import type { TurnOrigin } from '@xopcai/endpoint-tools-protocol'; import type { AgentService } from '../../agent/service.js'; import type { Config } from '../../config/schema.js'; import type { MessageBus } from '../../infra/bus/index.js'; import type { SessionIndex } from '../../session/index.js'; import type { ChatStreamEvent } from '../chat-stream/protocol.js'; import type { UserTurnAttachment } from '../user-turn-input.js'; export type RunGatewayAgentYield = ChatStreamEvent; export type RunGatewayAgentDeps = { config: Config; agentService: AgentService; bus: MessageBus; runAbortControllers: Map; activeWebchatRunBySession: Map; sessionIndex: SessionIndex; emit: (type: string, payload: unknown) => void; publishRealtime: (topic: string, event: string, data: unknown) => void; completeRealtimeTopic: (topic: string) => void; }; /** * @param runOptions.signal — When set (e.g. client disconnect), aborts in-flight generation and persists partial output. */ export declare function runGatewayAgent(deps: RunGatewayAgentDeps, message: string, channel: string, chatId: string, origin: TurnOrigin, attachments?: UserTurnAttachment[], thinking?: string, runOptions?: { signal?: AbortSignal; runId?: string; }): AsyncGenerator;