dsh-hive-panel 0.1.2 → 0.1.4
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 +23 -0
- package/lib/client.js +115 -60
- package/package.json +1 -1
- package/src/panel.js +115 -60
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
+
## [0.1.4] - 2026-12-04
|
|
2
|
+
|
|
3
|
+
### Changed
|
|
4
|
+
|
|
5
|
+
- The queen notice can be dismissed permanently per repository (kept in the browser's
|
|
6
|
+
localStorage); the notice no longer carries a `/queen off` button, and the exit
|
|
7
|
+
instructions moved into the view's `...` menu. Browser bundle rebuilt.
|
|
8
|
+
|
|
1
9
|
# Changelog
|
|
2
10
|
|
|
3
11
|
All notable changes to this project are documented in this file. The format is
|
|
4
12
|
based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and this project
|
|
5
13
|
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
14
|
|
|
15
|
+
## [0.1.3] - 2026-12-04
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- Chinese terminology synced with the final standalone-panel wording: agents are 智能体,
|
|
20
|
+
workers are Agent in English; queen stays 女王. Browser bundle rebuilt.
|
|
21
|
+
|
|
22
|
+
### Published
|
|
23
|
+
|
|
24
|
+
- npm: `dsh-hive-panel@0.1.3` on 2026-12-04.
|
|
25
|
+
|
|
7
26
|
## [0.1.2] - 2026-12-04
|
|
8
27
|
|
|
9
28
|
### Fixed
|
|
@@ -11,6 +30,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
11
30
|
- Chinese terminology: the queen is labelled 女王 again and worker labels stay 工蜂;
|
|
12
31
|
the browser bundle was rebuilt so the tab matches the standalone panel wording.
|
|
13
32
|
|
|
33
|
+
### Published
|
|
34
|
+
|
|
35
|
+
- npm: `dsh-hive-panel@0.1.2` on 2026-12-04.
|
|
36
|
+
|
|
14
37
|
## [0.1.1] - 2026-12-04
|
|
15
38
|
|
|
16
39
|
### Added
|
package/lib/client.js
CHANGED
|
@@ -37,6 +37,7 @@ const MAX_EVENTS = 80;
|
|
|
37
37
|
const DEFAULT_SNAPSHOT_URL = "/api/snapshot";
|
|
38
38
|
const DEFAULT_ACTIONS_URL = "/api/actions";
|
|
39
39
|
const DEFAULT_SUPERVISOR_URL = "/api/hive-runner";
|
|
40
|
+
const QUEEN_DISMISS_KEY = "hive.queenNoticeDismissed";
|
|
40
41
|
const DEFAULT_INTERVAL_MS = 3000;
|
|
41
42
|
|
|
42
43
|
const CARD_ACTIONS = Object.freeze({
|
|
@@ -719,8 +720,9 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
719
720
|
.hive-queen-hint {
|
|
720
721
|
display: none;
|
|
721
722
|
flex: 0 0 auto;
|
|
722
|
-
|
|
723
|
-
|
|
723
|
+
align-items: flex-start;
|
|
724
|
+
flex-direction: row;
|
|
725
|
+
gap: 8px;
|
|
724
726
|
padding: 10px 16px;
|
|
725
727
|
border-bottom: 1px solid color-mix(in srgb, var(--hive-accent, #58c4dc) 32%, var(--hive-line, #232b38));
|
|
726
728
|
background: var(--hive-accent-soft);
|
|
@@ -762,6 +764,14 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
762
764
|
color: var(--hive-fg-soft);
|
|
763
765
|
}
|
|
764
766
|
|
|
767
|
+
.hive-queen-body {
|
|
768
|
+
display: flex;
|
|
769
|
+
flex: 1 1 auto;
|
|
770
|
+
flex-direction: column;
|
|
771
|
+
gap: 4px;
|
|
772
|
+
min-width: 0;
|
|
773
|
+
}
|
|
774
|
+
|
|
765
775
|
.hive-queen-offer {
|
|
766
776
|
display: flex;
|
|
767
777
|
flex-wrap: wrap;
|
|
@@ -770,8 +780,18 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
770
780
|
max-width: 76ch;
|
|
771
781
|
}
|
|
772
782
|
|
|
773
|
-
.hive-queen-offer.is-hidden
|
|
774
|
-
|
|
783
|
+
.hive-queen-offer.is-hidden { display: none; }
|
|
784
|
+
|
|
785
|
+
.hive-queen-dismiss {
|
|
786
|
+
flex: 0 0 auto;
|
|
787
|
+
min-width: 24px;
|
|
788
|
+
padding: 0 6px;
|
|
789
|
+
color: var(--hive-fg-soft);
|
|
790
|
+
font-size: 16px;
|
|
791
|
+
line-height: 1.4;
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
.hive-queen-dismiss.is-hidden { display: none; }
|
|
775
795
|
|
|
776
796
|
.hive-queen-takeover {
|
|
777
797
|
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 45%, var(--hive-line, #232b38));
|
|
@@ -791,28 +811,6 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
791
811
|
overflow-wrap: anywhere;
|
|
792
812
|
}
|
|
793
813
|
|
|
794
|
-
.hive-queen-exit {
|
|
795
|
-
display: flex;
|
|
796
|
-
flex-wrap: wrap;
|
|
797
|
-
align-items: baseline;
|
|
798
|
-
gap: 5px;
|
|
799
|
-
max-width: 76ch;
|
|
800
|
-
color: color-mix(in srgb, var(--hive-accent, #58c4dc) 80%, var(--hive-fg, #e6edf3));
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
.hive-queen-command {
|
|
804
|
-
padding: 1px 6px;
|
|
805
|
-
border: 1px solid color-mix(in srgb, var(--hive-accent, #58c4dc) 30%, var(--hive-line, #232b38));
|
|
806
|
-
border-radius: 4px;
|
|
807
|
-
background: color-mix(in srgb, var(--hive-fg, #e6edf3) 10%, transparent);
|
|
808
|
-
color: var(--hive-fg, #e6edf3);
|
|
809
|
-
font-family: var(--hive-mono);
|
|
810
|
-
font-size: 10px;
|
|
811
|
-
line-height: 1.5;
|
|
812
|
-
cursor: text;
|
|
813
|
-
user-select: text;
|
|
814
|
-
}
|
|
815
|
-
|
|
816
814
|
.hive-queen-output {
|
|
817
815
|
margin-top: 6px;
|
|
818
816
|
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 32%, var(--hive-line, #232b38));
|
|
@@ -1072,8 +1070,7 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1072
1070
|
.hive-plan-hint,
|
|
1073
1071
|
.hive-limits-description,
|
|
1074
1072
|
.hive-limits-hint,
|
|
1075
|
-
.hive-queen-text
|
|
1076
|
-
.hive-queen-exit { max-width: 76ch; line-height: 1.55; }
|
|
1073
|
+
.hive-queen-text { max-width: 76ch; line-height: 1.55; }
|
|
1077
1074
|
|
|
1078
1075
|
.hive-empty,
|
|
1079
1076
|
.hive-filter-empty,
|
|
@@ -1162,7 +1159,7 @@ const messages = Object.freeze({
|
|
|
1162
1159
|
"action.modeTitle": "Toggle board mode",
|
|
1163
1160
|
"action.retry": "retry",
|
|
1164
1161
|
"action.unfreeze": "unfreeze",
|
|
1165
|
-
"pane.agents": "
|
|
1162
|
+
"pane.agents": "agents",
|
|
1166
1163
|
"pane.board": "board",
|
|
1167
1164
|
"pane.events": "events",
|
|
1168
1165
|
"board.hint": "5 lanes",
|
|
@@ -1194,8 +1191,8 @@ const messages = Object.freeze({
|
|
|
1194
1191
|
"stats.byRoleTitle": "by role: ",
|
|
1195
1192
|
"status.actionFailed": "action failed",
|
|
1196
1193
|
"status.disconnected": "disconnected",
|
|
1197
|
-
"agents.empty": "No
|
|
1198
|
-
"agents.openAria": "Open
|
|
1194
|
+
"agents.empty": "No agents yet.",
|
|
1195
|
+
"agents.openAria": "Open agent",
|
|
1199
1196
|
"agent.idle": "idle",
|
|
1200
1197
|
"agent.task": "task",
|
|
1201
1198
|
"agent.unknown": "unknown",
|
|
@@ -1252,7 +1249,7 @@ const messages = Object.freeze({
|
|
|
1252
1249
|
"prompt.after": "After task ids (comma separated, optional)",
|
|
1253
1250
|
"prompt.commitMessage": "Commit message",
|
|
1254
1251
|
"prompt.paths": "Paths (comma separated, optional)",
|
|
1255
|
-
"prompt.claimAgent": "Claim as
|
|
1252
|
+
"prompt.claimAgent": "Claim as agent",
|
|
1256
1253
|
"prompt.commitSha": "Commit sha (optional)",
|
|
1257
1254
|
"prompt.failReason": "Failure reason",
|
|
1258
1255
|
"action.plan": "Give the Queen a goal",
|
|
@@ -1279,9 +1276,11 @@ const messages = Object.freeze({
|
|
|
1279
1276
|
"init.output": "stdout",
|
|
1280
1277
|
"init.noOutput": "(no output)",
|
|
1281
1278
|
"init.queen": "This session's input now routes to the Queen (it splits tasks, it does not do the work).",
|
|
1282
|
-
"init.queenExit": "Exit from the chat window:",
|
|
1283
|
-
"init.queenCommand": "/queen off",
|
|
1284
1279
|
"init.queenOutput": "Initialisation output",
|
|
1280
|
+
"queen.dismiss": "Dismiss",
|
|
1281
|
+
"queen.dismissAria": "Dismiss the Queen notice for this repository",
|
|
1282
|
+
"help.queen": "Queen mode",
|
|
1283
|
+
"help.queenDesc": "Type /queen off to exit. After exiting, this session returns to normal coding mode. Hiding the notice does not change Queen mode.",
|
|
1285
1284
|
"queen.status.active": "Queen active",
|
|
1286
1285
|
"queen.status.inactive": "Queen not active",
|
|
1287
1286
|
"queen.source.auto": "auto",
|
|
@@ -1294,11 +1293,11 @@ const messages = Object.freeze({
|
|
|
1294
1293
|
"queen.takeoverBusy": "Taking over...",
|
|
1295
1294
|
"help.hint": "Open a task to see the actions for that task.",
|
|
1296
1295
|
"help.action.freeze": "Freeze: nobody can claim new tasks except tasks tagged fix.",
|
|
1297
|
-
"help.action.unfreeze": "Unfreeze:
|
|
1296
|
+
"help.action.unfreeze": "Unfreeze: agents can claim pending tasks again.",
|
|
1298
1297
|
"help.action.add": "New task: create a pending task with a role and file scope.",
|
|
1299
1298
|
"help.action.plan": "Give the Queen a goal: split a goal into tasks, preview the plan, then write it to the board.",
|
|
1300
1299
|
"help.action.commit": "Commit: commit the selected paths with a message.",
|
|
1301
|
-
"help.action.claim": "Claim: lease a pending task for
|
|
1300
|
+
"help.action.claim": "Claim: lease a pending task for an agent.",
|
|
1302
1301
|
"help.action.done": "Done: mark a claimed task complete, optionally with a commit sha.",
|
|
1303
1302
|
"help.action.fail": "Fail: mark a claimed task failed and record the reason.",
|
|
1304
1303
|
"help.action.retry": "Retry: put a failed or blocked task back in the queue.",
|
|
@@ -1306,7 +1305,7 @@ const messages = Object.freeze({
|
|
|
1306
1305
|
"help.params.add": "title, role, scope[], after[]",
|
|
1307
1306
|
"help.params.plan": "goal, maxCards",
|
|
1308
1307
|
"help.params.commit": "message, set[]",
|
|
1309
|
-
"help.params.claim": "id,
|
|
1308
|
+
"help.params.claim": "id, agent",
|
|
1310
1309
|
"help.params.done": "id, sha?",
|
|
1311
1310
|
"help.params.fail": "id, reason",
|
|
1312
1311
|
"help.params.retry": "id",
|
|
@@ -1357,7 +1356,7 @@ const messages = Object.freeze({
|
|
|
1357
1356
|
"action.modeTitle": "切换看板模式",
|
|
1358
1357
|
"action.retry": "重试",
|
|
1359
1358
|
"action.unfreeze": "解冻",
|
|
1360
|
-
"pane.agents": "
|
|
1359
|
+
"pane.agents": "智能体",
|
|
1361
1360
|
"pane.board": "任务",
|
|
1362
1361
|
"pane.events": "事件",
|
|
1363
1362
|
"board.hint": "5 条泳道",
|
|
@@ -1389,8 +1388,8 @@ const messages = Object.freeze({
|
|
|
1389
1388
|
"stats.byRoleTitle": "按角色:",
|
|
1390
1389
|
"status.actionFailed": "操作失败",
|
|
1391
1390
|
"status.disconnected": "连接断开",
|
|
1392
|
-
"agents.empty": "
|
|
1393
|
-
"agents.openAria": "
|
|
1391
|
+
"agents.empty": "后台暂无智能体。",
|
|
1392
|
+
"agents.openAria": "打开智能体",
|
|
1394
1393
|
"agent.idle": "空闲",
|
|
1395
1394
|
"agent.task": "任务",
|
|
1396
1395
|
"agent.unknown": "未知",
|
|
@@ -1447,7 +1446,7 @@ const messages = Object.freeze({
|
|
|
1447
1446
|
"prompt.after": "排在哪些任务之后(任务 ID,逗号分隔,可选)",
|
|
1448
1447
|
"prompt.commitMessage": "提交信息",
|
|
1449
1448
|
"prompt.paths": "路径(逗号分隔,可选)",
|
|
1450
|
-
"prompt.claimAgent": "
|
|
1449
|
+
"prompt.claimAgent": "以哪个智能体认领",
|
|
1451
1450
|
"prompt.commitSha": "提交 SHA(可选)",
|
|
1452
1451
|
"prompt.failReason": "失败原因",
|
|
1453
1452
|
"action.plan": "给女王下目标",
|
|
@@ -1474,9 +1473,11 @@ const messages = Object.freeze({
|
|
|
1474
1473
|
"init.output": "标准输出",
|
|
1475
1474
|
"init.noOutput": "(无输出)",
|
|
1476
1475
|
"init.queen": "本会话输入框已接入女王模式(女王只拆解任务,不亲自干活)。",
|
|
1477
|
-
"init.queenExit": "退出请在聊天窗口输入:",
|
|
1478
|
-
"init.queenCommand": "/queen off",
|
|
1479
1476
|
"init.queenOutput": "初始化输出",
|
|
1477
|
+
"queen.dismiss": "关闭提示",
|
|
1478
|
+
"queen.dismissAria": "关闭这个仓库的女王提示",
|
|
1479
|
+
"help.queen": "女王模式",
|
|
1480
|
+
"help.queenDesc": "输入 /queen off 退出,退出后本会话恢复普通编码模式;关闭提示不影响女王状态。",
|
|
1480
1481
|
"queen.status.active": "女王已接管",
|
|
1481
1482
|
"queen.status.inactive": "女王未接管",
|
|
1482
1483
|
"queen.source.auto": "自动",
|
|
@@ -1489,11 +1490,11 @@ const messages = Object.freeze({
|
|
|
1489
1490
|
"queen.takeoverBusy": "正在接管…",
|
|
1490
1491
|
"help.hint": "点开任务可查看该任务自己的操作。",
|
|
1491
1492
|
"help.action.freeze": "冻结:除带 fix 标签的任务外,任何人都不再能认领新任务。",
|
|
1492
|
-
"help.action.unfreeze": "
|
|
1493
|
+
"help.action.unfreeze": "解冻:恢复认领,智能体可以继续接取待办任务。",
|
|
1493
1494
|
"help.action.add": "新建任务:添加一条带角色和文件范围的待办任务。",
|
|
1494
1495
|
"help.action.plan": "给女王下目标:让女王把目标拆成任务计划,预览后再写入看板。",
|
|
1495
1496
|
"help.action.commit": "提交:按提交信息提交选中的路径。",
|
|
1496
|
-
"help.action.claim": "
|
|
1497
|
+
"help.action.claim": "认领:以某个智能体的名义短期租下这条待办任务。",
|
|
1497
1498
|
"help.action.done": "完成:把已认领的任务标为完成,可选填写提交 SHA。",
|
|
1498
1499
|
"help.action.fail": "标记失败:把已认领的任务标为失败,并写明原因。",
|
|
1499
1500
|
"help.action.retry": "重试:把失败或受阻的任务放回队列。",
|
|
@@ -1501,7 +1502,7 @@ const messages = Object.freeze({
|
|
|
1501
1502
|
"help.params.add": "title、role、scope[]、after[]",
|
|
1502
1503
|
"help.params.plan": "goal、maxCards",
|
|
1503
1504
|
"help.params.commit": "message、set[]",
|
|
1504
|
-
"help.params.claim": "id
|
|
1505
|
+
"help.params.claim": "id、智能体",
|
|
1505
1506
|
"help.params.done": "id、sha?",
|
|
1506
1507
|
"help.params.fail": "id、reason",
|
|
1507
1508
|
"help.params.retry": "id",
|
|
@@ -2288,6 +2289,7 @@ function mount(root, options = {}) {
|
|
|
2288
2289
|
let initRequestSeq = 0;
|
|
2289
2290
|
let queenNotice = false;
|
|
2290
2291
|
let queenBusy = false;
|
|
2292
|
+
const queenDismissedFallback = new Set();
|
|
2291
2293
|
let supervisorData = [];
|
|
2292
2294
|
let supervisorRequest = null;
|
|
2293
2295
|
let limitsOverlay = null;
|
|
@@ -2352,15 +2354,11 @@ function mount(root, options = {}) {
|
|
|
2352
2354
|
|
|
2353
2355
|
const freezeSlot = element(doc, "div", "hive-freeze-slot");
|
|
2354
2356
|
|
|
2355
|
-
// Queen-mode notice,
|
|
2357
|
+
// Queen-mode notice, driven by snapshot.queen.
|
|
2356
2358
|
const queenHint = element(doc, "section", "hive-queen-hint");
|
|
2357
2359
|
setAttr(queenHint, "role", "status");
|
|
2360
|
+
const queenBody = element(doc, "div", "hive-queen-body");
|
|
2358
2361
|
const queenHintText = element(doc, "div", "hive-queen-text", "");
|
|
2359
|
-
const queenExit = element(doc, "div", "hive-queen-exit");
|
|
2360
|
-
const queenExitText = element(doc, "span", "hive-queen-exit-text", "");
|
|
2361
|
-
const queenCommand = element(doc, "code", "hive-queen-command", "");
|
|
2362
|
-
queenExit.appendChild(queenExitText);
|
|
2363
|
-
queenExit.appendChild(queenCommand);
|
|
2364
2362
|
const queenOffer = element(doc, "div", "hive-queen-offer is-hidden");
|
|
2365
2363
|
const queenTakeoverButton = element(doc, "button", "hive-btn hive-queen-takeover", translate("queen.takeover"));
|
|
2366
2364
|
setAttr(queenTakeoverButton, "type", "button");
|
|
@@ -2375,10 +2373,18 @@ function mount(root, options = {}) {
|
|
|
2375
2373
|
const queenOutputPre = element(doc, "pre", "hive-output-pre", "");
|
|
2376
2374
|
queenOutputDetails.appendChild(queenOutputSummary);
|
|
2377
2375
|
queenOutputDetails.appendChild(queenOutputPre);
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2376
|
+
queenBody.appendChild(queenHintText);
|
|
2377
|
+
queenBody.appendChild(queenOffer);
|
|
2378
|
+
queenBody.appendChild(queenOutputDetails);
|
|
2379
|
+
const queenDismissButton = element(doc, "button", "hive-btn hive-btn-ghost hive-queen-dismiss is-hidden", "×");
|
|
2380
|
+
setAttr(queenDismissButton, "type", "button");
|
|
2381
|
+
setAttr(queenDismissButton, "title", translate("queen.dismissAria"));
|
|
2382
|
+
setAttr(queenDismissButton, "aria-label", translate("queen.dismissAria"));
|
|
2383
|
+
queenDismissButton.addEventListener("click", () => {
|
|
2384
|
+
dismissQueenNotice();
|
|
2385
|
+
});
|
|
2386
|
+
queenHint.appendChild(queenBody);
|
|
2387
|
+
queenHint.appendChild(queenDismissButton);
|
|
2382
2388
|
|
|
2383
2389
|
const main = element(doc, "main", "hive-main");
|
|
2384
2390
|
|
|
@@ -2624,6 +2630,8 @@ function mount(root, options = {}) {
|
|
|
2624
2630
|
body.appendChild(item);
|
|
2625
2631
|
}
|
|
2626
2632
|
}
|
|
2633
|
+
body.appendChild(element(doc, "div", "hive-help-section", translate("help.queen")));
|
|
2634
|
+
body.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
|
|
2627
2635
|
body.appendChild(element(doc, "div", "hive-help-hint", translate("help.hint")));
|
|
2628
2636
|
}
|
|
2629
2637
|
|
|
@@ -3692,11 +3700,57 @@ function mount(root, options = {}) {
|
|
|
3692
3700
|
initOutputPre.textContent = initOutput && initOutput.stdout ? initOutput.stdout : translate("init.noOutput");
|
|
3693
3701
|
}
|
|
3694
3702
|
|
|
3703
|
+
function queenStorage() {
|
|
3704
|
+
try {
|
|
3705
|
+
const storage = view && view.localStorage;
|
|
3706
|
+
if (storage && typeof storage.getItem === "function" && typeof storage.setItem === "function") {
|
|
3707
|
+
return storage;
|
|
3708
|
+
}
|
|
3709
|
+
} catch {
|
|
3710
|
+
// A blocked localStorage must not break the panel.
|
|
3711
|
+
}
|
|
3712
|
+
return null;
|
|
3713
|
+
}
|
|
3714
|
+
|
|
3715
|
+
function queenDismissStorageKey(repo) {
|
|
3716
|
+
return QUEEN_DISMISS_KEY + "=" + repo;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
function isQueenNoticeDismissed(repo) {
|
|
3720
|
+
if (!repo) return false;
|
|
3721
|
+
if (queenDismissedFallback.has(repo)) return true;
|
|
3722
|
+
const storage = queenStorage();
|
|
3723
|
+
if (!storage) return false;
|
|
3724
|
+
try {
|
|
3725
|
+
if (storage.getItem(queenDismissStorageKey(repo)) !== null) return true;
|
|
3726
|
+
return storage.getItem(QUEEN_DISMISS_KEY) === repo;
|
|
3727
|
+
} catch {
|
|
3728
|
+
return false;
|
|
3729
|
+
}
|
|
3730
|
+
}
|
|
3731
|
+
|
|
3732
|
+
function dismissQueenNotice() {
|
|
3733
|
+
const repo = lastModel ? lastModel.repo : "";
|
|
3734
|
+
if (!repo) return;
|
|
3735
|
+
queenDismissedFallback.add(repo);
|
|
3736
|
+
const storage = queenStorage();
|
|
3737
|
+
if (storage) {
|
|
3738
|
+
try {
|
|
3739
|
+
storage.setItem(queenDismissStorageKey(repo), "1");
|
|
3740
|
+
storage.setItem(QUEEN_DISMISS_KEY, repo);
|
|
3741
|
+
} catch {
|
|
3742
|
+
// The in-memory fallback above still hides it for this mount.
|
|
3743
|
+
}
|
|
3744
|
+
}
|
|
3745
|
+
if (!destroyed && lastModel) renderQueenHint(lastModel);
|
|
3746
|
+
}
|
|
3747
|
+
|
|
3695
3748
|
function renderQueenHint(model) {
|
|
3696
3749
|
const initialised = Boolean(model && model.initialised !== false);
|
|
3697
3750
|
const state = model && isRecord(model.queen) ? model.queen : null;
|
|
3698
3751
|
const active = state ? state.active === true : Boolean(queenNotice);
|
|
3699
|
-
const
|
|
3752
|
+
const dismissed = active && isQueenNoticeDismissed(model ? model.repo : "");
|
|
3753
|
+
const show = initialised && Boolean(state || queenNotice) && !dismissed;
|
|
3700
3754
|
const offer = show && !active;
|
|
3701
3755
|
|
|
3702
3756
|
if (initialised && state) {
|
|
@@ -3725,15 +3779,16 @@ function mount(root, options = {}) {
|
|
|
3725
3779
|
queenHint.className = "hive-queen-hint" + (show ? " is-visible" : "") + (offer ? " is-offer" : "");
|
|
3726
3780
|
queenHintText.textContent = active ? translate("init.queen") : translate("queen.offer");
|
|
3727
3781
|
queenOffer.className = "hive-queen-offer" + (offer ? "" : " is-hidden");
|
|
3782
|
+
queenDismissButton.className =
|
|
3783
|
+
"hive-btn hive-btn-ghost hive-queen-dismiss" + (active && show ? "" : " is-hidden");
|
|
3784
|
+
setAttr(queenDismissButton, "title", translate("queen.dismissAria"));
|
|
3785
|
+
setAttr(queenDismissButton, "aria-label", translate("queen.dismissAria"));
|
|
3728
3786
|
queenTakeoverButton.disabled = queenBusy;
|
|
3729
3787
|
queenTakeoverButton.textContent = queenBusy ? translate("queen.takeoverBusy") : translate("queen.takeover");
|
|
3730
3788
|
const takeoverAria = queenBusy ? translate("queen.takeoverBusy") : translate("queen.takeoverAria");
|
|
3731
3789
|
setAttr(queenTakeoverButton, "title", takeoverAria);
|
|
3732
3790
|
setAttr(queenTakeoverButton, "aria-label", takeoverAria);
|
|
3733
3791
|
|
|
3734
|
-
queenExit.className = "hive-queen-exit" + (active ? "" : " is-hidden");
|
|
3735
|
-
queenExitText.textContent = translate("init.queenExit");
|
|
3736
|
-
queenCommand.textContent = translate("init.queenCommand");
|
|
3737
3792
|
queenOutputSummary.textContent = translate("init.queenOutput");
|
|
3738
3793
|
setAttr(queenOutputSummary, "title", translate("init.queenOutput"));
|
|
3739
3794
|
const output = initOutput && initOutput.stdout ? initOutput.stdout : translate("init.noOutput");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-hive-panel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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
|
@@ -10,6 +10,7 @@ const MAX_EVENTS = 80;
|
|
|
10
10
|
const DEFAULT_SNAPSHOT_URL = "/api/snapshot";
|
|
11
11
|
const DEFAULT_ACTIONS_URL = "/api/actions";
|
|
12
12
|
const DEFAULT_SUPERVISOR_URL = "/api/hive-runner";
|
|
13
|
+
const QUEEN_DISMISS_KEY = "hive.queenNoticeDismissed";
|
|
13
14
|
const DEFAULT_INTERVAL_MS = 3000;
|
|
14
15
|
|
|
15
16
|
const CARD_ACTIONS = Object.freeze({
|
|
@@ -692,8 +693,9 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
692
693
|
.hive-queen-hint {
|
|
693
694
|
display: none;
|
|
694
695
|
flex: 0 0 auto;
|
|
695
|
-
|
|
696
|
-
|
|
696
|
+
align-items: flex-start;
|
|
697
|
+
flex-direction: row;
|
|
698
|
+
gap: 8px;
|
|
697
699
|
padding: 10px 16px;
|
|
698
700
|
border-bottom: 1px solid color-mix(in srgb, var(--hive-accent, #58c4dc) 32%, var(--hive-line, #232b38));
|
|
699
701
|
background: var(--hive-accent-soft);
|
|
@@ -735,6 +737,14 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
735
737
|
color: var(--hive-fg-soft);
|
|
736
738
|
}
|
|
737
739
|
|
|
740
|
+
.hive-queen-body {
|
|
741
|
+
display: flex;
|
|
742
|
+
flex: 1 1 auto;
|
|
743
|
+
flex-direction: column;
|
|
744
|
+
gap: 4px;
|
|
745
|
+
min-width: 0;
|
|
746
|
+
}
|
|
747
|
+
|
|
738
748
|
.hive-queen-offer {
|
|
739
749
|
display: flex;
|
|
740
750
|
flex-wrap: wrap;
|
|
@@ -743,8 +753,18 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
743
753
|
max-width: 76ch;
|
|
744
754
|
}
|
|
745
755
|
|
|
746
|
-
.hive-queen-offer.is-hidden
|
|
747
|
-
|
|
756
|
+
.hive-queen-offer.is-hidden { display: none; }
|
|
757
|
+
|
|
758
|
+
.hive-queen-dismiss {
|
|
759
|
+
flex: 0 0 auto;
|
|
760
|
+
min-width: 24px;
|
|
761
|
+
padding: 0 6px;
|
|
762
|
+
color: var(--hive-fg-soft);
|
|
763
|
+
font-size: 16px;
|
|
764
|
+
line-height: 1.4;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.hive-queen-dismiss.is-hidden { display: none; }
|
|
748
768
|
|
|
749
769
|
.hive-queen-takeover {
|
|
750
770
|
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 45%, var(--hive-line, #232b38));
|
|
@@ -764,28 +784,6 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
764
784
|
overflow-wrap: anywhere;
|
|
765
785
|
}
|
|
766
786
|
|
|
767
|
-
.hive-queen-exit {
|
|
768
|
-
display: flex;
|
|
769
|
-
flex-wrap: wrap;
|
|
770
|
-
align-items: baseline;
|
|
771
|
-
gap: 5px;
|
|
772
|
-
max-width: 76ch;
|
|
773
|
-
color: color-mix(in srgb, var(--hive-accent, #58c4dc) 80%, var(--hive-fg, #e6edf3));
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
.hive-queen-command {
|
|
777
|
-
padding: 1px 6px;
|
|
778
|
-
border: 1px solid color-mix(in srgb, var(--hive-accent, #58c4dc) 30%, var(--hive-line, #232b38));
|
|
779
|
-
border-radius: 4px;
|
|
780
|
-
background: color-mix(in srgb, var(--hive-fg, #e6edf3) 10%, transparent);
|
|
781
|
-
color: var(--hive-fg, #e6edf3);
|
|
782
|
-
font-family: var(--hive-mono);
|
|
783
|
-
font-size: 10px;
|
|
784
|
-
line-height: 1.5;
|
|
785
|
-
cursor: text;
|
|
786
|
-
user-select: text;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
787
|
.hive-queen-output {
|
|
790
788
|
margin-top: 6px;
|
|
791
789
|
border-color: color-mix(in srgb, var(--hive-accent, #58c4dc) 32%, var(--hive-line, #232b38));
|
|
@@ -1045,8 +1043,7 @@ const PANEL_STYLES = `.hive { position: relative; }
|
|
|
1045
1043
|
.hive-plan-hint,
|
|
1046
1044
|
.hive-limits-description,
|
|
1047
1045
|
.hive-limits-hint,
|
|
1048
|
-
.hive-queen-text
|
|
1049
|
-
.hive-queen-exit { max-width: 76ch; line-height: 1.55; }
|
|
1046
|
+
.hive-queen-text { max-width: 76ch; line-height: 1.55; }
|
|
1050
1047
|
|
|
1051
1048
|
.hive-empty,
|
|
1052
1049
|
.hive-filter-empty,
|
|
@@ -1135,7 +1132,7 @@ export const messages = Object.freeze({
|
|
|
1135
1132
|
"action.modeTitle": "Toggle board mode",
|
|
1136
1133
|
"action.retry": "retry",
|
|
1137
1134
|
"action.unfreeze": "unfreeze",
|
|
1138
|
-
"pane.agents": "
|
|
1135
|
+
"pane.agents": "agents",
|
|
1139
1136
|
"pane.board": "board",
|
|
1140
1137
|
"pane.events": "events",
|
|
1141
1138
|
"board.hint": "5 lanes",
|
|
@@ -1167,8 +1164,8 @@ export const messages = Object.freeze({
|
|
|
1167
1164
|
"stats.byRoleTitle": "by role: ",
|
|
1168
1165
|
"status.actionFailed": "action failed",
|
|
1169
1166
|
"status.disconnected": "disconnected",
|
|
1170
|
-
"agents.empty": "No
|
|
1171
|
-
"agents.openAria": "Open
|
|
1167
|
+
"agents.empty": "No agents yet.",
|
|
1168
|
+
"agents.openAria": "Open agent",
|
|
1172
1169
|
"agent.idle": "idle",
|
|
1173
1170
|
"agent.task": "task",
|
|
1174
1171
|
"agent.unknown": "unknown",
|
|
@@ -1225,7 +1222,7 @@ export const messages = Object.freeze({
|
|
|
1225
1222
|
"prompt.after": "After task ids (comma separated, optional)",
|
|
1226
1223
|
"prompt.commitMessage": "Commit message",
|
|
1227
1224
|
"prompt.paths": "Paths (comma separated, optional)",
|
|
1228
|
-
"prompt.claimAgent": "Claim as
|
|
1225
|
+
"prompt.claimAgent": "Claim as agent",
|
|
1229
1226
|
"prompt.commitSha": "Commit sha (optional)",
|
|
1230
1227
|
"prompt.failReason": "Failure reason",
|
|
1231
1228
|
"action.plan": "Give the Queen a goal",
|
|
@@ -1252,9 +1249,11 @@ export const messages = Object.freeze({
|
|
|
1252
1249
|
"init.output": "stdout",
|
|
1253
1250
|
"init.noOutput": "(no output)",
|
|
1254
1251
|
"init.queen": "This session's input now routes to the Queen (it splits tasks, it does not do the work).",
|
|
1255
|
-
"init.queenExit": "Exit from the chat window:",
|
|
1256
|
-
"init.queenCommand": "/queen off",
|
|
1257
1252
|
"init.queenOutput": "Initialisation output",
|
|
1253
|
+
"queen.dismiss": "Dismiss",
|
|
1254
|
+
"queen.dismissAria": "Dismiss the Queen notice for this repository",
|
|
1255
|
+
"help.queen": "Queen mode",
|
|
1256
|
+
"help.queenDesc": "Type /queen off to exit. After exiting, this session returns to normal coding mode. Hiding the notice does not change Queen mode.",
|
|
1258
1257
|
"queen.status.active": "Queen active",
|
|
1259
1258
|
"queen.status.inactive": "Queen not active",
|
|
1260
1259
|
"queen.source.auto": "auto",
|
|
@@ -1267,11 +1266,11 @@ export const messages = Object.freeze({
|
|
|
1267
1266
|
"queen.takeoverBusy": "Taking over...",
|
|
1268
1267
|
"help.hint": "Open a task to see the actions for that task.",
|
|
1269
1268
|
"help.action.freeze": "Freeze: nobody can claim new tasks except tasks tagged fix.",
|
|
1270
|
-
"help.action.unfreeze": "Unfreeze:
|
|
1269
|
+
"help.action.unfreeze": "Unfreeze: agents can claim pending tasks again.",
|
|
1271
1270
|
"help.action.add": "New task: create a pending task with a role and file scope.",
|
|
1272
1271
|
"help.action.plan": "Give the Queen a goal: split a goal into tasks, preview the plan, then write it to the board.",
|
|
1273
1272
|
"help.action.commit": "Commit: commit the selected paths with a message.",
|
|
1274
|
-
"help.action.claim": "Claim: lease a pending task for
|
|
1273
|
+
"help.action.claim": "Claim: lease a pending task for an agent.",
|
|
1275
1274
|
"help.action.done": "Done: mark a claimed task complete, optionally with a commit sha.",
|
|
1276
1275
|
"help.action.fail": "Fail: mark a claimed task failed and record the reason.",
|
|
1277
1276
|
"help.action.retry": "Retry: put a failed or blocked task back in the queue.",
|
|
@@ -1279,7 +1278,7 @@ export const messages = Object.freeze({
|
|
|
1279
1278
|
"help.params.add": "title, role, scope[], after[]",
|
|
1280
1279
|
"help.params.plan": "goal, maxCards",
|
|
1281
1280
|
"help.params.commit": "message, set[]",
|
|
1282
|
-
"help.params.claim": "id,
|
|
1281
|
+
"help.params.claim": "id, agent",
|
|
1283
1282
|
"help.params.done": "id, sha?",
|
|
1284
1283
|
"help.params.fail": "id, reason",
|
|
1285
1284
|
"help.params.retry": "id",
|
|
@@ -1330,7 +1329,7 @@ export const messages = Object.freeze({
|
|
|
1330
1329
|
"action.modeTitle": "切换看板模式",
|
|
1331
1330
|
"action.retry": "重试",
|
|
1332
1331
|
"action.unfreeze": "解冻",
|
|
1333
|
-
"pane.agents": "
|
|
1332
|
+
"pane.agents": "智能体",
|
|
1334
1333
|
"pane.board": "任务",
|
|
1335
1334
|
"pane.events": "事件",
|
|
1336
1335
|
"board.hint": "5 条泳道",
|
|
@@ -1362,8 +1361,8 @@ export const messages = Object.freeze({
|
|
|
1362
1361
|
"stats.byRoleTitle": "按角色:",
|
|
1363
1362
|
"status.actionFailed": "操作失败",
|
|
1364
1363
|
"status.disconnected": "连接断开",
|
|
1365
|
-
"agents.empty": "
|
|
1366
|
-
"agents.openAria": "
|
|
1364
|
+
"agents.empty": "后台暂无智能体。",
|
|
1365
|
+
"agents.openAria": "打开智能体",
|
|
1367
1366
|
"agent.idle": "空闲",
|
|
1368
1367
|
"agent.task": "任务",
|
|
1369
1368
|
"agent.unknown": "未知",
|
|
@@ -1420,7 +1419,7 @@ export const messages = Object.freeze({
|
|
|
1420
1419
|
"prompt.after": "排在哪些任务之后(任务 ID,逗号分隔,可选)",
|
|
1421
1420
|
"prompt.commitMessage": "提交信息",
|
|
1422
1421
|
"prompt.paths": "路径(逗号分隔,可选)",
|
|
1423
|
-
"prompt.claimAgent": "
|
|
1422
|
+
"prompt.claimAgent": "以哪个智能体认领",
|
|
1424
1423
|
"prompt.commitSha": "提交 SHA(可选)",
|
|
1425
1424
|
"prompt.failReason": "失败原因",
|
|
1426
1425
|
"action.plan": "给女王下目标",
|
|
@@ -1447,9 +1446,11 @@ export const messages = Object.freeze({
|
|
|
1447
1446
|
"init.output": "标准输出",
|
|
1448
1447
|
"init.noOutput": "(无输出)",
|
|
1449
1448
|
"init.queen": "本会话输入框已接入女王模式(女王只拆解任务,不亲自干活)。",
|
|
1450
|
-
"init.queenExit": "退出请在聊天窗口输入:",
|
|
1451
|
-
"init.queenCommand": "/queen off",
|
|
1452
1449
|
"init.queenOutput": "初始化输出",
|
|
1450
|
+
"queen.dismiss": "关闭提示",
|
|
1451
|
+
"queen.dismissAria": "关闭这个仓库的女王提示",
|
|
1452
|
+
"help.queen": "女王模式",
|
|
1453
|
+
"help.queenDesc": "输入 /queen off 退出,退出后本会话恢复普通编码模式;关闭提示不影响女王状态。",
|
|
1453
1454
|
"queen.status.active": "女王已接管",
|
|
1454
1455
|
"queen.status.inactive": "女王未接管",
|
|
1455
1456
|
"queen.source.auto": "自动",
|
|
@@ -1462,11 +1463,11 @@ export const messages = Object.freeze({
|
|
|
1462
1463
|
"queen.takeoverBusy": "正在接管…",
|
|
1463
1464
|
"help.hint": "点开任务可查看该任务自己的操作。",
|
|
1464
1465
|
"help.action.freeze": "冻结:除带 fix 标签的任务外,任何人都不再能认领新任务。",
|
|
1465
|
-
"help.action.unfreeze": "
|
|
1466
|
+
"help.action.unfreeze": "解冻:恢复认领,智能体可以继续接取待办任务。",
|
|
1466
1467
|
"help.action.add": "新建任务:添加一条带角色和文件范围的待办任务。",
|
|
1467
1468
|
"help.action.plan": "给女王下目标:让女王把目标拆成任务计划,预览后再写入看板。",
|
|
1468
1469
|
"help.action.commit": "提交:按提交信息提交选中的路径。",
|
|
1469
|
-
"help.action.claim": "
|
|
1470
|
+
"help.action.claim": "认领:以某个智能体的名义短期租下这条待办任务。",
|
|
1470
1471
|
"help.action.done": "完成:把已认领的任务标为完成,可选填写提交 SHA。",
|
|
1471
1472
|
"help.action.fail": "标记失败:把已认领的任务标为失败,并写明原因。",
|
|
1472
1473
|
"help.action.retry": "重试:把失败或受阻的任务放回队列。",
|
|
@@ -1474,7 +1475,7 @@ export const messages = Object.freeze({
|
|
|
1474
1475
|
"help.params.add": "title、role、scope[]、after[]",
|
|
1475
1476
|
"help.params.plan": "goal、maxCards",
|
|
1476
1477
|
"help.params.commit": "message、set[]",
|
|
1477
|
-
"help.params.claim": "id
|
|
1478
|
+
"help.params.claim": "id、智能体",
|
|
1478
1479
|
"help.params.done": "id、sha?",
|
|
1479
1480
|
"help.params.fail": "id、reason",
|
|
1480
1481
|
"help.params.retry": "id",
|
|
@@ -2261,6 +2262,7 @@ export function mount(root, options = {}) {
|
|
|
2261
2262
|
let initRequestSeq = 0;
|
|
2262
2263
|
let queenNotice = false;
|
|
2263
2264
|
let queenBusy = false;
|
|
2265
|
+
const queenDismissedFallback = new Set();
|
|
2264
2266
|
let supervisorData = [];
|
|
2265
2267
|
let supervisorRequest = null;
|
|
2266
2268
|
let limitsOverlay = null;
|
|
@@ -2325,15 +2327,11 @@ export function mount(root, options = {}) {
|
|
|
2325
2327
|
|
|
2326
2328
|
const freezeSlot = element(doc, "div", "hive-freeze-slot");
|
|
2327
2329
|
|
|
2328
|
-
// Queen-mode notice,
|
|
2330
|
+
// Queen-mode notice, driven by snapshot.queen.
|
|
2329
2331
|
const queenHint = element(doc, "section", "hive-queen-hint");
|
|
2330
2332
|
setAttr(queenHint, "role", "status");
|
|
2333
|
+
const queenBody = element(doc, "div", "hive-queen-body");
|
|
2331
2334
|
const queenHintText = element(doc, "div", "hive-queen-text", "");
|
|
2332
|
-
const queenExit = element(doc, "div", "hive-queen-exit");
|
|
2333
|
-
const queenExitText = element(doc, "span", "hive-queen-exit-text", "");
|
|
2334
|
-
const queenCommand = element(doc, "code", "hive-queen-command", "");
|
|
2335
|
-
queenExit.appendChild(queenExitText);
|
|
2336
|
-
queenExit.appendChild(queenCommand);
|
|
2337
2335
|
const queenOffer = element(doc, "div", "hive-queen-offer is-hidden");
|
|
2338
2336
|
const queenTakeoverButton = element(doc, "button", "hive-btn hive-queen-takeover", translate("queen.takeover"));
|
|
2339
2337
|
setAttr(queenTakeoverButton, "type", "button");
|
|
@@ -2348,10 +2346,18 @@ export function mount(root, options = {}) {
|
|
|
2348
2346
|
const queenOutputPre = element(doc, "pre", "hive-output-pre", "");
|
|
2349
2347
|
queenOutputDetails.appendChild(queenOutputSummary);
|
|
2350
2348
|
queenOutputDetails.appendChild(queenOutputPre);
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2349
|
+
queenBody.appendChild(queenHintText);
|
|
2350
|
+
queenBody.appendChild(queenOffer);
|
|
2351
|
+
queenBody.appendChild(queenOutputDetails);
|
|
2352
|
+
const queenDismissButton = element(doc, "button", "hive-btn hive-btn-ghost hive-queen-dismiss is-hidden", "×");
|
|
2353
|
+
setAttr(queenDismissButton, "type", "button");
|
|
2354
|
+
setAttr(queenDismissButton, "title", translate("queen.dismissAria"));
|
|
2355
|
+
setAttr(queenDismissButton, "aria-label", translate("queen.dismissAria"));
|
|
2356
|
+
queenDismissButton.addEventListener("click", () => {
|
|
2357
|
+
dismissQueenNotice();
|
|
2358
|
+
});
|
|
2359
|
+
queenHint.appendChild(queenBody);
|
|
2360
|
+
queenHint.appendChild(queenDismissButton);
|
|
2355
2361
|
|
|
2356
2362
|
const main = element(doc, "main", "hive-main");
|
|
2357
2363
|
|
|
@@ -2597,6 +2603,8 @@ export function mount(root, options = {}) {
|
|
|
2597
2603
|
body.appendChild(item);
|
|
2598
2604
|
}
|
|
2599
2605
|
}
|
|
2606
|
+
body.appendChild(element(doc, "div", "hive-help-section", translate("help.queen")));
|
|
2607
|
+
body.appendChild(element(doc, "div", "hive-help-desc hive-help-queen", translate("help.queenDesc")));
|
|
2600
2608
|
body.appendChild(element(doc, "div", "hive-help-hint", translate("help.hint")));
|
|
2601
2609
|
}
|
|
2602
2610
|
|
|
@@ -3665,11 +3673,57 @@ export function mount(root, options = {}) {
|
|
|
3665
3673
|
initOutputPre.textContent = initOutput && initOutput.stdout ? initOutput.stdout : translate("init.noOutput");
|
|
3666
3674
|
}
|
|
3667
3675
|
|
|
3676
|
+
function queenStorage() {
|
|
3677
|
+
try {
|
|
3678
|
+
const storage = view && view.localStorage;
|
|
3679
|
+
if (storage && typeof storage.getItem === "function" && typeof storage.setItem === "function") {
|
|
3680
|
+
return storage;
|
|
3681
|
+
}
|
|
3682
|
+
} catch {
|
|
3683
|
+
// A blocked localStorage must not break the panel.
|
|
3684
|
+
}
|
|
3685
|
+
return null;
|
|
3686
|
+
}
|
|
3687
|
+
|
|
3688
|
+
function queenDismissStorageKey(repo) {
|
|
3689
|
+
return QUEEN_DISMISS_KEY + "=" + repo;
|
|
3690
|
+
}
|
|
3691
|
+
|
|
3692
|
+
function isQueenNoticeDismissed(repo) {
|
|
3693
|
+
if (!repo) return false;
|
|
3694
|
+
if (queenDismissedFallback.has(repo)) return true;
|
|
3695
|
+
const storage = queenStorage();
|
|
3696
|
+
if (!storage) return false;
|
|
3697
|
+
try {
|
|
3698
|
+
if (storage.getItem(queenDismissStorageKey(repo)) !== null) return true;
|
|
3699
|
+
return storage.getItem(QUEEN_DISMISS_KEY) === repo;
|
|
3700
|
+
} catch {
|
|
3701
|
+
return false;
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
function dismissQueenNotice() {
|
|
3706
|
+
const repo = lastModel ? lastModel.repo : "";
|
|
3707
|
+
if (!repo) return;
|
|
3708
|
+
queenDismissedFallback.add(repo);
|
|
3709
|
+
const storage = queenStorage();
|
|
3710
|
+
if (storage) {
|
|
3711
|
+
try {
|
|
3712
|
+
storage.setItem(queenDismissStorageKey(repo), "1");
|
|
3713
|
+
storage.setItem(QUEEN_DISMISS_KEY, repo);
|
|
3714
|
+
} catch {
|
|
3715
|
+
// The in-memory fallback above still hides it for this mount.
|
|
3716
|
+
}
|
|
3717
|
+
}
|
|
3718
|
+
if (!destroyed && lastModel) renderQueenHint(lastModel);
|
|
3719
|
+
}
|
|
3720
|
+
|
|
3668
3721
|
function renderQueenHint(model) {
|
|
3669
3722
|
const initialised = Boolean(model && model.initialised !== false);
|
|
3670
3723
|
const state = model && isRecord(model.queen) ? model.queen : null;
|
|
3671
3724
|
const active = state ? state.active === true : Boolean(queenNotice);
|
|
3672
|
-
const
|
|
3725
|
+
const dismissed = active && isQueenNoticeDismissed(model ? model.repo : "");
|
|
3726
|
+
const show = initialised && Boolean(state || queenNotice) && !dismissed;
|
|
3673
3727
|
const offer = show && !active;
|
|
3674
3728
|
|
|
3675
3729
|
if (initialised && state) {
|
|
@@ -3698,15 +3752,16 @@ export function mount(root, options = {}) {
|
|
|
3698
3752
|
queenHint.className = "hive-queen-hint" + (show ? " is-visible" : "") + (offer ? " is-offer" : "");
|
|
3699
3753
|
queenHintText.textContent = active ? translate("init.queen") : translate("queen.offer");
|
|
3700
3754
|
queenOffer.className = "hive-queen-offer" + (offer ? "" : " is-hidden");
|
|
3755
|
+
queenDismissButton.className =
|
|
3756
|
+
"hive-btn hive-btn-ghost hive-queen-dismiss" + (active && show ? "" : " is-hidden");
|
|
3757
|
+
setAttr(queenDismissButton, "title", translate("queen.dismissAria"));
|
|
3758
|
+
setAttr(queenDismissButton, "aria-label", translate("queen.dismissAria"));
|
|
3701
3759
|
queenTakeoverButton.disabled = queenBusy;
|
|
3702
3760
|
queenTakeoverButton.textContent = queenBusy ? translate("queen.takeoverBusy") : translate("queen.takeover");
|
|
3703
3761
|
const takeoverAria = queenBusy ? translate("queen.takeoverBusy") : translate("queen.takeoverAria");
|
|
3704
3762
|
setAttr(queenTakeoverButton, "title", takeoverAria);
|
|
3705
3763
|
setAttr(queenTakeoverButton, "aria-label", takeoverAria);
|
|
3706
3764
|
|
|
3707
|
-
queenExit.className = "hive-queen-exit" + (active ? "" : " is-hidden");
|
|
3708
|
-
queenExitText.textContent = translate("init.queenExit");
|
|
3709
|
-
queenCommand.textContent = translate("init.queenCommand");
|
|
3710
3765
|
queenOutputSummary.textContent = translate("init.queenOutput");
|
|
3711
3766
|
setAttr(queenOutputSummary, "title", translate("init.queenOutput"));
|
|
3712
3767
|
const output = initOutput && initOutput.stdout ? initOutput.stdout : translate("init.noOutput");
|