@adcp/sdk 14.0.0-beta.17 → 14.0.0-beta.18

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 (35) hide show
  1. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  2. package/dist/lib/server/decisioning/context.d.mts +4 -0
  3. package/dist/lib/server/decisioning/context.d.ts +4 -0
  4. package/dist/lib/server/decisioning/index.d.mts +1 -0
  5. package/dist/lib/server/decisioning/index.d.ts +1 -0
  6. package/dist/lib/server/decisioning/index.js +11 -0
  7. package/dist/lib/server/decisioning/index.mjs +12 -0
  8. package/dist/lib/server/decisioning/runtime/postgres-task-registry.js +5 -3
  9. package/dist/lib/server/decisioning/runtime/postgres-task-registry.mjs +5 -3
  10. package/dist/lib/server/decisioning/runtime/postgres-task-settlement-intents.d.mts +136 -0
  11. package/dist/lib/server/decisioning/runtime/postgres-task-settlement-intents.d.ts +136 -0
  12. package/dist/lib/server/decisioning/runtime/postgres-task-settlement-intents.js +730 -0
  13. package/dist/lib/server/decisioning/runtime/postgres-task-settlement-intents.mjs +702 -0
  14. package/dist/lib/server/decisioning/runtime/postgres-task-settlement.js +108 -36
  15. package/dist/lib/server/decisioning/runtime/postgres-task-settlement.mjs +108 -36
  16. package/dist/lib/server/decisioning/runtime/to-context.js +38 -9
  17. package/dist/lib/server/decisioning/runtime/to-context.mjs +38 -9
  18. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  19. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  20. package/dist/lib/types/schemas.generated.js +0 -63
  21. package/dist/lib/types/schemas.generated.mjs +0 -63
  22. package/dist/lib/utils/well-formed-unicode.d.mts +2 -0
  23. package/dist/lib/utils/well-formed-unicode.d.ts +2 -0
  24. package/dist/lib/utils/well-formed-unicode.js +51 -0
  25. package/dist/lib/utils/well-formed-unicode.mjs +27 -0
  26. package/dist/lib/version.d.mts +3 -3
  27. package/dist/lib/version.d.ts +3 -3
  28. package/dist/lib/version.js +3 -3
  29. package/dist/lib/version.mjs +3 -3
  30. package/docs/guides/BUILD-AN-AGENT.md +7 -0
  31. package/docs/guides/DURABLE-TASK-SETTLEMENT.md +468 -0
  32. package/docs/llms.txt +4 -1
  33. package/docs/migration-13-to-14.md +1 -1
  34. package/docs/migration-task-registry-scoping.md +45 -14
  35. package/package.json +2 -1
@@ -24,32 +24,61 @@ __export(to_context_exports, {
24
24
  module.exports = __toCommonJS(to_context_exports);
25
25
  var import_task_registry = require('./task-registry.js');
26
26
  var import_async_outcome = require('../async-outcome.js');
27
- function cloneAndFreezeAuthValue(value, seen = /* @__PURE__ */ new WeakMap()) {
27
+ const abortSignalAbortedGetter = typeof AbortSignal === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(AbortSignal.prototype, "aborted")?.get;
28
+ function isNativeAbortSignal(value) {
29
+ if (abortSignalAbortedGetter === void 0) return false;
30
+ try {
31
+ abortSignalAbortedGetter.call(value);
32
+ return true;
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+ function nestedAuthValuePosition(position, key) {
38
+ if (position === "root" && key === "extra") return "extra";
39
+ if (position === "extra" && key === "signal") return "abort-signal";
40
+ return "other";
41
+ }
42
+ function authValueCachePosition(object, position, root) {
43
+ if (position === "root" || object === root) return "root";
44
+ if (position !== "extra") return "other";
45
+ const signalDescriptor = Object.getOwnPropertyDescriptor(object, "signal");
46
+ return signalDescriptor && "value" in signalDescriptor && signalDescriptor.value !== null && (typeof signalDescriptor.value === "object" || typeof signalDescriptor.value === "function") && isNativeAbortSignal(signalDescriptor.value) ? "extra" : "other";
47
+ }
48
+ function rememberAuthValueClone(seen, object, position, clone) {
49
+ const clonesByPosition = seen.get(object) ?? /* @__PURE__ */ new Map();
50
+ clonesByPosition.set(position, clone);
51
+ seen.set(object, clonesByPosition);
52
+ }
53
+ function cloneAndFreezeAuthValue(value, seen = /* @__PURE__ */ new WeakMap(), position = "root", rootObject) {
28
54
  if (value === null || typeof value !== "object" && typeof value !== "function") return value;
29
55
  const object = value;
30
- const prior = seen.get(object);
31
- if (prior !== void 0) return prior;
56
+ const root = rootObject ?? object;
57
+ if (position === "abort-signal" && object !== root && isNativeAbortSignal(object)) return value;
58
+ const cachePosition = authValueCachePosition(object, position, root);
59
+ const clonesByPosition = seen.get(object);
60
+ if (clonesByPosition?.has(cachePosition)) return clonesByPosition.get(cachePosition);
32
61
  if (value instanceof Date) return Object.freeze(new Date(value.getTime()));
33
62
  if (value instanceof Map) {
34
63
  const clone2 = /* @__PURE__ */ new Map();
35
- seen.set(object, clone2);
64
+ rememberAuthValueClone(seen, object, cachePosition, clone2);
36
65
  for (const [key, entry] of value)
37
- clone2.set(cloneAndFreezeAuthValue(key, seen), cloneAndFreezeAuthValue(entry, seen));
66
+ clone2.set(cloneAndFreezeAuthValue(key, seen, "other", root), cloneAndFreezeAuthValue(entry, seen, "other", root));
38
67
  return Object.freeze(clone2);
39
68
  }
40
69
  if (value instanceof Set) {
41
70
  const clone2 = /* @__PURE__ */ new Set();
42
- seen.set(object, clone2);
43
- for (const entry of value) clone2.add(cloneAndFreezeAuthValue(entry, seen));
71
+ rememberAuthValueClone(seen, object, cachePosition, clone2);
72
+ for (const entry of value) clone2.add(cloneAndFreezeAuthValue(entry, seen, "other", root));
44
73
  return Object.freeze(clone2);
45
74
  }
46
75
  const clone = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));
47
- seen.set(object, clone);
76
+ rememberAuthValueClone(seen, object, cachePosition, clone);
48
77
  for (const key of Reflect.ownKeys(object)) {
49
78
  const descriptor = Object.getOwnPropertyDescriptor(object, key);
50
79
  if (!descriptor) continue;
51
80
  if ("value" in descriptor) {
52
- descriptor.value = cloneAndFreezeAuthValue(descriptor.value, seen);
81
+ descriptor.value = cloneAndFreezeAuthValue(descriptor.value, seen, nestedAuthValuePosition(position, key), root);
53
82
  descriptor.writable = false;
54
83
  }
55
84
  descriptor.configurable = false;
@@ -2,32 +2,61 @@ import { sanitizeTaskProgressForStorage } from "./task-registry.mjs";
2
2
  import {
3
3
  _createTaskHandoff
4
4
  } from "../async-outcome.mjs";
5
- function cloneAndFreezeAuthValue(value, seen = /* @__PURE__ */ new WeakMap()) {
5
+ const abortSignalAbortedGetter = typeof AbortSignal === "undefined" ? void 0 : Object.getOwnPropertyDescriptor(AbortSignal.prototype, "aborted")?.get;
6
+ function isNativeAbortSignal(value) {
7
+ if (abortSignalAbortedGetter === void 0) return false;
8
+ try {
9
+ abortSignalAbortedGetter.call(value);
10
+ return true;
11
+ } catch {
12
+ return false;
13
+ }
14
+ }
15
+ function nestedAuthValuePosition(position, key) {
16
+ if (position === "root" && key === "extra") return "extra";
17
+ if (position === "extra" && key === "signal") return "abort-signal";
18
+ return "other";
19
+ }
20
+ function authValueCachePosition(object, position, root) {
21
+ if (position === "root" || object === root) return "root";
22
+ if (position !== "extra") return "other";
23
+ const signalDescriptor = Object.getOwnPropertyDescriptor(object, "signal");
24
+ return signalDescriptor && "value" in signalDescriptor && signalDescriptor.value !== null && (typeof signalDescriptor.value === "object" || typeof signalDescriptor.value === "function") && isNativeAbortSignal(signalDescriptor.value) ? "extra" : "other";
25
+ }
26
+ function rememberAuthValueClone(seen, object, position, clone) {
27
+ const clonesByPosition = seen.get(object) ?? /* @__PURE__ */ new Map();
28
+ clonesByPosition.set(position, clone);
29
+ seen.set(object, clonesByPosition);
30
+ }
31
+ function cloneAndFreezeAuthValue(value, seen = /* @__PURE__ */ new WeakMap(), position = "root", rootObject) {
6
32
  if (value === null || typeof value !== "object" && typeof value !== "function") return value;
7
33
  const object = value;
8
- const prior = seen.get(object);
9
- if (prior !== void 0) return prior;
34
+ const root = rootObject ?? object;
35
+ if (position === "abort-signal" && object !== root && isNativeAbortSignal(object)) return value;
36
+ const cachePosition = authValueCachePosition(object, position, root);
37
+ const clonesByPosition = seen.get(object);
38
+ if (clonesByPosition?.has(cachePosition)) return clonesByPosition.get(cachePosition);
10
39
  if (value instanceof Date) return Object.freeze(new Date(value.getTime()));
11
40
  if (value instanceof Map) {
12
41
  const clone2 = /* @__PURE__ */ new Map();
13
- seen.set(object, clone2);
42
+ rememberAuthValueClone(seen, object, cachePosition, clone2);
14
43
  for (const [key, entry] of value)
15
- clone2.set(cloneAndFreezeAuthValue(key, seen), cloneAndFreezeAuthValue(entry, seen));
44
+ clone2.set(cloneAndFreezeAuthValue(key, seen, "other", root), cloneAndFreezeAuthValue(entry, seen, "other", root));
16
45
  return Object.freeze(clone2);
17
46
  }
18
47
  if (value instanceof Set) {
19
48
  const clone2 = /* @__PURE__ */ new Set();
20
- seen.set(object, clone2);
21
- for (const entry of value) clone2.add(cloneAndFreezeAuthValue(entry, seen));
49
+ rememberAuthValueClone(seen, object, cachePosition, clone2);
50
+ for (const entry of value) clone2.add(cloneAndFreezeAuthValue(entry, seen, "other", root));
22
51
  return Object.freeze(clone2);
23
52
  }
24
53
  const clone = Array.isArray(value) ? [] : Object.create(Object.getPrototypeOf(value));
25
- seen.set(object, clone);
54
+ rememberAuthValueClone(seen, object, cachePosition, clone);
26
55
  for (const key of Reflect.ownKeys(object)) {
27
56
  const descriptor = Object.getOwnPropertyDescriptor(object, key);
28
57
  if (!descriptor) continue;
29
58
  if ("value" in descriptor) {
30
- descriptor.value = cloneAndFreezeAuthValue(descriptor.value, seen);
59
+ descriptor.value = cloneAndFreezeAuthValue(descriptor.value, seen, nestedAuthValuePosition(position, key), root);
31
60
  descriptor.writable = false;
32
61
  }
33
62
  descriptor.configurable = false;
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.17";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.18";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -197,7 +197,7 @@ export interface UpstreamTrafficQueryResult {
197
197
  */
198
198
  export declare function runValidations(validations: StoryboardValidation[], context: ValidationContext): ValidationResult[];
199
199
  /** Capability semver emitted in run summaries and used for advisory expiry. */
200
- export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.17";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "14.0.0-beta.18";
201
201
  /** True when a failed validation contributes to the owning step's grade. */
202
202
  export declare function validationFailsStep(result: ValidationResult): boolean;
203
203
  /**
@@ -11684,54 +11684,6 @@ const ProductFormatDeclarationSchema = import_zod.z.object({}).passthrough().mer
11684
11684
  format_shape: import_zod.z.string().optional(),
11685
11685
  v1_format_ref: import_zod.z.array(FormatReferenceStructuredObjectSchema).optional(),
11686
11686
  format_schema: PlatformExtensionReferenceSchema.optional()
11687
- }).passthrough()).and(import_zod.z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(import_zod.z.object({
11688
- format_option_id: import_zod.z.string().optional(),
11689
- publisher_domain: import_zod.z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
11690
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
11691
- macro_resolution_capabilities: import_zod.z.array(MacroProcessingCapabilitySchema).optional(),
11692
- technical_requirements_complete: import_zod.z.boolean().optional(),
11693
- display_name: import_zod.z.string().optional(),
11694
- sample_render_url: import_zod.z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
11695
- applies_to_channels: import_zod.z.array(MediaChannelSchema).optional(),
11696
- seller_preference: import_zod.z.union([import_zod.z.literal("preferred"), import_zod.z.literal("accepted"), import_zod.z.literal("discouraged")]).optional(),
11697
- locale_policy: CreativeLocalePolicySchema.optional(),
11698
- canonical_formats_only: import_zod.z.boolean().optional(),
11699
- experimental: import_zod.z.boolean().optional(),
11700
- format_shape: import_zod.z.string().optional(),
11701
- v1_format_ref: import_zod.z.array(FormatReferenceStructuredObjectSchema).optional(),
11702
- format_schema: PlatformExtensionReferenceSchema.optional()
11703
- }).passthrough()).and(import_zod.z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(import_zod.z.object({
11704
- format_option_id: import_zod.z.string().optional(),
11705
- publisher_domain: import_zod.z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
11706
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
11707
- macro_resolution_capabilities: import_zod.z.array(MacroProcessingCapabilitySchema).optional(),
11708
- technical_requirements_complete: import_zod.z.boolean().optional(),
11709
- display_name: import_zod.z.string().optional(),
11710
- sample_render_url: import_zod.z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
11711
- applies_to_channels: import_zod.z.array(MediaChannelSchema).optional(),
11712
- seller_preference: import_zod.z.union([import_zod.z.literal("preferred"), import_zod.z.literal("accepted"), import_zod.z.literal("discouraged")]).optional(),
11713
- locale_policy: CreativeLocalePolicySchema.optional(),
11714
- canonical_formats_only: import_zod.z.boolean().optional(),
11715
- experimental: import_zod.z.boolean().optional(),
11716
- format_shape: import_zod.z.string().optional(),
11717
- v1_format_ref: import_zod.z.array(FormatReferenceStructuredObjectSchema).optional(),
11718
- format_schema: PlatformExtensionReferenceSchema.optional()
11719
- }).passthrough()).and(import_zod.z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(import_zod.z.object({
11720
- format_option_id: import_zod.z.string().optional(),
11721
- publisher_domain: import_zod.z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
11722
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
11723
- macro_resolution_capabilities: import_zod.z.array(MacroProcessingCapabilitySchema).optional(),
11724
- technical_requirements_complete: import_zod.z.boolean().optional(),
11725
- display_name: import_zod.z.string().optional(),
11726
- sample_render_url: import_zod.z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
11727
- applies_to_channels: import_zod.z.array(MediaChannelSchema).optional(),
11728
- seller_preference: import_zod.z.union([import_zod.z.literal("preferred"), import_zod.z.literal("accepted"), import_zod.z.literal("discouraged")]).optional(),
11729
- locale_policy: CreativeLocalePolicySchema.optional(),
11730
- canonical_formats_only: import_zod.z.boolean().optional(),
11731
- experimental: import_zod.z.boolean().optional(),
11732
- format_shape: import_zod.z.string().optional(),
11733
- v1_format_ref: import_zod.z.array(FormatReferenceStructuredObjectSchema).optional(),
11734
- format_schema: PlatformExtensionReferenceSchema.optional()
11735
11687
  }).passthrough()).and(import_zod.z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema]));
11736
11688
  const AudienceEvidenceSelectionSchema = import_zod.z.object({
11737
11689
  evidence_id: import_zod.z.string().min(1),
@@ -11767,21 +11719,6 @@ const PlacementSchema = import_zod.z.object({}).passthrough().merge(import_zod.z
11767
11719
  audio_distribution_types: import_zod.z.array(AudioDistributionTypeSchema).optional(),
11768
11720
  sponsored_placement_types: import_zod.z.array(SponsoredPlacementTypeSchema).optional(),
11769
11721
  social_placement_surfaces: import_zod.z.array(SocialPlacementSurfaceSchema).optional()
11770
- }).passthrough()).and(import_zod.z.union([import_zod.z.object({}).passthrough(), import_zod.z.object({}).passthrough()])).and(import_zod.z.object({
11771
- kind: import_zod.z.union([import_zod.z.literal("publisher_ref"), import_zod.z.literal("seller_inline")]),
11772
- placement_id: import_zod.z.string(),
11773
- publisher_domain: import_zod.z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
11774
- seller_agent: SellerAgentReferenceSchema.optional(),
11775
- name: import_zod.z.string().optional(),
11776
- description: import_zod.z.string().optional(),
11777
- mode: import_zod.z.union([import_zod.z.literal("targetable"), import_zod.z.literal("included")]),
11778
- tags: import_zod.z.array(import_zod.z.string()).optional(),
11779
- format_ids: import_zod.z.array(FormatReferenceStructuredObjectSchema).optional(),
11780
- format_options: import_zod.z.array(ProductFormatDeclarationSchema).optional(),
11781
- video_placement_types: import_zod.z.array(VideoPlacementTypeSchema).optional(),
11782
- audio_distribution_types: import_zod.z.array(AudioDistributionTypeSchema).optional(),
11783
- sponsored_placement_types: import_zod.z.array(SponsoredPlacementTypeSchema).optional(),
11784
- social_placement_surfaces: import_zod.z.array(SocialPlacementSurfaceSchema).optional()
11785
11722
  }).passthrough());
11786
11723
  const PricingOptionSchema = import_zod.z.union([CPMPricingOptionSchema, VCPMPricingOptionSchema, CPCPricingOptionSchema, CPCVPricingOptionSchema, CPVPricingOptionSchema, CPPPricingOptionSchema, CPAPricingOptionSchema, RevenueSharePricingOptionSchema, FlatRatePricingOptionSchema, TimeBasedPricingOptionSchema]);
11787
11724
  const InstallmentSchema = import_zod.z.object({
@@ -10402,54 +10402,6 @@ const ProductFormatDeclarationSchema = z.object({}).passthrough().merge(z.object
10402
10402
  format_shape: z.string().optional(),
10403
10403
  v1_format_ref: z.array(FormatReferenceStructuredObjectSchema).optional(),
10404
10404
  format_schema: PlatformExtensionReferenceSchema.optional()
10405
- }).passthrough()).and(z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(z.object({
10406
- format_option_id: z.string().optional(),
10407
- publisher_domain: z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
10408
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
10409
- macro_resolution_capabilities: z.array(MacroProcessingCapabilitySchema).optional(),
10410
- technical_requirements_complete: z.boolean().optional(),
10411
- display_name: z.string().optional(),
10412
- sample_render_url: z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
10413
- applies_to_channels: z.array(MediaChannelSchema).optional(),
10414
- seller_preference: z.union([z.literal("preferred"), z.literal("accepted"), z.literal("discouraged")]).optional(),
10415
- locale_policy: CreativeLocalePolicySchema.optional(),
10416
- canonical_formats_only: z.boolean().optional(),
10417
- experimental: z.boolean().optional(),
10418
- format_shape: z.string().optional(),
10419
- v1_format_ref: z.array(FormatReferenceStructuredObjectSchema).optional(),
10420
- format_schema: PlatformExtensionReferenceSchema.optional()
10421
- }).passthrough()).and(z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(z.object({
10422
- format_option_id: z.string().optional(),
10423
- publisher_domain: z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
10424
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
10425
- macro_resolution_capabilities: z.array(MacroProcessingCapabilitySchema).optional(),
10426
- technical_requirements_complete: z.boolean().optional(),
10427
- display_name: z.string().optional(),
10428
- sample_render_url: z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
10429
- applies_to_channels: z.array(MediaChannelSchema).optional(),
10430
- seller_preference: z.union([z.literal("preferred"), z.literal("accepted"), z.literal("discouraged")]).optional(),
10431
- locale_policy: CreativeLocalePolicySchema.optional(),
10432
- canonical_formats_only: z.boolean().optional(),
10433
- experimental: z.boolean().optional(),
10434
- format_shape: z.string().optional(),
10435
- v1_format_ref: z.array(FormatReferenceStructuredObjectSchema).optional(),
10436
- format_schema: PlatformExtensionReferenceSchema.optional()
10437
- }).passthrough()).and(z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema])).and(z.object({
10438
- format_option_id: z.string().optional(),
10439
- publisher_domain: z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
10440
- tracker_execution_contract: TrackerExecutionContractSchema.optional(),
10441
- macro_resolution_capabilities: z.array(MacroProcessingCapabilitySchema).optional(),
10442
- technical_requirements_complete: z.boolean().optional(),
10443
- display_name: z.string().optional(),
10444
- sample_render_url: z.string().regex(new RegExp("^https://")).refine(adcpJsonSchemaUri, "Invalid URI").optional(),
10445
- applies_to_channels: z.array(MediaChannelSchema).optional(),
10446
- seller_preference: z.union([z.literal("preferred"), z.literal("accepted"), z.literal("discouraged")]).optional(),
10447
- locale_policy: CreativeLocalePolicySchema.optional(),
10448
- canonical_formats_only: z.boolean().optional(),
10449
- experimental: z.boolean().optional(),
10450
- format_shape: z.string().optional(),
10451
- v1_format_ref: z.array(FormatReferenceStructuredObjectSchema).optional(),
10452
- format_schema: PlatformExtensionReferenceSchema.optional()
10453
10405
  }).passthrough()).and(z.union([ImageFormatDeclarationSchema, HTML5FormatDeclarationSchema, DisplayTagFormatDeclarationSchema, ImageCarouselFormatDeclarationSchema, HostedVideoFormatDeclarationSchema, VASTVideoFormatDeclarationSchema, HostedAudioFormatDeclarationSchema, DAASTAudioFormatDeclarationSchema, SponsoredPlacementFormatDeclarationSchema, NativeInFeedFormatDeclarationSchema, ResponsiveCreativeFormatDeclarationSchema, AgentPlacementFormatDeclarationSchema, SellerRenderedStatefulDisplayFormatDeclarationSchema, CoordinatedPlacementsFormatDeclarationSchema, CustomFormatDeclarationSchema]));
10454
10406
  const AudienceEvidenceSelectionSchema = z.object({
10455
10407
  evidence_id: z.string().min(1),
@@ -10485,21 +10437,6 @@ const PlacementSchema = z.object({}).passthrough().merge(z.object({}).passthroug
10485
10437
  audio_distribution_types: z.array(AudioDistributionTypeSchema).optional(),
10486
10438
  sponsored_placement_types: z.array(SponsoredPlacementTypeSchema).optional(),
10487
10439
  social_placement_surfaces: z.array(SocialPlacementSurfaceSchema).optional()
10488
- }).passthrough()).and(z.union([z.object({}).passthrough(), z.object({}).passthrough()])).and(z.object({
10489
- kind: z.union([z.literal("publisher_ref"), z.literal("seller_inline")]),
10490
- placement_id: z.string(),
10491
- publisher_domain: z.string().regex(new RegExp("^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$")).optional(),
10492
- seller_agent: SellerAgentReferenceSchema.optional(),
10493
- name: z.string().optional(),
10494
- description: z.string().optional(),
10495
- mode: z.union([z.literal("targetable"), z.literal("included")]),
10496
- tags: z.array(z.string()).optional(),
10497
- format_ids: z.array(FormatReferenceStructuredObjectSchema).optional(),
10498
- format_options: z.array(ProductFormatDeclarationSchema).optional(),
10499
- video_placement_types: z.array(VideoPlacementTypeSchema).optional(),
10500
- audio_distribution_types: z.array(AudioDistributionTypeSchema).optional(),
10501
- sponsored_placement_types: z.array(SponsoredPlacementTypeSchema).optional(),
10502
- social_placement_surfaces: z.array(SocialPlacementSurfaceSchema).optional()
10503
10440
  }).passthrough());
10504
10441
  const PricingOptionSchema = z.union([CPMPricingOptionSchema, VCPMPricingOptionSchema, CPCPricingOptionSchema, CPCVPricingOptionSchema, CPVPricingOptionSchema, CPPPricingOptionSchema, CPAPricingOptionSchema, RevenueSharePricingOptionSchema, FlatRatePricingOptionSchema, TimeBasedPricingOptionSchema]);
10505
10442
  const InstallmentSchema = z.object({
@@ -0,0 +1,2 @@
1
+ /** Reject unpaired UTF-16 surrogates before values cross UTF-8 or hash boundaries. */
2
+ export declare function assertWellFormedUnicode(value: unknown, label: string): void;
@@ -0,0 +1,2 @@
1
+ /** Reject unpaired UTF-16 surrogates before values cross UTF-8 or hash boundaries. */
2
+ export declare function assertWellFormedUnicode(value: unknown, label: string): void;
@@ -0,0 +1,51 @@
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
+ var well_formed_unicode_exports = {};
20
+ __export(well_formed_unicode_exports, {
21
+ assertWellFormedUnicode: () => assertWellFormedUnicode
22
+ });
23
+ module.exports = __toCommonJS(well_formed_unicode_exports);
24
+ function assertWellFormedUnicode(value, label) {
25
+ const active = /* @__PURE__ */ new WeakSet();
26
+ const visit = (current) => {
27
+ if (typeof current === "string") {
28
+ if (Buffer.from(current, "utf8").toString("utf8") !== current) {
29
+ throw new TypeError(`${label} must contain well-formed Unicode`);
30
+ }
31
+ return;
32
+ }
33
+ if (current === null || typeof current !== "object") return;
34
+ if (active.has(current)) throw new TypeError(`${label} must be acyclic JSON`);
35
+ active.add(current);
36
+ if (Array.isArray(current)) {
37
+ for (const item of current) visit(item);
38
+ } else {
39
+ for (const key of Object.keys(current)) {
40
+ visit(key);
41
+ visit(current[key]);
42
+ }
43
+ }
44
+ active.delete(current);
45
+ };
46
+ visit(value);
47
+ }
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ assertWellFormedUnicode
51
+ });
@@ -0,0 +1,27 @@
1
+ function assertWellFormedUnicode(value, label) {
2
+ const active = /* @__PURE__ */ new WeakSet();
3
+ const visit = (current) => {
4
+ if (typeof current === "string") {
5
+ if (Buffer.from(current, "utf8").toString("utf8") !== current) {
6
+ throw new TypeError(`${label} must contain well-formed Unicode`);
7
+ }
8
+ return;
9
+ }
10
+ if (current === null || typeof current !== "object") return;
11
+ if (active.has(current)) throw new TypeError(`${label} must be acyclic JSON`);
12
+ active.add(current);
13
+ if (Array.isArray(current)) {
14
+ for (const item of current) visit(item);
15
+ } else {
16
+ for (const key of Object.keys(current)) {
17
+ visit(key);
18
+ visit(current[key]);
19
+ }
20
+ }
21
+ active.delete(current);
22
+ };
23
+ visit(value);
24
+ }
25
+ export {
26
+ assertWellFormedUnicode
27
+ };
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.0.0-beta.17";
4
+ export declare const LIBRARY_VERSION = "14.0.0-beta.18";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.0.0-beta.17";
36
+ readonly library: "14.0.0-beta.18";
37
37
  readonly adcp: "3.2.0-beta.9";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0-beta.1", "3.0-beta.1", "3.0-beta", "3.0.0-beta.3", "3.0-beta.3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.2.0-beta.9", "3.2-beta.9"];
39
- readonly generatedAt: "2026-08-29T18:03:01.220Z";
39
+ readonly generatedAt: "2026-08-29T22:10:59.071Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * AdCP SDK library version
3
3
  */
4
- export declare const LIBRARY_VERSION = "14.0.0-beta.17";
4
+ export declare const LIBRARY_VERSION = "14.0.0-beta.18";
5
5
  /**
6
6
  * AdCP specification version this library is built for
7
7
  */
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
33
33
  * Full version information
34
34
  */
35
35
  export declare const VERSION_INFO: {
36
- readonly library: "14.0.0-beta.17";
36
+ readonly library: "14.0.0-beta.18";
37
37
  readonly adcp: "3.2.0-beta.9";
38
38
  readonly compatibleVersions: readonly ["v2.5", "v2.6", "v3", "3.0.0-beta.1", "3.0-beta.1", "3.0-beta", "3.0.0-beta.3", "3.0-beta.3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.2.0-beta.9", "3.2-beta.9"];
39
- readonly generatedAt: "2026-08-29T18:03:01.220Z";
39
+ readonly generatedAt: "2026-08-29T22:10:59.071Z";
40
40
  };
41
41
  /**
42
42
  * Get the AdCP specification version this library is built for
@@ -31,7 +31,7 @@ __export(version_exports, {
31
31
  toReleasePrecisionVersion: () => toReleasePrecisionVersion
32
32
  });
33
33
  module.exports = __toCommonJS(version_exports);
34
- const LIBRARY_VERSION = "14.0.0-beta.17";
34
+ const LIBRARY_VERSION = "14.0.0-beta.18";
35
35
  const ADCP_VERSION = "3.2.0-beta.9";
36
36
  const ADCP_MAJOR_VERSION = 3;
37
37
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -94,10 +94,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
94
94
  "3.2-beta.9"
95
95
  ];
96
96
  const VERSION_INFO = {
97
- library: "14.0.0-beta.17",
97
+ library: "14.0.0-beta.18",
98
98
  adcp: "3.2.0-beta.9",
99
99
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
100
- generatedAt: "2026-08-29T18:03:01.220Z"
100
+ generatedAt: "2026-08-29T22:10:59.071Z"
101
101
  };
102
102
  function getAdcpVersion() {
103
103
  return ADCP_VERSION;
@@ -1,4 +1,4 @@
1
- const LIBRARY_VERSION = "14.0.0-beta.17";
1
+ const LIBRARY_VERSION = "14.0.0-beta.18";
2
2
  const ADCP_VERSION = "3.2.0-beta.9";
3
3
  const ADCP_MAJOR_VERSION = 3;
4
4
  const COMPATIBLE_ADCP_VERSIONS = [
@@ -61,10 +61,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
61
61
  "3.2-beta.9"
62
62
  ];
63
63
  const VERSION_INFO = {
64
- library: "14.0.0-beta.17",
64
+ library: "14.0.0-beta.18",
65
65
  adcp: "3.2.0-beta.9",
66
66
  compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
67
- generatedAt: "2026-08-29T18:03:01.220Z"
67
+ generatedAt: "2026-08-29T22:10:59.071Z"
68
68
  };
69
69
  function getAdcpVersion() {
70
70
  return ADCP_VERSION;
@@ -702,6 +702,13 @@ createAdcpServerFromPlatform(platform, {
702
702
 
703
703
  See [SIGNING-GUIDE.md](./SIGNING-GUIDE.md) for the full walkthrough: key generation, JWKS publication, brand.json, conformance testing, and KMS-backed production deployment.
704
704
 
705
+ When a human approval or provider callback commits before the application can
706
+ settle its SDK task, use the PostgreSQL settlement-intent queue to close that
707
+ earlier crash window. See [Durable task settlement](./DURABLE-TASK-SETTLEMENT.md)
708
+ for the domain transaction → task/webhook transaction → webhook recovery
709
+ sequence, copyable polling and push settlement handlers, and scoped dead-letter
710
+ operations.
711
+
705
712
  ### Portable MCP Apps for custom tools
706
713
 
707
714
  Use `resources` with custom-tool `_meta.ui` to attach one host-neutral MCP