@songsid/agend 2.1.4-beta.3 → 2.1.4-beta.31
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.
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/dist/agent-endpoint.js +1 -1
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/backend/antigravity.d.ts +9 -5
- package/dist/backend/antigravity.js +155 -30
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-code.d.ts +33 -21
- package/dist/backend/claude-code.js +103 -27
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/codex.d.ts +17 -0
- package/dist/backend/codex.js +123 -8
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/gemini-cli.js +2 -2
- package/dist/backend/gemini-cli.js.map +1 -1
- package/dist/backend/grok.js +2 -2
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro.d.ts +1 -0
- package/dist/backend/kiro.js +17 -3
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/opencode.d.ts +27 -11
- package/dist/backend/opencode.js +50 -39
- package/dist/backend/opencode.js.map +1 -1
- package/dist/backend/types.d.ts +20 -0
- package/dist/backend/types.js +12 -1
- package/dist/backend/types.js.map +1 -1
- package/dist/channel/adapters/discord.js +106 -19
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.js +5 -3
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/agy-mcp-launcher.d.ts +2 -0
- package/dist/channel/agy-mcp-launcher.js +28 -0
- package/dist/channel/agy-mcp-launcher.js.map +1 -0
- package/dist/channel/mcp-server.js +6 -20
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.js +4 -2
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/types.d.ts +1 -1
- package/dist/classic-channel-manager.d.ts +40 -3
- package/dist/classic-channel-manager.js +218 -31
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/cli.js +148 -33
- package/dist/cli.js.map +1 -1
- package/dist/completion-install.d.ts +70 -0
- package/dist/completion-install.js +152 -0
- package/dist/completion-install.js.map +1 -0
- package/dist/completion.d.ts +7 -1
- package/dist/completion.js +14 -4
- package/dist/completion.js.map +1 -1
- package/dist/config-validator.js +38 -7
- package/dist/config-validator.js.map +1 -1
- package/dist/config.d.ts +2 -0
- package/dist/config.js +10 -1
- package/dist/config.js.map +1 -1
- package/dist/daemon.d.ts +177 -5
- package/dist/daemon.js +771 -99
- package/dist/daemon.js.map +1 -1
- package/dist/doctor.d.ts +26 -0
- package/dist/doctor.js +216 -0
- package/dist/doctor.js.map +1 -0
- package/dist/fleet-context.d.ts +47 -0
- package/dist/fleet-manager.d.ts +251 -10
- package/dist/fleet-manager.js +2059 -387
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-yaml-slim.d.ts +10 -0
- package/dist/fleet-yaml-slim.js +59 -0
- package/dist/fleet-yaml-slim.js.map +1 -0
- package/dist/general-knowledge/skills/backend-providers/SKILL.md +114 -0
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +3 -1
- package/dist/general-knowledge/skills/delegation-playbook/SKILL.md +52 -0
- package/dist/general-knowledge/skills/development-workflow/SKILL.md +28 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +1 -0
- package/dist/general-knowledge/skills/fleet-restart/SKILL.md +1 -0
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +1 -0
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +64 -16
- package/dist/general-knowledge/skills/multi-channel/SKILL.md +1 -0
- package/dist/general-knowledge/skills/scheduling/SKILL.md +1 -0
- package/dist/general-knowledge/skills/session-management/SKILL.md +1 -0
- package/dist/general-knowledge/skills/tui-effort/SKILL.md +1 -0
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +30 -0
- package/dist/instance-lifecycle.d.ts +45 -0
- package/dist/instance-lifecycle.js +150 -5
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instructions.d.ts +12 -0
- package/dist/instructions.js +35 -1
- package/dist/instructions.js.map +1 -1
- package/dist/locale.js +750 -288
- package/dist/locale.js.map +1 -1
- package/dist/login-flows.d.ts +85 -0
- package/dist/login-flows.js +159 -0
- package/dist/login-flows.js.map +1 -0
- package/dist/login-manager.d.ts +63 -0
- package/dist/login-manager.js +134 -0
- package/dist/login-manager.js.map +1 -0
- package/dist/outbound-handlers.d.ts +8 -0
- package/dist/outbound-handlers.js +44 -5
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +5 -0
- package/dist/outbound-schemas.js +7 -0
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/quickstart.js +25 -0
- package/dist/quickstart.js.map +1 -1
- package/dist/restart-progress.d.ts +2 -0
- package/dist/restart-progress.js +3 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/scheduler/db.d.ts +12 -0
- package/dist/scheduler/db.js +59 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/service-installer.d.ts +11 -0
- package/dist/service-installer.js +84 -18
- package/dist/service-installer.js.map +1 -1
- package/dist/settings-api.js +1 -1
- package/dist/settings-api.js.map +1 -1
- package/dist/setup-wizard.js +2 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/tips.d.ts +44 -0
- package/dist/tips.js +355 -0
- package/dist/tips.js.map +1 -0
- package/dist/tmux-manager.d.ts +6 -0
- package/dist/tmux-manager.js +12 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-progress.d.ts +40 -0
- package/dist/tool-progress.js +289 -0
- package/dist/tool-progress.js.map +1 -0
- package/dist/topic-commands.d.ts +36 -4
- package/dist/topic-commands.js +322 -64
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +15 -2
- package/dist/transcript-monitor.js +63 -17
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-sources.d.ts +131 -0
- package/dist/transcript-sources.js +580 -0
- package/dist/transcript-sources.js.map +1 -0
- package/dist/types.d.ts +11 -0
- package/dist/ui/dashboard.html +55 -32
- package/dist/ui/settings.html +120 -51
- package/dist/ui/view.html +23 -15
- package/dist/usage/providers.d.ts +7 -0
- package/dist/usage/providers.js +18 -1
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.d.ts +8 -2
- package/dist/usage/usage-api.js +24 -3
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/workflow-templates/default.md +2 -1
- package/package.json +1 -1
package/dist/fleet-manager.d.ts
CHANGED
|
@@ -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. */
|
|
@@ -140,6 +169,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
140
169
|
private updateProgressTimer;
|
|
141
170
|
private updateProgressEditRunning;
|
|
142
171
|
private lastUpdateProgressText;
|
|
172
|
+
private updateCompletionTipText;
|
|
143
173
|
private eventLogPruneTimer;
|
|
144
174
|
private logRotateTimer;
|
|
145
175
|
/** Days of event/activity history to keep. */
|
|
@@ -222,6 +252,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
222
252
|
private isModelAdmin;
|
|
223
253
|
private handlePauseWakeSlash;
|
|
224
254
|
private handleUpdateSlash;
|
|
255
|
+
private handleTipsSlash;
|
|
225
256
|
/** Admin-only full conversation reset for fleet-topic and Classic instances. */
|
|
226
257
|
private handleClearSlash;
|
|
227
258
|
/** Get the adapter bound to an instance, falling back to primary adapter */
|
|
@@ -252,6 +283,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
252
283
|
bindInstanceAdapter(name: string, adapterId: string, fromInbound?: boolean): void;
|
|
253
284
|
getInstanceStatus(name: string): "running" | "paused" | "stopped" | "crashed";
|
|
254
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>;
|
|
292
|
+
/** Effective backends with a running or persisted-paused fleet/Classic instance. */
|
|
293
|
+
getActiveBackendIds(): ReadonlySet<string>;
|
|
255
294
|
isClassicInstance(name: string): boolean;
|
|
256
295
|
private cacheInstanceExecutionState;
|
|
257
296
|
private cancelIdleButtonRetirement;
|
|
@@ -268,6 +307,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
268
307
|
*/
|
|
269
308
|
private enforceWarmCap;
|
|
270
309
|
private waitForInstanceIdle;
|
|
310
|
+
/**
|
|
311
|
+
* Ask the daemon to capture the pane before answering, then wait for any state
|
|
312
|
+
* report produced after this request. The ordinary query is intentionally
|
|
313
|
+
* cache-only (idle gates call it frequently); this opt-in refresh is reserved
|
|
314
|
+
* for lifecycle decisions where a stale state would strand UI.
|
|
315
|
+
*/
|
|
316
|
+
private refreshInstanceExecutionState;
|
|
271
317
|
private deliverWithIdleGate;
|
|
272
318
|
/**
|
|
273
319
|
* Hand a payload to an instance's IPC, waiting out a *transient* disconnect.
|
|
@@ -445,6 +491,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
445
491
|
private handleDecisionCrud;
|
|
446
492
|
/** Resolve display name for an instance, fallback to instance name. */
|
|
447
493
|
resolveDisplayName(instanceName: string): string;
|
|
494
|
+
/** Persist identity to the instance's actual config store. Classic instances
|
|
495
|
+
* are registry rows in classicBot.yaml, not fleet.yaml instance entries. */
|
|
496
|
+
private setInstanceDisplayName;
|
|
497
|
+
private setInstanceDescription;
|
|
448
498
|
private handleSetDisplayName;
|
|
449
499
|
private handleSetDescription;
|
|
450
500
|
handleScheduleCrudHttp(instance: string, op: string, args: Record<string, unknown>): Promise<unknown>;
|
|
@@ -465,9 +515,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
465
515
|
private startTopicCleanupPoller;
|
|
466
516
|
/**
|
|
467
517
|
* Patch only values changed in the effective config into the original YAML
|
|
468
|
-
* document. Unknown keys
|
|
518
|
+
* document. Unknown keys and comments remain untouched; redundant
|
|
519
|
+
* non-identity instance leaves are canonicalized to inheritance afterward.
|
|
469
520
|
*/
|
|
470
521
|
saveFleetConfig(explicitPatches?: RawConfigPatch[]): void;
|
|
522
|
+
/** One-time upgrade migration; invalid YAML is never rewritten. */
|
|
523
|
+
private slimFleetConfigAtStartup;
|
|
524
|
+
private writeFleetConfigBackup;
|
|
471
525
|
private patchFleetDocument;
|
|
472
526
|
removeInstance(name: string): Promise<void>;
|
|
473
527
|
startStatuslineWatcher(name: string): void;
|
|
@@ -548,13 +602,12 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
548
602
|
*/
|
|
549
603
|
private postNonceButtonPrompt;
|
|
550
604
|
/**
|
|
551
|
-
*
|
|
605
|
+
* Validate a nonce-armed callback and claim it exactly once.
|
|
552
606
|
*
|
|
553
607
|
* Returns:
|
|
554
608
|
* - null — the callback is not for this prefix; try the next handler
|
|
555
609
|
* - "consumed" — for this prefix but stale/denied/malformed; stop dispatch
|
|
556
|
-
* - the entry+action — the click is authorized and
|
|
557
|
-
* from the map before any await, so double clicks cannot act twice)
|
|
610
|
+
* - the entry+action — the click is authorized and claimed before any await
|
|
558
611
|
*
|
|
559
612
|
* A stale click (expired nonce, or a pre-upgrade button whose payload no
|
|
560
613
|
* longer parses) collapses the clicked message so the dead button stops
|
|
@@ -563,6 +616,23 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
563
616
|
private consumeNonceCallback;
|
|
564
617
|
/** Collapse a consumed prompt's buttons into a final status line. */
|
|
565
618
|
private retireNonceButtons;
|
|
619
|
+
private tipsEnabled;
|
|
620
|
+
private readTipState;
|
|
621
|
+
private pickAvailableTip;
|
|
622
|
+
private tipText;
|
|
623
|
+
private formatTip;
|
|
624
|
+
/** Persistently enable advanced tips through the admin-only slash command. */
|
|
625
|
+
unlockAdvancedTips(userId: string): boolean;
|
|
626
|
+
/** Post one fresh nonce-armed tip in a known General channel. */
|
|
627
|
+
promptTip(generalName: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<"posted" | "empty" | "unavailable">;
|
|
628
|
+
private promptAdvancedTipUnlock;
|
|
629
|
+
private sendTipToGeneral;
|
|
630
|
+
private handleTipDismiss;
|
|
631
|
+
private handleTipUnlock;
|
|
632
|
+
/** Post the destructive `/clear` confirmation in the invoking channel. */
|
|
633
|
+
promptClearConfirmation(instanceName: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
|
|
634
|
+
/** Consume `/clear` Confirm/Cancel exactly once; only Confirm reaches IPC. */
|
|
635
|
+
private handleClearConfirmation;
|
|
566
636
|
/**
|
|
567
637
|
* Drop every pending prompt that refers to an instance being stopped or
|
|
568
638
|
* restarted — a restart offer for an instance the operator just restarted
|
|
@@ -613,7 +683,7 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
613
683
|
*/
|
|
614
684
|
private handleCancelClick;
|
|
615
685
|
private hasCancelButton;
|
|
616
|
-
sendCancelButton(instanceName: string, correlationId?: string): Promise<void>;
|
|
686
|
+
sendCancelButton(instanceName: string, correlationId?: string, preserveProgress?: boolean): Promise<void>;
|
|
617
687
|
/**
|
|
618
688
|
* The cancel button's text for a given elapsed time.
|
|
619
689
|
*
|
|
@@ -623,6 +693,13 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
623
693
|
* and once the agent had replied once there was no sign it was still going.
|
|
624
694
|
*/
|
|
625
695
|
static progressText(elapsedMs: number, activity?: string | null, minElapsedMs?: number): string;
|
|
696
|
+
/** Render elapsed time consistently in live and retained progress bubbles. */
|
|
697
|
+
private static formatProgressElapsed;
|
|
698
|
+
/** Final read-only form of a bubble that contains semantic tool history.
|
|
699
|
+
* Neutral wording is intentional: the same retirement primitive is used for
|
|
700
|
+
* normal completion, a mid-turn bubble replacement, and user cancellation,
|
|
701
|
+
* so claiming every retained checkpoint is "completed" would be false. */
|
|
702
|
+
private composeRetiredBubbleText;
|
|
626
703
|
/**
|
|
627
704
|
* Make a tool summary safe to paste into a channel message.
|
|
628
705
|
*
|
|
@@ -640,6 +717,26 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
640
717
|
* never used to decide anything — purely what the user is shown.
|
|
641
718
|
*/
|
|
642
719
|
private cacheInstanceActivity;
|
|
720
|
+
/**
|
|
721
|
+
* Cache the turn's tool-progress list and push it into the instance's live
|
|
722
|
+
* bubble, coalesced so a burst of tool events cannot flood the Bot API
|
|
723
|
+
* (Telegram's flood limit is per-chat across ALL forum topics, so edits are
|
|
724
|
+
* rate-limited per bubble AND ride behind the daemon-side 3s coalescer).
|
|
725
|
+
*/
|
|
726
|
+
private cacheInstanceProgress;
|
|
727
|
+
/** At most one progress-driven edit per bubble per TOOL_PROGRESS_EDIT_MIN_MS. */
|
|
728
|
+
private scheduleProgressEdit;
|
|
729
|
+
/**
|
|
730
|
+
* The ONE composer for the bubble text. Both writers — the elapsed-time
|
|
731
|
+
* ticker and the tool-progress push — go through here; two independent
|
|
732
|
+
* renderers editing the same message is how the progress list used to get
|
|
733
|
+
* wiped by the next elapsed tick (#528 trap 2).
|
|
734
|
+
*/
|
|
735
|
+
private composeBubbleText;
|
|
736
|
+
/** Pure composition of header + tool list, exposed for tests. */
|
|
737
|
+
static bubbleText(elapsedMs: number, activity: string | undefined, minElapsedMs: number, progress: string | undefined): string;
|
|
738
|
+
/** Recompose and edit the bubble in place; skips when nothing changed. */
|
|
739
|
+
private refreshBubble;
|
|
643
740
|
/**
|
|
644
741
|
* Refresh the button's text in place while the instance keeps working.
|
|
645
742
|
*
|
|
@@ -652,10 +749,14 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
652
749
|
private startProgressTicker;
|
|
653
750
|
/**
|
|
654
751
|
* After a reply: give the instance REPLY_RETIRE_GRACE_MS to resume working; if
|
|
655
|
-
* it has not, retire its button.
|
|
656
|
-
*
|
|
752
|
+
* it has not, retire its button. The daemon is asked for a fresh pane capture
|
|
753
|
+
* before deciding. Reading only the transition cache stranded the first
|
|
754
|
+
* post-restart bubble when its startup "working" report never got a matching
|
|
755
|
+
* idle edge. Re-arming replaces the previous timer, so a burst of replies ends
|
|
756
|
+
* with exactly one pending check.
|
|
657
757
|
*/
|
|
658
758
|
private armReplyGrace;
|
|
759
|
+
private finishReplyGrace;
|
|
659
760
|
/** Retire (delete) every cancel button belonging to an instance. */
|
|
660
761
|
private retireInstanceButtons;
|
|
661
762
|
/** Begin retiring one button (delete + bounded retry on failure). Idempotent:
|
|
@@ -680,7 +781,9 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
680
781
|
private sweepOrphanedCancelButtons;
|
|
681
782
|
/** Re-attempt a failed button delete up to CANCEL_BTN_MAX_RETRIES times. */
|
|
682
783
|
private scheduleButtonRetry;
|
|
683
|
-
/**
|
|
784
|
+
/** Retire one cancel bubble via its own adapter. A bubble that accumulated
|
|
785
|
+
* tool progress is kept as a read-only history message; a plain bubble keeps
|
|
786
|
+
* the legacy delete/edit-to-checkmark behavior. Resolves on success and
|
|
684
787
|
* rejects on failure so the caller can retry. */
|
|
685
788
|
private deleteButtonMessage;
|
|
686
789
|
/** Retire all cancel buttons for an instance — on reply or cancel. */
|
|
@@ -704,6 +807,74 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
704
807
|
private reactDone;
|
|
705
808
|
/** Interrupt an instance's current generation (cancel button / /cancel). */
|
|
706
809
|
cancelInstance(instanceName: string): boolean;
|
|
810
|
+
getDeliveryEpoch(instanceName: string): number;
|
|
811
|
+
private isDeliveryEpochCurrent;
|
|
812
|
+
/** Invalidate work queued before a user cancel and wake idle-gate waiters. */
|
|
813
|
+
private cancelPendingDeliveries;
|
|
814
|
+
private activeLogin;
|
|
815
|
+
/** Post the backend chooser for a bare `/login`. Caller enforces admin. */
|
|
816
|
+
promptLoginBackends(chat: {
|
|
817
|
+
adapter: ChannelAdapter;
|
|
818
|
+
adapterId: string;
|
|
819
|
+
chatId: string;
|
|
820
|
+
threadId?: string;
|
|
821
|
+
}): Promise<void>;
|
|
822
|
+
/**
|
|
823
|
+
* Start a login session for one backend. Caller enforces admin.
|
|
824
|
+
* Returns a status line to post, or null when a confirmation prompt was
|
|
825
|
+
* posted instead (auth still valid — see the pre-check below).
|
|
826
|
+
*/
|
|
827
|
+
startLoginSession(backendArg: string, chat: {
|
|
828
|
+
adapter: ChannelAdapter;
|
|
829
|
+
adapterId: string;
|
|
830
|
+
chatId: string;
|
|
831
|
+
threadId?: string;
|
|
832
|
+
}, opts?: {
|
|
833
|
+
skipAuthCheck?: boolean;
|
|
834
|
+
}): Promise<string | null>;
|
|
835
|
+
/** Create the login window and session (pre-check already settled). */
|
|
836
|
+
private launchLoginSession;
|
|
837
|
+
/** `/login code <text>` — paste admin-supplied text into the login window. */
|
|
838
|
+
loginSubmitInput(text: string): Promise<string>;
|
|
839
|
+
/** `/login cancel` — abort the active session and remove its window. */
|
|
840
|
+
cancelLoginSession(): Promise<string>;
|
|
841
|
+
/**
|
|
842
|
+
* The URL (+ code) is a live credential: whoever completes it binds THEIR
|
|
843
|
+
* account to this fleet's CLI. Telegram gets an HTML spoiler (same treatment
|
|
844
|
+
* as the dashboard token); other adapters get plain text with the warning.
|
|
845
|
+
*/
|
|
846
|
+
private sendLoginSecret;
|
|
847
|
+
/**
|
|
848
|
+
* After a successful login: wake the paused instances of that backend AND
|
|
849
|
+
* restart the running ones — a live CLI holds the old token in memory and
|
|
850
|
+
* only re-reads credentials on process start (a paused instance's CLI is
|
|
851
|
+
* already dead, so waking it respawns with the new token for free).
|
|
852
|
+
*/
|
|
853
|
+
private recoverBackendInstances;
|
|
854
|
+
/** Backend chooser button → start that backend's login session. */
|
|
855
|
+
private handleLoginBackendSelect;
|
|
856
|
+
/** Re-login confirmation (auth pre-check said credentials still work). */
|
|
857
|
+
private handleLoginConfirm;
|
|
858
|
+
/** Kiro provider button → drive the CLI's arrow-key selector. */
|
|
859
|
+
private handleLoginMenuSelect;
|
|
860
|
+
private activeInstall;
|
|
861
|
+
/** Start a CLI install session. Caller enforces admin. */
|
|
862
|
+
startInstallSession(backendArg: string, chat: {
|
|
863
|
+
adapter: ChannelAdapter;
|
|
864
|
+
adapterId: string;
|
|
865
|
+
chatId: string;
|
|
866
|
+
threadId?: string;
|
|
867
|
+
}): Promise<string>;
|
|
868
|
+
/** `/install-cli cancel` — abort the active install and remove its window. */
|
|
869
|
+
cancelInstallSession(): Promise<string>;
|
|
870
|
+
/** `command -v` on a login shell, so PATH additions from rc files count. */
|
|
871
|
+
private verifyBinaryOnLoginShell;
|
|
872
|
+
/** "Sign in now?" button after a successful install. */
|
|
873
|
+
private handleInstallLoginConfirm;
|
|
874
|
+
/** Discord native `/login` slash — shared by every adapter dispatch block. */
|
|
875
|
+
private handleLoginSlash;
|
|
876
|
+
/** Discord native `/install-cli` slash — shared by every dispatch block. */
|
|
877
|
+
private handleInstallCliSlash;
|
|
707
878
|
queueMirrorMessage(text: string): void;
|
|
708
879
|
/** Push an SSE event to all connected Web UI clients. */
|
|
709
880
|
emitSseEvent(event: string, data: unknown): void;
|
|
@@ -724,8 +895,45 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
724
895
|
private static GENERAL_INSTRUCTIONS;
|
|
725
896
|
/** Ensure the general instance has its project instructions file + knowledge */
|
|
726
897
|
private ensureGeneralInstructions;
|
|
727
|
-
/**
|
|
898
|
+
/** Resolve the workspace path a backend actually uses before publishing knowledge. */
|
|
899
|
+
private resolveKnowledgeWorkDir;
|
|
900
|
+
/**
|
|
901
|
+
* Where each backend natively loads on-demand skills from, relative to the
|
|
902
|
+
* workspace. Backends without a native skill mechanism (opencode, grok,
|
|
903
|
+
* antigravity, gemini-cli) are deliberately absent: dropping files a CLI
|
|
904
|
+
* never reads is clutter, not capability. Unknown directories are ignored
|
|
905
|
+
* by older CLI versions, so publishing is fail-open across upgrades.
|
|
906
|
+
*/
|
|
907
|
+
private static SKILLS_DIR_SEGMENTS;
|
|
908
|
+
/** Copy general-knowledge steering + all role-eligible skills to General. */
|
|
728
909
|
private syncGeneralKnowledge;
|
|
910
|
+
/** Publish only the bundled skills eligible for an instance role. */
|
|
911
|
+
private syncRoleSkills;
|
|
912
|
+
/**
|
|
913
|
+
* Steering (always-on rules like core-rules.md). Kiro loads a native
|
|
914
|
+
* steering directory; every other backend gets the content embedded into
|
|
915
|
+
* its instructions file (CLAUDE.md / AGENTS.md / …) inside a managed marker
|
|
916
|
+
* block — the previous behavior dropped bare .md files in the workspace
|
|
917
|
+
* root, which no CLI ever read. The block is replaced in place on every
|
|
918
|
+
* sync, so rule updates reach EXISTING workspaces; everything the user
|
|
919
|
+
* wrote outside the markers is preserved byte-for-byte.
|
|
920
|
+
*/
|
|
921
|
+
private syncGeneralSteering;
|
|
922
|
+
private static STEERING_BLOCK_BEGIN;
|
|
923
|
+
private static STEERING_BLOCK_END;
|
|
924
|
+
/**
|
|
925
|
+
* Publish AgEnD's bundled skills into a CLI's native skills directory,
|
|
926
|
+
* owning ONLY what we published. A manifest records which skill names AgEnD
|
|
927
|
+
* wrote; a bundled rename/removal deletes the stale managed copy, while a
|
|
928
|
+
* skill the user created by hand is never listed and therefore never
|
|
929
|
+
* touched — even if a future bundle happens to reuse its name (the sync
|
|
930
|
+
* then skips it and logs, rather than overwrite the user's work). The sole
|
|
931
|
+
* migration exception is the pre-manifest Kiro General layout explicitly
|
|
932
|
+
* selected by adoptLegacyUnmanaged.
|
|
933
|
+
*/
|
|
934
|
+
private syncManagedSkills;
|
|
935
|
+
/** Read AgEnD's roles extension from SKILL.md YAML frontmatter. */
|
|
936
|
+
private readManagedSkillRoles;
|
|
729
937
|
/** Fetch forum topic icon stickers and pick emoji IDs for each state */
|
|
730
938
|
private resolveTopicIcons;
|
|
731
939
|
/** Set topic icon based on instance state */
|
|
@@ -768,6 +976,34 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
768
976
|
private probeCliEnvs;
|
|
769
977
|
/** Best-effort model list for `/model`: cached CLI env first, else live probe. Never throws. */
|
|
770
978
|
private getModelOptions;
|
|
979
|
+
/**
|
|
980
|
+
* Model catalog behind the `list_models` tool.
|
|
981
|
+
*
|
|
982
|
+
* The two scopes are not cosmetic. "global" is the account/CLI catalog served
|
|
983
|
+
* from the startup probe cache; "instance" is resolved through that instance's
|
|
984
|
+
* OWN backend config, and for a Codex instance on a custom provider that is a
|
|
985
|
+
* different catalog entirely — `listModels()` reads models_cache.json out of
|
|
986
|
+
* the instance's private CODEX_HOME. Answering such an instance with the
|
|
987
|
+
* account list would name models its CLI rejects, which is exactly the
|
|
988
|
+
* mistake this tool exists to prevent.
|
|
989
|
+
*
|
|
990
|
+
* `scope` always describes where the returned LIST came from, not what was
|
|
991
|
+
* asked for: an instance query that falls back to the account catalog reports
|
|
992
|
+
* scope "global" and says so in `note`, rather than implying instance-level
|
|
993
|
+
* accuracy it does not have.
|
|
994
|
+
*
|
|
995
|
+
* Never throws — a model listing is an aid, and failing it must not fail a turn.
|
|
996
|
+
*/
|
|
997
|
+
listModelCatalog(opts?: {
|
|
998
|
+
backend?: string;
|
|
999
|
+
instanceName?: string;
|
|
1000
|
+
}): Promise<ModelCatalog>;
|
|
1001
|
+
/** The custom provider an instance overrides its backend with, if any. */
|
|
1002
|
+
private customProviderFor;
|
|
1003
|
+
/** Ask a backend for its catalog using ONE instance's real config. Never throws. */
|
|
1004
|
+
private instanceScopedModels;
|
|
1005
|
+
/** Account-wide catalog: probe cache first, live probe on miss. */
|
|
1006
|
+
private globalModelCatalog;
|
|
771
1007
|
/** `/model` slash handler (admin only). No arg → DC menu; `/model <name>` → apply directly. */
|
|
772
1008
|
/** Label an effort choice, marking the one currently configured. */
|
|
773
1009
|
private effortChoiceLabel;
|
|
@@ -785,6 +1021,10 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
785
1021
|
* Returns null on success (menu shown), or a fallback string to send.
|
|
786
1022
|
*/
|
|
787
1023
|
promptModelMenu(instanceName: string, userId: string, channelId: string, adapter: ChannelAdapter, chatId: string, threadId?: string): Promise<string | null>;
|
|
1024
|
+
/** Cached-or-live account catalog behind "/model → more models" (claude). */
|
|
1025
|
+
private claudeApiModelOptions;
|
|
1026
|
+
/** Replace a consumed "/model" menu with the full account catalog tier. */
|
|
1027
|
+
private expandClaudeModelMenu;
|
|
788
1028
|
/** Consume a `/model` selection callback. Returns true for all model-select ids (incl. stale). */
|
|
789
1029
|
private handleModelSelection;
|
|
790
1030
|
/** Apply a model to an instance: runtime paste (claude-code) or persist + restart (others). */
|
|
@@ -872,7 +1112,8 @@ export declare class FleetManager implements FleetContext, LifecycleContext, Arc
|
|
|
872
1112
|
/**
|
|
873
1113
|
* Hot-reload: re-read fleet.yaml and reconcile running instances.
|
|
874
1114
|
* Starts new, stops removed, restarts modified instances.
|
|
875
|
-
*
|
|
1115
|
+
* Whitelisted runtime fields are pushed into live daemons; all other instance
|
|
1116
|
+
* fields, plus cold fleet-level settings, retain restart semantics.
|
|
876
1117
|
*/
|
|
877
1118
|
private reconcileInstances;
|
|
878
1119
|
restartInstances(): Promise<void>;
|