@d86e/hive-panel 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/panel.js +12 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d86e/hive-panel",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A read-only board for a Hive swarm: agents, task lanes and the event tail, served from the refs and files you already have.",
5
5
  "type": "module",
6
6
  "bin": {
package/public/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",
@@ -2348,6 +2350,8 @@ export const messages = Object.freeze({
2348
2350
  "agents.workerStarted": "开始于 {time}",
2349
2351
  "agents.workerElapsed": "已运行 {duration}",
2350
2352
  "agents.technical": "技术详情",
2353
+ "agents.waitingReclaim": "等待回收 {count}",
2354
+ "agents.waitingReclaimTooltip": "有 {count} 个任务被认领但当前没有运行中的工作单元(进程重启后等待回收)",
2351
2355
  "agent.idle": "空闲",
2352
2356
  "agent.task": "任务",
2353
2357
  "agent.unknown": "未知",
@@ -6097,13 +6101,18 @@ export function mount(root, options = {}) {
6097
6101
  const row = currentSupervisorRow();
6098
6102
  const workers = supervisorWorkerCount(row);
6099
6103
  const running = workers !== null ? workers : identities;
6104
+ const claimed = asCount(model.stats.byState.claimed, (model.lanes.claimed || []).length);
6105
+ const waitingToReclaim = workers === 0 && claimed > 0;
6100
6106
  agentsCount.className = "hive-stat hive-agent-count";
6101
- agentsCount.textContent = translate("pane.agents") + " " + String(running);
6107
+ agentsCount.textContent = waitingToReclaim
6108
+ ? translate("agents.waitingReclaim").replace("{count}", String(claimed))
6109
+ : translate("pane.agents") + " " + String(running);
6102
6110
  const first = identities > 0 ? model.agents[0] : null;
6103
6111
  agentsCount._agent = first;
6104
6112
  agentsCount.disabled = false;
6105
- const message =
6106
- workers !== null
6113
+ const message = waitingToReclaim
6114
+ ? translate("agents.waitingReclaimTooltip").replace("{count}", String(claimed))
6115
+ : workers !== null
6107
6116
  ? translate("agents.runningTooltip")
6108
6117
  .replace("{running}", String(running))
6109
6118
  .replace("{identities}", String(identities))