UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.42 kB
import"./model-ref-shared-T-aCqInj.mjs";import{k as tryResolveConfiguredAgentWorkspaceDir}from"./agent-scope-config-CG9CFpGX.mjs";import{t as getPluginRuntimeGenerationRegistry}from"./generation-state-Bed3DvwS.mjs";import{n as withPluginRuntimeGenerationScope}from"./generation-scope-CxHnQlew.mjs";import{s as loadManifestMetadataSnapshot}from"./manifest-contract-eligibility-BFn2JM5T.mjs";import{r as modelKey}from"./provider-registry-index-fv5AHL27.mjs";import{n as resolvePluginProviderRegistryCore}from"./providers.runtime-DBX2iu0m.mjs"; //!src/commands/models/model-selection.runtime.ts function withModelCommandProviderRuntime(e,t){const n=getPluginRuntimeGenerationRegistry();const r=e.runtimeConfig;const i=process.env;const a=tryResolveConfiguredAgentWorkspaceDir(r,i);const o=loadManifestMetadataSnapshot({config:r,env:i,workspaceDir:a});const s=/* @__PURE__ */ new Set;const c=/* @__PURE__ */ new Set;const l=withPluginRuntimeGenerationScope({metadataSnapshot:o},e.selectModelRefs);for(const e of l)if(e){s.add(e.provider);c.add(modelKey(e.provider,e.model))}const u=s.size?resolvePluginProviderRegistryCore({config:r,env:i,workspaceDir:a,pluginMetadataSnapshot:o,providerRefs:[...s],modelRefs:[...c],registryScope:`exact`,activate:false}):void 0;return withPluginRuntimeGenerationScope({metadataSnapshot:o,pluginRegistry:u?.registry},()=>t(!n||n.providers.length>0))}export{withModelCommandProviderRuntime};