@songsid/agend 2.1.4-beta.2 → 2.1.4-beta.21

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 (128) hide show
  1. package/dist/agent-endpoint.js +1 -1
  2. package/dist/agent-endpoint.js.map +1 -1
  3. package/dist/backend/antigravity.d.ts +1 -0
  4. package/dist/backend/antigravity.js +4 -0
  5. package/dist/backend/antigravity.js.map +1 -1
  6. package/dist/backend/claude-code.js +23 -2
  7. package/dist/backend/claude-code.js.map +1 -1
  8. package/dist/backend/codex.d.ts +17 -0
  9. package/dist/backend/codex.js +122 -7
  10. package/dist/backend/codex.js.map +1 -1
  11. package/dist/backend/kiro.d.ts +1 -0
  12. package/dist/backend/kiro.js +14 -0
  13. package/dist/backend/kiro.js.map +1 -1
  14. package/dist/backend/opencode.d.ts +27 -11
  15. package/dist/backend/opencode.js +48 -37
  16. package/dist/backend/opencode.js.map +1 -1
  17. package/dist/backend/types.d.ts +14 -0
  18. package/dist/backend/types.js +7 -0
  19. package/dist/backend/types.js.map +1 -1
  20. package/dist/channel/adapters/discord.js +76 -25
  21. package/dist/channel/adapters/discord.js.map +1 -1
  22. package/dist/channel/adapters/telegram.js +5 -3
  23. package/dist/channel/adapters/telegram.js.map +1 -1
  24. package/dist/channel/mcp-server.js +6 -20
  25. package/dist/channel/mcp-server.js.map +1 -1
  26. package/dist/channel/mcp-tools.js +4 -2
  27. package/dist/channel/mcp-tools.js.map +1 -1
  28. package/dist/channel/types.d.ts +1 -1
  29. package/dist/classic-channel-manager.d.ts +40 -3
  30. package/dist/classic-channel-manager.js +218 -31
  31. package/dist/classic-channel-manager.js.map +1 -1
  32. package/dist/cli.js +159 -36
  33. package/dist/cli.js.map +1 -1
  34. package/dist/completion-install.d.ts +70 -0
  35. package/dist/completion-install.js +152 -0
  36. package/dist/completion-install.js.map +1 -0
  37. package/dist/completion.d.ts +7 -1
  38. package/dist/completion.js +14 -4
  39. package/dist/completion.js.map +1 -1
  40. package/dist/config-validator.js +38 -7
  41. package/dist/config-validator.js.map +1 -1
  42. package/dist/config.d.ts +2 -0
  43. package/dist/config.js +10 -1
  44. package/dist/config.js.map +1 -1
  45. package/dist/daemon.d.ts +171 -5
  46. package/dist/daemon.js +696 -82
  47. package/dist/daemon.js.map +1 -1
  48. package/dist/doctor.d.ts +26 -0
  49. package/dist/doctor.js +216 -0
  50. package/dist/doctor.js.map +1 -0
  51. package/dist/fleet-context.d.ts +16 -0
  52. package/dist/fleet-manager.d.ts +233 -10
  53. package/dist/fleet-manager.js +1828 -493
  54. package/dist/fleet-manager.js.map +1 -1
  55. package/dist/fleet-yaml-slim.d.ts +10 -0
  56. package/dist/fleet-yaml-slim.js +59 -0
  57. package/dist/fleet-yaml-slim.js.map +1 -0
  58. package/dist/general-knowledge/skills/backend-providers/SKILL.md +114 -0
  59. package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +3 -1
  60. package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +52 -0
  61. package/dist/general-knowledge/skills/development-workflow/SKILL.md +28 -0
  62. package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -0
  63. package/dist/general-knowledge/skills/fleet-health/SKILL.md +1 -0
  64. package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -0
  65. package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -0
  66. package/dist/general-knowledge/skills/model-discovery/SKILL.md +64 -16
  67. package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -0
  68. package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -0
  69. package/dist/general-knowledge/skills/session-management/SKILL.md +1 -0
  70. package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -0
  71. package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +30 -0
  72. package/dist/instance-lifecycle.d.ts +8 -0
  73. package/dist/instance-lifecycle.js +46 -25
  74. package/dist/instance-lifecycle.js.map +1 -1
  75. package/dist/instructions.d.ts +12 -0
  76. package/dist/instructions.js +33 -0
  77. package/dist/instructions.js.map +1 -1
  78. package/dist/locale.js +656 -220
  79. package/dist/locale.js.map +1 -1
  80. package/dist/outbound-handlers.d.ts +8 -0
  81. package/dist/outbound-handlers.js +44 -5
  82. package/dist/outbound-handlers.js.map +1 -1
  83. package/dist/outbound-schemas.d.ts +5 -0
  84. package/dist/outbound-schemas.js +7 -0
  85. package/dist/outbound-schemas.js.map +1 -1
  86. package/dist/quickstart.js +25 -0
  87. package/dist/quickstart.js.map +1 -1
  88. package/dist/restart-progress.d.ts +9 -1
  89. package/dist/restart-progress.js +30 -6
  90. package/dist/restart-progress.js.map +1 -1
  91. package/dist/scheduler/db.d.ts +5 -0
  92. package/dist/scheduler/db.js +35 -0
  93. package/dist/scheduler/db.js.map +1 -1
  94. package/dist/service-installer.d.ts +11 -0
  95. package/dist/service-installer.js +84 -18
  96. package/dist/service-installer.js.map +1 -1
  97. package/dist/settings-api.js +1 -1
  98. package/dist/settings-api.js.map +1 -1
  99. package/dist/tips.d.ts +39 -0
  100. package/dist/tips.js +351 -0
  101. package/dist/tips.js.map +1 -0
  102. package/dist/tool-progress.d.ts +40 -0
  103. package/dist/tool-progress.js +289 -0
  104. package/dist/tool-progress.js.map +1 -0
  105. package/dist/topic-commands.d.ts +28 -4
  106. package/dist/topic-commands.js +227 -65
  107. package/dist/topic-commands.js.map +1 -1
  108. package/dist/transcript-monitor.d.ts +15 -2
  109. package/dist/transcript-monitor.js +63 -17
  110. package/dist/transcript-monitor.js.map +1 -1
  111. package/dist/transcript-sources.d.ts +106 -0
  112. package/dist/transcript-sources.js +428 -0
  113. package/dist/transcript-sources.js.map +1 -0
  114. package/dist/types.d.ts +11 -0
  115. package/dist/ui/dashboard.html +55 -32
  116. package/dist/ui/settings.html +120 -51
  117. package/dist/ui/view.html +23 -15
  118. package/dist/update-marker.d.ts +30 -0
  119. package/dist/update-marker.js +71 -20
  120. package/dist/update-marker.js.map +1 -1
  121. package/dist/update-progress.d.ts +6 -0
  122. package/dist/update-progress.js +29 -0
  123. package/dist/update-progress.js.map +1 -0
  124. package/dist/usage/usage-api.d.ts +8 -2
  125. package/dist/usage/usage-api.js +24 -3
  126. package/dist/usage/usage-api.js.map +1 -1
  127. package/dist/workflow-templates/default.md +2 -1
  128. package/package.json +1 -1
@@ -36,6 +36,25 @@ export declare function selectLruEvictions(warm: string[], cap: number, opts: {
36
36
  isIdle: (name: string) => boolean;
37
37
  lastInboundAt: (name: string) => number;
38
38
  }): string[];
39
+ /**
40
+ * Answer shape for `list_models`. `scope` reports where the LIST came from —
41
+ * "instance" only when it was read through that instance's own backend config,
42
+ * "global" for the account/CLI catalog — so a caller can tell an authoritative
43
+ * per-instance list from a best-effort account-wide one.
44
+ */
45
+ export interface ModelCatalog {
46
+ backend: string;
47
+ scope: "instance" | "global";
48
+ /** Set whenever an instance was asked about, even if the list is global. */
49
+ instance?: string;
50
+ current_model: string | null;
51
+ models: import("./backend/types.js").ModelOption[];
52
+ /** "cache" = startup probe cache, "live" = probed now, "fallback" = none available. */
53
+ source: "cache" | "live" | "fallback";
54
+ probed_at?: string;
55
+ /** Caveat the caller should read before trusting the list. */
56
+ note?: string;
57
+ }
39
58
  export interface DeliveryOptions {
40
59
  /** Explicitly identify agent-to-agent delivery when metadata is unavailable. */
41
60
  isCrossInstance?: boolean;
@@ -83,6 +102,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
83
102
  costGuard: CostGuard | null;
84
103
  private statuslineWatcher;
85
104
  private dailySummary;
105
+ private dailyTipScheduler;
86
106
  private webhookEmitter;
87
107
  private topicIcons;
88
108
  private lastActivity;
@@ -94,6 +114,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
94
114
  private warmCapEvicting;
95
115
  /** Per-instance tail keeps cross-instance and scheduled deliveries FIFO. */
96
116
  private idleGatedDeliveryTails;
117
+ /**
118
+ * Per-instance cancellation epoch for deliveries which have not reached the
119
+ * daemon yet. A cancel advances the epoch; queued work captures the old value
120
+ * and becomes a no-op, while messages arriving after the click capture the new
121
+ * value and remain deliverable.
122
+ */
123
+ private deliveryEpochs;
97
124
  /** Non-user work must observe a fresh idle snapshot after the latest delivery. */
98
125
  private lastDeliveryAt;
99
126
  /** State-cache updates wake event-driven idle waiters without busy polling. */
@@ -106,6 +133,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
106
133
  readonly replyDeduper: ReplyDeduper;
107
134
  /** instanceName → what it is doing right now, when the backend can tell us. */
108
135
  private instanceActivity;
136
+ /** instanceName → this turn's tool list (multi-line), for the bubble. */
137
+ private instanceProgress;
109
138
  /** instanceName → tail of deliveries waiting for its IPC to come back. */
110
139
  private ipcWaitTails;
111
140
  /** instanceName → restart currently executing; concurrent callers join it. */
@@ -119,8 +148,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
119
148
  /** In-flight /effort selections, same coordinator shape as pendingModelSelects. */
120
149
  private pendingEffortSelects;
121
150
  private pendingModelSelects;
122
- /** One-shot General assistance buttons for stable interactive terminal prompts. */
123
- private pendingInteractivePromptAssists;
151
+ /** nonce → pending button prompt (hang restart, interactive assist, clean-exit restart). */
152
+ private pendingNonceButtons;
124
153
  private failoverActive;
125
154
  /** instance → when a click with no live button entry last fired a cancel. */
126
155
  private staleCancelClickAt;
@@ -137,6 +166,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
137
166
  private healthServer;
138
167
  private healthPortRetried;
139
168
  private updateCheckTimer;
169
+ private updateProgressTimer;
170
+ private updateProgressEditRunning;
171
+ private lastUpdateProgressText;
172
+ private updateCompletionTipText;
140
173
  private eventLogPruneTimer;
141
174
  private logRotateTimer;
142
175
  /** Days of event/activity history to keep. */
@@ -218,6 +251,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
218
251
  */
219
252
  private isModelAdmin;
220
253
  private handlePauseWakeSlash;
254
+ private handleUpdateSlash;
255
+ private handleTipsSlash;
221
256
  /** Admin-only full conversation reset for fleet-topic and Classic instances. */
222
257
  private handleClearSlash;
223
258
  /** Get the adapter bound to an instance, falling back to primary adapter */
@@ -248,6 +283,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
248
283
  bindInstanceAdapter(name: string, adapterId: string, fromInbound?: boolean): void;
249
284
  getInstanceStatus(name: string): "running" | "paused" | "stopped" | "crashed";
250
285
  getInstanceExecutionState(name: string): InstanceState | null;
286
+ /**
287
+ * Subscription providers currently relevant to this fleet. Stopped/crashed
288
+ * rows do not keep a usage card alive, while persisted paused instances do.
289
+ * Classic channels use their effective backend merge chain, not the raw row.
290
+ */
291
+ getActiveUsageProviderIds(): ReadonlySet<string>;
251
292
  isClassicInstance(name: string): boolean;
252
293
  private cacheInstanceExecutionState;
253
294
  private cancelIdleButtonRetirement;
@@ -264,6 +305,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
264
305
  */
265
306
  private enforceWarmCap;
266
307
  private waitForInstanceIdle;
308
+ /**
309
+ * Ask the daemon to capture the pane before answering, then wait for any state
310
+ * report produced after this request. The ordinary query is intentionally
311
+ * cache-only (idle gates call it frequently); this opt-in refresh is reserved
312
+ * for lifecycle decisions where a stale state would strand UI.
313
+ */
314
+ private refreshInstanceExecutionState;
267
315
  private deliverWithIdleGate;
268
316
  /**
269
317
  * Hand a payload to an instance's IPC, waiting out a *transient* disconnect.
@@ -331,6 +379,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
331
379
  ready: boolean;
332
380
  token: string | null;
333
381
  };
382
+ beginUpdateProgress(adapter: ChannelAdapter, chatId: string, threadId: string | undefined, messageId: string): void;
383
+ failUpdateProgress(message: string): void;
384
+ /** The old fleet edits CLI install stages; the new fleet adopts the same message below. */
385
+ private startUpdateProgressMonitor;
334
386
  /** Start all instances from fleet config */
335
387
  startAll(configPath: string): Promise<void>;
336
388
  /**
@@ -437,6 +489,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
437
489
  private handleDecisionCrud;
438
490
  /** Resolve display name for an instance, fallback to instance name. */
439
491
  resolveDisplayName(instanceName: string): string;
492
+ /** Persist identity to the instance's actual config store. Classic instances
493
+ * are registry rows in classicBot.yaml, not fleet.yaml instance entries. */
494
+ private setInstanceDisplayName;
495
+ private setInstanceDescription;
440
496
  private handleSetDisplayName;
441
497
  private handleSetDescription;
442
498
  handleScheduleCrudHttp(instance: string, op: string, args: Record<string, unknown>): Promise<unknown>;
@@ -457,9 +513,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
457
513
  private startTopicCleanupPoller;
458
514
  /**
459
515
  * Patch only values changed in the effective config into the original YAML
460
- * document. Unknown keys, explicit overrides and comments remain untouched.
516
+ * document. Unknown keys and comments remain untouched; redundant
517
+ * non-identity instance leaves are canonicalized to inheritance afterward.
461
518
  */
462
519
  saveFleetConfig(explicitPatches?: RawConfigPatch[]): void;
520
+ /** One-time upgrade migration; invalid YAML is never rewritten. */
521
+ private slimFleetConfigAtStartup;
522
+ private writeFleetConfigBackup;
463
523
  private patchFleetDocument;
464
524
  removeInstance(name: string): Promise<void>;
465
525
  startStatuslineWatcher(name: string): void;
@@ -532,6 +592,59 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
532
592
  private static readonly FLEET_ERROR_THROTTLE_MS;
533
593
  private fleetErrorNotices;
534
594
  notifyInstanceTopic(instanceName: string, text: string, extraOpts?: import("./channel/types.js").SendOpts): void;
595
+ /**
596
+ * Post decision buttons whose callback ids are `<prefix><nonce>:<action>`.
597
+ * The entry is registered before the send and rolled back if the send
598
+ * fails, so a nonce in the map always refers to a message that exists (or
599
+ * is about to). Returns the nonce, or null when the alert could not be sent.
600
+ */
601
+ private postNonceButtonPrompt;
602
+ /**
603
+ * Claim a nonce-armed callback exactly once.
604
+ *
605
+ * Returns:
606
+ * - null — the callback is not for this prefix; try the next handler
607
+ * - "consumed" — for this prefix but stale/denied/malformed; stop dispatch
608
+ * - the entry+action — the click is authorized and now claimed (removed
609
+ * from the map before any await, so double clicks cannot act twice)
610
+ *
611
+ * A stale click (expired nonce, or a pre-upgrade button whose payload no
612
+ * longer parses) collapses the clicked message so the dead button stops
613
+ * inviting clicks — the same courtesy the cancel button extends.
614
+ */
615
+ private consumeNonceCallback;
616
+ /** Collapse a consumed prompt's buttons into a final status line. */
617
+ private retireNonceButtons;
618
+ private tipsEnabled;
619
+ private readTipState;
620
+ private pickAvailableTip;
621
+ private tipText;
622
+ private formatTip;
623
+ /** Persistently enable advanced tips through the admin-only slash command. */
624
+ unlockAdvancedTips(userId: string): boolean;
625
+ /** Post one fresh nonce-armed tip in a known General channel. */
626
+ promptTip(generalName: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<"posted" | "empty" | "unavailable">;
627
+ private promptAdvancedTipUnlock;
628
+ private sendTipToGeneral;
629
+ private handleTipDismiss;
630
+ private handleTipUnlock;
631
+ /** Post the destructive `/clear` confirmation in the invoking channel. */
632
+ promptClearConfirmation(instanceName: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
633
+ /** Consume `/clear` Confirm/Cancel exactly once; only Confirm reaches IPC. */
634
+ private handleClearConfirmation;
635
+ /**
636
+ * Drop every pending prompt that refers to an instance being stopped or
637
+ * restarted — a restart offer for an instance the operator just restarted
638
+ * (or an assist for one they stopped) must not stay clickable for the rest
639
+ * of its 15 minutes.
640
+ */
641
+ clearNoncePromptsForInstance(instanceName: string): void;
642
+ /** A clean exit is intentional from the CLI's perspective, but often not from
643
+ * the operator's. Keep the instance notice passive and put the action in the
644
+ * same-world General topic where an administrator can make the choice. */
645
+ notifyNormalExit(instanceName: string): Promise<void>;
646
+ /** Consume a clean-exit Restart/Ignore button exactly once. */
647
+ private handleExitRestartPrompt;
535
648
  private interactivePromptLabel;
536
649
  /**
537
650
  * Surface a stable terminal prompt in both places that matter:
@@ -542,7 +655,6 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
542
655
  * contain usernames or secret-adjacent text and stays in daemon.log.
543
656
  */
544
657
  notifyInteractivePrompt(instanceName: string, kind: string): Promise<void>;
545
- private retireInteractivePromptButtons;
546
658
  /** Consume a General assist button exactly once. */
547
659
  private handleInteractivePromptAssist;
548
660
  /** Send a "🛑 Cancel" button to the instance's topic/channel after delivery. */
@@ -570,7 +682,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
570
682
  */
571
683
  private handleCancelClick;
572
684
  private hasCancelButton;
573
- sendCancelButton(instanceName: string, correlationId?: string): Promise<void>;
685
+ sendCancelButton(instanceName: string, correlationId?: string, preserveProgress?: boolean): Promise<void>;
574
686
  /**
575
687
  * The cancel button's text for a given elapsed time.
576
688
  *
@@ -580,6 +692,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
580
692
  * and once the agent had replied once there was no sign it was still going.
581
693
  */
582
694
  static progressText(elapsedMs: number, activity?: string | null, minElapsedMs?: number): string;
695
+ /** Render elapsed time consistently in live and retained progress bubbles. */
696
+ private static formatProgressElapsed;
697
+ /** Final read-only form of a bubble that contains semantic tool history.
698
+ * Neutral wording is intentional: the same retirement primitive is used for
699
+ * normal completion, a mid-turn bubble replacement, and user cancellation,
700
+ * so claiming every retained checkpoint is "completed" would be false. */
701
+ private composeRetiredBubbleText;
583
702
  /**
584
703
  * Make a tool summary safe to paste into a channel message.
585
704
  *
@@ -597,6 +716,26 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
597
716
  * never used to decide anything — purely what the user is shown.
598
717
  */
599
718
  private cacheInstanceActivity;
719
+ /**
720
+ * Cache the turn's tool-progress list and push it into the instance's live
721
+ * bubble, coalesced so a burst of tool events cannot flood the Bot API
722
+ * (Telegram's flood limit is per-chat across ALL forum topics, so edits are
723
+ * rate-limited per bubble AND ride behind the daemon-side 3s coalescer).
724
+ */
725
+ private cacheInstanceProgress;
726
+ /** At most one progress-driven edit per bubble per TOOL_PROGRESS_EDIT_MIN_MS. */
727
+ private scheduleProgressEdit;
728
+ /**
729
+ * The ONE composer for the bubble text. Both writers — the elapsed-time
730
+ * ticker and the tool-progress push — go through here; two independent
731
+ * renderers editing the same message is how the progress list used to get
732
+ * wiped by the next elapsed tick (#528 trap 2).
733
+ */
734
+ private composeBubbleText;
735
+ /** Pure composition of header + tool list, exposed for tests. */
736
+ static bubbleText(elapsedMs: number, activity: string | undefined, minElapsedMs: number, progress: string | undefined): string;
737
+ /** Recompose and edit the bubble in place; skips when nothing changed. */
738
+ private refreshBubble;
600
739
  /**
601
740
  * Refresh the button's text in place while the instance keeps working.
602
741
  *
@@ -609,10 +748,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
609
748
  private startProgressTicker;
610
749
  /**
611
750
  * After a reply: give the instance REPLY_RETIRE_GRACE_MS to resume working; if
612
- * it has not, retire its button. Re-arming replaces the previous timer, so a
613
- * burst of replies ends with exactly one pending check.
751
+ * it has not, retire its button. The daemon is asked for a fresh pane capture
752
+ * before deciding. Reading only the transition cache stranded the first
753
+ * post-restart bubble when its startup "working" report never got a matching
754
+ * idle edge. Re-arming replaces the previous timer, so a burst of replies ends
755
+ * with exactly one pending check.
614
756
  */
615
757
  private armReplyGrace;
758
+ private finishReplyGrace;
616
759
  /** Retire (delete) every cancel button belonging to an instance. */
617
760
  private retireInstanceButtons;
618
761
  /** Begin retiring one button (delete + bounded retry on failure). Idempotent:
@@ -637,7 +780,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
637
780
  private sweepOrphanedCancelButtons;
638
781
  /** Re-attempt a failed button delete up to CANCEL_BTN_MAX_RETRIES times. */
639
782
  private scheduleButtonRetry;
640
- /** Delete one button's message via its own adapter. Resolves on success,
783
+ /** Retire one cancel bubble via its own adapter. A bubble that accumulated
784
+ * tool progress is kept as a read-only history message; a plain bubble keeps
785
+ * the legacy delete/edit-to-checkmark behavior. Resolves on success and
641
786
  * rejects on failure so the caller can retry. */
642
787
  private deleteButtonMessage;
643
788
  /** Retire all cancel buttons for an instance — on reply or cancel. */
@@ -661,6 +806,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
661
806
  private reactDone;
662
807
  /** Interrupt an instance's current generation (cancel button / /cancel). */
663
808
  cancelInstance(instanceName: string): boolean;
809
+ getDeliveryEpoch(instanceName: string): number;
810
+ private isDeliveryEpochCurrent;
811
+ /** Invalidate work queued before a user cancel and wake idle-gate waiters. */
812
+ private cancelPendingDeliveries;
664
813
  queueMirrorMessage(text: string): void;
665
814
  /** Push an SSE event to all connected Web UI clients. */
666
815
  emitSseEvent(event: string, data: unknown): void;
@@ -669,12 +818,57 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
669
818
  title: string;
670
819
  }>;
671
820
  sendHangNotification(instanceName: string, unchangedForMs?: number): Promise<void>;
821
+ /**
822
+ * Consume a hang Force-restart / Keep-waiting button exactly once. Restart
823
+ * goes through restartSingleInstance — serialized against concurrent restart
824
+ * sources, and with a Classic-instance fallback (the previous hand-rolled
825
+ * stop+start silently left Classic instances stopped while reporting
826
+ * "restarted").
827
+ */
828
+ private handleHangPrompt;
672
829
  private static INSTRUCTIONS_FILENAME;
673
830
  private static GENERAL_INSTRUCTIONS;
674
831
  /** Ensure the general instance has its project instructions file + knowledge */
675
832
  private ensureGeneralInstructions;
676
- /** Copy general-knowledge steering + skills to the general instance's workspace */
833
+ /** Resolve the workspace path a backend actually uses before publishing knowledge. */
834
+ private resolveKnowledgeWorkDir;
835
+ /**
836
+ * Where each backend natively loads on-demand skills from, relative to the
837
+ * workspace. Backends without a native skill mechanism (opencode, grok,
838
+ * antigravity, gemini-cli) are deliberately absent: dropping files a CLI
839
+ * never reads is clutter, not capability. Unknown directories are ignored
840
+ * by older CLI versions, so publishing is fail-open across upgrades.
841
+ */
842
+ private static SKILLS_DIR_SEGMENTS;
843
+ /** Copy general-knowledge steering + all role-eligible skills to General. */
677
844
  private syncGeneralKnowledge;
845
+ /** Publish only the bundled skills eligible for an instance role. */
846
+ private syncRoleSkills;
847
+ /**
848
+ * Steering (always-on rules like core-rules.md). Kiro loads a native
849
+ * steering directory; every other backend gets the content embedded into
850
+ * its instructions file (CLAUDE.md / AGENTS.md / …) inside a managed marker
851
+ * block — the previous behavior dropped bare .md files in the workspace
852
+ * root, which no CLI ever read. The block is replaced in place on every
853
+ * sync, so rule updates reach EXISTING workspaces; everything the user
854
+ * wrote outside the markers is preserved byte-for-byte.
855
+ */
856
+ private syncGeneralSteering;
857
+ private static STEERING_BLOCK_BEGIN;
858
+ private static STEERING_BLOCK_END;
859
+ /**
860
+ * Publish AgEnD's bundled skills into a CLI's native skills directory,
861
+ * owning ONLY what we published. A manifest records which skill names AgEnD
862
+ * wrote; a bundled rename/removal deletes the stale managed copy, while a
863
+ * skill the user created by hand is never listed and therefore never
864
+ * touched — even if a future bundle happens to reuse its name (the sync
865
+ * then skips it and logs, rather than overwrite the user's work). The sole
866
+ * migration exception is the pre-manifest Kiro General layout explicitly
867
+ * selected by adoptLegacyUnmanaged.
868
+ */
869
+ private syncManagedSkills;
870
+ /** Read AgEnD's roles extension from SKILL.md YAML frontmatter. */
871
+ private readManagedSkillRoles;
678
872
  /** Fetch forum topic icon stickers and pick emoji IDs for each state */
679
873
  private resolveTopicIcons;
680
874
  /** Set topic icon based on instance state */
@@ -717,6 +911,34 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
717
911
  private probeCliEnvs;
718
912
  /** Best-effort model list for `/model`: cached CLI env first, else live probe. Never throws. */
719
913
  private getModelOptions;
914
+ /**
915
+ * Model catalog behind the `list_models` tool.
916
+ *
917
+ * The two scopes are not cosmetic. "global" is the account/CLI catalog served
918
+ * from the startup probe cache; "instance" is resolved through that instance's
919
+ * OWN backend config, and for a Codex instance on a custom provider that is a
920
+ * different catalog entirely — `listModels()` reads models_cache.json out of
921
+ * the instance's private CODEX_HOME. Answering such an instance with the
922
+ * account list would name models its CLI rejects, which is exactly the
923
+ * mistake this tool exists to prevent.
924
+ *
925
+ * `scope` always describes where the returned LIST came from, not what was
926
+ * asked for: an instance query that falls back to the account catalog reports
927
+ * scope "global" and says so in `note`, rather than implying instance-level
928
+ * accuracy it does not have.
929
+ *
930
+ * Never throws — a model listing is an aid, and failing it must not fail a turn.
931
+ */
932
+ listModelCatalog(opts?: {
933
+ backend?: string;
934
+ instanceName?: string;
935
+ }): Promise<ModelCatalog>;
936
+ /** The custom provider an instance overrides its backend with, if any. */
937
+ private customProviderFor;
938
+ /** Ask a backend for its catalog using ONE instance's real config. Never throws. */
939
+ private instanceScopedModels;
940
+ /** Account-wide catalog: probe cache first, live probe on miss. */
941
+ private globalModelCatalog;
720
942
  /** `/model` slash handler (admin only). No arg → DC menu; `/model <name>` → apply directly. */
721
943
  /** Label an effort choice, marking the one currently configured. */
722
944
  private effortChoiceLabel;
@@ -821,7 +1043,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
821
1043
  /**
822
1044
  * Hot-reload: re-read fleet.yaml and reconcile running instances.
823
1045
  * Starts new, stops removed, restarts modified instances.
824
- * Fleet-level config (access, cost_guard, etc.) requires /restart to take effect.
1046
+ * Whitelisted runtime fields are pushed into live daemons; all other instance
1047
+ * fields, plus cold fleet-level settings, retain restart semantics.
825
1048
  */
826
1049
  private reconcileInstances;
827
1050
  restartInstances(): Promise<void>;