agent-supervisor-mcp 2.0.2 → 2.0.3

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
@@ -1,6 +1,6 @@
1
1
  # agent-supervisor-mcp
2
2
 
3
- [English](README.en.md) | 中文
3
+ English | [Русский](README.ru.md) | [中文](README.zh-CN.md)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/agent-supervisor-mcp.svg)](https://www.npmjs.com/package/agent-supervisor-mcp)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/agent-supervisor-mcp.svg)](https://www.npmjs.com/package/agent-supervisor-mcp)
@@ -9,155 +9,156 @@
9
9
  [![node](https://img.shields.io/badge/node-%3E%3D22.13.0-339933.svg)](package.json)
10
10
  [![agent-supervisor-mcp on Glama](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp/badges/score.svg)](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp)
11
11
 
12
- 官网 [agent-supervisor.zriyo.com](https://agent-supervisor.zriyo.com) · 给模型读的 [llms.txt](https://agent-supervisor.zriyo.com/llms.txt) · [参考手册](docs/reference.md)
12
+ Website [agent-supervisor.zriyo.com](https://agent-supervisor.zriyo.com) · for models [llms.txt](https://agent-supervisor.zriyo.com/llms.txt) · [reference](docs/reference.en.md)
13
13
 
14
- 让几个 agent 同时改一个仓库,结果是互相覆盖,没人说得清谁改了什么,主线程的上下文还被 worker 的输出塞满。
14
+ Point several agents at one repository and they overwrite each other, nobody can say who changed what, and the main thread's context fills up with worker output.
15
15
 
16
- agent-supervisor-mcp 是一个 MCP server。主线程(Claude Code、Codex 或任何 MCP 客户端)用它同时指挥多个 Codex CLI worker:一个 worker 一个 Git worktree,状态写进 SQLite,另有一个网页看板。派单和记账都在磁盘上,不占模型上下文。
16
+ agent-supervisor-mcp is an MCP server. A main thread (Claude Code, Codex, or any MCP client) uses it to run several Codex CLI workers at once: one Git worktree per worker, state in SQLite, and a web board to watch them. Dispatch and bookkeeping live on disk, not in the model's context.
17
17
 
18
- ![演示:一个 Claude Code 主线程同时派 3 个 Codex worker,各自独立 worktree,并行跑完后合并提交](https://raw.githubusercontent.com/zriyox/agent-supervisor-mcp/main/assets/demo.gif)
18
+ ![Demo: one Claude Code main thread dispatches three Codex workers into separate worktrees, waits, and merges the result](https://raw.githubusercontent.com/zriyox/agent-supervisor-mcp/main/assets/demo.gif)
19
19
 
20
- *30 秒真跑:派 3 个 worker,各自 worktree 并行,主线程收 3 份 diff 合成一次 commit。*
20
+ *30 seconds, recorded live: three workers in their own worktrees in parallel, then the main thread collects three diffs and makes one commit.*
21
21
 
22
- > **这个包以前叫 codex-supervisor-mcp**。改名是因为 worker 不再只是 Codex。装着旧包的机器会被它的最后一版自动带过来:装上本包、把 MCP 注册和 skill 换成 `agent-supervisor`,状态目录原地不动。命令行工具的前缀从 `codex-supervisor-` 变成 `agent-supervisor-`。
22
+ > **This package used to be codex-supervisor-mcp.** It was renamed because a worker is no longer only Codex. A machine with the old package is brought over by its last release: this package is installed, the MCP registration and the skill become `agent-supervisor`, and the state directory stays where it is. The command line tools change prefix from `codex-supervisor-` to `agent-supervisor-`.
23
23
  >
24
- > **从 0.x 升级到 1.x**:工具从 39 个收成 14 个,名字和参数都换了,旧名不留别名。升级前先把在跑的 worker 收完,升级后重开会话让新 skill 生效。对照表在[参考手册](docs/reference.md),变更说明在 [1.0.0 release](https://github.com/zriyox/agent-supervisor-mcp/releases/tag/v1.0.0)。
24
+ > **Upgrading from 0.x to 1.x**: 39 tools became 14, with new names and arguments and no aliases for the old ones. Finish the workers in flight first, then reopen the session after upgrading so the new skill loads. The tool table is in the [reference](docs/reference.en.md); what changed is in the [1.0.0 release](https://github.com/zriyox/agent-supervisor-mcp/releases/tag/v1.0.0).
25
25
 
26
- ## 解决什么
26
+ ## What it solves
27
27
 
28
- | 问题 | 做法 |
28
+ | Problem | What it does |
29
29
  |---|---|
30
- | 几个 worker 互相踩文件 | 一个 worker 一个 worktree,`owned_paths` 在派单前查冲突 |
31
- | worker 的输出塞爆主线程 | 事件写 JSONL,主线程只读压缩过的概览(全部 worker 不超过 7000 字节) |
32
- | 重启或换会话后接不上 | 每个 work 一行 SQLite,带 `thread_id`;`resume_worker` 接回同一个 Codex 会话 |
33
- | 分不清跑失败还是进程没了 | 状态机把 `failed` 和 `lost` 分开,失败带来源和错误码 |
34
- | worker 说做完了其实没有 | 派单带 `acceptance` 验收命令,supervisor 在 worker 退出后自己跑,不过就拒绝合入 |
35
- | 改动留在本地没上线 | `land_worker` 合回主分支,`verify_push` 核对远端真有这笔提交 |
36
- | worktree 越堆越多 | 已合入或没有改动的在轮询时自动清;没合入的留 7 天,删之前先把未提交的改动存进它的分支。分支和证据不删 |
30
+ | Workers step on each other's files | One worktree per worker; `owned_paths` is checked for conflicts before dispatch |
31
+ | Worker output floods the main thread | Events go to JSONL; the main thread reads a compressed overview (every worker in under 7000 bytes) |
32
+ | A restart or a new session loses the workers | One SQLite row per work, with its `thread_id`; `resume_worker` rejoins the same Codex session |
33
+ | A failed run looks the same as a dead process | The state machine keeps `failed` and `lost` apart, and a failure carries its source and code |
34
+ | A worker says it is done and is not | Dispatch with `acceptance` commands; the supervisor runs them itself after the worker exits and refuses to land on failure |
35
+ | Changes sit on a local branch | `land_worker` merges into the integration branch; `verify_push` proves the commit is on the remote |
36
+ | Worktrees pile up | Landed or unchanged ones are removed during polling. Unlanded work is kept for 7 days, and its uncommitted edits are committed to its branch before the worktree goes. Branches and evidence stay |
37
37
 
38
- worker 默认跑 `codex exec`,`model` 透传。主线程留在 Claude,worker 挂 DeepSeek 或别的 provider,账单分开算。
38
+ A worker is a `codex exec` process by default and `model` is passed straight through. Keep the main thread on Claude, put the workers on DeepSeek or another provider, and the bills stay separate.
39
39
 
40
- worker 也可以是 Claude Code:`create_worker` 带 `runner: "claude"`。它没有系统级沙箱,所以只能在 git worktree 或只读模式下跑,也不支持旁问(`ask_worker`);其余派单、验收、续跑、合入、清理都一样。想接别的 CLI,看 [docs/runner.md](docs/runner.md)。
40
+ A worker can also be Claude Code: pass `runner: "claude"` to `create_worker`. It has no OS sandbox, so it runs only in a git worktree or read-only, and it has no side chat (`ask_worker`); dispatch, acceptance, resume, landing and cleanup are the same. To add another CLI, see [docs/runner.md](docs/runner.md).
41
41
 
42
- ## 五分钟跑起来
42
+ ## Five minutes to a running batch
43
43
 
44
- 要 Node.js 22.13.0 以上,`codex` CLI 在 `PATH` 里。macOS、Linux、Windows 都行。
44
+ You need Node.js 22.13.0 or newer and the `codex` CLI on `PATH`. macOS, Linux and Windows all work.
45
45
 
46
46
  ```bash
47
47
  npm install -g agent-supervisor-mcp
48
48
  ```
49
49
 
50
- 安装脚本会给检测到的 Claude Code 和 Codex 装 skill、注册 MCP,装完重启它们。没注册上(比如用了 `--ignore-scripts`)就跑一次 `agent-supervisor-setup`,或者手动加:
50
+ The install script puts the skill into every Claude Code and Codex it finds and registers the MCP server. Restart them afterwards. If nothing got registered (`--ignore-scripts`, for instance), run `agent-supervisor-setup`, or add it by hand:
51
51
 
52
52
  ```bash
53
53
  claude mcp add -s user agent-supervisor -- npx -y agent-supervisor-mcp
54
54
  codex mcp add agent-supervisor -- npx -y agent-supervisor-mcp
55
55
  ```
56
56
 
57
- Claude Desktop、Cursor、Windsurf 这类 GUI 客户端要自己改 MCP 配置,写法在[参考手册](docs/reference.md#环境变量)。只要 skill 不要 MCP:`npx skills add zriyox/agent-supervisor-mcp`。
57
+ GUI clients such as Claude Desktop, Cursor and Windsurf need their MCP config edited by hand; the snippet is in the [reference](docs/reference.en.md#environment-variables). For the skill without the server: `npx skills add zriyox/agent-supervisor-mcp`.
58
58
 
59
- 然后在 Claude Code 里说人话:
59
+ Then say it in plain words in Claude Code:
60
60
 
61
- > 把这三个模块的单测补齐,用 agent-supervisor 分三路并行跑,session 叫「补单测」。
61
+ > Fill in the unit tests for these three modules. Use agent-supervisor, three workers in parallel, call the session "unit tests".
62
62
 
63
- skill 会带着主线程走完这几步:
63
+ The skill walks the main thread through this:
64
64
 
65
65
  ```
66
- preflight_worker 先在同样的环境里跑一遍 probe
67
- create_worker ×3 每路带 session、owned_paths、goal
68
- wait_workers 一次最多等 60 秒,没完接着等
69
- get_worker ×3 每路的汇报,带它真跑过的命令和退出码
70
- get_worker_diff ×3 它实际改了什么
71
- land_worker ×3 核过了,代它提交并合入
66
+ preflight_worker run a probe in the same environment first
67
+ create_worker ×3 each with session, owned_paths, goal
68
+ wait_workers 60 seconds at most per call; call again until done
69
+ get_worker ×3 each worker's report, with the commands it ran and their exit codes
70
+ get_worker_diff ×3 what it actually changed
71
+ land_worker ×3 reviewed; commit on its behalf and land
72
72
  ```
73
73
 
74
- worker 自己不提交。它的改动留在 `worker/<taskId>` 分支,等主线程看过 diff 再合。
74
+ Workers never commit. Their changes stay on `worker/<taskId>` until the main thread has read the diff.
75
75
 
76
- 想看着它们跑,开看板:
76
+ To watch them work, open the board:
77
77
 
78
78
  ```bash
79
- agent-supervisor-web # 或 npx -p agent-supervisor-mcp agent-supervisor-web
79
+ agent-supervisor-web # or: npx -p agent-supervisor-mcp agent-supervisor-web
80
80
  ```
81
81
 
82
- 打开 `http://127.0.0.1:7877`。按 session 看每路 worker 的状态、正在跑的命令、改动和事件,还能旁问:从 worker 的线程 fork 一个只读会话来答,不打断它手上的活。看板只看,不派单也不取消。
82
+ Open `http://127.0.0.1:7877`. It shows each session's workers: status, the command running right now, changes and events. You can also ask a worker a question on the side; the answer comes from a read-only fork of its thread, so the work in progress is not interrupted. The board is read-only. It does not dispatch or cancel.
83
83
 
84
- ## 我自己怎么用
84
+ ## How I use it
85
85
 
86
- 能连 MCP 的都能当主线程,下面只是我的用法。我开两个 Claude Code 会话,一个只管文档,一个只管派活。合成一个的话,又写详设又盯 worker,上下文两小时就满。
86
+ Anything that speaks MCP can be the main thread; this is just my way. I run two Claude Code sessions, one for documents and one for dispatch. A single session that writes the design and also watches the workers fills its context in two hours.
87
87
 
88
- | 谁 | 开在哪 | 管什么 |
88
+ | Who | Where | Does what |
89
89
  |---|---|---|
90
- | 我 | | 定需求,拍板,看汇报 |
91
- | 规划会话 | 需求和文档仓 | 聊需求,写详设,每块活写一份任务书 |
92
- | 主脑会话 | 代码仓的一个 worktree | 读任务书,派 worker,核 diff,向我汇报。不写业务代码 |
93
- | Codex worker | 各自的 worktree | 一个 worker 做一个能独立验收的功能包。不 commit、不 push |
90
+ | Me | | Decide what to build, make the calls, read the reports |
91
+ | Planning session | The requirements and docs repository | Talk through the requirement, write the design, write one brief per block of work |
92
+ | Main-brain session | A worktree of the code repository | Read the brief, dispatch workers, check diffs, report to me. Writes no business code |
93
+ | Codex workers | Their own worktrees | One worker per independently verifiable feature package. No commit, no push |
94
94
 
95
- 两个会话之间只传一段文字,粘进主脑会话用 `/goal` 接上:
95
+ One block of text passes between the two sessions, pasted into the main-brain session and handed over with `/goal`:
96
96
 
97
97
  ```text
98
- 【角色】 你是主脑:派 worker,核结果,更新文档,向我汇报。不写业务代码。先加载 agent-supervisor skill。
99
- 【背景】 这一块为什么做,上一块留下了什么
100
- 【先读】 哪几份文档的哪几节,说法冲突时以哪份为准
101
- 【做什么】照任务书第几节那张表做,表里没有的不做
102
- 【派活】 先 find_works 查重;整批同一个 session.id;
103
- 写入范围不重叠才并行;验证命令同时填 acceptance;
104
- worker 说过了不算,你看到 diff 才算
105
- 【红线】 不改什么,不推什么,不读什么
106
- 【汇报】 中文,表格优先,报完停下来等我
98
+ [Role] You are the main brain: dispatch workers, check results, update docs, report to me.
99
+ You write no business code. Load the agent-supervisor skill first.
100
+ [Background] Why this block exists, what the previous one left behind
101
+ [Read first] Which sections of which documents, and which one wins when they disagree
102
+ [Do] Follow the table in section N of the brief. Nothing outside the table
103
+ [Dispatch] find_works first so nothing is dispatched twice; one session.id for the batch;
104
+ parallel only when write sets are disjoint; the verify command goes in acceptance too;
105
+ a worker's word is not enough, the diff you read is
106
+ [Red lines] What not to change, push or read
107
+ [Report] Tables first, then stop and wait for me
107
108
  ```
108
109
 
109
- ## 工具
110
+ ## Tools
110
111
 
111
- 默认 14 个。入参和边界见[参考手册](docs/reference.md#工具)。
112
+ Fourteen by default. Arguments and edge cases are in the [reference](docs/reference.en.md#tools).
112
113
 
113
- | 阶段 | 工具 | 干什么 |
114
+ | Stage | Tool | What it does |
114
115
  |---|---|---|
115
- | 派单前 | `preflight_worker` | 用和目标 worker 相同的环境起一个短 probe,或者先把验收命令真跑一遍 |
116
- | 派单 | `create_worker` | 派一路。带 `followup_of` 就是接着另一路的成果干 |
117
- | | `resume_worker` | 同一个会话继续跑,可先 rebase 到主线新头 |
118
- | | `cancel_worker` | 终止一路 |
119
- | 盯进度 | `poll_workers` | 不带 cursor 给全表;带 cursor 只给上次之后的变化,顺带恢复死掉的第一轮、清掉可清的 worktree |
120
- | | `wait_workers` | 等到有结果,单次最多 60 秒 |
121
- | 收活 | `get_worker` | 读一路:摘要、汇报、状态、事件、goal,要哪块取哪块 |
122
- | | `get_worker_diff` | 实际改动,按文件和 hunk 分页 |
123
- | | `ask_worker` | 旁路问它一句,只读,不动它的线程 |
124
- | 交付 | `land_worker` | 代提交并 cherry-pick 到集成分支,验收没过就拒 |
125
- | | `verify_push` | 证明合入的提交已经在远端。只验证,不替你 push |
126
- | | `cleanup` | 看某个 worktree 为什么还在,或立刻清掉。平时是自动清的 |
127
- | 批次 | `find_works` | 找回一批活,或按关键字搜历史 |
128
- | | `describe_session` | 给一批活记标题、目标、默认验收和审批状态 |
129
-
130
- 另有 3 个默认不注册,设 `AGENT_SUPERVISOR_TOOLS=all` 才出现:`facts`(已验证事实的台账)、`review`(起一个只读 verifier 独立复核)、`get_artifact`(读留存的证据)。日常派活用不到,不注册能省下每个会话的上下文。
131
-
132
- ## 和 Claude Code 的 subagent 有什么区别
133
-
134
- subagent 自己也能开 worktree,所以文件隔离不算差别。差别在模型和进程。
116
+ | Before dispatch | `preflight_worker` | Starts a short probe in the target worker's environment, or runs the acceptance commands for real first |
117
+ | Dispatch | `create_worker` | Dispatches one worker. With `followup_of` it builds on another worker's work |
118
+ | | `resume_worker` | Continues the same session, optionally rebased onto the new head first |
119
+ | | `cancel_worker` | Stops a worker |
120
+ | Tracking | `poll_workers` | Without a cursor, the whole table; with one, only what changed since, and it recovers a dead first run and removes worktrees that are safe to remove |
121
+ | | `wait_workers` | Waits for a result, 60 seconds at most per call |
122
+ | Collecting | `get_worker` | Reads one worker: summary, report, status, events, goal, whichever parts you ask for |
123
+ | | `get_worker_diff` | The actual changes, paged by file and hunk |
124
+ | | `ask_worker` | Asks the worker a side question. Read-only; its thread is untouched |
125
+ | Delivery | `land_worker` | Commits on the worker's behalf and cherry-picks onto the integration branch; refuses if acceptance failed |
126
+ | | `verify_push` | Proves the landed commit is on the remote. It verifies; it never pushes for you |
127
+ | | `cleanup` | Shows why a worktree is still there, or removes it now. Normally cleanup is automatic |
128
+ | Batches | `find_works` | Finds a batch again, or searches history by substring |
129
+ | | `describe_session` | Records a batch's title, objective, default acceptance and approval state |
130
+
131
+ Three more are registered only with `AGENT_SUPERVISOR_TOOLS=all`: `facts` (the ledger of verified facts), `review` (an independent read-only verifier) and `get_artifact` (stored evidence). A normal batch never needs them, and leaving them out saves context in every session.
132
+
133
+ ## How this differs from Claude Code subagents
134
+
135
+ A subagent can open its own worktree too, so file isolation is not the difference. The model and the process are.
135
136
 
136
137
  | | Claude Code subagent | agent-supervisor worker |
137
138
  |---|---|---|
138
- | 能跑什么模型 | 只能选 Claude | Codex CLI 配了 provider 的都行 |
139
- | 干活的是谁 | Claude Code 自己 | 独立的 `codex exec` 进程 |
140
- | 两路写同一个文件 | 没有路径声明 | 派单前查 `owned_paths` 交集,重叠直接拒 |
141
- | 主线程挂了 | 收不回来 | worker 和验收照常跑完,新窗口用 `find_works` 找回 |
142
- | 谁能驱动 | 只有 Claude Code | 任何 MCP 客户端 |
143
- | 看过程 | 只有它返回的结论 | 原始 JSONL 和网页看板 |
139
+ | Which models | Claude only | Anything the Codex CLI has a provider for |
140
+ | Who does the work | Claude Code itself | A separate `codex exec` process |
141
+ | Two workers writing one file | No path declaration | `owned_paths` overlap is checked before dispatch and rejected |
142
+ | The main thread dies | The work cannot be collected | Workers and acceptance run to the end; a new window finds them again with `find_works` |
143
+ | Who can drive it | Claude Code only | Any MCP client |
144
+ | Seeing the process | Only the conclusion it returns | Raw JSONL and the web board |
144
145
 
145
- ## 配置和状态
146
+ ## Configuration and state
146
147
 
147
- 状态都在 `~/.agent-supervisor`(从 codex-supervisor-mcp 升上来、已有 `~/.codex-supervisor` 的机器继续用旧目录):`data/supervisor.sqlite` 是台账,`data/runs/<taskId>.jsonl` 是 Codex 的原始输出,`worktrees/<taskId>/` 是各路的工作区。
148
+ Everything lives under `~/.agent-supervisor` (a machine upgraded from codex-supervisor-mcp that already has `~/.codex-supervisor` keeps using it): `data/supervisor.sqlite` is the ledger, `data/runs/<taskId>.jsonl` is Codex's raw output, and `worktrees/<taskId>/` holds each worker's checkout.
148
149
 
149
- | 变量 | 默认 | 作用 |
150
+ | Variable | Default | What it does |
150
151
  |---|---|---|
151
- | `SUPERVISOR_HOME` | `~/.agent-supervisor` | 状态根目录。MCP 和看板要指同一个 |
152
- | `CODEX_BIN` | `codex` | Codex CLI 路径。GUI 客户端的 `PATH` 里常常没有它 |
153
- | `SUPERVISOR_WEB_PORT` | `7877` | 看板端口 |
154
- | `AGENT_SUPERVISOR_NO_AUTO_UPDATE` | 未设 | `1` 关掉后台自动更新,只提醒 |
152
+ | `SUPERVISOR_HOME` | `~/.agent-supervisor` | State root. The MCP server and the board must point at the same one |
153
+ | `CODEX_BIN` | `codex` | Path to the Codex CLI. GUI clients often lack it on `PATH` |
154
+ | `SUPERVISOR_WEB_PORT` | `7877` | Board port |
155
+ | `AGENT_SUPERVISOR_NO_AUTO_UPDATE` | unset | `1` turns off background updates and only notifies |
155
156
 
156
- 其余变量、worker 的六种状态、沙箱默认放开哪些缓存目录,都在[参考手册](docs/reference.md)。
157
+ The remaining variables, the seven worker states and the cache directories the sandbox opens by default are in the [reference](docs/reference.en.md).
157
158
 
158
- 更新不用管。server 启动时后台查一次 registry,有新版就另起进程 `npm i -g`,正在跑的会话不受影响,下一个新会话就是新版。只对全局安装的那份生效。
159
+ Updates take care of themselves. At start the server asks the registry in the background and, if there is a newer version, a detached process runs `npm i -g`. The running session is untouched and the next one starts on the new version. This only applies to a global install.
159
160
 
160
- 卸载:
161
+ Uninstall:
161
162
 
162
163
  ```bash
163
164
  npm uninstall -g agent-supervisor-mcp
@@ -166,42 +167,42 @@ codex mcp remove agent-supervisor
166
167
  rm -rf ~/.claude/skills/agent-supervisor ~/.agents/skills/agent-supervisor ~/.codex/skills/agent-supervisor ~/.agent-supervisor
167
168
  ```
168
169
 
169
- ## 排查
170
+ ## Troubleshooting
170
171
 
171
- | 症状 | 原因 | 处理 |
172
+ | Symptom | Cause | Fix |
172
173
  |---|---|---|
173
- | `claude mcp list` 里没有 | 安装时没跑 `postinstall` | `agent-supervisor-setup` |
174
- | worker 一起来就 `failed`,`spawn codex ENOENT` | 进程 `PATH` 里没有 codex | 设 `CODEX_BIN` |
175
- | `codex only resolved to a shell shim` | Windows 只找到 `.cmd`,包入口没了 | 重装 `@openai/codex`,或 `CODEX_BIN` 指到 `codex.js` |
176
- | `Cannot find module 'node:sqlite'` | Node 低于 22.13.0 | 升 Node |
177
- | worker `lost` | worker 或它的运行进程被杀了 | 查事件,`resume_worker` 接回 |
178
- | worker `timed_out` | 时间预算用完被停掉 | 看已有改动;单轮超时 `resume_worker`,总预算用完用 `followup_of` 带新 `limits` 接续 |
179
- | `git add` 报 `index.lock: Operation not permitted` | 沙箱把 `.git` 设成只读,这是正常边界 | 让 `land_worker` 带 `commit_message` 代提交 |
180
- | `owned_paths overlap with active worker(s)` | 两路认领了同一片路径 | 改拆法,或取消占着的那路 |
181
- | 看板是空的 | 看板和 MCP 的 `SUPERVISOR_HOME` 不一样 | 两边指同一个目录 |
182
- | `port 7877 ... is already in use` | 已经有一个看板在跑 | 直接开它,或换 `SUPERVISOR_WEB_PORT` |
183
-
184
- ## 已知限制
185
-
186
- - worktree 从一个提交切出来,你工作区里没 commit 的东西不在里面。
187
- - 只隔离工作目录。临时目录、数据库、端口是共用的。
188
- - 守卫拦直接写文件,但它不是文件沙箱。你声明放行的脚本可以有清单外的副作用,要靠 land 前的 diff 检查兜住。
189
- - `acceptance` 里写了什么就查什么,没写的不会替你查。剩下的靠主线程看 diff。
190
- - 客户端的 MCP 超时是硬墙,一次 `wait_workers` 等不到底,只能反复调。
191
- - `find_works` 是子串匹配,几百条够用。向量检索不打算做。
192
-
193
- ## 开发
174
+ | Missing from `claude mcp list` | The install did not run `postinstall` | `agent-supervisor-setup` |
175
+ | Worker `failed` at once, `spawn codex ENOENT` | No codex on the process `PATH` | Set `CODEX_BIN` |
176
+ | `codex only resolved to a shell shim` | Windows found only the `.cmd`; the package entry is gone | Reinstall `@openai/codex`, or point `CODEX_BIN` at `codex.js` |
177
+ | `Cannot find module 'node:sqlite'` | Node older than 22.13.0 | Upgrade Node |
178
+ | Worker is `lost` | The worker or its run process was killed | Read the events, then `resume_worker` |
179
+ | Worker is `timed_out` | Its time budget ran out and it was stopped | Read what it left; `resume_worker` after a per-run limit, `followup_of` with new `limits` after the total one |
180
+ | `git add` fails with `index.lock: Operation not permitted` | The sandbox makes `.git` read-only. That is the intended boundary | Let `land_worker` commit with `commit_message` |
181
+ | `owned_paths overlap with active worker(s)` | Two workers claimed the same paths | Split the work differently, or cancel the one holding them |
182
+ | The board is empty | The board and the MCP server use different `SUPERVISOR_HOME` | Point both at the same directory |
183
+ | `port 7877 ... is already in use` | A board is already running | Open that one, or change `SUPERVISOR_WEB_PORT` |
184
+
185
+ ## Known limitations
186
+
187
+ - A worktree is cut from a commit. Uncommitted changes in your checkout are not in it.
188
+ - Only the working directory is isolated. Temp directories, databases and ports are shared.
189
+ - The guard blocks direct file writes, but it is not a filesystem sandbox. A script you allowed can have side effects outside its declared paths; the diff check before landing is what catches them.
190
+ - Acceptance checks what you wrote in `acceptance` and nothing else. The rest is the main thread reading the diff.
191
+ - The client's MCP tool timeout is a hard wall, so one `wait_workers` call cannot wait to the end. Call it again.
192
+ - `find_works` is substring matching, which is enough for a few hundred works. Vector search is not planned.
193
+
194
+ ## Development
194
195
 
195
196
  ```bash
196
197
  npm install
197
- npm test # fake-codex 回放,不到一分钟
198
- npm run test:real # 真 codex CLI 端到端,要先登录
199
- npm run web:dev # 看板开发,/api 代理到 7877
198
+ npm test # fake-codex replay, under a minute
199
+ npm run test:real # real codex CLI end to end; needs a logged-in codex
200
+ npm run web:dev # board development, /api proxied to 7877
200
201
  ```
201
202
 
202
- CI 跑 Ubuntu、macOS、Windows,外加一个 Node 22.13.0 的 job 卡住 `engines` 下界。
203
+ CI runs on Ubuntu, macOS and Windows, plus a Node 22.13.0 job that pins the lower bound of `engines`.
203
204
 
204
- 贡献看 [CONTRIBUTING.md](CONTRIBUTING.md)。安全问题走[私密通道](https://github.com/zriyox/agent-supervisor-mcp/security/advisories/new),见 [SECURITY.md](SECURITY.md)。
205
+ To contribute, read [CONTRIBUTING.en.md](CONTRIBUTING.en.md). Security reports go through the [private channel](https://github.com/zriyox/agent-supervisor-mcp/security/advisories/new); see [SECURITY.md](SECURITY.md).
205
206
 
206
207
  ## License
207
208
 
package/README.ru.md ADDED
@@ -0,0 +1,209 @@
1
+ # agent-supervisor-mcp
2
+
3
+ [English](README.md) | Русский | [中文](README.zh-CN.md)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/agent-supervisor-mcp.svg)](https://www.npmjs.com/package/agent-supervisor-mcp)
6
+ [![npm downloads](https://img.shields.io/npm/dm/agent-supervisor-mcp.svg)](https://www.npmjs.com/package/agent-supervisor-mcp)
7
+ [![license](https://img.shields.io/npm/l/agent-supervisor-mcp.svg)](LICENSE)
8
+ [![CI](https://github.com/zriyox/agent-supervisor-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/zriyox/agent-supervisor-mcp/actions/workflows/ci.yml)
9
+ [![node](https://img.shields.io/badge/node-%3E%3D22.13.0-339933.svg)](package.json)
10
+ [![agent-supervisor-mcp on Glama](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp/badges/score.svg)](https://glama.ai/mcp/servers/zriyox/agent-supervisor-mcp)
11
+
12
+ Сайт [agent-supervisor.zriyo.com](https://agent-supervisor.zriyo.com) · для моделей [llms.txt](https://agent-supervisor.zriyo.com/llms.txt) · [справочник](docs/reference.en.md) (на английском)
13
+
14
+ Если натравить несколько агентов на один репозиторий, они затирают работу друг друга, никто не может сказать, кто что поменял, а контекст основного потока забивается выводом воркеров.
15
+
16
+ agent-supervisor-mcp — это MCP-сервер. Основной поток (Claude Code, Codex или любой MCP-клиент) запускает через него несколько воркеров Codex CLI одновременно: у каждого воркера свой Git worktree, состояние хранится в SQLite, а следить за ними можно на веб-доске. Раздача задач и учёт живут на диске, а не в контексте модели.
17
+
18
+ ![Демо: основной поток Claude Code раздаёт задачи трём воркерам Codex в отдельные worktree, ждёт и сводит результат](https://raw.githubusercontent.com/zriyox/agent-supervisor-mcp/main/assets/demo.gif)
19
+
20
+ *30 секунд, записано вживую: три воркера параллельно в своих worktree, затем основной поток собирает три diff и делает один коммит.*
21
+
22
+ > **Раньше пакет назывался codex-supervisor-mcp.** Его переименовали, потому что воркер теперь не только Codex. Машину со старым пакетом переводит его последний релиз: ставится этот пакет, регистрация MCP и skill становятся `agent-supervisor`, а каталог состояния остаётся на месте. Префикс утилит командной строки меняется с `codex-supervisor-` на `agent-supervisor-`.
23
+ >
24
+ > **Переход с 0.x на 1.x**: 39 инструментов превратились в 14, с новыми именами и аргументами, старые имена не сохранены. Сначала доведите до конца запущенных воркеров, а после обновления откройте сессию заново, чтобы подгрузился новый skill. Таблица инструментов в [справочнике](docs/reference.en.md), что изменилось — в [релизе 1.0.0](https://github.com/zriyox/agent-supervisor-mcp/releases/tag/v1.0.0).
25
+
26
+ ## Что он решает
27
+
28
+ | Проблема | Что он делает |
29
+ |---|---|
30
+ | Воркеры наступают друг другу на файлы | У каждого воркера свой worktree; пересечение `owned_paths` проверяется до запуска |
31
+ | Вывод воркеров заливает основной поток | События пишутся в JSONL; основной поток читает сжатую сводку (все воркеры меньше чем в 7000 байт) |
32
+ | После перезапуска или в новой сессии воркеры теряются | Одна строка SQLite на задачу, с её `thread_id`; `resume_worker` возвращается в ту же сессию Codex |
33
+ | Упавший запуск не отличить от умершего процесса | Машина состояний разделяет `failed` и `lost`, а у сбоя есть источник и код |
34
+ | Воркер говорит, что всё готово, а это не так | Задача уходит с командами `acceptance`; супервизор сам запускает их после выхода воркера и не даёт влить результат, если они упали |
35
+ | Изменения так и остаются в локальной ветке | `land_worker` вливает их в интеграционную ветку; `verify_push` подтверждает, что коммит есть на remote |
36
+ | Worktree копятся | Влитые и пустые удаляются при опросе. Невлитая работа хранится 7 дней, и перед удалением worktree её незакоммиченные правки коммитятся в её ветку. Ветки и доказательства остаются |
37
+
38
+ По умолчанию воркер — это процесс `codex exec`, а `model` передаётся как есть. Основной поток остаётся на Claude, воркеры работают на DeepSeek или другом провайдере, и счета не смешиваются.
39
+
40
+ Воркером может быть и Claude Code: передайте `runner: "claude"` в `create_worker`. У него нет песочницы ОС, поэтому он работает только в git worktree или в режиме только для чтения, и у него нет побочного чата (`ask_worker`); запуск, приёмка, продолжение, вливание и очистка такие же. Как подключить другой CLI, описано в [docs/runner.md](docs/runner.md).
41
+
42
+ ## Пять минут до первой партии
43
+
44
+ Нужны Node.js 22.13.0 или новее и `codex` CLI в `PATH`. Работает на macOS, Linux и Windows.
45
+
46
+ ```bash
47
+ npm install -g agent-supervisor-mcp
48
+ ```
49
+
50
+ Скрипт установки кладёт skill во все найденные Claude Code и Codex и регистрирует MCP-сервер. После этого перезапустите их. Если ничего не зарегистрировалось (например, с `--ignore-scripts`), запустите `agent-supervisor-setup` или добавьте вручную:
51
+
52
+ ```bash
53
+ claude mcp add -s user agent-supervisor -- npx -y agent-supervisor-mcp
54
+ codex mcp add agent-supervisor -- npx -y agent-supervisor-mcp
55
+ ```
56
+
57
+ GUI-клиентам вроде Claude Desktop, Cursor и Windsurf конфигурацию MCP нужно поправить руками; фрагмент есть в [справочнике](docs/reference.en.md#environment-variables). Только skill, без сервера: `npx skills add zriyox/agent-supervisor-mcp`.
58
+
59
+ Дальше скажите в Claude Code обычными словами:
60
+
61
+ > Допиши юнит-тесты для этих трёх модулей. Используй agent-supervisor, три воркера параллельно, назови сессию «юнит-тесты».
62
+
63
+ Skill проведёт основной поток по таким шагам:
64
+
65
+ ```
66
+ preflight_worker сначала пробный запуск в том же окружении
67
+ create_worker ×3 каждому session, owned_paths, goal
68
+ wait_workers не больше 60 секунд за вызов; вызывать снова, пока не закончится
69
+ get_worker ×3 отчёт каждого воркера, с командами, которые он запускал, и их кодами выхода
70
+ get_worker_diff ×3 что он на самом деле поменял
71
+ land_worker ×3 проверено; закоммитить за него и влить
72
+ ```
73
+
74
+ Воркеры никогда не коммитят сами. Их изменения лежат в `worker/<taskId>`, пока основной поток не прочитает diff.
75
+
76
+ Чтобы смотреть, как они работают, откройте доску:
77
+
78
+ ```bash
79
+ agent-supervisor-web # или: npx -p agent-supervisor-mcp agent-supervisor-web
80
+ ```
81
+
82
+ Откройте `http://127.0.0.1:7877`. Там видны воркеры каждой сессии: статус, команда, которая выполняется прямо сейчас, изменения и события. Воркеру можно задать вопрос сбоку: ответ приходит из копии его треда только для чтения, так что текущая работа не прерывается. Доска только показывает. Запускать и отменять воркеров с неё нельзя.
83
+
84
+ ## Как я им пользуюсь
85
+
86
+ Основным потоком может быть всё, что говорит на MCP; это просто мой способ. Я держу две сессии Claude Code: одну для документов, другую для раздачи задач. Одна сессия, которая и пишет проект, и следит за воркерами, забивает контекст за два часа.
87
+
88
+ | Кто | Где | Что делает |
89
+ |---|---|---|
90
+ | Я | | Решаю, что строить, принимаю решения, читаю отчёты |
91
+ | Сессия планирования | Репозиторий требований и документации | Обсуждает требование, пишет проект, пишет по одному брифу на блок работы |
92
+ | Сессия «главного мозга» | Worktree репозитория с кодом | Читает бриф, раздаёт задачи воркерам, проверяет diff, отчитывается мне. Сама бизнес-код не пишет |
93
+ | Воркеры Codex | Свои worktree | Один воркер на функциональный пакет, который можно проверить отдельно. Без коммитов и push |
94
+
95
+ Между двумя сессиями передаётся один блок текста: его вставляют в сессию главного мозга и отдают через `/goal`:
96
+
97
+ ```text
98
+ [Роль] Ты главный мозг: раздаёшь задачи воркерам, проверяешь результат, обновляешь доки, отчитываешься мне.
99
+ Бизнес-код ты не пишешь. Сначала загрузи skill agent-supervisor.
100
+ [Контекст] Зачем нужен этот блок, что осталось от предыдущего
101
+ [Сначала прочти] Какие разделы каких документов и какой главнее, если они расходятся
102
+ [Сделать] Следуй таблице из раздела N брифа. Ничего сверх таблицы
103
+ [Раздача] Сначала find_works, чтобы ничего не запустить дважды; один session.id на партию;
104
+ параллельно только при непересекающихся наборах файлов; команда проверки идёт и в acceptance;
105
+ словам воркера не верить, верить diff, который ты прочитал
106
+ [Красные линии] Что не менять, не пушить и не читать
107
+ [Отчёт] Сначала таблицы, потом остановись и жди меня
108
+ ```
109
+
110
+ ## Инструменты
111
+
112
+ По умолчанию их четырнадцать. Аргументы и пограничные случаи — в [справочнике](docs/reference.en.md#tools).
113
+
114
+ | Этап | Инструмент | Что делает |
115
+ |---|---|---|
116
+ | До запуска | `preflight_worker` | Запускает короткую пробу в окружении будущего воркера или сначала по-настоящему прогоняет команды приёмки |
117
+ | Запуск | `create_worker` | Запускает одного воркера. С `followup_of` продолжает работу другого воркера |
118
+ | | `resume_worker` | Продолжает ту же сессию, при желании сначала перебазировав её на новую голову |
119
+ | | `cancel_worker` | Останавливает воркера |
120
+ | Наблюдение | `poll_workers` | Без курсора — вся таблица; с курсором — только то, что изменилось, плюс восстановление умершего первого запуска и удаление worktree, которые можно удалить безопасно |
121
+ | | `wait_workers` | Ждёт результата, не больше 60 секунд за вызов |
122
+ | Сбор результата | `get_worker` | Читает одного воркера: сводку, отчёт, статус, события, цель — какие части попросите |
123
+ | | `get_worker_diff` | Реальные изменения, постранично по файлам и hunk |
124
+ | | `ask_worker` | Задаёт воркеру вопрос сбоку. Только чтение; его тред не трогается |
125
+ | Сдача | `land_worker` | Коммитит за воркера и делает cherry-pick в интеграционную ветку; отказывает, если приёмка упала |
126
+ | | `verify_push` | Подтверждает, что влитый коммит есть на remote. Только проверяет, сам за вас не пушит |
127
+ | | `cleanup` | Показывает, почему worktree ещё на месте, или удаляет его сразу. Обычно очистка идёт сама |
128
+ | Партии | `find_works` | Снова находит партию или ищет по истории подстрокой |
129
+ | | `describe_session` | Записывает название партии, цель, приёмку по умолчанию и статус согласования |
130
+
131
+ Ещё три регистрируются только с `AGENT_SUPERVISOR_TOOLS=all`: `facts` (реестр проверенных фактов), `review` (независимый проверяющий только для чтения) и `get_artifact` (сохранённые доказательства). Обычной партии они не нужны, а без них в каждой сессии экономится контекст.
132
+
133
+ ## Чем это отличается от subagent в Claude Code
134
+
135
+ Subagent тоже может открыть свой worktree, так что разница не в изоляции файлов. Разница в модели и процессе.
136
+
137
+ | | Subagent Claude Code | Воркер agent-supervisor |
138
+ |---|---|---|
139
+ | Какие модели | Только Claude | Любые, для которых у Codex CLI есть провайдер |
140
+ | Кто выполняет работу | Сам Claude Code | Отдельный процесс `codex exec` |
141
+ | Два воркера пишут один файл | Пути не объявляются | Пересечение `owned_paths` проверяется до запуска, и запуск отклоняется |
142
+ | Основной поток умер | Результат не забрать | Воркеры и приёмка доходят до конца; новое окно снова находит их через `find_works` |
143
+ | Кто может управлять | Только Claude Code | Любой MCP-клиент |
144
+ | Видно ли процесс | Только итоговый вывод | Сырой JSONL и веб-доска |
145
+
146
+ ## Настройка и состояние
147
+
148
+ Всё лежит в `~/.agent-supervisor` (машина, обновлённая с codex-supervisor-mcp, у которой уже есть `~/.codex-supervisor`, продолжает пользоваться им): `data/supervisor.sqlite` — это реестр, `data/runs/<taskId>.jsonl` — сырой вывод Codex, а в `worktrees/<taskId>/` лежит рабочая копия каждого воркера.
149
+
150
+ | Переменная | По умолчанию | Что делает |
151
+ |---|---|---|
152
+ | `SUPERVISOR_HOME` | `~/.agent-supervisor` | Корень состояния. MCP-сервер и доска должны смотреть в один и тот же |
153
+ | `CODEX_BIN` | `codex` | Путь к Codex CLI. У GUI-клиентов его часто нет в `PATH` |
154
+ | `SUPERVISOR_WEB_PORT` | `7877` | Порт доски |
155
+ | `AGENT_SUPERVISOR_NO_AUTO_UPDATE` | не задана | `1` выключает фоновые обновления, остаются только уведомления |
156
+
157
+ Остальные переменные, семь состояний воркера и каталоги кэша, которые песочница открывает по умолчанию, — в [справочнике](docs/reference.en.md).
158
+
159
+ Обновления происходят сами. При старте сервер в фоне спрашивает реестр npm и, если есть версия новее, отдельный процесс запускает `npm i -g`. Текущая сессия не затрагивается, следующая стартует уже на новой версии. Это работает только для глобальной установки.
160
+
161
+ Удаление:
162
+
163
+ ```bash
164
+ npm uninstall -g agent-supervisor-mcp
165
+ claude mcp remove -s user agent-supervisor
166
+ codex mcp remove agent-supervisor
167
+ rm -rf ~/.claude/skills/agent-supervisor ~/.agents/skills/agent-supervisor ~/.codex/skills/agent-supervisor ~/.agent-supervisor
168
+ ```
169
+
170
+ ## Если что-то не так
171
+
172
+ | Симптом | Причина | Что сделать |
173
+ |---|---|---|
174
+ | Нет в `claude mcp list` | Установка не запустила `postinstall` | `agent-supervisor-setup` |
175
+ | Воркер сразу `failed`, `spawn codex ENOENT` | В `PATH` процесса нет codex | Задайте `CODEX_BIN` |
176
+ | `codex only resolved to a shell shim` | Windows нашла только `.cmd`, точки входа пакета нет | Переустановите `@openai/codex` или направьте `CODEX_BIN` на `codex.js` |
177
+ | `Cannot find module 'node:sqlite'` | Node старше 22.13.0 | Обновите Node |
178
+ | Воркер в состоянии `lost` | Воркер или его процесс запуска убили | Прочитайте события, затем `resume_worker` |
179
+ | Воркер в состоянии `timed_out` | Кончился бюджет времени, и его остановили | Посмотрите, что он оставил; после лимита на один запуск — `resume_worker`, после общего лимита — `followup_of` с новыми `limits` |
180
+ | `git add` падает с `index.lock: Operation not permitted` | Песочница делает `.git` доступным только для чтения. Так и задумано | Пусть коммитит `land_worker` с `commit_message` |
181
+ | `owned_paths overlap with active worker(s)` | Два воркера заняли одни и те же пути | Разделите работу иначе или отмените того, кто их держит |
182
+ | Доска пустая | У доски и MCP-сервера разные `SUPERVISOR_HOME` | Направьте оба в один каталог |
183
+ | `port 7877 ... is already in use` | Доска уже запущена | Откройте её или поменяйте `SUPERVISOR_WEB_PORT` |
184
+
185
+ ## Известные ограничения
186
+
187
+ - Worktree нарезается из коммита. Незакоммиченных изменений из вашей рабочей копии в нём нет.
188
+ - Изолирован только рабочий каталог. Временные каталоги, базы данных и порты общие.
189
+ - Защита блокирует прямую запись файлов, но это не файловая песочница. Разрешённый вами скрипт может что-то сделать за пределами объявленных путей; это ловит проверка diff перед вливанием.
190
+ - Приёмка проверяет то, что вы написали в `acceptance`, и больше ничего. Остальное — это основной поток, читающий diff.
191
+ - Таймаут MCP-инструмента у клиента — жёсткая стена, поэтому один вызов `wait_workers` не может ждать до конца. Вызовите его снова.
192
+ - `find_works` ищет по подстроке, этого хватает на несколько сотен задач. Векторный поиск не планируется.
193
+
194
+ ## Разработка
195
+
196
+ ```bash
197
+ npm install
198
+ npm test # прогон на fake-codex, меньше минуты
199
+ npm run test:real # настоящий codex CLI от начала до конца; нужен залогиненный codex
200
+ npm run web:dev # разработка доски, /api проксируется на 7877
201
+ ```
202
+
203
+ CI работает на Ubuntu, macOS и Windows, плюс отдельная задача на Node 22.13.0, которая фиксирует нижнюю границу `engines`.
204
+
205
+ Чтобы внести вклад, прочитайте [CONTRIBUTING.en.md](CONTRIBUTING.en.md). Сообщения о проблемах безопасности — через [закрытый канал](https://github.com/zriyox/agent-supervisor-mcp/security/advisories/new); подробнее в [SECURITY.md](SECURITY.md).
206
+
207
+ ## Лицензия
208
+
209
+ MIT