@songsid/agend 2.4.0-beta.17 → 2.4.0-beta.19

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 (431) hide show
  1. package/dist/agent-cli-instructions.md +13 -7
  2. package/dist/agent-cli.js +149 -49
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-export.d.ts +3 -1
  5. package/dist/agent-export.js +18 -1
  6. package/dist/agent-export.js.map +1 -1
  7. package/dist/agent-whats-new.js +9 -0
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/apply-job.d.ts +2 -2
  10. package/dist/auth-api.js +1 -1
  11. package/dist/auth-api.js.map +1 -1
  12. package/dist/backend/claude-code.d.ts +0 -6
  13. package/dist/backend/claude-code.js +29 -5
  14. package/dist/backend/claude-code.js.map +1 -1
  15. package/dist/backend/claude-transcript-errors.d.ts +4 -0
  16. package/dist/backend/claude-transcript-errors.js +5 -1
  17. package/dist/backend/claude-transcript-errors.js.map +1 -1
  18. package/dist/backend/codex-precaution.js +3 -2
  19. package/dist/backend/codex-precaution.js.map +1 -1
  20. package/dist/backend/codex.js +1 -1
  21. package/dist/backend/codex.js.map +1 -1
  22. package/dist/backend/types.d.ts +6 -0
  23. package/dist/backend/types.js.map +1 -1
  24. package/dist/build-provenance.json +1 -1
  25. package/dist/channel/mcp-server.js +8 -2
  26. package/dist/channel/mcp-server.js.map +1 -1
  27. package/dist/channel/mcp-tools.d.ts +27 -1
  28. package/dist/channel/mcp-tools.js +77 -7
  29. package/dist/channel/mcp-tools.js.map +1 -1
  30. package/dist/chat-task-refs.d.ts +61 -0
  31. package/dist/chat-task-refs.js +112 -0
  32. package/dist/chat-task-refs.js.map +1 -0
  33. package/dist/classic-channel-manager.d.ts +1 -1
  34. package/dist/classic-channel-manager.js +6 -2
  35. package/dist/classic-channel-manager.js.map +1 -1
  36. package/dist/claude-credential-launch.d.ts +6 -0
  37. package/dist/claude-credential-launch.js +16 -3
  38. package/dist/claude-credential-launch.js.map +1 -1
  39. package/dist/claude-credential-runner.js +3 -1
  40. package/dist/claude-credential-runner.js.map +1 -1
  41. package/dist/claude-setup-token-transport.js +25 -3
  42. package/dist/claude-setup-token-transport.js.map +1 -1
  43. package/dist/cli-audited.js +9 -8
  44. package/dist/cli-audited.js.map +1 -1
  45. package/dist/composite-tools.d.ts +11 -0
  46. package/dist/composite-tools.js +29 -0
  47. package/dist/composite-tools.js.map +1 -0
  48. package/dist/config-validator.js +22 -1
  49. package/dist/config-validator.js.map +1 -1
  50. package/dist/config.js +11 -0
  51. package/dist/config.js.map +1 -1
  52. package/dist/contact-auth-policy.d.ts +1 -0
  53. package/dist/contact-auth-policy.js +2 -1
  54. package/dist/contact-auth-policy.js.map +1 -1
  55. package/dist/contact-auth-service.js +2 -0
  56. package/dist/contact-auth-service.js.map +1 -1
  57. package/dist/contact-auth-store.js +21 -6
  58. package/dist/contact-auth-store.js.map +1 -1
  59. package/dist/contact-auth-types.d.ts +2 -0
  60. package/dist/contact-auth-types.js.map +1 -1
  61. package/dist/daemon.d.ts +8 -0
  62. package/dist/daemon.js +66 -13
  63. package/dist/daemon.js.map +1 -1
  64. package/dist/darwin-memory.js +2 -1
  65. package/dist/darwin-memory.js.map +1 -1
  66. package/dist/dashboard-permissions.d.ts +1 -8
  67. package/dist/dashboard-permissions.js +8 -9
  68. package/dist/dashboard-permissions.js.map +1 -1
  69. package/dist/delivery-outbox.d.ts +0 -6
  70. package/dist/delivery-outbox.js +0 -25
  71. package/dist/delivery-outbox.js.map +1 -1
  72. package/dist/delivery-outbox.test.js +132 -96
  73. package/dist/delivery-outbox.test.js.map +1 -1
  74. package/dist/fleet-context.d.ts +1 -0
  75. package/dist/fleet-manager.d.ts +60 -8
  76. package/dist/fleet-manager.js +404 -107
  77. package/dist/fleet-manager.js.map +1 -1
  78. package/dist/fleet-windows-runtime.d.ts +2 -2
  79. package/dist/fleet-windows-runtime.js +9 -2
  80. package/dist/fleet-windows-runtime.js.map +1 -1
  81. package/dist/fleet-yaml-stringify.d.ts +3 -0
  82. package/dist/fleet-yaml-stringify.js +132 -0
  83. package/dist/fleet-yaml-stringify.js.map +1 -0
  84. package/dist/general-knowledge/skills/concepts/SKILL.md +53 -4
  85. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +4 -0
  86. package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
  87. package/dist/general-knowledge/skills/hub/SKILL.md +2 -0
  88. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
  89. package/dist/general-knowledge/skills/model-discovery/SKILL.md +3 -2
  90. package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
  91. package/dist/general-knowledge/skills/task-board/SKILL.md +63 -0
  92. package/dist/general-knowledge/skills/web-appearance/SKILL.md +25 -2
  93. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +48 -11
  94. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +4 -0
  95. package/dist/general-knowledge/steering/core-rules.md +15 -78
  96. package/dist/general-role-block.d.ts +19 -0
  97. package/dist/general-role-block.js +56 -0
  98. package/dist/general-role-block.js.map +1 -0
  99. package/dist/general-role.d.ts +1 -1
  100. package/dist/general-role.js +1 -0
  101. package/dist/general-role.js.map +1 -1
  102. package/dist/host-memory.d.ts +3 -0
  103. package/dist/host-memory.js.map +1 -1
  104. package/dist/host-monitoring/darwin/collector.d.ts +18 -0
  105. package/dist/host-monitoring/darwin/collector.js +65 -0
  106. package/dist/host-monitoring/darwin/collector.js.map +1 -0
  107. package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
  108. package/dist/host-monitoring/darwin/defaults.js +9 -0
  109. package/dist/host-monitoring/darwin/defaults.js.map +1 -0
  110. package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
  111. package/dist/host-monitoring/darwin/interpretation.js +73 -0
  112. package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
  113. package/dist/host-monitoring/linux/collector.d.ts +17 -0
  114. package/dist/host-monitoring/linux/collector.js +55 -0
  115. package/dist/host-monitoring/linux/collector.js.map +1 -0
  116. package/dist/host-monitoring/linux/defaults.d.ts +2 -0
  117. package/dist/host-monitoring/linux/defaults.js +9 -0
  118. package/dist/host-monitoring/linux/defaults.js.map +1 -0
  119. package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
  120. package/dist/host-monitoring/linux/interpretation.js +76 -0
  121. package/dist/host-monitoring/linux/interpretation.js.map +1 -0
  122. package/dist/host-monitoring/transport.d.ts +42 -0
  123. package/dist/host-monitoring/transport.js +101 -0
  124. package/dist/host-monitoring/transport.js.map +1 -0
  125. package/dist/host-monitoring/wsl/collector.d.ts +19 -0
  126. package/dist/host-monitoring/wsl/collector.js +72 -0
  127. package/dist/host-monitoring/wsl/collector.js.map +1 -0
  128. package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
  129. package/dist/host-monitoring/wsl/defaults.js +9 -0
  130. package/dist/host-monitoring/wsl/defaults.js.map +1 -0
  131. package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
  132. package/dist/host-monitoring/wsl/interpretation.js +77 -0
  133. package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
  134. package/dist/host-monitoring-alert-policy.d.ts +73 -0
  135. package/dist/host-monitoring-alert-policy.js +152 -0
  136. package/dist/host-monitoring-alert-policy.js.map +1 -0
  137. package/dist/host-monitoring-alert-resources.d.ts +11 -0
  138. package/dist/host-monitoring-alert-resources.js +16 -0
  139. package/dist/host-monitoring-alert-resources.js.map +1 -0
  140. package/dist/host-monitoring-alert-settings.d.ts +16 -0
  141. package/dist/host-monitoring-alert-settings.js +68 -0
  142. package/dist/host-monitoring-alert-settings.js.map +1 -0
  143. package/dist/host-monitoring-alert-store.d.ts +49 -0
  144. package/dist/host-monitoring-alert-store.js +228 -0
  145. package/dist/host-monitoring-alert-store.js.map +1 -0
  146. package/dist/host-monitoring-alert-text.d.ts +7 -0
  147. package/dist/host-monitoring-alert-text.js +10 -0
  148. package/dist/host-monitoring-alert-text.js.map +1 -0
  149. package/dist/host-monitoring-alerts.d.ts +79 -0
  150. package/dist/host-monitoring-alerts.js +276 -0
  151. package/dist/host-monitoring-alerts.js.map +1 -0
  152. package/dist/host-monitoring-defaults.d.ts +19 -0
  153. package/dist/host-monitoring-defaults.js +10 -0
  154. package/dist/host-monitoring-defaults.js.map +1 -0
  155. package/dist/host-monitoring-footprint-policy.d.ts +45 -0
  156. package/dist/host-monitoring-footprint-policy.js +150 -0
  157. package/dist/host-monitoring-footprint-policy.js.map +1 -0
  158. package/dist/host-monitoring-footprint.d.ts +42 -0
  159. package/dist/host-monitoring-footprint.js +169 -0
  160. package/dist/host-monitoring-footprint.js.map +1 -0
  161. package/dist/host-monitoring-history-policy.d.ts +2 -0
  162. package/dist/host-monitoring-history-policy.js +16 -2
  163. package/dist/host-monitoring-history-policy.js.map +1 -1
  164. package/dist/host-monitoring-history-store.js +8 -6
  165. package/dist/host-monitoring-history-store.js.map +1 -1
  166. package/dist/host-monitoring-history-worker.js +19 -3
  167. package/dist/host-monitoring-history-worker.js.map +1 -1
  168. package/dist/host-monitoring-history.d.ts +9 -0
  169. package/dist/host-monitoring-history.js +45 -9
  170. package/dist/host-monitoring-history.js.map +1 -1
  171. package/dist/host-monitoring-platform.d.ts +18 -70
  172. package/dist/host-monitoring-platform.js +14 -269
  173. package/dist/host-monitoring-platform.js.map +1 -1
  174. package/dist/host-monitoring-process-identity.d.ts +8 -0
  175. package/dist/host-monitoring-process-identity.js +81 -0
  176. package/dist/host-monitoring-process-identity.js.map +1 -0
  177. package/dist/host-monitoring-runtime.d.ts +8 -0
  178. package/dist/host-monitoring-runtime.js +18 -3
  179. package/dist/host-monitoring-runtime.js.map +1 -1
  180. package/dist/host-monitoring.d.ts +15 -0
  181. package/dist/host-monitoring.js.map +1 -1
  182. package/dist/hub/agent-catalog-model.d.ts +21 -0
  183. package/dist/hub/agent-catalog-model.js +9 -1
  184. package/dist/hub/agent-catalog-model.js.map +1 -1
  185. package/dist/hub/agent-catalog.d.ts +4 -1
  186. package/dist/hub/agent-catalog.js +11 -0
  187. package/dist/hub/agent-catalog.js.map +1 -1
  188. package/dist/hub/catalog.js +12 -0
  189. package/dist/hub/catalog.js.map +1 -1
  190. package/dist/hub/client.js +4 -1
  191. package/dist/hub/client.js.map +1 -1
  192. package/dist/hub/compose/member.d.ts +5 -0
  193. package/dist/hub/compose/member.js +25 -5
  194. package/dist/hub/compose/member.js.map +1 -1
  195. package/dist/hub/compose/server.d.ts +2 -0
  196. package/dist/hub/compose/server.js +4 -2
  197. package/dist/hub/compose/server.js.map +1 -1
  198. package/dist/hub/http/compose.d.ts +5 -0
  199. package/dist/hub/http/compose.js +25 -2
  200. package/dist/hub/http/compose.js.map +1 -1
  201. package/dist/hub/http/deps.d.ts +2 -0
  202. package/dist/hub/http/schema.js +4 -0
  203. package/dist/hub/http/schema.js.map +1 -1
  204. package/dist/hub/lapse-carry.d.ts +45 -0
  205. package/dist/hub/lapse-carry.js +62 -0
  206. package/dist/hub/lapse-carry.js.map +1 -0
  207. package/dist/hub/member/agent-catalog.d.ts +4 -1
  208. package/dist/hub/member/agent-catalog.js +15 -4
  209. package/dist/hub/member/agent-catalog.js.map +1 -1
  210. package/dist/hub/member/agent-intro.d.ts +4 -3
  211. package/dist/hub/member/agent-intro.js +7 -0
  212. package/dist/hub/member/agent-intro.js.map +1 -1
  213. package/dist/hub/member/exposure-api.d.ts +2 -0
  214. package/dist/hub/member/exposure-api.js +8 -1
  215. package/dist/hub/member/exposure-api.js.map +1 -1
  216. package/dist/hub/member/room-post.d.ts +34 -6
  217. package/dist/hub/member/room-post.js +30 -0
  218. package/dist/hub/member/room-post.js.map +1 -1
  219. package/dist/hub/member/sharing.d.ts +2 -0
  220. package/dist/hub/member/sharing.js +9 -2
  221. package/dist/hub/member/sharing.js.map +1 -1
  222. package/dist/hub/protocol.d.ts +2 -0
  223. package/dist/hub/room-brief-model.js +2 -1
  224. package/dist/hub/room-brief-model.js.map +1 -1
  225. package/dist/hub/rooms/agents.d.ts +2 -0
  226. package/dist/hub/rooms/agents.js +16 -2
  227. package/dist/hub/rooms/agents.js.map +1 -1
  228. package/dist/hub/rooms/office.d.ts +82 -0
  229. package/dist/hub/rooms/office.js +46 -0
  230. package/dist/hub/rooms/office.js.map +1 -0
  231. package/dist/hub/rooms/service.d.ts +66 -1
  232. package/dist/hub/rooms/service.js +67 -11
  233. package/dist/hub/rooms/service.js.map +1 -1
  234. package/dist/hub/rooms/types.d.ts +4 -0
  235. package/dist/hub/runtime.d.ts +1 -1
  236. package/dist/hub/server.js +9 -2
  237. package/dist/hub/server.js.map +1 -1
  238. package/dist/hub/sharing-requests.d.ts +5 -2
  239. package/dist/hub/sharing-requests.js +19 -4
  240. package/dist/hub/sharing-requests.js.map +1 -1
  241. package/dist/instance-config-impact.js +1 -1
  242. package/dist/instance-config-impact.js.map +1 -1
  243. package/dist/instance-lifecycle.js +8 -9
  244. package/dist/instance-lifecycle.js.map +1 -1
  245. package/dist/instruction-file-sizes.d.ts +46 -0
  246. package/dist/instruction-file-sizes.js +115 -0
  247. package/dist/instruction-file-sizes.js.map +1 -0
  248. package/dist/instructions.d.ts +35 -1
  249. package/dist/instructions.js +59 -33
  250. package/dist/instructions.js.map +1 -1
  251. package/dist/locale.js +16 -4
  252. package/dist/locale.js.map +1 -1
  253. package/dist/log-steps.d.ts +5 -0
  254. package/dist/log-steps.js +6 -2
  255. package/dist/log-steps.js.map +1 -1
  256. package/dist/memory-guidance.d.ts +5 -0
  257. package/dist/memory-guidance.js +14 -0
  258. package/dist/memory-guidance.js.map +1 -0
  259. package/dist/model-defaults.d.ts +5 -0
  260. package/dist/model-defaults.js +6 -0
  261. package/dist/model-defaults.js.map +1 -0
  262. package/dist/native-mcp.d.ts +2 -0
  263. package/dist/native-mcp.js +16 -6
  264. package/dist/native-mcp.js.map +1 -1
  265. package/dist/needs-you-hub.d.ts +3 -0
  266. package/dist/needs-you-hub.js +7 -1
  267. package/dist/needs-you-hub.js.map +1 -1
  268. package/dist/needs-you.d.ts +15 -2
  269. package/dist/needs-you.js +6 -0
  270. package/dist/needs-you.js.map +1 -1
  271. package/dist/outbound-handlers.d.ts +3 -3
  272. package/dist/outbound-schemas.d.ts +3 -0
  273. package/dist/outbound-schemas.js +27 -26
  274. package/dist/outbound-schemas.js.map +1 -1
  275. package/dist/public-web-gateway.js +7 -1
  276. package/dist/public-web-gateway.js.map +1 -1
  277. package/dist/quickstart.d.ts +1 -1
  278. package/dist/quickstart.js +2 -3
  279. package/dist/quickstart.js.map +1 -1
  280. package/dist/remote-card-prompt.d.ts +1 -0
  281. package/dist/remote-card-prompt.js +1 -1
  282. package/dist/remote-card-prompt.js.map +1 -1
  283. package/dist/runtime-build-info.js +1 -1
  284. package/dist/runtime-build-info.js.map +1 -1
  285. package/dist/runtime-cli-install.js +9 -9
  286. package/dist/runtime-cli-install.js.map +1 -1
  287. package/dist/runtime-pane-mcp.js +7 -3
  288. package/dist/runtime-pane-mcp.js.map +1 -1
  289. package/dist/runtime-pane-native.js +2 -1
  290. package/dist/runtime-pane-native.js.map +1 -1
  291. package/dist/scheduler/db.js +2 -0
  292. package/dist/scheduler/db.js.map +1 -1
  293. package/dist/scheduler/task-board-mentions.d.ts +32 -0
  294. package/dist/scheduler/task-board-mentions.js +97 -0
  295. package/dist/scheduler/task-board-mentions.js.map +1 -0
  296. package/dist/scheduler/task-board-text.js +3 -0
  297. package/dist/scheduler/task-board-text.js.map +1 -1
  298. package/dist/scheduler/task-board.d.ts +199 -3
  299. package/dist/scheduler/task-board.js +492 -7
  300. package/dist/scheduler/task-board.js.map +1 -1
  301. package/dist/settings-api.d.ts +5 -1
  302. package/dist/settings-api.js +77 -2
  303. package/dist/settings-api.js.map +1 -1
  304. package/dist/settings-baseline.js +5 -4
  305. package/dist/settings-baseline.js.map +1 -1
  306. package/dist/settings-change.js +4 -2
  307. package/dist/settings-change.js.map +1 -1
  308. package/dist/settings-effect.d.ts +2 -0
  309. package/dist/settings-effect.js +20 -1
  310. package/dist/settings-effect.js.map +1 -1
  311. package/dist/settings-instance-patch.js +3 -1
  312. package/dist/settings-instance-patch.js.map +1 -1
  313. package/dist/setup-host.d.ts +2 -3
  314. package/dist/setup-host.js +3 -5
  315. package/dist/setup-host.js.map +1 -1
  316. package/dist/setup-wizard.js +0 -2
  317. package/dist/setup-wizard.js.map +1 -1
  318. package/dist/shared-default-adoption.d.ts +24 -0
  319. package/dist/shared-default-adoption.js +73 -0
  320. package/dist/shared-default-adoption.js.map +1 -0
  321. package/dist/subagent-records.d.ts +2 -0
  322. package/dist/subagent-records.js +11 -1
  323. package/dist/subagent-records.js.map +1 -1
  324. package/dist/subagent-service.d.ts +3 -0
  325. package/dist/subagent-service.js +24 -4
  326. package/dist/subagent-service.js.map +1 -1
  327. package/dist/task-board-tool.d.ts +31 -0
  328. package/dist/task-board-tool.js +31 -0
  329. package/dist/task-board-tool.js.map +1 -1
  330. package/dist/task-board-waker.d.ts +23 -30
  331. package/dist/task-board-waker.js +136 -97
  332. package/dist/task-board-waker.js.map +1 -1
  333. package/dist/topic-commands.js +4 -0
  334. package/dist/topic-commands.js.map +1 -1
  335. package/dist/types.d.ts +23 -0
  336. package/dist/ui/agent-details-settings.js +2 -2
  337. package/dist/ui/agent-export-dialog.js +4 -3
  338. package/dist/ui/agent-export-strings.js +4 -4
  339. package/dist/ui/agent-page-strings.js +18 -0
  340. package/dist/ui/chat-activity-groups.js +1 -1
  341. package/dist/ui/chat-activity.js +17 -0
  342. package/dist/ui/chat-store.js +34 -8
  343. package/dist/ui/chat-task-ref-strings.js +24 -0
  344. package/dist/ui/chat-task-refs.js +129 -0
  345. package/dist/ui/claude-setup-token.js +3 -3
  346. package/dist/ui/contact-auth-strings.js +33 -3
  347. package/dist/ui/contact-authorizations.js +17 -24
  348. package/dist/ui/contact-grant-editor.js +50 -0
  349. package/dist/ui/contact-permissions.js +21 -8
  350. package/dist/ui/fleet-office-card.js +18 -14
  351. package/dist/ui/fleet-office.js +29 -17
  352. package/dist/ui/fleet-task-activity.js +362 -0
  353. package/dist/ui/fleet-task-card.js +317 -314
  354. package/dist/ui/fleet-task-common.js +99 -9
  355. package/dist/ui/fleet-task-create.js +67 -0
  356. package/dist/ui/fleet-task-edit.js +204 -0
  357. package/dist/ui/fleet-task-follow.js +123 -0
  358. package/dist/ui/fleet-task-menu.js +1 -1
  359. package/dist/ui/fleet-task-owner.js +252 -0
  360. package/dist/ui/fleet-task-run.js +257 -0
  361. package/dist/ui/fleet-task-view.js +178 -39
  362. package/dist/ui/fleet-task-work.js +2 -2
  363. package/dist/ui/fleet-tasks.js +258 -130
  364. package/dist/ui/host-alerts.js +23 -0
  365. package/dist/ui/host-footprint.js +17 -0
  366. package/dist/ui/host-health.js +24 -16
  367. package/dist/ui/host-monitoring-darwin.js +6 -0
  368. package/dist/ui/host-monitoring-help.js +7 -0
  369. package/dist/ui/host-monitoring-linux.js +6 -0
  370. package/dist/ui/host-monitoring-wsl.js +6 -0
  371. package/dist/ui/host-time.js +5 -0
  372. package/dist/ui/hub-agent-copy.js +2 -0
  373. package/dist/ui/hub-client.js +4 -0
  374. package/dist/ui/hub-my-agents-strings.js +2 -0
  375. package/dist/ui/hub-my-agents.js +17 -1
  376. package/dist/ui/hub-room-composer.js +108 -5
  377. package/dist/ui/hub-room-members-strings.js +9 -2
  378. package/dist/ui/hub-room-members.js +72 -15
  379. package/dist/ui/hub-room-office.js +191 -0
  380. package/dist/ui/hub-room-purpose.js +18 -2
  381. package/dist/ui/hub-room-settings.js +8 -1
  382. package/dist/ui/hub-room-strings.js +15 -0
  383. package/dist/ui/hub-room-thread.js +51 -15
  384. package/dist/ui/hub-strings.js +1 -1
  385. package/dist/ui/log-row.js +7 -5
  386. package/dist/ui/native-instance-settings.js +4 -2
  387. package/dist/ui/panel-chat.js +98 -17
  388. package/dist/ui/panel-details.js +17 -0
  389. package/dist/ui/panel-fleet.js +1 -1
  390. package/dist/ui/panel-hub.js +4 -1
  391. package/dist/ui/panel-needs.js +38 -18
  392. package/dist/ui/panel-settings.js +58 -13
  393. package/dist/ui/settings-apply.js +8 -3
  394. package/dist/ui/settings-default-model-scope.js +40 -0
  395. package/dist/ui/settings-default-model-strings.js +43 -0
  396. package/dist/ui/settings-dialogs.js +9 -5
  397. package/dist/ui/settings-host-alerts.js +23 -0
  398. package/dist/ui/settings-host-monitoring.js +10 -8
  399. package/dist/ui/settings-hub.js +1 -1
  400. package/dist/ui/settings-layout.js +7 -2
  401. package/dist/ui/settings-model.js +9 -5
  402. package/dist/ui/settings-quota-notice.js +3 -3
  403. package/dist/ui/settings-registry.js +3 -0
  404. package/dist/ui/settings-shared-strings.js +22 -0
  405. package/dist/ui/settings-shared.js +59 -12
  406. package/dist/ui/settings-strings.js +2 -4
  407. package/dist/ui/shared/app-i18n.js +2 -2
  408. package/dist/ui/shared/app.css +169 -50
  409. package/dist/ui/shared/chat-composer.js +7 -6
  410. package/dist/ui/shared/chat-render.js +63 -10
  411. package/dist/ui/shared/chat-strings.js +2 -2
  412. package/dist/ui/shared/chat-thread.js +10 -3
  413. package/dist/ui/shared/composer-focus.js +21 -0
  414. package/dist/ui/shared/hub-chat.css +30 -2
  415. package/dist/ui/shared/hub-rooms-u2.css +17 -0
  416. package/dist/ui/shared/task-board.css +406 -8
  417. package/dist/ui/trigger-complete.js +71 -0
  418. package/dist/web-api.d.ts +11 -1
  419. package/dist/web-api.js +324 -18
  420. package/dist/web-api.js.map +1 -1
  421. package/dist/web-chat-history.d.ts +40 -1
  422. package/dist/web-chat-history.js +131 -9
  423. package/dist/web-chat-history.js.map +1 -1
  424. package/dist/web-guest-access.js +4 -4
  425. package/dist/web-guest-access.js.map +1 -1
  426. package/dist/web-upload.d.ts +1 -1
  427. package/dist/web-upload.js.map +1 -1
  428. package/dist/windows-native-mcp.js +5 -2
  429. package/dist/windows-native-mcp.js.map +1 -1
  430. package/dist/workflow-templates/default.md +4 -6
  431. package/package.json +1 -1
@@ -6,6 +6,7 @@ import { hi } from "./hub-agent-intro.js";
6
6
  // The dots use the Fleet sidebar's colours (.dot ok / busy / warn / off), so a state reads the same in both.
7
7
  // The shell owns the room's detail (and reads it again on member.changed); this panel applies presence.changed in place.
8
8
  import { html, useEffect, useState } from "/assets/app-html.js";
9
+ import { lang } from "/assets/app-i18n.js";
9
10
  import { hubClient } from "./hub-client.js";
10
11
  import { hm } from "./hub-room-members-strings.js";
11
12
  import { hroom } from "./hub-room-strings.js";
@@ -16,6 +17,36 @@ import { roomSource, RoomSourceMark } from "./hub-room-source.js";
16
17
  linkRoomsU2Css();
17
18
 
18
19
  const AGENTS_SHOWN = 8;
20
+ /**
21
+ * M-3533 M1 (docs/design/hub-office-visit.md §2.6): past this many people and agents together, the list is compact — a
22
+ * summary line, a filter, one line a row, the people not online folded, the agents grouped by owner (folded). A smaller
23
+ * room keeps today's list.
24
+ */
25
+ export const COMPACT_OVER = 12;
26
+
27
+ /** M1: a member matches the filter by its name or (an agent) its owner's, ignoring case. */
28
+ export const memberMatches = (m, q) => { const s = String(q || "").trim().toLocaleLowerCase(); return !s || `${m.name || ""} ${m.owner?.name || ""}`.toLocaleLowerCase().includes(s); };
29
+
30
+ /**
31
+ * M1: the agents by owner — keyed by the owner's id (two owners of one name are two groups), named by their name; my own
32
+ * group first, then the owners by name in the viewer's language (a group does not move as its agents start and stop).
33
+ * Within a group, the list's own order (presence).
34
+ */
35
+ export function byOwner(agents, locale = undefined) {
36
+ const groups = new Map();
37
+ for (const m of agents) {
38
+ const key = String(m.owner?.id || `name:${m.owner?.name || ""}`);
39
+ if (!groups.has(key)) groups.set(key, { key, owner: String(m.owner?.name || ""), mine: m.owner?.mine === true, agents: [] });
40
+ groups.get(key).agents.push(m);
41
+ }
42
+ return [...groups.values()].sort((a, b) => (Number(b.mine) - Number(a.mine)) || a.owner.localeCompare(b.owner, locale) || (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
43
+ }
44
+
45
+ /** M1: people in a stable order — me first, then by name in the viewer's language, the member id breaking a tie. */
46
+ export function peopleOrder(people, meId, locale = undefined) {
47
+ return [...people].sort((a, b) => (Number(b.id === meId) - Number(a.id === meId)) || String(a.name || "").localeCompare(String(b.name || ""), locale)
48
+ || (String(a.id) < String(b.id) ? -1 : String(a.id) > String(b.id) ? 1 : 0));
49
+ }
19
50
 
20
51
  /**
21
52
  * The dot class and words for one member, from the shared rooms presence mapping (hub-room-presence.js: reason codes,
@@ -46,11 +77,12 @@ export function ownerAgent(name) {
46
77
  * until the next detail;
47
78
  * - onMention(member): puts 「@name 」 in the composer;
48
79
  * - onOpenChat(member): opens the one-to-one, offered only for an agent whose member row says `canAsk`;
49
- * - onSettings().
80
+ * - onSettings();
81
+ * - compact (M1): true / false for that list whatever the size; absent, a room over COMPACT_OVER gets the compact one.
50
82
  */
51
- export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMention, onOpenChat, onSettings } = {}) {
83
+ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMention, onOpenChat, onSettings, compact: force = undefined } = {}) {
52
84
  const [presence, setPresence] = useState({}), [open, setOpen] = useState(null), [expanded, setExpanded] = useState(false);
53
- const [busy, setBusy] = useState(false), [failed, setFailed] = useState(false), [gone, setGone] = useState({});
85
+ const [busy, setBusy] = useState(false), [failed, setFailed] = useState(false), [gone, setGone] = useState({}), [q, setQ] = useState("");
54
86
  useEffect(() => { setPresence({}); setGone({}); }, [detail]);
55
87
  useEffect(() => client.subscribeRooms?.({
56
88
  // The whole state each time: presence, its reason code and note. One the event omits is cleared (undefined), so a
@@ -75,19 +107,16 @@ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMenti
75
107
  if (r?.ok) { setOpen(null); setGone(old => ({ ...old, [m.id]: true })); } // the shell reads the room again on member.changed
76
108
  else setFailed(true);
77
109
  };
110
+ // `compact` true / false: that list whatever the room's size (the classic list's own tests); by default, by size.
111
+ const compact = typeof force === "boolean" ? force : people.length + agents.length > COMPACT_OVER;
78
112
  // An agent's second line names whose it is beside its state (「處理中 · 林小華的 Agent」), always shown, not only on hover.
113
+ // M1: in a compact list a row is one line — the name, its state — and the owner and introduction move into its card.
79
114
  const row = (m, extra = null) => {
80
- const v = memberStatus(m), owner = (m.kind === "agent" || m.kind === "later") && m.owner?.name ? (v.update ? hm("askOwner", m.owner.name) : ownerAgent(m.owner.name)) : "";
81
- return html`<span class="hub-member-name"><${RoomSourceMark} source=${roomSource(m)} decorative=${true} />${m.name}${extra}</span><span class="hub-member-state"><span class=${`dot ${v.dot}`} aria-hidden="true"></span><span>${v.text}</span>${owner ? html`<span class="hub-member-owner">· ${owner}</span>` : null}</span>${m.intro||m.kind==="assistant"?html`<small class="note">${m.kind==="assistant"?hi("assistant"):m.intro}</small>`:null}`;
115
+ const v = memberStatus(m), owner = !compact && (m.kind === "agent" || m.kind === "later") && m.owner?.name ? (v.update ? hm("askOwner", m.owner.name) : ownerAgent(m.owner.name)) : "";
116
+ return html`<span class="hub-member-name"><${RoomSourceMark} source=${roomSource(m)} decorative=${true} />${m.name}${extra}</span><span class="hub-member-state"><span class=${`dot ${v.dot}`} aria-hidden="true"></span><span>${v.text}</span>${owner ? html`<span class="hub-member-owner">· ${owner}</span>` : null}</span>${!compact&&(m.intro||m.kind==="assistant")?html`<small class="note">${m.kind==="assistant"?hi("assistant"):m.intro}</small>`:null}`;
82
117
  };
83
- return html`<aside class="hub-room-members">
84
- ${detail.room?.purpose?html`<section class="hub-room-purpose-panel"><h4>${rp("title")}</h4><p>${detail.room.purpose}</p></section>`:manager&&client.roomPurposeV1===true&&typeof detail.room?.purpose==="string"?html`<button type="button" class="btn btn-link" onClick=${()=>onSettings?.()}>${rp("add")}</button>`:null}
85
- <section><h4>${heads.member}</h4>
86
- <ul>${people.map(m => html`<li class="hub-member" key=${m.id}>${row(m, html`${m.id === meId ? html` <span class="tag">${hroom("roleYou")}</span>` : null}${m.role === "manager" ? html` <span class="tag">${hroom("roleManager")}</span>` : null}`)}</li>`)}</ul>
87
- </section>
88
- ${agents.length ? null : html`<section class="hub-room-no-agents"><h4>${hm("agents")}</h4><p class="note">${hm("noAgents")}</p></section>`}
89
- ${agents.length ? html`<section><h4>${heads.agent}</h4>
90
- <ul>${shown.map(m => html`<li class="hub-member hub-member-agent" key=${m.id}>
118
+ const person = (m) => html`<li class="hub-member" key=${m.id}>${row(m, html`${m.id === meId ? html` <span class="tag">${hroom("roleYou")}</span>` : null}${m.role === "manager" ? html` <span class="tag">${hroom("roleManager")}</span>` : null}`)}</li>`;
119
+ const agentItem = (m) => html`<li class="hub-member hub-member-agent" key=${m.id}>
91
120
  <button type="button" class="hub-member-open" title=${roomSource(m)?.label || ""} aria-label=${`${m.name}. ${memberStatus(m).text}. ${roomSource(m)?.label || ""}`} aria-expanded=${open === m.id} onClick=${() => { setFailed(false); setOpen(open === m.id ? null : m.id); }}>${row(m)}</button>
92
121
  ${open === m.id ? html`<div class="hub-member-card" role="group" aria-label=${m.name}>
93
122
  <strong>${m.name}</strong>${m.intro?html`<p class="note">${m.intro}</p>`:null}${m.owner?.name ? html`<small class="note">${hm("ownerOf", m.owner.name)}</small>` : null}
@@ -100,9 +129,37 @@ export function RoomMembersPanel({ client = hubClient(), roomId, detail, onMenti
100
129
  </div>
101
130
  ${failed ? html`<p class="note" role="alert">${hm("removeFailed")}</p>` : null}
102
131
  </div>` : null}
103
- </li>`)}</ul>
132
+ </li>`;
133
+ // M1: the compact list (§2.6) — the summary, the filter, who is online, the rest folded; the agents by owner, folded.
134
+ // A filter opens every group with a match and shows only the matches; the summary keeps the room's counts, and the two
135
+ // headings say how many match of how many (the leader, #4366: clear that the list is filtered).
136
+ const compactList = () => {
137
+ const locale = lang(), ordered = peopleOrder(people, meId, locale);
138
+ const online = ordered.filter((m) => m.id === meId || m.presence === "online"), owners = byOwner(agents, locale);
139
+ const on = online.filter((m) => memberMatches(m, q)), off = ordered.filter((m) => !online.includes(m) && memberMatches(m, q));
140
+ const groups = owners.map((g) => ({ ...g, shown: g.agents.filter((m) => memberMatches(m, q)) })).filter((g) => g.shown.length);
141
+ const filtering = !!q.trim();
142
+ return html`<p class="note hub-members-sum">${hm("summary", people.length, online.length, agents.length, owners.length)}</p>
143
+ <input class="hub-members-filter" type="search" value=${q} placeholder=${hm("filter")} aria-label=${hm("filterLabel")} onInput=${(e) => setQ(e.target.value)} />
144
+ ${filtering && !on.length && !off.length && !groups.length ? html`<p class="note hub-members-none" role="status">${hm("noMatch")}</p>` : null}
145
+ <section class="hub-members-people"><h4>${filtering ? hm("membersMatch", on.length + off.length, people.length) : heads.member}</h4>
146
+ ${on.length ? html`<ul>${on.map(person)}</ul>` : null}
147
+ ${off.length ? html`<details class="hub-member-group hub-members-offline" open=${filtering}><summary>${hm("notOnline", off.length)}</summary><ul>${off.map(person)}</ul></details>` : null}
148
+ </section>
149
+ ${agents.length ? html`<section><h4>${filtering ? hm("agentsMatch", groups.reduce((n, g) => n + g.shown.length, 0), agents.length) : heads.agent}</h4>
150
+ ${groups.map((g) => html`<details class="hub-member-group hub-members-owner" key=${g.key} open=${filtering}><summary>${hm("ownerGroup", g.owner || hm("noOwner"), filtering ? g.shown.length : g.agents.length)}</summary><ul>${g.shown.map(agentItem)}</ul></details>`)}
151
+ </section>` : null}`;
152
+ };
153
+ return html`<aside class=${`hub-room-members${compact ? " compact" : ""}`}>
154
+ ${detail.room?.purpose?html`<section class="hub-room-purpose-panel"><h4>${rp("title")}</h4><p>${detail.room.purpose}</p></section>`:manager&&client.roomPurposeV1===true&&typeof detail.room?.purpose==="string"?html`<button type="button" class="btn btn-link" onClick=${()=>onSettings?.()}>${rp("add")}</button>`:null}
155
+ ${compact ? compactList() : html`<section><h4>${heads.member}</h4>
156
+ <ul>${people.map(person)}</ul>
157
+ </section>
158
+ ${agents.length ? null : html`<section class="hub-room-no-agents"><h4>${hm("agents")}</h4><p class="note">${hm("noAgents")}</p></section>`}
159
+ ${agents.length ? html`<section><h4>${heads.agent}</h4>
160
+ <ul>${shown.map(agentItem)}</ul>
104
161
  ${fold.rest ? html`<button type="button" class="btn btn-link hub-members-more" onClick=${() => setExpanded(!expanded)}>${expanded ? hm("fewer") : hroom("moreN", fold.rest)}</button>` : null}
105
- </section>` : null}
162
+ </section>` : null}`}
106
163
  ${assistant ? html`<section><ul><li class="hub-member hub-member-assistant">${row({ ...assistant, name: hroom("roomAssistant") })}</li></ul></section>` : null}
107
164
  <section class="hub-room-who"><h4>${hroom("whoSees")}</h4><p class="note">${hroom("whoSeesRoom")}</p></section>
108
165
  ${manager ? html`<button type="button" class="btn btn-link hub-room-settings-link" onClick=${() => onSettings?.()}>${hroom("roomSettings")}</button>` : null}
@@ -0,0 +1,191 @@
1
+ // M-3533 R1 (docs/design/hub-office-visit.md §2): a group room's office — the room page's Office tab. The dashboard's
2
+ // own Office drawing (fleet-office.js, loaded with import() only: the Hub serves it as HUB_OFFICE_MODULES), fed the
3
+ // room's office state (GET /hub/v1/rooms/:id/office/state, share-shaped) every POLL_MS while shown, and nothing else:
4
+ // no stream of this page's own (on the Fleet dashboard that is the fleet's), no editing, no sharing, no levels, no
5
+ // skin packs, no words. Each agent says what the room's member list says (hub-room-presence.js), "answering in this
6
+ // room" the more specific form of 處理中; its card the agent's owner and introduction from the room's members.
7
+ import { html, useEffect, useMemo, useRef, useState } from "/assets/app-html.js";
8
+ import { lang } from "/assets/app-i18n.js";
9
+ import { createLease } from "/assets/app-ctx.js";
10
+ import { Skeleton, ErrorState } from "/assets/ui-states.js";
11
+ import { hroom } from "./hub-room-strings.js";
12
+ import { presenceView } from "./hub-room-presence.js";
13
+
14
+ /** How often a shown office is read again (the share page's POLL_MS). */
15
+ export const ROOM_OFFICE_POLL_MS = 5000;
16
+ /** Reads in a row that fail while the office is shown before it says the picture may be old (one or two misses: silent). */
17
+ export const ROOM_OFFICE_STALE_AFTER = 3;
18
+ /** A label longer than this (an agent's name with its owner's) takes the owner's first word instead. */
19
+ const LABEL_MAX = 24;
20
+ /**
21
+ * A figure's name is also its key in the drawing's office (fleet-office-model.js nameList keeps names of at most 200 code
22
+ * units): an agent's name (up to 256 on the Hub) is cut to NAME_MAX characters, a label with its owner to KEY_MAX, with
23
+ * "…" — a name that long cannot be read on the scene anyway; the member list still says it in full.
24
+ */
25
+ const NAME_MAX = 48, KEY_MAX = 64;
26
+ /**
27
+ * A name the drawing reads as something else — "team:…" (a team, or NOBODY), an Object.prototype key ("__proto__",
28
+ * "constructor"…), a control character (LOBBY) — keyed with an invisible word joiner in front: the same to read, never
29
+ * the same key (#4355 review).
30
+ */
31
+ const RESERVED = (name) => name.startsWith("team:") || Object.prototype.hasOwnProperty.call(Object.prototype, name) || /[\u0000-\u001f]/.test(name);
32
+ const safeKey = (name) => (RESERVED(name) ? `\u2060${name}` : name);
33
+ const clip = (text, n) => { const c = [...text]; return c.length > n ? `${c.slice(0, n - 1).join("")}…` : text; };
34
+ const STORAGE_PREFIX = "agend_hub_room_office:";
35
+
36
+ /** The Office drawing, loaded once on first use (the Hub serves it; a fleet page has it already). */
37
+ let drawing = null;
38
+ export const loadDrawing = () => (drawing ??= Promise.all([import("./fleet-office.js"), import("./fleet-org.js")])
39
+ .then(([office, org]) => ({ Office: office.Office, buildOrgView: org.buildOrgView }))
40
+ .catch((e) => { drawing = null; throw e; }));
41
+
42
+ /** The state's agents as the app store's status frame (office-share-page.js appFromState): the drawing's input. */
43
+ export function officeApp(d) {
44
+ const instances = Array.isArray(d && d.instances) ? d.instances.filter((i) => i && typeof i.name === "string") : [];
45
+ const exec = Object.create(null);
46
+ for (const i of instances) exec[i.name] = i.execution_state ?? null;
47
+ return { ready: true, instances, exec, awaiting: {}, needs: [], connection: "polling" };
48
+ }
49
+
50
+ /**
51
+ * The drawing's reads, answered here from the room's state (`now()`): its one office, no acts, no skin packs; anything
52
+ * else (levels, a pack, a save) is not this page's to answer.
53
+ */
54
+ export function officeReads(now) {
55
+ const json = (body) => Promise.resolve(new Response(JSON.stringify(body), { status: 200, headers: { "Content-Type": "application/json" } }));
56
+ return (path, opts = {}) => {
57
+ const p = String(path), method = String(opts.method || "GET").toUpperCase();
58
+ if (method !== "GET") return Promise.resolve(new Response("", { status: 404 }));
59
+ if (p === "/ui/offices") return json(now()?.offices ?? { rev: 0, readable: true, offices: [] });
60
+ if (p === "/ui/office-acts") return json({ acts: [], now: Date.now() });
61
+ if (p === "/ui/office-skins") return json({ rev: "", packs: [] });
62
+ return Promise.resolve(new Response("", { status: 404 }));
63
+ };
64
+ }
65
+
66
+ /** This browser's choices for rooms' offices (zoom, the checkboxes), apart from the Fleet office's. */
67
+ export function roomOfficeStorage(base = (() => { try { return globalThis.localStorage || null; } catch { return null; } })()) {
68
+ if (!base) return undefined;
69
+ return {
70
+ getItem: (k) => { try { return base.getItem(STORAGE_PREFIX + k); } catch { return null; } },
71
+ setItem: (k, v) => { try { base.setItem(STORAGE_PREFIX + k, v); } catch { /* this page only */ } },
72
+ removeItem: (k) => { try { base.removeItem(STORAGE_PREFIX + k); } catch { /* this page only */ } },
73
+ };
74
+ }
75
+
76
+ /**
77
+ * An agent's state in the member list's own words (presenceView: its reason too, while the list says the same presence),
78
+ * and "answering in this room" as what it is doing now.
79
+ */
80
+ export function officeWords(node, members) {
81
+ const i = node && node.i;
82
+ if (!i) return { state: hroom("stOffline"), now: "" };
83
+ const kind = i.assistant ? "assistant" : "agent", presence = i.presence || "offline";
84
+ const listed = (Array.isArray(members) ? members : []).find((m) => m && (kind === "assistant" ? m.kind === "assistant" : m.kind === "agent" && m.id === i.member));
85
+ const v = presenceView(listed && listed.presence === presence ? listed : { kind, presence });
86
+ // Answering here is the more specific 處理中: the member list's working word, and what it is doing now.
87
+ return { state: hroom(i.answering ? "stWorking" : v.word), now: i.answering ? hroom("answeringHere") : "" };
88
+ }
89
+
90
+ /** A card's rows: the agent's owner and introduction, from the room's members (the assistant: provided by the Hub). */
91
+ export function officeCardRows(members, id) {
92
+ if (id === "assistant") return [{ key: "owner", label: hroom("cardOwner"), value: hroom("providedByHub") }];
93
+ const m = (Array.isArray(members) ? members : []).find((x) => x && x.kind === "agent" && x.id === id);
94
+ if (!m) return [];
95
+ return [{ key: "owner", label: hroom("cardOwner"), value: String(m.owner?.name || "") }, { key: "intro", label: hroom("cardIntro"), value: String(m.intro || "") }];
96
+ }
97
+
98
+ /**
99
+ * The drawing names people by their instance name (and shows it beside a display name, or first when the viewer prefers
100
+ * it): a room's agents are named by what members see — the room assistant by the room's word for it; agents sharing a
101
+ * name told apart by their owner, as the member list's second line does (「Atlas(Alex Sample)」, the owner's first word
102
+ * when that is too long) — and keep their member id as `member` (their card and words read it).
103
+ */
104
+ export function named(d, members = []) {
105
+ const list = (Array.isArray(d && d.instances) ? d.instances : []).filter((i) => i && typeof i.name === "string");
106
+ const base = (i) => clip(i.assistant ? hroom("roomAssistant") : String(i.display_name || "").trim() || "?", NAME_MAX);
107
+ const count = new Map();
108
+ for (const i of list) count.set(base(i), (count.get(base(i)) || 0) + 1);
109
+ const owners = new Map((Array.isArray(members) ? members : []).filter((m) => m && m.kind === "agent").map((m) => [m.id, String(m.owner?.name || "").trim()]));
110
+ const [open, close] = lang() === "zh-TW" ? ["(", ")"] : [" (", ")"];
111
+ const taken = new Set(), rename = new Map();
112
+ const instances = list.map((i) => {
113
+ const b = base(i), owner = owners.get(i.name) || "";
114
+ let label = b;
115
+ if (count.get(b) > 1 && owner) {
116
+ label = `${b}${open}${owner}${close}`;
117
+ if ([...label].length > LABEL_MAX) label = `${b}${open}${owner.split(/\s+/)[0]}${close}`;
118
+ label = clip(label, KEY_MAX);
119
+ }
120
+ label = safeKey(label);
121
+ for (let n = 2, at = label; taken.has(label); n++) label = `${at} ${n}`;
122
+ taken.add(label); rename.set(i.name, label);
123
+ return { ...i, name: label, display_name: label, member: i.name };
124
+ });
125
+ const offices = d && d.offices && Array.isArray(d.offices.offices)
126
+ ? { ...d.offices, offices: d.offices.offices.map((o) => ({ ...o, members: (Array.isArray(o.members) ? o.members : []).map((m) => rename.get(m) ?? m) })) } : d?.offices;
127
+ return { ...d, instances, offices };
128
+ }
129
+
130
+ /**
131
+ * `members` the room's (its detail's: owner, introduction, the list's states); `onMention(member)` the card's "@ it" (the
132
+ * page switches to Chat with the mention in the box); `more` / `onMore` a phone's options sheet, opened from the room's ⋯.
133
+ */
134
+ export function RoomOffice({ client, roomId, members, onMention = null, more = false, onMore = null, timers = globalThis, pollMs = ROOM_OFFICE_POLL_MS, load = loadDrawing }) {
135
+ const [phase, setPhase] = useState("loading"); // loading | live | failed | off
136
+ const [d, setD] = useState(null);
137
+ const [kit, setKit] = useState(null);
138
+ const [attempt, setAttempt] = useState(0);
139
+ // The drawing's modules failing to load is not the room's state failing to read: a good read must not hide it.
140
+ const [kitFailed, setKitFailed] = useState(false);
141
+ const [stale, setStale] = useState(false);
142
+ const misses = useRef(0);
143
+ const holder = useMemo(() => ({ d: null }), [roomId]);
144
+ const lease = useMemo(() => {
145
+ const reads = officeReads(() => holder.d);
146
+ return createLease({
147
+ setTimeout: (...a) => timers.setTimeout(...a), clearTimeout: (h) => timers.clearTimeout(h),
148
+ setInterval: (...a) => timers.setInterval(...a), clearInterval: (h) => timers.clearInterval(h),
149
+ fetch: (path, opts) => reads(path, opts),
150
+ });
151
+ }, [roomId, holder]);
152
+ useEffect(() => () => lease.dispose(), [lease]);
153
+ const storage = useMemo(() => roomOfficeStorage(), []);
154
+ useEffect(() => {
155
+ let stopped = false;
156
+ if (!kit) load().then((k) => { if (!stopped) { setKit(k); setKitFailed(false); } }, () => { if (!stopped) setKitFailed(true); });
157
+ const read = async () => {
158
+ const r = await client.roomOfficeState(roomId);
159
+ if (stopped || !lease.current()) return;
160
+ if (r && r.ok) { misses.current = 0; setStale(false); setD(r); setPhase("live"); return; }
161
+ if (r && r.status === 409 && r.code === "office-off") { setPhase("off"); return; }
162
+ // A read that fails while the office is shown keeps the last picture; ROOM_OFFICE_STALE_AFTER in a row say it may
163
+ // be old (people shown 處理中 minutes ago). A first read that fails says so at once.
164
+ if (++misses.current >= ROOM_OFFICE_STALE_AFTER) setStale(true);
165
+ setPhase((p) => (p === "live" ? p : "failed"));
166
+ };
167
+ void read();
168
+ const h = lease.interval(() => { if (!stopped && !globalThis.document?.hidden) void read(); }, pollMs);
169
+ return () => { stopped = true; lease.clear(h); };
170
+ }, [lease, attempt]);
171
+ const shown = useMemo(() => (d ? named(d, members) : null), [d, members]);
172
+ holder.d = shown;
173
+ const view = useMemo(() => (kit && shown ? kit.buildOrgView(shown.org, officeApp(shown)) : null), [kit, shown]);
174
+ const memberOf = (name) => {
175
+ const id = shown?.instances.find((i) => i.name === name)?.member;
176
+ return (Array.isArray(members) ? members : []).find((m) => m && (id === "assistant" ? m.kind === "assistant" : m.kind === "agent" && m.id === id)) || null;
177
+ };
178
+ if (phase === "off") return html`<div class="hub-room-office hub-room-office-note"><p class="note" role="status">${hroom("officeOff")}</p></div>`;
179
+ if ((phase === "failed" || kitFailed) && !view) return html`<div class="hub-room-office hub-room-office-note">
180
+ <${ErrorState} message=${hroom("officeFailed")} onRetry=${() => { setPhase("loading"); setKitFailed(false); setAttempt((n) => n + 1); }} /></div>`;
181
+ if (!view) return html`<div class="hub-room-office hub-room-office-loading"><${Skeleton} variant="cards" lines=${3} label=${hroom("officeLoading")} /></div>`;
182
+ const { Office } = kit;
183
+ return html`<div class="hub-room-office" data-trust="panel-content">
184
+ ${stale ? html`<p class="note hub-room-office-stale" role="status">${hroom("officeStale")}</p>` : null}
185
+ <${Office} view=${view} traffic=${[]} lease=${lease} opening="room" talk=${{ now: Date.now(), items: [] }}
186
+ oneOffice=${true} readOnly=${true} stream=${false} storage=${storage} words=${(node) => officeWords(node, members)}
187
+ cardRows=${(name) => officeCardRows(members, shown.instances.find((i) => i.name === name)?.member)}
188
+ cardAction=${onMention ? (name) => { const m = memberOf(name); return m ? { label: hroom("mentionIt"), title: hroom("mentionItTitle", name), run: () => onMention(m) } : null; } : null}
189
+ more=${more} onMore=${onMore} officesKey=${shown.offices?.offices?.[0]?.members?.join("\n") ?? ""} />
190
+ </div>`;
191
+ }
@@ -2,8 +2,8 @@ import {html,useState} from "/assets/app-html.js";
2
2
  import {register,t} from "/assets/app-i18n.js";
3
3
  import {Dialog} from "/assets/ui-dialog.js";
4
4
  register("hubRoomPurpose",{
5
- en:{title:"Purpose",hint:"One line on what this room is for. Members see it, and agents asked here are told.",placeholder:"For example: release questions for the web team",add:"Add a purpose",tooLong:"Use 200 characters or fewer.",close:"Close"},
6
- "zh-TW":{title:"用途",hint:"用一句話說明這個房間做什麼。成員看得到,在這裡被問的 Agent 也會知道。",placeholder:"例如:網頁組的發版問題",add:"新增用途",tooLong:"最多 200 個字。",close:"關閉"}
5
+ en:{title:"Purpose",hint:"One line on what this room is for. Members see it, and agents asked here are told.",placeholder:"For example: release questions for the web team",add:"Add a purpose",tooLong:"Use 200 characters or fewer.",close:"Close",edit:"Edit"},
6
+ "zh-TW":{title:"用途",hint:"用一句話說明這個房間做什麼。成員看得到,在這裡被問的 Agent 也會知道。",placeholder:"例如:網頁組的發版問題",add:"新增用途",tooLong:"最多 200 個字。",close:"關閉",edit:"編輯"}
7
7
  });
8
8
  export const rp=(key,...args)=>t(`hubRoomPurpose.${key}`,...args);
9
9
  export const purposeCount=value=>[...new Intl.Segmenter(undefined,{granularity:"grapheme"}).segment(String(value??""))].length;
@@ -17,3 +17,19 @@ export function RoomPurposeHeader({purpose="",onEdit}){
17
17
  return html`<button type="button" class="hub-room-purpose-trigger" title=${purpose} aria-haspopup="dialog" aria-expanded=${open?"true":"false"} aria-label=${`${rp("title")}: ${purpose}`} onClick=${()=>setOpen(true)}>${purpose}</button>
18
18
  ${open?html`<${Dialog} title=${rp("title")} onClose=${()=>setOpen(false)} actions=${html`<button type="button" class="btn" onClick=${()=>setOpen(false)}>${rp("close")}</button>`}><p class="hub-room-purpose-full">${purpose}</p></${Dialog}>`:null}`;
19
19
  }
20
+
21
+ /**
22
+ * M-3533 H1 (the user's approved r3, design §2.1a): the room's purpose as the strip under the header that an agent's chat
23
+ * page uses for its identity card (`.chat-card` with `.id-card.card-c`): the room's square picture, "Purpose" and the text
24
+ * beside it, wrapping as it needs; a manager has Edit at its right. No purpose: a manager sees the card with "Add a purpose";
25
+ * a member sees no card. The same card on a phone, where the purpose was only in the members sheet before.
26
+ */
27
+ export function RoomPurposeCard({initial="?",purpose="",onEdit}){
28
+ if(!purpose&&!onEdit)return null;
29
+ return html`<div class="chat-card open hub-room-card" data-trust="panel-content"><section class="id-card card-c" aria-label=${rp("title")}><div class="id-row">
30
+ <span class="av av-square hub-room-card-av" aria-hidden="true"><span class="av-text">${initial}</span></span>
31
+ <div class="id-text"><p class="id-tagline">${rp("title")}</p>${purpose?html`<p class="id-bio">${purpose}</p>`:null}</div>
32
+ ${/* The card's one action is the same button with or without a purpose: Edit, or Add a purpose (Lumen, #4349). */ ""}
33
+ ${onEdit?html`<button type="button" class=${`btn btn-sm hub-room-card-edit${purpose?"":" hub-room-card-add"}`} onClick=${onEdit}>${purpose?rp("edit"):rp("add")}</button>`:null}
34
+ </div></section></div>`;
35
+ }
@@ -56,7 +56,10 @@ export function RoomSettings({ client = hubClient(), roomId, detail, onClose, on
56
56
  const [offered, setOffered] = useState(assistant === true), [addPeople, setAddPeople] = useState([]), [addAgents, setAddAgents] = useState([]), [peopleNote, setPeopleNote] = useState("");
57
57
  const live = useRef(true);
58
58
  useEffect(() => () => { live.current = false; }, []);
59
- useEffect(() => { setName(room.name ?? ""); setAllMention(settings.allMention !== false); setHistory(settings.historyForNew === "all" ? "all" : "since-join"); }, [detail]);
59
+ // M-3533 R1 (design §2.1b): Room office, on or off — managers only (this dialog is theirs), when the Hub serves it.
60
+ const officeShown = typeof settings.office?.enabled === "boolean" && client.roomOfficeV1 === true;
61
+ const [office, setOffice] = useState(settings.office?.enabled === true);
62
+ useEffect(() => { setName(room.name ?? ""); setAllMention(settings.allMention !== false); setHistory(settings.historyForNew === "all" ? "all" : "since-join"); setOffice(settings.office?.enabled === true); }, [detail]);
60
63
  useEffect(()=>setAiApps(settings.aiApps!==false),[detail]);
61
64
  useEffect(() => {
62
65
  if (typeof assistant === "boolean") { setOffered(assistant); return; }
@@ -149,6 +152,10 @@ export function RoomSettings({ client = hubClient(), roomId, detail, onClose, on
149
152
  ${offered || hasAssistant ? html`<label class="check"><input id="hubRoomSettingsAssistant" class="s-ui-toggle" type="checkbox" role="switch" checked=${hasAssistant} disabled=${busy}
150
153
  onChange=${(e) => { const v = e.target.checked, id = members.find(m => m.kind === "assistant")?.id; void act(() => v ? client.addRoomMember(roomId, { kind: "assistant" }) : client.removeRoomMember(roomId, id)); }} /><span>${hs("assistantSwitch")}</span></label>` : null}
151
154
  </section>
155
+ ${officeShown ? html`<section class="form hub-room-office-settings"><h4>${hroom("officeSection")}</h4>
156
+ <label class="check"><input id="hubRoomOffice" class="s-ui-toggle" type="checkbox" role="switch" checked=${office} disabled=${busy}
157
+ onChange=${(e) => { const v = e.target.checked; setOffice(v); void act(() => client.updateRoom(roomId, { office: { enabled: v } }), () => setOffice(!v)); }} /><span>${hroom("officeSetting")}</span></label>
158
+ </section>` : null}
152
159
  <section class="form"><h4>${hroom("other")}</h4>
153
160
  <button type="button" class="btn btn-danger" disabled=${busy || room.archived === true} onClick=${() => { void archive(); }}>${hroom("archiveRoom")}</button>
154
161
  </section>
@@ -76,6 +76,14 @@ register("hubRoom", {
76
76
  create: "Create", cancel: "Cancel",
77
77
  createdSys: "{0} created this room.",
78
78
  purposeSetSys:"{0} set the purpose: {1}",purposeClearedSys:"{0} cleared the purpose.",
79
+ // M-3533 R1: a room's office (docs/design/hub-office-visit.md §2.1).
80
+ officeOnSys: "{0} turned the room office on.", officeOffSys: "{0} turned the room office off.",
81
+ tabChat: "Chat", tabOffice: "Office", roomViews: "{0}: chat or office",
82
+ officeLoading: "Loading the office…", officeFailed: "Can't load the office right now. The chat still works.",
83
+ officeOff: "A room manager turned the office off.",
84
+ cardOwner: "Owner", cardIntro: "Introduction", answeringHere: "Answering a question in this room",
85
+ mentionIt: "@ it", mentionItTitle: "Ask {0} in the chat", officeOptions: "Office options", officeStale: "The office may be out of date. Reconnecting…",
86
+ officeSection: "Room office", officeSetting: "Show the room office",
79
87
  sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
80
88
  invitedSys: "{0} agents invited; they join when the owner agrees.",
81
89
  nameRequired: "Enter a room name.",
@@ -208,6 +216,13 @@ register("hubRoom", {
208
216
  create: "建立", cancel: "取消",
209
217
  createdSys: "{0} 建立了這個房間。",
210
218
  purposeSetSys:"{0} 設定了用途:{1}",purposeClearedSys:"{0} 清除了用途。",
219
+ officeOnSys: "{0} 開啟了房間辦公室。", officeOffSys: "{0} 關閉了房間辦公室。",
220
+ tabChat: "聊天", tabOffice: "辦公室", roomViews: "{0}:聊天或辦公室",
221
+ officeLoading: "正在載入辦公室…", officeFailed: "目前無法載入辦公室,聊天仍可正常使用。",
222
+ officeOff: "房間管理員已關閉辦公室。",
223
+ cardOwner: "擁有者", cardIntro: "介紹", answeringHere: "正在回答這個房間的問題",
224
+ mentionIt: "@ 它", mentionItTitle: "在聊天裡問 {0}", officeOptions: "辦公室選項", officeStale: "畫面可能不是最新,正在重新連線…",
225
+ officeSection: "房間辦公室", officeSetting: "顯示房間辦公室",
211
226
  sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
212
227
  invitedSys: "已邀請 {0} 個 Agent,擁有者同意後會加入。",
213
228
  nameRequired: "請輸入房間名稱。",
@@ -1,4 +1,4 @@
1
- import {RoomPurposeHeader} from "./hub-room-purpose.js";
1
+ import {RoomPurposeCard} from "./hub-room-purpose.js";
2
2
  import { hi } from "./hub-agent-intro.js";
3
3
  import {hp} from "./hub-personal-agent-strings.js";
4
4
  // M-3092 PR 2 (Hub rooms, track U): one room of a Hub with rooms, on the Fleet chat's own thread (/assets/chat-thread.js
@@ -37,6 +37,7 @@ import { countsLine } from "./hub-room-list.js";
37
37
  import { DropOverlay, MAX_FILES, PendingFiles, hf, hubFileAttachment, pageCarriesFiles, putBackText, roomTakesFiles, uploadChosen, useFileDrop } from "./hub-attachments.js";
38
38
  import { LightboxHost, openLightbox } from "/assets/image-lightbox.js";
39
39
  import { ROOM_PINS_MAX, RoomPinsButton, RoomPinsDialog } from "./hub-room-pins.js";
40
+ import { RoomOffice } from "./hub-room-office.js";
40
41
  // M-3125 PR3: the one quote target an annotated room picture has (here, so a page with an older dictionary has the words).
41
42
  register("hubRoomAnnotate", { en: { quote: "Quote in this room" }, "zh-TW": { quote: "引用到這個房間" } });
42
43
 
@@ -94,6 +95,7 @@ export function authorLine(author, mine = false, direct = false) {
94
95
  const SYSTEM = { "room-created": "createdSys", "member-joined": "sysJoined", "admin-joined": "sysAdminJoined", "poll-closed": "sysPollClosed" };
95
96
  export function systemText(m) {
96
97
  if(m?.system?.kind==="purpose-changed"&&typeof m.system.purpose==="string"&&typeof m.system.name==="string")return hroom(m.system.purpose?"purposeSetSys":"purposeClearedSys",m.system.name,m.system.purpose);
98
+ if (m?.system?.kind === "office-changed" && typeof m.system.enabled === "boolean" && typeof m.system.name === "string") return hroom(m.system.enabled ? "officeOnSys" : "officeOffSys", m.system.name);
97
99
  if(m?.system?.kind==="app-rate-limited")return ha("rateLimited",m.system.name||"");
98
100
  if (m?.system?.kind === "agent-mention-stopped") return agentStopText(m.system) ?? String(m.text || "");
99
101
  const key = m && m.system && SYSTEM[m.system.kind];
@@ -400,7 +402,8 @@ function useMembersPanel() {
400
402
  * Fleet chat's thread (panel-hub.js's HubThread, given as `Thread`: the thread wiring is one), the room's composer, and
401
403
  * the members panel on the right. `client`: the Hub client; `me`: { id } from the session.
402
404
  */
403
- export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "", rooms = [], openRoom = () => {}, goList = () => {}, onLeft = () => {}, onMe = () => {}, pinsOn = false }) {
405
+ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "", rooms = [], openRoom = () => {}, goList = () => {}, onLeft = () => {}, onMe = () => {}, pinsOn = false,
406
+ view = "chat", onView = () => {}, officeHref = (v) => v }) {
404
407
  const store = useMemo(() => createRoomStore(roomId, { client, meId, pinsOn }), [roomId]);
405
408
  const [pinsOpen, setPinsOpen] = useState(false);
406
409
  useEffect(() => () => store.stop(), [store]);
@@ -430,6 +433,23 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
430
433
  if (r.ok) onLeft(); else setLeaveError(r.text);
431
434
  };
432
435
  const detail = store.detail(), room = detail?.room || listed || {}, group = room.kind === "group";
436
+ // M-3533 R1 (design §2.1): the room's office, a tab beside Chat while a manager has it on (and this Hub serves it).
437
+ const officeOn = group && client.roomOfficeV1 === true && detail?.settings?.office?.enabled === true;
438
+ const inOffice = officeOn && view === "office";
439
+ // M-3533 R1: the office card's "@ it" goes back to Chat with the mention in the box, once the box is there again.
440
+ const mentionNext = useRef(null), [officeMore, setOfficeMore] = useState(false);
441
+ // A member as the box mentions it: the room assistant by the composer's own word for it; an agent or a person by name,
442
+ // bound to that member (two agents of one name: this one).
443
+ const insertMention = (m) => {
444
+ if (!m) return;
445
+ if (m.kind === "assistant") insert.current?.(hroom("mentionAssistant"));
446
+ else insert.current?.(`@${m.name}`, m.kind === "agent" ? { name: String(m.name), id: m.id } : null);
447
+ };
448
+ useEffect(() => {
449
+ if (inOffice || !mentionNext.current) return undefined;
450
+ const m = mentionNext.current, h = setTimeout(() => { mentionNext.current = null; insertMention(m); }, 0);
451
+ return () => clearTimeout(h);
452
+ });
433
453
  // The page-level rooms notifier learns this person's id for this room from its detail (§12; member
434
454
  // ids are per room, so the id is kept under this room's id).
435
455
  useEffect(() => { const id = detail && detail.me && detail.me.id; if (id) onMe(roomId, id); }, [detail && detail.me && detail.me.id]);
@@ -445,7 +465,7 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
445
465
  } } : null;
446
466
  // M-3311 (1): a file dragged onto the conversation is attached, as in the Fleet chat.
447
467
  const mainRef = useRef(null);
448
- useFileDrop(mainRef, attach);
468
+ useFileDrop(mainRef, inOffice ? null : attach);
449
469
  // M-3311 (3): a long paste's chip — 「改為文字」 puts its text back into the box (the Fleet chat's), and the chip goes.
450
470
  const asText = (key) => { const f = filesRef.current.find((x) => x.key === key); if (!f) return; setFiles(filesRef.current.filter((x) => x.key !== key)); putBackText(input.current, f.text); input.current?.focus(); };
451
471
  const pending = files.length || fileMsg ? html`<${PendingFiles} files=${files} onAsText=${asText} onRemove=${(key) => setFiles(filesRef.current.filter((f) => f.key !== key))}
@@ -551,6 +571,10 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
551
571
  const [fullWidth, setFullWidth] = useState(hubChatWide);
552
572
  const textSize = useStore(textSizeStore), notify = useStore(notifyStore), narrow = useNarrowScreen();
553
573
  const menuItems = [
574
+ // M-3533 R1: a phone has no tab row — Office is the first item of ⋯ (in the office, its back returns to the chat).
575
+ narrow && officeOn && !inOffice ? { key: "office", label: hroom("tabOffice"), icon: "org", onSelect: () => onView("office") } : null,
576
+ // In the office a phone's options (hide paused, bedtime, dialogue, key, fit, fill) are one sheet, not rows over the scene.
577
+ narrow && inOffice ? { key: "officeMore", label: hroom("officeOptions"), icon: "settings", onSelect: () => setOfficeMore(true) } : null,
554
578
  group && detail?.me?.role === "manager" ? { key: "settings", label: hroom("roomSettings"), icon: "settings", onSelect: openSettings } : null,
555
579
  group && detail?.me ? { key: "leave", label: hroom("leaveRoom"), icon: "close", onSelect: () => { void leave(); } } : null,
556
580
  pinCount ? { key: "pins", label: `${t("chat.pinsTitle")} · ${pinCount}`, icon: "pin", onSelect: () => setPinsOpen(true) } : null,
@@ -562,43 +586,55 @@ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "",
562
586
  ...(notifySupport() === "ok" ? [{ key: "notify", checkbox: true, checked: notify.state === "on", disabled: notify.asking, label: hroom("notifyTitle"), onSelect: () => { void setNotify(notify.state !== "on"); } }] : []),
563
587
  ] : []),
564
588
  ].filter(Boolean);
565
- const line2 = group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
589
+ const line2 = narrow && inOffice ? hroom("tabOffice") : group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
566
590
  : room.assistant ? hroom("providedByHub") : room.agent?.answerOnly ? hp("answerOnlyAsker") : String(room.agent?.owner?.name || "");
567
591
  const showRail = wide && rail && Panel && group && detail;
568
592
  // The Fleet chat's working bar (Lumen): 「Notes 正在處理」, or 「2 個 Agent 正在處理」 — the answer row only when it arrives.
569
593
  // Who: this room's answers being worked on; the words: workingLine() (#3857), the one place that says it.
570
594
  const working = workingLine({ members: store.workers().map((w) => ({ ...w, presence: "working" })) });
571
595
  const panel = Panel && detail ? html`<${Panel} client=${client} roomId=${roomId} detail=${detail}
572
- onMention=${(m) => { setSheet(false); insert.current?.(`@${m.name}`); }}
596
+ onMention=${(m) => { setSheet(false); insertMention(m); }}
573
597
  onOpenChat=${(m) => { const direct = rooms.find((r) => r.kind === "direct" && r.agent?.exposureId === m.id); if (direct) openRoom(direct.id); }}
574
598
  onSettings=${() => { setSheet(false); openSettings(); }} />` : null;
575
599
  return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId} data-width=${fullWidth ? "full" : undefined}>
576
600
  <${LightboxHost} />
577
601
  ${pinsOpen ? html`<${RoomPinsDialog} pins=${store.pins()} onClose=${() => setPinsOpen(false)} onJump=${(p) => void showPin(p)} onUnpin=${(p) => void togglePin(p.messageId)} />` : null}
578
602
  <section class="hub-chat-main" ref=${mainRef}>
579
- ${attach ? html`<${DropOverlay} />` : null}
603
+ ${attach && !inOffice ? html`<${DropOverlay} />` : null}
580
604
  <header class=${`hub-chat-head${room.agent?.answerOnly?" hub-answer-only-head":""}`} data-trust="panel-content">
581
605
  ${/* Lumen (spec §2): on a phone the header starts with the Fleet chat's back to the list. */ ""}
582
- <a class="icon-btn hub-back only-narrow" href="/ui/hub" aria-label=${t("hub.back")} title=${t("hub.back")}
583
- onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); goList(); }}><${Icon} name="back" /></a>
584
- <span class=${`av${group ? " av-square" : ""}`} aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>
585
- <span class="hub-chat-title"><strong>${title}</strong>${group&&typeof room.purpose==="string"?html`<${RoomPurposeHeader} purpose=${room.purpose} onEdit=${detail?.me?.role==="manager"&&client.roomPurposeV1===true?openSettings:undefined} />`:null}<span class=${`s${room.agent?.answerOnly?" hub-answer-only-note":""}`}>${line2}</span>${room.assistant||room.agent?.intro?html`<span class="s hub-agent-intro-line">${room.assistant?hi("assistant"):room.agent.intro}</span>`:null}</span>
606
+ <a class="icon-btn hub-back only-narrow" href=${inOffice ? officeHref("chat") : "/ui/hub"} aria-label=${t("hub.back")} title=${t("hub.back")}
607
+ onClick=${(e) => { if (e.metaKey || e.ctrlKey) return; e.preventDefault(); if (inOffice) onView("chat"); else goList(); }}><${Icon} name="back" /></a>
608
+ ${/* M-3533 H1 (r3): a room's header is one line — its name, its counts beside it — and its picture is in the purpose card
609
+ under the header. A one-to-one chat keeps its picture here. */ ""}
610
+ ${group ? null : html`<span class="av" aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>`}
611
+ <span class=${`hub-chat-title${group ? " one-line" : ""}`}><strong>${title}</strong><span class=${`s${room.agent?.answerOnly?" hub-answer-only-note":""}`}>${line2}</span>${room.assistant||room.agent?.intro?html`<span class="s hub-agent-intro-line">${room.assistant?hi("assistant"):room.agent.intro}</span>`:null}</span>
612
+ ${officeOn && !narrow ? html`<nav class="inst-switch seg hub-room-tabs" aria-label=${hroom("roomViews", title)}>${["chat", "office"].map((v) => {
613
+ const label = hroom(v === "chat" ? "tabChat" : "tabOffice"), on = (v === "office") === inOffice;
614
+ return html`<a key=${v} class=${`seg-item${on ? " active" : ""}`} href=${officeHref(v)} aria-current=${on ? "page" : undefined} data-label=${label}
615
+ onClick=${(e) => { if (e.metaKey || e.ctrlKey || e.shiftKey || e.button > 0) return; e.preventDefault(); onView(v); }}>${label}</a>`; })}</nav>` : null}
586
616
  <span class="hub-head-tools"><${RoomPinsButton} count=${pinCount} onOpen=${() => setPinsOpen(true)} /><${TextSizeButton} /><${HubNotifyToggle} /></span>
587
617
  ${group && Panel ? html`<button type="button" class="icon-btn hub-room-rail-toggle" aria-pressed=${(wide ? rail : sheet) ? "true" : "false"} title=${hroom("members")} aria-label=${hroom("members")}
588
618
  onClick=${() => (wide ? setRail(!rail) : setSheet(true))}><${Icon} name="team" size=${18} /></button>` : null}
589
619
  ${menuItems.length ? html`<${Menu} cls="hub-room-menu" label=${hroom("menu")} fit=${true} ownerKey=${roomId} items=${menuItems} />` : null}
590
620
  </header>
621
+ ${inOffice ? html`<${RoomOffice} key=${roomId} client=${client} roomId=${roomId} members=${detail?.members || []}
622
+ onMention=${(m) => { mentionNext.current = m; onView("chat"); }} more=${narrow && officeMore} onMore=${narrow ? setOfficeMore : null} />` : null}
623
+ ${!inOffice && group && typeof room.purpose === "string" ? html`<${RoomPurposeCard} initial=${firstCharacter(title || "?") || "?"} purpose=${room.purpose}
624
+ onEdit=${detail?.me?.role === "manager" && client.roomPurposeV1 === true ? openSettings : undefined} />` : null}
591
625
  ${leaveError ? html`<p class="err hub-room-leave-err" role="alert">${leaveError}</p>` : null}
592
626
  ${room.closureReason === "owner-stopped-sharing" ? html`<p class="note" role="status">${hroom("noAnswerStopped", room.ownerName || room.agent?.owner?.name || "")}</p>` : null}
593
- <${Thread} store=${store} name=${title} panelKey=${`hub-room:${roomId}`} threadRef=${threadRef} extra=${extra}
627
+ ${inOffice ? null : html`<${Thread} store=${store} name=${title} panelKey=${`hub-room:${roomId}`} threadRef=${threadRef} extra=${extra}
594
628
  emptyView=${room.assistant ? html`<div class="hub-assistant-empty"><${Empty} icon="bot" title=${hroom("hubAssistant")} hint=${hroom("hubAssistantEmpty")} /></div>`
595
- : group ? html`<p class="note">${hroom("composerHint")}</p>` : null} />
596
- ${/* M-3117: under the thread, the Fleet chat's dock — its column, its padding, the working line and the box in it. */ ""}
597
- <div class="dock hub-dock" data-trust="composer"><div class="dock-col">
629
+ : group ? html`<p class="note">${hroom("composerHint")}</p>` : null} />`}
630
+ ${/* M-3117: under the thread, the Fleet chat's dock — its column, its padding, the working line and the box in it.
631
+ M-3533 R1: the office shows none (design §2.1: no message box under it; to ask, back to Chat). It stays mounted, hidden,
632
+ so a draft and the mentions picked into it are still there when Chat comes back. */ ""}
633
+ ${html`<div class="dock hub-dock" data-trust="composer" hidden=${inOffice}><div class="dock-col">
598
634
  ${working ? html`<${WorkBarView} kind="working" label=${working.text} elapsed="" elapsedTitle="" />` : null}
599
635
  <${RoomComposer} store=${sendStore} detail=${detail} reply=${reply} onReply=${setReply} closed=${store.closed()} inputRef=${input} insertRef=${insert}
600
636
  attach=${attach} pending=${pending} canSendEmpty=${files.some((f) => f.state === "ready")} />
601
- </div></div>
637
+ </div></div>`}
602
638
  </section>
603
639
  ${showRail ? html`<${RailFrame} trust="hub-context" label=${hroom("members")} title=${hroom("members")} closeLabel=${hroom("cancel")} onClose=${() => setRail(false)}>${panel}</${RailFrame}>` : null}
604
640
  ${!wide && sheet && panel && group ? html`<${Dialog} title=${hroom("members")} label=${hroom("members")} onClose=${() => setSheet(false)}><div class="hub-rail-sheet">${panel}</div></${Dialog}>` : null}
@@ -147,7 +147,7 @@ register("hub", {
147
147
  hold_rejected: "Hub 無法繼續使用這個 Fleet 儲存的連接。Hub 可能已還原至較舊的狀態,或不再接受這個 Fleet;請重新連接。",
148
148
  hold_refused: "Hub 拒絕了這次連接。", hold_revoked: "Hub 已撤銷這個 Fleet 的連接。", hold_other: "連接已暫停。",
149
149
  contactLimit: "回答 Hub 的提問時,這個 Agent 不能聯絡其他 Agent",
150
- contactLimitHint: "Hub 上的人可以問這個 Agent,但不能透過它找到你的其他 Agent。回答獲接受或經過 30 分鐘後解除。",
150
+ contactLimitHint: "Hub 上的人可以向這個 Agent 提問,但不能透過它找到你的其他 Agent。回答獲接受或經過 30 分鐘後解除。",
151
151
  contactLimitNotice: "現有分享已開啟聯絡限制。若要讓 Agent 在回答 Hub 提問時互相協助,請到「設定 → Hub → 分享的 Agent」取消勾選「回答 Hub 的提問時,這個 Agent 不能聯絡其他 Agent」。",
152
152
  contactNoticeDone: "知道了",
153
153
  sharedTitle: "分享的 Agent",