import type { KV } from "@nats-io/kv"; /** One answer to one checkpoint. `value` is the program's payload; `artifact` is the digest of * what the answerer actually saw, which is what makes an approval evidence rather than a claim. */ export interface CheckpointAnswerValue { readonly v: 1; readonly token: string; readonly answerId: string; /** Absent when the answer carries no payload — an approval that is only a "yes". */ readonly value?: unknown; readonly artifact?: string; /** WHO answered, as the run's own ACL knows them — never the presenting principal, which is the * driver for every answer and therefore discriminates nothing. */ readonly by: string; readonly at: number; } /** * The id an answer is filed under, DERIVED rather than random. * * A resolver that wrote its record and then crashed before presenting the token has to be able to * retry, and a fresh random id on the retry would file a second answer and leave the first one * unnameable. Deriving from the answer's own content makes the retry land on the same key with the * same bytes; two resolvers who genuinely answer the same thing are then indistinguishable, which * is correct, and two who answer differently get different ids and race on the settle, which is * what the settle is for. */ export declare function checkpointAnswerId(a: { token: string; by: string; value?: unknown; artifact?: string; }): string; /** * File an answer, create-only. * * A retry of the SAME answer is not a conflict: the id is derived from the content, so an existing * record under this id with identical bytes is this resolver's own earlier attempt and the call * succeeds. Different bytes under the same id would be a digest collision, which is refused rather * than overwritten. */ export declare function recordCheckpointAnswer(kv: KV, endpoint: string, value: CheckpointAnswerValue): Promise<{ key: string; created: boolean; }>; /** Read one answer. `undefined` = no answer was filed under this id. */ export declare function readCheckpointAnswer(kv: KV, endpoint: string, token: string, answerId: string): Promise; //# sourceMappingURL=checkpoint-answer.d.ts.map