import type { ServerWebSocket } from 'bun'; import type { FleetEventFeed } from './fleet-event-feed.ts'; import { type JsonRpcWebSocketSession } from './json-rpc-websocket.ts'; import type { OperationRegistry } from './operation-catalog.ts'; import { type Principal } from './principal.ts'; import type { WorkflowEventFeed } from './workflow-event-feed.ts'; export type ConnectionType = 'worker' | 'stream' | 'watch' | 'generic' | 'jsonrpc'; export interface WebSocketData { pathname: string; connectionType: ConnectionType; workflowId?: string; resumeFrom?: number; queue?: string; workerId?: string; workerRegistered?: boolean; workerProtocolVersion?: number; streamLastDeliveredSequence?: number; streamReplayInProgress?: boolean; pendingStreamMessages?: Array<{ sequence: number; message: string; }>; watchLastDeliveredSequence?: number; watchReplayInProgress?: boolean; pendingWatchMessages?: Array<{ sequence: number; message: string; }>; workflowStreamConnectionAccepted?: boolean; principal?: Principal; jsonRpcSession?: JsonRpcWebSocketSession; } export declare function handleJsonRpcWebSocketMessage(ws: Pick, 'data' | 'close'>, rawMessage: string | Buffer): void; export declare function openJsonRpcWebSocketSession(options: { ws: Pick, 'data' | 'send' | 'close'>; registry: OperationRegistry; engine: unknown; feed: WorkflowEventFeed; fleetFeed?: FleetEventFeed; activeSessions: Set; }): void; export declare function closeJsonRpcWebSocketSession(options: { session: JsonRpcWebSocketSession | undefined; activeSessions: Set; }): void; export declare function closeJsonRpcSessionsForShutdown(activeSessions: Set): Promise;