import type { AgentMessage } from "@pk-nerdsaver-ai/pi-agent-core";
/** Minimal slice of `Agent` the runtime drives — satisfied by pi-agent-core `Agent`. */
export interface AdvisorAgent {
    prompt(input: string): Promise<void>;
    abort(reason?: unknown): void;
    reset(): void;
    readonly state: {
        messages: AgentMessage[];
    };
}
export interface AdvisorRuntimeHost {
    /** Live primary transcript (use `agent.state.messages`). */
    snapshotMessages(): AgentMessage[];
    /** Surface one advice note to the primary (enqueues into the session YieldQueue). */
    enqueueAdvice(note: string, severity?: "nit" | "concern" | "blocker"): void;
    /**
     * Pre-prompt context maintenance for the advisor's own append-only context.
     * Promotes the advisor model to a larger sibling when its context nears the
     * window (mirroring the primary's promote-first policy) and resolves `true`
     * when the advisor should re-prime — reset and replay the current
     * primary-bounded transcript — because promotion did not free enough room.
     * Optional: hosts that omit it get no maintenance (context only shrinks when
     * the primary's next compaction triggers {@link AdvisorRuntime.reset}).
     */
    maintainContext?(incomingTokens: number): Promise<boolean>;
}
export declare class AdvisorRuntime {
    #private;
    private readonly agent;
    private readonly host;
    private readonly retryDelayMs;
    disposed: boolean;
    constructor(agent: AdvisorAgent, host: AdvisorRuntimeHost, retryDelayMs?: number);
    get backlog(): number;
    onTurnEnd(messages?: AgentMessage[]): void;
    waitForCatchup(maxMs: number, threshold: number, signal?: AbortSignal): Promise<void>;
    dispose(): void;
    /**
     * Re-prime the advisor after a history rewrite (compaction, session
     * switch/resume, branch). Clears the advisor's own (non-persisted) context
     * and rewinds the cursor to 0 so the NEXT turn replays the full current —
     * post-compaction — transcript, giving the advisor fresh context instead of
     * leaving it blind to everything before the rewrite.
     */
    reset(): void;
    /**
     * Seed the cursor to the current transcript length when the advisor is enabled
     * mid-session. Prevents the next turn from replaying the entire history to the
     * advisor (which would be expensive and likely stale).
     */
    seedTo(count: number): void;
}
