import type { ExtensionContext } from "@earendil-works/pi-coding-agent"; import type { AutoCompactionTrigger } from "../compaction/threshold.js"; /** Upper bound for a seed prompt (same as compaction instructions). */ export declare const MAX_COMPACTION_SEED_CHARS = 8192; /** Pi custom-message type of the seed Fabric sends after a committed compaction. */ export declare const COMPACTION_SEED_MESSAGE_TYPE = "fabric-compaction-seed"; /** * Pi delivery for a seed: a message that starts a turn, queued as a * follow-up. Pi defers a turn-starting message sent during `agent_settled` * until the settle finishes, so the seed is queued after the compaction * commits; a prompt submitted during the compaction runs first. */ export declare const COMPACTION_SEED_DELIVERY: { readonly triggerTurn: true; readonly deliverAs: "followUp"; }; export interface CompactionSeedMessage { customType: typeof COMPACTION_SEED_MESSAGE_TYPE; content: string; display: true; details: { version: 1; }; } export declare const compactionSeedMessage: (seed: string) => CompactionSeedMessage; export interface CompactRequestIntent { reason?: string; instructions?: string; preserve?: string[]; requestedBy?: string; /** * Queued after the compaction commits as a labelled Fabric message that * starts a turn; a prompt submitted during the compaction runs first. */ seed?: string; } export interface CompactPendingIntent { reason?: string; instructions?: string; preserve?: string[]; seed?: string; requestedBy: string; requestedAt: number; } type CompactCommitStatus = "committed" | "cancelled" | "failed"; export interface CompactLastCommit { at: number; requestedBy: string; status: CompactCommitStatus; summary?: string; tokensBefore?: number; estimatedTokensAfter?: number; error?: string; /** The intent's seed was handed to Pi as a labelled Fabric message. */ seeded?: true; } export interface CompactAutoTrigger { at: number; trigger: AutoCompactionTrigger; committed: boolean; } export interface CompactStatus { pending?: CompactPendingIntent; last?: CompactLastCommit; lastAuto?: CompactAutoTrigger; } export interface CompactControllerHooks { onRequest?: (intent: CompactPendingIntent) => void; onCommit?: (info: CompactLastCommit) => void; sendSeed?: (message: CompactionSeedMessage) => void; } /** Rejects a blank, non-string or oversized seed; shared by every path that accepts one. */ export declare const checkedSeed: (value: unknown) => string | undefined; export declare class CompactController { #private; constructor(hooks?: CompactControllerHooks); request(intent: CompactRequestIntent): CompactPendingIntent; cancel(): void; noteAutoCompaction(trigger: AutoCompactionTrigger, committed: boolean): void; status(): CompactStatus; maybeCommit(context: ExtensionContext): Promise; } export {}; //# sourceMappingURL=compact-controller.d.ts.map