@songsid/agend 2.4.0-beta.11 → 2.4.0-beta.12
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/accounts-view.d.ts +29 -0
- package/dist/accounts-view.js +2 -14
- package/dist/accounts-view.js.map +1 -1
- package/dist/agent-endpoint.d.ts +1 -0
- package/dist/agent-endpoint.js +4 -2
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/auth-api.d.ts +2 -0
- package/dist/auth-api.js +28 -2
- package/dist/auth-api.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/channel/mcp-server.js +1 -1
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +3 -1
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/claude-install-kind.d.ts +19 -0
- package/dist/claude-install-kind.js +54 -0
- package/dist/claude-install-kind.js.map +1 -0
- package/dist/daemon.d.ts +5 -0
- package/dist/daemon.js +20 -2
- package/dist/daemon.js.map +1 -1
- package/dist/fleet-manager.d.ts +105 -1
- package/dist/fleet-manager.js +366 -24
- package/dist/fleet-manager.js.map +1 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +25 -0
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +6 -0
- package/dist/hub/agent-intro-model.d.ts +38 -0
- package/dist/hub/agent-intro-model.js +14 -0
- package/dist/hub/agent-intro-model.js.map +1 -0
- package/dist/hub/agent-intro-tool.d.ts +35 -0
- package/dist/hub/agent-intro-tool.js +83 -0
- package/dist/hub/agent-intro-tool.js.map +1 -0
- package/dist/hub/client.d.ts +1 -0
- package/dist/hub/client.js +26 -0
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +13 -5
- package/dist/hub/compose/member.js +28 -5
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +1 -0
- package/dist/hub/compose/server.js +5 -1
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/http/compose.d.ts +1 -0
- package/dist/hub/http/compose.js +28 -5
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/schema.js +6 -0
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/member/agent-intro.d.ts +28 -0
- package/dist/hub/member/agent-intro.js +66 -0
- package/dist/hub/member/agent-intro.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +10 -0
- package/dist/hub/member/room-ask.js +70 -7
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-notification.d.ts +1 -1
- package/dist/hub/member/room-post.d.ts +6 -3
- package/dist/hub/member/room-post.js +9 -3
- package/dist/hub/member/room-post.js.map +1 -1
- package/dist/hub/protocol.d.ts +172 -4
- package/dist/hub/protocol.js +10 -5
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/room-answer-status-model.d.ts +3 -0
- package/dist/hub/room-answer-status-model.js +4 -0
- package/dist/hub/room-answer-status-model.js.map +1 -0
- package/dist/hub/room-brief-model.d.ts +30 -0
- package/dist/hub/room-brief-model.js +37 -0
- package/dist/hub/room-brief-model.js.map +1 -0
- package/dist/hub/room-context-model.d.ts +2 -0
- package/dist/hub/room-context-model.js +2 -2
- package/dist/hub/room-context-model.js.map +1 -1
- package/dist/hub/room-members-model.d.ts +63 -0
- package/dist/hub/room-members-model.js +7 -0
- package/dist/hub/room-members-model.js.map +1 -0
- package/dist/hub/rooms/agents.js +50 -10
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/brief.d.ts +18 -0
- package/dist/hub/rooms/brief.js +39 -0
- package/dist/hub/rooms/brief.js.map +1 -0
- package/dist/hub/rooms/members-page.d.ts +33 -0
- package/dist/hub/rooms/members-page.js +37 -0
- package/dist/hub/rooms/members-page.js.map +1 -0
- package/dist/hub/rooms/purpose.d.ts +7 -0
- package/dist/hub/rooms/purpose.js +14 -0
- package/dist/hub/rooms/purpose.js.map +1 -0
- package/dist/hub/rooms/service.d.ts +11 -0
- package/dist/hub/rooms/service.js +56 -12
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +6 -2
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/server.js +27 -1
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/types.d.ts +9 -5
- package/dist/hub-room-reply-warning.d.ts +2 -0
- package/dist/hub-room-reply-warning.js +16 -0
- package/dist/hub-room-reply-warning.js.map +1 -0
- package/dist/instance-lifecycle.d.ts +15 -0
- package/dist/instance-lifecycle.js +36 -1
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/locale.js +20 -0
- package/dist/locale.js.map +1 -1
- package/dist/login-controller.d.ts +26 -0
- package/dist/login-controller.js +72 -2
- package/dist/login-controller.js.map +1 -1
- package/dist/native-mcp.js +1 -1
- package/dist/native-mcp.js.map +1 -1
- package/dist/needs-you-hub.js +1 -1
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +8 -1
- package/dist/needs-you.js +5 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/outbound-handlers.d.ts +2 -1
- package/dist/outbound-handlers.js +17 -4
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +10 -0
- package/dist/outbound-schemas.js +3 -1
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/public-web-gateway.js +5 -1
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/settings-effect.js +17 -1
- package/dist/settings-effect.js.map +1 -1
- package/dist/tool-permissions.js +3 -3
- package/dist/tool-permissions.js.map +1 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/host-install.js +77 -3
- package/dist/ui/hub-agent-intro.js +15 -6
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-client.js +4 -0
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-my-agents.js +5 -2
- package/dist/ui/hub-room-composer.js +10 -2
- package/dist/ui/hub-room-list.js +1 -1
- package/dist/ui/hub-room-members.js +2 -0
- package/dist/ui/hub-room-new.js +7 -4
- package/dist/ui/hub-room-purpose.js +19 -0
- package/dist/ui/hub-room-search.js +1 -1
- package/dist/ui/hub-room-settings.js +9 -0
- package/dist/ui/hub-room-strings.js +6 -4
- package/dist/ui/hub-room-thread.js +68 -17
- package/dist/ui/panel-chat.js +19 -5
- package/dist/ui/panel-hub.js +61 -18
- package/dist/ui/shared/app-i18n.js +2 -2
- package/dist/ui/shared/app-shell.js +6 -0
- package/dist/ui/shared/app.js +3 -1
- package/dist/ui/shared/chat-msg-actions.js +3 -1
- package/dist/ui/shared/chat-quote.js +261 -0
- package/dist/ui/shared/hub-chat.css +28 -0
- package/dist/ui/shared/hub-rooms-u2.css +5 -0
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/web-api.d.ts +17 -4
- package/dist/web-api.js +83 -6
- package/dist/web-api.js.map +1 -1
- package/dist/web-asset-version.d.ts +65 -0
- package/dist/web-asset-version.js +259 -0
- package/dist/web-asset-version.js.map +1 -0
- package/dist/web-host-guard.js +3 -1
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-host-install.d.ts +30 -3
- package/dist/web-host-install.js +50 -4
- package/dist/web-host-install.js.map +1 -1
- package/dist/web-terminal.d.ts +5 -0
- package/dist/web-terminal.js +11 -0
- package/dist/web-terminal.js.map +1 -1
- package/launcher/agend-install.cjs +48 -7
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ register("hubRoom", {
|
|
|
38
38
|
searchResults: "Results", searchRooms: "Rooms and chats", searchBadgeRoom: "Room", searchBadgeChat: "Chat", searchCount: "{0} results",
|
|
39
39
|
searchOlder: "Search older messages", searchKeys: "↑↓ move · Enter open · Esc close", jumpMissing: "That message is no longer in this room.",
|
|
40
40
|
filterPh: "Filter: name or owner", filterClear: "Clear the filter",
|
|
41
|
-
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
41
|
+
laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer", noAnswerUnanswered:"No answer: The agent finished without answering here", noAnswerStopped: "No answer: {0} stopped sharing this agent.",
|
|
42
42
|
workingOne: "{0} is working on it", workingMany: "{0} agents are working",
|
|
43
43
|
// §4 composer
|
|
44
44
|
composer: "Speak in “{0}”; @ an agent to have it answer",
|
|
@@ -73,6 +73,7 @@ register("hubRoom", {
|
|
|
73
73
|
addAssistant: "Add a room assistant (provided by the Hub)",
|
|
74
74
|
create: "Create", cancel: "Cancel",
|
|
75
75
|
createdSys: "{0} created this room.",
|
|
76
|
+
purposeSetSys:"{0} set the purpose: {1}",purposeClearedSys:"{0} cleared the purpose.",
|
|
76
77
|
sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
|
|
77
78
|
invitedSys: "{0} agents invited; they join when the owner agrees.",
|
|
78
79
|
nameRequired: "Enter a room name.",
|
|
@@ -141,7 +142,7 @@ register("hubRoom", {
|
|
|
141
142
|
// The @ progress line in parts, a part with 0 left out (Lumen): "Answered 1 · Working 1".
|
|
142
143
|
progAnswered: "Answered {0}", progWorking: "Working {0}", progLater: "Reply later {0}",
|
|
143
144
|
progFailed: "Failed {0}", progBlocked: "Blocked {0}",
|
|
144
|
-
reasonExpired: "The question expired before an answer", reasonUnavailable: "The room assistant could not answer",
|
|
145
|
+
reasonUnanswered:"The agent finished without answering here", reasonExpired: "The question expired before an answer", reasonUnavailable: "The room assistant could not answer",
|
|
145
146
|
reasonInterrupted: "The answer was interrupted", reasonRetired: "This agent could not answer", reasonUnknown: "No reason given",
|
|
146
147
|
roomsCanAskIt: "People in its rooms can @ it there. See In these rooms.", invitationsTitle: "Invitations",
|
|
147
148
|
},
|
|
@@ -171,7 +172,7 @@ register("hubRoom", {
|
|
|
171
172
|
searchResults: "結果", searchRooms: "房間與聊天", searchBadgeRoom: "房間", searchBadgeChat: "聊天", searchCount: "{0} 筆結果",
|
|
172
173
|
searchOlder: "搜尋更早的訊息", searchKeys: "↑↓ 移動 · Enter 開啟 · Esc 關閉", jumpMissing: "這則訊息已不在這個房間裡。",
|
|
173
174
|
filterPh: "篩選:名稱或擁有者", filterClear: "清除篩選",
|
|
174
|
-
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
175
|
+
laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答", noAnswerUnanswered:"沒有回答:Agent 已結束處理,但沒有在這裡回答。", noAnswerStopped: "沒有回答:{0} 已停止分享這個 Agent。",
|
|
175
176
|
workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
|
|
176
177
|
composer: "在「{0}」說話;@ 一個 Agent 請它回答",
|
|
177
178
|
composerShort: "說話,或 @ Agent 請它回答",
|
|
@@ -203,6 +204,7 @@ register("hubRoom", {
|
|
|
203
204
|
addAssistant: "加入房間助理(Hub 提供)",
|
|
204
205
|
create: "建立", cancel: "取消",
|
|
205
206
|
createdSys: "{0} 建立了這個房間。",
|
|
207
|
+
purposeSetSys:"{0} 設定了用途:{1}",purposeClearedSys:"{0} 清除了用途。",
|
|
206
208
|
sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
|
|
207
209
|
invitedSys: "已邀請 {0} 個 Agent,擁有者同意後會加入。",
|
|
208
210
|
nameRequired: "請輸入房間名稱。",
|
|
@@ -260,7 +262,7 @@ register("hubRoom", {
|
|
|
260
262
|
peopleOne: "1 人", peopleMany: "{0} 人", agentsOne: "1 個 Agent", agentsMany: "{0} 個 Agent",
|
|
261
263
|
progAnswered: "已回答 {0}", progWorking: "處理中 {0}", progLater: "稍後回覆 {0}",
|
|
262
264
|
progFailed: "未回答 {0}", progBlocked: "無法回答 {0}",
|
|
263
|
-
reasonExpired: "問題在回答前就過期了", reasonUnavailable: "房間助理暫時無法回答",
|
|
265
|
+
reasonUnanswered:"Agent 已結束處理,但沒有在這裡回答", reasonExpired: "問題在回答前就過期了", reasonUnavailable: "房間助理暫時無法回答",
|
|
264
266
|
reasonInterrupted: "回答被中斷", reasonRetired: "這個 Agent 無法回答", reasonUnknown: "沒有說明原因",
|
|
265
267
|
roomsCanAskIt: "房間裡的人可以在房間裡 @ 它,見「在這些房間裡」。", invitationsTitle: "邀請",
|
|
266
268
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {RoomPurposeHeader} from "./hub-room-purpose.js";
|
|
1
2
|
import { hi } from "./hub-agent-intro.js";
|
|
2
3
|
import {hp} from "./hub-personal-agent-strings.js";
|
|
3
4
|
// M-3092 PR 2 (Hub rooms, track U): one room of a Hub with rooms, on the Fleet chat's own thread (/assets/chat-thread.js
|
|
@@ -24,19 +25,44 @@ import { firstCharacter } from "/assets/instance-nav.js";
|
|
|
24
25
|
import { hroom } from "./hub-room-strings.js";
|
|
25
26
|
import {ha} from "./hub-ai-apps-strings.js";
|
|
26
27
|
import { RoomComposer } from "./hub-room-composer.js";
|
|
27
|
-
import { TextSizeButton } from "/assets/header-tools.js";
|
|
28
|
+
import { TextSizeButton, TEXT_SIZES, setTextSize, textSizeStore } from "/assets/header-tools.js";
|
|
29
|
+
import { useStore } from "/assets/app-store.js";
|
|
30
|
+
import { notifyStore, notifySupport, setNotify } from "/assets/app-needs.js";
|
|
28
31
|
import { HubNotifyToggle } from "./hub-room-notify.js";
|
|
29
32
|
import { createHubButtonActions } from "./hub-button-actions.js";
|
|
30
33
|
import { linkRoomsU2Css } from "./hub-room-new-strings.js";
|
|
31
34
|
import { workingLine } from "./hub-room-working.js";
|
|
32
35
|
import { roomSource, mountSourceAuthor } from "./hub-room-source.js";
|
|
33
36
|
import { countsLine } from "./hub-room-list.js";
|
|
34
|
-
import { PendingFiles, hf, hubFileAttachment, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
|
|
37
|
+
import { DropOverlay, MAX_FILES, PendingFiles, hf, hubFileAttachment, pageCarriesFiles, putBackText, roomTakesFiles, uploadChosen, useFileDrop } from "./hub-attachments.js";
|
|
35
38
|
import { LightboxHost, openLightbox } from "/assets/image-lightbox.js";
|
|
36
39
|
// M-3125 PR3: the one quote target an annotated room picture has (here, so a page with an older dictionary has the words).
|
|
37
40
|
register("hubRoomAnnotate", { en: { quote: "Quote in this room" }, "zh-TW": { quote: "引用到這個房間" } });
|
|
38
41
|
|
|
39
42
|
linkRoomsU2Css(); // M-3127: the reaction chips and picker are drawn from hub-rooms-u2.css (a room opened before any U2 panel)
|
|
43
|
+
/**
|
|
44
|
+
* M-3311 (3): the Fleet chat's 「全寬」 for a Hub conversation — this device's choice (as the Fleet keeps its own), its own key:
|
|
45
|
+
* a Hub page has no Fleet module to share it with.
|
|
46
|
+
*/
|
|
47
|
+
const WIDE_KEY = "agend_hub_chat_wide";
|
|
48
|
+
export function hubChatWide() { try { return localStorage.getItem(WIDE_KEY) === "on"; } catch { return false; } }
|
|
49
|
+
function setHubChatWide(on) { try { if (on) localStorage.setItem(WIDE_KEY, "on"); else localStorage.removeItem(WIDE_KEY); } catch { /* this tab only */ } }
|
|
50
|
+
/** The Fleet chat's narrow screen (panel-chat.js narrowScreen): no 「全寬」 there — the column is the screen's already. */
|
|
51
|
+
const NARROW_QUERY = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
52
|
+
/**
|
|
53
|
+
* M-3311 (#4162 review): the narrow screen, kept current as the window is resized — hub-chat.css hides the header's text size
|
|
54
|
+
* and Notify at this same width, so ⋯ gains (or drops) them at once, not at the next render.
|
|
55
|
+
*/
|
|
56
|
+
function useNarrowScreen() {
|
|
57
|
+
const q = (() => { try { return typeof matchMedia === "function" ? matchMedia(NARROW_QUERY) : null; } catch { return null; } })();
|
|
58
|
+
const [narrow, setNarrow] = useState(() => !!q?.matches);
|
|
59
|
+
useEffect(() => { if (!q) return undefined; const on = () => setNarrow(!!q.matches); on(); q.addEventListener?.("change", on); return () => q.removeEventListener?.("change", on); }, []);
|
|
60
|
+
return narrow;
|
|
61
|
+
}
|
|
62
|
+
/** M-3311 (3): a room message's address — what Copy link copies; opening it shows that message (jumpParam). */
|
|
63
|
+
export const messageLink = (roomId, messageId) => `${location.origin}/ui/hub?room=${encodeURIComponent(roomId)}${messageId ? `&m=${encodeURIComponent(messageId)}` : ""}`;
|
|
64
|
+
/** M-3311 (#4159 review): a room row's Copy link — only a message with an address (a room message's id); otherwise none. */
|
|
65
|
+
export const roomLinkOf = (roomId) => (x) => (x && x.roomMessage ? messageLink(roomId, x.roomMessage) : null);
|
|
40
66
|
/** M-3127 C: the message a search hit opens (`?room=…&m=<id>`), or null. */
|
|
41
67
|
export const jumpParam = () => { try { const v = new URLSearchParams(location.search).get("m"); return v && /^[A-Za-z0-9-]{1,64}$/.test(v) ? v : null; } catch { return null; } };
|
|
42
68
|
const iso = (ms) => (Number.isFinite(ms) && ms > 0 ? new Date(ms).toISOString() : undefined);
|
|
@@ -66,6 +92,7 @@ export function authorLine(author, mine = false, direct = false) {
|
|
|
66
92
|
*/
|
|
67
93
|
const SYSTEM = { "room-created": "createdSys", "member-joined": "sysJoined", "admin-joined": "sysAdminJoined", "poll-closed": "sysPollClosed" };
|
|
68
94
|
export function systemText(m) {
|
|
95
|
+
if(m?.system?.kind==="purpose-changed"&&typeof m.system.purpose==="string"&&typeof m.system.name==="string")return hroom(m.system.purpose?"purposeSetSys":"purposeClearedSys",m.system.name,m.system.purpose);
|
|
69
96
|
if(m?.system?.kind==="app-rate-limited")return ha("rateLimited",m.system.name||"");
|
|
70
97
|
if (m?.system?.kind === "agent-mention-stopped") return agentStopText(m.system) ?? String(m.text || "");
|
|
71
98
|
const key = m && m.system && SYSTEM[m.system.kind];
|
|
@@ -78,7 +105,7 @@ export function systemText(m) {
|
|
|
78
105
|
* child counts as failed.
|
|
79
106
|
*/
|
|
80
107
|
const count = (v) => (Number.isSafeInteger(v) && v > 0 ? v : 0);
|
|
81
|
-
const REASON = { expired: "reasonExpired", unavailable: "reasonUnavailable", interrupted: "reasonInterrupted", retired: "reasonRetired", unknown: "reasonUnknown" };
|
|
108
|
+
const REASON = { "finished-without-answer":"reasonUnanswered",expired: "reasonExpired", unavailable: "reasonUnavailable", interrupted: "reasonInterrupted", retired: "reasonRetired", unknown: "reasonUnknown" };
|
|
82
109
|
export function askReason(code) { return REASON[code] ? hroom(REASON[code]) : ""; }
|
|
83
110
|
export function askState(ask) {
|
|
84
111
|
if (!ask || !Number.isSafeInteger(ask.total) || ask.total < 1) return null;
|
|
@@ -173,7 +200,7 @@ export function toThreadMessages(messages, { meId, ids, direct = false, expanded
|
|
|
173
200
|
...(!direct && Array.isArray(m.reactions) && m.reactions.length ? { reactionBar: reactionBar(m.reactions, { meId, names }) } : {}),
|
|
174
201
|
...(!direct && kind !== "person" && m.buttons ? { buttons: roomButtons(m.buttons, meId) } : {}),
|
|
175
202
|
...(quotedId ? { replyTo: { boot: BOOT, id: num(quotedId), sender: quoted ? authorLine(quoted.author, quoted.author?.id === meId, direct) : "", text: quoted ? String(quoted.text || "").slice(0, 120) : "" } } : {}),
|
|
176
|
-
...(m.stage === "not-answered" ? { text: m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : hroom("noAnswer") } : {}) });
|
|
203
|
+
...(m.stage === "not-answered" ? { text: m.reasonCode === "owner-stopped-sharing" ? hroom("noAnswerStopped", author.owner?.name || "") : m.reasonCode==="finished-without-answer"?hroom("noAnswerUnanswered"):hroom("noAnswer") } : {}) });
|
|
177
204
|
if (foldAfter) out.push({ boot: BOOT, id: num(`expand:${foldAfter.arg}`), role: "status", sender: "", text: "", bare: true, fold: true, action: foldAfter });
|
|
178
205
|
// Spec §10: once an @所有 Agent has answers, under the last one shown, 「請房間助理整理」 (it sends 「@房間助理 整理上面的回答」).
|
|
179
206
|
if (summarise && lastShown && byId.get(m.answerTo)?.mentions?.includes("all"))
|
|
@@ -385,12 +412,20 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
385
412
|
useEffect(() => { const id = detail && detail.me && detail.me.id; if (id) onMe(roomId, id); }, [detail && detail.me && detail.me.id]);
|
|
386
413
|
// M-3125: Attach only where this page and this room carry files and the room is open; chosen files ride the next send.
|
|
387
414
|
const takesFiles = pageCarriesFiles(client, store) && roomTakesFiles(room) && !store.closed();
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
415
|
+
// M-3311: `left` (what still fits) and `notice` serve a paste and a drop as the Fleet chat's (hub-attachments.js pasteToAttach).
|
|
416
|
+
const attach = takesFiles ? { title: hf("attach"), left: () => MAX_FILES - filesRef.current.length, notice: (text) => { if (alive.current) toast(text); },
|
|
417
|
+
onFiles: async (list) => {
|
|
418
|
+
setFileMsg("");
|
|
419
|
+
const refused = await uploadChosen(client, room.id || roomId, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
|
|
420
|
+
if (alive.current && refused.length) setFileMsg(refused.join(" "));
|
|
421
|
+
return refused;
|
|
422
|
+
} } : null;
|
|
423
|
+
// M-3311 (1): a file dragged onto the conversation is attached, as in the Fleet chat.
|
|
424
|
+
const mainRef = useRef(null);
|
|
425
|
+
useFileDrop(mainRef, attach);
|
|
426
|
+
// M-3311 (3): a long paste's chip — 「改為文字」 puts its text back into the box (the Fleet chat's), and the chip goes.
|
|
427
|
+
const asText = (key) => { const f = filesRef.current.find((x) => x.key === key); if (!f) return; setFiles(filesRef.current.filter((x) => x.key !== key)); putBackText(input.current, f.text); input.current?.focus(); };
|
|
428
|
+
const pending = files.length || fileMsg ? html`<${PendingFiles} files=${files} onAsText=${asText} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
|
|
394
429
|
formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />${fileMsg ? html`<p class="note" role="alert">${fileMsg}</p>` : null}` : null;
|
|
395
430
|
// The composer sends through the store; this one adds the ready files, waits for uploads, and clears only what was sent.
|
|
396
431
|
const annotateRef = useRef(null);
|
|
@@ -467,7 +502,25 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
467
502
|
// composer's files (uploaded like any chosen file) and the reply quotes the message it came from. Read at click time
|
|
468
503
|
// (the thread keeps its options from its first render).
|
|
469
504
|
openImage: (links, img) => openLightbox(links, img, annotateRef.current(img)),
|
|
505
|
+
// M-3311 (2): 「引用」 on a selected passage goes into this room's box (read at selection time).
|
|
506
|
+
quote: { field: () => input.current, can: () => !store.closed() },
|
|
507
|
+
// M-3311 (3): the Fleet chat's Copy link — a room message's address (opening it shows that message).
|
|
508
|
+
linkOf: roomLinkOf(roomId),
|
|
470
509
|
};
|
|
510
|
+
// M-3311 (3): the header's menu — a group room's Room settings and Leave, and on a desk the Fleet chat's 「全寬」 for any room.
|
|
511
|
+
const [fullWidth, setFullWidth] = useState(hubChatWide);
|
|
512
|
+
const textSize = useStore(textSizeStore), notify = useStore(notifyStore), narrow = useNarrowScreen();
|
|
513
|
+
const menuItems = [
|
|
514
|
+
group && detail?.me?.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
|
|
515
|
+
group && detail?.me ? { key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } } : null,
|
|
516
|
+
!narrow && detail?.me ? { key: "fullWidth", checkbox: true, checked: fullWidth, label: t("chat.fullWidth"), onSelect: () => { setHubChatWide(!fullWidth); setFullWidth(!fullWidth); } } : null,
|
|
517
|
+
// M-3311 (4): a phone's header is one row (back, the room, members, ⋯) as the Fleet chat's — its text size and Notify
|
|
518
|
+
// move into ⋯ there (hub-chat.css hides the two buttons at the same width).
|
|
519
|
+
...(narrow ? [
|
|
520
|
+
{ key: "textSize", label: t("app.textSize", t(`app.textSize_${textSize.size}`)), icon: "type", onSelect: () => setTextSize(TEXT_SIZES[(TEXT_SIZES.indexOf(textSize.size) + 1) % TEXT_SIZES.length]) },
|
|
521
|
+
...(notifySupport() === "ok" ? [{ key: "notify", checkbox: true, checked: notify.state === "on", disabled: notify.asking, label: hroom("notifyTitle"), onSelect: () => { void setNotify(notify.state !== "on"); } }] : []),
|
|
522
|
+
] : []),
|
|
523
|
+
].filter(Boolean);
|
|
471
524
|
const line2 = group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
|
|
472
525
|
: room.assistant ? hroom("providedByHub") : room.agent?.answerOnly ? hp("answerOnlyAsker") : String(room.agent?.owner?.name || "");
|
|
473
526
|
const showRail = wide && rail && Panel && group && detail;
|
|
@@ -478,22 +531,20 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
|
|
|
478
531
|
onMention=${(m) => { setSheet(false); insert.current?.(`@${m.name}`); }}
|
|
479
532
|
onOpenChat=${(m) => { const direct = rooms.find((r) => r.kind === "direct" && r.agent?.exposureId === m.id); if (direct) openRoom(direct.id); }}
|
|
480
533
|
onSettings=${() => { setSheet(false); openSettings(); }} />` : null;
|
|
481
|
-
return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId}>
|
|
534
|
+
return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId} data-width=${fullWidth ? "full" : undefined}>
|
|
482
535
|
<${LightboxHost} />
|
|
483
|
-
<section class="hub-chat-main">
|
|
536
|
+
<section class="hub-chat-main" ref=${mainRef}>
|
|
537
|
+
${attach ? html`<${DropOverlay} />` : null}
|
|
484
538
|
<header class=${`hub-chat-head${room.agent?.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">
|
|
485
539
|
${/* Lumen (spec §2): on a phone the header starts with the Fleet chat's back to the list. */ ""}
|
|
486
540
|
<a class="icon-btn hub-back only-narrow" href="/ui/hub" aria-label=${t("hub.back")} title=${t("hub.back")}
|
|
487
541
|
onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); goList(); }}><${Icon} name="back" /></a>
|
|
488
542
|
<span class=${`av${group ? " av-square" : ""}`} aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>
|
|
489
|
-
<span class="hub-chat-title"><strong>${title}</strong
|
|
543
|
+
<span class="hub-chat-title"><strong>${title}</strong>${group&&typeof room.purpose==="string"?html`<${RoomPurposeHeader} purpose=${room.purpose} onEdit=${detail?.me?.role==="manager"&&client.roomPurposeV1===true?openSettings:undefined} />`:null}<span class=${`s${room.agent?.answerOnly?" hub-answer-only-note":""}`}>${line2}</span>${room.assistant||room.agent?.intro?html`<span class="s hub-agent-intro-line">${room.assistant?hi("assistant"):room.agent.intro}</span>`:null}</span>
|
|
490
544
|
<span class="hub-head-tools"><${TextSizeButton} /><${HubNotifyToggle} /></span>
|
|
491
545
|
${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")}
|
|
492
546
|
onClick=${() => (wide ? setRail(!rail) : setSheet(true))}><${Icon} name="team" size=${18} /></button>` : null}
|
|
493
|
-
${
|
|
494
|
-
detail.me.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
|
|
495
|
-
{ key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } },
|
|
496
|
-
].filter(Boolean)} />` : null}
|
|
547
|
+
${menuItems.length ? html`<${Menu} cls="hub-room-menu" label=${hroom("menu")} fit=${true} ownerKey=${roomId} items=${menuItems} />` : null}
|
|
497
548
|
</header>
|
|
498
549
|
${leaveError ? html`<p class="err hub-room-leave-err" role="alert">${leaveError}</p>` : null}
|
|
499
550
|
${room.closureReason === "owner-stopped-sharing" ? html`<p class="note" role="status">${hroom("noAnswerStopped", room.ownerName || room.agent?.owner?.name || "")}</p>` : null}
|
package/dist/ui/panel-chat.js
CHANGED
|
@@ -722,7 +722,9 @@ function useMedia(query) {
|
|
|
722
722
|
/** M-3167: the model's short name for the composer's chip on a desk ("Opus 5.5 (claude-opus-5-5)" → "Opus 5.5"). */
|
|
723
723
|
export function shortModelName(label) {
|
|
724
724
|
const s = String(label || "").replace(/\s*\([^)]*\)\s*$/, "").trim();
|
|
725
|
-
|
|
725
|
+
// M-3304: a version is one or two digits each (`5`, `5-5`); a dated id's date is not a minor version —
|
|
726
|
+
// "claude-sonnet-6-20270101" is "Sonnet 6" (was "Sonnet 6.20270101"), "claude-opus-5-5-20261201" "Opus 5.5".
|
|
727
|
+
const family = /^claude-(opus|sonnet|haiku|fable)-(\d{1,2})(?:-(\d{1,2}))?(?![\d.])/i.exec(s);
|
|
726
728
|
if (family) return `${family[1][0].toUpperCase()}${family[1].slice(1).toLowerCase()} ${family[2]}${family[3] ? `.${family[3]}` : ""}`;
|
|
727
729
|
return s;
|
|
728
730
|
}
|
|
@@ -1087,12 +1089,24 @@ function ModelMenu({ name, c, lease }) {
|
|
|
1087
1089
|
// A desk: under the control that opened it (else above the box's left end); a click outside closes it.
|
|
1088
1090
|
const place = (el) => {
|
|
1089
1091
|
if (!el) return;
|
|
1090
|
-
const at = modelMenuAnchor, w = el.offsetWidth || 320
|
|
1092
|
+
const at = modelMenuAnchor, w = el.offsetWidth || 320;
|
|
1091
1093
|
const vw = globalThis.innerWidth || 1280, vh = globalThis.innerHeight || 800; // (a test DOM has no viewport)
|
|
1092
1094
|
let left, top;
|
|
1093
|
-
//
|
|
1094
|
-
|
|
1095
|
-
|
|
1095
|
+
// M-3304 (the user, beta.11): under the control — or above it when it sits in the lower half (the composer's chip) — and
|
|
1096
|
+
// never over it: a list longer than the room there scrolls within the menu (its height capped to that room), instead
|
|
1097
|
+
// of the menu moving up over the control and the header. Its left at the control's (kept in the viewport).
|
|
1098
|
+
if (at) {
|
|
1099
|
+
const up = at.top > vh / 2, room = Math.max(160, Math.floor(up ? at.top - 6 - 8 : vh - at.bottom - 6 - 8));
|
|
1100
|
+
el.style.setProperty("max-height", `${room}px`);
|
|
1101
|
+
const h = Math.min(el.offsetHeight || 0, room);
|
|
1102
|
+
left = Math.min(Math.max(8, at.left), vw - w - 8);
|
|
1103
|
+
top = up ? Math.max(8, at.top - 6 - h) : at.bottom + 6;
|
|
1104
|
+
} else {
|
|
1105
|
+
const box = el.closest(".p-chat")?.querySelector(".composer-box")?.getBoundingClientRect();
|
|
1106
|
+
el.style.setProperty("max-height", `${Math.max(160, Math.floor((box ? box.top : vh) - 16))}px`);
|
|
1107
|
+
const h = el.offsetHeight || 0;
|
|
1108
|
+
left = box ? box.left : 16; top = box ? Math.max(8, box.top - h - 8) : 72;
|
|
1109
|
+
}
|
|
1096
1110
|
el.style.setProperty("left", `${Math.round(left)}px`); el.style.setProperty("top", `${Math.round(top)}px`);
|
|
1097
1111
|
};
|
|
1098
1112
|
return html`<div class="model-menu-scrim" onClick=${close}></div><div class="model-menu-pop" ref=${(el) => { pop.current = el; place(el); }} onKeyDown=${onKeys}>${body}</div>`;
|
package/dist/ui/panel-hub.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IntroNotice, introNoticeOffered } from "./hub-intro-notice.js";
|
|
1
2
|
import { AgentIntroEditor, hi } from "./hub-agent-intro.js";
|
|
2
3
|
import {hp,personalAgentQuestionHint} from "./hub-personal-agent-strings.js";
|
|
3
4
|
import * as ownerEntryWords from "./hub-owner-strings.js";
|
|
@@ -55,7 +56,8 @@ import { createHubChatStore } from "./hub-chat-store.js";
|
|
|
55
56
|
import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quota.js";
|
|
56
57
|
import { PageHead } from "/assets/page-head.js";
|
|
57
58
|
import { bindRoomFeedback, bootHubPreview, downloadHtml, draftWithLine, panelOpenFor, roomPanelKey, roomPanelOpts, setHubPreviewOptIn } from "./hub-preview.js";
|
|
58
|
-
import { PendingFiles, hf, pageCarriesFiles, roomTakesFiles, uploadChosen } from "./hub-attachments.js";
|
|
59
|
+
import { DropOverlay, MAX_FILES, PendingFiles, hf, pageCarriesFiles, pasteToAttach, putBackText, roomTakesFiles, uploadChosen, useFileDrop } from "./hub-attachments.js";
|
|
60
|
+
import { composerCaret, insertQuote, installQuoteSelection, showCaret } from "/assets/chat-quote.js";
|
|
59
61
|
register("hubAccess", {
|
|
60
62
|
en: { tag: "Access needs checking", refused: "Asking was refused. Check your access before trying again.", check: "Check access", limited: "Asking was refused; the previous access information needs checking." },
|
|
61
63
|
"zh-TW": { tag: "需要確認權限", refused: "提問遭到拒絕。請先重新檢查權限,再試一次。", check: "重新檢查權限", limited: "提問遭到拒絕,先前的權限資訊需要重新確認。" },
|
|
@@ -209,8 +211,8 @@ export function HubPanel({ route }) {
|
|
|
209
211
|
if (s && tab === "ask" && view === "notices" && noticesOffered(s)) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-notices">
|
|
210
212
|
<${PanelHeader} title=${hc("noticesTitle")}><span class="hub-head-tools"><${HubNotifyToggle} /></span></${PanelHeader}><div data-trust="panel-content" class="panel-body hub-page-body">
|
|
211
213
|
<div class="col hub-owner hub-notices-col"><p class="s-page-lead hub-page-lead">${roleNoticesOffered(s, hubClient()) ? roleNoticeLead() : directoryNoticesOffered(s, hubClient()) ? dn("pageLead") : hc("noticesLead")}</p>
|
|
212
|
-
${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
|
|
213
|
-
${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}${roleNoticesOffered(s, hubClient()) ? html`<${RoleNotices} client=${hubClient()} />` : null}</div></div></div>`;
|
|
214
|
+
${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${introNoticeOffered(s,hubClient()) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
|
|
215
|
+
${introNoticeOffered(s,hubClient())?html`<${IntroNotice} client=${hubClient()} />`:null}${directoryNoticesOffered(s, hubClient()) ? html`<${DirectoryNotices} client=${hubClient()} />` : null}${roleNoticesOffered(s, hubClient()) ? html`<${RoleNotices} client=${hubClient()} />` : null}</div></div></div>`;
|
|
214
216
|
// M-3092: the owner's invitations (spec §8), a page of the chats like Notices.
|
|
215
217
|
if (s && tab === "ask" && view === "invitations" && roomsLive()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-invitations">
|
|
216
218
|
<${PanelHeader} title=${hroom("invitationsTitle")} /><div data-trust="panel-content" class="panel-body hub-page-body"><div class="col hub-owner">
|
|
@@ -384,7 +386,7 @@ export const NOTICES_PATH = "/ui/hub?view=notices";
|
|
|
384
386
|
export const INVITATIONS_PATH = "/ui/hub?view=invitations";
|
|
385
387
|
export const MY_TEAMS_PATH = "/ui/hub?view=teams";
|
|
386
388
|
const pairingNoticesOffered = (s) => !!s && Array.isArray(s.features) && s.features.includes("quick-pairing-v1") && !!hubClient().quickPairingV1;
|
|
387
|
-
const noticesOffered = s => pairingNoticesOffered(s) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient());
|
|
389
|
+
const noticesOffered = s => introNoticeOffered(s,hubClient()) || pairingNoticesOffered(s) || directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient());
|
|
388
390
|
const initial = (name) => (String(name || "?").trim()[0] || "?").toUpperCase();
|
|
389
391
|
const AV_TONES = 6;
|
|
390
392
|
const tone = (name) => { let h = 0; for (const c of String(name || "")) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % AV_TONES; };
|
|
@@ -476,7 +478,7 @@ export function HubSide({ onPick } = {}) {
|
|
|
476
478
|
${/* M-3190 (Argon): 新對話 and 新房間 head the conversation list, not the primary rows. */ ""}
|
|
477
479
|
<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} foot=${roomsLive()}
|
|
478
480
|
onNew=${() => { if (onPick) onPick(); navigate(NEW_CHAT_PATH); }} onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
|
|
479
|
-
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
481
|
+
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
|
|
480
482
|
onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
|
|
481
483
|
}
|
|
482
484
|
|
|
@@ -523,7 +525,7 @@ function HubHomeList() {
|
|
|
523
525
|
const filter = useRef(null);
|
|
524
526
|
return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} home=${true} onNew=${() => navigate(NEW_CHAT_PATH)}
|
|
525
527
|
onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
|
|
526
|
-
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
528
|
+
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
|
|
527
529
|
onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
|
|
528
530
|
}
|
|
529
531
|
|
|
@@ -655,7 +657,7 @@ function ChatLauncher() {
|
|
|
655
657
|
<div class="hub-launch-actions">${roomsLive() && rs.me?.canCreateRooms ? html`<button type="button" class="btn btn-primary hub-launch-pill" onClick=${() => setNewRoom(true)}><${Icon} name="room" size=${16} />${hc("launchNewRoom")}</button>` : null}
|
|
656
658
|
<a class="btn hub-launch-pill" href="/ui/hub/exposures" onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); navigate("/ui/hub/exposures"); }}><${Icon} name="globe" size=${16} />${hc("launchShare")}</a></div></section>` : null}
|
|
657
659
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
658
|
-
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant,
|
|
660
|
+
${newRoom ? html`<${LazyRoomPart} load=${() => import("./hub-room-new.js")} name="NewRoomDialog" props=${{ client: hubClient(), assistant: !!rs.me?.assistant, purposeSupported: roomPurposeLive(),
|
|
659
661
|
onClose: () => setNewRoom(false), onOpenRoom: (rid) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(rid)); } }} />` : null}`;
|
|
660
662
|
return html`<div class="hub-launch">${groupPolicyOn(s, hubClient())
|
|
661
663
|
? html`<${LazyGroups} pick=${(m) => m.ChatLauncherFrame || (({ children }) => children)} props=${{ admin: s.admin === true, features: s.features, children: list }} />` : list}</div>`;
|
|
@@ -775,12 +777,20 @@ function HubRoomView({ room: given }) {
|
|
|
775
777
|
const sent = new Set(chosen.map((f) => f.key));
|
|
776
778
|
setDraft(""); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); refreshRooms();
|
|
777
779
|
};
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
780
|
+
// M-3311: a paste (#4151 review: this composer's was empty) and a drop attach as the Fleet chat's — `left` and `notice` for them.
|
|
781
|
+
const attach = takesFiles ? { title: hf("attach"), left: () => MAX_FILES - filesRef.current.length, notice: (text) => { if (alive.current) toast(text); },
|
|
782
|
+
onFiles: async (list) => {
|
|
783
|
+
setMsg(null);
|
|
784
|
+
const refused = await uploadChosen(client, room.id, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
|
|
785
|
+
if (!alive.current) return refused;
|
|
786
|
+
if (refused.length) setMsg(refused.join(" "));
|
|
787
|
+
return refused;
|
|
788
|
+
} } : null;
|
|
789
|
+
const mainRef = useRef(null);
|
|
790
|
+
useFileDrop(mainRef, attach);
|
|
791
|
+
// M-3311 (2): 「引用」 on a selected passage goes into this question's box (the thread reads it at selection time; the box is
|
|
792
|
+
// there only while the conversation is open).
|
|
793
|
+
const askExtra = useMemo(() => ({ quote: { field: () => input.current } }), []);
|
|
784
794
|
const onKeyDown = (e) => { if (globalThis.AgendChatRender?.composerKey(e, { touch: touchScreen() }) === "send") { e.preventDefault(); send(); } };
|
|
785
795
|
const toggleInfo = () => {
|
|
786
796
|
if (!wide) { setSheet(true); return; }
|
|
@@ -795,14 +805,15 @@ function HubRoomView({ room: given }) {
|
|
|
795
805
|
// The panel takes the info rail's place while it shows a page (the rail's button brings the rail back).
|
|
796
806
|
const showRail = wide && rail && !panelOpen;
|
|
797
807
|
return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`} ref=${split}>
|
|
798
|
-
<section class="hub-chat-main" aria-label=${name}>
|
|
808
|
+
<section class="hub-chat-main" aria-label=${name} ref=${mainRef}>
|
|
809
|
+
${attach ? html`<${DropOverlay} />` : null}
|
|
799
810
|
<header class=${`hub-chat-head${room.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">${back}<${Avatar} name=${name} size="sm" />
|
|
800
811
|
<span class="hub-chat-title"><strong>${name}</strong><span class=${`s${room.answerOnly?" hub-answer-only-note":""}`}>${room.answerOnly?hp("answerOnlyAsker"):room.ownerName ? hc("answersFor", room.ownerName) : ""}</span>${room.intro?html`<span class="s hub-agent-intro-line">${room.intro}</span>`:null}</span>
|
|
801
812
|
${tag}
|
|
802
813
|
<button type="button" class="icon-btn" aria-pressed=${wide ? String(showRail) : undefined} aria-label=${hc("showInfo")} title=${hc("showInfo")} onClick=${toggleInfo}><${Icon} name="info" /></button>
|
|
803
814
|
<span class="hub-head-tools"><${TextSizeButton} /></span>
|
|
804
815
|
</header>
|
|
805
|
-
<${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
|
|
816
|
+
<${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} extra=${askExtra} />
|
|
806
817
|
<div class="dock hub-dock" data-trust="composer"><div class="dock-col">
|
|
807
818
|
${closed ? html`<p class="hub-banner danger" role="status">${hc("closed")}</p>` : null}
|
|
808
819
|
${frozen ? html`<p class="hub-banner warn" role="status">${paused ? t("hubSharing.pausedChat", name) : hc("frozen", name)}</p>` : null}
|
|
@@ -812,12 +823,13 @@ function HubRoomView({ room: given }) {
|
|
|
812
823
|
${!closed && !frozen && !denied && !takesFiles ? html`<p class="note hub-files-off" role="status">${hf(pageFiles ? "off" : "reload")}</p>` : null}
|
|
813
824
|
${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
|
|
814
825
|
${closed ? null : html`<div class="composer-box"><${PendingFiles} files=${files} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
|
|
826
|
+
onAsText=${(key) => { const f = filesRef.current.find((x) => x.key === key); if (!f) return; setFiles(filesRef.current.filter((x) => x.key !== key)); putBackText(input.current, f.text); input.current?.focus(); }}
|
|
815
827
|
formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />
|
|
816
828
|
<${ComposerInput} inputRef=${input} value=${draft} placeholder=${hc("composer", name)} onValue=${setDraft}
|
|
817
|
-
onKeyDown=${onKeyDown} onPaste=${() => {}} attach=${attach}
|
|
829
|
+
onKeyDown=${onKeyDown} onPaste=${(e) => { if (!frozen && !denied) pasteToAttach(e, attach); }} attach=${attach}
|
|
818
830
|
stop=${{ hidden: true, disabled: true, title: hc("stop"), label: hc("stop"), onClick: () => {} }}
|
|
819
831
|
send=${{ hidden: false, disabled: !draft.trim() || sending || frozen || denied || uploading, label: hc("send"), onClick: send }} /></div>`}
|
|
820
|
-
${closed ? null : html`<div class="composer-row"><span class="hint hub-identity">${hw("roomNote")}</span></div>`}
|
|
832
|
+
${closed ? null : html`<div class="composer-row hub-hints"><span class="hint hub-enter-hint">${t(touchScreen() ? "chat.nativeComposerHintTouch" : "chat.nativeComposerHint")}</span><span class="hint hub-identity">${hw("roomNote")}</span></div>`}
|
|
821
833
|
</div></div>
|
|
822
834
|
</section>
|
|
823
835
|
<${PreviewPanel} name=${panelKey} split=${split} msgs=${() => store.messages()} subscribe=${(fn) => store.subscribe(() => fn(panelKey, "msgs"))}
|
|
@@ -894,9 +906,37 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
|
|
|
894
906
|
reply: (x) => ex.startReply?.(x),
|
|
895
907
|
// React opens the thread's picker for that message (extra.react is the thread's own add/remove call, with an emoji).
|
|
896
908
|
...(typeof ex.react === "function" ? { react: (x) => thread.pickReaction?.(msgKey(x)), canReact: (x) => !!x.roomMessage && ex.canReact?.(x) !== false, reactLabel: ex.reactLabel } : {}),
|
|
909
|
+
// M-3311 (3): Copy link where the page gives a message an address (a room: extra.linkOf).
|
|
910
|
+
...(typeof ex.linkOf === "function" ? { linkOf: (x) => ex.linkOf(x) } : {}),
|
|
897
911
|
});
|
|
912
|
+
// M-3311 (2): the Fleet chat's 「引用」 — a passage selected in one message goes into this conversation's composer as a quote
|
|
913
|
+
// at the caret (chat-quote.js; panel-chat.js's own install), through the box's typing path. `extra.quote.field()`: the box.
|
|
914
|
+
const q = ex.quote;
|
|
915
|
+
const phone = () => typeof matchMedia === "function" && matchMedia("(pointer: coarse)").matches;
|
|
916
|
+
const offQuote = q ? installQuoteSelection(list, {
|
|
917
|
+
field: () => q.field(), canQuote: () => !!q.field() && q.can?.() !== false, phone,
|
|
918
|
+
composerBox: () => q.field()?.closest?.(".composer-box") || null, threadBox: () => sc,
|
|
919
|
+
insert: (text) => {
|
|
920
|
+
const field = q.field(); if (!field) return;
|
|
921
|
+
const value = field.value || "";
|
|
922
|
+
// The caret where the person left it in the box (kept when it lost the focus); never touched: the end.
|
|
923
|
+
const caret = field.dataset.touched === "1" ? composerCaret(field, value) : value.length;
|
|
924
|
+
const r = insertQuote(value, caret, text); if (!r) return;
|
|
925
|
+
const set = typeof HTMLTextAreaElement === "function" ? Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set : null;
|
|
926
|
+
if (set) set.call(field, r.value); else field.value = r.value;
|
|
927
|
+
field.dispatchEvent(new Event("input", { bubbles: true }));
|
|
928
|
+
// After the box redraws: the caret after the quote, in view. A phone keeps its keyboard down.
|
|
929
|
+
setTimeout(() => {
|
|
930
|
+
if (q.field() !== field) return;
|
|
931
|
+
field.dataset.touched = "1";
|
|
932
|
+
try { field.setSelectionRange(r.caret, r.caret); } catch { /* not a text field */ }
|
|
933
|
+
if (!phone()) field.focus();
|
|
934
|
+
showCaret(field, r.caret);
|
|
935
|
+
}, 0);
|
|
936
|
+
},
|
|
937
|
+
}) : () => {};
|
|
898
938
|
return () => {
|
|
899
|
-
offActions();
|
|
939
|
+
offActions(); offQuote();
|
|
900
940
|
paging = false;
|
|
901
941
|
off(); offOpt(); offPanel(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick);
|
|
902
942
|
thread.dispose(true); list.remove(); th.current = null; if (threadRef && threadRef.current === thread) threadRef.current = null;
|
|
@@ -958,6 +998,7 @@ function readActivity(exposureId) {
|
|
|
958
998
|
() => ({ ok: false, code: "unreachable" }));
|
|
959
999
|
}
|
|
960
1000
|
function HubMine() {
|
|
1001
|
+
const introSession=useSession();
|
|
961
1002
|
useStore(navStore); // ?agent= changes without a new route
|
|
962
1003
|
const [cat, reload] = useRead(() => hubClient().catalog());
|
|
963
1004
|
const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
|
|
@@ -1003,6 +1044,7 @@ function HubMine() {
|
|
|
1003
1044
|
${p.ownerConfirmed ? html`<span class="tag ok">${hw("confirmed")}</span>` : html`<button type="button" class="btn btn-sm btn-primary" onClick=${() => confirmPairing(p)}>${hw("confirmPairing")}</button>`}
|
|
1004
1045
|
</div>`)}</div></section>` : null}
|
|
1005
1046
|
${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
|
|
1047
|
+
${introNoticeOffered(introSession,hubClient())?html`<${IntroNotice} client=${hubClient()} />`:null}
|
|
1006
1048
|
${modernSharing ? html`<${LazyRoomPart} load=${() => import("./hub-my-agents.js")} name="HubMyAgents" props=${{ client: hubClient(), scope: session.csrf, shared: mine, policy: groupPolicyOn(session, hubClient()), personal: session.features.includes("personal-agents-v1"), apps: session.features.includes("mcp-apps-v1"), pausable: session.features.includes("sharing-pause-v1"), subjects: session.features.includes("grant-subjects-v1"), onChanged: reload, onAllow: setAllowTarget }} />` : null}
|
|
1007
1049
|
${!modernSharing && cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
|
|
1008
1050
|
${!modernSharing && mine.length ? html`<section class="card hub-shared"><h3>${ho(mine.some(e => e.kind === "personal") ? "yourAgentsCount" : "sharedCount", mine.length)}</h3>
|
|
@@ -1176,6 +1218,7 @@ function LazyRoomPart({ load, name, props = {} }) {
|
|
|
1176
1218
|
return C ? html`<${C} ...${props} />` : null;
|
|
1177
1219
|
}
|
|
1178
1220
|
const teamsLive = () => { const c = hubClient(); return typeof c.teamsLive === "function" && c.teamsLive() === true; };
|
|
1221
|
+
const roomPurposeLive=()=>session?.features?.includes("room-purpose-v1")&&hubClient().roomPurposeV1===true;
|
|
1179
1222
|
const roomsLive = () => { const c = hubClient(); return typeof c.roomsLive === "function" && c.roomsLive() === true; };
|
|
1180
1223
|
function LazyThisHub({ directory }) {
|
|
1181
1224
|
const [C, setC] = useState(null);
|
|
@@ -119,7 +119,7 @@ register("app", {
|
|
|
119
119
|
confirmTitle: "Please confirm", confirmOk: "Continue", cancel: "Cancel",
|
|
120
120
|
sidePanelLeave: "Leave {0} without saving? Your changes there will be lost.", sidePanelDiscard: "Discard changes",
|
|
121
121
|
// The server's own wording (src/locale.ts needs.reason.*), so the web says what Discord says.
|
|
122
|
-
needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
|
|
122
|
+
needs_reason_kiro_choice: "Kiro needs your decision", needs_reason_hang: "Not responding", needs_reason_exited: "Exited", needs_reason_assist: "Waiting at its terminal", needs_reason_question: "Asking you a question", needs_reason_permission: "Permission needed", needs_reason_dangerous_command: "Dangerous command waiting", needs_reason_login: "Waiting to connect its AI account", needs_reason_dialog: "Waiting at a dialog", needs_reason_terminal_input: "May be waiting for input", needs_reason_auth_paused: "Paused: AI account not connected", needs_reason_backend_signin: "AI account needs connecting", needs_reason_config_invalid: "Configuration file needs attention", needs_reason_hub_proposal: "Hub action proposed: review locally", needs_reason_hub_execution_hold: "Hub work held: review locally", needs_reason_hub_unavailable: "Hub not running", needs_reason_config_fallback: "Running on stored configuration", config_history_edit: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. The next restart would use the stored valid copy from {4}. Correct the YAML error; the file has not been changed by AgEnD.", config_history_no_history: "{0}, line {1}, column {2}: {3}. AgEnD is still running on the previous settings. No stored valid copy is available, so the next restart cannot recover automatically. Correct the YAML error before restarting; the file has not been changed by AgEnD.", config_history_fallback: "{0}, line {1}, column {2}: {3}. AgEnD started using the stored valid copy from {4}. Correct the YAML error and reload the settings. The file on disk has not been changed by AgEnD.", needs_reason_general_windows_offline: "General’s Windows PC is offline", needs_reason_general_location_hold: "Run General on", needs_reason_native_pane_hold: "Windows agent needs attention", needs_reason_model_switch: "Claude model switched", needs_reason_crashed: "Crashed", needs_reason_backend_missing: "AI CLI not installed", needs_reason_usage_limit: "Usage limit reached · reset time unknown", needs_reason_delivery_uncertain: "Could not confirm delivery", needs_reason_delivery_failed: "Delivery failed", needs_reason_missed_offline: "Missed while AgEnD was offline", needs_reason_task_review: "Waiting for your confirmation", needs_reason_task_blocked: "Blocked: asks you", needs_reason_task_stalled: "Its assignee went quiet",
|
|
123
123
|
},
|
|
124
124
|
"zh-TW": {
|
|
125
125
|
brand: "AgEnD", fleet: "Fleet", fleetOverview: "Fleet 概覽", view: "檢視", settings: "設定", instances: "Agent", newInstance: "新增 Agent", newAgent: "新增 Agent",
|
|
@@ -167,6 +167,6 @@ register("app", {
|
|
|
167
167
|
search: "搜尋", searchTitle: "搜尋聊天、agent 之間的訊息與任務({0})",
|
|
168
168
|
confirmTitle: "請確認", confirmOk: "繼續", cancel: "取消",
|
|
169
169
|
sidePanelLeave: "不儲存就離開「{0}」?你在那裡的修改會遺失。", sidePanelDiscard: "捨棄修改",
|
|
170
|
-
needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
|
|
170
|
+
needs_reason_kiro_choice: "Kiro 需要你決定", needs_reason_hang: "沒有回應", needs_reason_exited: "已結束", needs_reason_assist: "在終端機上等待", needs_reason_question: "正在問你問題", needs_reason_permission: "需要權限", needs_reason_dangerous_command: "危險指令待確認", needs_reason_login: "等待連接 AI 帳號", needs_reason_dialog: "停在對話框", needs_reason_terminal_input: "可能在等輸入", needs_reason_auth_paused: "已暫停:AI 帳號未連接", needs_reason_backend_signin: "需要連接 AI 帳號", needs_reason_config_invalid: "設定檔需要處理", needs_reason_hub_proposal: "Hub 提議操作:請在本機檢視", needs_reason_hub_execution_hold: "Hub 工作已暫停:請在本機檢視", needs_reason_hub_unavailable: "Hub 未在執行", needs_reason_config_fallback: "正在使用儲存的設定副本", config_history_edit: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。下次重新啟動會改用 {4} 儲存的有效副本。請修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_no_history: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 仍使用先前的設定執行。沒有可用的有效副本,下次重新啟動將無法自動恢復。請在重新啟動前修正 YAML 錯誤;AgEnD 未更動此檔案。", config_history_fallback: "{0} 第 {1} 行、第 {2} 欄:{3}。AgEnD 已使用 {4} 儲存的有效副本啟動。請修正 YAML 錯誤並重新載入設定。AgEnD 未更動磁碟上的檔案。", needs_reason_general_windows_offline: "General 所在的 Windows 電腦已離線", needs_reason_general_location_hold: "General 執行位置", needs_reason_native_pane_hold: "Windows Agent 需要處理", needs_reason_model_switch: "Claude 模型已切換", needs_reason_crashed: "已崩潰", needs_reason_backend_missing: "AI CLI 沒有安裝", needs_reason_usage_limit: "用量已達上限 · 恢復時間未知", needs_reason_delivery_uncertain: "無法確認是否送達", needs_reason_delivery_failed: "傳送失敗", needs_reason_missed_offline: "AgEnD 離線時錯過", needs_reason_task_review: "等你確認", needs_reason_task_blocked: "卡住,在問你", needs_reason_task_stalled: "接手者很久沒有動靜",
|
|
171
171
|
},
|
|
172
172
|
});
|
|
@@ -690,6 +690,8 @@ register("pendingSummary", {
|
|
|
690
690
|
"host_cli.install_confirm": "Install {0} on the AgEnD host",
|
|
691
691
|
"host_cli.update": "Update {0} on the AgEnD computer to {1}, the release AgEnD has audited (the registry's update command, run unattended). Only this CLI changes; nothing the page sent is run.",
|
|
692
692
|
"host_cli.update_latest": "Update {0} on the AgEnD computer to the LATEST release (not audited by AgEnD): the registry's update command for this CLI, run unattended; the CLI's own updater cannot choose a release. Only this CLI changes; nothing the page sent is run.",
|
|
693
|
+
"host_cli.native_switch": "Switch Claude Code on the AgEnD computer from its npm install to Claude's native install: run claude.ai/install.sh for {0}, the release AgEnD has audited (unattended). The npm copy stays until you remove it in a separate step.",
|
|
694
|
+
"host_cli.npm_remove": "Remove the npm copy of Claude Code from the AgEnD computer (npm -g uninstall @anthropic-ai/claude-code, in that copy's own npm prefix). Only after `claude` already runs from the native install.",
|
|
693
695
|
"runtime_cli.install": "Install {0} {1} on the paired Windows computer {2}: the version AgEnD pins, checked on that computer (its pinned hashes, the registry's signatures, the publisher's signature). Only this CLI is installed; nothing the page sent is run. That computer's owner's own switch still has to allow it.",
|
|
694
696
|
"runtime_cli.update_latest": "If {0} is already on the paired Windows computer {1}, this updates it to the vendor's LATEST release (not audited by AgEnD): the Runtime downloads the release the vendor's own manifest names and checks its checksum and the publisher's signature on that computer before switching to it.",
|
|
695
697
|
"hub.browserCertificate.replace": "Replace the Hub browser certificate. The member transport identity stays the same.",
|
|
@@ -736,6 +738,8 @@ register("pendingSummary", {
|
|
|
736
738
|
"host_cli.install_confirm": "在 AgEnD 主機上安裝 {0}",
|
|
737
739
|
"host_cli.update": "在 AgEnD 這台電腦上把 {0} 更新到 {1}(AgEnD 稽核過的版本),使用登錄表裡的更新指令(無人值守執行)。只會更新這個 CLI;頁面送來的內容不會被執行。",
|
|
738
740
|
"host_cli.update_latest": "在 AgEnD 這台電腦上把 {0} 更新到「最新版」(未經 AgEnD 稽核):使用登錄表裡這個 CLI 的更新指令(無人值守執行);這個 CLI 自己的更新器無法指定版本。只會更新這個 CLI;頁面送來的內容不會被執行。",
|
|
741
|
+
"host_cli.native_switch": "把 AgEnD 這台電腦上的 Claude Code 從 npm 安裝改成 Claude 的原生安裝:以 claude.ai/install.sh 安裝 {0}(AgEnD 稽核過的版本,無人值守執行)。npm 那份會留著,等你另外移除。",
|
|
742
|
+
"host_cli.npm_remove": "從 AgEnD 這台電腦移除 npm 安裝的 Claude Code(在那份所在的 npm 目錄執行 npm -g uninstall @anthropic-ai/claude-code)。只有在 `claude` 已經改用原生安裝時才會執行。",
|
|
739
743
|
"runtime_cli.install": "在已配對的 Windows 電腦 {2} 上安裝 {0} {1}:AgEnD 固定的版本,並在那台電腦上檢查(固定的雜湊、registry 簽章、發行者簽章)。只會安裝這個 CLI;頁面送來的內容不會被執行。仍需要那台電腦主人自己的開關允許。",
|
|
740
744
|
"runtime_cli.update_latest": "如果已配對的 Windows 電腦 {1} 上已經有 {0},這會把它更新到廠商的「最新版」(未經 AgEnD 稽核):Runtime 會下載廠商自己的 manifest 指定的版本,並在那台電腦上檢查它的雜湊與發行者簽章,才會切換過去。",
|
|
741
745
|
"hub.browserCertificate.replace": "更換 Hub 瀏覽器憑證;成員傳輸身分保持不變。",
|
|
@@ -783,6 +787,8 @@ const pendingSummaryArguments = Object.fromEntries([
|
|
|
783
787
|
["host_cli.install_confirm", "s"],
|
|
784
788
|
["host_cli.update", "ss"],
|
|
785
789
|
["host_cli.update_latest", "s"],
|
|
790
|
+
["host_cli.native_switch", "s"],
|
|
791
|
+
["host_cli.npm_remove", ""],
|
|
786
792
|
["runtime_cli.install", "sss"],
|
|
787
793
|
["runtime_cli.update_latest", "ss"],
|
|
788
794
|
["hub.browserCertificate.replace", ""],
|
package/dist/ui/shared/app.js
CHANGED
|
@@ -22,6 +22,7 @@ import { t } from "./app-i18n.js";
|
|
|
22
22
|
import { initTextSize, initUsageRail } from "./header-tools.js";
|
|
23
23
|
import { installOwnerCss } from "./owner-css.js";
|
|
24
24
|
import { startThemes } from "./app-themes.js";
|
|
25
|
+
import { warmModules } from "./module-warm.js";
|
|
25
26
|
|
|
26
27
|
const boot = document.body.dataset;
|
|
27
28
|
const workspaceLanding = location.pathname === "/ui";
|
|
@@ -43,7 +44,8 @@ const hubPage = mode === "full" && !guest && String(boot.hub || "").split(/\s+/)
|
|
|
43
44
|
|
|
44
45
|
// A failed load can be retried (the panel's Retry): each retry asks for a fresh URL, since a browser may keep a failed
|
|
45
46
|
// module import cached under the first one. boot() runs once, whichever attempt succeeds.
|
|
46
|
-
|
|
47
|
+
// M-3314: and before the first try, the module's whole graph is asked for at once (module-warm.js).
|
|
48
|
+
const retryUrl = (path, attempt) => (attempt ? `${path}?retry=${attempt}` : (warmModules(path), path));
|
|
47
49
|
// View is public (it is what an anonymous reader may open), so it lives under /assets/ beside this file.
|
|
48
50
|
const loadView = retryable((a) => import(retryUrl("/assets/panel-view.js", a)));
|
|
49
51
|
const panels = new Map([["view", { load: () => loadView().then((m) => m.ViewPanel) }]]);
|
|
@@ -108,7 +108,9 @@ export function installMessageActions(list, deps) {
|
|
|
108
108
|
// M-3127: a Hub room's messages take a reaction (deps.react: the thread's quick picker under that message); the Fleet passes none.
|
|
109
109
|
if (typeof deps.react === "function" && deps.canReact?.(row) !== false) items.push(["react", deps.reactLabel || "React", () => deps.react(row)]);
|
|
110
110
|
items.push(["copyText", deps.t("chat.copyText"), async () => { const ok = await deps.copyText(String(row.click?.label ?? row.text ?? "")); deps.notice(deps.t(ok ? "chat.copied" : "chat.copyFailed"), ok); }]);
|
|
111
|
-
|
|
111
|
+
// M-3311 (#4159 review): Copy link only for a message that has an address (linkOf → null: none, e.g. one still sending).
|
|
112
|
+
const link = typeof deps.linkOf === "function" ? deps.linkOf(row) : null;
|
|
113
|
+
if (link) items.push(["copyLink", deps.t("chat.copyLink"), async () => { const ok = await deps.copyText(link); deps.notice(deps.t(ok ? "chat.copied" : "chat.copyFailed"), ok); }]);
|
|
112
114
|
menu = doc.createElement("div");
|
|
113
115
|
menu.className = "msg-menu";
|
|
114
116
|
menu.setAttribute("role", "menu");
|