@adcp/sdk 13.0.0-rc.10 → 13.0.0-rc.13

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 (116) hide show
  1. package/dist/lib/core/AgentClient.d.mts +12 -3
  2. package/dist/lib/core/AgentClient.d.ts +12 -3
  3. package/dist/lib/core/AgentClient.d.ts.map +1 -1
  4. package/dist/lib/core/AgentClient.js +12 -3
  5. package/dist/lib/core/AgentClient.js.map +1 -1
  6. package/dist/lib/core/AgentClient.mjs +12 -3
  7. package/dist/lib/core/AgentClient.mjs.map +1 -1
  8. package/dist/lib/core/SingleAgentClient.d.mts +13 -3
  9. package/dist/lib/core/SingleAgentClient.d.ts +13 -3
  10. package/dist/lib/core/SingleAgentClient.d.ts.map +1 -1
  11. package/dist/lib/core/SingleAgentClient.js +52 -31
  12. package/dist/lib/core/SingleAgentClient.js.map +1 -1
  13. package/dist/lib/core/SingleAgentClient.mjs +52 -31
  14. package/dist/lib/core/SingleAgentClient.mjs.map +1 -1
  15. package/dist/lib/index.d.mts +1 -1
  16. package/dist/lib/index.d.ts +1 -1
  17. package/dist/lib/index.d.ts.map +1 -1
  18. package/dist/lib/index.js +8 -0
  19. package/dist/lib/index.js.map +1 -1
  20. package/dist/lib/index.mjs +8 -0
  21. package/dist/lib/index.mjs.map +1 -1
  22. package/dist/lib/registry/types.generated.d.mts +48 -1
  23. package/dist/lib/registry/types.generated.d.ts +48 -1
  24. package/dist/lib/registry/types.generated.d.ts.map +1 -1
  25. package/dist/lib/registry/types.generated.js.map +1 -1
  26. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  27. package/dist/lib/server/decisioning/runtime/from-platform.d.mts +1 -1
  28. package/dist/lib/server/decisioning/runtime/from-platform.d.ts +1 -1
  29. package/dist/lib/server/decisioning/runtime/from-platform.d.ts.map +1 -1
  30. package/dist/lib/server/decisioning/runtime/from-platform.js +389 -65
  31. package/dist/lib/server/decisioning/runtime/from-platform.js.map +1 -1
  32. package/dist/lib/server/decisioning/runtime/from-platform.mjs +389 -65
  33. package/dist/lib/server/decisioning/runtime/from-platform.mjs.map +1 -1
  34. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  35. package/dist/lib/testing/compliance/comply.js +8 -2
  36. package/dist/lib/testing/compliance/comply.js.map +1 -1
  37. package/dist/lib/testing/compliance/comply.mjs +8 -2
  38. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  39. package/dist/lib/testing/compliance/spec-conformance.d.ts.map +1 -1
  40. package/dist/lib/testing/compliance/spec-conformance.js +2 -0
  41. package/dist/lib/testing/compliance/spec-conformance.js.map +1 -1
  42. package/dist/lib/testing/compliance/spec-conformance.mjs +2 -0
  43. package/dist/lib/testing/compliance/spec-conformance.mjs.map +1 -1
  44. package/dist/lib/testing/compliance/summary.d.mts +2 -0
  45. package/dist/lib/testing/compliance/summary.d.ts +2 -0
  46. package/dist/lib/testing/compliance/summary.d.ts.map +1 -1
  47. package/dist/lib/testing/compliance/summary.js +3 -2
  48. package/dist/lib/testing/compliance/summary.js.map +1 -1
  49. package/dist/lib/testing/compliance/summary.mjs +3 -2
  50. package/dist/lib/testing/compliance/summary.mjs.map +1 -1
  51. package/dist/lib/testing/compliance/types.d.mts +4 -0
  52. package/dist/lib/testing/compliance/types.d.ts +4 -0
  53. package/dist/lib/testing/compliance/types.d.ts.map +1 -1
  54. package/dist/lib/testing/compliance/types.js.map +1 -1
  55. package/dist/lib/testing/storyboard/junit.js +49 -32
  56. package/dist/lib/testing/storyboard/junit.js.map +1 -1
  57. package/dist/lib/testing/storyboard/junit.mjs +49 -32
  58. package/dist/lib/testing/storyboard/junit.mjs.map +1 -1
  59. package/dist/lib/testing/storyboard/loader.d.ts.map +1 -1
  60. package/dist/lib/testing/storyboard/loader.js +26 -0
  61. package/dist/lib/testing/storyboard/loader.js.map +1 -1
  62. package/dist/lib/testing/storyboard/loader.mjs +26 -0
  63. package/dist/lib/testing/storyboard/loader.mjs.map +1 -1
  64. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  65. package/dist/lib/testing/storyboard/runner.js +66 -15
  66. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  67. package/dist/lib/testing/storyboard/runner.mjs +70 -16
  68. package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
  69. package/dist/lib/testing/storyboard/types.d.mts +26 -1
  70. package/dist/lib/testing/storyboard/types.d.ts +26 -1
  71. package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
  72. package/dist/lib/testing/storyboard/types.js.map +1 -1
  73. package/dist/lib/testing/storyboard/types.mjs.map +1 -1
  74. package/dist/lib/testing/storyboard/validations.d.mts +11 -0
  75. package/dist/lib/testing/storyboard/validations.d.ts +11 -0
  76. package/dist/lib/testing/storyboard/validations.d.ts.map +1 -1
  77. package/dist/lib/testing/storyboard/validations.js +30 -13
  78. package/dist/lib/testing/storyboard/validations.js.map +1 -1
  79. package/dist/lib/testing/storyboard/validations.mjs +27 -13
  80. package/dist/lib/testing/storyboard/validations.mjs.map +1 -1
  81. package/dist/lib/v2/projection/augment-response.d.mts +45 -0
  82. package/dist/lib/v2/projection/augment-response.d.ts +45 -0
  83. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  84. package/dist/lib/v2/projection/augment-response.js +54 -0
  85. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  86. package/dist/lib/v2/projection/augment-response.mjs +52 -0
  87. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  88. package/dist/lib/v2/projection/index.d.mts +7 -1
  89. package/dist/lib/v2/projection/index.d.ts +7 -1
  90. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  91. package/dist/lib/v2/projection/index.js +9 -0
  92. package/dist/lib/v2/projection/index.js.map +1 -1
  93. package/dist/lib/v2/projection/index.mjs +10 -0
  94. package/dist/lib/v2/projection/index.mjs.map +1 -1
  95. package/dist/lib/v2/projection/legacy-routes.d.mts +24 -0
  96. package/dist/lib/v2/projection/legacy-routes.d.ts +25 -0
  97. package/dist/lib/v2/projection/legacy-routes.d.ts.map +1 -0
  98. package/dist/lib/v2/projection/legacy-routes.js +163 -0
  99. package/dist/lib/v2/projection/legacy-routes.js.map +1 -0
  100. package/dist/lib/v2/projection/legacy-routes.mjs +138 -0
  101. package/dist/lib/v2/projection/legacy-routes.mjs.map +1 -0
  102. package/dist/lib/v2/projection/v1-to-v2.d.mts +3 -0
  103. package/dist/lib/v2/projection/v1-to-v2.d.ts +3 -0
  104. package/dist/lib/v2/projection/v1-to-v2.d.ts.map +1 -1
  105. package/dist/lib/v2/projection/v1-to-v2.js +2 -1
  106. package/dist/lib/v2/projection/v1-to-v2.js.map +1 -1
  107. package/dist/lib/v2/projection/v1-to-v2.mjs +2 -1
  108. package/dist/lib/v2/projection/v1-to-v2.mjs.map +1 -1
  109. package/dist/lib/version.d.mts +3 -3
  110. package/dist/lib/version.d.ts +3 -3
  111. package/dist/lib/version.js +3 -3
  112. package/dist/lib/version.js.map +1 -1
  113. package/dist/lib/version.mjs +3 -3
  114. package/dist/lib/version.mjs.map +1 -1
  115. package/docs/migration-12-to-13.md +56 -2
  116. package/package.json +3 -1
@@ -1889,25 +1889,25 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
1889
1889
  } else if (result.status === "completed" && result.success && result.data && transformCompletedResponse) {
1890
1890
  result = { ...result, data: transformCompletedResponse(result.data) };
1891
1891
  }
1892
- if (result.status === "completed" && result.success && this.asyncHandler) {
1893
- const handler = this.config.handlers?.[handlerName];
1894
- if (handler) {
1895
- throwIfAborted(effectiveOptions?.signal);
1896
- const metadata = {
1897
- operation_id: options?.contextId || "sync",
1898
- context_id: options?.contextId,
1899
- task_id: result.metadata.taskId,
1900
- agent_id: this.agent.id,
1901
- task_type: taskType,
1902
- status: result.status,
1903
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1904
- };
1905
- await handler(result.data, metadata);
1906
- throwIfAborted(effectiveOptions?.signal);
1907
- }
1908
- }
1892
+ await this.notifyCompletedStatusHandler(result, taskType, handlerName, effectiveOptions);
1909
1893
  return result;
1910
1894
  }
1895
+ async notifyCompletedStatusHandler(result, taskType, handlerName, options) {
1896
+ if (result.status !== "completed" || !result.success || !this.asyncHandler) return;
1897
+ const handler = this.config.handlers?.[handlerName];
1898
+ if (!handler) return;
1899
+ throwIfAborted(options?.signal);
1900
+ await handler(result.data, {
1901
+ operation_id: options?.contextId || "sync",
1902
+ context_id: options?.contextId,
1903
+ task_id: result.metadata.taskId,
1904
+ agent_id: this.agent.id,
1905
+ task_type: taskType,
1906
+ status: result.status,
1907
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1908
+ });
1909
+ throwIfAborted(options?.signal);
1910
+ }
1911
1911
  canonicalCreativeInputHandler(taskType, inputHandler) {
1912
1912
  if (!inputHandler || !CANONICAL_CREATIVE_ACTIVITY_TASKS.has(taskType)) return inputHandler;
1913
1913
  return async (context) => {
@@ -2864,12 +2864,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2864
2864
  if (result.data !== void 0) this.rememberCanonicalPackageRoutes(result.data, params);
2865
2865
  return result;
2866
2866
  }
2867
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
2867
+ /**
2868
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
2869
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
2870
+ */
2868
2871
  async createMediaBuyLegacy(params, inputHandler, options) {
2869
- return await this.createMediaBuy(
2872
+ return this.executeTaskUnprojected(
2873
+ "create_media_buy",
2870
2874
  params,
2871
2875
  inputHandler,
2872
- options
2876
+ options,
2877
+ "onCreateMediaBuyStatusChange"
2873
2878
  );
2874
2879
  }
2875
2880
  /**
@@ -2922,12 +2927,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2922
2927
  if (result.data !== void 0) this.rememberCanonicalPackageRoutes(result.data, params);
2923
2928
  return result;
2924
2929
  }
2925
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
2930
+ /**
2931
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
2932
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
2933
+ */
2926
2934
  async updateMediaBuyLegacy(params, inputHandler, options) {
2927
- return await this.updateMediaBuy(
2935
+ return this.executeTaskUnprojected(
2936
+ "update_media_buy",
2928
2937
  params,
2929
2938
  inputHandler,
2930
- options
2939
+ options,
2940
+ "onUpdateMediaBuyStatusChange"
2931
2941
  );
2932
2942
  }
2933
2943
  /**
@@ -2993,12 +3003,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2993
3003
  params
2994
3004
  );
2995
3005
  }
2996
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
3006
+ /**
3007
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
3008
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
3009
+ */
2997
3010
  async syncCreativesLegacy(params, inputHandler, options) {
2998
- return await this.syncCreatives(
3011
+ return this.executeTaskUnprojected(
3012
+ "sync_creatives",
2999
3013
  params,
3000
3014
  inputHandler,
3001
- options
3015
+ options,
3016
+ "onSyncCreativesStatusChange"
3002
3017
  );
3003
3018
  }
3004
3019
  resolveCreativeFormatWireMode(taskType, capabilities) {
@@ -3548,11 +3563,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3548
3563
  async executeTaskLegacy(taskName, params, inputHandler, options) {
3549
3564
  return this.executeTaskUnprojected(taskName, params, inputHandler, options);
3550
3565
  }
3551
- async executeTaskUnprojected(taskName, params, inputHandler, options) {
3552
- return withTaskDeadline(
3553
- options,
3554
- (effectiveOptions) => this.executeTaskUnprojectedWithinDeadline(taskName, params, inputHandler, effectiveOptions)
3555
- );
3566
+ async executeTaskUnprojected(taskName, params, inputHandler, options, handlerName) {
3567
+ return withTaskDeadline(options, async (effectiveOptions) => {
3568
+ const result = await this.executeTaskUnprojectedWithinDeadline(
3569
+ taskName,
3570
+ params,
3571
+ inputHandler,
3572
+ effectiveOptions
3573
+ );
3574
+ if (handlerName) await this.notifyCompletedStatusHandler(result, taskName, handlerName, effectiveOptions);
3575
+ return result;
3576
+ });
3556
3577
  }
3557
3578
  async executeTaskUnprojectedWithinDeadline(taskName, params, inputHandler, options) {
3558
3579
  throwIfAborted(options?.signal);