import type { Delegation } from "./types.js"; /** Resume strategy determined by inspecting a persisted delegation record. */ export type ResumeStrategy = { action: "reuse"; sessionId: string; reason: string; } | { action: "stack-on"; sessionId: string; reason: string; } | { action: "fresh"; reason: string; }; /** * REQ-RC-01: Determines whether a persisted delegation can be resumed, * stacked onto, or needs a fresh dispatch. * * Strategy priority: * 1. `reuse` — Session is non-terminal AND resumable AND still exists * 2. `stack-on` — Session is terminal BUT still exists in the SDK; new work * can be attached as a child. The SDK accepts stacking via * `task_id` / `parentSessionId` for any valid session ID. * 3. `fresh` — Session no longer exists or is not resumable * * @param delegation - The persisted delegation record to evaluate. * @param sessionExists - Whether the child session still exists in the host runtime. * @returns A ResumeStrategy indicating reuse, stack-on, or fresh dispatch with a reason. */ export declare function resolveResumeStrategy(delegation: Delegation, sessionExists: boolean): ResumeStrategy; /** * REQ-RC-01: Builds a continuation prompt that references the original task * without repeating the full prompt payload. * * @param delegation - The delegation to build a continuation prompt for. * @returns A concise continuation prompt referencing the original task and current state. */ export declare function buildContinuationPrompt(delegation: Delegation): string; /** * Builds a context-preserving prompt for stacking onto a terminal session. * Unlike buildContinuationPrompt (for resuming interrupted work), this * acknowledges the previous session's terminal state and frames the new * work as a follow-up or retry. * * @param delegation - The terminal delegation to stack onto. * @param customPrompt - Optional custom prompt. If omitted, builds a retry prompt. * @returns A stack-on prompt that preserves context from the original session. */ export declare function buildStackOnPrompt(delegation: Delegation, customPrompt?: string): string; //# sourceMappingURL=resume-resolver.d.ts.map