import type { SessionKey, SessionMap } from "./session-map.js"; import type { AgentDeliveryResult, BridgeCallbacks, ChannelMessage } from "./types.js"; /** Options for constructing a {@link ChannelBridge}. */ export type ChannelBridgeOptions = { /** CLI runtime provider ("claude", "gemini", "codex", "opencode"). */ provider: string; /** Session map for session persistence. */ sessionMap: SessionMap; /** Gateway URL for MCP server WebSocket connection. */ gatewayUrl: string; /** Gateway auth token for MCP server. */ gatewayToken: string; /** Working directory for CLI subprocess. */ workspaceDir?: string | undefined; /** Channel text chunk limit (default: 4000). */ chunkLimit?: number | undefined; /** MCP server entry point path. */ mcpServerPath?: string | undefined; /** Extra CLI arguments appended to every runtime invocation. */ runtimeArgs?: string[] | undefined; /** Extra environment variables injected into every runtime invocation. */ runtimeEnv?: Record | undefined; }; /** * Central orchestrator connecting incoming channel messages to CLI agent execution and delivery. * * `handle()` is the single entry point for all dispatch sites: agent command, auto-reply, * cron, and follow-up. It wires together runtime factory, session map, error classifier, * delivery adapter, system prompt builder, and MCP side effects. */ export declare class ChannelBridge { #private; constructor(options: ChannelBridgeOptions); /** * Process an incoming channel message through the full agent execution pipeline. * * Flow: session lookup → system prompt → MCP config → runtime execution → * event streaming → error classification → side effects → session update → result assembly. */ handle(message: ChannelMessage, callbacks?: BridgeCallbacks, abortSignal?: AbortSignal): Promise; } /** Build a SessionKey from a ChannelMessage. */ export declare function buildSessionKey(message: ChannelMessage): SessionKey;