@deepseek-ai/dsh-terminal-bash 0.1.7-rc.1 → 0.2.0-rc.1

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 CHANGED
@@ -1,6 +1,91 @@
1
- # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
- # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
- # after editing either side, bring the other along and re-record with:
1
+ # Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
2
+ # section, a hash of its English and Chinese blocks outside code blocks and generated regions.
3
+ # After editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/terminal/terminal-bash/README.md
5
- README.md: 466a42f46844d16b85d8754df0bd910361e2e401
6
- README.zh.md: 7ca41883f6c807102c75b25e531187a7ab148cbf
5
+ /:
6
+ en: 7451cb97579aa088
7
+ zh: 836bff293fae7bd3
8
+ /deepseek-ai-dsh-terminal-bash:
9
+ en: 70eb464a6754f633
10
+ zh: f7ad67d8a9eb7195
11
+ /deepseek-ai-dsh-terminal-bash/summary:
12
+ en: b50ba02f6602a1fd
13
+ zh: 1c954a0e0999280d
14
+ /deepseek-ai-dsh-terminal-bash/table-of-contents:
15
+ en: d152484eb41ac6b4
16
+ zh: 09388d293f9be9cb
17
+ /deepseek-ai-dsh-terminal-bash/use-this-package:
18
+ en: 13e1b604a235290e
19
+ zh: 5292c92ffe20537e
20
+ /deepseek-ai-dsh-terminal-bash/use-this-package/when-to-choose-it:
21
+ en: f4304ced55e55d4f
22
+ zh: 739d7a16691e4cc0
23
+ /deepseek-ai-dsh-terminal-bash/use-this-package/composition:
24
+ en: 71449ef1985b2f1b
25
+ zh: 562e9b5ef73cd5e1
26
+ /deepseek-ai-dsh-terminal-bash/use-this-package/configuration:
27
+ en: 2a10fc681cee698d
28
+ zh: ac60c8918bae3c85
29
+ /deepseek-ai-dsh-terminal-bash/use-this-package/shell-dialects-and-readiness:
30
+ en: 2cab01d85f524e3d
31
+ zh: 0d00b3e399a935b1
32
+ /deepseek-ai-dsh-terminal-bash/use-this-package/sandboxing-and-safe-operation:
33
+ en: 39e0f0b429b024a7
34
+ zh: 440171193664d13b
35
+ /deepseek-ai-dsh-terminal-bash/use-this-package/observable-outcomes-and-failures:
36
+ en: 71726aa75e303acd
37
+ zh: 4dc311eeed75fa09
38
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation:
39
+ en: 97f4f07114f5a995
40
+ zh: d30b07058a3103c7
41
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation/design-concept:
42
+ en: 5808eba7c8ff1993
43
+ zh: c85f1ab0a869c177
44
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation/source-map:
45
+ en: 9a525f7a7228a09b
46
+ zh: d57537edfacc9f8b
47
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation/readiness-model:
48
+ en: a768d621c2ea2585
49
+ zh: 8213317da48766e3
50
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation/send-cancellation-and-teardown:
51
+ en: 025325caab883327
52
+ zh: 1decfdea61e95ae1
53
+ /deepseek-ai-dsh-terminal-bash/understand-the-implementation/sandbox-mode-fence:
54
+ en: a88b693ec539ac28
55
+ zh: a309bbe671166027
56
+ /deepseek-ai-dsh-terminal-bash/further-exploration:
57
+ en: 648ee87712ed5c66
58
+ zh: 6444df8b1fabbc17
59
+ /deepseek-ai-dsh-terminal-bash/model-experience:
60
+ en: 215e7ba838619b7b
61
+ zh: a311da3843709f90
62
+ /deepseek-ai-dsh-terminal-bash/model-experience/indirect-consumer:
63
+ en: a601a3c4f5b848cd
64
+ zh: ec617f79f706aaa1
65
+ /deepseek-ai-dsh-terminal-bash/model-experience/indirect-consumer/what-the-model-sees:
66
+ en: ffd1d7a3a65ce703
67
+ zh: 6e892fb3aa6ac293
68
+ /deepseek-ai-dsh-terminal-bash/model-experience/indirect-consumer/token-effect:
69
+ en: 41bd9bec80350376
70
+ zh: bdd2db111e86282f
71
+ /deepseek-ai-dsh-terminal-bash/model-experience/indirect-consumer/kv-cache-effect:
72
+ en: 4ded19a792b5b94a
73
+ zh: 82029b44250df6a0
74
+ /deepseek-ai-dsh-terminal-bash/model-experience/sandbox-policy-context:
75
+ en: 0342db1221081250
76
+ zh: 6a510f03982e2d56
77
+ /deepseek-ai-dsh-terminal-bash/model-experience/sandbox-policy-context/what-the-model-sees:
78
+ en: d9cc7077b03fa969
79
+ zh: 91af4f3451603759
80
+ /deepseek-ai-dsh-terminal-bash/model-experience/sandbox-policy-context/token-effect:
81
+ en: d3b7f8f648fd0aa4
82
+ zh: 954f662ddafaedbb
83
+ /deepseek-ai-dsh-terminal-bash/model-experience/sandbox-policy-context/kv-cache-effect:
84
+ en: 5e4dc482b93e2b06
85
+ zh: 5b56af99bcfd74ed
86
+ /deepseek-ai-dsh-terminal-bash/known-limitations-and-deferred-work:
87
+ en: 2dc221de0d3a76a7
88
+ zh: 822cef044e765459
89
+ /deepseek-ai-dsh-terminal-bash/known-limitations-and-deferred-work/dev-note:
90
+ en: 979c4600ed8a81d5
91
+ zh: 4016ea615f638036
package/README.md CHANGED
@@ -57,11 +57,11 @@ Mount the terminal service, a subprocess provider, the sandbox and policy servic
57
57
  | `timeoutMs` | `30000` | Absolute bound on one send wait |
58
58
  | `disposeGraceMs` | `3000` | Grace before teardown escalates to `SIGKILL` |
59
59
 
60
- The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-terminal-bash) is the exhaustive source for every field, including the readiness timings (`pollIntervalMs`, `exactProbeAfterMs`, `idleSilenceMs`, `handoffGraceMs`), terminal size (`rows`, `cols`), and scrollback bounds (`scrollbackLines`, `scrollbackMaxBytes`).
60
+ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-terminal-bash) is the exhaustive source for every field, including the readiness timings (`pollIntervalMs`, `exactProbeAfterMs`, `idleSilenceMs`, `handoffGraceMs`, `promptTailGraceMs`), terminal size (`rows`, `cols`), and scrollback bounds (`scrollbackLines`, `scrollbackMaxBytes`).
61
61
 
62
62
  ### Shell dialects and readiness
63
63
 
64
- Both dialects expose the same readiness contract, so consumers are dialect-agnostic. A send settles when the shell is ready again: after the controlled prompt is verified, after the foreground process group provably waits on stdin (Linux), after output silence (`inferred_idle`), or at the absolute `timeoutMs`. An `inferred_idle` or `timeout` result does not prove the foreground command exited.
64
+ Both dialects expose the same readiness contract, so consumers are dialect-agnostic. A send settles when the shell is ready again: after the controlled prompt is verified, after the foreground process group provably waits on stdin (Linux), after output silence (`inferred_idle`), or at the absolute `timeoutMs`. A prompt marker whose printable tail has not arrived yet holds the send on the exact path for `promptTailGraceMs` beyond `idleSilenceMs + handoffGraceMs`, because the marker and its tail are written by the same prompt render. An `inferred_idle` or `timeout` result does not prove the foreground command exited.
65
65
 
66
66
  ### Sandboxing and safe operation
67
67
 
package/README.zh.md CHANGED
@@ -57,11 +57,11 @@ kind: "package-reference"
57
57
  | `timeoutMs` | `30000` | 一次发送等待的绝对上限 |
58
58
  | `disposeGraceMs` | `3000` | 清理升级到 `SIGKILL` 前的宽限时间 |
59
59
 
60
- 生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-terminal-bash)是每个字段的穷尽式真源,包括就绪计时(`pollIntervalMs`、`exactProbeAfterMs`、`idleSilenceMs`、`handoffGraceMs`)、终端尺寸(`rows`、`cols`)与 scrollback 上限(`scrollbackLines`、`scrollbackMaxBytes`)。
60
+ 生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-terminal-bash)是每个字段的穷尽式真源,包括就绪计时(`pollIntervalMs`、`exactProbeAfterMs`、`idleSilenceMs`、`handoffGraceMs`、`promptTailGraceMs`)、终端尺寸(`rows`、`cols`)与 scrollback 上限(`scrollbackLines`、`scrollbackMaxBytes`)。
61
61
 
62
62
  ### shell 方言与就绪
63
63
 
64
- 两种方言暴露相同的就绪约定,因此消费方与方言无关。当 shell 再次就绪时发送即结算:受控提示符被验证之后、前台进程组被证明在等待 stdin(Linux)之后、输出静默(`inferred_idle`)之后,或到达绝对 `timeoutMs`。`inferred_idle` 或 `timeout` 结果并不证明前台命令已退出。
64
+ 两种方言暴露相同的就绪约定,因此消费方与方言无关。当 shell 再次就绪时发送即结算:受控提示符被验证之后、前台进程组被证明在等待 stdin(Linux)之后、输出静默(`inferred_idle`)之后,或到达绝对 `timeoutMs`。若提示符标记已到达而其可打印尾部尚未到达,send 会在 `idleSilenceMs + handoffGraceMs` 之外继续等待 `promptTailGraceMs`,因为标记与尾部由同一次提示符渲染写出。`inferred_idle` 或 `timeout` 结果并不证明前台命令已退出。
65
65
 
66
66
  ### 沙箱与安全运行
67
67
 
package/lib/index.js CHANGED
@@ -48,11 +48,14 @@ const Config = z.object({
48
48
  exactProbeAfterMs: z.number().default(150),
49
49
  idleSilenceMs: z.number().default(3e3),
50
50
  handoffGraceMs: z.number().default(500),
51
+ promptTailGraceMs: z.number().default(0),
51
52
  timeoutMs: z.number().default(3e4),
52
53
  disposeGraceMs: z.number().default(3e3)
53
54
  });
54
55
  /**
55
- * Assert every effective numeric config field is a positive safe integer and bounds compose.
56
+ * Assert every effective numeric config field is a positive safe integer — except
57
+ * `promptTailGraceMs`, whose zero is the documented "no extension" value — and that bounds
58
+ * compose.
56
59
  * @param config - Schemastery-resolved plugin configuration.
57
60
  * @returns Narrows the input to the fully resolved configuration.
58
61
  */
@@ -60,9 +63,14 @@ function validateConfig(config) {
60
63
  const resolved = config;
61
64
  if (resolved.backendType.length === 0) throw new Error("terminal-bash: backendType must be non-empty");
62
65
  if (resolved.shellPath.length === 0) throw new Error("terminal-bash: shellPath must be non-empty");
63
- for (const [name, value] of Object.entries(resolved)) if (typeof value === "number" && (!Number.isSafeInteger(value) || value <= 0)) throw new Error(`terminal-bash: ${name} must be a positive safe integer`);
66
+ for (const [name, value] of Object.entries(resolved)) {
67
+ if (name === "promptTailGraceMs") continue;
68
+ if (typeof value === "number" && (!Number.isSafeInteger(value) || value <= 0)) throw new Error(`terminal-bash: ${name} must be a positive safe integer`);
69
+ }
70
+ if (typeof resolved.promptTailGraceMs === "number" && (!Number.isSafeInteger(resolved.promptTailGraceMs) || resolved.promptTailGraceMs < 0)) throw new Error("terminal-bash: promptTailGraceMs must be a non-negative safe integer");
64
71
  if (resolved.maxReadBytes > resolved.scrollbackMaxBytes) throw new Error("terminal-bash: maxReadBytes must not exceed scrollbackMaxBytes");
65
72
  if (resolved.handoffGraceMs < resolved.pollIntervalMs) throw new Error("terminal-bash: handoffGraceMs must be at least pollIntervalMs so one readiness poll runs inside the grace window");
73
+ if (resolved.promptTailGraceMs !== 0 && resolved.promptTailGraceMs < resolved.pollIntervalMs) throw new Error("terminal-bash: promptTailGraceMs must be zero or at least pollIntervalMs so a nonzero tolerance contains one readiness poll");
66
74
  }
67
75
  /** Exact printable prompt emitted after the private marker. */
68
76
  const CONTROLLED_PROMPT = "dsh> ";
@@ -714,7 +722,8 @@ var LocalPtySession = class {
714
722
  return;
715
723
  }
716
724
  const handoffGrace = this.promptSeen ? this.config.handoffGraceMs : 0;
717
- if (startupHasOutput && idleFor >= this.config.idleSilenceMs + handoffGrace) this.settleActive("inferred_idle");
725
+ const tailGrace = this.promptSeen && !this.promptTextSeen && "dsh> ".startsWith(this.promptTail) ? this.config.promptTailGraceMs : 0;
726
+ if (startupHasOutput && idleFor >= this.config.idleSilenceMs + handoffGrace + tailGrace) this.settleActive("inferred_idle");
718
727
  } catch (error) {
719
728
  if (this.protocolWorkPending()) await this.drainTerminalProtocol();
720
729
  if (this.active === operation && !this.closing && this.interrupting !== operation) this.failActive(error);
@@ -33,6 +33,15 @@ export interface Config {
33
33
  * regain the foreground before `inferred_idle` settles; at least one `pollIntervalMs`.
34
34
  */
35
35
  handoffGraceMs?: number;
36
+ /**
37
+ * Extra wait beyond `idleSilenceMs` and `handoffGraceMs`, once a prompt marker was seen but
38
+ * its printable tail has not arrived, before `inferred_idle` settles. The marker is written
39
+ * by the shell's own prompt function and the tail by the same render, so a missing tail is a
40
+ * delivery delay on a contended host rather than an absent prompt. Zero keeps the bound at
41
+ * `idleSilenceMs + handoffGraceMs`; any other value covers at least one `pollIntervalMs`, so a
42
+ * nonzero tolerance always contains a readiness poll.
43
+ */
44
+ promptTailGraceMs?: number;
36
45
  /** Absolute bound for one send and the complete pwsh startup sequence. */
37
46
  timeoutMs?: number;
38
47
  /** Grace before teardown escalates to `SIGKILL`. */
@@ -63,7 +72,9 @@ export declare function resolveConfig(config: Config): ResolvedConfig;
63
72
  /** Schemastery config exposed by the plugin. */
64
73
  export declare const Config: z<Config>;
65
74
  /**
66
- * Assert every effective numeric config field is a positive safe integer and bounds compose.
75
+ * Assert every effective numeric config field is a positive safe integer — except
76
+ * `promptTailGraceMs`, whose zero is the documented "no extension" value — and that bounds
77
+ * compose.
67
78
  * @param config - Schemastery-resolved plugin configuration.
68
79
  * @returns Narrows the input to the fully resolved configuration.
69
80
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-terminal-bash",
3
3
  "description": "Persistent shell PTY backend over the DeepSeek Harness subprocess terminal primitive",
4
- "version": "0.1.7-rc.1",
4
+ "version": "0.2.0-rc.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -27,30 +27,30 @@
27
27
  ],
28
28
  "license": "MIT",
29
29
  "peerDependencies": {
30
- "@deepseek-ai/dsh-agent": "0.1.7-rc.1",
31
- "@deepseek-ai/dsh-terminal": "0.1.7-rc.1",
32
- "@deepseek-ai/dsh-sandbox": "0.1.7-rc.1",
33
- "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.1",
34
- "@deepseek-ai/dsh-session": "0.1.7-rc.1",
35
- "@deepseek-ai/dsh-subprocess": "0.1.7-rc.1",
36
- "@deepseek-ai/cordis": "~4.0.4",
37
- "@deepseek-ai/dsh-session-projection": "0.1.7-rc.1"
30
+ "@deepseek-ai/dsh-agent": "0.2.0-rc.1",
31
+ "@deepseek-ai/dsh-terminal": "0.2.0-rc.1",
32
+ "@deepseek-ai/dsh-sandbox": "0.2.0-rc.1",
33
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.1",
34
+ "@deepseek-ai/dsh-session": "0.2.0-rc.1",
35
+ "@deepseek-ai/dsh-subprocess": "0.2.0-rc.1",
36
+ "@deepseek-ai/dsh-session-projection": "0.2.0-rc.1",
37
+ "@deepseek-ai/cordis": "~4.0.4"
38
38
  },
39
39
  "dependencies": {
40
40
  "@xterm/headless": "^6.0.0",
41
- "@deepseek-ai/dsh-pwsh-local": "0.1.7-rc.1",
42
- "@deepseek-ai/dsh-lazy-require": "0.1.7-rc.1",
41
+ "@deepseek-ai/dsh-lazy-require": "0.2.0-rc.1",
42
+ "@deepseek-ai/dsh-pwsh-local": "0.2.0-rc.1",
43
43
  "@deepseek-ai/schemastery": "~3.18.4"
44
44
  },
45
45
  "devDependencies": {
46
- "@deepseek-ai/dsh-agent": "0.1.7-rc.1",
47
- "@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.1",
48
- "@deepseek-ai/dsh-terminal": "0.1.7-rc.1",
49
- "@deepseek-ai/dsh-sandbox-policy": "0.1.7-rc.1",
50
- "@deepseek-ai/dsh-sandbox": "0.1.7-rc.1",
51
- "@deepseek-ai/dsh-session": "0.1.7-rc.1",
52
- "@deepseek-ai/dsh-subprocess": "0.1.7-rc.1",
53
- "@deepseek-ai/dsh-subprocess-local": "0.1.7-rc.1",
46
+ "@deepseek-ai/dsh-agent": "0.2.0-rc.1",
47
+ "@deepseek-ai/dsh-terminal": "0.2.0-rc.1",
48
+ "@deepseek-ai/dsh-agent-loop-testkit": "0.2.0-rc.1",
49
+ "@deepseek-ai/dsh-sandbox": "0.2.0-rc.1",
50
+ "@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.1",
51
+ "@deepseek-ai/dsh-session": "0.2.0-rc.1",
52
+ "@deepseek-ai/dsh-subprocess-local": "0.2.0-rc.1",
53
+ "@deepseek-ai/dsh-subprocess": "0.2.0-rc.1",
54
54
  "@deepseek-ai/cordis": "~4.0.4"
55
55
  }
56
56
  }