import type { Config } from '../config/schema.js';
import type { PREvent } from '../github/webhook.js';
import type { PROrigin } from '../github/detector.js';
import type { Vendor } from '../lib/vendor.js';
import { type StepResult } from '../lib/workflow.js';
import type { PRPhase } from '../lib/board.js';
export declare function isRetryableFixError(err: unknown): boolean;
export declare function getEffectiveStepType(stepType: string, isRecheckRun: boolean): string;
export declare function countCrosscheckCommitsForPR(tmpDir: string, baseRef: string): number;
export type WorkflowTrigger = 'run' | 'kickass' | 'watch' | 'serve' | 'backtrace' | 'comment';
export interface WorkflowCompleteInputs {
    owner: string;
    repoName: string;
    prNumber: number;
    workflowId: string;
    workflowStart: number;
    stepsRun: string[];
    results: Record<string, StepResult>;
    workflowFailed: boolean;
    round?: number;
    trigger?: WorkflowTrigger;
    qualityTier?: string;
    workflowError?: unknown;
    failedStep?: string;
    now?: number;
}
export type WorkflowEndedReason = 'completed' | 'error' | 'progress_gate' | 'max_iterations' | 'manual_abort';
export declare function buildWorkflowCompleteEvent(inputs: WorkflowCompleteInputs): Record<string, unknown>;
export declare function exceedsMaxRounds(effectiveType: string, originalStepType: string, maxRounds: number, round: number | undefined): boolean;
export interface PRPhaseData {
    phase?: PRPhase;
    verdict?: string | null;
    commentCount?: number;
    fixCount?: number;
    recheckVerdict?: string | null;
    crTokens?: number;
    recheckTokens?: number;
    fixTokens?: number;
    crReviewer?: string;
    recheckReviewer?: string;
    qualityTier?: string;
}
export interface WorkflowContext {
    owner: string;
    repoName: string;
    prNumber: number;
    pr: PREvent['pull_request'];
    tmpDir: string;
    token: string;
    config: Config;
    origin: PROrigin;
    reviewStart: number;
    log: (msg: string) => void;
    onPhaseChange: (label: string, data?: PRPhaseData) => void;
    crosscheckShas: Set<string>;
    isRecheckRun?: boolean;
    round?: number;
    dryRun?: boolean;
    steps?: import('./workflow.js').WorkflowStep[];
    smartSwitchFallback?: 'claude' | 'codex';
    pushedShas?: string[];
    initialReviewComment?: {
        id?: number;
        body: string;
    };
    overrideMaxRounds?: number;
    roundMode?: 'crazy' | 'halfcrazy';
    overrideTimeoutMs?: number;
    trigger?: WorkflowTrigger;
    onVendorLimit?: (failedVendor: Vendor, fallbackVendor: Vendor | null, reason: string, stepName: string) => void;
}
export interface WorkflowResult {
    verdict: string | null;
    fixAppliedCount?: number;
    fixSkipReason?: string;
    latestReviewComment?: {
        id?: number;
        body: string;
    };
}
export declare function resolveFixVendor(stepReviewer: string, origin: PROrigin, config: Config, fallback?: 'claude' | 'codex'): {
    vendor: 'claude' | 'codex' | null;
    usedHumanFallback: boolean;
};
export declare function runWorkflow(ctx: WorkflowContext): Promise<WorkflowResult>;
//# sourceMappingURL=runner.d.ts.map