/** 预处理输入:会话与当前消息、当前智能体 */ export interface InboundMessageContext { /** 会话 ID(桌面 session 或 channel:platform:threadId) */ sessionId: string; /** 用户原始消息(已 trim) */ message: string; /** 当前会话使用的 agentId,未解析 // 时的值 */ currentAgentId: string; } /** 预处理输出:后续链路使用的消息与智能体 */ export interface InboundMessagePreprocessResult { /** 预处理后的消息(如去掉 //智能体名称 后的内容) */ message: string; /** 本轮应使用的 agentId(可能因 // 切换而变更) */ agentId: string; /** 若存在,调用方应直接返回此内容、不跑 Agent(用于 //select 等内置指令) */ directResponse?: string; } /** 单个预处理步骤:可异步,返回新的 message + agentId,供下一步或最终使用 */ export type InboundPreprocessor = (ctx: InboundMessageContext) => Promise | InboundMessagePreprocessResult; /** 默认预处理管道:按顺序执行;扩展时可传入 [...defaultPipeline, myStep] */ export declare const defaultPipeline: InboundPreprocessor[]; /** * 对所有通道统一的入站消息预处理入口。 * 先跑完管道(当前为 //智能体 解析),返回最终 message 与 agentId,供 Gateway agent.chat 与 Channel handleChannelMessage 使用。 */ export declare function preprocessInboundMessage(ctx: InboundMessageContext, pipeline?: InboundPreprocessor[]): Promise;