import type { UnhashedRecord } from '../core/record.js'; import type { HookPayload } from './payloads.js'; /** * Hook ingestion. Two invariants dominate this module: * * 1. FAIL-OPEN — a recorder must never break the session it observes. The * public entry point catches everything, spills what it could not append, * and reports success to the harness. * 2. MINIMAL DATA — the ledger stores digests and short summaries, not full * tool payloads. The digest still pins the transcript: anyone holding the * transcript can recompute digests and prove it matches this ledger. */ export interface IngestContext { readonly now: () => Date; readonly harness: string; /** Store root for claim relativization; defaults to the payload cwd. */ readonly root?: string; } /** Pure: payload → unsealed record fields (no seq/prev, the store assigns those). */ export declare function buildRecordFromPayload(payload: HookPayload, context?: IngestContext): Omit | undefined; export interface IngestResult { readonly status: 'appended' | 'skipped' | 'spilled'; readonly seq?: number; readonly error?: string; } /** Side-effecting entry point used by `nightwatch hook`. Never throws. */ export declare function ingest(payload: HookPayload, projectRoot: string, context?: IngestContext): Promise;