@salesforce/b2c-dx-mcp 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/registry.js +21 -14
  2. package/dist/server-context.d.ts +6 -4
  3. package/dist/server-context.js +8 -5
  4. package/dist/tools/diagnostics/debug-capture-at-breakpoint.js +1 -1
  5. package/dist/tools/diagnostics/debug-continue.js +1 -1
  6. package/dist/tools/diagnostics/debug-end-session.js +1 -1
  7. package/dist/tools/diagnostics/debug-evaluate.js +1 -1
  8. package/dist/tools/diagnostics/debug-get-stack.js +1 -1
  9. package/dist/tools/diagnostics/debug-get-variables.js +1 -1
  10. package/dist/tools/diagnostics/debug-list-sessions.js +1 -1
  11. package/dist/tools/diagnostics/debug-set-breakpoints.js +1 -1
  12. package/dist/tools/diagnostics/debug-start-session.js +1 -1
  13. package/dist/tools/diagnostics/debug-step.js +1 -1
  14. package/dist/tools/diagnostics/debug-wait-for-stop.js +1 -1
  15. package/dist/tools/diagnostics/index.d.ts +6 -1
  16. package/dist/tools/diagnostics/index.js +13 -1
  17. package/dist/tools/diagnostics/log-watch-registry.d.ts +94 -0
  18. package/dist/tools/diagnostics/log-watch-registry.js +249 -0
  19. package/dist/tools/diagnostics/logs-get-recent.d.ts +9 -0
  20. package/dist/tools/diagnostics/logs-get-recent.js +68 -0
  21. package/dist/tools/diagnostics/logs-list-files.d.ts +9 -0
  22. package/dist/tools/diagnostics/logs-list-files.js +36 -0
  23. package/dist/tools/diagnostics/logs-watch-list.d.ts +4 -0
  24. package/dist/tools/diagnostics/logs-watch-list.js +36 -0
  25. package/dist/tools/diagnostics/logs-watch-poll.d.ts +4 -0
  26. package/dist/tools/diagnostics/logs-watch-poll.js +63 -0
  27. package/dist/tools/diagnostics/logs-watch-start.d.ts +9 -0
  28. package/dist/tools/diagnostics/logs-watch-start.js +117 -0
  29. package/dist/tools/diagnostics/logs-watch-stop.d.ts +4 -0
  30. package/dist/tools/diagnostics/logs-watch-stop.js +36 -0
  31. package/dist/tools/docs/docs-list.d.ts +3 -0
  32. package/dist/tools/docs/docs-list.js +22 -0
  33. package/dist/tools/docs/docs-read.d.ts +3 -0
  34. package/dist/tools/docs/docs-read.js +25 -0
  35. package/dist/tools/docs/docs-schema-list.d.ts +3 -0
  36. package/dist/tools/docs/docs-schema-list.js +21 -0
  37. package/dist/tools/docs/docs-schema-read.d.ts +3 -0
  38. package/dist/tools/docs/docs-schema-read.js +25 -0
  39. package/dist/tools/docs/docs-schema-search.d.ts +3 -0
  40. package/dist/tools/docs/docs-schema-search.js +26 -0
  41. package/dist/tools/docs/docs-search.d.ts +3 -0
  42. package/dist/tools/docs/docs-search.js +27 -0
  43. package/dist/tools/docs/index.d.ts +3 -0
  44. package/dist/tools/docs/index.js +22 -0
  45. package/dist/tools/index.d.ts +1 -0
  46. package/dist/tools/index.js +1 -0
  47. package/dist/utils/constants.d.ts +2 -2
  48. package/dist/utils/constants.js +1 -1
  49. package/oclif.manifest.json +4 -2
  50. package/package.json +4 -4
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { listDocs } from '@salesforce/b2c-tooling-sdk/docs';
7
+ import { createToolAdapter, jsonResult } from '../adapter.js';
8
+ export function createDocsListTool(loadServices) {
9
+ return createToolAdapter({
10
+ name: 'docs_list',
11
+ description: 'List every available Script API documentation entry (id + title). ' +
12
+ 'Output is large; prefer docs_search for targeted lookups.',
13
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
14
+ inputSchema: {},
15
+ async execute() {
16
+ const entries = listDocs();
17
+ return { count: entries.length, entries };
18
+ },
19
+ formatOutput: (output) => jsonResult(output),
20
+ }, loadServices);
21
+ }
22
+ //# sourceMappingURL=docs-list.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsReadTool(loadServices: () => Promise<Services> | Services): McpTool;
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ import { readDocByQuery } from '@salesforce/b2c-tooling-sdk/docs';
8
+ import { createToolAdapter, errorResult, jsonResult } from '../adapter.js';
9
+ export function createDocsReadTool(loadServices) {
10
+ return createToolAdapter({
11
+ name: 'docs_read',
12
+ description: 'Read full Script API documentation (markdown) for a B2C Commerce class or module. ' +
13
+ 'Accepts an exact id (e.g., "dw.catalog.ProductMgr") or fuzzy query — best match wins. ' +
14
+ 'Content can be large; if you do not know the id, call docs_search first to narrow down.',
15
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
16
+ inputSchema: {
17
+ query: z.string().min(1).describe('Exact id ("dw.catalog.ProductMgr") or fuzzy query ("ProductMgr").'),
18
+ },
19
+ async execute(args) {
20
+ return readDocByQuery(args.query);
21
+ },
22
+ formatOutput: (output) => output ? jsonResult(output) : errorResult('No documentation found. Try docs_search to find candidates.'),
23
+ }, loadServices);
24
+ }
25
+ //# sourceMappingURL=docs-read.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsSchemaListTool(loadServices: () => Promise<Services> | Services): McpTool;
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { listSchemas } from '@salesforce/b2c-tooling-sdk/docs';
7
+ import { createToolAdapter, jsonResult } from '../adapter.js';
8
+ export function createDocsSchemaListTool(loadServices) {
9
+ return createToolAdapter({
10
+ name: 'docs_schema_list',
11
+ description: 'List every available B2C Commerce XSD schema id. Use to discover schema names for docs_schema_read.',
12
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
13
+ inputSchema: {},
14
+ async execute() {
15
+ const entries = listSchemas();
16
+ return { count: entries.length, entries };
17
+ },
18
+ formatOutput: (output) => jsonResult(output),
19
+ }, loadServices);
20
+ }
21
+ //# sourceMappingURL=docs-schema-list.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsSchemaReadTool(loadServices: () => Promise<Services> | Services): McpTool;
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ import { readSchemaByQuery } from '@salesforce/b2c-tooling-sdk/docs';
8
+ import { createToolAdapter, errorResult, jsonResult } from '../adapter.js';
9
+ export function createDocsSchemaReadTool(loadServices) {
10
+ return createToolAdapter({
11
+ name: 'docs_schema_read',
12
+ description: 'Read the contents of a bundled B2C Commerce XSD schema (raw XML). ' +
13
+ 'Accepts an exact id or fuzzy query. Returns the schema body plus the on-disk path. ' +
14
+ 'Schemas can be large; if you do not know the id, call docs_schema_search first.',
15
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
16
+ inputSchema: {
17
+ query: z.string().min(1).describe('Schema name or partial match.'),
18
+ },
19
+ async execute(args) {
20
+ return readSchemaByQuery(args.query);
21
+ },
22
+ formatOutput: (output) => output ? jsonResult(output) : errorResult('No schema found. Try docs_schema_search to find candidates.'),
23
+ }, loadServices);
24
+ }
25
+ //# sourceMappingURL=docs-schema-read.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsSchemaSearchTool(loadServices: () => Promise<Services> | Services): McpTool;
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ import { searchSchemas } from '@salesforce/b2c-tooling-sdk/docs';
8
+ import { createToolAdapter, jsonResult } from '../adapter.js';
9
+ export function createDocsSchemaSearchTool(loadServices) {
10
+ return createToolAdapter({
11
+ name: 'docs_schema_search',
12
+ description: 'Fuzzy-search bundled B2C Commerce XSD schemas by id (e.g., "catalog", "order", "system-objecttype"). ' +
13
+ 'Returns matching schema ids + relevance score. Use BEFORE docs_schema_read when the exact id is unknown.',
14
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
15
+ inputSchema: {
16
+ query: z.string().min(1).describe('Schema name or partial match (e.g., "catalog", "order").'),
17
+ limit: z.number().int().positive().optional().describe('Maximum number of results to return. Defaults to 20.'),
18
+ },
19
+ async execute(args) {
20
+ const results = searchSchemas(args.query, args.limit ?? 20);
21
+ return { query: args.query, results };
22
+ },
23
+ formatOutput: (output) => jsonResult(output),
24
+ }, loadServices);
25
+ }
26
+ //# sourceMappingURL=docs-schema-search.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsSearchTool(loadServices: () => Promise<Services> | Services): McpTool;
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { z } from 'zod';
7
+ import { searchDocs } from '@salesforce/b2c-tooling-sdk/docs';
8
+ import { createToolAdapter, jsonResult } from '../adapter.js';
9
+ export function createDocsSearchTool(loadServices) {
10
+ return createToolAdapter({
11
+ name: 'docs_search',
12
+ description: 'Fuzzy-search the bundled B2C Commerce Script API documentation by class, module, or partial name ' +
13
+ '(e.g., "ProductMgr", "dw.catalog", "Status"). Returns matching ids + relevance score. ' +
14
+ 'Use this BEFORE docs_read when you do not know the exact id.',
15
+ toolsets: ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'],
16
+ inputSchema: {
17
+ query: z.string().min(1).describe('Search query (class name, module path, or partial match).'),
18
+ limit: z.number().int().positive().optional().describe('Maximum number of results to return. Defaults to 20.'),
19
+ },
20
+ async execute(args) {
21
+ const results = searchDocs(args.query, args.limit ?? 20);
22
+ return { query: args.query, results };
23
+ },
24
+ formatOutput: (output) => jsonResult(output),
25
+ }, loadServices);
26
+ }
27
+ //# sourceMappingURL=docs-search.js.map
@@ -0,0 +1,3 @@
1
+ import type { McpTool } from '../../utils/index.js';
2
+ import type { Services } from '../../services.js';
3
+ export declare function createDocsTools(loadServices: () => Promise<Services> | Services): McpTool[];
@@ -0,0 +1,22 @@
1
+ /*
2
+ * Copyright (c) 2025, Salesforce, Inc.
3
+ * SPDX-License-Identifier: Apache-2
4
+ * For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import { createDocsListTool } from './docs-list.js';
7
+ import { createDocsReadTool } from './docs-read.js';
8
+ import { createDocsSchemaListTool } from './docs-schema-list.js';
9
+ import { createDocsSchemaReadTool } from './docs-schema-read.js';
10
+ import { createDocsSchemaSearchTool } from './docs-schema-search.js';
11
+ import { createDocsSearchTool } from './docs-search.js';
12
+ export function createDocsTools(loadServices) {
13
+ return [
14
+ createDocsSearchTool(loadServices),
15
+ createDocsReadTool(loadServices),
16
+ createDocsListTool(loadServices),
17
+ createDocsSchemaSearchTool(loadServices),
18
+ createDocsSchemaReadTool(loadServices),
19
+ createDocsSchemaListTool(loadServices),
20
+ ];
21
+ }
22
+ //# sourceMappingURL=index.js.map
@@ -10,6 +10,7 @@
10
10
  export * from './adapter.js';
11
11
  export * from './cartridges/index.js';
12
12
  export * from './diagnostics/index.js';
13
+ export * from './docs/index.js';
13
14
  export * from './mrt/index.js';
14
15
  export * from './pwav3/index.js';
15
16
  export * from './scapi/index.js';
@@ -17,6 +17,7 @@ export * from './adapter.js';
17
17
  // Toolset exports
18
18
  export * from './cartridges/index.js';
19
19
  export * from './diagnostics/index.js';
20
+ export * from './docs/index.js';
20
21
  export * from './mrt/index.js';
21
22
  export * from './pwav3/index.js';
22
23
  export * from './scapi/index.js';
@@ -5,11 +5,11 @@ export declare const ALL_TOOLSETS = "ALL";
5
5
  /**
6
6
  * Available toolsets that can be enabled.
7
7
  */
8
- export declare const TOOLSETS: readonly ["CARTRIDGES", "MRT", "PWAV3", "SCAPI", "STOREFRONTNEXT"];
8
+ export declare const TOOLSETS: readonly ["CARTRIDGES", "DIAGNOSTICS", "MRT", "PWAV3", "SCAPI", "STOREFRONTNEXT"];
9
9
  /**
10
10
  * Valid toolset names including the special "ALL" value.
11
11
  */
12
- export declare const VALID_TOOLSET_NAMES: readonly ["ALL", "CARTRIDGES", "MRT", "PWAV3", "SCAPI", "STOREFRONTNEXT"];
12
+ export declare const VALID_TOOLSET_NAMES: readonly ["ALL", "CARTRIDGES", "DIAGNOSTICS", "MRT", "PWAV3", "SCAPI", "STOREFRONTNEXT"];
13
13
  /**
14
14
  * Type representing a valid toolset name.
15
15
  */
@@ -10,7 +10,7 @@ export const ALL_TOOLSETS = 'ALL';
10
10
  /**
11
11
  * Available toolsets that can be enabled.
12
12
  */
13
- export const TOOLSETS = ['CARTRIDGES', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'];
13
+ export const TOOLSETS = ['CARTRIDGES', 'DIAGNOSTICS', 'MRT', 'PWAV3', 'SCAPI', 'STOREFRONTNEXT'];
14
14
  /**
15
15
  * Valid toolset names including the special "ALL" value.
16
16
  */
@@ -172,6 +172,7 @@
172
172
  "type": "option"
173
173
  },
174
174
  "cloud-origin": {
175
+ "char": "o",
175
176
  "description": "MRT cloud origin URL (or set mrtOrigin in dw.json; default: https://cloud.mobify.com)",
176
177
  "env": "MRT_CLOUD_ORIGIN",
177
178
  "name": "cloud-origin",
@@ -180,6 +181,7 @@
180
181
  "type": "option"
181
182
  },
182
183
  "credentials-file": {
184
+ "char": "c",
183
185
  "description": "Path to MRT credentials file (overrides default ~/.mobify)",
184
186
  "env": "MRT_CREDENTIALS_FILE",
185
187
  "name": "credentials-file",
@@ -385,7 +387,7 @@
385
387
  "type": "boolean"
386
388
  },
387
389
  "toolsets": {
388
- "description": "Toolsets to enable (comma-separated). Options: all, CARTRIDGES, MRT, PWAV3, SCAPI, STOREFRONTNEXT",
390
+ "description": "Toolsets to enable (comma-separated). Options: all, CARTRIDGES, DIAGNOSTICS, MRT, PWAV3, SCAPI, STOREFRONTNEXT",
389
391
  "env": "SFCC_TOOLSETS",
390
392
  "name": "toolsets",
391
393
  "hasDynamicHelp": false,
@@ -418,5 +420,5 @@
418
420
  "enableJsonFlag": false
419
421
  }
420
422
  },
421
- "version": "1.1.3"
423
+ "version": "1.2.0"
422
424
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/b2c-dx-mcp",
3
3
  "description": "MCP server for B2C Commerce developer experience tools",
4
- "version": "1.1.3",
4
+ "version": "1.2.0",
5
5
  "author": "Salesforce",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "SalesforceCommerceCloud/b2c-developer-tooling",
@@ -80,7 +80,7 @@
80
80
  "yaml": "2.8.1",
81
81
  "postcss": "8.5.6",
82
82
  "zod": "3.25.76",
83
- "@salesforce/b2c-tooling-sdk": "1.11.1"
83
+ "@salesforce/b2c-tooling-sdk": "1.12.0"
84
84
  },
85
85
  "devDependencies": {
86
86
  "@eslint/compat": "^1",
@@ -98,10 +98,10 @@
98
98
  "eslint-config-oclif": "^6",
99
99
  "eslint-config-prettier": "^10",
100
100
  "eslint-plugin-header": "^3.1.1",
101
- "eslint-plugin-prettier": "^5.5.4",
101
+ "eslint-plugin-prettier": "^5.5.5",
102
102
  "mocha": "^10",
103
103
  "oclif": "^4",
104
- "prettier": "^3.6.2",
104
+ "prettier": "^3.8.3",
105
105
  "shx": "^0.3.3",
106
106
  "sinon": "^21.0.1",
107
107
  "tsx": "^4",