@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
@@ -75,6 +75,7 @@ import { CALLING, activeFurniture, bubbleAt, hiddenBy, bubbleRank, NIGHT, WANDER
75
75
  import { actsOk, createOfficeStore } from "./fleet-office-store.js";
76
76
  import { badgeOf, fixedOf, mergeLevels } from "./fleet-office-levels.js";
77
77
  import { OfficeCard, cardModel } from "./fleet-office-card.js";
78
+ import { PLAY, createHold, playAllowed, pruneReactions, reactionAt } from "./fleet-office-play.js";
78
79
  import { POLL_MS } from "./fleet-traffic.js";
79
80
  import { OfficeEditor, officeForSave } from "./fleet-office-editor.js";
80
81
  import { LayoutEditor, handlesOf } from "./fleet-office-layout.js";
@@ -99,7 +100,7 @@ register("orgo", {
99
100
  b_working: "On it.|Typing…|Almost there|In the zone|One more test", b_idle: "Tea time|Ready when you are|Stretching|Anything for me?",
100
101
  b_paused: "Zzz…|Back later", b_stopped: "Off duty|Zzz…", b_needs: "Need you!|A question for you|Over here!",
101
102
  b_crashed: "Ouch, crashed|Help!", b_stuck: "Hmm, stuck?|Still thinking…",
102
- hideAsleep: "Hide paused and stopped", nightOn: "Bedtime 0–6: the idle sleep", layoutIgnored: "Its saved layout does not fit this style: drawn as the style's own.",
103
+ hideAsleep: "Hide paused and stopped", nightOn: "Bedtime 0–6: the idle sleep", playOn: "Drag and pat", playStill: "Off while reduced motion is on", layoutIgnored: "Its saved layout does not fit this style: drawn as the style's own.",
103
104
  styleForAll: "The whole fleet's style, for everyone: every device and share link", styleHere: "The whole fleet's style in this browser",
104
105
  styleFailed: "The style was not saved for everyone ({0}).", styleBusy: "Too many changes. Try again in a minute.",
105
106
  fit: "Fit the office", overview: "Overview: click to move there", fullscreen: "Fullscreen", exitFullscreen: "Exit fullscreen",
@@ -128,7 +129,7 @@ register("orgo", {
128
129
  b_working: "處理中|打字中…|快好了|專心中|再測一次", b_idle: "喝茶中|隨時可以開工|伸個懶腰|有事找我嗎?",
129
130
  b_paused: "Zzz…|晚點回來", b_stopped: "下班了|Zzz…", b_needs: "需要你!|有個問題|在這裡!",
130
131
  b_crashed: "糟糕,當掉了|救命!", b_stuck: "嗯,卡住了?|還在想…",
131
- hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
132
+ hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", playOn: "拖曳與摸頭", playStill: "開啟「減少動態效果」時關閉", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
132
133
  styleForAll: "整個 fleet 的風格,所有人共用:每台裝置與分享連結都一樣", styleHere: "這個瀏覽器裡整個 fleet 的風格",
133
134
  styleFailed: "風格沒有替所有人儲存({0})。", styleBusy: "變更太頻繁,請一分鐘後再試。",
134
135
  fit: "顯示整個辦公室", overview: "總覽:點一下移到那裡", fullscreen: "全螢幕", exitFullscreen: "結束全螢幕",
@@ -587,6 +588,18 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
587
588
  }
588
589
  ctx.restore();
589
590
  }
591
+ // M-3293: a pat or a feed — a few hearts rising over the head (the palette's danger red, the text font: no new art)
592
+ // and their words in a bubble, while it lasts.
593
+ const t0 = now(), reacting = ms && p.reacts && p.reacts.size && pruneReactions(p.reacts, t0) ? p.reacts : null;
594
+ if (reacting) {
595
+ ctx.save();
596
+ ctx.fillStyle = env.pal.danger; ctx.font = "700 11px system-ui, sans-serif"; ctx.textAlign = "center"; ctx.textBaseline = "bottom";
597
+ for (const sp of speakers) {
598
+ const ra = reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
599
+ if (ra) for (const h of ra.hearts) { ctx.globalAlpha = h.alpha; ctx.fillText("♥", sp.x + h.dx, sp.y + h.dy); }
600
+ }
601
+ ctx.restore();
602
+ }
590
603
  // Speech bubbles: a short line for the state, now and then (typed out; whole at once when still), placed so no two
591
604
  // overlap (placeBubbles; #2431).
592
605
  const bubbles = [];
@@ -594,9 +607,14 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
594
607
  if (sp.look.dim || sp.look.pose === "away") continue;
595
608
  const says = sp.look.night ? "paused" : sp.look.state; // asleep at night: its "Zzz…" lines
596
609
  // What an agent says itself (office_set, #2578): whole, kept over the area's thinning like a call.
597
- const act = p.acts && p.acts.get(sp.look.name), own = actLive(act, says, Date.now(), p.actSeen) && act.say ? act.say : null;
610
+ const act = p.acts && p.acts.get(sp.look.name), ra = reacting && reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
611
+ // M-3293: a pat's or a feed's words first — the pack's own for it ("pat" / "feed" in its bubbles: theirs, their
612
+ // set's, the pack's), one picked by when it happened, else the page's.
613
+ const packSays = ra ? linesFor(reacting.get(sp.look.name).kind, p.lang, sk.pack, null, sp.look.name) : [];
614
+ const raSays = ra ? (packSays.length ? packSays[Math.floor(reacting.get(sp.look.name).t0) % packSays.length] : ra.say) : null;
615
+ const own = raSays ? raSays : actLive(act, says, Date.now(), p.actSeen) && act.say ? act.say : null;
598
616
  const b = own ? { text: own, shown: [...own].length } : bubbleAt(sp.look.name, says, ms, linesFor(says, p.lang, sk.pack, p.lines, sp.look.name)); // #3681: theirs, their set's, the pack's
599
- if (b) bubbles.push({ key: sp.look.name, area: sp.area, state: sp.look.state, calling: CALLING.has(sp.look.state), rank: own ? 0 : bubbleRank(sp.look.state), shown: b.shown,
617
+ if (b) bubbles.push({ key: sp.look.name, area: sp.area, state: sp.look.state, calling: CALLING.has(sp.look.state), rank: own ? 0 : bubbleRank(sp.look.state), shown: b.shown, ...(raSays ? { keep: true } : {}),
600
618
  box: bubbleBox(ctx, sp.x, sp.y, b.text), tail: { x: sp.x, y: sp.y }, sp, b });
601
619
  }
602
620
  // A crowded area speaks less (thinBubbles: calls, then work, a few at most); no bubble covers a name tag. `defer`
@@ -604,7 +622,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
604
622
  const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags);
605
623
  const say = () => { T(); for (const { sp, b, dy } of placed) sk.drawBubble(ctx, sp.x, sp.y, [...b.text].slice(0, b.shown).join(""), env, -dy); };
606
624
  if (defer) defer.push(say); else say();
607
- return walking || up.length > 0 || p.flights.size() > 0 || post.some((it) => it.t > 0) || rising.length > 0;
625
+ return walking || up.length > 0 || p.flights.size() > 0 || post.some((it) => it.t > 0) || rising.length > 0 || !!reacting;
608
626
  }
609
627
  /**
610
628
  * #2661: an NPC's name tag (a furniture item's label) — with the title a pack pins on it (`levels.fixed` by its id),
@@ -752,6 +770,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
752
770
  const [nightNow, setNightNow] = useState(() => isNight());
753
771
  useEffect(() => { if (!nightOn) return undefined; setNightNow(isNight()); const h = setInterval(() => setNightNow(isNight()), NIGHT.TICK); return () => clearInterval(h); }, [nightOn]);
754
772
  const night = nightOn && nightNow;
773
+ // M-3293: "Drag and pat" here (per device, on by default); in force only where playAllowed says (below).
774
+ const [playOn, setPlayOn] = useState(() => store.playOn());
775
+ const [, setTellRev] = useState(0); // M-3293: the card's Tell box redrawn when ticked
755
776
  const [lobbyOn, setLobbyOn] = useState(() => store.lobbyTile()); // #2554: All offices' lobby tile
756
777
  const [packs, setPacks] = useState([]); // the skin packs the host keeps: [{ id, name, sha }]
757
778
  const [packSkins, setPackSkins] = useState(() => new Map()); // id@sha → a loaded skin, or null (not a pack)
@@ -1101,6 +1122,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1101
1122
  // M-3286: the office's "Idle people stay in their own area" (Edit offices): strolls stay in the area, no visits.
1102
1123
  const ownArea = !!custom && custom.stayInArea === true;
1103
1124
  const visitMemo = useMemo(() => ({ claims: new Map(), idle: null }), [skin]);
1125
+ // M-3293: play — never on a share link's page (no onOpen there, or its own `talk`), with reduced motion, in All
1126
+ // offices, the carousel or Edit layout. `hold`: the person picked up (carried where the pointer is, walked back from
1127
+ // where they are dropped); `reacts`: pats and feeds showing (name → { kind, t0 }). The viewer's own: no request.
1128
+ const shared = talk !== undefined || typeof onOpen !== "function";
1129
+ const play = playAllowed({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
1130
+ const hold = useMemo(() => createHold(), []), reacts = useRef(new Map()), walkNow = useRef(null), holdTimer = useRef(null);
1131
+ useEffect(() => { if (!play) { hold.cancel(); reacts.current.clear(); } }, [play]);
1104
1132
  useEffect(() => {
1105
1133
  if (!zones || overview) return undefined;
1106
1134
  const go = () => {
@@ -1108,11 +1136,14 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1108
1136
  // An act's walk; not someone in bed for the night (#2568: bedtime wins, as for mail).
1109
1137
  for (const d of desksOf(L)) { const a = actsHere.get(d.node.name), at = !d.night && actLive(a, d.node.state, Date.now(), actSeen.current) ? actTarget(a, L, walkers, t) : null; if (at) to.set(d.node.name, at); }
1110
1138
  for (const [name, at] of mail.targets(L, t)) to.set(name, at);
1139
+ const held = hold.held(); // M-3293: carried: where the pointer is, no walk
1140
+ if (held) to.set(held.name, held.at);
1111
1141
  walkers.sync(to, t, L, still);
1112
1142
  // Reduced motion has no loop: drawn again here, or an act's walk (set after the scene was drawn) never shows.
1113
1143
  if (still) { if (scene.current && !globalThis.document?.hidden) draw(0); } else loop.current?.wake();
1114
1144
  };
1115
1145
  go();
1146
+ walkNow.current = go;
1116
1147
  if (still) return undefined;
1117
1148
  const h = setInterval(go, WANDER.TICK);
1118
1149
  return () => clearInterval(h);
@@ -1390,7 +1421,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1390
1421
  const parts = tiles.map((tl, i) => ({ ...partOf(tl.L, tileLooks[i], tl.skin, tl.zones, tl.walkers, tl.flights), night, key: tl.key, prefix: tl.prefix, tile: arranged.tiles[i], ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(tl.skin) }));
1391
1422
  scene.current = { ...base, overview: true, parts, lay: arranged };
1392
1423
  } else {
1393
- scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin) } };
1424
+ scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current } };
1394
1425
  }
1395
1426
  if (still) draw(0); else loop.current?.wake();
1396
1427
  }, [L, looks, skin, pal, size.w, size.h, ratio, matte, overview, tiles, tileLooks, arranged, ghosts, night, mail, actsHere, lv, wordsOf]);
@@ -1580,12 +1611,47 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1580
1611
  pinch: (from, to) => { raw.current = Math.min(OK_MAX, Math.max(OK_MIN, raw.current * (to.dist / from.dist))); setView(pinchOffice(view0(), from, to, raw.current)); } });
1581
1612
  /** Where a drag pans: the canvas, and Edit layout's overlay off its handles (the controls, the bar and the list: never). */
1582
1613
  const onScene = (el) => !!el && (el === canvasRef.current || (typeof el.closest === "function" && !!el.closest(".ol-svg") && !el.closest(".ol-handle")));
1614
+ /** M-3293: someone picked up — their walker set down under the pointer, no card, no tooltip, the click after it swallowed. */
1615
+ const pickedUp = (pointerId) => {
1616
+ const h = hold.held();
1617
+ if (!h) return;
1618
+ // Captured only now: a press that stays a click must reach the canvas (its card), which a capture would take away.
1619
+ try { stageRef.current.setPointerCapture(pointerId); } catch { /* gone */ }
1620
+ walkers.place(h.name, h.at); drag.current.swallow = true;
1621
+ setTip(null); setCard(null); loop.current?.wake();
1622
+ };
1583
1623
  const onDown = (e) => {
1584
1624
  lastType.current = e.pointerType || "mouse";
1585
1625
  if (!onScene(e.target)) return;
1626
+ // M-3293: a press on a person may pick them up — a mouse once it moves (no pan then), a touch once held still
1627
+ // (LONG_MS; a finger that moves first pans, as before).
1628
+ if (play && e.isPrimary !== false && !(e.pointerType === "mouse" && e.button !== 0)) {
1629
+ const d = deskOf(e), w = pointOf(e);
1630
+ const st = d && d.node && d.node.i && w ? hold.down(e.pointerId, e.pointerType || "mouse", w.x, w.y, now(), d.node.name, e.clientX, e.clientY) : hold.down(e.pointerId, "mouse", 0, 0, 0, null);
1631
+ if (st === "maybe") return; // no pan: a click (their card), or a pick-up once it moves
1632
+ if (st === "press") { const id = e.pointerId; clearTimeout(holdTimer.current); holdTimer.current = setTimeout(() => { if (hold.tick(now()) === "held") pickedUp(id); }, PLAY.LONG_MS); }
1633
+ }
1586
1634
  g.down(e);
1587
1635
  if (drag.current.pts.size === 2) raw.current = view0().k; // a pinch starts from the zoom shown
1588
1636
  };
1637
+ /** M-3293: while a press may pick someone up it is theirs (no pan); once held it carries them; a finger that moved first pans. */
1638
+ const onStageMove = (e) => {
1639
+ if (hold.state()) {
1640
+ const w = pointOf(e), was = hold.state();
1641
+ const st = w ? hold.move(e.pointerId, w.x, w.y, now(), e.clientX, e.clientY) : hold.state();
1642
+ if (st === "held") { if (was !== "held") pickedUp(e.pointerId); else { const h = hold.held(); walkers.place(h.name, h.at); loop.current?.wake(); } return; }
1643
+ if (st === "maybe" || st === "press") return;
1644
+ if (st === "pan") { clearTimeout(holdTimer.current); hold.cancel(); }
1645
+ }
1646
+ g.move(e);
1647
+ };
1648
+ const onStageUp = (e) => {
1649
+ clearTimeout(holdTimer.current);
1650
+ const r = hold.up(e.pointerId);
1651
+ if (r) { walkers.place(r.name, r.at); drag.current.swallow = true; setTimeout(() => { if (!drag.current.pts.size) drag.current.swallow = false; }, 0); walkNow.current?.(); }
1652
+ g.up(e);
1653
+ };
1654
+ const onStageCancel = (e) => { clearTimeout(holdTimer.current); const r = hold.up(e.pointerId); if (r) walkNow.current?.(); g.up(e); };
1589
1655
  const onWheel = (e) => {
1590
1656
  if (!onScene(e.target) && !(typeof e.target?.closest === "function" && e.target.closest(".ol-handle, .oo-tile-label"))) return;
1591
1657
  e.preventDefault();
@@ -1816,6 +1882,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1816
1882
  </select></label>
1817
1883
  <${People} nodes=${everyone} pinned=${f.pinned} onChange=${(pinned) => setF({ ...f, pinned })} />` : null}
1818
1884
  <label class="check oo-hide-asleep"><input type="checkbox" checked=${hideAsleep} onChange=${() => { const v = !hideAsleep; store.saveHideAsleep(v); setHideAsleep(v); setTip(null); }} /><span>${to("hideAsleep")}</span></label>
1885
+ ${zones && !overview && !shared ? html`<label class="check oo-play" title=${still ? to("playStill") : null}><input type="checkbox" checked=${playOn && !still} disabled=${still}
1886
+ onChange=${() => { const v = !playOn; store.savePlayOn(v); setPlayOn(v); }} /><span>${to("playOn")}</span></label>` : null}
1819
1887
  ${zones || overview ? html`<label class="check oo-night"><input type="checkbox" checked=${nightOn} onChange=${() => { const v = !nightOn; store.saveNightOn(v); setNightOn(v); }} /><span>${to("nightOn")}</span></label>` : null}
1820
1888
  <label class="check oo-dialogue" title=${to("dialogueTitle")}><input type="checkbox" checked=${dialogueOn} onChange=${toggleDialogue} /><span>${to("dialogue")}</span></label>
1821
1889
  ${overview ? html`<label class="check oo-lobby-tile" title=${lobbyAll.length ? undefined : to("lobbyEveryone")}><input type="checkbox" checked=${lobbyOn && lobbyAll.length > 0}
@@ -1856,7 +1924,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1856
1924
  ${editing && !overview && !carouselPick ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
1857
1925
  ask=${ask} current=${() => shown.current} onSaved=${adopt} onClose=${() => setEditing(false)} />` : null}
1858
1926
  ${overview || people.length || L.rooms.length ? null : html`<p class="note oo-empty">${to("nobody")} ${auto && (f.team || f.pinned.length) ? html`<button type="button" class="btn btn-sm" onClick=${() => setF({ team: "", pinned: [] })}>${to("everyone")}</button>` : null}</p>`}
1859
- <div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${g.move} onPointerUp=${g.up} onPointerCancel=${g.up}
1927
+ <div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${onStageMove} onPointerUp=${onStageUp} onPointerCancel=${onStageCancel}
1860
1928
  onWheel=${onWheel} onKeyDown=${onKeyDown} onFocusIn=${onFocusIn} onClickCapture=${g.clickCapture}>
1861
1929
  ${dialogueOn ? html`<div class="sr-only oo-dialogue-live" aria-live="polite">${dlgSay}</div>` : null}
1862
1930
  <canvas ref=${canvasRef} class=${`oo-canvas${(tipDesk && tipDesk.node.i) || dlgHot ? " hot" : ""}`} role="application" tabindex="0" aria-label=${to(carouselPick ? "labelCarousel" : overview ? "labelAll" : "label")}
@@ -1879,7 +1947,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
1879
1947
  state: stateWords(cardOf.node), now: caption(officePose(cardOf.node.state), cardOf.node.state),
1880
1948
  where: [cardOf.office || (custom ? custom.name : to("allOffice")), cardOf.area].filter(Boolean).join(" · ") })}
1881
1949
  avatar=${drawAvatar} sheet=${phone || size.w < SHEET_W} place=${(el) => { cardEl.current = el; placeCard(); }}
1882
- onChat=${onOpen ? () => { const n = cardOf.node.name; setCard(null); open(n); } : null} onFind=${findCard} onClose=${closeCard} />` : null}
1950
+ onChat=${onOpen ? () => { const n = cardOf.node.name; setCard(null); open(n); } : null} onFind=${findCard} onClose=${closeCard}
1951
+ onReact=${play ? (kind) => { const n = cardOf.node.name; reacts.current.set(n, { kind, t0: now() }); loop.current?.wake(); if (store.tellOn(n)) void store.tell(n, kind); } : null}
1952
+ tell=${play ? { on: store.tellOn(cardOf.node.name), set: (v) => { store.saveTell(cardOf.node.name, v); setTellRev((x) => x + 1); } } : null} />` : null}
1883
1953
  <ul class="oo-desks" aria-label=${to("desks")}>${people.map((d) => {
1884
1954
  const nt = nodeText(d.node), cap = caption(officePose(d.node.state), d.node.state), where = d.office ? ` · ${d.office}` : "";
1885
1955
  return html`<li key=${d.key}>${d.node.i
@@ -23,7 +23,7 @@ register("hostinstall", {
23
23
  output: "Installer output (last lines)",
24
24
  started: "Installing {0}…", confirm: "Install {0} on the AgEnD host",
25
25
  err_unsupported: "This CLI cannot be installed from here.", err_already: "{0} is already installed on this host.",
26
- err_busy: "Another install or sign-in is running. Wait for it to end, or cancel it.", err_shutting_down: "AgEnD is shutting down.",
26
+ err_busy: "Another install or sign-in is running. Wait for it to end, or cancel it.", err_cli_self_updating: "{0} is updating itself right now. Try again in a few minutes.", err_shutting_down: "AgEnD is shutting down.",
27
27
  err_not_allowed: "Only a fleet admin signed in on this machine or its network can install a CLI.",
28
28
  err_install_needs_a_local_admin: "Only a fleet admin signed in on this machine or its network can install a CLI.",
29
29
  err_install_not_over_public_link: "Installing is not available over the public link. Open the dashboard on the machine running AgEnD.",
@@ -44,7 +44,7 @@ register("hostinstall", {
44
44
  output: "安裝程式輸出(最後幾行)",
45
45
  started: "正在安裝 {0}…", confirm: "在 AgEnD 主機上安裝 {0}",
46
46
  err_unsupported: "這個 CLI 不能從這裡安裝。", err_already: "這台主機已經安裝 {0}。",
47
- err_busy: "另一個安裝或登入正在進行。請等它結束,或先取消它。", err_shutting_down: "AgEnD 正在關閉。",
47
+ err_busy: "另一個安裝或登入正在進行。請等它結束,或先取消它。", err_cli_self_updating: "{0} 正在自行更新,請過幾分鐘再試。", err_shutting_down: "AgEnD 正在關閉。",
48
48
  err_not_allowed: "只有在這台機器或它的網路上登入的 fleet 管理員,才能安裝 CLI。",
49
49
  err_install_needs_a_local_admin: "只有在這台機器或它的網路上登入的 fleet 管理員,才能安裝 CLI。",
50
50
  err_install_not_over_public_link: "公開連結上不能安裝。請在執行 AgEnD 的機器上開啟儀表板。",
@@ -110,6 +110,46 @@ register("hostinstall", {
110
110
  updatedLatestNoVersion: "{0} 的更新程式已結束(結束碼 0),但之後讀不到已安裝的版本,不確定現在是哪個版本。",
111
111
  },
112
112
  });
113
+ // M-3307 (#4146): an npm-global Claude Code is offered a switch to Claude's native install (the audited release through claude.ai/install.sh, in the same window), and afterwards
114
+ // the removal of the npm copy as a separate step that says what it removes. Both are held changes like Install and Update; the page names only "claude-code".
115
+ register("hostinstall", {
116
+ en: {
117
+ nativeOffer: "Claude Code is installed with npm ({0}). An AgEnD restart can interrupt npm's own updates and leave `claude` half-installed. Claude's native install avoids that: switching installs {1}, the release AgEnD has audited, with claude.ai/install.sh.",
118
+ nativeSwitch: "Switch to native install", cardLabelNative: "Switch Claude Code on this AgEnD computer to Claude's native install",
119
+ runningNative: "Installing Claude Code {0} with Claude's native installer (started on {1}).",
120
+ nativeOk: "`claude` now runs from Claude's native install: {0} ({1}).",
121
+ nativeStillNpm: "The native installer finished, but `claude` still runs the npm copy ({0}), which comes first on PATH. Removing the npm copy finishes the switch.",
122
+ nativeUnverified: "The native installer finished, but `claude` could not be found afterwards. Read its last lines below.",
123
+ failedNative: "The switch to Claude's native install did not finish.",
124
+ npmLeft: "The npm copy is still at {0}. Removing it runs npm -g uninstall @anthropic-ai/claude-code in that npm folder; Claude's native install stays.",
125
+ npmRemove: "Remove the npm copy", cardLabelNpmRemove: "Remove the npm copy of Claude Code from this AgEnD computer",
126
+ runningNpmRemove: "Removing the npm copy of Claude Code (started on {0}).",
127
+ npmRemoved: "The npm copy was removed. `claude` runs {0} ({1}).",
128
+ npmNotRemoved: "npm finished, but the npm copy is still at {0}. Read its last lines below: removing it may need the account that installed it.",
129
+ failedNpmRemove: "The npm copy was not removed.",
130
+ err_not_npm: "Claude Code here is not an npm install, so there is nothing to switch.",
131
+ err_still_npm: "There is no native install of Claude Code yet: switch to it first, then remove the npm copy.",
132
+ err_no_npm_copy: "There is no npm copy of Claude Code to remove.",
133
+ },
134
+ "zh-TW": {
135
+ nativeOffer: "Claude Code 是用 npm 安裝的({0})。AgEnD 重啟時可能打斷 npm 自己的更新,讓 `claude` 只裝了一半。改用 Claude 的原生安裝就不會這樣:切換會用 claude.ai/install.sh 安裝 {1},也就是 AgEnD 稽核過的版本。",
136
+ nativeSwitch: "改用原生安裝", cardLabelNative: "把這台 AgEnD 電腦上的 Claude Code 改成 Claude 的原生安裝",
137
+ runningNative: "正在用 Claude 的原生安裝程式安裝 Claude Code {0}(從 {1} 啟動)。",
138
+ nativeOk: "`claude` 現在使用 Claude 的原生安裝:{0}({1})。",
139
+ nativeStillNpm: "原生安裝程式已結束,但 `claude` 仍然執行 npm 那份({0}),因為它在 PATH 上比較前面。移除 npm 那份就能完成切換。",
140
+ nativeUnverified: "原生安裝程式已結束,但之後找不到 `claude`。請看下方它的最後幾行。",
141
+ failedNative: "改用 Claude 原生安裝沒有完成。",
142
+ npmLeft: "npm 那份還在 {0}。移除會在那個 npm 目錄執行 npm -g uninstall @anthropic-ai/claude-code;Claude 的原生安裝會保留。",
143
+ npmRemove: "移除 npm 那份", cardLabelNpmRemove: "從這台 AgEnD 電腦移除 npm 安裝的 Claude Code",
144
+ runningNpmRemove: "正在移除 npm 安裝的 Claude Code(從 {0} 啟動)。",
145
+ npmRemoved: "已移除 npm 那份。`claude` 現在執行 {0}({1})。",
146
+ npmNotRemoved: "npm 已結束,但 npm 那份還在 {0}。請看下方它的最後幾行:可能需要當初安裝它的帳號才能移除。",
147
+ failedNpmRemove: "npm 那份沒有移除。",
148
+ err_not_npm: "這裡的 Claude Code 不是用 npm 安裝的,不需要切換。",
149
+ err_still_npm: "還沒有 Claude Code 的原生安裝:請先改用原生安裝,再移除 npm 那份。",
150
+ err_no_npm_copy: "沒有 npm 安裝的 Claude Code 可以移除。",
151
+ },
152
+ });
113
153
  const th = (k, ...v) => t(`hostinstall.${k}`, ...v);
114
154
  function installStyles() {
115
155
  if (typeof document === "undefined" || !document.head || document.querySelector('link[href="/assets/host-install.css"]')) return;
@@ -181,6 +221,9 @@ export const startHostInstall = (backend) => startHostCli("/ui/host-install", ba
181
221
  /** Update `backend` on the host to the audited release (AGEND-136). */
182
222
  /** AGEND-154 (Prism P2-1 on #3552): the update to the vendor's latest (`latest`, the one named exception) says so in the request — `acceptLatestUnaudited: true` — which is what lets the server run it; a page without this line sends `{ backend }`, and the server refuses. */
183
223
  export const startHostUpdate = (backend, latest = false) => startHostCli("/ui/host-update", backend, latest ? "cardLabelUpdateLatest" : "cardLabelUpdate", latest ? { acceptLatestUnaudited: true } : {});
224
+ /** M-3307: switch the host's npm-global Claude Code to Claude's native install; then, a separate step, remove the npm copy. */
225
+ export const startHostNativeSwitch = () => startHostCli("/ui/host-native-switch", "claude-code", "cardLabelNative");
226
+ export const startHostNpmRemove = () => startHostCli("/ui/host-npm-remove", "claude-code", "cardLabelNpmRemove");
184
227
 
185
228
  export async function cancelHostInstall() {
186
229
  const r = await post("/ui/host-install/cancel", {});
@@ -240,6 +283,14 @@ export function VersionLine({ row, label, blocked = false }) {
240
283
  return html`<div class="s-account-version" data-cli-update=${u.state} data-via=${u.via} data-latest=${u.latest ? "1" : "0"}>
241
284
  <p class="note s-account-why">${text}</p>
242
285
  ${u.button ? html`<span class="s-actions"><button type="button" class="btn btn-sm btn-primary s-account-update" aria-label=${`${label} — ${buttonLabel}`} disabled=${blocked || installRunning(state)} onClick=${() => { void startHostUpdate(row.backend, !!u.latest); }}>${updating ? th("updating") : buttonLabel}</button></span>` : null}
286
+ ${row.npmLeftover && row.backend === "claude-code" && !(runFor(state, row.backend) && runFor(state, row.backend).claude && runFor(state, row.backend).claude.npmLeftover) ? html`<div class="s-account-native" data-npm-left="1">
287
+ <p class="note s-account-why">${th("npmLeft", row.npmLeftover.dir)}</p>
288
+ <span class="s-actions"><button type="button" class="btn btn-sm btn-primary s-account-npm-remove" disabled=${blocked || installRunning(state)} onClick=${() => { void startHostNpmRemove(); }}>${th("npmRemove")}</button></span>
289
+ </div>` : null}
290
+ ${row.nativeSwitch && row.backend === "claude-code" ? html`<div class="s-account-native" data-native-offer="1">
291
+ <p class="note s-account-why">${th("nativeOffer", row.nativeSwitch.npmPackageDir, u.audited)}</p>
292
+ <span class="s-actions"><button type="button" class="btn btn-sm btn-primary s-account-native-switch" aria-label=${`${label} — ${th("nativeSwitch")}`} disabled=${blocked || installRunning(state)} onClick=${() => { void startHostNativeSwitch(); }}>${th("nativeSwitch")}</button></span>
293
+ </div>` : null}
243
294
  </div>`;
244
295
  }
245
296
 
@@ -259,7 +310,26 @@ export function HostInstallRun({ backend, label }) {
259
310
  const lines = Array.isArray(run.lines) ? run.lines : [];
260
311
  let text, cls = "";
261
312
  const update = run.mode === "update";
262
- if (run.phase === "running") text = update ? (run.latest ? th("runningUpdateLatest", label, "", run.startedOn) : th("runningUpdate", label, run.targetVersion || "?", run.startedOn)) : th("running", label, run.startedOn);
313
+ // M-3307: the switch and the removal say where `claude` resolves afterwards (a fresh login shell) and whether the npm copy is still there, with the removal offered on it.
314
+ const switching = run.mode === "native" || run.mode === "remove-npm";
315
+ const c = run.claude || null;
316
+ let npmLeft = null;
317
+ if (switching) {
318
+ if (run.phase === "running") text = run.mode === "native" ? th("runningNative", run.targetVersion || "?", run.startedOn) : th("runningNpmRemove", run.startedOn);
319
+ else if (run.phase === "ok" && run.mode === "native") {
320
+ if (!c || !c.path) { cls = "signin-message"; text = th("nativeUnverified"); }
321
+ else if (c.kind === "native") { cls = "signin-ok"; text = th("nativeOk", c.path, run.version || "?"); }
322
+ else { cls = "signin-warn"; text = th("nativeStillNpm", c.path); }
323
+ npmLeft = c && c.npmLeftover ? c.npmLeftover : null;
324
+ }
325
+ else if (run.phase === "ok") {
326
+ if (c && c.npmLeftover) { cls = "signin-warn"; text = th("npmNotRemoved", c.npmLeftover); }
327
+ else { cls = "signin-ok"; text = th("npmRemoved", (c && c.path) || "?", run.version || "?"); }
328
+ }
329
+ else if (run.phase === "failed" || run.phase === "timeout" || run.phase === "cancelled") text = th(run.mode === "native" ? "failedNative" : "failedNpmRemove");
330
+ }
331
+ if (switching) { /* said above */ }
332
+ else if (run.phase === "running") text = update ? (run.latest ? th("runningUpdateLatest", label, "", run.startedOn) : th("runningUpdate", label, run.targetVersion || "?", run.startedOn)) : th("running", label, run.startedOn);
263
333
  else if (run.phase === "ok" && update) {
264
334
  // An update says the version before and after (the binary probe's own readings). Exit code 0 is not enough: when the version read afterwards is not the audited release (`reached`
265
335
  // false), or could not be read (null), it is a warning that names the installed and the audited version, not a success.
@@ -284,6 +354,10 @@ export function HostInstallRun({ backend, label }) {
284
354
  ${lines.length ? html`<pre class="s-account-install-output" aria-label=${th("output")}>${lines.join("\n")}</pre>`
285
355
  : run.phase === "running" ? html`<small class="note">${th("runningNoOutput")}</small>` : null}
286
356
  ${run.cleanupFailed ? html`<p class="note">${th("cleanup")}</p>` : null}
357
+ ${npmLeft ? html`<div class="s-account-native" data-npm-left="1">
358
+ <p class="note s-account-why">${th("npmLeft", npmLeft)}</p>
359
+ <span class="s-actions"><button type="button" class="btn btn-sm btn-primary s-account-npm-remove" disabled=${installRunning(state)} onClick=${() => { void startHostNpmRemove(); }}>${th("npmRemove")}</button></span>
360
+ </div>` : null}
287
361
  <div class="s-actions">${run.phase === "running"
288
362
  ? html`<button type="button" class="btn btn-sm btn-ghost" disabled=${busy} onClick=${cancel}>${th(update ? "cancelUpdate" : "cancel")}</button>`
289
363
  : html`<button type="button" class="btn btn-sm btn-ghost" onClick=${() => dismissHostInstall(run.id)}>${th("dismiss")}</button>`}</div>
@@ -0,0 +1,35 @@
1
+ import { html, useEffect, useRef, useState } from "/assets/app-html.js";
2
+ import { register, t } from "/assets/app-i18n.js";
3
+ register("hubIntro", {
4
+ en: {title:"Introduction",hint:"One line about what this agent handles. Colleagues can see it. Up to 50 characters.",placeholder:"I handle…",save:"Save introduction",failed:"Could not save the introduction. Try again.",saved:"Saved. The agent can still change it later; this line shows who changed it last.",edit:"Edit",close:"Close",owner:"Last changed by the owner",agent:"Last changed by the agent",default:"From the Fleet description",review:"Colleagues will see this line. Check it and save.",cut:"Your earlier description was longer; only the first 50 characters are shown here.",assistant:"Hub assistant. Answers from this room's chat."},
5
+ "zh-TW": {title:"自我介紹",hint:"用一句話說明這個 Agent 負責什麼,同仁會看到。最多 50 個字。",placeholder:"我負責…",save:"儲存自我介紹",failed:"無法儲存自我介紹,請再試一次。",saved:"已儲存。Agent 之後仍然可以更改;這一行會顯示最後是誰改的。",edit:"編輯",close:"關閉",owner:"最後由擁有者修改",agent:"最後由 Agent 修改",default:"來自 Fleet 說明",review:"同仁會看到這一行,請確認後儲存。",cut:"你之前的說明比較長,這裡只顯示前 50 個字。",assistant:"Hub 提供的助理,根據這個房間的對話回答。"}
6
+ });
7
+ export const hi=(key,...args)=>t(`hubIntro.${key}`,...args);
8
+ const split=value=>[...new Intl.Segmenter(undefined,{granularity:"grapheme"}).segment(String(value??""))].map(v=>v.segment);
9
+ export const introCount=value=>split(value).length;
10
+ export const introPreview=value=>split(value).slice(0,50).join("");
11
+ export function AgentIntroEditor({exposure,client,onSaved=()=>{},embedded=false}){
12
+ const [text,setText]=useState(exposure.intro??""),[busy,setBusy]=useState(false),[message,setMessage]=useState("");
13
+ const generation=useRef(0),pending=useRef(false);
14
+ useEffect(()=>{generation.current++;setText(exposure.intro??"");setMessage("");return()=>{generation.current++;};},[exposure.id,exposure.intro,exposure.introAt]);
15
+ const count=introCount(text);
16
+ const save=async event=>{event.preventDefault();if(pending.current||count>50)return;const mine=generation.current;pending.current=true;setBusy(true);setMessage("");let result;
17
+ try{result=await client.saveAgentIntro(exposure.id,exposure.revision,text);}catch{result={ok:false};}
18
+ pending.current=false;if(mine!==generation.current)return;setBusy(false);setMessage(hi(result?.ok?"saved":"failed"));if(result?.ok)onSaved(result);
19
+ };
20
+ const Body=embedded?"div":"form";
21
+ return html`<section class=${embedded?"hub-agent-intro":"card hub-agent-intro"}>${embedded?null:html`<h3>${hi("title")}</h3>`}<${Body} class="form" onSubmit=${embedded?undefined:save}>
22
+ <label class="field"><span>${hi("title")}</span><input value=${text} placeholder=${hi("placeholder")} disabled=${busy} onInput=${e=>setText(e.target.value)} aria-invalid=${count>50?"true":null} /><small class="note">${`${hi("hint")} ${count}/50`}</small></label>
23
+ ${exposure.introBy?html`<p class="note">${hi(exposure.introBy)}${exposure.introAt?html` · <time datetime=${new Date(exposure.introAt).toISOString()}>${new Date(exposure.introAt).toLocaleString()}</time>`:null}</p>`:null}
24
+ <div class="field-row"><button type=${embedded?"button":"submit"} onClick=${embedded?save:undefined} class="btn btn-sm btn-primary" disabled=${busy||count>50||text===(exposure.intro??"")}>${hi("save")}</button></div>
25
+ ${message?html`<p role="status">${message}</p>`:null}
26
+ </${Body}></section>`;
27
+ }
28
+
29
+ /** Form-free: the sharing dialog already owns the grant form. */
30
+ export function AgentIntroSharingPreview({exposure,client,onSaved=()=>{}}){
31
+ const [editing,setEditing]=useState(false),[saved,setSaved]=useState(null);
32
+ const value={...exposure,...saved},text=value.introBy?value.intro:(value.introDefault??value.intro??"");
33
+ return html`<div class="hub-intro-sharing-preview"><p class="note">${hi("title")}${text?`: ${text}`:""}</p><button type="button" class="btn btn-sm btn-ghost" onClick=${()=>setEditing(!editing)}>${hi(editing?"close":"edit")}</button>
34
+ ${editing?html`<${AgentIntroEditor} embedded=${true} exposure=${{...value,intro:text}} client=${client} onSaved=${result=>{setSaved(result);setEditing(false);onSaved(result);}} />`:null}</div>`;
35
+ }
@@ -3,7 +3,7 @@
3
3
  // stylesheet has had since the fleet chat's own attachments (.pending-files, .file-chip, .chip-x).
4
4
  // The server decides everything: a room offers Attach only while its fleet link negotiated attachments-v1 (room.features);
5
5
  // each file is uploaded on choice (typed by name, images by their bytes, within the limits), and Send names the ids.
6
- import { html } from "/assets/app-html.js";
6
+ import { html, useEffect, useRef } from "/assets/app-html.js";
7
7
  import { register, t } from "/assets/app-i18n.js";
8
8
  import { Icon } from "/assets/ui-icons.js";
9
9
 
@@ -67,7 +67,8 @@ export async function uploadChosen(client, roomId, fileList, { current, set, ali
67
67
  const room = Math.max(0, MAX_FILES - current().length);
68
68
  if (chosen.length > room) refusals.push(hf("tooMany", MAX_FILES));
69
69
  const admitted = chosen.slice(0, room).map((file) => ({ file, key: `${Date.now()}-${Math.random().toString(36).slice(2)}` }));
70
- if (admitted.length) set([...current(), ...admitted.map(({ file, key }) => ({ key, name: file.name, size: file.size, state: "uploading" }))]);
70
+ // M-3311 (3): a long paste's chip keeps its text, for the Fleet chat's 「改為文字」 (PendingFiles' onAsText).
71
+ if (admitted.length) set([...current(), ...admitted.map(({ file, key }) => ({ key, name: file.name, size: file.size, state: "uploading", ...(pastedTexts.has(file) ? { text: pastedTexts.get(file) } : {}) }))]);
71
72
  for (const { file, key } of admitted) {
72
73
  if (!alive()) break;
73
74
  if (!current().some((f) => f.key === key)) continue;
@@ -80,11 +81,88 @@ export async function uploadChosen(client, roomId, fileList, { current, set, ali
80
81
  return refusals;
81
82
  }
82
83
 
84
+ // ── M-3308 / M-3311: the Fleet chat's paste and drop (panel-chat.js onPaste, its drag-and-drop), for a Hub conversation — a
85
+ // room and a 1:1 question alike, through their own Attach (`attach`: { onFiles(list) → refusals, left?() → files that still
86
+ // fit, notice?(text) }) and so the Hub's file rules (uploadChosen above). Words: the Fleet chat's own (chat.*).
87
+
88
+ /** Past this many characters a text paste goes as a text file (the Fleet chat's LONG_PASTE_CHARS, chat-render.js). */
89
+ export const LONG_PASTE_CHARS = 4000;
90
+ const isLongPaste = (text) => (globalThis.AgendChatRender?.isLongPaste ? globalThis.AgendChatRender.isLongPaste(text) : typeof text === "string" && text.length > LONG_PASTE_CHARS);
91
+ const stamp = () => new Date().toISOString().slice(0, 19).replace(/[-:T]/g, "");
92
+ const IMAGE_EXT = { "image/png": "png", "image/jpeg": "jpg", "image/gif": "gif", "image/webp": "webp" };
93
+ /**
94
+ * A pasted file as the Hub uploads it. A clipboard picture (a screen capture) may come with no name — the Hub refuses an
95
+ * upload without one — so it is named `screenshot-<time>.<png|jpg|…>` by its type; a named one (Chrome's "image.png", a
96
+ * copied file) keeps its own.
97
+ */
98
+ export function pastedFile(file) {
99
+ if (!file || (file.name && file.name.trim())) return file;
100
+ const ext = IMAGE_EXT[file.type] || (String(file.type).startsWith("text/") ? "txt" : "bin");
101
+ return new File([file], `${String(file.type).startsWith("image/") ? "screenshot" : "pasted"}-${stamp()}.${ext}`, { type: file.type, lastModified: file.lastModified });
102
+ }
103
+ /**
104
+ * A paste into a Hub composer: its files are attached (the paste stops there unless text came with them); a text past
105
+ * LONG_PASTE_CHARS goes as `pasted-<time>.txt` — only when there is room for it (#4151 review: as the Fleet chat keeps it in the
106
+ * box when nothing more fits), and once attached it says so (the Fleet chat's notice). No `attach`: the box takes it, as ever.
107
+ */
108
+ export function pasteToAttach(e, attach) {
109
+ if (!attach) return;
110
+ const list = e.clipboardData && e.clipboardData.files ? [...e.clipboardData.files] : [];
111
+ const text = e.clipboardData ? e.clipboardData.getData("text") : "";
112
+ if (list.length) { void attach.onFiles(list.map(pastedFile)); if (!text) e.preventDefault(); return; }
113
+ if (!isLongPaste(text)) return;
114
+ if (typeof attach.left === "function" && attach.left() < 1) { attach.notice?.(t("chat.pasteKeptAsText")); return; }
115
+ e.preventDefault();
116
+ const file = new File([text], `pasted-${stamp()}.txt`, { type: "text/plain" });
117
+ pastedTexts.set(file, text);
118
+ Promise.resolve(attach.onFiles([file])).then((refused) => { if (!refused || !refused.length) attach.notice?.(t("chat.pasteAttached", text.length.toLocaleString())); });
119
+ }
120
+ /**
121
+ * M-3311 (1): files dragged over a Hub conversation (the `.hub-chat-main` at `ref`) show where they go; a drop attaches them —
122
+ * the Fleet chat's own (counted, so moving over messages does not flicker). Nothing while the conversation takes no files.
123
+ */
124
+ export function useFileDrop(ref, attach) {
125
+ const on = !!attach, latest = useRef(attach);
126
+ latest.current = attach; // the latest Attach (it closes over the conversation's current list), read at the drop
127
+ useEffect(() => {
128
+ const el = ref.current; if (!el || !on) return undefined;
129
+ let depth = 0;
130
+ const hasFiles = (e) => !!(e.dataTransfer && [...(e.dataTransfer.types || [])].includes("Files"));
131
+ const enter = (e) => { if (hasFiles(e)) { depth++; el.classList.add("dragging"); } };
132
+ const over = (e) => { if (hasFiles(e)) e.preventDefault(); };
133
+ const leave = (e) => { if (hasFiles(e) && --depth <= 0) { depth = 0; el.classList.remove("dragging"); } };
134
+ const drop = (e) => {
135
+ depth = 0; el.classList.remove("dragging");
136
+ const files = e.dataTransfer && e.dataTransfer.files ? [...e.dataTransfer.files] : [];
137
+ if (!files.length) return;
138
+ e.preventDefault(); void latest.current?.onFiles(files.map(pastedFile));
139
+ };
140
+ el.addEventListener("dragenter", enter); el.addEventListener("dragover", over); el.addEventListener("dragleave", leave); el.addEventListener("drop", drop);
141
+ return () => { el.classList.remove("dragging"); el.removeEventListener("dragenter", enter); el.removeEventListener("dragover", over); el.removeEventListener("dragleave", leave); el.removeEventListener("drop", drop); };
142
+ }, [ref.current, on]);
143
+ }
144
+ /** M-3311 (3): what a long paste became a file of — its chip can put it back as text (the Fleet chat's 「改為文字」). */
145
+ const pastedTexts = new WeakMap();
146
+ /**
147
+ * M-3311 (3): a long paste's text back into the box — after what is there, on a new line (the Fleet chat's fileBackAsText) —
148
+ * through the box's own typing path (its value setter and an input event: the composer's draft takes it).
149
+ */
150
+ export function putBackText(field, text) {
151
+ if (!field || typeof text !== "string") return;
152
+ const value = field.value || "", next = value ? `${value}\n${text}` : text;
153
+ const set = typeof HTMLTextAreaElement === "function" ? Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "value")?.set : null;
154
+ if (set) set.call(field, next); else field.value = next;
155
+ field.dispatchEvent(new Event("input", { bubbles: true }));
156
+ }
157
+ /** Where a dragged file goes: the Fleet chat's drop card (shown by `.dragging` on the conversation). */
158
+ export const DropOverlay = () => html`<div data-trust="drop" class="drop-overlay" aria-hidden="true"><div class="drop-card"><${Icon} name="attach" size=${32} /><span>${t("chat.dropHere")}</span></div></div>`;
159
+
83
160
  /** The files waiting under the composer. */
84
- export function PendingFiles({ files, onRemove, formatSize = (n) => `${n} B` }) {
161
+ export function PendingFiles({ files, onRemove, onAsText = null, formatSize = (n) => `${n} B` }) {
85
162
  if (!files.length) return null;
86
163
  return html`<div class="pending-files hub-pending-files">${files.map((f) => html`<span key=${f.key} class="file-chip" data-state=${f.state}>
87
164
  <span class="ic"><${Icon} name="file" size=${16} /></span><span class="nm">${f.name}</span>
88
165
  <span class="sz">${f.state === "uploading" ? hf("uploading") : formatSize(f.size)}</span>
166
+ ${typeof f.text === "string" && onAsText ? html`<button type="button" class="as-text" onClick=${() => onAsText(f.key)}>${t("chat.asText")}</button>` : null}
89
167
  <button type="button" class="chip-x" title=${hf("remove", f.name)} aria-label=${hf("remove", f.name)} onClick=${() => onRemove(f.key)}><${Icon} name="close" size=${14} /></button></span>`)}</div>`;
90
168
  }
@@ -8,7 +8,7 @@ register("hubChat", {
8
8
  navSearch: "Search", notices: "Notices", noticesTitle: "Notices", noNotices: "No security notices", noticesLead: "When a new fleet connects to this Hub, you're told here. If you don't recognize it, revoke it.", settings: "Settings", signedIn: "Signed in", signOut: "Sign out",
9
9
  // M-3190: the chat launcher (新對話, or 對話 with nothing to open)
10
10
  launchTitle: "Who do you want to talk to today?", launchOwner: "Owner: {0}", launchInRoom: "In #{0}", launchGo: "Chat →", launchFilter: "Filter agents",
11
- launchNone: "No agent has been shared with you directly yet", launchNoneHint: "Ask a colleague to share one with you in My shared agents, or go into a room on the left and work with its agents.",
11
+ launchNone: "No agent has been shared with you directly yet", launchNoneHint: "Ask a colleague to share one with you in My agents, or go into a room on the left and work with its agents.",
12
12
  launchNewRoom: "New room", launchShare: "Share my agent", launchNoMatch: "No agent matches.",
13
13
  chats: "Chats", newChat: "New chat", search: "Search chats", noChats: "No chats yet", noChatsHint: "Start one with New chat: it lists the agents someone allowed you to ask.",
14
14
  noMatch: "No chat matches.", waiting: "Waiting for an answer", represents: "Answers for {0}",
@@ -35,13 +35,13 @@ register("hubChat", {
35
35
  adminTitle: "Hub administrator", adminSees: "Can't see the content.",
36
36
  notHere: "Not here", notHereText: "{0}'s files and changes, its terminal (View) and its tool progress: only {1} sees them, in their own fleet.",
37
37
  oneToOne: "A chat has only you and this agent.",
38
- menu: "Menu", mine: "My shared agents", mineHint: "Who may ask them, until when", admin: "Administration", adminHint: "Connect fleets",
38
+ menu: "Menu", mine: "My agents", mineHint: "Who may ask them, until when", admin: "Administration", adminHint: "Connect fleets",
39
39
  back: "Chats",
40
40
  },
41
41
  "zh-TW": {
42
42
  navSearch: "搜尋", notices: "通知", noticesTitle: "通知", noNotices: "沒有安全通知", noticesLead: "有新的 Fleet 連接到這個 Hub 時,會在這裡通知你。如果你不認得它,請撤銷。", settings: "設定", signedIn: "已登入", signOut: "登出",
43
43
  launchTitle: "今天想找哪位 Agent?", launchOwner: "擁有者:{0}", launchInRoom: "位於 #{0}", launchGo: "對話 →", launchFilter: "篩選 Agent",
44
- launchNone: "還沒有人直接分享 Agent 給你", launchNoneHint: "請同事在「我分享的 Agent」授權給你,或直接進入左側的房間與 Agent 協作。",
44
+ launchNone: "還沒有人直接分享 Agent 給你", launchNoneHint: "請同事在「我的 Agent」授權給你,或直接進入左側的房間與 Agent 協作。",
45
45
  launchNewRoom: "開新房間", launchShare: "分享我的 Agent", launchNoMatch: "沒有符合的 Agent。",
46
46
  chats: "對話", newChat: "新對話", search: "搜尋對話", noChats: "還沒有對話", noChatsHint: "用「新對話」開始:會列出有人允許你提問的 Agent。",
47
47
  noMatch: "沒有符合的對話。", waiting: "等待回答", represents: "代表 {0} 回答",
@@ -68,7 +68,7 @@ register("hubChat", {
68
68
  adminTitle: "Hub 管理員", adminSees: "看不到內容。",
69
69
  notHere: "這裡沒有", notHereText: "{0} 的檔案與變更、終端機畫面(View)、工具進度:只有 {1} 在自己的 fleet 看得到。",
70
70
  oneToOne: "一個聊天室只有你和這個 Agent。",
71
- menu: "選單", mine: "我分享的 Agent", mineHint: "誰可以提問、到什麼時候", admin: "管理", adminHint: "連接 Fleet",
71
+ menu: "選單", mine: "我的 Agent", mineHint: "誰可以提問、到什麼時候", admin: "管理", adminHint: "連接 Fleet",
72
72
  back: "對話",
73
73
  },
74
74
  });
@@ -120,7 +120,7 @@ export function legacyRoom(item) {
120
120
  if (!item || typeof item !== "object" || typeof item.id !== "string") return null;
121
121
  return { id: item.id, kind: "direct", name: String(item.exposureName || ""), people: 1, agents: 1, online: null, unread: 0,
122
122
  lastAt: Number.isFinite(item.lastAt) ? item.lastAt : 0, lastText: "", lastAuthor: "",
123
- agent: { ...(item.answerOnly?{answerOnly:true}:{}), exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
123
+ agent: { ...(typeof item.intro==="string"?{intro:item.intro}:{}), ...(item.answerOnly?{answerOnly:true}:{}), exposureId: String(item.exposureId || ""), owner: { name: String(item.ownerName || "") }, presence: null }, limited: true, legacy: item };
124
124
  }
125
125
  export const ADDRESS_HINT = /^https:\/\/[^\s/?#@]+\/?$/i;
126
126
  export const CODE_HINT = /^[A-Za-z0-9][A-Za-z0-9 -]{4,62}[A-Za-z0-9]$/;
@@ -378,6 +378,20 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
378
378
  savePersonPrefs(sessionCsrf, favorites, onlyIfUnset = false) {
379
379
  return sessionCsrf && sessionCsrf === csrf ? call("PUT", "/hub/v1/me/prefs", { favorites, onlyIfUnset }) : Promise.resolve(retired());
380
380
  },
381
+ agentIntroDefaultsV1: true,
382
+ introNotice: () => call("GET", "/hub/v1/me/intro-notice"),
383
+ acknowledgeIntroNotice: () => call("DELETE", "/hub/v1/me/intro-notice"),
384
+ agentSharingV1: true,
385
+ ownAgents(scope) { return scope && scope === csrf ? call("GET", "/hub/v1/me/agents") : Promise.resolve(retired()); },
386
+ refreshOwnAgents(scope, fleetId) { return scope && scope === csrf ? call("POST", "/hub/v1/me/agents/refresh", { fleetId }) : Promise.resolve(retired()); },
387
+ requestAgentSharing(scope, input) { return scope && scope === csrf ? call("POST", "/hub/v1/me/agent-sharing", input) : Promise.resolve(retired()); },
388
+ agentSharingRequest(scope, requestId) { return scope && scope === csrf ? call("GET", `/hub/v1/me/agent-sharing/${id(requestId)}`) : Promise.resolve(retired()); },
389
+ previousAgentAccess(scope, exposureId) { return scope && scope === csrf ? call("GET", `/hub/v1/me/agents/${id(exposureId)}/previous-access`) : Promise.resolve(retired()); },
390
+ usePreviousAgentAccess(scope, exposureId, input) { return scope && scope === csrf ? call("POST", `/hub/v1/me/agents/${id(exposureId)}/previous-access`, input) : Promise.resolve(retired()); },
391
+ ownerGrant(scope, input) { return scope && scope === csrf ? call("POST", "/hub/v1/grants", input) : Promise.resolve(retired()); },
392
+ ownerSharing(scope, exposureId, revision, sharingEpoch, paused) { return scope && scope === csrf ? call("POST", `/hub/v1/exposures/${id(exposureId)}/sharing`, { revision, sharingEpoch, paused }) : Promise.resolve(retired()); },
393
+ agentIntrosV1: true,
394
+ saveAgentIntro: (exposureId, revision, text) => call("PUT", `/hub/v1/exposures/${id(exposureId)}/intro`, {revision,text}),
381
395
  catalog() { return call("GET", "/hub/v1/exposures"); },
382
396
  sharingPauseV1: true,
383
397
  sharing(exposureId, revision, sharingEpoch, paused) { return call("POST", `/hub/v1/exposures/${id(exposureId)}/sharing`, { revision, sharingEpoch, paused }); },
@@ -436,6 +450,7 @@ export function createHubWebClient({ fetchImpl = (...a) => fetch(...a), readTime
436
450
  /** → { ok, room, me: { role }, members: [Member], settings: { allMention, historyForNew } } */
437
451
  room(roomId) { return call("GET", `/hub/v1/rooms/${id(roomId)}`); },
438
452
  /** A group room: { name, people: [personId], teams: [teamId], groups: [groupId], agents: [exposureId], assistant }. */
453
+ roomPurposeV1: true,
439
454
  createRoom(input) { return call("POST", "/hub/v1/rooms", input); },
440
455
  /** { name?, allMention?, historyForNew?, assistant?, archived? } */
441
456
  updateRoom(roomId, patch) { return call("PATCH", `/hub/v1/rooms/${id(roomId)}`, patch); },