@songsid/agend 2.4.0-alpha.2 → 2.4.0-alpha.4

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 (654) hide show
  1. package/dist/account-isolation.d.ts +6 -0
  2. package/dist/account-isolation.js +40 -0
  3. package/dist/account-isolation.js.map +1 -0
  4. package/dist/accounts-signout.d.ts +15 -2
  5. package/dist/accounts-signout.js +52 -4
  6. package/dist/accounts-signout.js.map +1 -1
  7. package/dist/accounts-view.d.ts +114 -27
  8. package/dist/accounts-view.js +123 -60
  9. package/dist/accounts-view.js.map +1 -1
  10. package/dist/agent-cli-instructions.md +15 -9
  11. package/dist/agent-cli.js +47 -20
  12. package/dist/agent-cli.js.map +1 -1
  13. package/dist/agent-endpoint.js +23 -8
  14. package/dist/agent-endpoint.js.map +1 -1
  15. package/dist/agent-list-output.d.ts +23 -0
  16. package/dist/agent-list-output.js +53 -0
  17. package/dist/agent-list-output.js.map +1 -0
  18. package/dist/agent-runtime-change.js +4 -4
  19. package/dist/agent-runtime-change.js.map +1 -1
  20. package/dist/agent-whats-new.js +9 -7
  21. package/dist/agent-whats-new.js.map +1 -1
  22. package/dist/antigravity-first-run.d.ts +4 -0
  23. package/dist/antigravity-first-run.js +57 -0
  24. package/dist/antigravity-first-run.js.map +1 -0
  25. package/dist/antigravity-identity.d.ts +6 -0
  26. package/dist/antigravity-identity.js +27 -0
  27. package/dist/antigravity-identity.js.map +1 -0
  28. package/dist/antigravity-store.d.ts +22 -0
  29. package/dist/antigravity-store.js +79 -0
  30. package/dist/antigravity-store.js.map +1 -0
  31. package/dist/auth-api.js +11 -1
  32. package/dist/auth-api.js.map +1 -1
  33. package/dist/backend/agy-onboarding.d.ts +14 -0
  34. package/dist/backend/agy-onboarding.js +114 -0
  35. package/dist/backend/agy-onboarding.js.map +1 -0
  36. package/dist/backend/antigravity.d.ts +15 -0
  37. package/dist/backend/antigravity.js +44 -4
  38. package/dist/backend/antigravity.js.map +1 -1
  39. package/dist/backend/claude-code.d.ts +8 -0
  40. package/dist/backend/claude-code.js +11 -4
  41. package/dist/backend/claude-code.js.map +1 -1
  42. package/dist/backend/codex.js +7 -3
  43. package/dist/backend/codex.js.map +1 -1
  44. package/dist/backend/credential-profile.d.ts +22 -3
  45. package/dist/backend/credential-profile.js +61 -9
  46. package/dist/backend/credential-profile.js.map +1 -1
  47. package/dist/backend/grok.d.ts +19 -0
  48. package/dist/backend/grok.js +112 -1
  49. package/dist/backend/grok.js.map +1 -1
  50. package/dist/backend/types.d.ts +10 -0
  51. package/dist/backend/types.js.map +1 -1
  52. package/dist/backend-availability.d.ts +6 -0
  53. package/dist/backend-availability.js +11 -0
  54. package/dist/backend-availability.js.map +1 -1
  55. package/dist/browser-backend-signins.d.ts +9 -1
  56. package/dist/browser-backend-signins.js +9 -5
  57. package/dist/browser-backend-signins.js.map +1 -1
  58. package/dist/build-provenance.json +1 -1
  59. package/dist/channel/mcp-tools.js +10 -10
  60. package/dist/channel/mcp-tools.js.map +1 -1
  61. package/dist/child-process.d.ts +1 -0
  62. package/dist/child-process.js.map +1 -1
  63. package/dist/claude-auth-status.d.ts +1 -0
  64. package/dist/claude-auth-status.js +25 -0
  65. package/dist/claude-auth-status.js.map +1 -1
  66. package/dist/claude-model-observation.d.ts +71 -0
  67. package/dist/claude-model-observation.js +169 -0
  68. package/dist/claude-model-observation.js.map +1 -0
  69. package/dist/cli-capability.d.ts +104 -19
  70. package/dist/cli-capability.js +3 -1
  71. package/dist/cli-capability.js.map +1 -1
  72. package/dist/cli-caps-module.d.ts +14 -0
  73. package/dist/cli-caps-module.js +8 -1
  74. package/dist/cli-caps-module.js.map +1 -1
  75. package/dist/cli-registry-check.js +114 -18
  76. package/dist/cli-registry-check.js.map +1 -1
  77. package/dist/cli-registry.d.ts +116 -12
  78. package/dist/cli-registry.js +16 -1
  79. package/dist/cli-registry.js.map +1 -1
  80. package/dist/cli-spec-antigravity.d.ts +53 -11
  81. package/dist/cli-spec-antigravity.js +44 -13
  82. package/dist/cli-spec-antigravity.js.map +1 -1
  83. package/dist/cli-spec-claude-code.d.ts +14 -1
  84. package/dist/cli-spec-claude-code.js +5 -4
  85. package/dist/cli-spec-claude-code.js.map +1 -1
  86. package/dist/cli-spec-codex.d.ts +8 -0
  87. package/dist/cli-spec-codex.js +4 -3
  88. package/dist/cli-spec-codex.js.map +1 -1
  89. package/dist/cli-spec-grok.d.ts +4 -0
  90. package/dist/cli-spec-grok.js +2 -1
  91. package/dist/cli-spec-grok.js.map +1 -1
  92. package/dist/cli-spec-kiro-cli.d.ts +7 -0
  93. package/dist/cli-spec-kiro-cli.js +3 -2
  94. package/dist/cli-spec-kiro-cli.js.map +1 -1
  95. package/dist/cli-spec-muse.d.ts +4 -0
  96. package/dist/cli-spec-muse.js +2 -1
  97. package/dist/cli-spec-muse.js.map +1 -1
  98. package/dist/cli-spec-opencode.d.ts +1 -0
  99. package/dist/cli-spec-opencode.js +1 -0
  100. package/dist/cli-spec-opencode.js.map +1 -1
  101. package/dist/credential-store-proof.d.ts +6 -0
  102. package/dist/credential-store-proof.js +30 -0
  103. package/dist/credential-store-proof.js.map +1 -0
  104. package/dist/cross-instance-envelope.d.ts +4 -1
  105. package/dist/cross-instance-envelope.js +12 -7
  106. package/dist/cross-instance-envelope.js.map +1 -1
  107. package/dist/daemon.d.ts +24 -2
  108. package/dist/daemon.js +265 -37
  109. package/dist/daemon.js.map +1 -1
  110. package/dist/decision-list.d.ts +5 -4
  111. package/dist/decision-list.js +22 -8
  112. package/dist/decision-list.js.map +1 -1
  113. package/dist/delivery-consumed-watch.d.ts +24 -0
  114. package/dist/delivery-consumed-watch.js +21 -10
  115. package/dist/delivery-consumed-watch.js.map +1 -1
  116. package/dist/delivery-outbox.d.ts +5 -1
  117. package/dist/delivery-outbox.js +5 -0
  118. package/dist/delivery-outbox.js.map +1 -1
  119. package/dist/fleet-manager.d.ts +31 -2
  120. package/dist/fleet-manager.js +238 -56
  121. package/dist/fleet-manager.js.map +1 -1
  122. package/dist/fleet-windows-runtime.js +6 -6
  123. package/dist/fleet-windows-runtime.js.map +1 -1
  124. package/dist/general-knowledge/skills/concepts/SKILL.md +48 -7
  125. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -6
  126. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +18 -8
  127. package/dist/general-knowledge/skills/fleet-health/SKILL.md +16 -0
  128. package/dist/general-knowledge/skills/hub/SKILL.md +518 -0
  129. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -1
  130. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -1
  131. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +199 -40
  132. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +5 -1
  133. package/dist/general-role.d.ts +1 -1
  134. package/dist/general-role.js +1 -0
  135. package/dist/general-role.js.map +1 -1
  136. package/dist/grok-delivery-proof.d.ts +24 -0
  137. package/dist/grok-delivery-proof.js +124 -0
  138. package/dist/grok-delivery-proof.js.map +1 -0
  139. package/dist/hub/assistant/admin-types.d.ts +43 -0
  140. package/dist/hub/assistant/admin-types.js +2 -0
  141. package/dist/hub/assistant/admin-types.js.map +1 -0
  142. package/dist/hub/assistant/claude-host.d.ts +17 -0
  143. package/dist/hub/assistant/claude-host.js +300 -0
  144. package/dist/hub/assistant/claude-host.js.map +1 -0
  145. package/dist/hub/assistant/context.d.ts +3 -0
  146. package/dist/hub/assistant/context.js +7 -0
  147. package/dist/hub/assistant/context.js.map +1 -0
  148. package/dist/hub/assistant/fleet-host.d.ts +19 -0
  149. package/dist/hub/assistant/fleet-host.js +28 -0
  150. package/dist/hub/assistant/fleet-host.js.map +1 -0
  151. package/dist/hub/assistant/runner.d.ts +64 -0
  152. package/dist/hub/assistant/runner.js +239 -0
  153. package/dist/hub/assistant/runner.js.map +1 -0
  154. package/dist/hub/assistant/service.d.ts +51 -0
  155. package/dist/hub/assistant/service.js +143 -0
  156. package/dist/hub/assistant/service.js.map +1 -0
  157. package/dist/hub/assistant/store.d.ts +3 -0
  158. package/dist/hub/assistant/store.js +65 -0
  159. package/dist/hub/assistant/store.js.map +1 -0
  160. package/dist/hub/assistant/types.d.ts +60 -0
  161. package/dist/hub/assistant/types.js +2 -0
  162. package/dist/hub/assistant/types.js.map +1 -0
  163. package/dist/hub/buttons.d.ts +3 -0
  164. package/dist/hub/buttons.js +11 -11
  165. package/dist/hub/buttons.js.map +1 -1
  166. package/dist/hub/catalog.d.ts +13 -6
  167. package/dist/hub/catalog.js +127 -35
  168. package/dist/hub/catalog.js.map +1 -1
  169. package/dist/hub/client.d.ts +16 -0
  170. package/dist/hub/client.js +52 -9
  171. package/dist/hub/client.js.map +1 -1
  172. package/dist/hub/compose/member.d.ts +8 -1
  173. package/dist/hub/compose/member.js +238 -57
  174. package/dist/hub/compose/member.js.map +1 -1
  175. package/dist/hub/compose/server.d.ts +17 -1
  176. package/dist/hub/compose/server.js +76 -13
  177. package/dist/hub/compose/server.js.map +1 -1
  178. package/dist/hub/directory/admission.d.ts +15 -0
  179. package/dist/hub/directory/admission.js +56 -0
  180. package/dist/hub/directory/admission.js.map +1 -0
  181. package/dist/hub/directory/directory.d.ts +1 -1
  182. package/dist/hub/directory/directory.js +114 -0
  183. package/dist/hub/directory/directory.js.map +1 -1
  184. package/dist/hub/directory/types.d.ts +27 -0
  185. package/dist/hub/directory/types.js.map +1 -1
  186. package/dist/hub/enrolment-code.d.ts +1 -1
  187. package/dist/hub/enrolment-code.js +4 -4
  188. package/dist/hub/enrolment-code.js.map +1 -1
  189. package/dist/hub/grant-access.d.ts +11 -0
  190. package/dist/hub/grant-access.js +113 -0
  191. package/dist/hub/grant-access.js.map +1 -0
  192. package/dist/hub/grant-search.d.ts +9 -0
  193. package/dist/hub/grant-search.js +92 -0
  194. package/dist/hub/grant-search.js.map +1 -0
  195. package/dist/hub/group-policy/admin-control.d.ts +1 -0
  196. package/dist/hub/group-policy/admin-control.js +4 -2
  197. package/dist/hub/group-policy/admin-control.js.map +1 -1
  198. package/dist/hub/group-policy/admin-facts.d.ts +1 -0
  199. package/dist/hub/group-policy/admin-facts.js +2 -1
  200. package/dist/hub/group-policy/admin-facts.js.map +1 -1
  201. package/dist/hub/group-policy/admin-impact.d.ts +2 -0
  202. package/dist/hub/group-policy/admin-impact.js +10 -2
  203. package/dist/hub/group-policy/admin-impact.js.map +1 -1
  204. package/dist/hub/group-policy/admin-inventory.js +1 -1
  205. package/dist/hub/group-policy/admin-inventory.js.map +1 -1
  206. package/dist/hub/group-policy/admin-read.d.ts +1 -0
  207. package/dist/hub/group-policy/admin-read.js +3 -2
  208. package/dist/hub/group-policy/admin-read.js.map +1 -1
  209. package/dist/hub/group-policy/authorization.d.ts +5 -2
  210. package/dist/hub/group-policy/authorization.js +73 -32
  211. package/dist/hub/group-policy/authorization.js.map +1 -1
  212. package/dist/hub/group-policy/errors.d.ts +9 -0
  213. package/dist/hub/group-policy/errors.js +13 -0
  214. package/dist/hub/group-policy/errors.js.map +1 -0
  215. package/dist/hub/group-policy/impact-inventory.js +20 -4
  216. package/dist/hub/group-policy/impact-inventory.js.map +1 -1
  217. package/dist/hub/group-policy/resources.d.ts +4 -5
  218. package/dist/hub/group-policy/resources.js +26 -19
  219. package/dist/hub/group-policy/resources.js.map +1 -1
  220. package/dist/hub/group-policy/store.d.ts +21 -12
  221. package/dist/hub/group-policy/store.js +99 -109
  222. package/dist/hub/group-policy/store.js.map +1 -1
  223. package/dist/hub/group-policy/welcome.js.map +1 -1
  224. package/dist/hub/http/compose.d.ts +1 -0
  225. package/dist/hub/http/compose.js +463 -20
  226. package/dist/hub/http/compose.js.map +1 -1
  227. package/dist/hub/http/core.d.ts +24 -5
  228. package/dist/hub/http/core.js +181 -54
  229. package/dist/hub/http/core.js.map +1 -1
  230. package/dist/hub/http/deps.d.ts +26 -0
  231. package/dist/hub/http/schema.js +19 -0
  232. package/dist/hub/http/schema.js.map +1 -1
  233. package/dist/hub/init/member-certificate.d.ts +1 -0
  234. package/dist/hub/init/member-certificate.js +39 -0
  235. package/dist/hub/init/member-certificate.js.map +1 -0
  236. package/dist/hub/init/plan-digest.js +1 -0
  237. package/dist/hub/init/plan-digest.js.map +1 -1
  238. package/dist/hub/invitations.d.ts +96 -0
  239. package/dist/hub/invitations.js +292 -0
  240. package/dist/hub/invitations.js.map +1 -0
  241. package/dist/hub/join/certificate-trust.d.ts +13 -0
  242. package/dist/hub/join/certificate-trust.js +41 -0
  243. package/dist/hub/join/certificate-trust.js.map +1 -0
  244. package/dist/hub/join/certificate.d.ts +11 -0
  245. package/dist/hub/join/certificate.js +67 -0
  246. package/dist/hub/join/certificate.js.map +1 -0
  247. package/dist/hub/join/client.d.ts +5 -0
  248. package/dist/hub/join/client.js +30 -3
  249. package/dist/hub/join/client.js.map +1 -1
  250. package/dist/hub/join/http.js +5 -3
  251. package/dist/hub/join/http.js.map +1 -1
  252. package/dist/hub/join/local.d.ts +37 -1
  253. package/dist/hub/join/local.js +142 -14
  254. package/dist/hub/join/local.js.map +1 -1
  255. package/dist/hub/join/service.d.ts +19 -0
  256. package/dist/hub/join/service.js +46 -35
  257. package/dist/hub/join/service.js.map +1 -1
  258. package/dist/hub/join/trust.d.ts +9 -0
  259. package/dist/hub/join/trust.js +35 -0
  260. package/dist/hub/join/trust.js.map +1 -1
  261. package/dist/hub/member/pairing-api.js +12 -1
  262. package/dist/hub/member/pairing-api.js.map +1 -1
  263. package/dist/hub/member/room-ask.d.ts +137 -0
  264. package/dist/hub/member/room-ask.js +358 -0
  265. package/dist/hub/member/room-ask.js.map +1 -0
  266. package/dist/hub/member-journal.d.ts +18 -1
  267. package/dist/hub/member-journal.js +76 -3
  268. package/dist/hub/member-journal.js.map +1 -1
  269. package/dist/hub/member-origin.d.ts +177 -0
  270. package/dist/hub/member-origin.js +314 -0
  271. package/dist/hub/member-origin.js.map +1 -0
  272. package/dist/hub/pairing-notices.d.ts +1 -0
  273. package/dist/hub/pairing-notices.js +2 -1
  274. package/dist/hub/pairing-notices.js.map +1 -1
  275. package/dist/hub/pairing.d.ts +11 -0
  276. package/dist/hub/pairing.js +69 -21
  277. package/dist/hub/pairing.js.map +1 -1
  278. package/dist/hub/policy.d.ts +1 -1
  279. package/dist/hub/policy.js +19 -6
  280. package/dist/hub/policy.js.map +1 -1
  281. package/dist/hub/protocol.d.ts +172 -0
  282. package/dist/hub/protocol.js +25 -2
  283. package/dist/hub/protocol.js.map +1 -1
  284. package/dist/hub/quota.d.ts +2 -1
  285. package/dist/hub/quota.js +2 -2
  286. package/dist/hub/quota.js.map +1 -1
  287. package/dist/hub/roles/authority.d.ts +45 -0
  288. package/dist/hub/roles/authority.js +199 -0
  289. package/dist/hub/roles/authority.js.map +1 -0
  290. package/dist/hub/roles/change.d.ts +18 -0
  291. package/dist/hub/roles/change.js +76 -0
  292. package/dist/hub/roles/change.js.map +1 -0
  293. package/dist/hub/roles/clock.d.ts +18 -0
  294. package/dist/hub/roles/clock.js +58 -0
  295. package/dist/hub/roles/clock.js.map +1 -0
  296. package/dist/hub/roles/convert.d.ts +11 -0
  297. package/dist/hub/roles/convert.js +27 -0
  298. package/dist/hub/roles/convert.js.map +1 -0
  299. package/dist/hub/roles/cutover-inventory.d.ts +14 -0
  300. package/dist/hub/roles/cutover-inventory.js +42 -0
  301. package/dist/hub/roles/cutover-inventory.js.map +1 -0
  302. package/dist/hub/roles/cutover-marker.d.ts +57 -0
  303. package/dist/hub/roles/cutover-marker.js +26 -0
  304. package/dist/hub/roles/cutover-marker.js.map +1 -0
  305. package/dist/hub/roles/cutover.d.ts +32 -0
  306. package/dist/hub/roles/cutover.js +170 -0
  307. package/dist/hub/roles/cutover.js.map +1 -0
  308. package/dist/hub/roles/delegation.d.ts +24 -0
  309. package/dist/hub/roles/delegation.js +111 -0
  310. package/dist/hub/roles/delegation.js.map +1 -0
  311. package/dist/hub/roles/evaluate.d.ts +50 -0
  312. package/dist/hub/roles/evaluate.js +96 -0
  313. package/dist/hub/roles/evaluate.js.map +1 -0
  314. package/dist/hub/roles/expiry.d.ts +46 -0
  315. package/dist/hub/roles/expiry.js +180 -0
  316. package/dist/hub/roles/expiry.js.map +1 -0
  317. package/dist/hub/roles/mode-effects.d.ts +5 -0
  318. package/dist/hub/roles/mode-effects.js +21 -0
  319. package/dist/hub/roles/mode-effects.js.map +1 -0
  320. package/dist/hub/roles/model.d.ts +171 -0
  321. package/dist/hub/roles/model.js +79 -0
  322. package/dist/hub/roles/model.js.map +1 -0
  323. package/dist/hub/roles/read.d.ts +33 -0
  324. package/dist/hub/roles/read.js +55 -0
  325. package/dist/hub/roles/read.js.map +1 -0
  326. package/dist/hub/roles/writer.d.ts +80 -0
  327. package/dist/hub/roles/writer.js +427 -0
  328. package/dist/hub/roles/writer.js.map +1 -0
  329. package/dist/hub/rooms/admin.d.ts +45 -0
  330. package/dist/hub/rooms/admin.js +105 -0
  331. package/dist/hub/rooms/admin.js.map +1 -0
  332. package/dist/hub/rooms/agents.d.ts +74 -0
  333. package/dist/hub/rooms/agents.js +333 -0
  334. package/dist/hub/rooms/agents.js.map +1 -0
  335. package/dist/hub/rooms/assistant.d.ts +44 -0
  336. package/dist/hub/rooms/assistant.js +179 -0
  337. package/dist/hub/rooms/assistant.js.map +1 -0
  338. package/dist/hub/rooms/context.d.ts +10 -0
  339. package/dist/hub/rooms/context.js +24 -0
  340. package/dist/hub/rooms/context.js.map +1 -0
  341. package/dist/hub/rooms/direct-view.d.ts +39 -0
  342. package/dist/hub/rooms/direct-view.js +38 -0
  343. package/dist/hub/rooms/direct-view.js.map +1 -0
  344. package/dist/hub/rooms/directory.d.ts +35 -0
  345. package/dist/hub/rooms/directory.js +98 -0
  346. package/dist/hub/rooms/directory.js.map +1 -0
  347. package/dist/hub/rooms/schema.d.ts +11 -0
  348. package/dist/hub/rooms/schema.js +73 -0
  349. package/dist/hub/rooms/schema.js.map +1 -0
  350. package/dist/hub/rooms/service.d.ts +449 -0
  351. package/dist/hub/rooms/service.js +581 -0
  352. package/dist/hub/rooms/service.js.map +1 -0
  353. package/dist/hub/rooms/types.d.ts +79 -0
  354. package/dist/hub/rooms/types.js +2 -0
  355. package/dist/hub/rooms/types.js.map +1 -0
  356. package/dist/hub/rooms.d.ts +15 -1
  357. package/dist/hub/rooms.js +76 -31
  358. package/dist/hub/rooms.js.map +1 -1
  359. package/dist/hub/runtime.d.ts +8 -0
  360. package/dist/hub/runtime.js +57 -3
  361. package/dist/hub/runtime.js.map +1 -1
  362. package/dist/hub/server.d.ts +28 -0
  363. package/dist/hub/server.js +66 -6
  364. package/dist/hub/server.js.map +1 -1
  365. package/dist/hub/sessions.js +6 -2
  366. package/dist/hub/sessions.js.map +1 -1
  367. package/dist/hub/settings-commit.d.ts +6 -1
  368. package/dist/hub/settings-commit.js +15 -0
  369. package/dist/hub/settings-commit.js.map +1 -1
  370. package/dist/hub/settings-directory-decision.d.ts +2 -2
  371. package/dist/hub/settings-directory-decision.js +7 -5
  372. package/dist/hub/settings-directory-decision.js.map +1 -1
  373. package/dist/hub/settings-directory-proof.js +3 -1
  374. package/dist/hub/settings-directory-proof.js.map +1 -1
  375. package/dist/hub/settings-directory-recovery.d.ts +5 -0
  376. package/dist/hub/settings-directory-recovery.js +14 -4
  377. package/dist/hub/settings-directory-recovery.js.map +1 -1
  378. package/dist/hub/settings-member-address-control.d.ts +84 -0
  379. package/dist/hub/settings-member-address-control.js +150 -0
  380. package/dist/hub/settings-member-address-control.js.map +1 -0
  381. package/dist/hub/settings-member-address-decision.d.ts +229 -0
  382. package/dist/hub/settings-member-address-decision.js +318 -0
  383. package/dist/hub/settings-member-address-decision.js.map +1 -0
  384. package/dist/hub/settings-member-address-http.d.ts +9 -0
  385. package/dist/hub/settings-member-address-http.js +78 -0
  386. package/dist/hub/settings-member-address-http.js.map +1 -0
  387. package/dist/hub/settings-member-address-network.d.ts +2 -0
  388. package/dist/hub/settings-member-address-network.js +22 -0
  389. package/dist/hub/settings-member-address-network.js.map +1 -0
  390. package/dist/hub/settings-member-address-notices.d.ts +22 -0
  391. package/dist/hub/settings-member-address-notices.js +21 -0
  392. package/dist/hub/settings-member-address-notices.js.map +1 -0
  393. package/dist/hub/settings-member-address-policy.d.ts +21 -0
  394. package/dist/hub/settings-member-address-policy.js +34 -0
  395. package/dist/hub/settings-member-address-policy.js.map +1 -0
  396. package/dist/hub/settings-member-address.d.ts +64 -0
  397. package/dist/hub/settings-member-address.js +239 -0
  398. package/dist/hub/settings-member-address.js.map +1 -0
  399. package/dist/hub/sharing.d.ts +10 -0
  400. package/dist/hub/sharing.js +74 -0
  401. package/dist/hub/sharing.js.map +1 -0
  402. package/dist/hub/socket.d.ts +2 -0
  403. package/dist/hub/socket.js +2 -0
  404. package/dist/hub/socket.js.map +1 -1
  405. package/dist/hub/store.js +6 -2
  406. package/dist/hub/store.js.map +1 -1
  407. package/dist/hub/teams/types.d.ts +41 -0
  408. package/dist/hub/teams/types.js +2 -0
  409. package/dist/hub/teams/types.js.map +1 -0
  410. package/dist/hub/tls.d.ts +47 -0
  411. package/dist/hub/tls.js +23 -6
  412. package/dist/hub/tls.js.map +1 -1
  413. package/dist/hub/types.d.ts +68 -4
  414. package/dist/hub/validation.d.ts +1 -1
  415. package/dist/hub/validation.js +2 -2
  416. package/dist/hub/validation.js.map +1 -1
  417. package/dist/hub/web-origin.d.ts +93 -0
  418. package/dist/hub/web-origin.js +174 -0
  419. package/dist/hub/web-origin.js.map +1 -0
  420. package/dist/hub-pilot-trust-settings.d.ts +4 -0
  421. package/dist/hub-pilot-trust-settings.js +13 -0
  422. package/dist/hub-pilot-trust-settings.js.map +1 -0
  423. package/dist/human-delivery-receipts.d.ts +4 -2
  424. package/dist/human-delivery-receipts.js +20 -13
  425. package/dist/human-delivery-receipts.js.map +1 -1
  426. package/dist/inbound-presentation.d.ts +28 -0
  427. package/dist/inbound-presentation.js +48 -0
  428. package/dist/inbound-presentation.js.map +1 -0
  429. package/dist/instance-lifecycle.d.ts +13 -1
  430. package/dist/instance-lifecycle.js +33 -10
  431. package/dist/instance-lifecycle.js.map +1 -1
  432. package/dist/instructions.d.ts +10 -2
  433. package/dist/instructions.js +32 -7
  434. package/dist/instructions.js.map +1 -1
  435. package/dist/locale.js +20 -6
  436. package/dist/locale.js.map +1 -1
  437. package/dist/log-service.d.ts +3 -0
  438. package/dist/log-service.js +39 -22
  439. package/dist/log-service.js.map +1 -1
  440. package/dist/log-steps.d.ts +56 -1
  441. package/dist/log-steps.js +318 -56
  442. package/dist/log-steps.js.map +1 -1
  443. package/dist/login-flows.d.ts +24 -2
  444. package/dist/login-flows.js +53 -22
  445. package/dist/login-flows.js.map +1 -1
  446. package/dist/login-url.js +3 -0
  447. package/dist/login-url.js.map +1 -1
  448. package/dist/machine-accounts.d.ts +42 -12
  449. package/dist/machine-accounts.js +144 -46
  450. package/dist/machine-accounts.js.map +1 -1
  451. package/dist/machine-signins.d.ts +35 -13
  452. package/dist/machine-signins.js +57 -27
  453. package/dist/machine-signins.js.map +1 -1
  454. package/dist/native-instance-input.js +4 -4
  455. package/dist/native-instance-input.js.map +1 -1
  456. package/dist/native-instance-registry.d.ts +3 -3
  457. package/dist/native-instance-registry.js +11 -10
  458. package/dist/native-instance-registry.js.map +1 -1
  459. package/dist/needs-you-hub.js +6 -2
  460. package/dist/needs-you-hub.js.map +1 -1
  461. package/dist/needs-you.d.ts +5 -1
  462. package/dist/needs-you.js +4 -8
  463. package/dist/needs-you.js.map +1 -1
  464. package/dist/office-share-page.js +1 -1
  465. package/dist/office-share-page.js.map +1 -1
  466. package/dist/outbound-handlers.d.ts +1 -0
  467. package/dist/outbound-handlers.js +25 -19
  468. package/dist/outbound-handlers.js.map +1 -1
  469. package/dist/outbound-schemas.d.ts +19 -0
  470. package/dist/outbound-schemas.js +23 -4
  471. package/dist/outbound-schemas.js.map +1 -1
  472. package/dist/profile-signins.d.ts +5 -0
  473. package/dist/profile-signins.js +1 -0
  474. package/dist/profile-signins.js.map +1 -1
  475. package/dist/queued-handoffs.d.ts +3 -1
  476. package/dist/queued-handoffs.js +1 -1
  477. package/dist/queued-handoffs.js.map +1 -1
  478. package/dist/runtime-build-info.js +6 -2
  479. package/dist/runtime-build-info.js.map +1 -1
  480. package/dist/runtime-cli.js +33 -11
  481. package/dist/runtime-cli.js.map +1 -1
  482. package/dist/runtime-client.d.ts +18 -2
  483. package/dist/runtime-client.js +84 -21
  484. package/dist/runtime-client.js.map +1 -1
  485. package/dist/runtime-credential-profiles.d.ts +36 -4
  486. package/dist/runtime-credential-profiles.js +82 -16
  487. package/dist/runtime-credential-profiles.js.map +1 -1
  488. package/dist/runtime-profile-ownership.d.ts +2 -2
  489. package/dist/runtime-profile-ownership.js +3 -3
  490. package/dist/runtime-profile-ownership.js.map +1 -1
  491. package/dist/runtime-protocol.d.ts +5 -3
  492. package/dist/runtime-protocol.js +4 -0
  493. package/dist/runtime-protocol.js.map +1 -1
  494. package/dist/runtime-remote-accounts.d.ts +72 -5
  495. package/dist/runtime-remote-accounts.js +293 -52
  496. package/dist/runtime-remote-accounts.js.map +1 -1
  497. package/dist/runtime-remote-setup.d.ts +2 -2
  498. package/dist/runtime-remote-setup.js +2 -2
  499. package/dist/runtime-remote-setup.js.map +1 -1
  500. package/dist/runtime-signin-transport.d.ts +22 -4
  501. package/dist/runtime-signin-transport.js +50 -12
  502. package/dist/runtime-signin-transport.js.map +1 -1
  503. package/dist/runtime-signin.d.ts +42 -0
  504. package/dist/runtime-signin.js +105 -9
  505. package/dist/runtime-signin.js.map +1 -1
  506. package/dist/runtime-transcript-source.d.ts +2 -0
  507. package/dist/runtime-transcript-source.js +23 -1
  508. package/dist/runtime-transcript-source.js.map +1 -1
  509. package/dist/runtime-windows-bridge.js +6 -1
  510. package/dist/runtime-windows-bridge.js.map +1 -1
  511. package/dist/scheduler/task-board.d.ts +1 -0
  512. package/dist/scheduler/task-board.js +10 -1
  513. package/dist/scheduler/task-board.js.map +1 -1
  514. package/dist/settings-api.d.ts +1 -0
  515. package/dist/settings-api.js +15 -8
  516. package/dist/settings-api.js.map +1 -1
  517. package/dist/settings-baseline.d.ts +3 -0
  518. package/dist/settings-baseline.js +2 -2
  519. package/dist/settings-baseline.js.map +1 -1
  520. package/dist/settings-effect.d.ts +3 -0
  521. package/dist/settings-effect.js +12 -2
  522. package/dist/settings-effect.js.map +1 -1
  523. package/dist/signin-keepalive.d.ts +31 -2
  524. package/dist/signin-keepalive.js +123 -12
  525. package/dist/signin-keepalive.js.map +1 -1
  526. package/dist/structured-signin-transport.d.ts +2 -2
  527. package/dist/structured-signin-transport.js +27 -6
  528. package/dist/structured-signin-transport.js.map +1 -1
  529. package/dist/structured-signin.d.ts +16 -2
  530. package/dist/structured-signin.js +59 -4
  531. package/dist/structured-signin.js.map +1 -1
  532. package/dist/task-board-tool.d.ts +0 -13
  533. package/dist/task-board-tool.js +42 -6
  534. package/dist/task-board-tool.js.map +1 -1
  535. package/dist/tool-receipt-output.d.ts +151 -0
  536. package/dist/tool-receipt-output.js +50 -0
  537. package/dist/tool-receipt-output.js.map +1 -0
  538. package/dist/topic-commands.js +2 -1
  539. package/dist/topic-commands.js.map +1 -1
  540. package/dist/transcript-jsonl.d.ts +24 -0
  541. package/dist/transcript-jsonl.js +72 -22
  542. package/dist/transcript-jsonl.js.map +1 -1
  543. package/dist/transcript-monitor.d.ts +5 -1
  544. package/dist/transcript-monitor.js +65 -3
  545. package/dist/transcript-monitor.js.map +1 -1
  546. package/dist/transcript-needles.d.ts +1 -1
  547. package/dist/transcript-needles.js +1 -1
  548. package/dist/transcript-records.d.ts +2 -1
  549. package/dist/transcript-records.js.map +1 -1
  550. package/dist/transcript-sources.d.ts +4 -0
  551. package/dist/transcript-sources.js +2 -0
  552. package/dist/transcript-sources.js.map +1 -1
  553. package/dist/ui/accounts-keepalive.js +15 -6
  554. package/dist/ui/accounts-manage.js +25 -5
  555. package/dist/ui/accounts-view.js +28 -24
  556. package/dist/ui/agent-details-settings.js +10 -1
  557. package/dist/ui/agent-proposals.js +22 -2
  558. package/dist/ui/agent-runtime-settings.js +3 -3
  559. package/dist/ui/backend-signin.js +4 -4
  560. package/dist/ui/chat-activity.js +2 -2
  561. package/dist/ui/cli-caps.js +7 -7
  562. package/dist/ui/credential-profile-select.js +32 -19
  563. package/dist/ui/fleet-canvas.js +5 -2
  564. package/dist/ui/fleet-office-card.js +4 -2
  565. package/dist/ui/fleet-org.js +2 -0
  566. package/dist/ui/hub-admin-rooms-strings.js +28 -0
  567. package/dist/ui/hub-admin-rooms.js +77 -0
  568. package/dist/ui/hub-assistant-admin-strings.js +26 -0
  569. package/dist/ui/hub-assistant-admin.js +85 -0
  570. package/dist/ui/hub-chat-store.js +8 -4
  571. package/dist/ui/hub-client.js +224 -33
  572. package/dist/ui/hub-enrolment-code.js +1 -1
  573. package/dist/ui/hub-grant-picker.js +100 -0
  574. package/dist/ui/hub-group-search.js +2 -2
  575. package/dist/ui/hub-invitations-strings.js +30 -0
  576. package/dist/ui/hub-invitations.js +108 -0
  577. package/dist/ui/hub-join-one-strings.js +4 -2
  578. package/dist/ui/hub-join-steps.js +5 -2
  579. package/dist/ui/hub-pairing-form-strings.js +48 -0
  580. package/dist/ui/hub-pilot-trust-strings.js +27 -0
  581. package/dist/ui/hub-pilot-trust.js +41 -0
  582. package/dist/ui/hub-room-composer.js +113 -0
  583. package/dist/ui/hub-room-favorites.js +90 -0
  584. package/dist/ui/hub-room-list.js +152 -0
  585. package/dist/ui/hub-room-members-strings.js +12 -0
  586. package/dist/ui/hub-room-members.js +104 -0
  587. package/dist/ui/hub-room-new-strings.js +46 -0
  588. package/dist/ui/hub-room-new.js +135 -0
  589. package/dist/ui/hub-room-presence.js +123 -0
  590. package/dist/ui/hub-room-settings-strings.js +26 -0
  591. package/dist/ui/hub-room-settings.js +134 -0
  592. package/dist/ui/hub-room-strings.js +222 -0
  593. package/dist/ui/hub-room-thread.js +262 -0
  594. package/dist/ui/hub-room-unread.js +51 -0
  595. package/dist/ui/hub-room-working.js +29 -0
  596. package/dist/ui/log-row.js +14 -5
  597. package/dist/ui/machine-signin.js +47 -14
  598. package/dist/ui/panel-details.js +6 -1
  599. package/dist/ui/panel-fleet.js +2 -2
  600. package/dist/ui/panel-hub.js +145 -59
  601. package/dist/ui/panel-needs.js +2 -0
  602. package/dist/ui/panel-settings.js +2 -2
  603. package/dist/ui/settings-hub-company-join.js +32 -11
  604. package/dist/ui/settings-hub-connection.js +9 -3
  605. package/dist/ui/settings-hub-member-address.js +205 -0
  606. package/dist/ui/settings-hub-section.js +4 -0
  607. package/dist/ui/settings-hub-web-address.js +233 -0
  608. package/dist/ui/settings-hub.js +16 -4
  609. package/dist/ui/shared/accounts-keepalive.css +8 -0
  610. package/dist/ui/shared/accounts-usage-pool.css +10 -0
  611. package/dist/ui/shared/accounts.css +9 -0
  612. package/dist/ui/shared/app-i18n.js +2 -2
  613. package/dist/ui/shared/app-needs.js +3 -0
  614. package/dist/ui/shared/app-shell.js +4 -1
  615. package/dist/ui/shared/app.css +43 -5
  616. package/dist/ui/shared/chat-render.js +10 -0
  617. package/dist/ui/shared/chat-thread.js +14 -5
  618. package/dist/ui/shared/hub-chat.css +17 -0
  619. package/dist/ui/shared/hub-grant-picker.css +4 -0
  620. package/dist/ui/shared/hub-rooms-u2.css +42 -0
  621. package/dist/ui/shared/hub-sharing.css +4 -0
  622. package/dist/ui/shared/model-observation.js +16 -0
  623. package/dist/ui/shared/stale-tab.css +6 -0
  624. package/dist/ui/shared/stale-tab.js +50 -0
  625. package/dist/ui/shared/view-strings.js +2 -2
  626. package/dist/ui/structured-signin.js +19 -6
  627. package/dist/ui/usage-pool.js +76 -0
  628. package/dist/usage/agent-output.d.ts +144 -0
  629. package/dist/usage/agent-output.js +75 -0
  630. package/dist/usage/agent-output.js.map +1 -0
  631. package/dist/usage/provider-alerts.d.ts +6 -0
  632. package/dist/usage/provider-alerts.js +6 -0
  633. package/dist/usage/provider-alerts.js.map +1 -1
  634. package/dist/usage/providers.d.ts +2 -2
  635. package/dist/usage/providers.js +60 -18
  636. package/dist/usage/providers.js.map +1 -1
  637. package/dist/usage/usage-api.d.ts +12 -0
  638. package/dist/usage/usage-api.js +39 -0
  639. package/dist/usage/usage-api.js.map +1 -1
  640. package/dist/web-api.d.ts +4 -0
  641. package/dist/web-api.js +32 -13
  642. package/dist/web-api.js.map +1 -1
  643. package/dist/web-backend-login.d.ts +4 -1
  644. package/dist/web-backend-login.js.map +1 -1
  645. package/dist/windows-cli-providers.js +5 -1
  646. package/dist/windows-cli-providers.js.map +1 -1
  647. package/dist/windows-cli-worker.d.ts +33 -1
  648. package/dist/windows-cli-worker.js +150 -10
  649. package/dist/windows-cli-worker.js.map +1 -1
  650. package/dist/windows-cli.d.ts +7 -1
  651. package/dist/windows-cli.js +19 -2
  652. package/dist/windows-cli.js.map +1 -1
  653. package/dist/workflow-templates/default.md +2 -2
  654. package/package.json +1 -1
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Hub rooms (docs/design/hub-rooms-ux.md §§2–12): the rooms UI's own words, en and zh-TW.
3
+ * A module of its own (namespace hubRoom) so a tab holding an older hub-chat-strings.js still
4
+ * has every room word. Imports only app-i18n — nothing from the Fleet chat.
5
+ */
6
+ import { register, t } from "/assets/app-i18n.js";
7
+
8
+ register("hubRoom", {
9
+ en: {
10
+ // §1 vocabulary (on-screen terms)
11
+ chat: "Chat", room: "Room", members: "Members", roomManager: "Room manager",
12
+ roomAssistant: "Room assistant", hubAssistant: "Hub assistant",
13
+ mentionAll: "@All agents", invitation: "Invitation", replyLater: "Reply later", team: "Team",
14
+ // §2 layout
15
+ search: "Search", roomsGroup: "Rooms", agentsGroup: "Agents",
16
+ roomSub: "{0} people · {1} agents", providedByHub: "Provided by the Hub",
17
+ newChat: "+ New chat", newRoom: "+ New room",
18
+ noChats: "No chats yet",
19
+ noChatsHint: "Start with New chat; the list is the agents you may ask.",
20
+ noChatsHintRooms: "You can also start a room that holds people and agents together.",
21
+ // §3 thread
22
+ roomTitle: "{0} people · {1} agents · Room assistant",
23
+ roomSettings: "Room settings", leaveRoom: "Leave room", menu: "Menu",
24
+ authorAgent: "{0} · {1}'s agent", authorAssistant: "Room assistant · Provided by the Hub",
25
+ askProgress: "Answered {0} · working {1} · reply later {2}",
26
+ allAnswered: "All {0} answered", expandRest: "Show {0} more",
27
+ laterAnswer: "{0} ({1}) · answers after they come online", noAnswer: "No answer",
28
+ workingOne: "{0} is working on it", workingMany: "{0} agents are working",
29
+ // §4 composer
30
+ composer: "Speak in “{0}”; @ an agent to have it answer",
31
+ mentionAllHint: "{0} will all answer", mentionAssistant: "@Room assistant",
32
+ mentionAssistantHint: "Provided by the Hub",
33
+ allBar: "{0} agents, {1} online, {2} will answer after they come online",
34
+ composerHint: "Messages with no @agent are seen only by people in the room; agents will not answer.",
35
+ errAllMention: "Only a room manager can @All agents in this room.",
36
+ errNotMember: "You are no longer in this room.",
37
+ errArchived: "This room is archived; you can't send messages.",
38
+ errAssistant: "The room assistant cannot answer right now.",
39
+ notSentBecause: "Not sent: {0}",
40
+ sendNoConnection: "it did not reach AgEnD — check the connection", retrySend: "Retry send",
41
+ // §5 members rail
42
+ membersHead: "Members · {0} (online {1})", roleYou: "You", roleManager: "Manager",
43
+ agentsHead: "Agents · {0} (online {1})", moreN: "… {0} more",
44
+ whoSees: "Who can see this",
45
+ whoSeesRoom: "Everyone in the room sees every message and answer. An @agent reads the recent conversation.",
46
+ stOnline: "Online", stOffline: "Offline", stIdle: "Idle", stWorking: "Working", stPaused: "Paused",
47
+ pauseQuota: "Out of quota", pauseSignIn: "Waiting to sign in", pauseApproval: "Waiting for approval",
48
+ needsUpdate: "Needs an AgEnD update", stLater: "Answers when online",
49
+ stAssistantDown: "Cannot answer right now",
50
+ stStopped: "Stopped",
51
+ mentionHere: "@ it here", chatOneToOne: "Chat with it one-to-one", removeFromRoom: "Remove from room",
52
+ // §6 new room
53
+ newRoomTitle: "New room", name: "Name", namePlaceholder: "For example: Weekly leads meeting",
54
+ addPeople: "Add people, teams, or AD groups: type a name to search",
55
+ addAgents: "Add your own agents, or invite someone else's",
56
+ invitePending: "Invite · waiting for the owner",
57
+ inviteTeamAgents: "Invite every member's agents from this team",
58
+ addAssistant: "Add a room assistant (provided by the Hub)",
59
+ create: "Create", cancel: "Cancel",
60
+ createdSys: "{0} created this room.",
61
+ sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
62
+ invitedSys: "{0} agents invited; they join when the owner agrees.",
63
+ nameRequired: "Enter a room name.",
64
+ // §7 settings
65
+ basics: "Basics", membersCanAll: "Members can @All agents",
66
+ newMembersSee: "New members see", historyAfter: "Messages from after they join", historyAll: "The full history",
67
+ membersAndAgents: "Members and agents", makeManager: "Make room manager", makeMember: "Make member",
68
+ addMembers: "Add members", addOrInviteAgents: "Add or invite agents",
69
+ inviteRow: "{0} ({1}) · invited, waiting for the owner", cancelInvite: "Cancel invitation",
70
+ other: "Other", archiveRoom: "Archive room",
71
+ archiveAsk: "Archive “{0}”? The room becomes read-only; the content stays visible.",
72
+ archive: "Archive", lastManager: "Make someone else a room manager first.",
73
+ sysJoined: "{0} joined the room",
74
+ sysAgentJoined: "{0} ({1}'s agent) joined the room",
75
+ sysRenamed: "{0} renamed the room to “{1}”",
76
+ sysAssistantAdded: "The room assistant was added",
77
+ // §8 invitations
78
+ invitationsN: "Invitations · {0}",
79
+ inviteLead: "{0} invited your agent “{1}” to the room “{2}”",
80
+ inviteHint: "The {0} people in the room can @ it there; everyone in the room sees its answers.",
81
+ agree: "Agree", decline: "Decline",
82
+ inTheseRooms: "In these rooms", leaveThisRoom: "Leave this room", inviteExpired: "Invitation expired",
83
+ // §9 one-to-one
84
+ canAskUntil: "I can ask until {0}",
85
+ whoSeesDirect: "Only you see this chat. The agent's owner sees what you asked.",
86
+ // §10 room assistant
87
+ assistantIdleHub: "Idle · provided by the Hub",
88
+ askSummarise: "Ask the room assistant to summarise",
89
+ summarisePrompt: "@Room assistant summarise the answers above",
90
+ basedOnRecent: "Based on this room's recent conversation",
91
+ assistantBusyTry: "The room assistant cannot answer right now. Try again later.",
92
+ assistantBusyLater: "The room assistant is busy in another room; it will answer later.",
93
+ hubAssistantEmpty: "This is an AI assistant provided by the Hub. It cannot read your computer or other rooms.",
94
+ enableAssistant: "Enable the room assistant",
95
+ signedIn: "Signed in", needsSignIn: "Needs sign-in",
96
+ signInHow: "Sign in under AgEnD settings on this Hub computer.",
97
+ assistantQuota: "The room assistant uses this account's quota.",
98
+ aiAccount: "AI account", cap: "At most this many at once", idleMinutes: "Stop after this many idle minutes",
99
+ runningNow: "Now", stop: "Stop", lastUsed: "Last used",
100
+ usage: "Usage", usageLead: "Answers per day for the last 7 days",
101
+ quotaPlenty: "Plenty", quotaLow: "Running low", quotaGone: "Used up",
102
+ assistantNotEnabled: "The room assistant is not enabled yet.",
103
+ assistantEnableHint: "Sign in an AI account in AgEnD on this computer, then come back and turn it on.",
104
+ // §11 admin → rooms
105
+ whoCanCreate: "Who can start rooms", addPeopleOrTeams: "Add people or teams",
106
+ everyoneDirect: "Everyone can start a one-to-one chat.",
107
+ allRooms: "All rooms", active: "Active", archived: "Archived",
108
+ noContent: "Room content is not visible here.",
109
+ joinAsManager: "Join as a room manager",
110
+ // §12 unread: unreadN is the list-row count tooltip; mentionedYou is the row's @ mark.
111
+ unreadPrefix: "({0})", unreadN: "{0} unread", mentionMark: "@", mentionedYou: "Mentioned you",
112
+ // M-3092: a room's own line when an administrator joins; the prompts of a one-to-one chat (an agent's, the Hub assistant's).
113
+ sysAdminJoined: "{0} joined as a room manager", composerAssistant: "Ask the Hub assistant", composerDirect: "Ask {0}",
114
+ // M-3092 (Lumen's consent walk): an agent its owner shares, in rooms but asked by no one one-to-one; the Invitations page and row.
115
+ agentNoOneToOne: "No one may ask it one-to-one yet", inRoomsOne: "in 1 room", inRoomsMany: "in {0} rooms",
116
+ // A room's counts, singular and plural (Ridge's routing walk: never "1 people").
117
+ peopleOne: "1 person", peopleMany: "{0} people", agentsOne: "1 agent", agentsMany: "{0} agents",
118
+ // The @ progress line in parts, a part with 0 left out (Lumen): "Answered 1 · Working 1".
119
+ progAnswered: "Answered {0}", progWorking: "Working {0}", progLater: "Reply later {0}",
120
+ roomsCanAskIt: "People in its rooms can @ it there. See In these rooms.", invitationsTitle: "Invitations",
121
+ },
122
+ "zh-TW": {
123
+ chat: "對話", room: "房間", members: "成員", roomManager: "房間管理",
124
+ roomAssistant: "房間助理", hubAssistant: "Hub 助理",
125
+ mentionAll: "@所有 Agent", invitation: "邀請", replyLater: "稍後回覆", team: "團隊",
126
+ search: "搜尋", roomsGroup: "房間", agentsGroup: "Agent",
127
+ roomSub: "{0} 人 · {1} 個 Agent", providedByHub: "Hub 提供",
128
+ newChat: "+ 新對話", newRoom: "+ 新房間",
129
+ noChats: "還沒有對話",
130
+ noChatsHint: "用「新對話」開始;清單裡是允許你提問的 Agent。",
131
+ noChatsHintRooms: "也可以開一個房間,把人和 Agent 放在一起。",
132
+ roomTitle: "{0} 人 · {1} 個 Agent · 房間助理",
133
+ roomSettings: "房間設定", leaveRoom: "離開房間", menu: "選單",
134
+ authorAgent: "{0} · {1}的 Agent", authorAssistant: "房間助理 · Hub 提供",
135
+ askProgress: "已回答 {0} · 處理中 {1} · 稍後回覆 {2}",
136
+ allAnswered: "{0} 個都回答了", expandRest: "展開其餘 {0} 則",
137
+ laterAnswer: "{0}({1})· 上線後回答", noAnswer: "沒有回答",
138
+ workingOne: "{0} 正在處理", workingMany: "{0} 個 Agent 正在處理",
139
+ composer: "在「{0}」說話;@ 一個 Agent 請它回答",
140
+ mentionAllHint: "{0} 個都會回答", mentionAssistant: "@房間助理",
141
+ mentionAssistantHint: "Hub 提供",
142
+ allBar: "{0} 個 Agent 中 {1} 個在線上,{2} 個上線後回答",
143
+ composerHint: "沒有 @ 任何 Agent 的訊息只有房間裡的人看得到,Agent 不會回答。",
144
+ errAllMention: "這個房間只有房間管理可以 @所有 Agent。",
145
+ errNotMember: "你已經不在這個房間裡。",
146
+ errArchived: "這個房間已封存,不能再發言。",
147
+ errAssistant: "房間助理暫時無法回答。",
148
+ notSentBecause: "沒有送出:{0}",
149
+ sendNoConnection: "沒有送到 AgEnD,請檢查網路連線", retrySend: "重試傳送",
150
+ membersHead: "成員 · {0}(線上 {1})", roleYou: "你", roleManager: "管理",
151
+ agentsHead: "Agent · {0}(線上 {1})", moreN: "… 其餘 {0} 個",
152
+ whoSees: "誰看得到",
153
+ whoSeesRoom: "房間裡的每個人都看得到所有訊息與回答。Agent 被 @ 時會讀到最近的對話。",
154
+ stOnline: "線上", stOffline: "離線", stIdle: "待命", stWorking: "處理中", stPaused: "暫停",
155
+ pauseQuota: "額度用完", pauseSignIn: "等待登入", pauseApproval: "等待核准",
156
+ needsUpdate: "需要更新 AgEnD", stLater: "上線時回答",
157
+ stAssistantDown: "暫時無法回答",
158
+ stStopped: "已停止",
159
+ mentionHere: "在這裡 @ 它", chatOneToOne: "和它一對一對話", removeFromRoom: "從房間移除",
160
+ newRoomTitle: "新房間", name: "名稱", namePlaceholder: "例如:研一主管週會",
161
+ addPeople: "加入人、團隊或 AD 群組:輸入名稱搜尋",
162
+ addAgents: "加入自己的 Agent,或邀請別人的",
163
+ invitePending: "邀請 · 等擁有者同意",
164
+ inviteTeamAgents: "邀請這個團隊所有人的 Agent",
165
+ addAssistant: "加入房間助理(Hub 提供)",
166
+ create: "建立", cancel: "取消",
167
+ createdSys: "{0} 建立了這個房間。",
168
+ sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
169
+ invitedSys: "已邀請 {0} 個 Agent,擁有者同意後會加入。",
170
+ nameRequired: "請輸入房間名稱。",
171
+ basics: "基本", membersCanAll: "成員可以 @所有 Agent",
172
+ newMembersSee: "新成員看得到", historyAfter: "加入之後的訊息", historyAll: "全部的歷史訊息",
173
+ membersAndAgents: "成員與 Agent", makeManager: "設為房間管理", makeMember: "改為成員",
174
+ addMembers: "加入成員", addOrInviteAgents: "加入或邀請 Agent",
175
+ inviteRow: "{0}({1})· 已邀請,等擁有者同意", cancelInvite: "取消邀請",
176
+ other: "其他", archiveRoom: "封存房間",
177
+ archiveAsk: "要封存「{0}」嗎?房間會變成唯讀,內容仍然看得到。",
178
+ archive: "封存", lastManager: "請先把另一個人設為房間管理。",
179
+ sysJoined: "{0} 加入了房間",
180
+ sysAgentJoined: "{0}({1}的 Agent)加入了房間",
181
+ sysRenamed: "{0} 把房間改名為「{1}」",
182
+ sysAssistantAdded: "房間助理已加入",
183
+ invitationsN: "邀請 · {0}",
184
+ inviteLead: "{0} 邀請你的 Agent「{1}」加入房間「{2}」",
185
+ inviteHint: "房間裡的 {0} 個人可以在那裡 @ 它;它的回答房間裡的人都看得到。",
186
+ agree: "同意", decline: "不要",
187
+ inTheseRooms: "在這些房間裡", leaveThisRoom: "退出這個房間", inviteExpired: "邀請已過期",
188
+ canAskUntil: "我可以問到 {0}",
189
+ whoSeesDirect: "這個對話只有你看得到。Agent 的擁有者看得到你問了什麼。",
190
+ assistantIdleHub: "待命 · Hub 提供",
191
+ askSummarise: "請房間助理整理",
192
+ summarisePrompt: "@房間助理 整理上面的回答",
193
+ basedOnRecent: "根據這個房間最近的對話",
194
+ assistantBusyTry: "房間助理暫時無法回答,稍後再試。",
195
+ assistantBusyLater: "房間助理正在別的房間忙,稍後回答。",
196
+ hubAssistantEmpty: "這是 Hub 提供的 AI 助理。它讀不到你的電腦,也讀不到其他房間。",
197
+ enableAssistant: "啟用房間助理",
198
+ signedIn: "已登入", needsSignIn: "需要登入",
199
+ signInHow: "在 Hub 這台電腦的 AgEnD 設定裡登入。",
200
+ assistantQuota: "房間助理使用這個帳號的額度。",
201
+ aiAccount: "AI 帳號", cap: "同時最多幾個", idleMinutes: "閒置幾分鐘後停止",
202
+ runningNow: "現在", stop: "停止", lastUsed: "最後使用",
203
+ usage: "用量", usageLead: "近 7 天每天的回答次數",
204
+ quotaPlenty: "充足", quotaLow: "快用完", quotaGone: "用完",
205
+ assistantNotEnabled: "房間助理還沒有啟用。",
206
+ assistantEnableHint: "先在這台電腦的 AgEnD 登入一個 AI 帳號,再回來開啟。",
207
+ whoCanCreate: "誰可以開房間", addPeopleOrTeams: "加入人或團隊",
208
+ everyoneDirect: "每個人都可以開一對一對話。",
209
+ allRooms: "所有房間", active: "使用中", archived: "已封存",
210
+ noContent: "這裡看不到任何房間的內容。",
211
+ joinAsManager: "加入自己成為房間管理",
212
+ unreadPrefix: "({0})", unreadN: "{0} 則未讀", mentionMark: "@", mentionedYou: "有人 @ 你",
213
+ sysAdminJoined: "{0} 以房間管理的身分加入", composerAssistant: "問 Hub 助理", composerDirect: "問 {0}",
214
+ agentNoOneToOne: "還沒有人可以一對一提問", inRoomsOne: "在 1 個房間裡", inRoomsMany: "在 {0} 個房間裡",
215
+ peopleOne: "1 人", peopleMany: "{0} 人", agentsOne: "1 個 Agent", agentsMany: "{0} 個 Agent",
216
+ progAnswered: "已回答 {0}", progWorking: "處理中 {0}", progLater: "稍後回覆 {0}",
217
+ roomsCanAskIt: "房間裡的人可以在房間裡 @ 它,見「在這些房間裡」。", invitationsTitle: "邀請",
218
+ },
219
+ });
220
+
221
+ /** hubRoom.* words. */
222
+ export const hroom = (key, ...values) => t(`hubRoom.${key}`, ...values);
@@ -0,0 +1,262 @@
1
+ // 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
2
+ // through panel-hub.js's HubThread). docs/design/hub-rooms-ux.md §3 says only where a room differs from the Fleet chat:
3
+ // - every message says who wrote it — a person by name (mine: on the right, no name), an agent as 「name · owner 的 Agent」,
4
+ // the room assistant as 「房間助理 · Hub 提供」; the room's own lines (created, joined …) are the thread's status rows;
5
+ // - an answer is a reply to the message that asked for it (the thread's own quote, jumping to it);
6
+ // - under a message that asked several agents, one line of progress, live: 「已回答 7 · 處理中 2 · 稍後回覆 3」 → 「12 個
7
+ // 都回答了」; one agent: the Fleet's delivery marks on my own message; an answer still to come is not a row of its own.
8
+ // The store reads the room (seam 1 of docs/design/hub-rooms-split.md), keeps it live from the tab's one stream, sends with
9
+ // an idempotency key, and answers HubThread's store interface.
10
+ import { html, useEffect, useMemo, useRef, useState } from "/assets/app-html.js";
11
+ import { WorkBarView } from "/assets/chat-composer.js";
12
+ import { RailFrame } from "/assets/side-rail.js";
13
+ import { Icon } from "/assets/ui-icons.js";
14
+ import { Empty } from "/assets/ui-states.js";
15
+ import { Dialog } from "/assets/ui-dialog.js";
16
+ import { firstCharacter } from "/assets/instance-nav.js";
17
+ import { hroom } from "./hub-room-strings.js";
18
+ import { RoomComposer } from "./hub-room-composer.js";
19
+ import { workingLine } from "./hub-room-working.js";
20
+ import { countsLine } from "./hub-room-list.js";
21
+
22
+ const iso = (ms) => (Number.isFinite(ms) && ms > 0 ? new Date(ms).toISOString() : undefined);
23
+ const BOOT = "room";
24
+
25
+ /**
26
+ * One room message's author line (spec §3). `mine`: no name (the thread puts it on the right). The assistant is named by
27
+ * its flag, never by its stored name (Ridge: that is an older renderer's fallback): 「房間助理 · Hub 提供」 in a room,
28
+ * 「Hub 助理」 in its own one-to-one (`direct`).
29
+ */
30
+ export function authorLine(author, mine = false, direct = false) {
31
+ if (!author || mine) return "";
32
+ if (author.kind === "assistant") return direct ? hroom("hubAssistant") : hroom("authorAssistant");
33
+ if (author.kind === "agent") {
34
+ if (!author.owner?.name) return String(author.name || "");
35
+ // 「Alex 的 Agent」: a Latin owner name keeps a space before a CJK word that follows it (Lumen); 「林小華的 Agent」 none.
36
+ const owner = String(author.owner.name), plain = hroom("authorAgent", "\u0001", "\u0002");
37
+ return hroom("authorAgent", String(author.name || ""), /[A-Za-z0-9)]$/.test(owner) && /\u0002[\u3400-\u9fff]/.test(plain) ? `${owner} ` : owner);
38
+ }
39
+ return String(author.name || "");
40
+ }
41
+ /**
42
+ * A room's own line in this viewer's words (Ridge: `system` { kind, name } beside the stored text): a kind this page does
43
+ * not know, or an older row without `system`, keeps the stored text.
44
+ */
45
+ const SYSTEM = { "room-created": "createdSys", "member-joined": "sysJoined", "admin-joined": "sysAdminJoined" };
46
+ export function systemText(m) {
47
+ const key = m && m.system && SYSTEM[m.system.kind];
48
+ return key && typeof m.system.name === "string" ? hroom(key, m.system.name) : String((m && m.text) || "");
49
+ }
50
+ /**
51
+ * The progress of a message that asked agents (spec §3, Lumen): one agent → its delivery mark; several → one line, its
52
+ * parts without a 0 ("Answered 1 · Working 1"); every one answered → the delivered tick again, no line.
53
+ */
54
+ export function askState(ask) {
55
+ if (!ask || !Number.isSafeInteger(ask.total) || ask.total < 1) return null;
56
+ if (ask.total === 1 || ask.answered >= ask.total) return { delivery: ask.answered >= ask.total ? "delivered" : ask.working >= 1 ? "processing" : "queued" };
57
+ const parts = [[ask.answered, "progAnswered"], [ask.working, "progWorking"], [ask.later, "progLater"]].filter(([n]) => Number(n) > 0).map(([n, k]) => hroom(k, String(n)));
58
+ return { line: parts.join(" · ") };
59
+ }
60
+ /** How many answers of one question show when they are folded, and from how many they fold (Lumen: all up to 5). */
61
+ export const ANSWERS_SHOWN = 3, FOLD_FROM = 6;
62
+
63
+ /**
64
+ * Seam-1 messages (newest last) → the thread's messages. `ids`: a Map from a message id to its number in this thread
65
+ * (the thread's keys and quotes are numbers), extended here in arrival order and kept by the caller.
66
+ */
67
+ export function toThreadMessages(messages, { meId, ids, direct = false, expanded = new Set() }) {
68
+ const out = [], byId = new Map(messages.map((m) => [m.id, m]));
69
+ // Each question's answers that have text, in arrival order: past ANSWERS_SHOWN they wait behind one 「展開其餘 N 則」.
70
+ const answersOf = new Map();
71
+ const drawn = (m) => !!m.text || m.stage === "not-answered"; // an answer that shows: its text, or that none came (Ridge)
72
+ for (const m of messages) if (m && m.answerTo && drawn(m)) answersOf.set(m.answerTo, [...(answersOf.get(m.answerTo) || []), m.id]);
73
+ const num = (id) => { if (!ids.has(id)) ids.set(id, ids.size * 2 + 2); return ids.get(id); };
74
+ for (const m of messages) {
75
+ if (!m || typeof m.id !== "string") continue;
76
+ const author = m.author || {}, kind = author.kind;
77
+ // An answer still to come (queued, or being worked on: the working bar says who) is never an empty bubble.
78
+ if (m.answerTo && !m.text && (m.stage === "queued" || m.stage === "working")) continue;
79
+ // A question with FOLD_FROM answers or more shows its first ANSWERS_SHOWN; the rest wait behind one link right under the
80
+ // last one shown (until it is opened). Fewer than FOLD_FROM: every answer shows.
81
+ let foldAfter = null;
82
+ if (m.answerTo && !direct && !expanded.has(m.answerTo)) {
83
+ const list = answersOf.get(m.answerTo) || [], at = list.indexOf(m.id);
84
+ if (list.length >= FOLD_FROM) {
85
+ if (at >= ANSWERS_SHOWN) continue;
86
+ if (at === ANSWERS_SHOWN - 1) foldAfter = { label: hroom("expandRest", String(list.length - ANSWERS_SHOWN)), arg: m.answerTo };
87
+ }
88
+ }
89
+ const id = num(m.id), mine = kind === "person" && author.id === meId;
90
+ if (kind === "system") { out.push({ boot: BOOT, id, role: "status", sender: "", ts: iso(m.at), text: systemText(m), bare: true }); continue; }
91
+ // An answer is a reply to the message that asked for it (the Fleet's reply reference): replyTo, else answerTo.
92
+ const quoted = m.replyTo ? byId.get(m.replyTo) : m.answerTo ? byId.get(m.answerTo) : null;
93
+ const state = mine ? askState(m.ask) : null;
94
+ out.push({ boot: BOOT, id, role: kind === "person" ? "user" : "agent", sender: authorLine(author, mine, direct), ts: iso(m.at), text: String(m.text || ""), mine,
95
+ roomMessage: m.id, ...(state?.delivery ? { delivery: state.delivery } : {}),
96
+ ...(quoted ? { replyTo: { boot: BOOT, id: num(quoted.id), sender: authorLine(quoted.author, quoted.author?.id === meId, direct), text: String(quoted.text || "").slice(0, 120) } } : {}),
97
+ ...(m.stage === "not-answered" ? { text: hroom("noAnswer") } : {}) });
98
+ if (foldAfter) out.push({ boot: BOOT, id: num(`expand:${foldAfter.arg}`), role: "status", sender: "", text: "", bare: true, fold: true, action: foldAfter });
99
+ const line = askState(m.ask)?.line;
100
+ // Its status, not an event: under it, without a time of its own.
101
+ if (line) out.push({ boot: BOOT, id: id + 1, role: "status", sender: "", text: line, progressOf: m.id, bare: true });
102
+ if (mine && m.warning === "assistant-unavailable") out.push({ boot: BOOT, id: id + 1, role: "status", sender: "", ts: iso(m.at), text: hroom("errAssistant"), bare: true });
103
+ }
104
+ return out;
105
+ }
106
+
107
+ /**
108
+ * One room's store: `subscribe(fn)` → unsubscribe; `detail()` (the room GET: room, me, members, settings), `messages()`
109
+ * (the thread's), `raw()` (seam-1 messages), `loaded()`, `error()`, `closed()` (archived, or I am no longer in it), `room()`;
110
+ * `send(text, { mentions, replyTo })` → the client's answer (a refusal's code is the caller's to word; a soft warning is
111
+ * stored and drawn), `older()`, `markRead()`, `refresh()`, `stop()`. Reply buttons are not part of rooms: their calls are inert.
112
+ */
113
+ export function createRoomStore(roomId, { client, meId = "" } = {}) {
114
+ const subs = new Set(), ids = new Map(), expanded = new Set();
115
+ const st = { live: true, detail: null, messages: [], loaded: false, error: null, removed: false, more: false, view: [] };
116
+ // The room's committed order (Ridge: `sequence`, from the stored row): a waiting answer replaced in place, or an event that
117
+ // arrives out of order, is drawn where the room has it. Rows without it (a direct chat, an older Hub) keep arrival order.
118
+ const ordered = () => { if (st.messages.length && st.messages.every((m) => Number.isSafeInteger(m.sequence))) st.messages.sort((a, b) => a.sequence - b.sequence); };
119
+ const changed = () => { ordered(); st.view = toThreadMessages(st.messages, { meId: st.detail?.me?.id || meId, ids, direct: st.detail?.room?.kind === "direct", expanded }); for (const fn of [...subs]) { try { fn(); } catch { /* a subscriber's own failure */ } } };
120
+ const upsert = (m) => {
121
+ if (!m || m.roomId !== roomId || typeof m.id !== "string") return;
122
+ const i = st.messages.findIndex((x) => x.id === m.id || (m.idempotencyKey && x.idempotencyKey === m.idempotencyKey));
123
+ if (i >= 0) st.messages[i] = { ...st.messages[i], ...m }; else st.messages.push(m);
124
+ };
125
+ const readDetail = async () => { const d = await client.room(roomId); if (!st.live) return; if (d.ok) st.detail = d; else if (!st.detail) st.error = d.code || "failed"; };
126
+ async function refresh() {
127
+ const [d, page] = await Promise.all([client.room(roomId), client.roomMessages(roomId, { limit: 50 })]);
128
+ if (!st.live) return;
129
+ if (d.ok) st.detail = d; else st.error = d.code || "failed";
130
+ if (page.ok) { for (const m of page.messages || []) upsert(m); st.more = page.more === true; st.loaded = true; if (d.ok) st.error = null; }
131
+ else st.error = page.code || "failed";
132
+ changed();
133
+ }
134
+ const on = (fn) => (data) => { if (st.live && data && data.roomId === roomId) { fn(data); changed(); } };
135
+ const unsubscribe = typeof client.subscribeRooms === "function" ? client.subscribeRooms({
136
+ "message.added": on((d) => upsert(d.message)),
137
+ "message.updated": on((d) => { upsert(d.message); if (d.parent) { const p = st.messages.find((x) => x.id === d.parent.id); if (p) p.ask = d.parent.ask; } }),
138
+ // The member's live state as sent: presence, and its note and reason only while the event carries them (a reason
139
+ // alone updates it; an event without one clears it — never a stale reason).
140
+ "presence.changed": on((d) => { const m = st.detail?.members?.find((x) => x.id === d.memberId); if (m) { m.presence = d.presence;
141
+ for (const k of ["presenceNote", "presenceReason"]) { if (d[k]) m[k] = d[k]; else delete m[k]; } } }),
142
+ "member.changed": on(() => { void readDetail().then(changed); }),
143
+ "room.changed": on((d) => { if (d.removed) st.removed = true; else if (d.room && st.detail) st.detail = { ...st.detail, room: { ...st.detail.room, ...d.room } }; }),
144
+ }) : () => {};
145
+ void refresh();
146
+ return {
147
+ subscribe(fn) { subs.add(fn); return () => subs.delete(fn); },
148
+ detail: () => st.detail, raw: () => st.messages, messages: () => st.view, loaded: () => st.loaded, error: () => st.error,
149
+ closed: () => st.removed || st.detail?.room?.archived === true, removed: () => st.removed, more: () => st.more,
150
+ room: () => ({ ...(st.detail?.room || {}), ownerName: "" }),
151
+ async send(text, { mentions = [], replyTo } = {}) {
152
+ const idempotencyKey = (globalThis.crypto?.randomUUID?.() || `${Date.now()}-${Math.random()}`).replace(/[^A-Za-z0-9-]/g, "");
153
+ const r = await client.sendRoomMessage(roomId, { text, mentions, replyTo, idempotencyKey });
154
+ // The stored message, as the Hub answers it: `{ message }`, or the message itself (Ridge's server) — drawn at once,
155
+ // whether or not the stream is up yet (a first send after opening the room must not vanish).
156
+ const { ok, ...bare } = r || {};
157
+ const sent = r && r.message ? r.message : ok && typeof bare.id === "string" && typeof bare.roomId === "string" ? bare : null;
158
+ if (ok && sent) { upsert(sent); changed(); }
159
+ return r;
160
+ },
161
+ async older() {
162
+ const first = st.messages[0]; if (!first || !st.more) return;
163
+ const page = await client.roomMessages(roomId, { before: first.id, limit: 50 });
164
+ if (!st.live || !page.ok) return;
165
+ st.messages = [...(page.messages || []).filter((m) => !st.messages.some((x) => x.id === m.id)), ...st.messages]; st.more = page.more === true; changed();
166
+ },
167
+ /** 「展開其餘 N 則」: show every answer of that question. */
168
+ expand(messageId) { if (typeof messageId === "string" && !expanded.has(messageId)) { expanded.add(messageId); changed(); } },
169
+ /** Who is working on an answer in this room now (its answer row has no text yet): their names, in arrival order. */
170
+ working() { return this.workers().map((w) => w.name); },
171
+ /** The same, as members ({ kind, name }) — what workingLine() words (the room assistant by its own name). */
172
+ workers() { return st.messages.filter((m) => m.answerTo && !m.text && m.stage === "working" && m.author?.name).map((m) => ({ kind: m.author.kind === "assistant" ? "assistant" : "agent", name: String(m.author.name) })); },
173
+ markRead() { const last = st.messages.at(-1); return last ? client.markRoomRead(roomId, last.id) : Promise.resolve({ ok: true }); },
174
+ refresh, clickButton: async () => ({ ok: false, code: "stopped" }), vote: async () => ({ ok: false, code: "stopped" }), busy: () => false, mine: () => [],
175
+ stop() { st.live = false; subs.clear(); unsubscribe(); },
176
+ };
177
+ }
178
+
179
+ /**
180
+ * Wide enough for the side rail: the shared stylesheet hides `.u-rail` below 1200 px (app.css), so a narrower page shows
181
+ * the members panel in a sheet instead (spec §2: on a phone, a bottom drawer) — the Fleet's rail rule itself unchanged.
182
+ */
183
+ const RAIL_QUERY = "(min-width: 1200px)";
184
+ function useRailWide() {
185
+ const q = typeof matchMedia === "function" ? matchMedia(RAIL_QUERY) : null;
186
+ const [wide, setWide] = useState(() => !!q?.matches);
187
+ useEffect(() => { if (!q) return undefined; const on = () => setWide(!!q.matches); q.addEventListener?.("change", on); return () => q.removeEventListener?.("change", on); }, []);
188
+ return wide;
189
+ }
190
+ /** dev-claude2's members panel (hub-room-members.js), when this Hub serves it; otherwise the rail stays closed. */
191
+ function useMembersPanel() {
192
+ const [Panel, setPanel] = useState(null);
193
+ useEffect(() => { let live = true; import("./hub-room-members.js").then((m) => { if (live && typeof m.RoomMembersPanel === "function") setPanel(() => m.RoomMembersPanel); }, () => {}); return () => { live = false; }; }, []);
194
+ return Panel;
195
+ }
196
+
197
+ /**
198
+ * A room of a Hub with rooms (spec §3–§5): its header (a square avatar, its name, "3 人 · 12 個 Agent · 房間助理"), the
199
+ * Fleet chat's thread (panel-hub.js's HubThread, given as `Thread`: the thread wiring is one), the room's composer, and
200
+ * the members panel on the right. `client`: the Hub client; `me`: { id } from the session.
201
+ */
202
+ export function HubRoomPage({ roomId, listed = null, Thread, client, meId = "", rooms = [], openRoom = () => {} }) {
203
+ const store = useMemo(() => createRoomStore(roomId, { client, meId }), [roomId]);
204
+ useEffect(() => () => store.stop(), [store]);
205
+ const [, tick] = useState(0);
206
+ // The first read may land before this subscribes: read once more on subscribing.
207
+ useEffect(() => { const off = store.subscribe(() => tick((n) => n + 1)); tick((n) => n + 1); return off; }, [store]);
208
+ const [reply, setReply] = useState(null), [rail, setRail] = useState(true), [sheet, setSheet] = useState(false);
209
+ const wide = useRailWide();
210
+ const input = useRef(null), threadRef = useRef(null), insert = useRef(null);
211
+ const Panel = useMembersPanel();
212
+ // dev-claude2's room settings (hub-room-settings.js), opened from the header or the members panel.
213
+ const [settings, setSettings] = useState(null);
214
+ const openSettings = () => { import("./hub-room-settings.js").then((m) => { if (typeof m.RoomSettings === "function") setSettings(() => m.RoomSettings); }, () => {}); };
215
+ const detail = store.detail(), room = detail?.room || listed || {}, group = room.kind === "group";
216
+ // The Hub assistant's one-to-one is named by its flag, in this viewer's words (its stored name is a fallback).
217
+ const title = room.assistant ? hroom("hubAssistant") : String(room.name || "");
218
+ const hasAssistant = (detail?.members || []).some((m) => m.kind === "assistant");
219
+ // Read when shown: the latest message once loaded and again as messages arrive while the page is visible.
220
+ const count = store.raw().length;
221
+ useEffect(() => { if (store.loaded() && (typeof document === "undefined" || !document.hidden)) void store.markRead(); }, [store.loaded(), count]);
222
+ // The room's own mention labels, accented in every bubble as 「@Notes」 is (Lumen): @所有 Agent, the assistant, each member —
223
+ // read when the thread draws (the thread keeps its options from its first render, before the room's members are known).
224
+ const labels = () => [hroom("mentionAll"), hroom("mentionAssistant"), ...(store.detail()?.members || []).filter((m) => m.kind !== "assistant").map((m) => `@${m.name}`)];
225
+ const extra = {
226
+ isUser: (x) => x.mine === true, canReply: () => !store.closed(),
227
+ mentionLabels: labels, statusAction: (arg) => store.expand(arg),
228
+ startReply: (x) => { setReply(x); setTimeout(() => input.current?.focus(), 0); },
229
+ findQuoted: async () => { await store.older(); return false; },
230
+ };
231
+ const line2 = group ? `${countsLine(room.people, room.agents)}${hasAssistant ? ` · ${hroom("roomAssistant")}` : ""}`
232
+ : room.assistant ? hroom("providedByHub") : String(room.agent?.owner?.name || "");
233
+ const showRail = wide && rail && Panel && group && detail;
234
+ // The Fleet chat's working bar (Lumen): 「Notes 正在處理」, or 「2 個 Agent 正在處理」 — the answer row only when it arrives.
235
+ // Who: this room's answers being worked on; the words: workingLine() (#3857), the one place that says it.
236
+ const working = workingLine({ members: store.workers().map((w) => ({ ...w, presence: "working" })) });
237
+ const panel = Panel && detail ? html`<${Panel} client=${client} roomId=${roomId} detail=${detail}
238
+ onMention=${(m) => { setSheet(false); insert.current?.(`@${m.name}`); }}
239
+ onOpenChat=${(m) => { const direct = rooms.find((r) => r.kind === "direct" && r.agent?.exposureId === m.id); if (direct) openRoom(direct.id); }}
240
+ onSettings=${() => { setSheet(false); openSettings(); }} />` : null;
241
+ return html`<div class=${`hub-chat hub-room-page${showRail ? " with-rail" : ""}`} data-room=${roomId}>
242
+ <section class="hub-chat-main">
243
+ <header class="hub-chat-head" data-trust="panel-content">
244
+ <span class=${`av${group ? " av-square" : ""}`} aria-hidden="true"><span class="av-text">${firstCharacter(title || "?") || "?"}</span></span>
245
+ <span class="hub-chat-title"><strong>${title}</strong><span class="s">${line2}</span></span>
246
+ ${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")}
247
+ onClick=${() => (wide ? setRail(!rail) : setSheet(true))}><${Icon} name="team" size=${18} /></button>` : null}
248
+ ${group && detail?.me?.role === "manager" ? html`<button type="button" class="icon-btn hub-room-settings-open" title=${hroom("roomSettings")} aria-label=${hroom("roomSettings")}
249
+ onClick=${openSettings}><${Icon} name="settings" size=${18} /></button>` : null}
250
+ </header>
251
+ <${Thread} store=${store} name=${title} panelKey=${`hub-room:${roomId}`} threadRef=${threadRef} extra=${extra}
252
+ emptyView=${room.assistant ? html`<div class="hub-assistant-empty"><${Empty} icon="bot" title=${hroom("hubAssistant")} hint=${hroom("hubAssistantEmpty")} /></div>`
253
+ : group ? html`<p class="note">${hroom("composerHint")}</p>` : null} />
254
+ ${working ? html`<${WorkBarView} kind="working" label=${working.text} elapsed="" elapsedTitle="" />` : null}
255
+ <${RoomComposer} store=${store} detail=${detail} reply=${reply} onReply=${setReply} closed=${store.closed()} inputRef=${input} insertRef=${insert} />
256
+ </section>
257
+ ${showRail ? html`<${RailFrame} trust="hub-context" label=${hroom("members")} title=${hroom("members")} closeLabel=${hroom("cancel")} onClose=${() => setRail(false)}>${panel}</${RailFrame}>` : null}
258
+ ${!wide && sheet && panel && group ? html`<${Dialog} title=${hroom("members")} label=${hroom("members")} onClose=${() => setSheet(false)}><div class="hub-rail-sheet">${panel}</div></${Dialog}>` : null}
259
+ ${settings && detail ? html`<${settings} client=${client} roomId=${roomId} detail=${detail} assistant=${hasAssistant}
260
+ onClose=${() => setSettings(null)} onChanged=${() => { void store.refresh(); }} />` : null}
261
+ </div>`;
262
+ }
@@ -0,0 +1,51 @@
1
+ // Hub rooms unread and desktop notifications (hub-rooms-ux.md §12). Pure: one live event in, counts out.
2
+ // The Fleet desktop-notify rule is notifyOn in app-needs.js — imported, never copied. Tab title is this
3
+ // helper; the Needs-you prefix in app-shell.js is a different count.
4
+ import { notifyOn } from "/assets/app-needs.js";
5
+
6
+ const NONE = { unread: 0, mentioned: false, invitation: false, id: null };
7
+
8
+ /** Browser tab title: "(3) base" while there is unread; `base` itself when the total is 0. */
9
+ export function tabTitle(base, total) {
10
+ const n = Number(total);
11
+ return n > 0 && Number.isFinite(n) ? `(${Math.trunc(n)}) ${base}` : base;
12
+ }
13
+
14
+ function countable(message, me) {
15
+ const author = message && message.author;
16
+ if (!author || !me) return false;
17
+ if (author.id === me.id || author.kind === "system") return false;
18
+ return !!(message.text || message.stage !== "queued");
19
+ }
20
+
21
+ /**
22
+ * Per-event §12 counts: others' messages, an @ to me, answers from agents I @-ed, new invitations.
23
+ * Own messages and system rows are 0. A live invitation.changed with no invitation object is a
24
+ * removal (accept/decline) and does not count.
25
+ * `id` is the message (or invitation) identity so a caller that sums unread keeps a Set of ids
26
+ * rather than adding every message.updated of the same row.
27
+ */
28
+ export function counts(event, me) {
29
+ if (!event || typeof event !== "object") return NONE;
30
+ if (event.type === "invitation.changed") {
31
+ const inv = event.invitation;
32
+ return inv && typeof inv === "object" && (inv.id || inv.room)
33
+ ? { unread: 1, mentioned: false, invitation: true, id: inv.id || null }
34
+ : NONE;
35
+ }
36
+ if (event.type !== "message.added" && event.type !== "message.updated") return NONE;
37
+ const message = event.message;
38
+ if (!countable(message, me)) return NONE;
39
+ const mentions = Array.isArray(message.mentions) ? message.mentions : [];
40
+ return { unread: 1, mentioned: mentions.includes(me.id), invitation: false, id: message.id || null };
41
+ }
42
+
43
+ /** Desktop notify only for a row counts() treats as unread, and only while the tab is unfocused. */
44
+ export function shouldNotify(event, me, focus, env = globalThis) {
45
+ return !focus && counts(event, me).unread > 0 && notifyOn(env);
46
+ }
47
+
48
+ /** Open room + scrolled to the bottom → mark read (spec §12). */
49
+ export function readWhen(atBottom, open) {
50
+ return Boolean(open && atBottom);
51
+ }
@@ -0,0 +1,29 @@
1
+ // Hub rooms WorkBar line and assistant footnote (hub-rooms-ux.md §3 處理中). Pure: a room GET
2
+ // answer or a message in, words out. Words come from hub-room-strings.js (hroom), never copied.
3
+ import { hroom } from "./hub-room-strings.js";
4
+
5
+ function workingOf(detail) {
6
+ const members = detail && Array.isArray(detail.members) ? detail.members : [];
7
+ return members.filter((m) => m && (m.kind === "agent" || m.kind === "assistant") && m.presence === "working");
8
+ }
9
+
10
+ function displayName(member) {
11
+ return member.kind === "assistant" ? hroom("roomAssistant") : member.name;
12
+ }
13
+
14
+ /** One / several agents (and the room assistant) currently working; people never count. */
15
+ export function workingLine(detail) {
16
+ const working = workingOf(detail);
17
+ if (!working.length) return null;
18
+ const names = working.map(displayName);
19
+ const count = working.length;
20
+ const text = count === 1 ? hroom("workingOne", names[0]) : hroom("workingMany", count);
21
+ return { text, names, count };
22
+ }
23
+
24
+ /** Footnote under an assistant's answer; empty for anyone else. */
25
+ export function assistantFootnote(message) {
26
+ const author = message && message.author;
27
+ if (author && author.kind === "assistant" && message.answerTo) return hroom("basedOnRecent");
28
+ return "";
29
+ }
@@ -1,3 +1,4 @@
1
+ import { modelSwitchText, modelName, observationLabel } from "/assets/model-observation.js";
1
2
  // AGEND-181: one step of an instance's work as a row — shared by the Log tab (panel-log.js) and the chat's activity
2
3
  // timeline (chat-activity.js), so a step looks and behaves the same in both: its icon, words, status, and its arguments
3
4
  // and output on demand. Masking and cutting are the server's (log-steps.ts); this only shows what it is given.
@@ -157,9 +158,16 @@ export function mergeSteps(list, incoming, older = false) {
157
158
  // category and start time stay; the outcome is the newer read's.
158
159
  // Prism #3709 R5: a read that saw only a call's result has no turn evidence (`turn: ""`) — it never erases the turn the
159
160
  // call already gave (a fresh parser per cursor range), so a poll-by-poll Log groups exactly as a cold read does.
160
- if (!older) next[i] = s.kind === "tool" && !s.tool && next[i].tool
161
- ? { ...next[i], ...s, tool: next[i].tool, cat: next[i].cat, ts: next[i].ts, ...kept(s.turn, next[i].turn) }
162
- : { ...next[i], ...s, ...kept(s.turn, next[i].turn) };
161
+ // A result with no call (`tool: ""`) is not proof of anything about a step the page already holds as finished: codex runs a
162
+ // tool through an `exec` script call, and the item that did the work takes the call's step over (done / failed, with its
163
+ // own output); the script's own, later output — read by a poll that cannot see the call — is not the action's outcome.
164
+ // It completes a call still running, and never rewrites an outcome (a failed command stays failed, with its body).
165
+ const orphan = s.kind === "tool" && !s.tool && next[i].tool;
166
+ if (!older) next[i] = orphan && (next[i].status === "done" || next[i].status === "failed")
167
+ ? { ...next[i], ...kept(s.turn, next[i].turn) }
168
+ : orphan
169
+ ? { ...next[i], ...s, tool: next[i].tool, cat: next[i].cat, ts: next[i].ts, ...kept(s.turn, next[i].turn) }
170
+ : { ...next[i], ...s, ...kept(s.turn, next[i].turn) };
163
171
  else if (next[i].kind === "tool" && !next[i].tool && s.tool) {
164
172
  const { tool, cat, subject, input, ts } = s;
165
173
  next[i] = { ...next[i], tool, cat, ...(subject !== undefined ? { subject } : {}), ...(input !== undefined ? { input } : {}), ...(ts ? { ts } : {}), ...kept(next[i].turn, s.turn) };
@@ -294,7 +302,7 @@ export function LogRow({ x, prev, paths, chat, compact, latest }) {
294
302
  ${x.screen && open ? html`<div class="log-detail"><div class="log-text mono log-screen">${x.screen}</div></div>` : null}`;
295
303
  } else if (x.kind === "user" || x.kind === "assistant") {
296
304
  // In the chat's timeline an assistant line is what the agent said on the way (its replies are the bubbles): "Said".
297
- row = html`${head(KIND_ICON[x.kind], x.kind === "assistant" && chat ? tl("said") : tl(x.kind))}${text(x.body, x.bodyCut)}`;
305
+ row = html`${head(KIND_ICON[x.kind], x.kind === "assistant" && chat ? tl("said") : tl(x.kind))}${x.servedModel ? text(`${observationLabel("served")}: ${modelName(x.servedModel)}`) : null}${text(x.body, x.bodyCut)}`;
298
306
  } else if (x.kind === "thinking") {
299
307
  // AGEND-181: the model's thinking (admin only; the server sends it only then): folded to its start, opened on demand.
300
308
  const body = x.body || "";
@@ -309,7 +317,8 @@ export function LogRow({ x, prev, paths, chat, compact, latest }) {
309
317
  row = head(KIND_ICON.turn_end, x.durationMs ? tl("turnEndIn", duration(x.durationMs)) : tl("turnEnd"),
310
318
  x.status && x.status !== "done" ? html`<span class=${`log-status ${x.status}`}>${tl(x.status)}</span>` : null);
311
319
  } else if (x.kind === "state") {
312
- row = head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
320
+ row = x.modelSwitch ? html`${head(KIND_ICON.state, observationLabel("title"))}${text(modelSwitchText(x.modelSwitch))}`
321
+ : head(KIND_ICON.state, x.note === "compacted" ? tl("compacted") : x.note || "");
313
322
  } else {
314
323
  const cat = x.cat || "other";
315
324
  const subject = cat === "plan" && x.subject ? tl("plan_items", x.subject) : short(x.subject || "");