@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,81 @@
1
+ /**
2
+ * Shared purpose/action resolver for the HTTP adapters (express + nextjs) —
3
+ * vocabulary-unification round (Bug 14, adapter-spec §4.6).
4
+ *
5
+ * The PDLSS two-axis contract: `purpose` = bare category noun (`shopping`,
6
+ * `data`, custom nouns like `trading`); `action` = dotted verb
7
+ * (`shopping.search`) or an enumerated transport token. Transport verbs
8
+ * (GET/POST/...) NEVER travel as PDLSS actions — they map through the pinned
9
+ * method table below.
10
+ *
11
+ * SELF-CONTAINED on purpose: this published package cannot depend on the
12
+ * private @astrasyncai/pdlss-vocab workspace package, so the constants are
13
+ * duplicated here and pinned strictly equal by a monorepo CI test
14
+ * (vocab-equality.test.ts). Change them in BOTH places or that test fails.
15
+ */
16
+ /** Pinned method→action derivation table (§4.6). */
17
+ declare const HTTP_METHOD_ACTION_TABLE: Readonly<Record<string, string>>;
18
+ /** Unknown methods are treated as mutating until proven otherwise. */
19
+ declare const DEFAULT_HTTP_ACTION = "data.write";
20
+ /** Generic category emitted when nothing supplies a domain purpose. */
21
+ declare const DEFAULT_HTTP_PURPOSE = "data";
22
+ declare function actionForHttpMethod(method: string): string;
23
+ type HttpPurposeSource = 'route_config' | 'custom_extractor' | 'header' | 'legacy_header' | 'query' | 'action_derived' | 'transport_default';
24
+ type HttpActionSource = 'route_config' | 'custom_extractor' | 'header' | 'purpose_header_derived' | 'method_table';
25
+ interface HttpPdlssInput {
26
+ method: string;
27
+ /** `X-Astra-Purpose` header value (agent's declaration). */
28
+ astraPurpose?: string;
29
+ /** `X-Astra-Action` header value (agent's declaration, symmetric with MCP). */
30
+ astraAction?: string;
31
+ /** Legacy `x-purpose` header — deprecated, removal scheduled for 4.0.0. */
32
+ legacyPurpose?: string;
33
+ /** Legacy `?purpose` query param (express only) — deprecated, removal 4.0.0. */
34
+ queryPurpose?: string;
35
+ /** Dashboard route config send-mapping (RouteAccessConfig.purpose/.action). */
36
+ routePurpose?: string;
37
+ routeAction?: string;
38
+ /** Results of the merchant's extractPurpose/extractAction options. */
39
+ customPurpose?: string;
40
+ hasCustomPurposeExtractor?: boolean;
41
+ customAction?: string;
42
+ hasCustomActionExtractor?: boolean;
43
+ }
44
+ interface HttpPdlssResolution {
45
+ purpose: string;
46
+ action: string;
47
+ purposeSource: HttpPurposeSource;
48
+ actionSource: HttpActionSource;
49
+ }
50
+ /**
51
+ * Normalize an `X-Astra-Purpose` header value.
52
+ * - colon form `"category:action"` (legacy wire shape): take the prefix; the
53
+ * remainder is free-text and exists in no vocabulary — discard it and let
54
+ * the method table supply the action (matches pre-3.1.0 discard behavior).
55
+ * - dotted form `"shopping.purchase"` (the shape older docs taught): prefix
56
+ * becomes the purpose, the WHOLE token becomes an action candidate.
57
+ * - bare token: purpose verbatim.
58
+ */
59
+ declare function normalizePurposeHeader(value: string): {
60
+ purpose: string;
61
+ actionCandidate?: string;
62
+ };
63
+ /**
64
+ * Resolve the {purpose, action} pair for one HTTP request.
65
+ *
66
+ * Precedence (both axes; §4.6):
67
+ * action: route mapping → extractAction option → X-Astra-Action header →
68
+ * candidate from a dotted X-Astra-Purpose → pinned method table
69
+ * purpose: route mapping → extractPurpose option → X-Astra-Purpose →
70
+ * legacy x-purpose / ?purpose → category prefix of the resolved
71
+ * action → 'data'
72
+ *
73
+ * A configured custom extractor masks the header/legacy/query steps of its
74
+ * axis (it replaces the default chain, as extractPurpose always has); when it
75
+ * returns undefined the axis falls through to the table/prefix fallback.
76
+ * The route mapping is merchant policy fetched from the dashboard — it
77
+ * outranks agent-supplied headers the way MCP toolGates do.
78
+ */
79
+ declare function resolveHttpPdlss(input: HttpPdlssInput): HttpPdlssResolution;
80
+
81
+ export { DEFAULT_HTTP_ACTION, DEFAULT_HTTP_PURPOSE, HTTP_METHOD_ACTION_TABLE, type HttpActionSource, type HttpPdlssInput, type HttpPdlssResolution, type HttpPurposeSource, actionForHttpMethod, normalizePurposeHeader, resolveHttpPdlss };
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Shared purpose/action resolver for the HTTP adapters (express + nextjs) —
3
+ * vocabulary-unification round (Bug 14, adapter-spec §4.6).
4
+ *
5
+ * The PDLSS two-axis contract: `purpose` = bare category noun (`shopping`,
6
+ * `data`, custom nouns like `trading`); `action` = dotted verb
7
+ * (`shopping.search`) or an enumerated transport token. Transport verbs
8
+ * (GET/POST/...) NEVER travel as PDLSS actions — they map through the pinned
9
+ * method table below.
10
+ *
11
+ * SELF-CONTAINED on purpose: this published package cannot depend on the
12
+ * private @astrasyncai/pdlss-vocab workspace package, so the constants are
13
+ * duplicated here and pinned strictly equal by a monorepo CI test
14
+ * (vocab-equality.test.ts). Change them in BOTH places or that test fails.
15
+ */
16
+ /** Pinned method→action derivation table (§4.6). */
17
+ declare const HTTP_METHOD_ACTION_TABLE: Readonly<Record<string, string>>;
18
+ /** Unknown methods are treated as mutating until proven otherwise. */
19
+ declare const DEFAULT_HTTP_ACTION = "data.write";
20
+ /** Generic category emitted when nothing supplies a domain purpose. */
21
+ declare const DEFAULT_HTTP_PURPOSE = "data";
22
+ declare function actionForHttpMethod(method: string): string;
23
+ type HttpPurposeSource = 'route_config' | 'custom_extractor' | 'header' | 'legacy_header' | 'query' | 'action_derived' | 'transport_default';
24
+ type HttpActionSource = 'route_config' | 'custom_extractor' | 'header' | 'purpose_header_derived' | 'method_table';
25
+ interface HttpPdlssInput {
26
+ method: string;
27
+ /** `X-Astra-Purpose` header value (agent's declaration). */
28
+ astraPurpose?: string;
29
+ /** `X-Astra-Action` header value (agent's declaration, symmetric with MCP). */
30
+ astraAction?: string;
31
+ /** Legacy `x-purpose` header — deprecated, removal scheduled for 4.0.0. */
32
+ legacyPurpose?: string;
33
+ /** Legacy `?purpose` query param (express only) — deprecated, removal 4.0.0. */
34
+ queryPurpose?: string;
35
+ /** Dashboard route config send-mapping (RouteAccessConfig.purpose/.action). */
36
+ routePurpose?: string;
37
+ routeAction?: string;
38
+ /** Results of the merchant's extractPurpose/extractAction options. */
39
+ customPurpose?: string;
40
+ hasCustomPurposeExtractor?: boolean;
41
+ customAction?: string;
42
+ hasCustomActionExtractor?: boolean;
43
+ }
44
+ interface HttpPdlssResolution {
45
+ purpose: string;
46
+ action: string;
47
+ purposeSource: HttpPurposeSource;
48
+ actionSource: HttpActionSource;
49
+ }
50
+ /**
51
+ * Normalize an `X-Astra-Purpose` header value.
52
+ * - colon form `"category:action"` (legacy wire shape): take the prefix; the
53
+ * remainder is free-text and exists in no vocabulary — discard it and let
54
+ * the method table supply the action (matches pre-3.1.0 discard behavior).
55
+ * - dotted form `"shopping.purchase"` (the shape older docs taught): prefix
56
+ * becomes the purpose, the WHOLE token becomes an action candidate.
57
+ * - bare token: purpose verbatim.
58
+ */
59
+ declare function normalizePurposeHeader(value: string): {
60
+ purpose: string;
61
+ actionCandidate?: string;
62
+ };
63
+ /**
64
+ * Resolve the {purpose, action} pair for one HTTP request.
65
+ *
66
+ * Precedence (both axes; §4.6):
67
+ * action: route mapping → extractAction option → X-Astra-Action header →
68
+ * candidate from a dotted X-Astra-Purpose → pinned method table
69
+ * purpose: route mapping → extractPurpose option → X-Astra-Purpose →
70
+ * legacy x-purpose / ?purpose → category prefix of the resolved
71
+ * action → 'data'
72
+ *
73
+ * A configured custom extractor masks the header/legacy/query steps of its
74
+ * axis (it replaces the default chain, as extractPurpose always has); when it
75
+ * returns undefined the axis falls through to the table/prefix fallback.
76
+ * The route mapping is merchant policy fetched from the dashboard — it
77
+ * outranks agent-supplied headers the way MCP toolGates do.
78
+ */
79
+ declare function resolveHttpPdlss(input: HttpPdlssInput): HttpPdlssResolution;
80
+
81
+ export { DEFAULT_HTTP_ACTION, DEFAULT_HTTP_PURPOSE, HTTP_METHOD_ACTION_TABLE, type HttpActionSource, type HttpPdlssInput, type HttpPdlssResolution, type HttpPurposeSource, actionForHttpMethod, normalizePurposeHeader, resolveHttpPdlss };
@@ -0,0 +1,117 @@
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/adapters/http-pdlss.ts
21
+ var http_pdlss_exports = {};
22
+ __export(http_pdlss_exports, {
23
+ DEFAULT_HTTP_ACTION: () => DEFAULT_HTTP_ACTION,
24
+ DEFAULT_HTTP_PURPOSE: () => DEFAULT_HTTP_PURPOSE,
25
+ HTTP_METHOD_ACTION_TABLE: () => HTTP_METHOD_ACTION_TABLE,
26
+ actionForHttpMethod: () => actionForHttpMethod,
27
+ normalizePurposeHeader: () => normalizePurposeHeader,
28
+ resolveHttpPdlss: () => resolveHttpPdlss
29
+ });
30
+ module.exports = __toCommonJS(http_pdlss_exports);
31
+ var HTTP_METHOD_ACTION_TABLE = {
32
+ GET: "data.read",
33
+ HEAD: "data.read",
34
+ OPTIONS: "data.read",
35
+ POST: "data.write",
36
+ PUT: "data.write",
37
+ PATCH: "data.write",
38
+ DELETE: "data.delete"
39
+ };
40
+ var DEFAULT_HTTP_ACTION = "data.write";
41
+ var DEFAULT_HTTP_PURPOSE = "data";
42
+ function actionForHttpMethod(method) {
43
+ return HTTP_METHOD_ACTION_TABLE[method.toUpperCase()] ?? DEFAULT_HTTP_ACTION;
44
+ }
45
+ function normalizePurposeHeader(value) {
46
+ const colon = value.indexOf(":");
47
+ if (colon >= 0) {
48
+ return { purpose: value.slice(0, colon) };
49
+ }
50
+ const dot = value.indexOf(".");
51
+ if (dot > 0 && dot < value.length - 1) {
52
+ return { purpose: value.slice(0, dot), actionCandidate: value };
53
+ }
54
+ return { purpose: value };
55
+ }
56
+ function resolveHttpPdlss(input) {
57
+ const fromHeader = input.astraPurpose ? normalizePurposeHeader(input.astraPurpose) : void 0;
58
+ let action;
59
+ let actionSource;
60
+ if (input.routeAction) {
61
+ action = input.routeAction;
62
+ actionSource = "route_config";
63
+ } else if (input.hasCustomActionExtractor && input.customAction) {
64
+ action = input.customAction;
65
+ actionSource = "custom_extractor";
66
+ } else if (!input.hasCustomActionExtractor && input.astraAction) {
67
+ action = input.astraAction;
68
+ actionSource = "header";
69
+ } else if (!input.hasCustomActionExtractor && fromHeader?.actionCandidate) {
70
+ action = fromHeader.actionCandidate;
71
+ actionSource = "purpose_header_derived";
72
+ } else {
73
+ action = actionForHttpMethod(input.method);
74
+ actionSource = "method_table";
75
+ }
76
+ let purpose;
77
+ let purposeSource;
78
+ if (input.routePurpose) {
79
+ purpose = input.routePurpose;
80
+ purposeSource = "route_config";
81
+ } else if (input.hasCustomPurposeExtractor) {
82
+ if (input.customPurpose) {
83
+ purpose = input.customPurpose;
84
+ purposeSource = "custom_extractor";
85
+ }
86
+ } else if (fromHeader) {
87
+ purpose = fromHeader.purpose;
88
+ purposeSource = "header";
89
+ } else if (input.legacyPurpose) {
90
+ purpose = input.legacyPurpose;
91
+ purposeSource = "legacy_header";
92
+ } else if (input.queryPurpose) {
93
+ purpose = input.queryPurpose;
94
+ purposeSource = "query";
95
+ }
96
+ if (!purpose) {
97
+ const dot = action.indexOf(".");
98
+ if (dot > 0) {
99
+ purpose = action.slice(0, dot);
100
+ purposeSource = "action_derived";
101
+ } else {
102
+ purpose = DEFAULT_HTTP_PURPOSE;
103
+ purposeSource = "transport_default";
104
+ }
105
+ }
106
+ return { purpose, action, purposeSource, actionSource };
107
+ }
108
+ // Annotate the CommonJS export names for ESM import in node:
109
+ 0 && (module.exports = {
110
+ DEFAULT_HTTP_ACTION,
111
+ DEFAULT_HTTP_PURPOSE,
112
+ HTTP_METHOD_ACTION_TABLE,
113
+ actionForHttpMethod,
114
+ normalizePurposeHeader,
115
+ resolveHttpPdlss
116
+ });
117
+ //# sourceMappingURL=http-pdlss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/http-pdlss.ts"],"sourcesContent":["/**\n * Shared purpose/action resolver for the HTTP adapters (express + nextjs) —\n * vocabulary-unification round (Bug 14, adapter-spec §4.6).\n *\n * The PDLSS two-axis contract: `purpose` = bare category noun (`shopping`,\n * `data`, custom nouns like `trading`); `action` = dotted verb\n * (`shopping.search`) or an enumerated transport token. Transport verbs\n * (GET/POST/...) NEVER travel as PDLSS actions — they map through the pinned\n * method table below.\n *\n * SELF-CONTAINED on purpose: this published package cannot depend on the\n * private @astrasyncai/pdlss-vocab workspace package, so the constants are\n * duplicated here and pinned strictly equal by a monorepo CI test\n * (vocab-equality.test.ts). Change them in BOTH places or that test fails.\n */\n\n/** Pinned method→action derivation table (§4.6). */\nexport const HTTP_METHOD_ACTION_TABLE: Readonly<Record<string, string>> = {\n GET: 'data.read',\n HEAD: 'data.read',\n OPTIONS: 'data.read',\n POST: 'data.write',\n PUT: 'data.write',\n PATCH: 'data.write',\n DELETE: 'data.delete',\n};\n\n/** Unknown methods are treated as mutating until proven otherwise. */\nexport const DEFAULT_HTTP_ACTION = 'data.write';\n\n/** Generic category emitted when nothing supplies a domain purpose. */\nexport const DEFAULT_HTTP_PURPOSE = 'data';\n\nexport function actionForHttpMethod(method: string): string {\n return HTTP_METHOD_ACTION_TABLE[method.toUpperCase()] ?? DEFAULT_HTTP_ACTION;\n}\n\nexport type HttpPurposeSource =\n | 'route_config'\n | 'custom_extractor'\n | 'header'\n | 'legacy_header'\n | 'query'\n | 'action_derived'\n | 'transport_default';\n\nexport type HttpActionSource =\n | 'route_config'\n | 'custom_extractor'\n | 'header'\n | 'purpose_header_derived'\n | 'method_table';\n\nexport interface HttpPdlssInput {\n method: string;\n /** `X-Astra-Purpose` header value (agent's declaration). */\n astraPurpose?: string;\n /** `X-Astra-Action` header value (agent's declaration, symmetric with MCP). */\n astraAction?: string;\n /** Legacy `x-purpose` header — deprecated, removal scheduled for 4.0.0. */\n legacyPurpose?: string;\n /** Legacy `?purpose` query param (express only) — deprecated, removal 4.0.0. */\n queryPurpose?: string;\n /** Dashboard route config send-mapping (RouteAccessConfig.purpose/.action). */\n routePurpose?: string;\n routeAction?: string;\n /** Results of the merchant's extractPurpose/extractAction options. */\n customPurpose?: string;\n hasCustomPurposeExtractor?: boolean;\n customAction?: string;\n hasCustomActionExtractor?: boolean;\n}\n\nexport interface HttpPdlssResolution {\n purpose: string;\n action: string;\n purposeSource: HttpPurposeSource;\n actionSource: HttpActionSource;\n}\n\n/**\n * Normalize an `X-Astra-Purpose` header value.\n * - colon form `\"category:action\"` (legacy wire shape): take the prefix; the\n * remainder is free-text and exists in no vocabulary — discard it and let\n * the method table supply the action (matches pre-3.1.0 discard behavior).\n * - dotted form `\"shopping.purchase\"` (the shape older docs taught): prefix\n * becomes the purpose, the WHOLE token becomes an action candidate.\n * - bare token: purpose verbatim.\n */\nexport function normalizePurposeHeader(value: string): {\n purpose: string;\n actionCandidate?: string;\n} {\n const colon = value.indexOf(':');\n if (colon >= 0) {\n return { purpose: value.slice(0, colon) };\n }\n const dot = value.indexOf('.');\n if (dot > 0 && dot < value.length - 1) {\n return { purpose: value.slice(0, dot), actionCandidate: value };\n }\n return { purpose: value };\n}\n\n/**\n * Resolve the {purpose, action} pair for one HTTP request.\n *\n * Precedence (both axes; §4.6):\n * action: route mapping → extractAction option → X-Astra-Action header →\n * candidate from a dotted X-Astra-Purpose → pinned method table\n * purpose: route mapping → extractPurpose option → X-Astra-Purpose →\n * legacy x-purpose / ?purpose → category prefix of the resolved\n * action → 'data'\n *\n * A configured custom extractor masks the header/legacy/query steps of its\n * axis (it replaces the default chain, as extractPurpose always has); when it\n * returns undefined the axis falls through to the table/prefix fallback.\n * The route mapping is merchant policy fetched from the dashboard — it\n * outranks agent-supplied headers the way MCP toolGates do.\n */\nexport function resolveHttpPdlss(input: HttpPdlssInput): HttpPdlssResolution {\n const fromHeader = input.astraPurpose ? normalizePurposeHeader(input.astraPurpose) : undefined;\n\n // ── Action axis ──\n let action: string;\n let actionSource: HttpActionSource;\n if (input.routeAction) {\n action = input.routeAction;\n actionSource = 'route_config';\n } else if (input.hasCustomActionExtractor && input.customAction) {\n action = input.customAction;\n actionSource = 'custom_extractor';\n } else if (!input.hasCustomActionExtractor && input.astraAction) {\n action = input.astraAction;\n actionSource = 'header';\n } else if (!input.hasCustomActionExtractor && fromHeader?.actionCandidate) {\n action = fromHeader.actionCandidate;\n actionSource = 'purpose_header_derived';\n } else {\n action = actionForHttpMethod(input.method);\n actionSource = 'method_table';\n }\n\n // ── Purpose axis ──\n let purpose: string | undefined;\n let purposeSource: HttpPurposeSource | undefined;\n if (input.routePurpose) {\n purpose = input.routePurpose;\n purposeSource = 'route_config';\n } else if (input.hasCustomPurposeExtractor) {\n if (input.customPurpose) {\n purpose = input.customPurpose;\n purposeSource = 'custom_extractor';\n }\n } else if (fromHeader) {\n purpose = fromHeader.purpose;\n purposeSource = 'header';\n } else if (input.legacyPurpose) {\n purpose = input.legacyPurpose;\n purposeSource = 'legacy_header';\n } else if (input.queryPurpose) {\n purpose = input.queryPurpose;\n purposeSource = 'query';\n }\n\n if (!purpose) {\n // Keep the pair coherent: an agent that sent only X-Astra-Action (or a\n // route that mapped only the action) gets that action's own category.\n const dot = action.indexOf('.');\n if (dot > 0) {\n purpose = action.slice(0, dot);\n purposeSource = 'action_derived';\n } else {\n purpose = DEFAULT_HTTP_PURPOSE;\n purposeSource = 'transport_default';\n }\n }\n\n return { purpose, action, purposeSource: purposeSource!, actionSource };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBO,IAAM,2BAA6D;AAAA,EACxE,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AACV;AAGO,IAAM,sBAAsB;AAG5B,IAAM,uBAAuB;AAE7B,SAAS,oBAAoB,QAAwB;AAC1D,SAAO,yBAAyB,OAAO,YAAY,CAAC,KAAK;AAC3D;AAsDO,SAAS,uBAAuB,OAGrC;AACA,QAAM,QAAQ,MAAM,QAAQ,GAAG;AAC/B,MAAI,SAAS,GAAG;AACd,WAAO,EAAE,SAAS,MAAM,MAAM,GAAG,KAAK,EAAE;AAAA,EAC1C;AACA,QAAM,MAAM,MAAM,QAAQ,GAAG;AAC7B,MAAI,MAAM,KAAK,MAAM,MAAM,SAAS,GAAG;AACrC,WAAO,EAAE,SAAS,MAAM,MAAM,GAAG,GAAG,GAAG,iBAAiB,MAAM;AAAA,EAChE;AACA,SAAO,EAAE,SAAS,MAAM;AAC1B;AAkBO,SAAS,iBAAiB,OAA4C;AAC3E,QAAM,aAAa,MAAM,eAAe,uBAAuB,MAAM,YAAY,IAAI;AAGrF,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM,aAAa;AACrB,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,MAAM,4BAA4B,MAAM,cAAc;AAC/D,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,CAAC,MAAM,4BAA4B,MAAM,aAAa;AAC/D,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,CAAC,MAAM,4BAA4B,YAAY,iBAAiB;AACzE,aAAS,WAAW;AACpB,mBAAe;AAAA,EACjB,OAAO;AACL,aAAS,oBAAoB,MAAM,MAAM;AACzC,mBAAe;AAAA,EACjB;AAGA,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM,cAAc;AACtB,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB,WAAW,MAAM,2BAA2B;AAC1C,QAAI,MAAM,eAAe;AACvB,gBAAU,MAAM;AAChB,sBAAgB;AAAA,IAClB;AAAA,EACF,WAAW,YAAY;AACrB,cAAU,WAAW;AACrB,oBAAgB;AAAA,EAClB,WAAW,MAAM,eAAe;AAC9B,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB,WAAW,MAAM,cAAc;AAC7B,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB;AAEA,MAAI,CAAC,SAAS;AAGZ,UAAM,MAAM,OAAO,QAAQ,GAAG;AAC9B,QAAI,MAAM,GAAG;AACX,gBAAU,OAAO,MAAM,GAAG,GAAG;AAC7B,sBAAgB;AAAA,IAClB,OAAO;AACL,gBAAU;AACV,sBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,QAAQ,eAA+B,aAAa;AACxE;","names":[]}
@@ -0,0 +1,87 @@
1
+ // src/adapters/http-pdlss.ts
2
+ var HTTP_METHOD_ACTION_TABLE = {
3
+ GET: "data.read",
4
+ HEAD: "data.read",
5
+ OPTIONS: "data.read",
6
+ POST: "data.write",
7
+ PUT: "data.write",
8
+ PATCH: "data.write",
9
+ DELETE: "data.delete"
10
+ };
11
+ var DEFAULT_HTTP_ACTION = "data.write";
12
+ var DEFAULT_HTTP_PURPOSE = "data";
13
+ function actionForHttpMethod(method) {
14
+ return HTTP_METHOD_ACTION_TABLE[method.toUpperCase()] ?? DEFAULT_HTTP_ACTION;
15
+ }
16
+ function normalizePurposeHeader(value) {
17
+ const colon = value.indexOf(":");
18
+ if (colon >= 0) {
19
+ return { purpose: value.slice(0, colon) };
20
+ }
21
+ const dot = value.indexOf(".");
22
+ if (dot > 0 && dot < value.length - 1) {
23
+ return { purpose: value.slice(0, dot), actionCandidate: value };
24
+ }
25
+ return { purpose: value };
26
+ }
27
+ function resolveHttpPdlss(input) {
28
+ const fromHeader = input.astraPurpose ? normalizePurposeHeader(input.astraPurpose) : void 0;
29
+ let action;
30
+ let actionSource;
31
+ if (input.routeAction) {
32
+ action = input.routeAction;
33
+ actionSource = "route_config";
34
+ } else if (input.hasCustomActionExtractor && input.customAction) {
35
+ action = input.customAction;
36
+ actionSource = "custom_extractor";
37
+ } else if (!input.hasCustomActionExtractor && input.astraAction) {
38
+ action = input.astraAction;
39
+ actionSource = "header";
40
+ } else if (!input.hasCustomActionExtractor && fromHeader?.actionCandidate) {
41
+ action = fromHeader.actionCandidate;
42
+ actionSource = "purpose_header_derived";
43
+ } else {
44
+ action = actionForHttpMethod(input.method);
45
+ actionSource = "method_table";
46
+ }
47
+ let purpose;
48
+ let purposeSource;
49
+ if (input.routePurpose) {
50
+ purpose = input.routePurpose;
51
+ purposeSource = "route_config";
52
+ } else if (input.hasCustomPurposeExtractor) {
53
+ if (input.customPurpose) {
54
+ purpose = input.customPurpose;
55
+ purposeSource = "custom_extractor";
56
+ }
57
+ } else if (fromHeader) {
58
+ purpose = fromHeader.purpose;
59
+ purposeSource = "header";
60
+ } else if (input.legacyPurpose) {
61
+ purpose = input.legacyPurpose;
62
+ purposeSource = "legacy_header";
63
+ } else if (input.queryPurpose) {
64
+ purpose = input.queryPurpose;
65
+ purposeSource = "query";
66
+ }
67
+ if (!purpose) {
68
+ const dot = action.indexOf(".");
69
+ if (dot > 0) {
70
+ purpose = action.slice(0, dot);
71
+ purposeSource = "action_derived";
72
+ } else {
73
+ purpose = DEFAULT_HTTP_PURPOSE;
74
+ purposeSource = "transport_default";
75
+ }
76
+ }
77
+ return { purpose, action, purposeSource, actionSource };
78
+ }
79
+ export {
80
+ DEFAULT_HTTP_ACTION,
81
+ DEFAULT_HTTP_PURPOSE,
82
+ HTTP_METHOD_ACTION_TABLE,
83
+ actionForHttpMethod,
84
+ normalizePurposeHeader,
85
+ resolveHttpPdlss
86
+ };
87
+ //# sourceMappingURL=http-pdlss.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/adapters/http-pdlss.ts"],"sourcesContent":["/**\n * Shared purpose/action resolver for the HTTP adapters (express + nextjs) —\n * vocabulary-unification round (Bug 14, adapter-spec §4.6).\n *\n * The PDLSS two-axis contract: `purpose` = bare category noun (`shopping`,\n * `data`, custom nouns like `trading`); `action` = dotted verb\n * (`shopping.search`) or an enumerated transport token. Transport verbs\n * (GET/POST/...) NEVER travel as PDLSS actions — they map through the pinned\n * method table below.\n *\n * SELF-CONTAINED on purpose: this published package cannot depend on the\n * private @astrasyncai/pdlss-vocab workspace package, so the constants are\n * duplicated here and pinned strictly equal by a monorepo CI test\n * (vocab-equality.test.ts). Change them in BOTH places or that test fails.\n */\n\n/** Pinned method→action derivation table (§4.6). */\nexport const HTTP_METHOD_ACTION_TABLE: Readonly<Record<string, string>> = {\n GET: 'data.read',\n HEAD: 'data.read',\n OPTIONS: 'data.read',\n POST: 'data.write',\n PUT: 'data.write',\n PATCH: 'data.write',\n DELETE: 'data.delete',\n};\n\n/** Unknown methods are treated as mutating until proven otherwise. */\nexport const DEFAULT_HTTP_ACTION = 'data.write';\n\n/** Generic category emitted when nothing supplies a domain purpose. */\nexport const DEFAULT_HTTP_PURPOSE = 'data';\n\nexport function actionForHttpMethod(method: string): string {\n return HTTP_METHOD_ACTION_TABLE[method.toUpperCase()] ?? DEFAULT_HTTP_ACTION;\n}\n\nexport type HttpPurposeSource =\n | 'route_config'\n | 'custom_extractor'\n | 'header'\n | 'legacy_header'\n | 'query'\n | 'action_derived'\n | 'transport_default';\n\nexport type HttpActionSource =\n | 'route_config'\n | 'custom_extractor'\n | 'header'\n | 'purpose_header_derived'\n | 'method_table';\n\nexport interface HttpPdlssInput {\n method: string;\n /** `X-Astra-Purpose` header value (agent's declaration). */\n astraPurpose?: string;\n /** `X-Astra-Action` header value (agent's declaration, symmetric with MCP). */\n astraAction?: string;\n /** Legacy `x-purpose` header — deprecated, removal scheduled for 4.0.0. */\n legacyPurpose?: string;\n /** Legacy `?purpose` query param (express only) — deprecated, removal 4.0.0. */\n queryPurpose?: string;\n /** Dashboard route config send-mapping (RouteAccessConfig.purpose/.action). */\n routePurpose?: string;\n routeAction?: string;\n /** Results of the merchant's extractPurpose/extractAction options. */\n customPurpose?: string;\n hasCustomPurposeExtractor?: boolean;\n customAction?: string;\n hasCustomActionExtractor?: boolean;\n}\n\nexport interface HttpPdlssResolution {\n purpose: string;\n action: string;\n purposeSource: HttpPurposeSource;\n actionSource: HttpActionSource;\n}\n\n/**\n * Normalize an `X-Astra-Purpose` header value.\n * - colon form `\"category:action\"` (legacy wire shape): take the prefix; the\n * remainder is free-text and exists in no vocabulary — discard it and let\n * the method table supply the action (matches pre-3.1.0 discard behavior).\n * - dotted form `\"shopping.purchase\"` (the shape older docs taught): prefix\n * becomes the purpose, the WHOLE token becomes an action candidate.\n * - bare token: purpose verbatim.\n */\nexport function normalizePurposeHeader(value: string): {\n purpose: string;\n actionCandidate?: string;\n} {\n const colon = value.indexOf(':');\n if (colon >= 0) {\n return { purpose: value.slice(0, colon) };\n }\n const dot = value.indexOf('.');\n if (dot > 0 && dot < value.length - 1) {\n return { purpose: value.slice(0, dot), actionCandidate: value };\n }\n return { purpose: value };\n}\n\n/**\n * Resolve the {purpose, action} pair for one HTTP request.\n *\n * Precedence (both axes; §4.6):\n * action: route mapping → extractAction option → X-Astra-Action header →\n * candidate from a dotted X-Astra-Purpose → pinned method table\n * purpose: route mapping → extractPurpose option → X-Astra-Purpose →\n * legacy x-purpose / ?purpose → category prefix of the resolved\n * action → 'data'\n *\n * A configured custom extractor masks the header/legacy/query steps of its\n * axis (it replaces the default chain, as extractPurpose always has); when it\n * returns undefined the axis falls through to the table/prefix fallback.\n * The route mapping is merchant policy fetched from the dashboard — it\n * outranks agent-supplied headers the way MCP toolGates do.\n */\nexport function resolveHttpPdlss(input: HttpPdlssInput): HttpPdlssResolution {\n const fromHeader = input.astraPurpose ? normalizePurposeHeader(input.astraPurpose) : undefined;\n\n // ── Action axis ──\n let action: string;\n let actionSource: HttpActionSource;\n if (input.routeAction) {\n action = input.routeAction;\n actionSource = 'route_config';\n } else if (input.hasCustomActionExtractor && input.customAction) {\n action = input.customAction;\n actionSource = 'custom_extractor';\n } else if (!input.hasCustomActionExtractor && input.astraAction) {\n action = input.astraAction;\n actionSource = 'header';\n } else if (!input.hasCustomActionExtractor && fromHeader?.actionCandidate) {\n action = fromHeader.actionCandidate;\n actionSource = 'purpose_header_derived';\n } else {\n action = actionForHttpMethod(input.method);\n actionSource = 'method_table';\n }\n\n // ── Purpose axis ──\n let purpose: string | undefined;\n let purposeSource: HttpPurposeSource | undefined;\n if (input.routePurpose) {\n purpose = input.routePurpose;\n purposeSource = 'route_config';\n } else if (input.hasCustomPurposeExtractor) {\n if (input.customPurpose) {\n purpose = input.customPurpose;\n purposeSource = 'custom_extractor';\n }\n } else if (fromHeader) {\n purpose = fromHeader.purpose;\n purposeSource = 'header';\n } else if (input.legacyPurpose) {\n purpose = input.legacyPurpose;\n purposeSource = 'legacy_header';\n } else if (input.queryPurpose) {\n purpose = input.queryPurpose;\n purposeSource = 'query';\n }\n\n if (!purpose) {\n // Keep the pair coherent: an agent that sent only X-Astra-Action (or a\n // route that mapped only the action) gets that action's own category.\n const dot = action.indexOf('.');\n if (dot > 0) {\n purpose = action.slice(0, dot);\n purposeSource = 'action_derived';\n } else {\n purpose = DEFAULT_HTTP_PURPOSE;\n purposeSource = 'transport_default';\n }\n }\n\n return { purpose, action, purposeSource: purposeSource!, actionSource };\n}\n"],"mappings":";AAiBO,IAAM,2BAA6D;AAAA,EACxE,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AACV;AAGO,IAAM,sBAAsB;AAG5B,IAAM,uBAAuB;AAE7B,SAAS,oBAAoB,QAAwB;AAC1D,SAAO,yBAAyB,OAAO,YAAY,CAAC,KAAK;AAC3D;AAsDO,SAAS,uBAAuB,OAGrC;AACA,QAAM,QAAQ,MAAM,QAAQ,GAAG;AAC/B,MAAI,SAAS,GAAG;AACd,WAAO,EAAE,SAAS,MAAM,MAAM,GAAG,KAAK,EAAE;AAAA,EAC1C;AACA,QAAM,MAAM,MAAM,QAAQ,GAAG;AAC7B,MAAI,MAAM,KAAK,MAAM,MAAM,SAAS,GAAG;AACrC,WAAO,EAAE,SAAS,MAAM,MAAM,GAAG,GAAG,GAAG,iBAAiB,MAAM;AAAA,EAChE;AACA,SAAO,EAAE,SAAS,MAAM;AAC1B;AAkBO,SAAS,iBAAiB,OAA4C;AAC3E,QAAM,aAAa,MAAM,eAAe,uBAAuB,MAAM,YAAY,IAAI;AAGrF,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM,aAAa;AACrB,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,MAAM,4BAA4B,MAAM,cAAc;AAC/D,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,CAAC,MAAM,4BAA4B,MAAM,aAAa;AAC/D,aAAS,MAAM;AACf,mBAAe;AAAA,EACjB,WAAW,CAAC,MAAM,4BAA4B,YAAY,iBAAiB;AACzE,aAAS,WAAW;AACpB,mBAAe;AAAA,EACjB,OAAO;AACL,aAAS,oBAAoB,MAAM,MAAM;AACzC,mBAAe;AAAA,EACjB;AAGA,MAAI;AACJ,MAAI;AACJ,MAAI,MAAM,cAAc;AACtB,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB,WAAW,MAAM,2BAA2B;AAC1C,QAAI,MAAM,eAAe;AACvB,gBAAU,MAAM;AAChB,sBAAgB;AAAA,IAClB;AAAA,EACF,WAAW,YAAY;AACrB,cAAU,WAAW;AACrB,oBAAgB;AAAA,EAClB,WAAW,MAAM,eAAe;AAC9B,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB,WAAW,MAAM,cAAc;AAC7B,cAAU,MAAM;AAChB,oBAAgB;AAAA,EAClB;AAEA,MAAI,CAAC,SAAS;AAGZ,UAAM,MAAM,OAAO,QAAQ,GAAG;AAC9B,QAAI,MAAM,GAAG;AACX,gBAAU,OAAO,MAAM,GAAG,GAAG;AAC7B,sBAAgB;AAAA,IAClB,OAAO;AACL,gBAAU;AACV,sBAAgB;AAAA,IAClB;AAAA,EACF;AAEA,SAAO,EAAE,SAAS,QAAQ,eAA+B,aAAa;AACxE;","names":[]}
@@ -1,5 +1,6 @@
1
1
  import { Request, Response, RequestHandler } from 'express';
2
- import { a as AccessLevel, G as GatewayConfig, q as VerificationResult } from '../types-DedAJbNI.mjs';
2
+ import { a as AccessLevel, G as GatewayConfig, r as VerificationResult } from '../types-sy3tq8lp.mjs';
3
+ import '../metadata-capture.mjs';
3
4
 
4
5
  /**
5
6
  * MCP server-side helpers — companion to `transport/mcp.ts` (which handles the
@@ -1,5 +1,6 @@
1
1
  import { Request, Response, RequestHandler } from 'express';
2
- import { a as AccessLevel, G as GatewayConfig, q as VerificationResult } from '../types-DedAJbNI.js';
2
+ import { a as AccessLevel, G as GatewayConfig, r as VerificationResult } from '../types-9tns4wyl.js';
3
+ import '../metadata-capture.js';
3
4
 
4
5
  /**
5
6
  * MCP server-side helpers — companion to `transport/mcp.ts` (which handles the
@@ -40,7 +40,7 @@ function getTrustLevel(score) {
40
40
  }
41
41
 
42
42
  // src/version.ts
43
- var SDK_VERSION = "3.7.1";
43
+ var SDK_VERSION = "3.10.0";
44
44
 
45
45
  // src/well-known.ts
46
46
  var CACHE_TTL_MS = 60 * 60 * 1e3;
@@ -321,6 +321,7 @@ async function callVerifyAccessAPI(config, request) {
321
321
  if (requestData.runtimeChallengeOptions)
322
322
  body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
323
323
  if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
324
+ if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
324
325
  body.sdkVersion = SDK_VERSION;
325
326
  if (requestData.callerMetadata || requestData.clientIp || requestData.userAgent) {
326
327
  const meta = {