dsh-hive-panel 1.0.6 → 1.0.8
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 +32 -0
- package/lib/client.js +112 -42
- package/package.json +1 -1
- package/src/panel.js +112 -42
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@ 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.8] - 2026-12-05
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Renderer re-synced from hive-panel 1.0.4: card actions are single-flight (buttons
|
|
12
|
+
disabled while an action runs), a failure keeps the dialog open with the error, and
|
|
13
|
+
"not failed" results map to readable copy. Browser bundle rebuilt.
|
|
14
|
+
|
|
15
|
+
### Tests
|
|
16
|
+
|
|
17
|
+
- 41 checks pass, including the synced single-flight card actions and the rebuilt client.
|
|
18
|
+
|
|
19
|
+
## [1.0.7] - 2026-12-05
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- Renderer re-synced from hive-panel 1.0.3: when no worker is live but claimed tasks
|
|
24
|
+
remain, the header count shows "等待回收 N / waiting to reclaim N" with an explanatory
|
|
25
|
+
tooltip instead of implying that nothing is happening. Browser bundle rebuilt.
|
|
26
|
+
|
|
27
|
+
### Tests
|
|
28
|
+
|
|
29
|
+
- 41 checks pass, including the synced waiting-reclaim chip and the rebuilt client.
|
|
30
|
+
|
|
31
|
+
### Published
|
|
32
|
+
|
|
33
|
+
- npm: `dsh-hive-panel@1.0.7` on 2026-12-05.
|
|
34
|
+
|
|
7
35
|
## [1.0.6] - 2026-12-05
|
|
8
36
|
|
|
9
37
|
### Changed
|
|
@@ -16,6 +44,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
16
44
|
|
|
17
45
|
- 41 checks pass, including the synced renderer and the rebuilt client bundle.
|
|
18
46
|
|
|
47
|
+
### Published
|
|
48
|
+
|
|
49
|
+
- npm: `dsh-hive-panel@1.0.6` on 2026-12-05.
|
|
50
|
+
|
|
19
51
|
## [1.0.5] - 2026-12-05
|
|
20
52
|
|
|
21
53
|
### Fixed
|
package/lib/client.js
CHANGED
|
@@ -2172,6 +2172,8 @@ const messages = Object.freeze({
|
|
|
2172
2172
|
"agents.workerStarted": "Started {time}",
|
|
2173
2173
|
"agents.workerElapsed": "Running for {duration}",
|
|
2174
2174
|
"agents.technical": "Technical details",
|
|
2175
|
+
"agents.waitingReclaim": "Waiting to reclaim {count}",
|
|
2176
|
+
"agents.waitingReclaimTooltip": "{count} tasks are claimed but no agent is running (waiting to be reclaimed after a process restart)",
|
|
2175
2177
|
"agent.idle": "idle",
|
|
2176
2178
|
"agent.task": "task",
|
|
2177
2179
|
"agent.unknown": "unknown",
|
|
@@ -2368,6 +2370,9 @@ const messages = Object.freeze({
|
|
|
2368
2370
|
"toast.dismiss": "Dismiss",
|
|
2369
2371
|
"toast.planWritten": "Tasks written",
|
|
2370
2372
|
"toast.taskRemoved": "Task deleted",
|
|
2373
|
+
"action.busy": "Working…",
|
|
2374
|
+
"action.retryNotFailed": "The task is no longer failed; it may have been requeued.",
|
|
2375
|
+
"toast.retryQueued": "Task requeued",
|
|
2371
2376
|
"toast.pickupHint": "The supervisor will pick them up automatically.",
|
|
2372
2377
|
}),
|
|
2373
2378
|
zh: Object.freeze({
|
|
@@ -2421,6 +2426,8 @@ const messages = Object.freeze({
|
|
|
2421
2426
|
"agents.workerStarted": "开始于 {time}",
|
|
2422
2427
|
"agents.workerElapsed": "已运行 {duration}",
|
|
2423
2428
|
"agents.technical": "技术详情",
|
|
2429
|
+
"agents.waitingReclaim": "等待回收 {count}",
|
|
2430
|
+
"agents.waitingReclaimTooltip": "有 {count} 个任务被认领但当前没有运行中的工作单元(进程重启后等待回收)",
|
|
2424
2431
|
"agent.idle": "空闲",
|
|
2425
2432
|
"agent.task": "任务",
|
|
2426
2433
|
"agent.unknown": "未知",
|
|
@@ -2617,6 +2624,9 @@ const messages = Object.freeze({
|
|
|
2617
2624
|
"toast.dismiss": "关闭",
|
|
2618
2625
|
"toast.planWritten": "任务已写入",
|
|
2619
2626
|
"toast.taskRemoved": "任务已删除",
|
|
2627
|
+
"action.busy": "处理中…",
|
|
2628
|
+
"action.retryNotFailed": "任务已不在失败状态,可能已被重新派发",
|
|
2629
|
+
"toast.retryQueued": "已重新入队",
|
|
2620
2630
|
"toast.pickupHint": "supervisor 会自动接任务。",
|
|
2621
2631
|
}),
|
|
2622
2632
|
});
|
|
@@ -3634,6 +3644,8 @@ function mount(root, options = {}) {
|
|
|
3634
3644
|
let drawerNode = null;
|
|
3635
3645
|
let drawerState = null;
|
|
3636
3646
|
let drawerTrigger = null;
|
|
3647
|
+
let drawerActionBusy = false;
|
|
3648
|
+
let drawerActionButtons = [];
|
|
3637
3649
|
let unsubscribeLocale = null;
|
|
3638
3650
|
let statusKey = null;
|
|
3639
3651
|
let statusKind = "info";
|
|
@@ -5262,6 +5274,8 @@ function mount(root, options = {}) {
|
|
|
5262
5274
|
}
|
|
5263
5275
|
drawerNode = null;
|
|
5264
5276
|
drawerState = null;
|
|
5277
|
+
drawerActionBusy = false;
|
|
5278
|
+
drawerActionButtons = [];
|
|
5265
5279
|
if (typeof doc.removeEventListener === "function") {
|
|
5266
5280
|
doc.removeEventListener("keydown", onDrawerKeydown);
|
|
5267
5281
|
}
|
|
@@ -5564,6 +5578,8 @@ function mount(root, options = {}) {
|
|
|
5564
5578
|
),
|
|
5565
5579
|
);
|
|
5566
5580
|
}
|
|
5581
|
+
drawerActionBusy = false;
|
|
5582
|
+
drawerActionButtons = [];
|
|
5567
5583
|
if (runActions.length > 0 || actions.length > 0) {
|
|
5568
5584
|
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
5569
5585
|
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
@@ -5587,8 +5603,14 @@ function mount(root, options = {}) {
|
|
|
5587
5603
|
button.disabled = true;
|
|
5588
5604
|
setAttr(button, "aria-disabled", "true");
|
|
5589
5605
|
}
|
|
5606
|
+
drawerActionButtons.push({
|
|
5607
|
+
button,
|
|
5608
|
+
action: action.name,
|
|
5609
|
+
labelKey: action.labelKey,
|
|
5610
|
+
baseDisabled: button.disabled === true,
|
|
5611
|
+
});
|
|
5590
5612
|
button.addEventListener("click", () => {
|
|
5591
|
-
void runCardAction(action.name, card, lane);
|
|
5613
|
+
void runCardAction(action.name, card, lane, button);
|
|
5592
5614
|
});
|
|
5593
5615
|
foot.appendChild(button);
|
|
5594
5616
|
}
|
|
@@ -5769,50 +5791,93 @@ function mount(root, options = {}) {
|
|
|
5769
5791
|
}
|
|
5770
5792
|
}
|
|
5771
5793
|
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
}
|
|
5782
|
-
case "done": {
|
|
5783
|
-
const sha = ask(translate("prompt.commitSha"), "");
|
|
5784
|
-
if (sha === null) return;
|
|
5785
|
-
const body = { id: card.id };
|
|
5786
|
-
if (sha.trim()) body.sha = sha.trim();
|
|
5787
|
-
ok = await postAction("done", body);
|
|
5788
|
-
break;
|
|
5794
|
+
function setDrawerActionBusy(activeButton, busy) {
|
|
5795
|
+
for (const entry of drawerActionButtons) {
|
|
5796
|
+
if (busy) {
|
|
5797
|
+
entry.button.disabled = true;
|
|
5798
|
+
setAttr(entry.button, "aria-busy", "true");
|
|
5799
|
+
} else {
|
|
5800
|
+
entry.button.disabled = entry.baseDisabled;
|
|
5801
|
+
if (typeof entry.button.removeAttribute === "function") entry.button.removeAttribute("aria-busy");
|
|
5802
|
+
else delete entry.button.attributes["aria-busy"];
|
|
5789
5803
|
}
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5804
|
+
}
|
|
5805
|
+
if (!activeButton) return;
|
|
5806
|
+
if (busy) {
|
|
5807
|
+
activeButton.textContent = translate("action.busy");
|
|
5808
|
+
} else {
|
|
5809
|
+
const entry = drawerActionButtons.find((item) => item.button === activeButton);
|
|
5810
|
+
if (entry) activeButton.textContent = translate(entry.labelKey);
|
|
5811
|
+
}
|
|
5812
|
+
}
|
|
5813
|
+
|
|
5814
|
+
function cardActionErrorMessage(name, error) {
|
|
5815
|
+
const detail = actionErrorDetail(error) || translate("status.actionFailed");
|
|
5816
|
+
if (name === "retry" && /not failed/i.test(detail)) return translate("action.retryNotFailed");
|
|
5817
|
+
return detail;
|
|
5818
|
+
}
|
|
5819
|
+
|
|
5820
|
+
async function runCardAction(name, card, lane, button) {
|
|
5821
|
+
if (destroyed || drawerActionBusy) return;
|
|
5822
|
+
drawerActionBusy = true;
|
|
5823
|
+
setDrawerActionBusy(button, true);
|
|
5824
|
+
try {
|
|
5825
|
+
let body = null;
|
|
5826
|
+
switch (name) {
|
|
5827
|
+
case "claim": {
|
|
5828
|
+
const agent = ask(translate("prompt.claimAgent"), "panel");
|
|
5829
|
+
if (agent === null) return;
|
|
5830
|
+
body = { id: card.id, agent: agent.trim() || "panel" };
|
|
5831
|
+
break;
|
|
5832
|
+
}
|
|
5833
|
+
case "done": {
|
|
5834
|
+
const sha = ask(translate("prompt.commitSha"), "");
|
|
5835
|
+
if (sha === null) return;
|
|
5836
|
+
body = { id: card.id };
|
|
5837
|
+
if (sha.trim()) body.sha = sha.trim();
|
|
5838
|
+
break;
|
|
5839
|
+
}
|
|
5840
|
+
case "fail": {
|
|
5841
|
+
const reason = ask(translate("prompt.failReason"), "");
|
|
5842
|
+
if (reason === null || !reason.trim()) return;
|
|
5843
|
+
body = { id: card.id, reason: reason.trim() };
|
|
5844
|
+
break;
|
|
5845
|
+
}
|
|
5846
|
+
case "retry":
|
|
5847
|
+
case "supersede":
|
|
5848
|
+
body = { id: card.id };
|
|
5849
|
+
break;
|
|
5850
|
+
case "remove": {
|
|
5851
|
+
const title = card.title || card.id || translate("card.untitled");
|
|
5852
|
+
const message = translate("confirm.remove").replace("{title}", title);
|
|
5853
|
+
if (!askConfirm(message)) return;
|
|
5854
|
+
body = { id: card.id };
|
|
5855
|
+
break;
|
|
5856
|
+
}
|
|
5857
|
+
default:
|
|
5858
|
+
return;
|
|
5795
5859
|
}
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5860
|
+
|
|
5861
|
+
const result = await requestAction(name, body);
|
|
5862
|
+
if (!result.ok) {
|
|
5863
|
+
if (!destroyed) {
|
|
5864
|
+
setStatus("status.actionFailed", "error");
|
|
5865
|
+
reportError(result.error);
|
|
5866
|
+
showToast("error", translate("status.actionFailed"), cardActionErrorMessage(name, result.error));
|
|
5867
|
+
}
|
|
5868
|
+
return;
|
|
5805
5869
|
}
|
|
5806
|
-
|
|
5807
|
-
break;
|
|
5808
|
-
}
|
|
5809
|
-
if (ok && !destroyed) {
|
|
5810
|
-
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
5870
|
+
if (destroyed) return;
|
|
5811
5871
|
closeDrawer();
|
|
5812
|
-
|
|
5872
|
+
await forceRefresh();
|
|
5873
|
+
if (destroyed) return;
|
|
5874
|
+
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
5875
|
+
else if (name === "retry") showToast("success", translate("toast.retryQueued"), "");
|
|
5876
|
+
} finally {
|
|
5877
|
+
if (!destroyed && drawerNode) setDrawerActionBusy(button, false);
|
|
5878
|
+
drawerActionBusy = false;
|
|
5813
5879
|
}
|
|
5814
5880
|
}
|
|
5815
|
-
|
|
5816
5881
|
// --- rendering -----------------------------------------------------------
|
|
5817
5882
|
|
|
5818
5883
|
function renderInit(model) {
|
|
@@ -6170,13 +6235,18 @@ function mount(root, options = {}) {
|
|
|
6170
6235
|
const row = currentSupervisorRow();
|
|
6171
6236
|
const workers = supervisorWorkerCount(row);
|
|
6172
6237
|
const running = workers !== null ? workers : identities;
|
|
6238
|
+
const claimed = asCount(model.stats.byState.claimed, (model.lanes.claimed || []).length);
|
|
6239
|
+
const waitingToReclaim = workers === 0 && claimed > 0;
|
|
6173
6240
|
agentsCount.className = "hive-stat hive-agent-count";
|
|
6174
|
-
agentsCount.textContent =
|
|
6241
|
+
agentsCount.textContent = waitingToReclaim
|
|
6242
|
+
? translate("agents.waitingReclaim").replace("{count}", String(claimed))
|
|
6243
|
+
: translate("pane.agents") + " " + String(running);
|
|
6175
6244
|
const first = identities > 0 ? model.agents[0] : null;
|
|
6176
6245
|
agentsCount._agent = first;
|
|
6177
6246
|
agentsCount.disabled = false;
|
|
6178
|
-
const message =
|
|
6179
|
-
|
|
6247
|
+
const message = waitingToReclaim
|
|
6248
|
+
? translate("agents.waitingReclaimTooltip").replace("{count}", String(claimed))
|
|
6249
|
+
: workers !== null
|
|
6180
6250
|
? translate("agents.runningTooltip")
|
|
6181
6251
|
.replace("{running}", String(running))
|
|
6182
6252
|
.replace("{identities}", String(identities))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hive-panel",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
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
|
@@ -2099,6 +2099,8 @@ export const messages = Object.freeze({
|
|
|
2099
2099
|
"agents.workerStarted": "Started {time}",
|
|
2100
2100
|
"agents.workerElapsed": "Running for {duration}",
|
|
2101
2101
|
"agents.technical": "Technical details",
|
|
2102
|
+
"agents.waitingReclaim": "Waiting to reclaim {count}",
|
|
2103
|
+
"agents.waitingReclaimTooltip": "{count} tasks are claimed but no agent is running (waiting to be reclaimed after a process restart)",
|
|
2102
2104
|
"agent.idle": "idle",
|
|
2103
2105
|
"agent.task": "task",
|
|
2104
2106
|
"agent.unknown": "unknown",
|
|
@@ -2295,6 +2297,9 @@ export const messages = Object.freeze({
|
|
|
2295
2297
|
"toast.dismiss": "Dismiss",
|
|
2296
2298
|
"toast.planWritten": "Tasks written",
|
|
2297
2299
|
"toast.taskRemoved": "Task deleted",
|
|
2300
|
+
"action.busy": "Working…",
|
|
2301
|
+
"action.retryNotFailed": "The task is no longer failed; it may have been requeued.",
|
|
2302
|
+
"toast.retryQueued": "Task requeued",
|
|
2298
2303
|
"toast.pickupHint": "The supervisor will pick them up automatically.",
|
|
2299
2304
|
}),
|
|
2300
2305
|
zh: Object.freeze({
|
|
@@ -2348,6 +2353,8 @@ export const messages = Object.freeze({
|
|
|
2348
2353
|
"agents.workerStarted": "开始于 {time}",
|
|
2349
2354
|
"agents.workerElapsed": "已运行 {duration}",
|
|
2350
2355
|
"agents.technical": "技术详情",
|
|
2356
|
+
"agents.waitingReclaim": "等待回收 {count}",
|
|
2357
|
+
"agents.waitingReclaimTooltip": "有 {count} 个任务被认领但当前没有运行中的工作单元(进程重启后等待回收)",
|
|
2351
2358
|
"agent.idle": "空闲",
|
|
2352
2359
|
"agent.task": "任务",
|
|
2353
2360
|
"agent.unknown": "未知",
|
|
@@ -2544,6 +2551,9 @@ export const messages = Object.freeze({
|
|
|
2544
2551
|
"toast.dismiss": "关闭",
|
|
2545
2552
|
"toast.planWritten": "任务已写入",
|
|
2546
2553
|
"toast.taskRemoved": "任务已删除",
|
|
2554
|
+
"action.busy": "处理中…",
|
|
2555
|
+
"action.retryNotFailed": "任务已不在失败状态,可能已被重新派发",
|
|
2556
|
+
"toast.retryQueued": "已重新入队",
|
|
2547
2557
|
"toast.pickupHint": "supervisor 会自动接任务。",
|
|
2548
2558
|
}),
|
|
2549
2559
|
});
|
|
@@ -3561,6 +3571,8 @@ export function mount(root, options = {}) {
|
|
|
3561
3571
|
let drawerNode = null;
|
|
3562
3572
|
let drawerState = null;
|
|
3563
3573
|
let drawerTrigger = null;
|
|
3574
|
+
let drawerActionBusy = false;
|
|
3575
|
+
let drawerActionButtons = [];
|
|
3564
3576
|
let unsubscribeLocale = null;
|
|
3565
3577
|
let statusKey = null;
|
|
3566
3578
|
let statusKind = "info";
|
|
@@ -5189,6 +5201,8 @@ export function mount(root, options = {}) {
|
|
|
5189
5201
|
}
|
|
5190
5202
|
drawerNode = null;
|
|
5191
5203
|
drawerState = null;
|
|
5204
|
+
drawerActionBusy = false;
|
|
5205
|
+
drawerActionButtons = [];
|
|
5192
5206
|
if (typeof doc.removeEventListener === "function") {
|
|
5193
5207
|
doc.removeEventListener("keydown", onDrawerKeydown);
|
|
5194
5208
|
}
|
|
@@ -5491,6 +5505,8 @@ export function mount(root, options = {}) {
|
|
|
5491
5505
|
),
|
|
5492
5506
|
);
|
|
5493
5507
|
}
|
|
5508
|
+
drawerActionBusy = false;
|
|
5509
|
+
drawerActionButtons = [];
|
|
5494
5510
|
if (runActions.length > 0 || actions.length > 0) {
|
|
5495
5511
|
const foot = element(doc, "div", "hive-dialog-foot hive-card-actions");
|
|
5496
5512
|
setAttr(foot, "aria-label", translate("drawer.cardActions"));
|
|
@@ -5514,8 +5530,14 @@ export function mount(root, options = {}) {
|
|
|
5514
5530
|
button.disabled = true;
|
|
5515
5531
|
setAttr(button, "aria-disabled", "true");
|
|
5516
5532
|
}
|
|
5533
|
+
drawerActionButtons.push({
|
|
5534
|
+
button,
|
|
5535
|
+
action: action.name,
|
|
5536
|
+
labelKey: action.labelKey,
|
|
5537
|
+
baseDisabled: button.disabled === true,
|
|
5538
|
+
});
|
|
5517
5539
|
button.addEventListener("click", () => {
|
|
5518
|
-
void runCardAction(action.name, card, lane);
|
|
5540
|
+
void runCardAction(action.name, card, lane, button);
|
|
5519
5541
|
});
|
|
5520
5542
|
foot.appendChild(button);
|
|
5521
5543
|
}
|
|
@@ -5696,50 +5718,93 @@ export function mount(root, options = {}) {
|
|
|
5696
5718
|
}
|
|
5697
5719
|
}
|
|
5698
5720
|
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
}
|
|
5709
|
-
case "done": {
|
|
5710
|
-
const sha = ask(translate("prompt.commitSha"), "");
|
|
5711
|
-
if (sha === null) return;
|
|
5712
|
-
const body = { id: card.id };
|
|
5713
|
-
if (sha.trim()) body.sha = sha.trim();
|
|
5714
|
-
ok = await postAction("done", body);
|
|
5715
|
-
break;
|
|
5721
|
+
function setDrawerActionBusy(activeButton, busy) {
|
|
5722
|
+
for (const entry of drawerActionButtons) {
|
|
5723
|
+
if (busy) {
|
|
5724
|
+
entry.button.disabled = true;
|
|
5725
|
+
setAttr(entry.button, "aria-busy", "true");
|
|
5726
|
+
} else {
|
|
5727
|
+
entry.button.disabled = entry.baseDisabled;
|
|
5728
|
+
if (typeof entry.button.removeAttribute === "function") entry.button.removeAttribute("aria-busy");
|
|
5729
|
+
else delete entry.button.attributes["aria-busy"];
|
|
5716
5730
|
}
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5731
|
+
}
|
|
5732
|
+
if (!activeButton) return;
|
|
5733
|
+
if (busy) {
|
|
5734
|
+
activeButton.textContent = translate("action.busy");
|
|
5735
|
+
} else {
|
|
5736
|
+
const entry = drawerActionButtons.find((item) => item.button === activeButton);
|
|
5737
|
+
if (entry) activeButton.textContent = translate(entry.labelKey);
|
|
5738
|
+
}
|
|
5739
|
+
}
|
|
5740
|
+
|
|
5741
|
+
function cardActionErrorMessage(name, error) {
|
|
5742
|
+
const detail = actionErrorDetail(error) || translate("status.actionFailed");
|
|
5743
|
+
if (name === "retry" && /not failed/i.test(detail)) return translate("action.retryNotFailed");
|
|
5744
|
+
return detail;
|
|
5745
|
+
}
|
|
5746
|
+
|
|
5747
|
+
async function runCardAction(name, card, lane, button) {
|
|
5748
|
+
if (destroyed || drawerActionBusy) return;
|
|
5749
|
+
drawerActionBusy = true;
|
|
5750
|
+
setDrawerActionBusy(button, true);
|
|
5751
|
+
try {
|
|
5752
|
+
let body = null;
|
|
5753
|
+
switch (name) {
|
|
5754
|
+
case "claim": {
|
|
5755
|
+
const agent = ask(translate("prompt.claimAgent"), "panel");
|
|
5756
|
+
if (agent === null) return;
|
|
5757
|
+
body = { id: card.id, agent: agent.trim() || "panel" };
|
|
5758
|
+
break;
|
|
5759
|
+
}
|
|
5760
|
+
case "done": {
|
|
5761
|
+
const sha = ask(translate("prompt.commitSha"), "");
|
|
5762
|
+
if (sha === null) return;
|
|
5763
|
+
body = { id: card.id };
|
|
5764
|
+
if (sha.trim()) body.sha = sha.trim();
|
|
5765
|
+
break;
|
|
5766
|
+
}
|
|
5767
|
+
case "fail": {
|
|
5768
|
+
const reason = ask(translate("prompt.failReason"), "");
|
|
5769
|
+
if (reason === null || !reason.trim()) return;
|
|
5770
|
+
body = { id: card.id, reason: reason.trim() };
|
|
5771
|
+
break;
|
|
5772
|
+
}
|
|
5773
|
+
case "retry":
|
|
5774
|
+
case "supersede":
|
|
5775
|
+
body = { id: card.id };
|
|
5776
|
+
break;
|
|
5777
|
+
case "remove": {
|
|
5778
|
+
const title = card.title || card.id || translate("card.untitled");
|
|
5779
|
+
const message = translate("confirm.remove").replace("{title}", title);
|
|
5780
|
+
if (!askConfirm(message)) return;
|
|
5781
|
+
body = { id: card.id };
|
|
5782
|
+
break;
|
|
5783
|
+
}
|
|
5784
|
+
default:
|
|
5785
|
+
return;
|
|
5722
5786
|
}
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5787
|
+
|
|
5788
|
+
const result = await requestAction(name, body);
|
|
5789
|
+
if (!result.ok) {
|
|
5790
|
+
if (!destroyed) {
|
|
5791
|
+
setStatus("status.actionFailed", "error");
|
|
5792
|
+
reportError(result.error);
|
|
5793
|
+
showToast("error", translate("status.actionFailed"), cardActionErrorMessage(name, result.error));
|
|
5794
|
+
}
|
|
5795
|
+
return;
|
|
5732
5796
|
}
|
|
5733
|
-
|
|
5734
|
-
break;
|
|
5735
|
-
}
|
|
5736
|
-
if (ok && !destroyed) {
|
|
5737
|
-
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
5797
|
+
if (destroyed) return;
|
|
5738
5798
|
closeDrawer();
|
|
5739
|
-
|
|
5799
|
+
await forceRefresh();
|
|
5800
|
+
if (destroyed) return;
|
|
5801
|
+
if (name === "remove") showToast("success", translate("toast.taskRemoved"), "");
|
|
5802
|
+
else if (name === "retry") showToast("success", translate("toast.retryQueued"), "");
|
|
5803
|
+
} finally {
|
|
5804
|
+
if (!destroyed && drawerNode) setDrawerActionBusy(button, false);
|
|
5805
|
+
drawerActionBusy = false;
|
|
5740
5806
|
}
|
|
5741
5807
|
}
|
|
5742
|
-
|
|
5743
5808
|
// --- rendering -----------------------------------------------------------
|
|
5744
5809
|
|
|
5745
5810
|
function renderInit(model) {
|
|
@@ -6097,13 +6162,18 @@ export function mount(root, options = {}) {
|
|
|
6097
6162
|
const row = currentSupervisorRow();
|
|
6098
6163
|
const workers = supervisorWorkerCount(row);
|
|
6099
6164
|
const running = workers !== null ? workers : identities;
|
|
6165
|
+
const claimed = asCount(model.stats.byState.claimed, (model.lanes.claimed || []).length);
|
|
6166
|
+
const waitingToReclaim = workers === 0 && claimed > 0;
|
|
6100
6167
|
agentsCount.className = "hive-stat hive-agent-count";
|
|
6101
|
-
agentsCount.textContent =
|
|
6168
|
+
agentsCount.textContent = waitingToReclaim
|
|
6169
|
+
? translate("agents.waitingReclaim").replace("{count}", String(claimed))
|
|
6170
|
+
: translate("pane.agents") + " " + String(running);
|
|
6102
6171
|
const first = identities > 0 ? model.agents[0] : null;
|
|
6103
6172
|
agentsCount._agent = first;
|
|
6104
6173
|
agentsCount.disabled = false;
|
|
6105
|
-
const message =
|
|
6106
|
-
|
|
6174
|
+
const message = waitingToReclaim
|
|
6175
|
+
? translate("agents.waitingReclaimTooltip").replace("{count}", String(claimed))
|
|
6176
|
+
: workers !== null
|
|
6107
6177
|
? translate("agents.runningTooltip")
|
|
6108
6178
|
.replace("{running}", String(running))
|
|
6109
6179
|
.replace("{identities}", String(identities))
|