sfcc-dev-mcp 1.0.20 → 1.0.21
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.
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
* This abstraction allows for easier path management and testing.
|
|
6
6
|
*/
|
|
7
7
|
export declare class PathResolver {
|
|
8
|
+
/**
|
|
9
|
+
* Resolve the first existing path from a list of candidates.
|
|
10
|
+
* Falls back to the first candidate when none exist.
|
|
11
|
+
*/
|
|
12
|
+
private static resolveExistingPath;
|
|
8
13
|
/**
|
|
9
14
|
* Get the current working directory (project root)
|
|
10
15
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"path-resolver.d.ts","sourceRoot":"","sources":["../../src/utils/path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,qBAAa,YAAY;IACvB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAUlC;;OAEG;IACH,MAAM,CAAC,oBAAoB,IAAI,MAAM;IAYrC;;OAEG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM;IAQtC;;OAEG;IACH,MAAM,CAAC,yBAAyB,IAAI,MAAM;IAI1C;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,MAAM;IAIpC;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,YAAY,EAAE,MAAM,EAAE,GAAG,MAAM;IAMzD;;OAEG;IACH,MAAM,CAAC,WAAW,IAAI,MAAM;IAQ5B;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM;CAGjC"}
|
|
@@ -5,15 +5,29 @@
|
|
|
5
5
|
* This abstraction allows for easier path management and testing.
|
|
6
6
|
*/
|
|
7
7
|
import path from 'path';
|
|
8
|
+
import fs from 'fs';
|
|
8
9
|
import { fileURLToPath } from 'url';
|
|
9
10
|
export class PathResolver {
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the first existing path from a list of candidates.
|
|
13
|
+
* Falls back to the first candidate when none exist.
|
|
14
|
+
*/
|
|
15
|
+
static resolveExistingPath(candidates) {
|
|
16
|
+
for (const candidate of candidates) {
|
|
17
|
+
if (fs.existsSync(candidate)) {
|
|
18
|
+
return candidate;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return candidates[0];
|
|
22
|
+
}
|
|
10
23
|
/**
|
|
11
24
|
* Get the current working directory (project root)
|
|
12
25
|
*/
|
|
13
26
|
static getCurrentWorkingDir() {
|
|
14
27
|
// Get the directory of the current module file
|
|
15
|
-
// ts-jest may compile with a CommonJS module target in tests
|
|
16
|
-
//
|
|
28
|
+
// ts-jest may compile with a CommonJS module target in tests.
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
30
|
+
// @ts-ignore TS1343: runtime uses ESM (NodeNext) where import.meta is valid.
|
|
17
31
|
const __filename = fileURLToPath(import.meta.url);
|
|
18
32
|
const __dirname = path.dirname(__filename);
|
|
19
33
|
// Return the project root (handles both src/ and dist/ locations)
|
|
@@ -23,7 +37,11 @@ export class PathResolver {
|
|
|
23
37
|
* Root path for bundled AI instructions (AGENTS.md + skills)
|
|
24
38
|
*/
|
|
25
39
|
static getAiInstructionsPath() {
|
|
26
|
-
|
|
40
|
+
const root = this.getCurrentWorkingDir();
|
|
41
|
+
return this.resolveExistingPath([
|
|
42
|
+
path.join(root, 'ai-instructions'),
|
|
43
|
+
path.join(root, 'dist', 'ai-instructions'),
|
|
44
|
+
]);
|
|
27
45
|
}
|
|
28
46
|
/**
|
|
29
47
|
* Path to the bundled AGENTS.md
|
|
@@ -48,13 +66,17 @@ export class PathResolver {
|
|
|
48
66
|
* Get the docs directory path relative to the current working directory
|
|
49
67
|
*/
|
|
50
68
|
static getDocsPath() {
|
|
51
|
-
|
|
69
|
+
const root = this.getCurrentWorkingDir();
|
|
70
|
+
return this.resolveExistingPath([
|
|
71
|
+
path.join(root, 'docs'),
|
|
72
|
+
path.join(root, 'dist', 'docs'),
|
|
73
|
+
]);
|
|
52
74
|
}
|
|
53
75
|
/**
|
|
54
76
|
* Get the SFRA docs directory path relative to the current working directory
|
|
55
77
|
*/
|
|
56
78
|
static getSFRADocsPath() {
|
|
57
|
-
return this.
|
|
79
|
+
return path.join(this.getDocsPath(), 'sfra');
|
|
58
80
|
}
|
|
59
81
|
}
|
|
60
82
|
//# sourceMappingURL=path-resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path-resolver.js","sourceRoot":"","sources":["../../src/utils/path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,OAAO,YAAY;IACvB;;OAEG;IACH,MAAM,CAAC,oBAAoB;QACzB,+CAA+C;QAC/C,
|
|
1
|
+
{"version":3,"file":"path-resolver.js","sourceRoot":"","sources":["../../src/utils/path-resolver.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,OAAO,YAAY;IACvB;;;OAGG;IACK,MAAM,CAAC,mBAAmB,CAAC,UAAoB;QACrD,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;YACnC,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC7B,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,oBAAoB;QACzB,+CAA+C;QAC/C,8DAA8D;QAC9D,6DAA6D;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AC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sfcc-dev-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "MCP server for Salesforce B2C Commerce Cloud development assistance including logs, debugging, and development tools",
|
|
5
5
|
"mcpName": "io.github.taurgis/sfcc-dev-mcp",
|
|
6
6
|
"main": "dist/index.js",
|