@songsid/agend 2.3.5-alpha.7 → 2.3.5-alpha.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/dist/accounts-view.d.ts +17 -0
- package/dist/accounts-view.js +33 -6
- package/dist/accounts-view.js.map +1 -1
- package/dist/apply-job.d.ts +5 -0
- package/dist/apply-job.js +10 -3
- package/dist/apply-job.js.map +1 -1
- package/dist/auth-api.d.ts +1 -1
- package/dist/auth-api.js +4 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/config-validator.js +2 -1
- package/dist/config-validator.js.map +1 -1
- package/dist/fleet-manager.d.ts +25 -2
- package/dist/fleet-manager.js +158 -23
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/steering/core-rules.md +1 -1
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +151 -33
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.js +2 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +6 -0
- package/dist/hub/compose/member.js +9 -1
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +7 -0
- package/dist/hub/compose/server.js +47 -6
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/group-policy/admin-api.d.ts +30 -0
- package/dist/hub/group-policy/admin-api.js +83 -0
- package/dist/hub/group-policy/admin-api.js.map +1 -0
- package/dist/hub/group-policy/admin-control.d.ts +34 -0
- package/dist/hub/group-policy/admin-control.js +258 -0
- package/dist/hub/group-policy/admin-control.js.map +1 -0
- package/dist/hub/group-policy/admin-dto.d.ts +9 -1
- package/dist/hub/group-policy/admin-dto.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +17 -0
- package/dist/hub/group-policy/admin-facts.js +33 -0
- package/dist/hub/group-policy/admin-facts.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.d.ts +51 -0
- package/dist/hub/group-policy/admin-impact.js +88 -0
- package/dist/hub/group-policy/admin-impact.js.map +1 -0
- package/dist/hub/group-policy/authorization.d.ts +17 -0
- package/dist/hub/group-policy/authorization.js +123 -1
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
- package/dist/hub/group-policy/impact-inventory.js +75 -0
- package/dist/hub/group-policy/impact-inventory.js.map +1 -0
- package/dist/hub/group-policy/resources.d.ts +13 -1
- package/dist/hub/group-policy/resources.js +92 -23
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +11 -0
- package/dist/hub/group-policy/store.js +57 -2
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/welcome.d.ts +36 -0
- package/dist/hub/group-policy/welcome.js +55 -0
- package/dist/hub/group-policy/welcome.js.map +1 -0
- package/dist/hub/http/compose.d.ts +2 -0
- package/dist/hub/http/compose.js +128 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +7 -0
- package/dist/hub/member/pairing-api.d.ts +2 -0
- package/dist/hub/member/pairing-api.js +1 -0
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/pairing-notices.d.ts +18 -0
- package/dist/hub/member/pairing-notices.js +58 -0
- package/dist/hub/member/pairing-notices.js.map +1 -0
- package/dist/hub/pairing-notices.d.ts +47 -0
- package/dist/hub/pairing-notices.js +241 -0
- package/dist/hub/pairing-notices.js.map +1 -0
- package/dist/hub/pairing.d.ts +33 -1
- package/dist/hub/pairing.js +315 -15
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/protocol.d.ts +32 -0
- package/dist/hub/protocol.js +6 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/runtime.d.ts +4 -1
- package/dist/hub/runtime.js +11 -0
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/server.js +4 -0
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/store.d.ts +10 -1
- package/dist/hub/store.js +7 -4
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/types.d.ts +13 -2
- package/dist/locale.js +22 -16
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +9 -1
- package/dist/login-controller.js +20 -1
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +4 -2
- package/dist/login-flows.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.js +1 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/quickstart-api.js +2 -2
- package/dist/quickstart-api.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +5 -1
- package/dist/reply-buttons-controller.js +8 -4
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-buttons.d.ts +6 -2
- package/dist/reply-buttons.js +7 -3
- package/dist/reply-buttons.js.map +1 -1
- package/dist/settings-api.d.ts +2 -1
- package/dist/settings-api.js +4 -3
- package/dist/settings-api.js.map +1 -1
- package/dist/signin-keepalive.d.ts +2 -0
- package/dist/signin-keepalive.js +30 -2
- package/dist/signin-keepalive.js.map +1 -1
- package/dist/ui/accounts-keepalive.js +10 -5
- package/dist/ui/accounts-manage.js +29 -11
- package/dist/ui/accounts-view.js +75 -28
- package/dist/ui/backend-signin.js +10 -1
- package/dist/ui/hub-client.js +43 -3
- package/dist/ui/hub-group-policy.js +170 -0
- package/dist/ui/hub-group-strings.js +97 -0
- package/dist/ui/hub-owner-strings.js +4 -4
- package/dist/ui/hub-pairing-progress-strings.js +15 -0
- package/dist/ui/hub-quick-pairing.js +202 -0
- package/dist/ui/hub-quick-strings.js +43 -0
- package/dist/ui/hub-read-strings.js +7 -0
- package/dist/ui/hub-welcome.js +99 -0
- package/dist/ui/panel-hub.js +47 -10
- package/dist/ui/panel-settings.js +7 -4
- package/dist/ui/settings-apply.js +12 -5
- package/dist/ui/settings-devices.js +2 -2
- package/dist/ui/settings-dialogs.js +3 -1
- package/dist/ui/settings-hub-membership.js +18 -4
- package/dist/ui/settings-hub-section.js +26 -1
- package/dist/ui/settings-hub.js +52 -11
- package/dist/ui/settings-restart-strings.js +17 -0
- package/dist/ui/settings-strings.js +6 -4
- package/dist/ui/shared/accounts-keepalive.css +11 -6
- package/dist/ui/shared/accounts.css +68 -18
- package/dist/ui/shared/app-i18n.js +3 -0
- package/dist/ui/shared/app-shell.js +18 -8
- package/dist/ui/shared/hub-groups.css +26 -0
- package/dist/ui/shared/hub.css +1 -0
- package/dist/ui/shared/setup-host-text.js +4 -1
- package/dist/ui/shared/signin.js +3 -1
- package/dist/ui/shared/usage-dialog.js +3 -72
- package/dist/ui/shared/usage-meter.js +84 -0
- package/dist/ui/shared/web-authorize.js +4 -4
- package/dist/update-marker.d.ts +2 -0
- package/dist/update-marker.js.map +1 -1
- package/dist/web-api.d.ts +5 -1
- package/dist/web-api.js +25 -5
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +16 -2
- package/dist/web-backend-login.js +14 -0
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-notices.d.ts +9 -0
- package/dist/web-notices.js +19 -0
- package/dist/web-notices.js.map +1 -1
- package/dist/web-terminal.d.ts +7 -0
- package/dist/web-terminal.js +14 -2
- package/dist/web-terminal.js.map +1 -1
- package/package.json +1 -1
|
@@ -36,6 +36,8 @@ const CODEX_SPEED_CHOICES = ["", "standard", "fast"];
|
|
|
36
36
|
const byId = (id) => (typeof document !== "undefined" ? document.getElementById(id) : null);
|
|
37
37
|
|
|
38
38
|
const tn = (k, ...v) => t(`settings.${k}`, ...v);
|
|
39
|
+
// A cached older dictionary keeps the old alias label until reload, never a missing translation key.
|
|
40
|
+
const legacyPairingLabel = () => { const label = tn("legacyPairing"); return label === "settings.legacyPairing" ? "pairing" : label; };
|
|
39
41
|
export const impactText = (kind) => tn(kind === "now" ? "impactNow" : kind === "fleet" ? "impactFleet" : "impactAgent");
|
|
40
42
|
/** Ask in the app's own dialog (#1408 step 5): resolves true for the confirm button, false otherwise. */
|
|
41
43
|
export const ask = (message, opts = {}) => confirmDialog({ message, ...opts });
|
|
@@ -544,7 +546,7 @@ export function BotDialog({ id, ctx, onClose }) {
|
|
|
544
546
|
if (!ch) return null;
|
|
545
547
|
return html`<${EditDialog} title=${type === "telegram" ? "Telegram" : "Discord"} subtitle=${id} onClose=${onClose} onStage=${stage} impacts=${pendingImpacts()} schema=${schema}>
|
|
546
548
|
<div class="grid2">
|
|
547
|
-
<div class="field">${L(tn("accessMode"), "fleet.channel.access.mode", "bot-mode")}<${Select} id="bot-mode" value=${mode} onChange=${setMode} options=${ACCESS_MODES} />
|
|
549
|
+
<div class="field">${L(tn("accessMode"), "fleet.channel.access.mode", "bot-mode")}<${Select} id="bot-mode" value=${mode} onChange=${setMode} options=${ACCESS_MODES.map((value) => value === "pairing" ? { value, label: legacyPairingLabel() } : value)} />
|
|
548
550
|
<${Feedback} warning=${accessWarn} /></div>
|
|
549
551
|
<div class="field">${L(tn("allowedUsers"), "fleet.channel.access.allowed_users")}<${ChipList} items=${users} onChange=${setUsers} placeholder=${tn("userIdPlaceholder")} label=${tn("allowedUsers")} /></div>
|
|
550
552
|
</div>
|
|
@@ -11,7 +11,7 @@ register("hubMembership", {
|
|
|
11
11
|
loading: "Reading membership settings…", pending: "Waiting for owner confirmation…",
|
|
12
12
|
failed: "The membership change could not be verified. Check again before trying another change.",
|
|
13
13
|
unavailable: "Membership settings are unavailable. Open this fleet's own owner Settings and check again.",
|
|
14
|
-
retry: "Check again",
|
|
14
|
+
retry: "Check again",
|
|
15
15
|
},
|
|
16
16
|
"zh-TW": {
|
|
17
17
|
title: "Hub 成員功能", enabled: "允許這個 Fleet 連線至 Hub",
|
|
@@ -20,12 +20,27 @@ register("hubMembership", {
|
|
|
20
20
|
loading: "正在讀取成員設定…", pending: "等待擁有者確認…",
|
|
21
21
|
failed: "無法確認成員設定是否已變更。請再次檢查,再嘗試其他變更。",
|
|
22
22
|
unavailable: "目前無法使用成員設定。請開啟這個 Fleet 自己的擁有者設定頁面,再次檢查。",
|
|
23
|
-
retry: "再次檢查",
|
|
23
|
+
retry: "再次檢查",
|
|
24
24
|
},
|
|
25
25
|
});
|
|
26
26
|
const copy = key => t(`hubMembership.${key}`);
|
|
27
27
|
const path = "/api/settings/hub/membership";
|
|
28
28
|
const markedMember = () => String(globalThis.document?.body?.dataset?.hub || "").split(/\s+/).includes("member");
|
|
29
|
+
/**
|
|
30
|
+
* The leader's cid-hub-no-reload (#3319: the user stuck on "Reload page"): the page's Hub mark follows the saved switch, in
|
|
31
|
+
* place — what the server would mark a fresh page with (web-api hubBodyAttrs: `hub_member.enabled`, never over a public
|
|
32
|
+
* link, which this card never renders on). So once turning membership on is applied — confirmed here, in General, or by the
|
|
33
|
+
* host's Apply now: confirmedWrite follows it to the end either way, then this card reads it again — the Connect card loads
|
|
34
|
+
* with its address and code fields, and no reload is asked for. Nothing has loaded the Hub client before (no Hub module loads
|
|
35
|
+
* on an unmarked page), so it starts as the member client. Presentation only: a mark confers no authority.
|
|
36
|
+
*/
|
|
37
|
+
const markMember = on => {
|
|
38
|
+
const body = globalThis.document?.body;
|
|
39
|
+
if (!body || markedMember() === on) return;
|
|
40
|
+
const tokens = String(body.dataset.hub || "").split(/\s+/).filter(t => t && t !== "member");
|
|
41
|
+
if (on) tokens.push("member");
|
|
42
|
+
if (tokens.length) body.dataset.hub = tokens.join(" "); else delete body.dataset.hub;
|
|
43
|
+
};
|
|
29
44
|
export function HubMembershipSettings() {
|
|
30
45
|
const publicPage = globalThis.document?.body?.dataset?.publicLink === "1";
|
|
31
46
|
const [view, setView] = useState(null), [busy, setBusy] = useState(false), [messageKey, setMessageKey] = useState("loading");
|
|
@@ -37,7 +52,7 @@ export function HubMembershipSettings() {
|
|
|
37
52
|
if (!view) setMessageKey("loading");
|
|
38
53
|
let result; try { result = await api(path); } catch { result = null; }
|
|
39
54
|
if (!owner.current.mounted || owner.current.seq !== seq) return;
|
|
40
|
-
if (result?.ok && typeof result.body?.enabled === "boolean") { setView({ enabled: result.body.enabled }); setMessageKey(""); }
|
|
55
|
+
if (result?.ok && typeof result.body?.enabled === "boolean") { markMember(result.body.enabled); setView({ enabled: result.body.enabled }); setMessageKey(""); }
|
|
41
56
|
else { setView(null); setMessageKey("unavailable"); }
|
|
42
57
|
};
|
|
43
58
|
useEffect(() => {
|
|
@@ -73,6 +88,5 @@ export function HubMembershipSettings() {
|
|
|
73
88
|
<p class="note">${copy("off")}</p>
|
|
74
89
|
${messageKey && messageKey !== "loading" ? html`<p role="status">${copy(messageKey)}</p>` : null}
|
|
75
90
|
${!view && !busy && messageKey !== "loading" ? html`<button class="btn btn-sm" type="button" onClick=${read}>${copy("retry")}</button>` : null}
|
|
76
|
-
${view && view.enabled !== markedMember() ? html`<p class="note">${copy("reloadHint")} <button class="btn btn-sm" type="button" disabled=${busy} onClick=${() => location.reload()}>${copy("reload")}</button></p>` : null}
|
|
77
91
|
</section>${view?.enabled && markedMember() ? Connect ? html`<${Connect} />` : connectError ? html`<${ErrorState} message=${copy("unavailable")} onRetry=${() => setAttempt(n => n + 1)} />` : html`<${Skeleton} variant="form" lines=${4} />` : null}</div>`;
|
|
78
92
|
}
|
|
@@ -10,10 +10,14 @@ register("settingsHubSection", {
|
|
|
10
10
|
en: {
|
|
11
11
|
publicLink: "Hub settings are only on this fleet's own dashboard, not over the public link.",
|
|
12
12
|
relatedTitle: "Hub", relatedHint: "Connect this fleet to a team Hub and choose which agents to share.",
|
|
13
|
+
groupsTitle: "Group permissions", groupsHint: "Let members of chosen directory groups chat with agents, share agents or connect their fleet. Set on the Hub, signed in as its administrator.",
|
|
14
|
+
groupsOpen: "Open on the Hub", experimental: "Experimental",
|
|
13
15
|
},
|
|
14
16
|
"zh-TW": {
|
|
15
17
|
publicLink: "Hub 設定只在這個 Fleet 自己的儀表板上提供,公開連結上沒有。",
|
|
16
18
|
relatedTitle: "Hub", relatedHint: "將這個 Fleet 連線至團隊 Hub,並選擇要分享的 Agent。",
|
|
19
|
+
groupsTitle: "群組權限", groupsHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet。在 Hub 上以管理員身分登入後設定。",
|
|
20
|
+
groupsOpen: "在 Hub 上開啟", experimental: "實驗性",
|
|
17
21
|
},
|
|
18
22
|
});
|
|
19
23
|
export const hubSectionText = (key) => t(`settingsHubSection.${key}`);
|
|
@@ -25,11 +29,32 @@ function Lazy({ load, pick }) {
|
|
|
25
29
|
return Card ? html`<${Card} />` : null;
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
/**
|
|
33
|
+
* #3298 S-89: where the Hub's group permissions are set, found from this fleet's Settings. Only a link: the Hub's own sign-in and
|
|
34
|
+
* its own capability marks decide what opens there (this page never reads a Hub session across origins). The address is this
|
|
35
|
+
* fleet's own configured Hub web origin, accepted only as a bare HTTPS origin.
|
|
36
|
+
*/
|
|
37
|
+
export function hubGroupsHref(webOrigin) {
|
|
38
|
+
try { const u = new URL(String(webOrigin || "")); return u.protocol === "https:" && u.origin === String(webOrigin).replace(/\/$/, "") ? `${u.origin}/ui/hub/admin?view=groups` : null; } catch { return null; }
|
|
39
|
+
}
|
|
40
|
+
/** The page mark the fleet's server sets when its own Hub has group permissions composed (#3372 N2). */
|
|
41
|
+
export function hubGroupsMarked(doc = typeof document !== "undefined" ? document : null) {
|
|
42
|
+
try { return !!doc && !!doc.body && doc.body.dataset.hubGroups === "1"; } catch { return false; }
|
|
43
|
+
}
|
|
44
|
+
function GroupPermissionsRow({ href }) {
|
|
45
|
+
return html`<section class="card s-group" id="hub-group-permissions"><h3>${hubSectionText("groupsTitle")} <span class="tag warn">${hubSectionText("experimental")}</span></h3>
|
|
46
|
+
<p class="note">${hubSectionText("groupsHint")}</p>
|
|
47
|
+
<div class="s-row"><a class="btn btn-sm" href=${href} target="_blank" rel="noopener noreferrer">${hubSectionText("groupsOpen")}</a></div></section>`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function HubSection({ overPublicLink, hubHost, hubOrigin }) {
|
|
51
|
+
// Only when this fleet's own Hub offers group permissions (the server's page mark), the same gate as the Hub's editor.
|
|
52
|
+
const groupsHref = hubHost && hubGroupsMarked() ? hubGroupsHref(hubOrigin) : null;
|
|
29
53
|
if (overPublicLink) return html`<section class="card s-group" id="hub-public-link"><p class="note">${hubSectionText("publicLink")}</p></section>`;
|
|
30
54
|
return html`<div class="s-hub-section">
|
|
31
55
|
<${Lazy} load=${() => import("./settings-hub-membership.js")} pick=${(m) => m.HubMembershipSettings} />
|
|
32
56
|
${hubHost ? html`<${Lazy} load=${() => import("./settings-hub-retention.js")} pick=${(m) => m.HubRetentionSettings} />
|
|
33
57
|
<${Lazy} load=${() => import("./settings-hub-browser-certificate.js")} pick=${(m) => m.HubBrowserCertificateSettings} />` : null}
|
|
58
|
+
${groupsHref ? html`<${GroupPermissionsRow} href=${groupsHref} />` : null}
|
|
34
59
|
</div>`;
|
|
35
60
|
}
|
package/dist/ui/settings-hub.js
CHANGED
|
@@ -12,6 +12,9 @@ import { compareGroups, hubClient, safeWebOrigin, ADDRESS_HINT, CODE_HINT } from
|
|
|
12
12
|
import { hw, linkHubCss } from "./hub-strings.js";
|
|
13
13
|
import { guidanceFor } from "./hub-provider-guidance.js";
|
|
14
14
|
import { AGENT_CHOICE } from "./hub-agent-copy.js";
|
|
15
|
+
import { PairingNotices } from "./hub-quick-pairing.js";
|
|
16
|
+
import { hq } from "./hub-quick-strings.js";
|
|
17
|
+
import { hp } from "./hub-pairing-progress-strings.js";
|
|
15
18
|
|
|
16
19
|
const CONNECT_ERRORS = { address: "errAddress", code: "errCode", busy: "errBusy", unreachable: "errUnreachable", refused: "errRefused" };
|
|
17
20
|
const HOLDS = new Set(["unknown_outcome", "expired", "unsaved", "refused", "revoked", "disconnected"]);
|
|
@@ -20,6 +23,15 @@ const PUBLISH_ERRORS = { conflict: "errConflict", unsaved: "errUnsaved", not_pai
|
|
|
20
23
|
// The switcher may have cached hub-strings before this action existed. Its original Allow word is still available.
|
|
21
24
|
const allowOnHubLabel = () => { const label = hw("allowOnHub"); return label === "hub.allowOnHub" ? `${hw("allow")}…` : label; };
|
|
22
25
|
|
|
26
|
+
// A queued local confirmation describes one operation, not every later pairing or link state.
|
|
27
|
+
function waitingForPairing(msg, p) {
|
|
28
|
+
const pending = msg?.pending;
|
|
29
|
+
if (!pending) return true;
|
|
30
|
+
if (pending.action === "connect") return p?.state === "unpaired";
|
|
31
|
+
if (pending.action === "confirm") return p?.state === "pending" && p.localConfirmed === false && p.fingerprint?.digest === pending.fingerprint;
|
|
32
|
+
return pending.action === "disconnect" && p?.state === "paired" && p.binding === pending.binding && p.hub?.hubId === pending.hubId;
|
|
33
|
+
}
|
|
34
|
+
|
|
23
35
|
/** A fingerprint: its first 128 bits in groups people compare, the whole digest on request. */
|
|
24
36
|
function Fingerprint({ label, fp }) {
|
|
25
37
|
const [full, setFull] = useState(false);
|
|
@@ -40,6 +52,33 @@ export function HubConnectCard() {
|
|
|
40
52
|
const [busy, setBusy] = useState(false);
|
|
41
53
|
const [msg, setMsg] = useState(null);
|
|
42
54
|
const live = useRef(true);
|
|
55
|
+
const generation = useRef(0), activePending = useRef(null);
|
|
56
|
+
const pendingMessage = (action, shown, result, token) => {
|
|
57
|
+
const pending = { action, fingerprint: shown?.fingerprint?.digest, binding: shown?.binding, hubId: shown?.hub?.hubId };
|
|
58
|
+
activePending.current = pending;
|
|
59
|
+
setMsg({ error: false, text: hw("waitingConfirm"), pending });
|
|
60
|
+
if (!result.settled?.then) return; // An older client still clears its hint when the projection advances.
|
|
61
|
+
const current = () => live.current && generation.current === token && activePending.current === pending;
|
|
62
|
+
const finish = async outcome => {
|
|
63
|
+
if (!current()) return;
|
|
64
|
+
let next;
|
|
65
|
+
try { next = await client.pairing(); } catch { /* unknown result, never a retry/success claim */ }
|
|
66
|
+
if (!current()) return;
|
|
67
|
+
if (next) setPairing(next);
|
|
68
|
+
activePending.current = null;
|
|
69
|
+
const text = !next || !["applied", "failed", "expired", "rejected", "stale"].includes(outcome?.state) ? hp("unknown")
|
|
70
|
+
: outcome.state === "applied" || !waitingForPairing({ pending }, next) ? null
|
|
71
|
+
: action === "connect" && next.state === "unpaired" && ["failed", "expired"].includes(outcome.state) ? hp("connectFailed") : hp("notApplied");
|
|
72
|
+
setMsg(old => old?.pending === pending ? text ? { error: true, text } : null : old);
|
|
73
|
+
};
|
|
74
|
+
void Promise.resolve(result.settled).then(finish, () => finish(null));
|
|
75
|
+
};
|
|
76
|
+
useEffect(() => {
|
|
77
|
+
if (msg?.pending && !waitingForPairing(msg, pairing)) {
|
|
78
|
+
if (activePending.current === msg.pending) activePending.current = null;
|
|
79
|
+
setMsg(null);
|
|
80
|
+
}
|
|
81
|
+
}, [msg, pairing]);
|
|
43
82
|
const readPairing = () => {
|
|
44
83
|
setReadError(false);
|
|
45
84
|
return client.pairing().then((p) => { if (live.current) setPairing(p); }, () => { if (live.current) setReadError(true); });
|
|
@@ -49,28 +88,29 @@ export function HubConnectCard() {
|
|
|
49
88
|
live.current = true;
|
|
50
89
|
readPairing();
|
|
51
90
|
const off = client.subscribe((p) => { if (live.current) setPairing(p); });
|
|
52
|
-
return () => { live.current = false; off(); };
|
|
91
|
+
return () => { live.current = false; generation.current++; activePending.current = null; off(); };
|
|
53
92
|
}, []);
|
|
54
93
|
const act = async (fn) => {
|
|
55
94
|
if (busy) return;
|
|
95
|
+
const token = ++generation.current; activePending.current = null;
|
|
56
96
|
setBusy(true); setMsg(null);
|
|
57
|
-
try { await fn(); } catch { if (live.current) setMsg({ error: true, text: hw("errFailed") }); }
|
|
97
|
+
try { await fn(token); } catch { if (live.current && token === generation.current) setMsg({ error: true, text: hw("errFailed") }); }
|
|
58
98
|
finally { if (live.current) setBusy(false); }
|
|
59
99
|
};
|
|
60
|
-
const connect = () => act(async
|
|
100
|
+
const connect = () => act(async token => {
|
|
61
101
|
const r = await client.connect({ address: form.address.trim(), code: form.code.trim() });
|
|
62
102
|
if (!live.current) return;
|
|
63
|
-
if (r.ok) { setPairing(r.pairing); setForm({ address: "", code: "" }); if (r.pendingConfirmation)
|
|
103
|
+
if (r.ok) { setPairing(r.pairing); setForm({ address: "", code: "" }); if (r.pendingConfirmation) pendingMessage("connect", null, r, token); }
|
|
64
104
|
else setMsg({ error: true, text: hw(CONNECT_ERRORS[r.error] || "errFailed") });
|
|
65
105
|
});
|
|
66
|
-
const disconnect = (name) => act(async
|
|
106
|
+
const disconnect = (name) => act(async token => {
|
|
67
107
|
const shown = pairing; // #3115 r2: the pairing on screen now, before the dialog
|
|
68
108
|
if (!(await confirmDialog({ message: hw("disconnectAsk", name), confirmLabel: hw("disconnect"), danger: true }))) return;
|
|
69
109
|
const r = await client.disconnect(shown);
|
|
70
110
|
if (!live.current) return;
|
|
71
111
|
if (!r.ok) { setMsg({ error: true, text: hw("errUnsaved") }); return; }
|
|
72
112
|
setPairing(await client.pairing());
|
|
73
|
-
if (r.pendingConfirmation) {
|
|
113
|
+
if (r.pendingConfirmation) { pendingMessage("disconnect", shown, r, token); return; }
|
|
74
114
|
if (r.remote === "pending") setMsg({ error: false, text: hw("disconnectPending") });
|
|
75
115
|
});
|
|
76
116
|
const cancel = () => act(async () => { const p = await client.cancel(); if (live.current) setPairing(p); });
|
|
@@ -95,14 +135,14 @@ export function HubConnectCard() {
|
|
|
95
135
|
<${Fingerprint} label=${hw("pairingFp")} fp=${p.fingerprint} />
|
|
96
136
|
<p class="note">${hw("pendingCompare")}</p>
|
|
97
137
|
${p.localConfirmed === false && client.confirmFingerprint ? html`<div class="field-row"><button type="button" class="btn btn-primary hub-local-confirm" disabled=${busy}
|
|
98
|
-
onClick=${() => act(async
|
|
99
|
-
if (r.ok) { setPairing(r.pairing); if (r.pendingConfirmation)
|
|
138
|
+
onClick=${() => act(async token => { const r = await client.confirmFingerprint(p.fingerprint.digest); if (!live.current) return;
|
|
139
|
+
if (r.ok) { setPairing(r.pairing); if (r.pendingConfirmation) pendingMessage("confirm", p, r, token); }
|
|
100
140
|
else setMsg({ error: true, text: hw(r.error === "expired" ? "hold_expired" : r.error === "conflict" ? "errConflict" : "errUnsaved") }); })}>${hw("localMatch")}</button></div>`
|
|
101
141
|
: p.localConfirmed === true ? html`<p class="note hub-local-confirmed">${hw("localConfirmed")}</p>` : null}
|
|
102
142
|
${p.ownerConfirmed === null && p.adminApproved === null
|
|
103
143
|
// S3c: the member cannot see the Hub's progress — the two steps as instructions, no marks.
|
|
104
|
-
? html`<p class="hub-steps-lead">${
|
|
105
|
-
<ul class="hub-steps hub-steps-unknown"><li><span>${
|
|
144
|
+
? html`<p class="hub-steps-lead">${hq("remoteSteps")}</p>
|
|
145
|
+
<ul class="hub-steps hub-steps-unknown"><li><span>${hq("ownerStep")}</span></li><li><span>${hq("policyStep")}</span></li></ul>
|
|
106
146
|
<p class="note">${hw("hubProgressHidden")}</p>`
|
|
107
147
|
: html`<p class="hub-steps-lead">${hw("pendingSteps")}</p>
|
|
108
148
|
<ul class="hub-steps">${step(p.ownerConfirmed, "ownerStep")}${step(p.adminApproved, "adminStep")}</ul>`}
|
|
@@ -148,7 +188,8 @@ export function HubConnectCard() {
|
|
|
148
188
|
<p class="note">${hw("lead")}</p>
|
|
149
189
|
${client.stub ? html`<p class="note hub-preview" role="note">${hw("preview")}</p>` : null}
|
|
150
190
|
${body}
|
|
151
|
-
${
|
|
191
|
+
${p?.state === "paired" && client.pairingNotices?.().length ? html`<${PairingNotices} memberNotices=${client.pairingNotices()} memberOrigin=${safeWebOrigin(p)} />` : null}
|
|
192
|
+
${msg && waitingForPairing(msg, p) ? html`<p class=${msg.error ? "err" : "note"} role=${msg.error ? "alert" : "status"}>${msg.text}</p>` : null}
|
|
152
193
|
${p && p.state === "paired" ? html`<${HubExposures} key=${`${p.binding}|${p.hub.hubId}|${p.hub.fingerprint?.digest}|${safeWebOrigin(p)}`} client=${client} pairing=${p} />` : null}
|
|
153
194
|
</section>`;
|
|
154
195
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// S-92 (#3326 D1): the settings.* words for restarting AgEnD from Settings on a fleet with no chat connection, kept in a file
|
|
2
|
+
// of their own for the same reason as settings-shared-strings.js: a tab opened before an upgrade already holds the old
|
|
3
|
+
// settings-strings.js, and this file's URL is new, so no tab can hold an old copy of it. register() merges these over what
|
|
4
|
+
// settings-strings.js said. Every module that reads one of these keys imports this file after "./settings-strings.js".
|
|
5
|
+
import { register } from "/assets/app-i18n.js";
|
|
6
|
+
|
|
7
|
+
register("settings", {
|
|
8
|
+
en: {
|
|
9
|
+
// On a web-only fleet a restart from Settings is recorded in the dashboard's Notices (there is no chat channel).
|
|
10
|
+
applyRestartHintWebOnly: "This change needs AgEnD itself restarted. You can restart it here.",
|
|
11
|
+
restartFleetConfirmWebOnly: "Restart AgEnD now?\n\nEvery agent stops and starts again, work in progress is interrupted, and the panel is unreachable for up to a minute. It is recorded in this dashboard's Notices.",
|
|
12
|
+
},
|
|
13
|
+
"zh-TW": {
|
|
14
|
+
applyRestartHintWebOnly: "此變更需要重新啟動 AgEnD 本身。可以在這裡重新啟動。",
|
|
15
|
+
restartFleetConfirmWebOnly: "現在重新啟動 AgEnD?\n\n所有 agent 都會停止再啟動,進行中的工作會被中斷,面板會有最多約一分鐘無法連線。這次重新啟動會記錄在這個儀表板的通知中。",
|
|
16
|
+
},
|
|
17
|
+
});
|
|
@@ -126,6 +126,7 @@ register("settings", {
|
|
|
126
126
|
pause: "Pause",
|
|
127
127
|
wake: "Wake",
|
|
128
128
|
accessMode: "Access mode",
|
|
129
|
+
legacyPairing: "pairing (legacy; same as locked)",
|
|
129
130
|
affected: "Affected instances",
|
|
130
131
|
language: "Language (bot replies)",
|
|
131
132
|
defaultBackend: "Default backend",
|
|
@@ -569,10 +570,10 @@ register("settings", {
|
|
|
569
570
|
vaSessionsTitle: "Authorized sessions", vaSessionsNone: "No session is authorized now.", vaSessionUntil: "Authorized {0} · until {1}",
|
|
570
571
|
vaRevoke: "Revoke web authority", vaRevokeTitle: "Revoke all web authority?", vaRevokeConfirm: "Every authority given from the web so far reads as none from now on, and every session's authorization ends. Nobody is signed out: a session carries authority again once it is authorized again.",
|
|
571
572
|
vaRevoked: "Web authority given so far is revoked.", vaRevokedNotDurable: "Revoked for now, but it could not be saved: web authority stays off until it can be, and a restart before then undoes the revocation.", vaRevokeFailed: "That did not work — try again.",
|
|
572
|
-
webReadOnlyLead: "Read-only
|
|
573
|
+
webReadOnlyLead: "Read-only: these values control the dashboard's listeners and exposure. This page cannot change them.",
|
|
573
574
|
searchRetentionUnset: "not set (no age limit; 300,000-row cap)",
|
|
574
575
|
searchRetentionZero: "0 (no age limit; 300,000-row cap)",
|
|
575
|
-
webSearchHint: "Global search keeps entries with no age limit by default. The daily prune still caps the index at 300,000 rows (oldest first).
|
|
576
|
+
webSearchHint: "Global search keeps entries with no age limit by default. The daily prune still caps the index at 300,000 rows (oldest first). Retention cannot be changed here.",
|
|
576
577
|
classicBackend: "ClassicBot default backend",
|
|
577
578
|
whoUsesClassic: "Who can use ClassicBot",
|
|
578
579
|
userIdPlaceholder: "user id",
|
|
@@ -779,6 +780,7 @@ register("settings", {
|
|
|
779
780
|
pause: "暫停",
|
|
780
781
|
wake: "喚醒",
|
|
781
782
|
accessMode: "存取模式",
|
|
783
|
+
legacyPairing: "pairing(舊版;等同 locked)",
|
|
782
784
|
affected: "受影響 instances",
|
|
783
785
|
language: "語言(bot 回覆)",
|
|
784
786
|
defaultBackend: "預設後端",
|
|
@@ -1220,10 +1222,10 @@ register("settings", {
|
|
|
1220
1222
|
vaSessionsTitle: "已授權的 session", vaSessionsNone: "目前沒有已授權的 session。", vaSessionUntil: "{0} 授權 · 到 {1}",
|
|
1221
1223
|
vaRevoke: "撤銷網頁授權", vaRevokeTitle: "撤銷所有網頁授權?", vaRevokeConfirm: "到目前為止從網頁給出的授權,從現在起都視為無,所有 session 的授權也會結束。不會登出任何人:session 再授權一次後,送出的訊息會再帶有授權。",
|
|
1222
1224
|
vaRevoked: "已撤銷到目前為止的網頁授權。", vaRevokedNotDurable: "已暫時撤銷,但無法保存:在可以保存之前網頁授權會保持關閉,而在那之前重新啟動會讓這次撤銷失效。", vaRevokeFailed: "沒有成功,請再試一次。",
|
|
1223
|
-
webReadOnlyLead: "
|
|
1225
|
+
webReadOnlyLead: "僅供檢視:這些設定決定儀表板監聽和公開的內容。這個頁面無法修改。",
|
|
1224
1226
|
searchRetentionUnset: "未設定(不限天數;上限 30 萬筆)",
|
|
1225
1227
|
searchRetentionZero: "0(不限天數;上限 30 萬筆)",
|
|
1226
|
-
webSearchHint: "全域搜尋預設不限天數。每日清理仍會把索引上限維持在 30
|
|
1228
|
+
webSearchHint: "全域搜尋預設不限天數。每日清理仍會把索引上限維持在 30 萬筆(先刪最舊的)。這裡無法變更保存期限。",
|
|
1227
1229
|
classicBackend: "ClassicBot 預設 backend",
|
|
1228
1230
|
whoUsesClassic: "誰可以使用 ClassicBot",
|
|
1229
1231
|
userIdPlaceholder: "使用者 id",
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
/* #3292: Settings → Accounts → Keep sign-in alive — linked by accounts-keepalive.js (an older accounts.css lacks these rules).
|
|
2
|
-
|
|
3
|
-
.s-
|
|
1
|
+
/* #3292: Settings → Accounts → Keep sign-in alive — linked by accounts-keepalive.js (an older accounts.css lacks these rules).
|
|
2
|
+
* The foot of an account's box: one line (it wraps only when the box is too narrow), one tone off the box (--surface-2 on --bg, a tone the CLI card around it does not have), no line. What each switch does is the
|
|
3
|
+
* settings pages' ⓘ after it (`InfoTip`, app.css `.s-tipwrap`): its words are a layer over the box (position: absolute), never in the flow, so nothing moves.
|
|
4
|
+
* The colours are the theme's (tokens.css); nothing here has one of its own. */
|
|
5
|
+
.s-account-keepalive { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); margin: var(--s-3) calc(-1 * var(--s-4)) calc(-1 * var(--s-3)); padding: var(--s-2) var(--s-4); border-radius: 0 0 var(--r-md) var(--r-md); background: var(--surface-2); }
|
|
6
|
+
.s-account-keepalive .check { display: flex; align-items: center; gap: var(--s-2); }
|
|
4
7
|
.s-account-keepalive small { color: var(--text-2); font-size: var(--fs-xs); overflow-wrap: anywhere; }
|
|
5
|
-
.s-account-keepalive .
|
|
6
|
-
.s-account-keepalive .is-
|
|
7
|
-
|
|
8
|
+
.s-account-keepalive .is-warn { color: var(--warn); font-weight: var(--fw-semibold); }
|
|
9
|
+
.s-account-keepalive .is-bad { color: var(--danger); font-weight: var(--fw-semibold); }
|
|
10
|
+
/* The ⓘ sits against the switch it explains; the backup-renewal switch is on the same line, with its own ⓘ. */
|
|
11
|
+
.s-account-keepalive > .s-tipwrap { margin-left: calc(-1 * var(--s-2)); }
|
|
12
|
+
.s-account-keepalive .s-keepalive-fallback { display: flex; align-items: center; gap: var(--s-2); }
|
|
@@ -1,28 +1,78 @@
|
|
|
1
|
-
/* #3212: Settings → Agents → Accounts — linked by accounts-view.js (a page holding an older app.css still draws it).
|
|
1
|
+
/* #3212: Settings → Agents → Accounts — linked by accounts-view.js (a page holding an older app.css still draws it).
|
|
2
|
+
* Box layout: each CLI is a `.card`; each account is a box inside it (a status bar on its left edge) with three layers — the title bar (name, state,
|
|
3
|
+
* default tag · the buttons), the meta bar (who, used by), the usage block (5h and the week: two columns when wide, two stacked rows on a phone) and,
|
|
4
|
+
* for Keep sign-in alive, a foot.
|
|
5
|
+
* Colour is the theme's (tokens.css) and nothing else: this file has no colour of its own, so light and dark follow the page and the box looks like the
|
|
6
|
+
* settings cards around it. Layers are told apart by tone — the card is --surface, a box is --bg, the usage block is --surface again, the foot and a
|
|
7
|
+
* paired computer's tray are --surface-2 — not by lines. Shared pieces are used as they are: `.card`, `.s-row`, `.tag`, `.btn`, `Menu` (used by),
|
|
8
|
+
* `InfoTip` (the foot's ⓘ) and `CompactMeter` (the usage windows, app.css `.u-cm`).
|
|
9
|
+
* Nothing here is a layout the page waits on: the used-by list and the ⓘ words are layers over the box (position: absolute), so opening one never
|
|
10
|
+
* moves the box or the one below it. No inline styles are used (CSP style-src 'self'). */
|
|
2
11
|
.s-accounts { display: grid; gap: var(--s-3); }
|
|
3
|
-
|
|
12
|
+
|
|
13
|
+
/* One card per CLI (`.card`: --surface, --r-md). The section's own gap spaces the cards, so the card's bottom margin goes. overflow stays visible: the hints float out of it. */
|
|
14
|
+
.s-accounts .s-account-card { margin-bottom: 0; overflow: visible; }
|
|
4
15
|
.s-account-head { display: flex; align-items: center; gap: var(--s-2); }
|
|
5
|
-
.s-account-
|
|
6
|
-
.s-account-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.s
|
|
12
|
-
|
|
13
|
-
|
|
16
|
+
.s-account-head .s-account-add { margin-left: auto; }
|
|
17
|
+
.s-accounts .s-account-rows { display: grid; gap: var(--s-3); }
|
|
18
|
+
|
|
19
|
+
/* One box per account (`.s-row` on --bg). The left edge says the state: signed in, not signed in, or not known. overflow stays visible: the used-by list and the hints float out of it. */
|
|
20
|
+
/* The user's report on #3367 (house style #2330/#2332/#2489, decision 3536dae9): the state colour is the house straight
|
|
21
|
+
left bar — the `.lbar` shape from app.css (a 3px line, square, short of the corners) — never a border-left
|
|
22
|
+
curving into the row's rounded corners. Drawn here, on the row's own class, rather than by a class in the markup (#3407
|
|
23
|
+
review): this sheet loads apart from the shell and its markup, so a tab holding either older half still draws one bar
|
|
24
|
+
in its state's colour (older markup + this sheet: this bar; this markup is unchanged + an older sheet: the old edge),
|
|
25
|
+
never two. The 3px the bar takes is added to the row's padding. */
|
|
26
|
+
.s-accounts .s-account-row { display: block; position: relative; min-height: 0; padding: var(--s-3) var(--s-4) var(--s-3) calc(var(--s-4) + 3px); background: var(--bg); overflow: visible; }
|
|
27
|
+
.s-accounts .s-account-row::before { content: ""; position: absolute; left: 0; top: var(--s-2); bottom: var(--s-2); width: 3px; background: var(--ok); pointer-events: none; }
|
|
28
|
+
.s-account-row:has(.s-auth-state.is-not_signed_in)::before { background: var(--warn); }
|
|
29
|
+
.s-account-row:has(.s-auth-state:is(.is-unknown, .is-not_installed, .is-too_old))::before { background: var(--text-3); }
|
|
30
|
+
.s-account-row details { margin-top: var(--s-3); }
|
|
31
|
+
|
|
32
|
+
/* Layer 1: the title bar — name, state, default tag on the left; the buttons (`.s-actions`) on the right. */
|
|
33
|
+
.s-account-title-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
|
|
34
|
+
.s-account-title-left { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
|
|
35
|
+
.s-account-title-left strong { font-size: var(--fs-md); line-height: 1.4; overflow-wrap: anywhere; }
|
|
36
|
+
.s-account-default-tag { background: var(--accent-dim); color: var(--accent); font-weight: var(--fw-semibold); }
|
|
37
|
+
.s-account-row .s-actions:empty { display: none; }
|
|
38
|
+
|
|
39
|
+
/* Layer 2: the meta bar — who it is, who uses it (`.tag` pills). */
|
|
40
|
+
.s-account-meta-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); min-width: 0; margin-top: var(--s-3); }
|
|
41
|
+
.s-account-identity { font-family: var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
|
|
42
|
+
.s-account-used { color: var(--text-3); }
|
|
43
|
+
/* Used by N agents: the `Menu`'s button, drawn as the pill beside it. Its list is `.menu-list` (app.css), opened from the pill's own edge. */
|
|
44
|
+
button.s-account-used { display: inline-flex; align-items: center; gap: var(--s-1); border: 0; cursor: pointer; }
|
|
45
|
+
.s-account-used.has-users { color: var(--accent); background: var(--accent-dim); font-weight: var(--fw-semibold); }
|
|
46
|
+
.s-account-used.has-users:hover { background: var(--surface-2); }
|
|
47
|
+
.s-account-used.has-users:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
|
|
48
|
+
.s-account-used-menu .menu-list { left: 0; right: auto; min-width: 240px; max-width: min(380px, calc(100vw - 96px)); max-height: 280px; overflow-y: auto; }
|
|
49
|
+
.s-account-used-menu .menu-list.menu-up { top: auto; bottom: calc(100% + var(--s-1)); }
|
|
50
|
+
.s-account-used-menu .menu-list.menu-compact { max-height: 180px; }
|
|
51
|
+
.s-account-used-menu .menu-list.menu-short { max-height: 96px; }
|
|
52
|
+
.s-account-used-menu .menu-item { font-family: var(--font-mono); overflow-wrap: anywhere; }
|
|
53
|
+
|
|
54
|
+
/* Layer 3: the usage block — the short window ("5h") and the week, each a `CompactMeter` (name · bar · percent · reset: fixed columns, so stacked rows line up).
|
|
55
|
+
* Wide: two columns side by side; narrow: two rows stacked. */
|
|
56
|
+
.s-account-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s-1) var(--s-4); margin-top: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface); font-size: var(--fs-sm); line-height: 1.4; }
|
|
57
|
+
.s-account-usage.is-none { display: none; } /* a computer reports no usage: the dash says nothing, so it is not drawn (the node stays) */
|
|
58
|
+
/* Stale (last known, not read again): greyed as the Usage panel greys it, and said once. */
|
|
59
|
+
.s-account-usage.is-stale .u-cm-pct { color: var(--text-3); }
|
|
60
|
+
.s-account-usage.is-stale .u-cm-fill { background: var(--text-3); }
|
|
61
|
+
.s-usage-stale { grid-column: 1 / -1; color: var(--text-3); font-size: var(--fs-xs); }
|
|
62
|
+
|
|
63
|
+
.s-account-default { margin: 0; }
|
|
64
|
+
.s-accounts .s-account-default { padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--bg); }
|
|
14
65
|
.s-account-move { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
|
|
15
66
|
.s-account-move .check small { margin-left: var(--s-2); }
|
|
16
|
-
/* #3212 PR 2:
|
|
17
|
-
.s-account-head .s-account-add { margin-left: auto; }
|
|
18
|
-
.s-account-row .s-account-remove { color: var(--danger, var(--text-2)); }
|
|
67
|
+
/* #3212 PR 2: Remove's in-use list (a tab with an older copy of this file only loses the layout). */
|
|
19
68
|
.s-account-inuse ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
|
|
20
69
|
.s-account-inuse li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
|
|
21
70
|
.s-account-inuse li > span { flex: 1 1 12em; min-width: 0; overflow-wrap: anywhere; }
|
|
22
71
|
.s-account-inuse li > small { flex-basis: 100%; }
|
|
23
|
-
/* #3190 Part 3c: a paired computer's accounts under its name
|
|
24
|
-
.s-account-machine { display: grid; gap: var(--s-
|
|
72
|
+
/* #3190 Part 3c: a paired computer's accounts under its name — a tray one tone deeper holding the same account boxes. */
|
|
73
|
+
.s-accounts .s-account-machine { display: grid; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
|
|
25
74
|
.s-account-machine-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
|
|
26
75
|
.s-account-machine-head .s-account-add { margin-left: auto; }
|
|
27
|
-
|
|
28
|
-
.s-account-
|
|
76
|
+
/* Why a row or a whole computer cannot be changed: a quiet note. */
|
|
77
|
+
.s-account-why { margin: var(--s-2) 0 0; padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-size: var(--fs-xs); overflow-wrap: anywhere; }
|
|
78
|
+
.s-account-machine > .s-account-why { margin: 0; background: var(--bg); }
|
|
@@ -101,6 +101,8 @@ register("app", {
|
|
|
101
101
|
opFailed: "Settings were not applied", openSettings: "Open Settings",
|
|
102
102
|
restartWaiting: "{0} saved change(s) take effect after AgEnD restarts", restartNow: "Restart now", restartLater: "Later",
|
|
103
103
|
restartConfirm: "Restart AgEnD now?\n\nEvery agent stops and starts again, work in progress is interrupted, and the panel is unreachable for up to a minute. A notice is posted to your chat channel.",
|
|
104
|
+
// S-92: a fleet with no chat connection — its restart is recorded in the dashboard's Notices instead.
|
|
105
|
+
restartConfirmWebOnly: "Restart AgEnD now?\n\nEvery agent stops and starts again, work in progress is interrupted, and the panel is unreachable for up to a minute. It is recorded in this dashboard's Notices.",
|
|
104
106
|
restartOnHost: "Restart AgEnD to use them.",
|
|
105
107
|
restartOnHostChat: "Send /restart in General to use them.",
|
|
106
108
|
restartRefused: "Restart refused: {0}",
|
|
@@ -149,6 +151,7 @@ register("app", {
|
|
|
149
151
|
opFailed: "設定沒有套用", openSettings: "開啟設定",
|
|
150
152
|
restartWaiting: "{0} 項已儲存的變更要在 AgEnD 重新啟動後才會生效", restartNow: "立即重新啟動", restartLater: "稍後",
|
|
151
153
|
restartConfirm: "現在重新啟動 AgEnD?\n\n所有 agent 都會停止再啟動,進行中的工作會被中斷,面板會有最多約一分鐘無法連線。聊天頻道會收到一則通知。",
|
|
154
|
+
restartConfirmWebOnly: "現在重新啟動 AgEnD?\n\n所有 agent 都會停止再啟動,進行中的工作會被中斷,面板會有最多約一分鐘無法連線。這次重新啟動會記錄在這個儀表板的通知中。",
|
|
152
155
|
restartOnHost: "請重新啟動 AgEnD 讓它們生效。",
|
|
153
156
|
restartOnHostChat: "請在 General 傳 /restart 讓它們生效。",
|
|
154
157
|
restartRefused: "重新啟動被拒絕:{0}",
|
|
@@ -388,6 +388,15 @@ function HubSwitcherSlot() {
|
|
|
388
388
|
return mod ? html`<${mod} />` : null;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
|
+
// Fleet-only lazy boundary: the Hub module graph never reaches member Settings or its private inbox.
|
|
392
|
+
function MemberPairingNoticesSlot() {
|
|
393
|
+
const [Component, setComponent] = useState(null);
|
|
394
|
+
useEffect(() => { let live = true; import("/ui/js/hub-quick-pairing.js").then(m => {
|
|
395
|
+
if (live && m.MemberPairingNotices) setComponent(() => m.MemberPairingNotices);
|
|
396
|
+
}, () => {}); return () => { live = false; }; }, []);
|
|
397
|
+
return Component ? html`<${Component} />` : null;
|
|
398
|
+
}
|
|
399
|
+
|
|
391
400
|
function Sidebar({ route, onNewInstance, viewOnly }) {
|
|
392
401
|
const app = useStore(appStore);
|
|
393
402
|
const shell = useStore(shellStore);
|
|
@@ -819,9 +828,9 @@ export async function refreshRestartPending() {
|
|
|
819
828
|
* Restart now asks first and is never automatic (the leader's default: a Save that restarted on its own once took 33
|
|
820
829
|
* agents down at once). Asked again whenever a Save or a restart settles. Left to the Save in hand while it runs or offers
|
|
821
830
|
* its own restart (Settings' card, or the line above in another panel). Over a temporary public link it says so and
|
|
822
|
-
* offers nothing. Restart now
|
|
823
|
-
*
|
|
824
|
-
*
|
|
831
|
+
* offers nothing. S-92 (#3326 D1): Restart now whenever the page can restart — with no Settings job behind it (a hand
|
|
832
|
+
* edit) too: the server makes the job (`restartRunner(null)`). The muted hint (#3363's words: chat fleets send /restart in
|
|
833
|
+
* General, web-only fleets are told to restart AgEnD, no command) is for a page that cannot restart.
|
|
825
834
|
*/
|
|
826
835
|
function RestartLine() {
|
|
827
836
|
const { restartPending: pending, settingsOp: op, restartRunner, connections } = useStore(appStore);
|
|
@@ -833,13 +842,13 @@ function RestartLine() {
|
|
|
833
842
|
if (op && op.job && op.job.targets && op.job.targets.some((r) => r.target === "fleet" && r.status === "restart-required")) return null;
|
|
834
843
|
const seen = `${pending.jobId}|${pending.keys.join(",")}`;
|
|
835
844
|
if (later === seen) return null;
|
|
836
|
-
const canRestart =
|
|
845
|
+
const canRestart = typeof restartRunner === "function";
|
|
837
846
|
// connections === 0 is web-only; null is unknown — do not name General.
|
|
838
|
-
const hint = !
|
|
839
|
-
? t(connections > 0 ? "app.restartOnHostChat" : "app.restartOnHost")
|
|
840
|
-
: null;
|
|
847
|
+
const hint = !canRestart ? t(connections > 0 ? "app.restartOnHostChat" : "app.restartOnHost") : null;
|
|
841
848
|
const restart = async () => {
|
|
842
|
-
|
|
849
|
+
// S-92: on a fleet with no chat connection the restart is announced in the dashboard's Notices, not a chat channel.
|
|
850
|
+
const message = t(connections === 0 ? "app.restartConfirmWebOnly" : "app.restartConfirm");
|
|
851
|
+
if (!(await confirmDialog({ title: t("app.restartNow"), message, confirmLabel: t("app.restartNow"), danger: true }))) return;
|
|
843
852
|
setBusy(true);
|
|
844
853
|
let res;
|
|
845
854
|
try { res = await restartRunner(pending.jobId); } catch { res = { ok: false }; }
|
|
@@ -1003,6 +1012,7 @@ export function Shell({ panels, onNewInstance, viewOnly = false }) {
|
|
|
1003
1012
|
<main id="main" class="main" tabindex="-1" inert=${shell.drawer && narrow() ? true : undefined}>
|
|
1004
1013
|
<${ConnectionLine} />
|
|
1005
1014
|
<${StartupLine} />
|
|
1015
|
+
${viewOnly || guest || hub || !hubMarks().member || (nav.route?.panel === "settings" && nav.route.section === "hub") ? null : html`<${MemberPairingNoticesSlot} />`}
|
|
1006
1016
|
${viewOnly || guest || hub ? null : html`<${OperationLine} route=${nav.route} />`}
|
|
1007
1017
|
${viewOnly || guest || hub ? null : html`<${RestartLine} />`}
|
|
1008
1018
|
${viewOnly || guest || hub || !shell.banner ? null : html`<${shell.banner} />`}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/* #3298 S-89: the Hub's signed-in welcome and Administration → Group permissions. Its own stylesheet (linked by
|
|
2
|
+
hub-group-strings.js) so a tab holding an older hub-chat.css or hub-owner.css still draws these pages. Built on the shared
|
|
3
|
+
card / s-row / field / btn / tag pieces; only the layout of the two entries and the group rows is here. */
|
|
4
|
+
.hub-home.has-welcome .hub-home-pick.hub-home-welcome { align-items: flex-start; justify-content: flex-start; overflow-y: auto; }
|
|
5
|
+
.hub-welcome-page { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s-3); }
|
|
6
|
+
.hub-welcome { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-3); }
|
|
7
|
+
.hub-welcome-card { display: flex; flex-direction: column; gap: var(--s-2); min-height: 180px; }
|
|
8
|
+
.hub-welcome-card h3 { font-size: var(--fs-lg, 1.15rem); margin: 0; }
|
|
9
|
+
.hub-welcome-actions { margin-top: auto; display: flex; gap: var(--s-2); }
|
|
10
|
+
.hub-groups-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); }
|
|
11
|
+
.hub-welcome-card.is-off h3 { color: var(--text-2); }
|
|
12
|
+
.hub-welcome-fleets { margin: 0; padding-left: var(--s-4); }
|
|
13
|
+
@media (max-width: 899px) {
|
|
14
|
+
/* A phone shows the welcome first, then the chat list under it. */
|
|
15
|
+
.hub-home.has-welcome { flex-direction: column; overflow-y: auto; }
|
|
16
|
+
.hub-home.has-welcome .hub-home-pick.hub-home-welcome { display: block; flex: none; padding: var(--s-3); }
|
|
17
|
+
.hub-home.has-welcome .hub-home-list { flex: none; overflow: visible; }
|
|
18
|
+
}
|
|
19
|
+
/* A group's DN takes its own full line; its permissions, fleets and Remove wrap under it (hub-owner.css rows don't wrap). */
|
|
20
|
+
.hub-rows .s-row.hub-row.hub-group-row { flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
|
|
21
|
+
.hub-rows .s-row.hub-row.hub-group-row > .hub-row-text { flex: 1 1 100%; }
|
|
22
|
+
.hub-group-dn { overflow-wrap: anywhere; }
|
|
23
|
+
.hub-group-cap { display: inline-flex; align-items: center; gap: var(--s-1); white-space: nowrap; }
|
|
24
|
+
.hub-group-fleets { display: inline-flex; align-items: center; gap: var(--s-1); }
|
|
25
|
+
.hub-group-fleets input { width: 4.5em; }
|
|
26
|
+
.hub-groups-impact ul { margin: var(--s-1) 0 var(--s-2); padding-left: var(--s-4); }
|
package/dist/ui/shared/hub.css
CHANGED
|
@@ -17,6 +17,7 @@ a.hub-switch-item:focus-visible { outline: 2px solid var(--focus); outline-offse
|
|
|
17
17
|
.hub-fp-label { font-size: var(--fs-sm); color: var(--text-2); }
|
|
18
18
|
.hub-fp-groups { font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: .04em; word-spacing: .3em; overflow-wrap: anywhere; }
|
|
19
19
|
.hub-fp-full { font-family: var(--font-mono); font-size: var(--fs-xs); overflow-wrap: anywhere; color: var(--text-2); }
|
|
20
|
+
.hub-security-notices { flex: none; max-height: 38vh; overflow: auto; }
|
|
20
21
|
.hub-fp .btn-link { justify-self: start; }
|
|
21
22
|
.hub-steps-lead { margin: var(--s-1) 0 0; }
|
|
22
23
|
.hub-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
|
|
@@ -50,7 +50,7 @@ export const HOST_MESSAGES = [
|
|
|
50
50
|
["unknown probe", "不支援的檢查"],
|
|
51
51
|
["fleet not loaded", "設定尚未載入"],
|
|
52
52
|
["another secret operation is still running", "另一個寫入 token 的操作還在進行中"],
|
|
53
|
-
["setup cleanup failed;
|
|
53
|
+
["setup cleanup failed; some saved changes may not have been undone. This page cannot repair the incomplete rollback", "設定的復原失敗;部分已儲存的變更可能未能撤銷。這個頁面無法修復未完成的復原"],
|
|
54
54
|
["setup was not committed", "設定沒有寫入"],
|
|
55
55
|
["Token verification is not permitted over a public link", "公開連結不能驗證 token"],
|
|
56
56
|
["This bot token is already being polled by the running fleet. Enter the group id by hand, or stop AgEnD first.", "執行中的 fleet 正在使用這個 bot token。請手動輸入群組 id,或先停止 AgEnD。"],
|
|
@@ -64,6 +64,8 @@ export const HOST_MESSAGES = [
|
|
|
64
64
|
/** What the host answers with a code instead of words (the confirmation gate, settings-effect.ts; the finish step). */
|
|
65
65
|
export const HOST_CODES = {
|
|
66
66
|
en: {
|
|
67
|
+
// Cached servers may still return this older message; its recovery copy follows the current page.
|
|
68
|
+
"setup cleanup failed; inspect configuration on the host": "setup cleanup failed; some saved changes may not have been undone. This page cannot repair the incomplete rollback",
|
|
67
69
|
invalid_quickstart: "This setup is not valid. Review it and try again.",
|
|
68
70
|
connection_exists: "That connection already exists — a new connection never replaces one.",
|
|
69
71
|
agent_conflict: "That agent name is taken, or that agent does not exist.",
|
|
@@ -76,6 +78,7 @@ export const HOST_CODES = {
|
|
|
76
78
|
signin_cleanup_failed: "The login process could not be confirmed closed. Close it on the host and restart setup before retrying.",
|
|
77
79
|
},
|
|
78
80
|
"zh-TW": {
|
|
81
|
+
"setup cleanup failed; inspect configuration on the host": "設定的復原失敗;部分已儲存的變更可能未能撤銷。這個頁面無法修復未完成的復原",
|
|
79
82
|
invalid_quickstart: "這份設定無效。請檢查後再試一次。",
|
|
80
83
|
connection_exists: "這個連線已存在 —— 新的連線不會取代既有的連線。",
|
|
81
84
|
agent_conflict: "這個 agent 名稱已被使用,或那個 agent 不存在。",
|
package/dist/ui/shared/signin.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
const $ = (id) => document.getElementById(id);
|
|
12
12
|
const T = {
|
|
13
13
|
en: {
|
|
14
|
+
signout_unsaved: "Signed out for now, but the change could not be saved: a restart may bring the session back. This page cannot repair session storage.",
|
|
14
15
|
checking: "Checking your session…", title: "Sign in to AgEnD", lead: "Enter your sign-in code.",
|
|
15
16
|
label: "One-time code", submit: "Sign in", working: "Signing in…",
|
|
16
17
|
hint: "No code? Send /web in General, then press a sign-in button to get one.",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
dev_qr: "Or scan this QR code with a device that is already signed in as the owner. It holds this page's address and the code above, nothing else.",
|
|
47
48
|
},
|
|
48
49
|
"zh-TW": {
|
|
50
|
+
signout_unsaved: "暫時登出了,但變更沒能儲存:重新啟動後這個工作階段可能會回來。這個頁面無法修復工作階段的儲存問題。",
|
|
49
51
|
checking: "正在確認登入狀態…", title: "登入 AgEnD", lead: "輸入登入碼。",
|
|
50
52
|
label: "一次性登入碼", submit: "登入", working: "登入中…",
|
|
51
53
|
hint: "沒收到?在 General 傳 /web,再按登入按鈕取碼。",
|
|
@@ -197,7 +199,7 @@
|
|
|
197
199
|
// A sign-out the server could not make durable says so here, once (agend-auth.js signOut).
|
|
198
200
|
try {
|
|
199
201
|
const note = sessionStorage.getItem("agend_signout_note");
|
|
200
|
-
if (note) { sessionStorage.removeItem("agend_signout_note"); $("msg").textContent = note; }
|
|
202
|
+
if (note) { sessionStorage.removeItem("agend_signout_note"); $("msg").textContent = note.startsWith("Signed out for now, but the change could not be saved") ? t("signout_unsaved") : note; }
|
|
201
203
|
} catch { /* private mode */ }
|
|
202
204
|
$("code").focus();
|
|
203
205
|
offerResend();
|