@astrasyncai/verification-gateway 3.8.0 → 3.10.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 (114) 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 +152 -2
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +152 -2
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/http-pdlss.d.mts +81 -0
  10. package/dist/adapters/http-pdlss.d.ts +81 -0
  11. package/dist/adapters/http-pdlss.js +117 -0
  12. package/dist/adapters/http-pdlss.js.map +1 -0
  13. package/dist/adapters/http-pdlss.mjs +87 -0
  14. package/dist/adapters/http-pdlss.mjs.map +1 -0
  15. package/dist/adapters/mcp.d.mts +2 -1
  16. package/dist/adapters/mcp.d.ts +2 -1
  17. package/dist/adapters/mcp.js +2 -1
  18. package/dist/adapters/mcp.js.map +1 -1
  19. package/dist/adapters/mcp.mjs +2 -1
  20. package/dist/adapters/mcp.mjs.map +1 -1
  21. package/dist/adapters/nextjs.d.mts +3 -2
  22. package/dist/adapters/nextjs.d.ts +3 -2
  23. package/dist/adapters/nextjs.js +152 -2
  24. package/dist/adapters/nextjs.js.map +1 -1
  25. package/dist/adapters/nextjs.mjs +152 -2
  26. package/dist/adapters/nextjs.mjs.map +1 -1
  27. package/dist/adapters/sdk.d.mts +3 -2
  28. package/dist/adapters/sdk.d.ts +3 -2
  29. package/dist/adapters/sdk.js +2 -1
  30. package/dist/adapters/sdk.js.map +1 -1
  31. package/dist/adapters/sdk.mjs +2 -1
  32. package/dist/adapters/sdk.mjs.map +1 -1
  33. package/dist/agent/index.d.mts +3 -2
  34. package/dist/agent/index.d.ts +3 -2
  35. package/dist/bin/astrasync-claude-hook.js +17 -1
  36. package/dist/bin/astrasync-guard.js +17 -1
  37. package/dist/bin/astrasync.js +43 -1
  38. package/dist/browser/background.js +17 -1
  39. package/dist/browser/background.js.map +1 -1
  40. package/dist/browser/background.mjs +17 -1
  41. package/dist/browser/background.mjs.map +1 -1
  42. package/dist/browser/browser-adapter.d.mts +3 -2
  43. package/dist/browser/browser-adapter.d.ts +3 -2
  44. package/dist/claude-code/claude-code-adapter.d.mts +3 -2
  45. package/dist/claude-code/claude-code-adapter.d.ts +3 -2
  46. package/dist/cli/index.d.mts +3 -2
  47. package/dist/cli/index.d.ts +3 -2
  48. package/dist/cursor/cursor-adapter.d.mts +3 -2
  49. package/dist/cursor/cursor-adapter.d.ts +3 -2
  50. package/dist/cursor/extension.d.mts +3 -2
  51. package/dist/cursor/extension.d.ts +3 -2
  52. package/dist/cursor/extension.js +17 -1
  53. package/dist/cursor/extension.js.map +1 -1
  54. package/dist/cursor/extension.mjs +17 -1
  55. package/dist/cursor/extension.mjs.map +1 -1
  56. package/dist/edge-config.d.mts +131 -0
  57. package/dist/edge-config.d.ts +131 -0
  58. package/dist/edge-config.js +162 -0
  59. package/dist/edge-config.js.map +1 -0
  60. package/dist/edge-config.mjs +131 -0
  61. package/dist/edge-config.mjs.map +1 -0
  62. package/dist/{express-C8nJGi5P.d.ts → express-ClNtDhhc.d.ts} +1 -1
  63. package/dist/{express-Di_hnZZS.d.mts → express-DCXa1oqj.d.mts} +1 -1
  64. package/dist/gateway/gateway.d.mts +3 -2
  65. package/dist/gateway/gateway.d.ts +3 -2
  66. package/dist/gateway/gateway.js +17 -1
  67. package/dist/gateway/gateway.js.map +1 -1
  68. package/dist/gateway/gateway.mjs +17 -1
  69. package/dist/gateway/gateway.mjs.map +1 -1
  70. package/dist/git-trigger/git-hooks.d.mts +3 -2
  71. package/dist/git-trigger/git-hooks.d.ts +3 -2
  72. package/dist/{index-CXcvO9Au.d.mts → index-BrNKDmiR.d.mts} +1 -1
  73. package/dist/{index-CuCkjT7B.d.ts → index-CfHurO1P.d.ts} +1 -1
  74. package/dist/{index-CBQr4FGs.d.ts → index-D2ztkumS.d.ts} +1 -1
  75. package/dist/{index-DALAqct7.d.mts → index-Dr_XiN65.d.mts} +1 -1
  76. package/dist/index.d.mts +27 -82
  77. package/dist/index.d.ts +27 -82
  78. package/dist/index.js +435 -12
  79. package/dist/index.js.map +1 -1
  80. package/dist/index.mjs +417 -12
  81. package/dist/index.mjs.map +1 -1
  82. package/dist/local-evaluator/evaluator.d.mts +3 -2
  83. package/dist/local-evaluator/evaluator.d.ts +3 -2
  84. package/dist/metadata-capture.d.mts +87 -0
  85. package/dist/metadata-capture.d.ts +87 -0
  86. package/dist/metadata-capture.js +184 -0
  87. package/dist/metadata-capture.js.map +1 -0
  88. package/dist/metadata-capture.mjs +154 -0
  89. package/dist/metadata-capture.mjs.map +1 -0
  90. package/dist/{nextjs-IyXWW2KL.d.ts → nextjs-CEBVBsdi.d.ts} +1 -1
  91. package/dist/{nextjs-BMAe8ode.d.mts → nextjs-DcQIk6Zj.d.mts} +1 -1
  92. package/dist/platform-signatures.d.mts +97 -0
  93. package/dist/platform-signatures.d.ts +97 -0
  94. package/dist/platform-signatures.js +116 -0
  95. package/dist/platform-signatures.js.map +1 -0
  96. package/dist/platform-signatures.mjs +89 -0
  97. package/dist/platform-signatures.mjs.map +1 -0
  98. package/dist/{sdk-Cn4KcZ5G.d.mts → sdk-CZkbSOeO.d.mts} +1 -1
  99. package/dist/{sdk-ThdA_NtL.d.ts → sdk-H0JCLW2y.d.ts} +1 -1
  100. package/dist/transport/index.d.mts +3 -2
  101. package/dist/transport/index.d.ts +3 -2
  102. package/dist/{types-DedAJbNI.d.mts → types-9tns4wyl.d.ts} +88 -1
  103. package/dist/{types-CSFci5zD.d.mts → types-D0lCtFQ7.d.mts} +1 -1
  104. package/dist/{types-D1kyMiml.d.ts → types-YbiXYKx1.d.ts} +1 -1
  105. package/dist/{types-DedAJbNI.d.ts → types-sy3tq8lp.d.mts} +88 -1
  106. package/dist/ui/index.d.mts +2 -1
  107. package/dist/ui/index.d.ts +2 -1
  108. package/dist/verify.d.mts +151 -0
  109. package/dist/verify.d.ts +151 -0
  110. package/dist/verify.js +593 -0
  111. package/dist/verify.js.map +1 -0
  112. package/dist/verify.mjs +557 -0
  113. package/dist/verify.mjs.map +1 -0
  114. package/package.json +26 -1
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Platform-agent fingerprint signatures — the shared registry of known
3
+ * platform-agent UA / agent-card patterns (Claude / ChatGPT / Gemini /
4
+ * Cursor / Goose).
5
+ *
6
+ * Single source of truth, lifted verbatim from the backend's
7
+ * `platform-agent-detector.service` (which now imports detection from
8
+ * here): the backend's verify-access anonymous handler and the edge
9
+ * adapter (`@astrasyncai/adapter-lambda`) must classify identically or
10
+ * the three-tier visibility numbers drift between capture points.
11
+ *
12
+ * Pure regex — no Node built-ins, edge-safe. Detection is regex-only for
13
+ * v2.9 — TLS fingerprinting / behavioural signatures are deferred
14
+ * (recorded in adapter requirements doc).
15
+ */
16
+ type PlatformAgentVendor = 'claude' | 'chatgpt' | 'gemini' | 'cursor' | 'goose' | 'perplexity' | 'unknown';
17
+ interface PlatformFingerprint {
18
+ vendor: PlatformAgentVendor;
19
+ /** A stable identifier used as the orphan-agent dedup key. */
20
+ fingerprintKey: string;
21
+ /** Human-readable name surfaced in the admin panel. */
22
+ displayName: string;
23
+ }
24
+ interface PlatformDetectionInput {
25
+ userAgent?: string;
26
+ agentCardUrl?: string;
27
+ /**
28
+ * Workstream D — a safe API-key format prefix observed on the caller's
29
+ * credential header (e.g. `sk-ant-api03`, `sk-proj`, `aiza`). A strong
30
+ * platform signal; never the secret. Matched against `apiKeyFormatPatterns`.
31
+ */
32
+ apiKeyFormat?: string;
33
+ /**
34
+ * Workstream D — the sanitised platform-signal headers (lowercased names →
35
+ * values), e.g. `openai-organization`, `x-goog-user-project`. Matched
36
+ * against `headerPatterns` (which test on `name` and `name: value`).
37
+ */
38
+ platformHeaders?: Record<string, string>;
39
+ }
40
+ /**
41
+ * A signature definition, generic over the vendor key. The seed constant
42
+ * below uses the closed `PlatformAgentVendor` union; DB-promoted signatures
43
+ * (backend dynamic registry, console round) carry arbitrary string vendors —
44
+ * `matchPlatformSignature` accepts both.
45
+ */
46
+ interface PlatformSignatureDef<V extends string = string> {
47
+ vendor: V;
48
+ displayName: string;
49
+ uaPatterns?: RegExp[];
50
+ agentCardPatterns?: RegExp[];
51
+ /**
52
+ * Workstream D — patterns tested against an observed API-key format prefix
53
+ * (e.g. `/^sk-ant/i` → claude). A credential-header format is a stronger
54
+ * platform signal than a spoofable User-Agent.
55
+ */
56
+ apiKeyFormatPatterns?: RegExp[];
57
+ /**
58
+ * Workstream D — patterns tested against each observed platform-signal
59
+ * header, as both `name` and `name: value` (so `/openai-organization/i` and
60
+ * `/x-goog-user-project/i` match on presence).
61
+ */
62
+ headerPatterns?: RegExp[];
63
+ }
64
+ /**
65
+ * A fingerprint whose vendor may be a dynamically-promoted (non-seed) key.
66
+ * Structurally a superset of `PlatformFingerprint`.
67
+ */
68
+ interface DynamicPlatformFingerprint {
69
+ vendor: string;
70
+ fingerprintKey: string;
71
+ displayName: string;
72
+ }
73
+ /**
74
+ * Registry of known platform-agent signatures. Order matters — first match wins.
75
+ *
76
+ * Patterns are intentionally permissive (case-insensitive substring match) since
77
+ * platform UA strings drift between versions. False positives are tolerable —
78
+ * the orphan record is informational, not enforcement.
79
+ */
80
+ declare const PLATFORM_AGENT_SIGNATURES: ReadonlyArray<PlatformSignatureDef<PlatformAgentVendor>>;
81
+ /**
82
+ * Generic first-match-wins matcher over an arbitrary signature set. The
83
+ * backend's dynamic registry merges the seed constant with DB-promoted
84
+ * signatures and calls this — ONE matching implementation everywhere
85
+ * (fingerprint-key rule included: vendor + lowercased UA basename before
86
+ * the first space/slash, falling back to the agent-card host).
87
+ */
88
+ declare function matchPlatformSignature(signatures: ReadonlyArray<PlatformSignatureDef>, input: PlatformDetectionInput): DynamicPlatformFingerprint | undefined;
89
+ /**
90
+ * Inspect caller metadata for a known SEED platform-agent fingerprint.
91
+ * Returns undefined if no signature matches. (Backends with the dynamic
92
+ * registry should call `matchPlatformSignature` over their merged set
93
+ * instead — same semantics, live signature additions included.)
94
+ */
95
+ declare function detectPlatformFingerprint(input: PlatformDetectionInput): PlatformFingerprint | undefined;
96
+
97
+ export { type DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature };
@@ -0,0 +1,97 @@
1
+ /**
2
+ * Platform-agent fingerprint signatures — the shared registry of known
3
+ * platform-agent UA / agent-card patterns (Claude / ChatGPT / Gemini /
4
+ * Cursor / Goose).
5
+ *
6
+ * Single source of truth, lifted verbatim from the backend's
7
+ * `platform-agent-detector.service` (which now imports detection from
8
+ * here): the backend's verify-access anonymous handler and the edge
9
+ * adapter (`@astrasyncai/adapter-lambda`) must classify identically or
10
+ * the three-tier visibility numbers drift between capture points.
11
+ *
12
+ * Pure regex — no Node built-ins, edge-safe. Detection is regex-only for
13
+ * v2.9 — TLS fingerprinting / behavioural signatures are deferred
14
+ * (recorded in adapter requirements doc).
15
+ */
16
+ type PlatformAgentVendor = 'claude' | 'chatgpt' | 'gemini' | 'cursor' | 'goose' | 'perplexity' | 'unknown';
17
+ interface PlatformFingerprint {
18
+ vendor: PlatformAgentVendor;
19
+ /** A stable identifier used as the orphan-agent dedup key. */
20
+ fingerprintKey: string;
21
+ /** Human-readable name surfaced in the admin panel. */
22
+ displayName: string;
23
+ }
24
+ interface PlatformDetectionInput {
25
+ userAgent?: string;
26
+ agentCardUrl?: string;
27
+ /**
28
+ * Workstream D — a safe API-key format prefix observed on the caller's
29
+ * credential header (e.g. `sk-ant-api03`, `sk-proj`, `aiza`). A strong
30
+ * platform signal; never the secret. Matched against `apiKeyFormatPatterns`.
31
+ */
32
+ apiKeyFormat?: string;
33
+ /**
34
+ * Workstream D — the sanitised platform-signal headers (lowercased names →
35
+ * values), e.g. `openai-organization`, `x-goog-user-project`. Matched
36
+ * against `headerPatterns` (which test on `name` and `name: value`).
37
+ */
38
+ platformHeaders?: Record<string, string>;
39
+ }
40
+ /**
41
+ * A signature definition, generic over the vendor key. The seed constant
42
+ * below uses the closed `PlatformAgentVendor` union; DB-promoted signatures
43
+ * (backend dynamic registry, console round) carry arbitrary string vendors —
44
+ * `matchPlatformSignature` accepts both.
45
+ */
46
+ interface PlatformSignatureDef<V extends string = string> {
47
+ vendor: V;
48
+ displayName: string;
49
+ uaPatterns?: RegExp[];
50
+ agentCardPatterns?: RegExp[];
51
+ /**
52
+ * Workstream D — patterns tested against an observed API-key format prefix
53
+ * (e.g. `/^sk-ant/i` → claude). A credential-header format is a stronger
54
+ * platform signal than a spoofable User-Agent.
55
+ */
56
+ apiKeyFormatPatterns?: RegExp[];
57
+ /**
58
+ * Workstream D — patterns tested against each observed platform-signal
59
+ * header, as both `name` and `name: value` (so `/openai-organization/i` and
60
+ * `/x-goog-user-project/i` match on presence).
61
+ */
62
+ headerPatterns?: RegExp[];
63
+ }
64
+ /**
65
+ * A fingerprint whose vendor may be a dynamically-promoted (non-seed) key.
66
+ * Structurally a superset of `PlatformFingerprint`.
67
+ */
68
+ interface DynamicPlatformFingerprint {
69
+ vendor: string;
70
+ fingerprintKey: string;
71
+ displayName: string;
72
+ }
73
+ /**
74
+ * Registry of known platform-agent signatures. Order matters — first match wins.
75
+ *
76
+ * Patterns are intentionally permissive (case-insensitive substring match) since
77
+ * platform UA strings drift between versions. False positives are tolerable —
78
+ * the orphan record is informational, not enforcement.
79
+ */
80
+ declare const PLATFORM_AGENT_SIGNATURES: ReadonlyArray<PlatformSignatureDef<PlatformAgentVendor>>;
81
+ /**
82
+ * Generic first-match-wins matcher over an arbitrary signature set. The
83
+ * backend's dynamic registry merges the seed constant with DB-promoted
84
+ * signatures and calls this — ONE matching implementation everywhere
85
+ * (fingerprint-key rule included: vendor + lowercased UA basename before
86
+ * the first space/slash, falling back to the agent-card host).
87
+ */
88
+ declare function matchPlatformSignature(signatures: ReadonlyArray<PlatformSignatureDef>, input: PlatformDetectionInput): DynamicPlatformFingerprint | undefined;
89
+ /**
90
+ * Inspect caller metadata for a known SEED platform-agent fingerprint.
91
+ * Returns undefined if no signature matches. (Backends with the dynamic
92
+ * registry should call `matchPlatformSignature` over their merged set
93
+ * instead — same semantics, live signature additions included.)
94
+ */
95
+ declare function detectPlatformFingerprint(input: PlatformDetectionInput): PlatformFingerprint | undefined;
96
+
97
+ export { type DynamicPlatformFingerprint, PLATFORM_AGENT_SIGNATURES, type PlatformAgentVendor, type PlatformDetectionInput, type PlatformFingerprint, type PlatformSignatureDef, detectPlatformFingerprint, matchPlatformSignature };
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/platform-signatures.ts
21
+ var platform_signatures_exports = {};
22
+ __export(platform_signatures_exports, {
23
+ PLATFORM_AGENT_SIGNATURES: () => PLATFORM_AGENT_SIGNATURES,
24
+ detectPlatformFingerprint: () => detectPlatformFingerprint,
25
+ matchPlatformSignature: () => matchPlatformSignature
26
+ });
27
+ module.exports = __toCommonJS(platform_signatures_exports);
28
+ var PLATFORM_AGENT_SIGNATURES = [
29
+ {
30
+ vendor: "claude",
31
+ displayName: "Anthropic Claude",
32
+ uaPatterns: [/claude/i, /anthropic/i],
33
+ agentCardPatterns: [/anthropic\.com/i, /claude\.ai/i],
34
+ apiKeyFormatPatterns: [/^sk-ant/i],
35
+ headerPatterns: [/^anthropic-version/i, /^anthropic-beta/i, /^x-anthropic-/i]
36
+ },
37
+ {
38
+ vendor: "chatgpt",
39
+ displayName: "OpenAI ChatGPT",
40
+ uaPatterns: [/chatgpt/i, /openai/i, /gpt-?\d/i],
41
+ agentCardPatterns: [/openai\.com/i, /chatgpt\.com/i],
42
+ apiKeyFormatPatterns: [/^sk-proj/i, /^sk-svcacct/i],
43
+ headerPatterns: [/^openai-organization/i, /^openai-project/i, /^openai-version/i]
44
+ },
45
+ {
46
+ vendor: "gemini",
47
+ displayName: "Google Gemini",
48
+ uaPatterns: [/gemini/i, /google-gemini/i, /bard/i],
49
+ agentCardPatterns: [/gemini\.google\.com/i, /ai\.google\.dev/i],
50
+ apiKeyFormatPatterns: [/^aiza/i],
51
+ headerPatterns: [/^x-goog-user-project/i, /^x-goog-api-client/i]
52
+ },
53
+ {
54
+ vendor: "cursor",
55
+ displayName: "Cursor",
56
+ uaPatterns: [/cursor/i],
57
+ agentCardPatterns: [/cursor\.sh/i, /cursor\.com/i]
58
+ },
59
+ {
60
+ vendor: "goose",
61
+ displayName: "Block Goose",
62
+ uaPatterns: [/goose/i, /block-goose/i],
63
+ agentCardPatterns: [/block\.xyz\/goose/i, /goose\.tools/i]
64
+ },
65
+ {
66
+ vendor: "perplexity",
67
+ displayName: "Perplexity",
68
+ uaPatterns: [/perplexity/i],
69
+ agentCardPatterns: [/perplexity\.ai/i],
70
+ apiKeyFormatPatterns: [/^pplx-/i]
71
+ }
72
+ ];
73
+ function matchPlatformSignature(signatures, input) {
74
+ const ua = input.userAgent ?? "";
75
+ const cardUrl = input.agentCardUrl ?? "";
76
+ const apiKeyFormat = input.apiKeyFormat ?? "";
77
+ const headerLines = [];
78
+ if (input.platformHeaders) {
79
+ for (const [name, value] of Object.entries(input.platformHeaders)) {
80
+ headerLines.push(name, `${name}: ${value}`);
81
+ }
82
+ }
83
+ for (const sig of signatures) {
84
+ const uaMatch = sig.uaPatterns?.some((p) => p.test(ua));
85
+ const cardMatch = sig.agentCardPatterns?.some((p) => p.test(cardUrl));
86
+ const keyMatch = apiKeyFormat.length > 0 && sig.apiKeyFormatPatterns?.some((p) => p.test(apiKeyFormat));
87
+ const headerMatch = headerLines.length > 0 && sig.headerPatterns?.some((p) => headerLines.some((line) => p.test(line)));
88
+ if (uaMatch || cardMatch || keyMatch || headerMatch) {
89
+ const uaBase = ua.split(/[\s/]/)[0]?.toLowerCase() ?? "";
90
+ const cardHost = (() => {
91
+ try {
92
+ return cardUrl ? new URL(cardUrl).host : "";
93
+ } catch {
94
+ return "";
95
+ }
96
+ })();
97
+ const keyBasis = uaBase || cardHost || apiKeyFormat || "unknown";
98
+ return {
99
+ vendor: sig.vendor,
100
+ fingerprintKey: `${sig.vendor}:${keyBasis}`,
101
+ displayName: sig.displayName
102
+ };
103
+ }
104
+ }
105
+ return void 0;
106
+ }
107
+ function detectPlatformFingerprint(input) {
108
+ return matchPlatformSignature(PLATFORM_AGENT_SIGNATURES, input);
109
+ }
110
+ // Annotate the CommonJS export names for ESM import in node:
111
+ 0 && (module.exports = {
112
+ PLATFORM_AGENT_SIGNATURES,
113
+ detectPlatformFingerprint,
114
+ matchPlatformSignature
115
+ });
116
+ //# sourceMappingURL=platform-signatures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/platform-signatures.ts"],"sourcesContent":["/**\n * Platform-agent fingerprint signatures — the shared registry of known\n * platform-agent UA / agent-card patterns (Claude / ChatGPT / Gemini /\n * Cursor / Goose).\n *\n * Single source of truth, lifted verbatim from the backend's\n * `platform-agent-detector.service` (which now imports detection from\n * here): the backend's verify-access anonymous handler and the edge\n * adapter (`@astrasyncai/adapter-lambda`) must classify identically or\n * the three-tier visibility numbers drift between capture points.\n *\n * Pure regex — no Node built-ins, edge-safe. Detection is regex-only for\n * v2.9 — TLS fingerprinting / behavioural signatures are deferred\n * (recorded in adapter requirements doc).\n */\n\nexport type PlatformAgentVendor =\n | 'claude'\n | 'chatgpt'\n | 'gemini'\n | 'cursor'\n | 'goose'\n | 'perplexity'\n | 'unknown';\n\nexport interface PlatformFingerprint {\n vendor: PlatformAgentVendor;\n /** A stable identifier used as the orphan-agent dedup key. */\n fingerprintKey: string;\n /** Human-readable name surfaced in the admin panel. */\n displayName: string;\n}\n\nexport interface PlatformDetectionInput {\n userAgent?: string;\n agentCardUrl?: string;\n /**\n * Workstream D — a safe API-key format prefix observed on the caller's\n * credential header (e.g. `sk-ant-api03`, `sk-proj`, `aiza`). A strong\n * platform signal; never the secret. Matched against `apiKeyFormatPatterns`.\n */\n apiKeyFormat?: string;\n /**\n * Workstream D — the sanitised platform-signal headers (lowercased names →\n * values), e.g. `openai-organization`, `x-goog-user-project`. Matched\n * against `headerPatterns` (which test on `name` and `name: value`).\n */\n platformHeaders?: Record<string, string>;\n}\n\n/**\n * A signature definition, generic over the vendor key. The seed constant\n * below uses the closed `PlatformAgentVendor` union; DB-promoted signatures\n * (backend dynamic registry, console round) carry arbitrary string vendors —\n * `matchPlatformSignature` accepts both.\n */\nexport interface PlatformSignatureDef<V extends string = string> {\n vendor: V;\n displayName: string;\n uaPatterns?: RegExp[];\n agentCardPatterns?: RegExp[];\n /**\n * Workstream D — patterns tested against an observed API-key format prefix\n * (e.g. `/^sk-ant/i` → claude). A credential-header format is a stronger\n * platform signal than a spoofable User-Agent.\n */\n apiKeyFormatPatterns?: RegExp[];\n /**\n * Workstream D — patterns tested against each observed platform-signal\n * header, as both `name` and `name: value` (so `/openai-organization/i` and\n * `/x-goog-user-project/i` match on presence).\n */\n headerPatterns?: RegExp[];\n}\n\n/**\n * A fingerprint whose vendor may be a dynamically-promoted (non-seed) key.\n * Structurally a superset of `PlatformFingerprint`.\n */\nexport interface DynamicPlatformFingerprint {\n vendor: string;\n fingerprintKey: string;\n displayName: string;\n}\n\n/**\n * Registry of known platform-agent signatures. Order matters — first match wins.\n *\n * Patterns are intentionally permissive (case-insensitive substring match) since\n * platform UA strings drift between versions. False positives are tolerable —\n * the orphan record is informational, not enforcement.\n */\nexport const PLATFORM_AGENT_SIGNATURES: ReadonlyArray<PlatformSignatureDef<PlatformAgentVendor>> = [\n {\n vendor: 'claude',\n displayName: 'Anthropic Claude',\n uaPatterns: [/claude/i, /anthropic/i],\n agentCardPatterns: [/anthropic\\.com/i, /claude\\.ai/i],\n apiKeyFormatPatterns: [/^sk-ant/i],\n headerPatterns: [/^anthropic-version/i, /^anthropic-beta/i, /^x-anthropic-/i],\n },\n {\n vendor: 'chatgpt',\n displayName: 'OpenAI ChatGPT',\n uaPatterns: [/chatgpt/i, /openai/i, /gpt-?\\d/i],\n agentCardPatterns: [/openai\\.com/i, /chatgpt\\.com/i],\n apiKeyFormatPatterns: [/^sk-proj/i, /^sk-svcacct/i],\n headerPatterns: [/^openai-organization/i, /^openai-project/i, /^openai-version/i],\n },\n {\n vendor: 'gemini',\n displayName: 'Google Gemini',\n uaPatterns: [/gemini/i, /google-gemini/i, /bard/i],\n agentCardPatterns: [/gemini\\.google\\.com/i, /ai\\.google\\.dev/i],\n apiKeyFormatPatterns: [/^aiza/i],\n headerPatterns: [/^x-goog-user-project/i, /^x-goog-api-client/i],\n },\n {\n vendor: 'cursor',\n displayName: 'Cursor',\n uaPatterns: [/cursor/i],\n agentCardPatterns: [/cursor\\.sh/i, /cursor\\.com/i],\n },\n {\n vendor: 'goose',\n displayName: 'Block Goose',\n uaPatterns: [/goose/i, /block-goose/i],\n agentCardPatterns: [/block\\.xyz\\/goose/i, /goose\\.tools/i],\n },\n {\n vendor: 'perplexity',\n displayName: 'Perplexity',\n uaPatterns: [/perplexity/i],\n agentCardPatterns: [/perplexity\\.ai/i],\n apiKeyFormatPatterns: [/^pplx-/i],\n },\n];\n\n/**\n * Generic first-match-wins matcher over an arbitrary signature set. The\n * backend's dynamic registry merges the seed constant with DB-promoted\n * signatures and calls this — ONE matching implementation everywhere\n * (fingerprint-key rule included: vendor + lowercased UA basename before\n * the first space/slash, falling back to the agent-card host).\n */\nexport function matchPlatformSignature(\n signatures: ReadonlyArray<PlatformSignatureDef>,\n input: PlatformDetectionInput\n): DynamicPlatformFingerprint | undefined {\n const ua = input.userAgent ?? '';\n const cardUrl = input.agentCardUrl ?? '';\n const apiKeyFormat = input.apiKeyFormat ?? '';\n // Flatten platform headers to `name` and `name: value` lines for matching.\n const headerLines: string[] = [];\n if (input.platformHeaders) {\n for (const [name, value] of Object.entries(input.platformHeaders)) {\n headerLines.push(name, `${name}: ${value}`);\n }\n }\n\n for (const sig of signatures) {\n const uaMatch = sig.uaPatterns?.some((p) => p.test(ua));\n const cardMatch = sig.agentCardPatterns?.some((p) => p.test(cardUrl));\n const keyMatch =\n apiKeyFormat.length > 0 && sig.apiKeyFormatPatterns?.some((p) => p.test(apiKeyFormat));\n const headerMatch =\n headerLines.length > 0 &&\n sig.headerPatterns?.some((p) => headerLines.some((line) => p.test(line)));\n if (uaMatch || cardMatch || keyMatch || headerMatch) {\n const uaBase = ua.split(/[\\s/]/)[0]?.toLowerCase() ?? '';\n const cardHost = (() => {\n try {\n return cardUrl ? new URL(cardUrl).host : '';\n } catch {\n return '';\n }\n })();\n // Prefer a UA/card basename for the dedup key; fall back to the credential\n // format (still a stable per-vendor key) when only a key/header matched.\n const keyBasis = uaBase || cardHost || apiKeyFormat || 'unknown';\n return {\n vendor: sig.vendor,\n fingerprintKey: `${sig.vendor}:${keyBasis}`,\n displayName: sig.displayName,\n };\n }\n }\n\n return undefined;\n}\n\n/**\n * Inspect caller metadata for a known SEED platform-agent fingerprint.\n * Returns undefined if no signature matches. (Backends with the dynamic\n * registry should call `matchPlatformSignature` over their merged set\n * instead — same semantics, live signature additions included.)\n */\nexport function detectPlatformFingerprint(\n input: PlatformDetectionInput\n): PlatformFingerprint | undefined {\n // Seed vendors are all members of the PlatformAgentVendor union, so the\n // narrowing cast is sound by construction.\n return matchPlatformSignature(PLATFORM_AGENT_SIGNATURES, input) as\n | PlatformFingerprint\n | undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA4FO,IAAM,4BAAsF;AAAA,EACjG;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,WAAW,YAAY;AAAA,IACpC,mBAAmB,CAAC,mBAAmB,aAAa;AAAA,IACpD,sBAAsB,CAAC,UAAU;AAAA,IACjC,gBAAgB,CAAC,uBAAuB,oBAAoB,gBAAgB;AAAA,EAC9E;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,YAAY,WAAW,UAAU;AAAA,IAC9C,mBAAmB,CAAC,gBAAgB,eAAe;AAAA,IACnD,sBAAsB,CAAC,aAAa,cAAc;AAAA,IAClD,gBAAgB,CAAC,yBAAyB,oBAAoB,kBAAkB;AAAA,EAClF;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,WAAW,kBAAkB,OAAO;AAAA,IACjD,mBAAmB,CAAC,wBAAwB,kBAAkB;AAAA,IAC9D,sBAAsB,CAAC,QAAQ;AAAA,IAC/B,gBAAgB,CAAC,yBAAyB,qBAAqB;AAAA,EACjE;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,SAAS;AAAA,IACtB,mBAAmB,CAAC,eAAe,cAAc;AAAA,EACnD;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,UAAU,cAAc;AAAA,IACrC,mBAAmB,CAAC,sBAAsB,eAAe;AAAA,EAC3D;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,IACR,aAAa;AAAA,IACb,YAAY,CAAC,aAAa;AAAA,IAC1B,mBAAmB,CAAC,iBAAiB;AAAA,IACrC,sBAAsB,CAAC,SAAS;AAAA,EAClC;AACF;AASO,SAAS,uBACd,YACA,OACwC;AACxC,QAAM,KAAK,MAAM,aAAa;AAC9B,QAAM,UAAU,MAAM,gBAAgB;AACtC,QAAM,eAAe,MAAM,gBAAgB;AAE3C,QAAM,cAAwB,CAAC;AAC/B,MAAI,MAAM,iBAAiB;AACzB,eAAW,CAAC,MAAM,KAAK,KAAK,OAAO,QAAQ,MAAM,eAAe,GAAG;AACjE,kBAAY,KAAK,MAAM,GAAG,IAAI,KAAK,KAAK,EAAE;AAAA,IAC5C;AAAA,EACF;AAEA,aAAW,OAAO,YAAY;AAC5B,UAAM,UAAU,IAAI,YAAY,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;AACtD,UAAM,YAAY,IAAI,mBAAmB,KAAK,CAAC,MAAM,EAAE,KAAK,OAAO,CAAC;AACpE,UAAM,WACJ,aAAa,SAAS,KAAK,IAAI,sBAAsB,KAAK,CAAC,MAAM,EAAE,KAAK,YAAY,CAAC;AACvF,UAAM,cACJ,YAAY,SAAS,KACrB,IAAI,gBAAgB,KAAK,CAAC,MAAM,YAAY,KAAK,CAAC,SAAS,EAAE,KAAK,IAAI,CAAC,CAAC;AAC1E,QAAI,WAAW,aAAa,YAAY,aAAa;AACnD,YAAM,SAAS,GAAG,MAAM,OAAO,EAAE,CAAC,GAAG,YAAY,KAAK;AACtD,YAAM,YAAY,MAAM;AACtB,YAAI;AACF,iBAAO,UAAU,IAAI,IAAI,OAAO,EAAE,OAAO;AAAA,QAC3C,QAAQ;AACN,iBAAO;AAAA,QACT;AAAA,MACF,GAAG;AAGH,YAAM,WAAW,UAAU,YAAY,gBAAgB;AACvD,aAAO;AAAA,QACL,QAAQ,IAAI;AAAA,QACZ,gBAAgB,GAAG,IAAI,MAAM,IAAI,QAAQ;AAAA,QACzC,aAAa,IAAI;AAAA,MACnB;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;AAQO,SAAS,0BACd,OACiC;AAGjC,SAAO,uBAAuB,2BAA2B,KAAK;AAGhE;","names":[]}
@@ -0,0 +1,89 @@
1
+ // src/platform-signatures.ts
2
+ var PLATFORM_AGENT_SIGNATURES = [
3
+ {
4
+ vendor: "claude",
5
+ displayName: "Anthropic Claude",
6
+ uaPatterns: [/claude/i, /anthropic/i],
7
+ agentCardPatterns: [/anthropic\.com/i, /claude\.ai/i],
8
+ apiKeyFormatPatterns: [/^sk-ant/i],
9
+ headerPatterns: [/^anthropic-version/i, /^anthropic-beta/i, /^x-anthropic-/i]
10
+ },
11
+ {
12
+ vendor: "chatgpt",
13
+ displayName: "OpenAI ChatGPT",
14
+ uaPatterns: [/chatgpt/i, /openai/i, /gpt-?\d/i],
15
+ agentCardPatterns: [/openai\.com/i, /chatgpt\.com/i],
16
+ apiKeyFormatPatterns: [/^sk-proj/i, /^sk-svcacct/i],
17
+ headerPatterns: [/^openai-organization/i, /^openai-project/i, /^openai-version/i]
18
+ },
19
+ {
20
+ vendor: "gemini",
21
+ displayName: "Google Gemini",
22
+ uaPatterns: [/gemini/i, /google-gemini/i, /bard/i],
23
+ agentCardPatterns: [/gemini\.google\.com/i, /ai\.google\.dev/i],
24
+ apiKeyFormatPatterns: [/^aiza/i],
25
+ headerPatterns: [/^x-goog-user-project/i, /^x-goog-api-client/i]
26
+ },
27
+ {
28
+ vendor: "cursor",
29
+ displayName: "Cursor",
30
+ uaPatterns: [/cursor/i],
31
+ agentCardPatterns: [/cursor\.sh/i, /cursor\.com/i]
32
+ },
33
+ {
34
+ vendor: "goose",
35
+ displayName: "Block Goose",
36
+ uaPatterns: [/goose/i, /block-goose/i],
37
+ agentCardPatterns: [/block\.xyz\/goose/i, /goose\.tools/i]
38
+ },
39
+ {
40
+ vendor: "perplexity",
41
+ displayName: "Perplexity",
42
+ uaPatterns: [/perplexity/i],
43
+ agentCardPatterns: [/perplexity\.ai/i],
44
+ apiKeyFormatPatterns: [/^pplx-/i]
45
+ }
46
+ ];
47
+ function matchPlatformSignature(signatures, input) {
48
+ const ua = input.userAgent ?? "";
49
+ const cardUrl = input.agentCardUrl ?? "";
50
+ const apiKeyFormat = input.apiKeyFormat ?? "";
51
+ const headerLines = [];
52
+ if (input.platformHeaders) {
53
+ for (const [name, value] of Object.entries(input.platformHeaders)) {
54
+ headerLines.push(name, `${name}: ${value}`);
55
+ }
56
+ }
57
+ for (const sig of signatures) {
58
+ const uaMatch = sig.uaPatterns?.some((p) => p.test(ua));
59
+ const cardMatch = sig.agentCardPatterns?.some((p) => p.test(cardUrl));
60
+ const keyMatch = apiKeyFormat.length > 0 && sig.apiKeyFormatPatterns?.some((p) => p.test(apiKeyFormat));
61
+ const headerMatch = headerLines.length > 0 && sig.headerPatterns?.some((p) => headerLines.some((line) => p.test(line)));
62
+ if (uaMatch || cardMatch || keyMatch || headerMatch) {
63
+ const uaBase = ua.split(/[\s/]/)[0]?.toLowerCase() ?? "";
64
+ const cardHost = (() => {
65
+ try {
66
+ return cardUrl ? new URL(cardUrl).host : "";
67
+ } catch {
68
+ return "";
69
+ }
70
+ })();
71
+ const keyBasis = uaBase || cardHost || apiKeyFormat || "unknown";
72
+ return {
73
+ vendor: sig.vendor,
74
+ fingerprintKey: `${sig.vendor}:${keyBasis}`,
75
+ displayName: sig.displayName
76
+ };
77
+ }
78
+ }
79
+ return void 0;
80
+ }
81
+ function detectPlatformFingerprint(input) {
82
+ return matchPlatformSignature(PLATFORM_AGENT_SIGNATURES, input);
83
+ }
84
+ export {
85
+ PLATFORM_AGENT_SIGNATURES,
86
+ detectPlatformFingerprint,
87
+ matchPlatformSignature
88
+ };
89
+ //# sourceMappingURL=platform-signatures.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/platform-signatures.ts"],"sourcesContent":["/**\n * Platform-agent fingerprint signatures — the shared registry of known\n * platform-agent UA / agent-card patterns (Claude / ChatGPT / Gemini /\n * Cursor / Goose).\n *\n * Single source of truth, lifted verbatim from the backend's\n * `platform-agent-detector.service` (which now imports detection from\n * here): the backend's verify-access anonymous handler and the edge\n * adapter (`@astrasyncai/adapter-lambda`) must classify identically or\n * the three-tier visibility numbers drift between capture points.\n *\n * Pure regex — no Node built-ins, edge-safe. Detection is regex-only for\n * v2.9 — TLS fingerprinting / behavioural signatures are deferred\n * (recorded in adapter requirements doc).\n */\n\nexport type PlatformAgentVendor =\n | 'claude'\n | 'chatgpt'\n | 'gemini'\n | 'cursor'\n | 'goose'\n | 'perplexity'\n | 'unknown';\n\nexport interface PlatformFingerprint {\n vendor: PlatformAgentVendor;\n /** A stable identifier used as the orphan-agent dedup key. */\n fingerprintKey: string;\n /** Human-readable name surfaced in the admin panel. */\n displayName: string;\n}\n\nexport interface PlatformDetectionInput {\n userAgent?: string;\n agentCardUrl?: string;\n /**\n * Workstream D — a safe API-key format prefix observed on the caller's\n * credential header (e.g. `sk-ant-api03`, `sk-proj`, `aiza`). A strong\n * platform signal; never the secret. Matched against `apiKeyFormatPatterns`.\n */\n apiKeyFormat?: string;\n /**\n * Workstream D — the sanitised platform-signal headers (lowercased names →\n * values), e.g. `openai-organization`, `x-goog-user-project`. Matched\n * against `headerPatterns` (which test on `name` and `name: value`).\n */\n platformHeaders?: Record<string, string>;\n}\n\n/**\n * A signature definition, generic over the vendor key. The seed constant\n * below uses the closed `PlatformAgentVendor` union; DB-promoted signatures\n * (backend dynamic registry, console round) carry arbitrary string vendors —\n * `matchPlatformSignature` accepts both.\n */\nexport interface PlatformSignatureDef<V extends string = string> {\n vendor: V;\n displayName: string;\n uaPatterns?: RegExp[];\n agentCardPatterns?: RegExp[];\n /**\n * Workstream D — patterns tested against an observed API-key format prefix\n * (e.g. `/^sk-ant/i` → claude). A credential-header format is a stronger\n * platform signal than a spoofable User-Agent.\n */\n apiKeyFormatPatterns?: RegExp[];\n /**\n * Workstream D — patterns tested against each observed platform-signal\n * header, as both `name` and `name: value` (so `/openai-organization/i` and\n * `/x-goog-user-project/i` match on presence).\n */\n headerPatterns?: RegExp[];\n}\n\n/**\n * A fingerprint whose vendor may be a dynamically-promoted (non-seed) key.\n * Structurally a superset of `PlatformFingerprint`.\n */\nexport interface DynamicPlatformFingerprint {\n vendor: string;\n fingerprintKey: string;\n displayName: string;\n}\n\n/**\n * Registry of known platform-agent signatures. Order matters — first match wins.\n *\n * Patterns are intentionally permissive (case-insensitive substring match) since\n * platform UA strings drift between versions. False positives are tolerable —\n * the orphan record is informational, not enforcement.\n */\nexport const PLATFORM_AGENT_SIGNATURES: ReadonlyArray<PlatformSignatureDef<PlatformAgentVendor>> = [\n {\n vendor: 'claude',\n displayName: 'Anthropic Claude',\n uaPatterns: [/claude/i, /anthropic/i],\n agentCardPatterns: [/anthropic\\.com/i, /claude\\.ai/i],\n apiKeyFormatPatterns: [/^sk-ant/i],\n headerPatterns: [/^anthropic-version/i, /^anthropic-beta/i, /^x-anthropic-/i],\n },\n {\n vendor: 'chatgpt',\n displayName: 'OpenAI ChatGPT',\n uaPatterns: [/chatgpt/i, /openai/i, /gpt-?\\d/i],\n agentCardPatterns: [/openai\\.com/i, /chatgpt\\.com/i],\n apiKeyFormatPatterns: [/^sk-proj/i, /^sk-svcacct/i],\n headerPatterns: [/^openai-organization/i, /^openai-project/i, /^openai-version/i],\n },\n {\n vendor: 'gemini',\n displayName: 'Google Gemini',\n uaPatterns: [/gemini/i, /google-gemini/i, /bard/i],\n agentCardPatterns: [/gemini\\.google\\.com/i, /ai\\.google\\.dev/i],\n apiKeyFormatPatterns: [/^aiza/i],\n headerPatterns: [/^x-goog-user-project/i, /^x-goog-api-client/i],\n },\n {\n vendor: 'cursor',\n displayName: 'Cursor',\n uaPatterns: [/cursor/i],\n agentCardPatterns: [/cursor\\.sh/i, /cursor\\.com/i],\n },\n {\n vendor: 'goose',\n displayName: 'Block Goose',\n uaPatterns: [/goose/i, /block-goose/i],\n agentCardPatterns: [/block\\.xyz\\/goose/i, /goose\\.tools/i],\n },\n {\n vendor: 'perplexity',\n displayName: 'Perplexity',\n uaPatterns: [/perplexity/i],\n agentCardPatterns: [/perplexity\\.ai/i],\n apiKeyFormatPatterns: [/^pplx-/i],\n },\n];\n\n/**\n * Generic first-match-wins matcher over an arbitrary signature set. The\n * backend's dynamic registry merges the seed constant with DB-promoted\n * signatures and calls this — ONE matching implementation everywhere\n * (fingerprint-key rule included: vendor + lowercased UA basename before\n * the first space/slash, falling back to the agent-card host).\n */\nexport function matchPlatformSignature(\n signatures: ReadonlyArray<PlatformSignatureDef>,\n input: PlatformDetectionInput\n): DynamicPlatformFingerprint | undefined {\n const ua = input.userAgent ?? '';\n const cardUrl = input.agentCardUrl ?? '';\n const apiKeyFormat = input.apiKeyFormat ?? '';\n // Flatten platform headers to `name` and `name: value` lines for matching.\n const headerLines: string[] = [];\n if (input.platformHeaders) {\n for (const [name, value] of Object.entries(input.platformHeaders)) {\n headerLines.push(name, `${name}: ${value}`);\n }\n }\n\n for (const sig of signatures) {\n const uaMatch = sig.uaPatterns?.some((p) => p.test(ua));\n const cardMatch = sig.agentCardPatterns?.some((p) => p.test(cardUrl));\n const keyMatch =\n apiKeyFormat.length > 0 && sig.apiKeyFormatPatterns?.some((p) => p.test(apiKeyFormat));\n const headerMatch =\n headerLines.length > 0 &&\n sig.headerPatterns?.some((p) => headerLines.some((line) => p.test(line)));\n if (uaMatch || cardMatch || keyMatch || headerMatch) {\n const uaBase = ua.split(/[\\s/]/)[0]?.toLowerCase() ?? '';\n const cardHost = (() => {\n try {\n return cardUrl ? new URL(cardUrl).host : '';\n } catch {\n return '';\n }\n })();\n // Prefer a UA/card basename for the dedup key; fall back to the credential\n // format (still a stable per-vendor key) when only a key/header matched.\n const keyBasis = uaBase || cardHost || apiKeyFormat || 'unknown';\n return {\n vendor: sig.vendor,\n fingerprintKey: `${sig.vendor}:${keyBasis}`,\n displayName: sig.displayName,\n };\n }\n }\n\n return undefined;\n}\n\n/**\n * Inspect caller metadata for a known SEED platform-agent fingerprint.\n * Returns undefined if no signature matches. (Backends with the dynamic\n * registry should call `matchPlatformSignature` over their merged set\n * instead — same semantics, live signature additions included.)\n */\nexport function detectPlatformFingerprint(\n input: PlatformDetectionInput\n): PlatformFingerprint | undefined {\n // Seed vendors are all members of the PlatformAgentVendor union, so the\n // narrowing cast is sound by construction.\n return matchPlatformSignature(PLATFORM_AGENT_SIGNATURES, input) as\n | PlatformFingerprint\n | undefined;\n}\n"],"mappings":"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","names":[]}
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, p as TrustLevel, S as SDKOptions, q as VerificationResult } from './types-DedAJbNI.mjs';
1
+ import { a as AccessLevel, q as TrustLevel, S as SDKOptions, r as VerificationResult } from './types-sy3tq8lp.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Universal Verification Gateway - Access Level Definitions
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, p as TrustLevel, S as SDKOptions, q as VerificationResult } from './types-DedAJbNI.js';
1
+ import { a as AccessLevel, q as TrustLevel, S as SDKOptions, r as VerificationResult } from './types-9tns4wyl.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Universal Verification Gateway - Access Level Definitions
@@ -1,3 +1,4 @@
1
- import '../types-DedAJbNI.mjs';
2
- export { A as ACPEndpoint, a as ACPPaymentTokenType, b as ACPRequestContext, c as ACPRequestLike, d as ACPSignatureAlgorithm, e as ACPTotal, f as ACPVerifyInput, g as ACPVerifyResult, h as AP2CartMandateClaims, i as AP2ChainResult, j as AP2IntentMandateClaims, k as AP2MandateClaims, l as AP2MandateTriple, m as AP2MandateTripleInput, n as AP2MandateType, o as AP2PaymentDetailsTotal, p as AP2PaymentMandateClaims, q as AP2PaymentMandateForValue, r as AP2VerifyInput, C as CommerceContext, s as CommercePipelineInput, t as CommerceProtocol, u as CommercePurpose, v as CommerceSignatureStack, w as ConstraintEvalResult, x as ConstraintKey, y as ConstraintResult, E as ExtractorRequestLike, I as IdentityBindingResult, z as IdentityClaim, B as IdentityResolver, M as MPPChallengeForValue, D as MPPChallengeSummary, F as MPPCredentialSummary, G as MPPIntent, H as MPPKind, J as MPPReceiptSummary, K as MPPRequestContext, L as MPPRequestLike, N as MPPResponseLike, O as MPPVerifyInput, P as MPPVerifyResult, Q as ParsedRFC9421, R as PaymentMethodAllowlistInput, S as RFC9421SignatureParams, T as RFC9421Tag, U as RFC9421VerifyOptions, V as RFC9421VerifyRequest, W as RFC9421VerifyResult, X as RegistryName, Y as RegistryResolver, Z as ResolveContext, _ as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, $ as SpendingLimitInput, a0 as StripeWebhookInformationalEvent, a1 as TransactionContext, a2 as TransactionValueContext, a3 as TransportExtractor, a4 as UCPCheckoutContext, a5 as UCPManifestValidationResult, a6 as UCPRequestLike, a7 as UCPTotal, a8 as VIAllowedParty, a9 as VIBudgetLimit, aa as VIClaimsForValue, ab as VIConstraintEvalInput, ac as VIConstraints, ad as VIExecutionMode, ae as VIExtractedClaims, af as VILayer, ag as VILineItem, ah as VIMandateType, ai as VIPaymentAmount, aj as VIRecurrence, ak as VIVerifyInput, al as VIVerifyResult, am as VerifyStripeWebhookOptions, an as VerifyStripeWebhookResult, ao as X402Kind, ap as X402RequestContext, aq as X402RequestForValue, ar as X402RequestLike, as as X402RequirementsSummary, at as X402ResponseLike, au as applyCredentials, av as bindIdentity, aw as claim, ax as clearTransportExtractors, ay as createMastercardRegistry, az as createVisaRegistry, aA as createWebBotAuthRegistry, aB as detectProtocol, aC as evaluatePaymentMethodAllowlist, aD as evaluateSpendingLimit, aE as evaluateVIConstraints, aF as extractA2ACredentials, aG as extractACPContext, aH as extractACPTransactionValue, aI as extractAP2Mandate, aJ as extractAP2Mandates, aK as extractAP2TransactionValue, aL as extractCredentialsFromProtocol, aM as extractHttpCredentials, aN as extractMPPContext, aO as extractMPPFromRequest, aP as extractMPPFromResponse, aQ as extractMPPTransactionValue, aR as extractMcpCredentials, aS as extractUCPContext, aT as extractUCPTransactionValue, aU as extractVIClaims, aV as extractVITransactionValue, aW as extractX402Context, aX as extractX402FromRequest, aY as extractX402FromResponse, aZ as extractX402TransactionValue, a_ as fetchUCPManifest, a$ as getTransportExtractor, b0 as getTransportExtractors, b2 as isStripeWebhookInformational, b3 as mapACPRequestToPurpose, b4 as mapAP2MandateToPurpose, b5 as mapMPPRequestToPurpose, b6 as mapRFC9421TagToPurpose, b7 as mapUCPRequestToPurpose, b8 as mapVIMandateToPurpose, b9 as mapX402RequestToPurpose, ba as parseRFC9421, bb as registerTransportExtractor, bc as runCommercePipeline, bd as runMatchingExtractors, be as setA2AMetadata, bf as setHttpHeaders, bg as setMcpMeta, bh as validateUCPManifest, bi as verifyACPSignature, bj as verifyAP2Chain, bk as verifyMPP, bl as verifyRFC9421, bm as verifyStripeWebhook, bn as verifyVIChain } from '../index-CXcvO9Au.mjs';
1
+ import '../types-sy3tq8lp.mjs';
2
+ export { A as ACPEndpoint, a as ACPPaymentTokenType, b as ACPRequestContext, c as ACPRequestLike, d as ACPSignatureAlgorithm, e as ACPTotal, f as ACPVerifyInput, g as ACPVerifyResult, h as AP2CartMandateClaims, i as AP2ChainResult, j as AP2IntentMandateClaims, k as AP2MandateClaims, l as AP2MandateTriple, m as AP2MandateTripleInput, n as AP2MandateType, o as AP2PaymentDetailsTotal, p as AP2PaymentMandateClaims, q as AP2PaymentMandateForValue, r as AP2VerifyInput, C as CommerceContext, s as CommercePipelineInput, t as CommerceProtocol, u as CommercePurpose, v as CommerceSignatureStack, w as ConstraintEvalResult, x as ConstraintKey, y as ConstraintResult, E as ExtractorRequestLike, I as IdentityBindingResult, z as IdentityClaim, B as IdentityResolver, M as MPPChallengeForValue, D as MPPChallengeSummary, F as MPPCredentialSummary, G as MPPIntent, H as MPPKind, J as MPPReceiptSummary, K as MPPRequestContext, L as MPPRequestLike, N as MPPResponseLike, O as MPPVerifyInput, P as MPPVerifyResult, Q as ParsedRFC9421, R as PaymentMethodAllowlistInput, S as RFC9421SignatureParams, T as RFC9421Tag, U as RFC9421VerifyOptions, V as RFC9421VerifyRequest, W as RFC9421VerifyResult, X as RegistryName, Y as RegistryResolver, Z as ResolveContext, _ as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, $ as SpendingLimitInput, a0 as StripeWebhookInformationalEvent, a1 as TransactionContext, a2 as TransactionValueContext, a3 as TransportExtractor, a4 as UCPCheckoutContext, a5 as UCPManifestValidationResult, a6 as UCPRequestLike, a7 as UCPTotal, a8 as VIAllowedParty, a9 as VIBudgetLimit, aa as VIClaimsForValue, ab as VIConstraintEvalInput, ac as VIConstraints, ad as VIExecutionMode, ae as VIExtractedClaims, af as VILayer, ag as VILineItem, ah as VIMandateType, ai as VIPaymentAmount, aj as VIRecurrence, ak as VIVerifyInput, al as VIVerifyResult, am as VerifyStripeWebhookOptions, an as VerifyStripeWebhookResult, ao as X402Kind, ap as X402RequestContext, aq as X402RequestForValue, ar as X402RequestLike, as as X402RequirementsSummary, at as X402ResponseLike, au as applyCredentials, av as bindIdentity, aw as claim, ax as clearTransportExtractors, ay as createMastercardRegistry, az as createVisaRegistry, aA as createWebBotAuthRegistry, aB as detectProtocol, aC as evaluatePaymentMethodAllowlist, aD as evaluateSpendingLimit, aE as evaluateVIConstraints, aF as extractA2ACredentials, aG as extractACPContext, aH as extractACPTransactionValue, aI as extractAP2Mandate, aJ as extractAP2Mandates, aK as extractAP2TransactionValue, aL as extractCredentialsFromProtocol, aM as extractHttpCredentials, aN as extractMPPContext, aO as extractMPPFromRequest, aP as extractMPPFromResponse, aQ as extractMPPTransactionValue, aR as extractMcpCredentials, aS as extractUCPContext, aT as extractUCPTransactionValue, aU as extractVIClaims, aV as extractVITransactionValue, aW as extractX402Context, aX as extractX402FromRequest, aY as extractX402FromResponse, aZ as extractX402TransactionValue, a_ as fetchUCPManifest, a$ as getTransportExtractor, b0 as getTransportExtractors, b2 as isStripeWebhookInformational, b3 as mapACPRequestToPurpose, b4 as mapAP2MandateToPurpose, b5 as mapMPPRequestToPurpose, b6 as mapRFC9421TagToPurpose, b7 as mapUCPRequestToPurpose, b8 as mapVIMandateToPurpose, b9 as mapX402RequestToPurpose, ba as parseRFC9421, bb as registerTransportExtractor, bc as runCommercePipeline, bd as runMatchingExtractors, be as setA2AMetadata, bf as setHttpHeaders, bg as setMcpMeta, bh as validateUCPManifest, bi as verifyACPSignature, bj as verifyAP2Chain, bk as verifyMPP, bl as verifyRFC9421, bm as verifyStripeWebhook, bn as verifyVIChain } from '../index-BrNKDmiR.mjs';
3
+ import '../metadata-capture.mjs';
3
4
  import 'jose';
@@ -1,3 +1,4 @@
1
- import '../types-DedAJbNI.js';
2
- export { A as ACPEndpoint, a as ACPPaymentTokenType, b as ACPRequestContext, c as ACPRequestLike, d as ACPSignatureAlgorithm, e as ACPTotal, f as ACPVerifyInput, g as ACPVerifyResult, h as AP2CartMandateClaims, i as AP2ChainResult, j as AP2IntentMandateClaims, k as AP2MandateClaims, l as AP2MandateTriple, m as AP2MandateTripleInput, n as AP2MandateType, o as AP2PaymentDetailsTotal, p as AP2PaymentMandateClaims, q as AP2PaymentMandateForValue, r as AP2VerifyInput, C as CommerceContext, s as CommercePipelineInput, t as CommerceProtocol, u as CommercePurpose, v as CommerceSignatureStack, w as ConstraintEvalResult, x as ConstraintKey, y as ConstraintResult, E as ExtractorRequestLike, I as IdentityBindingResult, z as IdentityClaim, B as IdentityResolver, M as MPPChallengeForValue, D as MPPChallengeSummary, F as MPPCredentialSummary, G as MPPIntent, H as MPPKind, J as MPPReceiptSummary, K as MPPRequestContext, L as MPPRequestLike, N as MPPResponseLike, O as MPPVerifyInput, P as MPPVerifyResult, Q as ParsedRFC9421, R as PaymentMethodAllowlistInput, S as RFC9421SignatureParams, T as RFC9421Tag, U as RFC9421VerifyOptions, V as RFC9421VerifyRequest, W as RFC9421VerifyResult, X as RegistryName, Y as RegistryResolver, Z as ResolveContext, _ as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, $ as SpendingLimitInput, a0 as StripeWebhookInformationalEvent, a1 as TransactionContext, a2 as TransactionValueContext, a3 as TransportExtractor, a4 as UCPCheckoutContext, a5 as UCPManifestValidationResult, a6 as UCPRequestLike, a7 as UCPTotal, a8 as VIAllowedParty, a9 as VIBudgetLimit, aa as VIClaimsForValue, ab as VIConstraintEvalInput, ac as VIConstraints, ad as VIExecutionMode, ae as VIExtractedClaims, af as VILayer, ag as VILineItem, ah as VIMandateType, ai as VIPaymentAmount, aj as VIRecurrence, ak as VIVerifyInput, al as VIVerifyResult, am as VerifyStripeWebhookOptions, an as VerifyStripeWebhookResult, ao as X402Kind, ap as X402RequestContext, aq as X402RequestForValue, ar as X402RequestLike, as as X402RequirementsSummary, at as X402ResponseLike, au as applyCredentials, av as bindIdentity, aw as claim, ax as clearTransportExtractors, ay as createMastercardRegistry, az as createVisaRegistry, aA as createWebBotAuthRegistry, aB as detectProtocol, aC as evaluatePaymentMethodAllowlist, aD as evaluateSpendingLimit, aE as evaluateVIConstraints, aF as extractA2ACredentials, aG as extractACPContext, aH as extractACPTransactionValue, aI as extractAP2Mandate, aJ as extractAP2Mandates, aK as extractAP2TransactionValue, aL as extractCredentialsFromProtocol, aM as extractHttpCredentials, aN as extractMPPContext, aO as extractMPPFromRequest, aP as extractMPPFromResponse, aQ as extractMPPTransactionValue, aR as extractMcpCredentials, aS as extractUCPContext, aT as extractUCPTransactionValue, aU as extractVIClaims, aV as extractVITransactionValue, aW as extractX402Context, aX as extractX402FromRequest, aY as extractX402FromResponse, aZ as extractX402TransactionValue, a_ as fetchUCPManifest, a$ as getTransportExtractor, b0 as getTransportExtractors, b2 as isStripeWebhookInformational, b3 as mapACPRequestToPurpose, b4 as mapAP2MandateToPurpose, b5 as mapMPPRequestToPurpose, b6 as mapRFC9421TagToPurpose, b7 as mapUCPRequestToPurpose, b8 as mapVIMandateToPurpose, b9 as mapX402RequestToPurpose, ba as parseRFC9421, bb as registerTransportExtractor, bc as runCommercePipeline, bd as runMatchingExtractors, be as setA2AMetadata, bf as setHttpHeaders, bg as setMcpMeta, bh as validateUCPManifest, bi as verifyACPSignature, bj as verifyAP2Chain, bk as verifyMPP, bl as verifyRFC9421, bm as verifyStripeWebhook, bn as verifyVIChain } from '../index-CBQr4FGs.js';
1
+ import '../types-9tns4wyl.js';
2
+ export { A as ACPEndpoint, a as ACPPaymentTokenType, b as ACPRequestContext, c as ACPRequestLike, d as ACPSignatureAlgorithm, e as ACPTotal, f as ACPVerifyInput, g as ACPVerifyResult, h as AP2CartMandateClaims, i as AP2ChainResult, j as AP2IntentMandateClaims, k as AP2MandateClaims, l as AP2MandateTriple, m as AP2MandateTripleInput, n as AP2MandateType, o as AP2PaymentDetailsTotal, p as AP2PaymentMandateClaims, q as AP2PaymentMandateForValue, r as AP2VerifyInput, C as CommerceContext, s as CommercePipelineInput, t as CommerceProtocol, u as CommercePurpose, v as CommerceSignatureStack, w as ConstraintEvalResult, x as ConstraintKey, y as ConstraintResult, E as ExtractorRequestLike, I as IdentityBindingResult, z as IdentityClaim, B as IdentityResolver, M as MPPChallengeForValue, D as MPPChallengeSummary, F as MPPCredentialSummary, G as MPPIntent, H as MPPKind, J as MPPReceiptSummary, K as MPPRequestContext, L as MPPRequestLike, N as MPPResponseLike, O as MPPVerifyInput, P as MPPVerifyResult, Q as ParsedRFC9421, R as PaymentMethodAllowlistInput, S as RFC9421SignatureParams, T as RFC9421Tag, U as RFC9421VerifyOptions, V as RFC9421VerifyRequest, W as RFC9421VerifyResult, X as RegistryName, Y as RegistryResolver, Z as ResolveContext, _ as STRIPE_WEBHOOK_INFORMATIONAL_EVENTS, $ as SpendingLimitInput, a0 as StripeWebhookInformationalEvent, a1 as TransactionContext, a2 as TransactionValueContext, a3 as TransportExtractor, a4 as UCPCheckoutContext, a5 as UCPManifestValidationResult, a6 as UCPRequestLike, a7 as UCPTotal, a8 as VIAllowedParty, a9 as VIBudgetLimit, aa as VIClaimsForValue, ab as VIConstraintEvalInput, ac as VIConstraints, ad as VIExecutionMode, ae as VIExtractedClaims, af as VILayer, ag as VILineItem, ah as VIMandateType, ai as VIPaymentAmount, aj as VIRecurrence, ak as VIVerifyInput, al as VIVerifyResult, am as VerifyStripeWebhookOptions, an as VerifyStripeWebhookResult, ao as X402Kind, ap as X402RequestContext, aq as X402RequestForValue, ar as X402RequestLike, as as X402RequirementsSummary, at as X402ResponseLike, au as applyCredentials, av as bindIdentity, aw as claim, ax as clearTransportExtractors, ay as createMastercardRegistry, az as createVisaRegistry, aA as createWebBotAuthRegistry, aB as detectProtocol, aC as evaluatePaymentMethodAllowlist, aD as evaluateSpendingLimit, aE as evaluateVIConstraints, aF as extractA2ACredentials, aG as extractACPContext, aH as extractACPTransactionValue, aI as extractAP2Mandate, aJ as extractAP2Mandates, aK as extractAP2TransactionValue, aL as extractCredentialsFromProtocol, aM as extractHttpCredentials, aN as extractMPPContext, aO as extractMPPFromRequest, aP as extractMPPFromResponse, aQ as extractMPPTransactionValue, aR as extractMcpCredentials, aS as extractUCPContext, aT as extractUCPTransactionValue, aU as extractVIClaims, aV as extractVITransactionValue, aW as extractX402Context, aX as extractX402FromRequest, aY as extractX402FromResponse, aZ as extractX402TransactionValue, a_ as fetchUCPManifest, a$ as getTransportExtractor, b0 as getTransportExtractors, b2 as isStripeWebhookInformational, b3 as mapACPRequestToPurpose, b4 as mapAP2MandateToPurpose, b5 as mapMPPRequestToPurpose, b6 as mapRFC9421TagToPurpose, b7 as mapUCPRequestToPurpose, b8 as mapVIMandateToPurpose, b9 as mapX402RequestToPurpose, ba as parseRFC9421, bb as registerTransportExtractor, bc as runCommercePipeline, bd as runMatchingExtractors, be as setA2AMetadata, bf as setHttpHeaders, bg as setMcpMeta, bh as validateUCPManifest, bi as verifyACPSignature, bj as verifyAP2Chain, bk as verifyMPP, bl as verifyRFC9421, bm as verifyStripeWebhook, bn as verifyVIChain } from '../index-D2ztkumS.js';
3
+ import '../metadata-capture.js';
3
4
  import 'jose';
@@ -1,8 +1,11 @@
1
+ import { ObservedMetadata } from './metadata-capture.js';
2
+
1
3
  /**
2
4
  * AstraSync Universal Verification Gateway Types
3
5
  *
4
6
  * TypeScript type definitions for agent verification across all counterparty types.
5
7
  */
8
+
6
9
  /**
7
10
  * Trust levels assigned to agents based on their composite trust score
8
11
  */
@@ -498,6 +501,15 @@ interface CallerMetadata {
498
501
  forwardedFor?: string;
499
502
  /** Published agent card URL, if the agent advertised one (future: from agent headers). */
500
503
  agentCardUrl?: string;
504
+ /**
505
+ * The full sanitised view of the agent's inbound request headers + connection
506
+ * signals (Workstream D — maximal metadata capture). Produced by
507
+ * `sanitizeHeaders` (genuine secrets removed, credential headers reduced to a
508
+ * safe format prefix). Forwarded so the endpoint owner sees every wire signal
509
+ * about the agent, not just IP/UA. Local string work only — kept OUT of the
510
+ * verify cache key so per-request maps don't defeat verdict caching.
511
+ */
512
+ observedMetadata?: ObservedMetadata;
501
513
  }
502
514
  interface VerificationRequest {
503
515
  /** Agent credentials */
@@ -560,6 +572,81 @@ interface VerificationRequest {
560
572
  * visibility into transport-vs-intent.
561
573
  */
562
574
  invocationProtocol?: 'rest' | 'mcp' | 'a2a' | 'acp' | 'ap2' | 'mpp' | 'ucp';
575
+ /**
576
+ * 3.9.0 (§33.5 #1) — raw commerce-protocol artifacts forwarded verbatim
577
+ * to verify-access, whose Step 0.5 commerce pipeline runs the full
578
+ * cryptographic verification SERVER-side and persists commerce_context on
579
+ * the session. Adapters forward artifacts, they never verify them locally
580
+ * (bridge-is-transport: verify-access is the sole verification sink, so
581
+ * every decision is recorded once, with events). Shape mirrors the
582
+ * backend's `commerceArtifacts` schema 1:1.
583
+ */
584
+ commerceArtifacts?: CommerceArtifactsPayload;
585
+ }
586
+ /**
587
+ * Raw commerce-protocol artifacts as verify-access accepts them (backend
588
+ * `validation.ts` → `commerceArtifacts`). All optional; send what was
589
+ * detected on the wire.
590
+ */
591
+ interface CommerceArtifactsPayload {
592
+ /** Compact VI SD-JWT. */
593
+ viSdJwt?: string;
594
+ /** AP2 mandate triple as compact SD-JWTs. */
595
+ ap2Mandates?: {
596
+ intent?: string;
597
+ cart?: string;
598
+ payment?: string;
599
+ };
600
+ /** RFC 9421 signed request (Agent Pay / TAP / Web Bot Auth). */
601
+ rfc9421?: {
602
+ headers: Record<string, string | string[]>;
603
+ method: string;
604
+ url: string;
605
+ body?: string;
606
+ tag?: string;
607
+ };
608
+ /** UCP checkout session request. */
609
+ ucpRequest?: {
610
+ method: string;
611
+ url: string;
612
+ body?: unknown;
613
+ };
614
+ /** ACP request (HMAC-signed webhook or checkout body). */
615
+ acpRequest?: {
616
+ method: string;
617
+ url: string;
618
+ headers?: Record<string, string | string[]>;
619
+ body?: unknown;
620
+ rawBody?: string;
621
+ };
622
+ mppRequest?: {
623
+ method: string;
624
+ url: string;
625
+ headers: Record<string, string | string[]>;
626
+ body?: unknown;
627
+ rawBody?: string;
628
+ };
629
+ mppResponse?: {
630
+ status: number;
631
+ headers: Record<string, string | string[]>;
632
+ body?: unknown;
633
+ };
634
+ x402Request?: {
635
+ method?: string;
636
+ url?: string;
637
+ headers?: Record<string, string | string[]>;
638
+ body?: unknown;
639
+ };
640
+ x402Response?: {
641
+ status?: number;
642
+ headers?: Record<string, string | string[]>;
643
+ body?: unknown;
644
+ };
645
+ stripeWebhook?: {
646
+ payload: string;
647
+ signatureHeader: string;
648
+ secret: string;
649
+ };
563
650
  }
564
651
  /**
565
652
  * Route-specific access configuration
@@ -842,4 +929,4 @@ interface CommerceShieldProps {
842
929
  className?: string;
843
930
  }
844
931
 
845
- export type { AccessFailure as A, CommerceShieldProps as C, EnhancedVerificationResult as E, FiatSettlementBinding as F, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationRequest as V, AccessLevel as a, AgentCredentials as b, AstraSyncCredentials as c, CounterpartyType as d, ExpressMiddlewareOptions as e, GuidanceInfo as f, ProtocolTransport as g, RuntimeChallengeResult as h, SettlementArtifact as i, SettlementArtifactBinding as j, SettlementArtifactBindingBase as k, StablecoinSettlementBinding as l, StepUpApprovalInfo as m, StepUpApprovalStatus as n, StepUpOutcome as o, TrustLevel as p, VerificationResult as q, VerifiedAgent as r, VerifiedDeveloper as s, VerifiedOrganization as t };
932
+ export type { AccessFailure as A, CommerceArtifactsPayload as C, EnhancedVerificationResult as E, FiatSettlementBinding as F, GatewayConfig as G, NextJsMiddlewareOptions as N, PDLSSInfo as P, RouteAccessConfig as R, SDKOptions as S, TokenGuidance as T, VerificationRequest as V, AccessLevel as a, AgentCredentials as b, AstraSyncCredentials as c, CommerceShieldProps as d, CounterpartyType as e, ExpressMiddlewareOptions as f, GuidanceInfo as g, ProtocolTransport as h, RuntimeChallengeResult as i, SettlementArtifact as j, SettlementArtifactBinding as k, SettlementArtifactBindingBase as l, StablecoinSettlementBinding as m, StepUpApprovalInfo as n, StepUpApprovalStatus as o, StepUpOutcome as p, TrustLevel as q, VerificationResult as r, VerifiedAgent as s, VerifiedDeveloper as t, VerifiedOrganization as u };
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, d as CounterpartyType, T as TokenGuidance } from './types-DedAJbNI.mjs';
1
+ import { a as AccessLevel, e as CounterpartyType, T as TokenGuidance } from './types-sy3tq8lp.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.
@@ -1,4 +1,4 @@
1
- import { a as AccessLevel, d as CounterpartyType, T as TokenGuidance } from './types-DedAJbNI.js';
1
+ import { a as AccessLevel, e as CounterpartyType, T as TokenGuidance } from './types-9tns4wyl.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Gateway - Types for gateway modes, local evaluation, and adapter interface.