@salesforce/b2c-dx-mcp 3.1.2 → 3.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.
- package/content/guidance/b2c-cli/b2c-config/SKILL.md +23 -0
- package/content/guidance/b2c-cli/b2c-docs/SKILL.md +4 -3
- package/content/guidance/b2c-cli/b2c-scapi-schemas/SKILL.md +8 -6
- package/content/guidance/index.json +8 -8
- package/content/guidance/mcp/scapi/SKILL.md +31 -13
- package/content/guidance/mcp/scapi/references/custom-apis.md +4 -6
- package/content/guidance/mcp/scapi/references/tokens.md +1 -1
- package/dist/commands/mcp.d.ts +1 -0
- package/dist/commands/mcp.js +1 -1
- package/dist/tools/scapi/index.js +6 -2
- package/dist/tools/scapi/scapi-code.d.ts +2 -1
- package/dist/tools/scapi/scapi-code.js +65 -24
- package/dist/tools/scapi/scapi-schemas-list.d.ts +3 -1
- package/dist/tools/scapi/scapi-schemas-list.js +15 -3
- package/node_modules/@salesforce/b2c-agent-plugins/CHANGELOG.md +10 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-config/SKILL.md +23 -0
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-docs/SKILL.md +4 -3
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md +8 -6
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/b2c-ops/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/package.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/.codex-plugin/plugin.json +1 -1
- package/node_modules/@salesforce/b2c-agent-plugins/storefront-next/plugin.json +1 -1
- package/oclif.manifest.json +16 -2
- package/package.json +3 -3
|
@@ -206,6 +206,29 @@ b2c setup ide tsserver-plugin --json
|
|
|
206
206
|
|
|
207
207
|
The B2C DX VS Code extension needs no setup — it injects the same TypeScript Server plugin at runtime.
|
|
208
208
|
|
|
209
|
+
## OpenShell Sandbox (Beta)
|
|
210
|
+
|
|
211
|
+
`b2c setup openshell` creates an NVIDIA OpenShell sandbox from the resolved configuration. Secrets stay on the OpenShell gateway, and the sandbox can reach only the B2C hosts in use, at the configured Safety Mode level (or `NONE` if unset); Safety Mode rules carry over. Requires the `openshell` CLI with a running gateway, and Docker.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Sandbox for the active instance at the configured Safety Mode level
|
|
215
|
+
b2c setup openshell
|
|
216
|
+
|
|
217
|
+
# Read-only sandbox
|
|
218
|
+
b2c setup openshell --safety-level READ_ONLY
|
|
219
|
+
|
|
220
|
+
# Allow writes but not deletes; include the MCP server
|
|
221
|
+
b2c setup openshell --safety-level NO_DELETE --mcp
|
|
222
|
+
|
|
223
|
+
# Write the policy, profiles, Dockerfile, and setup.sh without running anything
|
|
224
|
+
b2c setup openshell --dry-run
|
|
225
|
+
|
|
226
|
+
# Run a command in the sandbox
|
|
227
|
+
openshell sandbox exec -n b2c-<instance> -- b2c code list
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Edit `.openshell/<sandbox>/policy.yaml` and re-run to apply it; use `--recreate` after changing secrets or configuration. Add hosts with `--allow-host`. Only client credentials work in the sandbox (no browser login). See the [Agent Sandboxing guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/agent-sandboxing#openshell).
|
|
231
|
+
|
|
209
232
|
## Managing Instances
|
|
210
233
|
|
|
211
234
|
### List Configured Instances
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: b2c-docs
|
|
3
|
-
description: Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say "how do I implement passwordless login" or "what methods does Basket have" or "how do I deploy a PWA Kit bundle" or "how do I import a site archive" or "what SCAPI endpoints are available for checkout".
|
|
3
|
+
description: Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce, OCAPI), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say "how do I implement passwordless login" or "what methods does Basket have" or "how do I deploy a PWA Kit bundle" or "how do I import a site archive" or "what SCAPI endpoints are available for checkout".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# B2C Docs Skill
|
|
@@ -15,7 +15,7 @@ Use the `b2c` CLI to search and read B2C Commerce documentation spanning multipl
|
|
|
15
15
|
|
|
16
16
|
## Key Features
|
|
17
17
|
|
|
18
|
-
- **Multi-corpus search** — Search across Script API, Developer Center guides, Salesforce Help (admin + merchandising), internal tooling docs (guides, CLI reference, MCP, and VS Code extension), job steps, and schemas in a unified index
|
|
18
|
+
- **Multi-corpus search** — Search across Script API, Developer Center guides, OCAPI reference, Salesforce Help (admin + merchandising), internal tooling docs (guides, CLI reference, MCP, and VS Code extension), job steps, and schemas in a unified index
|
|
19
19
|
- **Workspace-aware search** — Auto-detects project type (cartridges, SFRA, PWA Kit, Storefront Next) and boosts relevant documentation while de-boosting competing storefront frameworks
|
|
20
20
|
- **Category filtering** — Use `--category` to narrow results to a specific corpus (e.g., `commerce-api`, `pwa-kit-managed-runtime`, `sfra`, `script-api`, `help-admin`, `help-merchant`, `help-kb`)
|
|
21
21
|
- **Triage metadata** — Search results include `category`, `summary`, `keywords`, and `url` to help identify the right match without reading full content
|
|
@@ -114,7 +114,7 @@ The docs search understands which workspace framework your project uses and auto
|
|
|
114
114
|
|
|
115
115
|
**Category boost mapping:**
|
|
116
116
|
|
|
117
|
-
- Always relevant (any workspace): `b2c-commerce`, `tooling`
|
|
117
|
+
- Always relevant (any workspace): `b2c-commerce`, `ocapi`, `tooling`
|
|
118
118
|
- `cartridges` → `script-api`, `job-step`
|
|
119
119
|
- `sfra` → `sfra`
|
|
120
120
|
- `pwa-kit-v3` → `pwa-kit-managed-runtime`, `commerce-api`
|
|
@@ -239,6 +239,7 @@ xmllint --schema "$(b2c docs schema catalog --path)" my-catalog.xml --noout
|
|
|
239
239
|
| `sfra` | Storefront Reference Architecture (SFRA) guides | `sfra/controllers-and-routes` |
|
|
240
240
|
| `sfnext` | Storefront Next guides | `sfnext/sfnext-get-started` |
|
|
241
241
|
| `b2c-commerce` | General B2C Commerce platform guides | `b2c-commerce/business-manager-overview` |
|
|
242
|
+
| `ocapi` | OCAPI reference — usage, hooks, settings, and best practices for the Open Commerce API | `ocapi/ocapisettings`, `ocapi/bestpractices` |
|
|
242
243
|
| `tooling` | B2C CLI reference, guides, MCP docs, SDK guidance, and VS Code extension docs | `guide-authentication`, `cli-jobs` |
|
|
243
244
|
| `job-step` | Standard (system) job step catalog | `ImportCatalog`, `ExportCatalog`, `job-steps` |
|
|
244
245
|
| `help-admin` | Salesforce Help — administration/ops (import/export, jobs, replication, security, Account Manager, permissions, logs, inventory) | `help-admin/b2c_site_import_export` |
|
|
@@ -9,10 +9,12 @@ Browse standard or tenant-specific SCAPI OpenAPI contracts.
|
|
|
9
9
|
|
|
10
10
|
## Tool choice
|
|
11
11
|
|
|
12
|
-
When B2C MCP is available, prefer
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
When B2C MCP is available, prefer `scapi_search` for Admin and Shopper contracts.
|
|
13
|
+
Read `skill://mcp/scapi/SKILL.md` via resource or `skills_read` first; pass
|
|
14
|
+
`skillRead: true`. Discover method/path/operationId, then selected inputs and
|
|
15
|
+
fields. The default searches bundled standard contracts offline; `schemas: "live"`
|
|
16
|
+
searches the tenant's contracts (custom attributes, custom APIs, newer APIs) and
|
|
17
|
+
makes them callable from `scapi_execute`.
|
|
16
18
|
|
|
17
19
|
Use `scapi_schemas_list` for live schemas, custom attributes, and custom APIs.
|
|
18
20
|
For tenant fields, supply API family/name/version and `includeSchemas: true`.
|
|
@@ -20,9 +22,9 @@ Custom-property expansion defaults to true; `expandAll: true` preserves full def
|
|
|
20
22
|
For large schemas, fetch/filter through code mode as described in the MCP SCAPI skill.
|
|
21
23
|
Use `scapi_custom_apis_get_status` for registration status. Live schema access needs
|
|
22
24
|
`sfcc.scapi-schemas`. Prefer a dedicated task tool for execution, otherwise
|
|
23
|
-
`scapi_execute` supports Admin JSON calls with configured auth/scopes. For custom
|
|
25
|
+
`scapi_execute` supports Admin and guest Shopper JSON calls with configured auth/scopes. For custom
|
|
24
26
|
Admin endpoints, fetch the live contract through `scapi.request` in each program
|
|
25
|
-
before calling it; follow the MCP SCAPI skill.
|
|
27
|
+
before calling it; follow the MCP SCAPI skill. Registered-shopper and binary execution are
|
|
26
28
|
unsupported. Use docs tools for semantics
|
|
27
29
|
and limits rather than duplicating contract discovery.
|
|
28
30
|
|
|
@@ -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 | 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",
|
|
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 | OpenShell Sandbox (Beta) | 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":
|
|
136
|
+
"bytes": 25577
|
|
137
137
|
}
|
|
138
138
|
]
|
|
139
139
|
},
|
|
@@ -171,14 +171,14 @@
|
|
|
171
171
|
"id": "b2c-cli/b2c-docs",
|
|
172
172
|
"collection": "b2c-cli",
|
|
173
173
|
"title": "b2c-docs",
|
|
174
|
-
"description": "Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say \"how do I implement passwordless login\" or \"what methods does Basket have\" or \"how do I deploy a PWA Kit bundle\" or \"how do I import a site archive\" or \"what SCAPI endpoints are available for checkout\".",
|
|
174
|
+
"description": "Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce, OCAPI), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say \"how do I implement passwordless login\" or \"what methods does Basket have\" or \"how do I deploy a PWA Kit bundle\" or \"how do I import a site archive\" or \"what SCAPI endpoints are available for checkout\".",
|
|
175
175
|
"entrypoint": "SKILL.md",
|
|
176
176
|
"source": "skills/b2c-cli/skills/b2c-docs/SKILL.md",
|
|
177
177
|
"headings": "B2C Docs Skill | Key Features | Examples | Search Documentation | Workspace-Aware Search | Read Documentation | Standard Job Step Catalog | Download Documentation | Read XSD Schemas | Documentation Categories | Common Script API Classes | Common Schemas | More Commands",
|
|
178
178
|
"files": [
|
|
179
179
|
{
|
|
180
180
|
"path": "SKILL.md",
|
|
181
|
-
"bytes":
|
|
181
|
+
"bytes": 17996
|
|
182
182
|
}
|
|
183
183
|
]
|
|
184
184
|
},
|
|
@@ -349,7 +349,7 @@
|
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
351
|
"path": "SKILL.md",
|
|
352
|
-
"bytes":
|
|
352
|
+
"bytes": 4263
|
|
353
353
|
}
|
|
354
354
|
]
|
|
355
355
|
},
|
|
@@ -1366,7 +1366,7 @@
|
|
|
1366
1366
|
"files": [
|
|
1367
1367
|
{
|
|
1368
1368
|
"path": "references/custom-apis.md",
|
|
1369
|
-
"bytes":
|
|
1369
|
+
"bytes": 2734
|
|
1370
1370
|
},
|
|
1371
1371
|
{
|
|
1372
1372
|
"path": "references/custom-properties.md",
|
|
@@ -1394,11 +1394,11 @@
|
|
|
1394
1394
|
},
|
|
1395
1395
|
{
|
|
1396
1396
|
"path": "references/tokens.md",
|
|
1397
|
-
"bytes":
|
|
1397
|
+
"bytes": 2764
|
|
1398
1398
|
},
|
|
1399
1399
|
{
|
|
1400
1400
|
"path": "SKILL.md",
|
|
1401
|
-
"bytes":
|
|
1401
|
+
"bytes": 14035
|
|
1402
1402
|
}
|
|
1403
1403
|
],
|
|
1404
1404
|
"featured": true
|
|
@@ -17,8 +17,13 @@ then pass `skillRead: true`. This does not authorize mutations.
|
|
|
17
17
|
|
|
18
18
|
## Discover
|
|
19
19
|
|
|
20
|
-
Discovery
|
|
21
|
-
|
|
20
|
+
Discovery defaults to the bundled standard contracts offline; no credentials needed.
|
|
21
|
+
Pass `schemas: "live"` to search the configured tenant's Schemas API contracts
|
|
22
|
+
instead: tenant `c_*` properties, custom APIs, and APIs newer than the bundle.
|
|
23
|
+
Live search needs `sfcc.scapi-schemas`, uses the same project context as
|
|
24
|
+
`scapi_execute`, and caches per tenant for the server session (`refresh: true` refetches). Contracts that
|
|
25
|
+
failed to load are listed in `schemaFailures`. Schemas and responses can be huge.
|
|
26
|
+
Return only what the next decision needs:
|
|
22
27
|
|
|
23
28
|
1. Find APIs/operations through `spec.apis`/`spec.paths`; return method/path/operationId.
|
|
24
29
|
2. Narrow by `api`, path, or `authType`; inspect required inputs and selected fields,
|
|
@@ -55,24 +60,28 @@ Do not fall back to a terminal merely because there is no dedicated job/site too
|
|
|
55
60
|
|
|
56
61
|
Bundled schemas omit tenant `c_*` definitions. Known custom fields can be sent
|
|
57
62
|
directly in standard Admin bodies; schema retrieval is optional. SCAPI validates
|
|
58
|
-
the payload. To discover tenant fields,
|
|
59
|
-
`scapi_schemas_list`: `includeSchemas: true`,
|
|
63
|
+
the payload. To discover tenant fields, search with `schemas: "live"` (narrow with
|
|
64
|
+
`api`), or fetch the live schema with `scapi_schemas_list`: `includeSchemas: true`,
|
|
65
|
+
`apiFamily`, `apiName`, `apiVersion`.
|
|
60
66
|
Custom-property expansion defaults to true; disable with `expandCustomProperties: false`.
|
|
61
67
|
`expandAll: true` retains full definitions; it is separate from custom-property
|
|
62
68
|
expansion. Large contracts: fetch through `scapi_execute` and return only relevant
|
|
63
69
|
fields ([example](references/custom-properties.md)). Requires `sfcc.scapi-schemas`.
|
|
64
70
|
Use the same project/instance for schema lookup and writes.
|
|
65
71
|
|
|
66
|
-
Live
|
|
72
|
+
Live contracts found by `schemas: "live"` search, expanded `scapi_schemas_list`
|
|
73
|
+
fetches, or Schemas API reads inside `scapi_execute` are cached for that tenant.
|
|
74
|
+
`scapi_execute` then routes to them, replacing bundled versions; they never change
|
|
75
|
+
the offline `spec`. If schema access fails, report it; use
|
|
67
76
|
already-known fields or ask for missing details. The optional CLI equivalent is
|
|
68
77
|
`b2c scapi schemas get`, which also expands custom properties by default.
|
|
69
78
|
|
|
70
|
-
For custom endpoint contracts,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
For custom endpoint contracts, search with `schemas: "live"` or use
|
|
80
|
+
`scapi_schemas_list` with `apiFamily: "custom"`; check registration with
|
|
81
|
+
`scapi_custom_apis_get_status` when needed. Custom endpoints found through live
|
|
82
|
+
search are callable from `scapi_execute` for the same tenant. Otherwise fetch the
|
|
83
|
+
live contract through `scapi.request` in the program before making declared calls. `AmOAuth2`
|
|
84
|
+
and `ShopperToken` operations use their declared `c_*` scopes. [Custom API workflow](references/custom-apis.md).
|
|
76
85
|
|
|
77
86
|
## Authentication
|
|
78
87
|
|
|
@@ -80,14 +89,23 @@ Shopper operations remain unsupported. [Custom API workflow](references/custom-a
|
|
|
80
89
|
or pass tokens first. For an explicitly requested token or external HTTP client,
|
|
81
90
|
use `auth.accountManager()` / `auth.slas()` in `scapi_execute`:
|
|
82
91
|
[token exports](references/tokens.md). These helpers are unavailable in search.
|
|
92
|
+
- The operation's declared security selects the credential; there is no auth option.
|
|
83
93
|
- Admin `AmOAuth2`: Account Manager credentials. Each request selects operation/tenant
|
|
84
94
|
scopes and reuses suitable cached tokens; no upfront scope union.
|
|
95
|
+
- Shopper `ShopperToken`: a SLAS guest shopper (`slasClientId`, plus `slasClientSecret`
|
|
96
|
+
for private clients; Storefront Next `.env` supplies both). Requests need `siteId`
|
|
97
|
+
(configured or `query.siteId`). The guest session is per site and persists across
|
|
98
|
+
executions for the server session, so baskets carry over. SLAS scopes are fixed on
|
|
99
|
+
the client, not requested per call; 401/403 diagnostics compare the token's scopes
|
|
100
|
+
with the operation's. `sfcc.shopper-standard` satisfies only operations that list it.
|
|
101
|
+
Public clients must allow redirect URI `http://localhost:3000/callback`.
|
|
85
102
|
- Missing credentials: `config_inspect` with masking. `clientId` is Admin;
|
|
86
103
|
`slasClientId` is Shopper. Configuration does not grant access.
|
|
87
104
|
- Scope rejection: grant reported scopes in Account Manager; check extra configured
|
|
88
105
|
scopes. Read/write alternatives are alternatives. Later failures do not undo writes.
|
|
89
|
-
-
|
|
90
|
-
|
|
106
|
+
- Unsupported: registered-shopper-only operations (`RegisteredShopperToken`),
|
|
107
|
+
trusted-system/agent on-behalf tokens, and SLAS itself (`shopper/auth/v1`).
|
|
108
|
+
`auth.slas({flow: 'registered', ...})` exports a registered token for external clients.
|
|
91
109
|
SLAS admin roles differ: [CLI/SDK](https://salesforcecommercecloud.github.io/b2c-developer-tooling/cli/slas).
|
|
92
110
|
- HTTP 401/403 retain `status`/`data` plus `diagnostic`; preserve these.
|
|
93
111
|
A 403 alone does not prove missing scopes.
|
|
@@ -27,17 +27,15 @@ async (input) => {
|
|
|
27
27
|
query: input.query,
|
|
28
28
|
});
|
|
29
29
|
if (!result.ok) return {stage: 'endpoint', ...result};
|
|
30
|
-
return {status: result.status, fields: Object.fromEntries(
|
|
31
|
-
|
|
32
|
-
)};
|
|
33
|
-
}
|
|
30
|
+
return {status: result.status, fields: Object.fromEntries(input.fields.map((name) => [name, result.data[name]]))};
|
|
31
|
+
};
|
|
34
32
|
```
|
|
35
33
|
|
|
36
34
|
- Schema lookup needs `sfcc.scapi-schemas`; execution needs the operation's declared
|
|
37
35
|
`c_*` scope and tenant scope. Managed auth requests each; `sfcc.custom-apis` is
|
|
38
36
|
for registration status, not custom business logic.
|
|
39
|
-
-
|
|
40
|
-
|
|
37
|
+
- `AmOAuth2` contracts use Admin credentials; `ShopperToken` contracts use the SLAS
|
|
38
|
+
guest shopper (`slasClientId`, `siteId`). The declared security selects the credential.
|
|
41
39
|
- Paths in custom schemas are endpoint-relative (`/info`); requests use
|
|
42
40
|
`/custom/{apiName}/{apiVersion}/organizations/{organizationId}/info`.
|
|
43
41
|
- Required parameters and JSON-body checks, SDK safety, cancellation, and execution
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Only use when the task explicitly needs a token or an HTTP client outside code
|
|
4
4
|
mode. `scapi.request()` and snippets already authenticate; these helpers neither
|
|
5
|
-
configure their authentication nor enable unsupported
|
|
5
|
+
configure their authentication nor enable unsupported registered-shopper requests.
|
|
6
6
|
Run through `scapi_execute`, with the same project configuration and skill acknowledgment.
|
|
7
7
|
|
|
8
8
|
## Account Manager
|
package/dist/commands/mcp.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export default class McpServerCommand extends BaseCommand<typeof McpServerComman
|
|
|
42
42
|
'auth-methods': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
43
43
|
'user-auth': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
44
44
|
'account-manager-host': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
45
|
+
'client-auth-method': import("@oclif/core/interfaces").OptionFlag<"basic" | "basic-unencoded" | "body" | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
45
46
|
'jwt-cert': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
46
47
|
'jwt-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
47
48
|
'jwt-passphrase': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
package/dist/commands/mcp.js
CHANGED
|
@@ -199,7 +199,7 @@ export default class McpServerCommand extends BaseCommand {
|
|
|
199
199
|
}),
|
|
200
200
|
'docs-topics': Flags.string({
|
|
201
201
|
description: 'Limit the documentation exposed by the docs tools to these categories (comma-separated allowlist). ' +
|
|
202
|
-
'Options: script-api, job-step, commerce-api, pwa-kit-managed-runtime, sfnext, sfra, b2c-commerce, tooling, ' +
|
|
202
|
+
'Options: script-api, job-step, commerce-api, pwa-kit-managed-runtime, sfnext, sfra, b2c-commerce, ocapi, tooling, ' +
|
|
203
203
|
'help-admin, help-merchant, help-kb. ' +
|
|
204
204
|
'Bounds the whole docs corpus; per-call category/storefront narrow within it. Unknown names are ignored.',
|
|
205
205
|
env: 'SFCC_DOCS_TOPICS',
|
|
@@ -7,6 +7,7 @@ import { createMetricsGetTool } from './metrics-get.js';
|
|
|
7
7
|
import { createScapiCustomApisStatusTool } from './scapi-custom-apis-get-status.js';
|
|
8
8
|
import { createScapiSchemasListTool } from './scapi-schemas-list.js';
|
|
9
9
|
import { createScapiCodeTools } from './scapi-code.js';
|
|
10
|
+
import { ScapiLiveSchemaCache, ScapiShopperSessions } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
10
11
|
/**
|
|
11
12
|
* Creates all tools for the SCAPI toolset.
|
|
12
13
|
*
|
|
@@ -14,11 +15,14 @@ import { createScapiCodeTools } from './scapi-code.js';
|
|
|
14
15
|
* @returns Array of MCP tools
|
|
15
16
|
*/
|
|
16
17
|
export function createScapiTools(loadServices, executions) {
|
|
18
|
+
// Live contracts discovered by search or schema fetches are reused by execution for the same tenant.
|
|
19
|
+
const schemaCache = new ScapiLiveSchemaCache();
|
|
20
|
+
const shopperSessions = new ScapiShopperSessions();
|
|
17
21
|
return [
|
|
18
|
-
...createScapiCodeTools(loadServices, undefined, executions),
|
|
22
|
+
...createScapiCodeTools(loadServices, undefined, executions, schemaCache, shopperSessions),
|
|
19
23
|
createMetricsGetTool(loadServices),
|
|
20
24
|
createScapiCustomApisStatusTool(loadServices),
|
|
21
|
-
createScapiSchemasListTool(loadServices),
|
|
25
|
+
createScapiSchemasListTool(loadServices, schemaCache),
|
|
22
26
|
];
|
|
23
27
|
}
|
|
24
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { ScapiLiveSchemaCache, ScapiShopperSessions } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
1
2
|
import type { McpTool } from '../../utils/types.js';
|
|
2
3
|
import type { ServicesLoader } from '../adapter.js';
|
|
3
4
|
import { ScapiExecutionRegistry } from './execution-registry.js';
|
|
4
|
-
export declare function createScapiCodeTools(loadServices: ServicesLoader, snippetDirectory?: string, registry?: ScapiExecutionRegistry): McpTool[];
|
|
5
|
+
export declare function createScapiCodeTools(loadServices: ServicesLoader, snippetDirectory?: string, registry?: ScapiExecutionRegistry, schemaCache?: ScapiLiveSchemaCache, shopperSessions?: ScapiShopperSessions): McpTool[];
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { z } from 'zod';
|
|
7
|
-
import { loadScapiSchemas, runScapiCode, createScapiRequest, createScapiAuth, loadScapiSnippets, saveScapiSnippet, } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
7
|
+
import { loadScapiSchemas, mergeScapiSchemas, scapiTenantKey, ScapiLiveSchemaCache, ScapiShopperSessions, runScapiCode, createScapiRequest, createScapiAuth, loadScapiSnippets, saveScapiSnippet, } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
8
8
|
import { toOrganizationId } from '@salesforce/b2c-tooling-sdk/clients';
|
|
9
9
|
import { getB2CConfigDirectory } from '@salesforce/b2c-tooling-sdk/config';
|
|
10
10
|
import { resolveEffectiveSafetyConfig, loadGlobalSafetyConfig } from '@salesforce/b2c-tooling-sdk/safety';
|
|
@@ -23,19 +23,19 @@ function requireScapiSkill(read) {
|
|
|
23
23
|
if (read !== true)
|
|
24
24
|
throw new Error('SCAPI_SKILL_REQUIRED: Read skill://mcp/scapi/SKILL.md through resources or skills_read, then retry with skillRead: true.');
|
|
25
25
|
}
|
|
26
|
-
const searchDescription = `Discover
|
|
27
|
-
|
|
26
|
+
const searchDescription = `Discover Admin/Shopper SCAPI contracts; prefer dedicated tools. Read skill://mcp/scapi/SKILL.md first.
|
|
27
|
+
Default: bundled, offline. schemas:"live": tenant c_*, custom, newer APIs, reused by execute.
|
|
28
28
|
|
|
29
|
-
Schemas can be huge.
|
|
29
|
+
Schemas can be huge. Find operation IDs/paths first; then select required and task fields, not whole trees. Local refs expand; recursive/deep refs remain $ref.
|
|
30
30
|
|
|
31
|
-
Code objects (
|
|
31
|
+
Code objects (write JavaScript, not these types):
|
|
32
32
|
interface Operation {
|
|
33
33
|
api: string; operationId: string; summary?: string;
|
|
34
34
|
parameters: Array<{name: string; in: string; required?: boolean; schema?: unknown}>;
|
|
35
35
|
requestBody?: {required?: boolean; content: Record<string, {schema: any}>};
|
|
36
36
|
responses?: Record<string, unknown>;
|
|
37
37
|
security: Array<Record<string, string[]>>;
|
|
38
|
-
auth: {types: string[]; schemes: string[]; executable: boolean}; // runtime support, not
|
|
38
|
+
auth: {types: string[]; schemes: string[]; executable: boolean}; // runtime support, not access
|
|
39
39
|
}
|
|
40
40
|
declare const spec: {
|
|
41
41
|
apis: Array<{id: string; apiFamily: string; apiName: string; apiVersion: string; authTypes: string[]}>;
|
|
@@ -57,7 +57,7 @@ async () => {
|
|
|
57
57
|
return {parameters: op.parameters, required: body.required,
|
|
58
58
|
fields: Object.fromEntries(fields.map(k => [k, body.properties[k]])), auth: op.auth, security: op.security};
|
|
59
59
|
}`;
|
|
60
|
-
const executeDescription = `Read, create, update, or delete Commerce records through SCAPI Admin APIs when no dedicated tool fits. Discover
|
|
60
|
+
const executeDescription = `Read, create, update, or delete Commerce records through SCAPI Admin or Shopper APIs when no dedicated tool fits. Discover endpoints with scapi_search; operations found with schemas:"live" (including custom APIs) are callable here for the same tenant. Otherwise fetch a custom API's live contract through scapi.request() in the same program first. Auth is automatic; Shopper APIs run as a guest whose session (basket) persists per site. JSON only; no binary transfers.
|
|
61
61
|
Read skill://mcp/scapi/SKILL.md first.
|
|
62
62
|
|
|
63
63
|
Reuse workflows with await codemode.run(name, input); describe first. async (input) receives input. Completed executionId enables scapi_snippet_save.
|
|
@@ -86,20 +86,26 @@ function failure(error, resolution) {
|
|
|
86
86
|
return {
|
|
87
87
|
...codeResult({
|
|
88
88
|
error: message,
|
|
89
|
-
...(/^SCAPI_(ADMIN_|SHOPPER_|AUTH_|SCOPE_)/.test(message)
|
|
89
|
+
...(/^SCAPI_(ADMIN_|SHOPPER_|REGISTERED_SHOPPER_|AUTH_|SCOPE_)/.test(message)
|
|
90
90
|
? { skillReferences: [MCP_SKILL_REFERENCES.scapiAuthentication] }
|
|
91
91
|
: {}),
|
|
92
92
|
}, resolution),
|
|
93
93
|
isError: true,
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
export function createScapiCodeTools(loadServices, snippetDirectory, registry = new ScapiExecutionRegistry()) {
|
|
96
|
+
export function createScapiCodeTools(loadServices, snippetDirectory, registry = new ScapiExecutionRegistry(), schemaCache = new ScapiLiveSchemaCache(), shopperSessions = new ScapiShopperSessions()) {
|
|
97
97
|
// Retain only source for the last 50 completed executions, until this server ends.
|
|
98
98
|
const executions = new Map();
|
|
99
99
|
const searchInput = {
|
|
100
|
+
...createProjectContextInputSchema('configuration'),
|
|
100
101
|
code,
|
|
101
102
|
skillRead,
|
|
102
|
-
api: z.string().optional().describe('Limit schemas to family/name/version. Omit for all
|
|
103
|
+
api: z.string().optional().describe('Limit schemas to family/name/version. Omit for all APIs.'),
|
|
104
|
+
schemas: z
|
|
105
|
+
.enum(['bundled', 'live'])
|
|
106
|
+
.optional()
|
|
107
|
+
.describe('bundled (default, offline) or live tenant contracts from the Schemas API.'),
|
|
108
|
+
refresh: z.boolean().optional().describe('With schemas:"live", refetch instead of using cached contracts.'),
|
|
103
109
|
authType: z
|
|
104
110
|
.enum(['admin', 'shopper'])
|
|
105
111
|
.optional()
|
|
@@ -136,27 +142,48 @@ export function createScapiCodeTools(loadServices, snippetDirectory, registry =
|
|
|
136
142
|
toolsets: ['SCAPI', 'PWAV3', 'STOREFRONTNEXT'],
|
|
137
143
|
effect: 'read',
|
|
138
144
|
idempotent: true,
|
|
139
|
-
openWorld:
|
|
145
|
+
openWorld: true,
|
|
140
146
|
async handler(args, context) {
|
|
147
|
+
let resolution;
|
|
141
148
|
try {
|
|
142
149
|
const input = z.object(searchInput).strict().parse(args);
|
|
143
150
|
requireScapiSkill(input.skillRead);
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
if (input.schemas !== 'live' && input.refresh !== undefined)
|
|
152
|
+
throw new Error('SCAPI_SEARCH_ARGUMENT_INVALID: refresh requires schemas:"live".');
|
|
153
|
+
let documents;
|
|
154
|
+
let failures = [];
|
|
155
|
+
if (input.schemas === 'live') {
|
|
156
|
+
const services = await loadServices(input);
|
|
157
|
+
resolution = services.getResolution();
|
|
158
|
+
// Throws with configuration guidance when shortCode, tenantId, or OAuth credentials are missing.
|
|
159
|
+
const client = services.getScapiSchemasClient();
|
|
160
|
+
const organizationId = services.getOrganizationId();
|
|
161
|
+
const tenant = scapiTenantKey(services.getShortCode(), organizationId);
|
|
162
|
+
({ documents, failures } = await schemaCache.load(tenant, client, organizationId, {
|
|
163
|
+
api: input.api,
|
|
164
|
+
refresh: input.refresh,
|
|
152
165
|
signal: context?.signal,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
166
|
+
}));
|
|
167
|
+
if (documents.length === 0 && failures.length === 0)
|
|
168
|
+
throw new Error('Unknown schema ID for this tenant. Omit api to discover available APIs.');
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
documents = loadScapiSchemas().filter((document) => !input.api || document.entry.id === input.api);
|
|
172
|
+
if (documents.length === 0)
|
|
173
|
+
throw new Error('Unknown schema ID. Omit api to discover available APIs, or use schemas:"live" for tenant and custom APIs.');
|
|
174
|
+
}
|
|
175
|
+
const result = await runScapiCode({
|
|
176
|
+
code: input.code,
|
|
177
|
+
documents,
|
|
178
|
+
authType: input.authType,
|
|
179
|
+
signal: context?.signal,
|
|
180
|
+
timeoutMs: 10_000,
|
|
181
|
+
snippets: loadScapiSnippets(snippetDirectory),
|
|
156
182
|
});
|
|
183
|
+
return codeResult({ result, ...(failures.length > 0 ? { schemaFailures: failures } : {}) }, resolution);
|
|
157
184
|
}
|
|
158
185
|
catch (error) {
|
|
159
|
-
return failure(error);
|
|
186
|
+
return failure(error, resolution);
|
|
160
187
|
}
|
|
161
188
|
},
|
|
162
189
|
},
|
|
@@ -192,6 +219,7 @@ export function createScapiCodeTools(loadServices, snippetDirectory, registry =
|
|
|
192
219
|
resolution = services.getResolution();
|
|
193
220
|
const config = services.getResolvedConfig();
|
|
194
221
|
const { shortCode, tenantId, siteId } = config.values;
|
|
222
|
+
const tenant = shortCode && tenantId ? scapiTenantKey(shortCode, toOrganizationId(tenantId)) : undefined;
|
|
195
223
|
const safetyEnvironment = Object.fromEntries(['SFCC_SAFETY_LEVEL', 'SFCC_SAFETY_CONFIRM', 'SFCC_SAFETY_CONFIG'].map((name) => [
|
|
196
224
|
name,
|
|
197
225
|
services.getEnvironmentVariable(name),
|
|
@@ -206,7 +234,20 @@ export function createScapiCodeTools(loadServices, snippetDirectory, registry =
|
|
|
206
234
|
tenantId,
|
|
207
235
|
siteId,
|
|
208
236
|
auth: () => config.createOAuth(),
|
|
209
|
-
|
|
237
|
+
// Guest sessions outlive executions so shopper state (baskets) carries across them.
|
|
238
|
+
shopperAuth: shopperSessions.for({
|
|
239
|
+
shortCode,
|
|
240
|
+
tenantId,
|
|
241
|
+
slasClientId: config.values.slasClientId,
|
|
242
|
+
slasClientSecret: config.values.slasClientSecret,
|
|
243
|
+
}),
|
|
244
|
+
// Live contracts discovered for this tenant replace bundled ones; the user owns their accuracy.
|
|
245
|
+
documents: mergeScapiSchemas(loadScapiSchemas(), tenant ? schemaCache.get(tenant) : []),
|
|
246
|
+
onSchema(document, customProperties) {
|
|
247
|
+
// Keep expanded tenant contracts from being replaced by unexpanded fetches.
|
|
248
|
+
if (tenant && (customProperties || document.entry.apiFamily === 'custom'))
|
|
249
|
+
schemaCache.put(tenant, document);
|
|
250
|
+
},
|
|
210
251
|
confirm: (request) => execution.confirm(request),
|
|
211
252
|
onDispatch: () => execution.markDispatched(),
|
|
212
253
|
safety: resolveEffectiveSafetyConfig(config.values.safety, loadGlobalSafetyConfig(getB2CConfigDirectory(), safetyEnvironment, resolution?.projectDirectory?.path), safetyEnvironment),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Services } from '../../services.js';
|
|
2
2
|
import type { McpTool } from '../../utils/index.js';
|
|
3
|
+
import { type ScapiLiveSchemaCache } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
3
4
|
/**
|
|
4
5
|
* Creates the scapi_schemas_list tool.
|
|
5
6
|
*
|
|
@@ -7,6 +8,7 @@ import type { McpTool } from '../../utils/index.js';
|
|
|
7
8
|
* Lists or fetches SCAPI schema specifications; includes standard SCAPI and custom API as schema types.
|
|
8
9
|
*
|
|
9
10
|
* @param loadServices - Function that loads configuration and returns Services instance
|
|
11
|
+
* @param schemaCache - Optional live contract cache shared with SCAPI code mode
|
|
10
12
|
* @returns MCP tool for listing/fetching SCAPI schemas
|
|
11
13
|
*/
|
|
12
|
-
export declare function createScapiSchemasListTool(loadServices: () => Promise<Services> | Services): McpTool;
|
|
14
|
+
export declare function createScapiSchemasListTool(loadServices: () => Promise<Services> | Services, schemaCache?: ScapiLiveSchemaCache): McpTool;
|
|
@@ -16,6 +16,7 @@ import { z } from 'zod';
|
|
|
16
16
|
import { createToolAdapter, jsonResult } from '../adapter.js';
|
|
17
17
|
import { getApiErrorMessage } from '@salesforce/b2c-tooling-sdk/clients';
|
|
18
18
|
import { collapseOpenApiSchema } from '@salesforce/b2c-tooling-sdk/schemas';
|
|
19
|
+
import { createLiveScapiDocument, scapiTenantKey } from '@salesforce/b2c-tooling-sdk/scapi';
|
|
19
20
|
/**
|
|
20
21
|
* Builds the base URL for a SCAPI API endpoint.
|
|
21
22
|
*
|
|
@@ -52,10 +53,11 @@ function getSchemasApiError(error, response) {
|
|
|
52
53
|
* @param params.organizationId - Organization ID
|
|
53
54
|
* @param params.args - Input arguments with API identifiers
|
|
54
55
|
* @param params.shortCode - Optional short code for building base URL
|
|
56
|
+
* @param params.schemaCache - Optional live contract cache shared with SCAPI code mode
|
|
55
57
|
* @returns Schema fetch output
|
|
56
58
|
*/
|
|
57
59
|
async function fetchSpecificSchema(params) {
|
|
58
|
-
const { client, organizationId, args, shortCode } = params;
|
|
60
|
+
const { client, organizationId, args, shortCode, schemaCache } = params;
|
|
59
61
|
const { apiFamily, apiName, apiVersion, expandAll, status } = args;
|
|
60
62
|
// Warn if status filter was provided (it's ignored in fetch mode)
|
|
61
63
|
const warning = status
|
|
@@ -70,6 +72,15 @@ async function fetchSpecificSchema(params) {
|
|
|
70
72
|
if (error) {
|
|
71
73
|
throw new Error(`Failed to fetch schema for ${apiFamily}/${apiName}/${apiVersion}: ${getSchemasApiError(error, response)}`);
|
|
72
74
|
}
|
|
75
|
+
// Expanded tenant contracts become searchable and executable in SCAPI code mode.
|
|
76
|
+
if (schemaCache && shortCode && (args.expandCustomProperties !== false || apiFamily === 'custom')) {
|
|
77
|
+
try {
|
|
78
|
+
schemaCache.put(scapiTenantKey(shortCode, organizationId), createLiveScapiDocument({ apiFamily: apiFamily, apiName: apiName, apiVersion: apiVersion }, data));
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// Not a usable OpenAPI contract; still return it to the caller.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
73
84
|
// Apply collapsing unless expandAll is requested
|
|
74
85
|
const collapsed = !expandAll;
|
|
75
86
|
const processedSchema = collapsed
|
|
@@ -190,9 +201,10 @@ function getAvailableFilters(schemas) {
|
|
|
190
201
|
* Lists or fetches SCAPI schema specifications; includes standard SCAPI and custom API as schema types.
|
|
191
202
|
*
|
|
192
203
|
* @param loadServices - Function that loads configuration and returns Services instance
|
|
204
|
+
* @param schemaCache - Optional live contract cache shared with SCAPI code mode
|
|
193
205
|
* @returns MCP tool for listing/fetching SCAPI schemas
|
|
194
206
|
*/
|
|
195
|
-
export function createScapiSchemasListTool(loadServices) {
|
|
207
|
+
export function createScapiSchemasListTool(loadServices, schemaCache) {
|
|
196
208
|
return createToolAdapter({
|
|
197
209
|
name: 'scapi_schemas_list',
|
|
198
210
|
effect: 'read',
|
|
@@ -245,7 +257,7 @@ export function createScapiSchemasListTool(loadServices) {
|
|
|
245
257
|
}
|
|
246
258
|
// Execute appropriate mode
|
|
247
259
|
if (isFetchMode) {
|
|
248
|
-
return fetchSpecificSchema({ client, organizationId, args, shortCode });
|
|
260
|
+
return fetchSpecificSchema({ client, organizationId, args, shortCode, schemaCache });
|
|
249
261
|
}
|
|
250
262
|
return fetchSchemasList({ client, organizationId, args, shortCode });
|
|
251
263
|
},
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @salesforce/b2c-agent-plugins
|
|
2
2
|
|
|
3
|
+
## 1.10.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#720](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/pull/720) [`c1b0c17`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/c1b0c17e286a69a4945c9d66c0209c87b5441709) - Docs search now includes the OCAPI reference from B2C Commerce Developer Center (usage, hooks, settings, and best practices), available under the new `ocapi` category (45 articles). (Thanks [@clavery](https://github.com/clavery)!)
|
|
8
|
+
|
|
9
|
+
- [#723](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/pull/723) [`3172e1b`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/3172e1bff2e6bbb3246a87092c489a8f866b696e) - `scapi_search` can now search your instance's live SCAPI schemas with `schemas: "live"`, including your custom attributes, custom APIs, and APIs newer than the bundled reference. `scapi_execute` can then call what it found on the same instance. Offline search is still the default. (Thanks [@clavery](https://github.com/clavery)!)
|
|
10
|
+
|
|
11
|
+
- [#723](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/pull/723) [`3172e1b`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/3172e1bff2e6bbb3246a87092c489a8f866b696e) - `scapi_execute` can now call Shopper APIs as a guest shopper using your SLAS client, so any Storefront Next project works out of the box. The guest session persists across executions, so baskets carry over. Registered-shopper-only operations are not yet supported. (Thanks [@clavery](https://github.com/clavery)!)
|
|
12
|
+
|
|
3
13
|
## 1.10.2
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "b2c",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.3",
|
|
5
5
|
"description": "B2C Commerce development skills including Custom API development guides.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Salesforce"
|
|
@@ -206,6 +206,29 @@ b2c setup ide tsserver-plugin --json
|
|
|
206
206
|
|
|
207
207
|
The B2C DX VS Code extension needs no setup — it injects the same TypeScript Server plugin at runtime.
|
|
208
208
|
|
|
209
|
+
## OpenShell Sandbox (Beta)
|
|
210
|
+
|
|
211
|
+
`b2c setup openshell` creates an NVIDIA OpenShell sandbox from the resolved configuration. Secrets stay on the OpenShell gateway, and the sandbox can reach only the B2C hosts in use, at the configured Safety Mode level (or `NONE` if unset); Safety Mode rules carry over. Requires the `openshell` CLI with a running gateway, and Docker.
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Sandbox for the active instance at the configured Safety Mode level
|
|
215
|
+
b2c setup openshell
|
|
216
|
+
|
|
217
|
+
# Read-only sandbox
|
|
218
|
+
b2c setup openshell --safety-level READ_ONLY
|
|
219
|
+
|
|
220
|
+
# Allow writes but not deletes; include the MCP server
|
|
221
|
+
b2c setup openshell --safety-level NO_DELETE --mcp
|
|
222
|
+
|
|
223
|
+
# Write the policy, profiles, Dockerfile, and setup.sh without running anything
|
|
224
|
+
b2c setup openshell --dry-run
|
|
225
|
+
|
|
226
|
+
# Run a command in the sandbox
|
|
227
|
+
openshell sandbox exec -n b2c-<instance> -- b2c code list
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
Edit `.openshell/<sandbox>/policy.yaml` and re-run to apply it; use `--recreate` after changing secrets or configuration. Add hosts with `--allow-host`. Only client credentials work in the sandbox (no browser login). See the [Agent Sandboxing guide](https://salesforcecommercecloud.github.io/b2c-developer-tooling/guide/agent-sandboxing#openshell).
|
|
231
|
+
|
|
209
232
|
## Managing Instances
|
|
210
233
|
|
|
211
234
|
### List Configured Instances
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: b2c-docs
|
|
3
|
-
description: Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say "how do I implement passwordless login" or "what methods does Basket have" or "how do I deploy a PWA Kit bundle" or "how do I import a site archive" or "what SCAPI endpoints are available for checkout".
|
|
3
|
+
description: Search and read B2C Commerce documentation using the b2c CLI. Covers Script API reference (dw.* classes/modules), Developer Center guides (Commerce API, PWA Kit, SFRA, Storefront Next, B2C Commerce, OCAPI), Salesforce Help (Business Manager administration and merchandising), tooling documentation (CLI/MCP/SDK), standard job steps, and XSD schemas. Use this skill for ANY B2C Commerce developer or administrator question that is not already grounded in a loaded skill or the current project context — even if they just say "how do I implement passwordless login" or "what methods does Basket have" or "how do I deploy a PWA Kit bundle" or "how do I import a site archive" or "what SCAPI endpoints are available for checkout".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# B2C Docs Skill
|
|
@@ -15,7 +15,7 @@ Use the `b2c` CLI to search and read B2C Commerce documentation spanning multipl
|
|
|
15
15
|
|
|
16
16
|
## Key Features
|
|
17
17
|
|
|
18
|
-
- **Multi-corpus search** — Search across Script API, Developer Center guides, Salesforce Help (admin + merchandising), internal tooling docs (guides, CLI reference, MCP, and VS Code extension), job steps, and schemas in a unified index
|
|
18
|
+
- **Multi-corpus search** — Search across Script API, Developer Center guides, OCAPI reference, Salesforce Help (admin + merchandising), internal tooling docs (guides, CLI reference, MCP, and VS Code extension), job steps, and schemas in a unified index
|
|
19
19
|
- **Workspace-aware search** — Auto-detects project type (cartridges, SFRA, PWA Kit, Storefront Next) and boosts relevant documentation while de-boosting competing storefront frameworks
|
|
20
20
|
- **Category filtering** — Use `--category` to narrow results to a specific corpus (e.g., `commerce-api`, `pwa-kit-managed-runtime`, `sfra`, `script-api`, `help-admin`, `help-merchant`, `help-kb`)
|
|
21
21
|
- **Triage metadata** — Search results include `category`, `summary`, `keywords`, and `url` to help identify the right match without reading full content
|
|
@@ -114,7 +114,7 @@ The docs search understands which workspace framework your project uses and auto
|
|
|
114
114
|
|
|
115
115
|
**Category boost mapping:**
|
|
116
116
|
|
|
117
|
-
- Always relevant (any workspace): `b2c-commerce`, `tooling`
|
|
117
|
+
- Always relevant (any workspace): `b2c-commerce`, `ocapi`, `tooling`
|
|
118
118
|
- `cartridges` → `script-api`, `job-step`
|
|
119
119
|
- `sfra` → `sfra`
|
|
120
120
|
- `pwa-kit-v3` → `pwa-kit-managed-runtime`, `commerce-api`
|
|
@@ -239,6 +239,7 @@ xmllint --schema "$(b2c docs schema catalog --path)" my-catalog.xml --noout
|
|
|
239
239
|
| `sfra` | Storefront Reference Architecture (SFRA) guides | `sfra/controllers-and-routes` |
|
|
240
240
|
| `sfnext` | Storefront Next guides | `sfnext/sfnext-get-started` |
|
|
241
241
|
| `b2c-commerce` | General B2C Commerce platform guides | `b2c-commerce/business-manager-overview` |
|
|
242
|
+
| `ocapi` | OCAPI reference — usage, hooks, settings, and best practices for the Open Commerce API | `ocapi/ocapisettings`, `ocapi/bestpractices` |
|
|
242
243
|
| `tooling` | B2C CLI reference, guides, MCP docs, SDK guidance, and VS Code extension docs | `guide-authentication`, `cli-jobs` |
|
|
243
244
|
| `job-step` | Standard (system) job step catalog | `ImportCatalog`, `ExportCatalog`, `job-steps` |
|
|
244
245
|
| `help-admin` | Salesforce Help — administration/ops (import/export, jobs, replication, security, Account Manager, permissions, logs, inventory) | `help-admin/b2c_site_import_export` |
|
package/node_modules/@salesforce/b2c-agent-plugins/b2c-cli/skills/b2c-scapi-schemas/SKILL.md
CHANGED
|
@@ -9,10 +9,12 @@ Browse standard or tenant-specific SCAPI OpenAPI contracts.
|
|
|
9
9
|
|
|
10
10
|
## Tool choice
|
|
11
11
|
|
|
12
|
-
When B2C MCP is available, prefer
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
When B2C MCP is available, prefer `scapi_search` for Admin and Shopper contracts.
|
|
13
|
+
Read `skill://mcp/scapi/SKILL.md` via resource or `skills_read` first; pass
|
|
14
|
+
`skillRead: true`. Discover method/path/operationId, then selected inputs and
|
|
15
|
+
fields. The default searches bundled standard contracts offline; `schemas: "live"`
|
|
16
|
+
searches the tenant's contracts (custom attributes, custom APIs, newer APIs) and
|
|
17
|
+
makes them callable from `scapi_execute`.
|
|
16
18
|
|
|
17
19
|
Use `scapi_schemas_list` for live schemas, custom attributes, and custom APIs.
|
|
18
20
|
For tenant fields, supply API family/name/version and `includeSchemas: true`.
|
|
@@ -20,9 +22,9 @@ Custom-property expansion defaults to true; `expandAll: true` preserves full def
|
|
|
20
22
|
For large schemas, fetch/filter through code mode as described in the MCP SCAPI skill.
|
|
21
23
|
Use `scapi_custom_apis_get_status` for registration status. Live schema access needs
|
|
22
24
|
`sfcc.scapi-schemas`. Prefer a dedicated task tool for execution, otherwise
|
|
23
|
-
`scapi_execute` supports Admin JSON calls with configured auth/scopes. For custom
|
|
25
|
+
`scapi_execute` supports Admin and guest Shopper JSON calls with configured auth/scopes. For custom
|
|
24
26
|
Admin endpoints, fetch the live contract through `scapi.request` in each program
|
|
25
|
-
before calling it; follow the MCP SCAPI skill.
|
|
27
|
+
before calling it; follow the MCP SCAPI skill. Registered-shopper and binary execution are
|
|
26
28
|
unsupported. Use docs tools for semantics
|
|
27
29
|
and limits rather than duplicating contract discovery.
|
|
28
30
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "b2c-ops",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.3",
|
|
5
5
|
"description": "B2C Commerce operator and administrator runbooks for job health, checkout and failed orders, and incident triage.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Salesforce"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "storefront-next",
|
|
4
|
-
"version": "1.10.
|
|
4
|
+
"version": "1.10.3",
|
|
5
5
|
"description": "Storefront Next development skills for building React 19 storefronts on Salesforce B2C Commerce.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Salesforce"
|
package/oclif.manifest.json
CHANGED
|
@@ -230,6 +230,20 @@
|
|
|
230
230
|
"multiple": false,
|
|
231
231
|
"type": "option"
|
|
232
232
|
},
|
|
233
|
+
"client-auth-method": {
|
|
234
|
+
"description": "How the client ID and secret are sent to Account Manager (default: basic)",
|
|
235
|
+
"env": "SFCC_CLIENT_AUTH_METHOD",
|
|
236
|
+
"helpGroup": "AUTH",
|
|
237
|
+
"name": "client-auth-method",
|
|
238
|
+
"hasDynamicHelp": false,
|
|
239
|
+
"multiple": false,
|
|
240
|
+
"options": [
|
|
241
|
+
"basic",
|
|
242
|
+
"basic-unencoded",
|
|
243
|
+
"body"
|
|
244
|
+
],
|
|
245
|
+
"type": "option"
|
|
246
|
+
},
|
|
233
247
|
"jwt-cert": {
|
|
234
248
|
"description": "Path to JWT certificate file (cert.pem) for JWT Bearer authentication",
|
|
235
249
|
"env": "SFCC_JWT_CERT",
|
|
@@ -444,7 +458,7 @@
|
|
|
444
458
|
"type": "option"
|
|
445
459
|
},
|
|
446
460
|
"docs-topics": {
|
|
447
|
-
"description": "Limit the documentation exposed by the docs tools to these categories (comma-separated allowlist). Options: script-api, job-step, commerce-api, pwa-kit-managed-runtime, sfnext, sfra, b2c-commerce, tooling, help-admin, help-merchant, help-kb. Bounds the whole docs corpus; per-call category/storefront narrow within it. Unknown names are ignored.",
|
|
461
|
+
"description": "Limit the documentation exposed by the docs tools to these categories (comma-separated allowlist). Options: script-api, job-step, commerce-api, pwa-kit-managed-runtime, sfnext, sfra, b2c-commerce, ocapi, tooling, help-admin, help-merchant, help-kb. Bounds the whole docs corpus; per-call category/storefront narrow within it. Unknown names are ignored.",
|
|
448
462
|
"env": "SFCC_DOCS_TOPICS",
|
|
449
463
|
"name": "docs-topics",
|
|
450
464
|
"hasDynamicHelp": false,
|
|
@@ -462,5 +476,5 @@
|
|
|
462
476
|
"enableJsonFlag": false
|
|
463
477
|
}
|
|
464
478
|
},
|
|
465
|
-
"version": "3.
|
|
479
|
+
"version": "3.2.0"
|
|
466
480
|
}
|
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": "3.
|
|
4
|
+
"version": "3.2.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": "SalesforceCommerceCloud/b2c-developer-tooling",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"ts-morph": "27.0.2",
|
|
81
81
|
"yaml": "2.9.0",
|
|
82
82
|
"zod": "4.5.4",
|
|
83
|
-
"@salesforce/b2c-agent-plugins": "1.10.
|
|
84
|
-
"@salesforce/b2c-tooling-sdk": "2.
|
|
83
|
+
"@salesforce/b2c-agent-plugins": "1.10.3",
|
|
84
|
+
"@salesforce/b2c-tooling-sdk": "2.3.0"
|
|
85
85
|
},
|
|
86
86
|
"bundledDependencies": [
|
|
87
87
|
"@modelcontextprotocol/server",
|