@deepseek-ai/dsh-subagent-claude-code 0.2.1-alpha.1 → 0.2.1-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 +23 -23
- package/README.md +24 -29
- package/README.zh.md +25 -30
- package/cordis.patch.yml +6 -3
- package/icon.svg +1 -0
- package/lib/index.js +2 -4
- package/lib/types/run.d.ts +1 -1
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +33 -27
package/README.i18n.yaml
CHANGED
|
@@ -15,20 +15,20 @@
|
|
|
15
15
|
en: d152484eb41ac6b4
|
|
16
16
|
zh: 09388d293f9be9cb
|
|
17
17
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 8e614ec7785cbaae
|
|
19
|
+
zh: dd5b2ffff8d513c7
|
|
20
20
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package/installing-the-bundle:
|
|
21
|
-
en:
|
|
22
|
-
zh:
|
|
21
|
+
en: cf4a7e48ca796066
|
|
22
|
+
zh: d9140d0fda7b7029
|
|
23
23
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package/configuration:
|
|
24
|
-
en:
|
|
25
|
-
zh:
|
|
24
|
+
en: fbee5e4ab396c184
|
|
25
|
+
zh: dcf94832918d5010
|
|
26
26
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package/exposing-the-tool:
|
|
27
|
-
en:
|
|
28
|
-
zh:
|
|
27
|
+
en: ebf6ba7fef393ebb
|
|
28
|
+
zh: fad30b829e2e4188
|
|
29
29
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package/what-you-get:
|
|
30
|
-
en:
|
|
31
|
-
zh:
|
|
30
|
+
en: a731eabea54893d5
|
|
31
|
+
zh: e370dba101b3a7e8
|
|
32
32
|
/deepseek-ai-dsh-subagent-claude-code/use-this-package/failure-and-recovery:
|
|
33
33
|
en: 3cfe78175e68269e
|
|
34
34
|
zh: 478666ce1fcb4e59
|
|
@@ -39,11 +39,11 @@
|
|
|
39
39
|
en: c01f4a013f7f1a2f
|
|
40
40
|
zh: 92221e45d438334d
|
|
41
41
|
/deepseek-ai-dsh-subagent-claude-code/understand-the-implementation/source-map:
|
|
42
|
-
en:
|
|
43
|
-
zh:
|
|
42
|
+
en: 4826e5016f7d9655
|
|
43
|
+
zh: 9b80696313be1816
|
|
44
44
|
/deepseek-ai-dsh-subagent-claude-code/understand-the-implementation/run-flow:
|
|
45
45
|
en: 4dd16da30209644e
|
|
46
|
-
zh:
|
|
46
|
+
zh: 7ea63e1bf4cee29d
|
|
47
47
|
/deepseek-ai-dsh-subagent-claude-code/further-exploration:
|
|
48
48
|
en: 6d2c64f8f7ebab4c
|
|
49
49
|
zh: a892c363cd3982e5
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
en: 1796fa78833bfc2b
|
|
55
55
|
zh: d925d4c0d6c46552
|
|
56
56
|
/deepseek-ai-dsh-subagent-claude-code/model-experience/child-request/what-the-model-sees:
|
|
57
|
-
en:
|
|
58
|
-
zh:
|
|
57
|
+
en: 3edc725966ed48c2
|
|
58
|
+
zh: 2ec900cc7a4ae459
|
|
59
59
|
/deepseek-ai-dsh-subagent-claude-code/model-experience/child-request/token-effect:
|
|
60
60
|
en: 631f762d31c31a3d
|
|
61
61
|
zh: f32ad086756bf33d
|
|
@@ -66,17 +66,17 @@
|
|
|
66
66
|
en: 4c391bb16e3cd380
|
|
67
67
|
zh: ab3847efe35fa6dc
|
|
68
68
|
/deepseek-ai-dsh-subagent-claude-code/model-experience/parent-scheduling-and-results-indirectly/what-the-model-sees:
|
|
69
|
-
en:
|
|
70
|
-
zh:
|
|
69
|
+
en: fd177d7a8aa80ff0
|
|
70
|
+
zh: aa04468315ed2e0b
|
|
71
71
|
/deepseek-ai-dsh-subagent-claude-code/model-experience/parent-scheduling-and-results-indirectly/token-effect:
|
|
72
|
-
en:
|
|
73
|
-
zh:
|
|
72
|
+
en: 0c436fb0897a6eca
|
|
73
|
+
zh: 7ec0a953d0232af2
|
|
74
74
|
/deepseek-ai-dsh-subagent-claude-code/model-experience/parent-scheduling-and-results-indirectly/kv-cache-effect:
|
|
75
|
-
en:
|
|
76
|
-
zh:
|
|
75
|
+
en: 19f1316ea4bb1bb9
|
|
76
|
+
zh: 181231ddffdc8494
|
|
77
77
|
/deepseek-ai-dsh-subagent-claude-code/known-limitations-and-deferred-work:
|
|
78
|
-
en:
|
|
79
|
-
zh:
|
|
78
|
+
en: 37450e5856da6ead
|
|
79
|
+
zh: 9eac0422397c10e2
|
|
80
80
|
/deepseek-ai-dsh-subagent-claude-code/known-limitations-and-deferred-work/dev-note:
|
|
81
81
|
en: 185beb4ff55f0946
|
|
82
82
|
zh: 068ca7c57137eb33
|
package/README.md
CHANGED
|
@@ -25,19 +25,15 @@ Install this Profile Bundle when a delegated task should run as a fresh, unatten
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## Use this package
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Enable **Claude Code subagent** in the Web or Desktop Plugins page when a task needs a fresh native Claude Code session in the parent workspace.
|
|
29
29
|
|
|
30
30
|
### Installing the Bundle
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
The Official entry is visible offline. Enabling it installs the [target for the running DSH installation](../../boot/plugin-manager/README.md#use-this-package) through the ordinary bundle installer and selects its profile layer. The layer registers the provider and adds `subagent_claude_code` to every Agent as a global tool; it starts no native process until delegation. Restart when the installer reports that one is required.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
dsh plugin --profile <name> add @deepseek-ai/dsh-subagent-claude-code
|
|
36
|
-
dsh plugin --profile <name> remove @deepseek-ai/dsh-subagent-claude-code
|
|
37
|
-
dsh --profile <name>
|
|
38
|
-
```
|
|
34
|
+
Switching Off deselects the layer and leaves the package installed. Remove is a separate package operation. Enabling or switching Off registers or removes the global tool in the running Host, so live Agents see the change on their next request.
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
The layer inserts Host rows only, so any profile can select it, including the shipped headless, SDK, and ACP profiles. Existing provider-only consumers follow the [upgrade guide](../../../docs/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.md).
|
|
41
37
|
|
|
42
38
|
### Configuration
|
|
43
39
|
|
|
@@ -57,31 +53,30 @@ Removing the package withdraws the provider and its private runtime closure on t
|
|
|
57
53
|
| `plan` | Run in native planning mode, deny execution approval, and return the completed plan as the final answer |
|
|
58
54
|
| `bypassPermissions` | Explicitly set the SDK's dangerous confirmation and bypass permission checks |
|
|
59
55
|
|
|
60
|
-
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-subagent-claude-code) is the exhaustive source for every accepted field and its JSDoc. A configured `model` passes unchanged to every query from that provider instance; omission leaves native model selection in force. Credential-shaped ambient variables are removed before the explicit `env` overlay, so an API key intended for the child must be supplied there. The provider omits the SDK `settingSources` option, so Claude Code reads the host's normal user, project, and local settings relative to the
|
|
56
|
+
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-subagent-claude-code) is the exhaustive source for every accepted field and its JSDoc. A configured `model` passes unchanged to every query from that provider instance; omission leaves native model selection in force. Credential-shaped ambient variables are removed before the explicit `env` overlay, so an API key intended for the child must be supplied there. The provider omits the SDK `settingSources` option, so Claude Code reads the host's normal user, project, and local settings relative to the selected child working directory. It does not copy or filter those files, create or modify login state, inspect `PATH`, or fall back to a host `claude` executable.
|
|
61
57
|
|
|
58
|
+
<a id="exposing-the-tool"></a>
|
|
62
59
|
### Exposing the tool
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
The bundle inserts `tool-subagent-claude-code` as a Host row, so `subagent_claude_code` is a global tool visible to every preset, including minimal. Later user patches can configure or disable that row by id. A preset that registers its own tool with the same name shadows the global tool for its Agents. To mount the provider and tool without selecting the bundle layer, insert the same rows in `cordis.patch.yml`:
|
|
65
62
|
|
|
66
63
|
```yaml
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
backgroundMode: one-shot
|
|
77
|
-
maxDepth: provider-managed
|
|
64
|
+
- insert:
|
|
65
|
+
- id: subagent-claude-code
|
|
66
|
+
name: '@deepseek-ai/dsh-subagent-claude-code'
|
|
67
|
+
- id: tool-subagent-claude-code
|
|
68
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
69
|
+
config:
|
|
70
|
+
provider: claude-code
|
|
71
|
+
toolName: subagent_claude_code
|
|
72
|
+
maxDepth: provider-managed
|
|
78
73
|
```
|
|
79
74
|
|
|
80
|
-
The
|
|
75
|
+
The tool returns a child id after accepting the task and sends its result to the parent Agent on completion. Each external activation executes once and accepts no follow-up input or resume.
|
|
81
76
|
|
|
82
77
|
### What you get
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
The completion notice contains the final Claude Code answer, or the stop reason and optional safe diagnostic. The parent Session also retains the external task identity and complete terminal result independently of the notice; no local child Session is created. Product reasoning, tool activity, raw stderr, and workspace diffs do not enter the parent Session.
|
|
85
80
|
|
|
86
81
|
### Failure and recovery
|
|
87
82
|
|
|
@@ -110,7 +105,7 @@ This section explains how the provider drives a real Claude Code CLI and where t
|
|
|
110
105
|
| [`src/index.ts`](src/index.ts) | Plugin entry: config schema, provider registration |
|
|
111
106
|
| [`src/run.ts`](src/run.ts) | The SDK query lifecycle, result acceptance, and permission handling |
|
|
112
107
|
| [`src/process.ts`](src/process.ts) | Managed-range termination escalation on disposal |
|
|
113
|
-
| [`cordis.patch.yml`](cordis.patch.yml) | The Profile
|
|
108
|
+
| [`cordis.patch.yml`](cordis.patch.yml) | The Profile layer that registers the provider and contributes preset delegation tools |
|
|
114
109
|
|
|
115
110
|
### Run flow
|
|
116
111
|
|
|
@@ -140,7 +135,7 @@ Read these pages when the package-level contract is not enough. They move from t
|
|
|
140
135
|
|
|
141
136
|
#### What the model sees
|
|
142
137
|
|
|
143
|
-
The Claude Code child receives the standalone text task as one fresh SDK query. Its workspace is the
|
|
138
|
+
The Claude Code child receives the standalone text task as one fresh SDK query. Its workspace is the selected child working directory; the selected provider instance fixes the query's configured model, environment, and non-interactive permission mode, while an omitted model and every other product setting come from native Claude configuration. The executable version comes from the Bundle's pinned SDK platform payload.
|
|
144
139
|
|
|
145
140
|
#### Token effect
|
|
146
141
|
|
|
@@ -154,15 +149,15 @@ Independent of the parent request cache. Reuse depends only on Claude Code's own
|
|
|
154
149
|
|
|
155
150
|
#### What the model sees
|
|
156
151
|
|
|
157
|
-
Through `dsh-tool-subagent`,
|
|
152
|
+
Through `dsh-tool-subagent`, the parent model first receives a child id, then the final Claude Code answer or a failure notice with its stop reason and safe diagnostic. Diagnostics contain only fixed stage, category, and observed protocol or process facts. Product reasoning, intermediate messages, tool activity, stderr, usage, product identifiers, commands, paths, and raw protocol payloads are not copied into the parent Session.
|
|
158
153
|
|
|
159
154
|
#### Token effect
|
|
160
155
|
|
|
161
|
-
|
|
156
|
+
Parent input grows by the start acknowledgement and completion notice, including the final answer or failure detail. Child tokens do not enter the parent context. This provider adds no parent tool schema by itself.
|
|
162
157
|
|
|
163
158
|
#### KV Cache effect
|
|
164
159
|
|
|
165
|
-
|
|
160
|
+
Start acknowledgements and completion notices append after the reusable parent request prefix. A notice may wake another turn without rewriting the existing prefix.
|
|
166
161
|
|
|
167
162
|
## Known Limitations and Deferred Work
|
|
168
163
|
|
|
@@ -177,7 +172,7 @@ These limits define when this provider is a poor fit or needs special operationa
|
|
|
177
172
|
- **Authentication and account state remain native** — the Bundle supplies the CLI but does not create an account, log in, or rewrite Claude settings; configuration and authentication failures surface with their lifecycle stage and the safe `unknown` fallback rather than a separate public classification.
|
|
178
173
|
- **The SDK platform payload is required at delegation time** — installs that omit optional dependencies, unsupported platforms, and missing or damaged payloads fail at the first query; there is no host-CLI fallback.
|
|
179
174
|
- **No human interaction path** — `AskUserQuestion` is disabled, permission prompts are denied, MCP elicitation is declined, and blocking dialogs fail closed instead of suspending.
|
|
180
|
-
- **Assistant payload is final text only** — reasoning, intermediate messages, tool traffic, usage, stderr, and workspace diffs remain
|
|
175
|
+
- **Assistant payload is final text only** — failed runs can also expose a separate safe diagnostic; reasoning, intermediate messages, tool traffic, usage, stderr, and workspace diffs remain outside the parent Session. Task identity and terminal results are retained in the parent log.
|
|
181
176
|
- **No optional shared capabilities** — `agentOptions`, output schemas, child personas, tool filtering, and harness depth enforcement are rejected by the shared service for this provider.
|
|
182
177
|
- **No wall-clock timeout or side-effect rollback** — the caller cancels long work, and files or external systems changed before cancellation are not restored.
|
|
183
178
|
|
package/README.zh.md
CHANGED
|
@@ -25,19 +25,15 @@ kind: "package-bundle"
|
|
|
25
25
|
<a id="use-this-package"></a>
|
|
26
26
|
## 使用本包
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
当任务需要在父工作区中运行全新的原生 Claude Code 会话时,在 Web 或 Desktop 插件页启用 **Claude Code 子智能体**。
|
|
29
29
|
|
|
30
30
|
### 安装 Bundle
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
官方条目可离线显示。启用时,普通 bundle 安装器会安装[当前 DSH 安装对应的目标](../../boot/plugin-manager/README.zh.md#use-this-package)并选择其配置层。此层注册提供方,并为所有智能体添加全局工具 `subagent_claude_code`;实际委派前不会启动原生进程。安装器提示需要重启时,请重启应用。
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
dsh plugin --profile <name> add @deepseek-ai/dsh-subagent-claude-code
|
|
36
|
-
dsh plugin --profile <name> remove @deepseek-ai/dsh-subagent-claude-code
|
|
37
|
-
dsh --profile <name>
|
|
38
|
-
```
|
|
34
|
+
关闭只会取消选择配置层,保留已安装的包。移除是独立的包操作。启用或关闭会在运行中的 Host 注册或移除该全局工具,正在运行的智能体会在下一次请求时看到变化。
|
|
39
35
|
|
|
40
|
-
|
|
36
|
+
此层只插入 Host 条目,因此任何配置(包括随附的 headless、SDK 和 ACP)都可以选择它。原有仅提供方用法请遵循[升级指南](../../../docs/upgrade-guide/v0.2.1-alpha.1/native-subagent-bundle-tools/guide.zh.md)。
|
|
41
37
|
|
|
42
38
|
### 配置
|
|
43
39
|
|
|
@@ -57,31 +53,30 @@ dsh --profile <name>
|
|
|
57
53
|
| `plan` | 使用原生规划模式,拒绝执行审批,并把完整计划作为最终答案返回 |
|
|
58
54
|
| `bypassPermissions` | 显式设置 SDK 的危险确认并跳过权限检查 |
|
|
59
55
|
|
|
60
|
-
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-subagent-claude-code)是每个受支持字段及其 JSDoc 的穷尽式真源。已配置的 `model` 会原样传给该提供方实例的每次 query;省略时保留原生模型选择。具有凭证特征的环境变量会在显式 `env` 覆盖生效前被移除,因此供子进程使用的 API 密钥必须在该配置中显式提供。提供方省略 SDK 的 `settingSources` 选项,因此 Claude Code
|
|
56
|
+
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-subagent-claude-code)是每个受支持字段及其 JSDoc 的穷尽式真源。已配置的 `model` 会原样传给该提供方实例的每次 query;省略时保留原生模型选择。具有凭证特征的环境变量会在显式 `env` 覆盖生效前被移除,因此供子进程使用的 API 密钥必须在该配置中显式提供。提供方省略 SDK 的 `settingSources` 选项,因此 Claude Code 会相对于所选子级工作目录 读取宿主机常规的用户、项目与本地设置。它不会复制或过滤这些文件、创建或修改登录状态、检查 `PATH`,也不会回退到宿主 `claude` 可执行文件。
|
|
61
57
|
|
|
58
|
+
<a id="exposing-the-tool"></a>
|
|
62
59
|
### 暴露工具
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
Bundle 将 `tool-subagent-claude-code` 作为 Host 条目插入,因此 `subagent_claude_code` 是所有预设(包括 minimal)都可见的全局工具。后续用户补丁可以按 id 配置或禁用该行。预设自行注册的同名工具会为其智能体遮蔽该全局工具。若要不选择 bundle 层而挂载提供方和工具,在 `cordis.patch.yml` 中插入相同的条目:
|
|
65
62
|
|
|
66
63
|
```yaml
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
backgroundMode: one-shot
|
|
77
|
-
maxDepth: provider-managed
|
|
64
|
+
- insert:
|
|
65
|
+
- id: subagent-claude-code
|
|
66
|
+
name: '@deepseek-ai/dsh-subagent-claude-code'
|
|
67
|
+
- id: tool-subagent-claude-code
|
|
68
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
69
|
+
config:
|
|
70
|
+
provider: claude-code
|
|
71
|
+
toolName: subagent_claude_code
|
|
72
|
+
maxDepth: provider-managed
|
|
78
73
|
```
|
|
79
74
|
|
|
80
|
-
|
|
75
|
+
工具接受任务后返回 child id;任务完成后向父 agent 发送结果通知。外部 activation 只执行一次,不支持追加输入或恢复对话。
|
|
81
76
|
|
|
82
77
|
### 你会得到什么
|
|
83
78
|
|
|
84
|
-
|
|
79
|
+
完成通知包含 Claude Code 的最终答案,或停止原因与可选的安全诊断。父会话还独立保存外部任务的身份和完整终态结果;无需创建本地子 Session。产品推理、工具活动、原始 stderr 与工作区差异不会进入父会话。
|
|
85
80
|
|
|
86
81
|
### 失败与恢复
|
|
87
82
|
|
|
@@ -110,11 +105,11 @@ dsh --profile <name>
|
|
|
110
105
|
| [`src/index.ts`](src/index.ts) | 插件入口:配置 schema、提供方注册 |
|
|
111
106
|
| [`src/run.ts`](src/run.ts) | SDK query 生命周期、结果接受与权限处理 |
|
|
112
107
|
| [`src/process.ts`](src/process.ts) | dispose(资源释放)时的 managed-range 逐级终止 |
|
|
113
|
-
| [`cordis.patch.yml`](cordis.patch.yml) |
|
|
108
|
+
| [`cordis.patch.yml`](cordis.patch.yml) | 注册提供方并添加预设委派工具的 Profile 配置层 |
|
|
114
109
|
|
|
115
110
|
### 运行流程
|
|
116
111
|
|
|
117
|
-
|
|
112
|
+
一次启动只接受非空的文本块序列,并使用子代理服务选择的子级 cwd。它创建私有 `AbortController`,用精确拼接的任务调用官方 SDK `query()`,并仅在 SDK 的 custom-spawn 钩子已经提供由子进程 seam 管理的活动 CLI 句柄后发布运行。提供方完整迭代消息流,只接受满足 `subtype: "success"`、`is_error: false` 且 `result` 非空白、随后迭代器正常结束的 `result` 消息。其余一切结果都映射为带固定类别的 `error` 诊断,命名生命周期阶段与已观测进程结果——类别集合见 [`src/run.ts`](src/run.ts)。本地取消会在结果竞态中胜出并映射为 `aborted`,且不附带失败诊断。
|
|
118
113
|
|
|
119
114
|
</details>
|
|
120
115
|
|
|
@@ -140,7 +135,7 @@ dsh --profile <name>
|
|
|
140
135
|
|
|
141
136
|
#### 模型看到什么
|
|
142
137
|
|
|
143
|
-
Claude Code 子级会在一个全新的 SDK query
|
|
138
|
+
Claude Code 子级会在一个全新的 SDK query 中接收独立文本任务。它的工作区是所选子级工作目录;所选提供方实例会固定已配置的模型、环境与非交互权限模式,而省略的模型及其余产品设置来自 Claude 原生配置。可执行版本来自 Bundle 锁定的 SDK 平台载荷。
|
|
144
139
|
|
|
145
140
|
#### Token 影响
|
|
146
141
|
|
|
@@ -154,15 +149,15 @@ Claude Code 子级会在一个全新的 SDK query 中接收独立文本任务。
|
|
|
154
149
|
|
|
155
150
|
#### 模型看到什么
|
|
156
151
|
|
|
157
|
-
通过 `dsh-tool-subagent
|
|
152
|
+
通过 `dsh-tool-subagent`,父模型先收到 child id,随后收到 Claude Code 最终答案或带停止原因与安全诊断的失败通知。诊断只包含固定的阶段、类别和已观测的协议或进程事实。产品推理、中间消息、工具活动、stderr、用量、产品标识符、命令、路径与原始协议载荷不会复制到父 Session。
|
|
158
153
|
|
|
159
154
|
#### Token 影响
|
|
160
155
|
|
|
161
|
-
|
|
156
|
+
父级输入会增加启动确认与完成通知,包括最终答案或失败信息。子任务 token 不进入父级上下文。本提供方自身不添加父级工具 schema。
|
|
162
157
|
|
|
163
158
|
#### KV Cache 影响
|
|
164
159
|
|
|
165
|
-
|
|
160
|
+
启动确认与完成通知仅追加到可复用的父请求前缀之后。通知可能唤醒新轮次,不会改写已有前缀。
|
|
166
161
|
|
|
167
162
|
## 已知限制与延期工作
|
|
168
163
|
|
|
@@ -177,7 +172,7 @@ Claude Code 子级会在一个全新的 SDK query 中接收独立文本任务。
|
|
|
177
172
|
- **身份验证与账户状态仍由原生机制管理**——Bundle 会提供 CLI,但不会创建账户、登录或改写 Claude 设置;配置与身份验证失败会公开其生命周期阶段与安全的 `unknown` 回退,而不会增加单独的公开分类。
|
|
178
173
|
- **委派时必须存在 SDK 平台载荷**——省略 optional dependencies 的安装、不受支持的平台以及缺失或损坏的载荷都会在第一次 query 时失败;不会回退到宿主 CLI。
|
|
179
174
|
- **没有人工交互路径**——`AskUserQuestion` 被禁用,权限提示会被拒绝,MCP elicitation 会被拒绝,阻塞对话会以拒绝方式失败而不会挂起。
|
|
180
|
-
- **assistant
|
|
175
|
+
- **assistant 载荷仅包含最终文本**——失败运行还可公开独立的安全诊断;推理、中间消息、工具通信、用量、stderr 与工作区差异不会进入父 Session。任务身份与终态结果保存在父日志中。
|
|
181
176
|
- **没有可选的共享能力**——对于本提供方,共享服务会拒绝 `agentOptions`、输出 schema、子任务角色设定、工具筛选和 harness 深度强制约束。
|
|
182
177
|
- **没有按实际经过时间触发的超时或副作用回滚**——长时间运行的工作由调用方取消,且取消前已更改的文件或外部系统不会恢复原状。
|
|
183
178
|
|
package/cordis.patch.yml
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
# This optional Profile layer registers the dormant Claude Code provider. Agent
|
|
2
|
-
# presets separately decide whether one session receives its delegation tool.
|
|
3
|
-
|
|
4
1
|
- insert:
|
|
5
2
|
- id: subagent-claude-code
|
|
6
3
|
name: '@deepseek-ai/dsh-subagent-claude-code'
|
|
4
|
+
- id: tool-subagent-claude-code
|
|
5
|
+
name: '@deepseek-ai/dsh-tool-subagent'
|
|
6
|
+
config:
|
|
7
|
+
provider: claude-code
|
|
8
|
+
toolName: subagent_claude_code
|
|
9
|
+
maxDepth: provider-managed
|
package/icon.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="14.9893" y="15.1877" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0a)" fill-opacity="0.8"></rect><rect x="8.87109" y="9.0697" width="12.2365" height="12.2365" rx="2" fill="url(#dsh_plugin_art_R0b)" fill-opacity="0.8"></rect><defs><linearGradient id="dsh_plugin_art_R0a" x1="21.1075" y1="15.1877" x2="21.1075" y2="27.4243" gradientUnits="userSpaceOnUse"><stop stop-color="#45E7A4"></stop><stop offset="1" stop-color="#05909D"></stop></linearGradient><linearGradient id="dsh_plugin_art_R0b" x1="14.9894" y1="9.0697" x2="14.9894" y2="21.3063" gradientUnits="userSpaceOnUse"><stop stop-color="#69B9FF"></stop><stop offset="1" stop-color="#324DE2"></stop></linearGradient></defs></svg>
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import z from "@deepseek-ai/schemastery";
|
|
2
2
|
import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
|
|
3
|
-
import { NO_START_CAPABILITIES, assertPositiveFinite,
|
|
3
|
+
import { NO_START_CAPABILITIES, assertPositiveFinite, assertUsableCwd, settleRunResult, subprocessRunHandle } from "@deepseek-ai/dsh-subagent";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
6
6
|
import { brandString } from "@deepseek-ai/dsh-brand";
|
|
@@ -511,11 +511,9 @@ var ClaudeCodeProvider = class {
|
|
|
511
511
|
this.config = config;
|
|
512
512
|
}
|
|
513
513
|
async start(request) {
|
|
514
|
-
const parentCwd = request.parent.session.header.cwd;
|
|
515
|
-
if (parentCwd === void 0) throw new Error("subagent-claude-code: no working directory for the child — delegate from a parent session that has one");
|
|
516
514
|
let cwd;
|
|
517
515
|
try {
|
|
518
|
-
cwd =
|
|
516
|
+
cwd = assertUsableCwd("subagent-claude-code", "child cwd", request.cwd);
|
|
519
517
|
} catch (error) {
|
|
520
518
|
if (request.signal.aborted) throw new Error("subagent-claude-code: request was aborted before SDK startup");
|
|
521
519
|
const failure = claudeCodeStartupFailure(error);
|
package/lib/types/run.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare const DEFAULT_CLAUDE_CODE_PERMISSION_MODE: ClaudeCodePermissionMo
|
|
|
26
26
|
export declare function claudeCodeStartupFailure(cause: unknown): Error;
|
|
27
27
|
/** Fully resolved inputs for one official Claude Agent SDK query. */
|
|
28
28
|
export interface ClaudeCodeRunSpec {
|
|
29
|
-
/**
|
|
29
|
+
/** Selected child working directory supplied to the SDK and real CLI. */
|
|
30
30
|
readonly cwd: string;
|
|
31
31
|
/** Profile-selected native model; omitted to preserve Claude settings. */
|
|
32
32
|
readonly model?: string;
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-subagent-claude-code",
|
|
3
3
|
"description": "One-shot Claude Code subagent provider over the official Agent SDK",
|
|
4
|
-
"version": "0.2.1-alpha.
|
|
4
|
+
"version": "0.2.1-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -19,9 +19,13 @@
|
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
21
|
"./src/*": "./src/*",
|
|
22
|
-
"./package.json": "./package.json"
|
|
22
|
+
"./package.json": "./package.json",
|
|
23
|
+
"./locale/*.json": "./locale/*.json",
|
|
24
|
+
"./cordis.patch.yml": "./cordis.patch.yml"
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
27
|
+
"icon.svg",
|
|
28
|
+
"locale/*.json",
|
|
25
29
|
"lib/index.js",
|
|
26
30
|
"cordis.patch.yml",
|
|
27
31
|
"lib/types/**/*.d.ts"
|
|
@@ -34,37 +38,39 @@
|
|
|
34
38
|
},
|
|
35
39
|
"peerDependencies": {
|
|
36
40
|
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
37
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
38
|
-
"@deepseek-ai/dsh-session": "0.2.1-alpha.
|
|
39
|
-
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.
|
|
40
|
-
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.
|
|
41
|
-
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.
|
|
41
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
|
|
44
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
|
|
45
|
+
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.2"
|
|
42
46
|
},
|
|
43
47
|
"dependencies": {
|
|
44
48
|
"@anthropic-ai/claude-agent-sdk": "0.3.263",
|
|
45
49
|
"@anthropic-ai/sdk": "0.93.0",
|
|
46
|
-
"@
|
|
50
|
+
"@deepseek-ai/dsh-brand": "0.2.1-alpha.2",
|
|
51
|
+
"@deepseek-ai/schemastery": "~3.18.5-alpha.1",
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.31.0",
|
|
47
53
|
"zod": "^4.4.3",
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/schemastery": "~3.18.5-alpha.1"
|
|
54
|
+
"@deepseek-ai/dsh-tool-subagent": "0.2.1-alpha.2"
|
|
50
55
|
},
|
|
51
56
|
"devDependencies": {
|
|
52
57
|
"@deepseek-ai/cordis": "~4.0.5-alpha.1",
|
|
53
|
-
"@deepseek-ai/dsh-agent": "0.2.1-alpha.
|
|
54
|
-
"@deepseek-ai/dsh-app-boot": "0.2.1-alpha.
|
|
55
|
-
"@deepseek-ai/dsh-llm": "0.2.1-alpha.
|
|
56
|
-
"@deepseek-ai/dsh-loader-smoke": "0.2.1-alpha.
|
|
57
|
-
"@deepseek-ai/dsh-session
|
|
58
|
-
"@deepseek-ai/dsh-session-
|
|
59
|
-
"@deepseek-ai/dsh-session-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-subagent
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-subprocess
|
|
64
|
-
"@deepseek-ai/dsh-
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-tool-
|
|
67
|
-
"@deepseek-ai/dsh-tools": "0.2.1-alpha.
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
}
|
|
58
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-app-boot": "0.2.1-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-loader-smoke": "0.2.1-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-session-checkpoint-policy": "0.2.1-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-subagent": "0.2.1-alpha.2",
|
|
67
|
+
"@deepseek-ai/dsh-subagent-codex": "0.2.1-alpha.2",
|
|
68
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
|
|
69
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.2",
|
|
70
|
+
"@deepseek-ai/dsh-timeout": "0.2.1-alpha.2",
|
|
71
|
+
"@deepseek-ai/dsh-tool-jobs": "0.2.1-alpha.2",
|
|
72
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2",
|
|
73
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.1-alpha.2"
|
|
74
|
+
},
|
|
75
|
+
"icon": "./icon.svg"
|
|
70
76
|
}
|