dsh-leader-agent 0.4.0 → 0.5.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/doubao-tts/SKILL.md +158 -0
- package/.agents/skills/doubao-tts/scripts/tts.mjs +253 -0
- package/.agents/skills/e2e-scenarios/SKILL.md +15 -0
- package/.agents/skills/leader-mode/SKILL.md +3 -1
- package/.agents/skills/leader-mode/playbooks/implementation.md +1 -1
- package/.agents/skills/leader-mode/playbooks/program.md +1 -1
- package/.agents/skills/promo-stills/SKILL.md +107 -0
- package/.agents/skills/promo-stills/scripts/render.mjs +186 -0
- package/.agents/skills/promo-video/SKILL.md +134 -0
- package/.agents/skills/promo-video/references/copy-and-storyboard.md +74 -0
- package/.agents/skills/promo-video/references/qa.md +60 -0
- package/.agents/skills/promo-video/references/timeline-and-render.md +155 -0
- package/README.md +6 -16
- package/README_ZH.md +6 -18
- package/lib/client.js +611 -344
- package/package.json +1 -1
- package/src/client/board-card.js +104 -82
- package/src/client/board-projection.js +53 -0
- package/src/client/board-styles.js +221 -75
- package/src/client/board.js +85 -5
- package/src/client/card-detail-view.js +26 -0
- package/src/client/card-detail.js +36 -6
- package/src/client/icons.js +0 -7
- package/src/client/project-panel.js +51 -11
- package/src/client/project-section.js +30 -20
- package/src/host/cards/card-list-view.js +97 -0
- package/src/host/cards/store.js +36 -1
- package/src/host/index.js +9 -2
- package/src/host/projects/remote.js +24 -0
- package/src/host/tools/cards.js +259 -6
- package/src/host/tools/gate.js +32 -7
- package/src/shared/projects.js +1 -0
package/README.md
CHANGED
|
@@ -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,
|
|
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.
|
|
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.
|
|
@@ -69,17 +69,6 @@ The profile must be named `web`; custom names are absent from `PROFILE_TEMPLATES
|
|
|
69
69
|
|
|
70
70
|
For pinning a version, removing it, development installs, or trying it without a profile, see [Development](docs/development.md).
|
|
71
71
|
|
|
72
|
-
### Upgrading from `dsh-leader-kit`
|
|
73
|
-
|
|
74
|
-
The package was renamed to `dsh-leader-agent` **without a compatibility path**. `dsh plugin add` records the *package name* in `dsh.profile.bundles`, so the old entry survives and both bundles get applied: tools registered twice, two dispatchers settling the same `turn/end` (duplicate notifications and wakeups). Remove the old entry first, in the same profile you install into:
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
dsh plugin --profile web remove dsh-leader-kit
|
|
78
|
-
dsh plugin --profile web add dsh-leader-agent
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
The data directory moved with the name (`$DSH_HOME/dsh-leader-kit` → `$DSH_HOME/dsh-leader-agent`) and is **not migrated**: boards start empty and worker registrations rebuild on first start. The old package is deprecated in favor of this one.
|
|
82
|
-
|
|
83
72
|
## Preview
|
|
84
73
|
|
|
85
74
|
<div align="center">
|
|
@@ -125,8 +114,8 @@ Three mechanisms make this more than "a smarter prompt":
|
|
|
125
114
|
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.
|
|
126
115
|
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.
|
|
127
116
|
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.
|
|
128
|
-
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` / `slots` belong to the Leader (the first two are the acceptance anchor and injected content, the
|
|
129
|
-
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 rest read-only), click a slot chip to open the executor's session.
|
|
117
|
+
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`.
|
|
118
|
+
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.
|
|
130
119
|
|
|
131
120
|
## Orchestration lives in files
|
|
132
121
|
|
|
@@ -155,10 +144,10 @@ Running ten features in parallel requires real isolation between tasks: one work
|
|
|
155
144
|
## Current limitations
|
|
156
145
|
|
|
157
146
|
- **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.
|
|
158
|
-
- **The Leader
|
|
147
|
+
- **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).
|
|
159
148
|
- **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.
|
|
160
149
|
- **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.
|
|
161
|
-
- **Card details only write links.** Links can be added, edited and removed in the detail
|
|
150
|
+
- **Card details only write links and delete the card.** Links can be added, edited and removed; deletion lives in the detail footer, asks for confirmation, and is a hard delete with no undo. Completing, pinning and renaming still belong to the Leader's card tools. Card numbers increase globally and are never reused or reclaimed; models have no card-deletion tool, so a human must click it.
|
|
162
151
|
- **The project registry is only reachable from the left sidebar.** There are no project tools for the model; if the directory picker is unavailable you cannot create a project and need the web profile.
|
|
163
152
|
- **The project tree coexists with the official workspace tree.** Projects neither register nor occupy dsh workspaces: project sessions land in the official tree's "Ungrouped" section and are excluded there at render time (official counts and search still include them); when nothing but excluded rows is left in that section, its header is hidden too.
|
|
164
153
|
- **The client is coupled to the host version.** Dialogs, menus and icons are copied from host sources, the Typert remote channel is a hand-written protocol shape, and the leader session layout depends on the host's session view service, so host upgrades require syncing this repository.
|
|
@@ -195,6 +184,7 @@ Read [AGENTS.md](AGENTS.md) first: worktree discipline, verification requirement
|
|
|
195
184
|
| [docs/e2e-testing.md](docs/e2e-testing.md) | Browser e2e lane (commands, fixtures, mock conventions, screenshots) and manual evidence rules; assertion discipline and failure diagnosis live in `.agents/skills/e2e-scenarios/` |
|
|
196
185
|
| [.agents/notes/](.agents/notes/) | Decision memory for non-trivial changes |
|
|
197
186
|
| [.agents/skills/leader-mode/](.agents/skills/leader-mode/) | Protocol layer: dispatch, handoff, event scheduling, card upkeep, acceptance |
|
|
187
|
+
| [.agents/skills/promo-video/](.agents/skills/promo-video/) | Promo pipeline for the repo dev env (needs Playwright + ffmpeg): storyboard, TTS timeline, capture/record, cover production; narration in `doubao-tts/`, covers in `promo-stills/` |
|
|
198
188
|
|
|
199
189
|
## Credits
|
|
200
190
|
|
package/README_ZH.md
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
## 亮点
|
|
29
29
|
|
|
30
30
|
1. **通过一个 Leader,帮你推进开发和 Review** — 你只跟 Leader 说目标,它拆卡、派工、盯住每个 worker 的完成、验证产物、组织审查。注意力回到「要什么」上,不用逐个陪跑——目标规模是一次并行开发 10 个 feature。
|
|
31
|
-
2. **右栏 SidePanel 看板,正在工作的 Agent 一目了然** — 一个项目一块看板。卡面上是执行者槽位与实时信号灯,卡片说明按 Markdown
|
|
31
|
+
2. **右栏 SidePanel 看板,正在工作的 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,另有并行协作与交接规范。
|
|
@@ -69,19 +69,6 @@ profile 名必须用 `web`;自定义名不在 `PROFILE_TEMPLATES` 里,装出
|
|
|
69
69
|
|
|
70
70
|
指定版本、卸载、开发期安装与不装 profile 直接试跑见[开发](docs/development.md)。
|
|
71
71
|
|
|
72
|
-
### 从 `dsh-leader-kit` 升级
|
|
73
|
-
|
|
74
|
-
包名改成 `dsh-leader-agent`,**不提供兼容路径**。`dsh plugin add` 写进 `dsh.profile.bundles` 的是**包名**,旧条目升级后仍然在,两个 bundle 都会被 `apply`:工具注册两次、`agent/created` 订阅两次、两个 dispatcher 各结算同一个 `turn/end`(通知与唤醒都发两份)。先在你装的那个 profile 里删掉旧条目:
|
|
75
|
-
|
|
76
|
-
```sh
|
|
77
|
-
dsh plugin --profile web remove dsh-leader-kit
|
|
78
|
-
dsh plugin --profile web add dsh-leader-agent
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
桌面版同理,把 `web` 换成 `desktop`(CLI 用桌面安装自带的那个)。
|
|
82
|
-
|
|
83
|
-
数据目录随包名改为 `$DSH_HOME/dsh-leader-agent`,**不迁移**:升级后看板是空的、worker 登记表首次启动重建。旧包已 `deprecate` 指向新包。
|
|
84
|
-
|
|
85
72
|
## 预览
|
|
86
73
|
|
|
87
74
|
<div align="center">
|
|
@@ -127,8 +114,8 @@ dsh plugin --profile web add dsh-leader-agent
|
|
|
127
114
|
1. **加项目**:左栏「项目」区块点「加项目」,选一个目录。项目当场建好并绑定一个 leader 会话;点项目行就是打开这个 Leader。当前会话属于该项目时左栏按两层回执:打开的是 leader 会话则项目行整行亮,打开的是它派出的 worker 则项目行只点亮行首应用格子、选中态落在那个 worker 自己的会话行上。行首槽位平时是应用格子图标(宿主 `apps-add-outline`:三格 + 一个加号;替掉宿主的目录图标,免得侧边栏里「项目」和「工作区」同形),活动提示看 leader:它在跑就换成加载圈(leader 没有自己的行,项目展开着也照换),项目收起时名下有 worker 在跑也换成加载圈,展开后 worker 由会话行自己带加载圈。
|
|
128
115
|
2. **加载协议**:leader 会话里让模型加载 `leader-mode`,先读 `playbooks/program.md`,再按阶段读对应 playbook。
|
|
129
116
|
3. **派工**:`spawn_worker` 只要求 `name`(角色-任务短名),可带 `cardId` + `slot` 一次把卡槽位绑好;工具立即返回会话 id,此时 worker **还没开工**。用 `message_worker` 投递任务正文(`sessionId` + `message`,可顺手 `rename`),第一条消息才开工;挂卡 worker 的请求会自动带上卡片事实,消息里不必抄 spec。worker 的沙箱模式与审批策略在派工那一刻从 leader 继承(leader 是 Auto 时连审查门一起继承),回执里写明它实际以什么权限在跑,完全权限会被点名。要看它这一轮怎么做的(调了哪些工具、哪步失败),用 `read_worker_session` 回看,不必唤醒它。
|
|
130
|
-
4. **记任务事实**:`create_card` 建卡(`title` 必填),`update_card` 改卡(改内容带 `expectedRevision` 做乐观并发;链接可用 `links` 整体替换,或用 `addLinks` 按 id 增量追加),`list_cards` 查卡。卡片按项目归属、编号全局递增,跨项目改卡会被拒绝。`list_cards` 与 `create_card` 只给 leader,普通会话一件也没有;`update_card` leader 与 worker 都有。worker 只能改自己挂着的卡,且只能挂 `links` 这类派生字段:`title` / `spec` / `status` / `slots` 都归 leader
|
|
131
|
-
5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader
|
|
117
|
+
4. **记任务事实**:`create_card` 建卡(`title` 必填),`update_card` 改卡(改内容带 `expectedRevision` 做乐观并发;链接可用 `links` 整体替换,或用 `addLinks` 按 id 增量追加),`list_cards` 查卡。卡片按项目归属、编号全局递增,跨项目改卡会被拒绝。`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` 续读。
|
|
118
|
+
5. **看看板**:右栏「看板」Tab,按当前会话所属项目拉卡片。leader 建卡后自动打开;点卡面看详情(链接可编辑、可删卡,其余只读),点槽位 chip 打开执行者会话。
|
|
132
119
|
|
|
133
120
|
## 编排:把规则写进文件
|
|
134
121
|
|
|
@@ -157,10 +144,10 @@ dsh plugin --profile web add dsh-leader-agent
|
|
|
157
144
|
## 当前限制
|
|
158
145
|
|
|
159
146
|
- **后台编排只适用于长驻组合**(web / desktop / sdk)。headless 是一次性 CLI,会话在 turn 结束后即销毁,没有载体接收完成通知。
|
|
160
|
-
- **Leader
|
|
147
|
+
- **Leader 能纠偏、但不能中止 worker**:worker 是普通根会话,宿主的 `list_agents` / `send_message` / `interrupt_agent` 对它无效(`interrupt_agent` 会返回假成功)。跑偏了用 `message_worker` 把纠偏指令 steer 进它当前轮次(正在跑就插下一步);没有中止手段——宿主的 `Agent.cancel()` 没被接成工具,真卡死只能请人去那个会话处理。能读它的会话过程(`read_worker_session`,只读、不唤醒)。
|
|
161
148
|
- **完成回报依赖轮次正常结束**:进程在 worker 跑完前被杀,那一轮不结算;重启后自己打开 worker 会话看或续聊。
|
|
162
149
|
- **看板只对项目会话展示**:leader 与该项目的 worker 能看到;同目录的普通会话与已换下的 leader 只看到提示,不属于任何项目的会话也没有看板。
|
|
163
|
-
-
|
|
150
|
+
- **卡片详情的人工写操作只有链接与删除**:链接可在详情里增删改;删除在详情页脚,二次确认后硬删、不可撤销,编号不复用,槽位绑定一并解除;完成、置顶、重命名仍归 leader 的卡片工具。模型没有删除卡片的工具,删除只能由人点出来。
|
|
164
151
|
- **项目注册表只经左栏区块操作**:模型没有项目工具;目录选择器不可用时无法建项目,需换 web profile。
|
|
165
152
|
- **项目树与官方工作区树并存**:项目不注册也不占用 dsh 工作区,项目会话落进官方树的「未分组」,在那里被渲染层排除(官方计数与搜索仍包含它们);组里只剩被排除的行时「未分组」组头一起藏起来。
|
|
166
153
|
- **客户端与宿主版本耦合**:弹窗、菜单、图标复制自宿主源码,Typert 远程通道是手写协议形状,leader 会话形态依赖宿主的会话视图服务——宿主升级时要同步本仓。
|
|
@@ -197,6 +184,7 @@ npm run e2e # 浏览器 e2e
|
|
|
197
184
|
| [docs/e2e-testing.md](docs/e2e-testing.md) | 浏览器 e2e 车道(命令、夹具、mock 约定、截图)与人工取证规范;断言纪律与失败诊断见 `.agents/skills/e2e-scenarios/` |
|
|
198
185
|
| [.agents/notes/](.agents/notes/) | 非平凡改动的决策记忆 |
|
|
199
186
|
| [.agents/skills/leader-mode/](.agents/skills/leader-mode/) | 协议层:派工、接力、事件调度、卡片维护、验收裁决 |
|
|
187
|
+
| [.agents/skills/promo-video/](.agents/skills/promo-video/) | 宣传片流水线(需本仓开发环境:Playwright + ffmpeg):分镜、旁白时间轴、录制与封面制作;旁白见 `doubao-tts/`,封面见 `promo-stills/` |
|
|
200
188
|
|
|
201
189
|
## 致谢
|
|
202
190
|
|