@deepseek-ai/dsh-tool-subagent-control 0.1.2-alpha.2 → 0.1.2-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +10 -11
- package/README.zh.md +10 -11
- package/lib/index.js +12 -18
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +15 -19
- package/lib/types/list-agents.js +3 -2
- package/package.json +20 -26
- package/lib/invariant.js +0 -23
- package/lib/types/invariant.d.ts +0 -16
- package/lib/types/invariant.js +0 -22
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:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 99ca52dd4a7ea2629441c4d661632b8598c8171d
|
|
6
|
+
README.zh.md: 5a22f40b469b35b3a0046c5602560310884ae6a0
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-tool-subagent-control` adds the global control tools for continuable children: `send_message`
|
|
12
|
+
`dsh-tool-subagent-control` adds the global control tools for continuable children: `send_message` steers between a direct parent and child, `interrupt_agent` stops a child's current turn while keeping its inbox and descendants intact, and `list_agents` (from the separately loadable `list-agents` plugin) lists continuable children by durable id and label. Parents and continuable children inherit the same `send_message` definition and ordering, so model communication adds no child-only tool schema. No tool's presence decides whether a delegation tool starts continuable work.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -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
|
|
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.
|
|
50
50
|
|
|
51
51
|
### interrupt_agent
|
|
52
52
|
|
|
@@ -68,11 +68,11 @@ This section explains what the tools delegate to the subagent service; the obser
|
|
|
68
68
|
|
|
69
69
|
### Design concept
|
|
70
70
|
|
|
71
|
-
Thin adapters over `ctx.subagents.
|
|
71
|
+
Thin adapters over `ctx.subagents.sendMessage()`, `interrupt()`, and the list projections; the tools perform no lifecycle routing. Residency, cold resume, and authorization belong to the service, and the tools pass the exact live calling agent (`exec.agent`) as both sender and authority.
|
|
72
72
|
|
|
73
73
|
### Delivery and signal ownership
|
|
74
74
|
|
|
75
|
-
The tool forwards its execution signal, which owns admission only until inbox acceptance. Once the
|
|
75
|
+
The tool forwards its execution signal, which owns admission only until inbox acceptance. Once the target accepts a message, it cannot be cancelled through this tool. Every message is framed as `Agent <sender-id> sent a message:` and recorded with `{ kind: 'agent-message', form: 'relay', senderSessionId: sender.id }`; the service derives that attribution and never treats it as authority.
|
|
76
76
|
|
|
77
77
|
### Listing projection
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ The tool forwards its execution signal, which owns admission only until inbox ac
|
|
|
84
84
|
|---|---|
|
|
85
85
|
| [`src/index.ts`](src/index.ts) | `send_message` and `interrupt_agent` registration |
|
|
86
86
|
| [`src/list-agents.ts`](src/list-agents.ts) | `list_agents` registration: scopes, status refinement, projection |
|
|
87
|
-
|
|
|
87
|
+
| — | No runtime invariant companion is published; this model-facing adapter has no independent lifecycle stream; delivery and activation relations are owned by the subagent service it calls. |
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -97,7 +97,6 @@ Read these pages when the package-level contract is not enough; they move from t
|
|
|
97
97
|
|
|
98
98
|
- [Subagent subsystem](../../../docs/subsystems/subagent.md) — continuable children, activations, inbox, interrupt, and follow-up authority.
|
|
99
99
|
- [dsh-tool-subagent](../tool-subagent/README.md) — the delegation tool that starts continuable children.
|
|
100
|
-
- [dsh-tool-subagent-report](../tool-subagent-report/README.md) — the child-to-parent report channel.
|
|
101
100
|
- [Generated tool catalog](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent-control) — the three tool schemas.
|
|
102
101
|
|
|
103
102
|
-----
|
|
@@ -109,7 +108,7 @@ Read these pages when the package-level contract is not enough; they move from t
|
|
|
109
108
|
|
|
110
109
|
#### What the model sees
|
|
111
110
|
|
|
112
|
-
The generated [schemas](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent-control): `send_message` takes `
|
|
111
|
+
The generated [schemas](../../../docs/tool-catalog.md#deepseek-aidsh-tool-subagent-control): `send_message` takes `agent_id` and `message`; `interrupt_agent` takes `agent_id`; `list_agents` takes the optional `scope` enum.
|
|
113
112
|
|
|
114
113
|
#### Token effect
|
|
115
114
|
|
|
@@ -137,11 +136,11 @@ Append-only; each result follows the reusable request prefix.
|
|
|
137
136
|
|
|
138
137
|
#### What the model sees
|
|
139
138
|
|
|
140
|
-
`message
|
|
139
|
+
`message delivered to agent <agent_id>` on acceptance; the canonical output carries the accepted `messageId`. A failure — a non-adjacent target, unavailable parent, unknown child, descriptor-less child that cannot be resumed, or admission rejected — is an errored result whose message states the message was not delivered.
|
|
141
140
|
|
|
142
141
|
#### Token effect
|
|
143
142
|
|
|
144
|
-
One short acknowledgement per call; the
|
|
143
|
+
One short acknowledgement per call; the target's response never returns through this call. A child uses the same tool with its initial task's parent id to append selected content to parent history.
|
|
145
144
|
|
|
146
145
|
#### KV Cache effect
|
|
147
146
|
|
|
@@ -168,8 +167,8 @@ Append-only; each result follows the reusable request prefix.
|
|
|
168
167
|
|
|
169
168
|
These limits define what the control tools cannot observe or steer; they are current package constraints.
|
|
170
169
|
|
|
171
|
-
- **A
|
|
172
|
-
- **
|
|
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
|
+
- **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.
|
|
173
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.
|
|
174
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.
|
|
175
174
|
|
package/README.zh.md
CHANGED
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
`dsh-tool-subagent-control` 为可继续子级添加全局控制工具:`send_message`
|
|
12
|
+
`dsh-tool-subagent-control` 为可继续子级添加全局控制工具:`send_message` 在直接 parent 与 child 之间 steer,`interrupt_agent` 停止 child 当前轮次但保留其 inbox 与后代,`list_agents`(来自可单独加载的 `list-agents` 插件)按持久化 id 与标签列出可继续 child。parent 与可继续 child 继承相同的 `send_message` 定义和顺序,因此模型通信不会增加 child 专属工具 schema。是否加载这些工具不会决定委派工具是否启动可继续工作。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -46,7 +46,7 @@ kind: "package-reference"
|
|
|
46
46
|
|
|
47
47
|
### send_message
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
向 `agent_id` 指定的 Agent 发送消息:任何确切在线 Agent 都可以指定自己的直接可继续 child,而驻留的可继续 child 还可以指定自己的直接 parent。正在工作的目标通过 Steer 在最近的 step 边界接收消息;空闲目标会启动一个轮次,冷状态的直接 child 会通过继续执行生命周期恢复。调用只返回接受结果(被接受消息的稳定 `messageId`),绝不返回回复。失败——不受支持的目标、不可用的 parent、未知 child、缺少描述符而无法恢复的 child,或准入被拒——会明确说明消息未送达。
|
|
50
50
|
|
|
51
51
|
### interrupt_agent
|
|
52
52
|
|
|
@@ -68,11 +68,11 @@ kind: "package-reference"
|
|
|
68
68
|
|
|
69
69
|
### 设计理念
|
|
70
70
|
|
|
71
|
-
`ctx.subagents.
|
|
71
|
+
`ctx.subagents.sendMessage()`、`interrupt()` 与列表投影之上的轻量适配器;工具不执行任何生命周期路由。驻留、冷恢复与授权归服务所有,工具把确切在线的调用 Agent(`exec.agent`)同时作为 sender 与权限凭据传入。
|
|
72
72
|
|
|
73
73
|
### 投递与信号所有权
|
|
74
74
|
|
|
75
|
-
工具转发其执行信号,该信号只在 inbox
|
|
75
|
+
工具转发其执行信号,该信号只在 inbox 接受之前掌管准入。目标一旦接受消息,该消息便无法再通过本工具取消。每条消息都以 `Agent <sender-id> sent a message:` 作为前缀,并记录 `{ kind: 'agent-message', form: 'relay', senderSessionId: sender.id }`;该来源信息由服务推导,且绝不被视为权限。
|
|
76
76
|
|
|
77
77
|
### 列表投影
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ kind: "package-reference"
|
|
|
84
84
|
|---|---|
|
|
85
85
|
| [`src/index.ts`](src/index.ts) | `send_message` 与 `interrupt_agent` 注册 |
|
|
86
86
|
| [`src/list-agents.ts`](src/list-agents.ts) | `list_agents` 注册:作用域、状态细化、投影 |
|
|
87
|
-
|
|
|
87
|
+
| — | 不发布运行时不变式伴生入口;这个模型侧 adapter 没有独立 lifecycle stream;delivery 与 activation 关系由 subagent service 负责。 |
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -97,7 +97,6 @@ kind: "package-reference"
|
|
|
97
97
|
|
|
98
98
|
- [Subagent 子系统](../../../docs/subsystems/subagent.zh.md)——可继续子级、Activation、inbox、中断与后续消息权限。
|
|
99
99
|
- [dsh-tool-subagent](../tool-subagent/README.zh.md)——启动可继续子级的委派工具。
|
|
100
|
-
- [dsh-tool-subagent-report](../tool-subagent-report/README.zh.md)——子到父的上报通道。
|
|
101
100
|
- [生成工具目录](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent-control)——三个工具的 schema。
|
|
102
101
|
|
|
103
102
|
-----
|
|
@@ -109,7 +108,7 @@ kind: "package-reference"
|
|
|
109
108
|
|
|
110
109
|
#### 模型看到什么
|
|
111
110
|
|
|
112
|
-
已生成的 [schema](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent-control):`send_message` 接受 `
|
|
111
|
+
已生成的 [schema](../../../docs/tool-catalog.zh.md#deepseek-aidsh-tool-subagent-control):`send_message` 接受 `agent_id` 与 `message`;`interrupt_agent` 接受 `agent_id`;`list_agents` 接受可选的 `scope` 枚举。
|
|
113
112
|
|
|
114
113
|
#### Token 影响
|
|
115
114
|
|
|
@@ -137,11 +136,11 @@ kind: "package-reference"
|
|
|
137
136
|
|
|
138
137
|
#### 模型看到什么
|
|
139
138
|
|
|
140
|
-
接受时返回 `message
|
|
139
|
+
接受时返回 `message delivered to agent <agent_id>`;规范输出携带被接受的 `messageId`。失败——非相邻目标、不可用的 parent、未知 child、缺少描述符而无法恢复的 child,或准入被拒——会成为出错的结果,其消息说明该消息未送达。
|
|
141
140
|
|
|
142
141
|
#### Token 影响
|
|
143
142
|
|
|
144
|
-
|
|
143
|
+
每次调用产生一条简短确认消息;目标的响应绝不会通过本次调用返回。child 使用同一个工具和初始任务中的 parent id,把选定内容追加到 parent 历史中。
|
|
145
144
|
|
|
146
145
|
#### KV Cache 影响
|
|
147
146
|
|
|
@@ -168,8 +167,8 @@ kind: "package-reference"
|
|
|
168
167
|
|
|
169
168
|
这些限制说明控制工具无法观察或引导什么;它们是当前包约束。
|
|
170
169
|
|
|
171
|
-
-
|
|
172
|
-
-
|
|
170
|
+
- **已投递消息没有独立结果**——接受时只返回其 inbox `messageId`;目标后续工作会落入该目标的持久化会话,绝不会通过本工具收集。回复是另一条显式指定地址的 `send_message`,而非本次调用的结果。
|
|
171
|
+
- **只有受支持的相邻 Agent 可以通信**——每个 sender 都可以指定直接可继续 child,只有具备驻留可继续 Activation 的 sender 可以指定自己的直接 parent,且该 parent 必须仍在线;sibling 与更深的后代不能作为消息目标,只有直接 child 投递支持冷激活。
|
|
173
172
|
- **列表是快照,而非投递承诺**——它可能与发布、dispose(资源释放)或后续消息发生竞态,另一个进程也可能激活当前进程报告为 `ready` 的子级;跨进程准确性需要共享租约。`interrupt_agent` 自己执行权威的在线 lineage 检查,因此过期的发现结果不会授予权限。
|
|
174
173
|
- **没有分页或删除**——系统返回完整且稳定排序的集合;只要子级会话仍在持久化存储中,它就会继续出现在列表中,服务级上限或删除操作留待后续产品决策。
|
|
175
174
|
|
package/lib/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
2
2
|
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
3
|
+
import { markAdjacentAgentSendMessageTool } from "@deepseek-ai/dsh-subagent/internal";
|
|
3
4
|
//#region lib/types/index.js
|
|
4
5
|
/**
|
|
5
6
|
* The globally named `send_message` and `interrupt_agent` tools: thin
|
|
6
|
-
* model-facing adapters over `ctx.subagents.
|
|
7
|
+
* model-facing adapters over `ctx.subagents.sendMessage()` and
|
|
7
8
|
* `ctx.subagents.interrupt()`. They perform no lifecycle routing of their own —
|
|
8
9
|
* residency, cold resume, and interrupt authorization belong to the subagent
|
|
9
10
|
* service — and they live apart from the provider-bound
|
|
@@ -18,19 +19,19 @@ const inject = ["tools", "subagents"];
|
|
|
18
19
|
* @param ctx - context carrying the tool registry and subagent service.
|
|
19
20
|
*/
|
|
20
21
|
function apply(ctx) {
|
|
21
|
-
ctx.tools.register(defineTool({
|
|
22
|
+
ctx.tools.register(markAdjacentAgentSendMessageTool(defineTool({
|
|
22
23
|
name: "send_message",
|
|
23
|
-
description: "Send a message to a
|
|
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
25
|
parameters: {
|
|
25
|
-
|
|
26
|
+
agent_id: {
|
|
26
27
|
type: "string",
|
|
27
28
|
required: true,
|
|
28
|
-
description: "The
|
|
29
|
+
description: "The agent id of your direct continuable child, or your direct parent when you are a resident continuable child."
|
|
29
30
|
},
|
|
30
31
|
message: {
|
|
31
32
|
type: "string",
|
|
32
33
|
required: true,
|
|
33
|
-
description: "The message to deliver to the
|
|
34
|
+
description: "The message to deliver to the agent."
|
|
34
35
|
}
|
|
35
36
|
},
|
|
36
37
|
output: {
|
|
@@ -44,26 +45,19 @@ function apply(ctx) {
|
|
|
44
45
|
},
|
|
45
46
|
render: (args, _value) => [{
|
|
46
47
|
type: "text",
|
|
47
|
-
text: `message
|
|
48
|
+
text: `message delivered to agent ${args.agent_id}`
|
|
48
49
|
}]
|
|
49
50
|
},
|
|
50
51
|
async execute(args, exec) {
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
52
|
+
const sender = exec.agent;
|
|
53
|
+
if (!sender) throw new Error("send_message requires a calling agent (exec.agent was undefined)");
|
|
53
54
|
const message = [{
|
|
54
55
|
type: "text",
|
|
55
56
|
text: args.message
|
|
56
57
|
}];
|
|
57
|
-
return { messageId: await ctx.subagents.
|
|
58
|
-
source: {
|
|
59
|
-
kind: "coordinator",
|
|
60
|
-
form: "relay",
|
|
61
|
-
senderSessionId: parent.id
|
|
62
|
-
},
|
|
63
|
-
signal: exec.signal
|
|
64
|
-
}) };
|
|
58
|
+
return { messageId: await ctx.subagents.sendMessage(sender, brandString(args.agent_id), message, { signal: exec.signal }) };
|
|
65
59
|
}
|
|
66
|
-
}));
|
|
60
|
+
})));
|
|
67
61
|
ctx.tools.register(defineTool({
|
|
68
62
|
name: "interrupt_agent",
|
|
69
63
|
description: "Request cancellation of a background agent's current turn by its agent id. The target may be your direct child or a deeper agent created under you. Only the current turn stops: messages already queued for the agent stay parked until a later send_message, agents it started keep running, and the agent itself stays available for follow-ups. This call returns as soon as the stop request is accepted, so the target may keep running briefly; interrupting an agent that already finished is an accepted no-op.",
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The globally named `send_message` and `interrupt_agent` tools: thin
|
|
3
|
-
* model-facing adapters over `ctx.subagents.
|
|
3
|
+
* model-facing adapters over `ctx.subagents.sendMessage()` and
|
|
4
4
|
* `ctx.subagents.interrupt()`. They perform no lifecycle routing of their own —
|
|
5
5
|
* residency, cold resume, and interrupt authorization belong to the subagent
|
|
6
6
|
* service — and they live apart from the provider-bound
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The globally named `send_message` and `interrupt_agent` tools: thin
|
|
3
|
-
* model-facing adapters over `ctx.subagents.
|
|
3
|
+
* model-facing adapters over `ctx.subagents.sendMessage()` and
|
|
4
4
|
* `ctx.subagents.interrupt()`. They perform no lifecycle routing of their own —
|
|
5
5
|
* residency, cold resume, and interrupt authorization belong to the subagent
|
|
6
6
|
* service — and they live apart from the provider-bound
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { brandString } from '@deepseek-ai/dsh-brand';
|
|
12
12
|
import { defineTool } from '@deepseek-ai/dsh-tools';
|
|
13
|
+
import { markAdjacentAgentSendMessageTool } from '@deepseek-ai/dsh-subagent/internal';
|
|
13
14
|
export const name = 'tool-subagent-control';
|
|
14
15
|
export const inject = ['tools', 'subagents'];
|
|
15
16
|
/**
|
|
@@ -17,23 +18,22 @@ export const inject = ['tools', 'subagents'];
|
|
|
17
18
|
* @param ctx - context carrying the tool registry and subagent service.
|
|
18
19
|
*/
|
|
19
20
|
export function apply(ctx) {
|
|
20
|
-
ctx.tools.register(defineTool({
|
|
21
|
+
ctx.tools.register(markAdjacentAgentSendMessageTool(defineTool({
|
|
21
22
|
name: 'send_message',
|
|
22
|
-
description: 'Send a message to a
|
|
23
|
-
+ '
|
|
24
|
-
+ '
|
|
25
|
-
+ '
|
|
26
|
-
+ 'failure means the message was NOT delivered.',
|
|
23
|
+
description: 'Send a message to a direct continuable child by its agent id. If you are a resident continuable child, '
|
|
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 '
|
|
26
|
+
+ 'that the message was delivered. A failure means the message was NOT delivered.',
|
|
27
27
|
parameters: {
|
|
28
|
-
|
|
28
|
+
agent_id: {
|
|
29
29
|
type: 'string',
|
|
30
30
|
required: true,
|
|
31
|
-
description: 'The
|
|
31
|
+
description: 'The agent id of your direct continuable child, or your direct parent when you are a resident continuable child.',
|
|
32
32
|
},
|
|
33
33
|
message: {
|
|
34
34
|
type: 'string',
|
|
35
35
|
required: true,
|
|
36
|
-
description: 'The message to deliver to the
|
|
36
|
+
description: 'The message to deliver to the agent.',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
output: {
|
|
@@ -46,23 +46,19 @@ export function apply(ctx) {
|
|
|
46
46
|
},
|
|
47
47
|
render: (args, _value) => [{
|
|
48
48
|
type: 'text',
|
|
49
|
-
text: `message
|
|
49
|
+
text: `message delivered to agent ${args.agent_id}`,
|
|
50
50
|
}],
|
|
51
51
|
},
|
|
52
52
|
async execute(args, exec) {
|
|
53
|
-
const
|
|
54
|
-
if (!
|
|
55
|
-
// Parent authority requires an exact live calling agent.
|
|
53
|
+
const sender = exec.agent;
|
|
54
|
+
if (!sender) {
|
|
56
55
|
throw new Error('send_message requires a calling agent (exec.agent was undefined)');
|
|
57
56
|
}
|
|
58
57
|
const message = [{ type: 'text', text: args.message }];
|
|
59
|
-
const messageId = await ctx.subagents.
|
|
60
|
-
source: { kind: 'coordinator', form: 'relay', senderSessionId: parent.id },
|
|
61
|
-
signal: exec.signal,
|
|
62
|
-
});
|
|
58
|
+
const messageId = await ctx.subagents.sendMessage(sender, brandString(args.agent_id), message, { signal: exec.signal });
|
|
63
59
|
return { messageId };
|
|
64
60
|
},
|
|
65
|
-
}));
|
|
61
|
+
})));
|
|
66
62
|
ctx.tools.register(defineTool({
|
|
67
63
|
name: 'interrupt_agent',
|
|
68
64
|
description: 'Request cancellation of a background agent\'s current turn by its agent id. The target may be your '
|
package/lib/types/list-agents.js
CHANGED
|
@@ -56,8 +56,9 @@ export function apply(ctx) {
|
|
|
56
56
|
+ 'you started, not to poll for completion — you are told when one finishes. Status comes from the live '
|
|
57
57
|
+ 'registry: running means the agent is working right now, idle means it is loaded but between turns '
|
|
58
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`
|
|
60
|
-
+ '
|
|
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` '
|
|
61
|
+
+ 'candidate in every status. The snapshot is not a delivery '
|
|
61
62
|
+ 'promise — `send_message` performs the authoritative check and may still fail. Children that could '
|
|
62
63
|
+ 'not be read are reported as diagnostics instead of being silently dropped. Scope `descendants` '
|
|
63
64
|
+ 'walks the whole tree below you in stable pre-order, annotating each entry with its durable direct-parent '
|
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.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,10 +18,6 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./list-agents": {
|
|
26
22
|
"types": "./lib/types/list-agents.d.ts",
|
|
27
23
|
"default": "./lib/types/list-agents.js"
|
|
@@ -31,37 +27,35 @@
|
|
|
31
27
|
},
|
|
32
28
|
"files": [
|
|
33
29
|
"lib/index.js",
|
|
34
|
-
"lib/invariant.js",
|
|
35
30
|
"lib/types/**/*.js",
|
|
36
31
|
"lib/types/**/*.d.ts"
|
|
37
32
|
],
|
|
38
33
|
"license": "MIT",
|
|
39
34
|
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
40
36
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.2",
|
|
45
|
-
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.2"
|
|
37
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
38
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
39
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4"
|
|
46
40
|
},
|
|
47
41
|
"devDependencies": {
|
|
48
42
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
49
|
-
"@deepseek-ai/dsh-agent
|
|
50
|
-
"@deepseek-ai/dsh-agent-loop
|
|
51
|
-
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.
|
|
52
|
-
"@deepseek-ai/dsh-
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-session": "^0.1.2-alpha.
|
|
55
|
-
"@deepseek-ai/dsh-session-persistence": "^0.1.2-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-session-
|
|
57
|
-
"@deepseek-ai/dsh-session-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
43
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.4",
|
|
44
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.2-alpha.4",
|
|
45
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "^0.1.2-alpha.4",
|
|
46
|
+
"@deepseek-ai/dsh-llm": "^0.1.2-alpha.4",
|
|
47
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.4",
|
|
48
|
+
"@deepseek-ai/dsh-session-persistence": "^0.1.2-alpha.4",
|
|
49
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.2-alpha.4",
|
|
50
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.2-alpha.4",
|
|
51
|
+
"@deepseek-ai/dsh-session-query": "^0.1.2-alpha.4",
|
|
52
|
+
"@deepseek-ai/dsh-subagent": "^0.1.2-alpha.4",
|
|
53
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "^0.1.2-alpha.4",
|
|
54
|
+
"@deepseek-ai/dsh-tools": "^0.1.2-alpha.4",
|
|
55
|
+
"@deepseek-ai/dsh-subagent-fork-in-process": "^0.1.2-alpha.4"
|
|
62
56
|
},
|
|
63
57
|
"dependencies": {
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
58
|
+
"@deepseek-ai/dsh-util-values": "^0.1.2-alpha.4",
|
|
59
|
+
"@deepseek-ai/dsh-brand": "^0.1.2-alpha.4"
|
|
66
60
|
}
|
|
67
61
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-tool-subagent-control`.
|
|
4
|
-
* @module @deepseek-ai/dsh-tool-subagent-control/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-tool-subagent-control";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "tool-subagent-control-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: this model-facing adapter has no independent lifecycle stream; delivery
|
|
13
|
-
* and activation relations are owned by the subagent service it calls.
|
|
14
|
-
*/
|
|
15
|
-
const install = () => {};
|
|
16
|
-
/**
|
|
17
|
-
* Register this package's invariant companion.
|
|
18
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
-
*/
|
|
21
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
-
//#endregion
|
|
23
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-tool-subagent-control`.
|
|
3
|
-
* @module @deepseek-ai/dsh-tool-subagent-control/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "tool-subagent-control-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|
package/lib/types/invariant.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-tool-subagent-control`.
|
|
3
|
-
* @module @deepseek-ai/dsh-tool-subagent-control/invariant
|
|
4
|
-
*/
|
|
5
|
-
const PACKAGE_NAME = '@deepseek-ai/dsh-tool-subagent-control';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export const name = 'tool-subagent-control-invariant';
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export const inject = ['invariants'];
|
|
10
|
-
/**
|
|
11
|
-
* No runtime invariant: this model-facing adapter has no independent lifecycle stream; delivery
|
|
12
|
-
* and activation relations are owned by the subagent service it calls.
|
|
13
|
-
*/
|
|
14
|
-
const install = () => { };
|
|
15
|
-
/**
|
|
16
|
-
* Register this package's invariant companion.
|
|
17
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
18
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
19
|
-
*/
|
|
20
|
-
export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
21
|
-
/* jscpd:ignore-end */
|
|
22
|
-
//# sourceMappingURL=invariant.js.map
|