@astrasyncai/verification-gateway 5.2.0 → 5.3.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 (127) hide show
  1. package/dist/adapter-interface/interface.d.mts +2 -2
  2. package/dist/adapter-interface/interface.d.ts +2 -2
  3. package/dist/adapters/express.d.mts +2 -2
  4. package/dist/adapters/express.d.ts +2 -2
  5. package/dist/adapters/express.js +8 -3
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +8 -3
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/mcp.d.mts +2 -2
  10. package/dist/adapters/mcp.d.ts +2 -2
  11. package/dist/adapters/mcp.js +8 -3
  12. package/dist/adapters/mcp.js.map +1 -1
  13. package/dist/adapters/mcp.mjs +8 -3
  14. package/dist/adapters/mcp.mjs.map +1 -1
  15. package/dist/adapters/nextjs.d.mts +2 -2
  16. package/dist/adapters/nextjs.d.ts +2 -2
  17. package/dist/adapters/nextjs.js +8 -3
  18. package/dist/adapters/nextjs.js.map +1 -1
  19. package/dist/adapters/nextjs.mjs +8 -3
  20. package/dist/adapters/nextjs.mjs.map +1 -1
  21. package/dist/adapters/sdk.d.mts +2 -2
  22. package/dist/adapters/sdk.d.ts +2 -2
  23. package/dist/adapters/sdk.js +8 -3
  24. package/dist/adapters/sdk.js.map +1 -1
  25. package/dist/adapters/sdk.mjs +8 -3
  26. package/dist/adapters/sdk.mjs.map +1 -1
  27. package/dist/agent/index.d.mts +2 -2
  28. package/dist/agent/index.d.ts +2 -2
  29. package/dist/agent/index.js +1 -1
  30. package/dist/agent/index.js.map +1 -1
  31. package/dist/agent/index.mjs +1 -1
  32. package/dist/agent/index.mjs.map +1 -1
  33. package/dist/bin/astrasync-claude-hook.js +8 -3
  34. package/dist/bin/astrasync-codex-hook.js +8 -3
  35. package/dist/bin/astrasync-guard.js +8 -3
  36. package/dist/bin/astrasync.js +8 -3
  37. package/dist/browser/background.js +8 -3
  38. package/dist/browser/background.js.map +1 -1
  39. package/dist/browser/background.mjs +8 -3
  40. package/dist/browser/background.mjs.map +1 -1
  41. package/dist/browser/browser-adapter.d.mts +2 -2
  42. package/dist/browser/browser-adapter.d.ts +2 -2
  43. package/dist/claude-code/claude-code-adapter.d.mts +2 -2
  44. package/dist/claude-code/claude-code-adapter.d.ts +2 -2
  45. package/dist/cli/index.d.mts +2 -2
  46. package/dist/cli/index.d.ts +2 -2
  47. package/dist/cli/index.js +1 -1
  48. package/dist/cli/index.js.map +1 -1
  49. package/dist/cli/index.mjs +1 -1
  50. package/dist/cli/index.mjs.map +1 -1
  51. package/dist/codex/index.d.mts +2 -2
  52. package/dist/codex/index.d.ts +2 -2
  53. package/dist/codex/index.js +8 -3
  54. package/dist/codex/index.js.map +1 -1
  55. package/dist/codex/index.mjs +8 -3
  56. package/dist/codex/index.mjs.map +1 -1
  57. package/dist/cursor/cursor-adapter.d.mts +2 -2
  58. package/dist/cursor/cursor-adapter.d.ts +2 -2
  59. package/dist/cursor/extension.d.mts +2 -2
  60. package/dist/cursor/extension.d.ts +2 -2
  61. package/dist/cursor/extension.js +8 -3
  62. package/dist/cursor/extension.js.map +1 -1
  63. package/dist/cursor/extension.mjs +8 -3
  64. package/dist/cursor/extension.mjs.map +1 -1
  65. package/dist/edge-config.d.mts +1 -1
  66. package/dist/edge-config.d.ts +1 -1
  67. package/dist/edge-config.js +1 -1
  68. package/dist/edge-config.js.map +1 -1
  69. package/dist/edge-config.mjs +1 -1
  70. package/dist/edge-config.mjs.map +1 -1
  71. package/dist/edge-core/index.d.mts +1 -1
  72. package/dist/edge-core/index.d.ts +1 -1
  73. package/dist/edge-core/index.js +8 -3
  74. package/dist/edge-core/index.js.map +1 -1
  75. package/dist/edge-core/index.mjs +8 -3
  76. package/dist/edge-core/index.mjs.map +1 -1
  77. package/dist/{express-xK8pRrmj.d.ts → express-DHEz_6Rh.d.ts} +1 -1
  78. package/dist/{express-KkBZBMqi.d.mts → express-PLYlCd5k.d.mts} +1 -1
  79. package/dist/gateway/gateway.d.mts +2 -2
  80. package/dist/gateway/gateway.d.ts +2 -2
  81. package/dist/gateway/gateway.js +8 -3
  82. package/dist/gateway/gateway.js.map +1 -1
  83. package/dist/gateway/gateway.mjs +8 -3
  84. package/dist/gateway/gateway.mjs.map +1 -1
  85. package/dist/git-trigger/git-hooks.d.mts +2 -2
  86. package/dist/git-trigger/git-hooks.d.ts +2 -2
  87. package/dist/{index-DLQ4Rcuc.d.ts → index-BnrhTsp7.d.ts} +1 -1
  88. package/dist/{index-Hnz5VyMR.d.ts → index-CdF7L5E0.d.ts} +1 -1
  89. package/dist/{index-GPDn_EGI.d.mts → index-D6HQmsVV.d.mts} +1 -1
  90. package/dist/{index-DIRzR5IS.d.mts → index-zD5AaJsO.d.mts} +1 -1
  91. package/dist/index.d.mts +10 -10
  92. package/dist/index.d.ts +10 -10
  93. package/dist/index.js +8 -3
  94. package/dist/index.js.map +1 -1
  95. package/dist/index.mjs +8 -3
  96. package/dist/index.mjs.map +1 -1
  97. package/dist/local-evaluator/evaluator.d.mts +2 -2
  98. package/dist/local-evaluator/evaluator.d.ts +2 -2
  99. package/dist/{mcp-DPpu4xQz.d.ts → mcp-BuKgYZsC.d.ts} +1 -1
  100. package/dist/{mcp-Dju_Sr1o.d.mts → mcp-DDcGHRjo.d.mts} +1 -1
  101. package/dist/{nextjs-rZKzY_8o.d.ts → nextjs-CX9X9okw.d.ts} +1 -1
  102. package/dist/{nextjs-BuoDBN4g.d.mts → nextjs-w60J62Wj.d.mts} +1 -1
  103. package/dist/registration/index.js +1 -1
  104. package/dist/registration/index.js.map +1 -1
  105. package/dist/registration/index.mjs +1 -1
  106. package/dist/registration/index.mjs.map +1 -1
  107. package/dist/{sdk-CdO6TIEf.d.mts → sdk-DbY7-3PJ.d.mts} +1 -1
  108. package/dist/{sdk-DxHuIJBm.d.ts → sdk-uzuKDTRU.d.ts} +1 -1
  109. package/dist/transport/index.d.mts +2 -2
  110. package/dist/transport/index.d.ts +2 -2
  111. package/dist/transport/index.js +1 -1
  112. package/dist/transport/index.js.map +1 -1
  113. package/dist/transport/index.mjs +1 -1
  114. package/dist/transport/index.mjs.map +1 -1
  115. package/dist/{types-CoDjpbVY.d.mts → types-1urxLCZv.d.mts} +1 -1
  116. package/dist/{types-3UV7IZx7.d.ts → types-C1s1z0VD.d.ts} +1 -1
  117. package/dist/{types-CNBaZKxY.d.ts → types-CA1ZhoaJ.d.ts} +51 -0
  118. package/dist/{types-CSHcByFX.d.mts → types-eSqHyFFH.d.mts} +51 -0
  119. package/dist/ui/index.d.mts +1 -1
  120. package/dist/ui/index.d.ts +1 -1
  121. package/dist/verify.d.mts +1 -1
  122. package/dist/verify.d.ts +1 -1
  123. package/dist/verify.js +8 -3
  124. package/dist/verify.js.map +1 -1
  125. package/dist/verify.mjs +8 -3
  126. package/dist/verify.mjs.map +1 -1
  127. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { i as CounterpartyType, T as TokenGuidance } from './types-CSHcByFX.mjs';
1
+ import { i as CounterpartyType, T as TokenGuidance } from './types-eSqHyFFH.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -1,4 +1,4 @@
1
- import { i as CounterpartyType, T as TokenGuidance } from './types-CNBaZKxY.js';
1
+ import { i as CounterpartyType, T as TokenGuidance } from './types-CA1ZhoaJ.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -471,11 +471,34 @@ interface VerificationResult {
471
471
  stepUpOutcome?: StepUpOutcome;
472
472
  /** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
473
473
  settlement?: SettlementArtifact;
474
+ /**
475
+ * 5.3.0 (astra-pay): sanitized first-party settlement outcome. Present
476
+ * INSTEAD of `settlement` when the counterparty is an AstraSync-operated
477
+ * storefront and the request carried `commercePhase: 'confirm'` — the
478
+ * backend redeemed the voucher and executed the charge server-side
479
+ * (charge-at-redeem), so there is no artifact to deliver, only the result.
480
+ * `no_instrument` = policy passed but the owner has no chargeable
481
+ * instrument on file (steer the user to add one via onboarding).
482
+ */
483
+ settlementOutcome?: SettlementOutcomeInfo;
474
484
  /** Timestamp of verification */
475
485
  verifiedAt: Date;
476
486
  /** TTL for this result (seconds) */
477
487
  cacheTtl?: number;
478
488
  }
489
+ /**
490
+ * 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
491
+ * settlement. Carries NO voucher/instrument material — the settlement channel
492
+ * stays merchant-only; this is the result the agent plane is allowed to see.
493
+ */
494
+ interface SettlementOutcomeInfo {
495
+ status: 'settled' | 'failed' | 'requires_action' | 'no_instrument';
496
+ /** First-party order id — the buyer sees the purchase in their AstraSync
497
+ * dashboard orders view (no public receipt page). */
498
+ orderId?: string;
499
+ /** Decline/failure taxonomy code (card_declined, insufficient_funds, …). */
500
+ failureCode?: string;
501
+ }
479
502
  /**
480
503
  * Request context for verification
481
504
  */
@@ -531,6 +554,34 @@ interface VerificationRequest {
531
554
  transactionValue?: number;
532
555
  /** ISO-4217 currency code for transactionValue (e.g. 'USD', 'AUD', 'ETH'). Falls back to 'USD' server-side when unset. */
533
556
  currency?: string;
557
+ /**
558
+ * 5.3.0 (astra-pay): checkout-leg discriminator. `'confirm'` marks the
559
+ * completing call of a checkout; first-party settlement (charge-at-redeem
560
+ * on the owner's saved instrument) fires ONLY on this leg. Quote/browse
561
+ * legs omit it (or send `'quote'`) — they must never move money.
562
+ */
563
+ commercePhase?: 'quote' | 'confirm';
564
+ /**
565
+ * 5.3.0 (astra-pay): per-cart idempotency key (the checkout session id),
566
+ * forwarded on the confirm leg. Two concurrent confirms carrying the same
567
+ * key charge the owner's card at most once. Omit for raw one-shot confirms.
568
+ */
569
+ checkoutSessionId?: string;
570
+ /**
571
+ * 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
572
+ * the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
573
+ * email). Informational — never the money authority (that remains
574
+ * `transactionValue` bound into the settlement voucher).
575
+ */
576
+ checkoutItems?: Array<{
577
+ sku: string;
578
+ quantity: number;
579
+ title?: string;
580
+ unitPrice?: {
581
+ amount: string;
582
+ currency: string;
583
+ };
584
+ }>;
534
585
  /** Whether this is a sub-agent request */
535
586
  isSubAgentRequest?: boolean;
536
587
  /** Parent agent ID for sub-agent requests */
@@ -471,11 +471,34 @@ interface VerificationResult {
471
471
  stepUpOutcome?: StepUpOutcome;
472
472
  /** Settlement voucher (present on clean merchant-mediated grants with a verified wallet). */
473
473
  settlement?: SettlementArtifact;
474
+ /**
475
+ * 5.3.0 (astra-pay): sanitized first-party settlement outcome. Present
476
+ * INSTEAD of `settlement` when the counterparty is an AstraSync-operated
477
+ * storefront and the request carried `commercePhase: 'confirm'` — the
478
+ * backend redeemed the voucher and executed the charge server-side
479
+ * (charge-at-redeem), so there is no artifact to deliver, only the result.
480
+ * `no_instrument` = policy passed but the owner has no chargeable
481
+ * instrument on file (steer the user to add one via onboarding).
482
+ */
483
+ settlementOutcome?: SettlementOutcomeInfo;
474
484
  /** Timestamp of verification */
475
485
  verifiedAt: Date;
476
486
  /** TTL for this result (seconds) */
477
487
  cacheTtl?: number;
478
488
  }
489
+ /**
490
+ * 5.3.0 (astra-pay): sanitized outcome of first-party charge-at-redeem
491
+ * settlement. Carries NO voucher/instrument material — the settlement channel
492
+ * stays merchant-only; this is the result the agent plane is allowed to see.
493
+ */
494
+ interface SettlementOutcomeInfo {
495
+ status: 'settled' | 'failed' | 'requires_action' | 'no_instrument';
496
+ /** First-party order id — the buyer sees the purchase in their AstraSync
497
+ * dashboard orders view (no public receipt page). */
498
+ orderId?: string;
499
+ /** Decline/failure taxonomy code (card_declined, insufficient_funds, …). */
500
+ failureCode?: string;
501
+ }
479
502
  /**
480
503
  * Request context for verification
481
504
  */
@@ -531,6 +554,34 @@ interface VerificationRequest {
531
554
  transactionValue?: number;
532
555
  /** ISO-4217 currency code for transactionValue (e.g. 'USD', 'AUD', 'ETH'). Falls back to 'USD' server-side when unset. */
533
556
  currency?: string;
557
+ /**
558
+ * 5.3.0 (astra-pay): checkout-leg discriminator. `'confirm'` marks the
559
+ * completing call of a checkout; first-party settlement (charge-at-redeem
560
+ * on the owner's saved instrument) fires ONLY on this leg. Quote/browse
561
+ * legs omit it (or send `'quote'`) — they must never move money.
562
+ */
563
+ commercePhase?: 'quote' | 'confirm';
564
+ /**
565
+ * 5.3.0 (astra-pay): per-cart idempotency key (the checkout session id),
566
+ * forwarded on the confirm leg. Two concurrent confirms carrying the same
567
+ * key charge the owner's card at most once. Omit for raw one-shot confirms.
568
+ */
569
+ checkoutSessionId?: string;
570
+ /**
571
+ * 5.3.0 (astra-pay): the checkout's authoritative line items, forwarded on
572
+ * the confirm leg for the ORDER plane (receipts + digital-goods fulfillment
573
+ * email). Informational — never the money authority (that remains
574
+ * `transactionValue` bound into the settlement voucher).
575
+ */
576
+ checkoutItems?: Array<{
577
+ sku: string;
578
+ quantity: number;
579
+ title?: string;
580
+ unitPrice?: {
581
+ amount: string;
582
+ currency: string;
583
+ };
584
+ }>;
534
585
  /** Whether this is a sub-agent request */
535
586
  isSubAgentRequest?: boolean;
536
587
  /** Parent agent ID for sub-agent requests */
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-CSHcByFX.mjs';
1
+ import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-eSqHyFFH.mjs';
2
2
  import '../metadata-capture.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-CNBaZKxY.js';
1
+ import { V as VerificationInterstitialProps, w as VerificationResult, a as AgentCredentials, k as GuidanceInfo, u as TrustLevel } from '../types-CA1ZhoaJ.js';
2
2
  import '../metadata-capture.js';
3
3
 
4
4
  /**
package/dist/verify.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as AgentCredentials, G as GatewayConfig, d as AttemptReport, v as VerificationRequest, w as VerificationResult } from './types-CSHcByFX.mjs';
1
+ import { a as AgentCredentials, G as GatewayConfig, d as AttemptReport, v as VerificationRequest, w as VerificationResult } from './types-eSqHyFFH.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, d as AttemptReport, v as VerificationRequest, w as VerificationResult } from './types-CNBaZKxY.js';
1
+ import { a as AgentCredentials, G as GatewayConfig, d as AttemptReport, v as VerificationRequest, w as VerificationResult } from './types-CA1ZhoaJ.js';
2
2
  import { ObservedMetadata } from './metadata-capture.js';
3
3
 
4
4
  /**
package/dist/verify.js CHANGED
@@ -36,7 +36,7 @@ __export(verify_exports, {
36
36
  module.exports = __toCommonJS(verify_exports);
37
37
 
38
38
  // src/version.ts
39
- var SDK_VERSION = "5.2.0";
39
+ var SDK_VERSION = "5.3.0";
40
40
 
41
41
  // src/http.ts
42
42
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -348,6 +348,9 @@ async function callVerifyAccessAPI(config, request) {
348
348
  if (requestData.runtimeChallengeOptions)
349
349
  body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
350
350
  if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
351
+ if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
352
+ if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
353
+ if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
351
354
  if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
352
355
  if (requestData.attemptId) body.attemptId = requestData.attemptId;
353
356
  if (requestData.considerationSet) body.considerationSet = requestData.considerationSet;
@@ -519,7 +522,8 @@ async function verify(config, request, options) {
519
522
  recommendation: apiResponse.recommendation,
520
523
  recommendationReasons: apiResponse.recommendationReasons,
521
524
  stepUpApproval: apiResponse.stepUpApproval,
522
- settlement: apiResponse.settlement
525
+ settlement: apiResponse.settlement,
526
+ settlementOutcome: apiResponse.settlementOutcome
523
527
  };
524
528
  return result2;
525
529
  }
@@ -576,7 +580,8 @@ async function verify(config, request, options) {
576
580
  recommendationReasons: apiResponse.recommendationReasons,
577
581
  warningHeader: apiResponse.warningHeader,
578
582
  stepUpApproval: apiResponse.stepUpApproval,
579
- settlement: apiResponse.settlement
583
+ settlement: apiResponse.settlement,
584
+ settlementOutcome: apiResponse.settlementOutcome
580
585
  };
581
586
  if (result.recommendation === "deny") {
582
587
  result.policyAllowed = false;