@devlab.group/agent-commerce 2.8.0 → 2.9.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.
- package/README.md +28 -21
- package/dist/ap2.js +2 -2
- package/dist/{chunk-WDD2ZUR3.js → chunk-46Y5M7BA.js} +3 -2
- package/dist/chunk-46Y5M7BA.js.map +1 -0
- package/dist/{chunk-ENK63GKR.js → chunk-J3K7E4CA.js} +3 -3
- package/dist/{chunk-ENK63GKR.js.map → chunk-J3K7E4CA.js.map} +1 -1
- package/dist/{cli/chunk-APC5BTQM.js → chunk-RF3DFVXH.js} +2 -2
- package/dist/{chunk-IWXVQYG5.js.map → chunk-RF3DFVXH.js.map} +1 -1
- package/dist/{chunk-QZW5YL3G.js → chunk-TEI6GTUG.js} +7 -3
- package/dist/chunk-TEI6GTUG.js.map +1 -0
- package/dist/cli/{ap2-GYKFGE66.js → ap2-MUNB4HHC.js} +5 -5
- package/dist/cli/{ap2-GYKFGE66.js.map → ap2-MUNB4HHC.js.map} +1 -1
- package/dist/cli/{chunk-DKWO6LLX.js → chunk-4WPHZLVO.js} +3 -2
- package/dist/cli/chunk-4WPHZLVO.js.map +1 -0
- package/dist/cli/chunk-JP5NQ5II.js +8 -0
- package/dist/cli/{chunk-SAAT2XFX.js.map → chunk-JP5NQ5II.js.map} +1 -1
- package/dist/cli/chunk-KLKNFJTT.js +540 -0
- package/dist/cli/chunk-KLKNFJTT.js.map +1 -0
- package/dist/cli/{chunk-WFIR374D.js → chunk-L264N3ZV.js} +41 -5
- package/dist/cli/chunk-L264N3ZV.js.map +1 -0
- package/dist/cli/{chunk-VWQMSWDF.js → chunk-RAWPZIG6.js} +7 -3
- package/dist/cli/chunk-RAWPZIG6.js.map +1 -0
- package/dist/cli/{chunk-SYXLQ5BS.js → chunk-SEDRU2KV.js} +5 -5
- package/dist/cli/{chunk-SYXLQ5BS.js.map → chunk-SEDRU2KV.js.map} +1 -1
- package/dist/cli/{chunk-3PGFOEVJ.js → chunk-SHIA2B6G.js} +32 -6
- package/dist/cli/chunk-SHIA2B6G.js.map +1 -0
- package/dist/{chunk-IWXVQYG5.js → cli/chunk-UV23DWUY.js} +2 -2
- package/dist/cli/{chunk-APC5BTQM.js.map → chunk-UV23DWUY.js.map} +1 -1
- package/dist/cli/{chunk-YXXPZFWC.js → chunk-UX7GRVL4.js} +126 -18
- package/dist/cli/chunk-UX7GRVL4.js.map +1 -0
- package/dist/cli/{config-JWMHWVRT.js → config-IBG46HTQ.js} +6 -6
- package/dist/cli/{config-JWMHWVRT.js.map → config-IBG46HTQ.js.map} +1 -1
- package/dist/cli/index.js +34 -14
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/{mcp-OW5GY7TT.js → mcp-55FLXKCC.js} +3 -3
- package/dist/cli/{mcp-OW5GY7TT.js.map → mcp-55FLXKCC.js.map} +1 -1
- package/dist/cli/payment-providers-4OC2TONC.js +6 -0
- package/dist/cli/{payment-providers-QL2BJYMD.js.map → payment-providers-4OC2TONC.js.map} +1 -1
- package/dist/cli/{provider-3A2LVEQS.js → provider-H57SJDEJ.js} +4 -4
- package/dist/cli/{provider-3A2LVEQS.js.map → provider-H57SJDEJ.js.map} +1 -1
- package/dist/cli/receipts-SMX4MFO5.js +9 -0
- package/dist/cli/{receipts-FQUFGEQD.js.map → receipts-SMX4MFO5.js.map} +1 -1
- package/dist/cli/{run-KF5OQYPL.js → run-BS7323JH.js} +830 -184
- package/dist/cli/run-BS7323JH.js.map +1 -0
- package/dist/cli/{x402-5A7CVCIJ.js → x402-RNV3VHJT.js} +5 -5
- package/dist/cli/{x402-5A7CVCIJ.js.map → x402-RNV3VHJT.js.map} +1 -1
- package/dist/index.d.ts +74 -31
- package/dist/index.js +1410 -270
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +1 -1
- package/dist/mpp.js +2 -2
- package/dist/{store-BzgwHOPu.d.ts → store-04pazhFP.d.ts} +52 -1
- package/dist/testing.js +468 -273
- package/dist/testing.js.map +1 -1
- package/dist/x402.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-QZW5YL3G.js.map +0 -1
- package/dist/chunk-WDD2ZUR3.js.map +0 -1
- package/dist/cli/chunk-3PGFOEVJ.js.map +0 -1
- package/dist/cli/chunk-6BWEHQPJ.js +0 -215
- package/dist/cli/chunk-6BWEHQPJ.js.map +0 -1
- package/dist/cli/chunk-DKWO6LLX.js.map +0 -1
- package/dist/cli/chunk-SAAT2XFX.js +0 -8
- package/dist/cli/chunk-VWQMSWDF.js.map +0 -1
- package/dist/cli/chunk-WFIR374D.js.map +0 -1
- package/dist/cli/chunk-YXXPZFWC.js.map +0 -1
- package/dist/cli/payment-providers-QL2BJYMD.js +0 -6
- package/dist/cli/receipts-FQUFGEQD.js +0 -9
- package/dist/cli/run-KF5OQYPL.js.map +0 -1
package/dist/mcp.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MCP_TOOL_NAME_PATTERN, readCappedBody, MCP_MODERN_PROTOCOL_REVISION, x402ErrorCode, settlementFailure, settlementResponseFromDetails, x402McpPaymentSubmission, X402_MCP_PAYMENT_META_KEY, X402_MCP_PAYMENT_RESPONSE_META_KEY, settlementResponse, X402_MCP_ERROR_META_KEY } from './chunk-2PVRHMVT.js';
|
|
2
2
|
import { mcpPaymentRequired, MPP_MCP_CREDENTIAL_META_KEY, receiptObject, MPP_MCP_RECEIPT_META_KEY, MPP_MCP_PAYMENT_REQUIRED_META_KEY } from './chunk-D7FPSGUQ.js';
|
|
3
3
|
import { publishedInputSchema } from './chunk-MNI6APE6.js';
|
|
4
|
-
import { exclusionNames, PACKAGE_VERSION, descriptorStatus } from './chunk-
|
|
4
|
+
import { exclusionNames, PACKAGE_VERSION, descriptorStatus } from './chunk-J3K7E4CA.js';
|
|
5
5
|
import { toLogInfo, toCommerceError, CommerceError, extractReservedInputFields, PAYMENT_INPUT_FIELD, AUTHORIZATION_INPUT_FIELD, toErrorEnvelope, DELIVERY_SUMMARY_META_KEY, toDeliverySummary, toPaymentRequiredEnvelope } from './chunk-MDOGXTZD.js';
|
|
6
6
|
import { isRecord } from './chunk-2CJNA7MS.js';
|
|
7
7
|
import { createMcpHandler, Server, ProtocolError, ProtocolErrorCode, LATEST_PROTOCOL_VERSION } from '@modelcontextprotocol/server';
|
package/dist/mpp.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MPP_PROFILE, MPP_NETWORKS, MPP_SUPPORTED_SPEC, MPP_DEFAULT_NETWORK, MPP_MIN_CHALLENGE_SECRET_LENGTH, isMppNetwork, MPP_DEFAULT_PAYMENT_FLOW, MPP_SPEC_DRAFTS } from './chunk-6Z2H53CG.js';
|
|
2
2
|
export { MPPX_VERSION, MPP_PROFILE, MPP_SPEC_COMMIT, MPP_SPEC_DRAFTS, MPP_SPEC_REPOSITORY, MPP_SUPPORTED_SPEC } from './chunk-6Z2H53CG.js';
|
|
3
3
|
import { CONTENT_DIGEST_METADATA_KEY } from './chunk-D7FPSGUQ.js';
|
|
4
|
-
import { createX402PaymentProvider, DEFAULT_IDS, parseCanonicalAmount } from './chunk-
|
|
4
|
+
import { createX402PaymentProvider, DEFAULT_IDS, parseCanonicalAmount } from './chunk-TEI6GTUG.js';
|
|
5
5
|
import { SETTLE_AFTER_BACKEND_METADATA_KEY } from './chunk-VHS6MGXJ.js';
|
|
6
6
|
import './chunk-MNI6APE6.js';
|
|
7
|
-
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-
|
|
7
|
+
import { exclusionNames, descriptorStatus, PACKAGE_VERSION } from './chunk-J3K7E4CA.js';
|
|
8
8
|
import { systemClock, CommerceError, RECONCILIATION_METADATA_KEY } from './chunk-MDOGXTZD.js';
|
|
9
9
|
import { computeReplayKey, eip3009Locator } from './chunk-GA3O2A7R.js';
|
|
10
10
|
import './chunk-2CJNA7MS.js';
|
|
@@ -109,6 +109,34 @@ interface PendingTask {
|
|
|
109
109
|
/** Set and bounded by the caller */
|
|
110
110
|
readonly expiresAt: IsoTimestamp;
|
|
111
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* A task response last returned by its protocol adapter, saved for later reads.
|
|
114
|
+
* This record does not make the task payable. Experimental: may change in a
|
|
115
|
+
* minor release.
|
|
116
|
+
*/
|
|
117
|
+
interface TaskRecord {
|
|
118
|
+
/** Unique across the store */
|
|
119
|
+
readonly id: string;
|
|
120
|
+
readonly protocol: ProtocolName;
|
|
121
|
+
/** Groups related tasks for listing */
|
|
122
|
+
readonly groupId: string;
|
|
123
|
+
/** State name defined by the adapter */
|
|
124
|
+
readonly state: string;
|
|
125
|
+
/** Time of the last state change; used to sort listed records */
|
|
126
|
+
readonly updatedAt: IsoTimestamp;
|
|
127
|
+
/**
|
|
128
|
+
* JSON-serializable task response. Must not contain payment proofs or
|
|
129
|
+
* authorization presentations.
|
|
130
|
+
*/
|
|
131
|
+
readonly document: Readonly<Record<string, unknown>>;
|
|
132
|
+
/** Set and bounded by the caller */
|
|
133
|
+
readonly expiresAt: IsoTimestamp;
|
|
134
|
+
/**
|
|
135
|
+
* Mark an uncharged response for eviction at capacity. Omit this flag or
|
|
136
|
+
* set it to false to protect the record from capacity eviction.
|
|
137
|
+
*/
|
|
138
|
+
readonly evictable?: boolean;
|
|
139
|
+
}
|
|
112
140
|
|
|
113
141
|
/**
|
|
114
142
|
* Persistence boundary for receipts, events and payment attempts, implemented
|
|
@@ -381,9 +409,32 @@ interface ReceiptStore {
|
|
|
381
409
|
* in a minor release.
|
|
382
410
|
*/
|
|
383
411
|
takePendingTask?(id: string): Promise<PendingTask | undefined>;
|
|
412
|
+
/**
|
|
413
|
+
* Store task responses for later reads by protocol adapters. Implement all
|
|
414
|
+
* three methods or none. Experimental: may change in a minor release.
|
|
415
|
+
*
|
|
416
|
+
* Delete expired records, then store `record`. Replace an existing ID even
|
|
417
|
+
* at capacity. For a new ID, evict eligible records by `updatedAt` and then
|
|
418
|
+
* `id`, both ascending, until the count is below `maxRecords`. Return false
|
|
419
|
+
* without storing the new record if too few can be evicted.
|
|
420
|
+
*/
|
|
421
|
+
putTaskRecord?(record: TaskRecord, options: {
|
|
422
|
+
readonly maxRecords: number;
|
|
423
|
+
}): Promise<boolean>;
|
|
424
|
+
/** Return undefined for a missing or expired record. Experimental: may change in a minor release */
|
|
425
|
+
getTaskRecord?(id: string): Promise<TaskRecord | undefined>;
|
|
426
|
+
/**
|
|
427
|
+
* Return all unexpired records matching `protocol` and `groupId`, ordered by
|
|
428
|
+
* `updatedAt` and then `id`, both descending. Experimental: may change in a
|
|
429
|
+
* minor release.
|
|
430
|
+
*/
|
|
431
|
+
listTaskRecords?(filter: {
|
|
432
|
+
readonly protocol: ProtocolName;
|
|
433
|
+
readonly groupId: string;
|
|
434
|
+
}): Promise<readonly TaskRecord[]>;
|
|
384
435
|
readonly descriptor: AdapterDescriptor;
|
|
385
436
|
health(): Promise<AdapterHealth>;
|
|
386
437
|
close(): Promise<void>;
|
|
387
438
|
}
|
|
388
439
|
|
|
389
|
-
export type { AuthorizationHold as A, IdempotencyClaim as I, ListOptions as L, NewTransaction as N, PaymentAttemptListOptions as P, ReceiptStore as R,
|
|
440
|
+
export type { AuthorizationHold as A, IdempotencyClaim as I, ListOptions as L, NewTransaction as N, PaymentAttemptListOptions as P, ReceiptStore as R, TaskRecord as T, AuthorizationHoldReservation as a, AuthorizationHoldResult as b, IdempotencyScope as c, IdempotencyUpdate as d, PaymentAttemptReservation as e, PaymentAttemptResolveRequest as f, PaymentAttemptUpdate as g, PendingTask as h, ReceiptListOptions as i, TransactionListOptions as j, TransactionPage as k, TransactionStep as l };
|