@astrasyncai/verification-gateway 5.7.0 → 5.8.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 (72) hide show
  1. package/README.md +36 -0
  2. package/dist/adapters/express.js +4 -1
  3. package/dist/adapters/express.js.map +1 -1
  4. package/dist/adapters/express.mjs +4 -1
  5. package/dist/adapters/express.mjs.map +1 -1
  6. package/dist/adapters/mcp.js +1 -1
  7. package/dist/adapters/mcp.js.map +1 -1
  8. package/dist/adapters/mcp.mjs +1 -1
  9. package/dist/adapters/mcp.mjs.map +1 -1
  10. package/dist/adapters/nextjs.js +4 -1
  11. package/dist/adapters/nextjs.js.map +1 -1
  12. package/dist/adapters/nextjs.mjs +4 -1
  13. package/dist/adapters/nextjs.mjs.map +1 -1
  14. package/dist/adapters/sdk.js +1 -1
  15. package/dist/adapters/sdk.js.map +1 -1
  16. package/dist/adapters/sdk.mjs +1 -1
  17. package/dist/adapters/sdk.mjs.map +1 -1
  18. package/dist/agent/index.js +1 -1
  19. package/dist/agent/index.js.map +1 -1
  20. package/dist/agent/index.mjs +1 -1
  21. package/dist/agent/index.mjs.map +1 -1
  22. package/dist/bin/astrasync-claude-hook.js +1 -1
  23. package/dist/bin/astrasync-codex-hook.js +1 -1
  24. package/dist/bin/astrasync-guard.js +1 -1
  25. package/dist/bin/astrasync.js +1 -1
  26. package/dist/browser/background.js +1 -1
  27. package/dist/browser/background.js.map +1 -1
  28. package/dist/browser/background.mjs +1 -1
  29. package/dist/browser/background.mjs.map +1 -1
  30. package/dist/cli/index.js +1 -1
  31. package/dist/cli/index.js.map +1 -1
  32. package/dist/cli/index.mjs +1 -1
  33. package/dist/cli/index.mjs.map +1 -1
  34. package/dist/codex/index.js +1 -1
  35. package/dist/codex/index.js.map +1 -1
  36. package/dist/codex/index.mjs +1 -1
  37. package/dist/codex/index.mjs.map +1 -1
  38. package/dist/cursor/extension.js +1 -1
  39. package/dist/cursor/extension.js.map +1 -1
  40. package/dist/cursor/extension.mjs +1 -1
  41. package/dist/cursor/extension.mjs.map +1 -1
  42. package/dist/edge-config.js +1 -1
  43. package/dist/edge-config.js.map +1 -1
  44. package/dist/edge-config.mjs +1 -1
  45. package/dist/edge-config.mjs.map +1 -1
  46. package/dist/edge-core/index.js +1 -1
  47. package/dist/edge-core/index.js.map +1 -1
  48. package/dist/edge-core/index.mjs +1 -1
  49. package/dist/edge-core/index.mjs.map +1 -1
  50. package/dist/gateway/gateway.js +1 -1
  51. package/dist/gateway/gateway.js.map +1 -1
  52. package/dist/gateway/gateway.mjs +1 -1
  53. package/dist/gateway/gateway.mjs.map +1 -1
  54. package/dist/index.d.mts +9 -2
  55. package/dist/index.d.ts +9 -2
  56. package/dist/index.js +7 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/index.mjs +7 -1
  59. package/dist/index.mjs.map +1 -1
  60. package/dist/registration/index.js +1 -1
  61. package/dist/registration/index.js.map +1 -1
  62. package/dist/registration/index.mjs +1 -1
  63. package/dist/registration/index.mjs.map +1 -1
  64. package/dist/transport/index.js +1 -1
  65. package/dist/transport/index.js.map +1 -1
  66. package/dist/transport/index.mjs +1 -1
  67. package/dist/transport/index.mjs.map +1 -1
  68. package/dist/verify.js +1 -1
  69. package/dist/verify.js.map +1 -1
  70. package/dist/verify.mjs +1 -1
  71. package/dist/verify.mjs.map +1 -1
  72. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -1071,6 +1071,13 @@ interface RouteAccessConfig {
1071
1071
  allowedJurisdictions?: string[];
1072
1072
  /** Maximum transaction value for this route */
1073
1073
  maxTransactionValue?: number;
1074
+ /**
1075
+ * Venue-declared response budget for this route in ms (5.8.0). Consumed by
1076
+ * the AstraSync bridge, which waits this long before timing out a call it
1077
+ * delivers to the venue (clamped bridge-side to a 60s ceiling; 30s default
1078
+ * when unset). Declare it when a route's in-band holds outlive 30s.
1079
+ */
1080
+ responseBudgetMs?: number;
1074
1081
  /**
1075
1082
  * Backend-evaluator strict mode: when true AND
1076
1083
  * `allowedPurposes` is non-empty, verify-access denies requests arriving
@@ -4758,7 +4765,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
4758
4765
  * silently (never throwing), so this is a no-op there — which is correct:
4759
4766
  * in a browser the page's real UA is the honest identity.
4760
4767
  */
4761
- declare const SDK_USER_AGENT = "astrasync-sdk/5.7.0";
4768
+ declare const SDK_USER_AGENT = "astrasync-sdk/5.8.0";
4762
4769
  declare const sdkFetch: typeof fetch;
4763
4770
 
4764
4771
  /**
@@ -4779,6 +4786,6 @@ declare const sdkFetch: typeof fetch;
4779
4786
  * is fine — bumping both in the release-ceremony commit keeps them
4780
4787
  * lockstep.
4781
4788
  */
4782
- declare const SDK_VERSION = "5.7.0";
4789
+ declare const SDK_VERSION = "5.8.0";
4783
4790
 
4784
4791
  export { AgentClient, type AgentCredentials, type AgentProtocol, type AgentRecord, AstraSync, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DEFAULT_EDGE_CONFIG, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EnhancedVerificationResult, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HealthResponse, KYDRequiredError, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, type MerchantSettlementToken, type ModelConfig, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type ProtocolTransport, RUNTIME_SIGNATURES, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type RouteAccessConfig, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, type SettlementRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, _resetEdgeConfigCache, index as agent, authorizeSettlement, awaitStepUpApproval, buildGuidance, buildSdkObservedMetadata, clearCache, createMcpMiddleware, degradeToObserve, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, express, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, hasCredentials, isEdgeConfig, isVerifiedHopValidFor, matchEdgePathRule, matchPlatformSignature, nextjs, parseVerifiedHop, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, sanitizeHeaders, sdk, sdkFetch, serializeVerifiedHop, setMcpMeta, index$1 as transport, verify };
package/dist/index.d.ts CHANGED
@@ -1071,6 +1071,13 @@ interface RouteAccessConfig {
1071
1071
  allowedJurisdictions?: string[];
1072
1072
  /** Maximum transaction value for this route */
1073
1073
  maxTransactionValue?: number;
1074
+ /**
1075
+ * Venue-declared response budget for this route in ms (5.8.0). Consumed by
1076
+ * the AstraSync bridge, which waits this long before timing out a call it
1077
+ * delivers to the venue (clamped bridge-side to a 60s ceiling; 30s default
1078
+ * when unset). Declare it when a route's in-band holds outlive 30s.
1079
+ */
1080
+ responseBudgetMs?: number;
1074
1081
  /**
1075
1082
  * Backend-evaluator strict mode: when true AND
1076
1083
  * `allowedPurposes` is non-empty, verify-access denies requests arriving
@@ -4758,7 +4765,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
4758
4765
  * silently (never throwing), so this is a no-op there — which is correct:
4759
4766
  * in a browser the page's real UA is the honest identity.
4760
4767
  */
4761
- declare const SDK_USER_AGENT = "astrasync-sdk/5.7.0";
4768
+ declare const SDK_USER_AGENT = "astrasync-sdk/5.8.0";
4762
4769
  declare const sdkFetch: typeof fetch;
4763
4770
 
4764
4771
  /**
@@ -4779,6 +4786,6 @@ declare const sdkFetch: typeof fetch;
4779
4786
  * is fine — bumping both in the release-ceremony commit keeps them
4780
4787
  * lockstep.
4781
4788
  */
4782
- declare const SDK_VERSION = "5.7.0";
4789
+ declare const SDK_VERSION = "5.8.0";
4783
4790
 
4784
4791
  export { AgentClient, type AgentCredentials, type AgentProtocol, type AgentRecord, AstraSync, type AstraSyncConfig, type AstraSyncCredentials, AstraSyncError, type AttemptOutcome, type AttemptReport, AuthenticationError, type BuildGuidanceParams, CAPTURE_SCHEMA_VERSION, type CallerMetadata, ChallengeHandler, type CommerceArtifactsPayload, type CommerceContext, type CommercePipelineInput, type CommerceShieldProps, type ConsiderationItem, type ConsiderationSet, type CounterpartyType, DEFAULT_EDGE_CONFIG, type DynamicPlatformFingerprint, type EdgeConfig, type EdgeMode, type EdgePathRule, type EdgeVerificationDepth, type EnhancedVerificationResult, type ExpressMiddlewareOptions, type FetchEdgeConfigResult, type FetchEdgeConfigSuccess, type FiatSettlementBinding, type FrameworkConfig, type FulfilmentInfo, type GatewayConfig, type GuidanceEnvelope, type GuidanceInfo, type HealthResponse, KYDRequiredError, MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, MCP_VERIFIED_HOP_HEADER, MCP_VERIFIED_HOP_MAX_AGE_MS, type McpMiddlewareOptions, type MerchantSettlementToken, type ModelConfig, type NextJsMiddlewareOptions, type ObservedMetadata, type PDLSSConfig$1 as PDLSSConfig, type PDLSSDuration, type PDLSSInfo, type PDLSSLimits, type PDLSSPurpose, type PDLSSScope, type PDLSSSelfInstantiation, PLATFORM_AGENT_SIGNATURES, type PendingRegistrationResponse, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, type PollRegistrationResult, type ProtocolTransport, RUNTIME_SIGNATURES, type RegisterOptions, type RegisterResult, RegistrationDeniedError, RegistrationExpiredError, type RegistrationResponse, RegistrationTimeoutError, type RouteAccessConfig, type RuntimeChallengeResult, type RuntimeSignature, type SDKOptions, SDK_USER_AGENT, type SanitizeHeadersResult, type SettlementArtifact, type SettlementArtifactBinding, type SettlementArtifactBindingBase, type SettlementDecision, type SettlementOutcomeInfo, type SettlementRequest, type StablecoinSettlementBinding, type StepUpApprovalInfo, type StepUpApprovalStatus, type StepUpOutcome, TRUST_LEVEL_RANGES, type TokenGuidance, type ToolGate, type ToolGateConfig, type TrustLevel, SDK_VERSION as VERSION, type VerificationInterstitialProps, type VerificationRequest, type VerificationResult, type VerifiedAgent, type VerifiedDeveloper, type VerifiedHopMarker, type VerifiedOrganization, type VerifyOptions, type VerifyResponse, type WaitForApprovalOptions, type WellKnownAgenticCommerce, _resetEdgeConfigCache, index as agent, authorizeSettlement, awaitStepUpApproval, buildGuidance, buildSdkObservedMetadata, clearCache, createMcpMiddleware, degradeToObserve, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, express, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, hasCredentials, isEdgeConfig, isVerifiedHopValidFor, matchEdgePathRule, matchPlatformSignature, nextjs, parseVerifiedHop, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, sanitizeHeaders, sdk, sdkFetch, serializeVerifiedHop, setMcpMeta, index$1 as transport, verify };
package/dist/index.js CHANGED
@@ -112,7 +112,7 @@ function getTrustLevel(score) {
112
112
  }
113
113
 
114
114
  // src/version.ts
115
- var SDK_VERSION = "5.7.0";
115
+ var SDK_VERSION = "5.8.0";
116
116
 
117
117
  // src/http.ts
118
118
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -2052,6 +2052,8 @@ function createMiddleware(options) {
2052
2052
  }
2053
2053
  }
2054
2054
  }
2055
+ const attemptHeader = req.headers["x-astra-attempt-id"];
2056
+ const inboundAttemptId = typeof attemptHeader === "string" && /^att_[0-9a-f]{32}$/.test(attemptHeader) ? attemptHeader : void 0;
2055
2057
  const verificationRequest = {
2056
2058
  credentials,
2057
2059
  purpose,
@@ -2064,6 +2066,7 @@ function createMiddleware(options) {
2064
2066
  durationRequired: astraCreds?.pdlss?.duration?.maxSessionDuration,
2065
2067
  ...txValue !== void 0 && { transactionValue: txValue },
2066
2068
  ...txCurrency && { currency: txCurrency },
2069
+ ...inboundAttemptId && { attemptId: inboundAttemptId },
2067
2070
  callerMetadata: {
2068
2071
  sourceIp: originalClientIp,
2069
2072
  userAgent: req.headers["user-agent"],
@@ -2568,6 +2571,8 @@ function createMiddleware2(options) {
2568
2571
  }
2569
2572
  const forwardedFor = request.headers.get("x-forwarded-for") || void 0;
2570
2573
  const originalClientIp = forwardedFor?.split(",")[0]?.trim();
2574
+ const attemptHeader = request.headers.get("x-astra-attempt-id");
2575
+ const inboundAttemptId = attemptHeader && /^att_[0-9a-f]{32}$/.test(attemptHeader) ? attemptHeader : void 0;
2571
2576
  const verificationRequest = {
2572
2577
  credentials,
2573
2578
  purpose,
@@ -2577,6 +2582,7 @@ function createMiddleware2(options) {
2577
2582
  counterpartyType: config.counterpartyType || "website",
2578
2583
  enableRuntimeChallenge,
2579
2584
  durationRequired: astraCreds?.pdlss?.duration?.maxSessionDuration,
2585
+ ...inboundAttemptId && { attemptId: inboundAttemptId },
2580
2586
  callerMetadata: {
2581
2587
  sourceIp: originalClientIp,
2582
2588
  userAgent: request.headers.get("user-agent") || void 0,