/** * Where the report goes. Only known schemes are recognised: a generic * `:` test would swallow `C:\reports\out.md` on Windows. */ export declare function parseDestinations(values: string[], json?: boolean): Destination[] | string; /** The file the agent is told to write, if any. */ export declare function markdownPath(destinations: Destination[]): string | undefined; /** * Check every destination before the run starts. A ten-minute run that then * cannot post is the worst outcome, so this spends no tokens to find out. */ export declare function preflight(destinations: Destination[]): Promise; /** Route the finished report. Returns a message when a destination failed. */ export declare function deliver(destinations: Destination[], envelope: RunEnvelope, thread?: ThreadState): Promise; /** * This thread's comments, read before the run. Collapsing them afterwards needs * no judgement: the answer posted in between cannot be in a list taken before * it existed, which is the one thing an agent working the thread cannot know. */ export declare function threadComments(pr: number | undefined, thread?: string): Promise; /** * The report as delivered, header above it and footer under it. The marker goes * on top only in a thread: it is how a later round finds the comments we posted. */ export declare function decorate(report: string, decoration?: Decoration): string; /** * What signs the text as ours. An HTML comment is invisible wherever markdown * renders, and a later round reading the thread back knows which comments it * wrote, which conversation they belong to, and what they were written against. * Key=value, so a round with nothing restored can still parse it with `split`. */ export declare function marker(fields?: MarkerFields): string; /** A thread name safe inside an HTML comment, which cannot contain `--`. */ export declare function threadName(value?: string): string; /** What a posted comment opens with when the caller writes no header of their own. */ export declare function defaultHeader(): string; /** What signs the report when the caller writes no footer of their own. */ export declare function defaultFooter(model: string): string; /** The pull request `preflight` resolved, when the report is posted to one. */ export declare function pullRequestNumber(destinations: Destination[]): number | undefined; /** The model name you would recognise, without the provider namespace. */ export declare function modelName(model: string): string; export interface Decoration extends MarkerFields { header?: string; footer?: string; } export interface MarkerFields { /** Which conversation this comment belongs to, so parallel runs never mix. */ thread?: string; /** The commit the review was written against, read by the next round. */ commit?: string; /** Short session id. Omitted on an unsaved run. */ session?: string; } /** This thread's comments as they were before the run. */ export interface ThreadState { earlier: string[]; } export type Destination = { kind: "stdout"; } | { kind: "markdown"; path: string; } | { kind: "json"; path?: string; } | { kind: "gh"; pr?: number; }; export interface RunEnvelope { status: "pass" | "fail"; reason: string | null; report: string | null; reportPath: string | null; model: string; steps: number; tokens: { input: number; output: number; }; durationMs: number; sessionId: string | null; /** `extract` only: the values found, by field name. */ values?: Record; }