@astrasyncai/verification-gateway 5.13.0 → 5.14.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 (73) hide show
  1. package/dist/adapters/express.js +28 -10
  2. package/dist/adapters/express.js.map +1 -1
  3. package/dist/adapters/express.mjs +28 -10
  4. package/dist/adapters/express.mjs.map +1 -1
  5. package/dist/adapters/mcp.js +1 -1
  6. package/dist/adapters/mcp.js.map +1 -1
  7. package/dist/adapters/mcp.mjs +1 -1
  8. package/dist/adapters/mcp.mjs.map +1 -1
  9. package/dist/adapters/nextjs.js +28 -10
  10. package/dist/adapters/nextjs.js.map +1 -1
  11. package/dist/adapters/nextjs.mjs +28 -10
  12. package/dist/adapters/nextjs.mjs.map +1 -1
  13. package/dist/adapters/sdk.js +1 -1
  14. package/dist/adapters/sdk.js.map +1 -1
  15. package/dist/adapters/sdk.mjs +1 -1
  16. package/dist/adapters/sdk.mjs.map +1 -1
  17. package/dist/agent/index.js +1 -1
  18. package/dist/agent/index.js.map +1 -1
  19. package/dist/agent/index.mjs +1 -1
  20. package/dist/agent/index.mjs.map +1 -1
  21. package/dist/bin/astrasync-claude-hook.js +28 -10
  22. package/dist/bin/astrasync-codex-hook.js +28 -10
  23. package/dist/bin/astrasync-guard.js +28 -10
  24. package/dist/bin/astrasync.js +29 -11
  25. package/dist/browser/background.js +28 -10
  26. package/dist/browser/background.js.map +1 -1
  27. package/dist/browser/background.mjs +28 -10
  28. package/dist/browser/background.mjs.map +1 -1
  29. package/dist/cli/index.js +1 -1
  30. package/dist/cli/index.js.map +1 -1
  31. package/dist/cli/index.mjs +1 -1
  32. package/dist/cli/index.mjs.map +1 -1
  33. package/dist/codex/index.js +28 -10
  34. package/dist/codex/index.js.map +1 -1
  35. package/dist/codex/index.mjs +28 -10
  36. package/dist/codex/index.mjs.map +1 -1
  37. package/dist/cursor/extension.js +28 -10
  38. package/dist/cursor/extension.js.map +1 -1
  39. package/dist/cursor/extension.mjs +28 -10
  40. package/dist/cursor/extension.mjs.map +1 -1
  41. package/dist/edge-config.js +1 -1
  42. package/dist/edge-config.js.map +1 -1
  43. package/dist/edge-config.mjs +1 -1
  44. package/dist/edge-config.mjs.map +1 -1
  45. package/dist/edge-core/index.d.mts +32 -4
  46. package/dist/edge-core/index.d.ts +32 -4
  47. package/dist/edge-core/index.js +28 -10
  48. package/dist/edge-core/index.js.map +1 -1
  49. package/dist/edge-core/index.mjs +28 -10
  50. package/dist/edge-core/index.mjs.map +1 -1
  51. package/dist/gateway/gateway.js +28 -10
  52. package/dist/gateway/gateway.js.map +1 -1
  53. package/dist/gateway/gateway.mjs +28 -10
  54. package/dist/gateway/gateway.mjs.map +1 -1
  55. package/dist/index.d.mts +2 -2
  56. package/dist/index.d.ts +2 -2
  57. package/dist/index.js +28 -10
  58. package/dist/index.js.map +1 -1
  59. package/dist/index.mjs +28 -10
  60. package/dist/index.mjs.map +1 -1
  61. package/dist/registration/index.js +1 -1
  62. package/dist/registration/index.js.map +1 -1
  63. package/dist/registration/index.mjs +1 -1
  64. package/dist/registration/index.mjs.map +1 -1
  65. package/dist/transport/index.js +1 -1
  66. package/dist/transport/index.js.map +1 -1
  67. package/dist/transport/index.mjs +1 -1
  68. package/dist/transport/index.mjs.map +1 -1
  69. package/dist/verify.js +1 -1
  70. package/dist/verify.js.map +1 -1
  71. package/dist/verify.mjs +1 -1
  72. package/dist/verify.mjs.map +1 -1
  73. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -4935,7 +4935,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
4935
4935
  * silently (never throwing), so this is a no-op there — which is correct:
4936
4936
  * in a browser the page's real UA is the honest identity.
4937
4937
  */
4938
- declare const SDK_USER_AGENT = "astrasync-sdk/5.13.0";
4938
+ declare const SDK_USER_AGENT = "astrasync-sdk/5.14.0";
4939
4939
  declare const sdkFetch: typeof fetch;
4940
4940
 
4941
4941
  interface LocalPolicy {
@@ -5053,6 +5053,6 @@ declare function parseYaml(yamlContent: string): ParseResult;
5053
5053
  * is fine — bumping both in the release-ceremony commit keeps them
5054
5054
  * lockstep.
5055
5055
  */
5056
- declare const SDK_VERSION = "5.13.0";
5056
+ declare const SDK_VERSION = "5.14.0";
5057
5057
 
5058
5058
  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, DECLARED_SOURCE_MAX, 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, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, 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 ReportAttemptOptions, 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, VERIFICATION_STATUS_HEADER, 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, buildVerificationUnavailableBody, clearCache, createMcpMiddleware, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, express, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, hasCredentials, isEdgeConfig, isRejectedIdentityClaim, isVerificationUnavailable, isVerifiedHopValidFor, matchEdgePathRule, matchPlatformSignature, nextjs, normalizeDeclaredSource, parseYaml as parseLocalPolicyYaml, parseVerifiedHop, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, sanitizeHeaders, sdk, sdkFetch, serializeVerifiedHop, setMcpMeta, index$1 as transport, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify };
package/dist/index.d.ts CHANGED
@@ -4935,7 +4935,7 @@ declare function detectRuntime(userAgent: string | undefined | null): string | u
4935
4935
  * silently (never throwing), so this is a no-op there — which is correct:
4936
4936
  * in a browser the page's real UA is the honest identity.
4937
4937
  */
4938
- declare const SDK_USER_AGENT = "astrasync-sdk/5.13.0";
4938
+ declare const SDK_USER_AGENT = "astrasync-sdk/5.14.0";
4939
4939
  declare const sdkFetch: typeof fetch;
4940
4940
 
4941
4941
  interface LocalPolicy {
@@ -5053,6 +5053,6 @@ declare function parseYaml(yamlContent: string): ParseResult;
5053
5053
  * is fine — bumping both in the release-ceremony commit keeps them
5054
5054
  * lockstep.
5055
5055
  */
5056
- declare const SDK_VERSION = "5.13.0";
5056
+ declare const SDK_VERSION = "5.14.0";
5057
5057
 
5058
5058
  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, DECLARED_SOURCE_MAX, 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, type ParseResult as LocalPolicyParseResult, type ValidationError as LocalPolicyValidationError, type ValidationResult as LocalPolicyValidationResult, 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 ReportAttemptOptions, 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, VERIFICATION_STATUS_HEADER, 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, buildVerificationUnavailableBody, clearCache, createMcpMiddleware, degradeToObserve, denyStatusFor, deriveConnectionFromHeaders, detectPlatformFingerprint, detectRuntime, express, extractApiKeyFormat, extractCredentials, extractMcpCredentials, extractPlatformHeaders, fetchEdgeConfig, fetchRoutes, getCachedWellKnownUrls, getEdgeConfig, getTrustLevel, getWellKnownUrls, hasCredentials, isEdgeConfig, isRejectedIdentityClaim, isVerificationUnavailable, isVerifiedHopValidFor, matchEdgePathRule, matchPlatformSignature, nextjs, normalizeDeclaredSource, parseYaml as parseLocalPolicyYaml, parseVerifiedHop, pollStepUpStatus, prefetchWellKnown, quickVerify, recordDecision, reportAttempt, reportUnregisteredAttempt, sanitizeHeaders, sdk, sdkFetch, serializeVerifiedHop, setMcpMeta, index$1 as transport, unavailableRetryAfterSeconds, validatePolicy as validateLocalPolicy, verify };
package/dist/index.js CHANGED
@@ -122,7 +122,7 @@ function getTrustLevel(score) {
122
122
  }
123
123
 
124
124
  // src/version.ts
125
- var SDK_VERSION = "5.13.0";
125
+ var SDK_VERSION = "5.14.0";
126
126
 
127
127
  // src/http.ts
128
128
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -1917,6 +1917,11 @@ async function withBudget(promise, ms) {
1917
1917
  if (timer) clearTimeout(timer);
1918
1918
  }
1919
1919
  }
1920
+ var CONTAINER_ID = (() => {
1921
+ const c = globalThis.crypto;
1922
+ if (c?.randomUUID) return c.randomUUID();
1923
+ return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
1924
+ })();
1920
1925
  var destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
1921
1926
  var BeaconBuffer = class {
1922
1927
  constructor(options = {}) {
@@ -1924,6 +1929,7 @@ var BeaconBuffer = class {
1924
1929
  this.droppedSinceLast = 0;
1925
1930
  this.droppedTotal = 0;
1926
1931
  this.deliveredTotal = 0;
1932
+ this.enqueuedTotal = 0;
1927
1933
  this.backoffUntil = 0;
1928
1934
  this.collapse = /* @__PURE__ */ new Map();
1929
1935
  /** Keys the backend answered 401 for — later batches go unauthenticated. */
@@ -1936,13 +1942,16 @@ var BeaconBuffer = class {
1936
1942
  collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
1937
1943
  requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
1938
1944
  retryBackoffMs: options.retryBackoffMs ?? 1e3,
1945
+ holdRepeats: options.holdRepeats ?? false,
1946
+ containerId: options.containerId ?? CONTAINER_ID,
1939
1947
  now: options.now ?? Date.now
1940
1948
  };
1941
1949
  }
1942
1950
  /**
1943
1951
  * Queue one beacon. With a `collapseKey`, a repeat inside the window is
1944
- * merged into a held aggregate (sent when the window closes) instead of
1945
- * becoming its own item.
1952
+ * merged into this key's item while that item is still queued (not yet in
1953
+ * flight). Once it has left, the repeat becomes a new item, sendable on
1954
+ * this flush — nothing waits for a later invocation (round 27.6).
1946
1955
  */
1947
1956
  enqueue(dest, item, collapseKey) {
1948
1957
  const now = this.opts.now();
@@ -1955,12 +1964,15 @@ var BeaconBuffer = class {
1955
1964
  return;
1956
1965
  }
1957
1966
  }
1958
- const held = this.push(
1959
- dest,
1960
- { ...item, repeatCount: 1 },
1961
- entry.firstSeenAt + this.opts.collapseWindowMs
1962
- );
1963
- entry.held = held;
1967
+ if (this.opts.holdRepeats) {
1968
+ entry.held = this.push(
1969
+ dest,
1970
+ { ...item, repeatCount: 1 },
1971
+ entry.firstSeenAt + this.opts.collapseWindowMs
1972
+ );
1973
+ return;
1974
+ }
1975
+ entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
1964
1976
  return;
1965
1977
  }
1966
1978
  this.collapse.delete(collapseKey);
@@ -1996,6 +2008,7 @@ var BeaconBuffer = class {
1996
2008
  droppedSinceLast: this.droppedSinceLast,
1997
2009
  droppedTotal: this.droppedTotal,
1998
2010
  deliveredTotal: this.deliveredTotal,
2011
+ enqueuedTotal: this.enqueuedTotal,
1999
2012
  flushing: this.inFlight !== void 0
2000
2013
  };
2001
2014
  }
@@ -2010,6 +2023,7 @@ var BeaconBuffer = class {
2010
2023
  inFlight: false
2011
2024
  };
2012
2025
  this.queue.push(entry);
2026
+ this.enqueuedTotal += 1;
2013
2027
  return entry;
2014
2028
  }
2015
2029
  dropOldest() {
@@ -2055,7 +2069,11 @@ var BeaconBuffer = class {
2055
2069
  droppedSinceLast: reportedDropped,
2056
2070
  queueDepth: this.queue.length,
2057
2071
  adapter: dest.adapter ?? "edge-core",
2058
- version: SDK_VERSION
2072
+ version: SDK_VERSION,
2073
+ containerId: this.opts.containerId,
2074
+ enqueuedTotal: this.enqueuedTotal,
2075
+ deliveredTotal: this.deliveredTotal,
2076
+ droppedTotal: this.droppedTotal
2059
2077
  };
2060
2078
  const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
2061
2079
  const response = await withBudget(