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

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 (73) hide show
  1. package/dist/lib/index.d.mts +2 -2
  2. package/dist/lib/index.d.ts +2 -2
  3. package/dist/lib/index.d.ts.map +1 -1
  4. package/dist/lib/index.js +6 -0
  5. package/dist/lib/index.js.map +1 -1
  6. package/dist/lib/index.mjs +6 -0
  7. package/dist/lib/index.mjs.map +1 -1
  8. package/dist/lib/protocols/transportDiagnostics.js +2 -1
  9. package/dist/lib/protocols/transportDiagnostics.js.map +1 -1
  10. package/dist/lib/protocols/transportDiagnostics.mjs +2 -1
  11. package/dist/lib/protocols/transportDiagnostics.mjs.map +1 -1
  12. package/dist/lib/registry/index.d.mts +17 -0
  13. package/dist/lib/registry/index.d.ts +17 -0
  14. package/dist/lib/registry/index.d.ts.map +1 -1
  15. package/dist/lib/registry/index.js +81 -7
  16. package/dist/lib/registry/index.js.map +1 -1
  17. package/dist/lib/registry/index.mjs +79 -7
  18. package/dist/lib/registry/index.mjs.map +1 -1
  19. package/dist/lib/registry/types.generated.d.mts +157 -7
  20. package/dist/lib/registry/types.generated.d.ts +157 -7
  21. package/dist/lib/registry/types.generated.d.ts.map +1 -1
  22. package/dist/lib/registry/types.generated.js.map +1 -1
  23. package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
  24. package/dist/lib/server/errors.d.mts +10 -2
  25. package/dist/lib/server/errors.d.ts +10 -2
  26. package/dist/lib/server/errors.d.ts.map +1 -1
  27. package/dist/lib/server/errors.js +9 -2
  28. package/dist/lib/server/errors.js.map +1 -1
  29. package/dist/lib/server/errors.mjs +9 -2
  30. package/dist/lib/server/errors.mjs.map +1 -1
  31. package/dist/lib/testing/compliance/comply.d.mts +6 -0
  32. package/dist/lib/testing/compliance/comply.d.ts +6 -0
  33. package/dist/lib/testing/compliance/comply.d.ts.map +1 -1
  34. package/dist/lib/testing/compliance/comply.js +3 -0
  35. package/dist/lib/testing/compliance/comply.js.map +1 -1
  36. package/dist/lib/testing/compliance/comply.mjs +3 -0
  37. package/dist/lib/testing/compliance/comply.mjs.map +1 -1
  38. package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
  39. package/dist/lib/testing/storyboard/runner.js +31 -5
  40. package/dist/lib/testing/storyboard/runner.js.map +1 -1
  41. package/dist/lib/testing/storyboard/runner.mjs +36 -6
  42. package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
  43. package/dist/lib/testing/storyboard/types.d.mts +16 -5
  44. package/dist/lib/testing/storyboard/types.d.ts +16 -5
  45. package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
  46. package/dist/lib/testing/storyboard/types.js +1 -1
  47. package/dist/lib/testing/storyboard/types.js.map +1 -1
  48. package/dist/lib/testing/storyboard/types.mjs +1 -1
  49. package/dist/lib/testing/storyboard/types.mjs.map +1 -1
  50. package/dist/lib/testing/storyboard/validations.d.mts +1 -1
  51. package/dist/lib/testing/storyboard/validations.d.ts +1 -1
  52. package/dist/lib/v2/projection/augment-response.d.mts +16 -0
  53. package/dist/lib/v2/projection/augment-response.d.ts +16 -0
  54. package/dist/lib/v2/projection/augment-response.d.ts.map +1 -1
  55. package/dist/lib/v2/projection/augment-response.js +13 -4
  56. package/dist/lib/v2/projection/augment-response.js.map +1 -1
  57. package/dist/lib/v2/projection/augment-response.mjs +12 -4
  58. package/dist/lib/v2/projection/augment-response.mjs.map +1 -1
  59. package/dist/lib/v2/projection/index.d.mts +3 -1
  60. package/dist/lib/v2/projection/index.d.ts +3 -1
  61. package/dist/lib/v2/projection/index.d.ts.map +1 -1
  62. package/dist/lib/v2/projection/index.js +2 -0
  63. package/dist/lib/v2/projection/index.js.map +1 -1
  64. package/dist/lib/v2/projection/index.mjs +2 -0
  65. package/dist/lib/v2/projection/index.mjs.map +1 -1
  66. package/dist/lib/version.d.mts +3 -3
  67. package/dist/lib/version.d.ts +3 -3
  68. package/dist/lib/version.js +3 -3
  69. package/dist/lib/version.js.map +1 -1
  70. package/dist/lib/version.mjs +3 -3
  71. package/dist/lib/version.mjs.map +1 -1
  72. package/examples/error-compliant-server.ts +9 -3
  73. package/package.json +1 -1
@@ -24,7 +24,11 @@ import {
24
24
  } from "./validations.mjs";
25
25
  import { PARALLEL_DISPATCH_CONTRACT, runParallelDispatches, validateParallelDispatchSpec } from "./parallel-dispatch.mjs";
26
26
  import { resolvePath, resolvePortableIdentifierPathAll, toJsonPointer, validatePortableIdentifierPath } from "./path.mjs";
27
- import { RateLimitTripObserver, validateRateLimitTripSpec } from "./rate-limit-trip.mjs";
27
+ import {
28
+ RATE_LIMIT_TRIP_CONTRACT,
29
+ RateLimitTripObserver,
30
+ validateRateLimitTripSpec
31
+ } from "./rate-limit-trip.mjs";
28
32
  import { redactSecrets } from "../../utils/redact-secrets.mjs";
29
33
  import { ResponseSchemaValidationError } from "../../utils/response-unwrapper.mjs";
30
34
  import { injectLegacyEnvelopeStatus, normalizeLegacyMediaBuyStatusForReturn } from "../../utils/envelope-status-compat.mjs";
@@ -676,7 +680,7 @@ function buildCapabilityUnsupportedResult(agentUrls, storyboard, detail) {
676
680
  passed: true,
677
681
  skipped: true,
678
682
  skip_reason: "capability_unsupported",
679
- skip: { reason: "unsatisfied_contract", detail },
683
+ skip: { reason: DETAILED_SKIP_TO_CANONICAL.capability_unsupported, detail },
680
684
  duration_ms: 0,
681
685
  validations: [],
682
686
  context: {},
@@ -989,7 +993,8 @@ function detectImplicitRequires(storyboard, options = {}) {
989
993
  for (const phase of storyboard.phases) {
990
994
  for (const step of phase.steps) {
991
995
  const stepContractInScope = !step.requires_contract || contractsInScope.has(step.requires_contract);
992
- if (!needsWebhook && (step.sample_request && valueContainsWebhookToken(step.sample_request) || step.rate_limit_trip?.trip_target_sample_request && stepContractInScope && valueContainsWebhookToken(step.rate_limit_trip.trip_target_sample_request))) {
996
+ const rateLimitProbeInScope = step.task !== "expect_rate_limit_not_replayed" || stepContractInScope && contractsInScope.has(RATE_LIMIT_TRIP_CONTRACT) && options.allowLiveSideEffects === true;
997
+ if (!needsWebhook && (step.sample_request && rateLimitProbeInScope && valueContainsWebhookToken(step.sample_request) || step.rate_limit_trip?.trip_target_sample_request && stepContractInScope && rateLimitProbeInScope && valueContainsWebhookToken(step.rate_limit_trip.trip_target_sample_request))) {
993
998
  needsWebhook = true;
994
999
  }
995
1000
  if (!needsSigner && step.task === "request_signing_probe") {
@@ -3189,9 +3194,9 @@ async function executeProbeStep(client, step, phaseId, context, allSteps, option
3189
3194
  fetchFn: options.transport?.fetchFn
3190
3195
  };
3191
3196
  let requestRecordOverride;
3197
+ const contractsInScope = new Set(options.contracts ?? []);
3192
3198
  if (step.requires_contract) {
3193
- const contracts = new Set(options.contracts ?? []);
3194
- if (!contracts.has(step.requires_contract)) {
3199
+ if (!contractsInScope.has(step.requires_contract)) {
3195
3200
  httpResult = {
3196
3201
  url: runState.agentUrl,
3197
3202
  status: 0,
@@ -3203,6 +3208,17 @@ async function executeProbeStep(client, step, phaseId, context, allSteps, option
3203
3208
  };
3204
3209
  }
3205
3210
  }
3211
+ if (!httpResult && step.task === "expect_rate_limit_not_replayed" && !contractsInScope.has(RATE_LIMIT_TRIP_CONTRACT)) {
3212
+ httpResult = {
3213
+ url: runState.agentUrl,
3214
+ status: 0,
3215
+ headers: {},
3216
+ body: null,
3217
+ skipped: true,
3218
+ skip_reason: "missing_test_kit_contract",
3219
+ error: `Test-kit contract "${RATE_LIMIT_TRIP_CONTRACT}" is not configured on this runner.`
3220
+ };
3221
+ }
3206
3222
  if (httpResult) {
3207
3223
  } else if (step.task === "protected_resource_metadata") {
3208
3224
  if (step.validations?.some((validation) => validation.check === "oauth_metadata_graph")) {
@@ -3243,6 +3259,16 @@ async function executeProbeStep(client, step, phaseId, context, allSteps, option
3243
3259
  body: { attempts: 0, error: "rate_limit_trip_misconfigured" },
3244
3260
  error: specError
3245
3261
  };
3262
+ } else if (options.allowLiveSideEffects !== true) {
3263
+ httpResult = {
3264
+ url: runState.agentUrl,
3265
+ status: 0,
3266
+ headers: {},
3267
+ body: null,
3268
+ skipped: true,
3269
+ skip_reason: "live_side_effect_opt_in_required",
3270
+ error: "The rate-limit trip probe can send hundreds of mutating requests. Pass allowLiveSideEffects: true to authorize it explicitly."
3271
+ };
3246
3272
  } else {
3247
3273
  const rateLimitTrip = step.rate_limit_trip;
3248
3274
  const targetStep = {
@@ -3549,6 +3575,7 @@ function buildEffectiveStepRequest(step, context, options, runState) {
3549
3575
  };
3550
3576
  }
3551
3577
  function preflightRemainingCreativeAssetDirectives(allSteps, afterGlobalIndex, context, options, runState, excludedPhaseIds = /* @__PURE__ */ new Set()) {
3578
+ const contractsInScope = new Set(options.contracts ?? []);
3552
3579
  for (const target of allSteps) {
3553
3580
  if (target.globalIndex <= afterGlobalIndex) continue;
3554
3581
  if (excludedPhaseIds.has(target.phaseId)) continue;
@@ -3557,7 +3584,10 @@ function preflightRemainingCreativeAssetDirectives(allSteps, afterGlobalIndex, c
3557
3584
  if (target.step.requires_tool && options.agentTools && !options.agentTools.includes(target.step.requires_tool)) {
3558
3585
  continue;
3559
3586
  }
3560
- if (target.step.requires_contract && !new Set(options.contracts ?? []).has(target.step.requires_contract)) {
3587
+ if (target.step.requires_contract && !contractsInScope.has(target.step.requires_contract)) {
3588
+ continue;
3589
+ }
3590
+ if (target.step.task === "expect_rate_limit_not_replayed" && (!contractsInScope.has(RATE_LIMIT_TRIP_CONTRACT) || options.allowLiveSideEffects !== true)) {
3561
3591
  continue;
3562
3592
  }
3563
3593
  if (!PROBE_TASKS.has(target.step.task) && options.agentTools && !options.agentTools.includes(resolvedTask)) {