import type { AgentDetails, AgentState, DebugSession, TraceEventWithId } from "../types.js";
import type { DebugContext } from "../tools/index.js";
export type EvidenceSource = "memory" | "runtime_proxy" | "memory+runtime_proxy";
export interface SessionEvidenceOptions {
    sessionId?: string;
    projectId?: string;
    traceLimit?: number;
    types?: string[];
    preferRuntime?: boolean;
    fetchTraces?: boolean;
}
export interface SessionEvidence {
    sessionId: string;
    projectId?: string;
    source: EvidenceSource;
    session?: DebugSession;
    runtimeSession?: JsonRecord;
    agentId?: string;
    agentName?: string;
    agentDetails?: AgentDetails;
    state?: AgentState;
    messages: JsonRecord[];
    events: TraceEventWithId[];
    traceMeta?: JsonRecord;
    traceTotal?: number;
    diagnostics: {
        memorySessionFound: boolean;
        memoryTraceCount: number;
        runtimeSessionFetched: boolean;
        runtimeTraceFetched: boolean;
        warnings: string[];
    };
}
export type SessionEvidenceResult = {
    ok: true;
    evidence: SessionEvidence;
} | {
    ok: false;
    sessionId?: string;
    error: string;
    hint?: string;
    diagnostics: SessionEvidence["diagnostics"];
};
export type JsonRecord = Record<string, unknown>;
export declare function loadSessionEvidence(ctx: DebugContext, options?: SessionEvidenceOptions): Promise<SessionEvidenceResult>;
export declare function filterEvidenceEvents(events: TraceEventWithId[], filter: {
    text?: string;
    types?: string[];
    agentName?: string;
    hasError?: boolean;
}): TraceEventWithId[];
export declare function isErrorLikeEvent(event: TraceEventWithId): boolean;
export declare function evidenceMessage(evidence: SessionEvidence): string | undefined;
export declare function formatEvidenceDiagnostics(evidence: SessionEvidence): JsonRecord;
export declare function sortEventsChronologically(events: TraceEventWithId[]): TraceEventWithId[];
export declare function sortEventsRecentFirst(events: TraceEventWithId[]): TraceEventWithId[];
export declare function applyLimit<T>(items: T[], limit?: number): T[];
//# sourceMappingURL=session-evidence.d.ts.map