agentic-payments 0.1.14 → 0.1.15

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
@@ -25,7 +25,7 @@
25
25
  - **AP2 (Agent Payments Protocol)**: Cryptographic payment mandates with Ed25519 signatures
26
26
  - **ACP (Agentic Commerce Protocol)**: REST API integration with Stripe-compatible checkout
27
27
  - **Active Mandate**: Autonomous payment capsules with spend caps, time windows, and instant revocation
28
- - **Visa TAP (Trusted Agent Protocol)**: QUIC transport with RFC 9421 HTTP message signatures for ultra-low latency payments
28
+ - **Visa TAP (Trusted Agent Protocol)**: RFC 9421 HTTP message signatures for agent payment requests. The QUIC transport is not functional yet and fails closed (see [Visa TAP transport](#visa-tap-quic-transport))
29
29
 
30
30
  **Key Innovation**: Multi-agent Byzantine consensus allows fleets of specialized AI agents (purchasing, finance, compliance, audit) to collaboratively authorize transactions, ensuring no single compromised agent can approve fraudulent payments.
31
31
 
@@ -40,7 +40,6 @@ Built with TypeScript for Node.js, Deno, Bun, and browsers. Production-ready wit
40
40
  - ✅ **Cart Mandates**: Pre-approve shopping carts with line-item verification
41
41
  - ✅ **Payment Tracking**: Monitor payment status from authorization to capture
42
42
  - ✅ **MCP Protocol**: Stdio and HTTP transports for AI assistant integration (Claude, Cline, etc.)
43
- - ✅ **Visa TAP QUIC Transport**: Ultra-low latency payment authorization with 0-RTT connection resumption
44
43
  - ✅ **RFC 9421 HTTP Signatures**: Cryptographic request signing for secure payment authentication
45
44
  - ✅ **Production Ready**: 100% TypeScript, comprehensive error handling, <200KB
46
45
  - ✅ **CLI Tools**: Command-line interface for mandate management and testing
@@ -631,72 +630,34 @@ console.log(`Authorized: ${vendorPayment.isComplete()}`);
631
630
 
632
631
  **Use case**: Automated accounts payable, expense report processing, and vendor management where AI agents categorize, approve, and execute payments based on policy rules.
633
632
 
634
- ### Visa TAP: Ultra-Low Latency Payments with QUIC
633
+ ### Visa TAP: Signed Payment Requests
635
634
 
636
- Send payment authorizations over QUIC for 50-70% faster processing than HTTP/2:
635
+ Sign payment requests with RFC 9421 HTTP message signatures and submit them to
636
+ the merchant over HTTPS:
637
637
 
638
638
  ```typescript
639
- import { VisaTapQuicTransport, signHttpMessage } from 'agentic-payments';
640
- import { AgentIdentity } from 'agentic-payments';
641
-
642
- // 1. Create QUIC transport connection
643
- const transport = new VisaTapQuicTransport({
644
- host: 'merchant.com',
645
- port: 8443,
646
- enable0RTT: true, // 0-RTT reconnection (<1ms)
647
- maxConcurrentStreams: 100 // 100+ parallel payments
648
- });
639
+ import { AgentIdentity, signHttpMessage, computeContentDigest } from 'agentic-payments';
649
640
 
650
- await transport.connect();
651
- console.log('✅ Connected via QUIC');
652
-
653
- // 2. Sign payment request with RFC 9421
654
641
  const agent = await AgentIdentity.generate();
655
642
  const privateKeyHex = Buffer.from(agent.privateKey).toString('hex');
656
643
 
644
+ const body = new TextEncoder().encode(JSON.stringify(mandate));
657
645
  const signed = await signHttpMessage(
658
646
  {
659
647
  method: 'POST',
660
648
  authority: 'merchant.com',
661
649
  path: '/api/payments',
662
- contentDigest: 'sha-256=:...:',
650
+ contentDigest: computeContentDigest(body),
663
651
  },
664
652
  privateKeyHex,
665
653
  'did:agent:shopping-bot'
666
654
  );
667
655
 
668
- // 3. Send payment via QUIC
669
- const mandate = {
670
- mandate_id: 'mandate_001',
671
- agent: 'shopping-bot@example.com',
672
- holder: 'user@example.com',
673
- amount: 5000,
674
- currency: 'USD',
675
- period: 'single',
676
- kind: 'intent'
677
- };
678
-
679
- const response = await transport.sendPayment({
680
- ...mandate,
681
- signature: signed.signature,
682
- public_key: Buffer.from(agent.publicKey()).toString('hex')
683
- });
684
-
685
- console.log(`Transaction ID: ${response.transactionId}`);
686
- console.log(`Status: ${response.status}`);
687
- console.log(`Latency: ${response.processingTime}ms`);
688
-
689
- await transport.close();
656
+ // Send with your HTTPS client, carrying signed.signature / signed.signatureInput
657
+ // headers, and treat the payment as submitted only when the merchant confirms it.
690
658
  ```
691
659
 
692
- **Performance Benefits:**
693
- - **50-70% faster** than HTTP/2 for payment authorization
694
- - **0-RTT reconnection** for sub-millisecond session resumption
695
- - **Connection migration** for seamless mobile network handoffs
696
- - **100+ concurrent streams** per connection
697
- - **No head-of-line blocking** unlike HTTP/2
698
-
699
- **Use case**: High-frequency trading, real-time payments, mobile commerce, and latency-sensitive payment flows where every millisecond counts.
660
+ There is no working QUIC transport: see [Visa TAP transport](#visa-tap-quic-transport).
700
661
 
701
662
  ### Agent Fleet Management
702
663
 
@@ -908,66 +869,72 @@ console.log(`Complete: ${payment.isComplete()}`);
908
869
 
909
870
  ### Visa TAP QUIC Transport
910
871
 
911
- Ultra-low latency payment transport with RFC 9421 HTTP message signatures:
872
+ **Status: not functional. `connect()` always rejects with the agentic-flow
873
+ releases published so far.**
874
+
875
+ `VisaTapQuicTransport` sends through the optional peer `agentic-flow`
876
+ (`agentic-flow/transport/quic`). No agentic-flow release ships a working QUIC
877
+ transport: its `QuicTransport.send()` is a placeholder that sends nothing, and
878
+ agentic-flow 3.4.4+ reports this through `getQuicStatus()`
879
+ (`{ available: false, fallback: 'websocket' }`).
880
+
881
+ What happens since 0.1.15:
882
+
883
+ - `connect()` (and `VisaTapQuicTransport.create()`) asks agentic-flow whether
884
+ QUIC is available and rejects with `QuicTransportUnavailableError`
885
+ (`code: 'QUIC_UNAVAILABLE'`, with agentic-flow's reason) when it is not.
886
+ agentic-flow versions without the probe count as unavailable.
887
+ - Without agentic-flow installed, `connect()` rejects with an install hint.
888
+ - `send()` and `sendPayment()` reject with `'Not connected'` before a
889
+ successful `connect()`, and with `PaymentNotDeliveredError`
890
+ (`code: 'PAYMENT_NOT_DELIVERED'`) unless the server returns a response;
891
+ `sendPayment()` additionally requires a `transactionId` and a status of
892
+ `approved`, `declined` or `pending`. A response is never synthesised.
893
+
894
+ agentic-payments 0.1.14 connected to the placeholder and `sendPayment()`
895
+ resolved with a made-up `transactionId` and `status: 'pending'` although
896
+ nothing was sent. Treat any `transactionId` from 0.1.14's `sendPayment()` as
897
+ not submitted.
898
+
899
+ The transport does not switch to agentic-flow's WebSocket fallback on its own.
900
+ No Visa TAP endpoint speaks that framing, its `send()` carries no
901
+ application-level acknowledgement, and plain `ws://` would send mandates in
902
+ cleartext, so a silent switch could not tell a delivered payment from a lost
903
+ one. Until a real transport exists, submit signed requests over HTTPS.
912
904
 
913
905
  ```typescript
914
906
  import {
915
907
  VisaTapQuicTransport,
916
- signHttpMessage,
917
- verifyHttpSignature,
918
- computeContentDigest
908
+ QuicTransportUnavailableError,
909
+ getQuicTransportStatus,
919
910
  } from 'agentic-payments/visa-tap';
920
911
 
921
- // Create QUIC transport
922
- const transport = new VisaTapQuicTransport({
923
- host: 'payments.merchant.com',
924
- port: 8443,
925
- enable0RTT: true,
926
- timeout: 5000
927
- });
928
-
929
- await transport.connect();
930
-
931
- // Sign HTTP request per RFC 9421
932
- const body = new TextEncoder().encode(JSON.stringify(mandate));
933
- const contentDigest = computeContentDigest(body);
912
+ const status = await getQuicTransportStatus(); // { available: false, reason: '...' }
934
913
 
935
- const signed = await signHttpMessage(
936
- {
937
- method: 'POST',
938
- authority: 'payments.merchant.com',
939
- path: '/v1/payments',
940
- contentDigest,
941
- headers: {
942
- 'Content-Type': 'application/json'
943
- }
944
- },
945
- privateKeyHex,
946
- 'did:agent:payment-bot'
947
- );
948
-
949
- // Send payment
950
- const response = await transport.sendPayment(signedMandate);
951
-
952
- // Get connection statistics
953
- const stats = transport.getStats();
954
- console.log(`RTT: ${stats?.rtt}ms`);
955
- console.log(`Bytes sent: ${stats?.bytesSent}`);
956
-
957
- await transport.close();
914
+ try {
915
+ const transport = await VisaTapQuicTransport.create({ host: 'payments.merchant.com', port: 8443 });
916
+ const response = await transport.sendPayment(signedMandate); // only a real server response
917
+ await transport.close();
918
+ } catch (err) {
919
+ if (err instanceof QuicTransportUnavailableError) {
920
+ // Nothing was sent. Use HTTPS with signHttpMessage() instead.
921
+ }
922
+ }
958
923
  ```
959
924
 
960
925
  **API Reference:**
961
926
 
962
927
  | Method | Description | Returns |
963
928
  |--------|-------------|---------|
964
- | `constructor(config)` | Create QUIC transport | `VisaTapQuicTransport` |
965
- | `connect()` | Establish connection | `Promise<void>` |
966
- | `sendPayment(mandate)` | Send signed mandate | `Promise<PaymentResponse>` |
967
- | `send(data)` | Send raw data | `Promise<any>` |
968
- | `getStats()` | Get connection stats | `QuicStats \| null` |
929
+ | `VisaTapQuicTransport.create(config)` | Construct and `connect()` | `Promise<VisaTapQuicTransport>` |
930
+ | `constructor(config)` | Create transport (no I/O) | `VisaTapQuicTransport` |
931
+ | `connect()` | Rejects with `QuicTransportUnavailableError` unless agentic-flow reports QUIC available | `Promise<void>` |
932
+ | `sendPayment(mandate)` | Send signed mandate; rejects with `PaymentNotDeliveredError` without a confirmed response | `Promise<PaymentResponse>` |
933
+ | `send(data)` | Send raw data; rejects with `PaymentNotDeliveredError` without a response | `Promise<any>` |
934
+ | `getStats()` | Connection stats when connected | `QuicStats \| null` |
969
935
  | `isConnected()` | Check connection status | `boolean` |
970
936
  | `close()` | Close connection | `Promise<void>` |
937
+ | `getQuicTransportStatus()` | Whether agentic-flow has a working QUIC transport, and why not | `Promise<{ available, reason? }>` |
971
938
 
972
939
  **RFC 9421 Functions:**
973
940
 
@@ -1018,9 +985,9 @@ agentic-payments/
1018
985
  │ │ ├── signing.ts # Ed25519 signing
1019
986
  │ │ ├── revocation.ts # Revocation store
1020
987
  │ │ └── i18n.ts # Internationalization
1021
- │ ├── visa-tap/ # Visa TAP QUIC integration
988
+ │ ├── visa-tap/ # Visa TAP integration
1022
989
  │ │ ├── types.ts # Visa TAP TypeScript types
1023
- │ │ ├── quic-transport.ts # QUIC transport bridge
990
+ │ │ ├── quic-transport.ts # QUIC transport bridge (fails closed, see above)
1024
991
  │ │ ├── rfc9421.ts # RFC 9421 HTTP signatures
1025
992
  │ │ └── index.ts # Visa TAP exports
1026
993
  │ ├── cli/ # Command-line interface
@@ -1082,10 +1049,10 @@ app.post('/verify', limiter, verifyHandler);
1082
1049
 
1083
1050
  ### Network Security
1084
1051
 
1085
- **QUIC Transport**:
1086
- - TLS 1.3 encryption by default (no configuration needed)
1087
- - Certificate pinning for merchant endpoints
1088
- - Monitor connection statistics for anomalies
1052
+ **Payment transport**:
1053
+ - The Visa TAP QUIC transport is not functional and refuses to connect; submit payment requests over HTTPS (TLS 1.2+), signed with `signHttpMessage`
1054
+ - Pin certificates for merchant endpoints where your HTTPS client supports it
1055
+ - Record a payment as submitted only when the merchant confirms it
1089
1056
 
1090
1057
  **MCP Server**:
1091
1058
  - Use stdio transport for local development only
@@ -1127,23 +1094,9 @@ Optimized for low-latency payment authorization with minimal bundle impact:
1127
1094
  | Ed25519 Verify | ~3ms | Single verification |
1128
1095
  | Consensus (3 agents) | ~10ms | Byzantine fault tolerance |
1129
1096
  | Mandate Validation | <1ms | Schema + business rules |
1130
- | QUIC Connection | ~100ms | First connection (vs 300ms HTTP/2) |
1131
- | QUIC Reconnection | <1ms | 0-RTT session resumption |
1132
1097
  | RFC 9421 Signing | ~2ms | HTTP message signature |
1133
1098
  | Bundle Size | <200KB | Gzipped, tree-shakeable |
1134
1099
 
1135
- ### QUIC Transport Performance
1136
-
1137
- Comparison with HTTP/2 for payment authorization:
1138
-
1139
- | Metric | QUIC (Visa TAP) | HTTP/2 | Improvement |
1140
- |--------|-----------------|--------|-------------|
1141
- | First connection | 100ms | 300ms | **66% faster** |
1142
- | Reconnection | <1ms (0-RTT) | 200ms | **99.5% faster** |
1143
- | Mobile handoff | Seamless | Connection drop | **Connection migration** |
1144
- | Concurrent streams | 100+ | 100+ | Equal |
1145
- | Head-of-line blocking | None | Present | **Better reliability** |
1146
-
1147
1100
  ## 📄 License
1148
1101
 
1149
1102
  Licensed under either of:
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ export type { AgentVote, VerificationResult, VerificationConfig, SystemMetrics,
49
49
  export { IntentMandate, CartMandate, PaymentMandate } from './mandate.js';
50
50
  export type { IntentMandateData, CartMandateData, PaymentMandateData, CartItem, ValidationResult, } from './mandate.js';
51
51
  export { PaymentError, PaymentErrorCode, isRecoverable, getErrorCode, formatError, AgenticPaymentError, CryptoError, ValidationError, ConsensusError, SystemError, WasmInitError, ErrorCode, } from './errors.js';
52
- export { VisaTapQuicTransport, createQuicTransport } from './visa-tap/index.js';
52
+ export { VisaTapQuicTransport, createQuicTransport, getQuicTransportStatus, QuicTransportUnavailableError, PaymentNotDeliveredError, } from './visa-tap/index.js';
53
53
  export { signHttpMessage, verifyHttpSignature, computeContentDigest } from './visa-tap/index.js';
54
54
  export { TAP_VERSION, DEFAULT_QUIC_PORT, MAX_MANDATE_LIFETIME_SECS } from './visa-tap/index.js';
55
55
  export declare const VERSION = "1.0.0";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1E,YAAY,EACV,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,QAAQ,EACR,gBAAgB,GACjB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW,EAEX,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AAGrB,OA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A6B,EAC7B,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAGhG,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;;;GAIG;AACH,wBAAgB,OAAO,IAAI;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAeA;;;;;AAGD,wBAGE"}
package/dist/index.js CHANGED
@@ -50,8 +50,9 @@ export { IntentMandate, CartMandate, PaymentMandate } from './mandate.js';
50
50
  export { PaymentError, PaymentErrorCode, isRecoverable, getErrorCode, formatError,
51
51
  // Legacy aliases
52
52
  AgenticPaymentError, CryptoError, ValidationError, ConsensusError, SystemError, WasmInitError, ErrorCode, } from './errors.js';
53
- // Visa TAP (Trusted Agent Protocol) - QUIC transport integration
54
- export { VisaTapQuicTransport, createQuicTransport } from './visa-tap/index.js';
53
+ // Visa TAP (Trusted Agent Protocol). The QUIC transport fails closed: agentic-flow
54
+ // ships no working QUIC, so connect() rejects with QuicTransportUnavailableError.
55
+ export { VisaTapQuicTransport, createQuicTransport, getQuicTransportStatus, QuicTransportUnavailableError, PaymentNotDeliveredError, } from './visa-tap/index.js';
55
56
  export { signHttpMessage, verifyHttpSignature, computeContentDigest } from './visa-tap/index.js';
56
57
  export { TAP_VERSION, DEFAULT_QUIC_PORT, MAX_MANDATE_LIFETIME_SECS } from './visa-tap/index.js';
57
58
  // Version information
@@ -72,7 +73,6 @@ export function getInfo() {
72
73
  'intent-mandates',
73
74
  'cart-mandates',
74
75
  'payment-mandates',
75
- 'visa-tap-quic-transport',
76
76
  'rfc9421-http-signatures',
77
77
  'active-mandates',
78
78
  ],
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,eAAe;AACf,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG9C,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAQ3B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAS1E,gBAAgB;AAChB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,WAAW;AACX,iBAAiB;AACjB,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,GACV,MAAM,aAAa,CAAC;AAErB,iEAAiE;AACjE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAEhG,sBAAsB;AACtB,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,OAAO;IAKrB,OAAO;QACL,OAAO,EAAE,OAAO;QAChB,cAAc,EAAE,mBAAmB;QACnC,QAAQ,EAAE;YACR,oBAAoB;YACpB,uBAAuB;YACvB,2BAA2B;YAC3B,iBAAiB;YACjB,eAAe;YACf,kBAAkB;YAClB,yBAAyB;YACzB,yBAAyB;YACzB,iBAAiB;SAClB;KACF,CAAC;AACJ,CAAC;AAED,iBAAiB;AACjB,eAAe;IACb,OAAO;IACP,OAAO;CACR,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"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*
4
- * High-performance payment infrastructure with QUIC transport,
5
- * RFC 9421 HTTP message signatures, and Active Mandates.
4
+ * RFC 9421 HTTP message signatures, Active Mandates, and a QUIC transport
5
+ * bridge. No published agentic-flow release ships a working QUIC transport, so
6
+ * VisaTapQuicTransport.connect() rejects with QuicTransportUnavailableError.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
9
10
  * import { VisaTapQuicTransport, signHttpMessage } from 'agentic-payments/visa-tap';
10
11
  *
11
- * // Create QUIC transport
12
- * const transport = new VisaTapQuicTransport({
12
+ * // Throws QuicTransportUnavailableError while agentic-flow has no working QUIC
13
+ * const transport = await VisaTapQuicTransport.create({
13
14
  * host: 'merchant.com',
14
15
  * port: 8443
15
16
  * });
16
17
  *
17
- * await transport.connect();
18
- *
19
- * // Send payment
18
+ * // Resolves only with a server response carrying a transactionId;
19
+ * // otherwise rejects with PaymentNotDeliveredError
20
20
  * const response = await transport.sendPayment(signedMandate);
21
- * console.log('Payment approved:', response.transactionId);
22
21
  * ```
23
22
  */
24
23
  export { validateAndVerify, guardExecution, revoke, isRevoked, getAllRevocations, type SignedMandate, type VerificationResult, type ExecutionGuard, type RevocationRecord, } from '../active-mandate/index.js';
25
- export { VisaTapQuicTransport, createQuicTransport, loadQuicTransport, AGENTIC_FLOW_PEER_RANGE, } from './quic-transport.js';
24
+ export { VisaTapQuicTransport, createQuicTransport, loadQuicTransport, getQuicTransportStatus, QuicTransportUnavailableError, PaymentNotDeliveredError, QUIC_UNAVAILABLE, PAYMENT_NOT_DELIVERED, AGENTIC_FLOW_PEER_RANGE, type QuicTransportStatus, } from './quic-transport.js';
26
25
  export { signHttpMessage, verifyHttpSignature, computeContentDigest, } from './rfc9421.js';
27
26
  export type { Period, MandateKind, ActiveMandatePayload, SignedActiveMandate, SignatureComponents, SignedHttpMessage, QuicConfig, QuicStats, PaymentResponse, } from './types.js';
28
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/visa-tap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/visa-tap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAGH,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,mBAAmB,GACzB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,YAAY,EACV,MAAM,EACN,WAAW,EACX,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,SAAS,EACT,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,eAAO,MAAM,WAAW,QAAQ,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,iBAAiB,OAAO,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,yBAAyB,QAAmB,CAAC"}
@@ -1,30 +1,29 @@
1
1
  /**
2
2
  * Visa TAP (Trusted Agent Protocol) Integration
3
3
  *
4
- * High-performance payment infrastructure with QUIC transport,
5
- * RFC 9421 HTTP message signatures, and Active Mandates.
4
+ * RFC 9421 HTTP message signatures, Active Mandates, and a QUIC transport
5
+ * bridge. No published agentic-flow release ships a working QUIC transport, so
6
+ * VisaTapQuicTransport.connect() rejects with QuicTransportUnavailableError.
6
7
  *
7
8
  * @example
8
9
  * ```typescript
9
10
  * import { VisaTapQuicTransport, signHttpMessage } from 'agentic-payments/visa-tap';
10
11
  *
11
- * // Create QUIC transport
12
- * const transport = new VisaTapQuicTransport({
12
+ * // Throws QuicTransportUnavailableError while agentic-flow has no working QUIC
13
+ * const transport = await VisaTapQuicTransport.create({
13
14
  * host: 'merchant.com',
14
15
  * port: 8443
15
16
  * });
16
17
  *
17
- * await transport.connect();
18
- *
19
- * // Send payment
18
+ * // Resolves only with a server response carrying a transactionId;
19
+ * // otherwise rejects with PaymentNotDeliveredError
20
20
  * const response = await transport.sendPayment(signedMandate);
21
- * console.log('Payment approved:', response.transactionId);
22
21
  * ```
23
22
  */
24
23
  // Re-export from active-mandate (already working)
25
24
  export { validateAndVerify, guardExecution, revoke, isRevoked, getAllRevocations, } from '../active-mandate/index.js';
26
25
  // Export QUIC transport
27
- export { VisaTapQuicTransport, createQuicTransport, loadQuicTransport, AGENTIC_FLOW_PEER_RANGE, } from './quic-transport.js';
26
+ export { VisaTapQuicTransport, createQuicTransport, loadQuicTransport, getQuicTransportStatus, QuicTransportUnavailableError, PaymentNotDeliveredError, QUIC_UNAVAILABLE, PAYMENT_NOT_DELIVERED, AGENTIC_FLOW_PEER_RANGE, } from './quic-transport.js';
28
27
  // Export RFC 9421
29
28
  export { signHttpMessage, verifyHttpSignature, computeContentDigest, } from './rfc9421.js';
30
29
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/visa-tap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,kDAAkD;AAClD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,SAAS,EACT,iBAAiB,GAKlB,MAAM,4BAA4B,CAAC;AAEpC,wBAAwB;AACxB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAE7B,kBAAkB;AAClB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAetB;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/visa-tap/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,kDAAkD;AAClD,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,MAAM,EACN,SAAS,EACT,iBAAiB,GAKlB,MAAM,4BAA4B,CAAC;AAEpC,wBAAwB;AACxB,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,6BAA6B,EAC7B,wBAAwB,EACxB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,GAExB,MAAM,qBAAqB,CAAC;AAE7B,kBAAkB;AAClB,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAetB;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AAEjC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAEtC;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC"}
@@ -1,7 +1,18 @@
1
1
  /**
2
2
  * QUIC Transport Integration for Visa TAP
3
3
  *
4
- * Bridges agentic-payments with agentic-flow QUIC transport
4
+ * Bridges agentic-payments with the agentic-flow QUIC transport.
5
+ *
6
+ * No published agentic-flow release ships a working QUIC transport:
7
+ * `agentic-flow/transport/quic` is a placeholder whose `send()` discards the
8
+ * data. This transport therefore refuses to connect unless agentic-flow
9
+ * reports QUIC as available (`getQuicStatus()`), and never reports a payment
10
+ * as sent unless a real response comes back.
11
+ *
12
+ * It deliberately does not fall back to agentic-flow's WebSocket transport:
13
+ * no Visa TAP endpoint speaks that framing, its `send()` has no
14
+ * application-level acknowledgement, and plain `ws://` would carry mandates
15
+ * in cleartext. Failing closed is the only safe behaviour for payments.
5
16
  */
6
17
  import type { QuicConfig, QuicStats, PaymentResponse, SignedActiveMandate } from './types.js';
7
18
  /**
@@ -20,35 +31,83 @@ export declare const AGENTIC_FLOW_PEER_RANGE = "^2.0.14 || ^3.0.0";
20
31
  * @throws Error with install instructions when agentic-flow is not installed
21
32
  */
22
33
  export declare function loadQuicTransport(): Promise<any>;
34
+ /** Error code carried by {@link QuicTransportUnavailableError}. */
35
+ export declare const QUIC_UNAVAILABLE = "QUIC_UNAVAILABLE";
36
+ /** Error code carried by {@link PaymentNotDeliveredError}. */
37
+ export declare const PAYMENT_NOT_DELIVERED = "PAYMENT_NOT_DELIVERED";
38
+ /**
39
+ * Thrown by {@link VisaTapQuicTransport.connect} when no working QUIC
40
+ * transport is available, so nothing could be delivered.
41
+ */
42
+ export declare class QuicTransportUnavailableError extends Error {
43
+ readonly reason: string;
44
+ readonly code = "QUIC_UNAVAILABLE";
45
+ constructor(reason: string);
46
+ }
47
+ /**
48
+ * Thrown when a send did not produce a confirmed response, so the caller must
49
+ * treat the payment message as not delivered.
50
+ */
51
+ export declare class PaymentNotDeliveredError extends Error {
52
+ readonly code = "PAYMENT_NOT_DELIVERED";
53
+ constructor(message: string);
54
+ }
55
+ /** Result of {@link getQuicTransportStatus}. */
56
+ export interface QuicTransportStatus {
57
+ available: boolean;
58
+ reason?: string;
59
+ }
60
+ /**
61
+ * Ask agentic-flow whether its QUIC transport can actually move data.
62
+ *
63
+ * Fails closed: QUIC counts as available only when agentic-flow exports a
64
+ * probe and that probe says so. Older agentic-flow releases have no probe,
65
+ * and their QuicTransport is the same placeholder, so they are unavailable.
66
+ */
67
+ export declare function getQuicTransportStatus(mod?: any): Promise<QuicTransportStatus>;
23
68
  /**
24
69
  * Visa TAP QUIC Transport
25
70
  *
26
- * Provides high-performance QUIC transport for Visa TAP payments
27
- * with 0-RTT connection resumption and multiplexed streams.
71
+ * QUIC transport for Visa TAP payments, backed by agentic-flow.
72
+ *
73
+ * `connect()` rejects with {@link QuicTransportUnavailableError} unless
74
+ * agentic-flow reports a working QUIC transport. With every agentic-flow
75
+ * release published so far it rejects. Use {@link VisaTapQuicTransport.create}
76
+ * to construct and check in one step.
28
77
  */
29
78
  export declare class VisaTapQuicTransport {
30
79
  private quic;
31
80
  private config;
32
81
  private connected;
82
+ /**
83
+ * Construct a transport and connect it, failing fast when QUIC is
84
+ * unavailable.
85
+ *
86
+ * @throws QuicTransportUnavailableError when no working QUIC transport exists
87
+ */
88
+ static create(config: QuicConfig): Promise<VisaTapQuicTransport>;
33
89
  constructor(config: QuicConfig);
34
90
  /**
35
- * Connect to QUIC server
91
+ * Connect to the QUIC server.
36
92
  *
37
- * Supports 0-RTT connection resumption for sub-millisecond reconnection
93
+ * @throws Error with install instructions when agentic-flow is not installed
94
+ * @throws QuicTransportUnavailableError when agentic-flow has no working QUIC
38
95
  */
39
96
  connect(): Promise<void>;
40
97
  /**
41
98
  * Send payment request over QUIC
42
99
  *
43
100
  * @param signedMandate - Cryptographically signed Active Mandate
44
- * @returns Payment response
101
+ * @returns Payment response returned by the server
102
+ * @throws PaymentNotDeliveredError when no response with a transactionId came back
45
103
  */
46
104
  sendPayment(signedMandate: SignedActiveMandate): Promise<PaymentResponse>;
47
105
  /**
48
106
  * Send raw payment data
49
107
  *
50
108
  * @param data - Payment data object
51
- * @returns Response data
109
+ * @returns Response data returned by the server
110
+ * @throws PaymentNotDeliveredError when the transport returned no response
52
111
  */
53
112
  send(data: any): Promise<any>;
54
113
  /**
@@ -68,7 +127,10 @@ export declare class VisaTapQuicTransport {
68
127
  */
69
128
  close(): Promise<void>;
70
129
  /**
71
- * Parse payment response from QUIC
130
+ * Validate a payment response from the server.
131
+ *
132
+ * Never synthesises a response: a missing response, or one without a
133
+ * transactionId and a known status, means the payment was not confirmed.
72
134
  */
73
135
  private parsePaymentResponse;
74
136
  }
@@ -1 +1 @@
1
- {"version":3,"file":"quic-transport.d.ts","sourceRoot":"","sources":["../../src/visa-tap/quic-transport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAK9F;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,wEAAwE;AACxE,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,CAuBtD;AAED;;;;;GAKG;AACH,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,IAAI,CAAa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,CAEtB"}
@@ -1,7 +1,18 @@
1
1
  /**
2
2
  * QUIC Transport Integration for Visa TAP
3
3
  *
4
- * Bridges agentic-payments with agentic-flow QUIC transport
4
+ * Bridges agentic-payments with the agentic-flow QUIC transport.
5
+ *
6
+ * No published agentic-flow release ships a working QUIC transport:
7
+ * `agentic-flow/transport/quic` is a placeholder whose `send()` discards the
8
+ * data. This transport therefore refuses to connect unless agentic-flow
9
+ * reports QUIC as available (`getQuicStatus()`), and never reports a payment
10
+ * as sent unless a real response comes back.
11
+ *
12
+ * It deliberately does not fall back to agentic-flow's WebSocket transport:
13
+ * no Visa TAP endpoint speaks that framing, its `send()` has no
14
+ * application-level acknowledgement, and plain `ws://` would carry mandates
15
+ * in cleartext. Failing closed is the only safe behaviour for payments.
5
16
  */
6
17
  // Dynamic import to handle optional dependency gracefully
7
18
  let QuicTransport = null;
@@ -38,16 +49,102 @@ export async function loadQuicTransport() {
38
49
  QuicTransport = mod.QuicTransport;
39
50
  return QuicTransport;
40
51
  }
52
+ /** Error code carried by {@link QuicTransportUnavailableError}. */
53
+ export const QUIC_UNAVAILABLE = 'QUIC_UNAVAILABLE';
54
+ /** Error code carried by {@link PaymentNotDeliveredError}. */
55
+ export const PAYMENT_NOT_DELIVERED = 'PAYMENT_NOT_DELIVERED';
56
+ /**
57
+ * Thrown by {@link VisaTapQuicTransport.connect} when no working QUIC
58
+ * transport is available, so nothing could be delivered.
59
+ */
60
+ export class QuicTransportUnavailableError extends Error {
61
+ reason;
62
+ code = QUIC_UNAVAILABLE;
63
+ constructor(reason) {
64
+ super(`Visa TAP QUIC transport is unavailable: ${reason} No payment data can be sent over it; submit the mandate over HTTPS instead.`);
65
+ this.reason = reason;
66
+ this.name = 'QuicTransportUnavailableError';
67
+ }
68
+ }
69
+ /**
70
+ * Thrown when a send did not produce a confirmed response, so the caller must
71
+ * treat the payment message as not delivered.
72
+ */
73
+ export class PaymentNotDeliveredError extends Error {
74
+ code = PAYMENT_NOT_DELIVERED;
75
+ constructor(message) {
76
+ super(message);
77
+ this.name = 'PaymentNotDeliveredError';
78
+ }
79
+ }
80
+ const NO_PROBE_REASON = 'the installed agentic-flow has no getQuicStatus()/isQuicAvailable() probe, and its ' +
81
+ 'agentic-flow/transport/quic QuicTransport is a placeholder that sends no bytes.';
82
+ /**
83
+ * Ask agentic-flow whether its QUIC transport can actually move data.
84
+ *
85
+ * Fails closed: QUIC counts as available only when agentic-flow exports a
86
+ * probe and that probe says so. Older agentic-flow releases have no probe,
87
+ * and their QuicTransport is the same placeholder, so they are unavailable.
88
+ */
89
+ export async function getQuicTransportStatus(mod) {
90
+ if (!mod) {
91
+ try {
92
+ // @ts-ignore - Dynamic import of optional peer dependency
93
+ mod = await import(AGENTIC_FLOW_QUIC_MODULE);
94
+ }
95
+ catch {
96
+ return {
97
+ available: false,
98
+ reason: `agentic-flow is not installed (npm install agentic-flow@"${AGENTIC_FLOW_PEER_RANGE}").`,
99
+ };
100
+ }
101
+ }
102
+ try {
103
+ if (typeof mod?.getQuicStatus === 'function') {
104
+ const status = await mod.getQuicStatus();
105
+ if (status?.available === true)
106
+ return { available: true };
107
+ return {
108
+ available: false,
109
+ reason: String(status?.reason || 'agentic-flow reports QUIC as unavailable.'),
110
+ };
111
+ }
112
+ if (typeof mod?.isQuicAvailable === 'function') {
113
+ if ((await mod.isQuicAvailable()) === true)
114
+ return { available: true };
115
+ return { available: false, reason: 'agentic-flow reports QUIC as unavailable.' };
116
+ }
117
+ }
118
+ catch (error) {
119
+ return { available: false, reason: `agentic-flow QUIC probe failed: ${String(error)}` };
120
+ }
121
+ return { available: false, reason: NO_PROBE_REASON };
122
+ }
41
123
  /**
42
124
  * Visa TAP QUIC Transport
43
125
  *
44
- * Provides high-performance QUIC transport for Visa TAP payments
45
- * with 0-RTT connection resumption and multiplexed streams.
126
+ * QUIC transport for Visa TAP payments, backed by agentic-flow.
127
+ *
128
+ * `connect()` rejects with {@link QuicTransportUnavailableError} unless
129
+ * agentic-flow reports a working QUIC transport. With every agentic-flow
130
+ * release published so far it rejects. Use {@link VisaTapQuicTransport.create}
131
+ * to construct and check in one step.
46
132
  */
47
133
  export class VisaTapQuicTransport {
48
134
  quic = null;
49
135
  config;
50
136
  connected = false;
137
+ /**
138
+ * Construct a transport and connect it, failing fast when QUIC is
139
+ * unavailable.
140
+ *
141
+ * @throws QuicTransportUnavailableError when no working QUIC transport exists
142
+ */
143
+ static async create(config) {
144
+ const transport = new VisaTapQuicTransport(config);
145
+ await transport.connect();
146
+ return transport;
147
+ }
51
148
  constructor(config) {
52
149
  this.config = {
53
150
  timeout: 30000,
@@ -57,12 +154,18 @@ export class VisaTapQuicTransport {
57
154
  };
58
155
  }
59
156
  /**
60
- * Connect to QUIC server
157
+ * Connect to the QUIC server.
61
158
  *
62
- * Supports 0-RTT connection resumption for sub-millisecond reconnection
159
+ * @throws Error with install instructions when agentic-flow is not installed
160
+ * @throws QuicTransportUnavailableError when agentic-flow has no working QUIC
63
161
  */
64
162
  async connect() {
65
163
  const QuicClient = await loadQuicTransport();
164
+ // @ts-ignore - Dynamic import of optional peer dependency (cached by loadQuicTransport)
165
+ const status = await getQuicTransportStatus(await import(AGENTIC_FLOW_QUIC_MODULE));
166
+ if (!status.available) {
167
+ throw new QuicTransportUnavailableError(status.reason ?? 'unknown reason.');
168
+ }
66
169
  this.quic = new QuicClient({
67
170
  host: this.config.host,
68
171
  port: this.config.port,
@@ -75,7 +178,8 @@ export class VisaTapQuicTransport {
75
178
  * Send payment request over QUIC
76
179
  *
77
180
  * @param signedMandate - Cryptographically signed Active Mandate
78
- * @returns Payment response
181
+ * @returns Payment response returned by the server
182
+ * @throws PaymentNotDeliveredError when no response with a transactionId came back
79
183
  */
80
184
  async sendPayment(signedMandate) {
81
185
  if (!this.connected) {
@@ -92,13 +196,19 @@ export class VisaTapQuicTransport {
92
196
  * Send raw payment data
93
197
  *
94
198
  * @param data - Payment data object
95
- * @returns Response data
199
+ * @returns Response data returned by the server
200
+ * @throws PaymentNotDeliveredError when the transport returned no response
96
201
  */
97
202
  async send(data) {
98
203
  if (!this.connected) {
99
204
  throw new Error('Not connected. Call connect() first.');
100
205
  }
101
- return await this.quic.send(data);
206
+ const response = await this.quic.send(data);
207
+ if (response === undefined || response === null) {
208
+ throw new PaymentNotDeliveredError('The QUIC transport returned no response, so delivery is unconfirmed. ' +
209
+ 'Treat the message as not sent.');
210
+ }
211
+ return response;
102
212
  }
103
213
  /**
104
214
  * Get connection statistics
@@ -137,23 +247,21 @@ export class VisaTapQuicTransport {
137
247
  }
138
248
  }
139
249
  /**
140
- * Parse payment response from QUIC
250
+ * Validate a payment response from the server.
251
+ *
252
+ * Never synthesises a response: a missing response, or one without a
253
+ * transactionId and a known status, means the payment was not confirmed.
141
254
  */
142
255
  parsePaymentResponse(raw) {
143
- // agentic-flow 2.x/3.x QuicTransport.send() resolves to undefined
144
- const response = raw ?? {};
145
- // Handle different response formats
146
- if (response.transactionId) {
147
- return response;
256
+ const transactionId = raw?.transactionId;
257
+ if (raw === undefined || raw === null || typeof transactionId !== 'string' || !transactionId) {
258
+ throw new PaymentNotDeliveredError('The QUIC transport returned no payment response with a transactionId, so the ' +
259
+ 'payment was not confirmed. Treat it as not sent.');
148
260
  }
149
- // Default response format
150
- return {
151
- transactionId: response.id || crypto.randomUUID(),
152
- status: response.status || 'pending',
153
- amount: response.amount || 0,
154
- currency: response.currency || 'USD',
155
- timestamp: new Date().toISOString(),
156
- };
261
+ if (!['approved', 'declined', 'pending'].includes(raw.status)) {
262
+ throw new PaymentNotDeliveredError(`The payment response has an unknown status (${String(raw.status)}); treat it as not confirmed.`);
263
+ }
264
+ return raw;
157
265
  }
158
266
  }
159
267
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"quic-transport.js","sourceRoot":"","sources":["../../src/visa-tap/quic-transport.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,0DAA0D;AAC1D,IAAI,aAAa,GAAQ,IAAI,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,CAAC,MAA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C,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;AAClD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-payments",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Dual-protocol payment infrastructure for autonomous AI commerce (AP2 + ACP)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -135,7 +135,7 @@
135
135
  "@typescript-eslint/eslint-plugin": "^6.19.0",
136
136
  "@typescript-eslint/parser": "^6.19.0",
137
137
  "@vitest/coverage-v8": "^1.6.1",
138
- "agentic-flow": "^3.4.0",
138
+ "agentic-flow": "^3.4.4",
139
139
  "eslint": "^8.56.0",
140
140
  "eslint-config-prettier": "^9.1.0",
141
141
  "eslint-plugin-import": "^2.29.1",