dsh-hive-panel 0.1.8 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +77 -1
- package/README.md +77 -42
- package/README.zh-CN.md +58 -37
- package/SPEC.md +42 -5
- package/cordis.patch.yml +6 -4
- package/docs/DESIGN.md +98 -13
- package/lib/client.js +1313 -353
- package/lib/index.js +328 -12
- package/package.json +1 -1
- package/scripts/build-client.mjs +3 -0
- package/scripts/verify-host-exec.mjs +11 -5
- package/scripts/verify.mjs +276 -5
- package/src/client.template.js +51 -0
- package/src/panel.css +434 -93
- package/src/panel.js +1258 -352
- package/src/theme.css +1 -18
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,75 @@
|
|
|
1
|
+
## [0.2.3] - 2026-12-04
|
|
2
|
+
|
|
3
|
+
### Added
|
|
4
|
+
|
|
5
|
+
- Queen activation now registers the queen Session id with the resident
|
|
6
|
+
`dsh-hive-runner` supervisor (`ctx.get('hiveSupervisor').setQueenSession()`).
|
|
7
|
+
Every panel snapshot re-registers it, so after a plugin restart the next panel
|
|
8
|
+
access restores the parent; the runner then dispatches card workers into the
|
|
9
|
+
queen conversation instead of a hidden session or an arbitrary live agent.
|
|
10
|
+
|
|
11
|
+
## [0.2.2] - 2026-12-04
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- The card drawer's "Last run" block reports hive-consensus overlaps and the
|
|
16
|
+
worker's memory recall, synced from hive-panel 0.4.2: one "Also writing"
|
|
17
|
+
(同时写入) row lists the other agents that announced the same paths, and one
|
|
18
|
+
line reads the lessons summary ("Read N lessons" / 读取了 N 条经验, or
|
|
19
|
+
"No lessons to read" / 没有可读取的经验).
|
|
20
|
+
- `lib/index.js` forwards a run record's `overlaps` and `lessons` verbatim when
|
|
21
|
+
present, so the inlined renderer can normalize them; a legacy record keeps its
|
|
22
|
+
exact previous snapshot shape.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- The shared renderer and stylesheet are re-synced from hive-panel 0.4.2 and
|
|
27
|
+
`lib/client.js` is rebuilt.
|
|
28
|
+
|
|
29
|
+
### Tests
|
|
30
|
+
|
|
31
|
+
- `npm run check` passes (33 checks); the rebuilt client bundle carries both new
|
|
32
|
+
labels and the recall copy.
|
|
33
|
+
|
|
34
|
+
## [0.2.1] - 2026-12-04
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
38
|
+
- A failed `hive board --json` read no longer becomes a silent empty board: the snapshot
|
|
39
|
+
carries `boardError` with the exit status and CLI stderr (or a timeout/malformed-JSON
|
|
40
|
+
diagnostic), and the agents strip shows that diagnostic instead of "No agents yet".
|
|
41
|
+
This surfaced the live setup where an absolute `bins.hive` umbrella router could not
|
|
42
|
+
resolve its `hive-consensus` core and exited 127 with empty output.
|
|
43
|
+
- An in-progress card's last-run record now exposes the worker Session as soon as the
|
|
44
|
+
activation is accepted (paired with dsh-hive-runner 0.6.5), so the card drawer's
|
|
45
|
+
"Open agent chat" button appears for running cards too.
|
|
46
|
+
|
|
47
|
+
## [0.2.0] - 2026-12-04
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- The Hive tab has four lanes (pending / claimed / done / failed), matching hive-tasks
|
|
52
|
+
1.6.0. The blocked lane and its filter chip, copy and styles are gone; a failed card
|
|
53
|
+
keeps the retry action.
|
|
54
|
+
- Wide boards lay the four lanes out from 820px of container width, each lane at least
|
|
55
|
+
200px; narrower boards keep the state chips and the single card list. Lane cards keep
|
|
56
|
+
12px horizontal padding, a 14px title and a 12px meta line.
|
|
57
|
+
- The shared renderer and stylesheet are re-synced from hive-panel 0.4.0 and the browser
|
|
58
|
+
bundle is rebuilt.
|
|
59
|
+
|
|
60
|
+
### Removed
|
|
61
|
+
|
|
62
|
+
- The `block` action from the native allowlist. Record a failure with `fail` and requeue
|
|
63
|
+
it with `retry`.
|
|
64
|
+
|
|
65
|
+
### Tests
|
|
66
|
+
|
|
67
|
+
- `npm run check` passes with the action catalog at 18 allowlisted actions.
|
|
68
|
+
|
|
69
|
+
### Published
|
|
70
|
+
|
|
71
|
+
- npm: `dsh-hive-panel@0.2.0` on 2026-12-04.
|
|
72
|
+
|
|
1
73
|
## [0.1.8] - 2026-12-04
|
|
2
74
|
|
|
3
75
|
### Fixed
|
|
@@ -6,6 +78,10 @@
|
|
|
6
78
|
- The queen notice only documents `/queen off` as the exit; the "dismissing does not
|
|
7
79
|
change state" clarification moved into the close button's title/aria-label.
|
|
8
80
|
|
|
81
|
+
### Published
|
|
82
|
+
|
|
83
|
+
- npm: `dsh-hive-panel@0.1.8` on 2026-12-04.
|
|
84
|
+
|
|
9
85
|
## [0.1.6] - 2026-12-04
|
|
10
86
|
|
|
11
87
|
### Changed
|
|
@@ -136,4 +212,4 @@ First public snapshot.
|
|
|
136
212
|
|
|
137
213
|
### Published
|
|
138
214
|
|
|
139
|
-
- npm: `dsh-hive-panel@0.1.0` on 2026-12-04.
|
|
215
|
+
- npm: `dsh-hive-panel@0.1.0` on 2026-12-04.
|
package/README.md
CHANGED
|
@@ -37,10 +37,10 @@ the Hive CLI writes them.
|
|
|
37
37
|
|
|
38
38
|
| Capability | What it means |
|
|
39
39
|
| --- | --- |
|
|
40
|
-
| **A Hive tab in the conversation** | Board lanes (pending, claimed, done,
|
|
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 |
|
|
41
41
|
| **Initialise from the tab** | Run `hive init` on an uninitialised repository and start using it immediately |
|
|
42
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,
|
|
43
|
+
| **Card actions** | Claim, complete, fail, retry, renew, run a round and more — from the card you are looking at |
|
|
44
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
45
|
| **Read-only by default** | Watching the board is safe out of the box; mutations are opt-in |
|
|
46
46
|
|
|
@@ -51,41 +51,61 @@ the Hive CLI writes them.
|
|
|
51
51
|
- Node 22.19 or newer (the DSH runtime).
|
|
52
52
|
- The Hive CLI packages: [`@d86e/hive`](https://github.com/d86e/hive) and
|
|
53
53
|
[hive-tasks](https://github.com/d86e/hive-tasks). `hive-runner` and `merge-on-commit`
|
|
54
|
-
are optional
|
|
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
56
|
- [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) is optional; it adds the
|
|
56
57
|
resident supervisor and its status strip.
|
|
57
58
|
|
|
58
59
|
## Install
|
|
59
60
|
|
|
60
|
-
The
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
1. In `~/.dsh/profiles/desktop/package.json`, add the linked checkout to
|
|
64
|
-
`dependencies` and the package name to `dsh.profile.bundles`:
|
|
65
|
-
|
|
66
|
-
```diff
|
|
67
|
-
"dependencies": {
|
|
68
|
-
+ "dsh-hive-panel": "link:/path/to/dsh-hive-panel",
|
|
69
|
-
},
|
|
70
|
-
"dsh": {
|
|
71
|
-
"profile": {
|
|
72
|
-
"bundles": [
|
|
73
|
-
+ "dsh-hive-panel"
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
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):
|
|
78
64
|
|
|
79
|
-
|
|
65
|
+
1. **Quit DSH Desktop completely.** The profile is locked while the app runs.
|
|
66
|
+
If the Desktop app has never been opened, start it once so it creates
|
|
67
|
+
`~/.dsh/profiles/desktop/package.json`, then quit it.
|
|
80
68
|
|
|
81
|
-
2. Install the profile
|
|
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:
|
|
82
71
|
|
|
83
72
|
```bash
|
|
84
|
-
|
|
73
|
+
dsh plugin --profile desktop add dsh-hive-panel
|
|
85
74
|
```
|
|
86
75
|
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
For a CLI-managed profile use the same command with that profile name, for example
|
|
77
|
+
`dsh plugin --profile web add dsh-hive-panel`; restart with `dsh web` instead of
|
|
78
|
+
the Desktop app.
|
|
79
|
+
|
|
80
|
+
3. **Start DSH Desktop again.** Refreshing the page is not enough: host plugins and
|
|
81
|
+
browser bundles are loaded at startup.
|
|
82
|
+
|
|
83
|
+
<details>
|
|
84
|
+
<summary>Manual profile edit (same result, only needed when the CLI is unavailable)</summary>
|
|
85
|
+
|
|
86
|
+
Edit `~/.dsh/profiles/desktop/package.json` while DSH Desktop is not running: add the
|
|
87
|
+
published package to `dependencies`, add the package name to `dsh.profile.bundles`,
|
|
88
|
+
then run `pnpm install` in the profile directory. Keep the JSON valid: leave the
|
|
89
|
+
trailing comma only when another entry follows.
|
|
90
|
+
|
|
91
|
+
```diff
|
|
92
|
+
"dependencies": {
|
|
93
|
+
+ "dsh-hive-panel": "^0.1.8",
|
|
94
|
+
},
|
|
95
|
+
"dsh": {
|
|
96
|
+
"profile": {
|
|
97
|
+
"bundles": [
|
|
98
|
+
+ "dsh-hive-panel"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cd ~/.dsh/profiles/desktop && pnpm install
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
</details>
|
|
89
109
|
|
|
90
110
|
After the restart the conversation view has an extra **Hive** entry (labelled 蜂群 in a
|
|
91
111
|
Chinese UI).
|
|
@@ -113,18 +133,20 @@ restarts with `dsh web` instead of the desktop app.
|
|
|
113
133
|
## Configuration
|
|
114
134
|
|
|
115
135
|
The plugin ships defaults (read-only). Override them in your profile's
|
|
116
|
-
`cordis.patch.yml` by plugin id
|
|
136
|
+
`cordis.patch.yml` by plugin id; every key is optional and the defaults work on a
|
|
137
|
+
clean machine:
|
|
117
138
|
|
|
118
139
|
```yaml
|
|
119
140
|
- id: hive-panel
|
|
120
141
|
name: dsh-hive-panel
|
|
121
142
|
config:
|
|
122
143
|
writable: true
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
144
|
+
# Optional: pin an executable (PATH name or absolute path).
|
|
145
|
+
# The defaults are the PATH names in the table below; when one is missing the
|
|
146
|
+
# host retries the same command through npx before reporting an error.
|
|
147
|
+
# bins:
|
|
148
|
+
# hive: /path/to/hive/bin/hive.js
|
|
149
|
+
# tasks: /path/to/hive-tasks/bin/hive-tasks.js
|
|
128
150
|
```
|
|
129
151
|
|
|
130
152
|
Restart DSH after changing the config.
|
|
@@ -133,14 +155,19 @@ Restart DSH after changing the config.
|
|
|
133
155
|
| --- | --- | --- |
|
|
134
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 |
|
|
135
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 |
|
|
136
|
-
| `bins.hive` | `hive` from PATH | `hive` executable: PATH name or absolute path |
|
|
137
|
-
| `bins.tasks` | `hive-tasks` from PATH | `hive-tasks` executable |
|
|
138
|
-
| `bins.run` | `hive-run` from PATH | `hive-run` executable (the run action) |
|
|
139
|
-
| `bins.moc` | `moc` from PATH | `moc` executable (merge-on-commit hooks) |
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
158
|
+
| `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
|
+
| `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` |
|
|
161
|
+
| `bins.moc` | `moc` from PATH | `moc` executable (merge-on-commit hooks); npx fallback `-p merge-on-commit` |
|
|
162
|
+
|
|
163
|
+
**PATH first, `npx` second.** The defaults are the PATH names above, so a machine with
|
|
164
|
+
`npm i -g` installs works without any config. DSH's host process often does not inherit
|
|
165
|
+
your shell PATH; in that case the host retries the same command once through `npx -y -p
|
|
166
|
+
<package> ...` and only then reports the failure. First use needs network access so npx
|
|
167
|
+
can populate its cache; for an offline machine, install the CLIs globally or set the
|
|
168
|
+
`bins` entries to absolute paths. A configured absolute path is used as-is and is never
|
|
169
|
+
replaced by npx. When the PATH lookup and the npx fallback both fail, the response
|
|
170
|
+
carries an actionable hint (`npm i -g <packages>` plus the `bins.<key>` to set).
|
|
144
171
|
|
|
145
172
|
## Architecture
|
|
146
173
|
|
|
@@ -189,7 +216,15 @@ lines prefixed with `[hive-panel]` say whether the host half mounted.
|
|
|
189
216
|
**The board is empty.** Check `initialised` in the view. A repository that is not under
|
|
190
217
|
git, or has not been initialised, shows an initialise button. If the repository is
|
|
191
218
|
initialised but empty, the Hive binaries are probably not reachable from the host process:
|
|
192
|
-
|
|
219
|
+
the panel already retries each one through `npx`. Follow the install hint in the error
|
|
220
|
+
(or run `hive-tasks list --json` in a terminal and pin `bins` to that executable).
|
|
221
|
+
|
|
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
|
|
225
|
+
`node_modules`: the router then cannot resolve `hive-consensus` and exits 127 with empty
|
|
226
|
+
output. Either run `npm install` in that checkout or point `bins.hive` at
|
|
227
|
+
`hive-consensus/bin/hive.js` (the router is still needed for `hive roles`).
|
|
193
228
|
|
|
194
229
|
**Every button is disabled or the view says read-only.** `writable` is still `false`.
|
|
195
230
|
Set it to `true` in the profile config and restart DSH. Read-only mode also disables the
|
|
@@ -235,7 +270,7 @@ npm run check # node --check on the entry points + the offline verification
|
|
|
235
270
|
npm pack --dry-run # inspect the published contents
|
|
236
271
|
```
|
|
237
272
|
|
|
238
|
-
`scripts/verify.mjs` runs
|
|
273
|
+
`scripts/verify.mjs` runs 31 checks against a Cordis-shaped shim: route registration,
|
|
239
274
|
Session cwd resolution, sandbox policy, the action allowlist and quoting, read-only
|
|
240
275
|
semantics, response contracts, cold Sessions and the queen lifecycle. It never starts or
|
|
241
276
|
restarts a DSH process.
|
package/README.zh-CN.md
CHANGED
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
|
|
29
29
|
| 能力 | 说明 |
|
|
30
30
|
| --- | --- |
|
|
31
|
-
| **会话里的 Hive 标签页** | 按状态分列的看板(pending / claimed / done /
|
|
31
|
+
| **会话里的 Hive 标签页** | 按状态分列的看板(pending / claimed / done / failed)、任务卡详情和事件尾,作用域是当前 Session 的仓库 |
|
|
32
32
|
| **在标签页里初始化** | 对没初始化过的仓库执行 `hive init`,立刻可用 |
|
|
33
33
|
| **女王模式** | 打开已初始化的仓库时当前会话自动成为女王:只规划、只拆卡,不写代码。`/queen off` 退出,`/queen on`(或面板动作)重新进入 |
|
|
34
|
-
| **任务卡动作** |
|
|
34
|
+
| **任务卡动作** | 认领、完成、失败、重试、续租、跑一轮等,都从正在看的那张卡上发起 |
|
|
35
35
|
| **Runner 状态条** | 装了 [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 时,顶部显示每个仓库的 supervisor 状态(空闲 / 运行 / 暂停)、在飞 worker 数,并能暂停/恢复 |
|
|
36
36
|
| **默认只读** | 开箱即看是安全的;写操作需要显式打开 |
|
|
37
37
|
|
|
@@ -41,41 +41,55 @@
|
|
|
41
41
|
- Node 22.19 或更新(DSH 运行时)。
|
|
42
42
|
- Hive 命令行包:[`@d86e/hive`](https://github.com/d86e/hive) 与
|
|
43
43
|
[hive-tasks](https://github.com/d86e/hive-tasks)。`hive-runner` 和
|
|
44
|
-
`merge-on-commit`
|
|
44
|
+
`merge-on-commit` 是可选的。面板默认用 PATH 名调用,找不到时自动退到 `npx`(见[配置](#配置))。
|
|
45
45
|
- [dsh-hive-runner](https://github.com/d86e/dsh-hive-runner) 可选:装了才有常驻 supervisor 和状态条。
|
|
46
46
|
|
|
47
47
|
## 安装
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
1. 在 `~/.dsh/profiles/desktop/package.json` 的 `dependencies` 里加这个仓库的 link,并在 `dsh.profile.bundles` 里加包名:
|
|
52
|
-
|
|
53
|
-
```diff
|
|
54
|
-
"dependencies": {
|
|
55
|
-
+ "dsh-hive-panel": "link:/path/to/dsh-hive-panel",
|
|
56
|
-
},
|
|
57
|
-
"dsh": {
|
|
58
|
-
"profile": {
|
|
59
|
-
"bundles": [
|
|
60
|
-
+ "dsh-hive-panel"
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
```
|
|
49
|
+
`desktop` profile 归 DSH Desktop 应用管理,但应用没在运行时可以用 `dsh` CLI 装进去。请使用与桌面运行时同版本的 CLI(插件声明兼容 DSH 0.2.2-rc.5):
|
|
65
50
|
|
|
66
|
-
|
|
51
|
+
1. **完全退出 DSH Desktop。** 应用运行时 profile 是被锁住的。
|
|
52
|
+
如果桌面应用从没打开过,先启动一次让它生成 `~/.dsh/profiles/desktop/package.json`,再退出。
|
|
67
53
|
|
|
68
|
-
2.
|
|
54
|
+
2. **把插件装进 profile。** `dsh` 和 `pnpm` 需要在 PATH 上;
|
|
55
|
+
下面这条命令会同时更新 `dependencies` 和 `dsh.profile.bundles`:
|
|
69
56
|
|
|
70
57
|
```bash
|
|
71
|
-
|
|
58
|
+
dsh plugin --profile desktop add dsh-hive-panel
|
|
72
59
|
```
|
|
73
60
|
|
|
74
|
-
|
|
61
|
+
CLI 管理的 profile 用同样的命令换 profile 名,例如
|
|
62
|
+
`dsh plugin --profile web add dsh-hive-panel`;重启方式换成 `dsh web`。
|
|
63
|
+
|
|
64
|
+
3. **重新启动 DSH Desktop。** 刷新页面不够:host 插件和浏览器 bundle 都在启动时装载。
|
|
75
65
|
|
|
76
66
|
重启后会话视图里会多出 **Hive** 一项(中文界面显示「蜂群」)。
|
|
77
67
|
|
|
78
|
-
|
|
68
|
+
<details>
|
|
69
|
+
<summary>手工改 profile(效果相同,仅在 CLI 不可用时使用)</summary>
|
|
70
|
+
|
|
71
|
+
在 DSH Desktop 退出时编辑 `~/.dsh/profiles/desktop/package.json`:把已发布包加进
|
|
72
|
+
`dependencies`,把包名加进 `dsh.profile.bundles`,然后在 profile 目录执行
|
|
73
|
+
`pnpm install`。JSON 逗号按实际位置调整:新行后面还有依赖就保留行尾逗号,是最后一项就去掉。
|
|
74
|
+
|
|
75
|
+
```diff
|
|
76
|
+
"dependencies": {
|
|
77
|
+
+ "dsh-hive-panel": "^0.1.8",
|
|
78
|
+
},
|
|
79
|
+
"dsh": {
|
|
80
|
+
"profile": {
|
|
81
|
+
"bundles": [
|
|
82
|
+
+ "dsh-hive-panel"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
cd ~/.dsh/profiles/desktop && pnpm install
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
</details>
|
|
79
93
|
|
|
80
94
|
## 五分钟上手
|
|
81
95
|
|
|
@@ -88,18 +102,19 @@ CLI 管理的 profile(例如 `web`)同样改这两处;只是重启方式
|
|
|
88
102
|
|
|
89
103
|
## 配置
|
|
90
104
|
|
|
91
|
-
插件自带默认值(只读)。要改就在 profile 的 `cordis.patch.yml` 里按插件 id
|
|
105
|
+
插件自带默认值(只读)。要改就在 profile 的 `cordis.patch.yml` 里按插件 id 覆盖;
|
|
106
|
+
每个键都可选,默认值在干净机器上就能用:
|
|
92
107
|
|
|
93
108
|
```yaml
|
|
94
109
|
- id: hive-panel
|
|
95
110
|
name: dsh-hive-panel
|
|
96
111
|
config:
|
|
97
112
|
writable: true
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
113
|
+
# 可选:固定某个可执行文件(PATH 名或绝对路径)。
|
|
114
|
+
# 默认值就是下面表格里的 PATH 名;找不到时宿主会用 npx 重试同一条命令。
|
|
115
|
+
# bins:
|
|
116
|
+
# hive: /path/to/hive/bin/hive.js
|
|
117
|
+
# tasks: /path/to/hive-tasks/bin/hive-tasks.js
|
|
103
118
|
```
|
|
104
119
|
|
|
105
120
|
改完重启 DSH 生效。
|
|
@@ -108,12 +123,16 @@ CLI 管理的 profile(例如 `web`)同样改这两处;只是重启方式
|
|
|
108
123
|
| --- | --- | --- |
|
|
109
124
|
| `autoQueen` | `true` | 对已初始化的仓库打开视图时自动让当前会话成为女王。设为 `false` 时只能用 `/queen on` 或面板动作手动进入 |
|
|
110
125
|
| `writable` | `false` | 是否允许写动作(init、add、claim、done、fail、mode……)。关闭时看板仍可读,写动作被隐藏或拒绝 |
|
|
111
|
-
| `bins.hive` | PATH 上的 `hive` | `hive` 可执行文件:PATH
|
|
112
|
-
| `bins.tasks` | PATH 上的 `hive-tasks` | `hive-tasks`
|
|
113
|
-
| `bins.run` | PATH 上的 `hive-run` | `hive-run`
|
|
114
|
-
| `bins.moc` | PATH 上的 `moc` | `moc` 可执行文件(merge-on-commit
|
|
126
|
+
| `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
|
+
| `bins.tasks` | PATH 上的 `hive-tasks` | `hive-tasks` 可执行文件;npx 回退 `-p hive-tasks` |
|
|
128
|
+
| `bins.run` | PATH 上的 `hive-run` | `hive-run` 可执行文件(跑一轮动作);npx 回退 `-p hive-runner` |
|
|
129
|
+
| `bins.moc` | PATH 上的 `moc` | `moc` 可执行文件(merge-on-commit);npx 回退 `-p merge-on-commit` |
|
|
115
130
|
|
|
116
|
-
|
|
131
|
+
**先 PATH,再 npx。** 默认值就是上面的 PATH 名,所以用 `npm i -g` 装过的机器不需要任何配置。
|
|
132
|
+
DSH 宿主进程通常拿不到你 shell 的 PATH,这时宿主会把同一条命令用 `npx -y -p <包> ...` 重试一次,
|
|
133
|
+
仍然失败才报错。首次使用需要联网让 npx 填充缓存;离线机器请全局安装或用绝对路径固定 `bins`。
|
|
134
|
+
显式配置的绝对路径按原样使用,不会被 npx 替换。PATH 和 npx 都失败时,响应里会带可执行的提示
|
|
135
|
+
(`npm i -g <包列表>` 和该设置的 `bins.<键>`)。
|
|
117
136
|
|
|
118
137
|
## 架构
|
|
119
138
|
|
|
@@ -155,7 +174,9 @@ DSH 宿主进程
|
|
|
155
174
|
|
|
156
175
|
**Hive 视图没出现。** 浏览器 bundle 在启动时装载。确认 profile 的 `dependencies` 和 `dsh.profile.bundles` 两处都有 `dsh-hive-panel`、`pnpm install` 成功、DSH 是完全重启的。DSH 日志里 `[hive-panel]` 前缀的行会说明 host 半有没有挂上。
|
|
157
176
|
|
|
158
|
-
**看板是空的。** 先看视图里的 `initialised`。仓库不在 git 下、或还没初始化时会显示初始化按钮;已初始化但空,通常是宿主进程找不到 Hive
|
|
177
|
+
**看板是空的。** 先看视图里的 `initialised`。仓库不在 git 下、或还没初始化时会显示初始化按钮;已初始化但空,通常是宿主进程找不到 Hive 二进制——面板已经会自动用 `npx` 重试。按报错里的安装提示处理(或者在终端跑 `hive-tasks list --json`,把 `bins` 固定到那个可执行文件)。
|
|
178
|
+
|
|
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)。
|
|
159
180
|
|
|
160
181
|
**按钮全灰 / 提示只读。** `writable` 还是 `false`。在 profile 配置里改成 `true` 并重启 DSH。只读模式下「初始化 Hive」也不可用。
|
|
161
182
|
|
|
@@ -182,7 +203,7 @@ npm run check # 入口语法检查 + 离线验证
|
|
|
182
203
|
npm pack --dry-run # 检查发布内容
|
|
183
204
|
```
|
|
184
205
|
|
|
185
|
-
`scripts/verify.mjs` 在 Cordis 形状的 shim 上跑
|
|
206
|
+
`scripts/verify.mjs` 在 Cordis 形状的 shim 上跑 29 项检查:路由注册、Session cwd 解析、sandbox 策略、动作白名单与转义、只读语义、响应契约、冷会话和女王生命周期。不会启动或重启任何 DSH 进程。
|
|
186
207
|
|
|
187
208
|
浏览器 bundle `lib/client.js` 是生成物:改完 `src/` 后跑 `node scripts/build-client.mjs`。线上协议见 [SPEC.md](SPEC.md),实现说明和 DSH 实测证据见 [docs/DESIGN.md](docs/DESIGN.md)。
|
|
188
209
|
|
package/SPEC.md
CHANGED
|
@@ -81,6 +81,7 @@ these top-level fields:
|
|
|
81
81
|
"initialised": true,
|
|
82
82
|
"mode": "free",
|
|
83
83
|
"board": {},
|
|
84
|
+
"boardError": null,
|
|
84
85
|
"tasks": {},
|
|
85
86
|
"stats": {},
|
|
86
87
|
"events": [],
|
|
@@ -98,6 +99,10 @@ these top-level fields:
|
|
|
98
99
|
|
|
99
100
|
- `initialised` — `refs/hive/v1` exists in the repository (a refs probe), not a guess.
|
|
100
101
|
- `board`, `tasks`, `stats` — parsed JSON from the configured Hive binaries.
|
|
102
|
+
- `boardError` — `null` when `hive board --json` ran and returned a JSON array;
|
|
103
|
+
otherwise a one-line diagnostic naming the failure ("did not run", timeout, exit
|
|
104
|
+
status with the CLI stderr, or malformed JSON). `board` stays `[]` in that case,
|
|
105
|
+
so consumers can distinguish "nobody is working" from "the board CLI did not run".
|
|
101
106
|
- `events` — the newest 80 lines of `<cwd>/.hive/events.jsonl`, newest first.
|
|
102
107
|
- `writable` — the plugin configuration (`false` by default).
|
|
103
108
|
- `queen` — current host-memory queen mode for this Session: `active` is a boolean,
|
|
@@ -113,8 +118,9 @@ these top-level fields:
|
|
|
113
118
|
runtime counts) are exposed by the hive-runner supervisor status endpoint instead.
|
|
114
119
|
A successful `roles-add` shows up here on the next poll.
|
|
115
120
|
- An uninitialised repository returns the same shape with empty reads after only the
|
|
116
|
-
refs probe; `
|
|
117
|
-
still be active there after an
|
|
121
|
+
refs probe; `boardError` and `roles` errors are then `null`, and `roles` is
|
|
122
|
+
`{ list: [], limits: {}, error: null }`; `queen` may still be active there after an
|
|
123
|
+
explicit activation.
|
|
118
124
|
|
|
119
125
|
## 5. Action envelope
|
|
120
126
|
|
|
@@ -134,8 +140,9 @@ these top-level fields:
|
|
|
134
140
|
|
|
135
141
|
## 6. Action catalog
|
|
136
142
|
|
|
137
|
-
Actions: `init add plan claim done fail retry
|
|
138
|
-
commit doctor roles-add remove` plus the host-memory actions `queen-on`
|
|
143
|
+
Actions: `init add plan claim done fail retry renew mode learn recall verdict run
|
|
144
|
+
commit doctor roles-add roles-remove remove` plus the host-memory actions `queen-on`
|
|
145
|
+
and `queen-off`.
|
|
139
146
|
|
|
140
147
|
### 6.1 `roles-add`
|
|
141
148
|
|
|
@@ -188,6 +195,33 @@ hive-tasks (`bin: 'hive'`, argv `['tasks', 'rm', <id>]`), through the same shell
|
|
|
188
195
|
The card disappears from the next snapshot poll. Mutating action: requires
|
|
189
196
|
`writable: true`, otherwise `403` read-only.
|
|
190
197
|
|
|
198
|
+
### 6.3 `roles-remove`
|
|
199
|
+
|
|
200
|
+
`POST ?op=action&name=roles-remove&sessionId=<id>` with JSON body:
|
|
201
|
+
|
|
202
|
+
```json
|
|
203
|
+
{ "name": "reviewer" }
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Maps to `hive roles rm <name>` in the Session cwd through the shell seam (argv tokens,
|
|
207
|
+
single-quoted). It drops the role from `.hive/roles.yaml`; the CLI keeps the contract
|
|
208
|
+
file `.hive/roles/<name>.md` and says so on stdout.
|
|
209
|
+
|
|
210
|
+
- `name` (required) — `^[a-z][a-z0-9-]{1,31}$` (2–32 chars); anything else is a
|
|
211
|
+
`400 hive/invalid-argument` before execution.
|
|
212
|
+
- Neither `--force` nor `--keep-file` is ever sent, so the CLI owns every decision.
|
|
213
|
+
A missing role is a normal CLI refusal: exit `2` with
|
|
214
|
+
`hive roles: role "<name>" not found in .hive/roles.yaml` on stderr, returned
|
|
215
|
+
unchanged as `{ ok:false, code:2, stdout:"", stderr:<that text> }`.
|
|
216
|
+
- The host does not pre-check in-flight work or limits: `hive roles rm` itself does not
|
|
217
|
+
inspect cards, so deletion succeeds while cards still name the role (they keep their
|
|
218
|
+
`role` field; the supervisor simply has no definition/limit entry for it). A stale
|
|
219
|
+
`<role>` key can remain in `.hive/limits.json`; this action does not edit that file.
|
|
220
|
+
- Success: `200 { ok:true, code:0, stdout:"removed role <name> from .hive/roles.yaml\n
|
|
221
|
+
kept .hive/roles/<name>.md (pass --keep-file to silence)\n", stderr:"" }`.
|
|
222
|
+
The role disappears from snapshot `roles.list` on the next poll. Mutating action:
|
|
223
|
+
requires `writable: true`, otherwise `403` read-only.
|
|
224
|
+
|
|
191
225
|
For every action the host builds one fixed command template. Each argument field is
|
|
192
226
|
validated (id, agent, ttl, sha, ref mode, integer ranges, string length, NUL) and every
|
|
193
227
|
token is single-quoted before it enters the shell seam:
|
|
@@ -199,7 +233,10 @@ command = [bin, ...argv].map(quote).join(' ')
|
|
|
199
233
|
|
|
200
234
|
Invalid input is rejected with `400` before execution. `bins` (hive, hive-tasks,
|
|
201
235
|
hive-run, moc) come only from trusted host configuration and must each be a single
|
|
202
|
-
executable token: a PATH name or an absolute path.
|
|
236
|
+
executable token: a PATH name or an absolute path. The default for every key is its
|
|
237
|
+
PATH name; a bare default that the shell cannot resolve is retried once as
|
|
238
|
+
`npx -y -p <published package> ... <bin>`, and a configured absolute path is never
|
|
239
|
+
replaced. When both attempts fail, the error carries an install hint.
|
|
203
240
|
|
|
204
241
|
## 7. Execution
|
|
205
242
|
|
package/cordis.patch.yml
CHANGED
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
# An initialised Session auto-enters queen mode from the snapshot loop.
|
|
16
16
|
# Set false to require /queen on or the queen-on action.
|
|
17
17
|
autoQueen: true
|
|
18
|
-
# Trusted host-side executables. Omit to use PATH names;
|
|
19
|
-
#
|
|
18
|
+
# Trusted host-side executables. Omit to use the PATH names below; a
|
|
19
|
+
# missing PATH name is retried once through npx (-y -p <package> ...).
|
|
20
|
+
# An explicit absolute path is used as-is and never replaced.
|
|
21
|
+
# Defaults: hive, hive-tasks, hive-run, moc.
|
|
20
22
|
# bins:
|
|
21
|
-
# hive: "/path/to/hive
|
|
23
|
+
# hive: "/path/to/hive/bin/hive.js"
|
|
22
24
|
# tasks: "/path/to/hive-tasks/bin/hive-tasks.js"
|
|
23
25
|
# run: "/path/to/hive-runner/bin/hive-run.js"
|
|
24
|
-
# moc: "moc"
|
|
26
|
+
# moc: "/path/to/merge-on-commit/bin/moc.js"
|