UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

15 lines (14 loc) • 692 B
import { a as resolveGlobalSingleton } from "./global-singleton-0m-JziJW.mjs"; import { AsyncLocalStorage } from "node:async_hooks"; //#region src/plugins/load-diagnostics.ts const diagnostics = resolveGlobalSingleton(Symbol.for("openclaw.pluginLoadDiagnostics"), () => new AsyncLocalStorage()); /** Retain observed failures after temporary inspection registries have been released. */ function withPluginLoadDiagnostics(run) { const observed = []; return diagnostics.run(observed, () => run(observed)); } function recordPluginLoadDiagnostic(diagnostic) { diagnostics.getStore()?.push(diagnostic); } //#endregion export { withPluginLoadDiagnostics as n, recordPluginLoadDiagnostic as t };