@salesforce/b2c-dx-mcp 3.2.0 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,7 +91,7 @@ export class ScapiExecution {
91
91
  `${request.method} ${path}`,
92
92
  ...(Object.keys(request.query).length > 0 ? [`Query:\n${preview(request.query)}`] : []),
93
93
  ...(request.body === undefined ? [] : [`Body:\n${preview(request.body)}`]),
94
- 'Safety Mode requires approval. Declining stops this execution.',
94
+ 'Safety Mode requires approval. Accept sends this request only; declining stops this execution.',
95
95
  earlierWrites ? `Earlier write requests sent: ${earlierWrites}; no rollback.` : 'No earlier writes.',
96
96
  `Execution: ${this.id}`,
97
97
  ].join('\n');
@@ -101,11 +101,8 @@ export class ScapiExecution {
101
101
  inputRequests: {
102
102
  [key]: inputRequired.elicit({
103
103
  message,
104
- requestedSchema: {
105
- type: 'object',
106
- properties: { approve: { type: 'boolean', title: 'Approve this request only', default: false } },
107
- required: ['approve'],
108
- },
104
+ // No fields: the client's own accept/decline/cancel buttons carry the decision.
105
+ requestedSchema: { type: 'object', properties: {} },
109
106
  }),
110
107
  },
111
108
  }),
@@ -191,11 +188,14 @@ export class ScapiExecution {
191
188
  this.event = deferred();
192
189
  round.responded = true;
193
190
  const result = this.wait(context);
194
- if (!context.supportsElicitation || response.action !== 'accept' || response.content?.approve !== true) {
195
- this.cancel('SCAPI_APPROVAL_DECLINED: execution cancelled without sending the pending request.');
191
+ if (context.supportsElicitation && response.action === 'accept') {
192
+ round.decision.resolve();
193
+ }
194
+ else if (response.action === 'cancel') {
195
+ this.cancel('SCAPI_APPROVAL_CANCELLED: approval dismissed; execution cancelled without sending the pending request.');
196
196
  }
197
197
  else {
198
- round.decision.resolve();
198
+ this.cancel('SCAPI_APPROVAL_DECLINED: execution cancelled without sending the pending request.');
199
199
  }
200
200
  return result;
201
201
  }
@@ -476,5 +476,5 @@
476
476
  "enableJsonFlag": false
477
477
  }
478
478
  },
479
- "version": "3.2.0"
479
+ "version": "3.2.1"
480
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.2.0",
4
+ "version": "3.2.1",
5
5
  "author": "Salesforce",
6
6
  "license": "Apache-2.0",
7
7
  "repository": "SalesforceCommerceCloud/b2c-developer-tooling",