mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-09-11 04:00:38 +00:00
Merge remote-tracking branch 'origin/master' into dshw/pr-deepseek-harness-deepseek-harness-2672
# Conflicts: # docs/event-producer-consumer.i18n.yaml # docs/event-producer-consumer.md # docs/event-producer-consumer.zh.md # packages/acp/acp/tests/harness.ts # packages/api/session-controller/README.i18n.yaml # packages/api/session-controller/README.md # packages/api/session-controller/README.zh.md # packages/api/session-controller/tests/commands-queue-attachment.host.spec.ts # packages/context/agent-instructions/tests/agent-instructions.e2e.ts # packages/fs/tool-fs/tests/harness.ts # packages/preset/agent-presets/tests/invariant.spec.ts # packages/preset/agent-presets/tests/mount.spec.ts # packages/preset/agent-presets/tests/remote.spec.ts # packages/test-support/agent-loop-testkit/package.json
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
||||
# after editing either side, bring the other along and re-record with:
|
||||
# pnpm run verify-translation-pairing --write python/sdk-runtime/README.md
|
||||
README.md: 050ae85d9b0a38b82a3c66a84c3d8f34e137be6c
|
||||
README.zh.md: 7066d7224752294c25b58cfe8fb6a94524a2013d
|
||||
README.md: fb7478f305015e60dafd23861ab6fd91f10757f3
|
||||
README.zh.md: 7c663aba8d387fb7b1048afe28d50faee7350303
|
||||
|
||||
@@ -19,7 +19,7 @@ Both carriers execute the same `dsh` grammar and shipped profiles, including the
|
||||
- `bundled_package_dir() -> Path` returns the installed module-data root and verifies its release metadata.
|
||||
- `bundled_runtime_path() -> Path` returns the current platform executable and verifies required sidecars.
|
||||
- `resolve_bundled_launch_args(mode=None) -> tuple[str, ...]` returns the executable argv by default. Explicit `mode="node"` or `DSH_RUNTIME_MODE=node` selects the repo-only Node carrier.
|
||||
- `main()` implements the installed `dsh` console command and rejects an absent or blank `DSH_HOME` before replacing the Python process.
|
||||
- `main()` implements the installed `dsh` console command and rejects an absent or blank `DSH_HOME`. On Windows it waits for the bundled process with inherited standard streams and forwards its exit status; on POSIX it replaces the Python process.
|
||||
|
||||
Unsupported platforms and missing executables or sidecars raise `FileNotFoundError` with the build and installation routes. Unknown runtime modes raise `ValueError`.
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ Wheel 会安装 `dsh` 控制台命令和 `deepseek_harness_runtime` Python 模
|
||||
- `bundled_package_dir() -> Path` 返回已安装模块数据根目录,并校验发布元数据。
|
||||
- `bundled_runtime_path() -> Path` 返回当前平台可执行程序,并校验必需伴随文件。
|
||||
- `resolve_bundled_launch_args(mode=None) -> tuple[str, ...]` 默认返回可执行程序 argv。显式 `mode="node"` 或 `DSH_RUNTIME_MODE=node` 会选择仅限仓库使用的 Node 载体。
|
||||
- `main()` 实现已安装的 `dsh` 控制台命令,并在替换 Python 进程前拒绝缺失或空白的 `DSH_HOME`。
|
||||
- `main()` 实现已安装的 `dsh` 控制台命令,并拒绝缺失或空白的 `DSH_HOME`。在 Windows 上,它让打包进程继承标准流,等待其结束并转发退出状态;在 POSIX 上,它替换 Python 进程。
|
||||
|
||||
不支持的平台以及缺失的可执行程序或伴随文件会抛出 `FileNotFoundError`,并指出构建与安装路径。未知运行时模式会抛出 `ValueError`。
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env node
|
||||
/** Private entry owned by the Python single-file runtime packaging. */
|
||||
|
||||
const selectorName = 'DSH_SUBPROCESS_RUNNER'
|
||||
const selection = process.env[selectorName]
|
||||
|
||||
if (selection === undefined) {
|
||||
const { runCli } = await import('@deepseek-ai/dsh/lib/bin.js')
|
||||
await runCli()
|
||||
} else {
|
||||
Reflect.deleteProperty(process.env, selectorName)
|
||||
const { runSelectedSubprocessRunner } = await import('@deepseek-ai/dsh-subprocess-local/runner')
|
||||
await runSelectedSubprocessRunner(selection)
|
||||
}
|
||||
@@ -24,6 +24,7 @@ from __future__ import annotations
|
||||
import os
|
||||
import platform
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
@@ -156,7 +157,7 @@ def _node_launch_args() -> tuple[str, str]:
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Execute the bundled dsh CLI with an explicitly selected Harness home."""
|
||||
"""Launch the CLI with explicit DSH_HOME; wait on Windows, replace the process on POSIX."""
|
||||
if not os.environ.get("DSH_HOME", "").strip():
|
||||
print(
|
||||
"dsh: the Python runtime command requires an explicit DSH_HOME; "
|
||||
@@ -165,6 +166,9 @@ def main() -> None:
|
||||
)
|
||||
raise SystemExit(2)
|
||||
argv = (*resolve_bundled_launch_args(), *sys.argv[1:])
|
||||
if sys.platform == "win32":
|
||||
# Windows CRT exec does not replace the process; wait and preserve the runtime status.
|
||||
raise SystemExit(subprocess.run(argv, env=os.environ).returncode)
|
||||
os.execvpe(argv[0], argv, os.environ)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user