@songtonyli/dsh-cli 0.1.84 → 0.1.86

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/@deepseek-ai/dsh-client-modules/lib/index.js +1 -1
  4. package/node_modules/@deepseek-ai/dsh-client-ui-sidebar/lib/client.js +1 -1
  5. package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.i18n.yaml +14 -14
  6. package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.md +7 -7
  7. package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/README.zh.md +7 -7
  8. package/node_modules/@deepseek-ai/dsh-experimental-tool-agent-team/lib/index.js +28 -4
  9. package/node_modules/@deepseek-ai/dsh-llm-pi-ai/lib/index.js +39 -52
  10. package/node_modules/@deepseek-ai/dsh-subagent/README.i18n.yaml +4 -4
  11. package/node_modules/@deepseek-ai/dsh-subagent/README.md +3 -3
  12. package/node_modules/@deepseek-ai/dsh-subagent/README.zh.md +3 -3
  13. package/node_modules/@deepseek-ai/dsh-subagent/lib/index.js +8 -5
  14. package/node_modules/@deepseek-ai/dsh-subagent/lib/types/child-agent.js +9 -4
  15. package/node_modules/@deepseek-ai/dsh-tui-app/README.i18n.yaml +10 -10
  16. package/node_modules/@deepseek-ai/dsh-tui-app/README.md +16 -11
  17. package/node_modules/@deepseek-ai/dsh-tui-app/README.zh.md +16 -11
  18. package/node_modules/@deepseek-ai/dsh-tui-app/lib/index.js +1938 -1409
  19. package/node_modules/execa/package.json +1 -1
  20. package/node_modules/unist-util-visit/lib/index.js +173 -161
  21. package/node_modules/unist-util-visit/license +1 -1
  22. package/node_modules/unist-util-visit/package.json +46 -56
  23. package/node_modules/unist-util-visit/readme.md +87 -27
  24. package/node_modules/unist-util-visit-parents/lib/color.js +4 -0
  25. package/node_modules/unist-util-visit-parents/lib/color.node.js +4 -0
  26. package/node_modules/unist-util-visit-parents/lib/index.js +235 -52
  27. package/node_modules/unist-util-visit-parents/license +1 -1
  28. package/node_modules/unist-util-visit-parents/package.json +44 -54
  29. package/node_modules/unist-util-visit-parents/readme.md +185 -74
  30. package/package.json +4 -4
package/README.md CHANGED
@@ -26,7 +26,7 @@ workspace and no build step. Native packages that ship one build per platform
26
26
  ripgrep, the PTY backend's addons, sharp, koffi, and the Landlock launcher — are
27
27
  ordinary optional dependencies, so npm resolves the right one for your machine.
28
28
 
29
- Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.84; `dsh --version`
29
+ Requires Node `^22.19.0 || >=24.0.0`. Version 0.1.86; `dsh --version`
30
30
  also reports the harness build the package was assembled from.
31
31
 
32
32
  ## License
package/bin/dsh.mjs CHANGED
@@ -18,7 +18,7 @@ const argv = process.argv.slice(2)
18
18
  // version this package publishes. Reporting only one of the two would make an
19
19
  // ordinary `npm install @songtonyli/dsh-cli@x` look like it installed something else.
20
20
  if (argv.length === 1 && (argv[0] === '--version' || argv[0] === '-V')) {
21
- console.log('@songtonyli/dsh-cli 0.1.84 (deepseek-harness 0.2.1-rc.3)')
21
+ console.log('@songtonyli/dsh-cli 0.1.86 (deepseek-harness 0.2.1-rc.3)')
22
22
  process.exit(0)
23
23
  }
24
24
 
@@ -592,7 +592,7 @@ var ClientModuleRegistry = class extends Service {
592
592
  constructor(ctx) {
593
593
  super(ctx, "clientModules");
594
594
  const { version } = createRequire(import.meta.url)("../package.json");
595
- const commit = "fe5e941";
595
+ const commit = "8181263";
596
596
  this.release = {
597
597
  version,
598
598
  commit
@@ -195,7 +195,7 @@ window.__ModuleLoader__.load({
195
195
  const SCROLLBAR_LINGER_MS = 2e3;
196
196
  /** Format complete-build metadata for the local brand badge. */
197
197
  function localBuildVersion() {
198
- return `0.2.1-rc.3-fe5e941-dirty`;
198
+ return `0.2.1-rc.3-8181263-dirty`;
199
199
  }
200
200
  /** Analytics category of an official panel; other panels are never reported. */
201
201
  function officialEntry(id) {
@@ -9,14 +9,14 @@
9
9
  en: 0b01a243291821bc
10
10
  zh: 0dadd38d709ae9bd
11
11
  /deepseek-ai-dsh-experimental-tool-agent-team/summary:
12
- en: cb426055b46b381e
13
- zh: dc29d823d44f0c5e
12
+ en: 7f15cf2c8a768894
13
+ zh: ee5330a428fe4b34
14
14
  /deepseek-ai-dsh-experimental-tool-agent-team/table-of-contents:
15
15
  en: d152484eb41ac6b4
16
16
  zh: 09388d293f9be9cb
17
17
  /deepseek-ai-dsh-experimental-tool-agent-team/use-this-package:
18
- en: 5a56781cb7bf4d3b
19
- zh: 74df21efd6321afd
18
+ en: ec0052e90def6cab
19
+ zh: bdd9a8e9b696c4df
20
20
  /deepseek-ai-dsh-experimental-tool-agent-team/use-this-package/when-to-choose-it:
21
21
  en: 60ea90ce57cca56f
22
22
  zh: 181e48b7d4dcf755
@@ -24,8 +24,8 @@
24
24
  en: 9af650a79711b3b3
25
25
  zh: 2930360011b544e0
26
26
  /deepseek-ai-dsh-experimental-tool-agent-team/use-this-package/what-the-model-can-do:
27
- en: be42811bbcc3b438
28
- zh: 014bd055ca694315
27
+ en: c282b13aff3a063d
28
+ zh: 01174628d93a51e4
29
29
  /deepseek-ai-dsh-experimental-tool-agent-team/use-this-package/what-success-and-failure-look-like:
30
30
  en: e49a980372c55892
31
31
  zh: d4bcdd36278d040d
@@ -39,8 +39,8 @@
39
39
  en: 29c1bff5023123be
40
40
  zh: 079c4819ec9ef277
41
41
  /deepseek-ai-dsh-experimental-tool-agent-team/understand-the-implementation/policy-and-tools:
42
- en: 3e730667f904c7bd
43
- zh: 7f48e6c07c615d77
42
+ en: 7122ab95b163c090
43
+ zh: f89f03ab22b5df14
44
44
  /deepseek-ai-dsh-experimental-tool-agent-team/understand-the-implementation/scoped-registration-and-teardown:
45
45
  en: c2b29f27a74c02c0
46
46
  zh: 026f2ef93dd604d8
@@ -54,14 +54,14 @@
54
54
  en: 8e1e365ff3b0dfb2
55
55
  zh: c6c91fbf1e1df934
56
56
  /deepseek-ai-dsh-experimental-tool-agent-team/model-experience/team-policy-and-tools/what-the-model-sees:
57
- en: e8687e69bcdf411d
58
- zh: 84480d4dd33cf339
57
+ en: f5c675d1aa0e59a4
58
+ zh: c927a37dbacaecdf
59
59
  /deepseek-ai-dsh-experimental-tool-agent-team/model-experience/team-policy-and-tools/token-effect:
60
- en: 3f49674f937a8ca3
61
- zh: 79d34d605732abb1
60
+ en: 32b6897a69e355e8
61
+ zh: a79cefd94b3eb180
62
62
  /deepseek-ai-dsh-experimental-tool-agent-team/model-experience/team-policy-and-tools/kv-cache-effect:
63
- en: 2ba143e89873e768
64
- zh: 4f09446c0fb13cdb
63
+ en: c02d0c895b827cb6
64
+ zh: f544cf24314e8b78
65
65
  /deepseek-ai-dsh-experimental-tool-agent-team/known-limitations-and-deferred-work:
66
66
  en: 945184aa77ac76dd
67
67
  zh: 620b07948615a019
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
9
9
 
10
10
  ## Summary
11
11
 
12
- This package lets the model create named teammates, send them messages, inspect availability, wait for progress, interrupt stuck work, and coordinate through a shared task board. Every team member receives the same nine tools and guidance for coordinating in a shared workspace. It replaces legacy subagent controls with the same tool names, so compositions that need both must disable the legacy definitions. The package is published under its experimental name and provides no stability guarantee.
12
+ This package lets the model create named teammates, send them messages, inspect availability, wait for progress, interrupt stuck work, and coordinate through a shared task board. Every team member receives the same nine tools and guidance for coordinating in a shared workspace, including how the Lead decides which subtasks to delegate and to which role. It replaces legacy subagent controls with the same tool names, so compositions that need both must disable the legacy definitions. The package is published under its experimental name and provides no stability guarantee.
13
13
 
14
14
  ## Table of Contents
15
15
 
@@ -25,7 +25,7 @@ This package lets the model create named teammates, send them messages, inspect
25
25
  <a id="use-this-package"></a>
26
26
  ## Use this package
27
27
 
28
- Add this package on top of `@deepseek-ai/dsh-experimental-agent-team` when the model should run a team through tools. Once mounted, every team member — the Lead and each teammate — gets the same nine tools plus the same coordination policy. Each member receives its current role and name through required runtime context; `spawn_teammate` sends the initial task unchanged.
28
+ Add this package on top of `@deepseek-ai/dsh-experimental-agent-team` when the model should run a team through tools. Once mounted, every team member — the Lead and each teammate — gets the same nine tools plus the same coordination policy. Each member receives its current role and name through required runtime context, and a teammate also receives the role description its Lead gave it; `spawn_teammate` sends the initial task unchanged.
29
29
 
30
30
  ### When to choose it
31
31
 
@@ -56,7 +56,7 @@ Try it by asking the Lead model: "create a teammate named reviewer to check the
56
56
 
57
57
  The nine tools group into four capabilities:
58
58
 
59
- - **Create a teammate** — `spawn_teammate` takes a name, a description, and the initial task; only the Lead can call it.
59
+ - **Create a teammate** — `spawn_teammate` takes a role-revealing name, a description of the teammate's role, and the initial task; only the Lead can call it.
60
60
  - **Send messages** — `send_message` steers a running member at its nearest step boundary, starts or resumes an inactive member.
61
61
  - **See and wait** — `list_agents` returns each member’s `target` and availability; `wait_agent` waits for the next team change; `interrupt_agent` stops a teammate's current turn (Lead only).
62
62
  - **Manage the task board** — `team_task_create`, `team_task_list`, `team_task_get`, and `team_task_update` add, browse, read, and update shared tasks.
@@ -95,7 +95,7 @@ The [Agent Teams Agent Note](../../../.agents/notes/implemented/feature/2026-08-
95
95
 
96
96
  ### Policy and tools
97
97
 
98
- One `team:policy` section on the member scope states the shared coordination rules; the fixed text and the nine tool registrations are declared in [`src/index.ts`](src/index.ts). The nine tool schemas are registered in scopes recognized as Team members at publication. Scoped registrations with the same names as the legacy global continuable-subagent controls shadow those globals for team members only.
98
+ One `team:policy` section on the member scope states the shared coordination rules and the Lead's orchestration guidance; the fixed text and the nine tool registrations are declared in [`src/index.ts`](src/index.ts). The nine tool schemas are registered in scopes recognized as Team members at publication. Scoped registrations with the same names as the legacy global continuable-subagent controls shadow those globals for team members only.
99
99
 
100
100
  ### Scoped registration and teardown
101
101
 
@@ -124,15 +124,15 @@ Read these pages when the package-level contract is not enough. They move from t
124
124
 
125
125
  #### What the model sees
126
126
 
127
- One shared system policy covers Team availability, shared-cwd safety, task coordination, Steer delivery, inbox acceptance, and the Lead’s duty to wait. All nine schemas are identical for Leads and teammates; execution enforces Lead-only operations. Required runtime context states `You are the Team Lead named "lead".` or `You are teammate "<name>".` with `Your Team Lead is named "lead".`, plus roster and messaging instructions. Identity comes from current Team membership, survives optional-context suppression, and is restored when compaction removes its snapshot. An ordinary fork from a teammate receives its current Lead identity.
127
+ One shared system policy covers Team availability, shared-cwd safety, Lead orchestration, task coordination, Steer delivery, inbox acceptance, and the Lead’s duty to wait. The orchestration paragraph is written about the Team Lead in the third person, so it reads correctly for teammates too: the Lead classifies the request’s subtasks by kind of work, keeps small, sequential, or tightly coupled ones, delegates independent, parallel, or disjoint-write ones to a teammate with exactly one role, records each delegated subtask on the shared task board, and verifies the results itself before the final answer. All nine schemas are identical for Leads and teammates; execution enforces Lead-only operations. `spawn_teammate` asks for a role-revealing `name` and a `description` that states the teammate’s role and responsibility. Required runtime context states `You are the Team Lead named "lead".` or `You are teammate "<name>".`, followed for a teammate by `Your role: <description>` (omitted when the roster has no description) and `Your Team Lead is named "lead".`, plus roster and messaging instructions. Identity comes from current Team membership and the roster row, survives optional-context suppression, and is restored when compaction removes its snapshot. An ordinary fork from a teammate receives its current Lead identity.
128
128
 
129
129
  #### Token effect
130
130
 
131
- Fixed policy and schema cost on every Team member request. Identity is part of the complete runtime-context snapshot. An unchanged retained snapshot adds no message; changed or removed context causes the loop to append a complete snapshot, including identity. Tool calls add compact JSON roster, task, wait, or receipt results. Peer content is retained by the Team domain in the target's history.
131
+ Fixed policy and schema cost on every Team member request; the orchestration paragraph adds about 190 words to that policy. Identity is part of the complete runtime-context snapshot, and a teammate’s role line adds its description (at most 200 characters). An unchanged retained snapshot adds no message; changed or removed context causes the loop to append a complete snapshot, including identity. Tool calls add compact JSON roster, task, wait, or receipt results. Peer content is retained by the Team domain in the target's history.
132
132
 
133
133
  #### KV Cache effect
134
134
 
135
- With the same provider/model, shared system policy, and tool schemas, a fork retains the parent request prefix and appends its task and current runtime context. Tool results and peer messages append after the reusable request prefix. Sessions recorded with identity inside the system prompt can change that prefix on their first request under this layout; actual provider cache hits remain best-effort.
135
+ With the same provider/model, shared system policy, and tool schemas, a fork retains the parent request prefix and appends its task and current runtime context. The policy is identical for the Lead and every teammate, so role-specific text lives only in runtime context after that prefix. Tool results and peer messages append after the reusable request prefix. Sessions recorded with identity inside the system prompt can change that prefix on their first request under this layout; actual provider cache hits remain best-effort.
136
136
 
137
137
  ## Known Limitations and Deferred Work
138
138
 
@@ -9,7 +9,7 @@ kind: "package-reference"
9
9
 
10
10
  ## 概述
11
11
 
12
- 本包让模型创建具名 teammate、向它们发送消息、查看可用状态、等待进展、中断卡住的工作,并通过共享任务板协调。每个团队成员都会获得相同的九个工具,以及在共享工作区协调的指引。它会取代同名的旧版 subagent 控件,因此同时需要两者的组合必须禁用旧定义。本包以实验性名称公开发布,但不提供稳定性保证。
12
+ 本包让模型创建具名 teammate、向它们发送消息、查看可用状态、等待进展、中断卡住的工作,并通过共享任务板协调。每个团队成员都会获得相同的九个工具,以及在共享工作区协调的指引,包括 Lead 如何决定委派哪些子任务以及交给哪种角色。它会取代同名的旧版 subagent 控件,因此同时需要两者的组合必须禁用旧定义。本包以实验性名称公开发布,但不提供稳定性保证。
13
13
 
14
14
  ## 目录
15
15
 
@@ -25,7 +25,7 @@ kind: "package-reference"
25
25
  <a id="use-this-package"></a>
26
26
  ## 使用本包
27
27
 
28
- 当模型应该通过工具运行一支团队时,在 `@deepseek-ai/dsh-experimental-agent-team` 之上挂载本包。挂载后,每个团队成员——Lead 与每个 teammate——都会获得相同的九个工具,以及相同的协作策略。`spawn_teammate` 原样发送初始任务;每个成员通过必需的 runtime context 接收当前角色和名字。
28
+ 当模型应该通过工具运行一支团队时,在 `@deepseek-ai/dsh-experimental-agent-team` 之上挂载本包。挂载后,每个团队成员——Lead 与每个 teammate——都会获得相同的九个工具,以及相同的协作策略。`spawn_teammate` 原样发送初始任务;每个成员通过必需的 runtime context 接收当前角色和名字,teammate 还会收到其 Lead 给它的角色描述。
29
29
 
30
30
  ### 何时选择
31
31
 
@@ -56,7 +56,7 @@ kind: "package-reference"
56
56
 
57
57
  九个工具分为四类能力:
58
58
 
59
- - **创建 teammate**——`spawn_teammate` 接收名字、描述与初始任务;只有 Lead 可以调用它。
59
+ - **创建 teammate**——`spawn_teammate` 接收能体现角色的名字、说明 teammate 角色的描述与初始任务;只有 Lead 可以调用它。
60
60
  - **发送消息**——`send_message` 在最近的步骤边界对运行中的成员进行 steering(中途引导)、启动或恢复非活动成员。
61
61
  - **查看与等待**——`list_agents` 返回各成员的 `target` 与可用状态;`wait_agent` 等待下一次团队变化;`interrupt_agent` 停止 teammate 的当前轮次(仅限 Lead)。
62
62
  - **管理任务板**——`team_task_create`、`team_task_list`、`team_task_get` 与 `team_task_update` 添加、浏览、读取与更新共享任务。
@@ -95,7 +95,7 @@ kind: "package-reference"
95
95
 
96
96
  ### 策略与工具
97
97
 
98
- member scope 上的一个 `team:policy` 段落说明共享的协作规则;固定文本与九个工具注册都声明在 [`src/index.ts`](src/index.ts)。九个工具 schema 注册在发布时被识别为 Team member 的 scope 中。与旧全局 continuable-subagent 控件同名的 scoped 注册只会为团队成员覆盖这些全局控件。
98
+ member scope 上的一个 `team:policy` 段落说明共享的协作规则与 Lead 的编排指引;固定文本与九个工具注册都声明在 [`src/index.ts`](src/index.ts)。九个工具 schema 注册在发布时被识别为 Team member 的 scope 中。与旧全局 continuable-subagent 控件同名的 scoped 注册只会为团队成员覆盖这些全局控件。
99
99
 
100
100
  ### 按作用域注册与拆除
101
101
 
@@ -124,15 +124,15 @@ member scope 上的一个 `team:policy` 段落说明共享的协作规则;固
124
124
 
125
125
  #### 模型看到什么
126
126
 
127
- 共享系统 policy 覆盖 Team 可用性、共享 cwd 安全、任务协调、Steer 投递、inbox 接收和 Lead 等待责任。Lead 与 teammate 使用相同的九个 schema;执行时落实 Lead-only 操作。必需的 runtime context 声明 `You are the Team Lead named "lead".`,或 `You are teammate "<name>".` 与 `Your Team Lead is named "lead".`,并提供 roster 和消息操作说明。身份来自当前 Team membership,关闭可选 context 时仍保留,压缩移除快照后会恢复。从 teammate 创建的普通 fork 会收到当前 Lead 身份。
127
+ 共享系统 policy 覆盖 Team 可用性、共享 cwd 安全、Lead 编排、任务协调、Steer 投递、inbox 接收和 Lead 等待责任。编排段落以第三人称描述 Team Lead,因此对 teammate 同样读得通:Lead 按工作类型对请求的子任务分类,自己保留小型、顺序执行或紧耦合的子任务,把独立、可并行或写范围不相交的子任务委派给只承担一个角色的 teammate,在共享任务板上记录每个被委派的子任务,并在最终回答前亲自整合并验证结果。Lead 与 teammate 使用相同的九个 schema;执行时落实 Lead-only 操作。`spawn_teammate` 要求提供能体现角色的 `name`,以及说明 teammate 角色与职责的 `description`。必需的 runtime context 声明 `You are the Team Lead named "lead".`,或 `You are teammate "<name>".`;teammate 随后还有 `Your role: <description>`(roster 没有描述时省略)与 `Your Team Lead is named "lead".`,并提供 roster 和消息操作说明。身份来自当前 Team membership 和 roster 行,关闭可选 context 时仍保留,压缩移除快照后会恢复。从 teammate 创建的普通 fork 会收到当前 Lead 身份。
128
128
 
129
129
  #### Token 影响
130
130
 
131
- 每次 Team member 请求都有固定策略与 schema 成本。身份是完整 runtime-context 快照的一部分。保留的快照未变化时不追加消息;context 变化或被移除时,loop 追加包含身份的完整快照。工具调用会增加紧凑 JSON roster、task、wait 或 receipt 结果。Peer 内容由 Team 领域保留在 target 历史中。
131
+ 每次 Team member 请求都有固定策略与 schema 成本;编排段落为该策略增加约 190 个英文单词。身份是完整 runtime-context 快照的一部分,teammate 的角色行会加入其描述(最多 200 个字符)。保留的快照未变化时不追加消息;context 变化或被移除时,loop 追加包含身份的完整快照。工具调用会增加紧凑 JSON roster、task、wait 或 receipt 结果。Peer 内容由 Team 领域保留在 target 历史中。
132
132
 
133
133
  #### KV Cache 影响
134
134
 
135
- provider/model、共享 system 策略和工具 schema 相同时,fork 保留父请求前缀并追加任务与当前 runtime context。工具结果与 peer 消息追加在可复用请求前缀之后。原先在 system prompt 中记录身份的 Session,首次使用此布局请求时可能改变该前缀;提供方实际缓存命中仍为尽力而为。
135
+ provider/model、共享 system 策略和工具 schema 相同时,fork 保留父请求前缀并追加任务与当前 runtime context。该策略对 Lead 与每个 teammate 完全相同,因此角色相关文本只出现在该前缀之后的 runtime context 中。工具结果与 peer 消息追加在可复用请求前缀之后。原先在 system prompt 中记录身份的 Session,首次使用此布局请求时可能改变该前缀;提供方实际缓存命中仍为尽力而为。
136
136
 
137
137
  ## 已知限制与延期工作
138
138
 
@@ -18,16 +18,39 @@ const Config = z.object({
18
18
  freshProvider: z.string().default("spawn"),
19
19
  forkProvider: z.string().default("fork")
20
20
  });
21
- /** Model-facing collaboration guidance shared by Lead and teammates. */
21
+ /**
22
+ * Model-facing collaboration guidance, identical for the Lead and every
23
+ * teammate so a fork reuses the Lead's request prefix. Lead-specific guidance
24
+ * is therefore written about the Lead in the third person.
25
+ * @param interrupt - whether `interrupt_agent` is registered and named in the text.
26
+ * @returns the complete `team:policy` section text.
27
+ */
22
28
  function teamPolicy(interrupt) {
23
29
  return `Agent Teams is available in this session
24
30
 
25
31
  The Team Lead and all teammates share the same working directory and filesystem. Edits are immediately visible to every member. Split write work into disjoint scopes, record expected write scopes on shared tasks, and use task dependencies when work must be ordered. Write-scope overlap is advisory, not a lock.
26
32
 
33
+ The Team Lead orchestrates the work and is the only member that calls spawn_teammate. The Lead first breaks the request into subtasks and classifies each by kind of work: exploration or research, implementation of a separable part, review or verification, or testing. The Lead keeps a subtask when it is small, sequential, tightly coupled to the Lead's current reasoning, or needs the whole conversation. It delegates a subtask that is independent and can run in parallel, has a write scope disjoint from other work, or benefits from a focused role with fresh context. It does not spawn a teammate for trivial work, and it prefers send_message to an inactive teammate whose role matches over spawning a new one. Each teammate gets exactly one role matched to its kind of work: a role-revealing name and a description that states the role and responsibility. The Lead records every delegated subtask as a shared task with acceptance criteria, write scopes, and blocked_by dependencies, then assigns it to the teammate's target with team_task_update reassign or tells the teammate to claim it. The Lead integrates and verifies the teammates' results itself before the final answer.
34
+
27
35
  Prefer read/edit/write for file changes. If a file operation returns FS_STALE_VERSION, read the current file, rebase your intended change onto the new content, and retry. Bash, formatters, code generators, and scripts are not fully protected by the filesystem version guard; coordinate them explicitly and have the Lead review the final diff and run tests.
28
36
 
29
37
  Use the target returned by spawn_teammate or list_agents for send_message${interrupt ? " and interrupt_agent" : ""}, or as owner when assigning or filtering shared tasks. send_message steers a running target at its nearest step boundary and starts or resumes an inactive target. inactive means no turn is executing; it does not describe task completion, success, failure, or waiting for other agents. provisioning means member creation is in progress; failed means member creation failed. A peer message starts with its sender name. A successful send does not mean the recipient has processed it. Shared-task workflow is list, get, claim with the current revision, perform the work, then complete. Task readiness never starts an owner. Before wait_agent, use list_agents and make sure another required member is running or provisioning; use send_message first when the required member is inactive. wait_agent observes only changes after that call starts, never wakes a member, and returns noProgress immediately when no other member can produce a change. Re-list after wakeup or timeout. The Lead must wait for required teammates before giving the final answer.`;
30
38
  }
39
+ /**
40
+ * Render the teammate-specific identity lines of the `team:identity` context.
41
+ * @param name - the teammate's roster name.
42
+ * @param description - the role the Lead gave at creation; blank or absent omits the role line.
43
+ * @returns the lines that precede the shared roster and messaging instructions.
44
+ */
45
+ function teammateIdentity(name, description) {
46
+ const role = description?.trim();
47
+ return [
48
+ `You are teammate "${name}".`,
49
+ ...role === void 0 || role === "" ? [] : [`Your role: ${role}`],
50
+ "Your Team Lead is named \"lead\".",
51
+ "To message your Team Lead, use send_message({ target: \"lead\", message: \"...\" })."
52
+ ].join("\n");
53
+ }
31
54
  const ACTIVE_WAIT_STATUSES = new Set(["running", "provisioning"]);
32
55
  const NO_ACTIVE_PEER_MESSAGE = "No other Team member is running or provisioning. wait_agent cannot make progress or wake inactive teammates. Re-list with list_agents and team_task_list, then use send_message to wake each required inactive teammate before waiting again.";
33
56
  /**
@@ -242,7 +265,8 @@ function install(agent, ctx, config) {
242
265
  required: true,
243
266
  text: () => {
244
267
  const { role, name } = ctx.agentTeams.membership(agent);
245
- return `${role === "lead" ? "You are the Team Lead named \"lead\"." : `You are teammate "${name}".\nYour Team Lead is named "lead".\nTo message your Team Lead, use send_message({ target: "lead", message: "..." }).`}
268
+ const description = ctx.agentTeams.listMembers(agent).find((member) => member.id === agent.id)?.description;
269
+ return `${role === "lead" ? "You are the Team Lead named \"lead\"." : teammateIdentity(name, description)}
246
270
  Use list_agents({}) to find your teammates and their names.
247
271
  To message another teammate, use send_message({ target: "<teammate name>", message: "..." }).`;
248
272
  }
@@ -254,12 +278,12 @@ To message another teammate, use send_message({ target: "<teammate name>", messa
254
278
  name: {
255
279
  type: "string",
256
280
  required: true,
257
- description: "Unique lower-kebab-case teammate name."
281
+ description: "Unique lower-kebab-case teammate name that reveals its role, such as reviewer or test-writer."
258
282
  },
259
283
  description: {
260
284
  type: "string",
261
285
  required: true,
262
- description: "Short description of the delegated responsibility."
286
+ description: "The teammate's role: the kind of work it owns and its responsibility, in at most 200 characters. The teammate receives it as its role, and list_agents shows it."
263
287
  },
264
288
  prompt: {
265
289
  type: "string",
@@ -264,75 +264,62 @@ function toPiAssistant(message, onDegrade) {
264
264
  * @module dsh-llm-pi-ai/catalog-supplement
265
265
  */
266
266
  /** One provider route's supplemental models, keyed by model id. */
267
- const SUPPLEMENT = {
268
- anthropic: { "claude-haiku-5-5": {
269
- id: "claude-haiku-5-5",
270
- name: "Claude Haiku 5.5",
271
- api: "anthropic-messages",
272
- provider: "anthropic",
273
- baseUrl: "https://api.anthropic.com",
267
+ const SUPPLEMENT = { openrouter: {
268
+ "deepseek/deepseek-v4.1-flash-1017": {
269
+ id: "deepseek/deepseek-v4.1-flash-1017",
270
+ name: "DeepSeek: DeepSeek V4.1 Flash (1017)",
271
+ api: "openai-completions",
272
+ provider: "openrouter",
273
+ baseUrl: "https://openrouter.ai/api/v1",
274
274
  reasoning: true,
275
275
  input: ["text", "image"],
276
276
  cost: {
277
- input: .1,
278
- output: .5,
279
- cacheRead: .01,
280
- cacheWrite: .125,
281
- tiers: [{
282
- inputTokensAbove: 1e5,
283
- input: .5,
284
- output: 2.5,
285
- cacheRead: .05,
286
- cacheWrite: .625
287
- }]
277
+ input: .05,
278
+ output: .6,
279
+ cacheRead: .006,
280
+ cacheWrite: 0
288
281
  },
289
282
  contextWindow: 1e6,
290
- maxTokens: 128e3,
283
+ maxTokens: 943718,
291
284
  compat: {
292
- supportsMidConvoEffort: true,
293
- supportsMidConvoSystemMessages: true,
294
- supportsMidConvoToolChanges: true,
295
- forceAdaptiveThinking: true,
296
- supportsStrictTools: true
285
+ supportsDeveloperRole: false,
286
+ thinkingFormat: "openrouter",
287
+ supportsStrictMode: true,
288
+ sendSessionAffinityHeaders: true,
289
+ requiresReasoningContentOnAssistantMessages: true
297
290
  },
298
291
  thinkingLevelMap: {
299
- off: null,
300
- xhigh: "xhigh",
292
+ off: "none",
293
+ minimal: null,
294
+ low: "low",
295
+ medium: null,
296
+ high: "high",
297
+ xhigh: null,
301
298
  max: "max"
302
299
  },
303
- promptCache: {
304
- short: 300,
305
- long: 3600
306
- },
307
- inputLimits: {
308
- maxRequestBytes: 33554432,
309
- images: {
310
- maxPerRequest: 600,
311
- resize: {
312
- maxWidth: 2e3,
313
- maxHeight: 2e3,
314
- maxBytes: 4718592,
315
- jpegQuality: 80
316
- }
317
- }
318
- },
300
+ inputLimits: { images: { resize: {
301
+ maxWidth: 2e3,
302
+ maxHeight: 2e3,
303
+ maxBytes: 4718592,
304
+ jpegQuality: 80
305
+ } } },
319
306
  type: "chat"
320
- } },
321
- openrouter: { "deepseek/deepseek-v4.1-flash-1017": {
322
- id: "deepseek/deepseek-v4.1-flash-1017",
323
- name: "DeepSeek: DeepSeek V4.1 Flash (1017)",
307
+ },
308
+ "moonshotai/kimi-k3.1-pro": {
309
+ id: "moonshotai/kimi-k3.1-pro",
310
+ name: "MoonshotAI: Kimi K3.1 Pro",
324
311
  api: "openai-completions",
325
312
  provider: "openrouter",
326
313
  baseUrl: "https://openrouter.ai/api/v1",
327
314
  reasoning: true,
328
315
  input: ["text", "image"],
329
316
  cost: {
330
- input: .05,
331
- output: .6,
332
- cacheRead: .006,
317
+ input: 2,
318
+ output: 10,
319
+ cacheRead: .2,
333
320
  cacheWrite: 0
334
321
  },
335
- contextWindow: 1e6,
322
+ contextWindow: 1048576,
336
323
  maxTokens: 943718,
337
324
  compat: {
338
325
  supportsDeveloperRole: false,
@@ -357,8 +344,8 @@ const SUPPLEMENT = {
357
344
  jpegQuality: 80
358
345
  } } },
359
346
  type: "chat"
360
- } }
361
- };
347
+ }
348
+ } };
362
349
  /**
363
350
  * Supplemental catalog models for one pi-ai provider route.
364
351
  * @param provider - provider route key.
@@ -81,14 +81,14 @@
81
81
  en: dc8544657916e194
82
82
  zh: b0feff0764b5d903
83
83
  /deepseek-ai-dsh-subagent/model-experience/child-delegation-scope-statement/what-the-model-sees:
84
- en: 61906b6a7b656eeb
85
- zh: 2fa94349714efc9f
84
+ en: 92db374bf2a6ef86
85
+ zh: 7b36788c16ee7f9a
86
86
  /deepseek-ai-dsh-subagent/model-experience/child-delegation-scope-statement/what-the-model-sees/the-delegation-scope-statement:
87
87
  en: 960e4abc8393bcd1
88
88
  zh: e125aa2bab1570d0
89
89
  /deepseek-ai-dsh-subagent/model-experience/child-delegation-scope-statement/token-effect:
90
- en: 4e0b922b186dc2a9
91
- zh: 7453563417c5b9a2
90
+ en: c2743ba27edbb9ad
91
+ zh: f5bf886852d5d93a
92
92
  /deepseek-ai-dsh-subagent/model-experience/child-delegation-scope-statement/kv-cache-effect:
93
93
  en: 59e848fca82a46fb
94
94
  zh: fcd6a8a2bb58609f
@@ -178,17 +178,17 @@ Append-only in the parent: the notice follows its reusable request prefix. Reach
178
178
 
179
179
  #### What the model sees
180
180
 
181
- Every in-process child's runtime-context snapshot carries the `subagent:delegation` statement below, after the sandbox-policy and approval-policy sentences.
181
+ Every in-process child's runtime-context snapshot carries the `subagent:delegation` statement below, after the sandbox-policy and approval-policy sentences. It states the child's fixed permission scope and asks for one short sentence of narration before each tool call. A host that follows a child's work reads the last sentence of the child's latest assistant message; the child's result is still its last non-empty assistant message.
182
182
 
183
183
  ##### The delegation-scope statement
184
184
 
185
185
  ```markdown
186
- You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the job needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.
186
+ You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Before each tool call, say in one short sentence what you are doing and why it serves the task, so your progress can be followed.
187
187
  ```
188
188
 
189
189
  #### Token effect
190
190
 
191
- One fixed statement in each child's runtime-context snapshot; none in the parent's requests.
191
+ One fixed statement in each child's runtime-context snapshot, about 30 tokens of it the narration request; none in the parent's requests.
192
192
 
193
193
  #### KV Cache effect
194
194
 
@@ -178,17 +178,17 @@ kind: "package-reference"
178
178
 
179
179
  #### 模型看到什么
180
180
 
181
- 每个进程内子 agent 的运行时上下文快照都携带下方的 `subagent:delegation` 声明,位于沙箱策略与审批策略语句之后。
181
+ 每个进程内子 agent 的运行时上下文快照都携带下方的 `subagent:delegation` 声明,位于沙箱策略与审批策略语句之后。它说明子 agent 固定的权限范围,并要求在每次工具调用前用一句简短的话叙述进展。跟踪子 agent 工作的宿主读取该子 agent 最新 assistant 消息的最后一句;子 agent 的结果仍是它最后一条非空 assistant 消息。
182
182
 
183
183
  ##### 委派范围声明
184
184
 
185
185
  ```markdown
186
- You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the job needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.
186
+ You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Before each tool call, say in one short sentence what you are doing and why it serves the task, so your progress can be followed.
187
187
  ```
188
188
 
189
189
  #### Token 影响
190
190
 
191
- 每个子 agent 的运行时上下文快照中一条固定声明;父级请求中没有任何新增。
191
+ 每个子 agent 的运行时上下文快照中一条固定声明,其中叙述要求约占 30 个 token;父级请求中没有任何新增。
192
192
 
193
193
  #### KV Cache 影响
194
194
 
@@ -357,11 +357,14 @@ function childSessionMeta(parent, childDepth, isSeeded, selectedPreset) {
357
357
  };
358
358
  }
359
359
  /**
360
- * Model-facing delegation-scope statement for every in-process child. A
361
- * runtime-context contribution rather than a system-prompt section, so the
362
- * deployment's system prompt stays uniform across parents and children.
363
- */
364
- const SUBAGENT_DELEGATION_CONTEXT = "You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it.";
360
+ * Model-facing delegation statement for every in-process child: the fixed
361
+ * permission scope, and one sentence of progress narration before each tool
362
+ * call, which hosts that follow a child's work read from its assistant
363
+ * messages. A runtime-context contribution rather than a system-prompt
364
+ * section, so the deployment's system prompt stays uniform across parents and
365
+ * children.
366
+ */
367
+ const SUBAGENT_DELEGATION_CONTEXT = "You are a delegated subagent: your permission scope was fixed when you were started and cannot be widened from inside this session — operations that require approval are rejected automatically. When the task needs access beyond that scope, do not retry the denied operation; state the limitation in your reply so the delegating agent can handle it. Before each tool call, say in one short sentence what you are doing and why it serves the task, so your progress can be followed.";
365
368
  /**
366
369
  * Compose a child before publication and restore historical descriptor overrides.
367
370
  * Explicit selection mounts the named preset; omission synchronously joins the
@@ -120,14 +120,19 @@ export function childSessionMeta(parent, childDepth, isSeeded, selectedPreset) {
120
120
  };
121
121
  }
122
122
  /**
123
- * Model-facing delegation-scope statement for every in-process child. A
124
- * runtime-context contribution rather than a system-prompt section, so the
125
- * deployment's system prompt stays uniform across parents and children.
123
+ * Model-facing delegation statement for every in-process child: the fixed
124
+ * permission scope, and one sentence of progress narration before each tool
125
+ * call, which hosts that follow a child's work read from its assistant
126
+ * messages. A runtime-context contribution rather than a system-prompt
127
+ * section, so the deployment's system prompt stays uniform across parents and
128
+ * children.
126
129
  */
127
130
  export const SUBAGENT_DELEGATION_CONTEXT = 'You are a delegated subagent: your permission scope was fixed when you were started and cannot be '
128
131
  + 'widened from inside this session — operations that require approval are rejected automatically. '
129
132
  + 'When the task needs access beyond that scope, do not retry the denied operation; state the '
130
- + 'limitation in your reply so the delegating agent can handle it.';
133
+ + 'limitation in your reply so the delegating agent can handle it. '
134
+ + 'Before each tool call, say in one short sentence what you are doing and why it serves the task, '
135
+ + 'so your progress can be followed.';
131
136
  /**
132
137
  * Compose a child before publication and restore historical descriptor overrides.
133
138
  * Explicit selection mounts the named preset; omission synchronously joins the
@@ -21,11 +21,11 @@
21
21
  en: 312d9a3ea1cbb673
22
22
  zh: 937ff76d6bdcca22
23
23
  /deepseek-ai-dsh-tui-app/use-this-package/the-screen:
24
- en: 6d16c1e12149ace4
25
- zh: 24a57b64875568c2
24
+ en: 0fd2e1e0c9e7f8bf
25
+ zh: 8041451328c18841
26
26
  /deepseek-ai-dsh-tui-app/use-this-package/keys-and-commands:
27
- en: 2bf5e6b8a72663e4
28
- zh: b2ff69e277c4bdb4
27
+ en: 5c945c0e6dc13bad
28
+ zh: 0bab4493f437e489
29
29
  /deepseek-ai-dsh-tui-app/use-this-package/background-tool-calls:
30
30
  en: 322ae3c6d76383ec
31
31
  zh: 8c38eee4b57ed8dd
@@ -51,14 +51,14 @@
51
51
  en: e6c3923481cbf9e6
52
52
  zh: 0bca6c917dd26cbc
53
53
  /deepseek-ai-dsh-tui-app/understand-the-implementation/rendering-model:
54
- en: 42cc6ac3475fba61
55
- zh: 450342bc7b31cb61
54
+ en: ee593519f59c7a36
55
+ zh: 351fa58a43b483ff
56
56
  /deepseek-ai-dsh-tui-app/understand-the-implementation/patch-surface-over-base:
57
57
  en: 142f04bf29e981dd
58
58
  zh: a1689297b06c9ca6
59
59
  /deepseek-ai-dsh-tui-app/understand-the-implementation/source-map:
60
- en: 405fffcf257e13a2
61
- zh: 043db02313c45d23
60
+ en: af09904807f7cbe0
61
+ zh: 476d55baa67202c8
62
62
  /deepseek-ai-dsh-tui-app/understand-the-implementation/invariant-ownership:
63
63
  en: 0ddf6de8928026d5
64
64
  zh: 24feedcbb9e9d676
@@ -111,8 +111,8 @@
111
111
  en: 1dadc4a2f1560eaa
112
112
  zh: dc4697c269bc16b9
113
113
  /deepseek-ai-dsh-tui-app/known-limitations-and-deferred-work:
114
- en: 26e125a8a59bd810
115
- zh: 63c9e3bd6e8a56a4
114
+ en: bf6036f0f1c77e31
115
+ zh: b93daa37a5e13931
116
116
  /deepseek-ai-dsh-tui-app/known-limitations-and-deferred-work/dev-note:
117
117
  en: 5629c6159cec997f
118
118
  zh: 17f2d7e1f96da7f1