@songtonyli/dsh-cli 0.1.96 → 0.1.98

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.
Files changed (30) hide show
  1. package/README.md +1 -1
  2. package/bin/dsh.mjs +1 -1
  3. package/node_modules/@babel/runtime/helpers/asyncIterator.js +1 -1
  4. package/node_modules/@babel/runtime/helpers/esm/asyncIterator.js +1 -1
  5. package/node_modules/@babel/runtime/package.json +1 -1
  6. package/node_modules/@deepseek-ai/dsh-client-modules/lib/index.js +1 -1
  7. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  8. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.i18n.yaml +2 -2
  9. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.md +1 -1
  10. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/README.zh.md +1 -1
  11. package/node_modules/@deepseek-ai/dsh-ptc-runtime-node/lib/index.js +41 -16
  12. package/node_modules/@deepseek-ai/dsh-sandbox/README.i18n.yaml +5 -2
  13. package/node_modules/@deepseek-ai/dsh-sandbox/README.md +4 -0
  14. package/node_modules/@deepseek-ai/dsh-sandbox/README.zh.md +4 -0
  15. package/node_modules/@deepseek-ai/dsh-sandbox/lib/index.js +23 -3
  16. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.i18n.yaml +17 -14
  17. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.md +12 -6
  18. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/README.zh.md +12 -6
  19. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/lib/exec-shim.js +3 -1
  20. package/node_modules/@deepseek-ai/dsh-sandbox-apple-container/lib/index.js +54 -9
  21. package/node_modules/@deepseek-ai/dsh-sandbox-local/README.i18n.yaml +2 -2
  22. package/node_modules/@deepseek-ai/dsh-sandbox-local/README.md +2 -0
  23. package/node_modules/@deepseek-ai/dsh-sandbox-local/README.zh.md +2 -0
  24. package/node_modules/@deepseek-ai/dsh-sandbox-local/lib/index.js +74 -18
  25. package/node_modules/@deepseek-ai/dsh-tool-cordis/lib/types/api-catalog.js +11 -1
  26. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +4 -4
  27. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +5 -3
  28. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +5 -3
  29. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +5563 -5386
  30. package/package.json +2 -2
@@ -6,7 +6,7 @@ import { Service } from "@deepseek-ai/cordis";
6
6
  import z from "@deepseek-ai/schemastery";
7
7
  import { z as z$1 } from "zod";
8
8
  import { CommandDefinitionId } from "@deepseek-ai/dsh-commands/brand";
9
- import { SandboxUnavailableError, canonicalPath, nameGlobMatcher } from "@deepseek-ai/dsh-sandbox";
9
+ import { SandboxUnavailableError, canonicalPath, nameGlobMatcher, writableRoots } from "@deepseek-ai/dsh-sandbox";
10
10
  import { LocalSandboxProvider } from "@deepseek-ai/dsh-sandbox-local";
11
11
  import { createHash } from "node:crypto";
12
12
  import { mkdir, readdir, rm } from "node:fs/promises";
@@ -450,7 +450,9 @@ function setSandboxBackend(session, backend) {
450
450
  * local platform chain, while `container` runs the argv through an exec shim
451
451
  * inside a Linux container VM that bind-mounts the workspace at its own
452
452
  * absolute path (read-only under `read-only`). Host file effects stay inside
453
- * the workspace, and the guest cannot read unmounted host paths.
453
+ * the workspace, and the guest cannot read unmounted host paths. A host-bound
454
+ * execution, which the guest cannot run, confines in place under the local
455
+ * Seatbelt chain with a read fence instead.
454
456
  *
455
457
  * Each session's backend is the last `sandbox/backend` event in its log,
456
458
  * otherwise the configured default; the shared `/sandbox` command reports and
@@ -506,6 +508,11 @@ const DEFAULT_HIDDEN_FILES = [
506
508
  ".netrc",
507
509
  ".git-credentials"
508
510
  ];
511
+ /**
512
+ * Host directories whose file contents host-bound executions of container
513
+ * sessions cannot read by default: user homes and attached volumes.
514
+ */
515
+ const DEFAULT_HOST_BOUND_UNREADABLE_ROOTS = ["/Users", "/Volumes"];
509
516
  /** Stderr text of a write the read-only workspace mount refused. */
510
517
  const CONTAINER_DENIAL_SIGNATURES = ["read-only file system"];
511
518
  /** The shim's own failure line, emitted only when the command never started. */
@@ -571,7 +578,8 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
571
578
  protectedPaths: z.array(z.string()).default([".git"]),
572
579
  hiddenFiles: z.array(z.string()).default([...DEFAULT_HIDDEN_FILES]),
573
580
  hiddenFilesMaxDepth: z.natural().default(8),
574
- hiddenFilesSkipDirs: z.array(z.string()).default(["node_modules", ".git"])
581
+ hiddenFilesSkipDirs: z.array(z.string()).default(["node_modules", ".git"]),
582
+ hostBoundUnreadableRoots: z.array(z.string()).default([...DEFAULT_HOST_BOUND_UNREADABLE_ROOTS])
575
583
  })]);
576
584
  static inject = ["sessions", "sessionProjections"];
577
585
  /** The backend for sessions without a recorded choice, after `auto` resolution. */
@@ -583,6 +591,7 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
583
591
  envDenylist;
584
592
  readOnlyMounts;
585
593
  hiddenFiles;
594
+ hostBoundUnreadableRoots;
586
595
  runtime;
587
596
  pool;
588
597
  /** Reader for the `sandboxBackend` projection, registered during activation. */
@@ -615,6 +624,9 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
615
624
  const protectedPaths = config.protectedPaths;
616
625
  if (protectedPaths.some((path) => path === "" || isAbsolute(path) || path.includes(",") || path.split(/[\\/]/u).includes(".."))) throw new Error("sandbox-apple-container: protectedPaths entries must be workspace-relative paths without `..` or a comma");
617
626
  this.hiddenFiles = config.hiddenFiles;
627
+ const unreadable = config.hostBoundUnreadableRoots;
628
+ if (unreadable.some((path) => !isAbsolute(path))) throw new Error("sandbox-apple-container: hostBoundUnreadableRoots entries must be absolute paths");
629
+ this.hostBoundUnreadableRoots = [...new Set(unreadable.map(canonicalPath))];
618
630
  this.runtime = new ContainerRuntime({
619
631
  executable: this.executable,
620
632
  image: this.image,
@@ -727,6 +739,35 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
727
739
  };
728
740
  }
729
741
  /**
742
+ * Confine a host-bound execution in place. The local backend wraps it like
743
+ * any other call. The container guest cannot run host executables or receive
744
+ * descriptors beyond stdio, so the container backend confines it with the
745
+ * local Seatbelt chain under the policy's write rules and a read fence: file
746
+ * contents under `hostBoundUnreadableRoots` stay unreadable except the read
747
+ * scope, the policy's writable roots, and the runtime paths, and hidden files
748
+ * stay unreadable everywhere. Host paths outside those roots stay readable.
749
+ * @param argv - the exact argv the caller is about to spawn.
750
+ * @param policy - the file-effect policy this execution runs under.
751
+ * @param execution - the runtime paths the process must read.
752
+ * @param signal - cancellation before policy resolution.
753
+ * @returns the wrapped argv; a container session whose local chain is not
754
+ * Seatbelt fails closed with `SANDBOX_UNSUPPORTED_POLICY`.
755
+ */
756
+ async confineHostBound(argv, policy, execution, signal) {
757
+ signal?.throwIfAborted();
758
+ if (this.policyBackend(policy) === "local") return super.confine(argv, policy, signal);
759
+ const readable = [
760
+ ...this.containerReadRoots(policy),
761
+ ...writableRoots(policy),
762
+ ...execution.runtimePaths
763
+ ];
764
+ return this.confineWithReadFence(argv, policy, {
765
+ deniedRoots: this.hostBoundUnreadableRoots,
766
+ readableRoots: [...new Set(readable.map(canonicalPath))],
767
+ hiddenNames: this.hiddenFiles
768
+ }, signal);
769
+ }
770
+ /**
730
771
  * Tells the user that `danger-full-access` leaves the container.
731
772
  * @param policy - the calling session's resolved policy.
732
773
  * @param target - the wider mode the call asks for.
@@ -749,14 +790,18 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
749
790
  readScope(policy) {
750
791
  if (policy.mode === "danger-full-access" || this.policyBackend(policy) === "local") return void 0;
751
792
  return {
752
- roots: [...new Set([
753
- policy.workspaceRoot,
754
- canonicalPath(policy.workspaceRoot),
755
- ...this.readOnlyMounts
756
- ])],
793
+ roots: this.containerReadRoots(policy),
757
794
  hiddenNames: this.hiddenFiles
758
795
  };
759
796
  }
797
+ /** The host directories a container session's guest can read: the workspace as spelled and canonical, and the extra mounts. */
798
+ containerReadRoots(policy) {
799
+ return [...new Set([
800
+ policy.workspaceRoot,
801
+ canonicalPath(policy.workspaceRoot),
802
+ ...this.readOnlyMounts
803
+ ])];
804
+ }
760
805
  /** The backend of the session a policy names; agentless and unknown sessions use the default. */
761
806
  policyBackend(policy) {
762
807
  return this.backendFor(policy.sessionId === void 0 ? void 0 : this.ctx.sessions.get(policy.sessionId));
@@ -780,4 +825,4 @@ var AppleContainerSandboxProvider = class extends LocalSandboxProvider {
780
825
  }
781
826
  };
782
827
  //#endregion
783
- export { AppleContainerSandboxProvider, AppleContainerSandboxProvider as default, DEFAULT_ENV_DENYLIST, DEFAULT_HIDDEN_FILES, SANDBOX_BACKENDS, containerSupported, executableResolves, isSandboxBackend, resolveBackend, setSandboxBackend, shimInvocation };
828
+ export { AppleContainerSandboxProvider, AppleContainerSandboxProvider as default, DEFAULT_ENV_DENYLIST, DEFAULT_HIDDEN_FILES, DEFAULT_HOST_BOUND_UNREADABLE_ROOTS, SANDBOX_BACKENDS, containerSupported, executableResolves, isSandboxBackend, resolveBackend, setSandboxBackend, shimInvocation };
@@ -36,8 +36,8 @@
36
36
  en: f0c44248c2ca6acc
37
37
  zh: 554e9f706671d222
38
38
  /deepseek-ai-dsh-sandbox-local/understand-the-implementation/platform-profiles:
39
- en: 008967ee30fbbe46
40
- zh: 9e5c6a3e97851a69
39
+ en: ed15f305683568b8
40
+ zh: 6f34d5433a2fa9c5
41
41
  /deepseek-ai-dsh-sandbox-local/understand-the-implementation/denial-and-runner-failure-dialects:
42
42
  en: 62adfc9229c656cc
43
43
  zh: 11b1534b6d61e5de
@@ -80,6 +80,8 @@ The `@deepseek-ai/node-addon-system/landlock-run` API supplies the platform laun
80
80
 
81
81
  The Seatbelt profile is allow-default with `(deny file-write*)` plus write allow-lists derived from the shared `writableRoots` helper, so exactly the mode's promised file effects are governed; every root is canonicalized because Seatbelt matches resolved paths (`/tmp` IS `/private/tmp`).
82
82
 
83
+ A subclass can add a read fence through the protected `confineWithReadFence`: the profile then denies `file-read-data` under the fence's denied roots, allows it again under its readable roots, and denies it for files whose name matches a hidden-name glob. Seatbelt applies the last matching rule, so the forms follow that order. Metadata reads stay allowed. Resolved-path matching keeps symlinks and firmlinked `/System/Volumes/Data` spellings inside the fence, and Seatbelt refuses a new hard link to a file the fence denies. Only the Seatbelt rung expresses a fence; another selected runner or a configured `runnerCommand` fails closed with `SANDBOX_UNSUPPORTED_POLICY`. The [Apple container backend](../sandbox-apple-container/README.md) uses it for host-bound executions.
84
+
83
85
  The Windows rung keeps one deterministic write SID and standing ACE per workspace, while every live session/workspace pair gets a random private temp directory with a distinct SID and revocable ACE — sessions sharing a workspace share its intended write authority without inheriting one another's temp authority. A fresh provider always chooses a new temp path and SID, so crash residue cannot block or authorize a resumed session. The rung reports `partial` enforcement because NTFS hard links alias one file object across paths, reads stay unconfined, and a tree another AppContainer tool has ACL'd with a package SID is unreadable to the Low-integrity child.
84
86
 
85
87
  With the built-in Windows runner and a skill registry, this provider registers the [ACL diagnosis skill](../sandbox-windows-acl/README.md#failures-and-recovery). An operator-supplied `runnerCommand` does not register it; provider disposal removes the skill and its extracted resources.
@@ -80,6 +80,8 @@ bwrap profile 组合只读宿主根目录、全新 `/dev` 与私有 PID 命名
80
80
 
81
81
  Seatbelt profile 默认允许,带 `(deny file-write*)` 与来自共享 `writableRoots` 辅助函数的写入 allow-list,因此恰好管辖模式承诺的文件操作;每个根目录都经过规范化,因为 Seatbelt 匹配解析后的路径(`/tmp` 就是 `/private/tmp`)。
82
82
 
83
+ 子类可以通过受保护的 `confineWithReadFence` 添加读取围栏:profile 随后在围栏的拒绝根目录下拒绝 `file-read-data`,在其可读根目录下重新允许,并对名称匹配隐藏名 glob 的文件拒绝读取。Seatbelt 采用最后一条匹配规则,因此这些形式按此顺序排列。元数据读取仍然允许。按解析后路径匹配,使符号链接以及经 firmlink 的 `/System/Volumes/Data` 写法都留在围栏之内,Seatbelt 也会拒绝为围栏所拒绝的文件新建硬链接。只有 Seatbelt 档能表达围栏;选中的其他 runner 或配置的 `runnerCommand` 会以 `SANDBOX_UNSUPPORTED_POLICY` 故障关闭。[Apple container 后端](../sandbox-apple-container/README.zh.md)用它处理宿主机绑定执行。
84
+
83
85
  Windows 档为每个工作区保留一个确定性写入 SID 和常驻 ACE,同时为每个活跃的会话/工作区对分配一个随机私有临时目录,以及不同的 SID 和可撤销 ACE——共享工作区的会话共享其预期写权限,却不会继承彼此的临时目录权限。新的提供方总会选择新的临时路径和 SID,因此崩溃残留既无法阻止恢复的会话,也无法向其授权。该档报告 `partial` 强制执行,因为 NTFS 硬链接会把同一文件对象别名为多个路径、读取仍不受限,且被其他 AppContainer 工具以包 SID 标记过的目录树对 Low 完整性子进程不可读。
84
86
 
85
87
  当内置 Windows runner 与技能注册表同时可用时,此提供方会注册 [ACL 诊断技能](../sandbox-windows-acl/README.zh.md#failures-and-recovery)。自定义 `runnerCommand` 不注册该技能;提供方释放时移除技能及其提取的资源。
@@ -50,9 +50,41 @@ function landlockProfileArgs(policy) {
50
50
  readWrite
51
51
  });
52
52
  }
53
- /** Quote one path as an SBPL string literal. */
54
- function sbplString(path) {
55
- return `"${path.replaceAll("\\", String.raw`\\`).replaceAll("\"", String.raw`\"`)}"`;
53
+ /** Quote one path or regular expression as an SBPL string literal. */
54
+ function sbplString(text) {
55
+ return `"${text.replaceAll("\\", String.raw`\\`).replaceAll("\"", String.raw`\"`)}"`;
56
+ }
57
+ /**
58
+ * Translate a file-name glob into an SBPL regular expression for the last
59
+ * path component, matching `nameGlobMatcher` for ASCII names. An empty glob
60
+ * or one containing `/` matches no file name and yields no expression.
61
+ * @param glob - one hidden-name glob.
62
+ * @returns the expression, or `undefined` when the glob cannot match a name.
63
+ */
64
+ function hiddenNameRegex(glob) {
65
+ if (glob === "" || glob.includes("/")) return void 0;
66
+ let body = "";
67
+ for (const char of glob) if (char === "*") body += "[^/]*";
68
+ else if (/^[A-Za-z]$/u.test(char)) body += `[${char.toLowerCase()}${char.toUpperCase()}]`;
69
+ else if (char === "^" || char === "\\") body += `[\\${char}]`;
70
+ else body += `[${char}]`;
71
+ return `/${body}$`;
72
+ }
73
+ /**
74
+ * The SBPL forms of one read fence, in the order Seatbelt's last-match rule
75
+ * needs: the denial, the readable exceptions, then hidden names.
76
+ * @param fence - the restriction to express.
77
+ * @returns forms appended after the write rules.
78
+ */
79
+ function readFenceForms(fence) {
80
+ const forms = [];
81
+ if (fence.deniedRoots.length > 0) {
82
+ forms.push(`(deny file-read-data ${fence.deniedRoots.map((root) => `(subpath ${sbplString(root)})`).join(" ")})`);
83
+ if (fence.readableRoots.length > 0) forms.push(`(allow file-read-data ${fence.readableRoots.map((root) => `(subpath ${sbplString(root)})`).join(" ")})`);
84
+ }
85
+ const hidden = fence.hiddenNames.map(hiddenNameRegex).filter((regex) => regex !== void 0);
86
+ if (hidden.length > 0) forms.push(`(deny file-read-data ${hidden.map((regex) => `(regex ${sbplString(regex)})`).join(" ")})`);
87
+ return forms;
56
88
  }
57
89
  /**
58
90
  * Build the sandbox-exec arguments and SBPL profile for one policy. The
@@ -62,9 +94,10 @@ function sbplString(path) {
62
94
  * (`@deepseek-ai/dsh-fs-sandbox`) can never drift apart; the helper adds the
63
95
  * documented Seatbelt temp areas.
64
96
  * @param policy - file-effect policy to express as an SBPL profile.
97
+ * @param fence - optional read restriction appended after the write rules.
65
98
  * @returns sandbox-exec arguments before the trailing separator and command argv.
66
99
  */
67
- function seatbeltProfileArgs(policy) {
100
+ function seatbeltProfileArgs(policy, fence) {
68
101
  const forms = [
69
102
  "(version 1)",
70
103
  "(allow default)",
@@ -73,6 +106,7 @@ function seatbeltProfileArgs(policy) {
73
106
  ];
74
107
  const roots = writableRoots(policy);
75
108
  if (roots.length > 0) forms.push(`(allow file-write* ${roots.map((root) => `(subpath ${sbplString(root)})`).join(" ")})`);
109
+ if (fence !== void 0) forms.push(...readFenceForms(fence));
76
110
  return ["-p", forms.join(" ")];
77
111
  }
78
112
  //#endregion
@@ -305,24 +339,46 @@ var LocalSandboxProvider = class extends SandboxProvider {
305
339
  * `SANDBOX_UNAVAILABLE` error when the platform has no usable runner.
306
340
  */
307
341
  async confine(argv, policy, signal) {
342
+ return this.wrap(argv, policy, void 0, signal);
343
+ }
344
+ /**
345
+ * Wrap `argv` like {@link confine} and add a read fence to the profile. Only
346
+ * the Seatbelt rung expresses a read fence; another selected runner or a
347
+ * configured `runnerCommand` fails closed with `SANDBOX_UNSUPPORTED_POLICY`.
348
+ * @param argv - the exact argv the caller is about to spawn.
349
+ * @param policy - the file-effect policy this execution runs under.
350
+ * @param fence - the read restriction, with canonical paths.
351
+ * @param signal - cancellation before policy resolution.
352
+ * @returns the wrapped argv plus the Seatbelt rung's enforcement, denial
353
+ * signatures, and runner-failure rules.
354
+ */
355
+ async confineWithReadFence(argv, policy, fence, signal) {
356
+ return this.wrap(argv, policy, fence, signal);
357
+ }
358
+ /** The shared wrap of {@link confine} and {@link confineWithReadFence}. */
359
+ wrap(argv, policy, fence, signal) {
308
360
  signal?.throwIfAborted();
309
361
  policy = {
310
362
  ...policy,
311
363
  workspaceRoot: canonicalPath(policy.workspaceRoot)
312
364
  };
313
- if (this.runnerCommand !== void 0) return Promise.resolve({
314
- argv: [
315
- ...this.runnerCommand,
316
- ...bwrapProfileArgs(policy),
317
- "--",
318
- ...argv
319
- ],
320
- enforcement: "full",
321
- denialSignatures: DENIAL_SIGNATURES.runnerCommand,
322
- runnerFailureRules: [{ fatalSignatures: this.configuredRunnerFailureSignatures }]
323
- });
365
+ if (this.runnerCommand !== void 0) {
366
+ if (fence !== void 0) throw new SandboxUnsupportedPolicyError("sandbox-local: a configured runnerCommand cannot restrict reads");
367
+ return Promise.resolve({
368
+ argv: [
369
+ ...this.runnerCommand,
370
+ ...bwrapProfileArgs(policy),
371
+ "--",
372
+ ...argv
373
+ ],
374
+ enforcement: "full",
375
+ denialSignatures: DENIAL_SIGNATURES.runnerCommand,
376
+ runnerFailureRules: [{ fatalSignatures: this.configuredRunnerFailureSignatures }]
377
+ });
378
+ }
324
379
  const selected = this.selectRunner(policy.mode);
325
- const runnerArgv = this.runnerArgv(selected.runner, policy);
380
+ if (fence !== void 0 && selected.runner !== "seatbelt") throw new SandboxUnsupportedPolicyError(`sandbox-local: the ${selected.runner} runner cannot restrict reads`);
381
+ const runnerArgv = this.runnerArgv(selected.runner, policy, fence);
326
382
  return Promise.resolve({
327
383
  argv: [
328
384
  ...runnerArgv,
@@ -335,11 +391,11 @@ var LocalSandboxProvider = class extends SandboxProvider {
335
391
  });
336
392
  }
337
393
  /** The selected rung's runner invocation (program + profile arguments) for one policy. */
338
- runnerArgv(runner, policy) {
394
+ runnerArgv(runner, policy, fence) {
339
395
  switch (runner) {
340
396
  case "bwrap": return ["bwrap", ...bwrapProfileArgs(policy)];
341
397
  case "landlock": return [this.landlockLauncher(), ...landlockProfileArgs(policy)];
342
- case "seatbelt": return [this.seatbeltExec(), ...seatbeltProfileArgs(policy)];
398
+ case "seatbelt": return [this.seatbeltExec(), ...seatbeltProfileArgs(policy, fence)];
343
399
  case "windows-acl": return this.windowsAclRunnerArgv(policy);
344
400
  default: return assertNever(runner);
345
401
  }
@@ -2542,9 +2542,15 @@ export const SERVICE_API = [
2542
2542
  parameters: [{ name: 'argv', description: 'the exact argv the caller is about to spawn (program plus arguments), NOT a shell string — a shell-shaped consumer passes `[\'bash\', \'-c\', command]`.' }, { name: 'policy', description: 'the file-effect policy this execution runs under, carried per call (see {@link SandboxPolicy}).' }, { name: 'signal', description: 'cancellation while the provider resolves the policy and runner.' }],
2543
2543
  returns: 'the argv to spawn instead, plus the enforcement completeness the selected backend achieves for it.',
2544
2544
  },
2545
+ {
2546
+ signature: 'confineHostBound( argv: readonly string[], policy: SandboxPolicy, _execution: HostBoundExecution, signal?: AbortSignal, ): Promise<ConfinedArgv>',
2547
+ description: 'Wrap `argv` for a host-bound execution: one that must run in the subprocess provider\'s own execution world because its executable or runtime files are paths there outside the shared workspace, or because it inherits descriptors beyond stdin, stdout, and stderr. The base implementation is confine, which already confines in that world. A provider whose `confine` relocates execution, such as the Apple container backend, overrides this to confine in place under a read restriction it documents, or fails closed.',
2548
+ parameters: [{ name: 'argv', description: 'the exact argv the caller is about to spawn.' }, { name: 'policy', description: 'the file-effect policy this execution runs under.' }, { name: '_execution', description: 'the runtime paths the process must read.' }, { name: 'signal', description: 'cancellation while the provider resolves the policy and runner.' }],
2549
+ returns: 'the argv to spawn instead, plus the enforcement completeness the selected backend achieves for it.',
2550
+ },
2545
2551
  {
2546
2552
  signature: 'readScope(_policy: SandboxExecutionPolicy): SandboxReadScope | undefined',
2547
- description: 'What a process confined under `policy` can read on the host, or `undefined` when this backend does not confine reads. Model-facing tools that read the host for the same session must refuse paths outside the scope, so their view never exceeds the confined processes\'. The base implementation confines no reads.',
2553
+ description: 'What a process wrapped by confine under `policy` can read on the host, or `undefined` when this backend does not confine reads. Model-facing tools that read the host for the same session must refuse paths outside the scope, so their view never exceeds the confined processes\'. The base implementation confines no reads.',
2548
2554
  parameters: [{ name: '_policy', description: 'the file-effect policy of the calling session.' }],
2549
2555
  returns: 'the read scope, or `undefined` for unconfined reads.',
2550
2556
  },
@@ -6760,6 +6766,10 @@ export const TYPE_API = [
6760
6766
  name: 'HookRegistration',
6761
6767
  declaration: 'export interface HookRegistration {\n catch(handler: AnyHook): void;\n}',
6762
6768
  },
6769
+ {
6770
+ name: 'HostBoundExecution',
6771
+ declaration: 'export interface HostBoundExecution {\n readonly runtimePaths: readonly string[];\n}',
6772
+ },
6763
6773
  {
6764
6774
  name: 'HostConnectionFetch',
6765
6775
  declaration: 'export interface HostConnectionFetch {\n register(route: ConnectionFetchRoute): () => Promise<void>;\n}',
@@ -21,11 +21,11 @@
21
21
  en: d0ede2f3fc62912b
22
22
  zh: d177b8f16b58828f
23
23
  /deepseek-ai-dsh-tui-app/use-this-package/the-screen:
24
- en: 8798852e763b4558
25
- zh: 6bb6768ee7186709
24
+ en: 9716f5d4691e02ff
25
+ zh: 4c865819b68976b0
26
26
  /deepseek-ai-dsh-tui-app/use-this-package/keys-and-commands:
27
- en: 688e10e22846d3b5
28
- zh: 028366a1ef17688d
27
+ en: 826d814ecdb3d769
28
+ zh: c12a34eee544385c
29
29
  /deepseek-ai-dsh-tui-app/use-this-package/background-tool-calls:
30
30
  en: 322ae3c6d76383ec
31
31
  zh: 8c38eee4b57ed8dd
@@ -58,7 +58,7 @@ Motion reaches past streamed text: every lift and float rides the same fade tick
58
58
 
59
59
  The subagent panel is drawn while a local subagent session under the bound one is resident, or the listing carries a candidate it could not read; an external task has no local session and stays out of the panel, and so does a continuable descendant while Team mode is enabled, which the team line and the activity board show instead. Unfocused it is one summary line with the listed count and the first child's key label; focused, its heading counts what it lists and ends on the keys it answers, `↑↓ children · Enter opens · Tab regions · Esc input`, narrowed to `↑↓ children · Esc input` and then to `Esc input` on a terminal that cannot hold them, and each row gives the child's depth indent, its label or id, its mode (`one-shot` or `continuable`), `resident`, whether its agent is `running`, `completed` after its latest settled turn, or `idle`, its elapsed time — the open turn's, else the total its settled turns took — and its token usage, as far as this process's own view of that child and the composed projections carry them. Six rows are drawn at most, with `+<n> more · /subagents lists them all` under them; `/subagents` shows an external task as `external task · no local session` and shows its no-local-session detail instead of opening a Session, a candidate the listing could not interpret draws as `unreadable: <reason>` and shows its reason instead of opening a Session, and a failed listing keeps the rows the last good one produced with `listing failed: <reason>` beneath. The panel disappears with its last row. `Enter` or `Right` on a readable row, like `Enter` on a readable `/subagents` row, opens that child as a subagent view: the terminal draws the child session in place of the bound one — its transcript, live stream, conversation walk, inspector, reader, and its own subagent panel — while the session it was entered from stays open. A resident child is read live, and any other is resumed. The entry's detail rows print as notices under `subagent <label> · Ctrl+P or /parent returns to session <id>`, the header ends on `◆ subagent view ›` with one `›` per level entered and `· Ctrl+P returns`, a shaded line directly above the input reads `◆ subagent view · main › <label> · Ctrl+P back to <parent>` for as long as the view is open, whatever the transcript has scrolled to, and `Ctrl+P` or `/parent` goes back one level, redrawing the parent from its log as it stands then. A one-shot child opens read-only: its banner opens with `◆ subagent view · one-shot, read-only`, a prompt or `!` line typed there is refused with a notice and stays in the editor, `Esc` does not stop its turn, and commands such as `/parent` still run, while a continuable child takes prompts and a stop as any session does. `/new`, `/clear`, `/resume`, `/sessions`, and `/fork` refuse while any session in that chain runs a turn or a background job, since releasing a session ends its jobs, and otherwise release every view with the session they leave; quitting releases every view and saves the root session.
60
60
 
61
- While Team mode is enabled, continuable descendants from the standard subagent catalog supply teammate rows, and the shared task board supplies tasks. Root-relative names identify teammates and catalog labels describe their work; older unnamed entries use their labels as names. There is no separate current Team roster. Live members show their currently selected model, while cold members omit the model. The team panel is one dim summary line, `team · <n> teammates · working: <name>, <name> · tasks <completed>/<total> done · /team-play`, while the bound session has a teammate or a shared task that is not deleted, and it does not take the keyboard; a lead with neither leaves it unmounted. The count leaves out the lead, `working:` names the running teammates and is omitted while none runs, and the task counts leave out deleted tasks. A line wider than the terminal folds trailing names into `+<n>`, then reads `<n> working`, then ends in `…`. It is the only summary of the team: continuable descendants are not rows or counts in the subagent panel, and a teammate's activity-board row reads `<name> · <role>`, where the lead's role is `orchestrator` and a child's role is its description, or `teammate` when none is available. A teammate's session view titles its header and the line above the input `teammate <name> · <role>`, the role cut to 28 columns, instead of `subagent view`. `/team-panel off` hides the line, `/team-panel on` forces it on, which draws `team · no teammates or shared tasks yet` when there is no teammate and no shared task, and `/team-panel` alone toggles that choice. `/team on` and `/team off` save the root Session's Team selection without stopping children or deleting tasks; descendants share that selection and cannot change it. `/team` lists every member and every shared task; `Enter` opens a running or inactive teammate as a continuable session view, and the lead or a task opens a detail page. `/team-tools` prints the tools the Agent Teams plugin currently scopes onto this agent, each with the description the plugin supplies, and omits tools that are already visible without that plugin. A tool the plugin adds or removes shows up on the next `/team-tools` without a terminal change. `/team` detail pages also print string, number, and boolean fields the plugin adds to a member or a task. `/team-play` lists the exchanges those scoped tool calls, received team messages, and `team/` events record. Without the service each command notices `Agent Teams are not enabled in this composition` and the panel stays unmounted; a session whose Team mode is off notices `this session is not on a team`.
61
+ While Team mode is enabled, continuable descendants from the standard subagent catalog supply teammate rows, and the shared task board supplies tasks. Root-relative names identify teammates and catalog labels describe their work; older unnamed entries use their labels as names. There is no separate current Team roster. Live members show their currently selected model, while cold members omit the model. The team panel is one summary line, `✦ team · <n> teammates · working: <name>, <name> · tasks <completed>/<total> done · /team-play`, dim except for the accent `✦`, while the bound session has a teammate or a shared task that is not deleted, and it does not take the keyboard; a lead with neither leaves it unmounted. While a teammate runs and reduced motion is off, the `✦` spins the delegation animation on the spinner tick. The count leaves out the lead, `working:` names the running teammates and is omitted while none runs, and the task counts leave out deleted tasks. A line wider than the terminal folds trailing names into `+<n>`, then reads `<n> working`, then ends in `…`. It is the only summary of the team: continuable descendants are not rows or counts in the subagent panel, and a teammate's activity-board row reads `<name> · <role>`, where the lead's role is `orchestrator` and a child's role is its description, or `teammate` when none is available. A teammate's session view titles its header and the line above the input `teammate <name> · <role>`, the role cut to 28 columns, instead of `subagent view`. `/team-panel off` hides the line, `/team-panel on` forces it on, which draws `✦ team · no teammates or shared tasks yet` when there is no teammate and no shared task, and `/team-panel` alone toggles that choice. `/team on` and `/team off` save the root Session's Team selection without stopping children or deleting tasks; descendants share that selection and cannot change it. `/team` lists every member and every shared task; `Enter` opens a running or inactive teammate as a continuable session view, and the lead or a task opens a detail page. `/team-tools` prints the tools the Agent Teams plugin currently scopes onto this agent, each with the description the plugin supplies, and omits tools that are already visible without that plugin. A tool the plugin adds or removes shows up on the next `/team-tools` without a terminal change. `/team` detail pages also print string, number, and boolean fields the plugin adds to a member or a task. `/team-play` lists the exchanges those scoped tool calls, received team messages, and `team/` events record. Without the service each command notices `Agent Teams are not enabled in this composition` and the panel stays unmounted; a session whose Team mode is off notices `this session is not on a team`.
62
62
 
63
63
  `/btw` opens a temporary side agent as a view over the session on screen, so the user can ask questions while that session's agent keeps working. The side agent is a new Agent seeded with every event the session has logged so far, an unfinished turn included: a tool call still waiting for its result gets the fork's error result, and reply text that is still streaming is not included. Input still queued for the session, prompts and next-step context alike, stays with that session's agent and is not carried into the side agent. It runs on the session's last logged model, else its current selection, and it can only read: its session runs in the `read-only` sandbox mode with the `never` approval policy, so a write fails and cannot be approved, and it sees only the tools named in `btwTools`, plus the command tools in `btwSandboxedTools` when the command executor confines commands. Every other tool is hidden from it and refused if called. It runs its own turns: the question after `/btw` is its first prompt, and every line typed while it is on screen goes to it, `/btw <question>` included. The view is drawn like a subagent view: the header ends on `◆ btw side agent · Ctrl+P ends it and returns`, the shaded line above the input reads `◆ btw side agent · main › btw · Ctrl+P back to main`, and the transcript starts empty instead of repeating the inherited conversation. `Ctrl+P` or `/parent` ends the side agent, cancelling a turn it is running, and redraws the session it was opened from under `btw ended · back in session <id>`. The working session is only read: nothing is appended to its log, its inbox is untouched, and neither its subagent panel, `/subagents`, nor its model-facing subagent listing shows the side agent, which also cannot message it. An approval or question that a session held behind any view raises is shown on screen after `session <id>, behind this view, asks:` instead of being refused.
64
64
 
@@ -68,6 +68,8 @@ The conversation, input, subagent panel, and status bar form the vertical arrow-
68
68
 
69
69
  Every key the screen names is drawn as a chip, italic in the accent color apart from the words around it: in the status bar, the region legends, the pickers and prompts, the transient line, fold markers, notices, `/help`, and the reader. With `mouse: true`, a left click on a chip presses that key exactly as typing it would, so `Shift+↓` in the status bar walks to the bar, `Esc` on the armed-stop line stops the turn, and each arrow of a pair such as `↑↓` presses its own key. Turning it on turns the terminal's mouse reports on: the wheel opens the full-screen reader at the newest section and scrolls it up or down, but does nothing while an approval or question is open. The wheel and plain click-drag reach the application instead of scrolling the terminal's scrollback or selecting text; most terminals still scroll and select with `Shift` held (`Option` in iTerm2).
70
70
 
71
+ The input colors its leading `/command` token with the accent color and leaves arguments plain; `NO_COLOR` disables this styling.
72
+
71
73
  While the input has the keyboard:
72
74
 
73
75
  | Key | Effect |
@@ -190,7 +192,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
190
192
  | `/attach <path>` | Attach an image or file to the next prompt or a shared command that accepts attachments; `/attach` lists them and `/attach clear` drops them |
191
193
  | `/queue` | Show the messages queued for the next turn and step; `/queue clear` drops them, and the rows above the editor with them |
192
194
  | `/retry` | Continue an eligible failed turn without a new prompt; pending human input or active work prevents admission, and staged attachments remain pending |
193
- | `/skills` | List the skills the agent can load |
195
+ | `/skills` | List skills available to the current agent and working directory, including global skills |
194
196
  | `/signin` | Sign in to a provider through its notices and prompts; `/signin <key>` skips the picker |
195
197
  | `/login` | Sign in with a provider subscription (hides key-collecting logins); `/login <key>` skips the picker |
196
198
  | `/export [dir]` | Write this session's log ZIP (sub-sessions and attachments included) into `dir`, default the workspace |
@@ -215,7 +217,7 @@ Typing `/` at the start of the editor completes the terminal's own commands and
215
217
  | `/btw <question>` | Open a temporary side agent with this session's context and ask it the question; it can use read-only tools, the session keeps working and never sees it, and `Ctrl+P` ends it. Inside the side agent, `/btw <question>` asks it another question |
216
218
  | `/quit`, `/exit` | Save the session and exit |
217
219
 
218
- An empty root session with Team mode enabled draws a static start card. The TUI profile enables Team mode by default. It reads `Agent Teams is on`, says that the lead plans the work and delegates independent subtasks to teammates that each have one role, lists `/team-play` and `/team` with what each shows, and names `/team off`. The card never animates. The header reads `Agent Teams on`.
220
+ An empty root session with Team mode enabled draws a three-line start card. The TUI profile enables Team mode by default. A figure of the lead `◆` branching to three teammates `●` stands beside `Agent Teams`, `The lead splits the work; each teammate takes one role.`, and `/team-play live room · /team roster and tasks · /team off`; below 40 columns only the three text lines remain. Each time the card mounts, for a new or resumed empty session or `/team on` in one, it plays an entrance measured in spinner periods: the lead brightens, the trunk grows, each branch arrives with its slot spinning the delegation animation at its own phase and its text row fading in, and the slots land on `●` one step apart, 0.8 seconds at the default `spinnerMs`. Reduced motion, a disabled palette, `NO_COLOR`, and `TERM=dumb` draw the settled card at once, as does a card whose first line sits above the renderer's repaint window. While Team mode is on, the header ends with `· ✦ team · /team-play · /help`.
219
221
 
220
222
  The TUI exposes optional `provider`, `model`, and `reasoning_effort` fields on both `subagent` and `subagent_fork`, and `list_subagent_models` discovers the routes allowed by the Session policy. Omitting those fields inherits the lead's model. An explicit fork route is recorded after inherited history; changing the route can prevent reuse of the parent's cached prefix.
221
223
 
@@ -58,7 +58,7 @@ dsh tui --no-open # print sign-in URLs without opening a
58
58
 
59
59
  子 agent 面板在绑定会话之下有常驻的本地子 agent 会话、或列表中带有无法读取的候选者时绘制;外部任务没有本地会话,因此不在面板中出现;启用 Team 模式时,可继续后代也不在面板中出现,改由团队行和 activity board 显示。未聚焦时它是一行摘要,含列出的数量与第一个子会话的关键标签;聚焦时其标题统计所列出的条目,并以它所应答的按键 `↑↓ children · Enter opens · Tab regions · Esc input` 结尾,在容纳不下时收缩为 `↑↓ children · Esc input`,再收缩为 `Esc input`;每一行给出该子会话的层级缩进、其标签或 id、其模式(`one-shot` 或 `continuable`)、`resident`、其 agent 处于 `running`、最新已结束轮次后为 `completed`,还是 `idle`、其已用时间——进行中轮次的用时,否则是已结束轮次的合计——以及其 token 用量,以本进程对该子会话的可见程度与已组合的投影所能提供的为限。最多绘制六行,其下是 `+<n> more · /subagents lists them all`;`/subagents` 把外部任务显示为 `external task · no local session`,并显示其没有本地会话的详情而不打开会话,列表无法解读的候选者绘制为 `unreadable: <reason>`,并显示其原因而不打开会话,读取失败的列表则保留上一次成功读取产生的各行,并在其下写出 `listing failed: <reason>`。面板随其最后一行一同消失。在可读的行上按 `Enter` 或 `Right`,与在可读的 `/subagents` 行上按 `Enter` 一样,会把该子会话作为子 agent 视图打开:终端在已绑定会话的位置绘制子会话——其对话记录、实时流、对话记录走查、检查器、阅读器以及它自己的子 agent 面板——而进入它之前的会话保持打开。常驻的子会话被实时读取,其他子会话则被恢复。条目的详情行作为通知打印在 `subagent <label> · Ctrl+P or /parent returns to session <id>` 之下,页眉以 `◆ subagent view ›`(每进入一层一个 `›`)与 `· Ctrl+P returns` 结尾,只要视图打开,输入框正上方就有一条着色行写着 `◆ subagent view · main › <label> · Ctrl+P back to <parent>`,无论对话记录滚动到哪里,`Ctrl+P` 或 `/parent` 返回上一层,并按父会话此刻的日志重绘它。`one-shot` 子会话以只读方式打开:其横幅以 `◆ subagent view · one-shot, read-only` 开头,在其中输入的提示词或 `!` 行会被通知拒绝并留在编辑器中,`Esc` 不会停止它的轮次,而 `/parent` 等命令仍可运行;`continuable` 子会话则像任何会话一样接受提示词与停止。只要这条链中任一会话正在运行轮次或后台任务,`/new`、`/clear`、`/resume`、`/sessions` 与 `/fork` 都会拒绝(释放会话会结束它的后台任务),否则它们会随所离开的会话释放每一个视图;退出会释放每一个视图并保存根会话。
60
60
 
61
- 启用 Team 模式时,标准 subagent 目录中的可继续后代提供 teammate 行,共享任务板提供任务。相对于根的名称标识 teammate,目录标签描述其工作;较早的无名条目使用标签作为名称。当前状态不维护独立的 Team 名册。存活成员显示当前选中的模型,冷成员不显示模型。团队面板在绑定会话有 teammate,或有一条状态不是 `deleted` 的共享任务时,是一行不占键盘的暗色摘要 `team · <n> teammates · working: <name>, <name> · tasks <completed>/<total> done · /team-play`;只有 lead、且没有这类任务时,面板不挂载。计数不含 lead,`working:` 列出正在运行的 teammate 名字,没有 teammate 运行时省略,任务计数不含已删除任务。该行宽于终端时,先把末尾的名字折成 `+<n>`,再改为 `<n> working`,最后以 `…` 截断。它是团队唯一的摘要:可继续后代不作为子 agent 面板的行,也不计入其计数;teammate 在 activity board 上的行显示为 `<name> · <role>`,其中 lead 的角色是 `orchestrator`,子级的角色是其描述;没有描述时是 `teammate`。teammate 的会话视图在页头和输入框上方那一行以 `teammate <name> · <role>` 为标题(角色截为 28 列),而不是 `subagent view`。`/team-panel off` 隐藏该行,`/team-panel on` 强制显示,既没有 teammate 也没有共享任务时绘制 `team · no teammates or shared tasks yet`,单独的 `/team-panel` 在这两种选择之间切换。`/team on` 和 `/team off` 保存根 Session 的 Team 选择,不停止子级或删除任务;后代共享该选择,不能修改它。`/team` 列出每一名成员和每一条未删除的共享任务;在 `running` 或 `inactive` 的 teammate 上按 `Enter` 会把该会话作为可继续的会话视图打开,lead 或任务则打开详情页。`/team-tools` 打印 Agent Teams 插件当前限定在本 agent 上的工具,每条带上插件给出的描述,并略去没有该插件时就已经可见的工具。插件新增或移除的工具,下一次 `/team-tools` 就会反映出来,终端本身不必改动。`/team` 的详情页也会打印插件加在成员或任务上的字符串、数字和布尔字段。`/team-play` 列出这些限定工具的调用、收到的团队消息,以及 `team/` 事件所记录的往来。没有该服务时,每条命令提示 `Agent Teams are not enabled in this composition`,面板保持不挂载;会话的 Team 模式关闭时提示 `this session is not on a team`。
61
+ 启用 Team 模式时,标准 subagent 目录中的可继续后代提供 teammate 行,共享任务板提供任务。相对于根的名称标识 teammate,目录标签描述其工作;较早的无名条目使用标签作为名称。当前状态不维护独立的 Team 名册。存活成员显示当前选中的模型,冷成员不显示模型。团队面板在绑定会话有 teammate,或有一条状态不是 `deleted` 的共享任务时,是一行不占键盘的摘要 `✦ team · <n> teammates · working: <name>, <name> · tasks <completed>/<total> done · /team-play`,除强调色的 `✦` 外均为暗色;只有 lead、且没有这类任务时,面板不挂载。有 teammate 运行且未开启减弱动效时,`✦` 随 spinner tick 播放委派动画。计数不含 lead,`working:` 列出正在运行的 teammate 名字,没有 teammate 运行时省略,任务计数不含已删除任务。该行宽于终端时,先把末尾的名字折成 `+<n>`,再改为 `<n> working`,最后以 `…` 截断。它是团队唯一的摘要:可继续后代不作为子 agent 面板的行,也不计入其计数;teammate 在 activity board 上的行显示为 `<name> · <role>`,其中 lead 的角色是 `orchestrator`,子级的角色是其描述;没有描述时是 `teammate`。teammate 的会话视图在页头和输入框上方那一行以 `teammate <name> · <role>` 为标题(角色截为 28 列),而不是 `subagent view`。`/team-panel off` 隐藏该行,`/team-panel on` 强制显示,既没有 teammate 也没有共享任务时绘制 `✦ team · no teammates or shared tasks yet`,单独的 `/team-panel` 在这两种选择之间切换。`/team on` 和 `/team off` 保存根 Session 的 Team 选择,不停止子级或删除任务;后代共享该选择,不能修改它。`/team` 列出每一名成员和每一条未删除的共享任务;在 `running` 或 `inactive` 的 teammate 上按 `Enter` 会把该会话作为可继续的会话视图打开,lead 或任务则打开详情页。`/team-tools` 打印 Agent Teams 插件当前限定在本 agent 上的工具,每条带上插件给出的描述,并略去没有该插件时就已经可见的工具。插件新增或移除的工具,下一次 `/team-tools` 就会反映出来,终端本身不必改动。`/team` 的详情页也会打印插件加在成员或任务上的字符串、数字和布尔字段。`/team-play` 列出这些限定工具的调用、收到的团队消息,以及 `team/` 事件所记录的往来。没有该服务时,每条命令提示 `Agent Teams are not enabled in this composition`,面板保持不挂载;会话的 Team 模式关闭时提示 `this session is not on a team`。
62
62
 
63
63
  `/btw` 在屏幕上的会话之上打开一个临时的旁路 agent 视图,让用户在该会话的 agent 继续工作时提问。旁路 agent 是一个新的 Agent,以该会话迄今记录的全部事件为种子,包括尚未结束的轮次:仍在等待结果的工具调用会得到分叉产生的错误结果,仍在流式输出的回复文本不包含在内。该会话仍在排队的输入,无论是提示还是下一步上下文,都留给该会话的 agent,不会带进旁路 agent。它使用该会话最后记录的模型(否则使用其当前选择),并且只能读取:它的会话运行在 `read-only` 沙箱模式与 `never` 审批策略下,因此写入会失败且无法获批;它只看得到 `btwTools` 中列出的工具,以及在命令执行器会约束命令时 `btwSandboxedTools` 中的命令工具。其他工具对它隐藏,被调用时也会被拒绝。它运行自己的轮次:`/btw` 之后的问题是它的第一条提示,它在屏幕上时输入的每一行都交给它,`/btw <question>` 也一样。该视图的绘制方式与子 agent 视图相同:页眉以 `◆ btw side agent · Ctrl+P ends it and returns` 结尾,输入框上方的着色行写着 `◆ btw side agent · main › btw · Ctrl+P back to main`,对话记录从空开始,而不是重复继承来的对话。`Ctrl+P` 或 `/parent` 结束旁路 agent(取消它正在运行的轮次),并在 `btw ended · back in session <id>` 之下重绘打开它之前的会话。工作中的会话只被读取:不向其日志追加任何内容,不触碰其收件箱,其子 agent 面板、`/subagents` 与面向模型的子 agent 列表都不显示旁路 agent,旁路 agent 也不能给它发消息。被任一视图挡在后面的会话发起的审批或提问,会在 `session <id>, behind this view, asks:` 之后显示在屏幕上,而不是被拒绝。
64
64
 
@@ -68,6 +68,8 @@ dsh tui --no-open # print sign-in URLs without opening a
68
68
 
69
69
  屏幕上写出的每个按键都画成一枚徽标,以强调色的斜体与周围文字区分开:出现在状态栏、各区域的按键提示、选择器与提示、临时提示行、折叠标记、通知、`/help` 与阅读器中。设置 `mouse: true` 后,左键点击一枚徽标就按下该键,与键入它完全相同:点击状态栏中的 `Shift+↓` 会走到状态栏,点击已布防的停止提示行中的 `Esc` 会停止轮次,`↑↓` 这类成对箭头中的每个箭头各自按下自己的键。开启它会打开终端的鼠标报告:滚轮在最新小节打开全屏阅读器并向上或向下滚动,但审批或提问打开期间不响应滚轮。滚轮与普通的点击拖动交给应用,而不再滚动终端的回滚缓冲区或选择文本;大多数终端在按住 `Shift`(iTerm2 中为 `Option`)时仍可滚动与选择。
70
70
 
71
+ 编辑器以强调色显示开头的 `/command`,参数保持普通文本;`NO_COLOR` 会禁用此样式。
72
+
71
73
  编辑器持有键盘时:
72
74
 
73
75
  | 按键 | 效果 |
@@ -190,7 +192,7 @@ follow-ups 面板持有键盘时:
190
192
  | `/attach <path>` | 把图片或文件附加到下一条提示,或附加到接受附件的共享命令;`/attach` 列出,`/attach clear` 丢弃 |
191
193
  | `/queue` | 显示为下一轮次与下一步排队的消息;`/queue clear` 丢弃它们,编辑器上方的对应行也随之消失 |
192
194
  | `/retry` | 不添加新提示,继续符合条件的失败轮次;待处理的人类输入或正在进行的工作会阻止提交,暂存附件保持待发送 |
193
- | `/skills` | 列出 agent 可加载的技能 |
195
+ | `/skills` | 列出当前 agent 和工作目录可用的技能,包括全局技能 |
194
196
  | `/signin` | 通过提供方的通知与提示登录;`/signin <key>` 跳过选择器 |
195
197
  | `/login` | 用提供方订阅登录(隐藏仅收集密钥的登录);`/login <key>` 跳过选择器 |
196
198
  | `/export [dir]` | 把本会话的日志 ZIP(含子会话与附件)写入 `dir`,默认 workspace |
@@ -215,7 +217,7 @@ follow-ups 面板持有键盘时:
215
217
  | `/btw <question>` | 打开一个带有本会话上下文的临时旁路 agent 并向它提问;它可以使用只读工具,本会话继续工作且看不到它,`Ctrl+P` 结束它。在旁路 agent 中,`/btw <question>` 向它再提一个问题 |
216
218
  | `/quit`、`/exit` | 保存会话并退出 |
217
219
 
218
- 启用 Team 模式的空根会话画出一张静态起始卡片。TUI profile 默认开启 Team 模式。卡片写着 `Agent Teams is on`,说明 lead 规划工作并把相互独立的子任务委派给 teammate,每名 teammate 承担一个角色,列出 `/team-play` 与 `/team` 各自显示的内容,并给出 `/team off`。卡片从不动画。标题行写着 `Agent Teams on`。
220
+ 启用 Team 模式的空根会话画出一张三行起始卡片。TUI profile 默认开启 Team 模式。左侧图形是 lead `◆` 分叉到三名 teammate `●`,右侧依次是 `Agent Teams`、`The lead splits the work; each teammate takes one role.` 和 `/team-play live room · /team roster and tasks · /team off`;不足 40 列时只保留这三行文字。卡片每次挂载时(新的或恢复的空会话,或在空会话中执行 `/team on`),都会播放一段以 spinner 周期计时的入场:lead 变亮,主干伸出,每条分支依次到达,其槽位以各自的相位播放委派动画、对应文字行渐显,随后各槽位相隔一步落定为 `●`;默认 `spinnerMs` 下共 0.8 秒。减弱动效、禁用调色板、`NO_COLOR` 和 `TERM=dumb` 直接画出落定的卡片;首行位于渲染器重绘窗口之上的卡片也是如此。Team 模式开启时,标题行以 `· ✦ team · /team-play · /help` 结尾。
219
221
 
220
222
  TUI 在 `subagent` 与 `subagent_fork` 上均公开可选的 `provider`、`model` 和 `reasoning_effort` 字段,并通过 `list_subagent_models` 发现 Session 策略允许的路由。省略这些字段会继承 lead 的模型。显式 fork 路由记录在继承历史之后;更换路由可能使父级缓存前缀无法复用。
221
223