@songsid/agend 2.4.0-alpha.4 → 2.4.0-beta.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/dist/agent-whats-new.js +1 -1
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/auth-api.js +1 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/daemon.js +2 -1
- package/dist/daemon.js.map +1 -1
- package/dist/delivery-consumed-watch.d.ts +2 -0
- package/dist/delivery-consumed-watch.js +1 -1
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +8 -2
- package/dist/general-knowledge/skills/hub/SKILL.md +53 -16
- package/dist/hub/catalog.d.ts +1 -1
- package/dist/hub/catalog.js +34 -10
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +6 -0
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/grant-access.js +23 -3
- package/dist/hub/grant-access.js.map +1 -1
- package/dist/hub/grant-search.js +13 -1
- package/dist/hub/grant-search.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.js +18 -2
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/http/compose.js +76 -5
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/deps.d.ts +2 -0
- package/dist/hub/http/schema.js +2 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/join/store.d.ts +5 -0
- package/dist/hub/join/store.js +12 -2
- package/dist/hub/join/store.js.map +1 -1
- package/dist/hub/person-prefs.d.ts +22 -0
- package/dist/hub/person-prefs.js +34 -0
- package/dist/hub/person-prefs.js.map +1 -0
- package/dist/hub/rooms/service.js +1 -1
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +3 -1
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-member-address-http.js +3 -2
- package/dist/hub/settings-member-address-http.js.map +1 -1
- package/dist/hub/settings-member-address-policy.d.ts +3 -2
- package/dist/hub/settings-member-address-policy.js +3 -1
- package/dist/hub/settings-member-address-policy.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +3 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-http.js +3 -2
- package/dist/hub/settings-web-address-http.js.map +1 -1
- package/dist/hub/settings-web-address-policy.d.ts +3 -2
- package/dist/hub/settings-web-address-policy.js +3 -1
- package/dist/hub/settings-web-address-policy.js.map +1 -1
- package/dist/hub/teams/grant-schema.d.ts +2 -0
- package/dist/hub/teams/grant-schema.js +13 -0
- package/dist/hub/teams/grant-schema.js.map +1 -0
- package/dist/hub/teams/index.d.ts +7 -0
- package/dist/hub/teams/index.js +273 -0
- package/dist/hub/teams/index.js.map +1 -0
- package/dist/hub/teams/store.d.ts +34 -0
- package/dist/hub/teams/store.js +57 -0
- package/dist/hub/teams/store.js.map +1 -0
- package/dist/hub/teams/types.d.ts +58 -1
- package/dist/hub/types.d.ts +3 -0
- package/dist/hub-pilot-trust-settings.d.ts +1 -1
- package/dist/hub-pilot-trust-settings.js +2 -2
- package/dist/hub-pilot-trust-settings.js.map +1 -1
- package/dist/locale.js +2 -0
- package/dist/locale.js.map +1 -1
- package/dist/transcript-needles.d.ts +4 -2
- package/dist/transcript-needles.js +35 -4
- package/dist/transcript-needles.js.map +1 -1
- package/dist/ui/hub-client.js +18 -5
- package/dist/ui/hub-grant-picker.js +14 -5
- package/dist/ui/hub-group-strings.js +3 -3
- package/dist/ui/hub-room-composer.js +12 -2
- package/dist/ui/hub-room-favorites.js +63 -5
- package/dist/ui/hub-room-strings.js +2 -0
- package/dist/ui/hub-room-thread.js +39 -13
- package/dist/ui/hub-strings.js +2 -0
- package/dist/ui/hub-teams-strings.js +34 -0
- package/dist/ui/hub-teams.js +169 -0
- package/dist/ui/panel-hub.js +34 -16
- package/dist/ui/settings-hub-member-address.js +21 -6
- package/dist/ui/settings-hub-section.js +2 -2
- package/dist/ui/settings-hub-web-address.js +21 -5
- package/dist/ui/settings-layout.js +5 -1
- package/dist/ui/shared/app-shell.js +40 -6
- package/dist/ui/shared/app.css +3 -0
- package/dist/ui/shared/chat-thread.js +2 -1
- package/dist/ui/shared/hub-chat.css +5 -0
- package/dist/ui/shared/hub-signin.css +2 -0
- package/dist/ui/shared/hub-teams.css +31 -0
- package/dist/ui/shared/page-head.js +3 -2
- package/dist/ui/shared/usage-dialog.js +2 -1
- package/dist/ui/shared/view-strings.js +2 -0
- package/dist/usage/agent-output.js +1 -0
- package/dist/usage/agent-output.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +1 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/i18n.d.ts +1 -1
- package/dist/usage/i18n.js +2 -1
- package/dist/usage/i18n.js.map +1 -1
- package/dist/usage/providers.d.ts +4 -1
- package/dist/usage/providers.js +25 -10
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +1 -1
- package/dist/usage/usage-api.js +4 -4
- package/dist/usage/usage-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { GroupSearch } from "./hub-group-search.js";
|
|
|
6
6
|
import { hubClient } from "./hub-client.js";
|
|
7
7
|
register("hubGrantPicker", {
|
|
8
8
|
en: {
|
|
9
|
-
title: "Allow access to {0}", kind: "Allow", person: "A person", group: "An AD security group", findPerson: "Find a person", query: "Name or login", hint: "Type 2 to 64 characters.",
|
|
9
|
+
title: "Allow access to {0}", kind: "Allow", person: "A person", group: "An AD security group", team: "A team", teamPick: "Choose a team", teamHint: "The team's current members may ask. Removing someone from the team ends that permission. The grant's expiry keeps running.", findPerson: "Find a person", query: "Name or login", hint: "Type 2 to 64 characters.",
|
|
10
10
|
searching: "Searching…", none: "No matching people. Try more of their name or login.", more: "More people match. Type more of the name.", pick: "Choose {0}", choose: "Choose", change: "Choose someone else",
|
|
11
11
|
failed: "The directory could not be searched just now. Try again.", unsupported: "This directory does not support that search.", limited: "Too many searches. Try again shortly.", retry: "Search again",
|
|
12
12
|
days: "Access lasts", day: "{0} days", expiry: "Choose up to 90 days. Access expires automatically; removing the grant also ends access to its chats.",
|
|
@@ -14,7 +14,7 @@ register("hubGrantPicker", {
|
|
|
14
14
|
save: "Allow", cancel: "Cancel", refused: "The selected person or group changed or is no longer available. Search and choose again.", saveFailed: "Access could not be saved. Check the current agent and try again.",
|
|
15
15
|
},
|
|
16
16
|
"zh-TW": {
|
|
17
|
-
title: "允許向 {0} 提問", kind: "允許對象", person: "個人", group: "AD 安全性群組", findPerson: "尋找同仁", query: "姓名或登入帳號", hint: "請輸入 2 到 64 個字。",
|
|
17
|
+
title: "允許向 {0} 提問", kind: "允許對象", person: "個人", group: "AD 安全性群組", team: "團隊", teamPick: "選擇團隊", teamHint: "依團隊目前的成員允許提問;成員離開團隊後就不再適用這份權限,授權的到期時間照常計算。", findPerson: "尋找同仁", query: "姓名或登入帳號", hint: "請輸入 2 到 64 個字。",
|
|
18
18
|
searching: "搜尋中…", none: "找不到符合的同仁。請多輸入幾個姓名或帳號的字。", more: "還有更多同仁符合,請多輸入幾個字。", pick: "選擇 {0}", choose: "選擇", change: "重新選擇對象",
|
|
19
19
|
failed: "目前無法搜尋目錄,請再試一次。", unsupported: "這個目錄不支援這項搜尋。", limited: "搜尋太多次了,請稍後再試。", retry: "重新搜尋",
|
|
20
20
|
days: "允許多久", day: "{0} 天", expiry: "最長 90 天,到期自動失效;移除授權也會結束其聊天存取權。",
|
|
@@ -55,6 +55,13 @@ function PeopleSearch({ search, disabled, onPick }) {
|
|
|
55
55
|
<button type="button" class="btn btn-sm" disabled=${disabled} aria-label=${g("pick", p.displayName || p.login)} onClick=${() => onPick(p)}>${g("choose")}</button></li>`)}</ul>` : null}
|
|
56
56
|
</div>`;
|
|
57
57
|
}
|
|
58
|
+
function TeamPick({ client, disabled, onPick }) {
|
|
59
|
+
const [answer, setAnswer] = useState(null), [retry, setRetry] = useState(0);
|
|
60
|
+
useEffect(() => { let live = true; Promise.resolve().then(() => client.teams()).then(out => { if (live) setAnswer(out); }, () => { if (live) setAnswer({ ok: false }); }); return () => { live = false; }; }, [client, retry]);
|
|
61
|
+
if (!answer) return html`<p class="note" role="status">${g("searching")}</p>`;
|
|
62
|
+
if (!answer.ok) return html`<p class="err" role="status">${g("failed")}</p><button type="button" class="btn btn-sm" disabled=${disabled} onClick=${() => setRetry(n => n + 1)}>${g("retry")}</button>`;
|
|
63
|
+
return html`<label class="field"><span>${g("teamPick")}</span><select data-grant-team value="" disabled=${disabled} onChange=${e => { const row = answer.teams?.find(row => row.id === e.target.value); if (row) onPick(row); }}><option value="">${g("teamPick")}</option>${(answer.teams || []).map(row => html`<option value=${row.id}>${row.name}</option>`)}</select></label>`;
|
|
64
|
+
}
|
|
58
65
|
export function HubGrantPicker({ x, client, act, onClose }) {
|
|
59
66
|
const [kind, setKind] = useState("person"), [selected, setSelected] = useState(null), [days, setDays] = useState(7), [busy, setBusy] = useState(false), [error, setError] = useState(null), [unsupported, setUnsupported] = useState(false);
|
|
60
67
|
const life = useRef(0), writing = useRef(false), controllers = useRef(new Set());
|
|
@@ -75,7 +82,7 @@ export function HubGrantPicker({ x, client, act, onClose }) {
|
|
|
75
82
|
const submit = async event => {
|
|
76
83
|
event?.preventDefault?.(); if (writing.current || !selected || client !== hubClient()) return;
|
|
77
84
|
writing.current = true; setBusy(true); setError(null); const mine = life.current;
|
|
78
|
-
const subject = kind === "group" ? { kind: "group", group: { realm: selected.realm, objectId: selected.objectId }, dn: selected.dn }
|
|
85
|
+
const subject = kind === "team" ? { kind: "team", teamId: selected.id } : kind === "group" ? { kind: "group", group: { realm: selected.realm, objectId: selected.objectId }, dn: selected.dn }
|
|
79
86
|
: { kind: "person", person: { ...selected.person } };
|
|
80
87
|
const input = { exposureId: x.id, exposureRevision: x.revision, days, subject, ...(kind === "person" ? { login: selected.login } : {}) };
|
|
81
88
|
try {
|
|
@@ -87,12 +94,14 @@ export function HubGrantPicker({ x, client, act, onClose }) {
|
|
|
87
94
|
return html`<${Dialog} title=${g("title", x.displayName)} onClose=${onClose} actions=${html`<button type="button" class="btn" onClick=${onClose}>${g("cancel")}</button><button type="button" class="btn btn-primary" disabled=${busy || !selected} onClick=${submit}>${g("save")}</button>`}>
|
|
88
95
|
<form class="form hub-grant" data-grant-picker onSubmit=${submit}>
|
|
89
96
|
${error ? html`<p class="err" role="alert">${error}</p>` : null}
|
|
90
|
-
<label class="field"><span>${g("kind")}</span><select data-grant-kind value=${kind} disabled=${busy} onChange=${e => { change(); setKind(e.target.value); }}><option value="person">${g("person")}</option><option value="group">${g("group")}</option
|
|
91
|
-
${selected ? html`<div class="s-row"><span class="hub-row-text"><strong>${selected.displayName || selected.cn || selected.login}</strong><small class="note"><code>${selected.login || selected.dn}</code></small></span><button type="button" class="btn btn-sm" disabled=${busy} onClick=${change}>${g("change")}</button></div>`
|
|
97
|
+
<label class="field"><span>${g("kind")}</span><select data-grant-kind value=${kind} disabled=${busy} onChange=${e => { change(); setKind(e.target.value); }}><option value="person">${g("person")}</option><option value="group">${g("group")}</option>${client.teamsLive?.() === true ? html`<option value="team">${g("team")}</option>` : null}</select></label>
|
|
98
|
+
${selected ? html`<div class="s-row"><span class="hub-row-text"><strong>${selected.name || selected.displayName || selected.cn || selected.login}</strong><small class="note"><code>${selected.login || selected.dn || ""}</code></small></span><button type="button" class="btn btn-sm" disabled=${busy} onClick=${change}>${g("change")}</button></div>`
|
|
92
99
|
: kind === "person" ? html`<${PeopleSearch} search=${search} disabled=${busy} onPick=${setSelected} />`
|
|
100
|
+
: kind === "team" ? html`<${TeamPick} client=${client} disabled=${busy} onPick=${setSelected} />`
|
|
93
101
|
: html`<${GroupSearch} client=${groupClient} id="hubGrantGroup" disabled=${busy} unknownHint=${g("failed")} onUnsupported=${() => setUnsupported(true)} onPick=${p => setSelected({ ...p, realm: x.owner?.realm || "" })} />`}
|
|
94
102
|
${unsupported ? html`<p class="err" role="status">${g("unsupported")}</p>` : null}
|
|
95
103
|
${kind === "group" ? html`<p class="note">${g("groupHint")}</p>` : null}
|
|
104
|
+
${kind === "team" ? html`<p class="note">${g("teamHint")}</p>` : null}
|
|
96
105
|
<label class="field"><span>${g("days")}</span><select data-grant-days value=${String(days)} disabled=${busy} onChange=${e => setDays(Number(e.target.value))}>${[1, 7, 30, 90].map(d => html`<option value=${String(d)}>${g("day", d)}</option>`)}</select></label>
|
|
97
106
|
<p class="note">${g("expiry")}</p>
|
|
98
107
|
</form>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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).
|
|
2
|
+
// module so a tab holding an older hub-strings.js still draws these pages (retained-module SKEW). Preview; off unless the
|
|
3
3
|
// Hub's session says `group-policy-v1`.
|
|
4
4
|
import { register, t } from "/assets/app-i18n.js";
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ register("hubGroups", {
|
|
|
8
8
|
// Discovery
|
|
9
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
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: "
|
|
11
|
+
experimental: "Preview",
|
|
12
12
|
// Editor
|
|
13
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
14
|
back: "Administration", unsupported: "This Hub's directory can't be used for group permissions. Group permissions need Active Directory over LDAPS (port 636).",
|
|
@@ -55,7 +55,7 @@ register("hubGroups", {
|
|
|
55
55
|
"zh-TW": {
|
|
56
56
|
entryTitle: "群組權限", entryHint: "讓指定目錄群組的成員與 Agent 對話、分享 Agent 或連接自己的 Fleet,不必逐一核准每個人。",
|
|
57
57
|
entryOpen: "開啟群組權限", entryOpenHub: "在 Hub 上開啟", settingsRowHint: "在 Hub 的「管理」頁設定,需以 Hub 管理員身分登入。",
|
|
58
|
-
experimental: "
|
|
58
|
+
experimental: "預覽版",
|
|
59
59
|
title: "群組權限", lead: "這些目錄群組的成員可以做下列動作。目錄中的每個人仍然都能登入;與 Agent 對話仍需要 Agent 擁有者的授權。",
|
|
60
60
|
back: "管理", unsupported: "這個 Hub 的目錄無法用於群組權限。群組權限需要透過 LDAPS(連接埠 636)的 Active Directory。",
|
|
61
61
|
repair: "目錄設定在群組權限儲存後改變了。在修復 Hub 之前,群組權限暫停。",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// - with @所有 Agent in the text, a line above says how many answer now and how many after they come back;
|
|
6
6
|
// - under the box, always: messages with no @agent are seen only by the people in the room;
|
|
7
7
|
// - `/` is plain text here (no slash commands); a refusal is worded where the Fleet chat words "Not sent: …".
|
|
8
|
-
import { html, useState, useRef } from "/assets/app-html.js";
|
|
8
|
+
import { html, useEffect, useState, useRef } from "/assets/app-html.js";
|
|
9
9
|
import { ComposerInput, touchScreen } from "/assets/chat-composer.js";
|
|
10
10
|
import { t } from "/assets/app-i18n.js";
|
|
11
11
|
import { Icon } from "/assets/ui-icons.js";
|
|
@@ -15,6 +15,15 @@ import { presenceDot } from "./hub-room-presence.js";
|
|
|
15
15
|
const ONLINE = new Set(["online", "idle", "working"]);
|
|
16
16
|
const agentsOf = (detail) => (detail?.members || []).filter((m) => m.kind === "agent" || m.kind === "later");
|
|
17
17
|
|
|
18
|
+
/** Lumen (spec §4): where the room's long placeholder doesn't fit (a phone), the short one. */
|
|
19
|
+
const SHORT_QUERY = "(max-width: 599px)";
|
|
20
|
+
function useShortPlaceholder() {
|
|
21
|
+
const q = typeof matchMedia === "function" ? matchMedia(SHORT_QUERY) : null;
|
|
22
|
+
const [short, setShort] = useState(() => !!q?.matches);
|
|
23
|
+
useEffect(() => { if (!q) return; const on = () => setShort(q.matches); q.addEventListener?.("change", on); return () => q.removeEventListener?.("change", on); }, []);
|
|
24
|
+
return short;
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
/** The @ token being typed at `caret` (from an `@` after a space or the start to the caret), or null. */
|
|
19
28
|
export function mentionAt(value, caret) {
|
|
20
29
|
const before = String(value || "").slice(0, caret), at = before.lastIndexOf("@");
|
|
@@ -70,6 +79,7 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
70
79
|
const at = mentionAt(value, caret), options = at ? mentionOptions(detail, at.query) : [];
|
|
71
80
|
const palette = at && options.length ? options : null, chosen = palette ? palette[Math.min(pick, palette.length - 1)] : null;
|
|
72
81
|
const room = detail?.room || {}, group = room.kind === "group";
|
|
82
|
+
const short = useShortPlaceholder();
|
|
73
83
|
// 「在這裡 @ 它」 from the members panel: the mention goes into the box, after what is there.
|
|
74
84
|
if (insertRef) insertRef.current = (text) => { setValue((v) => `${v && !/\s$/.test(v) ? `${v} ` : v}${text} `); setTimeout(() => input.current?.focus(), 0); };
|
|
75
85
|
const complete = (o) => {
|
|
@@ -103,7 +113,7 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
103
113
|
${group && value.includes(hroom("mentionAll")) ? html`<p class="note hub-room-allbar" role="status">${allBar(detail)}</p>` : null}
|
|
104
114
|
${reply ? html`<div class="reply-bar" data-trust="composer" role="status"><span class="reply-text">${reply.sender ? `${reply.sender} · ` : ""}${String(reply.text || "").slice(0, 80)}</span>
|
|
105
115
|
<button type="button" class="icon-btn reply-cancel" title=${hroom("cancel")} aria-label=${hroom("cancel")} onClick=${() => { onReply(null); input.current?.focus(); }}><${Icon} name="close" size=${14} /></button></div>` : null}
|
|
106
|
-
<${ComposerInput} inputRef=${input} value=${value} placeholder=${room.assistant ? hroom("composerAssistant") : group ? hroom("composer", room.name || "") : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
116
|
+
<${ComposerInput} inputRef=${input} value=${value} placeholder=${room.assistant ? hroom("composerAssistant") : group ? (short ? hroom("composerShort") : hroom("composer", room.name || "")) : hroom("composerDirect", room.name || "")} onValue=${track} onKeyDown=${onKeyDown}
|
|
107
117
|
controls=${palette ? paletteId : undefined} expanded=${!!palette} activeDescendant=${chosen ? optId(chosen) : undefined}
|
|
108
118
|
stop=${{ hidden: true, disabled: true, title: t("chat.stopReply"), label: t("chat.stopReply"), onClick: () => {} }}
|
|
109
119
|
send=${{ hidden: false, disabled: !value.trim() || busy, label: t("chat.send"), onClick: () => { void send(); } }} />
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
// 「最愛」 above 「房間」 and 「Agent」 in the order they were starred (or moved in Edit), at most MAX_FAVORITES, and one that
|
|
4
4
|
// is gone from the list (left, removed) is dropped on the next change, never shown.
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// apart); another tab follows through the storage event. A Hub-side store replaces the source, not this module's rules.
|
|
6
|
+
// A Hub with person-prefs-v1 keeps them per directory person. This browser's old list seeds an unset Hub record once;
|
|
7
|
+
// an older Hub still uses local storage. The source changes, not the list's rules.
|
|
9
8
|
import { useEffect, useState } from "/assets/app-html.js";
|
|
10
9
|
import { createStore, useStore } from "/assets/app-store.js";
|
|
11
10
|
import { MAX_FAVORITES } from "/assets/instance-nav.js";
|
|
@@ -36,9 +35,68 @@ export const localFavoritesSource = {
|
|
|
36
35
|
};
|
|
37
36
|
|
|
38
37
|
let source = localFavoritesSource;
|
|
39
|
-
/** Tests
|
|
38
|
+
/** Tests swap where favourites are kept. */
|
|
40
39
|
export function setFavoritesSource(next) { source = next || localFavoritesSource; }
|
|
41
40
|
|
|
41
|
+
/** A session-owned cache: serialized writes, first-write migration, and refresh on focus or another tab's write. */
|
|
42
|
+
export function createHubFavoritesSource(client, session) {
|
|
43
|
+
let ids = [], ready = false, active = false, pending = null, writing = null, refreshing = null, revision = 0, edits = 0;
|
|
44
|
+
let changed = () => {};
|
|
45
|
+
const apply = (out) => {
|
|
46
|
+
if (!active || !out.ok || !Number.isSafeInteger(out.revision) || out.revision < revision) return;
|
|
47
|
+
revision = out.revision; ids = cleanIds(out.favorites); ready = true;
|
|
48
|
+
localFavoritesSource.write(session.login, ids);
|
|
49
|
+
changed();
|
|
50
|
+
};
|
|
51
|
+
const drain = () => writing ??= (async () => {
|
|
52
|
+
while (active && ready && pending) {
|
|
53
|
+
const sent = pending;
|
|
54
|
+
let out;
|
|
55
|
+
try { out = await client.savePersonPrefs(session.csrf, sent); } catch { break; }
|
|
56
|
+
if (!active || !out.ok) break; // retain the pending change for focus/the next edit
|
|
57
|
+
if (pending === sent) { pending = null; apply(out); }
|
|
58
|
+
else revision = Math.max(revision, out.revision || 0);
|
|
59
|
+
}
|
|
60
|
+
})().finally(() => { writing = null; });
|
|
61
|
+
const refresh = () => refreshing ??= (async () => {
|
|
62
|
+
await drain();
|
|
63
|
+
if (!active || pending) return;
|
|
64
|
+
const before = edits;
|
|
65
|
+
let out;
|
|
66
|
+
try {
|
|
67
|
+
out = await client.personPrefs(session.csrf);
|
|
68
|
+
if (!active || !out.ok || edits !== before) return;
|
|
69
|
+
if (!out.initialized) out = await client.savePersonPrefs(session.csrf, localFavoritesSource.read(session.login), true);
|
|
70
|
+
} catch { return; }
|
|
71
|
+
if (edits === before) apply(out);
|
|
72
|
+
})().finally(() => { refreshing = null; });
|
|
73
|
+
return {
|
|
74
|
+
ready: () => ready,
|
|
75
|
+
read: () => ids,
|
|
76
|
+
write(_login, value) { ids = cleanIds(value); pending = ids; edits++; void drain(); },
|
|
77
|
+
watch(_login, onChange) {
|
|
78
|
+
active = true; changed = onChange;
|
|
79
|
+
const unwatch = localFavoritesSource.watch(session.login, () => { void refresh(); });
|
|
80
|
+
const focus = () => { void refresh(); };
|
|
81
|
+
globalThis.addEventListener?.("focus", focus);
|
|
82
|
+
void refresh();
|
|
83
|
+
return () => { active = false; changed = () => {}; unwatch(); globalThis.removeEventListener?.("focus", focus); };
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
let configuredClient, configuredCsrf;
|
|
89
|
+
/** Called by the session owner; optional from the shell so an older cached module still loads. */
|
|
90
|
+
export function configureHubFavorites(client, session) {
|
|
91
|
+
const remote = session?.features?.includes("person-prefs-v1") && typeof client.personPrefs === "function" && typeof client.savePersonPrefs === "function";
|
|
92
|
+
const csrf = remote ? session.csrf : null;
|
|
93
|
+
if (configuredClient === client && configuredCsrf === csrf) return;
|
|
94
|
+
configuredClient = client; configuredCsrf = csrf;
|
|
95
|
+
loadFavorites(null); // retire the previous person's listener and late responses
|
|
96
|
+
source = remote ? createHubFavoritesSource(client, session) : localFavoritesSource;
|
|
97
|
+
loadFavorites(session?.login);
|
|
98
|
+
}
|
|
99
|
+
|
|
42
100
|
/** { login, ids }: whose favourites are loaded, and their ids in order. */
|
|
43
101
|
export const favoritesStore = createStore({ login: null, ids: [] });
|
|
44
102
|
let unwatch = () => {};
|
|
@@ -83,7 +141,7 @@ export function useRoomStar(rooms, login) {
|
|
|
83
141
|
const fav = useStore(favoritesStore);
|
|
84
142
|
const [editing, setEditing] = useState(false);
|
|
85
143
|
useEffect(() => { loadFavorites(login); }, [login]);
|
|
86
|
-
if (!login || fav.login !== login) return null;
|
|
144
|
+
if (!login || fav.login !== login || source.ready?.(login) === false) return null;
|
|
87
145
|
const known = new Set((Array.isArray(rooms) ? rooms : []).map((r) => r && r.id).filter(Boolean));
|
|
88
146
|
return { ids: liveFavorites(known, fav.ids), editing, setEditing,
|
|
89
147
|
toggle: (id) => toggleFavorite(id, known), move: (id, delta) => moveFavorite(id, delta, known) };
|
|
@@ -28,6 +28,7 @@ register("hubRoom", {
|
|
|
28
28
|
workingOne: "{0} is working on it", workingMany: "{0} agents are working",
|
|
29
29
|
// §4 composer
|
|
30
30
|
composer: "Speak in “{0}”; @ an agent to have it answer",
|
|
31
|
+
composerShort: "Message, or @ an agent to ask", // Lumen (spec §4): a phone's width
|
|
31
32
|
mentionAllHint: "{0} will all answer", mentionAssistant: "@Room assistant",
|
|
32
33
|
mentionAssistantHint: "Provided by the Hub",
|
|
33
34
|
allBar: "{0} agents, {1} online, {2} will answer after they come online",
|
|
@@ -137,6 +138,7 @@ register("hubRoom", {
|
|
|
137
138
|
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答",
|
|
138
139
|
workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
|
|
139
140
|
composer: "在「{0}」說話;@ 一個 Agent 請它回答",
|
|
141
|
+
composerShort: "說話,或 @ Agent 請它回答",
|
|
140
142
|
mentionAllHint: "{0} 個都會回答", mentionAssistant: "@房間助理",
|
|
141
143
|
mentionAssistantHint: "Hub 提供",
|
|
142
144
|
allBar: "{0} 個 Agent 中 {1} 個在線上,{2} 個上線後回答",
|
|
@@ -13,6 +13,9 @@ import { RailFrame } from "/assets/side-rail.js";
|
|
|
13
13
|
import { Icon } from "/assets/ui-icons.js";
|
|
14
14
|
import { Empty } from "/assets/ui-states.js";
|
|
15
15
|
import { Dialog } from "/assets/ui-dialog.js";
|
|
16
|
+
import { Menu } from "/assets/ui-menu.js";
|
|
17
|
+
import { t } from "/assets/app-i18n.js";
|
|
18
|
+
import "./hub-strings.js";
|
|
16
19
|
import { firstCharacter } from "/assets/instance-nav.js";
|
|
17
20
|
import { hroom } from "./hub-room-strings.js";
|
|
18
21
|
import { RoomComposer } from "./hub-room-composer.js";
|
|
@@ -64,7 +67,7 @@ export const ANSWERS_SHOWN = 3, FOLD_FROM = 6;
|
|
|
64
67
|
* Seam-1 messages (newest last) → the thread's messages. `ids`: a Map from a message id to its number in this thread
|
|
65
68
|
* (the thread's keys and quotes are numbers), extended here in arrival order and kept by the caller.
|
|
66
69
|
*/
|
|
67
|
-
export function toThreadMessages(messages, { meId, ids, direct = false, expanded = new Set() }) {
|
|
70
|
+
export function toThreadMessages(messages, { meId, ids, direct = false, expanded = new Set(), summarise = false }) {
|
|
68
71
|
const out = [], byId = new Map(messages.map((m) => [m.id, m]));
|
|
69
72
|
// Each question's answers that have text, in arrival order: past ANSWERS_SHOWN they wait behind one 「展開其餘 N 則」.
|
|
70
73
|
const answersOf = new Map();
|
|
@@ -78,13 +81,13 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
78
81
|
if (m.answerTo && !m.text && (m.stage === "queued" || m.stage === "working")) continue;
|
|
79
82
|
// A question with FOLD_FROM answers or more shows its first ANSWERS_SHOWN; the rest wait behind one link right under the
|
|
80
83
|
// last one shown (until it is opened). Fewer than FOLD_FROM: every answer shows.
|
|
81
|
-
let foldAfter = null;
|
|
82
|
-
if (m.answerTo
|
|
84
|
+
let foldAfter = null, lastShown = false;
|
|
85
|
+
if (m.answerTo) {
|
|
83
86
|
const list = answersOf.get(m.answerTo) || [], at = list.indexOf(m.id);
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
const folded = !direct && !expanded.has(m.answerTo) && list.length >= FOLD_FROM;
|
|
88
|
+
if (folded && at >= ANSWERS_SHOWN) continue;
|
|
89
|
+
if (folded && at === ANSWERS_SHOWN - 1) foldAfter = { label: hroom("expandRest", String(list.length - ANSWERS_SHOWN)), arg: m.answerTo };
|
|
90
|
+
lastShown = at >= 0 && at === (folded ? ANSWERS_SHOWN - 1 : list.length - 1);
|
|
88
91
|
}
|
|
89
92
|
const id = num(m.id), mine = kind === "person" && author.id === meId;
|
|
90
93
|
if (kind === "system") { out.push({ boot: BOOT, id, role: "status", sender: "", ts: iso(m.at), text: systemText(m), bare: true }); continue; }
|
|
@@ -92,10 +95,14 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
92
95
|
const quoted = m.replyTo ? byId.get(m.replyTo) : m.answerTo ? byId.get(m.answerTo) : null;
|
|
93
96
|
const state = mine ? askState(m.ask) : null;
|
|
94
97
|
out.push({ boot: BOOT, id, role: kind === "person" ? "user" : "agent", sender: authorLine(author, mine, direct), ts: iso(m.at), text: String(m.text || ""), mine,
|
|
98
|
+
...(kind === "person" && !mine ? { person: true } : {}), // Lumen (spec §3): someone else's words, a bubble on the left
|
|
95
99
|
roomMessage: m.id, ...(state?.delivery ? { delivery: state.delivery } : {}),
|
|
96
100
|
...(quoted ? { replyTo: { boot: BOOT, id: num(quoted.id), sender: authorLine(quoted.author, quoted.author?.id === meId, direct), text: String(quoted.text || "").slice(0, 120) } } : {}),
|
|
97
101
|
...(m.stage === "not-answered" ? { text: hroom("noAnswer") } : {}) });
|
|
98
102
|
if (foldAfter) out.push({ boot: BOOT, id: num(`expand:${foldAfter.arg}`), role: "status", sender: "", text: "", bare: true, fold: true, action: foldAfter });
|
|
103
|
+
// Spec §10: once an @所有 Agent has answers, under the last one shown, 「請房間助理整理」 (it sends 「@房間助理 整理上面的回答」).
|
|
104
|
+
if (summarise && lastShown && byId.get(m.answerTo)?.mentions?.includes("all"))
|
|
105
|
+
out.push({ boot: BOOT, id: num(`summarise:${m.answerTo}`), role: "status", sender: "", text: "", bare: true, action: { label: hroom("askSummarise"), arg: `summarise:${m.answerTo}` } });
|
|
99
106
|
const line = askState(m.ask)?.line;
|
|
100
107
|
// Its status, not an event: under it, without a time of its own.
|
|
101
108
|
if (line) out.push({ boot: BOOT, id: id + 1, role: "status", sender: "", text: line, progressOf: m.id, bare: true });
|
|
@@ -115,8 +122,10 @@ export function createRoomStore(roomId, { client, meId = "" } = {}) {
|
|
|
115
122
|
const st = { live: true, detail: null, messages: [], loaded: false, error: null, removed: false, more: false, view: [] };
|
|
116
123
|
// The room's committed order (Ridge: `sequence`, from the stored row): a waiting answer replaced in place, or an event that
|
|
117
124
|
// arrives out of order, is drawn where the room has it. Rows without it (a direct chat, an older Hub) keep arrival order.
|
|
125
|
+
const closedNow = () => st.removed || st.detail?.room?.archived === true;
|
|
118
126
|
const ordered = () => { if (st.messages.length && st.messages.every((m) => Number.isSafeInteger(m.sequence))) st.messages.sort((a, b) => a.sequence - b.sequence); };
|
|
119
|
-
const changed = () => { ordered(); st.view = toThreadMessages(st.messages, { meId: st.detail?.me?.id || meId, ids, direct: st.detail?.room?.kind === "direct", expanded
|
|
127
|
+
const changed = () => { ordered(); st.view = toThreadMessages(st.messages, { meId: st.detail?.me?.id || meId, ids, direct: st.detail?.room?.kind === "direct", expanded,
|
|
128
|
+
summarise: st.detail?.room?.kind === "group" && (st.detail?.members || []).some((x) => x.kind === "assistant") && !closedNow() }); for (const fn of [...subs]) { try { fn(); } catch { /* a subscriber's own failure */ } } };
|
|
120
129
|
const upsert = (m) => {
|
|
121
130
|
if (!m || m.roomId !== roomId || typeof m.id !== "string") return;
|
|
122
131
|
const i = st.messages.findIndex((x) => x.id === m.id || (m.idempotencyKey && x.idempotencyKey === m.idempotencyKey));
|
|
@@ -146,7 +155,7 @@ export function createRoomStore(roomId, { client, meId = "" } = {}) {
|
|
|
146
155
|
return {
|
|
147
156
|
subscribe(fn) { subs.add(fn); return () => subs.delete(fn); },
|
|
148
157
|
detail: () => st.detail, raw: () => st.messages, messages: () => st.view, loaded: () => st.loaded, error: () => st.error,
|
|
149
|
-
closed:
|
|
158
|
+
closed: closedNow, removed: () => st.removed, more: () => st.more,
|
|
150
159
|
room: () => ({ ...(st.detail?.room || {}), ownerName: "" }),
|
|
151
160
|
async send(text, { mentions = [], replyTo } = {}) {
|
|
152
161
|
const idempotencyKey = (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`).replace(/[^A-Za-z0-9-]/g, "");
|
|
@@ -199,7 +208,7 @@ function useMembersPanel() {
|
|
|
199
208
|
* Fleet chat's thread (panel-hub.js's HubThread, given as `Thread`: the thread wiring is one), the room's composer, and
|
|
200
209
|
* the members panel on the right. `client`: the Hub client; `me`: { id } from the session.
|
|
201
210
|
*/
|
|
202
|
-
export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "", rooms = [], openRoom = () => {} }) {
|
|
211
|
+
export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "", rooms = [], openRoom = () => {}, goList = () => {}, onLeft = () => {} }) {
|
|
203
212
|
const store = useMemo(() => createRoomStore(roomId, { client, meId }), [roomId]);
|
|
204
213
|
useEffect(() => () => store.stop(), [store]);
|
|
205
214
|
const [, tick] = useState(0);
|
|
@@ -212,6 +221,15 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
212
221
|
// dev-claude2's room settings (hub-room-settings.js), opened from the header or the members panel.
|
|
213
222
|
const [settings, setSettings] = useState(null);
|
|
214
223
|
const openSettings = () => { import("./hub-room-settings.js").then((m) => { if (typeof m.RoomSettings === "function") setSettings(() => m.RoomSettings); }, () => {}); };
|
|
224
|
+
// Lumen (spec §3, §7): 「離開房間」 for everyone in a group room, through U2's leaveRoom (the last manager is told why not).
|
|
225
|
+
const [leaveError, setLeaveError] = useState("");
|
|
226
|
+
const leave = async () => {
|
|
227
|
+
setLeaveError("");
|
|
228
|
+
const m = await import("./hub-room-settings.js").catch(() => null);
|
|
229
|
+
if (typeof m?.leaveRoom !== "function") return;
|
|
230
|
+
const r = await m.leaveRoom(client, roomId, store.detail()?.me?.id || meId);
|
|
231
|
+
if (r.ok) onLeft(); else setLeaveError(r.text);
|
|
232
|
+
};
|
|
215
233
|
const detail = store.detail(), room = detail?.room || listed || {}, group = room.kind === "group";
|
|
216
234
|
// The Hub assistant's one-to-one is named by its flag, in this viewer's words (its stored name is a fallback).
|
|
217
235
|
const title = room.assistant ? hroom("hubAssistant") : String(room.name || "");
|
|
@@ -224,7 +242,9 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
224
242
|
const labels = () => [hroom("mentionAll"), hroom("mentionAssistant"), ...(store.detail()?.members || []).filter((m) => m.kind !== "assistant").map((m) => `@${m.name}`)];
|
|
225
243
|
const extra = {
|
|
226
244
|
isUser: (x) => x.mine === true, canReply: () => !store.closed(),
|
|
227
|
-
mentionLabels: labels,
|
|
245
|
+
mentionLabels: labels,
|
|
246
|
+
// A line's one action: 「展開其餘 N 則」, or 「請房間助理整理」 (spec §10: the same as sending 「@房間助理 整理上面的回答」).
|
|
247
|
+
statusAction: (arg) => { if (String(arg).startsWith("summarise:")) { if (!store.closed()) void store.send(hroom("summarisePrompt"), { mentions: ["assistant"] }); } else store.expand(arg); },
|
|
228
248
|
startReply: (x) => { setReply(x); setTimeout(() => input.current?.focus(), 0); },
|
|
229
249
|
findQuoted: async () => { await store.older(); return false; },
|
|
230
250
|
};
|
|
@@ -241,13 +261,19 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
241
261
|
return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId}>
|
|
242
262
|
<section class="hub-chat-main">
|
|
243
263
|
<header class="hub-chat-head" data-trust="panel-content">
|
|
264
|
+
${/* Lumen (spec §2): on a phone the header starts with the Fleet chat's back to the list. */ ""}
|
|
265
|
+
<a class="icon-btn hub-back only-narrow" href="/ui/hub" aria-label=${t("hub.back")} title=${t("hub.back")}
|
|
266
|
+
onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); goList(); }}><${Icon} name="back" /></a>
|
|
244
267
|
<span class=${`av${group ? " av-square" : ""}`} aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>
|
|
245
268
|
<span class="hub-chat-title"><strong>${title}</strong><span class="s">${line2}</span></span>
|
|
246
269
|
${group && Panel ? html`<button type="button" class="icon-btn hub-room-rail-toggle" aria-pressed=${(wide ? rail : sheet) ? "true" : "false"} title=${hroom("members")} aria-label=${hroom("members")}
|
|
247
270
|
onClick=${() => (wide ? setRail(!rail) : setSheet(true))}><${Icon} name="team" size=${18} /></button>` : null}
|
|
248
|
-
${group && detail?.me
|
|
249
|
-
|
|
271
|
+
${group && detail?.me ? html`<${Menu} cls="hub-room-menu" label=${hroom("menu")} fit=${true} ownerKey=${roomId} items=${[
|
|
272
|
+
detail.me.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
|
|
273
|
+
{ key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } },
|
|
274
|
+
].filter(Boolean)} />` : null}
|
|
250
275
|
</header>
|
|
276
|
+
${leaveError ? html`<p class="err hub-room-leave-err" role="alert">${leaveError}</p>` : null}
|
|
251
277
|
<${Thread} store=${store} name=${title} panelKey=${`hub-room:${roomId}`} threadRef=${threadRef} extra=${extra}
|
|
252
278
|
emptyView=${room.assistant ? html`<div class="hub-assistant-empty"><${Empty} icon="bot" title=${hroom("hubAssistant")} hint=${hroom("hubAssistantEmpty")} /></div>`
|
|
253
279
|
: group ? html`<p class="note">${hroom("composerHint")}</p>` : null} />
|
package/dist/ui/hub-strings.js
CHANGED
|
@@ -17,6 +17,7 @@ register("hub", {
|
|
|
17
17
|
// The Hub workspace (S3b): sign-in, Ask, My shared agents, Administration
|
|
18
18
|
signedOutHub: "Not signed in", signOut: "Sign out", signInTitle: "Sign in to the Hub",
|
|
19
19
|
signInLead: "Use your company account. Your password goes to the directory only and is never kept.",
|
|
20
|
+
signInPreview: "This Hub is a preview. Its screens and features may still change.",
|
|
20
21
|
login: "Account", password: "Password", signIn: "Sign in",
|
|
21
22
|
errSignIn: "That account and password didn't work.", errDirectory: "The directory can't be reached right now. Try again later.",
|
|
22
23
|
errBusyHub: "Too many requests just now. Wait a moment and try again.", errConflictHub: "This changed meanwhile. It has been reloaded; check it and try again.",
|
|
@@ -91,6 +92,7 @@ register("hub", {
|
|
|
91
92
|
adminTitle: "管理",
|
|
92
93
|
signedOutHub: "尚未登入", signOut: "登出", signInTitle: "登入 Hub",
|
|
93
94
|
signInLead: "請使用公司帳號登入。密碼只送給目錄服務驗證,不會被保存。",
|
|
95
|
+
signInPreview: "這個 Hub 是預覽版,畫面與功能可能還會變動。",
|
|
94
96
|
login: "帳號", password: "密碼", signIn: "登入",
|
|
95
97
|
errSignIn: "帳號或密碼不正確。", errDirectory: "目前無法連到目錄服務,請稍後再試。",
|
|
96
98
|
errBusyHub: "請求太頻繁,請稍候再試。", errConflictHub: "這個項目剛剛有變更,已重新載入,請確認後再試一次。",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { register, t } from "/assets/app-i18n.js";
|
|
2
|
+
register("hubTeam", {
|
|
3
|
+
en: {
|
|
4
|
+
title: "Teams", mine: "My teams", manage: "Manage teams", lead: "AD groups stop at departments. A team is a list you pick, usable for rooms and for who may ask.",
|
|
5
|
+
pageLead: "Pick the people in each team. Rooms keep the people added at that moment; asking permissions and room-creation rights follow the current roster.",
|
|
6
|
+
myLead: "Manage the members of the teams you lead. A Hub administrator manages the name, department and lead.",
|
|
7
|
+
create: "New team", edit: "Edit {0}", empty: "No teams yet.", noMine: "You do not lead any teams.", loading: "Loading teams…", retry: "Try again", refresh: "Refresh", back: "All teams",
|
|
8
|
+
name: "Team name", department: "Department", departmentLine: "Department: {0}", chooseDepartment: "Choose a department", departmentQuery: "Search AD departments", leadPerson: "Lead", chooseLead: "Choose a lead",
|
|
9
|
+
members: "Members", role: "Role", roleLead: "Lead", roleMember: "Member", signedIn: "Joined Hub", agents: "Shared agents", yes: "Yes", notYet: "Not yet", unobserved: "Not checked yet", none: "None",
|
|
10
|
+
add: "Add member", remove: "Remove", search: "Search", personQuery: "Search everyone by name", searchHint: "Type 2 to 64 characters. People in any department can be selected.", groupHint: "Type 2 to 64 characters of the department name.",
|
|
11
|
+
searching: "Searching…", noMatches: "No matches. Try more of the name.", choose: "Choose {0}", pick: "Choose", cancel: "Cancel", change: "Change", save: "Save", saving: "Saving…", saved: "Saved.", unsaved: "Unsaved changes",
|
|
12
|
+
limit: "Up to 200 members, including the lead.", count: "{0} members", leadRequired: "The lead is always a member. Choose another lead before removing this person.",
|
|
13
|
+
disabledLead: "The lead's directory account is disabled. Choose a new lead.",
|
|
14
|
+
failed: "Teams could not be loaded. Try again.", searchFailed: "The directory could not be searched. Try again.", busy: "The Hub is busy. Try again shortly.", denied: "Your access changed. Refresh to check the current team.", saveFailed: "Your changes could not be saved. They are still here; refresh if someone else changed the team.",
|
|
15
|
+
delete: "Delete team", deleteTitle: "Delete {0}?", deleteLead: "These team-based permissions will stop applying. Existing room members and agents already accepted into rooms stay.", noImpact: "No active team grants or room-creation entry.", creators: "May create rooms", grantExpiry: "May ask {0} · until {1}",
|
|
16
|
+
styleLoading: "Loading the team editor…", styleFailed: "The team editor could not be loaded. Try again.",
|
|
17
|
+
},
|
|
18
|
+
"zh-TW": {
|
|
19
|
+
title: "團隊", mine: "我的團隊", manage: "管理團隊", lead: "AD 群組只到部門。團隊是你自己挑的一份名單,可以用在房間與提問權限。",
|
|
20
|
+
pageLead: "選擇各團隊的成員。加入房間時會保留當下的名單;提問權限與建立房間的權限則依團隊目前的成員判斷。",
|
|
21
|
+
myLead: "管理你負責的團隊成員。名稱、所屬部門與負責人由 Hub 管理員設定。",
|
|
22
|
+
create: "新增團隊", edit: "編輯 {0}", empty: "還沒有團隊。", noMine: "你目前沒有負責的團隊。", loading: "正在讀取團隊…", retry: "再試一次", refresh: "重新整理", back: "所有團隊",
|
|
23
|
+
name: "團隊名稱", department: "所屬部門", departmentLine: "所屬部門:{0}", chooseDepartment: "選擇部門", departmentQuery: "搜尋 AD 部門", leadPerson: "負責人", chooseLead: "選擇負責人",
|
|
24
|
+
members: "成員", role: "身分", roleLead: "負責人", roleMember: "成員", signedIn: "已加入 Hub", agents: "分享的 Agent", yes: "已加入", notYet: "尚未加入", unobserved: "尚未確認", none: "無",
|
|
25
|
+
add: "加入成員", remove: "移除", search: "搜尋", personQuery: "輸入姓名搜尋所有人", searchHint: "請輸入 2 到 64 個字,可以選擇其他部門的同仁。", groupHint: "請輸入部門名稱的 2 到 64 個字。",
|
|
26
|
+
searching: "搜尋中…", noMatches: "找不到符合的對象,請多輸入幾個姓名的字。", choose: "選擇 {0}", pick: "選擇", cancel: "取消", change: "變更", save: "儲存", saving: "儲存中…", saved: "已儲存。", unsaved: "尚未儲存",
|
|
27
|
+
limit: "最多 200 位成員,包含負責人。", count: "{0} 位成員", leadRequired: "負責人一定是成員,請先指定另一位負責人才能移除。",
|
|
28
|
+
disabledLead: "負責人的帳號已停用,請指定新的負責人。",
|
|
29
|
+
failed: "無法讀取團隊,請再試一次。", searchFailed: "目前無法搜尋目錄,請再試一次。", busy: "Hub 目前忙碌,請稍後再試。", denied: "你的權限已變更,請重新整理確認目前的團隊。", saveFailed: "無法儲存變更,編輯內容仍保留;若團隊已被其他人變更,請重新整理。",
|
|
30
|
+
delete: "刪除團隊", deleteTitle: "刪除「{0}」?", deleteLead: "以下以團隊授予的權限將停止適用。已加入房間的成員與已同意加入的 Agent 都會保留。", noImpact: "沒有有效的團隊授權或建立房間權限。", creators: "可以建立房間", grantExpiry: "可以問 {0} · 到 {1}",
|
|
31
|
+
styleLoading: "正在載入團隊編輯器…", styleFailed: "無法載入團隊編輯器,請再試一次。",
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
export const ht = (key, ...args) => t(`hubTeam.${key}`, ...args);
|