@instruments/materialgraph 0.45.0 → 1.0.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/association-types.d.ts +2 -2
- package/brand-types.d.ts +3 -3
- package/brands-client.d.ts +3 -3
- package/brands-client.js +3 -3
- package/{catalogue-client.d.ts → catalog-client.d.ts} +13 -13
- package/{catalogue-client.js → catalog-client.js} +13 -13
- package/{catalogue-types.d.ts → catalog-types.d.ts} +42 -42
- package/client-config.d.ts +7 -0
- package/client-response-schema.js +1 -1
- package/client-vocabulary.js +1 -1
- package/client.d.ts +13 -12
- package/client.js +19 -14
- package/color-profiles-types.d.ts +1 -1
- package/colors-client.d.ts +6 -6
- package/colors-client.js +3 -3
- package/errors.d.ts +2 -0
- package/errors.js +21 -3
- package/find-sampled-together-types.d.ts +2 -2
- package/find-variants-by-color-types.d.ts +6 -6
- package/find-variants-by-vector-types.d.ts +12 -11
- package/get-variant-types.d.ts +26 -0
- package/http-transport.d.ts +2 -0
- package/http-transport.js +17 -3
- package/identifiers.d.ts +1 -1
- package/image-reference-types.d.ts +2 -2
- package/index.d.ts +5 -5
- package/list-variant-facets-types.d.ts +2 -2
- package/list-variants-types.d.ts +14 -5
- package/material-asset-types.d.ts +1 -1
- package/operation-responses.d.ts +8 -8
- package/operations.generated.d.ts +1 -1
- package/operations.generated.js +14 -14
- package/package.json +2 -2
- package/resolve-color-types.d.ts +13 -13
- package/resolve-variant-types.d.ts +1 -1
- package/response-schemas.generated.d.ts +2 -2
- package/response-schemas.generated.js +43 -42
- package/response-schemas.js +20 -20
- package/runs.js +1 -1
- package/{samplize-catalogue-types.d.ts → samplize-catalog-types.d.ts} +5 -5
- package/samplize-colorvec.d.ts +1 -1
- package/samplize-colorvec.js +2 -2
- package/{search-catalogue-subset-types.d.ts → search-catalog-subset-types.d.ts} +5 -5
- package/search-variants-types.d.ts +4 -4
- package/types.d.ts +6 -6
- package/webmcp.generated.js +4 -4
- /package/{catalogue-types.js → catalog-types.js} +0 -0
- /package/{samplize-catalogue-types.js → samplize-catalog-types.js} +0 -0
- /package/{search-catalogue-subset-types.js → search-catalog-subset-types.js} +0 -0
package/response-schemas.js
CHANGED
|
@@ -24,40 +24,40 @@
|
|
|
24
24
|
* `outputSchema`s, which describe what the API sends rather than what a
|
|
25
25
|
* consumer should tolerate.
|
|
26
26
|
*
|
|
27
|
-
* This is its own entry point because the
|
|
27
|
+
* This is its own entry point because the catalog is large; importing the
|
|
28
28
|
* client does not load it, and it is parsed on the first `responseSchema()`
|
|
29
29
|
* call rather than on import.
|
|
30
30
|
*/
|
|
31
31
|
import { MaterialGraphError } from "./errors.js";
|
|
32
|
-
import {
|
|
32
|
+
import { RESPONSE_SCHEMA_CATALOG_JSON } from "./response-schemas.generated.js";
|
|
33
33
|
export { RESPONSE_SCHEMA_API_VERSION, RESPONSE_SCHEMA_OPERATION_IDS, } from "./response-schemas.generated.js";
|
|
34
34
|
const JSON_SCHEMA_DIALECT = "https://json-schema.org/draft/2020-12/schema";
|
|
35
35
|
const DEFINITION_PREFIX = "#/$defs/";
|
|
36
36
|
const isJsonSchemaMap = (value) => typeof value === "object" &&
|
|
37
37
|
value !== null &&
|
|
38
38
|
Object.values(value).every((schema) => typeof schema === "object" && schema !== null && !Array.isArray(schema));
|
|
39
|
-
const
|
|
39
|
+
const isCatalog = (value) => typeof value === "object" &&
|
|
40
40
|
value !== null &&
|
|
41
41
|
"definitions" in value &&
|
|
42
42
|
isJsonSchemaMap(value.definitions) &&
|
|
43
43
|
"operations" in value &&
|
|
44
44
|
isJsonSchemaMap(value.operations);
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
if (
|
|
48
|
-
const parsed = JSON.parse(
|
|
49
|
-
if (!
|
|
50
|
-
throw MaterialGraphError.unexpected("The response schema
|
|
45
|
+
let parsedCatalog;
|
|
46
|
+
const loadCatalog = () => {
|
|
47
|
+
if (parsedCatalog === undefined) {
|
|
48
|
+
const parsed = JSON.parse(RESPONSE_SCHEMA_CATALOG_JSON);
|
|
49
|
+
if (!isCatalog(parsed)) {
|
|
50
|
+
throw MaterialGraphError.unexpected("The response schema catalog is malformed");
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
parsedCatalog = parsed;
|
|
53
53
|
}
|
|
54
|
-
return
|
|
54
|
+
return parsedCatalog;
|
|
55
55
|
};
|
|
56
56
|
/** Add every definition `value` reaches, transitively, to `into`. */
|
|
57
|
-
const collectReferences = (
|
|
57
|
+
const collectReferences = (catalog, value, into) => {
|
|
58
58
|
if (Array.isArray(value)) {
|
|
59
59
|
for (const item of value) {
|
|
60
|
-
collectReferences(
|
|
60
|
+
collectReferences(catalog, item, into);
|
|
61
61
|
}
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
@@ -74,11 +74,11 @@ const collectReferences = (catalogue, value, into) => {
|
|
|
74
74
|
.replaceAll("~0", "~");
|
|
75
75
|
if (!into.has(name)) {
|
|
76
76
|
into.add(name);
|
|
77
|
-
collectReferences(
|
|
77
|
+
collectReferences(catalog, catalog.definitions[name], into);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
|
-
collectReferences(
|
|
81
|
+
collectReferences(catalog, child, into);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
};
|
|
@@ -88,18 +88,18 @@ const collectReferences = (catalogue, value, into) => {
|
|
|
88
88
|
* that annotates or mutates it cannot change what the next caller gets.
|
|
89
89
|
*/
|
|
90
90
|
export const responseSchema = (operationId) => {
|
|
91
|
-
const
|
|
92
|
-
const root = Object.hasOwn(
|
|
93
|
-
?
|
|
91
|
+
const catalog = loadCatalog();
|
|
92
|
+
const root = Object.hasOwn(catalog.operations, operationId)
|
|
93
|
+
? catalog.operations[operationId]
|
|
94
94
|
: undefined;
|
|
95
95
|
if (root === undefined) {
|
|
96
96
|
throw MaterialGraphError.unexpected(`No response schema for operation: ${operationId}`);
|
|
97
97
|
}
|
|
98
98
|
const names = new Set();
|
|
99
|
-
collectReferences(
|
|
99
|
+
collectReferences(catalog, root, names);
|
|
100
100
|
const definitions = {};
|
|
101
101
|
for (const name of [...names].toSorted()) {
|
|
102
|
-
const definition =
|
|
102
|
+
const definition = catalog.definitions[name];
|
|
103
103
|
if (definition !== undefined) {
|
|
104
104
|
definitions[name] = definition;
|
|
105
105
|
}
|
package/runs.js
CHANGED
|
@@ -50,7 +50,7 @@ const runOperation = (operationId) => {
|
|
|
50
50
|
}
|
|
51
51
|
return { ...match, operationId };
|
|
52
52
|
};
|
|
53
|
-
/** Build a `Blob` from raw bytes,
|
|
53
|
+
/** Build a `Blob` from raw bytes, normalizing to an ArrayBuffer-backed view. */
|
|
54
54
|
const bytesToBlob = (input) => {
|
|
55
55
|
const type = input.contentType !== undefined && input.contentType !== ""
|
|
56
56
|
? { type: input.contentType }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type SamplizeCatalogOptions = {
|
|
2
2
|
limit?: number;
|
|
3
3
|
/** Continue with unchanged filters and sourceVersion; omit when filters change. */
|
|
4
4
|
after?: string;
|
|
@@ -7,7 +7,7 @@ export type SamplizeCatalogueOptions = {
|
|
|
7
7
|
/** Pin every subsequent page to the version returned by the first page. */
|
|
8
8
|
sourceVersion?: string;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type SamplizeCatalogProduct = {
|
|
11
11
|
variantId: string;
|
|
12
12
|
productId: string;
|
|
13
13
|
name: string;
|
|
@@ -48,15 +48,15 @@ export type SamplizeCatalogueProduct = {
|
|
|
48
48
|
publishedHexes: SamplizeHexObservation[];
|
|
49
49
|
hexObservations: SamplizeHexObservation[];
|
|
50
50
|
};
|
|
51
|
-
export type
|
|
51
|
+
export type SamplizeCatalogPage = {
|
|
52
52
|
schemaVersion: 2;
|
|
53
|
-
|
|
53
|
+
searchCatalogSubset: "samplizeCatalog";
|
|
54
54
|
sourceVersion: string;
|
|
55
55
|
source: Record<string, unknown>;
|
|
56
56
|
/** Number of eligible records matching the supplied filters. */
|
|
57
57
|
total: number;
|
|
58
58
|
unavailableFields: string[];
|
|
59
|
-
items:
|
|
59
|
+
items: SamplizeCatalogProduct[];
|
|
60
60
|
nextCursor: string | null;
|
|
61
61
|
/** True on the final page; completeness requires collecting total unique IDs. */
|
|
62
62
|
complete: boolean;
|
package/samplize-colorvec.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare const selectSamplizeEligiblePaints: <T extends Omit<SamplizeColor
|
|
|
50
50
|
/** Official portable MG ranking over its complete versioned sampling-channel projection. */
|
|
51
51
|
export declare const createSamplizeColorVecIndex: (cache: SamplizeColorVecCache) => {
|
|
52
52
|
search(input: SamplizeColorVecInput): {
|
|
53
|
-
countBasis: "complete-
|
|
53
|
+
countBasis: "complete-catalog";
|
|
54
54
|
counts: Record<"brand" | "family" | "intensity" | "lightness", Record<string, number>>;
|
|
55
55
|
dictionaryVersion: string;
|
|
56
56
|
eligibleCount: number;
|
package/samplize-colorvec.js
CHANGED
|
@@ -28,7 +28,7 @@ const findReferencePaint = (paints, input) => {
|
|
|
28
28
|
? paints.find((p) => p.variantId === input.reference)
|
|
29
29
|
: undefined;
|
|
30
30
|
if (input.reference !== undefined && input.reference !== "" && !reference) {
|
|
31
|
-
throw new Error("The reference is absent from this
|
|
31
|
+
throw new Error("The reference is absent from this catalog version.");
|
|
32
32
|
}
|
|
33
33
|
return reference;
|
|
34
34
|
};
|
|
@@ -160,7 +160,7 @@ const searchSamplizePaints = (cache, paints, input, vectorFor) => {
|
|
|
160
160
|
});
|
|
161
161
|
const ids = groups.flatMap((p) => p.ids);
|
|
162
162
|
return {
|
|
163
|
-
countBasis: "complete-
|
|
163
|
+
countBasis: "complete-catalog",
|
|
164
164
|
counts,
|
|
165
165
|
dictionaryVersion: cache.dictionaryVersion,
|
|
166
166
|
eligibleCount: eligible.length,
|
|
@@ -34,8 +34,8 @@ import type { OpenEnum } from "./types.js";
|
|
|
34
34
|
* `"materialBankEuOrderable"` (Material Bank Europe) and
|
|
35
35
|
* `"designShopOrderable"` (DesignShop, with the products DesignShop hides from
|
|
36
36
|
* browse excluded).
|
|
37
|
-
* `"
|
|
38
|
-
* Bank North America and governed
|
|
37
|
+
* `"materialBankNaAndCatalog"` is a single producer-side union of Material
|
|
38
|
+
* Bank North America and governed Catalog channel membership.
|
|
39
39
|
*
|
|
40
40
|
* `"materialBankOrderable"` is NOT one of them, despite the name. It selects
|
|
41
41
|
* materials carrying a Material Bank identity — PROVENANCE, not a storefront —
|
|
@@ -43,15 +43,15 @@ import type { OpenEnum } from "./types.js";
|
|
|
43
43
|
* that were never in the Material Bank feed; if you mean orderable, use one of
|
|
44
44
|
* the channel-backed scopes above.
|
|
45
45
|
*/
|
|
46
|
-
export type
|
|
46
|
+
export type SearchCatalogSubset = OpenEnum<"samplizeCatalog" | "all" | "designShopOrderable" | "materialBankEuOrderable" | "materialBankNaAndCatalog" | "materialBankNaOrderable" | "materialBankOrderable">;
|
|
47
47
|
/**
|
|
48
48
|
* The corpus a response AND its counts were drawn from. Present only when a
|
|
49
49
|
* narrowing scope applied — absence means the whole graph. Read it alongside
|
|
50
50
|
* the counts: a short page under a scope is a small SCOPED corpus, never a
|
|
51
51
|
* truncated one.
|
|
52
52
|
*/
|
|
53
|
-
export type
|
|
54
|
-
scope:
|
|
53
|
+
export type SearchCatalogSubsetReceipt = {
|
|
54
|
+
scope: SearchCatalogSubset;
|
|
55
55
|
/** What the scope admits, in one sentence, for a human reader. */
|
|
56
56
|
description: string;
|
|
57
57
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* `contract-parity.test.ts` keeps them honest.
|
|
9
9
|
*/
|
|
10
10
|
import type { ColorRangeCondition, FilterGroups, ListVariantsInclude, ListVariantsOutput, OptionalFilterGroups } from "./list-variants-types.js";
|
|
11
|
-
import type {
|
|
11
|
+
import type { SearchCatalogSubset } from "./search-catalog-subset-types.js";
|
|
12
12
|
/** Switches one of a previous answer's `choices`: its `handle`, and the `group` and `id` of the alternative to read it as. */
|
|
13
13
|
export type SearchVariantsSelection = {
|
|
14
14
|
group: string;
|
|
@@ -29,7 +29,7 @@ export type SearchVariantsInput = {
|
|
|
29
29
|
/** What to find, in plain words. 1–200 characters. */
|
|
30
30
|
query: string;
|
|
31
31
|
/** Only this corpus scope. Absent or all: every variant. */
|
|
32
|
-
|
|
32
|
+
searchCatalogSubset?: SearchCatalogSubset;
|
|
33
33
|
/** Up to eight choices to switch, from the previous answer's `choices`. */
|
|
34
34
|
selections?: SearchVariantsSelection[];
|
|
35
35
|
};
|
|
@@ -69,7 +69,7 @@ export type SearchVariantsOutput = ListVariantsOutput & {
|
|
|
69
69
|
choices?: SearchVariantsChoice[];
|
|
70
70
|
/** The measured-color regions that ran. */
|
|
71
71
|
colors?: ColorRangeCondition[];
|
|
72
|
-
/** Words corrected to
|
|
72
|
+
/** Words corrected to catalog spellings. */
|
|
73
73
|
corrections?: {
|
|
74
74
|
correction: string;
|
|
75
75
|
word: string;
|
|
@@ -83,7 +83,7 @@ export type SearchVariantsOutput = ListVariantsOutput & {
|
|
|
83
83
|
/** The `listVariants()` preferences that ran. */
|
|
84
84
|
optionalFilters?: OptionalFilterGroups;
|
|
85
85
|
/** How the search ended. `partial_match`: no variant met every condition together, so those read from words (never a category, brand or number) rank instead of filtering; `understood` says which. */
|
|
86
|
-
outcome: "page" | "partial_match" | "no_match" | "nothing_understood" | "out_of_scope" | "
|
|
86
|
+
outcome: "page" | "partial_match" | "no_match" | "nothing_understood" | "out_of_scope" | "brand_not_in_catalog";
|
|
87
87
|
/** The fixed search scope, also present in `filters`. */
|
|
88
88
|
scope?: FilterGroups;
|
|
89
89
|
/** One entry per phrase the parser read, in the parser's order. */
|
package/types.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ import type { MaterialTile } from "./material-types.js";
|
|
|
25
25
|
* 3. **A page is not a corpus.** A list is this page. Follow the cursor for
|
|
26
26
|
* the rest, and never report a page size as a total.
|
|
27
27
|
*/
|
|
28
|
-
import type {
|
|
28
|
+
import type { SearchCatalogSubset } from "./search-catalog-subset-types.js";
|
|
29
29
|
export type OpenEnum<T extends string> = T | (string & Record<never, never>);
|
|
30
30
|
export type { JsonValue } from "./json-value-types.js";
|
|
31
31
|
/** OKLab triple. */
|
|
@@ -65,7 +65,7 @@ export type ProjectTypeShare = {
|
|
|
65
65
|
projectCount: number;
|
|
66
66
|
};
|
|
67
67
|
/**
|
|
68
|
-
* A pairing item from the
|
|
68
|
+
* A pairing item from the behavioral arm — real order evidence, or board
|
|
69
69
|
* curation when this seed has no order edges.
|
|
70
70
|
*
|
|
71
71
|
* WHAT YOU MAY CLAIM, per `source`:
|
|
@@ -84,7 +84,7 @@ export type CospecPairing = {
|
|
|
84
84
|
/** The evidence tier. `cospec` = orders; `considered` = boards. Read it before phrasing. */
|
|
85
85
|
source: "cospec" | "considered";
|
|
86
86
|
/**
|
|
87
|
-
* Membership of the requested `
|
|
87
|
+
* Membership of the requested `searchCatalogSubset`: true in, false out, null when
|
|
88
88
|
* the graph cannot say. Absent when no narrowing scope was asked for. It
|
|
89
89
|
* flags, it never removes (MG-2292).
|
|
90
90
|
*/
|
|
@@ -135,7 +135,7 @@ export type ColorPairing = {
|
|
|
135
135
|
source: "color";
|
|
136
136
|
score: number;
|
|
137
137
|
/**
|
|
138
|
-
* Membership of the requested `
|
|
138
|
+
* Membership of the requested `searchCatalogSubset`: true in, false out, null when
|
|
139
139
|
* the graph cannot say. Absent when no narrowing scope was asked for. It
|
|
140
140
|
* flags, it never removes (MG-2292).
|
|
141
141
|
*/
|
|
@@ -249,7 +249,7 @@ export type ListAttributesResult = {
|
|
|
249
249
|
};
|
|
250
250
|
};
|
|
251
251
|
export type { ResolveValueCandidate, ValueResolution, } from "./catalog-discovery-types.js";
|
|
252
|
-
export type { ResolveColorOptions,
|
|
252
|
+
export type { ResolveColorOptions, ResolveColorCatalogVariant, ResolveColorVariant, ResolveColorResponse, } from "./resolve-color-types.js";
|
|
253
253
|
export type { BySpecVerdictState, BySpecVerdictCell, BySpecVerdict, MaterialVerdict, BySpecUnresolvedCriterion, } from "./by-spec-types.js";
|
|
254
254
|
export type WhoamiResponse = {
|
|
255
255
|
principal: string;
|
|
@@ -266,7 +266,7 @@ export type PairingsOptions = {
|
|
|
266
266
|
/** Graph-owned order applied within fixed cospec → considered → color tiers. */
|
|
267
267
|
order?: PairingOrderMode;
|
|
268
268
|
/** Flags each item's `inScope` against this scope; never narrows the rail. */
|
|
269
|
-
|
|
269
|
+
searchCatalogSubset?: SearchCatalogSubset;
|
|
270
270
|
/** The previous response's `nextCursor`, passed back verbatim. */
|
|
271
271
|
cursor?: Cursor;
|
|
272
272
|
};
|
package/webmcp.generated.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const json = [
|
|
2
|
-
"[{\"annotations\":{\"readOnlyHint\":true,\"untrustedContentHint\":true},\"description\":\"Reads `query` into filters, runs them through `list_variants` and answers with what was understood beside a page of variants. `understood` says what each phrase became: a hard `filter`, a ranking `preference`, or `not_applied` when nothing could serve it. `filters`, `optionalFilters` and `name` are exactly what ran, so the three can be sent to `list_variants` to narrow or widen the same search. A phrase with more than one meaning is answered with one and listed in `choices`: send its `handle` with an alternative's `group` and `id` in `selections` to switch it. `unresolved` lists words nothing in the vocabulary could read. A query that applies nothing returns no items, never the whole
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"\"
|
|
2
|
+
"[{\"annotations\":{\"readOnlyHint\":true,\"untrustedContentHint\":true},\"description\":\"Reads `query` into filters, runs them through `list_variants` and answers with what was understood beside a page of variants. `understood` says what each phrase became: a hard `filter`, a ranking `preference`, or `not_applied` when nothing could serve it. `filters`, `optionalFilters` and `name` are exactly what ran, so the three can be sent to `list_variants` to narrow or widen the same search. A phrase with more than one meaning is answered with one and listed in `choices`: send its `handle` with an alternative's `group` and `id` in `selections` to switch it. `unresolved` lists words nothing in the vocabulary could read. A query that applies nothing returns no items, never the whole catalog; a preference alone still ranks it. `cursor` is the previous page's `pageInfo.endCursor`, tied to the vocabulary version the query was read against; it pages this operation only, not `list_variants`. Requires the `mg:read` bearer scope.\",\"inputSchema\":{\"$ref\":\"#/$defs/schema0\",\"$defs\":{\"schema0\":{\"type\":\"object\",\"properties\":{\"attributes\":{\"description\":\"Attribute/block ids to add; id fields always return.\",\"maxItems\":50,\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"cursor\":{\"type\":\"string\"},\"leaveOut\":{\"maxItems\":8,\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"limit\":{\"description\":\"5-10 for examples.\",\"type\":\"integer\",\"minimum\":1,\"maximum\":50},\"query\":{\"type\":\"string\",\"minLength\":1,\"maxLength\":200,\"description\":\"What to find, in plain words.\"},\"selections\":{\"description\":\"Switch a choice: handle, alternative group and id.\",\"maxItems\":8,\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"group\":{\"type\":\"string\"},\"handle\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"}},\"required\":[\"group\",\"handle\",\"id\"],\"additionalProperties\":false}},\"searchCatalogSubset\":{\"description\":\"Only this corpus scope. Absent or all: every variant.\",\"type\":\"string\",\"enum\":[\"all\",\"samplizeCatalog\",\"materialBankOrderable\",\"materialBankNaOrderable\",\"materialBankNaAndCatalog\",\"materialBankEuOrderable\",\"designShopOrderable\"]},\"include\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"image\",\"url\"]}}},\"required\":[\"query\"],\"additionalProperties\":false}}},\"method\":\"POST\",\"name\":\"search\",\"operationId\":\"search_variants\",\"outputSchema\":{\"$ref\":\"#/$defs/schema0\",\"$defs\":{\"schema1\":{\"anyOf\":[{\"type\":\"string\"},{\"type\":\"number\"},{\"type\":\"boolean\"},{\"type\":\"null\"},{\"type\":\"array\",\"items\":{\"$ref\":\"#/$defs/schema1\"}},{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\"},\"additionalProperties\":{\"$ref\":\"#/$defs/schema1\"}}]},\"schema0\":{\"type\":\"object\",\"properties\":{\"excludedBySearchCatalogSubset\":{\"description\":\"Filtered variant ids outside the materials catalog.\",\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"items\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"category\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"],\"additionalProperties\":false},{\"type\":\"null\"}],\"description\":\"The first original source category, or null when unknown.\"},\"categories\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"],\"additionalProperties\":false},\"description\":\"All original source categories in source order.\"},\"productType\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"],\"additionalProperties\":false},{\"type\":\"null\"}],\"description\":\"The accepted primary specification type, or null for a color sample or unresolved subject.\"},\"sampleSubject\":{\"type\":\"string\",\"enum\":[\"material\",\"paint_color_sample\",\"unknown\",\"conflict\"]},\"colorOptionValueId\":{\"type\":[\"string\",\"null\"]},\"hasDeclaredColor\":{\"type\":\"boolean\",\"description\":\"True for a paint color card, paint line, primer or coating: the card is the brand's declared hex, never a photo.\"},\"code\":{\"description\":\"The brand's item code.\",\"type\":[\"string\",\"null\"]},\"hex\":{\"description\":\"The settled card color hex, or null when unknown. Paint cards show this color and never a ph",
|
|
3
|
+
"oto.\",\"type\":[\"string\",\"null\"]},\"image\":{\"anyOf\":[{\"type\":\"object\",\"properties\":{\"alt\":{\"type\":\"string\"},\"url\":{\"type\":\"string\"}},\"required\":[\"alt\",\"url\"],\"additionalProperties\":false},{\"type\":\"null\"}],\"description\":\"The settled material card image. Always null for paint color samples and paint/coating product types.\"},\"brand\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"],\"additionalProperties\":false,\"description\":\"The brand. `id` is the slug get_brand takes.\"},\"name\":{\"type\":\"string\",\"description\":\"The variant's own name.\"},\"product\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"}},\"required\":[\"id\",\"name\"],\"additionalProperties\":false},\"url\":{\"description\":\"The brand's page for it, or null when none is known.\",\"type\":[\"string\",\"null\"]},\"variantId\":{\"type\":\"string\"},\"materialBankId\":{\"description\":\"The variant's Material Bank SKU. Absent: none recorded.\",\"type\":\"string\"},\"notApplicable\":{\"type\":\"object\",\"properties\":{\"attributes\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"blocks\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"additionalProperties\":false,\"description\":\"Requested blocks or attributes this product type does not carry.\"},\"preference\":{\"type\":\"object\",\"properties\":{\"matched\":{\"type\":\"array\",\"items\":{\"type\":\"number\"}},\"score\":{\"type\":\"number\"}},\"required\":[\"matched\",\"score\"],\"additionalProperties\":false},\"specifications\":{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\"},\"additionalProperties\":{\"type\":\"object\",\"propertyNames\":{\"type\":\"string\"},\"additionalProperties\":{\"$ref\":\"#/$defs/schema1\"}}},\"variantCount\":{\"description\":\"Eligible variants of this product. Absent: none counted.\",\"type\":\"integer\",\"exclusiveMinimum\":0,\"maximum\":9007199254740991}},\"required\":[\"category\",\"categories\",\"productType\",\"sampleSubject\",\"colorOptionValueId\",\"hasDeclaredColor\",\"code\",\"brand\",\"name\",\"product\",\"variantId\"],\"additionalProperties\":false}},\"nameWords\":{\"description\":\"Empty name lookup: each word, and whether a name in scope starts it. Unmatched words were left out unless all or none matched.\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"matched\":{\"type\":\"boolean\"},\"word\":{\"type\":\"string\"}},\"required\":[\"matched\",\"word\"],\"additionalProperties\":false}},\"pageInfo\":{\"type\":\"object\",\"properties\":{\"endCursor\":{\"type\":[\"string\",\"null\"]},\"hasNextPage\":{\"type\":\"boolean\"}},\"required\":[\"endCursor\",\"hasNextPage\"],\"additionalProperties\":false},\"preferenceMatchesRemain\":{\"description\":\"False: nothing from this page on meets any optionalFilter.\",\"type\":\"boolean\"},\"unavailableVariantIds\":{\"description\":\"Filtered ids in the catalog this list can't show, e.g. retired.\",\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"unresolvedVariantIds\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"unstated\":{\"description\":\"Filtered attributes no variant in scope states at all.\",\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"words\":{\"description\":\"Each word asked for, and whether any variant in scope names it.\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"matched\":{\"type\":\"boolean\"},\"word\":{\"type\":\"string\"}},\"required\":[\"matched\",\"word\"],\"additionalProperties\":false}},\"choices\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"alternatives\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"group\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"kind\":{\"type\":\"string\"},\"label\":{\"type\":\"string\"}},\"required\":[\"group\",\"id\",\"kind\",\"label\"],\"additionalProperties\":false}},\"basis\":{\"type\":\"string\"},\"handle\":{\"type\":\"string\"},\"reason\":{\"type\":\"string\"},\"selected\":{\"type\":\"object\",\"properties\":{\"group\":{\"type\":\"string\"},\"id\":{\"type\":\"string\"},\"kind\":{\"type\":\"string\"},\"label\":{\"type\":\"string\"}},\"required\":[\"group\",\"id\",\"kind\",\"label\"],\"additionalProperties\":false},\"text\":{\"type\":\"string\"}},\"required\":[\"alternatives\",\"basis\",\"handle\",\"reason\",\"selected\",\"text\"],\"additionalProperties\":false}},\"colors\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"hex\":{\"type\":\"string\",\"pattern\":\"^#[\\\\da-f]{6}$\",\"description\":\"The color's own point in the region; it orders matc",
|
|
4
|
+
"hes.\"},\"intent\":{\"type\":\"string\",\"enum\":[\"required\",\"preferred\"]},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"not_in\"]},\"range\":{\"type\":\"object\",\"properties\":{\"chroma\":{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\"},{\"type\":\"number\"}],\"items\":false,\"minItems\":2,\"maxItems\":2},\"hue\":{\"anyOf\":[{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\"},{\"type\":\"number\"}],\"items\":false,\"minItems\":2,\"maxItems\":2},{\"type\":\"null\"}]},\"lightness\":{\"type\":\"array\",\"prefixItems\":[{\"type\":\"number\"},{\"type\":\"number\"}],\"items\":false,\"minItems\":2,\"maxItems\":2}},\"required\":[\"chroma\",\"hue\",\"lightness\"],\"additionalProperties\":false}},\"required\":[\"hex\",\"op\",\"range\"],\"additionalProperties\":false},\"description\":\"The color regions that ran.\"},\"corrections\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"correction\":{\"type\":\"string\"},\"word\":{\"type\":\"string\"}},\"required\":[\"correction\",\"word\"],\"additionalProperties\":false}},\"filters\":{\"type\":\"object\",\"properties\":{\"anyField\":{\"description\":\"One of values in any of fields (term attributes).\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"fields\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"unstated\":{\"type\":\"string\",\"const\":\"pass\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"fields\",\"op\",\"values\"],\"additionalProperties\":false}},\"numbers\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"eq\",\"gt\",\"gte\",\"lt\",\"lte\"]},\"value\":{\"type\":\"number\"}},\"required\":[\"field\",\"op\",\"value\"],\"additionalProperties\":false}},\"presence\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"exists\",\"missing\"]}},\"required\":[\"field\",\"op\"],\"additionalProperties\":false}},\"terms\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"all\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"unstated\":{\"type\":\"string\",\"const\":\"pass\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"field\",\"op\",\"values\"],\"additionalProperties\":false}}},\"additionalProperties\":false,\"description\":\"The filters that ran, the scope among them.\"},\"name\":{\"type\":\"string\",\"description\":\"The paint name looked up.\"},\"oneRowPer\":{\"type\":\"string\",\"enum\":[\"product\",\"variant\",\"paint_variant_or_product\"],\"description\":\"A row per product, per variant, or per exact paint variant followed by other products.\"},\"optionalFilters\":{\"type\":\"object\",\"properties\":{\"anyField\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"fields\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"weight\":{\"type\":\"integer\",\"minimum\":1,\"maximum\":10}},\"required\":[\"fields\",\"op\",\"values\",\"weight\"],\"additionalProperties\":false}},\"numbers\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"eq\",\"gt\",\"gte\",\"lt\",\"lte\"]},\"value\":{\"type\":\"number\"},\"weight\":{\"type\":\"integer\",\"minimum\":1,\"maximum\":10}},\"required\":[\"field\",\"op\",\"value\",\"weight\"],\"additionalProperties\":false}},\"presence\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"exists\",\"missing\"]},\"weight\":{\"type\":\"integer\",\"minimum\":1,\"maximum\":10}},\"required\":[\"field\",\"op\",\"weight\"],\"additionalProperties\":false}},\"terms\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"all\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"weight\":{\"type\":\"integer\",\"minimum\":1,\"maximum\":10}},\"required\":[\"field\",\"op\",\"values\",\"weight\"],\"additionalProperties\":false}}},\"additionalProperties\":false,\"description\":\"The preferences that ran.\"},\"outcome\":{\"type\":\"string\",\"enum\":[\"page\",\"partial_match\",\"no_match\",\"nothing_understood\",\"out_of_scope\",\"brand_not_in_catalog\"],\"description\":\"How the search ended.\"},\"scope\":{\"type\":\"object\",\"proper",
|
|
5
|
+
"ties\":{\"anyField\":{\"description\":\"One of values in any of fields (term attributes).\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"fields\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"unstated\":{\"type\":\"string\",\"const\":\"pass\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"fields\",\"op\",\"values\"],\"additionalProperties\":false}},\"numbers\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"eq\",\"gt\",\"gte\",\"lt\",\"lte\"]},\"value\":{\"type\":\"number\"}},\"required\":[\"field\",\"op\",\"value\"],\"additionalProperties\":false}},\"presence\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"exists\",\"missing\"]}},\"required\":[\"field\",\"op\"],\"additionalProperties\":false}},\"terms\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"field\":{\"type\":\"string\"},\"op\":{\"type\":\"string\",\"enum\":[\"in\",\"all\",\"not_in\"]},\"orText\":{\"type\":\"string\"},\"unstated\":{\"type\":\"string\",\"const\":\"pass\"},\"values\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"field\",\"op\",\"values\"],\"additionalProperties\":false}}},\"additionalProperties\":false,\"description\":\"The fixed scope, repeated in filters.\"},\"understood\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"applied\":{\"type\":\"string\",\"enum\":[\"filter\",\"preference\",\"not_applied\"],\"description\":\"filter narrows; preference only ranks; not_applied did neither.\"},\"id\":{\"type\":\"string\",\"description\":\"The parser's condition id.\"},\"kind\":{\"type\":\"string\",\"enum\":[\"category\",\"brand\",\"term\",\"number\",\"color\",\"paint\",\"name\"]},\"label\":{\"type\":\"string\",\"description\":\"What the words were read as.\"},\"note\":{\"type\":\"string\"},\"text\":{\"type\":\"string\",\"description\":\"The query words it came from.\"}},\"required\":[\"applied\",\"id\",\"kind\",\"label\",\"text\"],\"additionalProperties\":false}},\"unresolved\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"required\":[\"items\",\"pageInfo\",\"oneRowPer\",\"outcome\",\"understood\"],\"additionalProperties\":false}}},\"path\":\"/api/v1/variants/search\",\"requiredHeaders\":[],\"requiresVisibleConfirmation\":false}]",
|
|
6
6
|
].join("");
|
|
7
7
|
export const WEBMCP_TOOLS = JSON.parse(json);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|