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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/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 +21 -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 +2 -2
  12. package/dist/auth-api.js +4 -2
  13. package/dist/auth-api.js.map +1 -1
  14. package/dist/backend/antigravity.d.ts +3 -0
  15. package/dist/backend/antigravity.js +9 -0
  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 +1 -1
  33. package/dist/backend/effort-metadata.js +3 -2
  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 +33 -0
  48. package/dist/backend/launch-effort.js +123 -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 +33 -4
  54. package/dist/backend/types.js +2 -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 +24 -1
  66. package/dist/channel/adapters/discord.js +87 -2
  67. package/dist/channel/adapters/discord.js.map +1 -1
  68. package/dist/channel/adapters/telegram.d.ts +24 -2
  69. package/dist/channel/adapters/telegram.js +118 -20
  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 +24 -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.js +9 -3
  83. package/dist/channel/tool-router.js.map +1 -1
  84. package/dist/channel/types.d.ts +39 -3
  85. package/dist/cli.js +133 -28
  86. package/dist/cli.js.map +1 -1
  87. package/dist/command-table.d.ts +2 -2
  88. package/dist/command-table.js +6 -3
  89. package/dist/command-table.js.map +1 -1
  90. package/dist/config-validator.js +59 -0
  91. package/dist/config-validator.js.map +1 -1
  92. package/dist/cross-instance-envelope.d.ts +15 -2
  93. package/dist/cross-instance-envelope.js +29 -5
  94. package/dist/cross-instance-envelope.js.map +1 -1
  95. package/dist/daemon.d.ts +156 -1
  96. package/dist/daemon.js +764 -89
  97. package/dist/daemon.js.map +1 -1
  98. package/dist/delivery-outbox.d.ts +62 -7
  99. package/dist/delivery-outbox.js +309 -22
  100. package/dist/delivery-outbox.js.map +1 -1
  101. package/dist/delivery-reconciliation.d.ts +18 -1
  102. package/dist/delivery-reconciliation.js +67 -2
  103. package/dist/delivery-reconciliation.js.map +1 -1
  104. package/dist/fleet-context.d.ts +10 -1
  105. package/dist/fleet-manager.d.ts +345 -10
  106. package/dist/fleet-manager.js +1868 -174
  107. package/dist/fleet-manager.js.map +1 -1
  108. package/dist/general-knowledge/skills/backend-providers/SKILL.md +1 -1
  109. package/dist/general-knowledge/skills/credential-profiles/SKILL.md +92 -21
  110. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +27 -3
  111. package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +8 -8
  112. package/dist/general-knowledge/skills/fleet-config/SKILL.md +5 -5
  113. package/dist/general-knowledge/skills/fleet-health/SKILL.md +4 -4
  114. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +13 -13
  115. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -2
  116. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +6 -0
  117. package/dist/general-knowledge/skills/model-discovery/SKILL.md +9 -9
  118. package/dist/general-knowledge/skills/multi-channel/SKILL.md +8 -2
  119. package/dist/general-knowledge/skills/scheduling/SKILL.md +5 -3
  120. package/dist/general-knowledge/skills/session-management/SKILL.md +6 -5
  121. package/dist/general-knowledge/skills/tui-effort/SKILL.md +2 -2
  122. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +8 -3
  123. package/dist/general-knowledge/steering/core-rules.md +8 -7
  124. package/dist/host-memory.d.ts +10 -0
  125. package/dist/host-memory.js +33 -1
  126. package/dist/host-memory.js.map +1 -1
  127. package/dist/human-delivery-receipts.d.ts +83 -0
  128. package/dist/human-delivery-receipts.js +194 -0
  129. package/dist/human-delivery-receipts.js.map +1 -0
  130. package/dist/instance-avatar.d.ts +36 -0
  131. package/dist/instance-avatar.js +57 -0
  132. package/dist/instance-avatar.js.map +1 -0
  133. package/dist/instance-config-impact.js +6 -0
  134. package/dist/instance-config-impact.js.map +1 -1
  135. package/dist/instance-lifecycle.d.ts +29 -6
  136. package/dist/instance-lifecycle.js +79 -28
  137. package/dist/instance-lifecycle.js.map +1 -1
  138. package/dist/instructions.d.ts +3 -1
  139. package/dist/instructions.js +11 -8
  140. package/dist/instructions.js.map +1 -1
  141. package/dist/kiro-log-gate.d.ts +42 -0
  142. package/dist/kiro-log-gate.js +39 -0
  143. package/dist/kiro-log-gate.js.map +1 -0
  144. package/dist/locale.js +200 -44
  145. package/dist/locale.js.map +1 -1
  146. package/dist/log-service.d.ts +99 -0
  147. package/dist/log-service.js +243 -0
  148. package/dist/log-service.js.map +1 -0
  149. package/dist/log-steps.d.ts +169 -0
  150. package/dist/log-steps.js +858 -0
  151. package/dist/log-steps.js.map +1 -0
  152. package/dist/login-controller.d.ts +20 -3
  153. package/dist/login-controller.js +71 -19
  154. package/dist/login-controller.js.map +1 -1
  155. package/dist/login-flows.d.ts +5 -2
  156. package/dist/login-flows.js +5 -4
  157. package/dist/login-flows.js.map +1 -1
  158. package/dist/memory-pressure.d.ts +13 -1
  159. package/dist/memory-pressure.js +50 -10
  160. package/dist/memory-pressure.js.map +1 -1
  161. package/dist/needs-you-hub.js +2 -0
  162. package/dist/needs-you-hub.js.map +1 -1
  163. package/dist/needs-you-live.d.ts +6 -0
  164. package/dist/needs-you-live.js +23 -3
  165. package/dist/needs-you-live.js.map +1 -1
  166. package/dist/next-steps.js +1 -1
  167. package/dist/next-steps.js.map +1 -1
  168. package/dist/outbound-handlers.d.ts +100 -0
  169. package/dist/outbound-handlers.js +263 -96
  170. package/dist/outbound-handlers.js.map +1 -1
  171. package/dist/outbound-schemas.d.ts +26 -15
  172. package/dist/outbound-schemas.js +24 -7
  173. package/dist/outbound-schemas.js.map +1 -1
  174. package/dist/public-link-progress.d.ts +1 -1
  175. package/dist/public-link-progress.js +8 -2
  176. package/dist/public-link-progress.js.map +1 -1
  177. package/dist/public-preview.d.ts +101 -0
  178. package/dist/public-preview.js +236 -0
  179. package/dist/public-preview.js.map +1 -0
  180. package/dist/public-web-gateway.js +11 -4
  181. package/dist/public-web-gateway.js.map +1 -1
  182. package/dist/public-web-link.d.ts +24 -1
  183. package/dist/public-web-link.js +63 -9
  184. package/dist/public-web-link.js.map +1 -1
  185. package/dist/reply-buttons-controller.d.ts +3 -0
  186. package/dist/reply-buttons-controller.js +3 -2
  187. package/dist/reply-buttons-controller.js.map +1 -1
  188. package/dist/restart-guard.d.ts +6 -3
  189. package/dist/restart-guard.js +6 -3
  190. package/dist/restart-guard.js.map +1 -1
  191. package/dist/restart-progress.d.ts +33 -0
  192. package/dist/restart-progress.js +30 -0
  193. package/dist/restart-progress.js.map +1 -1
  194. package/dist/service-activation.d.ts +15 -7
  195. package/dist/service-activation.js +46 -29
  196. package/dist/service-activation.js.map +1 -1
  197. package/dist/service-installer.d.ts +31 -0
  198. package/dist/service-installer.js +41 -2
  199. package/dist/service-installer.js.map +1 -1
  200. package/dist/settings-api.js +85 -25
  201. package/dist/settings-api.js.map +1 -1
  202. package/dist/settings-change.js +72 -1
  203. package/dist/settings-change.js.map +1 -1
  204. package/dist/settings-effect.js +28 -4
  205. package/dist/settings-effect.js.map +1 -1
  206. package/dist/settings-http-confirmation.js +7 -0
  207. package/dist/settings-http-confirmation.js.map +1 -1
  208. package/dist/setup-form.d.ts +1 -1
  209. package/dist/setup-form.js +1 -1
  210. package/dist/spawn-gate.js +5 -1
  211. package/dist/spawn-gate.js.map +1 -1
  212. package/dist/spawn-hold-reply.d.ts +12 -0
  213. package/dist/spawn-hold-reply.js +39 -0
  214. package/dist/spawn-hold-reply.js.map +1 -0
  215. package/dist/status-emojis.d.ts +10 -3
  216. package/dist/status-emojis.js +11 -2
  217. package/dist/status-emojis.js.map +1 -1
  218. package/dist/systemd-peer-bus.d.ts +95 -0
  219. package/dist/systemd-peer-bus.js +430 -0
  220. package/dist/systemd-peer-bus.js.map +1 -0
  221. package/dist/systemd-runtime.d.ts +27 -1
  222. package/dist/systemd-runtime.js +69 -7
  223. package/dist/systemd-runtime.js.map +1 -1
  224. package/dist/tips.js +4 -4
  225. package/dist/tips.js.map +1 -1
  226. package/dist/tool-progress.js +3 -2
  227. package/dist/tool-progress.js.map +1 -1
  228. package/dist/topic-commands.d.ts +42 -2
  229. package/dist/topic-commands.js +92 -7
  230. package/dist/topic-commands.js.map +1 -1
  231. package/dist/transcript-delta-reader.d.ts +3 -3
  232. package/dist/transcript-delta-reader.js +8 -8
  233. package/dist/transcript-delta-reader.js.map +1 -1
  234. package/dist/transcript-jsonl.d.ts +80 -3
  235. package/dist/transcript-jsonl.js +147 -10
  236. package/dist/transcript-jsonl.js.map +1 -1
  237. package/dist/transcript-monitor.d.ts +19 -0
  238. package/dist/transcript-monitor.js +87 -15
  239. package/dist/transcript-monitor.js.map +1 -1
  240. package/dist/transcript-sources.d.ts +78 -0
  241. package/dist/transcript-sources.js +375 -64
  242. package/dist/transcript-sources.js.map +1 -1
  243. package/dist/transcript-turns.d.ts +15 -2
  244. package/dist/transcript-turns.js +15 -2
  245. package/dist/transcript-turns.js.map +1 -1
  246. package/dist/tunnel/cloudflared.d.ts +7 -15
  247. package/dist/tunnel/cloudflared.js +36 -1
  248. package/dist/tunnel/cloudflared.js.map +1 -1
  249. package/dist/tunnel/purpose-lane.d.ts +5 -1
  250. package/dist/tunnel/purpose-lane.js +14 -7
  251. package/dist/tunnel/purpose-lane.js.map +1 -1
  252. package/dist/tunnel/types.d.ts +5 -1
  253. package/dist/tunnel/types.js.map +1 -1
  254. package/dist/turn-resume.d.ts +2 -0
  255. package/dist/turn-resume.js +1 -1
  256. package/dist/turn-resume.js.map +1 -1
  257. package/dist/types.d.ts +25 -0
  258. package/dist/ui/chat-commands.js +1 -0
  259. package/dist/ui/chat-emojis.js +33 -0
  260. package/dist/ui/chat-mentions.js +63 -0
  261. package/dist/ui/chat-render.js +42 -2
  262. package/dist/ui/chat-store.js +2 -2
  263. package/dist/ui/chat-strings.js +38 -20
  264. package/dist/ui/chat-thread.js +69 -12
  265. package/dist/ui/chat-time.js +80 -0
  266. package/dist/ui/panel-chat.js +39 -10
  267. package/dist/ui/panel-details.js +2 -0
  268. package/dist/ui/panel-fleet.js +199 -57
  269. package/dist/ui/panel-log.js +428 -0
  270. package/dist/ui/panel-needs.js +6 -2
  271. package/dist/ui/panel-settings.js +137 -32
  272. package/dist/ui/preview-panel.js +55 -15
  273. package/dist/ui/preview-status.js +28 -0
  274. package/dist/ui/preview.js +44 -3
  275. package/dist/ui/settings-dialogs.js +7 -2
  276. package/dist/ui/settings-model.js +2 -1
  277. package/dist/ui/settings-strings.js +46 -4
  278. package/dist/ui/settings-token.js +1 -1
  279. package/dist/ui/shared/app-i18n.js +43 -17
  280. package/dist/ui/shared/app-prefs.js +250 -0
  281. package/dist/ui/shared/app-route.js +7 -2
  282. package/dist/ui/shared/app-shell.js +165 -8
  283. package/dist/ui/shared/app-store.js +5 -1
  284. package/dist/ui/shared/app-stream.js +23 -5
  285. package/dist/ui/shared/app.css +155 -22
  286. package/dist/ui/shared/app.js +11 -1
  287. package/dist/ui/shared/fonts/README.md +1 -1
  288. package/dist/ui/shared/header-tools.js +55 -5
  289. package/dist/ui/shared/instance-nav.js +241 -45
  290. package/dist/ui/shared/instance-switch.js +4 -4
  291. package/dist/ui/shared/panel-view.js +6 -0
  292. package/dist/ui/shared/signin.js +7 -7
  293. package/dist/ui/shared/theme.js +39 -7
  294. package/dist/ui/shared/tokens.css +1 -1
  295. package/dist/ui/shared/ui-icons.js +1 -0
  296. package/dist/ui/shared/usage-dialog.js +23 -5
  297. package/dist/ui/shared/view-strings.js +32 -4
  298. package/dist/ui/signin.html +1 -1
  299. package/dist/unrecognised-prompt.d.ts +23 -0
  300. package/dist/unrecognised-prompt.js +74 -0
  301. package/dist/unrecognised-prompt.js.map +1 -0
  302. package/dist/update-install.d.ts +28 -2
  303. package/dist/update-install.js +22 -4
  304. package/dist/update-install.js.map +1 -1
  305. package/dist/update-marker.d.ts +51 -0
  306. package/dist/update-marker.js +61 -0
  307. package/dist/update-marker.js.map +1 -1
  308. package/dist/update-preflight.d.ts +100 -0
  309. package/dist/update-preflight.js +264 -0
  310. package/dist/update-preflight.js.map +1 -0
  311. package/dist/updater-caller.d.ts +31 -0
  312. package/dist/updater-caller.js +109 -0
  313. package/dist/updater-caller.js.map +1 -0
  314. package/dist/usage/i18n-keys.d.ts +1 -1
  315. package/dist/usage/i18n-keys.js +1 -1
  316. package/dist/usage/i18n-keys.js.map +1 -1
  317. package/dist/usage/providers.d.ts +34 -5
  318. package/dist/usage/providers.js +160 -27
  319. package/dist/usage/providers.js.map +1 -1
  320. package/dist/usage/statusline-usage.d.ts +6 -2
  321. package/dist/usage/statusline-usage.js +10 -4
  322. package/dist/usage/statusline-usage.js.map +1 -1
  323. package/dist/view-api.d.ts +1 -1
  324. package/dist/view-api.js +38 -8
  325. package/dist/view-api.js.map +1 -1
  326. package/dist/wake-coordinator.d.ts +11 -0
  327. package/dist/wake-coordinator.js +38 -4
  328. package/dist/wake-coordinator.js.map +1 -1
  329. package/dist/web-api.d.ts +49 -2
  330. package/dist/web-api.js +421 -31
  331. package/dist/web-api.js.map +1 -1
  332. package/dist/web-auth.d.ts +2 -2
  333. package/dist/web-auth.js +9 -4
  334. package/dist/web-auth.js.map +1 -1
  335. package/dist/web-commands.d.ts +27 -4
  336. package/dist/web-commands.js +19 -4
  337. package/dist/web-commands.js.map +1 -1
  338. package/dist/web-host-guard.d.ts +3 -11
  339. package/dist/web-host-guard.js +3 -12
  340. package/dist/web-host-guard.js.map +1 -1
  341. package/dist/web-images.d.ts +47 -0
  342. package/dist/web-images.js +169 -0
  343. package/dist/web-images.js.map +1 -0
  344. package/dist/web-mentions.d.ts +44 -0
  345. package/dist/web-mentions.js +75 -0
  346. package/dist/web-mentions.js.map +1 -0
  347. package/dist/web-prefs.d.ts +63 -0
  348. package/dist/web-prefs.js +265 -0
  349. package/dist/web-prefs.js.map +1 -0
  350. package/dist/web-preview.d.ts +14 -1
  351. package/dist/web-preview.js +35 -13
  352. package/dist/web-preview.js.map +1 -1
  353. package/dist/web-reply-files.d.ts +45 -0
  354. package/dist/web-reply-files.js +223 -0
  355. package/dist/web-reply-files.js.map +1 -0
  356. package/dist/web-schedules.d.ts +12 -0
  357. package/dist/web-schedules.js +34 -0
  358. package/dist/web-schedules.js.map +1 -0
  359. package/dist/web-server-drain.d.ts +10 -0
  360. package/dist/web-server-drain.js +50 -0
  361. package/dist/web-server-drain.js.map +1 -0
  362. package/dist/web-session.d.ts +36 -1
  363. package/dist/web-session.js +53 -6
  364. package/dist/web-session.js.map +1 -1
  365. package/dist/web-settings-patch.d.ts +23 -0
  366. package/dist/web-settings-patch.js +77 -0
  367. package/dist/web-settings-patch.js.map +1 -0
  368. package/dist/web-shell-routes.d.ts +5 -1
  369. package/dist/web-shell-routes.js +10 -1
  370. package/dist/web-shell-routes.js.map +1 -1
  371. package/dist/web-upload.d.ts +17 -4
  372. package/dist/web-upload.js +64 -13
  373. package/dist/web-upload.js.map +1 -1
  374. package/dist/workflow-templates/default.md +1 -1
  375. package/package.json +1 -1
  376. package/templates/launchd.plist.ejs +3 -1
  377. 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,20 @@ 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";
55
60
  import { ReplyButtonsController } from "./reply-buttons-controller.js";
56
61
  import { WebFileLedger } from "./web-upload.js";
62
+ import { type CachedImage } from "./web-images.js";
57
63
  import { type RawConfigPatch } from "./settings-api.js";
58
64
  import { type AgentEndpointContext } from "./agent-endpoint.js";
59
65
  import { ClassicChannelManager } from "./classic-channel-manager.js";
60
66
  import { type ExplicitInstanceRemoval } from "./instance-removal.js";
61
67
  import type { InstanceState, InteractionSnapshot } from "./backend/types.js";
68
+ import { type Daemon } from "./daemon.js";
62
69
  import { WakeCoordinator } from "./wake-coordinator.js";
63
70
  import { TargetQueueWorker } from "./target-queue-worker.js";
64
71
  import { resolveDeliveryWorkerMode } from "./types.js";
@@ -71,6 +78,7 @@ import { type PreviewAvailability } from "./web-preview.js";
71
78
  import { type ConnectionMetadata, type ConnectionBinding, type BindingProbe, type SecretApplyJob, type ProviderSecretApplyJob } from "./connection-secrets.js";
72
79
  import { type ProviderSecretStatus } from "./provider-secret-registry.js";
73
80
  import { ApplyJobStore, type ApplyJob, type ApplyTargetKind, type SelfRestartResult } from "./apply-job.js";
81
+ import { type CarryResult } from "./backend/claude-carry.js";
74
82
  import { StormWindow } from "./storm-window.js";
75
83
  import { SpawnGate } from "./spawn-gate.js";
76
84
  import { BackendOutageTracker } from "./backend-outage.js";
@@ -98,6 +106,17 @@ export declare function selectLruEvictions(warm: string[], cap: number, opts: {
98
106
  * must match here, or a deleted instance's CLI is left running (#1305 P2-3).
99
107
  */
100
108
  export declare function isOrphanInstanceWindowName(name: string): boolean;
109
+ /** restartSingleInstance's options. `carry` (#1753): a credential-profile switch; its outcome is written into `result`. */
110
+ export interface RestartOpts {
111
+ freshStart?: boolean;
112
+ explicit?: boolean;
113
+ carry?: {
114
+ backend: string;
115
+ from: string | null;
116
+ to: string | null;
117
+ result?: CarryResult | null;
118
+ };
119
+ }
101
120
  /**
102
121
  * Answer shape for `list_models`. `scope` reports where the LIST came from —
103
122
  * "instance" only when it was read through that instance's own backend config,
@@ -158,6 +177,8 @@ export declare const LOGIN_CALLBACK_PREFIX = "login:";
158
177
  * and hides exactly the newly released model the user opened `/model` to find.
159
178
  * The wait is announced before it starts, so it reads as progress, not a stall.
160
179
  */
180
+ /** #1690: how long `/model` waits for the daemon's word on our own runtime switch (its dialog wait plus settling). */
181
+ export declare const RUNTIME_SWITCH_RESULT_MS = 12000;
161
182
  export declare const CLI_ENV_PROBE_DEADLINE_MS = 16000;
162
183
  /**
163
184
  * How many CLIs may cold-start at once, from BOTH memory and cores.
@@ -200,7 +221,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
200
221
  private replyObligationTimer;
201
222
  private readonly activeDurableTargets;
202
223
  /** Live view of lifecycle.daemons — used throughout; not deprecated. */
203
- get daemons(): Map<string, import("./daemon.js").Daemon>;
224
+ get daemons(): Map<string, Daemon>;
204
225
  fleetConfig: FleetConfig | null;
205
226
  private rawFleetConfig;
206
227
  private rawFleetDocument;
@@ -299,6 +320,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
299
320
  private webChannelEchoGuards;
300
321
  /** instanceName → restart currently executing; concurrent callers join it. */
301
322
  private restartsInFlight;
323
+ /**
324
+ * #1753: each in-flight restart's stop → start gap — the conversation carry it will run there (its own, or one a later
325
+ * caller joined with before the gap), and whether the gap has been reached.
326
+ */
327
+ private readonly restartGaps;
302
328
  /**
303
329
  * Delayed automatic retries for instances whose startup failed. Before this a
304
330
  * failed start was logged once and the instance stayed `stopped` until an
@@ -333,6 +359,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
333
359
  /** In-flight /effort selections, same coordinator shape as pendingModelSelects. */
334
360
  private pendingEffortSelects;
335
361
  private pendingModelSelects;
362
+ /** #1806: in-flight /backend steps, keyed by nonce (see handleBackendSelection). */
363
+ private pendingBackendSelects;
336
364
  /** nonce → pending button prompt (hang restart, interactive assist, clean-exit restart). */
337
365
  private pendingNonceButtons;
338
366
  /** #1386 "Needs you": the list, its live chat messages and Acknowledge. Started with the fleet (finishStartup). */
@@ -397,6 +425,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
397
425
  private connectionBindingInFlight;
398
426
  private collabInstances;
399
427
  private healthServer;
428
+ private healthServerDrain;
400
429
  /** #1306: the preview listener (health_port + 1 by default), and whether it is listening. */
401
430
  private previewListener;
402
431
  private previewListening;
@@ -409,6 +438,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
409
438
  private updateProgressEditRunning;
410
439
  private lastUpdateProgressText;
411
440
  private updateCompletionTipText;
441
+ /**
442
+ * #1660: an adopted update whose retire outcome is still owed. The
443
+ * completion summary was (or will be) posted; this watch appends the
444
+ * cleanup outcome to the same receipt instead of letting stage edits
445
+ * clobber it — and refuses a receipt that no longer matches (checklist 3/5).
446
+ */
447
+ private updateCleanupWatch;
412
448
  /** Injectable only to keep the chat→CLI reload hand-off deterministic in tests. */
413
449
  private fullRestartLauncher;
414
450
  private eventLogPruneTimer;
@@ -428,8 +464,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
428
464
  private memoryLogAt;
429
465
  private memoryDebugAt;
430
466
  private memoryLogLevel;
431
- private memoryNoticeAt;
432
- private memoryNoticeLevel;
467
+ /** #1685: the host_memory value the last status frame carried, so a change re-sends the frame. */
468
+ private memoryIndicatorShown;
433
469
  private mirrorBuffer;
434
470
  private mirrorTimer;
435
471
  private sseClients;
@@ -439,6 +475,15 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
439
475
  private webChatStore;
440
476
  /** Uploaded files and the files the dashboard may fetch back (uploads, reply attachments). */
441
477
  readonly webFiles: WebFileLedger;
478
+ /** #1770: per instance, its last web reply still copying its files — the next one is shown after it, in order. */
479
+ private readonly webReplyOrder;
480
+ /** #1770: an instance's web-files byte cap (a field, so a test can make it small). */
481
+ private webReplyMaxBytes;
482
+ /** #1682: the people seen on inbound messages (id → name), for the web chat's mention pills; bounded, in memory. */
483
+ readonly seenUsers: SeenUsers;
484
+ private webPrefsStore?;
485
+ /** #1665: the web preferences kept on the host (<home>/web-prefs.json), read on first use. */
486
+ get webPrefs(): WebPrefsStore;
442
487
  /**
443
488
  * Read from disk on every access rather than cached at startup: `agend
444
489
  * web-token rotate` runs in a separate process, and a cached copy would keep
@@ -519,12 +564,17 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
519
564
  kind: string;
520
565
  correlationId: string;
521
566
  payload: Record<string, unknown>;
567
+ forwards?: readonly string[];
568
+ requestedKind?: string;
522
569
  }): {
523
570
  deliveryId: string;
524
571
  state: string;
525
572
  duplicate: boolean;
573
+ kind: string;
526
574
  };
527
575
  queryDurableDeliveryStatus(callerInstance: string, selector: DeliveryStatusSelector): DeliveryStatusPage;
576
+ /** #1641: why a target is not taking queued work right now, or null when nothing known holds it. */
577
+ private deliveryWaitingReason;
528
578
  getDaemonBootId(instanceName: string): string | undefined;
529
579
  markDurableResponseDelivered(sourceInstance: string, operationId: string): void;
530
580
  /** Called after a replacement Daemon object is installed in lifecycle.daemons. */
@@ -535,6 +585,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
535
585
  * notice when the owner is not working and nothing came back in time.
536
586
  */
537
587
  sweepReplyObligations(now?: Date): void;
588
+ private expireReplyObligations;
538
589
  private scheduleDeliveryOutboxPump;
539
590
  private runDeliveryOutboxPump;
540
591
  /**
@@ -551,6 +602,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
551
602
  private dispatchDurableDelivery;
552
603
  private waitForDurableLaneRelease;
553
604
  private spawnConcurrency;
605
+ /** #1685: "elevated" or "critical" while host memory pressure slows or holds new agents; otherwise null (an
606
+ * unknown macOS reading — the advisory case — is unknown, so null too). */
607
+ private hostMemoryIndicator;
554
608
  /** Separate cooldown: changing measurements must not create new text-throttle keys. */
555
609
  private reportMemoryPressure;
556
610
  /** Wire the one fleet-wide storm into notification and recovery surfaces. */
@@ -586,6 +640,18 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
586
640
  */
587
641
  isPlannedRestart(): boolean;
588
642
  private finishStartup;
643
+ /**
644
+ * We are the post-update fleet: the update is over by definition. Clearing it here (rather than in the update
645
+ * command, which exits before the new fleet is up) is what keeps the quiet window from outliving the restart.
646
+ * #1660 exception: an update still owing its retire outcome keeps its receipt until the cleanup watch resolves it —
647
+ * deleting it here is what lost the warning. Terminal stages are still cleared unconditionally.
648
+ * #1735: and while the watch is armed it owns the marker — even if the outcome landed after the completion posted
649
+ * (a launchd kickstart or a detached restart returns at once, so it can land at any point of the boot): the watch
650
+ * appends it, then clears.
651
+ * #1737 review: and only the marker this boot adopted. One written since — a `/restart full` or a new `/update`
652
+ * landing while this boot's completion was still being edited — belongs to its writer and is left alone.
653
+ */
654
+ private clearSettledUpdateMarker;
589
655
  lastActivityMs(name: string): number;
590
656
  /** Capture the current daemon and delivery owner for a background context read. */
591
657
  getPaneContextSource(name: string): import("./pane-context-cache.js").PaneContextSource | null;
@@ -751,6 +817,18 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
751
817
  getActiveBackendIds(): ReadonlySet<string>;
752
818
  isClassicInstance(name: string): boolean;
753
819
  /** #1523 N2: a ClassicBot room's own summary for its Details page (classicBot.yaml), or null. */
820
+ /** #1218: the Log tab's on-demand service — made on first use; with `web.log_tab` off it answers off and does nothing. */
821
+ private logService;
822
+ private get log();
823
+ /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
824
+ logSteps(name: string, q: LogQuery): Promise<LogAnswer | null>;
825
+ /**
826
+ * #1218: where an instance's steps are read from, resolved only when its Log asks: the transcript its daemon follows
827
+ * now; for claude-code, also the path its statusline last named (so a stopped instance's Log still shows its last
828
+ * work). kiro: fleet events with the reason its history is not read (kiro-log-gate.ts); other backends have no
829
+ * transcript AgEnD can read.
830
+ */
831
+ private logSource;
754
832
  classicRoomFor(name: string): {
755
833
  name: string;
756
834
  channel_id: string;
@@ -826,11 +904,39 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
826
904
  * already in flight may still land late — the contract permits that.
827
905
  */
828
906
  sendClassicWebEcho(instance: string, text: string): Promise<number>;
829
- reserveWebChannelEcho(instanceName: string, sendEcho: () => Promise<unknown>): (accepted: boolean) => void;
907
+ /**
908
+ * #1666: a delivered web chat message starts the same cancel/progress lifecycle in the instance's topic as a platform
909
+ * inbound (afterUserInboundDelivered): the same bubble, ticker and retire rules. Not its ✅ tracking — the web message
910
+ * id is no platform message, and the echo is the fleet's own post. The web send calls this on the echo's lane.
911
+ */
912
+ startWebChatProgress(instanceName: string): Promise<void>;
913
+ /**
914
+ * `copy: false` (#1666/#1668): an entry that is not a copy of a message — the web send's Cancel/progress bubble. It
915
+ * 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
916
+ * starts (waiting behind a slow echo is not its delay), its own timeout only releases the lane (the copies queued
917
+ * behind it are not "behind an ambiguous copy"), and another entry's timeout never drops it. A copy reserved while
918
+ * any non-copy is still open starts its own budget when the last of them finishes: a slow bubble is no copy's delay,
919
+ * however far back the copy is. And a timeout only ever drops copies reserved AFTER the entry that timed out — with
920
+ * deferred budgets, deadlines no longer grow with the order, so that rule is stated, not implied (#1668 r3).
921
+ */
922
+ reserveWebChannelEcho(instanceName: string, sendEcho: () => Promise<unknown>, opts?: {
923
+ copy?: boolean;
924
+ }): (accepted: boolean) => void;
830
925
  /** Whether this target already has an ordinary non-user delivery in its FIFO. */
831
926
  hasPendingIdleGatedDelivery(instanceName: string): boolean;
832
927
  /** The running launch's own steer capability (#1405); undefined for a backend without one, or no running Daemon. */
833
928
  instanceLaunchSupportsSteer(instanceName: string): boolean | undefined;
929
+ private humanReceiptDaemons;
930
+ /** Cached FM + lifecycle + Daemon + tmux owner; unknown ownership grants nothing. */
931
+ private humanReceiptOwner;
932
+ private listenForHumanReceipt;
933
+ /** Evidence-only admission. Bots/system/agent payloads have no trusted origin. */
934
+ private humanReceiptPayload;
935
+ /** Bind at the actual IPC send, after all wake/reconnect waits. No human retry lane. */
936
+ private bindHumanReceiptPayload;
937
+ deliverHumanToInstance(instanceName: string, payload: Record<string, unknown>, origin: HumanOrigin | undefined, originalBody: string, options?: DeliveryOptions): Promise<boolean | void>;
938
+ /** Synchronous steer/btw handoff, using the same evidence and owner binding. */
939
+ sendHumanControl(instanceName: string, payload: Record<string, unknown>, origin: HumanOrigin | undefined, originalBody: string): boolean;
834
940
  /** Single delivery facade: wake paused CLIs and serialize non-user work behind idle. */
835
941
  deliverToInstance(instanceName: string, payload: Record<string, unknown>, options?: DeliveryOptions): Promise<boolean | void>;
836
942
  /**
@@ -877,6 +983,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
877
983
  * the check and the act, so the channel's instance cannot be rebound to another bot in between.
878
984
  */
879
985
  private dispatchSlash;
986
+ private dispatchSlashCore;
880
987
  /**
881
988
  * The door every Discord slash command goes through (src/slash-authz.ts has the rule and the reasoning): the scope
882
989
  * it lets the command into, or the reply that refuses it. Synchronous, so the dispatch acts on what it judged.
@@ -1006,6 +1113,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1006
1113
  * from restarting the same process twice; backendNameOf defines ownership.
1007
1114
  */
1008
1115
  private configuredBackendInstanceNames;
1116
+ /** #1624: migration cannot infer ownership from the running daemon roster.
1117
+ * Stopped/paused ClassicBot entries count too; their workspace is exactly
1118
+ * the one startClassicInstance builds, not this FleetManager's dataDir.
1119
+ */
1120
+ kiroPeerWorkingDirectories(name: string): string[];
1009
1121
  /**
1010
1122
  * Probe the same executable set exposed by the web backend catalog.
1011
1123
  *
@@ -1058,12 +1170,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1058
1170
  /** Last-resort completion after RestartProgress could not deliver to its
1059
1171
  * adopted target. It stays bounded and never wakes a not-ready gateway. */
1060
1172
  private sendFleetStartCompletionFallback;
1061
- stopInstance(name: string, transition?: TransitionHandle): Promise<void>;
1173
+ stopInstance(name: string, transition?: TransitionHandle): Promise<{
1174
+ backgroundWorkEnded: boolean;
1175
+ }>;
1062
1176
  /** 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>;
1177
+ restartSingleInstance(name: string, opts?: RestartOpts): Promise<void>;
1067
1178
  isInstanceRestarting(name: string): boolean;
1068
1179
  /** InstanceLifecycleContext: an explicit wake joins the restart in flight. */
1069
1180
  restartInFlight(name: string): Promise<void> | undefined;
@@ -1084,6 +1195,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1084
1195
  * One-shot: the daemon deletes it on startup.
1085
1196
  */
1086
1197
  private writeFreshStartMarker;
1198
+ /**
1199
+ * #1753: a credential-profile switch, between the old CLI's stop and the new one's start. Where the backend can take
1200
+ * the conversation along (claude-code), copy it into the new profile and make it the one `--continue` picks; when that
1201
+ * cannot be done, or the backend cannot, start fresh as before. Null when nothing was tried.
1202
+ */
1203
+ private switchConversation;
1087
1204
  /** Load .env file from data dir into process.env */
1088
1205
  private loadEnvFile;
1089
1206
  /** Initialize auth before any adapter can answer /dashboard. */
@@ -1099,11 +1216,31 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1099
1216
  ttlMinutes: number;
1100
1217
  } | null;
1101
1218
  private tunnelPurposeLane;
1219
+ private previewTunnel;
1102
1220
  private publicWebLink;
1221
+ /** #1723: the public link's preview tunnel — a manager and lease of its own, never the fleet's one tunnel lane. */
1222
+ private getPreviewTunnel;
1103
1223
  private getTunnelLane;
1104
1224
  private publicOwnerCurrent;
1105
1225
  /** Exact owning General. No primary-adapter or name fallback participates in authorization. */
1106
1226
  private dashboardOwner;
1227
+ /**
1228
+ * #1742: the General a fleet admin's DM speaks for (`/start web`): the same owner `/web` in that General would make
1229
+ * — this bot's configured group and its one General topic. No address to match in a DM, so it must be unambiguous:
1230
+ * no General, or more than one on this bot and group, and there is no owner (nothing is guessed).
1231
+ */
1232
+ private dmDashboardOwner;
1233
+ /**
1234
+ * #1742: a fleet admin whose Telegram `/web` could not reach them privately may next open the bot's DM and press
1235
+ * Telegram's START, which sends a bare `/start` — read as `/start web` (the DM menu) for 10 minutes, once, for that
1236
+ * admin on that bot. Monotonic: a wall-clock jump neither opens nor shuts it.
1237
+ */
1238
+ private readonly tgWebStartWindows;
1239
+ private openTgWebStartWindow;
1240
+ /** Uses the window up: true when it was open. */
1241
+ private takeTgWebStartWindow;
1242
+ /** #1742: `/start web` from a fleet admin: the /web menu right here in the DM, for the General this bot serves. */
1243
+ private startWebInDm;
1107
1244
  private getPublicWebLink;
1108
1245
  getPublicWebStatus(): {
1109
1246
  state: string;
@@ -1117,6 +1254,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1117
1254
  }, current: () => boolean): Promise<void>;
1118
1255
  /** Telegram's typed command enters through the same strict owner and nonce path as Discord. */
1119
1256
  dashboardMenu(msg: InboundMessage): Promise<void>;
1257
+ /**
1258
+ * #1686: build the Telegram deep-link that opens a DM with this bot pre-seeded with `/start web`.
1259
+ * Returns null when no botUsername is known or the username fails Telegram's format validation.
1260
+ */
1261
+ private tgStartWebUrl;
1120
1262
  private sendLocalDashboard;
1121
1263
  /**
1122
1264
  * #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 +1278,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1136
1278
  /** Why the DM did not go, for the log only (Discord 50007 = the user does not accept DMs from this server's members). */
1137
1279
  private logDashboardDmFailure;
1138
1280
  /** False when the menu was not shown (the caller still owes the user an answer). */
1281
+ /**
1282
+ * `dmChatId` (#1742): show it in the owner's own private chat with the bot instead of the General — the owner, its
1283
+ * gates and the code's route are the same; only where the menu sits (and its clicks are good) changes.
1284
+ */
1139
1285
  private showDashboardMenu;
1140
1286
  private handleDashboardCallback;
1141
1287
  /** `/dashboard revoke`: sign out every browser and withdraw any unused code. */
@@ -1188,6 +1334,36 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1188
1334
  private reportFullRestartFailure;
1189
1335
  failUpdateProgress(message: string): void;
1190
1336
  /** The old fleet edits CLI install stages; the new fleet adopts the same message below. */
1337
+ /**
1338
+ * #1660: arm the post-completion cleanup watch and make sure its monitor
1339
+ * actually runs. The new fleet adopts the receipt at boot but nothing else
1340
+ * starts this timer on that path (Prism a) — without this, the owed
1341
+ * outcome would sit in the marker unwatched. READY never waits for it.
1342
+ */
1343
+ /**
1344
+ * #1735: what the completion of an adopted update does about its retire outcome, read from the marker as it is now.
1345
+ * Already landed with a warning (a detached restart returns before this fleet boots, so the updater retires first)
1346
+ * → render it in the completion. Still owed (`cleanup: "pending"` — a service restart waits for READY, which comes
1347
+ * after the completion) → watch for it. Anything else (no retire on this update, done silently, another receipt)
1348
+ * → nothing.
1349
+ */
1350
+ /**
1351
+ * #1716: background work this restart/update ended, scoped to the operation
1352
+ * so an older stop never reports (`sinceAt` null = plain boot, report
1353
+ * nothing). A method — not a module function — because the #1737
1354
+ * extracted-completion harness runs this region verbatim with only
1355
+ * `this`-methods plus a fixed context.
1356
+ */
1357
+ private collectBackgroundWorkEndedNames;
1358
+ private updateCleanupAtCompletion;
1359
+ private armCleanupWatch;
1360
+ /**
1361
+ * #1660: append a recorded cleanup outcome to the adopted update message,
1362
+ * then release the receipt — but only if this receipt still owns the
1363
+ * marker. The await yields, so a newer receipt (e.g. a full-restart that
1364
+ * landed mid-edit) must not be cleared or disturbed (Prism b).
1365
+ */
1366
+ private appendCleanupWarning;
1191
1367
  private startUpdateProgressMonitor;
1192
1368
  /** Start all instances from fleet config */
1193
1369
  startAll(configPath: string): Promise<void>;
@@ -1392,6 +1568,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1392
1568
  */
1393
1569
  private resolveInboundTarget;
1394
1570
  private handleInboundMessage;
1571
+ /**
1572
+ * #1752: the bot that speaks back about an inbound message — in a fleet topic the owning instance's adapter, never
1573
+ * the sibling that happened to win the dedup race; elsewhere (ClassicBot rooms, no routed instance) the receiver.
1574
+ */
1575
+ private inboundNoticeAdapter;
1576
+ private handleInboundMessageCore;
1395
1577
  /** Handle outbound tool calls from a daemon instance */
1396
1578
  /** Warn (but don't block) when rate limits are high. 30-min debounce per instance. */
1397
1579
  private rateLimitWarnedAt;
@@ -1433,7 +1615,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1433
1615
  private isWebOnlyFleet;
1434
1616
  /** On a fleet with no chat platform, the dashboard is where an instance-health prompt is posted (#1307 item 6). */
1435
1617
  private webOnlyPromptPlace;
1618
+ /** Resolves when the reply is in the web chat (#1770: after its files are copied); the caller need not wait. */
1436
1619
  private afterReplyRouted;
1620
+ /**
1621
+ * #1770: a reply's files as the web chat shows them. Each is copied into the instance's web-files/ and served from
1622
+ * the copy. One the copy refuses (a symlink, not a regular file, over 50 MB, a state file, missing) is not shown;
1623
+ * one that could not be copied (I/O) is served from the agent's own path, as before — until the fleet restarts.
1624
+ */
1625
+ private webReplyAttachments;
1437
1626
  private handleScheduleTrigger;
1438
1627
  /**
1439
1628
  * The adapter that can actually post into a chat, found by its group.
@@ -1675,6 +1864,46 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1675
1864
  /** Keyed `<connection>\0<server id>`. */
1676
1865
  private guildEmojiCache;
1677
1866
  private guildEmojiFetches;
1867
+ private webImageCaches;
1868
+ private webImageCache;
1869
+ /**
1870
+ * instance → the connection that is its own bot: configured now (a connection removed from fleet.yaml is nobody's,
1871
+ * whatever an instance still names — #1635 review), not the primary, and answering for it alone.
1872
+ */
1873
+ private ownBots;
1874
+ /**
1875
+ * The bot a connection is now: its running adapter and that bot's own user id. Everything cached for an own bot is
1876
+ * keyed by both, so a bot put in its place (a token replaced under the same connection id) never shows the old one's
1877
+ * face or colour, and the old one's late answers land under the old key (#1635 review). null while it has no id.
1878
+ */
1879
+ private botOwner;
1880
+ /** Still the same bot behind `connection` (after an await): the same adapter object and the same bot id. */
1881
+ private botStillOwns;
1882
+ /** keyed `<connection>\0<bot id>\0<channel>`: the bot's colour there, refreshed at most daily (monotonic), one read at a time. */
1883
+ private webAccents;
1884
+ private webAccentReads;
1885
+ private webAccent;
1886
+ /** The cache key of an own bot's avatar, and its loader (which refuses an answer from a bot no longer there). */
1887
+ private botAvatarSource;
1888
+ /** One instance's avatar and ring for the status frame. Synchronous: what is cached now; fetches run behind. */
1889
+ private webIdentityImage;
1890
+ /** GET /ui/img/bot|avatar/<key>: what is cached, never a fetch. Only an own-bot connection, or a known instance's upload. */
1891
+ webImage(kind: "bot" | "avatar", key: string): CachedImage | null;
1892
+ /**
1893
+ * #1682 GET /ui/mentions: names for the mention ids a page found in what it rendered — never a Discord request; in order:
1894
+ * the fleet's bots (an instance's own bot is that instance's label: fleet.yaml, and the View profiles read from
1895
+ * profiles.db, as the status frame does), the people seen on inbound messages, and the Discord adapters' caches
1896
+ * (members, users, roles, channels).
1897
+ */
1898
+ webMentionNames(query: MentionQuery): MentionNames;
1899
+ /** GET /ui/emojis: the custom emoji of every server the fleet's Discord bots are in (the Settings picker's cache). */
1900
+ webEmojiList(): Promise<Array<{
1901
+ id: string;
1902
+ name: string;
1903
+ animated: boolean;
1904
+ }>>;
1905
+ /** GET /ui/img/emoji/<id>: only an emoji of those servers; fetched once from Discord's CDN, then from the host cache. */
1906
+ webEmoji(id: string): Promise<CachedImage | null>;
1678
1907
  /**
1679
1908
  * What `instanceName` may pick as its persona emoji (the `list_emojis`
1680
1909
  * tool): its current status set with where each value comes from, the
@@ -1977,6 +2206,19 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1977
2206
  */
1978
2207
  orgChart(): OrgChart;
1979
2208
  private cacheService;
2209
+ /**
2210
+ * #1699: the credential profile an instance's CLI signs in with on `backend` — fleet.yaml's (with its defaults), or a
2211
+ * ClassicBot room's launched or would-be login when the room runs that backend. Null: the backend's default login
2212
+ * (also for a backend that has no profiles, where the option is ignored).
2213
+ */
2214
+ credentialProfileOf(name: string, backend: string): string | null;
2215
+ /**
2216
+ * #1699: the claude config dir an instance's CLI uses — its credential profile's, else exactly as before
2217
+ * (CLAUDE_CONFIG_DIR or ~/.claude).
2218
+ */
2219
+ claudeConfigDirOf(name: string): string;
2220
+ /** The instances the cache analysis reads: fleet.yaml's, then the ClassicBot rooms (their workspace under the AgEnD home, their own backend). */
2221
+ private cacheInstances;
1980
2222
  /**
1981
2223
  * #1468: the prompt-cache expiry analysis for the web, per instance, over `window`. Read from each instance's
1982
2224
  * ledger as it is now; the first request starts the bounded, persisted catch-up over the transcripts
@@ -2049,6 +2291,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2049
2291
  * synchronous; they never probe the pane.
2050
2292
  */
2051
2293
  private clearTargetFence;
2294
+ /** #1806: the web's /backend confirmations — one per question, used once, for the arguments and backend asked about. */
2295
+ private readonly webBackendTokens;
2052
2296
  /** #1269: the web's /clear confirmations — one token per question, used once, for the instance as it was asked about. */
2053
2297
  private readonly webClearTokens;
2054
2298
  /** #1269: an instance's chat command from the web chat (web-commands.ts); `publicLink`: a gateway request. */
@@ -2112,7 +2356,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2112
2356
  * Backends with no remote login flow (opencode logs in from a terminal) get
2113
2357
  * no button — the alert's own wording already tells them what to run.
2114
2358
  */
2115
- offerBackendLogin(targetInstance: string, backend: string): Promise<void>;
2359
+ offerBackendLogin(targetInstance: string, backend: string, profile?: string): Promise<void>;
2116
2360
  /** Consume a General assist button exactly once. */
2117
2361
  private handleInteractivePromptAssist;
2118
2362
  /** Send a "🛑 Cancel" button to the instance's topic/channel after delivery. */
@@ -2345,6 +2589,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2345
2589
  skipAuthCheck?: boolean;
2346
2590
  tokenPresent?: boolean;
2347
2591
  tunnel?: boolean;
2592
+ profile?: string;
2348
2593
  }): Promise<string | null>;
2349
2594
  /** Which way a `/login` went (#1131) — so the event log shows what users actually need. */
2350
2595
  private recordLoginFlow;
@@ -2388,6 +2633,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2388
2633
  chatId: string;
2389
2634
  threadId?: string;
2390
2635
  userId?: string;
2636
+ }, signIn?: {
2637
+ profile?: string;
2391
2638
  }): Promise<string>;
2392
2639
  /** Whether this backend's CLI is on the fleet's PATH (what `/login` installs when it is not). */
2393
2640
  isCliInstalled(backend: string): boolean;
@@ -2504,6 +2751,20 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2504
2751
  /** Forward a message to a classic channel instance with chat log context */
2505
2752
  private forwardToClassicInstance;
2506
2753
  /** Paste raw text directly to a classic instance's CLI (no [user:] wrapping) */
2754
+ /** #1690: our own runtime switches awaiting the daemon's outcome, by id. */
2755
+ private readonly runtimeSwitchWaiters;
2756
+ /**
2757
+ * #1690: type `/model <model>` and wait for what it came to: the daemon answers claude's "Switch model?" for us (Yes
2758
+ * when it names this model, No otherwise) or sees claude's own result. Null when it could not be sent; a timeout is
2759
+ * "not confirmed".
2760
+ */
2761
+ private runRuntimeModelSwitch;
2762
+ /**
2763
+ * #1690: the names claude-code is known to accept, for checking `/model <name>` BEFORE it is typed — claude itself
2764
+ * accepts any string ("Set model to opsu"), and its "Switch model?" then names the typo. Static aliases (with [1m]),
2765
+ * the cached account catalog, the configured model; without a cached catalog, any `claude-…` id too (cannot check).
2766
+ */
2767
+ private claudeModelKnown;
2507
2768
  private pasteRawToClassicInstance;
2508
2769
  /** Resolve the backend name configured for an instance (fleet or classic). */
2509
2770
  private backendNameForInstance;
@@ -2669,6 +2930,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2669
2930
  */
2670
2931
  applyEffort(instanceName: string, requested: string): Promise<string>;
2671
2932
  applyModel(instanceName: string, model: string): Promise<string>;
2933
+ /** Save an instance's model (fleet.yaml, or its ClassicBot channel). False when neither holds it. */
2934
+ private persistInstanceModel;
2672
2935
  /**
2673
2936
  * The trailing "Current effort: …" line for a /model reply.
2674
2937
  *
@@ -2677,6 +2940,72 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2677
2940
  * a switch saves the round trip of asking. Empty when the backend has none.
2678
2941
  */
2679
2942
  private effortSuffix;
2943
+ /** The steps' view of this fleet (backend-command.ts). `live`: a missing or stale model list may be probed (not on the web). */
2944
+ private backendCommandDeps;
2945
+ /**
2946
+ * `/effort`'s levels for a backend this instance may move to, for the model that will run there (codex's levels are
2947
+ * per model; null: its configured default). Empty: it has no effort setting. A file read, never a CLI.
2948
+ */
2949
+ backendEffortLevels(instanceName: string, backend: string, model?: string | null): string[];
2950
+ /**
2951
+ * #1808: whether a backend takes this model name — the one rule for /backend and update_instance_config's switch.
2952
+ * The name must be one its launch line can carry (modelNameCarried); then its offered list (the cached CLI env), and
2953
+ * claude-code's known names (without this instance's configured model, which belongs to the backend being left).
2954
+ * With no list known, the backend's usual name pattern decides.
2955
+ */
2956
+ backendModelVerdict(instanceName: string, backend: string, model: string,
2957
+ /** The provider the backend will run on (default: this instance's own, else the fleet's). */
2958
+ opts?: {
2959
+ provider: string | null;
2960
+ }): {
2961
+ ok: true;
2962
+ } | {
2963
+ ok: false;
2964
+ choices: string[];
2965
+ };
2966
+ /**
2967
+ * #1807 review r2: the model codex's next launch of this instance runs. Every launch's writeConfig copies the SHARED
2968
+ * config.toml into the instance's codex home first, so that source decides — not the home's copy from an earlier
2969
+ * launch. Read-only; a model chosen here (`-c model=…`) outranks it; a project file that could change it, unproven.
2970
+ */
2971
+ private prospectiveCodexModel;
2972
+ /** #1811: whether a launch of `backend` here would pass a level: the same gate its builder applies. */
2973
+ private launchEffortGate;
2974
+ /** Installed the way the launch finds a CLI (resolveBinary): on PATH or in a known install directory. */
2975
+ private backendInstalledHere;
2976
+ /** The models `/model` would offer on a backend: the cached CLI env, else (live) a bounded probe. Never throws. */
2977
+ private backendModelOptions;
2978
+ /**
2979
+ * #1806 review: the instance a `/backend` was asked about is still this config entry — not one deleted and created
2980
+ * again under the same name, or replaced by a Settings edit (both put a new object there), stopped or not.
2981
+ */
2982
+ private backendTargetIs;
2983
+ /** `/backend` is for fleet.yaml instances: update_instance_config does not manage a ClassicBot agent. */
2984
+ private backendCommandRefusal;
2985
+ /**
2986
+ * Apply a confirmed `/backend`: judged again first (a menu lives a minute — the backend may have moved, a CLI been
2987
+ * removed), then update_instance_config's write: backend, model and effort at once, refused and rolled back whole
2988
+ * (its credential-profile login gate included), then one fresh relaunch of a running instance.
2989
+ */
2990
+ applyBackendSwitch(instanceName: string, args: readonly string[], from: string, stillCurrent: () => boolean): Promise<string>;
2991
+ /** A step's buttons: index callbacks (a model id can be longer than Telegram's 64-byte callback data allows). */
2992
+ private backendStepButtons;
2993
+ /**
2994
+ * Show a `/backend` step (a choice, or the confirmation) where the command was given: Discord edits its interaction
2995
+ * reply; Telegram retires the previous step's keyboard and posts the next. One pending entry per step, under a fresh
2996
+ * nonce: a click on an older step finds nothing.
2997
+ */
2998
+ private presentBackendStep;
2999
+ /** Close a `/backend` menu with a last word: its buttons go (Telegram edits them away), the text stays. Returns where it was said. */
3000
+ private endBackendMenu;
3001
+ /** Start `/backend` for a fleet instance from Discord or Telegram; the caller has checked the channel admin. */
3002
+ private beginBackendCommand;
3003
+ /** `/backend` slash handler: channel admin, as `/model`. Options or typed text give the direct form. */
3004
+ private handleBackendSlash;
3005
+ /** Telegram `/backend` in a fleet topic (topic-commands) or a ClassicBot chat; the caller has checked the admin. */
3006
+ runBackendCommand(instanceName: string, text: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string, adapterId?: string): Promise<void>;
3007
+ /** Consume a `/backend` click: the next step, or on the confirmation the switch itself. True for every backend-select id. */
3008
+ private handleBackendSelection;
2680
3009
  /** Read recent chat log for agent context */
2681
3010
  private getRecentChatLog;
2682
3011
  /**
@@ -2692,6 +3021,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2692
3021
  private getMissingBackendWarning;
2693
3022
  /** Handle Discord's required static slash choice, warning before a likely startup failure. */
2694
3023
  private handleClassicStartSlash;
3024
+ private handleClassicStartSlashCore;
2695
3025
  /** Present platform-native backend choices, then start on selection or timeout. */
2696
3026
  private beginClassicBackendSelection;
2697
3027
  /** Consume a selection callback. Returns true for all ClassicBot callback IDs, including stale ones. */
@@ -3003,6 +3333,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3003
3333
  previewForUi(hostHeader: string | undefined, secure: boolean): PreviewAvailability & {
3004
3334
  boot: string | null;
3005
3335
  };
3336
+ /**
3337
+ * #1723: for one page of the public link (exposure `exposureId`, at `dashboardOrigin`): its own preview tunnel's
3338
+ * origin once up, "starting" until then, why it failed if it did — or a configured web.preview_origin, used instead.
3339
+ */
3340
+ publicPreviewForUi(exposureId: string, dashboardOrigin: string): PublicPreviewForUi;
3006
3341
  getUiStatus(): unknown;
3007
3342
  private getUiStatusSync;
3008
3343
  }