import { type EvalUploadClient, type RemoteTraceState } from "../../cli/statelog/evalUploadClient.js"; /** * `agency eval upload`: send finished run directories, with their grades, to * the linked statelog project. Per run: ask the server what it already holds * for the trace, send only what is safe (all of it, the missing tail of an * earlier bulk upload, or nothing), then upsert every annotation row. A run * that fails never stops the next one. Statelog dedupes per trace, so running * this twice is harmless. */ export type EvalUploadTarget = { origin: string; projectSlug: string; apiKey: string; }; export type EvalUploadDependencies = { client?: EvalUploadClient; reportWarning?: (message: string) => void; /** Called with one formatted line as each run finishes. */ reportProgress?: (line: string) => void; }; export type UploadRunOutcome = { dir: string; traceId: string; status: "uploaded"; events: number; annotations: number; } | { dir: string; traceId: string; status: "present"; serverEvents: number; fileEvents: number; annotations: number; } | { dir: string; traceId: string; status: "resumed"; from: number; events: number; annotations: number; } | { dir: string; traceId: string | null; status: "failed"; error: string; }; export type EvalUploadResult = { runs: UploadRunOutcome[]; /** The batch page on statelog, when every uploaded run belongs to one * batch; null otherwise. */ batchUrl: string | null; }; export declare function evalUpload(targets: string[], target: EvalUploadTarget, dependencies?: EvalUploadDependencies): Promise; /** What to do with a trace's events, given what the server holds and how * many events the file has. Pure, so every branch is testable. */ export type EventPlan = { kind: "create-empty"; } | { kind: "upload-all"; } | { kind: "skip"; serverEvents: number; } | { kind: "resume"; from: number; } | { kind: "refuse"; reason: string; }; export declare function eventPlan(state: RemoteTraceState, fileEvents: number): EventPlan; /** One run's outcome as the line the CLI prints. */ export declare function formatRunLine(run: UploadRunOutcome, cwd?: string): string; /** The closing lines: a count line, and the batch page when there is one. */ export declare function formatUploadSummary(result: EvalUploadResult): string[]; /** Every output line at once: per-run lines, then the summary. */ export declare function formatUploadResult(result: EvalUploadResult, cwd?: string): string[];