export declare const TRACE_AGENT_STATE_VERSION: 1;
export type TraceAgentDefaultLoopMode = 'hypothesis_experiment';
export type TraceAgentDefaultResponseView = 'conclusion_evidence';
export interface TraceAgentPreferences {
    /** Max experiments to run automatically per user turn */
    maxExperimentsPerTurn: number;
    /** Default orchestration mode (user preference) */
    defaultLoopMode: TraceAgentDefaultLoopMode;
    /** Default UI response view preference */
    defaultResponseView: TraceAgentDefaultResponseView;
    /** Preferred output language */
    language: 'zh';
    /** Quality first (no hard cost/latency constraints) */
    qualityFirst: true;
}
export interface TraceAgentGoalSpec {
    /** User's stated goal (may be refined by intent later) */
    userGoal: string;
    /** Optional: refined/normalized goal from intent understanding */
    normalizedGoal?: string;
    /** Optional: what counts as "done" for this session */
    doneWhen?: string[];
    /** Optional: stop conditions (budget, low info gain, need user input, etc.) */
    stopWhen?: string[];
}
export interface TraceAgentCoverage {
    /** Entities already covered/inspected */
    entities: {
        frames: string[];
        sessions: string[];
    };
    /** Time ranges already covered */
    timeRanges: Array<{
        start: string;
        end: string;
    }>;
    /** Domains already covered (frame/cpu/binder/memory/...) */
    domains: string[];
    /** Packages/process names already covered (best-effort) */
    packages: string[];
}
export interface TraceAgentTurnLogEntry {
    id: string;
    turnIndex: number;
    timestamp: number;
    query: string;
    followUpType?: string;
    intentPrimaryGoal?: string;
    conclusionSummary?: string;
    confidence?: number;
}
export interface TraceAgentHypothesis {
    id: string;
    mechanism: string;
    status: 'proposed' | 'investigating' | 'confirmed' | 'rejected';
    confidence: number;
    supportingEvidenceIds: string[];
    contradictingEvidenceIds: string[];
    gaps: string[];
    createdAt: number;
    updatedAt: number;
}
export interface TraceAgentEvidence {
    id: string;
    kind: 'sql' | 'skill' | 'derived';
    title: string;
    digest: string;
    traceId: string;
    createdAt: number;
    /** Provenance (best-effort; JSON-safe) */
    source?: Record<string, any>;
}
export interface TraceAgentExperiment {
    id: string;
    type: 'run_skill' | 'run_sql' | 'repair_sql' | 'ask_user' | 'stop';
    objective: string;
    status: 'planned' | 'running' | 'succeeded' | 'failed' | 'skipped';
    createdAt: number;
    updatedAt: number;
    producedEvidenceIds: string[];
    error?: string;
}
export interface TraceAgentContradiction {
    id: string;
    description: string;
    severity: 'minor' | 'major' | 'critical';
    createdAt: number;
    resolvedAt?: number;
    evidenceIds: string[];
    hypothesisIds: string[];
    resolutionExperimentIds: string[];
}
export interface TraceAgentState {
    version: number;
    sessionId: string;
    traceId: string;
    createdAt: number;
    updatedAt: number;
    goal: TraceAgentGoalSpec;
    preferences: TraceAgentPreferences;
    coverage: TraceAgentCoverage;
    turnLog: TraceAgentTurnLogEntry[];
    hypotheses: TraceAgentHypothesis[];
    evidence: TraceAgentEvidence[];
    experiments: TraceAgentExperiment[];
    contradictions: TraceAgentContradiction[];
}
export declare function createInitialTraceAgentState(params: {
    sessionId: string;
    traceId: string;
    userGoal: string;
    now?: number;
}): TraceAgentState;
export declare function migrateTraceAgentState(snapshot: any, expected: {
    sessionId: string;
    traceId: string;
}): TraceAgentState;
export declare function summarizeTraceAgentState(state: TraceAgentState): {
    version: number;
    goal: string;
    maxExperimentsPerTurn: number;
    turns: number;
    updatedAt: number;
};
//# sourceMappingURL=traceAgentState.d.ts.map