@astrasyncai/verification-gateway 5.14.0 → 5.15.0

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 (98) hide show
  1. package/README.md +27 -17
  2. package/dist/adapters/express.d.mts +1 -1
  3. package/dist/adapters/express.d.ts +1 -1
  4. package/dist/adapters/express.js +477 -240
  5. package/dist/adapters/express.js.map +1 -1
  6. package/dist/adapters/express.mjs +477 -240
  7. package/dist/adapters/express.mjs.map +1 -1
  8. package/dist/adapters/mcp.d.mts +1 -1
  9. package/dist/adapters/mcp.d.ts +1 -1
  10. package/dist/adapters/mcp.js +20 -6
  11. package/dist/adapters/mcp.js.map +1 -1
  12. package/dist/adapters/mcp.mjs +20 -6
  13. package/dist/adapters/mcp.mjs.map +1 -1
  14. package/dist/adapters/nextjs.d.mts +1 -1
  15. package/dist/adapters/nextjs.d.ts +1 -1
  16. package/dist/adapters/nextjs.js +460 -239
  17. package/dist/adapters/nextjs.js.map +1 -1
  18. package/dist/adapters/nextjs.mjs +460 -239
  19. package/dist/adapters/nextjs.mjs.map +1 -1
  20. package/dist/adapters/sdk.d.mts +18 -10
  21. package/dist/adapters/sdk.d.ts +18 -10
  22. package/dist/adapters/sdk.js +80 -23
  23. package/dist/adapters/sdk.js.map +1 -1
  24. package/dist/adapters/sdk.mjs +80 -23
  25. package/dist/adapters/sdk.mjs.map +1 -1
  26. package/dist/agent/index.js +1 -1
  27. package/dist/agent/index.js.map +1 -1
  28. package/dist/agent/index.mjs +1 -1
  29. package/dist/agent/index.mjs.map +1 -1
  30. package/dist/bin/astrasync-claude-hook.js +55 -11
  31. package/dist/bin/astrasync-codex-hook.js +55 -11
  32. package/dist/bin/astrasync-guard.js +55 -11
  33. package/dist/bin/astrasync.js +288 -33
  34. package/dist/browser/background.js +50 -6
  35. package/dist/browser/background.js.map +1 -1
  36. package/dist/browser/background.mjs +60 -6
  37. package/dist/browser/background.mjs.map +1 -1
  38. package/dist/cli/index.js +1 -1
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/cli/index.mjs +1 -1
  41. package/dist/cli/index.mjs.map +1 -1
  42. package/dist/codex/index.js +55 -11
  43. package/dist/codex/index.js.map +1 -1
  44. package/dist/codex/index.mjs +65 -11
  45. package/dist/codex/index.mjs.map +1 -1
  46. package/dist/cursor/extension.js +55 -11
  47. package/dist/cursor/extension.js.map +1 -1
  48. package/dist/cursor/extension.mjs +65 -11
  49. package/dist/cursor/extension.mjs.map +1 -1
  50. package/dist/edge-config.d.mts +31 -2
  51. package/dist/edge-config.d.ts +31 -2
  52. package/dist/edge-config.js +35 -5
  53. package/dist/edge-config.js.map +1 -1
  54. package/dist/edge-config.mjs +32 -4
  55. package/dist/edge-config.mjs.map +1 -1
  56. package/dist/edge-core/index.d.mts +11 -2
  57. package/dist/edge-core/index.d.ts +11 -2
  58. package/dist/edge-core/index.js +93 -10
  59. package/dist/edge-core/index.js.map +1 -1
  60. package/dist/edge-core/index.mjs +91 -10
  61. package/dist/edge-core/index.mjs.map +1 -1
  62. package/dist/gateway/gateway.js +50 -6
  63. package/dist/gateway/gateway.js.map +1 -1
  64. package/dist/gateway/gateway.mjs +60 -6
  65. package/dist/gateway/gateway.mjs.map +1 -1
  66. package/dist/git-trigger/git-hooks.d.mts +1 -1
  67. package/dist/git-trigger/git-hooks.d.ts +1 -1
  68. package/dist/index.d.mts +1314 -34
  69. package/dist/index.d.ts +1314 -34
  70. package/dist/index.js +5116 -2612
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +5063 -2614
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/registration/index.d.mts +28 -2
  75. package/dist/registration/index.d.ts +28 -2
  76. package/dist/registration/index.js +18 -3
  77. package/dist/registration/index.js.map +1 -1
  78. package/dist/registration/index.mjs +15 -2
  79. package/dist/registration/index.mjs.map +1 -1
  80. package/dist/transport/index.d.mts +7 -5
  81. package/dist/transport/index.d.ts +7 -5
  82. package/dist/transport/index.js +61 -5
  83. package/dist/transport/index.js.map +1 -1
  84. package/dist/transport/index.mjs +67 -11
  85. package/dist/transport/index.mjs.map +1 -1
  86. package/dist/{types-C_b4QTyO.d.ts → types-DtJjlW4O.d.ts} +104 -10
  87. package/dist/{types-BCkwBA84.d.mts → types-Dxf9DBpr.d.mts} +106 -12
  88. package/dist/{types-BCkwBA84.d.ts → types-Dxf9DBpr.d.ts} +106 -12
  89. package/dist/{types-DlshIIR-.d.mts → types-Eg6VoBNH.d.mts} +104 -10
  90. package/dist/ui/index.d.mts +1 -1
  91. package/dist/ui/index.d.ts +1 -1
  92. package/dist/verify.d.mts +1 -1
  93. package/dist/verify.d.ts +1 -1
  94. package/dist/verify.js +20 -6
  95. package/dist/verify.js.map +1 -1
  96. package/dist/verify.mjs +20 -6
  97. package/dist/verify.mjs.map +1 -1
  98. package/package.json +1 -1
package/README.md CHANGED
@@ -530,24 +530,34 @@ Read `result.settlementOutcome.status` — never `success` alone:
530
530
 
531
531
  | status | Meaning | Your action |
532
532
  | ------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
533
- | `settled` | Charged; `orderId` present | Fulfil / mark paid |
533
+ | `pending_merchant` | 5.14.1: order recorded — YOU settle it | Charge the `settlementToken` (card) or redeem the `settlement` voucher (stablecoin), then `reportSettlement()` |
534
+ | `settled` | Money moved (reported / webhook) | Fulfil / mark paid |
534
535
  | `requires_approval` | Held for human step-up — not a failure | Record as pending; a re-drive follows approval |
535
- | `pending_merchant` | 5.5.0 self-settle: YOU charge (see below) | Charge with the `settlementToken`, then report |
536
536
  | `failed` | Charge declined (`failureCode`) | Mark failed |
537
537
  | `requires_action` | 3DS/SCA needed on the saved card | Per your policy |
538
538
  | `no_instrument` | Policy passed, no chargeable card on file | Terminal on autonomous; NON-terminal after approval — the human's approval survives; re-drive the same session once a card exists |
539
539
  | _anything else_ | A status newer than your SDK | Treat as PENDING, never failed (open union, 5.5.0) |
540
540
 
541
- **Self-settling merchants (5.5.0, `settlement_mode='self_settle'`):** the
542
- confirm result carries `settlementToken` (agent-blind
543
- `{ stripeCustomerId, stripePaymentMethodId, amountMinor, currency, sessionId,
544
- orderId, jti, statementSuffix, expiresAt }`) instead of a completed charge.
545
- Charge on your own integration with Stripe idempotency key
546
- `voucher:<token.jti>` and `metadata: { jti, sessionId }`, then call
547
- `client.reportSettlement({ sessionId, status, amountMinor, currency,
548
- processorRef })` so the buyer's dashboard and the agent's poll surface
549
- reconcile. Amounts must match the order exactly; replays are safe. Never
550
- expose the token to the agent plane or logs.
541
+ **Every merchant settles (5.14.1 — AstraSync never charges):** a purchase
542
+ grant records the order and returns `settlementOutcome: { status:
543
+ 'pending_merchant', orderId }` with what you settle:
544
+
545
+ - **Card, first-party storefront (our Stripe tenant):** `settlementToken`
546
+ (agent-blind `{ stripeCustomerId, stripePaymentMethodId, amountMinor,
547
+ currency, sessionId, orderId, jti, statementSuffix, expiresAt }`). Charge on
548
+ your own integration with Stripe idempotency key `voucher:<token.jti>` and
549
+ `metadata: { jti, sessionId }`, then `client.reportSettlement({ orderId,
550
+ status, amountMinor, currency, processorRef })`.
551
+ - **Stablecoin, any merchant:** the `settlement` voucher. Redeem it (the order
552
+ moves to `redeemed`), move the funds, then `client.reportSettlement({
553
+ orderId, status: 'settled', amountMinor, currency, txHash, chainId })`.
554
+ - **The request's protocol carried the payment** (ACP / MPP token, x402
555
+ payload, AP2 payment mandate): nothing is minted; settle with that
556
+ credential and report back.
557
+
558
+ Amounts must match the order exactly; replays are safe. An order nobody
559
+ settles expires 10 minutes after its artifact does; a late report still
560
+ settles it. Never expose the token or voucher to the agent plane or logs.
551
561
 
552
562
  **Fulfilment PII (5.6.0):** first-party confirm results carry a
553
563
  `fulfilment: { email, emailSource }` block — you ALWAYS get a fulfilment
@@ -605,11 +615,11 @@ interface FiatSettlementBinding {
605
615
 
606
616
  ### Voucher lifecycle (server-to-server)
607
617
 
608
- | Endpoint | Purpose |
609
- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
610
- | `POST /api/wallets/voucher/verify` | Verify signature/issuer and return the decoded payload — proves authenticity only, no spend |
611
- | `POST /api/wallets/voucher/redeem` | Atomic single-use spend: first caller gets `200 redeemed`, replays get `409 already_redeemed` (with first-redeemer forensics), revoked vouchers get `409 revoked` |
612
- | `GET /api/wallets/voucher/.well-known/jwks.json` | Public JWKS for offline signature verification |
618
+ | Endpoint | Purpose |
619
+ | ------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
620
+ | `POST /api/wallets/voucher/verify` | Verify signature/issuer and return the decoded payload — proves authenticity only, no spend |
621
+ | `POST /api/wallets/voucher/redeem` | Atomic single-use spend: first caller gets `200 redeemed` (plus `order: { status: 'redeemed' }` when the voucher funds a recorded order — 5.14.1, no charge happens here), replays get `409 already_redeemed` (with first-redeemer forensics), revoked vouchers get `409 revoked` |
622
+ | `GET /api/wallets/voucher/.well-known/jwks.json` | Public JWKS for offline signature verification |
613
623
 
614
624
  Redeem accepts optional `expectedAmountMinor` / `expectedCurrency` — mismatches are rejected (`400 amount_mismatch` / `currency_mismatch`) **before** the voucher is spent, so a mismatch never burns the voucher. Vouchers carry `aud` = your merchant id; declare `merchantId` on verify/redeem to have the audience check enforced (standard JWT libraries give you the same check free on offline verification).
615
625
 
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-BCkwBA84.mjs';
2
+ import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-Dxf9DBpr.mjs';
3
3
 
4
4
  /**
5
5
  * AstraSync Universal Verification Gateway - Express Middleware
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-BCkwBA84.js';
2
+ import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-Dxf9DBpr.js';
3
3
 
4
4
  /**
5
5
  * AstraSync Universal Verification Gateway - Express Middleware