@songsid/agend 2.4.0-beta.10 → 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.
Files changed (298) hide show
  1. package/dist/accounts-view.d.ts +29 -0
  2. package/dist/accounts-view.js +2 -14
  3. package/dist/accounts-view.js.map +1 -1
  4. package/dist/agent-endpoint.d.ts +1 -0
  5. package/dist/agent-endpoint.js +4 -2
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/auth-api.d.ts +2 -0
  8. package/dist/auth-api.js +29 -2
  9. package/dist/auth-api.js.map +1 -1
  10. package/dist/backend/claude-code.js +35 -9
  11. package/dist/backend/claude-code.js.map +1 -1
  12. package/dist/backend/codex-precaution.d.ts +7 -0
  13. package/dist/backend/codex-precaution.js +102 -0
  14. package/dist/backend/codex-precaution.js.map +1 -0
  15. package/dist/backend/codex.d.ts +1 -0
  16. package/dist/backend/codex.js +18 -0
  17. package/dist/backend/codex.js.map +1 -1
  18. package/dist/backend/grok.js +21 -6
  19. package/dist/backend/grok.js.map +1 -1
  20. package/dist/backend/types.d.ts +9 -1
  21. package/dist/backend/types.js.map +1 -1
  22. package/dist/build-provenance.json +1 -1
  23. package/dist/channel/mcp-server.js +1 -1
  24. package/dist/channel/mcp-server.js.map +1 -1
  25. package/dist/channel/mcp-tools.js +3 -1
  26. package/dist/channel/mcp-tools.js.map +1 -1
  27. package/dist/claude-install-kind.d.ts +19 -0
  28. package/dist/claude-install-kind.js +54 -0
  29. package/dist/claude-install-kind.js.map +1 -0
  30. package/dist/cli-audited.js +3 -3
  31. package/dist/cli-audited.js.map +1 -1
  32. package/dist/daemon.d.ts +5 -0
  33. package/dist/daemon.js +22 -4
  34. package/dist/daemon.js.map +1 -1
  35. package/dist/event-log.d.ts +12 -0
  36. package/dist/event-log.js +40 -0
  37. package/dist/event-log.js.map +1 -1
  38. package/dist/fleet-manager.d.ts +122 -2
  39. package/dist/fleet-manager.js +482 -27
  40. package/dist/fleet-manager.js.map +1 -1
  41. package/dist/general-knowledge/skills/hub/SKILL.md +38 -6
  42. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +16 -1
  43. package/dist/hub/admin-dashboard.js +3 -3
  44. package/dist/hub/admin-dashboard.js.map +1 -1
  45. package/dist/hub/agent-catalog-model.d.ts +276 -0
  46. package/dist/hub/agent-catalog-model.js +49 -0
  47. package/dist/hub/agent-catalog-model.js.map +1 -0
  48. package/dist/hub/agent-catalog.d.ts +137 -0
  49. package/dist/hub/agent-catalog.js +118 -0
  50. package/dist/hub/agent-catalog.js.map +1 -0
  51. package/dist/hub/agent-intro-model.d.ts +38 -0
  52. package/dist/hub/agent-intro-model.js +14 -0
  53. package/dist/hub/agent-intro-model.js.map +1 -0
  54. package/dist/hub/agent-intro-tool.d.ts +35 -0
  55. package/dist/hub/agent-intro-tool.js +83 -0
  56. package/dist/hub/agent-intro-tool.js.map +1 -0
  57. package/dist/hub/agent-intro.d.ts +31 -0
  58. package/dist/hub/agent-intro.js +51 -0
  59. package/dist/hub/agent-intro.js.map +1 -0
  60. package/dist/hub/catalog.d.ts +4 -2
  61. package/dist/hub/catalog.js +19 -3
  62. package/dist/hub/catalog.js.map +1 -1
  63. package/dist/hub/client.d.ts +3 -0
  64. package/dist/hub/client.js +47 -1
  65. package/dist/hub/client.js.map +1 -1
  66. package/dist/hub/compose/member.d.ts +19 -5
  67. package/dist/hub/compose/member.js +94 -13
  68. package/dist/hub/compose/member.js.map +1 -1
  69. package/dist/hub/compose/server.d.ts +5 -0
  70. package/dist/hub/compose/server.js +6 -1
  71. package/dist/hub/compose/server.js.map +1 -1
  72. package/dist/hub/execution/service.d.ts +1 -1
  73. package/dist/hub/execution/service.js +1 -0
  74. package/dist/hub/execution/service.js.map +1 -1
  75. package/dist/hub/http/compose.d.ts +3 -0
  76. package/dist/hub/http/compose.js +122 -15
  77. package/dist/hub/http/compose.js.map +1 -1
  78. package/dist/hub/http/schema.js +15 -0
  79. package/dist/hub/http/schema.js.map +1 -1
  80. package/dist/hub/mcp/tools.js +2 -1
  81. package/dist/hub/mcp/tools.js.map +1 -1
  82. package/dist/hub/member/agent-catalog.d.ts +28 -0
  83. package/dist/hub/member/agent-catalog.js +80 -0
  84. package/dist/hub/member/agent-catalog.js.map +1 -0
  85. package/dist/hub/member/agent-intro.d.ts +28 -0
  86. package/dist/hub/member/agent-intro.js +66 -0
  87. package/dist/hub/member/agent-intro.js.map +1 -0
  88. package/dist/hub/member/exposure-api.d.ts +3 -3
  89. package/dist/hub/member/exposure-api.js +4 -4
  90. package/dist/hub/member/exposure-api.js.map +1 -1
  91. package/dist/hub/member/exposures.d.ts +12 -4
  92. package/dist/hub/member/exposures.js +27 -13
  93. package/dist/hub/member/exposures.js.map +1 -1
  94. package/dist/hub/member/room-ask.d.ts +14 -1
  95. package/dist/hub/member/room-ask.js +76 -10
  96. package/dist/hub/member/room-ask.js.map +1 -1
  97. package/dist/hub/member/room-context-budget.d.ts +5 -0
  98. package/dist/hub/member/room-context-budget.js +34 -0
  99. package/dist/hub/member/room-context-budget.js.map +1 -0
  100. package/dist/hub/member/room-notification.d.ts +1 -1
  101. package/dist/hub/member/room-post.d.ts +6 -3
  102. package/dist/hub/member/room-post.js +9 -3
  103. package/dist/hub/member/room-post.js.map +1 -1
  104. package/dist/hub/member/sharing-journal.d.ts +252 -0
  105. package/dist/hub/member/sharing-journal.js +212 -0
  106. package/dist/hub/member/sharing-journal.js.map +1 -0
  107. package/dist/hub/member/sharing-link.d.ts +25 -0
  108. package/dist/hub/member/sharing-link.js +68 -0
  109. package/dist/hub/member/sharing-link.js.map +1 -0
  110. package/dist/hub/member/sharing-result.d.ts +6 -0
  111. package/dist/hub/member/sharing-result.js +46 -0
  112. package/dist/hub/member/sharing-result.js.map +1 -0
  113. package/dist/hub/member/sharing.d.ts +37 -0
  114. package/dist/hub/member/sharing.js +181 -0
  115. package/dist/hub/member/sharing.js.map +1 -0
  116. package/dist/hub/personal/owner-host.d.ts +6 -0
  117. package/dist/hub/personal/owner-host.js +4 -2
  118. package/dist/hub/personal/owner-host.js.map +1 -1
  119. package/dist/hub/protocol.d.ts +398 -4
  120. package/dist/hub/protocol.js +13 -5
  121. package/dist/hub/protocol.js.map +1 -1
  122. package/dist/hub/room-answer-status-model.d.ts +3 -0
  123. package/dist/hub/room-answer-status-model.js +4 -0
  124. package/dist/hub/room-answer-status-model.js.map +1 -0
  125. package/dist/hub/room-brief-model.d.ts +30 -0
  126. package/dist/hub/room-brief-model.js +37 -0
  127. package/dist/hub/room-brief-model.js.map +1 -0
  128. package/dist/hub/room-context-model.d.ts +2 -0
  129. package/dist/hub/room-context-model.js +2 -2
  130. package/dist/hub/room-context-model.js.map +1 -1
  131. package/dist/hub/room-members-model.d.ts +63 -0
  132. package/dist/hub/room-members-model.js +7 -0
  133. package/dist/hub/room-members-model.js.map +1 -0
  134. package/dist/hub/rooms/agents.d.ts +1 -0
  135. package/dist/hub/rooms/agents.js +62 -11
  136. package/dist/hub/rooms/agents.js.map +1 -1
  137. package/dist/hub/rooms/brief.d.ts +18 -0
  138. package/dist/hub/rooms/brief.js +39 -0
  139. package/dist/hub/rooms/brief.js.map +1 -0
  140. package/dist/hub/rooms/direct-view.d.ts +5 -1
  141. package/dist/hub/rooms/direct-view.js +2 -2
  142. package/dist/hub/rooms/direct-view.js.map +1 -1
  143. package/dist/hub/rooms/members-page.d.ts +33 -0
  144. package/dist/hub/rooms/members-page.js +37 -0
  145. package/dist/hub/rooms/members-page.js.map +1 -0
  146. package/dist/hub/rooms/purpose.d.ts +7 -0
  147. package/dist/hub/rooms/purpose.js +14 -0
  148. package/dist/hub/rooms/purpose.js.map +1 -0
  149. package/dist/hub/rooms/service.d.ts +43 -0
  150. package/dist/hub/rooms/service.js +80 -22
  151. package/dist/hub/rooms/service.js.map +1 -1
  152. package/dist/hub/rooms/types.d.ts +6 -1
  153. package/dist/hub/rooms.d.ts +1 -0
  154. package/dist/hub/rooms.js +9 -4
  155. package/dist/hub/rooms.js.map +1 -1
  156. package/dist/hub/runtime.d.ts +1 -1
  157. package/dist/hub/server.js +49 -1
  158. package/dist/hub/server.js.map +1 -1
  159. package/dist/hub/sharing-previous-access.d.ts +22 -0
  160. package/dist/hub/sharing-previous-access.js +93 -0
  161. package/dist/hub/sharing-previous-access.js.map +1 -0
  162. package/dist/hub/sharing-requests.d.ts +171 -0
  163. package/dist/hub/sharing-requests.js +311 -0
  164. package/dist/hub/sharing-requests.js.map +1 -0
  165. package/dist/hub/sharing-retention.d.ts +47 -0
  166. package/dist/hub/sharing-retention.js +83 -0
  167. package/dist/hub/sharing-retention.js.map +1 -0
  168. package/dist/hub/sharing-withdrawal.d.ts +14 -0
  169. package/dist/hub/sharing-withdrawal.js +28 -0
  170. package/dist/hub/sharing-withdrawal.js.map +1 -0
  171. package/dist/hub/types.d.ts +13 -5
  172. package/dist/hub-page-sharing-settings.d.ts +6 -0
  173. package/dist/hub-page-sharing-settings.js +19 -0
  174. package/dist/hub-page-sharing-settings.js.map +1 -0
  175. package/dist/hub-room-reply-warning.d.ts +2 -0
  176. package/dist/hub-room-reply-warning.js +16 -0
  177. package/dist/hub-room-reply-warning.js.map +1 -0
  178. package/dist/hub-sharing-notice.d.ts +43 -0
  179. package/dist/hub-sharing-notice.js +34 -0
  180. package/dist/hub-sharing-notice.js.map +1 -0
  181. package/dist/instance-lifecycle.d.ts +15 -0
  182. package/dist/instance-lifecycle.js +36 -1
  183. package/dist/instance-lifecycle.js.map +1 -1
  184. package/dist/locale.js +78 -0
  185. package/dist/locale.js.map +1 -1
  186. package/dist/login-controller.d.ts +26 -0
  187. package/dist/login-controller.js +72 -2
  188. package/dist/login-controller.js.map +1 -1
  189. package/dist/login-flows.js +1 -1
  190. package/dist/login-flows.js.map +1 -1
  191. package/dist/native-mcp.js +1 -1
  192. package/dist/native-mcp.js.map +1 -1
  193. package/dist/needs-you-hub.js +1 -1
  194. package/dist/needs-you-hub.js.map +1 -1
  195. package/dist/needs-you.d.ts +8 -1
  196. package/dist/needs-you.js +6 -0
  197. package/dist/needs-you.js.map +1 -1
  198. package/dist/office-share-page.js +1 -1
  199. package/dist/office-share-page.js.map +1 -1
  200. package/dist/outbound-handlers.d.ts +2 -1
  201. package/dist/outbound-handlers.js +17 -4
  202. package/dist/outbound-handlers.js.map +1 -1
  203. package/dist/outbound-schemas.d.ts +10 -0
  204. package/dist/outbound-schemas.js +3 -1
  205. package/dist/outbound-schemas.js.map +1 -1
  206. package/dist/public-web-gateway.js +9 -3
  207. package/dist/public-web-gateway.js.map +1 -1
  208. package/dist/remote-card-answer.d.ts +1 -1
  209. package/dist/remote-card-answer.js +8 -1
  210. package/dist/remote-card-answer.js.map +1 -1
  211. package/dist/remote-card-prompt.js +1 -1
  212. package/dist/remote-card-prompt.js.map +1 -1
  213. package/dist/restart-progress.d.ts +6 -0
  214. package/dist/restart-progress.js +5 -0
  215. package/dist/restart-progress.js.map +1 -1
  216. package/dist/settings-api.d.ts +1 -0
  217. package/dist/settings-api.js +84 -10
  218. package/dist/settings-api.js.map +1 -1
  219. package/dist/settings-baseline.d.ts +3 -0
  220. package/dist/settings-baseline.js +2 -2
  221. package/dist/settings-baseline.js.map +1 -1
  222. package/dist/settings-change.js +1 -0
  223. package/dist/settings-change.js.map +1 -1
  224. package/dist/settings-effect.d.ts +3 -0
  225. package/dist/settings-effect.js +33 -2
  226. package/dist/settings-effect.js.map +1 -1
  227. package/dist/tool-permissions.js +3 -3
  228. package/dist/tool-permissions.js.map +1 -1
  229. package/dist/ui/chat-quote.js +3 -261
  230. package/dist/ui/fleet-office-card.js +8 -4
  231. package/dist/ui/fleet-office-pack.d.ts +1 -0
  232. package/dist/ui/fleet-office-pack.js +6 -2
  233. package/dist/ui/fleet-office-play.js +84 -0
  234. package/dist/ui/fleet-office-store.js +23 -0
  235. package/dist/ui/fleet-office-zones.js +5 -1
  236. package/dist/ui/fleet-office.js +78 -8
  237. package/dist/ui/host-install.js +77 -3
  238. package/dist/ui/hub-agent-intro.js +35 -0
  239. package/dist/ui/hub-attachments.js +81 -3
  240. package/dist/ui/hub-chat-strings.js +4 -4
  241. package/dist/ui/hub-client.js +16 -1
  242. package/dist/ui/hub-grant-picker.js +25 -11
  243. package/dist/ui/hub-group-strings.js +3 -3
  244. package/dist/ui/hub-intro-notice.js +16 -0
  245. package/dist/ui/hub-my-agents-model.js +42 -0
  246. package/dist/ui/hub-my-agents-strings.js +18 -0
  247. package/dist/ui/hub-my-agents.js +144 -0
  248. package/dist/ui/hub-owner-strings.js +5 -5
  249. package/dist/ui/hub-personal-agent.js +5 -4
  250. package/dist/ui/hub-room-composer.js +37 -6
  251. package/dist/ui/hub-room-list.js +4 -3
  252. package/dist/ui/hub-room-members.js +5 -2
  253. package/dist/ui/hub-room-new.js +8 -5
  254. package/dist/ui/hub-room-purpose.js +19 -0
  255. package/dist/ui/hub-room-search.js +1 -1
  256. package/dist/ui/hub-room-settings.js +9 -0
  257. package/dist/ui/hub-room-strings.js +6 -4
  258. package/dist/ui/hub-room-thread.js +70 -17
  259. package/dist/ui/hub-strings.js +5 -5
  260. package/dist/ui/hub-welcome.js +6 -6
  261. package/dist/ui/notice-hub-sharing.js +81 -0
  262. package/dist/ui/panel-chat.js +19 -5
  263. package/dist/ui/panel-hub.js +77 -29
  264. package/dist/ui/panel-notices.js +2 -1
  265. package/dist/ui/settings-hub-connection.js +2 -2
  266. package/dist/ui/settings-hub-page-sharing.js +52 -0
  267. package/dist/ui/settings-hub.js +4 -2
  268. package/dist/ui/settings-registry.js +1 -0
  269. package/dist/ui/shared/app-i18n.js +2 -2
  270. package/dist/ui/shared/app-shell.js +14 -2
  271. package/dist/ui/shared/app-store.js +6 -2
  272. package/dist/ui/shared/app.js +3 -1
  273. package/dist/ui/shared/chat-msg-actions.js +3 -1
  274. package/dist/ui/shared/chat-quote.js +261 -0
  275. package/dist/ui/shared/hub-chat.css +31 -0
  276. package/dist/ui/shared/hub-my-agents.css +35 -0
  277. package/dist/ui/shared/hub-rooms-u2.css +5 -0
  278. package/dist/ui/shared/module-warm.d.ts +3 -0
  279. package/dist/ui/shared/module-warm.js +39 -0
  280. package/dist/web-api.d.ts +21 -5
  281. package/dist/web-api.js +138 -7
  282. package/dist/web-api.js.map +1 -1
  283. package/dist/web-asset-version.d.ts +65 -0
  284. package/dist/web-asset-version.js +259 -0
  285. package/dist/web-asset-version.js.map +1 -0
  286. package/dist/web-host-guard.js +3 -1
  287. package/dist/web-host-guard.js.map +1 -1
  288. package/dist/web-host-install.d.ts +30 -3
  289. package/dist/web-host-install.js +50 -4
  290. package/dist/web-host-install.js.map +1 -1
  291. package/dist/web-notices.d.ts +17 -0
  292. package/dist/web-notices.js +47 -6
  293. package/dist/web-notices.js.map +1 -1
  294. package/dist/web-terminal.d.ts +5 -0
  295. package/dist/web-terminal.js +11 -0
  296. package/dist/web-terminal.js.map +1 -1
  297. package/launcher/agend-install.cjs +48 -7
  298. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ import { IntroNotice, introNoticeOffered } from "./hub-intro-notice.js";
2
+ import { AgentIntroEditor, hi } from "./hub-agent-intro.js";
1
3
  import {hp,personalAgentQuestionHint} from "./hub-personal-agent-strings.js";
2
4
  import * as ownerEntryWords from "./hub-owner-strings.js";
3
5
  import * as companyViews from "./hub-company-join.js";
@@ -54,7 +56,8 @@ import { createHubChatStore } from "./hub-chat-store.js";
54
56
  import { QuotaBanner, QuotaCard, QuotaChip, QuotaVisibilityRow } from "./hub-quota.js";
55
57
  import { PageHead } from "/assets/page-head.js";
56
58
  import { bindRoomFeedback, bootHubPreview, downloadHtml, draftWithLine, panelOpenFor, roomPanelKey, roomPanelOpts, setHubPreviewOptIn } from "./hub-preview.js";
57
- 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";
58
61
  register("hubAccess", {
59
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." },
60
63
  "zh-TW": { tag: "需要確認權限", refused: "提問遭到拒絕。請先重新檢查權限,再試一次。", check: "重新檢查權限", limited: "提問遭到拒絕,先前的權限資訊需要重新確認。" },
@@ -208,8 +211,8 @@ export function HubPanel({ route }) {
208
211
  if (s && tab === "ask" && view === "notices" && noticesOffered(s)) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-notices">
209
212
  <${PanelHeader} title=${hc("noticesTitle")}><span class="hub-head-tools"><${HubNotifyToggle} /></span></${PanelHeader}><div data-trust="panel-content" class="panel-body hub-page-body">
210
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>
211
- ${pairingNoticesOffered(s) ? html`<${PairingNotices} admin=${!!s.admin} empty=${directoryNoticesOffered(s, hubClient()) || roleNoticesOffered(s, hubClient()) ? null : html`<${Empty} icon="bell" title=${hc("noNotices")} />`} />` : null}
212
- ${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>`;
213
216
  // M-3092: the owner's invitations (spec §8), a page of the chats like Notices.
214
217
  if (s && tab === "ask" && view === "invitations" && roomsLive()) return html`<div data-effect-panel="hub" class="panel p-hub p-hub-invitations">
215
218
  <${PanelHeader} title=${hroom("invitationsTitle")} /><div data-trust="panel-content" class="panel-body hub-page-body"><div class="col hub-owner">
@@ -383,7 +386,7 @@ export const NOTICES_PATH = "/ui/hub?view=notices";
383
386
  export const INVITATIONS_PATH = "/ui/hub?view=invitations";
384
387
  export const MY_TEAMS_PATH = "/ui/hub?view=teams";
385
388
  const pairingNoticesOffered = (s) => !!s && Array.isArray(s.features) && s.features.includes("quick-pairing-v1") && !!hubClient().quickPairingV1;
386
- 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());
387
390
  const initial = (name) => (String(name || "?").trim()[0] || "?").toUpperCase();
388
391
  const AV_TONES = 6;
389
392
  const tone = (name) => { let h = 0; for (const c of String(name || "")) h = (h * 31 + c.codePointAt(0)) >>> 0; return h % AV_TONES; };
@@ -475,7 +478,7 @@ export function HubSide({ onPick } = {}) {
475
478
  ${/* M-3190 (Argon): 新對話 and 新房間 head the conversation list, not the primary rows. */ ""}
476
479
  <${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} onPick=${onPick} quietEmpty=${home} foot=${roomsLive()}
477
480
  onNew=${() => { if (onPick) onPick(); navigate(NEW_CHAT_PATH); }} onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
478
- ${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(),
479
482
  onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
480
483
  }
481
484
 
@@ -522,7 +525,7 @@ function HubHomeList() {
522
525
  const filter = useRef(null);
523
526
  return html`<${HubRoomList} rs=${rs} q=${q} setQ=${setQ} filtering=${filtering} setFiltering=${setFiltering} filterRef=${filter} home=${true} onNew=${() => navigate(NEW_CHAT_PATH)}
524
527
  onNewRoom=${roomsLive() && rs.me?.canCreateRooms ? () => setNewRoom(true) : null} />
525
- ${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(),
526
529
  onClose: () => setNewRoom(false), onOpenRoom: (id) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(id)); } }} />` : null}`;
527
530
  }
528
531
 
@@ -617,7 +620,7 @@ function ChatLauncher() {
617
620
  let live = true;
618
621
  if (typeof hubClient().room !== "function") return undefined;
619
622
  Promise.all(groups.map((r) => hubClient().room(r.id).then((d) => (d && Array.isArray(d.members) ? d.members : [])
620
- .filter((m) => m && m.kind === "agent" && !m.mine).map((m) => ({ key: `room:${r.id}:${m.id}`, name: m.name || "", sub: hc("launchInRoom", r.name), href: roomPath(r.id) })), () => [])))
623
+ .filter((m) => m && m.kind === "agent" && !m.mine).map((m) => ({ key: `room:${r.id}:${m.id}`, name: m.name || "", sub: [m.intro,hc("launchInRoom", r.name)].filter(Boolean).join(" · "), href: roomPath(r.id) })), () => [])))
621
624
  .then((all) => { if (live) setInRooms(all.flat()); });
622
625
  return () => { live = false; };
623
626
  }, [groupKey]);
@@ -633,9 +636,9 @@ function ChatLauncher() {
633
636
  const chats = rs.rooms.filter((r) => r.kind !== "group" && !r.archived);
634
637
  const shownIn = new Set(chats.map((r) => (r.legacy || r.agent || {}).exposureId).filter(Boolean));
635
638
  const rows = [
636
- ...chats.map((r) => ({ key: r.id, name: r.assistant ? hroom("hubAssistant") : r.name, sub: r.assistant ? hroom("providedByHub") : r.agent?.owner?.name ? hc("launchOwner", r.agent.owner.name) : "",
639
+ ...chats.map((r) => ({ key: r.id, name: r.assistant ? hroom("hubAssistant") : r.name, sub: r.assistant ? hi("assistant") : [r.agent?.intro,r.agent?.owner?.name ? hc("launchOwner", r.agent.owner.name) : ""].filter(Boolean).join(" · "),
637
640
  href: roomPath(r.id), online: r.assistant ? (r.presence || "idle") !== "unavailable" : r.agent?.presence === "online" })),
638
- ...askable.filter((it) => !shownIn.has(it.exposure.id)).map((it) => ({ key: it.grant.id, name: it.exposure.displayName, sub: it.exposure.answerOnly ? hp("answerOnlyAsker") : hc("launchOwner", it.ownerName || "—"), ask: it })),
641
+ ...askable.filter((it) => !shownIn.has(it.exposure.id)).map((it) => ({ key: it.grant.id, name: it.exposure.displayName, sub: [it.exposure.intro,it.exposure.answerOnly ? hp("answerOnlyAsker") : hc("launchOwner", it.ownerName || "—")].filter(Boolean).join(" · "), ask: it })),
639
642
  ...inRooms,
640
643
  ];
641
644
  const needle = q.trim().toLowerCase();
@@ -654,7 +657,7 @@ function ChatLauncher() {
654
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}
655
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}
656
659
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
657
- ${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(),
658
661
  onClose: () => setNewRoom(false), onOpenRoom: (rid) => { setNewRoom(false); void refreshRooms(); navigate(roomPath(rid)); } }} />` : null}`;
659
662
  return html`<div class="hub-launch">${groupPolicyOn(s, hubClient())
660
663
  ? html`<${LazyGroups} pick=${(m) => m.ChatLauncherFrame || (({ children }) => children)} props=${{ admin: s.admin === true, features: s.features, children: list }} />` : list}</div>`;
@@ -774,12 +777,20 @@ function HubRoomView({ room: given }) {
774
777
  const sent = new Set(chosen.map((f) => f.key));
775
778
  setDraft(""); setFiles(filesRef.current.filter((f) => !sent.has(f.key))); refreshRooms();
776
779
  };
777
- const attach = takesFiles ? { title: hf("attach"), onFiles: async (list) => {
778
- setMsg(null);
779
- const refused = await uploadChosen(client, room.id, list, { current: () => filesRef.current, set: setFiles, alive: () => alive.current });
780
- if (!alive.current) return;
781
- if (refused.length) setMsg(refused.join(" "));
782
- } } : null;
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 } }), []);
783
794
  const onKeyDown = (e) => { if (globalThis.AgendChatRender?.composerKey(e, { touch: touchScreen() }) === "send") { e.preventDefault(); send(); } };
784
795
  const toggleInfo = () => {
785
796
  if (!wide) { setSheet(true); return; }
@@ -794,14 +805,15 @@ function HubRoomView({ room: given }) {
794
805
  // The panel takes the info rail's place while it shows a page (the rail's button brings the rail back).
795
806
  const showRail = wide && rail && !panelOpen;
796
807
  return html`<div class=${`hub-chat${showRail ? " with-rail" : ""}`} ref=${split}>
797
- <section class="hub-chat-main" aria-label=${name}>
808
+ <section class="hub-chat-main" aria-label=${name} ref=${mainRef}>
809
+ ${attach ? html`<${DropOverlay} />` : null}
798
810
  <header class=${`hub-chat-head${room.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">${back}<${Avatar} name=${name} size="sm" />
799
- <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></span>
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>
800
812
  ${tag}
801
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>
802
814
  <span class="hub-head-tools"><${TextSizeButton} /></span>
803
815
  </header>
804
- <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} />
816
+ <${HubThread} store=${store} name=${name} panelKey=${panelKey} threadRef=${threadRef} extra=${askExtra} />
805
817
  <div class="dock hub-dock" data-trust="composer"><div class="dock-col">
806
818
  ${closed ? html`<p class="hub-banner danger" role="status">${hc("closed")}</p>` : null}
807
819
  ${frozen ? html`<p class="hub-banner warn" role="status">${paused ? t("hubSharing.pausedChat", name) : hc("frozen", name)}</p>` : null}
@@ -811,12 +823,13 @@ function HubRoomView({ room: given }) {
811
823
  ${!closed && !frozen && !denied && !takesFiles ? html`<p class="note hub-files-off" role="status">${hf(pageFiles ? "off" : "reload")}</p>` : null}
812
824
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
813
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(); }}
814
827
  formatSize=${(n) => (globalThis.AgendChatRender?.formatSize ? globalThis.AgendChatRender.formatSize(n) : `${n} B`)} />
815
828
  <${ComposerInput} inputRef=${input} value=${draft} placeholder=${hc("composer", name)} onValue=${setDraft}
816
- onKeyDown=${onKeyDown} onPaste=${() => {}} attach=${attach}
829
+ onKeyDown=${onKeyDown} onPaste=${(e) => { if (!frozen && !denied) pasteToAttach(e, attach); }} attach=${attach}
817
830
  stop=${{ hidden: true, disabled: true, title: hc("stop"), label: hc("stop"), onClick: () => {} }}
818
831
  send=${{ hidden: false, disabled: !draft.trim() || sending || frozen || denied || uploading, label: hc("send"), onClick: send }} /></div>`}
819
- ${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>`}
820
833
  </div></div>
821
834
  </section>
822
835
  <${PreviewPanel} name=${panelKey} split=${split} msgs=${() => store.messages()} subscribe=${(fn) => store.subscribe(() => fn(panelKey, "msgs"))}
@@ -893,9 +906,37 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
893
906
  reply: (x) => ex.startReply?.(x),
894
907
  // React opens the thread's picker for that message (extra.react is the thread's own add/remove call, with an emoji).
895
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) } : {}),
896
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
+ }) : () => {};
897
938
  return () => {
898
- offActions();
939
+ offActions(); offQuote();
899
940
  paging = false;
900
941
  off(); offOpt(); offPanel(); sc.removeEventListener("scroll", onScroll); list.removeEventListener("click", thread.onClick);
901
942
  thread.dispose(true); list.remove(); th.current = null; if (threadRef && threadRef.current === thread) threadRef.current = null;
@@ -917,7 +958,7 @@ function HubThread({ store, name, panelKey, threadRef, extra = null, emptyView =
917
958
  /** The right-hand panel's cards (the usage rail's look): the agent, its quota (G), your access, who sees it, what is not here. */
918
959
  function HubRoomInfo({ room, closed = false, denied = false }) {
919
960
  const name = room.exposureName || "", owner = room.ownerName || "";
920
- return html`<section class="u-provider hub-card hub-agent-card"><${Avatar} name=${name} size="lg" /><strong>${name}</strong>
961
+ return html`<section class="u-provider hub-card hub-agent-card"><${Avatar} name=${name} size="lg" /><strong>${name}</strong>${room.intro?html`<p class="note">${room.intro}</p>`:null}
921
962
  ${owner ? html`<span class="note">${hc("answersFor", owner)}</span>` : null}</section>
922
963
  <${QuotaCard} room=${room} />
923
964
  ${room.grantExpiresAt && !closed ? html`<section class="u-provider hub-card"><div class="u-head"><strong>${hc("yourAccess")}</strong></div>
@@ -957,10 +998,13 @@ function readActivity(exposureId) {
957
998
  () => ({ ok: false, code: "unreachable" }));
958
999
  }
959
1000
  function HubMine() {
1001
+ const introSession=useSession();
960
1002
  useStore(navStore); // ?agent= changes without a new route
961
1003
  const [cat, reload] = useRead(() => hubClient().catalog());
962
1004
  const [pairings, reloadPairings] = useRead(() => hubClient().pairings());
963
1005
  const [msg, setMsg] = useState(null);
1006
+ const [allowTarget, setAllowTarget] = useState(null);
1007
+ const modernSharing = session?.features?.includes("agent-sharing-v1") && hubClient()?.agentSharingV1 === true;
964
1008
  useEffect(() => {
965
1009
  linkHubChatCss(); linkHubOwnerCss();
966
1010
  if (!document.querySelector('link[data-hub-sharing-css="1"]')) {
@@ -986,10 +1030,10 @@ function HubMine() {
986
1030
  // lands nowhere (useRead's own liveness ends with that page).
987
1031
  if (x) return html`<${HubAgentPage} key=${x.id} x=${x} act=${act} msg=${msg} />`;
988
1032
  // Nothing shared yet: the empty state below says where to share from, so the lead doesn't say it too (Argon #20).
989
- return html`<div class="col hub-owner"><${OlderFleetBanner} client=${hubClient()} signIn=${session?.csrf || ""} /><p class="s-page-lead hub-page-lead">${ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
1033
+ return html`<div class="col hub-owner">${!modernSharing ? html`<${OlderFleetBanner} client=${hubClient()} signIn=${session?.csrf || ""} />` : null}<p class="s-page-lead hub-page-lead">${modernSharing ? ho("mineLeadNew") : ho(cat && !cat.error && !mine.length ? "mineLeadShort" : "mineLead")}</p>
990
1034
  <div class="s-section-layout">
991
1035
  ${/* M-3190: 「我的 Fleet」 moved here from 對話 — the person's Fleets and the steps to connect one. */ ""}
992
- ${groupPolicyOn(session, hubClient()) ? html`<${LazyGroups} pick=${(m) => m.MyFleetsCard || (() => null)} props=${{ quick: session.features.includes("quick-pairing-v1"), admin: session.admin === true, features: session.features }} />` : null}
1036
+ ${groupPolicyOn(session, hubClient()) ? html`<${LazyGroups} pick=${(m) => m.MyFleetsCard || (() => null)} props=${{ quick: session.features.includes("quick-pairing-v1"), admin: session.admin === true, features: session.features, compact: modernSharing }} />` : null}
993
1037
  ${session?.features?.includes("personal-agents-v1") ? html`<${LazyRoomPart} load=${() => import("./hub-personal-agent.js")} name="HubPersonalAgent" props=${{client:hubClient(),scope:session.csrf,isAdmin:session.admin===true,onSaved:reload}} />` : null}
994
1038
  ${roomsLive() ? html`<${LazyRoomPart} load=${() => import("./hub-invitations.js")} name="InvitationsList" props=${{ client: hubClient(), heading: true }} />` : null}
995
1039
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
@@ -1000,12 +1044,14 @@ function HubMine() {
1000
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>`}
1001
1045
  </div>`)}</div></section>` : null}
1002
1046
  ${!cat ? html`<${Skeleton} variant="rows" lines=${4} />` : cat.error ? html`<${ErrorState} message=${cat.error} onRetry=${reload} />` : null}
1003
- ${cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
1004
- ${mine.length ? html`<section class="card hub-shared"><h3>${ho(mine.some(e => e.kind === "personal") ? "yourAgentsCount" : "sharedCount", mine.length)}</h3>
1047
+ ${introNoticeOffered(introSession,hubClient())?html`<${IntroNotice} client=${hubClient()} />`:null}
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}
1049
+ ${!modernSharing && cat && !cat.error && !mine.length ? html`<div class="center hub-empty"><${Empty} icon="globe" title=${hw("exposuresEmpty")} hint=${hw("exposuresHint")} /></div>` : null}
1050
+ ${!modernSharing && mine.length ? html`<section class="card hub-shared"><h3>${ho(mine.some(e => e.kind === "personal") ? "yourAgentsCount" : "sharedCount", mine.length)}</h3>
1005
1051
  <div class="hub-rows">${mine.map((e) => html`<a key=${e.id} class="s-row hub-row hub-row-link" href=${`/ui/hub/exposures?agent=${encodeURIComponent(e.id)}`}>
1006
- <${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong><small class="note">${grantSummary(e.grants)}</small></span>
1052
+ <${Avatar} name=${e.displayName} /><span class="hub-row-text"><strong>${e.displayName}</strong>${e.intro?html`<small class="note">${e.intro}</small>`:null}<small class="note">${grantSummary(e.grants)}</small></span>
1007
1053
  ${stateTag(e.state, e.kind === "personal")}<${Icon} name="next" size=${16} /></a>`)}</div></section>` : null}
1008
- </div></div>`;
1054
+ </div>${allowTarget ? html`<${AllowDialog} x=${allowTarget} act=${act} onClose=${() => setAllowTarget(null)} />` : null}</div>`;
1009
1055
  }
1010
1056
 
1011
1057
  /** One shared agent: who may ask (allow, revoke), whether askers see its quota (G), who asked lately, pause. */
@@ -1042,6 +1088,7 @@ function HubAgentPage({ x, act, msg }) {
1042
1088
  ? `${hroom("agentNoOneToOne")} · ${roomCount === 1 ? hroom("inRoomsOne") : hroom("inRoomsMany", String(roomCount))}` : grantSummary(grants)} />
1043
1089
  <div class="s-section-layout">
1044
1090
  ${msg ? html`<p class="err" role="alert">${msg}</p>` : null}
1091
+ ${session?.features?.includes("agent-intros-v1") && client.agentIntrosV1 ? html`<${AgentIntroEditor} exposure=${x} client=${client} onSaved=${()=>act(async()=>({ok:true}))} />` : null}
1045
1092
  <section class="card"><div class="hub-card-head"><h3>${ho("whoMayAsk")}</h3>${shared ? html`<button type="button" class="btn btn-sm" onClick=${() => setAllowing(true)}><${Icon} name="plus" size=${14} />${ho("allow")}</button>` : null}</div>
1046
1093
  ${grants.length ? html`<div class="hub-rows">${grants.map((g) => html`<div key=${g.id} class="s-row hub-row">
1047
1094
  <${Avatar} name=${g.subjectName || g.subjectLogin} size="sm" />
@@ -1171,6 +1218,7 @@ function LazyRoomPart({ load, name, props = {} }) {
1171
1218
  return C ? html`<${C} ...${props} />` : null;
1172
1219
  }
1173
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;
1174
1222
  const roomsLive = () => { const c = hubClient(); return typeof c.roomsLive === "function" && c.roomsLive() === true; };
1175
1223
  function LazyThisHub({ directory }) {
1176
1224
  const [C, setC] = useState(null);
@@ -10,6 +10,7 @@ import { PanelHeader, setTitle } from "/assets/app-shell.js";
10
10
  import { chatPath } from "/assets/app-route.js";
11
11
  import { Empty, ErrorState, Skeleton } from "/assets/ui-states.js";
12
12
  import { Icon } from "/assets/ui-icons.js";
13
+ import { HubSharingNotice } from "./notice-hub-sharing.js";
13
14
  import { HubUpdateNotice, useHubUpdateActions } from "./notice-hub-update.js";
14
15
 
15
16
  register("notices", {
@@ -92,7 +93,7 @@ export function NoticesPanel({ navKey }) {
92
93
  <div class="n-title"><strong>${tn(`kind_${n.kind}`)}${n.instance ? ` · ${n.instance}` : ""}</strong>
93
94
  ${n.id > seenAtOpen ? html`<span class="notice-new">${tn("unread")}</span>` : null}
94
95
  <span class="n-age" title=${new Date(n.at).toLocaleString()}>${noticeAge(n.at, nowMs)}</span></div>
95
- ${n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
96
+ ${n.hubSharing ? html`<${HubSharingNotice} notice=${n} />` : n.hubUpdate ? html`<${HubUpdateNotice} notice=${n} actions=${hubActions} />` : html`<p class="n-detail notice-text">${n.text}</p>`}
96
97
  ${n.instance && known.has(n.instance) ? html`<div class="n-actions"><a class="btn btn-sm btn-ghost" href=${chatPath(n.instance)}>${tn("open")}</a></div>` : null}
97
98
  </div>
98
99
  </article>`)}
@@ -12,7 +12,7 @@ register("hubConnection", {
12
12
  rights: "Whether you can share agents or chat depends on what your Hub administrator allows; the Hub's home page shows yours.",
13
13
  title: "Hub connection", unconnected: "Not connected", connected: "Connected", paused: "Paused", connecting: "Connecting…", attention: "Connection needs attention",
14
14
  hub: "Hub", fleet: "Fleet", thisFleet: "This Fleet", open: "Open Hub", pause: "Pause connection", resume: "Resume connection",
15
- connectedHint: "This Fleet can use the Hub. Connecting does not share any Agent: each one appears on the Hub only after you share it.",
15
+ connectedHint: "This Fleet can use the Hub. Connecting does not share any agent: other people can see and ask one only after you share it.",
16
16
  pausedHint: "New Hub work and answer delivery are stopped. The saved connection and existing conversations are kept.",
17
17
  connectingHint: "The connection is saved. Waiting for the Hub link before reporting Connected.",
18
18
  advanced: "Connect with a pairing code (Advanced)", manualHint: "Use this for a Hub with a pairing code. The main sign-in flow enables membership when it succeeds.",
@@ -25,7 +25,7 @@ register("hubConnection", {
25
25
  rights: "連接後能不能分享 Agent、和 Agent 對話,由 Hub 管理員設定;Hub 首頁會顯示你目前的權限。",
26
26
  title: "Hub 連接", unconnected: "尚未連接", connected: "已連接", paused: "已暫停", connecting: "正在連接…", attention: "連接需要處理",
27
27
  hub: "Hub", fleet: "Fleet", thisFleet: "這個 Fleet", open: "開啟 Hub", pause: "暫停連接", resume: "恢復連接",
28
- connectedHint: "這個 Fleet 已可使用 Hub。連接不會自動分享 Agent:每個 Agent 都要你自己分享才會出現在 Hub。",
28
+ connectedHint: "這個 Fleet 已可使用 Hub。連接不會自動分享 Agent:要你自己分享之後,其他人才看得到、才能提問。",
29
29
  pausedHint: "已停止新的 Hub 工作與回答傳送;連接資料和既有對話仍保留。",
30
30
  connectingHint: "連接資料已儲存,正在等待與 Hub 的網路連線;尚未顯示為已連接。",
31
31
  advanced: "使用配對碼連接(進階)", manualHint: "供使用配對碼的 Hub 使用。上方登入流程成功後會自動啟用成員功能。",
@@ -0,0 +1,52 @@
1
+ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ import { api, confirmedWrite } from "./settings-confirm.js";
4
+
5
+ register("hubPageSharing", {
6
+ en: {
7
+ title: "Sharing from the Hub", switch: "Let me share agents from the Hub page",
8
+ hint: "When on, this Fleet sends the Hub your agents' names and descriptions, which only you can see there, and applies a share or stop you make on the Hub page without asking again. A notice with Undo is posted here each time.",
9
+ pending: "Waiting for owner confirmation…", unavailable: "This setting is unavailable. Check again.",
10
+ unknown: "The change is not confirmed. Check the saved setting before trying again.", retry: "Check again",
11
+ },
12
+ "zh-TW": {
13
+ title: "從 Hub 分享", switch: "允許我從 Hub 頁面分享 Agent",
14
+ hint: "開啟後,這個 Fleet 會把你的 Agent 名稱與說明傳給 Hub(在 Hub 上只有你看得到),並直接套用你在 Hub 頁面做的分享或停止,不再另外確認。每次都會在這裡發出可以復原的通知。",
15
+ pending: "等待擁有者確認…", unavailable: "目前無法使用這個設定,請再次檢查。",
16
+ unknown: "尚未確認變更,請先檢查儲存的設定再試一次。", retry: "再次檢查",
17
+ },
18
+ });
19
+ const copy = key => t(`hubPageSharing.${key}`);
20
+ const path = "/api/settings/hub/share-from-hub";
21
+ export function HubPageSharingSettings() {
22
+ const [enabled, setEnabled] = useState(null), [busy, setBusy] = useState(false), [phase, setPhase] = useState("");
23
+ const owner = useRef({ live: true, seq: 0, busy: false });
24
+ const read = async () => {
25
+ const seq = ++owner.current.seq;
26
+ let result; try { result = await api(path); } catch { result = null; }
27
+ if (!owner.current.live || owner.current.seq !== seq) return;
28
+ if (result?.ok && typeof result.body?.enabled === "boolean") { setEnabled(result.body.enabled); setPhase(""); }
29
+ else { setEnabled(null); setPhase("unavailable"); }
30
+ };
31
+ useEffect(() => { owner.current.live = true; void read(); return () => { owner.current.live = false; owner.current.seq++; }; }, []);
32
+ const change = async value => {
33
+ if (enabled === null || owner.current.busy) return;
34
+ owner.current.busy = true; owner.current.seq++; setBusy(true); setPhase("");
35
+ try {
36
+ const result = await confirmedWrite(path, { method: "PUT", body: { enabled: value }, resendable: true, label: copy("title"),
37
+ onPending: () => { if (owner.current.live) setPhase("pending"); } });
38
+ if (!owner.current.live) return;
39
+ if (result.ok) await read();
40
+ else { setEnabled(null); setPhase("unknown"); }
41
+ } catch { if (owner.current.live) { setEnabled(null); setPhase("unknown"); } }
42
+ finally { owner.current.busy = false; if (owner.current.live) setBusy(false); }
43
+ };
44
+ return html`<div class="hub-update-consent">
45
+ <label class="check hub-update-switch"><input class="s-ui-toggle" type="checkbox" role="switch" id="hubShareFromHub"
46
+ checked=${enabled === true} disabled=${enabled === null || busy} aria-describedby="hubShareFromHub-note"
47
+ onChange=${event => { void change(event.target.checked); }} /><span>${copy("switch")}</span></label>
48
+ <p class="note" id="hubShareFromHub-note">${copy("hint")}</p>
49
+ ${phase ? html`<p role="status">${copy(phase)}</p>` : null}
50
+ ${enabled === null && !busy && phase ? html`<button class="btn btn-sm" type="button" onClick=${read}>${copy("retry")}</button>` : null}
51
+ </div>`;
52
+ }
@@ -21,11 +21,12 @@ import { confirmPlace, pendingView } from "./hub-confirm-place.js";
21
21
  import { hq } from "./hub-quick-strings.js";
22
22
  import { hp } from "./hub-pairing-progress-strings.js";
23
23
  import { hpf, pairingCodeState, pairingFailure } from "./hub-pairing-form-strings.js";
24
+ import { HubPageSharingSettings } from "./settings-hub-page-sharing.js";
24
25
  import { HubUpdateConsent } from "./settings-hub-updates.js";
25
26
 
26
27
  register("hubSharingFleet", {
27
- en: { hint: "To pause and resume without clearing the allow list, open this agent under My shared agents on the Hub. Turning Share off stops sharing." },
28
- "zh-TW": { hint: "要保留允許名單並暫停或繼續分享,請在 Hub「我分享的 Agent」開啟這個 Agent。關閉「分享」會停止分享。" },
28
+ en: { hint: "To pause and resume without clearing the allow list, open this agent under My agents on the Hub. Turning Share off stops sharing." },
29
+ "zh-TW": { hint: "要保留允許名單並暫停或繼續分享,請在 Hub「我的 Agent」開啟這個 Agent。關閉「分享」會停止分享。" },
29
30
  });
30
31
  const CONNECT_ERRORS = { address: "errAddress", code: "errCode", busy: "errBusy", unreachable: "errUnreachable", refused: "errRefused" };
31
32
  const HOLDS = new Set(["unknown_outcome", "expired", "unsaved", "refused", "revoked", "disconnected", "rejected"]);
@@ -288,6 +289,7 @@ function HubExposures({ client, pairing }) {
288
289
  }, [rows, msg]);
289
290
  return html`<div class="hub-exposures">
290
291
  <h4>${hw("sharedTitle")}</h4>
292
+ ${pairing?.link === "online" ? html`<${HubPageSharingSettings} />` : null}
291
293
  <p class="note">${hw("agentLead")}</p>
292
294
  <p class="note">${hw("classicRoomLead")}</p>
293
295
  <p class="note hub-sharing-hint">${t("hubSharingFleet.hint")}</p>
@@ -23,6 +23,7 @@ const ROWS = [
23
23
  ["general.location", "agent-defaults", "#general-location", null, null, ["general", "windows", "paired PC", "host", "location"], ["General", "Windows", "電腦", "主機", "執行位置"], L("Run General on", "General 執行位置")],
24
24
  // alpha.6 feedback (#2): "hub" found nothing — Settings → Hub's cards. Connect to a Hub is drawn once membership is on.
25
25
  ["hub.membership", "hub", "#hubMemberEnabled", null, "hub_member.enabled", ["hub", "team hub", "membership", "connect", "join", "pair", "share agents"], ["Hub", "團隊 Hub", "成員", "連線", "加入", "配對", "分享"], L("Allow this fleet to connect to a Hub", "允許這個 Fleet 連線至 Hub")],
26
+ ["hub.page-sharing", "hub", "#hubShareFromHub", null, "hub_member.share_from_hub", ["hub", "share agents", "undo", "owner", "agent list"], ["Hub", "分享 Agent", "復原", "擁有者", "清單"], L("Let me share agents from the Hub page", "允許我從 Hub 頁面分享 Agent")],
26
27
  ["hub.company-address", "hub", "#hubCompanyAddress", null, null, ["hub", "company account", "company link", "sign in", "connect", "join"], ["Hub", "公司帳號", "公司連結", "登入", "連接", "加入"], L("Hub address", "Hub 位址")],
27
28
  ["hub.connect", "hub", "#hub-connect", null, null, ["hub", "connect to a hub", "pairing code", "hub address", "fingerprint", "pair", "unpair", "disconnect", "join"], ["Hub", "連線至 Hub", "配對碼", "Hub 位址", "指紋", "配對", "解除配對", "中斷連線", "加入"], L("Connect to a Hub", "連線至 Hub")],
28
29
  ["quota.notices", "notifications", "#quota-notices", null, "defaults.quota_notice", ["usage", "quota", "notifications", "remaining", "weekly"], ["用量", "額度", "提醒", "通知", "剩餘"], L("Quota notices", "用量提醒")],
@@ -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
  });
@@ -341,8 +341,8 @@ export function signInHref() {
341
341
 
342
342
  // ── AgEnD Hub P1 (docs/design/hub-ui-client.md): the page's mark, set by the listener that served it ──
343
343
  register("hubShell", {
344
- en: { brand: "AgEnD Hub", ask: "Ask", exposures: "My shared agents", admin: "Administration", preview: "Preview" },
345
- "zh-TW": { brand: "AgEnD Hub", ask: "提問", exposures: "我分享的 Agent", admin: "管理", preview: "預覽版" },
344
+ en: { brand: "AgEnD Hub", ask: "Ask", exposures: "My agents", admin: "Administration", preview: "Preview" },
345
+ "zh-TW": { brand: "AgEnD Hub", ask: "提問", exposures: "我的 Agent", admin: "管理", preview: "預覽版" },
346
346
  });
347
347
  function hubMarks() {
348
348
  const tokens = String((typeof document !== "undefined" && document.body?.dataset?.hub) || "").split(/\s+/);
@@ -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.",
@@ -703,6 +705,8 @@ register("pendingSummary", {
703
705
  "hub.run.stop": "Stop this fleet's Hub and pause chats with shared agents. Valid sign-ins can resume when it runs again. Nothing is deleted.",
704
706
  "hub.preview.on": "Serve HTML previews on this Hub at port {0}.",
705
707
  "hub.preview.off": "Stop serving HTML previews on this Hub.",
708
+ "hub.pageSharing.enable": "Allow the connected Hub to apply sharing changes requested by this Fleet's owner, and send its agent names and descriptions to that owner.",
709
+ "hub.pageSharing.disable": "Turn off sharing from the Hub page and stop sending its agent list. Existing shares are unchanged.",
706
710
  "hub.membership.enable": "Enable this fleet's Hub membership. Connecting and sharing an agent are separate choices.",
707
711
  "hub.membership.disable": "Disable this fleet's Hub membership. New Hub work and answer disclosure stop; existing agent conversations remain.",
708
712
  "hub.companyJoin.confirm": "Connect this Fleet to Hub {0} using your company account. Agent sharing stays separate.",
@@ -734,6 +738,8 @@ register("pendingSummary", {
734
738
  "host_cli.install_confirm": "在 AgEnD 主機上安裝 {0}",
735
739
  "host_cli.update": "在 AgEnD 這台電腦上把 {0} 更新到 {1}(AgEnD 稽核過的版本),使用登錄表裡的更新指令(無人值守執行)。只會更新這個 CLI;頁面送來的內容不會被執行。",
736
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` 已經改用原生安裝時才會執行。",
737
743
  "runtime_cli.install": "在已配對的 Windows 電腦 {2} 上安裝 {0} {1}:AgEnD 固定的版本,並在那台電腦上檢查(固定的雜湊、registry 簽章、發行者簽章)。只會安裝這個 CLI;頁面送來的內容不會被執行。仍需要那台電腦主人自己的開關允許。",
738
744
  "runtime_cli.update_latest": "如果已配對的 Windows 電腦 {1} 上已經有 {0},這會把它更新到廠商的「最新版」(未經 AgEnD 稽核):Runtime 會下載廠商自己的 manifest 指定的版本,並在那台電腦上檢查它的雜湊與發行者簽章,才會切換過去。",
739
745
  "hub.browserCertificate.replace": "更換 Hub 瀏覽器憑證;成員傳輸身分保持不變。",
@@ -747,6 +753,8 @@ register("pendingSummary", {
747
753
  "hub.run.stop": "停止這個 Fleet 的 Hub,暫停與分享的 Agent 的對話。再次執行後,仍有效的登入狀態可以恢復。不會刪除任何資料。",
748
754
  "hub.preview.on": "在這個 Hub 的連接埠 {0} 提供 HTML 預覽。",
749
755
  "hub.preview.off": "停止在這個 Hub 提供 HTML 預覽。",
756
+ "hub.pageSharing.enable": "允許已連接的 Hub 套用這個 Fleet 擁有者要求的分享變更,並把 Agent 名稱與說明傳給擁有者。",
757
+ "hub.pageSharing.disable": "關閉從 Hub 頁面分享並停止傳送 Agent 清單,既有分享不變。",
750
758
  "hub.membership.enable": "啟用這個 Fleet 的 Hub 成員功能。連接與分享 Agent 需另外選擇。",
751
759
  "hub.membership.disable": "停用這個 Fleet 的 Hub 成員功能。停止新的 Hub 工作與回答傳送;既有 Agent 對話會保留。",
752
760
  "hub.companyJoin.confirm": "以公司帳號將這個 Fleet 連接到 Hub {0}。分享 Agent 需另外選擇。",
@@ -779,6 +787,8 @@ const pendingSummaryArguments = Object.fromEntries([
779
787
  ["host_cli.install_confirm", "s"],
780
788
  ["host_cli.update", "ss"],
781
789
  ["host_cli.update_latest", "s"],
790
+ ["host_cli.native_switch", "s"],
791
+ ["host_cli.npm_remove", ""],
782
792
  ["runtime_cli.install", "sss"],
783
793
  ["runtime_cli.update_latest", "ss"],
784
794
  ["hub.browserCertificate.replace", ""],
@@ -792,6 +802,8 @@ const pendingSummaryArguments = Object.fromEntries([
792
802
  ["hub.run.stop", ""],
793
803
  ["hub.preview.on", "s"],
794
804
  ["hub.preview.off", ""],
805
+ ["hub.pageSharing.enable", ""],
806
+ ["hub.pageSharing.disable", ""],
795
807
  ["hub.membership.enable", ""],
796
808
  ["hub.membership.disable", ""],
797
809
  ["hub.companyJoin.confirm", "s"],
@@ -79,7 +79,8 @@ export function applyStatus(d) {
79
79
  */
80
80
  export const NOTICES_KEPT = 500;
81
81
  function noticesState(enabled, byId, seen) {
82
- const items = [...byId.values()].sort((a, b) => b.id - a.id).slice(0, NOTICES_KEPT);
82
+ const all = [...byId.values()].sort((a, b) => b.id - a.id);
83
+ const items = all.filter((notice, index) => index < NOTICES_KEPT || (notice.hubSharing?.undoUntil || 0) > Date.now());
83
84
  return { enabled, items, seen, unread: items.filter((n) => n.id > seen).length };
84
85
  }
85
86
  const validNotice = (n) => !!n && Number.isSafeInteger(n.id) && n.id > 0 && typeof n.text === "string";
@@ -91,7 +92,10 @@ export function mergeNoticeList(cur, d) {
91
92
  return noticesState(!!(d && d.enabled === true), byId, Math.max(cur ? cur.seen | 0 : 0, d ? d.seen | 0 : 0));
92
93
  }
93
94
  export function addNotice(cur, n) {
94
- if (!cur || !cur.enabled || !validNotice(n) || cur.items.some((x) => x.id === n.id)) return cur;
95
+ if (!cur || !cur.enabled || !validNotice(n)) return cur;
96
+ const previous = cur.items.find(x => x.id === n.id);
97
+ if (previous && (!n.hubSharing || !previous.hubSharing || n.hubSharing.key !== previous.hubSharing.key
98
+ || n.hubSharing.version <= previous.hubSharing.version)) return cur;
95
99
  return noticesState(true, new Map([...cur.items, n].map((x) => [x.id, x])), cur.seen | 0);
96
100
  }
97
101
  /** The newest Notice the status frame names that the page does not have yet (a polling page hears no `notice`). 0: none. */
@@ -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
- const retryUrl = (path, attempt) => (attempt ? `${path}?retry=${attempt}` : path);
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
- if (typeof deps.linkOf === "function") items.push(["copyLink", deps.t("chat.copyLink"), async () => { const ok = await deps.copyText(deps.linkOf(row)); deps.notice(deps.t(ok ? "chat.copied" : "chat.copyFailed"), ok); }]);
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");