/**
 * JSONL transcript importer for Claude Code session files.
 *
 * Claude Code writes session transcripts to `~/.claude/projects/<slug>/
 * <session-uuid>.jsonl`. Each line is a JSON object. Conversation lines
 * have shape `{type, sessionId, timestamp, message: {role, content}}`
 * where `content` is an Anthropic SDK content-block array
 * (`text|thinking|tool_use|tool_result`).
 *
 * Mapping to `session_events.kind`:
 *
 *   user.text         → prompt
 *   assistant.text    → response
 *   assistant.tool_use → tool_call
 *   user.tool_result  → tool_result
 *   thinking          → (skipped — not user-replayable in v1)
 *
 * Non-conversation lines (`ai-title`, `attachment`, `system`,
 * `queue-operation`, etc.) are skipped. Idempotent on re-import: each
 * row carries a sha256 `content_hash` of `kind|payload`, and the
 * `idx_session_events_dedupe` UNIQUE index drops collisions silently
 * via `INSERT OR IGNORE`.
 *
 * Lossy by design — agentmemory documents the same scope:
 *   - Anthropic-internal cache markers, partial-message frames, and
 *     non-string tool_result encodings beyond plain text are not
 *     preserved.
 *   - Things we WILL preserve: prompts, assistant text, tool name +
 *     args + result, and timestamps.
 */
import type { SessionEventInput } from './capture.js';
export interface TranscriptLine {
    type?: string;
    sessionId?: string;
    timestamp?: string;
    message?: {
        role?: 'user' | 'assistant';
        content?: ContentBlock[];
    };
}
type ContentBlock = {
    type: 'text';
    text?: string;
} | {
    type: 'thinking';
    thinking?: string;
} | {
    type: 'tool_use';
    id?: string;
    name?: string;
    input?: unknown;
} | {
    type: 'tool_result';
    tool_use_id?: string;
    content?: unknown;
} | {
    type: string;
    [key: string]: unknown;
};
export interface ImportResult {
    sessionId: string | null;
    eventCount: number;
    /** Lines that produced zero events — non-conversation types + parse errors. */
    skipped: number;
    /** Lines whose JSON parsed but were rejected (missing required fields, unknown block types). */
    malformed: number;
}
/**
 * Pure mapper: one transcript line → 0..N `SessionEventInput`s.
 *
 * Exported so unit tests can exercise the mapping in isolation without
 * standing up a database. Returns `[]` for any line that doesn't yield
 * replayable events (thinking blocks, ai-title, missing fields, etc.) —
 * the caller treats an empty array as "skipped".
 */
export declare function parseTranscriptLine(line: unknown): SessionEventInput[];
/**
 * Import one JSONL file. Streams the file in 64 KB chunks via `readSync`
 * and a `StringDecoder` (which handles UTF-8 sequences that span chunk
 * boundaries) so a 500 MB transcript archive doesn't load into a single
 * string. Parsed rows flush to SQLite in {@link FLUSH_BATCH_ROWS}-sized
 * transactional batches.
 *
 * Malformed lines do NOT throw — they're counted and skipped so a single
 * bad row never blocks the rest of the file. Idempotent on re-import via
 * the `INSERT OR IGNORE` + `idx_session_events_dedupe` UNIQUE index.
 */
export declare function importJsonlTranscript(path: string): ImportResult;
export {};
