dsh-hive-panel 0.2.3 → 1.0.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/CHANGELOG.md CHANGED
@@ -1,3 +1,66 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented in this file. The format is
4
+ based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
5
+ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [1.0.0] - 2026-12-04
8
+
9
+ ### Stable
10
+
11
+ - The plugin's public surface is frozen for the 1.x line: the conversation view and its
12
+ snapshot shape (board, tasks, stats, events, runner status, `queen` state,
13
+ `autoQueen`), the allowlisted host actions (init/add/plan/claim/done/fail/retry/renew/
14
+ mode/learn/recall/verdict/run/commit/doctor/remove/roles-add/roles-remove/queen-on/
15
+ queen-off), the config keys (`writable`, `autoQueen`, `bins`) and the
16
+ `dsh.compatibility` declaration keep their names and semantics during 1.x; new fields
17
+ and actions may be added, removals wait for a future major.
18
+ - The queen-session registration with `dsh-hive-runner` and the browser bundle contract
19
+ (module id, `exports["./client"]`, injected slot) stay stable.
20
+
21
+ ### Compatibility
22
+
23
+ - DSH 0.2.2-rc.5, Node >=22.19, profiles `desktop` and `web`. Upgrading from 0.3.x
24
+ needs no profile change beyond the version; the same Hive refs are read and
25
+ `dsh-hive-runner` 1.x is the optional supervisor.
26
+ - The standalone `@d86e/hive-panel` 1.x board can run side by side; both read the same
27
+ refs and `.hive/` files.
28
+
29
+ ## [0.3.0] - 2026-12-04
30
+
31
+ ### Changed
32
+
33
+ - Queen prompt refresh: the built-in fallback role and the exit hint now describe the
34
+ coordinator contract — plan and coordinate, split work into fine-grained cards that
35
+ each carry an acceptance command, then order, supervise, review and report; never
36
+ write code, commit, or claim/finish cards; load the `hive-queen` skill. The injected
37
+ role text cap rises from 4096 to 16384 characters (`QUEEN_MAX_CHARS`).
38
+ - The plan action's `--max-cards` defaults to 50 (was 8) and accepts 0, which means no
39
+ limit and is forwarded to the CLI unchanged. The shared renderer is re-synced from
40
+ hive-panel 0.5.0: the goal dialog's **Max tasks** field defaults to 50, allows 0 with
41
+ the hint "0 = no limit" (「0 = 不限」), validates any whole number of 0 or more, and
42
+ forwards 0 unchanged. `lib/client.js` is rebuilt.
43
+
44
+ ### Tests
45
+
46
+ - `npm run check` passes (34 checks): new plan argv assertions (50 default, 0
47
+ unchanged, negative/fractional rejected) and a missing-role-file fallback assertion
48
+ for the coordinator contract; the truncation check now expects 16384 characters.
49
+
50
+ ### Docs
51
+
52
+ - README, README.zh-CN, SPEC, SECURITY, docs/DESIGN.md and docs/QUEEN-ACTIVATION.md
53
+ describe the new cap and the coordinator contract.
54
+ - README, README.zh-CN and SPEC are aligned with the 0.3.0 code: task/agent terminology,
55
+ the task details (last run output, "Also writing" overlaps, lessons, Open agent chat),
56
+ the per-role concurrency settings, the supervisor indicator, the current profile
57
+ install example, and the snapshot/action/execution contract (mode object, lastRun,
58
+ roles, npx fallback, timeouts, queen registration).
59
+
60
+ ### Published
61
+
62
+ - npm: `dsh-hive-panel@0.3.0` on 2026-12-04.
63
+
1
64
  ## [0.2.3] - 2026-12-04
2
65
 
3
66
  ### Added
@@ -8,6 +71,10 @@
8
71
  access restores the parent; the runner then dispatches card workers into the
9
72
  queen conversation instead of a hidden session or an arbitrary live agent.
10
73
 
74
+ ### Published
75
+
76
+ - npm: `dsh-hive-panel@0.2.3` on 2026-12-04.
77
+
11
78
  ## [0.2.2] - 2026-12-04
12
79
 
13
80
  ### Added
@@ -106,16 +173,6 @@
106
173
  errors, and the task cap is labelled "Max tasks".
107
174
  - The panel mirrors the standalone board: inlined supervisor, settings gear in the toolbar,
108
175
  pause as a toolbar action, simplified menu and unified icons.
109
-
110
- ### Fixed
111
-
112
- - Settings action button alignment.
113
- - 25 checks now cover the roles snapshot view, roles-add and the remove allowlist.
114
-
115
- ## [Unreleased]
116
-
117
- ### Added
118
-
119
176
  - `remove` panel action: deletes a task card through `hive tasks rm <id>` (the hive
120
177
  router forwards `tasks` to hive-tasks) with a strict lowercase card-id check
121
178
  (`^[a-z0-9][a-z0-9-]{1,63}$`) and no `--force`. The CLI stderr reaches the panel
@@ -123,6 +180,11 @@
123
180
  `ok:false, code:2` plus that stderr. The shared renderer's drawer exposes the action
124
181
  as a red button with a second confirmation. `lib/client.js` rebuilt.
125
182
 
183
+ ### Fixed
184
+
185
+ - Settings action button alignment.
186
+ - 25 checks now cover the roles snapshot view, roles-add and the remove allowlist.
187
+
126
188
  ### Published
127
189
 
128
190
  - npm: `dsh-hive-panel@0.1.5` on 2026-12-04.
@@ -135,12 +197,6 @@
135
197
  localStorage); the notice no longer carries a `/queen off` button, and the exit
136
198
  instructions moved into the view's `...` menu. Browser bundle rebuilt.
137
199
 
138
- # Changelog
139
-
140
- All notable changes to this project are documented in this file. The format is
141
- based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
142
- adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
143
-
144
200
  ### Published
145
201
 
146
202
  - npm: `dsh-hive-panel@0.1.4` on 2026-12-04.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  **English** · [简体中文](README.zh-CN.md)
6
6
 
7
7
  **A Hive board and a queen inside DSH Web.** One conversation view that reads the Hive
8
- state of the Session's repository, initialises it, and turns a goal into task cards.
8
+ state of the Session's repository, initialises it, and turns a goal into tasks.
9
9
 
10
10
  [![CI](https://img.shields.io/github/actions/workflow/status/d86e/dsh-hive-panel/ci.yml?style=for-the-badge&logo=github)](https://github.com/d86e/dsh-hive-panel/actions)
11
11
  [![npm](https://img.shields.io/npm/v/dsh-hive-panel?style=for-the-badge&logo=npm&color=cb3837)](https://www.npmjs.com/package/dsh-hive-panel)
@@ -16,10 +16,10 @@ state of the Session's repository, initialises it, and turns a goal into task ca
16
16
 
17
17
  ---
18
18
 
19
- [Hive](https://github.com/d86e/hive) coordinates a swarm of coding agents inside git: task
20
- cards, path leases, a presence board and a commit-time merge, all as refs and files in the
19
+ [Hive](https://github.com/d86e/hive) coordinates a swarm of coding agents inside git: tasks,
20
+ path announcements, a presence board and a commit-time merge, all as refs and files in the
21
21
  repository itself. **dsh-hive-panel** brings that state into DSH Web as one conversation
22
- view, so you can watch the board, plan with a queen and act on cards without leaving the
22
+ view, so you can watch the board, plan with a queen and act on tasks without leaving the
23
23
  Session.
24
24
 
25
25
  Two halves install together:
@@ -30,19 +30,21 @@ Two halves install together:
30
30
 
31
31
  The repository is always the Session's working directory: the browser never sends a path
32
32
  and nothing is configured per project. There is no extra port, no sidecar dashboard and no
33
- second source of truth — every card, lease and event stays in git and `.hive/`, exactly as
33
+ second source of truth — every task, claim and event stays in git and `.hive/`, exactly as
34
34
  the Hive CLI writes them.
35
35
 
36
36
  ## What you get
37
37
 
38
38
  | Capability | What it means |
39
39
  | --- | --- |
40
- | **A Hive tab in the conversation** | Board lanes (pending, claimed, done, failed), card details and the event tail, scoped to the Session's repository |
40
+ | **A Hive tab in the conversation** | The board lanes (pending, claimed, done, failed), the header agents count, the event drawer and task details, scoped to the Session's repository |
41
41
  | **Initialise from the tab** | Run `hive init` on an uninitialised repository and start using it immediately |
42
- | **Queen mode** | An initialised repository makes the current Session the queen automatically: it plans and splits goals into cards instead of writing code. `/queen off` exits; `/queen on` (or the panel action) re-enters |
43
- | **Card actions** | Claim, complete, fail, retry, renew, run a round and more — from the card you are looking at |
44
- | **Runner strip** | When [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) is installed, per-repository supervisor state (idle, running, paused), live worker counts and pause/resume |
45
- | **Read-only by default** | Watching the board is safe out of the box; mutations are opt-in |
42
+ | **Queen mode** | An initialised repository makes the current Session the queen automatically: it plans and coordinates, splits goals into fine-grained tasks that each carry an acceptance command, then orders, supervises, reviews and reports — it never writes code. A header badge shows whether the Queen is active. `/queen off` exits; `/queen on` or the **Let the Queen take over** button re-enters |
43
+ | **Task actions** | Claim, complete, fail, retry and delete a task from its details; create tasks, ask the Queen for a task plan and pause or resume claiming from the toolbar |
44
+ | **Task details** | ID, role, state and file scope, plus the last run: output, the **Also writing** overlap announcements and the lessons read. **Open agent chat** jumps to that worker's conversation when DSH can navigate to it |
45
+ | **Settings** | The toolbar gear opens per-role concurrency limits (0–999, 0 pauses the role; needs `dsh-hive-runner`) and role management (add a role with adapter, model and responsibilities; delete a role) |
46
+ | **Supervisor status** | When [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) is installed, the toolbar shows the current repository's supervisor state (idle, running, backoff, paused) with the running agent count, and **Resume** while paused |
47
+ | **Read-only by default** | Watching the board is safe out of the box; mutations (including settings writes) are opt-in |
46
48
 
47
49
  ## Requirements
48
50
 
@@ -50,24 +52,28 @@ the Hive CLI writes them.
50
52
  plugin declares compatibility with.
51
53
  - Node 22.19 or newer (the DSH runtime).
52
54
  - The Hive CLI packages: [`@d86e/hive`](https://github.com/d86e/hive) and
53
- [hive-tasks](https://github.com/d86e/hive-tasks). `hive-runner` and `merge-on-commit`
54
- are optional. The panel runs them by their PATH names and retries through `npx` when
55
- one is not on the shell PATH (see [Configuration](#configuration)).
55
+ [hive-tasks](https://github.com/d86e/hive-tasks). The goal planner additionally needs
56
+ `hive-run`, which the [hive-runner](https://github.com/d86e/hive-runner) package
57
+ publishes; `merge-on-commit` is optional (the `moc` commit action). The panel runs
58
+ these by their PATH names and retries through `npx` when one is not on the shell PATH
59
+ (see [Configuration](#configuration)).
56
60
  - [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) is optional; it adds the
57
- resident supervisor and its status strip.
61
+ resident supervisor, the supervisor indicator and the per-role concurrency settings.
58
62
 
59
63
  ## Install
60
64
 
61
- The `desktop` profile belongs to the DSH Desktop application, but the `dsh` CLI can
62
- install into it while the app is not running. Use the CLI of the same version as the
63
- Desktop runtime (the plugin declares compatibility with DSH 0.2.2-rc.5):
65
+ The `desktop` profile belongs to the DSH Desktop application. With the app quit, use the
66
+ `dsh` command installed by DSH Desktop: that carrier may manage the reserved `desktop`
67
+ profile, while a separately installed npm `dsh` refuses it. The plugin declares
68
+ compatibility with DSH 0.2.2-rc.5.
64
69
 
65
- 1. **Quit DSH Desktop completely.** The profile is locked while the app runs.
70
+ 1. **Quit DSH Desktop completely.** The profile cannot be modified while the app runs.
66
71
  If the Desktop app has never been opened, start it once so it creates
67
72
  `~/.dsh/profiles/desktop/package.json`, then quit it.
68
73
 
69
- 2. **Install the plugin into the profile.** `dsh` and `pnpm` must be on your PATH;
70
- the command updates both `dependencies` and `dsh.profile.bundles` for you:
74
+ 2. **Install the plugin into the profile.** `dsh` must be on your PATH; the Desktop
75
+ carrier ships the package manager it runs. The command updates both
76
+ `dependencies` and `dsh.profile.bundles` for you:
71
77
 
72
78
  ```bash
73
79
  dsh plugin --profile desktop add dsh-hive-panel
@@ -90,7 +96,7 @@ trailing comma only when another entry follows.
90
96
 
91
97
  ```diff
92
98
  "dependencies": {
93
- + "dsh-hive-panel": "^0.1.8",
99
+ + "dsh-hive-panel": "^1.0.0",
94
100
  },
95
101
  "dsh": {
96
102
  "profile": {
@@ -123,11 +129,17 @@ restarts with `dsh web` instead of the desktop app.
123
129
  needs writes enabled (see [Configuration](#configuration)).
124
130
  4. **Become the queen.** A successful initialisation — or opening the view on a
125
131
  repository that is already initialised — marks the current Session as the queen: it
126
- only plans and splits cards, it does not edit code. Tell it a goal in the
127
- conversation, or use **Give the queen a goal**, preview the plan and write the cards.
128
- 5. **Work the board.** Cards appear in their lanes; open one to see details and the actions
129
- available for its state. If `dsh-hive-runner` is installed, its strip at the top shows
130
- each repository's supervisor state and lets you pause or resume it.
132
+ plans and coordinates, splits work into fine-grained tasks that each carry an acceptance
133
+ command, and orders, supervises, reviews and reports; it never edits code or commits.
134
+ If the notice is inactive (after `/queen off`, or with `autoQueen: false`), click
135
+ **Let the Queen take over**. Tell it a goal in the conversation, or click
136
+ **Set the Queen a goal**, preview the plan and write the tasks. The goal dialog's
137
+ **Max tasks** field defaults to 50; `0` means no limit.
138
+ 5. **Work the board.** Tasks appear in their lanes; open one to see its details, its last
139
+ run and the actions available for its state. The gear opens **Settings**: per-role
140
+ concurrency limits (with `dsh-hive-runner` installed) and adding or deleting roles.
141
+ If `dsh-hive-runner` is installed, the toolbar also shows this repository's supervisor
142
+ state and a **Resume** button while it is paused.
131
143
  6. `/queen off` returns the Session to normal coding; the Hive view keeps working.
132
144
 
133
145
  ## Configuration
@@ -153,13 +165,16 @@ Restart DSH after changing the config.
153
165
 
154
166
  | Key | Default | Meaning |
155
167
  | --- | --- | --- |
156
- | `autoQueen` | `true` | Make the current Session the queen automatically when the view opens on an initialised repository. Set to `false` to enter queen mode only with `/queen on` or the panel action |
157
- | `writable` | `false` | Allow mutating actions (init, add, claim, done, fail, mode, ...). When false the board is still readable and mutations are hidden or rejected |
168
+ | `autoQueen` | `true` | Make the current Session the queen automatically when a snapshot sees an initialised repository. Set to `false` to enter queen mode only with `init`, `/queen on` or the **Let the Queen take over** button |
169
+ | `writable` | `false` | Allow mutating actions (init, add, plan, claim, done, fail, retry, remove, mode, roles-add, roles-remove, ...). When false the board is still readable and mutations are hidden or rejected |
158
170
  | `bins.hive` | `hive` from PATH | `hive` executable: PATH name or absolute path. When missing, retried through `npx -y -p @d86e/hive -p hive-consensus -p hive-tasks -p hive-runner -p merge-on-commit hive` |
159
171
  | `bins.tasks` | `hive-tasks` from PATH | `hive-tasks` executable; npx fallback `-p hive-tasks` |
160
- | `bins.run` | `hive-run` from PATH | `hive-run` executable (the run action); npx fallback `-p hive-runner` |
172
+ | `bins.run` | `hive-run` from PATH | `hive-run` executable: the goal planner (`hive-run plan`) and the `run` action; npx fallback `-p hive-runner` |
161
173
  | `bins.moc` | `moc` from PATH | `moc` executable (merge-on-commit hooks); npx fallback `-p merge-on-commit` |
162
174
 
175
+ Two optional bounds are accepted as well: `timeoutMs` for one snapshot read (default
176
+ 30000) and `actionTimeoutMs` for one action (default 1800000).
177
+
163
178
  **PATH first, `npx` second.** The defaults are the PATH names above, so a machine with
164
179
  `npm i -g` installs works without any config. DSH's host process often does not inherit
165
180
  your shell PATH; in that case the host retries the same command once through `npx -y -p
@@ -174,7 +189,7 @@ carries an actionable hint (`npm i -g <packages>` plus the `bins.<key>` to set).
174
189
  ```
175
190
  DSH Web (browser)
176
191
  conversation view
177
- └── Hive / 蜂群 tab ──── board · cards · events · runner strip
192
+ └── Hive / 蜂群 tab ──── board · agents · task details · events · settings
178
193
  │
179
194
  │ same-origin request, authenticated by the DSH Session
180
195
  ▼
@@ -191,20 +206,22 @@ DSH host process
191
206
  git: refs/hive/v1/** + .hive/ (the only state)
192
207
  ```
193
208
 
194
- Nothing is stored by the plugin. Queen mode is an in-memory switch in the host process, so
195
- a restart ends it (fail-safe) and no Session log is ever modified.
209
+ The host half stores nothing. Queen mode is an in-memory switch in the host process, so a
210
+ restart ends it (fail-safe) and no Session log is ever modified. Saving role limits in
211
+ Settings posts to `dsh-hive-runner`, which writes `.hive/limits.json` in the repository;
212
+ the browser half only keeps the dismissed queen notice flag in `localStorage`.
196
213
 
197
214
  ## Relationship to the other Hive projects
198
215
 
199
216
  | Project | What it does | How this panel relates |
200
217
  | --- | --- | --- |
201
- | [hive](https://github.com/d86e/hive) | One CLI entry point: init, roles, tasks, run, board, commit, doctor | The panel runs `hive init` and board reads through it |
202
- | [hive-tasks](https://github.com/d86e/hive-tasks) | Task cards with dependencies, priority and acceptance | Cards are what the board displays and the actions mutate |
203
- | [hive-consensus](https://github.com/d86e/hive-consensus) | Path leases, presence board, freeze mode, shared lessons | Claim/renew and the board shown in the tab come from it |
204
- | [hive-runner](https://github.com/d86e/hive-runner) | One execution round per invocation (`hive-run --once`) | The run action starts one round when the binary is configured |
205
- | [merge-on-commit](https://github.com/d86e/merge-on-commit) | Three-way merge at commit time | Optional `moc` binary; not required for the board |
218
+ | [hive](https://github.com/d86e/hive) | One CLI entry point: init, roles, tasks, run, board, commit, doctor | The panel runs `hive init`, the board-read commands and the role commands through it |
219
+ | [hive-tasks](https://github.com/d86e/hive-tasks) | Tasks with dependencies, priority and acceptance | The board displays these tasks and the actions mutate them |
220
+ | [hive-consensus](https://github.com/d86e/hive-consensus) | Path announcements (concurrent writers), presence board, freeze mode, shared lessons | The presence board and the **Also writing** overlap announcements shown in the tab come from it |
221
+ | [hive-runner](https://github.com/d86e/hive-runner) | One execution round per invocation (`hive-run --once`) and the goal planner (`hive-run plan`) | The goal planner and the `run` action use `hive-run` when it is configured |
222
+ | [merge-on-commit](https://github.com/d86e/merge-on-commit) | Three-way merge at commit time | Optional `moc` binary for the `commit` action; not required for the board |
206
223
  | [hive-panel](https://github.com/d86e/hive-panel) | Standalone read-only board outside DSH | Not needed. This plugin is the DSH-native surface; the standalone board can still be used separately |
207
- | [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) | Resident supervisor + subagent workers in DSH | Optional: adds the Runner strip and pause/resume |
224
+ | [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) | Resident supervisor + subagent workers in DSH | Optional: adds the supervisor indicator, resume, the per-role concurrency settings and the workers that execute tasks |
208
225
 
209
226
  ## FAQ
210
227
 
@@ -219,16 +236,16 @@ initialised but empty, the Hive binaries are probably not reachable from the hos
219
236
  the panel already retries each one through `npx`. Follow the install hint in the error
220
237
  (or run `hive-tasks list --json` in a terminal and pin `bins` to that executable).
221
238
 
222
- **The agents strip shows a `hive board` error instead of "No agents yet".** The board CLI
223
- did not run successfully; the strip keeps its exit status and stderr. A common cause is a
224
- `bins.hive` absolute path to the umbrella `hive` router on a source checkout without
239
+ **The board looks empty and the header agents count is disabled.** The `hive board` read
240
+ did not run successfully; the count keeps the diagnostic in its tooltip. A common cause is
241
+ a `bins.hive` absolute path to the umbrella `hive` router on a source checkout without
225
242
  `node_modules`: the router then cannot resolve `hive-consensus` and exits 127 with empty
226
243
  output. Either run `npm install` in that checkout or point `bins.hive` at
227
244
  `hive-consensus/bin/hive.js` (the router is still needed for `hive roles`).
228
245
 
229
246
  **Every button is disabled or the view says read-only.** `writable` is still `false`.
230
247
  Set it to `true` in the profile config and restart DSH. Read-only mode also disables the
231
- initialise button.
248
+ initialise button and every settings write (role add/remove).
232
249
 
233
250
  **"Connection lost" or no snapshot.** The panel resolves the repository from the Session.
234
251
  Keep a live Session open, or reopen the cold Session so its recorded working directory can
@@ -238,12 +255,14 @@ installed DSH (0.2.2-rc.5).
238
255
  **Do I need the standalone `hive-panel`?** No. That project is a separate board served
239
256
  outside DSH. This plugin reads the same refs and files and adds the actions DSH allows.
240
257
 
241
- **Does it write anything into my repository?** Only the commands you trigger — for
242
- example initialisation writes the Hive role files, hooks and refs, exactly as the Hive CLI
243
- does. Queen mode stores nothing.
258
+ **Does it write anything into my repository?** Only the actions you trigger — for example
259
+ initialisation writes the Hive role files, hooks and refs, exactly as the Hive CLI does,
260
+ and saving role limits in Settings is written by `dsh-hive-runner` to
261
+ `.hive/limits.json`. Queen mode stores nothing.
244
262
 
245
263
  **Can several Sessions use it at once?** Yes. Each Session is scoped to its own working
246
- directory, and queen mode applies only to the Session that initialised the repository.
264
+ directory. Queen mode is per Session: any Session that snapshots an initialised repository
265
+ enters it automatically unless that Session ran `/queen off` or `autoQueen` is `false`.
247
266
 
248
267
  ## Security
249
268
 
@@ -258,8 +277,8 @@ directory, and queen mode applies only to the Session that initialised the repos
258
277
  action allowlist; `writable: true` hands the panel repo-scoped command ability. Keep it
259
278
  `false` when you only need to watch.
260
279
  - The queen role text comes from `<repo>/.hive/roles/queen.md` and is treated as
261
- low-trust input: it is labelled as untrusted, has a built-in fallback and is capped at
262
- 4096 characters.
280
+ low-trust input: it is labelled as untrusted, has a built-in coordinator fallback and is
281
+ capped at 16384 characters.
263
282
  - If you expose DSH Web beyond your machine, add authentication or a reverse proxy at the
264
283
  DSH layer first.
265
284
 
@@ -267,13 +286,14 @@ directory, and queen mode applies only to the Session that initialised the repos
267
286
 
268
287
  ```bash
269
288
  npm run check # node --check on the entry points + the offline verification shim
289
+ npm test # alias for npm run check
270
290
  npm pack --dry-run # inspect the published contents
271
291
  ```
272
292
 
273
- `scripts/verify.mjs` runs 31 checks against a Cordis-shaped shim: route registration,
274
- Session cwd resolution, sandbox policy, the action allowlist and quoting, read-only
275
- semantics, response contracts, cold Sessions and the queen lifecycle. It never starts or
276
- restarts a DSH process.
293
+ `scripts/verify.mjs` runs 34 checks against a Cordis-shaped shim: route registration,
294
+ Session cwd resolution, sandbox policy, the action allowlist and quoting, the snapshot
295
+ `lastRun`/`roles` contracts, read-only semantics, response contracts, cold Sessions, the
296
+ queen lifecycle and the PATH → npx fallback. It never starts or restarts a DSH process.
277
297
 
278
298
  The browser bundle `lib/client.js` is generated: after editing `src/`, run
279
299
  `node scripts/build-client.mjs`. The wire protocol is specified in [SPEC.md](SPEC.md);
package/README.zh-CN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [English](README.md) · **简体中文**
6
6
 
7
- **DSH Web 里的 Hive 看板与女王。** 一个会话视图,读取当前 Session 所在仓库的 Hive 状态、初始化仓库,并把目标拆成任务卡。
7
+ **DSH Web 里的 Hive 看板与女王。** 一个会话视图,读取当前 Session 所在仓库的 Hive 状态、初始化仓库,并把目标拆成任务。
8
8
 
9
9
  [![CI](https://img.shields.io/github/actions/workflow/status/d86e/dsh-hive-panel/ci.yml?style=for-the-badge&logo=github)](https://github.com/d86e/dsh-hive-panel/actions)
10
10
  [![npm](https://img.shields.io/npm/v/dsh-hive-panel?style=for-the-badge&logo=npm&color=cb3837)](https://www.npmjs.com/package/dsh-hive-panel)
@@ -15,43 +15,50 @@
15
15
 
16
16
  ---
17
17
 
18
- [Hive](https://github.com/d86e/hive) 让一群 AI agent 在 git 里自我协调:任务卡、路径租约、在场看板、提交时合并,全部是仓库里的 refs 和文件。**dsh-hive-panel** 把这套状态搬进 DSH Web 的一个会话视图:不用离开 Session,就能看看板、和女王一起规划、直接对任务卡动手。
18
+ [Hive](https://github.com/d86e/hive) 让一群智能体在 git 里自我协调:任务、路径公告(同时写入)、在场看板、提交时合并,全部是仓库里的 refs 和文件。**dsh-hive-panel** 把这套状态搬进 DSH Web 的一个会话视图:不用离开 Session,就能看看板、和女王一起规划、直接对任务动手。
19
19
 
20
20
  两半一起安装:
21
21
 
22
22
  - **host 半**运行在 DSH 进程里:把当前 Session 的仓库解析出来,读取 Hive 状态,并只通过 DSH 自己的 shell 执行层运行一份固定目录里的 Hive 命令;
23
23
  - **浏览器半**在会话里加一个 Hive(蜂群)视图。
24
24
 
25
- 仓库永远是当前 Session 的工作目录:浏览器不传路径,也不需要按项目配置。没有额外端口、没有独立看板服务、没有第二份真相——任务卡、租约和事件都留在 git 和 `.hive/` 里,和 Hive CLI 写下的完全一致。
25
+ 仓库永远是当前 Session 的工作目录:浏览器不传路径,也不需要按项目配置。没有额外端口、没有独立看板服务、没有第二份真相——任务、认领和事件都留在 git 和 `.hive/` 里,和 Hive CLI 写下的完全一致。
26
26
 
27
27
  ## 能做什么
28
28
 
29
29
  | 能力 | 说明 |
30
30
  | --- | --- |
31
- | **会话里的 Hive 标签页** | 按状态分列的看板(pending / claimed / done / failed)、任务卡详情和事件尾,作用域是当前 Session 的仓库 |
31
+ | **会话里的 Hive 标签页** | 四个任务分栏(待办 / 进行中 / 已完成 / 失败)、标题栏的智能体计数、事件抽屉和任务详情,作用域是当前 Session 的仓库 |
32
32
  | **在标签页里初始化** | 对没初始化过的仓库执行 `hive init`,立刻可用 |
33
- | **女王模式** | 打开已初始化的仓库时当前会话自动成为女王:只规划、只拆卡,不写代码。`/queen off` 退出,`/queen on`(或面板动作)重新进入 |
34
- | **任务卡动作** | 认领、完成、失败、重试、续租、跑一轮等,都从正在看的那张卡上发起 |
35
- | **Runner 状态条** | 装了 [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 时,顶部显示每个仓库的 supervisor 状态(空闲 / 运行 / 暂停)、在飞 worker 数,并能暂停/恢复 |
36
- | **默认只读** | 开箱即看是安全的;写操作需要显式打开 |
33
+ | **女王模式** | 打开已初始化的仓库时当前会话自动成为女王:负责规划与协调,把目标拆成每条都带验收命令的细粒度任务,再排序、监督、审查和汇报——不写代码。工具栏徽标显示女王是否已接管。`/queen off` 退出,`/queen on` 或提示里的「让女王接管」重新进入 |
34
+ | **任务动作** | 在任务详情里认领、完成、标记失败、重试、删除;在工具栏新建任务、给女王设目标、暂停/恢复认领 |
35
+ | **任务详情** | ID、角色、状态和文件范围,以及最近一次执行:输出、「同时写入」公告和读取的经验条数。**打开智能体对话** 在 DSH 能跳转时直接切到该智能体的会话 |
36
+ | **设置** | 工具栏齿轮打开按角色的并发上限(0–999,0 表示暂停该角色;需要 `dsh-hive-runner`)和角色管理(新增角色可带适配器、模型和职责描述;可删除角色) |
37
+ | **Supervisor 状态** | 装了 [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 时,工具栏显示当前仓库的 supervisor 状态(空闲 / 运行中 / 退避 / 已暂停)、运行中的智能体数,暂停时可点「恢复」 |
38
+ | **默认只读** | 开箱即看是安全的;写操作(包括设置里的写入)需要显式打开 |
37
39
 
38
40
  ## 环境要求
39
41
 
40
42
  - DSH Web,`desktop`(或 `web`)profile,版本 0.2.2-rc.5——插件声明的兼容版本。
41
43
  - Node 22.19 或更新(DSH 运行时)。
42
44
  - Hive 命令行包:[`@d86e/hive`](https://github.com/d86e/hive) 与
43
- [hive-tasks](https://github.com/d86e/hive-tasks)。`hive-runner` 和
44
- `merge-on-commit` 是可选的。面板默认用 PATH 名调用,找不到时自动退到 `npx`(见[配置](#配置))。
45
- - [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 可选:装了才有常驻 supervisor 和状态条。
45
+ [hive-tasks](https://github.com/d86e/hive-tasks)。女王的目标规划还需要 `hive-run`
46
+ (由 [hive-runner](https://github.com/d86e/hive-runner) 包提供);`merge-on-commit`
47
+ 是可选的(`moc` 提交动作)。面板默认用 PATH 名调用,找不到时自动退到 `npx`
48
+ (见[配置](#配置))。
49
+ - [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 可选:提供常驻 supervisor、
50
+ supervisor 状态指示和按角色的并发上限设置。
46
51
 
47
52
  ## 安装
48
53
 
49
- `desktop` profile 归 DSH Desktop 应用管理,但应用没在运行时可以用 `dsh` CLI 装进去。请使用与桌面运行时同版本的 CLI(插件声明兼容 DSH 0.2.2-rc.5):
54
+ `desktop` profile 归 DSH Desktop 应用管理。请在应用退出时使用 DSH Desktop 自带的
55
+ `dsh` 命令:这个载体可以管理保留的 `desktop` profile,而另外通过 npm 安装的
56
+ `dsh` 会拒绝该 profile。插件声明兼容 DSH 0.2.2-rc.5。
50
57
 
51
- 1. **完全退出 DSH Desktop。** 应用运行时 profile 是被锁住的。
58
+ 1. **完全退出 DSH Desktop。** 应用运行时 profile 无法修改。
52
59
  如果桌面应用从没打开过,先启动一次让它生成 `~/.dsh/profiles/desktop/package.json`,再退出。
53
60
 
54
- 2. **把插件装进 profile。** `dsh` 和 `pnpm` 需要在 PATH 上;
61
+ 2. **把插件装进 profile。** `dsh` 需要在 PATH 上;Desktop 载体自带它使用的包管理器。
55
62
  下面这条命令会同时更新 `dependencies` 和 `dsh.profile.bundles`:
56
63
 
57
64
  ```bash
@@ -74,7 +81,7 @@
74
81
 
75
82
  ```diff
76
83
  "dependencies": {
77
- + "dsh-hive-panel": "^0.1.8",
84
+ + "dsh-hive-panel": "^1.0.0",
78
85
  },
79
86
  "dsh": {
80
87
  "profile": {
@@ -96,8 +103,8 @@ cd ~/.dsh/profiles/desktop && pnpm install
96
103
  1. **安装**插件并重启 DSH(见上)。
97
104
  2. **开会话**:在要协调的 git 仓库里开一个 Session。会话的 cwd 就是仓库,面板不会问你要路径。
98
105
  3. **打开 Hive 视图**。仓库还没初始化时,点「初始化 Hive」,它会写入角色文件、钩子和协调 refs——需要先打开写权限(见[配置](#配置))。
99
- 4. **进入女王模式**:初始化成功、或对已初始化的仓库打开视图,会把当前会话标记为女王;它只规划、只拆卡,不改代码。直接在对话里说目标,或者点「给女王下目标」,先预览计划、确认后写入任务卡。
100
- 5. **用看板干活**:任务卡出现在对应分栏;点开卡片看详情和该状态可用的动作。装了 `dsh-hive-runner` 时,顶部状态条显示各仓库的 supervisor 状态,可以直接暂停/恢复。
106
+ 4. **进入女王模式**:初始化成功、或对已初始化的仓库打开视图,会把当前会话标记为女王;它只规划、只拆任务,不改代码。若提示显示未接管(`/queen off` 过,或 `autoQueen: false`),点「让女王接管」。直接在对话里说目标,或者点「给女王设目标」,先预览计划、确认后写入任务;目标对话框的「最大任务数」默认 50,`0` 表示不限。
107
+ 5. **用看板干活**:任务出现在对应分栏;点开任务看详情、最近一次执行和该状态可用的动作。工具栏的齿轮打开**设置**:按角色的并发上限(需要 `dsh-hive-runner`)以及新增/删除角色。装了 `dsh-hive-runner` 时,工具栏还会显示当前仓库的 supervisor 状态,暂停时可点「恢复」。
101
108
  6. `/queen off` 让会话回到普通编码模式;Hive 视图照常工作。
102
109
 
103
110
  ## 配置
@@ -121,13 +128,16 @@ cd ~/.dsh/profiles/desktop && pnpm install
121
128
 
122
129
  | 配置项 | 默认 | 含义 |
123
130
  | --- | --- | --- |
124
- | `autoQueen` | `true` | 对已初始化的仓库打开视图时自动让当前会话成为女王。设为 `false` 时只能用 `/queen on` 或面板动作手动进入 |
125
- | `writable` | `false` | 是否允许写动作(init、add、claim、done、fail、mode……)。关闭时看板仍可读,写动作被隐藏或拒绝 |
131
+ | `autoQueen` | `true` | 快照看到已初始化的仓库时自动让当前会话成为女王。设为 `false` 时只能用 `init`、`/queen on` 或「让女王接管」手动进入 |
132
+ | `writable` | `false` | 是否允许写动作(init、add、plan、claim、done、fail、retry、remove、mode、roles-add、roles-remove……)。关闭时看板仍可读,写动作被隐藏或拒绝 |
126
133
  | `bins.hive` | PATH 上的 `hive` | `hive` 可执行文件:PATH 名或绝对路径。找不到时用 `npx -y -p @d86e/hive -p hive-consensus -p hive-tasks -p hive-runner -p merge-on-commit hive` 重试 |
127
134
  | `bins.tasks` | PATH 上的 `hive-tasks` | `hive-tasks` 可执行文件;npx 回退 `-p hive-tasks` |
128
- | `bins.run` | PATH 上的 `hive-run` | `hive-run` 可执行文件(跑一轮动作);npx 回退 `-p hive-runner` |
135
+ | `bins.run` | PATH 上的 `hive-run` | `hive-run` 可执行文件:女王的目标规划(`hive-run plan`)和 `run` 动作;npx 回退 `-p hive-runner` |
129
136
  | `bins.moc` | PATH 上的 `moc` | `moc` 可执行文件(merge-on-commit);npx 回退 `-p merge-on-commit` |
130
137
 
138
+ 另外还接受两个可选的超时上限:`timeoutMs`(单次快照读取,默认 30000)和
139
+ `actionTimeoutMs`(单次动作,默认 1800000)。
140
+
131
141
  **先 PATH,再 npx。** 默认值就是上面的 PATH 名,所以用 `npm i -g` 装过的机器不需要任何配置。
132
142
  DSH 宿主进程通常拿不到你 shell 的 PATH,这时宿主会把同一条命令用 `npx -y -p <包> ...` 重试一次,
133
143
  仍然失败才报错。首次使用需要联网让 npx 填充缓存;离线机器请全局安装或用绝对路径固定 `bins`。
@@ -139,7 +149,7 @@ DSH 宿主进程通常拿不到你 shell 的 PATH,这时宿主会把同一条
139
149
  ```
140
150
  DSH Web(浏览器)
141
151
  会话视图
142
- └── Hive / 蜂群 标签页 ──── 看板 · 任务卡 · 事件 · Runner 状态条
152
+ └── Hive / 蜂群 标签页 ──── 看板 · 智能体 · 任务详情 · 事件 · 设置
143
153
  │
144
154
  │ 同源请求,由 DSH Session 认证
145
155
  ▼
@@ -156,19 +166,19 @@ DSH 宿主进程
156
166
  git: refs/hive/v1/** + .hive/ (唯一的状态)
157
167
  ```
158
168
 
159
- 插件自己不存任何状态。女王模式只是宿主进程里的内存开关,重启即退出(fail-safe),也不会改动会话日志。
169
+ 面板的 host 半不存任何状态。女王模式只是宿主进程里的内存开关,重启即退出(fail-safe),也不会改动会话日志;设置里保存的角色并发上限由 `dsh-hive-runner` 写入仓库的 `.hive/limits.json`;浏览器半只在 `localStorage` 里记「女王提示已关闭」。
160
170
 
161
171
  ## 与 Hive 其他仓库的关系
162
172
 
163
173
  | 仓库 | 作用 | 与本面板的关系 |
164
174
  | --- | --- | --- |
165
- | [hive](https://github.com/d86e/hive) | 统一入口:init、roles、tasks、run、board、commit、doctor | 面板通过它执行 `hive init` 和看板读取 |
166
- | [hive-tasks](https://github.com/d86e/hive-tasks) | 带依赖、优先级、验收命令的任务卡 | 看板展示、动作操作的就是这些卡 |
167
- | [hive-consensus](https://github.com/d86e/hive-consensus) | 路径租约、在场看板、冻结模式、共享经验 | 认领/续租和标签页里的看板来自它 |
168
- | [hive-runner](https://github.com/d86e/hive-runner) | 每次调用跑一轮执行(`hive-run --once`) | 配置了二进制时,「跑一轮」动作会调用它 |
169
- | [merge-on-commit](https://github.com/d86e/merge-on-commit) | 提交时三方合并 | 可选的 `moc` 二进制,看板不依赖它 |
175
+ | [hive](https://github.com/d86e/hive) | 统一入口:init、roles、tasks、run、board、commit、doctor | 面板通过它执行 `hive init`、看板读取和角色命令 |
176
+ | [hive-tasks](https://github.com/d86e/hive-tasks) | 带依赖、优先级、验收命令的任务 | 看板展示、动作操作的就是这些任务 |
177
+ | [hive-consensus](https://github.com/d86e/hive-consensus) | 路径公告(同时写入)、在场看板、冻结模式、共享经验 | 标签页里的在场看板和「同时写入」公告来自它 |
178
+ | [hive-runner](https://github.com/d86e/hive-runner) | 每次调用跑一轮执行(`hive-run --once`),也提供目标规划器(`hive-run plan`) | 女王的目标规划和 `run` 动作在配置后调用它 |
179
+ | [merge-on-commit](https://github.com/d86e/merge-on-commit) | 提交时三方合并 | 可选的 `moc` 二进制,供 `commit` 动作使用;看板不依赖它 |
170
180
  | [hive-panel](https://github.com/d86e/hive-panel) | DSH 之外的独立只读看板 | 不需要装。本插件是 DSH 原生界面,独立看板仍可单独使用 |
171
- | [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) | DSH 里的常驻 supervisor + subagent worker | 可选:提供 Runner 状态条和暂停/恢复 |
181
+ | [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) | DSH 里的常驻 supervisor + 子智能体 | 可选:提供 supervisor 状态指示、暂停/恢复、按角色的并发上限设置,以及执行任务的子智能体 |
172
182
 
173
183
  ## 常见问题
174
184
 
@@ -176,34 +186,35 @@ DSH 宿主进程
176
186
 
177
187
  **看板是空的。** 先看视图里的 `initialised`。仓库不在 git 下、或还没初始化时会显示初始化按钮;已初始化但空,通常是宿主进程找不到 Hive 二进制——面板已经会自动用 `npx` 重试。按报错里的安装提示处理(或者在终端跑 `hive-tasks list --json`,把 `bins` 固定到那个可执行文件)。
178
188
 
179
- **智能体条显示 `hive board` 错误而不是「后台无智能体」。** board CLI 没有执行成功,条上会保留退出状态和 stderr。常见原因是 `bins.hive` 的绝对路径指向源码 checkout 里的 umbrella `hive` router,而该目录没有 `node_modules`:router 找不到 `hive-consensus`,以 127 退出且没有任何输出。在该 checkout 里跑 `npm install`,或把 `bins.hive` 指到 `hive-consensus/bin/hive.js`(`hive roles` 仍需要 router)。
189
+ **看板像是空的、标题栏的智能体计数不可点。** `hive board` 没有执行成功;计数会把诊断信息放在提示(tooltip)里。常见原因是 `bins.hive` 的绝对路径指向源码 checkout 里的 umbrella `hive` router,而该目录没有 `node_modules`:router 找不到 `hive-consensus`,以 127 退出且没有任何输出。在该 checkout 里跑 `npm install`,或把 `bins.hive` 指到 `hive-consensus/bin/hive.js`(`hive roles` 仍需要 router)。
180
190
 
181
- **按钮全灰 / 提示只读。** `writable` 还是 `false`。在 profile 配置里改成 `true` 并重启 DSH。只读模式下「初始化 Hive」也不可用。
191
+ **按钮全灰 / 提示只读。** `writable` 还是 `false`。在 profile 配置里改成 `true` 并重启 DSH。只读模式下「初始化 Hive」不可用,设置里的角色新增/删除也不可用。
182
192
 
183
193
  **提示连接断开或拿不到快照。** 面板从 Session 解析仓库:保持 Session 活着,或重新打开冷会话,让记录的工作目录可读。仍然失败就看 DSH 日志,并确认插件版本与安装的 DSH(0.2.2-rc.5)匹配。
184
194
 
185
195
  **还需要装独立的 `hive-panel` 吗?** 不需要。那是 DSH 之外的独立看板;本插件读同一份 refs 和文件,并额外提供 DSH 允许的动作。
186
196
 
187
- **它会往我的仓库里写东西吗?** 只写你触发的命令——例如初始化会写入 Hive 的角色文件、钩子和 refs,和 Hive CLI 的行为一致。女王模式不存任何东西。
197
+ **它会往我的仓库里写东西吗?** 只写你触发的动作——例如初始化会写入 Hive 的角色文件、钩子和 refs,和 Hive CLI 的行为一致;设置里保存角色并发上限由 `dsh-hive-runner` 写入 `.hive/limits.json`。女王模式不存任何东西。
188
198
 
189
- **多个会话能同时用吗?** 能。每个会话只作用于自己的工作目录,女王模式只影响初始化该仓库的那个会话。
199
+ **多个会话能同时用吗?** 能。每个会话只作用于自己的工作目录。女王模式按会话隔离:任何打开已初始化仓库的会话都会自动进入,除非该会话 `/queen off` 过,或配置了 `autoQueen: false`。
190
200
 
191
201
  ## 安全
192
202
 
193
203
  - 浏览器只能选动作名和合法的参数值。host 侧为每个动作构造固定命令,参数逐项校验、作为单个 token 加引号,绝不拼进 shell 语法。
194
204
  - 命令经 DSH 的 shell 执行层执行:当前 Session 的 sandbox 策略、凭证擦除、超时、输出上限和取消都会生效。插件自己不 spawn 进程。
195
205
  - 面板触发的动作**不经过审批**,也不写进会话审计。安全边界是「当前 Session sandbox + host 侧动作白名单」;`writable: true` 相当于把仓库范围内的命令能力交给这个看板。只需要看时保持 `false`。
196
- - 女王角色文本来自 `<repo>/.hive/roles/queen.md`,按低信任输入处理:带不可信标注、缺失时用内置兜底、总长上限 4096 字符。
206
+ - 女王角色文本来自 `<repo>/.hive/roles/queen.md`,按低信任输入处理:带不可信标注、缺失时用内置的协调者兜底、总长上限 16384 字符。
197
207
  - 要把 DSH Web 暴露到本机之外,先在 DSH 层做认证或反向代理。
198
208
 
199
209
  ## 开发
200
210
 
201
211
  ```bash
202
212
  npm run check # 入口语法检查 + 离线验证
213
+ npm test # 等同 npm run check
203
214
  npm pack --dry-run # 检查发布内容
204
215
  ```
205
216
 
206
- `scripts/verify.mjs` 在 Cordis 形状的 shim 上跑 29 项检查:路由注册、Session cwd 解析、sandbox 策略、动作白名单与转义、只读语义、响应契约、冷会话和女王生命周期。不会启动或重启任何 DSH 进程。
217
+ `scripts/verify.mjs` 在 Cordis 形状的 shim 上跑 34 项检查:路由注册、Session cwd 解析、sandbox 策略、动作白名单与转义、快照 `lastRun`/`roles` 契约、只读语义、响应契约、冷会话、女王生命周期,以及 PATH → npx 回退。不会启动或重启任何 DSH 进程。
207
218
 
208
219
  浏览器 bundle `lib/client.js` 是生成物:改完 `src/` 后跑 `node scripts/build-client.mjs`。线上协议见 [SPEC.md](SPEC.md),实现说明和 DSH 实测证据见 [docs/DESIGN.md](docs/DESIGN.md)。
209
220