Download src/plugins/runtime/load-context-state.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 1.3 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/runtime/load-context-state.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugins/runtime/load-context-state.ts
-
curl -L -o load-context-state.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/runtime/load-context-state.ts
1.3 kB
| import type { DeclaredProviderOwnerIndex } from "../provider-owner-index.js"; | |
| export type PluginRuntimeLoadContextState = { | |
| activationInputFingerprint: string; | |
| activationResultFingerprint: string; | |
| controlPlaneFingerprint: string; | |
| registrationConfigKey: string; | |
| loaderCacheIdentity?: Readonly<{ requestKey: string; resolvedKey: string }>; | |
| declaredProviderOwners: DeclaredProviderOwnerIndex; | |
| }; | |
| // Keep private config/env out of diagnostic traversal while registry spreads | |
| // preserve the exact owning context across source and built readers. | |
| const pluginRuntimeLoadContext = Symbol.for("openclaw.pluginRuntimeLoadContext"); | |
| type ContextCarrier = { [pluginRuntimeLoadContext]?: () => PluginRuntimeLoadContextState }; | |
| export function bindPluginRuntimeLoadContextState( | |
| registry: object, | |
| context: PluginRuntimeLoadContextState, | |
| ): void { | |
| Object.defineProperty(registry, pluginRuntimeLoadContext, { | |
| value: () => context, | |
| configurable: true, | |
| writable: true, | |
| enumerable: true, | |
| }); | |
| } | |
| export function getPluginRuntimeLoadContextState( | |
| registry: object | undefined, | |
| ): PluginRuntimeLoadContextState | undefined { | |
| // SAFETY: Only the owning setter writes this private registry slot. | |
| return (registry as ContextCarrier | undefined)?.[pluginRuntimeLoadContext]?.(); | |
| } | |