dsh-hive-panel 0.2.0 → 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 +51 -1
- package/README.md +7 -0
- package/README.zh-CN.md +2 -0
- package/SPEC.md +8 -2
- package/docs/DESIGN.md +4 -1
- package/lib/client.js +144 -14
- package/lib/index.js +87 -3
- package/package.json +1 -1
- package/scripts/verify.mjs +46 -3
- package/src/panel.css +11 -0
- package/src/panel.js +143 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,49 @@
|
|
|
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
|
+
|
|
1
47
|
## [0.2.0] - 2026-12-04
|
|
2
48
|
|
|
3
49
|
### Changed
|
|
@@ -20,6 +66,10 @@
|
|
|
20
66
|
|
|
21
67
|
- `npm run check` passes with the action catalog at 18 allowlisted actions.
|
|
22
68
|
|
|
69
|
+
### Published
|
|
70
|
+
|
|
71
|
+
- npm: `dsh-hive-panel@0.2.0` on 2026-12-04.
|
|
72
|
+
|
|
23
73
|
## [0.1.8] - 2026-12-04
|
|
24
74
|
|
|
25
75
|
### Fixed
|
|
@@ -162,4 +212,4 @@ First public snapshot.
|
|
|
162
212
|
|
|
163
213
|
### Published
|
|
164
214
|
|
|
165
|
-
- 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
|
@@ -219,6 +219,13 @@ initialised but empty, the Hive binaries are probably not reachable from the hos
|
|
|
219
219
|
the panel already retries each one through `npx`. Follow the install hint in the error
|
|
220
220
|
(or run `hive-tasks list --json` in a terminal and pin `bins` to that executable).
|
|
221
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`).
|
|
228
|
+
|
|
222
229
|
**Every button is disabled or the view says read-only.** `writable` is still `false`.
|
|
223
230
|
Set it to `true` in the profile config and restart DSH. Read-only mode also disables the
|
|
224
231
|
initialise button.
|
package/README.zh-CN.md
CHANGED
|
@@ -176,6 +176,8 @@ DSH 宿主进程
|
|
|
176
176
|
|
|
177
177
|
**看板是空的。** 先看视图里的 `initialised`。仓库不在 git 下、或还没初始化时会显示初始化按钮;已初始化但空,通常是宿主进程找不到 Hive 二进制——面板已经会自动用 `npx` 重试。按报错里的安装提示处理(或者在终端跑 `hive-tasks list --json`,把 `bins` 固定到那个可执行文件)。
|
|
178
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)。
|
|
180
|
+
|
|
179
181
|
**按钮全灰 / 提示只读。** `writable` 还是 `false`。在 profile 配置里改成 `true` 并重启 DSH。只读模式下「初始化 Hive」也不可用。
|
|
180
182
|
|
|
181
183
|
**提示连接断开或拿不到快照。** 面板从 Session 解析仓库:保持 Session 活着,或重新打开冷会话,让记录的工作目录可读。仍然失败就看 DSH 日志,并确认插件版本与安装的 DSH(0.2.2-rc.5)匹配。
|
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
|
|
package/docs/DESIGN.md
CHANGED
|
@@ -165,7 +165,7 @@ interface ConnectionFetchRoute {
|
|
|
165
165
|
|
|
166
166
|
| 请求 | 响应 |
|
|
167
167
|
| --- | --- |
|
|
168
|
-
| `GET /api/hive?op=snapshot&sessionId=<id>` | 快照 JSON,字段固定 `{ at, repo, initialised, mode, board, tasks, stats, events, writable, queen, roles }` |
|
|
168
|
+
| `GET /api/hive?op=snapshot&sessionId=<id>` | 快照 JSON,字段固定 `{ at, repo, initialised, mode, board, boardError, tasks, stats, events, writable, queen, roles }` |
|
|
169
169
|
| `GET /api/hive?op=actions&sessionId=<id>` | `{ writable, autoQueen, actions: string[], repo }` |
|
|
170
170
|
| `POST /api/hive?op=action&name=<name>&sessionId=<id>`(JSON body) | 动作结果 `{ ok, code, stdout, stderr }` |
|
|
171
171
|
| 未知 `op` | `400 { ok:false, error:{ code:'hive/unknown-op', message } }` |
|
|
@@ -231,6 +231,9 @@ child_process 会绕过 Session sandbox mode、凭证擦除、超时/输出上
|
|
|
231
231
|
| 快照探针 | `git for-each-ref --format=%(refname) refs/hive/v1`、`git cat-file -p refs/hive/v1/mode` |
|
|
232
232
|
| 动作 | `init add plan claim done fail retry renew mode learn recall verdict run commit doctor roles-add roles-remove remove` |
|
|
233
233
|
|
|
234
|
+
`hive board --json` 失败(未执行、超时、非零退出、非法 JSON)时 `board` 保持 `[]`,
|
|
235
|
+
`boardError` 携带退出状态和 stderr 等诊断;这样空看板与“读失败”不再混淆。
|
|
236
|
+
|
|
234
237
|
动作表沿用 `hive-panel/src/actions.js` 的 argv 构造;每个字段先校验(id/agent/ttl/sha/mode/整数范围/
|
|
235
238
|
字符串长度/NUL),再作为独立 argv token 用单引号严格转义:
|
|
236
239
|
|
package/lib/client.js
CHANGED
|
@@ -477,6 +477,14 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
477
477
|
font-size: 12px;
|
|
478
478
|
}
|
|
479
479
|
|
|
480
|
+
.hive-agents-error {
|
|
481
|
+
min-width: 0;
|
|
482
|
+
overflow-wrap: anywhere;
|
|
483
|
+
color: var(--hive-danger);
|
|
484
|
+
font-family: var(--hive-mono);
|
|
485
|
+
font-size: 12px;
|
|
486
|
+
}
|
|
487
|
+
|
|
480
488
|
.hive-stage-chips {
|
|
481
489
|
display: flex;
|
|
482
490
|
flex: 0 0 auto;
|
|
@@ -1571,7 +1579,8 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1571
1579
|
}
|
|
1572
1580
|
|
|
1573
1581
|
.hive-card-run-output {
|
|
1574
|
-
max-height: 360px;
|
|
1582
|
+
max-height: 360px;
|
|
1583
|
+
max-height: 20lh; /* longer output scrolls inside the pre */
|
|
1575
1584
|
margin: 0;
|
|
1576
1585
|
padding: 10px;
|
|
1577
1586
|
overflow: auto;
|
|
@@ -2038,6 +2047,16 @@ dialog.hive-dialog .hive-dialog-title,
|
|
|
2038
2047
|
dialog.hive-dialog .hive-card-subline,
|
|
2039
2048
|
dialog.hive-dialog .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }
|
|
2040
2049
|
dialog.hive-dialog .hive-dialog-foot { flex-wrap: wrap; }
|
|
2050
|
+
dialog.hive-dialog {
|
|
2051
|
+
display: flex;
|
|
2052
|
+
flex-direction: column;
|
|
2053
|
+
max-height: 80vh;
|
|
2054
|
+
}
|
|
2055
|
+
dialog.hive-dialog .hive-dialog-head,
|
|
2056
|
+
dialog.hive-dialog .hive-dialog-foot { flex: 0 0 auto; }
|
|
2057
|
+
dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
|
2058
|
+
.hive-card-run-output { max-height: 20lh; overflow: auto; }
|
|
2059
|
+
.hive-card-actions { flex-wrap: wrap; justify-content: flex-end; }
|
|
2041
2060
|
`;
|
|
2042
2061
|
|
|
2043
2062
|
const LANE_LABEL_KEYS = Object.freeze({
|
|
@@ -2115,6 +2134,9 @@ const messages = Object.freeze({
|
|
|
2115
2134
|
"drawer.removeClaimed": "A claimed task must be released or reopened before it can be deleted.",
|
|
2116
2135
|
"drawer.rawJson": "raw json",
|
|
2117
2136
|
"drawer.lastRun": "Last run",
|
|
2137
|
+
"drawer.runOverlaps": "Also writing",
|
|
2138
|
+
"drawer.runLessons": "Read {count} lessons",
|
|
2139
|
+
"drawer.runNoLessons": "No lessons to read",
|
|
2118
2140
|
"drawer.noRuns": "No runs yet",
|
|
2119
2141
|
"drawer.copyOutput": "Copy output",
|
|
2120
2142
|
"drawer.openChat": "Open agent chat",
|
|
@@ -2354,6 +2376,9 @@ const messages = Object.freeze({
|
|
|
2354
2376
|
"drawer.removeClaimed": "已认领的任务必须先释放或重开才能删除。",
|
|
2355
2377
|
"drawer.rawJson": "原始 JSON",
|
|
2356
2378
|
"drawer.lastRun": "最近一次执行",
|
|
2379
|
+
"drawer.runOverlaps": "同时写入",
|
|
2380
|
+
"drawer.runLessons": "读取了 {count} 条经验",
|
|
2381
|
+
"drawer.runNoLessons": "没有可读取的经验",
|
|
2357
2382
|
"drawer.noRuns": "还没有执行记录",
|
|
2358
2383
|
"drawer.copyOutput": "复制输出",
|
|
2359
2384
|
"drawer.openChat": "打开智能体对话",
|
|
@@ -2566,12 +2591,56 @@ function normalizeScope(scope) {
|
|
|
2566
2591
|
return [];
|
|
2567
2592
|
}
|
|
2568
2593
|
|
|
2594
|
+
/**
|
|
2595
|
+
* Normalize the optional `overlaps` announcements of a run record: other agents
|
|
2596
|
+
* have declared they are writing the same paths too. An entry without a
|
|
2597
|
+
* non-empty agent is dropped; a missing or malformed list is empty, so the
|
|
2598
|
+
* drawer renders no overlap row.
|
|
2599
|
+
* @param {unknown} value
|
|
2600
|
+
* @returns {Array<{key:string,agent:string,task:string,expiresAt:string}>}
|
|
2601
|
+
*/
|
|
2602
|
+
function normalizeOverlaps(value) {
|
|
2603
|
+
const overlaps = [];
|
|
2604
|
+
for (const entry of asArray(value)) {
|
|
2605
|
+
if (!isRecord(entry)) continue;
|
|
2606
|
+
const agent = asString(entry.agent);
|
|
2607
|
+
if (agent.trim() === "") continue;
|
|
2608
|
+
overlaps.push({
|
|
2609
|
+
key: asString(entry.key),
|
|
2610
|
+
agent,
|
|
2611
|
+
task: asString(entry.task),
|
|
2612
|
+
expiresAt: asString(entry.expiresAt),
|
|
2613
|
+
});
|
|
2614
|
+
}
|
|
2615
|
+
return overlaps;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* Normalize the optional `lessons` recall summary of a run record. A missing
|
|
2620
|
+
* or malformed record is null; a count-only, scopes-only or error-only record
|
|
2621
|
+
* survives so the drawer can still render its "no lessons" line.
|
|
2622
|
+
* @param {unknown} value
|
|
2623
|
+
* @returns {null|{count:number,scopes:string[],error?:string}}
|
|
2624
|
+
*/
|
|
2625
|
+
function normalizeLessons(value) {
|
|
2626
|
+
if (!isRecord(value)) return null;
|
|
2627
|
+
const lessons = {
|
|
2628
|
+
count: asCount(value.count, 0),
|
|
2629
|
+
scopes: asArray(value.scopes)
|
|
2630
|
+
.map((scope) => asString(scope))
|
|
2631
|
+
.filter((scope) => scope.trim() !== ""),
|
|
2632
|
+
};
|
|
2633
|
+
const error = asString(value.error);
|
|
2634
|
+
if (error !== "") lessons.error = error;
|
|
2635
|
+
return lessons;
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2569
2638
|
/**
|
|
2570
2639
|
* Normalize `lastRun` (written by hive-runner to .hive/runs/<cardId>.json).
|
|
2571
2640
|
* A missing record is null; a malformed one is dropped instead of leaking
|
|
2572
2641
|
* half-parsed values into the drawer.
|
|
2573
2642
|
* @param {unknown} value
|
|
2574
|
-
* @returns {null|{agent:string,startedAt:string,endedAt:string,status:string,commit:string,exitCode:number|null,sessionId:string,output:string}}
|
|
2643
|
+
* @returns {null|{agent:string,startedAt:string,endedAt:string,status:string,commit:string,exitCode:number|null,sessionId:string,output:string,overlaps:Array<{key:string,agent:string,task:string,expiresAt:string}>,lessons:null|{count:number,scopes:string[],error?:string}}}
|
|
2575
2644
|
*/
|
|
2576
2645
|
function normalizeLastRun(value) {
|
|
2577
2646
|
if (!isRecord(value)) return null;
|
|
@@ -2588,6 +2657,10 @@ function normalizeLastRun(value) {
|
|
|
2588
2657
|
// navigate can open that conversation, an older record simply has none.
|
|
2589
2658
|
sessionId: asString(value.sessionId),
|
|
2590
2659
|
output: asString(value.output),
|
|
2660
|
+
// Consensus announcements from the other writers of these paths.
|
|
2661
|
+
overlaps: normalizeOverlaps(value.overlaps),
|
|
2662
|
+
// Memory recall summary: how many lessons the worker read before its run.
|
|
2663
|
+
lessons: normalizeLessons(value.lessons),
|
|
2591
2664
|
};
|
|
2592
2665
|
}
|
|
2593
2666
|
|
|
@@ -2744,6 +2817,7 @@ function toolbarActions(writable, mode) {
|
|
|
2744
2817
|
* laneOrder: string[],
|
|
2745
2818
|
* stats: {total:number, byState:Record<string,number>, byRole:Record<string,number>, oldestPending:{id:string,createdAt:string}|null},
|
|
2746
2819
|
* agents: Array<{agent:string,state:string,task:string,files:string[],updatedAt:string}>,
|
|
2820
|
+
* boardError: string|null,
|
|
2747
2821
|
* events: Array<{ts:string,kind:string,task:string,actor:string}>,
|
|
2748
2822
|
* actions: Array<{name:string,labelKey:string,body?:object}>
|
|
2749
2823
|
* }}
|
|
@@ -2822,6 +2896,9 @@ function renderModel(snapshot) {
|
|
|
2822
2896
|
laneOrder: [...LANE_ORDER],
|
|
2823
2897
|
stats: normalizeStats(source.stats, tasks),
|
|
2824
2898
|
agents: normalizeAgents(source.board),
|
|
2899
|
+
// A board read that failed is not the same as an idle swarm: keep the
|
|
2900
|
+
// diagnostic so the agents strip can show it instead of "no agents".
|
|
2901
|
+
boardError: asString(source.boardError) || null,
|
|
2825
2902
|
events: normalizeEvents(source.events),
|
|
2826
2903
|
actions: initialised ? toolbarActions(writable, mode) : [],
|
|
2827
2904
|
};
|
|
@@ -5139,13 +5216,20 @@ function mount(root, options = {}) {
|
|
|
5139
5216
|
* The card drawer's "Last run" block. With no record it is one muted line;
|
|
5140
5217
|
* with a record it shows status, agent, timestamps and the short commit above
|
|
5141
5218
|
* the worker output (monospace, internally scrollable) and a copy button.
|
|
5142
|
-
* A record
|
|
5143
|
-
*
|
|
5219
|
+
* A record with overlapping writers adds one "Also writing" row, a record with
|
|
5220
|
+
* a lessons summary adds one recall row, and a record whose worker Session is
|
|
5221
|
+
* known, on a host that provides `openSession`, also gets the "Open agent
|
|
5222
|
+
* chat" button.
|
|
5144
5223
|
* @param {object|null} run - normalized `lastRun` (see normalizeLastRun)
|
|
5145
5224
|
* @returns {HTMLElement}
|
|
5146
5225
|
*/
|
|
5147
|
-
function buildRunSection(run) {
|
|
5226
|
+
function buildRunSection(run, actionHost) {
|
|
5148
5227
|
const section = element(doc, "div", "hive-card-run");
|
|
5228
|
+
const addAction = (node) => {
|
|
5229
|
+
if (Array.isArray(actionHost)) actionHost.push(node);
|
|
5230
|
+
else if (actionHost && typeof actionHost.appendChild === "function") actionHost.appendChild(node);
|
|
5231
|
+
else section.appendChild(node);
|
|
5232
|
+
};
|
|
5149
5233
|
section.appendChild(element(doc, "div", "hive-card-run-title", translate("drawer.lastRun")));
|
|
5150
5234
|
if (!run) {
|
|
5151
5235
|
section.appendChild(element(doc, "div", "hive-note hive-card-run-empty", translate("drawer.noRuns")));
|
|
@@ -5160,6 +5244,30 @@ function mount(root, options = {}) {
|
|
|
5160
5244
|
const meta = element(doc, "div", "hive-card-run-meta", metaPartsText);
|
|
5161
5245
|
setAttr(meta, "title", metaPartsText);
|
|
5162
5246
|
section.appendChild(meta);
|
|
5247
|
+
// Consensus announcements: the other agents that announced the same paths. Invalid
|
|
5248
|
+
// entries are dropped by normalizeLastRun, duplicates collapse to one name,
|
|
5249
|
+
// and no overlapping writer means no row at all.
|
|
5250
|
+
const writers = [];
|
|
5251
|
+
for (const overlap of run.overlaps) {
|
|
5252
|
+
const agent = asString(overlap.agent);
|
|
5253
|
+
if (agent !== "" && !writers.includes(agent)) writers.push(agent);
|
|
5254
|
+
}
|
|
5255
|
+
if (writers.length > 0) {
|
|
5256
|
+
const overlapsLabel = translate("drawer.runOverlaps");
|
|
5257
|
+
// The zh dictionary copy uses the full-width colon elsewhere in the panel.
|
|
5258
|
+
const separator = /[\u4e00-\u9fff]/.test(overlapsLabel) ? ":" : ": ";
|
|
5259
|
+
section.appendChild(
|
|
5260
|
+
element(doc, "div", "hive-card-run-meta", overlapsLabel + separator + writers.join(", ")),
|
|
5261
|
+
);
|
|
5262
|
+
}
|
|
5263
|
+
// Memory recall: the worker always reports whether it read lessons, so the
|
|
5264
|
+
// block keeps one line even when the record predates that field.
|
|
5265
|
+
const lessonCount = run.lessons ? asCount(run.lessons.count, 0) : 0;
|
|
5266
|
+
const lessonsText =
|
|
5267
|
+
lessonCount > 0
|
|
5268
|
+
? translate("drawer.runLessons").replace("{count}", String(lessonCount))
|
|
5269
|
+
: translate("drawer.runNoLessons");
|
|
5270
|
+
section.appendChild(element(doc, "div", "hive-card-run-meta", lessonsText));
|
|
5163
5271
|
section.appendChild(element(doc, "pre", "hive-card-run-output", run.output));
|
|
5164
5272
|
const foot = element(doc, "div", "hive-card-run-foot");
|
|
5165
5273
|
const copy = element(doc, "button", "hive-btn hive-btn-ghost hive-card-run-copy", translate("drawer.copyOutput"));
|
|
@@ -5169,10 +5277,14 @@ function mount(root, options = {}) {
|
|
|
5169
5277
|
copy.addEventListener("click", () => {
|
|
5170
5278
|
copyToClipboard(doc, run.output);
|
|
5171
5279
|
});
|
|
5172
|
-
|
|
5280
|
+
if (Array.isArray(actionHost) || actionHost) addAction(copy);
|
|
5281
|
+
else foot.appendChild(copy);
|
|
5173
5282
|
// Only render the jump-to-chat control when both halves exist: a recorded
|
|
5174
|
-
// worker Session and a host navigation callback.
|
|
5175
|
-
|
|
5283
|
+
// worker Session and a host navigation callback. The status does not matter:
|
|
5284
|
+
// a running card exposes its Session as soon as the worker starts, and the
|
|
5285
|
+
// button must be there while the card is still in progress. No disabled stub.
|
|
5286
|
+
const canOpenChat = asString(run.sessionId) !== "" && typeof openSession === "function";
|
|
5287
|
+
if (canOpenChat) {
|
|
5176
5288
|
const chat = element(doc, "button", "hive-btn hive-btn-ghost hive-card-run-open", translate("drawer.openChat"));
|
|
5177
5289
|
setAttr(chat, "type", "button");
|
|
5178
5290
|
setAttr(chat, "title", translate("drawer.openChat"));
|
|
@@ -5184,9 +5296,10 @@ function mount(root, options = {}) {
|
|
|
5184
5296
|
reportError(error);
|
|
5185
5297
|
}
|
|
5186
5298
|
});
|
|
5187
|
-
|
|
5299
|
+
if (Array.isArray(actionHost) || actionHost) addAction(chat);
|
|
5300
|
+
else foot.appendChild(chat);
|
|
5188
5301
|
}
|
|
5189
|
-
section.appendChild(foot);
|
|
5302
|
+
if (!actionHost) section.appendChild(foot);
|
|
5190
5303
|
return section;
|
|
5191
5304
|
}
|
|
5192
5305
|
|
|
@@ -5226,7 +5339,8 @@ function mount(root, options = {}) {
|
|
|
5226
5339
|
dialog.appendChild(head);
|
|
5227
5340
|
|
|
5228
5341
|
const body = element(doc, "div", "hive-dialog-body hive-card-body");
|
|
5229
|
-
|
|
5342
|
+
const runActions = [];
|
|
5343
|
+
body.appendChild(buildRunSection(card.lastRun, runActions));
|
|
5230
5344
|
dialog.appendChild(body);
|
|
5231
5345
|
|
|
5232
5346
|
const actions = actionsForState(lane, lastModel ? lastModel.writable : false);
|
|
@@ -5240,9 +5354,10 @@ function mount(root, options = {}) {
|
|
|
5240
5354
|
),
|
|
5241
5355
|
);
|
|
5242
5356
|
}
|
|
5243
|
-
if (actions.length > 0) {
|
|
5357
|
+
if (runActions.length > 0 || actions.length > 0) {
|
|
5244
5358
|
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
5245
5359
|
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
5360
|
+
for (const runAction of runActions) foot.appendChild(runAction);
|
|
5246
5361
|
const claimed = asString(card.state || lane) === "claimed";
|
|
5247
5362
|
for (const action of actions) {
|
|
5248
5363
|
const destructive = action.name === "remove";
|
|
@@ -5831,8 +5946,23 @@ function mount(root, options = {}) {
|
|
|
5831
5946
|
return;
|
|
5832
5947
|
}
|
|
5833
5948
|
agentsCount.textContent = String(model.agents.length);
|
|
5949
|
+
// A failed board read must never look like an idle swarm: show the CLI
|
|
5950
|
+
// diagnostic in the strip instead of the "no agents" empty state.
|
|
5951
|
+
if (model.boardError) {
|
|
5952
|
+
const error = element(
|
|
5953
|
+
doc,
|
|
5954
|
+
"span",
|
|
5955
|
+
"hive-agents-error",
|
|
5956
|
+
summarizeActionOutput(model.boardError, 400) || model.boardError,
|
|
5957
|
+
);
|
|
5958
|
+
setAttr(error, "title", model.boardError);
|
|
5959
|
+
setAttr(error, "role", "status");
|
|
5960
|
+
agentPills.appendChild(error);
|
|
5961
|
+
}
|
|
5834
5962
|
if (model.agents.length === 0) {
|
|
5835
|
-
|
|
5963
|
+
if (!model.boardError) {
|
|
5964
|
+
agentPills.appendChild(element(doc, "span", "hive-agents-empty", translate("agents.empty")));
|
|
5965
|
+
}
|
|
5836
5966
|
return;
|
|
5837
5967
|
}
|
|
5838
5968
|
for (const agent of model.agents) {
|
|
@@ -6247,7 +6377,7 @@ function mount(root, options = {}) {
|
|
|
6247
6377
|
|
|
6248
6378
|
return { mount: mount, renderModel: renderModel, messages: messages }
|
|
6249
6379
|
})()
|
|
6250
|
-
var HIVE_PANEL_CSS = "/*\n * hive-panel-ui\n * Dark-first, host-themed through four variables:\n * --hive-bg, --hive-fg, --hive-line, --hive-accent\n * Defaults live on a zero-specificity :root rule and every rule keeps a fallback,\n * so a host can override the variables on :root, body, a wrapper, or .hive.\n */\n\n.hive,\n.hive *,\n.hive *::before,\n.hive *::after {\n box-sizing: border-box;\n}\n\n.hive {\n /* Derived helpers; the four required variables use inline fallbacks. */\n --hive-fg-soft: color-mix(in srgb, var(--hive-fg) 62%, transparent);\n --hive-fg-faint: color-mix(in srgb, var(--hive-fg) 40%, transparent);\n --hive-surface: color-mix(in srgb, var(--hive-fg) 4%, transparent);\n --hive-surface-strong: color-mix(in srgb, var(--hive-fg) 8%, transparent);\n --hive-surface-hover: color-mix(in srgb, var(--hive-fg) 11%, transparent);\n --hive-accent-soft: color-mix(in srgb, var(--hive-accent) 17%, transparent);\n --hive-mono: ui-monospace, \"SFMono-Regular\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 480px;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-lg);\n background: var(--hive-bg);\n color: var(--hive-fg);\n font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n color-scheme: light dark;\n}\n\n.hive ::selection {\n background: color-mix(in srgb, var(--hive-accent) 35%, transparent);\n}\n\n/* ------------------------------------------------------------------ top bar */\n\n.hive-bar {\n display: flex;\n flex: 0 0 auto;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px 12px;\n padding: 9px 14px;\n border-bottom: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 2%, transparent);\n}\n\n.hive-ident {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n}\n\n.hive-brand {\n color: var(--hive-accent);\n font-size: 10px;\n font-weight: 750;\n letter-spacing: 0.18em;\n text-transform: uppercase;\n}\n\n.hive-repo {\n max-width: min(34vw, 360px);\n overflow: hidden;\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 11.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-time {\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.hive-badge {\n padding: 2px 8px;\n border: 1px solid var(--hive-line);\n border-radius: 999px;\n font-size: 10px;\n font-weight: 650;\n letter-spacing: 0.09em;\n line-height: 1.5;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-badge.is-free {\n border-color: color-mix(in srgb, var(--hive-accent) 45%, transparent);\n background: var(--hive-accent-soft);\n color: var(--hive-accent);\n}\n\n.hive-badge.is-freeze {\n border-color: color-mix(in srgb, var(--hive-warn) 45%, transparent);\n background: color-mix(in srgb, var(--hive-warn) 14%, transparent);\n color: var(--hive-warn);\n}\n\n.hive-badge.is-custom {\n color: var(--hive-fg-soft);\n}\n\n.hive-stats {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 5px;\n min-width: 0;\n}\n\n.hive-stat {\n padding: 1px 7px;\n border: 1px solid transparent;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface);\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n font-variant-numeric: tabular-nums;\n line-height: 1.7;\n white-space: nowrap;\n}\n\n.hive-stat strong {\n color: var(--hive-fg);\n font-weight: 650;\n}\n\n.hive-stat.is-total {\n color: var(--hive-fg);\n}\n\n.hive-stat.is-warn {\n color: var(--hive-warn);\n background: color-mix(in srgb, var(--hive-warn) 10%, transparent);\n}\n\n.hive-status {\n color: var(--hive-danger);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-status:empty {\n display: none;\n}\n\n.hive-status::before {\n content: \"● \";\n font-size: 9px;\n}\n\n.hive-status.is-error {\n color: var(--hive-danger);\n}\n\n.hive-status.is-info {\n color: var(--hive-info);\n}\n\n.hive-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-left: auto;\n}\n\n/* ------------------------------------------------------------------ buttons */\n\n.hive-btn {\n appearance: none;\n padding: 4px 10px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface-strong);\n color: var(--hive-fg);\n font: inherit;\n font-size: 11.5px;\n font-weight: 550;\n line-height: 1.5;\n cursor: pointer;\n transition: border-color 120ms ease, background 120ms ease, color 120ms ease;\n}\n\n.hive-btn:hover {\n border-color: color-mix(in srgb, var(--hive-accent) 55%, var(--hive-line));\n background: var(--hive-accent-soft);\n}\n\n.hive-btn:active {\n transform: translateY(1px);\n}\n\n.hive-btn:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 1px;\n}\n\n.hive-btn-ghost {\n padding: 3px 8px;\n border-color: transparent;\n background: transparent;\n color: var(--hive-fg-soft);\n font-size: 11px;\n}\n\n/* ------------------------------------------------------------------- layout */\n\n.hive-main {\n display: grid;\n flex: 1 1 auto;\n grid-template-columns: minmax(185px, 230px) minmax(0, 1fr) minmax(215px, 300px);\n min-height: 0;\n}\n\n.hive-pane {\n display: flex;\n flex-direction: column;\n min-width: 0;\n min-height: 0;\n}\n\n.hive-agents {\n border-right: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 1.5%, transparent);\n}\n\n.hive-events {\n border-left: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 1.5%, transparent);\n}\n\n.hive-pane-head {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 7px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--hive-line);\n color: var(--hive-fg-soft);\n font-size: 10px;\n font-weight: 650;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n}\n\n.hive-hint {\n color: var(--hive-fg-faint);\n font-size: 9.5px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: none;\n}\n\n.hive-count {\n min-width: 18px;\n margin-left: auto;\n padding: 0 6px;\n border-radius: 999px;\n background: var(--hive-surface);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10px;\n font-variant-numeric: tabular-nums;\n line-height: 17px;\n text-align: center;\n}\n\n.hive-scroll {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 7px;\n min-height: 0;\n padding: 10px;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-empty {\n padding: 14px 10px;\n color: var(--hive-fg-faint);\n font-size: 11px;\n text-align: center;\n}\n\n/* ------------------------------------------------------------------- agents */\n\n.hive-agent {\n padding: 8px 10px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface);\n}\n\n.hive-agent-head {\n display: flex;\n align-items: center;\n gap: 7px;\n font-weight: 600;\n}\n\n.hive-agent-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-dot {\n width: 7px;\n height: 7px;\n flex: 0 0 auto;\n border-radius: 50%;\n background: var(--hive-fg-faint);\n box-shadow: none;\n}\n\n.hive-dot.is-working {\n background: var(--hive-accent);\n box-shadow: none;\n}\n\n.hive-dot.is-idle {\n background: var(--hive-fg-faint);\n}\n\n.hive-dot.is-failed {\n background: var(--hive-danger);\n}\n\n.hive-dot.is-done {\n background: var(--hive-ok);\n}\n\n.hive-meta {\n margin-top: 3px;\n overflow: hidden;\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-agent-files {\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n}\n\n/* -------------------------------------------------------------------- lanes */\n\n.hive-board { background: var(--hive-bg); }\n\n.hive-lanes {\n display: flex;\n flex: 1 1 auto;\n align-items: stretch;\n gap: 9px;\n min-height: 0;\n padding: 10px;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-lane {\n display: flex;\n flex: 0 0 232px;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: color-mix(in srgb, var(--hive-fg) 2%, transparent);\n}\n\n.hive-lane-head {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 7px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--hive-line);\n color: var(--hive-fg-soft);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n.hive-lane-head::before {\n width: 3px;\n height: 10px;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-fg-faint);\n content: \"\";\n}\n\n.hive-lane-name {\n color: var(--hive-fg);\n}\n\n.hive-lane-pending .hive-lane-head::before {\n background: var(--hive-accent);\n}\n\n.hive-lane-claimed .hive-lane-head::before {\n background: var(--hive-info);\n}\n\n.hive-lane-done .hive-lane-head::before {\n background: var(--hive-ok);\n}\n\n.hive-lane-failed .hive-lane-head::before {\n background: var(--hive-danger);\n}\n\n.hive-lane-cards {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 7px;\n min-height: 0;\n padding: 7px;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-card {\n padding: 8px 9px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface);\n cursor: pointer;\n transition: border-color 120ms ease, background 120ms ease;\n}\n\n.hive-card:hover {\n border-color: color-mix(in srgb, var(--hive-accent) 55%, var(--hive-line));\n background: var(--hive-surface-hover);\n}\n\n.hive-card:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 1px;\n}\n\n.hive-card-title {\n overflow-wrap: anywhere;\n font-size: 12.5px;\n font-weight: 600;\n line-height: 1.35;\n}\n\n.hive-card-meta {\n margin-top: 4px;\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n}\n\n.hive-scopes {\n display: flex;\n flex-wrap: wrap;\n gap: 3px;\n margin-top: 6px;\n}\n\n.hive-scope {\n max-width: 100%;\n overflow: hidden;\n padding: 1px 5px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface-strong);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-reason {\n margin-top: 6px;\n padding: 3px 6px;\n overflow-wrap: anywhere;\n border-left: 1px solid var(--hive-danger);\n border-radius: 0 var(--hive-radius-sm) var(--hive-radius-sm) 0;\n background: color-mix(in srgb, var(--hive-danger) 10%, transparent);\n color: color-mix(in srgb, var(--hive-danger) 82%, var(--hive-fg));\n font-size: 10.5px;\n}\n\n.hive-card-foot {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 7px;\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n}\n\n.hive-card-id,\n.hive-card-state {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-card-state {\n text-transform: uppercase;\n}\n\n/* ------------------------------------------------------------------- events */\n\n.hive-event {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n gap: 2px 7px;\n padding: 6px 7px;\n border: 1px solid transparent;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface);\n font-size: 10.5px;\n}\n\n.hive-event-time {\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.hive-event-kind {\n justify-self: start;\n overflow: hidden;\n color: var(--hive-accent);\n font-weight: 600;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-event-text {\n grid-column: 1 / -1;\n overflow-wrap: anywhere;\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10px;\n}\n\n/* ------------------------------------------------------------------- drawer */\n\n.hive-drawer {\n position: fixed;\n z-index: 2147483000;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n width: min(440px, 92vw);\n border-left: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-bg) 97%, var(--hive-fg) 3%);\n color: var(--hive-fg);\n box-shadow: none;\n font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n color-scheme: light dark;\n animation: hive-drawer-in 150ms ease-out;\n}\n\n.hive-drawer-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 14px;\n border-bottom: 1px solid var(--hive-line);\n}\n\n.hive-drawer-titlebox {\n min-width: 0;\n}\n\n.hive-drawer-eyebrow {\n overflow: hidden;\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n letter-spacing: 0.05em;\n text-overflow: ellipsis;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-drawer-title {\n margin: 3px 0 0;\n overflow-wrap: anywhere;\n color: var(--hive-fg);\n font-size: 15px;\n font-weight: 650;\n line-height: 1.35;\n}\n\n.hive-drawer-head .hive-btn-ghost {\n flex: 0 0 auto;\n margin-left: auto;\n}\n\n.hive-drawer-body {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 10px;\n min-height: 0;\n padding: 14px;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-actions-row {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.hive-note {\n color: var(--hive-fg-faint);\n font-size: 11px;\n}\n\n.hive-section-label {\n margin-top: 2px;\n color: var(--hive-fg-faint);\n font-size: 9.5px;\n font-weight: 650;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n.hive-json {\n max-height: 55vh;\n margin: 0;\n padding: 10px;\n overflow: auto;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: color-mix(in srgb, var(--hive-fg) 3%, transparent);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10.5px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n white-space: pre-wrap;\n}\n\n@keyframes hive-drawer-in {\n from {\n opacity: 0;\n transform: translateX(18px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .hive-card,\n .hive-btn {\n transition: none;\n }\n\n .hive-drawer {\n animation: none;\n }\n}\n\n/* ------------------------------------------------------------------ compact */\n\n@media (max-width: 920px) {\n .hive {\n min-height: 100dvh;\n height: 100dvh;\n border-radius: 0;\n }\n\n .hive-main {\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: minmax(110px, 17vh) minmax(280px, 1fr) minmax(120px, 20vh);\n }\n\n .hive-agents {\n border-right: 0;\n border-bottom: 1px solid var(--hive-line);\n }\n\n .hive-events {\n border-top: 1px solid var(--hive-line);\n border-left: 0;\n }\n\n .hive-agent-list {\n flex-direction: row;\n overflow-x: auto;\n overflow-y: hidden;\n }\n\n .hive-agent {\n flex: 0 0 190px;\n }\n\n .hive-drawer {\n width: 100vw;\n }\n}\n/* DSH design-token bridge. Neutral grayscale fallbacks keep standalone pages readable. */\n.hive, .hive-portal, .hive-dialog {\n --hive-bg: var(--dsw-alias-bg-base, #fff);\n --hive-bg-layer-1: var(--dsw-alias-bg-layer-1, #fff);\n --hive-bg-layer-2: var(--dsw-alias-bg-layer-2, #fff);\n --hive-bg-layer-3: var(--dsw-alias-bg-layer-3, #f5f5f5);\n --hive-line: var(--dsw-alias-border-l1, #d9d9d9);\n --hive-line-2: var(--dsw-alias-border-l2, #e8e8e8);\n --hive-fg: var(--dsw-alias-label-primary, #000);\n --hive-fg-soft: var(--dsw-alias-label-secondary, #4d4d4d);\n --hive-fg-faint: var(--dsw-alias-label-tertiary, #808080);\n --hive-accent: var(--dsw-alias-brand-primary, #000);\n --hive-hover: var(--dsw-alias-interactive-bg-hover, #f2f2f2);\n --hive-selected: var(--dsw-alias-border-selected, #000);\n --hive-danger: var(--dsw-alias-state-error-primary, #000);\n --hive-ok: var(--dsw-alias-state-success-primary, #000);\n --hive-warn: var(--dsw-alias-state-warn-primary, #000);\n --hive-info: var(--dsw-alias-brand-primary, #000);\n --hive-radius-sm: var(--dsw-radius-sm, 4px);\n --hive-radius-md: var(--dsw-radius-md, 8px);\n --hive-radius-lg: var(--dsw-radius-lg, 12px);\n --hive-elevation: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n --hive-surface: var(--hive-bg-layer-1);\n --hive-surface-strong: var(--hive-bg-layer-2);\n --hive-surface-hover: var(--hive-hover);\n --hive-accent-soft: color-mix(in srgb, var(--hive-accent) 14%, transparent);\n --hive-label-on-brand: var(--hive-bg);\n --hive-mono: ui-monospace, \"SFMono-Regular\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n}\n\n/* Tokenized component treatment. */\n.hive { background: var(--hive-bg); color: var(--hive-fg); border-color: var(--hive-line); border-radius: var(--hive-radius-lg); }\n.hive-bar { background: var(--hive-bg-layer-1); border-bottom-color: var(--hive-line); gap: 8px; }\n.hive-main,\n.hive-board { background: var(--hive-bg); }\n.hive-agents,\n.hive-events { background: var(--hive-bg-layer-1); border-color: var(--hive-line); }\n.hive-lane { background: var(--hive-bg-layer-1); border-color: var(--hive-line); border-radius: var(--hive-radius-md); }\n.hive-card { background: var(--hive-bg-layer-1); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-md); box-shadow: none; }\n.hive-card:hover { background: var(--hive-hover); border-color: var(--hive-line); }\n.hive-btn { background: transparent; border: 1px solid var(--hive-line); color: var(--hive-fg); border-radius: var(--hive-radius-md); }\n.hive-btn:hover { background: var(--hive-hover); border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-btn-ghost { background: transparent; border-color: transparent; color: var(--hive-fg-soft); }\n.hive-btn-ghost:hover { background: var(--hive-hover); border-color: transparent; color: var(--hive-fg); }\n.hive-btn-danger { background: transparent; border-color: var(--hive-danger); color: var(--hive-danger); }\n.hive-btn-danger:hover:not(:disabled) { background: var(--hive-hover); border-color: var(--hive-danger); color: var(--hive-danger); }\n.hive-settings-primary,\n.hive-add-submit { background: var(--hive-accent); border-color: var(--hive-accent); color: var(--hive-label-on-brand); }\n.hive-settings-primary:hover:not(:disabled),\n.hive-add-submit:hover:not(:disabled) { background: var(--hive-accent); border-color: var(--hive-accent); color: var(--hive-label-on-brand); }\n.hive-settings-secondary { background: transparent; border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-settings-secondary:hover { background: var(--hive-hover); border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-input,\n.hive-textarea,\n.hive-limits-input { background: var(--hive-bg-layer-1); border: 1px solid var(--hive-line); color: var(--hive-fg); border-radius: var(--hive-radius-sm); }\n.hive-input:focus,\n.hive-textarea:focus,\n.hive-limits-input:focus { outline: 1px solid var(--hive-selected); outline-offset: 0; }\n.hive-dialog,\n.hive-add-dialog,\n.hive-settings-dialog,\n.hive-card-dialog { background: var(--hive-bg-layer-2); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-lg); box-shadow: var(--hive-elevation); color: var(--hive-fg); }\n.hive-toast { background: var(--hive-bg-layer-2); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-lg); box-shadow: none; color: var(--hive-fg); }\n.hive-drawer { background: var(--hive-bg-layer-2); border-left: 1px solid var(--hive-line); box-shadow: none; }\n.hive-json,\n.hive-plan-raw,\n.hive-plan-item,\n.hive-scope,\n.hive-init-card,\n.hive-limits-error,\n.hive-settings-note { background: var(--hive-bg-layer-1); border-color: var(--hive-line); border-radius: var(--hive-radius-sm); }\n.hive-limits-row { border-top-color: var(--hive-line-2); }\n.hive-limits-row:not(.is-head):hover { background: var(--hive-hover); }\n.hive-settings-tab[aria-selected=\"true\"] { border-bottom-color: var(--hive-selected); }\n.hive-lane-head,\n.hive-dialog-head,\n.hive-dialog-foot,\n.hive-drawer-head,\n.hive-settings-tabs { border-color: var(--hive-line-2); }\n.hive-freeze-banner { background: transparent; border-bottom-color: var(--hive-warn); color: var(--hive-warn); }\n.hive-freeze-banner .hive-btn { background: transparent; border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-queen-hint { background: var(--hive-bg-layer-1); border-color: var(--hive-line); }\n.hive-supervisor-inline,\n.hive-stat,\n.hive-status,\n.hive-queen-badge {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: 22px;\n padding: 0 8px;\n border: 1px solid var(--hive-line);\n border-radius: 999px;\n background: transparent;\n color: var(--hive-fg-soft);\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n white-space: nowrap;\n}\n.hive-supervisor-inline { gap: 6px; }\n.hive-supervisor-inline-label { color: var(--hive-fg-soft); font-weight: 400; }\n.hive-supervisor-inline-state { display: inline-flex; align-items: center; gap: 6px; color: var(--hive-fg-soft); font-size: 12px; font-weight: 400; }\n.hive-supervisor-inline-state::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--hive-fg-faint); content: \"\"; }\n.hive-supervisor-inline-state.is-running::before { background: var(--hive-accent); }\n.hive-supervisor-inline-state.is-backoff::before { background: var(--hive-warn); }\n.hive-supervisor-inline-state.is-paused::before { background: var(--hive-fg-faint); }\n.hive-supervisor-inline-resume { height: auto; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--hive-fg-soft); font-size: 12px; line-height: 1; }\n.hive-supervisor-inline-resume:hover { background: transparent; color: var(--hive-fg); }\n.hive-stats { flex-wrap: wrap; gap: 8px; }\n.hive-stat.is-warn { color: var(--hive-fg-soft); background: transparent; }\n.hive-stat strong { color: var(--hive-fg-soft); font-weight: 400; }\n.hive-status { color: var(--hive-fg-soft); }\n.hive-status::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--hive-danger); content: \"\"; font-size: 0; }\n.hive-status.is-info::before { background: var(--hive-accent); }\n.hive-queen-badge { color: var(--hive-fg-soft); }\n\n\n.hive-portal {\n position: fixed;\n inset: 0;\n z-index: 2147483600;\n pointer-events: none;\n}\n\n.hive-portal > .hive-overlay { pointer-events: auto; }\n\n/* Buttons: two explicit tiers. */\n.hive-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 28px;\n padding: 0 12px;\n border: 1px solid var(--hive-line-2);\n border-radius: var(--hive-radius-md);\n background: transparent;\n color: var(--hive-fg);\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n\n.hive-btn:hover {\n border-color: var(--hive-line-2);\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-btn-ghost {\n border-color: transparent;\n background: transparent;\n color: var(--hive-fg-soft);\n}\n\n.hive-btn-ghost:hover {\n border-color: transparent;\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-btn-danger {\n border-color: var(--hive-danger);\n background: transparent;\n color: var(--hive-danger);\n}\n\n.hive-btn-danger:hover:not(:disabled) {\n border-color: var(--hive-danger);\n background: var(--hive-hover);\n color: var(--hive-danger);\n}\n\n.hive-settings-primary,\n.hive-add-submit {\n border-color: var(--hive-accent);\n background: var(--hive-accent);\n color: var(--hive-label-on-brand);\n font-weight: 600;\n}\n\n.hive-settings-primary:hover:not(:disabled),\n.hive-add-submit:hover:not(:disabled) {\n border-color: var(--hive-accent);\n background: color-mix(in srgb, var(--hive-accent) 92%, #000);\n color: var(--hive-label-on-brand);\n}\n\n.hive-settings-primary:active:not(:disabled),\n.hive-add-submit:active:not(:disabled) {\n border-color: var(--hive-accent);\n background: color-mix(in srgb, var(--hive-accent) 84%, #000);\n color: var(--hive-label-on-brand);\n}\n\n.hive-settings-primary:focus-visible,\n.hive-add-submit:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 2px;\n}\n\n.hive-settings-secondary {\n border-color: var(--hive-line-2);\n background: transparent;\n color: var(--hive-fg);\n}\n\n.hive-settings-secondary:hover {\n border-color: var(--hive-line-2);\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-icon-button,\n.hive-dialog-close {\n height: 28px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--hive-fg-soft);\n}\n\n.hive-icon-button:hover,\n.hive-dialog-close:hover {\n border: 0;\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-role-remove {\n height: 28px;\n min-height: 28px;\n padding: 0;\n border-color: transparent;\n background: transparent;\n color: var(--hive-danger);\n}\n\n/* Dialogs are portaled to the document body; keep them above the panel. */\n.hive-dialog,\n.hive-add-dialog,\n.hive-settings-dialog,\n.hive-card-dialog {\n border: 1px solid var(--hive-line);\n background: var(--hive-bg-layer-2);\n box-shadow: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n}\n\n/* toolbar action rhythm */\n.hive-actions { gap: 8px; }\n.hive-actions > .hive-btn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }\n\n/* Dialog form containment: portal content must not create horizontal scroll. */\n.hive-portal,\n.hive-portal *,\n.hive-portal *::before,\n.hive-portal *::after { box-sizing: border-box; }\n\n.hive-portal .hive-dialog { max-width: 92vw; overflow-x: hidden; }\n.hive-portal .hive-dialog-head,\n.hive-portal .hive-dialog-body,\n.hive-portal .hive-dialog-foot { padding-left: 16px; padding-right: 16px; }\n.hive-portal .hive-dialog-body { width: auto; min-width: 0; max-width: 100%; }\n.hive-portal .hive-dialog-body > * { margin-left: 0; margin-right: 0; max-width: 100%; min-width: 0; }\n.hive-portal .hive-field,\n.hive-portal .hive-field-row,\n.hive-portal .hive-settings-section,\n.hive-portal .hive-settings-tabpanel,\n.hive-portal .hive-limits-table { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }\n.hive-portal .hive-field-row > .hive-field { width: auto; flex: 1 1 160px; }\n.hive-portal .hive-input,\n.hive-portal .hive-textarea,\n.hive-portal select { width: 100%; min-width: 0; max-width: 100%; }\n.hive-portal .hive-limits-row {\n width: 100%;\n max-width: 100%;\n min-width: 0;\n grid-template-columns: minmax(0, 1fr) 96px 48px 48px 28px;\n}\n.hive-portal .hive-limits-cell,\n.hive-portal .hive-limits-role,\n.hive-portal .hive-dialog-title,\n.hive-portal .hive-card-subline,\n.hive-portal .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }\n.hive-portal .hive-dialog-foot { flex-wrap: wrap; }\n\n.hive-portal .hive-dialog-body { overflow-x: hidden; }\n.hive-portal .hive-settings-tabs { flex-wrap: wrap; }\n.hive-portal .hive-card-actions,\n.hive-portal .hive-settings-form-actions { max-width: 100%; }\n\n/* Native <dialog>: top layer, browser-managed backdrop and focus trap. */\n.hive-dialog,\n.hive-dialog *,\n.hive-dialog *::before,\n.hive-dialog *::after { box-sizing: border-box; }\n\ndialog.hive-dialog {\n position: fixed;\n inset: 0;\n margin: auto;\n padding: 0;\n width: min(560px, 100%);\n max-width: 92vw;\n max-height: 80vh;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-lg);\n background: var(--hive-bg-layer-2);\n color: var(--hive-fg);\n box-shadow: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n color-scheme: light dark;\n}\n\ndialog.hive-card-dialog { width: min(720px, 92vw); }\n\ndialog.hive-dialog::backdrop {\n background: var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, 0.24));\n backdrop-filter: var(--dsw-mask-blur, none);\n}\n\ndialog.hive-dialog .hive-dialog-head,\ndialog.hive-dialog .hive-dialog-body,\ndialog.hive-dialog .hive-dialog-foot { padding-left: 16px; padding-right: 16px; }\ndialog.hive-dialog .hive-dialog-body { width: auto; min-width: 0; max-width: 100%; overflow-x: hidden; }\ndialog.hive-dialog .hive-dialog-body > * { margin-left: 0; margin-right: 0; max-width: 100%; min-width: 0; }\ndialog.hive-dialog .hive-field,\ndialog.hive-dialog .hive-field-row,\ndialog.hive-dialog .hive-settings-section,\ndialog.hive-dialog .hive-settings-tabpanel,\ndialog.hive-dialog .hive-limits-table { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }\ndialog.hive-dialog .hive-field-row > .hive-field { width: auto; flex: 1 1 160px; }\ndialog.hive-dialog .hive-input,\ndialog.hive-dialog .hive-textarea,\ndialog.hive-dialog select { width: 100%; min-width: 0; max-width: 100%; }\ndialog.hive-dialog .hive-limits-row {\n width: 100%;\n max-width: 100%;\n min-width: 0;\n grid-template-columns: minmax(0, 1fr) 96px 48px 48px 28px;\n}\ndialog.hive-dialog .hive-limits-cell,\ndialog.hive-dialog .hive-limits-role,\ndialog.hive-dialog .hive-dialog-title,\ndialog.hive-dialog .hive-card-subline,\ndialog.hive-dialog .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }\ndialog.hive-dialog .hive-dialog-foot { flex-wrap: wrap; }\n\n\n/* The DSH design-token bridge is bundled in panel.css; this file is kept for package layout compatibility. */\n"
|
|
6380
|
+
var HIVE_PANEL_CSS = "/*\n * hive-panel-ui\n * Dark-first, host-themed through four variables:\n * --hive-bg, --hive-fg, --hive-line, --hive-accent\n * Defaults live on a zero-specificity :root rule and every rule keeps a fallback,\n * so a host can override the variables on :root, body, a wrapper, or .hive.\n */\n\n.hive,\n.hive *,\n.hive *::before,\n.hive *::after {\n box-sizing: border-box;\n}\n\n.hive {\n /* Derived helpers; the four required variables use inline fallbacks. */\n --hive-fg-soft: color-mix(in srgb, var(--hive-fg) 62%, transparent);\n --hive-fg-faint: color-mix(in srgb, var(--hive-fg) 40%, transparent);\n --hive-surface: color-mix(in srgb, var(--hive-fg) 4%, transparent);\n --hive-surface-strong: color-mix(in srgb, var(--hive-fg) 8%, transparent);\n --hive-surface-hover: color-mix(in srgb, var(--hive-fg) 11%, transparent);\n --hive-accent-soft: color-mix(in srgb, var(--hive-accent) 17%, transparent);\n --hive-mono: ui-monospace, \"SFMono-Regular\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n\n display: flex;\n flex-direction: column;\n width: 100%;\n height: 100%;\n min-height: 480px;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-lg);\n background: var(--hive-bg);\n color: var(--hive-fg);\n font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n color-scheme: light dark;\n}\n\n.hive ::selection {\n background: color-mix(in srgb, var(--hive-accent) 35%, transparent);\n}\n\n/* ------------------------------------------------------------------ top bar */\n\n.hive-bar {\n display: flex;\n flex: 0 0 auto;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px 12px;\n padding: 9px 14px;\n border-bottom: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 2%, transparent);\n}\n\n.hive-ident {\n display: flex;\n align-items: baseline;\n gap: 8px;\n min-width: 0;\n}\n\n.hive-brand {\n color: var(--hive-accent);\n font-size: 10px;\n font-weight: 750;\n letter-spacing: 0.18em;\n text-transform: uppercase;\n}\n\n.hive-repo {\n max-width: min(34vw, 360px);\n overflow: hidden;\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 11.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-time {\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 11px;\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.hive-badge {\n padding: 2px 8px;\n border: 1px solid var(--hive-line);\n border-radius: 999px;\n font-size: 10px;\n font-weight: 650;\n letter-spacing: 0.09em;\n line-height: 1.5;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-badge.is-free {\n border-color: color-mix(in srgb, var(--hive-accent) 45%, transparent);\n background: var(--hive-accent-soft);\n color: var(--hive-accent);\n}\n\n.hive-badge.is-freeze {\n border-color: color-mix(in srgb, var(--hive-warn) 45%, transparent);\n background: color-mix(in srgb, var(--hive-warn) 14%, transparent);\n color: var(--hive-warn);\n}\n\n.hive-badge.is-custom {\n color: var(--hive-fg-soft);\n}\n\n.hive-stats {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 5px;\n min-width: 0;\n}\n\n.hive-stat {\n padding: 1px 7px;\n border: 1px solid transparent;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface);\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n font-variant-numeric: tabular-nums;\n line-height: 1.7;\n white-space: nowrap;\n}\n\n.hive-stat strong {\n color: var(--hive-fg);\n font-weight: 650;\n}\n\n.hive-stat.is-total {\n color: var(--hive-fg);\n}\n\n.hive-stat.is-warn {\n color: var(--hive-warn);\n background: color-mix(in srgb, var(--hive-warn) 10%, transparent);\n}\n\n.hive-status {\n color: var(--hive-danger);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.09em;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-status:empty {\n display: none;\n}\n\n.hive-status::before {\n content: \"● \";\n font-size: 9px;\n}\n\n.hive-status.is-error {\n color: var(--hive-danger);\n}\n\n.hive-status.is-info {\n color: var(--hive-info);\n}\n\n.hive-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-left: auto;\n}\n\n/* ------------------------------------------------------------------ buttons */\n\n.hive-btn {\n appearance: none;\n padding: 4px 10px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface-strong);\n color: var(--hive-fg);\n font: inherit;\n font-size: 11.5px;\n font-weight: 550;\n line-height: 1.5;\n cursor: pointer;\n transition: border-color 120ms ease, background 120ms ease, color 120ms ease;\n}\n\n.hive-btn:hover {\n border-color: color-mix(in srgb, var(--hive-accent) 55%, var(--hive-line));\n background: var(--hive-accent-soft);\n}\n\n.hive-btn:active {\n transform: translateY(1px);\n}\n\n.hive-btn:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 1px;\n}\n\n.hive-btn-ghost {\n padding: 3px 8px;\n border-color: transparent;\n background: transparent;\n color: var(--hive-fg-soft);\n font-size: 11px;\n}\n\n/* ------------------------------------------------------------------- layout */\n\n.hive-main {\n display: grid;\n flex: 1 1 auto;\n grid-template-columns: minmax(185px, 230px) minmax(0, 1fr) minmax(215px, 300px);\n min-height: 0;\n}\n\n.hive-pane {\n display: flex;\n flex-direction: column;\n min-width: 0;\n min-height: 0;\n}\n\n.hive-agents {\n border-right: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 1.5%, transparent);\n}\n\n.hive-events {\n border-left: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-fg) 1.5%, transparent);\n}\n\n.hive-pane-head {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 7px;\n padding: 8px 12px;\n border-bottom: 1px solid var(--hive-line);\n color: var(--hive-fg-soft);\n font-size: 10px;\n font-weight: 650;\n letter-spacing: 0.12em;\n text-transform: uppercase;\n}\n\n.hive-hint {\n color: var(--hive-fg-faint);\n font-size: 9.5px;\n font-weight: 500;\n letter-spacing: 0.04em;\n text-transform: none;\n}\n\n.hive-count {\n min-width: 18px;\n margin-left: auto;\n padding: 0 6px;\n border-radius: 999px;\n background: var(--hive-surface);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10px;\n font-variant-numeric: tabular-nums;\n line-height: 17px;\n text-align: center;\n}\n\n.hive-scroll {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 7px;\n min-height: 0;\n padding: 10px;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-empty {\n padding: 14px 10px;\n color: var(--hive-fg-faint);\n font-size: 11px;\n text-align: center;\n}\n\n/* ------------------------------------------------------------------- agents */\n\n.hive-agent {\n padding: 8px 10px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface);\n}\n\n.hive-agent-head {\n display: flex;\n align-items: center;\n gap: 7px;\n font-weight: 600;\n}\n\n.hive-agent-name {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-dot {\n width: 7px;\n height: 7px;\n flex: 0 0 auto;\n border-radius: 50%;\n background: var(--hive-fg-faint);\n box-shadow: none;\n}\n\n.hive-dot.is-working {\n background: var(--hive-accent);\n box-shadow: none;\n}\n\n.hive-dot.is-idle {\n background: var(--hive-fg-faint);\n}\n\n.hive-dot.is-failed {\n background: var(--hive-danger);\n}\n\n.hive-dot.is-done {\n background: var(--hive-ok);\n}\n\n.hive-meta {\n margin-top: 3px;\n overflow: hidden;\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-agent-files {\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n}\n\n/* -------------------------------------------------------------------- lanes */\n\n.hive-board { background: var(--hive-bg); }\n\n.hive-lanes {\n display: flex;\n flex: 1 1 auto;\n align-items: stretch;\n gap: 9px;\n min-height: 0;\n padding: 10px;\n overflow-x: auto;\n overflow-y: hidden;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-lane {\n display: flex;\n flex: 0 0 232px;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: color-mix(in srgb, var(--hive-fg) 2%, transparent);\n}\n\n.hive-lane-head {\n display: flex;\n flex: 0 0 auto;\n align-items: center;\n gap: 7px;\n padding: 8px 10px;\n border-bottom: 1px solid var(--hive-line);\n color: var(--hive-fg-soft);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n.hive-lane-head::before {\n width: 3px;\n height: 10px;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-fg-faint);\n content: \"\";\n}\n\n.hive-lane-name {\n color: var(--hive-fg);\n}\n\n.hive-lane-pending .hive-lane-head::before {\n background: var(--hive-accent);\n}\n\n.hive-lane-claimed .hive-lane-head::before {\n background: var(--hive-info);\n}\n\n.hive-lane-done .hive-lane-head::before {\n background: var(--hive-ok);\n}\n\n.hive-lane-failed .hive-lane-head::before {\n background: var(--hive-danger);\n}\n\n.hive-lane-cards {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 7px;\n min-height: 0;\n padding: 7px;\n overflow-x: hidden;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-card {\n padding: 8px 9px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: var(--hive-surface);\n cursor: pointer;\n transition: border-color 120ms ease, background 120ms ease;\n}\n\n.hive-card:hover {\n border-color: color-mix(in srgb, var(--hive-accent) 55%, var(--hive-line));\n background: var(--hive-surface-hover);\n}\n\n.hive-card:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 1px;\n}\n\n.hive-card-title {\n overflow-wrap: anywhere;\n font-size: 12.5px;\n font-weight: 600;\n line-height: 1.35;\n}\n\n.hive-card-meta {\n margin-top: 4px;\n color: var(--hive-fg-soft);\n font-size: 10.5px;\n}\n\n.hive-scopes {\n display: flex;\n flex-wrap: wrap;\n gap: 3px;\n margin-top: 6px;\n}\n\n.hive-scope {\n max-width: 100%;\n overflow: hidden;\n padding: 1px 5px;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface-strong);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-reason {\n margin-top: 6px;\n padding: 3px 6px;\n overflow-wrap: anywhere;\n border-left: 1px solid var(--hive-danger);\n border-radius: 0 var(--hive-radius-sm) var(--hive-radius-sm) 0;\n background: color-mix(in srgb, var(--hive-danger) 10%, transparent);\n color: color-mix(in srgb, var(--hive-danger) 82%, var(--hive-fg));\n font-size: 10.5px;\n}\n\n.hive-card-foot {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 7px;\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n}\n\n.hive-card-id,\n.hive-card-state {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-card-state {\n text-transform: uppercase;\n}\n\n/* ------------------------------------------------------------------- events */\n\n.hive-event {\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n gap: 2px 7px;\n padding: 6px 7px;\n border: 1px solid transparent;\n border-radius: var(--hive-radius-sm);\n background: var(--hive-surface);\n font-size: 10.5px;\n}\n\n.hive-event-time {\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.hive-event-kind {\n justify-self: start;\n overflow: hidden;\n color: var(--hive-accent);\n font-weight: 600;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-event-text {\n grid-column: 1 / -1;\n overflow-wrap: anywhere;\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10px;\n}\n\n/* ------------------------------------------------------------------- drawer */\n\n.hive-drawer {\n position: fixed;\n z-index: 2147483000;\n top: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n width: min(440px, 92vw);\n border-left: 1px solid var(--hive-line);\n background: color-mix(in srgb, var(--hive-bg) 97%, var(--hive-fg) 3%);\n color: var(--hive-fg);\n box-shadow: none;\n font: 14px/1.5 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif;\n color-scheme: light dark;\n animation: hive-drawer-in 150ms ease-out;\n}\n\n.hive-drawer-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n padding: 14px;\n border-bottom: 1px solid var(--hive-line);\n}\n\n.hive-drawer-titlebox {\n min-width: 0;\n}\n\n.hive-drawer-eyebrow {\n overflow: hidden;\n color: var(--hive-fg-faint);\n font-family: var(--hive-mono);\n font-size: 9.5px;\n letter-spacing: 0.05em;\n text-overflow: ellipsis;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.hive-drawer-title {\n margin: 3px 0 0;\n overflow-wrap: anywhere;\n color: var(--hive-fg);\n font-size: 15px;\n font-weight: 650;\n line-height: 1.35;\n}\n\n.hive-drawer-head .hive-btn-ghost {\n flex: 0 0 auto;\n margin-left: auto;\n}\n\n.hive-drawer-body {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n gap: 10px;\n min-height: 0;\n padding: 14px;\n overflow-y: auto;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n}\n\n.hive-actions-row {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n.hive-note {\n color: var(--hive-fg-faint);\n font-size: 11px;\n}\n\n.hive-section-label {\n margin-top: 2px;\n color: var(--hive-fg-faint);\n font-size: 9.5px;\n font-weight: 650;\n letter-spacing: 0.1em;\n text-transform: uppercase;\n}\n\n.hive-json {\n max-height: 55vh;\n margin: 0;\n padding: 10px;\n overflow: auto;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-md);\n background: color-mix(in srgb, var(--hive-fg) 3%, transparent);\n color: var(--hive-fg-soft);\n font-family: var(--hive-mono);\n font-size: 10.5px;\n line-height: 1.55;\n overflow-wrap: anywhere;\n scrollbar-color: var(--hive-line) transparent;\n scrollbar-width: thin;\n white-space: pre-wrap;\n}\n\n@keyframes hive-drawer-in {\n from {\n opacity: 0;\n transform: translateX(18px);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .hive-card,\n .hive-btn {\n transition: none;\n }\n\n .hive-drawer {\n animation: none;\n }\n}\n\n/* ------------------------------------------------------------------ compact */\n\n@media (max-width: 920px) {\n .hive {\n min-height: 100dvh;\n height: 100dvh;\n border-radius: 0;\n }\n\n .hive-main {\n grid-template-columns: minmax(0, 1fr);\n grid-template-rows: minmax(110px, 17vh) minmax(280px, 1fr) minmax(120px, 20vh);\n }\n\n .hive-agents {\n border-right: 0;\n border-bottom: 1px solid var(--hive-line);\n }\n\n .hive-events {\n border-top: 1px solid var(--hive-line);\n border-left: 0;\n }\n\n .hive-agent-list {\n flex-direction: row;\n overflow-x: auto;\n overflow-y: hidden;\n }\n\n .hive-agent {\n flex: 0 0 190px;\n }\n\n .hive-drawer {\n width: 100vw;\n }\n}\n/* DSH design-token bridge. Neutral grayscale fallbacks keep standalone pages readable. */\n.hive, .hive-portal, .hive-dialog {\n --hive-bg: var(--dsw-alias-bg-base, #fff);\n --hive-bg-layer-1: var(--dsw-alias-bg-layer-1, #fff);\n --hive-bg-layer-2: var(--dsw-alias-bg-layer-2, #fff);\n --hive-bg-layer-3: var(--dsw-alias-bg-layer-3, #f5f5f5);\n --hive-line: var(--dsw-alias-border-l1, #d9d9d9);\n --hive-line-2: var(--dsw-alias-border-l2, #e8e8e8);\n --hive-fg: var(--dsw-alias-label-primary, #000);\n --hive-fg-soft: var(--dsw-alias-label-secondary, #4d4d4d);\n --hive-fg-faint: var(--dsw-alias-label-tertiary, #808080);\n --hive-accent: var(--dsw-alias-brand-primary, #000);\n --hive-hover: var(--dsw-alias-interactive-bg-hover, #f2f2f2);\n --hive-selected: var(--dsw-alias-border-selected, #000);\n --hive-danger: var(--dsw-alias-state-error-primary, #000);\n --hive-ok: var(--dsw-alias-state-success-primary, #000);\n --hive-warn: var(--dsw-alias-state-warn-primary, #000);\n --hive-info: var(--dsw-alias-brand-primary, #000);\n --hive-radius-sm: var(--dsw-radius-sm, 4px);\n --hive-radius-md: var(--dsw-radius-md, 8px);\n --hive-radius-lg: var(--dsw-radius-lg, 12px);\n --hive-elevation: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n --hive-surface: var(--hive-bg-layer-1);\n --hive-surface-strong: var(--hive-bg-layer-2);\n --hive-surface-hover: var(--hive-hover);\n --hive-accent-soft: color-mix(in srgb, var(--hive-accent) 14%, transparent);\n --hive-label-on-brand: var(--hive-bg);\n --hive-mono: ui-monospace, \"SFMono-Regular\", \"JetBrains Mono\", Menlo, Consolas, monospace;\n}\n\n/* Tokenized component treatment. */\n.hive { background: var(--hive-bg); color: var(--hive-fg); border-color: var(--hive-line); border-radius: var(--hive-radius-lg); }\n.hive-bar { background: var(--hive-bg-layer-1); border-bottom-color: var(--hive-line); gap: 8px; }\n.hive-main,\n.hive-board { background: var(--hive-bg); }\n.hive-agents,\n.hive-events { background: var(--hive-bg-layer-1); border-color: var(--hive-line); }\n.hive-lane { background: var(--hive-bg-layer-1); border-color: var(--hive-line); border-radius: var(--hive-radius-md); }\n.hive-card { background: var(--hive-bg-layer-1); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-md); box-shadow: none; }\n.hive-card:hover { background: var(--hive-hover); border-color: var(--hive-line); }\n.hive-btn { background: transparent; border: 1px solid var(--hive-line); color: var(--hive-fg); border-radius: var(--hive-radius-md); }\n.hive-btn:hover { background: var(--hive-hover); border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-btn-ghost { background: transparent; border-color: transparent; color: var(--hive-fg-soft); }\n.hive-btn-ghost:hover { background: var(--hive-hover); border-color: transparent; color: var(--hive-fg); }\n.hive-btn-danger { background: transparent; border-color: var(--hive-danger); color: var(--hive-danger); }\n.hive-btn-danger:hover:not(:disabled) { background: var(--hive-hover); border-color: var(--hive-danger); color: var(--hive-danger); }\n.hive-settings-primary,\n.hive-add-submit { background: var(--hive-accent); border-color: var(--hive-accent); color: var(--hive-label-on-brand); }\n.hive-settings-primary:hover:not(:disabled),\n.hive-add-submit:hover:not(:disabled) { background: var(--hive-accent); border-color: var(--hive-accent); color: var(--hive-label-on-brand); }\n.hive-settings-secondary { background: transparent; border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-settings-secondary:hover { background: var(--hive-hover); border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-input,\n.hive-textarea,\n.hive-limits-input { background: var(--hive-bg-layer-1); border: 1px solid var(--hive-line); color: var(--hive-fg); border-radius: var(--hive-radius-sm); }\n.hive-input:focus,\n.hive-textarea:focus,\n.hive-limits-input:focus { outline: 1px solid var(--hive-selected); outline-offset: 0; }\n.hive-dialog,\n.hive-add-dialog,\n.hive-settings-dialog,\n.hive-card-dialog { background: var(--hive-bg-layer-2); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-lg); box-shadow: var(--hive-elevation); color: var(--hive-fg); }\n.hive-toast { background: var(--hive-bg-layer-2); border: 1px solid var(--hive-line); border-radius: var(--hive-radius-lg); box-shadow: none; color: var(--hive-fg); }\n.hive-drawer { background: var(--hive-bg-layer-2); border-left: 1px solid var(--hive-line); box-shadow: none; }\n.hive-json,\n.hive-plan-raw,\n.hive-plan-item,\n.hive-scope,\n.hive-init-card,\n.hive-limits-error,\n.hive-settings-note { background: var(--hive-bg-layer-1); border-color: var(--hive-line); border-radius: var(--hive-radius-sm); }\n.hive-limits-row { border-top-color: var(--hive-line-2); }\n.hive-limits-row:not(.is-head):hover { background: var(--hive-hover); }\n.hive-settings-tab[aria-selected=\"true\"] { border-bottom-color: var(--hive-selected); }\n.hive-lane-head,\n.hive-dialog-head,\n.hive-dialog-foot,\n.hive-drawer-head,\n.hive-settings-tabs { border-color: var(--hive-line-2); }\n.hive-freeze-banner { background: transparent; border-bottom-color: var(--hive-warn); color: var(--hive-warn); }\n.hive-freeze-banner .hive-btn { background: transparent; border-color: var(--hive-line); color: var(--hive-fg); }\n.hive-queen-hint { background: var(--hive-bg-layer-1); border-color: var(--hive-line); }\n.hive-supervisor-inline,\n.hive-stat,\n.hive-status,\n.hive-queen-badge {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n height: 22px;\n padding: 0 8px;\n border: 1px solid var(--hive-line);\n border-radius: 999px;\n background: transparent;\n color: var(--hive-fg-soft);\n font-size: 12px;\n font-weight: 400;\n line-height: 1;\n white-space: nowrap;\n}\n.hive-supervisor-inline { gap: 6px; }\n.hive-supervisor-inline-label { color: var(--hive-fg-soft); font-weight: 400; }\n.hive-supervisor-inline-state { display: inline-flex; align-items: center; gap: 6px; color: var(--hive-fg-soft); font-size: 12px; font-weight: 400; }\n.hive-supervisor-inline-state::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--hive-fg-faint); content: \"\"; }\n.hive-supervisor-inline-state.is-running::before { background: var(--hive-accent); }\n.hive-supervisor-inline-state.is-backoff::before { background: var(--hive-warn); }\n.hive-supervisor-inline-state.is-paused::before { background: var(--hive-fg-faint); }\n.hive-supervisor-inline-resume { height: auto; min-height: 0; padding: 0; border: 0; background: transparent; color: var(--hive-fg-soft); font-size: 12px; line-height: 1; }\n.hive-supervisor-inline-resume:hover { background: transparent; color: var(--hive-fg); }\n.hive-stats { flex-wrap: wrap; gap: 8px; }\n.hive-stat.is-warn { color: var(--hive-fg-soft); background: transparent; }\n.hive-stat strong { color: var(--hive-fg-soft); font-weight: 400; }\n.hive-status { color: var(--hive-fg-soft); }\n.hive-status::before { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--hive-danger); content: \"\"; font-size: 0; }\n.hive-status.is-info::before { background: var(--hive-accent); }\n.hive-queen-badge { color: var(--hive-fg-soft); }\n\n\n.hive-portal {\n position: fixed;\n inset: 0;\n z-index: 2147483600;\n pointer-events: none;\n}\n\n.hive-portal > .hive-overlay { pointer-events: auto; }\n\n/* Buttons: two explicit tiers. */\n.hive-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n height: 28px;\n padding: 0 12px;\n border: 1px solid var(--hive-line-2);\n border-radius: var(--hive-radius-md);\n background: transparent;\n color: var(--hive-fg);\n font-size: 14px;\n font-weight: 600;\n line-height: 1.5;\n}\n\n.hive-btn:hover {\n border-color: var(--hive-line-2);\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-btn-ghost {\n border-color: transparent;\n background: transparent;\n color: var(--hive-fg-soft);\n}\n\n.hive-btn-ghost:hover {\n border-color: transparent;\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-btn-danger {\n border-color: var(--hive-danger);\n background: transparent;\n color: var(--hive-danger);\n}\n\n.hive-btn-danger:hover:not(:disabled) {\n border-color: var(--hive-danger);\n background: var(--hive-hover);\n color: var(--hive-danger);\n}\n\n.hive-settings-primary,\n.hive-add-submit {\n border-color: var(--hive-accent);\n background: var(--hive-accent);\n color: var(--hive-label-on-brand);\n font-weight: 600;\n}\n\n.hive-settings-primary:hover:not(:disabled),\n.hive-add-submit:hover:not(:disabled) {\n border-color: var(--hive-accent);\n background: color-mix(in srgb, var(--hive-accent) 92%, #000);\n color: var(--hive-label-on-brand);\n}\n\n.hive-settings-primary:active:not(:disabled),\n.hive-add-submit:active:not(:disabled) {\n border-color: var(--hive-accent);\n background: color-mix(in srgb, var(--hive-accent) 84%, #000);\n color: var(--hive-label-on-brand);\n}\n\n.hive-settings-primary:focus-visible,\n.hive-add-submit:focus-visible {\n outline: 2px solid var(--hive-accent);\n outline-offset: 2px;\n}\n\n.hive-settings-secondary {\n border-color: var(--hive-line-2);\n background: transparent;\n color: var(--hive-fg);\n}\n\n.hive-settings-secondary:hover {\n border-color: var(--hive-line-2);\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-icon-button,\n.hive-dialog-close {\n height: 28px;\n padding: 0;\n border: 0;\n background: transparent;\n color: var(--hive-fg-soft);\n}\n\n.hive-icon-button:hover,\n.hive-dialog-close:hover {\n border: 0;\n background: var(--hive-hover);\n color: var(--hive-fg);\n}\n\n.hive-role-remove {\n height: 28px;\n min-height: 28px;\n padding: 0;\n border-color: transparent;\n background: transparent;\n color: var(--hive-danger);\n}\n\n/* Dialogs are portaled to the document body; keep them above the panel. */\n.hive-dialog,\n.hive-add-dialog,\n.hive-settings-dialog,\n.hive-card-dialog {\n border: 1px solid var(--hive-line);\n background: var(--hive-bg-layer-2);\n box-shadow: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n}\n\n/* toolbar action rhythm */\n.hive-actions { gap: 8px; }\n.hive-actions > .hive-btn { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }\n\n/* Dialog form containment: portal content must not create horizontal scroll. */\n.hive-portal,\n.hive-portal *,\n.hive-portal *::before,\n.hive-portal *::after { box-sizing: border-box; }\n\n.hive-portal .hive-dialog { max-width: 92vw; overflow-x: hidden; }\n.hive-portal .hive-dialog-head,\n.hive-portal .hive-dialog-body,\n.hive-portal .hive-dialog-foot { padding-left: 16px; padding-right: 16px; }\n.hive-portal .hive-dialog-body { width: auto; min-width: 0; max-width: 100%; }\n.hive-portal .hive-dialog-body > * { margin-left: 0; margin-right: 0; max-width: 100%; min-width: 0; }\n.hive-portal .hive-field,\n.hive-portal .hive-field-row,\n.hive-portal .hive-settings-section,\n.hive-portal .hive-settings-tabpanel,\n.hive-portal .hive-limits-table { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }\n.hive-portal .hive-field-row > .hive-field { width: auto; flex: 1 1 160px; }\n.hive-portal .hive-input,\n.hive-portal .hive-textarea,\n.hive-portal select { width: 100%; min-width: 0; max-width: 100%; }\n.hive-portal .hive-limits-row {\n width: 100%;\n max-width: 100%;\n min-width: 0;\n grid-template-columns: minmax(0, 1fr) 96px 48px 48px 28px;\n}\n.hive-portal .hive-limits-cell,\n.hive-portal .hive-limits-role,\n.hive-portal .hive-dialog-title,\n.hive-portal .hive-card-subline,\n.hive-portal .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }\n.hive-portal .hive-dialog-foot { flex-wrap: wrap; }\n\n.hive-portal .hive-dialog-body { overflow-x: hidden; }\n.hive-portal .hive-settings-tabs { flex-wrap: wrap; }\n.hive-portal .hive-card-actions,\n.hive-portal .hive-settings-form-actions { max-width: 100%; }\n\n/* Native <dialog>: top layer, browser-managed backdrop and focus trap. */\n.hive-dialog,\n.hive-dialog *,\n.hive-dialog *::before,\n.hive-dialog *::after { box-sizing: border-box; }\n\ndialog.hive-dialog {\n position: fixed;\n inset: 0;\n margin: auto;\n padding: 0;\n width: min(560px, 100%);\n max-width: 92vw;\n max-height: 80vh;\n overflow: hidden;\n border: 1px solid var(--hive-line);\n border-radius: var(--hive-radius-lg);\n background: var(--hive-bg-layer-2);\n color: var(--hive-fg);\n box-shadow: var(--dsw-elevation-panel, 0 12px 32px rgba(0, 0, 0, 0.18));\n color-scheme: light dark;\n}\n\ndialog.hive-card-dialog { width: min(720px, 92vw); }\n\ndialog.hive-dialog::backdrop {\n background: var(--dsw-alias-bg-mask-1, rgba(0, 0, 0, 0.24));\n backdrop-filter: var(--dsw-mask-blur, none);\n}\n\ndialog.hive-dialog .hive-dialog-head,\ndialog.hive-dialog .hive-dialog-body,\ndialog.hive-dialog .hive-dialog-foot { padding-left: 16px; padding-right: 16px; }\ndialog.hive-dialog .hive-dialog-body { width: auto; min-width: 0; max-width: 100%; overflow-x: hidden; }\ndialog.hive-dialog .hive-dialog-body > * { margin-left: 0; margin-right: 0; max-width: 100%; min-width: 0; }\ndialog.hive-dialog .hive-field,\ndialog.hive-dialog .hive-field-row,\ndialog.hive-dialog .hive-settings-section,\ndialog.hive-dialog .hive-settings-tabpanel,\ndialog.hive-dialog .hive-limits-table { width: 100%; max-width: 100%; min-width: 0; margin-left: 0; margin-right: 0; }\ndialog.hive-dialog .hive-field-row > .hive-field { width: auto; flex: 1 1 160px; }\ndialog.hive-dialog .hive-input,\ndialog.hive-dialog .hive-textarea,\ndialog.hive-dialog select { width: 100%; min-width: 0; max-width: 100%; }\ndialog.hive-dialog .hive-limits-row {\n width: 100%;\n max-width: 100%;\n min-width: 0;\n grid-template-columns: minmax(0, 1fr) 96px 48px 48px 28px;\n}\ndialog.hive-dialog .hive-limits-cell,\ndialog.hive-dialog .hive-limits-role,\ndialog.hive-dialog .hive-dialog-title,\ndialog.hive-dialog .hive-card-subline,\ndialog.hive-dialog .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }\ndialog.hive-dialog .hive-dialog-foot { flex-wrap: wrap; }\n\ndialog.hive-dialog {\n display: flex;\n flex-direction: column;\n max-height: 80vh;\n}\ndialog.hive-dialog .hive-dialog-head,\ndialog.hive-dialog .hive-dialog-foot { flex: 0 0 auto; }\ndialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; }\n.hive-card-run-output { max-height: 20lh; overflow: auto; }\n.hive-card-actions { flex-wrap: wrap; justify-content: flex-end; }\n\n\n/* The DSH design-token bridge is bundled in panel.css; this file is kept for package layout compatibility. */\n"
|
|
6251
6381
|
function ensureHivePanelCss() {
|
|
6252
6382
|
if (typeof document === 'undefined') return
|
|
6253
6383
|
if (document.querySelector('style[data-hive-panel-css]') !== null) return
|
package/lib/index.js
CHANGED
|
@@ -238,6 +238,49 @@ export function parseJson(text, fallback) {
|
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
+
/** Last `max` characters of CLI output collapsed onto one line. */
|
|
242
|
+
function tailText(text, max = 300) {
|
|
243
|
+
const normalized = String(text ?? '').replace(/\s+/g, ' ').trim()
|
|
244
|
+
return normalized.length <= max ? normalized : '…' + normalized.slice(-max)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* A stable diagnostic for a failed snapshot CLI read, or null on success.
|
|
249
|
+
* The snapshot previously collapsed every failure into the empty fallback, which
|
|
250
|
+
* made "the CLI did not run" indistinguishable from "there is nothing to show".
|
|
251
|
+
* @param {object|undefined} result - ctx.shell execute result.
|
|
252
|
+
* @param {string} label - user-facing command name, for example `hive board`.
|
|
253
|
+
* @returns {string|null}
|
|
254
|
+
*/
|
|
255
|
+
export function snapshotReadError(result, label) {
|
|
256
|
+
if (result === undefined || result === null) return label + ' did not run'
|
|
257
|
+
if (result.timedOut === true) return label + ' timed out'
|
|
258
|
+
if (result.aborted === true) return label + ' was aborted'
|
|
259
|
+
if (result.exitCode !== 0) {
|
|
260
|
+
const stderr = String(result.stderr?.text ?? '')
|
|
261
|
+
const stdout = String(result.stdout?.text ?? '')
|
|
262
|
+
const detail = tailText(stderr !== '' ? stderr : stdout)
|
|
263
|
+
return label + ' exited ' + String(result.exitCode) + (detail === '' ? ' with no output' : ': ' + detail)
|
|
264
|
+
}
|
|
265
|
+
return null
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* Parse `hive board --json` into `{ board, boardError }`. A failed, empty or
|
|
270
|
+
* malformed read keeps the array empty but reports why, so the panel can show a
|
|
271
|
+
* diagnostic instead of the misleading "no agents" empty state.
|
|
272
|
+
* @param {object|undefined} result - board CLI execute result.
|
|
273
|
+
* @returns {{ board: object[], boardError: string|null }}
|
|
274
|
+
*/
|
|
275
|
+
export function parseBoardSnapshot(result) {
|
|
276
|
+
const failure = snapshotReadError(result, 'hive board')
|
|
277
|
+
if (failure !== null) return { board: [], boardError: failure }
|
|
278
|
+
const parsed = parseJson(result.stdout?.text, undefined)
|
|
279
|
+
if (parsed === undefined) return { board: [], boardError: 'hive board returned no JSON' }
|
|
280
|
+
if (!Array.isArray(parsed)) return { board: [], boardError: 'hive board returned a non-array JSON value' }
|
|
281
|
+
return { board: parsed, boardError: null }
|
|
282
|
+
}
|
|
283
|
+
|
|
241
284
|
/** The bin key behind each snapshot command. */
|
|
242
285
|
export const SNAPSHOT_BINS = Object.freeze({
|
|
243
286
|
board: 'hive',
|
|
@@ -381,10 +424,12 @@ export function lastRunPath(cwd, cardId) {
|
|
|
381
424
|
* out-of-contract files all degrade to null: a broken record never breaks the
|
|
382
425
|
* snapshot. A record written by a worker activation also carries that worker's
|
|
383
426
|
* `sessionId` (and its `agentName`); both are forwarded only when present so a
|
|
384
|
-
* legacy record keeps its exact previous shape.
|
|
427
|
+
* legacy record keeps its exact previous shape. hive-consensus `overlaps` and
|
|
428
|
+
* the memory-recall `lessons` summary are forwarded verbatim for the shared
|
|
429
|
+
* renderer to normalize, and are omitted from legacy records the same way.
|
|
385
430
|
* @param {string} cwd - repository root.
|
|
386
431
|
* @param {unknown} cardId - card id from the task list.
|
|
387
|
-
* @returns {null|{ cardId: string, agent: string, startedAt: string|null, endedAt: string|null, status: 'done'|'failed'|'running', exitCode?: number, commit?: string, sessionId?: string, agentName?: string, output: string }}
|
|
432
|
+
* @returns {null|{ cardId: string, agent: string, startedAt: string|null, endedAt: string|null, status: 'done'|'failed'|'running', exitCode?: number, commit?: string, sessionId?: string, agentName?: string, overlaps?: Array<object>, lessons?: object, output: string }}
|
|
388
433
|
*/
|
|
389
434
|
export function readLastRun(cwd, cardId) {
|
|
390
435
|
const file = lastRunPath(cwd, cardId)
|
|
@@ -416,6 +461,13 @@ export function readLastRun(cwd, cardId) {
|
|
|
416
461
|
// Worker chat identity: forwarded verbatim, omitted on pre-0.6.4 records.
|
|
417
462
|
if (typeof parsed.sessionId === 'string' && parsed.sessionId !== '') record.sessionId = parsed.sessionId
|
|
418
463
|
if (typeof parsed.agentName === 'string' && parsed.agentName !== '') record.agentName = parsed.agentName
|
|
464
|
+
// hive-consensus announcements and the memory-recall summary: forwarded
|
|
465
|
+
// verbatim when present, normalized by the shared renderer. A malformed value
|
|
466
|
+
// is dropped here and an older record gains no extra key.
|
|
467
|
+
if (Array.isArray(parsed.overlaps)) record.overlaps = parsed.overlaps
|
|
468
|
+
if (parsed.lessons !== null && typeof parsed.lessons === 'object' && !Array.isArray(parsed.lessons)) {
|
|
469
|
+
record.lessons = parsed.lessons
|
|
470
|
+
}
|
|
419
471
|
return record
|
|
420
472
|
}
|
|
421
473
|
|
|
@@ -903,6 +955,32 @@ export function createBridge(ctx, config = {}) {
|
|
|
903
955
|
}
|
|
904
956
|
}
|
|
905
957
|
|
|
958
|
+
/**
|
|
959
|
+
* Register the queen Session with the resident Hive runner (when mounted).
|
|
960
|
+
* The runner parents every card worker to exactly this Session; before this
|
|
961
|
+
* registration it waits instead of dispatching. Registration is in-memory and
|
|
962
|
+
* idempotent, so every panel snapshot re-registers after a restart.
|
|
963
|
+
* @param {string} sessionId live Session id of the queen conversation
|
|
964
|
+
*/
|
|
965
|
+
function registerQueenSession(sessionId) {
|
|
966
|
+
if (typeof sessionId !== 'string' || sessionId === '') return false
|
|
967
|
+
let runner
|
|
968
|
+
try {
|
|
969
|
+
runner = ctx.get('hiveSupervisor')
|
|
970
|
+
} catch (error) {
|
|
971
|
+
log('hive-runner queen registration lookup failed', error)
|
|
972
|
+
return false
|
|
973
|
+
}
|
|
974
|
+
if (runner === undefined || typeof runner.setQueenSession !== 'function') return false
|
|
975
|
+
try {
|
|
976
|
+
runner.setQueenSession(sessionId)
|
|
977
|
+
return true
|
|
978
|
+
} catch (error) {
|
|
979
|
+
log('hive-runner queen registration failed', error)
|
|
980
|
+
return false
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
|
|
906
984
|
/**
|
|
907
985
|
* Auto-activate queen mode for an initialised Session before a snapshot is
|
|
908
986
|
* returned. Idempotent: the controller does not rewrite an active session and
|
|
@@ -956,6 +1034,7 @@ export function createBridge(ctx, config = {}) {
|
|
|
956
1034
|
initialised: false,
|
|
957
1035
|
mode: { mode: 'free' },
|
|
958
1036
|
board: [],
|
|
1037
|
+
boardError: null,
|
|
959
1038
|
tasks: [],
|
|
960
1039
|
stats: null,
|
|
961
1040
|
events: [],
|
|
@@ -967,6 +1046,7 @@ export function createBridge(ctx, config = {}) {
|
|
|
967
1046
|
const initialised = refs !== undefined && refs.exitCode === 0 && String(refs.stdout?.text ?? '').trim() !== ''
|
|
968
1047
|
if (initialised) autoActivateQueen(sessionId, cwd)
|
|
969
1048
|
payload.queen = queenSnapshot(sessionId, cwd)
|
|
1049
|
+
if (payload.queen.active) registerQueenSession(sessionId)
|
|
970
1050
|
if (!initialised) {
|
|
971
1051
|
payload.events = readEvents(cwd)
|
|
972
1052
|
return payload
|
|
@@ -980,11 +1060,13 @@ export function createBridge(ctx, config = {}) {
|
|
|
980
1060
|
tryExecute(SNAPSHOT_READS.mode, { cwd, session, timeoutMs: PROBE_TIMEOUT_MS, signal }),
|
|
981
1061
|
tryExecuteWithFallback(commands.roles, fallbacks.roles, { cwd, session, timeoutMs: snapshotTimeoutMs, signal }, 'hive'),
|
|
982
1062
|
])
|
|
1063
|
+
const boardRead = parseBoardSnapshot(board)
|
|
983
1064
|
return {
|
|
984
1065
|
...payload,
|
|
985
1066
|
initialised: true,
|
|
986
1067
|
mode: readMode(mode),
|
|
987
|
-
board:
|
|
1068
|
+
board: boardRead.board,
|
|
1069
|
+
boardError: boardRead.boardError,
|
|
988
1070
|
tasks: attachLastRuns(cwd, parseJson(tasks?.stdout?.text, [])),
|
|
989
1071
|
stats: parseJson(stats?.stdout?.text, null),
|
|
990
1072
|
events: readEvents(cwd),
|
|
@@ -1028,6 +1110,7 @@ export function createBridge(ctx, config = {}) {
|
|
|
1028
1110
|
if (refs === undefined || refs.exitCode !== 0 || String(refs.stdout?.text ?? '').trim() === '') return false
|
|
1029
1111
|
try {
|
|
1030
1112
|
queen.mark({ sessionId, cwd })
|
|
1113
|
+
registerQueenSession(sessionId)
|
|
1031
1114
|
return true
|
|
1032
1115
|
} catch (error) {
|
|
1033
1116
|
log('queen activation failed', error)
|
|
@@ -1047,6 +1130,7 @@ export function createBridge(ctx, config = {}) {
|
|
|
1047
1130
|
throw new HiveRequestError('hive/queen-unavailable', 'queen controller is unavailable', 500)
|
|
1048
1131
|
}
|
|
1049
1132
|
queen.mark({ sessionId, cwd, source: 'manual' })
|
|
1133
|
+
registerQueenSession(sessionId)
|
|
1050
1134
|
return { status: 200, body: { ok: true, code: 0, stdout: '', stderr: '' } }
|
|
1051
1135
|
}
|
|
1052
1136
|
if (actionName === QUEEN_OFF_ACTION) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hive-panel",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Hive board and queen mode inside DSH Web: a conversation view scoped to the Session's repository, with allowlisted task-card actions over DSH's shell seam.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
package/scripts/verify.mjs
CHANGED
|
@@ -87,6 +87,7 @@ assert.ok(clientSource.includes('ctx.locale.bind('), 'the client half never bind
|
|
|
87
87
|
assert.ok(clientSource.includes('uiWorkspace'), 'the client bundle never resolves workspace navigation')
|
|
88
88
|
assert.ok(clientSource.includes('hiveOpenSession'), 'the client bundle never forwards an open-session callback')
|
|
89
89
|
assert.ok(clientSource.includes('drawer.openChat'), 'the inlined renderer lost the Open agent chat copy')
|
|
90
|
+
assert.ok(clientSource.includes('boardError'), 'the inlined renderer lost the board diagnostic rendering')
|
|
90
91
|
assert.equal(clientSource.includes('/hive-panel/api'), false, 'the retired proxy prefix is still in the bundle')
|
|
91
92
|
assert.equal(clientSource.includes('7717'), false, 'the retired 7717 upstream is still in the bundle')
|
|
92
93
|
ok('client bundle uses /api/hive and forwards the Session id')
|
|
@@ -353,14 +354,15 @@ async function call(route, { method = 'GET', query = {}, body } = {}) {
|
|
|
353
354
|
assert.equal(outcome.body.writable, false)
|
|
354
355
|
assert.equal(outcome.body.mode.mode, 'free')
|
|
355
356
|
assert.deepEqual(outcome.body.board, [{ agent: 'w1', state: 'claimed', task: 'c1' }])
|
|
357
|
+
assert.equal(outcome.body.boardError, null, 'a successful board read carries no error')
|
|
356
358
|
assert.deepEqual(outcome.body.tasks, [{ id: 'c1', title: 'card one', state: 'pending', role: 'coder', lastRun: null }])
|
|
357
359
|
assert.equal(outcome.body.stats.total, 1)
|
|
358
360
|
assert.equal(outcome.body.events.length, 2)
|
|
359
361
|
assert.equal(outcome.body.events[0].kind, 'task_done', 'events must be newest-first')
|
|
360
|
-
for (const key of ['at', 'repo', 'initialised', 'mode', 'board', 'tasks', 'stats', 'events', 'writable', 'queen', 'roles']) {
|
|
362
|
+
for (const key of ['at', 'repo', 'initialised', 'mode', 'board', 'boardError', 'tasks', 'stats', 'events', 'writable', 'queen', 'roles']) {
|
|
361
363
|
assert.ok(Object.prototype.hasOwnProperty.call(outcome.body, key), 'snapshot is missing ' + key)
|
|
362
364
|
}
|
|
363
|
-
assert.deepEqual(Object.keys(outcome.body).sort(), ['at', 'board', 'events', 'initialised', 'mode', 'queen', 'repo', 'roles', 'stats', 'tasks', 'writable'])
|
|
365
|
+
assert.deepEqual(Object.keys(outcome.body).sort(), ['at', 'board', 'boardError', 'events', 'initialised', 'mode', 'queen', 'repo', 'roles', 'stats', 'tasks', 'writable'])
|
|
364
366
|
assert.deepEqual(outcome.body.queen, { active: true, source: 'auto', repo }, 'an initialised repo must auto-enter queen mode from the snapshot')
|
|
365
367
|
assert.deepEqual(outcome.body.roles, {
|
|
366
368
|
list: [
|
|
@@ -384,7 +386,48 @@ async function call(route, { method = 'GET', query = {}, body } = {}) {
|
|
|
384
386
|
assert.ok(execution.command.startsWith("'hive'") || execution.command.startsWith("'hive-tasks'") || execution.command.startsWith("'git'"))
|
|
385
387
|
}
|
|
386
388
|
ok('GET op=snapshot runs fixed Hive CLI commands in the Session cwd under its sandbox policy')
|
|
387
|
-
ok('snapshot keeps the { at, repo, initialised, mode, board, tasks, stats, events, writable, queen, roles } contract')
|
|
389
|
+
ok('snapshot keeps the { at, repo, initialised, mode, board, boardError, tasks, stats, events, writable, queen, roles } contract')
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// ── 6d. a failed board read is a diagnostic, never a silent empty board ────
|
|
393
|
+
{
|
|
394
|
+
const failingBoard = createCtx({
|
|
395
|
+
live,
|
|
396
|
+
cwdOf,
|
|
397
|
+
shell: spec => {
|
|
398
|
+
if (spec.command.includes("'for-each-ref'")) return { exitCode: 0, stdout: 'refs/hive/v1/mode\n' }
|
|
399
|
+
if (spec.command.includes("'board'")) return { exitCode: 1, stderr: 'fatal: refs/hive/v1/board is unreadable\n' }
|
|
400
|
+
return defaultShellResult(spec)
|
|
401
|
+
},
|
|
402
|
+
})
|
|
403
|
+
host.apply(failingBoard.ctx, {})
|
|
404
|
+
const failed = await call(failingBoard.routes.get('/api/hive'), { query: { op: 'snapshot', sessionId: 's-live' } })
|
|
405
|
+
assert.equal(failed.status, 200, 'a board failure must not fail the whole snapshot')
|
|
406
|
+
assert.deepEqual(failed.body.board, [], 'a failed board read keeps the empty array for the board field')
|
|
407
|
+
assert.match(failed.body.boardError, /hive board exited 1/, 'the snapshot must name the failed command')
|
|
408
|
+
assert.match(failed.body.boardError, /board is unreadable/, 'the snapshot must keep the CLI stderr')
|
|
409
|
+
ok('a failed hive board read puts a diagnostic in boardError instead of a silent empty board')
|
|
410
|
+
|
|
411
|
+
const malformedBoard = createCtx({
|
|
412
|
+
live,
|
|
413
|
+
cwdOf,
|
|
414
|
+
shell: spec => {
|
|
415
|
+
if (spec.command.includes("'for-each-ref'")) return { exitCode: 0, stdout: 'refs/hive/v1/mode\n' }
|
|
416
|
+
if (spec.command.includes("'board'")) return { exitCode: 0, stdout: '{ not a board array' }
|
|
417
|
+
return defaultShellResult(spec)
|
|
418
|
+
},
|
|
419
|
+
})
|
|
420
|
+
host.apply(malformedBoard.ctx, {})
|
|
421
|
+
const malformed = await call(malformedBoard.routes.get('/api/hive'), { query: { op: 'snapshot', sessionId: 's-live' } })
|
|
422
|
+
assert.equal(malformed.status, 200)
|
|
423
|
+
assert.deepEqual(malformed.body.board, [])
|
|
424
|
+
assert.match(malformed.body.boardError, /no JSON/, 'malformed board JSON is diagnosed, not swallowed')
|
|
425
|
+
ok('malformed hive board JSON is diagnosed in boardError')
|
|
426
|
+
|
|
427
|
+
assert.match(host.snapshotReadError(undefined, 'hive board'), /did not run/)
|
|
428
|
+
assert.equal(host.snapshotReadError({ exitCode: 0, stdout: { text: '[]' } }, 'hive board'), null)
|
|
429
|
+
assert.deepEqual(host.parseBoardSnapshot({ exitCode: 0, stdout: { text: '[]' } }), { board: [], boardError: null })
|
|
430
|
+
assert.match(host.parseBoardSnapshot(undefined).boardError, /did not run/)
|
|
388
431
|
}
|
|
389
432
|
|
|
390
433
|
// ── 6b. uninitialised repo: no Hive CLI fan-out ─────────────────────────────
|
package/src/panel.css
CHANGED
|
@@ -1086,3 +1086,14 @@ dialog.hive-dialog .hive-card-subline,
|
|
|
1086
1086
|
dialog.hive-dialog .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }
|
|
1087
1087
|
dialog.hive-dialog .hive-dialog-foot { flex-wrap: wrap; }
|
|
1088
1088
|
|
|
1089
|
+
dialog.hive-dialog {
|
|
1090
|
+
display: flex;
|
|
1091
|
+
flex-direction: column;
|
|
1092
|
+
max-height: 80vh;
|
|
1093
|
+
}
|
|
1094
|
+
dialog.hive-dialog .hive-dialog-head,
|
|
1095
|
+
dialog.hive-dialog .hive-dialog-foot { flex: 0 0 auto; }
|
|
1096
|
+
dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
|
1097
|
+
.hive-card-run-output { max-height: 20lh; overflow: auto; }
|
|
1098
|
+
.hive-card-actions { flex-wrap: wrap; justify-content: flex-end; }
|
|
1099
|
+
|
package/src/panel.js
CHANGED
|
@@ -404,6 +404,14 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
404
404
|
font-size: 12px;
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
+
.hive-agents-error {
|
|
408
|
+
min-width: 0;
|
|
409
|
+
overflow-wrap: anywhere;
|
|
410
|
+
color: var(--hive-danger);
|
|
411
|
+
font-family: var(--hive-mono);
|
|
412
|
+
font-size: 12px;
|
|
413
|
+
}
|
|
414
|
+
|
|
407
415
|
.hive-stage-chips {
|
|
408
416
|
display: flex;
|
|
409
417
|
flex: 0 0 auto;
|
|
@@ -1498,7 +1506,8 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1498
1506
|
}
|
|
1499
1507
|
|
|
1500
1508
|
.hive-card-run-output {
|
|
1501
|
-
max-height: 360px;
|
|
1509
|
+
max-height: 360px;
|
|
1510
|
+
max-height: 20lh; /* longer output scrolls inside the pre */
|
|
1502
1511
|
margin: 0;
|
|
1503
1512
|
padding: 10px;
|
|
1504
1513
|
overflow: auto;
|
|
@@ -1965,6 +1974,16 @@ dialog.hive-dialog .hive-dialog-title,
|
|
|
1965
1974
|
dialog.hive-dialog .hive-card-subline,
|
|
1966
1975
|
dialog.hive-dialog .hive-settings-role-name { min-width: 0; overflow-wrap: anywhere; }
|
|
1967
1976
|
dialog.hive-dialog .hive-dialog-foot { flex-wrap: wrap; }
|
|
1977
|
+
dialog.hive-dialog {
|
|
1978
|
+
display: flex;
|
|
1979
|
+
flex-direction: column;
|
|
1980
|
+
max-height: 80vh;
|
|
1981
|
+
}
|
|
1982
|
+
dialog.hive-dialog .hive-dialog-head,
|
|
1983
|
+
dialog.hive-dialog .hive-dialog-foot { flex: 0 0 auto; }
|
|
1984
|
+
dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
|
1985
|
+
.hive-card-run-output { max-height: 20lh; overflow: auto; }
|
|
1986
|
+
.hive-card-actions { flex-wrap: wrap; justify-content: flex-end; }
|
|
1968
1987
|
`;
|
|
1969
1988
|
|
|
1970
1989
|
const LANE_LABEL_KEYS = Object.freeze({
|
|
@@ -2042,6 +2061,9 @@ export const messages = Object.freeze({
|
|
|
2042
2061
|
"drawer.removeClaimed": "A claimed task must be released or reopened before it can be deleted.",
|
|
2043
2062
|
"drawer.rawJson": "raw json",
|
|
2044
2063
|
"drawer.lastRun": "Last run",
|
|
2064
|
+
"drawer.runOverlaps": "Also writing",
|
|
2065
|
+
"drawer.runLessons": "Read {count} lessons",
|
|
2066
|
+
"drawer.runNoLessons": "No lessons to read",
|
|
2045
2067
|
"drawer.noRuns": "No runs yet",
|
|
2046
2068
|
"drawer.copyOutput": "Copy output",
|
|
2047
2069
|
"drawer.openChat": "Open agent chat",
|
|
@@ -2281,6 +2303,9 @@ export const messages = Object.freeze({
|
|
|
2281
2303
|
"drawer.removeClaimed": "已认领的任务必须先释放或重开才能删除。",
|
|
2282
2304
|
"drawer.rawJson": "原始 JSON",
|
|
2283
2305
|
"drawer.lastRun": "最近一次执行",
|
|
2306
|
+
"drawer.runOverlaps": "同时写入",
|
|
2307
|
+
"drawer.runLessons": "读取了 {count} 条经验",
|
|
2308
|
+
"drawer.runNoLessons": "没有可读取的经验",
|
|
2284
2309
|
"drawer.noRuns": "还没有执行记录",
|
|
2285
2310
|
"drawer.copyOutput": "复制输出",
|
|
2286
2311
|
"drawer.openChat": "打开智能体对话",
|
|
@@ -2493,12 +2518,56 @@ function normalizeScope(scope) {
|
|
|
2493
2518
|
return [];
|
|
2494
2519
|
}
|
|
2495
2520
|
|
|
2521
|
+
/**
|
|
2522
|
+
* Normalize the optional `overlaps` announcements of a run record: other agents
|
|
2523
|
+
* have declared they are writing the same paths too. An entry without a
|
|
2524
|
+
* non-empty agent is dropped; a missing or malformed list is empty, so the
|
|
2525
|
+
* drawer renders no overlap row.
|
|
2526
|
+
* @param {unknown} value
|
|
2527
|
+
* @returns {Array<{key:string,agent:string,task:string,expiresAt:string}>}
|
|
2528
|
+
*/
|
|
2529
|
+
function normalizeOverlaps(value) {
|
|
2530
|
+
const overlaps = [];
|
|
2531
|
+
for (const entry of asArray(value)) {
|
|
2532
|
+
if (!isRecord(entry)) continue;
|
|
2533
|
+
const agent = asString(entry.agent);
|
|
2534
|
+
if (agent.trim() === "") continue;
|
|
2535
|
+
overlaps.push({
|
|
2536
|
+
key: asString(entry.key),
|
|
2537
|
+
agent,
|
|
2538
|
+
task: asString(entry.task),
|
|
2539
|
+
expiresAt: asString(entry.expiresAt),
|
|
2540
|
+
});
|
|
2541
|
+
}
|
|
2542
|
+
return overlaps;
|
|
2543
|
+
}
|
|
2544
|
+
|
|
2545
|
+
/**
|
|
2546
|
+
* Normalize the optional `lessons` recall summary of a run record. A missing
|
|
2547
|
+
* or malformed record is null; a count-only, scopes-only or error-only record
|
|
2548
|
+
* survives so the drawer can still render its "no lessons" line.
|
|
2549
|
+
* @param {unknown} value
|
|
2550
|
+
* @returns {null|{count:number,scopes:string[],error?:string}}
|
|
2551
|
+
*/
|
|
2552
|
+
function normalizeLessons(value) {
|
|
2553
|
+
if (!isRecord(value)) return null;
|
|
2554
|
+
const lessons = {
|
|
2555
|
+
count: asCount(value.count, 0),
|
|
2556
|
+
scopes: asArray(value.scopes)
|
|
2557
|
+
.map((scope) => asString(scope))
|
|
2558
|
+
.filter((scope) => scope.trim() !== ""),
|
|
2559
|
+
};
|
|
2560
|
+
const error = asString(value.error);
|
|
2561
|
+
if (error !== "") lessons.error = error;
|
|
2562
|
+
return lessons;
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2496
2565
|
/**
|
|
2497
2566
|
* Normalize `lastRun` (written by hive-runner to .hive/runs/<cardId>.json).
|
|
2498
2567
|
* A missing record is null; a malformed one is dropped instead of leaking
|
|
2499
2568
|
* half-parsed values into the drawer.
|
|
2500
2569
|
* @param {unknown} value
|
|
2501
|
-
* @returns {null|{agent:string,startedAt:string,endedAt:string,status:string,commit:string,exitCode:number|null,sessionId:string,output:string}}
|
|
2570
|
+
* @returns {null|{agent:string,startedAt:string,endedAt:string,status:string,commit:string,exitCode:number|null,sessionId:string,output:string,overlaps:Array<{key:string,agent:string,task:string,expiresAt:string}>,lessons:null|{count:number,scopes:string[],error?:string}}}
|
|
2502
2571
|
*/
|
|
2503
2572
|
function normalizeLastRun(value) {
|
|
2504
2573
|
if (!isRecord(value)) return null;
|
|
@@ -2515,6 +2584,10 @@ function normalizeLastRun(value) {
|
|
|
2515
2584
|
// navigate can open that conversation, an older record simply has none.
|
|
2516
2585
|
sessionId: asString(value.sessionId),
|
|
2517
2586
|
output: asString(value.output),
|
|
2587
|
+
// Consensus announcements from the other writers of these paths.
|
|
2588
|
+
overlaps: normalizeOverlaps(value.overlaps),
|
|
2589
|
+
// Memory recall summary: how many lessons the worker read before its run.
|
|
2590
|
+
lessons: normalizeLessons(value.lessons),
|
|
2518
2591
|
};
|
|
2519
2592
|
}
|
|
2520
2593
|
|
|
@@ -2671,6 +2744,7 @@ function toolbarActions(writable, mode) {
|
|
|
2671
2744
|
* laneOrder: string[],
|
|
2672
2745
|
* stats: {total:number, byState:Record<string,number>, byRole:Record<string,number>, oldestPending:{id:string,createdAt:string}|null},
|
|
2673
2746
|
* agents: Array<{agent:string,state:string,task:string,files:string[],updatedAt:string}>,
|
|
2747
|
+
* boardError: string|null,
|
|
2674
2748
|
* events: Array<{ts:string,kind:string,task:string,actor:string}>,
|
|
2675
2749
|
* actions: Array<{name:string,labelKey:string,body?:object}>
|
|
2676
2750
|
* }}
|
|
@@ -2749,6 +2823,9 @@ export function renderModel(snapshot) {
|
|
|
2749
2823
|
laneOrder: [...LANE_ORDER],
|
|
2750
2824
|
stats: normalizeStats(source.stats, tasks),
|
|
2751
2825
|
agents: normalizeAgents(source.board),
|
|
2826
|
+
// A board read that failed is not the same as an idle swarm: keep the
|
|
2827
|
+
// diagnostic so the agents strip can show it instead of "no agents".
|
|
2828
|
+
boardError: asString(source.boardError) || null,
|
|
2752
2829
|
events: normalizeEvents(source.events),
|
|
2753
2830
|
actions: initialised ? toolbarActions(writable, mode) : [],
|
|
2754
2831
|
};
|
|
@@ -5066,13 +5143,20 @@ export function mount(root, options = {}) {
|
|
|
5066
5143
|
* The card drawer's "Last run" block. With no record it is one muted line;
|
|
5067
5144
|
* with a record it shows status, agent, timestamps and the short commit above
|
|
5068
5145
|
* the worker output (monospace, internally scrollable) and a copy button.
|
|
5069
|
-
* A record
|
|
5070
|
-
*
|
|
5146
|
+
* A record with overlapping writers adds one "Also writing" row, a record with
|
|
5147
|
+
* a lessons summary adds one recall row, and a record whose worker Session is
|
|
5148
|
+
* known, on a host that provides `openSession`, also gets the "Open agent
|
|
5149
|
+
* chat" button.
|
|
5071
5150
|
* @param {object|null} run - normalized `lastRun` (see normalizeLastRun)
|
|
5072
5151
|
* @returns {HTMLElement}
|
|
5073
5152
|
*/
|
|
5074
|
-
function buildRunSection(run) {
|
|
5153
|
+
function buildRunSection(run, actionHost) {
|
|
5075
5154
|
const section = element(doc, "div", "hive-card-run");
|
|
5155
|
+
const addAction = (node) => {
|
|
5156
|
+
if (Array.isArray(actionHost)) actionHost.push(node);
|
|
5157
|
+
else if (actionHost && typeof actionHost.appendChild === "function") actionHost.appendChild(node);
|
|
5158
|
+
else section.appendChild(node);
|
|
5159
|
+
};
|
|
5076
5160
|
section.appendChild(element(doc, "div", "hive-card-run-title", translate("drawer.lastRun")));
|
|
5077
5161
|
if (!run) {
|
|
5078
5162
|
section.appendChild(element(doc, "div", "hive-note hive-card-run-empty", translate("drawer.noRuns")));
|
|
@@ -5087,6 +5171,30 @@ export function mount(root, options = {}) {
|
|
|
5087
5171
|
const meta = element(doc, "div", "hive-card-run-meta", metaPartsText);
|
|
5088
5172
|
setAttr(meta, "title", metaPartsText);
|
|
5089
5173
|
section.appendChild(meta);
|
|
5174
|
+
// Consensus announcements: the other agents that announced the same paths. Invalid
|
|
5175
|
+
// entries are dropped by normalizeLastRun, duplicates collapse to one name,
|
|
5176
|
+
// and no overlapping writer means no row at all.
|
|
5177
|
+
const writers = [];
|
|
5178
|
+
for (const overlap of run.overlaps) {
|
|
5179
|
+
const agent = asString(overlap.agent);
|
|
5180
|
+
if (agent !== "" && !writers.includes(agent)) writers.push(agent);
|
|
5181
|
+
}
|
|
5182
|
+
if (writers.length > 0) {
|
|
5183
|
+
const overlapsLabel = translate("drawer.runOverlaps");
|
|
5184
|
+
// The zh dictionary copy uses the full-width colon elsewhere in the panel.
|
|
5185
|
+
const separator = /[\u4e00-\u9fff]/.test(overlapsLabel) ? ":" : ": ";
|
|
5186
|
+
section.appendChild(
|
|
5187
|
+
element(doc, "div", "hive-card-run-meta", overlapsLabel + separator + writers.join(", ")),
|
|
5188
|
+
);
|
|
5189
|
+
}
|
|
5190
|
+
// Memory recall: the worker always reports whether it read lessons, so the
|
|
5191
|
+
// block keeps one line even when the record predates that field.
|
|
5192
|
+
const lessonCount = run.lessons ? asCount(run.lessons.count, 0) : 0;
|
|
5193
|
+
const lessonsText =
|
|
5194
|
+
lessonCount > 0
|
|
5195
|
+
? translate("drawer.runLessons").replace("{count}", String(lessonCount))
|
|
5196
|
+
: translate("drawer.runNoLessons");
|
|
5197
|
+
section.appendChild(element(doc, "div", "hive-card-run-meta", lessonsText));
|
|
5090
5198
|
section.appendChild(element(doc, "pre", "hive-card-run-output", run.output));
|
|
5091
5199
|
const foot = element(doc, "div", "hive-card-run-foot");
|
|
5092
5200
|
const copy = element(doc, "button", "hive-btn hive-btn-ghost hive-card-run-copy", translate("drawer.copyOutput"));
|
|
@@ -5096,10 +5204,14 @@ export function mount(root, options = {}) {
|
|
|
5096
5204
|
copy.addEventListener("click", () => {
|
|
5097
5205
|
copyToClipboard(doc, run.output);
|
|
5098
5206
|
});
|
|
5099
|
-
|
|
5207
|
+
if (Array.isArray(actionHost) || actionHost) addAction(copy);
|
|
5208
|
+
else foot.appendChild(copy);
|
|
5100
5209
|
// Only render the jump-to-chat control when both halves exist: a recorded
|
|
5101
|
-
// worker Session and a host navigation callback.
|
|
5102
|
-
|
|
5210
|
+
// worker Session and a host navigation callback. The status does not matter:
|
|
5211
|
+
// a running card exposes its Session as soon as the worker starts, and the
|
|
5212
|
+
// button must be there while the card is still in progress. No disabled stub.
|
|
5213
|
+
const canOpenChat = asString(run.sessionId) !== "" && typeof openSession === "function";
|
|
5214
|
+
if (canOpenChat) {
|
|
5103
5215
|
const chat = element(doc, "button", "hive-btn hive-btn-ghost hive-card-run-open", translate("drawer.openChat"));
|
|
5104
5216
|
setAttr(chat, "type", "button");
|
|
5105
5217
|
setAttr(chat, "title", translate("drawer.openChat"));
|
|
@@ -5111,9 +5223,10 @@ export function mount(root, options = {}) {
|
|
|
5111
5223
|
reportError(error);
|
|
5112
5224
|
}
|
|
5113
5225
|
});
|
|
5114
|
-
|
|
5226
|
+
if (Array.isArray(actionHost) || actionHost) addAction(chat);
|
|
5227
|
+
else foot.appendChild(chat);
|
|
5115
5228
|
}
|
|
5116
|
-
section.appendChild(foot);
|
|
5229
|
+
if (!actionHost) section.appendChild(foot);
|
|
5117
5230
|
return section;
|
|
5118
5231
|
}
|
|
5119
5232
|
|
|
@@ -5153,7 +5266,8 @@ export function mount(root, options = {}) {
|
|
|
5153
5266
|
dialog.appendChild(head);
|
|
5154
5267
|
|
|
5155
5268
|
const body = element(doc, "div", "hive-dialog-body hive-card-body");
|
|
5156
|
-
|
|
5269
|
+
const runActions = [];
|
|
5270
|
+
body.appendChild(buildRunSection(card.lastRun, runActions));
|
|
5157
5271
|
dialog.appendChild(body);
|
|
5158
5272
|
|
|
5159
5273
|
const actions = actionsForState(lane, lastModel ? lastModel.writable : false);
|
|
@@ -5167,9 +5281,10 @@ export function mount(root, options = {}) {
|
|
|
5167
5281
|
),
|
|
5168
5282
|
);
|
|
5169
5283
|
}
|
|
5170
|
-
if (actions.length > 0) {
|
|
5284
|
+
if (runActions.length > 0 || actions.length > 0) {
|
|
5171
5285
|
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
5172
5286
|
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
5287
|
+
for (const runAction of runActions) foot.appendChild(runAction);
|
|
5173
5288
|
const claimed = asString(card.state || lane) === "claimed";
|
|
5174
5289
|
for (const action of actions) {
|
|
5175
5290
|
const destructive = action.name === "remove";
|
|
@@ -5758,8 +5873,23 @@ export function mount(root, options = {}) {
|
|
|
5758
5873
|
return;
|
|
5759
5874
|
}
|
|
5760
5875
|
agentsCount.textContent = String(model.agents.length);
|
|
5876
|
+
// A failed board read must never look like an idle swarm: show the CLI
|
|
5877
|
+
// diagnostic in the strip instead of the "no agents" empty state.
|
|
5878
|
+
if (model.boardError) {
|
|
5879
|
+
const error = element(
|
|
5880
|
+
doc,
|
|
5881
|
+
"span",
|
|
5882
|
+
"hive-agents-error",
|
|
5883
|
+
summarizeActionOutput(model.boardError, 400) || model.boardError,
|
|
5884
|
+
);
|
|
5885
|
+
setAttr(error, "title", model.boardError);
|
|
5886
|
+
setAttr(error, "role", "status");
|
|
5887
|
+
agentPills.appendChild(error);
|
|
5888
|
+
}
|
|
5761
5889
|
if (model.agents.length === 0) {
|
|
5762
|
-
|
|
5890
|
+
if (!model.boardError) {
|
|
5891
|
+
agentPills.appendChild(element(doc, "span", "hive-agents-empty", translate("agents.empty")));
|
|
5892
|
+
}
|
|
5763
5893
|
return;
|
|
5764
5894
|
}
|
|
5765
5895
|
for (const agent of model.agents) {
|