import type { SandboxValue } from "./values.js"; import { type PendingHostCallPolicyMode } from "../snapshot/policy.js"; export type HostCallLifecycle = "created" | "running" | "settled" | "consumed" | "cancelled"; export type HostCallOutcome = { status: "fulfilled"; value: SandboxValue; } | { status: "rejected"; reason: SandboxValue; }; export type HostCallRecord = { id: string; runId: string; sourceHash: string; moduleId: string; operation: string; argumentDigest: string; policy: PendingHostCallPolicyMode; lifecycle: HostCallLifecycle; outcome?: HostCallOutcome; }; export type HostCallResumeProof = { callId: string; sourceHash: string; moduleId: string; operation: string; argumentDigest: string; outcome: HostCallOutcome; }; export type HostCallResumeRequest = Omit & { callId: string; requirement: "external-reconciliation"; }; export type HostCallResumeProvider = (request: HostCallResumeRequest) => HostCallResumeProof | Promise; export declare class HostCallResumabilityError extends Error { readonly action: "reset" | "external-reconciliation"; readonly callId: string; readonly lifecycle: HostCallLifecycle; constructor(record: HostCallRecord, action: "reset" | "external-reconciliation", message: string); } export declare class HostCallJournal { private readonly sourceHash; private readonly resumeProvider?; readonly runId: string; private nextCall; private readonly records; private readonly restored; constructor(sourceHash: string, records?: readonly HostCallRecord[], resumeProvider?: HostCallResumeProvider | undefined); issue(input: { moduleId: string; operation: string; argumentDigest: string; policy: PendingHostCallPolicyMode; }): { record: HostCallRecord; restored: boolean; }; private createRecord; start(record: HostCallRecord): void; settle(record: HostCallRecord, outcome: HostCallOutcome): void; consume(record: HostCallRecord): void; cancel(record: HostCallRecord, reason: SandboxValue): void; reconcile(record: HostCallRecord): Promise; snapshot(): HostCallRecord[]; } export declare function digestHostCallArguments(args: readonly unknown[]): string;