@astrasyncai/verification-gateway 5.14.0 → 5.16.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.
- package/README.md +36 -18
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +492 -240
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +492 -240
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +23 -6
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +23 -6
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +475 -239
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +475 -239
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +18 -10
- package/dist/adapters/sdk.d.ts +18 -10
- package/dist/adapters/sdk.js +83 -23
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +83 -23
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +69 -54
- package/dist/agent/index.d.ts +69 -54
- package/dist/agent/index.js +24 -14
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +24 -14
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +58 -11
- package/dist/bin/astrasync-codex-hook.js +58 -11
- package/dist/bin/astrasync-guard.js +177 -11
- package/dist/bin/astrasync.js +433 -38
- package/dist/browser/background.js +53 -6
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +63 -6
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +58 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +68 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +58 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +68 -11
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +31 -2
- package/dist/edge-config.d.ts +31 -2
- package/dist/edge-config.js +35 -5
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +32 -4
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +11 -2
- package/dist/edge-core/index.d.ts +11 -2
- package/dist/edge-core/index.js +97 -11
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +95 -11
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +53 -6
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +63 -6
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +1407 -88
- package/dist/index.d.ts +1407 -88
- package/dist/index.js +5148 -2616
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5094 -2618
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.d.mts +28 -2
- package/dist/registration/index.d.ts +28 -2
- package/dist/registration/index.js +18 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +15 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +7 -5
- package/dist/transport/index.d.ts +7 -5
- package/dist/transport/index.js +61 -5
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +67 -11
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-BCkwBA84.d.mts → types-Blz520bR.d.mts} +116 -12
- package/dist/{types-BCkwBA84.d.ts → types-Blz520bR.d.ts} +116 -12
- package/dist/{types-C_b4QTyO.d.ts → types-Bm1QvGqI.d.ts} +114 -10
- package/dist/{types-DlshIIR-.d.mts → types-DBe4hgfT.d.mts} +114 -10
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +23 -6
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +23 -6
- package/dist/verify.mjs.map +1 -1
- 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
|
-
| `
|
|
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
|
-
**
|
|
542
|
-
|
|
543
|
-
`
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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
|
|
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
|
|
|
@@ -826,7 +836,15 @@ The installer registers the `astrasync-claude-hook` binary in Claude Code's `set
|
|
|
826
836
|
- **BREAKING type change:** `SettlementArtifact.binding` is now a union — `StablecoinSettlementBinding` (v2: `amountMinor` integer minor units + `assetDecimals`, pinned `chainId`/`tokenContract`/CAIP-19 `asset`) or `FiatSettlementBinding` (processor artifacts keep major-unit `amount`). The float `amount` field is gone from stablecoin bindings. Matches the server's `ver: 2` wire format, which redeems/verifies reject other versions of.
|
|
827
837
|
- Settlement Artifacts docs rewritten: voucher lifecycle endpoints (verify / redeem / JWKS), expected-value gates on redeem, revocation semantics, and an explicit **guarantee boundary** — what a successful redeem proves and what it doesn't (redeem proves the authorization is live and single-use; it does not check or move funds).
|
|
828
838
|
|
|
829
|
-
###
|
|
839
|
+
### v5.16.0 — ChallengeHandler auto-include removed
|
|
840
|
+
|
|
841
|
+
- `ChallengeHandler` answers only for counterparties registered as pending —
|
|
842
|
+
the 3.7.1 auto-include let anyone presenting an agent's ASTRA-id pass its
|
|
843
|
+
runtime challenge. Pass `challengeHandler` to `AgentClient` and `fetch()`
|
|
844
|
+
registers each call while it is in flight; otherwise call
|
|
845
|
+
`registerPending()` / `removePending()` around each interaction.
|
|
846
|
+
|
|
847
|
+
### v3.7.1 — ChallengeHandler auto-include (removed in 5.16.0)
|
|
830
848
|
|
|
831
849
|
- `ChallengeHandler` auto-includes the incoming `counterpartyId`/`counterpartyUrl` in the challenge response when no counterparties were pre-registered via `registerPending()` — the correct default for agents that never call it. Pre-registered whitelists behave exactly as before.
|
|
832
850
|
- Runtime-challenge docs: auto-include default + double-appended-path warning.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-Blz520bR.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-
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-Blz520bR.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|