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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/dist/agent-cli-instructions.md +13 -7
  2. package/dist/agent-cli.js +149 -49
  3. package/dist/agent-cli.js.map +1 -1
  4. package/dist/agent-export.d.ts +3 -1
  5. package/dist/agent-export.js +18 -1
  6. package/dist/agent-export.js.map +1 -1
  7. package/dist/agent-whats-new.js +9 -0
  8. package/dist/agent-whats-new.js.map +1 -1
  9. package/dist/apply-job.d.ts +2 -2
  10. package/dist/auth-api.js +1 -1
  11. package/dist/auth-api.js.map +1 -1
  12. package/dist/backend/claude-code.d.ts +0 -6
  13. package/dist/backend/claude-code.js +23 -3
  14. package/dist/backend/claude-code.js.map +1 -1
  15. package/dist/backend/codex-precaution.js +3 -2
  16. package/dist/backend/codex-precaution.js.map +1 -1
  17. package/dist/backend/codex.js +1 -1
  18. package/dist/backend/codex.js.map +1 -1
  19. package/dist/backend/types.d.ts +6 -0
  20. package/dist/backend/types.js.map +1 -1
  21. package/dist/build-provenance.json +1 -1
  22. package/dist/channel/mcp-server.js +8 -2
  23. package/dist/channel/mcp-server.js.map +1 -1
  24. package/dist/channel/mcp-tools.d.ts +27 -1
  25. package/dist/channel/mcp-tools.js +77 -7
  26. package/dist/channel/mcp-tools.js.map +1 -1
  27. package/dist/chat-task-refs.d.ts +61 -0
  28. package/dist/chat-task-refs.js +112 -0
  29. package/dist/chat-task-refs.js.map +1 -0
  30. package/dist/classic-channel-manager.d.ts +1 -1
  31. package/dist/classic-channel-manager.js +6 -2
  32. package/dist/classic-channel-manager.js.map +1 -1
  33. package/dist/claude-credential-launch.d.ts +6 -0
  34. package/dist/claude-credential-launch.js +16 -3
  35. package/dist/claude-credential-launch.js.map +1 -1
  36. package/dist/claude-credential-runner.js +3 -1
  37. package/dist/claude-credential-runner.js.map +1 -1
  38. package/dist/claude-setup-token-transport.js +25 -3
  39. package/dist/claude-setup-token-transport.js.map +1 -1
  40. package/dist/cli-audited.js +5 -5
  41. package/dist/cli-audited.js.map +1 -1
  42. package/dist/composite-tools.d.ts +11 -0
  43. package/dist/composite-tools.js +29 -0
  44. package/dist/composite-tools.js.map +1 -0
  45. package/dist/config-validator.js +22 -1
  46. package/dist/config-validator.js.map +1 -1
  47. package/dist/config.js +11 -0
  48. package/dist/config.js.map +1 -1
  49. package/dist/contact-auth-policy.d.ts +1 -0
  50. package/dist/contact-auth-policy.js +2 -1
  51. package/dist/contact-auth-policy.js.map +1 -1
  52. package/dist/contact-auth-service.js +2 -0
  53. package/dist/contact-auth-service.js.map +1 -1
  54. package/dist/contact-auth-store.js +21 -6
  55. package/dist/contact-auth-store.js.map +1 -1
  56. package/dist/contact-auth-types.d.ts +2 -0
  57. package/dist/contact-auth-types.js.map +1 -1
  58. package/dist/daemon.js +4 -0
  59. package/dist/daemon.js.map +1 -1
  60. package/dist/darwin-memory.js +2 -1
  61. package/dist/darwin-memory.js.map +1 -1
  62. package/dist/dashboard-permissions.d.ts +1 -8
  63. package/dist/dashboard-permissions.js +8 -9
  64. package/dist/dashboard-permissions.js.map +1 -1
  65. package/dist/delivery-outbox.d.ts +0 -6
  66. package/dist/delivery-outbox.js +0 -25
  67. package/dist/delivery-outbox.js.map +1 -1
  68. package/dist/delivery-outbox.test.js +132 -96
  69. package/dist/delivery-outbox.test.js.map +1 -1
  70. package/dist/fleet-manager.d.ts +45 -7
  71. package/dist/fleet-manager.js +309 -99
  72. package/dist/fleet-manager.js.map +1 -1
  73. package/dist/fleet-windows-runtime.d.ts +1 -1
  74. package/dist/fleet-windows-runtime.js +8 -1
  75. package/dist/fleet-windows-runtime.js.map +1 -1
  76. package/dist/fleet-yaml-stringify.d.ts +1 -1
  77. package/dist/fleet-yaml-stringify.js +64 -11
  78. package/dist/fleet-yaml-stringify.js.map +1 -1
  79. package/dist/general-knowledge/skills/concepts/SKILL.md +53 -4
  80. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +4 -0
  81. package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
  82. package/dist/general-knowledge/skills/hub/SKILL.md +2 -0
  83. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
  84. package/dist/general-knowledge/skills/model-discovery/SKILL.md +3 -2
  85. package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
  86. package/dist/general-knowledge/skills/task-board/SKILL.md +63 -0
  87. package/dist/general-knowledge/skills/web-appearance/SKILL.md +25 -2
  88. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +38 -9
  89. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +4 -0
  90. package/dist/general-knowledge/steering/core-rules.md +15 -78
  91. package/dist/general-role-block.d.ts +19 -0
  92. package/dist/general-role-block.js +56 -0
  93. package/dist/general-role-block.js.map +1 -0
  94. package/dist/general-role.d.ts +1 -1
  95. package/dist/general-role.js +1 -0
  96. package/dist/general-role.js.map +1 -1
  97. package/dist/host-memory.d.ts +3 -0
  98. package/dist/host-memory.js.map +1 -1
  99. package/dist/host-monitoring/darwin/collector.d.ts +18 -0
  100. package/dist/host-monitoring/darwin/collector.js +65 -0
  101. package/dist/host-monitoring/darwin/collector.js.map +1 -0
  102. package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
  103. package/dist/host-monitoring/darwin/defaults.js +9 -0
  104. package/dist/host-monitoring/darwin/defaults.js.map +1 -0
  105. package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
  106. package/dist/host-monitoring/darwin/interpretation.js +73 -0
  107. package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
  108. package/dist/host-monitoring/linux/collector.d.ts +17 -0
  109. package/dist/host-monitoring/linux/collector.js +55 -0
  110. package/dist/host-monitoring/linux/collector.js.map +1 -0
  111. package/dist/host-monitoring/linux/defaults.d.ts +2 -0
  112. package/dist/host-monitoring/linux/defaults.js +9 -0
  113. package/dist/host-monitoring/linux/defaults.js.map +1 -0
  114. package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
  115. package/dist/host-monitoring/linux/interpretation.js +76 -0
  116. package/dist/host-monitoring/linux/interpretation.js.map +1 -0
  117. package/dist/host-monitoring/transport.d.ts +42 -0
  118. package/dist/host-monitoring/transport.js +101 -0
  119. package/dist/host-monitoring/transport.js.map +1 -0
  120. package/dist/host-monitoring/wsl/collector.d.ts +19 -0
  121. package/dist/host-monitoring/wsl/collector.js +72 -0
  122. package/dist/host-monitoring/wsl/collector.js.map +1 -0
  123. package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
  124. package/dist/host-monitoring/wsl/defaults.js +9 -0
  125. package/dist/host-monitoring/wsl/defaults.js.map +1 -0
  126. package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
  127. package/dist/host-monitoring/wsl/interpretation.js +77 -0
  128. package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
  129. package/dist/host-monitoring-alert-policy.d.ts +2 -0
  130. package/dist/host-monitoring-alert-policy.js +4 -2
  131. package/dist/host-monitoring-alert-policy.js.map +1 -1
  132. package/dist/host-monitoring-alert-settings.d.ts +3 -1
  133. package/dist/host-monitoring-alert-settings.js +7 -2
  134. package/dist/host-monitoring-alert-settings.js.map +1 -1
  135. package/dist/host-monitoring-alerts.d.ts +3 -0
  136. package/dist/host-monitoring-alerts.js +18 -3
  137. package/dist/host-monitoring-alerts.js.map +1 -1
  138. package/dist/host-monitoring-defaults.d.ts +19 -0
  139. package/dist/host-monitoring-defaults.js +10 -0
  140. package/dist/host-monitoring-defaults.js.map +1 -0
  141. package/dist/host-monitoring-platform.d.ts +18 -70
  142. package/dist/host-monitoring-platform.js +14 -269
  143. package/dist/host-monitoring-platform.js.map +1 -1
  144. package/dist/host-monitoring.d.ts +13 -0
  145. package/dist/host-monitoring.js.map +1 -1
  146. package/dist/hub/agent-catalog-model.d.ts +21 -0
  147. package/dist/hub/agent-catalog-model.js +9 -1
  148. package/dist/hub/agent-catalog-model.js.map +1 -1
  149. package/dist/hub/agent-catalog.d.ts +4 -1
  150. package/dist/hub/agent-catalog.js +11 -0
  151. package/dist/hub/agent-catalog.js.map +1 -1
  152. package/dist/hub/catalog.js +12 -0
  153. package/dist/hub/catalog.js.map +1 -1
  154. package/dist/hub/client.js +4 -1
  155. package/dist/hub/client.js.map +1 -1
  156. package/dist/hub/compose/member.d.ts +5 -0
  157. package/dist/hub/compose/member.js +25 -5
  158. package/dist/hub/compose/member.js.map +1 -1
  159. package/dist/hub/compose/server.d.ts +2 -0
  160. package/dist/hub/compose/server.js +4 -2
  161. package/dist/hub/compose/server.js.map +1 -1
  162. package/dist/hub/http/compose.d.ts +5 -0
  163. package/dist/hub/http/compose.js +25 -2
  164. package/dist/hub/http/compose.js.map +1 -1
  165. package/dist/hub/http/deps.d.ts +2 -0
  166. package/dist/hub/http/schema.js +4 -0
  167. package/dist/hub/http/schema.js.map +1 -1
  168. package/dist/hub/lapse-carry.d.ts +45 -0
  169. package/dist/hub/lapse-carry.js +62 -0
  170. package/dist/hub/lapse-carry.js.map +1 -0
  171. package/dist/hub/member/agent-catalog.d.ts +4 -1
  172. package/dist/hub/member/agent-catalog.js +15 -4
  173. package/dist/hub/member/agent-catalog.js.map +1 -1
  174. package/dist/hub/member/agent-intro.d.ts +4 -3
  175. package/dist/hub/member/agent-intro.js +7 -0
  176. package/dist/hub/member/agent-intro.js.map +1 -1
  177. package/dist/hub/member/exposure-api.d.ts +2 -0
  178. package/dist/hub/member/exposure-api.js +8 -1
  179. package/dist/hub/member/exposure-api.js.map +1 -1
  180. package/dist/hub/member/room-post.d.ts +34 -6
  181. package/dist/hub/member/room-post.js +30 -0
  182. package/dist/hub/member/room-post.js.map +1 -1
  183. package/dist/hub/member/sharing.d.ts +2 -0
  184. package/dist/hub/member/sharing.js +9 -2
  185. package/dist/hub/member/sharing.js.map +1 -1
  186. package/dist/hub/protocol.d.ts +2 -0
  187. package/dist/hub/room-brief-model.js +2 -1
  188. package/dist/hub/room-brief-model.js.map +1 -1
  189. package/dist/hub/rooms/agents.d.ts +2 -0
  190. package/dist/hub/rooms/agents.js +16 -2
  191. package/dist/hub/rooms/agents.js.map +1 -1
  192. package/dist/hub/rooms/office.d.ts +82 -0
  193. package/dist/hub/rooms/office.js +46 -0
  194. package/dist/hub/rooms/office.js.map +1 -0
  195. package/dist/hub/rooms/service.d.ts +66 -1
  196. package/dist/hub/rooms/service.js +67 -11
  197. package/dist/hub/rooms/service.js.map +1 -1
  198. package/dist/hub/rooms/types.d.ts +4 -0
  199. package/dist/hub/runtime.d.ts +1 -1
  200. package/dist/hub/server.js +9 -2
  201. package/dist/hub/server.js.map +1 -1
  202. package/dist/hub/sharing-requests.d.ts +5 -2
  203. package/dist/hub/sharing-requests.js +19 -4
  204. package/dist/hub/sharing-requests.js.map +1 -1
  205. package/dist/instance-config-impact.js +1 -1
  206. package/dist/instance-config-impact.js.map +1 -1
  207. package/dist/instance-lifecycle.js +6 -7
  208. package/dist/instance-lifecycle.js.map +1 -1
  209. package/dist/instruction-file-sizes.d.ts +46 -0
  210. package/dist/instruction-file-sizes.js +115 -0
  211. package/dist/instruction-file-sizes.js.map +1 -0
  212. package/dist/instructions.d.ts +35 -1
  213. package/dist/instructions.js +59 -33
  214. package/dist/instructions.js.map +1 -1
  215. package/dist/locale.js +16 -4
  216. package/dist/locale.js.map +1 -1
  217. package/dist/log-steps.d.ts +5 -0
  218. package/dist/log-steps.js +6 -2
  219. package/dist/log-steps.js.map +1 -1
  220. package/dist/memory-guidance.d.ts +5 -0
  221. package/dist/memory-guidance.js +14 -0
  222. package/dist/memory-guidance.js.map +1 -0
  223. package/dist/model-defaults.d.ts +5 -0
  224. package/dist/model-defaults.js +6 -0
  225. package/dist/model-defaults.js.map +1 -0
  226. package/dist/native-mcp.d.ts +2 -0
  227. package/dist/native-mcp.js +16 -6
  228. package/dist/native-mcp.js.map +1 -1
  229. package/dist/needs-you-hub.d.ts +2 -0
  230. package/dist/needs-you-hub.js +6 -1
  231. package/dist/needs-you-hub.js.map +1 -1
  232. package/dist/needs-you.d.ts +13 -1
  233. package/dist/needs-you.js +5 -0
  234. package/dist/needs-you.js.map +1 -1
  235. package/dist/outbound-handlers.d.ts +3 -3
  236. package/dist/outbound-schemas.d.ts +3 -0
  237. package/dist/outbound-schemas.js +27 -26
  238. package/dist/outbound-schemas.js.map +1 -1
  239. package/dist/quickstart.d.ts +1 -1
  240. package/dist/quickstart.js +2 -3
  241. package/dist/quickstart.js.map +1 -1
  242. package/dist/remote-card-prompt.d.ts +1 -0
  243. package/dist/remote-card-prompt.js +1 -1
  244. package/dist/remote-card-prompt.js.map +1 -1
  245. package/dist/runtime-build-info.js +1 -1
  246. package/dist/runtime-build-info.js.map +1 -1
  247. package/dist/runtime-cli-install.js +5 -5
  248. package/dist/runtime-cli-install.js.map +1 -1
  249. package/dist/runtime-pane-mcp.js +7 -3
  250. package/dist/runtime-pane-mcp.js.map +1 -1
  251. package/dist/runtime-pane-native.js +2 -1
  252. package/dist/runtime-pane-native.js.map +1 -1
  253. package/dist/scheduler/db.js +2 -0
  254. package/dist/scheduler/db.js.map +1 -1
  255. package/dist/scheduler/task-board-mentions.d.ts +32 -0
  256. package/dist/scheduler/task-board-mentions.js +97 -0
  257. package/dist/scheduler/task-board-mentions.js.map +1 -0
  258. package/dist/scheduler/task-board-text.js +3 -0
  259. package/dist/scheduler/task-board-text.js.map +1 -1
  260. package/dist/scheduler/task-board.d.ts +199 -3
  261. package/dist/scheduler/task-board.js +492 -7
  262. package/dist/scheduler/task-board.js.map +1 -1
  263. package/dist/settings-api.d.ts +3 -1
  264. package/dist/settings-api.js +23 -4
  265. package/dist/settings-api.js.map +1 -1
  266. package/dist/settings-change.js +4 -2
  267. package/dist/settings-change.js.map +1 -1
  268. package/dist/settings-effect.js +1 -1
  269. package/dist/settings-effect.js.map +1 -1
  270. package/dist/settings-instance-patch.js +3 -1
  271. package/dist/settings-instance-patch.js.map +1 -1
  272. package/dist/setup-host.d.ts +2 -3
  273. package/dist/setup-host.js +3 -5
  274. package/dist/setup-host.js.map +1 -1
  275. package/dist/setup-wizard.js +0 -2
  276. package/dist/setup-wizard.js.map +1 -1
  277. package/dist/shared-default-adoption.d.ts +24 -0
  278. package/dist/shared-default-adoption.js +73 -0
  279. package/dist/shared-default-adoption.js.map +1 -0
  280. package/dist/subagent-records.d.ts +2 -0
  281. package/dist/subagent-records.js +11 -1
  282. package/dist/subagent-records.js.map +1 -1
  283. package/dist/subagent-service.d.ts +3 -0
  284. package/dist/subagent-service.js +24 -4
  285. package/dist/subagent-service.js.map +1 -1
  286. package/dist/task-board-tool.d.ts +31 -0
  287. package/dist/task-board-tool.js +31 -0
  288. package/dist/task-board-tool.js.map +1 -1
  289. package/dist/task-board-waker.d.ts +23 -30
  290. package/dist/task-board-waker.js +136 -97
  291. package/dist/task-board-waker.js.map +1 -1
  292. package/dist/types.d.ts +23 -0
  293. package/dist/ui/agent-details-settings.js +2 -2
  294. package/dist/ui/agent-export-dialog.js +4 -3
  295. package/dist/ui/agent-export-strings.js +4 -4
  296. package/dist/ui/agent-page-strings.js +18 -0
  297. package/dist/ui/chat-activity-groups.js +1 -1
  298. package/dist/ui/chat-activity.js +17 -0
  299. package/dist/ui/chat-store.js +13 -4
  300. package/dist/ui/chat-task-ref-strings.js +24 -0
  301. package/dist/ui/chat-task-refs.js +129 -0
  302. package/dist/ui/claude-setup-token.js +3 -3
  303. package/dist/ui/contact-auth-strings.js +33 -3
  304. package/dist/ui/contact-authorizations.js +17 -24
  305. package/dist/ui/contact-grant-editor.js +50 -0
  306. package/dist/ui/contact-permissions.js +21 -8
  307. package/dist/ui/fleet-office-card.js +18 -14
  308. package/dist/ui/fleet-office.js +29 -17
  309. package/dist/ui/fleet-task-activity.js +362 -0
  310. package/dist/ui/fleet-task-card.js +317 -314
  311. package/dist/ui/fleet-task-common.js +99 -9
  312. package/dist/ui/fleet-task-create.js +67 -0
  313. package/dist/ui/fleet-task-edit.js +204 -0
  314. package/dist/ui/fleet-task-follow.js +123 -0
  315. package/dist/ui/fleet-task-menu.js +1 -1
  316. package/dist/ui/fleet-task-owner.js +252 -0
  317. package/dist/ui/fleet-task-run.js +257 -0
  318. package/dist/ui/fleet-task-view.js +178 -39
  319. package/dist/ui/fleet-task-work.js +2 -2
  320. package/dist/ui/fleet-tasks.js +258 -130
  321. package/dist/ui/host-health.js +9 -6
  322. package/dist/ui/host-monitoring-darwin.js +6 -0
  323. package/dist/ui/host-monitoring-help.js +7 -0
  324. package/dist/ui/host-monitoring-linux.js +6 -0
  325. package/dist/ui/host-monitoring-wsl.js +6 -0
  326. package/dist/ui/hub-agent-copy.js +2 -0
  327. package/dist/ui/hub-client.js +4 -0
  328. package/dist/ui/hub-my-agents-strings.js +2 -0
  329. package/dist/ui/hub-my-agents.js +17 -1
  330. package/dist/ui/hub-room-composer.js +108 -5
  331. package/dist/ui/hub-room-members-strings.js +9 -2
  332. package/dist/ui/hub-room-members.js +72 -15
  333. package/dist/ui/hub-room-office.js +191 -0
  334. package/dist/ui/hub-room-purpose.js +18 -2
  335. package/dist/ui/hub-room-settings.js +8 -1
  336. package/dist/ui/hub-room-strings.js +15 -0
  337. package/dist/ui/hub-room-thread.js +51 -15
  338. package/dist/ui/hub-strings.js +1 -1
  339. package/dist/ui/log-row.js +7 -5
  340. package/dist/ui/native-instance-settings.js +4 -2
  341. package/dist/ui/panel-chat.js +96 -17
  342. package/dist/ui/panel-details.js +17 -0
  343. package/dist/ui/panel-fleet.js +1 -1
  344. package/dist/ui/panel-hub.js +4 -1
  345. package/dist/ui/panel-needs.js +11 -2
  346. package/dist/ui/panel-settings.js +57 -13
  347. package/dist/ui/settings-apply.js +8 -3
  348. package/dist/ui/settings-default-model-scope.js +40 -0
  349. package/dist/ui/settings-default-model-strings.js +43 -0
  350. package/dist/ui/settings-dialogs.js +9 -5
  351. package/dist/ui/settings-host-alerts.js +4 -3
  352. package/dist/ui/settings-host-monitoring.js +2 -1
  353. package/dist/ui/settings-hub.js +1 -1
  354. package/dist/ui/settings-layout.js +7 -2
  355. package/dist/ui/settings-model.js +9 -5
  356. package/dist/ui/settings-quota-notice.js +3 -3
  357. package/dist/ui/settings-registry.js +3 -0
  358. package/dist/ui/settings-shared-strings.js +22 -0
  359. package/dist/ui/settings-shared.js +59 -12
  360. package/dist/ui/settings-strings.js +2 -4
  361. package/dist/ui/shared/app-i18n.js +2 -2
  362. package/dist/ui/shared/app.css +124 -46
  363. package/dist/ui/shared/chat-composer.js +7 -6
  364. package/dist/ui/shared/chat-render.js +39 -1
  365. package/dist/ui/shared/chat-thread.js +8 -3
  366. package/dist/ui/shared/composer-focus.js +21 -0
  367. package/dist/ui/shared/hub-chat.css +30 -2
  368. package/dist/ui/shared/hub-rooms-u2.css +17 -0
  369. package/dist/ui/shared/task-board.css +406 -8
  370. package/dist/ui/trigger-complete.js +71 -0
  371. package/dist/web-api.d.ts +9 -0
  372. package/dist/web-api.js +128 -13
  373. package/dist/web-api.js.map +1 -1
  374. package/dist/windows-native-mcp.js +5 -2
  375. package/dist/windows-native-mcp.js.map +1 -1
  376. package/dist/workflow-templates/default.md +4 -6
  377. package/package.json +1 -1
package/dist/web-api.d.ts CHANGED
@@ -270,6 +270,15 @@ export interface WebApiContext extends ClaudeCredentialApi {
270
270
  stillCurrent?: () => boolean;
271
271
  authorityCurrent?: () => boolean;
272
272
  }): Promise<boolean | void>;
273
+ /**
274
+ * #4336 (M-3516): the reactions waiting for the agent (an Office pat or feed with Tell on, a platform reaction) as the
275
+ * `pending_reactions` meta a person's message carries — "[Recent reactions: …]" — and `consume`, called only once the
276
+ * message was accepted (a failed delivery keeps them for the next one). As a platform message's (fleet-manager).
277
+ */
278
+ pendingReactionsMeta?(instanceName: string): {
279
+ meta: Record<string, string>;
280
+ consume: () => void;
281
+ };
273
282
  getUiStatus(): unknown;
274
283
  /** Current owned pane reader shared with status; absent means context is unavailable. */
275
284
  getPaneContextSource?(name: string): PaneContextSource | null;
package/dist/web-api.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { historyQuery } from './host-monitoring-history-policy.js';
2
+ import { instructionFileSizes } from "./instruction-file-sizes.js";
2
3
  import { handleClaudeCredentials } from "./web-claude-credentials.js";
3
4
  import { pipeline } from "node:stream/promises";
4
5
  import { handleContactAuthorizationApi } from "./contact-auth-api.js";
@@ -52,7 +53,8 @@ import { createHash, createHmac, randomUUID } from "node:crypto";
52
53
  import { CreateInstanceArgs, CreateScheduleArgs, UpdateScheduleArgs, validateArgs } from "./outbound-schemas.js";
53
54
  import { scheduleView } from "./web-schedules.js";
54
55
  import { DEFAULT_SCHEDULER_CONFIG } from "./scheduler/index.js";
55
- import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError } from "./scheduler/task-board.js";
56
+ import { CARD_PRIORITIES, CARD_SIZES, CARD_STATUSES, TaskBoardError, cardCode } from "./scheduler/task-board.js";
57
+ import { TASK_REF_SEPARATOR, cardsForRefs, taskReadWay, taskRefBlock, taskRefCodes, taskRefView } from "./chat-task-refs.js";
56
58
  import { readStatuslineModel, resolveInstanceContext } from "./topic-commands.js";
57
59
  import { z } from "zod";
58
60
  import { ONBOARDING_BACKENDS } from "./backend-signin-pending.js";
@@ -89,7 +91,7 @@ import { handleNativeModelCatalog, refreshNativeModelCatalog } from "./native-mo
89
91
  import { claudeDocumentedModels } from "./model-catalog-defaults.js";
90
92
  import { shapeDocumentedClaudeModels, shapeWebModelCatalog } from "./web-model-groups.js";
91
93
  import { handleRuntimeRequest } from "./runtime-api.js";
92
- import { taskBoardOffNames } from "./dashboard-permissions.js";
94
+ import { taskBoardOffIn, taskBoardOffNames } from "./dashboard-permissions.js";
93
95
  import { topicFields } from "./instance-topic-delete.js";
94
96
  // ── Strict public-facing schemas ────────────────────────────────────────────
95
97
  // web-api endpoints must reject unknown fields so the dashboard cannot inject
@@ -162,6 +164,11 @@ const CardMoveSchema = z.object({
162
164
  comment: z.string().max(MAX_TEXT).optional(),
163
165
  version: z.number().int().optional(),
164
166
  }).strict();
167
+ /** Following a card (docs/design/task-board.md): instances to start and to stop watching it, in one write. */
168
+ const CardWatchersSchema = z.object({
169
+ add: z.array(z.string().min(1).max(256)).max(10).optional(),
170
+ remove: z.array(z.string().min(1).max(256)).max(10).optional(),
171
+ }).strict();
165
172
  const CardReorderSchema = z.object({ after: CardRef.nullable().optional(), before: CardRef.nullable().optional() }).strict();
166
173
  const ProjectCreateSchema = z.object({ name: z.string().max(256), description: z.string().max(BOARD_TEXT).optional(), leadInstance: z.string().max(256).nullable().optional() }).strict();
167
174
  /** #2352: a project's lead must be one of the fleet's instances now (the board keeps any name, as for an assignee). */
@@ -5169,6 +5176,8 @@ export function handleWebRequest(req, res, url, ctx) {
5169
5176
  effort_source,
5170
5177
  statusline,
5171
5178
  recent_activity: instanceActivity.slice(0, 20),
5179
+ // M-3522: the files the agent's CLI loads every session and their sizes (stat only), for the Details card.
5180
+ ...(room ? {} : { instruction_files: instructionFileSizes(config, backend) }),
5172
5181
  });
5173
5182
  return true;
5174
5183
  }
@@ -5292,7 +5301,7 @@ export function handleWebRequest(req, res, url, ctx) {
5292
5301
  }
5293
5302
  // ── Task board (scheduler/task-board.ts) ──────────────
5294
5303
  // Reads are the session's; every write is the signed-in person's, through the same rules an instance's tools use.
5295
- if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/work" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects")) {
5304
+ if (path === "/ui/tasks/board" || path === "/ui/tasks/search" || path === "/ui/tasks/refs" || path === "/ui/tasks/work" || path.startsWith("/ui/tasks/cards") || path.startsWith("/ui/tasks/projects")) {
5296
5305
  const board = ctx.scheduler?.db.board;
5297
5306
  if (!board) {
5298
5307
  json(res, 503, { error: "The task board is not available", code: "unavailable", key: "unavailable" });
@@ -5314,15 +5323,72 @@ export function handleWebRequest(req, res, url, ctx) {
5314
5323
  const scope = { leaveOutAuthors: gateway ? Object.keys(ctx.fleetConfig?.instances ?? {}).filter(hiddenName) : [] };
5315
5324
  const hiddenRef = (ref) => { const c = ref ? board.findCard(ref) : undefined; return !!c && hidden(c); };
5316
5325
  const mentionsHidden = (v) => (typeof v === "string" ? hiddenName(v) : !!v && typeof v === "object" && Object.values(v).some(mentionsHidden));
5326
+ // A main task kept out of sight is not numbered by its sub tasks either — a card's `parentId`, and the `parent`
5327
+ // of its "created" event, read as none over the link (the card number alone says a main task is there).
5328
+ // Nor is a card kept out of sight numbered anywhere else a card number is read: a card's `dependsOn` and
5329
+ // `unmetDeps` (a number kept out of the list), the `dependsOn` of an "updated" event's `changes` (kept out of both its
5330
+ // lists; a change that is then the same on both sides is not shown, nor an event with no change left), and the
5331
+ // `cascade` / `restored` of a sub task's "moved" event (the main task it was taken down with). Each number is looked up
5332
+ // once per request, whatever the number of cards that name it.
5333
+ const hiddenCodes = new Map();
5334
+ const hiddenCode = (code) => { let h = hiddenCodes.get(code); if (h === undefined) {
5335
+ h = hiddenRef(code);
5336
+ hiddenCodes.set(code, h);
5337
+ } return h; };
5338
+ // …`hiddenUnmet` (over the link only) says how many of the unfinished dependencies were left out, so a card that waits for
5339
+ // a card kept out of sight still reads as waiting (a clock, not "ready"): how many, never which.
5340
+ const unnumbered = (v) => {
5341
+ if (!gateway)
5342
+ return v;
5343
+ const parentId = v.parentId && hiddenCode(v.parentId) ? null : v.parentId;
5344
+ const dependsOn = v.dependsOn.filter((c) => !hiddenCode(c));
5345
+ const unmetDeps = v.unmetDeps.filter((c) => !hiddenCode(c));
5346
+ return { ...v, parentId, dependsOn, unmetDeps, hiddenUnmet: v.unmetDeps.length - unmetDeps.length };
5347
+ };
5348
+ const numbered = (v) => (Array.isArray(v) ? v.filter((c) => typeof c !== "string" || !hiddenCode(c)) : v);
5349
+ /** An event as the link may read it; null when nothing of it is left to show. */
5350
+ const unnumberedEvent = (e) => {
5351
+ const data = e.data;
5352
+ if (!data || typeof data !== "object")
5353
+ return e;
5354
+ if (e.type === "created")
5355
+ return typeof data.parent === "string" && hiddenCode(data.parent) ? { ...e, data: { ...data, parent: null } } : e;
5356
+ if (e.type === "moved") {
5357
+ const gone = ["cascade", "restored"].filter((k) => typeof data[k] === "string" && hiddenCode(data[k]));
5358
+ if (!gone.length)
5359
+ return e;
5360
+ const rest = { ...data };
5361
+ for (const k of gone)
5362
+ delete rest[k];
5363
+ return { ...e, data: rest };
5364
+ }
5365
+ if (e.type === "updated" && data.changes && typeof data.changes === "object") {
5366
+ const { dependsOn, ...others } = data.changes;
5367
+ const dep = dependsOn && typeof dependsOn === "object" ? dependsOn : null;
5368
+ if (!dep)
5369
+ return e;
5370
+ const from = numbered(dep.from), to = numbered(dep.to);
5371
+ if (JSON.stringify(from) === JSON.stringify(dep.from) && JSON.stringify(to) === JSON.stringify(dep.to))
5372
+ return e;
5373
+ const changes = JSON.stringify(from) === JSON.stringify(to) ? others : { ...others, dependsOn: { ...dep, from, to } };
5374
+ return Object.keys(changes).length ? { ...e, data: { ...data, changes } } : null;
5375
+ }
5376
+ return e;
5377
+ };
5317
5378
  const shown = (d) => !gateway ? d : {
5318
5379
  ...d,
5380
+ card: unnumbered(d.card),
5319
5381
  parent: d.card.parentId && hiddenRef(d.card.parentId) ? null : d.parent,
5320
- children: d.children.filter((c) => !hidden(c)),
5382
+ children: d.children.filter((c) => !hidden(c)).map(unnumbered),
5383
+ watchers: d.watchers.filter((n) => !hiddenName(n)),
5384
+ // A main task kept out of sight is not named here either: its watchers go with it (the `parent` above reads as none).
5385
+ inheritedWatchers: d.card.parentId && hiddenRef(d.card.parentId) ? [] : d.inheritedWatchers.filter((n) => !hiddenName(n)),
5386
+ leader: d.leader && hiddenName(d.leader.name) ? null : d.leader, // as a project's hidden lead: read as none
5321
5387
  comments: d.comments.filter((e) => !hiddenName(e.author)),
5322
5388
  logs: d.logs.filter((e) => !hiddenName(e.author)),
5323
- history: d.history.filter((e) => !hiddenName(e.actor) && !mentionsHidden(e.data)),
5389
+ history: d.history.filter((e) => !hiddenName(e.actor) && !mentionsHidden(e.data)).flatMap((e) => unnumberedEvent(e) ?? []),
5324
5390
  };
5325
- const card = /^\/ui\/tasks\/cards\/([^/]+)(?:\/(move|reorder))?$/.exec(path);
5391
+ const card = /^\/ui\/tasks\/cards\/([^/]+)(?:\/(move|reorder|watchers))?$/.exec(path);
5326
5392
  const project = /^\/ui\/tasks\/projects\/(\d+)$/.exec(path);
5327
5393
  try {
5328
5394
  const ref = card ? decodeURIComponent(card[1]) : "";
@@ -5353,7 +5419,7 @@ export function handleWebRequest(req, res, url, ctx) {
5353
5419
  // #2355 review: the names a project's lead may be — the fleet's instances (a Classic-only room is not one); over the
5354
5420
  // public link, not a hidden one.
5355
5421
  const leads = Object.keys(ctx.fleetConfig?.instances ?? {}).filter((n) => !hiddenName(n)).sort();
5356
- const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone) });
5422
+ const body = JSON.stringify({ rev, cards: board.views(cards, scope, ctx.dispatcherGone).map(unnumbered), projects, leads, boardOff, stats: board.projectStats(ctx.dispatcherGone) });
5357
5423
  if (key)
5358
5424
  boardBodies.set(board, { key, body });
5359
5425
  jsonText(res, 200, body);
@@ -5381,7 +5447,7 @@ export function handleWebRequest(req, res, url, ctx) {
5381
5447
  for (const c of [...w.doing, ...w.blocked, ...w.review, ...w.ready, ...w.waiting.map((x) => x.card), ...w.mains.map((x) => x.card)])
5382
5448
  if (!hidden(c))
5383
5449
  all.set(c.uuid, c);
5384
- const viewOf = new Map(board.views([...all.values()], scope, ctx.dispatcherGone).map((v) => [v.uuid, v]));
5450
+ const viewOf = new Map(board.views([...all.values()], scope, ctx.dispatcherGone).map((v) => [v.uuid, unnumbered(v)]));
5385
5451
  const drawn = (cards) => cards.flatMap((c) => (viewOf.has(c.uuid) ? [viewOf.get(c.uuid)] : []));
5386
5452
  const codes = (cards) => cards.filter((x) => all.has(x.card.uuid)).map((x) => x.card.code);
5387
5453
  const body = JSON.stringify({ instances: works.map(({ name, w }) => ({
@@ -5398,7 +5464,7 @@ export function handleWebRequest(req, res, url, ctx) {
5398
5464
  if (method === "GET" && path === "/ui/tasks/search") {
5399
5465
  const names = new Map(board.listProjects(true).map((p) => [p.id, p.name]));
5400
5466
  const hits = board.search(url.searchParams.get("q") ?? "", Number(url.searchParams.get("limit")) || 20, scope).filter((h) => !hidden(h.card));
5401
- const views = board.views(hits.map((h) => h.card), scope, ctx.dispatcherGone);
5467
+ const views = board.views(hits.map((h) => h.card), scope, ctx.dispatcherGone).map(unnumbered);
5402
5468
  const results = hits.map(({ card: c, match }, i) => ({
5403
5469
  card: views[i],
5404
5470
  match,
@@ -5408,6 +5474,20 @@ export function handleWebRequest(req, res, url, ctx) {
5408
5474
  json(res, 200, { results });
5409
5475
  return true;
5410
5476
  }
5477
+ if (method === "GET" && path === "/ui/tasks/refs") {
5478
+ // A card as a chat shows it — number, title, status, who has it — and the cards offered while `#` is typed.
5479
+ // `?codes=M-3,S-4` answers those that are cards (the others are left out, not an error); `?q=` (what follows the `#`,
5480
+ // empty for the latest changes) offers cards. Over the public link, not a card that names a hidden instance.
5481
+ const wanted = url.searchParams.get("codes");
5482
+ if (wanted !== null) {
5483
+ const codes = [...new Set(wanted.split(",").map((c) => cardCode(c.trim().replace(/^#/, ""))).filter((c) => !!c))].slice(0, 50);
5484
+ json(res, 200, { refs: cardsForRefs(board, codes, hidden).map(taskRefView) });
5485
+ return true;
5486
+ }
5487
+ const limit = Number(url.searchParams.get("limit")) || 8;
5488
+ json(res, 200, { refs: board.suggest((url.searchParams.get("q") ?? "").slice(0, 100), limit, (c) => !hidden(c)).map(taskRefView) });
5489
+ return true;
5490
+ }
5411
5491
  if (method === "GET" && card && !card[2]) {
5412
5492
  const found = board.getCard(ref);
5413
5493
  if (hidden(found)) {
@@ -5431,6 +5511,12 @@ export function handleWebRequest(req, res, url, ctx) {
5431
5511
  return { card: board.view(moved, {}, ctx.dispatcherGone), notes: said };
5432
5512
  });
5433
5513
  }
5514
+ else if (card[2] === "watchers") {
5515
+ boardWrite(req, res, url, ctx, board, CardWatchersSchema, (change, person) => {
5516
+ const { card: watched, watchers, said } = board.setWatchers(person, ref, change);
5517
+ return { card: board.view(watched, {}, ctx.dispatcherGone), watchers: watchers.filter((n) => !hiddenName(n)), notes: said };
5518
+ });
5519
+ }
5434
5520
  else if (card[2] === "reorder") {
5435
5521
  boardWrite(req, res, url, ctx, board, CardReorderSchema, ({ after, before }, person) => ({ card: board.view(board.reorder(person, ref, after ?? null, before ?? null), {}, ctx.dispatcherGone) }));
5436
5522
  }
@@ -6118,11 +6204,12 @@ async function handleResendMessage(req, res, ctx) {
6118
6204
  update();
6119
6205
  const delivery = attachmentDelivery(row.text, files);
6120
6206
  const adapter = ctx.getAdapterForInstance ? ctx.getAdapterForInstance(instance) : ctx.adapter;
6207
+ const reactions = ctx.pendingReactionsMeta?.(instance) ?? { meta: {}, consume: () => { } }; // #4336
6121
6208
  const payload = { type: "fleet_inbound", content: delivery.text, ...(nativeRequestId ? { requestId: nativeRequestId } : {}), targetSession: instance, meta: {
6122
6209
  chat_id: ctx.getGroupIdForInstance?.(instance) ?? String(ctx.fleetConfig?.channel?.group_id ?? ""),
6123
6210
  thread_id: String(ctx.fleetConfig?.instances[instance]?.topic_id ?? ""), message_id: messageId,
6124
6211
  user: person.name, user_id: person.userId, source: "web", ts: new Date().toISOString(), adapter_id: adapter?.id,
6125
- ...(guest ? { web_guest: "1" } : {}), ...delivery.meta, ...(quoted ? { reply_to_text: webChatReplyText(quoted) } : {}),
6212
+ ...(guest ? { web_guest: "1" } : {}), ...reactions.meta, ...delivery.meta, ...(quoted ? { reply_to_text: webChatReplyText(quoted) } : {}),
6126
6213
  } };
6127
6214
  let handedOff = false;
6128
6215
  try {
@@ -6131,6 +6218,7 @@ async function handleResendMessage(req, res, ctx) {
6131
6218
  if (delivered === false)
6132
6219
  throw new Error("delivery changed");
6133
6220
  handedOff = true;
6221
+ reactions.consume(); // #4336: they rode this message; only now, once accepted
6134
6222
  if (!res.destroyed)
6135
6223
  json(res, 200, { sent: true, message: row });
6136
6224
  }
@@ -6163,6 +6251,7 @@ function handleSendMessage(req, res, ctx) {
6163
6251
  let claim;
6164
6252
  let acceptedId = null;
6165
6253
  let tellPasted; // #4145: the pasted-token line, after this message's own (whatever the send's end)
6254
+ let tellBoardOff; // Cards named for an instance with the task board off, said once the message went
6166
6255
  try {
6167
6256
  const raw = JSON.parse(body);
6168
6257
  const parsed = SendMessageSchema.safeParse(raw);
@@ -6265,6 +6354,24 @@ function handleSendMessage(req, res, ctx) {
6265
6354
  }
6266
6355
  // The same tags and meta a Telegram photo/document produces, so the agent needs nothing new.
6267
6356
  const delivery = attachmentDelivery(typed, files);
6357
+ // The task cards the person's words name (`#M-3`, typed or chosen from the list), read from the board now, go to
6358
+ // the agent as a short block under them, so it need not guess. Nothing is added for a number that is no card (never was,
6359
+ // or deleted since), for a guest (a guest has no board), for an instance whose task board is switched off (it is told
6360
+ // nothing of the board: only the person's words go), for a line that starts with "/" (a command for the CLI, or /raw's
6361
+ // exact paste), or for a card that names an instance hidden on the public link. The chat's copy, the channel's echo and
6362
+ // the receipt's "what was typed" stay the person's words.
6363
+ const taskBoard = guest || taskBoardOffIn(ctx.fleetConfig, instance) || /^\s*\//.test(typed) ? undefined : ctx.scheduler?.db.board;
6364
+ const { hidden: hiddenCard } = boardHiding(ctx, linkRestricted(req, new URL(req.url ?? "/", "http://localhost"), ctx));
6365
+ const refCards = taskBoard ? cardsForRefs(taskBoard, taskRefCodes(typed), hiddenCard) : [];
6366
+ const refBlock = taskBoard && refCards.length ? taskRefBlock(taskBoard, refCards, { read: taskReadWay(ctx.fleetConfig?.instances[instance], instance), hidden: hiddenCard }) : "";
6367
+ // Cards named for an instance whose task board is off are not handed over (it has no task tool): the person is
6368
+ // told which instance it is and where to turn it on, as a line in the chat after the message — not left to wonder why it did nothing.
6369
+ if (!guest && !/^\s*\//.test(typed) && taskBoardOffIn(ctx.fleetConfig, instance) && ctx.scheduler?.db.board) {
6370
+ const named = cardsForRefs(ctx.scheduler.db.board, taskRefCodes(typed), hiddenCard).map((c) => c.code);
6371
+ if (named.length)
6372
+ tellBoardOff = () => ctx.emitSseEvent("message", { instance, role: "status", sender: "AgEnD", text: t("web.task_board_off_refs", instance, named.join(", ")), ts: new Date().toISOString(), messageId: newWebMessageId() });
6373
+ }
6374
+ const deliveredText = delivery.text + refBlock;
6268
6375
  // #1269: `/raw ` is pasted into the CLI with no [user:] envelope (the daemon's own check, on this exact text).
6269
6376
  // M-3278 (decision 7933bf90): the public link's admin session may do that too, as a local one may; anyone else
6270
6377
  // over the link (a guest) still may not.
@@ -6300,10 +6407,10 @@ function handleSendMessage(req, res, ctx) {
6300
6407
  if (nativeRequestId && ctx.nativeInstanceRuntime) {
6301
6408
  const previous = ctx.nativeInstanceRuntime().get(instance)?.turns.find(turn => turn.id === nativeRequestId);
6302
6409
  if (previous) {
6303
- if (previous.prompt !== delivery.text) {
6410
+ if (previous.prompt !== delivery.text && !previous.prompt.startsWith(delivery.text + TASK_REF_SEPARATOR)) {
6304
6411
  json(res, 409, { error: "clientId belongs to a different message" });
6305
6412
  return;
6306
- }
6413
+ } // the card block under it is read afresh on a retry
6307
6414
  acceptedId = messageId;
6308
6415
  json(res, 200, { sent: true, messageId, repeated: true });
6309
6416
  return;
@@ -6352,13 +6459,17 @@ function handleSendMessage(req, res, ctx) {
6352
6459
  return sent;
6353
6460
  }) : undefined;
6354
6461
  let delivered;
6462
+ // #4336 (M-3516): the reactions waiting for the agent ride this message, as a platform message's do (one line,
6463
+ // "[Recent reactions: …]"); they are consumed below only once it was accepted. The room's or topic's echo of it is
6464
+ // a bot copy the agent is never handed, so they are delivered exactly once.
6465
+ const reactions = ctx.pendingReactionsMeta?.(instance) ?? { meta: {}, consume: () => { } };
6355
6466
  try {
6356
6467
  const deliver = (name, payload) => ctx.deliverHumanToInstance
6357
6468
  ? ctx.deliverHumanToInstance(name, payload, webHumanOrigin(false, authority), typed, { stillCurrent, ...(native ? { authorityCurrent } : {}) })
6358
6469
  : ctx.deliverToInstance(name, payload, { stillCurrent, ...(native ? { authorityCurrent } : {}) });
6359
6470
  delivered = await deliver(instance, {
6360
6471
  type: "fleet_inbound",
6361
- content: delivery.text,
6472
+ content: deliveredText,
6362
6473
  ...(nativeRequestId ? { requestId: nativeRequestId } : {}),
6363
6474
  targetSession: instance,
6364
6475
  meta: {
@@ -6370,6 +6481,7 @@ function handleSendMessage(req, res, ctx) {
6370
6481
  source: "web",
6371
6482
  ...(guest ? { web_guest: "1" } : {}), // #1920: "[user:…@web:g#…]" (authority none)
6372
6483
  adapter_id: syncAdapter?.id,
6484
+ ...reactions.meta,
6373
6485
  ...delivery.meta,
6374
6486
  // #2272: `(reply_to: "…")`, as a Discord or Telegram reply gives the agent.
6375
6487
  ...(quoted ? { reply_to_text: webChatReplyText(quoted) } : {}),
@@ -6398,6 +6510,7 @@ function handleSendMessage(req, res, ctx) {
6398
6510
  // The agent has it: from here on a repeat of this clientId is this send, whatever fails after (the echo, the
6399
6511
  // stream's copy) — a Retry then gets this messageId, never a second delivery.
6400
6512
  acceptedId = messageId;
6513
+ reactions.consume();
6401
6514
  settleEcho?.(true);
6402
6515
  settleClassicEcho?.(true);
6403
6516
  // #1666: the same cancel/progress bubble a platform inbound starts, in the topic the echo went to — a second turn
@@ -6426,6 +6539,8 @@ function handleSendMessage(req, res, ctx) {
6426
6539
  finally {
6427
6540
  claim?.settle(acceptedId);
6428
6541
  tellPasted?.();
6542
+ if (acceptedId)
6543
+ tellBoardOff?.();
6429
6544
  }
6430
6545
  });
6431
6546
  }