@adcp/sdk 15.7.0 → 15.8.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 (74) hide show
  1. package/dist/lib/core/SingleAgentClient.d.mts +14 -0
  2. package/dist/lib/core/SingleAgentClient.d.ts +14 -0
  3. package/dist/lib/core/SingleAgentClient.js +138 -54
  4. package/dist/lib/core/SingleAgentClient.mjs +141 -54
  5. package/dist/lib/core/agent-discovery-cache.d.mts +2 -0
  6. package/dist/lib/core/agent-discovery-cache.d.ts +2 -0
  7. package/dist/lib/core/creative-schema-support.d.mts +3 -0
  8. package/dist/lib/core/creative-schema-support.d.ts +3 -0
  9. package/dist/lib/core/creative-schema-support.js +113 -0
  10. package/dist/lib/core/creative-schema-support.mjs +89 -0
  11. package/dist/lib/core/product-cache.js +4 -3
  12. package/dist/lib/core/product-cache.mjs +4 -3
  13. package/dist/lib/reporting/ledger/handler.d.mts +10 -3
  14. package/dist/lib/reporting/ledger/handler.d.ts +10 -3
  15. package/dist/lib/reporting/ledger/handler.js +17 -4
  16. package/dist/lib/reporting/ledger/handler.mjs +17 -4
  17. package/dist/lib/reporting/ledger/managed.d.mts +3 -1
  18. package/dist/lib/reporting/ledger/managed.d.ts +3 -1
  19. package/dist/lib/reporting/ledger/managed.js +4 -1
  20. package/dist/lib/reporting/ledger/managed.mjs +4 -1
  21. package/dist/lib/reporting/ledger/postgres.d.mts +87 -0
  22. package/dist/lib/reporting/ledger/postgres.d.ts +87 -0
  23. package/dist/lib/reporting/ledger/postgres.js +314 -13
  24. package/dist/lib/reporting/ledger/postgres.mjs +314 -13
  25. package/dist/lib/reporting/ledger/row-storage.d.mts +23 -0
  26. package/dist/lib/reporting/ledger/row-storage.d.ts +23 -0
  27. package/dist/lib/reporting/ledger/row-storage.js +56 -0
  28. package/dist/lib/reporting/ledger/row-storage.mjs +56 -0
  29. package/dist/lib/reporting/ledger/types.d.mts +26 -0
  30. package/dist/lib/reporting/ledger/types.d.ts +26 -0
  31. package/dist/lib/reporting/service/index.d.mts +33 -3
  32. package/dist/lib/reporting/service/index.d.ts +33 -3
  33. package/dist/lib/reporting/service/index.js +20 -2
  34. package/dist/lib/reporting/service/index.mjs +20 -2
  35. package/dist/lib/reporting/service/maintenance.d.mts +20 -1
  36. package/dist/lib/reporting/service/maintenance.d.ts +20 -1
  37. package/dist/lib/reporting/service/maintenance.js +25 -2
  38. package/dist/lib/reporting/service/maintenance.mjs +25 -2
  39. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  40. package/dist/lib/testing/storyboard/request-builder.js +14 -16
  41. package/dist/lib/testing/storyboard/request-builder.mjs +14 -16
  42. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  43. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  44. package/dist/lib/types/schemas.generated.js +2542 -2542
  45. package/dist/lib/types/schemas.generated.mjs +2542 -2542
  46. package/dist/lib/v2/projection/creative-delivery.d.mts +22 -0
  47. package/dist/lib/v2/projection/creative-delivery.d.ts +22 -0
  48. package/dist/lib/v2/projection/creative-delivery.js +92 -0
  49. package/dist/lib/v2/projection/creative-delivery.mjs +91 -0
  50. package/dist/lib/v2/projection/legacy-metadata.d.mts +6 -3
  51. package/dist/lib/v2/projection/legacy-metadata.d.ts +6 -3
  52. package/dist/lib/v2/projection/legacy-metadata.js +17 -0
  53. package/dist/lib/v2/projection/legacy-metadata.mjs +15 -0
  54. package/dist/lib/validation/bidding-policy.js +1 -1
  55. package/dist/lib/validation/bidding-policy.mjs +1 -1
  56. package/dist/lib/validation/budget-allocation.js +1 -1
  57. package/dist/lib/validation/budget-allocation.mjs +1 -1
  58. package/dist/lib/validation/get-products-request.js +3 -3
  59. package/dist/lib/validation/get-products-request.mjs +3 -3
  60. package/dist/lib/validation/sync-creatives.js +9 -13
  61. package/dist/lib/validation/sync-creatives.mjs +9 -13
  62. package/dist/lib/version.d.mts +3 -3
  63. package/dist/lib/version.d.ts +3 -3
  64. package/dist/lib/version.js +3 -3
  65. package/dist/lib/version.mjs +3 -3
  66. package/docs/TYPE-SUMMARY.md +2 -2
  67. package/docs/ZOD-SCHEMAS.md +11 -1
  68. package/docs/guides/CREATIVE-DELIVERY.md +16 -0
  69. package/docs/guides/REPORTING-LEDGER-CUTOVER.md +405 -0
  70. package/docs/guides/REPORTING-LEDGER.md +130 -0
  71. package/docs/guides/REPORTING-OPERATIONS.md +12 -0
  72. package/docs/llms.txt +3 -2
  73. package/docs/migration-14.x-rc-worksheet.md +4 -4
  74. package/package.json +1 -1
@@ -6,25 +6,25 @@ const UNKNOWN_FORMAT_ID = Object.freeze({ agent_url: "https://unknown.example.co
6
6
  const FALLBACK_CALLER_AGENT_URL = "https://e2e-orchestrator.adcontextprotocol.org/";
7
7
  const FIXTURE_AWARE_ENRICHERS = /* @__PURE__ */ new Set([
8
8
  "create_media_buy",
9
- // merges discovery-derived product_id / pricing_option_id INTO fixture packages[0]
9
+ // preserves authored accounts and merges discovered identifiers INTO fixture packages[0]
10
10
  "comply_test_controller",
11
11
  // forces account.sandbox: true regardless of fixture
12
12
  "check_governance",
13
13
  // preserves the authored intent-vs-delivery request shape
14
14
  "get_products",
15
- // preserves wholesale fixture fields while keeping resolved account scope authoritative
15
+ // preserves discovery fields and authored account identities
16
16
  "get_signals",
17
- // preserves discovery fields while keeping async task account scope authoritative
17
+ // preserves discovery fields and authored account identities
18
18
  "get_task_status",
19
- // preserves task filters while keeping resolved account scope authoritative
19
+ // preserves task filters and authored account identities
20
20
  "list_tasks",
21
- // preserves reconciliation filters while keeping resolved account scope authoritative
21
+ // preserves reconciliation filters and authored account identities
22
22
  "update_media_buy",
23
- // resolves account via resolveAccount(options) so sandbox routing matches create_media_buy
23
+ // fills missing account identity and carries sandbox routing into authored natural keys
24
24
  "get_media_buys",
25
- // resolves account via resolveAccount(options) so sandbox routing matches create_media_buy
25
+ // fills missing account identity and carries sandbox routing into authored natural keys
26
26
  "get_media_buy_delivery"
27
- // resolves account via resolveAccount(options) so sandbox routing matches create_media_buy
27
+ // fills missing account identity and carries sandbox routing into authored natural keys
28
28
  ]);
29
29
  function hasUnresolvedContextReference(value) {
30
30
  if (typeof value === "string") return /^\$context\.\w+$/.test(value);
@@ -67,23 +67,21 @@ function runClockMs(runnerVars) {
67
67
  return runnerVars?.runStartMs ?? Date.now();
68
68
  }
69
69
  function resolveMediaBuyAccount(fixtureAccount, contextAccount, options) {
70
- const resolvedAccount = contextAccount ?? resolveAccount(options);
71
- if (contextAccount === void 0 && fixtureAccount !== null && typeof fixtureAccount === "object" && !Array.isArray(fixtureAccount) && typeof fixtureAccount.operator === "string" && typeof fixtureAccount.account_id !== "string") {
72
- const sandbox = resolvedAccount.sandbox;
70
+ if (hasAuthoredAccountIdentity(fixtureAccount)) {
71
+ if (hasUnresolvedContextReference(fixtureAccount)) return fixtureAccount;
72
+ if (typeof fixtureAccount.account_id === "string") return fixtureAccount;
73
+ const sandbox = contextAccount?.sandbox ?? resolveAccount(options).sandbox;
73
74
  return {
74
75
  ...fixtureAccount,
75
76
  ...sandbox !== void 0 && { sandbox }
76
77
  };
77
78
  }
78
- return resolvedAccount;
79
+ return contextAccount ?? resolveAccount(options);
79
80
  }
80
81
  function resolveDiscoveryAccount(task, fixtureAccount, contextAccount, options) {
81
- if (ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && contextAccount === void 0 && hasUnresolvedContextReference(fixtureAccount))
82
- return void 0;
82
+ if (ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && hasUnresolvedContextReference(fixtureAccount)) return contextAccount;
83
83
  if (ACCOUNT_FREE_DISCOVERY_TASKS.has(task) && fixtureAccount === void 0 && contextAccount === void 0)
84
84
  return void 0;
85
- if (contextAccount === void 0 && fixtureAccount && typeof fixtureAccount === "object" && "account_id" in fixtureAccount)
86
- return fixtureAccount;
87
85
  return resolveMediaBuyAccount(fixtureAccount, contextAccount, options);
88
86
  }
89
87
  const OPERATION_SCOPED_CONTROLLER_SCENARIOS = /* @__PURE__ */ new Set([
@@ -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 = "15.7.0";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "15.8.0";
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 = "15.7.0";
200
+ export declare const RUNNER_CAPABILITY_VERSION = "15.8.0";
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
  /**