import { z } from 'zod';
import { type ItemsMap } from '../../types/field';
import { type MetricQuery } from '../../types/metricQuery';
import { type AiDeepResearchChartConfig } from './types';
export declare const AI_DEEP_RESEARCH_CHART_LANGUAGE = "chart";
export declare const AI_DEEP_RESEARCH_MAX_CHARTS = 8;
export declare const AI_DEEP_RESEARCH_MAX_INLINE_ROWS = 100;
export declare const AI_DEEP_RESEARCH_MAX_INLINE_COLUMNS = 10;
/**
 * Whitelisted HTML tags allowed in report markdown, mapped to their allowed
 * attributes. Single source for the frontend sanitizer and the backend
 * markdown lint.
 */
export declare const AI_DEEP_RESEARCH_MARKDOWN_TAGS: Record<string, string[]>;
export declare const aiDeepResearchInlineColumnSchema: z.ZodObject<{
    id: z.ZodString;
    label: z.ZodString;
    type: z.ZodEnum<["string", "number", "boolean", "date"]>;
}, "strip", z.ZodTypeAny, {
    id: string;
    label: string;
    type: "string" | "number" | "boolean" | "date";
}, {
    id: string;
    label: string;
    type: "string" | "number" | "boolean" | "date";
}>;
/**
 * A chart backed by a completed run_metric_query execution. The backend
 * verifies the queryUuid and injects the snapshot at publish time.
 */
declare const warehouseChartObjectSchema: z.ZodObject<{
    source: z.ZodLiteral<"warehouse">;
    queryUuid: z.ZodString;
    title: z.ZodString;
    chartConfig: z.ZodType<AiDeepResearchChartConfig, z.ZodTypeDef, AiDeepResearchChartConfig>;
}, "strip", z.ZodTypeAny, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}>;
/**
 * A chart whose data the agent computed itself (derived analysis, MCP or
 * web data). Snapshot-only; `derivedFrom` cites the verified executions
 * the computation used, when any.
 */
declare const inlineChartObjectSchema: z.ZodObject<{
    source: z.ZodLiteral<"inline">;
    key: z.ZodString;
    title: z.ZodString;
    chartConfig: z.ZodType<AiDeepResearchChartConfig, z.ZodTypeDef, AiDeepResearchChartConfig>;
    columns: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        label: z.ZodString;
        type: z.ZodEnum<["string", "number", "boolean", "date"]>;
    }, "strip", z.ZodTypeAny, {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }, {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }>, "many">;
    rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">, "many">;
    derivedFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}, {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}>;
export declare const aiDeepResearchChartDefinitionSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"source", [z.ZodObject<{
    source: z.ZodLiteral<"warehouse">;
    queryUuid: z.ZodString;
    title: z.ZodString;
    chartConfig: z.ZodType<AiDeepResearchChartConfig, z.ZodTypeDef, AiDeepResearchChartConfig>;
}, "strip", z.ZodTypeAny, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}>, z.ZodObject<{
    source: z.ZodLiteral<"inline">;
    key: z.ZodString;
    title: z.ZodString;
    chartConfig: z.ZodType<AiDeepResearchChartConfig, z.ZodTypeDef, AiDeepResearchChartConfig>;
    columns: z.ZodArray<z.ZodObject<{
        id: z.ZodString;
        label: z.ZodString;
        type: z.ZodEnum<["string", "number", "boolean", "date"]>;
    }, "strip", z.ZodTypeAny, {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }, {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }>, "many">;
    rows: z.ZodArray<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>, "many">, "many">;
    derivedFrom: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}, {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}>]>, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
} | {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}, {
    source: "warehouse";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
} | {
    key: string;
    rows: (string | number | boolean | null)[][];
    source: "inline";
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    columns: {
        id: string;
        label: string;
        type: "string" | "number" | "boolean" | "date";
    }[];
    derivedFrom?: string[] | undefined;
}>;
export type AiDeepResearchWarehouseChart = z.infer<typeof warehouseChartObjectSchema>;
export type AiDeepResearchInlineChart = z.infer<typeof inlineChartObjectSchema>;
export type AiDeepResearchChartDefinition = z.infer<typeof aiDeepResearchChartDefinitionSchema>;
export declare const getDeepResearchChartKey: (chart: AiDeepResearchChartDefinition) => string;
/**
 * Synthesizes a fields map for an inline (agent-computed) chart so it renders
 * through the same pipeline as warehouse-backed charts: number columns become
 * metrics, everything else dimensions.
 */
export declare const buildInlineChartFields: (columns: AiDeepResearchInlineChart["columns"]) => ItemsMap;
/** Synthesizes a metric query describing an inline chart's embedded data. */
export declare const buildInlineChartMetricQuery: (chart: Pick<AiDeepResearchInlineChart, "columns" | "rows">) => MetricQuery;
export type AiDeepResearchChartRef = {
    key: string;
    title: string;
    /** Char range of the whole link in the markdown. */
    start: number;
    end: number;
    raw: string;
};
export declare const getDeepResearchChartRefMarkdown: (title: string, key: string) => string;
export declare const legacyDeepResearchChartBlockSchema: z.ZodObject<{
    queryUuid: z.ZodString;
    title: z.ZodString;
    chartConfig: z.ZodType<AiDeepResearchChartConfig, z.ZodTypeDef, AiDeepResearchChartConfig>;
}, "strip", z.ZodTypeAny, {
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}, {
    chartConfig: AiDeepResearchChartConfig;
    title: string;
    queryUuid: string;
}>;
export type LegacyAiDeepResearchChartBlock = z.infer<typeof legacyDeepResearchChartBlockSchema>;
export type AiDeepResearchChartBlockMatch = {
    start: number;
    end: number;
    raw: string;
    block: LegacyAiDeepResearchChartBlock | null;
    error: string | null;
};
export declare const findDeepResearchChartBlocks: (markdown: string) => AiDeepResearchChartBlockMatch[];
/** Splices char ranges out of a markdown document, back to front. */
export declare const spliceDeepResearchRanges: (markdown: string, replacements: Array<{
    match: {
        start: number;
        end: number;
    };
    replacement: string;
}>) => string;
export declare const findDeepResearchChartRefs: (markdown: string) => AiDeepResearchChartRef[];
export declare const countDeepResearchFindings: (markdown: string) => number;
/**
 * Validates a submitted report: the markdown structure and the referential
 * integrity between chart definitions (tool arguments) and the
 * [title](#chart-key) references in the markdown. Returns actionable errors
 * the agent can self-correct from.
 */
export declare const lintDeepResearchReport: (markdown: string, charts: AiDeepResearchChartDefinition[]) => string[];
export {};
//# sourceMappingURL=markdown.d.ts.map