import { type Plan } from "@xgjktech/xg-openclaw-shared"; import type { ImStreamClient } from "./connection.js"; /** * 组装发往前端的 plan:剥离 origin(内部路由信息,含 sessionKey,前端不需要也不该看到)。 * 返回浅拷贝,不 mutate 入参(middleware 拿到的 plan 引用可能别处还要用)。 */ export declare function toWirePlan(plan: Plan): Plan; /** * 发送一条 PLAN_STAT。绝不抛、绝不 await 调用方(内部自己 catch)。 */ export declare function sendPlanStat(params: { plan: Plan; source: "tool" | "snapshot"; }): void; /** * 登记 WS client(供后续 PLAN_STAT 增量路由),登记完立刻 fire-and-forget 触发一次快照: * 反查该群未完成的计划,逐个发 PLAN_STAT(source: "snapshot")。 * * dispatch 是热路径:整个快照过程包 try/catch、绝不 await、绝不抛——快照失败不能连累 * WS 绑定本身(登记必须先于快照执行、且不受快照结果影响)。 * * `deps.listPlansByOrigin` 默认注入 plan-store-access 的实现;测试可传入假实现 * 模拟反查异常(红线防御性场景——即便被注入的反查实现意外抛出,本函数也绝不外抛)。 */ export declare function registerPlanWsClientAndSnapshot(groupId: string, client: ImStreamClient, replyToMsgId: string, deps?: { listPlansByOrigin: (channel: string, to: string) => Plan[]; }): void; //# sourceMappingURL=plan-stat-event.d.ts.map