UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

30 lines (29 loc) • 1.54 kB
import { d as resolveAgentWorkspaceDir } from "./agent-scope-config-BEk6-ThS.mjs"; import "./agent-scope-bJOokm5r.mjs"; import { o as getPluginRuntimeGatewayRequestScope } from "./gateway-request-scope-DV3FHtde.mjs"; import { l as getActivePluginRegistry } from "./runtime-U4i1bMh7.mjs"; import { pn as validateHooksStatusParams } from "./src-D6kL8tMP.mjs"; import { t as loadWorkspaceHookEntries } from "./workspace-C-KrI94f.mjs"; import { t as buildWorkspaceHookStatus } from "./hooks-status-p6A1AlNC.mjs"; import { t as assertValidParams } from "./validation-UW_NLjlV.mjs"; import { t as resolveAgentIdOrRespondError } from "./agent-id-shared-BvQwtL4x.mjs"; //#region src/gateway/server-methods/hooks-status.ts /** Gateway handler for the live hook status report. */ const hooksStatusHandlers = { "hooks.status": ({ params, respond, context }) => { if (!assertValidParams(params, validateHooksStatusParams, "hooks.status", respond)) return; const config = context.getRuntimeConfig(); const resolved = resolveAgentIdOrRespondError({ rawAgentId: params.agentId, respond, cfg: config }); if (!resolved) return; const workspaceDir = resolveAgentWorkspaceDir(config, resolved.agentId); const entries = [...(getPluginRuntimeGatewayRequestScope()?.pluginRegistry ?? getActivePluginRegistry())?.hooks.map((hook) => hook.entry) ?? [], ...loadWorkspaceHookEntries(workspaceDir, { config })]; respond(true, buildWorkspaceHookStatus(workspaceDir, { config, entries }), void 0); } }; //#endregion export { hooksStatusHandlers };