dsh-subagent-kimi 0.0.0-stage → 0.1.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,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 DeepSeek
4
+ Copyright (c) 2026 Saviio
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,130 @@
1
- # Temporary Holding Version
1
+ # dsh-subagent-kimi
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ English | [中文](README.zh.md)
4
+
5
+ A one-shot [Kimi Code CLI](https://www.kimi.com/code/docs/en/) subagent provider for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), using the Agent Client Protocol (ACP).
6
+
7
+ Each delegation starts a fresh Kimi process and ACP session in the selected workspace. The parent supplies one self-contained text task and receives the assistant text or a safe terminal diagnostic. Reasoning, tool traffic, and raw protocol messages stay out of the parent conversation.
8
+
9
+ ## Requirements
10
+
11
+ - Node.js 24.9.0 or later.
12
+ - DeepSeek Harness `>=0.2.1-rc.2 <0.3.0`; both `0.2.1-rc.2` and `0.2.1-rc.3` are verified.
13
+ - Kimi Code CLI available as `kimi` on `PATH`, with authentication and provider settings configured through Kimi. Version 2.3.1 is the verified baseline; using the current release is recommended.
14
+
15
+ Install or upgrade Kimi, then check its version and authentication:
16
+
17
+ ```sh
18
+ npm install -g @moonshot-ai/kimi-code@latest
19
+ kimi --version
20
+ kimi login
21
+ ```
22
+
23
+ The provider resolves `kimi` through the subprocess service's `PATH` lookup on every delegation; it does not bundle a Kimi runtime. Native Kimi configuration and authentication remain authoritative under `KIMI_CODE_HOME` or `~/.kimi-code`.
24
+
25
+ ## Install
26
+
27
+ Install the bundle into a DeepSeek Harness profile, replacing `<name>` with `web`, `headless`, `sdk`, `acp`, or your custom profile name:
28
+
29
+ ```sh
30
+ dsh plugin --profile <name> add dsh-subagent-kimi
31
+ ```
32
+
33
+ The CLI uses `pnpm` for profile package operations, so `pnpm` must be available on `PATH`. Restart DSH if it reports that a restart is required. In Web or Desktop, you can instead open **Plugins → Add plugin**, enter `dsh-subagent-kimi`, and install and enable the bundle there.
34
+
35
+ For a custom Node composition, `npm install dsh-subagent-kimi` installs only the JavaScript dependency; it does not install or enable the bundle in a DSH profile. Mount the provider and tool as shown below, or include the bundle in your own composition.
36
+
37
+ The bundle metadata loads `cordis.patch.yml`, registers the `kimi` provider, and exposes `subagent_kimi` as a global Harness tool. Loading the bundle does not start Kimi; a process is created only for an actual delegation.
38
+
39
+ To mount the provider and tool manually, use:
40
+
41
+ ```yaml
42
+ - insert:
43
+ - id: subagent-kimi
44
+ name: 'dsh-subagent-kimi'
45
+ - id: tool-subagent-kimi
46
+ name: '@deepseek-ai/dsh-tool-subagent'
47
+ config:
48
+ provider: kimi
49
+ toolName: subagent_kimi
50
+ maxDepth: provider-managed
51
+ ```
52
+
53
+ ## Configuration
54
+
55
+ ```yaml
56
+ - id: subagent-kimi
57
+ name: 'dsh-subagent-kimi'
58
+ config:
59
+ providerName: kimi
60
+ model: kimi-code/kimi-for-coding # optional
61
+ permissionMode: reject
62
+ env: {}
63
+ disposeEofGraceMs: 6000
64
+ disposeGraceMs: 3000
65
+ ```
66
+
67
+ | Field | Default | Meaning |
68
+ | --- | --- | --- |
69
+ | `providerName` | `kimi` | Non-empty registry name on `ctx.subagents`; each mounted instance needs a unique name. |
70
+ | `model` | Kimi native settings | Optional model alias set through ACP `session/set_config_option` after session creation. No alias discovery or rewriting is performed. |
71
+ | `env` | `{}` | Explicit child environment layered over the subprocess service's credential-scrubbed parent environment. |
72
+ | `permissionMode` | `reject` | ACP session mode and unattended permission behavior; see below. |
73
+ | `disposeEofGraceMs` | `6000` | Time in milliseconds allowed for cooperative shutdown after stdin EOF before termination escalation. |
74
+ | `disposeGraceMs` | `3000` | Process-observation and managed termination grace in milliseconds. Both grace values must be positive, finite, and within Node's timer limit. |
75
+
76
+ Credential-shaped ambient variables are scrubbed by the Harness subprocess service. Values explicitly present in `env` are forwarded, including credential-shaped values, so do not commit API keys to profile files.
77
+
78
+ ### Permission modes
79
+
80
+ | Value | ACP session mode | ACP permission requests |
81
+ | --- | --- | --- |
82
+ | `reject` | `default`; manual approvals | Cancel every request |
83
+ | `yolo` | `yolo`; routine edits and commands run under Kimi's native yolo policy | Cancel remaining requests, including risky actions and questions |
84
+ | `auto` | `auto`; Kimi's native automatic policy | Select the first `allow_once` or `allow_always` option if a request still arrives |
85
+
86
+ No mode creates a human interaction channel in the parent Harness session. `auto` can modify files and execute commands without human approval; use it only in trusted, appropriately isolated workspaces.
87
+
88
+ **`reject` is not a sandbox or a read-only guarantee.** It denies requests that Kimi sends over ACP, but operations Kimi permits without making an ACP request can still proceed. Use operating-system or Harness workspace isolation when side effects must be constrained.
89
+
90
+ ## Behavior
91
+
92
+ - The provider accepts only a non-empty sequence of text blocks. Images and other content types are rejected before a process starts.
93
+ - Every run starts a fresh `kimi acp` executable resolved from `PATH` and a new ACP session. There is no process pooling, follow-up input, or resume. Using Kimi's own executable rather than the DSH Electron binary also prevents macOS from registering another DSH/Electron app in the Dock.
94
+ - Startup completes ACP `initialize`, `session/new`, `session/set_mode`, and optional `session/set_config_option` before publishing the run. Configuration failures use the `configure-session` stage and clean up the private process before rejecting.
95
+ - `session/prompt` executes exactly one task. Streamed `agent_message_chunk` text is collected; thoughts, plans, tool calls, and other updates are consumed but not returned.
96
+ - ACP stop reasons map to Harness `completed`, `max-tokens`, `refusal`, `aborted`, or `error`. Unknown reasons and a successful stop with no assistant text are treated as errors.
97
+ - Cancellation sends best-effort `session/cancel`, settles locally without waiting for a cooperative child, and remains backed by process teardown.
98
+ - Disposal closes stdin, waits for cooperative EOF shutdown, then escalates through the shared managed subprocess owner and waits for process-range quiescence.
99
+ - Failures expose only fixed product/stage/category facts and optional stop reason, exit code, and signal. Raw stderr, exception text, task content, environment values, paths, and protocol payloads are not copied into model-visible diagnostics. Internal Host logging retains the original error where available.
100
+
101
+ The provider advertises no optional start capabilities and does not inherit the parent conversation. Requests requiring `agentPreset`, `agentOptions`, structured output, or Harness-enforced depth limits are rejected by the shared subagent service.
102
+
103
+ ## Limitations
104
+
105
+ - Kimi ACP sessions are native Kimi sessions and may remain in Kimi's local session history after the one-shot run. This provider does not mark them ephemeral or delete them.
106
+ - The package does not create an account, log in, select a provider, or repair Kimi configuration. Authentication failures remain Kimi startup/prompt failures with safe diagnostics.
107
+ - One run is one text-only task. There is no continuation, resume, progress stream, or parent-context inheritance.
108
+ - There is no built-in wall-clock timeout and no rollback of files or external systems changed before cancellation.
109
+ - Native Kimi settings, hooks, skills, and account state can affect the child. Use an explicit isolated `KIMI_CODE_HOME` in `env` when deployment policy requires a separate Kimi home, and configure authentication there separately.
110
+ - The user owns Kimi installation and upgrades. The `PATH` visible to DSH must resolve to a compatible Kimi CLI. Version 2.3.1 is verified; older versions are not blocked explicitly, but must support the ACP methods used by this provider.
111
+ - Compatibility is based on Kimi Code CLI 2.3.1, ACP SDK 1.4.0, and DeepSeek Harness `>=0.2.1-rc.2 <0.3.0`. Both DSH `0.2.1-rc.2` and `0.2.1-rc.3` are verified. Upgrade Kimi or DSH beyond these baselines only after rerunning protocol and real-product verification.
112
+
113
+ ## Development
114
+
115
+ ```sh
116
+ npm install
117
+ npm run clean
118
+ npm run typecheck
119
+ npm run build
120
+ npm pack --dry-run
121
+ ```
122
+
123
+ The implementation follows DeepSeek Harness's Codex product-provider structure and adapts its ACP subprocess lifecycle for Kimi Code CLI. Upstream references:
124
+
125
+ - [`subagent-codex`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent-codex)
126
+ - [`subagent-acp`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent-acp)
127
+ - [Kimi `acp` reference](https://www.kimi.com/code/docs/en/kimi-code-cli/reference/kimi-acp.html)
128
+ - [Kimi command reference](https://www.kimi.com/code/docs/en/kimi-code-cli/reference/kimi-command.html)
129
+
130
+ Released under MIT; see [LICENSE](LICENSE).
package/README.zh.md ADDED
@@ -0,0 +1,130 @@
1
+ # dsh-subagent-kimi
2
+
3
+ [English](README.md) | 中文
4
+
5
+ 面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的一次性 [Kimi Code CLI](https://www.kimi.com/code/docs/en/) 子智能体插件,通过 Agent Client Protocol(ACP)驱动真实 Kimi 进程。
6
+
7
+ 每次委派都会在指定工作目录中启动独立的 Kimi 进程和 ACP 会话。父会话传入一个自包含的文本任务,并接收助手回答或安全的终止诊断;推理过程、工具流量和原始协议消息不会进入父会话。
8
+
9
+ ## 环境要求
10
+
11
+ - Node.js 24.9.0 或更高版本。
12
+ - DeepSeek Harness `>=0.2.1-rc.2 <0.3.0`,已验证 `0.2.1-rc.2` 和 `0.2.1-rc.3`。
13
+ - 可通过 `PATH` 找到 Kimi Code CLI(`kimi`),并已在 Kimi 中配置认证和模型提供商。已验证版本为 2.3.1,建议使用当前发布版。
14
+
15
+ 安装或升级 Kimi,然后检查版本和认证:
16
+
17
+ ```sh
18
+ npm install -g @moonshot-ai/kimi-code@latest
19
+ kimi --version
20
+ kimi login
21
+ ```
22
+
23
+ Provider 每次委派都通过 subprocess 服务的 `PATH` 查找启动 `kimi`,插件本身不携带 Kimi 运行时。Kimi 原生配置和认证仍以 `KIMI_CODE_HOME` 或 `~/.kimi-code` 为准。
24
+
25
+ ## 安装
26
+
27
+ 将 Bundle 安装进 DeepSeek Harness Profile,`<name>` 替换为 `web`、`headless`、`sdk`、`acp` 或自定义 Profile 名称:
28
+
29
+ ```sh
30
+ dsh plugin --profile <name> add dsh-subagent-kimi
31
+ ```
32
+
33
+ 该命令通过 `pnpm` 管理 Profile 依赖,因此需要确保 `pnpm` 在 `PATH` 中。如果 DSH 提示需要重启,请重启后使用。在 Web 或 Desktop 中,也可以打开 **Plugins → 添加插件**,输入 `dsh-subagent-kimi`,然后安装并启用该 Bundle。
34
+
35
+ 对于自定义 Node 组合,`npm install dsh-subagent-kimi` 只安装 JavaScript 依赖,不等同于在 DSH Profile 中安装并启用插件。此时需要按下面的示例挂载 provider 和工具,或将 Bundle 纳入自己的组合。
36
+
37
+ Bundle 元数据会加载 `cordis.patch.yml`、注册 `kimi` provider,并将 `subagent_kimi` 添加为 Harness 全局工具。仅加载 Bundle 不会启动 Kimi;只有实际发生委派时才创建进程。
38
+
39
+ 如需手工挂载 provider 和工具:
40
+
41
+ ```yaml
42
+ - insert:
43
+ - id: subagent-kimi
44
+ name: 'dsh-subagent-kimi'
45
+ - id: tool-subagent-kimi
46
+ name: '@deepseek-ai/dsh-tool-subagent'
47
+ config:
48
+ provider: kimi
49
+ toolName: subagent_kimi
50
+ maxDepth: provider-managed
51
+ ```
52
+
53
+ ## 配置
54
+
55
+ ```yaml
56
+ - id: subagent-kimi
57
+ name: 'dsh-subagent-kimi'
58
+ config:
59
+ providerName: kimi
60
+ model: kimi-code/kimi-for-coding # 可选
61
+ permissionMode: reject
62
+ env: {}
63
+ disposeEofGraceMs: 6000
64
+ disposeGraceMs: 3000
65
+ ```
66
+
67
+ | 字段 | 默认值 | 含义 |
68
+ | --- | --- | --- |
69
+ | `providerName` | `kimi` | 在 `ctx.subagents` 中注册的非空名称;每个挂载实例必须使用不同名称。 |
70
+ | `model` | Kimi 原生设置 | 可选模型别名,在会话创建后通过 ACP `session/set_config_option` 设置,不发现或改写别名。 |
71
+ | `env` | `{}` | 显式子进程环境,叠加在 subprocess 服务清除凭据后的父环境之上。 |
72
+ | `permissionMode` | `reject` | ACP 会话模式和无人值守权限处理方式,见下表。 |
73
+ | `disposeEofGraceMs` | `6000` | stdin EOF 后等待协作式退出的毫秒数,超时才升级终止。 |
74
+ | `disposeGraceMs` | `3000` | 进程状态观察和托管终止的毫秒宽限期。两个值都必须为有限正数,且不能超过 Node 计时器上限。 |
75
+
76
+ Harness subprocess 服务会清除父环境中形似凭据的变量;`env` 中显式配置的值仍会转发,包括凭据类值。因此不要将 API key 提交到 Profile 文件。
77
+
78
+ ### 权限模式
79
+
80
+ | 值 | ACP 会话模式 | ACP 权限请求 |
81
+ | --- | --- | --- |
82
+ | `reject` | `default`,人工批准模式 | 取消所有请求 |
83
+ | `yolo` | `yolo`,常规编辑和命令按 Kimi 原生 yolo 策略执行 | 取消剩余请求,包括高风险操作和提问 |
84
+ | `auto` | `auto`,Kimi 原生自动策略 | 如果仍收到请求,选择首个 `allow_once` 或 `allow_always` 选项 |
85
+
86
+ 所有模式都不会在父 Harness 会话中建立人工交互通道。`auto` 可以在无人批准的情况下修改文件和执行命令,只应在可信且适当隔离的工作目录中使用。
87
+
88
+ **`reject` 不是沙箱,也不是只读保证。** 它只拒绝 Kimi 通过 ACP 发出的请求;Kimi 不发起 ACP 请求就直接允许的操作仍可能执行。需要限制副作用时,请使用操作系统或 Harness 工作区隔离。
89
+
90
+ ## 行为与结果
91
+
92
+ - 仅接受非空文本块序列;图片等内容类型会在启动进程前被拒绝。
93
+ - 每次运行都通过 `PATH` 启动独立的 `kimi acp` 可执行文件和 ACP 会话,不复用进程,不支持追加输入或恢复会话。使用 Kimi 自己的可执行文件而不是 DSH 的 Electron 二进制,也避免了 macOS 在 Dock 中再注册一个 DSH/Electron 应用。
94
+ - 启动时完成 ACP `initialize`、`session/new`、`session/set_mode` 和可选的 `session/set_config_option`,成功后才发布 run;配置失败使用 `configure-session` 阶段,并先清理尚未发布的私有进程。
95
+ - `session/prompt` 只执行一次任务。收集流式 `agent_message_chunk` 文本;思考、计划、工具调用等更新会被消费但不作为结果返回。
96
+ - ACP 停止原因映射为 Harness 的 `completed`、`max-tokens`、`refusal`、`aborted` 或 `error`。未知原因,以及声称成功却没有任何助手文本的情况,均按错误处理。
97
+ - 取消会尽力发送 `session/cancel`,在本地及时结算,并最终由进程清理兜底。
98
+ - 清理时先关闭 stdin 并等待 EOF 协作退出,再通过共享 subprocess 所有者分级终止,并等待整个进程范围静止。
99
+ - 失败诊断只包含固定的产品、阶段、类别,以及可选的停止原因、退出码和信号。原始 stderr、异常文本、任务内容、环境值、路径和协议负载不会复制到模型可见诊断中;Host 内部日志会保留可用的原始错误。
100
+
101
+ Provider 不继承父对话,也不声明任何可选 start capabilities。需要 `agentPreset`、`agentOptions`、结构化输出或 Harness 深度限制的请求会由共享 subagent 服务拒绝。
102
+
103
+ ## 限制
104
+
105
+ - Kimi ACP 会话是原生 Kimi 会话,一次性任务结束后可能仍保留在本地历史中。本插件不会将其标记为临时会话,也不会自动删除。
106
+ - 插件不会创建账号、登录、选择模型提供商或修复 Kimi 配置。认证问题会以安全的启动或 prompt 失败诊断呈现。
107
+ - 每次运行仅处理一个文本任务,不支持续聊、恢复、进度流或父上下文继承。
108
+ - 没有内置墙钟超时,也不会回滚取消前已经发生的文件或外部系统副作用。
109
+ - Kimi 原生设置、hooks、skills 和账号状态会影响子进程。部署策略需要独立 Kimi home 时,可在 `env` 中显式设置 `KIMI_CODE_HOME`,并在该 home 中单独配置认证。
110
+ - 用户负责 Kimi 的安装和升级。DSH 可见的 `PATH` 必须解析到兼容的 Kimi CLI。已验证版本为 2.3.1;旧版本不会被显式拒绝,但必须支持本插件使用的 ACP 方法。
111
+ - 兼容基线为 Kimi Code CLI 2.3.1、ACP SDK 1.4.0 和 DeepSeek Harness `>=0.2.1-rc.2 <0.3.0`,已验证 DSH `0.2.1-rc.2` 和 `0.2.1-rc.3`。超出这些基线升级 Kimi 或 DSH 后,应重新完成协议和真实产品验证。
112
+
113
+ ## 开发
114
+
115
+ ```sh
116
+ npm install
117
+ npm run clean
118
+ npm run typecheck
119
+ npm run build
120
+ npm pack --dry-run
121
+ ```
122
+
123
+ 实现参考 DeepSeek Harness 的 Codex 产品 provider 结构,并针对 Kimi Code CLI 调整其 ACP 子进程生命周期。上游资料:
124
+
125
+ - [`subagent-codex`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent-codex)
126
+ - [`subagent-acp`](https://github.com/deepseek-ai/deepseek-harness/tree/master/packages/subagent/subagent-acp)
127
+ - [Kimi `acp` 文档](https://www.kimi.com/code/docs/en/kimi-code-cli/reference/kimi-acp.html)
128
+ - [Kimi 命令文档](https://www.kimi.com/code/docs/en/kimi-code-cli/reference/kimi-command.html)
129
+
130
+ 基于 MIT 发布,详见 [LICENSE](LICENSE)。
@@ -0,0 +1,9 @@
1
+ - insert:
2
+ - id: subagent-kimi
3
+ name: 'dsh-subagent-kimi'
4
+ - id: tool-subagent-kimi
5
+ name: '@deepseek-ai/dsh-tool-subagent'
6
+ config:
7
+ provider: kimi
8
+ toolName: subagent_kimi
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="15" y="15" width="12" height="12" rx="3" fill="url(#kimi_a)" fill-opacity="0.85"/><rect x="9" y="9" width="12" height="12" rx="3" fill="url(#kimi_b)" fill-opacity="0.85"/><defs><linearGradient id="kimi_a" x1="21" y1="15" x2="21" y2="27" gradientUnits="userSpaceOnUse"><stop stop-color="#8B7CFF"/><stop offset="1" stop-color="#4D3FD1"/></linearGradient><linearGradient id="kimi_b" x1="15" y1="9" x2="15" y2="21" gradientUnits="userSpaceOnUse"><stop stop-color="#69E4FF"/><stop offset="1" stop-color="#1677FF"/></linearGradient></defs></svg>
package/lib/index.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ import type { Context } from '@deepseek-ai/cordis';
2
+ import z from '@deepseek-ai/schemastery';
3
+ import { type KimiPermissionMode } from './run.ts';
4
+ export declare const name = "subagent-kimi";
5
+ export declare const inject: string[];
6
+ export interface Config {
7
+ /** Provider name on `ctx.subagents` (default `kimi`). */
8
+ providerName?: string;
9
+ /** Kimi model alias fixed for this provider; omitted to inherit Kimi settings. */
10
+ model?: string;
11
+ /** Explicit environment entries layered over the scrubbed parent environment. */
12
+ env?: Record<string, string>;
13
+ /** ACP session mode and unattended permission behavior. */
14
+ permissionMode?: KimiPermissionMode;
15
+ /** Grace in milliseconds for cooperative EOF shutdown before termination. */
16
+ disposeEofGraceMs?: number;
17
+ /** Grace in milliseconds between managed subprocess termination tiers. */
18
+ disposeGraceMs?: number;
19
+ }
20
+ export declare const Config: z<Config>;
21
+ export declare function apply(ctx: Context, config: Config): void;
22
+ //# sourceMappingURL=index.d.ts.map
package/lib/index.js ADDED
@@ -0,0 +1,76 @@
1
+ import z from '@deepseek-ai/schemastery';
2
+ import { MAX_TIMER_DELAY_MS } from '@deepseek-ai/dsh-timeout';
3
+ import { assertPositiveFinite, assertUsableCwd, NO_START_CAPABILITIES, } from '@deepseek-ai/dsh-subagent';
4
+ import { DEFAULT_DISPOSE_EOF_GRACE_MS, DEFAULT_DISPOSE_GRACE_MS, DEFAULT_KIMI_PERMISSION_MODE, KIMI_PERMISSION_MODES, kimiConfigurationFailure, startKimiRun, } from "./run.js";
5
+ export const name = 'subagent-kimi';
6
+ export const inject = ['subagents', 'subprocess'];
7
+ const DEFAULT_PROVIDER_NAME = 'kimi';
8
+ export const Config = z.object({
9
+ providerName: z.string().min(1).default(DEFAULT_PROVIDER_NAME),
10
+ model: z.string().min(1),
11
+ env: z.dict(z.string()).default({}),
12
+ permissionMode: z.union([...KIMI_PERMISSION_MODES])
13
+ .default(DEFAULT_KIMI_PERMISSION_MODE),
14
+ disposeEofGraceMs: z.number().default(DEFAULT_DISPOSE_EOF_GRACE_MS),
15
+ disposeGraceMs: z.number().default(DEFAULT_DISPOSE_GRACE_MS),
16
+ });
17
+ class KimiProvider {
18
+ name;
19
+ ctx;
20
+ config;
21
+ capabilities = NO_START_CAPABILITIES;
22
+ inheritsParentContext = false;
23
+ constructor(name, ctx, config) {
24
+ this.name = name;
25
+ this.ctx = ctx;
26
+ this.config = config;
27
+ }
28
+ start(request) {
29
+ let cwd;
30
+ try {
31
+ cwd = assertUsableCwd('subagent-kimi', 'child cwd', request.cwd);
32
+ }
33
+ catch (error) {
34
+ if (request.signal.aborted) {
35
+ throw new Error('subagent-kimi: request was aborted before ACP startup');
36
+ }
37
+ const failure = kimiConfigurationFailure(error);
38
+ this.ctx.logger.warn(`subagent-kimi "${this.name}": child start failed: %o`, failure);
39
+ throw failure;
40
+ }
41
+ const spec = {
42
+ cwd,
43
+ ...this.config.model === undefined ? {} : { model: this.config.model },
44
+ permissionMode: this.config.permissionMode,
45
+ env: this.config.env,
46
+ disposeEofGraceMs: this.config.disposeEofGraceMs,
47
+ disposeGraceMs: this.config.disposeGraceMs,
48
+ spawn: spawnSpec => this.ctx.subprocess.spawn(spawnSpec),
49
+ onError: (error, stopReason) => {
50
+ this.ctx.logger.warn(`subagent-kimi "${this.name}": child run failed (${stopReason}): %o`, error);
51
+ },
52
+ };
53
+ return startKimiRun(request, spec);
54
+ }
55
+ }
56
+ export function apply(ctx, config) {
57
+ const resolved = {
58
+ providerName: config.providerName ?? DEFAULT_PROVIDER_NAME,
59
+ ...config.model === undefined ? {} : { model: config.model },
60
+ env: config.env ?? {},
61
+ permissionMode: config.permissionMode ?? DEFAULT_KIMI_PERMISSION_MODE,
62
+ disposeEofGraceMs: config.disposeEofGraceMs ?? DEFAULT_DISPOSE_EOF_GRACE_MS,
63
+ disposeGraceMs: config.disposeGraceMs ?? DEFAULT_DISPOSE_GRACE_MS,
64
+ };
65
+ for (const [field, value] of [
66
+ ['disposeEofGraceMs', resolved.disposeEofGraceMs],
67
+ ['disposeGraceMs', resolved.disposeGraceMs],
68
+ ]) {
69
+ assertPositiveFinite('subagent-kimi', field, value);
70
+ if (value > MAX_TIMER_DELAY_MS) {
71
+ throw new Error(`subagent-kimi: ${field} must be no greater than ${MAX_TIMER_DELAY_MS}`);
72
+ }
73
+ }
74
+ ctx.subagents.registerProvider(new KimiProvider(resolved.providerName, ctx, resolved));
75
+ }
76
+ //# sourceMappingURL=index.js.map
package/lib/run.d.ts ADDED
@@ -0,0 +1,27 @@
1
+ import { type ContentBlock as AcpContentBlock, type StopReason } from '@agentclientprotocol/sdk';
2
+ import type { ContentBlock } from '@deepseek-ai/dsh-llm';
3
+ import { type SubagentRun, type SubagentStartRequest, type SubagentStopReason } from '@deepseek-ai/dsh-subagent';
4
+ import type { SubprocessHandle, SubprocessSpawnSpec } from '@deepseek-ai/dsh-subprocess';
5
+ export type KimiPermissionMode = 'reject' | 'yolo' | 'auto';
6
+ export declare const KIMI_PERMISSION_MODES: readonly ["reject", "yolo", "auto"];
7
+ export declare const DEFAULT_KIMI_PERMISSION_MODE: KimiPermissionMode;
8
+ export declare const DEFAULT_DISPOSE_EOF_GRACE_MS = 6000;
9
+ export declare const DEFAULT_DISPOSE_GRACE_MS = 3000;
10
+ export interface KimiRunSpec {
11
+ readonly cwd: string;
12
+ readonly model?: string;
13
+ readonly permissionMode: KimiPermissionMode;
14
+ readonly env: Record<string, string>;
15
+ readonly disposeEofGraceMs: number;
16
+ readonly disposeGraceMs: number;
17
+ readonly spawn: (spec: SubprocessSpawnSpec) => SubprocessHandle;
18
+ readonly onError?: (error: Error, stopReason: SubagentStopReason) => void;
19
+ }
20
+ export declare function kimiConfigurationFailure(cause: unknown): Error;
21
+ export declare function kimiAcpArgv(): string[];
22
+ export declare function kimiTextTask(prompt: readonly ContentBlock[]): string[];
23
+ export declare function disposeKimiChild(child: SubprocessHandle, eofGraceMs: number): Promise<void>;
24
+ export declare function kimiStopReason(reason: StopReason): SubagentStopReason;
25
+ export declare function kimiContentText(content: AcpContentBlock): string;
26
+ export declare function startKimiRun(request: SubagentStartRequest, spec: KimiRunSpec): Promise<SubagentRun>;
27
+ //# sourceMappingURL=run.d.ts.map
package/lib/run.js ADDED
@@ -0,0 +1,445 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import { Readable as NodeReadable, Writable as NodeWritable } from 'node:stream';
3
+ import { client as createAcpClientApp, methods, ndJsonStream, PROTOCOL_VERSION, } from '@agentclientprotocol/sdk';
4
+ import { brandString } from '@deepseek-ai/dsh-brand';
5
+ import { AssistantOutputFold, settleRunResult, subprocessRunHandle, } from '@deepseek-ai/dsh-subagent';
6
+ export const KIMI_PERMISSION_MODES = [
7
+ 'reject',
8
+ 'yolo',
9
+ 'auto',
10
+ ];
11
+ export const DEFAULT_KIMI_PERMISSION_MODE = 'reject';
12
+ export const DEFAULT_DISPOSE_EOF_GRACE_MS = 6_000;
13
+ export const DEFAULT_DISPOSE_GRACE_MS = 3_000;
14
+ const ACP_TOOL_KINDS = new Set([
15
+ 'read', 'edit', 'delete', 'move', 'search',
16
+ 'execute', 'think', 'fetch', 'switch_mode', 'other',
17
+ ]);
18
+ function failureDiagnostic(facts) {
19
+ const fields = [
20
+ 'product: Kimi Code CLI',
21
+ `stage: ${facts.stage}`,
22
+ `category: ${facts.category}`,
23
+ ];
24
+ if (facts.stopReason !== undefined) {
25
+ fields.push(`stop reason: ${facts.stopReason}`);
26
+ }
27
+ if (facts.outcome?.exitCode !== null && facts.outcome?.exitCode !== undefined) {
28
+ fields.push(`exit code: ${facts.outcome.exitCode}`);
29
+ }
30
+ if (facts.outcome?.signal !== null && facts.outcome?.signal !== undefined) {
31
+ fields.push(`signal: ${facts.outcome.signal}`);
32
+ }
33
+ return `Product subagent failure (${fields.join('; ')})`;
34
+ }
35
+ function permissionDiagnostic(permission) {
36
+ return `Kimi unattended decision (mode: ${permission.mode}; request: ${permission.request}; decision: ${permission.decision})`;
37
+ }
38
+ function diagnosticText(facts, permission) {
39
+ const failure = failureDiagnostic(facts);
40
+ return permission === undefined
41
+ ? failure
42
+ : `${failure}\n${permissionDiagnostic(permission)}`;
43
+ }
44
+ class KimiRunFailure extends Error {
45
+ constructor(facts, cause) {
46
+ super(`subagent-kimi: ${failureDiagnostic(facts)}`, cause === undefined ? undefined : { cause });
47
+ this.name = 'KimiRunFailure';
48
+ }
49
+ }
50
+ export function kimiConfigurationFailure(cause) {
51
+ return new KimiRunFailure({
52
+ stage: 'initialize',
53
+ category: 'configuration',
54
+ }, cause);
55
+ }
56
+ export function kimiAcpArgv() {
57
+ return ['kimi', 'acp'];
58
+ }
59
+ export function kimiTextTask(prompt) {
60
+ if (prompt.length === 0) {
61
+ throw new Error('subagent-kimi: the one-shot task must contain only text blocks');
62
+ }
63
+ const texts = [];
64
+ for (const block of prompt) {
65
+ if (block.type !== 'text') {
66
+ throw new Error('subagent-kimi: the one-shot task must contain only text blocks');
67
+ }
68
+ texts.push(block.text);
69
+ }
70
+ if (texts.every(text => text.trim().length === 0)) {
71
+ throw new Error('subagent-kimi: the one-shot task must not be empty');
72
+ }
73
+ return texts;
74
+ }
75
+ function toError(value) {
76
+ return value instanceof Error ? value : new Error(String(value));
77
+ }
78
+ function reportFailure(spec, error) {
79
+ try {
80
+ spec.onError?.(toError(error), 'error');
81
+ }
82
+ catch {
83
+ // Logging must not replace the child failure.
84
+ }
85
+ }
86
+ function permissionRequestKind(kind) {
87
+ const candidate = kind ?? 'unknown';
88
+ return ACP_TOOL_KINDS.has(candidate) ? candidate : 'unknown';
89
+ }
90
+ async function rangeExitsWithin(child, ms) {
91
+ const controller = new AbortController();
92
+ const timer = setTimeout(() => { controller.abort(); }, ms);
93
+ try {
94
+ return await child.waitForExit(controller.signal);
95
+ }
96
+ finally {
97
+ clearTimeout(timer);
98
+ }
99
+ }
100
+ export async function disposeKimiChild(child, eofGraceMs) {
101
+ const failures = [];
102
+ child.stdin?.end();
103
+ let exited = false;
104
+ try {
105
+ exited = await rangeExitsWithin(child, eofGraceMs);
106
+ }
107
+ catch (error) {
108
+ failures.push(toError(error));
109
+ }
110
+ if (exited)
111
+ return;
112
+ child.terminate();
113
+ try {
114
+ await child.waitForExit();
115
+ }
116
+ catch (error) {
117
+ failures.push(toError(error));
118
+ }
119
+ if (failures.length === 1)
120
+ throw failures[0];
121
+ if (failures.length > 1) {
122
+ throw new AggregateError(failures, 'Kimi subprocess teardown failed');
123
+ }
124
+ }
125
+ export function kimiStopReason(reason) {
126
+ switch (reason) {
127
+ case 'end_turn':
128
+ return 'completed';
129
+ case 'max_tokens':
130
+ return 'max-tokens';
131
+ case 'refusal':
132
+ return 'refusal';
133
+ case 'cancelled':
134
+ return 'aborted';
135
+ case 'max_turn_requests':
136
+ return 'error';
137
+ default:
138
+ return 'error';
139
+ }
140
+ }
141
+ export function kimiContentText(content) {
142
+ return content.type === 'text' ? content.text : '';
143
+ }
144
+ function startupFailure(error, stage, outcome) {
145
+ return new KimiRunFailure(outcome === undefined
146
+ ? { stage, category: 'transport' }
147
+ : { stage, category: 'process-exit', outcome }, error);
148
+ }
149
+ function terminalFailure(reason, permission) {
150
+ switch (reason) {
151
+ case 'end_turn':
152
+ return undefined;
153
+ case 'max_turn_requests':
154
+ return diagnosticText({
155
+ stage: 'prompt',
156
+ category: 'remote-limit',
157
+ stopReason: 'max_turn_requests',
158
+ }, permission);
159
+ case 'max_tokens':
160
+ case 'refusal':
161
+ case 'cancelled':
162
+ return permission === undefined
163
+ ? undefined
164
+ : permissionDiagnostic(permission);
165
+ default:
166
+ return diagnosticText({
167
+ stage: 'prompt',
168
+ category: 'unknown',
169
+ stopReason: 'unknown',
170
+ }, permission);
171
+ }
172
+ }
173
+ export async function startKimiRun(request, spec) {
174
+ const texts = kimiTextTask(request.prompt);
175
+ if (request.signal.aborted) {
176
+ throw new Error('subagent-kimi: request was aborted before ACP startup');
177
+ }
178
+ const id = brandString(randomUUID());
179
+ let child;
180
+ try {
181
+ child = spec.spawn({
182
+ argv: kimiAcpArgv(),
183
+ cwd: spec.cwd,
184
+ stdio: { stdin: 'pipe', stdout: 'pipe', stderr: 'inherit' },
185
+ graceMs: spec.disposeGraceMs,
186
+ env: spec.env,
187
+ });
188
+ }
189
+ catch (error) {
190
+ reportFailure(spec, error);
191
+ throw new KimiRunFailure({
192
+ stage: 'process',
193
+ category: 'process-start',
194
+ }, error);
195
+ }
196
+ if (child.stdin === undefined || child.stdout === undefined) {
197
+ child.terminate();
198
+ await child.waitForExit().catch(() => false);
199
+ throw new KimiRunFailure({
200
+ stage: 'process',
201
+ category: 'process-start',
202
+ });
203
+ }
204
+ let processOutcome;
205
+ let processFailure;
206
+ const processDone = child.done.then((outcome) => {
207
+ processOutcome = outcome;
208
+ return outcome;
209
+ }, (error) => {
210
+ processFailure = toError(error);
211
+ throw processFailure;
212
+ });
213
+ const processRejected = processDone.then(() => new Promise(() => { }), (error) => Promise.reject(toError(error)));
214
+ processRejected.catch(() => { });
215
+ const observeProcessOutcome = async (signal) => {
216
+ if (processOutcome !== undefined)
217
+ return processOutcome;
218
+ const timeout = AbortSignal.timeout(Math.ceil(spec.disposeGraceMs));
219
+ const bound = signal === undefined
220
+ ? timeout
221
+ : AbortSignal.any([signal, timeout]);
222
+ const aborted = Promise.withResolvers();
223
+ const onObservationAbort = () => { aborted.resolve(undefined); };
224
+ bound.addEventListener('abort', onObservationAbort, { once: true });
225
+ if (bound.aborted)
226
+ onObservationAbort();
227
+ try {
228
+ return await Promise.race([processDone, aborted.promise]);
229
+ }
230
+ catch {
231
+ return processOutcome;
232
+ }
233
+ finally {
234
+ bound.removeEventListener('abort', onObservationAbort);
235
+ }
236
+ };
237
+ let processDisposal;
238
+ const disposeProcess = () => (processDisposal ??= disposeKimiChild(child, spec.disposeEofGraceMs));
239
+ const fold = new AssistantOutputFold();
240
+ const flags = { cancelled: false };
241
+ let latestPermission;
242
+ const acpPermission = spec.permissionMode === 'auto' ? 'allow' : 'reject';
243
+ const clientApp = createAcpClientApp({ name: 'dsh-subagent-kimi' })
244
+ .onNotification(methods.client.session.update, ({ params }) => {
245
+ const update = params.update;
246
+ if (update.sessionUpdate === 'agent_message_chunk') {
247
+ fold.pushText(kimiContentText(update.content));
248
+ }
249
+ return Promise.resolve();
250
+ })
251
+ .onRequest(methods.client.session.requestPermission, ({ params }) => {
252
+ if (acpPermission === 'allow') {
253
+ const allow = params.options.find(option => option.kind === 'allow_once' || option.kind === 'allow_always');
254
+ if (allow !== undefined) {
255
+ latestPermission = {
256
+ mode: spec.permissionMode,
257
+ request: permissionRequestKind(params.toolCall.kind),
258
+ decision: 'allowed',
259
+ };
260
+ return Promise.resolve({
261
+ outcome: { outcome: 'selected', optionId: allow.optionId },
262
+ });
263
+ }
264
+ }
265
+ latestPermission = {
266
+ mode: spec.permissionMode,
267
+ request: permissionRequestKind(params.toolCall.kind),
268
+ decision: 'denied',
269
+ };
270
+ return Promise.resolve({ outcome: { outcome: 'cancelled' } });
271
+ });
272
+ const connection = clientApp.connect(ndJsonStream(NodeWritable.toWeb(child.stdin), NodeReadable.toWeb(child.stdout)));
273
+ const agent = connection.agent;
274
+ let sessionId;
275
+ let startupStage = 'initialize';
276
+ let signalCancelSettled;
277
+ const cancelSettled = new Promise((resolve) => {
278
+ signalCancelSettled = resolve;
279
+ });
280
+ const requestCancel = () => {
281
+ if (flags.cancelled)
282
+ return;
283
+ flags.cancelled = true;
284
+ signalCancelSettled();
285
+ if (sessionId !== undefined) {
286
+ void agent.notify(methods.agent.session.cancel, { sessionId })
287
+ .catch(() => { });
288
+ }
289
+ };
290
+ const onAbort = () => { requestCancel(); };
291
+ request.signal.addEventListener('abort', onAbort, { once: true });
292
+ const collectOutput = () => fold.collect() ?? [];
293
+ try {
294
+ await Promise.race([
295
+ (async () => {
296
+ await agent.request(methods.agent.initialize, {
297
+ protocolVersion: PROTOCOL_VERSION,
298
+ clientCapabilities: {},
299
+ });
300
+ startupStage = 'new-session';
301
+ const session = await agent.request(methods.agent.session.new, {
302
+ cwd: spec.cwd,
303
+ mcpServers: [],
304
+ });
305
+ const returnedSessionId = Reflect.get(session, 'sessionId');
306
+ if (typeof returnedSessionId !== 'string' || returnedSessionId.length === 0) {
307
+ throw new KimiRunFailure({
308
+ stage: 'new-session',
309
+ category: 'protocol',
310
+ }, new Error('Kimi ACP published without a session id'));
311
+ }
312
+ sessionId = returnedSessionId;
313
+ startupStage = 'configure-session';
314
+ await agent.request(methods.agent.session.setMode, {
315
+ sessionId: returnedSessionId,
316
+ modeId: spec.permissionMode === 'reject' ? 'default' : spec.permissionMode,
317
+ });
318
+ if (spec.model !== undefined) {
319
+ await agent.request(methods.agent.session.setConfigOption, {
320
+ sessionId: returnedSessionId,
321
+ configId: 'model',
322
+ value: spec.model,
323
+ });
324
+ }
325
+ if (flags.cancelled) {
326
+ throw new Error('subagent-kimi: cancelled before the ACP session started');
327
+ }
328
+ })(),
329
+ processRejected,
330
+ cancelSettled.then(() => {
331
+ throw new Error('subagent-kimi: cancelled before the ACP session started');
332
+ }),
333
+ ]);
334
+ }
335
+ catch (error) {
336
+ request.signal.removeEventListener('abort', onAbort);
337
+ const cancelledBeforeCleanup = flags.cancelled;
338
+ const observedOutcome = !cancelledBeforeCleanup && !(error instanceof KimiRunFailure)
339
+ ? await observeProcessOutcome()
340
+ : undefined;
341
+ const startup = cancelledBeforeCleanup
342
+ ? { kind: 'cancelled' }
343
+ : {
344
+ kind: 'failed',
345
+ failure: error instanceof KimiRunFailure
346
+ ? error
347
+ : startupFailure(error, startupStage, observedOutcome),
348
+ };
349
+ if (startup.kind === 'failed') {
350
+ reportFailure(spec, error instanceof KimiRunFailure ? error.cause : processFailure ?? error);
351
+ }
352
+ try {
353
+ await disposeProcess();
354
+ }
355
+ catch (cleanupError) {
356
+ reportFailure(spec, cleanupError);
357
+ const cleanupFailure = new KimiRunFailure({
358
+ stage: 'teardown',
359
+ category: processOutcome === undefined ? 'unknown' : 'process-exit',
360
+ ...processOutcome === undefined ? {} : { outcome: processOutcome },
361
+ }, cleanupError);
362
+ if (startup.kind === 'cancelled') {
363
+ throw new AggregateError([cleanupFailure], cleanupFailure.message);
364
+ }
365
+ throw new AggregateError([startup.failure, cleanupFailure], `${startup.failure.message}; ${cleanupFailure.message}`);
366
+ }
367
+ if (startup.kind === 'cancelled') {
368
+ throw new Error('subagent-kimi: request was aborted before ACP startup');
369
+ }
370
+ throw startup.failure;
371
+ }
372
+ if (sessionId === undefined) {
373
+ throw new Error('subagent-kimi: ACP startup fulfilled without a session id');
374
+ }
375
+ const remoteSessionId = sessionId;
376
+ let diagnostic;
377
+ const result = settleRunResult({
378
+ attempt: async () => {
379
+ try {
380
+ const promptResult = await Promise.race([
381
+ agent.request(methods.agent.session.prompt, {
382
+ sessionId: remoteSessionId,
383
+ prompt: texts.map(text => ({ type: 'text', text })),
384
+ }),
385
+ cancelSettled.then(() => {
386
+ throw new Error('subagent-kimi: cancelled while the ACP prompt was running');
387
+ }),
388
+ ]);
389
+ const stopReason = kimiStopReason(promptResult.stopReason);
390
+ const output = collectOutput();
391
+ const hasAnswer = output.some(block => block.type === 'text' && block.text.trim().length > 0);
392
+ diagnostic = terminalFailure(promptResult.stopReason, latestPermission);
393
+ if (stopReason === 'completed' && !hasAnswer) {
394
+ diagnostic = diagnosticText({
395
+ stage: 'prompt',
396
+ category: 'invalid-result',
397
+ }, latestPermission);
398
+ return { output, diagnostic, stopReason: 'error' };
399
+ }
400
+ return {
401
+ output,
402
+ ...diagnostic === undefined ? {} : { diagnostic },
403
+ stopReason,
404
+ };
405
+ }
406
+ catch (error) {
407
+ if (!flags.cancelled) {
408
+ const outcome = await observeProcessOutcome(request.signal);
409
+ const facts = outcome === undefined
410
+ ? { stage: 'prompt', category: 'transport' }
411
+ : { stage: 'process', category: 'process-exit', outcome };
412
+ diagnostic = diagnosticText(facts, latestPermission);
413
+ }
414
+ throw processFailure ?? error;
415
+ }
416
+ },
417
+ collectOutput,
418
+ collectDiagnostic: () => diagnostic,
419
+ cancelled: () => flags.cancelled,
420
+ onError: spec.onError,
421
+ signal: request.signal,
422
+ onAbort,
423
+ });
424
+ return subprocessRunHandle({
425
+ id,
426
+ result,
427
+ signal: request.signal,
428
+ onAbort,
429
+ requestCancel,
430
+ teardown: async () => {
431
+ try {
432
+ await disposeProcess();
433
+ }
434
+ catch (error) {
435
+ reportFailure(spec, error);
436
+ throw new KimiRunFailure({
437
+ stage: 'teardown',
438
+ category: processOutcome === undefined ? 'unknown' : 'process-exit',
439
+ ...processOutcome === undefined ? {} : { outcome: processOutcome },
440
+ }, error);
441
+ }
442
+ },
443
+ });
444
+ }
445
+ //# sourceMappingURL=run.js.map
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Kimi subagent",
4
+ "description": "Delegate one task to Kimi Code CLI using its native authentication and settings."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Kimi 子智能体",
4
+ "description": "使用 Kimi Code CLI 原生认证和设置委派单个任务。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,105 @@
1
1
  {
2
2
  "name": "dsh-subagent-kimi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "One-shot Kimi Code CLI subagent provider for DeepSeek Harness over ACP",
5
+ "keywords": [
6
+ "deepseek-harness",
7
+ "dsh",
8
+ "kimi",
9
+ "kimi-code",
10
+ "subagent",
11
+ "acp",
12
+ "cordis"
13
+ ],
14
+ "license": "MIT",
15
+ "author": "Saviio",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/Saviio/dsh-subagent-kimi.git"
19
+ },
20
+ "homepage": "https://github.com/Saviio/dsh-subagent-kimi#readme",
21
+ "bugs": {
22
+ "url": "https://github.com/Saviio/dsh-subagent-kimi/issues"
23
+ },
24
+ "type": "module",
25
+ "main": "lib/index.js",
26
+ "types": "lib/index.d.ts",
27
+ "exports": {
28
+ ".": {
29
+ "types": "./lib/index.d.ts",
30
+ "default": "./lib/index.js"
31
+ },
32
+ "./package.json": "./package.json",
33
+ "./locale/*.json": "./locale/*.json",
34
+ "./cordis.patch.yml": "./cordis.patch.yml"
35
+ },
36
+ "files": [
37
+ "icon.svg",
38
+ "locale/*.json",
39
+ "lib/**/*.js",
40
+ "lib/**/*.d.ts",
41
+ "cordis.patch.yml"
42
+ ],
43
+ "engines": {
44
+ "node": ">=24.9.0"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "dsh": {
50
+ "bundle": {
51
+ "patch": "./cordis.patch.yml"
52
+ }
53
+ },
54
+ "icon": "./icon.svg",
55
+ "scripts": {
56
+ "clean": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\"",
57
+ "build": "tsc -p tsconfig.json",
58
+ "typecheck": "tsc -p tsconfig.json --noEmit",
59
+ "prepack": "npm run clean && npm run build"
60
+ },
61
+ "peerDependencies": {
62
+ "@deepseek-ai/cordis": "~4.0.5",
63
+ "@deepseek-ai/dsh-llm": ">=0.2.1-rc.2 <0.3.0",
64
+ "@deepseek-ai/dsh-session": ">=0.2.1-rc.2 <0.3.0",
65
+ "@deepseek-ai/dsh-subagent": ">=0.2.1-rc.2 <0.3.0",
66
+ "@deepseek-ai/dsh-subprocess": ">=0.2.1-rc.2 <0.3.0",
67
+ "@deepseek-ai/dsh-timeout": ">=0.2.1-rc.2 <0.3.0"
68
+ },
69
+ "dependencies": {
70
+ "@agentclientprotocol/sdk": "1.4.0",
71
+ "@deepseek-ai/dsh-brand": ">=0.2.1-rc.2 <0.3.0",
72
+ "@deepseek-ai/dsh-tool-subagent": ">=0.2.1-rc.2 <0.3.0",
73
+ "@deepseek-ai/schemastery": "~3.18.5"
74
+ },
75
+ "devDependencies": {
76
+ "@deepseek-ai/cordis": "~4.0.5",
77
+ "@deepseek-ai/cordis-plugin-loader": "~1.0.6",
78
+ "@deepseek-ai/dsh-agent": "0.2.1-rc.3",
79
+ "@deepseek-ai/dsh-app-boot": "0.2.1-rc.3",
80
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
81
+ "@deepseek-ai/dsh-loader-smoke": "0.2.1-rc.3",
82
+ "@deepseek-ai/dsh-session": "0.2.1-rc.3",
83
+ "@deepseek-ai/dsh-session-checkpoint-policy": "0.2.1-rc.3",
84
+ "@deepseek-ai/dsh-session-persistence-jsonl": "0.2.1-rc.3",
85
+ "@deepseek-ai/dsh-session-projection": "0.2.1-rc.3",
86
+ "@deepseek-ai/dsh-subagent": "0.2.1-rc.3",
87
+ "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
88
+ "@deepseek-ai/dsh-subprocess-local": "0.2.1-rc.3",
89
+ "@deepseek-ai/dsh-timeout": "0.2.1-rc.3",
90
+ "@deepseek-ai/dsh-tool-jobs": "0.2.1-rc.3",
91
+ "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
92
+ "@moonshot-ai/kimi-code": "2.3.1",
93
+ "@types/node": "^24.10.1",
94
+ "tsx": "^4.23.13",
95
+ "typescript": "^6.0.3"
96
+ },
97
+ "allowScripts": {
98
+ "@deepseek-ai/dsh-subprocess-local@0.2.1-rc.3": true,
99
+ "node-pty@1.1.0": true,
100
+ "node-pty@1.2.0-beta.15": true,
101
+ "koffi@3.1.1": true,
102
+ "esbuild@0.28.2": true,
103
+ "@moonshot-ai/kimi-code": false
104
+ }
105
+ }