import type { PeerInfo, StreamEvent } from "./types.ts"; export type { PeerInfo } from "./types.ts"; export const ROUTE_TIMEOUT_MS = 300_000; export const MGMT_TIMEOUT_MS = 120_000; export const QUERY_TIMEOUT_MS = 60_000; export const SHUTDOWN_GRACE_MS = 5_000; /** Messages sent from Worker (container) to Supervisor (host) via stdout. */ export type WorkerMessage = | { type: "ready" } | { type: "ack"; messageId: string } | { type: "event"; conversationId: string; event: StreamEvent } | { type: "chat_done"; conversationId: string; messageId?: string } | { type: "route_request"; requestId: string; toId: string; message: string } | { type: "route_done"; requestId: string; response: string; messageId?: string } | { type: "mgmt_request"; requestId: string; action: string; targetId?: string; name?: string; content?: string } | { type: "bg_event"; source: string; conversationId: string; event: StreamEvent } | { type: "bg_done"; source: string; conversationId: string } | { type: "query_response"; requestId: string; data?: unknown; error?: string } | { type: "error"; error: string }; /** Messages sent from Supervisor (host) to Worker (container) via stdin. */ export type SupervisorMessage = | { type: "chat"; messageId: string; fromId: string; message: string; conversationId: string } | { type: "route"; messageId: string; fromId: string; message: string; requestId: string } | { type: "route_response"; requestId: string; response?: string; error?: string } | { type: "mgmt_response"; requestId: string; response?: unknown; error?: string } | { type: "query"; requestId: string; action: string; params?: Record } | { type: "peers_update"; peers: PeerInfo[] } | { type: "shutdown" };