import type { TurnId } from '../types/ids/index.js'; import type { AnswerReviewContext } from '../types/session/answer-review.js'; /** Numbers are restricted to safe integers; use strings for exact decimal values. */ export type JsonClaimValue = string | number | boolean | null; export interface JsonClaimRequirement { readonly id: string; /** Host-selected source identifier, never an address supplied by the candidate. */ readonly source: string; /** RFC 6901 pointer to a scalar in the complete JSON document. */ readonly pointer: string; /** Optional postcondition in addition to candidate/source equality. */ readonly expected?: JsonClaimValue; } export interface JsonClaimReadRequest { readonly scope: string; readonly turnId: TurnId; readonly iteration: number; readonly requestId: string; readonly startedAt: number; /** Remaining total allowance. The host must bound capture, not only the returned buffer. */ readonly maxBytes: number; readonly signal: AbortSignal; } export interface JsonClaimObservation { readonly scope: string; readonly turnId: TurnId; readonly iteration: number; readonly requestId: string; readonly source: string; readonly observedAt: number; readonly complete: boolean; readonly kind: 'current' | 'historical'; readonly bytes: Uint8Array; } export interface JsonClaimReceipt { readonly scope: string; readonly turnId: TurnId; readonly iteration: number; readonly claims: Readonly>; readonly observations: readonly { readonly source: string; readonly requestId: string; readonly observedAt: number; readonly bytes: number; readonly sha256: string; }[]; } export type JsonClaimVerdict = { readonly accept: true; readonly receipt: JsonClaimReceipt; } | { readonly accept: false; readonly feedback: string; }; export interface JsonClaimVerifierOptions { /** Host-owned authorization scope, including the admitted revision/claim where applicable. */ readonly scope: string; readonly turnId: TurnId; readonly requirements: readonly JsonClaimRequirement[]; /** * Trusted, read-only adapter. Enforce access, capture bounds and cancellation; * observe during this call. A matching envelope is not authentication against * a dishonest adapter. Do not replay an action or relabel an archive as current. */ readonly observe: (source: string, request: JsonClaimReadRequest) => Promise; /** Total captured source bytes per verification; default 1 MiB, at most 8 MiB. */ readonly maxBytes?: number; /** Whole verification deadline; default 2 seconds, at most 30 seconds. */ readonly timeoutMs?: number; } export interface JsonClaimVerifier { /** False while an observer is outstanding, including after timeout/cancellation. */ isDrained(): boolean; /** No success cache. Every call observes the configured sources again. */ verify(claims: unknown, context: Pick): Promise; } /** * Compare explicit candidate fields with fresh, host-authorized JSON observations. * This does not judge prose or prove the broader task complete. A receipt describes * observation time, not an atomic snapshot or continuing truth after the read. */ export declare function createJsonClaimVerifier(options: JsonClaimVerifierOptions): JsonClaimVerifier; //# sourceMappingURL=json-claim-verifier.d.ts.map