dsh-hive-panel 1.0.12 → 1.0.14
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 +31 -0
- package/lib/client.js +52 -11
- package/package.json +1 -1
- package/src/panel.js +52 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ 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.14] - 2026-12-05
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Renderer re-synced from hive-panel 1.0.8: task rows strip the workflow prefix and show
|
|
12
|
+
only the task name, while the task details keep the full title. Browser bundle rebuilt.
|
|
13
|
+
|
|
14
|
+
### Tests
|
|
15
|
+
|
|
16
|
+
- 48 checks pass, including the synced prefix stripping and the full-title detail.
|
|
17
|
+
|
|
18
|
+
## [1.0.13] - 2026-12-05
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Renderer re-synced from hive-panel 1.0.7: supervisor health prefers the top-level
|
|
23
|
+
`lastTickAt`, so a long drain no longer reports the supervisor as unresponsive, and
|
|
24
|
+
the repository scope meta is shown alongside. Browser bundle rebuilt.
|
|
25
|
+
|
|
26
|
+
### Tests
|
|
27
|
+
|
|
28
|
+
- 48 checks pass, including the synced top-tick health and the scope meta.
|
|
29
|
+
|
|
30
|
+
### Published
|
|
31
|
+
|
|
32
|
+
- npm: `dsh-hive-panel@1.0.13` on 2026-12-05.
|
|
33
|
+
|
|
7
34
|
## [1.0.12] - 2026-12-05
|
|
8
35
|
|
|
9
36
|
### Fixed
|
|
@@ -26,6 +53,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
26
53
|
- 48 checks cover the per-repository injection, foreign-repo query/body rejection with
|
|
27
54
|
zero spawn, the panel-side rejection toast/tooltip (en + zh) and the 32768 role cap.
|
|
28
55
|
|
|
56
|
+
### Published
|
|
57
|
+
|
|
58
|
+
- npm: `dsh-hive-panel@1.0.12` on 2026-12-05.
|
|
59
|
+
|
|
29
60
|
## [1.0.11] - 2026-12-05
|
|
30
61
|
|
|
31
62
|
### Changed
|
package/lib/client.js
CHANGED
|
@@ -2216,6 +2216,7 @@ const messages = Object.freeze({
|
|
|
2216
2216
|
"supervisor.unresponsive": "Unresponsive",
|
|
2217
2217
|
"supervisor.noData": "No supervisor data",
|
|
2218
2218
|
"supervisor.lastCheck": "Last check {seconds}s ago",
|
|
2219
|
+
"supervisor.lastTick": "Last tick {seconds}s ago",
|
|
2219
2220
|
"supervisor.tooltipRunning": "Running {count}",
|
|
2220
2221
|
"supervisor.tooltipQueued": "Queued {count}",
|
|
2221
2222
|
"supervisor.tooltipError": "Last error: {error}",
|
|
@@ -2479,6 +2480,7 @@ const messages = Object.freeze({
|
|
|
2479
2480
|
"supervisor.unresponsive": "未响应",
|
|
2480
2481
|
"supervisor.noData": "无监督器数据",
|
|
2481
2482
|
"supervisor.lastCheck": "最近一次检查 {seconds} 秒前",
|
|
2483
|
+
"supervisor.lastTick": "最后 tick {seconds} 秒前",
|
|
2482
2484
|
"supervisor.tooltipRunning": "运行中 {count} 个",
|
|
2483
2485
|
"supervisor.tooltipQueued": "待办 {count} 个",
|
|
2484
2486
|
"supervisor.tooltipError": "最近错误:{error}",
|
|
@@ -3172,6 +3174,32 @@ function normalizeSupervisorWorkers(source) {
|
|
|
3172
3174
|
return rows;
|
|
3173
3175
|
}
|
|
3174
3176
|
|
|
3177
|
+
function supervisorTopTick(payload) {
|
|
3178
|
+
const candidates = [payload];
|
|
3179
|
+
for (const key of ["data", "result", "status", "supervisor"]) {
|
|
3180
|
+
if (isRecord(payload) && isRecord(payload[key])) candidates.push(payload[key]);
|
|
3181
|
+
}
|
|
3182
|
+
for (const source of candidates) {
|
|
3183
|
+
if (!isRecord(source)) continue;
|
|
3184
|
+
const tick = asString(source.lastTickAt || source.last_tick_at);
|
|
3185
|
+
if (tick) return tick;
|
|
3186
|
+
}
|
|
3187
|
+
return "";
|
|
3188
|
+
}
|
|
3189
|
+
|
|
3190
|
+
function supervisorHeartbeatAt(rows) {
|
|
3191
|
+
if (!Array.isArray(rows)) return null;
|
|
3192
|
+
const top = parseDate(rows.lastTickAt);
|
|
3193
|
+
if (top) return top;
|
|
3194
|
+
let latest = null;
|
|
3195
|
+
for (const row of rows) {
|
|
3196
|
+
if (!isRecord(row)) continue;
|
|
3197
|
+
const check = parseDate(row.lastCheckAt);
|
|
3198
|
+
if (check && (latest === null || check.getTime() > latest.getTime())) latest = check;
|
|
3199
|
+
}
|
|
3200
|
+
return latest;
|
|
3201
|
+
}
|
|
3202
|
+
|
|
3175
3203
|
function normalizeSupervisorStatus(payload) {
|
|
3176
3204
|
const rows = new Map();
|
|
3177
3205
|
for (const raw of supervisorEntriesFrom(payload)) {
|
|
@@ -3223,12 +3251,14 @@ function normalizeSupervisorStatus(payload) {
|
|
|
3223
3251
|
workers: normalizeSupervisorWorkers(source),
|
|
3224
3252
|
});
|
|
3225
3253
|
}
|
|
3226
|
-
|
|
3254
|
+
const result = [...rows.values()].sort((left, right) => left.repo.localeCompare(right.repo));
|
|
3255
|
+
result.lastTickAt = supervisorTopTick(payload);
|
|
3256
|
+
return result;
|
|
3227
3257
|
}
|
|
3228
3258
|
|
|
3229
3259
|
/**
|
|
3230
3260
|
* Normalize the supervisor's queen cross-repository rejection observability:
|
|
3231
|
-
*
|
|
3261
|
+
* \`crossRepoBlocked\` count + \`lastCrossRepoBlocked { tool, repo, cwd, at }\`.
|
|
3232
3262
|
* Older/newer supervisors may nest it under queen-prefixed or repoScope names.
|
|
3233
3263
|
* @param {unknown} payload - /api/hive-runner?op=status payload.
|
|
3234
3264
|
* @returns {{ count: number, last: { tool: string, repo: string, cwd: string, at: string } | null }}
|
|
@@ -3287,6 +3317,15 @@ function supervisorWorkerCount(row) {
|
|
|
3287
3317
|
return found ? total : null;
|
|
3288
3318
|
}
|
|
3289
3319
|
|
|
3320
|
+
function taskDisplayTitle(title) {
|
|
3321
|
+
const full = asString(title);
|
|
3322
|
+
if (!full) return full;
|
|
3323
|
+
const stripped = full
|
|
3324
|
+
.replace(/^[\w.-]+\/[A-Za-z]?\d+\s*[::]\s*/, "")
|
|
3325
|
+
.replace(/^[A-Za-z]+-\d+\s*[::]\s*/, "");
|
|
3326
|
+
return stripped || full;
|
|
3327
|
+
}
|
|
3328
|
+
|
|
3290
3329
|
function element(doc, tag, className, text) {
|
|
3291
3330
|
const node = doc.createElement(tag);
|
|
3292
3331
|
if (className) node.className = className;
|
|
@@ -6139,10 +6178,10 @@ function mount(root, options = {}) {
|
|
|
6139
6178
|
? supervisorData.find((entry) => entry.repo === lastModel.repo)
|
|
6140
6179
|
: null;
|
|
6141
6180
|
const now = Date.now();
|
|
6142
|
-
const
|
|
6143
|
-
const fresh =
|
|
6181
|
+
const heartbeat = supervisorHeartbeatAt(supervisorData);
|
|
6182
|
+
const fresh = heartbeat !== null && now - heartbeat.getTime() <= 90_000;
|
|
6144
6183
|
const paused = Boolean(row && (row.paused === true || row.state === "paused"));
|
|
6145
|
-
const status = paused ? "paused" : fresh ? "normal" : "unresponsive";
|
|
6184
|
+
const status = paused ? "paused" : !row ? "unresponsive" : fresh ? "normal" : "unresponsive";
|
|
6146
6185
|
const label =
|
|
6147
6186
|
status === "normal"
|
|
6148
6187
|
? translate("supervisor.normal")
|
|
@@ -6156,11 +6195,12 @@ function mount(root, options = {}) {
|
|
|
6156
6195
|
supervisorInlineState.textContent = label;
|
|
6157
6196
|
|
|
6158
6197
|
const details = [];
|
|
6159
|
-
if (
|
|
6198
|
+
if (heartbeat) {
|
|
6199
|
+
const hasTopTick = Boolean(supervisorData && parseDate(supervisorData.lastTickAt));
|
|
6160
6200
|
details.push(
|
|
6161
|
-
translate("supervisor.lastCheck").replace(
|
|
6201
|
+
translate(hasTopTick ? "supervisor.lastTick" : "supervisor.lastCheck").replace(
|
|
6162
6202
|
"{seconds}",
|
|
6163
|
-
String(Math.max(0, Math.floor((now -
|
|
6203
|
+
String(Math.max(0, Math.floor((now - heartbeat.getTime()) / 1000))),
|
|
6164
6204
|
),
|
|
6165
6205
|
);
|
|
6166
6206
|
} else {
|
|
@@ -6396,7 +6436,8 @@ function mount(root, options = {}) {
|
|
|
6396
6436
|
|
|
6397
6437
|
function renderCard(card, lane, existing) {
|
|
6398
6438
|
const node = existing || element(doc, "article", "hive-card");
|
|
6399
|
-
const
|
|
6439
|
+
const fullTitle = card.title || translate("card.untitled");
|
|
6440
|
+
const title = taskDisplayTitle(fullTitle);
|
|
6400
6441
|
if (!existing) {
|
|
6401
6442
|
setAttr(node, "tabindex", "0");
|
|
6402
6443
|
setAttr(node, "role", "button");
|
|
@@ -6414,8 +6455,8 @@ function mount(root, options = {}) {
|
|
|
6414
6455
|
node._hiveCard = card;
|
|
6415
6456
|
node._hiveLane = lane;
|
|
6416
6457
|
node._hiveTitle.textContent = title;
|
|
6417
|
-
setAttr(node, "aria-label", translate("card.openAria") + " " +
|
|
6418
|
-
setAttr(node, "title",
|
|
6458
|
+
setAttr(node, "aria-label", translate("card.openAria") + " " + fullTitle);
|
|
6459
|
+
setAttr(node, "title", fullTitle);
|
|
6419
6460
|
return node;
|
|
6420
6461
|
}
|
|
6421
6462
|
function renderStageChips(model) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hive-panel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Hive board and queen mode inside DSH Web: a conversation view scoped to the Session's repository, with allowlisted task-card actions over DSH's shell seam.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
package/src/panel.js
CHANGED
|
@@ -2143,6 +2143,7 @@ export const messages = Object.freeze({
|
|
|
2143
2143
|
"supervisor.unresponsive": "Unresponsive",
|
|
2144
2144
|
"supervisor.noData": "No supervisor data",
|
|
2145
2145
|
"supervisor.lastCheck": "Last check {seconds}s ago",
|
|
2146
|
+
"supervisor.lastTick": "Last tick {seconds}s ago",
|
|
2146
2147
|
"supervisor.tooltipRunning": "Running {count}",
|
|
2147
2148
|
"supervisor.tooltipQueued": "Queued {count}",
|
|
2148
2149
|
"supervisor.tooltipError": "Last error: {error}",
|
|
@@ -2406,6 +2407,7 @@ export const messages = Object.freeze({
|
|
|
2406
2407
|
"supervisor.unresponsive": "未响应",
|
|
2407
2408
|
"supervisor.noData": "无监督器数据",
|
|
2408
2409
|
"supervisor.lastCheck": "最近一次检查 {seconds} 秒前",
|
|
2410
|
+
"supervisor.lastTick": "最后 tick {seconds} 秒前",
|
|
2409
2411
|
"supervisor.tooltipRunning": "运行中 {count} 个",
|
|
2410
2412
|
"supervisor.tooltipQueued": "待办 {count} 个",
|
|
2411
2413
|
"supervisor.tooltipError": "最近错误:{error}",
|
|
@@ -3099,6 +3101,32 @@ function normalizeSupervisorWorkers(source) {
|
|
|
3099
3101
|
return rows;
|
|
3100
3102
|
}
|
|
3101
3103
|
|
|
3104
|
+
function supervisorTopTick(payload) {
|
|
3105
|
+
const candidates = [payload];
|
|
3106
|
+
for (const key of ["data", "result", "status", "supervisor"]) {
|
|
3107
|
+
if (isRecord(payload) && isRecord(payload[key])) candidates.push(payload[key]);
|
|
3108
|
+
}
|
|
3109
|
+
for (const source of candidates) {
|
|
3110
|
+
if (!isRecord(source)) continue;
|
|
3111
|
+
const tick = asString(source.lastTickAt || source.last_tick_at);
|
|
3112
|
+
if (tick) return tick;
|
|
3113
|
+
}
|
|
3114
|
+
return "";
|
|
3115
|
+
}
|
|
3116
|
+
|
|
3117
|
+
function supervisorHeartbeatAt(rows) {
|
|
3118
|
+
if (!Array.isArray(rows)) return null;
|
|
3119
|
+
const top = parseDate(rows.lastTickAt);
|
|
3120
|
+
if (top) return top;
|
|
3121
|
+
let latest = null;
|
|
3122
|
+
for (const row of rows) {
|
|
3123
|
+
if (!isRecord(row)) continue;
|
|
3124
|
+
const check = parseDate(row.lastCheckAt);
|
|
3125
|
+
if (check && (latest === null || check.getTime() > latest.getTime())) latest = check;
|
|
3126
|
+
}
|
|
3127
|
+
return latest;
|
|
3128
|
+
}
|
|
3129
|
+
|
|
3102
3130
|
function normalizeSupervisorStatus(payload) {
|
|
3103
3131
|
const rows = new Map();
|
|
3104
3132
|
for (const raw of supervisorEntriesFrom(payload)) {
|
|
@@ -3150,12 +3178,14 @@ function normalizeSupervisorStatus(payload) {
|
|
|
3150
3178
|
workers: normalizeSupervisorWorkers(source),
|
|
3151
3179
|
});
|
|
3152
3180
|
}
|
|
3153
|
-
|
|
3181
|
+
const result = [...rows.values()].sort((left, right) => left.repo.localeCompare(right.repo));
|
|
3182
|
+
result.lastTickAt = supervisorTopTick(payload);
|
|
3183
|
+
return result;
|
|
3154
3184
|
}
|
|
3155
3185
|
|
|
3156
3186
|
/**
|
|
3157
3187
|
* Normalize the supervisor's queen cross-repository rejection observability:
|
|
3158
|
-
*
|
|
3188
|
+
* \`crossRepoBlocked\` count + \`lastCrossRepoBlocked { tool, repo, cwd, at }\`.
|
|
3159
3189
|
* Older/newer supervisors may nest it under queen-prefixed or repoScope names.
|
|
3160
3190
|
* @param {unknown} payload - /api/hive-runner?op=status payload.
|
|
3161
3191
|
* @returns {{ count: number, last: { tool: string, repo: string, cwd: string, at: string } | null }}
|
|
@@ -3214,6 +3244,15 @@ function supervisorWorkerCount(row) {
|
|
|
3214
3244
|
return found ? total : null;
|
|
3215
3245
|
}
|
|
3216
3246
|
|
|
3247
|
+
function taskDisplayTitle(title) {
|
|
3248
|
+
const full = asString(title);
|
|
3249
|
+
if (!full) return full;
|
|
3250
|
+
const stripped = full
|
|
3251
|
+
.replace(/^[\w.-]+\/[A-Za-z]?\d+\s*[::]\s*/, "")
|
|
3252
|
+
.replace(/^[A-Za-z]+-\d+\s*[::]\s*/, "");
|
|
3253
|
+
return stripped || full;
|
|
3254
|
+
}
|
|
3255
|
+
|
|
3217
3256
|
function element(doc, tag, className, text) {
|
|
3218
3257
|
const node = doc.createElement(tag);
|
|
3219
3258
|
if (className) node.className = className;
|
|
@@ -6066,10 +6105,10 @@ export function mount(root, options = {}) {
|
|
|
6066
6105
|
? supervisorData.find((entry) => entry.repo === lastModel.repo)
|
|
6067
6106
|
: null;
|
|
6068
6107
|
const now = Date.now();
|
|
6069
|
-
const
|
|
6070
|
-
const fresh =
|
|
6108
|
+
const heartbeat = supervisorHeartbeatAt(supervisorData);
|
|
6109
|
+
const fresh = heartbeat !== null && now - heartbeat.getTime() <= 90_000;
|
|
6071
6110
|
const paused = Boolean(row && (row.paused === true || row.state === "paused"));
|
|
6072
|
-
const status = paused ? "paused" : fresh ? "normal" : "unresponsive";
|
|
6111
|
+
const status = paused ? "paused" : !row ? "unresponsive" : fresh ? "normal" : "unresponsive";
|
|
6073
6112
|
const label =
|
|
6074
6113
|
status === "normal"
|
|
6075
6114
|
? translate("supervisor.normal")
|
|
@@ -6083,11 +6122,12 @@ export function mount(root, options = {}) {
|
|
|
6083
6122
|
supervisorInlineState.textContent = label;
|
|
6084
6123
|
|
|
6085
6124
|
const details = [];
|
|
6086
|
-
if (
|
|
6125
|
+
if (heartbeat) {
|
|
6126
|
+
const hasTopTick = Boolean(supervisorData && parseDate(supervisorData.lastTickAt));
|
|
6087
6127
|
details.push(
|
|
6088
|
-
translate("supervisor.lastCheck").replace(
|
|
6128
|
+
translate(hasTopTick ? "supervisor.lastTick" : "supervisor.lastCheck").replace(
|
|
6089
6129
|
"{seconds}",
|
|
6090
|
-
String(Math.max(0, Math.floor((now -
|
|
6130
|
+
String(Math.max(0, Math.floor((now - heartbeat.getTime()) / 1000))),
|
|
6091
6131
|
),
|
|
6092
6132
|
);
|
|
6093
6133
|
} else {
|
|
@@ -6323,7 +6363,8 @@ export function mount(root, options = {}) {
|
|
|
6323
6363
|
|
|
6324
6364
|
function renderCard(card, lane, existing) {
|
|
6325
6365
|
const node = existing || element(doc, "article", "hive-card");
|
|
6326
|
-
const
|
|
6366
|
+
const fullTitle = card.title || translate("card.untitled");
|
|
6367
|
+
const title = taskDisplayTitle(fullTitle);
|
|
6327
6368
|
if (!existing) {
|
|
6328
6369
|
setAttr(node, "tabindex", "0");
|
|
6329
6370
|
setAttr(node, "role", "button");
|
|
@@ -6341,8 +6382,8 @@ export function mount(root, options = {}) {
|
|
|
6341
6382
|
node._hiveCard = card;
|
|
6342
6383
|
node._hiveLane = lane;
|
|
6343
6384
|
node._hiveTitle.textContent = title;
|
|
6344
|
-
setAttr(node, "aria-label", translate("card.openAria") + " " +
|
|
6345
|
-
setAttr(node, "title",
|
|
6385
|
+
setAttr(node, "aria-label", translate("card.openAria") + " " + fullTitle);
|
|
6386
|
+
setAttr(node, "title", fullTitle);
|
|
6346
6387
|
return node;
|
|
6347
6388
|
}
|
|
6348
6389
|
function renderStageChips(model) {
|