@m2msentinel/sdk 1.2.0 → 1.2.2

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/README.md CHANGED
@@ -40,13 +40,13 @@ Autonomous agents handling value must never rely on a single oracle or heuristic
40
40
  npm install @m2msentinel/sdk
41
41
 
42
42
  # Or unscoped package
43
- npm install m2m-sentinel-sdk@1.2.0
43
+ npm install m2m-sentinel-sdk@1.2.2
44
44
  ```
45
45
 
46
46
  ### Python (PyPI)
47
47
 
48
48
  ```bash
49
- pip install m2m-sentinel==1.2.0
49
+ pip install m2m-sentinel==1.2.2
50
50
  ```
51
51
 
52
52
  ### MCP Server (Model Context Protocol)
package/agent_adapter.js CHANGED
@@ -67,7 +67,7 @@ class M2MSentinelActionProvider {
67
67
 
68
68
  const headers = {
69
69
  Accept: 'application/json',
70
- 'User-Agent': 'M2MSentinel-AgentKit/1.2.0',
70
+ 'User-Agent': 'M2MSentinel-AgentKit/1.2.2',
71
71
  ...options.headers
72
72
  };
73
73
  if (this.apiKey && !headers['x-api-key']) {
package/mcp_server.js CHANGED
@@ -8,7 +8,7 @@ const readline = require('readline');
8
8
  let BASE_URL = process.env.M2M_SENTINEL_BASE_URL || 'https://api.m2msentinel.com';
9
9
  let API_KEY = process.env.M2M_SENTINEL_API_KEY || '';
10
10
  const TIMEOUT_MS = Number(process.env.M2M_SENTINEL_TIMEOUT_MS || 30000);
11
- const VERSION = '1.2.0';
11
+ const VERSION = '1.2.2';
12
12
 
13
13
  const TOOLS = [
14
14
  {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@m2msentinel/sdk",
3
- "version": "1.2.0",
4
- "mcpName": "io.github.m2m-sentinel/m2m-sentinel-sdk",
3
+ "version": "1.2.2",
4
+ "mcpName": "io.github.M2M-Sentinel/m2m-sentinel-sdk",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "m2m-sentinel-sdk",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "Source-distributed TypeScript client for M2M Sentinel Base capability intelligence API",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -39,6 +39,9 @@ export interface X402PaymentChallenge {
39
39
  export interface X402SignedAuthorizationV2 {
40
40
  x402Version: 2;
41
41
  resource?: any;
42
+ /** The server's advertised extensions, echoed back. The CDP Bazaar indexes a
43
+ * resource from the bazaar extension carried by the settlement. */
44
+ extensions?: any;
42
45
  /** The chosen offer echoed back verbatim. The server deep-equality matches
43
46
  * this against its own requirements to learn which offer is being paid. */
44
47
  accepted: any;
@@ -271,6 +274,12 @@ export class X402SignerClient {
271
274
  x402Version: 2,
272
275
  resource: challenge.resource,
273
276
  accepted: offer,
277
+ // Echo the server's advertised extensions back. The canonical client
278
+ // merges paymentRequired.extensions into the payload; omitting the
279
+ // field still settles the payment, so this failed silently -- but the
280
+ // CDP Bazaar indexes a resource from the bazaar extension carried by
281
+ // the settlement, so a payment without it is invisible to discovery.
282
+ extensions: challenge.extensions,
274
283
  payload: {
275
284
  authorization: {
276
285
  from: fromAddress,
@@ -309,7 +318,7 @@ export class X402SignerClient {
309
318
 
310
319
  async fetchWithAutoPayment(path: string, options: any = {}): Promise<any> {
311
320
  const url = path.startsWith('http') ? path : `${this.baseUrl}/${path.replace(/^\/+/, '')}`;
312
- const headers = { 'Accept': 'application/json', 'User-Agent': '@m2msentinel/sdk-ts/1.2.0', ...(options.headers || {}) };
321
+ const headers = { 'Accept': 'application/json', 'User-Agent': '@m2msentinel/sdk-ts/1.2.2', ...(options.headers || {}) };
313
322
 
314
323
  let res = await fetch(url, { method: options.method || 'GET', headers, body: options.body });
315
324
  if (res.status !== 402) {
package/x402_signer.js CHANGED
@@ -189,6 +189,12 @@ class X402SignerClient {
189
189
  x402Version: 2,
190
190
  resource: challenge.resource,
191
191
  accepted: offer,
192
+ // Echo the server's advertised extensions back. The canonical client
193
+ // merges paymentRequired.extensions into the payload; omitting the
194
+ // field still settles the payment, so this failed silently -- but the
195
+ // CDP Bazaar indexes a resource from the bazaar extension carried by
196
+ // the settlement, so a payment without it is invisible to discovery.
197
+ extensions: challenge.extensions,
192
198
  payload: {
193
199
  authorization: {
194
200
  from: message.from,
@@ -265,7 +271,7 @@ class X402SignerClient {
265
271
  path: url.pathname + url.search,
266
272
  method: options.method || 'GET',
267
273
  headers: {
268
- 'User-Agent': 'M2M-Sentinel-X402Signer/1.2.0',
274
+ 'User-Agent': 'M2M-Sentinel-X402Signer/1.2.2',
269
275
  'Accept': 'application/json',
270
276
  ...(options.headers || {})
271
277
  },