import { getPrefixedLogger } from "../../../../util/logger.js";
import { type Clark, type ClarkStateHandlerParams } from "../../../state-machine/clark-fsm.js";
import type { ApiExecutionResult, ApiExecutionInputs } from "./api-executor.js";
import type { ApiIdentifier } from "../../subagents/apis/types.js";
export declare enum ApiValidationStage {
    REGISTRATION = "registration",
    EXECUTE = "execute",
    AUTH = "auth",
    RESULTS = "results",
    METADATA = "metadata"
}
export interface ApiValidationIssue {
    stage: ApiValidationStage;
    reason: string;
    recoverable: boolean;
    attempt: number;
    error?: string;
    suggestion?: string;
}
export interface ApiValidationPipelineOptions {
    maxRegistrationAttempts: number;
    maxExecutionAttempts: number;
    validateMetadata?: boolean;
    omitStepOutputs?: boolean;
    timeout?: number;
}
export interface ApiValidationPipelineResult {
    success: boolean;
    summary: string;
    issues: ApiValidationIssue[];
    attempts: Record<ApiValidationStage, number>;
    executionResult?: ApiExecutionResult;
    escalated: boolean;
}
export declare class ApiValidationEscalatedError extends Error {
    readonly issues: ApiValidationIssue[];
    readonly summary: string;
    constructor(summary: string, issues: ApiValidationIssue[]);
}
export interface RunApiValidationPipelineParams {
    clark: Clark;
    services: ClarkStateHandlerParams;
    identifier: ApiIdentifier;
    inputs?: ApiExecutionInputs;
    options?: Partial<ApiValidationPipelineOptions>;
    logger?: ReturnType<typeof getPrefixedLogger>;
}
/**
 * Execute the automated API validation pipeline, progressing through execution,
 * authentication, parameter, metadata, and result validation stages.
 */
export declare const runApiValidationPipeline: (params: RunApiValidationPipelineParams) => Promise<ApiValidationPipelineResult>;
/**
 * Checks if there are any pending escalations.
 */
export declare const hasPendingEscalations: () => boolean;
type FlushEscalationsParams = {
    clark: Clark;
    services: ClarkStateHandlerParams;
    logger: ReturnType<typeof getPrefixedLogger>;
    /** If true, bypass the AwaitingUser state check (used when called from handleAiRespondToToolPermission) */
    force?: boolean;
    /** If true, skip the state transition to AwaitingUser (used when Clark is already awaiting user input) */
    skipStateTransition?: boolean;
};
/**
 * Flushes pending escalations by sending a multi_choice message to the user.
 * Returns true if an escalation was sent, false otherwise.
 */
export declare const flushPendingEscalations: ({ clark, services, logger, force, skipStateTransition, }: FlushEscalationsParams) => Promise<boolean>;
export {};
//# sourceMappingURL=api-validation-orchestrator.d.ts.map