import { type QualityIntelligence as QI } from "@oscharko-dev/keiko-contracts";
import { type QualityIntelligenceRunSummary } from "@oscharko-dev/keiko-workflows";
import type { QualityIntelligenceStartRunRequest } from "@oscharko-dev/keiko-contracts";
import type { UiHandlerDeps } from "../deps.js";
import { QiIngestionError } from "./runIngestion.js";
import type { QiSkippedSource } from "./runIngestion.js";
import { QiGenerationError } from "./generationPort.js";
export interface QiRunAccepted {
    readonly runId: string;
    readonly requestedAt: string;
    readonly sourceCount: number;
    readonly atomCount: number;
    readonly modelId?: string | undefined;
    /** Sources dropped because the request exceeded the 16-source cap (Epic #729). */
    readonly droppedSourceCount: number;
    /** Connected sources skipped because they ingested to nothing usable (Epic #729 N+1 resilience). */
    readonly skippedSources: readonly QiSkippedSource[];
}
export interface ExecuteQiRunInput {
    readonly request: QualityIntelligenceStartRunRequest;
    readonly runId: string;
    readonly deps: UiHandlerDeps;
    readonly registeredAt: string;
    readonly signal: AbortSignal;
    readonly onEvent: (event: QI.QualityIntelligenceRunEvent) => void;
    readonly onAccepted: (accepted: QiRunAccepted) => void;
}
/**
 * Execute a QI run end to end. Throws `QiIngestionError` / `QiGenerationError` (safe, coded) when
 * the request cannot start; otherwise returns the run summary after the workflow reaches a terminal
 * state. `onAccepted` fires once, after ingestion + model resolution succeed and before generation.
 */
export declare function executeQiRun(input: ExecuteQiRunInput): Promise<QualityIntelligenceRunSummary>;
export { QiIngestionError, QiGenerationError };
//# sourceMappingURL=runExecution.d.ts.map