Skip to content

Commit 462bf6b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into W-21112167-Replications-API
2 parents 1fe65b7 + c2df074 commit 462bf6b

86 files changed

Lines changed: 1220 additions & 277 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/job-log-command.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/.vitepress/config.mts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,16 @@ const referenceSidebar = [
103103
items: [
104104
{text: 'cartridge_deploy', link: '/mcp/tools/cartridge-deploy'},
105105
{text: 'mrt_bundle_push', link: '/mcp/tools/mrt-bundle-push'},
106-
{text: 'pwakit_development_guidelines', link: '/mcp/tools/pwakit-development-guidelines'},
106+
{text: 'pwakit_get_guidelines', link: '/mcp/tools/pwakit-get-guidelines'},
107107
{text: 'scapi_schemas_list', link: '/mcp/tools/scapi-schemas-list'},
108-
{text: 'scapi_custom_api_scaffold', link: '/mcp/tools/scapi-custom-api-scaffold'},
109-
{text: 'scapi_custom_apis_status', link: '/mcp/tools/scapi-custom-apis-status'},
110-
{text: 'storefront_next_development_guidelines', link: '/mcp/tools/storefront-next-development-guidelines'},
111-
{text: 'storefront_next_figma_to_component_workflow', link: '/mcp/tools/storefront-next-figma-to-component-workflow'},
112-
{text: 'storefront_next_generate_component', link: '/mcp/tools/storefront-next-generate-component'},
113-
{text: 'storefront_next_map_tokens_to_theme', link: '/mcp/tools/storefront-next-map-tokens-to-theme'},
114-
{text: 'storefront_next_page_designer_decorator', link: '/mcp/tools/storefront-next-page-designer-decorator'},
115-
{text: 'storefront_next_site_theming', link: '/mcp/tools/storefront-next-site-theming'},
108+
{text: 'scapi_custom_api_generate_scaffold', link: '/mcp/tools/scapi-custom-api-generate-scaffold'},
109+
{text: 'scapi_custom_apis_get_status', link: '/mcp/tools/scapi-custom-apis-get-status'},
110+
{text: 'sfnext_get_guidelines', link: '/mcp/tools/sfnext-get-guidelines'},
111+
{text: 'sfnext_start_figma_workflow', link: '/mcp/tools/sfnext-start-figma-workflow'},
112+
{text: 'sfnext_analyze_component', link: '/mcp/tools/sfnext-analyze-component'},
113+
{text: 'sfnext_match_tokens_to_theme', link: '/mcp/tools/sfnext-match-tokens-to-theme'},
114+
{text: 'sfnext_add_page_designer_decorator', link: '/mcp/tools/sfnext-add-page-designer-decorator'},
115+
{text: 'sfnext_configure_theme', link: '/mcp/tools/sfnext-configure-theme'},
116116
],
117117
},
118118
];

docs/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @salesforce/b2c-dx-docs
22

3+
## 0.2.6
4+
5+
### Patch Changes
6+
7+
- [#270](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/pull/270) [`bf35222`](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/commit/bf352223881dccba4ba07c62bdf4d50a2832c835) - Rename MCP tools for clearer, action-oriented naming. scapi_custom_api_scaffold → scapi_custom_api_generate_scaffold. sfnext_map_tokens_to_theme → sfnext_match_tokens_to_theme. (Thanks [@yhsieh1](https://github.com/yhsieh1)!)
8+
39
## 0.2.5
410

511
### Patch Changes

docs/cli/index.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,32 @@ These flags are available on all commands that interact with B2C instances:
2727
| `--username`, `-u` | `SFCC_USERNAME` | Username for Basic Auth |
2828
| `--password`, `-p` | `SFCC_PASSWORD` | Password/access key for Basic Auth |
2929

30+
### Safety Mode
31+
32+
Safety Mode provides protection against accidental or unwanted destructive operations. This is particularly important when using the CLI in automated environments, CI/CD pipelines, or as a tool for AI agents.
33+
34+
| Environment Variable | Values | Description |
35+
| ---------------------- | ------ | ----------- |
36+
| `SFCC_SAFETY_LEVEL` | `NONE` (default) | No restrictions |
37+
| | `NO_DELETE` | Block DELETE operations |
38+
| | `NO_UPDATE` | Block DELETE and destructive operations (reset, stop, restart) |
39+
| | `READ_ONLY` | Block all write operations (GET only) |
40+
41+
**Example:**
42+
```bash
43+
# Prevent deletions in CI/CD
44+
export SFCC_SAFETY_LEVEL=NO_DELETE
45+
b2c sandbox create --realm test # ✅ Allowed
46+
b2c sandbox delete test-id # ❌ Blocked
47+
48+
# Read-only mode for reporting
49+
export SFCC_SAFETY_LEVEL=READ_ONLY
50+
b2c sandbox list # ✅ Allowed
51+
b2c sandbox create --realm test # ❌ Blocked
52+
```
53+
54+
Safety Mode operates at the HTTP layer and cannot be bypassed by command-line flags. See the [Security Guide](/guide/security#operational-security-safety-mode) for detailed information.
55+
3056
### Other Environment Variables
3157

3258
| Environment Variable | Description |

docs/guide/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ You can configure the CLI using environment variables:
8282
| `MRT_PROJECT` | MRT project slug (`SFCC_MRT_PROJECT` also supported) |
8383
| `MRT_ENVIRONMENT` | MRT environment name (`SFCC_MRT_ENVIRONMENT`, `MRT_TARGET` also supported) |
8484
| `MRT_CLOUD_ORIGIN` | MRT API origin URL override (`SFCC_MRT_CLOUD_ORIGIN` also supported) |
85+
| `SFCC_SAFETY_LEVEL` | Safety mode: `NONE`, `NO_DELETE`, `NO_UPDATE`, `READ_ONLY` (see [Safety Mode](/guide/security#operational-security-safety-mode)) |
8586

8687
## .env File
8788

docs/guide/security.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,44 @@ When adding a new dependency that requires build scripts:
6464

6565
This project uses [NPM trusted publishers](https://docs.npmjs.com/trusted-publishers) for package publication. Instead of storing long-lived npm tokens, packages are published via GitHub Actions using short-lived OIDC tokens that cannot be extracted or reused.
6666

67+
## Operational Security: Safety Mode
68+
69+
The CLI includes a **Safety Mode** feature via CLI checks and HTTP middleware that prevents accidental or unwanted destructive operations. This is particularly important when:
70+
71+
- Providing the CLI as a tool to AI agents/LLMs
72+
- Working in production environments
73+
- Training new team members
74+
- Running commands from untrusted scripts
75+
76+
### Safety Levels
77+
78+
Configure via the `SFCC_SAFETY_LEVEL` environment variable:
79+
80+
| Level | Description | Blocks |
81+
|-------|-------------|--------|
82+
| `NONE` | No restrictions (default) | Nothing |
83+
| `NO_DELETE` | Prevent deletions | DELETE operations |
84+
| `NO_UPDATE` | Prevent deletions and destructive updates | DELETE + reset/stop/restart |
85+
| `READ_ONLY` | Read-only mode | All writes (POST/PUT/PATCH/DELETE) |
86+
87+
### Usage
88+
89+
```bash
90+
# Default - no restrictions
91+
export SFCC_SAFETY_LEVEL=NONE
92+
93+
# Prevent deletions
94+
export SFCC_SAFETY_LEVEL=NO_DELETE
95+
96+
# Prevent deletions and destructive updates
97+
export SFCC_SAFETY_LEVEL=NO_UPDATE
98+
99+
# Read-only mode
100+
export SFCC_SAFETY_LEVEL=READ_ONLY
101+
```
102+
103+
Environment variables are used instead of command-line flags because LLMs control commands and flags, but not the environment.
104+
67105
## Best Practices
68106

69107
### For Contributors
@@ -78,3 +116,4 @@ This project uses [NPM trusted publishers](https://docs.npmjs.com/trusted-publis
78116
- Keep the CLI updated to receive security patches
79117
- Review the `pnpm-workspace.yaml` settings if you fork or modify this project
80118
- Consider using similar protections in your own projects
119+
- **Use Safety Mode** when running CLI in automated environments or providing it as a tool to AI agents

docs/mcp/figma-tools-setup.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Prerequisites and setup for Figma-to-component tools (workflow orch
44

55
# Figma-to-Component Tools Setup
66

7-
Prerequisites and setup for using the Figma workflow tools: `storefront_next_figma_to_component_workflow`, `storefront_next_generate_component`, and `storefront_next_map_tokens_to_theme`.
7+
Prerequisites and setup for using the Figma workflow tools: `sfnext_start_figma_workflow`, `sfnext_analyze_component`, and `sfnext_match_tokens_to_theme`.
88

99
> **Note:** 🚧 This MCP tool is for Storefront Next. Storefront Next is part of a closed pilot and isn't available for general use.
1010
@@ -15,7 +15,7 @@ The Figma-to-component workflow requires an **external Figma MCP server** to fet
1515
**Prerequisites:**
1616
- b2c-dx-mcp configured with `--allow-non-ga-tools` flag (Figma tools are preview)
1717
- Storefront Next project
18-
- `app.css` theme file (required for `storefront_next_map_tokens_to_theme` tool; optional path can be provided)
18+
- `app.css` theme file (required for `sfnext_match_tokens_to_theme` tool; optional path can be provided)
1919
- External Figma MCP server enabled in your MCP client
2020

2121
See [Installation](./installation) for b2c-dx-mcp setup.
@@ -49,8 +49,8 @@ If the Figma MCP server is not enabled, the workflow tool will still return inst
4949

5050
## Related Documentation
5151

52-
- [storefront_next_figma_to_component_workflow](./tools/storefront-next-figma-to-component-workflow) - Workflow orchestrator (call first)
53-
- [storefront_next_generate_component](./tools/storefront-next-generate-component) - REUSE/EXTEND/CREATE recommendation
54-
- [storefront_next_map_tokens_to_theme](./tools/storefront-next-map-tokens-to-theme) - Token mapping
52+
- [sfnext_start_figma_workflow](./tools/sfnext-start-figma-workflow) - Workflow orchestrator (call first)
53+
- [sfnext_analyze_component](./tools/sfnext-analyze-component) - REUSE/EXTEND/CREATE recommendation
54+
- [sfnext_match_tokens_to_theme](./tools/sfnext-match-tokens-to-theme) - Token mapping
5555
- [STOREFRONTNEXT Toolset](./toolsets#storefrontnext) - Overview of Storefront Next tools
5656
- [Figma MCP Server Documentation](https://developers.figma.com/docs/figma-mcp-server) - Official Figma MCP setup

docs/mcp/tools/pwakit-development-guidelines.md renamed to docs/mcp/tools/pwakit-get-guidelines.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
description: Get PWA Kit v3 development guidelines and best practices for React, Chakra UI, and Commerce API.
33
---
44

5-
# pwakit_development_guidelines
5+
# pwakit_get_guidelines
66

77
Returns critical architecture rules, coding standards, and best practices for building PWA Kit v3 applications with React, Chakra UI, and Commerce API.
88

99
## Overview
1010

11-
The `pwakit_development_guidelines` tool provides essential development guidance for PWA Kit v3. It:
11+
The `pwakit_get_guidelines` tool provides essential development guidance for PWA Kit v3. It:
1212

1313
1. Returns comprehensive guidelines by default (quick-reference plus key sections).
1414
2. Supports retrieving specific topic sections on demand.

docs/mcp/tools/scapi-custom-api-scaffold.md renamed to docs/mcp/tools/scapi-custom-api-generate-scaffold.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
description: Generate a new custom SCAPI endpoint (OAS 3.0 schema, api.json, script.js) in an existing cartridge.
33
---
44

5-
# scapi_custom_api_scaffold
5+
# scapi_custom_api_generate_scaffold
66

77
Generate a new custom SCAPI endpoint in an existing cartridge. Creates `schema.yaml` (OAS 3.0 contract), `api.json` (endpoint mapping), and `script.js` (implementation) under the cartridge's `rest-apis/<apiName>/` directory.
88

99
## Overview
1010

11-
The `scapi_custom_api_scaffold` tool scaffolds a new custom API using the B2C tooling SDK's `custom-api` scaffold. It:
11+
The `scapi_custom_api_generate_scaffold` tool scaffolds a new custom API using the B2C tooling SDK's `custom-api` scaffold. It:
1212

1313
- Creates an OpenAPI 3.0 schema, API manifest, and script stub in your project.
1414
- Uses the first cartridge found in the project if you don't specify one.
1515
- Supports **shopper** (siteId, customer-facing) or **admin** (no siteId) API types.
1616

17-
**No instance or OAuth required** — this tool works locally and only writes files into your project. To check registration status after deployment, use [`scapi_custom_apis_status`](./scapi-custom-apis-status).
17+
**No instance or OAuth required** — this tool works locally and only writes files into your project. To check registration status after deployment, use [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status).
1818

1919
## Parameters
2020

@@ -78,15 +78,15 @@ Returns the scaffold ID, output directory, and list of created files:
7878
1. **Edit** `schema.yaml` to define paths, request/response schemas, and operation IDs.
7979
2. **Edit** `script.js` to implement the endpoint logic.
8080
3. **Deploy** the cartridge to your instance and **activate** the code version to register the API.
81-
4. **Verify** with [`scapi_custom_apis_status`](./scapi-custom-apis-status) that endpoints show as `active`.
81+
4. **Verify** with [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status) that endpoints show as `active`.
8282

8383
Shopper APIs are available at:
8484
`https://{shortCode}.api.commercecloud.salesforce.com/custom/{apiName}/v1/organizations/{organizationId}/...` and require the `siteId` query parameter and ShopperToken authentication.
8585

8686
## Related Tools
8787

8888
- Part of the [SCAPI](../toolsets#scapi), [PWAV3](../toolsets#pwav3), and [STOREFRONTNEXT](../toolsets#storefrontnext) toolsets
89-
- [`scapi_custom_apis_status`](./scapi-custom-apis-status) — Check custom API endpoint registration status after deployment
89+
- [`scapi_custom_apis_get_status`](./scapi-custom-apis-get-status) — Check custom API endpoint registration status after deployment
9090
- [`scapi_schemas_list`](./scapi-schemas-list) — List or fetch custom API schemas (use `apiFamily: "custom"`)
9191

9292
## See Also

docs/mcp/tools/scapi-custom-apis-status.md renamed to docs/mcp/tools/scapi-custom-apis-get-status.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
description: Check the registration status of custom SCAPI endpoints deployed on your B2C Commerce instance.
33
---
44

5-
# scapi_custom_apis_status
5+
# scapi_custom_apis_get_status
66

77
List custom SCAPI endpoint registration status (active/not_registered). Returns one row per endpoint per site with detailed status information.
88

99
## Overview
1010

1111
Checks the registration status of custom API endpoints deployed on your B2C Commerce instance. Returns endpoint status (`active` or `not_registered`) with per-site details.
1212

13-
**Note:** This tool queries your live instance. For schema definitions, use [`scapi_schemas_list`](./scapi-schemas-list) with `apiFamily: "custom"`. To create a new custom API, use [`scapi_custom_api_scaffold`](./scapi-custom-api-scaffold).
13+
**Note:** This tool queries your live instance. For schema definitions, use [`scapi_schemas_list`](./scapi-schemas-list) with `apiFamily: "custom"`. To create a new custom API, use [`scapi_custom_api_generate_scaffold`](./scapi-custom-api-generate-scaffold).
1414

1515
## Authentication
1616

0 commit comments

Comments
 (0)