@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 +2 -2
- package/agent_adapter.js +1 -1
- package/mcp_server.js +1 -1
- package/package.json +2 -2
- package/typescript/package.json +1 -1
- package/typescript/x402.ts +10 -1
- package/x402_signer.js +7 -1
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.
|
|
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.
|
|
49
|
+
pip install m2m-sentinel==1.2.2
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
### MCP Server (Model Context Protocol)
|
package/agent_adapter.js
CHANGED
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.
|
|
11
|
+
const VERSION = '1.2.2';
|
|
12
12
|
|
|
13
13
|
const TOOLS = [
|
|
14
14
|
{
|
package/package.json
CHANGED
package/typescript/package.json
CHANGED
package/typescript/x402.ts
CHANGED
|
@@ -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.
|
|
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.
|
|
274
|
+
'User-Agent': 'M2M-Sentinel-X402Signer/1.2.2',
|
|
269
275
|
'Accept': 'application/json',
|
|
270
276
|
...(options.headers || {})
|
|
271
277
|
},
|