dsh-hive-panel 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@ All notable changes to this project are documented in this file. The format is
4
4
  based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [1.0.11] - 2026-12-05
8
+
9
+ ### Changed
10
+
11
+ - Renderer and stylesheet re-synced from hive-panel 1.0.6: the supervisor heartbeat now
12
+ shows a semantic state — green normal, amber paused, grey unresponsive — with an
13
+ explanatory tooltip and the last-seen time. Browser bundle rebuilt.
14
+
15
+ ### Tests
16
+
17
+ - 43 checks pass, including the synced heartbeat states and the rebuilt client.
18
+
19
+ ## [1.0.10] - 2026-12-05
20
+
21
+ ### Fixed
22
+
23
+ - The queen contract is never injected into worker Sessions: activation worker Sessions
24
+ (subagent / delegation children) are skipped before the cwd-based queen detection, so
25
+ a worker running inside an initialised repository is not treated as the queen and does
26
+ not receive the queen invariants or the `/queen off` suppression. Complements
27
+ dsh-hive-runner 1.0.11's worker exemption in the tool guard.
28
+
29
+ ### Tests
30
+
31
+ - 43 checks pass, including the worker Session skip and the unchanged queen paths.
32
+
33
+ ### Published
34
+
35
+ - npm: `dsh-hive-panel@1.0.10` on 2026-12-05.
36
+
7
37
  ## [1.0.9] - 2026-12-05
8
38
 
9
39
  ### Fixed
@@ -15,6 +45,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
15
45
 
16
46
  - 41 checks pass, including the synced top row and the rebuilt client.
17
47
 
48
+ ### Published
49
+
50
+ - npm: `dsh-hive-panel@1.0.9` on 2026-12-05.
51
+
18
52
  ## [1.0.8] - 2026-12-05
19
53
 
20
54
  ### Fixed
package/README.md CHANGED
@@ -286,7 +286,10 @@ supervisor registration happens on the same first assembly.
286
286
  implement; never call `write`/`edit`/`apply_patch`/`bash`/`cua` or any file-mutating or
287
287
  command-executing tool; tasks and state use only `hive_*` tools; `claim`/`done`/`fail` are
288
288
  worker actions the queen must not call; implementation is delegated to the supervisor). The
289
- tool-boundary sentence is injected in English and Chinese, so an older `hive init` role file
289
+ Card-worker Sessions are never injected or registered as the queen (the supervisor's
290
+ `isWorkerSession(sessionId)`, or the parent/queen and subagent header markers), so they keep
291
+ their normal write/edit/bash tools. The tool-boundary sentence is injected in English and
292
+ Chinese, so an older `hive init` role file
290
293
  gets it without re-running init. Goals become Hive tasks; discussion creates tasks only when
291
294
  asked to execute, so a stale or custom workspace role file cannot remove the boundary.
292
295
  - If you expose DSH Web beyond your machine, add authentication or a reverse proxy at the
package/SPEC.md CHANGED
@@ -309,9 +309,14 @@ Activation:
309
309
  the role + trusted invariants, and registers it with the supervisor. This is the
310
310
  path that keeps a restarted DSH, or a Session that never opened the panel, on the
311
311
  queen contract instead of a plain coding agent; only that Session's cwd is read.
312
- Subagent Sessions (`header.origin === "subagent"` or a positive
313
- `header.delegationDepth`) are excluded: card workers share the repository cwd and
314
- must never be auto-queened or overwrite the supervisor's queen registration.
312
+ Worker Sessions are excluded so they keep their normal coding tools: the host asks
313
+ the mounted supervisor's new `isWorkerSession(sessionId)` first (authoritative when
314
+ it answers true); otherwise it falls back to
315
+ `session.header.parentSession` equal to the registered queen Session id, or the
316
+ durable subagent markers (`header.origin === "subagent"` / a positive
317
+ `header.delegationDepth`). Card workers share the repository cwd and must never be
318
+ auto-queened, injected with the "do not write code" contract, registered as the
319
+ queen, or blocked from their write/edit/bash tools by the queen mutation guard.
315
320
  2. **Snapshot auto (default).** Before returning a `200` snapshot, the host probes
316
321
  `refs/hive/v1` and the `hive init` marker files in the Session cwd. When the repo
317
322
  is initialised, `autoQueen` is not `false`, and the Session was not explicitly
@@ -387,6 +392,7 @@ Host APIs used: `connection.fetch.register`, `sessions`, `workingDirectory`, `sh
387
392
  `ctx.effect` and `ctx.on('agent/disposed')`. `sandboxPolicy`, `sessionPersistence`
388
393
  and `hiveSupervisor` are optional and read through `ctx.get`. The supervisor contract
389
394
  used here is `setQueenSession(sessionId)` plus the optional `addRepo(repo)` /
390
- `hasRepo(repo)` from dsh-hive-runner's `HiveSupervisor` (feature-detected; older
391
- supervisors get no repository registration). A DSH upgrade can change any of these:
395
+ `hasRepo(repo)` / `isWorkerSession(sessionId)` from dsh-hive-runner's `HiveSupervisor`
396
+ (feature-detected; older supervisors get no repository registration and fall back to
397
+ the Session-header worker markers). A DSH upgrade can change any of these:
392
398
  re-run `npm run check` against the installed DSH before releasing.
package/docs/DESIGN.md CHANGED
@@ -300,6 +300,11 @@ token(PATH 名或绝对路径)。
300
300
  **单向**的:`/queen off`、agent dispose、插件卸载、进程重启都不会 `removeRepo`;
301
301
  supervisor 的 `status().repos`(面板 supervisor 条的数据源)随即可见该仓库。
302
302
  旧版 supervisor 没有 `addRepo` 时跳过仓库登记并记一条日志,仍登记 queen Session。
303
+ **worker 会话跳过注入**:优先调用 supervisor 新接口 `isWorkerSession(sessionId)`;
304
+ 拿不到(或返回非 true)时兜底看 `session.header.parentSession === queenSessionId`,再看
305
+ `origin === 'subagent'` / `delegationDepth > 0`。worker 与父会话共享仓库 cwd,若被注入
306
+ 「不能写代码」约束或登记成 queen,就会被 runner 的 queen mutation guard 拦掉 write/edit/bash;
307
+ 因此 worker 既不注入、也不登记(注册的 queen id 与 repo 均不变),只登记真正的顶层会话。
303
308
  subagent 会话
304
309
  (`session.header.origin === 'subagent'` 或 `delegationDepth > 0`)被排除:卡 worker 与父会话
305
310
  共享仓库 cwd,若自动注入会污染 worker 并把 supervisor 的 queen 登记顶掉。
@@ -442,7 +447,7 @@ npm run check
442
447
  # ok - node --check lib/queen.js
443
448
  # ok - node --check lib/client.js
444
449
  # ...
445
- # 41 checks passed
450
+ # 43 checks passed
446
451
  ```
447
452
 
448
453
  覆盖:语法、package/bundle 声明、无代理残留、client bundle 的 `/api/hive` URL 与 Session 注入、
@@ -458,7 +463,9 @@ Connection Fetch 路由注册、快照走 `ctx.shell` 且 cwd/policy 正确、
458
463
  (含 `QUEEN_INVARIANTS`、supervisor 幂等登记、跨仓库隔离)、`/queen off` 后不注入、
459
464
  `autoQueen=false` 不注入、未初始化仓库不注入;prompt/init/queen-on 路径对
460
465
  `hiveSupervisor.addRepo` 的登记(幂等去重、只登记有 queen.md 的仓库、退出与卸载不删除);
461
- invariants 的工具边界断言(write/edit/apply_patch/bash/cua/claim、hive_*、中英两句)。
466
+ invariants 的工具边界断言(write/edit/apply_patch/bash/cua/claim、hive_*、中英两句);
467
+ worker 会话跳过注入/登记(supervisor `isWorkerSession` 优先与 `parentSession===queen` 兜底),
468
+ 配套集成验证真实 runner 的 queen guard 放行 worker 的 write、仍拦截 queen 的 write。
462
469
 
463
470
  不启动、不重启任何 DSH 进程,也不写运行中的 `~/.dsh`。
464
471
 
package/lib/client.js CHANGED
@@ -2106,6 +2106,10 @@ dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow:
2106
2106
  .hive-agents-technical { border-top: 1px solid var(--hive-line-2); padding-top: 8px; }
2107
2107
  .hive-agents-technical-summary { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; cursor: pointer; }
2108
2108
  .hive-agents-technical-json { max-height: 220px; margin-top: 8px; }
2109
+ .hive-supervisor-inline-sep { color: var(--hive-fg-faint); }
2110
+ .hive-supervisor-inline-state.is-normal::before { background: var(--hive-ok); }
2111
+ .hive-supervisor-inline-state.is-paused::before { background: var(--hive-warn); }
2112
+ .hive-supervisor-inline-state.is-unresponsive::before { background: var(--hive-fg-faint); }
2109
2113
  `;
2110
2114
 
2111
2115
  const LANE_LABEL_KEYS = Object.freeze({
@@ -2207,7 +2211,14 @@ const messages = Object.freeze({
2207
2211
  "supervisor.runningCount": "running {count}",
2208
2212
  "supervisor.idle": "idle",
2209
2213
  "supervisor.backoff": "backoff",
2210
- "supervisor.paused": "paused",
2214
+ "supervisor.paused": "Paused",
2215
+ "supervisor.normal": "Normal",
2216
+ "supervisor.unresponsive": "Unresponsive",
2217
+ "supervisor.noData": "No supervisor data",
2218
+ "supervisor.lastCheck": "Last check {seconds}s ago",
2219
+ "supervisor.tooltipRunning": "Running {count}",
2220
+ "supervisor.tooltipQueued": "Queued {count}",
2221
+ "supervisor.tooltipError": "Last error: {error}",
2211
2222
  "supervisor.resume": "resume",
2212
2223
  "supervisor.resumeAria": "Resume the supervisor for {repo}",
2213
2224
  "supervisor.resumeFailed": "Could not resume the supervisor",
@@ -2462,6 +2473,13 @@ const messages = Object.freeze({
2462
2473
  "supervisor.idle": "空闲",
2463
2474
  "supervisor.backoff": "退避",
2464
2475
  "supervisor.paused": "已暂停",
2476
+ "supervisor.normal": "正常",
2477
+ "supervisor.unresponsive": "未响应",
2478
+ "supervisor.noData": "无监督器数据",
2479
+ "supervisor.lastCheck": "最近一次检查 {seconds} 秒前",
2480
+ "supervisor.tooltipRunning": "运行中 {count} 个",
2481
+ "supervisor.tooltipQueued": "待办 {count} 个",
2482
+ "supervisor.tooltipError": "最近错误:{error}",
2465
2483
  "supervisor.resume": "恢复",
2466
2484
  "supervisor.resumeAria": "恢复 {repo} 的 supervisor",
2467
2485
  "supervisor.resumeFailed": "恢复 supervisor 失败",
@@ -3166,13 +3184,40 @@ function normalizeSupervisorStatus(payload) {
3166
3184
  supervisorCount(source.agents) ??
3167
3185
  supervisorCount(source.inflight) ??
3168
3186
  supervisorCount(source.count);
3187
+ const roleRows = normalizeSupervisorRoles(source);
3188
+ let queued = isRecord(source.backlog) ? supervisorCount(source.backlog.queued) : null;
3189
+ if (queued === null) {
3190
+ let total = 0;
3191
+ let found = false;
3192
+ for (const role of roleRows) {
3193
+ if (supervisorNumber(role.queued) !== null) {
3194
+ total += supervisorNumber(role.queued);
3195
+ found = true;
3196
+ }
3197
+ }
3198
+ queued = found ? total : null;
3199
+ }
3200
+ const lastError = asString(
3201
+ source.lastError || source.environmentError || source.limitsError,
3202
+ );
3203
+ const lastCheckAt = asString(source.lastCheckAt || source.last_check_at);
3169
3204
  let state = "idle";
3170
3205
  if (paused) state = "paused";
3171
3206
  else if (source.backoff === true || /backoff|back-off|retry|delay|wait/.test(rawState)) state = "backoff";
3172
3207
  else if (/run|active|busy|working/.test(rawState)) state = "running";
3173
3208
  else if (/idle|ready|free/.test(rawState)) state = "idle";
3174
3209
  else if (running !== null && running > 0) state = "running";
3175
- rows.set(repo, { repo, state, running, roles: normalizeSupervisorRoles(source), workers: normalizeSupervisorWorkers(source) });
3210
+ rows.set(repo, {
3211
+ repo,
3212
+ state,
3213
+ paused,
3214
+ running,
3215
+ queued,
3216
+ lastCheckAt,
3217
+ lastError,
3218
+ roles: roleRows,
3219
+ workers: normalizeSupervisorWorkers(source),
3220
+ });
3176
3221
  }
3177
3222
  return [...rows.values()].sort((left, right) => left.repo.localeCompare(right.repo));
3178
3223
  }
@@ -3708,6 +3753,7 @@ function mount(root, options = {}) {
3708
3753
  const supervisorInline = element(doc, "span", "hive-supervisor-inline is-hidden");
3709
3754
  setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
3710
3755
  const supervisorInlineLabel = element(doc, "span", "hive-supervisor-inline-label", translate("supervisor.label"));
3756
+ const supervisorInlineSep = element(doc, "span", "hive-supervisor-inline-sep", "·");
3711
3757
  const supervisorInlineState = element(doc, "span", "hive-supervisor-inline-state", "");
3712
3758
  const supervisorInlineResume = element(doc, "button", "hive-btn hive-supervisor-inline-resume is-hidden", translate("supervisor.resume"));
3713
3759
  setAttr(supervisorInlineResume, "type", "button");
@@ -3715,6 +3761,7 @@ function mount(root, options = {}) {
3715
3761
  if (supervisorInlineRow) void resumeSupervisor(supervisorInlineRow, supervisorInlineResume);
3716
3762
  });
3717
3763
  supervisorInline.appendChild(supervisorInlineLabel);
3764
+ supervisorInline.appendChild(supervisorInlineSep);
3718
3765
  supervisorInline.appendChild(supervisorInlineState);
3719
3766
  supervisorInline.appendChild(supervisorInlineResume);
3720
3767
  bar.appendChild(supervisorInline);
@@ -6036,36 +6083,58 @@ function mount(root, options = {}) {
6036
6083
  supervisorInlineState.className = "hive-supervisor-inline-state";
6037
6084
  supervisorInlineState.textContent = "";
6038
6085
  supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume is-hidden";
6039
- setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
6040
6086
  supervisorInlineLabel.textContent = translate("supervisor.label");
6041
- if (!lastModel || !Array.isArray(supervisorData) || supervisorData.length === 0) return;
6042
- const row = supervisorData.find((entry) => entry.repo === lastModel.repo);
6043
- if (!row) return;
6087
+ supervisorInlineSep.textContent = "·";
6088
+ if (!lastModel) return;
6089
+
6090
+ const row = Array.isArray(supervisorData)
6091
+ ? supervisorData.find((entry) => entry.repo === lastModel.repo)
6092
+ : null;
6093
+ const now = Date.now();
6094
+ const lastCheck = row ? parseDate(row.lastCheckAt) : null;
6095
+ const fresh = lastCheck !== null && now - lastCheck.getTime() <= 90_000;
6096
+ const paused = Boolean(row && (row.paused === true || row.state === "paused"));
6097
+ const status = paused ? "paused" : fresh ? "normal" : "unresponsive";
6098
+ const label =
6099
+ status === "normal"
6100
+ ? translate("supervisor.normal")
6101
+ : status === "paused"
6102
+ ? translate("supervisor.paused")
6103
+ : translate("supervisor.unresponsive");
6044
6104
 
6045
- supervisorInlineRow = row;
6046
6105
  supervisorInline.className = "hive-supervisor-inline";
6047
- let stateLabel = translate("supervisor.idle");
6048
- if (row.state === "running") {
6049
- stateLabel =
6050
- row.running === null || row.running === undefined
6051
- ? translate("supervisor.running")
6052
- : translate("supervisor.runningCount").replace("{count}", String(row.running));
6053
- } else if (row.state === "backoff") {
6054
- stateLabel = translate("supervisor.backoff");
6055
- } else if (row.state === "paused") {
6056
- stateLabel = translate("supervisor.paused");
6057
- }
6058
- supervisorInlineState.className = "hive-supervisor-inline-state is-" + row.state;
6059
- supervisorInlineState.textContent = stateLabel;
6060
-
6061
- if (row.state === "paused") {
6106
+ supervisorInlineRow = row || null;
6107
+ supervisorInlineState.className = "hive-supervisor-inline-state is-" + status;
6108
+ supervisorInlineState.textContent = label;
6109
+
6110
+ const details = [];
6111
+ if (lastCheck) {
6112
+ details.push(
6113
+ translate("supervisor.lastCheck").replace(
6114
+ "{seconds}",
6115
+ String(Math.max(0, Math.floor((now - lastCheck.getTime()) / 1000))),
6116
+ ),
6117
+ );
6118
+ } else {
6119
+ details.push(translate("supervisor.noData"));
6120
+ }
6121
+ const running = row ? supervisorWorkerCount(row) : null;
6122
+ details.push(translate("supervisor.tooltipRunning").replace("{count}", String(running === null ? 0 : running)));
6123
+ details.push(translate("supervisor.tooltipQueued").replace("{count}", String(row && row.queued !== null && row.queued !== undefined ? row.queued : 0)));
6124
+ if (row && row.lastError) {
6125
+ details.push(translate("supervisor.tooltipError").replace("{error}", asString(row.lastError)));
6126
+ }
6127
+ const tooltip = details.join(" · ");
6128
+ setAttr(supervisorInline, "title", tooltip);
6129
+ setAttr(supervisorInline, "aria-label", tooltip);
6130
+
6131
+ if (paused && row) {
6062
6132
  const aria = translate("supervisor.resumeAria").replace("{repo}", row.repo);
6063
6133
  supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume";
6064
6134
  setAttr(supervisorInlineResume, "title", aria);
6065
6135
  setAttr(supervisorInlineResume, "aria-label", aria);
6066
6136
  }
6067
6137
  }
6068
-
6069
6138
  function setSupervisorData(rows) {
6070
6139
  supervisorData = Array.isArray(rows) ? rows : [];
6071
6140
  renderSupervisor();
@@ -6719,7 +6788,7 @@ function mount(root, options = {}) {
6719
6788
 
6720
6789
  return { mount: mount, renderModel: renderModel, messages: messages }
6721
6790
  })()
6722
- 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/* Virtual lanes: fixed 26px cards, 2px gaps, 28px stride. */\n.hive-lane-cards {\n display: block;\n flex: 1 1 auto;\n min-height: 0;\n padding: 7px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.hive-lane-virtual { position: relative; width: 100%; min-width: 0; }\n.hive-lane-virtual .hive-card {\n position: absolute;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n height: 26px;\n min-height: 26px;\n padding: 2px 8px;\n overflow: hidden;\n border-radius: var(--hive-radius-sm);\n}\n.hive-lane-virtual .hive-card-title {\n width: 100%;\n overflow: hidden;\n font-size: 12px;\n line-height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-agent-count { font: inherit; cursor: pointer; }\n.hive-agent-count:disabled { cursor: default; }\n\n/* Agents dialog */\n.hive-agents-dialog { width: min(560px, 92vw); max-height: 80vh; }\n.hive-agents-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }\n.hive-agents-empty-note { padding: 10px 0; color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; }\n.hive-agent-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hive-line-2); }\n.hive-agent-row-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }\n.hive-agent-row-name { color: var(--hive-fg); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-row-task { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-row-meta { color: var(--hive-fg-faint); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agents-workers-title { padding-top: 4px; color: var(--hive-fg); font-size: 14px; font-weight: 700; line-height: 1.5; }\n.hive-agent-worker-row { padding: 8px 0; border-bottom: 1px solid var(--hive-line-2); }\n.hive-agent-worker-task { color: var(--hive-fg); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-worker-meta { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agents-technical { border-top: 1px solid var(--hive-line-2); padding-top: 8px; }\n.hive-agents-technical-summary { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; cursor: pointer; }\n.hive-agents-technical-json { max-height: 220px; margin-top: 8px; }\n\n\n/* The DSH design-token bridge is bundled in panel.css; this file is kept for package layout compatibility. */\n"
6791
+ 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/* Virtual lanes: fixed 26px cards, 2px gaps, 28px stride. */\n.hive-lane-cards {\n display: block;\n flex: 1 1 auto;\n min-height: 0;\n padding: 7px;\n overflow-x: hidden;\n overflow-y: auto;\n}\n.hive-lane-virtual { position: relative; width: 100%; min-width: 0; }\n.hive-lane-virtual .hive-card {\n position: absolute;\n left: 0;\n right: 0;\n display: flex;\n align-items: center;\n height: 26px;\n min-height: 26px;\n padding: 2px 8px;\n overflow: hidden;\n border-radius: var(--hive-radius-sm);\n}\n.hive-lane-virtual .hive-card-title {\n width: 100%;\n overflow: hidden;\n font-size: 12px;\n line-height: 16px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.hive-agent-count { font: inherit; cursor: pointer; }\n.hive-agent-count:disabled { cursor: default; }\n\n/* Agents dialog */\n.hive-agents-dialog { width: min(560px, 92vw); max-height: 80vh; }\n.hive-agents-body { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }\n.hive-agents-empty-note { padding: 10px 0; color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; }\n.hive-agent-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--hive-line-2); }\n.hive-agent-row-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: 2px; min-width: 0; }\n.hive-agent-row-name { color: var(--hive-fg); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-row-task { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-row-meta { color: var(--hive-fg-faint); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agents-workers-title { padding-top: 4px; color: var(--hive-fg); font-size: 14px; font-weight: 700; line-height: 1.5; }\n.hive-agent-worker-row { padding: 8px 0; border-bottom: 1px solid var(--hive-line-2); }\n.hive-agent-worker-task { color: var(--hive-fg); font-size: 14px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agent-worker-meta { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }\n.hive-agents-technical { border-top: 1px solid var(--hive-line-2); padding-top: 8px; }\n.hive-agents-technical-summary { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; cursor: pointer; }\n.hive-agents-technical-json { max-height: 220px; margin-top: 8px; }\n\n.hive-supervisor-inline-sep { color: var(--hive-fg-faint); }\n.hive-supervisor-inline-state.is-normal::before { background: var(--hive-ok); }\n.hive-supervisor-inline-state.is-paused::before { background: var(--hive-warn); }\n.hive-supervisor-inline-state.is-unresponsive::before { background: var(--hive-fg-faint); }\n\n\n/* The DSH design-token bridge is bundled in panel.css; this file is kept for package layout compatibility. */\n"
6723
6792
  function ensureHivePanelCss() {
6724
6793
  if (typeof document === 'undefined') return
6725
6794
  if (document.querySelector('style[data-hive-panel-css]') !== null) return
package/lib/queen.js CHANGED
@@ -157,6 +157,82 @@ export function isTopLevelSession(session) {
157
157
  return true
158
158
  }
159
159
 
160
+ /** Read the mounted dsh-hive-runner supervisor service, if any. */
161
+ function supervisorOf(ctx) {
162
+ if (ctx === null || typeof ctx !== 'object' || typeof ctx.get !== 'function') return undefined
163
+ try {
164
+ return ctx.get('hiveSupervisor')
165
+ } catch {
166
+ return undefined
167
+ }
168
+ }
169
+
170
+ /**
171
+ * The supervisor's currently registered queen Session id, if any.
172
+ * Reads the shared `queenSession` object first, then `status().queenSessionId`.
173
+ * @param {object} [supervisor] - mounted Hive supervisor service.
174
+ * @returns {string | undefined} the registered queen Session id.
175
+ */
176
+ export function registeredQueenSessionId(supervisor) {
177
+ if (supervisor === null || typeof supervisor !== 'object') return undefined
178
+ try {
179
+ const id = supervisor.queenSession?.sessionId
180
+ if (typeof id === 'string' && id !== '') return id
181
+ } catch {
182
+ // fall through to status()
183
+ }
184
+ try {
185
+ const status = typeof supervisor.status === 'function' ? supervisor.status() : undefined
186
+ const id = status?.queenSessionId
187
+ if (typeof id === 'string' && id !== '') return id
188
+ } catch {
189
+ // no status, no queen id
190
+ }
191
+ return undefined
192
+ }
193
+
194
+ /**
195
+ * Whether a Session is a supervisor card worker / delegation child. Workers
196
+ * share the repository cwd with the queen but must keep their normal coding
197
+ * tools: injecting the queen contract into them would forbid the writes the
198
+ * supervisor asked them to do (and the queen mutation guard keys off the
199
+ * registered queen Session, so a worker must never be registered as one).
200
+ *
201
+ * Primary source: the mounted supervisor's `isWorkerSession(sessionId)`
202
+ * (newer dsh-hive-runner). Fallback when that interface is unavailable or
203
+ * returns a non-boolean: `session.header.parentSession` equals the
204
+ * supervisor's registered queen Session id, or the durable subagent markers
205
+ * (`origin === 'subagent'` / a positive `delegationDepth`).
206
+ *
207
+ * @param {object} ctx - host Cordis context (may expose `hiveSupervisor`).
208
+ * @param {object} session - DSH Session (or a test stub).
209
+ * @returns {boolean} true for worker/delegated Sessions.
210
+ */
211
+ export function isWorkerSession(ctx, session) {
212
+ const sessionId = session !== null && typeof session === 'object' ? session.id : undefined
213
+ const supervisor = supervisorOf(ctx)
214
+ if (supervisor !== undefined && typeof supervisor.isWorkerSession === 'function'
215
+ && typeof sessionId === 'string' && sessionId !== '') {
216
+ try {
217
+ // A positive registry answer is authoritative; a negative answer still
218
+ // falls through to the header lineage below, because a visible subagent
219
+ // Session is not always listed in the supervisor's live-worker registry
220
+ // (legacy/persisted children carry only parentSession in the header).
221
+ const answer = supervisor.isWorkerSession(sessionId)
222
+ if (answer === true) return true
223
+ } catch {
224
+ // Fall back to the header markers below.
225
+ }
226
+ }
227
+ const header = session !== null && typeof session === 'object' ? session.header : undefined
228
+ const queenSessionId = registeredQueenSessionId(supervisor)
229
+ if (typeof queenSessionId === 'string' && queenSessionId !== ''
230
+ && header !== null && typeof header === 'object' && header.parentSession === queenSessionId) {
231
+ return true
232
+ }
233
+ return !isTopLevelSession(session)
234
+ }
235
+
160
236
  /**
161
237
  * Create the queen controller for one plugin fiber.
162
238
  *
@@ -251,8 +327,9 @@ export function createQueen(ctx, options = {}) {
251
327
  if (active !== undefined) return active.text
252
328
  if (!autoQueen || suppressed.has(sessionId)) return ''
253
329
  // A card worker / delegated child shares the repo cwd but must never
254
- // become the queen (and must never overwrite the supervisor's queen id).
255
- if (!isTopLevelSession(agent.session)) return ''
330
+ // become the queen (nor lose its normal coding tools): ask the supervisor
331
+ // first, then fall back to the parent/queen and subagent header markers.
332
+ if (isWorkerSession(ctx, agent.session)) return ''
256
333
  let cwd
257
334
  try {
258
335
  cwd = ctx.workingDirectory?.get?.(agent.session)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hive-panel",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
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",
@@ -1050,6 +1050,82 @@ async function call(route, { method = 'GET', query = {}, body } = {}) {
1050
1050
  ok('panel init/queen-on register the queen cwd with the supervisor (idempotent, initialised repos only, one-way)')
1051
1051
  }
1052
1052
 
1053
+ // ── 11e. worker Sessions never receive the queen contract ──────────────────
1054
+ {
1055
+ // Preferred path: the mounted supervisor exposes isWorkerSession(sessionId).
1056
+ const repoCalls = []
1057
+ const sessions = []
1058
+ const workerQueries = []
1059
+ const supervisor = {
1060
+ queenSession: { sessionId: 's-queen' },
1061
+ addRepo(repo) { if (!repoCalls.includes(repo)) repoCalls.push(repo); return { repo } },
1062
+ hasRepo(repo) { return repoCalls.includes(repo) },
1063
+ setQueenSession(sessionId) { sessions.push(sessionId) },
1064
+ isWorkerSession(sessionId) { workerQueries.push(sessionId); return sessionId === 's-supervised-worker' },
1065
+ }
1066
+ const sessionsById = new Map([
1067
+ ['s-queen', { id: 's-queen', header: { id: 's-queen', cwd: repo } }],
1068
+ ['s-supervised-worker', { id: 's-supervised-worker', header: { id: 's-supervised-worker', cwd: repo } }],
1069
+ ['s-top', { id: 's-top', header: { id: 's-top', cwd: repo } }],
1070
+ ])
1071
+ const shim = createCtx({
1072
+ live: sessionsById,
1073
+ cwdOf: () => repo,
1074
+ supervisor,
1075
+ })
1076
+ host.apply(shim.ctx, {})
1077
+ const section = shim.sections.find(entry => entry.name === 'hive:queen')
1078
+
1079
+ // isWorkerSession(sessionId) is authoritative: even a Session with a clean
1080
+ // top-level header is skipped, and it is never registered as the queen.
1081
+ assert.equal(section.text({ agent: { session: sessionsById.get('s-supervised-worker') } }), '')
1082
+ assert.deepEqual(workerQueries, ['s-supervised-worker'])
1083
+ assert.equal(sessions.length, 0, 'a worker Session must not be registered as the queen')
1084
+ assert.deepEqual(repoCalls, [], 'a worker Session must not register its repo through the queen path')
1085
+
1086
+ // An ordinary top-level Session in the same repository still injects and registers.
1087
+ const topText = section.text({ agent: { session: sessionsById.get('s-top') } })
1088
+ assert.match(topText, /You plan and coordinate/)
1089
+ assert.deepEqual(sessions, ['s-top'])
1090
+ assert.deepEqual(repoCalls, [repo])
1091
+ ok('a supervisor isWorkerSession(sessionId) worker is never injected or registered; a top-level Session still is')
1092
+ }
1093
+
1094
+ // ── 11f. worker fallback: parentSession === the registered queen ───────────
1095
+ {
1096
+ // No isWorkerSession on this supervisor: fall back to the header markers.
1097
+ const repoCalls = []
1098
+ const sessions = []
1099
+ const supervisor = {
1100
+ queenSession: { sessionId: 's-boss' },
1101
+ addRepo(repo) { if (!repoCalls.includes(repo)) repoCalls.push(repo); return { repo } },
1102
+ hasRepo(repo) { return repoCalls.includes(repo) },
1103
+ setQueenSession(sessionId) { sessions.push(sessionId) },
1104
+ }
1105
+ const sessionsById = new Map([
1106
+ ['s-boss', { id: 's-boss', header: { id: 's-boss', cwd: repo } }],
1107
+ ['s-child', { id: 's-child', header: { id: 's-child', cwd: repo, parentSession: 's-boss' } }],
1108
+ ['s-orphan', { id: 's-orphan', header: { id: 's-orphan', cwd: repo } }],
1109
+ ])
1110
+ const shim = createCtx({ live: sessionsById, cwdOf: () => repo, supervisor })
1111
+ host.apply(shim.ctx, {})
1112
+ const section = shim.sections.find(entry => entry.name === 'hive:queen')
1113
+
1114
+ // parentSession === registered queen Session: worker, no injection / no queen id.
1115
+ assert.equal(section.text({ agent: { session: sessionsById.get('s-child') } }), '')
1116
+ assert.deepEqual(sessions, [], 'a parentSession child must never be registered as the queen')
1117
+ assert.deepEqual(repoCalls, [])
1118
+ assert.equal(supervisor.queenSession.sessionId, 's-boss', 'the registered queen id must not be overwritten by a worker')
1119
+ // The runner mutation guard keys off registered queen sessions/worker headers, so a
1120
+ // worker that is never registered keeps its write/edit/bash tools unblocked.
1121
+
1122
+ // A normal top-level Session is still injected and registers as before.
1123
+ assert.match(section.text({ agent: { session: sessionsById.get('s-orphan') } }), /You plan and coordinate/)
1124
+ assert.deepEqual(sessions, ['s-orphan'])
1125
+ assert.deepEqual(repoCalls, [repo])
1126
+ ok('the parentSession===queen fallback skips worker Sessions but keeps top-level injection and registration')
1127
+ }
1128
+
1053
1129
  // ── 12. queen activation / scope / exit ─────────────────────────────────────
1054
1130
  {
1055
1131
  const shim = createCtx({
package/src/panel.css CHANGED
@@ -1148,3 +1148,8 @@ dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow:
1148
1148
  .hive-agents-technical-summary { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; cursor: pointer; }
1149
1149
  .hive-agents-technical-json { max-height: 220px; margin-top: 8px; }
1150
1150
 
1151
+ .hive-supervisor-inline-sep { color: var(--hive-fg-faint); }
1152
+ .hive-supervisor-inline-state.is-normal::before { background: var(--hive-ok); }
1153
+ .hive-supervisor-inline-state.is-paused::before { background: var(--hive-warn); }
1154
+ .hive-supervisor-inline-state.is-unresponsive::before { background: var(--hive-fg-faint); }
1155
+
package/src/panel.js CHANGED
@@ -2033,6 +2033,10 @@ dialog.hive-dialog .hive-dialog-body { flex: 1 1 auto; min-height: 0; overflow:
2033
2033
  .hive-agents-technical { border-top: 1px solid var(--hive-line-2); padding-top: 8px; }
2034
2034
  .hive-agents-technical-summary { color: var(--hive-fg-soft); font-size: 12px; line-height: 1.5; cursor: pointer; }
2035
2035
  .hive-agents-technical-json { max-height: 220px; margin-top: 8px; }
2036
+ .hive-supervisor-inline-sep { color: var(--hive-fg-faint); }
2037
+ .hive-supervisor-inline-state.is-normal::before { background: var(--hive-ok); }
2038
+ .hive-supervisor-inline-state.is-paused::before { background: var(--hive-warn); }
2039
+ .hive-supervisor-inline-state.is-unresponsive::before { background: var(--hive-fg-faint); }
2036
2040
  `;
2037
2041
 
2038
2042
  const LANE_LABEL_KEYS = Object.freeze({
@@ -2134,7 +2138,14 @@ export const messages = Object.freeze({
2134
2138
  "supervisor.runningCount": "running {count}",
2135
2139
  "supervisor.idle": "idle",
2136
2140
  "supervisor.backoff": "backoff",
2137
- "supervisor.paused": "paused",
2141
+ "supervisor.paused": "Paused",
2142
+ "supervisor.normal": "Normal",
2143
+ "supervisor.unresponsive": "Unresponsive",
2144
+ "supervisor.noData": "No supervisor data",
2145
+ "supervisor.lastCheck": "Last check {seconds}s ago",
2146
+ "supervisor.tooltipRunning": "Running {count}",
2147
+ "supervisor.tooltipQueued": "Queued {count}",
2148
+ "supervisor.tooltipError": "Last error: {error}",
2138
2149
  "supervisor.resume": "resume",
2139
2150
  "supervisor.resumeAria": "Resume the supervisor for {repo}",
2140
2151
  "supervisor.resumeFailed": "Could not resume the supervisor",
@@ -2389,6 +2400,13 @@ export const messages = Object.freeze({
2389
2400
  "supervisor.idle": "空闲",
2390
2401
  "supervisor.backoff": "退避",
2391
2402
  "supervisor.paused": "已暂停",
2403
+ "supervisor.normal": "正常",
2404
+ "supervisor.unresponsive": "未响应",
2405
+ "supervisor.noData": "无监督器数据",
2406
+ "supervisor.lastCheck": "最近一次检查 {seconds} 秒前",
2407
+ "supervisor.tooltipRunning": "运行中 {count} 个",
2408
+ "supervisor.tooltipQueued": "待办 {count} 个",
2409
+ "supervisor.tooltipError": "最近错误:{error}",
2392
2410
  "supervisor.resume": "恢复",
2393
2411
  "supervisor.resumeAria": "恢复 {repo} 的 supervisor",
2394
2412
  "supervisor.resumeFailed": "恢复 supervisor 失败",
@@ -3093,13 +3111,40 @@ function normalizeSupervisorStatus(payload) {
3093
3111
  supervisorCount(source.agents) ??
3094
3112
  supervisorCount(source.inflight) ??
3095
3113
  supervisorCount(source.count);
3114
+ const roleRows = normalizeSupervisorRoles(source);
3115
+ let queued = isRecord(source.backlog) ? supervisorCount(source.backlog.queued) : null;
3116
+ if (queued === null) {
3117
+ let total = 0;
3118
+ let found = false;
3119
+ for (const role of roleRows) {
3120
+ if (supervisorNumber(role.queued) !== null) {
3121
+ total += supervisorNumber(role.queued);
3122
+ found = true;
3123
+ }
3124
+ }
3125
+ queued = found ? total : null;
3126
+ }
3127
+ const lastError = asString(
3128
+ source.lastError || source.environmentError || source.limitsError,
3129
+ );
3130
+ const lastCheckAt = asString(source.lastCheckAt || source.last_check_at);
3096
3131
  let state = "idle";
3097
3132
  if (paused) state = "paused";
3098
3133
  else if (source.backoff === true || /backoff|back-off|retry|delay|wait/.test(rawState)) state = "backoff";
3099
3134
  else if (/run|active|busy|working/.test(rawState)) state = "running";
3100
3135
  else if (/idle|ready|free/.test(rawState)) state = "idle";
3101
3136
  else if (running !== null && running > 0) state = "running";
3102
- rows.set(repo, { repo, state, running, roles: normalizeSupervisorRoles(source), workers: normalizeSupervisorWorkers(source) });
3137
+ rows.set(repo, {
3138
+ repo,
3139
+ state,
3140
+ paused,
3141
+ running,
3142
+ queued,
3143
+ lastCheckAt,
3144
+ lastError,
3145
+ roles: roleRows,
3146
+ workers: normalizeSupervisorWorkers(source),
3147
+ });
3103
3148
  }
3104
3149
  return [...rows.values()].sort((left, right) => left.repo.localeCompare(right.repo));
3105
3150
  }
@@ -3635,6 +3680,7 @@ export function mount(root, options = {}) {
3635
3680
  const supervisorInline = element(doc, "span", "hive-supervisor-inline is-hidden");
3636
3681
  setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
3637
3682
  const supervisorInlineLabel = element(doc, "span", "hive-supervisor-inline-label", translate("supervisor.label"));
3683
+ const supervisorInlineSep = element(doc, "span", "hive-supervisor-inline-sep", "·");
3638
3684
  const supervisorInlineState = element(doc, "span", "hive-supervisor-inline-state", "");
3639
3685
  const supervisorInlineResume = element(doc, "button", "hive-btn hive-supervisor-inline-resume is-hidden", translate("supervisor.resume"));
3640
3686
  setAttr(supervisorInlineResume, "type", "button");
@@ -3642,6 +3688,7 @@ export function mount(root, options = {}) {
3642
3688
  if (supervisorInlineRow) void resumeSupervisor(supervisorInlineRow, supervisorInlineResume);
3643
3689
  });
3644
3690
  supervisorInline.appendChild(supervisorInlineLabel);
3691
+ supervisorInline.appendChild(supervisorInlineSep);
3645
3692
  supervisorInline.appendChild(supervisorInlineState);
3646
3693
  supervisorInline.appendChild(supervisorInlineResume);
3647
3694
  bar.appendChild(supervisorInline);
@@ -5963,36 +6010,58 @@ export function mount(root, options = {}) {
5963
6010
  supervisorInlineState.className = "hive-supervisor-inline-state";
5964
6011
  supervisorInlineState.textContent = "";
5965
6012
  supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume is-hidden";
5966
- setAttr(supervisorInline, "aria-label", translate("supervisor.aria"));
5967
6013
  supervisorInlineLabel.textContent = translate("supervisor.label");
5968
- if (!lastModel || !Array.isArray(supervisorData) || supervisorData.length === 0) return;
5969
- const row = supervisorData.find((entry) => entry.repo === lastModel.repo);
5970
- if (!row) return;
6014
+ supervisorInlineSep.textContent = "·";
6015
+ if (!lastModel) return;
6016
+
6017
+ const row = Array.isArray(supervisorData)
6018
+ ? supervisorData.find((entry) => entry.repo === lastModel.repo)
6019
+ : null;
6020
+ const now = Date.now();
6021
+ const lastCheck = row ? parseDate(row.lastCheckAt) : null;
6022
+ const fresh = lastCheck !== null && now - lastCheck.getTime() <= 90_000;
6023
+ const paused = Boolean(row && (row.paused === true || row.state === "paused"));
6024
+ const status = paused ? "paused" : fresh ? "normal" : "unresponsive";
6025
+ const label =
6026
+ status === "normal"
6027
+ ? translate("supervisor.normal")
6028
+ : status === "paused"
6029
+ ? translate("supervisor.paused")
6030
+ : translate("supervisor.unresponsive");
5971
6031
 
5972
- supervisorInlineRow = row;
5973
6032
  supervisorInline.className = "hive-supervisor-inline";
5974
- let stateLabel = translate("supervisor.idle");
5975
- if (row.state === "running") {
5976
- stateLabel =
5977
- row.running === null || row.running === undefined
5978
- ? translate("supervisor.running")
5979
- : translate("supervisor.runningCount").replace("{count}", String(row.running));
5980
- } else if (row.state === "backoff") {
5981
- stateLabel = translate("supervisor.backoff");
5982
- } else if (row.state === "paused") {
5983
- stateLabel = translate("supervisor.paused");
5984
- }
5985
- supervisorInlineState.className = "hive-supervisor-inline-state is-" + row.state;
5986
- supervisorInlineState.textContent = stateLabel;
5987
-
5988
- if (row.state === "paused") {
6033
+ supervisorInlineRow = row || null;
6034
+ supervisorInlineState.className = "hive-supervisor-inline-state is-" + status;
6035
+ supervisorInlineState.textContent = label;
6036
+
6037
+ const details = [];
6038
+ if (lastCheck) {
6039
+ details.push(
6040
+ translate("supervisor.lastCheck").replace(
6041
+ "{seconds}",
6042
+ String(Math.max(0, Math.floor((now - lastCheck.getTime()) / 1000))),
6043
+ ),
6044
+ );
6045
+ } else {
6046
+ details.push(translate("supervisor.noData"));
6047
+ }
6048
+ const running = row ? supervisorWorkerCount(row) : null;
6049
+ details.push(translate("supervisor.tooltipRunning").replace("{count}", String(running === null ? 0 : running)));
6050
+ details.push(translate("supervisor.tooltipQueued").replace("{count}", String(row && row.queued !== null && row.queued !== undefined ? row.queued : 0)));
6051
+ if (row && row.lastError) {
6052
+ details.push(translate("supervisor.tooltipError").replace("{error}", asString(row.lastError)));
6053
+ }
6054
+ const tooltip = details.join(" · ");
6055
+ setAttr(supervisorInline, "title", tooltip);
6056
+ setAttr(supervisorInline, "aria-label", tooltip);
6057
+
6058
+ if (paused && row) {
5989
6059
  const aria = translate("supervisor.resumeAria").replace("{repo}", row.repo);
5990
6060
  supervisorInlineResume.className = "hive-btn hive-supervisor-inline-resume";
5991
6061
  setAttr(supervisorInlineResume, "title", aria);
5992
6062
  setAttr(supervisorInlineResume, "aria-label", aria);
5993
6063
  }
5994
6064
  }
5995
-
5996
6065
  function setSupervisorData(rows) {
5997
6066
  supervisorData = Array.isArray(rows) ? rows : [];
5998
6067
  renderSupervisor();