/** * 单账号连接运行器:WebSocket 长连接 + 入站消息派发。 * * 由两类入口复用: * - Gateway 启动时经 startAccount 委托(account-reconciler) * - 运行时 Reconciler 轮询发现的新增/变更账号(account-reconciler) * * 每次入站消息重新读取最新 cfg/config(rt.config.current()), * 使非连接类字段(systemPrompt、groupPolicy、bindings 等)变更无需断连即生效。 */ import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { Logger } from "./channel-log.js"; import { type ImStreamClient } from "./connection.js"; import type { ResolvedAccount, XgImConfig } from "./types.js"; export interface AccountConnectionHandle { stop: () => void; streamClient: ImStreamClient; isReconnectExhausted: () => boolean; } export interface StartAccountConnectionParams { /** 连接建立时的配置快照(兜底);派发时优先读 cfgProvider() */ cfg: OpenClawConfig; account: ResolvedAccount; config: XgImConfig; /** 插件运行时(内部 surface 较 SDK 类型丰富,沿用原实现用 any 承接) */ rt: any; log: Logger; abortSignal?: AbortSignal; /** 返回最新运行时配置(rt.config.current());缺省用启动快照 */ cfgProvider?: () => OpenClawConfig; } /** * 启动一个账号的 WebSocket 连接并持续派发,直到 abortSignal 触发。 * 返回句柄供调用方主动 stop(幂等)。 */ export declare function startAccountConnection(params: StartAccountConnectionParams): Promise; //# sourceMappingURL=account-connection.d.ts.map