UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

22 lines (21 loc) • 902 B
import { a as resolveGlobalSingleton } from "./global-singleton-D7yf05nR.mjs"; import { AsyncLocalStorage } from "node:async_hooks"; //#region src/auto-reply/reply/dispatch-processed-outcome.ts const dispatchProcessedOutcomeSink = resolveGlobalSingleton(Symbol.for("openclaw.dispatchProcessedOutcomeSink"), () => new AsyncLocalStorage()); /** * Runs a channel turn's dispatch under a sink so its terminal outcome can attribute * zero-count warnings without widening the plugin-visible dispatch result contract. */ async function withDispatchProcessedOutcomeSink(e) { const t = {}; return { result: await dispatchProcessedOutcomeSink.run(t, e), processedOutcome: t.current }; } function noteDispatchProcessedOutcome(e) { const t = dispatchProcessedOutcomeSink.getStore(); if (t) t.current = e; } //#endregion export { withDispatchProcessedOutcomeSink as n, noteDispatchProcessedOutcome as t };