import type { SessionEntry } from "../../../session-manager.ts";
import type { ExtensionAPI, ExtensionContext } from "../../types.ts";
import type { Goal } from "./types.ts";
export type TrailingGoalContinuations = {
    /** Continuations whose turn ran: the unattended loop the load-time flood guard bounds. */
    readonly counted: number;
    /** The newest continuation was refused for a usage or rate limit, so the goal was waiting that limit out. */
    readonly waitingOutLimit: boolean;
};
export type SessionStartContinuationOptions = {
    readonly continuationPending: boolean;
    readonly markContinuationPending: () => void;
    /** The session opened in the middle of a limit wait, so this wake re-checks that limit (senpi#4085). */
    readonly limitWait?: boolean;
};
/**
 * Reads the goal continuations queued since the most recent real user message in the branch (mirrors the
 * todo-gate / todo-bridge backward branch read). A real user message is the only reset: the assistant turns in
 * between are exactly the unattended loop the load-time admission guard exists to stop.
 *
 * A continuation the provider refused for a usage or rate limit ran no model turn, so it is not part of that
 * loop (senpi#4085). A goal that waited a limit out for more wakes than the cap is therefore not a flood, and it
 * resumes after a restart or a config reload.
 */
export declare function readTrailingGoalContinuations(entries: readonly SessionEntry[]): TrailingGoalContinuations;
/** Routes startup and resume continuations through the same verdict and delivery accounting as agent-end paths. */
export declare function queueGoalContinuation(pi: ExtensionAPI, ctx: ExtensionContext, goal: Goal, options: SessionStartContinuationOptions): Promise<Goal | null>;
//# sourceMappingURL=session-start-continuation.d.ts.map