@songsid/agend 2.4.0-beta.26 → 2.4.0-beta.28

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 (506) hide show
  1. package/dist/agent-cli-instructions.md +2 -1
  2. package/dist/agent-cli.js +6 -0
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-endpoint.d.ts +1 -0
  5. package/dist/agent-endpoint.js +5 -0
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/agent-whats-new.js +4 -0
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/backend/kiro-auth-store.d.ts +15 -2
  10. package/dist/backend/kiro-auth-store.js +64 -0
  11. package/dist/backend/kiro-auth-store.js.map +1 -1
  12. package/dist/build-provenance.json +1 -1
  13. package/dist/channel/adapters/discord.js +4 -4
  14. package/dist/channel/adapters/discord.js.map +1 -1
  15. package/dist/channel/adapters/telegram.js +3 -3
  16. package/dist/channel/adapters/telegram.js.map +1 -1
  17. package/dist/channel/ipc-bridge.d.ts +7 -0
  18. package/dist/channel/ipc-bridge.js +45 -11
  19. package/dist/channel/ipc-bridge.js.map +1 -1
  20. package/dist/channel/mcp-server.js +3 -1
  21. package/dist/channel/mcp-server.js.map +1 -1
  22. package/dist/channel/mcp-tools.js +6 -4
  23. package/dist/channel/mcp-tools.js.map +1 -1
  24. package/dist/claude-turn-boundaries.d.ts +15 -0
  25. package/dist/claude-turn-boundaries.js +88 -0
  26. package/dist/claude-turn-boundaries.js.map +1 -0
  27. package/dist/cli.js +35 -2
  28. package/dist/cli.js.map +1 -1
  29. package/dist/contact-auth-service.js +3 -0
  30. package/dist/contact-auth-service.js.map +1 -1
  31. package/dist/contact-auth-store.d.ts +16 -0
  32. package/dist/contact-auth-store.js +61 -1
  33. package/dist/contact-auth-store.js.map +1 -1
  34. package/dist/daemon.d.ts +76 -4
  35. package/dist/daemon.js +621 -115
  36. package/dist/daemon.js.map +1 -1
  37. package/dist/delivery-outbox.d.ts +145 -7
  38. package/dist/delivery-outbox.js +373 -8
  39. package/dist/delivery-outbox.js.map +1 -1
  40. package/dist/detached-fleet-stop.d.ts +40 -0
  41. package/dist/detached-fleet-stop.js +126 -0
  42. package/dist/detached-fleet-stop.js.map +1 -0
  43. package/dist/fleet-lock.d.ts +5 -0
  44. package/dist/fleet-lock.js +21 -2
  45. package/dist/fleet-lock.js.map +1 -1
  46. package/dist/fleet-manager.d.ts +499 -5
  47. package/dist/fleet-manager.js +2917 -217
  48. package/dist/fleet-manager.js.map +1 -1
  49. package/dist/fleet-windows-runtime.d.ts +39 -3
  50. package/dist/fleet-windows-runtime.js +208 -30
  51. package/dist/fleet-windows-runtime.js.map +1 -1
  52. package/dist/general-knowledge/skills/concepts/SKILL.md +5 -0
  53. package/dist/general-knowledge/skills/hub/SKILL.md +5 -1
  54. package/dist/general-knowledge/skills/task-board/SKILL.md +14 -0
  55. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +96 -26
  56. package/dist/hub/admin-dashboard.js +1 -1
  57. package/dist/hub/admin-dashboard.js.map +1 -1
  58. package/dist/hub/agent-catalog.d.ts +1 -1
  59. package/dist/hub/agent-catalog.js +4 -3
  60. package/dist/hub/agent-catalog.js.map +1 -1
  61. package/dist/hub/agent-intro.d.ts +1 -1
  62. package/dist/hub/agent-intro.js +1 -1
  63. package/dist/hub/agent-intro.js.map +1 -1
  64. package/dist/hub/agent-pictures.d.ts +1 -1
  65. package/dist/hub/agent-pictures.js +4 -3
  66. package/dist/hub/agent-pictures.js.map +1 -1
  67. package/dist/hub/catalog.d.ts +2 -2
  68. package/dist/hub/catalog.js +16 -13
  69. package/dist/hub/catalog.js.map +1 -1
  70. package/dist/hub/client.js +9 -2
  71. package/dist/hub/client.js.map +1 -1
  72. package/dist/hub/compose/member.js +8 -1
  73. package/dist/hub/compose/member.js.map +1 -1
  74. package/dist/hub/compose/server.js +4 -2
  75. package/dist/hub/compose/server.js.map +1 -1
  76. package/dist/hub/fleet-updates.d.ts +2 -2
  77. package/dist/hub/fleet-updates.js +7 -5
  78. package/dist/hub/fleet-updates.js.map +1 -1
  79. package/dist/hub/fleet-versions.d.ts +1 -1
  80. package/dist/hub/fleet-versions.js +3 -2
  81. package/dist/hub/fleet-versions.js.map +1 -1
  82. package/dist/hub/http/compose.js +57 -30
  83. package/dist/hub/http/compose.js.map +1 -1
  84. package/dist/hub/http/schema.js +4 -1
  85. package/dist/hub/http/schema.js.map +1 -1
  86. package/dist/hub/join/service.d.ts +6 -0
  87. package/dist/hub/join/service.js +10 -0
  88. package/dist/hub/join/service.js.map +1 -1
  89. package/dist/hub/member/room-ask.js +2 -0
  90. package/dist/hub/member/room-ask.js.map +1 -1
  91. package/dist/hub/member/room-post.d.ts +4 -0
  92. package/dist/hub/member/room-post.js +26 -1
  93. package/dist/hub/member/room-post.js.map +1 -1
  94. package/dist/hub/protocol.d.ts +58 -0
  95. package/dist/hub/protocol.js +3 -2
  96. package/dist/hub/protocol.js.map +1 -1
  97. package/dist/hub/quota.d.ts +2 -2
  98. package/dist/hub/quota.js +6 -4
  99. package/dist/hub/quota.js.map +1 -1
  100. package/dist/hub/read-statement.d.ts +6 -0
  101. package/dist/hub/read-statement.js +33 -0
  102. package/dist/hub/read-statement.js.map +1 -0
  103. package/dist/hub/recommendations.d.ts +1 -1
  104. package/dist/hub/recommendations.js +3 -2
  105. package/dist/hub/recommendations.js.map +1 -1
  106. package/dist/hub/representative.d.ts +2 -0
  107. package/dist/hub/representative.js +8 -4
  108. package/dist/hub/representative.js.map +1 -1
  109. package/dist/hub/roles/clock.d.ts +1 -1
  110. package/dist/hub/roles/clock.js +9 -7
  111. package/dist/hub/roles/clock.js.map +1 -1
  112. package/dist/hub/roles/read.d.ts +4 -0
  113. package/dist/hub/roles/read.js +37 -7
  114. package/dist/hub/roles/read.js.map +1 -1
  115. package/dist/hub/room-history-model.d.ts +87 -0
  116. package/dist/hub/room-history-model.js +14 -0
  117. package/dist/hub/room-history-model.js.map +1 -0
  118. package/dist/hub/rooms/agents.d.ts +1 -1
  119. package/dist/hub/rooms/agents.js +3 -2
  120. package/dist/hub/rooms/agents.js.map +1 -1
  121. package/dist/hub/rooms/history.d.ts +8 -0
  122. package/dist/hub/rooms/history.js +31 -0
  123. package/dist/hub/rooms/history.js.map +1 -0
  124. package/dist/hub/rooms/schema.d.ts +2 -0
  125. package/dist/hub/rooms/schema.js +4 -0
  126. package/dist/hub/rooms/schema.js.map +1 -1
  127. package/dist/hub/rooms/service.d.ts +35 -19
  128. package/dist/hub/rooms/service.js +105 -26
  129. package/dist/hub/rooms/service.js.map +1 -1
  130. package/dist/hub/server.js +10 -3
  131. package/dist/hub/server.js.map +1 -1
  132. package/dist/hub/session-epoch.js +2 -1
  133. package/dist/hub/session-epoch.js.map +1 -1
  134. package/dist/hub/settings-directory-decision.js +14 -7
  135. package/dist/hub/settings-directory-decision.js.map +1 -1
  136. package/dist/hub/settings-member-address-decision.js +3 -2
  137. package/dist/hub/settings-member-address-decision.js.map +1 -1
  138. package/dist/hub/settings-web-address-decision.js +2 -1
  139. package/dist/hub/settings-web-address-decision.js.map +1 -1
  140. package/dist/hub/store.d.ts +5 -0
  141. package/dist/hub/store.js +28 -5
  142. package/dist/hub/store.js.map +1 -1
  143. package/dist/hub/types.d.ts +2 -2
  144. package/dist/hub-agent-incarnation-record.d.ts +24 -0
  145. package/dist/hub-agent-incarnation-record.js +46 -0
  146. package/dist/hub-agent-incarnation-record.js.map +1 -0
  147. package/dist/human-delivery-receipts.d.ts +16 -4
  148. package/dist/human-delivery-receipts.js +26 -5
  149. package/dist/human-delivery-receipts.js.map +1 -1
  150. package/dist/instance-lifecycle.d.ts +9 -3
  151. package/dist/instance-lifecycle.js +27 -10
  152. package/dist/instance-lifecycle.js.map +1 -1
  153. package/dist/instructions.d.ts +1 -1
  154. package/dist/local-pane-endpoint.d.ts +14 -0
  155. package/dist/local-pane-endpoint.js +32 -0
  156. package/dist/local-pane-endpoint.js.map +1 -1
  157. package/dist/locale.js +68 -4
  158. package/dist/locale.js.map +1 -1
  159. package/dist/native-agent-admission.js +9 -0
  160. package/dist/native-agent-admission.js.map +1 -1
  161. package/dist/native-exec-context.d.ts +11 -0
  162. package/dist/native-exec-context.js +18 -0
  163. package/dist/native-exec-context.js.map +1 -0
  164. package/dist/native-exec-input.d.ts +56 -0
  165. package/dist/native-exec-input.js +89 -0
  166. package/dist/native-exec-input.js.map +1 -0
  167. package/dist/native-mcp.d.ts +9 -1
  168. package/dist/native-mcp.js +29 -7
  169. package/dist/native-mcp.js.map +1 -1
  170. package/dist/native-pane-lifecycle.d.ts +3 -0
  171. package/dist/native-pane-lifecycle.js +2 -0
  172. package/dist/native-pane-lifecycle.js.map +1 -1
  173. package/dist/native-pane-manager.d.ts +18 -0
  174. package/dist/native-pane-manager.js +85 -8
  175. package/dist/native-pane-manager.js.map +1 -1
  176. package/dist/needs-you.d.ts +2 -1
  177. package/dist/needs-you.js.map +1 -1
  178. package/dist/outbound-handlers.d.ts +1 -0
  179. package/dist/outbound-handlers.js +9 -3
  180. package/dist/outbound-handlers.js.map +1 -1
  181. package/dist/outbound-schemas.d.ts +8 -0
  182. package/dist/outbound-schemas.js +6 -2
  183. package/dist/outbound-schemas.js.map +1 -1
  184. package/dist/public-web-gateway.js +3 -1
  185. package/dist/public-web-gateway.js.map +1 -1
  186. package/dist/recover.cjs +1 -0
  187. package/dist/reply-buttons-controller.d.ts +1 -0
  188. package/dist/reply-buttons-controller.js +1 -1
  189. package/dist/reply-buttons-controller.js.map +1 -1
  190. package/dist/request-contact-gate.d.ts +2 -0
  191. package/dist/request-contact-gate.js +8 -3
  192. package/dist/request-contact-gate.js.map +1 -1
  193. package/dist/request-context-activation.d.ts +29 -0
  194. package/dist/request-context-activation.js +85 -0
  195. package/dist/request-context-activation.js.map +1 -0
  196. package/dist/request-context-admission.d.ts +22 -0
  197. package/dist/request-context-admission.js +12 -0
  198. package/dist/request-context-admission.js.map +1 -0
  199. package/dist/request-context-boot.d.ts +35 -0
  200. package/dist/request-context-boot.js +97 -0
  201. package/dist/request-context-boot.js.map +1 -0
  202. package/dist/request-context-call.d.ts +3 -0
  203. package/dist/request-context-call.js.map +1 -1
  204. package/dist/request-context-compatibility.js +10 -2
  205. package/dist/request-context-compatibility.js.map +1 -1
  206. package/dist/request-context-continuation.d.ts +6 -0
  207. package/dist/request-context-continuation.js +24 -0
  208. package/dist/request-context-continuation.js.map +1 -0
  209. package/dist/request-context-control-api.d.ts +119 -0
  210. package/dist/request-context-control-api.js +179 -0
  211. package/dist/request-context-control-api.js.map +1 -0
  212. package/dist/request-context-control-copy.d.ts +3 -0
  213. package/dist/request-context-control-copy.js +7 -0
  214. package/dist/request-context-control-copy.js.map +1 -0
  215. package/dist/request-context-controller.d.ts +44 -0
  216. package/dist/request-context-controller.js +129 -0
  217. package/dist/request-context-controller.js.map +1 -0
  218. package/dist/request-context-delivery-resolver.d.ts +13 -0
  219. package/dist/request-context-delivery-resolver.js +30 -0
  220. package/dist/request-context-delivery-resolver.js.map +1 -0
  221. package/dist/request-context-drain-projection.d.ts +8 -0
  222. package/dist/request-context-drain-projection.js +40 -0
  223. package/dist/request-context-drain-projection.js.map +1 -0
  224. package/dist/request-context-drain.d.ts +22 -0
  225. package/dist/request-context-drain.js +139 -7
  226. package/dist/request-context-drain.js.map +1 -1
  227. package/dist/request-context-enable-offer.d.ts +13 -0
  228. package/dist/request-context-enable-offer.js +31 -0
  229. package/dist/request-context-enable-offer.js.map +1 -0
  230. package/dist/request-context-exec-owner.d.ts +39 -0
  231. package/dist/request-context-exec-owner.js +128 -0
  232. package/dist/request-context-exec-owner.js.map +1 -0
  233. package/dist/request-context-go-back-view.d.ts +1 -0
  234. package/dist/request-context-go-back-view.js +17 -0
  235. package/dist/request-context-go-back-view.js.map +1 -0
  236. package/dist/request-context-helper-readiness.d.ts +14 -0
  237. package/dist/request-context-helper-readiness.js +23 -0
  238. package/dist/request-context-helper-readiness.js.map +1 -0
  239. package/dist/request-context-helper.d.ts +20 -0
  240. package/dist/request-context-helper.js +41 -0
  241. package/dist/request-context-helper.js.map +1 -0
  242. package/dist/request-context-hub-resolver.d.ts +29 -0
  243. package/dist/request-context-hub-resolver.js +90 -0
  244. package/dist/request-context-hub-resolver.js.map +1 -0
  245. package/dist/request-context-human-resolver.d.ts +20 -0
  246. package/dist/request-context-human-resolver.js +77 -0
  247. package/dist/request-context-human-resolver.js.map +1 -0
  248. package/dist/request-context-human.d.ts +112 -0
  249. package/dist/request-context-human.js +176 -0
  250. package/dist/request-context-human.js.map +1 -0
  251. package/dist/request-context-inputs.d.ts +21 -0
  252. package/dist/request-context-inputs.js +63 -0
  253. package/dist/request-context-inputs.js.map +1 -0
  254. package/dist/request-context-installation.d.ts +117 -0
  255. package/dist/request-context-installation.js +328 -0
  256. package/dist/request-context-installation.js.map +1 -0
  257. package/dist/request-context-knowledge.d.ts +5 -0
  258. package/dist/request-context-knowledge.js +32 -0
  259. package/dist/request-context-knowledge.js.map +1 -0
  260. package/dist/request-context-migration.d.ts +11 -0
  261. package/dist/request-context-migration.js +16 -3
  262. package/dist/request-context-migration.js.map +1 -1
  263. package/dist/request-context-native-human.d.ts +20 -0
  264. package/dist/request-context-native-human.js +91 -0
  265. package/dist/request-context-native-human.js.map +1 -0
  266. package/dist/request-context-native-output.d.ts +15 -0
  267. package/dist/request-context-native-output.js +46 -0
  268. package/dist/request-context-native-output.js.map +1 -0
  269. package/dist/request-context-native-result.d.ts +15 -0
  270. package/dist/request-context-native-result.js +46 -0
  271. package/dist/request-context-native-result.js.map +1 -0
  272. package/dist/request-context-off.d.ts +22 -0
  273. package/dist/request-context-off.js +77 -0
  274. package/dist/request-context-off.js.map +1 -0
  275. package/dist/request-context-outside-label.d.ts +5 -0
  276. package/dist/request-context-outside-label.js +28 -0
  277. package/dist/request-context-outside-label.js.map +1 -0
  278. package/dist/request-context-pane.d.ts +8 -0
  279. package/dist/request-context-pane.js +19 -0
  280. package/dist/request-context-pane.js.map +1 -1
  281. package/dist/request-context-pending-work.d.ts +11 -0
  282. package/dist/request-context-pending-work.js +43 -0
  283. package/dist/request-context-pending-work.js.map +1 -0
  284. package/dist/request-context-policy.d.ts +17 -1
  285. package/dist/request-context-policy.js +84 -6
  286. package/dist/request-context-policy.js.map +1 -1
  287. package/dist/request-context-readiness.d.ts +49 -0
  288. package/dist/request-context-readiness.js +64 -0
  289. package/dist/request-context-readiness.js.map +1 -0
  290. package/dist/request-context-recovery.d.ts +6 -2
  291. package/dist/request-context-recovery.js +25 -0
  292. package/dist/request-context-recovery.js.map +1 -1
  293. package/dist/request-context-relay.d.ts +2 -2
  294. package/dist/request-context-relay.js +10 -10
  295. package/dist/request-context-relay.js.map +1 -1
  296. package/dist/request-context-reply-pending.d.ts +16 -0
  297. package/dist/request-context-reply-pending.js +77 -0
  298. package/dist/request-context-reply-pending.js.map +1 -0
  299. package/dist/request-context-resolution.d.ts +35 -0
  300. package/dist/request-context-resolution.js +86 -0
  301. package/dist/request-context-resolution.js.map +1 -0
  302. package/dist/request-context-retirement.d.ts +21 -0
  303. package/dist/request-context-retirement.js +16 -0
  304. package/dist/request-context-retirement.js.map +1 -0
  305. package/dist/request-context-start.d.ts +15 -0
  306. package/dist/request-context-start.js +2 -0
  307. package/dist/request-context-start.js.map +1 -0
  308. package/dist/request-context-turns.d.ts +1 -1
  309. package/dist/request-context-turns.js +3 -2
  310. package/dist/request-context-turns.js.map +1 -1
  311. package/dist/request-context-unproved-label.d.ts +4 -0
  312. package/dist/request-context-unproved-label.js +25 -0
  313. package/dist/request-context-unproved-label.js.map +1 -0
  314. package/dist/request-context-update-guard.d.ts +15 -0
  315. package/dist/request-context-update-guard.js +54 -0
  316. package/dist/request-context-update-guard.js.map +1 -0
  317. package/dist/request-context-work.d.ts +50 -0
  318. package/dist/request-context-work.js +178 -0
  319. package/dist/request-context-work.js.map +1 -0
  320. package/dist/request-hub-context.d.ts +1 -0
  321. package/dist/request-hub-output.d.ts +2 -0
  322. package/dist/request-hub-output.js +12 -0
  323. package/dist/request-hub-output.js.map +1 -1
  324. package/dist/retained-human-control.d.ts +11 -0
  325. package/dist/retained-human-control.js +11 -0
  326. package/dist/retained-human-control.js.map +1 -0
  327. package/dist/runtime-build-info.js +1 -1
  328. package/dist/runtime-build-info.js.map +1 -1
  329. package/dist/runtime-cli.js +1 -1
  330. package/dist/runtime-cli.js.map +1 -1
  331. package/dist/runtime-client-store.js +7 -1
  332. package/dist/runtime-client-store.js.map +1 -1
  333. package/dist/runtime-client.js +15 -3
  334. package/dist/runtime-client.js.map +1 -1
  335. package/dist/runtime-coordinator.d.ts +23 -0
  336. package/dist/runtime-coordinator.js +103 -4
  337. package/dist/runtime-coordinator.js.map +1 -1
  338. package/dist/runtime-pane-mcp.d.ts +9 -0
  339. package/dist/runtime-pane-mcp.js +22 -2
  340. package/dist/runtime-pane-mcp.js.map +1 -1
  341. package/dist/runtime-protocol.d.ts +2 -0
  342. package/dist/runtime-protocol.js.map +1 -1
  343. package/dist/runtime-update-controller.js +1 -1
  344. package/dist/runtime-update-controller.js.map +1 -1
  345. package/dist/runtime-windows-bridge.d.ts +8 -0
  346. package/dist/runtime-windows-bridge.js +50 -3
  347. package/dist/runtime-windows-bridge.js.map +1 -1
  348. package/dist/scheduler/db.js +9 -0
  349. package/dist/scheduler/db.js.map +1 -1
  350. package/dist/scheduler/task-board-text.d.ts +3 -6
  351. package/dist/scheduler/task-board-text.js +15 -10
  352. package/dist/scheduler/task-board-text.js.map +1 -1
  353. package/dist/scheduler/task-board-unread.d.ts +90 -0
  354. package/dist/scheduler/task-board-unread.js +192 -0
  355. package/dist/scheduler/task-board-unread.js.map +1 -0
  356. package/dist/scheduler/task-board.d.ts +324 -6
  357. package/dist/scheduler/task-board.js +786 -47
  358. package/dist/scheduler/task-board.js.map +1 -1
  359. package/dist/service-install-handover.d.ts +52 -0
  360. package/dist/service-install-handover.js +50 -0
  361. package/dist/service-install-handover.js.map +1 -0
  362. package/dist/service-installer.d.ts +12 -0
  363. package/dist/service-installer.js +24 -10
  364. package/dist/service-installer.js.map +1 -1
  365. package/dist/settings-api.d.ts +2 -0
  366. package/dist/settings-api.js +4 -0
  367. package/dist/settings-api.js.map +1 -1
  368. package/dist/settings-baseline.d.ts +1 -0
  369. package/dist/settings-baseline.js +5 -4
  370. package/dist/settings-baseline.js.map +1 -1
  371. package/dist/settings-confirmation.d.ts +2 -0
  372. package/dist/settings-confirmation.js +6 -0
  373. package/dist/settings-confirmation.js.map +1 -1
  374. package/dist/settings-effect.d.ts +2 -0
  375. package/dist/settings-effect.js +59 -1
  376. package/dist/settings-effect.js.map +1 -1
  377. package/dist/settings-http-confirmation.d.ts +3 -0
  378. package/dist/settings-http-confirmation.js +29 -0
  379. package/dist/settings-http-confirmation.js.map +1 -1
  380. package/dist/settings-route-lifetime.d.ts +3 -1
  381. package/dist/settings-route-lifetime.js +15 -5
  382. package/dist/settings-route-lifetime.js.map +1 -1
  383. package/dist/settings-transaction.d.ts +3 -2
  384. package/dist/settings-transaction.js.map +1 -1
  385. package/dist/task-board-tool.js +24 -3
  386. package/dist/task-board-tool.js.map +1 -1
  387. package/dist/task-board-waker.d.ts +53 -2
  388. package/dist/task-board-waker.js +183 -12
  389. package/dist/task-board-waker.js.map +1 -1
  390. package/dist/tips.js +1 -1
  391. package/dist/tips.js.map +1 -1
  392. package/dist/tool-permissions.js +3 -3
  393. package/dist/tool-permissions.js.map +1 -1
  394. package/dist/tool-receipt-output.d.ts +6 -6
  395. package/dist/transcript-monitor.d.ts +6 -1
  396. package/dist/transcript-monitor.js +59 -4
  397. package/dist/transcript-monitor.js.map +1 -1
  398. package/dist/transcript-turns.d.ts +3 -0
  399. package/dist/transcript-turns.js +5 -0
  400. package/dist/transcript-turns.js.map +1 -1
  401. package/dist/turn-reply-guard.d.ts +16 -1
  402. package/dist/turn-reply-guard.js +20 -2
  403. package/dist/turn-reply-guard.js.map +1 -1
  404. package/dist/ui/app.html +2 -2
  405. package/dist/ui/contact-auth-strings.js +6 -6
  406. package/dist/ui/contact-authorizations.js +19 -1
  407. package/dist/ui/contact-grant-editor.js +71 -11
  408. package/dist/ui/contact-needs.js +27 -8
  409. package/dist/ui/contact-permissions.js +25 -8
  410. package/dist/ui/contact-tool-groups.js +1 -1
  411. package/dist/ui/fleet-task-activity.js +164 -24
  412. package/dist/ui/fleet-task-card.js +77 -13
  413. package/dist/ui/fleet-task-common.js +14 -0
  414. package/dist/ui/fleet-task-flow.js +353 -0
  415. package/dist/ui/fleet-task-md.js +1 -1
  416. package/dist/ui/fleet-task-run.js +98 -22
  417. package/dist/ui/fleet-task-thread.js +245 -0
  418. package/dist/ui/fleet-task-unread.js +100 -0
  419. package/dist/ui/fleet-task-view.js +6 -5
  420. package/dist/ui/fleet-task-wake.js +140 -0
  421. package/dist/ui/fleet-tasks.js +13 -6
  422. package/dist/ui/hub-client.js +3 -0
  423. package/dist/ui/hub-room-members.js +4 -2
  424. package/dist/ui/hub-room-settings-strings.js +8 -0
  425. package/dist/ui/hub-room-settings.js +32 -0
  426. package/dist/ui/hub-room-thread.js +7 -1
  427. package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
  428. package/dist/ui/icons/hub-favicon.ico +0 -0
  429. package/dist/ui/icons/hub-favicon.svg +10 -0
  430. package/dist/ui/icons/hub-icon-192.png +0 -0
  431. package/dist/ui/icons/hub-icon-512.png +0 -0
  432. package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
  433. package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
  434. package/dist/ui/icons/hub-maskable.svg +12 -0
  435. package/dist/ui/panel-hub.js +14 -3
  436. package/dist/ui/panel-needs.js +2 -1
  437. package/dist/ui/panel-settings.js +2 -1
  438. package/dist/ui/panel-windows-cli.js +2 -2
  439. package/dist/ui/request-contact-card.js +287 -0
  440. package/dist/ui/request-contact-client.js +83 -0
  441. package/dist/ui/request-contact-page.js +78 -0
  442. package/dist/ui/request-context-control.js +209 -0
  443. package/dist/ui/settings-registry.js +2 -0
  444. package/dist/ui/settings-update.js +3 -2
  445. package/dist/ui/shared/access-overview.css +1 -1
  446. package/dist/ui/shared/app-i18n.js +2 -2
  447. package/dist/ui/shared/app-install.js +2 -2
  448. package/dist/ui/shared/app-shell.js +17 -4
  449. package/dist/ui/shared/app-stream.js +4 -1
  450. package/dist/ui/shared/app-update.js +2 -1
  451. package/dist/ui/shared/app.css +101 -10
  452. package/dist/ui/shared/app.js +19 -2
  453. package/dist/ui/shared/task-board.css +164 -0
  454. package/dist/ui/shared/ui-icons.js +3 -0
  455. package/dist/ui/shared/ui-states.js +6 -0
  456. package/dist/ui/shared/update-card-ui.js +178 -11
  457. package/dist/ui/shared/view-strings.js +18 -0
  458. package/dist/ui/shared/web-authorize.js +1 -1
  459. package/dist/ui/task-unread.js +70 -0
  460. package/dist/ui/windows-cli-catalog.js +33 -6
  461. package/dist/update-card.d.ts +1 -1
  462. package/dist/update-card.js +7 -7
  463. package/dist/update-card.js.map +1 -1
  464. package/dist/update-fix.d.ts +66 -0
  465. package/dist/update-fix.js +67 -0
  466. package/dist/update-fix.js.map +1 -0
  467. package/dist/update-goback.js +15 -3
  468. package/dist/update-goback.js.map +1 -1
  469. package/dist/update-readiness.d.ts +2 -0
  470. package/dist/update-readiness.js +5 -1
  471. package/dist/update-readiness.js.map +1 -1
  472. package/dist/update-snapshot-scope.js +1 -0
  473. package/dist/update-snapshot-scope.js.map +1 -1
  474. package/dist/usage/i18n-keys.d.ts +1 -1
  475. package/dist/usage/i18n-keys.js +9 -0
  476. package/dist/usage/i18n-keys.js.map +1 -1
  477. package/dist/usage/providers.d.ts +3 -11
  478. package/dist/usage/providers.js +93 -131
  479. package/dist/usage/providers.js.map +1 -1
  480. package/dist/web-api.d.ts +49 -1
  481. package/dist/web-api.js +234 -13
  482. package/dist/web-api.js.map +1 -1
  483. package/dist/web-chat-history.d.ts +2 -0
  484. package/dist/web-chat-history.js.map +1 -1
  485. package/dist/web-icons.d.ts +9 -3
  486. package/dist/web-icons.js +62 -5
  487. package/dist/web-icons.js.map +1 -1
  488. package/dist/web-update.d.ts +9 -0
  489. package/dist/windows-agents.d.ts +24 -2
  490. package/dist/windows-agents.js +110 -4
  491. package/dist/windows-agents.js.map +1 -1
  492. package/dist/windows-cli-api.js +4 -2
  493. package/dist/windows-cli-api.js.map +1 -1
  494. package/dist/windows-cli-worker.js +9 -1
  495. package/dist/windows-cli-worker.js.map +1 -1
  496. package/dist/windows-cli.d.ts +55 -1
  497. package/dist/windows-cli.js +147 -17
  498. package/dist/windows-cli.js.map +1 -1
  499. package/dist/windows-shortcuts.d.ts +3 -22
  500. package/dist/windows-shortcuts.js +5 -45
  501. package/dist/windows-shortcuts.js.map +1 -1
  502. package/dist/workflow-templates/default.md +3 -2
  503. package/dist/wsl-host.d.ts +52 -0
  504. package/dist/wsl-host.js +97 -0
  505. package/dist/wsl-host.js.map +1 -0
  506. package/package.json +1 -1
@@ -1,3 +1,6 @@
1
+ import { HUB_ROOM_HISTORY_CAPABILITY, ROOM_HISTORY_BYTES, ROOM_HISTORY_NOTE, roomHistorySchema } from "../room-history-model.js";
2
+ import { spendRoomHistory, historyBinding, historyCursor, readHistoryCursor } from "./history.js";
3
+ import { boundedRoomText } from "./context.js";
1
4
  import { HUB_ROOM_MEMBERS_CAPABILITY } from "../room-members-model.js";
2
5
  import { pageRoomMembers } from "./members-page.js";
3
6
  import { normalizeRoomPurpose } from "./purpose.js";
@@ -85,7 +88,7 @@ export function validRoomEmoji(s) {
85
88
  return false;
86
89
  return [...new Intl.Segmenter("en", { granularity: "grapheme" }).segment(s)].length === 1;
87
90
  }
88
- const patchSchema = z.strictObject({ name: label.optional(), purpose: purpose.optional(), allMention: z.boolean().optional(), historyForNew: z.enum(["since-join", "all"]).optional(), archived: z.boolean().optional(), assistant: z.boolean().optional(),
91
+ const patchSchema = z.strictObject({ name: label.optional(), purpose: purpose.optional(), allMention: z.boolean().optional(), membersCanAddOwnAgents: z.boolean().optional(), historyForNew: z.enum(["since-join", "all"]).optional(), archived: z.boolean().optional(), assistant: z.boolean().optional(),
89
92
  office: z.strictObject({ enabled: z.boolean().optional(), style: z.enum(ROOM_OFFICE_STYLES).optional() }).optional() });
90
93
  export class HubRoomRefusal extends Error {
91
94
  status;
@@ -283,34 +286,37 @@ export class HubGroupRooms {
283
286
  return db.prepare("SELECT display_name FROM hub_people WHERE person=? UNION ALL SELECT display_name FROM hub_room_people WHERE person=? LIMIT 1").get(person, person)?.display_name ?? person;
284
287
  }
285
288
  maximum(db, id) { return db.prepare("SELECT COALESCE(MAX(sequence),0) AS n FROM hub_room_posts WHERE room_id=?").get(id).n; }
286
- projection(row) {
289
+ projection(row, batchDb) {
290
+ // A history page already owns a synchronous, fenced transaction. Reuse its
291
+ // database for projection; nested atomic calls would reparse mount state per row.
292
+ const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
287
293
  let system = row.author_kind === "system" && ["room-created", "member-joined", "admin-joined", "poll-closed", "app-rate-limited"].includes(row.author_id)
288
294
  ? { kind: row.author_id, name: row.author_name } : undefined;
289
295
  if (row.author_kind === "system" && row.author_id === "purpose-changed") {
290
- const event = this.core.atomic(db => db.prepare("SELECT purpose FROM hub_room_purpose_events WHERE post_id=?").get(row.id));
296
+ const event = read(db => db.prepare("SELECT purpose FROM hub_room_purpose_events WHERE post_id=?").get(row.id));
291
297
  if (event)
292
298
  system = { kind: "purpose-changed", name: row.author_name, purpose: event.purpose };
293
299
  }
294
300
  if (row.author_kind === "system" && row.author_id === "office-style-changed") {
295
- const event = this.core.atomic(db => db.prepare("SELECT style FROM hub_room_office_style_events WHERE post_id=?").get(row.id));
301
+ const event = read(db => db.prepare("SELECT style FROM hub_room_office_style_events WHERE post_id=?").get(row.id));
296
302
  if (event)
297
303
  system = { kind: "office-style-changed", name: row.author_name, style: event.style };
298
304
  }
299
305
  if (row.author_kind === "system" && row.author_id === "office-changed") {
300
- const event = this.core.atomic(db => db.prepare("SELECT enabled FROM hub_room_office_events WHERE post_id=?").get(row.id));
306
+ const event = read(db => db.prepare("SELECT enabled FROM hub_room_office_events WHERE post_id=?").get(row.id));
301
307
  if (event)
302
308
  system = { kind: "office-changed", name: row.author_name, enabled: event.enabled === 1 };
303
309
  }
304
310
  // Agent rows retain their owner-at-message in author_subject; a later exposure transfer must not relabel history.
305
- const agent = row.author_kind === "agent" ? this.core.atomic(db => {
311
+ const agent = row.author_kind === "agent" ? read(db => {
306
312
  const e = readExposure(db, row.author_id);
307
313
  return { owner: { name: this.name(db, row.author_subject) }, ...(e ? { agentKind: e.source_kind === "personal" ? "personal" : "fleet" } : {}) };
308
314
  }) : undefined;
309
- return { id: row.id, roomId: row.room_id, at: row.created_at, sequence: row.sequence, author: { kind: row.author_kind, id: row.author_id, name: row.author_name, ...agent, ...this.viaAuthor(row) },
310
- ...(system ? { system } : {}), ...this.agentMetadata(row), text: this.core.deps.content.get(row.content_ref)?.question ?? "", mentions: JSON.parse(row.mentions),
315
+ return { id: row.id, roomId: row.room_id, at: row.created_at, sequence: row.sequence, author: { kind: row.author_kind, id: row.author_id, name: row.author_name, ...agent, ...this.viaAuthor(row, batchDb) },
316
+ ...(system ? { system } : {}), ...this.agentMetadata(row, batchDb), text: this.core.deps.content.get(row.content_ref)?.question ?? "", mentions: JSON.parse(row.mentions),
311
317
  ...(row.reply_to ? { replyTo: row.reply_to } : {}), ...(row.idempotency_key ? { idempotencyKey: row.idempotency_key } : {}),
312
- ...(row.stage ? { stage: row.stage } : {}), ...(row.answer_to ? { answerTo: row.answer_to } : {}), ...this.filesOf(row),
313
- ...this.core.atomic(db => {
318
+ ...(row.stage ? { stage: row.stage } : {}), ...(row.answer_to ? { answerTo: row.answer_to } : {}), ...this.filesOf(row, batchDb),
319
+ ...read(db => {
314
320
  const a = this.agents.progress(db, row.id), b = this.assistant.progress(db, row.id);
315
321
  const total = (a?.total ?? 0) + (b?.total ?? 0), failed = (a?.failed ?? 0) + (b?.failed ?? 0), blocked = (a?.blocked ?? 0) + (b?.blocked ?? 0);
316
322
  const ask = a || b ? { total, answered: (a?.answered ?? 0) + (b?.answered ?? 0), working: (a?.working ?? 0) + (b?.working ?? 0), later: (a?.later ?? 0) + (b?.later ?? 0),
@@ -342,15 +348,17 @@ export class HubGroupRooms {
342
348
  store() { const s = this.filesStore(); if (!s)
343
349
  throw new HubProtocolError("incompatible"); return s; }
344
350
  /** M-3125: a post's files, in order (none when the Hub has no attachment store). */
345
- filesOf(row) {
351
+ filesOf(row, batchDb) {
346
352
  const store = this.filesStore();
347
353
  if (!store)
348
354
  return {};
349
- const refs = this.core.atomic(db => [...store.forMessage(db, row.id, "question"), ...store.forMessage(db, row.id, "answer")]);
355
+ const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
356
+ const refs = read(db => [...store.forMessage(db, row.id, "question"), ...store.forMessage(db, row.id, "answer")]);
350
357
  return refs.length ? { files: refs.map(r => groupFileView(row.room_id, r)) } : {};
351
358
  }
352
- viaAuthor(row) {
353
- return this.core.atomic(db => {
359
+ viaAuthor(row, batchDb) {
360
+ const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
361
+ return read(db => {
354
362
  const app = this.appPosts ? db.prepare("SELECT app_id,app_name FROM hub_mcp_room_posts WHERE post_id=?").get(row.id) : undefined;
355
363
  if (app)
356
364
  return { via: { id: app.app_id, name: app.app_name, kind: "app" } };
@@ -358,8 +366,9 @@ export class HubGroupRooms {
358
366
  return op ? { name: op.person_name, via: { id: op.exposure_id, name: op.via_name, kind: "agent" } } : {};
359
367
  });
360
368
  }
361
- agentMetadata(row) {
362
- return this.core.atomic(db => {
369
+ agentMetadata(row, batchDb) {
370
+ const read = (work) => batchDb ? work(batchDb) : this.core.atomic(work);
371
+ return read(db => {
363
372
  const stop = db.prepare("SELECT source_id,reason,name,retry_at FROM hub_room_agent_stops WHERE post_id=?").get(row.id);
364
373
  if (stop)
365
374
  return { system: { kind: "agent-mention-stopped", reason: stop.reason, name: stop.name, sourceId: stop.source_id, ...(stop.retry_at !== null ? { retryAt: stop.retry_at } : {}) } };
@@ -486,6 +495,52 @@ export class HubGroupRooms {
486
495
  throw new HubProtocolError("backpressure");
487
496
  this.agentReadBuckets.set(owner, { at: b?.at ?? at, count: (b?.count ?? 0) + 1 });
488
497
  }
498
+ async agentHistory(input, link) {
499
+ const body = validated(roomHistorySchema, input);
500
+ if (!link.features.has(HUB_ROOM_HISTORY_CAPABILITY))
501
+ throw new HubProtocolError("incompatible");
502
+ const { source, fence } = await this.agentSource(body.exposureId, link);
503
+ return this.core.atomic(db => {
504
+ this.agentRead(source.owner);
505
+ const rooms = db.prepare(`SELECT r.id,m.id AS member,m.joined_sequence AS floor FROM hub_room_members m JOIN hub_group_rooms r ON r.id=m.room_id
506
+ WHERE m.kind='agent' AND m.subject=? AND m.owner_at_join=? AND r.assistant_for IS NULL AND (r.id=? OR r.name=?) ORDER BY r.id LIMIT 2`).all(source.id, source.owner, body.room, body.room);
507
+ const room = rooms.find(r => r.id === body.room) ?? (rooms.length === 1 ? rooms[0] : undefined);
508
+ if (!room)
509
+ return { ok: false, code: "not-found" };
510
+ const binding = historyBinding(source.id, source.owner, room.id, room.member, room.floor);
511
+ // Exactly the member floor and inherited audience boundary, including the original question of an answer.
512
+ const visible = `room_id=? AND sequence>=? AND COALESCE((SELECT audience_sequence FROM hub_room_post_lineage l WHERE l.post_id=hub_room_posts.id),sequence)>=?
513
+ AND (answer_to IS NULL OR EXISTS(SELECT 1 FROM hub_room_posts original WHERE original.id=hub_room_posts.answer_to AND original.room_id=hub_room_posts.room_id AND original.sequence>=?))`;
514
+ let until = Number.MAX_SAFE_INTEGER;
515
+ if (body.cursor) {
516
+ const id = readHistoryCursor(body.cursor, binding);
517
+ if (!id)
518
+ return { ok: false, code: "stale" };
519
+ const row = db.prepare(`SELECT sequence FROM hub_room_posts WHERE id=? AND ${visible}`).get(id, room.id, room.floor, room.floor, room.floor);
520
+ if (!row)
521
+ return { ok: false, code: "stale" };
522
+ until = row.sequence;
523
+ }
524
+ if (!spendRoomHistory(db, source.id, this.core.now()))
525
+ return { ok: false, code: "rate-limited", retryAt: (Math.floor(this.core.now() / 3600_000) + 1) * 3600_000 };
526
+ const rows = db.prepare(`SELECT * FROM hub_room_posts WHERE ${visible} AND sequence<? AND (stage IS NULL OR stage='answered')
527
+ AND NOT EXISTS(SELECT 1 FROM hub_room_deliveries d WHERE d.id=hub_room_posts.delivery_id AND d.state='answered' AND d.reason_code='acknowledged-by-reaction' AND d.answer_id IS NULL)
528
+ ORDER BY sequence DESC LIMIT ?`).all(room.id, room.floor, room.floor, room.floor, until, (body.limit ?? 20) + 1);
529
+ const messages = [];
530
+ const result = () => ({ ok: true, roomId: room.id, note: ROOM_HISTORY_NOTE, messages: [...messages].reverse(),
531
+ ...(messages.length < rows.length && messages.length ? { next_cursor: historyCursor(binding, messages[messages.length - 1].id) } : {}) });
532
+ for (const row of rows.slice(0, body.limit ?? 20)) {
533
+ const raw = this.core.deps.content.get(row.content_ref)?.question ?? "", text = boundedRoomText(raw, 2048);
534
+ const by = this.viaAuthor(row);
535
+ messages.push({ id: row.id, sequence: row.sequence, at: row.created_at, author: { kind: row.author_kind, name: boundedRoomText(by.name ?? row.author_name, 256), ...(by.via ? { via: { kind: by.via.kind, name: boundedRoomText(by.via.name, 256) } } : {}) }, text, ...(text !== raw ? { truncated: true } : {}) });
536
+ if (Buffer.byteLength(JSON.stringify(result())) > ROOM_HISTORY_BYTES) {
537
+ messages.pop();
538
+ break;
539
+ }
540
+ }
541
+ return result();
542
+ }, fence);
543
+ }
489
544
  async agentMembers(input, link) {
490
545
  const body = validated(roomMembersSchema, input);
491
546
  if (body.v2 && !link.features.has(HUB_ROOM_MEMBERS_CAPABILITY))
@@ -667,7 +722,7 @@ export class HubGroupRooms {
667
722
  AND (p.author_kind<>'person' OR p.author_subject<>?) AND j.value IN (?,?) LIMIT 1`).get(room.id, floor, floor, member.read_sequence, member.subject, member.id, member.subject);
668
723
  const online = db.prepare(`SELECT COUNT(*) AS n FROM hub_room_members m WHERE m.room_id=? AND m.kind='person' AND EXISTS
669
724
  (SELECT 1 FROM hub_sessions s WHERE s.person=m.subject AND s.state='active' AND s.expires_at>?)`).get(room.id, this.core.now()).n;
670
- const projected = last ? this.projection(last) : undefined;
725
+ const projected = last ? this.projection(last, db) : undefined;
671
726
  const summary = { id: room.id, kind: "group", name: room.name, purpose: room.purpose ?? "", people: counts.find(c => c.kind === "person")?.n ?? 0,
672
727
  agents: counts.find(c => c.kind === "agent")?.n ?? 0, online, unread, lastAt: last?.created_at ?? room.created_at,
673
728
  lastText: projected?.text.slice(0, 240) ?? "", ...(projected?.system ? { lastSystem: projected.system } : {}), lastAuthor: last?.author_name ?? "", mentioned, archived: room.archived === 1 };
@@ -893,9 +948,10 @@ export class HubGroupRooms {
893
948
  const own = this.member(db, id, me), room = this.room(db, id);
894
949
  // M-3533 R2a: each shared agent's look (its owner's catalog colour and emoji), each Fleet's catalog read once.
895
950
  const catalogs = new Map();
951
+ const transportState = this.core.deps.store.read();
896
952
  const lookOf = (fleetId, exposureId) => {
897
953
  if (!catalogs.has(fleetId))
898
- catalogs.set(fleetId, this.looks ? this.looks(fleetId) : null);
954
+ catalogs.set(fleetId, this.looks ? this.looks(fleetId, db, transportState) : null);
899
955
  return catalogs.get(fleetId)?.get(exposureId) ?? null;
900
956
  };
901
957
  const members = db.prepare("SELECT * FROM hub_room_members WHERE room_id=? ORDER BY kind,id").all(id).map(m => {
@@ -905,7 +961,7 @@ export class HubGroupRooms {
905
961
  const e = readExposure(db, m.subject), look = memberLook(e?.fleet_id ? lookOf(e.fleet_id, m.subject) : null);
906
962
  return { id: m.subject, kind: m.kind, name: e?.display_name ?? m.subject, ...(look ? { look } : {}), ...agentIntro(db, m.subject), role: m.role,
907
963
  ...(e ? { agentKind: e.source_kind === "personal" ? "personal" : "fleet" } : {}),
908
- ...(e?.answer_only === 1 ? { answerOnly: true } : {}), owner: { name: this.name(db, m.owner_at_join ?? ""), ...(m.owner_at_join ? { id: m.owner_at_join } : {}), ...(m.owner_at_join === me ? { mine: true } : {}) }, ...this.agents.presence(m.subject), canAsk: canAsk.has(m.subject) };
964
+ ...(e?.answer_only === 1 ? { answerOnly: true } : {}), owner: { name: this.name(db, m.owner_at_join ?? ""), ...(m.owner_at_join ? { id: m.owner_at_join } : {}), ...(m.owner_at_join === me ? { mine: true } : {}) }, ...this.agents.presence(m.subject, db), canAsk: canAsk.has(m.subject) };
909
965
  }
910
966
  return { id: m.id, kind: m.kind, name: this.name(db, m.subject), role: m.role,
911
967
  signedIn: !!db.prepare("SELECT 1 FROM hub_people WHERE person=?").get(m.subject),
@@ -913,7 +969,7 @@ export class HubGroupRooms {
913
969
  });
914
970
  // M-3125: the room takes people's files when this Hub stores files (the 1:1 chat's own attachments-v1 mark).
915
971
  return { room: { ...this.summary(db, room, own), ...(this.filesStore() ? { features: ["attachments-v1"] } : {}) }, me: { id: own.id, role: own.role }, members,
916
- settings: { allMention: room.all_mention === 1, historyForNew: room.history_for_new,
972
+ settings: { allMention: room.all_mention === 1, membersCanAddOwnAgents: room.members_add_own_agents === 1, historyForNew: room.history_for_new,
917
973
  ...(this.appPosts ? { aiApps: db.prepare("SELECT enabled FROM hub_mcp_room_policy WHERE room_id=?").get(id)?.enabled !== 0 } : {}),
918
974
  ...(members.some(m => m.kind === "assistant") ? { assistant: true } : {}),
919
975
  ...(this.office ? { office: { enabled: officeOn(room.office_enabled), style: room.office_style } } : {}) }, invited: [] };
@@ -935,8 +991,8 @@ export class HubGroupRooms {
935
991
  db.prepare("DELETE FROM hub_room_members WHERE room_id=? AND kind='assistant'").run(id);
936
992
  const was = officeOn(row.office_enabled), office = body.office?.enabled === undefined ? row.office_enabled : Number(body.office.enabled);
937
993
  const style = body.office?.style ?? row.office_style;
938
- db.prepare("UPDATE hub_group_rooms SET name=?,purpose=?,all_mention=?,history_for_new=?,archived=?,office_enabled=?,office_style=? WHERE id=?")
939
- .run(body.name ?? row.name, body.purpose ?? row.purpose, body.allMention === undefined ? row.all_mention : Number(body.allMention), body.historyForNew ?? row.history_for_new, body.archived === undefined ? row.archived : Number(body.archived), office, style, id);
994
+ db.prepare("UPDATE hub_group_rooms SET name=?,purpose=?,all_mention=?,history_for_new=?,archived=?,office_enabled=?,office_style=?,members_add_own_agents=? WHERE id=?")
995
+ .run(body.name ?? row.name, body.purpose ?? row.purpose, body.allMention === undefined ? row.all_mention : Number(body.allMention), body.historyForNew ?? row.history_for_new, body.archived === undefined ? row.archived : Number(body.archived), office, style, body.membersCanAddOwnAgents === undefined ? row.members_add_own_agents : Number(body.membersCanAddOwnAgents), id);
940
996
  const changed = [];
941
997
  if (body.purpose !== undefined && body.purpose !== row.purpose)
942
998
  changed.push(this.recordPurpose(db, tx, id, me, body.purpose, ctx.requestId));
@@ -961,12 +1017,13 @@ export class HubGroupRooms {
961
1017
  if (body.kind === "assistant")
962
1018
  return this.patch(ctx, id, { assistant: true });
963
1019
  if (body.kind === "agent") {
964
- this.core.atomic(db => { this.member(db, id, me, true); }, this.fence(ctx));
1020
+ this.core.atomic(db => { this.memberAgentAddition(db, id, me); }, this.fence(ctx));
965
1021
  const permit = await this.core.groupExposure(body.id, null, this.core.groupContext(ctx));
966
1022
  this.core.atomic((db, tx) => {
967
- this.member(db, id, me, true);
1023
+ this.memberAgentAddition(db, id, me);
968
1024
  this.addAgentMember(db, tx, id, body.id, me);
969
1025
  this.core.audit(tx, { requestId: ctx.requestId, actor: { kind: "person", person: personFromString(me) }, action: "room.agent-added", result: "completed", roomId: id, exposureId: body.id });
1026
+ this.memberAgentAddition(db, id, me);
970
1027
  }, { assertCurrent: () => { this.fence(ctx).assertCurrent(); permit.assertCurrent(); } });
971
1028
  this.emit({ type: "member.changed", roomId: id, data: { roomId: id } });
972
1029
  return { ok: true };
@@ -1025,6 +1082,27 @@ export class HubGroupRooms {
1025
1082
  this.emit({ type: "member.changed", roomId: id, data: { roomId: id } });
1026
1083
  return { ok: true };
1027
1084
  }
1085
+ /** Member authority is local to this room and never permits people, assistants or another owner's agents. */
1086
+ memberAgentAddition(db, id, me) {
1087
+ const member = this.member(db, id, me), room = this.room(db, id);
1088
+ if (room.assistant_for || (member.role !== "manager" && room.members_add_own_agents !== 1))
1089
+ throw new HubRoomRefusal(403, "denied");
1090
+ if (room.archived)
1091
+ throw new HubRoomRefusal(409, "archived");
1092
+ }
1093
+ async ownAgentCandidates(ctx, id, q) {
1094
+ if (q.length > 64 || /[\u0000-\u001f\u007f]/.test(q))
1095
+ throw new HubProtocolError("invalid");
1096
+ const me = await this.who(ctx);
1097
+ const check = () => this.core.atomic(db => this.memberAgentAddition(db, id, me), this.fence(ctx));
1098
+ check();
1099
+ return new HubCatalogService(this.core).withVisible(ctx, view => {
1100
+ check();
1101
+ return view.mine.filter(e => e.state === "published" && e.displayName.toLowerCase().startsWith(q.trim().toLowerCase()))
1102
+ .slice(0, 20).map(e => ({ kind: "agent", id: e.id, name: e.displayName, mine: true,
1103
+ owner: { name: this.core.atomic(db => this.name(db, me)) } }));
1104
+ });
1105
+ }
1028
1106
  /** C invitation acceptance calls this only inside its guarded exact-invitation transaction. */
1029
1107
  addAgentMember(db, tx, roomId, exposureId, owner) {
1030
1108
  const room = this.room(db, roomId);
@@ -1093,7 +1171,7 @@ export class HubGroupRooms {
1093
1171
  until = row.sequence;
1094
1172
  }
1095
1173
  const rows = db.prepare("SELECT * FROM hub_room_posts WHERE room_id=? AND sequence>=? AND COALESCE((SELECT audience_sequence FROM hub_room_post_lineage l WHERE l.post_id=hub_room_posts.id),sequence)>=? AND sequence<? AND (answer_to IS NULL OR EXISTS(SELECT 1 FROM hub_room_posts original WHERE original.id=hub_room_posts.answer_to AND original.sequence>=?)) ORDER BY sequence DESC LIMIT ?").all(id, member.joined_sequence, member.joined_sequence, until, member.joined_sequence, limit + 1);
1096
- return { messages: rows.slice(0, limit).reverse().map(row => this.projection(row)), more: rows.length > limit };
1174
+ return { messages: rows.slice(0, limit).reverse().map(row => this.projection(row, db)), more: rows.length > limit };
1097
1175
  }, this.fence(ctx));
1098
1176
  }
1099
1177
  async post(ctx, id, input) {
@@ -1239,9 +1317,10 @@ export class HubGroupRooms {
1239
1317
  const answering = this.agents.answering(db, id);
1240
1318
  // R2a: each Fleet's catalog read once (it is the owner's latest, kept by the Hub: there when the Fleet is offline).
1241
1319
  const catalogs = new Map();
1320
+ const transportState = this.core.deps.store.read();
1242
1321
  const lookOf = (fleetId, exposureId) => {
1243
1322
  if (!catalogs.has(fleetId))
1244
- catalogs.set(fleetId, this.looks ? this.looks(fleetId) : null);
1323
+ catalogs.set(fleetId, this.looks ? this.looks(fleetId, db, transportState) : null);
1245
1324
  return catalogs.get(fleetId)?.get(exposureId) ?? null;
1246
1325
  };
1247
1326
  const agents = db.prepare("SELECT * FROM hub_room_members WHERE room_id=? AND kind IN ('agent','assistant') ORDER BY kind,id").all(id).map(m => {