/** * v5.8.0: profileHook 包装器 * * 用法(替换 api.on 一对一调用): * import { profileHook } from "../utils/profile-hook.js"; * profileHook(api, "before_prompt_build", "prompt-enhancer", (event, ctx) => { ... }); * * 行为零变化:内部 await handler,把返回值原样透传,异常原样 rethrow。 * 唯一副作用:在 hook_profile 表写一条记录(duration_ms + status)。写表失败静默。 * * 关闭开关:setHookProfilerEnabled(false) 后只 register handler,不写表。 * 这样即使 DB 出问题,wrapped handler 也能正常跑。 */ import type { OpenClawPluginApi } from "openclaw/plugin-sdk"; export declare function setHookProfilerEnabled(enabled: boolean): void; export declare function isHookProfilerEnabled(): boolean; type AnyHandler = (event: any, ctx: any) => any; export declare function profileHook(api: OpenClawPluginApi, event: string, moduleName: string, handler: AnyHandler, options?: unknown): void; export {};