/** * Plain-data protocol for the isolated declarative configuration evaluator. * * Neither side trusts structured clone to preserve prototypes, descriptors, or * frozen state. Every received envelope is inspected through own property * descriptors, rebuilt with a null prototype, and frozen before use. * * @module */ import { type DeclarativeConfigErrorCode, type DeclarativeConfigErrorPhase, type DeclarativeConfigErrorReason, DeclarativeConfigEvaluationError, type DeclarativeConfigFileName, type DeclarativeConfigSourceLocation, type PreparedDeclarativeConfigWorkerPayload } from "./declarative-evaluator.js"; import { type ConfigSnapshotRecord } from "./snapshot.js"; /** Version of the worker request/response envelope contract. */ export declare const DECLARATIVE_CONFIG_WORKER_PROTOCOL_VERSION = 2; /** The already-coupled cache identity and evaluator input sent to the worker. */ export type DeclarativeConfigWorkerRequest = PreparedDeclarativeConfigWorkerPayload; /** Serializable fields retained from a typed evaluator failure. */ export interface DeclarativeConfigWorkerErrorDTO { readonly code: DeclarativeConfigErrorCode; readonly phase: DeclarativeConfigErrorPhase; readonly reason: DeclarativeConfigErrorReason; readonly location: DeclarativeConfigSourceLocation | null; readonly retryable: boolean; } /** Successful worker response. */ export interface DeclarativeConfigWorkerSuccessResponse { readonly ok: true; readonly snapshot: ConfigSnapshotRecord; } /** Failed worker response. */ export interface DeclarativeConfigWorkerErrorResponse { readonly ok: false; readonly error: DeclarativeConfigWorkerErrorDTO; } /** Exact one-shot response emitted by the evaluator worker. */ export type DeclarativeConfigWorkerResponse = DeclarativeConfigWorkerSuccessResponse | DeclarativeConfigWorkerErrorResponse; /** Infrastructure failures that can be created outside the evaluator. */ export type DeclarativeConfigWorkerInfrastructureReason = "worker-aborted" | "worker-overloaded" | "worker-protocol" | "worker-memory-limit-unavailable" | "worker-timeout" | "worker-unavailable"; /** * Build a typed failure for worker lifecycle and protocol errors. * * The caller owns the retry policy because aborts and host availability have * different retry semantics. */ export declare function createDeclarativeConfigWorkerInfrastructureError(reason: DeclarativeConfigWorkerInfrastructureReason): DeclarativeConfigEvaluationError; /** * Validate and detach one worker request. * * Resource and language semantics remain the evaluator's responsibility; this * boundary only accepts the exact direct-input shape and plain string data. */ export declare function decodeDeclarativeConfigWorkerRequest(value: unknown): DeclarativeConfigWorkerRequest; /** Create the exact success envelope emitted by the worker. */ export declare function createDeclarativeConfigWorkerSuccessResponse(snapshot: unknown): DeclarativeConfigWorkerSuccessResponse; /** * Create the exact failure envelope emitted by the worker. * * Unknown or malformed failures are deliberately collapsed to a retryable * availability error; arbitrary names, messages, stacks, and prototypes never * cross the boundary. */ export declare function createDeclarativeConfigWorkerErrorResponse(error: unknown): DeclarativeConfigWorkerErrorResponse; /** * Decode one worker response. * * A valid failure envelope is rethrown as a fresh local typed error. A success * is recanonicalized so callers never observe structured-clone prototypes or * mutable descriptors. */ export declare function decodeDeclarativeConfigWorkerResponse(value: unknown, maximumSourceOffset: number, expectedFileName?: DeclarativeConfigFileName): DeclarativeConfigWorkerSuccessResponse; //# sourceMappingURL=declarative-evaluator-worker-protocol.d.ts.map