@adcp/sdk 16.2.0 → 16.3.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.
- package/AGENTS.md +2 -0
- package/dist/lib/core/AgentClient.js +17 -1
- package/dist/lib/core/AgentClient.mjs +17 -1
- package/dist/lib/core/SingleAgentClient.js +13 -0
- package/dist/lib/core/SingleAgentClient.mjs +13 -0
- package/dist/lib/core/TaskExecutor.js +88 -13
- package/dist/lib/core/TaskExecutor.mjs +89 -14
- package/dist/lib/errors/index.d.mts +34 -0
- package/dist/lib/errors/index.d.ts +34 -0
- package/dist/lib/errors/index.js +11 -0
- package/dist/lib/errors/index.mjs +10 -0
- package/dist/lib/index.d.mts +1 -1
- package/dist/lib/index.d.ts +1 -1
- package/dist/lib/index.js +2 -0
- package/dist/lib/index.mjs +2 -0
- package/dist/lib/media-buy/compatibility.d.mts +1 -0
- package/dist/lib/media-buy/compatibility.d.ts +1 -0
- package/dist/lib/media-buy/compatibility.js +33 -10
- package/dist/lib/media-buy/compatibility.mjs +32 -14
- package/dist/lib/negotiation/buyer.js +11 -5
- package/dist/lib/negotiation/buyer.mjs +11 -5
- package/dist/lib/negotiation/types.d.mts +4 -2
- package/dist/lib/negotiation/types.d.ts +4 -2
- package/dist/lib/negotiation/verification.d.mts +15 -6
- package/dist/lib/negotiation/verification.d.ts +15 -6
- package/dist/lib/negotiation/verification.js +146 -27
- package/dist/lib/negotiation/verification.mjs +146 -28
- package/dist/lib/negotiation/version.d.mts +6 -0
- package/dist/lib/negotiation/version.d.ts +6 -0
- package/dist/lib/negotiation/version.js +60 -0
- package/dist/lib/negotiation/version.mjs +33 -0
- package/dist/lib/server/create-adcp-server.js +1 -1
- package/dist/lib/server/create-adcp-server.mjs +1 -1
- package/dist/lib/server/error-arm-tools.d.mts +10 -10
- package/dist/lib/server/error-arm-tools.d.ts +10 -10
- package/dist/lib/server/error-arm-tools.js +22 -58
- package/dist/lib/server/error-arm-tools.mjs +30 -65
- package/dist/lib/testing/compliance/comply.js +17 -0
- package/dist/lib/testing/compliance/comply.mjs +17 -0
- package/dist/lib/testing/index.d.mts +3 -0
- package/dist/lib/testing/index.d.ts +3 -0
- package/dist/lib/testing/index.js +44 -2
- package/dist/lib/testing/index.mjs +42 -0
- package/dist/lib/testing/storyboard/collection-selection.d.mts +259 -0
- package/dist/lib/testing/storyboard/collection-selection.d.ts +259 -0
- package/dist/lib/testing/storyboard/collection-selection.js +384 -0
- package/dist/lib/testing/storyboard/collection-selection.mjs +348 -0
- package/dist/lib/testing/storyboard/context.js +12 -6
- package/dist/lib/testing/storyboard/context.mjs +12 -6
- package/dist/lib/testing/storyboard/fixture-resolution.d.mts +39 -1
- package/dist/lib/testing/storyboard/fixture-resolution.d.ts +39 -1
- package/dist/lib/testing/storyboard/fixture-resolution.js +216 -12
- package/dist/lib/testing/storyboard/fixture-resolution.mjs +218 -12
- package/dist/lib/testing/storyboard/index.d.mts +9 -2
- package/dist/lib/testing/storyboard/index.d.ts +9 -2
- package/dist/lib/testing/storyboard/index.js +51 -2
- package/dist/lib/testing/storyboard/index.mjs +49 -1
- package/dist/lib/testing/storyboard/prepared-fixtures.d.mts +471 -0
- package/dist/lib/testing/storyboard/prepared-fixtures.d.ts +471 -0
- package/dist/lib/testing/storyboard/prepared-fixtures.js +434 -0
- package/dist/lib/testing/storyboard/prepared-fixtures.mjs +389 -0
- package/dist/lib/testing/storyboard/protected-context.d.mts +127 -0
- package/dist/lib/testing/storyboard/protected-context.d.ts +127 -0
- package/dist/lib/testing/storyboard/protected-context.js +301 -0
- package/dist/lib/testing/storyboard/protected-context.mjs +267 -0
- package/dist/lib/testing/storyboard/rejection-hints.js +13 -4
- package/dist/lib/testing/storyboard/rejection-hints.mjs +13 -4
- package/dist/lib/testing/storyboard/runner.d.mts +24 -0
- package/dist/lib/testing/storyboard/runner.d.ts +24 -0
- package/dist/lib/testing/storyboard/runner.js +1061 -105
- package/dist/lib/testing/storyboard/runner.mjs +1075 -106
- package/dist/lib/testing/storyboard/seeding.d.mts +15 -1
- package/dist/lib/testing/storyboard/seeding.d.ts +15 -1
- package/dist/lib/testing/storyboard/seeding.js +272 -12
- package/dist/lib/testing/storyboard/seeding.mjs +274 -13
- package/dist/lib/testing/storyboard/types.d.mts +207 -10
- package/dist/lib/testing/storyboard/types.d.ts +207 -10
- package/dist/lib/testing/storyboard/types.js +1 -1
- package/dist/lib/testing/storyboard/types.mjs +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/testing/storyboard/validations.js +95 -0
- package/dist/lib/testing/storyboard/validations.mjs +95 -0
- package/dist/lib/validation/bundled-schema-store.js +5 -0
- package/dist/lib/validation/bundled-schema-store.mjs +4 -0
- package/dist/lib/validation/schema-loader.js +19 -2
- package/dist/lib/validation/schema-loader.mjs +22 -3
- 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.mjs +3 -3
- package/docs/TYPE-SUMMARY.md +1 -1
- package/docs/guides/COLLECTION-FIXTURE-FOUNDATION.md +850 -0
- package/docs/guides/PROPOSAL-TERMS-VERIFICATION.md +66 -0
- package/docs/llms.txt +3 -2
- package/docs/migration-14.x-rc-worksheet.md +4 -4
- package/package.json +1 -1
|
@@ -40,6 +40,7 @@ var import_test_controller = require('../test-controller.js');
|
|
|
40
40
|
var import_glob = require('../../utils/glob.js');
|
|
41
41
|
var import_path = require('./path.js');
|
|
42
42
|
var import_canonicalize = require('../../signing/canonicalize.js');
|
|
43
|
+
var import_collection_selection = require('./collection-selection.js');
|
|
43
44
|
var import_shape_drift_hints = require('./shape-drift-hints.js');
|
|
44
45
|
var import_test_kit = require('./test-kit.js');
|
|
45
46
|
var import_canonical_format_satisfaction = require('./canonical-format-satisfaction.js');
|
|
@@ -146,6 +147,8 @@ function runValidation(validation, ctx) {
|
|
|
146
147
|
return validateFieldInContextArray(validation, ctx);
|
|
147
148
|
case "all_fields_in_context_array":
|
|
148
149
|
return validateAllFieldsInContextArray(validation, ctx);
|
|
150
|
+
case "collection_set_equals_context":
|
|
151
|
+
return validateCollectionSetEqualsContext(validation, ctx);
|
|
149
152
|
case "upstream_traffic":
|
|
150
153
|
return validateUpstreamTraffic(validation, ctx);
|
|
151
154
|
case "replay_not_cached_rate_limit":
|
|
@@ -2104,6 +2107,98 @@ function validateFieldEqualsContext(validation, ctx) {
|
|
|
2104
2107
|
actual: actual ?? null
|
|
2105
2108
|
};
|
|
2106
2109
|
}
|
|
2110
|
+
function validateCollectionSetEqualsContext(validation, ctx) {
|
|
2111
|
+
const check = "collection_set_equals_context";
|
|
2112
|
+
const base = { check, description: validation.description, schema_id: null, schema_url: null };
|
|
2113
|
+
if (!validation.path) {
|
|
2114
|
+
return {
|
|
2115
|
+
...base,
|
|
2116
|
+
passed: false,
|
|
2117
|
+
error: 'collection_set_equals_context is missing "path" \u2014 set it to the response array of CollectionSelector objects to compare, e.g. packages[0].targeting_overlay.collection_selection.collections',
|
|
2118
|
+
json_pointer: null,
|
|
2119
|
+
expected: "a response path pointing at a CollectionSelector[]",
|
|
2120
|
+
actual: null
|
|
2121
|
+
};
|
|
2122
|
+
}
|
|
2123
|
+
if (!validation.context_key) {
|
|
2124
|
+
return {
|
|
2125
|
+
...base,
|
|
2126
|
+
passed: false,
|
|
2127
|
+
error: 'collection_set_equals_context is missing "context_key" \u2014 set it to the __adcp_fixture_* key captured by the fixture declaration whose selection this step reads back, e.g. __adcp_fixture_subset',
|
|
2128
|
+
json_pointer: null,
|
|
2129
|
+
expected: "a reserved fixture capture key holding the expected selector array",
|
|
2130
|
+
actual: null
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2133
|
+
const pointer = (0, import_path.toJsonPointer)(validation.path);
|
|
2134
|
+
const storyboardContext = ctx.storyboardContext;
|
|
2135
|
+
if (!storyboardContext || !Object.hasOwn(storyboardContext, validation.context_key)) {
|
|
2136
|
+
return {
|
|
2137
|
+
...base,
|
|
2138
|
+
passed: false,
|
|
2139
|
+
path: validation.path,
|
|
2140
|
+
error: `expected_context_absent: context key "${validation.context_key}" was never published, so there is no expected set to compare against. Declare it as a capture on the fixture_resolution entry that pins this product \u2014 context_outputs: [{ key: ${validation.context_key}, witness: strict_subset }] \u2014 and confirm the whole fixture graph resolved (captures publish all-or-nothing). Unlike field_equals_context, this check FAILS rather than skipping on a missing key: silently passing would certify exactly the substitution it exists to catch.`,
|
|
2141
|
+
json_pointer: pointer,
|
|
2142
|
+
expected: `context["${validation.context_key}"]`,
|
|
2143
|
+
actual: null
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
const expectedRaw = storyboardContext[validation.context_key];
|
|
2147
|
+
if (Array.isArray(expectedRaw) && expectedRaw.length > 0 && expectedRaw.every(
|
|
2148
|
+
(entry) => entry !== null && typeof entry === "object" && "collection_id" in entry && !("collection_ids" in entry)
|
|
2149
|
+
)) {
|
|
2150
|
+
return {
|
|
2151
|
+
...base,
|
|
2152
|
+
passed: false,
|
|
2153
|
+
path: validation.path,
|
|
2154
|
+
error: `expected_context_malformed: context["${validation.context_key}"] looks like a \`distinct_pairs\` witness, which is a diagnostic shape carrying singular \`collection_id\` \u2014 not the \`collection_ids\` arrays the wire and this check compare. Capture \`witness: declared_selectors\` (every selector the product declared) or \`witness: strict_subset\` (a proper subset of them) instead.`,
|
|
2155
|
+
json_pointer: pointer,
|
|
2156
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2157
|
+
actual: "distinct_pairs_witness"
|
|
2158
|
+
};
|
|
2159
|
+
}
|
|
2160
|
+
const expected = (0, import_collection_selection.normalizeCollectionSelectors)(expectedRaw);
|
|
2161
|
+
if (!expected.ok) {
|
|
2162
|
+
return {
|
|
2163
|
+
...base,
|
|
2164
|
+
passed: false,
|
|
2165
|
+
path: validation.path,
|
|
2166
|
+
error: `expected_context_malformed: context["${validation.context_key}"] is not a usable collection selector array \u2014 ${expected.failure.detail}`,
|
|
2167
|
+
json_pointer: pointer,
|
|
2168
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2169
|
+
actual: null
|
|
2170
|
+
};
|
|
2171
|
+
}
|
|
2172
|
+
const actualRaw = (0, import_path.resolvePath)(resolveTarget(ctx).data, validation.path);
|
|
2173
|
+
const actual = (0, import_collection_selection.normalizeCollectionSelectors)(actualRaw);
|
|
2174
|
+
if (!actual.ok) {
|
|
2175
|
+
return {
|
|
2176
|
+
...base,
|
|
2177
|
+
passed: false,
|
|
2178
|
+
path: validation.path,
|
|
2179
|
+
error: `actual_collections_malformed: ${actual.failure.detail}`,
|
|
2180
|
+
json_pointer: pointer,
|
|
2181
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2182
|
+
actual: actualRaw ?? null
|
|
2183
|
+
};
|
|
2184
|
+
}
|
|
2185
|
+
const diff = (0, import_collection_selection.diffCollectionPairSets)(actual.value.pairs, expected.value.pairs);
|
|
2186
|
+
if (diff.equal) {
|
|
2187
|
+
return { ...base, passed: true, path: validation.path, json_pointer: pointer };
|
|
2188
|
+
}
|
|
2189
|
+
const parts = [];
|
|
2190
|
+
if (diff.missing.length > 0) parts.push(`missing ${(0, import_collection_selection.summarizeCollectionPairs)(diff.missing)}`);
|
|
2191
|
+
if (diff.unexpected.length > 0) parts.push(`unexpected ${(0, import_collection_selection.summarizeCollectionPairs)(diff.unexpected)}`);
|
|
2192
|
+
return {
|
|
2193
|
+
...base,
|
|
2194
|
+
passed: false,
|
|
2195
|
+
path: validation.path,
|
|
2196
|
+
error: `collection sets differ: ${parts.join("; ")}`,
|
|
2197
|
+
json_pointer: pointer,
|
|
2198
|
+
expected: expected.value.pairs,
|
|
2199
|
+
actual: actual.value.pairs
|
|
2200
|
+
};
|
|
2201
|
+
}
|
|
2107
2202
|
function validateFieldInContextArray(validation, ctx) {
|
|
2108
2203
|
if (!validation.path) {
|
|
2109
2204
|
return {
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
WILDCARD
|
|
24
24
|
} from "./path.mjs";
|
|
25
25
|
import { canonicalTargetUri } from "../../signing/canonicalize.mjs";
|
|
26
|
+
import { diffCollectionPairSets, normalizeCollectionSelectors, summarizeCollectionPairs } from "./collection-selection.mjs";
|
|
26
27
|
import { detectShapeDriftHints } from "./shape-drift-hints.mjs";
|
|
27
28
|
import { PROBE_TASK_ALLOWLIST } from "./test-kit.mjs";
|
|
28
29
|
import { validateCanonicalFormatSatisfaction } from "./canonical-format-satisfaction.mjs";
|
|
@@ -127,6 +128,8 @@ function runValidation(validation, ctx) {
|
|
|
127
128
|
return validateFieldInContextArray(validation, ctx);
|
|
128
129
|
case "all_fields_in_context_array":
|
|
129
130
|
return validateAllFieldsInContextArray(validation, ctx);
|
|
131
|
+
case "collection_set_equals_context":
|
|
132
|
+
return validateCollectionSetEqualsContext(validation, ctx);
|
|
130
133
|
case "upstream_traffic":
|
|
131
134
|
return validateUpstreamTraffic(validation, ctx);
|
|
132
135
|
case "replay_not_cached_rate_limit":
|
|
@@ -2086,6 +2089,98 @@ function validateFieldEqualsContext(validation, ctx) {
|
|
|
2086
2089
|
actual: actual ?? null
|
|
2087
2090
|
};
|
|
2088
2091
|
}
|
|
2092
|
+
function validateCollectionSetEqualsContext(validation, ctx) {
|
|
2093
|
+
const check = "collection_set_equals_context";
|
|
2094
|
+
const base = { check, description: validation.description, schema_id: null, schema_url: null };
|
|
2095
|
+
if (!validation.path) {
|
|
2096
|
+
return {
|
|
2097
|
+
...base,
|
|
2098
|
+
passed: false,
|
|
2099
|
+
error: 'collection_set_equals_context is missing "path" \u2014 set it to the response array of CollectionSelector objects to compare, e.g. packages[0].targeting_overlay.collection_selection.collections',
|
|
2100
|
+
json_pointer: null,
|
|
2101
|
+
expected: "a response path pointing at a CollectionSelector[]",
|
|
2102
|
+
actual: null
|
|
2103
|
+
};
|
|
2104
|
+
}
|
|
2105
|
+
if (!validation.context_key) {
|
|
2106
|
+
return {
|
|
2107
|
+
...base,
|
|
2108
|
+
passed: false,
|
|
2109
|
+
error: 'collection_set_equals_context is missing "context_key" \u2014 set it to the __adcp_fixture_* key captured by the fixture declaration whose selection this step reads back, e.g. __adcp_fixture_subset',
|
|
2110
|
+
json_pointer: null,
|
|
2111
|
+
expected: "a reserved fixture capture key holding the expected selector array",
|
|
2112
|
+
actual: null
|
|
2113
|
+
};
|
|
2114
|
+
}
|
|
2115
|
+
const pointer = toJsonPointer(validation.path);
|
|
2116
|
+
const storyboardContext = ctx.storyboardContext;
|
|
2117
|
+
if (!storyboardContext || !Object.hasOwn(storyboardContext, validation.context_key)) {
|
|
2118
|
+
return {
|
|
2119
|
+
...base,
|
|
2120
|
+
passed: false,
|
|
2121
|
+
path: validation.path,
|
|
2122
|
+
error: `expected_context_absent: context key "${validation.context_key}" was never published, so there is no expected set to compare against. Declare it as a capture on the fixture_resolution entry that pins this product \u2014 context_outputs: [{ key: ${validation.context_key}, witness: strict_subset }] \u2014 and confirm the whole fixture graph resolved (captures publish all-or-nothing). Unlike field_equals_context, this check FAILS rather than skipping on a missing key: silently passing would certify exactly the substitution it exists to catch.`,
|
|
2123
|
+
json_pointer: pointer,
|
|
2124
|
+
expected: `context["${validation.context_key}"]`,
|
|
2125
|
+
actual: null
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
const expectedRaw = storyboardContext[validation.context_key];
|
|
2129
|
+
if (Array.isArray(expectedRaw) && expectedRaw.length > 0 && expectedRaw.every(
|
|
2130
|
+
(entry) => entry !== null && typeof entry === "object" && "collection_id" in entry && !("collection_ids" in entry)
|
|
2131
|
+
)) {
|
|
2132
|
+
return {
|
|
2133
|
+
...base,
|
|
2134
|
+
passed: false,
|
|
2135
|
+
path: validation.path,
|
|
2136
|
+
error: `expected_context_malformed: context["${validation.context_key}"] looks like a \`distinct_pairs\` witness, which is a diagnostic shape carrying singular \`collection_id\` \u2014 not the \`collection_ids\` arrays the wire and this check compare. Capture \`witness: declared_selectors\` (every selector the product declared) or \`witness: strict_subset\` (a proper subset of them) instead.`,
|
|
2137
|
+
json_pointer: pointer,
|
|
2138
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2139
|
+
actual: "distinct_pairs_witness"
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
const expected = normalizeCollectionSelectors(expectedRaw);
|
|
2143
|
+
if (!expected.ok) {
|
|
2144
|
+
return {
|
|
2145
|
+
...base,
|
|
2146
|
+
passed: false,
|
|
2147
|
+
path: validation.path,
|
|
2148
|
+
error: `expected_context_malformed: context["${validation.context_key}"] is not a usable collection selector array \u2014 ${expected.failure.detail}`,
|
|
2149
|
+
json_pointer: pointer,
|
|
2150
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2151
|
+
actual: null
|
|
2152
|
+
};
|
|
2153
|
+
}
|
|
2154
|
+
const actualRaw = resolvePath(resolveTarget(ctx).data, validation.path);
|
|
2155
|
+
const actual = normalizeCollectionSelectors(actualRaw);
|
|
2156
|
+
if (!actual.ok) {
|
|
2157
|
+
return {
|
|
2158
|
+
...base,
|
|
2159
|
+
passed: false,
|
|
2160
|
+
path: validation.path,
|
|
2161
|
+
error: `actual_collections_malformed: ${actual.failure.detail}`,
|
|
2162
|
+
json_pointer: pointer,
|
|
2163
|
+
expected: "an array of { publisher_domain, collection_ids } selectors",
|
|
2164
|
+
actual: actualRaw ?? null
|
|
2165
|
+
};
|
|
2166
|
+
}
|
|
2167
|
+
const diff = diffCollectionPairSets(actual.value.pairs, expected.value.pairs);
|
|
2168
|
+
if (diff.equal) {
|
|
2169
|
+
return { ...base, passed: true, path: validation.path, json_pointer: pointer };
|
|
2170
|
+
}
|
|
2171
|
+
const parts = [];
|
|
2172
|
+
if (diff.missing.length > 0) parts.push(`missing ${summarizeCollectionPairs(diff.missing)}`);
|
|
2173
|
+
if (diff.unexpected.length > 0) parts.push(`unexpected ${summarizeCollectionPairs(diff.unexpected)}`);
|
|
2174
|
+
return {
|
|
2175
|
+
...base,
|
|
2176
|
+
passed: false,
|
|
2177
|
+
path: validation.path,
|
|
2178
|
+
error: `collection sets differ: ${parts.join("; ")}`,
|
|
2179
|
+
json_pointer: pointer,
|
|
2180
|
+
expected: expected.value.pairs,
|
|
2181
|
+
actual: actual.value.pairs
|
|
2182
|
+
};
|
|
2183
|
+
}
|
|
2089
2184
|
function validateFieldInContextArray(validation, ctx) {
|
|
2090
2185
|
if (!validation.path) {
|
|
2091
2186
|
return {
|
|
@@ -28,6 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var bundled_schema_store_exports = {};
|
|
30
30
|
__export(bundled_schema_store_exports, {
|
|
31
|
+
clearBundledSchemaStoreCache: () => clearBundledSchemaStoreCache,
|
|
31
32
|
hasBundledSchemaStore: () => hasBundledSchemaStore,
|
|
32
33
|
listBundledSchemaFiles: () => listBundledSchemaFiles,
|
|
33
34
|
loadBundledSchemaFile: () => loadBundledSchemaFile
|
|
@@ -54,6 +55,9 @@ function walkRawSchemas(root) {
|
|
|
54
55
|
function archivePath(bundledRoot) {
|
|
55
56
|
return import_node_path.default.join(import_node_path.default.dirname(bundledRoot), ARCHIVE_FILE);
|
|
56
57
|
}
|
|
58
|
+
function clearBundledSchemaStoreCache(bundledRoot) {
|
|
59
|
+
archiveCache.delete(archivePath(bundledRoot));
|
|
60
|
+
}
|
|
57
61
|
function expandCompactSchema(root) {
|
|
58
62
|
const compactNames = root[COMPACT_DEFINITIONS_KEY];
|
|
59
63
|
const definitions = root.$defs;
|
|
@@ -140,6 +144,7 @@ function loadBundledSchemaFile(file) {
|
|
|
140
144
|
}
|
|
141
145
|
// Annotate the CommonJS export names for ESM import in node:
|
|
142
146
|
0 && (module.exports = {
|
|
147
|
+
clearBundledSchemaStoreCache,
|
|
143
148
|
hasBundledSchemaStore,
|
|
144
149
|
listBundledSchemaFiles,
|
|
145
150
|
loadBundledSchemaFile
|
|
@@ -19,6 +19,9 @@ function walkRawSchemas(root) {
|
|
|
19
19
|
function archivePath(bundledRoot) {
|
|
20
20
|
return path.join(path.dirname(bundledRoot), ARCHIVE_FILE);
|
|
21
21
|
}
|
|
22
|
+
function clearBundledSchemaStoreCache(bundledRoot) {
|
|
23
|
+
archiveCache.delete(archivePath(bundledRoot));
|
|
24
|
+
}
|
|
22
25
|
function expandCompactSchema(root) {
|
|
23
26
|
const compactNames = root[COMPACT_DEFINITIONS_KEY];
|
|
24
27
|
const definitions = root.$defs;
|
|
@@ -104,6 +107,7 @@ function loadBundledSchemaFile(file) {
|
|
|
104
107
|
return schema ? expandCompactSchema(schema) : void 0;
|
|
105
108
|
}
|
|
106
109
|
export {
|
|
110
|
+
clearBundledSchemaStoreCache,
|
|
107
111
|
hasBundledSchemaStore,
|
|
108
112
|
listBundledSchemaFiles,
|
|
109
113
|
loadBundledSchemaFile
|
|
@@ -31,6 +31,7 @@ __export(schema_loader_exports, {
|
|
|
31
31
|
SCHEMA_FILENAME_SUFFIX: () => SCHEMA_FILENAME_SUFFIX,
|
|
32
32
|
_resetValidationLoader: () => _resetValidationLoader,
|
|
33
33
|
bindIdentity33SchemaScope: () => bindIdentity33SchemaScope,
|
|
34
|
+
getActiveSchemaArtifactLocation: () => getActiveSchemaArtifactLocation,
|
|
34
35
|
getCanonicalToolValidatorForVersion: () => getCanonicalToolValidatorForVersion,
|
|
35
36
|
getMcpProfileInputSchema: () => getMcpProfileInputSchema,
|
|
36
37
|
getMcpToolSchema: () => getMcpToolSchema,
|
|
@@ -39,6 +40,7 @@ __export(schema_loader_exports, {
|
|
|
39
40
|
getRequestSchemaEntityPaths: () => getRequestSchemaEntityPaths,
|
|
40
41
|
getSchemaDefaultByPath: () => getSchemaDefaultByPath,
|
|
41
42
|
getSchemaDocumentByRef: () => getSchemaDocumentByRef,
|
|
43
|
+
getSchemaLoaderGeneration: () => getSchemaLoaderGeneration,
|
|
42
44
|
getSchemaValidatorByRef: () => getSchemaValidatorByRef,
|
|
43
45
|
getToolSchemaDocument: () => getToolSchemaDocument,
|
|
44
46
|
getValidator: () => getValidator,
|
|
@@ -48,6 +50,7 @@ __export(schema_loader_exports, {
|
|
|
48
50
|
listValidatorKeys: () => listValidatorKeys,
|
|
49
51
|
registerExternalSchemaRoot: () => registerExternalSchemaRoot,
|
|
50
52
|
resolveBundleKey: () => resolveBundleKey,
|
|
53
|
+
resolveSchemaRoot: () => resolveSchemaRoot,
|
|
51
54
|
resolveServedValidationVersion: () => resolveServedValidationVersion,
|
|
52
55
|
schemaAllowsTopLevelField: () => schemaAllowsTopLevelField,
|
|
53
56
|
toReleasePrecisionWire: () => toReleasePrecisionWire,
|
|
@@ -208,6 +211,9 @@ const states = /* @__PURE__ */ new Map();
|
|
|
208
211
|
const schemaRefValidators = /* @__PURE__ */ new Map();
|
|
209
212
|
const keywordSchemaRefValidators = /* @__PURE__ */ new WeakMap();
|
|
210
213
|
let keywordCacheGeneration = 0;
|
|
214
|
+
function getSchemaLoaderGeneration() {
|
|
215
|
+
return keywordCacheGeneration;
|
|
216
|
+
}
|
|
211
217
|
const externalSchemaRoots = /* @__PURE__ */ new Map();
|
|
212
218
|
const scopedExternalSchemaRoots = new import_async_hooks.AsyncLocalStorage();
|
|
213
219
|
function stateCacheKey(bundleKey, root) {
|
|
@@ -323,15 +329,15 @@ function assertSchemaRootMatchesVersion(version, root) {
|
|
|
323
329
|
const externalSchemaRootAliases = /* @__PURE__ */ new Map();
|
|
324
330
|
function registerExternalSchemaRoot(version, root) {
|
|
325
331
|
const key = resolveBundleKey(version);
|
|
332
|
+
(0, import_bundled_schema_store.clearBundledSchemaStoreCache)(import_path.default.join(root, "bundled"));
|
|
326
333
|
if (!hasSchemaRootShape(root)) {
|
|
327
334
|
throw new Error(`External AdCP schema root for version "${version}" not found or empty at ${root}`);
|
|
328
335
|
}
|
|
329
336
|
const aliases = assertSchemaRootMatchesVersion(version, root);
|
|
330
337
|
externalSchemaRootAliases.set(key, aliases);
|
|
331
338
|
for (const alias of aliases) {
|
|
332
|
-
const previous = externalSchemaRoots.get(alias);
|
|
333
339
|
externalSchemaRoots.set(alias, root);
|
|
334
|
-
|
|
340
|
+
clearStatesForBundle(alias);
|
|
335
341
|
}
|
|
336
342
|
}
|
|
337
343
|
function unregisterExternalSchemaRoot(version) {
|
|
@@ -350,6 +356,7 @@ function unregisterExternalSchemaRoot(version) {
|
|
|
350
356
|
}
|
|
351
357
|
function withExternalSchemaRoot(version, root, fn) {
|
|
352
358
|
if (root === void 0) return fn();
|
|
359
|
+
(0, import_bundled_schema_store.clearBundledSchemaStoreCache)(import_path.default.join(root, "bundled"));
|
|
353
360
|
if (!hasSchemaRootShape(root)) {
|
|
354
361
|
throw new Error(`External AdCP schema root for version "${version}" not found or empty at ${root}`);
|
|
355
362
|
}
|
|
@@ -362,6 +369,13 @@ function withExternalSchemaRoot(version, root, fn) {
|
|
|
362
369
|
}
|
|
363
370
|
return scopedExternalSchemaRoots.run(next, fn);
|
|
364
371
|
}
|
|
372
|
+
function getActiveSchemaArtifactLocation(version) {
|
|
373
|
+
return {
|
|
374
|
+
bundle_key: resolveBundleKey(version),
|
|
375
|
+
root: resolveSchemaRoot(version),
|
|
376
|
+
external: isExternalSchemaRootActive(version)
|
|
377
|
+
};
|
|
378
|
+
}
|
|
365
379
|
function isExternalSchemaRootActive(version) {
|
|
366
380
|
const key = resolveBundleKey(version);
|
|
367
381
|
if (isIdentity33SchemaScope() && key === "3.3") return true;
|
|
@@ -1114,6 +1128,7 @@ function cloneJsonValue(value) {
|
|
|
1114
1128
|
SCHEMA_FILENAME_SUFFIX,
|
|
1115
1129
|
_resetValidationLoader,
|
|
1116
1130
|
bindIdentity33SchemaScope,
|
|
1131
|
+
getActiveSchemaArtifactLocation,
|
|
1117
1132
|
getCanonicalToolValidatorForVersion,
|
|
1118
1133
|
getMcpProfileInputSchema,
|
|
1119
1134
|
getMcpToolSchema,
|
|
@@ -1122,6 +1137,7 @@ function cloneJsonValue(value) {
|
|
|
1122
1137
|
getRequestSchemaEntityPaths,
|
|
1123
1138
|
getSchemaDefaultByPath,
|
|
1124
1139
|
getSchemaDocumentByRef,
|
|
1140
|
+
getSchemaLoaderGeneration,
|
|
1125
1141
|
getSchemaValidatorByRef,
|
|
1126
1142
|
getToolSchemaDocument,
|
|
1127
1143
|
getValidator,
|
|
@@ -1131,6 +1147,7 @@ function cloneJsonValue(value) {
|
|
|
1131
1147
|
listValidatorKeys,
|
|
1132
1148
|
registerExternalSchemaRoot,
|
|
1133
1149
|
resolveBundleKey,
|
|
1150
|
+
resolveSchemaRoot,
|
|
1134
1151
|
resolveServedValidationVersion,
|
|
1135
1152
|
schemaAllowsTopLevelField,
|
|
1136
1153
|
toReleasePrecisionWire,
|
|
@@ -11,7 +11,12 @@ import path from "path";
|
|
|
11
11
|
import { isDeepStrictEqual } from "node:util";
|
|
12
12
|
import { ADCP_VERSION } from "../version.mjs";
|
|
13
13
|
import { ConfigurationError } from "../errors/index.mjs";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
clearBundledSchemaStoreCache,
|
|
16
|
+
hasBundledSchemaStore,
|
|
17
|
+
listBundledSchemaFiles,
|
|
18
|
+
loadBundledSchemaFile
|
|
19
|
+
} from "./bundled-schema-store.mjs";
|
|
15
20
|
const SCHEMA_FILENAME_SUFFIX = {
|
|
16
21
|
request: "request",
|
|
17
22
|
sync: "response",
|
|
@@ -152,6 +157,9 @@ const states = /* @__PURE__ */ new Map();
|
|
|
152
157
|
const schemaRefValidators = /* @__PURE__ */ new Map();
|
|
153
158
|
const keywordSchemaRefValidators = /* @__PURE__ */ new WeakMap();
|
|
154
159
|
let keywordCacheGeneration = 0;
|
|
160
|
+
function getSchemaLoaderGeneration() {
|
|
161
|
+
return keywordCacheGeneration;
|
|
162
|
+
}
|
|
155
163
|
const externalSchemaRoots = /* @__PURE__ */ new Map();
|
|
156
164
|
const scopedExternalSchemaRoots = new AsyncLocalStorage();
|
|
157
165
|
function stateCacheKey(bundleKey, root) {
|
|
@@ -267,15 +275,15 @@ function assertSchemaRootMatchesVersion(version, root) {
|
|
|
267
275
|
const externalSchemaRootAliases = /* @__PURE__ */ new Map();
|
|
268
276
|
function registerExternalSchemaRoot(version, root) {
|
|
269
277
|
const key = resolveBundleKey(version);
|
|
278
|
+
clearBundledSchemaStoreCache(path.join(root, "bundled"));
|
|
270
279
|
if (!hasSchemaRootShape(root)) {
|
|
271
280
|
throw new Error(`External AdCP schema root for version "${version}" not found or empty at ${root}`);
|
|
272
281
|
}
|
|
273
282
|
const aliases = assertSchemaRootMatchesVersion(version, root);
|
|
274
283
|
externalSchemaRootAliases.set(key, aliases);
|
|
275
284
|
for (const alias of aliases) {
|
|
276
|
-
const previous = externalSchemaRoots.get(alias);
|
|
277
285
|
externalSchemaRoots.set(alias, root);
|
|
278
|
-
|
|
286
|
+
clearStatesForBundle(alias);
|
|
279
287
|
}
|
|
280
288
|
}
|
|
281
289
|
function unregisterExternalSchemaRoot(version) {
|
|
@@ -294,6 +302,7 @@ function unregisterExternalSchemaRoot(version) {
|
|
|
294
302
|
}
|
|
295
303
|
function withExternalSchemaRoot(version, root, fn) {
|
|
296
304
|
if (root === void 0) return fn();
|
|
305
|
+
clearBundledSchemaStoreCache(path.join(root, "bundled"));
|
|
297
306
|
if (!hasSchemaRootShape(root)) {
|
|
298
307
|
throw new Error(`External AdCP schema root for version "${version}" not found or empty at ${root}`);
|
|
299
308
|
}
|
|
@@ -306,6 +315,13 @@ function withExternalSchemaRoot(version, root, fn) {
|
|
|
306
315
|
}
|
|
307
316
|
return scopedExternalSchemaRoots.run(next, fn);
|
|
308
317
|
}
|
|
318
|
+
function getActiveSchemaArtifactLocation(version) {
|
|
319
|
+
return {
|
|
320
|
+
bundle_key: resolveBundleKey(version),
|
|
321
|
+
root: resolveSchemaRoot(version),
|
|
322
|
+
external: isExternalSchemaRootActive(version)
|
|
323
|
+
};
|
|
324
|
+
}
|
|
309
325
|
function isExternalSchemaRootActive(version) {
|
|
310
326
|
const key = resolveBundleKey(version);
|
|
311
327
|
if (isIdentity33SchemaScope() && key === "3.3") return true;
|
|
@@ -1057,6 +1073,7 @@ export {
|
|
|
1057
1073
|
SCHEMA_FILENAME_SUFFIX,
|
|
1058
1074
|
_resetValidationLoader,
|
|
1059
1075
|
bindIdentity33SchemaScope,
|
|
1076
|
+
getActiveSchemaArtifactLocation,
|
|
1060
1077
|
getCanonicalToolValidatorForVersion,
|
|
1061
1078
|
getMcpProfileInputSchema,
|
|
1062
1079
|
getMcpToolSchema,
|
|
@@ -1065,6 +1082,7 @@ export {
|
|
|
1065
1082
|
getRequestSchemaEntityPaths,
|
|
1066
1083
|
getSchemaDefaultByPath,
|
|
1067
1084
|
getSchemaDocumentByRef,
|
|
1085
|
+
getSchemaLoaderGeneration,
|
|
1068
1086
|
getSchemaValidatorByRef,
|
|
1069
1087
|
getToolSchemaDocument,
|
|
1070
1088
|
getValidator,
|
|
@@ -1074,6 +1092,7 @@ export {
|
|
|
1074
1092
|
listValidatorKeys,
|
|
1075
1093
|
registerExternalSchemaRoot,
|
|
1076
1094
|
resolveBundleKey,
|
|
1095
|
+
resolveSchemaRoot,
|
|
1077
1096
|
resolveServedValidationVersion,
|
|
1078
1097
|
schemaAllowsTopLevelField,
|
|
1079
1098
|
toReleasePrecisionWire,
|
package/dist/lib/version.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AdCP SDK library version
|
|
3
3
|
*/
|
|
4
|
-
export declare const LIBRARY_VERSION = "16.
|
|
4
|
+
export declare const LIBRARY_VERSION = "16.3.0";
|
|
5
5
|
/**
|
|
6
6
|
* AdCP specification version this library is built for
|
|
7
7
|
*/
|
|
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
|
|
|
33
33
|
* Full version information
|
|
34
34
|
*/
|
|
35
35
|
export declare const VERSION_INFO: {
|
|
36
|
-
readonly library: "16.
|
|
36
|
+
readonly library: "16.3.0";
|
|
37
37
|
readonly adcp: "3.2.5";
|
|
38
38
|
readonly compatibleVersions: readonly ["v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.1.25", "3.1.26", "3.1.27", "3.1.28", "3.1.29", "3.2.1", "3.2", "3.2.2", "3.2.3", "3.2.4", "3.2.5"];
|
|
39
|
-
readonly generatedAt: "2026-10-
|
|
39
|
+
readonly generatedAt: "2026-10-22T14:25:22.608Z";
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Get the AdCP specification version this library is built for
|
package/dist/lib/version.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* AdCP SDK library version
|
|
3
3
|
*/
|
|
4
|
-
export declare const LIBRARY_VERSION = "16.
|
|
4
|
+
export declare const LIBRARY_VERSION = "16.3.0";
|
|
5
5
|
/**
|
|
6
6
|
* AdCP specification version this library is built for
|
|
7
7
|
*/
|
|
@@ -33,10 +33,10 @@ export type AdcpVersion = (typeof COMPATIBLE_ADCP_VERSIONS)[number];
|
|
|
33
33
|
* Full version information
|
|
34
34
|
*/
|
|
35
35
|
export declare const VERSION_INFO: {
|
|
36
|
-
readonly library: "16.
|
|
36
|
+
readonly library: "16.3.0";
|
|
37
37
|
readonly adcp: "3.2.5";
|
|
38
38
|
readonly compatibleVersions: readonly ["v3", "3.0.0", "3.0", "3.0.1", "3.0.2", "3.0.3", "3.0.4", "3.0.5", "3.0.6", "3.0.7", "3.0.8", "3.0.9", "3.0.10", "3.0.11", "3.0.12", "3.0.13", "3.0.14", "3.0.15", "3.0.16", "3.0.17", "3.0.18", "3.0.19", "3.0.20", "3.0.21", "3.0.22", "3.0.23", "3.0.24", "3.0.25", "3.1.0", "3.1", "3.1.1", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10", "3.1.11", "3.1.12", "3.1.13", "3.1.14", "3.1.15", "3.1.16", "3.1.17", "3.1.18", "3.1.19", "3.1.20", "3.1.21", "3.1.22", "3.1.23", "3.1.24", "3.1.25", "3.1.26", "3.1.27", "3.1.28", "3.1.29", "3.2.1", "3.2", "3.2.2", "3.2.3", "3.2.4", "3.2.5"];
|
|
39
|
-
readonly generatedAt: "2026-10-
|
|
39
|
+
readonly generatedAt: "2026-10-22T14:25:22.608Z";
|
|
40
40
|
};
|
|
41
41
|
/**
|
|
42
42
|
* Get the AdCP specification version this library is built for
|
package/dist/lib/version.js
CHANGED
|
@@ -31,7 +31,7 @@ __export(version_exports, {
|
|
|
31
31
|
toReleasePrecisionVersion: () => toReleasePrecisionVersion
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(version_exports);
|
|
34
|
-
const LIBRARY_VERSION = "16.
|
|
34
|
+
const LIBRARY_VERSION = "16.3.0";
|
|
35
35
|
const ADCP_VERSION = "3.2.5";
|
|
36
36
|
const ADCP_MAJOR_VERSION = 3;
|
|
37
37
|
const COMPATIBLE_ADCP_VERSIONS = [
|
|
@@ -102,10 +102,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
|
|
|
102
102
|
"3.2.5"
|
|
103
103
|
];
|
|
104
104
|
const VERSION_INFO = {
|
|
105
|
-
library: "16.
|
|
105
|
+
library: "16.3.0",
|
|
106
106
|
adcp: "3.2.5",
|
|
107
107
|
compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
|
|
108
|
-
generatedAt: "2026-10-
|
|
108
|
+
generatedAt: "2026-10-22T14:25:22.608Z"
|
|
109
109
|
};
|
|
110
110
|
function getAdcpVersion() {
|
|
111
111
|
return ADCP_VERSION;
|
package/dist/lib/version.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const LIBRARY_VERSION = "16.
|
|
1
|
+
const LIBRARY_VERSION = "16.3.0";
|
|
2
2
|
const ADCP_VERSION = "3.2.5";
|
|
3
3
|
const ADCP_MAJOR_VERSION = 3;
|
|
4
4
|
const COMPATIBLE_ADCP_VERSIONS = [
|
|
@@ -69,10 +69,10 @@ const COMPATIBLE_ADCP_VERSIONS = [
|
|
|
69
69
|
"3.2.5"
|
|
70
70
|
];
|
|
71
71
|
const VERSION_INFO = {
|
|
72
|
-
library: "16.
|
|
72
|
+
library: "16.3.0",
|
|
73
73
|
adcp: "3.2.5",
|
|
74
74
|
compatibleVersions: COMPATIBLE_ADCP_VERSIONS,
|
|
75
|
-
generatedAt: "2026-10-
|
|
75
|
+
generatedAt: "2026-10-22T14:25:22.608Z"
|
|
76
76
|
};
|
|
77
77
|
function getAdcpVersion() {
|
|
78
78
|
return ADCP_VERSION;
|
package/docs/TYPE-SUMMARY.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# AdCP Type Summary
|
|
2
2
|
|
|
3
3
|
> Generated at: 2026-10-22
|
|
4
|
-
> @adcp/sdk v16.
|
|
4
|
+
> @adcp/sdk v16.3.0
|
|
5
5
|
|
|
6
6
|
Curated reference of the types that matter for using the AdCP client. For full generated types see `src/lib/types/tools.generated.ts` and `src/lib/types/core.generated.ts`.
|
|
7
7
|
|