@deepseek-ai/dsh-subagent-claude-code 0.0.1-rc.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/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2026, DeepSeek
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,6 @@
1
+ # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
+ # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
+ # after editing either side, bring the other along and re-record with:
4
+ # pnpm run verify-translation-pairing --write packages/subagent/subagent-claude-code/README.md
5
+ README.md: 17b14e847baea3eadda7129b5e49f5e65b668cc8
6
+ README.zh.md: 2f59144d5bd9f26a58773e6dd53909b2b0e8da14
package/README.md ADDED
@@ -0,0 +1,98 @@
1
+ # @deepseek-ai/dsh-subagent-claude-code
2
+
3
+ English | [中文](README.zh.md)
4
+
5
+ This package registers the fixed `claude-code` subagent provider. Each accepted run invokes the official Claude Agent SDK in the delegating Session's workspace, resolves the native `claude` executable through the shared subprocess service, submits one self-contained text task, and returns only the final answer through the shared [`dsh-subagent`](../subagent/README.md) result contract.
6
+
7
+ ## Start and ownership
8
+
9
+ `start(request)` accepts only a non-empty sequence of text blocks and derives the child cwd from the parent Session. It creates one private `AbortController`, calls the official SDK `query()`, and publishes the run only after the SDK's `spawnClaudeCodeProcess` hook has supplied a live CLI handle owned by [`dsh-subprocess`](../../subprocess/subprocess/README.md). A failure or cancellation before publication closes the query, terminates any acquired process tree, waits for it to exit, and rejects `start()`.
10
+
11
+ The SDK receives the exact concatenated text task. The provider iterates the complete SDK message stream and accepts only a `result` message with `subtype: "success"`, `is_error: false`, and a nonblank `result`, followed by normal iterator completion. Every SDK error subtype, an error-marked success, a missing answer, iterator failure, protocol failure, or process failure maps to `error`; the provider produces neither `max-tokens` nor `refusal`.
12
+
13
+ Local cancellation wins the result race and maps to `aborted`. `dispose()` is idempotent: it aborts the run, asks the SDK query to close, invokes the shared process-tree termination escalation, and waits for whole-tree exit. SDK graceful close expresses protocol intent; the subprocess handle remains the authority for process quiescence. Result failure and independent teardown failure remain separate.
14
+
15
+ ## Native settings and interaction
16
+
17
+ The provider deliberately omits the SDK `settingSources` option. The official SDK therefore reads the host's normal user, project, and local Claude settings relative to the parent Session cwd, including native account state and product configuration. The provider neither copies nor filters those files and does not create or modify login state.
18
+
19
+ Each query sets `persistSession: false` and disables `AskUserQuestion`. It supplies no `canUseTool`, elicitation, or dialog callback, so unattended interactions fail through the SDK instead of waiting for a user interface this provider does not own.
20
+
21
+ ## Capabilities and context
22
+
23
+ The provider advertises no optional start-time capabilities and reports `inheritsParentContext: false`. Claude Code receives the standalone text task and the parent Session cwd, but not the parent conversation, persona, tool filter, depth policy, or structured-output contract. Every run has an independent SDK query, cancellation controller, CLI process, and non-persisted product session.
24
+
25
+ ## Configuration
26
+
27
+ | Key | Default | Meaning |
28
+ |---|---|---|
29
+ | `env` | `{}` | Explicit SDK/CLI environment layered over the shared credential-scrubbed parent environment. |
30
+ | `disposeGraceMs` | `3000` | Positive finite grace in milliseconds, no greater than [`MAX_TIMER_DELAY_MS`](../../util/timeout/README.md), between the shared process-tree owner's termination tiers; disposal then waits for whole-tree exit. |
31
+
32
+ Production resolves `claude` from the subprocess execution world's credential-scrubbed `PATH`, with explicit `env` entries applied, and passes the resulting path to the SDK as `pathToClaudeCodeExecutable`. On Windows, a resolved `.cmd` or `.bat` path is carried as a quoted, per-spawn environment value that `cmd.exe /v:off` expands once, so valid path metacharacters remain data. The pinned SDK's fixed flags then occupy cmd's command tail and contain no cmd metacharacters; they are not ordinary Windows argv. Native settings and authentication remain authoritative. The plugin does not install another CLI, select a model, create a product home, log in, or probe an account. Credential-shaped ambient variables are removed before the explicit `env` overlay is applied, so an API key or token intended for the child must be supplied there. Non-credential endpoint variables such as `ANTHROPIC_BASE_URL`, along with ordinary ambient values such as `PATH` and `HOME`, remain inherited unless overridden.
33
+
34
+ Shipped profiles load this provider once on the host and start no Claude process until a tool call. Full Agent Presets carry the tool row below with `disabled: true`; copy a preset and remove that field to expose `subagent_claude_code` only to agents composed from the copy. A custom host composition can still use both rows directly.
35
+
36
+ ```yaml
37
+ - id: subagent-claude-code
38
+ name: '@deepseek-ai/dsh-subagent-claude-code'
39
+ config:
40
+ env:
41
+ ANTHROPIC_API_KEY: !!js process.env.ANTHROPIC_API_KEY
42
+
43
+ - id: tool-subagent-claude-code
44
+ name: '@deepseek-ai/dsh-tool-subagent'
45
+ disabled: true
46
+ config:
47
+ provider: claude-code
48
+ toolName: subagent_claude_code
49
+ enableRunInBackground: false
50
+ maxDepth: provider-managed
51
+ ```
52
+
53
+ ## Product compatibility and evidence
54
+
55
+ The runtime dependency is pinned to `@anthropic-ai/claude-agent-sdk@0.3.220`. Production runs the native `claude` installation. The keyless real-product test uses the SDK-distributed Claude Code 2.1.220 CLI as a deterministic fixture, routed through the same native executable-resolution and Windows batch-shim path; it does not claim compatibility with every independently installed version. Loader composition proves that both product packages coexist without starting either product.
56
+
57
+ The project owner's identity-scoped distribution authorization covers the official SDK and the official CLI/platform payloads declared by each SDK version. [`THIRD_PARTY_NOTICES.md`](../../../THIRD_PARTY_NOTICES.md) discloses the current optional payload closure without classifying its declared terms as permissive; unrelated non-permissive runtime dependencies continue to fail the notices gate.
58
+
59
+ ## Model Experience
60
+
61
+ ### Child request
62
+
63
+ #### What the model sees
64
+
65
+ The Claude Code child receives the standalone text task as one fresh SDK query. Its workspace is the parent Session cwd, while its model, system instructions, tools, permissions, and authentication come from the host's native Claude settings and product installation.
66
+
67
+ #### Token effect
68
+
69
+ The child pays for an independent Claude Code context and query. Child tokens do not enter the parent's context.
70
+
71
+ #### KV Cache effect
72
+
73
+ Independent of the parent request cache. Reuse depends only on Claude Code's own model, instructions, tools, native settings, and fresh query.
74
+
75
+ ### Parent tool result, indirectly
76
+
77
+ #### What the model sees
78
+
79
+ Through `dsh-tool-subagent`, the parent sees only the strict final Claude Code answer or the consumer's exact error for a non-completed result. Claude Code reasoning, tool activity, intermediate messages, stderr, workspace diffs, usage, and product ids are not copied into the parent Session.
80
+
81
+ #### Token effect
82
+
83
+ Parent input grows only by the final answer or error retained in the tool result. This provider adds no parent tool schema by itself.
84
+
85
+ #### KV Cache effect
86
+
87
+ Append-only: the new tool result follows the reusable parent request prefix.
88
+
89
+ ## Known Limitations and Deferred Work
90
+
91
+ - **One fresh query and process per run** — there is no continuation, resume, pooling, progress stream, or product-session persistence.
92
+ - **Host settings are intentionally authoritative** — project and user settings can change model, tools, and behavior; the provider does not provide a filtered or hermetic production mode.
93
+ - **Product installation and account state remain native** — a missing or incompatible `claude`, configuration error, or authentication failure is surfaced as a startup or run error; the plugin provides no installer or login flow.
94
+ - **The SDK platform CLI remains in the install closure** — production ignores it in favor of the host `claude`, but the current SDK optional dependency is still installed and supplies the keyless compatibility fixture. Removing that payload belongs to the separate product installation-closure follow-up.
95
+ - **No human interaction path** — `AskUserQuestion` is disabled and other interactive callbacks are absent, so tasks requiring new approval or input fail instead of suspending.
96
+ - **Final text only** — reasoning, intermediate messages, tool traffic, usage, stderr, and workspace diffs remain product-local.
97
+ - **No optional shared capabilities** — output schemas, child personas, tool filtering, and harness depth enforcement are rejected by the shared service for this provider.
98
+ - **No wall-clock timeout or side-effect rollback** — the caller cancels long work, and files or external systems changed before cancellation are not restored.
package/README.zh.md ADDED
@@ -0,0 +1,98 @@
1
+ # @deepseek-ai/dsh-subagent-claude-code
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 本包(package)注册固定的 `claude-code` subagent 提供方。每次接受运行请求后,它都会在发起委托的会话工作区中调用官方 Claude Agent SDK,通过共享子进程服务解析原生 `claude` 可执行文件,提交一个自包含的文本任务,并通过共享的 [`dsh-subagent`](../subagent/README.md) 结果约定仅返回最终答案。
6
+
7
+ ## 启动与所有权
8
+
9
+ `start(request)` 只接受非空的文本块序列,并根据父会话确定子级 cwd。它会创建一个私有 `AbortController`,调用官方 SDK 的 `query()`,并仅在 SDK 的 `spawnClaudeCodeProcess` 钩子已经提供由 [`dsh-subprocess`](../../subprocess/subprocess/README.md) 管理的活动 CLI 句柄后发布此次运行。若在发布前发生失败或取消,它会关闭 query、终止所有已取得的进程树并等待其退出,然后拒绝 `start()` 调用。
10
+
11
+ SDK 接收由文本块原样拼接成的任务。提供方会完整迭代 SDK 消息流,而且只接受满足以下条件的 `result` 消息:其 `subtype: "success"`、`is_error: false` 且 `result` 非空白,之后迭代器还须正常结束。所有 SDK 错误子类型、标记为错误的成功消息、缺失答案、迭代器失败、协议失败或进程失败都映射为 `error`;该提供方不会产生 `max-tokens` 或 `refusal`。
12
+
13
+ 本地取消会在结果竞态中胜出并映射为 `aborted`。`dispose()` 具有幂等性:它会中止此次运行、请求 SDK query 关闭、调用共享的进程树逐级终止机制,并等待整棵进程树退出。SDK 的优雅关闭只表达协议意图;进程是否完全停稳仍以子进程句柄为准。结果失败与独立的清理失败仍彼此分离。
14
+
15
+ ## 原生设置与交互
16
+
17
+ 提供方故意省略 SDK 的 `settingSources` 选项。因此,官方 SDK 会相对于父会话 cwd 读取宿主机常规的用户、项目和本地 Claude 设置,包括原生账户状态与产品配置。提供方既不复制也不过滤这些文件,也不会创建或修改登录状态。
18
+
19
+ 每次 query 都设置 `persistSession: false` 并禁用 `AskUserQuestion`。提供方不设置 `canUseTool`、elicitation 或对话回调,因此无人值守交互会经 SDK 失败,而不会等待本提供方不负责的用户界面。
20
+
21
+ ## 能力与上下文
22
+
23
+ 本提供方不声明任何可选的启动时能力,并报告 `inheritsParentContext: false`。Claude Code 会接收独立文本任务和父会话 cwd,但不会接收父会话的对话、角色设定、工具筛选器、深度策略或结构化输出约定。每次运行都拥有独立的 SDK query、取消控制器、CLI 进程和不持久化的产品会话。
24
+
25
+ ## 配置
26
+
27
+ | 配置键 | 默认值 | 含义 |
28
+ |---|---|---|
29
+ | `env` | `{}` | 显式指定的 SDK/CLI 环境,叠加在由共享机制清除凭证后的父环境之上。 |
30
+ | `disposeGraceMs` | `3000` | 共享进程树责任方各终止层级之间的宽限期,单位为毫秒且须为正有限值,并不得大于仓库共享的 [`MAX_TIMER_DELAY_MS`](../../util/timeout/README.md);随后资源释放会等待整棵进程树退出。 |
31
+
32
+ 生产环境从子进程执行世界清除凭证后的 `PATH` 解析 `claude`,再应用显式 `env` 条目,并把所得路径作为 `pathToClaudeCodeExecutable` 交给 SDK。在 Windows 上,解析到的 `.cmd` 或 `.bat` 路径会作为带引号、仅供本次 spawn 使用的环境值交给 `cmd.exe /v:off` 展开一次,因此合法路径中的元字符仍只是数据。锁定版本的 SDK 随后把固定命令行选项放在 cmd 的命令尾部;这些选项不含 cmd 元字符,也并不是普通的 Windows argv。原生设置与身份验证继续是权威来源。本插件不安装另一份 CLI、不选择模型、不创建产品主目录、不执行登录,也不探测账户。具有凭证特征的环境变量会在显式 `env` 覆盖生效前被清除,因此供子进程使用的 API 密钥或 token 必须在该配置中显式提供。除非被覆盖,`ANTHROPIC_BASE_URL` 等非凭证端点变量以及 `PATH` 和 `HOME` 等普通环境变量仍会被继承。
33
+
34
+ 随附 profile 会在宿主上加载一次该提供方,而且在工具被调用前不会启动 Claude 进程。完整 Agent Preset 携带下列工具行并设置 `disabled: true`;复制一个 preset 后删除该字段,即可只向由该副本组装的 agent 暴露 `subagent_claude_code`。自定义宿主组装仍可直接使用两条配置行。
35
+
36
+ ```yaml
37
+ - id: subagent-claude-code
38
+ name: '@deepseek-ai/dsh-subagent-claude-code'
39
+ config:
40
+ env:
41
+ ANTHROPIC_API_KEY: !!js process.env.ANTHROPIC_API_KEY
42
+
43
+ - id: tool-subagent-claude-code
44
+ name: '@deepseek-ai/dsh-tool-subagent'
45
+ disabled: true
46
+ config:
47
+ provider: claude-code
48
+ toolName: subagent_claude_code
49
+ enableRunInBackground: false
50
+ maxDepth: provider-managed
51
+ ```
52
+
53
+ ## 产品兼容性与证据
54
+
55
+ 运行时依赖精确锁定为 `@anthropic-ai/claude-agent-sdk@0.3.220`。生产运行使用原生 `claude` 安装。无密钥真实产品测试使用由 SDK 分发的 Claude Code 2.1.220 CLI 作为确定性 fixture(测试前置数据),并通过同一套原生可执行文件解析路径与 Windows batch shim 路径运行;这项测试不声称兼容每个独立安装的版本。Loader 组合证明两个产品包能够共存且不会启动任一产品。
56
+
57
+ 项目所有者按身份范围授权分发官方 SDK 及每个 SDK 版本声明的官方 CLI/平台载荷。[`THIRD_PARTY_NOTICES.md`](../../../THIRD_PARTY_NOTICES.md) 会披露当前可选载荷闭包,但不会把其声明条款归类为宽松许可证;其他无关的非宽松运行时依赖仍会使第三方声明门禁失败。
58
+
59
+ ## 模型体验
60
+
61
+ ### 子任务请求
62
+
63
+ #### 模型看到的内容
64
+
65
+ Claude Code 子任务会在一个全新的 SDK query 中接收独立文本任务。它的工作区是父会话 cwd;其模型、系统指令、工具、权限和身份验证来自宿主机原生 Claude 设置与产品安装。
66
+
67
+ #### 对 token 的影响
68
+
69
+ 子任务需为独立的 Claude Code 上下文和 query 承担 token 开销。子任务 token 不会进入父级上下文。
70
+
71
+ #### 对 KV Cache 的影响
72
+
73
+ 这与父请求缓存相互独立。能否复用只取决于 Claude Code 自身的模型、指令、工具、原生设置和全新 query。
74
+
75
+ ### 父级工具结果(间接)
76
+
77
+ #### 模型看到的内容
78
+
79
+ 通过 `dsh-tool-subagent`,父级模型只会看到符合严格成功条件的 Claude Code 最终答案,或者在结果未完成时看到消费方给出的原样错误。Claude Code 的推理、工具活动、中间消息、stderr、工作区差异、用量信息和产品标识符均不会复制到父会话。
80
+
81
+ #### 对 token 的影响
82
+
83
+ 父级输入只会增加工具结果中保留的最终答案或错误内容。本提供方自身不添加父级工具 schema。
84
+
85
+ #### 对 KV Cache 的影响
86
+
87
+ 仅追加:新的工具结果接在可复用的父请求前缀之后。
88
+
89
+ ## 已知限制与后续工作
90
+
91
+ - **每次运行均新建一个 query 和一个进程**:不支持续接、恢复、池化、进度流或产品会话持久化。
92
+ - **宿主设置有意保持权威**:项目和用户设置可以改变模型、工具与行为;本提供方不提供经过筛选或与宿主环境隔离的生产模式。
93
+ - **产品安装与账户状态仍由原生机制管理**:`claude` 缺失或不兼容、配置错误或身份验证失败都会呈现为启动错误或运行错误;本插件不提供安装程序或登录流程。
94
+ - **SDK 平台 CLI 仍在安装闭包内**:生产环境会忽略它,改用宿主提供的 `claude`,但当前 SDK 的可选依赖仍会安装,并提供无密钥兼容性 fixture。移除该载荷属于独立的产品安装闭包后续项。
95
+ - **没有人工交互路径**:`AskUserQuestion` 被禁用,其他交互回调也不存在,因此需要新审批或输入的任务会失败而不会挂起。
96
+ - **仅返回最终文本**:推理、中间消息、工具通信、用量信息、stderr 和工作区差异仍只保留在产品内部。
97
+ - **没有可选的共享能力**:对于本提供方,共享服务会拒绝输出 schema、子任务角色设定、工具筛选和 harness 深度强制约束。
98
+ - **没有按实际经过时间触发的超时或副作用回滚**:长时间运行的工作由调用方取消,且取消前已更改的文件或外部系统不会恢复原状。
package/lib/index.js ADDED
@@ -0,0 +1,369 @@
1
+ import z from "@deepseek-ai/schemastery";
2
+ import { MAX_TIMER_DELAY_MS } from "@deepseek-ai/dsh-timeout";
3
+ import { NO_START_CAPABILITIES, assertPositiveFinite, resolveChildCwd, settleRunResult, subprocessRunHandle } from "@deepseek-ai/dsh-subagent";
4
+ import { randomUUID } from "node:crypto";
5
+ import { query } from "@anthropic-ai/claude-agent-sdk";
6
+ import { SessionId } from "@deepseek-ai/dsh-session";
7
+ import { scrubbedParentEnv } from "@deepseek-ai/dsh-subprocess";
8
+ import { EventEmitter } from "node:events";
9
+ import { extname } from "node:path";
10
+ //#region lib/types/process.js
11
+ /**
12
+ * Projection from the shared managed-process handle to the official Claude
13
+ * Agent SDK's custom-spawn process interface.
14
+ *
15
+ * @module @deepseek-ai/dsh-subagent-claude-code/process
16
+ */
17
+ const WINDOWS_BATCH_EXECUTABLE_ENV = "DSH_CLAUDE_CODE_EXECUTABLE";
18
+ function thrown$1(value) {
19
+ /* v8 ignore next -- the subprocess seam rejects with Error. */
20
+ return value instanceof Error ? value : new Error(String(value));
21
+ }
22
+ /**
23
+ * Encode the SDK's complete child environment as a subprocess overlay.
24
+ * @param env - SDK-composed child environment after its removals and replacements.
25
+ * @returns explicit values plus tombstones for surviving ambient names the SDK removed.
26
+ */
27
+ function sdkEnvironmentOverlay(env) {
28
+ const overlay = { ...env };
29
+ for (const name of Object.keys(scrubbedParentEnv())) if (!(name in env)) overlay[name] = void 0;
30
+ return overlay;
31
+ }
32
+ /**
33
+ * Translate one official SDK spawn request to the shared process owner.
34
+ * @param options - command, arguments, workspace, environment, and forwarded signal from the SDK.
35
+ * @param graceMs - process-tree termination grace.
36
+ * @param platform - host platform selecting the Windows batch-shim boundary.
37
+ * @returns the fully explicit shared subprocess request.
38
+ * @remarks The batch-shim path quotes only the resolved executable. The pinned SDK
39
+ * supplies fixed flag arguments without cmd metacharacters; cmd reparses that tail.
40
+ */
41
+ function claudeSpawnSpec(options, graceMs, platform = process.platform) {
42
+ if (options.cwd === void 0 || options.cwd.length === 0) throw new Error("subagent-claude-code: SDK spawn request omitted its workspace");
43
+ const extension = extname(options.command).toLowerCase();
44
+ const batchShim = platform === "win32" && (extension === ".cmd" || extension === ".bat");
45
+ const env = sdkEnvironmentOverlay(options.env);
46
+ const argv = batchShim ? [
47
+ "cmd.exe",
48
+ "/d",
49
+ "/v:off",
50
+ "/s",
51
+ "/c",
52
+ `%${WINDOWS_BATCH_EXECUTABLE_ENV}%`,
53
+ ...options.args
54
+ ] : [options.command, ...options.args];
55
+ if (batchShim) env[WINDOWS_BATCH_EXECUTABLE_ENV] = `"${options.command}"`;
56
+ return {
57
+ argv,
58
+ cwd: options.cwd,
59
+ stdio: {
60
+ stdin: "pipe",
61
+ stdout: "pipe",
62
+ stderr: "inherit"
63
+ },
64
+ graceMs,
65
+ signal: options.signal,
66
+ env
67
+ };
68
+ }
69
+ /**
70
+ * SDK-facing view of one shared managed process. Protocol transport remains
71
+ * in the official SDK; this adapter only projects streams and exit events.
72
+ */
73
+ var ManagedClaudeCodeProcess = class {
74
+ child;
75
+ stdin;
76
+ stdout;
77
+ events = new EventEmitter();
78
+ exitCodeValue = null;
79
+ signalCodeValue = null;
80
+ killRequested = false;
81
+ /**
82
+ * Project a managed process with piped stdin and stdout.
83
+ * @param child - shared handle that remains the process-tree authority.
84
+ */
85
+ constructor(child) {
86
+ this.child = child;
87
+ this.stdin = child.stdin;
88
+ this.stdout = child.stdout;
89
+ this.events.on("error", () => {});
90
+ child.done.then((outcome) => {
91
+ this.exitCodeValue = outcome.exitCode;
92
+ this.signalCodeValue = outcome.signal;
93
+ this.events.emit("exit", outcome.exitCode, outcome.signal);
94
+ }, (error) => {
95
+ this.events.emit("error", thrown$1(error));
96
+ });
97
+ }
98
+ /** Whether the SDK has requested managed tree termination. */
99
+ get killed() {
100
+ return this.killRequested;
101
+ }
102
+ /** Direct-child exit code, or null while running or after signal exit. */
103
+ get exitCode() {
104
+ return this.exitCodeValue;
105
+ }
106
+ /** Direct-child terminating signal, if any. */
107
+ get signalCode() {
108
+ return this.signalCodeValue;
109
+ }
110
+ /**
111
+ * Route the SDK's termination request to the tree-scoped process owner.
112
+ * @param _signal - SDK-selected signal; the shared seam owns its escalation ladder.
113
+ * @returns false only after exit or a previous termination request.
114
+ */
115
+ kill(_signal) {
116
+ if (this.killRequested || this.exitCodeValue !== null || this.signalCodeValue !== null) return false;
117
+ this.killRequested = true;
118
+ this.child.terminate();
119
+ return true;
120
+ }
121
+ /** Register a persistent process lifecycle listener. */
122
+ on(event, listener) {
123
+ this.events.on(event, listener);
124
+ }
125
+ /** Register a one-shot process lifecycle listener. */
126
+ once(event, listener) {
127
+ this.events.once(event, listener);
128
+ }
129
+ /** Remove a process lifecycle listener. */
130
+ off(event, listener) {
131
+ this.events.off(event, listener);
132
+ }
133
+ };
134
+ //#endregion
135
+ //#region lib/types/run.js
136
+ /**
137
+ * One-shot Claude Code lifecycle: invoke the official Agent SDK, place its
138
+ * real CLI process under the shared subprocess owner, map only strict SDK
139
+ * success to completion, and dispose to whole-tree quiescence.
140
+ *
141
+ * @module @deepseek-ai/dsh-subagent-claude-code/run
142
+ */
143
+ /** Default POSIX grace between subprocess termination tiers. */
144
+ const DEFAULT_DISPOSE_GRACE_MS = 3e3;
145
+ function thrown(value) {
146
+ /* v8 ignore next -- typed SDK and subprocess failures reject with Error. */
147
+ return value instanceof Error ? value : new Error(String(value));
148
+ }
149
+ /**
150
+ * Validate and preserve the one-shot task before crossing the SDK boundary.
151
+ * @param prompt - task content accepted from the shared subagent service.
152
+ * @returns the exact text sequence as one SDK prompt.
153
+ */
154
+ function textTask(prompt) {
155
+ if (prompt.length === 0) throw new Error("subagent-claude-code: the one-shot task must contain only text blocks");
156
+ const texts = [];
157
+ for (const block of prompt) {
158
+ if (block.type !== "text") throw new Error("subagent-claude-code: the one-shot task must contain only text blocks");
159
+ texts.push(block.text);
160
+ }
161
+ if (texts.every((text) => text.trim().length === 0)) throw new Error("subagent-claude-code: the one-shot task must not be empty");
162
+ return texts.join("");
163
+ }
164
+ /**
165
+ * Strictly derive the only SDK result that can complete a shared run.
166
+ * @param message - an official discriminated result union.
167
+ * @returns exact final text for a successful, non-error result.
168
+ */
169
+ function successfulResult(message) {
170
+ if (message.subtype !== "success" || message.is_error || message.result.trim().length === 0) {
171
+ const detail = message.subtype === "success" ? "success result was marked as an error or contained no answer" : message.errors.join("; ") || message.subtype;
172
+ throw new Error(`subagent-claude-code: Claude Code failed: ${detail}`);
173
+ }
174
+ return message.result;
175
+ }
176
+ /**
177
+ * Consume the complete SDK stream and require one strict success plus normal
178
+ * iterator completion.
179
+ * @param query - published official SDK query.
180
+ * @returns the completed shared result.
181
+ */
182
+ async function consumeClaudeQuery(query) {
183
+ let answer;
184
+ for await (const message of query) {
185
+ if (message.type !== "result") continue;
186
+ answer = successfulResult(message);
187
+ }
188
+ if (answer === void 0) throw new Error("subagent-claude-code: Claude Code ended without a result");
189
+ return {
190
+ output: [{
191
+ type: "text",
192
+ text: answer
193
+ }],
194
+ stopReason: "completed"
195
+ };
196
+ }
197
+ /**
198
+ * Close the official query, terminate the managed process tree, and wait for
199
+ * the subprocess owner to prove it is gone.
200
+ * @param query - official SDK query, when creation reached that point.
201
+ * @param child - shared-service handle that owns the CLI process tree.
202
+ */
203
+ async function disposeClaudeCodeChild(query, child) {
204
+ const failures = [];
205
+ try {
206
+ query?.close();
207
+ } catch (error) {
208
+ failures.push(thrown(error));
209
+ }
210
+ if (child.pid > 0) {
211
+ child.terminate();
212
+ try {
213
+ await child.waitForExit();
214
+ } catch (error) {
215
+ failures.push(thrown(error));
216
+ }
217
+ }
218
+ try {
219
+ await child.done;
220
+ } catch (error) {
221
+ failures.push(thrown(error));
222
+ }
223
+ const firstFailure = failures[0];
224
+ if (failures.length === 1 && firstFailure !== void 0) throw firstFailure;
225
+ if (failures.length > 1) throw new AggregateError(failures, "subagent-claude-code: query and process cleanup failed");
226
+ }
227
+ /**
228
+ * Build the fixed official SDK options for one one-shot provider run.
229
+ * @param spec - Workspace, environment, process service, and disposal policy.
230
+ * @param controller - per-run cancellation owner.
231
+ * @param capture - receives the real managed child synchronously from the SDK hook.
232
+ * @returns options that inherit native settings while disabling persistence and user questions.
233
+ */
234
+ function claudeQueryOptions(spec, controller, capture) {
235
+ return {
236
+ abortController: controller,
237
+ cwd: spec.cwd,
238
+ pathToClaudeCodeExecutable: spec.executable,
239
+ env: {
240
+ ...scrubbedParentEnv(),
241
+ ...spec.env
242
+ },
243
+ persistSession: false,
244
+ disallowedTools: ["AskUserQuestion"],
245
+ spawnClaudeCodeProcess: (options) => {
246
+ const child = spec.spawn(claudeSpawnSpec(options, spec.disposeGraceMs));
247
+ capture(child);
248
+ return new ManagedClaudeCodeProcess(child);
249
+ }
250
+ };
251
+ }
252
+ /**
253
+ * Start one official Claude Agent SDK query and publish its one-shot run.
254
+ * @param request - resolved shared subagent request.
255
+ * @param spec - Workspace, environment, process service, and diagnostic policy.
256
+ * @returns the published run after both Query and real CLI handle exist.
257
+ */
258
+ async function startClaudeCodeRun(request, spec) {
259
+ const prompt = textTask(request.prompt);
260
+ if (request.signal.aborted) throw new Error("subagent-claude-code: request was aborted before SDK startup");
261
+ const controller = new AbortController();
262
+ const requestCancel = () => {
263
+ if (!controller.signal.aborted) controller.abort(/* @__PURE__ */ new Error("subagent-claude-code: run cancelled locally"));
264
+ };
265
+ const onAbort = () => {
266
+ requestCancel();
267
+ };
268
+ request.signal.addEventListener("abort", onAbort, { once: true });
269
+ let child;
270
+ let query$1;
271
+ try {
272
+ query$1 = query({
273
+ prompt,
274
+ options: claudeQueryOptions(spec, controller, (captured) => {
275
+ child = captured;
276
+ })
277
+ });
278
+ if (child === void 0 || child.pid <= 0) throw new Error("subagent-claude-code: official SDK did not publish a controllable Claude Code process");
279
+ if (controller.signal.aborted) throw new Error("subagent-claude-code: request was aborted before SDK startup");
280
+ } catch (error) {
281
+ request.signal.removeEventListener("abort", onAbort);
282
+ const cancelledBeforeCleanup = controller.signal.aborted;
283
+ requestCancel();
284
+ if (child !== void 0) try {
285
+ await disposeClaudeCodeChild(query$1, child);
286
+ } catch (disposeError) {
287
+ throw new AggregateError([thrown(error), thrown(disposeError)], "subagent-claude-code: startup failed and CLI cleanup also failed");
288
+ }
289
+ else if (query$1 !== void 0) try {
290
+ query$1.close();
291
+ } catch (disposeError) {
292
+ throw new AggregateError([thrown(error), thrown(disposeError)], "subagent-claude-code: startup failed and query cleanup also failed");
293
+ }
294
+ if (cancelledBeforeCleanup || request.signal.aborted) throw new Error("subagent-claude-code: request was aborted before SDK startup");
295
+ throw thrown(error);
296
+ }
297
+ const publishedQuery = query$1;
298
+ const publishedChild = child;
299
+ const result = settleRunResult({
300
+ attempt: () => consumeClaudeQuery(publishedQuery),
301
+ collectOutput: () => [],
302
+ cancelled: () => controller.signal.aborted,
303
+ onError: spec.onError,
304
+ signal: request.signal,
305
+ onAbort
306
+ });
307
+ return subprocessRunHandle({
308
+ id: SessionId(randomUUID()),
309
+ result,
310
+ signal: request.signal,
311
+ onAbort,
312
+ requestCancel,
313
+ teardown: () => disposeClaudeCodeChild(publishedQuery, publishedChild)
314
+ });
315
+ }
316
+ //#endregion
317
+ //#region lib/types/index.js
318
+ /**
319
+ * Fixed Claude Code one-shot subagent provider. Every accepted run invokes
320
+ * the official Agent SDK in the delegating Session's workspace and places
321
+ * the SDK-spawned real CLI under the shared subprocess owner.
322
+ *
323
+ * @module @deepseek-ai/dsh-subagent-claude-code
324
+ */
325
+ const name = "subagent-claude-code";
326
+ const inject = ["subagents", "subprocess"];
327
+ const Config = z.object({
328
+ env: z.dict(z.string()).default({}),
329
+ disposeGraceMs: z.number().default(DEFAULT_DISPOSE_GRACE_MS)
330
+ });
331
+ var ClaudeCodeProvider = class {
332
+ ctx;
333
+ config;
334
+ name = "claude-code";
335
+ capabilities = NO_START_CAPABILITIES;
336
+ inheritsParentContext = false;
337
+ constructor(ctx, config) {
338
+ this.ctx = ctx;
339
+ this.config = config;
340
+ }
341
+ async start(request) {
342
+ const parentCwd = request.parent.session.header.cwd;
343
+ if (parentCwd === void 0) throw new Error("subagent-claude-code: no working directory for the child — delegate from a parent session that has one");
344
+ const executable = await this.ctx.subprocess.resolveExecutable("claude", this.config.env, request.signal);
345
+ return startClaudeCodeRun(request, {
346
+ cwd: resolveChildCwd("subagent-claude-code", void 0, parentCwd),
347
+ executable,
348
+ env: this.config.env,
349
+ disposeGraceMs: this.config.disposeGraceMs,
350
+ spawn: (spawnSpec) => this.ctx.subprocess.spawn(spawnSpec),
351
+ onError: (error, stopReason) => {
352
+ this.ctx.logger.warn(`subagent-claude-code: child run failed (${stopReason}): ${error.message}`);
353
+ }
354
+ });
355
+ }
356
+ };
357
+ /**
358
+ * Register the fixed `claude-code` provider.
359
+ * @param ctx - context carrying shared subagent and subprocess services.
360
+ * @param config - explicit child environment and disposal grace.
361
+ */
362
+ function apply(ctx, config) {
363
+ const resolved = config;
364
+ assertPositiveFinite("subagent-claude-code", "disposeGraceMs", resolved.disposeGraceMs);
365
+ if (resolved.disposeGraceMs > MAX_TIMER_DELAY_MS) throw new Error(`subagent-claude-code: disposeGraceMs must be no greater than ${MAX_TIMER_DELAY_MS}`);
366
+ ctx.subagents.registerProvider(new ClaudeCodeProvider(ctx, resolved));
367
+ }
368
+ //#endregion
369
+ export { Config, apply, inject, name };
@@ -0,0 +1,24 @@
1
+ //#region lib/types/invariant.js
2
+ /**
3
+ * Package-owned invariant companion for
4
+ * `@deepseek-ai/dsh-subagent-claude-code`.
5
+ * @module @deepseek-ai/dsh-subagent-claude-code/invariant
6
+ */
7
+ const PACKAGE_NAME = "@deepseek-ai/dsh-subagent-claude-code";
8
+ /** Cordis companion plugin name. */
9
+ const name = "subagent-claude-code-invariant";
10
+ /** Service required before the companion can reserve package ownership. */
11
+ const inject = ["invariants"];
12
+ /**
13
+ * No runtime invariant: lifecycle pairing belongs to the shared subagent
14
+ * service and process-tree ownership belongs to the subprocess service.
15
+ */
16
+ const install = () => {};
17
+ /**
18
+ * Register this package's invariant companion.
19
+ * @param ctx - plugin context carrying the invariant registry.
20
+ * @returns the installed registration's disposer.
21
+ */
22
+ const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
23
+ //#endregion
24
+ export { apply, inject, name };
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Fixed Claude Code one-shot subagent provider. Every accepted run invokes
3
+ * the official Agent SDK in the delegating Session's workspace and places
4
+ * the SDK-spawned real CLI under the shared subprocess owner.
5
+ *
6
+ * @module @deepseek-ai/dsh-subagent-claude-code
7
+ */
8
+ import type { Context } from '@deepseek-ai/cordis';
9
+ import z from '@deepseek-ai/schemastery';
10
+ export declare const name = "subagent-claude-code";
11
+ export declare const inject: string[];
12
+ /** Deployment-owned environment and process-release bound. */
13
+ export interface Config {
14
+ /**
15
+ * Explicit environment entries layered over the subprocess seam's
16
+ * credential-scrubbed parent environment.
17
+ */
18
+ env?: Record<string, string>;
19
+ /** Grace in milliseconds for Claude Code process-tree termination. */
20
+ disposeGraceMs?: number;
21
+ }
22
+ export declare const Config: z<Config>;
23
+ /**
24
+ * Register the fixed `claude-code` provider.
25
+ * @param ctx - context carrying shared subagent and subprocess services.
26
+ * @param config - explicit child environment and disposal grace.
27
+ */
28
+ export declare function apply(ctx: Context, config: Config): void;
29
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Package-owned invariant companion for
3
+ * `@deepseek-ai/dsh-subagent-claude-code`.
4
+ * @module @deepseek-ai/dsh-subagent-claude-code/invariant
5
+ */
6
+ import type { Context } from '@deepseek-ai/cordis';
7
+ /** Cordis companion plugin name. */
8
+ export declare const name = "subagent-claude-code-invariant";
9
+ /** Service required before the companion can reserve package ownership. */
10
+ export declare const inject: string[];
11
+ /**
12
+ * Register this package's invariant companion.
13
+ * @param ctx - plugin context carrying the invariant registry.
14
+ * @returns the installed registration's disposer.
15
+ */
16
+ export declare const apply: (ctx: Context) => Promise<() => void>;
17
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Projection from the shared managed-process handle to the official Claude
3
+ * Agent SDK's custom-spawn process interface.
4
+ *
5
+ * @module @deepseek-ai/dsh-subagent-claude-code/process
6
+ */
7
+ import type { SpawnedProcess, SpawnOptions } from '@anthropic-ai/claude-agent-sdk';
8
+ import { type SubprocessHandle, type SubprocessSpawnSpec } from '@deepseek-ai/dsh-subprocess';
9
+ /**
10
+ * Encode the SDK's complete child environment as a subprocess overlay.
11
+ * @param env - SDK-composed child environment after its removals and replacements.
12
+ * @returns explicit values plus tombstones for surviving ambient names the SDK removed.
13
+ */
14
+ export declare function sdkEnvironmentOverlay(env: SpawnOptions['env']): NodeJS.ProcessEnv;
15
+ /**
16
+ * Translate one official SDK spawn request to the shared process owner.
17
+ * @param options - command, arguments, workspace, environment, and forwarded signal from the SDK.
18
+ * @param graceMs - process-tree termination grace.
19
+ * @param platform - host platform selecting the Windows batch-shim boundary.
20
+ * @returns the fully explicit shared subprocess request.
21
+ * @remarks The batch-shim path quotes only the resolved executable. The pinned SDK
22
+ * supplies fixed flag arguments without cmd metacharacters; cmd reparses that tail.
23
+ */
24
+ export declare function claudeSpawnSpec(options: SpawnOptions, graceMs: number, platform?: NodeJS.Platform): SubprocessSpawnSpec;
25
+ /**
26
+ * SDK-facing view of one shared managed process. Protocol transport remains
27
+ * in the official SDK; this adapter only projects streams and exit events.
28
+ */
29
+ export declare class ManagedClaudeCodeProcess implements SpawnedProcess {
30
+ private readonly child;
31
+ readonly stdin: import("stream").Writable;
32
+ readonly stdout: import("stream").Readable;
33
+ private readonly events;
34
+ private exitCodeValue;
35
+ private signalCodeValue;
36
+ private killRequested;
37
+ /**
38
+ * Project a managed process with piped stdin and stdout.
39
+ * @param child - shared handle that remains the process-tree authority.
40
+ */
41
+ constructor(child: SubprocessHandle);
42
+ /** Whether the SDK has requested managed tree termination. */
43
+ get killed(): boolean;
44
+ /** Direct-child exit code, or null while running or after signal exit. */
45
+ get exitCode(): number | null;
46
+ /** Direct-child terminating signal, if any. */
47
+ get signalCode(): NodeJS.Signals | null;
48
+ /**
49
+ * Route the SDK's termination request to the tree-scoped process owner.
50
+ * @param _signal - SDK-selected signal; the shared seam owns its escalation ladder.
51
+ * @returns false only after exit or a previous termination request.
52
+ */
53
+ kill(_signal: NodeJS.Signals): boolean;
54
+ /** Register a persistent process lifecycle listener. */
55
+ on(event: 'exit' | 'error', listener: ((code: number | null, signal: NodeJS.Signals | null) => void) | ((error: Error) => void)): void;
56
+ /** Register a one-shot process lifecycle listener. */
57
+ once(event: 'exit' | 'error', listener: ((code: number | null, signal: NodeJS.Signals | null) => void) | ((error: Error) => void)): void;
58
+ /** Remove a process lifecycle listener. */
59
+ off(event: 'exit' | 'error', listener: ((code: number | null, signal: NodeJS.Signals | null) => void) | ((error: Error) => void)): void;
60
+ }
61
+ //# sourceMappingURL=process.d.ts.map
@@ -0,0 +1,70 @@
1
+ /**
2
+ * One-shot Claude Code lifecycle: invoke the official Agent SDK, place its
3
+ * real CLI process under the shared subprocess owner, map only strict SDK
4
+ * success to completion, and dispose to whole-tree quiescence.
5
+ *
6
+ * @module @deepseek-ai/dsh-subagent-claude-code/run
7
+ */
8
+ import { type Options, type Query, type SDKMessage, type SDKResultMessage } from '@anthropic-ai/claude-agent-sdk';
9
+ import type { ContentBlock } from '@deepseek-ai/dsh-llm';
10
+ import { type SubagentResult, type SubagentRun, type SubagentStartRequest, type SubagentStopReason } from '@deepseek-ai/dsh-subagent';
11
+ import { type SubprocessHandle, type SubprocessSpawnSpec } from '@deepseek-ai/dsh-subprocess';
12
+ /** Default POSIX grace between subprocess termination tiers. */
13
+ export declare const DEFAULT_DISPOSE_GRACE_MS = 3000;
14
+ /** Fully resolved inputs for one official Claude Agent SDK query. */
15
+ export interface ClaudeCodeRunSpec {
16
+ /** Parent Session workspace supplied to the SDK and real CLI. */
17
+ readonly cwd: string;
18
+ /** Exact native Claude Code executable resolved from the host PATH. */
19
+ readonly executable: string;
20
+ /** Explicit deployment/test environment layered after shared scrubbing. */
21
+ readonly env: Record<string, string>;
22
+ /** Subprocess termination grace passed to the shared process-tree owner. */
23
+ readonly disposeGraceMs: number;
24
+ /** Shared subprocess service spawn operation. */
25
+ readonly spawn: (spec: SubprocessSpawnSpec) => SubprocessHandle;
26
+ /** Diagnostic sink for a post-publication error flattened into a result. */
27
+ readonly onError?: (error: Error, stopReason: SubagentStopReason) => void;
28
+ }
29
+ /**
30
+ * Validate and preserve the one-shot task before crossing the SDK boundary.
31
+ * @param prompt - task content accepted from the shared subagent service.
32
+ * @returns the exact text sequence as one SDK prompt.
33
+ */
34
+ export declare function textTask(prompt: readonly ContentBlock[]): string;
35
+ /**
36
+ * Strictly derive the only SDK result that can complete a shared run.
37
+ * @param message - an official discriminated result union.
38
+ * @returns exact final text for a successful, non-error result.
39
+ */
40
+ export declare function successfulResult(message: SDKResultMessage): string;
41
+ /**
42
+ * Consume the complete SDK stream and require one strict success plus normal
43
+ * iterator completion.
44
+ * @param query - published official SDK query.
45
+ * @returns the completed shared result.
46
+ */
47
+ export declare function consumeClaudeQuery(query: AsyncIterable<SDKMessage>): Promise<SubagentResult>;
48
+ /**
49
+ * Close the official query, terminate the managed process tree, and wait for
50
+ * the subprocess owner to prove it is gone.
51
+ * @param query - official SDK query, when creation reached that point.
52
+ * @param child - shared-service handle that owns the CLI process tree.
53
+ */
54
+ export declare function disposeClaudeCodeChild(query: Pick<Query, 'close'> | undefined, child: SubprocessHandle): Promise<void>;
55
+ /**
56
+ * Build the fixed official SDK options for one one-shot provider run.
57
+ * @param spec - Workspace, environment, process service, and disposal policy.
58
+ * @param controller - per-run cancellation owner.
59
+ * @param capture - receives the real managed child synchronously from the SDK hook.
60
+ * @returns options that inherit native settings while disabling persistence and user questions.
61
+ */
62
+ export declare function claudeQueryOptions(spec: ClaudeCodeRunSpec, controller: AbortController, capture: (child: SubprocessHandle) => void): Options;
63
+ /**
64
+ * Start one official Claude Agent SDK query and publish its one-shot run.
65
+ * @param request - resolved shared subagent request.
66
+ * @param spec - Workspace, environment, process service, and diagnostic policy.
67
+ * @returns the published run after both Query and real CLI handle exist.
68
+ */
69
+ export declare function startClaudeCodeRun(request: SubagentStartRequest, spec: ClaudeCodeRunSpec): Promise<SubagentRun>;
70
+ //# sourceMappingURL=run.d.ts.map
package/package.json ADDED
@@ -0,0 +1,60 @@
1
+ {
2
+ "name": "@deepseek-ai/dsh-subagent-claude-code",
3
+ "description": "One-shot Claude Code subagent provider over the official Agent SDK",
4
+ "version": "0.0.1-rc.1",
5
+ "publishConfig": {
6
+ "access": "restricted"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
11
+ "directory": "packages/subagent/subagent-claude-code"
12
+ },
13
+ "type": "module",
14
+ "main": "lib/index.js",
15
+ "types": "lib/types/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./lib/types/index.d.ts",
19
+ "default": "./lib/index.js"
20
+ },
21
+ "./invariant": {
22
+ "types": "./lib/types/invariant.d.ts",
23
+ "default": "./lib/invariant.js"
24
+ },
25
+ "./src/*": "./src/*",
26
+ "./package.json": "./package.json"
27
+ },
28
+ "files": [
29
+ "lib/index.js",
30
+ "lib/invariant.js",
31
+ "lib/types/**/*.d.ts"
32
+ ],
33
+ "license": "BSD-3-Clause",
34
+ "peerDependencies": {
35
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
36
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
37
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.1",
38
+ "@deepseek-ai/dsh-subagent": "^0.0.1-rc.1",
39
+ "@deepseek-ai/dsh-subprocess": "^0.0.1-rc.1",
40
+ "@deepseek-ai/dsh-timeout": "^0.0.1-rc.1",
41
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
42
+ },
43
+ "dependencies": {
44
+ "@anthropic-ai/sdk": "0.93.0",
45
+ "@anthropic-ai/claude-agent-sdk": "0.3.220",
46
+ "@deepseek-ai/schemastery": "^3.18.1-rc.1"
47
+ },
48
+ "devDependencies": {
49
+ "@deepseek-ai/dsh-agent": "^0.0.1-rc.1",
50
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.1",
51
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.1",
52
+ "@deepseek-ai/dsh-loader-smoke": "^0.0.1-rc.1",
53
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.1",
54
+ "@deepseek-ai/dsh-subagent": "^0.0.1-rc.1",
55
+ "@deepseek-ai/dsh-subprocess": "^0.0.1-rc.1",
56
+ "@deepseek-ai/dsh-subprocess-local": "^0.0.1-rc.1",
57
+ "@deepseek-ai/dsh-timeout": "^0.0.1-rc.1",
58
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
59
+ }
60
+ }