@astrasyncai/verification-gateway 3.9.0 → 3.10.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 (108) hide show
  1. package/dist/adapter-interface/interface.d.mts +3 -2
  2. package/dist/adapter-interface/interface.d.ts +3 -2
  3. package/dist/adapters/express.d.mts +3 -2
  4. package/dist/adapters/express.d.ts +3 -2
  5. package/dist/adapters/express.js +151 -2
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +151 -2
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/mcp.d.mts +2 -1
  10. package/dist/adapters/mcp.d.ts +2 -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 +3 -2
  16. package/dist/adapters/nextjs.d.ts +3 -2
  17. package/dist/adapters/nextjs.js +151 -2
  18. package/dist/adapters/nextjs.js.map +1 -1
  19. package/dist/adapters/nextjs.mjs +151 -2
  20. package/dist/adapters/nextjs.mjs.map +1 -1
  21. package/dist/adapters/sdk.d.mts +3 -2
  22. package/dist/adapters/sdk.d.ts +3 -2
  23. package/dist/adapters/sdk.js +1 -1
  24. package/dist/adapters/sdk.js.map +1 -1
  25. package/dist/adapters/sdk.mjs +1 -1
  26. package/dist/adapters/sdk.mjs.map +1 -1
  27. package/dist/agent/index.d.mts +3 -2
  28. package/dist/agent/index.d.ts +3 -2
  29. package/dist/bin/astrasync-claude-hook.js +276 -25
  30. package/dist/bin/astrasync-guard.js +258 -23
  31. package/dist/bin/astrasync.js +282 -24
  32. package/dist/browser/background.js +257 -22
  33. package/dist/browser/background.js.map +1 -1
  34. package/dist/browser/background.mjs +257 -22
  35. package/dist/browser/background.mjs.map +1 -1
  36. package/dist/browser/browser-adapter.d.mts +3 -2
  37. package/dist/browser/browser-adapter.d.ts +3 -2
  38. package/dist/claude-code/claude-code-adapter.d.mts +3 -2
  39. package/dist/claude-code/claude-code-adapter.d.ts +3 -2
  40. package/dist/cli/index.d.mts +3 -2
  41. package/dist/cli/index.d.ts +3 -2
  42. package/dist/cursor/cursor-adapter.d.mts +3 -2
  43. package/dist/cursor/cursor-adapter.d.ts +3 -2
  44. package/dist/cursor/extension.d.mts +3 -2
  45. package/dist/cursor/extension.d.ts +3 -2
  46. package/dist/cursor/extension.js +257 -22
  47. package/dist/cursor/extension.js.map +1 -1
  48. package/dist/cursor/extension.mjs +257 -22
  49. package/dist/cursor/extension.mjs.map +1 -1
  50. package/dist/edge-config.d.mts +2 -1
  51. package/dist/edge-config.d.ts +2 -1
  52. package/dist/{express-sGXhDdd0.d.ts → express-ClNtDhhc.d.ts} +1 -1
  53. package/dist/{express-DXUyvv7t.d.mts → express-DCXa1oqj.d.mts} +1 -1
  54. package/dist/gateway/gateway.d.mts +29 -3
  55. package/dist/gateway/gateway.d.ts +29 -3
  56. package/dist/gateway/gateway.js +257 -22
  57. package/dist/gateway/gateway.js.map +1 -1
  58. package/dist/gateway/gateway.mjs +257 -22
  59. package/dist/gateway/gateway.mjs.map +1 -1
  60. package/dist/git-trigger/git-hooks.d.mts +3 -2
  61. package/dist/git-trigger/git-hooks.d.ts +3 -2
  62. package/dist/{index-Dalih3EB.d.mts → index-BrNKDmiR.d.mts} +1 -1
  63. package/dist/{index-C61VL_OW.d.ts → index-CfHurO1P.d.ts} +1 -1
  64. package/dist/{index-CMg-vjEK.d.ts → index-D2ztkumS.d.ts} +1 -1
  65. package/dist/{index-DmmdehNu.d.mts → index-Dr_XiN65.d.mts} +1 -1
  66. package/dist/index.d.mts +10 -9
  67. package/dist/index.d.ts +10 -9
  68. package/dist/index.js +218 -11
  69. package/dist/index.js.map +1 -1
  70. package/dist/index.mjs +211 -11
  71. package/dist/index.mjs.map +1 -1
  72. package/dist/local-evaluator/evaluator.d.mts +3 -2
  73. package/dist/local-evaluator/evaluator.d.ts +3 -2
  74. package/dist/local-evaluator/evaluator.js +165 -7
  75. package/dist/local-evaluator/evaluator.js.map +1 -1
  76. package/dist/local-evaluator/evaluator.mjs +165 -7
  77. package/dist/local-evaluator/evaluator.mjs.map +1 -1
  78. package/dist/metadata-capture.d.mts +87 -0
  79. package/dist/metadata-capture.d.ts +87 -0
  80. package/dist/metadata-capture.js +184 -0
  81. package/dist/metadata-capture.js.map +1 -0
  82. package/dist/metadata-capture.mjs +154 -0
  83. package/dist/metadata-capture.mjs.map +1 -0
  84. package/dist/{nextjs-DwUW-Nm1.d.ts → nextjs-CEBVBsdi.d.ts} +1 -1
  85. package/dist/{nextjs-F_2pbPIA.d.mts → nextjs-DcQIk6Zj.d.mts} +1 -1
  86. package/dist/platform-signatures.d.mts +60 -10
  87. package/dist/platform-signatures.d.ts +60 -10
  88. package/dist/platform-signatures.js +37 -10
  89. package/dist/platform-signatures.js.map +1 -1
  90. package/dist/platform-signatures.mjs +35 -9
  91. package/dist/platform-signatures.mjs.map +1 -1
  92. package/dist/{sdk-Clob2-0A.d.mts → sdk-CZkbSOeO.d.mts} +1 -1
  93. package/dist/{sdk-CfHANs4A.d.ts → sdk-H0JCLW2y.d.ts} +1 -1
  94. package/dist/transport/index.d.mts +3 -2
  95. package/dist/transport/index.d.ts +3 -2
  96. package/dist/{types-ACMsV07B.d.mts → types-9tns4wyl.d.ts} +12 -0
  97. package/dist/{types-DmSDgPpG.d.ts → types-BV6abBnF.d.mts} +7 -1
  98. package/dist/{types-BtqUvK8v.d.mts → types-C23_uaY8.d.ts} +7 -1
  99. package/dist/{types-ACMsV07B.d.ts → types-sy3tq8lp.d.mts} +12 -0
  100. package/dist/ui/index.d.mts +2 -1
  101. package/dist/ui/index.d.ts +2 -1
  102. package/dist/verify.d.mts +8 -1
  103. package/dist/verify.d.ts +8 -1
  104. package/dist/verify.js +1 -1
  105. package/dist/verify.js.map +1 -1
  106. package/dist/verify.mjs +1 -1
  107. package/dist/verify.mjs.map +1 -1
  108. package/package.json +6 -1
@@ -1,6 +1,7 @@
1
1
  import { AstraSyncGateway } from '../gateway/gateway.mjs';
2
- import { V as VerificationDecision, P as PDLSSContext } from '../types-BtqUvK8v.mjs';
3
- import '../types-ACMsV07B.mjs';
2
+ import { V as VerificationDecision, P as PDLSSContext } from '../types-BV6abBnF.mjs';
3
+ import '../types-sy3tq8lp.mjs';
4
+ import '../metadata-capture.mjs';
4
5
 
5
6
  /**
6
7
  * Git Trigger — Enterprise git push / PR verification
@@ -1,6 +1,7 @@
1
1
  import { AstraSyncGateway } from '../gateway/gateway.js';
2
- import { V as VerificationDecision, P as PDLSSContext } from '../types-DmSDgPpG.js';
3
- import '../types-ACMsV07B.js';
2
+ import { V as VerificationDecision, P as PDLSSContext } from '../types-C23_uaY8.js';
3
+ import '../types-9tns4wyl.js';
4
+ import '../metadata-capture.js';
4
5
 
5
6
  /**
6
7
  * Git Trigger — Enterprise git push / PR verification
@@ -1,4 +1,4 @@
1
- import { c as AstraSyncCredentials, h as ProtocolTransport } from './types-ACMsV07B.mjs';
1
+ import { c as AstraSyncCredentials, h as ProtocolTransport } from './types-sy3tq8lp.mjs';
2
2
  import { JWK } from 'jose';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as AstraSyncCredentials, h as ProtocolTransport, G as GatewayConfig } from './types-ACMsV07B.js';
1
+ import { c as AstraSyncCredentials, h as ProtocolTransport, G as GatewayConfig } from './types-9tns4wyl.js';
2
2
 
3
3
  /**
4
4
  * AgentClient — Credential Presentation
@@ -1,4 +1,4 @@
1
- import { c as AstraSyncCredentials, h as ProtocolTransport } from './types-ACMsV07B.js';
1
+ import { c as AstraSyncCredentials, h as ProtocolTransport } from './types-9tns4wyl.js';
2
2
  import { JWK } from 'jose';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { c as AstraSyncCredentials, h as ProtocolTransport, G as GatewayConfig } from './types-ACMsV07B.mjs';
1
+ import { c as AstraSyncCredentials, h as ProtocolTransport, G as GatewayConfig } from './types-sy3tq8lp.mjs';
2
2
 
3
3
  /**
4
4
  * AgentClient — Credential Presentation
package/dist/index.d.mts CHANGED
@@ -1,15 +1,16 @@
1
- import { G as GatewayConfig, n as StepUpApprovalInfo, p as StepUpOutcome, o as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-ACMsV07B.mjs';
2
- export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload, d as CommerceShieldProps, e as CounterpartyType, f as ExpressMiddlewareOptions, F as FiatSettlementBinding, g as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, h as ProtocolTransport, R as RouteAccessConfig, i as RuntimeChallengeResult, S as SDKOptions, j as SettlementArtifact, k as SettlementArtifactBinding, l as SettlementArtifactBindingBase, m as StablecoinSettlementBinding, T as TokenGuidance, q as TrustLevel, V as VerificationRequest, r as VerificationResult, s as VerifiedAgent, t as VerifiedDeveloper, u as VerifiedOrganization } from './types-ACMsV07B.mjs';
3
- export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-Clob2-0A.mjs';
1
+ import { G as GatewayConfig, n as StepUpApprovalInfo, p as StepUpOutcome, o as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-sy3tq8lp.mjs';
2
+ export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload, d as CommerceShieldProps, e as CounterpartyType, f as ExpressMiddlewareOptions, F as FiatSettlementBinding, g as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, h as ProtocolTransport, R as RouteAccessConfig, i as RuntimeChallengeResult, S as SDKOptions, j as SettlementArtifact, k as SettlementArtifactBinding, l as SettlementArtifactBindingBase, m as StablecoinSettlementBinding, T as TokenGuidance, q as TrustLevel, V as VerificationRequest, r as VerificationResult, s as VerifiedAgent, t as VerifiedDeveloper, u as VerifiedOrganization } from './types-sy3tq8lp.mjs';
3
+ export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-CZkbSOeO.mjs';
4
4
  export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportUnregisteredAttempt, verify } from './verify.mjs';
5
- export { e as express } from './express-DXUyvv7t.mjs';
6
- export { n as nextjs } from './nextjs-F_2pbPIA.mjs';
7
- export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-Dalih3EB.mjs';
5
+ export { e as express } from './express-DCXa1oqj.mjs';
6
+ export { n as nextjs } from './nextjs-DcQIk6Zj.mjs';
7
+ export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-BrNKDmiR.mjs';
8
8
  export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.mjs';
9
9
  export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.mjs';
10
- export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-DmmdehNu.mjs';
10
+ export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-Dr_XiN65.mjs';
11
11
  export { DEFAULT_EDGE_CONFIG, EdgeConfig, EdgeMode, EdgePathRule, EdgeVerificationDepth, FetchEdgeConfigResult, FetchEdgeConfigSuccess, _resetEdgeConfigCache, degradeToObserve, fetchEdgeConfig, getEdgeConfig, isEdgeConfig, matchEdgePathRule } from './edge-config.mjs';
12
- export { PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, detectPlatformFingerprint } from './platform-signatures.mjs';
12
+ export { DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature } from './platform-signatures.mjs';
13
+ export { MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, ObservedMetadata, SanitizeHeadersResult, extractApiKeyFormat, extractPlatformHeaders, sanitizeHeaders } from './metadata-capture.mjs';
13
14
  import 'express';
14
15
  import 'next/server';
15
16
  import 'jose';
@@ -144,6 +145,6 @@ declare function getCachedWellKnownUrls(apiBaseUrl: string): WellKnownAgenticCom
144
145
  * is fine — bumping both in the release-ceremony commit keeps them
145
146
  * lockstep.
146
147
  */
147
- declare const SDK_VERSION = "3.9.0";
148
+ declare const SDK_VERSION = "3.10.1";
148
149
 
149
150
  export { EnhancedVerificationResult, GatewayConfig, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown };
package/dist/index.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import { G as GatewayConfig, n as StepUpApprovalInfo, p as StepUpOutcome, o as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-ACMsV07B.js';
2
- export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload, d as CommerceShieldProps, e as CounterpartyType, f as ExpressMiddlewareOptions, F as FiatSettlementBinding, g as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, h as ProtocolTransport, R as RouteAccessConfig, i as RuntimeChallengeResult, S as SDKOptions, j as SettlementArtifact, k as SettlementArtifactBinding, l as SettlementArtifactBindingBase, m as StablecoinSettlementBinding, T as TokenGuidance, q as TrustLevel, V as VerificationRequest, r as VerificationResult, s as VerifiedAgent, t as VerifiedDeveloper, u as VerifiedOrganization } from './types-ACMsV07B.js';
3
- export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-CfHANs4A.js';
1
+ import { G as GatewayConfig, n as StepUpApprovalInfo, p as StepUpOutcome, o as StepUpApprovalStatus, E as EnhancedVerificationResult, A as AccessFailure } from './types-9tns4wyl.js';
2
+ export { a as AccessLevel, b as AgentCredentials, c as AstraSyncCredentials, C as CommerceArtifactsPayload, d as CommerceShieldProps, e as CounterpartyType, f as ExpressMiddlewareOptions, F as FiatSettlementBinding, g as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, h as ProtocolTransport, R as RouteAccessConfig, i as RuntimeChallengeResult, S as SDKOptions, j as SettlementArtifact, k as SettlementArtifactBinding, l as SettlementArtifactBindingBase, m as StablecoinSettlementBinding, T as TokenGuidance, q as TrustLevel, V as VerificationRequest, r as VerificationResult, s as VerifiedAgent, t as VerifiedDeveloper, u as VerifiedOrganization } from './types-9tns4wyl.js';
3
+ export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-H0JCLW2y.js';
4
4
  export { VerifyOptions, clearCache, extractCredentials, fetchRoutes, hasCredentials, quickVerify, reportUnregisteredAttempt, verify } from './verify.js';
5
- export { e as express } from './express-sGXhDdd0.js';
6
- export { n as nextjs } from './nextjs-DwUW-Nm1.js';
7
- export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-CMg-vjEK.js';
5
+ export { e as express } from './express-ClNtDhhc.js';
6
+ export { n as nextjs } from './nextjs-CEBVBsdi.js';
7
+ export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-D2ztkumS.js';
8
8
  export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.js';
9
9
  export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.js';
10
- export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-C61VL_OW.js';
10
+ export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-CfHurO1P.js';
11
11
  export { DEFAULT_EDGE_CONFIG, EdgeConfig, EdgeMode, EdgePathRule, EdgeVerificationDepth, FetchEdgeConfigResult, FetchEdgeConfigSuccess, _resetEdgeConfigCache, degradeToObserve, fetchEdgeConfig, getEdgeConfig, isEdgeConfig, matchEdgePathRule } from './edge-config.js';
12
- export { PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, detectPlatformFingerprint } from './platform-signatures.js';
12
+ export { DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, PlatformAgentVendor, PlatformDetectionInput, PlatformFingerprint, PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature } from './platform-signatures.js';
13
+ export { MAX_HEADERS, MAX_HEADER_VALUE_BYTES, MAX_TOTAL_BYTES, ObservedMetadata, SanitizeHeadersResult, extractApiKeyFormat, extractPlatformHeaders, sanitizeHeaders } from './metadata-capture.js';
13
14
  import 'express';
14
15
  import 'next/server';
15
16
  import 'jose';
@@ -144,6 +145,6 @@ declare function getCachedWellKnownUrls(apiBaseUrl: string): WellKnownAgenticCom
144
145
  * is fine — bumping both in the release-ceremony commit keeps them
145
146
  * lockstep.
146
147
  */
147
- declare const SDK_VERSION = "3.9.0";
148
+ declare const SDK_VERSION = "3.10.1";
148
149
 
149
150
  export { EnhancedVerificationResult, GatewayConfig, type SettlementDecision, type SettlementRequest, StepUpApprovalInfo, StepUpApprovalStatus, StepUpOutcome, SDK_VERSION as VERSION, type WellKnownAgenticCommerce, authorizeSettlement, awaitStepUpApproval, getCachedWellKnownUrls, getWellKnownUrls, pollStepUpStatus, prefetchWellKnown };
package/dist/index.js CHANGED
@@ -40,6 +40,9 @@ __export(src_exports, {
40
40
  DEFAULT_EDGE_CONFIG: () => DEFAULT_EDGE_CONFIG,
41
41
  DEFAULT_TRUST_THRESHOLDS: () => DEFAULT_TRUST_THRESHOLDS,
42
42
  KYDRequiredError: () => KYDRequiredError,
43
+ MAX_HEADERS: () => MAX_HEADERS,
44
+ MAX_HEADER_VALUE_BYTES: () => MAX_HEADER_VALUE_BYTES,
45
+ MAX_TOTAL_BYTES: () => MAX_TOTAL_BYTES,
43
46
  PLATFORM_AGENT_SIGNATURES: () => PLATFORM_AGENT_SIGNATURES,
44
47
  RegistrationDeniedError: () => RegistrationDeniedError,
45
48
  RegistrationExpiredError: () => RegistrationExpiredError,
@@ -57,8 +60,10 @@ __export(src_exports, {
57
60
  detectPlatformFingerprint: () => detectPlatformFingerprint,
58
61
  determineAccessLevel: () => determineAccessLevel,
59
62
  express: () => express_exports,
63
+ extractApiKeyFormat: () => extractApiKeyFormat,
60
64
  extractCredentials: () => extractCredentials,
61
65
  extractMcpCredentials: () => extractMcpCredentials,
66
+ extractPlatformHeaders: () => extractPlatformHeaders,
62
67
  fetchEdgeConfig: () => fetchEdgeConfig,
63
68
  fetchRoutes: () => fetchRoutes,
64
69
  getAccessLevelForScore: () => getAccessLevelForScore,
@@ -71,12 +76,14 @@ __export(src_exports, {
71
76
  hasMinimumAccess: () => hasMinimumAccess,
72
77
  isEdgeConfig: () => isEdgeConfig,
73
78
  matchEdgePathRule: () => matchEdgePathRule,
79
+ matchPlatformSignature: () => matchPlatformSignature,
74
80
  nextjs: () => nextjs_exports,
75
81
  pollStepUpStatus: () => pollStepUpStatus,
76
82
  prefetchWellKnown: () => prefetchWellKnown,
77
83
  quickVerify: () => quickVerify,
78
84
  recordDecision: () => recordDecision2,
79
85
  reportUnregisteredAttempt: () => reportUnregisteredAttempt,
86
+ sanitizeHeaders: () => sanitizeHeaders,
80
87
  sdk: () => sdk_exports,
81
88
  setMcpMeta: () => setMcpMeta,
82
89
  transport: () => transport_exports,
@@ -206,7 +213,7 @@ function getCapabilities(accessLevel) {
206
213
  }
207
214
 
208
215
  // src/version.ts
209
- var SDK_VERSION = "3.9.0";
216
+ var SDK_VERSION = "3.10.1";
210
217
 
211
218
  // src/well-known.ts
212
219
  var CACHE_TTL_MS = 60 * 60 * 1e3;
@@ -1103,6 +1110,152 @@ function performCounterpartyPreCheck(routeConfig, astraCreds, purpose) {
1103
1110
  return failures;
1104
1111
  }
1105
1112
 
1113
+ // src/metadata-capture.ts
1114
+ var SECRET_HEADER_NAMES = /* @__PURE__ */ new Set([
1115
+ "cookie",
1116
+ "set-cookie",
1117
+ "x-csrf-token",
1118
+ "proxy-authorization",
1119
+ "x-astrasync-signature",
1120
+ "x-astrasync-secret",
1121
+ "x-hub-signature",
1122
+ "x-hub-signature-256"
1123
+ ]);
1124
+ var SECRET_HEADER_PREFIXES = ["x-astrasync-", "kya-", "kya_"];
1125
+ var CREDENTIAL_HEADER_NAMES = /* @__PURE__ */ new Set([
1126
+ "authorization",
1127
+ "x-api-key",
1128
+ "x-goog-api-key",
1129
+ "api-key"
1130
+ ]);
1131
+ function isSignatureHeader(name) {
1132
+ return name === "signature" || name.endsWith("-signature") || name.endsWith("-signature-256");
1133
+ }
1134
+ var PLATFORM_HEADER_NAMES = /* @__PURE__ */ new Set([
1135
+ "openai-organization",
1136
+ "openai-project",
1137
+ "openai-version",
1138
+ "openai-processing-ms",
1139
+ "anthropic-version",
1140
+ "anthropic-beta",
1141
+ "x-goog-user-project",
1142
+ "x-goog-api-client",
1143
+ "user-agent",
1144
+ "x-agent-card-url",
1145
+ "x-agent-provider"
1146
+ ]);
1147
+ var PLATFORM_HEADER_PREFIXES = ["x-goog-", "x-stainless-", "x-anthropic-", "x-openai-"];
1148
+ var KEY_FORMAT_PREFIXES = [
1149
+ "sk-ant-api03",
1150
+ "sk-ant-api",
1151
+ "sk-ant",
1152
+ "sk-proj",
1153
+ "sk-svcacct",
1154
+ "sk-or-v1",
1155
+ "sk-or",
1156
+ "sk-lf",
1157
+ "sk-",
1158
+ "gsk_",
1159
+ "aiza",
1160
+ "ya29",
1161
+ "ghp_",
1162
+ "gho_",
1163
+ "github_pat_",
1164
+ "xai-",
1165
+ "pplx-",
1166
+ "r8_",
1167
+ "hf_",
1168
+ "astra-",
1169
+ "astrae-"
1170
+ ];
1171
+ var MAX_HEADERS = 64;
1172
+ var MAX_HEADER_VALUE_BYTES = 1024;
1173
+ var MAX_TOTAL_BYTES = 16 * 1024;
1174
+ function byteLength(s) {
1175
+ let bytes = 0;
1176
+ for (let i = 0; i < s.length; i++) {
1177
+ const code = s.charCodeAt(i);
1178
+ if (code < 128) bytes += 1;
1179
+ else if (code < 2048) bytes += 2;
1180
+ else if (code >= 55296 && code <= 56319) {
1181
+ bytes += 4;
1182
+ i++;
1183
+ } else bytes += 3;
1184
+ }
1185
+ return bytes;
1186
+ }
1187
+ function extractApiKeyFormat(rawValue) {
1188
+ if (!rawValue) return void 0;
1189
+ let value = rawValue.trim();
1190
+ const spaceIdx = value.indexOf(" ");
1191
+ if (spaceIdx > 0) {
1192
+ const scheme = value.slice(0, spaceIdx).toLowerCase();
1193
+ if (scheme === "bearer" || scheme === "basic" || scheme === "token") {
1194
+ value = value.slice(spaceIdx + 1).trim();
1195
+ }
1196
+ }
1197
+ const lower = value.toLowerCase();
1198
+ for (const prefix of KEY_FORMAT_PREFIXES) {
1199
+ if (lower.startsWith(prefix)) {
1200
+ return prefix;
1201
+ }
1202
+ }
1203
+ return void 0;
1204
+ }
1205
+ function isSecretHeader(name) {
1206
+ if (SECRET_HEADER_NAMES.has(name)) return true;
1207
+ if (SECRET_HEADER_PREFIXES.some((p) => name.startsWith(p))) return true;
1208
+ if (isSignatureHeader(name)) return true;
1209
+ return false;
1210
+ }
1211
+ function isPlatformHeader(name) {
1212
+ if (PLATFORM_HEADER_NAMES.has(name)) return true;
1213
+ return PLATFORM_HEADER_PREFIXES.some((p) => name.startsWith(p));
1214
+ }
1215
+ function sanitizeHeaders(raw) {
1216
+ const headers = {};
1217
+ const platformHeaders = {};
1218
+ let apiKeyFormat;
1219
+ let totalBytes = 0;
1220
+ let count = 0;
1221
+ if (!raw) return { headers };
1222
+ for (const rawName of Object.keys(raw)) {
1223
+ if (count >= MAX_HEADERS) break;
1224
+ const name = rawName.toLowerCase();
1225
+ const rawValue = raw[rawName];
1226
+ if (rawValue === void 0) continue;
1227
+ const joined = Array.isArray(rawValue) ? rawValue.join(", ") : String(rawValue);
1228
+ if (CREDENTIAL_HEADER_NAMES.has(name)) {
1229
+ const fmt = extractApiKeyFormat(joined);
1230
+ if (fmt && !apiKeyFormat) apiKeyFormat = fmt;
1231
+ continue;
1232
+ }
1233
+ if (isSecretHeader(name)) continue;
1234
+ let value = joined;
1235
+ if (byteLength(value) > MAX_HEADER_VALUE_BYTES) {
1236
+ value = value.slice(0, MAX_HEADER_VALUE_BYTES);
1237
+ }
1238
+ const entryBytes = byteLength(name) + byteLength(value);
1239
+ if (totalBytes + entryBytes > MAX_TOTAL_BYTES) continue;
1240
+ totalBytes += entryBytes;
1241
+ count++;
1242
+ headers[name] = value;
1243
+ if (isPlatformHeader(name)) platformHeaders[name] = value;
1244
+ }
1245
+ const result = { headers };
1246
+ if (apiKeyFormat) result.apiKeyFormat = apiKeyFormat;
1247
+ if (Object.keys(platformHeaders).length > 0) result.platformHeaders = platformHeaders;
1248
+ return result;
1249
+ }
1250
+ function extractPlatformHeaders(sanitized) {
1251
+ const out = {};
1252
+ if (!sanitized) return out;
1253
+ for (const name of Object.keys(sanitized)) {
1254
+ if (isPlatformHeader(name.toLowerCase())) out[name.toLowerCase()] = sanitized[name];
1255
+ }
1256
+ return out;
1257
+ }
1258
+
1106
1259
  // src/adapters/express.ts
1107
1260
  function defaultExtractCredentials(req) {
1108
1261
  return extractCredentials(
@@ -1369,7 +1522,18 @@ function createMiddleware(options) {
1369
1522
  referer: req.headers.referer,
1370
1523
  host: req.headers.host,
1371
1524
  forwardedFor: forwardedForStr,
1372
- agentCardUrl
1525
+ agentCardUrl,
1526
+ // Workstream D — capture EVERY inbound header (SDK-only merchants
1527
+ // have no edge to do it upstream). Local string work, secrets
1528
+ // stripped; out of the verify cache key so it doesn't defeat caching.
1529
+ observedMetadata: (() => {
1530
+ const { headers, apiKeyFormat, platformHeaders } = sanitizeHeaders(req.headers);
1531
+ return {
1532
+ headers,
1533
+ ...apiKeyFormat && { apiKeyFormat },
1534
+ ...platformHeaders && { platformHeaders }
1535
+ };
1536
+ })()
1373
1537
  }
1374
1538
  };
1375
1539
  let result = await verify(config, verificationRequest);
@@ -1849,7 +2013,18 @@ function createMiddleware2(options) {
1849
2013
  referer: request.headers.get("referer") || void 0,
1850
2014
  host: request.headers.get("host") || void 0,
1851
2015
  forwardedFor,
1852
- agentCardUrl: request.headers.get("x-astrasync-agent-card") || void 0
2016
+ agentCardUrl: request.headers.get("x-astrasync-agent-card") || void 0,
2017
+ // Workstream D — full sanitised header capture (Web Headers → plain map).
2018
+ observedMetadata: (() => {
2019
+ const { headers, apiKeyFormat, platformHeaders } = sanitizeHeaders(
2020
+ Object.fromEntries(request.headers.entries())
2021
+ );
2022
+ return {
2023
+ headers,
2024
+ ...apiKeyFormat && { apiKeyFormat },
2025
+ ...platformHeaders && { platformHeaders }
2026
+ };
2027
+ })()
1853
2028
  }
1854
2029
  };
1855
2030
  let result = await verify(config, verificationRequest);
@@ -5879,19 +6054,25 @@ var PLATFORM_AGENT_SIGNATURES = [
5879
6054
  vendor: "claude",
5880
6055
  displayName: "Anthropic Claude",
5881
6056
  uaPatterns: [/claude/i, /anthropic/i],
5882
- agentCardPatterns: [/anthropic\.com/i, /claude\.ai/i]
6057
+ agentCardPatterns: [/anthropic\.com/i, /claude\.ai/i],
6058
+ apiKeyFormatPatterns: [/^sk-ant/i],
6059
+ headerPatterns: [/^anthropic-version/i, /^anthropic-beta/i, /^x-anthropic-/i]
5883
6060
  },
5884
6061
  {
5885
6062
  vendor: "chatgpt",
5886
6063
  displayName: "OpenAI ChatGPT",
5887
6064
  uaPatterns: [/chatgpt/i, /openai/i, /gpt-?\d/i],
5888
- agentCardPatterns: [/openai\.com/i, /chatgpt\.com/i]
6065
+ agentCardPatterns: [/openai\.com/i, /chatgpt\.com/i],
6066
+ apiKeyFormatPatterns: [/^sk-proj/i, /^sk-svcacct/i],
6067
+ headerPatterns: [/^openai-organization/i, /^openai-project/i, /^openai-version/i]
5889
6068
  },
5890
6069
  {
5891
6070
  vendor: "gemini",
5892
6071
  displayName: "Google Gemini",
5893
6072
  uaPatterns: [/gemini/i, /google-gemini/i, /bard/i],
5894
- agentCardPatterns: [/gemini\.google\.com/i, /ai\.google\.dev/i]
6073
+ agentCardPatterns: [/gemini\.google\.com/i, /ai\.google\.dev/i],
6074
+ apiKeyFormatPatterns: [/^aiza/i],
6075
+ headerPatterns: [/^x-goog-user-project/i, /^x-goog-api-client/i]
5895
6076
  },
5896
6077
  {
5897
6078
  vendor: "cursor",
@@ -5904,15 +6085,31 @@ var PLATFORM_AGENT_SIGNATURES = [
5904
6085
  displayName: "Block Goose",
5905
6086
  uaPatterns: [/goose/i, /block-goose/i],
5906
6087
  agentCardPatterns: [/block\.xyz\/goose/i, /goose\.tools/i]
6088
+ },
6089
+ {
6090
+ vendor: "perplexity",
6091
+ displayName: "Perplexity",
6092
+ uaPatterns: [/perplexity/i],
6093
+ agentCardPatterns: [/perplexity\.ai/i],
6094
+ apiKeyFormatPatterns: [/^pplx-/i]
5907
6095
  }
5908
6096
  ];
5909
- function detectPlatformFingerprint(input) {
6097
+ function matchPlatformSignature(signatures, input) {
5910
6098
  const ua = input.userAgent ?? "";
5911
6099
  const cardUrl = input.agentCardUrl ?? "";
5912
- for (const sig of PLATFORM_AGENT_SIGNATURES) {
6100
+ const apiKeyFormat = input.apiKeyFormat ?? "";
6101
+ const headerLines = [];
6102
+ if (input.platformHeaders) {
6103
+ for (const [name, value] of Object.entries(input.platformHeaders)) {
6104
+ headerLines.push(name, `${name}: ${value}`);
6105
+ }
6106
+ }
6107
+ for (const sig of signatures) {
5913
6108
  const uaMatch = sig.uaPatterns?.some((p) => p.test(ua));
5914
6109
  const cardMatch = sig.agentCardPatterns?.some((p) => p.test(cardUrl));
5915
- if (uaMatch || cardMatch) {
6110
+ const keyMatch = apiKeyFormat.length > 0 && sig.apiKeyFormatPatterns?.some((p) => p.test(apiKeyFormat));
6111
+ const headerMatch = headerLines.length > 0 && sig.headerPatterns?.some((p) => headerLines.some((line) => p.test(line)));
6112
+ if (uaMatch || cardMatch || keyMatch || headerMatch) {
5916
6113
  const uaBase = ua.split(/[\s/]/)[0]?.toLowerCase() ?? "";
5917
6114
  const cardHost = (() => {
5918
6115
  try {
@@ -5921,16 +6118,19 @@ function detectPlatformFingerprint(input) {
5921
6118
  return "";
5922
6119
  }
5923
6120
  })();
5924
- const fingerprintKey = `${sig.vendor}:${uaBase || cardHost || "unknown"}`;
6121
+ const keyBasis = uaBase || cardHost || apiKeyFormat || "unknown";
5925
6122
  return {
5926
6123
  vendor: sig.vendor,
5927
- fingerprintKey,
6124
+ fingerprintKey: `${sig.vendor}:${keyBasis}`,
5928
6125
  displayName: sig.displayName
5929
6126
  };
5930
6127
  }
5931
6128
  }
5932
6129
  return void 0;
5933
6130
  }
6131
+ function detectPlatformFingerprint(input) {
6132
+ return matchPlatformSignature(PLATFORM_AGENT_SIGNATURES, input);
6133
+ }
5934
6134
  // Annotate the CommonJS export names for ESM import in node:
5935
6135
  0 && (module.exports = {
5936
6136
  ACCESS_LEVEL_DESCRIPTIONS,
@@ -5943,6 +6143,9 @@ function detectPlatformFingerprint(input) {
5943
6143
  DEFAULT_EDGE_CONFIG,
5944
6144
  DEFAULT_TRUST_THRESHOLDS,
5945
6145
  KYDRequiredError,
6146
+ MAX_HEADERS,
6147
+ MAX_HEADER_VALUE_BYTES,
6148
+ MAX_TOTAL_BYTES,
5946
6149
  PLATFORM_AGENT_SIGNATURES,
5947
6150
  RegistrationDeniedError,
5948
6151
  RegistrationExpiredError,
@@ -5960,8 +6163,10 @@ function detectPlatformFingerprint(input) {
5960
6163
  detectPlatformFingerprint,
5961
6164
  determineAccessLevel,
5962
6165
  express,
6166
+ extractApiKeyFormat,
5963
6167
  extractCredentials,
5964
6168
  extractMcpCredentials,
6169
+ extractPlatformHeaders,
5965
6170
  fetchEdgeConfig,
5966
6171
  fetchRoutes,
5967
6172
  getAccessLevelForScore,
@@ -5974,12 +6179,14 @@ function detectPlatformFingerprint(input) {
5974
6179
  hasMinimumAccess,
5975
6180
  isEdgeConfig,
5976
6181
  matchEdgePathRule,
6182
+ matchPlatformSignature,
5977
6183
  nextjs,
5978
6184
  pollStepUpStatus,
5979
6185
  prefetchWellKnown,
5980
6186
  quickVerify,
5981
6187
  recordDecision,
5982
6188
  reportUnregisteredAttempt,
6189
+ sanitizeHeaders,
5983
6190
  sdk,
5984
6191
  setMcpMeta,
5985
6192
  transport,