dsh-leader-agent 0.6.0 → 0.8.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 +6 -3
- package/.agents/skills/leader-mode/SKILL.md +2 -1
- package/.agents/skills/leader-mode/playbooks/implementation.md +1 -1
- package/.agents/skills/leader-mode/playbooks/program.md +1 -1
- package/.agents/skills/leader-mode/playbooks/testing.md +46 -0
- package/.agents/skills/leader-mode/references/parallel.md +1 -1
- package/README.md +19 -13
- package/README_ZH.md +19 -13
- package/THIRD_PARTY_LICENSE +7 -7
- package/lib/client.js +3711 -1059
- package/locale/de.json +144 -0
- package/locale/en.json +138 -0
- package/locale/es.json +144 -0
- package/locale/fr.json +144 -0
- package/locale/ja.json +144 -0
- package/locale/pt.json +144 -0
- package/locale/ru.json +144 -0
- package/locale/zh.json +138 -0
- package/package.json +18 -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 +116 -43
- package/src/client/board-mode.js +116 -0
- package/src/client/board-projection.js +6 -2
- package/src/client/board-rail-plan.js +159 -0
- package/src/client/board-rail.js +254 -0
- package/src/client/board-settings.js +169 -0
- package/src/client/board-styles.js +401 -48
- package/src/client/board.js +210 -36
- 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 +70 -9
- 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 +1108 -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/motion-preference.js +59 -0
- package/src/client/project-changes.js +2 -1
- package/src/client/project-panel-logic.js +27 -19
- package/src/client/project-panel.js +83 -48
- package/src/client/project-remote.js +56 -29
- package/src/client/project-section.js +31 -19
- package/src/client/ready-signal.js +1 -1
- package/src/client/session-tabs-logic.js +20 -6
- package/src/client/session-tabs.js +152 -56
- 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 +215 -55
- package/src/host/index.js +52 -7
- package/src/host/message.js +6 -2
- package/src/host/projects/remote.js +4 -1
- package/src/host/projects/service.js +19 -1
- package/src/host/projects/session-index.js +20 -0
- 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/host/worker-sessions.js +11 -7
- package/src/shared/card-links.js +6 -6
|
@@ -16,7 +16,8 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
|
|
|
16
16
|
|
|
17
17
|
## 断言纪律
|
|
18
18
|
|
|
19
|
-
- **断言外部世界**:DOM
|
|
19
|
+
- **断言外部世界**:DOM 的结构、class、属性与可见性,磁盘上的 JSON。不读 agent 的自述文本,不拿页面里的推理文字当证据。
|
|
20
|
+
- **不测样式**:颜色、字号、圆角、动画、像素位置与尺寸、布局对齐一律不写进 e2e;它们随宿主改版漂移,写进去只会周期性红。样式走人工取证(清单见 [e2e-testing 的样式/布局人工取证](https://github.com/fengshenx/dsh-leader-agent/blob/main/docs/e2e-testing.md#样式布局人工取证review-门禁))。例外只有**已修 bug 的最小相对几何守卫**(行高/左缘/宽度),且基准必须是宿主同一元素。
|
|
20
21
|
- **等状态,不睡时间**。`waitFor()` 轮询到条件成立;locator 用 `contenteditable="true"`、`data-*`、可见文本这类状态条件,让 playwright 自己等。
|
|
21
22
|
- **等待预算按正常耗时给**。实测单场景 3–8 秒、元素 1–2 秒到位:首次启动 20 秒、元素状态 15 秒。写 60 秒/90 秒只会让失败多等一整分钟,还把「机器慢」与「等错了元素」混成同一个症状。慢机与 2 核 CI 用 `E2E_BUDGET_SCALE=1.5` 整体放大(测试级上限走 `scenarioTimeout()`,取同一个倍率)。
|
|
22
23
|
- **失败要带读数**。元素等待走 `waitForLocator()`:失败时报 locator、目标元素读数(计数、`visible`、边界盒、`display` / `visibility` / `checkVisibility`、宽高)与页面读数(会话行、工作区行、插件元素计数)。目标读数用来分开「不在 DOM」「在 DOM 但 `display:none`」「在 DOM 但零尺寸」——只数 count 时这三种是同一句超时。读数自身限 2 秒,页面主线程卡死时退化成 `{ unavailable }`;自定义读数用 `describePage()`。细节见[e2e 失败预算](https://github.com/fengshenx/dsh-leader-agent/blob/main/.agents/notes/implemented/testing/2026-11-04-e2e-failure-budget.md)。
|
|
@@ -33,7 +34,9 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
|
|
|
33
34
|
|
|
34
35
|
## 失败诊断
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
操作面(单场景入口、`e2e:report`、负载卫生、已知 flake、超时口径与取证路径)见 [docs/e2e-testing.md 的跑法与失败处理](https://github.com/fengshenx/dsh-leader-agent/blob/main/docs/e2e-testing.md#跑法与失败处理);本节只讲判据,不重复命令。
|
|
38
|
+
|
|
39
|
+
1. **先看耗时**:单场景约 10–15 秒,全量按场景数累加。跑了一分钟还没结束,先怀疑某个等待在等不会出现的元素(典型:`lib/client.js` 没构建、会话行没渲染),不是机器慢。别用 `grep` / `head` 过滤输出,`TimeoutError` 里的 locator 就是线索。报错头是「等待失败:…」而不是「等待超时」时,先看页面或浏览器是不是已经关掉、崩了——那不是选择器的问题。测试级上限 90 秒(`scenarioTimeout()`,随 `E2E_BUDGET_SCALE` 放大);清理链上实例与 mock 卡住会变成带名字的失败,浏览器关闭超时只告警并继续。
|
|
37
40
|
2. 先看 `problems`(pageerror / console.error)。本仓出过「圆点不亮」查不出原因的情况,根因是三处空 `catch`:保留会话失败、订阅就绪失败,全都吞掉,界面上只剩一个空心圈。失败必须报告,且同一目标只报一次。
|
|
38
41
|
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
42
|
4. 看 `instance.logs`(子进程 stdout/stderr 全量)与 `mock.requests`:模型请求到底有没有发出来、打到哪个端点、带没带标记。
|
|
@@ -74,5 +77,5 @@ e2e 的判据是「真实宿主 + 真实 chromium 里,可观察行为是否成
|
|
|
74
77
|
|
|
75
78
|
- 不为了 e2e 改生产代码:场景用现有 class 与 role;需要新选择器时那是一次产品决定,不夹带。
|
|
76
79
|
- 不把截图当断言:截图只解释「当时界面上是什么样」,回归靠断言。
|
|
77
|
-
-
|
|
80
|
+
- 不覆盖原生控件、样式与像素布局(已修 bug 的最小几何守卫除外)、WebKit / Firefox:这些走人工取证,PR 里如实标注。
|
|
78
81
|
- 不加 `--test-force-exit`:它会把漏清理从「挂住/超时变红」变成「绿着通过 + 孤儿进程」;有界清理见[e2e 清理笔记](https://github.com/fengshenx/dsh-leader-agent/blob/main/.agents/notes/implemented/testing/2026-11-04-e2e-shutdown-bounded.md)。
|
|
@@ -49,6 +49,7 @@ worker 的工作目录强制是项目目录:leader 不能指定 worker 的 cwd
|
|
|
49
49
|
| 讨论需求、了解系统 | 先明确可观察行为、验收与范围;机制不明先追机制,设计理由不明先查历史记录,分别标事实、推断与缺口 |
|
|
50
50
|
| 设计与任务定义 | 从真实用法推 owner 与接口;文档归属由项目规范决定;先查重,业务优先级交用户 |
|
|
51
51
|
| Feature / Bug / Refactor | [实现 playbook](playbooks/implementation.md),依 [并行协作](references/parallel.md)派完整简报;独占 worktree,执行者按行为单元实现验证 |
|
|
52
|
+
| 测试与验证 | [测试 playbook](playbooks/testing.md),按改动面选最便宜的层、双向验证并交可复算证据;项目命令与门槛按项目约定 |
|
|
52
53
|
| 多任务与依赖 | [编排 playbook](playbooks/program.md),按 owner/语义依赖安排,优先消化审查与 CI 队列 |
|
|
53
54
|
| 交付 / CI / 审查 / 合入准备 | [交付 playbook](playbooks/delivery.md),当前 head 验产物、行为、审查与门禁,按授权推进 |
|
|
54
55
|
| 暂停、恢复与清理 | [交接 playbook](playbooks/handoff.md),保存指针与证据缺口,恢复核对实态,清理遵守项目门槛 |
|
|
@@ -83,7 +84,7 @@ worker 的工作目录强制是项目目录:leader 不能指定 worker 的 cwd
|
|
|
83
84
|
|
|
84
85
|
## 派工与接收
|
|
85
86
|
|
|
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
|
|
87
|
+
派工用 `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
88
|
|
|
88
89
|
派工确保原简报、后续指令、实际产物与版本均可沿指针完整恢复,不依赖「done」摘要继承变更。按 [leader 传话纪律](playbooks/program.md#输出与传话纪律)保留边界与验收,已落盘正文不抄入派单。按宿主与任务权限使用 worker;现有 owner 与 worktree 状态能可信恢复时续跑,新上下文更合适时新派,不能丢原约束。停止/恢复遵守用户指令与宿主契约;能力不可用明确 limitation,不声称多模型独立评估。
|
|
89
90
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 实现、缺陷与重构
|
|
2
2
|
|
|
3
|
-
共用前提:已有验收、设计/Issue、独占 worktree 和明确写入 owner;委派简报见 [并行协作](../references/parallel.md)。行为驱动、fixture
|
|
3
|
+
共用前提:已有验收、设计/Issue、独占 worktree 和明确写入 owner;委派简报见 [并行协作](../references/parallel.md)。行为驱动、fixture、永久回归与覆盖率以项目约定为准,测试方法见 [测试 playbook](testing.md),验证范围按项目既有门禁选择,结构判断按 [专项能力方法](../SKILL.md#按问题调用专项能力)。
|
|
4
4
|
|
|
5
5
|
本 playbook 可由普通单会话或 dev worker 直接使用,不要求加载 leader 入口、建卡或启动派工。共同工程要求相同;worker 的任务来源、交接对象与阶段归属由宿主身份和派单确定,普通会话直接向用户交付。
|
|
6
6
|
|
|
@@ -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
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# 测试与验证
|
|
2
|
+
|
|
3
|
+
测试不是「跑过命令」,而是用最便宜、能证伪的手段证明可观察行为成立。先定验收与可观察量,再选层;能用纯函数、夹具或落盘断言证明的不上浏览器。项目自己的测试命令、覆盖率门槛、flake 表与人工取证范围是事实源,本 playbook 只给方法与检查点。
|
|
4
|
+
|
|
5
|
+
## 选层
|
|
6
|
+
|
|
7
|
+
- **纯函数 / 数据转换 / 状态归一 / 落盘格式**:单测。输入输出可判定,不需要运行时。
|
|
8
|
+
- **构建、打包、profile、门禁**:用项目自带的构建与打包检查,不另造一套断言。
|
|
9
|
+
- **真实 UI 行为**:项目的 e2e 车道。先读项目里的车道文档与场景写法,不自己另起一套。
|
|
10
|
+
- **样式、像素、动画、原生控件、跨浏览器**:人工取证;自动回归只守行为与已修 bug 的最小几何守卫,不守观感。
|
|
11
|
+
|
|
12
|
+
同一条结论有更便宜的层就不要升级;e2e 只补单测证明不了的那一段。
|
|
13
|
+
|
|
14
|
+
## 写用例
|
|
15
|
+
|
|
16
|
+
- **先失败再修**:bug 先复现正确失败,feature 先固定用户路径,重构先固定消费者行为。方法见[实现 playbook](implementation.md)。
|
|
17
|
+
- **断言外部可观察量**:返回值、落盘文件、DOM 属性与可见性、ARIA、wire、投影。不读内部调用栈或自述。
|
|
18
|
+
- **假件照真实 API 面构造**:多给一个宿主方法,会掩盖下限版本的能力缺口。
|
|
19
|
+
- **一次只改一个变量**:用例名写清守住的那句话;去掉不稳定的时序依赖。
|
|
20
|
+
- **边界与反向路径至少各有一条**:空值、越界、失败、取消、重复提交。
|
|
21
|
+
- e2e 场景的断言纪律、等待预算与失败读数见 [e2e-scenarios](../../e2e-scenarios/SKILL.md)。
|
|
22
|
+
|
|
23
|
+
## 双向验证
|
|
24
|
+
|
|
25
|
+
修 bug 与重大回归必须:撤掉修复(或注入缺陷)→ 对应用例变红 → 还原 → 全绿。没变红先怀疑用例,不先怀疑实现;把「撤掉什么、红了哪条、报什么读数」写进交付物。重大缺陷固化为永久回归。
|
|
26
|
+
|
|
27
|
+
## 证据与门禁
|
|
28
|
+
|
|
29
|
+
- 按项目门禁跑最小检查;交付物写清跑了什么、结果、未跑项与原因。不贴一条命令当证据,不把 worker PASS 当验收;PR 证据格式见[交付 playbook](delivery.md#开-pr)。
|
|
30
|
+
- 失败先读目标/页面读数、日志与请求记录,区分数据没到、渲染错了、环境坏了;不靠重试或加大等待变绿。
|
|
31
|
+
- 已知 flake 要登记并追根因;同一处连续两次空载失败按回归处理。
|
|
32
|
+
- 截图与临时数据不入库;截图只解释当时状态,不替代断言。
|
|
33
|
+
- 覆盖数字只作下限:新增文件默认要求全覆盖,加载不到的文件要登记理由,不靠漏测或空导入变绿。
|
|
34
|
+
|
|
35
|
+
## 审查测试
|
|
36
|
+
|
|
37
|
+
- 断言是否落在可观察行为上,而不是实现细节?
|
|
38
|
+
- 撤掉修复后这条用例会红吗?
|
|
39
|
+
- 假件是否比真实 API 面多给了能力?
|
|
40
|
+
- 是否有只证明「代码执行过」的绿灯?
|
|
41
|
+
- e2e 是否在测样式、像素或动画?是则删掉或转人工取证;只有已修 bug 的最小相对几何守卫可以留,基准必须是宿主同一元素。
|
|
42
|
+
- 覆盖数字是否靠加载文件凑出来,而不是覆盖行为?
|
|
43
|
+
|
|
44
|
+
## 不覆盖
|
|
45
|
+
|
|
46
|
+
原生控件、样式与像素布局、WebKit/Firefox 走人工取证并在交付物里标注;不真实调用付费模型 API;不把 e2e 塞进只跑纯函数的门禁。
|
|
@@ -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">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
## Highlights
|
|
29
29
|
|
|
30
30
|
1. **One Leader drives development and review** — You state the goal once. The Leader opens cards, dispatches workers, watches each one finish, verifies the deliverable and organizes review. Your attention goes back to "what do I want" instead of "which agent is stuck"; the target is ten features in flight at once.
|
|
31
|
-
2. **A right SidePanel board: see who is working at a glance** — One board per project. Each card carries its executor slot and a live status light, its note renders as Markdown, its links are editable in place, and the detail footer can delete the card. Click a card for the spec (goal, scope, acceptance, links), click a slot to drill into that agent's session and keep talking; worker reports arrive as Markdown-rendered agent bubbles; dispatched task briefs arrive as user-style bubbles whose body uses the same Markdown pipeline as assistant content; single newlines merge per Markdown, so use blank lines or Markdown syntax for a line break.
|
|
31
|
+
2. **A right SidePanel board: see who is working at a glance** — One board per project, in two presentations: **Work** (default) keeps the plain list, **Cinematic** draws it as a workflow map for demos and social sharing; switch under Settings → Leader Agent → Task board. Each card carries its executor slot and a live status light, its note renders as Markdown, its links are editable in place, and the detail footer can delete the card. Click a card for the spec (goal, scope, acceptance, links), click a slot to drill into that agent's session and keep talking; worker reports arrive as Markdown-rendered agent bubbles; dispatched task briefs arrive as user-style bubbles whose body uses the same Markdown pipeline as assistant content; single newlines merge per Markdown, so use blank lines or Markdown syntax for a line break.
|
|
32
32
|
3. **Arrange your agents however you want** — Two files do the arranging. `LEADER.md` holds the Leader's prompt and this project's orchestration rules: boundaries, dispatch requirements, acceptance criteria. `SLOTS.md` gives each worker role its own rules (dev / review / …). Both are evaluated before every model request and appended only when their text changes, so editing a file changes behavior without recreating sessions.
|
|
33
33
|
4. **Many projects in parallel, one Leader each** — Adding a project binds a leader session to it, and the project tree lists the workers that Leader spawned; rows can be dragged to reorder, and deleting a project only drops the record while keeping the folder and the sessions (dsh workspaces are untouched). Projects stay out of each other's way. Swap in a new Leader and the existing workers plus undelivered reports move over, so it can dispatch immediately.
|
|
34
34
|
5. **The `leader-mode` skill: an orchestration protocol for the Leader** — Not "you are a tech lead". Staged playbooks across discussion → design → implementation and delivery → review → merge, plus guidance on parallel collaboration and handoff.
|
|
@@ -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
|
|
|
@@ -55,7 +55,7 @@ Desktop uses its own profile (`$DSH_HOME/profiles/desktop`), separate from `web`
|
|
|
55
55
|
|
|
56
56
|
On Windows / Linux, use `runtime/cli/bin/dsh` inside the installation directory. The app reads the profile only at startup, and only one version can be mounted at a time. `DSH_HOME` must be absolute or start with `~/`. Sessions, projects, and cards are shared with `web`; plugin packages and activation are separate.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
Development: `npm run desktop` uses an isolated root (`.dev/desktop-home`); `npm run desktop:prod` uses a shadow root (`.dev/desktop-prod-home`) linking sessions/cards to `~/.dsh`; online profile untouched. Both run local code; direct launches use the installed version. `-- --remove` cleans its root; `-- --remove --remove-mount` removes a legacy mount.
|
|
59
59
|
|
|
60
60
|
### Web install
|
|
61
61
|
|
|
@@ -73,12 +73,18 @@ For pinning a version, removing it, development installs, or trying it without a
|
|
|
73
73
|
## Preview
|
|
74
74
|
|
|
75
75
|
<div align="center">
|
|
76
|
-
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="
|
|
76
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="Work mode: the project tree on the left, the Leader's conversation in the middle, the delivery board as a list on the right" width="1200">
|
|
77
77
|
</div>
|
|
78
78
|
|
|
79
|
-
Left: projects and
|
|
79
|
+
**Work mode (default).** The plain list: one card per task with a slot chip per executor. Left: projects and their workers. Center: the Leader's session — task, dispatch, report, verdict. Right: the board; click an executor to open its session.
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
<div align="center">
|
|
82
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/ab19c6307736fc21675bbac2847dd9bce3bf7a81/docs/assets/readme/board-cinema.png" alt="Cinematic mode in the dark theme: the delivery board as a workflow map, with cards on a trunk and executors on animated branches" width="1200">
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
**Cinematic mode.** The same board as a workflow map: cards on a trunk, one branch per executor; only a running branch animates. Built for demos and social sharing. Shown in the dark theme; the light theme uses electric-blue lines.
|
|
86
|
+
|
|
87
|
+
Switch under **Settings → Leader Agent → Task board**; the choice is stored per browser. Work-mode shot is a real session; cinematic shot is the browser e2e fixture (real host + local mock).
|
|
82
88
|
|
|
83
89
|
## How it runs
|
|
84
90
|
|
|
@@ -100,11 +106,11 @@ Three mechanisms make this more than "a smarter prompt":
|
|
|
100
106
|
- **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
107
|
- **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
108
|
- **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.
|
|
109
|
+
- **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
110
|
|
|
105
111
|
## Design trade-offs
|
|
106
112
|
|
|
107
|
-
- This project does not aim to rebuild dsh
|
|
113
|
+
- This project does not aim to rebuild [the Super-agent research prototype from the DeepSeek Harness team](https://github.com/deepseek-ai/dsh-superagent-prototype) (a research prototype, not an official DeepSeek product), which watches one repository and runs event-driven sessions. It solves a different problem: letting one person manage 20+ sessions, with a Leader, a board and parallel tasks ([FAQ](https://fengshenx.github.io/dsh-leader-agent/#faq)).
|
|
108
114
|
- Today's agents are not reliable enough to run unattended, so the design assumes you can interrupt or push any worker at any point.
|
|
109
115
|
- The routing layer runs a full-size model. In practice, holding the global picture, it often connects several PRs in one thought and resolves what a single worker cannot see.
|
|
110
116
|
- Agent orchestration generalizes. A card describes the task itself, so it works outside coding and composes with any skill.
|
|
@@ -116,8 +122,8 @@ Three mechanisms make this more than "a smarter prompt":
|
|
|
116
122
|
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
123
|
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
124
|
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`.
|
|
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.
|
|
125
|
+
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`.
|
|
126
|
+
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. Work mode is the default; choose Cinematic under Settings → Leader Agent → Task board.
|
|
121
127
|
|
|
122
128
|
## Orchestration lives in files
|
|
123
129
|
|
|
@@ -146,7 +152,7 @@ Running ten features in parallel requires real isolation between tasks: one work
|
|
|
146
152
|
## Current limitations
|
|
147
153
|
|
|
148
154
|
- **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).
|
|
155
|
+
- **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
156
|
- **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
157
|
- **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
158
|
- **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">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
## 亮点
|
|
29
29
|
|
|
30
30
|
1. **通过一个 Leader,帮你推进开发和 Review** — 你只跟 Leader 说目标,它拆卡、派工、盯住每个 worker 的完成、验证产物、组织审查。注意力回到「要什么」上,不用逐个陪跑——目标规模是一次并行开发 10 个 feature。
|
|
31
|
-
2. **右栏 SidePanel 看板,正在工作的 Agent 一目了然** —
|
|
31
|
+
2. **右栏 SidePanel 看板,正在工作的 Agent 一目了然** — 一个项目一块看板,两套呈现:**工作**(默认)保持纯列表,**炫酷**把卡片画成线路图、纯演示与社交媒体传播用,`设置 → Leader Agent → 任务看板` 切换。卡面上是执行者槽位与实时信号灯,卡片说明按 Markdown 渲染,链接可在浮层里直接编辑,详情页脚可删除卡片;点卡面看详情(目标、范围、验收、链接,其余只读),点槽位直接下钻进那个 Agent 的会话接着聊。worker 的回报按 Markdown 渲染成左侧 agent 气泡;leader 派过去的任务渲染成右侧用户气泡,正文与 assistant 内容同套 Markdown;单换行按 Markdown 合并,需要断行用空行或 Markdown 语法。
|
|
32
32
|
3. **Agent 自由编排** — 拆成两份文件:`LEADER.md` 写 Leader 的 prompt 与项目编排规则(职责边界、派工要求、验收口径);`SLOTS.md` 按角色给 worker 写编排规则(开发 / 审核……)。两者在每次模型请求前求值、正文变化才追加,改文件即改行为,不用重建会话。
|
|
33
33
|
4. **多项目并行,每个项目一个 Leader** — 左栏加一个项目就绑定一个 leader 会话,项目树列出它派出的 worker;项目行可拖拽排序,删除项目只删记录、保留文件夹与会话(dsh 工作区不受影响)。项目之间各管各的。换 Leader 时原班 worker 与未投递的回报一并改投新会话,新 Leader 直接接着派。
|
|
34
34
|
5. **`leader-mode` skill,给 Leader 的编排 Skill** — 不是一句「你是 tech lead」:按技术讨论 → 设计 → 实现交付 → 审查 → 合入分阶段给 playbook,另有并行协作与交接规范。
|
|
@@ -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
|
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
Windows / Linux 换成安装目录里对应的 `runtime/cli/bin/dsh`。应用只在启动时读 profile,同一时刻只能挂一个版本;`DSH_HOME` 要用绝对路径或 `~/` 写法。会话、项目与卡片数据与 `web` 共享,插件包与激活状态各自一份。
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
`npm run desktop` 用 dev 根 `.dev/desktop-home`;`npm run desktop:prod` 用正式数据(影子根 `.dev/desktop-prod-home`,共用日常,线上 profile 不动)。都用本仓代码,直接启动仍用线上;`-- --remove` 清根,旧版用 `-- --remove --remove-mount` 摘。
|
|
59
59
|
|
|
60
60
|
### Web 版安装
|
|
61
61
|
|
|
@@ -73,12 +73,18 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
73
73
|
## 预览
|
|
74
74
|
|
|
75
75
|
<div align="center">
|
|
76
|
-
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="
|
|
76
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/main/docs/assets/readme/board.png" alt="工作模式:左栏项目树、中栏 Leader 的会话、右栏列表形态的交付看板" width="1200">
|
|
77
77
|
</div>
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
**工作模式(默认)**:纯列表,一卡一件事,槽位 chip 标出执行者。左栏项目树、中栏 Leader 会话、右栏看板;点执行者即可下钻到它的会话。
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
<div align="center">
|
|
82
|
+
<img src="https://raw.githubusercontent.com/fengshenx/dsh-leader-agent/ab19c6307736fc21675bbac2847dd9bce3bf7a81/docs/assets/readme/board-cinema.png" alt="炫酷模式(深色主题):交付看板画成线路图,卡片挂在主干上,执行者支线按运行状态点亮" width="1200">
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
**炫酷模式**:同一块看板画成线路图——卡片挂主干,执行者是右侧支线,只有执行中的支线跑光点。纯演示,社交媒体传播用。图为深色主题;浅色宿主下是电蓝正交线条。
|
|
86
|
+
|
|
87
|
+
在 **设置 → Leader Agent → 任务看板** 切换,选择只存本浏览器;工作模式截图取自真实会话,炫酷模式取自 e2e 夹具(真实宿主 + 本地 mock)。
|
|
82
88
|
|
|
83
89
|
## 它是怎么跑起来的
|
|
84
90
|
|
|
@@ -100,11 +106,11 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
100
106
|
- **身份决定工具面**:Leader 拿得到 `spawn_worker` / `message_worker`,worker 拿不到;工具面在会话创建时由宿主裁剪,不是靠提示词约束模型。
|
|
101
107
|
- **完成由机制结算并自动唤醒**:worker 那一轮结束时,Leader 自动收到一条回报(渲染成 worker 的发言气泡),不轮询、不靠 worker 自觉。
|
|
102
108
|
- **worker 是常驻根会话**:能同时跑多个,人可以直接打开它的会话接着聊,进程重启后能冷恢复。代价是 Leader 侧不能强杀它,见[当前限制](#当前限制)。
|
|
103
|
-
- **项目会话有标签栏**:第一个标签是项目名(Leader 入口),点开的 worker
|
|
109
|
+
- **项目会话有标签栏**:第一个标签是项目名(Leader 入口),点开的 worker 带着状态灯加入;栏右端是会话「更多」与右栏开关。关标签只丢快捷方式,会话仍在项目树里。
|
|
104
110
|
|
|
105
111
|
## 设计取舍
|
|
106
112
|
|
|
107
|
-
-
|
|
113
|
+
- 这个项目不复刻 [DeepSeek Harness 团队的 Super-agent 研究原型](https://github.com/deepseek-ai/dsh-superagent-prototype)(研究原型,不是 DeepSeek 官方产品;它盯一个仓库、按事件起会话),要解决的是另一件事:让 1 个人管理 20 个以上的 Session,有 Leader、看板和并行任务([项目落地页 FAQ](https://fengshenx.github.io/dsh-leader-agent/#faq))。
|
|
108
114
|
- 在当前 agent 还不是那么完善的情况下,这个项目的思路是你可以随时打断或者推进某个 worker 的工作。
|
|
109
115
|
- routing 层用的是完整大模型,实际使用中,routing 层由于知道全局信息,经常能够把多个 PR 串起来思考,解决单 Worker 看不到的问题。
|
|
110
116
|
- Agent 编排的泛化。Card 是任务本身的描述,可以用在非编码场景,也可以和各种 Skill 集成。
|
|
@@ -116,8 +122,8 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
116
122
|
1. **加项目**:左栏「项目」区块点「加项目」,选一个目录。项目当场建好并绑定一个 leader 会话;点项目行就是打开这个 Leader。当前会话属于该项目时左栏按两层回执:打开的是 leader 会话则项目行整行亮,打开的是它派出的 worker 则项目行只点亮行首应用格子、选中态落在那个 worker 自己的会话行上。行首槽位平时是应用格子图标(宿主 `apps-add-outline`:三格 + 一个加号;替掉宿主的目录图标,免得侧边栏里「项目」和「工作区」同形),活动提示看 leader:它在跑就换成加载圈(leader 没有自己的行,项目展开着也照换),项目收起时名下有 worker 在跑也换成加载圈,展开后 worker 由会话行自己带加载圈。
|
|
117
123
|
2. **加载协议**:leader 会话里让模型加载 `leader-mode`,先读 `playbooks/program.md`,再按阶段读对应 playbook。
|
|
118
124
|
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`
|
|
120
|
-
5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip
|
|
125
|
+
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` 续读。
|
|
126
|
+
5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip 打开执行者会话。工作模式是默认;想切炫酷,在 `设置 → Leader Agent → 任务看板` 选「炫酷模式」。
|
|
121
127
|
|
|
122
128
|
## 编排:把规则写进文件
|
|
123
129
|
|
|
@@ -146,7 +152,7 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
146
152
|
## 当前限制
|
|
147
153
|
|
|
148
154
|
- **后台编排只适用于长驻组合**(web / desktop / sdk)。headless 是一次性 CLI,会话在 turn 结束后即销毁,没有载体接收完成通知。
|
|
149
|
-
- **Leader 能纠偏、但不能中止 worker**:worker 是普通根会话,宿主的 `list_agents` / `send_message` / `interrupt_agent` 对它无效(`interrupt_agent`
|
|
155
|
+
- **Leader 能纠偏、但不能中止 worker**:worker 是普通根会话,宿主的 `list_agents` / `send_message` / `interrupt_agent` / `wait_agent` 对它无效(`interrupt_agent` 会返回假成功,`wait_agent` 只会阻塞空等)。跑偏了用 `message_worker` 把纠偏指令 steer 进它当前轮次(正在跑就插下一步);没有中止手段——宿主的 `Agent.cancel()` 没被接成工具,真卡死只能请人去那个会话处理。能读它的会话过程(`read_worker_session`,只读、不唤醒)。
|
|
150
156
|
- **完成回报依赖轮次正常结束**:进程在 worker 跑完前被杀,那一轮不结算;重启后自己打开 worker 会话看或续聊。
|
|
151
157
|
- **看板只对项目会话展示**:leader 与该项目的 worker 能看到;同目录的普通会话与已换下的 leader 只看到提示,不属于任何项目的会话也没有看板。
|
|
152
158
|
- **会话标签栏是 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` 文件里。
|