@songsid/agend 2.3.5-alpha.11 → 2.3.5-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/THIRD_PARTY_NOTICES.md +4 -0
  2. package/dist/accounts-view.d.ts +3 -0
  3. package/dist/accounts-view.js +2 -2
  4. package/dist/accounts-view.js.map +1 -1
  5. package/dist/agent-workspace.d.ts +1 -2
  6. package/dist/agent-workspace.js +8 -29
  7. package/dist/agent-workspace.js.map +1 -1
  8. package/dist/auth-api.js +15 -29
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/claude-code.js +16 -3
  11. package/dist/backend/claude-code.js.map +1 -1
  12. package/dist/backend/codex.d.ts +7 -14
  13. package/dist/backend/codex.js +25 -29
  14. package/dist/backend/codex.js.map +1 -1
  15. package/dist/backend/credential-profile.d.ts +16 -0
  16. package/dist/backend/credential-profile.js +44 -0
  17. package/dist/backend/credential-profile.js.map +1 -1
  18. package/dist/backend/grok-mcp.d.ts +5 -0
  19. package/dist/backend/grok-mcp.js +221 -0
  20. package/dist/backend/grok-mcp.js.map +1 -0
  21. package/dist/backend/grok.d.ts +0 -10
  22. package/dist/backend/grok.js +5 -82
  23. package/dist/backend/grok.js.map +1 -1
  24. package/dist/backend/muse.d.ts +3 -1
  25. package/dist/backend/muse.js +31 -1
  26. package/dist/backend/muse.js.map +1 -1
  27. package/dist/backend/types.d.ts +18 -1
  28. package/dist/backend/types.js.map +1 -1
  29. package/dist/build-provenance.json +1 -1
  30. package/dist/cli.js +18 -0
  31. package/dist/cli.js.map +1 -1
  32. package/dist/codex-pane-ownership.d.ts +13 -0
  33. package/dist/codex-pane-ownership.js +192 -0
  34. package/dist/codex-pane-ownership.js.map +1 -0
  35. package/dist/create-host-account.d.ts +17 -0
  36. package/dist/create-host-account.js +47 -0
  37. package/dist/create-host-account.js.map +1 -0
  38. package/dist/daemon.d.ts +25 -0
  39. package/dist/daemon.js +203 -16
  40. package/dist/daemon.js.map +1 -1
  41. package/dist/delivery-outbox.js +7 -0
  42. package/dist/delivery-outbox.js.map +1 -1
  43. package/dist/fleet-manager.d.ts +40 -9
  44. package/dist/fleet-manager.js +198 -47
  45. package/dist/fleet-manager.js.map +1 -1
  46. package/dist/general-knowledge/skills/concepts/SKILL.md +1 -1
  47. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +1 -1
  48. package/dist/hub/client.d.ts +1 -1
  49. package/dist/hub/client.js +11 -0
  50. package/dist/hub/client.js.map +1 -1
  51. package/dist/hub/compose/member.d.ts +2 -2
  52. package/dist/hub/compose/member.js +11 -3
  53. package/dist/hub/compose/member.js.map +1 -1
  54. package/dist/hub/member/exposure-api.d.ts +2 -0
  55. package/dist/hub/member/exposure-api.js +4 -2
  56. package/dist/hub/member/exposure-api.js.map +1 -1
  57. package/dist/hub/member/pairing-api.d.ts +2 -2
  58. package/dist/hub/member/pairing-api.js +2 -2
  59. package/dist/hub/member/pairing-api.js.map +1 -1
  60. package/dist/hub/server.js +8 -0
  61. package/dist/hub/server.js.map +1 -1
  62. package/dist/hub-pairing-summary.d.ts +3 -1
  63. package/dist/hub-pairing-summary.js +6 -3
  64. package/dist/hub-pairing-summary.js.map +1 -1
  65. package/dist/instance-lifecycle.js +29 -1
  66. package/dist/instance-lifecycle.js.map +1 -1
  67. package/dist/locale.js +13 -9
  68. package/dist/locale.js.map +1 -1
  69. package/dist/public-web-link.d.ts +5 -0
  70. package/dist/public-web-link.js +8 -0
  71. package/dist/public-web-link.js.map +1 -1
  72. package/dist/runtime-client-store.js +5 -0
  73. package/dist/runtime-client-store.js.map +1 -1
  74. package/dist/runtime-pane-private.d.ts +2 -0
  75. package/dist/runtime-pane-private.js +25 -0
  76. package/dist/runtime-pane-private.js.map +1 -1
  77. package/dist/runtime-pane-private.ps1 +74 -7
  78. package/dist/selection-card.d.ts +4 -3
  79. package/dist/selection-card.js +2 -1
  80. package/dist/selection-card.js.map +1 -1
  81. package/dist/settings-api.js +5 -17
  82. package/dist/settings-api.js.map +1 -1
  83. package/dist/settings-change.d.ts +2 -0
  84. package/dist/settings-change.js +74 -31
  85. package/dist/settings-change.js.map +1 -1
  86. package/dist/settings-confirmation.d.ts +23 -0
  87. package/dist/settings-confirmation.js +13 -2
  88. package/dist/settings-confirmation.js.map +1 -1
  89. package/dist/settings-effect.d.ts +4 -0
  90. package/dist/settings-effect.js +14 -14
  91. package/dist/settings-effect.js.map +1 -1
  92. package/dist/settings-http-confirmation.d.ts +3 -1
  93. package/dist/settings-http-confirmation.js +12 -7
  94. package/dist/settings-http-confirmation.js.map +1 -1
  95. package/dist/settings-summary.d.ts +24 -0
  96. package/dist/settings-summary.js +42 -0
  97. package/dist/settings-summary.js.map +1 -0
  98. package/dist/signin-keepalive.d.ts +25 -1
  99. package/dist/signin-keepalive.js +44 -1
  100. package/dist/signin-keepalive.js.map +1 -1
  101. package/dist/transcript-delta-reader.d.ts +9 -1
  102. package/dist/transcript-delta-reader.js +37 -8
  103. package/dist/transcript-delta-reader.js.map +1 -1
  104. package/dist/ui/accounts-view.js +9 -7
  105. package/dist/ui/agent-details-settings.js +253 -0
  106. package/dist/ui/agent-instructions-field.js +69 -0
  107. package/dist/ui/agent-page-strings.js +148 -0
  108. package/dist/ui/chat-quote.js +12 -17
  109. package/dist/ui/hub-client.js +1 -1
  110. package/dist/ui/hub-company-join-strings.js +1 -1
  111. package/dist/ui/hub-company-join.js +7 -0
  112. package/dist/ui/hub-strings.js +10 -6
  113. package/dist/ui/native-instance-settings.js +47 -14
  114. package/dist/ui/panel-chat.js +2 -1
  115. package/dist/ui/panel-details.js +38 -14
  116. package/dist/ui/panel-fleet.js +9 -3
  117. package/dist/ui/panel-settings.js +17 -8
  118. package/dist/ui/settings-access-overview.js +188 -0
  119. package/dist/ui/settings-access-strings.js +1 -1
  120. package/dist/ui/settings-confirm.js +5 -5
  121. package/dist/ui/settings-devices.js +5 -5
  122. package/dist/ui/settings-dialogs.js +208 -100
  123. package/dist/ui/settings-hub-company-join.js +69 -14
  124. package/dist/ui/settings-hub.js +13 -5
  125. package/dist/ui/settings-layout.js +1 -1
  126. package/dist/ui/settings-model.js +15 -0
  127. package/dist/ui/settings-strings.js +8 -8
  128. package/dist/ui/shared/access-overview.css +48 -0
  129. package/dist/ui/shared/app-i18n.js +2 -2
  130. package/dist/ui/shared/app-shell.js +145 -4
  131. package/dist/ui/shared/app-store.js +2 -0
  132. package/dist/ui/shared/app.css +69 -7
  133. package/dist/ui/shared/chat-render.js +17 -5
  134. package/dist/ui/shared/device-roles.js +1 -1
  135. package/dist/ui/shared/instance-nav.js +5 -1
  136. package/dist/ui/shared/signin.js +130 -43
  137. package/dist/ui/shared/usage-dialog.js +27 -15
  138. package/dist/ui/shared/view-strings.js +2 -0
  139. package/dist/ui/shared/web-authorize.js +2 -2
  140. package/dist/ui/signin.html +19 -8
  141. package/dist/update-dispatch.d.ts +50 -0
  142. package/dist/update-dispatch.js +58 -2
  143. package/dist/update-dispatch.js.map +1 -1
  144. package/dist/usage/format-rich.js +1 -1
  145. package/dist/usage/format-rich.js.map +1 -1
  146. package/dist/usage/usage-api.d.ts +8 -2
  147. package/dist/usage/usage-api.js +12 -5
  148. package/dist/usage/usage-api.js.map +1 -1
  149. package/dist/web-api.d.ts +5 -0
  150. package/dist/web-api.js +58 -0
  151. package/dist/web-api.js.map +1 -1
  152. package/dist/web-backend-login.d.ts +2 -0
  153. package/dist/web-backend-login.js.map +1 -1
  154. package/dist/web-remote-access.d.ts +71 -3
  155. package/dist/web-remote-access.js +197 -6
  156. package/dist/web-remote-access.js.map +1 -1
  157. package/dist/web-session.d.ts +4 -2
  158. package/dist/web-session.js +5 -2
  159. package/dist/web-session.js.map +1 -1
  160. package/dist/workspace-file-policy.d.ts +2 -0
  161. package/dist/workspace-file-policy.js +31 -0
  162. package/dist/workspace-file-policy.js.map +1 -0
  163. package/dist/workspace-follow.js +2 -1
  164. package/dist/workspace-follow.js.map +1 -1
  165. package/package.json +2 -2
  166. package/templates/runtime-assets/runtime-pane-private.ps1 +74 -7
  167. package/dist/ui/shared/signin-authenticator.js +0 -60
  168. package/dist/ui/signin-authenticator.html +0 -60
@@ -0,0 +1,188 @@
1
+ // S-120 (M-2753 story 8): Settings → Access & security → Overview. Three cards up front — who is signed in (admins and
2
+ // guests, each with Sign out), the ways in from outside (the public link, a fixed address, connections from outside,
3
+ // shared links; Close now where the page may), and two-step confirmation (THIS admin's own authenticator, #3503: shown and
4
+ // linked, never changed here) — then the other connections, each on its own page with its own disconnect or remove.
5
+ // Every action here is an existing route asked again by the server: a sign-out is POST /ui/devices/signout (#3553).
6
+ // The words are English and 繁體中文, as everything in src/ui (tests/i18n-ui-literals-2390.test.ts).
7
+ import { html, useEffect, useState } from "/assets/app-html.js";
8
+ import { t, register } from "/assets/app-i18n.js";
9
+ import { Dialog } from "/assets/ui-dialog.js";
10
+ import { Icon } from "/assets/ui-icons.js";
11
+ import { navigate } from "/assets/app-nav.js";
12
+ import { appStore, useStore } from "/assets/app-store.js";
13
+ import { sectionPath } from "/assets/app-route.js";
14
+ import { api } from "./settings-confirm.js";
15
+ import { agoWords } from "./settings-devices.js";
16
+ import { roleName } from "/assets/device-roles.js";
17
+
18
+ register("accessov", {
19
+ en: {
20
+ tab: "Overview", devicesTitle: "Signed-in devices", devicesCount: "{0} signed in", more: "{0} more in Devices & sign-in", manageDevices: "Devices & sign-in", manageGuests: "Guests",
21
+ legend: "✓ the verified owner: may add devices and sign others out. Not verified: everyday use only.",
22
+ blockedOwner: "Verify as the owner first to sign out other devices.", blockedOther: "Another admin's device: only that admin can sign it out.",
23
+ signOutTitle: "Sign out {0}?", signOutLead: "{0} is signed out at once and has to sign in again.", signedOut: "{0} was signed out.",
24
+ entryTitle: "Ways in from outside", publicLink: "Public link", publicLinkHint: "An address that opens this dashboard from anywhere; signing in is still required.",
25
+ linkOpen: "Open", linkQuick: "temporary address", linkNamed: "fixed address {0}", linkLeft: "{0} left", hm: "{0} h {1} min", h: "{0} h", m: "{0} min", linkNoExpiry: "no expiry", linkClosed: "Closed", linkNotAllowed: "Not allowed",
26
+ outside: "Connections from outside", outsideHint: "Signing in from outside with the 6-digit code (authenticator app).", allowed: "Allowed", off: "Off",
27
+ shares: "Shared links", sharesHint: "Read-only office views and pages; whoever has the link can view them without signing in.",
28
+ sharesCount: "{0} open", none: "None", closeNow: "Close the public link now", manageSharing: "Public & sharing",
29
+ closeTitle: "Close the public link now?", closeLead: "The link stops working at once. Devices signed in through it are signed out.", closeGo: "Close the link", closed: "The public link is closed.", closeFailed: "The link could not be closed. Try again.",
30
+ outsideOwned: "This is the outside connection. Turn off “Connections from outside” in Owner verification to close it.",
31
+ twoStepTitle: "Owner verification", twoStepMine: "Your own authenticator app. Every admin sets up their own.",
32
+ app: "Authenticator app", appSet: "Set up on {0}", appNone: "Not set up", askCode: "Ask for my 6-digit code to confirm changes",
33
+ on: "On", goOwner: "Owner verification settings", twoStepNone: "Without it, changes from other devices are confirmed with Apply now.",
34
+ otherTitle: "Other connections", otherLead: "Disconnect or remove each one on its own page.",
35
+ hub: "Hub", hubHint: "Your team's Hub and the agents shared there", windows: "Windows computers", windowsHint: "Windows computers connected to run agents",
36
+ accounts: "AI accounts", accountsHint: "The Claude, Codex and other accounts your agents use", hubOn: "Connected", paired: "{0} connected",
37
+ },
38
+ "zh-TW": {
39
+ tab: "總覽", devicesTitle: "已登入的裝置", devicesCount: "{0} 個登入", more: "另外 {0} 個,到「裝置與登入」查看", manageDevices: "裝置與登入", manageGuests: "訪客",
40
+ legend: "✓ 已驗證的擁有者:可新增裝置、登出其他裝置。未驗證:只能使用一般功能。",
41
+ blockedOwner: "要先驗證為擁有者,才能登出其他裝置。", blockedOther: "別的管理員的裝置,只有那位管理員本人能登出。",
42
+ signOutTitle: "登出 {0}?", signOutLead: "{0} 會立即登出,之後需要重新登入。", signedOut: "已登出 {0}。",
43
+ entryTitle: "從外面連線的方式", publicLink: "公開連結", publicLinkHint: "從任何地方開啟這個儀表板的網址;開啟後仍要登入。",
44
+ linkOpen: "開啟中", linkQuick: "臨時網址", linkNamed: "固定網址 {0}", linkLeft: "剩 {0}", hm: "{0} 小時 {1} 分", h: "{0} 小時", m: "{0} 分", linkNoExpiry: "不過期", linkClosed: "已關閉", linkNotAllowed: "不允許",
45
+ outside: "從外面連線", outsideHint: "從外面登入時,用 6 位數驗證碼(驗證器 App)。", allowed: "允許", off: "關閉",
46
+ shares: "分享連結", sharesHint: "唯讀的辦公室畫面或網頁;拿到連結的人不用登入就能看。",
47
+ sharesCount: "{0} 個開放中", none: "沒有", closeNow: "立即關閉公開連結", manageSharing: "公開與分享",
48
+ closeTitle: "立即關閉公開連結?", closeLead: "連結會馬上失效,透過它登入的裝置也會一併登出。", closeGo: "關閉連結", closed: "公開連結已關閉。", closeFailed: "沒能關閉連結,請再試一次。",
49
+ outsideOwned: "這是「從外面連線」用的連結。要關閉,請到擁有者驗證關掉「從外面連線」。",
50
+ twoStepTitle: "擁有者驗證", twoStepMine: "這是你自己的驗證器 App;每位管理員各自設定。",
51
+ app: "驗證器 App", appSet: "已於 {0} 設定", appNone: "尚未設定", askCode: "確認變更時要求我的 6 位數驗證碼",
52
+ on: "開啟", goOwner: "擁有者驗證設定", twoStepNone: "未設定時,其他裝置上的變更以「立即套用」確認。",
53
+ otherTitle: "其他連線", otherLead: "到各自的頁面中斷或移除。",
54
+ hub: "Hub", hubHint: "你的團隊 Hub,以及在那裡分享的 Agent", windows: "Windows 電腦", windowsHint: "連上這裡、用來執行 Agent 的 Windows 電腦",
55
+ accounts: "AI 帳號", accountsHint: "Agent 使用的 Claude、Codex 等帳號", hubOn: "已連線", paired: "已連上 {0} 台",
56
+ },
57
+ });
58
+ const to = (k, ...a) => t(`accessov.${k}`, ...a);
59
+ /** M-2855: the tab's own label (a tab opened before this page existed holds an older settings-layout.js without it). */
60
+ export const accessOverviewLabel = () => to("tab");
61
+
62
+ /**
63
+ * M-2855: this page's stylesheet, linked once when the module loads (a tab opened before this page existed holds an
64
+ * older app.css with none of its rules). Before first render, so the cards never paint unstyled.
65
+ */
66
+ export function linkAccessOverviewCss(doc = typeof document !== "undefined" ? document : null) {
67
+ try {
68
+ if (!doc || !doc.head || doc.querySelector('link[data-access-overview-css="1"]')) return;
69
+ const link = doc.createElement("link");
70
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/access-overview.css"); link.setAttribute("data-access-overview-css", "1");
71
+ doc.head.appendChild(link);
72
+ } catch { /* the page still works without it */ }
73
+ }
74
+ linkAccessOverviewCss();
75
+ const SHOWN = 4;
76
+ const leftWords = (ms) => { const m = Math.max(1, Math.round(ms / 60_000)); return m >= 60 ? (m % 60 ? to("hm", Math.floor(m / 60), m % 60) : to("h", Math.floor(m / 60))) : to("m", m); };
77
+ const day = (ms) => { const d = new Date(ms); return `${d.getFullYear()}/${String(d.getMonth() + 1).padStart(2, "0")}/${String(d.getDate()).padStart(2, "0")}`; };
78
+
79
+ function Row({ label, value, tone, hint }) {
80
+ return html`<div class="s-ov-row"><dt>${label}</dt><dd class=${tone ? `s-ov-${tone}` : ""}>${value}</dd>${hint ? html`<small class="s-ov-hint">${hint}</small>` : null}</div>`;
81
+ }
82
+ function More({ label, onClick }) {
83
+ return html`<button type="button" class="s-ov-link" onClick=${onClick}><span>${label}</span><${Icon} name="chevron" size=${14} /></button>`;
84
+ }
85
+
86
+ export function AccessOverview({ web = {}, hub, openTab, overPublicLink, active = true }) {
87
+ // Devices: GET /ui/devices only (#3553) — every tier, its role, and whether this session may sign it out.
88
+ const [devices, setDevices] = useState(null);
89
+ const [outside, setOutside] = useState(null);
90
+ const [shares, setShares] = useState(null), [machines, setMachines] = useState(null);
91
+ const [ask, setAsk] = useState(null), [askClose, setAskClose] = useState(false), [linkNote, setLinkNote] = useState("");
92
+ const { publicLink } = useStore(appStore);
93
+ // #3600: the status frame this page saw when its close went through. Until the next frame arrives (each frame is a new
94
+ // object), that frame still says "open" for a link that is already closed: it is shown as closed, at once.
95
+ const [closedFrame, setClosedFrame] = useState(null);
96
+ const [busy, setBusy] = useState(false);
97
+ const [note, setNote] = useState("");
98
+ const load = async () => {
99
+ const [d, o] = await Promise.all([api("/ui/devices"), api("/ui/outside")]);
100
+ if (d.ok && d.body) setDevices(d.body.devices || []);
101
+ if (o.ok && o.body) setOutside(o.body);
102
+ // Existing reads only: the share lists (office + page) and the paired computers; one that is refused says nothing.
103
+ const [os, ps, rt] = await Promise.all([api("/ui/office-share"), api("/ui/page-share"), api("/ui/runtimes")]);
104
+ setShares([os, ps].reduce((n, r) => n + (r.ok && r.body && Array.isArray(r.body.shares) ? r.body.shares.length : 0), 0));
105
+ if (rt.ok && rt.body && rt.body.enabled) setMachines((rt.body.machines || []).length);
106
+ };
107
+ // Read again whenever the tab is shown: the tab panels stay mounted, so a device signed out on 裝置與登入 (or a link
108
+ // closed elsewhere) would otherwise still be listed here.
109
+ useEffect(() => { if (active) load(); }, [active]);
110
+ const rows = [...(devices || [])].sort((a, b) => (b.current ? 1 : 0) - (a.current ? 1 : 0));
111
+ const blockedWhy = (d) => to(d.signOutBlocked === "other_admin" ? "blockedOther" : "blockedOwner");
112
+ const signOut = async () => {
113
+ const d = ask; setBusy(true);
114
+ const r = await api("/ui/devices/signout", { method: "POST", body: JSON.stringify({ handle: d.handle }) });
115
+ setBusy(false); setAsk(null); setNote(r.ok ? to("signedOut", d.label) : (r.body && r.body.error) || `HTTP ${r.status}`);
116
+ load();
117
+ };
118
+ // The link's state: the shell's status frame (every fleet; a tab from before S-120 has none — then /ui/outside's).
119
+ const pub = web.public_link || {};
120
+ const framed = publicLink && publicLink.state !== "closed" && publicLink !== closedFrame ? { ...publicLink, quick: !pub.hostname } : null;
121
+ const link = framed || (outside && outside.link) || null;
122
+ // A web-only fleet's outside link is the owner's switch (#3008): closed there, not here (the route answers 409).
123
+ const outsideOwned = !!(link && outside && outside.webOnly && outside.outside);
124
+ const closeLink = async () => {
125
+ setBusy(true);
126
+ const seen = publicLink;
127
+ const r = await api("/ui/public-link/close", { method: "POST", body: "{}" });
128
+ setBusy(false); setAskClose(false);
129
+ if (r.ok && r.body && r.body.closed === true) setClosedFrame(seen); // only a close that happened; a refusal changes nothing
130
+ setLinkNote(r.ok ? to("closed") : r.body && r.body.error === "outside_link" ? to("outsideOwned") : to("closeFailed"));
131
+ load();
132
+ };
133
+ const linkValue = link ? html`<span class="tag tag-ok">${to("linkOpen")}</span> ${link.quick ? to("linkQuick") : to("linkNamed", pub.hostname || "")} · ${link.noExpiry ? to("linkNoExpiry") : link.expiresAt ? to("linkLeft", leftWords(link.expiresAt - Date.now())) : ""}`
134
+ : pub.allow_public === false ? to("linkNotAllowed") : pub.hostname ? `${to("linkClosed")} · ${to("linkNamed", pub.hostname)}` : to("linkClosed");
135
+ return html`<div class="s-ov" id="accessOverview">
136
+ <div class="s-ov-grid">
137
+ <section class="card s-ov-card s-ov-devices" id="ovDevices"><h3 class="s-ov-title"><${Icon} name="user" size=${18} />${to("devicesTitle")}</h3>
138
+ <p class="note">${to("devicesCount", rows.length)}</p>
139
+ <ul class="s-ov-devlist s-ov-list">${rows.slice(0, SHOWN).map((d) => html`<li class=${`s-ov-dev${d.current ? " current" : ""}`} key=${d.handle} data-handle=${d.handle}>
140
+ <div class="s-ov-dev-main"><span class="s-ov-dev-name">${d.label}${d.current ? html` <span class="tag">${t("app.thisDevice")}</span>` : null}</span>
141
+ <span class="s-ov-dev-meta"><span data-role=${d.tier === "admin" ? (d.verified ? "owner" : "admin") : d.tier}>${roleName(d.tier, d.verified)}</span> · ${t("app.lastActive", agoWords(d.lastSeen))}</span>
142
+ ${!d.current && !d.canSignOut ? html`<span class="s-ov-why">${blockedWhy(d)}</span>` : null}</div>
143
+ ${d.current ? null : html`<button type="button" class=${`btn btn-sm${d.canSignOut ? " btn-danger" : ""}`} data-ov-signout=${d.handle} disabled=${!d.canSignOut || busy} onClick=${() => d.canSignOut && setAsk(d)}>${t("app.signOut")}</button>`}
144
+ </li>`)}</ul>
145
+ ${rows.length > SHOWN ? html`<${More} label=${to("more", rows.length - SHOWN)} onClick=${() => openTab("login", "devicesCard")} />` : null}
146
+ <p class="note s-ov-legend">${to("legend")}</p>
147
+ ${note ? html`<p class="note" role="status">${note}</p>` : null}
148
+ <footer><${More} label=${to("manageDevices")} onClick=${() => openTab("login", "devicesCard")} /><${More} label=${to("manageGuests")} onClick=${() => openTab("guests")} /></footer>
149
+ </section>
150
+ <section class="card s-ov-card" id="ovEntry"><h3 class="s-ov-title"><${Icon} name="globe" size=${18} />${to("entryTitle")}</h3>
151
+ <dl class="s-ov-facts">
152
+ <${Row} label=${to("publicLink")} hint=${to("publicLinkHint")} value=${linkValue} />
153
+ ${outside && outside.webOnly ? html`<${Row} label=${to("outside")} hint=${to("outsideHint")} value=${to(outside.outside ? "allowed" : "off")} />` : null}
154
+ ${shares !== null ? html`<${Row} label=${to("shares")} hint=${to("sharesHint")} value=${shares ? to("sharesCount", shares) : to("none")} tone=${shares ? "" : "muted"} />` : null}
155
+ </dl>
156
+ ${link && !overPublicLink ? outsideOwned
157
+ ? html`<p class="note" id="ovOutsideOwned">${to("outsideOwned")} <${More} label=${to("goOwner")} onClick=${() => openTab("login", "outsideCard")} /></p>`
158
+ : html`<div class="s-ov-actions"><button type="button" class="btn btn-sm btn-danger" id="ovCloseLink" disabled=${busy} onClick=${() => setAskClose(true)}>${to("closeNow")}</button></div>` : null}
159
+ ${linkNote ? html`<p class="note" role="status" id="ovLinkNote">${linkNote}</p>` : null}
160
+ <footer><${More} label=${to("manageSharing")} onClick=${() => openTab("sharing")} /></footer>
161
+ </section>
162
+ <section class="card s-ov-card" id="ovTwoStep"><h3 class="s-ov-title"><${Icon} name="key" size=${18} />${to("twoStepTitle")}</h3>
163
+ <p class="note">${to("twoStepMine")}</p>
164
+ <dl class="s-ov-facts">
165
+ <${Row} label=${to("app")} value=${outside && outside.enrolled ? html`<span class="tag tag-ok">${to("appSet", day(outside.enrolledAt))}</span>` : html`<span class="tag">${to("appNone")}</span>`} />
166
+ <${Row} label=${to("askCode")} value=${to(outside && outside.strict ? "on" : "off")} tone=${outside && outside.strict ? "" : "muted"} />
167
+ </dl>
168
+ ${outside && !outside.enrolled ? html`<p class="note">${to("twoStepNone")}</p>` : null}
169
+ <footer><${More} label=${to("goOwner")} onClick=${() => openTab("login", "outsideCard")} /></footer>
170
+ </section>
171
+ </div>
172
+ <section class="s-ov-other" id="ovOther"><h3>${to("otherTitle")}</h3><p class="note">${to("otherLead")}</p>
173
+ <div class="s-ov-tiles">
174
+ ${[["plug", "hub", "hubHint", "hub", hub ? to("hubOn") : null], ["code", "windows", "windowsHint", "runtimes", machines ? to("paired", machines) : null], ["bot", "accounts", "accountsHint", "agents", null]].map(([icon, k, hint, sec, state]) => html`
175
+ <button type="button" class="s-ov-tile" data-ov-go=${sec} onClick=${() => navigate(sectionPath(sec))}><${Icon} name=${icon} size=${18} />
176
+ <span><strong>${to(k)}</strong><small>${to(hint)}</small>${state ? html`<small class="s-ov-state">${state}</small>` : null}</span><${Icon} name="chevron" size=${16} /></button>`)}
177
+ </div>
178
+ </section>
179
+ ${askClose ? html`<${Dialog} title=${to("closeTitle")} onClose=${() => { if (!busy) setAskClose(false); }} busy=${busy} actions=${html`
180
+ <button type="button" class="btn" disabled=${busy} onClick=${() => setAskClose(false)}>${t("app.cancel")}</button>
181
+ <button type="button" class="btn btn-danger" id="ovCloseGo" disabled=${busy} onClick=${closeLink}>${to("closeGo")}</button>`}>
182
+ <p class="note">${to("closeLead")}</p></${Dialog}>` : null}
183
+ ${ask ? html`<${Dialog} title=${to("signOutTitle", ask.label)} onClose=${() => { if (!busy) setAsk(null); }} busy=${busy} actions=${html`
184
+ <button type="button" class="btn" disabled=${busy} onClick=${() => setAsk(null)}>${t("app.cancel")}</button>
185
+ <button type="button" class="btn btn-danger" id="ovSignOutGo" disabled=${busy} onClick=${signOut}>${t("app.signOut")}</button>`}>
186
+ <p class="note">${to("signOutLead", ask.label)}</p></${Dialog}>` : null}
187
+ </div>`;
188
+ }
@@ -23,7 +23,7 @@ register("settings", {
23
23
  },
24
24
  "zh-TW": {
25
25
  webLoginQr: "新裝置用其他裝置登入時顯示 QR Code",
26
- webLoginQrHint: "顯示在新裝置登入頁、8 碼裝置登入碼旁邊。裡面只有該頁面的網址和裝置登入碼,沒有任何憑證;核准仍需要已登入並驗證擁有者的裝置。預設關閉;有連接聊天平台的 fleet 不受影響。",
26
+ webLoginQrHint: "顯示在新裝置登入頁、8 字元裝置登入碼旁邊。裡面只有該頁面的網址和裝置登入碼,沒有任何憑證;核准仍需要已登入並驗證擁有者的裝置。預設關閉;有連接聊天平台的 fleet 不受影響。",
27
27
  },
28
28
  });
29
29
 
@@ -63,8 +63,7 @@ const finals = new Map(); // id → its decided view
63
63
  let timer = null, polling = false;
64
64
 
65
65
  function publish() {
66
- appStore.set({
67
- pendingChanges: [...tracked.values()].map(({ view, at, label, retry, displaySummary }) => ({
66
+ const views = [...tracked.values()].map(({ view, at, label, retry, displaySummary }) => ({
68
67
  ...view,
69
68
  label: label || null,
70
69
  // Display only: the server owns the diff, confirmation digest and execution.
@@ -84,8 +83,9 @@ function publish() {
84
83
  dismiss: TERMINAL.has(view.state) ? () => forget(view.id) : null,
85
84
  // AGEND-118: a request that ended without applying can be sent again (the same write, a new confirmation).
86
85
  retry: retry && resendable(view) ? () => resend(view.id) : null,
87
- })),
88
- });
86
+ }));
87
+ appStore.set({ pendingChanges: views.filter(view => view.presentation !== "hub-join"),
88
+ hubJoinChanges: views.filter(view => view.presentation === "hub-join") });
89
89
  }
90
90
 
91
91
  function forget(id) {
@@ -303,5 +303,5 @@ export function resetConfirmations() {
303
303
  for (const e of tracked.values()) if (e.doneTimer) clearTimeout(e.doneTimer);
304
304
  tracked.clear(); finals.clear();
305
305
  if (timer) { clearTimeout(timer); timer = null; }
306
- appStore.set({ pendingChanges: [] });
306
+ appStore.set({ pendingChanges: [], hubJoinChanges: [] });
307
307
  }
@@ -58,7 +58,7 @@ register("devices", {
58
58
  signOutAllLeadChat: "This device, your other devices and every guest and read-only session are signed out. Other admins' devices stay signed in. You will have to sign in again.",
59
59
  },
60
60
  "zh-TW": {
61
- title: "裝置與登入", lead: "用 8 碼裝置登入碼讓新裝置登入。在已登入且已驗證擁有者的裝置上,到這裡核准。",
61
+ title: "裝置與登入", lead: "用 8 字元裝置登入碼讓新裝置登入。在已登入且已驗證擁有者的裝置上,到這裡核准。",
62
62
  add: "新增裝置", noCopy: "核准不會複製這台裝置的登入狀態,新裝置會取得自己的工作階段。",
63
63
  ownerOnly: "只有已驗證擁有者的裝置才能新增裝置。請使用 AgEnD 電腦,或用驗證器 App 登入。",
64
64
  dlgTitle: "新增裝置", dlgLead: "在新裝置上選「使用其他裝置登入」,再輸入它顯示的裝置登入碼。",
@@ -81,12 +81,12 @@ register("devices", {
81
81
  signedOut: "已登出 {0}。", alreadyGone: "這台裝置已經登出了。",
82
82
  notSaved: "暫時登出了,但變更沒能儲存:重新啟動後這個工作階段可能會回來。這個頁面無法修復工作階段的儲存問題。",
83
83
  authorityOff: "網頁授權已關閉,所以沒有任何裝置是擁有者:不能新增裝置,也不能登出其他裝置。",
84
- chatLead: "登入這個儀表板的所有裝置。你可以登出自己的裝置,以及任何訪客或唯讀的登入;別的管理者的裝置只有那位管理者本人能登出。",
85
- signOutOtherAdmin: "只有這台裝置所屬的管理者本人能登出它。",
86
- lostOther: "那台裝置屬於別的管理者:只有他本人能登出。",
84
+ chatLead: "登入這個儀表板的所有裝置。你可以登出自己的裝置,以及任何訪客或唯讀的登入;別的管理員的裝置只有那位管理員本人能登出。",
85
+ signOutOtherAdmin: "只有這台裝置所屬的管理員本人能登出它。",
86
+ lostOther: "那台裝置屬於別的管理員:只有他本人能登出。",
87
87
  signOutAll: "全部登出", signOutAllTitle: "全部登出?",
88
88
  signOutAllLeadWeb: "所有裝置都會登出,包含這一台,之後需要重新登入。",
89
- signOutAllLeadChat: "這台裝置、你的其他裝置,以及所有訪客和唯讀的登入都會登出;別的管理者的裝置不受影響。之後需要重新登入。",
89
+ signOutAllLeadChat: "這台裝置、你的其他裝置,以及所有訪客和唯讀的登入都會登出;別的管理員的裝置不受影響。之後需要重新登入。",
90
90
  },
91
91
  });
92
92
  const td = (k, ...v) => t(`devices.${k}`, ...v);