@songsid/agend 2.1.12 → 2.2.0-alpha.2

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 (436) hide show
  1. package/README.md +4 -2
  2. package/README.zh-TW.md +4 -2
  3. package/dist/agent-cli.js +6 -1
  4. package/dist/agent-cli.js.map +1 -1
  5. package/dist/agent-endpoint.js +68 -12
  6. package/dist/agent-endpoint.js.map +1 -1
  7. package/dist/agent-token-header.d.ts +13 -0
  8. package/dist/agent-token-header.js +16 -0
  9. package/dist/agent-token-header.js.map +1 -0
  10. package/dist/auth/one-time-code.d.ts +19 -0
  11. package/dist/auth/one-time-code.js +49 -0
  12. package/dist/auth/one-time-code.js.map +1 -0
  13. package/dist/auth-api.d.ts +52 -0
  14. package/dist/auth-api.js +346 -0
  15. package/dist/auth-api.js.map +1 -0
  16. package/dist/backend/antigravity.js +4 -3
  17. package/dist/backend/antigravity.js.map +1 -1
  18. package/dist/backend/claude-code.d.ts +4 -0
  19. package/dist/backend/claude-code.js +97 -0
  20. package/dist/backend/claude-code.js.map +1 -1
  21. package/dist/backend/codex.js +59 -30
  22. package/dist/backend/codex.js.map +1 -1
  23. package/dist/backend/grok.js +1 -1
  24. package/dist/backend/grok.js.map +1 -1
  25. package/dist/backend/kiro-agent.d.ts +66 -0
  26. package/dist/backend/kiro-agent.js +302 -0
  27. package/dist/backend/kiro-agent.js.map +1 -0
  28. package/dist/backend/kiro-identity.d.ts +80 -0
  29. package/dist/backend/kiro-identity.js +537 -0
  30. package/dist/backend/kiro-identity.js.map +1 -0
  31. package/dist/backend/kiro-v2-store-worker.d.ts +1 -0
  32. package/dist/backend/kiro-v2-store-worker.js +87 -0
  33. package/dist/backend/kiro-v2-store-worker.js.map +1 -0
  34. package/dist/backend/kiro-v2-store.d.ts +54 -0
  35. package/dist/backend/kiro-v2-store.js +131 -0
  36. package/dist/backend/kiro-v2-store.js.map +1 -0
  37. package/dist/backend/kiro-v3-identity.d.ts +5 -0
  38. package/dist/backend/kiro-v3-identity.js +22 -0
  39. package/dist/backend/kiro-v3-identity.js.map +1 -1
  40. package/dist/backend/kiro.d.ts +90 -7
  41. package/dist/backend/kiro.js +500 -124
  42. package/dist/backend/kiro.js.map +1 -1
  43. package/dist/backend/muse.js +1 -1
  44. package/dist/backend/muse.js.map +1 -1
  45. package/dist/backend/types.d.ts +51 -3
  46. package/dist/backend/types.js.map +1 -1
  47. package/dist/cache-analysis.d.ts +92 -0
  48. package/dist/cache-analysis.js +147 -0
  49. package/dist/cache-analysis.js.map +1 -0
  50. package/dist/cache-ledger.d.ts +108 -0
  51. package/dist/cache-ledger.js +230 -0
  52. package/dist/cache-ledger.js.map +1 -0
  53. package/dist/cache-prices.d.ts +32 -0
  54. package/dist/cache-prices.js +73 -0
  55. package/dist/cache-prices.js.map +1 -0
  56. package/dist/cache-scan.d.ts +39 -0
  57. package/dist/cache-scan.js +115 -0
  58. package/dist/cache-scan.js.map +1 -0
  59. package/dist/cache-service.d.ts +115 -0
  60. package/dist/cache-service.js +417 -0
  61. package/dist/cache-service.js.map +1 -0
  62. package/dist/channel/adapters/discord.d.ts +1 -0
  63. package/dist/channel/adapters/discord.js +29 -10
  64. package/dist/channel/adapters/discord.js.map +1 -1
  65. package/dist/channel/adapters/telegram.d.ts +1 -0
  66. package/dist/channel/adapters/telegram.js +13 -1
  67. package/dist/channel/adapters/telegram.js.map +1 -1
  68. package/dist/channel/types.d.ts +9 -1
  69. package/dist/classic-channel-manager.d.ts +18 -10
  70. package/dist/classic-channel-manager.js +45 -18
  71. package/dist/classic-channel-manager.js.map +1 -1
  72. package/dist/cli-entry.d.ts +19 -0
  73. package/dist/cli-entry.js +36 -0
  74. package/dist/cli-entry.js.map +1 -0
  75. package/dist/cli.js +471 -146
  76. package/dist/cli.js.map +1 -1
  77. package/dist/command-table.d.ts +5 -3
  78. package/dist/command-table.js +29 -27
  79. package/dist/command-table.js.map +1 -1
  80. package/dist/config-validator.js +46 -0
  81. package/dist/config-validator.js.map +1 -1
  82. package/dist/config.js +12 -0
  83. package/dist/config.js.map +1 -1
  84. package/dist/connection-secrets.d.ts +6 -0
  85. package/dist/connection-secrets.js +4 -0
  86. package/dist/connection-secrets.js.map +1 -1
  87. package/dist/daemon.d.ts +95 -4
  88. package/dist/daemon.js +748 -111
  89. package/dist/daemon.js.map +1 -1
  90. package/dist/darwin-memory.d.ts +6 -1
  91. package/dist/darwin-memory.js +17 -6
  92. package/dist/darwin-memory.js.map +1 -1
  93. package/dist/delivery-consumed-watch.d.ts +85 -0
  94. package/dist/delivery-consumed-watch.js +244 -0
  95. package/dist/delivery-consumed-watch.js.map +1 -0
  96. package/dist/delivery-outbox.d.ts +61 -0
  97. package/dist/delivery-outbox.js +120 -2
  98. package/dist/delivery-outbox.js.map +1 -1
  99. package/dist/delivery-reconciliation.d.ts +14 -5
  100. package/dist/delivery-reconciliation.js +27 -4
  101. package/dist/delivery-reconciliation.js.map +1 -1
  102. package/dist/delivery-reconciliation.test.js +35 -1
  103. package/dist/delivery-reconciliation.test.js.map +1 -1
  104. package/dist/event-log.d.ts +4 -1
  105. package/dist/event-log.js +6 -3
  106. package/dist/event-log.js.map +1 -1
  107. package/dist/event-loop-watch.d.ts +28 -0
  108. package/dist/event-loop-watch.js +75 -3
  109. package/dist/event-loop-watch.js.map +1 -1
  110. package/dist/fleet-context.d.ts +22 -2
  111. package/dist/fleet-control-audit.d.ts +5 -0
  112. package/dist/fleet-control-audit.js +7 -0
  113. package/dist/fleet-control-audit.js.map +1 -1
  114. package/dist/fleet-level-config.d.ts +2 -2
  115. package/dist/fleet-level-config.js +28 -1
  116. package/dist/fleet-level-config.js.map +1 -1
  117. package/dist/fleet-manager.d.ts +339 -12
  118. package/dist/fleet-manager.js +2623 -461
  119. package/dist/fleet-manager.js.map +1 -1
  120. package/dist/full-restart.js +2 -3
  121. package/dist/full-restart.js.map +1 -1
  122. package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -1
  123. package/dist/host-memory.d.ts +4 -0
  124. package/dist/host-memory.js.map +1 -1
  125. package/dist/install-lock.d.ts +49 -0
  126. package/dist/install-lock.js +200 -0
  127. package/dist/install-lock.js.map +1 -0
  128. package/dist/instance-config-impact.js +8 -2
  129. package/dist/instance-config-impact.js.map +1 -1
  130. package/dist/instance-lifecycle.d.ts +10 -5
  131. package/dist/instance-lifecycle.js +162 -53
  132. package/dist/instance-lifecycle.js.map +1 -1
  133. package/dist/locale.js +164 -16
  134. package/dist/locale.js.map +1 -1
  135. package/dist/login-controller.d.ts +2 -0
  136. package/dist/login-controller.js +17 -5
  137. package/dist/login-controller.js.map +1 -1
  138. package/dist/memory-pressure.d.ts +7 -8
  139. package/dist/memory-pressure.js +76 -15
  140. package/dist/memory-pressure.js.map +1 -1
  141. package/dist/monotonic-budget.d.ts +2 -0
  142. package/dist/monotonic-budget.js +28 -0
  143. package/dist/monotonic-budget.js.map +1 -0
  144. package/dist/needs-you-hub.d.ts +114 -0
  145. package/dist/needs-you-hub.js +370 -0
  146. package/dist/needs-you-hub.js.map +1 -0
  147. package/dist/needs-you-live.d.ts +116 -0
  148. package/dist/needs-you-live.js +228 -0
  149. package/dist/needs-you-live.js.map +1 -0
  150. package/dist/needs-you.d.ts +132 -0
  151. package/dist/needs-you.js +164 -0
  152. package/dist/needs-you.js.map +1 -0
  153. package/dist/node-version-guard.d.ts +30 -0
  154. package/dist/node-version-guard.js +50 -0
  155. package/dist/node-version-guard.js.map +1 -0
  156. package/dist/operator-control-paths.d.ts +4 -0
  157. package/dist/operator-control-paths.js +24 -0
  158. package/dist/operator-control-paths.js.map +1 -0
  159. package/dist/outbound-handlers.d.ts +2 -0
  160. package/dist/outbound-handlers.js +9 -2
  161. package/dist/outbound-handlers.js.map +1 -1
  162. package/dist/outbound-schemas.d.ts +5 -5
  163. package/dist/outbound-schemas.js +1 -1
  164. package/dist/outbound-schemas.js.map +1 -1
  165. package/dist/package-preimage.d.ts +26 -0
  166. package/dist/package-preimage.js +96 -0
  167. package/dist/package-preimage.js.map +1 -0
  168. package/dist/profile-control.js +4 -20
  169. package/dist/profile-control.js.map +1 -1
  170. package/dist/public-web-gateway.d.ts +18 -0
  171. package/dist/public-web-gateway.js +141 -0
  172. package/dist/public-web-gateway.js.map +1 -0
  173. package/dist/public-web-link.d.ts +53 -0
  174. package/dist/public-web-link.js +175 -0
  175. package/dist/public-web-link.js.map +1 -0
  176. package/dist/quickstart-api.d.ts +8 -1
  177. package/dist/quickstart-api.js +86 -48
  178. package/dist/quickstart-api.js.map +1 -1
  179. package/dist/quickstart.d.ts +1 -0
  180. package/dist/quickstart.js +16 -6
  181. package/dist/quickstart.js.map +1 -1
  182. package/dist/restart-guard.d.ts +52 -0
  183. package/dist/restart-guard.js +109 -0
  184. package/dist/restart-guard.js.map +1 -0
  185. package/dist/scheduler/db.d.ts +7 -1
  186. package/dist/scheduler/db.js +44 -2
  187. package/dist/scheduler/db.js.map +1 -1
  188. package/dist/scheduler/index.d.ts +1 -1
  189. package/dist/scheduler/retry-label.d.ts +11 -0
  190. package/dist/scheduler/retry-label.js +24 -0
  191. package/dist/scheduler/retry-label.js.map +1 -0
  192. package/dist/scheduler/scheduler.d.ts +55 -2
  193. package/dist/scheduler/scheduler.js +220 -8
  194. package/dist/scheduler/scheduler.js.map +1 -1
  195. package/dist/scheduler/types.d.ts +22 -0
  196. package/dist/scheduler/types.js.map +1 -1
  197. package/dist/secret-store.d.ts +5 -0
  198. package/dist/secret-store.js +20 -0
  199. package/dist/secret-store.js.map +1 -1
  200. package/dist/service-activation.d.ts +152 -0
  201. package/dist/service-activation.js +407 -0
  202. package/dist/service-activation.js.map +1 -0
  203. package/dist/service-installer.d.ts +63 -1
  204. package/dist/service-installer.js +141 -16
  205. package/dist/service-installer.js.map +1 -1
  206. package/dist/service-plan.d.ts +65 -0
  207. package/dist/service-plan.js +108 -0
  208. package/dist/service-plan.js.map +1 -0
  209. package/dist/service-restart-selection.d.ts +6 -5
  210. package/dist/service-restart-selection.js +6 -5
  211. package/dist/service-restart-selection.js.map +1 -1
  212. package/dist/settings-api.d.ts +10 -2
  213. package/dist/settings-api.js +216 -72
  214. package/dist/settings-api.js.map +1 -1
  215. package/dist/settings-baseline.d.ts +20 -0
  216. package/dist/settings-baseline.js +104 -0
  217. package/dist/settings-baseline.js.map +1 -0
  218. package/dist/settings-change.d.ts +21 -0
  219. package/dist/settings-change.js +161 -0
  220. package/dist/settings-change.js.map +1 -0
  221. package/dist/settings-confirmation.d.ts +105 -0
  222. package/dist/settings-confirmation.js +232 -0
  223. package/dist/settings-confirmation.js.map +1 -0
  224. package/dist/settings-control.d.ts +41 -0
  225. package/dist/settings-control.js +294 -0
  226. package/dist/settings-control.js.map +1 -0
  227. package/dist/settings-effect.d.ts +24 -0
  228. package/dist/settings-effect.js +169 -0
  229. package/dist/settings-effect.js.map +1 -0
  230. package/dist/settings-http-confirmation.d.ts +29 -0
  231. package/dist/settings-http-confirmation.js +123 -0
  232. package/dist/settings-http-confirmation.js.map +1 -0
  233. package/dist/settings-instance-patch.d.ts +4 -0
  234. package/dist/settings-instance-patch.js +26 -0
  235. package/dist/settings-instance-patch.js.map +1 -0
  236. package/dist/settings-request-capability.d.ts +16 -0
  237. package/dist/settings-request-capability.js +32 -0
  238. package/dist/settings-request-capability.js.map +1 -0
  239. package/dist/settings-transaction.d.ts +65 -0
  240. package/dist/settings-transaction.js +223 -0
  241. package/dist/settings-transaction.js.map +1 -0
  242. package/dist/setup-auth.d.ts +10 -18
  243. package/dist/setup-auth.js +14 -38
  244. package/dist/setup-auth.js.map +1 -1
  245. package/dist/setup-form.d.ts +1 -1
  246. package/dist/setup-form.js +75 -18
  247. package/dist/setup-form.js.map +1 -1
  248. package/dist/setup-guide.d.ts +13 -0
  249. package/dist/setup-guide.js +25 -0
  250. package/dist/setup-guide.js.map +1 -0
  251. package/dist/setup-host.d.ts +16 -0
  252. package/dist/setup-host.js +199 -35
  253. package/dist/setup-host.js.map +1 -1
  254. package/dist/setup-wizard.js +5 -1
  255. package/dist/setup-wizard.js.map +1 -1
  256. package/dist/slash-authz.d.ts +17 -3
  257. package/dist/slash-authz.js +5 -0
  258. package/dist/slash-authz.js.map +1 -1
  259. package/dist/spawn-gate.js +3 -3
  260. package/dist/spawn-gate.js.map +1 -1
  261. package/dist/sqlite-open-errors.d.ts +12 -0
  262. package/dist/sqlite-open-errors.js +13 -0
  263. package/dist/sqlite-open-errors.js.map +1 -0
  264. package/dist/statusline-watcher.d.ts +5 -0
  265. package/dist/statusline-watcher.js +2 -0
  266. package/dist/statusline-watcher.js.map +1 -1
  267. package/dist/steer-capability.d.ts +6 -0
  268. package/dist/steer-capability.js +8 -0
  269. package/dist/steer-capability.js.map +1 -1
  270. package/dist/sync-work-attribution.d.ts +14 -0
  271. package/dist/sync-work-attribution.js +43 -8
  272. package/dist/sync-work-attribution.js.map +1 -1
  273. package/dist/tips.js +10 -5
  274. package/dist/tips.js.map +1 -1
  275. package/dist/tmux-control.d.ts +57 -5
  276. package/dist/tmux-control.js +379 -61
  277. package/dist/tmux-control.js.map +1 -1
  278. package/dist/tmux-manager.d.ts +20 -6
  279. package/dist/tmux-manager.js +90 -47
  280. package/dist/tmux-manager.js.map +1 -1
  281. package/dist/tmux-read.d.ts +59 -0
  282. package/dist/tmux-read.js +213 -0
  283. package/dist/tmux-read.js.map +1 -0
  284. package/dist/topic-commands.d.ts +21 -10
  285. package/dist/topic-commands.js +205 -63
  286. package/dist/topic-commands.js.map +1 -1
  287. package/dist/transcript-delta-reader.js +2 -1
  288. package/dist/transcript-delta-reader.js.map +1 -1
  289. package/dist/tunnel/cloudflared-install.d.ts +2 -0
  290. package/dist/tunnel/cloudflared-install.js +1 -1
  291. package/dist/tunnel/cloudflared-install.js.map +1 -1
  292. package/dist/tunnel/purpose-lane.d.ts +14 -0
  293. package/dist/tunnel/purpose-lane.js +43 -0
  294. package/dist/tunnel/purpose-lane.js.map +1 -0
  295. package/dist/turn-reply-guard.d.ts +2 -0
  296. package/dist/turn-reply-guard.js +10 -1
  297. package/dist/turn-reply-guard.js.map +1 -1
  298. package/dist/types.d.ts +33 -0
  299. package/dist/ui/app.html +18 -0
  300. package/dist/ui/chat-commands.js +43 -0
  301. package/dist/ui/chat-render.js +478 -0
  302. package/dist/ui/chat-store.js +318 -0
  303. package/dist/ui/chat-strings.js +89 -0
  304. package/dist/ui/chat-thread.js +246 -0
  305. package/dist/ui/chat-tour.js +116 -0
  306. package/dist/ui/fleet-cache.js +168 -0
  307. package/dist/ui/fleet-org.js +142 -0
  308. package/dist/ui/panel-chat.js +504 -0
  309. package/dist/ui/panel-fleet.js +427 -0
  310. package/dist/ui/panel-needs.js +202 -0
  311. package/dist/ui/panel-settings.js +754 -0
  312. package/dist/ui/preview-panel.js +202 -0
  313. package/dist/ui/preview.js +270 -0
  314. package/dist/ui/settings-apply.js +239 -0
  315. package/dist/ui/settings-confirm.js +186 -0
  316. package/dist/ui/settings-dialogs.js +546 -0
  317. package/dist/ui/settings-model.js +277 -0
  318. package/dist/ui/settings-strings.js +654 -0
  319. package/dist/ui/settings-wizard.js +140 -0
  320. package/dist/ui/shared/agend-auth.js +93 -0
  321. package/dist/ui/shared/app-ctx.js +80 -0
  322. package/dist/ui/shared/app-html.js +9 -0
  323. package/dist/ui/shared/app-i18n.js +95 -0
  324. package/dist/ui/shared/app-nav.js +73 -0
  325. package/dist/ui/shared/app-needs.js +114 -0
  326. package/dist/ui/shared/app-route.js +73 -0
  327. package/dist/ui/shared/app-session.js +66 -0
  328. package/dist/ui/shared/app-shell.js +346 -0
  329. package/dist/ui/shared/app-store.js +51 -0
  330. package/dist/ui/shared/app-stream.js +201 -0
  331. package/dist/ui/shared/app.css +820 -0
  332. package/dist/ui/shared/app.js +88 -0
  333. package/dist/ui/shared/fonts/OFL.txt +92 -0
  334. package/dist/ui/shared/fonts/README.md +21 -0
  335. package/dist/ui/shared/fonts/inter.woff2 +0 -0
  336. package/dist/ui/shared/htm.module.js +1 -0
  337. package/dist/ui/shared/panel-view.js +655 -0
  338. package/dist/ui/shared/preact-hooks.module.js +2 -0
  339. package/dist/ui/shared/preact.module.js +2 -0
  340. package/dist/ui/shared/signin.js +142 -0
  341. package/dist/ui/shared/theme.js +29 -0
  342. package/dist/ui/shared/tokens.css +153 -0
  343. package/dist/ui/shared/ui-confirm.js +43 -0
  344. package/dist/ui/shared/ui-dialog.js +45 -0
  345. package/dist/ui/shared/ui-icons.js +63 -0
  346. package/dist/ui/shared/ui-menu.js +39 -0
  347. package/dist/ui/shared/ui-states.js +20 -0
  348. package/dist/ui/shared/ui-toast.js +18 -0
  349. package/dist/ui/shared/vendor/htm.LICENSE +202 -0
  350. package/dist/ui/shared/vendor/preact.LICENSE +21 -0
  351. package/dist/ui/shared/vendor/vendor.json +39 -0
  352. package/dist/ui/shared/view-strings.js +309 -0
  353. package/dist/ui/signin.html +52 -0
  354. package/dist/update-check.d.ts +6 -2
  355. package/dist/update-check.js +12 -3
  356. package/dist/update-check.js.map +1 -1
  357. package/dist/update-dispatch.d.ts +28 -0
  358. package/dist/update-dispatch.js +73 -0
  359. package/dist/update-dispatch.js.map +1 -0
  360. package/dist/update-install.d.ts +129 -0
  361. package/dist/update-install.js +262 -0
  362. package/dist/update-install.js.map +1 -0
  363. package/dist/upgrade-notices.d.ts +17 -0
  364. package/dist/upgrade-notices.js +93 -0
  365. package/dist/upgrade-notices.js.map +1 -0
  366. package/dist/usage/statusline-usage.d.ts +2 -0
  367. package/dist/usage/statusline-usage.js +14 -10
  368. package/dist/usage/statusline-usage.js.map +1 -1
  369. package/dist/view-api.d.ts +6 -1
  370. package/dist/view-api.js +62 -51
  371. package/dist/view-api.js.map +1 -1
  372. package/dist/web-api.d.ts +85 -14
  373. package/dist/web-api.js +557 -77
  374. package/dist/web-api.js.map +1 -1
  375. package/dist/web-auth.d.ts +71 -27
  376. package/dist/web-auth.js +169 -69
  377. package/dist/web-auth.js.map +1 -1
  378. package/dist/web-body.d.ts +3 -0
  379. package/dist/web-body.js +55 -0
  380. package/dist/web-body.js.map +1 -0
  381. package/dist/web-channel-echo.d.ts +9 -0
  382. package/dist/web-channel-echo.js +55 -0
  383. package/dist/web-channel-echo.js.map +1 -0
  384. package/dist/web-chat-history.d.ts +125 -0
  385. package/dist/web-chat-history.js +184 -0
  386. package/dist/web-chat-history.js.map +1 -0
  387. package/dist/web-commands.d.ts +77 -0
  388. package/dist/web-commands.js +81 -0
  389. package/dist/web-commands.js.map +1 -0
  390. package/dist/web-continuation.d.ts +7 -0
  391. package/dist/web-continuation.js +22 -0
  392. package/dist/web-continuation.js.map +1 -0
  393. package/dist/web-host-guard.d.ts +34 -0
  394. package/dist/web-host-guard.js +57 -1
  395. package/dist/web-host-guard.js.map +1 -1
  396. package/dist/web-login.d.ts +72 -0
  397. package/dist/web-login.js +132 -0
  398. package/dist/web-login.js.map +1 -0
  399. package/dist/web-org.d.ts +55 -0
  400. package/dist/web-org.js +67 -0
  401. package/dist/web-org.js.map +1 -0
  402. package/dist/web-preview.d.ts +77 -0
  403. package/dist/web-preview.js +240 -0
  404. package/dist/web-preview.js.map +1 -0
  405. package/dist/web-request-context.d.ts +10 -0
  406. package/dist/web-request-context.js +13 -0
  407. package/dist/web-request-context.js.map +1 -0
  408. package/dist/web-session.d.ts +167 -0
  409. package/dist/web-session.js +389 -0
  410. package/dist/web-session.js.map +1 -0
  411. package/dist/web-shell-routes.d.ts +59 -0
  412. package/dist/web-shell-routes.js +96 -0
  413. package/dist/web-shell-routes.js.map +1 -0
  414. package/dist/web-upload.d.ts +183 -0
  415. package/dist/web-upload.js +468 -0
  416. package/dist/web-upload.js.map +1 -0
  417. package/dist/website-tips-renderer.d.ts +2 -2
  418. package/dist/website-tips-renderer.js +3 -3
  419. package/dist/website-tips-renderer.js.map +1 -1
  420. package/launcher/agend +110 -0
  421. package/launcher/agend-agent +110 -0
  422. package/launcher/agend-agent.cjs +4 -0
  423. package/launcher/agend.cjs +4 -0
  424. package/launcher/install-admission.cjs +105 -0
  425. package/launcher/launch.cjs +64 -0
  426. package/launcher/postinstall.cjs +114 -0
  427. package/launcher/run-in-process.cjs +13 -0
  428. package/launcher/runtime-platform.cjs +86 -0
  429. package/launcher/runtime-select.cjs +217 -0
  430. package/package.json +18 -7
  431. package/scripts/preinstall-guard.cjs +55 -0
  432. package/templates/launchd.plist.ejs +2 -2
  433. package/templates/systemd.service.ejs +1 -1
  434. package/dist/ui/dashboard.html +0 -774
  435. package/dist/ui/settings.html +0 -2165
  436. package/dist/ui/view.html +0 -1139
@@ -1,3 +1,5 @@
1
+ import { SettingsExecution } from "./settings-transaction.js";
2
+ import type { LoginCodeOwner } from "./web-login.js";
1
3
  import { type ProfileTicket } from "./runtime-cpu-profile.js";
2
4
  import type { CpuProfile } from "./cpu-profile.js";
3
5
  import { type FleetMemory } from "./process-memory.js";
@@ -49,6 +51,8 @@ export declare function applyTaskListCap<T extends {
49
51
  omitted: number;
50
52
  hint: string;
51
53
  } | T[];
54
+ import { WebChatHistory } from "./web-chat-history.js";
55
+ import { WebFileLedger } from "./web-upload.js";
52
56
  import { type RawConfigPatch } from "./settings-api.js";
53
57
  import { type AgentEndpointContext } from "./agent-endpoint.js";
54
58
  import { ClassicChannelManager } from "./classic-channel-manager.js";
@@ -57,6 +61,11 @@ import type { InstanceState, InteractionSnapshot } from "./backend/types.js";
57
61
  import { WakeCoordinator } from "./wake-coordinator.js";
58
62
  import { TargetQueueWorker } from "./target-queue-worker.js";
59
63
  import { resolveDeliveryWorkerMode } from "./types.js";
64
+ import { type WebNeedsItem } from "./needs-you-hub.js";
65
+ import { type OrgChart } from "./web-org.js";
66
+ import { type CacheReport } from "./cache-service.js";
67
+ import { type WebCommandResult } from "./web-commands.js";
68
+ import { type PreviewAvailability } from "./web-preview.js";
60
69
  import { type ConnectionMetadata, type ConnectionBinding, type BindingProbe, type SecretApplyJob, type ProviderSecretApplyJob } from "./connection-secrets.js";
61
70
  import { type ProviderSecretStatus } from "./provider-secret-registry.js";
62
71
  import { ApplyJobStore, type ApplyJob, type ApplyTargetKind, type SelfRestartResult } from "./apply-job.js";
@@ -119,6 +128,11 @@ export interface DeliveryOptions {
119
128
  * paused after its row was claimed is handed back instead of woken here.
120
129
  */
121
130
  noInlineWake?: boolean;
131
+ /**
132
+ * #1426: the caller's own fence, asked wherever the delivery epoch is — through the wake, the idle wait and up to the
133
+ * IPC hand-off itself. False drops the delivery unsent (a schedule retry past its deadline).
134
+ */
135
+ stillCurrent?: () => boolean;
122
136
  }
123
137
  export declare const LOGIN_CALLBACK_PREFIX = "login:";
124
138
  /**
@@ -271,6 +285,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
271
285
  private instanceProgress;
272
286
  /** instanceName → tail of deliveries waiting for its IPC to come back. */
273
287
  private ipcWaitTails;
288
+ private webChannelEchoTails;
289
+ /**
290
+ * instanceName → the reservation whose echo callback is currently running.
291
+ * sendClassicWebEcho fences every per-entry copy against it: no new copy
292
+ * starts after the ordering budget is gone or the delivery epoch is revoked.
293
+ * Serialized per instance by the echo tail, so one slot is enough.
294
+ */
295
+ private webChannelEchoGuards;
274
296
  /** instanceName → restart currently executing; concurrent callers join it. */
275
297
  private restartsInFlight;
276
298
  /**
@@ -309,6 +331,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
309
331
  private pendingModelSelects;
310
332
  /** nonce → pending button prompt (hang restart, interactive assist, clean-exit restart). */
311
333
  private pendingNonceButtons;
334
+ /** #1386 "Needs you": the list, its live chat messages and Acknowledge. Started with the fleet (finishStartup). */
335
+ private needsYou;
336
+ /** When the fleet first saw an instance crashed, for its "Needs you" age; cleared when it is not. */
337
+ private readonly needsCrashedAt;
338
+ /** Pause reason/time read from the marker, per paused instance; dropped on any attention change of it, and at most
339
+ * NEEDS_PAUSE_TTL_MS old — so a recompute does not re-read the file every time (#1386 §4.3). */
340
+ private readonly needsPauseCache;
341
+ /**
342
+ * Clicks that came from the web dashboard (clickWebPrompt). Only that method adds to it, so nothing an
343
+ * adapter emits — whatever fields its payload carries — can claim a dashboard click's authority.
344
+ */
345
+ private readonly webPromptClicks;
346
+ /** The web clicks consumeNonceCallback actually claimed (the others were refused or lost a race). */
347
+ private readonly webPromptClaims;
312
348
  private failoverActive;
313
349
  /** instance → when a click with no live button entry last fired a cancel. */
314
350
  private staleCancelClickAt;
@@ -357,6 +393,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
357
393
  private connectionBindingInFlight;
358
394
  private collabInstances;
359
395
  private healthServer;
396
+ /** #1306: the preview listener (health_port + 1 by default), and whether it is listening. */
397
+ private previewListener;
398
+ private previewListening;
399
+ /** The ports the preview listener was started for, and the inputs it was built from (a reload compares them). */
400
+ private previewPorts;
401
+ private previewInputs;
360
402
  private healthPortRetried;
361
403
  private updateCheckTimer;
362
404
  private updateProgressTimer;
@@ -387,12 +429,36 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
387
429
  private mirrorBuffer;
388
430
  private mirrorTimer;
389
431
  private sseClients;
432
+ /** The web chat's recent messages: what `/ui/history` serves and what a reconnecting SSE stream is sent. */
433
+ readonly webChatHistory: WebChatHistory;
434
+ /** Uploaded files and the files the dashboard may fetch back (uploads, reply attachments). */
435
+ readonly webFiles: WebFileLedger;
390
436
  /**
391
437
  * Read from disk on every access rather than cached at startup: `agend
392
438
  * web-token rotate` runs in a separate process, and a cached copy would keep
393
439
  * authorizing revoked links and cookies until the fleet restarted.
394
440
  */
441
+ private settingsGeneration;
442
+ private settingsRuntimeRevision;
443
+ private settingsConfirmation;
444
+ private settingsControl;
445
+ private settingsJobSettlements;
446
+ private classicSettingsOwners;
447
+ private queueSettingsOperation;
448
+ private settingsGate;
449
+ private promptSettingsChange;
450
+ private handleSettingsChangeCallback;
451
+ startSettingsConfirmationControl(): Promise<void>;
395
452
  private get webToken();
453
+ /**
454
+ * Server-side web sessions (see web-session.ts). Created with the token, not per
455
+ * request: they are persisted, and a restart must find them again.
456
+ */
457
+ private webSessions;
458
+ /** Heartbeat of the dashboard's SSE stream; public so a test can shorten it. */
459
+ sseHeartbeatMs: number;
460
+ /** The dashboard's login codes. Memory only: a code that outlives the process is a code nobody can prove was not copied. */
461
+ private webLoginCodes;
396
462
  /**
397
463
  * Set while a Settings apply job is driving the reconcile. The reconcile
398
464
  * stays the single doer; it just says out loud what it is doing to whom, so
@@ -410,7 +476,6 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
410
476
  /** Set when the file on disk and the in-memory config disagree on a
411
477
  * startup-only key at startup. See checkStartupSignatureConsistency(). */
412
478
  private fleetSignatureMismatch;
413
- private viewToken;
414
479
  private healthServerListening;
415
480
  constructor(dataDir: string);
416
481
  private ensureDeliveryOutbox;
@@ -694,11 +759,51 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
694
759
  private sendWhenConnected;
695
760
  /** Poll for the instance's IPC to come back, then send. Throws if it does not. */
696
761
  private sendAfterIpcReturns;
762
+ /**
763
+ * Reserve the display echo before IPC handoff: a fast reply cannot overtake
764
+ * it. The web request settles admission without awaiting the platform POST.
765
+ * Only accepted messages send an echo; failures release replies normally.
766
+ * Each reservation has a 5s total monotonic ordering budget (queue/admission
767
+ * included). Expiry drops unstarted copies and releases replies. An adapter
768
+ * request already in flight may land late, but cannot retain the ordering lane.
769
+ */
770
+ /**
771
+ * Post an owner web-chat echo to every ClassicBot channel entry opted in
772
+ * for `instance` (#1320 part B). Per entry: the channel's own adapter, no
773
+ * thread, mention suppression on. Returns the number of channels posted
774
+ * to. Failures are per-entry warn-and-continue — a failed echo never fails
775
+ * the web send. Entries without `web_echo: true` are never touched.
776
+ *
777
+ * Every copy is fenced at start time: an entry whose explicit world is
778
+ * gone is skipped (only legacy adapterId-less entries fall back to the
779
+ * primary adapter); when running under a reservation, an exhausted
780
+ * ordering budget or a revoked delivery epoch stops the loop, and each
781
+ * entry is re-resolved against current registration so a removed opt-in
782
+ * or a rebound adapter is never posted through a stale route. A copy
783
+ * already in flight may still land late — the contract permits that.
784
+ */
785
+ sendClassicWebEcho(instance: string, text: string): Promise<number>;
786
+ reserveWebChannelEcho(instanceName: string, sendEcho: () => Promise<unknown>): (accepted: boolean) => void;
697
787
  /** Whether this target already has an ordinary non-user delivery in its FIFO. */
698
788
  hasPendingIdleGatedDelivery(instanceName: string): boolean;
789
+ /** The running launch's own steer capability (#1405); undefined for a backend without one, or no running Daemon. */
790
+ instanceLaunchSupportsSteer(instanceName: string): boolean | undefined;
699
791
  /** Single delivery facade: wake paused CLIs and serialize non-user work behind idle. */
700
792
  deliverToInstance(instanceName: string, payload: Record<string, unknown>, options?: DeliveryOptions): Promise<boolean | void>;
701
- /** Fleet admin is an explicit config allowlist entry, not merely an open/paired user. */
793
+ /**
794
+ * The fleet-admin list of exactly this adapter (#754): its `access.allowed_users`, read from fleet.yaml. An adapter
795
+ * id that matches no configured channel and no running adapter has NO list — it is never answered with the primary
796
+ * channel's, as `getChannelConfig` would. No id at all means the primary adapter, a single-adapter fleet's only one.
797
+ */
798
+ private adminListOf;
799
+ /**
800
+ * The one fleet-admin gate (#754): is this user an admin of the adapter that OWNS what they are acting on — the
801
+ * target instance's or General's adapter, never merely the one the request arrived on. An empty list means nobody
802
+ * (`disabled`, so the reply can say admin commands are off); an unknown adapter means nobody either (`denied`).
803
+ * Fleet admin is an explicit config entry: a paired or open-mode user is not one.
804
+ */
805
+ adminGate(userId: string, ownerAdapterId?: string): "ok" | "disabled" | "denied";
806
+ /** Fleet admin is an explicit config allowlist entry, not merely an open/paired user. See adminGate. */
702
807
  isFleetAdmin(userId: string, adapterId?: string): boolean;
703
808
  /** Whether this adapter has any fleet admin at all (an empty allowlist means the admin commands are off). */
704
809
  hasFleetAdmins(adapterId?: string): boolean;
@@ -724,13 +829,16 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
724
829
  * this caller speak here at all) and then the COMMAND TABLE (src/command-table.ts — does this command apply
725
830
  * in this kind of channel, and which kind of admin does it need). The table can only narrow what the door
726
831
  * let through. A command nobody registered is answered, not left to time out.
832
+ *
833
+ * The door, the table and the start of the command run in one synchronous stretch (#1399 review): no await between
834
+ * the check and the act, so the channel's instance cannot be rebound to another bot in between.
727
835
  */
728
836
  private dispatchSlash;
729
837
  /**
730
- * The door every Discord slash command goes through (src/slash-authz.ts has the rule and the reasoning).
731
- * Answers the caller itself when it refuses, so a refused command costs one reply and does nothing else.
838
+ * The door every Discord slash command goes through (src/slash-authz.ts has the rule and the reasoning): the scope
839
+ * it lets the command into, or the reply that refuses it. Synchronous, so the dispatch acts on what it judged.
732
840
  */
733
- private authorizeSlash;
841
+ private slashDoor;
734
842
  /** Phase 2: delivery_worker for a target (instance override → fleet default → wake_only). */
735
843
  deliveryWorkerMode(target: string): ReturnType<typeof resolveDeliveryWorkerMode>;
736
844
  /** Active instances mid-restart: they keep their warm slot through the stop → replacement gap. */
@@ -769,8 +877,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
769
877
  /** Deliver an already-resolved hot snapshot without depending on IPC timing. */
770
878
  private applyHotConfigUpdate;
771
879
  private classicBehaviorUpdate;
880
+ /** Compensation retains this transaction's exact instance owner across its own transitions. */
881
+ captureClassicSettingsRestoration(instanceName: string, changedFields: string[], execution?: SettingsExecution): () => Promise<void>;
772
882
  /** Apply a Settings edit to a ClassicBot channel without waiting for the poller. */
773
- restartClassicInstanceFromSettings(instanceName: string, changedFields?: string[]): Promise<void>;
883
+ restartClassicInstanceFromSettings(instanceName: string, changedFields?: string[], execution?: SettingsExecution): Promise<void>;
884
+ private restartClassicSettingsOwned;
774
885
  /** Reload classicBot.yaml once. Kept callable so the periodic production
775
886
  * path is covered without relying on fake timers around startAll(). */
776
887
  private reloadClassicConfigFromDisk;
@@ -782,7 +893,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
782
893
  */
783
894
  resumePaused?: boolean,
784
895
  /** Phase 2a: the caller's transition, for a start made from inside a restart or wake. */
785
- transition?: TransitionHandle): Promise<void>;
896
+ transition?: TransitionHandle, execution?: SettingsExecution): Promise<void>;
786
897
  /** Recreate a daemon for a marker-only paused instance after an explicit wake/delivery. */
787
898
  startPersistedPausedInstance(name: string, transition?: TransitionHandle): Promise<void>;
788
899
  /**
@@ -932,6 +1043,50 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
932
1043
  private loadEnvFile;
933
1044
  /** Initialize auth before any adapter can answer /dashboard. */
934
1045
  private initializeWebAuthTokens;
1046
+ private initializeWebSessions;
1047
+ /**
1048
+ * A single-use login code for the dashboard, for a channel only the operator
1049
+ * can read (`/dashboard`). Null while the panel is closed (no web.token).
1050
+ */
1051
+ issueDashboardLogin(): {
1052
+ display: string;
1053
+ expiresAt: number;
1054
+ ttlMinutes: number;
1055
+ } | null;
1056
+ private tunnelPurposeLane;
1057
+ private publicWebLink;
1058
+ private getTunnelLane;
1059
+ private publicOwnerCurrent;
1060
+ /** Exact owning General. No primary-adapter or name fallback participates in authorization. */
1061
+ private dashboardOwner;
1062
+ private getPublicWebLink;
1063
+ getPublicWebStatus(): {
1064
+ state: string;
1065
+ expiresAt?: number;
1066
+ remainingSeconds?: number;
1067
+ };
1068
+ confirmPublicWebLogin(info: {
1069
+ label: string;
1070
+ handle: string;
1071
+ owner: LoginCodeOwner;
1072
+ }, current: () => boolean): Promise<void>;
1073
+ /** Telegram's typed command enters through the same strict owner and nonce path as Discord. */
1074
+ dashboardMenu(msg: InboundMessage): Promise<void>;
1075
+ private sendLocalDashboard;
1076
+ private showDashboardMenu;
1077
+ private handleDashboardCallback;
1078
+ /** `/dashboard revoke`: sign out every browser and withdraw any unused code. */
1079
+ revokeWebSessions(): {
1080
+ count: number;
1081
+ durable: boolean;
1082
+ };
1083
+ /** Called by the sign-in endpoint: a login the operator did not make should be visible to them. */
1084
+ onWebLogin(info: {
1085
+ label: string;
1086
+ surface: "local" | "gateway";
1087
+ tier: string;
1088
+ handle: string;
1089
+ }): void;
935
1090
  getDashboardAccess(): {
936
1091
  ready: boolean;
937
1092
  token: string | null;
@@ -964,6 +1119,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
964
1119
  * mirroring classic chat-log rotation (same 7-day retention).
965
1120
  */
966
1121
  private rotateInboxes;
1122
+ /**
1123
+ * Web uploads no message took before a restart (#1273): removed once older than the upload window. Younger ones
1124
+ * are looked at again when the first comes due (an unref'd timer, so it never holds the process).
1125
+ */
1126
+ private sweepOrphanedWebUploads;
967
1127
  /** Start the shared channel adapter(s) for topic mode */
968
1128
  private startSharedAdapter;
969
1129
  /** Exponential backoff retry for a single failed adapter (background, non-blocking). */
@@ -1019,6 +1179,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1019
1179
  };
1020
1180
  /** Start the primary adapter (backward-compatible, sets this.adapter) */
1021
1181
  private startSingleAdapter;
1182
+ private startSingleAdapterOwned;
1022
1183
  /**
1023
1184
  * Register a Telegram connection's command menus; any other kind of channel has none to register. Started, not
1024
1185
  * awaited: a slow api.telegram.org must never hold up the adapter's login (each call has its own timeout). Never fatal.
@@ -1026,12 +1187,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1026
1187
  private registerTelegramCommandsFor;
1027
1188
  /** Start an additional (non-primary) adapter */
1028
1189
  private startAdditionalAdapter;
1190
+ private startAdditionalAdapterOwned;
1029
1191
  /** Connect IPC to a single instance with all handlers */
1030
1192
  connectIpcToInstance(name: string): Promise<void>;
1031
1193
  private connectIpcToInstanceInternal;
1032
1194
  /** Attempt IPC reconnection with exponential backoff */
1033
1195
  private ipcReconnect;
1034
1196
  private runIpcReconnect;
1197
+ private disposeSettingsAdapter;
1035
1198
  /** Restart a channel adapter after fatal error with infinite retry + 60s cap */
1036
1199
  private restartAdapter;
1037
1200
  /** Handle inbound message — transcribe voice if present, then route */
@@ -1126,8 +1289,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1126
1289
  /**
1127
1290
  * #1346: whether this copy may claim the shared dedup key for
1128
1291
  * command-like text. Fleet topics resolve an owning adapter and only its
1129
- * copy proceeds; anything else (classic targets, unknown routing, no
1130
- * identity) passes through to the existing handling.
1292
+ * copy proceeds. Classic targets and unknown routing keep their existing
1293
+ * handling. At the receiving Telegram world's own forum root, an explicit
1294
+ * suffix requires a known matching username before dedup; present-thread
1295
+ * copies retain their permissive handling when that identity is unknown.
1131
1296
  */
1132
1297
  private isOwnerCommandCopy;
1133
1298
  private resolveInboundTarget;
@@ -1158,10 +1323,21 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1158
1323
  * their fleet is organised. Both stay theirs — this only makes sure they are
1159
1324
  * not discovered by an agent failing at three in the morning.
1160
1325
  */
1326
+ /**
1327
+ * #1366: the first time a fleet runs 2.2 or later, tell each chat platform's General — once — that its agents can
1328
+ * now be talked to from a browser. Claimed in upgrade-notices.json before the send, released if the send fails.
1329
+ * Platforms with nowhere to post fleet notices (no group, or a Discord fleet with no General channel) are skipped
1330
+ * and not recorded, so they are told once they have one.
1331
+ */
1332
+ announceWebChatOnce(version: string): Promise<void>;
1161
1333
  private announceToolPermissionsChange;
1162
1334
  private checkToolPermission;
1163
1335
  private handleOutboundFromInstance;
1164
1336
  /** Side effects of a routed reply: cancel-button lifecycle, logs, SSE, chat log. */
1337
+ /** No chat platform is configured at all: the web dashboard is the fleet's only surface. */
1338
+ private isWebOnlyFleet;
1339
+ /** On a fleet with no chat platform, the dashboard is where an instance-health prompt is posted (#1307 item 6). */
1340
+ private webOnlyPromptPlace;
1165
1341
  private afterReplyRouted;
1166
1342
  private handleScheduleTrigger;
1167
1343
  /**
@@ -1195,6 +1371,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1195
1371
  private scheduleSourceAdapter;
1196
1372
  private notifySourceTopic;
1197
1373
  private notifyScheduleFailure;
1374
+ /**
1375
+ * #1426: a deferred occurrence's retry will not run — superseded by the next occurrence, deferred again, or its wait
1376
+ * capped. Recorded as `deferred → skipped (…)`, and said in the schedule's own chat with its admins @mentioned:
1377
+ * this is the case that used to be a silently lost day.
1378
+ */
1379
+ private scheduleRetryDropped;
1198
1380
  /**
1199
1381
  * The typed IPC messages, all through one door.
1200
1382
  *
@@ -1316,11 +1498,15 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1316
1498
  * non-identity instance leaves are canonicalized to inheritance afterward.
1317
1499
  */
1318
1500
  saveFleetConfig(explicitPatches?: RawConfigPatch[]): void;
1501
+ /** Why the config written to `candidate` must not replace fleet.yaml, or null: it does not load, or it adds errors. */
1502
+ private savedFleetConfigProblem;
1319
1503
  /** One-time upgrade migration; invalid YAML is never rewritten. */
1320
1504
  private slimFleetConfigAtStartup;
1321
1505
  private writeFleetConfigBackup;
1322
1506
  private patchFleetDocument;
1323
- removeInstance(name: string, authorization: ExplicitInstanceRemoval): Promise<void>;
1507
+ getSettingsConfigPath(): string;
1508
+ removeInstance(name: string, authorization: ExplicitInstanceRemoval, execution?: SettingsExecution): Promise<void>;
1509
+ private removeInstanceOwned;
1324
1510
  startStatuslineWatcher(name: string): void;
1325
1511
  stopStatuslineWatcher(name: string): void;
1326
1512
  /**
@@ -1331,6 +1517,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1331
1517
  * to a plain add (never worse than the old behaviour).
1332
1518
  */
1333
1519
  private lastStatusEmoji;
1520
+ /**
1521
+ * #1056: every status emoji each bot really stamped, per `${adapterId}:${messageId}` (match keys). A connection's
1522
+ * status set can change while AgEnD runs, so "is this a stamp?" cannot be answered from the current set alone: a
1523
+ * bot's earlier stamp in the old emoji must still be plumbing, not an agent's reaction. Unbounded for the same
1524
+ * reason as lastStatusEmoji (a few short strings per stamped message).
1525
+ */
1526
+ private stampedStatus;
1527
+ private noteStamped;
1334
1528
  /**
1335
1529
  * One in-flight status update per bot+message: updates run strictly in call
1336
1530
  * order, so a delayed ❌ add can never land after a newer ✅'s removal —
@@ -1355,6 +1549,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1355
1549
  platform: string | undefined;
1356
1550
  };
1357
1551
  private warnedStatusEmojis;
1552
+ /**
1553
+ * The connection whose `options.status_emojis` an instance on `worldId` stamps with. #1056: read from the live config
1554
+ * first — a Settings save replaces `fleetConfig.channels`, and the running world keeps the object it started with —
1555
+ * so a change to the connection's emojis applies at the next stamp, as an instance's own override does. Only the
1556
+ * emoji options are taken from it: the platform is still the running adapter's (resolveStatusEmojisFor).
1557
+ */
1558
+ private statusEmojiChannel;
1358
1559
  /**
1359
1560
  * A Discord connection's server emojis for the Settings picker (#1005), from
1360
1561
  * every server its bot can draw on (#1021): the primary `group_id` server,
@@ -1480,6 +1681,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1480
1681
  */
1481
1682
  private savedAttachmentReactionFor;
1482
1683
  reactMessageStatus(instanceName: string, chatId: string, messageId: string, status: DeliveryStatus, threadId?: string, receivedAt?: number): void;
1684
+ /** One delivery report for a web user's message: recorded with it, and sent to the pages when it moved. */
1685
+ private reportWebDelivery;
1483
1686
  /**
1484
1687
  * Apply a terminal delivery verdict. On Telegram the built-in delivered is
1485
1688
  * 👀 and failed is 👎; Discord shows ✅/❌ — both configurable (#1005).
@@ -1545,6 +1748,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1545
1748
  * retention, and the caller is the original source or target (#1340 P2 🔒).
1546
1749
  */
1547
1750
  wasDeliveryIdPrunedForCaller(deliveryId: string, callerInstance: string): boolean;
1751
+ /** How long opening events.db waits for another process's lock (a field so tests need not wait 5 s). */
1752
+ private eventLogBusyTimeoutMs;
1548
1753
  private openEventLog;
1549
1754
  /**
1550
1755
  * Report a fleet-level fault (not attributable to one instance) to the General
@@ -1660,6 +1865,67 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1660
1865
  private handleRetiredPromptButton;
1661
1866
  /** Routes a click to the handler that owns its prefix; false when none does. */
1662
1867
  private dispatchAdapterCallback;
1868
+ /**
1869
+ * A prompt the dashboard was offered is no longer open (answered on either surface, expired, or its
1870
+ * instance stopped): every page drops its buttons, and shows `outcome` when there is one.
1871
+ */
1872
+ private webPromptGone;
1873
+ /** The interaction wait an instance is in now, as a comparable key: which daemon/spawn owns it, and its episode. */
1874
+ private interactionWaitKey;
1875
+ /** An instance's interaction observation, pause or wake changed (relayed by the lifecycle): recompute now, not at the tick. */
1876
+ onAttentionChanged(name: string): void;
1877
+ /** The list for the web: every world's items, and those of instances with no world (#1386 §5.0). */
1878
+ needsYouItems(): WebNeedsItem[];
1879
+ /**
1880
+ * #1389: the org chart's structure for the web — the instances the dashboard lists (getUiStatus's names), General,
1881
+ * fleet.yaml's teams, each instance's description and thread link. Read on demand; the live state rides the stream.
1882
+ */
1883
+ orgChart(): OrgChart;
1884
+ private cacheService;
1885
+ /**
1886
+ * #1468: the prompt-cache expiry analysis for the web, per instance, over `window`. Read from each instance's
1887
+ * ledger as it is now; the first request starts the bounded, persisted catch-up over the transcripts
1888
+ * (cache-service.ts) — never a vendor call, never a synchronous transcript read.
1889
+ */
1890
+ cacheReport(window: string): Promise<CacheReport>;
1891
+ /** The web's Acknowledge (any item; a signed-in session is fleet-admin level). */
1892
+ acknowledgeNeedsItem(id: string, principal: string): {
1893
+ status: 200 | 400 | 404 | 409 | 500;
1894
+ message: string;
1895
+ };
1896
+ private needsYouInstances;
1897
+ private needsYouPrompts;
1898
+ /**
1899
+ * Shutdown: detach the hub first — nothing reaches it from here on, and the next startAll (finishStartup) builds a
1900
+ * fresh one; the old one's late ACKs are fenced by its own stop (#1398 review) — then let it retire its live
1901
+ * messages, bounded so a platform that does not answer cannot hold the shutdown.
1902
+ */
1903
+ private stopNeedsYou;
1904
+ private startNeedsYou;
1905
+ /** The prompts open on the dashboard right now (a page that loads after one was posted asks for them). */
1906
+ listWebPrompts(): Array<{
1907
+ instance: string;
1908
+ nonce: string;
1909
+ text: string;
1910
+ actions: Array<{
1911
+ id: string;
1912
+ label: string;
1913
+ }>;
1914
+ expiresAt: number;
1915
+ }>;
1916
+ /**
1917
+ * A click on a prompt in the web dashboard (web track C4). It is the platform click, made by the
1918
+ * dashboard: the same handler, the same single claim (whoever answers first — here or on Telegram —
1919
+ * wins), and the platform's buttons collapse to the outcome exactly as for a click there.
1920
+ *
1921
+ * The caller has passed the /ui gate (session, same origin, CSRF). Here: the prompt must be one offered
1922
+ * on the dashboard, about the instance the page named, and the action one of its own buttons.
1923
+ */
1924
+ clickWebPrompt(instance: string, nonce: string, action: string): Promise<{
1925
+ status: 200 | 400 | 403 | 409;
1926
+ error?: string;
1927
+ outcome?: string;
1928
+ }>;
1663
1929
  private retireNonceButtons;
1664
1930
  private tipsEnabled;
1665
1931
  private readTipState;
@@ -1676,6 +1942,24 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1676
1942
  private handleTipUnlock;
1677
1943
  /** Post the destructive `/clear` confirmation in the invoking channel. */
1678
1944
  promptClearConfirmation(instanceName: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
1945
+ /**
1946
+ * What a confirmed /clear must still find when it acts — shared by the platform's Confirm button and the web
1947
+ * (#1269): the same daemon and IPC client, the same interaction owner, lifecycle epoch and delivery epoch as when the
1948
+ * fence was taken. Null when there is no owner to pin (then nothing may be cleared). The reads are cached and
1949
+ * synchronous; they never probe the pane.
1950
+ */
1951
+ private clearTargetFence;
1952
+ /** #1269: the web's /clear confirmations — one token per question, used once, for the instance as it was asked about. */
1953
+ private readonly webClearTokens;
1954
+ /** #1269: an instance's chat command from the web chat (web-commands.ts); `publicLink`: a gateway request. */
1955
+ webCommand(input: {
1956
+ instance: string;
1957
+ command: string;
1958
+ args?: string;
1959
+ confirm?: string;
1960
+ }, opts: {
1961
+ publicLink: boolean;
1962
+ }): Promise<WebCommandResult>;
1679
1963
  /** Consume `/clear` Confirm/Cancel exactly once; only Confirm reaches IPC. */
1680
1964
  private handleClearConfirmation;
1681
1965
  /**
@@ -1753,6 +2037,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1753
2037
  * instance that has already started a new turn.
1754
2038
  */
1755
2039
  private handleCancelClick;
2040
+ /** Where an instance's cancel button is posted — and so the only place a click on it can come from. */
2041
+ private cancelButtonDestination;
2042
+ /**
2043
+ * A click came from this destination. A Discord click names the guild as its chat and the channel as its thread; a
2044
+ * Telegram click names the chat and topic, with the General topic as thread 1 or none at all.
2045
+ */
2046
+ private clickAtDestination;
1756
2047
  private hasCancelButton;
1757
2048
  private beginCancelButtonPublication;
1758
2049
  /** Remember a clear/cancel/idle decision that arrived before notifyAlert
@@ -1877,6 +2168,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1877
2168
  cancelInstance(instanceName: string): boolean;
1878
2169
  getDeliveryEpoch(instanceName: string): number;
1879
2170
  private isDeliveryEpochCurrent;
2171
+ /** The delivery epoch, and the caller's own fence when it gave one (DeliveryOptions.stillCurrent, #1426). */
2172
+ private deliveryCurrent;
1880
2173
  /** Invalidate work queued before a user cancel and wake idle-gate waiters. */
1881
2174
  private cancelPendingDeliveries;
1882
2175
  /** Web-terminal login: the only sign-in path (the chat-relay mode was removed, #1139). */
@@ -1927,6 +2220,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1927
2220
  * happened to be paused. General is still told the outcome.
1928
2221
  */
1929
2222
  private applyClassicApproval;
2223
+ private notifyClassicRequester;
1930
2224
  /** Consume a ClassicBot approval button. */
1931
2225
  private handleClassicApproval;
1932
2226
  /**
@@ -2195,7 +2489,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2195
2489
  /** `/effort` — DC Select Menu, or apply directly when a level is given. */
2196
2490
  private handleEffortSlash;
2197
2491
  /** TG inline-keyboard effort menu. Returns null on success, else a fallback string. */
2198
- promptEffortMenu(instanceName: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
2492
+ promptEffortMenu(instanceName: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string, adapterId?: string): Promise<string | null>;
2199
2493
  /** Consume an `/effort` selection callback. Mirrors handleModelSelection. */
2200
2494
  private handleEffortSelection;
2201
2495
  private handleModelSlash;
@@ -2204,7 +2498,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2204
2498
  * pendingModelSelects coordinator as the DC Select Menu path.
2205
2499
  * Returns null on success (menu shown), or a fallback string to send.
2206
2500
  */
2207
- promptModelMenu(instanceName: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
2501
+ promptModelMenu(instanceName: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string, adapterId?: string): Promise<string | null>;
2208
2502
  /** Cached-or-live account catalog behind "/model → more models" (claude). */
2209
2503
  private claudeApiModelOptions;
2210
2504
  /** Replace a consumed "/model" menu with the full account catalog tier. */
@@ -2221,6 +2515,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2221
2515
  * menu, because a picker with no rows cannot even offer another refresh.
2222
2516
  */
2223
2517
  private refreshModelMenu;
2518
+ /**
2519
+ * A /model or /effort menu click may still act (#1396 review): the instance is still owned by the adapter the click
2520
+ * came through (it may have been rebound since the menu opened) and the clicker is still that channel's admin. Asked
2521
+ * when the click is claimed and again right before the change is applied.
2522
+ */
2523
+ private menuClickStillCurrent;
2524
+ /** Current source-to-target mapping, including same-adapter topic moves. */
2525
+ private commandChannelStillTargets;
2224
2526
  /** Consume a `/model` selection callback. Returns true for all model-select ids (incl. stale). */
2225
2527
  private handleModelSelection;
2226
2528
  /** Apply a model to an instance: runtime paste (claude-code) or persist + restart (others). */
@@ -2268,6 +2570,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2268
2570
  * you @mention the bot; on Discord, @mention or `/chat`. The chat's platform is the adapter it came through.
2269
2571
  */
2270
2572
  private classicStartKey;
2573
+ /** Approval is a system notification: General's agent need not be running. */
2574
+ private findClassicApprovalGeneral;
2271
2575
  /** Return a user-facing blocker without mutating ClassicBot state. */
2272
2576
  private validateClassicStart;
2273
2577
  private isBackendInstalled;
@@ -2407,6 +2711,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2407
2711
  verificationId: string;
2408
2712
  sessionBinding: string;
2409
2713
  idempotencyKey: string;
2714
+ execution?: SettingsExecution;
2410
2715
  }): {
2411
2716
  job: ProviderSecretApplyJob;
2412
2717
  reused: boolean;
@@ -2450,6 +2755,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2450
2755
  verificationId: string;
2451
2756
  sessionBinding: string;
2452
2757
  idempotencyKey: string;
2758
+ execution?: SettingsExecution;
2453
2759
  }): {
2454
2760
  job: SecretApplyJob;
2455
2761
  reused: boolean;
@@ -2484,6 +2790,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2484
2790
  verificationId: string;
2485
2791
  sessionBinding: string;
2486
2792
  idempotencyKey: string;
2793
+ execution?: SettingsExecution;
2487
2794
  }): {
2488
2795
  job: SecretApplyJob;
2489
2796
  reused: boolean;
@@ -2539,7 +2846,27 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2539
2846
  * Only the parsed host name is logged, never the raw header.
2540
2847
  */
2541
2848
  private noteRejectedHost;
2849
+ /** Shared handler dispatcher; gateway admission is enforced by its separate listener. */
2850
+ private dispatchWebHttp;
2542
2851
  private startHealthServer;
2852
+ /**
2853
+ * #1306: the preview listener, beside the web listener and closed with it. When it cannot listen (the port is
2854
+ * taken, web.preview: false), cards show Source and Download only; nothing else changes.
2855
+ */
2856
+ private startPreviewListener;
2857
+ /** What a reload may change hot: web.preview, and the dashboard names (the shim's allow-list and frame-ancestors). */
2858
+ private previewInputsSignature;
2859
+ /**
2860
+ * After a config reload: web.preview true→false stops the listener at once (/ui then offers no origin, boot or
2861
+ * frame-src), false→true starts it, and a change of dashboard names rebuilds it (a new boot id). preview_port and
2862
+ * preview_origin are not adopted here: they are startup-only, and the reload reports "restart required".
2863
+ */
2864
+ private reconcilePreviewListener;
2865
+ private stopPreviewListener;
2866
+ /** For one /ui load: the preview origin it may frame, and the listener's boot id (see web-preview.ts). */
2867
+ previewForUi(hostHeader: string | undefined, secure: boolean): PreviewAvailability & {
2868
+ boot: string | null;
2869
+ };
2543
2870
  getUiStatus(): unknown;
2544
2871
  private getUiStatusSync;
2545
2872
  }