@deepseek-ai/dsh-tool-subagent-control 0.1.6-alpha.2 → 0.1.7-alpha.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
@@ -2,5 +2,5 @@
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
4
  # pnpm run verify-translation-pairing --write packages/subagent/tool-subagent-control/README.md
5
- README.md: 99ca52dd4a7ea2629441c4d661632b8598c8171d
6
- README.zh.md: 1ff49a3179dbe61db1a9353e2fab131082cb29ae
5
+ README.md: 2cfa000f1ba9f7950b28369a9b7bd3523610b579
6
+ README.zh.md: f2154fde965899e7b4f30271846bce52414b010d
package/README.md CHANGED
@@ -46,7 +46,7 @@ This package takes no configuration: the root plugin provides `send_message` and
46
46
 
47
47
  ### send_message
48
48
 
49
- Sends a message to an Agent named by `agent_id`: any exact live Agent may target its direct continuable child, while a resident continuable child may also target its direct parent. A working target receives the message at its nearest step boundary through Steer; an idle target starts a turn, and a cold direct child resumes through the continuation lifecycle. The call returns only acceptance (the accepted message's stable `messageId`), never a reply. A failure — an unsupported target, unavailable parent, unknown child, descriptor-less child that cannot be resumed, or rejected admission — states the message was not delivered.
49
+ Sends a message to an Agent named by `agent_id`: any exact live Agent may target its direct continuable child, while a resident continuable child may also target its direct parent. A working target receives the message at its nearest step boundary through Steer; an inactive target starts or resumes a turn through the continuation lifecycle. The call returns only acceptance (the accepted message's stable `messageId`), never a reply. A failure — an unsupported target, unavailable parent, unknown child, descriptor-less child that cannot be resumed, or rejected admission — states the message was not delivered.
50
50
 
51
51
  ### interrupt_agent
52
52
 
@@ -54,7 +54,7 @@ Stops only the target's current turn: queued messages stay parked until a later
54
54
 
55
55
  ### list_agents
56
56
 
57
- Lists the continuable children below the calling agent: `children` (default) shows direct children, `descendants` walks the whole tree in stable pre-order, annotating each entry with its durable direct-parent session id and depth. Status comes from the live Agent registry — `running`, `idle`, or `ready`. One-shot children are intentionally absent because they cannot accept `send_message`, and unreadable candidates appear as diagnostics.
57
+ Lists the continuable children below the calling agent: `children` (default) reads direct children from the parent catalog without opening child logs; `descendants` walks the whole tree in stable pre-order, annotating each entry with its durable direct-parent session id and depth. Status comes from the live Agent registry — `running` or `inactive`. One-shot children are intentionally absent because they cannot accept `send_message`, and unreadable candidates appear as diagnostics only in `descendants` scope.
58
58
 
59
59
  -----
60
60
 
@@ -150,7 +150,7 @@ Append-only; newly visible content follows the reusable request prefix and does
150
150
 
151
151
  #### What the model sees
152
152
 
153
- One line per continuable child in stable catalog order: `<id> [<status>] — <label>` (`running` = active driver, `idle` = resident between turns, `ready` = storage only, resumable rather than terminal), plus `<id> [diagnostic: <reason>]` for a candidate that could not be read. The `descendants` scope inserts ` parent=<id> depth=<n>` before the label dash on every line, in pre-order. One-shot children are intentionally absent; `(no subagents)` means no continuable child or diagnostic survived the projection.
153
+ One line per continuable child in stable catalog order: `<id> [<status>] — <label>` (`running` = executing a turn; `inactive` = no turn executing, whether loaded or stored; neither status describes task completion or outcome). Only `descendants` scope adds `<id> [diagnostic: <reason>]` for a candidate that could not be read. The `descendants` scope inserts ` parent=<id> depth=<n>` before the label dash on every line, in pre-order. One-shot children are intentionally absent; `(no subagents)` means no continuable child or diagnostic survived the projection.
154
154
 
155
155
  #### Token effect
156
156
 
@@ -169,7 +169,7 @@ These limits define what the control tools cannot observe or steer; they are cur
169
169
 
170
170
  - **A delivered message has no independent result** — acceptance returns only its inbox `messageId`; later target work lands in that target's durable Session and is never collected through this tool. A reply is another explicitly addressed `send_message`, not this call's result.
171
171
  - **Only supported adjacent Agents can communicate** — every sender may target a direct continuable child, only a sender with a resident continuable Activation may target its direct parent, and that parent must remain live; siblings and deeper descendants are not message targets, and only direct-child delivery supports cold activation.
172
- - **Listing is a snapshot, not a delivery promise** — it may race publication, disposal, or a later message, and another process may activate a child this process reports as `ready`; cross-process accuracy requires a shared lease. `interrupt_agent` performs the authoritative live-lineage check itself, so discovery staleness cannot grant authority.
172
+ - **Listing is a snapshot, not a delivery promise** — it may race publication, disposal, or a later message, and another process may activate a child this process reports as `inactive`; cross-process accuracy requires a shared lease. `interrupt_agent` performs the authoritative live-lineage check itself, so discovery staleness cannot grant authority.
173
173
  - **No pagination or deletion** — the complete stably ordered set is returned, and persisted children remain listed for as long as their sessions remain in persistence; a service-level bound or delete operation is a later product decision.
174
174
 
175
175
  <a id="dev-note"></a>
package/README.zh.md CHANGED
@@ -46,7 +46,7 @@ kind: "package-reference"
46
46
 
47
47
  ### send_message
48
48
 
49
- 向 `agent_id` 指定的 Agent 发送消息:任何确切在线 Agent 都可以向自己的直接可继续子级发送消息,驻留的可继续子级还可以向自己的直接父级发送消息。正在工作的目标通过 Steer 在最近的步骤边界接收消息;空闲目标会启动一个轮次,冷状态的直接子级会通过继续执行生命周期恢复。调用只返回接受结果(被接受消息的稳定 `messageId`),绝不返回回复。失败——不受支持的目标、不可用的父级、未知子级、缺少描述符而无法恢复的子级,或准入被拒——会明确说明消息未送达。
49
+ 向 `agent_id` 指定的 Agent 发送消息:任何确切在线 Agent 都可以向自己的直接可继续子级发送消息,驻留的可继续子级还可以向自己的直接父级发送消息。正在工作的目标通过 Steer 在最近的步骤边界接收消息;非活跃目标会通过继续执行生命周期启动或恢复一个轮次。调用只返回接受结果(被接受消息的稳定 `messageId`),绝不返回回复。失败——不受支持的目标、不可用的父级、未知子级、缺少描述符而无法恢复的子级,或准入被拒——会明确说明消息未送达。
50
50
 
51
51
  ### interrupt_agent
52
52
 
@@ -54,7 +54,7 @@ kind: "package-reference"
54
54
 
55
55
  ### list_agents
56
56
 
57
- 列出调用方 agent 下方的可继续子级:`children`(默认)只显示直接子级,`descendants` 按稳定前序遍历整棵树,并为每个条目标注其持久化直接父级会话 ID 与深度。状态来自在线 Agent 注册表——`running`、`idle` 或 `ready`。一次性子级因无法接受 `send_message` 而被有意排除,无法读取的候选项以诊断信息呈现。
57
+ 列出调用方 agent 下方的可继续子级:`children`(默认)从父目录读取直接子级,不打开子日志;`descendants` 按稳定前序遍历整棵树,并为每个条目标注其持久化直接父级会话 ID 与深度。状态来自在线 Agent 注册表——`running` 或 `inactive`。一次性子级因无法接受 `send_message` 而被有意排除,无法读取的候选项仅在 `descendants` 作用域中以诊断信息呈现。
58
58
 
59
59
  -----
60
60
 
@@ -150,7 +150,7 @@ kind: "package-reference"
150
150
 
151
151
  #### 模型看到什么
152
152
 
153
- 按稳定目录顺序,每个可继续子级占一行:`<id> [<status>] — <label>`(`running` 表示驱动器活跃,`idle` 表示驻留但处于轮次之间,`ready` 表示仅存于存储,可恢复而非终态),另为无法读取的候选项渲染 `<id> [diagnostic: <reason>]`。`descendants` 作用域会在每行标签的破折号之前按前序插入 ` parent=<id> depth=<n>`。一次性子级会被有意排除;`(no subagents)` 表示投影后没有留下可继续子级或诊断信息。
153
+ 按稳定目录顺序,每个可继续子级占一行:`<id> [<status>] — <label>`(`running` 表示正在执行轮次;`inactive` 表示没有轮次在执行,包括已加载和仅存于存储的情况;两种状态均不表示任务完成或结果)。仅 `descendants` 作用域会为无法读取的候选项添加 `<id> [diagnostic: <reason>]`。`descendants` 作用域会在每行标签的破折号之前按前序插入 ` parent=<id> depth=<n>`。一次性子级会被有意排除;`(no subagents)` 表示投影后没有留下可继续子级或诊断信息。
154
154
 
155
155
  #### Token 影响
156
156
 
@@ -169,7 +169,7 @@ kind: "package-reference"
169
169
 
170
170
  - **已投递消息没有独立结果**——接受时只返回其 inbox `messageId`;目标后续工作会落入该目标的持久化会话,绝不会通过本工具收集。回复是另一条显式指定地址的 `send_message`,而非本次调用的结果。
171
171
  - **只有受支持的相邻 Agent 可以通信**——每个发送方都可以向直接可继续子级发送消息;只有具备驻留可继续 Activation 的发送方可以向自己的直接父级发送消息,且该父级必须仍在线;同级与更深的后代不能作为消息目标,只有向直接子级投递才支持冷激活。
172
- - **列表是快照,而非投递承诺**——它可能与发布、dispose(资源释放)或后续消息发生竞态,另一个进程也可能激活当前进程报告为 `ready` 的子级;跨进程准确性需要共享租约。`interrupt_agent` 自己执行权威的在线 lineage 检查,因此过期的发现结果不会授予权限。
172
+ - **列表是快照,而非投递承诺**——它可能与发布、dispose(资源释放)或后续消息发生竞态,另一个进程也可能激活当前进程报告为 `inactive` 的子级;跨进程准确性需要共享租约。`interrupt_agent` 自己执行权威的在线 lineage 检查,因此过期的发现结果不会授予权限。
173
173
  - **没有分页或删除**——系统返回完整且稳定排序的集合;只要子级会话仍在持久化存储中,它就会继续出现在列表中,服务级上限或删除操作留待后续产品决策。
174
174
 
175
175
  <a id="dev-note"></a>
package/lib/index.js CHANGED
@@ -21,7 +21,7 @@ const inject = ["tools", "subagents"];
21
21
  function apply(ctx) {
22
22
  ctx.tools.register(markAdjacentAgentSendMessageTool(defineTool({
23
23
  name: "send_message",
24
- description: "Send a message to a direct continuable child by its agent id. If you are a resident continuable child, you may also target your direct parent. If the target is still working, the message steers its nearest step; if it is idle, the message starts a turn. This call returns no answer from the agent — only confirmation that the message was delivered. A failure means the message was NOT delivered.",
24
+ description: "Send a message to a direct continuable child by its agent id. If you are a resident continuable child, you may also target your direct parent. If the target is still working, the message steers its nearest step; if it is inactive, the message starts or resumes a turn. This call returns no answer from the agent — only confirmation that the message was delivered. A failure means the message was NOT delivered.",
25
25
  parameters: {
26
26
  agent_id: {
27
27
  type: "string",
@@ -22,7 +22,7 @@ export function apply(ctx) {
22
22
  name: 'send_message',
23
23
  description: 'Send a message to a direct continuable child by its agent id. If you are a resident continuable child, '
24
24
  + 'you may also target your direct parent. If the target is still working, the message steers its nearest step; '
25
- + 'if it is idle, the message starts a turn. This call returns no answer from the agent — only confirmation '
25
+ + 'if it is inactive, the message starts or resumes a turn. This call returns no answer from the agent — only confirmation '
26
26
  + 'that the message was delivered. A failure means the message was NOT delivered.',
27
27
  parameters: {
28
28
  agent_id: {
@@ -14,23 +14,14 @@ export const inject = ['tools', 'subagents', 'agents'];
14
14
  function resolveListAgentsRequest(request) {
15
15
  return { scope: request.scope ?? 'children' };
16
16
  }
17
- /**
18
- * Refine one candidate's status through the live Agent registry: `running`
19
- * for an active driver, `idle` for a resident Agent between turns (possibly
20
- * waiting on agents it started), and `ready` when no live Agent remains.
21
- * `ready` preserves resumability without presenting an inactive conversation
22
- * as a terminal result to collect.
23
- */
17
+ /** Report turn activity without exposing whether the child is loaded. */
24
18
  function statusOf(agents, id) {
25
- const agent = agents.get(id);
26
- if (agent === undefined)
27
- return 'ready';
28
- return agent.status === 'running' ? 'running' : 'idle';
19
+ return agents.get(id)?.status === 'running' ? 'running' : 'inactive';
29
20
  }
30
21
  /** Project one service row into the model-facing entry, or omit a one-shot child. */
31
22
  function project(agents, entry, position) {
32
23
  const at = position === undefined ? {} : { parent: position.parentId, depth: position.depth };
33
- if (entry.kind === 'diagnostic') {
24
+ if ('kind' in entry && entry.kind === 'diagnostic') {
34
25
  return { kind: 'diagnostic', id: entry.id, reason: entry.reason, ...at };
35
26
  }
36
27
  // One-shot children cannot be continued by send_message, so the model
@@ -54,13 +45,13 @@ export function apply(ctx) {
54
45
  name: 'list_agents',
55
46
  description: 'List your continuable background subagents by durable id and label. Use it to recall which ones '
56
47
  + 'you started, not to poll for completion — you are told when one finishes. Status comes from the live '
57
- + 'registry: running means the agent is working right now, idle means it is loaded but between turns '
58
- + '(it may be waiting on agents it started), and ready means it exists only in storage — resumable, not '
59
- + 'terminal, and not a result waiting to be collected; a `send_message` steers a running child at its nearest '
60
- + 'step boundary or starts a turn for an idle or ready child, and a direct child remains a `send_message` '
48
+ + 'registry: running means the agent is working right now; inactive means no turn is executing, whether '
49
+ + 'the child is loaded or must be resumed. inactive does not describe task completion, success, failure, '
50
+ + 'or waiting for other agents. A `send_message` steers a running child at its nearest step boundary '
51
+ + 'or starts or resumes a turn for an inactive child, and a direct child remains a `send_message` '
61
52
  + 'candidate in every status. The snapshot is not a delivery '
62
53
  + 'promise — `send_message` performs the authoritative check and may still fail. Children that could '
63
- + 'not be read are reported as diagnostics instead of being silently dropped. Scope `descendants` '
54
+ + 'not be read are reported as diagnostics only in `descendants` scope. Scope `descendants` '
64
55
  + 'walks the whole tree below you in stable pre-order, annotating each entry with its durable direct-parent '
65
56
  + 'session id and depth. You may use `send_message` only for depth-1 entries; deeper entries are '
66
57
  + 'candidates for `interrupt_agent` only.',
@@ -83,7 +74,7 @@ export function apply(ctx) {
83
74
  kind: { type: 'string', required: true, enum: ['child'] },
84
75
  id: { type: 'string', required: true },
85
76
  label: { type: 'string', required: true },
86
- status: { type: 'string', required: true, enum: ['running', 'idle', 'ready'] },
77
+ status: { type: 'string', required: true, enum: ['running', 'inactive'] },
87
78
  parent: { type: 'string' },
88
79
  depth: { type: 'number' },
89
80
  },
@@ -129,8 +120,6 @@ export function apply(ctx) {
129
120
  throw new Error('list_agents requires a calling agent (exec.agent was undefined)');
130
121
  }
131
122
  const request = resolveListAgentsRequest(args);
132
- // The registry drains started tool bodies, so the scan must observe the
133
- // call's signal rather than finish a slow catalog after cancellation.
134
123
  switch (request.scope) {
135
124
  case 'children': {
136
125
  const entries = await ctx.subagents.listChildren(parent.id, exec.signal);
@@ -139,6 +128,7 @@ export function apply(ctx) {
139
128
  .filter(entry => entry !== undefined);
140
129
  }
141
130
  case 'descendants': {
131
+ // Complete-corpus reads can await storage, so they observe tool cancellation.
142
132
  const entries = await ctx.subagents.listDescendants(parent.id, exec.signal);
143
133
  return entries
144
134
  .map(entry => project(ctx.agents, entry, entry))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@deepseek-ai/dsh-tool-subagent-control",
3
3
  "description": "Globally named send_message, interrupt_agent, and list_agents tools over ctx.subagents continuations",
4
- "version": "0.1.6-alpha.2",
4
+ "version": "0.1.7-alpha.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -32,30 +32,30 @@
32
32
  ],
33
33
  "license": "MIT",
34
34
  "peerDependencies": {
35
- "@deepseek-ai/cordis": "^4.0.2",
36
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
37
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
38
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
39
- "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2"
35
+ "@deepseek-ai/dsh-llm": "^0.1.7-alpha.1",
36
+ "@deepseek-ai/cordis": "^4.0.3",
37
+ "@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
38
+ "@deepseek-ai/dsh-subagent": "^0.1.7-alpha.1",
39
+ "@deepseek-ai/dsh-tools": "^0.1.7-alpha.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@deepseek-ai/cordis": "^4.0.2",
43
- "@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
44
- "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.6-alpha.2",
45
- "@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
46
- "@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
47
- "@deepseek-ai/dsh-session-persistence": "^0.1.6-alpha.2",
48
- "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
49
- "@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
50
- "@deepseek-ai/dsh-session-query": "^0.1.6-alpha.2",
51
- "@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
52
- "@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
53
- "@deepseek-ai/dsh-subagent-fork-in-process": "^0.1.6-alpha.2",
54
- "@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.6-alpha.2",
55
- "@deepseek-ai/dsh-tools": "^0.1.6-alpha.2"
42
+ "@deepseek-ai/cordis": "^4.0.3",
43
+ "@deepseek-ai/dsh-agent": "^0.1.7-alpha.1",
44
+ "@deepseek-ai/dsh-agent-loop": "^0.1.7-alpha.1",
45
+ "@deepseek-ai/dsh-agent-loop-testkit": "^0.1.7-alpha.1",
46
+ "@deepseek-ai/dsh-llm": "^0.1.7-alpha.1",
47
+ "@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
48
+ "@deepseek-ai/dsh-session-persistence": "^0.1.7-alpha.1",
49
+ "@deepseek-ai/dsh-session-projection": "^0.1.7-alpha.1",
50
+ "@deepseek-ai/dsh-session-query": "^0.1.7-alpha.1",
51
+ "@deepseek-ai/dsh-subagent": "^0.1.7-alpha.1",
52
+ "@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.7-alpha.1",
53
+ "@deepseek-ai/dsh-subagent-fork-in-process": "^0.1.7-alpha.1",
54
+ "@deepseek-ai/dsh-tools": "^0.1.7-alpha.1",
55
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.7-alpha.1"
56
56
  },
57
57
  "dependencies": {
58
- "@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
59
- "@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2"
58
+ "@deepseek-ai/dsh-util-values": "^0.1.7-alpha.1",
59
+ "@deepseek-ai/dsh-brand": "^0.1.7-alpha.1"
60
60
  }
61
61
  }