UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

3 lines • 1.62 kB
import{n as CLAUDE_BUNDLE_MANIFEST_RELATIVE_PATH,o as resolveBundleComponentPaths}from"./bundle-manifest-CeCINH5W.mjs";import{t as applyMergePatch}from"./merge-patch-CKGPHlQC.mjs";import{n as loadEnabledBundleConfig,r as readBundleJsonObject,t as extractBundleServerMap}from"./bundle-config-shared-ByVIq6Xa.mjs"; //!src/plugins/bundle-lsp.ts function loadBundleLspConfig(e){if(e.bundleFormat!==`claude`)return{config:{lspServers:{}},diagnostics:[]};const t=readBundleJsonObject({rootDir:e.rootDir,relativePath:CLAUDE_BUNDLE_MANIFEST_RELATIVE_PATH});if(!t.ok)return{config:{lspServers:{}},diagnostics:[t.error]};let n={lspServers:{}};const r=resolveBundleComponentPaths(t.raw.lspServers,e.rootDir,[`.lsp.json`]);const i=[];for(const t of r){const r=readBundleJsonObject({rootDir:e.rootDir,relativePath:t,allowMissing:true});if(!r.ok)i.push(r.reason===`open`?r.error:`unable to read ${t}: ${r.error}`);n=applyMergePatch(n,{lspServers:r.ok?extractBundleServerMap(r.raw,[`lspServers`]):{}})}return{config:n,diagnostics:i}}function inspectBundleLspRuntimeSupport(e){const{config:t,diagnostics:n}=loadBundleLspConfig(e);const r=[];const i=[];for(const[e,n]of Object.entries(t.lspServers))(typeof n.command===`string`&&n.command.trim().length>0?r:i).push(e);return{supportedServerNames:r,unsupportedServerNames:i,diagnostics:n}}function loadEnabledBundleLspConfig(e){return loadEnabledBundleConfig({workspaceDir:e.workspaceDir,cfg:e.cfg,manifestRegistry:e.manifestRegistry,createEmptyConfig:()=>({lspServers:{}}),loadBundleConfig:loadBundleLspConfig})}export{loadEnabledBundleLspConfig as n,inspectBundleLspRuntimeSupport as t};