@deepseek-ai/dsh-subagent-dsh-sdk 0.1.5-rc.2 → 0.1.6-alpha.2
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 +2 -2
- package/README.zh.md +12 -12
- package/package.json +26 -26
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/subagent-dsh-sdk/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 013fc6eed19c1e7b1849398ca9c002935a92d3bc
|
|
6
|
+
README.zh.md: b5d8816faedf05475584cc715114b833f765924e
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "The out-of-process SDK subagent backend for users and maintainers choosing a delegation provider, configuring a child Harness runtime
|
|
2
|
+
description: "The out-of-process SDK subagent backend for users and maintainers choosing a delegation provider, configuring a child Harness runtime, or debugging local nested child runs."
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -25,7 +25,7 @@ English | [中文](README.zh.md)
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
-
Mount this provider when a delegation should run as a complete Harness runtime in its own process. The common path is explicit: mount the seam, mount this provider,
|
|
28
|
+
Mount this provider when a delegation should run as a complete Harness runtime in its own process. The common path is explicit: mount the seam, mount this provider, configure `dshBin` when needed, and select the child `profile` and ordered `patches`.
|
|
29
29
|
|
|
30
30
|
### When to choose it
|
|
31
31
|
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "面向用户与维护者的进程外 SDK subagent 后端,用于选择委派提供方、配置子 Harness
|
|
2
|
+
description: "面向用户与维护者的进程外 SDK subagent 后端,用于选择委派提供方、配置子 Harness 运行时,或排查本地嵌套子 agent(智能体)的运行问题。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -25,21 +25,21 @@ kind: "package-reference"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用本包
|
|
27
27
|
|
|
28
|
-
当委派应以完整 Harness 运行时在独立进程中运行时,挂载本提供方。常用路径是显式的:挂载 seam
|
|
28
|
+
当委派应以完整 Harness 运行时在独立进程中运行时,挂载本提供方。常用路径是显式的:挂载 seam、挂载本提供方,按需配置 `dshBin`,并选择子级 `profile` 与有序 `patches`。
|
|
29
29
|
|
|
30
30
|
### 何时选择
|
|
31
31
|
|
|
32
32
|
当子进程必须是完整的 harness 对等体——拥有自己的组合、会话持久化、模型路由与工具——而不是共享父进程的 agent 时,选择此后端。当子进程必须共享父级组合或遵守父级强制的非路由能力时,请选择进程内后端:本提供方接受 agent 路由选项,但会拒绝结构化输出、深度上限、工具过滤或 persona,而不是静默省略。
|
|
33
33
|
|
|
34
|
-
提供方声明 `agentOptions: true`,同时保持 `outputSchema`/`depthLimit`/`toolFilter`/`persona` 为 false,并且 `inheritsParentContext: false`。不可变的 `agentRouteDefaults` 会在模型覆盖与确切路由预检前,把配置的 provider/model 基线公开给 `dsh-tool-subagent`;`start()`
|
|
34
|
+
提供方声明 `agentOptions: true`,同时保持 `outputSchema`/`depthLimit`/`toolFilter`/`persona` 为 false,并且 `inheritsParentContext: false`。不可变的 `agentRouteDefaults` 会在模型覆盖与确切路由预检前,把配置的 provider/model 基线公开给 `dsh-tool-subagent`;`start()` 则为直接调用方独立应用同一份配置默认值,包括 `maxTokens`。agent 路由值通过显式白名单跨越 SDK 协议;子进程仍是另一进程里的全新运行时,唯一从父 agent 本身派生的值是工作区 cwd。基于本提供方的 `dsh-tool-subagent` 部署应设置 `maxDepth: 'provider-managed'`——子 harness 拥有自己的递归预算。
|
|
35
35
|
|
|
36
36
|
### 配置
|
|
37
37
|
|
|
38
38
|
| 字段 | 默认值 | 含义 |
|
|
39
39
|
|---|---|---|
|
|
40
40
|
| `providerName` | `dsh-sdk` | `ctx.subagents` 上的注册表名称 |
|
|
41
|
-
| `dshBin` | SDK 依赖 | 显式 dsh CLI
|
|
42
|
-
| `profile` | `sdk` |
|
|
41
|
+
| `dshBin` | SDK 依赖 | 显式 dsh CLI(命令行界面)模块,在插件加载时解析并校验;省略则使用 SDK 依赖 |
|
|
42
|
+
| `profile` | `sdk` | 具名子 profile |
|
|
43
43
|
| `patches` | `[]` | 每次启动的有序 profile patch 文件,在插件加载时解析并校验 |
|
|
44
44
|
| `dshHome` | 必填 | 每个嵌套子进程的绝对隔离 Harness home |
|
|
45
45
|
| `cwd` | 父会话 cwd | 子进程及其 SDK 会话的工作目录覆盖值 |
|
|
@@ -47,7 +47,7 @@ kind: "package-reference"
|
|
|
47
47
|
| `model` | `deepseek-v4-flash` | 写入子进程 `initialize` 的模型 |
|
|
48
48
|
| `maxTokens` | 适配器/提供方路由默认值 | 写入子进程 `initialize` 的单次请求输出 token 上限 |
|
|
49
49
|
| `env` | `{}` | 叠加在已清理凭据的父环境之上的显式子环境 |
|
|
50
|
-
| `shutdownTimeoutMs` | `1000` | dispose
|
|
50
|
+
| `shutdownTimeoutMs` | `1000` | dispose(资源释放)期间协议 `shutdown` 交换的时限 |
|
|
51
51
|
| `disposeEofGraceMs` | `6000` | stdin EOF 之后、平台终止之前的宽限 |
|
|
52
52
|
| `disposeGraceMs` | `3000` | 终止后的退出确认宽限 |
|
|
53
53
|
|
|
@@ -93,7 +93,7 @@ kind: "package-reference"
|
|
|
93
93
|
|
|
94
94
|
- **完整 harness 对等体。** 每个子进程都是独立进程中的完整 Harness 运行时——拥有自己的组合、会话、模型路由与工具;只有解析后的工作目录与 `initialize` 路由从父级跨越。
|
|
95
95
|
- **每次运行一个运行时。** 每次运行都 spawn 全新运行时进程;没有进程池。
|
|
96
|
-
- **JSON-RPC
|
|
96
|
+
- **JSON-RPC 协议格式(wire format)是序列化边界。** 同进程 subagent 值不会为防御目的克隆;协议才是校验不可信输入的地方。
|
|
97
97
|
|
|
98
98
|
### 源码地图
|
|
99
99
|
|
|
@@ -104,7 +104,7 @@ kind: "package-reference"
|
|
|
104
104
|
|
|
105
105
|
### 运行流程
|
|
106
106
|
|
|
107
|
-
一次启动会在 spawn 前解析子进程工作目录与一条进程级 SDK 路由。`request.agentOptions` 中每个已声明字段(`provider`、`model`、`reasoningEffort` 或 `maxTokens`)都会覆盖对应的提供方实例默认值;省略时保留已配置的提供方/模型与可选上限,而推理强度只有在请求提供时才会出现。随后,提供方通过 SDK 客户端 spawn 运行时,并在履行前完成 `initialize` 握手,其中包括确切模型与推理强度校验。路由、spawn、握手或发布前取消失败时,只会在子进程被回收后拒绝;工作目录解析失败则会在尚未 spawn 任何内容时拒绝。发布后,提供方拥有一段 SDK 活动,并从子会话事件中读取答案:最后一条完整且非空的 `assistant/message`(记录 usage 的空内容消息会被跳过);若没有这类消息,则取累积的 `text-delta` 流。dispose
|
|
107
|
+
一次启动会在 spawn 前解析子进程工作目录与一条进程级 SDK 路由。`request.agentOptions` 中每个已声明字段(`provider`、`model`、`reasoningEffort` 或 `maxTokens`)都会覆盖对应的提供方实例默认值;省略时保留已配置的提供方/模型与可选上限,而推理强度只有在请求提供时才会出现。随后,提供方通过 SDK 客户端 spawn 运行时,并在履行前完成 `initialize` 握手,其中包括确切模型与推理强度校验。路由、spawn、握手或发布前取消失败时,只会在子进程被回收后拒绝;工作目录解析失败则会在尚未 spawn 任何内容时拒绝。发布后,提供方拥有一段 SDK 活动,并从子会话事件中读取答案:最后一条完整且非空的 `assistant/message`(记录 usage 的空内容消息会被跳过);若没有这类消息,则取累积的 `text-delta` 流。dispose 是幂等的:先在本地把结果确定为 `aborted`,发出有界的协议 `shutdown` 请求,再经 stdin EOF → SIGTERM → SIGKILL 升级到实际退出。
|
|
108
108
|
|
|
109
109
|
### 停止原因映射
|
|
110
110
|
|
|
@@ -112,7 +112,7 @@ kind: "package-reference"
|
|
|
112
112
|
|
|
113
113
|
### 进程边界
|
|
114
114
|
|
|
115
|
-
子进程环境以子进程 seam
|
|
115
|
+
子进程环境以子进程 seam 中已清除凭据的父环境为基础,并在清除之后合并显式 `config.env` 值。子进程由 SDK 客户端 spawn,而不是经由 `ctx.subprocess`——这是 SDK 托管传输的文档化例外——因此本后端会自行执行环境清理。
|
|
116
116
|
|
|
117
117
|
</details>
|
|
118
118
|
|
|
@@ -138,7 +138,7 @@ kind: "package-reference"
|
|
|
138
138
|
|
|
139
139
|
#### 模型看到什么
|
|
140
140
|
|
|
141
|
-
|
|
141
|
+
子运行时的模型会收到作为用户消息的独立任务,以及该运行时自身配置的系统提示词、工具和全新会话。它不会收到父级对话。父级工具调用可以为本次运行选择子级提供方、模型与推理强度;所选路由和由部署控制的可选输出上限会固定到这个新子进程。persona、工具过滤、深度强制与结构化输出仍不受支持,并会被拒绝而不是静默省略。
|
|
142
142
|
|
|
143
143
|
#### Token 影响
|
|
144
144
|
|
|
@@ -171,7 +171,7 @@ kind: "package-reference"
|
|
|
171
171
|
|
|
172
172
|
- **每次运行都使用全新的运行时进程**——不使用进程池;harness 运行时需要启动完整的插件树,因此每次运行的 spawn 成本高于 ACP 后端通常使用的子进程。
|
|
173
173
|
- **不支持路由之外的启动时能力**——父级可以选择子 agent 路由,但无法在子进程内强制执行 `outputSchema`、深度限制、工具过滤或 persona;应改为配置所选子 profile 及其有序 patch。
|
|
174
|
-
- **子进程的 transcript
|
|
174
|
+
- **子进程的 transcript(文本记录)保留在其自身的会话根目录中**——父级日志只记录委派工具调用与结果;流式 `session.event` 通道只用于提取输出,不会桥接到父级日志中。
|
|
175
175
|
- **仅支持本地子进程**——解析出的工作目录是本地路径;远程运行时需要独立的后端。
|
|
176
176
|
|
|
177
177
|
<a id="dev-note"></a>
|
|
@@ -187,4 +187,4 @@ kind: "package-reference"
|
|
|
187
187
|
|
|
188
188
|
</details>
|
|
189
189
|
|
|
190
|
-
**运行时不变式:** 不发布伴生入口。run 生命周期配对由 subagent seam
|
|
190
|
+
**运行时不变式:** 不发布伴生入口。run 生命周期配对由 subagent seam 的不变式检查;本后端自身的状态位于子进程中,不在当前上下文的事件流内。
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-subagent-dsh-sdk",
|
|
3
3
|
"description": "Out-of-process SDK subagent backend: drives a child DeepSeek Harness runtime subprocess over stdio JSON-RPC through the TypeScript SDK client",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -28,36 +28,36 @@
|
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
31
|
-
"@deepseek-ai/dsh-
|
|
32
|
-
"@deepseek-ai/dsh-
|
|
33
|
-
"@deepseek-ai/dsh-sdk-client": "^0.1.
|
|
34
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
31
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-sdk-client": "^0.1.6-alpha.2",
|
|
34
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
35
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@deepseek-ai/
|
|
40
|
-
"@deepseek-ai/
|
|
39
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
40
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
44
44
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
45
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
46
|
-
"@deepseek-ai/dsh-agent
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
53
|
-
"@deepseek-ai/dsh-
|
|
54
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
55
|
-
"@deepseek-ai/dsh-skill-filesystem": "^0.1.
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-subprocess": "^0.1.
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-tool-subagent": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
45
|
+
"@deepseek-ai/dsh-agent-instructions": "^0.1.6-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-app-boot": "^0.1.6-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-sdk-client": "^0.1.6-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-sdk-protocol": "^0.1.6-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-session-checkpoint-policy": "^0.1.6-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-loader-smoke": "^0.1.6-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-skill-filesystem": "^0.1.6-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-subagent": "^0.1.6-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-subprocess": "^0.1.6-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-llm-deepseek": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-tool-subagent": "^0.1.6-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-system-prompt": "^0.1.6-alpha.2"
|
|
62
62
|
}
|
|
63
63
|
}
|