/** The moments `openlore hook ` serves. */ export declare const HOOK_MOMENTS: readonly ["before-edit", "after-tools", "before-stop", "after-compact", "before-subagent", "subagent-start"]; export type HookMoment = typeof HOOK_MOMENTS[number]; /** Every agent-loop moment: the prompt-submitted moment (`openlore orient --inject`) and the hook moments. */ export declare const LOOP_MOMENTS: readonly ["prompt-submitted", "before-edit", "after-tools", "before-stop", "after-compact", "before-subagent", "subagent-start"]; export type LoopMoment = typeof LOOP_MOMENTS[number]; export declare function deliveredDir(root: string): string; export declare function deliveredPath(root: string, sessionId: string): string; /** Who a finding was shown to: the agent (hook context) or the user (the before-stop receipt). */ export type Audience = 'agent' | 'user'; /** One shown finding in the session record (change: hook-reliability, design section 3). */ export interface ShownFinding { code: string; subject: string; /** The moment that first showed it, and when. */ moment: string; shownAt: string; audiences: Audience[]; /** The check that produced it and the root-relative file it concerns, when known. */ check?: string; file?: string; /** * What happened to it (design section 4): `fixed` when the same check ran again on its file after * an agent edit and did not report it; `open` when the last stop receipt still reported it. * Unset is not assessed. `decided` is joined from decisions when `openlore status` runs. */ state?: FindingState; } export type FindingState = 'fixed' | 'open'; /** * The proof a finding rests on. With a cited line, its whitespace-normalized text is the proof and * the line NUMBER is left out, so lines added above it do not make it new. Without one, the * source's discriminator is (a run time, a return count, a kind). */ export interface FindingProof { path?: string; lineText?: string; discriminator?: string; } /** * A finding's identity: `sha256(code \0 subject \0 proofHash)`, and its printed id, the first 8 * hex characters (`f:1a2b3c4d`). One finding has one identity at every moment. */ export declare function findingIdentity(code: string, subject: string, proof?: FindingProof): { identity: string; id: string; }; /** * Per harness session: the facts already delivered (`keys`, still written so an older CLI reads * the record), the findings shown with their identity, and the commit the session started from. */ export interface SessionRecord { keys: Set; findings: Record; startHead?: string; } export declare function readSession(root: string, sessionId: string | undefined): SessionRecord; /** * Whether this finding was already shown to `audience` in the session. A finding marked fixed that * is reported again counts as not shown: it came back. */ export declare function wasShown(rec: SessionRecord, identity: string, audience: Audience): boolean; /** Record that a finding was shown to `audience` at `moment` (a fixed finding that came back is open again). */ export declare function markShown(rec: SessionRecord, identity: string, f: { code: string; subject: string; check?: string; file?: string; }, moment: string, audience: Audience): void; /** * After `check` ran to completion on `files` (root-relative) following an agent edit: every finding * it showed earlier on one of those files that it did not report now (`reported` identities) is * fixed. A check that failed or timed out must not call this: it proves nothing. */ export declare function markFixed(rec: SessionRecord, check: string, files: readonly string[], reported: ReadonlySet): void; /** The stop receipt still reports these: they are open (unless fixed later). */ export declare function markOpen(rec: SessionRecord, reported: ReadonlySet): void; /** * Write the session record, merged with what a concurrent hook of the same session wrote meanwhile * (the harness runs matching hooks in parallel). Records untouched for a week are removed. */ export declare function writeSession(root: string, sessionId: string | undefined, rec: SessionRecord): Promise; //# sourceMappingURL=hook-session.d.ts.map