cmdr-mcp 0.4.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/README.md +44 -17
- package/docs/README.zh-CN.md +33 -8
- package/docs/agent-integration.md +74 -12
- package/docs/dashboard-plan.md +327 -0
- package/docs/dashboard.md +101 -0
- package/docs/implementation.md +25 -4
- package/docs/long-running-collaboration.md +4 -2
- package/docs/publishing.md +11 -9
- package/docs/setup.md +4 -3
- package/docs/troubleshooting.md +3 -3
- package/marketplace.json +2 -2
- package/package.json +10 -2
- package/plugins/cmdr/.claude-plugin/plugin.json +1 -1
- package/plugins/cmdr/.codex-plugin/plugin.json +1 -1
- package/plugins/cmdr/.kimi-plugin/plugin.json +65 -0
- package/plugins/cmdr/.zcode-plugin/plugin.json +1 -1
- package/plugins/cmdr/README.md +7 -5
- package/plugins/cmdr/THIRD_PARTY_NOTICES.txt +130 -0
- package/plugins/cmdr/bin/cmdr-check.mjs +6 -1
- package/plugins/cmdr/bin/cmdr-node +8 -1
- package/plugins/cmdr/commands/cmdr.md +3 -1
- package/plugins/cmdr/dist/cli.mjs +226 -43
- package/plugins/cmdr/dist/daemon.mjs +4792 -161
- package/plugins/cmdr/dist/dashboard/app.css +1 -0
- package/plugins/cmdr/dist/dashboard/app.js +10 -0
- package/plugins/cmdr/dist/dashboard/index.html +13 -0
- package/plugins/cmdr/dist/hook.mjs +22 -4
- package/plugins/cmdr/dist/integrity.json +24 -19
- package/plugins/cmdr/dist/mcp.mjs +148 -66
- package/plugins/cmdr/kimi-identity/SKILL.md +12 -0
- package/plugins/cmdr/skills/cmdr/SKILL.md +4 -2
- package/plugins/cmdr/skills/cmdr/references/commander.md +3 -1
- package/plugins/cmdr/skills/cmdr/references/executor.md +3 -1
- package/plugins/cmdr/skills/cmdr/references/setup.md +1 -1
- package/plugins/cmdr/skills/cmdr-commander/SKILL.md +3 -1
- package/plugins/cmdr/skills/cmdr-executor/SKILL.md +3 -1
- package/plugins/cmdr/skills/using-cmdr/SKILL.md +3 -3
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
{
|
|
8
8
|
"name": "cmdr",
|
|
9
9
|
"source": "./plugins/cmdr",
|
|
10
|
-
"version": "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.
|
|
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.
|
|
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,32 +98,55 @@ 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
|
|
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
|
-
Exactly
|
|
108
|
+
Exactly nine MCP tools are exposed, independently of the host:
|
|
105
109
|
|
|
106
|
-
| Tool
|
|
107
|
-
|
|
|
108
|
-
| `join`
|
|
109
|
-
| `list`
|
|
110
|
-
| `send`
|
|
111
|
-
| `report`
|
|
112
|
-
| `ask`
|
|
113
|
-
| `read`
|
|
114
|
-
| `leave`
|
|
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 |
|
|
115
121
|
|
|
116
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.
|
|
117
123
|
|
|
124
|
+
## Local dashboard
|
|
125
|
+
|
|
126
|
+
Run `cmdr dashboard` (or the stable CLI path printed by setup) to open the built-in React dashboard. `--no-open` prints short-lived access URLs for `127.0.0.1` and the machine’s non-loopback IPv4 addresses. The server binds to `0.0.0.0` on a system-assigned port; each address has its own single-use token, so opening the local link does not consume the LAN links. One page switches between squads, with a task workspace, a member/activity dock, and a persistent confirmation panel. Users can submit structured answers or send a note to the selected squad’s commander; notes enter the existing user-message queue without directly changing tasks. The HTTP/SSE service runs inside the existing daemon; closing the page does not stop collaboration.
|
|
127
|
+
|
|
128
|
+
Dashboard UI copy follows the system/browser’s preferred language: Chinese (`zh-*`) uses Simplified Chinese; other languages use English. Agent/user content and HTML artifacts remain unchanged. Reload after changing the browser language.
|
|
129
|
+
|
|
130
|
+
Example dashboard with demo data: multiple squads, task progress, member status, HTML explanations and user answers. Agent content in this example was written in English; it is not automatically translated.
|
|
131
|
+
|
|
132
|
+

|
|
133
|
+
|
|
134
|
+
<details>
|
|
135
|
+
<summary>Task details with the answer form kept open</summary>
|
|
136
|
+
|
|
137
|
+

|
|
138
|
+
|
|
139
|
+
</details>
|
|
140
|
+
|
|
141
|
+
[View the Chinese dashboard example](.github/assets/dashboard/main.jpg).
|
|
142
|
+
|
|
143
|
+
Commanders create tasks with `task(action="create", title=...)`, dispatch using `send(task_id=..., to=..., message=...)`, and ask the user with `ask(target="user", question=..., kind="single|multiple|text|confirm")`. Answers enter the stable commander inbox; explicitly use `ask(target="user", action="handle", id=..., version=..., result=...)` after processing. `artifact` publishes self-contained sandboxed HTML explanations. See [dashboard operations and limits](docs/dashboard.md).
|
|
144
|
+
|
|
118
145
|
## Installation diagnostics and member CLI
|
|
119
146
|
|
|
120
147
|
If cmdr tools are absent, inspect the host's actual plugin cache with `cmdr doctor --plugin-root /path/to/cached/plugin`. Add `--deep` to check MCP and daemon access in a temporary state directory. The checker works even when the inspected CLI bundle is missing. Refresh/reinstall damaged caches from the complete npm package and start a new session.
|
|
121
148
|
|
|
122
|
-
`cmdr session join|list|send|report|ask|read|leave` provides member operations when MCP tools are unavailable. Supply `--agent` and `--native-id` (or `CMDR_AGENT`/`CMDR_SESSION_ID`); use the same native ID as the host. These commands retain membership and messages after exit, and display connection presence as `cli`; execution state is reported separately.
|
|
149
|
+
`cmdr session join|list|send|report|ask|read|leave|task|artifact` provides member operations when MCP tools are unavailable. Supply `--agent` and `--native-id` (or `CMDR_AGENT`/`CMDR_SESSION_ID`); use the same native ID as the host. These commands retain membership and messages after exit, and display connection presence as `cli`; execution state is reported separately.
|
|
123
150
|
|
|
124
151
|
```sh
|
|
125
152
|
cmdr session join --agent zcode --native-id YOUR_SESSION_ID --squad-name my-project
|
|
@@ -172,7 +199,7 @@ npm run check
|
|
|
172
199
|
npm run verify:zcode # optional: requires the locally installed ZCode desktop runtime
|
|
173
200
|
```
|
|
174
201
|
|
|
175
|
-
`npm run check` checks formatting/types, builds the four entry points, runs unit/real-process tests, then packs and installs the npm tarball offline in a temporary prefix to verify the CLI and
|
|
202
|
+
`npm run check` checks formatting/types, builds the four entry points, runs unit/real-process tests, then packs and installs the npm tarball offline in a temporary prefix to verify the CLI and nine MCP tools. CI runs on macOS/Linux with Node 22/24 and checks generated bundles are not tracked by Git. The optional ZCode check validates, installs and connects the plugin using an isolated desktop runtime, without making a model request.
|
|
176
203
|
|
|
177
204
|
For development, `claude --plugin-dir ./plugins/cmdr` loads the plugin directly. Installed hosts use cached copies: reinstall/refresh after changing a plugin. Version numbers come from `package.json`; after same-version changes, restart the daemon explicitly. Generated bundles and third-party license notices are ignored by Git and included in the npm package.
|
|
178
205
|
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -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.
|
|
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.
|
|
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,11 +90,11 @@ 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
|
|
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
|
|
|
95
|
-
固定
|
|
97
|
+
固定 9 个 MCP 工具:`join`、`list`、`send`、`report`、`ask`、`read`、`leave`、`task`、`artifact`。读取即出队,`peek` 不出队,`history` 可回看。报告状态保存在 `message.data.status`。指挥官离队后小队变为 orphaned,可按原 ID 接管;`leave(dissolve=true)` 解散小队,但已经排队的消息仍可读取。
|
|
96
98
|
|
|
97
99
|
```sh
|
|
98
100
|
plugins/cmdr/bin/cmdr status
|
|
@@ -122,7 +124,7 @@ npm run check
|
|
|
122
124
|
npm run verify:zcode
|
|
123
125
|
```
|
|
124
126
|
|
|
125
|
-
`check` 包括格式、类型、打包、单元/真实进程测试,以及 npm tarball 在临时目录中的离线安装和
|
|
127
|
+
`check` 包括格式、类型、打包、单元/真实进程测试,以及 npm tarball 在临时目录中的离线安装和 9 个工具验证。ZCode 验证可选,需要已安装桌面端;它在临时目录使用 App 内置运行时验证插件和 9 个 MCP 工具连接,不发起模型请求。
|
|
126
128
|
|
|
127
129
|
插件版本由 `package.json` 统一生成。源码修改后需重新打包,并更新宿主缓存;同版本代码变更需手动重启 daemon。CI 验证 macOS/Linux、Node 22/24、npm 包可运行性,并确保生成产物没有被 Git 跟踪。
|
|
128
130
|
|
|
@@ -130,9 +132,9 @@ npm run verify:zcode
|
|
|
130
132
|
|
|
131
133
|
## 安装诊断与成员 CLI
|
|
132
134
|
|
|
133
|
-
工具未出现时,用 `cmdr doctor --plugin-root /实际宿主缓存中的插件目录` 检查缓存里的文件校验和与版本。加 `--deep` 会在临时数据目录中完成 MCP 握手、
|
|
135
|
+
工具未出现时,用 `cmdr doctor --plugin-root /实际宿主缓存中的插件目录` 检查缓存里的文件校验和与版本。加 `--deep` 会在临时数据目录中完成 MCP 握手、9 个工具检查及 daemon 访问,不操作正常小队。基础检查器独立于 dist,CLI bundle 缺失时仍可诊断;Node 缺失时先安装 Node。修复采用完整 npm 包重新注册市场、刷新/重装缓存并打开新会话,不跨安装目录链接 dist。
|
|
134
136
|
|
|
135
|
-
`cmdr session join|list|send|report|ask|read|leave` 提供完整成员操作,原有运维命令含义不变。显式传 `--agent`、`--native-id`,或设置 `CMDR_AGENT`、`CMDR_SESSION_ID`;与 MCP/hook 共享会话时必须使用相同原生 ID,共享 MCP 进程不能配置一个固定 ID。CLI 显示 `presence=cli`,退出后保留成员关系和任务状态;连接结束不代表模型停工。监听由 daemon 独立管理。
|
|
137
|
+
`cmdr session join|list|send|report|ask|read|leave|task|artifact` 提供完整成员操作,原有运维命令含义不变。显式传 `--agent`、`--native-id`,或设置 `CMDR_AGENT`、`CMDR_SESSION_ID`;与 MCP/hook 共享会话时必须使用相同原生 ID,共享 MCP 进程不能配置一个固定 ID。CLI 显示 `presence=cli`,退出后保留成员关系和任务状态;连接结束不代表模型停工。监听由 daemon 独立管理。
|
|
136
138
|
|
|
137
139
|
```sh
|
|
138
140
|
cmdr session join --agent zcode --native-id YOUR_SESSION_ID --squad-name my-project
|
|
@@ -143,3 +145,26 @@ cmdr session report --agent zcode --native-id YOUR_SESSION_ID --status done --re
|
|
|
143
145
|
指挥官必须显式声明 role=commander,report/ask 由执行者调用。结果为 JSON,失败使用非零退出码。`--input` 接受该操作完整 JSON 参数;`--timeout`、SIGINT/SIGTERM 可取消等待,等待中的 read 取消不消费后续消息。ask 取消前可能已发送,不能盲目重试。
|
|
144
146
|
|
|
145
147
|
`CMDR_HOME/logs/diagnostics/` 保存有界、限频的元数据快照。hook 仍失败放行,不写消息正文;unknown 表示尚未观察到,配置存在不代表真实触发。doctor 显示 provisional 会话及等待推荐来源;升级诊断不进入任务消息队列。详细案例见[排障说明](troubleshooting.md)。
|
|
148
|
+
|
|
149
|
+
## 内置看板
|
|
150
|
+
|
|
151
|
+
运行 `cmdr dashboard` 打开本机看板;setup 安装使用其返回的稳定 CLI 路径。`--no-open` 输出 `127.0.0.1` 及本机非回环网卡 IPv4 的短时访问地址。服务默认监听 `0.0.0.0`,端口由系统分配;各地址使用独立的一次性凭证,本机自动打开不影响局域网链接使用。单个 React 页面切换多个小队,以任务工作区、底部成员/活动坞和常驻确认面板展示进展。用户通过内置表单提交答复,也可向当前小队的指挥官留言;留言复用现有用户消息队列,不直接修改任务。普通进展更新不会整页刷新,切换小队保留表单草稿。
|
|
152
|
+
|
|
153
|
+
看板文案默认跟随系统/浏览器首选语言:中文(`zh-*`)显示简体中文,其他语言显示英文。Agent/用户内容与 HTML 展示保持原样;更改浏览器语言后刷新页面生效。
|
|
154
|
+
|
|
155
|
+
看板示例(演示数据):同页查看多个小队、任务进展和成员状态,通过右侧表单回复问题或向指挥官留言。
|
|
156
|
+
|
|
157
|
+

|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary>查看英文版看板及任务详情</summary>
|
|
161
|
+
|
|
162
|
+
英文示例的任务、问题和 HTML 内容使用预先准备的英文演示数据,不是自动翻译的 Agent 消息。
|
|
163
|
+
|
|
164
|
+

|
|
165
|
+
|
|
166
|
+

|
|
167
|
+
|
|
168
|
+
</details>
|
|
169
|
+
|
|
170
|
+
指挥官通过 `task` 管理任务,`send(task_id=...)` 关联派发,`ask(target="user")` 创建问题,`artifact` 发布隔离的 HTML 补充说明。用户答案持久化后进入当前指挥官收件箱;读取不代表处理,使用 `ask(target="user", action="handle", id=..., version=..., result=...)` 明确记录结果。关闭页面不结束小队。数据隔离、重试、恢复、HTML 限制和升级见[看板使用说明](dashboard.md)。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Build a source checkout with `npm ci && npm run build`, or use the unpacked/installed npm package. Git does not contain generated runtime bundles. `npm pack` / `npm publish` builds and includes them automatically.
|
|
4
4
|
|
|
5
|
-
The daemon and message model accept arbitrary lowercase Agent IDs (`[a-z][a-z0-9_-]{0,63}`), not a closed Claude/Codex enum. All hosts share the same
|
|
5
|
+
The daemon and message model accept arbitrary lowercase Agent IDs (`[a-z][a-z0-9_-]{0,63}`), not a closed Claude/Codex enum. All hosts share the same nine MCP tools. Specialized adapters add identity, working-directory discovery and lifecycle reminders; none is required to use the queue.
|
|
6
6
|
|
|
7
7
|
For automatic runtime, skill and user MCP/hooks installation, use [standalone setup](setup.md). The manual and native-plugin contracts follow below.
|
|
8
8
|
|
|
@@ -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
|
|
20
|
-
|
|
|
21
|
-
| `CMDR_AGENT`
|
|
22
|
-
| `CMDR_SESSION_ID`
|
|
23
|
-
| `CMDR_CWD`
|
|
24
|
-
| `CMDR_SESSION_TITLE`
|
|
25
|
-
| `CMDR_TOOL_TIMEOUT_SEC` | The timeout **already configured on the host**; informs wait recommendations, does not change the host timeout
|
|
26
|
-
| `CMDR_HOME`
|
|
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.
|
|
@@ -73,14 +73,76 @@ npm run verify:zcode
|
|
|
73
73
|
ZCODE_RUNTIME_PATH=/path/to/glm/zcode.cjs npm run verify:zcode
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
By default this command builds an npm tarball and tests its unpacked contents. An existing unpacked package root can be passed as `npm run verify:zcode -- /path/to/package`. The test invokes the actual desktop runtime's stdio app-server, validates and installs cmdr in an isolated workspace/storage directory, checks discovered components, and confirms a connected MCP server with
|
|
76
|
+
By default this command builds an npm tarball and tests its unpacked contents. An existing unpacked package root can be passed as `npm run verify:zcode -- /path/to/package`. The test invokes the actual desktop runtime's stdio app-server, validates and installs cmdr in an isolated workspace/storage directory, checks discovered components, and confirms a connected MCP server with nine tools. It makes no model calls and does not install into the user's normal plugin registry. GUI-driven model collaboration remains a separate manual check.
|
|
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
|
|
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).
|