@equinor/roma-nx-plugin 6.2.0-rc.1 → 6.3.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/CHANGELOG.md +18 -0
- package/migrations.json +146 -0
- package/package.json +17 -17
- package/src/executors/publish/manifest-model.d.ts +2 -0
- package/src/executors/publish/publish-script.js +1 -1
- package/src/executors/publish/publish-script.js.map +1 -1
- package/src/executors/serve/server.js +10 -3
- package/src/executors/serve/server.js.map +1 -1
- package/src/executors/utils/csp/data/generated-csp.json +1 -1
- package/src/generators/app/data/generated-dependencies.json +17 -17
- package/src/generators/skill/files/creating-dashboard-descriptors/SKILL.md +149 -0
- package/src/generators/skill/files/roma-app-development/SKILL.md +34 -1
- package/src/generators/skill/files/roma-app-development/generators.md +2 -1
- package/src/generators/skill/files/roma-dashboard-mcp/SKILL.md +74 -0
- package/src/generators/skill/files/roma-dashboard-mcp/scripts/roma-mcp-bridge.mjs +227 -0
- package/src/migrations/swap-eds-to-roma-ui/swap-eds-to-roma-ui.d.ts +10 -0
- package/src/migrations/swap-eds-to-roma-ui/swap-eds-to-roma-ui.js +86 -0
- package/src/migrations/swap-eds-to-roma-ui/swap-eds-to-roma-ui.js.map +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
# [6.3.0](https://github.com/equinor/tops-roma/compare/roma-6.2.0...roma-6.3.0) (2026-11-24)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **ROMA-327:** dashboard time range follows the saved range; gantts fetch around their window ([#639](https://github.com/equinor/tops-roma/issues/639)) ([0662f35](https://github.com/equinor/tops-roma/commit/0662f3551ecf8767a1517e2430dfb179fd052e60))
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **ROMA-298:** opt-in category grouping in the sidebar ([#640](https://github.com/equinor/tops-roma/issues/640)) ([030f9a2](https://github.com/equinor/tops-roma/commit/030f9a25608e836ac15aaebbf2dfb615da8e8fd4))
|
|
14
|
+
* **ROMA-333:** Profile sidesheet ([#557](https://github.com/equinor/tops-roma/issues/557)) ([e9ab05e](https://github.com/equinor/tops-roma/commit/e9ab05ebddffad2cb0a1fb1ab595583e106e3829))
|
|
15
|
+
* **ROMA-369:** dashboard phase 3 LLM authoring tools ([#589](https://github.com/equinor/tops-roma/issues/589)) ([0893a1c](https://github.com/equinor/tops-roma/commit/0893a1cdbd32cdbffaa8d22e762ba53baf8e3a4e)), closes [#597](https://github.com/equinor/tops-roma/issues/597)
|
|
16
|
+
* **roma-plugin:** migrate apps to the Fusion 9 and Roma 6.2 package set ([16c62ab](https://github.com/equinor/tops-roma/commit/16c62aba898aae2af2f43d58f75f6e406a4b3f39))
|
|
17
|
+
* **roma-plugin:** roma-dashboard-mcp skill with Azure CLI token bridge ([#608](https://github.com/equinor/tops-roma/issues/608)) ([2212795](https://github.com/equinor/tops-roma/commit/22127957cb6ccf48ef02c6669c382876dbcc9032))
|
|
18
|
+
|
|
19
|
+
# [6.2.0](https://github.com/equinor/tops-roma/compare/roma-6.2.0-rc.1...roma-6.2.0) (2026-07-03)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
5
23
|
# [6.2.0-rc.1](https://github.com/equinor/tops-roma/compare/roma-6.2.0-rc.0...roma-6.2.0-rc.1) (2026-06-26)
|
|
6
24
|
|
|
7
25
|
|
package/migrations.json
CHANGED
|
@@ -34,6 +34,11 @@
|
|
|
34
34
|
"version": "6.2.0-beta.0",
|
|
35
35
|
"description": "Migrate apps to fusion-framework-react-router v2 Router component",
|
|
36
36
|
"implementation": "./src/migrations/migrate-fusion-router/migrate-fusion-router"
|
|
37
|
+
},
|
|
38
|
+
"swap-eds-to-roma-ui": {
|
|
39
|
+
"version": "6.3.0-beta.0",
|
|
40
|
+
"description": "Swap @equinor/eds-core-react imports and dependency for @equinor/roma-ui",
|
|
41
|
+
"implementation": "./src/migrations/swap-eds-to-roma-ui/swap-eds-to-roma-ui"
|
|
37
42
|
}
|
|
38
43
|
},
|
|
39
44
|
"packageJsonUpdates": {
|
|
@@ -599,6 +604,147 @@
|
|
|
599
604
|
"@equinor/fusion-framework-react-module": { "version": "4.0.0" },
|
|
600
605
|
"@equinor/fusion-framework-react-module-http": { "version": "11.0.0" }
|
|
601
606
|
}
|
|
607
|
+
},
|
|
608
|
+
"upgrade-fusion-6-3": {
|
|
609
|
+
"version": "6.3.0",
|
|
610
|
+
"packages": {
|
|
611
|
+
"@equinor/eds-core-react": {
|
|
612
|
+
"version": "^2.6.4",
|
|
613
|
+
"alwaysAddToPackageJson": false
|
|
614
|
+
},
|
|
615
|
+
"@equinor/eds-icons": {
|
|
616
|
+
"version": "^1.6.0",
|
|
617
|
+
"alwaysAddToPackageJson": false
|
|
618
|
+
},
|
|
619
|
+
"@equinor/eds-tokens": {
|
|
620
|
+
"version": "^2.3.2",
|
|
621
|
+
"alwaysAddToPackageJson": false
|
|
622
|
+
},
|
|
623
|
+
"@equinor/fusion-framework": {
|
|
624
|
+
"version": "^9.1.0",
|
|
625
|
+
"alwaysAddToPackageJson": false
|
|
626
|
+
},
|
|
627
|
+
"@equinor/fusion-framework-app": {
|
|
628
|
+
"version": "^13.3.0",
|
|
629
|
+
"alwaysAddToPackageJson": false
|
|
630
|
+
},
|
|
631
|
+
"@equinor/fusion-framework-module": {
|
|
632
|
+
"version": "^6.2.0",
|
|
633
|
+
"alwaysAddToPackageJson": false
|
|
634
|
+
},
|
|
635
|
+
"@equinor/fusion-framework-module-app": {
|
|
636
|
+
"version": "^8.3.0",
|
|
637
|
+
"alwaysAddToPackageJson": false
|
|
638
|
+
},
|
|
639
|
+
"@equinor/fusion-framework-module-context": {
|
|
640
|
+
"version": "^9.1.0",
|
|
641
|
+
"alwaysAddToPackageJson": false
|
|
642
|
+
},
|
|
643
|
+
"@equinor/fusion-framework-module-event": {
|
|
644
|
+
"version": "^6.1.4",
|
|
645
|
+
"alwaysAddToPackageJson": false
|
|
646
|
+
},
|
|
647
|
+
"@equinor/fusion-framework-module-feature-flag": {
|
|
648
|
+
"version": "^2.2.0",
|
|
649
|
+
"alwaysAddToPackageJson": false
|
|
650
|
+
},
|
|
651
|
+
"@equinor/fusion-framework-module-http": {
|
|
652
|
+
"version": "^8.1.5",
|
|
653
|
+
"alwaysAddToPackageJson": false
|
|
654
|
+
},
|
|
655
|
+
"@equinor/fusion-framework-module-msal": {
|
|
656
|
+
"version": "^12.1.0",
|
|
657
|
+
"alwaysAddToPackageJson": false
|
|
658
|
+
},
|
|
659
|
+
"@equinor/fusion-framework-module-navigation": {
|
|
660
|
+
"version": "^8.0.0",
|
|
661
|
+
"alwaysAddToPackageJson": false
|
|
662
|
+
},
|
|
663
|
+
"@equinor/fusion-framework-module-service-discovery": {
|
|
664
|
+
"version": "^10.3.0",
|
|
665
|
+
"alwaysAddToPackageJson": false
|
|
666
|
+
},
|
|
667
|
+
"@equinor/fusion-framework-react": {
|
|
668
|
+
"version": "^9.0.5",
|
|
669
|
+
"alwaysAddToPackageJson": false
|
|
670
|
+
},
|
|
671
|
+
"@equinor/fusion-framework-react-app": {
|
|
672
|
+
"version": "^14.3.9",
|
|
673
|
+
"alwaysAddToPackageJson": false
|
|
674
|
+
},
|
|
675
|
+
"@equinor/fusion-framework-react-module": {
|
|
676
|
+
"version": "^4.0.7",
|
|
677
|
+
"alwaysAddToPackageJson": false
|
|
678
|
+
},
|
|
679
|
+
"@equinor/fusion-framework-react-module-context": {
|
|
680
|
+
"version": "^7.0.8",
|
|
681
|
+
"alwaysAddToPackageJson": false
|
|
682
|
+
},
|
|
683
|
+
"@equinor/fusion-framework-react-module-http": {
|
|
684
|
+
"version": "^12.0.4",
|
|
685
|
+
"alwaysAddToPackageJson": false
|
|
686
|
+
},
|
|
687
|
+
"@equinor/fusion-framework-react-router": {
|
|
688
|
+
"version": "^2.4.8",
|
|
689
|
+
"alwaysAddToPackageJson": false
|
|
690
|
+
},
|
|
691
|
+
"@equinor/roma-dynatrace-module": {
|
|
692
|
+
"version": "^0.2.0",
|
|
693
|
+
"alwaysAddToPackageJson": false
|
|
694
|
+
},
|
|
695
|
+
"@equinor/roma-framework": {
|
|
696
|
+
"version": "^6.2.0",
|
|
697
|
+
"alwaysAddToPackageJson": false
|
|
698
|
+
},
|
|
699
|
+
"@equinor/roma-page-title-module": {
|
|
700
|
+
"version": "^1.2.0",
|
|
701
|
+
"alwaysAddToPackageJson": false
|
|
702
|
+
},
|
|
703
|
+
"@equinor/roma-page-title-module-react": {
|
|
704
|
+
"version": "^1.2.0",
|
|
705
|
+
"alwaysAddToPackageJson": false
|
|
706
|
+
},
|
|
707
|
+
"@equinor/roma-query-module": {
|
|
708
|
+
"version": "^0.2.0",
|
|
709
|
+
"alwaysAddToPackageJson": false
|
|
710
|
+
},
|
|
711
|
+
"@equinor/roma-settings-module": {
|
|
712
|
+
"version": "^0.2.0",
|
|
713
|
+
"alwaysAddToPackageJson": false
|
|
714
|
+
},
|
|
715
|
+
"@equinor/roma-sse-module": {
|
|
716
|
+
"version": "^1.2.0",
|
|
717
|
+
"alwaysAddToPackageJson": false
|
|
718
|
+
},
|
|
719
|
+
"@equinor/roma-sse-module-react": {
|
|
720
|
+
"version": "^1.2.0",
|
|
721
|
+
"alwaysAddToPackageJson": false
|
|
722
|
+
},
|
|
723
|
+
"@equinor/roma-ui": {
|
|
724
|
+
"version": "^1.4.0",
|
|
725
|
+
"alwaysAddToPackageJson": false
|
|
726
|
+
},
|
|
727
|
+
"@tanstack/react-query": {
|
|
728
|
+
"version": "5.107.1",
|
|
729
|
+
"alwaysAddToPackageJson": false
|
|
730
|
+
},
|
|
731
|
+
"@tanstack/react-query-devtools": {
|
|
732
|
+
"version": "5.107.1",
|
|
733
|
+
"alwaysAddToPackageJson": false
|
|
734
|
+
},
|
|
735
|
+
"@tanstack/react-query-persist-client": {
|
|
736
|
+
"version": "5.107.1",
|
|
737
|
+
"alwaysAddToPackageJson": false
|
|
738
|
+
},
|
|
739
|
+
"react": {
|
|
740
|
+
"version": "^19.3.1",
|
|
741
|
+
"alwaysAddToPackageJson": false
|
|
742
|
+
},
|
|
743
|
+
"react-dom": {
|
|
744
|
+
"version": "^19.3.1",
|
|
745
|
+
"alwaysAddToPackageJson": false
|
|
746
|
+
}
|
|
747
|
+
}
|
|
602
748
|
}
|
|
603
749
|
}
|
|
604
750
|
}
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/roma-nx-plugin",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.3.0",
|
|
5
5
|
"repository": "https://github.com/equinor/tops-roma",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@azure/identity": "^4.
|
|
8
|
-
"@equinor/fusion-framework-module-app": "8.0
|
|
9
|
-
"@equinor/roma-framework": "6.
|
|
10
|
-
"@nx/devkit": "^22.
|
|
11
|
-
"@nx/react": "^22.
|
|
12
|
-
"@vitejs/plugin-react": "^6.0
|
|
13
|
-
"cypress": "^15.
|
|
14
|
-
"esbuild": "0.27.
|
|
15
|
-
"express": "^4.
|
|
7
|
+
"@azure/identity": "^4.14.1",
|
|
8
|
+
"@equinor/fusion-framework-module-app": "8.3.0",
|
|
9
|
+
"@equinor/roma-framework": "6.2.0",
|
|
10
|
+
"@nx/devkit": "^22.7.12",
|
|
11
|
+
"@nx/react": "^22.7.12",
|
|
12
|
+
"@vitejs/plugin-react": "^6.3.0",
|
|
13
|
+
"cypress": "^15.21.2",
|
|
14
|
+
"esbuild": "0.27.7",
|
|
15
|
+
"express": "^4.22.3",
|
|
16
16
|
"get-port": "^7.2.0",
|
|
17
|
-
"http-proxy-middleware": "^3.0.
|
|
17
|
+
"http-proxy-middleware": "^3.0.10",
|
|
18
18
|
"open": "^10.2.0",
|
|
19
|
-
"rollup": "^4.
|
|
20
|
-
"semver": "6.3.
|
|
19
|
+
"rollup": "^4.68.3",
|
|
20
|
+
"semver": "6.3.2",
|
|
21
21
|
"ts-morph": "^25.0.1",
|
|
22
|
-
"tslib": "^2.
|
|
23
|
-
"vite": "^8.
|
|
24
|
-
"vite-plugin-checker": "^0.14.
|
|
25
|
-
"vite-plugin-environment": "^1.1.
|
|
22
|
+
"tslib": "^2.9.1",
|
|
23
|
+
"vite": "^8.3.8",
|
|
24
|
+
"vite-plugin-checker": "^0.14.5",
|
|
25
|
+
"vite-plugin-environment": "^1.1.4"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"@nx/devkit": "^22.0.3",
|
|
@@ -300,7 +300,7 @@ async function uploadAssets(appName, pathToOutput, config) {
|
|
|
300
300
|
const fd = new FormData();
|
|
301
301
|
for (const relativePath of assetFilenames) {
|
|
302
302
|
const fileBytes = await (0, promises_1.readFile)((0, node_path_1.join)(pathToOutput, relativePath));
|
|
303
|
-
fd.append('files', new Blob([fileBytes.buffer]), relativePath);
|
|
303
|
+
fd.append('files', new Blob([fileBytes.buffer]), (0, node_path_1.basename)(relativePath));
|
|
304
304
|
}
|
|
305
305
|
console.log(`Uploading ${assetFilenames.length} asset(s) for ${appName}: ${assetFilenames.join(', ')}`);
|
|
306
306
|
const token = await authenticate(config);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish-script.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/publish-script.ts"],"names":[],"mappings":";;;AAyKA,oCAoBC;AA7LD,+CAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"publish-script.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/publish/publish-script.ts"],"names":[],"mappings":";;;AAyKA,oCAoBC;AA7LD,+CAAqD;AACrD,yCAAqD;AACrD,8CAAyD;AAGzD,yCAA2C;AAC3C,yCAAsC;AAEtC,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,0BAAc,CAAC,CAA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I,EAAE,CAAC;QAC7B,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACnB,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -5,7 +5,6 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
const read_manifest_1 = require("../utils/read-manifest");
|
|
8
|
-
const express = require('express');
|
|
9
8
|
const open_1 = tslib_1.__importDefault(require("open"));
|
|
10
9
|
const get_port_1 = tslib_1.__importStar(require("get-port"));
|
|
11
10
|
const vite_1 = require("vite");
|
|
@@ -15,6 +14,7 @@ const http_proxy_middleware_1 = require("http-proxy-middleware");
|
|
|
15
14
|
const create_vite_config_1 = require("../create-vite-config");
|
|
16
15
|
const get_vite_config_1 = require("../utils/get-vite-config");
|
|
17
16
|
const load_services_1 = require("../utils/load-services");
|
|
17
|
+
const express = require('express');
|
|
18
18
|
const createProxyMiddleware = (options) => {
|
|
19
19
|
var _a;
|
|
20
20
|
console.log(`[ROMA] Proxying ${(_a = options.name) !== null && _a !== void 0 ? _a : options.pathFilter} to ${options.target}`);
|
|
@@ -63,7 +63,9 @@ async function createServer({ port: requestedPort = 3000, devPortal = 'node_modu
|
|
|
63
63
|
// Apply vite-middleware to the express app
|
|
64
64
|
app.use(vite.middlewares);
|
|
65
65
|
app.use(createProxyMiddleware({
|
|
66
|
-
target: portalTarget
|
|
66
|
+
target: !portalTarget.includes('localhost')
|
|
67
|
+
? portalTarget
|
|
68
|
+
: 'https://romadev.equinor.com',
|
|
67
69
|
changeOrigin: true,
|
|
68
70
|
pathFilter: '/apim',
|
|
69
71
|
}));
|
|
@@ -88,6 +90,9 @@ async function createServer({ port: requestedPort = 3000, devPortal = 'node_modu
|
|
|
88
90
|
if (s.uri.includes(portalTarget)) {
|
|
89
91
|
s.uri = s.uri.replace(portalTarget, `http://localhost:${port}`);
|
|
90
92
|
}
|
|
93
|
+
else if (portalTarget.includes('localhost')) {
|
|
94
|
+
s.uri = s.uri.replace(`https://romadev.equinor.com`, `http://localhost:${port}`);
|
|
95
|
+
}
|
|
91
96
|
});
|
|
92
97
|
return JSON.stringify(response);
|
|
93
98
|
}),
|
|
@@ -173,7 +178,9 @@ async function createServer({ port: requestedPort = 3000, devPortal = 'node_modu
|
|
|
173
178
|
changeOrigin: true,
|
|
174
179
|
}));
|
|
175
180
|
app.use(createProxyMiddleware({
|
|
176
|
-
target: portalTarget
|
|
181
|
+
target: !portalTarget.includes('localhost')
|
|
182
|
+
? portalTarget
|
|
183
|
+
: 'https://romadev.equinor.com',
|
|
177
184
|
changeOrigin: true,
|
|
178
185
|
pathFilter: '/cdn',
|
|
179
186
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/serve/server.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/executors/serve/server.ts"],"names":[],"mappings":";;AAsCA,oCA8QC;;AApTD,6DAA6D;AAC7D,aAAa;AACb,0DAAsD;AAEtD,wDAAwB;AACxB,6DAAgD;AAChD,+BAIc;AACd,+BAAqC;AACrC,qCAAuC;AACvC,iEAI+B;AAC/B,8DAA6D;AAE7D,8DAAyD;AACzD,0DAAsD;AAGtD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,MAAM,qBAAqB,GAAG,CAI5B,OAAgD,EAChD,EAAE;;IACF,OAAO,CAAC,GAAG,CACT,mBAAmB,MAAA,OAAO,CAAC,IAAI,mCAAI,OAAO,CAAC,UAAU,OAAO,OAAO,CAAC,MAAM,EAAE,CAC7E,CAAC;IACF,OAAO,IAAA,6CAAsB,EAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAC;AAEK,KAAK,UAAU,YAAY,CAChC,EACE,IAAI,EAAE,aAAa,GAAG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AAG,EAAE,KAAK,EAAE,GAAY,EAAE,GAAG,EAAE,EAAE;QACvC,MAAM,OAAO,GAAG,IAAA,sBAAY,EAAC,IAAA,WAAI,EAAC,aAAa,GAAG,aAAa,CAAC,EAAE,OAAO,CAAC,CAAC;QAC3E,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC7D,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,2BAA2B;QAC3B,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACpB,OAAO,CAAC,GAAG,CAAC,6CAA6C,IAAI,SAAS,CAAC,CAAC;YACxE,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,CAAC,GAAG,CACT,uDAAuD,IAAI,SAAS,WAAW,SAAS,CACzF,CAAC;gBACF,IAAA,cAAI,EAAC,oBAAoB,IAAI,SAAS,WAAW,EAAE,CAAC,CAAC;YACvD,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CACT,oDAAoD,IAAI,SAAS,WAAW,SAAS,CACtF,CAAC;YACJ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,OAAO,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_comment": "Generated by plugins/roma/scripts/generate-csp.mjs from apps/workbench/public/staticwebapp.config.json. Do not edit by hand; run `nx run roma:generate-csp` to refresh.",
|
|
3
3
|
"source": "apps/workbench/public/staticwebapp.config.json",
|
|
4
|
-
"contentSecurityPolicy": "default-src 'self'; script-src 'self' https://unpkg.com; style-src 'self' 'unsafe-inline' https://cdn.eds.equinor.com https://romadev.equinor.com https://fonts.googleapis.com; font-src 'self' https://cdn.eds.equinor.com https://romadev.equinor.com https://fonts.gstatic.com; connect-src 'self' https:; img-src 'self' data: https:; frame-src https://login.microsoftonline.com; frame-ancestors 'none'; object-src 'none'; base-uri 'self'; form-action 'self';"
|
|
4
|
+
"contentSecurityPolicy": "default-src 'self'; script-src 'self' https://unpkg.com https://www.unpkg.com; worker-src 'self'; style-src 'self' 'unsafe-inline' https://cdn.eds.equinor.com https://romadev.equinor.com https://fonts.googleapis.com; font-src 'self' https://cdn.eds.equinor.com https://romadev.equinor.com https://fonts.gstatic.com; connect-src 'self' https: data:; img-src 'self' data: https:; frame-src https://login.microsoftonline.com; frame-ancestors 'none'; object-src 'none'; base-uri 'self'; form-action 'self';"
|
|
5
5
|
}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
-
"_generatedAt": "2026-
|
|
2
|
+
"_generatedAt": "2026-11-24T13:29:50.250Z",
|
|
3
3
|
"_description": "Auto-generated by plugins/roma/scripts/generate-dependencies.mjs — do not edit manually.",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@equinor/roma-framework": "^6.0
|
|
6
|
-
"@equinor/fusion-framework": "^
|
|
7
|
-
"@equinor/fusion-framework-app": "^
|
|
8
|
-
"@equinor/eds-core-react": "^2.4
|
|
5
|
+
"@equinor/roma-framework": "^6.2.0",
|
|
6
|
+
"@equinor/fusion-framework": "^9.1.0",
|
|
7
|
+
"@equinor/fusion-framework-app": "^13.3.0",
|
|
8
|
+
"@equinor/eds-core-react": "^2.6.4",
|
|
9
9
|
"@equinor/eds-data-grid-react": "^1.3.0",
|
|
10
|
-
"@equinor/eds-icons": "^1.
|
|
11
|
-
"@equinor/eds-tokens": "^2.2
|
|
12
|
-
"@equinor/fusion-framework-react": "^
|
|
13
|
-
"@equinor/fusion-framework-react-
|
|
14
|
-
"@equinor/fusion-framework-react-
|
|
15
|
-
"@equinor/fusion-framework-module
|
|
16
|
-
"
|
|
17
|
-
"
|
|
10
|
+
"@equinor/eds-icons": "^1.6.0",
|
|
11
|
+
"@equinor/eds-tokens": "^2.3.2",
|
|
12
|
+
"@equinor/fusion-framework-react": "^9.0.5",
|
|
13
|
+
"@equinor/fusion-framework-react-router": "^2.4.8",
|
|
14
|
+
"@equinor/fusion-framework-react-app": "^14.3.9",
|
|
15
|
+
"@equinor/fusion-framework-react-module": "^4.0.7",
|
|
16
|
+
"@equinor/fusion-framework-module-navigation": "^8.0.0",
|
|
17
|
+
"styled-components": "^6.6.0",
|
|
18
|
+
"ajv": "^8.20.0",
|
|
18
19
|
"is-mergeable-object": "^1.1.1",
|
|
19
|
-
"@equinor/fusion-framework-module-msal": "^
|
|
20
|
-
"
|
|
21
|
-
"react": "^19.
|
|
22
|
-
"react-dom": "^19.2.4"
|
|
20
|
+
"@equinor/fusion-framework-module-msal": "^12.1.0",
|
|
21
|
+
"react": "^19.3.1",
|
|
22
|
+
"react-dom": "^19.3.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: creating-dashboard-descriptors
|
|
3
|
+
description: Use when adding or extending a Roma dashboard data source (datasource) descriptor (libs/data-engine/core/src/sources/descriptors/*.json) from an OpenAPI or Swagger spec, e.g. "create a descriptor for endpoint X", "add fields from the swagger file", or "expose this API on dashboards".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Creating dashboard descriptors from an OpenAPI spec
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
A descriptor maps one paged list endpoint to typed rows. The OpenAPI spec is the contract and
|
|
11
|
+
`roma-workbench/apps/roma-docs/docs/Features/DataSources/` is the reference. Read its
|
|
12
|
+
`DescriptorReference.md` (including "Units"), `AddingADataSource.md` and `JsonataRules.md`
|
|
13
|
+
before writing anything. The shipped descriptors are the templates to copy.
|
|
14
|
+
|
|
15
|
+
**The shared test suites and validators are the guardrails. A new source conforms to them; they
|
|
16
|
+
never bend to fit it.**
|
|
17
|
+
|
|
18
|
+
## Outside tops-roma
|
|
19
|
+
|
|
20
|
+
The guardrails live only in the tops-roma repository. If `roma-workbench/libs/data-engine/core/src/sources`
|
|
21
|
+
doesn't exist in the current workspace, still run the intake below so the user leaves with settled
|
|
22
|
+
decisions; for the service key (#5), ask the user, since the shipped descriptors aren't here.
|
|
23
|
+
Then explain that the descriptor must be written, verified and published from a tops-roma
|
|
24
|
+
checkout, and stop. Write no files, not even a draft, and publish nothing: the API accepts any JSON object,
|
|
25
|
+
so an unverified descriptor breaks dashboards at run time.
|
|
26
|
+
|
|
27
|
+
## Intake: settle five things before writing any file
|
|
28
|
+
|
|
29
|
+
Every descriptor rests on five decisions. A decision is settled only when the user's own messages state it,
|
|
30
|
+
**for that decision**. Naming the endpoint settles #1 only. "All the fields" settles the field list in #2,
|
|
31
|
+
but not the filters, roles, units or date binding. A service key settles #5 only.
|
|
32
|
+
|
|
33
|
+
For each unsettled decision, read the spec, propose an answer, and ask. Send all the questions in **one**
|
|
34
|
+
message and write no files until the user replies. If the user says "just pick defaults", that does not
|
|
35
|
+
settle anything. Send your proposals anyway, so they can confirm them with a single "yes".
|
|
36
|
+
|
|
37
|
+
| # | Decision | What to propose from the spec |
|
|
38
|
+
| --- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
39
|
+
| 1 | **Endpoint** | List each list endpoint in the spec with its method, path and paging envelope (`content`/`last`, `items`/`hasNext`, or none). Recommend one. An endpoint with no paging, or with a path parameter, can't be a source on its own; say so. |
|
|
40
|
+
| 2 | **Fields and filters** | Fields: the row properties, grouped as identifiers, people, dates, statuses and amounts. Say which you'd leave out and why (internal ids, nested arrays). Filters: the query params or body properties, apart from paging. |
|
|
41
|
+
| 3 | **Aggregation** | A descriptor has no aggregation setting of its own; widgets choose sum, count and so on. Propose each field's `role` (`measure` or `dimension`). Pair every quantity or price with its unit or currency field via `unitField`. For each repeating path, propose `multi` (`first`, `join`, `distinctJoin`) or an `expr` that sums. Name the `rowKey` and any `identity` (person) field. If a row has its own page in a Roma app, propose a `link` on the field users recognise, e.g. `"link": "/apps/deal/deal/{dealId}"` on `dealKey`. |
|
|
42
|
+
| 4 | **Global time** | List every date filter pair, e.g. departure from/to and arrival from/to. Recommend the pair to mark `globalTimeRole: 'from'`/`'to'` for the dashboard's date range, and say what that range would then mean, e.g. "voyages departing in the range". If that filter selects a parent record while each row is a child (cargos vs. their movements), also propose `globalTimeField` naming the row's own date, so rows outside the range are dropped on the client. If there is no date pair, say the source won't follow the dashboard dates. |
|
|
43
|
+
| 5 | **Roma service key** | The Fusion service key the Roma API registers for this service. Look up the `serviceKey`s used by the shipped descriptors. Propose an existing one only if it serves the same API. A new key means a host app must register a transport, which is outside this task. |
|
|
44
|
+
|
|
45
|
+
Format the message as five numbered items, in the order of the table. Each item gives your proposal and
|
|
46
|
+
then the question. Leave out any item the user has already settled.
|
|
47
|
+
|
|
48
|
+
**Red flags: you are about to skip the intake.**
|
|
49
|
+
|
|
50
|
+
- "The request clearly implies the rest."
|
|
51
|
+
- "Only one endpoint matches, so the date binding is obvious too."
|
|
52
|
+
- You have written your proposals as decisions ("Global time: bind fromDate/toDate") rather than as
|
|
53
|
+
questions.
|
|
54
|
+
|
|
55
|
+
In any of these cases, send the intake message.
|
|
56
|
+
|
|
57
|
+
## Also stop and ask when
|
|
58
|
+
|
|
59
|
+
Put these questions in the intake message, after the five numbered items. If they come up later, ask them
|
|
60
|
+
in one message and wait.
|
|
61
|
+
|
|
62
|
+
- The user hasn't provided the OpenAPI spec as a file path or URL. Ask for it first, on its own.
|
|
63
|
+
- The endpoint covers the same rows as an existing source, even if it adds a field or two. Those
|
|
64
|
+
might be better as fields on the existing source than as a new one.
|
|
65
|
+
- A shared test cannot pass for this source. Examples: there is no person-bearing field for
|
|
66
|
+
`identity`, or the page envelope isn't `content`. Ask; never add an exemption, flag or skip.
|
|
67
|
+
- You would change a convention the existing descriptors follow. For example, ids are strings via
|
|
68
|
+
`$string(id)`, so they are never thousands-grouped.
|
|
69
|
+
|
|
70
|
+
## Reading the spec
|
|
71
|
+
|
|
72
|
+
Use the spec the user gave you, whether a file path or a URL. If they didn't give one, ask for it
|
|
73
|
+
before doing anything else. Don't search the repo or the web and don't reconstruct the contract from
|
|
74
|
+
code; an older copy or a guessed shape gives wrong paths and descriptions. Once you have it, read
|
|
75
|
+
four things:
|
|
76
|
+
|
|
77
|
+
1. The path. Write it **service-relative**: drop the prefix the Fusion client adds (for example
|
|
78
|
+
`/ratscore`).
|
|
79
|
+
2. The request: query params, or the body schema.
|
|
80
|
+
3. The 200 envelope. It gives you `rows`, `hasMore`, `totalPages` and `totalRows`.
|
|
81
|
+
4. The row schema. Your field `path`s navigate it.
|
|
82
|
+
|
|
83
|
+
To follow a property, resolve `$ref`, `allOf` and array `items` step by step along the field's
|
|
84
|
+
path. A body request needs its property names vendored into a committed fixture named after the
|
|
85
|
+
request schema, e.g. `fixtures/deal-search-request.properties.json`. That way the "sends only spec
|
|
86
|
+
properties" test runs without the spec. Reuse the fixture when another endpoint takes the same body.
|
|
87
|
+
|
|
88
|
+
## Field descriptions
|
|
89
|
+
|
|
90
|
+
Every field needs a `description` of at least 20 characters. Build it like this:
|
|
91
|
+
|
|
92
|
+
1. Start from the spec description of the property at the field's `path`. For an `expr` field,
|
|
93
|
+
use the properties it reads. When the leaf property has no description, use its parent's.
|
|
94
|
+
2. Drop sentences that only matter when writing through the API: create/update rules, "read
|
|
95
|
+
only", validation errors.
|
|
96
|
+
3. Add enum values as "One of A, B or C." When there are more than about eight, give a few as
|
|
97
|
+
"e.g. A, B or C".
|
|
98
|
+
4. Append what the spec doesn't say: how Roma derives the value (summed, comma-joined, first
|
|
99
|
+
leg), whether users recognise it ("internal id; prefer Deal key"), and pitfalls ("never add
|
|
100
|
+
across units", "not unique on its own").
|
|
101
|
+
|
|
102
|
+
## Files to touch
|
|
103
|
+
|
|
104
|
+
All paths are under `roma-workbench/libs/data-engine/core/src/sources/`.
|
|
105
|
+
|
|
106
|
+
| File | Change |
|
|
107
|
+
| ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
108
|
+
| `descriptors/<id>.json` | The descriptor. Both the source and each field put `description` right after `label`. A concept that another source already exposes keeps that source's key and type, e.g. `dealId` as a string. |
|
|
109
|
+
| `fixtures/<id>.page.json` | A spec-shaped page. Every field must be non-null on at least one row. |
|
|
110
|
+
| `lib/conformance.spec.ts` | Add a `cases` entry with `page` and a `morePages` that flips `hasMore`. Add source-specific tests next to the existing ones. |
|
|
111
|
+
| `lib/field-ids.snapshot.json` | Add every field key, sorted. Never remove a key. |
|
|
112
|
+
|
|
113
|
+
When extending an existing source, also add the new field to its fixture.
|
|
114
|
+
|
|
115
|
+
Also update any `dashboards.md` table that lists per-source facts, such as the `unitField` pairs.
|
|
116
|
+
Run prettier only on files you create. On existing files it reformats them wholesale.
|
|
117
|
+
|
|
118
|
+
## Publish
|
|
119
|
+
|
|
120
|
+
Dashboards read descriptors from the Roma API, not from the bundle. After the files above pass
|
|
121
|
+
verification, publish the descriptor on its service in each environment:
|
|
122
|
+
|
|
123
|
+
- Admin app: Administration → Services → ⋮ → **Data sources** → paste or load the JSON → **Upload**.
|
|
124
|
+
- Or `PUT /api/apps/services/key/{serviceKey}/datasources/{id}` with the descriptor as the body
|
|
125
|
+
(`Roma.App` or `Roma.Administrator`).
|
|
126
|
+
|
|
127
|
+
The server sets `id` and `serviceKey` from the path and returns `409` if another service already
|
|
128
|
+
publishes the id. Do not add the descriptor to `BUNDLED_DESCRIPTORS`; that list only serves tests.
|
|
129
|
+
|
|
130
|
+
To confirm it is live, call `list_datasources` on the `roma-dashboards` MCP server (set it up with
|
|
131
|
+
the roma-dashboard-mcp skill) and check that the new id appears.
|
|
132
|
+
|
|
133
|
+
## Verify
|
|
134
|
+
|
|
135
|
+
```sh
|
|
136
|
+
cd roma-workbench && bunx nx run-many -t test,build,lint -p roma-data-engine,roma-dashboard-core,roma-dashboard-sources,roma-dashboard-react --skip-nx-cache
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Common mistakes
|
|
140
|
+
|
|
141
|
+
| Mistake | Fix |
|
|
142
|
+
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
143
|
+
| A repeating path without `multi` | Add `multi`, or an `expr` that collapses it. |
|
|
144
|
+
| A hand-written `expr` over a numeric column | Inline the coercion (see "Coercion" in the docs). |
|
|
145
|
+
| A quantity or price without `unitField` | Give each measure its own unit or currency dimension. Copy `effectiveQuantity`'s null-when-no-unit `expr`. |
|
|
146
|
+
| Writing `path[0]` | Write `[path][0]`. |
|
|
147
|
+
| A person field without `identity: true` | Mark string dimensions that hold users' short names. |
|
|
148
|
+
| A new field missing from the snapshot or fixture | Two tests fail. Add it to both. |
|
|
149
|
+
| A fixture invented from memory | Copy the schema's property names exactly. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: roma-app-development
|
|
3
|
-
description: Skill for developing Roma applications and widgets. Covers app scaffolding via the Roma NX plugin generators, service configuration, data fetching with React Query + Fusion HTTP clients, and the patterns used across the Roma workbench.
|
|
3
|
+
description: Skill for developing Roma applications and widgets. Covers app scaffolding via the Roma NX plugin generators, service configuration, data fetching with React Query + Fusion HTTP clients, UI components (@equinor/roma-ui / EDS), Roma documentation lookup, and the patterns used across the Roma workbench.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Roma App Development
|
|
@@ -16,6 +16,39 @@ Use this skill when you need to:
|
|
|
16
16
|
- Understand how the Roma framework, Fusion, and React Query work together
|
|
17
17
|
- Use Fusion Framework modules (event system, auth, navigation, service discovery, feature flags, telemetry)
|
|
18
18
|
- Use Roma custom modules (page titles, real-time SSE events)
|
|
19
|
+
- Build UI with Roma / EDS components
|
|
20
|
+
|
|
21
|
+
## Roma Documentation
|
|
22
|
+
|
|
23
|
+
Before implementing, load the Roma docs index: **https://docs.roma.equinor.com/llms.txt**.
|
|
24
|
+
It lists every docs page (framework, modules, components, guides, design guidelines) with links —
|
|
25
|
+
fetch the pages relevant to your task instead of guessing APIs.
|
|
26
|
+
|
|
27
|
+
- The site is behind Equinor GitHub SSO. If the fetch redirects to a GitHub login page, ask the user
|
|
28
|
+
to paste the relevant content, or read the source markdown in `equinor/tops-roma` under
|
|
29
|
+
`roma-workbench/apps/roma-docs/docs/` (e.g. `gh api repos/equinor/tops-roma/contents/roma-workbench/apps/roma-docs/docs`).
|
|
30
|
+
- Prefer the docs over the files in this skill when they disagree — the docs are kept current.
|
|
31
|
+
|
|
32
|
+
## UI Components — always `@equinor/roma-ui`
|
|
33
|
+
|
|
34
|
+
Import **all** UI components from `@equinor/roma-ui`. Never import from `@equinor/eds-core-react`.
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
// ✅
|
|
38
|
+
import { Button, Card, Typography, DatePicker } from '@equinor/roma-ui';
|
|
39
|
+
// ❌
|
|
40
|
+
import { Button, Card, Typography } from '@equinor/eds-core-react';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `roma-ui` re-exports all of EDS (`export * from '@equinor/eds-core-react'`) and layers Roma overrides on
|
|
44
|
+
top (e.g. `DatePicker`, `DateRangePicker`, `Switch`, `Badge`) plus Roma-only components (`Select`,
|
|
45
|
+
`NumberField`, `Calendar`, formatters). Importing EDS directly silently bypasses those overrides.
|
|
46
|
+
- This applies even when a component is "just EDS" and works identically today — overrides can be added
|
|
47
|
+
at any time.
|
|
48
|
+
- Icons and tokens still come from `@equinor/eds-icons` and `@equinor/eds-tokens`.
|
|
49
|
+
- `@equinor/roma-ui` must be a dependency; remove `@equinor/eds-core-react` from the app's `package.json`.
|
|
50
|
+
- Existing apps: run `nx migrate @equinor/roma-nx-plugin` — the `swap-eds-to-roma-ui` migration rewrites
|
|
51
|
+
imports and dependencies. Code generated by older templates may still import EDS directly; swap it.
|
|
19
52
|
|
|
20
53
|
## Installation
|
|
21
54
|
|
|
@@ -192,7 +192,8 @@ export default configure;
|
|
|
192
192
|
|
|
193
193
|
#### `src/App.tsx` — Root Component
|
|
194
194
|
|
|
195
|
-
The default template (non-minimal, no routing) uses EDS components
|
|
195
|
+
The default template (non-minimal, no routing) uses EDS components. When writing or editing app code,
|
|
196
|
+
import these from `@equinor/roma-ui` instead of `@equinor/eds-core-react` (see `SKILL.md`):
|
|
196
197
|
|
|
197
198
|
```tsx
|
|
198
199
|
import { Card, Typography, Button, Icon } from '@equinor/eds-core-react';
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: roma-dashboard-mcp
|
|
3
|
+
description: Use when connecting GitHub Copilot CLI (or another MCP client) to the Roma dashboards MCP server, e.g. "set up the Roma dashboard tools", "add roma-dashboards to my MCP config", or when roma-dashboards calls fail with 401, 403, expired token or "az login" errors.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Connecting to the Roma dashboards MCP server
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
The Roma API serves its dashboard tools over MCP, but it doesn't publish OAuth metadata. A client
|
|
11
|
+
therefore can't sign in by itself, and a pasted token dies after about an hour. Instead, register
|
|
12
|
+
the bundled **bridge**: a local stdio server that fetches tokens from the Azure CLI, renews them,
|
|
13
|
+
and forwards each message to the right environment. No token is ever written to a config file.
|
|
14
|
+
|
|
15
|
+
## Environments
|
|
16
|
+
|
|
17
|
+
| `--env` | Endpoint | Token resource |
|
|
18
|
+
| ------- | --------------------------------------------- | ------------------------------- |
|
|
19
|
+
| `dev` | `https://romadev.equinor.com/eventstream/mcp` | `api://RomaWorkbenchApiNonProd` |
|
|
20
|
+
| `qa` | `https://romaqa.equinor.com/eventstream/mcp` | `api://RomaWorkbenchApiNonProd` |
|
|
21
|
+
| `prod` | `https://roma.equinor.com/eventstream/mcp` | `api://RomaWorkbenchApi` |
|
|
22
|
+
|
|
23
|
+
The bridge knows these; pass `--env`. `--url` and `--resource` override them, e.g. for a local API.
|
|
24
|
+
|
|
25
|
+
## Setup (Copilot CLI)
|
|
26
|
+
|
|
27
|
+
1. **Check prerequisites.** `node --version` must be 18 or later. `az account show` must succeed.
|
|
28
|
+
If it doesn't, ask the user to run `az login --tenant 3aa4a235-b6e2-48d5-9195-7fcf05b459b0`
|
|
29
|
+
themselves (it is interactive) and wait.
|
|
30
|
+
2. **Settle the environment.** If the user didn't name one, ask, proposing `dev`.
|
|
31
|
+
3. **Install the bridge** at a stable path. Copy `scripts/roma-mcp-bridge.mjs` from this skill's
|
|
32
|
+
directory to `~/.copilot/roma-mcp-bridge.mjs`. Never point the config at a temp dir or a
|
|
33
|
+
checkout that changes branch. To update the bridge later, copy it again.
|
|
34
|
+
4. **Merge** this entry into `mcpServers` in `~/.copilot/mcp-config.json`. Read the file first and
|
|
35
|
+
keep every other server; create the file only if it is missing. If it isn't valid JSON, stop and
|
|
36
|
+
ask. Replace an existing `roma-dashboards` entry. Use the absolute path from
|
|
37
|
+
`node -p "require('os').homedir()"`, never `~`.
|
|
38
|
+
```json
|
|
39
|
+
"roma-dashboards": {
|
|
40
|
+
"type": "local",
|
|
41
|
+
"command": "node",
|
|
42
|
+
"args": ["/Users/me/.copilot/roma-mcp-bridge.mjs", "--env", "dev"],
|
|
43
|
+
"tools": ["*"]
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
For a second environment, add another entry such as `roma-dashboards-qa`.
|
|
47
|
+
5. **Smoke-test** the bridge directly:
|
|
48
|
+
```sh
|
|
49
|
+
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | node ~/.copilot/roma-mcp-bridge.mjs --env dev
|
|
50
|
+
```
|
|
51
|
+
The bridge exits when its input closes and never prints the token, so this is safe to run
|
|
52
|
+
as is. Success is one JSON line whose `result.tools` lists `list_datasources`,
|
|
53
|
+
`list_dashboards` and the rest. A line with `error`, or no output at all, is a
|
|
54
|
+
failure: see Troubleshooting. Leave the config in place and report the error to the user.
|
|
55
|
+
6. Tell the user to restart Copilot CLI (or run `/mcp`) to load `roma-dashboards`.
|
|
56
|
+
|
|
57
|
+
Other clients take the same command and args as a stdio server, e.g. VS Code `.vscode/mcp.json`:
|
|
58
|
+
`"servers": { "roma-dashboards": { "type": "stdio", "command": "node", "args": [...] } }`.
|
|
59
|
+
|
|
60
|
+
## Troubleshooting
|
|
61
|
+
|
|
62
|
+
| Symptom | Cause and fix |
|
|
63
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------- |
|
|
64
|
+
| Error mentioning `az login` | az missing, or the login expired. The user runs `az login`; no restart needed. |
|
|
65
|
+
| `HTTP 401` after a retry | Wrong token resource, e.g. the non-prod resource against prod. Use `--env`, not a hand-picked URL. |
|
|
66
|
+
| `HTTP 403` | The user lacks `Roma.User`/`Roma.Administrator` in that environment. Request access; don't retry. |
|
|
67
|
+
| Server missing after setup | Relative or `~` path in `args`, or the client wasn't restarted. |
|
|
68
|
+
| A data source is missing from `list_datasources` | It hasn't been published. **REQUIRED SUB-SKILL:** use creating-dashboard-descriptors. |
|
|
69
|
+
|
|
70
|
+
## Common mistakes
|
|
71
|
+
|
|
72
|
+
- Pasting a token into `headers`. It expires within the hour; always use the bridge.
|
|
73
|
+
- Overwriting `mcp-config.json` and losing the user's other servers.
|
|
74
|
+
- Running `az account get-access-token` yourself to "test" auth and printing the token.
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Bridges a local MCP client (stdio, newline-delimited JSON-RPC) to the Roma
|
|
3
|
+
// dashboards MCP endpoint (stateless Streamable HTTP). Bearer tokens come from
|
|
4
|
+
// the Azure CLI and are renewed automatically, so nothing secret is stored in
|
|
5
|
+
// the client config. Logs go to stderr; stdout carries JSON-RPC only.
|
|
6
|
+
import { execFile } from 'node:child_process';
|
|
7
|
+
import { realpathSync } from 'node:fs';
|
|
8
|
+
import { createInterface } from 'node:readline';
|
|
9
|
+
import { pathToFileURL } from 'node:url';
|
|
10
|
+
|
|
11
|
+
export const ENVIRONMENTS = {
|
|
12
|
+
dev: {
|
|
13
|
+
url: 'https://romadev.equinor.com/eventstream/mcp',
|
|
14
|
+
resource: 'api://RomaWorkbenchApiNonProd',
|
|
15
|
+
},
|
|
16
|
+
qa: {
|
|
17
|
+
url: 'https://romaqa.equinor.com/eventstream/mcp',
|
|
18
|
+
resource: 'api://RomaWorkbenchApiNonProd',
|
|
19
|
+
},
|
|
20
|
+
prod: {
|
|
21
|
+
url: 'https://roma.equinor.com/eventstream/mcp',
|
|
22
|
+
resource: 'api://RomaWorkbenchApi',
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const REFRESH_MARGIN_MS = 5 * 60 * 1000;
|
|
27
|
+
|
|
28
|
+
export function parseArgs(argv) {
|
|
29
|
+
const opts = {};
|
|
30
|
+
for (let i = 0; i < argv.length; i += 2) {
|
|
31
|
+
const key = argv[i];
|
|
32
|
+
const value = argv[i + 1];
|
|
33
|
+
if (
|
|
34
|
+
!['--env', '--url', '--resource'].includes(key) ||
|
|
35
|
+
value === undefined
|
|
36
|
+
) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
'Usage: roma-mcp-bridge.mjs [--env dev|qa|prod] [--url <endpoint>] [--resource <api://...>]'
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
opts[key.slice(2)] = value;
|
|
42
|
+
}
|
|
43
|
+
const env = opts.env ?? 'dev';
|
|
44
|
+
const target = ENVIRONMENTS[env];
|
|
45
|
+
if (!target) {
|
|
46
|
+
throw new Error(
|
|
47
|
+
`Unknown environment "${env}". Use one of: ${Object.keys(ENVIRONMENTS).join(', ')}`
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
url: opts.url ?? target.url,
|
|
52
|
+
resource: opts.resource ?? target.resource,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function runAz(args) {
|
|
57
|
+
// az is a .cmd shim on Windows, which execFile can only start through cmd.exe.
|
|
58
|
+
const [cmd, cmdArgs] =
|
|
59
|
+
process.platform === 'win32'
|
|
60
|
+
? ['cmd.exe', ['/d', '/c', 'az', ...args]]
|
|
61
|
+
: ['az', args];
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
execFile(
|
|
64
|
+
cmd,
|
|
65
|
+
cmdArgs,
|
|
66
|
+
{ timeout: 60_000, windowsHide: true },
|
|
67
|
+
(err, stdout, stderr) => {
|
|
68
|
+
if (err) reject(new Error((stderr || err.message).trim()));
|
|
69
|
+
else resolve(stdout);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export async function readAzToken(resource, exec = runAz) {
|
|
76
|
+
let raw;
|
|
77
|
+
try {
|
|
78
|
+
raw = await exec([
|
|
79
|
+
'account',
|
|
80
|
+
'get-access-token',
|
|
81
|
+
'--resource',
|
|
82
|
+
resource,
|
|
83
|
+
'-o',
|
|
84
|
+
'json',
|
|
85
|
+
]);
|
|
86
|
+
} catch (err) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
`Could not get a token from the Azure CLI for ${resource}. Install az and run "az login" ` +
|
|
89
|
+
`(tenant 3aa4a235-b6e2-48d5-9195-7fcf05b459b0), then retry. Details: ${err.message}`
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
const parsed = JSON.parse(raw);
|
|
93
|
+
const expiresAt =
|
|
94
|
+
typeof parsed.expires_on === 'number'
|
|
95
|
+
? parsed.expires_on * 1000
|
|
96
|
+
: new Date(String(parsed.expiresOn).replace(' ', 'T')).getTime();
|
|
97
|
+
return { token: parsed.accessToken, expiresAt };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function sseMessages(text) {
|
|
101
|
+
return text
|
|
102
|
+
.split(/\r?\n\r?\n/)
|
|
103
|
+
.map((event) =>
|
|
104
|
+
event
|
|
105
|
+
.split(/\r?\n/)
|
|
106
|
+
.filter((line) => line.startsWith('data:'))
|
|
107
|
+
.map((line) => line.slice(5).trimStart())
|
|
108
|
+
.join('\n')
|
|
109
|
+
)
|
|
110
|
+
.filter((data) => data.trim());
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function createBridge({
|
|
114
|
+
url,
|
|
115
|
+
getToken,
|
|
116
|
+
fetchImpl = fetch,
|
|
117
|
+
write,
|
|
118
|
+
log,
|
|
119
|
+
now = Date.now,
|
|
120
|
+
}) {
|
|
121
|
+
let cached;
|
|
122
|
+
let pending;
|
|
123
|
+
|
|
124
|
+
function token(force) {
|
|
125
|
+
if (!force && cached && now() < cached.expiresAt - REFRESH_MARGIN_MS)
|
|
126
|
+
return Promise.resolve(cached.token);
|
|
127
|
+
pending ??= getToken()
|
|
128
|
+
.then((fresh) => {
|
|
129
|
+
cached = fresh;
|
|
130
|
+
return fresh.token;
|
|
131
|
+
})
|
|
132
|
+
.finally(() => {
|
|
133
|
+
pending = undefined;
|
|
134
|
+
});
|
|
135
|
+
return pending;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
async function post(body, force) {
|
|
139
|
+
return fetchImpl(url, {
|
|
140
|
+
method: 'POST',
|
|
141
|
+
headers: {
|
|
142
|
+
Authorization: `Bearer ${await token(force)}`,
|
|
143
|
+
'Content-Type': 'application/json',
|
|
144
|
+
Accept: 'application/json, text/event-stream',
|
|
145
|
+
},
|
|
146
|
+
body,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
async function handleLine(line) {
|
|
151
|
+
if (!line.trim()) return;
|
|
152
|
+
let id;
|
|
153
|
+
try {
|
|
154
|
+
id = JSON.parse(line).id;
|
|
155
|
+
} catch {
|
|
156
|
+
log(`Ignoring non-JSON input: ${line.slice(0, 200)}`);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
let res = await post(line, false);
|
|
161
|
+
if (res.status === 401) {
|
|
162
|
+
log(
|
|
163
|
+
'Server answered 401; refreshing the Azure CLI token and retrying once.'
|
|
164
|
+
);
|
|
165
|
+
res = await post(line, true);
|
|
166
|
+
}
|
|
167
|
+
const text = await res.text();
|
|
168
|
+
if (!res.ok)
|
|
169
|
+
throw new Error(
|
|
170
|
+
`Roma MCP endpoint answered HTTP ${res.status}: ${text.slice(0, 300)}`
|
|
171
|
+
);
|
|
172
|
+
if (!text.trim()) return;
|
|
173
|
+
const contentType = res.headers.get('content-type') ?? '';
|
|
174
|
+
const messages = contentType.includes('text/event-stream')
|
|
175
|
+
? sseMessages(text)
|
|
176
|
+
: [text];
|
|
177
|
+
for (const message of messages)
|
|
178
|
+
write(JSON.stringify(JSON.parse(message)));
|
|
179
|
+
} catch (err) {
|
|
180
|
+
log(err.message);
|
|
181
|
+
if (id !== undefined && id !== null) {
|
|
182
|
+
write(
|
|
183
|
+
JSON.stringify({
|
|
184
|
+
jsonrpc: '2.0',
|
|
185
|
+
id,
|
|
186
|
+
error: { code: -32000, message: err.message },
|
|
187
|
+
})
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return { handleLine };
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function main() {
|
|
197
|
+
const log = (msg) => process.stderr.write(`[roma-mcp-bridge] ${msg}\n`);
|
|
198
|
+
let target;
|
|
199
|
+
try {
|
|
200
|
+
target = parseArgs(process.argv.slice(2));
|
|
201
|
+
} catch (err) {
|
|
202
|
+
log(err.message);
|
|
203
|
+
process.exit(2);
|
|
204
|
+
}
|
|
205
|
+
log(`Forwarding to ${target.url}`);
|
|
206
|
+
const bridge = createBridge({
|
|
207
|
+
url: target.url,
|
|
208
|
+
getToken: () => readAzToken(target.resource),
|
|
209
|
+
write: (line) => process.stdout.write(`${line}\n`),
|
|
210
|
+
log,
|
|
211
|
+
});
|
|
212
|
+
const inFlight = new Set();
|
|
213
|
+
const rl = createInterface({ input: process.stdin });
|
|
214
|
+
rl.on('line', (line) => {
|
|
215
|
+
const p = bridge.handleLine(line).finally(() => inFlight.delete(p));
|
|
216
|
+
inFlight.add(p);
|
|
217
|
+
});
|
|
218
|
+
rl.on('close', () => Promise.all(inFlight).then(() => process.exit(0)));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// Node resolves symlinks in import.meta.url but not in argv, e.g. /tmp -> /private/tmp on macOS.
|
|
222
|
+
if (
|
|
223
|
+
process.argv[1] &&
|
|
224
|
+
import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href
|
|
225
|
+
) {
|
|
226
|
+
main();
|
|
227
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
/**
|
|
3
|
+
* Migrates consumer apps/libs from `@equinor/eds-core-react` to
|
|
4
|
+
* `@equinor/roma-ui` (which re-exports eds plus Roma overrides):
|
|
5
|
+
* - rewrites imports across all project source files
|
|
6
|
+
* - swaps the dependency in the root and any per-project package.json
|
|
7
|
+
* - falls back to adding roma-ui to the root package.json when eds isn't
|
|
8
|
+
* declared anywhere (root-only, per-project, or mixed layouts all handled)
|
|
9
|
+
*/
|
|
10
|
+
export default function update(tree: Tree): Promise<void>;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = update;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const EDS = '@equinor/eds-core-react';
|
|
6
|
+
const ROMA_UI = '@equinor/roma-ui';
|
|
7
|
+
const ROMA_UI_VERSION = '1.2.0-rc.0';
|
|
8
|
+
const SOURCE_EXTS = ['.ts', '.tsx', '.js', '.jsx', '.mts', '.cts'];
|
|
9
|
+
/**
|
|
10
|
+
* Replaces bare imports of `@equinor/eds-core-react` with `@equinor/roma-ui`.
|
|
11
|
+
* Subpath imports (e.g. `@equinor/eds-core-react/...`) are intentionally left
|
|
12
|
+
* untouched — only the exact specifier is swapped, in single or double quotes.
|
|
13
|
+
*/
|
|
14
|
+
function rewriteFile(tree, filePath) {
|
|
15
|
+
if (!SOURCE_EXTS.some((ext) => filePath.endsWith(ext)))
|
|
16
|
+
return false;
|
|
17
|
+
const content = tree.read(filePath, 'utf-8');
|
|
18
|
+
if (!content || !content.includes(EDS))
|
|
19
|
+
return false;
|
|
20
|
+
const updated = content
|
|
21
|
+
.replace(new RegExp(`'${EDS}'`, 'g'), `'${ROMA_UI}'`)
|
|
22
|
+
.replace(new RegExp(`"${EDS}"`, 'g'), `"${ROMA_UI}"`);
|
|
23
|
+
if (updated === content)
|
|
24
|
+
return false;
|
|
25
|
+
tree.write(filePath, updated);
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function rewriteImports(tree) {
|
|
29
|
+
const files = [];
|
|
30
|
+
for (const [, project] of (0, devkit_1.getProjects)(tree)) {
|
|
31
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, project.root, (filePath) => files.push(filePath));
|
|
32
|
+
}
|
|
33
|
+
let changed = false;
|
|
34
|
+
for (const filePath of files) {
|
|
35
|
+
if (rewriteFile(tree, filePath))
|
|
36
|
+
changed = true;
|
|
37
|
+
}
|
|
38
|
+
return changed;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Swaps the dependency in a single package.json. Wherever
|
|
42
|
+
* `@equinor/eds-core-react` lives (dependencies or devDependencies), add
|
|
43
|
+
* `@equinor/roma-ui` in the same place and remove eds. Returns true if changed.
|
|
44
|
+
*/
|
|
45
|
+
function swapInPackageJson(tree, path) {
|
|
46
|
+
if (!tree.exists(path))
|
|
47
|
+
return false;
|
|
48
|
+
let changed = false;
|
|
49
|
+
(0, devkit_1.updateJson)(tree, path, (json) => {
|
|
50
|
+
for (const section of ['dependencies', 'devDependencies']) {
|
|
51
|
+
if (json[section] && json[section][EDS]) {
|
|
52
|
+
delete json[section][EDS];
|
|
53
|
+
json[section][ROMA_UI] = ROMA_UI_VERSION;
|
|
54
|
+
changed = true;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return json;
|
|
58
|
+
});
|
|
59
|
+
return changed;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Migrates consumer apps/libs from `@equinor/eds-core-react` to
|
|
63
|
+
* `@equinor/roma-ui` (which re-exports eds plus Roma overrides):
|
|
64
|
+
* - rewrites imports across all project source files
|
|
65
|
+
* - swaps the dependency in the root and any per-project package.json
|
|
66
|
+
* - falls back to adding roma-ui to the root package.json when eds isn't
|
|
67
|
+
* declared anywhere (root-only, per-project, or mixed layouts all handled)
|
|
68
|
+
*/
|
|
69
|
+
async function update(tree) {
|
|
70
|
+
rewriteImports(tree);
|
|
71
|
+
let depChanged = swapInPackageJson(tree, 'package.json');
|
|
72
|
+
for (const [, project] of (0, devkit_1.getProjects)(tree)) {
|
|
73
|
+
depChanged =
|
|
74
|
+
swapInPackageJson(tree, `${project.root}/package.json`) || depChanged;
|
|
75
|
+
}
|
|
76
|
+
if (!depChanged && tree.exists('package.json')) {
|
|
77
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
78
|
+
var _a;
|
|
79
|
+
json.dependencies = (_a = json.dependencies) !== null && _a !== void 0 ? _a : {};
|
|
80
|
+
json.dependencies[ROMA_UI] = ROMA_UI_VERSION;
|
|
81
|
+
return json;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=swap-eds-to-roma-ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"swap-eds-to-roma-ui.js","sourceRoot":"","sources":["../../../../../../plugins/roma/src/migrations/swap-eds-to-roma-ui/swap-eds-to-roma-ui.ts"],"names":[],"mappings":";;AA4EA,yBAkBC;AA9FD,uCAMoB;AAEpB,MA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