@deepseek-ai/dsh-subprocess-local 0.2.1-alpha.1 → 0.2.1-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +2 -1
- package/README.zh.md +2 -1
- package/lib/index.js +5 -3
- package/locale/en.json +5 -0
- package/locale/zh.json +6 -0
- package/package.json +14 -12
package/README.i18n.yaml
CHANGED
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
en: e290ccc9b3c92c08
|
|
64
64
|
zh: d75d48f485447a74
|
|
65
65
|
/deepseek-ai-dsh-subprocess-local/known-limitations-and-deferred-work:
|
|
66
|
-
en:
|
|
67
|
-
zh:
|
|
66
|
+
en: aca923fe6b461acb
|
|
67
|
+
zh: ee19a96907134d85
|
|
68
68
|
/deepseek-ai-dsh-subprocess-local/known-limitations-and-deferred-work/dev-note:
|
|
69
69
|
en: e67f633dc6fe7773
|
|
70
70
|
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -149,7 +149,8 @@ These limits define when the provider is a poor fit or needs special operational
|
|
|
149
149
|
- **Native ownership has explicit host requirements** — Linux needs a readable user manager and `systemd-run --expand-environment=no`; older systemd versions use the warned PGID fallback. macOS always uses that fallback because no supported public persistent owner exists.
|
|
150
150
|
- **Native selection has bounded per-spawn costs** — Linux repeats the bootstrap entry, libc `execve`/`fcntl` bindings, live user manager, and literal-argv scope probe until it first succeeds; later eligible ordinary or terminal spawns recheck only the live user manager. Windows rechecks the runner entry, bindings, and current Job support before every ordinary spawn. Successful Linux deep-probe state and fallback-warning de-duplication persist for the provider lifetime. All probes finish before the user command can run, and child-process probes have a 5-second timeout. Each Linux launch creates a private request directory, checks unresolved scope establishment every 50 milliseconds, then exponentially backs off an established active scope to at most 5 seconds between queries; a Windows ordinary launch keeps one runner and IPC channel until the Job reports zero active processes. Target standard handles are inherited directly, with no named-pipe stdio or result files.
|
|
151
151
|
- **Windows Job inheritance has defined exclusions** — ordinary descendants inherit the Job by default, but breakaway processes are outside the guarantee. The target starts only after Job assignment; external termination of the runner in the narrow create-to-assignment interval can leave a suspended target behind.
|
|
152
|
-
- **Windows terminal signalling is console-wide** — SIGINT is delivered as a `\x03` Ctrl-C input write that
|
|
152
|
+
- **Windows terminal signalling is console-wide** — SIGINT is delivered as a `\x03` Ctrl-C input write that the console host turns into a console-wide CTRL_C event (on Windows that host is node-pty's bundled OpenConsole); SIGTSTP and SIGHUP are rejected as unavailable; a `taskkill` without `/F` does not terminate console processes, so the teardown TERM tier is a grace wait before the `/F` escalation. Windows readiness has no exact stdin-wait tier: the prompt-marker fast path compares the shell pid as the pseudo foreground group, and silence/timing tiers cover the rest.
|
|
153
|
+
- **Windows terminal allocation requires node-pty's bundled console host assets** — every Windows terminal is spawned with `useConptyDll: true`, so allocation resolves `conpty/conpty.dll` and `OpenConsole.exe` relative to node-pty's own addon; an asset that is missing or unpacked wrong makes `spawnTerminal` throw instead of falling back to the operating system console host. node-pty marks the option experimental, so a node-pty upgrade can change this behaviour. See the [bundled console host note](../../../.agents/notes/implemented/bug-fix/2026-09-28-pty-bundled-console-host.md).
|
|
153
154
|
- **Fallback terminal ownership remains observational** — on macOS or Linux without usable user-systemd, a child that reparents before any foreground-inspection snapshot or leaves the owned terminal session can escape the process-table scan. The local provider does not add a continuous process-table monitor; supported Linux native mode instead retains these descendants through scope membership.
|
|
154
155
|
- **In-process cleanup requires a JavaScript-observable exit** — direct `process.exit()`, default uncaught exceptions, and default unhandled rejections emit Node's synchronous `exit` event. The default OS disposition for an unhandled `SIGTERM`, `SIGINT`, or `SIGHUP` bypasses that event; an application covers those signals only by installing a handler that performs normal disposal or calls `process.exit()`. `SIGKILL`, fatal OOM, `process.abort()`, native crashes, power loss, and any failure that cannot run JavaScript require an external supervisor, container init, or equivalent OS owner.
|
|
155
156
|
- **The credential scrub is a name heuristic** — `*KEY*`/`*PASSWORD*`/`*SECRET*`/`*TOKEN*` only; differently named secrets (for example `*PASSPHRASE*`) pass through, and a whitelist for over-scrubbed variables is noted future work.
|
package/README.zh.md
CHANGED
|
@@ -149,7 +149,8 @@ spill 文件以 `0600` 权限、`O_EXCL` 与随机名称在 `0700` 每进程目
|
|
|
149
149
|
- **native ownership 有明确宿主要求**——Linux 需要可读的 user manager 与 `systemd-run --expand-environment=no`;旧版 systemd 使用带告警的 PGID fallback。macOS 因没有受支持的公开 persistent owner,始终使用该 fallback。
|
|
150
150
|
- **native 选择具有有界的每次 spawn 成本**——Linux 会重复检查 bootstrap 入口、libc `execve`/`fcntl` bindings、存活的 user manager 与 literal-argv scope 支持,直到这套完整探测首次成功;后续符合条件的普通命令或终端 spawn 只重新检查存活的 user manager。Windows 会在每次普通 spawn 前重新检查 runner 入口、bindings 与当前 Job 支持。Linux 深度探测的成功状态与 fallback 告警去重会在提供方生命周期内持续保留。所有探测都会在用户命令可能运行前完成,子进程探测的超时为 5 秒。每次 Linux 启动都会创建私有请求目录,以 50 毫秒间隔检查尚未确定的 scope 建立状态;scope 已建立且仍 active 后,查询间隔按指数增长,最多为 5 秒。Windows 普通命令会保留一个 runner 与一条 IPC 通道,直到 Job 报告活动进程数为零。目标会直接继承标准句柄,不使用 named-pipe stdio 或结果文件。
|
|
151
151
|
- **Windows Job inheritance 有明确排除项**——普通后代默认继承 Job,但 breakaway 进程不在保证范围。目标只在 Job 分配后启动;runner 若在 create-to-assignment 极窄区间遭外力终止,可能留下 suspended target。
|
|
152
|
-
- **Windows 终端信号是控制台级的**——SIGINT 以 `\x03` Ctrl-C
|
|
152
|
+
- **Windows 终端信号是控制台级的**——SIGINT 以 `\x03` Ctrl-C 输入写入投递,由控制台宿主(Windows 上为 node-pty 自带的 OpenConsole)转为控制台级 CTRL_C 事件;SIGTSTP 与 SIGHUP 被拒绝(不可用);不带 `/F` 的 `taskkill` 无法终止控制台进程,因此拆卸的 TERM 档是 `/F` 升级前的宽限等待。Windows 就绪没有精确的 stdin-wait 档:prompt-marker 快路径把 shell pid 作为伪前台进程组比较,其余由静默与计时档覆盖。
|
|
153
|
+
- **Windows 终端分配依赖 node-pty 自带的控制台宿主资产**——每个 Windows 终端都以 `useConptyDll: true` 启动,分配时按 node-pty 自身 addon 的相对位置解析 `conpty/conpty.dll` 与 `OpenConsole.exe`;资产缺失或解包错误会让 `spawnTerminal` 抛错,而不是回退到操作系统控制台宿主。node-pty 把该选项标为实验性,升级 node-pty 可能改变这一行为。见[自带控制台宿主说明](../../../.agents/notes/implemented/bug-fix/2026-09-28-pty-bundled-console-host.zh.md)。
|
|
153
154
|
- **fallback 终端 ownership 仍依赖观察**——在 macOS 或缺少可用 user-systemd 的 Linux 上,子进程如果在任何前台检查快照之前重新设定父进程,或离开自有终端会话,就可能逃出进程表扫描。本地提供方不会新增持续进程表监视器;受支持的 Linux native 模式改由 scope membership 持有这些后代。
|
|
154
155
|
- **进程内清理要求退出阶段仍能执行 JavaScript**——直接 `process.exit()`、默认未捕获异常和默认未处理 rejection 会发出 Node 同步 `exit` 事件。未安装 handler 时,`SIGTERM`、`SIGINT` 或 `SIGHUP` 的默认 OS 处置不会发出该事件;应用只有安装执行正常 dispose 或调用 `process.exit()` 的 handler 才能覆盖这些信号。`SIGKILL`、fatal OOM、`process.abort()`、native crash、断电,以及任何无法运行 JavaScript 的故障,都需要外部 supervisor、容器 init 或等价的 OS owner 负责。
|
|
155
156
|
- **凭据清除依赖名称启发式规则**——只匹配 `*KEY*`/`*PASSWORD*`/`*SECRET*`/`*TOKEN*`;名称不同的 secret(例如 `*PASSPHRASE*`)会继续传递,对误删变量引入白名单属于已记录的后续工作。
|
package/lib/index.js
CHANGED
|
@@ -1419,7 +1419,8 @@ var LocalSubprocessRuntime = class extends SubprocessRuntime {
|
|
|
1419
1419
|
const inspector = this.terminalInspector ?? createProcessInspector();
|
|
1420
1420
|
const containmentMode = this.selectContainmentMode("terminal");
|
|
1421
1421
|
const env = targetEnvironment(spec);
|
|
1422
|
-
const
|
|
1422
|
+
const platform = this.internals.platform ?? process.platform;
|
|
1423
|
+
const activity = prepareShellActivity(spec, env, platform);
|
|
1423
1424
|
const launch = activity === void 0 ? spec : {
|
|
1424
1425
|
...spec,
|
|
1425
1426
|
argv: activity.argv,
|
|
@@ -1433,7 +1434,8 @@ var LocalSubprocessRuntime = class extends SubprocessRuntime {
|
|
|
1433
1434
|
env: {
|
|
1434
1435
|
...activity?.env ?? env,
|
|
1435
1436
|
TERM: spec.terminalType
|
|
1436
|
-
}
|
|
1437
|
+
},
|
|
1438
|
+
...platform === "win32" ? { useConptyDll: true } : {}
|
|
1437
1439
|
};
|
|
1438
1440
|
let scope;
|
|
1439
1441
|
let terminal;
|
|
@@ -1460,7 +1462,7 @@ var LocalSubprocessRuntime = class extends SubprocessRuntime {
|
|
|
1460
1462
|
settled: directSettlement.promise,
|
|
1461
1463
|
signal: (signal) => signalLinuxDirectProcess(terminal.pid, () => process.kill(terminal.pid, signal))
|
|
1462
1464
|
});
|
|
1463
|
-
handle = new LocalTerminalHandle(terminal, inspector, spec.graceMs,
|
|
1465
|
+
handle = new LocalTerminalHandle(terminal, inspector, spec.graceMs, platform, owner, scope?.resolveOutcome, activity, () => {
|
|
1464
1466
|
this.terminals.delete(handle);
|
|
1465
1467
|
}, spec.shellActivity === true);
|
|
1466
1468
|
this.terminals.add(handle);
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-subprocess-local",
|
|
3
3
|
"description": "Local-subprocess implementation of the DeepSeek Harness subprocess seam",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.3",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,9 +27,11 @@
|
|
|
27
27
|
"./output": {
|
|
28
28
|
"types": "./lib/types/output.d.ts",
|
|
29
29
|
"default": "./lib/output.js"
|
|
30
|
-
}
|
|
30
|
+
},
|
|
31
|
+
"./locale/*.json": "./locale/*.json"
|
|
31
32
|
},
|
|
32
33
|
"files": [
|
|
34
|
+
"locale/*.json",
|
|
33
35
|
"lib/index.js",
|
|
34
36
|
"lib/runner.js",
|
|
35
37
|
"lib/runner-*.js",
|
|
@@ -39,21 +41,21 @@
|
|
|
39
41
|
],
|
|
40
42
|
"license": "MIT",
|
|
41
43
|
"peerDependencies": {
|
|
42
|
-
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.
|
|
43
|
-
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.
|
|
44
|
-
"@deepseek-ai/cordis": "~4.0.5-alpha.
|
|
44
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.3",
|
|
45
|
+
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.3",
|
|
46
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2"
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
49
|
+
"@deepseek-ai/dsh-lazy-require": "0.2.1-alpha.3",
|
|
50
|
+
"@deepseek-ai/dsh-win32-process": "0.2.1-alpha.3",
|
|
47
51
|
"koffi": "3.1.1",
|
|
48
|
-
"node-pty": "1.2.0-beta.15"
|
|
49
|
-
"@deepseek-ai/dsh-win32-process": "0.2.1-alpha.1",
|
|
50
|
-
"@deepseek-ai/dsh-lazy-require": "0.2.1-alpha.1"
|
|
52
|
+
"node-pty": "1.2.0-beta.15"
|
|
51
53
|
},
|
|
52
54
|
"devDependencies": {
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/
|
|
56
|
-
"@deepseek-ai/
|
|
55
|
+
"@deepseek-ai/dsh-loader-smoke": "0.2.1-alpha.3",
|
|
56
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.3",
|
|
57
|
+
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.3",
|
|
58
|
+
"@deepseek-ai/cordis": "~4.0.5-alpha.2"
|
|
57
59
|
},
|
|
58
60
|
"scripts": {
|
|
59
61
|
"postinstall": "node scripts/ensure-spawn-helper.mjs"
|