@adcp/sdk 14.0.0 → 14.2.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 (234) hide show
  1. package/dist/lib/adapters/implicit-account-store.d.mts +12 -7
  2. package/dist/lib/adapters/implicit-account-store.d.ts +12 -7
  3. package/dist/lib/adapters/implicit-account-store.js +69 -15
  4. package/dist/lib/adapters/implicit-account-store.mjs +69 -15
  5. package/dist/lib/core/AgentClient.d.mts +1 -0
  6. package/dist/lib/core/AgentClient.d.ts +1 -0
  7. package/dist/lib/core/AgentClient.js +3 -0
  8. package/dist/lib/core/AgentClient.mjs +3 -0
  9. package/dist/lib/core/SingleAgentClient.d.mts +35 -2
  10. package/dist/lib/core/SingleAgentClient.d.ts +35 -2
  11. package/dist/lib/core/SingleAgentClient.js +377 -36
  12. package/dist/lib/core/SingleAgentClient.mjs +387 -38
  13. package/dist/lib/core/TaskExecutor.d.mts +3 -1
  14. package/dist/lib/core/TaskExecutor.d.ts +3 -1
  15. package/dist/lib/core/TaskExecutor.js +17 -12
  16. package/dist/lib/core/TaskExecutor.mjs +17 -12
  17. package/dist/lib/core/account-key.d.mts +3 -0
  18. package/dist/lib/core/account-key.d.ts +3 -0
  19. package/dist/lib/core/account-key.js +41 -0
  20. package/dist/lib/core/account-key.mjs +17 -0
  21. package/dist/lib/core/account-resolution.d.mts +2 -0
  22. package/dist/lib/core/account-resolution.d.ts +2 -0
  23. package/dist/lib/core/buyer-account-registry.d.mts +93 -0
  24. package/dist/lib/core/buyer-account-registry.d.ts +93 -0
  25. package/dist/lib/core/buyer-account-registry.js +602 -0
  26. package/dist/lib/core/buyer-account-registry.mjs +578 -0
  27. package/dist/lib/core/product-cache.d.mts +18 -0
  28. package/dist/lib/core/product-cache.d.ts +18 -0
  29. package/dist/lib/core/product-cache.js +137 -0
  30. package/dist/lib/core/product-cache.mjs +112 -0
  31. package/dist/lib/errors/index.d.mts +40 -1
  32. package/dist/lib/errors/index.d.ts +40 -1
  33. package/dist/lib/errors/index.js +69 -3
  34. package/dist/lib/errors/index.mjs +64 -3
  35. package/dist/lib/governance/authorization.d.mts +17 -1
  36. package/dist/lib/governance/authorization.d.ts +17 -1
  37. package/dist/lib/governance/authorization.js +55 -7
  38. package/dist/lib/governance/authorization.mjs +59 -7
  39. package/dist/lib/governance/index.d.mts +2 -2
  40. package/dist/lib/governance/index.d.ts +2 -2
  41. package/dist/lib/governance/index.js +2 -0
  42. package/dist/lib/governance/index.mjs +3 -1
  43. package/dist/lib/index.d.mts +7 -4
  44. package/dist/lib/index.d.ts +7 -4
  45. package/dist/lib/index.js +29 -0
  46. package/dist/lib/index.mjs +31 -1
  47. package/dist/lib/net/agent-transport-fetch.d.mts +4 -0
  48. package/dist/lib/net/agent-transport-fetch.d.ts +4 -0
  49. package/dist/lib/net/agent-transport-fetch.js +18 -5
  50. package/dist/lib/net/agent-transport-fetch.mjs +17 -5
  51. package/dist/lib/protocols/a2a.js +9 -1
  52. package/dist/lib/protocols/a2a.mjs +9 -1
  53. package/dist/lib/protocols/index.js +9 -2
  54. package/dist/lib/protocols/index.mjs +9 -2
  55. package/dist/lib/protocols/mcp-modern.js +2 -1
  56. package/dist/lib/protocols/mcp-modern.mjs +2 -1
  57. package/dist/lib/protocols/mcp.js +5 -2
  58. package/dist/lib/protocols/mcp.mjs +5 -2
  59. package/dist/lib/protocols/rawResponseCapture.d.mts +6 -0
  60. package/dist/lib/protocols/rawResponseCapture.d.ts +6 -0
  61. package/dist/lib/protocols/rawResponseCapture.js +41 -29
  62. package/dist/lib/protocols/rawResponseCapture.mjs +40 -29
  63. package/dist/lib/protocols/signedRequestRejection.d.mts +9 -0
  64. package/dist/lib/protocols/signedRequestRejection.d.ts +9 -0
  65. package/dist/lib/protocols/signedRequestRejection.js +209 -0
  66. package/dist/lib/protocols/signedRequestRejection.mjs +189 -0
  67. package/dist/lib/protocols/transportDiagnostics.d.mts +1 -0
  68. package/dist/lib/protocols/transportDiagnostics.d.ts +1 -0
  69. package/dist/lib/protocols/transportDiagnostics.js +2 -0
  70. package/dist/lib/protocols/transportDiagnostics.mjs +1 -0
  71. package/dist/lib/registry/types.generated.d.mts +112 -45
  72. package/dist/lib/registry/types.generated.d.ts +112 -45
  73. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  74. package/dist/lib/server/account-provisioning.d.mts +2 -0
  75. package/dist/lib/server/account-provisioning.d.ts +2 -0
  76. package/dist/lib/server/account-provisioning.js +30 -0
  77. package/dist/lib/server/account-provisioning.mjs +6 -0
  78. package/dist/lib/server/account-reference-warnings.d.mts +12 -0
  79. package/dist/lib/server/account-reference-warnings.d.ts +12 -0
  80. package/dist/lib/server/account-reference-warnings.js +48 -0
  81. package/dist/lib/server/account-reference-warnings.mjs +23 -0
  82. package/dist/lib/server/auth-signature.js +1 -0
  83. package/dist/lib/server/auth-signature.mjs +1 -0
  84. package/dist/lib/server/create-adcp-server.d.mts +34 -0
  85. package/dist/lib/server/create-adcp-server.d.ts +34 -0
  86. package/dist/lib/server/create-adcp-server.js +225 -14
  87. package/dist/lib/server/create-adcp-server.mjs +225 -14
  88. package/dist/lib/server/decisioning/account.d.mts +2 -0
  89. package/dist/lib/server/decisioning/account.d.ts +2 -0
  90. package/dist/lib/server/decisioning/runtime/from-platform.js +49 -10
  91. package/dist/lib/server/decisioning/runtime/from-platform.mjs +49 -10
  92. package/dist/lib/server/index.d.mts +2 -2
  93. package/dist/lib/server/index.d.ts +2 -2
  94. package/dist/lib/server/index.js +2 -0
  95. package/dist/lib/server/index.mjs +3 -1
  96. package/dist/lib/signing/agent-resolver/consistency.d.mts +6 -13
  97. package/dist/lib/signing/agent-resolver/consistency.d.ts +6 -13
  98. package/dist/lib/signing/agent-resolver/consistency.js +0 -1
  99. package/dist/lib/signing/agent-resolver/consistency.mjs +0 -1
  100. package/dist/lib/signing/agent-resolver/errors.d.mts +3 -1
  101. package/dist/lib/signing/agent-resolver/errors.d.ts +3 -1
  102. package/dist/lib/signing/agent-resolver/errors.js +6 -0
  103. package/dist/lib/signing/agent-resolver/errors.mjs +6 -0
  104. package/dist/lib/signing/agent-resolver/fetch-helpers.d.mts +11 -0
  105. package/dist/lib/signing/agent-resolver/fetch-helpers.d.ts +11 -0
  106. package/dist/lib/signing/agent-resolver/fetch-helpers.js +37 -2
  107. package/dist/lib/signing/agent-resolver/fetch-helpers.mjs +40 -3
  108. package/dist/lib/signing/agent-resolver/jwks-set.js +24 -3
  109. package/dist/lib/signing/agent-resolver/jwks-set.mjs +24 -3
  110. package/dist/lib/signing/agent-resolver/legacy-brand.d.mts +15 -0
  111. package/dist/lib/signing/agent-resolver/legacy-brand.d.ts +15 -0
  112. package/dist/lib/signing/agent-resolver/legacy-brand.js +60 -0
  113. package/dist/lib/signing/agent-resolver/legacy-brand.mjs +36 -0
  114. package/dist/lib/signing/agent-resolver/operator-authorization.d.mts +13 -0
  115. package/dist/lib/signing/agent-resolver/operator-authorization.d.ts +13 -0
  116. package/dist/lib/signing/agent-resolver/operator-authorization.js +108 -0
  117. package/dist/lib/signing/agent-resolver/operator-authorization.mjs +84 -0
  118. package/dist/lib/signing/agent-resolver/resolve-agent.d.mts +14 -4
  119. package/dist/lib/signing/agent-resolver/resolve-agent.d.ts +14 -4
  120. package/dist/lib/signing/agent-resolver/resolve-agent.js +148 -137
  121. package/dist/lib/signing/agent-resolver/resolve-agent.mjs +157 -139
  122. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.mts +7 -1
  123. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.d.ts +7 -1
  124. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.js +50 -17
  125. package/dist/lib/signing/agent-resolver/resolved-agent-jwks.mjs +50 -17
  126. package/dist/lib/signing/agent-resolver/select-agent.d.mts +14 -15
  127. package/dist/lib/signing/agent-resolver/select-agent.d.ts +14 -15
  128. package/dist/lib/signing/agent-resolver/select-agent.js +98 -13
  129. package/dist/lib/signing/agent-resolver/select-agent.mjs +95 -13
  130. package/dist/lib/signing/brand-jwks.d.mts +29 -75
  131. package/dist/lib/signing/brand-jwks.d.ts +29 -75
  132. package/dist/lib/signing/brand-jwks.js +120 -182
  133. package/dist/lib/signing/brand-jwks.mjs +120 -182
  134. package/dist/lib/signing/errors.d.mts +7 -3
  135. package/dist/lib/signing/errors.d.ts +7 -3
  136. package/dist/lib/signing/errors.js +7 -2
  137. package/dist/lib/signing/errors.mjs +7 -2
  138. package/dist/lib/signing/jwks-https.d.mts +7 -0
  139. package/dist/lib/signing/jwks-https.d.ts +7 -0
  140. package/dist/lib/signing/jwks-https.js +31 -8
  141. package/dist/lib/signing/jwks-https.mjs +31 -8
  142. package/dist/lib/signing/jwks.d.mts +8 -0
  143. package/dist/lib/signing/jwks.d.ts +8 -0
  144. package/dist/lib/signing/middleware.js +2 -1
  145. package/dist/lib/signing/middleware.mjs +2 -1
  146. package/dist/lib/signing/publisher-pins.d.mts +11 -0
  147. package/dist/lib/signing/publisher-pins.d.ts +11 -0
  148. package/dist/lib/signing/publisher-pins.js +125 -0
  149. package/dist/lib/signing/publisher-pins.mjs +101 -0
  150. package/dist/lib/signing/server.d.mts +1 -0
  151. package/dist/lib/signing/server.d.ts +1 -0
  152. package/dist/lib/signing/types.d.mts +5 -0
  153. package/dist/lib/signing/types.d.ts +5 -0
  154. package/dist/lib/signing/verifier.js +50 -5
  155. package/dist/lib/signing/verifier.mjs +50 -5
  156. package/dist/lib/signing/webhook-verifier.d.mts +7 -2
  157. package/dist/lib/signing/webhook-verifier.d.ts +7 -2
  158. package/dist/lib/signing/webhook-verifier.js +42 -2
  159. package/dist/lib/signing/webhook-verifier.mjs +42 -2
  160. package/dist/lib/testing/storyboard/account-policy.d.mts +2 -0
  161. package/dist/lib/testing/storyboard/account-policy.d.ts +2 -0
  162. package/dist/lib/testing/storyboard/account-policy.js +35 -0
  163. package/dist/lib/testing/storyboard/account-policy.mjs +11 -0
  164. package/dist/lib/testing/storyboard/context.js +6 -0
  165. package/dist/lib/testing/storyboard/context.mjs +6 -0
  166. package/dist/lib/testing/storyboard/request-builder.js +12 -2
  167. package/dist/lib/testing/storyboard/request-builder.mjs +12 -2
  168. package/dist/lib/testing/storyboard/runner.js +3 -2
  169. package/dist/lib/testing/storyboard/runner.mjs +3 -2
  170. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  171. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  172. package/dist/lib/types/accept-proposal.d.ts +19 -1
  173. package/dist/lib/types/buy-products.d.ts +19 -1
  174. package/dist/lib/types/check-governance.d.ts +19 -1
  175. package/dist/lib/types/comply-test-controller.d.ts +19 -1
  176. package/dist/lib/types/control-media-buy.d.ts +19 -1
  177. package/dist/lib/types/core.generated.d.mts +14 -1
  178. package/dist/lib/types/core.generated.d.ts +14 -1
  179. package/dist/lib/types/create-media-buy.d.ts +14 -1
  180. package/dist/lib/types/get-media-buys.d.ts +14 -1
  181. package/dist/lib/types/get-products.d.ts +19 -1
  182. package/dist/lib/types/list-products.d.ts +19 -1
  183. package/dist/lib/types/refine-proposals.d.ts +19 -1
  184. package/dist/lib/types/request-proposals.d.ts +19 -1
  185. package/dist/lib/types/schemas.generated.d.ts +12 -3
  186. package/dist/lib/types/schemas.generated.js +4 -1
  187. package/dist/lib/types/schemas.generated.mjs +4 -1
  188. package/dist/lib/types/tools.generated.d.mts +14 -1
  189. package/dist/lib/types/tools.generated.d.ts +14 -1
  190. package/dist/lib/types/update-media-buy.d.ts +14 -1
  191. package/dist/lib/version.d.mts +3 -3
  192. package/dist/lib/version.d.ts +3 -3
  193. package/dist/lib/version.js +3 -3
  194. package/dist/lib/version.mjs +3 -3
  195. package/dist/lib/webhooks/index.d.mts +24 -0
  196. package/dist/lib/webhooks/index.d.ts +24 -0
  197. package/dist/lib/webhooks/index.js +50 -24
  198. package/dist/lib/webhooks/index.mjs +49 -24
  199. package/dist/lib/wholesale-feed-sync/index.d.mts +2 -0
  200. package/dist/lib/wholesale-feed-sync/index.d.ts +2 -0
  201. package/dist/lib/wholesale-feed-sync/index.js +7 -0
  202. package/dist/lib/wholesale-feed-sync/index.mjs +4 -0
  203. package/dist/lib/wholesale-feed-sync/mirror.d.mts +97 -0
  204. package/dist/lib/wholesale-feed-sync/mirror.d.ts +97 -0
  205. package/dist/lib/wholesale-feed-sync/mirror.js +350 -0
  206. package/dist/lib/wholesale-feed-sync/mirror.mjs +322 -0
  207. package/dist/lib/wholesale-feed-sync/sync.d.mts +13 -29
  208. package/dist/lib/wholesale-feed-sync/sync.d.ts +13 -29
  209. package/dist/lib/wholesale-feed-sync/sync.js +208 -281
  210. package/dist/lib/wholesale-feed-sync/sync.mjs +213 -281
  211. package/dist/lib/wholesale-feed-sync/types.d.mts +4 -3
  212. package/dist/lib/wholesale-feed-sync/types.d.ts +4 -3
  213. package/docs/README.md +6 -0
  214. package/docs/TYPE-SUMMARY.md +2 -2
  215. package/docs/guides/BUILD-AN-AGENT.md +2 -2
  216. package/docs/guides/BUYER-QUICKSTART-3.2.md +2 -0
  217. package/docs/guides/BUYER-STORAGE.md +3 -0
  218. package/docs/guides/FIRST-CALL-TO-A-SELLER.md +106 -0
  219. package/docs/guides/SIGNING-GUIDE.md +16 -7
  220. package/docs/guides/account-resolution.md +132 -10
  221. package/docs/llms.txt +3 -2
  222. package/docs/migration-14.0-to-14.1.md +85 -0
  223. package/docs/migration-14.x-rc-worksheet.md +4 -4
  224. package/docs/migration-4.x-to-5.x.md +1 -0
  225. package/docs/migration-agent-resolution-3.3.md +125 -0
  226. package/docs/recipes/verifying-inbound-webhooks.md +60 -15
  227. package/package.json +3 -2
  228. package/skills/adcp-brand.previous/SKILL.md +0 -200
  229. package/skills/adcp-creative.previous/SKILL.md +0 -305
  230. package/skills/adcp-governance.previous/SKILL.md +0 -566
  231. package/skills/adcp-measurement.previous/SKILL.md +0 -136
  232. package/skills/adcp-media-buy.previous/SKILL.md +0 -556
  233. package/skills/adcp-si.previous/SKILL.md +0 -206
  234. package/skills/adcp-signals.previous/SKILL.md +0 -204
@@ -0,0 +1,189 @@
1
+ import { fileURLToPath as __adcpFileURLToPath } from "node:url";
2
+ import { dirname as __adcpDirname } from "node:path";
3
+ import { createRequire as __adcpCreateRequire } from "node:module";
4
+ const __dirname = __adcpDirname(__adcpFileURLToPath(import.meta.url));
5
+ const require2 = __adcpCreateRequire(import.meta.url);
6
+ import { AuthenticationRequiredError } from "../errors/index.mjs";
7
+ import { RequestSigningErrorCodeMetadata } from "../types/enums.generated.mjs";
8
+ import { parseWWWAuthenticate } from "../auth/oauth/diagnostics.mjs";
9
+ import { redactSensitiveJsonOrText, sanitizeTransportHeaders, sanitizeTransportUrl } from "./transportDiagnostics.mjs";
10
+ import { recordRawResponseCapture } from "./rawResponseCapture.mjs";
11
+ const CAPTURE_BYTES = 16 * 1024;
12
+ const EXCERPT_LENGTH = 2048;
13
+ const CAPTURE_TIMEOUT_MS = 1e3;
14
+ const PUBLIC_HEADERS = /* @__PURE__ */ new Set([
15
+ "accept",
16
+ "content-type",
17
+ "content-length",
18
+ "user-agent",
19
+ "host",
20
+ "a2a-version",
21
+ "a2a-extensions",
22
+ "adcp-version",
23
+ "mcp-protocol-version",
24
+ "mcp-session-id",
25
+ "traceparent",
26
+ "tracestate",
27
+ "signature",
28
+ "signature-input",
29
+ "content-digest"
30
+ ]);
31
+ function wrapFetchWithSignedRequestRejection(upstream, agentUrl) {
32
+ return async (input, init) => {
33
+ const startedAt = Date.now();
34
+ const response = await upstream(input, init);
35
+ const headers = new Headers(init?.headers ?? (input instanceof Request ? input.headers : void 0));
36
+ if (response.status !== 401 || !headers.has("signature")) return response;
37
+ const url = typeof input === "string" ? input : input instanceof URL ? input.toString() : input.url;
38
+ const parsed = parseWWWAuthenticate(response.headers.get("www-authenticate"));
39
+ if (parsed && parsed.scheme !== "signature") return response;
40
+ const knownCode = parsed?.scheme === "signature" && parsed.error && Object.prototype.hasOwnProperty.call(RequestSigningErrorCodeMetadata, parsed.error);
41
+ const challenge = parsed ? { scheme: parsed.scheme.slice(0, 64), ...knownCode && { error: parsed.error } } : void 0;
42
+ const secrets = getHeaderSecrets(headers);
43
+ const captured = await captureBody(response, secrets, init?.signal);
44
+ const captureHeaders = sanitizeTransportHeaders(response.headers);
45
+ for (const key of Object.keys(captureHeaders)) {
46
+ captureHeaders[key] = redactReflected(captureHeaders[key], secrets);
47
+ }
48
+ if (parsed) captureHeaders["www-authenticate"] = knownCode ? `Signature error="${parsed.error}"` : "Signature";
49
+ recordRawResponseCapture(input, init, response, captured?.body ?? "", captured?.truncated ?? true, startedAt, {
50
+ url: sanitizeTransportUrl(url),
51
+ headers: captureHeaders
52
+ });
53
+ const body = captured?.body;
54
+ let excerpt = body;
55
+ if (body && body.length > EXCERPT_LENGTH) {
56
+ let end = EXCERPT_LENGTH - 1;
57
+ if (/[\uD800-\uDBFF]/.test(body[end - 1])) end--;
58
+ excerpt = body.slice(0, end) + "\u2026";
59
+ }
60
+ throw new AuthenticationRequiredError(sanitizeTransportUrl(agentUrl ?? url), void 0, void 0, challenge, {
61
+ status: response.status,
62
+ responseBody: excerpt
63
+ });
64
+ };
65
+ }
66
+ function getSignedRequestRejection(error) {
67
+ const seen = /* @__PURE__ */ new Set();
68
+ while (error && typeof error === "object" && !seen.has(error)) {
69
+ seen.add(error);
70
+ if (error instanceof AuthenticationRequiredError && error.requestSigned) return error;
71
+ error = error.cause;
72
+ }
73
+ return void 0;
74
+ }
75
+ function getHeaderSecrets(headers) {
76
+ const secrets = [];
77
+ headers.forEach((value, name) => {
78
+ if (value && !PUBLIC_HEADERS.has(name)) {
79
+ secrets.push(value);
80
+ if (/^(authorization|proxy-authorization)$/i.test(name)) {
81
+ const credential = value.replace(/^\S+\s+/, "");
82
+ if (credential) secrets.push(credential);
83
+ }
84
+ }
85
+ });
86
+ return secrets;
87
+ }
88
+ function redactReflected(value, secrets) {
89
+ const mask = new Uint8Array(value.length);
90
+ for (const secret of secrets) {
91
+ for (let from = 0; from < value.length; ) {
92
+ const at = value.indexOf(secret, from);
93
+ if (at < 0) break;
94
+ mask.fill(1, at, at + secret.length);
95
+ from = at + 1;
96
+ }
97
+ }
98
+ let out = "";
99
+ let cursor = 0;
100
+ for (let at = 0; at < value.length; ) {
101
+ if (!mask[at]) {
102
+ at++;
103
+ continue;
104
+ }
105
+ out += value.slice(cursor, at) + "[redacted]";
106
+ while (at < value.length && mask[at]) at++;
107
+ cursor = at;
108
+ }
109
+ return out + value.slice(cursor);
110
+ }
111
+ async function captureBody(response, secrets, signal) {
112
+ if (!response.body) return void 0;
113
+ const reader = response.body.getReader();
114
+ let timer;
115
+ let cancelled = false;
116
+ const cancel = () => {
117
+ cancelled = true;
118
+ void reader.cancel().catch(() => {
119
+ });
120
+ };
121
+ signal?.addEventListener("abort", cancel, { once: true });
122
+ if (signal?.aborted) cancel();
123
+ try {
124
+ return await Promise.race([
125
+ (async () => {
126
+ const chunks = [];
127
+ let bytes = 0;
128
+ while (true) {
129
+ const { value, done } = await reader.read();
130
+ if (done) break;
131
+ if (bytes + value.byteLength > CAPTURE_BYTES) {
132
+ return { body: "[seller response exceeds diagnostic capture limit]", truncated: true };
133
+ }
134
+ chunks.push(value);
135
+ bytes += value.byteLength;
136
+ }
137
+ if (cancelled) return void 0;
138
+ let text = Buffer.concat(chunks).toString("utf8");
139
+ const redact = (value) => redactReflected(value, secrets);
140
+ if (/^\s*[{["]/.test(text)) {
141
+ try {
142
+ const valueRedacted = JSON.stringify(
143
+ JSON.parse(text, (_key, value) => {
144
+ if (typeof value === "string") return redact(value);
145
+ if ((typeof value === "boolean" || value === null) && secrets.includes(String(value)))
146
+ return "[redacted]";
147
+ if (typeof value === "number" && secrets.some((secret) => /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/i.test(secret) && Number(secret) === value))
148
+ return "[redacted]";
149
+ return value;
150
+ })
151
+ );
152
+ text = JSON.stringify(
153
+ JSON.parse(redactSensitiveJsonOrText(valueRedacted), (_key, value) => {
154
+ if (value && typeof value === "object" && !Array.isArray(value)) {
155
+ const out = /* @__PURE__ */ Object.create(null);
156
+ for (const key of Object.keys(value)) out[redact(key)] = value[key];
157
+ return out;
158
+ }
159
+ return value;
160
+ })
161
+ );
162
+ } catch {
163
+ return { body: "[seller response is not valid diagnostic JSON]", truncated: true };
164
+ }
165
+ } else {
166
+ text = redact(text);
167
+ }
168
+ text = redactSensitiveJsonOrText(text).replace(/[\u0000-\u001f\u007f]/g, " ");
169
+ return { body: text, truncated: false };
170
+ })(),
171
+ new Promise((resolve) => {
172
+ timer = setTimeout(() => {
173
+ cancel();
174
+ resolve(void 0);
175
+ }, CAPTURE_TIMEOUT_MS);
176
+ })
177
+ ]);
178
+ } catch {
179
+ return void 0;
180
+ } finally {
181
+ if (timer) clearTimeout(timer);
182
+ signal?.removeEventListener("abort", cancel);
183
+ cancel();
184
+ }
185
+ }
186
+ export {
187
+ getSignedRequestRejection,
188
+ wrapFetchWithSignedRequestRejection
189
+ };
@@ -53,4 +53,5 @@ export declare function withTransportDiagnostics<T>(context: TransportActivityCo
53
53
  export declare function sanitizeTransportUrl(value: string): string;
54
54
  export declare function sanitizeTransportHeaders(headers: HeadersInit | undefined): Record<string, string>;
55
55
  export declare function wrapFetchWithTransportDiagnostics(upstream: typeof fetch): typeof fetch;
56
+ export declare function redactSensitiveJsonOrText(text: string): string;
56
57
  export {};
@@ -53,4 +53,5 @@ export declare function withTransportDiagnostics<T>(context: TransportActivityCo
53
53
  export declare function sanitizeTransportUrl(value: string): string;
54
54
  export declare function sanitizeTransportHeaders(headers: HeadersInit | undefined): Record<string, string>;
55
55
  export declare function wrapFetchWithTransportDiagnostics(upstream: typeof fetch): typeof fetch;
56
+ export declare function redactSensitiveJsonOrText(text: string): string;
56
57
  export {};
@@ -20,6 +20,7 @@ var transportDiagnostics_exports = {};
20
20
  __export(transportDiagnostics_exports, {
21
21
  BODY_SNIPPET_TIMEOUT_MS: () => BODY_SNIPPET_TIMEOUT_MS,
22
22
  OBSERVER_FLUSH_TIMEOUT_MS: () => OBSERVER_FLUSH_TIMEOUT_MS,
23
+ redactSensitiveJsonOrText: () => redactSensitiveJsonOrText,
23
24
  sanitizeTransportHeaders: () => sanitizeTransportHeaders,
24
25
  sanitizeTransportUrl: () => sanitizeTransportUrl,
25
26
  transportDiagnosticsStorage: () => transportDiagnosticsStorage,
@@ -385,6 +386,7 @@ function fingerprintDiagnosticValue(value) {
385
386
  0 && (module.exports = {
386
387
  BODY_SNIPPET_TIMEOUT_MS,
387
388
  OBSERVER_FLUSH_TIMEOUT_MS,
389
+ redactSensitiveJsonOrText,
388
390
  sanitizeTransportHeaders,
389
391
  sanitizeTransportUrl,
390
392
  transportDiagnosticsStorage,
@@ -360,6 +360,7 @@ function fingerprintDiagnosticValue(value) {
360
360
  export {
361
361
  BODY_SNIPPET_TIMEOUT_MS,
362
362
  OBSERVER_FLUSH_TIMEOUT_MS,
363
+ redactSensitiveJsonOrText,
363
364
  sanitizeTransportHeaders,
364
365
  sanitizeTransportUrl,
365
366
  transportDiagnosticsStorage,
@@ -1756,11 +1756,11 @@ export interface paths {
1756
1756
  put?: never;
1757
1757
  /**
1758
1758
  * Refresh agent snapshot
1759
- * @description Re-probe the agent and update its registry health (online, tools_count, response_time_ms), capability snapshot (inferred type, discovered tools), and compliance verdict (storyboard pass/fail counts). Use after fixing your agent so the registry shows fresh data without waiting for the periodic heartbeat (~1h).
1759
+ * @description Re-probe the agent and update its registry health (online, tools_count, response_time_ms), capability snapshot (inferred type, discovered tools), and compliance verdict (storyboard pass/fail counts). Use after fixing your agent so the registry shows fresh data without waiting for the periodic heartbeat.
1760
1760
  *
1761
- * **Compliance re-run:** when the caller owns the agent or is an AAO admin and the capability probe succeeds, the full storyboard suite can run for several minutes on capability-rich agents with a fresh test session, and `agent_storyboard_status` is updated. Owner-triggered runs use `triggered_by: 'owner_test'`; admin-triggered support runs use `triggered_by: 'manual'`. Badge fan-out reissues verification badges off the new run. If the compliance call fails (timeout, OAuth wall, internal error), the capability/health portion still returns successfully — `compliance.ran` is `false` with an `error` string.
1761
+ * **Compliance re-run:** when the caller owns the agent or is an AgenticAdvertising.org admin and the capability probe succeeds, the full storyboard suite runs with a fresh test session. Owner-triggered runs use `triggered_by: 'owner_test'`; admin-triggered support runs use `triggered_by: 'manual'`. Only a complete authoritative run can update public grades or badges.
1762
1762
  *
1763
- * **Auth:** owner of the agent, AAO admin, or static `ADMIN_API_KEY`. Human submissions are temporarily fenced with HTTP 503 until durable authorization provenance is supported; static admin API key submissions remain available.
1763
+ * **Auth:** an authenticated owner or administrator credential is checked at admission and throughout execution. Static admin API keys cannot queue a refresh.
1764
1764
  *
1765
1765
  * **Rate limits:** 60 seconds per agent URL, 30 requests per user per hour.
1766
1766
  */
@@ -2641,7 +2641,7 @@ export interface components {
2641
2641
  verified?: boolean;
2642
2642
  /** @description Canonical badge roles the agent is AgenticAdvertising.org Verified for (e.g. media-buy, creative). */
2643
2643
  verified_roles?: components["schemas"]["BadgeRole"][];
2644
- /** @description Active AgenticAdvertising.org Verified AdCP releases for each verified role, keyed by canonical badge role and sorted newest-first (e.g. { media-buy: ['3.1', '3.0'] }). Use this when choosing a version-pinned badge URL. */
2644
+ /** @description Active AgenticAdvertising.org Verified AdCP releases for each verified role, keyed by canonical badge role and sorted newest-first (e.g. { media-buy: ['3.2', '3.1'] }). Use this when choosing a version-pinned badge URL. */
2645
2645
  verified_role_versions?: {
2646
2646
  [key: string]: string[];
2647
2647
  };
@@ -4164,21 +4164,48 @@ export interface components {
4164
4164
  compliance_opt_out?: boolean;
4165
4165
  /** @description True when monitoring is enabled but badges remain suppressed until a fresh passing full-suite run completes. */
4166
4166
  badge_requalification_required?: boolean;
4167
- /** @description Current human refresh admission state. Monitoring requeue is a separate scheduler operation and is not a retry or ETA for this endpoint. */
4167
+ /** @description Whether authenticated owners and administrators can queue an agent refresh. */
4168
4168
  refresh_availability?: {
4169
4169
  available: boolean;
4170
- /** @description Whether retrying the same human refresh request later is expected to succeed without a platform change. */
4171
- retryable: boolean;
4172
- /** @enum {string} */
4173
- scope: "platform";
4174
- /** @enum {string} */
4175
- applies_to: "human_session";
4176
- /** @enum {string} */
4177
- code: "refresh_authorization_provenance_required";
4178
- notice: string;
4179
- /** @enum {string} */
4180
- alternative_action: "monitoring_requeue";
4181
- alternative_description: string;
4170
+ /**
4171
+ * @deprecated
4172
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4173
+ */
4174
+ retryable?: boolean;
4175
+ /**
4176
+ * @deprecated
4177
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4178
+ * @enum {string}
4179
+ */
4180
+ scope?: "platform";
4181
+ /**
4182
+ * @deprecated
4183
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4184
+ * @enum {string}
4185
+ */
4186
+ applies_to?: "human_session";
4187
+ /**
4188
+ * @deprecated
4189
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4190
+ * @enum {string}
4191
+ */
4192
+ code?: "refresh_authorization_provenance_required";
4193
+ /**
4194
+ * @deprecated
4195
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4196
+ */
4197
+ notice?: string;
4198
+ /**
4199
+ * @deprecated
4200
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4201
+ * @enum {string}
4202
+ */
4203
+ alternative_action?: "monitoring_requeue";
4204
+ /**
4205
+ * @deprecated
4206
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
4207
+ */
4208
+ alternative_description?: string;
4182
4209
  };
4183
4210
  tracks?: {
4184
4211
  [key: string]: string;
@@ -4200,6 +4227,21 @@ export interface components {
4200
4227
  status_changed_at?: string | null;
4201
4228
  storyboards_passing?: number;
4202
4229
  storyboards_total?: number;
4230
+ /** @description Owner/operator-only newest persisted full assessment, including audit-only timeouts. Null for other viewers. This does not change the public verdict. */
4231
+ latest_attempt?: {
4232
+ /** Format: uuid */
4233
+ id: string;
4234
+ tested_at: string;
4235
+ /** @enum {string} */
4236
+ triggered_by: "heartbeat" | "owner_test" | "manual" | "webhook";
4237
+ /** @enum {string} */
4238
+ completeness: "complete" | "timed_out" | "not_completed";
4239
+ is_authoritative: boolean;
4240
+ requested_compliance_target: string | null;
4241
+ storyboards_completed: number | null;
4242
+ storyboards_total: number | null;
4243
+ first_blocker: string | null;
4244
+ } | null;
4203
4245
  /** @description How often the heartbeat re-tests this agent, in hours */
4204
4246
  check_interval_hours?: number;
4205
4247
  /** @description Specialisms the agent declared in get_adcp_capabilities, from the latest run */
@@ -4329,7 +4371,7 @@ export interface components {
4329
4371
  };
4330
4372
  VerificationBadge: {
4331
4373
  role: components["schemas"]["BadgeRole"] & unknown;
4332
- /** @description AdCP release this badge was issued against, MAJOR.MINOR (e.g. '3.0', '3.1'). Load-bearing for badge identity — pairs with the (agent_url, role, adcp_version) PK. */
4374
+ /** @description AdCP release this badge was issued against, MAJOR.MINOR (e.g. '3.1', '3.2'). Load-bearing for badge identity — pairs with the (agent_url, role, adcp_version) PK. */
4333
4375
  adcp_version: string;
4334
4376
  verified_at: string;
4335
4377
  /** @description Specialisms demonstrably passed (enums/specialism.json). Preview specialisms are excluded from stable badges. */
@@ -9299,7 +9341,7 @@ export interface operations {
9299
9341
  encodedUrl: string;
9300
9342
  /** @description Canonical badge role */
9301
9343
  role: components["schemas"]["BadgeRole"] & unknown;
9302
- /** @description AdCP release as MAJOR.MINOR (e.g. '3.0', '3.1') */
9344
+ /** @description AdCP release as MAJOR.MINOR (e.g. '3.1', '3.2') */
9303
9345
  version: string;
9304
9346
  };
9305
9347
  cookie?: never;
@@ -10208,13 +10250,13 @@ export interface operations {
10208
10250
  run_id?: string;
10209
10251
  /** @description Fresh test session id used for the compliance run. Useful when matching seller-side logs to the refresh. */
10210
10252
  test_session_id?: string;
10211
- /** @description Requested compliance target before alias resolution, e.g. 3.1, 3.0, 3.1-rc, or 3.1-beta. Present when `ran` is true. */
10253
+ /** @description Requested compliance target before alias resolution, e.g. 3.2, 3.1, 3.0, 3.2-rc, or 3.2-beta. Present when `ran` is true. */
10212
10254
  requested_compliance_target?: string;
10213
- /** @description Concrete AdCP compliance bundle version used for the run, e.g. 3.0.12 or 3.1.0-beta.7. Present when `ran` is true. */
10255
+ /** @description Concrete AdCP compliance bundle version used for the run, e.g. 3.2.1, 3.1.24, or 3.2.0-rc.7. Present when `ran` is true. */
10214
10256
  adcp_version?: string;
10215
10257
  /** @description True when this run can update public badge state. */
10216
10258
  badge_eligible?: boolean;
10217
- /** @description Public badge versions this run can issue, e.g. ['3.0']. */
10259
+ /** @description Public badge versions this run can issue, e.g. ['3.2']. */
10218
10260
  badge_eligible_adcp_versions?: string[];
10219
10261
  /** @description Aggregate verdict from the run (passing / failing / partial / unknown). Only present when `ran` is true. */
10220
10262
  overall_status?: string;
@@ -10327,34 +10369,59 @@ export interface operations {
10327
10369
  "application/json": components["schemas"]["Error"];
10328
10370
  };
10329
10371
  };
10330
- /** @description Refresh queue or authorization unavailable. Human submissions are fenced with refresh_authorization_provenance_required until durable authorization provenance is supported; this response is non-retryable and carries no ETA. Static admin API key submissions remain supported. */
10372
+ /** @description Refresh queue or authorization temporarily unavailable. */
10331
10373
  503: {
10332
10374
  headers: {
10333
10375
  [name: string]: unknown;
10334
10376
  };
10335
10377
  content: {
10336
- "application/json": {
10337
- /** @enum {string} */
10338
- error: "admin_authorization_unavailable";
10339
- message: string;
10340
- } | {
10341
- error: string;
10342
- /** @enum {string} */
10343
- code: "refresh_authorization_provenance_required";
10344
- /** @enum {boolean} */
10345
- retryable: false;
10346
- /** @enum {string} */
10347
- scope: "platform";
10348
- /** @enum {string} */
10349
- applies_to: "human_session";
10350
- /** @enum {string} */
10351
- alternative_action: "monitoring_requeue";
10352
- alternative_description: string;
10378
+ "application/json": components["schemas"]["Error"] & {
10379
+ /**
10380
+ * @deprecated
10381
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10382
+ */
10383
+ message?: string;
10384
+ /**
10385
+ * @deprecated
10386
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10387
+ * @enum {string}
10388
+ */
10389
+ code?: "refresh_authorization_provenance_required";
10390
+ /**
10391
+ * @deprecated
10392
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10393
+ * @enum {boolean}
10394
+ */
10395
+ retryable?: false;
10396
+ /**
10397
+ * @deprecated
10398
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10399
+ * @enum {string}
10400
+ */
10401
+ scope?: "platform";
10402
+ /**
10403
+ * @deprecated
10404
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10405
+ * @enum {string}
10406
+ */
10407
+ applies_to?: "human_session";
10408
+ /**
10409
+ * @deprecated
10410
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10411
+ * @enum {string}
10412
+ */
10413
+ alternative_action?: "monitoring_requeue";
10414
+ /**
10415
+ * @deprecated
10416
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10417
+ */
10418
+ alternative_description?: string;
10353
10419
  /**
10354
10420
  * Format: uri
10355
- * @description Issue tracking the restoration of human-initiated refresh
10421
+ * @deprecated
10422
+ * @description Deprecated: removed from the AgenticAdvertising.org registry OpenAPI and no longer sent. Retained as an optional property for SDK 14.x type compatibility; it will be removed in the next major release.
10356
10423
  */
10357
- tracking_issue: string;
10424
+ tracking_issue?: string;
10358
10425
  };
10359
10426
  };
10360
10427
  };
@@ -10922,7 +10989,7 @@ export interface operations {
10922
10989
  query?: {
10923
10990
  /** @description Filter by storyboard category */
10924
10991
  category?: string;
10925
- /** @description Compliance target to inspect, e.g. 3.1, 3.0, 3.1-rc, or 3.1-beta */
10992
+ /** @description Compliance target to inspect, e.g. 3.2, 3.1, 3.0, 3.2-rc, or 3.2-beta */
10926
10993
  compliance_target?: string;
10927
10994
  };
10928
10995
  header?: never;
@@ -10959,7 +11026,7 @@ export interface operations {
10959
11026
  getStoryboard: {
10960
11027
  parameters: {
10961
11028
  query?: {
10962
- /** @description Compliance target to inspect, e.g. 3.1, 3.0, 3.1-rc, or 3.1-beta */
11029
+ /** @description Compliance target to inspect, e.g. 3.2, 3.1, 3.0, 3.2-rc, or 3.2-beta */
10963
11030
  compliance_target?: string;
10964
11031
  };
10965
11032
  header?: never;
@@ -11342,7 +11409,7 @@ export interface operations {
11342
11409
  getStoryboardFirstStep: {
11343
11410
  parameters: {
11344
11411
  query?: {
11345
- /** @description Compliance target to inspect, e.g. 3.1, 3.0, 3.1-rc, or 3.1-beta */
11412
+ /** @description Compliance target to inspect, e.g. 3.2, 3.1, 3.0, 3.2-rc, or 3.2-beta */
11346
11413
  compliance_target?: string;
11347
11414
  };
11348
11415
  header?: never;