cmdr-mcp 0.5.0 → 0.6.0

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.
Files changed (33) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/README.md +20 -16
  3. package/docs/README.zh-CN.md +6 -4
  4. package/docs/agent-integration.md +72 -10
  5. package/docs/dashboard.md +1 -1
  6. package/docs/implementation.md +1 -1
  7. package/docs/long-running-collaboration.md +4 -2
  8. package/docs/publishing.md +8 -8
  9. package/docs/setup.md +4 -3
  10. package/docs/troubleshooting.md +1 -1
  11. package/marketplace.json +2 -2
  12. package/package.json +2 -2
  13. package/plugins/cmdr/.claude-plugin/plugin.json +1 -1
  14. package/plugins/cmdr/.codex-plugin/plugin.json +1 -1
  15. package/plugins/cmdr/.kimi-plugin/plugin.json +65 -0
  16. package/plugins/cmdr/.zcode-plugin/plugin.json +1 -1
  17. package/plugins/cmdr/README.md +4 -4
  18. package/plugins/cmdr/bin/cmdr-check.mjs +3 -1
  19. package/plugins/cmdr/bin/cmdr-node +8 -1
  20. package/plugins/cmdr/commands/cmdr.md +1 -1
  21. package/plugins/cmdr/dist/cli.mjs +107 -14
  22. package/plugins/cmdr/dist/daemon.mjs +52 -13
  23. package/plugins/cmdr/dist/hook.mjs +21 -3
  24. package/plugins/cmdr/dist/integrity.json +20 -18
  25. package/plugins/cmdr/dist/mcp.mjs +9 -3
  26. package/plugins/cmdr/kimi-identity/SKILL.md +12 -0
  27. package/plugins/cmdr/skills/cmdr/SKILL.md +1 -1
  28. package/plugins/cmdr/skills/cmdr/references/commander.md +1 -1
  29. package/plugins/cmdr/skills/cmdr/references/executor.md +1 -1
  30. package/plugins/cmdr/skills/cmdr/references/setup.md +1 -1
  31. package/plugins/cmdr/skills/cmdr-commander/SKILL.md +1 -1
  32. package/plugins/cmdr/skills/cmdr-executor/SKILL.md +1 -1
  33. package/plugins/cmdr/skills/using-cmdr/SKILL.md +2 -2
@@ -7,9 +7,9 @@
7
7
  {
8
8
  "name": "cmdr",
9
9
  "source": "./plugins/cmdr",
10
- "version": "0.5.0",
10
+ "version": "0.6.0",
11
11
  "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders."
12
12
  }
13
13
  ],
14
- "description": "Local multi-agent squads for Claude Code, Codex, ZCode and other MCP hosts."
14
+ "description": "Local multi-agent squads for Claude Code, Codex, ZCode, Kimi Code and other MCP hosts."
15
15
  }
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cmdr
2
2
 
3
- **Local squads for coding agents.** Connect existing Claude Code, Codex, ZCode and other MCP-capable Agent sessions. A commander dispatches tasks; executors report progress and ask questions. Messages persist in SQLite and arrive in priority order.
3
+ **Local squads for coding agents.** Connect existing Claude Code, Codex, ZCode, Kimi Code and other MCP-capable Agent sessions. A commander dispatches tasks; executors report progress and ask questions. Messages persist in SQLite and arrive in priority order.
4
4
 
5
5
  [中文说明](docs/README.zh-CN.md) · [Design specification](docs/cmdr-design-v1.md) · [Host integration](docs/agent-integration.md) · [Implementation and verification](docs/implementation.md)
6
6
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  Requires macOS or Linux and **Node.js ≥22.5** (24 recommended). The development branch contains source and plugin metadata. npm packages and the generated `marketplace` branch include the runtime bundles.
10
10
 
11
- **One-command setup (0.5.0):** replace `claude-code` with `codex` or `zcode` for your host.
11
+ **One-command setup (0.6.0):** replace `claude-code` with `codex`, `zcode` or `kimi-code` for your host.
12
12
 
13
13
  ```sh
14
14
  npx -y --package=cmdr-mcp@latest cmdr setup --agent claude-code
@@ -42,7 +42,7 @@ For distribution, `npm pack` (or `npm publish`) runs `prepack` to build the four
42
42
 
43
43
  ```sh
44
44
  npm pack
45
- npm install --global ./cmdr-mcp-0.5.0.tgz
45
+ npm install --global ./cmdr-mcp-0.6.0.tgz
46
46
  cmdr --help
47
47
  ```
48
48
 
@@ -70,6 +70,10 @@ Open a workspace, then **Settings → Plugins → Create → Add plugin marketpl
70
70
 
71
71
  The native `.zcode-plugin` manifest sets up MCP, commands and skills; ZCode discovers the four supported lifecycle hooks automatically. Local developers can still select a built checkout or installed npm package root. See [ZCode setup and verification](docs/agent-integration.md#zcode-desktop).
72
72
 
73
+ **Kimi Code desktop**
74
+
75
+ Run `npx -y --package=cmdr-mcp@latest cmdr setup --agent kimi-code`, then restart the Kimi Code app (its hook executor caches `config.toml` at startup). Setup writes the cmdr MCP server into `~/.kimi-code/mcp.json`, five lifecycle hooks into `~/.kimi-code/config.toml` and links the `cmdr` and `cmdr-identity` skills into `~/.kimi-code/skills/`. Kimi pools one MCP process per workspace, so every cmdr call must carry your session identity: the `cmdr-identity` skill renders your real session id (`${KIMI_SESSION_ID}`) and instructs the model to pass it as `_cmdr_session` on every call. The native `.kimi-plugin` manifest declares MCP, commands, skills and the same hooks for installation through the host plugin manager, with `sessionStart.skill` injecting the identity skill into every new or resumed session. See [Kimi Code setup and verification](docs/agent-integration.md#kimi-code-desktop).
76
+
73
77
  **Other Agents**
74
78
 
75
79
  Use any MCP stdio client. Generate a configuration with an absolute executable path:
@@ -94,26 +98,26 @@ Joining by name atomically creates or finds a persistent channel and defaults to
94
98
  2. The commander inspects `list`, then `send`s clear tasks with acceptance criteria.
95
99
  3. Executors `read`, immediately acknowledge with `report(status="working", reply_to=<command id>)`, do the work, then report done/failed/cancelled with the same `reply_to`.
96
100
  4. Executors use `ask` when blocked; the commander responds with `send(type="answer", reply_to=<ask id>)`.
97
- 5. Use `join(..., standby="auto")`. Claude/ZCode then arm `listener.arm.command` with its indicated native tool. Inspect `list` for listener health. With `can_auto_respond=true`, end the idle turn. Unsupported hosts remain manual; the skills bound fallback polling to two waits and explain manual continuation.
101
+ 5. Use `join(..., standby="auto")`. Claude/ZCode/Kimi then arm `listener.arm.command` with its indicated native tool. Inspect `list` for listener health. With `can_auto_respond=true`, end the idle turn. Unsupported hosts remain manual; the skills bound fallback polling to two waits and explain manual continuation.
98
102
  6. `leave` preserves queued messages. Commander departure orphans the squad; `leave(dissolve=true)` disbands it.
99
103
 
100
- Codex wakes through app-server proxy or the `codex queue` fallback. Claude uses Monitor and ZCode uses background Bash completion through the built-in `cmdr standby watch`; re-arm after task termination. See [Long-running collaboration](docs/long-running-collaboration.md) for capabilities, recovery, handover and compatibility requirements.
104
+ Codex wakes through app-server proxy or the `codex queue` fallback. Claude uses Monitor; ZCode and Kimi Code use background Bash completion through the built-in `cmdr standby watch`; re-arm after task termination. See [Long-running collaboration](docs/long-running-collaboration.md) for capabilities, recovery, handover and compatibility requirements.
101
105
 
102
106
  ## Tools
103
107
 
104
108
  Exactly nine MCP tools are exposed, independently of the host:
105
109
 
106
- | Tool | Purpose |
107
- | --- | --- |
108
- | `join` | Atomic join/create by `squad_name`, or explicit `role` and squad ID |
109
- | `list` | Task ownership, unacknowledged age, progress, connection state and listener health |
110
- | `send` | Commands, cancel, answers and info; task_key deduplication and gated reassign |
111
- | `report` | Executor ready, working, blocked, done, failed or cancelled reports |
112
- | `ask` | Executor questions, or commander `target=user` dashboard questions and handling receipts |
113
- | `read` | Priority dequeue, peek/history, recover, ID lookup and long polling |
114
- | `leave` | Leave, orphan or dissolve a squad |
115
- | `task` | Create, update, query and archive persistent dashboard tasks |
116
- | `artifact` | Publish/query isolated HTML explanations for tasks and questions |
110
+ | Tool | Purpose |
111
+ | ---------- | ---------------------------------------------------------------------------------------- |
112
+ | `join` | Atomic join/create by `squad_name`, or explicit `role` and squad ID |
113
+ | `list` | Task ownership, unacknowledged age, progress, connection state and listener health |
114
+ | `send` | Commands, cancel, answers and info; task_key deduplication and gated reassign |
115
+ | `report` | Executor ready, working, blocked, done, failed or cancelled reports |
116
+ | `ask` | Executor questions, or commander `target=user` dashboard questions and handling receipts |
117
+ | `read` | Priority dequeue, peek/history, recover, ID lookup and long polling |
118
+ | `leave` | Leave, orphan or dissolve a squad |
119
+ | `task` | Create, update, query and archive persistent dashboard tasks |
120
+ | `artifact` | Publish/query isolated HTML explanations for tasks and questions |
117
121
 
118
122
  Every successful tool result includes identity, recommended wait and unread count. Reports carry their status in `message.data.status`. Unread messages are retained across daemon restarts; reads mark them delivered and leave history. Delivery is distinct from acceptance and completion. `read(recover=true)` non-destructively lists all unfinished commands, including already-read work. `pending=0`, `unread=0` and `offline` never release task ownership. `read`/`list` are compact by default; use `full=true` for expanded metadata. ID lookups also enforce the reassignment gate before exposing queued replacement work. Listings never include command bodies; use `read(id=...)` for your own inbox or operator `tail --full` for observation. No exactly-once execution guarantee is made.
119
123
 
@@ -1,6 +1,6 @@
1
1
  # cmdr
2
2
 
3
- 让本机已经打开的 **Claude Code、Codex、ZCode 和其他支持 MCP 的 Agent** 组成小队:指挥官发任务,执行方汇报、提问,消息按优先级持久化到 SQLite。
3
+ 让本机已经打开的 **Claude Code、Codex、ZCode、Kimi Code 和其他支持 MCP 的 Agent** 组成小队:指挥官发任务,执行方汇报、提问,消息按优先级持久化到 SQLite。
4
4
 
5
5
  [English](../README.md) · [设计方案](cmdr-design-v1.md) · [接入指南](agent-integration.md) · [实现与验证记录](implementation.md)
6
6
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  支持 macOS / Linux,需要 Node.js ≥22.5(推荐 24)。开发分支保存源码和插件元数据;npm 发布包及自动生成的 `marketplace` 分支包含完整运行时。
10
10
 
11
- **一条命令完整安装(0.5.0)**,将 `claude-code` 换成实际使用的 `codex` 或 `zcode`:
11
+ **一条命令完整安装(0.6.0)**,将 `claude-code` 换成实际使用的 `codex`、`zcode` 或 `kimi-code`:
12
12
 
13
13
  ```sh
14
14
  npx -y --package=cmdr-mcp@latest cmdr setup --agent claude-code
@@ -42,7 +42,7 @@ npm run build
42
42
 
43
43
  ```sh
44
44
  npm pack
45
- npm install --global ./cmdr-mcp-0.5.0.tgz
45
+ npm install --global ./cmdr-mcp-0.6.0.tgz
46
46
  cmdr --help
47
47
  ```
48
48
 
@@ -68,6 +68,8 @@ ZCode 桌面端:打开工作区,在 **设置 → 插件 → 创建 → 添
68
68
 
69
69
  原生 `.zcode-plugin` 清单负责 MCP、命令和技能,ZCode 自动发现 4 类受支持的 hooks。本地开发仍可选择已构建的仓库或已安装 npm 包根目录。
70
70
 
71
+ Kimi Code 桌面端:运行 `npx -y --package=cmdr-mcp@latest cmdr setup --agent kimi-code`,然后重启 Kimi Code 应用(其 hook 执行器启动时缓存 `config.toml`)。setup 会把 cmdr MCP server 写入 `~/.kimi-code/mcp.json`、把 5 个生命周期 hooks 写入 `~/.kimi-code/config.toml`,并把 `cmdr` 与 `cmdr-identity` 技能链接到 `~/.kimi-code/skills/`。Kimi 按工作区共享一个 MCP 进程,所以每次调用 cmdr 都必须携带会话身份:`cmdr-identity` 技能会把你的真实会话 ID(`${KIMI_SESSION_ID}`)渲染出来,并要求模型在每次调用时以 `_cmdr_session` 传入。原生 `.kimi-plugin` 清单通过宿主插件管理器声明 MCP、命令、技能和同样的 hooks,并用 `sessionStart.skill` 在每个新建或恢复的会话自动注入身份技能。详见[接入指南的 Kimi Code 章节](agent-integration.md)。旧的手动配置如果在 `mcp.json` 里固定过 `CMDR_SESSION_ID`,请移除后重跑 setup。
72
+
71
73
  其他 Agent:
72
74
 
73
75
  ```sh
@@ -88,7 +90,7 @@ ZCode 桌面端:打开工作区,在 **设置 → 插件 → 创建 → 添
88
90
 
89
91
  执行方加入后 `report(ready)` 报到,说明目录、能力和当前上下文。指挥官通过 `list` 看成员,用 `send` 下发可验证任务。执行方 `read` 读取任务后立即用 `report(working, reply_to=<command id>)` 接单,再带相同 `reply_to` 汇报 done/failed/cancelled,遇到阻塞用 `ask` 提问;指挥官通过 `send(type="answer", reply_to=<ask id>)` 回答。
90
92
 
91
- 加入时设置 `standby="auto"`,再按 `listener.arm` 和 `list` 的健康状态操作。Codex 由 daemon 自动探测 proxy,并在不可用时尝试 `codex queue`;Claude 使用原生 Monitor,ZCode 使用 `run_in_background=true` 的后台 Bash,两者都运行内置 `cmdr standby watch`。宿主 watcher 真正挂载后才显示 `can_auto_respond=true`,此时可结束空闲回合;任务完成、失败、到期或宿主重启后重新挂载。只有不支持原生通知或挂载失败时,才退回两次有限轮询并说明需人工续接。完整操作与边界见[长期协作](long-running-collaboration.md)。
93
+ 加入时设置 `standby="auto"`,再按 `listener.arm` 和 `list` 的健康状态操作。Codex 由 daemon 自动探测 proxy,并在不可用时尝试 `codex queue`;Claude 使用原生 Monitor,ZCode 和 Kimi Code 使用 `run_in_background=true` 的后台 Bash,都运行内置 `cmdr standby watch`。宿主 watcher 真正挂载后才显示 `can_auto_respond=true`,此时可结束空闲回合;任务完成、失败、到期或宿主重启后重新挂载。只有不支持原生通知或挂载失败时,才退回两次有限轮询并说明需人工续接。完整操作与边界见[长期协作](long-running-collaboration.md)。
92
94
 
93
95
  ## 工具和运维
94
96
 
@@ -16,14 +16,14 @@ The output uses an absolute executable path and a conventional `mcpServers` obje
16
16
 
17
17
  Environment contract:
18
18
 
19
- | Variable | Meaning |
20
- | --- | --- |
21
- | `CMDR_AGENT` | Stable host identifier, e.g. `opencode`, `zcode`, `my-agent`; default `generic` when undetected |
22
- | `CMDR_SESSION_ID` | Optional unique native session ID, stable across resume; never reuse one ID for concurrent independent sessions |
23
- | `CMDR_CWD` | Optional actual session directory, useful when MCP launches in a plugin directory |
24
- | `CMDR_SESSION_TITLE` | Optional session title for the board |
25
- | `CMDR_TOOL_TIMEOUT_SEC` | The timeout **already configured on the host**; informs wait recommendations, does not change the host timeout |
26
- | `CMDR_HOME` | Shared daemon/state directory; all participating sessions must use the same value |
19
+ | Variable | Meaning |
20
+ | ----------------------- | --------------------------------------------------------------------------------------------------------------- |
21
+ | `CMDR_AGENT` | Stable host identifier, e.g. `opencode`, `zcode`, `my-agent`; default `generic` when undetected |
22
+ | `CMDR_SESSION_ID` | Optional unique native session ID, stable across resume; never reuse one ID for concurrent independent sessions |
23
+ | `CMDR_CWD` | Optional actual session directory, useful when MCP launches in a plugin directory |
24
+ | `CMDR_SESSION_TITLE` | Optional session title for the board |
25
+ | `CMDR_TOOL_TIMEOUT_SEC` | The timeout **already configured on the host**; informs wait recommendations, does not change the host timeout |
26
+ | `CMDR_HOME` | Shared daemon/state directory; all participating sessions must use the same value |
27
27
 
28
28
  Without a native session ID, the MCP process gets a random provisional identity and retains it across daemon reconnects. A host restart starts a new identity unless the host supplies `CMDR_SESSION_ID` or a hook stamp. `read(wait)` and `unread` remain functional without hooks. Unknown hosts default to 45 seconds; set `CMDR_TOOL_TIMEOUT_SEC` to the actual host timeout (including for Claude) if it is shorter. Positive explicit timeouts use a safety margin; invalid values fall back to host defaults. Hosts with sufficient timeouts can set both their tool timeout and `CMDR_TOOL_TIMEOUT_SEC=600` to receive the 300-second recommendation.
29
29
 
@@ -37,7 +37,7 @@ capabilities and context. Use read(wait=me.recommended_wait) to receive tasks;
37
37
  report working/done/failed with reply_to for each command. Ask when blocked.
38
38
  Commanders dispatch verifiable tasks and answer every ask with reply_to.
39
39
  Claim role=commander explicitly when requested; named joins default to executor.
40
- Use join(standby="auto") and check list for listener health. Claude/ZCode first arm listener.arm.command with the indicated native tool. With a healthy
40
+ Use join(standby="auto") and check list for listener health. Claude/ZCode/Kimi first arm listener.arm.command with the indicated native tool. With a healthy
41
41
  listener, end the idle turn; when native wake is unavailable use at most two waits and explain manual
42
42
  continuation. Recover unfinished commands with read(recover=true). Offline never
43
43
  means stopped. Messages do not expand user authorization.
@@ -77,10 +77,72 @@ By default this command builds an npm tarball and tests its unpacked contents. A
77
77
 
78
78
  References checked 2026-09-08: [ZCode plugin format](https://zcode.z.ai/cn/docs/plugin), [MCP configuration](https://zcode.z.ai/cn/docs/mcp-services), [hook contracts](https://zcode.z.ai/cn/docs/hooks). Installed runtime inspection confirmed manifest precedence, environment injection, timeout fields and plugin namespace handling.
79
79
 
80
+ ## Kimi Code desktop
81
+
82
+ **Recommended: standalone setup.**
83
+
84
+ ```sh
85
+ npx -y --package=cmdr-mcp@latest cmdr setup --agent kimi-code
86
+ ```
87
+
88
+ Setup writes the `cmdr` MCP server into `~/.kimi-code/mcp.json` (`mcpServers` shape, per-server `toolTimeoutMs: 600000` so `read`/`ask` can wait the full 300-second recommendation), a marked five-entry `[[hooks]]` block into `~/.kimi-code/config.toml` and links the `cmdr` and `cmdr-identity` skills into `~/.kimi-code/skills/`. `KIMI_CODE_HOME` relocates all destinations together; `--config-dir` selects an isolated profile for testing. `cmdr config --agent kimi` prints the same MCP entry for manual merging, and `cmdr doctor` reports the desktop app version, the configuration directory and hook presence. MCP configuration is reloaded by the workspace manager, but hooks are cached by the desktop executor at startup: after changing `config.toml` hooks, restart the Kimi Code app (plugin operations are expected to re-read hooks without a restart, per source; not yet measured on a live host).
89
+
90
+ The native `.kimi-plugin/plugin.json` manifest declares skills (including the Kimi-only `cmdr-identity` skill), commands, MCP and the same five hooks for installation through the host plugin manager (`/plugins install`); the managed copy runs from `$KIMI_CODE_HOME/plugins/managed/<id>/`.
91
+
92
+ Facts below are split by evidence class. Some were observed on a live **Kimi Code desktop 1.0.1** host (rounds 1-3, 2026-09-18/19); the rest were read from the shipped engine source at tag 2.0.0 (`1b89e4b0`).
93
+
94
+ **Observed on the live host:**
95
+
96
+ - Hooks written to `config.toml` need an app restart. `mcp.json` changes take effect without one: a restored `mcp.json` replaced the running MCP processes in place.
97
+ - Agent-level hook payloads (Stop, UserPromptSubmit, PreToolUse) carry the desktop bootstrap cwd `/`. SessionStart carries the workspace cwd, with `source=resume` for sessions restored at app start and `source=startup` for new ones.
98
+ - A per-server `toolTimeoutMs: 600000` holds long waits (`read(wait=75)` returned after 79.7s), so the 300-second recommendation is safe.
99
+ - Two sessions in one workspace share a single MCP process. With `_cmdr_session` stamps they still act as distinct members: in round 3, sessions A and B used one MCP process, and neither ever received a command addressed to the other.
100
+ - Per-call identity works on both paths:
101
+ - A session that first ran `/skill:cmdr-identity` stamped its very first call with the rendered id.
102
+ - A session without the skill was blocked once by PreToolUse (exit 2, correct id in the reason) and retried with the stamp.
103
+ - A session restored at app start sent SessionStart but bound nothing, which removes the round-2 misattribution.
104
+ - UserPromptSubmit stdout reaches the model. A typed message surfaced "1 unread" and the session read the message and reported. Activating a skill with `/skill:` does not fire UserPromptSubmit.
105
+ - A Stop exit 2 continued the turn once, and the session then handled the unread command.
106
+ - Archiving a session fired SessionEnd with `reason=archive` and took the member offline, while the shared MCP process kept serving the other session.
107
+ - The built-in watcher woke stamped sessions automatically, after 25s and 15s.
108
+
109
+ **From the engine source (kimi-code 2.0.0):**
110
+
111
+ - The shared MCP process is started per workspace from `mcp.json` (`workspaceMcpService.ts:58-70`, `:110-117`); the child environment carries no session id (`client-stdio.ts:191`, `:292-304`), and neither `initialize` nor `callTool` carries one (`client-stdio.ts:58-61`, `:122`). The MCP cwd is the workspace root.
112
+ - `${KIMI_SESSION_ID}` in a skill body is replaced with the real session id on every render path - user `/skill` activation, the model's Skill tool call, and the plugin `sessionStart.skill` injection (`registry.ts:60-70`, `:166-168`; `agentPluginService.ts:121-132`, `:246-255`). The `cmdr-identity` skill (plugin-only file, plus setup-linked user skill) carries the per-call stamping rules; the `sessionStart.skill` manifest field injects it into the **main agent only**, so the main agent makes cmdr calls on behalf of subagents with the same stamp. Slash-command rendering of the placeholder is unverified - the identity source is the skill, not the `/cmdr` command.
113
+ - A PreToolUse exit 2 turns into the tool call's error result carrying the stderr reason (`runHook.ts:140-151`; `beforeToolExecuteEvent.ts:19-21`), evaluated before permission approval; hooks cannot rewrite tool input (`runHook.ts:43-56`). The cmdr bridge independently rejects an unstamped kimi call with `SESSION_STAMP_REQUIRED` explaining the shared process and where to obtain the id.
114
+ - UserPromptSubmit exit-0 stdout becomes a user message in the model context (`agentExternalHooksService.ts:370-385`) and fires only on real user input, never on watcher-woken turns; SessionStart stdout is dropped by the host (#2873).
115
+ - A Stop exit 2 appends the reason as a user message and may continue the turn once (`stop_hook_active` is always false; `agentExternalHooksService.ts:235-260`, `:389-423`).
116
+ - SessionEnd fires only on archive/delete of a loaded session (and CLI `/reload` exit), not on tab close or app quit (`sessionLifecycleService.ts:414-474`); plugin install/enable/disable or reload re-reads hooks (`pluginService.ts:91-167`).
117
+ - Hooks are `[[hooks]]` tables (`event`, `matcher`, `command`, `timeout`); an unrecognized `event` fails the whole configuration load. All hook payloads carry the running session's `session_id` and `hook_event_name`. The five installed hooks:
118
+
119
+ | Event | Role |
120
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
121
+ | SessionStart | Presence and restored-session tracking; for Kimi it is also the only hook whose cwd may update the session record (agent-level payloads carry `/`); never binds identity (startup restores would misidentify the shared MCP process) |
122
+ | UserPromptSubmit | Unread-message reminder: exit 0 stdout becomes a user message in the model context; fires only on real user input, never on watcher-woken turns |
123
+ | PreToolUse | Verifies `_cmdr_session` on cmdr tools (matcher matches the tool-name regex in `src/shared/env.ts`); silent on match, exit 2 + reason naming the expected id otherwise |
124
+ | Stop | exit 2 + reason appends a user message and may continue the turn once; throttled per sequence |
125
+ | SessionEnd | Presence only; fires on archive/delete of a loaded session (and CLI `/reload` exit) |
126
+
127
+ - **Wake** uses the same built-in watcher as ZCode: run `listener.arm.command` with Bash `run_in_background=true`; the watcher stays silent and exits on actionable work, and the completion notification starts the next turn. Re-arm after every completion, failure or kill.
128
+
129
+ **Migration.** Earlier manual Kimi setups that pinned `CMDR_SESSION_ID` in `mcp.json` must remove it: the workspace-pooled MCP would otherwise route every session to one fixed member. Rerun `cmdr setup --agent kimi-code` to obtain the stamping hooks and the identity skill.
130
+
131
+ The native plugin manifest carries no `CMDR_AGENT` binding: plugin hooks and the plugin MCP process are recognized as Kimi Code through the `KIMI_PLUGIN_ROOT` variable the host injects into plugin processes, so agent detection (and the exit-code-2 hook wrapper path) depends on that injection; the standalone setup path binds `CMDR_AGENT=kimi` in its launchers instead. Standalone setup and the native plugin are mutually exclusive — setup refuses to run while a managed `cmdr` plugin copy exists under `$KIMI_CODE_HOME/plugins/managed/`.
132
+
133
+ ### Remaining real-host checks
134
+
135
+ Observed and source-verified semantics are above. Still open for live confirmation:
136
+
137
+ 1. Watcher re-arm after a daemon restart.
138
+ 2. Plugin install/enable reloading hooks without an app restart (expected from source; unconfirmed).
139
+ 3. `${KIMI_SESSION_ID}` substitution through the plugin `sessionStart.skill` in newly created, resumed and compacted sessions. The `/skill:cmdr-identity` path is confirmed.
140
+ 4. Whether slash-command files render `${KIMI_SESSION_ID}` (if they do, the identity paragraph can move into the `/cmdr` command too).
141
+
80
142
  ## Diagnostics and CLI members
81
143
 
82
144
  See [Troubleshooting](troubleshooting.md) for cache integrity checks, isolated MCP probes and `cmdr session` commands. Member CLI uses protocol 1, `kind=mcp` and `transport=cli` registration. Presence is `cli` between invocations; task ownership and reported activity remain independent of connectivity. The daemon supports `admin.standby`, `admin.events` and `admin.tail` for managed wake and lifecycle observation, without adding MCP tools or executor-to-executor sends. See [long-running collaboration](long-running-collaboration.md). `_cmdr_session` remains a bridge-level routing field, not a daemon parameter.
83
145
 
84
146
  ## Automatic wake
85
147
 
86
- Codex supports proxy and queue compatibility paths. Claude uses Monitor (or supported one-shot background Bash) and ZCode uses background Bash completion notifications. Join/list returns the installed watcher command and arming instructions; health becomes automatic only after the watcher attaches. Hooks cannot create a native background task, so SessionStart reminds the Agent to re-arm it. Unknown MCP hosts remain manual. See [automatic standby](long-running-collaboration.md#automatic-standby).
148
+ Codex supports proxy and queue compatibility paths. Claude uses Monitor (or supported one-shot background Bash); ZCode and Kimi Code use background Bash completion notifications. Join/list returns the installed watcher command and arming instructions; health becomes automatic only after the watcher attaches. Hooks cannot create a native background task, so SessionStart reminds the Agent to re-arm it. Unknown MCP hosts remain manual. See [automatic standby](long-running-collaboration.md#automatic-standby).
package/docs/dashboard.md CHANGED
@@ -96,6 +96,6 @@ task(action="update", id="<任务 ID>", artifact_ids=["<展示块 ID>"])
96
96
 
97
97
  每个标签页一条 SSE,所有小队共享。事件只提示数据变化,页面再查询快照;断线恢复同样重新查询。表单草稿保存在当前页面内存中,按小队和问题区分,切换小队不丢失;浏览器整页重载不保证恢复。
98
98
 
99
- 监听健康、宿主接受唤醒、任务接单和问题处理各自显示。Codex 复用 proxy/queue;Claude/ZCode 完整执行 `listener.arm.command`,保留其中的 `CMDR_HOME`,使用宿主原生通知。安装自检与自动化测试不代替真实宿主的信任提示和模型唤醒验证。
99
+ 监听健康、宿主接受唤醒、任务接单和问题处理各自显示。Codex 复用 proxy/queue;Claude/ZCode/Kimi 完整执行 `listener.arm.command`,保留其中的 `CMDR_HOME`,使用宿主原生通知。安装自检与自动化测试不代替真实宿主的信任提示和模型唤醒验证。
100
100
 
101
101
  设计背景见[方案文档](dashboard-plan.md)。
@@ -1,6 +1,6 @@
1
1
  # Implementation and verification
2
2
 
3
- This document records the implementation and its verification scope. The design's historical v0.1.x trial reports described a prior prototype; they are not test evidence for this implementation. This release is versioned from `package.json` as **0.5.0**, internal protocol **1**.
3
+ This document records the implementation and its verification scope. The design's historical v0.1.x trial reports described a prior prototype; they are not test evidence for this implementation. This release is versioned from `package.json` as **0.6.0**, internal protocol **1**.
4
4
 
5
5
  ## Delivered behavior
6
6
 
@@ -62,6 +62,7 @@ On startup or after a wake, use ordinary `read` and `read(recover=true)`. Recove
62
62
  | Codex | Daemon attaches through app-server proxy; falls back to `codex queue` when proxy is unavailable | Join with auto, check health, end the idle turn |
63
63
  | Claude Code | Native Monitor emits a notification for each watcher output line | Run `listener.arm.command` with Monitor; re-arm on expiry/exit |
64
64
  | ZCode desktop | Native background Bash re-invokes its session when the watcher exits | Run `listener.arm.command` with `run_in_background=true`; re-arm after each notification |
65
+ | Kimi Code desktop | Native background Bash re-invokes its session when the watcher exits | Run `listener.arm.command` with `run_in_background=true`; re-arm after each notification |
65
66
 
66
67
  All paths share the same actionable policy: command, cancel, ask, answer, system, terminal/blocked reports, attention-marked info and direct info. working/ready reports and broadcast info without attention are quiet. Commands gated by reassignment remain blocked. Observation does not consume messages or accept tasks. Every wake must be followed by `read` and `read(recover=true)`, cancellation handling, and correlated working/terminal reports.
67
68
 
@@ -99,18 +100,19 @@ cmdr standby resume --session SID --resolve retry
99
100
 
100
101
  `retry` explicitly permits a new submission; it does not establish that the earlier one failed. Busy sessions coalesce backlog. Host acceptance remains separate from the command owner's working report.
101
102
 
102
- ### Claude and ZCode: native host watchers
103
+ ### Claude, ZCode and Kimi Code: native host watchers
103
104
 
104
105
  Join/list returns `listener.arm` with an absolute installed command, the native host tool and re-arm instructions. The standard command is:
105
106
 
106
107
  ```sh
107
108
  cmdr standby watch --session claude:REAL_ID
108
109
  cmdr standby watch --session zcode:REAL_ID
110
+ cmdr standby watch --session kimi:REAL_ID
109
111
  ```
110
112
 
111
113
  Claude uses its **Monitor tool**, not foreground Bash or shell `&`. Each stdout line becomes a native notification, queued into an active turn or opening an idle turn. The reporter's Monitor has a 30-minute lifetime; re-arm when the host reports expiry/exit. If Monitor is absent but the host supports background Bash completion notifications, use `--once` with `run_in_background=true`. If neither mechanism exists, explicitly select manual.
112
114
 
113
- ZCode uses **Bash with run_in_background=true**. Its native task survives the current turn and automatically re-invokes the session on completed/failed/killed. The built-in watcher remains silent during idle periods and exits after printing actionable metadata. It never consumes inbox messages, so a lost output notification still leaves the work available for recovery. On notification: inspect task output, read/recover, handle work, and re-arm. An immediate backlog produces an immediate notification; drain/reconcile it before re-arming.
115
+ ZCode and Kimi Code use **Bash with run_in_background=true**. Their native task survives the current turn and automatically re-invokes the session on completed/failed/killed. The built-in watcher remains silent during idle periods and exits after printing actionable metadata (on Kimi Code it also exits after one wake because its hook reminders cannot reach the model, so the agent must re-arm from the completion notification). It never consumes inbox messages, so a lost output notification still leaves the work available for recovery. On notification: inspect task output, read/recover, handle work, and re-arm. An immediate backlog produces an immediate notification; drain/reconcile it before re-arming.
114
116
 
115
117
  The command subscribes before inspecting current work, covering startup races, unread messages and read-but-unaccepted commands. At attach, accepted commands without pending cancellation are treated as already known: a blocked executor can re-arm and wait for an answer without repeatedly waking on its own unfinished task. Ownership and `read(recover=true)` remain unchanged; reconcile accepted work on startup or after context loss before arming. Unread answers, new commands and pending cancellation still notify, including cancellation requested after attach.
116
118
 
@@ -1,6 +1,6 @@
1
1
  # npm 发布
2
2
 
3
- 本次发布版本为 `cmdr-mcp@0.5.0`。npm 包名是 `cmdr-mcp`,CLI、宿主插件和 marketplace 名称仍为 `cmdr`。全局安装后的包根目录是 `$(npm root -g)/cmdr-mcp`。
3
+ 本次发布版本为 `cmdr-mcp@0.6.0`。npm 包名是 `cmdr-mcp`,CLI、宿主插件和 marketplace 名称仍为 `cmdr`。全局安装后的包根目录是 `$(npm root -g)/cmdr-mcp`。
4
4
 
5
5
  ## 准备与验证
6
6
 
@@ -10,12 +10,12 @@
10
10
  npm ci
11
11
  npm run check
12
12
  npm pack
13
- npm publish ./cmdr-mcp-0.5.0.tgz --dry-run --access public --registry https://registry.npmjs.org/
13
+ npm publish ./cmdr-mcp-0.6.0.tgz --dry-run --access public --registry https://registry.npmjs.org/
14
14
  ```
15
15
 
16
16
  涉及 ZCode 的发布另运行 `npm run verify:zcode`:从实际 tarball 安装到隔离缓存,核对完整性并移走安装源后验证 9 个工具;需要本机 ZCode runtime。
17
17
 
18
- `npm run check` 包括格式、类型、构建、测试以及临时目录中的 npm 包离线安装验证:检查发布资源、安装后 marketplace 路径、CLI 和 9 个 MCP 工具。`npm pack` 通过 `prepack` 生成 4 个运行入口及第三方许可证声明,输出 `cmdr-mcp-0.5.0.tgz`。源码、测试和开发依赖不进入发布包。
18
+ `npm run check` 包括格式、类型、构建、测试以及临时目录中的 npm 包离线安装验证:检查发布资源、安装后 marketplace 路径、CLI 和 9 个 MCP 工具。`npm pack` 通过 `prepack` 生成 4 个运行入口及第三方许可证声明,输出 `cmdr-mcp-0.6.0.tgz`。源码、测试和开发依赖不进入发布包。
19
19
 
20
20
  检查 `git diff`,确认版本与预期一致,构建未意外修改宿主 manifests。发布前保留经过验证的源码提交;不要手改或提交 `plugins/cmdr/dist/`、`THIRD_PARTY_NOTICES.txt` 和 `.tgz`。
21
21
 
@@ -38,20 +38,20 @@ CLI 输出授权地址后,立即把本次链接发到对话中,让维护者
38
38
  确认发布时,上传已检查的 tarball,并按 npm 提示完成账号验证:
39
39
 
40
40
  ```sh
41
- npm publish ./cmdr-mcp-0.5.0.tgz --access public --registry https://registry.npmjs.org/
41
+ npm publish ./cmdr-mcp-0.6.0.tgz --access public --registry https://registry.npmjs.org/
42
42
  ```
43
43
 
44
- 此命令会公开发布 `0.5.0` 并使用默认的 `latest` 标签。相同包名和版本不能重复发布;后续修改需要提升版本并重新构建验证。发布使用 tarball,以保持上传内容与已检查产物一致。
44
+ 此命令会公开发布 `0.6.0` 并使用默认的 `latest` 标签。相同包名和版本不能重复发布;后续修改需要提升版本并重新构建验证。发布使用 tarball,以保持上传内容与已检查产物一致。
45
45
 
46
46
  ## 发布后核对
47
47
 
48
48
  ```sh
49
- npm view cmdr-mcp@0.5.0 name version dist.integrity --registry https://registry.npmjs.org/
50
- npm install --global cmdr-mcp@0.5.0 --registry https://registry.npmjs.org/
49
+ npm view cmdr-mcp@0.6.0 name version dist.integrity --registry https://registry.npmjs.org/
50
+ npm install --global cmdr-mcp@0.6.0 --registry https://registry.npmjs.org/
51
51
  cmdr --help
52
52
  ```
53
53
 
54
- 按照[安装说明](README.zh-CN.md#安装)运行 setup 或注册原生插件。原生插件升级后刷新或重装宿主缓存,使用新版本 CLI 执行 `cmdr daemon restart`,再重连 MCP;该命令先做一致性预检,再替换旧 daemon。随后检查监听状态,Claude/ZCode 按 `listener.arm` 重新挂载 watcher。
54
+ 按照[安装说明](README.zh-CN.md#安装)运行 setup 或注册原生插件。原生插件升级后刷新或重装宿主缓存,使用新版本 CLI 执行 `cmdr daemon restart`,再重连 MCP;该命令先做一致性预检,再替换旧 daemon。随后检查监听状态,Claude/ZCode/Kimi 按 `listener.arm` 重新挂载 watcher。
55
55
 
56
56
  npm 命令行为参考:[npm publish 官方文档](https://docs.npmjs.com/cli/v11/commands/npm-publish/)。
57
57
 
package/docs/setup.md CHANGED
@@ -6,7 +6,7 @@ Available from cmdr-mcp 0.4.0. Requires macOS/Linux and Node.js >=22.5 (24 recom
6
6
  npx -y --package=cmdr-mcp@latest cmdr setup --agent claude-code
7
7
  ```
8
8
 
9
- Choose `claude-code`, `codex` or `zcode`. Setup installs a persistent runtime, the `cmdr` skill, MCP and user hooks, then checks the nine tools in temporary state. Use the printed CLI path (normally `~/.cmdr/bin/cmdr`), open a new host session and complete any trust prompts. Existing hook opt-outs are preserved. Other MCP hosts use `cmdr config --agent <host-id>`.
9
+ Choose `claude-code`, `codex`, `zcode` or `kimi-code`. Setup installs a persistent runtime, the `cmdr` skill, MCP and user hooks, then checks the nine tools in temporary state. Use the printed CLI path (normally `~/.cmdr/bin/cmdr`), open a new host session and complete any trust prompts. Kimi Code loads `config.toml` hooks only at startup, so restart the app instead. Existing hook opt-outs are preserved. Other MCP hosts use `cmdr config --agent <host-id>`.
10
10
 
11
11
  To install only the self-contained skill and its role/setup references:
12
12
 
@@ -23,6 +23,7 @@ Add `-g` for global scope or `--agent <supported-agent>` to select a host. This
23
23
  | Claude Code (`claude-code`, alias `claude`) | `~/.claude.json` | `~/.claude/settings.json` | `~/.claude/skills/cmdr` |
24
24
  | Codex | `$CODEX_HOME/config.toml`, default `~/.codex/config.toml` | `$CODEX_HOME/hooks.json` | `$CODEX_HOME/skills/cmdr` |
25
25
  | ZCode | `~/.zcode/cli/config.json`, `mcp.servers` | Same file, `hooks.events` | `~/.zcode/skills/cmdr` |
26
+ | Kimi Code (`kimi-code`, alias `kimi`) | `$KIMI_CODE_HOME/mcp.json`, default `~/.kimi-code/mcp.json` | Same directory, `config.toml` `[[hooks]]` | `$KIMI_CODE_HOME/skills/cmdr` |
26
27
 
27
28
  | Option | Purpose |
28
29
  | --- | --- |
@@ -30,7 +31,7 @@ Add `-g` for global scope or `--agent <supported-agent>` to select a host. This
30
31
  | `--json` | Return paths, changes, warnings and backup location as JSON |
31
32
  | `--config-dir PATH` | Select a custom host **user** profile directory; launch the host with that same profile |
32
33
 
33
- `CLAUDE_CONFIG_DIR` is respected; its MCP file is `<CLAUDE_CONFIG_DIR>/.claude.json`. ZCode loads user hooks, not workspace hooks. `CMDR_HOME` selects runtime/state storage (default `~/.cmdr`): build directories live in `runtimes/`, stable profile-specific launchers in `bin/`. They survive npx cache removal and bind the host/state directory, never a fixed session ID. See [host integration](agent-integration.md) for identity and lifecycle contracts.
34
+ `CLAUDE_CONFIG_DIR` is respected; its MCP file is `<CLAUDE_CONFIG_DIR>/.claude.json`. `KIMI_CODE_HOME` relocates the whole Kimi Code data directory, including `mcp.json`, `config.toml` and `skills/`; without it the default `~/.kimi-code` applies. ZCode loads user hooks, not workspace hooks. `CMDR_HOME` selects runtime/state storage (default `~/.cmdr`): build directories live in `runtimes/`, stable profile-specific launchers in `bin/`. They survive npx cache removal and bind the host/state directory, never a fixed session ID. See [host integration](agent-integration.md) for identity and lifecycle contracts.
34
35
 
35
36
  ## Upgrade and recovery
36
37
 
@@ -42,4 +43,4 @@ Existing copies/symlinks of this repository's skill are backed up and replaced w
42
43
 
43
44
  Backups live in `<CMDR_HOME>/setup-backups/<run>/`. `restore.json` maps each changed path to its backup (`null` marks a newly created entry). Failed writes are rolled back; concurrent edits are reported for manual recovery. After a crash, inspect that record before retrying. Remove a stale `setup.lock` only after confirming its recorded process has stopped.
44
45
 
45
- For diagnostics, run `<printed-cli> doctor --deep`. Move a damaged runtime directory aside and rerun setup from an intact package. Native plugins require their own cache refresh. For [automatic standby](long-running-collaboration.md#automatic-standby), Claude/ZCode arm `listener.arm.command` with the indicated native host tool; Codex uses daemon-managed proxy/queue delivery. GUI trust, actual hook execution and automatic wake must be verified in the host; setup's isolated MCP check does not establish those capabilities.
46
+ For diagnostics, run `<printed-cli> doctor --deep`. Move a damaged runtime directory aside and rerun setup from an intact package. Native plugins require their own cache refresh. For [automatic standby](long-running-collaboration.md#automatic-standby), Claude/ZCode/Kimi Code arm `listener.arm.command` with the indicated native host tool; Codex uses daemon-managed proxy/queue delivery. GUI trust, actual hook execution and automatic wake must be verified in the host; setup's isolated MCP check does not establish those capabilities.
@@ -90,5 +90,5 @@ See [long-running collaboration](long-running-collaboration.md) for adapter requ
90
90
  ## Automatic wake diagnostics
91
91
 
92
92
  - Codex: `standby status --session SID` shows the selected `transport`. Auto mode tries proxy then queue. Missing socket alone no longer establishes that wake is unavailable. Queue compatibility needs Node >=22.12, an available CLI with queue --thread/--message, and readable state_5/rollout lifecycle records in the daemon's CODEX_HOME. Inspect the concrete proxy/queue error before choosing an explicit executable or transport.
93
- - Claude/ZCode: `wake_mode=claude|zcode` with starting means the native watcher still needs arming. Use the absolute `listener.arm.command` with Monitor or background Bash as specified; shell detachment cannot supply a native completion notification. WATCHER_ACTIVE means inspect/reuse the existing native task. Re-arm after daemon/App restart or native task expiry.
93
+ - Claude/ZCode/Kimi: `wake_mode=claude|zcode|kimi` with starting means the native watcher still needs arming. Use the absolute `listener.arm.command` with Monitor or background Bash as specified; shell detachment cannot supply a native completion notification. WATCHER_ACTIVE means inspect/reuse the existing native task. Re-arm after daemon/App restart or native task expiry.
94
94
  - `uncertain` is not automatic retry permission. Reconcile host history and cmdr work, then choose standby resume --resolve accepted or retry. CLI acceptance never substitutes for a working report from the member.
package/marketplace.json CHANGED
@@ -4,9 +4,9 @@
4
4
  {
5
5
  "name": "cmdr",
6
6
  "source": "./plugins/cmdr",
7
- "version": "0.5.0",
7
+ "version": "0.6.0",
8
8
  "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders."
9
9
  }
10
10
  ],
11
- "description": "Local multi-agent squads for Claude Code, Codex, ZCode and other MCP hosts."
11
+ "description": "Local multi-agent squads for Claude Code, Codex, ZCode, Kimi Code and other MCP hosts."
12
12
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "cmdr-mcp",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
- "description": "Local multi-agent squads for Claude Code, Codex, ZCode and any MCP host",
5
+ "description": "Local multi-agent squads for Claude Code, Codex, ZCode, Kimi Code and any MCP host",
6
6
  "engines": {
7
7
  "node": ">=22.5.0"
8
8
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmdr",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders.",
5
5
  "author": {
6
6
  "name": "njugray"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmdr",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders.",
5
5
  "author": {
6
6
  "name": "njugray"
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "cmdr",
3
+ "version": "0.6.0",
4
+ "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders.",
5
+ "author": {
6
+ "name": "njugray"
7
+ },
8
+ "license": "MIT",
9
+ "repository": "https://github.com/njugray/cmdr",
10
+ "skills": [
11
+ "./skills/",
12
+ "./kimi-identity/"
13
+ ],
14
+ "commands": "./commands/",
15
+ "sessionStart": {
16
+ "skill": "cmdr-identity"
17
+ },
18
+ "mcpServers": {
19
+ "cmdr": {
20
+ "command": "./bin/cmdr-mcp",
21
+ "env": {
22
+ "CMDR_AGENT": "kimi",
23
+ "CMDR_TOOL_TIMEOUT_SEC": "600"
24
+ },
25
+ "toolTimeoutMs": 600000
26
+ }
27
+ },
28
+ "hooks": [
29
+ {
30
+ "event": "SessionStart",
31
+ "command": "./bin/cmdr-hook SessionStart",
32
+ "timeout": 5
33
+ },
34
+ {
35
+ "event": "UserPromptSubmit",
36
+ "command": "./bin/cmdr-hook UserPromptSubmit",
37
+ "timeout": 5
38
+ },
39
+ {
40
+ "event": "PreToolUse",
41
+ "matcher": "(?:^|[_:])cmdr(?:__|:)(list|join|report|leave|ask|send|read|task|artifact)$",
42
+ "command": "./bin/cmdr-hook PreToolUse",
43
+ "timeout": 5
44
+ },
45
+ {
46
+ "event": "Stop",
47
+ "command": "./bin/cmdr-hook Stop",
48
+ "timeout": 5
49
+ },
50
+ {
51
+ "event": "SessionEnd",
52
+ "command": "./bin/cmdr-hook SessionEnd",
53
+ "timeout": 1
54
+ }
55
+ ],
56
+ "interface": {
57
+ "displayName": "cmdr",
58
+ "category": "Developer Tools",
59
+ "shortDescription": "Coordinate local coding-agent sessions.",
60
+ "longDescription": "Connect local coding-agent sessions in squads with persistent messages, explicit roles, and lifecycle reminders.",
61
+ "developerName": "njugray",
62
+ "defaultPrompt": "Create or join a cmdr squad.",
63
+ "capabilities": []
64
+ }
65
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmdr",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Local multi-agent squads with durable messages, roles and lifecycle reminders.",
5
5
  "author": {
6
6
  "name": "njugray"
@@ -1,6 +1,6 @@
1
1
  # cmdr plugin
2
2
 
3
- Connect local Claude Code, Codex, ZCode and other MCP-capable sessions as a squad. Requires macOS/Linux and Node.js ≥22.5 (24 recommended); npm distribution packages include all runtime dependencies. A source checkout requires `npm ci && npm run build` at the repository root before installation; generated `dist` files are not tracked by Git.
3
+ Connect local Claude Code, Codex, ZCode, Kimi Code and other MCP-capable sessions as a squad. Requires macOS/Linux and Node.js ≥22.5 (24 recommended); npm distribution packages include all runtime dependencies. A source checkout requires `npm ci && npm run build` at the repository root before installation; generated `dist` files are not tracked by Git.
4
4
 
5
5
  For installation through `cmdr setup` or `npx skills`, see [standalone setup](https://github.com/njugray/cmdr/blob/main/docs/setup.md). Use one installation method per host to avoid duplicate tools and hooks.
6
6
 
@@ -8,11 +8,11 @@ In each session enter `/cmdr my-project`. Joining defaults to executor, even for
8
8
 
9
9
  Tools: `join`, `list`, `send`, `report`, `ask`, `read`, `leave`. Executors report ready with capabilities/cwd, then read tasks, report results and ask when blocked. Commanders dispatch verifiable tasks and answer questions with `reply_to`. Acknowledge each command with working + reply_to before executing it. Use read(recover=true) to find unfinished commands after interruptions. Offline never means stopped. Use join(standby="auto") and check listener health; with a healthy listener, end the idle turn. Manual fallback is limited to two recommended waits.
10
10
 
11
- Install a built checkout or the unpacked/installed npm package root as a marketplace in Claude Code/Codex, or use ZCode Settings → Plugins → Create → Add plugin marketplace. Codex needs hooks enabled and five hook approvals; start a new session after installation. For ZCode, use the published `njugray/cmdr#marketplace` source to install without a local build or global npm package. ZCode uses its native manifest and four supported hooks; MCP EOF handles offline state. Generic hosts can configure the absolute `bin/cmdr-mcp` executable and `CMDR_AGENT=<host>` with optional `CMDR_SESSION_ID=<unique native session>`.
11
+ Install a built checkout or the unpacked/installed npm package root as a marketplace in Claude Code/Codex, or use ZCode Settings → Plugins → Create → Add plugin marketplace. Codex needs hooks enabled and five hook approvals; start a new session after installation. For ZCode, use the published `njugray/cmdr#marketplace` source to install without a local build or global npm package. ZCode uses its native manifest and four supported hooks; MCP EOF handles offline state. Kimi Code installs through `cmdr setup --agent kimi-code` or the native `.kimi-plugin` manifest via the host plugin manager; it uses five hooks and a per-call `_cmdr_session` stamp because Kimi pools one MCP process per workspace — the `cmdr-identity` skill renders the session id (`${KIMI_SESSION_ID}`) for the model. Generic hosts can configure the absolute `bin/cmdr-mcp` executable and `CMDR_AGENT=<host>` with optional `CMDR_SESSION_ID=<unique native session>`.
12
12
 
13
- `bin/cmdr config --agent zcode` prints native ZCode configuration; `bin/cmdr config --agent my-agent` prints generic MCP configuration. `bin/cmdr doctor` checks installation health. `bin/cmdr daemon restart` reloads same-version code changes. State lives in `~/.cmdr/` (override `CMDR_HOME`), shared by all sessions.
13
+ `bin/cmdr config --agent zcode` prints native ZCode configuration; `bin/cmdr config --agent kimi` prints native Kimi Code configuration; `bin/cmdr config --agent my-agent` prints generic MCP configuration. `bin/cmdr doctor` checks installation health. `bin/cmdr daemon restart` reloads same-version code changes. State lives in `~/.cmdr/` (override `CMDR_HOME`), shared by all sessions.
14
14
 
15
- Codex wakes through proxy or queue; Claude Monitor and ZCode background Bash run the built-in standby watcher. Join/list supplies native arming instructions, and a live lease controls health. Unknown hosts remain manual; no remote transport is provided. Read marks delivery; report(working/done/failed/cancelled, reply_to) tracks work separately. cmdr standby manages listeners, and tail --after/--for supports non-consuming event replay. See [long-running collaboration](https://github.com/njugray/cmdr/blob/main/docs/long-running-collaboration.md).
15
+ Codex wakes through proxy or queue; Claude Monitor and ZCode/Kimi Code background Bash run the built-in standby watcher. Join/list supplies native arming instructions, and a live lease controls health. Unknown hosts remain manual; no remote transport is provided. Read marks delivery; report(working/done/failed/cancelled, reply_to) tracks work separately. cmdr standby manages listeners, and tail --after/--for supports non-consuming event replay. See [long-running collaboration](https://github.com/njugray/cmdr/blob/main/docs/long-running-collaboration.md).
16
16
 
17
17
  [Installation and usage](https://github.com/njugray/cmdr#readme) · [Host integration](https://github.com/njugray/cmdr/blob/main/docs/agent-integration.md) · [Verification scope](https://github.com/njugray/cmdr/blob/main/docs/implementation.md)
18
18
 
@@ -34,12 +34,14 @@ const required = [
34
34
  '.claude-plugin/plugin.json',
35
35
  '.codex-plugin/plugin.json',
36
36
  '.zcode-plugin/plugin.json',
37
+ '.kimi-plugin/plugin.json',
37
38
  ];
38
39
  for (const path of new Set([...required, ...Object.keys(manifest?.files || {})])) {
39
40
  if (
40
41
  !required.includes(path) &&
41
42
  !path.startsWith('skills/') &&
42
43
  !path.startsWith('commands/') &&
44
+ !path.startsWith('kimi-identity/') &&
43
45
  path !== 'THIRD_PARTY_NOTICES.txt'
44
46
  ) {
45
47
  errors.push(`Unexpected manifest path: ${path}`);
@@ -62,7 +64,7 @@ for (const path of new Set([...required, ...Object.keys(manifest?.files || {})])
62
64
  if (!files[path]) errors.push(`Missing, modified or linked asset: ${path}`);
63
65
  }
64
66
  const versions = {};
65
- for (const host of ['claude', 'codex', 'zcode']) {
67
+ for (const host of ['claude', 'codex', 'zcode', 'kimi']) {
66
68
  try {
67
69
  versions[host] = read(`.${host}-plugin/plugin.json`).version;
68
70
  if (versions[host] !== manifest?.version) errors.push(`${host} version differs from build`);
@@ -51,7 +51,14 @@ if [ ! -f "$CMDR_BIN_DIR/../dist/$CMDR_ENTRY.mjs" ]; then
51
51
  exit 1
52
52
  fi
53
53
  if [ "$CMDR_ENTRY" = hook ]; then
54
- "$CMDR_NODE" --experimental-sqlite --disable-warning=ExperimentalWarning "$CMDR_BIN_DIR/../dist/hook.mjs" "$@" 2>/dev/null || cmdr_failure runtime
54
+ # Node never uses exit code 2 itself, so only a hook block (the native Kimi
55
+ # Code format) surfaces stderr; every other failure stays fail-open.
56
+ { CMDR_HOOK_ERR=$("$CMDR_NODE" --experimental-sqlite --disable-warning=ExperimentalWarning "$CMDR_BIN_DIR/../dist/hook.mjs" "$@" 2>&1 1>&3 3>&-); CMDR_HOOK_STATUS=$?; } 3>&1
57
+ if [ "$CMDR_HOOK_STATUS" -eq 2 ]; then
58
+ printf '%s' "$CMDR_HOOK_ERR" >&2
59
+ exit 2
60
+ fi
61
+ [ "$CMDR_HOOK_STATUS" -ne 0 ] && cmdr_failure runtime
55
62
  exit 0
56
63
  fi
57
64
  exec "$CMDR_NODE" --experimental-sqlite --disable-warning=ExperimentalWarning "$CMDR_BIN_DIR/../dist/$CMDR_ENTRY.mjs" "$@"
@@ -3,7 +3,7 @@ description: Create or join a persistent local agent channel.
3
3
  argument-hint: <name>
4
4
  ---
5
5
  Call join(squad_name="$ARGUMENTS", standby="auto") for atomic find-or-create. If no name was provided, ask for one; do not invent it. Joining defaults to executor, including a channel without a commander. Add role="commander" if the user explicitly requested command; use takeover=true only for requested handover.
6
- Follow protocol_hint and the role skill. Executors report ready with cwd and capabilities. Give a brief translated user_reply preserving the join line. For Claude/ZCode, arm listener.arm.command with the indicated native host tool, following the role skill; re-arm on task termination or restart. Check listener health and end the idle turn when can_auto_respond=true. Use at most two recommended waits only when native wake is unavailable; explain the actual limitation.
6
+ Follow protocol_hint and the role skill. Executors report ready with cwd and capabilities. Give a brief translated user_reply preserving the join line. For Claude/ZCode/Kimi, arm listener.arm.command with the indicated native host tool, following the role skill; re-arm on task termination or restart. Check listener health and end the idle turn when can_auto_respond=true. Use at most two recommended waits only when native wake is unavailable; explain the actual limitation.
7
7
  If tools are unavailable, follow the cmdr skill's setup reference (or using-cmdr diagnostics for legacy installs) and member CLI fallback. Use the real host session ID, never an invented identity or raw socket workaround.
8
8
 
9
9
  For dashboard work, use task/artifact and the commander role reference for ask(target="user"). Open the built-in page with the current installation’s `cmdr dashboard`; do not generate a replacement dashboard HTML file.