@songsid/agend 2.4.0-beta.37 → 2.4.0-beta.39
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/agent-workspace.js +5 -4
- package/dist/agent-workspace.js.map +1 -1
- package/dist/auth-api.js +2 -0
- package/dist/auth-api.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/fleet-manager.d.ts +15 -0
- package/dist/fleet-manager.js +38 -5
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/admin/SKILL.md +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +50 -50
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +4 -0
- package/dist/hub/directory/directory.js +2 -2
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/init/text.js +11 -11
- package/dist/hub/init/text.js.map +1 -1
- package/dist/hub/mcp/catalog.js +1 -1
- package/dist/hub/mcp/catalog.js.map +1 -1
- package/dist/hub/mcp/server.js +1 -1
- package/dist/hub/mcp/server.js.map +1 -1
- package/dist/locale.js +6 -6
- package/dist/locale.js.map +1 -1
- package/dist/office-share-page.js +1 -1
- package/dist/office-share-page.js.map +1 -1
- package/dist/runtime-personal-answer-only.js +1 -1
- package/dist/runtime-personal-answer-only.js.map +1 -1
- package/dist/runtime-transcript-delta-reader.js +6 -1
- package/dist/runtime-transcript-delta-reader.js.map +1 -1
- package/dist/tmux-rollback.js +21 -23
- package/dist/tmux-rollback.js.map +1 -1
- package/dist/tmux-server.d.ts +2 -0
- package/dist/tmux-server.js +31 -13
- package/dist/tmux-server.js.map +1 -1
- package/dist/ui/hub-admin-overview.js +2 -2
- package/dist/ui/hub-agent-intro.js +2 -2
- package/dist/ui/hub-ai-apps-strings.js +1 -1
- package/dist/ui/hub-chat-strings.js +2 -2
- package/dist/ui/hub-client.js +18 -5
- package/dist/ui/hub-company-join-strings.js +31 -31
- package/dist/ui/hub-company-join.js +2 -2
- package/dist/ui/hub-enrolment-code-strings.js +10 -10
- package/dist/ui/hub-grant-picker.js +3 -3
- package/dist/ui/hub-group-strings.js +2 -2
- package/dist/ui/hub-join-one-strings.js +12 -12
- package/dist/ui/hub-join-steps.js +10 -10
- package/dist/ui/hub-my-agents-strings.js +3 -3
- package/dist/ui/hub-personal-agent-strings.js +6 -6
- package/dist/ui/hub-roles-strings.js +1 -1
- package/dist/ui/hub-room-composer.js +21 -1
- package/dist/ui/hub-room-owner-requests-strings.js +2 -2
- package/dist/ui/hub-room-thread.js +116 -9
- package/dist/ui/hub-strings.js +4 -4
- package/dist/ui/hub-subject-picker.js +1 -1
- package/dist/ui/hub-teams-strings.js +1 -1
- package/dist/ui/settings-access-overview.js +104 -25
- package/dist/ui/settings-hub-member-address.js +6 -6
- package/dist/ui/settings-hub-web-address.js +6 -6
- package/dist/ui/settings-registry.js +1 -1
- package/dist/ui/shared/access-overview.css +6 -0
- package/dist/ui/shared/app-shell.js +7 -7
- package/dist/ui/shared/app.css +24 -3
- package/dist/ui/shared/info-tip.js +33 -8
- package/dist/ui/shared/update-card-ui.js +72 -25
- package/dist/ui/shared/usage-agents.js +99 -0
- package/dist/ui/shared/usage-dialog.js +15 -18
- package/dist/ui/shared/view-strings.js +1 -1
- package/dist/ui/workspace-diff-path.d.ts +1 -0
- package/dist/ui/workspace-diff-path.js +22 -0
- package/dist/ui/workspace-panel.js +4 -3
- package/dist/update-readiness-host.js +6 -2
- package/dist/update-readiness-host.js.map +1 -1
- package/dist/update-readiness.js +15 -2
- package/dist/update-readiness.js.map +1 -1
- package/dist/usage/providers.d.ts +4 -0
- package/dist/usage/providers.js +9 -2
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.js +3 -2
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/web-api.js +2 -1
- package/dist/web-api.js.map +1 -1
- package/package.json +1 -1
|
@@ -53,7 +53,7 @@ register("hubGroups", {
|
|
|
53
53
|
deniedPerson: "Your Hub administrator has excluded your account from this.", suspended: "Paused by your Hub administrator.",
|
|
54
54
|
publishNot: "Sharing agents is not included in your access.",
|
|
55
55
|
// M-3190: the chat launcher's frame and 我的 Agent → My fleets
|
|
56
|
-
readyBanner: "Your Hub is ready: create a pairing code to invite
|
|
56
|
+
readyBanner: "Your Hub is ready: create a pairing code to invite members, or set up the room assistant →", readyGo: "Open Administration", readyDismiss: "Dismiss",
|
|
57
57
|
footFleets: "{0} fleets connected ({1})", listSep: ", ", footManage: "Manage in My agents →", footNone: "Want to share agents from your own AgEnD?", footConnect: "Connect a fleet in My agents →",
|
|
58
58
|
fleetsTitle: "My fleets", connectCount: "{0} of {1}", fleetMenu: "Fleet {0}", connectAnother: "+ Connect another fleet",
|
|
59
59
|
copy: "Copy", copied: "Copied", copyFailed: "Copy failed. Select the address and copy it.",
|
|
@@ -101,7 +101,7 @@ register("hubGroups", {
|
|
|
101
101
|
unknown: "目錄沒有回應,現在無法確認。", retry: "重試", ineligible: "你的目錄帳號目前無法使用這個功能。",
|
|
102
102
|
deniedPerson: "Hub 管理員已將你的帳號排除在外。", suspended: "已被 Hub 管理員暫停。",
|
|
103
103
|
publishNot: "你的存取權不包含分享 Agent。",
|
|
104
|
-
readyBanner: "Hub
|
|
104
|
+
readyBanner: "Hub 已就緒:產生配對碼邀請成員加入,或設定房間助理 →", readyGo: "前往「管理」", readyDismiss: "關閉",
|
|
105
105
|
footFleets: "已連接 {0} 個 Fleet({1})", listSep: "、", footManage: "前往「我的 Agent」管理 →", footNone: "要用自己的 AgEnD 分享 Agent?", footConnect: "前往「我的 Agent」連接 Fleet →",
|
|
106
106
|
fleetsTitle: "我的 Fleet", connectCount: "{0} / {1}", fleetMenu: "Fleet {0}", connectAnother: "+ 連接另一個 Fleet",
|
|
107
107
|
copy: "複製", copied: "已複製", copyFailed: "複製失敗。請選取位址再複製。",
|
|
@@ -7,19 +7,19 @@ import { register, t } from "/assets/app-i18n.js";
|
|
|
7
7
|
export const joinOneStringsV1 = true;
|
|
8
8
|
register("joinOne", {
|
|
9
9
|
en: {
|
|
10
|
-
input: "Hub address", placeholder: "hub.example.com", go: "Sign in with
|
|
10
|
+
input: "Hub address", placeholder: "hub.example.com", go: "Sign in with organization account", other: "Other ways",
|
|
11
11
|
otherPairing: "This looks like a pairing code. Use it below.",
|
|
12
12
|
found: "Found “{0}”. This Fleet will appear as “{1}”.", rename: "Rename", label: "Fleet name (optional)",
|
|
13
13
|
probing: "Looking up the Hub…",
|
|
14
14
|
E1: "That is not a Hub address. Enter one like hub.example.com.",
|
|
15
15
|
E2: "A Hub address must use https.",
|
|
16
|
-
E3: "{0} cannot be reached. Check the address and that this computer is on
|
|
16
|
+
E3: "{0} cannot be reached. Check the address and that this computer is on your organization's network.",
|
|
17
17
|
E4: "This computer does not trust {0}'s certificate, so nothing was connected. Check the address or certificate with your Hub administrator.",
|
|
18
18
|
E5: "{0} is not an AgEnD Hub.",
|
|
19
|
-
E6: "“{0}” does not accept
|
|
19
|
+
E6: "“{0}” does not accept organization-account connections yet. Ask its administrator to turn them on.",
|
|
20
20
|
E7: "The Hub and this Fleet need different host names. A different port is not enough.",
|
|
21
21
|
E8: "“{0}” presents a different identity than before, so nothing was connected. Confirm with your Hub administrator, then choose Replace saved Hub identity.",
|
|
22
|
-
E9: "Your
|
|
22
|
+
E9: "Your organization account may not connect a Fleet. Ask your Hub administrator.",
|
|
23
23
|
E10: "You have reached the limit of connected Fleets. Revoke one on the Hub first.",
|
|
24
24
|
E11: "The Hub is handling other connections and will retry shortly.",
|
|
25
25
|
E12: "This attempt timed out and nothing was created. Press again.",
|
|
@@ -27,26 +27,26 @@ register("joinOne", {
|
|
|
27
27
|
E14: "The result could not be confirmed. Choose Check again; do not start again.",
|
|
28
28
|
limited: "Too many lookups. Wait a minute, then try again.",
|
|
29
29
|
opened: "Opened the sign-in tab for {0}…", left: "{0} left", reopen: "Reopen tab", cancel: "Cancel",
|
|
30
|
-
ownerLine: "Connected with {0}'s
|
|
30
|
+
ownerLine: "Connected with {0}'s organization account · This Fleet is called “{1}”",
|
|
31
31
|
reconnect: "Reconnect", remove: "Remove this connection",
|
|
32
|
-
revokedHint: "The Hub ended this Fleet's connection, for example after it moved the address Fleets connect to. Reconnect signs in again with your
|
|
32
|
+
revokedHint: "The Hub ended this Fleet's connection, for example after it moved the address Fleets connect to. Reconnect signs in again with your organization account; nothing else is needed.",
|
|
33
33
|
removeAsk: "Remove the connection to “{0}”? Agents you share will stop answering.", removeYes: "Remove", removeNo: "Keep",
|
|
34
34
|
removed: "The connection was removed.",
|
|
35
35
|
},
|
|
36
36
|
"zh-TW": {
|
|
37
|
-
input: "Hub 位址", placeholder: "hub.example.com", go: "
|
|
37
|
+
input: "Hub 位址", placeholder: "hub.example.com", go: "以組織帳號登入", other: "其他方式",
|
|
38
38
|
otherPairing: "這看起來是配對碼,請在下方使用。",
|
|
39
39
|
found: "找到「{0}」。這台 Fleet 會顯示為「{1}」", rename: "改名", label: "Fleet 名稱(選填)",
|
|
40
40
|
probing: "正在查詢 Hub…",
|
|
41
41
|
E1: "這不是 Hub 位址。請輸入像 hub.example.com 的位址。",
|
|
42
42
|
E2: "Hub 位址必須是 https。",
|
|
43
|
-
E3: "連不上 {0}
|
|
43
|
+
E3: "連不上 {0}。請確認位址,以及這台電腦連得到組織的網路。",
|
|
44
44
|
E4: "{0} 的憑證不受這台電腦信任,所以沒有連接。請向 Hub 管理員確認位址或憑證。",
|
|
45
45
|
E5: "{0} 不是 AgEnD Hub。",
|
|
46
|
-
E6: "「{0}
|
|
46
|
+
E6: "「{0}」還沒開放用組織帳號連接。請 Hub 管理員開啟。",
|
|
47
47
|
E7: "Hub 和這台 Fleet 的網址要用不同的主機名稱。只換連接埠不行。",
|
|
48
48
|
E8: "「{0}」的身分和上次不同,所以沒有連接。請向 Hub 管理員確認後,再選「更換已儲存的 Hub 身分」。",
|
|
49
|
-
E9: "
|
|
49
|
+
E9: "你的組織帳號沒有連接 Fleet 的權限。請找 Hub 管理員。",
|
|
50
50
|
E10: "你連接的 Fleet 已達上限。請先在 Hub 撤銷一台。",
|
|
51
51
|
E11: "Hub 正在處理其他連接,稍後會自動再試。",
|
|
52
52
|
E12: "這次連接逾時了,沒有建立任何東西。請再按一次。",
|
|
@@ -54,9 +54,9 @@ register("joinOne", {
|
|
|
54
54
|
E14: "無法確認結果。請按「再次檢查」,不要重新開始。",
|
|
55
55
|
limited: "查詢太多次了。請等一分鐘再試。",
|
|
56
56
|
opened: "已開啟 {0} 的登入分頁…", left: "剩 {0}", reopen: "重新開啟分頁", cancel: "取消",
|
|
57
|
-
ownerLine: "以 {0}
|
|
57
|
+
ownerLine: "以 {0} 的組織帳號連接 · 這台 Fleet 叫「{1}」",
|
|
58
58
|
reconnect: "重新連接", remove: "移除這個連接",
|
|
59
|
-
revokedHint: "Hub 結束了這個 Fleet 的連接,例如它變更了 Fleet
|
|
59
|
+
revokedHint: "Hub 結束了這個 Fleet 的連接,例如它變更了 Fleet 連接位址之後。按「重新連接」以組織帳號再次登入即可,不需要其他步驟。",
|
|
60
60
|
removeAsk: "要移除與「{0}」的連接嗎?你分享的 Agent 會停止回答。", removeYes: "移除", removeNo: "保留",
|
|
61
61
|
removed: "已移除連接。",
|
|
62
62
|
},
|
|
@@ -21,13 +21,13 @@ import { pasteText } from "./hub-people-paste.js";
|
|
|
21
21
|
export const joinStepsV1 = true;
|
|
22
22
|
register("hubJoinSteps", {
|
|
23
23
|
en: {
|
|
24
|
-
step3: "Tell
|
|
24
|
+
step3: "Tell members how to join", sentence: "In AgEnD, open Settings → Hub, enter {0}, then sign in with the organization account.",
|
|
25
25
|
// M-3190: 我分享的 Agent → My fleets — the same step, its address in a copyable chip under this line.
|
|
26
|
-
pasteLead: "In AgEnD, open Settings → Hub, paste this address, then sign in with the
|
|
26
|
+
pasteLead: "In AgEnD, open Settings → Hub, paste this address, then sign in with the organization account:",
|
|
27
27
|
copy: "Copy these instructions", copied: "Copied", copyFailed: "Copy failed. Select the sentence and copy it.",
|
|
28
28
|
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",
|
|
29
|
-
title: "Let
|
|
30
|
-
step1: "Let
|
|
29
|
+
title: "Let members join", lead: "Three steps. Each one is checked against what the Hub has saved.", done: "Done",
|
|
30
|
+
step1: "Let members connect Fleets with their organization account", step1Switch: "Allow organization-account Fleet connections",
|
|
31
31
|
step2: "Who can join", step2Hint: "Add an AD group, team or person who may connect a Fleet, then save.",
|
|
32
32
|
step2Code: "A live join code counts too.", byDn: "Add by distinguished name", dnLabel: "Distinguished name", dnAdd: "Add",
|
|
33
33
|
perPerson: "Each person up to", fleetsUnit: "Fleets", capAsk: "Chat with agents", capPublish: "Share agents", remove: "Remove",
|
|
@@ -37,16 +37,16 @@ register("hubJoinSteps", {
|
|
|
37
37
|
stale: "The check is out of date. It has been run again; look at it and save again.", failed: "Could not save. Try again.",
|
|
38
38
|
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.",
|
|
39
39
|
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.",
|
|
40
|
-
groupsPage: "All group permissions", advanced: "Link with key fingerprint (Advanced)", advancedHint: "Only for a
|
|
40
|
+
groupsPage: "All group permissions", advanced: "Link with key fingerprint (Advanced)", advancedHint: "Only for a member who must check the key fingerprint by hand.",
|
|
41
41
|
exceptions: "Individual invitations", otherWays: "Other ways",
|
|
42
42
|
},
|
|
43
43
|
"zh-TW": {
|
|
44
|
-
step3: "
|
|
45
|
-
pasteLead: "在 AgEnD 的「設定 → Hub
|
|
44
|
+
step3: "告訴成員怎麼加入", sentence: "在 AgEnD 的「設定 → Hub」輸入 {0},再用組織帳號登入。",
|
|
45
|
+
pasteLead: "在 AgEnD 的「設定 → Hub」貼上這個位址,再用組織帳號登入:",
|
|
46
46
|
copy: "複製這段說明", copied: "已複製", copyFailed: "複製失敗。請選取這段說明再複製。",
|
|
47
47
|
step3Off: "請先完成步驟 1 和 2。", reading: "正在確認 Hub 已儲存的設定…", readFailed: "目前無法更新 Hub 設定,請再試一次。", retry: "再試一次",
|
|
48
|
-
title: "
|
|
49
|
-
step1: "
|
|
48
|
+
title: "讓成員加入", lead: "三個步驟,每一步都依 Hub 已儲存的設定判斷是否完成。", done: "已完成",
|
|
49
|
+
step1: "允許成員用組織帳號連接 Fleet", step1Switch: "允許以組織帳號連接 Fleet",
|
|
50
50
|
step2: "誰可以加入", step2Hint: "加入可以連接 Fleet 的 AD 群組、團隊或人員,然後儲存。",
|
|
51
51
|
step2Code: "有效的加入碼也算完成。", byDn: "用辨別名稱新增", dnLabel: "辨別名稱", dnAdd: "新增",
|
|
52
52
|
perPerson: "每人最多", fleetsUnit: "台", capAsk: "和 Agent 對話", capPublish: "分享 Agent", remove: "移除",
|
|
@@ -56,7 +56,7 @@ register("hubJoinSteps", {
|
|
|
56
56
|
stale: "檢查結果已過期,已重新檢查。請看過後再儲存一次。", failed: "無法儲存,請再試一次。",
|
|
57
57
|
unsupported: "這個目錄無法列出群組來設定權限:需要 Active Directory 並使用 LDAPS。請在「管理」按「編輯 AD 連線」檢查,或改用個別邀請。", repair: "已儲存的權限需要在「群組權限」頁修復。",
|
|
58
58
|
duplicate: "這個群組已經在清單裡。", notFound: "找不到這個群組。", notSecurity: "這不是安全性群組。", invalidDn: "這不是辨別名稱。", unknownGroup: "目前無法確認這個群組,請再試一次。",
|
|
59
|
-
groupsPage: "所有群組權限", advanced: "含金鑰指紋的連結(進階)", advancedHint: "
|
|
59
|
+
groupsPage: "所有群組權限", advanced: "含金鑰指紋的連結(進階)", advancedHint: "只給需要自己核對金鑰指紋的成員。",
|
|
60
60
|
exceptions: "個別邀請", otherWays: "其他方式",
|
|
61
61
|
},
|
|
62
62
|
});
|
|
@@ -6,15 +6,15 @@ register("hubMyAgents", {
|
|
|
6
6
|
lapsed:"Its backend or folder changed since you shared it, so Hub questions are refused until you share it again. The people who may ask it stay.", shareAgain:"Share again", needsReshare:"Needs re-share", kept:"(kept)",
|
|
7
7
|
shared:"Shared", nobody:"nobody may ask yet", setWho:"Choose who may ask", pictureDiscLarge:"Its avatar is too large for the Hub (limit 64 KB). On your Fleet, pick a smaller picture, or a PNG that AgEnD can shrink, in this agent's View → Edit profile → Avatar.", picturePortraitLarge:"Its identity-card portrait is too large for the Hub (limit 512 KB, including its avatar). On your Fleet, pick a smaller picture, or a PNG that AgEnD can shrink, in this agent's View → Edit profile → Identity card → Portrait.", pictureCharacterLarge:"Its own character from your office's skin pack is too large for the Hub (limit 512 KB with its avatar and portrait), so room offices draw it as the plain figure. In that pack, give it a smaller set: fewer or smaller frames.", peopleOne:"1 person may ask", people:"{0} people may ask", subjects:"{0} people, groups or teams may ask", paused:"Paused", sharing:"Sharing…", stopping:"Stopping…", uncertain:"Not confirmed yet: this Fleet hasn't answered. Refresh to check.", refused:"Not shared: {0}", changed:"This list changed. It has been refreshed; tick again.",
|
|
8
8
|
shareOne:"Share 1 agent", stopOne:"Stop sharing 1 agent", stopTitleOne:"Stop sharing 1 agent?", accessTitleOne:"1 agent is shared. Who may ask it?", share:"Share {0} agents", stop:"Stop sharing {0} agents", mixed:"Share {0} · Stop sharing {1}", apply:"Apply changes", cancel:"Cancel", stopTitle:"Stop sharing {0} agents?", stopBody:"People will no longer be able to ask: {0}. Their lists of who may ask are cleared.", stopHint:"To keep the lists and only stop answers for now, pause sharing instead.", stopGo:"Stop sharing", pause:"Pause instead", pauseOne:"Pause sharing", later:"Decide later", accessTitle:"{0} agents are shared. Who may ask them?", accessLead:"Nobody can ask them until you choose.", same:"The same people for all {0}", each:"Choose for each agent", choose:"Choose who may ask", previousMixed:"Use the list it had before", previous:"Use the list it had before ({0} people)", used:"The previous list is saved.", saved:"Saved", saveFailed:"Could not save access for {0}. Check the current agent and try again.", personal:"On my own computer", details:"Open {0}",
|
|
9
|
-
empty:"You don't have an agent on this Hub yet.", already:"You can already ask other people's agents: open Chats, or @mention an agent in a room.", emptyLead:"To have an agent of your own that
|
|
9
|
+
empty:"You don't have an agent on this Hub yet.", already:"You can already ask other people's agents: open Chats, or @mention an agent in a room.", emptyLead:"To have an agent of your own that members can ask:", personalOff:"Personal agents are turned off on this Hub. Ask your Hub administrator.", fleetLead:"If you run AgEnD, share the agents in it.", connectDenied:"Ask your Hub administrator to let you connect a Fleet.", apps:"Your own Claude Code or Codex can also use this Hub for you. That is for asking and posting as you. Members can't ask it.", appsLink:"My AI apps", failed:"The list could not be read. Refresh to try again.",
|
|
10
10
|
},
|
|
11
11
|
"zh-TW": {
|
|
12
12
|
offlineShort:"離線 · 最後上線 {0}", knownShared:"已分享 {0}", oldCountOne:"有 1 個 Fleet 需要更新,才能從這裡分享 Agent。", oldCount:"有 {0} 個 Fleet 需要更新,才能從這裡分享 Agent。", namesMore:"{0} 等 {1} 個", lead:"可以分享到這個 Hub 的 Agent,以及誰可以向它們提問。", refresh:"重新整理", refreshing:"確認中…", fleet:"Fleet", connected:"已連接", offline:"這個 Fleet 目前離線,顯示的是 {0} 的狀態。", count:"已分享 {0} / {1}", select:"全選", general:"你的 Fleet 的 General,可以管理這個 Fleet。", classic:"ClassicBot 房間", classicHint:"Hub 的提問與回答不會貼到它的 Discord 或 Telegram 房間,房間的聊天也不會複製到 Hub。但它是同一個 Agent、同一份記憶:在這裡回答時,可能用到它在房間裡得知的內容。",
|
|
13
13
|
old:"請更新這個 Fleet,才能從這裡分享 Agent。", update:"更新這個 Fleet", updateHint:"請到那台電腦的「設定 → Hub」,確認連接狀態與版本。", off:"這個 Fleet 的「設定 → Hub」關閉了從 Hub 頁面分享。", denied:"Hub 管理員還沒有允許你分享 Agent。", unknown:"Hub 目前無法確認是否允許分享,請重新整理確認。", remote:"這種 Agent 還不能回答 Hub 的提問。", unavailable:"這個 Agent 目前無法回答 Hub 的提問。", limit:"這個 Fleet 已經分享 64 個 Agent,達到上限。", suspended:"這個 Fleet 在這個 Hub 已暫停。", revoked:"這個 Fleet 已從這個 Hub 移除。",
|
|
14
14
|
lapsed:"分享之後它的後端或資料夾換了,重新分享之前 Hub 的提問都會被拒絕。可以提問的人會保留。", shareAgain:"重新分享", needsReshare:"需要重新分享", kept:"(會保留)",
|
|
15
15
|
shared:"分享中", nobody:"還沒有人可以問", setWho:"設定誰可以問", pictureDiscLarge:"它的頭像太大,Hub 無法顯示(上限 64 KB)。請在你的 Fleet 上,於這個 Agent 的「檢視 → 編輯個人資料 → 頭像」換一張較小的圖片,或改用 AgEnD 能自動縮小的 PNG。", picturePortraitLarge:"它的身分卡肖像太大,Hub 無法顯示(上限 512 KB,含頭像)。請在你的 Fleet 上,於這個 Agent 的「檢視 → 編輯個人資料 → 身分卡 → 肖像」換一張較小的圖片,或改用 AgEnD 能自動縮小的 PNG。", pictureCharacterLarge:"它在你辦公室外觀包裡的專屬角色太大,Hub 無法顯示(上限 512 KB,含頭像與肖像),房間辦公室會改用一般人物。請在那個外觀包裡給它較小的角色:較少或較小的影格。", peopleOne:"1 人可以提問", people:"{0} 人可以提問", subjects:"{0} 個人員、群組或團隊可以提問", paused:"已暫停", sharing:"分享中…", stopping:"停止中…", uncertain:"還沒有確認:這個 Fleet 尚未回應,請重新整理確認。", refused:"沒有分享:{0}", changed:"清單已有變動並重新整理,請重新勾選。",
|
|
16
|
-
shareOne:"分享 1 個 Agent", stopOne:"停止分享 1 個 Agent", stopTitleOne:"要停止分享 1 個 Agent 嗎?", accessTitleOne:"已分享 1 個 Agent。誰可以問它?", share:"分享 {0} 個 Agent", stop:"停止分享 {0} 個 Agent", mixed:"分享 {0} 個 · 停止分享 {1} 個", apply:"套用變更", cancel:"取消", stopTitle:"要停止分享 {0} 個 Agent 嗎?", stopBody:"
|
|
17
|
-
empty:"你在這個 Hub 還沒有自己的 Agent。", already:"你現在就可以問別人的 Agent:到「對話」,或在房間裡 @ 一個 Agent。", emptyLead:"想要有自己的 Agent
|
|
16
|
+
shareOne:"分享 1 個 Agent", stopOne:"停止分享 1 個 Agent", stopTitleOne:"要停止分享 1 個 Agent 嗎?", accessTitleOne:"已分享 1 個 Agent。誰可以問它?", share:"分享 {0} 個 Agent", stop:"停止分享 {0} 個 Agent", mixed:"分享 {0} 個 · 停止分享 {1} 個", apply:"套用變更", cancel:"取消", stopTitle:"要停止分享 {0} 個 Agent 嗎?", stopBody:"成員將無法再問:{0}。這些 Agent 的「可以提問的人」名單會被清除。", stopHint:"如果只是暫時不回答、想保留名單,請改用「暫停分享」。", stopGo:"停止分享", pause:"改為暫停", pauseOne:"暫停分享", later:"稍後再決定", accessTitle:"已分享 {0} 個 Agent。誰可以問它們?", accessLead:"在你選擇之前,沒有人可以問它們。", same:"{0} 個都用同一份名單", each:"每個 Agent 分開選", choose:"選擇誰可以提問", previousMixed:"沿用之前的名單", previous:"沿用之前的名單({0} 人)", used:"已儲存之前的名單。", saved:"已儲存", saveFailed:"無法儲存 {0} 的提問權限,請確認目前的 Agent 後再試。", personal:"在我的電腦上", details:"開啟 {0}",
|
|
17
|
+
empty:"你在這個 Hub 還沒有自己的 Agent。", already:"你現在就可以問別人的 Agent:到「對話」,或在房間裡 @ 一個 Agent。", emptyLead:"想要有自己的 Agent 讓成員提問:", personalOff:"這個 Hub 還沒有開啟個人 Agent,請洽 Hub 管理員。", fleetLead:"如果你有在使用 AgEnD,可以分享裡面的 Agent。", connectDenied:"請 Hub 管理員允許你連接 Fleet。", apps:"你自己的 Claude Code 或 Codex 也可以替你使用這個 Hub,用來提問和發言;成員不能問它。", appsLink:"我的 AI App", failed:"無法讀取清單,請重新整理再試。",
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
export const ms = (key, ...args) => t(`hubMyAgents.${key}`, ...args);
|
|
@@ -12,7 +12,7 @@ register("hubPersonal",{
|
|
|
12
12
|
"answerOnlyFailed": "Codex can't be used here: this computer can't keep it inside one folder, and Answer only mode isn't available either. Claude can be used.",
|
|
13
13
|
"answerOnlyAsker": "Answers from general knowledge only. It can't look at any files.",
|
|
14
14
|
"title": "Personal agent",
|
|
15
|
-
"lead": "Your own Codex or Claude answers
|
|
15
|
+
"lead": "Your own Codex or Claude answers members, from your Windows computer. No Fleet needed.",
|
|
16
16
|
"guard": "Read-only, and only one folder: the Hub agent folder on your computer. People allowed to ask may receive anything in that folder. Your own AI account pays for answers.",
|
|
17
17
|
"add": "Add a personal agent",
|
|
18
18
|
"replace": "Use a different computer",
|
|
@@ -130,7 +130,7 @@ register("hubPersonal",{
|
|
|
130
130
|
"answerOnlyFailed": "這裡不能使用 Codex:這台電腦無法把它限制在單一資料夾內,也無法使用「只回答」模式。可以使用 Claude。",
|
|
131
131
|
"answerOnlyAsker": "只根據一般知識回答,無法查看任何檔案。",
|
|
132
132
|
"title": "個人 Agent",
|
|
133
|
-
"lead": "由你自己的 Codex 或 Claude,在你的 Windows
|
|
133
|
+
"lead": "由你自己的 Codex 或 Claude,在你的 Windows 電腦上回答成員。不需要 Fleet。",
|
|
134
134
|
"guard": "只能讀取,而且只讀你電腦上的「Hub agent」資料夾。可以提問的人可能取得資料夾內的任何內容;回答使用你自己的 AI 帳號額度。",
|
|
135
135
|
"add": "新增個人 Agent",
|
|
136
136
|
"replace": "改用另一台電腦",
|
|
@@ -170,9 +170,9 @@ register("hubPersonal",{
|
|
|
170
170
|
"adminTitle": "個人 Agent",
|
|
171
171
|
"adminLead": "選擇誰能在自己的電腦新增 Agent,回答使用那個人的 AI 帳號額度。",
|
|
172
172
|
"enabled": "允許個人 Agent",
|
|
173
|
-
"allowed": "
|
|
173
|
+
"allowed": "可新增的成員與團隊",
|
|
174
174
|
"adminAlways": "開啟後,一律包含 Hub 管理員。",
|
|
175
|
-
"person": "
|
|
175
|
+
"person": "成員",
|
|
176
176
|
"team": "團隊",
|
|
177
177
|
"search": "輸入姓名搜尋所有人",
|
|
178
178
|
"find": "搜尋",
|
|
@@ -181,7 +181,7 @@ register("hubPersonal",{
|
|
|
181
181
|
"saveSettings": "儲存",
|
|
182
182
|
"unsaved": "尚未儲存",
|
|
183
183
|
"savedSettings": "已儲存",
|
|
184
|
-
"unknownPerson": "
|
|
184
|
+
"unknownPerson": "先前選擇的成員",
|
|
185
185
|
"unknownTeam": "先前選擇的團隊",
|
|
186
186
|
"newCommand": "重新產生指令",
|
|
187
187
|
"canUse": "可以使用",
|
|
@@ -209,7 +209,7 @@ register("hubPersonal",{
|
|
|
209
209
|
"waitingHint": "如果一分鐘後電腦還沒有出現,請按「重新整理」。",
|
|
210
210
|
"configureNext": "在下方選擇 Codex 或 Claude Code、填寫名稱,然後儲存。",
|
|
211
211
|
"workingNext": "正在回答提問,請讓這台電腦保持開機。",
|
|
212
|
-
"sharedReady": "
|
|
212
|
+
"sharedReady": "你選擇的成員可以在房間 @ 它,或一對一提問。",
|
|
213
213
|
"offlineNext": "這台電腦目前沒有連接。請開機並登入 Windows,它會自動連接。如果你關閉了自動啟動,請在安裝程式顯示的資料夾裡,按兩下 connect-agend.bat,再按「重新整理」。",
|
|
214
214
|
"configureStep": "選擇 Codex 或 Claude 並命名",
|
|
215
215
|
"requirementsShort": "需要一台 Windows 電腦,已安裝 Node.js 22.14 或更新版本,並已登入 Codex 或 Claude Code。",
|
|
@@ -223,7 +223,7 @@ register("hubRole",{
|
|
|
223
223
|
"styleLoading": "正在載入角色設定…",
|
|
224
224
|
"styleFailed": "無法載入角色設定樣式,請再試一次。",
|
|
225
225
|
"title": "角色與權限",
|
|
226
|
-
"lead": "
|
|
226
|
+
"lead": "設定成員可以在這個 Hub 做什麼。角色不能讀取對話內容,也不會顯示花費。",
|
|
227
227
|
"loading": "正在讀取角色…",
|
|
228
228
|
"failed": "無法讀取角色,請再試一次。",
|
|
229
229
|
"retry": "再試一次",
|
|
@@ -174,6 +174,13 @@ export function refusalText(r) {
|
|
|
174
174
|
: status >= 500 || code === "unavailable" ? "sendUnavailable" : "";
|
|
175
175
|
return hroom("notSentBecause", why ? hroom(why) : hroom("sendRefused", code || String(status)));
|
|
176
176
|
}
|
|
177
|
+
/** M-4027: a new post's idempotency key (the Hub takes a UUID). */
|
|
178
|
+
export function newPostKey() {
|
|
179
|
+
if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
|
|
180
|
+
const b = new Uint8Array(16); globalThis.crypto.getRandomValues(b); b[6] = (b[6] & 0x0f) | 0x40; b[8] = (b[8] & 0x3f) | 0x80;
|
|
181
|
+
const h = [...b].map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
182
|
+
return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`;
|
|
183
|
+
}
|
|
177
184
|
/** M-3604: 「重試傳送」 only where sending the same thing again can work (no answer, busy, unavailable). */
|
|
178
185
|
export function retryable(r) {
|
|
179
186
|
if (!r || r.ok || REFUSALS[r.code]) return false;
|
|
@@ -194,6 +201,10 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
194
201
|
// range (editRange: the selection when it began, the caret after), never by guessing from the text.
|
|
195
202
|
const bindings = useRef([]), edit = useRef({ input: null, key: null, ime: null, composing: false });
|
|
196
203
|
const own = useRef(null), input = inputRef || own;
|
|
204
|
+
// M-4027: the key of a send whose outcome is unknown (no answer, busy, unavailable), with exactly what it sent. Retrying
|
|
205
|
+
// that same draft sends the same key, so a post the Hub stored before its answer was lost is not stored twice; a changed
|
|
206
|
+
// draft is a new post with a new key.
|
|
207
|
+
const retryOf = useRef(null);
|
|
197
208
|
const [caret, setCaret] = useState(0);
|
|
198
209
|
const at = mentionAt(value, caret), options = at ? mentionOptions(detail, at.query) : [];
|
|
199
210
|
const palette = at && options.length ? options : null, chosen = palette ? palette[Math.min(pick, palette.length - 1)] : null;
|
|
@@ -245,14 +256,23 @@ export function RoomComposer({ store, detail, reply = null, onReply = () => {},
|
|
|
245
256
|
// unless something new was typed meanwhile.
|
|
246
257
|
const was = { value, bindings: bindings.current, reply };
|
|
247
258
|
setValue(""); bindings.current = []; onReply(null);
|
|
248
|
-
const
|
|
259
|
+
const mentions = boundMentions(was.value, detail, was.bindings), replyTo = was.reply ? was.reply.roomMessage : undefined;
|
|
260
|
+
const draft = JSON.stringify([text, mentions, replyTo ?? null]);
|
|
261
|
+
const idempotencyKey = retryOf.current?.draft === draft ? retryOf.current.key : newPostKey();
|
|
262
|
+
const r = await store.send(text, { mentions, ...(replyTo ? { replyTo } : {}), idempotencyKey });
|
|
249
263
|
setBusy(false);
|
|
264
|
+
// Prism #4676 (1): remember the key that was actually sent — the room page gives a key a new one when its files changed.
|
|
265
|
+
retryOf.current = !r.ok && retryable(r) ? { draft, key: typeof r.sentKey === "string" ? r.sentKey : idempotencyKey } : null;
|
|
250
266
|
if (!r.ok) {
|
|
251
267
|
if (!input.current?.value) { setValue(was.value); bindings.current = was.bindings; if (was.reply) onReply(was.reply); }
|
|
252
268
|
setMsg({ text: refusalText(r), retry: retryable(r) });
|
|
253
269
|
}
|
|
254
270
|
};
|
|
255
271
|
const onKeyDown = (e) => {
|
|
272
|
+
// M-4037: while an IME is composing (Chinese, Japanese…), its keys are its own: ArrowDown/Up move its candidates and
|
|
273
|
+
// Enter commits one — the @ menu must not pick or send on them. Some engines report the commit's Enter as keyCode 229
|
|
274
|
+
// with isComposing already false; the shared guard (chat-render composerKey) checks both, and so does this.
|
|
275
|
+
if (e.isComposing || e.keyCode === 229 || edit.current.composing) return;
|
|
256
276
|
if (palette && (e.key === "ArrowDown" || e.key === "ArrowUp")) { e.preventDefault(); setPick((i) => (i + (e.key === "ArrowDown" ? 1 : palette.length - 1)) % palette.length); return; }
|
|
257
277
|
if (palette && (e.key === "Enter" || e.key === "Tab") && !e.isComposing) { e.preventDefault(); complete(chosen); return; }
|
|
258
278
|
if (palette && e.key === "Escape") { e.preventDefault(); setCaret(-1); return; }
|
|
@@ -56,12 +56,12 @@ register("hubOwnerRequests", {
|
|
|
56
56
|
classic: "ClassicBot room",
|
|
57
57
|
},
|
|
58
58
|
"zh-TW": {
|
|
59
|
-
missing: "
|
|
59
|
+
missing: "找不到某位成員的 Agent 嗎?它可能沒有分享給你。",
|
|
60
60
|
ask: "請擁有者加入",
|
|
61
61
|
chooseTitle: "請擁有者加入 Agent",
|
|
62
62
|
choose: "擁有者是誰?",
|
|
63
63
|
owner: "擁有者",
|
|
64
|
-
search: "
|
|
64
|
+
search: "搜尋成員",
|
|
65
65
|
title: "請 {0} 把 Agent 加入「{1}」",
|
|
66
66
|
lead: "{0} 會看到是誰提出、是哪個房間。只有在 {0} 加入之後,你才會知道是哪個 Agent。",
|
|
67
67
|
note: "如果知道是哪個 Agent,可以寫在這裡(選填)",
|
|
@@ -56,6 +56,18 @@ linkRoomsU2Css(); // M-3127: the reaction chips and picker are drawn from hub-
|
|
|
56
56
|
* a Hub page has no Fleet module to share it with.
|
|
57
57
|
*/
|
|
58
58
|
const WIDE_KEY = "agend_hub_chat_wide";
|
|
59
|
+
/** M-4023: how many pages of 50 a catch-up reads back to join what is held. */
|
|
60
|
+
const CATCH_UP_PAGES = 10;
|
|
61
|
+
/**
|
|
62
|
+
* M-4027: a new post's idempotency key (the Hub takes a UUID). Kept here, not imported: a tab that retains an older
|
|
63
|
+
* hub-room-composer.js must still link this module (Prism #4676), so this file imports nothing new from it.
|
|
64
|
+
*/
|
|
65
|
+
const freshPostKey = () => {
|
|
66
|
+
if (typeof globalThis.crypto?.randomUUID === "function") return globalThis.crypto.randomUUID();
|
|
67
|
+
const b = new Uint8Array(16); globalThis.crypto.getRandomValues(b); b[6] = (b[6] & 0x0f) | 0x40; b[8] = (b[8] & 0x3f) | 0x80;
|
|
68
|
+
const h = [...b].map((x) => x.toString(16).padStart(2, "0")).join("");
|
|
69
|
+
return `${h.slice(0, 8)}-${h.slice(8, 12)}-${h.slice(12, 16)}-${h.slice(16, 20)}-${h.slice(20)}`;
|
|
70
|
+
};
|
|
59
71
|
export function hubChatWide() { try { return localStorage.getItem(WIDE_KEY) === "on"; } catch { return false; } }
|
|
60
72
|
function setHubChatWide(on) { try { if (on) localStorage.setItem(WIDE_KEY, "on"); else localStorage.removeItem(WIDE_KEY); } catch { /* this tab only */ } }
|
|
61
73
|
/** The Fleet chat's narrow screen (panel-chat.js narrowScreen): no 「全寬」 there — the column is the screen's already. */
|
|
@@ -279,16 +291,96 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
279
291
|
if (i >= 0 && st.messages[i].id.startsWith("local:")) st.messages[i] = m;
|
|
280
292
|
else if (i >= 0) { const next = { ...st.messages[i], ...m }; if (!("reactions" in m)) delete next.reactions; st.messages[i] = next; } else st.messages.push(m);
|
|
281
293
|
};
|
|
294
|
+
// M-4031: which rows the stream changed, and when (a counter, not a clock). A page read that started before a row's live
|
|
295
|
+
// change carries an older copy of it: that row keeps the stream's version; the page's other rows load as read.
|
|
296
|
+
let liveTick = 0;
|
|
297
|
+
const rowAt = new Map();
|
|
298
|
+
const live = (m) => { if (m && typeof m.id === "string") rowAt.set(m.id, ++liveTick); upsert(m); };
|
|
299
|
+
// Prism #4670 (2, 4): a reply's event also moves its parent's `ask` (who answered so far) — and only that. It is stamped
|
|
300
|
+
// apart from whole rows: a page read before it takes everything else of the parent from the page (a reaction made while
|
|
301
|
+
// offline, say) and only `ask` from the stream; a page that brings the parent later (not loaded yet) takes it too.
|
|
302
|
+
const askAt = new Map(), liveAsk = new Map();
|
|
303
|
+
const liveParent = (parent) => {
|
|
304
|
+
if (!parent || typeof parent.id !== "string") return;
|
|
305
|
+
askAt.set(parent.id, ++liveTick); liveAsk.set(parent.id, parent.ask);
|
|
306
|
+
const p = st.messages.find((x) => x.id === parent.id); if (p) p.ask = parent.ask;
|
|
307
|
+
};
|
|
308
|
+
const sameRow = (x, m) => x.id === m.id || (m.idempotencyKey && x.idempotencyKey === m.idempotencyKey);
|
|
309
|
+
/** What to keep of a page row `m` (read from `since`) next to the held copy `x`: the held row when the stream sent a
|
|
310
|
+
* whole newer copy; else the page row over it (as upsert merges), with the stream's newer `ask` laid on top. */
|
|
311
|
+
const pageRow = (m, since, x) => {
|
|
312
|
+
if (x && !x.id.startsWith("local:") && rowAt.get(x.id) > since) return x;
|
|
313
|
+
let next = !x || x.id.startsWith("local:") ? m : (() => { const n = { ...x, ...m }; if (!("reactions" in m)) delete n.reactions; return n; })();
|
|
314
|
+
if (askAt.get(m.id) > since) next = { ...next, ask: liveAsk.get(m.id) };
|
|
315
|
+
return next;
|
|
316
|
+
};
|
|
317
|
+
/** A row from a page read that started at `since`. */
|
|
318
|
+
const fromPage = (m, since) => {
|
|
319
|
+
if (!m || m.roomId !== roomId || typeof m.id !== "string") return;
|
|
320
|
+
const i = st.messages.findIndex((x) => sameRow(x, m));
|
|
321
|
+
const row = pageRow(m, since, i >= 0 ? st.messages[i] : undefined);
|
|
322
|
+
if (i >= 0) st.messages[i] = row; else st.messages.push(row);
|
|
323
|
+
};
|
|
282
324
|
const readDetail = async () => { const d = await client.room(roomId); if (!st.live) return; if (d.ok) st.detail = d; else if (!st.detail) st.error = d.code || "failed"; };
|
|
283
325
|
async function refresh() {
|
|
326
|
+
const since = liveTick;
|
|
284
327
|
const [d, page] = await Promise.all([client.room(roomId), client.roomMessages(roomId, { limit: 50 })]);
|
|
285
328
|
if (!st.live) return;
|
|
286
329
|
if (d.ok) st.detail = d; else st.error = d.code || "failed";
|
|
287
|
-
if (page.ok) { for (const m of page.messages || [])
|
|
330
|
+
if (page.ok) { for (const m of page.messages || []) fromPage(m, since); st.more = page.more === true; st.loaded = true; if (d.ok) st.error = null; }
|
|
288
331
|
else st.error = page.code || "failed";
|
|
289
332
|
changed();
|
|
333
|
+
if (st.loaded && catchAfterLoad) { catchAfterLoad = false; void catchUp(); }
|
|
290
334
|
void readPins();
|
|
291
335
|
}
|
|
336
|
+
/**
|
|
337
|
+
* M-4023: catch up after the stream was away (it reconnected, or the page comes back to the foreground). Nothing sent
|
|
338
|
+
* meanwhile is replayed, so read the newest page — and older pages until one meets a message already held — and merge it
|
|
339
|
+
* in the room's order, each message once: a held one is updated in place, a missed one lands where the room has it.
|
|
340
|
+
* Messages that arrived on the stream while this read was out stay after it. More than CATCH_UP_PAGES pages missed: the
|
|
341
|
+
* held rows can't be joined to the new ones, so the thread restarts from the newest page (older ones load on scroll).
|
|
342
|
+
*/
|
|
343
|
+
let catching = null, catchAgain = false, catchAfterLoad = false;
|
|
344
|
+
function catchUp() {
|
|
345
|
+
// Prism #4670 (1): the stream came back while the first page is still out — that page may predate what was missed.
|
|
346
|
+
if (st.live && !st.loaded) { catchAfterLoad = true; return Promise.resolve(); }
|
|
347
|
+
if (!st.live) return Promise.resolve();
|
|
348
|
+
if (catching) { catchAgain = true; return catching; }
|
|
349
|
+
catching = (async () => {
|
|
350
|
+
do {
|
|
351
|
+
catchAgain = false;
|
|
352
|
+
const since = liveTick;
|
|
353
|
+
const before = new Set(st.messages.map((m) => m.id));
|
|
354
|
+
const held = new Set(st.messages.filter((m) => !m.id.startsWith("local:")).map((m) => m.id));
|
|
355
|
+
let page = await client.roomMessages(roomId, { limit: 50 });
|
|
356
|
+
if (!st.live || !page.ok) return;
|
|
357
|
+
let fresh = page.messages || [], more = page.more === true;
|
|
358
|
+
// Nothing held (an empty room): the newest page is the thread; older ones load on scroll.
|
|
359
|
+
for (let n = 1; held.size && more && fresh.length && !fresh.some((m) => held.has(m.id)) && n < CATCH_UP_PAGES; n++) {
|
|
360
|
+
page = await client.roomMessages(roomId, { before: fresh[0].id, limit: 50 });
|
|
361
|
+
if (!st.live || !page.ok) return;
|
|
362
|
+
const known = new Set(fresh.map((m) => m.id));
|
|
363
|
+
fresh = [...(page.messages || []).filter((m) => !known.has(m.id)), ...fresh];
|
|
364
|
+
more = page.more === true;
|
|
365
|
+
}
|
|
366
|
+
const joined = !held.size || fresh.some((m) => held.has(m.id)) || !more;
|
|
367
|
+
const merged = fresh.map((m) => {
|
|
368
|
+
// M-4031: a whole live copy newer than this read stays; a live `ask` alone is laid over the page's row.
|
|
369
|
+
return pageRow(m, since, st.messages.find((y) => sameRow(y, m)));
|
|
370
|
+
});
|
|
371
|
+
const inFresh = (x) => fresh.some((m) => m.id === x.id || (m.idempotencyKey && x.idempotencyKey === m.idempotencyKey));
|
|
372
|
+
// Held before the read and not in it: older than the page (it reaches back to a held row). Arrived during the read,
|
|
373
|
+
// or still being sent: after it.
|
|
374
|
+
const older = joined ? st.messages.filter((x) => before.has(x.id) && !x.id.startsWith("local:") && !inFresh(x)) : [];
|
|
375
|
+
const after = st.messages.filter((x) => (!before.has(x.id) || x.id.startsWith("local:")) && !inFresh(x));
|
|
376
|
+
st.messages = [...older, ...merged, ...after];
|
|
377
|
+
// Prism #4670 (3): what lies before the page — the page's own answer when nothing was held, more when it couldn't join.
|
|
378
|
+
if (!held.size) st.more = more; else if (!joined) st.more = true;
|
|
379
|
+
changed();
|
|
380
|
+
} while (catchAgain && st.live);
|
|
381
|
+
})().finally(() => { catching = null; });
|
|
382
|
+
return catching;
|
|
383
|
+
}
|
|
292
384
|
/** M-3340: my pins, read again (opening the room; my other tab or device changed them: pins.changed). A group room only. */
|
|
293
385
|
async function readPins() {
|
|
294
386
|
if (!pinsOn || typeof client.roomPins !== "function" || st.detail?.room?.kind !== "group") return;
|
|
@@ -303,8 +395,8 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
303
395
|
client, entries: () => st.view, refresh: () => refresh(), changed: () => { for (const fn of [...subs]) { try { fn(); } catch { /* a subscriber's own failure */ } } },
|
|
304
396
|
});
|
|
305
397
|
const unsubscribe = typeof client.subscribeRooms === "function" ? client.subscribeRooms({
|
|
306
|
-
"message.added": on((d) =>
|
|
307
|
-
"message.updated": on((d) => {
|
|
398
|
+
"message.added": on((d) => live(d.message)),
|
|
399
|
+
"message.updated": on((d) => { live(d.message); if (d.parent) liveParent(d.parent); }),
|
|
308
400
|
// The member's live state as sent: presence, and its note and reason only while the event carries them (a reason
|
|
309
401
|
// alone updates it; an event without one clears it — never a stale reason).
|
|
310
402
|
"presence.changed": on((d) => { const m = st.detail?.members?.find((x) => x.id === d.memberId); if (m) { m.presence = d.presence;
|
|
@@ -312,6 +404,8 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
312
404
|
"member.changed": on(() => { void readDetail().then(changed); }),
|
|
313
405
|
"pins.changed": on(() => { void readPins(); }),
|
|
314
406
|
"room.changed": on((d) => { if (d.removed) st.removed = true; else if (d.room && st.detail) st.detail = { ...st.detail, room: { ...st.detail.room, ...d.room } }; }),
|
|
407
|
+
// M-4023: the stream dropped and is back; what was sent meanwhile is read, not lost.
|
|
408
|
+
reconnected: () => { void catchUp(); },
|
|
315
409
|
}) : () => {};
|
|
316
410
|
/** One page older than what is held (the server's `before=`). False when there was nothing to fetch. */
|
|
317
411
|
async function older() {
|
|
@@ -354,11 +448,16 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
354
448
|
room: () => ({ ...(st.detail?.room || {}), ownerName: "" }),
|
|
355
449
|
// M-3125: this store carries files (pageCarriesFiles reads the mark), sent as the post's `files`.
|
|
356
450
|
filesV1: true,
|
|
357
|
-
async send(text, { mentions = [], replyTo, files } = {}) {
|
|
358
|
-
|
|
451
|
+
async send(text, { mentions = [], replyTo, files, idempotencyKey: retryKey } = {}) {
|
|
452
|
+
// M-4027: a retry of the same draft passes the key its first try used — the Hub stores one post per key, so a post
|
|
453
|
+
// that was committed but whose answer was lost is not stored twice. Anything else is a new post with a new key.
|
|
454
|
+
const idempotencyKey = typeof retryKey === "string" && /^[A-Za-z0-9-]{8,128}$/.test(retryKey) ? retryKey
|
|
455
|
+
: (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`).replace(/[^A-Za-z0-9-]/g, "");
|
|
359
456
|
// M-3951: my message shows at once, as the Fleet chat's does: in a 1:1 with its ◷ until the Hub's copy replaces it.
|
|
360
457
|
// Files keep today's path (their chips stay in the composer until the Hub has them).
|
|
361
|
-
|
|
458
|
+
// Prism #4676 (3): a retry whose first try the stream already delivered (only its answer was lost) draws nothing new.
|
|
459
|
+
const confirmed = st.messages.some((m) => m.idempotencyKey === idempotencyKey && !m.id.startsWith("local:"));
|
|
460
|
+
const me = st.detail?.me?.id || meId, local = `local:${idempotencyKey}`, draws = !files?.length && !!text && !!me && !confirmed;
|
|
362
461
|
if (draws) { st.messages.push({ id: local, roomId, at: Date.now(), author: { kind: "person", id: me, name: "" }, text, mentions, idempotencyKey,
|
|
363
462
|
...(replyTo ? { replyTo } : {}), ...(st.detail?.room?.kind === "direct" ? { receiptStage: "queued" } : {}) }); changed(); }
|
|
364
463
|
let r;
|
|
@@ -371,7 +470,8 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
371
470
|
// The stream's copy, when it came first, is at least as new as the send's answer (its stage may already be ✓).
|
|
372
471
|
if (ok && sent && !st.messages.some((m) => m.id === sent.id)) upsert(sent);
|
|
373
472
|
if (draws || (ok && sent)) changed();
|
|
374
|
-
|
|
473
|
+
// M-4027: the key this send carried (a retry must repeat the key of exactly what it sends).
|
|
474
|
+
return r && typeof r === "object" ? { ...r, sentKey: idempotencyKey } : r;
|
|
375
475
|
},
|
|
376
476
|
older, findQuoted,
|
|
377
477
|
/**
|
|
@@ -423,7 +523,7 @@ export function createRoomStore(roomId, { client, meId = "", pinsOn = false } =
|
|
|
423
523
|
return r;
|
|
424
524
|
},
|
|
425
525
|
markRead() { const last = st.messages.at(-1); return last ? client.markRoomRead(roomId, last.id) : Promise.resolve({ ok: true }); },
|
|
426
|
-
refresh, clickButton: actions.clickButton, vote: actions.vote, busy: actions.busy, mine: actions.mine,
|
|
526
|
+
refresh, catchUp, clickButton: actions.clickButton, vote: actions.vote, busy: actions.busy, mine: actions.mine,
|
|
427
527
|
stop() { st.live = false; subs.clear(); unsubscribe(); actions.stop(); },
|
|
428
528
|
};
|
|
429
529
|
}
|
|
@@ -557,9 +657,15 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
557
657
|
return true;
|
|
558
658
|
} }] };
|
|
559
659
|
};
|
|
660
|
+
// M-4027: the files a key was sent with. A retry's key comes from the composer, which sees only the words: when the files
|
|
661
|
+
// differ from that key's try, it is a different post and takes a new key.
|
|
662
|
+
const keyFiles = useRef(null);
|
|
560
663
|
const sendStore = useMemo(() => ({ ...store, send: async (text, opts = {}) => {
|
|
561
664
|
if (filesRef.current.some((f) => f.state === "uploading")) { setFileMsg(hf("waitUpload")); return { ok: false, code: "uploading" }; }
|
|
562
665
|
const chosen = filesRef.current.filter((f) => f.state === "ready");
|
|
666
|
+
const files = chosen.map((f) => f.id).join(",");
|
|
667
|
+
if (opts.idempotencyKey && keyFiles.current?.key === opts.idempotencyKey && keyFiles.current.files !== files) opts = { ...opts, idempotencyKey: freshPostKey() };
|
|
668
|
+
keyFiles.current = opts.idempotencyKey ? { key: opts.idempotencyKey, files } : null;
|
|
563
669
|
const r = await store.send(text, { ...opts, ...(chosen.length ? { files: chosen.map((f) => f.id) } : {}) });
|
|
564
670
|
if (r?.ok && chosen.length) { const sent = new Set(chosen.map((f) => f.key)); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); }
|
|
565
671
|
return r;
|
|
@@ -592,7 +698,8 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
592
698
|
useEffect(() => { if (store.loaded() && shown()) void store.markRead(); }, [store.loaded(), newest]);
|
|
593
699
|
useEffect(() => {
|
|
594
700
|
if (typeof document === "undefined") return undefined;
|
|
595
|
-
|
|
701
|
+
// M-4023: back in the foreground, read what the stream may have missed first, then mark the room's real newest row read.
|
|
702
|
+
const onVisible = () => { if (store.loaded() && shown()) void store.catchUp().then(() => { if (shown()) void store.markRead(); }); };
|
|
596
703
|
document.addEventListener("visibilitychange", onVisible);
|
|
597
704
|
return () => document.removeEventListener("visibilitychange", onVisible);
|
|
598
705
|
}, [store]);
|
package/dist/ui/hub-strings.js
CHANGED
|
@@ -17,11 +17,11 @@ register("hub", {
|
|
|
17
17
|
adminTitle: "Administration",
|
|
18
18
|
// The Hub workspace (S3b): sign-in, Ask, My agents, Administration
|
|
19
19
|
signedOutHub: "Not signed in", signOut: "Sign out", signInTitle: "Sign in to the Hub",
|
|
20
|
-
signInLead: "Use your
|
|
20
|
+
signInLead: "Use your organization account. The Hub checks your password with the directory and never keeps it; your browser may offer to save it for you.",
|
|
21
21
|
signInPreview: "This Hub is a preview. Its screens and features may still change.",
|
|
22
22
|
login: "Account", password: "Password", signIn: "Sign in",
|
|
23
23
|
errSignIn: "That account and password didn't work.",
|
|
24
|
-
loginEmailHint: "Sign in with your
|
|
24
|
+
loginEmailHint: "Sign in with your organization email or AD account name.",
|
|
25
25
|
errDirectory: "The directory can't be reached right now. Try again later.",
|
|
26
26
|
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.",
|
|
27
27
|
errNotFound: "Not found, or not available to you.", errDenied: "You're not allowed to do that (or no longer).", approveOwnerDenied: "{0} can't connect a Fleet right now: they aren't in the allowed groups, or they've been blocked from connecting.", errUnreachableHub: "The Hub can't be reached.",
|
|
@@ -98,11 +98,11 @@ register("hub", {
|
|
|
98
98
|
exposuresHint: "請在自己的 Fleet 分享 Agent:設定 → Hub。",
|
|
99
99
|
adminTitle: "管理",
|
|
100
100
|
signedOutHub: "尚未登入", signOut: "登出", signInTitle: "登入 Hub",
|
|
101
|
-
signInLead: "
|
|
101
|
+
signInLead: "請使用組織帳號登入。Hub 只把密碼送給目錄服務驗證,不會保存;你的瀏覽器可能會詢問是否幫你記住。",
|
|
102
102
|
signInPreview: "這個 Hub 是預覽版,畫面與功能可能還會變動。",
|
|
103
103
|
login: "帳號", password: "密碼", signIn: "登入",
|
|
104
104
|
errSignIn: "帳號或密碼不正確。",
|
|
105
|
-
loginEmailHint: "
|
|
105
|
+
loginEmailHint: "可以用組織 email 或 AD 帳號登入。",
|
|
106
106
|
errDirectory: "目前無法連到目錄服務,請稍後再試。",
|
|
107
107
|
errBusyHub: "請求太頻繁,請稍候再試。", errConflictHub: "這個項目剛剛有變更,已重新載入,請確認後再試一次。",
|
|
108
108
|
errNotFound: "找不到,或你無法使用。", errDenied: "你沒有權限(或權限已被撤回)。", approveOwnerDenied: "{0} 目前不能連接 Fleet(不在允許的範圍,或已被禁止連接)。", errUnreachableHub: "無法連到 Hub。",
|
|
@@ -6,7 +6,7 @@ import { searchablePeopleQuery } from "./hub-people-query.js";
|
|
|
6
6
|
import { PeoplePaste, pasteText } from "./hub-people-paste.js";
|
|
7
7
|
register("hubSubjectPicker", {
|
|
8
8
|
en: { kind:"Add a group, team or person", group:"AD group", team:"Team", person:"Person", teamPick:"Choose a team", findPerson:"Find a person", query:"Name or login", hint:"Type 2 to 64 characters.", peopleHint:"Type a name or account: 2 letters or more, or 1 Chinese character.", 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", failed:"The directory could not be searched just now. Try again.", limited:"Too many searches. Try again shortly.", retry:"Search again", change:"Choose someone else", teamRow:"{0} · Team · {1} members · Lead: {2}", teamHint:"Its leads decide who is on this team.", personRow:"{0} · Person", teamChecked:"Team members checked: {0}" },
|
|
9
|
-
"zh-TW": { kind:"新增群組、團隊或人員", group:"AD 群組", team:"團隊", person:"人員", teamPick:"選擇團隊", findPerson:"
|
|
9
|
+
"zh-TW": { kind:"新增群組、團隊或人員", group:"AD 群組", team:"團隊", person:"人員", teamPick:"選擇團隊", findPerson:"尋找成員", query:"姓名或登入帳號", hint:"請輸入 2 到 64 個字。", peopleHint:"輸入姓名或帳號:至少 2 個英文字母,或 1 個中文字。", searching:"搜尋中…", none:"找不到符合的成員,請多輸入幾個姓名或帳號的字。", more:"還有更多成員符合,請多輸入幾個字。", pick:"選擇 {0}", choose:"選擇", failed:"目前無法搜尋目錄,請再試一次。", limited:"搜尋太多次了,請稍後再試。", retry:"重新搜尋", change:"重新選擇對象", teamRow:"{0} · 團隊 · {1} 位成員 · 負責人:{2}", teamHint:"團隊成員由負責人決定。", personRow:"{0} · 人員", teamChecked:"已檢查的團隊成員:{0}" }
|
|
10
10
|
});
|
|
11
11
|
export const subjectText = (key, ...args) => t(`hubSubjectPicker.${key}`, ...args);
|
|
12
12
|
const g = subjectText;
|
|
@@ -26,7 +26,7 @@ register("hubTeam", {
|
|
|
26
26
|
create: "新增團隊", edit: "編輯 {0}", empty: "還沒有團隊。", noMine: "你目前沒有負責的團隊。", loading: "正在讀取團隊…", retry: "再試一次", refresh: "重新整理", back: "所有團隊",
|
|
27
27
|
name: "團隊名稱", department: "部門(選填)", departmentLine: "所屬部門:{0}", chooseDepartment: "選擇部門", departmentQuery: "搜尋 AD 部門", leadPerson: "負責人(最多 5 位)", chooseLead: "選擇負責人",
|
|
28
28
|
members: "成員", role: "身分", roleLead: "負責人", roleMember: "成員", signedIn: "已加入 Hub", agents: "分享的 Agent", yes: "已加入", notYet: "尚未加入", unobserved: "尚未確認", none: "無",
|
|
29
|
-
add: "加入成員", remove: "移除", search: "搜尋", personQuery: "輸入姓名搜尋所有人", searchHint: "輸入姓名或帳號:至少 2 個英文字母,或 1
|
|
29
|
+
add: "加入成員", remove: "移除", search: "搜尋", personQuery: "輸入姓名搜尋所有人", searchHint: "輸入姓名或帳號:至少 2 個英文字母,或 1 個中文字。可以選擇其他部門的成員。", groupHint: "請輸入部門名稱的 2 到 64 個字。",
|
|
30
30
|
searching: "搜尋中…", noMatches: "找不到符合的對象,請多輸入幾個姓名的字。", choose: "選擇 {0}", pick: "選擇", cancel: "取消", change: "變更", save: "儲存", saving: "儲存中…", saved: "已儲存。", unsaved: "尚未儲存",
|
|
31
31
|
limit: "最多 200 位成員,包含負責人。", count: "{0} 位成員", leadRequired: "負責人也是成員。離開之前,請先指定另一位負責人。",
|
|
32
32
|
disabledLead: "負責人的帳號已停用,請指定新的負責人。",
|