dsh-subagent-kimi 0.1.0 → 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/README.md CHANGED
@@ -9,19 +9,31 @@ Each delegation starts a fresh Kimi process and ACP session in the selected work
9
9
  ## Requirements
10
10
 
11
11
  - Node.js 24.9.0 or later.
12
- - DeepSeek Harness packages on the verified `0.2.1-rc.3` release line.
13
- - Kimi Code authentication and provider settings configured through Kimi Code CLI. Run `kimi login` or configure Kimi normally before delegating.
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
14
 
15
- The package pins `@moonshot-ai/kimi-code@2.3.1` and invokes its package-local CLI. It does **not** execute `kimi` from the host `PATH`, and there is no host-CLI fallback. Native Kimi configuration and authentication remain authoritative under `KIMI_CODE_HOME` or `~/.kimi-code`.
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`.
16
24
 
17
25
  ## Install
18
26
 
19
- Install `dsh-subagent-kimi` through the DeepSeek Harness plugin/bundle manager, or add it to the Node project containing your Harness composition:
27
+ Install the bundle into a DeepSeek Harness profile, replacing `<name>` with `web`, `headless`, `sdk`, `acp`, or your custom profile name:
20
28
 
21
29
  ```sh
22
- npm install dsh-subagent-kimi
30
+ dsh plugin --profile <name> add dsh-subagent-kimi
23
31
  ```
24
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
+
25
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.
26
38
 
27
39
  To mount the provider and tool manually, use:
@@ -78,7 +90,7 @@ No mode creates a human interaction channel in the parent Harness session. `auto
78
90
  ## Behavior
79
91
 
80
92
  - The provider accepts only a non-empty sequence of text blocks. Images and other content types are rejected before a process starts.
81
- - Every run uses a new package-local `node <kimi-code> acp` process and a new ACP session. There is no process pooling, follow-up input, or resume.
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.
82
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.
83
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.
84
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.
@@ -95,7 +107,8 @@ The provider advertises no optional start capabilities and does not inherit the
95
107
  - One run is one text-only task. There is no continuation, resume, progress stream, or parent-context inheritance.
96
108
  - There is no built-in wall-clock timeout and no rollback of files or external systems changed before cancellation.
97
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.
98
- - Compatibility is pinned by development evidence to Kimi Code CLI 2.3.1, ACP SDK 1.4.0, and DeepSeek Harness 0.2.1-rc.3. Upgrade these together only after rerunning protocol and real-product verification.
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.
99
112
 
100
113
  ## Development
101
114
 
package/README.zh.md CHANGED
@@ -9,19 +9,31 @@
9
9
  ## 环境要求
10
10
 
11
11
  - Node.js 24.9.0 或更高版本。
12
- - 已验证的 DeepSeek Harness `0.2.1-rc.3` 依赖线。
13
- - 已通过 Kimi Code CLI 配置认证和模型提供商。委派前请先运行 `kimi login` 或按正常方式完成 Kimi 配置。
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
14
 
15
- 本包固定依赖 `@moonshot-ai/kimi-code@2.3.1`,并调用该 npm 包内的 CLI;**不会**执行宿主机 `PATH` 中的 `kimi`,也没有宿主机 CLI 回退机制。Kimi 原生配置和认证仍以 `KIMI_CODE_HOME` 或 `~/.kimi-code` 为准。
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` 为准。
16
24
 
17
25
  ## 安装
18
26
 
19
- 通过 DeepSeek Harness 插件/Bundle 管理器安装 `dsh-subagent-kimi`,或在承载 Harness 组合的 Node 项目中安装:
27
+ 将 Bundle 安装进 DeepSeek Harness Profile,`<name>` 替换为 `web`、`headless`、`sdk`、`acp` 或自定义 Profile 名称:
20
28
 
21
29
  ```sh
22
- npm install dsh-subagent-kimi
30
+ dsh plugin --profile <name> add dsh-subagent-kimi
23
31
  ```
24
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
+
25
37
  Bundle 元数据会加载 `cordis.patch.yml`、注册 `kimi` provider,并将 `subagent_kimi` 添加为 Harness 全局工具。仅加载 Bundle 不会启动 Kimi;只有实际发生委派时才创建进程。
26
38
 
27
39
  如需手工挂载 provider 和工具:
@@ -78,8 +90,8 @@ Harness subprocess 服务会清除父环境中形似凭据的变量;`env` 中
78
90
  ## 行为与结果
79
91
 
80
92
  - 仅接受非空文本块序列;图片等内容类型会在启动进程前被拒绝。
81
- - 每次运行都创建新的包内 `node <kimi-code> acp` 进程和 ACP 会话,不复用进程,不支持追加输入或恢复会话。
82
- - ACP `initialize`、`session/new`、`session/set_mode` 和可选的 `session/set_config_option` 成功后才发布 run;配置失败使用 `configure-session` 阶段,并先清理尚未发布的私有进程。
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` 阶段,并先清理尚未发布的私有进程。
83
95
  - `session/prompt` 只执行一次任务。收集流式 `agent_message_chunk` 文本;思考、计划、工具调用等更新会被消费但不作为结果返回。
84
96
  - ACP 停止原因映射为 Harness 的 `completed`、`max-tokens`、`refusal`、`aborted` 或 `error`。未知原因,以及声称成功却没有任何助手文本的情况,均按错误处理。
85
97
  - 取消会尽力发送 `session/cancel`,在本地及时结算,并最终由进程清理兜底。
@@ -95,7 +107,8 @@ Provider 不继承父对话,也不声明任何可选 start capabilities。需
95
107
  - 每次运行仅处理一个文本任务,不支持续聊、恢复、进度流或父上下文继承。
96
108
  - 没有内置墙钟超时,也不会回滚取消前已经发生的文件或外部系统副作用。
97
109
  - Kimi 原生设置、hooks、skills 和账号状态会影响子进程。部署策略需要独立 Kimi home 时,可在 `env` 中显式设置 `KIMI_CODE_HOME`,并在该 home 中单独配置认证。
98
- - 当前兼容基线为 Kimi Code CLI 2.3.1、ACP SDK 1.4.0 和 DeepSeek Harness 0.2.1-rc.3。升级这些依赖后,应重新完成协议和真实产品验证。
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 后,应重新完成协议和真实产品验证。
99
112
 
100
113
  ## 开发
101
114
 
package/lib/run.js CHANGED
@@ -1,7 +1,4 @@
1
1
  import { randomUUID } from 'node:crypto';
2
- import { readFileSync } from 'node:fs';
3
- import { createRequire } from 'node:module';
4
- import { dirname, resolve } from 'node:path';
5
2
  import { Readable as NodeReadable, Writable as NodeWritable } from 'node:stream';
6
3
  import { client as createAcpClientApp, methods, ndJsonStream, PROTOCOL_VERSION, } from '@agentclientprotocol/sdk';
7
4
  import { brandString } from '@deepseek-ai/dsh-brand';
@@ -14,10 +11,6 @@ export const KIMI_PERMISSION_MODES = [
14
11
  export const DEFAULT_KIMI_PERMISSION_MODE = 'reject';
15
12
  export const DEFAULT_DISPOSE_EOF_GRACE_MS = 6_000;
16
13
  export const DEFAULT_DISPOSE_GRACE_MS = 3_000;
17
- const kimiPackageJsonPath = createRequire(import.meta.url)
18
- .resolve('@moonshot-ai/kimi-code/package.json');
19
- const kimiPackageManifest = JSON.parse(readFileSync(kimiPackageJsonPath, 'utf8'));
20
- const KIMI_PACKAGE_BIN = resolve(dirname(kimiPackageJsonPath), kimiPackageManifest.bin.kimi);
21
14
  const ACP_TOOL_KINDS = new Set([
22
15
  'read', 'edit', 'delete', 'move', 'search',
23
16
  'execute', 'think', 'fetch', 'switch_mode', 'other',
@@ -61,7 +54,7 @@ export function kimiConfigurationFailure(cause) {
61
54
  }, cause);
62
55
  }
63
56
  export function kimiAcpArgv() {
64
- return [process.execPath, KIMI_PACKAGE_BIN, 'acp'];
57
+ return ['kimi', 'acp'];
65
58
  }
66
59
  export function kimiTextTask(prompt) {
67
60
  if (prompt.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-subagent-kimi",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "One-shot Kimi Code CLI subagent provider for DeepSeek Harness over ACP",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -60,18 +60,17 @@
60
60
  },
61
61
  "peerDependencies": {
62
62
  "@deepseek-ai/cordis": "~4.0.5",
63
- "@deepseek-ai/dsh-llm": "0.2.1-rc.3",
64
- "@deepseek-ai/dsh-session": "0.2.1-rc.3",
65
- "@deepseek-ai/dsh-subagent": "0.2.1-rc.3",
66
- "@deepseek-ai/dsh-subprocess": "0.2.1-rc.3",
67
- "@deepseek-ai/dsh-timeout": "0.2.1-rc.3"
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
68
  },
69
69
  "dependencies": {
70
70
  "@agentclientprotocol/sdk": "1.4.0",
71
- "@deepseek-ai/dsh-brand": "0.2.1-rc.3",
72
- "@deepseek-ai/dsh-tool-subagent": "0.2.1-rc.3",
73
- "@deepseek-ai/schemastery": "~3.18.5",
74
- "@moonshot-ai/kimi-code": "2.3.1"
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"
75
74
  },
76
75
  "devDependencies": {
77
76
  "@deepseek-ai/cordis": "~4.0.5",
@@ -90,6 +89,7 @@
90
89
  "@deepseek-ai/dsh-timeout": "0.2.1-rc.3",
91
90
  "@deepseek-ai/dsh-tool-jobs": "0.2.1-rc.3",
92
91
  "@deepseek-ai/dsh-tools": "0.2.1-rc.3",
92
+ "@moonshot-ai/kimi-code": "2.3.1",
93
93
  "@types/node": "^24.10.1",
94
94
  "tsx": "^4.23.13",
95
95
  "typescript": "^6.0.3"