@songsid/agend 2.2.0-beta.1 → 2.2.0-beta.11

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 (401) hide show
  1. package/README.md +1 -1
  2. package/README.zh-TW.md +1 -1
  3. package/dist/agent-cli-instructions.md +16 -9
  4. package/dist/agent-cli.js +15 -7
  5. package/dist/agent-cli.js.map +1 -1
  6. package/dist/agent-endpoint.js +24 -9
  7. package/dist/agent-endpoint.js.map +1 -1
  8. package/dist/agent-whats-new.d.ts +47 -0
  9. package/dist/agent-whats-new.js +147 -0
  10. package/dist/agent-whats-new.js.map +1 -0
  11. package/dist/auth-api.d.ts +5 -3
  12. package/dist/auth-api.js +19 -3
  13. package/dist/auth-api.js.map +1 -1
  14. package/dist/backend/antigravity.d.ts +8 -0
  15. package/dist/backend/antigravity.js +32 -9
  16. package/dist/backend/antigravity.js.map +1 -1
  17. package/dist/backend/claude-carry.d.ts +22 -0
  18. package/dist/backend/claude-carry.js +170 -0
  19. package/dist/backend/claude-carry.js.map +1 -0
  20. package/dist/backend/claude-code.d.ts +65 -2
  21. package/dist/backend/claude-code.js +226 -33
  22. package/dist/backend/claude-code.js.map +1 -1
  23. package/dist/backend/codex-metadata.d.ts +33 -0
  24. package/dist/backend/codex-metadata.js +122 -18
  25. package/dist/backend/codex-metadata.js.map +1 -1
  26. package/dist/backend/codex.d.ts +3 -0
  27. package/dist/backend/codex.js +17 -1
  28. package/dist/backend/codex.js.map +1 -1
  29. package/dist/backend/credential-profile.d.ts +40 -3
  30. package/dist/backend/credential-profile.js +113 -5
  31. package/dist/backend/credential-profile.js.map +1 -1
  32. package/dist/backend/effort-metadata.d.ts +37 -1
  33. package/dist/backend/effort-metadata.js +86 -15
  34. package/dist/backend/effort-metadata.js.map +1 -1
  35. package/dist/backend/grok.d.ts +4 -0
  36. package/dist/backend/grok.js +14 -0
  37. package/dist/backend/grok.js.map +1 -1
  38. package/dist/backend/kiro-engine-ledger.d.ts +5 -0
  39. package/dist/backend/kiro-engine-ledger.js +20 -0
  40. package/dist/backend/kiro-engine-ledger.js.map +1 -1
  41. package/dist/backend/kiro-identity.d.ts +6 -0
  42. package/dist/backend/kiro-identity.js +19 -5
  43. package/dist/backend/kiro-identity.js.map +1 -1
  44. package/dist/backend/kiro.d.ts +39 -3
  45. package/dist/backend/kiro.js +143 -19
  46. package/dist/backend/kiro.js.map +1 -1
  47. package/dist/backend/launch-effort.d.ts +61 -0
  48. package/dist/backend/launch-effort.js +170 -0
  49. package/dist/backend/launch-effort.js.map +1 -0
  50. package/dist/backend/muse.d.ts +84 -0
  51. package/dist/backend/muse.js +449 -53
  52. package/dist/backend/muse.js.map +1 -1
  53. package/dist/backend/types.d.ts +47 -4
  54. package/dist/backend/types.js +12 -1
  55. package/dist/backend/types.js.map +1 -1
  56. package/dist/backend-command.d.ts +91 -0
  57. package/dist/backend-command.js +122 -0
  58. package/dist/backend-command.js.map +1 -0
  59. package/dist/background-work-ended.d.ts +18 -0
  60. package/dist/background-work-ended.js +30 -0
  61. package/dist/background-work-ended.js.map +1 -0
  62. package/dist/cache-service.d.ts +2 -0
  63. package/dist/cache-service.js +2 -1
  64. package/dist/cache-service.js.map +1 -1
  65. package/dist/channel/adapters/discord.d.ts +36 -1
  66. package/dist/channel/adapters/discord.js +126 -4
  67. package/dist/channel/adapters/discord.js.map +1 -1
  68. package/dist/channel/adapters/telegram.d.ts +42 -2
  69. package/dist/channel/adapters/telegram.js +142 -23
  70. package/dist/channel/adapters/telegram.js.map +1 -1
  71. package/dist/channel/mcp-server.js +9 -1
  72. package/dist/channel/mcp-server.js.map +1 -1
  73. package/dist/channel/mcp-tools.d.ts +11 -0
  74. package/dist/channel/mcp-tools.js +26 -13
  75. package/dist/channel/mcp-tools.js.map +1 -1
  76. package/dist/channel/message-edit-errors.d.ts +5 -0
  77. package/dist/channel/message-edit-errors.js +24 -0
  78. package/dist/channel/message-edit-errors.js.map +1 -0
  79. package/dist/channel/telegram-markdown.d.ts +6 -0
  80. package/dist/channel/telegram-markdown.js +104 -0
  81. package/dist/channel/telegram-markdown.js.map +1 -0
  82. package/dist/channel/tool-router.d.ts +2 -0
  83. package/dist/channel/tool-router.js +10 -4
  84. package/dist/channel/tool-router.js.map +1 -1
  85. package/dist/channel/types.d.ts +55 -3
  86. package/dist/cli.js +167 -39
  87. package/dist/cli.js.map +1 -1
  88. package/dist/command-table.d.ts +2 -2
  89. package/dist/command-table.js +6 -3
  90. package/dist/command-table.js.map +1 -1
  91. package/dist/config-validator.js +59 -0
  92. package/dist/config-validator.js.map +1 -1
  93. package/dist/cross-instance-envelope.d.ts +15 -2
  94. package/dist/cross-instance-envelope.js +29 -5
  95. package/dist/cross-instance-envelope.js.map +1 -1
  96. package/dist/daemon.d.ts +156 -1
  97. package/dist/daemon.js +773 -89
  98. package/dist/daemon.js.map +1 -1
  99. package/dist/delivery-outbox.d.ts +70 -8
  100. package/dist/delivery-outbox.js +315 -24
  101. package/dist/delivery-outbox.js.map +1 -1
  102. package/dist/delivery-reconciliation.d.ts +18 -1
  103. package/dist/delivery-reconciliation.js +67 -2
  104. package/dist/delivery-reconciliation.js.map +1 -1
  105. package/dist/fleet-context.d.ts +10 -1
  106. package/dist/fleet-manager.d.ts +404 -13
  107. package/dist/fleet-manager.js +2039 -210
  108. package/dist/fleet-manager.js.map +1 -1
  109. package/dist/general-knowledge/skills/backend-providers/SKILL.md +1 -1
  110. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +92 -21
  111. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +27 -3
  112. package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +8 -8
  113. package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -5
  114. package/dist/general-knowledge/skills/fleet-health/SKILL.md +4 -4
  115. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +13 -13
  116. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -2
  117. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +6 -0
  118. package/dist/general-knowledge/skills/model-discovery/SKILL.md +12 -9
  119. package/dist/general-knowledge/skills/multi-channel/SKILL.md +8 -2
  120. package/dist/general-knowledge/skills/scheduling/SKILL.md +5 -3
  121. package/dist/general-knowledge/skills/session-management/SKILL.md +6 -5
  122. package/dist/general-knowledge/skills/tui-effort/SKILL.md +2 -2
  123. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +8 -3
  124. package/dist/general-knowledge/steering/core-rules.md +8 -7
  125. package/dist/host-memory.d.ts +10 -0
  126. package/dist/host-memory.js +33 -1
  127. package/dist/host-memory.js.map +1 -1
  128. package/dist/human-delivery-receipts.d.ts +83 -0
  129. package/dist/human-delivery-receipts.js +194 -0
  130. package/dist/human-delivery-receipts.js.map +1 -0
  131. package/dist/instance-avatar.d.ts +36 -0
  132. package/dist/instance-avatar.js +57 -0
  133. package/dist/instance-avatar.js.map +1 -0
  134. package/dist/instance-config-impact.js +6 -0
  135. package/dist/instance-config-impact.js.map +1 -1
  136. package/dist/instance-lifecycle.d.ts +29 -6
  137. package/dist/instance-lifecycle.js +79 -28
  138. package/dist/instance-lifecycle.js.map +1 -1
  139. package/dist/instructions.d.ts +3 -1
  140. package/dist/instructions.js +11 -8
  141. package/dist/instructions.js.map +1 -1
  142. package/dist/kiro-log-gate.d.ts +42 -0
  143. package/dist/kiro-log-gate.js +39 -0
  144. package/dist/kiro-log-gate.js.map +1 -0
  145. package/dist/locale.js +226 -44
  146. package/dist/locale.js.map +1 -1
  147. package/dist/log-service.d.ts +99 -0
  148. package/dist/log-service.js +243 -0
  149. package/dist/log-service.js.map +1 -0
  150. package/dist/log-steps.d.ts +169 -0
  151. package/dist/log-steps.js +858 -0
  152. package/dist/log-steps.js.map +1 -0
  153. package/dist/login-controller.d.ts +20 -3
  154. package/dist/login-controller.js +71 -19
  155. package/dist/login-controller.js.map +1 -1
  156. package/dist/login-flows.d.ts +5 -2
  157. package/dist/login-flows.js +5 -4
  158. package/dist/login-flows.js.map +1 -1
  159. package/dist/memory-pressure.d.ts +13 -1
  160. package/dist/memory-pressure.js +50 -10
  161. package/dist/memory-pressure.js.map +1 -1
  162. package/dist/needs-you-hub.js +2 -0
  163. package/dist/needs-you-hub.js.map +1 -1
  164. package/dist/needs-you-live.d.ts +6 -0
  165. package/dist/needs-you-live.js +23 -3
  166. package/dist/needs-you-live.js.map +1 -1
  167. package/dist/next-steps.js +1 -1
  168. package/dist/next-steps.js.map +1 -1
  169. package/dist/outbound-handlers.d.ts +100 -0
  170. package/dist/outbound-handlers.js +284 -97
  171. package/dist/outbound-handlers.js.map +1 -1
  172. package/dist/outbound-schemas.d.ts +38 -15
  173. package/dist/outbound-schemas.js +36 -8
  174. package/dist/outbound-schemas.js.map +1 -1
  175. package/dist/public-link-progress.d.ts +1 -1
  176. package/dist/public-link-progress.js +8 -2
  177. package/dist/public-link-progress.js.map +1 -1
  178. package/dist/public-preview.d.ts +101 -0
  179. package/dist/public-preview.js +236 -0
  180. package/dist/public-preview.js.map +1 -0
  181. package/dist/public-web-gateway.js +14 -4
  182. package/dist/public-web-gateway.js.map +1 -1
  183. package/dist/public-web-link.d.ts +24 -1
  184. package/dist/public-web-link.js +63 -9
  185. package/dist/public-web-link.js.map +1 -1
  186. package/dist/reply-buttons-controller.d.ts +89 -5
  187. package/dist/reply-buttons-controller.js +273 -8
  188. package/dist/reply-buttons-controller.js.map +1 -1
  189. package/dist/reply-buttons.d.ts +48 -3
  190. package/dist/reply-buttons.js +105 -10
  191. package/dist/reply-buttons.js.map +1 -1
  192. package/dist/reply-polls.d.ts +85 -0
  193. package/dist/reply-polls.js +154 -0
  194. package/dist/reply-polls.js.map +1 -0
  195. package/dist/restart-guard.d.ts +6 -3
  196. package/dist/restart-guard.js +6 -3
  197. package/dist/restart-guard.js.map +1 -1
  198. package/dist/restart-progress.d.ts +33 -0
  199. package/dist/restart-progress.js +30 -0
  200. package/dist/restart-progress.js.map +1 -1
  201. package/dist/service-activation.d.ts +15 -7
  202. package/dist/service-activation.js +46 -29
  203. package/dist/service-activation.js.map +1 -1
  204. package/dist/service-installer.d.ts +31 -0
  205. package/dist/service-installer.js +41 -2
  206. package/dist/service-installer.js.map +1 -1
  207. package/dist/settings-api.js +85 -25
  208. package/dist/settings-api.js.map +1 -1
  209. package/dist/settings-change.js +72 -1
  210. package/dist/settings-change.js.map +1 -1
  211. package/dist/settings-effect.js +28 -4
  212. package/dist/settings-effect.js.map +1 -1
  213. package/dist/settings-http-confirmation.js +7 -0
  214. package/dist/settings-http-confirmation.js.map +1 -1
  215. package/dist/setup-form.d.ts +1 -1
  216. package/dist/setup-form.js +1 -1
  217. package/dist/spawn-gate.js +5 -1
  218. package/dist/spawn-gate.js.map +1 -1
  219. package/dist/spawn-hold-reply.d.ts +12 -0
  220. package/dist/spawn-hold-reply.js +39 -0
  221. package/dist/spawn-hold-reply.js.map +1 -0
  222. package/dist/status-emojis.d.ts +10 -3
  223. package/dist/status-emojis.js +11 -2
  224. package/dist/status-emojis.js.map +1 -1
  225. package/dist/systemd-peer-bus.d.ts +95 -0
  226. package/dist/systemd-peer-bus.js +430 -0
  227. package/dist/systemd-peer-bus.js.map +1 -0
  228. package/dist/systemd-runtime.d.ts +27 -1
  229. package/dist/systemd-runtime.js +69 -7
  230. package/dist/systemd-runtime.js.map +1 -1
  231. package/dist/tips.js +4 -4
  232. package/dist/tips.js.map +1 -1
  233. package/dist/tool-permissions.js +3 -3
  234. package/dist/tool-permissions.js.map +1 -1
  235. package/dist/tool-progress.js +3 -2
  236. package/dist/tool-progress.js.map +1 -1
  237. package/dist/topic-commands.d.ts +42 -2
  238. package/dist/topic-commands.js +101 -11
  239. package/dist/topic-commands.js.map +1 -1
  240. package/dist/transcript-delta-reader.d.ts +3 -3
  241. package/dist/transcript-delta-reader.js +8 -8
  242. package/dist/transcript-delta-reader.js.map +1 -1
  243. package/dist/transcript-jsonl.d.ts +80 -3
  244. package/dist/transcript-jsonl.js +147 -10
  245. package/dist/transcript-jsonl.js.map +1 -1
  246. package/dist/transcript-monitor.d.ts +19 -0
  247. package/dist/transcript-monitor.js +87 -15
  248. package/dist/transcript-monitor.js.map +1 -1
  249. package/dist/transcript-sources.d.ts +78 -0
  250. package/dist/transcript-sources.js +375 -64
  251. package/dist/transcript-sources.js.map +1 -1
  252. package/dist/transcript-turns.d.ts +15 -2
  253. package/dist/transcript-turns.js +15 -2
  254. package/dist/transcript-turns.js.map +1 -1
  255. package/dist/tunnel/cloudflared.d.ts +7 -15
  256. package/dist/tunnel/cloudflared.js +36 -1
  257. package/dist/tunnel/cloudflared.js.map +1 -1
  258. package/dist/tunnel/purpose-lane.d.ts +5 -1
  259. package/dist/tunnel/purpose-lane.js +14 -7
  260. package/dist/tunnel/purpose-lane.js.map +1 -1
  261. package/dist/tunnel/types.d.ts +5 -1
  262. package/dist/tunnel/types.js.map +1 -1
  263. package/dist/turn-resume.d.ts +2 -0
  264. package/dist/turn-resume.js +1 -1
  265. package/dist/turn-resume.js.map +1 -1
  266. package/dist/types.d.ts +25 -0
  267. package/dist/ui/chat-commands.js +1 -0
  268. package/dist/ui/chat-emojis.js +33 -0
  269. package/dist/ui/chat-mentions.js +63 -0
  270. package/dist/ui/chat-render.js +61 -4
  271. package/dist/ui/chat-store.js +37 -3
  272. package/dist/ui/chat-strings.js +40 -20
  273. package/dist/ui/chat-thread.js +111 -12
  274. package/dist/ui/chat-time.js +80 -0
  275. package/dist/ui/panel-chat.js +41 -10
  276. package/dist/ui/panel-details.js +2 -0
  277. package/dist/ui/panel-fleet.js +199 -57
  278. package/dist/ui/panel-log.js +428 -0
  279. package/dist/ui/panel-needs.js +6 -2
  280. package/dist/ui/panel-settings.js +184 -32
  281. package/dist/ui/preview-panel.js +55 -15
  282. package/dist/ui/preview-status.js +28 -0
  283. package/dist/ui/preview.js +44 -3
  284. package/dist/ui/settings-dialogs.js +7 -2
  285. package/dist/ui/settings-model.js +2 -1
  286. package/dist/ui/settings-strings.js +56 -4
  287. package/dist/ui/settings-token.js +1 -1
  288. package/dist/ui/shared/app-i18n.js +43 -17
  289. package/dist/ui/shared/app-prefs.js +250 -0
  290. package/dist/ui/shared/app-route.js +7 -2
  291. package/dist/ui/shared/app-shell.js +165 -8
  292. package/dist/ui/shared/app-store.js +5 -1
  293. package/dist/ui/shared/app-stream.js +26 -5
  294. package/dist/ui/shared/app.css +163 -22
  295. package/dist/ui/shared/app.js +11 -1
  296. package/dist/ui/shared/fonts/README.md +1 -1
  297. package/dist/ui/shared/header-tools.js +55 -5
  298. package/dist/ui/shared/instance-nav.js +241 -45
  299. package/dist/ui/shared/instance-switch.js +4 -4
  300. package/dist/ui/shared/panel-view.js +6 -0
  301. package/dist/ui/shared/signin.js +7 -7
  302. package/dist/ui/shared/theme.js +39 -7
  303. package/dist/ui/shared/tokens.css +1 -1
  304. package/dist/ui/shared/ui-icons.js +1 -0
  305. package/dist/ui/shared/usage-dialog.js +23 -5
  306. package/dist/ui/shared/view-strings.js +32 -4
  307. package/dist/ui/signin.html +1 -1
  308. package/dist/unrecognised-prompt.d.ts +23 -0
  309. package/dist/unrecognised-prompt.js +74 -0
  310. package/dist/unrecognised-prompt.js.map +1 -0
  311. package/dist/update-check.d.ts +31 -0
  312. package/dist/update-check.js +47 -0
  313. package/dist/update-check.js.map +1 -1
  314. package/dist/update-install.d.ts +28 -2
  315. package/dist/update-install.js +22 -4
  316. package/dist/update-install.js.map +1 -1
  317. package/dist/update-launch.d.ts +46 -1
  318. package/dist/update-launch.js +146 -3
  319. package/dist/update-launch.js.map +1 -1
  320. package/dist/update-marker.d.ts +51 -0
  321. package/dist/update-marker.js +61 -0
  322. package/dist/update-marker.js.map +1 -1
  323. package/dist/update-preflight.d.ts +100 -0
  324. package/dist/update-preflight.js +264 -0
  325. package/dist/update-preflight.js.map +1 -0
  326. package/dist/updater-caller.d.ts +31 -0
  327. package/dist/updater-caller.js +109 -0
  328. package/dist/updater-caller.js.map +1 -0
  329. package/dist/usage/i18n-keys.d.ts +1 -1
  330. package/dist/usage/i18n-keys.js +1 -1
  331. package/dist/usage/i18n-keys.js.map +1 -1
  332. package/dist/usage/providers.d.ts +34 -5
  333. package/dist/usage/providers.js +160 -27
  334. package/dist/usage/providers.js.map +1 -1
  335. package/dist/usage/statusline-usage.d.ts +6 -2
  336. package/dist/usage/statusline-usage.js +10 -4
  337. package/dist/usage/statusline-usage.js.map +1 -1
  338. package/dist/view-api.d.ts +1 -1
  339. package/dist/view-api.js +38 -8
  340. package/dist/view-api.js.map +1 -1
  341. package/dist/wake-coordinator.d.ts +11 -0
  342. package/dist/wake-coordinator.js +38 -4
  343. package/dist/wake-coordinator.js.map +1 -1
  344. package/dist/web-api.d.ts +89 -4
  345. package/dist/web-api.js +551 -45
  346. package/dist/web-api.js.map +1 -1
  347. package/dist/web-auth.d.ts +2 -2
  348. package/dist/web-auth.js +9 -4
  349. package/dist/web-auth.js.map +1 -1
  350. package/dist/web-chat-history.d.ts +12 -1
  351. package/dist/web-chat-history.js +29 -7
  352. package/dist/web-chat-history.js.map +1 -1
  353. package/dist/web-commands.d.ts +27 -4
  354. package/dist/web-commands.js +19 -4
  355. package/dist/web-commands.js.map +1 -1
  356. package/dist/web-host-guard.d.ts +3 -11
  357. package/dist/web-host-guard.js +3 -12
  358. package/dist/web-host-guard.js.map +1 -1
  359. package/dist/web-images.d.ts +47 -0
  360. package/dist/web-images.js +169 -0
  361. package/dist/web-images.js.map +1 -0
  362. package/dist/web-login.d.ts +14 -0
  363. package/dist/web-login.js +4 -2
  364. package/dist/web-login.js.map +1 -1
  365. package/dist/web-mentions.d.ts +44 -0
  366. package/dist/web-mentions.js +75 -0
  367. package/dist/web-mentions.js.map +1 -0
  368. package/dist/web-prefs.d.ts +81 -0
  369. package/dist/web-prefs.js +297 -0
  370. package/dist/web-prefs.js.map +1 -0
  371. package/dist/web-preview.d.ts +14 -1
  372. package/dist/web-preview.js +35 -13
  373. package/dist/web-preview.js.map +1 -1
  374. package/dist/web-profile.d.ts +32 -0
  375. package/dist/web-profile.js +132 -0
  376. package/dist/web-profile.js.map +1 -0
  377. package/dist/web-reply-files.d.ts +45 -0
  378. package/dist/web-reply-files.js +223 -0
  379. package/dist/web-reply-files.js.map +1 -0
  380. package/dist/web-schedules.d.ts +12 -0
  381. package/dist/web-schedules.js +34 -0
  382. package/dist/web-schedules.js.map +1 -0
  383. package/dist/web-server-drain.d.ts +10 -0
  384. package/dist/web-server-drain.js +50 -0
  385. package/dist/web-server-drain.js.map +1 -0
  386. package/dist/web-session.d.ts +50 -1
  387. package/dist/web-session.js +63 -6
  388. package/dist/web-session.js.map +1 -1
  389. package/dist/web-settings-patch.d.ts +23 -0
  390. package/dist/web-settings-patch.js +77 -0
  391. package/dist/web-settings-patch.js.map +1 -0
  392. package/dist/web-shell-routes.d.ts +5 -1
  393. package/dist/web-shell-routes.js +10 -1
  394. package/dist/web-shell-routes.js.map +1 -1
  395. package/dist/web-upload.d.ts +17 -4
  396. package/dist/web-upload.js +64 -13
  397. package/dist/web-upload.js.map +1 -1
  398. package/dist/workflow-templates/default.md +1 -1
  399. package/package.json +1 -1
  400. package/templates/launchd.plist.ejs +3 -1
  401. package/templates/systemd.service.ejs +2 -1
@@ -1,3 +1,4 @@
1
+ import { type HumanOrigin } from "./human-delivery-receipts.js";
1
2
  import { SettingsExecution } from "./settings-transaction.js";
2
3
  import type { LoginCodeOwner } from "./web-login.js";
3
4
  import { type ProfileTicket } from "./runtime-cpu-profile.js";
@@ -51,14 +52,22 @@ export declare function applyTaskListCap<T extends {
51
52
  omitted: number;
52
53
  hint: string;
53
54
  } | T[];
55
+ import { type PublicPreviewForUi } from "./web-api.js";
56
+ import { type LogAnswer, type LogQuery } from "./log-service.js";
54
57
  import { WebChatHistory } from "./web-chat-history.js";
58
+ import { SeenUsers, type MentionNames, type MentionQuery } from "./web-mentions.js";
59
+ import { WebPrefsStore } from "./web-prefs.js";
60
+ import { type WebAccount } from "./web-profile.js";
61
+ import type { WebPerson as WebPersonView } from "./web-api.js";
55
62
  import { ReplyButtonsController } from "./reply-buttons-controller.js";
56
63
  import { WebFileLedger } from "./web-upload.js";
64
+ import { type CachedImage } from "./web-images.js";
57
65
  import { type RawConfigPatch } from "./settings-api.js";
58
66
  import { type AgentEndpointContext } from "./agent-endpoint.js";
59
67
  import { ClassicChannelManager } from "./classic-channel-manager.js";
60
68
  import { type ExplicitInstanceRemoval } from "./instance-removal.js";
61
69
  import type { InstanceState, InteractionSnapshot } from "./backend/types.js";
70
+ import { type Daemon } from "./daemon.js";
62
71
  import { WakeCoordinator } from "./wake-coordinator.js";
63
72
  import { TargetQueueWorker } from "./target-queue-worker.js";
64
73
  import { resolveDeliveryWorkerMode } from "./types.js";
@@ -71,6 +80,7 @@ import { type PreviewAvailability } from "./web-preview.js";
71
80
  import { type ConnectionMetadata, type ConnectionBinding, type BindingProbe, type SecretApplyJob, type ProviderSecretApplyJob } from "./connection-secrets.js";
72
81
  import { type ProviderSecretStatus } from "./provider-secret-registry.js";
73
82
  import { ApplyJobStore, type ApplyJob, type ApplyTargetKind, type SelfRestartResult } from "./apply-job.js";
83
+ import { type CarryResult } from "./backend/claude-carry.js";
74
84
  import { StormWindow } from "./storm-window.js";
75
85
  import { SpawnGate } from "./spawn-gate.js";
76
86
  import { BackendOutageTracker } from "./backend-outage.js";
@@ -98,6 +108,17 @@ export declare function selectLruEvictions(warm: string[], cap: number, opts: {
98
108
  * must match here, or a deleted instance's CLI is left running (#1305 P2-3).
99
109
  */
100
110
  export declare function isOrphanInstanceWindowName(name: string): boolean;
111
+ /** restartSingleInstance's options. `carry` (#1753): a credential-profile switch; its outcome is written into `result`. */
112
+ export interface RestartOpts {
113
+ freshStart?: boolean;
114
+ explicit?: boolean;
115
+ carry?: {
116
+ backend: string;
117
+ from: string | null;
118
+ to: string | null;
119
+ result?: CarryResult | null;
120
+ };
121
+ }
101
122
  /**
102
123
  * Answer shape for `list_models`. `scope` reports where the LIST came from —
103
124
  * "instance" only when it was read through that instance's own backend config,
@@ -158,6 +179,8 @@ export declare const LOGIN_CALLBACK_PREFIX = "login:";
158
179
  * and hides exactly the newly released model the user opened `/model` to find.
159
180
  * The wait is announced before it starts, so it reads as progress, not a stall.
160
181
  */
182
+ /** #1690: how long `/model` waits for the daemon's word on our own runtime switch (its dialog wait plus settling). */
183
+ export declare const RUNTIME_SWITCH_RESULT_MS = 12000;
161
184
  export declare const CLI_ENV_PROBE_DEADLINE_MS = 16000;
162
185
  /**
163
186
  * How many CLIs may cold-start at once, from BOTH memory and cores.
@@ -200,7 +223,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
200
223
  private replyObligationTimer;
201
224
  private readonly activeDurableTargets;
202
225
  /** Live view of lifecycle.daemons — used throughout; not deprecated. */
203
- get daemons(): Map<string, import("./daemon.js").Daemon>;
226
+ get daemons(): Map<string, Daemon>;
204
227
  fleetConfig: FleetConfig | null;
205
228
  private rawFleetConfig;
206
229
  private rawFleetDocument;
@@ -299,6 +322,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
299
322
  private webChannelEchoGuards;
300
323
  /** instanceName → restart currently executing; concurrent callers join it. */
301
324
  private restartsInFlight;
325
+ /**
326
+ * #1753: each in-flight restart's stop → start gap — the conversation carry it will run there (its own, or one a later
327
+ * caller joined with before the gap), and whether the gap has been reached.
328
+ */
329
+ private readonly restartGaps;
302
330
  /**
303
331
  * Delayed automatic retries for instances whose startup failed. Before this a
304
332
  * failed start was logged once and the instance stayed `stopped` until an
@@ -333,6 +361,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
333
361
  /** In-flight /effort selections, same coordinator shape as pendingModelSelects. */
334
362
  private pendingEffortSelects;
335
363
  private pendingModelSelects;
364
+ /** #1806: in-flight /backend steps, keyed by nonce (see handleBackendSelection). */
365
+ private pendingBackendSelects;
336
366
  /** nonce → pending button prompt (hang restart, interactive assist, clean-exit restart). */
337
367
  private pendingNonceButtons;
338
368
  /** #1386 "Needs you": the list, its live chat messages and Acknowledge. Started with the fleet (finishStartup). */
@@ -397,6 +427,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
397
427
  private connectionBindingInFlight;
398
428
  private collabInstances;
399
429
  private healthServer;
430
+ private healthServerDrain;
400
431
  /** #1306: the preview listener (health_port + 1 by default), and whether it is listening. */
401
432
  private previewListener;
402
433
  private previewListening;
@@ -409,6 +440,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
409
440
  private updateProgressEditRunning;
410
441
  private lastUpdateProgressText;
411
442
  private updateCompletionTipText;
443
+ /**
444
+ * #1660: an adopted update whose retire outcome is still owed. The
445
+ * completion summary was (or will be) posted; this watch appends the
446
+ * cleanup outcome to the same receipt instead of letting stage edits
447
+ * clobber it — and refuses a receipt that no longer matches (checklist 3/5).
448
+ */
449
+ private updateCleanupWatch;
412
450
  /** Injectable only to keep the chat→CLI reload hand-off deterministic in tests. */
413
451
  private fullRestartLauncher;
414
452
  private eventLogPruneTimer;
@@ -428,8 +466,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
428
466
  private memoryLogAt;
429
467
  private memoryDebugAt;
430
468
  private memoryLogLevel;
431
- private memoryNoticeAt;
432
- private memoryNoticeLevel;
469
+ /** #1685: the host_memory value the last status frame carried, so a change re-sends the frame. */
470
+ private memoryIndicatorShown;
433
471
  private mirrorBuffer;
434
472
  private mirrorTimer;
435
473
  private sseClients;
@@ -439,6 +477,43 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
439
477
  private webChatStore;
440
478
  /** Uploaded files and the files the dashboard may fetch back (uploads, reply attachments). */
441
479
  readonly webFiles: WebFileLedger;
480
+ /** #1770: per instance, its last web reply still copying its files — the next one is shown after it, in order. */
481
+ private readonly webReplyOrder;
482
+ /** #1770: an instance's web-files byte cap (a field, so a test can make it small). */
483
+ private webReplyMaxBytes;
484
+ /** #1682: the people seen on inbound messages (id → name), for the web chat's mention pills; bounded, in memory. */
485
+ readonly seenUsers: SeenUsers;
486
+ private webPrefsStore?;
487
+ /** #1665: the web preferences kept on the host (<home>/web-prefs.json), read on first use. */
488
+ /**
489
+ * #1827: a web person as agents and chats see them. Signed in as an account (a sign-in code DMed to it): that
490
+ * account's user id — still `via web`, and only for recognition — and the name they chose, else their account's name
491
+ * at sign-in (made safe). Otherwise (an `agend web` session): "web-user", as before, under a name the operator may set.
492
+ * Names are checked again now: one an instance or bot has taken since reads as the next choice down.
493
+ */
494
+ webPerson(owner?: WebAccount): WebPersonView;
495
+ /** #1827: set (null: clear — back to their account's name) a web person's own name; validated in full. */
496
+ setWebPersonName(owner: WebAccount | undefined, raw: unknown): {
497
+ ok: true;
498
+ person: WebPersonView;
499
+ } | {
500
+ ok: false;
501
+ status: number;
502
+ error: string;
503
+ };
504
+ /** #1827 (auth-api): a sign-in as this account — its display name then is the web name it starts with. */
505
+ noteWebSignIn(account: {
506
+ adapterId: string;
507
+ userId: string;
508
+ username?: string;
509
+ }): void;
510
+ /**
511
+ * #1827: a name that belongs to something here — an instance (or ClassicBot room), its display name, a bot. On the web
512
+ * send path: it never throws (a lookup that fails reserves nothing; the name was checked in full when it was set).
513
+ */
514
+ private webNameReserved;
515
+ private webNameTaken;
516
+ get webPrefs(): WebPrefsStore;
442
517
  /**
443
518
  * Read from disk on every access rather than cached at startup: `agend
444
519
  * web-token rotate` runs in a separate process, and a cached copy would keep
@@ -500,6 +575,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
500
575
  */
501
576
  replyButtons(): ReplyButtonsController | null;
502
577
  private replyButtonsStore;
578
+ /**
579
+ * #1823: a closed poll's results go to its instance through the delivery outbox, as a system notice keyed by the
580
+ * poll: durable (held until the instance can take it) and admitted once, however often this is asked. Addressed to
581
+ * the poll's chat, so the instance's answer (the right option, the scores) goes there.
582
+ */
583
+ private admitPollResults;
503
584
  /**
504
585
  * #1266: who may answer a reply's buttons on a platform — whoever may message that instance there: in a ClassicBot
505
586
  * room anyone there (as a typed message), elsewhere someone the sending connection lets speak (#754/#1148), never a
@@ -519,12 +600,17 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
519
600
  kind: string;
520
601
  correlationId: string;
521
602
  payload: Record<string, unknown>;
603
+ forwards?: readonly string[];
604
+ requestedKind?: string;
522
605
  }): {
523
606
  deliveryId: string;
524
607
  state: string;
525
608
  duplicate: boolean;
609
+ kind: string;
526
610
  };
527
611
  queryDurableDeliveryStatus(callerInstance: string, selector: DeliveryStatusSelector): DeliveryStatusPage;
612
+ /** #1641: why a target is not taking queued work right now, or null when nothing known holds it. */
613
+ private deliveryWaitingReason;
528
614
  getDaemonBootId(instanceName: string): string | undefined;
529
615
  markDurableResponseDelivered(sourceInstance: string, operationId: string): void;
530
616
  /** Called after a replacement Daemon object is installed in lifecycle.daemons. */
@@ -535,6 +621,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
535
621
  * notice when the owner is not working and nothing came back in time.
536
622
  */
537
623
  sweepReplyObligations(now?: Date): void;
624
+ private expireReplyObligations;
538
625
  private scheduleDeliveryOutboxPump;
539
626
  private runDeliveryOutboxPump;
540
627
  /**
@@ -551,6 +638,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
551
638
  private dispatchDurableDelivery;
552
639
  private waitForDurableLaneRelease;
553
640
  private spawnConcurrency;
641
+ /** #1685: "elevated" or "critical" while host memory pressure slows or holds new agents; otherwise null (an
642
+ * unknown macOS reading — the advisory case — is unknown, so null too). */
643
+ private hostMemoryIndicator;
554
644
  /** Separate cooldown: changing measurements must not create new text-throttle keys. */
555
645
  private reportMemoryPressure;
556
646
  /** Wire the one fleet-wide storm into notification and recovery surfaces. */
@@ -586,6 +676,18 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
586
676
  */
587
677
  isPlannedRestart(): boolean;
588
678
  private finishStartup;
679
+ /**
680
+ * We are the post-update fleet: the update is over by definition. Clearing it here (rather than in the update
681
+ * command, which exits before the new fleet is up) is what keeps the quiet window from outliving the restart.
682
+ * #1660 exception: an update still owing its retire outcome keeps its receipt until the cleanup watch resolves it —
683
+ * deleting it here is what lost the warning. Terminal stages are still cleared unconditionally.
684
+ * #1735: and while the watch is armed it owns the marker — even if the outcome landed after the completion posted
685
+ * (a launchd kickstart or a detached restart returns at once, so it can land at any point of the boot): the watch
686
+ * appends it, then clears.
687
+ * #1737 review: and only the marker this boot adopted. One written since — a `/restart full` or a new `/update`
688
+ * landing while this boot's completion was still being edited — belongs to its writer and is left alone.
689
+ */
690
+ private clearSettledUpdateMarker;
589
691
  lastActivityMs(name: string): number;
590
692
  /** Capture the current daemon and delivery owner for a background context read. */
591
693
  getPaneContextSource(name: string): import("./pane-context-cache.js").PaneContextSource | null;
@@ -751,6 +853,18 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
751
853
  getActiveBackendIds(): ReadonlySet<string>;
752
854
  isClassicInstance(name: string): boolean;
753
855
  /** #1523 N2: a ClassicBot room's own summary for its Details page (classicBot.yaml), or null. */
856
+ /** #1218: the Log tab's on-demand service — made on first use; with `web.log_tab` off it answers off and does nothing. */
857
+ private logService;
858
+ private get log();
859
+ /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
860
+ logSteps(name: string, q: LogQuery): Promise<LogAnswer | null>;
861
+ /**
862
+ * #1218: where an instance's steps are read from, resolved only when its Log asks: the transcript its daemon follows
863
+ * now; for claude-code, also the path its statusline last named (so a stopped instance's Log still shows its last
864
+ * work). kiro: fleet events with the reason its history is not read (kiro-log-gate.ts); other backends have no
865
+ * transcript AgEnD can read.
866
+ */
867
+ private logSource;
754
868
  classicRoomFor(name: string): {
755
869
  name: string;
756
870
  channel_id: string;
@@ -825,12 +939,41 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
825
939
  * or a rebound adapter is never posted through a stale route. A copy
826
940
  * already in flight may still land late — the contract permits that.
827
941
  */
828
- sendClassicWebEcho(instance: string, text: string): Promise<number>;
829
- reserveWebChannelEcho(instanceName: string, sendEcho: () => Promise<unknown>): (accepted: boolean) => void;
942
+ /** `sender` (#1827): the web person's name, as the room log records them ("web-user" when none). */
943
+ sendClassicWebEcho(instance: string, text: string, sender?: string): Promise<number>;
944
+ /**
945
+ * #1666: a delivered web chat message starts the same cancel/progress lifecycle in the instance's topic as a platform
946
+ * inbound (afterUserInboundDelivered): the same bubble, ticker and retire rules. Not its ✅ tracking — the web message
947
+ * id is no platform message, and the echo is the fleet's own post. The web send calls this on the echo's lane.
948
+ */
949
+ startWebChatProgress(instanceName: string): Promise<void>;
950
+ /**
951
+ * `copy: false` (#1666/#1668): an entry that is not a copy of a message — the web send's Cancel/progress bubble. It
952
+ * keeps its place in the order, but the lane's copy rules do not apply to it: its 5 s budget starts when its turn
953
+ * starts (waiting behind a slow echo is not its delay), its own timeout only releases the lane (the copies queued
954
+ * behind it are not "behind an ambiguous copy"), and another entry's timeout never drops it. A copy reserved while
955
+ * any non-copy is still open starts its own budget when the last of them finishes: a slow bubble is no copy's delay,
956
+ * however far back the copy is. And a timeout only ever drops copies reserved AFTER the entry that timed out — with
957
+ * deferred budgets, deadlines no longer grow with the order, so that rule is stated, not implied (#1668 r3).
958
+ */
959
+ reserveWebChannelEcho(instanceName: string, sendEcho: () => Promise<unknown>, opts?: {
960
+ copy?: boolean;
961
+ }): (accepted: boolean) => void;
830
962
  /** Whether this target already has an ordinary non-user delivery in its FIFO. */
831
963
  hasPendingIdleGatedDelivery(instanceName: string): boolean;
832
964
  /** The running launch's own steer capability (#1405); undefined for a backend without one, or no running Daemon. */
833
965
  instanceLaunchSupportsSteer(instanceName: string): boolean | undefined;
966
+ private humanReceiptDaemons;
967
+ /** Cached FM + lifecycle + Daemon + tmux owner; unknown ownership grants nothing. */
968
+ private humanReceiptOwner;
969
+ private listenForHumanReceipt;
970
+ /** Evidence-only admission. Bots/system/agent payloads have no trusted origin. */
971
+ private humanReceiptPayload;
972
+ /** Bind at the actual IPC send, after all wake/reconnect waits. No human retry lane. */
973
+ private bindHumanReceiptPayload;
974
+ deliverHumanToInstance(instanceName: string, payload: Record<string, unknown>, origin: HumanOrigin | undefined, originalBody: string, options?: DeliveryOptions): Promise<boolean | void>;
975
+ /** Synchronous steer/btw handoff, using the same evidence and owner binding. */
976
+ sendHumanControl(instanceName: string, payload: Record<string, unknown>, origin: HumanOrigin | undefined, originalBody: string): boolean;
834
977
  /** Single delivery facade: wake paused CLIs and serialize non-user work behind idle. */
835
978
  deliverToInstance(instanceName: string, payload: Record<string, unknown>, options?: DeliveryOptions): Promise<boolean | void>;
836
979
  /**
@@ -877,6 +1020,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
877
1020
  * the check and the act, so the channel's instance cannot be rebound to another bot in between.
878
1021
  */
879
1022
  private dispatchSlash;
1023
+ private dispatchSlashCore;
880
1024
  /**
881
1025
  * The door every Discord slash command goes through (src/slash-authz.ts has the rule and the reasoning): the scope
882
1026
  * it lets the command into, or the reply that refuses it. Synchronous, so the dispatch acts on what it judged.
@@ -1006,6 +1150,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1006
1150
  * from restarting the same process twice; backendNameOf defines ownership.
1007
1151
  */
1008
1152
  private configuredBackendInstanceNames;
1153
+ /** #1624: migration cannot infer ownership from the running daemon roster.
1154
+ * Stopped/paused ClassicBot entries count too; their workspace is exactly
1155
+ * the one startClassicInstance builds, not this FleetManager's dataDir.
1156
+ */
1157
+ kiroPeerWorkingDirectories(name: string): string[];
1009
1158
  /**
1010
1159
  * Probe the same executable set exposed by the web backend catalog.
1011
1160
  *
@@ -1058,12 +1207,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1058
1207
  /** Last-resort completion after RestartProgress could not deliver to its
1059
1208
  * adopted target. It stays bounded and never wakes a not-ready gateway. */
1060
1209
  private sendFleetStartCompletionFallback;
1061
- stopInstance(name: string, transition?: TransitionHandle): Promise<void>;
1210
+ stopInstance(name: string, transition?: TransitionHandle): Promise<{
1211
+ backgroundWorkEnded: boolean;
1212
+ }>;
1062
1213
  /** Restart a single instance, reloading fleet.yaml first to pick up config changes. */
1063
- restartSingleInstance(name: string, opts?: {
1064
- freshStart?: boolean;
1065
- explicit?: boolean;
1066
- }): Promise<void>;
1214
+ restartSingleInstance(name: string, opts?: RestartOpts): Promise<void>;
1067
1215
  isInstanceRestarting(name: string): boolean;
1068
1216
  /** InstanceLifecycleContext: an explicit wake joins the restart in flight. */
1069
1217
  restartInFlight(name: string): Promise<void> | undefined;
@@ -1084,6 +1232,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1084
1232
  * One-shot: the daemon deletes it on startup.
1085
1233
  */
1086
1234
  private writeFreshStartMarker;
1235
+ /**
1236
+ * #1753: a credential-profile switch, between the old CLI's stop and the new one's start. Where the backend can take
1237
+ * the conversation along (claude-code), copy it into the new profile and make it the one `--continue` picks; when that
1238
+ * cannot be done, or the backend cannot, start fresh as before. Null when nothing was tried.
1239
+ */
1240
+ private switchConversation;
1087
1241
  /** Load .env file from data dir into process.env */
1088
1242
  private loadEnvFile;
1089
1243
  /** Initialize auth before any adapter can answer /dashboard. */
@@ -1099,11 +1253,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1099
1253
  ttlMinutes: number;
1100
1254
  } | null;
1101
1255
  private tunnelPurposeLane;
1256
+ private previewTunnel;
1102
1257
  private publicWebLink;
1258
+ /** #1723: the public link's preview tunnel — a manager and lease of its own, never the fleet's one tunnel lane. */
1259
+ private getPreviewTunnel;
1103
1260
  private getTunnelLane;
1104
1261
  private publicOwnerCurrent;
1105
1262
  /** Exact owning General. No primary-adapter or name fallback participates in authorization. */
1106
1263
  private dashboardOwner;
1264
+ /**
1265
+ * #1742: the General a fleet admin's DM speaks for (`/start web`): the same owner `/web` in that General would make
1266
+ * — this bot's configured group and its one General topic. No address to match in a DM, so it must be unambiguous:
1267
+ * no General, or more than one on this bot and group, and there is no owner (nothing is guessed).
1268
+ */
1269
+ private dmDashboardOwner;
1270
+ /**
1271
+ * #1742: a fleet admin whose Telegram `/web` could not reach them privately may next open the bot's DM and press
1272
+ * Telegram's START, which sends a bare `/start` — read as `/start web` (the DM menu) for 10 minutes, once, for that
1273
+ * admin on that bot. Monotonic: a wall-clock jump neither opens nor shuts it.
1274
+ */
1275
+ private readonly tgWebStartWindows;
1276
+ private openTgWebStartWindow;
1277
+ /** Uses the window up: true when it was open. */
1278
+ private takeTgWebStartWindow;
1279
+ /** #1742: `/start web` from a fleet admin: the /web menu right here in the DM, for the General this bot serves. */
1280
+ private startWebInDm;
1107
1281
  private getPublicWebLink;
1108
1282
  getPublicWebStatus(): {
1109
1283
  state: string;
@@ -1117,6 +1291,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1117
1291
  }, current: () => boolean): Promise<void>;
1118
1292
  /** Telegram's typed command enters through the same strict owner and nonce path as Discord. */
1119
1293
  dashboardMenu(msg: InboundMessage): Promise<void>;
1294
+ /**
1295
+ * #1686: build the Telegram deep-link that opens a DM with this bot pre-seeded with `/start web`.
1296
+ * Returns null when no botUsername is known or the username fails Telegram's format validation.
1297
+ */
1298
+ private tgStartWebUrl;
1120
1299
  private sendLocalDashboard;
1121
1300
  /**
1122
1301
  * #1586: the sign-in code once more, as a message of its own, so a phone can copy it by itself: Telegram's monospace
@@ -1136,6 +1315,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1136
1315
  /** Why the DM did not go, for the log only (Discord 50007 = the user does not accept DMs from this server's members). */
1137
1316
  private logDashboardDmFailure;
1138
1317
  /** False when the menu was not shown (the caller still owes the user an answer). */
1318
+ /**
1319
+ * `dmChatId` (#1742): show it in the owner's own private chat with the bot instead of the General — the owner, its
1320
+ * gates and the code's route are the same; only where the menu sits (and its clicks are good) changes.
1321
+ */
1139
1322
  private showDashboardMenu;
1140
1323
  private handleDashboardCallback;
1141
1324
  /** `/dashboard revoke`: sign out every browser and withdraw any unused code. */
@@ -1188,6 +1371,36 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1188
1371
  private reportFullRestartFailure;
1189
1372
  failUpdateProgress(message: string): void;
1190
1373
  /** The old fleet edits CLI install stages; the new fleet adopts the same message below. */
1374
+ /**
1375
+ * #1660: arm the post-completion cleanup watch and make sure its monitor
1376
+ * actually runs. The new fleet adopts the receipt at boot but nothing else
1377
+ * starts this timer on that path (Prism a) — without this, the owed
1378
+ * outcome would sit in the marker unwatched. READY never waits for it.
1379
+ */
1380
+ /**
1381
+ * #1735: what the completion of an adopted update does about its retire outcome, read from the marker as it is now.
1382
+ * Already landed with a warning (a detached restart returns before this fleet boots, so the updater retires first)
1383
+ * → render it in the completion. Still owed (`cleanup: "pending"` — a service restart waits for READY, which comes
1384
+ * after the completion) → watch for it. Anything else (no retire on this update, done silently, another receipt)
1385
+ * → nothing.
1386
+ */
1387
+ /**
1388
+ * #1716: background work this restart/update ended, scoped to the operation
1389
+ * so an older stop never reports (`sinceAt` null = plain boot, report
1390
+ * nothing). A method — not a module function — because the #1737
1391
+ * extracted-completion harness runs this region verbatim with only
1392
+ * `this`-methods plus a fixed context.
1393
+ */
1394
+ private collectBackgroundWorkEndedNames;
1395
+ private updateCleanupAtCompletion;
1396
+ private armCleanupWatch;
1397
+ /**
1398
+ * #1660: append a recorded cleanup outcome to the adopted update message,
1399
+ * then release the receipt — but only if this receipt still owns the
1400
+ * marker. The await yields, so a newer receipt (e.g. a full-restart that
1401
+ * landed mid-edit) must not be cleared or disturbed (Prism b).
1402
+ */
1403
+ private appendCleanupWarning;
1191
1404
  private startUpdateProgressMonitor;
1192
1405
  /** Start all instances from fleet config */
1193
1406
  startAll(configPath: string): Promise<void>;
@@ -1392,6 +1605,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1392
1605
  */
1393
1606
  private resolveInboundTarget;
1394
1607
  private handleInboundMessage;
1608
+ /**
1609
+ * #1752: the bot that speaks back about an inbound message — in a fleet topic the owning instance's adapter, never
1610
+ * the sibling that happened to win the dedup race; elsewhere (ClassicBot rooms, no routed instance) the receiver.
1611
+ */
1612
+ private inboundNoticeAdapter;
1613
+ private handleInboundMessageCore;
1395
1614
  /** Handle outbound tool calls from a daemon instance */
1396
1615
  /** Warn (but don't block) when rate limits are high. 30-min debounce per instance. */
1397
1616
  private rateLimitWarnedAt;
@@ -1433,7 +1652,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1433
1652
  private isWebOnlyFleet;
1434
1653
  /** On a fleet with no chat platform, the dashboard is where an instance-health prompt is posted (#1307 item 6). */
1435
1654
  private webOnlyPromptPlace;
1655
+ /** Resolves when the reply is in the web chat (#1770: after its files are copied); the caller need not wait. */
1436
1656
  private afterReplyRouted;
1657
+ /**
1658
+ * #1770: a reply's files as the web chat shows them. Each is copied into the instance's web-files/ and served from
1659
+ * the copy. One the copy refuses (a symlink, not a regular file, over 50 MB, a state file, missing) is not shown;
1660
+ * one that could not be copied (I/O) is served from the agent's own path, as before — until the fleet restarts.
1661
+ */
1662
+ private webReplyAttachments;
1437
1663
  private handleScheduleTrigger;
1438
1664
  /**
1439
1665
  * The adapter that can actually post into a chat, found by its group.
@@ -1675,6 +1901,46 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1675
1901
  /** Keyed `<connection>\0<server id>`. */
1676
1902
  private guildEmojiCache;
1677
1903
  private guildEmojiFetches;
1904
+ private webImageCaches;
1905
+ private webImageCache;
1906
+ /**
1907
+ * instance → the connection that is its own bot: configured now (a connection removed from fleet.yaml is nobody's,
1908
+ * whatever an instance still names — #1635 review), not the primary, and answering for it alone.
1909
+ */
1910
+ private ownBots;
1911
+ /**
1912
+ * The bot a connection is now: its running adapter and that bot's own user id. Everything cached for an own bot is
1913
+ * keyed by both, so a bot put in its place (a token replaced under the same connection id) never shows the old one's
1914
+ * face or colour, and the old one's late answers land under the old key (#1635 review). null while it has no id.
1915
+ */
1916
+ private botOwner;
1917
+ /** Still the same bot behind `connection` (after an await): the same adapter object and the same bot id. */
1918
+ private botStillOwns;
1919
+ /** keyed `<connection>\0<bot id>\0<channel>`: the bot's colour there, refreshed at most daily (monotonic), one read at a time. */
1920
+ private webAccents;
1921
+ private webAccentReads;
1922
+ private webAccent;
1923
+ /** The cache key of an own bot's avatar, and its loader (which refuses an answer from a bot no longer there). */
1924
+ private botAvatarSource;
1925
+ /** One instance's avatar and ring for the status frame. Synchronous: what is cached now; fetches run behind. */
1926
+ private webIdentityImage;
1927
+ /** GET /ui/img/bot|avatar/<key>: what is cached, never a fetch. Only an own-bot connection, or a known instance's upload. */
1928
+ webImage(kind: "bot" | "avatar", key: string): CachedImage | null;
1929
+ /**
1930
+ * #1682 GET /ui/mentions: names for the mention ids a page found in what it rendered — never a Discord request; in order:
1931
+ * the fleet's bots (an instance's own bot is that instance's label: fleet.yaml, and the View profiles read from
1932
+ * profiles.db, as the status frame does), the people seen on inbound messages, and the Discord adapters' caches
1933
+ * (members, users, roles, channels).
1934
+ */
1935
+ webMentionNames(query: MentionQuery): MentionNames;
1936
+ /** GET /ui/emojis: the custom emoji of every server the fleet's Discord bots are in (the Settings picker's cache). */
1937
+ webEmojiList(): Promise<Array<{
1938
+ id: string;
1939
+ name: string;
1940
+ animated: boolean;
1941
+ }>>;
1942
+ /** GET /ui/img/emoji/<id>: only an emoji of those servers; fetched once from Discord's CDN, then from the host cache. */
1943
+ webEmoji(id: string): Promise<CachedImage | null>;
1678
1944
  /**
1679
1945
  * What `instanceName` may pick as its persona emoji (the `list_emojis`
1680
1946
  * tool): its current status set with where each value comes from, the
@@ -1977,6 +2243,19 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1977
2243
  */
1978
2244
  orgChart(): OrgChart;
1979
2245
  private cacheService;
2246
+ /**
2247
+ * #1699: the credential profile an instance's CLI signs in with on `backend` — fleet.yaml's (with its defaults), or a
2248
+ * ClassicBot room's launched or would-be login when the room runs that backend. Null: the backend's default login
2249
+ * (also for a backend that has no profiles, where the option is ignored).
2250
+ */
2251
+ credentialProfileOf(name: string, backend: string): string | null;
2252
+ /**
2253
+ * #1699: the claude config dir an instance's CLI uses — its credential profile's, else exactly as before
2254
+ * (CLAUDE_CONFIG_DIR or ~/.claude).
2255
+ */
2256
+ claudeConfigDirOf(name: string): string;
2257
+ /** The instances the cache analysis reads: fleet.yaml's, then the ClassicBot rooms (their workspace under the AgEnD home, their own backend). */
2258
+ private cacheInstances;
1980
2259
  /**
1981
2260
  * #1468: the prompt-cache expiry analysis for the web, per instance, over `window`. Read from each instance's
1982
2261
  * ledger as it is now; the first request starts the bounded, persisted catch-up over the transcripts
@@ -2016,10 +2295,26 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2016
2295
  * The caller has passed the /ui gate (session, same origin, CSRF). Here: the prompt must be one offered
2017
2296
  * on the dashboard, about the instance the page named, and the action one of its own buttons.
2018
2297
  */
2019
- /** #1266: a click on a reply's button in the web chat (the /ui gate is passed: a session, or the public link). */
2020
- clickWebReplyButton(instance: string, id: string, index: number): Promise<{
2298
+ /** #1823: close_poll — `instance` closes one of its own polls before the deadline. */
2299
+ closePollEarly(instance: string, id: string): Promise<{
2300
+ ok: true;
2301
+ voted: number;
2302
+ } | {
2303
+ ok: false;
2304
+ error: string;
2305
+ }>;
2306
+ /**
2307
+ * #1266: a click on a reply's button in the web chat (the /ui gate is passed: a session, or the public link). On a
2308
+ * poll (#1823) it is `voter`'s vote: the page's session.
2309
+ */
2310
+ clickWebReplyButton(instance: string, id: string, index: number, voter?: {
2311
+ key: string;
2312
+ userId: string;
2313
+ name: string;
2314
+ }): Promise<{
2021
2315
  status: 200 | 400 | 403 | 409;
2022
2316
  error?: string;
2317
+ options?: number[];
2023
2318
  }>;
2024
2319
  clickWebPrompt(instance: string, nonce: string, action: string): Promise<{
2025
2320
  status: 200 | 400 | 403 | 409;
@@ -2049,6 +2344,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2049
2344
  * synchronous; they never probe the pane.
2050
2345
  */
2051
2346
  private clearTargetFence;
2347
+ /** #1806: the web's /backend confirmations — one per question, used once, for the arguments and backend asked about. */
2348
+ private readonly webBackendTokens;
2052
2349
  /** #1269: the web's /clear confirmations — one token per question, used once, for the instance as it was asked about. */
2053
2350
  private readonly webClearTokens;
2054
2351
  /** #1269: an instance's chat command from the web chat (web-commands.ts); `publicLink`: a gateway request. */
@@ -2059,6 +2356,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2059
2356
  confirm?: string;
2060
2357
  }, opts: {
2061
2358
  publicLink: boolean;
2359
+ person?: Pick<WebPersonView, "userId" | "name">;
2062
2360
  }): Promise<WebCommandResult>;
2063
2361
  /** Consume `/clear` Confirm/Cancel exactly once; only Confirm reaches IPC. */
2064
2362
  private handleClearConfirmation;
@@ -2112,7 +2410,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2112
2410
  * Backends with no remote login flow (opencode logs in from a terminal) get
2113
2411
  * no button — the alert's own wording already tells them what to run.
2114
2412
  */
2115
- offerBackendLogin(targetInstance: string, backend: string): Promise<void>;
2413
+ offerBackendLogin(targetInstance: string, backend: string, profile?: string): Promise<void>;
2116
2414
  /** Consume a General assist button exactly once. */
2117
2415
  private handleInteractivePromptAssist;
2118
2416
  /** Send a "🛑 Cancel" button to the instance's topic/channel after delivery. */
@@ -2345,6 +2643,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2345
2643
  skipAuthCheck?: boolean;
2346
2644
  tokenPresent?: boolean;
2347
2645
  tunnel?: boolean;
2646
+ profile?: string;
2348
2647
  }): Promise<string | null>;
2349
2648
  /** Which way a `/login` went (#1131) — so the event log shows what users actually need. */
2350
2649
  private recordLoginFlow;
@@ -2388,6 +2687,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2388
2687
  chatId: string;
2389
2688
  threadId?: string;
2390
2689
  userId?: string;
2690
+ }, signIn?: {
2691
+ profile?: string;
2391
2692
  }): Promise<string>;
2392
2693
  /** Whether this backend's CLI is on the fleet's PATH (what `/login` installs when it is not). */
2393
2694
  isCliInstalled(backend: string): boolean;
@@ -2504,6 +2805,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2504
2805
  /** Forward a message to a classic channel instance with chat log context */
2505
2806
  private forwardToClassicInstance;
2506
2807
  /** Paste raw text directly to a classic instance's CLI (no [user:] wrapping) */
2808
+ /** #1690: our own runtime switches awaiting the daemon's outcome, by id. */
2809
+ private readonly runtimeSwitchWaiters;
2810
+ /**
2811
+ * #1690: type `/model <model>` and wait for what it came to: the daemon answers claude's "Switch model?" for us (Yes
2812
+ * when it names this model, No otherwise) or sees claude's own result. Null when it could not be sent; a timeout is
2813
+ * "not confirmed".
2814
+ */
2815
+ private runRuntimeModelSwitch;
2816
+ /**
2817
+ * #1690: the names claude-code is known to accept, for checking `/model <name>` BEFORE it is typed — claude itself
2818
+ * accepts any string ("Set model to opsu"), and its "Switch model?" then names the typo. Static aliases (with [1m]),
2819
+ * the cached account catalog, the configured model; without a cached catalog, any `claude-…` id too (cannot check).
2820
+ */
2821
+ private claudeModelKnown;
2507
2822
  private pasteRawToClassicInstance;
2508
2823
  /** Resolve the backend name configured for an instance (fleet or classic). */
2509
2824
  private backendNameForInstance;
@@ -2646,6 +2961,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2646
2961
  effortStrategyFor(instanceName: string): "runtime" | "restart" | "unsupported";
2647
2962
  /** Effort levels this instance's backend actually accepts (empty = unsupported). */
2648
2963
  effortLevelsFor(instanceName: string): string[];
2964
+ /** The instance's backend's effort metadata; agy's levels are its model's (#1825), the one the instance runs. */
2965
+ private instanceEffortMetadata;
2649
2966
  /** Configured effort for an instance: per-instance, else fleet default, else none. */
2650
2967
  resolveInstanceEffort(instanceName: string): {
2651
2968
  effort: string | null;
@@ -2669,6 +2986,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2669
2986
  */
2670
2987
  applyEffort(instanceName: string, requested: string): Promise<string>;
2671
2988
  applyModel(instanceName: string, model: string): Promise<string>;
2989
+ /** Save an instance's model (fleet.yaml, or its ClassicBot channel). False when neither holds it. */
2990
+ private persistInstanceModel;
2672
2991
  /**
2673
2992
  * The trailing "Current effort: …" line for a /model reply.
2674
2993
  *
@@ -2677,6 +2996,72 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2677
2996
  * a switch saves the round trip of asking. Empty when the backend has none.
2678
2997
  */
2679
2998
  private effortSuffix;
2999
+ /** The steps' view of this fleet (backend-command.ts). `live`: a missing or stale model list may be probed (not on the web). */
3000
+ private backendCommandDeps;
3001
+ /**
3002
+ * `/effort`'s levels for a backend this instance may move to, for the model that will run there (codex's levels are
3003
+ * per model; null: its configured default). Empty: it has no effort setting. A file read, never a CLI.
3004
+ */
3005
+ backendEffortLevels(instanceName: string, backend: string, model?: string | null): string[];
3006
+ /**
3007
+ * #1808: whether a backend takes this model name — the one rule for /backend and update_instance_config's switch.
3008
+ * The name must be one its launch line can carry (modelNameCarried); then its offered list (the cached CLI env), and
3009
+ * claude-code's known names (without this instance's configured model, which belongs to the backend being left).
3010
+ * With no list known, the backend's usual name pattern decides.
3011
+ */
3012
+ backendModelVerdict(instanceName: string, backend: string, model: string,
3013
+ /** The provider the backend will run on (default: this instance's own, else the fleet's). */
3014
+ opts?: {
3015
+ provider: string | null;
3016
+ }): {
3017
+ ok: true;
3018
+ } | {
3019
+ ok: false;
3020
+ choices: string[];
3021
+ };
3022
+ /**
3023
+ * #1807 review r2: the model codex's next launch of this instance runs. Every launch's writeConfig copies the SHARED
3024
+ * config.toml into the instance's codex home first, so that source decides — not the home's copy from an earlier
3025
+ * launch. Read-only; a model chosen here (`-c model=…`) outranks it; a project file that could change it, unproven.
3026
+ */
3027
+ private prospectiveCodexModel;
3028
+ /** #1811: whether a launch of `backend` here would pass a level: the same gate its builder applies. */
3029
+ private launchEffortGate;
3030
+ /** Installed the way the launch finds a CLI (resolveBinary): on PATH or in a known install directory. */
3031
+ private backendInstalledHere;
3032
+ /** The models `/model` would offer on a backend: the cached CLI env, else (live) a bounded probe. Never throws. */
3033
+ private backendModelOptions;
3034
+ /**
3035
+ * #1806 review: the instance a `/backend` was asked about is still this config entry — not one deleted and created
3036
+ * again under the same name, or replaced by a Settings edit (both put a new object there), stopped or not.
3037
+ */
3038
+ private backendTargetIs;
3039
+ /** `/backend` is for fleet.yaml instances: update_instance_config does not manage a ClassicBot agent. */
3040
+ private backendCommandRefusal;
3041
+ /**
3042
+ * Apply a confirmed `/backend`: judged again first (a menu lives a minute — the backend may have moved, a CLI been
3043
+ * removed), then update_instance_config's write: backend, model and effort at once, refused and rolled back whole
3044
+ * (its credential-profile login gate included), then one fresh relaunch of a running instance.
3045
+ */
3046
+ applyBackendSwitch(instanceName: string, args: readonly string[], from: string, stillCurrent: () => boolean): Promise<string>;
3047
+ /** A step's buttons: index callbacks (a model id can be longer than Telegram's 64-byte callback data allows). */
3048
+ private backendStepButtons;
3049
+ /**
3050
+ * Show a `/backend` step (a choice, or the confirmation) where the command was given: Discord edits its interaction
3051
+ * reply; Telegram retires the previous step's keyboard and posts the next. One pending entry per step, under a fresh
3052
+ * nonce: a click on an older step finds nothing.
3053
+ */
3054
+ private presentBackendStep;
3055
+ /** Close a `/backend` menu with a last word: its buttons go (Telegram edits them away), the text stays. Returns where it was said. */
3056
+ private endBackendMenu;
3057
+ /** Start `/backend` for a fleet instance from Discord or Telegram; the caller has checked the channel admin. */
3058
+ private beginBackendCommand;
3059
+ /** `/backend` slash handler: channel admin, as `/model`. Options or typed text give the direct form. */
3060
+ private handleBackendSlash;
3061
+ /** Telegram `/backend` in a fleet topic (topic-commands) or a ClassicBot chat; the caller has checked the admin. */
3062
+ runBackendCommand(instanceName: string, text: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string, adapterId?: string): Promise<void>;
3063
+ /** Consume a `/backend` click: the next step, or on the confirmation the switch itself. True for every backend-select id. */
3064
+ private handleBackendSelection;
2680
3065
  /** Read recent chat log for agent context */
2681
3066
  private getRecentChatLog;
2682
3067
  /**
@@ -2692,6 +3077,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2692
3077
  private getMissingBackendWarning;
2693
3078
  /** Handle Discord's required static slash choice, warning before a likely startup failure. */
2694
3079
  private handleClassicStartSlash;
3080
+ private handleClassicStartSlashCore;
2695
3081
  /** Present platform-native backend choices, then start on selection or timeout. */
2696
3082
  private beginClassicBackendSelection;
2697
3083
  /** Consume a selection callback. Returns true for all ClassicBot callback IDs, including stale ones. */
@@ -3003,6 +3389,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3003
3389
  previewForUi(hostHeader: string | undefined, secure: boolean): PreviewAvailability & {
3004
3390
  boot: string | null;
3005
3391
  };
3392
+ /**
3393
+ * #1723: for one page of the public link (exposure `exposureId`, at `dashboardOrigin`): its own preview tunnel's
3394
+ * origin once up, "starting" until then, why it failed if it did — or a configured web.preview_origin, used instead.
3395
+ */
3396
+ publicPreviewForUi(exposureId: string, dashboardOrigin: string): PublicPreviewForUi;
3006
3397
  getUiStatus(): unknown;
3007
3398
  private getUiStatusSync;
3008
3399
  }