dsh-hive-panel 0.1.3 → 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 +16 -0
- package/lib/client.js +101 -46
- package/package.json +1 -1
- package/src/panel.js +101 -46
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
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
|
|
@@ -11,6 +19,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
11
19
|
- Chinese terminology synced with the final standalone-panel wording: agents are 智能体,
|
|
12
20
|
workers are Agent in English; queen stays 女王. Browser bundle rebuilt.
|
|
13
21
|
|
|
22
|
+
### Published
|
|
23
|
+
|
|
24
|
+
- npm: `dsh-hive-panel@0.1.3` on 2026-12-04.
|
|
25
|
+
|
|
14
26
|
## [0.1.2] - 2026-12-04
|
|
15
27
|
|
|
16
28
|
### Fixed
|
|
@@ -18,6 +30,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
18
30
|
- Chinese terminology: the queen is labelled 女王 again and worker labels stay 工蜂;
|
|
19
31
|
the browser bundle was rebuilt so the tab matches the standalone panel wording.
|
|
20
32
|
|
|
33
|
+
### Published
|
|
34
|
+
|
|
35
|
+
- npm: `dsh-hive-panel@0.1.2` on 2026-12-04.
|
|
36
|
+
|
|
21
37
|
## [0.1.1] - 2026-12-04
|
|
22
38
|
|
|
23
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,
|
|
@@ -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",
|
|
@@ -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": "自动",
|
|
@@ -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,
|
|
@@ -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",
|
|
@@ -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": "自动",
|
|
@@ -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");
|