import { type AxAIService } from '@ax-llm/ax';
import type { TraceAnalysisStore } from './store';
export interface AnalyzeTracesInput {
    /** The user-facing question. Domain framing belongs here, not in the
     *  actor description. */
    question: string;
}
export interface AnalyzeTracesResult {
    /** The responder's prose answer. */
    answer: string;
    /** Bulleted findings extracted from the responder's structured output. */
    findings: string[];
    /** Per-actor-turn snapshots captured via `actorTurnCallback`. */
    turns: AnalyzeTracesTurnSnapshot[];
    /** Total turns the actor took. */
    turnCount: number;
    /** Token usage by role. */
    usage: TraceAnalystUsage;
    /** Full system + assistant + tool message log by role. */
    chatLog: TraceAnalystChatLog;
    /** Prompt version that produced this run. */
    actorPromptVersion: string;
}
export interface TraceAnalystUsage {
    actor: TraceAnalystUsageEntry[];
    responder: TraceAnalystUsageEntry[];
}
export interface TraceAnalystUsageEntry {
    [key: string]: unknown;
}
export interface TraceAnalystChatLog {
    actor: TraceAnalystChatMessage[];
    responder: TraceAnalystChatMessage[];
}
export interface TraceAnalystChatMessage {
    [key: string]: unknown;
}
export interface AnalyzeTracesTurnSnapshot {
    turn: number;
    isError: boolean;
    /** The JS code the actor produced for this turn. */
    code: string;
    /** The formatted action-log entry the actor sees on the next turn. */
    output: string;
    /** Provider thought (when `actorOptions.showThoughts` is true and the
     *  provider returns it). */
    thought?: string;
}
export interface AnalyzeTracesOptions {
    /** Trace data source. Pass either an OTLP-JSONL path or a custom store. */
    source: string | TraceAnalysisStore;
    /** Caller-provided AxAIService. */
    ai: AxAIService;
    /** Model id forwarded to actor + responder. */
    model?: string;
    /** Recursion depth. 0 = no sub-agent dispatch. Default 1. */
    maxDepth?: number;
    /** Maximum actor turns. Default 12. */
    maxTurns?: number;
    /** Maximum parallel sub-agent calls in batched llmQuery. Default 2. */
    maxParallelSubagents?: number;
    /** Override the actor description. */
    actorDescription?: string;
    /** Override the subagent description. */
    subagentDescription?: string;
    /** Per-turn observability hook. */
    onTurn?: (turn: AnalyzeTracesTurnSnapshot) => void | Promise<void>;
    /** Override max runtime characters per turn. Default 6000. */
    maxRuntimeChars?: number;
    /** When set, every turn's snapshot is appended to this JSONL file
     *  immediately. If the analyst crashes mid-loop (provider 503,
     *  network error, validator reject) the partial reasoning is still
     *  on disk. Replay the file with the responder afterward to recover
     *  evidence. */
    progressLogPath?: string;
}
/**
 * Run the trace analyst.
 *
 * Throws:
 *   - `TraceFileMissingError` if `source` is a path and doesn't exist.
 *   - `AxAgentClarificationError` if the analyst asks for clarification.
 *   - Provider errors (auth, rate limits) propagate from the AI service.
 */
export declare function analyzeTraces(input: AnalyzeTracesInput, options: AnalyzeTracesOptions): Promise<AnalyzeTracesResult>;
//# sourceMappingURL=analyst.d.ts.map