/** * Soft orientation for continue / mid-work recovery after interruptions. * * Professional agents (Claude Code, Cursor, etc.) re-attach to interrupted * work: live jobs, open tasks, last tools — they do not skip ahead and mark * plan items done. This is guidance + facts, not a hard gate. */ import type { SessionPlan } from "../store/plan.js"; import type { ChatMessage } from "../types.js"; import type { BackgroundJob } from "../tools/jobs.js"; export declare const CONTINUE_ORIENT_PREFIX = "CONTINUE / RECOVER MID-WORK"; /** User is asking to pick up after a pause, error, or short nudge. */ export declare function looksLikeContinueOrResumePrompt(prompt: string): boolean; export interface ContinueOrientInput { readonly prompt: string; readonly history?: readonly ChatMessage[] | undefined; readonly plan?: SessionPlan | undefined; readonly runningJobs?: readonly BackgroundJob[] | undefined; readonly recentJobs?: readonly BackgroundJob[] | undefined; /** Skip for pure Q&A / social — never force re-attach on "what did you find?" */ readonly informationalQuery?: boolean | undefined; readonly idleOrSocial?: boolean | undefined; /** Structured outcome of the previous turn in this session, when known. */ readonly previousTurn?: PreviousTurnSignal | undefined; } export interface PreviousTurnSignal { readonly status: "succeeded" | "partial" | "blocked" | "failed" | "aborted" | "paused_budget" | "error"; readonly reason?: string | undefined; } /** True when the last turn provably did not finish its work. */ export declare function previousTurnUnfinished(signal: PreviousTurnSignal | undefined): boolean; export interface RecentToolHint { readonly name: string; readonly ok?: boolean | undefined; readonly head: string; } /** Last few tool results from history (newest last), high-signal one-liners. */ export declare function extractRecentToolHints(history: readonly ChatMessage[] | undefined, limit?: number): RecentToolHint[]; /** * Whether this turn should receive mid-work recovery orientation. * Soft: continue phrasing, or open plan work / live jobs with prior history. */ export declare function shouldInjectContinueOrientation(input: ContinueOrientInput): boolean; /** * Factual briefing + soft procedure. Empty string if nothing useful to say. */ export declare function buildContinueOrientation(input: ContinueOrientInput): string;