@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
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-BCkwBA84.mjs';
1
+ import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-Dxf9DBpr.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Verification Interstitial Component
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-BCkwBA84.js';
1
+ import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-Dxf9DBpr.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Verification Interstitial Component
package/dist/verify.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-DlshIIR-.mjs';
1
+ import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-Eg6VoBNH.mjs';
2
2
  import { ObservedMetadata } from './metadata-capture.mjs';
3
3
 
4
4
  /**
package/dist/verify.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-C_b4QTyO.js';
1
+ import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-DtJjlW4O.js';
2
2
  import { ObservedMetadata } from './metadata-capture.js';
3
3
 
4
4
  /**
package/dist/verify.js CHANGED
@@ -37,7 +37,7 @@ __export(verify_exports, {
37
37
  module.exports = __toCommonJS(verify_exports);
38
38
 
39
39
  // src/version.ts
40
- var SDK_VERSION = "5.14.0";
40
+ var SDK_VERSION = "5.15.0";
41
41
 
42
42
  // src/http.ts
43
43
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -422,6 +422,7 @@ async function callVerifyAccessAPI(config, request) {
422
422
  if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
423
423
  if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
424
424
  if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
425
+ if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
425
426
  if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
426
427
  if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
427
428
  if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
@@ -572,7 +573,8 @@ async function verify(config, request, options) {
572
573
  "[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
573
574
  );
574
575
  }
575
- if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache) {
576
+ const uncacheable = Boolean(request.commerceArtifacts);
577
+ if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
576
578
  const cached = getCachedResult(request, mergedConfig.counterpartyId);
577
579
  if (cached) {
578
580
  if (mergedConfig.debug) {
@@ -653,7 +655,10 @@ async function verify(config, request, options) {
653
655
  // MERCHANT caller only (bridge callers strip it before the agent plane).
654
656
  settlementToken: apiResponse.settlementToken,
655
657
  // 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
656
- fulfilment: apiResponse.fulfilment
658
+ fulfilment: apiResponse.fulfilment,
659
+ mandates: apiResponse.mandates,
660
+ kyaToken: apiResponse.kyaToken,
661
+ aep: apiResponse.aep
657
662
  };
658
663
  return result2;
659
664
  }
@@ -663,7 +668,10 @@ async function verify(config, request, options) {
663
668
  trustScore: apiResponse.agent.trustScore,
664
669
  trustLevel: getTrustLevel(apiResponse.agent.trustScore),
665
670
  blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
666
- status: apiResponse.agent.agentStatus
671
+ status: apiResponse.agent.agentStatus,
672
+ ...apiResponse.agent.protocolIdentities && {
673
+ protocolIdentities: apiResponse.agent.protocolIdentities
674
+ }
667
675
  } : void 0;
668
676
  const developer = apiResponse.developer ? {
669
677
  astradId: apiResponse.developer.kyaOwnerId,
@@ -714,7 +722,11 @@ async function verify(config, request, options) {
714
722
  settlementOutcome: apiResponse.settlementOutcome,
715
723
  settlementToken: apiResponse.settlementToken,
716
724
  // 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
717
- fulfilment: apiResponse.fulfilment
725
+ fulfilment: apiResponse.fulfilment,
726
+ // 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
727
+ mandates: apiResponse.mandates,
728
+ kyaToken: apiResponse.kyaToken,
729
+ aep: apiResponse.aep
718
730
  };
719
731
  if (result.recommendation === "deny") {
720
732
  result.policyAllowed = false;
@@ -734,7 +746,9 @@ async function verify(config, request, options) {
734
746
  }
735
747
  const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
736
748
  if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
737
- cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
749
+ if (!uncacheable) {
750
+ cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
751
+ }
738
752
  }
739
753
  return result;
740
754
  }