@songsid/agend 2.4.0-alpha.1 → 2.4.0-alpha.2
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/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agent-whats-new.js +2 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +3 -1
- package/dist/auth-api.js.map +1 -1
- package/dist/backend/claude-code.js +4 -0
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/types.d.ts +6 -0
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +1 -1
- package/dist/backend-availability.js +28 -1
- package/dist/backend-availability.js.map +1 -1
- package/dist/browser-backend-signins.d.ts +7 -1
- package/dist/browser-backend-signins.js +8 -4
- package/dist/browser-backend-signins.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-tools.js +1 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/config-validator.js +47 -7
- package/dist/config-validator.js.map +1 -1
- package/dist/daemon.d.ts +3 -0
- package/dist/daemon.js +4 -0
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +33 -4
- package/dist/fleet-manager.js +143 -61
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +19 -0
- package/dist/hub/audit/index.js +12 -5
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/catalog.d.ts +6 -0
- package/dist/hub/catalog.js +14 -4
- 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 +2 -0
- package/dist/hub/compose/member.js +11 -2
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.js +2 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/enrolment-code.d.ts +126 -0
- package/dist/hub/enrolment-code.js +266 -0
- package/dist/hub/enrolment-code.js.map +1 -0
- package/dist/hub/group-policy/admin-impact.js +4 -2
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/admin-inventory.js +6 -6
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +16 -2
- package/dist/hub/group-policy/authorization.js +69 -5
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.js +3 -3
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +40 -1
- package/dist/hub/group-policy/resources.js +51 -13
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.d.ts +6 -0
- package/dist/hub/group-policy/store.js +49 -4
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/http/compose.js +30 -6
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/init/text.js +2 -2
- package/dist/hub/init/text.js.map +1 -1
- package/dist/hub/init/web.d.ts +7 -0
- package/dist/hub/init/web.js +6 -1
- package/dist/hub/init/web.js.map +1 -1
- package/dist/hub/join/local.d.ts +27 -0
- package/dist/hub/join/local.js +70 -5
- package/dist/hub/join/local.js.map +1 -1
- package/dist/hub/join/receipt.d.ts +1 -0
- package/dist/hub/join/receipt.js +1 -1
- package/dist/hub/join/receipt.js.map +1 -1
- package/dist/hub/join/service.d.ts +92 -6
- package/dist/hub/join/service.js +199 -28
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/join/store.d.ts +2 -1
- package/dist/hub/join/store.js +7 -7
- package/dist/hub/join/store.js.map +1 -1
- package/dist/hub/member/exposure-api.d.ts +2 -0
- package/dist/hub/member/exposure-api.js +3 -2
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +4 -0
- package/dist/hub/member/exposures.js +12 -2
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/pairing-notices.js +8 -6
- package/dist/hub/member/pairing-notices.js.map +1 -1
- package/dist/hub/pairing-notices.d.ts +5 -2
- package/dist/hub/pairing-notices.js +38 -13
- package/dist/hub/pairing-notices.js.map +1 -1
- package/dist/hub/pairing.d.ts +7 -2
- package/dist/hub/protocol.d.ts +47 -0
- package/dist/hub/protocol.js +3 -1
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/server.js +15 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +12 -4
- package/dist/hub-pairing-summary.js +1 -1
- package/dist/hub-pairing-summary.js.map +1 -1
- package/dist/instance-config-impact.js +4 -0
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.js +4 -0
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +6 -2
- package/dist/locale.js.map +1 -1
- package/dist/log-service.d.ts +62 -6
- package/dist/log-service.js +135 -28
- package/dist/log-service.js.map +1 -1
- package/dist/log-steps-agy-grok.d.ts +74 -0
- package/dist/log-steps-agy-grok.js +440 -0
- package/dist/log-steps-agy-grok.js.map +1 -0
- package/dist/log-steps.d.ts +62 -3
- package/dist/log-steps.js +188 -22
- package/dist/log-steps.js.map +1 -1
- package/dist/log-transcript-paths.d.ts +29 -0
- package/dist/log-transcript-paths.js +109 -0
- package/dist/log-transcript-paths.js.map +1 -0
- package/dist/login-controller.d.ts +17 -3
- package/dist/login-controller.js +57 -5
- package/dist/login-controller.js.map +1 -1
- package/dist/login-window-lock.d.ts +20 -8
- package/dist/login-window-lock.js +35 -16
- package/dist/login-window-lock.js.map +1 -1
- package/dist/outbound-handlers.d.ts +14 -0
- package/dist/outbound-handlers.js +49 -1
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/profile-signins.d.ts +2 -0
- package/dist/profile-signins.js +1 -1
- package/dist/profile-signins.js.map +1 -1
- package/dist/settings-api.d.ts +34 -0
- package/dist/settings-api.js +184 -6
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-change.js +38 -1
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.js +14 -0
- package/dist/settings-effect.js.map +1 -1
- package/dist/tool-progress.d.ts +7 -0
- package/dist/tool-progress.js +21 -9
- package/dist/tool-progress.js.map +1 -1
- package/dist/types.d.ts +13 -0
- package/dist/ui/accounts-view.js +14 -4
- package/dist/ui/agent-details-settings.js +2 -2
- package/dist/ui/agent-page-strings.js +2 -2
- package/dist/ui/backend-signin.js +47 -14
- package/dist/ui/chat-activity-groups.js +225 -0
- package/dist/ui/chat-activity.js +355 -0
- package/dist/ui/chat-popout-header.js +35 -0
- package/dist/ui/chat-popout-transport.js +80 -0
- package/dist/ui/chat-popout.js +63 -0
- package/dist/ui/chat-quote.js +3 -1
- package/dist/ui/chat-store.js +45 -4
- package/dist/ui/chat-workspace-gestures.js +177 -0
- package/dist/ui/chat-workspace-navigation.js +34 -10
- package/dist/ui/chat-workspace.js +96 -32
- package/dist/ui/host-install.js +2 -2
- package/dist/ui/hub-agent-copy.js +7 -7
- package/dist/ui/hub-chat-strings.js +3 -3
- package/dist/ui/hub-client.js +77 -17
- package/dist/ui/hub-company-join-strings.js +12 -10
- package/dist/ui/hub-company-join.js +52 -39
- package/dist/ui/hub-confirm-place.js +44 -0
- package/dist/ui/hub-directory-editor-strings.js +3 -3
- package/dist/ui/hub-directory-notice-strings.js +1 -1
- package/dist/ui/hub-enrolment-code-strings.js +44 -0
- package/dist/ui/hub-enrolment-code.js +159 -0
- package/dist/ui/hub-group-search.js +82 -0
- package/dist/ui/hub-group-strings.js +8 -8
- package/dist/ui/hub-join-approval.js +31 -0
- package/dist/ui/hub-join-code-input.js +66 -0
- package/dist/ui/hub-join-queue.js +62 -0
- package/dist/ui/hub-join-steps.js +231 -0
- package/dist/ui/hub-joincode-flow-strings.js +22 -0
- package/dist/ui/hub-owner-strings.js +9 -9
- package/dist/ui/hub-pairing-progress-strings.js +1 -1
- package/dist/ui/hub-quick-pairing.js +8 -4
- package/dist/ui/hub-quick-strings.js +11 -11
- package/dist/ui/hub-share-refused.js +17 -0
- package/dist/ui/hub-strings.js +61 -61
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/hub-welcome.js +26 -5
- package/dist/ui/image-annotate.js +283 -0
- package/dist/ui/image-lightbox.js +26 -6
- package/dist/ui/log-row.js +327 -0
- package/dist/ui/panel-chat.js +151 -12
- package/dist/ui/panel-details.js +14 -6
- package/dist/ui/panel-hub.js +42 -13
- package/dist/ui/panel-log.js +9 -154
- package/dist/ui/panel-settings.js +48 -11
- package/dist/ui/search-dialog.js +1 -0
- package/dist/ui/settings-access-overview.js +1 -1
- package/dist/ui/settings-hub-browser-certificate.js +3 -3
- package/dist/ui/settings-hub-company-join.js +41 -30
- package/dist/ui/settings-hub-connection.js +8 -5
- package/dist/ui/settings-hub-membership.js +3 -3
- package/dist/ui/settings-hub-section.js +1 -1
- package/dist/ui/settings-hub-setup-strings.js +6 -6
- package/dist/ui/settings-hub-setup.js +44 -6
- package/dist/ui/settings-hub.js +35 -10
- package/dist/ui/settings-layout.js +6 -4
- package/dist/ui/settings-public-session-strings.js +37 -0
- package/dist/ui/settings-registry.js +4 -0
- package/dist/ui/settings-strings.js +2 -2
- package/dist/ui/shared/app-shell.js +16 -10
- package/dist/ui/shared/app.css +195 -30
- package/dist/ui/shared/app.js +8 -1
- package/dist/ui/shared/chat-render.js +11 -2
- package/dist/ui/shared/chat-thread.js +20 -3
- package/dist/ui/shared/chat-work-bar.css +7 -0
- package/dist/ui/shared/chat-workspace-model.js +39 -9
- package/dist/ui/shared/hub-owner.css +8 -0
- package/dist/ui/shared/identity-color.js +9 -3
- package/dist/ui/shared/image-annotate.css +45 -0
- package/dist/ui/shared/instance-nav.js +59 -22
- package/dist/ui/shared/pane-geometry.js +29 -0
- package/dist/ui/shared/signin.js +2 -2
- package/dist/ui/shared/tokens.css +14 -0
- package/dist/ui/shared/ui-menu.js +22 -7
- package/dist/ui/signin.html +1 -1
- package/dist/ui/structured-signin.js +11 -4
- package/dist/web-api.d.ts +1 -0
- package/dist/web-api.js +34 -4
- package/dist/web-api.js.map +1 -1
- package/dist/web-backend-login.d.ts +9 -3
- package/dist/web-backend-login.js +7 -4
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-chat-history.d.ts +11 -0
- package/dist/web-chat-history.js +9 -1
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-guest-access.js +2 -2
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-session.d.ts +31 -3
- package/dist/web-session.js +25 -4
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +8 -2
- package/dist/web-settings-patch.js +22 -10
- package/dist/web-settings-patch.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub UX U2 (spec 1.2, server item S2): find an AD group by the start of its name, then hand the chosen hit to the caller.
|
|
3
|
+
* Input feedback only, never authority: the caller resolves the hit's DN with the existing resolve (the server's GUID), and
|
|
4
|
+
* preview and save re-resolve as before. Shared with B2's join-code scope (Ridge). Its own words, so a page whose other
|
|
5
|
+
* Hub dictionaries are cached from an older build still has every word here (upgrade skew).
|
|
6
|
+
*
|
|
7
|
+
* searchGroups(client, q) → { ok: true, groups: [{ objectId, cn, dn }], truncated }
|
|
8
|
+
* | { ok: false, reason: "invalid" | "unsupported" | "unknown" | "limited", failure?, retryAfter? }
|
|
9
|
+
* <GroupSearch client disabled exclude=[objectId…] label onPick={hit => …} onUnsupported={() => …} />
|
|
10
|
+
*/
|
|
11
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
12
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
13
|
+
export const groupSearchV1 = true;
|
|
14
|
+
/** `id` is a prop (default "hubGroupSearch"; its note is `${id}Note`), so two pickers on one page never share an element id. */
|
|
15
|
+
export const groupSearchIdV1 = true;
|
|
16
|
+
register("hubGroupSearch", {
|
|
17
|
+
en: {
|
|
18
|
+
label: "Find a group", placeholder: "Start of the group's name, e.g. eng", hint: "Type at least 2 characters.",
|
|
19
|
+
searching: "Searching…", none: "No group starts with “{0}”.", more: "More groups match. Type more of the name.",
|
|
20
|
+
limited: "Too many searches. Try again in {0} seconds.", unknown: "The directory could not be searched just now. Try again, or add the group by its distinguished name.",
|
|
21
|
+
invalid: "Use 2 to 64 characters.", add: "Add {0}", addShort: "Add", added: "Added",
|
|
22
|
+
},
|
|
23
|
+
"zh-TW": {
|
|
24
|
+
label: "尋找群組", placeholder: "群組名稱的開頭,例如 eng", hint: "請至少輸入 2 個字。",
|
|
25
|
+
searching: "搜尋中…", none: "沒有以「{0}」開頭的群組。", more: "還有更多群組符合。請多輸入幾個字。",
|
|
26
|
+
limited: "搜尋太多次了。請 {0} 秒後再試。", unknown: "目前無法搜尋目錄。請再試一次,或用辨別名稱新增群組。",
|
|
27
|
+
invalid: "請輸入 2 到 64 個字。", add: "新增 {0}", addShort: "新增", added: "已新增",
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
const g = (key, ...args) => t(`hubGroupSearch.${key}`, ...args);
|
|
31
|
+
const CONTROL = /[\u0000-\u001f\u007f]/;
|
|
32
|
+
const row = (x) => x && typeof x.objectId === "string" && typeof x.cn === "string" && typeof x.dn === "string" ? { objectId: x.objectId, cn: x.cn, dn: x.dn } : null;
|
|
33
|
+
|
|
34
|
+
/** One search, normalized for the page. Never throws. */
|
|
35
|
+
export async function searchGroups(client, q) {
|
|
36
|
+
const text = String(q ?? "").trim();
|
|
37
|
+
if (CONTROL.test(String(q ?? "")) || text.length < 2 || text.length > 64) return { ok: false, reason: "invalid" };
|
|
38
|
+
if (!client || typeof client.searchGroups !== "function") return { ok: false, reason: "unsupported" };
|
|
39
|
+
let r;
|
|
40
|
+
try { r = await client.searchGroups(text); } catch { return { ok: false, reason: "unknown" }; }
|
|
41
|
+
if (r && r.ok === true && Array.isArray(r.groups)) return { ok: true, groups: r.groups.map(row).filter(Boolean).slice(0, 20), truncated: r.truncated === true };
|
|
42
|
+
if (r && r.status === 429) return { ok: false, reason: "limited", retryAfter: Number(r.retryAfter) > 0 ? Number(r.retryAfter) : 60 };
|
|
43
|
+
if (r && r.status === 400) return { ok: false, reason: "invalid" };
|
|
44
|
+
if (r && (r.reason === "unsupported" || r.reason === "unknown" || r.reason === "limited"))
|
|
45
|
+
return { ok: false, reason: r.reason, ...(r.reason === "unknown" && r.failure ? { failure: String(r.failure) } : {}), ...(r.reason === "limited" ? { retryAfter: 60 } : {}) };
|
|
46
|
+
return { ok: false, reason: "unknown" };
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The search box: 300 ms after typing stops, the newest answer for the text in the box only. */
|
|
50
|
+
export function GroupSearch({ client, disabled = false, exclude = [], label, onPick, onUnsupported, id = "hubGroupSearch" } = {}) {
|
|
51
|
+
const noteId = `${id}Note`;
|
|
52
|
+
const [q, setQ] = useState(""), [answer, setAnswer] = useState(null), [busy, setBusy] = useState(false);
|
|
53
|
+
const seq = useRef(0), told = useRef(false), live = useRef(true);
|
|
54
|
+
useEffect(() => () => { live.current = false; }, []);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
const text = q.trim(); const mine = ++seq.current;
|
|
57
|
+
if (text.length < 2) { setAnswer(null); setBusy(false); return; }
|
|
58
|
+
setBusy(true);
|
|
59
|
+
const timer = setTimeout(async () => {
|
|
60
|
+
const r = await searchGroups(client, q);
|
|
61
|
+
if (!live.current || mine !== seq.current) return;
|
|
62
|
+
setBusy(false); setAnswer({ ...r, q: text });
|
|
63
|
+
if (!r.ok && r.reason === "unsupported" && !told.current) { told.current = true; onUnsupported?.(); }
|
|
64
|
+
}, 300);
|
|
65
|
+
return () => clearTimeout(timer);
|
|
66
|
+
}, [q, client]);
|
|
67
|
+
if (answer && !answer.ok && answer.reason === "unsupported") return null; // the caller's DN input takes over
|
|
68
|
+
const hits = answer?.ok ? answer.groups : [];
|
|
69
|
+
const message = busy ? g("searching")
|
|
70
|
+
: !answer ? (q.trim() && q.trim().length < 2 ? g("hint") : null)
|
|
71
|
+
: answer.ok ? (hits.length ? (answer.truncated ? g("more") : null) : g("none", answer.q))
|
|
72
|
+
: answer.reason === "limited" ? g("limited", answer.retryAfter ?? 60) : answer.reason === "invalid" ? g("invalid") : g("unknown");
|
|
73
|
+
return html`<div class="hub-group-search">
|
|
74
|
+
<label class="field" for=${id}><span>${label || g("label")}</span>
|
|
75
|
+
<input id=${id} type="search" value=${q} disabled=${disabled} autocomplete="off" spellcheck=${false} placeholder=${g("placeholder")}
|
|
76
|
+
aria-describedby=${noteId} onInput=${(e) => setQ(e.target.value)} /></label>
|
|
77
|
+
${message ? html`<p class="note" id=${noteId} role="status">${message}</p>` : null}
|
|
78
|
+
${hits.length ? html`<ul class="hub-group-hits" role="list">${hits.map((h) => { const has = exclude.includes(h.objectId);
|
|
79
|
+
return html`<li class="s-row" key=${h.objectId}><span class="hub-row-text"><strong>${h.cn}</strong><small class="note"><code>${h.dn}</code></small></span>
|
|
80
|
+
<button type="button" class="btn btn-sm" disabled=${disabled || has} aria-label=${g("add", h.cn)} onClick=${() => onPick?.(h)}>${has ? g("added") : g("addShort")}</button></li>`; })}</ul>` : null}
|
|
81
|
+
</div>`;
|
|
82
|
+
}
|
|
@@ -44,12 +44,12 @@ register("hubGroups", {
|
|
|
44
44
|
welcomeTitle: "Welcome, {0}", welcomeLead: "What would you like to do?",
|
|
45
45
|
chatTitle: "Chat with an agent", chatHint: "Ask the agents their owners have shared with you.", chatGo: "Open chats",
|
|
46
46
|
chatNone: "No agents have been shared with you yet. An agent's owner has to give you access.",
|
|
47
|
-
connectTitle: "Connect your fleet", connectHint: "
|
|
48
|
-
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
|
|
49
|
-
connectManual: "Your Hub
|
|
50
|
-
contactAdmin: "Contact your Hub
|
|
47
|
+
connectTitle: "Connect your fleet", connectHint: "Connect your own AgEnD to this Hub, then choose which agents to share.", connectGo: "Connect my fleet",
|
|
48
|
+
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 administrator for more.",
|
|
49
|
+
connectManual: "Your Hub administrator connects fleets for you. Ask them for a pairing code.", connectNotIncluded: "Connecting a fleet is not included in your access.",
|
|
50
|
+
contactAdmin: "Contact your Hub administrator.", noActions: "Your account can sign in, but no actions are allowed yet.",
|
|
51
51
|
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.",
|
|
52
|
-
deniedPerson: "Your Hub
|
|
52
|
+
deniedPerson: "Your Hub administrator has excluded your account from this.", suspended: "Paused by your Hub administrator.",
|
|
53
53
|
publishNot: "Sharing agents is not included in your access.",
|
|
54
54
|
},
|
|
55
55
|
"zh-TW": {
|
|
@@ -69,7 +69,7 @@ register("hubGroups", {
|
|
|
69
69
|
notFound: "目錄中沒有這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。",
|
|
70
70
|
unknownGroup: "目錄沒有回應,請再試一次。", duplicate: "這個群組已經在清單中。",
|
|
71
71
|
failUnreachable: "Hub 連不到目錄伺服器,或伺服器沒有及時回應。請確認伺服器正在執行,而且 Hub 所在的電腦連得到它,然後再試一次。",
|
|
72
|
-
failCertificate: "Hub
|
|
72
|
+
failCertificate: "Hub 不信任目錄伺服器的憑證,所以沒有連接。如果伺服器的憑證已更新或更換,Hub 的目錄設定需要新的憑證:請找設定這個 Hub 的人。",
|
|
73
73
|
failServiceSignIn: "目錄拒絕了 Hub 的服務帳號。可能是密碼已變更,或帳號被鎖定或停用:請找設定這個 Hub 的人檢查。",
|
|
74
74
|
failLookup: "目錄有回應,但群組查詢沒有完成。請再試一次;如果一直失敗,請檢查群組的辨別名稱。",
|
|
75
75
|
noGroupsOn: "群組權限開啟但清單中沒有群組時,沒有人能透過群組取得權限:沒有以其他方式核准的人,將無法與 Agent 對話、分享 Agent 或連接 Fleet。除非這正是你要的,請先加入群組。",
|
|
@@ -88,9 +88,9 @@ register("hubGroups", {
|
|
|
88
88
|
welcomeTitle: "歡迎,{0}", welcomeLead: "你想做什麼?",
|
|
89
89
|
chatTitle: "與 Agent 對話", chatHint: "詢問擁有者分享給你的 Agent。", chatGo: "開啟對話",
|
|
90
90
|
chatNone: "還沒有人分享 Agent 給你。需要 Agent 的擁有者給你存取權。",
|
|
91
|
-
connectTitle: "連接你的 Fleet", connectHint: "將你自己的 AgEnD
|
|
91
|
+
connectTitle: "連接你的 Fleet", connectHint: "將你自己的 AgEnD 連接到這個 Hub,再選擇要分享的 Agent。", connectGo: "連接我的 Fleet",
|
|
92
92
|
connectFleets: "你的 Fleet:{0} / {1}", fleetActive: "使用中", fleetPaused: "已暫停", fleetRevoked: "已撤銷", fleetUnknown: "目前無法確認", connectLimit: "你已連接允許的最多 Fleet 數。可以管理它們,或請 Hub 管理員增加。",
|
|
93
|
-
connectManual: "你的 Hub
|
|
93
|
+
connectManual: "你的 Hub 管理員會幫你連接 Fleet。請向他索取配對碼。", connectNotIncluded: "你的存取權不包含連接 Fleet。",
|
|
94
94
|
contactAdmin: "請聯絡你的 Hub 管理員。", noActions: "你的帳號可以登入,但還沒有允許任何動作。",
|
|
95
95
|
unknown: "目錄沒有回應,現在無法確認。", retry: "重試", ineligible: "你的目錄帳號目前無法使用這個功能。",
|
|
96
96
|
deniedPerson: "Hub 管理員已將你的帳號排除在外。", suspended: "已被 Hub 管理員暫停。",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** Mounted-page lease for the pure queue. A navigation, session or request change retires timers and late results. */
|
|
2
|
+
import { useEffect, useRef, useState } from "/assets/app-html.js";
|
|
3
|
+
import { createJoinApprovalQueue } from "./hub-join-queue.js";
|
|
4
|
+
export function useJoinApproval(options) {
|
|
5
|
+
const binding = useRef(null), latest = useRef(options), live = useRef(false), epoch = useRef(0), holder = useRef(null);
|
|
6
|
+
// The browser projection can temporarily be unavailable. Pin its first finite outer deadline for this exact request/session.
|
|
7
|
+
if (!binding.current || binding.current.requestId !== options.requestId || binding.current.sessionKey !== options.sessionKey)
|
|
8
|
+
binding.current = { requestId: options.requestId, sessionKey: options.sessionKey, deadline: options.deadline };
|
|
9
|
+
else if (!Number.isFinite(binding.current.deadline) && Number.isFinite(options.deadline)) binding.current.deadline = options.deadline;
|
|
10
|
+
const bound = { ...options, deadline: binding.current.deadline };
|
|
11
|
+
latest.current = bound;
|
|
12
|
+
const [phase, setPhase] = useState(null);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
live.current = true; epoch.current++; setPhase(null);
|
|
15
|
+
return () => { live.current = false; epoch.current++; holder.current?.queue.cancel(); holder.current = null; };
|
|
16
|
+
}, [bound.requestId, bound.deadline, bound.sessionKey]);
|
|
17
|
+
const run = csrf => {
|
|
18
|
+
const mine = epoch.current, { requestId, deadline, sessionKey } = bound;
|
|
19
|
+
const current = () => live.current && mine === epoch.current && latest.current.requestId === requestId
|
|
20
|
+
&& latest.current.deadline === deadline && latest.current.sessionKey === sessionKey && latest.current.current?.() !== false;
|
|
21
|
+
if (!current()) return Promise.resolve({ ok: false, code: "retired" });
|
|
22
|
+
if (!holder.current || holder.current.csrf !== csrf) {
|
|
23
|
+
holder.current?.queue.cancel();
|
|
24
|
+
holder.current = { csrf, queue: createJoinApprovalQueue({ requestId, deadline, csrf, current, approve: options.approve,
|
|
25
|
+
onChange: event => { if (current()) setPhase(event); } }) };
|
|
26
|
+
}
|
|
27
|
+
return holder.current.queue.run();
|
|
28
|
+
};
|
|
29
|
+
return { run, queued: phase?.phase === "queued", busy: phase?.phase === "approving" || phase?.phase === "queued",
|
|
30
|
+
retryAttempt: phase?.phase === "queued" ? phase.attempts : null };
|
|
31
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// M-2988 (Lumen's Hub story board, round 2, finding 1): a colleague holding the administrator's join code fills the
|
|
2
|
+
// Fleet's one Hub input. Words for it: a hint that the code goes after the address with a space, a code typed on its
|
|
3
|
+
// own, and "join code included" once it is recognised. The administrator's copied text — "In AgEnD Settings → Hub, enter
|
|
4
|
+
// {host} and this code." with the code on the next line (hub-enrolment-code.js) — is read as the address and the code,
|
|
5
|
+
// in either language, also after a text field has dropped its line break. Its own module and namespace, so a tab that still
|
|
6
|
+
// holds an older hub-join-one-strings.js loads this panel (a missing named export would stop the module from loading).
|
|
7
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
8
|
+
import { classifyHubInput } from "./hub-join-one-strings.js";
|
|
9
|
+
|
|
10
|
+
register("joinCode", {
|
|
11
|
+
en: {
|
|
12
|
+
hint: "Enter the Hub address, or paste what your Hub administrator sent you. A join code goes after the address with a space: hub.example.com ABCD-EFGH",
|
|
13
|
+
codeOnly: "That is a join code. Put the Hub address before it, with a space: hub.example.com {0}",
|
|
14
|
+
included: "Join code included.",
|
|
15
|
+
// alpha.2 rehearsal findings 3/4: a refused or held attempt, and one another browser session started.
|
|
16
|
+
codeDenied: "The Hub did not accept this join code: it may have ended or been mistyped, or your account may not be allowed to connect a Fleet. Ask your Hub administrator for a current code, then start again.",
|
|
17
|
+
blocked: "Another connection attempt is still open (shown above). Use “Recover this connection” or “Cancel connection” on it, then start again.",
|
|
18
|
+
foreignHeld: "This attempt was started in another browser tab or session. You can recover or cancel it here.",
|
|
19
|
+
foreignBusy: "This attempt is still in progress in another browser tab or session. Finish it there, or wait for it to end ({0} left).",
|
|
20
|
+
},
|
|
21
|
+
"zh-TW": {
|
|
22
|
+
hint: "輸入 Hub 位址,或貼上 Hub 管理員給你的內容。加入碼接在位址後面、中間空一格:hub.example.com ABCD-EFGH",
|
|
23
|
+
codeOnly: "這是加入碼。請在前面加上 Hub 位址,中間空一格:hub.example.com {0}",
|
|
24
|
+
included: "已帶入加入碼。",
|
|
25
|
+
codeDenied: "Hub 沒有接受這組加入碼:可能已停用或打錯,也可能你的帳號不能連接 Fleet。請向 Hub 管理員要一組有效的加入碼,再重新開始。",
|
|
26
|
+
blocked: "還有一個連接嘗試沒有結束(顯示在上方)。請先按「恢復這次連接」或「取消連接」,再重新開始。",
|
|
27
|
+
foreignHeld: "這個連接嘗試是在另一個瀏覽器分頁或工作階段開始的。你可以在這裡恢復或取消它。",
|
|
28
|
+
foreignBusy: "這個連接嘗試還在另一個瀏覽器分頁或工作階段進行中。請在那裡完成,或等它結束(剩 {0})。",
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
export const jc = (key, ...args) => t(`joinCode.${key}`, ...args);
|
|
32
|
+
|
|
33
|
+
const CODE_CHARS = "0-9A-HJKMNP-TV-Za-hjkmnp-tv-z";
|
|
34
|
+
const CODE_DASHED = new RegExp(`^[${CODE_CHARS}]{4}-[${CODE_CHARS}]{4}$`);
|
|
35
|
+
const TRAILING_CODE = new RegExp(`(?:^|[\\s.。::,,])([${CODE_CHARS}]{4}-[${CODE_CHARS}]{4})$`);
|
|
36
|
+
const QUOTES = /^[「『“"'((\[]+|[」』”"'),,。.、::;;!!??\])]+$/g;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The administrator's handoff text, if that is what this is: one address (a word that reads as a Hub address with a dot,
|
|
40
|
+
* a port or https://) and one dashed join code at the end. Returns "host CODE" for the input, or null.
|
|
41
|
+
*/
|
|
42
|
+
export function fromHandoffText(raw) {
|
|
43
|
+
const text = String(raw ?? "").trim();
|
|
44
|
+
const code = TRAILING_CODE.exec(text);
|
|
45
|
+
if (!code) return null;
|
|
46
|
+
const before = text.slice(0, text.length - code[1].length);
|
|
47
|
+
if (!/\s/.test(before.trim()) && !/[\r\n]/.test(text)) return null; // "host CODE" alone is the normal form, not a handoff
|
|
48
|
+
const found = new Set();
|
|
49
|
+
for (const word of before.split(/\s+/)) {
|
|
50
|
+
const w = word.replace(QUOTES, "");
|
|
51
|
+
if (!w || !(/^https:\/\//i.test(w) || /[.:]/.test(w) || w.startsWith("["))) continue;
|
|
52
|
+
const k = classifyHubInput(w);
|
|
53
|
+
if (k.kind === "address" && !k.code) found.add(k.address);
|
|
54
|
+
}
|
|
55
|
+
if (found.size !== 1) return null;
|
|
56
|
+
const address = [...found][0], host = (() => { try { return new URL(address).host; } catch { return ""; } })();
|
|
57
|
+
return host ? `${host} ${code[1].toUpperCase()}` : null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** classifyHubInput, plus: the handoff text (read as address + code) and a dashed join code typed alone (its own message). */
|
|
61
|
+
export function classifyJoinInput(raw) {
|
|
62
|
+
const value = String(raw ?? "").trim();
|
|
63
|
+
if (CODE_DASHED.test(value)) return { kind: "error", error: "codeOnly", code: value.toUpperCase() };
|
|
64
|
+
const handoff = fromHandoffText(value);
|
|
65
|
+
return classifyHubInput(handoff ?? value);
|
|
66
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Same company-join request only: one initial approval plus at most eight 2–6s jittered retries.
|
|
2
|
+
* The caller owns current(): invalidate it on session/request/navigation changes. This is presentation orchestration,
|
|
3
|
+
* never an enrollment permit. Each approval still asks the Hub. The immutable outer deadline is never extended.
|
|
4
|
+
*/
|
|
5
|
+
export function createJoinApprovalQueue(options) {
|
|
6
|
+
const { requestId, csrf, deadline } = options;
|
|
7
|
+
const approve = options.approve.bind(options), current = options.current?.bind(options) || (() => true);
|
|
8
|
+
const changed = options.onChange?.bind(options) || (() => {}), now = options.now?.bind(options) || (() => Date.now());
|
|
9
|
+
const random = options.random?.bind(options) || (() => Math.random());
|
|
10
|
+
let stopped = false, flight = null;
|
|
11
|
+
const retired = () => ({ ok: false, code: "retired" });
|
|
12
|
+
// A local timer cannot prove nothing was issued. The caller must read the authoritative join projection.
|
|
13
|
+
const timedOut = () => ({ ok: false, code: "unavailable", deadline: true });
|
|
14
|
+
const live = () => { try { return !stopped && current() === true; } catch { return false; } };
|
|
15
|
+
const emit = (event) => { if (live()) { try { changed(event); } catch { /* a renderer's own failure */ } } };
|
|
16
|
+
const finish = (mine, result, phase) => {
|
|
17
|
+
if (flight !== mine) return;
|
|
18
|
+
clearTimeout(mine.retryTimer); clearTimeout(mine.deadlineTimer); mine.abort?.abort(); flight = null;
|
|
19
|
+
if (live()) emit({ phase, attempts: mine.attempts });
|
|
20
|
+
// A synchronous observer may itself retire the page/session.
|
|
21
|
+
mine.resolve(live() ? result : retired());
|
|
22
|
+
};
|
|
23
|
+
const step = async (mine) => {
|
|
24
|
+
if (flight !== mine) return;
|
|
25
|
+
if (!live()) { finish(mine, retired(), "retired"); return; }
|
|
26
|
+
if (now() >= deadline) { finish(mine, timedOut(), "uncertain"); return; }
|
|
27
|
+
mine.attempts++;
|
|
28
|
+
if (mine.attempts === 1) emit({ phase: "approving", attempts: mine.attempts });
|
|
29
|
+
if (!live()) { finish(mine, retired(), "retired"); return; }
|
|
30
|
+
let answer;
|
|
31
|
+
try { answer = await approve(requestId, csrf, mine.abort?.signal); }
|
|
32
|
+
catch { answer = { ok: false, code: "unavailable" }; }
|
|
33
|
+
if (flight !== mine) return;
|
|
34
|
+
if (!live()) { finish(mine, retired(), "retired"); return; }
|
|
35
|
+
if (now() >= deadline) { finish(mine, timedOut(), "uncertain"); return; }
|
|
36
|
+
if (answer?.ok === true) { finish(mine, answer, "done"); return; }
|
|
37
|
+
const busy = answer?.code === "backpressure" && (answer.reason === undefined || answer.reason === "backpressure");
|
|
38
|
+
if (!busy || mine.attempts >= 9) { finish(mine, answer || { ok: false, code: "unavailable" }, "failed"); return; }
|
|
39
|
+
const sample = random(), delay = 2000 + Math.floor((Number.isFinite(sample) ? Math.max(0, Math.min(1, sample)) : 0) * 4000);
|
|
40
|
+
emit({ phase: "queued", attempts: mine.attempts, retryInMs: delay });
|
|
41
|
+
if (!live()) { finish(mine, retired(), "retired"); return; }
|
|
42
|
+
mine.retryTimer = setTimeout(() => { mine.retryTimer = null; void step(mine); }, Math.min(delay, deadline - now()));
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
run() {
|
|
46
|
+
if (!live()) return Promise.resolve(retired());
|
|
47
|
+
if (flight) return flight.promise;
|
|
48
|
+
if (!Number.isFinite(deadline) || typeof requestId !== "string" || !requestId || typeof csrf !== "string" || !csrf)
|
|
49
|
+
return Promise.resolve({ ok: false, code: "unavailable" });
|
|
50
|
+
const mine = { attempts: 0, retryTimer: null, deadlineTimer: null,
|
|
51
|
+
abort: typeof AbortController === "function" ? new AbortController() : null, promise: null, resolve: null };
|
|
52
|
+
mine.promise = new Promise(resolve => { mine.resolve = resolve; }); flight = mine;
|
|
53
|
+
if (now() >= deadline) finish(mine, timedOut(), "uncertain");
|
|
54
|
+
else {
|
|
55
|
+
mine.deadlineTimer = setTimeout(() => finish(mine, timedOut(), "uncertain"), deadline - now());
|
|
56
|
+
void step(mine);
|
|
57
|
+
}
|
|
58
|
+
return mine.promise;
|
|
59
|
+
},
|
|
60
|
+
cancel() { stopped = true; if (flight) finish(flight, retired(), "retired"); },
|
|
61
|
+
};
|
|
62
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hub UX U2 (spec 1.2 / 2.6): the administrator's 「讓同仁加入」 card — three steps, each done from server state.
|
|
3
|
+
* This module so far holds step 3 and the join-code slot that B2 (Ridge) mounts into; steps 1–2 follow in this PR.
|
|
4
|
+
*
|
|
5
|
+
* Slot contract (agreed with Ridge, hub-b2-mount-contract / hub-b2-create-gate):
|
|
6
|
+
* <div id="hubEnrolmentCodeSlot"> mounts `HubEnrolmentCode` from ./hub-enrolment-code.js, lazily, only when the session
|
|
7
|
+
* advertises "enrolment-code-v1" (an implementation capability, independent of the on/off switch) and the module exports
|
|
8
|
+
* `enrolmentCodeV1 === true`. A missing module, a failed import or a missing flag leaves the slot empty (upgrade skew).
|
|
9
|
+
* Props: { client, enabled, host, onChanged } — `enabled` = step 1 done (code creation needs only company join on; a live
|
|
10
|
+
* code then satisfies step 2), `host` = the display host of step 3's sentence, `onChanged()` after create/revoke so this
|
|
11
|
+
* card reads its steps again. Revoking stays the component's own (it lists retained codes even with creation off).
|
|
12
|
+
*/
|
|
13
|
+
import { html, useEffect, useRef, useState } from "/assets/app-html.js";
|
|
14
|
+
import { GroupSearch } from "./hub-group-search.js";
|
|
15
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
16
|
+
import { hubClient } from "./hub-client.js";
|
|
17
|
+
export const joinStepsV1 = true;
|
|
18
|
+
register("hubJoinSteps", {
|
|
19
|
+
en: {
|
|
20
|
+
step3: "Tell colleagues how to join", sentence: "In AgEnD, open Settings → Hub, enter {0}, then sign in with the company account.",
|
|
21
|
+
copy: "Copy these instructions", copied: "Copied", copyFailed: "Copy failed. Select the sentence and copy it.",
|
|
22
|
+
step3Off: "Finish steps 1 and 2 first.", reading: "Checking the saved Hub settings…", readFailed: "Could not refresh the Hub settings. Try again.", retry: "Try again",
|
|
23
|
+
title: "Let colleagues join", lead: "Three steps. Each one is checked against what the Hub has saved.", done: "Done",
|
|
24
|
+
step1: "Let colleagues connect Fleets with their company account", step1Switch: "Allow company-account Fleet connections",
|
|
25
|
+
step2: "Who can join", step2Hint: "Add the AD groups whose members may connect a Fleet, then save.",
|
|
26
|
+
step2Code: "A live join code counts too.", byDn: "Add by distinguished name", dnLabel: "Distinguished name", dnAdd: "Add",
|
|
27
|
+
perPerson: "Each person up to", fleetsUnit: "Fleets", capAsk: "Chat with agents", capPublish: "Share agents", remove: "Remove",
|
|
28
|
+
noGroups: "No group yet.", previewing: "Checking what this changes…", noImpact: "Nobody loses anything.",
|
|
29
|
+
losing: "These people lose an action", suspended: "These are paused when you save", adminLosesChat: "You would no longer be able to chat with agents.",
|
|
30
|
+
save: "Save", saving: "Saving…", saved: "Saved.", conflict: "Someone else changed this. The page now shows the saved version.",
|
|
31
|
+
stale: "The check is out of date. It has been run again; look at it and save again.", failed: "Could not save. Try again.",
|
|
32
|
+
unsupported: "This directory can't list groups for permissions: that needs Active Directory over LDAPS. Check it with “Edit AD connection” on the Administration page, or send individual invitations instead.", repair: "The saved permissions need repair on the Group permissions page.",
|
|
33
|
+
duplicate: "That group is already on the list.", notFound: "No such group.", notSecurity: "That is not a security group.", invalidDn: "That is not a distinguished name.", unknownGroup: "The group could not be checked. Try again.",
|
|
34
|
+
groupsPage: "All group permissions", advanced: "Link with key fingerprint (Advanced)", advancedHint: "Only for a colleague who must check the key fingerprint by hand.",
|
|
35
|
+
exceptions: "Individual invitations", otherWays: "Other ways",
|
|
36
|
+
},
|
|
37
|
+
"zh-TW": {
|
|
38
|
+
step3: "告訴同仁怎麼加入", sentence: "在 AgEnD 的「設定 → Hub」輸入 {0},再用公司帳號登入。",
|
|
39
|
+
copy: "複製這段說明", copied: "已複製", copyFailed: "複製失敗。請選取這段說明再複製。",
|
|
40
|
+
step3Off: "請先完成步驟 1 和 2。", reading: "正在確認 Hub 已儲存的設定…", readFailed: "目前無法更新 Hub 設定,請再試一次。", retry: "再試一次",
|
|
41
|
+
title: "讓同仁加入", lead: "三個步驟,每一步都依 Hub 已儲存的設定判斷是否完成。", done: "已完成",
|
|
42
|
+
step1: "允許同仁用公司帳號連接 Fleet", step1Switch: "允許以公司帳號連接 Fleet",
|
|
43
|
+
step2: "誰可以加入", step2Hint: "加入可以連接 Fleet 的 AD 群組,然後儲存。",
|
|
44
|
+
step2Code: "有效的加入碼也算完成。", byDn: "用辨別名稱新增", dnLabel: "辨別名稱", dnAdd: "新增",
|
|
45
|
+
perPerson: "每人最多", fleetsUnit: "台", capAsk: "和 Agent 對話", capPublish: "分享 Agent", remove: "移除",
|
|
46
|
+
noGroups: "還沒有群組。", previewing: "正在檢查這次變更的影響…", noImpact: "沒有人會失去任何權限。",
|
|
47
|
+
losing: "這些人會失去權限", suspended: "儲存後會暫停這些項目", adminLosesChat: "你將無法再和 Agent 對話。",
|
|
48
|
+
save: "儲存", saving: "儲存中…", saved: "已儲存。", conflict: "有人剛改過這裡。頁面已顯示目前儲存的版本。",
|
|
49
|
+
stale: "檢查結果已過期,已重新檢查。請看過後再儲存一次。", failed: "無法儲存,請再試一次。",
|
|
50
|
+
unsupported: "這個目錄無法列出群組來設定權限:需要 Active Directory 並使用 LDAPS。請在「管理」按「編輯 AD 連線」檢查,或改用個別邀請。", repair: "已儲存的權限需要在「群組權限」頁修復。",
|
|
51
|
+
duplicate: "這個群組已經在清單裡。", notFound: "找不到這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。", unknownGroup: "目前無法確認這個群組,請再試一次。",
|
|
52
|
+
groupsPage: "所有群組權限", advanced: "含金鑰指紋的連結(進階)", advancedHint: "只給需要自己核對金鑰指紋的同仁。",
|
|
53
|
+
exceptions: "個別邀請", otherWays: "其他方式",
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
const sw = (key, ...args) => t(`hubJoinSteps.${key}`, ...args);
|
|
57
|
+
/** The web origin as people see it (spec 1.2): no https://, no :443. */
|
|
58
|
+
export function displayHost(webOrigin) {
|
|
59
|
+
try { const u = new URL(String(webOrigin || "")); return u.protocol === "https:" ? u.host.replace(/:443$/, "") : ""; } catch { return ""; }
|
|
60
|
+
}
|
|
61
|
+
/** The one sentence colleagues need (step 3's), for this Hub. */
|
|
62
|
+
export const joinSentence = (webOrigin) => { const host = displayHost(webOrigin); return host ? sw("sentence", host) : ""; };
|
|
63
|
+
export const otherWaysLabel = () => sw("otherWays");
|
|
64
|
+
/** B2's join-code component in its slot, or nothing (see the contract above). */
|
|
65
|
+
// B2 ships the module; until then (and on a Hub that does not serve it) the import fails and the slot stays empty.
|
|
66
|
+
const CODE_MODULE = "./hub-enrolment-code.js";
|
|
67
|
+
const loadCode = () => import(/* @vite-ignore */ CODE_MODULE);
|
|
68
|
+
export function EnrolmentCodeSlot({ features = [], client = hubClient(), enabled = false, host = "", onChanged, load = loadCode } = {}) {
|
|
69
|
+
const offered = Array.isArray(features) && features.includes("enrolment-code-v1");
|
|
70
|
+
const [Code, setCode] = useState(null);
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
let live = true;
|
|
73
|
+
if (offered) Promise.resolve().then(load).then(m => { if (live && m && m.enrolmentCodeV1 === true && typeof m.HubEnrolmentCode === "function") setCode(() => m.HubEnrolmentCode); }, () => {});
|
|
74
|
+
return () => { live = false; };
|
|
75
|
+
}, [offered]);
|
|
76
|
+
return html`<div id="hubEnrolmentCodeSlot">${offered && Code ? html`<${Code} client=${client} enabled=${enabled} host=${host} onChanged=${onChanged} />` : null}</div>`;
|
|
77
|
+
}
|
|
78
|
+
/** Step 3: the one sentence colleagues need, its copy button (only once steps 1 and 2 are done), and the join-code slot. */
|
|
79
|
+
export function JoinStep3({ webOrigin, step1 = false, step2 = false, features = [], client = hubClient(), onChanged, load, pending = false } = {}) {
|
|
80
|
+
const host = displayHost(webOrigin), ready = step1 && step2 && !!host, [copied, setCopied] = useState(null);
|
|
81
|
+
const copy = async () => { try { await navigator.clipboard.writeText(sw("sentence", host)); setCopied("copied"); } catch { setCopied("copyFailed"); } };
|
|
82
|
+
return html`<li class=${ready ? "now" : ""} data-step="3"><div class="hub-step-body"><span><b>${sw("step3")}</b>
|
|
83
|
+
${ready ? html`<small class="note hub-join-sentence">${sw("sentence", host)}</small>` : html`<small class="note" id="hubJoinStep3Off">${sw(pending ? "reading" : "step3Off")}</small>`}</span>
|
|
84
|
+
<button type="button" class="btn btn-sm" disabled=${!ready} aria-describedby=${ready ? undefined : "hubJoinStep3Off"} onClick=${copy}>${copied === "copied" ? sw("copied") : sw("copy")}</button>
|
|
85
|
+
${copied === "copyFailed" ? html`<p class="note" role="alert">${sw("copyFailed")}</p>` : null}
|
|
86
|
+
<${EnrolmentCodeSlot} features=${features} client=${client} enabled=${step1} host=${host} onChanged=${onChanged} ...${load ? { load } : {}} />
|
|
87
|
+
</div></li>`;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const RESOLVE = { "not-found": "notFound", "not-security-group": "notSecurity", invalid: "invalidDn", unsupported: "unsupported", unknown: "unknownGroup" };
|
|
91
|
+
const CAP_ORDER = ["ask_agents", "publish_agents", "pair_fleet"];
|
|
92
|
+
const same = (a, b) => JSON.stringify(a) === JSON.stringify(b);
|
|
93
|
+
/** A group lets its members join: connect is allowed with at least one Fleet each. */
|
|
94
|
+
export const groupLetsJoin = (g) => !!g && Array.isArray(g.allow) && g.allow.includes("pair_fleet") && g.maxFleets >= 1;
|
|
95
|
+
/** Step 2 is done from saved state: the policy is on and a group lets members join — or a join code is live (B2). */
|
|
96
|
+
export function step2Done(policy, codes) {
|
|
97
|
+
return !!policy && policy.state === "enabled" && policy.groups.some(groupLetsJoin) || Array.isArray(codes) && codes.some((c) => c && c.state === "live");
|
|
98
|
+
}
|
|
99
|
+
/** The proposed policy: saved fields, these groups, switched on once it has a group (one 儲存, spec 1.2). */
|
|
100
|
+
export function proposedPolicy(saved, groups) {
|
|
101
|
+
return { ...saved, state: groups.length ? "enabled" : saved.state,
|
|
102
|
+
groups: groups.map((g) => ({ group: { realm: g.group.realm, objectId: g.group.objectId }, dn: g.dn, allow: CAP_ORDER.filter((c) => g.allow.includes(c)), maxFleets: g.maxFleets })) };
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** Step 2: who can join — search, chips, each person's Fleet limit and the two other permissions; the server's check; one 儲存. */
|
|
106
|
+
export function JoinStep2({ client = hubClient(), onSaved } = {}) {
|
|
107
|
+
const [view, setView] = useState(null), [groups, setGroups] = useState([]), [preview, setPreview] = useState(null);
|
|
108
|
+
const [msg, setMsg] = useState(null), [saving, setSaving] = useState(false), [dn, setDn] = useState(""), [dnOpen, setDnOpen] = useState(false), [again, setAgain] = useState(0);
|
|
109
|
+
const live = useRef(true), seq = useRef(0);
|
|
110
|
+
useEffect(() => { live.current = true; return () => { live.current = false; }; }, []);
|
|
111
|
+
const load = async () => {
|
|
112
|
+
if (typeof client.groupPolicy !== "function") { setView({ supported: false, binding: "ready", policy: null }); return; } // an older client
|
|
113
|
+
let r; try { r = await client.groupPolicy(); } catch { r = { ok: false }; }
|
|
114
|
+
if (!live.current) return;
|
|
115
|
+
if (!r.ok) { setView(old => ({ ...old, failed: true })); return; }
|
|
116
|
+
setView(r); setGroups(r.policy ? r.policy.groups.map((g) => ({ ...g, allow: [...g.allow] })) : []); setPreview(null);
|
|
117
|
+
};
|
|
118
|
+
useEffect(() => { void load(); }, []);
|
|
119
|
+
const policy = view && view.policy, editable = !!policy && view.supported === true && view.binding === "ready";
|
|
120
|
+
const draft = policy ? proposedPolicy(policy, groups) : null, changed = !!draft && !same(draft, proposedPolicy(policy, policy.groups)) || !!policy && !!groups.length && policy.state !== "enabled";
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
if (!editable || !changed) { setPreview(null); return undefined; }
|
|
123
|
+
const mine = ++seq.current; setPreview({ loading: true });
|
|
124
|
+
const timer = setTimeout(async () => {
|
|
125
|
+
const r = await client.previewGroupPolicy(draft);
|
|
126
|
+
if (live.current && mine === seq.current) setPreview(r.ok ? { ok: true, ...r } : { ok: false, code: r.code });
|
|
127
|
+
}, 400);
|
|
128
|
+
return () => clearTimeout(timer);
|
|
129
|
+
}, [editable, JSON.stringify(draft), changed, again]);
|
|
130
|
+
const addResolved = async (text) => {
|
|
131
|
+
setMsg(null);
|
|
132
|
+
const r = await client.resolveGroup(text);
|
|
133
|
+
if (!live.current) return false;
|
|
134
|
+
if (!r.ok || r.reason) { setMsg({ err: true, text: sw(r.ok ? RESOLVE[r.reason] || "unknownGroup" : r.code === "unsupported" ? "unsupported" : "unknownGroup") }); return false; }
|
|
135
|
+
if (groups.some((g) => g.group.objectId === r.objectId)) { setMsg({ err: true, text: sw("duplicate") }); return false; }
|
|
136
|
+
// In this card a group is added to let its members join: chat and connect, one Fleet each (the admin can change both).
|
|
137
|
+
setGroups((gs) => [...gs, { group: { realm: r.realm, objectId: r.objectId }, dn: r.dn, allow: ["ask_agents", "pair_fleet"], maxFleets: 1 }]);
|
|
138
|
+
return true;
|
|
139
|
+
};
|
|
140
|
+
const setCap = (i, cap, on) => setGroups(groups.map((g, j) => j !== i ? g : { ...g, allow: on ? [...new Set([...g.allow, cap])] : g.allow.filter((x) => x !== cap) }));
|
|
141
|
+
const setFleets = (i, n) => setGroups(groups.map((g, j) => { if (j !== i) return g; const m = Math.max(0, Math.min(8, Math.floor(Number(n)) || 0));
|
|
142
|
+
return { ...g, maxFleets: m, allow: m > 0 ? [...new Set([...g.allow, "pair_fleet"])] : g.allow.filter((x) => x !== "pair_fleet") }; }));
|
|
143
|
+
const save = async () => {
|
|
144
|
+
if (!preview || !preview.ok || saving) return;
|
|
145
|
+
setSaving(true); setMsg(null);
|
|
146
|
+
const r = await client.saveGroupPolicy(draft, preview.previewDigest);
|
|
147
|
+
if (!live.current) return;
|
|
148
|
+
setSaving(false);
|
|
149
|
+
if (r.ok) { setMsg({ text: sw("saved") }); await load(); onSaved?.(); return; }
|
|
150
|
+
setMsg({ err: true, text: sw(r.code === "conflict" ? "conflict" : r.code === "stale-preview" || r.code === "expired" ? "stale" : "failed") });
|
|
151
|
+
if (r.code === "conflict") await load(); else if (r.code === "stale-preview" || r.code === "expired") setAgain((n) => n + 1);
|
|
152
|
+
};
|
|
153
|
+
if (!view) return html`<p class="note" aria-busy="true">${sw("previewing")}</p>`;
|
|
154
|
+
if (view.failed) return html`<div class="hub-join-read-status"><p class="note" role="status">${sw("readFailed")}</p><button type="button" class="btn" onClick=${load}>${sw("retry")}</button></div>`;
|
|
155
|
+
const pv = preview && preview.ok ? preview.impact || {} : null;
|
|
156
|
+
return html`<div class="hub-join-step2">
|
|
157
|
+
${view.supported !== true ? html`<p class="note" role="status">${sw("unsupported")}</p>` : null}
|
|
158
|
+
${view.binding === "repair-required" ? html`<p class="err" role="alert">${sw("repair")}</p>` : null}
|
|
159
|
+
${editable ? html`<${GroupSearch} client=${client} exclude=${groups.map((g) => g.group.objectId)} onPick=${(hit) => addResolved(hit.dn)} onUnsupported=${() => setDnOpen(true)} />` : null}
|
|
160
|
+
${groups.length ? html`<ul class="hub-join-groups" role="list">${groups.map((g, i) => html`<li key=${g.group.objectId} class="s-row hub-row" data-group=${g.group.objectId}>
|
|
161
|
+
<span class="hub-row-text"><strong>${(/^CN=([^,]+)/i.exec(g.dn) || [0, g.dn])[1]}</strong><small class="note"><code>${g.dn}</code></small></span>
|
|
162
|
+
<label class="field hub-join-fleets"><span>${sw("perPerson")}</span><input type="number" min="0" max="8" value=${String(g.maxFleets)} disabled=${!editable} onInput=${(e) => setFleets(i, e.target.value)} /><span>${sw("fleetsUnit")}</span></label>
|
|
163
|
+
<label class="check"><input type="checkbox" checked=${g.allow.includes("ask_agents")} disabled=${!editable} onChange=${(e) => setCap(i, "ask_agents", e.target.checked)} /> ${sw("capAsk")}</label>
|
|
164
|
+
<label class="check"><input type="checkbox" checked=${g.allow.includes("publish_agents")} disabled=${!editable} onChange=${(e) => setCap(i, "publish_agents", e.target.checked)} /> ${sw("capPublish")}</label>
|
|
165
|
+
${editable ? html`<button type="button" class="btn btn-sm btn-ghost" onClick=${() => setGroups(groups.filter((_, j) => j !== i))}>${sw("remove")}</button>` : null}</li>`)}</ul>`
|
|
166
|
+
: html`<p class="note">${sw("noGroups")}</p>`}
|
|
167
|
+
${editable ? html`<details class="s-ui-disclosure hub-join-bydn" open=${dnOpen} onToggle=${(e) => setDnOpen(e.target.open)}><summary>${sw("byDn")}</summary>
|
|
168
|
+
<form class="hub-step-form" onSubmit=${async (e) => { e.preventDefault(); if (dn.trim() && await addResolved(dn.trim())) setDn(""); }}>
|
|
169
|
+
<label class="field"><span>${sw("dnLabel")}</span><input value=${dn} autocomplete="off" spellcheck=${false} onInput=${(e) => setDn(e.target.value)} /></label>
|
|
170
|
+
<button type="submit" class="btn btn-sm" disabled=${!dn.trim()}>${sw("dnAdd")}</button></form></details>` : null}
|
|
171
|
+
${msg ? html`<p class=${msg.err ? "err" : "note"} role=${msg.err ? "alert" : "status"}>${msg.text}</p>` : null}
|
|
172
|
+
${changed && editable ? html`<div class="hub-join-preview" aria-live="polite">${!preview || preview.loading ? html`<p class="note" aria-busy="true">${sw("previewing")}</p>`
|
|
173
|
+
: !preview.ok ? html`<p class="note" role="status">${sw(preview.code === "conflict" ? "conflict" : "failed")}</p>`
|
|
174
|
+
: html`${pv.adminLosesChat ? html`<p class="err" role="alert">${sw("adminLosesChat")}</p>` : null}
|
|
175
|
+
${(pv.losingActions || []).length ? html`<p class="note"><b>${sw("losing")}</b>: ${pv.losingActions.map((r) => r.name || r.login || r.personId).join(", ")}</p>` : null}
|
|
176
|
+
${(pv.suspendedOnSave || []).length ? html`<p class="note"><b>${sw("suspended")}</b>: ${pv.suspendedOnSave.map((r) => r.label || r.id).join(", ")}</p>` : null}
|
|
177
|
+
${!(pv.losingActions || []).length && !(pv.suspendedOnSave || []).length && !pv.adminLosesChat ? html`<p class="note">${sw("noImpact")}</p>` : null}
|
|
178
|
+
<div class="field-row"><button type="button" class="btn btn-primary" disabled=${saving} onClick=${save}>${saving ? sw("saving") : sw("save")}</button></div>`}</div>` : null}
|
|
179
|
+
</div>`;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The card (spec 1.2): first on Administration. Step 1 is the existing switch (its state and writes stay the caller's);
|
|
184
|
+
* step 2 is done from the saved policy or a live join code, read here again whenever step 2 or B2's slot changes something;
|
|
185
|
+
* step 3 waits for both. `groups`: the session offers group permissions (else step 2 cannot be edited here).
|
|
186
|
+
*/
|
|
187
|
+
export function HubJoinCard({ view, busy = false, error = null, onToggle, onRetry, groups = false, features = [], client = hubClient(), webOrigin, children } = {}) {
|
|
188
|
+
const [policy, setPolicy] = useState(null), [codes, setCodes] = useState(null), [tick, setTick] = useState(0);
|
|
189
|
+
const [reading, setReading] = useState(true), [readError, setReadError] = useState(false);
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
let live = true;
|
|
192
|
+
const off = client.onSignedOut?.(() => { live = false; setPolicy(null); setCodes(null); setReading(false); setReadError(true); });
|
|
193
|
+
setReading(true); setReadError(false);
|
|
194
|
+
const read = async () => {
|
|
195
|
+
let failed = false;
|
|
196
|
+
// These also work with a retained client that has no shared read queue.
|
|
197
|
+
for (const [enabled, method, save] of [[groups, "groupPolicy", setPolicy], [true, "enrolmentCodes", setCodes]]) {
|
|
198
|
+
if (!live) return;
|
|
199
|
+
if (!enabled || typeof client[method] !== "function") continue;
|
|
200
|
+
let r; try { r = await client[method](); } catch { r = { ok: false }; }
|
|
201
|
+
if (!live) return;
|
|
202
|
+
if (r?.ok) save(method === "groupPolicy" ? r.policy : Array.isArray(r.codes) ? r.codes : null);
|
|
203
|
+
else { failed = true; if (r?.code !== "backpressure") save(null); }
|
|
204
|
+
}
|
|
205
|
+
if (live) { setReadError(failed); setReading(false); }
|
|
206
|
+
};
|
|
207
|
+
void read();
|
|
208
|
+
return () => { live = false; off?.(); };
|
|
209
|
+
}, [client, groups, tick]);
|
|
210
|
+
const changed = () => setTick((n) => n + 1);
|
|
211
|
+
const s1 = !!view && view.enabled === true, s2 = step2Done(policy, codes);
|
|
212
|
+
const origin = webOrigin || (typeof location !== "undefined" ? location.origin : "");
|
|
213
|
+
const mark = (done) => done ? html` <span class="tag ok">${sw("done")}</span>` : null;
|
|
214
|
+
return html`<section class="card hub-company-join hub-join-card" data-entry="let-colleagues-join"><h3>${sw("title")}</h3>
|
|
215
|
+
<p class="note">${sw("lead")}</p>
|
|
216
|
+
${error ? html`<p class="err" role="alert">${error}${onRetry ? html` <button type="button" class="btn btn-sm btn-ghost" onClick=${onRetry}>${sw("retry")}</button>` : null}</p>` : null}
|
|
217
|
+
${reading || readError ? html`<div class="hub-join-read-status"><p class="note" role="status" aria-busy=${reading}>${sw(reading ? "reading" : "readFailed")}</p>
|
|
218
|
+
${readError ? html`<button type="button" class="btn" onClick=${changed}>${sw("retry")}</button>` : null}</div>` : null}
|
|
219
|
+
<ol class="hub-steps hub-join-steps">
|
|
220
|
+
<li class=${s1 ? "done" : "now"} data-step="1"><div class="hub-step-body"><span><b>${sw("step1")}${mark(s1)}</b></span>
|
|
221
|
+
${view ? html`<label class="check"><input type="checkbox" role="switch" class="s-ui-toggle" checked=${view.enabled} disabled=${busy || !!error} onChange=${(e) => onToggle?.(e.target.checked)} /><span>${sw("step1Switch")}</span></label>` : null}</div></li>
|
|
222
|
+
<li class=${s2 ? "done" : s1 ? "now" : ""} data-step="2"><div class="hub-step-body"><span><b>${sw("step2")}${mark(s2)}</b><small class="note">${sw("step2Hint")} ${features.includes("enrolment-code-v1") ? sw("step2Code") : ""}</small></span>
|
|
223
|
+
${groups ? html`<${JoinStep2} client=${client} onSaved=${changed} />` : html`<p class="note" role="status">${sw("unsupported")}</p>`}</div></li>
|
|
224
|
+
<${JoinStep3} webOrigin=${origin} step1=${s1} step2=${s2} features=${features} client=${client} onChanged=${changed} pending=${!view || reading || readError} />
|
|
225
|
+
</ol>
|
|
226
|
+
${view && view.enabled && view.companyLink ? html`<details class="s-ui-disclosure hub-join-advanced"><summary>${sw("advanced")}</summary><div class="s-disclosure-body"><p class="note">${sw("advancedHint")}</p>
|
|
227
|
+
<label class="field"><span>${sw("advanced")}</span><textarea rows="4" readonly value=${view.companyLink} /></label></div></details>` : null}
|
|
228
|
+
${children}
|
|
229
|
+
</section>`;
|
|
230
|
+
}
|
|
231
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** New flow copy stays with the fresh modules even when a tab holds the older B2 dictionary. */
|
|
2
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
3
|
+
import { he } from "./hub-enrolment-code-strings.js";
|
|
4
|
+
register("joinCodeFlow", {
|
|
5
|
+
en: {
|
|
6
|
+
liveLimit: "At most 8 join codes can be live. End one before creating another.",
|
|
7
|
+
hourlyLimit: "At most 10 join codes can be created in one hour. Try again later.",
|
|
8
|
+
endTitle: "End this join code?", endConfirm: "This code cannot be used again.",
|
|
9
|
+
endPending: "{0} Fleet connections in progress will stop.", endNames: "Including these Fleets:", endOthers: "And {0} others.",
|
|
10
|
+
endUnchanged: "Fleets already connected are unchanged.", queuedProgress: "Waiting in the queue… Retry {0} of 8.",
|
|
11
|
+
},
|
|
12
|
+
"zh-TW": {
|
|
13
|
+
liveLimit: "最多 8 組有效的加入碼,請先停用一組,再建立新的加入碼。",
|
|
14
|
+
hourlyLimit: "一小時內最多建立 10 組加入碼,請晚點再試。",
|
|
15
|
+
endTitle: "停用這組加入碼?", endConfirm: "這組加入碼將無法再使用。",
|
|
16
|
+
endPending: "正在連接的 {0} 台 Fleet 將中斷。", endNames: "包含以下 Fleet:", endOthers: "以及另外 {0} 台。",
|
|
17
|
+
endUnchanged: "已連接的 Fleet 不受影響。", queuedProgress: "正在排隊…第 {0} 次重試,共 8 次。",
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
export const jf = (key, ...args) => t(`joinCodeFlow.${key}`, ...args);
|
|
21
|
+
/** An older hook has no attempt counter: retain the truthful generic queue message. */
|
|
22
|
+
export const queueMessage = attempt => Number.isInteger(attempt) && attempt >= 1 && attempt <= 8 ? jf("queuedProgress", attempt) : he("queued");
|
|
@@ -14,30 +14,30 @@ register("hubOwner", {
|
|
|
14
14
|
approvedTag: "Approved", backToMine: "My shared agents", codeFor: "Pairing code for {0}", codeUnusedYet: "Not used yet", fleetOf: "{0}'s fleet",
|
|
15
15
|
makeCode: "Create pairing code", mayAsk: "{0} may ask", mayAskNone: "No one may ask yet", mayAskOne: "1 may ask",
|
|
16
16
|
mineLead: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately. To share or stop sharing one, use your fleet's Settings → Hub.", mineLeadShort: "The agents that answer for you on this Hub: who may ask them, until when, and who asked lately.",
|
|
17
|
-
noFleets: "No fleet is
|
|
18
|
-
pairedFleets: "
|
|
19
|
-
pauseTitle: "
|
|
17
|
+
noFleets: "No fleet is connected yet.", ownerChecked: "The owner confirmed", ownerLogin: "Owner's sign-in name", pairSteps: "Pair a fleet",
|
|
18
|
+
pairedFleets: "Connected fleets · {0}", pauseGo: "Stop sharing…", pauseLead: "No one can ask it any more. To share it again, it has to be shared again from its fleet, and everyone has to be allowed to ask again. What was asked stays readable.",
|
|
19
|
+
pauseTitle: "Stop sharing", pendingLead: "Check that this fingerprint matches the one your fleet shows, then confirm.",
|
|
20
20
|
pendingPairings: "Pairings waiting for you", recent: "Recent questions",
|
|
21
21
|
recentLead: "Who asked and when, and whether it was answered. What they asked stays in your fleet's chat.", recentNone: "No one has asked yet.",
|
|
22
22
|
refresh: "Refresh", revokeItem: "Revoke…", revokedTag: "Revoked", rowMenu: "More for {0}", scopeHub: "This Hub", scopeYou: "Yours",
|
|
23
|
-
sharedCount: "Shared · {0}", stageAnswered: "Answered", stageNot: "Not answered", stageWaiting: "Waiting", statePaused: "
|
|
23
|
+
sharedCount: "Shared · {0}", stageAnswered: "Answered", stageNot: "Not answered", stageWaiting: "Waiting", statePaused: "Sharing stopped on the Hub",
|
|
24
24
|
stateShared: "Shared", stateWithdrawn: "Withdrawn", stepApprove: "You approve", stepApproveHint: "Check the same fingerprint, then approve.",
|
|
25
25
|
stepCode: "Make a pairing code", stepCodeHint: "For the fleet's owner: they type it in their fleet within 10 minutes; it works once.",
|
|
26
26
|
stepOwner: "The owner checks the fingerprint", stepOwnerHint: "In their fleet, then on this Hub under My shared agents.",
|
|
27
27
|
untilLeft: "until {0} ({1})", waitingOwner: "Waiting for the owner", whoMayAsk: "Who may ask",
|
|
28
28
|
},
|
|
29
29
|
"zh-TW": {
|
|
30
|
-
memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub →
|
|
30
|
+
memberAddress: "Hub 位址", memberAddressHint: "在你的 Fleet「設定 → Hub → 其他方式」的「Hub 位址」欄位貼上這個位址,並輸入配對碼。這與 Hub 的瀏覽器位址不同。",
|
|
31
31
|
memberAddressMissing: "請向管理員索取要填入「Hub 位址」欄位的位址;它的連接埠可能與這個頁面不同。", copyHandoff: "複製位址與配對碼", handoffCopied: "已複製位址與配對碼", handoffCopyFailed: "無法複製。請選取上方的位址與配對碼來複製。",
|
|
32
32
|
active: "使用中", adminLead: "管理允許連接的人員與已連接的 Fleet。這裡看不到任何人的對話。", manualAdvanced: "進階:使用配對碼連接", allow: "允許提問…", allowDays: "期限", allowGo: "允許", allowLogin: "對方的登入名稱",
|
|
33
33
|
allowLoginHint: "對方登入這個 Hub 用的帳號。", allowTitle: "允許提問 {0}", approveGo: "核准…", approvedTag: "已核准", backToMine: "我分享的 Agent",
|
|
34
34
|
codeFor: "給 {0} 的配對碼", codeUnusedYet: "還沒使用", fleetOf: "{0} 的 Fleet", makeCode: "產生配對碼", mayAsk: "{0} 人可以提問", mayAskNone: "還沒有人可以提問",
|
|
35
|
-
mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 Fleet 的「設定 → Hub」。", mineLeadShort: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。", noFleets: "
|
|
36
|
-
ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 Fleet", pairedFleets: "
|
|
37
|
-
pauseLead: "
|
|
35
|
+
mayAskOne: "1 人可以提問", mineLead: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。要開始或停止分享,請到你 Fleet 的「設定 → Hub」。", mineLeadShort: "在這個 Hub 上代表你回答的 Agent:誰可以提問、到什麼時候、最近誰問過。", noFleets: "還沒有已連接的 Fleet。",
|
|
36
|
+
ownerChecked: "擁有者已確認", ownerLogin: "擁有者的登入名稱", pairSteps: "配對一個 Fleet", pairedFleets: "已連接的 Fleet · {0}", pauseGo: "停止分享…",
|
|
37
|
+
pauseLead: "之後沒有人能再向它提問。要再分享,必須回到它的 Fleet 重新分享,而且每個人都要重新允許提問。已經問過的內容仍然看得到。", pauseTitle: "停止分享", pendingLead: "確認這個指紋和你 Fleet 上顯示的一致,再按確認。", pendingPairings: "等你核對的配對",
|
|
38
38
|
recent: "最近的提問", recentLead: "誰問的、什麼時候,有沒有回答。問了什麼留在你 Fleet 的聊天裡。", recentNone: "還沒有人問過。", refresh: "重新整理", revokeItem: "撤銷…", revokedTag: "已撤銷",
|
|
39
39
|
rowMenu: "{0} 的更多動作", scopeHub: "這個 Hub", scopeYou: "你的", sharedCount: "分享中 · {0}", stageAnswered: "已回答", stageNot: "未回答", stageWaiting: "等待中",
|
|
40
|
-
statePaused: "
|
|
40
|
+
statePaused: "已在 Hub 停止分享", stateShared: "分享中", stateWithdrawn: "已停止分享", stepApprove: "你核准", stepApproveHint: "核對同一個指紋後核准。", stepCode: "產生配對碼",
|
|
41
41
|
stepCodeHint: "給 Fleet 的擁有者:10 分鐘內在他的 Fleet 輸入,只能用一次。", stepOwner: "擁有者核對指紋", stepOwnerHint: "在他的 Fleet 上,然後在這個 Hub 的「我分享的 Agent」確認。",
|
|
42
42
|
untilLeft: "到 {0}({1})", waitingOwner: "等待擁有者", whoMayAsk: "可以提問的人",
|
|
43
43
|
},
|