UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

39 lines (38 loc) 1.86 kB
import { n as getRuntimeConfig, s as readConfigFileSnapshot } from "./io.runtime-B9iJRs3w.js"; import { A as resolveChannelSchemaSelection, M as collectPluginSchemaMetadataCore, j as collectChannelSchemaMetadataCore } from "./io.types-BUCjdS5v.js"; import { t as resolveConfigWidePluginManifestRegistry } from "./io.plugin-metadata-BruF5izX.js"; import "./config-Cs0XXL3x.js"; import { t as buildConfigSchemaCore } from "./schema-DyKN69ex.js"; //#region src/config/runtime-schema.ts function loadManifestRegistry(config, env) { return resolveConfigWidePluginManifestRegistry({ config, env: env ?? process.env }); } /** Builds one config schema from an exact manifest registry. */ function buildRuntimeConfigSchemaFromRegistry(registry, config) { return buildConfigSchemaCore({ plugins: collectPluginSchemaMetadataCore(registry), channels: collectChannelSchemaMetadataCore(registry, resolveChannelSchemaSelection(registry, config)) }); } /** Builds the config schema from the active runtime config and plugin metadata. */ function loadGatewayRuntimeConfigSchema() { const config = getRuntimeConfig(); return buildRuntimeConfigSchemaFromRegistry(loadManifestRegistry(config), config); } async function readBestEffortRuntimeConfigSchema() { const snapshot = await readConfigFileSnapshot({ observe: false }); const config = snapshot.valid ? snapshot.sourceConfig : { agents: { list: [{ id: "main" }] }, plugins: { enabled: true } }; const registry = loadManifestRegistry(config); return buildConfigSchemaCore({ plugins: snapshot.valid ? collectPluginSchemaMetadataCore(registry) : [], channels: collectChannelSchemaMetadataCore(registry, resolveChannelSchemaSelection(registry, config)) }); } //#endregion export { loadGatewayRuntimeConfigSchema as n, readBestEffortRuntimeConfigSchema as r, buildRuntimeConfigSchemaFromRegistry as t };