dsh-leader-agent 0.6.0 → 0.7.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/.agents/skills/e2e-scenarios/SKILL.md +3 -1
- package/.agents/skills/leader-mode/SKILL.md +1 -1
- package/.agents/skills/leader-mode/playbooks/program.md +1 -1
- package/.agents/skills/leader-mode/references/parallel.md +1 -1
- package/README.md +6 -6
- package/README_ZH.md +6 -6
- package/THIRD_PARTY_LICENSE +7 -7
- package/lib/client.js +2287 -676
- package/locale/de.json +134 -0
- package/locale/en.json +128 -0
- package/locale/es.json +134 -0
- package/locale/fr.json +134 -0
- package/locale/ja.json +134 -0
- package/locale/pt.json +134 -0
- package/locale/ru.json +134 -0
- package/locale/zh.json +128 -0
- package/package.json +17 -4
- package/src/client/agent-bubble-styles.js +31 -1
- package/src/client/agent-bubble-view.js +42 -17
- package/src/client/board-card.js +18 -16
- package/src/client/board-projection.js +6 -2
- package/src/client/board-styles.js +11 -41
- package/src/client/board.js +31 -23
- package/src/client/bubble-clock.js +10 -6
- package/src/client/card-detail-view.js +8 -11
- package/src/client/card-detail.js +12 -11
- package/src/client/card-links-editor.js +27 -15
- package/src/client/index.js +59 -8
- package/src/client/leader-changes-anchor.js +51 -0
- package/src/client/leader-changes.js +150 -0
- package/src/client/leader-view-logic.js +2 -1
- package/src/client/leader-view.js +1 -1
- package/src/client/locales.generated.js +1028 -0
- package/src/client/locales.js +27 -35
- package/src/client/main-panel.js +73 -0
- package/src/client/markdown.js +34 -11
- package/src/client/project-changes.js +2 -1
- package/src/client/project-panel-logic.js +24 -17
- package/src/client/project-panel.js +47 -45
- package/src/client/project-remote.js +56 -29
- package/src/client/project-section.js +25 -18
- package/src/client/ready-signal.js +1 -1
- package/src/client/session-tabs-logic.js +20 -6
- package/src/client/session-tabs.js +139 -53
- package/src/client/session-watermark.js +10 -6
- package/src/client/signal-styles.js +56 -0
- package/src/client/toast-view.js +1 -0
- package/src/client/worker-report-avatar.js +243 -51
- package/src/client/worker-report-view.js +4 -2
- package/src/client/worker-task-view.js +8 -7
- package/src/host/cards/card-context.js +1 -1
- package/src/host/cards/store.js +24 -5
- package/src/host/dispatch.js +115 -20
- package/src/host/index.js +17 -4
- package/src/host/projects/remote.js +4 -1
- package/src/host/projects/store.js +1 -2
- package/src/host/skills.js +1 -1
- package/src/host/tools/cards.js +54 -9
- package/src/host/tools/gate.js +17 -12
- package/src/host/tools/spawn-worker.js +1 -1
- package/src/host/worker-registry.js +52 -5
- package/src/shared/card-links.js +6 -6
|
@@ -33,7 +33,9 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
|
|
|
33
33
|
|
|
34
34
|
## 失败诊断
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
操作面(单场景入口、`e2e:report`、负载卫生、已知 flake、超时口径与取证路径)见 [docs/e2e-testing.md 的跑法与失败处理](https://github.com/fengshenx/dsh-leader-agent/blob/main/docs/e2e-testing.md#跑法与失败处理);本节只讲判据,不重复命令。
|
|
37
|
+
|
|
38
|
+
1. **先看耗时**:单场景约 10–15 秒,全量按场景数累加。跑了一分钟还没结束,先怀疑某个等待在等不会出现的元素(典型:`lib/client.js` 没构建、会话行没渲染),不是机器慢。别用 `grep` / `head` 过滤输出,`TimeoutError` 里的 locator 就是线索。报错头是「等待失败:…」而不是「等待超时」时,先看页面或浏览器是不是已经关掉、崩了——那不是选择器的问题。测试级上限 90 秒(`scenarioTimeout()`,随 `E2E_BUDGET_SCALE` 放大);清理链上实例与 mock 卡住会变成带名字的失败,浏览器关闭超时只告警并继续。
|
|
37
39
|
2. 先看 `problems`(pageerror / console.error)。本仓出过「圆点不亮」查不出原因的情况,根因是三处空 `catch`:保留会话失败、订阅就绪失败,全都吞掉,界面上只剩一个空心圈。失败必须报告,且同一目标只报一次。
|
|
38
40
|
3. **构建过了也可能坏**:改过 `src/client/` 里的 CSS 就先跑 `plugin.e2e.js` 冒烟。`STYLE_TEXT` 这类模板字符串里混进反引号会当场截断模板,剩余正文被当成 JS 表达式,产物里留下未定义标识符——插件在 import 期抛错、整页白屏,症状与「没构建」一模一样(每个等待都超时),而 `node --check`、单测与覆盖率门禁全绿,它们都不做模块求值。冒烟只验「插件能不能挂载」,3–6 秒,红了不必等全套跑完;`problems` 里的原文形如 `dsh-leader-agent: import failed: <标识符> is not defined`。
|
|
39
41
|
4. 看 `instance.logs`(子进程 stdout/stderr 全量)与 `mock.requests`:模型请求到底有没有发出来、打到哪个端点、带没带标记。
|
|
@@ -83,7 +83,7 @@ worker 的工作目录强制是项目目录:leader 不能指定 worker 的 cwd
|
|
|
83
83
|
|
|
84
84
|
## 派工与接收
|
|
85
85
|
|
|
86
|
-
派工用 `spawn_worker`:它建一个常驻 worker 会话并立即返回会话 id,worker 那一轮结束时自动唤醒你并附完成通知与产物摘要(它不需要、也没有「报告完成」这类工具),同一轮可连派多个工。worker 是普通会话——人能在项目树里打开它直接聊,那种轮次不经过你,也不会唤醒你。**worker 的入口只有三个**:`spawn_worker`(派工)、`message_worker`(续聊与改名:`sessionId` + `message` 必填,可选 `rename`)、`read_worker_session`(回看它的会话回合:任务、正文、调过哪些工具、哪一步失败与原因;只读、不唤醒 worker——排查「为什么慢/为什么错」先用它,不要为此让 worker 再跑一轮)。宿主的 `list_agents` / `send_message` / `interrupt_agent` 认的是宿主 subagent 体系,看不到也投不到我们的 worker
|
|
86
|
+
派工用 `spawn_worker`:它建一个常驻 worker 会话并立即返回会话 id,worker 那一轮结束时自动唤醒你并附完成通知与产物摘要(它不需要、也没有「报告完成」这类工具),同一轮可连派多个工。worker 是普通会话——人能在项目树里打开它直接聊,那种轮次不经过你,也不会唤醒你。**worker 的入口只有三个**:`spawn_worker`(派工)、`message_worker`(续聊与改名:`sessionId` + `message` 必填,可选 `rename`)、`read_worker_session`(回看它的会话回合:任务、正文、调过哪些工具、哪一步失败与原因;只读、不唤醒 worker——排查「为什么慢/为什么错」先用它,不要为此让 worker 再跑一轮)。宿主的 `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` 认的是宿主 subagent 体系,看不到也投不到我们的 worker(这四件已从你的工具面摘掉;`wait_agent` 只会阻塞空等,worker 跑完会自己唤醒你)。worker 跑偏时用 `message_worker` 把纠偏指令 steer 进它当前轮次(正在跑就插进下一步,不是另起一轮);没有中止手段,真卡死才请人去那个会话里处理。卡片用 `create_card`、`update_card`、`list_cards`,建卡与改卡可带 `kind` 给卡面分类(同一项目用同一套短标签,空串清除),改卡带 `expectedRevision` 做乐观并发——这个版本号从 `list_cards` 的列表里读(每行都带 `revision`),要读某张卡的规格与链接全文就传 `cardId` 单卡查询。完整对应见 [leader 动作与工具](playbooks/program.md#leader-动作与工具)。
|
|
87
87
|
|
|
88
88
|
派工确保原简报、后续指令、实际产物与版本均可沿指针完整恢复,不依赖「done」摘要继承变更。按 [leader 传话纪律](playbooks/program.md#输出与传话纪律)保留边界与验收,已落盘正文不抄入派单。按宿主与任务权限使用 worker;现有 owner 与 worktree 状态能可信恢复时续跑,新上下文更合适时新派,不能丢原约束。停止/恢复遵守用户指令与宿主契约;能力不可用明确 limitation,不声称多模型独立评估。
|
|
89
89
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
|
|
27
27
|
worker 是常驻根会话,人可以在项目树里打开它直接下钻对话。**人自己聊的那几轮你要当没发生**:它不会唤醒你,也不会给你完成通知;除非用户回来让你接着推进,否则不要凭猜测去追问它在聊什么。
|
|
28
28
|
|
|
29
|
-
worker 的一切交互只有 `spawn_worker`、`message_worker` 与只读的 `read_worker_session` 三个入口。宿主的 `list_agents` / `send_message` / `interrupt_agent` 只认宿主 subagent 体系:我们的 worker
|
|
29
|
+
worker 的一切交互只有 `spawn_worker`、`message_worker` 与只读的 `read_worker_session` 三个入口。宿主的 `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` 只认宿主 subagent 体系:我们的 worker 是普通根会话,不在它们的子会话名录里,传话、中止与等待都落不到它身上(这四件已从你的工具面摘掉)。worker 跑偏时用 `message_worker` 把纠偏指令 steer 进当前轮次(正在跑就插进下一步);没有中止手段,真卡死了才请人去那个会话里处理。宿主另有同伴模型的一套同名工具,按成员名寻址,与本流程的 worker 不是同一批,同样不要混用。
|
|
30
30
|
|
|
31
31
|
worker 连续 15 分钟没有任何回报时,机制侧会注入一条带 **`【后台巡查】`** 前缀的例行检查提醒(与完成通知同一条通道,但正文自带前缀与会话 id,不是 worker 的回报;不一定是卡住,也不代表任务失败)。收到后先 `read_worker_session` 回看它最近几轮卡在哪一步,再决定继续等待、用 `message_worker` 纠偏,还是请人在它的会话里处理;不要因为收到提醒就重复追问或重派同一件活。提醒每 15 分钟至多一条,本流程仍没有中止手段。
|
|
32
32
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
用当前宿主提供的卡片工具和 `git worktree list` 核对任务指针;开发 worktree 以 git 名录与项目约定的 worktree 目录为准,不维护盘上注册表。执行者活性以宿主为准,PR/CI 以代码托管平台为准。名录不是任务内容或完成证明。
|
|
8
8
|
|
|
9
|
-
用户授权协调既有执行者后才投递消息。派工、回派与暂停都走本 bundle 的 `message_worker`(`sessionId` + `message`),不用别的消息工具猜会话 id——宿主的 `list_agents` / `send_message` / `interrupt_agent` 只认宿主 subagent 体系,本 bundle 的 worker 是普通会话,它们看不到、也投不到。
|
|
9
|
+
用户授权协调既有执行者后才投递消息。派工、回派与暂停都走本 bundle 的 `message_worker`(`sessionId` + `message`),不用别的消息工具猜会话 id——宿主的 `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` 只认宿主 subagent 体系,本 bundle 的 worker 是普通会话,它们看不到、也投不到。
|
|
10
10
|
|
|
11
11
|
派活绑定卡槽位,不按「谁空闲」:投递前用查卡工具确认任务挂在哪张卡、槽位上是谁,只派给那张卡的槽位执行者——空闲不等于可派,一会话一时只服务一张卡的一个槽位。**挂着未完成卡的 worker 不能接别的工作**(投递门禁只放行同卡续跑):先把它手上的卡标 `done` 或归档,槽位会自动释放,worker 才能接新任务。**同时挂多张 `active` 卡**(整卡替换 `slots` 时会造出来)一律拒绝投递,与声明哪张卡无关——先关掉多余的卡收敛到一张。`idle` 不等于有人可派:卡槽位与看板信号都看不出「被用户停止」,停用会话状态即 idle。不做事前判断,**投递即探测**:`message_worker` 失败后按错误信息判——报「没有派工记录」说明该会话已撤销(归档会摘掉登记),视作死槽,用 `update_card` 把该槽位改派给新会话;其余错误是普通失败,照常上报,不动槽位。
|
|
12
12
|
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-en-dark.svg">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-en.svg" alt="dsh-leader-agent: a Leader fanning out
|
|
4
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-en.svg" alt="dsh-leader-agent: a Leader keystone fanning out into parallel worker tracks" width="460">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<strong>English</strong> | <a href="README_ZH.md">简体中文</a>
|
|
9
|
+
<strong>English</strong> | <a href="README_ZH.md">简体中文</a> | <a href="https://fengshenx.github.io/dsh-leader-agent/">Website</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
### Desktop install (DeepSeek Harness Desktop)
|
|
41
41
|
|
|
42
|
-
Desktop uses its own profile (`$DSH_HOME/profiles/desktop`), separate from `web`.
|
|
42
|
+
Desktop uses its own profile (`$DSH_HOME/profiles/desktop`), separate from `web`. The **delivery board is a web-profile feature**; the desktop profile loads the plugin without it.
|
|
43
43
|
|
|
44
44
|
**GUI install:** open **Plugins** in the left sidebar, click **Add plugin** in the top right, type `dsh-leader-agent` and click **Install**:
|
|
45
45
|
|
|
@@ -100,7 +100,7 @@ Three mechanisms make this more than "a smarter prompt":
|
|
|
100
100
|
- **Identity decides the tool surface.** The Leader gets `spawn_worker` / `message_worker`; workers don't. The host trims the tool surface when a session is created — the model is not trusted to hold back.
|
|
101
101
|
- **Completion is settled by the runtime, which wakes the Leader.** When a worker's turn ends, the Leader receives a report (rendered as the worker speaking), with no polling from the Leader and no submit step from the worker.
|
|
102
102
|
- **Workers are persistent root sessions.** Several run at once, you can open any of them and keep the conversation going, and they cold-resume after a restart. The cost: the Leader cannot stop one, see [Current limitations](#current-limitations).
|
|
103
|
-
- **Project sessions get a tab bar.** The project name is the Leader tab; workers you open join it with a live status light. Closing a tab only drops the shortcut — the session stays in the project tree.
|
|
103
|
+
- **Project sessions get a tab bar.** The project name is the Leader tab; workers you open join it with a live status light. The bar's right end carries the session **More** menu and the right-panel toggle, so the close control stays put. Closing a tab only drops the shortcut — the session stays in the project tree.
|
|
104
104
|
|
|
105
105
|
## Design trade-offs
|
|
106
106
|
|
|
@@ -116,7 +116,7 @@ Three mechanisms make this more than "a smarter prompt":
|
|
|
116
116
|
1. **Add a project.** In the left sidebar's Projects section, click Add project and pick a directory. The project is created immediately and bound to a leader session; clicking the project row opens that Leader. Selection comes in two layers: the whole row only lights up for the current Leader session, while opening a worker lights the row-start glyph and puts the row highlight on that worker's own session row. The slot at the row start shows the host's `apps-add-outline` glyph by default (three cells plus a plus sign; it replaces the host's folder icon so projects and workspaces are not the same shape in the sidebar): while the Leader is running it becomes a spinner (the Leader has no row of its own, so this holds whether the project is expanded or collapsed), and when the project is collapsed with a worker running under it, it becomes a spinner too — once expanded, each worker carries its own spinner.
|
|
117
117
|
2. **Load the protocol.** In the leader session, have the model load `leader-mode`. It reads `playbooks/program.md` first, then the playbook for the current stage.
|
|
118
118
|
3. **Dispatch.** `spawn_worker` requires `name` (a short role-task handle); `cardId` + `slot` optionally bind the card's executor slot in the same call. It returns a session id immediately and the worker has **not started yet**. Deliver the task body with `message_worker` (`sessionId` + `message`, optionally `rename`): the first message is what starts the turn, and a card-bound worker gets the card facts added to its request automatically, so you do not need to paste the spec. The worker's sandbox mode and approval policy are inherited from the Leader at dispatch time (an Auto Leader also passes on its review gate); the receipt states the permissions the worker actually runs with, and calls out full access by name. To see how it went about this turn — which tools it called, where it failed — use `read_worker_session` on it; that does not wake the worker.
|
|
119
|
-
4. **Record task facts.** `create_card` opens a card (`title` required), `update_card` edits one (content changes carry `expectedRevision` for optimistic concurrency; links can be replaced wholesale with `links` or merged by id with `addLinks`), `list_cards` reads them. Cards belong to a project and are numbered globally; edits across projects are refused. `list_cards` and `create_card` are the Leader's alone, and plain sessions get neither; `update_card` is shared with workers. A worker may only edit a card it is bound to, and only derived fields such as `links` — `title` / `spec` / `status` / `kind` / `sortOrder` / `slots` belong to the Leader (the first two are the acceptance anchor and injected content, the rest organize the board and decide who executes). `read_card` is the worker's alone: it reads any card in the project, and with no `cardId` / `number` it reads the worker's single bound card — the way back to its task after compaction or a stale injection. Long specs come in 2000-character pages via `specOffset`.
|
|
119
|
+
4. **Record task facts.** `create_card` opens a card (`title` required), `update_card` edits one (content changes carry `expectedRevision` for optimistic concurrency; links can be replaced wholesale with `links` or merged by id with `addLinks`), `list_cards` reads them. Links are deliverable entry points — PRs, issues, docs, assets — not comment or inline-comment anchors (`#issuecomment-` / `#discussion_r` / `#pullrequestreview-`). Comments are process evidence; write them in the report body. Cards belong to a project and are numbered globally; edits across projects are refused. `list_cards` and `create_card` are the Leader's alone, and plain sessions get neither; `update_card` is shared with workers. A worker may only edit a card it is bound to, and only derived fields such as `links` — `title` / `spec` / `status` / `kind` / `sortOrder` / `slots` belong to the Leader (the first two are the acceptance anchor and injected content, the rest organize the board and decide who executes). `read_card` is the worker's alone: it reads any card in the project, and with no `cardId` / `number` it reads the worker's single bound card — the way back to its task after compaction or a stale injection. Long specs come in 2000-character pages via `specOffset`.
|
|
120
120
|
5. **Watch the board.** The Board tab in the right panel pulls cards for the project of the current session. It opens by itself when the leader creates a card; click a card for details (links editable, the card deletable, the rest read-only), click a slot chip to open the executor's session.
|
|
121
121
|
|
|
122
122
|
## Orchestration lives in files
|
|
@@ -146,7 +146,7 @@ Running ten features in parallel requires real isolation between tasks: one work
|
|
|
146
146
|
## Current limitations
|
|
147
147
|
|
|
148
148
|
- **Background orchestration needs a long-lived host** (web / desktop / sdk). headless is a one-shot CLI: the session is destroyed when the turn ends, and nothing is left to receive completion reports.
|
|
149
|
-
- **The Leader can steer a worker but cannot cancel one.** Workers are ordinary root sessions, so the host's `list_agents` / `send_message` / `interrupt_agent` do not apply to them (`interrupt_agent` even returns a false success). A worker that goes off track is steered with `message_worker`: the message is injected into the next step of its current turn. There is no cancel — the host's `Agent.cancel()` is not exposed as a tool here — so a wedged worker needs a human in its own session. You can read what it is doing (`read_worker_session`, read-only, no wake-up).
|
|
149
|
+
- **The Leader can steer a worker but cannot cancel one.** Workers are ordinary root sessions, so the host's `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` do not apply to them (`interrupt_agent` even returns a false success; `wait_agent` only blocks). A worker that goes off track is steered with `message_worker`: the message is injected into the next step of its current turn. There is no cancel — the host's `Agent.cancel()` is not exposed as a tool here — so a wedged worker needs a human in its own session. You can read what it is doing (`read_worker_session`, read-only, no wake-up).
|
|
150
150
|
- **Completion reports depend on the turn ending normally.** If the process dies before a worker finishes, that turn is never settled. After a restart, open the worker session and continue there.
|
|
151
151
|
- **The board only shows for project sessions.** The leader and that project's workers see it; an ordinary session in the same directory, or a retired leader, only gets a notice, and sessions outside any project get no board at all.
|
|
152
152
|
- **The session tab bar is a DOM overlay, not a native host feature.** It is inserted above the conversation header; per-project tab state lives in browser localStorage and does not travel with the data root.
|
package/README_ZH.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
3
|
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-zh-dark.svg">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-zh.svg" alt="dsh-leader-agent:Leader
|
|
4
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/logo-zh.svg" alt="dsh-leader-agent:Leader 节点扇出三条并行执行轨" width="460">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
|
-
<a href="README.md">English</a> | <strong>简体中文</strong>
|
|
9
|
+
<a href="README.md">English</a> | <strong>简体中文</strong> | <a href="https://fengshenx.github.io/dsh-leader-agent/">官网</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
12
|
<p align="center">
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
|
|
40
40
|
### 桌面版安装(DeepSeek Harness Desktop)
|
|
41
41
|
|
|
42
|
-
桌面版用独立 profile(`$DSH_HOME/profiles/desktop`),与上面的 `web`
|
|
42
|
+
桌面版用独立 profile(`$DSH_HOME/profiles/desktop`),与上面的 `web` 互不相通。**交付看板是 `web` profile 的功能**,桌面版装的是插件本体,没有看板。
|
|
43
43
|
|
|
44
44
|
**图形界面安装**:左侧 SidePanel 打开「插件」,点右上角「添加插件」,在包名框填 `dsh-leader-agent` 后点「安装」:
|
|
45
45
|
|
|
@@ -100,7 +100,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
100
100
|
- **身份决定工具面**:Leader 拿得到 `spawn_worker` / `message_worker`,worker 拿不到;工具面在会话创建时由宿主裁剪,不是靠提示词约束模型。
|
|
101
101
|
- **完成由机制结算并自动唤醒**:worker 那一轮结束时,Leader 自动收到一条回报(渲染成 worker 的发言气泡),不轮询、不靠 worker 自觉。
|
|
102
102
|
- **worker 是常驻根会话**:能同时跑多个,人可以直接打开它的会话接着聊,进程重启后能冷恢复。代价是 Leader 侧不能强杀它,见[当前限制](#当前限制)。
|
|
103
|
-
- **项目会话有标签栏**:第一个标签是项目名(Leader 入口),点开的 worker
|
|
103
|
+
- **项目会话有标签栏**:第一个标签是项目名(Leader 入口),点开的 worker 带着状态灯加入;栏右端是会话「更多」与右栏开关。关标签只丢快捷方式,会话仍在项目树里。
|
|
104
104
|
|
|
105
105
|
## 设计取舍
|
|
106
106
|
|
|
@@ -116,7 +116,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
116
116
|
1. **加项目**:左栏「项目」区块点「加项目」,选一个目录。项目当场建好并绑定一个 leader 会话;点项目行就是打开这个 Leader。当前会话属于该项目时左栏按两层回执:打开的是 leader 会话则项目行整行亮,打开的是它派出的 worker 则项目行只点亮行首应用格子、选中态落在那个 worker 自己的会话行上。行首槽位平时是应用格子图标(宿主 `apps-add-outline`:三格 + 一个加号;替掉宿主的目录图标,免得侧边栏里「项目」和「工作区」同形),活动提示看 leader:它在跑就换成加载圈(leader 没有自己的行,项目展开着也照换),项目收起时名下有 worker 在跑也换成加载圈,展开后 worker 由会话行自己带加载圈。
|
|
117
117
|
2. **加载协议**:leader 会话里让模型加载 `leader-mode`,先读 `playbooks/program.md`,再按阶段读对应 playbook。
|
|
118
118
|
3. **派工**:`spawn_worker` 只要求 `name`(角色-任务短名),可带 `cardId` + `slot` 一次把卡槽位绑好;工具立即返回会话 id,此时 worker **还没开工**。用 `message_worker` 投递任务正文(`sessionId` + `message`,可顺手 `rename`),第一条消息才开工;挂卡 worker 的请求会自动带上卡片事实,消息里不必抄 spec。worker 的沙箱模式与审批策略在派工那一刻从 leader 继承(leader 是 Auto 时连审查门一起继承),回执里写明它实际以什么权限在跑,完全权限会被点名。要看它这一轮怎么做的(调了哪些工具、哪步失败),用 `read_worker_session` 回看,不必唤醒它。
|
|
119
|
-
4. **记任务事实**:`create_card` 建卡(`title` 必填),`update_card` 改卡(改内容带 `expectedRevision` 做乐观并发;链接可用 `links` 整体替换,或用 `addLinks` 按 id 增量追加),`list_cards`
|
|
119
|
+
4. **记任务事实**:`create_card` 建卡(`title` 必填),`update_card` 改卡(改内容带 `expectedRevision` 做乐观并发;链接可用 `links` 整体替换,或用 `addLinks` 按 id 增量追加),`list_cards` 查卡。链接只挂 PR / Issue / 文档 / 成片这类交付物入口,不挂评论或行内评论的锚点(`#issuecomment-` / `#discussion_r` / `#pullrequestreview-`);评论是过程证据,写进回报正文。卡片按项目归属、编号全局递增,跨项目改卡会被拒绝。`list_cards` 与 `create_card` 只给 leader,普通会话一件也没有;`update_card` leader 与 worker 都有。worker 只能改自己挂着的卡,且只能挂 `links` 这类派生字段:`title` / `spec` / `status` / `kind` / `sortOrder` / `slots` 都归 leader(前两者是验收锚点与注入内容,其余组织看板并决定谁在执行)。`read_card` 只给 worker:读本项目的任意卡,不传 `cardId` / `number` 时读自己唯一绑定的卡——压缩或注入失效后找回任务的入口;长规格按 2000 字符分页,用 `specOffset` 续读。
|
|
120
120
|
5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip 打开执行者会话。
|
|
121
121
|
|
|
122
122
|
## 编排:把规则写进文件
|
|
@@ -146,7 +146,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
146
146
|
## 当前限制
|
|
147
147
|
|
|
148
148
|
- **后台编排只适用于长驻组合**(web / desktop / sdk)。headless 是一次性 CLI,会话在 turn 结束后即销毁,没有载体接收完成通知。
|
|
149
|
-
- **Leader 能纠偏、但不能中止 worker**:worker 是普通根会话,宿主的 `list_agents` / `send_message` / `interrupt_agent` 对它无效(`interrupt_agent`
|
|
149
|
+
- **Leader 能纠偏、但不能中止 worker**:worker 是普通根会话,宿主的 `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` 对它无效(`interrupt_agent` 会返回假成功,`wait_agent` 只会阻塞空等)。跑偏了用 `message_worker` 把纠偏指令 steer 进它当前轮次(正在跑就插下一步);没有中止手段——宿主的 `Agent.cancel()` 没被接成工具,真卡死只能请人去那个会话处理。能读它的会话过程(`read_worker_session`,只读、不唤醒)。
|
|
150
150
|
- **完成回报依赖轮次正常结束**:进程在 worker 跑完前被杀,那一轮不结算;重启后自己打开 worker 会话看或续聊。
|
|
151
151
|
- **看板只对项目会话展示**:leader 与该项目的 worker 能看到;同目录的普通会话与已换下的 leader 只看到提示,不属于任何项目的会话也没有看板。
|
|
152
152
|
- **会话标签栏是 DOM 注入,不是宿主原生能力**:它插在会话头之上,标签状态按项目存在浏览器 localStorage,不随数据根迁移。
|
package/THIRD_PARTY_LICENSE
CHANGED
|
@@ -7,16 +7,16 @@
|
|
|
7
7
|
|
|
8
8
|
## 随客户端产物分发的第三方代码
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### blobatar 2.7.0(MIT)
|
|
11
11
|
|
|
12
|
-
- 来源:https://github.com/
|
|
13
|
-
- 版权:Copyright (c)
|
|
14
|
-
- 用途:worker / leader
|
|
12
|
+
- 来源:https://github.com/Alain00/blobatar
|
|
13
|
+
- 版权:Copyright (c) 2026 Alain
|
|
14
|
+
- 用途:worker / leader 头像的确定性「身体 + 胶囊眼」几何。实现由 esbuild 内联进 lib/client.js;产物头部另有同份 MIT 声明。
|
|
15
15
|
|
|
16
16
|
```text
|
|
17
17
|
MIT License
|
|
18
18
|
|
|
19
|
-
Copyright (c)
|
|
19
|
+
Copyright (c) 2026 Alain
|
|
20
20
|
|
|
21
21
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
22
|
of this software and associated documentation files (the "Software"), to deal
|
|
@@ -33,8 +33,7 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
33
33
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
34
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
35
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
|
37
|
-
SOFTWARE.
|
|
36
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
38
37
|
```
|
|
39
38
|
|
|
40
39
|
## 随包安装的运行时依赖
|
|
@@ -79,6 +78,7 @@ SOFTWARE.
|
|
|
79
78
|
| 包 | 版本 | 许可 | 来源 |
|
|
80
79
|
| --- | --- | --- | --- |
|
|
81
80
|
| esbuild | 0.28.2 | MIT | https://github.com/evanw/esbuild |
|
|
81
|
+
| oxlint | 1.94.0 | MIT | https://github.com/oxc-project/oxc |
|
|
82
82
|
| playwright | 1.64.1 | Apache-2.0 | https://github.com/microsoft/playwright |
|
|
83
83
|
|
|
84
84
|
这些工具只在开发、构建或测试时使用,不进入 npm 包或客户端产物;完整许可文本在各自安装目录的 `LICENSE` 文件里。
|