@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
package/dist/web-api.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { handleRequestContactApi } from "./request-contact-api.js";
2
+ import { projectRequestContextControl, projectRequestContextNeeds, requestContextControlSnapshot } from "./request-context-control-api.js";
2
3
  import { historyQuery } from './host-monitoring-history-policy.js';
3
4
  import { instructionFileSizes } from "./instruction-file-sizes.js";
4
5
  import { handleClaudeCredentials } from "./web-claude-credentials.js";
@@ -55,7 +56,7 @@ import { createHash, createHmac, randomUUID } from "node:crypto";
55
56
  import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
56
57
  import { scheduleView } from "./web-schedules.js";
57
58
  import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
58
- import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError, archiveAfterDays, cardCode } from "./scheduler/task-board.js";
59
+ import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, MAX_RECIPIENTS, TaskBoardError, archiveAfterDays, cardCode } from "./scheduler/task-board.js";
59
60
  import { TASK_REF_SEPARATOR, cardsForRefs, taskReadWay, taskRefBlock, taskRefCodes, taskRefView } from "./chat-task-refs.js";
60
61
  import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js";
61
62
  import { z } from "zod";
@@ -77,6 +78,7 @@ import { resolveToolSet } from "./tool-permissions.js";
77
78
  import { OPERATOR, isOwnerEffectKey } from "./web-prefs.js";
78
79
  import { WEB_NAME_FALLBACK, webPersonKey } from "./web-profile.js";
79
80
  import { updateAnswerLabel } from "./update-card.js";
81
+ import { isUpdateFix, SERVICE_FIX_CONFIRM } from "./update-fix.js";
80
82
  import { commitTeamCreate, commitTeamUpdate } from "./outbound-handlers.js";
81
83
  import { parseMentionQuery } from "./web-mentions.js";
82
84
  import { authorizeExplicitInstanceRemoval } from "./instance-removal.js";
@@ -159,7 +161,38 @@ const CardPatchSchema = z.object({
159
161
  projectId: z.number().int().nullable().optional(),
160
162
  log: z.string().max(BOARD_TEXT).optional(),
161
163
  comment: z.string().max(MAX_TEXT).optional(),
164
+ // Comment threads (docs/design/task-board.md): the comment this one answers, and whom it is for (the recipient chip).
165
+ replyTo: z.number().int().positive().optional(),
166
+ to: z.array(z.string().min(1).max(256)).max(MAX_RECIPIENTS).optional(),
162
167
  }).strict();
168
+ /**
169
+ * A card's comments as the public link may read them (docs/design/task-board.md, "Comment threads"): a reply to a comment kept
170
+ * out of sight reads as a comment of its own (nothing says what it answers), and an instance kept out of sight is not named as
171
+ * the one who reacted, resolved or deleted.
172
+ */
173
+ function threadsShown(comments, hiddenName) {
174
+ const ids = new Set(comments.map((e) => e.id));
175
+ return comments.map((e) => {
176
+ const { parentId, reactions, resolved, deleted, ...rest } = e;
177
+ const out = { ...rest };
178
+ if (parentId !== undefined && ids.has(parentId))
179
+ out.parentId = parentId;
180
+ const kept = (reactions ?? []).map((r) => ({ ...r, by: r.by.filter((b) => !hiddenName(b.name)) })).filter((r) => r.by.length);
181
+ if (kept.length)
182
+ out.reactions = kept;
183
+ if (resolved)
184
+ out.resolved = hiddenName(resolved.by) ? { at: resolved.at, by: "" } : resolved;
185
+ if (deleted)
186
+ out.deleted = hiddenName(deleted.by) ? { at: deleted.at, by: "" } : deleted;
187
+ return out;
188
+ });
189
+ }
190
+ /** A change to one comment of a card (docs/design/task-board.md, "Comment threads"), by the verb in the address. */
191
+ const CommentEditSchema = z.object({ text: z.string().max(MAX_TEXT) }).strict();
192
+ const CommentReactSchema = z.object({ emoji: z.string().min(1).max(64), on: z.boolean().optional() }).strict();
193
+ const CommentResolveSchema = z.object({ resolved: z.boolean().optional() }).strict();
194
+ const CommentDeleteSchema = z.object({}).strict();
195
+ const CardReadSchema = z.object({}).strict();
163
196
  const CardMoveSchema = z.object({
164
197
  to: z.enum(CARD_STATUSES),
165
198
  reason: z.string().max(BOARD_TEXT).optional(),
@@ -233,6 +266,7 @@ const safeInstanceSegment = (name) => /^[^\\/\x00]+$/.test(name) && name !== "."
233
266
  const streamGuests = new WeakMap();
234
267
  const streamContactProjection = new WeakMap();
235
268
  function contactNeedsFor(req, url, ctx, base) {
269
+ base = projectRequestContextNeeds(req, url, ctx.requestContextControl, base);
236
270
  const auth = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
237
271
  const admin = auth.kind === 'allow' && auth.via === 'session' && auth.session.tier === 'admin';
238
272
  base = admin ? base : base.filter(item => !item || typeof item !== 'object' || item.type !== 'host');
@@ -603,6 +637,8 @@ function handleAppIcon(req, res, url, ctx, method) {
603
637
  * POST /ui/update/check look now (one a minute) → the GET's answer
604
638
  * POST /ui/update/start { confirm: "update-agend" } + Idempotency-Key → 202 { started } (the progress is the GET's)
605
639
  * POST /ui/update/answer { action } + Idempotency-Key → 200 { card } (the one update offer)
640
+ * POST /ui/update/fixes { fix: "linger" } + Idempotency-Key → 200 { preflight } (M-3770 1.6: a pre-flight fix button);
641
+ * { fix: "service", confirm: "restart-as-service" } → 202 { restarting } (S-246), or 422 { reason }
606
642
  * GET /ui/update/log { text, error } — the updater's own words, for the failure's "full log"
607
643
  * Signed-in sessions only (never the CLI's token or a guest; M-3278: the public link's sessions too, as locally); an
608
644
  * admin's for all but the version. Asked again once a body is in.
@@ -613,7 +649,7 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
613
649
  json(res, 404, { error: "not found" });
614
650
  return true;
615
651
  }
616
- const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/answer": "POST", "/ui/update/log": "GET" };
652
+ const routes = { "/ui/update": "GET", "/ui/update/check": "POST", "/ui/update/start": "POST", "/ui/update/answer": "POST", "/ui/update/fixes": "POST", "/ui/update/log": "GET" };
617
653
  if (!routes[path]) {
618
654
  json(res, 404, { error: "not found" });
619
655
  return true;
@@ -664,7 +700,7 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
664
700
  body = await parseBody(req);
665
701
  }
666
702
  catch {
667
- if (path === "/ui/update/start" || path === "/ui/update/answer") {
703
+ if (path === "/ui/update/start" || path === "/ui/update/answer" || path === "/ui/update/fixes") {
668
704
  json(res, 400, { error: "Invalid JSON" });
669
705
  return;
670
706
  }
@@ -706,6 +742,30 @@ function handleWebUpdate(req, res, url, ctx, path, method) {
706
742
  json(res, answered.status, answered.ok ? { card: answered.card } : answered.body);
707
743
  return;
708
744
  }
745
+ if (path === "/ui/update/fixes") {
746
+ if (!host.fixUpdate) {
747
+ json(res, 404, { error: "unavailable" });
748
+ return;
749
+ }
750
+ const header = req.headers["idempotency-key"];
751
+ const key = typeof header === "string" ? header : "";
752
+ if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
753
+ json(res, 400, { error: "Idempotency-Key required (8-128 chars of [A-Za-z0-9_.:-])" });
754
+ return;
755
+ }
756
+ if (!isUpdateFix(body.fix)) {
757
+ json(res, 400, { error: "fix must be one of: linger, service" });
758
+ return;
759
+ }
760
+ // S-246: every Agent stops briefly — only once the page has asked.
761
+ if (body.fix === "service" && body.confirm !== SERVICE_FIX_CONFIRM) {
762
+ json(res, 400, { error: `confirm must be "${SERVICE_FIX_CONFIRM}"` });
763
+ return;
764
+ }
765
+ const fixed = await host.fixUpdate(key, now.person, body.fix, stillAllowed);
766
+ json(res, fixed.status, fixed.body);
767
+ return;
768
+ }
709
769
  const header = req.headers["idempotency-key"];
710
770
  const key = typeof header === "string" ? header : "";
711
771
  if (!/^[A-Za-z0-9_.:-]{8,128}$/.test(key)) {
@@ -2377,6 +2437,11 @@ function webIdentityOf(req, url, ctx) {
2377
2437
  const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
2378
2438
  return v.kind === "allow" && v.via === "session" ? ctx.webSessionIdentity?.(v.session) : undefined;
2379
2439
  }
2440
+ /** Exact admitted browser route, independent of whether its account can be recognised. Never from body/headers. */
2441
+ function webSessionHandleOf(req, url, ctx) {
2442
+ const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
2443
+ return v.kind === "allow" && v.via === "session" ? v.session.handle : undefined;
2444
+ }
2380
2445
  /**
2381
2446
  * #1939 S1: whether this request carries `web-session` authority, asked as it stands now — on arrival without an instance,
2382
2447
  * after the body with the one it names (then confirmAfterBody joins the two). Never touches the session.
@@ -2579,7 +2644,7 @@ function webPersonOr401(req, res, url, ctx) {
2579
2644
  */
2580
2645
  function boardActor(req, url, ctx, p) {
2581
2646
  const v = evaluateWebRequest(req, url, ctx.webToken ?? null, ctx.webSessions, { touch: false });
2582
- return v.kind === "allow" && v.via === "session" ? { kind: "person", name: p.name } : { kind: "script", name: "web-token" };
2647
+ return v.kind === "allow" && v.via === "session" ? { kind: "person", name: p.name, key: p.key } : { kind: "script", name: "web-token" };
2583
2648
  }
2584
2649
  /**
2585
2650
  * A board refusal as the dashboard reads it: the board's sentence, its code and the status that fits, and — when the
@@ -2630,6 +2695,79 @@ async function serveCardFile(res, board, id, rules) {
2630
2695
  miss();
2631
2696
  }
2632
2697
  }
2698
+ /** A notice that has not been handed to delivery this long after its comment is lost (the fleet stopped while it was gathering it). */
2699
+ const WAKE_LOST_MS = 2 * 60_000;
2700
+ /** The person's unread, by card number (the board's `unreadFor`), without a card the viewer may not see. */
2701
+ function unreadBody(board, person, gone, hidden) {
2702
+ const cards = {};
2703
+ for (const u of board.unreadFor(person, gone).cards) {
2704
+ const card = board.findCard(u.id);
2705
+ if (!card || hidden(card))
2706
+ continue;
2707
+ cards[u.id] = { n: u.n, reasons: u.reasons, entries: u.entries, at: u.at, by: u.by };
2708
+ }
2709
+ return { total: Object.keys(cards).length, cards };
2710
+ }
2711
+ /** A card's comments with the status of those written for instances (`wakeViews`); a comment nobody was meant to hear is as it was. */
2712
+ function withWakeViews(comments, stored, ctx, hiddenName) {
2713
+ if (!stored.size)
2714
+ return comments;
2715
+ // Each notice once (a gathered window of comments shares one), and none whose comment shows a skip (wakeViews reads no key for it).
2716
+ const keys = [...new Set([...stored.values()].flat().flatMap((w) => (w.key && !w.skip ? [w.key] : [])))];
2717
+ const progress = keys.length ? ctx.taskWakeProgress?.(keys) ?? new Map() : new Map();
2718
+ const now = Date.now();
2719
+ return comments.map((e) => {
2720
+ const list = stored.get(e.id);
2721
+ if (!list || e.deleted)
2722
+ return e;
2723
+ const views = wakeViews(list.filter((w) => !hiddenName(w.to)), progress, now);
2724
+ return views.length ? { ...e, wakes: views } : e;
2725
+ });
2726
+ }
2727
+ /** How far one notice got, from what the board kept (`key` / `skip`, when it was routed) and what the delivery outbox says of it. */
2728
+ function noticeState(w, progress, now) {
2729
+ if (w.skip)
2730
+ return { state: "skipped", skip: w.skip };
2731
+ if (!w.key)
2732
+ return now - Date.parse(w.at) > WAKE_LOST_MS ? { state: "skipped", skip: "lost" } : { state: "sending" };
2733
+ const p = progress.get(w.key);
2734
+ if (!p)
2735
+ return { state: "unknown" };
2736
+ switch (p.state) {
2737
+ case "delivered": return p.consumedAt ? { state: "read", readAt: p.consumedAt } : { state: "delivered" };
2738
+ case "failed": return { state: "failed", ...(p.failure ? { failure: p.failure } : {}) };
2739
+ case "uncertain": return { state: "uncertain" };
2740
+ case "cancelled": return { state: "withdrawn" };
2741
+ default: return { state: "queued" };
2742
+ }
2743
+ }
2744
+ export function wakeViews(wakes, progress, now) {
2745
+ return wakes.map((w) => ({ to: w.to, why: w.why, at: w.at, ...noticeState(w, progress, now) }));
2746
+ }
2747
+ export function handoffViews(list, progress, now) {
2748
+ return list.map((h) => {
2749
+ // (M-3908's `failure` is the comment status's: a hand-over says only that it failed.)
2750
+ const { failure: _failure, ...state } = noticeState(h, progress, now);
2751
+ return { id: h.id, card: h.card, to: h.to, why: h.why, after: h.after, at: h.at, ...state };
2752
+ });
2753
+ }
2754
+ /**
2755
+ * A card's handoffs (its own and, for a main task, those of its sub tasks) with how far each notice got — for a session that can write, never of an
2756
+ * instance kept out of sight; the card whose finishing readied one (`after`) is numbered only if the viewer may see it (`hiddenCode`: a card kept out of
2757
+ * sight reads as none, and the page says "S-2 can start" instead of "S-1 done").
2758
+ */
2759
+ export function withHandoffViews(board, ref, children, ctx, hiddenName, hiddenCode = () => false) {
2760
+ // The card read already has its sub tasks (with their uuids): only the card itself is looked up.
2761
+ const own = board.findCard(ref);
2762
+ const uuids = [...(own ? [own.uuid] : []), ...children.map((c) => c.uuid)];
2763
+ const list = board.handoffsOf(uuids).filter((h) => !hiddenName(h.to)).map((h) => (h.after && hiddenCode(h.after) ? { ...h, after: null } : h));
2764
+ if (!list.length)
2765
+ return [];
2766
+ // Each notice once (one notice can carry several hand-overs), and none whose hand-over shows a skip (handoffViews reads no key for it), as withWakeViews.
2767
+ const keys = [...new Set(list.flatMap((h) => (h.key && !h.skip ? [h.key] : [])))];
2768
+ const progress = keys.length ? ctx.taskWakeProgress?.(keys) ?? new Map() : new Map();
2769
+ return handoffViews(list, progress, Date.now());
2770
+ }
2633
2771
  function boardError(res, err) {
2634
2772
  if (res.headersSent)
2635
2773
  return;
@@ -3204,6 +3342,7 @@ export function handleWebRequest(req, res, url, ctx) {
3204
3342
  // #1386: "Needs you" rides the passive channels only — no endpoint of its own to poll. Over the public link,
3205
3343
  // without the task board's hidden cards (#2306 review).
3206
3344
  needs: visibleNeeds(ctx, linkRestricted(req, url, ctx), contactNeedsFor(req, url, ctx, ctx.needsYouItems?.() ?? [])),
3345
+ requestContextCutover: requestContextControlSnapshot(req, url, ctx.requestContextControl),
3207
3346
  // #1577: the newest message this answer accounts for — after a restart, the last restored one until this process
3208
3347
  // records its own (`<boot>-0` would be after(0): the whole restored history again on every poll).
3209
3348
  cursor: history ? history.pollCursor() : null,
@@ -3247,6 +3386,8 @@ export function handleWebRequest(req, res, url, ctx) {
3247
3386
  }
3248
3387
  if (!guest)
3249
3388
  streamContactProjection.set(res, (event, value) => {
3389
+ if (event === "request-context-control")
3390
+ return projectRequestContextControl(req, url, ctx.requestContextControl, value) ?? null;
3250
3391
  if (event === "needs")
3251
3392
  return { items: contactNeedsFor(req, url, ctx, (value && typeof value === "object" && Array.isArray(value.items)) ? value.items : []) };
3252
3393
  if (event === "contact-auth") {
@@ -3297,6 +3438,8 @@ export function handleWebRequest(req, res, url, ctx) {
3297
3438
  // #1386: and "Needs you" as it is now; changes follow as `needs` events.
3298
3439
  if (!guest && ctx.needsYouItems)
3299
3440
  res.write(`event: needs\ndata: ${JSON.stringify({ items: contactNeedsFor(req, url, ctx, ctx.needsYouItems()) })}\n\n`);
3441
+ if (!guest && ctx.requestContextControl)
3442
+ res.write(`event: request-context-control\ndata: ${JSON.stringify(requestContextControlSnapshot(req, url, ctx.requestContextControl) ?? null)}\n\n`);
3300
3443
  ctx.sseClients.add(res);
3301
3444
  // #1956: the heartbeat's status comes from the one build every open stream shares each tick (statusTick), with
3302
3445
  // this stream's own projection; this stream's checks stay its own.
@@ -4373,7 +4516,7 @@ export function handleWebRequest(req, res, url, ctx) {
4373
4516
  // #1920 review: a guest's choice reaches the agent marked as a guest's, as its typed messages do.
4374
4517
  const { authority } = confirmAfterBody(arrival, webAuthorityOf(req, url, ctx, instance));
4375
4518
  const identity = webIdentityOf(req, url, ctx);
4376
- const r = await click(instance, id, index, { key: person.voterKey, userId: person.userId, name: person.name, ...(guest ? { guest: true } : {}), authority, ...(identity ? { identity } : {}) });
4519
+ const r = await click(instance, id, index, { key: person.voterKey, userId: person.userId, name: person.name, ...(guest ? { guest: true } : {}), authority, ...(identity ? { identity } : {}), sessionHandle: webSessionHandleOf(req, url, ctx) });
4377
4520
  json(res, r.status, r.status === 200 ? { answered: true, ...(r.options ? { options: r.options } : {}) } : { error: r.error ?? "Refused", ...(r.status === 409 ? { gone: true } : {}) });
4378
4521
  })().catch(err => {
4379
4522
  ctx.logger.error({ err: err.message }, "Web reply-button click failed");
@@ -5135,7 +5278,7 @@ export function handleWebRequest(req, res, url, ctx) {
5135
5278
  const r = await run({ instance, command, args: str(body.args, MAX_COMMAND_ARGS), confirm: body.confirm, ...(body.action ? { action: body.action } : {}) },
5136
5279
  // M-3278 (decision 7933bf90): `publicLink` is a request over the link by anyone but an admin session — the link's
5137
5280
  // admin runs /save and gets /model and /backend's Sign in, as on the local dashboard.
5138
- { publicLink: !!gatewayRequestContext(req) && !adminAdmissionOf(req, url, ctx), person, authority, ...(identity ? { identity } : {}), ...(guest ? { guest: true } : {}) });
5281
+ { publicLink: !!gatewayRequestContext(req) && !adminAdmissionOf(req, url, ctx), person, authority, ...(identity ? { identity } : {}), sessionHandle: webSessionHandleOf(req, url, ctx), ...(guest ? { guest: true } : {}) });
5139
5282
  if (!stillAuthorized(req, res, url, ctx))
5140
5283
  return;
5141
5284
  json(res, r.status, r.body);
@@ -5462,11 +5605,18 @@ export function handleWebRequest(req, res, url, ctx) {
5462
5605
  }
5463
5606
  // ── Task board (scheduler/task-board.ts) ──────────────
5464
5607
  // Reads are the session's; every write is the signed-in person's, through the same rules an instance's tools use.
5465
- if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/refs" || path === "/ui/tasks/work" || path === "/ui/tasks/archive" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects") || path.startsWith("/ui/tasks/files/")) {
5608
+ if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/refs" || path === "/ui/tasks/work" || path === "/ui/tasks/archive" || path === "/ui/tasks/unread" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects") || path.startsWith("/ui/tasks/files/")) {
5466
5609
  const board = ctx.scheduler?.db.board;
5467
5610
  // M-3668: how many days after it finished a main task leaves the board (defaults.task_board.archive_after_days).
5468
5611
  const archiveDays = archiveAfterDays(ctx.fleetConfig?.defaults?.task_board?.archive_after_days);
5469
5612
  if (!board) {
5613
+ // The page asks for the person's unread on every admin page (task-unread.js), so a fleet with no task board answers it as it does a
5614
+ // session that has none — nothing — and not with an error the browser logs as one.
5615
+ if (method === "GET" && path === "/ui/tasks/unread") {
5616
+ res.setHeader("Cache-Control", "no-store");
5617
+ json(res, 200, { enabled: false, total: 0, cards: {} });
5618
+ return true;
5619
+ }
5470
5620
  json(res, 503, { error: "The task board is not available", code: "unavailable", key: "unavailable" });
5471
5621
  return true;
5472
5622
  }
@@ -5547,11 +5697,15 @@ export function handleWebRequest(req, res, url, ctx) {
5547
5697
  // A main task kept out of sight is not named here either: its watchers go with it (the `parent` above reads as none).
5548
5698
  inheritedWatchers: d.card.parentId && hiddenRef(d.card.parentId) ? [] : d.inheritedWatchers.filter((n) => !hiddenName(n)),
5549
5699
  leader: d.leader && hiddenName(d.leader.name) ? null : d.leader, // as a project's hidden lead: read as none
5550
- comments: d.comments.filter((e) => !hiddenName(e.author)),
5700
+ comments: threadsShown(d.comments.filter((e) => !hiddenName(e.author)), hiddenName),
5551
5701
  logs: d.logs.filter((e) => !hiddenName(e.author)),
5552
5702
  history: d.history.filter((e) => !hiddenName(e.actor) && !mentionsHidden(e.data)).flatMap((e) => unnumberedEvent(e) ?? []),
5703
+ // A sub task kept out of sight has no moves here, nor does one a hidden instance made.
5704
+ subEvents: d.subEvents.filter((e) => !hiddenCode(e.card) && !hiddenName(e.actor) && !mentionsHidden(e.data)),
5553
5705
  };
5554
5706
  const card = /^\/ui\/tasks\/cards\/([^/]+)(?:\/(move|reorder|watchers))?$/.exec(path);
5707
+ const comment = /^\/ui\/tasks\/cards\/([^/]+)\/comments\/(\d{1,12})\/(edit|react|resolve|delete)$/.exec(path);
5708
+ const opened = /^\/ui\/tasks\/cards\/([^/]+)\/read$/.exec(path);
5555
5709
  const project = /^\/ui\/tasks\/projects\/(\d+)$/.exec(path);
5556
5710
  try {
5557
5711
  const ref = card ? decodeURIComponent(card[1]) : "";
@@ -5593,6 +5747,30 @@ export function handleWebRequest(req, res, url, ctx) {
5593
5747
  jsonText(res, 200, body);
5594
5748
  return true;
5595
5749
  }
5750
+ // What is new for this person (docs/design/task-board.md, "Unread"): the cards someone answered, named them on or handed them to
5751
+ // confirm or answer. Theirs alone — an admin session's name; a read-only reader has no one, so no unread, no mark. Never cached
5752
+ // (it moves with every comment) and never carries a hidden instance's card.
5753
+ if (method === "GET" && path === "/ui/tasks/unread") {
5754
+ res.setHeader("Cache-Control", "no-store");
5755
+ const reader = adminAdmissionOf(req, url, ctx) ? webPersonOf(req, url, ctx) : null;
5756
+ const who = reader ? boardActor(req, url, ctx, reader) : null;
5757
+ if (!who || who.kind !== "person") {
5758
+ json(res, 200, { enabled: false, total: 0, cards: {} });
5759
+ return true;
5760
+ }
5761
+ json(res, 200, { enabled: true, ...unreadBody(board, who, ctx.dispatcherGone, hidden) });
5762
+ return true;
5763
+ }
5764
+ if (method === "POST" && opened) {
5765
+ // They opened the card: all of it so far is read. A card kept out of sight is "no such card", as everywhere.
5766
+ const cardRef = decodeURIComponent(opened[1]);
5767
+ if (hidden(board.getCard(cardRef))) {
5768
+ json(res, 404, { error: "no such card", code: "not_found" });
5769
+ return true;
5770
+ }
5771
+ boardWrite(req, res, url, ctx, board, CardReadSchema, (_body, person) => { board.markRead(person, cardRef); return { ok: true, ...unreadBody(board, person, ctx.dispatcherGone, hidden) }; });
5772
+ return true;
5773
+ }
5596
5774
  if (method === "GET" && path === "/ui/tasks/work") {
5597
5775
  // #2246 step 3: each instance's work on the board — what its `task mine` reads (myWork) — for the board's
5598
5776
  // Instance list and an instance's Details page (`?instance=`): the fleet's instances and anyone else a live
@@ -5673,7 +5851,22 @@ export function handleWebRequest(req, res, url, ctx) {
5673
5851
  json(res, 404, { error: "no such card", code: "not_found" });
5674
5852
  return true;
5675
5853
  }
5676
- json(res, 200, { ...shown(board.detail(ref, scope, ctx.dispatcherGone)), ...(board.isArchived(found, archiveDays) ? { archived: true, archiveAfterDays: archiveDays } : {}) });
5854
+ // `viewer`: who this request writes as — an admin session's person — so the page knows which comments are theirs to edit
5855
+ // (and that it may react, resolve and delete); none for a read-only session, the CLI's token or a guest.
5856
+ const viewerPerson = adminAdmissionOf(req, url, ctx) ? webPersonOf(req, url, ctx) : null;
5857
+ const viewer = viewerPerson ? boardActor(req, url, ctx, viewerPerson) : null;
5858
+ const read = shown(board.detail(ref, scope, ctx.dispatcherGone));
5859
+ // The comment status: only to a session that can write (it is the writer's feedback), and never of an instance kept out of sight.
5860
+ const withStatus = viewer ? withWakeViews(read.comments, board.entryWakes(ref), ctx, hiddenName) : read.comments;
5861
+ // Each comment says whether it is the viewer's (two people who are both "web-user" are told apart by their key, not their name).
5862
+ const mine = viewer && viewer.kind === "person" ? board.commentsWrittenBy(ref, viewer) : null;
5863
+ // And which reactions are theirs: by the same key, so two people with one name do not press each other's chip.
5864
+ const reacted = viewer && viewer.kind === "person" ? board.reactedBy(ref, viewer) : null;
5865
+ const shownComments = mine ? withStatus.map((e) => ({ ...e, mine: mine.has(e.id), ...(e.reactions ? { reactions: e.reactions.map((r) => ({ ...r, mine: !!reacted?.has(`${e.id}|${r.emoji}`) })) } : {}) })) : withStatus;
5866
+ // The handoffs, like the comment status, only to a session that can write (the delivery's state is the writer's feedback).
5867
+ const handoffs = viewer ? withHandoffViews(board, ref, read.children, ctx, hiddenName, hiddenCode) : [];
5868
+ json(res, 200, { ...read, comments: shownComments, ...(mine ? { viewer: { name: viewer.name, kind: viewer.kind } } : {}), ...(handoffs.length ? { handoffs } : {}),
5869
+ ...(board.isArchived(found, archiveDays) ? { archived: true, archiveAfterDays: archiveDays } : {}) });
5677
5870
  return true;
5678
5871
  }
5679
5872
  if (method === "GET" && path === "/ui/tasks/archive") {
@@ -5700,6 +5893,30 @@ export function handleWebRequest(req, res, url, ctx) {
5700
5893
  });
5701
5894
  return true;
5702
5895
  }
5896
+ if (method === "POST" && comment) {
5897
+ // One comment of a card: edit, react, resolve, delete. A card kept out of sight is "no such card"; over the link only an
5898
+ // admin session gets here (above), and it sees the board whole.
5899
+ const cardRef = decodeURIComponent(comment[1]), entryId = Number(comment[2]);
5900
+ const found = board.getCard(cardRef);
5901
+ if (hidden(found)) {
5902
+ json(res, 404, { error: "no such card", code: "not_found" });
5903
+ return true;
5904
+ }
5905
+ const answer = (done) => ({ card: board.view(done.card, {}, ctx.dispatcherGone), comment: done.entry, notes: done.said });
5906
+ switch (comment[3]) {
5907
+ case "edit":
5908
+ boardWrite(req, res, url, ctx, board, CommentEditSchema, ({ text }, person) => answer(board.editComment(person, cardRef, entryId, text)));
5909
+ break;
5910
+ case "react":
5911
+ boardWrite(req, res, url, ctx, board, CommentReactSchema, ({ emoji, on }, person) => answer(board.react(person, cardRef, entryId, emoji, on !== false)));
5912
+ break;
5913
+ case "resolve":
5914
+ boardWrite(req, res, url, ctx, board, CommentResolveSchema, ({ resolved }, person) => answer(board.resolveThread(person, cardRef, entryId, resolved !== false)));
5915
+ break;
5916
+ default: boardWrite(req, res, url, ctx, board, CommentDeleteSchema, (_body, person) => answer(board.deleteComment(person, cardRef, entryId)));
5917
+ }
5918
+ return true;
5919
+ }
5703
5920
  if (method === "POST" && card) {
5704
5921
  if (card[2] === "move") {
5705
5922
  boardWrite(req, res, url, ctx, board, CardMoveSchema, ({ to, ...move }, person) => {
@@ -6409,7 +6626,7 @@ async function handleResendMessage(req, res, ctx) {
6409
6626
  } };
6410
6627
  let handedOff = false;
6411
6628
  try {
6412
- const delivered = ctx.deliverHumanToInstance ? await ctx.deliverHumanToInstance(instance, payload, webHumanOrigin(false, authority, webIdentityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx)), row.text, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
6629
+ const delivered = ctx.deliverHumanToInstance ? await ctx.deliverHumanToInstance(instance, payload, webHumanOrigin(false, authority, webIdentityOf(req, url, ctx), !!guest, webSessionHandleOf(req, url, ctx)), row.text, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
6413
6630
  : await ctx.deliverToInstance(instance, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
6414
6631
  if (delivered === false)
6415
6632
  throw new Error("delivery changed");
@@ -6661,7 +6878,7 @@ function handleSendMessage(req, res, ctx) {
6661
6878
  const reactions = ctx.pendingReactionsMeta?.(instance) ?? { meta: {}, consume: () => { } };
6662
6879
  try {
6663
6880
  const deliver = (name, payload) => ctx.deliverHumanToInstance
6664
- ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority, webIdentityOf(req, new URL(req.url ?? "/", "http://localhost"), ctx)), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
6881
+ ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority, webIdentityOf(req, requestUrl, ctx), !!guest, webSessionHandleOf(req, requestUrl, ctx)), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
6665
6882
  : ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
6666
6883
  delivered = await deliver(instance, {
6667
6884
  type: "fleet_inbound",
@@ -7212,12 +7429,16 @@ export function serveHubWorkspaceShell(res, hub) {
7212
7429
  const html = readFileSync(join(__dirname, "ui", "app.html"), "utf-8").replace(HUB_SHELL_DROPS, "");
7213
7430
  const attr = (v) => v.replace(/[&<>"']/g, c => `&#${c.charCodeAt(0)};`);
7214
7431
  const name = hubNameOf(hub.name);
7432
+ // The Hub has not checked this browser's session yet. Its pre-module frame
7433
+ // matches SessionLoading, rather than the Fleet's workspace-shaped skeleton.
7434
+ const neutral = `<main id="main" class="session-loading-page" role="status" aria-busy="true" aria-label="Loading…"><div class="skeleton sk-inline" aria-hidden="true"><div class="sk-line"></div></div></main>`;
7435
+ const page = html.replace(/<!--app-boot-->[\s\S]*?<!--\/app-boot-->/, neutral);
7215
7436
  const preview = hub.preview;
7216
7437
  const previewAttrs = preview ? ` data-dashboard-origin="${attr(preview.dashboardOrigin)}"`
7217
7438
  + (preview.previewOrigin && preview.bootId ? ` data-preview-origin="${attr(preview.previewOrigin)}" data-preview-boot="${attr(preview.bootId)}"`
7218
7439
  : ` data-preview-reason-code="${attr(preview.reasonCode ?? "notOffered")}" data-preview-reason="${attr(preview.reason ?? "")}"`) : "";
7219
7440
  const body = `<body data-mode="full" data-web-transport="none" data-usage-panel="0" data-log-tab="0" data-hub="hub"${name ? ` data-hub-name="${attr(name)}"` : ""}${hub.loginWithoutAt ? ` data-hub-login="no-at"` : ""}${previewAttrs}>`;
7220
- sendPanelHtml(res, withAppIconLinks(html).replace("<body>", body), 200, { "Cache-Control": "no-store" }, { mediaSrc: "'none'", ...(preview?.previewOrigin ? { frameSrc: `${preview.previewOrigin}/frame` } : {}) });
7441
+ sendPanelHtml(res, withAppIconLinks(page, "hub").replace("<body>", body), 200, { "Cache-Control": "no-store" }, { mediaSrc: "'none'", ...(preview?.previewOrigin ? { frameSrc: `${preview.previewOrigin}/frame` } : {}) });
7221
7442
  }
7222
7443
  catch {
7223
7444
  json(res, 500, { error: "app.html not found" });
@@ -7256,7 +7477,7 @@ export function shellPreload(mode, guest, path, workspace) {
7256
7477
  if (!guest) {
7257
7478
  if (panel && panel !== "chat" && panel !== "view" && PANEL_MODULES[panel])
7258
7479
  entries.push(PANEL_MODULES[panel]);
7259
- entries.push("/ui/js/backend-signin.js", "/ui/js/agent-proposals.js");
7480
+ entries.push("/ui/js/backend-signin.js", "/ui/js/agent-proposals.js", "/ui/js/task-unread.js");
7260
7481
  if (workspace)
7261
7482
  entries.push("/ui/js/chat-workspace.js", PANEL_MODULES.details, PANEL_MODULES.log, PANEL_MODULES.view);
7262
7483
  }