@sap-ux/fiori-mcp-server 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -2640,7 +2640,7 @@ PGHZoN9jcvvvWDLUGtJkEotMgdFpEA2XWR83H4fVFVc=
|
|
|
2640
2640
|
This is the **final step** of the workflow and performs the actual modification.
|
|
2641
2641
|
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:cm(JTr),outputSchema:cm(abr)}];var f8e=class{applicationKey="";extensionName="";extensionVersion="";getApplicationKey(){return this.applicationKey}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.extensionName}};var Wmi=Dn(tmr(),1);var iZe=class{extensionName;eventName;constructor(t,r){this.extensionName=t,this.eventName=r}getExtensionName(){return this.extensionName}getEventName(){return this.eventName}toString(){return`${this.extensionName}/${this.eventName}`}};var k1;(function(e){e[e.OnePercent=0]="OnePercent",e[e.TenPercent=1]="TenPercent",e[e.NoSampling=2]="NoSampling"})(k1||(k1={}));function LDt(e){e.channel.setUseDiskRetryCaching(!0),e.addTelemetryProcessor(t=>(t.tags["ai.location.ip"]="0.0.0.0",t.tags["ai.cloud.roleInstance"]="masked",t.tags["ai.cloud.role"]="masked",t.tags["ai.device.type"]="masked",!0))}var rmr={name:"@sap-ux/telemetry",version:"1.0.9",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:"2.9.8",axios:"1.16.0","performance-now":"2.1.0",yaml:"2.8.3"},devDependencies:{"@jest/globals":"30.3.0","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 $1={azureInstrumentationKey:"",telemetryEnabled:!0,telemetryLibName:rmr.name,telemetryLibVersion:rmr.version,consumerModuleName:"",consumerModuleVersion:""};process.env.APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL??="true";var aZe=class extends f8e{clients;constructor(t,r,n){super(),this.clients=new Map,this.applicationKey=t,this.extensionVersion=n,this.extensionName=r;let i=this.createTelemetryClient(k1.OnePercent),a=this.createTelemetryClient(k1.TenPercent),s=this.createTelemetryClient(k1.NoSampling);this.clients.set(k1.OnePercent,i),this.clients.set(k1.TenPercent,a),this.clients.set(k1.NoSampling,s)}reportBlocking(t,r,n,i,a=!1){if(!a||$1.telemetryEnabled){let{client:s,event:c}=this.prepareClientAndEvent(t,r,n,i);return this.trackEventBlocking(s,c)}return Promise.resolve()}async report(t,r,n,i,a,s){if(s!==void 0&&!s||!$1.telemetryEnabled)return;let{client:c,event:l}=this.prepareClientAndEvent(t,r,n,i);this.trackEvent(c,l)}prepareClientAndEvent(t,r,n,i=k1.NoSampling){let a=this.clients.get(i),c={name:new iZe(this.extensionName,t).toString(),properties:r,measurements:n};return{client:a,event:c}}async trackEventBlocking(t,r){if(process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true")return new Promise((n,i)=>{try{t.trackEvent(r),t.flush({callback:()=>n()})}catch(a){i(a)}})}trackEvent(t,r){return process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"?(t.trackEvent(r),!0):!1}createTelemetryClient(t){let r;switch(t){case k1.OnePercent:r=1;break;case k1.TenPercent:r=10;break;case k1.NoSampling:default:r=100;break}let n=new Wmi.TelemetryClient(this.applicationKey);return n.config.samplingPercentage=r,LDt(n),n}};var nmr=()=>{let e=new Date().getTime();return new Date(e).toISOString()};var oZe=class extends aZe{constructor(t,r,n){super(t,r,n)}async report(t,r,n,i,a,s){let c=await kDt(a),l={v:this.extensionVersion,datetime:nmr()},u={...r,...c,...l};await super.report(t,u,n,i,a,s)}async reportEvent(t,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(t,n);return super.report(t.eventName,a,s,r,n,i)}async reportEventBlocking(t,r,n,i){let{finalProperties:a,finalMeasurements:s}=await this.collectToolsSuiteTelemetry(t,n);return super.reportBlocking(t.eventName,a,s,r,i)}async collectToolsSuiteTelemetry(t,r){let n=await kDt(r),i={v:this.extensionVersion,datetime:nmr()},a={...t.properties,...n,...i},s={...t.measurements};return{finalProperties:a,finalMeasurements:s}}};d2t();var Xmi=Dn(Fx(),1),Qmi=Dn(YFe(),1);sk();import kY from"node:fs";import zJ from"node:path";var $Dt={internalFeature:!1};var sZe;(function(e){e.UNKNOWN="UNKNOWN",e.NO_TOOLS_ID="NO_TOOLS_ID"})(sZe||(sZe={}));var fW;(function(e){e.CAPJava="CAPJava",e.CAPNode="CAPNode",e.ABAP="ABAP",e.UNKNOWN="UNKNOWN"})(fW||(fW={}));var HTe;(function(e){e.CF="CF",e.ABAP="ABAP",e.UNKNOWN_DEPLOY_CONFIG="UNKNOWN_DEPLOY_CONFIG",e.NO_DEPLOY_CONFIG="NO_DEPLOY_CONFIG"})(HTe||(HTe={}));var yO;(function(e){e.DevSpace="cmn.devspace",e.AppStudio="cmn.appstudio",e.AppStudioBackwardCompatible="appstudio",e.InternlVsExternal="cmn.internalFeatures",e.InternlVsExternalBackwardCompatible="internalVsExternal",e.TemplateType="cmn.template",e.DeployTargetType="cmn.deployTarget",e.ODataSourceType="cmn.odataSource",e.AppToolsId="cmn.toolsId",e.NodeVersion="cmn.nodeVersion",e.AppProgrammingLanguage="cmn.appLanguage",e.TemplateId="cmn.templateId",e.TemplateVersion="cmn.templateVersion",e.ApplicationType="cmn.applicationType",e.IdeType="cmn.ideType"})(yO||(yO={}));async function kDt(e){let t=await amr(),r={};return e&&(r=await wxo(e.appPath)),{...t,...r}}async function amr(){let e={};return e[yO.DevSpace]=await xxo(),e[yO.AppStudio]=yT(),e[yO.AppStudioBackwardCompatible]=e[yO.AppStudio],e[yO.InternlVsExternal]=kxo(),e[yO.InternlVsExternalBackwardCompatible]=e[yO.InternlVsExternal],e[yO.NodeVersion]=await Vxo(),e[yO.IdeType]=omr(),e}async function xxo(){if(yT())try{if(!process.env.H2O_URL||!process.env.WORKSPACE_ID)return"";let e=process.env.H2O_URL,t=process.env.WORKSPACE_ID.replace("workspaces-",""),r=`${e}/ws-manager/api/v1/workspace/${t}`,n=await Xmi.default.get(r);if(n.data)return n.data?.config?.annotations?.pack}catch{}return""}async function wxo(e){if(!e)return{};let t=await Ixo(e),r=await Lxo(e),n=await Z0e(e),i=await Rxo(e);n==="Fiori Reuse"&&(i=fW.UNKNOWN);let a=await $xo(e),s=await T2e(e),c={};return c[yO.TemplateType]=t,c[yO.DeployTargetType]=r,c[yO.ODataSourceType]=i,c[yO.AppToolsId]=a.toolsId??"",c[yO.AppProgrammingLanguage]=s,c[yO.TemplateId]=a.id??"",c[yO.TemplateVersion]=a.version??"",c[yO.ApplicationType]=n??"",c}async function Ixo(e){let t=zJ.join(e,"README.md"),r=zJ.join(e,".appGenInfo.json");if(kY.existsSync(r)){let n=await kY.promises.readFile(r,"utf-8"),i=JSON.parse(n);if(i?.generationParameters?.template)return i.generationParameters.template.trim()}if(kY.existsSync(t)){let n=await kY.promises.readFile(t,"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 Rxo(e){try{let t;try{t=await qK(e)}catch{}if(!t)try{let i=zJ.dirname(e);t=await qK(i,!1)}catch{}let r=!1;if(!t){let i=zJ.dirname(e),a=zJ.dirname(i);r=await $0e(a),t=r?a:e}if(r)return fW.CAPJava;let n=await cme(t);return Mxo(n)}catch{return fW.UNKNOWN}}function Mxo(e){return e==="EDMXBackend"?fW.ABAP:e==="CAPNodejs"?fW.CAPNode:e==="CAPJava"?fW.CAPJava:fW.UNKNOWN}async function Lxo(e){let t=HTe.NO_DEPLOY_CONFIG,r=zJ.join(e,"ui5-deploy.yaml");try{await kY.promises.access(r);let n=await kY.promises.readFile(r,"utf-8"),a=Qmi.default.parse(n)?.builder?.customTasks;a?t=a.some(c=>c.name==="deploy-to-abap")?HTe.ABAP:HTe.CF:t=HTe.UNKNOWN_DEPLOY_CONFIG}catch{}return t}function kxo(){return $Dt.internalFeature?"internal":"external"}async function $xo(e){let t=await tR(e),r={manifest:zJ.join(t,"manifest.json"),appdescr:zJ.join(t,"manifest.appdescr_variant"),ui5Yaml:zJ.join(e,"ui5.yaml")};try{if(kY.existsSync(r.manifest)){let n=await kY.promises.readFile(r.manifest,"utf-8"),i=JSON.parse(n);return imr(i["sap.app"]?.sourceTemplate??{})}if(kY.existsSync(r.appdescr)&&kY.existsSync(r.ui5Yaml)){let n=await kY.promises.readFile(r.ui5Yaml,"utf-8"),a=(await bhe.newInstance(n)).getCustomConfiguration("adp");return imr(a?.support??{})}}catch{}return imr({})}function imr(e){return{id:e.id??"",version:e.version??"",toolsId:e.toolsId??sZe.NO_TOOLS_ID}}async function Vxo(){try{return(await new hCe().run("node",["-v"])??"unknown").replaceAll(/(?:^v)|([\r\n]{1,100})/g,"")}catch{return"unknown"}}function omr(){if(yT())return"appstudio";let e=process.env.VSCODE_CWD?.toLowerCase()??"",t=process.env.VSCODE_PID,r=process.env.TERM_PROGRAM??"",n=process.env.VSCODE_APPNAME?.toLowerCase()??"";return!t&&!e&&r!=="vscode"&&r!=="vscode-insiders"?"unknown":process.env.CURSOR_TRACE_ID||n.includes("cursor")||e.includes("cursor")?"cursor":n.includes("windsurf")||e.includes("windsurf")||e.includes("codeium")?"windsurf":n.includes("antigravity")||e.includes("antigravity")?"antigravity":n.includes("trae")||e.includes("trae")?"trae":n.includes("kiro")||e.includes("kiro")?"kiro":n.includes("vscodium")||n.includes("codium")||e.includes("vscodium")||e.includes("codium")?"vscodium":n.includes("code-server")||e.includes("code-server")||process.env.CODE_SERVER_SESSION?"code-server":n.includes("insiders")||e.includes("code - insiders")||e.includes("code insiders")||e.includes("vscode-insiders")||r==="vscode-insiders"?"vscode-insiders":t||r==="vscode"?"vscode":"unknown"}var Jmi=Dn(tmr(),1);var hMe;(function(e){e.Test="test",e.TELEMETRY_SETTINGS_INIT_FAILED="TELEMETRY_SETTINGS_INIT_FAILED",e.DISABLE_TELEMETRY="DISABLE_TELEMETRY"})(hMe||(hMe={}));var Fxo=e=>{let t=[/sap-ux.+/gi,/[-a-zA-Z]+\/ide-extension\/.+/gi,/(\/telemetry\/.+)/gi],r=[],n=e.split(`
|
|
2642
2642
|
`).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 t){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},VDt,Zmi=e=>{process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY?.trim()!=="true"&&(VDt=new Jmi.TelemetryClient($1.azureInstrumentationKey),LDt(VDt));let t={message:e.message};if(e.stack){let n=Fxo(e.stack);n.length&&(t.stack=n.join(`
|
|
2643
|
-
`))}let r={name:hMe.TELEMETRY_SETTINGS_INIT_FAILED,properties:t,measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&VDt.trackEvent(r)},egi=(e,t)=>{let r={name:hMe.DISABLE_TELEMETRY,properties:{disableTelemetry:`${!e}`,...t},measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&VDt.trackEvent(r)};import Uxo from"node:os";import jxo from"node:path";import Bxo from"node:fs";var qxo={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"},Gxo=["sap.ux.annotation.lsp.enableTelemetry","sap.ux.applicationModeler.enableTelemetry","sap.ux.help.enableTelemetry","sap.ux.serviceModeler.enableTelemetry"],Hxo=e=>{let t=process.platform,r=e[t];if(yT()&&(r=e.theia),!r)return null;let n=Uxo.homedir();return jxo.join(n,r)};async function zxo(e){let t;try{t=await e.read(new qne)}catch{}if(t)$1.telemetryEnabled=t.enableTelemetry;else{let r=Hxo(qxo);if(!r)await FDt(!0);else{let n;try{n=await Bxo.promises.readFile(r,"utf-8");let i=JSON.parse(n),s=Gxo.map(c=>i[c]??!0).reduce((c,l)=>c&&l,!0);await FDt(s)}catch{await FDt(!0)}}}}function Yxo(e){i0t(o_e.TelemetrySetting,()=>{e.read(new qne).then(t=>{t&&($1.telemetryEnabled=t.enableTelemetry)}).catch(()=>{})})}var smr=async e=>{try{$1.consumerModuleName=e.consumerModule.name,$1.consumerModuleVersion=e.consumerModule.version,$Dt.internalFeature=e.internalFeature??!1,e.resourceId&&($1.azureInstrumentationKey=e.resourceId);let t=await l8e({entityName:"telemetrySetting"});await zxo(t),e.watchTelemetrySettingStore&&Yxo(t)}catch(t){Zmi(t)}};async function FDt(e){try{let r=await l8e({entityName:"telemetrySetting"}),n=new s8e({enableTelemetry:e});await r.write(n),$1.telemetryEnabled=e}catch{}let t=await amr();egi(e,t)}var T3=class e{static clientMap=new Map;static getTelemetryClient(){return e.getTelemetryClientByClass(oZe)}static getTelemetryClientByClass(t){let r=e.clientMap.get(t.name);if(r)return r;let n=t;return r=new n($1.azureInstrumentationKey,$1.consumerModuleName,$1.consumerModuleVersion),e.clientMap.set(t.name,r),r}};var b3;(function(e){e.START_MARK="START_MARK",e.END_MARK="END_MARK",e.MEASUREMENT="MEASUREMENT"})(b3||(b3={}));var UDt=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 cZe=class{startTime;name;type;getStartTime(){return this.startTime}constructor(t,r,n){this.startTime=n,this.name=t,this.startTime=n,this.type=r}},jDt=class extends cZe{startTime;duration;constructor(t,r,n){super(t,b3.MEASUREMENT,r),this.startTime=r,this.duration=n,this.duration=n}getDurationTime(){return this.duration}};import{performance as Kxo}from"node:perf_hooks";var Wxo=()=>Kxo.now(),OP=class e extends UDt{static initTiming;static now=Wxo;static entries=[];static initialize(){e.initTiming=e.now()}static mark(t,r,n){let i=new cZe(t,r,n);e.entries.push(i)}static startMark(t){let r=e.now(),n=t+r;return e.mark(n,b3.START_MARK,r),n}static endMark(t){let r=e.now();e.mark(t,b3.END_MARK,r)}static measure(t){let r=e.getEntriesByNameType(t,b3.START_MARK).slice(-1)[0],n=e.getEntriesByNameType(t,b3.END_MARK).slice(-1)[0];if(!r&&!n)throw new Error(`Failed to execute 'measure': mark '${t}' doesn't exist.`);if(!r||!n){let l=r?b3.END_MARK:b3.START_MARK;throw new Error(`Failed to execute 'measure': mark '${t}'of type '${l}' doesn't exist.`)}let i=r.getStartTime(),s=n.getStartTime()-i,c=new jDt(`${t}`,e.now(),s);e.entries.push(c)}static getEntries(){return e.entries}static getEntriesByName(t){return e.entries.filter(r=>r.name===t)}static getEntriesByNameType(t,r){return e.entries.filter(n=>n.name===t&&n.type===r)}static getEntriesByType(t){return e.entries.filter(r=>r.type===t)}static getMeasurementDuration(t){return e.getEntriesByNameType(t,b3.MEASUREMENT).slice(-1)[0].getDurationTime()}static clearEntries(){e.entries=[]}};OP.initialize();var Xxo=(e,t)=>new Error(`Wrong path for '${e}' field is specified in instructions with index - ${t}`),Qxo=(e,t,r,n)=>{let i=t.split("/"),a=e,s=0;for(;s<i.length;){if(a=a[i[s]],a===void 0)throw Xxo(r,n);s++}return a},tgi=(e,t)=>{let r={},n={},i=null;t.paramIndex!==void 0&&(i=e[t.paramIndex]);let a=t.key?t.key:"data",s="";return typeof t.value=="string"?s=t.value:t.value!==void 0&&t.paramIndex!==void 0?s=Qxo(i,t.value.path,"val",t.paramIndex):s=i,typeof s=="number"&&!Number.isNaN(s)?n[a]=s:r[a]=s,[r,n]},cmr=(e,t)=>{let r,n,i={},a={};if(Array.isArray(t))for(let s of t)[r,n]=tgi(e,s),i={...i,...r},a={...a,...n};else[i,a]=tgi(e,t);return[i,a]};var rgi=(e,t,r,n)=>(...i)=>{let a=t.apply(e,i);return T3.getTelemetryClient().report(r,{},{},n),a},ngi=(e,t,r,n)=>async(...i)=>{let a=await t.apply(e,i);return T3.getTelemetryClient().report(r,{},{},n),a},igi=(e,t,r,n)=>(...i)=>{let a=OP.startMark("mark"),s=t.apply(e,i);OP.endMark(a),OP.measure(a);let c=OP.getMeasurementDuration(a);return T3.getTelemetryClient().report(r,{},{ms:c},n),s},agi=(e,t,r,n)=>async(...i)=>{let a=OP.startMark("mark"),s=await t.apply(e,i);OP.endMark(a),OP.measure(a);let c=OP.getMeasurementDuration(a);return T3.getTelemetryClient().report(r,{},{ms:c},n),s},ogi=(e,t,r,n,i)=>(...a)=>{let s=t.apply(e,a),[c,l]=cmr(a,i);return T3.getTelemetryClient().report(r,c,l,n),s},sgi=(e,t,r,n,i)=>async(...a)=>{let s=await t.apply(e,a),[c,l]=cmr(a,i);return T3.getTelemetryClient().report(r,c,l,n),s};var KJ;(function(e){e.NOTIFICATION="notify",e.DURATION="duration",e.CAPTURE_PARAM="captureParam"})(KJ||(KJ={}));var BDt=new Map;BDt.set(KJ.NOTIFICATION,rgi);BDt.set(KJ.DURATION,igi);BDt.set(KJ.CAPTURE_PARAM,ogi);var qDt=new Map;qDt.set(KJ.NOTIFICATION,ngi);qDt.set(KJ.DURATION,agi);qDt.set(KJ.CAPTURE_PARAM,sgi);var lmr={AnnotationModeler:"sap.ux.annotationModeler",AppGenerator:"sap.ux.appGenerator",ApplicationModeler:"sap.ux.applicationModeler",Help:"sap.ux.help",ServiceModeler:"sap.ux.serviceModeler",Internal:"sap.ux.internal"},umr={"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},GDt="testBetaFeatures",pmr="sap.ux.applicationModeler.enableExperimentalFeatures";import{createRequire as Zxo}from"node:module";var e1o=Zxo(import.meta.url);function cgi(){try{return e1o("vscode")}catch{return}}var t1o=cgi(),HDt=class e{static get vscode(){return t1o}static getFeatureToggle(t){let r,n=e.vscode;if((t.includes(GDt)||t===pmr)&&n){let a=t.slice(0,t.lastIndexOf(".")),s=t.slice(t.lastIndexOf(".")+1,t.length);r=n.workspace.getConfiguration(a)?.get(s)}else r=!1;return process.env.TOOLSUITE_FEATURES&&(r=process.env.TOOLSUITE_FEATURES.split(",").includes(t)?!0:r),umr[t]&&(umr[t]===r?r=!0:r=!1),{feature:t,isEnabled:r===!0?r:!1}}static getAllFeatureToggles(){let t=[],r=e.vscode;if(r)Object.keys(lmr).forEach(n=>{let i=`${lmr[n]}.${GDt}`,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};t.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};t.push(a)}}return t}};function dmr(){let e="sap.ux.internal.enableInternalFeatures",t=!1,r=HDt.vscode;return r&&(t=(r.workspace?r.workspace.getConfiguration().get(e):!1)??!1),process.env.TOOLSUITE_INTERNAL&&process.env.TOOLSUITE_INTERNAL==="true"&&(t=!0),t}var Cyi=Dn(_yi(),1);import{randomUUID as Vwo}from"node:crypto";var Mwo=["@sap-ux","fiori-mcp-server"].join("/");var Lwo="1.5.0",Tyi={name:Mwo,version:Lwo};var byi={telemetry:{unknownOs:"Unknown"}};var Amr="fiori-mcp-server",Syi=hv.createInstance();async function $wo(){await Syi.init({resources:{en:{[Amr]:byi}},lng:"en",fallbackLng:"en",defaultNS:Amr,ns:[Amr],showSupportNotice:!1})}function Ayi(e,t){return Syi.t(e,t)}$wo().catch(()=>{});var{version:Fwo}=Tyi,Oyi="@sap-ux/fiori-mcp-server",Pyi="unknown-tool",Uwo="0a65e45d-6bf4-421d-b845-61e888c50e9e",hW=class{static _telemetryData;static _previousEventTimestamp;static _sessionId;static get telemetryData(){return this._telemetryData}static get sessionId(){return this._sessionId}static initSessionId(){this._sessionId=Vwo(),Fa.info(`Telemetry session initialized with ID: ${this._sessionId}`)}static async initTelemetrySettings(t){this._sessionId||this.initSessionId();let r={consumerModule:{name:Oyi,version:Fwo},watchTelemetrySettingStore:!1,internalFeature:dmr(),resourceId:Uwo,...t};try{await smr(r)}catch(n){Fa.error(`Error initializing telemetry settings: ${n}`)}}static createTelemetryData(t,r=!1){let n=new Date().getTime();if(this._previousEventTimestamp||(r=!1,this._previousEventTimestamp=n),!this._telemetryData){let i=Ayi("telemetry.unknownOs");try{i=(0,Cyi.default)()}catch{}this._telemetryData={Platform:yT()?"SBAS":"VSCode",OperatingSystem:i,SessionId:this.sessionId}}if(r){let i={...this._telemetryData,...t};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,t),this._telemetryData}static prepareTelemetryEvent(t,r){this.markToolsEndTime();let n=r.markName?OP.getMeasurementDuration(r.markName):void 0;return{eventName:t,properties:r,measurements:n?{RequestTime:n}:{}}}static markToolStartTime(){this.createTelemetryData({markName:OP.startMark("MCP_LOADING_TIME")})}static markToolsEndTime(){this._telemetryData?.markName&&(OP.endMark(this._telemetryData.markName),OP.measure(this._telemetryData.markName))}static async sendTelemetry(t,r,n){let i=this.createTelemetryData(r)??r,a=this.prepareTelemetryEvent(t,i);await T3.getTelemetryClient().reportEvent(a,k1.NoSampling,n?{appPath:n}:void 0)}static getTelemetryName(){return Oyi}};var Nyi="2024-11-05";function jwo(e){return Rde.includes(e)?e:Rde.includes(Nyi)?Nyi:Rde[Rde.length-1]}var cxt=class{server;mcpClientName="unknown-client";mcpClientVersion="unknown-version";constructor(){this.server=new yot({name:"fiori-mcp",version:eOe,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=t=>Fa.error(`[MCP Error] ${t}`),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async setupTelemetry(){await hW.initTelemetrySettings()}setupToolHandlers(){this.server.setRequestHandler(u$e,async t=>{this.mcpClientName=t.params.clientInfo?.name||"unknown-client",this.mcpClientVersion=t.params.clientInfo?.version||"unknown-version",Fa.info(`MCP Client connected: ${this.mcpClientName} v${this.mcpClientVersion}`);let r={mcpClientName:this.mcpClientName,mcpClientVersion:this.mcpClientVersion};return await hW.sendTelemetry(dQr,r),{protocolVersion:jwo(t.params.protocolVersion),capabilities:{tools:{}},serverInfo:{name:"fiori-mcp",version:eOe},instructions:`You are connected to the SAP Fiori MCP server. Always call tools/list at the start of every session to discover all available tools \u2014 never assume which tools exist.
|
|
2643
|
+
`))}let r={name:hMe.TELEMETRY_SETTINGS_INIT_FAILED,properties:t,measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&VDt.trackEvent(r)},egi=(e,t)=>{let r={name:hMe.DISABLE_TELEMETRY,properties:{disableTelemetry:`${!e}`,...t},measurements:{}};process.env.SAP_UX_FIORI_TOOLS_DISABLE_TELEMETRY!=="true"&&VDt.trackEvent(r)};import Uxo from"node:os";import jxo from"node:path";import Bxo from"node:fs";var qxo={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"},Gxo=["sap.ux.annotation.lsp.enableTelemetry","sap.ux.applicationModeler.enableTelemetry","sap.ux.help.enableTelemetry","sap.ux.serviceModeler.enableTelemetry"],Hxo=e=>{let t=process.platform,r=e[t];if(yT()&&(r=e.theia),!r)return null;let n=Uxo.homedir();return jxo.join(n,r)};async function zxo(e){let t;try{t=await e.read(new qne)}catch{}if(t)$1.telemetryEnabled=t.enableTelemetry;else{let r=Hxo(qxo);if(!r)await FDt(!0);else{let n;try{n=await Bxo.promises.readFile(r,"utf-8");let i=JSON.parse(n),s=Gxo.map(c=>i[c]??!0).reduce((c,l)=>c&&l,!0);await FDt(s)}catch{await FDt(!0)}}}}function Yxo(e){i0t(o_e.TelemetrySetting,()=>{e.read(new qne).then(t=>{t&&($1.telemetryEnabled=t.enableTelemetry)}).catch(()=>{})})}var smr=async e=>{try{$1.consumerModuleName=e.consumerModule.name,$1.consumerModuleVersion=e.consumerModule.version,$Dt.internalFeature=e.internalFeature??!1,e.resourceId&&($1.azureInstrumentationKey=e.resourceId);let t=await l8e({entityName:"telemetrySetting"});await zxo(t),e.watchTelemetrySettingStore&&Yxo(t)}catch(t){Zmi(t)}};async function FDt(e){try{let r=await l8e({entityName:"telemetrySetting"}),n=new s8e({enableTelemetry:e});await r.write(n),$1.telemetryEnabled=e}catch{}let t=await amr();egi(e,t)}var T3=class e{static clientMap=new Map;static getTelemetryClient(){return e.getTelemetryClientByClass(oZe)}static getTelemetryClientByClass(t){let r=e.clientMap.get(t.name);if(r)return r;let n=t;return r=new n($1.azureInstrumentationKey,$1.consumerModuleName,$1.consumerModuleVersion),e.clientMap.set(t.name,r),r}};var b3;(function(e){e.START_MARK="START_MARK",e.END_MARK="END_MARK",e.MEASUREMENT="MEASUREMENT"})(b3||(b3={}));var UDt=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 cZe=class{startTime;name;type;getStartTime(){return this.startTime}constructor(t,r,n){this.startTime=n,this.name=t,this.startTime=n,this.type=r}},jDt=class extends cZe{startTime;duration;constructor(t,r,n){super(t,b3.MEASUREMENT,r),this.startTime=r,this.duration=n,this.duration=n}getDurationTime(){return this.duration}};import{performance as Kxo}from"node:perf_hooks";var Wxo=()=>Kxo.now(),OP=class e extends UDt{static initTiming;static now=Wxo;static entries=[];static initialize(){e.initTiming=e.now()}static mark(t,r,n){let i=new cZe(t,r,n);e.entries.push(i)}static startMark(t){let r=e.now(),n=t+r;return e.mark(n,b3.START_MARK,r),n}static endMark(t){let r=e.now();e.mark(t,b3.END_MARK,r)}static measure(t){let r=e.getEntriesByNameType(t,b3.START_MARK).slice(-1)[0],n=e.getEntriesByNameType(t,b3.END_MARK).slice(-1)[0];if(!r&&!n)throw new Error(`Failed to execute 'measure': mark '${t}' doesn't exist.`);if(!r||!n){let l=r?b3.END_MARK:b3.START_MARK;throw new Error(`Failed to execute 'measure': mark '${t}'of type '${l}' doesn't exist.`)}let i=r.getStartTime(),s=n.getStartTime()-i,c=new jDt(`${t}`,e.now(),s);e.entries.push(c)}static getEntries(){return e.entries}static getEntriesByName(t){return e.entries.filter(r=>r.name===t)}static getEntriesByNameType(t,r){return e.entries.filter(n=>n.name===t&&n.type===r)}static getEntriesByType(t){return e.entries.filter(r=>r.type===t)}static getMeasurementDuration(t){return e.getEntriesByNameType(t,b3.MEASUREMENT).slice(-1)[0].getDurationTime()}static clearEntries(){e.entries=[]}};OP.initialize();var Xxo=(e,t)=>new Error(`Wrong path for '${e}' field is specified in instructions with index - ${t}`),Qxo=(e,t,r,n)=>{let i=t.split("/"),a=e,s=0;for(;s<i.length;){if(a=a[i[s]],a===void 0)throw Xxo(r,n);s++}return a},tgi=(e,t)=>{let r={},n={},i=null;t.paramIndex!==void 0&&(i=e[t.paramIndex]);let a=t.key?t.key:"data",s="";return typeof t.value=="string"?s=t.value:t.value!==void 0&&t.paramIndex!==void 0?s=Qxo(i,t.value.path,"val",t.paramIndex):s=i,typeof s=="number"&&!Number.isNaN(s)?n[a]=s:r[a]=s,[r,n]},cmr=(e,t)=>{let r,n,i={},a={};if(Array.isArray(t))for(let s of t)[r,n]=tgi(e,s),i={...i,...r},a={...a,...n};else[i,a]=tgi(e,t);return[i,a]};var rgi=(e,t,r,n)=>(...i)=>{let a=t.apply(e,i);return T3.getTelemetryClient().report(r,{},{},n),a},ngi=(e,t,r,n)=>async(...i)=>{let a=await t.apply(e,i);return T3.getTelemetryClient().report(r,{},{},n),a},igi=(e,t,r,n)=>(...i)=>{let a=OP.startMark("mark"),s=t.apply(e,i);OP.endMark(a),OP.measure(a);let c=OP.getMeasurementDuration(a);return T3.getTelemetryClient().report(r,{},{ms:c},n),s},agi=(e,t,r,n)=>async(...i)=>{let a=OP.startMark("mark"),s=await t.apply(e,i);OP.endMark(a),OP.measure(a);let c=OP.getMeasurementDuration(a);return T3.getTelemetryClient().report(r,{},{ms:c},n),s},ogi=(e,t,r,n,i)=>(...a)=>{let s=t.apply(e,a),[c,l]=cmr(a,i);return T3.getTelemetryClient().report(r,c,l,n),s},sgi=(e,t,r,n,i)=>async(...a)=>{let s=await t.apply(e,a),[c,l]=cmr(a,i);return T3.getTelemetryClient().report(r,c,l,n),s};var KJ;(function(e){e.NOTIFICATION="notify",e.DURATION="duration",e.CAPTURE_PARAM="captureParam"})(KJ||(KJ={}));var BDt=new Map;BDt.set(KJ.NOTIFICATION,rgi);BDt.set(KJ.DURATION,igi);BDt.set(KJ.CAPTURE_PARAM,ogi);var qDt=new Map;qDt.set(KJ.NOTIFICATION,ngi);qDt.set(KJ.DURATION,agi);qDt.set(KJ.CAPTURE_PARAM,sgi);var lmr={AnnotationModeler:"sap.ux.annotationModeler",AppGenerator:"sap.ux.appGenerator",ApplicationModeler:"sap.ux.applicationModeler",Help:"sap.ux.help",ServiceModeler:"sap.ux.serviceModeler",Internal:"sap.ux.internal"},umr={"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},GDt="testBetaFeatures",pmr="sap.ux.applicationModeler.enableExperimentalFeatures";import{createRequire as Zxo}from"node:module";var e1o=Zxo(import.meta.url);function cgi(){try{return e1o("vscode")}catch{return}}var t1o=cgi(),HDt=class e{static get vscode(){return t1o}static getFeatureToggle(t){let r,n=e.vscode;if((t.includes(GDt)||t===pmr)&&n){let a=t.slice(0,t.lastIndexOf(".")),s=t.slice(t.lastIndexOf(".")+1,t.length);r=n.workspace.getConfiguration(a)?.get(s)}else r=!1;return process.env.TOOLSUITE_FEATURES&&(r=process.env.TOOLSUITE_FEATURES.split(",").includes(t)?!0:r),umr[t]&&(umr[t]===r?r=!0:r=!1),{feature:t,isEnabled:r===!0?r:!1}}static getAllFeatureToggles(){let t=[],r=e.vscode;if(r)Object.keys(lmr).forEach(n=>{let i=`${lmr[n]}.${GDt}`,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};t.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};t.push(a)}}return t}};function dmr(){let e="sap.ux.internal.enableInternalFeatures",t=!1,r=HDt.vscode;return r&&(t=(r.workspace?r.workspace.getConfiguration().get(e):!1)??!1),process.env.TOOLSUITE_INTERNAL&&process.env.TOOLSUITE_INTERNAL==="true"&&(t=!0),t}var Cyi=Dn(_yi(),1);import{randomUUID as Vwo}from"node:crypto";var Mwo=["@sap-ux","fiori-mcp-server"].join("/");var Lwo="1.5.1",Tyi={name:Mwo,version:Lwo};var byi={telemetry:{unknownOs:"Unknown"}};var Amr="fiori-mcp-server",Syi=hv.createInstance();async function $wo(){await Syi.init({resources:{en:{[Amr]:byi}},lng:"en",fallbackLng:"en",defaultNS:Amr,ns:[Amr],showSupportNotice:!1})}function Ayi(e,t){return Syi.t(e,t)}$wo().catch(()=>{});var{version:Fwo}=Tyi,Oyi="@sap-ux/fiori-mcp-server",Pyi="unknown-tool",Uwo="0a65e45d-6bf4-421d-b845-61e888c50e9e",hW=class{static _telemetryData;static _previousEventTimestamp;static _sessionId;static get telemetryData(){return this._telemetryData}static get sessionId(){return this._sessionId}static initSessionId(){this._sessionId=Vwo(),Fa.info(`Telemetry session initialized with ID: ${this._sessionId}`)}static async initTelemetrySettings(t){this._sessionId||this.initSessionId();let r={consumerModule:{name:Oyi,version:Fwo},watchTelemetrySettingStore:!1,internalFeature:dmr(),resourceId:Uwo,...t};try{await smr(r)}catch(n){Fa.error(`Error initializing telemetry settings: ${n}`)}}static createTelemetryData(t,r=!1){let n=new Date().getTime();if(this._previousEventTimestamp||(r=!1,this._previousEventTimestamp=n),!this._telemetryData){let i=Ayi("telemetry.unknownOs");try{i=(0,Cyi.default)()}catch{}this._telemetryData={Platform:yT()?"SBAS":"VSCode",OperatingSystem:i,SessionId:this.sessionId}}if(r){let i={...this._telemetryData,...t};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,t),this._telemetryData}static prepareTelemetryEvent(t,r){this.markToolsEndTime();let n=r.markName?OP.getMeasurementDuration(r.markName):void 0;return{eventName:t,properties:r,measurements:n?{RequestTime:n}:{}}}static markToolStartTime(){this.createTelemetryData({markName:OP.startMark("MCP_LOADING_TIME")})}static markToolsEndTime(){this._telemetryData?.markName&&(OP.endMark(this._telemetryData.markName),OP.measure(this._telemetryData.markName))}static async sendTelemetry(t,r,n){let i=this.createTelemetryData(r)??r,a=this.prepareTelemetryEvent(t,i);await T3.getTelemetryClient().reportEvent(a,k1.NoSampling,n?{appPath:n}:void 0)}static getTelemetryName(){return Oyi}};var Nyi="2024-11-05";function jwo(e){return Rde.includes(e)?e:Rde.includes(Nyi)?Nyi:Rde[Rde.length-1]}var cxt=class{server;mcpClientName="unknown-client";mcpClientVersion="unknown-version";constructor(){this.server=new yot({name:"fiori-mcp",version:eOe,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=t=>Fa.error(`[MCP Error] ${t}`),process.on("SIGINT",async()=>{await this.server.close(),process.exit(0)})}async setupTelemetry(){await hW.initTelemetrySettings()}setupToolHandlers(){this.server.setRequestHandler(u$e,async t=>{this.mcpClientName=t.params.clientInfo?.name||"unknown-client",this.mcpClientVersion=t.params.clientInfo?.version||"unknown-version",Fa.info(`MCP Client connected: ${this.mcpClientName} v${this.mcpClientVersion}`);let r={mcpClientName:this.mcpClientName,mcpClientVersion:this.mcpClientVersion};return await hW.sendTelemetry(dQr,r),{protocolVersion:jwo(t.params.protocolVersion),capabilities:{tools:{}},serverInfo:{name:"fiori-mcp",version:eOe},instructions:`You are connected to the SAP Fiori MCP server. Always call tools/list at the start of every session to discover all available tools \u2014 never assume which tools exist.
|
|
2644
2644
|
|
|
2645
2645
|
## Modifying an existing SAP Fiori application (3-step workflow)
|
|
2646
2646
|
|
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.5.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"mcpName": "io.github.SAP/fiori-mcp-server",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"SAP Fiori tools",
|
|
@@ -58,20 +58,20 @@
|
|
|
58
58
|
"ts-node": "10.9.2",
|
|
59
59
|
"zod": "4.3.6",
|
|
60
60
|
"@sap-ux/axios-extension": "2.0.3",
|
|
61
|
-
"@sap-ux/btp-utils": "2.0.2",
|
|
62
61
|
"@sap-ux/feature-toggle": "1.0.2",
|
|
63
62
|
"@sap-ux/fiori-annotation-api": "1.0.8",
|
|
64
63
|
"@sap-ux/fiori-docs-embeddings": "1.2.3",
|
|
64
|
+
"@sap-ux/btp-utils": "2.0.2",
|
|
65
65
|
"@sap-ux/i18n": "1.0.1",
|
|
66
66
|
"@sap-ux/logger": "1.0.1",
|
|
67
|
-
"@sap-ux/nodejs-utils": "1.0.3",
|
|
68
67
|
"@sap-ux/odata-annotation-core": "1.0.1",
|
|
69
68
|
"@sap-ux/odata-entity-model": "1.0.1",
|
|
70
|
-
"@sap-ux/
|
|
69
|
+
"@sap-ux/odata-annotation-core-types": "1.0.1",
|
|
71
70
|
"@sap-ux/store": "2.0.1",
|
|
71
|
+
"@sap-ux/project-access": "2.1.2",
|
|
72
|
+
"@sap-ux/nodejs-utils": "1.0.3",
|
|
72
73
|
"@sap-ux/telemetry": "1.0.9",
|
|
73
|
-
"@sap-ux/text-document-utils": "1.0.1"
|
|
74
|
-
"@sap-ux/odata-annotation-core-types": "1.0.1"
|
|
74
|
+
"@sap-ux/text-document-utils": "1.0.1"
|
|
75
75
|
},
|
|
76
76
|
"engines": {
|
|
77
77
|
"node": ">=22.x"
|