@devlab.group/agent-commerce 2.1.0 → 2.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.
Files changed (75) hide show
  1. package/README.md +35 -5
  2. package/dist/ap2.js +3 -3
  3. package/dist/{chunk-LZS5BL3W.js → chunk-2DAJAJI7.js} +23 -5
  4. package/dist/chunk-2DAJAJI7.js.map +1 -0
  5. package/dist/{chunk-UHMYRV3J.js → chunk-BNUD4RBN.js} +22 -7
  6. package/dist/chunk-BNUD4RBN.js.map +1 -0
  7. package/dist/{chunk-IFGRCXME.js → chunk-REBY2IEP.js} +24 -20
  8. package/dist/chunk-REBY2IEP.js.map +1 -0
  9. package/dist/{chunk-SY6GUYSQ.js → chunk-XYHDQ22D.js} +3 -3
  10. package/dist/{chunk-SY6GUYSQ.js.map → chunk-XYHDQ22D.js.map} +1 -1
  11. package/dist/cli/ap2-HLBIUSTK.js +678 -0
  12. package/dist/cli/ap2-HLBIUSTK.js.map +1 -0
  13. package/dist/cli/chunk-2LN5PO5I.js +1352 -0
  14. package/dist/cli/chunk-2LN5PO5I.js.map +1 -0
  15. package/dist/cli/chunk-3EQBCFZY.js +53 -0
  16. package/dist/cli/chunk-3EQBCFZY.js.map +1 -0
  17. package/dist/cli/chunk-3M6U7ILB.js +8 -0
  18. package/dist/cli/chunk-3M6U7ILB.js.map +1 -0
  19. package/dist/cli/chunk-3MGAJ5FX.js +70 -0
  20. package/dist/cli/chunk-3MGAJ5FX.js.map +1 -0
  21. package/dist/cli/chunk-5K4XEAZV.js +113 -0
  22. package/dist/cli/chunk-5K4XEAZV.js.map +1 -0
  23. package/dist/cli/chunk-AA3FIEAR.js +27 -0
  24. package/dist/cli/chunk-AA3FIEAR.js.map +1 -0
  25. package/dist/cli/chunk-FHCFR2GS.js +17 -0
  26. package/dist/cli/chunk-FHCFR2GS.js.map +1 -0
  27. package/dist/cli/chunk-ILUYEQSV.js +1744 -0
  28. package/dist/cli/chunk-ILUYEQSV.js.map +1 -0
  29. package/dist/cli/chunk-KTV52MCU.js +338 -0
  30. package/dist/cli/chunk-KTV52MCU.js.map +1 -0
  31. package/dist/cli/chunk-OSTCU6ZK.js +44 -0
  32. package/dist/cli/chunk-OSTCU6ZK.js.map +1 -0
  33. package/dist/cli/chunk-OZ4LAWBK.js +256 -0
  34. package/dist/cli/chunk-OZ4LAWBK.js.map +1 -0
  35. package/dist/cli/chunk-QQ3WY5L3.js +271 -0
  36. package/dist/cli/chunk-QQ3WY5L3.js.map +1 -0
  37. package/dist/cli/chunk-QY3K6PEQ.js +8 -0
  38. package/dist/cli/chunk-QY3K6PEQ.js.map +1 -0
  39. package/dist/cli/chunk-QZ6TOMX6.js +1413 -0
  40. package/dist/cli/chunk-QZ6TOMX6.js.map +1 -0
  41. package/dist/cli/chunk-SNM3OVCY.js +625 -0
  42. package/dist/cli/chunk-SNM3OVCY.js.map +1 -0
  43. package/dist/cli/chunk-SPAYKVUP.js +118 -0
  44. package/dist/cli/chunk-SPAYKVUP.js.map +1 -0
  45. package/dist/cli/chunk-TPC4EJLT.js +11 -0
  46. package/dist/cli/chunk-TPC4EJLT.js.map +1 -0
  47. package/dist/cli/config-VYAJGZXE.js +11 -0
  48. package/dist/cli/config-VYAJGZXE.js.map +1 -0
  49. package/dist/cli/index.js +150 -3627
  50. package/dist/cli/index.js.map +1 -1
  51. package/dist/cli/mcp-HFD7ZNCQ.js +559 -0
  52. package/dist/cli/mcp-HFD7ZNCQ.js.map +1 -0
  53. package/dist/cli/near-5AY3HWYF.js +58 -0
  54. package/dist/cli/near-5AY3HWYF.js.map +1 -0
  55. package/dist/cli/provider-JV5HCQGR.js +396 -0
  56. package/dist/cli/provider-JV5HCQGR.js.map +1 -0
  57. package/dist/cli/run-WV44B62Y.js +7301 -0
  58. package/dist/cli/run-WV44B62Y.js.map +1 -0
  59. package/dist/cli/svm-3MMYFPC7.js +33 -0
  60. package/dist/cli/svm-3MMYFPC7.js.map +1 -0
  61. package/dist/cli/x402-NADFV5CD.js +96 -0
  62. package/dist/cli/x402-NADFV5CD.js.map +1 -0
  63. package/dist/index.d.ts +12 -3
  64. package/dist/index.js +82 -11
  65. package/dist/index.js.map +1 -1
  66. package/dist/mcp.js +6 -16
  67. package/dist/mcp.js.map +1 -1
  68. package/dist/mpp.js +3 -3
  69. package/dist/{networks-olfflCI_.d.ts → networks-DTWRlj-K.d.ts} +2 -2
  70. package/dist/x402.d.ts +7 -2
  71. package/dist/x402.js +4 -4
  72. package/package.json +2 -2
  73. package/dist/chunk-IFGRCXME.js.map +0 -1
  74. package/dist/chunk-LZS5BL3W.js.map +0 -1
  75. package/dist/chunk-UHMYRV3J.js.map +0 -1
@@ -0,0 +1,27 @@
1
+ // src/payments/mpp/constants.ts
2
+ var MPP_SPEC_COMMIT = "806fdb8b8c92cda5c84b8660558921b6bbeef7e0";
3
+ var MPP_SPEC_DRAFTS = {
4
+ core: "draft-httpauth-payment-01",
5
+ intent: "draft-payment-intent-charge-00",
6
+ method: "draft-evm-charge-00"
7
+ };
8
+ var MPP_MIN_CHALLENGE_SECRET_LENGTH = 32;
9
+ var MPPX_VERSION = "0.13.1";
10
+ var MPP_PROFILE = {
11
+ intent: "charge",
12
+ method: "evm",
13
+ credentialType: "authorization",
14
+ assetSymbol: "USDC",
15
+ assetDecimals: 6
16
+ };
17
+ var MPP_NETWORKS = ["eip155:31337", "eip155:84532", "eip155:8453"];
18
+ var MPP_DEFAULT_NETWORK = "eip155:84532";
19
+ var MPP_DEFAULT_PAYMENT_FLOW = "upfront";
20
+ function isMppNetwork(value) {
21
+ return MPP_NETWORKS.includes(value);
22
+ }
23
+ var MPP_SUPPORTED_SPEC = `mpp/${MPP_SPEC_DRAFTS.core} intent=${MPP_PROFILE.intent} method=${MPP_PROFILE.method}`;
24
+
25
+ export { MPPX_VERSION, MPP_DEFAULT_NETWORK, MPP_DEFAULT_PAYMENT_FLOW, MPP_MIN_CHALLENGE_SECRET_LENGTH, MPP_NETWORKS, MPP_PROFILE, MPP_SPEC_COMMIT, MPP_SPEC_DRAFTS, MPP_SUPPORTED_SPEC, isMppNetwork };
26
+ //# sourceMappingURL=chunk-AA3FIEAR.js.map
27
+ //# sourceMappingURL=chunk-AA3FIEAR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/payments/mpp/constants.ts"],"names":[],"mappings":";AAoBO,IAAM,eAAA,GAAkB;AAGxB,IAAM,eAAA,GAAkB;AAAA,EAC7B,IAAA,EAAM,2BAAA;AAAA,EACN,MAAA,EAAQ,gCAAA;AAAA,EACR,MAAA,EAAQ;AACV;AAMO,IAAM,+BAAA,GAAkC;AAGxC,IAAM,YAAA,GAAe;AAUrB,IAAM,WAAA,GAAc;AAAA,EACzB,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,KAAA;AAAA,EACR,cAAA,EAAgB,eAAA;AAAA,EAChB,WAAA,EAAa,MAAA;AAAA,EACb,aAAA,EAAe;AACjB;AAGO,IAAM,YAAA,GAAe,CAAC,cAAA,EAAgB,cAAA,EAAgB,aAAa;AAKnE,IAAM,mBAAA,GAAkC;AAOxC,IAAM,wBAAA,GAA4C;AAElD,SAAS,aAAa,KAAA,EAAoC;AAC/D,EAAA,OAAQ,YAAA,CAAmC,SAAS,KAAK,CAAA;AAC3D;AAGO,IAAM,kBAAA,GAAqB,OAAO,eAAA,CAAgB,IAAI,WAAW,WAAA,CAAY,MAAM,CAAA,QAAA,EAAW,WAAA,CAAY,MAAM,CAAA","file":"chunk-AA3FIEAR.js","sourcesContent":["/**\n * The one MPP profile this rail targets.\n *\n * MPP combines a core HTTP authentication layer, an intent, a method and\n * optional extensions. These constants identify the selected combination and\n * the exact specification revision.\n *\n * Importing this metadata does not load `mppx`.\n */\nimport type { X402PaymentFlow } from '../x402/payment-flow';\n\n/** Upstream specification repository the pinned drafts were read from */\nexport const MPP_SPEC_REPOSITORY = 'https://github.com/tempoxyz/mpp-specs';\n\n/**\n * Upstream commit the pinned drafts were read at.\n *\n * A draft's content can change without its `-00` name changing, so the name\n * alone does not identify a document; the commit does.\n */\nexport const MPP_SPEC_COMMIT = '806fdb8b8c92cda5c84b8660558921b6bbeef7e0';\n\n/** The core HTTP authentication draft, the `charge` intent, and its EVM method */\nexport const MPP_SPEC_DRAFTS = {\n core: 'draft-httpauth-payment-01',\n intent: 'draft-payment-intent-charge-00',\n method: 'draft-evm-charge-00',\n} as const;\n\n/**\n * Minimum accepted `challengeSecret.length`. This is a configuration floor,\n * not an entropy check.\n */\nexport const MPP_MIN_CHALLENGE_SECRET_LENGTH = 32;\n\n/** Exact `mppx` release the rail is pinned to */\nexport const MPPX_VERSION = '0.13.1';\n\n/**\n * The pinned profile.\n *\n * `intent`, `method` and `credentialType` copy MPP wire identifiers from\n * `mppx` so this module has no peer import; tests detect drift. `assetSymbol`\n * is the pricing currency an MPP resource must use. EVM charge requests carry a\n * numeric `chainId` and token address instead.\n */\nexport const MPP_PROFILE = {\n intent: 'charge',\n method: 'evm',\n credentialType: 'authorization',\n assetSymbol: 'USDC',\n assetDecimals: 6,\n} as const;\n\n/** Supported CAIP-2 networks; gateway config applies the x402 mainnet guardrails */\nexport const MPP_NETWORKS = ['eip155:31337', 'eip155:84532', 'eip155:8453'] as const;\n\nexport type MppNetwork = (typeof MPP_NETWORKS)[number];\n\n/** Default network: Base Sepolia. The local Anvil chain is `eip155:31337` */\nexport const MPP_DEFAULT_NETWORK: MppNetwork = 'eip155:84532';\n\n/**\n * Default payment flow: `upfront` settles before the backend runs. The\n * `charge` intent counts a backend call made before verification completes as\n * partial access, and EVM charge verification includes the transfer itself.\n */\nexport const MPP_DEFAULT_PAYMENT_FLOW: X402PaymentFlow = 'upfront';\n\nexport function isMppNetwork(value: string): value is MppNetwork {\n return (MPP_NETWORKS as readonly string[]).includes(value);\n}\n\n/** Compact descriptor value naming the core draft, intent and method */\nexport const MPP_SUPPORTED_SPEC = `mpp/${MPP_SPEC_DRAFTS.core} intent=${MPP_PROFILE.intent} method=${MPP_PROFILE.method}`;\n"]}
@@ -0,0 +1,17 @@
1
+ // src/authorization/ap2/constants.ts
2
+ var AP2_SPEC_VERSION = "0.2.0";
3
+ var AP2_MODES = ["direct"];
4
+ var AP2_SIGNING_ALGORITHM = "ES256";
5
+ var AP2_KEY_TYPE = "EC";
6
+ var AP2_JWK_CURVE = "P-256";
7
+ var AP2_JWK_COORDINATE_BYTES = 32;
8
+ var AP2_JWK_MEMBERS = ["kty", "crv", "x", "y", "kid", "alg", "use"];
9
+ var AP2_CHECKOUT_MANDATE_VCT = "mandate.checkout.1";
10
+ var AP2_CHECKOUT_PROFILE = "agent-commerce/ap2/checkout/v1";
11
+ var AP2_DIGEST_ALGORITHM = "sha-256";
12
+ var AP2_DEFAULT_CLOCK_SKEW_SECONDS = 60;
13
+ var AP2_MAX_CLOCK_SKEW_SECONDS = 300;
14
+
15
+ export { AP2_CHECKOUT_MANDATE_VCT, AP2_CHECKOUT_PROFILE, AP2_DEFAULT_CLOCK_SKEW_SECONDS, AP2_DIGEST_ALGORITHM, AP2_JWK_COORDINATE_BYTES, AP2_JWK_CURVE, AP2_JWK_MEMBERS, AP2_KEY_TYPE, AP2_MAX_CLOCK_SKEW_SECONDS, AP2_MODES, AP2_SIGNING_ALGORITHM, AP2_SPEC_VERSION };
16
+ //# sourceMappingURL=chunk-FHCFR2GS.js.map
17
+ //# sourceMappingURL=chunk-FHCFR2GS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/authorization/ap2/constants.ts"],"names":[],"mappings":";AAQO,IAAM,gBAAA,GAAmB;AAOzB,IAAM,SAAA,GAAY,CAAC,QAAQ;AAO3B,IAAM,qBAAA,GAAwB;AAG9B,IAAM,YAAA,GAAe;AACrB,IAAM,aAAA,GAAgB;AAGtB,IAAM,wBAAA,GAA2B;AAOjC,IAAM,eAAA,GAAkB,CAAC,KAAA,EAAO,KAAA,EAAO,KAAK,GAAA,EAAK,KAAA,EAAO,OAAO,KAAK;AAOpE,IAAM,wBAAA,GAA2B;AAQjC,IAAM,oBAAA,GAAuB;AAO7B,IAAM,oBAAA,GAAuB;AAG7B,IAAM,8BAAA,GAAiC;AAMvC,IAAM,0BAAA,GAA6B","file":"chunk-FHCFR2GS.js","sourcesContent":["/**\n * Pinned AP2 identifiers and key policy.\n *\n * AP2 v0.2.0 (2026-04-28, commit b4587ac) is the tagged release this gateway\n * verifies against; unversioned `main` is never implemented against. Config,\n * the verifier and `doctor` all read these, so a bump lands in one place.\n */\n\nexport const AP2_SPEC_VERSION = '0.2.0';\n\n/**\n * Direct only. Autonomous mode needs open mandates, cnf-bound agent keys and\n * constraint evaluation over `checkout.line_items`, none of which is\n * implemented, so it is refused rather than partly served.\n */\nexport const AP2_MODES = ['direct'] as const;\nexport type Ap2Mode = (typeof AP2_MODES)[number];\n\n/**\n * A single algorithm, so `alg=none` and the HMAC family are excluded by\n * construction rather than by a denylist\n */\nexport const AP2_SIGNING_ALGORITHM = 'ES256';\n\n/** The key type and curve ES256 implies. Any other pair is refused at load */\nexport const AP2_KEY_TYPE = 'EC';\nexport const AP2_JWK_CURVE = 'P-256';\n\n/** Byte length of a P-256 coordinate, before base64url encoding */\nexport const AP2_JWK_COORDINATE_BYTES = 32;\n\n/**\n * JWK members a verification key may carry. An allowlist, so private material\n * (`d`) and URL members (`x5u`, `jku`) are refused without the list naming\n * them. Keys are configured inline and never fetched; see docs/security.md.\n */\nexport const AP2_JWK_MEMBERS = ['kty', 'crv', 'x', 'y', 'kid', 'alg', 'use'] as const;\n\n/**\n * Compared against this literal, never as a prefix. `mandate.checkout.open.1`\n * carries spending constraints nothing here evaluates, so accepting it would\n * tell a buyer their limits were checked when nothing read them.\n */\nexport const AP2_CHECKOUT_MANDATE_VCT = 'mandate.checkout.1';\n\n/**\n * Merchant checkout JWTs declare this gateway-specific profile; AP2 leaves\n * the checkout payload out of scope. The identifier is a namespace that\n * clients do not dereference. Merchants sign it into each checkout JWT, so\n * changing the expected value would reject previously signed JWTs.\n */\nexport const AP2_CHECKOUT_PROFILE = 'agent-commerce/ap2/checkout/v1';\n\n/**\n * The only accepted SD-JWT `_sd_alg` (an absent one means sha-256). Any other\n * value is refused rather than hashed as sha-256, which would check a\n * presentation under an algorithm it never claimed.\n */\nexport const AP2_DIGEST_ALGORITHM = 'sha-256';\n\n/** Seconds of clock skew tolerated on mandate and checkout time claims */\nexport const AP2_DEFAULT_CLOCK_SKEW_SECONDS = 60;\n\n/**\n * Skew as wide as a mandate's validity window would stop `exp` rejecting\n * anything. An operator who needs more than five minutes has a clock to fix.\n */\nexport const AP2_MAX_CLOCK_SKEW_SECONDS = 300;\n"]}