@adcp/sdk 13.0.0-rc.21 → 13.0.0-rc.23
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.
- package/dist/lib/schemas-data/v2.5/_provenance.json +1 -1
- package/dist/lib/testing/storyboard/runner.d.mts +2 -2
- package/dist/lib/testing/storyboard/runner.d.ts +2 -2
- package/dist/lib/testing/storyboard/runner.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/runner.js +16 -2
- package/dist/lib/testing/storyboard/runner.js.map +1 -1
- package/dist/lib/testing/storyboard/runner.mjs +16 -2
- package/dist/lib/testing/storyboard/runner.mjs.map +1 -1
- package/dist/lib/testing/storyboard/types.d.mts +7 -4
- package/dist/lib/testing/storyboard/types.d.ts +7 -4
- package/dist/lib/testing/storyboard/types.d.ts.map +1 -1
- package/dist/lib/testing/storyboard/types.js.map +1 -1
- package/dist/lib/testing/storyboard/types.mjs.map +1 -1
- package/dist/lib/testing/storyboard/validations.d.mts +1 -1
- package/dist/lib/testing/storyboard/validations.d.ts +1 -1
- package/dist/lib/v2/projection/creative-delivery.d.ts.map +1 -1
- package/dist/lib/v2/projection/creative-delivery.js +2 -0
- package/dist/lib/v2/projection/creative-delivery.js.map +1 -1
- package/dist/lib/v2/projection/creative-delivery.mjs +2 -0
- package/dist/lib/v2/projection/creative-delivery.mjs.map +1 -1
- package/dist/lib/version.d.mts +3 -3
- package/dist/lib/version.d.ts +3 -3
- package/dist/lib/version.js +3 -3
- package/dist/lib/version.js.map +1 -1
- package/dist/lib/version.mjs +3 -3
- package/dist/lib/version.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -220,7 +220,7 @@ function evaluateCapabilityPredicate(predicate, actual) {
|
|
|
220
220
|
if (!Array.isArray(actual)) {
|
|
221
221
|
return `Capability predicate \`${predicate.path}\` must contain ${JSON.stringify(predicate.contains)}: agent declared ${actual === void 0 ? "no value" : JSON.stringify(actual)}.`;
|
|
222
222
|
}
|
|
223
|
-
if (!actual.
|
|
223
|
+
if (!actual.some((value) => capabilityValuesEqual(value, predicate.contains))) {
|
|
224
224
|
return `Capability predicate \`${predicate.path}\` must contain ${JSON.stringify(predicate.contains)}: agent declared ${JSON.stringify(actual)}.`;
|
|
225
225
|
}
|
|
226
226
|
return null;
|
|
@@ -229,7 +229,7 @@ function evaluateCapabilityPredicate(predicate, actual) {
|
|
|
229
229
|
if (!Array.isArray(actual)) {
|
|
230
230
|
return `Capability predicate \`${predicate.path}\` must not contain ${JSON.stringify(predicate.not_contains)}: agent declared ${actual === void 0 ? "no value" : JSON.stringify(actual)}.`;
|
|
231
231
|
}
|
|
232
|
-
if (actual.
|
|
232
|
+
if (actual.some((value) => capabilityValuesEqual(value, predicate.not_contains))) {
|
|
233
233
|
return `Capability predicate \`${predicate.path}\` must not contain ${JSON.stringify(predicate.not_contains)}: agent declared ${JSON.stringify(actual)}.`;
|
|
234
234
|
}
|
|
235
235
|
return null;
|
|
@@ -242,6 +242,20 @@ function evaluateCapabilityPredicate(predicate, actual) {
|
|
|
242
242
|
}
|
|
243
243
|
return null;
|
|
244
244
|
}
|
|
245
|
+
function capabilityValuesEqual(a, b) {
|
|
246
|
+
if (a === b) return true;
|
|
247
|
+
if (typeof a !== typeof b || a === null || b === null || typeof a !== "object") return false;
|
|
248
|
+
if (Array.isArray(a)) {
|
|
249
|
+
if (!Array.isArray(b) || a.length !== b.length) return false;
|
|
250
|
+
return a.every((value, index) => capabilityValuesEqual(value, b[index]));
|
|
251
|
+
}
|
|
252
|
+
if (Array.isArray(b)) return false;
|
|
253
|
+
const aRecord = a;
|
|
254
|
+
const bRecord = b;
|
|
255
|
+
const aKeys = Object.keys(aRecord).sort();
|
|
256
|
+
const bKeys = Object.keys(bRecord).sort();
|
|
257
|
+
return aKeys.length === bKeys.length && aKeys.every((key, index) => key === bKeys[index] && capabilityValuesEqual(aRecord[key], bRecord[key]));
|
|
258
|
+
}
|
|
245
259
|
function evaluateRequiresCapabilityGate(predicate, profile, agentTools, adcpVersion) {
|
|
246
260
|
const rawCaps = profile?.raw_capabilities;
|
|
247
261
|
if (rawCaps !== void 0) {
|