/**
 * Session capture — write side.
 *
 * Hooks (`scripts/prompt-recall-hook.mjs`, `scripts/stop-hook.mjs`,
 * `scripts/session-end-hook.mjs`, etc.) call `recordEvent()` or the
 * batched `recordEvents()` to persist turn-by-turn events into the
 * `session_events` table. The timeline reader in `./timeline.ts`
 * then reassembles them into the replay stream.
 *
 * Distinct from the summary `sessions` table (one row per session)
 * and from `defence_audit` (one row per scan). Captures every event
 * with enough fidelity to scrub/replay.
 */
/**
 * Six kinds the schema CHECK constraint enforces. Keeping these in
 * sync with `schema.sql` is load-bearing — adding a new kind requires
 * both a schema migration and a code update here.
 */
export type SessionEventKind = 'prompt' | 'response' | 'tool_call' | 'tool_result' | 'tool_error' | 'hook_fire';
export interface SessionEventInput {
    session_id: string;
    /** ISO-8601 timestamp string. Caller-supplied so import order is preserved. */
    ts: string;
    kind: SessionEventKind;
    /**
     * Payload — object (auto-serialised to JSON) or string (stored as-is).
     * Strings are kept verbatim so JSONL importers can pass through raw
     * content without double-encoding.
     */
    payload: unknown;
    project?: string | null;
    actor?: string | null;
    duration_ms?: number | null;
    audit_id?: number | null;
}
/** Insert one event row. Returns the new row id. */
export declare function recordEvent(input: SessionEventInput): number;
/**
 * Batched insert wrapped in a single transaction. Used when a hook
 * fires and produces several events at once (e.g. stop-hook emitting
 * a `response` plus N tool_call/tool_result pairs from the just-
 * finished turn). All-or-nothing: a CHECK violation rolls back the
 * lot, so the table never holds half a turn.
 */
export declare function recordEvents(inputs: readonly SessionEventInput[]): number[];
