/** * Builders for the `run`/`resume` {@link WorkerInboundMessage} envelopes the * {@link import('./worker-execution-strategy.ts').WorkerExecutionStrategy} sends to a * worker. Extracted as free functions so the strategy stays under the line cap and the * envelope-construction rules (protocol version, turn id, size cap, host-log-sink * stamping) live in one place. The strategy keeps ownership of the turn-id counter and * the assert-and-send; these functions only assemble the message. * * @module core/worker-inbound-message */ import type { OperationOutcome, WorkerInboundMessage } from './types.ts'; /** The turn-protocol context every inbound message carries, owned by the strategy. */ export interface WorkerInboundMessageContext { turnId: number; maxProtocolMessageBytes: number | undefined; /** Whether the engine host installed an `onLog` sink; stamps `hostHasLogSink` (#529). */ hasLogSink: boolean; } /** Build a `run` inbound message from start parameters and the turn context. */ export declare function buildRunMessage(parameters: { workflowId: string; workflowExecutionToken?: string; revision?: string; workflowType: string; input: unknown; checkpoint: ArrayBuffer; executionStateOwnerId?: string; deadline?: number; headers?: [string, string][]; }, context: WorkerInboundMessageContext): WorkerInboundMessage & { type: 'run'; }; /** Build a `resume` inbound message from resume parameters and the turn context. */ export declare function buildResumeMessage(parameters: { workflowId: string; checkpoint: ArrayBuffer; operationResult: OperationOutcome; }, context: WorkerInboundMessageContext): WorkerInboundMessage & { type: 'resume'; };