import { CopilotHandler, CopilotRequest, Issue, Proposal } from '../../../ai'; import { ChatAction } from './types'; export type RunDeps = { handler: CopilotHandler; /** Called at the start of every turn so a repair turn sees the latest page and chat. */ buildRequest: () => { ok: true; request: CopilotRequest; } | { ok: false; error: string; }; validate: (proposal: Proposal) => { ok: boolean; issues: Issue[]; }; dispatch: (action: ChatAction) => void; createId: () => string; signal: AbortSignal; /** Consecutive auto-repair turns allowed. Defaults to 2. */ maxRepairs?: number; }; /** Runs one assistant turn, then repair turns while the last proposal is invalid. Turns run strictly one after another. */ export declare function runAssistant(deps: RunDeps): Promise;