import type { ModelCatalogEntry } from "../../agents/model-catalog.js"; import type { createDefaultDeps } from "../../cli/deps.js"; import type { HealthSummary } from "../../commands/health.js"; import type { CronService } from "../../cron/service.js"; import type { createSubsystemLogger } from "../../logging/subsystem.js"; import type { WizardSession } from "../../wizard/session.js"; import type { ChatAbortControllerEntry } from "../chat-abort.js"; import type { ExecApprovalManager } from "../exec-approval-manager.js"; import type { NodeRegistry } from "../node-registry.js"; import type { ConnectParams, ErrorShape, RequestFrame } from "../protocol/index.js"; import type { GatewayBroadcastFn, GatewayBroadcastToConnIdsFn } from "../server-broadcast.js"; import type { ChannelRuntimeSnapshot } from "../server-channels.js"; import type { DedupeEntry } from "../server-shared.js"; type SubsystemLogger = ReturnType; export type GatewayClient = { connect: ConnectParams; connId?: string; clientIp?: string; canvasHostUrl?: string; canvasCapability?: string; canvasCapabilityExpiresAtMs?: number; }; export type RespondFn = (ok: boolean, payload?: unknown, error?: ErrorShape, meta?: Record) => void; export type GatewayRequestContext = { deps: ReturnType; cron: CronService; cronStorePath: string; execApprovalManager?: ExecApprovalManager; loadGatewayModelCatalog: () => Promise; getHealthCache: () => HealthSummary | null; refreshHealthSnapshot: (opts?: { probe?: boolean; }) => Promise; logHealth: { error: (message: string) => void; }; logGateway: SubsystemLogger; incrementPresenceVersion: () => number; getHealthVersion: () => number; broadcast: GatewayBroadcastFn; broadcastToConnIds: GatewayBroadcastToConnIdsFn; nodeSendToSession: (sessionKey: string, event: string, payload: unknown) => void; nodeSendToAllSubscribed: (event: string, payload: unknown) => void; nodeSubscribe: (nodeId: string, sessionKey: string) => void; nodeUnsubscribe: (nodeId: string, sessionKey: string) => void; nodeUnsubscribeAll: (nodeId: string) => void; hasConnectedMobileNode: () => boolean; hasExecApprovalClients?: () => boolean; nodeRegistry: NodeRegistry; agentRunSeq: Map; chatAbortControllers: Map; chatAbortedRuns: Map; chatRunBuffers: Map; chatDeltaSentAt: Map; addChatRun: (sessionId: string, entry: { sessionKey: string; clientRunId: string; }) => void; removeChatRun: (sessionId: string, clientRunId: string, sessionKey?: string) => { sessionKey: string; clientRunId: string; } | undefined; registerToolEventRecipient: (runId: string, connId: string) => void; dedupe: Map; wizardSessions: Map; findRunningWizard: () => string | null; purgeWizardSession: (id: string) => void; getRuntimeSnapshot: () => ChannelRuntimeSnapshot; startChannel: (channel: import("../../channels/plugins/types.js").ChannelId, accountId?: string) => Promise; stopChannel: (channel: import("../../channels/plugins/types.js").ChannelId, accountId?: string) => Promise; markChannelLoggedOut: (channelId: import("../../channels/plugins/types.js").ChannelId, cleared: boolean, accountId?: string) => void; wizardRunner: (opts: import("../../commands/onboard-types.js").OnboardOptions, runtime: import("../../runtime.js").RuntimeEnv, prompter: import("../../wizard/prompts.js").WizardPrompter) => Promise; broadcastVoiceWakeChanged: (triggers: string[]) => void; }; export type GatewayRequestOptions = { req: RequestFrame; client: GatewayClient | null; isWebchatConnect: (params: ConnectParams | null | undefined) => boolean; respond: RespondFn; context: GatewayRequestContext; }; export type GatewayRequestHandlerOptions = { req: RequestFrame; params: Record; client: GatewayClient | null; isWebchatConnect: (params: ConnectParams | null | undefined) => boolean; respond: RespondFn; context: GatewayRequestContext; }; export type GatewayRequestHandler = (opts: GatewayRequestHandlerOptions) => Promise | void; export type GatewayRequestHandlers = Record; export {};