@adcp/sdk 16.0.0 → 16.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 (85) hide show
  1. package/README.md +52 -0
  2. package/bin/adcp-identity.js +3 -2
  3. package/dist/lib/client/core.d.mts +1 -1
  4. package/dist/lib/client/core.d.ts +1 -1
  5. package/dist/lib/core/AgentClient.d.mts +8 -1
  6. package/dist/lib/core/AgentClient.d.ts +8 -1
  7. package/dist/lib/core/AgentClient.js +10 -0
  8. package/dist/lib/core/AgentClient.mjs +10 -0
  9. package/dist/lib/core/AsyncHandler.d.mts +2 -0
  10. package/dist/lib/core/AsyncHandler.d.ts +2 -0
  11. package/dist/lib/core/AsyncHandler.js +1 -1
  12. package/dist/lib/core/AsyncHandler.mjs +1 -1
  13. package/dist/lib/core/ConversationTypes.d.mts +32 -0
  14. package/dist/lib/core/ConversationTypes.d.ts +32 -0
  15. package/dist/lib/core/SingleAgentClient.d.mts +11 -1
  16. package/dist/lib/core/SingleAgentClient.d.ts +11 -1
  17. package/dist/lib/core/SingleAgentClient.js +25 -6
  18. package/dist/lib/core/SingleAgentClient.mjs +26 -7
  19. package/dist/lib/core/TaskExecutor.d.mts +3 -1
  20. package/dist/lib/core/TaskExecutor.d.ts +3 -1
  21. package/dist/lib/core/TaskExecutor.js +127 -34
  22. package/dist/lib/core/TaskExecutor.mjs +127 -34
  23. package/dist/lib/core/task-deadline.d.mts +2 -0
  24. package/dist/lib/core/task-deadline.d.ts +2 -0
  25. package/dist/lib/core/task-deadline.js +20 -2
  26. package/dist/lib/core/task-deadline.mjs +19 -2
  27. package/dist/lib/governance/authorization.d.mts +66 -0
  28. package/dist/lib/governance/authorization.d.ts +66 -0
  29. package/dist/lib/governance/authorization.js +181 -37
  30. package/dist/lib/governance/authorization.mjs +183 -36
  31. package/dist/lib/governance/index.d.mts +2 -2
  32. package/dist/lib/governance/index.d.ts +2 -2
  33. package/dist/lib/governance/index.js +4 -2
  34. package/dist/lib/governance/index.mjs +3 -1
  35. package/dist/lib/identity-3.3/index.d.mts +1 -0
  36. package/dist/lib/identity-3.3/index.d.ts +1 -0
  37. package/dist/lib/identity-3.3/index.js +3 -1
  38. package/dist/lib/identity-3.3/index.mjs +1 -0
  39. package/dist/lib/identity-3.3/jws-artifacts.d.mts +147 -0
  40. package/dist/lib/identity-3.3/jws-artifacts.d.ts +147 -0
  41. package/dist/lib/identity-3.3/jws-artifacts.js +258 -0
  42. package/dist/lib/identity-3.3/jws-artifacts.mjs +234 -0
  43. package/dist/lib/identity-3.3/revocation.d.mts +7 -0
  44. package/dist/lib/identity-3.3/revocation.d.ts +7 -0
  45. package/dist/lib/identity-3.3/revocation.js +13 -0
  46. package/dist/lib/identity-3.3/revocation.mjs +13 -0
  47. package/dist/lib/identity-3.3/schemas.draft.js +1 -1
  48. package/dist/lib/identity-3.3/schemas.draft.mjs +1 -1
  49. package/dist/lib/identity-3.3/trust.d.mts +8 -0
  50. package/dist/lib/identity-3.3/trust.d.ts +8 -0
  51. package/dist/lib/identity-3.3/trust.js +41 -12
  52. package/dist/lib/identity-3.3/trust.mjs +40 -12
  53. package/dist/lib/index.d.mts +3 -3
  54. package/dist/lib/index.d.ts +3 -3
  55. package/dist/lib/index.js +2 -0
  56. package/dist/lib/index.mjs +2 -0
  57. package/dist/lib/registry/types.generated.d.mts +24 -1
  58. package/dist/lib/registry/types.generated.d.ts +24 -1
  59. package/dist/lib/server/account-sync-contract.js +4 -1
  60. package/dist/lib/server/account-sync-contract.mjs +4 -1
  61. package/dist/lib/server/decisioning/runtime/from-platform.js +22 -17
  62. package/dist/lib/server/decisioning/runtime/from-platform.mjs +22 -17
  63. package/dist/lib/server/index.d.mts +2 -2
  64. package/dist/lib/server/index.d.ts +2 -2
  65. package/dist/lib/server/index.js +2 -0
  66. package/dist/lib/server/index.mjs +2 -0
  67. package/dist/lib/signing/web-bot-auth.js +25 -5
  68. package/dist/lib/signing/web-bot-auth.mjs +25 -6
  69. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  70. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  71. package/dist/lib/v2/projection/catalog.d.mts +6 -0
  72. package/dist/lib/v2/projection/catalog.d.ts +6 -0
  73. package/dist/lib/v2/projection/catalog.js +5 -0
  74. package/dist/lib/v2/projection/catalog.mjs +4 -0
  75. package/dist/lib/v2/projection/v1-to-v2.js +3 -2
  76. package/dist/lib/v2/projection/v1-to-v2.mjs +4 -3
  77. package/dist/lib/version.d.mts +3 -3
  78. package/dist/lib/version.d.ts +3 -3
  79. package/dist/lib/version.js +3 -3
  80. package/dist/lib/version.mjs +3 -3
  81. package/docs/TYPE-SUMMARY.md +12 -2
  82. package/docs/llms.txt +3 -3
  83. package/docs/migration-14.x-rc-worksheet.md +4 -4
  84. package/docs/migration-agent-identity-3.3.md +72 -19
  85. package/package.json +6 -4
@@ -0,0 +1,234 @@
1
+ import { compactVerify, decodeProtectedHeader, importJWK } from "jose";
2
+ import { ssrfSafeFetch } from "../net/index.mjs";
3
+ import { canonicalAgentOrigin } from "../signing/agent-resolver/canonicalize.mjs";
4
+ import { eTldPlusOne } from "../signing/agent-resolver/etld.mjs";
5
+ import { parseStrictJson } from "../signing/agent-resolver/strict-json.mjs";
6
+ import {
7
+ isRefusedWebBotAuthTestKey,
8
+ jwkThumbprint,
9
+ receivedAgentOrigin
10
+ } from "../signing/web-bot-auth.mjs";
11
+ class JwsArtifactError extends Error {
12
+ constructor(code, message, options) {
13
+ super(message);
14
+ this.code = code;
15
+ this.name = "JwsArtifactError";
16
+ if (options?.cause !== void 0) Object.defineProperty(this, "cause", { value: options.cause });
17
+ }
18
+ code;
19
+ /** True for outages: retry later, never treat as absence or as a verdict on the artifact. */
20
+ get transient() {
21
+ return this.code === "jws_key_unavailable" || this.code === "jws_revocation_unavailable";
22
+ }
23
+ }
24
+ async function selectJwsArtifactProfile(signingAgentUrl, trust) {
25
+ const origin = canonicalAgentOrigin(signingAgentUrl);
26
+ try {
27
+ eTldPlusOne(origin);
28
+ } catch {
29
+ return { profile: "3.2", origin, reason: "no_trust_record" };
30
+ }
31
+ let record;
32
+ try {
33
+ record = await trust.get(origin);
34
+ } catch (cause) {
35
+ throw new JwsArtifactError("jws_key_unavailable", "Issuer trust record is unavailable", { cause });
36
+ }
37
+ if (record.status !== "present") return { profile: "3.2", origin, reason: "no_trust_record" };
38
+ const listed = (record.record.agents ?? []).some((agent) => {
39
+ try {
40
+ return canonicalAgentOrigin(agent.url) === origin;
41
+ } catch {
42
+ return false;
43
+ }
44
+ });
45
+ return listed ? { profile: "web-bot-auth", origin, operator: record.operator } : { profile: "3.2", origin, reason: "unlisted" };
46
+ }
47
+ async function verifyWebBotAuthJwsArtifact(token, origin, options) {
48
+ if (typeof options.typ !== "string" || !options.typ)
49
+ throw new TypeError("verifyWebBotAuthJwsArtifact requires the typ the surface accepts");
50
+ if (options.revocation === void 0)
51
+ throw new TypeError("verifyWebBotAuthJwsArtifact requires a revocation resolver, or revocation: false");
52
+ let header;
53
+ try {
54
+ header = decodeProtectedHeader(token);
55
+ } catch {
56
+ throw new JwsArtifactError("jws_invalid", "Malformed JWS protected header");
57
+ }
58
+ if (header.typ !== options.typ)
59
+ throw new JwsArtifactError("jws_invalid", "JWS typ is not the one this surface accepts");
60
+ if (header.alg !== "EdDSA") throw new JwsArtifactError("jws_invalid", "A Web Bot Auth JWS artifact uses alg EdDSA");
61
+ const kid = header.kid;
62
+ if (typeof kid !== "string" || kid.length === 0 || kid.length > 256)
63
+ throw new JwsArtifactError("jws_key_unknown", "JWS kid is missing");
64
+ try {
65
+ origin = receivedAgentOrigin(canonicalAgentOrigin(origin));
66
+ } catch {
67
+ throw new JwsArtifactError("jws_key_unknown", "Signing origin is not an https origin");
68
+ }
69
+ let key = null;
70
+ let keySource = "directory";
71
+ let directoryFailure;
72
+ try {
73
+ key = await options.directory.resolve(kid, origin);
74
+ } catch (cause) {
75
+ directoryFailure = cause;
76
+ }
77
+ if (!key && options.archive) {
78
+ const archived = await options.archive.resolve(origin, kid);
79
+ if (archived) {
80
+ key = archived;
81
+ keySource = "archive";
82
+ }
83
+ }
84
+ if (!key) {
85
+ if (directoryFailure !== void 0)
86
+ throw new JwsArtifactError("jws_key_unavailable", "Issuer key directory is unavailable", {
87
+ cause: directoryFailure
88
+ });
89
+ throw new JwsArtifactError("jws_key_unknown", "No key at the issuer origin carries this kid");
90
+ }
91
+ if (key.kty !== "OKP" || key.crv !== "Ed25519" || typeof key.x !== "string")
92
+ throw new JwsArtifactError("jws_invalid", "A Web Bot Auth JWS artifact is signed with an Ed25519 key");
93
+ let thumbprint;
94
+ try {
95
+ thumbprint = jwkThumbprint(key);
96
+ } catch {
97
+ throw new JwsArtifactError("jws_invalid", "Key thumbprint cannot be computed");
98
+ }
99
+ if (kid !== thumbprint) throw new JwsArtifactError("jws_invalid", "JWS kid is not the key JWK thumbprint");
100
+ let verified;
101
+ try {
102
+ const publicKey = { kty: "OKP", crv: "Ed25519", x: key.x };
103
+ verified = await compactVerify(token, await importJWK(publicKey, "EdDSA"), {
104
+ algorithms: ["EdDSA"],
105
+ ...options.crit ? { crit: options.crit } : {}
106
+ });
107
+ } catch {
108
+ throw new JwsArtifactError("jws_invalid", "JWS signature verification failed");
109
+ }
110
+ const result = {
111
+ origin,
112
+ kid,
113
+ key,
114
+ keySource,
115
+ protectedHeader: verified.protectedHeader,
116
+ payload: verified.payload
117
+ };
118
+ if (options.revocation) {
119
+ let status;
120
+ try {
121
+ status = await options.revocation.status(origin, kid);
122
+ } catch (cause) {
123
+ throw new JwsArtifactError("jws_revocation_unavailable", "Issuer revocation status could not be established", {
124
+ cause
125
+ });
126
+ }
127
+ if (status === "unknown" || status === "absent" && (options.revocationAbsent ?? "reject") === "reject")
128
+ throw new JwsArtifactError("jws_revocation_unavailable", "Issuer revocation status could not be established");
129
+ if (status === "revoked") {
130
+ if ((options.revokedKey ?? "reject") === "reject")
131
+ throw new JwsArtifactError("jws_key_revoked", "Signing key is revoked by its origin");
132
+ try {
133
+ const detail = await options.revocation.detail(origin, kid);
134
+ if (detail) result.revocationDetail = detail;
135
+ } catch (cause) {
136
+ throw new JwsArtifactError("jws_revocation_unavailable", "Issuer revocation detail could not be read", {
137
+ cause
138
+ });
139
+ }
140
+ }
141
+ result.revocation = status;
142
+ }
143
+ return result;
144
+ }
145
+ const GOVERNANCE_KEY_ARCHIVE_PATH = "/.well-known/jwks-archive.json";
146
+ const ARCHIVE_FAILURE_COOLDOWN_SECONDS = 60;
147
+ class GovernanceKeyArchiveResolver {
148
+ constructor(options = {}) {
149
+ this.options = options;
150
+ const maxAge = options.maxAgeSeconds ?? 300;
151
+ if (!Number.isFinite(maxAge) || maxAge < 0)
152
+ throw new TypeError("maxAgeSeconds must be a finite, non-negative number");
153
+ this.maxOrigins = options.maxOrigins ?? 256;
154
+ if (!Number.isSafeInteger(this.maxOrigins) || this.maxOrigins < 1)
155
+ throw new TypeError("maxOrigins must be a positive safe integer");
156
+ }
157
+ options;
158
+ cache = /* @__PURE__ */ new Map();
159
+ failures = /* @__PURE__ */ new Map();
160
+ pending = /* @__PURE__ */ new Map();
161
+ maxOrigins;
162
+ async resolve(origin, kid) {
163
+ origin = receivedAgentOrigin(canonicalAgentOrigin(origin));
164
+ const now = (this.options.now ?? (() => Date.now() / 1e3))();
165
+ const cached = this.cache.get(origin);
166
+ let keys;
167
+ if (cached && cached.freshUntil > now) keys = cached.keys;
168
+ else {
169
+ const failure = this.failures.get(origin);
170
+ if (failure && failure.until > now)
171
+ throw new JwsArtifactError("jws_key_unavailable", "Governance key archive is unavailable", {
172
+ cause: failure.cause
173
+ });
174
+ let pending = this.pending.get(origin);
175
+ if (!pending) {
176
+ pending = this.fetch(origin, now);
177
+ this.pending.set(origin, pending);
178
+ }
179
+ try {
180
+ keys = await pending;
181
+ } finally {
182
+ if (this.pending.get(origin) === pending) this.pending.delete(origin);
183
+ }
184
+ }
185
+ return keys.find((key) => key.kid === kid) ?? null;
186
+ }
187
+ async fetch(origin, now) {
188
+ let keys;
189
+ try {
190
+ const response = await ssrfSafeFetch(origin + GOVERNANCE_KEY_ARCHIVE_PATH, {
191
+ ...this.options.fetchOptions,
192
+ headers: { accept: "application/json" },
193
+ timeoutMs: 1e4,
194
+ maxBodyBytes: 1024 * 1024
195
+ });
196
+ if (response.status === 404 || response.status === 410) keys = [];
197
+ else {
198
+ if (response.status !== 200) throw new Error(`Archive answered ${response.status}`);
199
+ const document = parseStrictJson(new TextDecoder("utf-8", { fatal: true }).decode(response.body), 32);
200
+ if (!Array.isArray(document.keys) || document.keys.length > 4096) throw new Error("Invalid key archive");
201
+ keys = [];
202
+ for (const raw of document.keys) {
203
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) continue;
204
+ const jwk = raw;
205
+ if (Object.keys(jwk).some((name) => PRIVATE_JWK_MEMBERS.has(name.toLowerCase()) || name.startsWith("_private")))
206
+ throw new Error("Key archive publishes private key material");
207
+ if (jwk.kty !== "OKP" || jwk.crv !== "Ed25519" || typeof jwk.x !== "string") continue;
208
+ const thumbprint = jwkThumbprint(jwk);
209
+ if (jwk.kid !== void 0 && jwk.kid !== thumbprint) continue;
210
+ if (isRefusedWebBotAuthTestKey(thumbprint, this.options.allowTestKeys)) continue;
211
+ keys.push({ kty: "OKP", crv: "Ed25519", x: jwk.x, kid: thumbprint });
212
+ }
213
+ }
214
+ } catch (cause) {
215
+ if (this.failures.size >= this.maxOrigins && !this.failures.has(origin))
216
+ this.failures.delete(this.failures.keys().next().value);
217
+ this.failures.set(origin, { until: now + ARCHIVE_FAILURE_COOLDOWN_SECONDS, cause });
218
+ throw new JwsArtifactError("jws_key_unavailable", "Governance key archive is unavailable", { cause });
219
+ }
220
+ this.failures.delete(origin);
221
+ if (this.cache.size >= this.maxOrigins && !this.cache.has(origin))
222
+ this.cache.delete(this.cache.keys().next().value);
223
+ this.cache.set(origin, { keys, freshUntil: now + (this.options.maxAgeSeconds ?? 300) });
224
+ return keys;
225
+ }
226
+ }
227
+ const PRIVATE_JWK_MEMBERS = /* @__PURE__ */ new Set(["d", "p", "q", "dp", "dq", "qi", "oth", "k"]);
228
+ export {
229
+ GOVERNANCE_KEY_ARCHIVE_PATH,
230
+ GovernanceKeyArchiveResolver,
231
+ JwsArtifactError,
232
+ selectJwsArtifactProfile,
233
+ verifyWebBotAuthJwsArtifact
234
+ };
@@ -78,6 +78,13 @@ export declare class OriginRevocationResolver {
78
78
  */
79
79
  status(originUrl: string, keyid: string): Promise<OriginRevocationStatus>;
80
80
  private currentStatus;
81
+ /**
82
+ * The most severe detail stored for a revoked key (R9: `keyCompromise` and
83
+ * the earliest `invalidity_date` win), or undefined when the key is not
84
+ * revoked. Reads the history store only; call {@link status} first to refresh.
85
+ * Throws {@link WebBotAuthUnavailableError} when the store fails.
86
+ */
87
+ detail(originUrl: string, keyid: string): Promise<RevocationDetail | undefined>;
81
88
  private readStored;
82
89
  private refresh;
83
90
  private now;
@@ -78,6 +78,13 @@ export declare class OriginRevocationResolver {
78
78
  */
79
79
  status(originUrl: string, keyid: string): Promise<OriginRevocationStatus>;
80
80
  private currentStatus;
81
+ /**
82
+ * The most severe detail stored for a revoked key (R9: `keyCompromise` and
83
+ * the earliest `invalidity_date` win), or undefined when the key is not
84
+ * revoked. Reads the history store only; call {@link status} first to refresh.
85
+ * Throws {@link WebBotAuthUnavailableError} when the store fails.
86
+ */
87
+ detail(originUrl: string, keyid: string): Promise<RevocationDetail | undefined>;
81
88
  private readStored;
82
89
  private refresh;
83
90
  private now;
@@ -186,6 +186,19 @@ class OriginRevocationResolver {
186
186
  }
187
187
  return settled();
188
188
  }
189
+ /**
190
+ * The most severe detail stored for a revoked key (R9: `keyCompromise` and
191
+ * the earliest `invalidity_date` win), or undefined when the key is not
192
+ * revoked. Reads the history store only; call {@link status} first to refresh.
193
+ * Throws {@link WebBotAuthUnavailableError} when the store fails.
194
+ */
195
+ async detail(originUrl, keyid) {
196
+ try {
197
+ return await this.readStored((0, import_canonicalize.canonicalAgentOrigin)(originUrl), keyid);
198
+ } catch (error) {
199
+ throw new import_web_bot_auth.WebBotAuthUnavailableError("revocation_persistence_failed", error);
200
+ }
201
+ }
189
202
  async readStored(origin, keyid) {
190
203
  try {
191
204
  return await this.options.store.get(origin, keyid);
@@ -165,6 +165,19 @@ class OriginRevocationResolver {
165
165
  }
166
166
  return settled();
167
167
  }
168
+ /**
169
+ * The most severe detail stored for a revoked key (R9: `keyCompromise` and
170
+ * the earliest `invalidity_date` win), or undefined when the key is not
171
+ * revoked. Reads the history store only; call {@link status} first to refresh.
172
+ * Throws {@link WebBotAuthUnavailableError} when the store fails.
173
+ */
174
+ async detail(originUrl, keyid) {
175
+ try {
176
+ return await this.readStored(canonicalAgentOrigin(originUrl), keyid);
177
+ } catch (error) {
178
+ throw new WebBotAuthUnavailableError("revocation_persistence_failed", error);
179
+ }
180
+ }
168
181
  async readStored(origin, keyid) {
169
182
  try {
170
183
  return await this.options.store.get(origin, keyid);
@@ -242,7 +242,7 @@ var schemas_draft_default = [
242
242
  properties: {
243
243
  grantee: {
244
244
  $ref: "#/definitions/domain",
245
- description: "Domain of the organization receiving the grant. Its agents resolve to this domain through its own trust.json."
245
+ description: "Registrable domain (eTLD+1) of the organization receiving the grant, under the pinned Public Suffix List snapshot, ICANN and private sections (spec R3a step 1). Its agents resolve to this domain through its own trust.json. A host below a registrable domain (t1.vendor.example) is not one, and neither is a public suffix itself (github.io); alice.github.io is one, because github.io is in the private section. A grant whose grantee is not a registrable domain covers no claim, and its scopes still count for exclusive_grants, as L2 \xA7Grants in trust records describes (docs/building/by-layer/L2/accounts-and-agents.mdx). A pattern can't evaluate the Public Suffix List, so verifiers apply the rule. To limit a grant to some of the grantee's agents, list them in agents[]."
246
246
  },
247
247
  agents: {
248
248
  type: "array",
@@ -219,7 +219,7 @@ var schemas_draft_default = [
219
219
  properties: {
220
220
  grantee: {
221
221
  $ref: "#/definitions/domain",
222
- description: "Domain of the organization receiving the grant. Its agents resolve to this domain through its own trust.json."
222
+ description: "Registrable domain (eTLD+1) of the organization receiving the grant, under the pinned Public Suffix List snapshot, ICANN and private sections (spec R3a step 1). Its agents resolve to this domain through its own trust.json. A host below a registrable domain (t1.vendor.example) is not one, and neither is a public suffix itself (github.io); alice.github.io is one, because github.io is in the private section. A grant whose grantee is not a registrable domain covers no claim, and its scopes still count for exclusive_grants, as L2 \xA7Grants in trust records describes (docs/building/by-layer/L2/accounts-and-agents.mdx). A pattern can't evaluate the Public Suffix List, so verifiers apply the rule. To limit a grant to some of the grantee's agents, list them in agents[]."
223
223
  },
224
224
  agents: {
225
225
  type: "array",
@@ -34,6 +34,14 @@ export declare class TrustMembershipError extends IdentityAuthorizationError {
34
34
  }
35
35
  /** Schema plus semantic checks; publication never includes identity keys. */
36
36
  export declare function validateTrustRecord(value: unknown): asserts value is TrustRecord;
37
+ /**
38
+ * Publication rules beyond the schema: every grant's `grantee` is a
39
+ * registrable domain and every `agents[].url` parses as an agent origin. A
40
+ * relying party ignores a grant that breaks either, so publishing one grants
41
+ * nothing while still making `grants[]` exhaustive for its scopes.
42
+ */
43
+ export declare function assertPublishableTrustRecord(record: TrustRecord): void;
44
+ /** Validate ({@link assertPublishableTrustRecord}) and copy a trust record for publication. */
37
45
  export declare function createTrustRecord(record: TrustRecord): TrustRecord;
38
46
  export type TrustFetchResult = {
39
47
  status: 'present';
@@ -34,6 +34,14 @@ export declare class TrustMembershipError extends IdentityAuthorizationError {
34
34
  }
35
35
  /** Schema plus semantic checks; publication never includes identity keys. */
36
36
  export declare function validateTrustRecord(value: unknown): asserts value is TrustRecord;
37
+ /**
38
+ * Publication rules beyond the schema: every grant's `grantee` is a
39
+ * registrable domain and every `agents[].url` parses as an agent origin. A
40
+ * relying party ignores a grant that breaks either, so publishing one grants
41
+ * nothing while still making `grants[]` exhaustive for its scopes.
42
+ */
43
+ export declare function assertPublishableTrustRecord(record: TrustRecord): void;
44
+ /** Validate ({@link assertPublishableTrustRecord}) and copy a trust record for publication. */
37
45
  export declare function createTrustRecord(record: TrustRecord): TrustRecord;
38
46
  export type TrustFetchResult = {
39
47
  status: 'present';
@@ -32,6 +32,7 @@ __export(trust_exports, {
32
32
  TrustEvaluator: () => TrustEvaluator,
33
33
  TrustMembershipError: () => TrustMembershipError,
34
34
  TrustRecordUnavailableError: () => TrustRecordUnavailableError,
35
+ assertPublishableTrustRecord: () => assertPublishableTrustRecord,
35
36
  authorizeDemandGrant: () => authorizeDemandGrant,
36
37
  createTrustRecord: () => createTrustRecord,
37
38
  validateIdentity33Schema: () => validateIdentity33Schema,
@@ -110,8 +111,34 @@ function validateTrustRecord(value) {
110
111
  origins.add(origin);
111
112
  }
112
113
  }
113
- function createTrustRecord(record) {
114
+ function registrableGrantee(grantee) {
115
+ try {
116
+ return (0, import_etld.eTldPlusOne)(grantee) === grantee ? grantee : void 0;
117
+ } catch {
118
+ return void 0;
119
+ }
120
+ }
121
+ function grantAgentOrigin(url) {
122
+ try {
123
+ return (0, import_canonicalize.canonicalAgentOrigin)(url);
124
+ } catch {
125
+ return void 0;
126
+ }
127
+ }
128
+ function assertPublishableTrustRecord(record) {
114
129
  validateTrustRecord(record);
130
+ for (const grant of record.grants ?? []) {
131
+ if (registrableGrantee(grant.grantee) === void 0)
132
+ throw new TypeError(
133
+ `Grant grantee "${grant.grantee}" is not a registrable domain; name the organization's registrable domain and narrow with agents[]`
134
+ );
135
+ for (const agent of grant.agents ?? [])
136
+ if (grantAgentOrigin(agent.url) === void 0)
137
+ throw new TypeError(`Grant agents[] URL "${agent.url}" is not a valid agent origin`);
138
+ }
139
+ }
140
+ function createTrustRecord(record) {
141
+ assertPublishableTrustRecord(record);
115
142
  return structuredClone(record);
116
143
  }
117
144
  class TrustEvaluator {
@@ -308,13 +335,15 @@ function authorityGroup(operator) {
308
335
  const provider = (0, import_tldts.parse)(operator).domain;
309
336
  return `private:${provider ?? operator}`;
310
337
  }
338
+ function grantsScope(grant, scope) {
339
+ return grant.scopes.some(
340
+ (granted) => granted === "*" || granted === scope || granted === "adcp:all" && scope.startsWith("adcp:")
341
+ );
342
+ }
311
343
  function grantMatches(grant, target, claim, now) {
312
- if ((0, import_etld.eTldPlusOne)(grant.grantee) !== target) return false;
313
- if (!grant.scopes.some(
314
- (scope) => scope === "*" || scope === claim.scope || scope === "adcp:all" && claim.scope.startsWith("adcp:")
315
- ))
316
- return false;
317
- if (grant.agents && !grant.agents.some((agent) => (0, import_canonicalize.canonicalAgentOrigin)(agent.url) === (0, import_canonicalize.canonicalAgentOrigin)(claim.signerOrigin)))
344
+ if (registrableGrantee(grant.grantee) !== target) return false;
345
+ if (!grantsScope(grant, claim.scope)) return false;
346
+ if (grant.agents && !grant.agents.some((agent) => grantAgentOrigin(agent.url) === (0, import_canonicalize.canonicalAgentOrigin)(claim.signerOrigin)))
318
347
  return false;
319
348
  const brands = grant.profiles?.adcp?.brands;
320
349
  if (brands && !brands.includes("*") && (!claim.brand.brand_id || !brands.includes(claim.brand.brand_id)))
@@ -361,11 +390,10 @@ async function authorizeDemandGrant(claim, options) {
361
390
  if (second) return result("trust", [brand, account, operator], [first[0], second]);
362
391
  }
363
392
  }
364
- const covered = (record.record.grants ?? []).some(
365
- (g) => ((0, import_etld.eTldPlusOne)(g.grantee) === account || selfOperated && (0, import_etld.eTldPlusOne)(g.grantee) === operator) && g.scopes.some(
366
- (scope) => scope === "*" || scope === claim.scope || scope === "adcp:all" && claim.scope.startsWith("adcp:")
367
- )
368
- );
393
+ const covered = (record.record.grants ?? []).some((g) => {
394
+ const grantee = registrableGrantee(g.grantee);
395
+ return grantee !== void 0 && (grantee === account || selfOperated && grantee === operator) && grantsScope(g, claim.scope);
396
+ });
369
397
  if (!covered && !record.record.exclusive_grants && await options.sellerAuthorization?.(claim))
370
398
  return result("seller", [brand, account, operator]);
371
399
  throw new IdentityAuthorizationError("grant_absent");
@@ -376,6 +404,7 @@ async function authorizeDemandGrant(claim, options) {
376
404
  TrustEvaluator,
377
405
  TrustMembershipError,
378
406
  TrustRecordUnavailableError,
407
+ assertPublishableTrustRecord,
379
408
  authorizeDemandGrant,
380
409
  createTrustRecord,
381
410
  validateIdentity33Schema,
@@ -70,8 +70,34 @@ function validateTrustRecord(value) {
70
70
  origins.add(origin);
71
71
  }
72
72
  }
73
- function createTrustRecord(record) {
73
+ function registrableGrantee(grantee) {
74
+ try {
75
+ return eTldPlusOne(grantee) === grantee ? grantee : void 0;
76
+ } catch {
77
+ return void 0;
78
+ }
79
+ }
80
+ function grantAgentOrigin(url) {
81
+ try {
82
+ return canonicalAgentOrigin(url);
83
+ } catch {
84
+ return void 0;
85
+ }
86
+ }
87
+ function assertPublishableTrustRecord(record) {
74
88
  validateTrustRecord(record);
89
+ for (const grant of record.grants ?? []) {
90
+ if (registrableGrantee(grant.grantee) === void 0)
91
+ throw new TypeError(
92
+ `Grant grantee "${grant.grantee}" is not a registrable domain; name the organization's registrable domain and narrow with agents[]`
93
+ );
94
+ for (const agent of grant.agents ?? [])
95
+ if (grantAgentOrigin(agent.url) === void 0)
96
+ throw new TypeError(`Grant agents[] URL "${agent.url}" is not a valid agent origin`);
97
+ }
98
+ }
99
+ function createTrustRecord(record) {
100
+ assertPublishableTrustRecord(record);
75
101
  return structuredClone(record);
76
102
  }
77
103
  class TrustEvaluator {
@@ -268,13 +294,15 @@ function authorityGroup(operator) {
268
294
  const provider = parseDomain(operator).domain;
269
295
  return `private:${provider ?? operator}`;
270
296
  }
297
+ function grantsScope(grant, scope) {
298
+ return grant.scopes.some(
299
+ (granted) => granted === "*" || granted === scope || granted === "adcp:all" && scope.startsWith("adcp:")
300
+ );
301
+ }
271
302
  function grantMatches(grant, target, claim, now) {
272
- if (eTldPlusOne(grant.grantee) !== target) return false;
273
- if (!grant.scopes.some(
274
- (scope) => scope === "*" || scope === claim.scope || scope === "adcp:all" && claim.scope.startsWith("adcp:")
275
- ))
276
- return false;
277
- if (grant.agents && !grant.agents.some((agent) => canonicalAgentOrigin(agent.url) === canonicalAgentOrigin(claim.signerOrigin)))
303
+ if (registrableGrantee(grant.grantee) !== target) return false;
304
+ if (!grantsScope(grant, claim.scope)) return false;
305
+ if (grant.agents && !grant.agents.some((agent) => grantAgentOrigin(agent.url) === canonicalAgentOrigin(claim.signerOrigin)))
278
306
  return false;
279
307
  const brands = grant.profiles?.adcp?.brands;
280
308
  if (brands && !brands.includes("*") && (!claim.brand.brand_id || !brands.includes(claim.brand.brand_id)))
@@ -321,11 +349,10 @@ async function authorizeDemandGrant(claim, options) {
321
349
  if (second) return result("trust", [brand, account, operator], [first[0], second]);
322
350
  }
323
351
  }
324
- const covered = (record.record.grants ?? []).some(
325
- (g) => (eTldPlusOne(g.grantee) === account || selfOperated && eTldPlusOne(g.grantee) === operator) && g.scopes.some(
326
- (scope) => scope === "*" || scope === claim.scope || scope === "adcp:all" && claim.scope.startsWith("adcp:")
327
- )
328
- );
352
+ const covered = (record.record.grants ?? []).some((g) => {
353
+ const grantee = registrableGrantee(g.grantee);
354
+ return grantee !== void 0 && (grantee === account || selfOperated && grantee === operator) && grantsScope(g, claim.scope);
355
+ });
329
356
  if (!covered && !record.record.exclusive_grants && await options.sellerAuthorization?.(claim))
330
357
  return result("seller", [brand, account, operator]);
331
358
  throw new IdentityAuthorizationError("grant_absent");
@@ -335,6 +362,7 @@ export {
335
362
  TrustEvaluator,
336
363
  TrustMembershipError,
337
364
  TrustRecordUnavailableError,
365
+ assertPublishableTrustRecord,
338
366
  authorizeDemandGrant,
339
367
  createTrustRecord,
340
368
  validateIdentity33Schema,
@@ -36,17 +36,17 @@ export { match, attachMatch } from './core/match.mjs';
36
36
  export type { MatchHandlers, PartialMatchHandlers } from './core/match.mjs';
37
37
  export { ProtocolResponseParser, responseParser, ADCP_STATUS, type ADCPStatus } from './core/ProtocolResponseParser.mjs';
38
38
  export { ResponseValidator, responseValidator, type ValidationResult, type ValidationOptions, } from './core/ResponseValidator.mjs';
39
- export type { Message, InputRequest, InputHandler, InputHandlerResponse, ConversationContext, TaskOptions, WebhookToolPredicate, WebhookUrlTemplate, TaskResult, TaskResultCompleted, TaskResultIntermediate, TaskResultFailure, TaskResultMetadata, DeferredContinuation, DirectPauseRecoveryRequest, TaskState, TaskStatus, ConversationConfig, AdcpErrorInfo, AdcpValidationIssue, } from './core/ConversationTypes.mjs';
39
+ export type { Message, InputRequest, InputHandler, InputHandlerResponse, ConversationContext, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskInfo, WebhookToolPredicate, WebhookUrlTemplate, TaskResult, TaskResultCompleted, TaskResultIntermediate, TaskResultFailure, TaskResultMetadata, DeferredContinuation, DirectPauseRecoveryRequest, TaskState, TaskStatus, ConversationConfig, AdcpErrorInfo, AdcpValidationIssue, } from './core/ConversationTypes.mjs';
40
40
  export type { GovernanceConfig, CampaignGovernanceConfig, GovernanceCheckResult, GovernanceOutcome, GovernanceFinding, GovernanceIntentDetails, GovernanceCondition, GovernanceEscalation, NormalizedGovernanceApproved, NormalizedGovernanceConditions, NormalizedGovernanceDenied, NormalizedGovernanceVerdict, } from './core/GovernanceTypes.mjs';
41
41
  export { GovernanceMiddleware } from './core/GovernanceMiddleware.mjs';
42
42
  export { isGovernanceApproved, isGovernanceConditions, isGovernanceDenied, normalizeGovernanceVerdict, } from './core/GovernanceTypes.mjs';
43
43
  export type { GovernanceDebugEntry } from './core/GovernanceMiddleware.mjs';
44
- export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, createGovernanceAgentJwksResolver, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance/index.mjs';
44
+ export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, verifyHistoricalGovernanceContext, createGovernanceAgentJwksResolver, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance/index.mjs';
45
45
  export { ssrfSafeFetch, decodeBodyAsJsonOrText, SSRF_TRANSIENT_CODES, SsrfRefusedError, isPrivateIp, isAlwaysBlocked, isLikelyPrivateUrl, type SsrfRefusedCode, type SsrfDnsLookup, type SsrfFetchOptions, type SsrfFetchResult, } from './net/index.mjs';
46
46
  export { createCanonicalReferenceCache, createCanonicalReferenceResolver, canonicalReferenceCacheKey, resolveCanonicalReference, resolveFormatSchemaReference, resolvePlatformExtensionsReference, type CanonicalReference, type CanonicalReferenceCache, type CanonicalReferenceCacheOptions, type CanonicalReferenceError, type CanonicalReferenceErrorCode, type CanonicalReferenceFailureResult, type CanonicalReferenceKind, type CanonicalReferenceResolveOptions, type CanonicalReferenceResolvedResult, type CanonicalReferenceResolver, type CanonicalReferenceResolverOptions, type CanonicalReferenceResult, type CanonicalReferenceStatus, type ExternalRefDigestMap, type FormatSchemaReferenceResolvedResult, type FormatSchemaReferenceResult, type PlatformExtensionsReferenceResult, } from './canonical-references/index.mjs';
47
47
  export { assessAcceptancePolicy, createAcceptancePolicyCatalogResolver, resolveAcceptancePolicyCatalog, resolveAcceptancePolicyProfiles, resolveVerifiedAcceptancePolicyProfiles, type AcceptancePolicyCatalog, type AcceptancePolicyCatalogErrorCode, type AcceptancePolicyCatalogFailure, type AcceptancePolicyCatalogIssue, type AcceptancePolicyCatalogResolver, type AcceptancePolicyCatalogResult, type AcceptancePolicyCatalogSuccess, type AcceptancePolicyDiscoveryCapability, type AcceptancePolicyProfile, type AcceptancePolicyProfileResolution, type AcceptancePolicyRegistryPolicy, type AcceptancePolicyRegistryResolver, type AcceptancePolicyReference, type AcceptancePolicyRequirement, type AcceptancePolicyRule, type AcceptancePolicySurface, type RegistryAcceptancePolicyProfileReference, type ResolveAcceptancePolicyCatalogOptions, type ResolveVerifiedAcceptancePolicyProfilesOptions, type ResolvedAcceptancePolicyDefault, type VerifiedAcceptancePolicyProfilesResult, type VerifiedAcceptancePolicyProfilesSuccess, } from './acceptance-policy/index.mjs';
48
48
  export { type AcceptancePolicyAssessment, type AcceptancePolicyAssessmentDiagnostic, type AcceptancePolicyAssessmentDiagnosticCode, type AcceptancePolicyMatchedRule, type AcceptancePolicyOutcome, type AssessAcceptancePolicyInput, } from './acceptance-policy/evaluator.mjs';
49
- export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, GovernanceBuyerIdentity, } from './governance/index.mjs';
49
+ export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, VerifyHistoricalGovernanceContextOptions, HistoricalGovernanceContextResult, GovernanceBuyerIdentity, } from './governance/index.mjs';
50
50
  export type { BaseTaskEvent, ProtocolRequestEvent, ProtocolResponseEvent, TaskStatusEvent, ObjectEvent, TaskEvent, TaskEventCallbacks, } from './core/TaskEventTypes.mjs';
51
51
  export { createOperationId } from './core/TaskEventTypes.mjs';
52
52
  export type { AsyncHandlerConfig, WebhookMetadata, Activity, NotificationMetadata, MediaBuyDeliveryNotification, CreateMediaBuyStatusChangeHandler, UpdateMediaBuyStatusChangeHandler, SyncCreativesStatusChangeHandler, GetProductsStatusChangeHandler, ListProductsStatusChangeHandler, } from './core/AsyncHandler.mjs';
@@ -36,17 +36,17 @@ export { match, attachMatch } from './core/match';
36
36
  export type { MatchHandlers, PartialMatchHandlers } from './core/match';
37
37
  export { ProtocolResponseParser, responseParser, ADCP_STATUS, type ADCPStatus } from './core/ProtocolResponseParser';
38
38
  export { ResponseValidator, responseValidator, type ValidationResult, type ValidationOptions, } from './core/ResponseValidator';
39
- export type { Message, InputRequest, InputHandler, InputHandlerResponse, ConversationContext, TaskOptions, WebhookToolPredicate, WebhookUrlTemplate, TaskResult, TaskResultCompleted, TaskResultIntermediate, TaskResultFailure, TaskResultMetadata, DeferredContinuation, DirectPauseRecoveryRequest, TaskState, TaskStatus, ConversationConfig, AdcpErrorInfo, AdcpValidationIssue, } from './core/ConversationTypes';
39
+ export type { Message, InputRequest, InputHandler, InputHandlerResponse, ConversationContext, TaskOptions, TrackTaskRequest, TrackedTask, SubmittedContinuation, TaskInfo, WebhookToolPredicate, WebhookUrlTemplate, TaskResult, TaskResultCompleted, TaskResultIntermediate, TaskResultFailure, TaskResultMetadata, DeferredContinuation, DirectPauseRecoveryRequest, TaskState, TaskStatus, ConversationConfig, AdcpErrorInfo, AdcpValidationIssue, } from './core/ConversationTypes';
40
40
  export type { GovernanceConfig, CampaignGovernanceConfig, GovernanceCheckResult, GovernanceOutcome, GovernanceFinding, GovernanceIntentDetails, GovernanceCondition, GovernanceEscalation, NormalizedGovernanceApproved, NormalizedGovernanceConditions, NormalizedGovernanceDenied, NormalizedGovernanceVerdict, } from './core/GovernanceTypes';
41
41
  export { GovernanceMiddleware } from './core/GovernanceMiddleware';
42
42
  export { isGovernanceApproved, isGovernanceConditions, isGovernanceDenied, normalizeGovernanceVerdict, } from './core/GovernanceTypes';
43
43
  export type { GovernanceDebugEntry } from './core/GovernanceMiddleware';
44
- export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, createGovernanceAgentJwksResolver, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance';
44
+ export { GOVERNANCE_AUTHORIZATION_CRITICAL_CLAIMS, GovernanceAuthorizationError, GovernanceReplayStoreAdapter, InMemoryGovernanceReplayStore, buildGovernanceCommitment, buildGovernanceExecutionCommitment, buildGovernanceExecutionRequest, buildGovernanceIntentRequest, buildGovernanceProposedCommitment, buildHumanReviewPlan, buildHumanOverride, computeGovernedPayloadHash, createGovernanceEnforcementMiddleware, getGovernanceEnforcementTasks, governancePurchaseTypeForTask, governanceTaskRequiresProposedCommitment, targetDeclaresGovernanceEnforcement, targetDeclaresLegacyGovernanceAwareness, validateGovernancePlan, verifyGovernanceAuthorization, verifyHistoricalGovernanceContext, createGovernanceAgentJwksResolver, REGULATED_HUMAN_REVIEW_CATEGORIES, ANNEX_III_POLICY_IDS, } from './governance';
45
45
  export { ssrfSafeFetch, decodeBodyAsJsonOrText, SSRF_TRANSIENT_CODES, SsrfRefusedError, isPrivateIp, isAlwaysBlocked, isLikelyPrivateUrl, type SsrfRefusedCode, type SsrfDnsLookup, type SsrfFetchOptions, type SsrfFetchResult, } from './net';
46
46
  export { createCanonicalReferenceCache, createCanonicalReferenceResolver, canonicalReferenceCacheKey, resolveCanonicalReference, resolveFormatSchemaReference, resolvePlatformExtensionsReference, type CanonicalReference, type CanonicalReferenceCache, type CanonicalReferenceCacheOptions, type CanonicalReferenceError, type CanonicalReferenceErrorCode, type CanonicalReferenceFailureResult, type CanonicalReferenceKind, type CanonicalReferenceResolveOptions, type CanonicalReferenceResolvedResult, type CanonicalReferenceResolver, type CanonicalReferenceResolverOptions, type CanonicalReferenceResult, type CanonicalReferenceStatus, type ExternalRefDigestMap, type FormatSchemaReferenceResolvedResult, type FormatSchemaReferenceResult, type PlatformExtensionsReferenceResult, } from './canonical-references';
47
47
  export { assessAcceptancePolicy, createAcceptancePolicyCatalogResolver, resolveAcceptancePolicyCatalog, resolveAcceptancePolicyProfiles, resolveVerifiedAcceptancePolicyProfiles, type AcceptancePolicyCatalog, type AcceptancePolicyCatalogErrorCode, type AcceptancePolicyCatalogFailure, type AcceptancePolicyCatalogIssue, type AcceptancePolicyCatalogResolver, type AcceptancePolicyCatalogResult, type AcceptancePolicyCatalogSuccess, type AcceptancePolicyDiscoveryCapability, type AcceptancePolicyProfile, type AcceptancePolicyProfileResolution, type AcceptancePolicyRegistryPolicy, type AcceptancePolicyRegistryResolver, type AcceptancePolicyReference, type AcceptancePolicyRequirement, type AcceptancePolicyRule, type AcceptancePolicySurface, type RegistryAcceptancePolicyProfileReference, type ResolveAcceptancePolicyCatalogOptions, type ResolveVerifiedAcceptancePolicyProfilesOptions, type ResolvedAcceptancePolicyDefault, type VerifiedAcceptancePolicyProfilesResult, type VerifiedAcceptancePolicyProfilesSuccess, } from './acceptance-policy';
48
48
  export { type AcceptancePolicyAssessment, type AcceptancePolicyAssessmentDiagnostic, type AcceptancePolicyAssessmentDiagnosticCode, type AcceptancePolicyMatchedRule, type AcceptancePolicyOutcome, type AssessAcceptancePolicyInput, } from './acceptance-policy/evaluator';
49
- export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, GovernanceBuyerIdentity, } from './governance';
49
+ export type { BuildGovernanceExecutionRequestInput, BuildGovernanceIntentRequestInput, BuildHumanReviewPlanInput, BuildHumanOverrideInput, DataSubjectContestation, GovernanceAuthorizationClaims, GovernanceAuthorizationCriticalClaim, GovernanceAuthorizationErrorCode, GovernanceAuthorizationFailure, GovernanceAuthorizationResult, GovernanceAuthorizationSuccess, GovernanceCommitment, GovernanceEnforcementMiddleware, GovernanceEnforcementMiddlewareConfig, GovernanceEnforcementMiddlewareInput, GovernanceEnforcementMode, GovernanceEnforcementTask, GovernancePlan, GovernanceReplayStore, GovernanceReplayBinding, GovernanceRevocationResolver, GovernanceRevocationStatus, GovernanceValidationIssue, HumanOverride, InMemoryGovernanceReplayStoreOptions, PlanBudget, ReallocationAutonomy, VerifyGovernanceAuthorizationOptions, VerifyHistoricalGovernanceContextOptions, HistoricalGovernanceContextResult, GovernanceBuyerIdentity, } from './governance';
50
50
  export type { BaseTaskEvent, ProtocolRequestEvent, ProtocolResponseEvent, TaskStatusEvent, ObjectEvent, TaskEvent, TaskEventCallbacks, } from './core/TaskEventTypes';
51
51
  export { createOperationId } from './core/TaskEventTypes';
52
52
  export type { AsyncHandlerConfig, WebhookMetadata, Activity, NotificationMetadata, MediaBuyDeliveryNotification, CreateMediaBuyStatusChangeHandler, UpdateMediaBuyStatusChangeHandler, SyncCreativesStatusChangeHandler, GetProductsStatusChangeHandler, ListProductsStatusChangeHandler, } from './core/AsyncHandler';
package/dist/lib/index.js CHANGED
@@ -714,6 +714,7 @@ __export(index_exports, {
714
714
  vastAssetSlot: () => import_format_asset_slot_builders.vastAssetSlot,
715
715
  vastGroupAsset: () => import_format_asset_slot_builders.vastGroupAsset,
716
716
  verifyGovernanceAuthorization: () => import_governance.verifyGovernanceAuthorization,
717
+ verifyHistoricalGovernanceContext: () => import_governance.verifyHistoricalGovernanceContext,
717
718
  verifyIntrospection: () => import_server.verifyIntrospection,
718
719
  videoAsset: () => import_asset_builders.videoAsset,
719
720
  videoAssetSlot: () => import_format_asset_slot_builders.videoAssetSlot,
@@ -1558,6 +1559,7 @@ function createAdCPClientFromEnv() {
1558
1559
  vastAssetSlot,
1559
1560
  vastGroupAsset,
1560
1561
  verifyGovernanceAuthorization,
1562
+ verifyHistoricalGovernanceContext,
1561
1563
  verifyIntrospection,
1562
1564
  videoAsset,
1563
1565
  videoAssetSlot,
@@ -160,6 +160,7 @@ import {
160
160
  targetDeclaresLegacyGovernanceAwareness,
161
161
  validateGovernancePlan,
162
162
  verifyGovernanceAuthorization,
163
+ verifyHistoricalGovernanceContext,
163
164
  createGovernanceAgentJwksResolver,
164
165
  REGULATED_HUMAN_REVIEW_CATEGORIES,
165
166
  ANNEX_III_POLICY_IDS
@@ -1520,6 +1521,7 @@ export {
1520
1521
  vastAssetSlot,
1521
1522
  vastGroupAsset,
1522
1523
  verifyGovernanceAuthorization,
1524
+ verifyHistoricalGovernanceContext,
1523
1525
  verifyIntrospection,
1524
1526
  videoAsset,
1525
1527
  videoAssetSlot,