import type { ParsedPayload } from "../../../hooks/adapter/parse.js"; import { type EventAdapterIdV3 } from "../adapter-id.js"; import type { EventV3WriteMode } from "../control.js"; import type { HookSignalV3 } from "./hook.js"; import type { TurnRitualEvidenceV3 } from "./hook-base.js"; /** * Durable intake spool for hook signals, plus the producer diagnostics spool. * * A hook process appends its parsed signal here BEFORE reading or validating * any producer state, so a lost lease, a crash, or a state-format mismatch can * never destroy a delivered signal. Whichever process holds that session's * producer-state lease drains the spool in append order and deletes each * record only after its outcome is durably published. Intake records hold raw * payloads transiently under owner-only permissions; anything that cannot * become a ledger event is preserved in the diagnostics spool with raw content * fields reduced to byte counts and digests. */ declare const INTAKE_FORMAT: "harnery-v3-hook-intake"; declare const INTAKE_VERSION: 1; export interface HookIntakeRecordV3 { format: typeof INTAKE_FORMAT; format_version: typeof INTAKE_VERSION; mode: EventV3WriteMode; signal: HookSignalV3; payload: ParsedPayload; adapter: EventAdapterIdV3; instance_id: `inst_${string}`; producer_id: `prd_${string}`; build_id: `build_${string}`; platform: "linux" | "windows" | "macos" | "unknown"; bridge?: "codex-wsl"; adapterVersion?: string; harnessVersion?: string; monotonic_ns?: string; observed_at?: string; hook_name?: string; hook_duration_ms?: number; stop_remediation?: boolean; turn_ritual?: TurnRitualEvidenceV3; delegated_child?: { generation_id: `gen_${string}`; parent_generation_id: `gen_${string}`; delegation_id: `del_${string}`; caused_by_event_id: `evt_${string}`; }; } export interface HookIntakeGroupV3 { adapter: EventAdapterIdV3; session_hash: `hid_${string}`; directory: string; } export interface HookIntakeEntryV3 { path: string; name: string; /** Undefined when the file is unreadable or fails shape validation. */ record: HookIntakeRecordV3 | undefined; } export declare function hookIntakeGroupDirV3(coordRoot: string, adapter: EventAdapterIdV3, sessionHash: `hid_${string}`): string; export declare function appendHookIntakeRecordV3(coordRoot: string, sessionHash: `hid_${string}`, record: HookIntakeRecordV3): string; export declare function listHookIntakeGroupsV3(coordRoot: string): HookIntakeGroupV3[]; export declare function listHookIntakeRecordsV3(directory: string): HookIntakeEntryV3[]; export declare function removeIntakeRecordV3(path: string): void; /** * Preserve a signal that could not become a ledger event. Raw content fields * are reduced to byte counts and digests so the diagnostics spool never holds * prompt, tool input, or tool output bodies (invariant: delivered evidence is * never silently destroyed, and never re-exposed either). * * Identical emissions are bounded per (category, reason, instance) key and * UTC day: past the loose-exemplar limit the emission is coalesced into the * key's summary file. Returns the path of the durable record either way (the * loose file when admitted, the summary file when coalesced); `undefined` * means nothing durable was written. The gate is fail-open, so a mitigation * failure still produces the loose file. */ export declare function writeProducerDiagnosticV3(coordRoot: string, category: string, record: Record): string | undefined; export {}; //# sourceMappingURL=intake.d.ts.map