@salesforce/b2c-dx-mcp 3.0.0 → 3.1.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 (59) hide show
  1. package/content/guidance/b2c-cli/b2c-config/SKILL.md +18 -1
  2. package/content/guidance/b2c-cli/b2c-job/SKILL.md +2 -0
  3. package/content/guidance/b2c-cli/b2c-job/references/EXPORT.md +9 -3
  4. package/content/guidance/b2c-cli/b2c-job/references/IMPORT.md +12 -0
  5. package/content/guidance/b2c-cli/b2c-mrt/SKILL.md +5 -4
  6. package/content/guidance/b2c-cli/b2c-mrt/references/BUNDLE-COMMANDS.md +21 -3
  7. package/content/guidance/b2c-cli/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +23 -0
  8. package/content/guidance/b2c-cli/b2c-webdav/SKILL.md +17 -0
  9. package/content/guidance/index.json +18 -18
  10. package/content/guidance/mcp/scapi/SKILL.md +46 -14
  11. package/dist/commands/mcp.d.ts +1 -0
  12. package/dist/commands/mcp.js +7 -0
  13. package/dist/guidance.js +0 -2
  14. package/dist/registry.js +1 -1
  15. package/dist/server-context.d.ts +2 -0
  16. package/dist/server-context.js +4 -0
  17. package/dist/server.d.ts +2 -4
  18. package/dist/server.js +16 -3
  19. package/dist/tools/scapi/execution-registry.d.ts +62 -0
  20. package/dist/tools/scapi/execution-registry.js +303 -0
  21. package/dist/tools/scapi/index.d.ts +2 -1
  22. package/dist/tools/scapi/index.js +2 -2
  23. package/dist/tools/scapi/scapi-code.d.ts +2 -1
  24. package/dist/tools/scapi/scapi-code.js +71 -34
  25. package/dist/utils/types.d.ts +10 -3
  26. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-CLhGwQTn.d.mts +2 -1
  27. package/node_modules/@modelcontextprotocol/server/dist/createMcpHandler-dBHMsxwf.d.cts +2 -1
  28. package/node_modules/@modelcontextprotocol/server/dist/mcp-D7GmuPnv.cjs +1 -1
  29. package/node_modules/@modelcontextprotocol/server/dist/mcp-DXXb3Vv3.mjs +1 -1
  30. package/node_modules/@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs +2 -0
  31. package/node_modules/@modelcontextprotocol/server/dist/src-STyD_Vvf.cjs +2 -0
  32. package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +22 -0
  33. package/node_modules/@salesforce/b2c-agent-plugins/README.md +4 -2
  34. package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
  35. package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
  36. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
  37. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
  38. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +18 -1
  39. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/SKILL.md +2 -0
  40. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/EXPORT.md +9 -3
  41. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-job/references/IMPORT.md +12 -0
  42. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/SKILL.md +5 -4
  43. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/references/BUNDLE-COMMANDS.md +21 -3
  44. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-mrt/references/ENVIRONMENT-COMMANDS.md +23 -0
  45. package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-webdav/SKILL.md +17 -0
  46. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
  47. package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
  48. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/.codex-plugin/plugin.json +41 -0
  49. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/README.md +35 -0
  50. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/assets/logo.svg +31 -0
  51. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/plugin.json +45 -0
  52. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/skills/using-b2c-tooling-sdk/SKILL.md +226 -0
  53. package/node_modules/@salesforce/b2c-agent-plugins/b2c-python-sdk/skills/using-b2c-tooling-sdk/references/api-catalog.md +154 -0
  54. package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
  55. package/node_modules/@salesforce/b2c-agent-plugins/plugins.json +3 -0
  56. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +1 -1
  57. package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +1 -1
  58. package/oclif.manifest.json +8 -1
  59. package/package.json +3 -3
@@ -31,6 +31,23 @@ Sources, in resolution order (highest priority first):
31
31
 
32
32
  For unexpected values, inspect resolved configuration and sources with `config_inspect` or `b2c setup inspect`.
33
33
 
34
+ ### Storefront Next Environment Compatibility
35
+
36
+ The resolver accepts these Storefront Next variables as fallbacks, so a project
37
+ can reuse its existing B2C Commerce and SLAS configuration:
38
+
39
+ | Storefront Next variable | Resolved field | Default toolkit variable |
40
+ | -------------------------------------------- | ------------------ | ------------------------- |
41
+ | `PUBLIC__app__commerce__api__clientId` | `slasClientId` | `SFCC_SLAS_CLIENT_ID` |
42
+ | `PUBLIC__app__commerce__api__organizationId` | `tenantId` | `SFCC_TENANT_ID` |
43
+ | `PUBLIC__app__commerce__api__shortCode` | `shortCode` | `SFCC_SHORTCODE` |
44
+ | `COMMERCE_API_SLAS_SECRET` | `slasClientSecret` | `SFCC_SLAS_CLIENT_SECRET` |
45
+ | `PUBLIC__app__defaultSiteId` | `siteId` | `SFCC_SITE_ID` |
46
+ | `MRT_PROJECT` | `mrtProject` | `MRT_PROJECT` |
47
+ | `MRT_TARGET` | `mrtEnvironment` | `MRT_ENVIRONMENT` |
48
+
49
+ Explicit flags and default toolkit variables win over these fallbacks.
50
+
34
51
  ### Shared Global Default
35
52
 
36
53
  Use a shared fallback when the same `dw.json`-format file should work across the CLI, MCP server, and B2C DX VS Code extension:
@@ -263,7 +280,7 @@ The `setup inspect` command displays configuration organized by category:
263
280
  - **Managed Runtime (MRT)**: mrtProject, mrtEnvironment, mrtApiKey, mrtOrigin (if set)
264
281
  - **Project**: configured deployment, content, and documentation defaults
265
282
  - **Metadata**: siteId, instanceName, and projectDirectory (only shown when configured)
266
- - **Safety**: safety configuration (only shown when configured)
283
+ - **Safety**: effective level, level-based confirmation, source column, and rule count after combining instance, global-file, and environment settings (only shown when configured). `SafetyFile` identifies the global file listed in Sources; `SafetyEnv` identifies environment settings. Use `--verbose` for numbered rules in matching order with their sources, or `--json` for the complete effective safety object. Explicit confirmation rules still apply when level confirmation is disabled.
267
284
  - **Sources**: List of all configuration sources that were loaded
268
285
 
269
286
  Each value shows its source in brackets:
@@ -39,7 +39,9 @@ Deletion removes completed execution records; it does not cancel jobs.
39
39
 
40
40
  ```bash
41
41
  b2c job import ./archive --show-log
42
+ b2c job import ./storefront-export.zip --wait-for-storefront
42
43
  b2c job export --site MySite --site-data campaigns_and_promotions --output ./export
44
+ b2c job export --storefront my-storefront --output ./export
43
45
  ```
44
46
 
45
47
  Import/export wait by default and transfer files over WebDAV. Jobs prefer SCAPI
@@ -39,6 +39,9 @@ b2c job export --site RefArch
39
39
  # export a site with specific site data units
40
40
  b2c job export --site RefArch --site-data content,site_preferences
41
41
 
42
+ # export one composable storefront by storefront name
43
+ b2c job export --storefront my-storefront
44
+
42
45
  # export multiple sites
43
46
  b2c job export --site RefArch --site SiteGenesis --site-data campaigns_and_promotions
44
47
 
@@ -98,6 +101,7 @@ Do not require a temporary directory and copy step for export-based migrations.
98
101
  | Flag | Description |
99
102
  | ------------------ | ------------------------------------------------------------------------------ |
100
103
  | `--site` | Site IDs to export (use `--site-data` to pick specific units, defaults to all) |
104
+ | `--storefront` | One composable storefront name |
101
105
  | `--catalog` | Catalog IDs |
102
106
  | `--library` | Library IDs |
103
107
  | `--inventory-list` | Inventory list IDs |
@@ -106,10 +110,12 @@ Do not require a temporary directory and copy step for export-based migrations.
106
110
 
107
111
  **Site data units** (use with `--site-data`):
108
112
 
109
- `ab_tests`, `active_data_feeds`, `all`, `cache_settings`, `campaigns_and_promotions`, `content`, `coupons`, `custom_objects`, `customer_cdn_settings`, `customer_groups`, `distributed_commerce_extensions`, `dynamic_file_resources`, `gift_certificates`, `ocapi_settings`, `payment_methods`, `payment_processors`, `redirect_urls`, `search_settings`, `shipping`, `site_descriptor`, `site_preferences`, `sitemap_settings`, `slots`, `sorting_rules`, `source_codes`, `static_dynamic_alias_mappings`, `stores`, `tax`, `url_rules`
113
+ `ab_tests`, `active_data_feeds`, `all`, `cache_settings`, `campaigns_and_promotions`, `channels`, `commerce_feature_states`, `content`, `coupons`, `custom_objects`, `customer_cdn_settings`, `customer_groups`, `distributed_commerce_extensions`, `dynamic_file_resources`, `gift_certificates`, `ocapi_settings`, `payment_methods`, `payment_processors`, `point_of_sale_channels`, `redirect_urls`, `search_settings`, `shipping`, `site_descriptor`, `site_preferences`, `sitemap_settings`, `slots`, `sorting_rules`, `source_codes`, `static_dynamic_alias_mappings`, `stores`, `tax`, `url_rules`
110
114
 
111
115
  **Global data units** (use with `--global-data`):
112
116
 
113
- `access_roles`, `all`, `csc_settings`, `csrf_whitelists`, `custom_preference_groups`, `custom_quota_settings`, `custom_types`, `geolocations`, `global_custom_objects`, `job_schedules`, `job_schedules_deprecated`, `locales`, `meta_data`, `oauth_providers`, `ocapi_settings`, `page_meta_tags`, `preferences`, `price_adjustment_limits`, `services`, `sorting_rules`, `static_resources`, `system_type_definitions`, `users`, `webdav_client_permissions`
117
+ `access_roles`, `all`, `csc_settings`, `csrf_whitelists`, `custom_preference_groups`, `custom_quota_settings`, `custom_types`, `event_routing`, `geolocations`, `global_custom_objects`, `job_schedules`, `job_schedules_deprecated`, `locales`, `meta_data`, `oauth_providers`, `ocapi_settings`, `page_meta_tags`, `preferences`, `price_adjustment_limits`, `services`, `sorting_rules`, `static_resources`, `system_type_definitions`, `users`, `webdav_client_permissions`
118
+
119
+ For full control over the export configuration (including `assignments`, `catalog_static_resources`, `library_static_resources`, and `customer_lists`), use `--data-units` with a JSON string matching the `ExportDataUnitsConfiguration` shape. The `storefronts` object is keyed by storefront name and may select only one storefront.
114
120
 
115
- For full control over the export configuration (including `catalog_static_resources`, `library_static_resources`, and `customer_lists`), use `--data-units` with a JSON string matching the `ExportDataUnitsConfiguration` shape.
121
+ The `storefronts` export data unit requires B2C Commerce 26.10 or later. Failed storefront exports include a version note alongside the original error; check the instance version when the server rejects this data unit.
@@ -23,12 +23,24 @@ b2c job import existing-archive.zip --remote
23
23
  # show job log on failure
24
24
  b2c job import ./my-site-data --show-log
25
25
 
26
+ # wait for Storefront Next post-import setup after the archive import succeeds
27
+ b2c job import ./storefront-export.zip --wait-for-storefront
28
+
26
29
  # import only a subset of a directory (extra positionals are paths/globs
27
30
  # resolved against the directory; preserves layout inside the archive)
28
31
  b2c job import ./my-site-data sites/RefArch libraries/mylib
29
32
  b2c job import ./my-site-data 'libraries/**'
30
33
  ```
31
34
 
35
+ `--wait-for-storefront` snapshots existing setup-job executions before import,
36
+ waits for the archive import to succeed, and then polls briefly for the newly
37
+ triggered `sfcc-post-import-setup-storefront` execution before waiting for it to
38
+ finish. It cannot be combined with `--no-wait`. If no new setup execution appears
39
+ within 60 seconds, the CLI checks available import logs and includes `[DATAERROR]`
40
+ entries in the timeout error. Logs are downloaded for this diagnostic only on
41
+ discovery timeout. Resolve any reported data errors before retrying; if logs are
42
+ unavailable or contain no data errors, inspect the import contents and recent job executions.
43
+
32
44
  ### Import Sets
33
45
 
34
46
  `job import-set` first applies site import/export archives from discovered cartridge `metadata/` sources, then applies archives in `./migrations`, and skips archives already recorded on the target instance:
@@ -17,15 +17,16 @@ Run `b2c setup inspect` to see the resolved configuration and which source provi
17
17
 
18
18
  ### MRT Backends (legacy vs SCAPI)
19
19
 
20
- Most MRT commands run against the legacy MRT Cloud API (API key). Two commands — `mrt bundle history` and `mrt bundle deploy <bundleId>` — can also run over the SCAPI MRT backend. Choose with `--mrt-backend` (`MRT_BACKEND` / `SFCC_MRT_BACKEND`, or `mrtBackend` in `dw.json`):
20
+ Most MRT commands run against the legacy MRT Cloud API (API key). Several commands can also run over the SCAPI MRT backend: `mrt bundle history`, `mrt bundle list`, `mrt bundle deploy` (both the local-build push and deploying an existing `<bundleId>`), and the `mrt env var` family (`list` / `set` / `push` / `delete`). Choose with `--mrt-backend` (`MRT_BACKEND` / `SFCC_MRT_BACKEND`, or `mrtBackend` in `dw.json`):
21
21
 
22
- - `auto` (default) — use SCAPI when it's configured (`--short-code` + `--tenant-id` + client-credentials or JWT Bearer auth; scopes `sfcc.storefront.deployments[.rw]`), otherwise legacy. Falls back to legacy on safe pre-execution errors.
22
+ - `auto` (default) — use SCAPI when it's configured (`--short-code` + `--tenant-id` + client-credentials or JWT Bearer auth), otherwise legacy. Falls back to legacy on safe pre-execution errors. Each command requests its own scopes: bundle commands use `sfcc.storefront.deployments[.rw]`; env var commands use `sfcc.storefront.environments[.rw]` (reads accept either tier, writes require `.rw`).
23
23
  - `legacy` — always the MRT Cloud API.
24
- - `scapi` — always SCAPI, with no fallback; errors if prerequisites are missing. Also errors on unsupported commands and on the local-build push path (`deploy` with no bundle ID).
24
+ - `scapi` — always SCAPI, with no fallback; errors if prerequisites are missing. Also errors on unsupported commands (every MRT command except the bundle and env var commands above).
25
25
 
26
26
  Notes:
27
27
 
28
- - Under `--json`, these commands emit the **serving backend's native shape** (legacy `{count, next, previous, deployments}` vs SCAPI `{limit, offset, total, data}`). The human table is normalized; `--json` is not. Pin `legacy` or `scapi` when a script needs a stable shape.
28
+ - Under `--json`, these commands emit the **serving backend's native shape** (e.g. `bundle history` is legacy `{count, next, previous, deployments}` vs SCAPI `{limit, offset, total, data}`; `env var list` is legacy `{count, variables}` vs the SCAPI native environment-variables map). The human table is normalized; `--json` is not. Pin `legacy` or `scapi` when a script needs a stable shape.
29
+ - Env vars over SCAPI use the Storefront Environments API. `set` and `delete` apply a merge-PATCH (only the keys you pass change; `delete` sends the key with a `null` value); values are always masked by both backends. `push` resolves the backend once from its initial read and pins every write to it, so a single `push` never crosses backends.
29
30
  - Legacy-only flags (`--api-key`, `--cloud-origin` / `-u`, `--credentials-file` / `-c`) are ignored — with a warning — when SCAPI serves the request.
30
31
  - `--storefront` (long) and `-s` (short) are aliases of `--project` / `-p` — the SCAPI storefront ID is the project slug, so all four are interchangeable on every `mrt` command. On `mrt project create` this flag sets the new project's slug (auto-generated from the name if omitted); `mrt bundle save` uses `-d` for `--save-dir`, keeping `-s` free for the storefront alias.
31
32
 
@@ -31,11 +31,22 @@ b2c mrt bundle deploy -p my-storefront --ssr-param SSRProxyPath=/api
31
31
  b2c mrt bundle deploy -p my-storefront \
32
32
  --ssr-param SSRProxyPath=/api \
33
33
  --ssr-param SSRTimeout=30000
34
+
35
+ # Push a local build and deploy it via the SCAPI backend
36
+ b2c mrt bundle deploy -p my-storefront -e staging --mrt-backend scapi
37
+
38
+ # Push via SCAPI with a custom v2 archive layout
39
+ b2c mrt bundle deploy -p my-storefront --mrt-backend scapi --root-dir bld --match-mode ignore_missing
40
+
41
+ # Push via the legacy v2 endpoint (opt in with --v2)
42
+ b2c mrt bundle deploy -p my-storefront --mrt-backend legacy --v2 --match-mode ignore_missing
34
43
  ```
35
44
 
45
+ **Bundle format:** SCAPI always uploads the v2 format. The legacy backend defaults to v1; pass `--v2` to upload through the legacy v2 endpoint (upload, plus a separate deploy when `-e` is given). `--root-dir`, `--config-path`, and `--match-mode` control the v2 archive layout and only take effect on a v2 upload — on a legacy v1 push they are ignored and the command warns (pass `--v2` to enable them). `b2c mrt bundle deploy --v2` performs the same v2 upload as `b2c mrt bundle upload-v2` and can also deploy in one step.
46
+
36
47
  ### Deploy Existing Bundle
37
48
 
38
- Deploying an existing bundle (with a bundle ID) is backend-aware — it honors `--mrt-backend` (`auto` / `legacy` / `scapi`). Pushing a local build is legacy-pinned. See the "MRT Backends" section in the skill overview.
49
+ Both the local-build push and deploying an existing bundle (with a bundle ID) are backend-aware — they honor `--mrt-backend` (`auto` / `legacy` / `scapi`). For a local-build push under `auto`, a safe SCAPI upload failure falls back to legacy, but once the bundle is uploaded a later deploy failure is not retried on legacy (so a bundle is never uploaded twice). See the "MRT Backends" section in the skill overview.
39
50
 
40
51
  ```bash
41
52
  # Deploy existing bundle by ID
@@ -55,6 +66,10 @@ b2c mrt bundle deploy 12345 -p my-storefront -e production --mrt-backend scapi -
55
66
  | `--build-dir`, `-b` | Path to build directory | `build` |
56
67
  | `--ssr-only` | Server-only file patterns | `ssr.js,ssr.mjs,server/**/*` |
57
68
  | `--ssr-shared` | Shared file patterns | `static/**/*,client/**/*` |
69
+ | `--v2` | Use the v2 bundle format/endpoint (SCAPI always uses v2; opt in on legacy) | `false` |
70
+ | `--root-dir` | Archive path prefix for built files and the config file (v2 uploads only) | `bld` |
71
+ | `--config-path` | In-archive config file path, relative to `--root-dir` (v2 uploads only) | `.mrt/config.json` |
72
+ | `--match-mode` | Handling of SSR patterns matching no files — `strict` or `ignore_missing` (v2 uploads only) | `strict` |
58
73
  | `--node-version`, `-n` | Node.js version for SSR | `24.x` |
59
74
  | `--ssr-param` | SSR parameters (key=value, can repeat) | |
60
75
 
@@ -102,16 +117,19 @@ b2c mrt bundle upload-v2 -p my-storefront --dependencies @./deps.json --cc-overr
102
117
 
103
118
  ## Bundle List
104
119
 
105
- List bundles in a project.
120
+ List bundles in a project. Backend-aware (`--mrt-backend`); under `--json` it returns the serving backend's native response verbatim (legacy vs SCAPI shapes differ).
106
121
 
107
122
  ```bash
108
123
  b2c mrt bundle list --project my-storefront
109
124
  b2c mrt bundle list -p my-storefront --limit 10
110
125
  b2c mrt bundle list -p my-storefront --offset 20
111
126
  b2c mrt bundle list -p my-storefront --json
127
+
128
+ # Force the SCAPI backend
129
+ b2c mrt bundle list -p my-storefront --mrt-backend scapi
112
130
  ```
113
131
 
114
- **Output columns:** Bundle ID, Message, Status, Created
132
+ **Output columns:** Bundle ID, Message, Status, User, Created
115
133
 
116
134
  ## Bundle History
117
135
 
@@ -110,11 +110,16 @@ b2c mrt env b2c -p my-storefront -e production --clear-sites
110
110
 
111
111
  ## Environment Variables
112
112
 
113
+ The `mrt env var` commands (`list` / `set` / `push` / `delete`) are backend-aware: they honor `--mrt-backend` (`auto` / `legacy` / `scapi`) and, over SCAPI, use the Storefront Environments API (scopes `sfcc.storefront.environments` for reads, `sfcc.storefront.environments.rw` for writes). See the [MRT Backends](../SKILL.md#mrt-backends-legacy-vs-scapi) section for backend selection. Values are always masked by both backends. `set` and `delete` apply a merge-PATCH — only the keys you pass change (`delete` sends the key with a `null` value); other variables are preserved. Under `--json`, each command returns the serving backend's native shape.
114
+
113
115
  ### List Variables
114
116
 
115
117
  ```bash
116
118
  b2c mrt env var list --project my-storefront --environment production
117
119
  b2c mrt env var list -p my-storefront -e staging --json
120
+
121
+ # Force the SCAPI backend
122
+ b2c mrt env var list -p my-storefront -e staging --mrt-backend scapi
118
123
  ```
119
124
 
120
125
  ### Set Variables
@@ -130,6 +135,9 @@ b2c mrt env var set API_KEY=secret DEBUG=true FEATURE_FLAG=enabled \
130
135
  # Value with spaces (use quotes)
131
136
  b2c mrt env var set "MESSAGE=hello world" -p my-storefront -e production
132
137
 
138
+ # Force the SCAPI backend
139
+ b2c mrt env var set API_KEY=secret -p my-storefront -e staging --mrt-backend scapi
140
+
133
141
  # Using environment variables for auth
134
142
  export MRT_API_KEY=your-api-key
135
143
  export MRT_PROJECT=my-storefront
@@ -137,10 +145,25 @@ export MRT_ENVIRONMENT=staging
137
145
  b2c mrt env var set MY_VAR=value
138
146
  ```
139
147
 
148
+ ### Push Variables from a .env File
149
+
150
+ Diff a local `.env` file against the remote environment and apply the additions/updates (remote-only variables are not deleted). `push` resolves the backend once from its initial read and pins every write to it; over SCAPI the changes are applied as a single merge-PATCH.
151
+
152
+ ```bash
153
+ # Push ./.env, with confirmation prompt
154
+ b2c mrt env var push -p my-storefront -e production
155
+
156
+ # Push a custom file, skipping confirmation, over SCAPI
157
+ b2c mrt env var push -p my-storefront -e staging --file config/.env --yes --mrt-backend scapi
158
+ ```
159
+
140
160
  ### Delete Variable
141
161
 
142
162
  ```bash
143
163
  b2c mrt env var delete MY_VAR -p my-storefront -e production
164
+
165
+ # Force the SCAPI backend
166
+ b2c mrt env var delete MY_VAR -p my-storefront -e production --mrt-backend scapi
144
167
  ```
145
168
 
146
169
  ## URL Redirects
@@ -37,11 +37,28 @@ The `--root` flag specifies the WebDAV directory:
37
37
  - `catalogs` - Product catalogs
38
38
  - `libraries` - Content libraries
39
39
  - `static` - Static resources
40
+ - `dynamic` - Site-specific files, including Velocity templates
40
41
  - `logs` - Application logs
41
42
  - `securitylogs` - Security logs
42
43
 
43
44
  ## Examples
44
45
 
46
+ ### Dynamic Site Files
47
+
48
+ Use `--root=dynamic` with the site ID as the first remote path segment. For example,
49
+ `MySite/mockData/mock.vm` resolves to `Sites/Dynamic/MySite/mockData/mock.vm`.
50
+ This location holds site-specific files independently of code versions, including
51
+ Velocity templates used by `dw.template.Velocity.renderTemplate()`.
52
+
53
+ ```bash
54
+ b2c webdav ls --root=dynamic MySite/
55
+ b2c webdav mkdir --root=dynamic MySite/mockData
56
+ b2c webdav put --root=dynamic ./mock.vm MySite/mockData/
57
+ b2c webdav get --root=dynamic MySite/mockData/mock.vm -o ./mock.vm
58
+ ```
59
+
60
+ The same root and site-prefixed paths work with `rm`, `zip`, and `unzip`.
61
+
45
62
  ### List Files
46
63
 
47
64
  ```bash
@@ -129,11 +129,11 @@
129
129
  "description": "Configure B2C CLI/MCP authentication, instances, and project defaults; troubleshoot missing credentials, wrong targets, or configuration precedence. Routine inspection can use config_inspect or b2c setup inspect directly.",
130
130
  "entrypoint": "SKILL.md",
131
131
  "source": "skills/b2c-cli/skills/b2c-config/SKILL.md",
132
- "headings": "B2C Config Skill | How the CLI Discovers Configuration | Shared Global Default | MCP Project Context | `dw.json` Key Casing | Authentication | `--user-auth` Flag | Tenant ID and Organization ID | Inspecting Configuration | When to Use | View Current Configuration | Debug Sensitive Values | JSON Output for Scripting | IDE Integration | Managing Instances | List Configured Instances | Create a New Instance | Switch Active Instance | Remove an Instance | Understanding the Output | Configuration Priority | Project Defaults in package.json | Troubleshooting | Command says \"credentials required\" or \"client-id is required\" | Command targets the wrong instance | `dw.json` is not being picked up | 401/403 errors on SCAPI/OCAPI calls | Missing `tenantId` / `shortCode` | MRT commands say \"API key required\" | Sensitive values masked in `setup inspect` | Missing values | Wrong source taking precedence | Still stuck | Getting Admin OAuth Tokens | More Commands",
132
+ "headings": "B2C Config Skill | How the CLI Discovers Configuration | Storefront Next Environment Compatibility | Shared Global Default | MCP Project Context | `dw.json` Key Casing | Authentication | `--user-auth` Flag | Tenant ID and Organization ID | Inspecting Configuration | When to Use | View Current Configuration | Debug Sensitive Values | JSON Output for Scripting | IDE Integration | Managing Instances | List Configured Instances | Create a New Instance | Switch Active Instance | Remove an Instance | Understanding the Output | Configuration Priority | Project Defaults in package.json | Troubleshooting | Command says \"credentials required\" or \"client-id is required\" | Command targets the wrong instance | `dw.json` is not being picked up | 401/403 errors on SCAPI/OCAPI calls | Missing `tenantId` / `shortCode` | MRT commands say \"API key required\" | Sensitive values masked in `setup inspect` | Missing values | Wrong source taking precedence | Still stuck | Getting Admin OAuth Tokens | More Commands",
133
133
  "files": [
134
134
  {
135
135
  "path": "SKILL.md",
136
- "bytes": 22816
136
+ "bytes": 24384
137
137
  }
138
138
  ]
139
139
  },
@@ -231,11 +231,11 @@
231
231
  "files": [
232
232
  {
233
233
  "path": "references/EXPORT.md",
234
- "bytes": 5933
234
+ "bytes": 6540
235
235
  },
236
236
  {
237
237
  "path": "references/IMPORT.md",
238
- "bytes": 2106
238
+ "bytes": 2904
239
239
  },
240
240
  {
241
241
  "path": "references/RUN-AND-MONITOR.md",
@@ -243,7 +243,7 @@
243
243
  },
244
244
  {
245
245
  "path": "SKILL.md",
246
- "bytes": 2740
246
+ "bytes": 2861
247
247
  }
248
248
  ]
249
249
  },
@@ -284,15 +284,15 @@
284
284
  "description": "Deploy and manage Managed Runtime (MRT) storefronts using the b2c CLI. Use this skill whenever the user needs to deploy a PWA Kit bundle, manage MRT environments and projects, set environment variables, configure URL redirects, or manage organization connections — even if they just say \"deploy my PWA\" or \"set up a staging environment\".",
285
285
  "entrypoint": "SKILL.md",
286
286
  "source": "skills/b2c-cli/skills/b2c-mrt/SKILL.md",
287
- "headings": "MRT Bundle Commands Reference | Bundle Deploy | Push Local Build | Deploy Existing Bundle | Bundle Upload (v2) | Bundle List | Bundle History | Bundle Download | Common Workflows | Development to Production Pipeline | Rollback to Previous Bundle | Download and Inspect Bundle | MRT Environment Commands Reference | Environment Management | List Environments | Create Environment | Get Environment Details | Update Environment | Delete Environment | Invalidate Cache | B2C Commerce Connection | Environment Variables | List Variables | Set Variables | Delete Variable | URL Redirects | List Redirects | Create Redirect | Delete Redirect | Clone Redirects | Access Control Headers | List Access Control Headers | MRT Project Commands Reference | Project Management | List Projects | Create Project | Get Project Details | Update Project | Delete Project | Member Management | List Members | Add Member | Get Member Details | Update Member Role | Remove Member | Deployment Notifications | List Notifications | Create Notification | Get Notification Details | Update Notification | Delete Notification | B2C MRT Skill | Configuration & Authentication | MRT Backends (legacy vs SCAPI) | Command Structure | Quick Examples | Deploy a Bundle | Manage Environments | Environment Variables | View Deployment History | Organization Members and Certificates | Project Management | URL Redirects | Configuration | dw.json | Environment Variables | ~/.mobify Config | Detailed References | More Commands",
287
+ "headings": "MRT Bundle Commands Reference | Bundle Deploy | Push Local Build | Deploy Existing Bundle | Bundle Upload (v2) | Bundle List | Bundle History | Bundle Download | Common Workflows | Development to Production Pipeline | Rollback to Previous Bundle | Download and Inspect Bundle | MRT Environment Commands Reference | Environment Management | List Environments | Create Environment | Get Environment Details | Update Environment | Delete Environment | Invalidate Cache | B2C Commerce Connection | Environment Variables | List Variables | Set Variables | Push Variables from a .env File | Delete Variable | URL Redirects | List Redirects | Create Redirect | Delete Redirect | Clone Redirects | Access Control Headers | List Access Control Headers | MRT Project Commands Reference | Project Management | List Projects | Create Project | Get Project Details | Update Project | Delete Project | Member Management | List Members | Add Member | Get Member Details | Update Member Role | Remove Member | Deployment Notifications | List Notifications | Create Notification | Get Notification Details | Update Notification | Delete Notification | B2C MRT Skill | Configuration & Authentication | MRT Backends (legacy vs SCAPI) | Command Structure | Quick Examples | Deploy a Bundle | Manage Environments | Environment Variables | View Deployment History | Organization Members and Certificates | Project Management | URL Redirects | Configuration | dw.json | Environment Variables | ~/.mobify Config | Detailed References | More Commands",
288
288
  "files": [
289
289
  {
290
290
  "path": "references/BUNDLE-COMMANDS.md",
291
- "bytes": 7241
291
+ "bytes": 9061
292
292
  },
293
293
  {
294
294
  "path": "references/ENVIRONMENT-COMMANDS.md",
295
- "bytes": 5493
295
+ "bytes": 7026
296
296
  },
297
297
  {
298
298
  "path": "references/PROJECT-COMMANDS.md",
@@ -300,7 +300,7 @@
300
300
  },
301
301
  {
302
302
  "path": "SKILL.md",
303
- "bytes": 7994
303
+ "bytes": 8753
304
304
  }
305
305
  ]
306
306
  },
@@ -417,11 +417,11 @@
417
417
  "description": "List, upload, download, and manage files on B2C Commerce instances via WebDAV. Use this skill whenever the user needs to upload files to IMPEX directories, download exports from an instance, list remote files, create or delete directories, zip or unzip files on the server, manage file transfers to sandboxes, or browse instance file systems — even if they just say \"upload a file to the instance\" or \"check what's in the IMPEX folder\".",
418
418
  "entrypoint": "SKILL.md",
419
419
  "source": "skills/b2c-cli/skills/b2c-webdav/SKILL.md",
420
- "headings": "B2C WebDAV Skill | MCP equivalent | Configuration & Authentication | WebDAV Roots | Examples | List Files | Download Files | Upload Files | Create Directories | Delete Files | Delete Cartridges | Zip/Unzip Remote Files | Import-Set Managed State | More Commands | Related Skills",
420
+ "headings": "B2C WebDAV Skill | MCP equivalent | Configuration & Authentication | WebDAV Roots | Examples | Dynamic Site Files | List Files | Download Files | Upload Files | Create Directories | Delete Files | Delete Cartridges | Zip/Unzip Remote Files | Import-Set Managed State | More Commands | Related Skills",
421
421
  "files": [
422
422
  {
423
423
  "path": "SKILL.md",
424
- "bytes": 6088
424
+ "bytes": 6788
425
425
  }
426
426
  ]
427
427
  },
@@ -1313,7 +1313,7 @@
1313
1313
  "title": "b2c-config",
1314
1314
  "description": "MCP configuration, authentication setup, external access grants, and masked inspection. Use for setup or unresolved configuration issues; routine config_inspect needs no skill read.",
1315
1315
  "entrypoint": "SKILL.md",
1316
- "source": "guidance/mcp/b2c-config/SKILL.md",
1316
+ "source": "packages/b2c-dx-mcp/skills/b2c-config/SKILL.md",
1317
1317
  "headings": "MCP Configuration | Inspect resolved values | Where configuration comes from | Setup and access | CLI, when requested | Further reading",
1318
1318
  "files": [
1319
1319
  {
@@ -1329,7 +1329,7 @@
1329
1329
  "title": "MCP CIP Analytics",
1330
1330
  "description": "Discover and run CIP reports or analytics SQL for sales, merchandising, and technical operations. Resolve warehouse access, bound results, and interpret site/date scope.",
1331
1331
  "entrypoint": "SKILL.md",
1332
- "source": "guidance/mcp/cip/SKILL.md",
1332
+ "source": "packages/b2c-dx-mcp/skills/cip/SKILL.md",
1333
1333
  "headings": "CIP analytics | Choose and discover | Configuration and access | Query and interpret",
1334
1334
  "files": [
1335
1335
  {
@@ -1345,7 +1345,7 @@
1345
1345
  "title": "MCP Debugger Usage",
1346
1346
  "description": "Bounded debugger capture, request triggering, state inspection, and reliable session cleanup.",
1347
1347
  "entrypoint": "SKILL.md",
1348
- "source": "guidance/mcp/debugger/SKILL.md",
1348
+ "source": "packages/b2c-dx-mcp/skills/debugger/SKILL.md",
1349
1349
  "headings": "MCP Debugger Usage | Prerequisites | Capture and cleanup | Stepping | Recovery | CLI or IDE, when requested",
1350
1350
  "files": [
1351
1351
  {
@@ -1361,8 +1361,8 @@
1361
1361
  "title": "MCP SCAPI Code Mode",
1362
1362
  "description": "Discover standard and live custom SCAPI contracts, compose Admin requests, and verify changes using configured authentication and safety rules.",
1363
1363
  "entrypoint": "SKILL.md",
1364
- "source": "guidance/mcp/scapi/SKILL.md",
1365
- "headings": "Custom Admin APIs | Live custom property definitions | Job review and investigation | Basic product creation | Join campaign assignments to promotions | Save a reusable workflow | Built-in SCAPI snippets | builtin/create-product | builtin/campaign-promotions | builtin/failed-job-triage | builtin/job-execution-review | builtin/job-execution-inspect | builtin/code-version-inspect | builtin/site-cartridge-inspect | Token exports for external clients | Account Manager | SLAS | Output and failures | SCAPI Code Mode | Discover | Task map | Tenant custom properties and APIs | Authentication | Compose and verify | Reusable workflows",
1364
+ "source": "packages/b2c-dx-mcp/skills/scapi/SKILL.md",
1365
+ "headings": "Custom Admin APIs | Live custom property definitions | Job review and investigation | Basic product creation | Join campaign assignments to promotions | Save a reusable workflow | Built-in SCAPI snippets | builtin/create-product | builtin/campaign-promotions | builtin/failed-job-triage | builtin/job-execution-review | builtin/job-execution-inspect | builtin/code-version-inspect | builtin/site-cartridge-inspect | Token exports for external clients | Account Manager | SLAS | Output and failures | SCAPI Code Mode | Discover | Task map | Tenant custom properties and APIs | Authentication | Compose and verify | Confirmation and cancellation | Reusable workflows",
1366
1366
  "files": [
1367
1367
  {
1368
1368
  "path": "references/custom-apis.md",
@@ -1398,7 +1398,7 @@
1398
1398
  },
1399
1399
  {
1400
1400
  "path": "SKILL.md",
1401
- "bytes": 9669
1401
+ "bytes": 12530
1402
1402
  }
1403
1403
  ],
1404
1404
  "featured": true
@@ -1409,7 +1409,7 @@
1409
1409
  "title": "server",
1410
1410
  "description": "B2C MCP setup, toolset customization, available capabilities, tool choice, and skill discovery.",
1411
1411
  "entrypoint": "SKILL.md",
1412
- "source": "guidance/mcp/server/SKILL.md",
1412
+ "source": "packages/b2c-dx-mcp/skills/server/SKILL.md",
1413
1413
  "headings": "Instance files and cartridge uploads | B2C MCP Server | Server configuration and tool availability | Tool choice and project configuration | Skills | Setup references",
1414
1414
  "files": [
1415
1415
  {
@@ -33,18 +33,18 @@ runtime support, not configured access; `op.security` gives scopes.
33
33
  Use these API IDs to narrow discovery; inspect the operation's inputs before calling.
34
34
  Snippet names below have the `builtin/` prefix. Describe only the relevant snippet.
35
35
 
36
- | Task | API / starting point |
37
- | --- | --- |
38
- | Review runs, including successes | `operation/jobs/v1`: `searchJobExecutions`; `job-execution-review` snippet |
39
- | Inspect steps and exact log path | `operation/jobs/v1`: `getJobExecution`; `job-execution-inspect` snippet |
40
- | Investigate failures with detail reads | `failed-job-triage` snippet; [jobs](references/jobs.md) |
41
- | Start a job / stop an execution | `operation/jobs/v1`: `createJobExecution` / `deleteJobExecution`; confirm intent and active runs first |
42
- | Active/rollback versions, activation metadata | `dx/scripts/v1`: `getCodeVersions`; `code-version-inspect` snippet |
43
- | Activate/create/delete a code version | `dx/scripts/v1`: `updateCodeVersion` / `createCodeVersion` / `deleteCodeVersion` |
44
- | Site status, catalog, ordered cartridge path | `site/sites/v1`: `getSiteById`; `site-cartridge-inspect` snippet |
45
- | Change a site's custom cartridge path | `site/sites/v1`: `replaceSiteCustomCartridges`; preserve order and unrelated entries |
46
- | Basic product + optional category assignment | `create-product` snippet; [products](references/products.md) |
47
- | Campaign assignments and promotion details | `campaign-promotions` snippet; [promotions](references/promotions.md) |
36
+ | Task | API / starting point |
37
+ | --------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
38
+ | Review runs, including successes | `operation/jobs/v1`: `searchJobExecutions`; `job-execution-review` snippet |
39
+ | Inspect steps and exact log path | `operation/jobs/v1`: `getJobExecution`; `job-execution-inspect` snippet |
40
+ | Investigate failures with detail reads | `failed-job-triage` snippet; [jobs](references/jobs.md) |
41
+ | Start a job / stop an execution | `operation/jobs/v1`: `createJobExecution` / `deleteJobExecution`; confirm intent and active runs first |
42
+ | Active/rollback versions, activation metadata | `dx/scripts/v1`: `getCodeVersions`; `code-version-inspect` snippet |
43
+ | Activate/create/delete a code version | `dx/scripts/v1`: `updateCodeVersion` / `createCodeVersion` / `deleteCodeVersion` |
44
+ | Site status, catalog, ordered cartridge path | `site/sites/v1`: `getSiteById`; `site-cartridge-inspect` snippet |
45
+ | Change a site's custom cartridge path | `site/sites/v1`: `replaceSiteCustomCartridges`; preserve order and unrelated entries |
46
+ | Basic product + optional category assignment | `create-product` snippet; [products](references/products.md) |
47
+ | Campaign assignments and promotion details | `campaign-promotions` snippet; [promotions](references/promotions.md) |
48
48
 
49
49
  File content is WebDAV: `webdav_list` / `webdav_get` / `webdav_put`.
50
50
  Deploy local cartridge files with `cartridge_deploy`. Job schedules/definitions
@@ -115,16 +115,48 @@ These are conditional setup references, not additional prerequisite reads.
115
115
  no program replay or automatic cleanup deletion.
116
116
  - Filter/page at the API, then project/aggregate in code. Include IDs, verification
117
117
  fields, errors, totals, and continuation inputs. Do not crop away missing data.
118
- - Limits: 20 calls, four concurrent, 30 seconds, 24 KB returned. Narrow oversized
118
+ - Limits: 20 calls, four outstanding, 30 seconds of active execution, 24 KB returned.
119
+ Managed API/token calls are serialized within an execution. Narrow oversized
119
120
  discovery; reduce live pages/projections.
120
121
  - SDK safety applies per request, including POST searches. Use only authorized
121
- targeted exceptions. Confirmation-required requests stop. Code mode does not
122
+ targeted exceptions. Confirmation uses client elicitation; see below. Code mode does not
122
123
  transfer binaries; use WebDAV tools for instance files, an external client for
123
124
  binary SCAPI endpoints.
124
125
  - `fetch` and `WebSocket` are disabled. Use `scapi.request()` inside programs;
125
126
  direct HTTP belongs in an external client, outside MCP Safety Mode. Do not use
126
127
  imports or other Node networking APIs to bypass this boundary.
127
128
 
129
+ ## Confirmation and cancellation
130
+
131
+ - A request requiring approval retains the running program and returns MCP
132
+ `input_required`. Let the client handle elicitation and the protocol retry;
133
+ never manufacture approval responses or modify opaque `requestState`.
134
+ - Retries validate the original code, input, and target arguments, then resume
135
+ the same execution. Repeated code is **not evaluated again**. Each request
136
+ needs its own approval; a whole program is not a transaction.
137
+ - Later managed calls wait for the pending decision. Earlier writes remain
138
+ applied. Prompts identify the organization, operation, method/path, and execution
139
+ ID. JSON previews are redacted and capped at five lines/400 characters; marked
140
+ truncation does not limit approval, which covers the full request.
141
+ Results include operation outcomes; `unknown` requires
142
+ checking the affected records before a fresh attempt.
143
+ - Decline/cancel terminates the entire execution, even if code catches errors.
144
+ Explicitly stop work with `scapi_execute({action: "cancel", executionId, skillRead: true})`;
145
+ omit code, input, project overrides, and protocol continuation state.
146
+ - Approval has no server deadline; waiting does not consume the active runtime
147
+ budget. At most four executions may be active per server, including pending
148
+ approvals. Cancel unwanted work to free a slot. Server shutdown or disconnect
149
+ releases retained workers; state does not survive a restart. Clients may impose
150
+ their own timeout. Duplicate responses never replay code or send a request twice.
151
+ - To change code/input/target, cancel unwanted retained work and start a fresh
152
+ execution without continuation state. Cancellation does not roll back writes.
153
+ Clients without form elicitation stop at confirmation-required requests.
154
+
155
+ For safety levels, rule matching, configuration precedence, and confirmation
156
+ semantics, read `docs_read({query: "guide-safety"})` when needed. If docs tools
157
+ are unavailable, use the [Safety Mode guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/safety.md).
158
+ This is an optional policy reference, not another prerequisite read.
159
+
128
160
  ## Reusable workflows
129
161
 
130
162
  Find workflows with `codemode.search(query)`; `codemode.describe(name)`
@@ -20,6 +20,7 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
20
20
  command: string;
21
21
  }[];
22
22
  static flags: {
23
+ 'allow-non-ga-tools': import("@oclif/core/interfaces").BooleanFlag<boolean>;
23
24
  toolsets: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
24
25
  tools: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
25
26
  'docs-topics': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
@@ -182,6 +182,10 @@ export default class McpServerCommand extends BaseCommand {
182
182
  // Inherit Instance flags (server, code-version, username, password, client-id, client-secret)
183
183
  // These provide B2C instance configuration for tools like cartridge_deploy
184
184
  ...InstanceCommand.baseFlags,
185
+ 'allow-non-ga-tools': Flags.boolean({
186
+ description: 'Deprecated compatibility flag; has no effect',
187
+ hidden: true,
188
+ }),
185
189
  // MCP-specific toolset selection flags
186
190
  toolsets: Flags.string({
187
191
  description: `Toolsets to enable (comma-separated; default: all). Options: all, ${TOOLSETS.join(', ')}`,
@@ -346,6 +350,9 @@ export default class McpServerCommand extends BaseCommand {
346
350
  * These can be exposed to Services if needed for features like telemetry or caching.
347
351
  */
348
352
  async run() {
353
+ if (this.flags['allow-non-ga-tools']) {
354
+ this.logger.warn('--allow-non-ga-tools is deprecated and has no effect. You can remove it from your MCP configuration.');
355
+ }
349
356
  // Flags are already parsed by BaseCommand.init()
350
357
  // Parse toolsets and tools from comma-separated strings
351
358
  // Note: toolsets are uppercased, tools are lowercased by their parse functions
package/dist/guidance.js CHANGED
@@ -36,8 +36,6 @@ const inputSchema = {
36
36
  const collectionSchema = z.object({
37
37
  id: z.string(),
38
38
  title: z.string(),
39
- isGA: z.boolean(),
40
- workspaces: z.array(z.string()).optional(),
41
39
  });
42
40
  const pageFields = {
43
41
  collections: z.array(collectionSchema),
package/dist/registry.js CHANGED
@@ -40,7 +40,7 @@ export function createToolRegistry(loadServices, serverContext, detectedWorkspac
40
40
  ...createDiagnosticsTools(loadServices, serverContext),
41
41
  ...createDocsTools(loadServices, { detectedWorkspaces, enabledCategories: enabledDocCategories }),
42
42
  ...createMrtTools(loadServices),
43
- ...createScapiTools(loadServices),
43
+ ...createScapiTools(loadServices, serverContext?.scapiExecutions),
44
44
  createGuidanceTool(),
45
45
  ];
46
46
  // Organize tools by their declared toolsets (supports multi-toolset)
@@ -1,6 +1,7 @@
1
1
  import { LogWatchRegistry } from './tools/diagnostics/log-watch-registry.js';
2
2
  import { MrtLogWatchRegistry } from './tools/diagnostics/mrt-log-watch-registry.js';
3
3
  import { DebugSessionRegistry } from './tools/diagnostics/session-registry.js';
4
+ import { ScapiExecutionRegistry } from './tools/scapi/execution-registry.js';
4
5
  /**
5
6
  * Server-scoped persistent state that lives for the lifetime of the MCP
6
7
  * server process. Holds registries for stateful resources (debug sessions,
@@ -27,6 +28,7 @@ export declare class ServerContext {
27
28
  readonly debugSessions: DebugSessionRegistry;
28
29
  readonly logWatches: LogWatchRegistry;
29
30
  readonly mrtLogWatches: MrtLogWatchRegistry;
31
+ readonly scapiExecutions: ScapiExecutionRegistry;
30
32
  constructor();
31
33
  destroyAll(): Promise<void>;
32
34
  }
@@ -6,6 +6,7 @@
6
6
  import { LogWatchRegistry } from './tools/diagnostics/log-watch-registry.js';
7
7
  import { MrtLogWatchRegistry } from './tools/diagnostics/mrt-log-watch-registry.js';
8
8
  import { DebugSessionRegistry } from './tools/diagnostics/session-registry.js';
9
+ import { ScapiExecutionRegistry } from './tools/scapi/execution-registry.js';
9
10
  /**
10
11
  * Server-scoped persistent state that lives for the lifetime of the MCP
11
12
  * server process. Holds registries for stateful resources (debug sessions,
@@ -32,16 +33,19 @@ export class ServerContext {
32
33
  debugSessions;
33
34
  logWatches;
34
35
  mrtLogWatches;
36
+ scapiExecutions;
35
37
  constructor() {
36
38
  this.debugSessions = new DebugSessionRegistry();
37
39
  this.logWatches = new LogWatchRegistry();
38
40
  this.mrtLogWatches = new MrtLogWatchRegistry();
41
+ this.scapiExecutions = new ScapiExecutionRegistry();
39
42
  }
40
43
  async destroyAll() {
41
44
  await Promise.allSettled([
42
45
  this.debugSessions.destroyAll(),
43
46
  this.logWatches.destroyAll(),
44
47
  this.mrtLogWatches.destroyAll(),
48
+ this.scapiExecutions.destroyAll(),
45
49
  ]);
46
50
  }
47
51
  }
package/dist/server.d.ts CHANGED
@@ -2,7 +2,7 @@ import { McpServer } from '@modelcontextprotocol/server';
2
2
  import type { CallToolResult, Implementation, ReadResourceResult, ToolAnnotations, ServerOptions, Transport } from '@modelcontextprotocol/server';
3
3
  import { type ZodRawShape } from 'zod';
4
4
  import type { Telemetry } from '@salesforce/b2c-tooling-sdk/telemetry';
5
- import type { McpToolConfig } from './utils/types.js';
5
+ import type { McpToolConfig, ToolContext } from './utils/types.js';
6
6
  /**
7
7
  * Extended server options.
8
8
  */
@@ -45,9 +45,7 @@ export declare class B2CDxMcpServer extends McpServer {
45
45
  * @param inputSchema - Zod schema for input validation
46
46
  * @param handler - Function to handle tool invocations
47
47
  */
48
- addTool(name: string, description: string, inputSchema: ZodRawShape, handler: (args: Record<string, unknown>, context?: {
49
- signal?: AbortSignal;
50
- }) => Promise<CallToolResult>, metadata?: Pick<McpToolConfig, 'outputSchema' | 'title'> & {
48
+ addTool(name: string, description: string, inputSchema: ZodRawShape, handler: (args: Record<string, unknown>, context?: ToolContext) => Promise<CallToolResult>, metadata?: Pick<McpToolConfig, 'outputSchema' | 'title'> & {
51
49
  annotations?: ToolAnnotations;
52
50
  }): void;
53
51
  close(): Promise<void>;