@sap-ux/fiori-mcp-server 1.8.5 → 1.8.7
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/dist/index.js
CHANGED
|
@@ -4311,9 +4311,9 @@ PGHZoN9jcvvvWDLUGtJkEotMgdFpEA2XWR83H4fVFVc=
|
|
|
4311
4311
|
The output of this tool is required for the final step 'execute_functionality' (Step 3).`,annotations:{title:"Get Fiori Functionality Details",readOnlyHint:!0,idempotentHint:!0,openWorldHint:!1},inputSchema:Av(BZr),outputSchema:Av(KZr)},{name:"execute_functionality",description:`**(Step 3 of 3)**
|
|
4312
4312
|
Executes a specific functionality to modify an existing SAP Fiori application with provided parameters.
|
|
4313
4313
|
This is the **final step** of the workflow and performs the actual modification.
|
|
4314
|
-
You MUST provide the exact parameter information obtained from get_functionality_details (Step 2).`,annotations:{title:"Execute Fiori Functionality",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},inputSchema:Av(qZr),outputSchema:Av(XZr)}];var zpt=class{applicationKey="";extensionName="";extensionVersion="";getApplicationKey(){return this.applicationKey}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.extensionName}};var Jfo=br(z6r(),1);var Ugt=class{extensionName;eventName;constructor(e,r){this.extensionName=e,this.eventName=r}getExtensionName(){return this.extensionName}getEventName(){return this.eventName}toString(){return`${this.extensionName}/${this.eventName}`}};var PM;(function(t){t[t.OnePercent=0]="OnePercent",t[t.TenPercent=1]="TenPercent",t[t.NoSampling=2]="NoSampling"})(PM||(PM={}));function j9t(t){if(t.setUseDiskRetryCaching)try{t.setUseDiskRetryCaching(!0)}catch{}t.addTelemetryProcessor(e=>(e.tags??={},e.tags["ai.location.ip"]="0.0.0.0",e.tags["ai.cloud.roleInstance"]="masked",e.tags["ai.cloud.role"]="masked",e.tags["ai.device.type"]="masked",!0))}var K6r={name:"@sap-ux/telemetry",version:"1.0.15",description:"Library for sending usage telemetry data",type:"module",repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/telemetry"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Atelemetry"},license:"Apache-2.0",private:!1,main:"dist/index.js",scripts:{build:"tsc --build",watch:"tsc --watch",clean:"rimraf --glob dist coverage *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors","test-u":"cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors -u",link:"pnpm link --global",unlink:"pnpm unlink --global",example:"ts-node example/index.ts"},dependencies:{"@sap-ux/store":"workspace:*","@sap-ux/project-access":"workspace:*","@sap-ux/btp-utils":"workspace:*","@sap-ux/ui5-config":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/nodejs-utils":"workspace:*",applicationinsights:"3.15.0",axios:"1.18.0","performance-now":"2.1.0",yaml:"2.9.0"},devDependencies:{"@jest/globals":"30.4.1","jest-extended":"7.0.0",memfs:"3.4.13",unionfs:"4.6.0",dotenv:"17.4.2"},files:["dist","LICENSE","!dist/*.map","!dist/**/*.map"],engines:{node:">=22.x"}};var xM={azureInstrumentationKey:"",telemetryEnabled:!0,telemetryLibName:K6r.name,telemetryLibVersion:K6r.version,consumerModuleName:"",consumerModuleVersion:""};process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL??="true";var Bgt=class extends zpt{clients;constructor(e,r,n){super(),this.clients=new Map,this.applicationKey=e,this.extensionVersion=n,this.extensionName=r;let i=this.createTelemetryClient(PM.OnePercent),a=this.createTelemetryClient(PM.TenPercent),s=this.createTelemetryClient(PM.NoSampling);this.clients.set(PM.OnePercent,i),this.clients.set(PM.TenPercent,a),this.clients.set(PM.NoSampling,s)}reportBlocking(e,r,n,i,a=!1){if(!a||xM.telemetryEnabled){let{client:s,event:c}=this.prepareClientAndEvent(e,r,n,i);return this.trackEventBlocking(s,c)}return Promise.resolve()}async report(e,r,n,i,a,s){if(s!==void 0&&!s||!xM.telemetryEnabled)return;let{client:c,event:l}=this.prepareClientAndEvent(e,r,n,i);this.trackEvent(c,l)}prepareClientAndEvent(e,r,n,i=PM.NoSampling){let a=this.clients.get(i),c={name:new Ugt(this.extensionName,e).toString(),properties:r,measurements:n};return{client:a,event:c}}async trackEventBlocking(e,r){process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&(e.trackEvent(r),await e.flush())}trackEvent(e,r){return process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"?(e.trackEvent(r),!0):!1}createTelemetryClient(e){let r;switch(e){case PM.OnePercent:r=1;break;case PM.TenPercent:r=10;break;case PM.NoSampling:default:r=100;break}let n=new Jfo.TelemetryClient(this.applicationKey);return n.config.samplingPercentage=r,j9t(n),n}};var W6r=()=>{let t=new Date().getTime();return new Date(t).toISOString()};var qgt=class extends Bgt{constructor(e,r,n){super(e,r,n)}async report(e,r,n,i,a,s){let c=await U9t(a),l={v:this.extensionVersion,datetime:W6r()},u={...r,...c,...l};await super.report(e,u,n,i,a,s)}async reportEvent(e,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(e,n);return super.report(e.eventName,a,s,r,n,i)}async reportEventBlocking(e,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(e,n);return super.reportBlocking(e.eventName,a,s,r,i)}async collectToolsSuiteTelemetry(e,r){let n=await U9t(r),i={v:this.extensionVersion,datetime:W6r()},a={...e.properties,...n,...i},s={...e.measurements};return{finalProperties:a,finalMeasurements:s}}};dar();var Qfo=br(sk(),1),Zfo=br(Ior(),1);nU();import IX from"node:fs";import Loe from"node:path";var B9t={internalFeature:!1};var Ggt;(function(t){t.UNKNOWN="UNKNOWN",t.NO_TOOLS_ID="NO_TOOLS_ID"})(Ggt||(Ggt={}));var fee;(function(t){t.CAPJava="CAPJava",t.CAPNode="CAPNode",t.ABAP="ABAP",t.UNKNOWN="UNKNOWN"})(fee||(fee={}));var k1e;(function(t){t.CF="CF",t.ABAP="ABAP",t.UNKNOWN_DEPLOY_CONFIG="UNKNOWN_DEPLOY_CONFIG",t.NO_DEPLOY_CONFIG="NO_DEPLOY_CONFIG"})(k1e||(k1e={}));var C0;(function(t){t.DevSpace="cmn.devspace",t.AppStudio="cmn.appstudio",t.AppStudioBackwardCompatible="appstudio",t.InternlVsExternal="cmn.internalFeatures",t.InternlVsExternalBackwardCompatible="internalVsExternal",t.TemplateType="cmn.template",t.DeployTargetType="cmn.deployTarget",t.ODataSourceType="cmn.odataSource",t.AppToolsId="cmn.toolsId",t.NodeVersion="cmn.nodeVersion",t.AppProgrammingLanguage="cmn.appLanguage",t.TemplateId="cmn.templateId",t.TemplateVersion="cmn.templateVersion",t.ApplicationType="cmn.applicationType",t.IdeType="cmn.ideType"})(C0||(C0={}));async function U9t(t){let e=await X6r(),r={};return t&&(r=await BTc(t.appPath)),{...e,...r}}async function X6r(){let t={};return t[C0.DevSpace]=await UTc(),t[C0.AppStudio]=zA(),t[C0.AppStudioBackwardCompatible]=t[C0.AppStudio],t[C0.InternlVsExternal]=KTc(),t[C0.InternlVsExternalBackwardCompatible]=t[C0.InternlVsExternal],t[C0.NodeVersion]=await YTc(),t[C0.IdeType]=J6r(),t}async function UTc(){if(zA())try{if(!process.env.H2O_URL||!process.env.WORKSPACE_ID)return"";let t=process.env.H2O_URL,e=process.env.WORKSPACE_ID.replace("workspaces-",""),r=`${t}/ws-manager/api/v1/workspace/${e}`,n=await Qfo.default.get(r);if(n.data)return n.data?.config?.annotations?.pack}catch{}return""}async function BTc(t){if(!t)return{};let e=await qTc(t),r=await zTc(t),n=await XLe(t),i=await GTc(t);n==="Fiori Reuse"&&(i=fee.UNKNOWN);let a=await WTc(t),s=await L6e(t),c={};return c[C0.TemplateType]=e,c[C0.DeployTargetType]=r,c[C0.ODataSourceType]=i,c[C0.AppToolsId]=a.toolsId??"",c[C0.AppProgrammingLanguage]=s,c[C0.TemplateId]=a.id??"",c[C0.TemplateVersion]=a.version??"",c[C0.ApplicationType]=n??"",c}async function qTc(t){let e=Loe.join(t,"README.md"),r=Loe.join(t,".appGenInfo.json");if(IX.existsSync(r)){let n=await IX.promises.readFile(r,"utf-8"),i=JSON.parse(n);if(i?.generationParameters?.template)return i.generationParameters.template.trim()}if(IX.existsSync(e)){let n=await IX.promises.readFile(e,"utf-8");if(n){let i="",a=n.split(/\r?\n/);for(let s of a){let l=/\|\*\*Template Used\*\*<br>(.*?)\|/.exec(s);if(l&&l.length>=2){i=l[1].trim();break}}return i}}return""}async function GTc(t){try{let e;try{e=await T7(t)}catch{}if(!e)try{let i=Loe.dirname(t);e=await T7(i,!1)}catch{}let r=!1;if(!e){let i=Loe.dirname(t),a=Loe.dirname(i);r=await FLe(a),e=r?a:t}if(r)return fee.CAPJava;let n=await SOe(e);return HTc(n)}catch{return fee.UNKNOWN}}function HTc(t){return t==="EDMXBackend"?fee.ABAP:t==="CAPNodejs"?fee.CAPNode:t==="CAPJava"?fee.CAPJava:fee.UNKNOWN}async function zTc(t){let e=k1e.NO_DEPLOY_CONFIG,r=Loe.join(t,"ui5-deploy.yaml");try{await IX.promises.access(r);let n=await IX.promises.readFile(r,"utf-8"),a=Zfo.default.parse(n)?.builder?.customTasks;a?e=a.some(c=>c.name==="deploy-to-abap")?k1e.ABAP:k1e.CF:e=k1e.UNKNOWN_DEPLOY_CONFIG}catch{}return e}function KTc(){return B9t.internalFeature?"internal":"external"}async function WTc(t){let e=await tk(t),r={manifest:Loe.join(e,"manifest.json"),appdescr:Loe.join(e,"manifest.appdescr_variant"),ui5Yaml:Loe.join(t,"ui5.yaml")};try{if(IX.existsSync(r.manifest)){let n=await IX.promises.readFile(r.manifest,"utf-8"),i=JSON.parse(n);return Y6r(i["sap.app"]?.sourceTemplate??{})}if(IX.existsSync(r.appdescr)&&IX.existsSync(r.ui5Yaml)){let n=await IX.promises.readFile(r.ui5Yaml,"utf-8"),a=(await jSe.newInstance(n)).getCustomConfiguration("adp");return Y6r(a?.support??{})}}catch{}return Y6r({})}function Y6r(t){return{id:t.id??"",version:t.version??"",toolsId:t.toolsId??Ggt.NO_TOOLS_ID}}async function YTc(){try{return(await new sMe().run("node",["-v"])??"unknown").replaceAll(/(?:^v)|([\r\n]{1,100})/g,"")}catch{return"unknown"}}function J6r(){if(zA())return"appstudio";let t=process.env.VSCODE_CWD?.toLowerCase()??"",e=process.env.VSCODE_PID,r=process.env.TERM_PROGRAM??"",n=process.env.VSCODE_APPNAME?.toLowerCase()??"";return!e&&!t&&r!=="vscode"&&r!=="vscode-insiders"?"unknown":process.env.CURSOR_TRACE_ID||n.includes("cursor")||t.includes("cursor")?"cursor":n.includes("windsurf")||t.includes("windsurf")||t.includes("codeium")?"windsurf":n.includes("antigravity")||t.includes("antigravity")?"antigravity":n.includes("trae")||t.includes("trae")?"trae":n.includes("kiro")||t.includes("kiro")?"kiro":n.includes("vscodium")||n.includes("codium")||t.includes("vscodium")||t.includes("codium")?"vscodium":n.includes("code-server")||t.includes("code-server")||process.env.CODE_SERVER_SESSION?"code-server":n.includes("insiders")||t.includes("code - insiders")||t.includes("code insiders")||t.includes("vscode-insiders")||r==="vscode-insiders"?"vscode-insiders":e||r==="vscode"?"vscode":"unknown"}var eho=br(z6r(),1);var Eze;(function(t){t.Test="test",t.TELEMETRY_SETTINGS_INIT_FAILED="TELEMETRY_SETTINGS_INIT_FAILED",t.DISABLE_TELEMETRY="DISABLE_TELEMETRY"})(Eze||(Eze={}));var XTc=t=>{let e=[/sap-ux.+/gi,/[-a-zA-Z]+\/ide-extension\/.+/gi,/(\/telemetry\/.+)/gi],r=[],n=t.split(`
|
|
4314
|
+
You MUST provide the exact parameter information obtained from get_functionality_details (Step 2).`,annotations:{title:"Execute Fiori Functionality",readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},inputSchema:Av(qZr),outputSchema:Av(XZr)}];var zpt=class{applicationKey="";extensionName="";extensionVersion="";getApplicationKey(){return this.applicationKey}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.extensionName}};var Jfo=br(z6r(),1);var Ugt=class{extensionName;eventName;constructor(e,r){this.extensionName=e,this.eventName=r}getExtensionName(){return this.extensionName}getEventName(){return this.eventName}toString(){return`${this.extensionName}/${this.eventName}`}};var PM;(function(t){t[t.OnePercent=0]="OnePercent",t[t.TenPercent=1]="TenPercent",t[t.NoSampling=2]="NoSampling"})(PM||(PM={}));function j9t(t){if(t.setUseDiskRetryCaching)try{t.setUseDiskRetryCaching(!0)}catch{}t.addTelemetryProcessor(e=>(e.tags??={},e.tags["ai.location.ip"]="0.0.0.0",e.tags["ai.cloud.roleInstance"]="masked",e.tags["ai.cloud.role"]="masked",e.tags["ai.device.type"]="masked",!0))}var K6r={name:"@sap-ux/telemetry",version:"1.0.17",description:"Library for sending usage telemetry data",type:"module",repository:{type:"git",url:"https://github.com/SAP/open-ux-tools.git",directory:"packages/telemetry"},bugs:{url:"https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Atelemetry"},license:"Apache-2.0",private:!1,main:"dist/index.js",scripts:{build:"tsc --build",watch:"tsc --watch",clean:"rimraf --glob dist coverage *.tsbuildinfo",format:"prettier --write '**/*.{js,json,ts,yaml,yml}' --ignore-path ../../.prettierignore",lint:"eslint","lint:fix":"eslint --fix",test:"cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors","test-u":"cross-env NODE_OPTIONS='--experimental-vm-modules' jest --ci --forceExit --detectOpenHandles --colors -u",link:"pnpm link --global",unlink:"pnpm unlink --global",example:"ts-node example/index.ts"},dependencies:{"@sap-ux/store":"workspace:*","@sap-ux/project-access":"workspace:*","@sap-ux/btp-utils":"workspace:*","@sap-ux/ui5-config":"workspace:*","@sap-ux/logger":"workspace:*","@sap-ux/nodejs-utils":"workspace:*",applicationinsights:"3.15.0",axios:"1.18.1","performance-now":"2.1.0",yaml:"2.9.0"},devDependencies:{"@jest/globals":"30.4.1","jest-extended":"7.0.0",memfs:"3.4.13",unionfs:"4.6.0",dotenv:"17.4.2"},files:["dist","LICENSE","!dist/*.map","!dist/**/*.map"],engines:{node:">=22.x"}};var xM={azureInstrumentationKey:"",telemetryEnabled:!0,telemetryLibName:K6r.name,telemetryLibVersion:K6r.version,consumerModuleName:"",consumerModuleVersion:""};process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL??="true";var Bgt=class extends zpt{clients;constructor(e,r,n){super(),this.clients=new Map,this.applicationKey=e,this.extensionVersion=n,this.extensionName=r;let i=this.createTelemetryClient(PM.OnePercent),a=this.createTelemetryClient(PM.TenPercent),s=this.createTelemetryClient(PM.NoSampling);this.clients.set(PM.OnePercent,i),this.clients.set(PM.TenPercent,a),this.clients.set(PM.NoSampling,s)}reportBlocking(e,r,n,i,a=!1){if(!a||xM.telemetryEnabled){let{client:s,event:c}=this.prepareClientAndEvent(e,r,n,i);return this.trackEventBlocking(s,c)}return Promise.resolve()}async report(e,r,n,i,a,s){if(s!==void 0&&!s||!xM.telemetryEnabled)return;let{client:c,event:l}=this.prepareClientAndEvent(e,r,n,i);this.trackEvent(c,l)}prepareClientAndEvent(e,r,n,i=PM.NoSampling){let a=this.clients.get(i),c={name:new Ugt(this.extensionName,e).toString(),properties:r,measurements:n};return{client:a,event:c}}async trackEventBlocking(e,r){process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&(e.trackEvent(r),await e.flush())}trackEvent(e,r){return process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"?(e.trackEvent(r),!0):!1}createTelemetryClient(e){let r;switch(e){case PM.OnePercent:r=1;break;case PM.TenPercent:r=10;break;case PM.NoSampling:default:r=100;break}let n=new Jfo.TelemetryClient(this.applicationKey);return n.config.samplingPercentage=r,j9t(n),n}};var W6r=()=>{let t=new Date().getTime();return new Date(t).toISOString()};var qgt=class extends Bgt{constructor(e,r,n){super(e,r,n)}async report(e,r,n,i,a,s){let c=await U9t(a),l={v:this.extensionVersion,datetime:W6r()},u={...r,...c,...l};await super.report(e,u,n,i,a,s)}async reportEvent(e,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(e,n);return super.report(e.eventName,a,s,r,n,i)}async reportEventBlocking(e,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(e,n);return super.reportBlocking(e.eventName,a,s,r,i)}async collectToolsSuiteTelemetry(e,r){let n=await U9t(r),i={v:this.extensionVersion,datetime:W6r()},a={...e.properties,...n,...i},s={...e.measurements};return{finalProperties:a,finalMeasurements:s}}};dar();var Qfo=br(sk(),1),Zfo=br(Ior(),1);nU();import IX from"node:fs";import Loe from"node:path";var B9t={internalFeature:!1};var Ggt;(function(t){t.UNKNOWN="UNKNOWN",t.NO_TOOLS_ID="NO_TOOLS_ID"})(Ggt||(Ggt={}));var fee;(function(t){t.CAPJava="CAPJava",t.CAPNode="CAPNode",t.ABAP="ABAP",t.UNKNOWN="UNKNOWN"})(fee||(fee={}));var k1e;(function(t){t.CF="CF",t.ABAP="ABAP",t.UNKNOWN_DEPLOY_CONFIG="UNKNOWN_DEPLOY_CONFIG",t.NO_DEPLOY_CONFIG="NO_DEPLOY_CONFIG"})(k1e||(k1e={}));var C0;(function(t){t.DevSpace="cmn.devspace",t.AppStudio="cmn.appstudio",t.AppStudioBackwardCompatible="appstudio",t.InternlVsExternal="cmn.internalFeatures",t.InternlVsExternalBackwardCompatible="internalVsExternal",t.TemplateType="cmn.template",t.DeployTargetType="cmn.deployTarget",t.ODataSourceType="cmn.odataSource",t.AppToolsId="cmn.toolsId",t.NodeVersion="cmn.nodeVersion",t.AppProgrammingLanguage="cmn.appLanguage",t.TemplateId="cmn.templateId",t.TemplateVersion="cmn.templateVersion",t.ApplicationType="cmn.applicationType",t.IdeType="cmn.ideType"})(C0||(C0={}));async function U9t(t){let e=await X6r(),r={};return t&&(r=await BTc(t.appPath)),{...e,...r}}async function X6r(){let t={};return t[C0.DevSpace]=await UTc(),t[C0.AppStudio]=zA(),t[C0.AppStudioBackwardCompatible]=t[C0.AppStudio],t[C0.InternlVsExternal]=KTc(),t[C0.InternlVsExternalBackwardCompatible]=t[C0.InternlVsExternal],t[C0.NodeVersion]=await YTc(),t[C0.IdeType]=J6r(),t}async function UTc(){if(zA())try{if(!process.env.H2O_URL||!process.env.WORKSPACE_ID)return"";let t=process.env.H2O_URL,e=process.env.WORKSPACE_ID.replace("workspaces-",""),r=`${t}/ws-manager/api/v1/workspace/${e}`,n=await Qfo.default.get(r);if(n.data)return n.data?.config?.annotations?.pack}catch{}return""}async function BTc(t){if(!t)return{};let e=await qTc(t),r=await zTc(t),n=await XLe(t),i=await GTc(t);n==="Fiori Reuse"&&(i=fee.UNKNOWN);let a=await WTc(t),s=await L6e(t),c={};return c[C0.TemplateType]=e,c[C0.DeployTargetType]=r,c[C0.ODataSourceType]=i,c[C0.AppToolsId]=a.toolsId??"",c[C0.AppProgrammingLanguage]=s,c[C0.TemplateId]=a.id??"",c[C0.TemplateVersion]=a.version??"",c[C0.ApplicationType]=n??"",c}async function qTc(t){let e=Loe.join(t,"README.md"),r=Loe.join(t,".appGenInfo.json");if(IX.existsSync(r)){let n=await IX.promises.readFile(r,"utf-8"),i=JSON.parse(n);if(i?.generationParameters?.template)return i.generationParameters.template.trim()}if(IX.existsSync(e)){let n=await IX.promises.readFile(e,"utf-8");if(n){let i="",a=n.split(/\r?\n/);for(let s of a){let l=/\|\*\*Template Used\*\*<br>(.*?)\|/.exec(s);if(l&&l.length>=2){i=l[1].trim();break}}return i}}return""}async function GTc(t){try{let e;try{e=await T7(t)}catch{}if(!e)try{let i=Loe.dirname(t);e=await T7(i,!1)}catch{}let r=!1;if(!e){let i=Loe.dirname(t),a=Loe.dirname(i);r=await FLe(a),e=r?a:t}if(r)return fee.CAPJava;let n=await SOe(e);return HTc(n)}catch{return fee.UNKNOWN}}function HTc(t){return t==="EDMXBackend"?fee.ABAP:t==="CAPNodejs"?fee.CAPNode:t==="CAPJava"?fee.CAPJava:fee.UNKNOWN}async function zTc(t){let e=k1e.NO_DEPLOY_CONFIG,r=Loe.join(t,"ui5-deploy.yaml");try{await IX.promises.access(r);let n=await IX.promises.readFile(r,"utf-8"),a=Zfo.default.parse(n)?.builder?.customTasks;a?e=a.some(c=>c.name==="deploy-to-abap")?k1e.ABAP:k1e.CF:e=k1e.UNKNOWN_DEPLOY_CONFIG}catch{}return e}function KTc(){return B9t.internalFeature?"internal":"external"}async function WTc(t){let e=await tk(t),r={manifest:Loe.join(e,"manifest.json"),appdescr:Loe.join(e,"manifest.appdescr_variant"),ui5Yaml:Loe.join(t,"ui5.yaml")};try{if(IX.existsSync(r.manifest)){let n=await IX.promises.readFile(r.manifest,"utf-8"),i=JSON.parse(n);return Y6r(i["sap.app"]?.sourceTemplate??{})}if(IX.existsSync(r.appdescr)&&IX.existsSync(r.ui5Yaml)){let n=await IX.promises.readFile(r.ui5Yaml,"utf-8"),a=(await jSe.newInstance(n)).getCustomConfiguration("adp");return Y6r(a?.support??{})}}catch{}return Y6r({})}function Y6r(t){return{id:t.id??"",version:t.version??"",toolsId:t.toolsId??Ggt.NO_TOOLS_ID}}async function YTc(){try{return(await new sMe().run("node",["-v"])??"unknown").replaceAll(/(?:^v)|([\r\n]{1,100})/g,"")}catch{return"unknown"}}function J6r(){if(zA())return"appstudio";let t=process.env.VSCODE_CWD?.toLowerCase()??"",e=process.env.VSCODE_PID,r=process.env.TERM_PROGRAM??"",n=process.env.VSCODE_APPNAME?.toLowerCase()??"";return!e&&!t&&r!=="vscode"&&r!=="vscode-insiders"?"unknown":process.env.CURSOR_TRACE_ID||n.includes("cursor")||t.includes("cursor")?"cursor":n.includes("windsurf")||t.includes("windsurf")||t.includes("codeium")?"windsurf":n.includes("antigravity")||t.includes("antigravity")?"antigravity":n.includes("trae")||t.includes("trae")?"trae":n.includes("kiro")||t.includes("kiro")?"kiro":n.includes("vscodium")||n.includes("codium")||t.includes("vscodium")||t.includes("codium")?"vscodium":n.includes("code-server")||t.includes("code-server")||process.env.CODE_SERVER_SESSION?"code-server":n.includes("insiders")||t.includes("code - insiders")||t.includes("code insiders")||t.includes("vscode-insiders")||r==="vscode-insiders"?"vscode-insiders":e||r==="vscode"?"vscode":"unknown"}var eho=br(z6r(),1);var Eze;(function(t){t.Test="test",t.TELEMETRY_SETTINGS_INIT_FAILED="TELEMETRY_SETTINGS_INIT_FAILED",t.DISABLE_TELEMETRY="DISABLE_TELEMETRY"})(Eze||(Eze={}));var XTc=t=>{let e=[/sap-ux.+/gi,/[-a-zA-Z]+\/ide-extension\/.+/gi,/(\/telemetry\/.+)/gi],r=[],n=t.split(`
|
|
4315
4315
|
`).filter(i=>!!/^\s*at .*(\S+:\d+|\(native\))/m.exec(i));return n.length&&n.forEach(i=>{let a=i.replace(/^\s+/,""),c=/ (\((.+):(\d+):(\d+)\)$)/.exec(i);if(!c)return;let l=null,u=c[2].replace(/\\/g,"/");for(let m of e){let g=m.exec(u);if(g){l=g[0];break}}if(!l)return;a=a.replace(c[0],"");let p=a.split(/\s+/).slice(1).join(""),d=c[3],f=c[4],h=`${p} at (${l}:${d}:${f});`;r.push(h)}),r},q9t,tho=t=>{process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY?.trim()!=="true"&&(q9t=new eho.TelemetryClient(xM.azureInstrumentationKey),j9t(q9t));let e={message:t.message};if(t.stack){let n=XTc(t.stack);n.length&&(e.stack=n.join(`
|
|
4316
|
-
`))}let r={name:Eze.TELEMETRY_SETTINGS_INIT_FAILED,properties:e,measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&q9t.trackEvent(r)},rho=(t,e)=>{let r={name:Eze.DISABLE_TELEMETRY,properties:{disableTelemetry:`${!t}`,...e},measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&q9t.trackEvent(r)};import JTc from"node:os";import QTc from"node:path";import ZTc from"node:fs";var eSc={win32:"\\AppData\\Roaming\\Code\\User\\settings.json",darwin:"/Library/Application Support/Code/User/settings.json",linux:"/.config/Code/User/settings.json",theia:"/.theia/settings.json"},tSc=["sap.ux.annotation.lsp.enableTelemetry","sap.ux.applicationModeler.enableTelemetry","sap.ux.help.enableTelemetry","sap.ux.serviceModeler.enableTelemetry"],rSc=t=>{let e=process.platform,r=t[e];if(zA()&&(r=t.theia),!r)return null;let n=JTc.homedir();return QTc.join(n,r)};async function nSc(t){let e;try{e=await t.read(new jye)}catch{}if(e)xM.telemetryEnabled=e.enableTelemetry;else{let r=rSc(eSc);if(!r)await G9t(!0);else{let n;try{n=await ZTc.promises.readFile(r,"utf-8");let i=JSON.parse(n),s=tSc.map(c=>i[c]??!0).reduce((c,l)=>c&&l,!0);await G9t(s)}catch{await G9t(!0)}}}}function iSc(t){y2t(FPe.TelemetrySetting,()=>{t.read(new jye).then(e=>{e&&(xM.telemetryEnabled=e.enableTelemetry)}).catch(()=>{})})}var Q6r=async t=>{try{xM.consumerModuleName=t.consumerModule.name,xM.consumerModuleVersion=t.consumerModule.version,B9t.internalFeature=t.internalFeature??!1,t.resourceId&&(xM.azureInstrumentationKey=t.resourceId);let e=await Bpt({entityName:"telemetrySetting"});await nSc(e),t.watchTelemetrySettingStore&&iSc(e)}catch(e){tho(e)}};async function G9t(t){try{let r=await Bpt({entityName:"telemetrySetting"}),n=new jpt({enableTelemetry:t});await r.write(n),xM.telemetryEnabled=t}catch{}let e=await X6r();rho(t,e)}var oSc="ApplicationInsightsInstrumentationKeyPLACEH0LDER",Q8=class t{static clientMap=new Map;static getTelemetryClient(){return t.getTelemetryClientByClass(qgt)}static getTelemetryClientByClass(e){let r=t.clientMap.get(e.name);if(r)return r;let n=t.buildConnectionString(xM.azureInstrumentationKey);return r=new e(n,xM.consumerModuleName,xM.consumerModuleVersion),t.clientMap.set(e.name,r),r}static buildConnectionString(e){return e?`InstrumentationKey=${e===oSc?"00000000-0000-0000-0000-000000000000":e}`:""}};var Z8;(function(t){t.START_MARK="START_MARK",t.END_MARK="END_MARK",t.MEASUREMENT="MEASUREMENT"})(Z8||(Z8={}));var H9t=class{static initTiming;static enteries;static initialize;static startMark;static endMark;static measure;static getEntries;static getEntriesByName;static getEntriesByType;static getEntriesByNameType;static getMeasurementDuration;static clearEntries};var Hgt=class{startTime;name;type;getStartTime(){return this.startTime}constructor(e,r,n){this.startTime=n,this.name=e,this.startTime=n,this.type=r}},z9t=class extends Hgt{startTime;duration;constructor(e,r,n){super(e,Z8.MEASUREMENT,r),this.startTime=r,this.duration=n,this.duration=n}getDurationTime(){return this.duration}};import{performance as aSc}from"node:perf_hooks";var sSc=()=>aSc.now(),GC=class t extends H9t{static initTiming;static now=sSc;static entries=[];static initialize(){t.initTiming=t.now()}static mark(e,r,n){let i=new Hgt(e,r,n);t.entries.push(i)}static startMark(e){let r=t.now(),n=e+r;return t.mark(n,Z8.START_MARK,r),n}static endMark(e){let r=t.now();t.mark(e,Z8.END_MARK,r)}static measure(e){let r=t.getEntriesByNameType(e,Z8.START_MARK).slice(-1)[0],n=t.getEntriesByNameType(e,Z8.END_MARK).slice(-1)[0];if(!r&&!n)throw new Error(`Failed to execute 'measure': mark '${e}' doesn't exist.`);if(!r||!n){let l=r?Z8.END_MARK:Z8.START_MARK;throw new Error(`Failed to execute 'measure': mark '${e}'of type '${l}' doesn't exist.`)}let i=r.getStartTime(),s=n.getStartTime()-i,c=new z9t(`${e}`,t.now(),s);t.entries.push(c)}static getEntries(){return t.entries}static getEntriesByName(e){return t.entries.filter(r=>r.name===e)}static getEntriesByNameType(e,r){return t.entries.filter(n=>n.name===e&&n.type===r)}static getEntriesByType(e){return t.entries.filter(r=>r.type===e)}static getMeasurementDuration(e){return t.getEntriesByNameType(e,Z8.MEASUREMENT).slice(-1)[0].getDurationTime()}static clearEntries(){t.entries=[]}};GC.initialize();var cSc=(t,e)=>new Error(`Wrong path for '${t}' field is specified in instructions with index - ${e}`),lSc=(t,e,r,n)=>{let i=e.split("/"),a=t,s=0;for(;s<i.length;){if(a=a[i[s]],a===void 0)throw cSc(r,n);s++}return a},nho=(t,e)=>{let r={},n={},i=null;e.paramIndex!==void 0&&(i=t[e.paramIndex]);let a=e.key?e.key:"data",s="";return typeof e.value=="string"?s=e.value:e.value!==void 0&&e.paramIndex!==void 0?s=lSc(i,e.value.path,"val",e.paramIndex):s=i,typeof s=="number"&&!Number.isNaN(s)?n[a]=s:r[a]=s,[r,n]},Z6r=(t,e)=>{let r,n,i={},a={};if(Array.isArray(e))for(let s of e)[r,n]=nho(t,s),i={...i,...r},a={...a,...n};else[i,a]=nho(t,e);return[i,a]};var iho=(t,e,r,n)=>(...i)=>{let a=e.apply(t,i);return Q8.getTelemetryClient().report(r,{},{},n),a},oho=(t,e,r,n)=>async(...i)=>{let a=await e.apply(t,i);return Q8.getTelemetryClient().report(r,{},{},n),a},aho=(t,e,r,n)=>(...i)=>{let a=GC.startMark("mark"),s=e.apply(t,i);GC.endMark(a),GC.measure(a);let c=GC.getMeasurementDuration(a);return Q8.getTelemetryClient().report(r,{},{ms:c},n),s},sho=(t,e,r,n)=>async(...i)=>{let a=GC.startMark("mark"),s=await e.apply(t,i);GC.endMark(a),GC.measure(a);let c=GC.getMeasurementDuration(a);return Q8.getTelemetryClient().report(r,{},{ms:c},n),s},cho=(t,e,r,n,i)=>(...a)=>{let s=e.apply(t,a),[c,l]=Z6r(a,i);return Q8.getTelemetryClient().report(r,c,l,n),s},lho=(t,e,r,n,i)=>async(...a)=>{let s=await e.apply(t,a),[c,l]=Z6r(a,i);return Q8.getTelemetryClient().report(r,c,l,n),s};var Moe;(function(t){t.NOTIFICATION="notify",t.DURATION="duration",t.CAPTURE_PARAM="captureParam"})(Moe||(Moe={}));var K9t=new Map;K9t.set(Moe.NOTIFICATION,iho);K9t.set(Moe.DURATION,aho);K9t.set(Moe.CAPTURE_PARAM,cho);var W9t=new Map;W9t.set(Moe.NOTIFICATION,oho);W9t.set(Moe.DURATION,sho);W9t.set(Moe.CAPTURE_PARAM,lho);var eYr={AnnotationModeler:"sap.ux.annotationModeler",AppGenerator:"sap.ux.appGenerator",ApplicationModeler:"sap.ux.applicationModeler",Help:"sap.ux.help",ServiceModeler:"sap.ux.serviceModeler",Internal:"sap.ux.internal"},tYr={"sap.ux.help.testBetaFeatures.enableAppStudioGDContribution":"c8c52f0b-0d7d-4697-997a-d6f29814f42e","sap.ux.help.testBetaFeatures.showTestGuides":"fbb03f42-0a86-4fd5-9fc4-8c9b38a4d1a3","sap.ux.help.testBetaFeatures.enableFioriAI":"165a0e31-35ea-4bee-8d47-b8593435a82d","sap.ux.help.testBetaFeatures.enableFioriAIJoule":"165a0e31-35ea-4bee-8d47-b8593435a82e","sap.ux.help.testBetaFeatures.enableFioriAIVsCode":"165a0e31-35ea-4bee-8d47-b8593435a82f","sap.ux.help.testBetaFeatures.enableFioriAIAppModeler":"165a0e31-35ea-4bee-8d47-b8593435a82g","sap.ux.help.testBetaFeatures.enableFioriAIRapGeneration":"165a0e31-35ea-4bee-8d47-b8593435a82h","sap.ux.applicationModeler.testBetaFeatures.manifestEditor":!0,"sap.ux.appGenerator.testBetaFeatures.newAnnotationAPI":!0},Y9t="testBetaFeatures",rYr="sap.ux.applicationModeler.enableExperimentalFeatures";import{createRequire as pSc}from"node:module";var dSc=pSc(import.meta.url);function uho(){try{return dSc("vscode")}catch{return}}var fSc=uho(),X9t=class t{static get vscode(){return fSc}static getFeatureToggle(e){let r,n=t.vscode;if((e.includes(Y9t)||e===rYr)&&n){let a=e.slice(0,e.lastIndexOf(".")),s=e.slice(e.lastIndexOf(".")+1,e.length);r=n.workspace.getConfiguration(a)?.get(s)}else r=!1;return process.env.TOOLSUITE_FEATURES&&(r=process.env.TOOLSUITE_FEATURES.split(",").includes(e)?!0:r),tYr[e]&&(tYr[e]===r?r=!0:r=!1),{feature:e,isEnabled:r===!0?r:!1}}static getAllFeatureToggles(){let e=[],r=t.vscode;if(r)Object.keys(eYr).forEach(n=>{let i=`${eYr[n]}.${Y9t}`,a,s=[];try{a=r.workspace.getConfiguration(i),s=Object.keys(a).filter(c=>typeof a?.[c]!="function")}catch{}a&&s.forEach(c=>{let l=a.get(c),u={feature:`${i}.${c}`,isEnabled:l||!1};e.push(u)})});else if(process.env.TOOLSUITE_FEATURES){let n=process.env.TOOLSUITE_FEATURES.split(",");for(let i of n){let a={feature:i,isEnabled:!0};e.push(a)}}return e}};function nYr(){let t="sap.ux.internal.enableInternalFeatures",e=!1,r=X9t.vscode;return r&&(e=(r.workspace?r.workspace.getConfiguration().get(t):!1)??!1),process.env.TOOLSUITE_INTERNAL&&process.env.TOOLSUITE_INTERNAL==="true"&&(e=!0),e}var xmo=br(Tmo(),1);import{randomUUID as XOc}from"node:crypto";var zOc=["@sap-ux","fiori-mcp-server"].join("/");var KOc="1.8.5",Smo={name:zOc,version:KOc};var Omo={telemetry:{unknownOs:"Unknown"}};var mYr="fiori-mcp-server",Amo=sE.createInstance();async function YOc(){await Amo.init({resources:{en:{[mYr]:Omo}},lng:"en",fallbackLng:"en",defaultNS:mYr,ns:[mYr],showSupportNotice:!1})}function Cmo(t,e){return Amo.t(t,e)}YOc().catch(()=>{});var{version:JOc}=Smo,Pmo="@sap-ux/fiori-mcp-server",wmo="unknown-tool",QOc="0a65e45d-6bf4-421d-b845-61e888c50e9e",hee=class{static _telemetryData;static _previousEventTimestamp;static _sessionId;static get telemetryData(){return this._telemetryData}static get sessionId(){return this._sessionId}static initSessionId(){this._sessionId=XOc(),Po.info(`Telemetry session initialized with ID: ${this._sessionId}`)}static async initTelemetrySettings(e){this._sessionId||this.initSessionId();let r={consumerModule:{name:Pmo,version:JOc},watchTelemetrySettingStore:!1,internalFeature:nYr(),resourceId:QOc,...e};try{await Q6r(r)}catch(n){Po.error(`Error initializing telemetry settings: ${n}`)}}static createTelemetryData(e,r=!1){let n=new Date().getTime();if(this._previousEventTimestamp||(r=!1,this._previousEventTimestamp=n),!this._telemetryData){let i=Cmo("telemetry.unknownOs");try{i=(0,xmo.default)()}catch{}this._telemetryData={Platform:zA()?"SBAS":"VSCode",OperatingSystem:i,SessionId:this.sessionId}}if(r){let i={...this._telemetryData,...e};if(Math.abs(this._previousEventTimestamp-n)<1e3&&JSON.stringify(i)===JSON.stringify(this._telemetryData))return}return this._previousEventTimestamp=n,this._telemetryData=Object.assign(this._telemetryData,e),this._telemetryData}static prepareTelemetryEvent(e,r){this.markToolsEndTime();let n=r.markName?GC.getMeasurementDuration(r.markName):void 0;return{eventName:e,properties:r,measurements:n?{RequestTime:n}:{}}}static markToolStartTime(){this.createTelemetryData({markName:GC.startMark("MCP_LOADING_TIME")})}static markToolsEndTime(){this._telemetryData?.markName&&(GC.endMark(this._telemetryData.markName),GC.measure(this._telemetryData.markName))}static async sendTelemetry(e,r,n){let i=this.createTelemetryData(r)??r,a=this.prepareTelemetryEvent(e,i);await Q8.getTelemetryClient().reportEvent(a,PM.NoSampling,n?{appPath:n}:void 0)}static getTelemetryName(){return Pmo}};var Nmo="2024-11-05";function ZOc(t){return GTe.includes(t)?t:GTe.includes(Nmo)?Nmo:GTe[GTe.length-1]}var fXt=class{server;mcpClientName="unknown-client";mcpClientVersion="unknown-version";constructor(){this.server=new HSt({name:"fiori-mcp",version:cRe,icons:[{src:"https://raw.githubusercontent.com/SAP/open-ux-tools/main/packages/fiori-mcp-server/assets/icon.svg",mimeType:"image/svg+xml"},{src:"https://raw.githubusercontent.com/SAP/open-ux-tools/main/packages/fiori-mcp-server/assets/icon.png",mimeType:"image/png"}],title:"MCP Server for SAP Fiori"},{capabilities:{tools:{}}}),this.setupToolHandlers(),this.setupErrorHandling()}setupErrorHandling(){this.server.onerror=e=>Po.error(`[MCP Error] ${e}`),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async setupTelemetry(){await hee.initTelemetrySettings()}setupToolHandlers(){this.server.setRequestHandler(nKe,async e=>{this.mcpClientName=e.params.clientInfo?.name||"unknown-client",this.mcpClientVersion=e.params.clientInfo?.version||"unknown-version",Po.info(`MCP Client connected: ${this.mcpClientName} v${this.mcpClientVersion}`);let r={mcpClientName:this.mcpClientName,mcpClientVersion:this.mcpClientVersion};return await hee.sendTelemetry(Lkn,r),{protocolVersion:ZOc(e.params.protocolVersion),capabilities:{tools:{}},serverInfo:{name:"fiori-mcp",version:cRe},instructions:`
|
|
4316
|
+
`))}let r={name:Eze.TELEMETRY_SETTINGS_INIT_FAILED,properties:e,measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&q9t.trackEvent(r)},rho=(t,e)=>{let r={name:Eze.DISABLE_TELEMETRY,properties:{disableTelemetry:`${!t}`,...e},measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&q9t.trackEvent(r)};import JTc from"node:os";import QTc from"node:path";import ZTc from"node:fs";var eSc={win32:"\\AppData\\Roaming\\Code\\User\\settings.json",darwin:"/Library/Application Support/Code/User/settings.json",linux:"/.config/Code/User/settings.json",theia:"/.theia/settings.json"},tSc=["sap.ux.annotation.lsp.enableTelemetry","sap.ux.applicationModeler.enableTelemetry","sap.ux.help.enableTelemetry","sap.ux.serviceModeler.enableTelemetry"],rSc=t=>{let e=process.platform,r=t[e];if(zA()&&(r=t.theia),!r)return null;let n=JTc.homedir();return QTc.join(n,r)};async function nSc(t){let e;try{e=await t.read(new jye)}catch{}if(e)xM.telemetryEnabled=e.enableTelemetry;else{let r=rSc(eSc);if(!r)await G9t(!0);else{let n;try{n=await ZTc.promises.readFile(r,"utf-8");let i=JSON.parse(n),s=tSc.map(c=>i[c]??!0).reduce((c,l)=>c&&l,!0);await G9t(s)}catch{await G9t(!0)}}}}function iSc(t){y2t(FPe.TelemetrySetting,()=>{t.read(new jye).then(e=>{e&&(xM.telemetryEnabled=e.enableTelemetry)}).catch(()=>{})})}var Q6r=async t=>{try{xM.consumerModuleName=t.consumerModule.name,xM.consumerModuleVersion=t.consumerModule.version,B9t.internalFeature=t.internalFeature??!1,t.resourceId&&(xM.azureInstrumentationKey=t.resourceId);let e=await Bpt({entityName:"telemetrySetting"});await nSc(e),t.watchTelemetrySettingStore&&iSc(e)}catch(e){tho(e)}};async function G9t(t){try{let r=await Bpt({entityName:"telemetrySetting"}),n=new jpt({enableTelemetry:t});await r.write(n),xM.telemetryEnabled=t}catch{}let e=await X6r();rho(t,e)}var oSc="ApplicationInsightsInstrumentationKeyPLACEH0LDER",Q8=class t{static clientMap=new Map;static getTelemetryClient(){return t.getTelemetryClientByClass(qgt)}static getTelemetryClientByClass(e){let r=t.clientMap.get(e.name);if(r)return r;let n=t.buildConnectionString(xM.azureInstrumentationKey);return r=new e(n,xM.consumerModuleName,xM.consumerModuleVersion),t.clientMap.set(e.name,r),r}static buildConnectionString(e){return e?`InstrumentationKey=${e===oSc?"00000000-0000-0000-0000-000000000000":e}`:""}};var Z8;(function(t){t.START_MARK="START_MARK",t.END_MARK="END_MARK",t.MEASUREMENT="MEASUREMENT"})(Z8||(Z8={}));var H9t=class{static initTiming;static enteries;static initialize;static startMark;static endMark;static measure;static getEntries;static getEntriesByName;static getEntriesByType;static getEntriesByNameType;static getMeasurementDuration;static clearEntries};var Hgt=class{startTime;name;type;getStartTime(){return this.startTime}constructor(e,r,n){this.startTime=n,this.name=e,this.startTime=n,this.type=r}},z9t=class extends Hgt{startTime;duration;constructor(e,r,n){super(e,Z8.MEASUREMENT,r),this.startTime=r,this.duration=n,this.duration=n}getDurationTime(){return this.duration}};import{performance as aSc}from"node:perf_hooks";var sSc=()=>aSc.now(),GC=class t extends H9t{static initTiming;static now=sSc;static entries=[];static initialize(){t.initTiming=t.now()}static mark(e,r,n){let i=new Hgt(e,r,n);t.entries.push(i)}static startMark(e){let r=t.now(),n=e+r;return t.mark(n,Z8.START_MARK,r),n}static endMark(e){let r=t.now();t.mark(e,Z8.END_MARK,r)}static measure(e){let r=t.getEntriesByNameType(e,Z8.START_MARK).slice(-1)[0],n=t.getEntriesByNameType(e,Z8.END_MARK).slice(-1)[0];if(!r&&!n)throw new Error(`Failed to execute 'measure': mark '${e}' doesn't exist.`);if(!r||!n){let l=r?Z8.END_MARK:Z8.START_MARK;throw new Error(`Failed to execute 'measure': mark '${e}'of type '${l}' doesn't exist.`)}let i=r.getStartTime(),s=n.getStartTime()-i,c=new z9t(`${e}`,t.now(),s);t.entries.push(c)}static getEntries(){return t.entries}static getEntriesByName(e){return t.entries.filter(r=>r.name===e)}static getEntriesByNameType(e,r){return t.entries.filter(n=>n.name===e&&n.type===r)}static getEntriesByType(e){return t.entries.filter(r=>r.type===e)}static getMeasurementDuration(e){return t.getEntriesByNameType(e,Z8.MEASUREMENT).slice(-1)[0].getDurationTime()}static clearEntries(){t.entries=[]}};GC.initialize();var cSc=(t,e)=>new Error(`Wrong path for '${t}' field is specified in instructions with index - ${e}`),lSc=(t,e,r,n)=>{let i=e.split("/"),a=t,s=0;for(;s<i.length;){if(a=a[i[s]],a===void 0)throw cSc(r,n);s++}return a},nho=(t,e)=>{let r={},n={},i=null;e.paramIndex!==void 0&&(i=t[e.paramIndex]);let a=e.key?e.key:"data",s="";return typeof e.value=="string"?s=e.value:e.value!==void 0&&e.paramIndex!==void 0?s=lSc(i,e.value.path,"val",e.paramIndex):s=i,typeof s=="number"&&!Number.isNaN(s)?n[a]=s:r[a]=s,[r,n]},Z6r=(t,e)=>{let r,n,i={},a={};if(Array.isArray(e))for(let s of e)[r,n]=nho(t,s),i={...i,...r},a={...a,...n};else[i,a]=nho(t,e);return[i,a]};var iho=(t,e,r,n)=>(...i)=>{let a=e.apply(t,i);return Q8.getTelemetryClient().report(r,{},{},n),a},oho=(t,e,r,n)=>async(...i)=>{let a=await e.apply(t,i);return Q8.getTelemetryClient().report(r,{},{},n),a},aho=(t,e,r,n)=>(...i)=>{let a=GC.startMark("mark"),s=e.apply(t,i);GC.endMark(a),GC.measure(a);let c=GC.getMeasurementDuration(a);return Q8.getTelemetryClient().report(r,{},{ms:c},n),s},sho=(t,e,r,n)=>async(...i)=>{let a=GC.startMark("mark"),s=await e.apply(t,i);GC.endMark(a),GC.measure(a);let c=GC.getMeasurementDuration(a);return Q8.getTelemetryClient().report(r,{},{ms:c},n),s},cho=(t,e,r,n,i)=>(...a)=>{let s=e.apply(t,a),[c,l]=Z6r(a,i);return Q8.getTelemetryClient().report(r,c,l,n),s},lho=(t,e,r,n,i)=>async(...a)=>{let s=await e.apply(t,a),[c,l]=Z6r(a,i);return Q8.getTelemetryClient().report(r,c,l,n),s};var Moe;(function(t){t.NOTIFICATION="notify",t.DURATION="duration",t.CAPTURE_PARAM="captureParam"})(Moe||(Moe={}));var K9t=new Map;K9t.set(Moe.NOTIFICATION,iho);K9t.set(Moe.DURATION,aho);K9t.set(Moe.CAPTURE_PARAM,cho);var W9t=new Map;W9t.set(Moe.NOTIFICATION,oho);W9t.set(Moe.DURATION,sho);W9t.set(Moe.CAPTURE_PARAM,lho);var eYr={AnnotationModeler:"sap.ux.annotationModeler",AppGenerator:"sap.ux.appGenerator",ApplicationModeler:"sap.ux.applicationModeler",Help:"sap.ux.help",ServiceModeler:"sap.ux.serviceModeler",Internal:"sap.ux.internal"},tYr={"sap.ux.help.testBetaFeatures.enableAppStudioGDContribution":"c8c52f0b-0d7d-4697-997a-d6f29814f42e","sap.ux.help.testBetaFeatures.showTestGuides":"fbb03f42-0a86-4fd5-9fc4-8c9b38a4d1a3","sap.ux.help.testBetaFeatures.enableFioriAI":"165a0e31-35ea-4bee-8d47-b8593435a82d","sap.ux.help.testBetaFeatures.enableFioriAIJoule":"165a0e31-35ea-4bee-8d47-b8593435a82e","sap.ux.help.testBetaFeatures.enableFioriAIVsCode":"165a0e31-35ea-4bee-8d47-b8593435a82f","sap.ux.help.testBetaFeatures.enableFioriAIAppModeler":"165a0e31-35ea-4bee-8d47-b8593435a82g","sap.ux.help.testBetaFeatures.enableFioriAIRapGeneration":"165a0e31-35ea-4bee-8d47-b8593435a82h","sap.ux.applicationModeler.testBetaFeatures.manifestEditor":!0,"sap.ux.appGenerator.testBetaFeatures.newAnnotationAPI":!0},Y9t="testBetaFeatures",rYr="sap.ux.applicationModeler.enableExperimentalFeatures";import{createRequire as pSc}from"node:module";var dSc=pSc(import.meta.url);function uho(){try{return dSc("vscode")}catch{return}}var fSc=uho(),X9t=class t{static get vscode(){return fSc}static getFeatureToggle(e){let r,n=t.vscode;if((e.includes(Y9t)||e===rYr)&&n){let a=e.slice(0,e.lastIndexOf(".")),s=e.slice(e.lastIndexOf(".")+1,e.length);r=n.workspace.getConfiguration(a)?.get(s)}else r=!1;return process.env.TOOLSUITE_FEATURES&&(r=process.env.TOOLSUITE_FEATURES.split(",").includes(e)?!0:r),tYr[e]&&(tYr[e]===r?r=!0:r=!1),{feature:e,isEnabled:r===!0?r:!1}}static getAllFeatureToggles(){let e=[],r=t.vscode;if(r)Object.keys(eYr).forEach(n=>{let i=`${eYr[n]}.${Y9t}`,a,s=[];try{a=r.workspace.getConfiguration(i),s=Object.keys(a).filter(c=>typeof a?.[c]!="function")}catch{}a&&s.forEach(c=>{let l=a.get(c),u={feature:`${i}.${c}`,isEnabled:l||!1};e.push(u)})});else if(process.env.TOOLSUITE_FEATURES){let n=process.env.TOOLSUITE_FEATURES.split(",");for(let i of n){let a={feature:i,isEnabled:!0};e.push(a)}}return e}};function nYr(){let t="sap.ux.internal.enableInternalFeatures",e=!1,r=X9t.vscode;return r&&(e=(r.workspace?r.workspace.getConfiguration().get(t):!1)??!1),process.env.TOOLSUITE_INTERNAL&&process.env.TOOLSUITE_INTERNAL==="true"&&(e=!0),e}var xmo=br(Tmo(),1);import{randomUUID as XOc}from"node:crypto";var zOc=["@sap-ux","fiori-mcp-server"].join("/");var KOc="1.8.7",Smo={name:zOc,version:KOc};var Omo={telemetry:{unknownOs:"Unknown"}};var mYr="fiori-mcp-server",Amo=sE.createInstance();async function YOc(){await Amo.init({resources:{en:{[mYr]:Omo}},lng:"en",fallbackLng:"en",defaultNS:mYr,ns:[mYr],showSupportNotice:!1})}function Cmo(t,e){return Amo.t(t,e)}YOc().catch(()=>{});var{version:JOc}=Smo,Pmo="@sap-ux/fiori-mcp-server",wmo="unknown-tool",QOc="0a65e45d-6bf4-421d-b845-61e888c50e9e",hee=class{static _telemetryData;static _previousEventTimestamp;static _sessionId;static get telemetryData(){return this._telemetryData}static get sessionId(){return this._sessionId}static initSessionId(){this._sessionId=XOc(),Po.info(`Telemetry session initialized with ID: ${this._sessionId}`)}static async initTelemetrySettings(e){this._sessionId||this.initSessionId();let r={consumerModule:{name:Pmo,version:JOc},watchTelemetrySettingStore:!1,internalFeature:nYr(),resourceId:QOc,...e};try{await Q6r(r)}catch(n){Po.error(`Error initializing telemetry settings: ${n}`)}}static createTelemetryData(e,r=!1){let n=new Date().getTime();if(this._previousEventTimestamp||(r=!1,this._previousEventTimestamp=n),!this._telemetryData){let i=Cmo("telemetry.unknownOs");try{i=(0,xmo.default)()}catch{}this._telemetryData={Platform:zA()?"SBAS":"VSCode",OperatingSystem:i,SessionId:this.sessionId}}if(r){let i={...this._telemetryData,...e};if(Math.abs(this._previousEventTimestamp-n)<1e3&&JSON.stringify(i)===JSON.stringify(this._telemetryData))return}return this._previousEventTimestamp=n,this._telemetryData=Object.assign(this._telemetryData,e),this._telemetryData}static prepareTelemetryEvent(e,r){this.markToolsEndTime();let n=r.markName?GC.getMeasurementDuration(r.markName):void 0;return{eventName:e,properties:r,measurements:n?{RequestTime:n}:{}}}static markToolStartTime(){this.createTelemetryData({markName:GC.startMark("MCP_LOADING_TIME")})}static markToolsEndTime(){this._telemetryData?.markName&&(GC.endMark(this._telemetryData.markName),GC.measure(this._telemetryData.markName))}static async sendTelemetry(e,r,n){let i=this.createTelemetryData(r)??r,a=this.prepareTelemetryEvent(e,i);await Q8.getTelemetryClient().reportEvent(a,PM.NoSampling,n?{appPath:n}:void 0)}static getTelemetryName(){return Pmo}};var Nmo="2024-11-05";function ZOc(t){return GTe.includes(t)?t:GTe.includes(Nmo)?Nmo:GTe[GTe.length-1]}var fXt=class{server;mcpClientName="unknown-client";mcpClientVersion="unknown-version";constructor(){this.server=new HSt({name:"fiori-mcp",version:cRe,icons:[{src:"https://raw.githubusercontent.com/SAP/open-ux-tools/main/packages/fiori-mcp-server/assets/icon.svg",mimeType:"image/svg+xml"},{src:"https://raw.githubusercontent.com/SAP/open-ux-tools/main/packages/fiori-mcp-server/assets/icon.png",mimeType:"image/png"}],title:"MCP Server for SAP Fiori"},{capabilities:{tools:{}}}),this.setupToolHandlers(),this.setupErrorHandling()}setupErrorHandling(){this.server.onerror=e=>Po.error(`[MCP Error] ${e}`),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async setupTelemetry(){await hee.initTelemetrySettings()}setupToolHandlers(){this.server.setRequestHandler(nKe,async e=>{this.mcpClientName=e.params.clientInfo?.name||"unknown-client",this.mcpClientVersion=e.params.clientInfo?.version||"unknown-version",Po.info(`MCP Client connected: ${this.mcpClientName} v${this.mcpClientVersion}`);let r={mcpClientName:this.mcpClientName,mcpClientVersion:this.mcpClientVersion};return await hee.sendTelemetry(Lkn,r),{protocolVersion:ZOc(e.params.protocolVersion),capabilities:{tools:{}},serverInfo:{name:"fiori-mcp",version:cRe},instructions:`
|
|
4317
4317
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
|
4318
4318
|
\u{1F6A8}\u{1F6A8}\u{1F6A8} STOP - READ THIS BEFORE CALLING ANY TOOLS \u{1F6A8}\u{1F6A8}\u{1F6A8}
|
|
4319
4319
|
\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/fiori-mcp-server",
|
|
3
3
|
"description": "SAP Fiori - Model Context Protocol (MCP) server",
|
|
4
|
-
"version": "1.8.
|
|
4
|
+
"version": "1.8.7",
|
|
5
5
|
"mcpName": "io.github.SAP/fiori-mcp-server",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"SAP Fiori tools",
|
|
@@ -57,20 +57,20 @@
|
|
|
57
57
|
"xml-formatter": "3.7.0",
|
|
58
58
|
"ts-node": "10.9.2",
|
|
59
59
|
"zod": "4.3.6",
|
|
60
|
-
"@sap-ux/axios-extension": "2.0.
|
|
61
|
-
"@sap-ux/btp-utils": "2.0.
|
|
60
|
+
"@sap-ux/axios-extension": "2.0.6",
|
|
61
|
+
"@sap-ux/btp-utils": "2.0.5",
|
|
62
62
|
"@sap-ux/feature-toggle": "1.0.4",
|
|
63
|
-
"@sap-ux/fiori-annotation-api": "1.0.
|
|
63
|
+
"@sap-ux/fiori-annotation-api": "1.0.13",
|
|
64
64
|
"@sap-ux/fiori-docs-embeddings": "1.2.5",
|
|
65
65
|
"@sap-ux/i18n": "1.0.2",
|
|
66
66
|
"@sap-ux/logger": "1.0.2",
|
|
67
|
-
"@sap-ux/nodejs-utils": "1.0.
|
|
67
|
+
"@sap-ux/nodejs-utils": "1.0.6",
|
|
68
68
|
"@sap-ux/odata-annotation-core": "1.0.1",
|
|
69
69
|
"@sap-ux/odata-annotation-core-types": "1.0.1",
|
|
70
70
|
"@sap-ux/odata-entity-model": "1.0.1",
|
|
71
|
-
"@sap-ux/project-access": "2.1.
|
|
71
|
+
"@sap-ux/project-access": "2.1.6",
|
|
72
72
|
"@sap-ux/store": "2.0.3",
|
|
73
|
-
"@sap-ux/telemetry": "1.0.
|
|
73
|
+
"@sap-ux/telemetry": "1.0.17",
|
|
74
74
|
"@sap-ux/text-document-utils": "1.0.1"
|
|
75
75
|
},
|
|
76
76
|
"engines": {
|