/** Trace source loading and parsing for Claude JSONL / OpenClaw JSONL / generic markdown logs. */
import type { TraceSourceMetadata } from '../types/index.js';
export interface CcAssistantContent {
    type: 'thinking' | 'text' | 'tool_use';
    thinking?: string;
    text?: string;
    id?: string;
    name?: string;
    input?: Record<string, unknown>;
}
export interface CcAssistantRecord {
    type: 'assistant';
    uuid: string;
    parentUuid: string | null;
    sessionId: string;
    timestamp: string;
    cwd?: string;
    gitBranch?: string;
    entrypoint?: string;
    attributionSkill?: string;
    message: {
        role: 'assistant';
        model?: string;
        content: CcAssistantContent[];
        stop_reason?: string;
        usage?: {
            input_tokens?: number;
            output_tokens?: number;
            cache_read_input_tokens?: number;
            cache_creation_input_tokens?: number;
        };
    };
}
export interface CcUserToolResultContent {
    type: 'tool_result';
    tool_use_id: string;
    content: string;
    is_error?: boolean;
}
export interface CcUserTextContent {
    type: 'text';
    text: string;
}
export interface CcUserRecord {
    type: 'user';
    uuid: string;
    parentUuid: string | null;
    sessionId: string;
    timestamp: string;
    entrypoint?: string;
    message: {
        role: 'user';
        content: string | Array<CcUserTextContent | CcUserToolResultContent>;
    };
}
export type CcRecord = CcAssistantRecord | CcUserRecord | {
    type: string;
    [k: string]: unknown;
};
export type { TraceSourceMetadata } from '../types/index.js';
export interface CcSession {
    sessionId: string;
    /**
     * Logical parent session. For a directory shaped as:
     *   A/main.jsonl
     *   A/subagents/x1.jsonl
     *   A/subagents/x2.jsonl
     * all three traces share the same sessionGroupId, while sourcePath still
     * points at the concrete evidence file.
     */
    sessionGroupId?: string;
    sessionGroupPath?: string;
    traceId?: string;
    traceRole?: 'standalone' | 'main' | 'subagent';
    traceLabel?: string;
    sourcePath: string;
    sourceKind?: 'claude' | 'openclaw' | 'markdown_log' | 'unknown';
    records: unknown[];
    cwd?: string;
    gitBranch?: string;
    entrypoint?: string;
    sourceMetadata?: TraceSourceMetadata;
    startTimestamp?: string;
    endTimestamp?: string;
}
/**
 * 加载一个目录(或单个 JSONL/agent markdown log 文件)下的所有 session。
 * 递归扫描目录,覆盖 Claude Code 主 session 旁边的 subagents/*.jsonl,
 * 也支持 agent workspace/logs/*.log 里的 Markdown 对话记录。
 */
export declare function loadCcSessions(path: string): CcSession[];
//# sourceMappingURL=trace-source.d.ts.map