@instruments/materialgraph 0.25.0 → 0.26.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 +20 -20
- package/associations-client.d.ts +4 -4
- package/associations-client.js +3 -10
- package/attribution-types.d.ts +3 -3
- package/brand-most-sampled-types.d.ts +4 -4
- package/brand-types.d.ts +6 -6
- package/brands-client.d.ts +4 -4
- package/brands-client.js +9 -13
- package/browse-types.d.ts +8 -8
- package/by-colour-types.d.ts +18 -18
- package/by-spec-types.d.ts +14 -14
- package/catalog-discovery-types.d.ts +14 -14
- package/catalogue-client.d.ts +4 -4
- package/catalogue-client.js +38 -37
- package/catalogue-types.d.ts +4 -4
- package/citation-types.d.ts +4 -4
- package/client-browse.d.ts +4 -4
- package/client-browse.js +24 -25
- package/client-config.d.ts +2 -2
- package/client-exploration.d.ts +3 -3
- package/client-exploration.js +4 -6
- package/client-source-material-comments.d.ts +4 -4
- package/client-source-material-comments.js +4 -38
- package/client-vocabulary.d.ts +8 -8
- package/client-vocabulary.js +20 -30
- package/client.d.ts +11 -45
- package/client.js +143 -188
- package/codes-client.d.ts +2 -2
- package/codes-client.js +8 -8
- package/codes-types.d.ts +34 -34
- package/colour-aggregate-types.d.ts +24 -24
- package/colours-client.d.ts +2 -2
- package/colours-client.js +15 -15
- package/compare-types.d.ts +10 -10
- package/composition-client.d.ts +3 -3
- package/composition-client.js +8 -7
- package/composition-types.d.ts +12 -12
- package/coordinate-client.d.ts +2 -2
- package/coordinate-client.js +1 -13
- package/corpus-scope-types.d.ts +3 -3
- package/corpus-scope-types.js +1 -25
- package/correction-types.d.ts +10 -10
- package/demand-batch-types.d.ts +18 -18
- package/demand-types.d.ts +24 -24
- package/errors.d.ts +12 -12
- package/errors.js +53 -52
- package/exploration-types.d.ts +22 -22
- package/fan-deck-types.d.ts +6 -6
- package/http-transport.d.ts +13 -21
- package/http-transport.js +31 -28
- package/identify-types.d.ts +10 -10
- package/index.d.ts +0 -6
- package/index.js +0 -2
- package/match-rejection-types.d.ts +6 -6
- package/match-stream-types.d.ts +32 -32
- package/match-stream.d.ts +2 -2
- package/match-stream.js +55 -41
- package/match-types.d.ts +8 -8
- package/material-asset-types.d.ts +26 -26
- package/material-block-types.d.ts +6 -6
- package/material-query-plan-types.d.ts +26 -26
- package/material-resources-client.d.ts +5 -5
- package/material-resources-client.js +10 -20
- package/material-types.d.ts +12 -12
- package/ndjson.js +16 -8
- package/operations.d.ts +6 -6
- package/operations.js +9 -39
- package/package.json +1 -1
- package/palette-completion-types.d.ts +22 -22
- package/palette-search-types.d.ts +28 -28
- package/query-understanding-types.d.ts +38 -35
- package/render-assets-types.d.ts +8 -8
- package/resolve-client.d.ts +2 -2
- package/resolve-client.js +4 -6
- package/resolve-colour-types.d.ts +8 -8
- package/resolve-types.d.ts +10 -10
- package/run-types.d.ts +70 -70
- package/runs.d.ts +13 -26
- package/runs.js +77 -89
- package/samplize-catalogue-types.d.ts +18 -18
- package/samplize-colorvec.d.ts +20 -20
- package/samplize-colorvec.js +66 -42
- package/schema-resource-types.d.ts +38 -38
- package/schema-resource-types.js +5 -5
- package/search-card-types.d.ts +4 -4
- package/search-collapse-types.d.ts +4 -4
- package/search-mood-types.d.ts +2 -2
- package/search-refinement-types.d.ts +8 -8
- package/search-request-types.d.ts +5 -5
- package/search-response-receipt-types.d.ts +58 -42
- package/search-response-types.d.ts +2 -2
- package/search-result-validation.d.ts +3 -3
- package/search-result-validation.js +53 -36
- package/search-window-types.d.ts +2 -2
- package/slot-pool-types.d.ts +20 -20
- package/source-material-validation.d.ts +3 -3
- package/source-material-validation.js +35 -39
- package/spec-facet-types.d.ts +10 -10
- package/spec-types.d.ts +6 -6
- package/specifications.d.ts +9 -25
- package/specifications.js +15 -21
- package/sse.d.ts +2 -2
- package/sse.js +32 -16
- package/substitute-types.d.ts +22 -22
- package/suggest-types.d.ts +7 -7
- package/suggest-types.js +3 -3
- package/taxonomy-coverage-types.d.ts +8 -8
- package/types.d.ts +119 -119
- package/validation.d.ts +26 -26
- package/validation.js +97 -92
- package/webmcp.d.ts +2 -2
- package/webmcp.generated.js +94 -93
- package/project-types.d.ts +0 -79
- package/project-types.js +0 -9
- package/projects.d.ts +0 -13
- package/projects.js +0 -46
- package/run-events.d.ts +0 -106
- package/run-events.js +0 -32
- package/schedule-reference-types.d.ts +0 -46
- package/schedule-reference-types.js +0 -1
- package/schedule-references-client.d.ts +0 -14
- package/schedule-references-client.js +0 -26
- package/schedule-types.d.ts +0 -261
- package/schedule-types.js +0 -1
|
@@ -17,7 +17,7 @@ import type { OklabTriple, OpenEnum } from "./types.js";
|
|
|
17
17
|
/** How the per-colour scores are combined across a palette. */
|
|
18
18
|
export type PaletteLogic = OpenEnum<"all" | "any">;
|
|
19
19
|
/** One queried palette colour — exactly one of `hex` or `oklab`. */
|
|
20
|
-
export
|
|
20
|
+
export type PaletteQueryColour = {
|
|
21
21
|
hex?: string;
|
|
22
22
|
oklab?: OklabTriple;
|
|
23
23
|
/**
|
|
@@ -28,13 +28,13 @@ export interface PaletteQueryColour {
|
|
|
28
28
|
proportion?: number;
|
|
29
29
|
/** Relative importance; defaults to 1 and is normalised across the query. */
|
|
30
30
|
weight?: number;
|
|
31
|
-
}
|
|
31
|
+
};
|
|
32
32
|
/** One gradient stop — exactly one of `hex` or `oklab`. Order is meaningful. */
|
|
33
|
-
export
|
|
33
|
+
export type GradientStop = {
|
|
34
34
|
hex?: string;
|
|
35
35
|
oklab?: OklabTriple;
|
|
36
|
-
}
|
|
37
|
-
export
|
|
36
|
+
};
|
|
37
|
+
export type SearchPaletteInput = {
|
|
38
38
|
corpusScope?: CorpusScope;
|
|
39
39
|
/** The palette to match, 1–8 colours. */
|
|
40
40
|
colours: PaletteQueryColour[];
|
|
@@ -46,26 +46,26 @@ export interface SearchPaletteInput {
|
|
|
46
46
|
logic?: PaletteLogic;
|
|
47
47
|
/** Results to return; defaults to 24, capped at 48. */
|
|
48
48
|
limit?: number;
|
|
49
|
-
}
|
|
50
|
-
export
|
|
49
|
+
};
|
|
50
|
+
export type SearchGradientInput = {
|
|
51
51
|
corpusScope?: CorpusScope;
|
|
52
52
|
/** The ordered colour transition, 2–6 stops. */
|
|
53
53
|
stops: GradientStop[];
|
|
54
54
|
/** Results to return; defaults to 24, capped at 48. */
|
|
55
55
|
limit?: number;
|
|
56
|
-
}
|
|
56
|
+
};
|
|
57
57
|
/**
|
|
58
58
|
* One swatch used for scoring. Samplize paint uses its selected published hex;
|
|
59
59
|
* other materials use colorscope palettes extracted from imagery. `name` is null when no human
|
|
60
60
|
* name was resolved — unnamed, not colourless.
|
|
61
61
|
*/
|
|
62
|
-
export
|
|
62
|
+
export type CandidateSwatch = {
|
|
63
63
|
hex: string;
|
|
64
64
|
proportion: number;
|
|
65
65
|
name: string | null;
|
|
66
|
-
}
|
|
66
|
+
};
|
|
67
67
|
/** Why a queried colour (or gradient sample) scored what it scored. */
|
|
68
|
-
export
|
|
68
|
+
export type ColourMatchReceipt = {
|
|
69
69
|
queryHex: string;
|
|
70
70
|
/** `colourScore × proportionScore` for the best-matching swatch. */
|
|
71
71
|
score: number;
|
|
@@ -75,9 +75,9 @@ export interface ColourMatchReceipt {
|
|
|
75
75
|
proportionScore: number;
|
|
76
76
|
/** The swatch that produced the score, or null when nothing matched. */
|
|
77
77
|
matched: CandidateSwatch | null;
|
|
78
|
-
}
|
|
78
|
+
};
|
|
79
79
|
/** Identity and evidence shared by both multi-colour match shapes. */
|
|
80
|
-
export
|
|
80
|
+
export type MultiColourMatchBase = {
|
|
81
81
|
/** Opaque — round-trip verbatim. */
|
|
82
82
|
variantId: VariantId;
|
|
83
83
|
brand: string;
|
|
@@ -105,12 +105,12 @@ export interface MultiColourMatchBase {
|
|
|
105
105
|
palette: CandidateSwatch[];
|
|
106
106
|
/** The aggregate match score in [0,1]; higher is closer. */
|
|
107
107
|
score: number;
|
|
108
|
-
}
|
|
109
|
-
export
|
|
108
|
+
};
|
|
109
|
+
export type PaletteMatch = {
|
|
110
110
|
/** One receipt per queried colour, in query order. */
|
|
111
111
|
colours: ColourMatchReceipt[];
|
|
112
|
-
}
|
|
113
|
-
export
|
|
112
|
+
} & MultiColourMatchBase;
|
|
113
|
+
export type GradientMatch = {
|
|
114
114
|
/**
|
|
115
115
|
* Distinct matched thirds of the path over 3. A material owning only one end
|
|
116
116
|
* of the transition caps out around 0.33 — coverage is what separates a real
|
|
@@ -119,7 +119,7 @@ export interface GradientMatch extends MultiColourMatchBase {
|
|
|
119
119
|
coverage: number;
|
|
120
120
|
/** One receipt per sampled point along the path, in path order. */
|
|
121
121
|
samples: ColourMatchReceipt[];
|
|
122
|
-
}
|
|
122
|
+
} & MultiColourMatchBase;
|
|
123
123
|
/**
|
|
124
124
|
* The hue-family ADMISSION gate the page was scored under: a candidate swatch
|
|
125
125
|
* may satisfy a query colour only if colorscope's `isHueCompatible` admits it
|
|
@@ -129,35 +129,35 @@ export interface GradientMatch extends MultiColourMatchBase {
|
|
|
129
129
|
* request knob); the receipt exists so a threshold change is visible on the
|
|
130
130
|
* wire.
|
|
131
131
|
*/
|
|
132
|
-
export
|
|
132
|
+
export type HueGateReceipt = {
|
|
133
133
|
/** Below this query chroma the colour is achromatic and any hue is admitted. */
|
|
134
134
|
achromaticQueryChroma: number;
|
|
135
135
|
/** A swatch must carry at least this share of the query colour's chroma. */
|
|
136
136
|
minChromaRatio: number;
|
|
137
137
|
/** Floor on the cosine agreement between the two hue vectors. */
|
|
138
138
|
minHueCosine: number;
|
|
139
|
-
}
|
|
139
|
+
};
|
|
140
140
|
/**
|
|
141
141
|
* A PAGE, NOT A CORPUS. `count` is `matches.length` under `limit` (24 default,
|
|
142
142
|
* 48 max) — this surface states no corpus total and has no cursor, so "N
|
|
143
143
|
* materials match this palette" is not a claim you can make from it.
|
|
144
144
|
*/
|
|
145
|
-
export
|
|
145
|
+
export type SearchPaletteResponse = {
|
|
146
146
|
corpusScope?: CorpusScopeReceipt;
|
|
147
147
|
/** The query as interpreted — check it before trusting a surprising order. */
|
|
148
148
|
query: {
|
|
149
149
|
/** Colours that actually ran after minor stated shares were omitted. */
|
|
150
|
-
colours:
|
|
150
|
+
colours: {
|
|
151
151
|
hex: string;
|
|
152
152
|
proportion?: number;
|
|
153
153
|
weight?: number;
|
|
154
|
-
}
|
|
154
|
+
}[];
|
|
155
155
|
/** Colours not searched because their stated share was below 5%. */
|
|
156
|
-
droppedColours:
|
|
156
|
+
droppedColours: {
|
|
157
157
|
hex: string;
|
|
158
158
|
proportion?: number;
|
|
159
159
|
weight?: number;
|
|
160
|
-
}
|
|
160
|
+
}[];
|
|
161
161
|
logic: PaletteLogic;
|
|
162
162
|
/** `no_effective_colours` means no material query ran. */
|
|
163
163
|
outcome: OpenEnum<"matches" | "no_effective_colours">;
|
|
@@ -167,9 +167,9 @@ export interface SearchPaletteResponse {
|
|
|
167
167
|
/** `matches.length`, capped by `limit`. Never a corpus total. */
|
|
168
168
|
count: number;
|
|
169
169
|
matches: PaletteMatch[];
|
|
170
|
-
}
|
|
170
|
+
};
|
|
171
171
|
/** A PAGE, NOT A CORPUS — see {@link SearchPaletteResponse}. */
|
|
172
|
-
export
|
|
172
|
+
export type SearchGradientResponse = {
|
|
173
173
|
corpusScope?: CorpusScopeReceipt;
|
|
174
174
|
query: {
|
|
175
175
|
stops: string[];
|
|
@@ -179,4 +179,4 @@ export interface SearchGradientResponse {
|
|
|
179
179
|
/** `matches.length`, capped by `limit`. Never a corpus total. */
|
|
180
180
|
count: number;
|
|
181
181
|
matches: GradientMatch[];
|
|
182
|
-
}
|
|
182
|
+
};
|
|
@@ -3,7 +3,7 @@ import type { ColorResolution } from "@instruments/colorscope/naming";
|
|
|
3
3
|
import type { SearchFilter } from "./search-refinement-types.js";
|
|
4
4
|
import type { OpenEnum } from "./types.js";
|
|
5
5
|
export type QuerySenseKind = OpenEnum<"brand" | "product" | "paint_identity" | "category" | "material" | "colour" | "attribute" | "attribute_value" | "certification">;
|
|
6
|
-
export
|
|
6
|
+
export type QuerySense = {
|
|
7
7
|
id: string;
|
|
8
8
|
kind: QuerySenseKind;
|
|
9
9
|
label: string;
|
|
@@ -28,14 +28,14 @@ export interface QuerySense {
|
|
|
28
28
|
hex?: string;
|
|
29
29
|
};
|
|
30
30
|
reason?: string;
|
|
31
|
-
}
|
|
32
|
-
export
|
|
31
|
+
};
|
|
32
|
+
export type CanonicalLexicalAuthorityReceipt = {
|
|
33
33
|
authority: OpenEnum<"taxonomy" | "colorscope">;
|
|
34
34
|
version: string;
|
|
35
35
|
revision: string;
|
|
36
36
|
digest?: string;
|
|
37
|
-
}
|
|
38
|
-
export
|
|
37
|
+
};
|
|
38
|
+
export type CanonicalLexicalReading = {
|
|
39
39
|
matchTarget?: MatchTarget;
|
|
40
40
|
colorResolution?: ColorResolution;
|
|
41
41
|
authority: OpenEnum<"taxonomy" | "colorscope">;
|
|
@@ -63,8 +63,8 @@ export interface CanonicalLexicalReading {
|
|
|
63
63
|
snapshot?: string;
|
|
64
64
|
source: string;
|
|
65
65
|
};
|
|
66
|
-
}
|
|
67
|
-
export
|
|
66
|
+
};
|
|
67
|
+
export type CanonicalLexicalMatch = {
|
|
68
68
|
original: string;
|
|
69
69
|
canonical: string;
|
|
70
70
|
rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
|
|
@@ -80,24 +80,24 @@ export interface CanonicalLexicalMatch {
|
|
|
80
80
|
rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
|
|
81
81
|
authorities: CanonicalLexicalAuthorityReceipt[];
|
|
82
82
|
};
|
|
83
|
-
}
|
|
84
|
-
export
|
|
83
|
+
};
|
|
84
|
+
export type CanonicalLexicalReceipt = {
|
|
85
85
|
original: string;
|
|
86
86
|
outcome: OpenEnum<"resolved" | "ambiguous" | "declined" | "partial" | "unresolved">;
|
|
87
87
|
matches: CanonicalLexicalMatch[];
|
|
88
88
|
unresolved: CanonicalLexicalMatch[];
|
|
89
|
-
}
|
|
90
|
-
export
|
|
89
|
+
};
|
|
90
|
+
export type QueryResidualReceipt = {
|
|
91
91
|
kind: OpenEnum<"compound" | "descriptive" | "ambiguous" | "empty">;
|
|
92
92
|
tokens: string[];
|
|
93
93
|
resolvedTokens: string[];
|
|
94
94
|
unresolvedTokens: string[];
|
|
95
95
|
resolvedRatio: number;
|
|
96
96
|
comparisonFrame: boolean;
|
|
97
|
-
}
|
|
97
|
+
};
|
|
98
98
|
/** Deterministic criteria compiled from the query before retrieval. */
|
|
99
|
-
export
|
|
100
|
-
applied:
|
|
99
|
+
export type QueryCriteriaReceipt = {
|
|
100
|
+
applied: {
|
|
101
101
|
criterion: SearchFilter;
|
|
102
102
|
lane: OpenEnum<"filter" | "preference">;
|
|
103
103
|
lexicalSignal?: {
|
|
@@ -114,30 +114,30 @@ export interface QueryCriteriaReceipt {
|
|
|
114
114
|
};
|
|
115
115
|
source: OpenEnum<"compiled" | "taxonomy-adapter">;
|
|
116
116
|
span: string;
|
|
117
|
-
}
|
|
118
|
-
conflicts:
|
|
117
|
+
}[];
|
|
118
|
+
conflicts: {
|
|
119
119
|
attributeId: string;
|
|
120
120
|
caller: SearchFilter;
|
|
121
121
|
compiled: SearchFilter;
|
|
122
122
|
reason: string;
|
|
123
|
-
}
|
|
124
|
-
exclusions:
|
|
123
|
+
}[];
|
|
124
|
+
exclusions: {
|
|
125
125
|
criterion: SearchFilter;
|
|
126
126
|
execution: OpenEnum<"blocked-positive-only-contract">;
|
|
127
127
|
lane: OpenEnum<"hard" | "soft">;
|
|
128
128
|
missingValuePolicy: OpenEnum<"retain-unknown">;
|
|
129
129
|
span: string;
|
|
130
|
-
}
|
|
130
|
+
}[];
|
|
131
131
|
preferences: SearchFilter[];
|
|
132
132
|
residualText: string | null;
|
|
133
|
-
unresolved:
|
|
133
|
+
unresolved: {
|
|
134
134
|
code: OpenEnum<"missing-searchable-attribute" | "missing-dimension-pair-contract" | "missing-explicit-comparator" | "negative-criterion-contract-blocked" | "registry-contract-drift" | "unsupported-numeric-format" | "unsupported-unit" | "unsupported-strict-comparator">;
|
|
135
135
|
reason: string;
|
|
136
136
|
span: string;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
137
|
+
}[];
|
|
138
|
+
};
|
|
139
139
|
/** How the query named or inferred a product type before retrieval. */
|
|
140
|
-
export
|
|
140
|
+
export type QueryProductTypeReceipt = {
|
|
141
141
|
kind: OpenEnum<"leaf" | "group" | "vector" | "ambiguous" | "none">;
|
|
142
142
|
gate: OpenEnum<"hard" | "constrain" | "none">;
|
|
143
143
|
pass: OpenEnum<"taxonomy" | "synonym" | "display-name" | "group" | "head-noun" | "vector" | "none">;
|
|
@@ -152,14 +152,14 @@ export interface QueryProductTypeReceipt {
|
|
|
152
152
|
vectorPassRan: boolean;
|
|
153
153
|
registryVersion: string;
|
|
154
154
|
durationMs: number;
|
|
155
|
-
candidates:
|
|
155
|
+
candidates: {
|
|
156
156
|
productTypeId: string;
|
|
157
157
|
displayName: string;
|
|
158
158
|
similarity: number;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
159
|
+
}[];
|
|
160
|
+
};
|
|
161
161
|
/** The selected retrieval arm; null when the path is browse or criteria-only. */
|
|
162
|
-
export
|
|
162
|
+
export type QueryArmReceipt = {
|
|
163
163
|
arm: OpenEnum<"dense" | "lexical" | "colour"> | null;
|
|
164
164
|
reason: string;
|
|
165
165
|
reasonDetail?: OpenEnum<"derived-colour-veto" | "typo-recovery" | "literal-compound-without-type">;
|
|
@@ -169,8 +169,8 @@ export interface QueryArmReceipt {
|
|
|
169
169
|
productTypeIds: string[];
|
|
170
170
|
residual: QueryResidualReceipt;
|
|
171
171
|
registryVersion: string;
|
|
172
|
-
}
|
|
173
|
-
export
|
|
172
|
+
};
|
|
173
|
+
export type QueryAmbiguityReceipt = {
|
|
174
174
|
outcome: OpenEnum<"applied" | "abstained" | "refused" | "timeout">;
|
|
175
175
|
modelId: string | null;
|
|
176
176
|
providerRan: boolean;
|
|
@@ -182,7 +182,7 @@ export interface QueryAmbiguityReceipt {
|
|
|
182
182
|
routing: OpenEnum<"compound" | "descriptive"> | null;
|
|
183
183
|
productTypeIds: string[];
|
|
184
184
|
changedArm: boolean;
|
|
185
|
-
}
|
|
185
|
+
};
|
|
186
186
|
export interface QueryCategoryScopeReceipt {
|
|
187
187
|
source: OpenEnum<"caller" | "anchor">;
|
|
188
188
|
mechanism: OpenEnum<"sql-predicate" | "provider-filter" | "allowlist" | "prune">;
|
|
@@ -191,15 +191,15 @@ export interface QueryCategoryScopeReceipt {
|
|
|
191
191
|
specScanBounded?: boolean;
|
|
192
192
|
[key: string]: unknown;
|
|
193
193
|
}
|
|
194
|
-
export
|
|
194
|
+
export type QuerySpecAllowlistReceipt = {
|
|
195
195
|
limit: number;
|
|
196
196
|
returned: number;
|
|
197
197
|
retrieved?: number;
|
|
198
198
|
truncated: boolean;
|
|
199
199
|
emptyMeansScarcity: boolean;
|
|
200
200
|
outcome?: OpenEnum<"corpus-scarcity" | "retrieval-miss" | "unknown">;
|
|
201
|
-
}
|
|
202
|
-
export
|
|
201
|
+
};
|
|
202
|
+
export type QueryUnsatisfiableNarrowing = {
|
|
203
203
|
narrowing: OpenEnum<"product-type">;
|
|
204
204
|
gate: OpenEnum<"hard">;
|
|
205
205
|
productTypeId: string;
|
|
@@ -207,8 +207,11 @@ export interface QueryUnsatisfiableNarrowing {
|
|
|
207
207
|
productTypeIds: string[];
|
|
208
208
|
pass: string;
|
|
209
209
|
evidence: OpenEnum<"zero-accepted-variants">;
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
relaxedDisplayName?: string;
|
|
211
|
+
relaxedProductTypeId?: string;
|
|
212
|
+
relaxedProductTypeIds?: string[];
|
|
213
|
+
relaxedTo: OpenEnum<"head-noun" | "none">;
|
|
214
|
+
};
|
|
212
215
|
/** Inspectable interpretation of the raw query by ordinary MaterialGraph search. */
|
|
213
216
|
export interface QueryUnderstanding {
|
|
214
217
|
version: OpenEnum<"1">;
|
package/render-assets-types.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { VariantId } from "./identifiers.js";
|
|
|
2
2
|
export type RenderAssetChannelRole = "base-color" | "normal" | "roughness" | "metalness" | "height" | "ambient-occlusion";
|
|
3
3
|
export type RenderAssetSourceBasis = "catalog_feed" | "declared" | "derived";
|
|
4
4
|
export type RenderAssetUnavailableReason = "no_accepted_appearance" | "pending" | "withheld" | "rejected" | "superseded" | "variant_inactive" | "delivery_unverified" | "integrity_error";
|
|
5
|
-
export
|
|
5
|
+
export type RenderAssetFreshness = {
|
|
6
6
|
revision: string;
|
|
7
7
|
updatedAt: string | null;
|
|
8
8
|
checkedAt: string | null;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
9
|
+
};
|
|
10
|
+
export type RenderAssetChannel = {
|
|
11
11
|
role: RenderAssetChannelRole;
|
|
12
12
|
url: string;
|
|
13
13
|
sha256: string;
|
|
@@ -17,8 +17,8 @@ export interface RenderAssetChannel {
|
|
|
17
17
|
height: number;
|
|
18
18
|
bitDepth: 8 | 16;
|
|
19
19
|
colorSpace: "srgb" | "linear";
|
|
20
|
-
}
|
|
21
|
-
export
|
|
20
|
+
};
|
|
21
|
+
export type MaterialRenderAssetsAvailable = {
|
|
22
22
|
schemaVersion: "pbr-render-assets/v1";
|
|
23
23
|
variantId: VariantId;
|
|
24
24
|
status: "available";
|
|
@@ -51,8 +51,8 @@ export interface MaterialRenderAssetsAvailable {
|
|
|
51
51
|
channels: RenderAssetChannel[];
|
|
52
52
|
supersedesSetIds: string[];
|
|
53
53
|
freshness: RenderAssetFreshness;
|
|
54
|
-
}
|
|
55
|
-
export
|
|
54
|
+
};
|
|
55
|
+
export type MaterialRenderAssetsUnavailable = {
|
|
56
56
|
schemaVersion: "pbr-render-assets/v1";
|
|
57
57
|
variantId: VariantId;
|
|
58
58
|
status: "unavailable";
|
|
@@ -61,5 +61,5 @@ export interface MaterialRenderAssetsUnavailable {
|
|
|
61
61
|
sourceBasis: RenderAssetSourceBasis | null;
|
|
62
62
|
reasonCodes: RenderAssetUnavailableReason[];
|
|
63
63
|
freshness: RenderAssetFreshness;
|
|
64
|
-
}
|
|
64
|
+
};
|
|
65
65
|
export type MaterialRenderAssets = MaterialRenderAssetsAvailable | MaterialRenderAssetsUnavailable;
|
package/resolve-client.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ import type { VocabularySearchOptions, VocabularySearchResponse } from "./types.
|
|
|
76
76
|
* resolved independently, so one meaningless phrase never spoils the batch.
|
|
77
77
|
* @param options `category` to scope the coverage answer, and an `AbortSignal`.
|
|
78
78
|
*/
|
|
79
|
-
export declare
|
|
79
|
+
export declare const resolvePhrasesRequest: (transport: HttpTransport, phrases: string[], scope?: ResolvePhrasesScope) => Promise<ResolveResponse>;
|
|
80
80
|
/**
|
|
81
81
|
* THE QUESTION: "is 'FloorScore' an attribute or a value, and what is it called
|
|
82
82
|
* here?" The catch-all for ONE phrase when you do not know which half of an
|
|
@@ -87,4 +87,4 @@ export declare function resolvePhrasesRequest(transport: HttpTransport, phrases:
|
|
|
87
87
|
* phrase might name a brand, paint, colour or category rather than a spec, and
|
|
88
88
|
* `mg.glossary()` to EXPLAIN a term rather than find it.
|
|
89
89
|
*/
|
|
90
|
-
export declare
|
|
90
|
+
export declare const searchVocabularyRequest: (transport: HttpTransport, query: string, options?: VocabularySearchOptions, signal?: AbortSignal) => Promise<VocabularySearchResponse>;
|
package/resolve-client.js
CHANGED
|
@@ -49,11 +49,11 @@ import { resolveOperation } from "./operations.js";
|
|
|
49
49
|
* resolved independently, so one meaningless phrase never spoils the batch.
|
|
50
50
|
* @param options `category` to scope the coverage answer, and an `AbortSignal`.
|
|
51
51
|
*/
|
|
52
|
-
export
|
|
52
|
+
export const resolvePhrasesRequest = async (transport, phrases, scope) => {
|
|
53
53
|
// A bare signal is what this took before `category` existed; keep accepting it
|
|
54
54
|
// so no published call site had to change to gain coverage.
|
|
55
55
|
const options = scope instanceof AbortSignal ? { signal: scope } : (scope ?? {});
|
|
56
|
-
return transport.requestJson(resolveOperation("resolve_phrases"), {
|
|
56
|
+
return await transport.requestJson(resolveOperation("resolve_phrases"), {
|
|
57
57
|
body: {
|
|
58
58
|
phrases,
|
|
59
59
|
...(options.category === undefined
|
|
@@ -62,7 +62,7 @@ export function resolvePhrasesRequest(transport, phrases, scope) {
|
|
|
62
62
|
},
|
|
63
63
|
signal: options.signal,
|
|
64
64
|
});
|
|
65
|
-
}
|
|
65
|
+
};
|
|
66
66
|
/**
|
|
67
67
|
* THE QUESTION: "is 'FloorScore' an attribute or a value, and what is it called
|
|
68
68
|
* here?" The catch-all for ONE phrase when you do not know which half of an
|
|
@@ -73,6 +73,4 @@ export function resolvePhrasesRequest(transport, phrases, scope) {
|
|
|
73
73
|
* phrase might name a brand, paint, colour or category rather than a spec, and
|
|
74
74
|
* `mg.glossary()` to EXPLAIN a term rather than find it.
|
|
75
75
|
*/
|
|
76
|
-
export
|
|
77
|
-
return transport.requestJson(resolveOperation("catalog_vocabulary_search"), { query: { q: query, limit: options?.limit, kind: options?.kind }, signal });
|
|
78
|
-
}
|
|
76
|
+
export const searchVocabularyRequest = async (transport, query, options, signal) => await transport.requestJson(resolveOperation("catalog_vocabulary_search"), { query: { kind: options?.kind, limit: options?.limit, q: query }, signal });
|
|
@@ -8,15 +8,15 @@ import type { CorpusScope } from "./corpus-scope-types.js";
|
|
|
8
8
|
import type { VariantId } from "./identifiers.js";
|
|
9
9
|
import type { OpenEnum } from "./types.js";
|
|
10
10
|
/** Options for `resolveColour`. */
|
|
11
|
-
export
|
|
11
|
+
export type ResolveColourOptions = {
|
|
12
12
|
/**
|
|
13
13
|
* Sets `inScope` on each catalogue variant the lookup reports. It never
|
|
14
14
|
* narrows the lookup. Absent leaves every `inScope` null.
|
|
15
15
|
*/
|
|
16
16
|
corpusScope?: CorpusScope;
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
/** One catalogue variant carrying the named paint. */
|
|
19
|
-
export
|
|
19
|
+
export type ResolveColourCatalogueVariant = {
|
|
20
20
|
variantId: VariantId;
|
|
21
21
|
/** The brand exactly as stored, suspect or not. */
|
|
22
22
|
brand: {
|
|
@@ -32,7 +32,7 @@ export interface ResolveColourCatalogueVariant {
|
|
|
32
32
|
* made it. The variant is still the right one for the name.
|
|
33
33
|
*/
|
|
34
34
|
parentageSuspect: boolean;
|
|
35
|
-
}
|
|
35
|
+
};
|
|
36
36
|
/**
|
|
37
37
|
* Whether the named paint is a variant in the catalogue. Exact, global, and
|
|
38
38
|
* never narrowed by `corpusScope`, and run only for a `brand` library hit.
|
|
@@ -50,18 +50,18 @@ export type ResolveColourVariant = ({
|
|
|
50
50
|
status: "not-looked-up";
|
|
51
51
|
reason: OpenEnum<"reference-colour" | "descriptive-colour" | "no-paint-identity" | "generic-colour" | "several-paints">;
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type ResolveColourResponse = {
|
|
54
54
|
/** Examples within the governed range. They do not replace its representative or bounds. */
|
|
55
55
|
rangeSamples?: string[];
|
|
56
56
|
/** Explicit manufacturer choices for an ambiguous paint name. Never selected automatically. */
|
|
57
|
-
alternatives?:
|
|
57
|
+
alternatives?: {
|
|
58
58
|
query: string;
|
|
59
59
|
name: string;
|
|
60
60
|
hex: string;
|
|
61
61
|
libraryId: string;
|
|
62
62
|
libraryName: string;
|
|
63
63
|
code?: string;
|
|
64
|
-
}
|
|
64
|
+
}[];
|
|
65
65
|
/** Generic meaning; maker-specific paint identity is carried by match. */
|
|
66
66
|
genericResolution: ColorResolution;
|
|
67
67
|
match: {
|
|
@@ -80,4 +80,4 @@ export interface ResolveColourResponse {
|
|
|
80
80
|
/** The catalogue lookup for the name. Absent from servers that predate it. */
|
|
81
81
|
variant?: ResolveColourVariant;
|
|
82
82
|
} | null;
|
|
83
|
-
}
|
|
83
|
+
};
|
package/resolve-types.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type ResolutionKind = "brand" | "paint_identity" | "colour" | "category"
|
|
|
51
51
|
*/
|
|
52
52
|
export type ResolutionRung = "exact" | "alias" | "lexical";
|
|
53
53
|
/** One thing a phrase turned out to mean. */
|
|
54
|
-
export
|
|
54
|
+
export type ResolvedMeaning = {
|
|
55
55
|
kind: ResolutionKind;
|
|
56
56
|
/**
|
|
57
57
|
* The canonical token. OPAQUE — hand it back verbatim, never parse, tidy or
|
|
@@ -91,9 +91,9 @@ export interface ResolvedMeaning {
|
|
|
91
91
|
* nothing rather than a figure measured a different way.
|
|
92
92
|
*/
|
|
93
93
|
coverage?: MeaningCoverage;
|
|
94
|
-
}
|
|
94
|
+
};
|
|
95
95
|
/** How much of the catalogue stands behind one reading. */
|
|
96
|
-
export
|
|
96
|
+
export type MeaningCoverage = {
|
|
97
97
|
/**
|
|
98
98
|
* How many variants carry this reading, CORPUS-WIDE and across every brand —
|
|
99
99
|
* never scoped to the `category` you sent, even when you sent one. `0` is a
|
|
@@ -121,9 +121,9 @@ export interface MeaningCoverage {
|
|
|
121
121
|
* category holds SOME value for the attribute, not that it holds this one.
|
|
122
122
|
*/
|
|
123
123
|
inCategory?: boolean;
|
|
124
|
-
}
|
|
124
|
+
};
|
|
125
125
|
/** What one phrase resolved to — including, explicitly, nothing. */
|
|
126
|
-
export
|
|
126
|
+
export type PhraseResolution = {
|
|
127
127
|
/** The phrase exactly as you sent it, so you can rejoin the batch by value. */
|
|
128
128
|
phrase: string;
|
|
129
129
|
/**
|
|
@@ -147,9 +147,9 @@ export interface PhraseResolution {
|
|
|
147
147
|
* material world.
|
|
148
148
|
*/
|
|
149
149
|
unresolved: boolean;
|
|
150
|
-
}
|
|
150
|
+
};
|
|
151
151
|
/** Optional scoping for a resolve call. */
|
|
152
|
-
export
|
|
152
|
+
export type ResolvePhrasesOptions = {
|
|
153
153
|
/**
|
|
154
154
|
* The product category you are grounding these words FOR — a slot, not a
|
|
155
155
|
* filter. It adds {@link MeaningCoverage.inCategory} to every `attribute` and
|
|
@@ -157,7 +157,7 @@ export interface ResolvePhrasesOptions {
|
|
|
157
157
|
*/
|
|
158
158
|
category?: string;
|
|
159
159
|
signal?: AbortSignal;
|
|
160
|
-
}
|
|
160
|
+
};
|
|
161
161
|
/**
|
|
162
162
|
* What `mg.resolve()` accepts as its second argument. A bare `AbortSignal` is
|
|
163
163
|
* still accepted, exactly as before {@link ResolvePhrasesOptions} existed, so no
|
|
@@ -165,7 +165,7 @@ export interface ResolvePhrasesOptions {
|
|
|
165
165
|
*/
|
|
166
166
|
export type ResolvePhrasesScope = AbortSignal | ResolvePhrasesOptions;
|
|
167
167
|
/** The resolve response: one entry per phrase, in the order you sent them. */
|
|
168
|
-
export
|
|
168
|
+
export type ResolveResponse = {
|
|
169
169
|
/** One per phrase, in request order — never reordered, never deduplicated. */
|
|
170
170
|
resolutions: PhraseResolution[];
|
|
171
|
-
}
|
|
171
|
+
};
|