UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

20 lines (19 loc) • 1.6 kB
import { o as runWithPluginExecutionFrame } from "./plugin-instance-invocation-Bq_toGDw.mjs"; import { n as createRegistryScope, s as runOutsidePluginRuntimeRegistryScope } from "./gateway-request-scope-BvvDhs5D.mjs"; import { n as getPluginRuntimeExecutionFrame, t as PluginRuntimeExecutionFrame } from "./execution-frame-D6-zKKdm.mjs"; import { n as createPluginMetadataSnapshotFrame, s as runOutsidePluginMetadataSnapshotScope } from "./current-plugin-metadata-snapshot-H0TP3PFt.mjs"; import { n as runOutsidePluginRuntimeGenerationRegistryScope } from "./generation-state-CbpjEoxA.mjs"; import { t as createEmptyPluginRegistry } from "./registry-empty-Cv4VTWYA.mjs"; //#region src/plugins/runtime/generation-scope.ts /** Carries one prepared plugin generation through all nested runtime lookups. */ function withPluginRuntimeGenerationScope(e, t) { const n = e.pluginRegistry ?? createEmptyPluginRegistry(); const r = createPluginMetadataSnapshotFrame(e.metadataSnapshot, { trustConfigIdentity: true }); return runWithPluginExecutionFrame(new PluginRuntimeExecutionFrame(r, createRegistryScope(n, getPluginRuntimeExecutionFrame(r)?.gatewayScope, e.metadataSnapshot.declaredProviderOwners), n), t); } /** Re-admission drops the old generation while retaining the exact Gateway caller. */ function runOutsidePluginRuntimeGenerationScope(e) { return runOutsidePluginRuntimeGenerationRegistryScope(() => runOutsidePluginMetadataSnapshotScope(() => runOutsidePluginRuntimeRegistryScope(e))); } //#endregion export { withPluginRuntimeGenerationScope as n, runOutsidePluginRuntimeGenerationScope as t };