import { type ApiSuccess } from '../../types/api/success';
import { type ItemsMap } from '../../types/field';
import { type MetricQuery } from '../../types/metricQuery';
export declare const AI_DEEP_RESEARCH_RUN_STATUSES: readonly ["queued", "running", "completed", "partially_completed", "failed", "cancelled"];
export type AiDeepResearchRunStatus = (typeof AI_DEEP_RESEARCH_RUN_STATUSES)[number];
export declare const AI_DEEP_RESEARCH_TERMINAL_STATUSES: readonly ["completed", "partially_completed", "failed", "cancelled"];
export type AiDeepResearchTerminalStatus = (typeof AI_DEEP_RESEARCH_TERMINAL_STATUSES)[number];
export declare const isAiDeepResearchRunTerminal: (status: AiDeepResearchRunStatus) => status is AiDeepResearchTerminalStatus;
export type AiDeepResearchBudget = {
    maxRuntimeMs: number;
    maxTokens: number;
    maxToolCalls: number;
    maxWarehouseQueries: number;
    maxResultRows: number;
};
export declare const AI_DEEP_RESEARCH_EFFORTS: readonly ["low", "medium", "high", "xhigh"];
export type AiDeepResearchEffort = (typeof AI_DEEP_RESEARCH_EFFORTS)[number];
export type AiDeepResearchRequestBody = {
    prompt: string;
    /** Server-owned execution budget tier. Defaults to medium. */
    effort?: AiDeepResearchEffort;
    /** Agent thread to attach the run to. Must be owned by the caller. */
    threadUuid?: string;
    /** Thread message that captured this prompt. Requires threadUuid. */
    promptUuid?: string;
};
export declare const AI_DEEP_RESEARCH_CONFIDENCE_LEVELS: readonly ["low", "medium", "high"];
export type AiDeepResearchConfidence = (typeof AI_DEEP_RESEARCH_CONFIDENCE_LEVELS)[number];
export type AiDeepResearchChartConfig = {
    defaultVizType: 'table' | 'bar' | 'horizontal' | 'line' | 'scatter' | 'pie' | 'funnel';
    xAxisDimension: string | null;
    yAxisMetrics: string[] | null;
    groupBy: string[] | null;
    xAxisType: 'category' | 'time' | null;
    stackBars: boolean | null;
    lineType: 'line' | 'area' | null;
    funnelDataInput: 'row' | 'column' | null;
    xAxisLabel: string;
    yAxisLabel: string;
    secondaryYAxisMetric: string | null;
    secondaryYAxisLabel: string | null;
};
export type AiDeepResearchChartSnapshotValue = string | number | boolean | null;
/** The rendered dataset of a report chart, frozen at publish time. */
export type AiDeepResearchChartSnapshot = {
    takenAt: string;
    rowCount: number;
    truncated: boolean;
    /** Field ids ordering the values in each row. */
    columnOrder: string[];
    /** Raw row values ordered by `columnOrder`; formatted client-side. */
    rows: AiDeepResearchChartSnapshotValue[][];
};
/**
 * Everything the UI needs to render one report chart, keyed by chart key in
 * `AiDeepResearchRun.resultChartData`. Written entirely by the backend at
 * publish time; the markdown only carries [title](#chart-<key>) references.
 */
export type AiDeepResearchChartData = {
    source: 'warehouse' | 'inline';
    title: string;
    chartConfig: AiDeepResearchChartConfig;
    /** Warehouse charts: the verified execution this chart is evidence of. */
    queryUuid: string | null;
    /** Inline charts: verified executions the data was derived from. */
    derivedFrom: string[] | null;
    /** Real for warehouse charts, synthesized for inline ones. */
    metricQuery: MetricQuery;
    /** Selected + filter fields; drives labels and value formatting. */
    fields: ItemsMap;
    /** Null only for reports persisted before snapshots existed. */
    snapshot: AiDeepResearchChartSnapshot | null;
};
export type AiDeepResearchChartDataMap = Record<string, AiDeepResearchChartData>;
export declare const AI_DEEP_RESEARCH_EVENT_TYPES: readonly ["status_changed", "cancellation_requested", "progress"];
export type AiDeepResearchEventType = (typeof AI_DEEP_RESEARCH_EVENT_TYPES)[number];
export declare const AI_DEEP_RESEARCH_PHASES: readonly ["planning", "investigating", "validating", "synthesizing"];
export type AiDeepResearchPhase = (typeof AI_DEEP_RESEARCH_PHASES)[number];
export declare const AI_DEEP_RESEARCH_ACTIVITIES: readonly ["lightdash_metadata", "warehouse_query", "web_search", "web_fetch", "reporting"];
export type AiDeepResearchActivity = (typeof AI_DEEP_RESEARCH_ACTIVITIES)[number];
export type AiDeepResearchProgress = {
    phase: AiDeepResearchPhase;
    activity: AiDeepResearchActivity | null;
    current: number | null;
    total: number | null;
};
export type AiDeepResearchEventPayloadMap = {
    status_changed: {
        status: AiDeepResearchRunStatus;
    };
    cancellation_requested: Record<string, never>;
    progress: {
        progress: AiDeepResearchProgress;
    };
};
export type AiDeepResearchEventPayload = {
    status: AiDeepResearchRunStatus;
} | Record<string, never> | {
    progress: AiDeepResearchProgress;
};
export type AiDeepResearchEvent = {
    aiDeepResearchEventUuid: string;
    aiDeepResearchRunUuid: string;
    eventType: 'status_changed';
    payload: {
        status: AiDeepResearchRunStatus;
    };
    createdAt: string;
} | {
    aiDeepResearchEventUuid: string;
    aiDeepResearchRunUuid: string;
    eventType: 'cancellation_requested';
    payload: Record<string, never>;
    createdAt: string;
} | {
    aiDeepResearchEventUuid: string;
    aiDeepResearchRunUuid: string;
    eventType: 'progress';
    payload: {
        progress: AiDeepResearchProgress;
    };
    createdAt: string;
};
export type AiDeepResearchRun = {
    aiDeepResearchRunUuid: string;
    projectUuid: string;
    aiThreadUuid: string | null;
    promptUuid: string | null;
    prompt: string;
    status: AiDeepResearchRunStatus;
    /** The report narrative with [title](#chart-<key>) chart references. */
    resultMarkdown: string | null;
    /** Render data for each referenced chart, keyed by chart key. */
    resultChartData: AiDeepResearchChartDataMap | null;
    budget: AiDeepResearchBudget;
    errorMessage: string | null;
    cancellationRequestedAt: string | null;
    createdAt: string;
    updatedAt: string;
    startedAt: string | null;
    completedAt: string | null;
};
export type AiDeepResearchEventsPage = {
    events: AiDeepResearchEvent[];
    nextCursor: string | null;
};
export type ApiAiDeepResearchRunResponse = ApiSuccess<AiDeepResearchRun>;
export type ApiAiDeepResearchRunListResponse = ApiSuccess<AiDeepResearchRun[]>;
export type ApiAiDeepResearchEventsResponse = ApiSuccess<AiDeepResearchEventsPage>;
export type AiDeepResearchJobPayload = {
    aiDeepResearchRunUuid: string;
};
//# sourceMappingURL=types.d.ts.map