imcp 0.1.19 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/__mocks__/strip-json-comments.d.ts +1 -0
- package/dist/__mocks__/strip-json-comments.js +2 -0
- package/dist/__mocks__/strip-json-comments.js.map +1 -0
- package/dist/cli/commands/install.js +1 -1
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/tui.d.ts +2 -0
- package/dist/cli/commands/tui.js +2 -0
- package/dist/cli/commands/tui.js.map +1 -0
- package/dist/cli/commands/uninstall.js +1 -1
- package/dist/cli/commands/uninstall.js.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tui/App.d.ts +1 -0
- package/dist/cli/tui/App.js +2 -0
- package/dist/cli/tui/App.js.map +1 -0
- package/dist/cli/tui/components/ClientSelector.d.ts +11 -0
- package/dist/cli/tui/components/ClientSelector.js +2 -0
- package/dist/cli/tui/components/ClientSelector.js.map +1 -0
- package/dist/cli/tui/components/Header.d.ts +1 -0
- package/dist/cli/tui/components/Header.js +2 -0
- package/dist/cli/tui/components/Header.js.map +1 -0
- package/dist/cli/tui/components/InstallProgress.d.ts +8 -0
- package/dist/cli/tui/components/InstallProgress.js +2 -0
- package/dist/cli/tui/components/InstallProgress.js.map +1 -0
- package/dist/cli/tui/components/Panel.d.ts +8 -0
- package/dist/cli/tui/components/Panel.js +2 -0
- package/dist/cli/tui/components/Panel.js.map +1 -0
- package/dist/cli/tui/components/SearchBar.d.ts +11 -0
- package/dist/cli/tui/components/SearchBar.js +2 -0
- package/dist/cli/tui/components/SearchBar.js.map +1 -0
- package/dist/cli/tui/components/ServerList.d.ts +16 -0
- package/dist/cli/tui/components/ServerList.js +2 -0
- package/dist/cli/tui/components/ServerList.js.map +1 -0
- package/dist/cli/tui/components/StepIndicator.d.ts +7 -0
- package/dist/cli/tui/components/StepIndicator.js +2 -0
- package/dist/cli/tui/components/StepIndicator.js.map +1 -0
- package/dist/cli/tui/hooks/useInstall.d.ts +18 -0
- package/dist/cli/tui/hooks/useInstall.js +2 -0
- package/dist/cli/tui/hooks/useInstall.js.map +1 -0
- package/dist/cli/tui/hooks/useServers.d.ts +18 -0
- package/dist/cli/tui/hooks/useServers.js +2 -0
- package/dist/cli/tui/hooks/useServers.js.map +1 -0
- package/dist/cli/tui/utils/fuzzySearch.d.ts +9 -0
- package/dist/cli/tui/utils/fuzzySearch.js +2 -0
- package/dist/cli/tui/utils/fuzzySearch.js.map +1 -0
- package/dist/cli/utils/clientOptions.d.ts +3 -0
- package/dist/cli/utils/clientOptions.js +2 -0
- package/dist/cli/utils/clientOptions.js.map +1 -0
- package/dist/core/installers/clients/BaseClientInstaller.d.ts +8 -0
- package/dist/core/installers/clients/BaseClientInstaller.js +1 -1
- package/dist/core/installers/clients/BaseClientInstaller.js.map +1 -1
- package/dist/core/installers/clients/ClaudeCodeInstaller.js +1 -1
- package/dist/core/installers/clients/ClaudeCodeInstaller.js.map +1 -1
- package/dist/core/installers/clients/ClientInstaller.d.ts +3 -0
- package/dist/core/installers/clients/ClientInstaller.js +1 -1
- package/dist/core/installers/clients/ClientInstaller.js.map +1 -1
- package/dist/core/installers/clients/ClientInstallerFactory.js +1 -1
- package/dist/core/installers/clients/ClientInstallerFactory.js.map +1 -1
- package/dist/core/installers/clients/CodexInstaller.d.ts +45 -0
- package/dist/core/installers/clients/CodexInstaller.js +2 -0
- package/dist/core/installers/clients/CodexInstaller.js.map +1 -0
- package/dist/core/installers/clients/GithubCopilotInstaller.js +1 -1
- package/dist/core/installers/clients/GithubCopilotInstaller.js.map +1 -1
- package/dist/core/installers/clients/RooCodeInstaller.d.ts +11 -0
- package/dist/core/installers/clients/RooCodeInstaller.js +2 -0
- package/dist/core/installers/clients/RooCodeInstaller.js.map +1 -0
- package/dist/core/installers/clients/VisualStudioInstaller.js +1 -1
- package/dist/core/installers/clients/VisualStudioInstaller.js.map +1 -1
- package/dist/core/loaders/ConfigurationLoader.js +1 -1
- package/dist/core/loaders/ConfigurationLoader.js.map +1 -1
- package/dist/core/loaders/ConfigurationProvider.d.ts +1 -0
- package/dist/core/loaders/ConfigurationProvider.js +1 -1
- package/dist/core/loaders/ConfigurationProvider.js.map +1 -1
- package/dist/core/metadatas/constants.js +1 -1
- package/dist/core/metadatas/constants.js.map +1 -1
- package/dist/core/metadatas/types.d.ts +2 -0
- package/dist/core/metadatas/types.js.map +1 -1
- package/dist/services/InstallationService.js +1 -1
- package/dist/services/InstallationService.js.map +1 -1
- package/dist/services/RequirementService.d.ts +2 -3
- package/dist/services/RequirementService.js +1 -1
- package/dist/services/RequirementService.js.map +1 -1
- package/dist/services/ServerService.d.ts +5 -0
- package/dist/services/ServerService.js +1 -1
- package/dist/services/ServerService.js.map +1 -1
- package/dist/services/TelemetryService.js +1 -1
- package/dist/services/TelemetryService.js.map +1 -1
- package/dist/utils/tomlUtils.d.ts +17 -0
- package/dist/utils/tomlUtils.js +2 -0
- package/dist/utils/tomlUtils.js.map +1 -0
- package/dist/web/public/js/modal/modalSetup.js +1 -1
- package/dist/web/public/js/modal/modalSetup.js.map +1 -1
- package/package.json +7 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","path","exec","promisify","fileURLToPath","GITHUB_REPO","LOCAL_FEEDS_DIR","SETTINGS_DIR","SUPPORTED_CLIENTS","Logger","checkGithubAuth","ConfigurationLoader","execAsync","__dirname","dirname","url","ConfigurationProvider","static","configPath","configuration","configLock","Promise","resolve","tempDir","constructor","this","join","localServerCategories","feeds","clientMCPSettings","getInstance","instance","withLock","operation","current","r","initialize","feedFile","settings","async","configDir","mkdir","recursive","rm","force","error","code","config","JSON","parse","readFile","saveConfiguration","loadFeedsIntoConfiguration","loadClientMCPSettings","writeFile","stringify","getServerCategories","getServerCategory","categoryName","find","s","name","getClientMcpSettings","getFeedConfiguration","getServerMcpConfig","serverName","mcpServers","getInstallationStatus","category","installationStatus","getServerStatus","status","serversStatus","getRequirementStatus","requirementName","requirementsStatus","updateInstallationStatus","requirementStatus","serverStatus","lastUpdated","Date","toISOString","updateRequirementStatus","updateRequirementOperationStatus","operationStatus","updateServerStatus","updateServerOperationStatus","clientName","installedStatus","isRequirementsReady","feedConfiguration","serverConfig","dependencies","requirements","requirementNames","map","every","reqStatus","installed","GetServerRequirementStatus","filter","x","undefined","isServerReady","clients","clientStatus","syncFeeds","repo","branch","log","debug","action","paths","localFeeds","repoUrl","repoBranch","cloneGitRepository","import","clonePath","sourceFeedsDir","feedsPath","access","err","Error","cp","downloadGithubRelease","version","downloadPath","repoName","feedAssetsName","reloadClientMCPSettings","removeServerFromClientMCPSettings","target","readJsonFile","writeJsonFile","clientEntries","Object","entries","targetClients","clientSettings","settingPath","process","env","CODE_INSIDERS","codeInsiderSettingPath","codeSettingPath","content","modified","servers","actualServerName","replace","values","configProvider"],"sources":["../../../src/core/loaders/ConfigurationProvider.ts"],"mappings":"OAAOA,OAAQ,qBACRC,SAAU,cACRC,SAAY,uBACZC,cAAiB,cACjBC,kBAAqB,aACrBC,YAAaC,gBAAiBC,aAAcC,sBAAyB,mCACrEC,WAAc,+BACdC,oBAAuB,mCAYvBC,wBAA2B,2BAEpC,MAAMC,UAAYT,UAAUD,MACtBW,UAAYZ,KAAKa,QAAQV,0BAA0BW,aAEnD,MAAOC,sBACDC,gBACAC,WACAC,cACAC,WAA4BC,QAAQC,UACpCC,QAER,WAAAC,GAEIC,KAAKP,WAAajB,KAAKyB,KAAKnB,aAAc,uBAC1CkB,KAAKN,cAAgB,CACjBQ,sBAAuB,GACvBC,MAAO,GACPC,kBAAmB,IAEvBJ,KAAKF,QAAUtB,KAAKyB,KAAKpB,gBAAiB,UAC9C,CAEO,kBAAOwB,GAIV,OAHKd,sBAAsBe,WACvBf,sBAAsBe,SAAW,IAAIf,uBAElCA,sBAAsBe,QACjC,CAEQ,cAAMC,CAAYC,GACtB,MAAMC,EAAUT,KAAKL,WACrB,IAAIE,E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AAQhF,aAAaD,YACrBiF,EAAQhF,WAAWD,GAC1BkF,GAAW,GAIXA,UACMb,EAAcM,EAAaM,GACjCzI,OAAOqG,MAAM,kBAAkB7C,iBAA0BsB,cAEjE,CAAE,MAAO1C,GACLpC,OAAOoC,MAAM,2BAA2BoB,iBAA0BsB,cAAwB1C,EAC9F,CACJ,CAGA,GAAIpB,KAAKN,cAAcU,kBAAmB,CACtC,GAAIuG,EAAQ,CAER,MAAMO,EAAiBlH,KAAKN,cAAcU,kBAAkBuG,GACxDO,IACIA,EAAezE,aAAaD,WACrB0E,EAAezE,WAAWD,GAEjC0E,EAAeS,UAAUnF,WAClB0E,EAAeS,QAAQnF,GAG1C,MAEI,IAAK,MAAM0E,KAAkBH,OAAOe,OAAO9H,KAAKN,cAAcU,mBACtD8G,EAAezE,aAAaD,WACrB0E,EAAezE,WAAWD,GAEjC0E,EAAeS,UAAUnF,WAClB0E,EAAeS,QAAQnF,SAIpCxC,KAAK0B,mBACf,IAER,SAIG,MAAMqG,eAAiBxI,sBAAsBc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["fs","path","exec","promisify","fileURLToPath","GITHUB_REPO","LOCAL_FEEDS_DIR","SETTINGS_DIR","SUPPORTED_CLIENTS","Logger","checkGithubAuth","ConfigurationLoader","execAsync","__dirname","dirname","url","ConfigurationProvider","static","configPath","configuration","configLock","Promise","resolve","tempDir","constructor","this","join","localServerCategories","feeds","clientMCPSettings","getInstance","instance","withLock","operation","current","r","initialize","feedFile","settings","async","configDir","mkdir","recursive","rm","force","error","code","config","JSON","parse","readFile","saveConfiguration","loadFeedsIntoConfiguration","loadClientMCPSettings","writeFile","stringify","getServerCategories","getServerCategory","categoryName","find","s","name","getClientMcpSettings","getFeedConfiguration","getServerMcpConfig","serverName","mcpServers","getInstallationStatus","category","installationStatus","getServerStatus","status","serversStatus","getRequirementStatus","requirementName","requirementsStatus","updateInstallationStatus","requirementStatus","serverStatus","lastUpdated","Date","toISOString","updateRequirementStatus","updateRequirementOperationStatus","operationStatus","updateServerStatus","updateServerOperationStatus","clientName","installedStatus","isRequirementsReady","feedConfiguration","serverConfig","dependencies","requirements","requirementNames","map","every","reqStatus","installed","markRequirementsForReinstall","length","requirementStatuses","requirement","existingStatus","type","inProgress","version","undefined","availableUpdate","lastCheckTime","pythonEnv","npmPath","GetServerRequirementStatus","filter","x","isServerReady","clients","clientStatus","syncFeeds","repo","branch","log","debug","action","paths","localFeeds","repoUrl","repoBranch","cloneGitRepository","import","clonePath","sourceFeedsDir","feedsPath","access","err","Error","cp","downloadGithubRelease","downloadPath","repoName","feedAssetsName","reloadClientMCPSettings","removeServerFromClientMCPSettings","target","readJsonFile","writeJsonFile","clientEntries","Object","entries","targetClients","clientSettings","settingPath","process","env","CODE_INSIDERS","codeInsiderSettingPath","codeSettingPath","content","modified","servers","actualServerName","replace","values","configProvider"],"sources":["../../../src/core/loaders/ConfigurationProvider.ts"],"mappings":"OAAOA,OAAQ,qBACRC,SAAU,cACRC,SAAY,uBACZC,cAAiB,cACjBC,kBAAqB,aACrBC,YAAaC,gBAAiBC,aAAcC,sBAAyB,mCACrEC,WAAc,+BACdC,oBAAuB,mCAYvBC,wBAA2B,2BAEpC,MAAMC,UAAYT,UAAUD,MACtBW,UAAYZ,KAAKa,QAAQV,0BAA0BW,aAEnD,MAAOC,sBACDC,gBACAC,WACAC,cACAC,WAA4BC,QAAQC,UACpCC,QAER,WAAAC,GAEIC,KAAKP,WAAajB,KAAKyB,KAAKnB,aAAc,uBAC1CkB,KAAKN,cAAgB,CACjBQ,sBAAuB,GACvBC,MAAO,GACPC,kBAAmB,IAEvBJ,KAAKF,QAAUtB,KAAKyB,KAAKpB,gBAAiB,UAC9C,CAEO,kBAAOwB,GAIV,OAHKd,sBAAsBe,WACvBf,sBAAsBe,SAAW,IAAIf,uBAElCA,sBAAsBe,QACjC,CAEQ,cAAMC,CAAYC,GACtB,MAAMC,EAAUT,KAAKL,WACrB,IAAIE,EACJG,KAAKL,WAAa,IAAIC,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O,EAAiB7H,KAAKN,cAAcU,kBAAkBkH,GACxDO,IACIA,EAAepF,aAAaD,WACrBqF,EAAepF,WAAWD,GAEjCqF,EAAeS,UAAU9F,WAClBqF,EAAeS,QAAQ9F,GAG1C,MAEI,IAAK,MAAMqF,KAAkBH,OAAOe,OAAOzI,KAAKN,cAAcU,mBACtDyH,EAAepF,aAAaD,WACrBqF,EAAepF,WAAWD,GAEjCqF,EAAeS,UAAU9F,WAClBqF,EAAeS,QAAQ9F,SAIpCxC,KAAK0B,mBACf,IAER,SAIG,MAAMgH,eAAiBnJ,sBAAsBc","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import os from"os";import path from"path";export const GITHUB_REPO={url:"https://github.com/ai-microsoft/imcp-feed.git",repoName:"ai-microsoft/imcp-feed",feedsPath:"feeds",feedAssetsName:"imcp-feeds-${latest}.zip"};export const SETTINGS_DIR=(process.platform,path.join(os.homedir(),".imcp"));export const LOCAL_FEEDS_DIR=path.join(SETTINGS_DIR,"feeds");export const USER_INFO_PATH=path.join(SETTINGS_DIR,"settings","user_info.json");export const LOCAL_FEEDS_SCHEMA_DIR=path.join(LOCAL_FEEDS_DIR,"schemas");const CODE_STRORAGE_DIR=(()=>{switch(process.platform){case"win32":return path.join(os.homedir(),"AppData","Roaming","Code","User");case"darwin":return path.join(os.homedir(),"Library","Application Support","Code","User");default:return process.env.WSL_DISTRO_NAME?path.join(os.homedir(),".vscode-server","data","User"):path.join(os.homedir(),".config","Code","User")}})(),CODE_INSIDER_STRORAGE_DIR=(()=>{switch(process.platform){case"win32":return path.join(os.homedir(),"AppData","Roaming","Code - Insiders","User");case"darwin":return path.join(os.homedir(),"Library","Application Support","Code - Insiders","User");default:return path.join(os.homedir(),".config","Code - Insiders","User")}})();export const SUPPORTED_CLIENTS=(()=>{const o={MSRooCode:{extension:{extensionId:"microsoftai.ms-roo-cline",leastVersion:"0.0.8",repository:"ai-microsoft/roo-cline",assetName:"ms-roo-cline-${version}.vsix",private:!0},codeSettingPath:path.join(CODE_STRORAGE_DIR,"globalStorage","microsoftai.ms-roo-cline","settings","cline_mcp_settings.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"globalStorage","microsoftai.ms-roo-cline","settings","cline_mcp_settings.json")},Cline:{extension:{extensionId:"saoudrizwan.claude-dev"},codeSettingPath:path.join(CODE_STRORAGE_DIR,"globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json")},GithubCopilot:{extension:{extensionId:"github.copilot"},codeSettingPath:path.join(CODE_STRORAGE_DIR,"mcp.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"mcp.json")},ClaudeCode:{codeSettingPath:path.join(os.homedir(),".claude.json"),codeInsiderSettingPath:path.join(os.homedir(),".claude.json")}};return"win32"===process.platform&&(o.VisualStudio={codeSettingPath:path.join(os.homedir(),".mcp.json"),codeInsiderSettingPath:path.join(os.homedir(),".mcp.json")}),o})();export const SUPPORTED_CLIENT_NAMES=Object.keys(SUPPORTED_CLIENTS);export const UPDATE_CHECK_INTERVAL_MS=6e5;export const INSTRUMENTATION_KEY="c5fc06c7-a96c-4d80-9aff-bc9c933db0d1";
|
|
1
|
+
import os from"os";import path from"path";export const GITHUB_REPO={url:"https://github.com/ai-microsoft/imcp-feed.git",repoName:"ai-microsoft/imcp-feed",feedsPath:"feeds",feedAssetsName:"imcp-feeds-${latest}.zip"};export const SETTINGS_DIR=(process.platform,path.join(os.homedir(),".imcp"));export const LOCAL_FEEDS_DIR=path.join(SETTINGS_DIR,"feeds");export const USER_INFO_PATH=path.join(SETTINGS_DIR,"settings","user_info.json");export const LOCAL_FEEDS_SCHEMA_DIR=path.join(LOCAL_FEEDS_DIR,"schemas");const CODE_STRORAGE_DIR=(()=>{switch(process.platform){case"win32":return path.join(os.homedir(),"AppData","Roaming","Code","User");case"darwin":return path.join(os.homedir(),"Library","Application Support","Code","User");default:return process.env.WSL_DISTRO_NAME?path.join(os.homedir(),".vscode-server","data","User"):path.join(os.homedir(),".config","Code","User")}})(),CODE_INSIDER_STRORAGE_DIR=(()=>{switch(process.platform){case"win32":return path.join(os.homedir(),"AppData","Roaming","Code - Insiders","User");case"darwin":return path.join(os.homedir(),"Library","Application Support","Code - Insiders","User");default:return path.join(os.homedir(),".config","Code - Insiders","User")}})();export const SUPPORTED_CLIENTS=(()=>{const o={MSRooCode:{extension:{extensionId:"microsoftai.ms-roo-cline",leastVersion:"0.0.8",repository:"ai-microsoft/roo-cline",assetName:"ms-roo-cline-${version}.vsix",private:!0},codeSettingPath:path.join(CODE_STRORAGE_DIR,"globalStorage","microsoftai.ms-roo-cline","settings","cline_mcp_settings.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"globalStorage","microsoftai.ms-roo-cline","settings","cline_mcp_settings.json")},RooCode:{extension:{extensionId:"rooveterinaryinc.roo-cline"},codeSettingPath:path.join(CODE_STRORAGE_DIR,"globalStorage","rooveterinaryinc.roo-cline","settings","mcp_settings.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"globalStorage","rooveterinaryinc.roo-cline","settings","mcp_settings.json")},Cline:{extension:{extensionId:"saoudrizwan.claude-dev"},codeSettingPath:path.join(CODE_STRORAGE_DIR,"globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"globalStorage","saoudrizwan.claude-dev","settings","cline_mcp_settings.json")},GithubCopilot:{extension:{extensionId:"github.copilot"},codeSettingPath:path.join(CODE_STRORAGE_DIR,"mcp.json"),codeInsiderSettingPath:path.join(CODE_INSIDER_STRORAGE_DIR,"mcp.json")},ClaudeCode:{codeSettingPath:path.join(os.homedir(),".claude.json"),codeInsiderSettingPath:path.join(os.homedir(),".claude.json")}};return"win32"===process.platform&&(o.VisualStudio={codeSettingPath:path.join(os.homedir(),".mcp.json"),codeInsiderSettingPath:path.join(os.homedir(),".mcp.json")}),o})();export const SUPPORTED_CLIENT_NAMES=Object.keys(SUPPORTED_CLIENTS);export const UPDATE_CHECK_INTERVAL_MS=6e5;export const INSTRUMENTATION_KEY="c5fc06c7-a96c-4d80-9aff-bc9c933db0d1";
|
|
2
2
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["os","path","GITHUB_REPO","url","repoName","feedsPath","feedAssetsName","SETTINGS_DIR","process","platform","join","homedir","LOCAL_FEEDS_DIR","USER_INFO_PATH","LOCAL_FEEDS_SCHEMA_DIR","CODE_STRORAGE_DIR","env","WSL_DISTRO_NAME","CODE_INSIDER_STRORAGE_DIR","SUPPORTED_CLIENTS","clients","MSRooCode","extension","extensionId","leastVersion","repository","assetName","private","codeSettingPath","codeInsiderSettingPath","Cline","GithubCopilot","ClaudeCode","SUPPORTED_CLIENT_NAMES","Object","keys","UPDATE_CHECK_INTERVAL_MS","INSTRUMENTATION_KEY"],"sources":["../../../src/core/metadatas/constants.ts"],"mappings":"OAAOA,OAAQ,YACRC,SAAU,cAQV,MAAMC,YAAc,CACzBC,IAAK,gDACLC,SAAU,yBACVC,UAAW,QACXC,eAAgB,mCAMX,MAAMC,cACHC,QAAQC,SAILR,KAAKS,KAAKV,GAAGW,UAAW,iBAO9B,MAAMC,gBAAkBX,KAAKS,KAAKH,aAAc,gBAKhD,MAAMM,eAAiBZ,KAAKS,KAAKH,aAAc,WAAY,yBAK3D,MAAMO,uBAAyBb,KAAKS,KAAKE,gBAAiB,WAEjE,MAAMG,kBAAoB,MACxB,OAAQP,QAAQC,UACd,IAAK,QACH,OAAOR,KAAKS,KAAKV,GAAGW,UAAW,UAAW,UAAW,OAAQ,QAC/D,IAAK,SACH,OAAOV,KAAKS,KAAKV,GAAGW,UAAW,UAAW,sBAAuB,OAAQ,QAC3E,QACE,OAAIH,QAAQQ,IAAIC,gBACPhB,KAAKS,KAAKV,GAAGW,UAAW,iBAAkB,OAAQ,QAEpDV,KAAKS,KAAKV,GAAGW,UAAW,UAAW,OAAQ,QAEvD,EAZyB,GAcpBO,0BAA4B,MAChC,OAAQV,QAAQC,UACd,IAAK,QACH,OAAOR,KAAKS,KAAKV,GAAGW,UAAW,UAAW,UAAW,kBAAmB,QAC1E,IAAK,SACH,OAAOV,KAAKS,KAAKV,GAAGW,UAAW,UAAW,sBAAuB,kBAAmB,QACtF,QACE,OAAOV,KAAKS,KAAKV,GAAGW,UAAW,UAAW,kBAAmB,QAElE,EATiC,UAqB3B,MAAMQ,kBAUR,MACH,MAAMC,EAA+B,CACnCC,UAAa,CACXC,UAAW,CACTC,YAAa,2BACbC,aAAc,QACdC,WAAY,yBACZC,UAAW,+BACXC,SAAS,GAEXC,gBAAiB3B,KAAKS,KAAKK,kBAAmB,gBAAiB,2BAA4B,WAAY,2BACvGc,uBAAwB5B,KAAKS,KAAKQ,0BAA2B,gBAAiB,2BAA4B,WAAY,4BAExHY,MAAS,
|
|
1
|
+
{"version":3,"names":["os","path","GITHUB_REPO","url","repoName","feedsPath","feedAssetsName","SETTINGS_DIR","process","platform","join","homedir","LOCAL_FEEDS_DIR","USER_INFO_PATH","LOCAL_FEEDS_SCHEMA_DIR","CODE_STRORAGE_DIR","env","WSL_DISTRO_NAME","CODE_INSIDER_STRORAGE_DIR","SUPPORTED_CLIENTS","clients","MSRooCode","extension","extensionId","leastVersion","repository","assetName","private","codeSettingPath","codeInsiderSettingPath","RooCode","Cline","GithubCopilot","ClaudeCode","SUPPORTED_CLIENT_NAMES","Object","keys","UPDATE_CHECK_INTERVAL_MS","INSTRUMENTATION_KEY"],"sources":["../../../src/core/metadatas/constants.ts"],"mappings":"OAAOA,OAAQ,YACRC,SAAU,cAQV,MAAMC,YAAc,CACzBC,IAAK,gDACLC,SAAU,yBACVC,UAAW,QACXC,eAAgB,mCAMX,MAAMC,cACHC,QAAQC,SAILR,KAAKS,KAAKV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fK,gBAAiB3B,KAAKS,KAAKK,kBAAmB,gBAAiB,yBAA0B,WAAY,2BACrGc,uBAAwB5B,KAAKS,KAAKQ,0BAA2B,gBAAiB,yBAA0B,WAAY,4BAEtHc,cAAiB,CACfV,UAAW,CACTC,YAAa,kBAEfK,gBAAiB3B,KAAKS,KAAKK,kBAAmB,YAC9Cc,uBAAwB5B,KAAKS,KAAKQ,0BAA2B,aAE/De,WAAc,CACZL,gBAAiB3B,KAAKS,KAAKV,GAAGW,UAAW,gBACzCkB,uBAAwB5B,KAAKS,KAAKV,GAAGW,UAAW,kBAUpD,MANyB,UAArBH,QAAQC,WACVW,EAAsB,aAAI,CACxBQ,gBAAiB3B,KAAKS,KAAKV,GAAGW,UAAW,aACzCkB,uBAAwB5B,KAAKS,KAAKV,GAAGW,UAAW,eAG7CS,CACR,EA/CI,UAoDE,MAAMc,uBAAyBC,OAAOC,KAAKjB,0BAM3C,MAAMkB,yBAA2B,WAKjC,MAAMC,oBAAsB","ignoreList":[]}
|
|
@@ -68,6 +68,8 @@ export interface ServerInstallOptions {
|
|
|
68
68
|
requirements?: RequirementConfig[];
|
|
69
69
|
args?: string[];
|
|
70
70
|
settings?: Record<string, any>;
|
|
71
|
+
blockUntilComplete?: boolean;
|
|
72
|
+
forceRequirementReinstall?: boolean;
|
|
71
73
|
}
|
|
72
74
|
export interface UpdateRequirementOptions {
|
|
73
75
|
requirementName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["OSType","MCPEvent"],"sources":["../../../src/core/metadatas/types.ts"],"mappings":"OAAA,IAAYA,QAAZ,SAAYA,GACVA,EAAA,kBACAA,EAAA,cACAA,EAAA,aACD,CAJD,CAAYA,gBAAM,
|
|
1
|
+
{"version":3,"names":["OSType","MCPEvent"],"sources":["../../../src/core/metadatas/types.ts"],"mappings":"OAAA,IAAYA,QAAZ,SAAYA,GACVA,EAAA,kBACAA,EAAA,cACAA,EAAA,aACD,CAJD,CAAYA,gBAAM,YAyKlB,IAAYC,UAAZ,SAAYA,GACVA,EAAA,oCACAA,EAAA,wCACAA,EAAA,gCACAA,EAAA,gCACAA,EAAA,+BACD,CAND,CAAYA,oBAAQ","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ClientInstaller}from"../core/installers/clients/ClientInstaller.js";import{ConfigurationProvider}from"../core/loaders/ConfigurationProvider.js";import{Logger}from"../utils/logger.js";import{requirementService}from"./RequirementService.js";import{InstallOperationManager}from"../core/loaders/InstallOperationManager.js";import*as RecordingConstants from"../core/metadatas/recordingConstants.js";export class InstallationService{constructor(){}async install(e,r,t){const n=await InstallOperationManager.getInstance(e,r).resetOperation(),s=ConfigurationProvider.getInstance(),a=t.targetClients||[];if(t.requirements&&t.requirements.length>0&&n.recordingAsync((()=>requirementService.processRequirementUpdates(e,r,t)),{stepName:RecordingConstants.STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE,onError:e=>{const r=`Error in background requirement updates: ${e instanceof Error?e.message:String(e)}`;return Logger.error(r),r},onComplete:()=>{0===a.length&&n.markOverallStatus("completed","Requirement updates completed.")}}),!a||0===a.length){return{success:!0,message:"No clients specified for installation."}}const i="Server and clients are already installed and ready";if(await n.recording((()=>s.isServerReady(e,r,a)),{stepName:RecordingConstants.STEP_CHECK_SERVER_READINESS,inProgressMessage:"Checking if server is already ready.",endMessage:e=>e?"Server and clients are already installed and ready":"Server is not ready. Proceeding with installation."}))return{success:!0,message:i,status:[{status:"completed",type:"install",target:"server",message:i}]};const o=new ClientInstaller(e,r,a),l=await requirementService.checkAndInstallRequirements(e,r,t);return await requirementService.checkServerRequirementForUpdateAsync(e,r).then((()=>{Logger.info(`Requirement check for ${e}:${r} completed successfully.`)})).catch((t=>{Logger.error(`Requirement check for ${e}:${r} failed: ${t instanceof Error?t.message:String(t)}`)})),l&&!l.success?(await n.recordStep("RequirementInstallationCheck","failed",l.error?.message||l.message||"Requirement installation failed."),l):await o.install(t)}}
|
|
1
|
+
import{ClientInstaller}from"../core/installers/clients/ClientInstaller.js";import{ConfigurationProvider}from"../core/loaders/ConfigurationProvider.js";import{Logger}from"../utils/logger.js";import{requirementService}from"./RequirementService.js";import{InstallOperationManager}from"../core/loaders/InstallOperationManager.js";import*as RecordingConstants from"../core/metadatas/recordingConstants.js";export class InstallationService{constructor(){}async install(e,r,t){const n=await InstallOperationManager.getInstance(e,r).resetOperation(),s=ConfigurationProvider.getInstance(),a=t.targetClients||[];if(t.forceRequirementReinstall&&(Logger.log(`Reinstall requested: resetting requirement status for ${e}/${r}`),await s.markRequirementsForReinstall(e,r)),t.requirements&&t.requirements.length>0&&n.recordingAsync((()=>requirementService.processRequirementUpdates(e,r,t)),{stepName:RecordingConstants.STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE,onError:e=>{const r=`Error in background requirement updates: ${e instanceof Error?e.message:String(e)}`;return Logger.error(r),r},onComplete:()=>{0===a.length&&n.markOverallStatus("completed","Requirement updates completed.")}}),!a||0===a.length){return{success:!0,message:"No clients specified for installation."}}const i="Server and clients are already installed and ready";if(await n.recording((()=>s.isServerReady(e,r,a)),{stepName:RecordingConstants.STEP_CHECK_SERVER_READINESS,inProgressMessage:"Checking if server is already ready.",endMessage:e=>e?"Server and clients are already installed and ready":"Server is not ready. Proceeding with installation."}))return{success:!0,message:i,status:[{status:"completed",type:"install",target:"server",message:i}]};const o=new ClientInstaller(e,r,a),l=await requirementService.checkAndInstallRequirements(e,r,t);return await requirementService.checkServerRequirementForUpdateAsync(e,r).then((()=>{Logger.info(`Requirement check for ${e}:${r} completed successfully.`)})).catch((t=>{Logger.error(`Requirement check for ${e}:${r} failed: ${t instanceof Error?t.message:String(t)}`)})),l&&!l.success?(await n.recordStep("RequirementInstallationCheck","failed",l.error?.message||l.message||"Requirement installation failed."),l):await o.install(t)}}
|
|
2
2
|
//# sourceMappingURL=InstallationService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ClientInstaller","ConfigurationProvider","Logger","requirementService","InstallOperationManager","RecordingConstants","InstallationService","constructor","install","categoryName","serverName","options","recoder","getInstance","resetOperation","configProvider","clients","targetClients","requirements","length","recordingAsync","processRequirementUpdates","stepName","STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE","onError","error","errorMsg","Error","message","String","onComplete","markOverallStatus","success","readyMessage","recording","isServerReady","STEP_CHECK_SERVER_READINESS","inProgressMessage","endMessage","ready","status","type","target","clientInstaller","requirementsResult","checkAndInstallRequirements","checkServerRequirementForUpdateAsync","then","info","catch","recordStep"],"sources":["../../src/services/InstallationService.ts"],"mappings":"OAISA,oBAAuB,uDACvBC,0BAA6B,kDAC7BC,WAAc,4BACdC,uBAA0B,iCAC1BC,4BAA+B,uDAC5BC,uBAAwB,iDAK9B,MAAOC,oBAEX,WAAAC,GAEA,CASA,aAAMC,CAAQC,EAAsBC,EAAoBC,GAEtD,MAAMC,QAAgBR,wBAAwBS,YAAYJ,EAAcC,GAAYI,iBAC9EC,EAAiBd,sBAAsBY,cAEvCG,EAAUL,EAAQM,eAAiB,
|
|
1
|
+
{"version":3,"names":["ClientInstaller","ConfigurationProvider","Logger","requirementService","InstallOperationManager","RecordingConstants","InstallationService","constructor","install","categoryName","serverName","options","recoder","getInstance","resetOperation","configProvider","clients","targetClients","forceRequirementReinstall","log","markRequirementsForReinstall","requirements","length","recordingAsync","processRequirementUpdates","stepName","STEP_PROCESS_REQUIREMENT_UPDATES_SERVICE","onError","error","errorMsg","Error","message","String","onComplete","markOverallStatus","success","readyMessage","recording","isServerReady","STEP_CHECK_SERVER_READINESS","inProgressMessage","endMessage","ready","status","type","target","clientInstaller","requirementsResult","checkAndInstallRequirements","checkServerRequirementForUpdateAsync","then","info","catch","recordStep"],"sources":["../../src/services/InstallationService.ts"],"mappings":"OAISA,oBAAuB,uDACvBC,0BAA6B,kDAC7BC,WAAc,4BACdC,uBAA0B,iCAC1BC,4BAA+B,uDAC5BC,uBAAwB,iDAK9B,MAAOC,oBAEX,WAAAC,GAEA,CASA,aAAMC,CAA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,aAAiBE,MAAQF,EAAMG,QAAUC,OAAOJ,KAAS,IAGrImB,IAAuBA,EAAmBZ,eACtCvB,EAAQyC,WAAW,+BAAgC,SAAUN,EAAmBnB,OAAOG,SAAWgB,EAAmBhB,SAAW,oCAC/HgB,SAGID,EAAgBtC,QAAQG,EACvC","ignoreList":[]}
|
|
@@ -21,14 +21,13 @@ export declare class RequirementService {
|
|
|
21
21
|
*/
|
|
22
22
|
checkAndInstallRequirements(categoryName: string, serverName: string, options: ServerInstallOptions): Promise<ServerOperationResult | null>;
|
|
23
23
|
/**
|
|
24
|
-
* Installs requirements
|
|
25
|
-
* Requirements with the same order are installed in parallel.
|
|
24
|
+
* Installs requirements (groups with the same order are processed in parallel).
|
|
26
25
|
* @param categoryName The category name.
|
|
27
26
|
* @param feedConfig The feed configuration.
|
|
28
27
|
* @param sortedRequirements Array of requirements sorted by order.
|
|
29
28
|
* @param options The installation options.
|
|
30
29
|
*/
|
|
31
|
-
private
|
|
30
|
+
private installRequirements;
|
|
32
31
|
/**
|
|
33
32
|
* Helper to update requirement status for failure case.
|
|
34
33
|
* @param categoryName The category name.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createInstallerFactory}from"../core/installers/index.js";import{exec}from"child_process";import util from"util";import{configProvider,ConfigurationProvider}from"../core/loaders/ConfigurationProvider.js";import{Logger}from"../utils/logger.js";import{updateCheckTracker}from"../utils/UpdateCheckTracker.js";import{InstallOperationManager}from"../core/loaders/InstallOperationManager.js";import*as RecordingConstants from"../core/metadatas/recordingConstants.js";import{systemSettingsManager}from"../core/loaders/SystemSettingsManager.js";export class RequirementService{static instance;installerFactory;constructor(){this.installerFactory=createInstallerFactory(util.promisify(exec))}static getInstance(){return RequirementService.instance||(RequirementService.instance=new RequirementService),RequirementService.instance}generateOperationId(){return`install-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}async checkAndInstallRequirements(e,t,r){const n=InstallOperationManager.getInstance(e,t);return n.recording((async()=>{const a=ConfigurationProvider.getInstance(),s=await a.getFeedConfiguration(e);if(!s){const e="Feed configuration not found";return{success:!1,message:e,status:[{status:"failed",type:"install",target:"server",message:e}]}}const i=s.mcpServers.find((e=>e.name===t));if(!i?.dependencies?.requirements||0===i.dependencies.requirements.length){const r=`No requirements for ${t} in category ${e}`;return Logger.debug(r),await n.recordStep(RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,"completed",r),null}if(await n.recording((async()=>{await n.recordStep(RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,"in-progress","Checking status of all requirements.");const o=await Promise.all(i.dependencies.requirements.map((async e=>{const t=s.requirements?.find((t=>t.name===e.name))||{name:e.name,version:e.version,type:"npm"};return await this.installerFactory.checkInstallation(t,r)}))),u=await a.isRequirementsReady(e,t);for(const t of o)t.installed&&!u?await a.updateRequirementStatus(e,t.name,{...t,installed:!0}):!t.installed&&u&&await a.updateRequirementStatus(e,t.name,{...t,installed:!1});return o.every((e=>e.installed))}),{stepName:RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,inProgressMessage:`Checking status of all requirements for ${t}`,endMessage:r=>r?`Requirements for ${t} in ${e} are already installed.`:"Requirements check completed. Some requirements need installation."}))return null;const o=[...i.dependencies.requirements].sort(((e,t)=>(e.order??1/0)-(t.order??1/0)));return n.recordingAsync((()=>this.installRequirementsInBackground(e,t,s,o,r,n)),{stepName:RecordingConstants.STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND,inProgressMessage:"Starting background installation of requirements.",endMessage:()=>"Background installation of requirements completed.",onError:r=>{const n=`Error in background requirement installations for ${t} in ${e}: ${r instanceof Error?r.message:String(r)}`;return Logger.error(n),n}}),null}),{stepName:RecordingConstants.STEP_CHECK_AND_INSTALL_REQUIREMENTS,inProgressMessage:`Checking and installing requirements for ${t}`,endMessage:e=>!1===e?.success?`Requirement check/install failed: ${e.message}`:`Requirement check and install process for ${t} completed.`,onResult:e=>null===e||!1!==e.success})}async installRequirementsInBackground(e,t,r,n,a,s){const i=ConfigurationProvider.getInstance(),o=n.reduce(((e,t)=>{const r=t.order??1/0;return e[r]||(e[r]=[]),e[r].push(t),e}),{}),u=Object.keys(o).map(Number).sort(((e,t)=>e-t));for(const t of u){const n=o[t];await Promise.all(n.map((async t=>{const n=`InstallRequirement_${t.name}`;return s.recording((async()=>{let n=r.requirements?.find((e=>e.name===t.name));if(!n){n={name:t.name,version:t.version,type:"npm"};const r=`Requirement ${t.name} not found in feed's requirements definitions for category ${e}. Using default config.`;return Logger.warn(r),{installed:!0,message:r,type:n.type,name:t.name,version:t.version}}let o={...a};const u=await i.getRequirementStatus(e,t.name);"pip"===n.type&&u?.pythonEnv&&!o?.settings?.pythonEnv&&(o={...o,settings:{...o?.settings,pythonEnv:u.pythonEnv}});const c=this.installerFactory.getInstaller(n);if(!c){const r=`No installer found for requirement type: ${n.type}`;throw await this.updateRequirementFailureStatus(e,t.name,n.type,r),new Error(r)}const m=this.generateOperationId();await this.updateRequirementProgressStatus(e,t.name,n.type,m);const l=await c.install(n,s,o),d=l.installed,g=d?`Requirement ${t.name} installed successfully`:`Failed to install ${t.name}: ${l.error||"Unknown error"}`;if(await this.updateRequirementCompletionStatus(e,t.name,l,m),!d)throw new Error(g);return{...l,message:g}}),{stepName:n,inProgressMessage:`Starting installation of ${t.name}`,onResult:e=>e.installed,endMessage:e=>e.message})})))}}async updateRequirementFailureStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{name:t,type:r,installed:!1,error:n,operationStatus:{status:"failed",type:"install",target:"requirement",message:`Error installing requirement: ${n}`,operationId:this.generateOperationId()}})}async updateRequirementProgressStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{name:t,type:r,installed:!1,inProgress:!0,operationStatus:{status:"in-progress",type:"install",target:"requirement",message:`Installing requirement: ${t}`,operationId:n}})}async updateRequirementCompletionStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{...r,operationStatus:{status:r.installed?"completed":"failed",type:"install",target:"requirement",message:r.installed?`Requirement ${t} installed successfully`:`Failed to install ${t}`,operationId:n}})}validateRequirement(e){if(!e.name)throw new Error("Requirement name is required");if(!e.type)throw new Error("Requirement type is required");if("other"===e.type&&!e.registry)throw new Error('Registry must be specified for requirement type "other"');if(e.registry){const{githubRelease:t,artifacts:r}=e.registry;if(t){if(!t.repository)throw new Error("Repository is required for GitHub release registry");if(!t.assetName)throw new Error("Asset name is required for GitHub release registry")}if(r&&!r.registryUrl)throw new Error("Registry URL is required for artifacts registry")}}async checkRequirementForUpdateAsync(){(await configProvider.getServerCategories()).forEach((async e=>{if(e&&e.feedConfiguration&&e.name){await updateCheckTracker.startOperation(e.name)?(Logger.info(`Checking the status of requirements in ${e.name}`),this.checkRequirementsForUpdateInternal(e).catch((t=>{e.name&&updateCheckTracker.endOperation(e.name).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`))),Logger.error(`Error checking requirements for updates: ${t.message}`)}))):Logger.debug(`Update check already in progress for ${e.name}, skipping`)}}))}async checkServerRequirementForUpdateAsync(e,t){const r=await configProvider.getServerCategory(e);if(!r)return void Logger.error(`Server category ${e} not found`);await updateCheckTracker.startOperation(`${r.name}:${t}`)&&this.checkRequirementsForUpdateInternal(r,t).then((()=>{updateCheckTracker.endOperation(`${r.name}:${t}`).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`)))})).catch((e=>{updateCheckTracker.endOperation(`${r.name}:${t}`).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`))),Logger.error(`Error checking requirements for updates: ${e.message}`)}))}async checkRequirementsForUpdateInternal(e,t){if(e.name&&e.feedConfiguration?.requirements?.length)try{for(const r of e.feedConfiguration.requirements)if(r.version.includes("latest")){const n=e.installationStatus?.requirementsStatus[r.name];if(!n)continue;let a=t;if(a){Logger.debug(`Checking whether requirement ${r.name} has update for server ${t}`);const n=e.feedConfiguration.mcpServers.find((e=>e.name===t));if(!n?.dependencies?.requirements?.some((e=>e.name==r.name))){Logger.debug(`Requirement ${r.name} is not associated with server ${t}. Skipping update check.`);continue}}else a=e.feedConfiguration.mcpServers.find((e=>e.dependencies?.requirements?.some((e=>e.name==r.name))))?.name;if(!a){Logger.debug(`No server using requirement ${r.name}. Skipping update check.`);continue}const s=await this.checkRequirementForUpdates(r,n,e.name,a);s.availableUpdate&&e.name&&(await configProvider.updateRequirementStatus(e.name,r.name,s),e.installationStatus?.requirementsStatus&&(e.installationStatus.requirementsStatus[r.name]=s)),n.lastCheckTime=(new Date).toISOString(),await configProvider.updateRequirementStatus(e.name,r.name,n),e.installationStatus?.requirementsStatus&&(e.installationStatus.requirementsStatus[r.name]=s)}}catch(e){throw Logger.error(`Error checking requirements for updates: ${e instanceof Error?e.message:String(e)}`),e}}async checkRequirementStatus(e,t){return this.validateRequirement(e),await this.installerFactory.checkInstallation(e,t)}async checkRequirementForUpdates(e,t,r,n){this.validateRequirement(e);const a=this.installerFactory.getInstaller(e);if(!a||!a.supportCheckUpdates())return t;var s=await systemSettingsManager.getSystemSettings();const i="pip"===e.type?{settings:{pythonEnv:s.pythonEnvs?.[`${r}:${n}`]||s.pythonEnvs?.system||t.pythonEnv}}:void 0,o=await this.checkRequirementStatus(e,i);return await a.checkForUpdates(e,o)}async processRequirementUpdates(e,t,r){const n=`requirement-updates-${e}-${t}`;if(!await updateCheckTracker.startOperation(n))return void Logger.info(`Requirement updates for ${e}/${t} already in progress, skipping`);const a=InstallOperationManager.getInstance(e,t);try{await a.recording((async()=>{const t=ConfigurationProvider.getInstance(),n=await t.getFeedConfiguration(e);if(!n){const t=`Feed configuration not found for category: ${e}`;throw Logger.error(t),new Error(t)}const s=r.requirements?.map((async s=>{const i=`${RecordingConstants.STEP_INSTALL_REQUIREMENT_PREFIX}: ${s.name}`;return a.recording((async()=>{let i,o;try{if(i=n.requirements?.find((e=>e.name===s.name)),!i){const r=`Requirement configuration not found for: ${s.name}`;throw Logger.error(r),await t.updateRequirementStatus(e,s.name,{name:s.name,type:"unknown",installed:!1,inProgress:!1,error:r,operationStatus:{status:"failed",type:"update",target:"requirement",message:r}}),new Error(r)}if(o=await t.getRequirementStatus(e,s.name),!o){const r=`No current status found for requirement: ${s.name}`;throw Logger.error(r),await t.updateRequirementStatus(e,s.name,{name:s.name,type:i.type,installed:!1,inProgress:!1,error:r,operationStatus:{status:"failed",type:"update",target:"requirement",message:r}}),new Error(r)}Logger.info(`Updating ${s.name} from ${o.version||"unknown"} to ${s.version}`),await t.updateRequirementStatus(e,s.name,{...o,name:s.name,type:o.type||i.type||"unknown",installed:o.installed||!1,inProgress:!0,operationStatus:{status:"in-progress",type:"update",target:"requirement",message:`Updating ${s.name} from ${o.version||"unknown"} to ${s.version}`}});let u={...r};"pip"===i.type&&o.pythonEnv&&!u?.settings?.pythonEnv&&(u={...u,settings:{...u?.settings,pythonEnv:o.pythonEnv}});const c=await this.updateRequirement(i,s.version,a,u),m=`Successfully updated ${s.name} to version ${s.version}`,l=`Failed to update ${s.name} to version ${s.version}. Error: ${c.error||"Unknown"}`;if(await t.updateRequirementStatus(e,s.name,{...c,name:s.name,type:c.type||o.type||i.type||"unknown",installed:c.installed,inProgress:!1,operationStatus:{status:c.installed?"completed":"failed",type:"update",target:"requirement",message:c.installed?m:l},availableUpdate:c.installed?void 0:o.availableUpdate}),!c.installed)throw Logger.error(l),new Error(l);return Logger.info(m),c}catch(r){const n=`Error updating requirement ${s.name}: ${r instanceof Error?r.message:String(r)}`;throw Logger.error(n),await t.updateRequirementStatus(e,s.name,{name:s.name,type:i?.type||o?.type||"unknown",installed:!1,inProgress:!1,error:r instanceof Error?r.message:String(r),operationStatus:{status:"failed",type:"update",target:"requirement",message:n}}),r}}),{stepName:i,inProgressMessage:`Processing update for requirement ${s.name}`,onResult:e=>e.installed})}));s&&await Promise.all(s)}),{stepName:RecordingConstants.STEP_PROCESS_REQUIREMENT_UPDATES,inProgressMessage:`Starting to process requirement updates for ${t}`,endMessage:()=>`Finished processing requirement updates for ${t}`})}finally{await updateCheckTracker.endOperation(n)}}async updateRequirement(e,t,r,n){this.validateRequirement(e);const a={...e,version:e.version.includes("latest")?e.version:t};return await this.installerFactory.install(a,r,n)}}export const requirementService=RequirementService.getInstance();
|
|
1
|
+
import{createInstallerFactory}from"../core/installers/index.js";import{exec}from"child_process";import util from"util";import{configProvider,ConfigurationProvider}from"../core/loaders/ConfigurationProvider.js";import{Logger}from"../utils/logger.js";import{updateCheckTracker}from"../utils/UpdateCheckTracker.js";import{InstallOperationManager}from"../core/loaders/InstallOperationManager.js";import*as RecordingConstants from"../core/metadatas/recordingConstants.js";import{systemSettingsManager}from"../core/loaders/SystemSettingsManager.js";export class RequirementService{static instance;installerFactory;constructor(){this.installerFactory=createInstallerFactory(util.promisify(exec))}static getInstance(){return RequirementService.instance||(RequirementService.instance=new RequirementService),RequirementService.instance}generateOperationId(){return`install-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}async checkAndInstallRequirements(e,t,r){const n=InstallOperationManager.getInstance(e,t);return n.recording((async()=>{const a=ConfigurationProvider.getInstance(),s=await a.getFeedConfiguration(e);if(!s){const e="Feed configuration not found";return{success:!1,message:e,status:[{status:"failed",type:"install",target:"server",message:e}]}}const i=s.mcpServers.find((e=>e.name===t));if(!i?.dependencies?.requirements||0===i.dependencies.requirements.length){const r=`No requirements for ${t} in category ${e}`;return Logger.debug(r),await n.recordStep(RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,"completed",r),null}const o=!0===r?.forceRequirementReinstall;if(await n.recording((async()=>{await n.recordStep(RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,"in-progress","Checking status of all requirements.");const o=await Promise.all(i.dependencies.requirements.map((async e=>{const t=s.requirements?.find((t=>t.name===e.name))||{name:e.name,version:e.version,type:"npm"};return await this.installerFactory.checkInstallation(t,r)}))),u=await a.isRequirementsReady(e,t);for(const t of o)t.installed&&!u?await a.updateRequirementStatus(e,t.name,{...t,installed:!0}):!t.installed&&u&&await a.updateRequirementStatus(e,t.name,{...t,installed:!1});return o.every((e=>e.installed))}),{stepName:RecordingConstants.STEP_CHECKING_REQUIREMENT_STATUS,inProgressMessage:`Checking status of all requirements for ${t}`,endMessage:r=>r?`Requirements for ${t} in ${e} are already installed.`:"Requirements check completed. Some requirements need installation."})&&!o)return null;o&&Logger.log(`Force requirement reinstall requested for ${t} in ${e}. Requirements will be reinstalled.`);const u=[...i.dependencies.requirements].sort(((e,t)=>(e.order??1/0)-(t.order??1/0))),installTask=()=>this.installRequirements(e,t,s,u,r,n);if(r?.blockUntilComplete){try{await n.recording(installTask,{stepName:RecordingConstants.STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND,inProgressMessage:"Installing requirements.",endMessage:()=>"Requirement installation completed."})}catch(r){const n=r instanceof Error?r:new Error(String(r)),a=`Failed to install requirements for ${t} in ${e}: ${n.message}`;return Logger.error(a),{success:!1,message:a,error:n,status:[{status:"failed",type:"install",target:"requirement",message:a}]}}return null}return n.recordingAsync(installTask,{stepName:RecordingConstants.STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND,inProgressMessage:"Starting background installation of requirements.",endMessage:()=>"Background installation of requirements completed.",onError:r=>{const n=`Error in background requirement installations for ${t} in ${e}: ${r instanceof Error?r.message:String(r)}`;return Logger.error(n),n}}),null}),{stepName:RecordingConstants.STEP_CHECK_AND_INSTALL_REQUIREMENTS,inProgressMessage:`Checking and installing requirements for ${t}`,endMessage:e=>!1===e?.success?`Requirement check/install failed: ${e.message}`:`Requirement check and install process for ${t} completed.`,onResult:e=>null===e||!1!==e.success})}async installRequirements(e,t,r,n,a,s){const i=ConfigurationProvider.getInstance(),o=n.reduce(((e,t)=>{const r=t.order??1/0;return e[r]||(e[r]=[]),e[r].push(t),e}),{}),u=Object.keys(o).map(Number).sort(((e,t)=>e-t));for(const t of u){const n=o[t];await Promise.all(n.map((async t=>{const n=`InstallRequirement_${t.name}`;return s.recording((async()=>{let n=r.requirements?.find((e=>e.name===t.name));if(!n){n={name:t.name,version:t.version,type:"npm"};const r=`Requirement ${t.name} not found in feed's requirements definitions for category ${e}. Using default config.`;return Logger.warn(r),{installed:!0,message:r,type:n.type,name:t.name,version:t.version}}let o={...a};const u=await i.getRequirementStatus(e,t.name);"pip"===n.type&&u?.pythonEnv&&!o?.settings?.pythonEnv&&(o={...o,settings:{...o?.settings,pythonEnv:u.pythonEnv}});const c=this.installerFactory.getInstaller(n);if(!c){const r=`No installer found for requirement type: ${n.type}`;throw await this.updateRequirementFailureStatus(e,t.name,n.type,r),new Error(r)}const m=this.generateOperationId();await this.updateRequirementProgressStatus(e,t.name,n.type,m);const l=await c.install(n,s,o),g=l.installed,d=g?`Requirement ${t.name} installed successfully`:`Failed to install ${t.name}: ${l.error||"Unknown error"}`;if(await this.updateRequirementCompletionStatus(e,t.name,l,m),!g)throw new Error(d);return{...l,message:d}}),{stepName:n,inProgressMessage:`Starting installation of ${t.name}`,onResult:e=>e.installed,endMessage:e=>e.message})})))}}async updateRequirementFailureStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{name:t,type:r,installed:!1,error:n,operationStatus:{status:"failed",type:"install",target:"requirement",message:`Error installing requirement: ${n}`,operationId:this.generateOperationId()}})}async updateRequirementProgressStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{name:t,type:r,installed:!1,inProgress:!0,operationStatus:{status:"in-progress",type:"install",target:"requirement",message:`Installing requirement: ${t}`,operationId:n}})}async updateRequirementCompletionStatus(e,t,r,n){const a=ConfigurationProvider.getInstance();await a.updateRequirementStatus(e,t,{...r,operationStatus:{status:r.installed?"completed":"failed",type:"install",target:"requirement",message:r.installed?`Requirement ${t} installed successfully`:`Failed to install ${t}`,operationId:n}})}validateRequirement(e){if(!e.name)throw new Error("Requirement name is required");if(!e.type)throw new Error("Requirement type is required");if("other"===e.type&&!e.registry)throw new Error('Registry must be specified for requirement type "other"');if(e.registry){const{githubRelease:t,artifacts:r}=e.registry;if(t){if(!t.repository)throw new Error("Repository is required for GitHub release registry");if(!t.assetName)throw new Error("Asset name is required for GitHub release registry")}if(r&&!r.registryUrl)throw new Error("Registry URL is required for artifacts registry")}}async checkRequirementForUpdateAsync(){(await configProvider.getServerCategories()).forEach((async e=>{if(e&&e.feedConfiguration&&e.name){await updateCheckTracker.startOperation(e.name)?(Logger.debug(`Checking the status of requirements in ${e.name}`),this.checkRequirementsForUpdateInternal(e).catch((t=>{e.name&&updateCheckTracker.endOperation(e.name).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`))),Logger.error(`Error checking requirements for updates: ${t.message}`)}))):Logger.debug(`Update check already in progress for ${e.name}, skipping`)}}))}async checkServerRequirementForUpdateAsync(e,t){const r=await configProvider.getServerCategory(e);if(!r)return void Logger.error(`Server category ${e} not found`);await updateCheckTracker.startOperation(`${r.name}:${t}`)&&this.checkRequirementsForUpdateInternal(r,t).then((()=>{updateCheckTracker.endOperation(`${r.name}:${t}`).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`)))})).catch((e=>{updateCheckTracker.endOperation(`${r.name}:${t}`).catch((e=>console.error(`Failed to mark update check as complete: ${e.message}`))),Logger.error(`Error checking requirements for updates: ${e.message}`)}))}async checkRequirementsForUpdateInternal(e,t){if(e.name&&e.feedConfiguration?.requirements?.length)try{for(const r of e.feedConfiguration.requirements)if(r.version.includes("latest")){const n=e.installationStatus?.requirementsStatus[r.name];if(!n)continue;let a=t;if(a){Logger.debug(`Checking whether requirement ${r.name} has update for server ${t}`);const n=e.feedConfiguration.mcpServers.find((e=>e.name===t));if(!n?.dependencies?.requirements?.some((e=>e.name==r.name))){Logger.debug(`Requirement ${r.name} is not associated with server ${t}. Skipping update check.`);continue}}else a=e.feedConfiguration.mcpServers.find((e=>e.dependencies?.requirements?.some((e=>e.name==r.name))))?.name;if(!a){Logger.debug(`No server using requirement ${r.name}. Skipping update check.`);continue}const s=await this.checkRequirementForUpdates(r,n,e.name,a);s.availableUpdate&&e.name&&(await configProvider.updateRequirementStatus(e.name,r.name,s),e.installationStatus?.requirementsStatus&&(e.installationStatus.requirementsStatus[r.name]=s)),n.lastCheckTime=(new Date).toISOString(),await configProvider.updateRequirementStatus(e.name,r.name,n),e.installationStatus?.requirementsStatus&&(e.installationStatus.requirementsStatus[r.name]=s)}}catch(e){throw Logger.error(`Error checking requirements for updates: ${e instanceof Error?e.message:String(e)}`),e}}async checkRequirementStatus(e,t){return this.validateRequirement(e),await this.installerFactory.checkInstallation(e,t)}async checkRequirementForUpdates(e,t,r,n){this.validateRequirement(e);const a=this.installerFactory.getInstaller(e);if(!a||!a.supportCheckUpdates())return t;var s=await systemSettingsManager.getSystemSettings();const i="pip"===e.type?{settings:{pythonEnv:s.pythonEnvs?.[`${r}:${n}`]||s.pythonEnvs?.system||t.pythonEnv}}:void 0,o=await this.checkRequirementStatus(e,i);return await a.checkForUpdates(e,o)}async processRequirementUpdates(e,t,r){const n=`requirement-updates-${e}-${t}`;if(!await updateCheckTracker.startOperation(n))return void Logger.info(`Requirement updates for ${e}/${t} already in progress, skipping`);const a=InstallOperationManager.getInstance(e,t);try{await a.recording((async()=>{const t=ConfigurationProvider.getInstance(),n=await t.getFeedConfiguration(e);if(!n){const t=`Feed configuration not found for category: ${e}`;throw Logger.error(t),new Error(t)}const s=r.requirements?.map((async s=>{const i=`${RecordingConstants.STEP_INSTALL_REQUIREMENT_PREFIX}: ${s.name}`;return a.recording((async()=>{let i,o;try{if(i=n.requirements?.find((e=>e.name===s.name)),!i){const r=`Requirement configuration not found for: ${s.name}`;throw Logger.error(r),await t.updateRequirementStatus(e,s.name,{name:s.name,type:"unknown",installed:!1,inProgress:!1,error:r,operationStatus:{status:"failed",type:"update",target:"requirement",message:r}}),new Error(r)}if(o=await t.getRequirementStatus(e,s.name),!o){const r=`No current status found for requirement: ${s.name}`;throw Logger.error(r),await t.updateRequirementStatus(e,s.name,{name:s.name,type:i.type,installed:!1,inProgress:!1,error:r,operationStatus:{status:"failed",type:"update",target:"requirement",message:r}}),new Error(r)}Logger.info(`Updating ${s.name} from ${o.version||"unknown"} to ${s.version}`),await t.updateRequirementStatus(e,s.name,{...o,name:s.name,type:o.type||i.type||"unknown",installed:o.installed||!1,inProgress:!0,operationStatus:{status:"in-progress",type:"update",target:"requirement",message:`Updating ${s.name} from ${o.version||"unknown"} to ${s.version}`}});let u={...r};"pip"===i.type&&o.pythonEnv&&!u?.settings?.pythonEnv&&(u={...u,settings:{...u?.settings,pythonEnv:o.pythonEnv}});const c=await this.updateRequirement(i,s.version,a,u),m=`Successfully updated ${s.name} to version ${s.version}`,l=`Failed to update ${s.name} to version ${s.version}. Error: ${c.error||"Unknown"}`;if(await t.updateRequirementStatus(e,s.name,{...c,name:s.name,type:c.type||o.type||i.type||"unknown",installed:c.installed,inProgress:!1,operationStatus:{status:c.installed?"completed":"failed",type:"update",target:"requirement",message:c.installed?m:l},availableUpdate:c.installed?void 0:o.availableUpdate}),!c.installed)throw Logger.error(l),new Error(l);return Logger.info(m),c}catch(r){const n=`Error updating requirement ${s.name}: ${r instanceof Error?r.message:String(r)}`;throw Logger.error(n),await t.updateRequirementStatus(e,s.name,{name:s.name,type:i?.type||o?.type||"unknown",installed:!1,inProgress:!1,error:r instanceof Error?r.message:String(r),operationStatus:{status:"failed",type:"update",target:"requirement",message:n}}),r}}),{stepName:i,inProgressMessage:`Processing update for requirement ${s.name}`,onResult:e=>e.installed})}));s&&await Promise.all(s)}),{stepName:RecordingConstants.STEP_PROCESS_REQUIREMENT_UPDATES,inProgressMessage:`Starting to process requirement updates for ${t}`,endMessage:()=>`Finished processing requirement updates for ${t}`})}finally{await updateCheckTracker.endOperation(n)}}async updateRequirement(e,t,r,n){this.validateRequirement(e);const a={...e,version:e.version.includes("latest")?e.version:t};return await this.installerFactory.install(a,r,n)}}export const requirementService=RequirementService.getInstance();
|
|
2
2
|
//# sourceMappingURL=RequirementService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createInstallerFactory","exec","util","configProvider","ConfigurationProvider","Logger","updateCheckTracker","InstallOperationManager","RecordingConstants","systemSettingsManager","RequirementService","static","installerFactory","constructor","this","promisify","getInstance","instance","generateOperationId","Date","now","Math","random","toString","substr","checkAndInstallRequirements","categoryName","serverName","options","recoder","recording","async","feedConfig","getFeedConfiguration","errorMsg","success","message","status","type","target","serverConfig","mcpServers","find","s","name","dependencies","requirements","length","msg","debug","recordStep","STEP_CHECKING_REQUIREMENT_STATUS","requirementStatuses","Promise","all","map","req","reqConfig","r","version","checkInstallation","requirementsReady","isRequirementsReady","installed","updateRequirementStatus","every","stepName","inProgressMessage","endMessage","ready","sortedRequirements","sort","a","b","order","Infinity","recordingAsync","installRequirementsInBackground","STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND","onError","err","Error","String","error","STEP_CHECK_AND_INSTALL_REQUIREMENTS","result","onResult","requirementGroups","reduce","groups","push","orderKeys","Object","keys","Number","group","requirement","requirementConfig","warnMsg","warn","currentOptions","currentStatus","getRequirementStatus","pythonEnv","settings","installer","getInstaller","updateRequirementFailureStatus","operationId","updateRequirementProgressStatus","installStatus","install","updateRequirementCompletionStatus","requirementName","requirementType","errorMessage","operationStatus","inProgress","validateRequirement","registry","githubRelease","artifacts","repository","assetName","registryUrl","checkRequirementForUpdateAsync","getServerCategories","forEach","serverCategory","feedConfiguration","startOperation","info","checkRequirementsForUpdateInternal","catch","endOperation","lockError","console","checkServerRequirementForUpdateAsync","getServerCategory","then","includes","installationStatus","requirementsStatus","providedServerName","some","updatedStatus","checkRequirementForUpdates","availableUpdate","lastCheckTime","toISOString","checkRequirementStatus","supportCheckUpdates","systemSettings","getSystemSettings","pythonEnvs","system","undefined","checkForUpdates","processRequirementUpdates","operationKey","updatePromises","reqToUpdate","STEP_INSTALL_REQUIREMENT_PREFIX","updateRequirement","successMessage","failureMessage","STEP_PROCESS_REQUIREMENT_UPDATES","updateVersion","recorder","updatedRequirement","requirementService"],"sources":["../../src/services/RequirementService.ts"],"mappings":"OAUSA,2BAAgD,qCAChDC,SAAY,uBACdC,SAAU,cACRC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D,OAAO8E,MAAMkF,GACP,IAAIpF,MAAMoF,GAGpB,OADAhK,OAAO8H,KAAKiC,GACLnB,CACX,CAAE,MAAO9D,GACL,MAAMjD,EAAW,8BAA8B+H,EAAYrH,SAASuC,aAAiBF,MAAQE,EAAM/C,QAAU8C,OAAOC,KASpH,MARA9E,OAAO8E,MAAMjD,SACP/B,EAAe6D,wBAAwBtC,EAAcuI,EAAYrH,KAAM,CACzEA,KAAMqH,EAAYrH,KAClBN,KAAMmB,GAAWnB,MAAQ+D,GAAe/D,MAAQ,UAChDyB,WAAW,EAAOsD,YAAY,EAC9BlC,MAAOA,aAAiBF,MAAQE,EAAM/C,QAAU8C,OAAOC,GACvDiC,gBAAiB,CAAE/E,OAAQ,SAAUC,KAAM,SAAUC,OAAQ,cAAeH,QAASF,KAEnFiD,CACV,IAEJ,CACIjB,SAAUA,EACVC,kBAAmB,qCAAqC8F,EAAYrH,OACpE0C,SAAWjD,GAAWA,EAAO0B,WAEpC,IAGDiG,SACM3G,QAAQC,IAAI0G,EACtB,GACD,CACC9F,SAAU1D,mBAAmB8J,iCAC7BnG,kBAAmB,+CAA+CxC,IAElEyC,WAAY,IAAM,+CAA+CzC,KAEzE,C,cACUrB,mBAAmBgI,aAAayB,EAC1C,CACJ,CASQ,uBAAMI,CAAkBnE,EAAgCuE,EAAuBC,EAAmC5I,GACtHd,KAAKwG,oBAAoBtB,GACzB,MAAMyE,EAAwC,IACvCzE,EACHrC,QAASqC,EAAYrC,QAAQiF,SAAS,UAAY5C,EAAYrC,QAAU4G,GAE5E,aAAazJ,KAAKF,iBAAiBmG,QAAQ0D,EAAoBD,EAAU5I,EAC7E,SAIG,MAAM8I,mBAAqBhK,mBAAmBM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createInstallerFactory","exec","util","configProvider","ConfigurationProvider","Logger","updateCheckTracker","InstallOperationManager","RecordingConstants","systemSettingsManager","RequirementService","static","installerFactory","constructor","this","promisify","getInstance","instance","generateOperationId","Date","now","Math","random","toString","substr","checkAndInstallRequirements","categoryName","serverName","options","recoder","recording","async","feedConfig","getFeedConfiguration","errorMsg","success","message","status","type","target","serverConfig","mcpServers","find","s","name","dependencies","requirements","length","msg","debug","recordStep","STEP_CHECKING_REQUIREMENT_STATUS","forceReinstall","forceRequirementReinstall","requirementStatuses","Promise","all","map","req","reqConfig","r","version","checkInstallation","requirementsReady","isRequirementsReady","installed","updateRequirementStatus","every","stepName","inProgressMessage","endMessage","ready","log","sortedRequirements","sort","a","b","order","Infinity","installTask","installRequirements","blockUntilComplete","STEP_INSTALLING_REQUIREMENTS_IN_BACKGROUND","err","errorObj","Error","String","error","recordingAsync","onError","STEP_CHECK_AND_INSTALL_REQUIREMENTS","result","onResult","requirementGroups","reduce","groups","push","orderKeys","Object","keys","Number","group","requirement","requirementConfig","warnMsg","warn","currentOptions","currentStatus","getRequirementStatus","pythonEnv","settings","installer","getInstaller","updateRequirementFailureStatus","operationId","updateRequirementProgressStatus","installStatus","install","updateRequirementCompletionStatus","requirementName","requirementType","errorMessage","operationStatus","inProgress","validateRequirement","registry","githubRelease","artifacts","repository","assetName","registryUrl","checkRequirementForUpdateAsync","getServerCategories","forEach","serverCategory","feedConfiguration","startOperation","checkRequirementsForUpdateInternal","catch","endOperation","lockError","console","checkServerRequirementForUpdateAsync","getServerCategory","then","includes","installationStatus","requirementsStatus","providedServerName","some","updatedStatus","checkRequirementForUpdates","availableUpdate","lastCheckTime","toISOString","checkRequirementStatus","supportCheckUpdates","systemSettings","getSystemSettings","pythonEnvs","system","undefined","checkForUpdates","processRequirementUpdates","operationKey","info","updatePromises","reqToUpdate","STEP_INSTALL_REQUIREMENT_PREFIX","updateRequirement","successMessage","failureMessage","STEP_PROCESS_REQUIREMENT_UPDATES","updateVersion","recorder","updatedRequirement","requirementService"],"sources":["../../src/services/RequirementService.ts"],"mappings":"OAUSA,2BAAgD,qCAChDC,SAAY,uBACdC,SAAU,cACRC,eAAgBC,0BAA6B,kDAC7CC,WAAc,4BACdC,uB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+CAA+C1C,IAElE2C,WAAY,IAAM,+CAA+C3C,KAEzE,C,cACUrB,mBAAmBqI,aAAayB,EAC1C,CACJ,CASQ,uBAAMK,CAAkBnE,EAAgCuE,EAAuBC,EAAmClJ,GACtHd,KAAK8G,oBAAoBtB,GACzB,MAAMyE,EAAwC,IACvCzE,EACHzC,QAASyC,EAAYzC,QAAQoF,SAAS,UAAY3C,EAAYzC,QAAUgH,GAE5E,aAAa/J,KAAKF,iBAAiByG,QAAQ0D,EAAoBD,EAAUlJ,EAC7E,SAIG,MAAMoJ,mBAAqBtK,mBAAmBM","ignoreList":[]}
|
|
@@ -33,6 +33,11 @@ export declare class ServerService {
|
|
|
33
33
|
* Validates server names
|
|
34
34
|
*/
|
|
35
35
|
validateServerName(category: string, names: string | string[]): Promise<boolean>;
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the category for each server name by inspecting the loaded feed configurations.
|
|
38
|
+
* Throws if a server cannot be found or if duplicates exist across categories.
|
|
39
|
+
*/
|
|
40
|
+
resolveServerCategories(serverNames: string[]): Promise<Record<string, string>>;
|
|
36
41
|
/**
|
|
37
42
|
* Formats success/error messages for operations
|
|
38
43
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import path from"path";import{fileURLToPath}from"url";import{Logger}from"../utils/logger.js";import{ServerSchemaProvider}from"../core/loaders/ServerSchemaProvider.js";import{mcpManager}from"./MCPManager.js";const __dirname=path.dirname(fileURLToPath(import.meta.url));export class ServerService{async listServerCategories(e={}){return mcpManager.listServerCategories(e)}async getServerCategory(e){return(await this.listServerCategories()).find((r=>r.name===e))}async getServerSchema(e,r){try{const
|
|
1
|
+
import path from"path";import{fileURLToPath}from"url";import{Logger}from"../utils/logger.js";import{ServerSchemaProvider}from"../core/loaders/ServerSchemaProvider.js";import{mcpManager}from"./MCPManager.js";const __dirname=path.dirname(fileURLToPath(import.meta.url));export class ServerService{async listServerCategories(e={}){return mcpManager.listServerCategories(e)}async getServerCategory(e){return(await this.listServerCategories()).find((r=>r.name===e))}async getServerSchema(e,r){try{const t=ServerSchemaProvider.getInstance(),a=await mcpManager.getServerMcpConfig(e,r);return await t.getSchema(e,a?.schemas||`${r}.json`)}catch(t){throw Logger.error(`Failed to get schema for server ${r} in category ${e}:`,t),t}}async installMcpServer(e,r,t={}){Logger.debug(`Installing MCP server: ${JSON.stringify({category:e,serverName:r,options:t})}`);try{const a=await mcpManager.installServer(e,r,t);return Logger.debug(`Installation result: ${JSON.stringify(a)}`),a}catch(e){throw Logger.error(`Failed to install MCP server: ${r}`,e),e}}async uninstallMcpServer(e,r,t={}){Logger.debug(`Uninstalling MCP server: ${JSON.stringify({category:e,serverName:r,options:t})}`);try{const a=await mcpManager.uninstallServer(e,r,t);return Logger.debug(`Uninstallation result: ${JSON.stringify(a)}`),a}catch(e){throw Logger.error(`Failed to uninstall MCP server: ${r}`,e),e}}async validateServerName(e,r){const t=Array.isArray(r)?r:[r];Logger.debug(`Validating server names: ${JSON.stringify({category:e,names:t})}`);const a=await mcpManager.getFeedConfiguration(e);if(!a)return Logger.debug(`Validation failed: Category "${e}" not found in feeds`),!1;const n=t.filter((e=>!a.mcpServers.some((r=>r.name===e))));return!(n.length>0)||(Logger.debug(`Validation failed: Servers "${n.join(", ")}" not found in category "${e}"`),!1)}async resolveServerCategories(e){const r=await this.listServerCategories(),t=new Map;for(const e of r){const r=e.feedConfiguration?.mcpServers??[];for(const a of r){const r=t.get(a.name)??[];r.push(e.name),t.set(a.name,r)}}const a=[],n={};for(const r of e){const e=t.get(r)??[];if(0!==e.length){if(e.length>1)throw new Error(`Server "${r}" exists in multiple categories (${e.join(", ")}). Server names must be unique across categories.`);n[r]=e[0]}else a.push(r)}if(a.length>0)throw new Error(`Servers not found in feeds: ${a.join(", ")}. Try running "imcp pull" to refresh your local feeds.`);return n}formatOperationResults(e){return{success:e.every((e=>e.success)),messages:e.map((e=>e.message)).filter((e=>void 0!==e))}}async syncFeeds(){return mcpManager.syncFeeds()}async onboardFeed(e){try{const r=await mcpManager.onboardFeed(e);return Logger.log(`Feed onboarding process for '${e.name}' initiated with status: ${r.status}, ID: ${r.onboardingId}`),r}catch(r){throw Logger.error(`Failed to initiate feed onboarding for '${e.name}':`,r),r}}}export const serverService=new ServerService;
|
|
2
2
|
//# sourceMappingURL=ServerService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","fileURLToPath","Logger","ServerSchemaProvider","mcpManager","__dirname","dirname","url","ServerService","listServerCategories","options","getServerCategory","categoryName","this","find","s","name","getServerSchema","serverName","provider","getInstance","serverMcpConfig","getServerMcpConfig","getSchema","schemas","error","installMcpServer","category","debug","JSON","stringify","result","installServer","uninstallMcpServer","uninstallServer","validateServerName","names","serverNames","Array","isArray","feedConfig","getFeedConfiguration","invalidServers","filter","mcpServers","some","server","length","join","formatOperationResults","results","success","every","r","messages","map","message","m","undefined","syncFeeds","onboardFeed","config","log","status","onboardingId","serverService"],"sources":["../../src/services/ServerService.ts"],"mappings":"OAAOA,SAAU,cACRC,kBAAqB,aACrBC,WAAc,4BACAC,yBAA4B,iDAU1CC,eAAkB,kBAG3B,MAAMC,UAAYL,KAAKM,QAAQL,0BAA0BM,aAMnD,MAAOC,cAIX,0BAAMC,CAAqBC,EAAqC,IAC9D,OAAON,WAAWK,qBAAqBC,EACzC,CAKA,uBAAMC,CAAkBC,GAGtB,aAF+BC,KAAKJ,wBACIK,MAAKC,GAAKA,EAAEC,OAASJ,GAE/D,CAKA,qBAAMK,CAAgBL,EAAsBM,GAC1C,IACE,MAAMC,EAAWhB,qBAAqBiB,cAChCC,QAAwBjB,WAAWkB,mBAAmBV,EAAcM,GAC1E,aAAaC,EAASI,UAAUX,EAAcS,GAAiBG,SAAW,GAAGN,SAC/E,CAAE,MAAOO,GAEP,MADAvB,OAAOuB,MAAM,mCAAmCP,iBAA0BN,KAAiBa,GACrFA,CACR,CACF,CAKA,sBAAMC,CACJC,EACAT,EACAR,EAAgC,IAEhCR,OAAO0B,MAAM,0BAA0BC,KAAKC,UAAU,CAAEH,WAAUT,aAAYR,eAC9E,IACE,MAAMqB,QAAe3B,WAAW4B,cAAcL,EAAUT,EAAYR,GAEpE,OADAR,OAAO0B,MAAM,wBAAwBC,KAAKC,UAAUC,MAC7CA,CACT,CAAE,MAAON,GAEP,MADAvB,OAAOuB,MAAM,iCAAiCP,IAAcO,GACtDA,CACR,CACF,CAQA,wBAAMQ,CACJN,EACAT,EACAR,EAAkC,IAElCR,OAAO0B,MAAM,4BAA4BC,KAAKC,UAAU,CAAEH,WAAUT,aAAYR,eAChF,IACE,MAAMqB,QAAe3B,WAAW8B,gBAAgBP,EAAUT,EAAYR,GAEtE,OADAR,OAAO0B,MAAM,0BAA0BC,KAAKC,UAAUC,MAC/CA,CACT,CAAE,MAAON,GAEP,MADAvB,OAAOuB,MAAM,mCAAmCP,IAAcO,GACxDA,CACR,CACF,CAKA,wBAAMU,CAAmBR,EAAkBS,GACzC,MAAMC,EAAcC,MAAMC,QAAQH,GAASA,EAAQ,CAACA,GACpDlC,OAAO0B,MAAM,4BAA4BC,KAAKC,UAAU,CAAEH,WAAUS,MAAOC,OAG3E,MAAMG,QAAmBpC,WAAWqC,qBAAqBd,GACzD,IAAKa,EAEH,OADAtC,OAAO0B,MAAM,gCAAgCD,0BACtC,EAIT,MAAMe,EAAiBL,EAAYM,QAAO3B,IACvCwB,EAAWI,WAAWC,MAAKC,GAAUA,EAAO9B,OAASA,MAGxD,QAAI0B,EAAeK,OAAS,KAC1B7C,OAAO0B,MAAM,+BAA+Bc,EAAeM,KAAK,iCAAiCrB,OAC1F,EAIX,CAKA,
|
|
1
|
+
{"version":3,"names":["path","fileURLToPath","Logger","ServerSchemaProvider","mcpManager","__dirname","dirname","url","ServerService","listServerCategories","options","getServerCategory","categoryName","this","find","s","name","getServerSchema","serverName","provider","getInstance","serverMcpConfig","getServerMcpConfig","getSchema","schemas","error","installMcpServer","category","debug","JSON","stringify","result","installServer","uninstallMcpServer","uninstallServer","validateServerName","names","serverNames","Array","isArray","feedConfig","getFeedConfiguration","invalidServers","filter","mcpServers","some","server","length","join","resolveServerCategories","categories","serverToCategories","Map","feedConfiguration","list","get","push","set","missingServers","resolvedMap","matches","Error","formatOperationResults","results","success","every","r","messages","map","message","m","undefined","syncFeeds","onboardFeed","config","log","status","onboardingId","serverService"],"sources":["../../src/services/ServerService.ts"],"mappings":"OAAOA,SAAU,cACRC,kBAAqB,aACrBC,WAAc,4BACAC,yBAA4B,iDAU1CC,eAAkB,kBAG3B,MAAMC,UAAYL,KAAKM,QAAQL,0BAA0BM,aAMnD,MAAOC,cAIX,0BAAMC,CAAqBC,EAAqC,IAC9D,OAAON,WAAWK,qBAAqBC,EACzC,CAKA,uBAAMC,CAAkBC,GAGtB,aAF+BC,KAAKJ,wBACIK,MAAKC,GAAKA,EAAEC,OAASJ,GAE/D,CAKA,qBAAMK,CAAgBL,EAAsBM,GAC1C,IACE,MAAMC,EAAWhB,qBAAqBiB,cAChCC,QAAwBjB,WAAWkB,mBAAmBV,EAAcM,GAC1E,aAAaC,EAASI,UAAUX,EAAcS,GAAiBG,SAAW,GAAGN,SAC/E,CAAE,MAAOO,GAEP,MADAvB,OAAOuB,MAAM,mCAAmCP,iBAA0BN,KAAiBa,GACrFA,CACR,CACF,CAKA,sBAAMC,CACJC,EACAT,EACAR,EAAgC,IAEhCR,OAAO0B,MAAM,0BAA0BC,KAAKC,UAAU,CAAEH,WAAUT,aAAYR,eAC9E,IACE,MAAMqB,QAAe3B,WAAW4B,cAAcL,EAAUT,EAAYR,GAEpE,OADAR,OAAO0B,MAAM,wBAAwBC,KAAKC,UAAUC,MAC7CA,CACT,CAAE,MAAON,GAEP,MADAvB,OAAOuB,MAAM,iCAAiCP,IAAcO,GACtDA,CACR,CACF,CAQA,wBAAMQ,CACJN,EACAT,EACAR,EAAkC,IAElCR,OAAO0B,MAAM,4BAA4BC,KAAKC,UAAU,CAAEH,WAAUT,aAAYR,eAChF,IACE,MAAMqB,QAAe3B,WAAW8B,gBAAg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xB,CAEA,GAAIwC,EAAeX,OAAS,EAC1B,MAAM,IAAIc,MAAM,+BAA+BH,EAAeV,KAAK,+DAGrE,OAAOW,CACT,CAKA,sBAAAG,CAAuBC,GAIrB,MAAO,CACLC,QAASD,EAAQE,OAAMC,GAAKA,EAAEF,UAC9BG,SAAUJ,EAAQK,KAAIF,GAAKA,EAAEG,UAAS1B,QAAQ2B,QAAyBC,IAAND,IAErE,CAKA,eAAME,GACJ,OAAOpE,WAAWoE,WACpB,CAMA,iBAAMC,CAAYC,GAChB,IACE,MAAM3C,QAAe3B,WAAWqE,YAAYC,GAI5C,OADAxE,OAAOyE,IAAI,gCAAgCD,EAAO1D,gCAAgCe,EAAO6C,eAAe7C,EAAO8C,gBACxG9C,CACT,CAAE,MAAON,GAEP,MADAvB,OAAOuB,MAAM,2CAA2CiD,EAAO1D,SAAUS,GACnEA,CACR,CACF,SAIK,MAAMqD,cAAgB,IAAItE","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as appInsights from"applicationinsights";import{INSTRUMENTATION_KEY}from"../core/metadatas/constants.js";export class TelemetryService{static client=null;static instrumentationKey=`InstrumentationKey=${INSTRUMENTATION_KEY}`;static{try{const t=new appInsights.TelemetryClient(TelemetryService.instrumentationKey);t.config.disableAppInsights=!1,t.config.maxBatchSize=250,t.context.tags[t.context.keys.cloudRole]="imcp",TelemetryService.client=t
|
|
1
|
+
import*as appInsights from"applicationinsights";import{INSTRUMENTATION_KEY}from"../core/metadatas/constants.js";export class TelemetryService{static client=null;static instrumentationKey=`InstrumentationKey=${INSTRUMENTATION_KEY}`;static{try{const t=new appInsights.TelemetryClient(TelemetryService.instrumentationKey);t.config.disableAppInsights=!1,t.config.maxBatchSize=250,t.context.tags[t.context.keys.cloudRole]="imcp",TelemetryService.client=t}catch(t){console.error("Failed to initialize Application Insights:",t)}}static trackEvent(t,e){this.client&&this.client.trackEvent({name:t,properties:e})}static trackException(t,e){this.client&&this.client.trackException({exception:t,properties:e})}static trackTrace(t,e){this.client&&this.client.trackTrace({message:t,properties:e})}static trackMetric(t,e){this.client&&this.client.trackMetric({name:t,value:e})}static flush(){return new Promise((t=>{this.client?(this.client.flush(),t()):t()}))}}
|
|
2
2
|
//# sourceMappingURL=TelemetryService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["appInsights","INSTRUMENTATION_KEY","TelemetryService","static","client","TelemetryClient","instrumentationKey","config","disableAppInsights","maxBatchSize","context","tags","keys","cloudRole","
|
|
1
|
+
{"version":3,"names":["appInsights","INSTRUMENTATION_KEY","TelemetryService","static","client","TelemetryClient","instrumentationKey","config","disableAppInsights","maxBatchSize","context","tags","keys","cloudRole","error","console","trackEvent","name","properties","this","trackException","exception","trackTrace","message","trackMetric","value","flush","Promise","resolve"],"sources":["../../src/services/TelemetryService.ts"],"mappings":"UAAYA,gBAAiB,6BACpBC,wBAA2B,wCAE9B,MAAOC,iBACHC,cAAoD,KACpDA,0BAAqC,sBAAsBF,6BAIjE,IACE,MAAMG,EAAS,IAAIJ,YAAYK,gBAAgBH,iBAAiBI,oBAChEF,EAAOG,OAAOC,oBAAqB,EACnCJ,EAAOG,OAAOE,aAAe,IAC7BL,EAAOM,QAAQC,KAAKP,EAAOM,QAAQE,KAAKC,WAAa,OACrDX,iBAAiBE,OAASA,CAC5B,CAAE,MAAOU,GACPC,QAAQD,MAAM,6CAA8CA,EAC9D,CACF,CAEA,iBAAOE,CAAWC,EAAcC,GACzBC,KAAKf,QAGVe,KAAKf,OAAOY,WAAW,CAAEC,OAAMC,cACjC,CAEA,qBAAOE,CAAeN,EAAcI,GAC7BC,KAAKf,QAGVe,KAAKf,OAAOgB,eAAe,CAAEC,UAAWP,EAAOI,cACjD,CAEA,iBAAOI,CAAWC,EAAiBL,GAC5BC,KAAKf,QAGVe,KAAKf,OAAOkB,WAAW,CAAEC,UAASL,cACpC,CAEA,kBAAOM,CAAYP,EAAcQ,GAC1BN,KAAKf,QAGVe,KAAKf,OAAOoB,YAAY,CAAEP,OAAMQ,SAClC,CAEA,YAAOC,GACL,OAAO,IAAIC,SAASC,IACbT,KAAKf,QAIVe,KAAKf,OAAOsB,QACZE,KAJEA,GAIO,GAEb","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type representing TOML configuration data
|
|
3
|
+
*/
|
|
4
|
+
export type TomlData = Record<string, any>;
|
|
5
|
+
/**
|
|
6
|
+
* Read a TOML file and parse it
|
|
7
|
+
* @param filePath Path to the TOML file
|
|
8
|
+
* @param createIfNotExist Whether to create the file if it doesn't exist
|
|
9
|
+
* @returns Parsed TOML content as an object
|
|
10
|
+
*/
|
|
11
|
+
export declare function readTomlFile(filePath: string, createIfNotExist?: boolean): Promise<TomlData>;
|
|
12
|
+
/**
|
|
13
|
+
* Write an object to a TOML file
|
|
14
|
+
* @param filePath Path to the TOML file
|
|
15
|
+
* @param data Object to write
|
|
16
|
+
*/
|
|
17
|
+
export declare function writeTomlFile(filePath: string, data: TomlData): Promise<void>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import*as TOML from"@iarna/toml";import{readFile,writeFile,mkdir}from"fs/promises";import{dirname}from"path";import{existsSync}from"fs";import{Logger}from"./logger.js";export async function readTomlFile(r,e=!1){try{if(!existsSync(r)){if(e)return Logger.info(`TOML file not found at ${r}, creating new one`),await mkdir(dirname(r),{recursive:!0}),await writeFile(r,"","utf8"),{};throw new Error(`TOML file not found: ${r}`)}const i=await readFile(r,"utf8");return i.trim()?TOML.parse(i):{}}catch(e){if(e instanceof Error&&e.message.includes("not found"))throw e;throw Logger.error(`Error reading TOML file ${r}: ${e instanceof Error?e.message:String(e)}`),e}}export async function writeTomlFile(r,e){try{await mkdir(dirname(r),{recursive:!0});const i=TOML.stringify(e);await writeFile(r,i,"utf8"),Logger.debug(`Successfully wrote TOML file: ${r}`)}catch(e){throw Logger.error(`Error writing TOML file ${r}: ${e instanceof Error?e.message:String(e)}`),e}}
|
|
2
|
+
//# sourceMappingURL=tomlUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TOML","readFile","writeFile","mkdir","dirname","existsSync","Logger","async","readTomlFile","filePath","createIfNotExist","info","recursive","Error","content","trim","parse","error","message","includes","String","writeTomlFile","data","tomlString","stringify","debug"],"sources":["../../src/utils/tomlUtils.ts"],"mappings":"UAAYA,SAAU,qBACbC,SAAUC,UAAWC,UAAa,qBAClCC,YAAe,cACfC,eAAkB,YAClBC,WAAc,qBAahBC,eAAeC,aAAaC,EAAkBC,MACjD,IACI,IAAKL,WAAWI,GAAW,CACvB,GAAIC,EAIA,OAHAJ,OAAOK,KAAK,0BAA0BF,6BAChCN,MAAMC,QAAQK,GAAW,CAAEG,qBAC3BV,UAAUO,EAAU,GAAI,QACvB,GAEX,MAAM,IAAII,MAAM,wBAAwBJ,IAC5C,CAEA,MAAMK,QAAgBb,SAASQ,EAAU,QACzC,OAAKK,EAAQC,OAGNf,KAAKgB,MAAMF,GAFP,EAGf,CAAE,MAAOG,GACL,GAAIA,aAAiBJ,OAASI,EAAMC,QAAQC,SAAS,aACjD,MAAMF,EAGV,MADAX,OAAOW,MAAM,2BAA2BR,MAAaQ,aAAiBJ,MAAQI,EAAMC,QAAUE,OAAOH,MAC/FA,CACV,CACJ,QAOOV,eAAec,cAAcZ,EAAkBa,GAClD,UACUnB,MAAMC,QAAQK,GAAW,CAAEG,eACjC,MAAMW,EAAavB,KAAKwB,UAAUF,SAC5BpB,UAAUO,EAAUc,EAAY,QACtCjB,OAAOmB,MAAM,iCAAiChB,IAClD,CAAE,MAAOQ,GAEL,MADAX,OAAOW,MAAM,2BAA2BR,MAAaQ,aAAiBJ,MAAQI,EAAMC,QAAUE,OAAOH,MAC/FA,CACV,CACJ","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{showToast,showConfirm}from"../notifications.js";import{showInstallLoadingModal,updateOverallInstallStatus}from"./loadingModal.js";import{uninstallTools}from"./installation.js";import{handleBulkClientInstall}from"./installation.js";import{compareVersions}from"./versionUtils.js";export function setupClientItems(e,t,n,a,s){e.forEach((e=>{const l=t.installedStatus[e]||{status:"not-installed",type:"check",target:"server"};let o="",i="";"completed"===l.status&&"install"===l.type?(o="Installed",i="installed"):"pending"===l.status?(o="Pending Requirements",i="pending"):"in-progress"===l.status?(o="In Progress",i="pending"):"failed"===l.status&&(o="Failed",i="not-installed");const r="completed"===l.status&&"install"===l.type,d="in-progress"===l.status,c=!r&&!d,m=createClientItem(e,o,i,c,r,d);setupClientItemListeners(m,e,c),setupUninstallButton(m,o,l,e,n,a,i),s.appendChild(m)})),addSectionTitle(s)}export function setupEnvironmentVariables(e,t,n){if("sse"===e.mode||"streamable-http"===e.mode)return void(t.style.display="none");const a=e.installation?.env||e.installation?.env||{};addEnvironmentTitle(t),fetch("/api/settings").then((e=>e.json())).then((s=>{const l=s&&s.data&&s.data.userConfigurations?s.data.userConfigurations:{};0===Object.keys(a).length?addNoEnvMessage(t):createEnvironmentInputs(a,t,n.clientMcpSettings,e.name,l)})).catch((()=>{0===Object.keys(a).length?addNoEnvMessage(t):createEnvironmentInputs(a,t,n.clientMcpSettings,e.name,{})}))}export function setupInstallationArguments(e,t,n,a){if(!e)return void(t.style.display="none");if("sse"===a?.mode||"streamable-http"===a?.mode){t.innerHTML="";let n=!1;return e.url&&(addArgumentsTitle(t),createReadOnlyTextBox(t,"Server URL",e.url,"sse_url"),n=!0),e.startingCommand&&(n||addArgumentsTitle(t),createReadOnlyTextBox(t,"Starting Command",e.startingCommand,"sse_starting_command"),n=!0),void(n||(t.style.display="none"))}addArgumentsTitle(t);const s=createArgumentsContainer();t.appendChild(s),e.args&&Array.isArray(e.args)?e.args.forEach((e=>{s.appendChild(createArgumentInput(e))})):s.appendChild(createArgumentInput()),("python"===e.command||e.command.includes("python"))&&addPythonEnvironmentInput(n,a.name,t)}export function setupServerRequirements(e,t,n,a,s){if("sse"===e.mode||"streamable-http"===e.mode)return void(s.style.display="none");const l=e.dependencies?.requirements||[],o=t.data.installationStatus?.requirementsStatus||{};if(l.length>0){const e=renderRequirements(l,o,n,a);s.innerHTML=`\n <h3 class="text-lg font-semibold text-gray-700 mb-3">Dependencies</h3>\n <p class="text-sm text-gray-600 mb-4">These dependencies will be automatically installed when installing the server</p>\n ${e}\n `,setupUpdateToggles(s)}else s.innerHTML='<p class="text-gray-600">No additional dependencies required.</p>'}export function setupFormSubmitHandler(e,t,n,a,s,l,o,i,r){e.onsubmit=e=>{e.preventDefault();const d={},c=[],m=[];let u;if("sse"!==r?.mode&&"streamable-http"!==r?.mode){t.querySelectorAll("input").forEach((e=>{e.name&&e.value&&(d[e.name]=e.value)}));const e=n.querySelectorAll(".arg-input");c.push(...Array.from(e).map((e=>e.value.trim())).filter((e=>""!==e)));const s=document.getElementById("python_env");u=s?.value?.trim();a.querySelectorAll(".toggle-update:checked").forEach((e=>{m.push({name:e.dataset.name,version:e.dataset.version})}))}function proceedInstall(){const e=m.length>0,t=document.querySelector(".uninstall-btn");if(!t||!t.matches(":active")){const t=window.selectedClients;if(0===t.length&&!e)return void showToast("Please select at least one client to configure.","error");let n="Starting installation...";const a=o[l]||{installedStatus:{}};if(t.length>0){const e=t[0],s=a.installedStatus?.[e]?.message;s&&(n=s)}const r={targetClients:t,env:d,args:c,settings:u?{pythonEnv:u}:{}};m.length>0&&(r.requirements=m),handleBulkClientInstall(s,l,t,d,n,i,r)}}fetch("/api/settings").then((e=>e.json())).then((e=>{const t=e&&e.data&&e.data.userConfigurations?e.data.userConfigurations:{},n=e&&e.data&&e.data.pythonEnvs?e.data.pythonEnvs:{},a={...t},o={...n};Object.keys(d).forEach((e=>{a[e]=d[e]}));let i=!1;const r=new Set([...Object.keys(t),...Object.keys(d)]);for(const e of r)if(t[e]!==a[e]){i=!0;break}let c=!1;if(void 0!==u&&u!==n[`${s}:${l}`]&&(o[`${s}:${l}`]=u,c=!0),i||c){const e={};i&&(e.userConfigurations=a),c&&(e.pythonEnvs=o),fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((()=>{proceedInstall()})).catch((()=>{proceedInstall()}))}else proceedInstall()})).catch((()=>{proceedInstall()}))}}function createClientItem(e,t,n,a,s,l){const o=document.createElement("div");o.className="client-item",o.dataset.target=e,o.dataset.selected="false";const i=document.createElement("div");i.className="client-info";const r=document.createElement("span");return r.className="text-sm font-medium text-gray-900",r.textContent=e,i.appendChild(r),o.appendChild(i),a||(o.classList.add("non-selectable"),s?(o.classList.add("installed-item"),o.title="Already installed"):l&&(o.classList.add("in-progress-item"),o.title="Installation in progress")),o}function setupClientItemListeners(e,t,n){n&&e.addEventListener("click",(()=>{const n="true"===e.dataset.selected;e.dataset.selected=n?"false":"true",n?(e.classList.remove("selected"),window.selectedClients=window.selectedClients.filter((e=>e!==t))):(e.classList.add("selected"),window.selectedClients.includes(t)||window.selectedClients.push(t))}))}function setupUninstallButton(e,t,n,a,s,l,o){if(t){const i=document.createElement("div");i.className="status-container";const r=document.createElement("span");if(r.className=`status-badge ${o}`,r.textContent=t,i.appendChild(r),"completed"===n.status&&"install"===n.type){const e=createUninstallButton(a,s,l);i.appendChild(e)}e.appendChild(i)}}function createUninstallButton(e,t,n){const a=document.createElement("button");return a.className="uninstall-btn text-red-600 hover:text-red-800 ml-2",a.innerHTML='<i class="bx bx-trash"></i>',a.title="Uninstall from this client",a.onclick=async a=>{a.stopPropagation(),a.preventDefault();if(await showConfirm("Uninstall Confirmation",`Are you sure you want to uninstall ${n} from ${e}?`)){window.selectedClients=[e],showInstallLoadingModal("Uninstalling");const a={[n]:{removeData:!0}};try{updateOverallInstallStatus("in-progress",`Uninstalling ${n} from ${e}...`),await uninstallTools(t,a,[e])}catch(e){updateOverallInstallStatus("failed",`Error during uninstall: ${e.message}`)}}return!1},a}function addSectionTitle(e){if(!e.querySelector(".section-title")){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Client Status",e.insertBefore(t,e.firstChild)}}function addEnvironmentTitle(e){if(!e.querySelector(".section-title")){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Environment Variables",e.insertBefore(t,e.firstChild)}}function addNoEnvMessage(e){const t=document.createElement("p");t.className="text-gray-600",t.textContent="No environment variables required for this MCP server.",e.appendChild(t)}function createEnvironmentInputs(e,t,n,a,s={}){Object.keys(e).forEach((l=>{const o=e[l],i=`env_${l}`,r=document.createElement("div");r.className="mb-3";const d=document.createElement("label");d.htmlFor=i,d.className="block text-sm font-medium text-gray-700 mb-1",d.innerHTML=`${l} ${o.Required?'<span class="text-red-500">*</span>':""}`;const c=document.createElement("input");c.type=o.isSecret?"password":"text",c.id=i,c.name=l,c.placeholder=o.Description||l,c.required=o.Required,c.className="input-field";let m=o.Default||"";if(s&&s[l]?m=s[l]:n&&n.MSRooCode&&n.MSRooCode.mcpServers&&n.MSRooCode.mcpServers[a]&&n.MSRooCode.mcpServers[a].env&&n.MSRooCode.mcpServers[a].env[l]&&(m=n.MSRooCode.mcpServers[a].env[l]),c.value=m,r.appendChild(d),r.appendChild(c),o.Description){const e=document.createElement("p");e.className="text-xs text-gray-500 mt-1",e.textContent=o.Description,r.appendChild(e)}t.appendChild(r)}))}function addArgumentsTitle(e){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Arguments",e.appendChild(t)}function createArgumentsContainer(){const e=document.createElement("div");e.className="args-container mb-3";const t=document.createElement("button");return t.type="button",t.className="add-arg-button px-3 py-1 text-sm text-blue-600 hover:text-blue-800 border border-blue-600 hover:border-blue-800 rounded-md mb-2",t.innerHTML='<i class="bx bx-plus"></i> Add Argument',t.onclick=()=>e.appendChild(createArgumentInput()),e.appendChild(t),e}function createArgumentInput(e=""){const t=document.createElement("div");t.className="arg-wrapper flex items-center gap-2 mb-2";const n=document.createElement("input");n.type="text",n.className="arg-input flex-grow",n.value=e,n.placeholder="Enter argument value";const a=document.createElement("button");return a.type="button",a.className="remove-arg-button text-red-600 hover:text-red-800",a.innerHTML='<i class="bx bx-trash"></i>',a.onclick=()=>t.remove(),t.appendChild(n),t.appendChild(a),t}function createReadOnlyTextBox(e,t,n,a){const s=document.createElement("div");s.className="mb-3 sse-info-field";const l=document.createElement("label");l.htmlFor=a,l.className="block text-sm font-medium text-gray-700 mb-1",l.textContent=t;const o=document.createElement("input");o.type="text",o.id=a,o.value=n,o.readOnly=!0,o.className="input-field sse-input-readonly w-full",s.appendChild(l),s.appendChild(o),e.appendChild(s)}function addPythonEnvironmentInput(e,t,n){const a=document.createElement("div");a.className="mt-4";const s=document.createElement("label");s.htmlFor="python_env",s.className="block text-sm font-medium text-gray-700 mb-1",s.textContent="Python Environment";const l=document.createElement("input");l.type="text",l.id="python_env",l.className="input-field",l.placeholder="Enter Python environment path (optional)";const o=document.createElement("p");o.className="text-xs text-gray-500 mt-1",o.textContent="Specify the Python exectable file(e.g. C:/python312/python) to use for installation. Leave empty to use system default. You can specify value in Settings page",a.appendChild(s),a.appendChild(l),a.appendChild(o),n.appendChild(a),fetch("/api/settings").then((e=>e.json())).then((n=>{n&&n.data&&n.data.pythonEnvs&&(l.value=n.data.pythonEnvs[`${e}:${t}`]||n.data.pythonEnvs.system||"")})).catch((()=>{}))}function renderRequirements(e,t,n,a){return e.map((e=>{const s=t[e.name]||{};let l=s.installed?"text-green-600 bg-green-50":"text-yellow-600 bg-yellow-50",o=s.installed?"Installed":"Required",i=s.version?` • <span class="font-medium">${s.version}</span>`:"",r="";return s.installed&&s.availableUpdate&&s.availableUpdate.version&&s.version&&compareVersions(s.availableUpdate.version,s.version)>0&&(l="text-yellow-600 bg-yellow-50",o=`<span style="color: #f59e0b; font-weight: bold; margin-right: 5px;">↑</span>${s.availableUpdate.version}`,r=`\n <label class="inline-flex items-center cursor-pointer ml-2">\n <input type="checkbox" class="toggle-update sr-only"\n data-name="${e.name}"\n data-version="${s.availableUpdate.version}"\n data-category="${n}"\n data-server="${a}">\n <div class="relative w-10 h-5 bg-gray-200 rounded-full toggle-bg">\n <div class="absolute inset-y-0 left-0 w-5 h-5 bg-white rounded-full transition-transform duration-300 transform"></div>\n </div>\n <span class="ml-2 text-sm text-gray-700">Update</span>\n </label>\n `),`\n <div class="border border-gray-200 p-3 rounded-lg mb-2 hover:bg-gray-50">\n <div class="flex justify-between items-center">\n <div>\n <div class="font-semibold text-gray-800">${e.name}</div>\n <div class="text-sm text-gray-600 shadow-sm p-1 rounded bg-gray-50">\n <span class="font-medium">${s.type||"package"}</span>${i}\n </div>\n </div>\n <div class="flex items-center">\n <span class="${l} inline-flex items-center px-3 py-1 rounded-full text-sm">\n ${o}\n </span>\n ${r}\n </div>\n </div>\n </div>\n `})).join("")}function setupUpdateToggles(e){e.querySelectorAll(".toggle-update").forEach((e=>{e.addEventListener("change",(function(){const e=this.parentElement.querySelector(".toggle-bg");this.checked?(e.classList.add("bg-blue-500"),e.querySelector("div").classList.add("translate-x-5")):(e.classList.remove("bg-blue-500"),e.querySelector("div").classList.remove("translate-x-5"))}))}))}
|
|
1
|
+
import{showToast,showConfirm}from"../notifications.js";import{showInstallLoadingModal,updateOverallInstallStatus}from"./loadingModal.js";import{uninstallTools}from"./installation.js";import{handleBulkClientInstall}from"./installation.js";import{compareVersions}from"./versionUtils.js";export function setupClientItems(e,t,n,s,a){e.forEach((e=>{const l=t.installedStatus[e]||{status:"not-installed",type:"check",target:"server"};let i="",o="";"completed"===l.status&&"install"===l.type?(i="Installed",o="installed"):"pending"===l.status?(i="Pending Requirements",o="pending"):"in-progress"===l.status?(i="In Progress",o="pending"):"failed"===l.status&&(i="Failed",o="not-installed");const r="completed"===l.status&&"install"===l.type,d="in-progress"===l.status,c=!r&&!d,m=createClientItem(e,i,o,c,r,d);setupClientItemListeners(m,e,c),setupUninstallButton(m,i,l,e,n,s,o),a.appendChild(m)})),addSectionTitle(a)}export function setupEnvironmentVariables(e,t,n){if("sse"===e.mode||"streamable-http"===e.mode)return void(t.style.display="none");const s=e.installation?.env||e.installation?.env||{};addEnvironmentTitle(t),fetch("/api/settings").then((e=>e.json())).then((a=>{const l=a&&a.data&&a.data.userConfigurations?a.data.userConfigurations:{};0===Object.keys(s).length?addNoEnvMessage(t):createEnvironmentInputs(s,t,n.clientMcpSettings,e.name,l)})).catch((()=>{0===Object.keys(s).length?addNoEnvMessage(t):createEnvironmentInputs(s,t,n.clientMcpSettings,e.name,{})}))}export function setupInstallationArguments(e,t,n,s){if(!e)return void(t.style.display="none");if("sse"===s?.mode||"streamable-http"===s?.mode){t.innerHTML="";let n=!1;return e.url&&(addArgumentsTitle(t),createReadOnlyTextBox(t,"Server URL",e.url,"sse_url"),n=!0),e.startingCommand&&(n||addArgumentsTitle(t),createReadOnlyTextBox(t,"Starting Command",e.startingCommand,"sse_starting_command"),n=!0),void(n||(t.style.display="none"))}addArgumentsTitle(t);const a=createArgumentsContainer();t.appendChild(a),e.args&&Array.isArray(e.args)?e.args.forEach((e=>{a.appendChild(createArgumentInput(e))})):a.appendChild(createArgumentInput()),("python"===e.command||e.command.includes("python"))&&addPythonEnvironmentInput(n,s.name,t)}export function setupServerRequirements(e,t,n,s,a){if("sse"===e.mode||"streamable-http"===e.mode)return void(a.style.display="none");const l=e.dependencies?.requirements||[],i=t.data.installationStatus?.requirementsStatus||{};if(l.length>0){const e=renderRequirements(l,i,n,s);a.innerHTML=`\n <h3 class="text-lg font-semibold text-gray-700 mb-3">Dependencies</h3>\n <p class="text-sm text-gray-600 mb-4">These dependencies will be automatically installed when installing the server</p>\n ${e}\n `,setupUpdateToggles(a)}else a.innerHTML='<p class="text-gray-600">No additional dependencies required.</p>'}export function setupFormSubmitHandler(e,t,n,s,a,l,i,o,r){e.onsubmit=e=>{e.preventDefault();const d={},c=[],m=[];let u;if("sse"!==r?.mode&&"streamable-http"!==r?.mode){t.querySelectorAll("input").forEach((e=>{e.name&&e.value&&(d[e.name]=e.value)}));const e=n.querySelectorAll(".arg-input");c.push(...Array.from(e).map((e=>e.value.trim())).filter((e=>""!==e)));const a=document.getElementById("python_env");u=a?.value?.trim();s.querySelectorAll(".toggle-update:checked").forEach((e=>{m.push({name:e.dataset.name,version:e.dataset.version})}))}function proceedInstall(){const e=m.length>0,t=document.querySelector(".uninstall-btn");if(!t||!t.matches(":active")){const t=window.selectedClients;if(0===t.length&&!e)return void showToast("Please select at least one client to configure.","error");let n="Starting installation...";const s=i[l]||{installedStatus:{}};if(t.length>0){const e=t[0],a=s.installedStatus?.[e]?.message;a&&(n=a)}const r={targetClients:t,env:d,args:c,settings:u?{pythonEnv:u}:{}};m.length>0&&(r.requirements=m),handleBulkClientInstall(a,l,t,d,n,o,r)}}fetch("/api/settings").then((e=>e.json())).then((e=>{const t=e&&e.data&&e.data.userConfigurations?e.data.userConfigurations:{},n=e&&e.data&&e.data.pythonEnvs?e.data.pythonEnvs:{},s={...t},i={...n};Object.keys(d).forEach((e=>{s[e]=d[e]}));let o=!1;const r=new Set([...Object.keys(t),...Object.keys(d)]);for(const e of r)if(t[e]!==s[e]){o=!0;break}let c=!1;if(void 0!==u&&u!==n[`${a}:${l}`]&&(i[`${a}:${l}`]=u,c=!0),o||c){const e={};o&&(e.userConfigurations=s),c&&(e.pythonEnvs=i),fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then((()=>{proceedInstall()})).catch((()=>{proceedInstall()}))}else proceedInstall()})).catch((()=>{proceedInstall()}))}}function createClientItem(e,t,n,s,a,l){const i=document.createElement("div");i.className="client-item",i.dataset.target=e,i.dataset.selected="false";const o=document.createElement("div");o.className="client-info";const r=document.createElement("span");return r.className="text-sm font-medium text-gray-900",r.textContent=e,o.appendChild(r),i.appendChild(o),s||(i.classList.add("non-selectable"),a?(i.classList.add("installed-item"),i.title="Already installed"):l&&(i.classList.add("in-progress-item"),i.title="Installation in progress")),i}function setupClientItemListeners(e,t,n){n&&e.addEventListener("click",(()=>{const n="true"===e.dataset.selected;e.dataset.selected=n?"false":"true",n?(e.classList.remove("selected"),window.selectedClients=window.selectedClients.filter((e=>e!==t))):(e.classList.add("selected"),window.selectedClients.includes(t)||window.selectedClients.push(t))}))}function setupUninstallButton(e,t,n,s,a,l,i){if(t){const o=document.createElement("div");o.className="status-container";const r=document.createElement("span");if(r.className=`status-badge ${i}`,r.textContent=t,o.appendChild(r),"completed"===n.status&&"install"===n.type){const e=createUninstallButton(s,a,l);o.appendChild(e)}e.appendChild(o)}}function createUninstallButton(e,t,n){const s=document.createElement("button");return s.className="uninstall-btn text-red-600 hover:text-red-800 ml-2",s.innerHTML='<i class="bx bx-trash"></i>',s.title="Uninstall from this client",s.onclick=async s=>{s.stopPropagation(),s.preventDefault();if(await showConfirm("Uninstall Confirmation",`Are you sure you want to uninstall ${n} from ${e}?`)){window.selectedClients=[e],showInstallLoadingModal("Uninstalling");const s={[n]:{removeData:!0}};try{updateOverallInstallStatus("in-progress",`Uninstalling ${n} from ${e}...`),await uninstallTools(t,s,[e])}catch(e){updateOverallInstallStatus("failed",`Error during uninstall: ${e.message}`)}}return!1},s}function addSectionTitle(e){if(!e.querySelector(".section-title")){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Client Status",e.insertBefore(t,e.firstChild)}}function addEnvironmentTitle(e){if(!e.querySelector(".section-title")){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Environment Variables",e.insertBefore(t,e.firstChild)}}function addNoEnvMessage(e){const t=document.createElement("p");t.className="text-gray-600",t.textContent="No environment variables required for this MCP server.",e.appendChild(t)}function getClientEnvValue(e,t,n){if(!e)return null;const s=Object.keys(e);for(const a of s){const s=e[a];if(!(s&&s.mcpServers&&s.mcpServers[t]&&s.mcpServers[t].env))continue;const l=s.mcpServers[t].env[n];if(l)return l}return null}function createEnvironmentInputs(e,t,n,s,a={}){Object.keys(e).forEach((l=>{const i=e[l],o=`env_${l}`,r=document.createElement("div");r.className="mb-3";const d=document.createElement("label");d.htmlFor=o,d.className="block text-sm font-medium text-gray-700 mb-1",d.innerHTML=`${l} ${i.Required?'<span class="text-red-500">*</span>':""}`;const c=document.createElement("input");c.type=i.isSecret?"password":"text",c.id=o,c.name=l,c.placeholder=i.Description||l,c.required=i.Required,c.className="input-field";let m=i.Default||"";if(a&&a[l])m=a[l];else{const e=getClientEnvValue(n,s,l);e&&(m=e)}if(c.value=m,r.appendChild(d),r.appendChild(c),i.Description){const e=document.createElement("p");e.className="text-xs text-gray-500 mt-1",e.textContent=i.Description,r.appendChild(e)}t.appendChild(r)}))}function addArgumentsTitle(e){const t=document.createElement("h3");t.className="section-title text-lg font-semibold text-gray-700 mb-3",t.textContent="Arguments",e.appendChild(t)}function createArgumentsContainer(){const e=document.createElement("div");e.className="args-container mb-3";const t=document.createElement("button");return t.type="button",t.className="add-arg-button px-3 py-1 text-sm text-blue-600 hover:text-blue-800 border border-blue-600 hover:border-blue-800 rounded-md mb-2",t.innerHTML='<i class="bx bx-plus"></i> Add Argument',t.onclick=()=>e.appendChild(createArgumentInput()),e.appendChild(t),e}function createArgumentInput(e=""){const t=document.createElement("div");t.className="arg-wrapper flex items-center gap-2 mb-2";const n=document.createElement("input");n.type="text",n.className="arg-input flex-grow",n.value=e,n.placeholder="Enter argument value";const s=document.createElement("button");return s.type="button",s.className="remove-arg-button text-red-600 hover:text-red-800",s.innerHTML='<i class="bx bx-trash"></i>',s.onclick=()=>t.remove(),t.appendChild(n),t.appendChild(s),t}function createReadOnlyTextBox(e,t,n,s){const a=document.createElement("div");a.className="mb-3 sse-info-field";const l=document.createElement("label");l.htmlFor=s,l.className="block text-sm font-medium text-gray-700 mb-1",l.textContent=t;const i=document.createElement("input");i.type="text",i.id=s,i.value=n,i.readOnly=!0,i.className="input-field sse-input-readonly w-full",a.appendChild(l),a.appendChild(i),e.appendChild(a)}function addPythonEnvironmentInput(e,t,n){const s=document.createElement("div");s.className="mt-4";const a=document.createElement("label");a.htmlFor="python_env",a.className="block text-sm font-medium text-gray-700 mb-1",a.textContent="Python Environment";const l=document.createElement("input");l.type="text",l.id="python_env",l.className="input-field",l.placeholder="Enter Python environment path (optional)";const i=document.createElement("p");i.className="text-xs text-gray-500 mt-1",i.textContent="Specify the Python exectable file(e.g. C:/python312/python) to use for installation. Leave empty to use system default. You can specify value in Settings page",s.appendChild(a),s.appendChild(l),s.appendChild(i),n.appendChild(s),fetch("/api/settings").then((e=>e.json())).then((n=>{n&&n.data&&n.data.pythonEnvs&&(l.value=n.data.pythonEnvs[`${e}:${t}`]||n.data.pythonEnvs.system||"")})).catch((()=>{}))}function renderRequirements(e,t,n,s){return e.map((e=>{const a=t[e.name]||{};let l=a.installed?"text-green-600 bg-green-50":"text-yellow-600 bg-yellow-50",i=a.installed?"Installed":"Required",o=a.version?` • <span class="font-medium">${a.version}</span>`:"",r="";return a.installed&&a.availableUpdate&&a.availableUpdate.version&&a.version&&compareVersions(a.availableUpdate.version,a.version)>0&&(l="text-yellow-600 bg-yellow-50",i=`<span style="color: #f59e0b; font-weight: bold; margin-right: 5px;">↑</span>${a.availableUpdate.version}`,r=`\n <label class="inline-flex items-center cursor-pointer ml-2">\n <input type="checkbox" class="toggle-update sr-only"\n data-name="${e.name}"\n data-version="${a.availableUpdate.version}"\n data-category="${n}"\n data-server="${s}">\n <div class="relative w-10 h-5 bg-gray-200 rounded-full toggle-bg">\n <div class="absolute inset-y-0 left-0 w-5 h-5 bg-white rounded-full transition-transform duration-300 transform"></div>\n </div>\n <span class="ml-2 text-sm text-gray-700">Update</span>\n </label>\n `),`\n <div class="border border-gray-200 p-3 rounded-lg mb-2 hover:bg-gray-50">\n <div class="flex justify-between items-center">\n <div>\n <div class="font-semibold text-gray-800">${e.name}</div>\n <div class="text-sm text-gray-600 shadow-sm p-1 rounded bg-gray-50">\n <span class="font-medium">${a.type||"package"}</span>${o}\n </div>\n </div>\n <div class="flex items-center">\n <span class="${l} inline-flex items-center px-3 py-1 rounded-full text-sm">\n ${i}\n </span>\n ${r}\n </div>\n </div>\n </div>\n `})).join("")}function setupUpdateToggles(e){e.querySelectorAll(".toggle-update").forEach((e=>{e.addEventListener("change",(function(){const e=this.parentElement.querySelector(".toggle-bg");this.checked?(e.classList.add("bg-blue-500"),e.querySelector("div").classList.add("translate-x-5")):(e.classList.remove("bg-blue-500"),e.querySelector("div").classList.remove("translate-x-5"))}))}))}
|
|
2
2
|
//# sourceMappingURL=modalSetup.js.map
|