@songsid/agend 2.3.4-beta.1 → 2.3.4-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 (284) hide show
  1. package/THIRD_PARTY_NOTICES.md +37 -0
  2. package/dist/agend-home.d.ts +13 -0
  3. package/dist/agend-home.js +42 -0
  4. package/dist/agend-home.js.map +1 -1
  5. package/dist/agent-cli-instructions.md +1 -1
  6. package/dist/agent-credentials.d.ts +24 -0
  7. package/dist/agent-credentials.js +66 -0
  8. package/dist/agent-credentials.js.map +1 -0
  9. package/dist/agent-endpoint.d.ts +3 -1
  10. package/dist/agent-endpoint.js +13 -0
  11. package/dist/agent-endpoint.js.map +1 -1
  12. package/dist/auth-api.js +10 -2
  13. package/dist/auth-api.js.map +1 -1
  14. package/dist/authority/session-authorizations.d.ts +28 -4
  15. package/dist/authority/session-authorizations.js +63 -17
  16. package/dist/authority/session-authorizations.js.map +1 -1
  17. package/dist/backend/antigravity.js +3 -1
  18. package/dist/backend/antigravity.js.map +1 -1
  19. package/dist/backend/claude-code.d.ts +3 -0
  20. package/dist/backend/claude-code.js +89 -4
  21. package/dist/backend/claude-code.js.map +1 -1
  22. package/dist/backend/codex-footer-hints.d.ts +4 -0
  23. package/dist/backend/codex-footer-hints.js +27 -0
  24. package/dist/backend/codex-footer-hints.js.map +1 -0
  25. package/dist/backend/codex-session-lookup.d.ts +35 -0
  26. package/dist/backend/codex-session-lookup.js +93 -0
  27. package/dist/backend/codex-session-lookup.js.map +1 -1
  28. package/dist/backend/codex.d.ts +27 -0
  29. package/dist/backend/codex.js +124 -23
  30. package/dist/backend/codex.js.map +1 -1
  31. package/dist/backend/kiro-identity.d.ts +2 -0
  32. package/dist/backend/kiro-identity.js +13 -6
  33. package/dist/backend/kiro-identity.js.map +1 -1
  34. package/dist/backend/kiro.d.ts +3 -0
  35. package/dist/backend/kiro.js +68 -5
  36. package/dist/backend/kiro.js.map +1 -1
  37. package/dist/backend/muse.js +5 -3
  38. package/dist/backend/muse.js.map +1 -1
  39. package/dist/backend/types.d.ts +6 -1
  40. package/dist/backend/types.js +3 -0
  41. package/dist/backend/types.js.map +1 -1
  42. package/dist/backend-availability.d.ts +6 -0
  43. package/dist/backend-availability.js +13 -5
  44. package/dist/backend-availability.js.map +1 -1
  45. package/dist/cache-ledger.d.ts +85 -0
  46. package/dist/cache-ledger.js +236 -1
  47. package/dist/cache-ledger.js.map +1 -1
  48. package/dist/cache-service.d.ts +5 -0
  49. package/dist/cache-service.js +16 -4
  50. package/dist/cache-service.js.map +1 -1
  51. package/dist/channel/adapters/discord.js +27 -4
  52. package/dist/channel/adapters/discord.js.map +1 -1
  53. package/dist/channel/adapters/telegram.d.ts +51 -0
  54. package/dist/channel/adapters/telegram.js +238 -18
  55. package/dist/channel/adapters/telegram.js.map +1 -1
  56. package/dist/channel/inbox-temp-name.d.ts +9 -0
  57. package/dist/channel/inbox-temp-name.js +13 -0
  58. package/dist/channel/inbox-temp-name.js.map +1 -0
  59. package/dist/channel/mcp-tools.js +3 -3
  60. package/dist/channel/mcp-tools.js.map +1 -1
  61. package/dist/channel/types.d.ts +2 -0
  62. package/dist/chat-log-ids.d.ts +48 -0
  63. package/dist/chat-log-ids.js +182 -0
  64. package/dist/chat-log-ids.js.map +1 -0
  65. package/dist/classic-channel-manager.d.ts +8 -1
  66. package/dist/classic-channel-manager.js +24 -2
  67. package/dist/classic-channel-manager.js.map +1 -1
  68. package/dist/cli.js +4 -6
  69. package/dist/cli.js.map +1 -1
  70. package/dist/cross-instance-notice.d.ts +10 -0
  71. package/dist/cross-instance-notice.js +67 -5
  72. package/dist/cross-instance-notice.js.map +1 -1
  73. package/dist/daemon.d.ts +52 -0
  74. package/dist/daemon.js +530 -34
  75. package/dist/daemon.js.map +1 -1
  76. package/dist/delivery-consumed-watch.d.ts +23 -1
  77. package/dist/delivery-consumed-watch.js +30 -3
  78. package/dist/delivery-consumed-watch.js.map +1 -1
  79. package/dist/delivery-reconciliation.d.ts +7 -0
  80. package/dist/delivery-reconciliation.js +9 -1
  81. package/dist/delivery-reconciliation.js.map +1 -1
  82. package/dist/dialog-screen-text.d.ts +16 -0
  83. package/dist/dialog-screen-text.js +51 -0
  84. package/dist/dialog-screen-text.js.map +1 -0
  85. package/dist/export-import.d.ts +7 -0
  86. package/dist/export-import.js +44 -10
  87. package/dist/export-import.js.map +1 -1
  88. package/dist/fleet-context.d.ts +2 -0
  89. package/dist/fleet-manager.d.ts +147 -11
  90. package/dist/fleet-manager.js +747 -118
  91. package/dist/fleet-manager.js.map +1 -1
  92. package/dist/fleet-yaml-patch.d.ts +3 -0
  93. package/dist/fleet-yaml-patch.js +103 -0
  94. package/dist/fleet-yaml-patch.js.map +1 -0
  95. package/dist/general-knowledge/skills/concepts/SKILL.md +393 -0
  96. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +1 -0
  97. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +3 -1
  98. package/dist/general-knowledge/skills/kiro-engine-migration/SKILL.md +41 -4
  99. package/dist/general-knowledge/skills/model-discovery/SKILL.md +2 -0
  100. package/dist/general-knowledge/skills/web-appearance/SKILL.md +1 -1
  101. package/dist/general-knowledge/skills/web-dashboard/SKILL.md +10 -4
  102. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +1 -1
  103. package/dist/install-stream.d.ts +53 -0
  104. package/dist/install-stream.js +134 -0
  105. package/dist/install-stream.js.map +1 -0
  106. package/dist/instance-lifecycle.d.ts +20 -2
  107. package/dist/instance-lifecycle.js +80 -12
  108. package/dist/instance-lifecycle.js.map +1 -1
  109. package/dist/instance-topic-delete.d.ts +77 -0
  110. package/dist/instance-topic-delete.js +123 -0
  111. package/dist/instance-topic-delete.js.map +1 -0
  112. package/dist/instructions.d.ts +1 -1
  113. package/dist/instructions.js +1 -1
  114. package/dist/instructions.js.map +1 -1
  115. package/dist/kiro-engine-status.d.ts +11 -0
  116. package/dist/kiro-engine-status.js +6 -0
  117. package/dist/kiro-engine-status.js.map +1 -1
  118. package/dist/kiro-resume-summary.d.ts +37 -0
  119. package/dist/kiro-resume-summary.js +85 -0
  120. package/dist/kiro-resume-summary.js.map +1 -0
  121. package/dist/locale.js +82 -6
  122. package/dist/locale.js.map +1 -1
  123. package/dist/log-service.d.ts +30 -0
  124. package/dist/log-service.js +36 -3
  125. package/dist/log-service.js.map +1 -1
  126. package/dist/log-steps.d.ts +4 -3
  127. package/dist/log-steps.js +32 -7
  128. package/dist/log-steps.js.map +1 -1
  129. package/dist/logger.d.ts +12 -0
  130. package/dist/logger.js +43 -1
  131. package/dist/logger.js.map +1 -1
  132. package/dist/login-controller.js +9 -1
  133. package/dist/login-controller.js.map +1 -1
  134. package/dist/login-flows.d.ts +2 -0
  135. package/dist/login-flows.js +5 -2
  136. package/dist/login-flows.js.map +1 -1
  137. package/dist/login-manager.d.ts +6 -0
  138. package/dist/login-manager.js +10 -1
  139. package/dist/login-manager.js.map +1 -1
  140. package/dist/missed-offline.d.ts +25 -0
  141. package/dist/missed-offline.js +79 -0
  142. package/dist/missed-offline.js.map +1 -0
  143. package/dist/needs-you-hub.d.ts +6 -1
  144. package/dist/needs-you-hub.js +31 -8
  145. package/dist/needs-you-hub.js.map +1 -1
  146. package/dist/needs-you.d.ts +22 -2
  147. package/dist/needs-you.js +17 -3
  148. package/dist/needs-you.js.map +1 -1
  149. package/dist/office-share-page.d.ts +1 -1
  150. package/dist/office-share-page.js +6 -2
  151. package/dist/office-share-page.js.map +1 -1
  152. package/dist/outbound-handlers.js +59 -3
  153. package/dist/outbound-handlers.js.map +1 -1
  154. package/dist/outbound-schemas.d.ts +1 -0
  155. package/dist/outbound-schemas.js +9 -3
  156. package/dist/outbound-schemas.js.map +1 -1
  157. package/dist/package-preimage.js +27 -2
  158. package/dist/package-preimage.js.map +1 -1
  159. package/dist/queued-handoffs.d.ts +33 -0
  160. package/dist/queued-handoffs.js +75 -0
  161. package/dist/queued-handoffs.js.map +1 -0
  162. package/dist/reply-buttons-controller.js +10 -0
  163. package/dist/reply-buttons-controller.js.map +1 -1
  164. package/dist/scheduler/db.d.ts +2 -1
  165. package/dist/scheduler/db.js +23 -9
  166. package/dist/scheduler/db.js.map +1 -1
  167. package/dist/selection-card.d.ts +2 -3
  168. package/dist/selection-card.js +99 -26
  169. package/dist/selection-card.js.map +1 -1
  170. package/dist/settings-api.d.ts +13 -0
  171. package/dist/settings-api.js +12 -1
  172. package/dist/settings-api.js.map +1 -1
  173. package/dist/stall-reporter.d.ts +21 -0
  174. package/dist/stall-reporter.js +82 -0
  175. package/dist/stall-reporter.js.map +1 -0
  176. package/dist/tmux-control.d.ts +2 -2
  177. package/dist/tmux-control.js +4 -2
  178. package/dist/tmux-control.js.map +1 -1
  179. package/dist/tmux-exec-helper.d.ts +6 -3
  180. package/dist/tmux-exec-helper.js +115 -53
  181. package/dist/tmux-exec-helper.js.map +1 -1
  182. package/dist/tmux-manager.d.ts +6 -0
  183. package/dist/tmux-manager.js +17 -0
  184. package/dist/tmux-manager.js.map +1 -1
  185. package/dist/tool-permissions.d.ts +5 -2
  186. package/dist/tool-permissions.js +6 -5
  187. package/dist/tool-permissions.js.map +1 -1
  188. package/dist/tool-progress.d.ts +2 -0
  189. package/dist/tool-progress.js +19 -3
  190. package/dist/tool-progress.js.map +1 -1
  191. package/dist/topic-commands.js +4 -0
  192. package/dist/topic-commands.js.map +1 -1
  193. package/dist/tunnel/cloudflared-install.d.ts +4 -0
  194. package/dist/tunnel/cloudflared-install.js +20 -1
  195. package/dist/tunnel/cloudflared-install.js.map +1 -1
  196. package/dist/tunnel/cloudflared.d.ts +8 -1
  197. package/dist/tunnel/cloudflared.js +34 -6
  198. package/dist/tunnel/cloudflared.js.map +1 -1
  199. package/dist/tunnel/lease.d.ts +3 -3
  200. package/dist/tunnel/lease.js +23 -19
  201. package/dist/tunnel/lease.js.map +1 -1
  202. package/dist/tunnel/manager.js +6 -7
  203. package/dist/tunnel/manager.js.map +1 -1
  204. package/dist/ui/chat-store.js +20 -3
  205. package/dist/ui/chat-strings.js +4 -4
  206. package/dist/ui/chat-thread.js +52 -10
  207. package/dist/ui/fleet-canvas.js +4 -3
  208. package/dist/ui/fleet-office-model.js +55 -22
  209. package/dist/ui/fleet-office-overview.js +6 -38
  210. package/dist/ui/fleet-office-pack.js +4 -3
  211. package/dist/ui/fleet-office-skin.js +114 -21
  212. package/dist/ui/fleet-office-store.js +5 -0
  213. package/dist/ui/fleet-office-zones.js +2 -2
  214. package/dist/ui/fleet-office.js +41 -9
  215. package/dist/ui/fleet-usage.js +90 -27
  216. package/dist/ui/panel-chat.js +2 -0
  217. package/dist/ui/panel-log.js +7 -1
  218. package/dist/ui/panel-needs.js +17 -8
  219. package/dist/ui/settings-strings.js +2 -2
  220. package/dist/ui/shared/app-i18n.js +4 -4
  221. package/dist/ui/shared/app-needs.js +1 -1
  222. package/dist/ui/shared/app-shell.js +4 -2
  223. package/dist/ui/shared/app-stream.js +26 -0
  224. package/dist/ui/shared/app.css +51 -3
  225. package/dist/ui/shared/office/guild.png +0 -0
  226. package/dist/ui/shared/office/school.png +0 -0
  227. package/dist/ui/shared/panel-view.js +339 -17
  228. package/dist/ui/shared/usage-dialog.js +18 -1
  229. package/dist/ui/shared/view-history.css +17 -0
  230. package/dist/ui/shared/view-history.js +438 -0
  231. package/dist/ui/shared/view-strings.js +42 -0
  232. package/dist/unattended-install.d.ts +6 -0
  233. package/dist/unattended-install.js +79 -0
  234. package/dist/unattended-install.js.map +1 -0
  235. package/dist/usage/capacity.d.ts +69 -0
  236. package/dist/usage/capacity.js +119 -0
  237. package/dist/usage/capacity.js.map +1 -0
  238. package/dist/usage/i18n-keys.d.ts +1 -1
  239. package/dist/usage/i18n-keys.js +3 -0
  240. package/dist/usage/i18n-keys.js.map +1 -1
  241. package/dist/usage/profile-timeline.d.ts +16 -0
  242. package/dist/usage/profile-timeline.js +58 -0
  243. package/dist/usage/profile-timeline.js.map +1 -0
  244. package/dist/usage/quota-history.d.ts +43 -0
  245. package/dist/usage/quota-history.js +168 -0
  246. package/dist/usage/quota-history.js.map +1 -0
  247. package/dist/usage/usage-api.d.ts +31 -0
  248. package/dist/usage/usage-api.js +80 -1
  249. package/dist/usage/usage-api.js.map +1 -1
  250. package/dist/usage-report.d.ts +25 -1
  251. package/dist/usage-report.js +55 -4
  252. package/dist/usage-report.js.map +1 -1
  253. package/dist/usage-rollup.d.ts +4 -1
  254. package/dist/usage-rollup.js +12 -3
  255. package/dist/usage-rollup.js.map +1 -1
  256. package/dist/view-api.d.ts +31 -0
  257. package/dist/view-api.js +186 -41
  258. package/dist/view-api.js.map +1 -1
  259. package/dist/view-history.d.ts +84 -0
  260. package/dist/view-history.js +116 -0
  261. package/dist/view-history.js.map +1 -0
  262. package/dist/web-api.d.ts +6 -0
  263. package/dist/web-api.js +15 -4
  264. package/dist/web-api.js.map +1 -1
  265. package/dist/web-chat-history.d.ts +20 -0
  266. package/dist/web-chat-history.js +21 -0
  267. package/dist/web-chat-history.js.map +1 -1
  268. package/dist/web-guest-access.js +5 -1
  269. package/dist/web-guest-access.js.map +1 -1
  270. package/dist/web-login.d.ts +4 -3
  271. package/dist/web-login.js +23 -14
  272. package/dist/web-login.js.map +1 -1
  273. package/dist/web-office-pack-tools.d.ts +1 -1
  274. package/dist/web-office-pack-tools.js +1 -1
  275. package/dist/web-office-pack-tools.js.map +1 -1
  276. package/dist/web-session-authorization.d.ts +13 -2
  277. package/dist/web-session-authorization.js +10 -3
  278. package/dist/web-session-authorization.js.map +1 -1
  279. package/dist/web-session.d.ts +5 -0
  280. package/dist/web-session.js +20 -8
  281. package/dist/web-session.js.map +1 -1
  282. package/launcher/agend-install.cjs +16 -2
  283. package/launcher/private-home.cjs +1 -1
  284. package/package.json +1 -1
@@ -15,6 +15,7 @@ import type { FleetConfig, RawFleetConfig, InstanceConfig, WebVerifiedAuthorityC
15
15
  import { type DeliveryStatus, type GuildEmoji, type GuildEmojiGroup, type ResolvedStatusEmojis } from "./status-emojis.js";
16
16
  import { type RouteTarget } from "./fleet-context.js";
17
17
  import { EventLog } from "./event-log.js";
18
+ import { type TopicDeleteOutcome } from "./instance-topic-delete.js";
18
19
  import { BackendAvailabilityStore, type AvailabilityProbes, type BackendAvailability } from "./backend-availability.js";
19
20
  import { AdapterWorld } from "./adapter-world.js";
20
21
  import { CostGuard } from "./cost-guard.js";
@@ -61,6 +62,7 @@ export declare function applyTaskListCap<T extends {
61
62
  } | T[];
62
63
  import { type PublicPreviewForUi } from "./web-api.js";
63
64
  import { type LogAnswer, type LogQuery } from "./log-service.js";
65
+ import { type ViewHistoryAnswer, type ViewHistoryQuery } from "./view-history.js";
64
66
  import { WebChatHistory, type WebChatPost } from "./web-chat-history.js";
65
67
  import { type WebEchoCopy } from "./web-reactions.js";
66
68
  import { SeenUsers, type MentionNames, type MentionQuery } from "./web-mentions.js";
@@ -87,6 +89,7 @@ import { WebBackendLogins, type SignInTarget } from "./web-backend-login.js";
87
89
  import { BrowserBackendSignIns } from "./browser-backend-signins.js";
88
90
  import { type RawConfigPatch } from "./settings-api.js";
89
91
  import { type AgentEndpointContext } from "./agent-endpoint.js";
92
+ import { AgentCredentials } from "./agent-credentials.js";
90
93
  import { ClassicChannelManager } from "./classic-channel-manager.js";
91
94
  import { type ExplicitInstanceRemoval } from "./instance-removal.js";
92
95
  import { type SessionOomRetry } from "./session-oom-stop.js";
@@ -115,6 +118,7 @@ import { type CarryResult } from "./backend/claude-carry.js";
115
118
  import { StormWindow } from "./storm-window.js";
116
119
  import { SpawnGate } from "./spawn-gate.js";
117
120
  import { BackendOutageTracker } from "./backend-outage.js";
121
+ import { OwnStatusMessages } from "./chat-log-ids.js";
118
122
  /** #2348: how a guest sign-in code's issuance ended (issueGuestCode), for Settings → Guests' Send sign-in code. */
119
123
  export type GuestCodeOutcome = {
120
124
  kind: "sent";
@@ -166,6 +170,11 @@ export interface RestartOpts {
166
170
  sessionOomRetry?: SessionOomRetry;
167
171
  /** Internal pre-invalidation owner fence for an unclear-OOM action. */
168
172
  recoveryCurrent?: () => boolean;
173
+ /**
174
+ * #1490 row 27: the lifecycle the caller acts for (lifecyclePin), asked before anything is invalidated. A button or
175
+ * menu offered for one instance never restarts a later one of the same name, or one restarted since.
176
+ */
177
+ ownerCurrent?: () => boolean;
169
178
  carry?: {
170
179
  backend: string;
171
180
  from: string | null;
@@ -270,6 +279,11 @@ export type GuestAuditEntry = {
270
279
  name: string;
271
280
  outcome: string;
272
281
  };
282
+ /** #1490 row 27: a restart asked for one lifecycle of an instance after it was stopped, restarted or replaced. */
283
+ export declare class RestartSupersededError extends Error {
284
+ /** `shown`: the instance as the chat list names it (shownInstanceName). */
285
+ constructor(shown: string);
286
+ }
273
287
  export declare class FleetManager implements FleetContext, LifecycleContext, ArchiverContext, StatuslineWatcherContext, OutboundContext, AgentEndpointContext {
274
288
  dataDir: string;
275
289
  private static signalTarget;
@@ -437,6 +451,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
437
451
  private startupRetryNotices;
438
452
  /** Unsupported-CLI refusals waiting to go out, grouped by reason (#1109). */
439
453
  private unsupportedCliNotices;
454
+ private kiroCompatibilityHolds;
440
455
  private kiroIncompatNotices;
441
456
  /** Backoff between automatic startup retries; the last step repeats while the backend is down. */
442
457
  static readonly STARTUP_RETRY_BACKOFF_MS: number[];
@@ -464,6 +479,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
464
479
  private kiroMigrationRuns;
465
480
  /** #1386 "Needs you": the list, its live chat messages and Acknowledge. Started with the fleet (finishStartup). */
466
481
  private needsYou;
482
+ private missedOfflineStore;
467
483
  private configHistory;
468
484
  private configHistoryTimer;
469
485
  private loadedFleetSource;
@@ -572,11 +588,15 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
572
588
  private discordPresenceEagerPending;
573
589
  private discordPresenceInFlight;
574
590
  private static readonly DISCORD_PRESENCE_REFRESH_MS;
591
+ /** #3066 §1d: how often a fleet with no Discord bot reads the quota for its history (the user's choice: 30 min). */
592
+ static readonly QUOTA_BACKGROUND_READ_MS: number;
593
+ private quotaReadTimer;
575
594
  /** Days of event/activity history to keep. */
576
595
  private static readonly EVENT_LOG_RETENTION_DAYS;
577
596
  private watchdogTimer;
578
597
  private startupMemoryDeadline;
579
598
  private eventLoopWatch;
599
+ private stallReporter;
580
600
  private startedAt;
581
601
  private stormOpenNotifyTimer;
582
602
  private memoryLogAt;
@@ -617,6 +637,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
617
637
  private readonly webChatRemovals;
618
638
  /** #1774: a removal under way — its replies' fate waits for its outcome (success: theirs no more; failure: theirs). */
619
639
  private readonly webChatRemovalsPending;
640
+ /**
641
+ * #1490 row 27: "still the same lifecycle of `name`" — its lifecycle epoch, moved on synchronously by every stop,
642
+ * restart and removal (the map is never pruned, so a same-name replacement has a later one). Taken when a button
643
+ * or menu is claimed or offered, asked after every await before acting by name.
644
+ */
645
+ /** #1490 row 27: an instance as the chat list names it — its display name where it has one, else its name. */
646
+ private shownInstanceName;
647
+ private lifecyclePin;
620
648
  private webChatGeneration;
621
649
  /** #1774: who an instance's reply is from, taken when it is sent: the name's generation and its daemon then. */
622
650
  private webChatIdentity;
@@ -863,6 +891,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
863
891
  * startup-only key at startup. See checkStartupSignatureConsistency(). */
864
892
  private fleetSignatureMismatch;
865
893
  private healthServerListening;
894
+ private agentCredentialsCache?;
895
+ get agentCredentials(): AgentCredentials;
866
896
  constructor(dataDir: string);
867
897
  /** #1266: a reply's buttons — the store (reply-buttons.db) and what a click does. Created on first use. */
868
898
  private replyButtonsCtl;
@@ -1193,6 +1223,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1193
1223
  /** Board 003648ac: a web /compact followed to its end, from the transcript the Log reads (none: nothing to follow). */
1194
1224
  private compactWatchService;
1195
1225
  private get compactWatch();
1226
+ /**
1227
+ * Claude history in the View: an instance's earlier conversation for its View, from the transcript the Log reads —
1228
+ * the View's route applied its own access rules first (view-api.ts); the Log's switch plays no part.
1229
+ */
1230
+ viewHistory(name: string, q: ViewHistoryQuery): Promise<ViewHistoryAnswer | null>;
1196
1231
  /** #1218: GET /ui/steps — an instance's steps, read on demand (null: no such instance). */
1197
1232
  logSteps(name: string, q: LogQuery): Promise<LogAnswer | null>;
1198
1233
  /**
@@ -1566,6 +1601,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
1566
1601
  * first unattended start and every scheduled retry.
1567
1602
  */
1568
1603
  private stopOnUnsupportedCli;
1604
+ /** No pane is needed for a compatibility refusal to remain in Needs you. */
1605
+ setKiroCompatibilityHold(name: string, message: string | null): void;
1569
1606
  /**
1570
1607
  * LifecycleContext: a kiro instance the installed kiro-cli cannot run as
1571
1608
  * configured (#1109) — at start, or at a respawn after kiro-cli replaced
@@ -2023,6 +2060,35 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2023
2060
  /** Start all instances from fleet config */
2024
2061
  startAll(configPath: string): Promise<void>;
2025
2062
  private startAllWithinDeadline;
2063
+ /**
2064
+ * #3066 §1d (the user: yes, every 30 min): the quota history (usage/quota-history.ts) records only the readings AgEnD
2065
+ * makes. A Discord bot's presence refresh reads every 15 min; without one, nothing reads while nobody looks. So, with no
2066
+ * Discord bot and while some account has a running agent, read every 30 min — the same cached read (its 5-minute TTL
2067
+ * still bounds the vendor calls), recorded like any other.
2068
+ */
2069
+ private startQuotaBackgroundReads;
2070
+ /** #3066 §1: the latest estimates, by `provider\0metric` (what usage-api's lookup reads, synchronously). */
2071
+ private capacityEstimates;
2072
+ private capacityTimer;
2073
+ static readonly CAPACITY_REFRESH_MS: number;
2074
+ /**
2075
+ * #3066 §1: estimate each account's weekly 100% from the quota history (§1d) and the usage ledger's hours — both read
2076
+ * asynchronously, the arithmetic small (usage/capacity.ts). An account is its usage provider id ("claude",
2077
+ * "claude:hsinlin", "codex:yanxianchen"): its hours are the ledger sources of that backend under that credential profile
2078
+ * (Codex's "unrecorded" hours are no account's). A per-model weekly ("Sonnet (weekly)") counts only that model's tokens.
2079
+ *
2080
+ * Prism #3073: no estimate rather than a wrong one —
2081
+ * - a window is measured only where the ledger has its hours: kept (31 days) and scanned (`days.coverage`) for every
2082
+ * instance of the account's backend, and every instance whose hours count for it; the quota history goes back 12 weeks;
2083
+ * - a profile literally named "default", "unknown" or "unrecorded" (configured, on disk, or in the quota history) makes
2084
+ * those hours ambiguous: neither the host
2085
+ * account nor the named one is estimated (each would be credited the other's use, or lose its own);
2086
+ * - only a metric the vendor marks per-model (`scope: "model"`) is filtered by model; another named weekly pool
2087
+ * ("Luna Reserve (weekly)", Antigravity pools) is no model name and is not estimated.
2088
+ */
2089
+ refreshCapacity(): Promise<number>;
2090
+ /** One background quota read, when nothing else reads (no Discord bot) and an account has a running agent. */
2091
+ backgroundQuotaRead(): Promise<boolean>;
2026
2092
  /** Keep Discord profile activity aligned with the same cached usage source as /usage. */
2027
2093
  private startDiscordUsagePresence;
2028
2094
  /**
@@ -2248,6 +2314,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2248
2314
  * copies retain their permissive handling when that identity is unknown.
2249
2315
  */
2250
2316
  private isOwnerCommandCopy;
2317
+ /** File a Telegram update that was too old to inject; Needs you lists it until Acknowledge. */
2318
+ private recordMissedOffline;
2251
2319
  /**
2252
2320
  * #1085: coincident topic numbers must not route across Telegram groups.
2253
2321
  */
@@ -2405,6 +2473,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2405
2473
  * of the schedule response on IPC.
2406
2474
  */
2407
2475
  private performScheduleOp;
2476
+ /**
2477
+ * `post_decision` with `supersedes` changes a decision someone else may have recorded (it stops being active): the
2478
+ * same permission as `update_decision`, asked through the same live check (tool set + dashboard switches), on both
2479
+ * create paths. An empty or absent value supersedes nothing and needs nothing; anything else must be an id.
2480
+ */
2481
+ private decisionSupersedes;
2408
2482
  handleDecisionCrudHttp(instance: string, op: string, args: Record<string, unknown>): Promise<unknown>;
2409
2483
  handleTaskCrudHttp(instance: string, args: Record<string, unknown>): Promise<unknown>;
2410
2484
  handleSetDisplayNameHttp(instance: string, name: string): Promise<unknown>;
@@ -2420,7 +2494,41 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
2420
2494
  private handleTaskCrud;
2421
2495
  /** Create a forum topic via the adapter. Returns the message_thread_id. */
2422
2496
  createForumTopic(topicName: string, adapterId?: string): Promise<number | string>;
2423
- deleteForumTopic(topicId: number | string, adapterId?: string): Promise<void>;
2497
+ /**
2498
+ * Delete an agent and, unless asked not to, its own chat topic (user decision: by default). The topic is planned
2499
+ * before the removal (its id and bot go with the fleet.yaml entry) and deleted through the agent's OWN bot after it;
2500
+ * the outcome is the platform's answer (instance-topic-delete.ts). A topic that cannot go never fails the removal.
2501
+ */
2502
+ removeInstanceAndTopic(name: string, authorization: ExplicitInstanceRemoval, opts: {
2503
+ deleteTopic: boolean;
2504
+ execution?: SettingsExecution;
2505
+ }): Promise<TopicDeleteOutcome>;
2506
+ /** #3055: destinations whose platform deletion is running now; a binding to one waits until it is over. */
2507
+ private readonly topicDeletionsInFlight;
2508
+ /** True while a topic with this id is being deleted on any connection (a new binding of it is refused meanwhile). */
2509
+ isTopicDeletionInFlight(topicId: number | string): boolean;
2510
+ /**
2511
+ * #3055 review r2 (Prism P1-3): would this instance config bind a topic whose deletion is running now? Compared by
2512
+ * physical destination, so the same thread number in another Telegram group is not held. Settings asks it at commit.
2513
+ */
2514
+ topicBindingInFlight(inst: {
2515
+ channel_id?: unknown;
2516
+ topic_id?: unknown;
2517
+ }): boolean;
2518
+ /** Any topic deletion running now (a connection's group or General may not be re-pointed meanwhile). */
2519
+ topicDeletionPending(): boolean;
2520
+ /** The physical destination of `topicId` on the bot `adapterId`. */
2521
+ private destinationFor;
2522
+ /** The adapter of the bot `adapterId` names — never a substitute for a bot that is not there. */
2523
+ private instanceTopicAdapter;
2524
+ /**
2525
+ * Topic ownership by physical destination (#3055 review, Prism P1): an instance's topic is where its bot's platform
2526
+ * puts it (a Telegram group + thread, a Discord channel), so two bots in one group, or two instances on one
2527
+ * channel, are seen to share it; and every connection's own General is protected, with or without a General agent.
2528
+ */
2529
+ private topicOwnership;
2530
+ /** What deleting `name`'s topic would act on: its own bot only — a bot that is not there is never substituted. */
2531
+ private planInstanceTopicDelete;
2424
2532
  getForumTopicDeleter(adapterId?: string): ((topicId: number | string) => Promise<void>) | null;
2425
2533
  private topicCleanupTimer;
2426
2534
  private sessionPruneTimer;
@@ -3406,9 +3514,11 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3406
3514
  * Make a tool summary safe to paste into a channel message.
3407
3515
  *
3408
3516
  * The text is agent-controlled (it is built from tool inputs — file paths,
3409
- * shell commands), so it gets flattened to one line, capped, and stripped of
3410
- * the two Discord mass-mention triggers. Neither channel renders it with a
3411
- * parse mode, so no markup escaping is needed beyond that.
3517
+ * shell commands), so it gets flattened to one line, secrets masked, capped,
3518
+ * and stripped of the two Discord mass-mention triggers. Masking comes BEFORE
3519
+ * the cap: a cap can cut a mask's context but must never be what hides (or
3520
+ * fails to hide) a secret. Neither channel renders it with a parse mode, so no
3521
+ * markup escaping is needed beyond that.
3412
3522
  */
3413
3523
  private static sanitizeActivity;
3414
3524
  /**
@@ -3448,6 +3558,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3448
3558
  */
3449
3559
  /** Configured threshold before elapsed time appears, in ms. */
3450
3560
  progressMinElapsedMs(): number;
3561
+ /** M-2391: when the instance's live (not retiring) bubble started — the current turn's start — or undefined. */
3562
+ private liveButtonStart;
3451
3563
  private startProgressTicker;
3452
3564
  /**
3453
3565
  * After a reply: give the instance REPLY_RETIRE_GRACE_MS to resume working; if
@@ -3638,6 +3750,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3638
3750
  /** "Resend token" button (web login): only the requester may press it; the token never enters the channel. */
3639
3751
  private handleLoginTokenResend;
3640
3752
  private activeInstall;
3753
+ /** M-2281: how long `/login`'s install window may run (a field so a smoke can shorten it). */
3754
+ installTimeoutMs: number;
3641
3755
  /** An install that succeeded, between its success line and the sign-in it hands over to (#1131). */
3642
3756
  private installHandoff;
3643
3757
  /** Start a CLI install session. Caller enforces admin. */
@@ -3652,6 +3766,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3652
3766
  }): Promise<string>;
3653
3767
  /** Whether this backend's CLI is on the fleet's PATH (what `/login` installs when it is not). */
3654
3768
  isCliInstalled(backend: string): boolean;
3769
+ /** M-2281: isCliInstalled without holding the fleet loop (a chat click's path: `which` on a slow PATH can take seconds). */
3770
+ isCliInstalledOffLoop(backend: string): Promise<boolean>;
3655
3771
  /** Abort the active install (`/login cancel`) and remove its window. */
3656
3772
  cancelInstallSession(): Promise<string>;
3657
3773
  /** `command -v` on a login shell, so PATH additions from rc files count. */
@@ -3663,12 +3779,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3663
3779
  */
3664
3780
  private locateBinaryOnLoginShell;
3665
3781
  /**
3666
- * #1092: the binary in one of the directories its own installer installs to,
3667
- * when no login shell can see it (the installer recorded its PATH in an
3668
- * interactive-only rc file). The same executable-file check as the login
3669
- * shell lookup; a symlink to an executable counts, as codex's launcher is one.
3782
+ * #1092: the binary in one of the directories its own installer installs to, when no login shell can see it (the
3783
+ * installer recorded its PATH in an interactive-only rc file) — only those directories (#1092). #3009: through
3784
+ * backend-availability's install-directory check (the one resolveBackendBinary uses): one killable child, never
3785
+ * accessSync/statSync on the fleet's thread. An executable file counts, a symlink to one too (codex's launcher is one).
3670
3786
  */
3671
- private locateInInstallerBinDirs;
3787
+ private locateInstalledBackend;
3672
3788
  /** Put an installed binary's directory on the fleet's PATH (#1059), once. */
3673
3789
  private adoptBinaryDirectory;
3674
3790
  /** Discord native `/login` slash — shared by every adapter dispatch block. */
@@ -3783,6 +3899,22 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3783
3899
  * text is its command path — and other sources pass through untouched.
3784
3900
  */
3785
3901
  private replyDiscordNotACommand;
3902
+ /** #2940: this fleet's own status bubbles and the messages the platform said were deleted (ids, never text). */
3903
+ readonly ownStatusMessages: OwnStatusMessages;
3904
+ /**
3905
+ * #2940: a status bubble of ours was posted: never logged, and a line already logged for it (by a sibling bot) goes.
3906
+ * Discord only (#2943 review: the only platform where our bots see each other's posts), keyed by channel and id.
3907
+ */
3908
+ private noteOwnStatusMessage;
3909
+ /** #2940: Discord says a message was deleted — its chat-log line goes, and it is never logged after this. */
3910
+ onPlatformMessageDeleted(e: {
3911
+ messageId?: string;
3912
+ channelId?: string;
3913
+ } | undefined): void;
3914
+ /** #2940: the key a Discord message's chat-log line is kept under (none for another platform: nothing is tracked). */
3915
+ private chatLogKey;
3916
+ /** #2940: whether `msg` must not enter the chat log (only its key is looked at; the debug trail names keys, not text). */
3917
+ private chatLogExcludes;
3786
3918
  /** Handle a message in a classic channel: log it, forward only /chat messages */
3787
3919
  private handleClassicChannelMessage;
3788
3920
  /** Download photo or document attachment to classic instance workspace inbox. Returns { path, kind } or undefined. */
@@ -3985,8 +4117,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
3985
4117
  * restart backends only read it at launch, so it is persisted and the
3986
4118
  * instance respawns.
3987
4119
  */
3988
- applyEffort(instanceName: string, requested: string): Promise<string>;
3989
- applyModel(instanceName: string, model: string): Promise<string>;
4120
+ applyEffort(instanceName: string, requested: string, opts?: {
4121
+ current?: () => boolean;
4122
+ }): Promise<string>;
4123
+ applyModel(instanceName: string, model: string, opts?: {
4124
+ current?: () => boolean;
4125
+ }): Promise<string>;
3990
4126
  /** Save an instance's model (fleet.yaml, or its ClassicBot channel). False when neither holds it. */
3991
4127
  private persistInstanceModel;
3992
4128
  /**