import type { RequestOptions } from "../base-client";
import type { RequestBuilder } from "../request-builder";
/** Status of a pipeline execution. */
export type PipelineExecutionStatus = "running" | "awaiting_approval" | "approved" | "rejected" | "completed" | "failed" | "expired";
/** A pipeline execution resource. */
export interface PipelineExecution {
    id: string;
    pipeline_id: string;
    workspace_id: string | null;
    status: PipelineExecutionStatus;
    input: Record<string, unknown>;
    node_outputs: Record<string, unknown>;
    checkpoint_node: string | null;
    checkpoint_data: Record<string, unknown> | null;
    checkpoint_notes: string | null;
    checkpoint_refinements: Array<{
        node_id: string;
        instruction: string;
        timestamp: string;
    }>;
    checkpoint_session_id: string | null;
    started_at: string;
    completed_at: string | null;
}
/** Attributes for editing checkpoint data before approval. */
export interface UpdateCheckpointAttributes {
    /** RD-edited output data. Corrected values flow into downstream nodes. */
    checkpoint_data?: Record<string, unknown>;
}
/** Attributes for requesting AI refinement of a checkpoint node. */
export interface AiRefineAttributes {
    /** The node ID to re-run with the instruction. */
    node_id: string;
    /** Natural language instruction for the refinement. */
    instruction: string;
}
/**
 * Creates the pipelineExecutions namespace for managing HITL pipeline checkpoints.
 *
 * @param rb - The request builder used for API communication.
 * @returns Pipeline executions namespace.
 *
 * @example
 * ```typescript
 * // Poll status after triggering
 * const execution = await admin.pipelineExecutions.get(executionId);
 * if (execution.status === "awaiting_approval") {
 *   await admin.pipelineExecutions.updateCheckpoint(executionId, {
 *     checkpoint_data: { ...correctedValues },
 *   });
 *   await admin.pipelineExecutions.addNote(executionId, "Corrected HbA1c from 7.8 to 7.2");
 *   await admin.pipelineExecutions.approve(executionId);
 * }
 * ```
 */
export declare function createPipelineExecutionsNamespace(rb: RequestBuilder): {
    /**
     * Get a pipeline execution by ID.
     *
     * @param id - Execution UUID.
     * @param options - Optional request options.
     * @returns PipelineExecution resource.
     */
    get(id: string, options?: RequestOptions): Promise<unknown>;
    /**
     * List pipeline executions for a workspace.
     *
     * @param workspaceId - Workspace UUID to filter by.
     * @param filters - Optional additional filters (status).
     * @param options - Optional request options.
     * @returns Array of PipelineExecution resources.
     */
    list(workspaceId: string, filters?: {
        status?: PipelineExecutionStatus;
    }, options?: RequestOptions): Promise<unknown>;
    /**
     * Approve the current checkpoint. Pipeline resumes with current checkpoint_data.
     * Only valid when status === "awaiting_approval".
     *
     * @param id - Execution UUID.
     * @param options - Optional request options.
     */
    approve(id: string, options?: RequestOptions): Promise<unknown>;
    /**
     * Reject the current checkpoint. Pipeline halts — no downstream nodes run.
     * Only valid when status === "awaiting_approval".
     *
     * @param id - Execution UUID.
     * @param options - Optional request options.
     */
    reject(id: string, options?: RequestOptions): Promise<unknown>;
    /**
     * Edit checkpoint_data before approving.
     * Only valid when status === "awaiting_approval".
     * Corrected values flow into all downstream pipeline nodes.
     *
     * @param id - Execution UUID.
     * @param attributes - Fields to update.
     * @param options - Optional request options.
     */
    updateCheckpoint(id: string, attributes: UpdateCheckpointAttributes, options?: RequestOptions): Promise<unknown>;
    /**
     * Set the checkpoint note. Replaces any existing note.
     * Only valid when status === "awaiting_approval".
     *
     * @param id - Execution UUID.
     * @param note - Note text.
     * @param options - Optional request options.
     */
    addNote(id: string, note: string, options?: RequestOptions): Promise<unknown>;
    /**
     * Request AI refinement of a specific checkpoint node.
     * Only valid when status === "awaiting_approval".
     *
     * @param id - Execution UUID.
     * @param nodeId - The node ID to re-run with the instruction.
     * @param instruction - Natural language instruction for the refinement.
     * @param options - Optional request options.
     */
    aiRefine(id: string, nodeId: string, instruction: string, options?: RequestOptions): Promise<unknown>;
};
//# sourceMappingURL=pipeline-executions.d.ts.map