@astrasyncai/verification-gateway 5.20.0 → 5.21.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 (95) hide show
  1. package/CHANGELOG.md +62 -3
  2. package/README.md +2 -2
  3. package/dist/adapters/express.d.mts +1 -1
  4. package/dist/adapters/express.d.ts +1 -1
  5. package/dist/adapters/express.js +1 -1
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +1 -1
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/mcp.d.mts +1 -1
  10. package/dist/adapters/mcp.d.ts +1 -1
  11. package/dist/adapters/mcp.js +1 -1
  12. package/dist/adapters/mcp.js.map +1 -1
  13. package/dist/adapters/mcp.mjs +1 -1
  14. package/dist/adapters/mcp.mjs.map +1 -1
  15. package/dist/adapters/nextjs.d.mts +1 -1
  16. package/dist/adapters/nextjs.d.ts +1 -1
  17. package/dist/adapters/nextjs.js +1 -1
  18. package/dist/adapters/nextjs.js.map +1 -1
  19. package/dist/adapters/nextjs.mjs +1 -1
  20. package/dist/adapters/nextjs.mjs.map +1 -1
  21. package/dist/adapters/sdk.d.mts +8 -31
  22. package/dist/adapters/sdk.d.ts +8 -31
  23. package/dist/adapters/sdk.js +8 -22
  24. package/dist/adapters/sdk.js.map +1 -1
  25. package/dist/adapters/sdk.mjs +8 -22
  26. package/dist/adapters/sdk.mjs.map +1 -1
  27. package/dist/agent/index.js +1 -1
  28. package/dist/agent/index.js.map +1 -1
  29. package/dist/agent/index.mjs +1 -1
  30. package/dist/agent/index.mjs.map +1 -1
  31. package/dist/bin/astrasync-claude-hook.js +2 -2
  32. package/dist/bin/astrasync-codex-hook.js +2 -2
  33. package/dist/bin/astrasync-guard.js +2 -2
  34. package/dist/bin/astrasync.js +15 -2
  35. package/dist/browser/background.js +2 -2
  36. package/dist/browser/background.js.map +1 -1
  37. package/dist/browser/background.mjs +2 -2
  38. package/dist/browser/background.mjs.map +1 -1
  39. package/dist/cli/index.js +1 -1
  40. package/dist/cli/index.js.map +1 -1
  41. package/dist/cli/index.mjs +1 -1
  42. package/dist/cli/index.mjs.map +1 -1
  43. package/dist/codex/index.js +2 -2
  44. package/dist/codex/index.js.map +1 -1
  45. package/dist/codex/index.mjs +2 -2
  46. package/dist/codex/index.mjs.map +1 -1
  47. package/dist/cursor/extension.js +2 -2
  48. package/dist/cursor/extension.js.map +1 -1
  49. package/dist/cursor/extension.mjs +2 -2
  50. package/dist/cursor/extension.mjs.map +1 -1
  51. package/dist/edge-config.d.mts +1 -1
  52. package/dist/edge-config.d.ts +1 -1
  53. package/dist/edge-config.js +1 -1
  54. package/dist/edge-config.js.map +1 -1
  55. package/dist/edge-config.mjs +1 -1
  56. package/dist/edge-config.mjs.map +1 -1
  57. package/dist/edge-core/index.d.mts +1 -1
  58. package/dist/edge-core/index.d.ts +1 -1
  59. package/dist/edge-core/index.js +1 -1
  60. package/dist/edge-core/index.js.map +1 -1
  61. package/dist/edge-core/index.mjs +1 -1
  62. package/dist/edge-core/index.mjs.map +1 -1
  63. package/dist/gateway/gateway.js +2 -2
  64. package/dist/gateway/gateway.js.map +1 -1
  65. package/dist/gateway/gateway.mjs +2 -2
  66. package/dist/gateway/gateway.mjs.map +1 -1
  67. package/dist/git-trigger/git-hooks.d.mts +1 -1
  68. package/dist/git-trigger/git-hooks.d.ts +1 -1
  69. package/dist/index.d.mts +156 -34
  70. package/dist/index.d.ts +156 -34
  71. package/dist/index.js +327 -40
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +319 -40
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/registration/index.js +1 -1
  76. package/dist/registration/index.js.map +1 -1
  77. package/dist/registration/index.mjs +1 -1
  78. package/dist/registration/index.mjs.map +1 -1
  79. package/dist/transport/index.js +1 -1
  80. package/dist/transport/index.js.map +1 -1
  81. package/dist/transport/index.mjs +1 -1
  82. package/dist/transport/index.mjs.map +1 -1
  83. package/dist/{types-D37aSQ9c.d.mts → types-B4zhOAlq.d.mts} +5 -0
  84. package/dist/{types-Dn8tXnei.d.ts → types-CtBXnWuV.d.ts} +5 -0
  85. package/dist/{types-CxjqmPl-.d.mts → types-DHHyXtuZ.d.mts} +5 -0
  86. package/dist/{types-CxjqmPl-.d.ts → types-DHHyXtuZ.d.ts} +5 -0
  87. package/dist/ui/index.d.mts +1 -1
  88. package/dist/ui/index.d.ts +1 -1
  89. package/dist/verify.d.mts +1 -1
  90. package/dist/verify.d.ts +1 -1
  91. package/dist/verify.js +1 -1
  92. package/dist/verify.js.map +1 -1
  93. package/dist/verify.mjs +1 -1
  94. package/dist/verify.mjs.map +1 -1
  95. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -8,6 +8,65 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
8
8
  Full architectural context for each release lives in the platform spec at
9
9
  `docs/research/adapter-architecture-technical-requirements.md`.
10
10
 
11
+ ## [5.21.1] — 2026-10-24 — pricingContextFrom exported
12
+
13
+ ### Added
14
+
15
+ - **`pricingContextFrom(headers)`** and the `PricingContext` type are exported
16
+ from the package root (they were internal to the kits). Use them when your
17
+ own catalogue route prices with `createAgentCommerce`:
18
+ `commerce.price(sku, priceMinor, pricingContextFrom(req.headers))`. Your
19
+ catalogue then applies exactly the kits' rule (a cardholder price only for a
20
+ verified agent with a valid `X-Astra-Issuer-Program`), so the price an agent
21
+ sees can't drift from the price your checkout charges.
22
+
23
+ ## [5.21.0] — 2026-10-26 — endpoint changes are dashboard-only, agent commerce studio rules
24
+
25
+ ### Removed (breaking, security — shops' item 48)
26
+
27
+ - **`VerificationGatewayClient.updateEndpoint`** and the `EndpointOperationalPatch`
28
+ type. After registration, endpoint settings (checkout, catalogue, events,
29
+ skill and health check URLs) change in the dashboard only, behind the
30
+ owner's login and MFA; the platform now refuses API keys on
31
+ `PATCH /api/endpoints/:id` (403). Why: a merchant's API key lives in its
32
+ host's environment, and a host compromise must not let a leaked key point
33
+ agents at another checkout or catalogue under the merchant's verified
34
+ identity. Every dashboard change to one of these URLs alerts the owner.
35
+ - **`sendTestEvent(id, { approvalId })`.** From code the test event is
36
+ synthetic only (an `approvalId` is no longer sent; the platform answers 403
37
+ `dashboard_only` to an API key that sends one). A real held approval's
38
+ payload releases or re-drives that checkout, so it is sent from the
39
+ endpoint page in the dashboard.
40
+
41
+ ### Changed
42
+
43
+ - **The default AstraSync API base is `https://astrasync.ai/api`** (gateway
44
+ online mode, the transport's default verify URL, README examples), the same
45
+ as `verify()`'s documented base. `api.astrasync.ai` still answers; pass
46
+ `apiBaseUrl` explicitly as before if you set one.
47
+
48
+ ### Added — agent commerce studio rules
49
+
50
+ - **`createAgentCommerce({ apiBaseUrl, apiKey, counterpartyId })`** fetches
51
+ the rules you set in the dashboard (endpoint → Agent commerce) every 5
52
+ minutes and keeps the last good copy when a fetch fails: product
53
+ visibility, agent price, the image agents get, a verified-agent discount,
54
+ and card issuer offers. AstraSync stores rules only; it hosts nothing.
55
+ `report({ catalogUrl, checkoutUrl, eventsUrl })` tells the dashboard where
56
+ your kit lives — shown as suggestions you confirm; it never sets a URL.
57
+ - **`serveAgentCatalog({ commerce, products })`** serves your catalogue to
58
+ agents priced and filtered by those rules (`issuer_offer` marks a
59
+ cardholder-priced line). **`fromFeed(url)`** reads a Shopify
60
+ `products.json`, Google Merchant XML, CSV or JSON feed you already have.
61
+ - **Kits: `agentCommerce`.** The UCP and ACP kits price lines with the same
62
+ rules, so the agent's price is the price you charge. A cardholder price
63
+ applies on `X-Astra-Issuer-Program` (sent by the AstraSync bridge) and the
64
+ confirm carries `metadata.issuerProgram`; AstraSync refuses the purchase
65
+ unless the buyer is that programme's cardholder. Pass `metadata` through
66
+ in your `verifyPurchase`.
67
+ - `issuerOfferPrice` / `priceForAgent`: the shared price rule (percent off,
68
+ half up, clamped).
69
+
11
70
  ## [5.20.0] — 2026-10-19 — fewer backend calls, recoverable declined holds, endpoint ops from code
12
71
 
13
72
  ### Changed (behaviour)
@@ -48,12 +107,12 @@ Full architectural context for each release lives in the platform spec at
48
107
  in the verify-access body (honoured only from a first-party AstraSync
49
108
  service caller; a verify carrying it is never cached).
50
109
  - `VerificationGatewayClient.updateEndpoint(id, { eventsUrl, healthCheckUrl,
51
- skillUrl, catalogUrl, checkoutUrl })` → `PATCH /api/endpoints/:id`
110
+ skillUrl, catalogUrl, checkoutUrl })` → `PATCH /api/endpoints/:id`
52
111
  (operational URLs only, API key of the owner or an org member) and
53
112
  `sendTestEvent(id, { type, approvalId? })` → `POST
54
- /api/endpoints/:id/events/test` (one signed step-up event delivered now;
113
+ /api/endpoints/:id/events/test` (one signed step-up event delivered now;
55
114
  returns `{ delivered, status, responseCode, error, eventId, type,
56
- approvalId }`). Types `EndpointOperationalPatch`, `TestEventType`,
115
+ approvalId }`). Types `EndpointOperationalPatch`, `TestEventType`,
57
116
  `TestEventResult`.
58
117
  - Kits' `pollHeldSessions` releases a `lapsed` approval (UCP and ACP);
59
118
  `StepUpApprovalStatus` gains `'lapsed'`.
package/README.md CHANGED
@@ -73,7 +73,7 @@ import { createMiddleware } from '@astrasyncai/verification-gateway/nextjs';
73
73
  // v2.3.7+ — per-route policy lives in the AstraSync dashboard.
74
74
  // The SDK fetches it on init via counterpartyId; do NOT pass routes here.
75
75
  export const middleware = createMiddleware({
76
- apiBaseUrl: 'https://api.astrasync.ai',
76
+ apiBaseUrl: 'https://astrasync.ai/api', // always includes /api
77
77
  apiKey: process.env.ASTRASYNC_API_KEY,
78
78
  counterpartyId: 'ASTRAE-...',
79
79
  showInterstitial: true,
@@ -90,7 +90,7 @@ export const config = {
90
90
  import { createClient } from '@astrasyncai/verification-gateway/sdk';
91
91
 
92
92
  const gateway = createClient({
93
- apiBaseUrl: 'https://api.astrasync.ai',
93
+ apiBaseUrl: 'https://astrasync.ai/api', // always includes /api
94
94
  });
95
95
 
96
96
  // Verify another agent before interacting
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { e as VerificationResult, E as ExpressMiddlewareOptions, b as AstraSyncCredentials } from '../types-CxjqmPl-.mjs';
2
+ import { e as VerificationResult, E as ExpressMiddlewareOptions, b as AstraSyncCredentials } from '../types-DHHyXtuZ.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 { e as VerificationResult, E as ExpressMiddlewareOptions, b as AstraSyncCredentials } from '../types-CxjqmPl-.js';
2
+ import { e as VerificationResult, E as ExpressMiddlewareOptions, b as AstraSyncCredentials } from '../types-DHHyXtuZ.js';
3
3
 
4
4
  /**
5
5
  * AstraSync Universal Verification Gateway - Express Middleware
@@ -479,7 +479,7 @@ function routePolicyOf(route) {
479
479
  }
480
480
 
481
481
  // src/version.ts
482
- var SDK_VERSION = "5.20.0";
482
+ var SDK_VERSION = "5.21.1";
483
483
 
484
484
  // src/http.ts
485
485
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;