imcp 0.1.18 → 0.2.0
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 +33 -0
- package/dist/cli/commands/install.js +1 -1
- package/dist/cli/commands/install.js.map +1 -1
- 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/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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BaseClientInstaller","Logger","fs","path","SUPPORTED_CLIENTS","InstallOperationManager","RecordingConstants","VisualStudioInstaller","clientName","updateVSSettings","serverName","installConfig","debug","results","settingPath","this","codeSettingPath","setupClientSettings","push","success","error","errorMessage","Error","message","String","settingsDir","dirname","mkdir","recursive","settings","existingContent","readFile","JSON","parse","initializeSettings","replace","mode","handleStdioMode","handleSseAndStreamableMode","writeFile","stringify","servers","inputs","setupSettings","url","finalConfig","args","map","arg","command","env","install","serverConfig","options","categoryName","operationId","generateOperationId","recorder","getInstance","name","recording","async","setupInstallConfig","stepName","STEP_SETUP_INSTALLATION_CONFIG","STEP_UPDATE_VS_SETTINGS","onResult","result","some","r","anySuccess","successPaths","filter","errors","status","type","target","join","undefined","STEP_INSTALLATION","endMessage","onError","errorMsg"],"sources":["../../../../src/core/installers/clients/VisualStudioInsta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U,KAAM,GAAI,QACnE5B,OAAOW,MAAM,kDAAkDE,IAEnE,CAAE,MAAOM,GAEL,MADAnB,OAAOmB,MAAM,iDAAkDA,GACzDA,CACV,CACJ,CAOU,kBAAAc,CAAmBL,GACpBA,IACDA,EAAW,CACPY,QAAS,GACTC,OAAQ,KAIXb,EAASa,SACVb,EAASa,OAAS,IAGjBb,EAASY,UACVZ,EAASY,QAAU,GAE3B,CASU,aAAAE,CAAcd,EAAenB,EAAoBC,GAEvDkB,EAASY,QAAQ/B,GAAc,CAC3BkC,IAAKjC,EAAciC,
|
|
1
|
+
{"version":3,"names":["BaseClientInstaller","Logger","fs","path","SUPPORTED_CLIENTS","InstallOperationManager","RecordingConstants","VisualStudioInstaller","clientName","updateVSSettings","serverName","installConfig","debug","results","settingPath","this","codeSettingPath","setupClientSettings","push","success","error","errorMessage","Error","message","String","settingsDir","dirname","mkdir","recursive","settings","existingContent","readFile","JSON","parse","initializeSettings","replace","mode","handleStdioMode","handleSseAndStreamableMode","writeFile","stringify","servers","inputs","setupSettings","url","applySourceEnv","finalConfig","args","map","arg","command","env","install","serverConfig","options","categoryName","operationId","generateOperationId","recorder","getInstance","name","recording","async","setupInstallConfig","stepName","STEP_SETUP_INSTALLATION_CONFIG","STEP_UPDATE_VS_SETTINGS","onResult","result","some","r","anySuccess","successPaths","filter","errors","status","type","target","join","undefined","STEP_INSTALLATION","endMessage","onError","errorMsg"],"sources":["../../../../src/core/installers/clients/VisualStudioInstaller.ts"],"mappings":"OAASA,wBAA2B,kCAC3BC,WAAc,kCAChBC,OAAQ,qBACRC,SAAU,cACRC,sBAAyB,sCAEzBC,4BAA+B,qDAC5BC,uBAAwB,+CAM9B,MAAOC,8BAA8BP,oBACpBQ,WAAqB,eAO9B,sBAAMC,CAAiBC,EAAoBC,GACjDV,OAAOW,MAAM,mCACb,MAAMC,EAAqE,GAE3E,IACI,MAAMC,EAAcV,kBAAkBW,KAAKP,YAAYQ,gBACvDf,OAAOW,MAAM,qCAAqCE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8BAA8BkE,EAAOI,KAAK,QAOtEtB,cACApC,MAAOmD,OAAaQ,EAAYL,EAAOI,KAAK,MAC/C,GAEL,CACId,SAAU1D,mBAAmB0E,kBAC7Bb,SAAWC,GAA8B,WAAnBA,GAAQO,OAC9BM,WAAab,GAAYA,GAA4B7C,QACrD2D,QAAU9D,IACN,MAAM+D,EAAW,+BAA+BpE,KAAKP,sBAAsBY,aAAiBE,MAAQF,EAAMG,QAAUC,OAAOJ,KAC3H,MAAO,CACHgD,OAAQ,CACJO,OAAQ,SACRC,KAAM,UACNC,OAAQ,SACRtD,QAAS4D,EACT3B,cACApC,MAAOA,aAAiBE,MAAQF,EAAMG,QAAUC,OAAOJ,IACxDG,QAAS4D,EACf,GAKjB","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import fs from"fs/promises";import path from"path";import{LOCAL_FEEDS_DIR,SUPPORTED_CLIENTS}from"../metadatas/constants.js";import{Logger}from"../../utils/logger.js";import{readJsonFile}from"../../utils/clientUtils.js";export class ConfigurationLoader{static updateServerInstalledStatus(e,t,
|
|
1
|
+
import fs from"fs/promises";import path from"path";import{LOCAL_FEEDS_DIR,SUPPORTED_CLIENTS}from"../metadatas/constants.js";import{Logger}from"../../utils/logger.js";import{readJsonFile}from"../../utils/clientUtils.js";export class ConfigurationLoader{static updateServerInstalledStatus(e,t,r){e.installedStatus||(e.installedStatus={}),e.installedStatus[t]=r}static removeClientStatus(e,t){e.installedStatus&&e.installedStatus[t]&&delete e.installedStatus[t]}static syncServerCategoriesWithClientSettings(e){return e.clientMCPSettings?(e.localServerCategories=e.localServerCategories.map((t=>{if(!t.installationStatus?.serversStatus)return t;const r={...t.installationStatus.serversStatus},s=e.clientMCPSettings;for(const[e,t]of Object.entries(s)){const s="GithubCopilot"===e||"VisualStudio"===e?t.servers||{}:t.mcpServers||{};Object.keys(r).forEach((t=>{const a="VisualStudio"===e?t.replace(/-/g,"_"):t;if(s[a]){if(!r[t].installedStatus[e]){const s={status:"completed",type:"install",target:"server",message:`Server ${t} is configured for client ${e}`};ConfigurationLoader.updateServerInstalledStatus(r[t],e,s)}}else ConfigurationLoader.removeClientStatus(r[t],e)}))}return{...t,installationStatus:{...t.installationStatus,serversStatus:r,lastUpdated:(new Date).toISOString()}}})),e):e}static initializeInstallationStatus(e){const t={},r={};if(e){if(e.requirements)for(const r of e.requirements)t[r.name]={name:r.name,type:r.type,installed:!1,version:r.version,error:void 0};if(e.mcpServers)for(const t of e.mcpServers)r[t.name]={name:t.name,error:void 0,installedStatus:{}}}return{requirementsStatus:t,serversStatus:r,lastUpdated:(new Date).toISOString()}}static async syncServerCategoriesWithFeeds(e){e.localServerCategories=e.localServerCategories.filter((t=>e.feeds[t.name])).map((t=>(t.feedConfiguration=e.feeds[t.name],t.installationStatus&&t.installationStatus.requirementsStatus&&0!==Object.keys(t.installationStatus.requirementsStatus).length&&t.installationStatus.serversStatus&&!(Object.keys(t.installationStatus.serversStatus).length<Object.keys(t.feedConfiguration?.mcpServers||[]).length)||(t.installationStatus=ConfigurationLoader.initializeInstallationStatus(t.feedConfiguration)),t)));const t=new Set(e.localServerCategories.map((e=>e.name)));for(const[r,s]of Object.entries(e.feeds))if(!t.has(r)){const t={name:r,displayName:s.displayName||r,type:"local",description:s.description||`Local MCP server category: ${r}`,installationStatus:ConfigurationLoader.initializeInstallationStatus(s),feedConfiguration:s};e.localServerCategories.push(t),Logger.debug(`Created new local server entry for feed: ${r}`)}return e}static async loadFeedsIntoConfiguration(e,t,r){try{await fs.mkdir(LOCAL_FEEDS_DIR,{recursive:!0});const s={};if(t)try{const e=await fs.readFile(t,"utf8");let a=JSON.parse(e);a&&a.name&&(a.systemTags||(a.systemTags={}),a.systemTags.adhoc="true",r?.prLink&&(a.PullRequest=r.prLink),r?.adhocServers&&r.adhocServers.length>0&&a.mcpServers&&(a.mcpServers=a.mcpServers.map((e=>(r.adhocServers.includes(e.name)&&(e.systemTags||(e.systemTags={}),e.systemTags.adhoc="true"),e)))),s[a.name]=a,Logger.log(`Loaded and processed feed configuration from provided file: ${t}`))}catch(e){Logger.error(`Error loading feed configuration from provided file ${t}:`,e)}const a=(await fs.readdir(LOCAL_FEEDS_DIR)).filter((e=>e.endsWith(".json")));if(0===a.length&&!t)return Logger.log(`No feed configuration files found in ${LOCAL_FEEDS_DIR}`),e;for(const e of a)try{const t=path.join(LOCAL_FEEDS_DIR,e),r=await fs.readFile(t,"utf8"),a=JSON.parse(r);a&&a.name&&(s[a.name]?Logger.log(`Skipping local feed ${a.name} as it was provided via --feed-file`):s[a.name]=a)}catch(t){Logger.warn(`Error loading feed configuration from ${e}: ${t instanceof Error?t.message:String(t)}`)}const i=Object.values(s);i.sort(((e,t)=>{const r=e.displayName||"",s=t.displayName||"";return r.localeCompare(s)}));const n={};for(const e of i)n[e.name]=e;return e.feeds=n,await ConfigurationLoader.syncServerCategoriesWithFeeds(e)}catch(e){throw Logger.error("Error loading feed configurations:",e),e}}static async loadClientMCPSettings(e){try{Logger.debug("Starting to load MCP client settings...");const t={};for(const[e,r]of Object.entries(SUPPORTED_CLIENTS)){const s=process.env.CODE_INSIDERS?r.codeInsiderSettingPath:r.codeSettingPath;try{let r=await readJsonFile(s,!0);"GithubCopilot"===e&&(r.servers||(r.servers={}),r.inputs||(r.inputs=[])),t[e]=r,Logger.debug(`Successfully loaded MCP settings for ${e}`)}catch(r){Logger.debug(`Warning: Could not load MCP settings for client ${e}: ${r instanceof Error?r.message:String(r)}`),t[e]={}}}return e.clientMCPSettings=t,ConfigurationLoader.syncServerCategoriesWithClientSettings(e)}catch(e){throw Logger.error("Error loading client MCP settings:",e),e}}}
|
|
2
2
|
//# sourceMappingURL=ConfigurationLoader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","path","LOCAL_FEEDS_DIR","SUPPORTED_CLIENTS","Logger","readJsonFile","ConfigurationLoader","updateServerInstalledStatus","serverStatus","clientName","operationStatus","installedStatus","removeClientStatus","syncServerCategoriesWithClientSettings","configuration","clientMCPSettings","localServerCategories","map","category","installationStatus","serversStatus","updatedServerStatus","clientSettings","settings","Object","entries","clientServers","servers","mcpServers","keys","forEach","serverName","checkServerName","replace","status","type","target","message","lastUpdated","Date","toISOString","initializeInstallationStatus","feedConfig","requirementsStatus","requirements","req","name","installed","version","error","undefined","mcp","syncServerCategoriesWithFeeds","filter","server","feeds","feedConfiguration","length","existingServerNames","Set","feedName","has","newServerCategory","displayName","description","push","
|
|
1
|
+
{"version":3,"names":["fs","path","LOCAL_FEEDS_DIR","SUPPORTED_CLIENTS","Logger","readJsonFile","ConfigurationLoader","updateServerInstalledStatus","serverStatus","clientName","operationStatus","installedStatus","removeClientStatus","syncServerCategoriesWithClientSettings","configuration","clientMCPSettings","localServerCategories","map","category","installationStatus","serversStatus","updatedServerStatus","clientSettings","settings","Object","entries","clientServers","servers","mcpServers","keys","forEach","serverName","checkServerName","replace","status","type","target","message","lastUpdated","Date","toISOString","initializeInstallationStatus","feedConfig","requirementsStatus","requirements","req","name","installed","version","error","undefined","mcp","syncServerCategoriesWithFeeds","filter","server","feeds","feedConfiguration","length","existingServerNames","Set","feedName","has","newServerCategory","displayName","description","push","debug","loadFeedsIntoConfiguration","feedFile","mkdir","recursive","content","readFile","config","JSON","parse","systemTags","prLink","PullRequest","adhocServers","includes","log","jsonFiles","readdir","file","endsWith","filePath","join","warn","Error","String","feedValues","values","sort","a","b","displayNameA","displayNameB","localeCompare","sortedFeeds","loadClientMCPSettings","settingPath","process","env","CODE_INSIDERS","codeInsiderSettingPath","codeSettingPath","inputs"],"sources":["../../../src/core/loaders/ConfigurationLoader.ts"],"mappings":"OAAOA,OAAQ,qBACRC,SAAU,cACRC,gBAAiBC,sBAAyB,mCAC1CC,WAAc,+BACdC,iBAAoB,oCAWvB,MAAOC,oBAID,kCAAOC,CACXC,EACAC,EACAC,GAEKF,EAAaG,kBACdH,EAAaG,gBAAkB,IAEnCH,EAAaG,gBAAgBF,GAAcC,CAC/C,CAKQ,yBAAOE,CACX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tC,OAAOiC,EAAaE,cAAcD,EAAa,IAGnD,MAAME,EAAiD,GACvD,IAAK,MAAM1B,KAAUkB,EACjBQ,EAAY1B,EAAO3B,MAAQ2B,EAG/B,OADA3D,EAAcyC,MAAQ4C,QACT7F,oBAAoB8C,8BAA8BtC,EACnE,CAAE,MAAOmC,GAEL,MADA7C,OAAO6C,MAAM,qCAAsCA,GAC7CA,CACV,CACJ,CAKA,kCAAamD,CAAsBtF,GAC/B,IACIV,OAAO8D,MAAM,2CACb,MAAM3C,EAAgD,GAEtD,IAAK,MAAOd,EAAYa,KAAmBE,OAAOC,QAAQtB,mBAAoB,CAC1E,MAAMkG,EAAcC,QAAQC,IAAIC,cAC1BlF,EAAemF,uBACfnF,EAAeoF,gBACrB,IACI,IAAInC,QAAgBlE,aAAagG,GAAa,GAE3B,kBAAf5F,IAEK8D,EAAQ5C,UACT4C,EAAQ5C,QAAU,IAEjB4C,EAAQoC,SACTpC,EAAQoC,OAAS,KAGzBpF,EAASd,GAAc8D,EACvBnE,OAAO8D,MAAM,wCAAwCzD,IACzD,CAAE,MAAOwC,GACL7C,OAAO8D,MAAM,mDAAmDzD,MAAewC,aAAiBwC,MAAQxC,EAAMZ,QAAUqD,OAAOzC,MAC/H1B,EAASd,GAAc,EAC3B,CACJ,CAGA,OADAK,EAAcC,kBAAoBQ,EAC3BjB,oBAAoBO,uCAAuCC,EACtE,CAAE,MAAOmC,GAEL,MADA7C,OAAO6C,MAAM,qCAAsCA,GAC7CA,CACV,CACJ","ignoreList":[]}
|
|
@@ -27,6 +27,7 @@ export declare class ConfigurationProvider {
|
|
|
27
27
|
updateServerStatus(categoryName: string, serverName: string, status: MCPServerStatus): Promise<boolean>;
|
|
28
28
|
updateServerOperationStatus(categoryName: string, serverName: string, clientName: string, operationStatus: OperationStatus): Promise<boolean>;
|
|
29
29
|
isRequirementsReady(categoryName: string, serverName: string): Promise<boolean>;
|
|
30
|
+
markRequirementsForReinstall(categoryName: string, serverName: string): Promise<void>;
|
|
30
31
|
GetServerRequirementStatus(categoryName: string, serverName: string): Promise<RequirementStatus[]>;
|
|
31
32
|
isServerReady(categoryName: string, serverName: string, clients: string[]): Promise<boolean>;
|
|
32
33
|
syncFeeds(repo?: string, branch?: string): Promise<void>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import fs from"fs/promises";import path from"path";import{exec}from"child_process";import{promisify}from"util";import{fileURLToPath}from"url";import{GITHUB_REPO,LOCAL_FEEDS_DIR,SETTINGS_DIR,SUPPORTED_CLIENTS}from"../metadatas/constants.js";import{Logger}from"../../utils/logger.js";import{checkGithubAuth}from"../../utils/githubAuth.js";import{ConfigurationLoader}from"./ConfigurationLoader.js";const execAsync=promisify(exec),__dirname=path.dirname(fileURLToPath(import.meta.url));export class ConfigurationProvider{static instance;configPath;configuration;configLock=Promise.resolve();tempDir;constructor(){this.configPath=path.join(SETTINGS_DIR,"configurations.json"),this.configuration={localServerCategories:[],feeds:{},clientMCPSettings:{}},this.tempDir=path.join(LOCAL_FEEDS_DIR,"../temp")}static getInstance(){return ConfigurationProvider.instance||(ConfigurationProvider.instance=new ConfigurationProvider),ConfigurationProvider.instance}async withLock(t){const e=this.configLock;let i;this.configLock=new Promise((t=>i=t));try{return await e,await t()}finally{i()}}async initialize(t,e){await this.withLock((async()=>{const i=path.dirname(this.configPath);await fs.mkdir(i,{recursive:!0});try{await fs.rm(this.configPath,{recursive:!0,force:!0})}catch(t){if("ENOENT"!==t.code)throw t}try{try{const t=JSON.parse(await fs.readFile(this.configPath,"utf8"));this.configuration=t}catch(t){if("ENOENT"!==t.code)throw t;await this.saveConfiguration()}await this.loadFeedsIntoConfiguration(t,e),await this.loadClientMCPSettings()}catch(t){throw Logger.error("Error during initialization",t),t}}))}async saveConfiguration(){const t=path.dirname(this.configPath);await fs.mkdir(t,{recursive:!0}),await fs.writeFile(this.configPath,JSON.stringify(this.configuration,null,2))}async getServerCategories(){return await this.withLock((async()=>this.configuration.localServerCategories))}async getServerCategory(t){return await this.withLock((async()=>this.configuration.localServerCategories.find((e=>e.name===t))))}async getClientMcpSettings(){return await this.withLock((async()=>this.configuration.clientMCPSettings))}async getFeedConfiguration(t){return await this.withLock((async()=>this.configuration.feeds[t]))}async getServerMcpConfig(t,e){return await this.withLock((async()=>this.configuration.feeds[t]?.mcpServers.find((t=>t.name===e))))}async getInstallationStatus(t){return await this.withLock((async()=>{const e=this.configuration.localServerCategories.find((e=>e.name===t));return e?.installationStatus}))}async getServerStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t)),a=i?.installationStatus;return a?.serversStatus[e]}))}async getRequirementStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t)),a=i?.installationStatus;return a?.requirementsStatus[e]}))}async updateInstallationStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a&&(a.installationStatus||(a.installationStatus={requirementsStatus:{},serversStatus:{},lastUpdated:(new Date).toISOString()}),a.installationStatus.requirementsStatus={...a.installationStatus.requirementsStatus,...e},a.installationStatus.serversStatus={...a.installationStatus.serversStatus,...i},a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateRequirementStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus&&(a.installationStatus.requirementsStatus[e]=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateRequirementOperationStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus?.requirementsStatus[e]&&(a.installationStatus.requirementsStatus[e].operationStatus=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateServerStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus&&(a.installationStatus.serversStatus[e]=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateServerOperationStatus(t,e,i,a){return await this.withLock((async()=>{const r=this.configuration.localServerCategories.find((e=>e.name===t));return!!r?.installationStatus?.serversStatus[e]&&(r.installationStatus.serversStatus[e].installedStatus[i]=a,r.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async isRequirementsReady(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t));if(!i?.feedConfiguration)return!1;const a=i.feedConfiguration.mcpServers.find((t=>t.name===e));if(!a?.dependencies?.requirements)return!0;const r=a.dependencies.requirements.map((t=>t.name)),n=i?.installationStatus;return!!n?.requirementsStatus&&r.every((t=>{const e=n.requirementsStatus[t];return e?.installed&&!e?.error}))}))}async GetServerRequirementStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t));if(!i?.feedConfiguration)return[];const a=i.feedConfiguration.mcpServers.find((t=>t.name===e));if(!a?.dependencies?.requirements)return[];return a.dependencies.requirements.map((t=>t.name)).map((t=>i?.installationStatus?.requirementsStatus[t])).filter((t=>void 0!==t))}))}async isServerReady(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t)),r=a?.installationStatus,n=r?.serversStatus[e];return!!n&&i.every((t=>{const e=n.installedStatus?.[t];return"completed"===e?.status&&!e?.error}))}))}async syncFeeds(t,e){return await this.withLock((async()=>{Logger.log("Starting feed synchronization...");try{await checkGithubAuth(),Logger.debug({action:"create_directories",paths:{localFeeds:LOCAL_FEEDS_DIR,tempDir:this.tempDir}}),await fs.mkdir(LOCAL_FEEDS_DIR,{recursive:!0}),await fs.mkdir(this.tempDir,{recursive:!0}),await fs.rm(this.tempDir,{recursive:!0,force:!0});const i=t||GITHUB_REPO.url,a=e||"main";if(t||e){Logger.debug(`Using git clone with repository ${i} and branch ${a}`);const{cloneGitRepository:t}=await import("../../utils/gitUtils.js"),e=path.join(this.tempDir,"repo-clone");await t(i,a,e);const r=path.join(e,GITHUB_REPO.feedsPath);Logger.debug("Updating local feeds from git clone..."),await fs.rm(LOCAL_FEEDS_DIR,{recursive:!0,force:!0});try{await fs.access(r)}catch(t){throw new Error(`Could not find feeds directory in cloned repository: ${r}`)}await fs.cp(r,LOCAL_FEEDS_DIR,{recursive:!0,force:!0}),Logger.log("Successfully updated local feeds from git repository")}else{Logger.debug("Downloading latest release...");const{downloadGithubRelease:t}=await import("../../utils/githubUtils.js"),{version:e,downloadPath:i}=await t(GITHUB_REPO.repoName,"latest",GITHUB_REPO.feedAssetsName,void 0,!0,this.tempDir);Logger.debug({action:"download_release",downloadPath:i,version:e,repoName:GITHUB_REPO.repoName}),Logger.debug("Updating local feeds..."),await fs.rm(LOCAL_FEEDS_DIR,{recursive:!0,force:!0});const a=i;try{await fs.access(i)}catch(t){throw new Error(`Could not find feeds directory in downloaded path: ${a}`)}await fs.cp(a,LOCAL_FEEDS_DIR,{recursive:!0,force:!0}),Logger.log("Successfully updated local feeds")}}catch(t){throw Logger.error("Error during feed synchronization",t),new Error("Failed to sync feeds. Use --verbose for detailed error information.")}}))}async loadFeedsIntoConfiguration(t,e){this.configuration=await ConfigurationLoader.loadFeedsIntoConfiguration(this.configuration,t,e),await this.saveConfiguration()}async loadClientMCPSettings(){this.configuration=await ConfigurationLoader.loadClientMCPSettings(this.configuration),await this.saveConfiguration()}async reloadClientMCPSettings(){return await this.withLock((async()=>{await this.loadClientMCPSettings()}))}async removeServerFromClientMCPSettings(t,e){return await this.withLock((async()=>{const{readJsonFile:i,writeJsonFile:a}=await import("../../utils/clientUtils.js"),r=Object.entries(SUPPORTED_CLIENTS),n=e?r.filter((([t])=>t===e)):r;for(const[e,r]of n){const n=process.env.CODE_INSIDERS?r.codeInsiderSettingPath:r.codeSettingPath;try{const r=await i(n,!0);let s=!1;if("GithubCopilot"===e&&r.mcp?.servers?.[t])delete r.mcp.servers[t],s=!0;else if("VisualStudio"===e){const e=t.replace(/-/g,"_");r.servers?.[e]&&(delete r.servers[e],s=!0)}else r.mcpServers?.[t]&&(delete r.mcpServers[t],s=!0);s&&(await a(n,r),Logger.debug(`Removed server ${t} from client ${e} settings`))}catch(i){Logger.error(`Failed to remove server ${t} from client ${e} settings:`,i)}}if(this.configuration.clientMCPSettings){if(e){const i=this.configuration.clientMCPSettings[e];i&&(i.mcpServers?.[t]&&delete i.mcpServers[t],i.servers?.[t]&&delete i.servers[t])}else for(const e of Object.values(this.configuration.clientMCPSettings))e.mcpServers?.[t]&&delete e.mcpServers[t],e.servers?.[t]&&delete e.servers[t];await this.saveConfiguration()}}))}}export const configProvider=ConfigurationProvider.getInstance();
|
|
1
|
+
import fs from"fs/promises";import path from"path";import{exec}from"child_process";import{promisify}from"util";import{fileURLToPath}from"url";import{GITHUB_REPO,LOCAL_FEEDS_DIR,SETTINGS_DIR,SUPPORTED_CLIENTS}from"../metadatas/constants.js";import{Logger}from"../../utils/logger.js";import{checkGithubAuth}from"../../utils/githubAuth.js";import{ConfigurationLoader}from"./ConfigurationLoader.js";const execAsync=promisify(exec),__dirname=path.dirname(fileURLToPath(import.meta.url));export class ConfigurationProvider{static instance;configPath;configuration;configLock=Promise.resolve();tempDir;constructor(){this.configPath=path.join(SETTINGS_DIR,"configurations.json"),this.configuration={localServerCategories:[],feeds:{},clientMCPSettings:{}},this.tempDir=path.join(LOCAL_FEEDS_DIR,"../temp")}static getInstance(){return ConfigurationProvider.instance||(ConfigurationProvider.instance=new ConfigurationProvider),ConfigurationProvider.instance}async withLock(t){const e=this.configLock;let i;this.configLock=new Promise((t=>i=t));try{return await e,await t()}finally{i()}}async initialize(t,e){await this.withLock((async()=>{const i=path.dirname(this.configPath);await fs.mkdir(i,{recursive:!0});try{await fs.rm(this.configPath,{recursive:!0,force:!0})}catch(t){if("ENOENT"!==t.code)throw t}try{try{const t=JSON.parse(await fs.readFile(this.configPath,"utf8"));this.configuration=t}catch(t){if("ENOENT"!==t.code)throw t;await this.saveConfiguration()}await this.loadFeedsIntoConfiguration(t,e),await this.loadClientMCPSettings()}catch(t){throw Logger.error("Error during initialization",t),t}}))}async saveConfiguration(){const t=path.dirname(this.configPath);await fs.mkdir(t,{recursive:!0}),await fs.writeFile(this.configPath,JSON.stringify(this.configuration,null,2))}async getServerCategories(){return await this.withLock((async()=>this.configuration.localServerCategories))}async getServerCategory(t){return await this.withLock((async()=>this.configuration.localServerCategories.find((e=>e.name===t))))}async getClientMcpSettings(){return await this.withLock((async()=>this.configuration.clientMCPSettings))}async getFeedConfiguration(t){return await this.withLock((async()=>this.configuration.feeds[t]))}async getServerMcpConfig(t,e){return await this.withLock((async()=>this.configuration.feeds[t]?.mcpServers.find((t=>t.name===e))))}async getInstallationStatus(t){return await this.withLock((async()=>{const e=this.configuration.localServerCategories.find((e=>e.name===t));return e?.installationStatus}))}async getServerStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t)),a=i?.installationStatus;return a?.serversStatus[e]}))}async getRequirementStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t)),a=i?.installationStatus;return a?.requirementsStatus[e]}))}async updateInstallationStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a&&(a.installationStatus||(a.installationStatus={requirementsStatus:{},serversStatus:{},lastUpdated:(new Date).toISOString()}),a.installationStatus.requirementsStatus={...a.installationStatus.requirementsStatus,...e},a.installationStatus.serversStatus={...a.installationStatus.serversStatus,...i},a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateRequirementStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus&&(a.installationStatus.requirementsStatus[e]=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateRequirementOperationStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus?.requirementsStatus[e]&&(a.installationStatus.requirementsStatus[e].operationStatus=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateServerStatus(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t));return!!a?.installationStatus&&(a.installationStatus.serversStatus[e]=i,a.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async updateServerOperationStatus(t,e,i,a){return await this.withLock((async()=>{const n=this.configuration.localServerCategories.find((e=>e.name===t));return!!n?.installationStatus?.serversStatus[e]&&(n.installationStatus.serversStatus[e].installedStatus[i]=a,n.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration(),!0)}))}async isRequirementsReady(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t));if(!i?.feedConfiguration)return!1;const a=i.feedConfiguration.mcpServers.find((t=>t.name===e));if(!a?.dependencies?.requirements)return!0;const n=a.dependencies.requirements.map((t=>t.name)),r=i?.installationStatus;return!!r?.requirementsStatus&&n.every((t=>{const e=r.requirementsStatus[t];return e?.installed&&!e?.error}))}))}async markRequirementsForReinstall(t,e){await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t));if(!i)return;if(!i.feedConfiguration)return;const a=i.feedConfiguration.mcpServers.find((t=>t.name===e));if(!a?.dependencies?.requirements||0===a.dependencies.requirements.length)return;i.installationStatus||(i.installationStatus={requirementsStatus:{},serversStatus:{},lastUpdated:(new Date).toISOString()});const n=i.installationStatus.requirementsStatus||{};for(const t of a.dependencies.requirements){const e=n[t.name];n[t.name]={name:t.name,type:e?.type||"unknown",installed:!1,inProgress:!1,version:t?.version||e?.version,error:void 0,availableUpdate:e?.availableUpdate,lastCheckTime:e?.lastCheckTime,operationStatus:void 0,pythonEnv:e?.pythonEnv,npmPath:e?.npmPath}}i.installationStatus.requirementsStatus=n,i.installationStatus.lastUpdated=(new Date).toISOString(),await this.saveConfiguration()}))}async GetServerRequirementStatus(t,e){return await this.withLock((async()=>{const i=this.configuration.localServerCategories.find((e=>e.name===t));if(!i?.feedConfiguration)return[];const a=i.feedConfiguration.mcpServers.find((t=>t.name===e));if(!a?.dependencies?.requirements)return[];return a.dependencies.requirements.map((t=>t.name)).map((t=>i?.installationStatus?.requirementsStatus[t])).filter((t=>void 0!==t))}))}async isServerReady(t,e,i){return await this.withLock((async()=>{const a=this.configuration.localServerCategories.find((e=>e.name===t)),n=a?.installationStatus,r=n?.serversStatus[e];return!!r&&i.every((t=>{const e=r.installedStatus?.[t];return"completed"===e?.status&&!e?.error}))}))}async syncFeeds(t,e){return await this.withLock((async()=>{Logger.log("Starting feed synchronization...");try{await checkGithubAuth(),Logger.debug({action:"create_directories",paths:{localFeeds:LOCAL_FEEDS_DIR,tempDir:this.tempDir}}),await fs.mkdir(LOCAL_FEEDS_DIR,{recursive:!0}),await fs.mkdir(this.tempDir,{recursive:!0}),await fs.rm(this.tempDir,{recursive:!0,force:!0});const i=t||GITHUB_REPO.url,a=e||"main";if(t||e){Logger.debug(`Using git clone with repository ${i} and branch ${a}`);const{cloneGitRepository:t}=await import("../../utils/gitUtils.js"),e=path.join(this.tempDir,"repo-clone");await t(i,a,e);const n=path.join(e,GITHUB_REPO.feedsPath);Logger.debug("Updating local feeds from git clone..."),await fs.rm(LOCAL_FEEDS_DIR,{recursive:!0,force:!0});try{await fs.access(n)}catch(t){throw new Error(`Could not find feeds directory in cloned repository: ${n}`)}await fs.cp(n,LOCAL_FEEDS_DIR,{recursive:!0,force:!0}),Logger.log("Successfully updated local feeds from git repository")}else{Logger.debug("Downloading latest release...");const{downloadGithubRelease:t}=await import("../../utils/githubUtils.js"),{version:e,downloadPath:i}=await t(GITHUB_REPO.repoName,"latest",GITHUB_REPO.feedAssetsName,void 0,!0,this.tempDir);Logger.debug({action:"download_release",downloadPath:i,version:e,repoName:GITHUB_REPO.repoName}),Logger.debug("Updating local feeds..."),await fs.rm(LOCAL_FEEDS_DIR,{recursive:!0,force:!0});const a=i;try{await fs.access(i)}catch(t){throw new Error(`Could not find feeds directory in downloaded path: ${a}`)}await fs.cp(a,LOCAL_FEEDS_DIR,{recursive:!0,force:!0}),Logger.log("Successfully updated local feeds")}}catch(t){throw Logger.error("Error during feed synchronization",t),new Error("Failed to sync feeds. Use --verbose for detailed error information.")}}))}async loadFeedsIntoConfiguration(t,e){this.configuration=await ConfigurationLoader.loadFeedsIntoConfiguration(this.configuration,t,e),await this.saveConfiguration()}async loadClientMCPSettings(){this.configuration=await ConfigurationLoader.loadClientMCPSettings(this.configuration),await this.saveConfiguration()}async reloadClientMCPSettings(){return await this.withLock((async()=>{await this.loadClientMCPSettings()}))}async removeServerFromClientMCPSettings(t,e){return await this.withLock((async()=>{const{readJsonFile:i,writeJsonFile:a}=await import("../../utils/clientUtils.js"),n=Object.entries(SUPPORTED_CLIENTS),r=e?n.filter((([t])=>t===e)):n;for(const[e,n]of r){const r=process.env.CODE_INSIDERS?n.codeInsiderSettingPath:n.codeSettingPath;try{const n=await i(r,!0);let s=!1;if("GithubCopilot"===e)n.servers?.[t]&&(delete n.servers[t],s=!0);else if("VisualStudio"===e){const e=t.replace(/-/g,"_");n.servers?.[e]&&(delete n.servers[e],s=!0)}else n.mcpServers?.[t]&&(delete n.mcpServers[t],s=!0);s&&(await a(r,n),Logger.debug(`Removed server ${t} from client ${e} settings`))}catch(i){Logger.error(`Failed to remove server ${t} from client ${e} settings:`,i)}}if(this.configuration.clientMCPSettings){if(e){const i=this.configuration.clientMCPSettings[e];i&&(i.mcpServers?.[t]&&delete i.mcpServers[t],i.servers?.[t]&&delete i.servers[t])}else for(const e of Object.values(this.configuration.clientMCPSettings))e.mcpServers?.[t]&&delete e.mcpServers[t],e.servers?.[t]&&delete e.servers[t];await this.saveConfiguration()}}))}}export const configProvider=ConfigurationProvider.getInstance();
|
|
2
2
|
//# sourceMappingURL=ConfigurationProvider.js.map
|
|
@@ -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","mcp","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,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BA,IAAe6C,IACtDG,EAEN,IAAK,MAAOhD,EAAYoD,KAAmBD,EAAe,CACtD,MAAME,EAAcC,QAAQC,IAAIC,cAC1BJ,EAAeK,uBACfL,EAAeM,gBAErB,IACI,MAAMC,QAAgBb,EAAaO,GAAa,GAChD,IAAIO,GAAW,EAGf,GAAmB,kBAAf5D,GAAkC2D,EAAQE,KAAKC,UAAUpF,UAClDiF,EAAQE,IAAIC,QAAQpF,GAC3BkF,GAAW,OACR,GAAmB,iBAAf5D,EAA8B,CACrC,MAAM+D,EAAmBrF,EAAWsF,QAAQ,KAAM,KAC9CL,EAAQG,UAAUC,YACXJ,EAAQG,QAAQC,GACvBH,GAAW,EAEnB,MAAWD,EAAQhF,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,EAAeU,UAAUpF,WAClB0E,EAAeU,QAAQpF,GAG1C,MAEI,IAAK,MAAM0E,KAAkBH,OAAOgB,OAAO/H,KAAKN,cAAcU,mBACtD8G,EAAezE,aAAaD,WACrB0E,EAAezE,WAAWD,GAEjC0E,EAAeU,UAAUpF,WAClB0E,EAAeU,QAAQpF,SAIpCxC,KAAK0B,mBACf,IAER,SAIG,MAAMsG,eAAiBzI,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,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W,QAEZ,GAAmB,iBAAfvE,EAA8B,CACrC,MAAMyE,EAAmB/F,EAAWgG,QAAQ,KAAM,KAC9CJ,EAAQE,UAAUC,YACXH,EAAQE,QAAQC,GACvBF,GAAW,EAEnB,MAAWD,EAAQ3F,aAAaD,YACrB4F,EAAQ3F,WAAWD,GAC1B6F,GAAW,GAIXA,UACMb,EAAcM,EAAaM,GACjCpJ,OAAOiH,MAAM,kBAAkBzD,iBAA0BsB,cAEjE,CAAE,MAAO1C,GACLpC,OAAOoC,MAAM,2BAA2BoB,iBAA0BsB,cAAwB1C,EAC9F,CACJ,CAGA,GAAIpB,KAAKN,cAAcU,kBAAmB,CACtC,GAAIkH,EAAQ,CAER,MAAMO,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,"
|
|
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,QACX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A8B,WAAY,sBAE1Ha,MAAS,CACPT,UAAW,CACTC,YAAa,0BAEfK,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,uBA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AAOxB,IACN1B,OAAO0B,MAAM,yBAAyBnB,KAAgBC,aAAsBkB,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"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clF,eAAY6F,EAAYvD,EAAc8C,mBAGpEF,EAAclF,UAEf,MADA1D,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,uBACd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,EACtB,GACD,CACClG,SAAU5D,mBAAmBoK,iCAC7BvG,kBAAmB,+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,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,EAAYzC,GAAc0C,EAAQ,EANlC,MAFEF,EAAeF,KAAKtC,EASxB,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":[]}
|