Download src/plugins/runtime/metadata-registry-loader.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 2.08 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/runtime/metadata-registry-loader.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugins/runtime/metadata-registry-loader.ts
-
curl -L -o metadata-registry-loader.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugins/runtime/metadata-registry-loader.ts
2.08 kB
| // Metadata registry loader builds plugin metadata registries without activating runtime barrels. | |
| import type { OpenClawConfig } from "../../config/types.openclaw.js"; | |
| import { loadPluginRegistryHandle } from "../loader.js"; | |
| import type { PluginManifestRegistry } from "../manifest-registry.js"; | |
| import { hasExplicitPluginIdScope } from "../plugin-scope.js"; | |
| import type { PluginRegistry } from "../registry.js"; | |
| import type { PluginLogger } from "../types.js"; | |
| import { buildPluginRuntimeLoadOptions, type PluginRuntimeLoadContext } from "./load-context.js"; | |
| import { resolvePluginRuntimeLoadContext } from "./load-context.resolve.js"; | |
| /** Loads a non-activated plugin metadata registry snapshot for validation/status callers. */ | |
| export function loadPluginMetadataRegistrySnapshot(options?: { | |
| config?: OpenClawConfig; | |
| activationSourceConfig?: OpenClawConfig; | |
| env?: NodeJS.ProcessEnv; | |
| logger?: PluginLogger; | |
| workspaceDir?: string; | |
| onlyPluginIds?: string[]; | |
| loadModules?: boolean; | |
| manifestRegistry?: PluginManifestRegistry; | |
| runtimeContext?: PluginRuntimeLoadContext; | |
| }): PluginRegistry { | |
| const context = options?.runtimeContext ?? resolvePluginRuntimeLoadContext(options); | |
| return loadPluginRegistryHandle( | |
| buildPluginRuntimeLoadOptions(context, { | |
| ...(options?.config !== undefined ? { config: options.config } : {}), | |
| ...(options?.activationSourceConfig !== undefined | |
| ? { activationSourceConfig: options.activationSourceConfig } | |
| : {}), | |
| ...(options?.workspaceDir !== undefined ? { workspaceDir: options.workspaceDir } : {}), | |
| ...(options?.env !== undefined ? { env: options.env } : {}), | |
| ...(options?.logger !== undefined ? { logger: options.logger } : {}), | |
| throwOnLoadError: true, | |
| cache: false, | |
| mode: "validate", | |
| loadModules: options?.loadModules, | |
| ...(hasExplicitPluginIdScope(options?.onlyPluginIds) | |
| ? { onlyPluginIds: options?.onlyPluginIds } | |
| : {}), | |
| ...(options?.manifestRegistry ? { manifestRegistry: options.manifestRegistry } : {}), | |
| }), | |
| ); | |
| } | |