/** * 模块: 输出自检(Self-Check) * * Hook: before_agent_reply * 时机: AI 回复发送前,拦截检查 * 作用: 检测空输出、错误关键词、格式异常,记录问题但不阻断正常输出 * * 来源: 对标 Claude Code "评估与观测" 能力(Agent Harness 六层第5层) */ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; export interface SelfCheckConfig { /** 是否启用 */ enabled?: boolean; /** 检查空输出 */ checkEmpty?: boolean; /** 检查 NO_REPLY 标记 */ checkNoReply?: boolean; /** 检查错误关键词 */ checkErrorKeywords?: boolean; /** 检查超长输出 */ checkExcessiveLength?: boolean; /** 超长阈值(字符),默认 10000 */ maxLength?: number; /** 错误关键词列表 */ errorKeywords?: string[]; /** 是否阻断(true=拦截,false=仅记录) */ blockOnEmpty?: boolean; } export declare function registerSelfCheck(api: OpenClawPluginApi, config?: SelfCheckConfig): void;