@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
@@ -1879,25 +1879,25 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
1879
1879
  } else if (result.status === "completed" && result.success && result.data && transformCompletedResponse) {
1880
1880
  result = { ...result, data: transformCompletedResponse(result.data) };
1881
1881
  }
1882
- if (result.status === "completed" && result.success && this.asyncHandler) {
1883
- const handler = this.config.handlers?.[handlerName];
1884
- if (handler) {
1885
- (0, import_abort2.throwIfAborted)(effectiveOptions?.signal);
1886
- const metadata = {
1887
- operation_id: options?.contextId || "sync",
1888
- context_id: options?.contextId,
1889
- task_id: result.metadata.taskId,
1890
- agent_id: this.agent.id,
1891
- task_type: taskType,
1892
- status: result.status,
1893
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
1894
- };
1895
- await handler(result.data, metadata);
1896
- (0, import_abort2.throwIfAborted)(effectiveOptions?.signal);
1897
- }
1898
- }
1882
+ await this.notifyCompletedStatusHandler(result, taskType, handlerName, effectiveOptions);
1899
1883
  return result;
1900
1884
  }
1885
+ async notifyCompletedStatusHandler(result, taskType, handlerName, options) {
1886
+ if (result.status !== "completed" || !result.success || !this.asyncHandler) return;
1887
+ const handler = this.config.handlers?.[handlerName];
1888
+ if (!handler) return;
1889
+ (0, import_abort2.throwIfAborted)(options?.signal);
1890
+ await handler(result.data, {
1891
+ operation_id: options?.contextId || "sync",
1892
+ context_id: options?.contextId,
1893
+ task_id: result.metadata.taskId,
1894
+ agent_id: this.agent.id,
1895
+ task_type: taskType,
1896
+ status: result.status,
1897
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
1898
+ });
1899
+ (0, import_abort2.throwIfAborted)(options?.signal);
1900
+ }
1901
1901
  canonicalCreativeInputHandler(taskType, inputHandler) {
1902
1902
  if (!inputHandler || !CANONICAL_CREATIVE_ACTIVITY_TASKS.has(taskType)) return inputHandler;
1903
1903
  return async (context) => {
@@ -2854,12 +2854,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2854
2854
  if (result.data !== void 0) this.rememberCanonicalPackageRoutes(result.data, params);
2855
2855
  return result;
2856
2856
  }
2857
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
2857
+ /**
2858
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
2859
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
2860
+ */
2858
2861
  async createMediaBuyLegacy(params, inputHandler, options) {
2859
- return await this.createMediaBuy(
2862
+ return this.executeTaskUnprojected(
2863
+ "create_media_buy",
2860
2864
  params,
2861
2865
  inputHandler,
2862
- options
2866
+ options,
2867
+ "onCreateMediaBuyStatusChange"
2863
2868
  );
2864
2869
  }
2865
2870
  /**
@@ -2912,12 +2917,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2912
2917
  if (result.data !== void 0) this.rememberCanonicalPackageRoutes(result.data, params);
2913
2918
  return result;
2914
2919
  }
2915
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
2920
+ /**
2921
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
2922
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
2923
+ */
2916
2924
  async updateMediaBuyLegacy(params, inputHandler, options) {
2917
- return await this.updateMediaBuy(
2925
+ return this.executeTaskUnprojected(
2926
+ "update_media_buy",
2918
2927
  params,
2919
2928
  inputHandler,
2920
- options
2929
+ options,
2930
+ "onUpdateMediaBuyStatusChange"
2921
2931
  );
2922
2932
  }
2923
2933
  /**
@@ -2983,12 +2993,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
2983
2993
  params
2984
2994
  );
2985
2995
  }
2986
- /** @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values. */
2996
+ /**
2997
+ * @deprecated Compatibility-only entry point for callers still holding legacy creative `format_id` values.
2998
+ * Projection-only options are ignored because this method preserves the caller's legacy wire payload.
2999
+ */
2987
3000
  async syncCreativesLegacy(params, inputHandler, options) {
2988
- return await this.syncCreatives(
3001
+ return this.executeTaskUnprojected(
3002
+ "sync_creatives",
2989
3003
  params,
2990
3004
  inputHandler,
2991
- options
3005
+ options,
3006
+ "onSyncCreativesStatusChange"
2992
3007
  );
2993
3008
  }
2994
3009
  resolveCreativeFormatWireMode(taskType, capabilities) {
@@ -3538,11 +3553,17 @@ Hint: this usually means agent_uri does not include the MCP endpoint path. The S
3538
3553
  async executeTaskLegacy(taskName, params, inputHandler, options) {
3539
3554
  return this.executeTaskUnprojected(taskName, params, inputHandler, options);
3540
3555
  }
3541
- async executeTaskUnprojected(taskName, params, inputHandler, options) {
3542
- return (0, import_task_deadline.withTaskDeadline)(
3543
- options,
3544
- (effectiveOptions) => this.executeTaskUnprojectedWithinDeadline(taskName, params, inputHandler, effectiveOptions)
3545
- );
3556
+ async executeTaskUnprojected(taskName, params, inputHandler, options, handlerName) {
3557
+ return (0, import_task_deadline.withTaskDeadline)(options, async (effectiveOptions) => {
3558
+ const result = await this.executeTaskUnprojectedWithinDeadline(
3559
+ taskName,
3560
+ params,
3561
+ inputHandler,
3562
+ effectiveOptions
3563
+ );
3564
+ if (handlerName) await this.notifyCompletedStatusHandler(result, taskName, handlerName, effectiveOptions);
3565
+ return result;
3566
+ });
3546
3567
  }
3547
3568
  async executeTaskUnprojectedWithinDeadline(taskName, params, inputHandler, options) {
3548
3569
  (0, import_abort2.throwIfAborted)(options?.signal);