import type { PartialDeep, Promisable, ReadonlyDeep, WritableDeep } from 'type-fest';
import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
import type { TaskJson } from '../../pipeline/PipelineJson/TaskJson';
import type { LlmCall } from '../../types/LlmCall';
import type { Parameters } from '../../types/Parameters';
import type { string_parameter_name } from '../../types/string_name';
import type { TODO_string } from '../../utils/organization/TODO_string';
import type { ExecutionReportJson } from '../execution-report/ExecutionReportJson';
import type { PipelineExecutorResult } from '../PipelineExecutorResult';
import type { CreatePipelineExecutorOptions } from './00-CreatePipelineExecutorOptions';
/**
 * Options for executing attempts of a pipeline task, including configuration for jokers, priority,
 * maximum attempts, prepared content, parameters, the task itself, the prepared pipeline, execution report,
 * and pipeline identification. Used internally by the pipeline executor.
 *
 * @private internal type of `executeAttempts`
 */
export type ExecuteAttemptsOptions = Required<Omit<CreatePipelineExecutorOptions, 'pipeline'>> & {
    /**
     * Names of parameters that act as jokers, which can be used to bypass normal execution if their value meets requirements.
     */
    readonly jokerParameterNames: Readonly<ReadonlyArray<string_parameter_name>>;
    /**
     * Priority of the current execution attempt, used to influence UI or execution order.
     */
    readonly priority: number;
    /**
     * Maximum number of attempts allowed for this task, including retries and joker attempts.
     * Note: [💂] There are two distinct variables
     * 1) `maxExecutionAttempts` - attempts for LLM model
     * 2) `maxAttempts` - attempts for any task (LLM, SCRIPT, DIALOG, etc.)
     */
    readonly maxAttempts: number;
    /**
     * The content prepared for execution, with parameters already substituted.
     */
    readonly preparedContent: TODO_string;
    /**
     * The parameters provided for this execution attempt.
     */
    readonly parameters: Readonly<Parameters>;
    /**
     * The task being executed, as a deeply immutable TaskJson object.
     * Note: Naming should be unified between `task` and `currentTask`.
     */
    readonly task: ReadonlyDeep<TaskJson>;
    /**
     * The pipeline structure prepared for execution, as a deeply immutable PipelineJson object.
     */
    readonly preparedPipeline: ReadonlyDeep<PipelineJson>;
    /**
     * Callback invoked with partial results as the execution progresses.
     */
    onProgress(newOngoingResult: PartialDeep<PipelineExecutorResult>): Promisable<void>;
    /**
     * Optional callback invoked with each LLM call.
     */
    logLlmCall?(llmCall: LlmCall): Promisable<void>;
    /**
     * The execution report object, which is updated during execution.
     */
    readonly $executionReport: WritableDeep<ExecutionReportJson>;
    /**
     * String identifier for the pipeline, used for logging and error reporting.
     */
    readonly pipelineIdentification: string;
};
/**
 * Executes a pipeline task with multiple attempts, including joker and retry logic. Handles different task types
 * (prompt, script, dialog, etc.), applies postprocessing, checks expectations, and updates the execution report.
 * Throws errors if execution fails after all attempts.
 *
 * @param options - The options for execution, including task, parameters, pipeline, and configuration.
 * @returns The result string of the executed task.
 *
 * @private internal utility of `createPipelineExecutor`
 */
export declare function executeAttempts(options: ExecuteAttemptsOptions): Promise<TODO_string>;
