@salesforce/b2c-dx-mcp 0.4.0 → 0.4.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.
@@ -46,7 +46,7 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
46
46
  lang: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
47
47
  config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
48
48
  instance: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
49
- 'working-directory': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
49
+ 'project-directory': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
50
50
  'extra-query': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
51
51
  'extra-body': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
52
52
  'extra-headers': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -78,7 +78,7 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
78
78
  * Priority (highest to lowest):
79
79
  * 1. CLI flags (--server, --username, --api-key, etc.)
80
80
  * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, SFCC_MRT_API_KEY, etc.)
81
- * 3. dw.json file (via --config flag or auto-discovered from --working-directory)
81
+ * 3. dw.json file (via --config flag or auto-discovered from --project-directory)
82
82
  * 4. ~/.mobify file (for MRT API key)
83
83
  */
84
84
  protected loadConfiguration(): ResolvedB2CConfig;
@@ -47,7 +47,7 @@
47
47
  * ### Global Flags (inherited from BaseCommand)
48
48
  * | Flag | Env Variable | Description |
49
49
  * |------|--------------|-------------|
50
- * | `--working-directory` | `SFCC_WORKING_DIRECTORY` | Project working directory (see note below) |
50
+ * | `--project-directory` | `SFCC_PROJECT_DIRECTORY` | Project directory (see note below) |
51
51
  * | `--config` | `SFCC_CONFIG` | Path to dw.json config file (auto-discovered if not provided) |
52
52
  * | `--instance` | `SFCC_INSTANCE` | Instance name from configuration file |
53
53
  * | `--log-level` | `SFCC_LOG_LEVEL` | Set logging verbosity (trace, debug, info, warn, error, silent) |
@@ -55,13 +55,13 @@
55
55
  * | `--json` | - | Output logs as JSON lines |
56
56
  * | `--lang` | - | Language for messages |
57
57
  *
58
- * **Note on `--working-directory`**: Many MCP clients (Cursor, Claude Desktop) spawn servers from the
58
+ * **Note on `--project-directory`**: Many MCP clients (Cursor, Claude Desktop) spawn servers from the
59
59
  * user's home directory (`~`) rather than the project directory. This flag is used for:
60
60
  * - Auto-discovery (detecting project type when no `--toolsets` or `--tools` are provided)
61
61
  * - Scaffolding tools (creating files in the correct project location)
62
62
  * - Any tool that needs to operate on the project directory
63
63
  *
64
- * Use `--working-directory` or `SFCC_WORKING_DIRECTORY` env var to specify the actual project path.
64
+ * Use `--project-directory` or `SFCC_PROJECT_DIRECTORY` env var to specify the actual project path.
65
65
  *
66
66
  * ## Configuration
67
67
  *
@@ -233,7 +233,7 @@ export default class McpServerCommand extends BaseCommand {
233
233
  * Priority (highest to lowest):
234
234
  * 1. CLI flags (--server, --username, --api-key, etc.)
235
235
  * 2. Environment variables (SFCC_SERVER, SFCC_USERNAME, SFCC_MRT_API_KEY, etc.)
236
- * 3. dw.json file (via --config flag or auto-discovered from --working-directory)
236
+ * 3. dw.json file (via --config flag or auto-discovered from --project-directory)
237
237
  * 4. ~/.mobify file (for MRT API key)
238
238
  */
239
239
  loadConfiguration() {
@@ -298,7 +298,7 @@ export default class McpServerCommand extends BaseCommand {
298
298
  allowNonGaTools: this.flags['allow-non-ga-tools'],
299
299
  configPath: this.flags.config,
300
300
  // Working directory for auto-discovery. oclif handles flag with env fallback.
301
- workingDirectory: this.flags['working-directory'],
301
+ workingDirectory: this.flags['project-directory'],
302
302
  };
303
303
  // Add toolsets to telemetry attributes
304
304
  if (this.telemetry && startupFlags.toolsets) {
package/dist/registry.js CHANGED
@@ -95,13 +95,13 @@ export function createToolRegistry(loadServices) {
95
95
  */
96
96
  async function performAutoDiscovery(flags, reason) {
97
97
  const logger = getLogger();
98
- // Working directory from --working-directory flag or SFCC_WORKING_DIRECTORY env var
98
+ // Working directory from --project-directory flag or SFCC_PROJECT_DIRECTORY env var
99
99
  const workingDirectory = flags.workingDirectory ?? process.cwd();
100
100
  // Warn if working directory wasn't explicitly configured
101
101
  if (!flags.workingDirectory) {
102
- logger.warn({ cwd: workingDirectory }, 'No --working-directory flag or SFCC_WORKING_DIRECTORY env var provided. ' +
102
+ logger.warn({ cwd: workingDirectory }, 'No --project-directory flag or SFCC_PROJECT_DIRECTORY env var provided. ' +
103
103
  'MCP clients like Cursor and Claude Desktop often spawn servers from ~ instead of the project directory. ' +
104
- 'Set --working-directory or SFCC_WORKING_DIRECTORY for reliable auto-discovery.');
104
+ 'Set --project-directory or SFCC_PROJECT_DIRECTORY for reliable auto-discovery.');
105
105
  }
106
106
  const detectionResult = await detectWorkspaceType(workingDirectory);
107
107
  // Map all detected project types to MCP toolsets (union)
@@ -506,7 +506,7 @@ export function resolveComponent(input, workspaceRoot, searchPaths) {
506
506
  `Full path checked: ${fullPath}\n\n` +
507
507
  `Tips:\n` +
508
508
  ` 1. Use component name instead (e.g., "ProductCard") for automatic discovery\n` +
509
- ` 2. If components are in a different repo, set --working-directory flag or SFCC_WORKING_DIRECTORY env var`);
509
+ ` 2. If components are in a different repo, set --project-directory flag or SFCC_PROJECT_DIRECTORY env var`);
510
510
  }
511
511
  // Treat as component name - search for it
512
512
  const found = findComponentByName(input, workspaceRoot, searchPaths);
@@ -528,7 +528,7 @@ export function resolveComponent(input, workspaceRoot, searchPaths) {
528
528
  ` 1. Provide full path: component: "src/components/ProductCard.tsx"\n` +
529
529
  ` 2. Add custom search: searchPaths: ["packages/retail/src"]\n` +
530
530
  ` 3. Check component name spelling and casing\n` +
531
- ` 4. If components are in a different repo, set --working-directory flag or SFCC_WORKING_DIRECTORY env var`);
531
+ ` 4. If components are in a different repo, set --project-directory flag or SFCC_PROJECT_DIRECTORY env var`);
532
532
  }
533
533
  return found;
534
534
  }
@@ -99,11 +99,14 @@
99
99
  "multiple": false,
100
100
  "type": "option"
101
101
  },
102
- "working-directory": {
103
- "description": "Project working directory",
104
- "env": "SFCC_WORKING_DIRECTORY",
102
+ "project-directory": {
103
+ "aliases": [
104
+ "working-directory"
105
+ ],
106
+ "description": "Project directory",
107
+ "env": "SFCC_PROJECT_DIRECTORY",
105
108
  "helpGroup": "GLOBAL",
106
- "name": "working-directory",
109
+ "name": "project-directory",
107
110
  "hasDynamicHelp": false,
108
111
  "multiple": false,
109
112
  "type": "option"
@@ -384,5 +387,5 @@
384
387
  "enableJsonFlag": false
385
388
  }
386
389
  },
387
- "version": "0.4.0"
390
+ "version": "0.4.1"
388
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/b2c-dx-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "MCP server for B2C Commerce Cloud developer experience tools",
5
5
  "author": "Salesforce",
6
6
  "license": "MIT",
@@ -79,7 +79,7 @@
79
79
  "ts-morph": "^27.0.0",
80
80
  "yaml": "2.8.1",
81
81
  "zod": "3.25.76",
82
- "@salesforce/b2c-tooling-sdk": "0.5.0"
82
+ "@salesforce/b2c-tooling-sdk": "0.5.1"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@eslint/compat": "^1",