@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.
Files changed (158) hide show
  1. package/dist/accounts-view.d.ts +17 -0
  2. package/dist/accounts-view.js +33 -6
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/apply-job.d.ts +5 -0
  5. package/dist/apply-job.js +10 -3
  6. package/dist/apply-job.js.map +1 -1
  7. package/dist/auth-api.d.ts +1 -1
  8. package/dist/auth-api.js +4 -2
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/build-provenance.json +1 -1
  11. package/dist/config-validator.js +2 -1
  12. package/dist/config-validator.js.map +1 -1
  13. package/dist/fleet-manager.d.ts +25 -2
  14. package/dist/fleet-manager.js +158 -23
  15. package/dist/fleet-manager.js.map +1 -1
  16. package/dist/general-knowledge/steering/core-rules.md +1 -1
  17. package/dist/hub/catalog.d.ts +1 -1
  18. package/dist/hub/catalog.js +151 -33
  19. package/dist/hub/catalog.js.map +1 -1
  20. package/dist/hub/client.js +2 -0
  21. package/dist/hub/client.js.map +1 -1
  22. package/dist/hub/compose/member.d.ts +6 -0
  23. package/dist/hub/compose/member.js +9 -1
  24. package/dist/hub/compose/member.js.map +1 -1
  25. package/dist/hub/compose/server.d.ts +7 -0
  26. package/dist/hub/compose/server.js +47 -6
  27. package/dist/hub/compose/server.js.map +1 -1
  28. package/dist/hub/group-policy/admin-api.d.ts +30 -0
  29. package/dist/hub/group-policy/admin-api.js +83 -0
  30. package/dist/hub/group-policy/admin-api.js.map +1 -0
  31. package/dist/hub/group-policy/admin-control.d.ts +34 -0
  32. package/dist/hub/group-policy/admin-control.js +258 -0
  33. package/dist/hub/group-policy/admin-control.js.map +1 -0
  34. package/dist/hub/group-policy/admin-dto.d.ts +9 -1
  35. package/dist/hub/group-policy/admin-dto.js.map +1 -1
  36. package/dist/hub/group-policy/admin-facts.d.ts +17 -0
  37. package/dist/hub/group-policy/admin-facts.js +33 -0
  38. package/dist/hub/group-policy/admin-facts.js.map +1 -0
  39. package/dist/hub/group-policy/admin-impact.d.ts +51 -0
  40. package/dist/hub/group-policy/admin-impact.js +88 -0
  41. package/dist/hub/group-policy/admin-impact.js.map +1 -0
  42. package/dist/hub/group-policy/authorization.d.ts +17 -0
  43. package/dist/hub/group-policy/authorization.js +123 -1
  44. package/dist/hub/group-policy/authorization.js.map +1 -1
  45. package/dist/hub/group-policy/impact-inventory.d.ts +21 -0
  46. package/dist/hub/group-policy/impact-inventory.js +75 -0
  47. package/dist/hub/group-policy/impact-inventory.js.map +1 -0
  48. package/dist/hub/group-policy/resources.d.ts +13 -1
  49. package/dist/hub/group-policy/resources.js +92 -23
  50. package/dist/hub/group-policy/resources.js.map +1 -1
  51. package/dist/hub/group-policy/store.d.ts +11 -0
  52. package/dist/hub/group-policy/store.js +57 -2
  53. package/dist/hub/group-policy/store.js.map +1 -1
  54. package/dist/hub/group-policy/welcome.d.ts +36 -0
  55. package/dist/hub/group-policy/welcome.js +55 -0
  56. package/dist/hub/group-policy/welcome.js.map +1 -0
  57. package/dist/hub/http/compose.d.ts +2 -0
  58. package/dist/hub/http/compose.js +128 -6
  59. package/dist/hub/http/compose.js.map +1 -1
  60. package/dist/hub/http/deps.d.ts +7 -0
  61. package/dist/hub/member/pairing-api.d.ts +2 -0
  62. package/dist/hub/member/pairing-api.js +1 -0
  63. package/dist/hub/member/pairing-api.js.map +1 -1
  64. package/dist/hub/member/pairing-notices.d.ts +18 -0
  65. package/dist/hub/member/pairing-notices.js +58 -0
  66. package/dist/hub/member/pairing-notices.js.map +1 -0
  67. package/dist/hub/pairing-notices.d.ts +47 -0
  68. package/dist/hub/pairing-notices.js +241 -0
  69. package/dist/hub/pairing-notices.js.map +1 -0
  70. package/dist/hub/pairing.d.ts +33 -1
  71. package/dist/hub/pairing.js +315 -15
  72. package/dist/hub/pairing.js.map +1 -1
  73. package/dist/hub/protocol.d.ts +32 -0
  74. package/dist/hub/protocol.js +6 -1
  75. package/dist/hub/protocol.js.map +1 -1
  76. package/dist/hub/runtime.d.ts +4 -1
  77. package/dist/hub/runtime.js +11 -0
  78. package/dist/hub/runtime.js.map +1 -1
  79. package/dist/hub/server.js +4 -0
  80. package/dist/hub/server.js.map +1 -1
  81. package/dist/hub/store.d.ts +10 -1
  82. package/dist/hub/store.js +7 -4
  83. package/dist/hub/store.js.map +1 -1
  84. package/dist/hub/types.d.ts +13 -2
  85. package/dist/locale.js +22 -16
  86. package/dist/locale.js.map +1 -1
  87. package/dist/login-controller.d.ts +9 -1
  88. package/dist/login-controller.js +20 -1
  89. package/dist/login-controller.js.map +1 -1
  90. package/dist/login-flows.js +4 -2
  91. package/dist/login-flows.js.map +1 -1
  92. package/dist/office-share-page.js +1 -1
  93. package/dist/office-share-page.js.map +1 -1
  94. package/dist/outbound-handlers.js +1 -1
  95. package/dist/outbound-handlers.js.map +1 -1
  96. package/dist/quickstart-api.js +2 -2
  97. package/dist/quickstart-api.js.map +1 -1
  98. package/dist/reply-buttons-controller.d.ts +5 -1
  99. package/dist/reply-buttons-controller.js +8 -4
  100. package/dist/reply-buttons-controller.js.map +1 -1
  101. package/dist/reply-buttons.d.ts +6 -2
  102. package/dist/reply-buttons.js +7 -3
  103. package/dist/reply-buttons.js.map +1 -1
  104. package/dist/settings-api.d.ts +2 -1
  105. package/dist/settings-api.js +4 -3
  106. package/dist/settings-api.js.map +1 -1
  107. package/dist/signin-keepalive.d.ts +2 -0
  108. package/dist/signin-keepalive.js +30 -2
  109. package/dist/signin-keepalive.js.map +1 -1
  110. package/dist/ui/accounts-keepalive.js +10 -5
  111. package/dist/ui/accounts-manage.js +29 -11
  112. package/dist/ui/accounts-view.js +75 -28
  113. package/dist/ui/backend-signin.js +10 -1
  114. package/dist/ui/hub-client.js +43 -3
  115. package/dist/ui/hub-group-policy.js +170 -0
  116. package/dist/ui/hub-group-strings.js +97 -0
  117. package/dist/ui/hub-owner-strings.js +4 -4
  118. package/dist/ui/hub-pairing-progress-strings.js +15 -0
  119. package/dist/ui/hub-quick-pairing.js +202 -0
  120. package/dist/ui/hub-quick-strings.js +43 -0
  121. package/dist/ui/hub-read-strings.js +7 -0
  122. package/dist/ui/hub-welcome.js +99 -0
  123. package/dist/ui/panel-hub.js +47 -10
  124. package/dist/ui/panel-settings.js +7 -4
  125. package/dist/ui/settings-apply.js +12 -5
  126. package/dist/ui/settings-devices.js +2 -2
  127. package/dist/ui/settings-dialogs.js +3 -1
  128. package/dist/ui/settings-hub-membership.js +18 -4
  129. package/dist/ui/settings-hub-section.js +26 -1
  130. package/dist/ui/settings-hub.js +52 -11
  131. package/dist/ui/settings-restart-strings.js +17 -0
  132. package/dist/ui/settings-strings.js +6 -4
  133. package/dist/ui/shared/accounts-keepalive.css +11 -6
  134. package/dist/ui/shared/accounts.css +68 -18
  135. package/dist/ui/shared/app-i18n.js +3 -0
  136. package/dist/ui/shared/app-shell.js +18 -8
  137. package/dist/ui/shared/hub-groups.css +26 -0
  138. package/dist/ui/shared/hub.css +1 -0
  139. package/dist/ui/shared/setup-host-text.js +4 -1
  140. package/dist/ui/shared/signin.js +3 -1
  141. package/dist/ui/shared/usage-dialog.js +3 -72
  142. package/dist/ui/shared/usage-meter.js +84 -0
  143. package/dist/ui/shared/web-authorize.js +4 -4
  144. package/dist/update-marker.d.ts +2 -0
  145. package/dist/update-marker.js.map +1 -1
  146. package/dist/web-api.d.ts +5 -1
  147. package/dist/web-api.js +25 -5
  148. package/dist/web-api.js.map +1 -1
  149. package/dist/web-backend-login.d.ts +16 -2
  150. package/dist/web-backend-login.js +14 -0
  151. package/dist/web-backend-login.js.map +1 -1
  152. package/dist/web-notices.d.ts +9 -0
  153. package/dist/web-notices.js +19 -0
  154. package/dist/web-notices.js.map +1 -1
  155. package/dist/web-terminal.d.ts +7 -0
  156. package/dist/web-terminal.js +14 -2
  157. package/dist/web-terminal.js.map +1 -1
  158. package/package.json +1 -1
@@ -259,11 +259,44 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a) } = {}) {
259
259
  read(roomId, after = 0) { return call("GET", `/hub/v1/rooms/${id(roomId)}/messages?after=${id(after)}`); },
260
260
  chooseButtons(roomId, input) { return call("POST", `/hub/v1/rooms/${id(roomId)}/buttons`, input); },
261
261
  pairings() { return call("GET", "/hub/v1/pairings"); },
262
+ quickPairingV1: true,
263
+ createQuickPairing(label) { return call("POST", "/hub/v1/quick-pairing", { label }); },
264
+ quickPairing(pairingId) { return call("GET", `/hub/v1/quick-pairing${pairingId ? `?id=${id(pairingId)}` : ""}`); },
265
+ stopQuickPairing(pairingId) { return call("POST", `/hub/v1/quick-pairing/${id(pairingId)}/stop`); },
266
+ revokeOwnFleet(fleetId, generation) { return call("POST", `/hub/v1/fleets/${id(fleetId)}/revoke`, { generation }); },
267
+ pairingNotices() { return call("GET", "/hub/v1/notices"); },
268
+ /** The Hub's stream begins with the complete current snapshot; no bootstrap GET is needed. */
269
+ pairingNoticeSnapshotV1: typeof EventSource !== "undefined",
270
+ acknowledgePairingNotice(noticeId) { return call("POST", `/hub/v1/notices/${id(noticeId)}/ack`); },
271
+ subscribePairingNotices(fn, onClosed = () => {}) {
272
+ if (typeof EventSource === "undefined") return () => {};
273
+ const events = new EventSource("/hub/v1/notices/events"); let live = true;
274
+ events.addEventListener("notices", (event) => { if (!live) return; try { const value = JSON.parse(event.data); if (Array.isArray(value.notices)) fn(value.notices); } catch { /* bounded server DTO only */ } });
275
+ events.addEventListener("error", () => {
276
+ // A refused handshake is CLOSED, unlike a transient disconnect that EventSource itself reconnects.
277
+ if (live && events.readyState === 2) { live = false; events.close(); onClosed(); }
278
+ });
279
+ return () => { live = false; events.close(); };
280
+ },
262
281
  confirmPairing(pairingId, fingerprint) { return call("POST", `/hub/v1/pairings/${id(pairingId)}/confirm`, { fingerprint }); },
263
282
  adminOverview() { return call("GET", "/hub/v1/admin/overview"); },
264
283
  createPairing(login) { return call("POST", "/hub/v1/admin/pairings", { login }); },
265
284
  approvePairing(pairingId, fingerprint) { return call("POST", `/hub/v1/admin/pairings/${id(pairingId)}/approve`, { fingerprint }); },
266
285
  revokeFleet(fleetId) { return call("POST", `/hub/v1/admin/fleets/${id(fleetId)}/revoke`); },
286
+ // #3298 S-89 (experimental, off unless the session lists "group-policy-v1"): group permissions, admin only; the welcome, any
287
+ // signed-in person (display only — every action still asks the server).
288
+ groupPolicy() { return call("GET", "/hub/v1/admin/group-policy"); },
289
+ resolveGroup(dn) { return call("POST", "/hub/v1/admin/group-policy/resolve", { dn }); },
290
+ previewGroupPolicy(policy) { return call("POST", "/hub/v1/admin/group-policy/preview", { policy }); },
291
+ /** The policy that was previewed and that preview's digest: the server applies only its own sealed candidate for them. */
292
+ saveGroupPolicy(policy, previewDigest) { return call("PUT", "/hub/v1/admin/group-policy", { policy, previewDigest }); },
293
+ /** One exact paused resource: its own revision, and the policy and suspension-record (lifecycle) revisions the page was shown. */
294
+ resumeGroupResource(resource, expectedPolicyRevision, expectedLifecycleRevision) {
295
+ return call("POST", "/hub/v1/admin/group-policy/resources/resume", { resource, expectedPolicyRevision, expectedLifecycleRevision });
296
+ },
297
+ welcome() { return call("GET", "/hub/v1/me/welcome"); },
298
+ /** This client has the group permissions calls (a cached older client does not: the pages then hide them). */
299
+ groupPolicyV1: true,
267
300
  };
268
301
  }
269
302
 
@@ -275,6 +308,7 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a) } = {}) {
275
308
  * `confirm` is settings-confirm.js (loaded with the card): { api, isPendingResponse, track, newKey }.
276
309
  */
277
310
  export function createMemberClient({ confirm, pollMs = 5000, doc = typeof document !== "undefined" ? document : null, timers = globalThis }) {
311
+ let pairingNotices = [];
278
312
  const listed = async () => {
279
313
  const r = await confirm.api("/api/hub/member/exposures");
280
314
  return r.ok && r.body && Array.isArray(r.body.exposures) ? r.body.exposures : r.status === 404 ? null : [];
@@ -284,12 +318,17 @@ export function createMemberClient({ confirm, pollMs = 5000, doc = typeof docume
284
318
  // "sent for confirmation", followed in the background; the poll shows the result); cancel at once.
285
319
  const pairingNow = async () => {
286
320
  const r = await confirm.api("/api/hub/member/pairing");
287
- if (r.ok && r.body && r.body.pairing) return r.body.pairing;
321
+ if (r.ok && r.body && r.body.pairing) { pairingNotices = Array.isArray(r.body.notices) ? r.body.notices : []; return r.body.pairing; }
322
+ pairingNotices = [];
288
323
  return { state: "held", hold: r.status === 404 ? "unavailable" : "unsaved" };
289
324
  };
290
325
  const step = async (name, body) => {
291
326
  const r = await confirm.api(`/api/hub/member/pairing/${name}`, { method: "POST", headers: { "Idempotency-Key": confirm.newKey("hub") }, body: JSON.stringify(body || {}) });
292
- if (confirm.isPendingResponse(r)) { void Promise.resolve(confirm.track(r.body.pending_change, "hub")).catch(() => {}); return { ok: true, pendingConfirmation: true, pairing: await pairingNow() }; }
327
+ if (confirm.isPendingResponse(r)) {
328
+ const settled = Promise.resolve(confirm.track(r.body.pending_change, "hub"));
329
+ void settled.catch(() => {});
330
+ return { ok: true, pendingConfirmation: true, settled, pairing: await pairingNow() };
331
+ }
293
332
  if (r.status === 404) return { ok: false, error: "unavailable" };
294
333
  return r.body && typeof r.body === "object" ? r.body : { ok: false, error: "unsaved" };
295
334
  };
@@ -308,6 +347,7 @@ export function createMemberClient({ confirm, pollMs = 5000, doc = typeof docume
308
347
  return {
309
348
  stub: false, member: true,
310
349
  pairing: pairingNow,
350
+ pairingNotices: () => pairingNotices,
311
351
  async connect({ address, code }) {
312
352
  const a = String(address || "").trim(), c = String(code || "").trim();
313
353
  if (!ADDRESS_HINT.test(a)) return { ok: false, error: "address" };
@@ -320,7 +360,7 @@ export function createMemberClient({ confirm, pollMs = 5000, doc = typeof docume
320
360
  // #3115 r2: exactly the pairing shown — its hub and bindingId; the server refuses any other (a replacement, a re-pair).
321
361
  const hubId = shown && (shown.hub ? shown.hub.hubId : shown.hubId), binding = shown && shown.binding;
322
362
  if (!hubId || !binding) return { ok: false, error: "conflict" };
323
- const r = await step("disconnect", { hubId, binding }); return r.ok ? { ok: true, remote: "pending", ...(r.pendingConfirmation ? { pendingConfirmation: true } : {}) } : { ok: false, error: r.error === "unsaved" ? "unsaved" : "conflict" }; },
363
+ const r = await step("disconnect", { hubId, binding }); return r.ok ? { ok: true, remote: "pending", ...(r.pendingConfirmation ? { pendingConfirmation: true, settled: r.settled } : {}) } : { ok: false, error: r.error === "unsaved" ? "unsaved" : "conflict" }; },
324
364
  async cancel() { const r = await confirm.api("/api/hub/member/pairing/cancel", { method: "POST", body: "{}" }); return r.ok && r.body && r.body.pairing ? r.body.pairing : pairingNow(); },
325
365
  /** The local status, every pollMs while visible (one request at a time; none while hidden); stops with the last listener. */
326
366
  subscribe(fn) { listeners.add(fn); if (!timer) timer = timers.setTimeout(tick, pollMs); return () => { listeners.delete(fn); if (!listeners.size && timer) { timers.clearTimeout(timer); timer = null; } }; },
@@ -0,0 +1,170 @@
1
+ // #3298 S-89: Administration → Group permissions, on the Hub's own listener, for the Hub's configured directory administrator.
2
+ // Experimental and off by default. The page is a presentation of the server's control (S-88): every list is read fresh, the
3
+ // group is looked up by the server (its GUID is the server's, never typed here), the effect of a change is the server's own
4
+ // preview, and Save applies exactly that preview (its digest) — one click on the preview already on screen, no extra dialog
5
+ // (721ca0c3 addendum 2). Nothing here decides who may do what. Shared components: PageHead, card, s-row, field, btn, tag, note,
6
+ // Empty/ErrorState/Skeleton.
7
+ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
8
+ import { PageHead } from "/assets/page-head.js";
9
+ import { ErrorState, Skeleton } from "/assets/ui-states.js";
10
+ import { navigate } from "/assets/app-nav.js";
11
+ import { hubClient } from "./hub-client.js";
12
+ import { hg } from "./hub-group-strings.js";
13
+ import { hr } from "./hub-read-strings.js";
14
+
15
+ export const CAPS = [["ask_agents", "capAsk"], ["publish_agents", "capPublish"], ["pair_fleet", "capPair"]];
16
+ const PREVIEW_DELAY_MS = 400;
17
+ const READ_BUSY = "busy";
18
+ const RESOLVE_REASON = { "not-found": "notFound", "not-security-group": "notSecurity", invalid: "invalidDn", unsupported: "unsupported", unknown: "unknownGroup" };
19
+
20
+ /** The draft as the server receives it: the saved policy with this page's state and groups, its revision as the compare-and-set. */
21
+ export function draftPolicy(saved, state, groups) {
22
+ return { ...saved, state, groups: groups.map((g) => ({ group: { realm: g.group.realm, objectId: g.group.objectId }, dn: g.dn, allow: CAPS.map(([c]) => c).filter((c) => g.allow.includes(c)), maxFleets: g.maxFleets })) };
23
+ }
24
+ const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
25
+
26
+ /** #3298 S-89: the prominent entry to Group permissions at the top of Administration (discovery without docs). */
27
+ export function GroupPermissionsCard() {
28
+ const go = (e) => { e.preventDefault(); navigate("/ui/hub/admin?view=groups"); };
29
+ return html`<section class="card hub-groups-entry" data-entry="group-permissions"><h3>${hg("entryTitle")} <span class="tag warn">${hg("experimental")}</span></h3>
30
+ <p class="note">${hg("entryHint")}</p>
31
+ <div class="hub-groups-actions"><a class="btn btn-primary" href="/ui/hub/admin?view=groups" onClick=${go}>${hg("entryOpen")}</a></div></section>`;
32
+ }
33
+
34
+ export function HubGroupPolicyPage() {
35
+ const c = hubClient();
36
+ const [view, setView] = useState(null), [error, setError] = useState(""), [msg, setMsg] = useState(null);
37
+ const [state, setState] = useState("never-enabled"), [groups, setGroups] = useState([]);
38
+ const [dn, setDn] = useState(""), [adding, setAdding] = useState(false), [addError, setAddError] = useState("");
39
+ const [preview, setPreview] = useState(null), [saving, setSaving] = useState(false), [again, setAgain] = useState(0);
40
+ const live = useRef(true), seq = useRef(0), readSeq = useRef(0), retry = useRef(null);
41
+ useEffect(() => { live.current = true; return () => { live.current = false; readSeq.current++; clearTimeout(retry.current); }; }, []);
42
+ const load = async () => {
43
+ if (!live.current) return;
44
+ clearTimeout(retry.current); retry.current = null;
45
+ const mine = ++readSeq.current;
46
+ setError("");
47
+ const r = await c.groupPolicy();
48
+ if (!live.current || mine !== readSeq.current) return;
49
+ if (!r.ok && r.code === "backpressure") {
50
+ setError(READ_BUSY); const seconds = Number(r.retryAfter);
51
+ retry.current = setTimeout(() => { if (live.current && mine === readSeq.current) void load(); },
52
+ (Number.isFinite(seconds) && seconds > 0 ? Math.max(1, Math.min(300, seconds)) : 10) * 1000);
53
+ return;
54
+ }
55
+ if (!r.ok) { setError(r.code === "denied" ? hg("contactAdmin") : hg("failed")); return; }
56
+ setView(r);
57
+ if (r.policy) { setState(r.policy.state); setGroups(r.policy.groups.map((g) => ({ ...g, allow: [...g.allow] }))); }
58
+ setPreview(null);
59
+ };
60
+ useEffect(() => { void load(); }, []);
61
+ const policy = view && view.policy;
62
+ const editable = !!policy && view.supported === true && view.binding === "ready";
63
+ const draft = policy ? draftPolicy(policy, state, groups) : null;
64
+ const changed = !!draft && !same(draft, draftPolicy(policy, policy.state, policy.groups));
65
+ // The server's preview of the draft, refreshed as it changes. A stale answer (an older draft) is dropped.
66
+ useEffect(() => {
67
+ if (!editable || !changed) { setPreview(null); return undefined; }
68
+ const mine = ++seq.current;
69
+ setPreview({ loading: true });
70
+ const timer = setTimeout(async () => {
71
+ const r = await c.previewGroupPolicy(draft);
72
+ if (!live.current || mine !== seq.current) return;
73
+ setPreview(r.ok ? { ok: true, ...r } : { ok: false, code: r.code });
74
+ }, PREVIEW_DELAY_MS);
75
+ return () => clearTimeout(timer);
76
+ }, [editable, JSON.stringify(draft), again]);
77
+ const add = async (e) => {
78
+ e.preventDefault();
79
+ const text = dn.trim();
80
+ if (!text || adding) return;
81
+ setAdding(true); setAddError("");
82
+ const r = await c.resolveGroup(text);
83
+ if (!live.current) return;
84
+ setAdding(false);
85
+ if (!r.ok) { setAddError(hg(r.code === "unsupported" ? "unsupported" : "unknownGroup")); return; }
86
+ if (r.ok && r.reason) { setAddError(hg(RESOLVE_REASON[r.reason] || "unknownGroup")); return; }
87
+ const key = { realm: r.realm, objectId: r.objectId };
88
+ if (groups.some((g) => g.group.objectId === key.objectId)) { setAddError(hg("duplicate")); return; }
89
+ // A newly allowed group starts with chat only and one fleet (#3298 decision 2); more is the admin's explicit choice.
90
+ setGroups([...groups, { group: key, dn: r.dn, allow: ["ask_agents"], maxFleets: 1 }]); setDn("");
91
+ };
92
+ const setCap = (i, cap, on) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, allow: on ? [...g.allow, cap] : g.allow.filter((x) => x !== cap),
93
+ // Connecting a fleet needs at least one slot.
94
+ maxFleets: on && cap === "pair_fleet" && g.maxFleets === 0 ? 1 : g.maxFleets }));
95
+ const setFleets = (i, n) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, maxFleets: Math.max(0, Math.min(8, Number(n) || 0)) }));
96
+ const save = async () => {
97
+ if (!preview || !preview.ok || saving) return;
98
+ setSaving(true); setMsg(null);
99
+ const r = await c.saveGroupPolicy(draft, preview.previewDigest);
100
+ if (!live.current) return;
101
+ setSaving(false);
102
+ if (r.ok) { setMsg({ ok: true, text: hg("saved") }); await load(); return; }
103
+ setMsg({ ok: false, text: hg(r.code === "conflict" ? "conflict" : r.code === "stale-preview" ? "previewStale" : r.code === "expired" ? "previewExpired" : "failed") });
104
+ // A preview the server no longer holds is checked again (the person sees the fresh effect before saving).
105
+ if (r.code === "stale-preview" || r.code === "expired") setAgain((n) => n + 1);
106
+ };
107
+ const resume = async (row) => {
108
+ setMsg(null);
109
+ const r = await c.resumeGroupResource(row.resource, policy.revision, row.lifecycleRevision); // the resource carries its own revision
110
+ if (!live.current) return;
111
+ setMsg(r.ok ? { ok: true, text: hg("resumed") } : { ok: false, text: hg(r.code === "conflict" ? "conflict" : "failed") });
112
+ await load();
113
+ };
114
+ const head = html`<${PageHead} title=${hg("title")} scope=${hg("experimental")} lead=${hg("lead")} />`;
115
+ if (error) return html`<div class="col hub-owner hub-groups">${head}<div class="s-section-layout">${error === READ_BUSY
116
+ ? html`<p class="note" role="status" data-groups="busy">${hr("busy")}</p>`
117
+ : html`<${ErrorState} message=${error} onRetry=${load} />`}</div></div>`;
118
+ if (!view) return html`<div class="col hub-owner hub-groups">${head}<div class="s-section-layout"><section class="card"><${Skeleton} variant="rows" lines=${4} /></section></div></div>`;
119
+ // The card names the SAVED state; a turn on/off not saved yet is shown as pending, never as already on (Cairn #3372).
120
+ const saved = policy ? policy.state : "never-enabled";
121
+ const stateKey = saved === "enabled" ? "Enabled" : saved === "suspended" ? "Suspended" : "Never";
122
+ const pending = !!policy && state !== saved;
123
+ const paused = Array.isArray(view.paused) ? view.paused : [];
124
+ const pv = preview && preview.ok ? preview.impact || {} : null;
125
+ const list = (rows, label) => rows && rows.length ? html`<div class="hub-groups-impact"><b>${label}</b><ul>${rows.map((r, i) => html`<li key=${i}>${r.name || r.label || r.dn || r.id}${r.login ? html` <small class="note"><code>${r.login}</code></small>` : null}</li>`)}</ul></div>` : null;
126
+ return html`<div class="col hub-owner hub-groups">${head}
127
+ <div class="s-section-layout">
128
+ <p class="note"><a href="/ui/hub/admin" onClick=${(e) => { e.preventDefault(); navigate("/ui/hub/admin"); }}>← ${hg("back")}</a></p>
129
+ ${view.supported !== true ? html`<p class="note" role="status" data-reason="unsupported">${hg("unsupported")}</p>` : null}
130
+ ${view.binding === "repair-required" ? html`<p class="err" role="alert" data-reason="repair">${hg("repair")}</p>` : null}
131
+ ${msg ? html`<p class=${msg.ok ? "note" : "err"} role=${msg.ok ? "status" : "alert"}>${msg.text}</p>` : null}
132
+ ${!policy ? null : html`<section class="card hub-groups-state"><h3>${hg(`state${stateKey}`)}</h3><p class="note">${hg(`state${stateKey}Hint`)}</p>
133
+ ${pending ? html`<p class="note" role="status" data-pending=${state === "enabled" ? "on" : "off"}><span class="tag warn">${hg("notSaved")}</span> ${hg(state === "enabled" ? "pendingOn" : "pendingOff")}</p>` : null}
134
+ ${editable ? html`<div class="hub-groups-actions">${pending
135
+ ? html`<button type="button" class="btn btn-sm" onClick=${() => setState(saved)}>${hg("undo")}</button>`
136
+ : state === "enabled"
137
+ ? html`<button type="button" class="btn btn-sm" onClick=${() => setState("suspended")}>${hg("turnOff")}</button>`
138
+ : html`<button type="button" class="btn btn-sm" onClick=${() => setState("enabled")}>${hg("turnOn")}</button>`}</div>` : null}
139
+ </section>
140
+ <section class="card hub-groups-list"><h3>${hg("groupsTitle")}</h3>
141
+ ${groups.length ? html`<div class="hub-rows">${groups.map((g, i) => html`<div key=${g.group.objectId} class="s-row hub-row hub-group-row" data-group=${g.group.objectId}>
142
+ <span class="hub-row-text"><code class="hub-group-dn">${g.dn}</code></span>
143
+ ${CAPS.map(([cap, word]) => html`<label key=${cap} class="hub-group-cap"><input type="checkbox" checked=${g.allow.includes(cap)} disabled=${!editable} onChange=${(e) => setCap(i, cap, e.target.checked)} /> ${hg(word)}</label>`)}
144
+ <label class="field hub-group-fleets" title=${hg("fleetsHint")}><span>${hg("fleets")}</span><input type="number" min="0" max="8" value=${String(g.maxFleets)} disabled=${!editable || !g.allow.includes("pair_fleet")} onInput=${(e) => setFleets(i, e.target.value)} /></label>
145
+ ${editable ? html`<button type="button" class="btn btn-sm btn-ghost" onClick=${() => setGroups(groups.filter((_, j) => j !== i))}>${hg("remove")}</button>` : null}
146
+ </div>`)}</div>` : html`<p class="note">${hg("noGroups")}</p>`}
147
+ ${editable ? html`<form class="hub-step-form" onSubmit=${add}><label class="field"><span class="sr-only">${hg("addLabel")}</span>
148
+ <input placeholder=${hg("addPlaceholder")} aria-label=${hg("addLabel")} autocomplete="off" spellcheck=${false} autocapitalize="none" value=${dn} onInput=${(e) => { setDn(e.target.value); setAddError(""); }} /></label>
149
+ <button type="submit" class="btn btn-sm" disabled=${!dn.trim() || adding}>${adding ? hg("resolving") : hg("add")}</button></form>` : null}
150
+ ${addError ? html`<p class="err" role="alert">${addError}</p>` : null}
151
+ </section>
152
+ ${policy && policy.denies && policy.denies.length ? html`<section class="card"><h3>${hg("deniesTitle")}</h3><p class="note">${hg("deniesHint")}</p>
153
+ <div class="hub-rows">${policy.denies.map((d) => html`<div key=${d.person.objectId} class="s-row hub-row"><span class="hub-row-text">${d.name || d.person.objectId}</span>
154
+ ${d.deny.map((cap) => html`<span key=${cap} class="tag warn">${hg((CAPS.find(([c]) => c === cap) || [0, cap])[1])}</span>`)}</div>`)}</div></section>` : null}
155
+ ${changed ? html`<section class="card hub-groups-preview" aria-live="polite"><h3>${hg("previewTitle")}</h3>
156
+ ${!preview || preview.loading ? html`<p class="note" aria-busy="true"><span class="out-spin" aria-hidden="true"></span> ${hg("previewing")}</p>`
157
+ : !preview.ok ? html`<p class="note" role="status">${preview.code === "unavailable" || preview.code === "not-found" ? hg("enableLater") : preview.code === "conflict" ? hg("conflict") : hg("failed")}</p>`
158
+ : html`${pv.adminLosesChat ? html`<p class="err" role="alert">${hg("adminLosesChat")}</p>` : null}
159
+ ${list(pv.losingActions, hg("losingActions"))}${pv.held && pv.held.length ? html`<div class="hub-groups-impact hub-groups-held" data-held=${pv.held.length}><b>${hg("held", pv.held.length)}</b><p class="note">${hg("heldHint")}</p>
160
+ <ul>${pv.held.map((r, i) => html`<li key=${i}>${r.name || r.personId}${r.login ? html` <small class="note"><code>${r.login}</code></small>` : null}</li>`)}</ul></div>` : null}${list(pv.losingPublication, hg("losingPublication"))}${list(pv.grandfathered, hg("grandfathered"))}${list(pv.suspendedOnSave || pv.suspended, hg("suspended"))}
161
+ ${!(pv.losingActions || []).length && !(pv.losingPublication || []).length && !(pv.suspendedOnSave || pv.suspended || []).length && !pv.adminLosesChat ? html`<p class="note">${hg("noImpact")}</p>` : null}
162
+ <div class="hub-groups-actions"><button type="button" class="btn btn-primary" disabled=${saving} onClick=${save}>${state === "enabled" && policy.state !== "enabled" ? hg("saveOn") : hg("save")}</button></div>`}
163
+ </section>` : null}
164
+ ${paused.length ? html`<section class="card hub-groups-paused"><h3>${hg("pausedTitle")}</h3><p class="note">${hg("pausedHint")}</p>
165
+ <div class="hub-rows">${paused.map((row) => html`<div key=${`${row.resource.kind}:${row.resource.id}`} class="s-row hub-row" data-paused=${row.resource.id}>
166
+ <span class="tag">${hg(row.resource.kind === "fleet" ? "kindFleet" : row.resource.kind === "exposure" ? "kindExposure" : "kindAsker")}</span>
167
+ <span class="hub-row-text"><strong>${row.label || row.resource.id}</strong>${row.owner ? html`<small class="note">${row.owner.name || ""}</small>` : null}</span>
168
+ <button type="button" class="btn btn-sm" onClick=${() => resume(row)}>${hg("resume")}</button></div>`)}</div></section>` : null}`}
169
+ </div></div>`;
170
+ }
@@ -0,0 +1,97 @@
1
+ // #3298 S-89: the words of the Hub's group permissions editor, the signed-in welcome and their discovery entries, in their own
2
+ // module so a tab holding an older hub-strings.js still draws these pages (retained-module SKEW). Experimental; off unless the
3
+ // Hub's session says `group-policy-v1`.
4
+ import { register, t } from "/assets/app-i18n.js";
5
+
6
+ register("hubGroups", {
7
+ en: {
8
+ // Discovery
9
+ entryTitle: "Group permissions", entryHint: "Let members of chosen directory groups chat with agents, share agents or connect their fleet, without approving each person.",
10
+ entryOpen: "Open group permissions", entryOpenHub: "Open on the Hub", settingsRowHint: "Set on the Hub's Administration page, signed in as its administrator.",
11
+ experimental: "Experimental",
12
+ // Editor
13
+ title: "Group permissions", lead: "Members of these directory groups get these actions. Sign-in stays open to everyone in the directory; chatting with an agent still needs its owner's grant.",
14
+ back: "Administration", unsupported: "This Hub's directory can't be used for group permissions. Group permissions need Active Directory over LDAPS (port 636).",
15
+ repair: "The directory settings changed since group permissions were saved. Group permissions are paused until the Hub is repaired.",
16
+ stateNever: "Off", stateEnabled: "On", stateSuspended: "Switched off — resources paused",
17
+ stateNeverHint: "Nothing changes for anyone until you turn this on.", stateEnabledHint: "Only the actions below are allowed.",
18
+ stateSuspendedHint: "What group permissions allowed is paused. Resume each one below, or turn group permissions on again.",
19
+ groupsTitle: "Groups", noGroups: "No groups yet. Add a directory group by its distinguished name.",
20
+ addLabel: "Group (distinguished name)", addPlaceholder: "CN=Hub-Members,OU=Groups,DC=example,DC=test", add: "Add group",
21
+ resolving: "Looking up the group…", capAsk: "Chat with agents", capPublish: "Share agents", capPair: "Connect a fleet",
22
+ fleets: "Fleets", fleetsHint: "How many fleets each member may connect (0–8).", remove: "Remove",
23
+ notFound: "No such group in the directory.", notSecurity: "That is not a security group.", invalidDn: "That is not a distinguished name.",
24
+ unknownGroup: "The directory didn't answer. Try again.", duplicate: "That group is already listed.",
25
+ deniesTitle: "People excluded", deniesHint: "Exclusions win over any group.",
26
+ previewTitle: "What this change does", previewing: "Checking who is affected…", noImpact: "No one loses anything they can do now.",
27
+ losingActions: "Lose actions they can do now", losingPublication: "After saving, can't share new or revised agents (already shared ones stay)",
28
+ grandfathered: "Shared agents kept as they are", suspended: "Paused by this change",
29
+ held: "Held, unchanged: {0} people", heldHint: "AD did not report group membership for these people. Nothing changes for them now: they gain nothing and nothing of theirs is paused. They are checked again at their next action.", adminLosesChat: "After saving, you won't be able to chat with agents: you are not in a group that allows it.",
30
+ previewStale: "Something changed since this was checked. Check again.", previewExpired: "This check expired. Check again.",
31
+ save: "Save", saveOn: "Turn on and save", turnOff: "Turn off", turnOn: "Turn on", undo: "Undo", notSaved: "Not saved", pendingOn: "Turns on when you save.", pendingOff: "Turns off when you save; what depends on it is paused.", check: "Check what changes",
32
+ saved: "Saved.", conflict: "Someone else changed group permissions. Reload to see their version.", failed: "Couldn't save. Try again.",
33
+ pausedTitle: "Paused", pausedHint: "Allowed by a group before, paused now. Resume one after checking it is still wanted.", resume: "Resume", resumed: "Resumed.",
34
+ kindFleet: "Fleet", kindExposure: "Shared agent", kindAsker: "Chat access",
35
+ enableLater: "Turning group permissions on becomes available once the Hub's enforcement is installed.",
36
+ // Welcome
37
+ welcomeTitle: "Welcome, {0}", welcomeLead: "What would you like to do?",
38
+ chatTitle: "Chat with an agent", chatHint: "Ask the agents their owners have shared with you.", chatGo: "Open chats",
39
+ chatNone: "No agents have been shared with you yet. An agent's owner has to give you access.",
40
+ connectTitle: "Connect your fleet", connectHint: "Pair your own AgEnD with this Hub, then choose which agents to share.", connectGo: "Connect my fleet",
41
+ connectFleets: "Your fleets: {0} of {1}", fleetActive: "Active", fleetPaused: "Paused", fleetRevoked: "Revoked", fleetUnknown: "Can't be checked right now", connectLimit: "You have connected as many fleets as you may. Manage them, or ask your Hub admin for more.",
42
+ connectManual: "Your Hub admin pairs fleets for you. Ask them for a pairing code.", connectNotIncluded: "Connecting a fleet is not included in your access.",
43
+ contactAdmin: "Contact your Hub admin.", noActions: "Your account can sign in, but no actions are allowed yet.",
44
+ unknown: "The directory didn't answer, so this can't be checked right now.", retry: "Retry", ineligible: "Your directory account can't use this right now.",
45
+ deniedPerson: "Your Hub admin has excluded your account from this.", suspended: "Paused by your Hub admin.",
46
+ publishNot: "Sharing agents is not included in your access.",
47
+ },
48
+ "zh-TW": {
49
+ entryTitle: "群組權限", entryHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet,不必逐一核准每個人。",
50
+ entryOpen: "開啟群組權限", entryOpenHub: "在 Hub 上開啟", settingsRowHint: "在 Hub 的「管理」頁設定,需以 Hub 管理員身分登入。",
51
+ experimental: "實驗性",
52
+ title: "群組權限", lead: "這些目錄群組的成員可以做下列動作。目錄中的每個人仍然都能登入;與 Agent 對話仍需要 Agent 擁有者的授權。",
53
+ back: "管理", unsupported: "這個 Hub 的目錄無法用於群組權限。群組權限需要透過 LDAPS(連接埠 636)的 Active Directory。",
54
+ repair: "目錄設定在群組權限儲存後改變了。在修復 Hub 之前,群組權限暫停。",
55
+ stateNever: "關閉", stateEnabled: "開啟", stateSuspended: "已關閉——資源已暫停",
56
+ stateNeverHint: "開啟前,任何人都不受影響。", stateEnabledHint: "只允許下列動作。",
57
+ stateSuspendedHint: "群組權限先前允許的項目已暫停。可在下方逐一恢復,或再次開啟群組權限。",
58
+ groupsTitle: "群組", noGroups: "還沒有群組。請用辨別名稱(DN)新增目錄群組。",
59
+ addLabel: "群組(辨別名稱)", addPlaceholder: "CN=Hub-Members,OU=Groups,DC=example,DC=test", add: "新增群組",
60
+ resolving: "正在查詢群組…", capAsk: "與 Agent 對話", capPublish: "分享 Agent", capPair: "連接 Fleet",
61
+ fleets: "Fleet 數", fleetsHint: "每位成員可連接的 Fleet 數(0–8)。", remove: "移除",
62
+ notFound: "目錄中沒有這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。",
63
+ unknownGroup: "目錄沒有回應,請再試一次。", duplicate: "這個群組已經在清單中。",
64
+ deniesTitle: "排除的人", deniesHint: "排除優先於任何群組。",
65
+ previewTitle: "這次變更的影響", previewing: "正在檢查受影響的人…", noImpact: "沒有人會失去目前能做的事。",
66
+ losingActions: "會失去目前能做的動作", losingPublication: "儲存後,無法分享新的或修改過的 Agent(已分享的保留)",
67
+ grandfathered: "保留原狀的已分享 Agent", suspended: "這次變更會暫停",
68
+ held: "暫緩、維持不變:{0} 人", heldHint: "AD 沒有回報這些人的群組成員資格。現在他們不受影響:不會得到新的權限,也不會暫停他們的任何東西。下次他們操作時會再檢查一次。", adminLosesChat: "儲存後,你將無法與 Agent 對話:你不在允許對話的群組中。",
69
+ previewStale: "檢查後有東西變了,請再檢查一次。", previewExpired: "這次檢查已過期,請再檢查一次。",
70
+ save: "儲存", saveOn: "開啟並儲存", turnOff: "關閉", turnOn: "開啟", undo: "復原", notSaved: "尚未儲存", pendingOn: "儲存後才會開啟。", pendingOff: "儲存後才會關閉;依賴它的項目會暫停。", check: "檢查會改變什麼",
71
+ saved: "已儲存。", conflict: "有人改了群組權限。請重新載入查看他們的版本。", failed: "無法儲存,請再試一次。",
72
+ pausedTitle: "已暫停", pausedHint: "先前由群組允許、目前暫停。確認仍然需要後再逐一恢復。", resume: "恢復", resumed: "已恢復。",
73
+ kindFleet: "Fleet", kindExposure: "已分享的 Agent", kindAsker: "對話權限",
74
+ enableLater: "安裝 Hub 的權限執行功能後,才能開啟群組權限。",
75
+ welcomeTitle: "歡迎,{0}", welcomeLead: "你想做什麼?",
76
+ chatTitle: "與 Agent 對話", chatHint: "詢問擁有者分享給你的 Agent。", chatGo: "開啟對話",
77
+ chatNone: "還沒有人分享 Agent 給你。需要 Agent 的擁有者給你存取權。",
78
+ connectTitle: "連接你的 Fleet", connectHint: "將你自己的 AgEnD 與這個 Hub 配對,再選擇要分享的 Agent。", connectGo: "連接我的 Fleet",
79
+ connectFleets: "你的 Fleet:{0} / {1}", fleetActive: "使用中", fleetPaused: "已暫停", fleetRevoked: "已撤銷", fleetUnknown: "目前無法確認", connectLimit: "你已連接允許的最多 Fleet 數。可以管理它們,或請 Hub 管理員增加。",
80
+ connectManual: "你的 Hub 管理員會幫你配對 Fleet。請向他索取配對碼。", connectNotIncluded: "你的存取權不包含連接 Fleet。",
81
+ contactAdmin: "請聯絡你的 Hub 管理員。", noActions: "你的帳號可以登入,但還沒有允許任何動作。",
82
+ unknown: "目錄沒有回應,現在無法確認。", retry: "重試", ineligible: "你的目錄帳號目前無法使用這個功能。",
83
+ deniedPerson: "Hub 管理員已將你的帳號排除在外。", suspended: "已被 Hub 管理員暫停。",
84
+ publishNot: "你的存取權不包含分享 Agent。",
85
+ },
86
+ });
87
+ export const hg = (key, ...values) => t(`hubGroups.${key}`, ...values);
88
+ /** This module's stylesheet, linked once when it loads (the pages work without it, plainer). */
89
+ export function linkHubGroupsCss(doc = typeof document !== "undefined" ? document : null) {
90
+ try {
91
+ if (!doc || !doc.head || doc.querySelector('link[data-hub-groups-css="1"]')) return;
92
+ const link = doc.createElement("link");
93
+ link.setAttribute("rel", "stylesheet"); link.setAttribute("href", "/assets/hub-groups.css"); link.setAttribute("data-hub-groups-css", "1");
94
+ doc.head.appendChild(link);
95
+ } catch { /* the pages still work without it */ }
96
+ }
97
+ linkHubGroupsCss();
@@ -5,8 +5,8 @@ import { register, t } from "/assets/app-i18n.js";
5
5
 
6
6
  register("hubOwner", {
7
7
  en: {
8
- memberAddress: "Member address", memberAddressHint: "Enter this address and the code in your fleet's Settings → Hub → Connect to a Hub. This is separate from the Hub's browser address.",
9
- memberAddressMissing: "Ask the administrator for the member address; it may use a different port from this page.", copyHandoff: "Copy address and code", handoffCopied: "Address and code copied", handoffCopyFailed: "Couldn't copy. Select the address and code above to copy them.",
8
+ memberAddress: "Hub address", memberAddressHint: "Paste this address into the Hub address field in your fleet's Settings → Hub → Connect to a Hub, together with the code. This is separate from the Hub's browser address.",
9
+ memberAddressMissing: "Ask the administrator for the address to enter in the Hub address field; it may use a different port from this page.", copyHandoff: "Copy address and code", handoffCopied: "Address and code copied", handoffCopyFailed: "Couldn't copy. Select the address and code above to copy them.",
10
10
  active: "Active", adminLead: "Pair a fleet with this Hub and see the fleets that are paired. You can't read anyone's chats here.",
11
11
  allow: "Allow…", allowDays: "For", allowGo: "Allow", allowLogin: "Their sign-in name",
12
12
  allowLoginHint: "The account they sign in to this Hub with.", allowTitle: "Allow someone to ask {0}", approveGo: "Approve…",
@@ -26,8 +26,8 @@ register("hubOwner", {
26
26
  untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
27
27
  },
28
28
  "zh-TW": {
29
- memberAddress: "成員連線位址", memberAddressHint: "在你 fleet 的「設定 → Hub → 連線到 Hub」輸入這個位址和配對碼。這與 Hub 的瀏覽器位址不同。",
30
- memberAddressMissing: "請向管理員索取成員連線位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
29
+ memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub → 連線到 Hub」的「Hub 位址」欄位貼上這個位址,並輸入配對碼。這與 Hub 的瀏覽器位址不同。",
30
+ memberAddressMissing: "請向管理員索取要填入「Hub 位址」欄位的位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
31
31
  active: "使用中", adminLead: "把 fleet 配對到這個 Hub,並查看已配對的 fleet。這裡看不到任何人的對話。", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
32
32
  allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
33
33
  codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
@@ -0,0 +1,15 @@
1
+ // Kept with the new card behavior so a cached earlier hub-strings module cannot expose raw keys.
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ register("hubPairingProgress", {
4
+ en: {
5
+ connectFailed: "Pairing did not finish. Start a new pairing on the Hub and use its new code here.",
6
+ notApplied: "This request was not applied. Check the pairing status above before trying again.",
7
+ unknown: "The result cannot be checked right now. Review the pairing status and the confirmation card before trying again.",
8
+ },
9
+ "zh-TW": {
10
+ connectFailed: "配對未完成。請在 Hub 重新開始配對,再將新的代碼填在這裡。",
11
+ notApplied: "這次要求未套用。請先查看上方的配對狀態,再決定是否重試。",
12
+ unknown: "目前無法確認結果。請先查看配對狀態與確認卡片,再決定是否重試。",
13
+ },
14
+ });
15
+ export const hp = key => t(`hubPairingProgress.${key}`);