import type { FailureCategory, WorkerInboundMessage, WorkerOutboundMessage } from './types.ts'; import type { WorkerTurnWatchdog } from './worker-turn-watchdog.ts'; export interface WorkerProtocolFailure { failureCategory: FailureCategory; error: string; targetWorkflowId?: string; otherError: string; } export declare class WorkerProtocolGuard { #private; constructor(maxProtocolMessageBytes: number | undefined, requireProtocolVersion: boolean, turnWatchdog: WorkerTurnWatchdog); validateHostToWorkerMessage(message: WorkerInboundMessage): WorkerProtocolFailure | null; acceptWorkerMessage(worker: Worker, message: unknown): { accepted: true; message: WorkerOutboundMessage; } | { accepted: false; failure: WorkerProtocolFailure; }; }