@instruments/materialgraph 0.24.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.
Files changed (124) hide show
  1. package/association-types.d.ts +20 -20
  2. package/associations-client.d.ts +4 -4
  3. package/associations-client.js +3 -10
  4. package/attribution-types.d.ts +3 -3
  5. package/brand-most-sampled-types.d.ts +4 -4
  6. package/brand-types.d.ts +6 -6
  7. package/brands-client.d.ts +4 -4
  8. package/brands-client.js +9 -13
  9. package/browse-types.d.ts +8 -8
  10. package/by-colour-types.d.ts +18 -18
  11. package/by-spec-types.d.ts +14 -14
  12. package/catalog-discovery-types.d.ts +14 -14
  13. package/catalogue-client.d.ts +4 -4
  14. package/catalogue-client.js +38 -37
  15. package/catalogue-types.d.ts +4 -4
  16. package/citation-types.d.ts +4 -4
  17. package/client-browse.d.ts +4 -4
  18. package/client-browse.js +24 -25
  19. package/client-config.d.ts +2 -2
  20. package/client-exploration.d.ts +3 -3
  21. package/client-exploration.js +4 -6
  22. package/client-source-material-comments.d.ts +4 -4
  23. package/client-source-material-comments.js +4 -38
  24. package/client-vocabulary.d.ts +8 -8
  25. package/client-vocabulary.js +20 -30
  26. package/client.d.ts +11 -45
  27. package/client.js +143 -188
  28. package/codes-client.d.ts +2 -2
  29. package/codes-client.js +8 -8
  30. package/codes-types.d.ts +34 -34
  31. package/colour-aggregate-types.d.ts +24 -24
  32. package/colours-client.d.ts +2 -2
  33. package/colours-client.js +15 -15
  34. package/compare-types.d.ts +10 -10
  35. package/composition-client.d.ts +3 -3
  36. package/composition-client.js +8 -7
  37. package/composition-types.d.ts +12 -12
  38. package/coordinate-client.d.ts +2 -2
  39. package/coordinate-client.js +1 -13
  40. package/corpus-scope-types.d.ts +3 -3
  41. package/corpus-scope-types.js +1 -25
  42. package/correction-types.d.ts +10 -10
  43. package/demand-batch-types.d.ts +18 -18
  44. package/demand-types.d.ts +24 -24
  45. package/errors.d.ts +12 -12
  46. package/errors.js +53 -52
  47. package/exploration-types.d.ts +29 -22
  48. package/fan-deck-types.d.ts +6 -6
  49. package/http-transport.d.ts +13 -21
  50. package/http-transport.js +31 -28
  51. package/identify-types.d.ts +10 -10
  52. package/index.d.ts +0 -6
  53. package/index.js +0 -2
  54. package/match-rejection-types.d.ts +6 -6
  55. package/match-stream-types.d.ts +32 -32
  56. package/match-stream.d.ts +2 -2
  57. package/match-stream.js +55 -41
  58. package/match-types.d.ts +8 -8
  59. package/material-asset-types.d.ts +26 -26
  60. package/material-block-types.d.ts +6 -6
  61. package/material-query-plan-types.d.ts +26 -26
  62. package/material-resources-client.d.ts +5 -5
  63. package/material-resources-client.js +10 -20
  64. package/material-types.d.ts +12 -12
  65. package/ndjson.js +16 -8
  66. package/operations.d.ts +6 -6
  67. package/operations.js +9 -39
  68. package/package.json +2 -2
  69. package/palette-completion-types.d.ts +22 -22
  70. package/palette-search-types.d.ts +28 -28
  71. package/query-understanding-types.d.ts +43 -36
  72. package/render-assets-types.d.ts +8 -8
  73. package/resolve-client.d.ts +2 -2
  74. package/resolve-client.js +4 -6
  75. package/resolve-colour-types.d.ts +22 -6
  76. package/resolve-types.d.ts +10 -10
  77. package/run-types.d.ts +70 -70
  78. package/runs.d.ts +13 -26
  79. package/runs.js +77 -89
  80. package/samplize-catalogue-types.d.ts +18 -18
  81. package/samplize-colorvec.d.ts +20 -20
  82. package/samplize-colorvec.js +66 -42
  83. package/schema-resource-types.d.ts +38 -38
  84. package/schema-resource-types.js +5 -5
  85. package/search-card-types.d.ts +14 -5
  86. package/search-collapse-types.d.ts +4 -4
  87. package/search-mood-types.d.ts +2 -2
  88. package/search-refinement-types.d.ts +8 -8
  89. package/search-request-types.d.ts +6 -6
  90. package/search-response-receipt-types.d.ts +135 -34
  91. package/search-response-types.d.ts +2 -2
  92. package/search-result-validation.d.ts +3 -3
  93. package/search-result-validation.js +53 -36
  94. package/search-window-types.d.ts +2 -2
  95. package/slot-pool-types.d.ts +20 -20
  96. package/source-material-validation.d.ts +3 -3
  97. package/source-material-validation.js +35 -39
  98. package/spec-facet-types.d.ts +10 -10
  99. package/spec-types.d.ts +6 -6
  100. package/specifications.d.ts +9 -25
  101. package/specifications.js +15 -21
  102. package/sse.d.ts +2 -2
  103. package/sse.js +32 -16
  104. package/substitute-types.d.ts +22 -22
  105. package/suggest-types.d.ts +7 -7
  106. package/suggest-types.js +3 -3
  107. package/taxonomy-coverage-types.d.ts +8 -8
  108. package/types.d.ts +119 -119
  109. package/validation.d.ts +26 -26
  110. package/validation.js +97 -92
  111. package/webmcp.d.ts +2 -2
  112. package/webmcp.generated.js +94 -87
  113. package/project-types.d.ts +0 -79
  114. package/project-types.js +0 -9
  115. package/projects.d.ts +0 -13
  116. package/projects.js +0 -46
  117. package/run-events.d.ts +0 -106
  118. package/run-events.js +0 -32
  119. package/schedule-reference-types.d.ts +0 -46
  120. package/schedule-reference-types.js +0 -1
  121. package/schedule-references-client.d.ts +0 -14
  122. package/schedule-references-client.js +0 -26
  123. package/schedule-types.d.ts +0 -261
  124. 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 interface PaletteQueryColour {
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 interface GradientStop {
33
+ export type GradientStop = {
34
34
  hex?: string;
35
35
  oklab?: OklabTriple;
36
- }
37
- export interface SearchPaletteInput {
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 interface SearchGradientInput {
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 interface CandidateSwatch {
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 interface ColourMatchReceipt {
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 interface MultiColourMatchBase {
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 interface PaletteMatch extends MultiColourMatchBase {
108
+ };
109
+ export type PaletteMatch = {
110
110
  /** One receipt per queried colour, in query order. */
111
111
  colours: ColourMatchReceipt[];
112
- }
113
- export interface GradientMatch extends MultiColourMatchBase {
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 interface HueGateReceipt {
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 interface SearchPaletteResponse {
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: Array<{
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: Array<{
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 interface SearchGradientResponse {
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
+ };
@@ -1,7 +1,9 @@
1
+ import type { MatchTarget } from "@instruments/colorscope/match";
2
+ import type { ColorResolution } from "@instruments/colorscope/naming";
1
3
  import type { SearchFilter } from "./search-refinement-types.js";
2
4
  import type { OpenEnum } from "./types.js";
3
5
  export type QuerySenseKind = OpenEnum<"brand" | "product" | "paint_identity" | "category" | "material" | "colour" | "attribute" | "attribute_value" | "certification">;
4
- export interface QuerySense {
6
+ export type QuerySense = {
5
7
  id: string;
6
8
  kind: QuerySenseKind;
7
9
  label: string;
@@ -26,14 +28,16 @@ export interface QuerySense {
26
28
  hex?: string;
27
29
  };
28
30
  reason?: string;
29
- }
30
- export interface CanonicalLexicalAuthorityReceipt {
31
+ };
32
+ export type CanonicalLexicalAuthorityReceipt = {
31
33
  authority: OpenEnum<"taxonomy" | "colorscope">;
32
34
  version: string;
33
35
  revision: string;
34
36
  digest?: string;
35
- }
36
- export interface CanonicalLexicalReading {
37
+ };
38
+ export type CanonicalLexicalReading = {
39
+ matchTarget?: MatchTarget;
40
+ colorResolution?: ColorResolution;
37
41
  authority: OpenEnum<"taxonomy" | "colorscope">;
38
42
  identity: string;
39
43
  outcome: OpenEnum<"equivalent" | "ambiguous" | "declined">;
@@ -59,8 +63,8 @@ export interface CanonicalLexicalReading {
59
63
  snapshot?: string;
60
64
  source: string;
61
65
  };
62
- }
63
- export interface CanonicalLexicalMatch {
66
+ };
67
+ export type CanonicalLexicalMatch = {
64
68
  original: string;
65
69
  canonical: string;
66
70
  rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
@@ -76,24 +80,24 @@ export interface CanonicalLexicalMatch {
76
80
  rule: OpenEnum<"exact" | "plural-to-singular" | "typo-to-canonical">;
77
81
  authorities: CanonicalLexicalAuthorityReceipt[];
78
82
  };
79
- }
80
- export interface CanonicalLexicalReceipt {
83
+ };
84
+ export type CanonicalLexicalReceipt = {
81
85
  original: string;
82
86
  outcome: OpenEnum<"resolved" | "ambiguous" | "declined" | "partial" | "unresolved">;
83
87
  matches: CanonicalLexicalMatch[];
84
88
  unresolved: CanonicalLexicalMatch[];
85
- }
86
- export interface QueryResidualReceipt {
89
+ };
90
+ export type QueryResidualReceipt = {
87
91
  kind: OpenEnum<"compound" | "descriptive" | "ambiguous" | "empty">;
88
92
  tokens: string[];
89
93
  resolvedTokens: string[];
90
94
  unresolvedTokens: string[];
91
95
  resolvedRatio: number;
92
96
  comparisonFrame: boolean;
93
- }
97
+ };
94
98
  /** Deterministic criteria compiled from the query before retrieval. */
95
- export interface QueryCriteriaReceipt {
96
- applied: Array<{
99
+ export type QueryCriteriaReceipt = {
100
+ applied: {
97
101
  criterion: SearchFilter;
98
102
  lane: OpenEnum<"filter" | "preference">;
99
103
  lexicalSignal?: {
@@ -110,30 +114,30 @@ export interface QueryCriteriaReceipt {
110
114
  };
111
115
  source: OpenEnum<"compiled" | "taxonomy-adapter">;
112
116
  span: string;
113
- }>;
114
- conflicts: Array<{
117
+ }[];
118
+ conflicts: {
115
119
  attributeId: string;
116
120
  caller: SearchFilter;
117
121
  compiled: SearchFilter;
118
122
  reason: string;
119
- }>;
120
- exclusions: Array<{
123
+ }[];
124
+ exclusions: {
121
125
  criterion: SearchFilter;
122
126
  execution: OpenEnum<"blocked-positive-only-contract">;
123
127
  lane: OpenEnum<"hard" | "soft">;
124
128
  missingValuePolicy: OpenEnum<"retain-unknown">;
125
129
  span: string;
126
- }>;
130
+ }[];
127
131
  preferences: SearchFilter[];
128
132
  residualText: string | null;
129
- unresolved: Array<{
133
+ unresolved: {
130
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">;
131
135
  reason: string;
132
136
  span: string;
133
- }>;
134
- }
137
+ }[];
138
+ };
135
139
  /** How the query named or inferred a product type before retrieval. */
136
- export interface QueryProductTypeReceipt {
140
+ export type QueryProductTypeReceipt = {
137
141
  kind: OpenEnum<"leaf" | "group" | "vector" | "ambiguous" | "none">;
138
142
  gate: OpenEnum<"hard" | "constrain" | "none">;
139
143
  pass: OpenEnum<"taxonomy" | "synonym" | "display-name" | "group" | "head-noun" | "vector" | "none">;
@@ -148,14 +152,14 @@ export interface QueryProductTypeReceipt {
148
152
  vectorPassRan: boolean;
149
153
  registryVersion: string;
150
154
  durationMs: number;
151
- candidates: Array<{
155
+ candidates: {
152
156
  productTypeId: string;
153
157
  displayName: string;
154
158
  similarity: number;
155
- }>;
156
- }
159
+ }[];
160
+ };
157
161
  /** The selected retrieval arm; null when the path is browse or criteria-only. */
158
- export interface QueryArmReceipt {
162
+ export type QueryArmReceipt = {
159
163
  arm: OpenEnum<"dense" | "lexical" | "colour"> | null;
160
164
  reason: string;
161
165
  reasonDetail?: OpenEnum<"derived-colour-veto" | "typo-recovery" | "literal-compound-without-type">;
@@ -165,8 +169,8 @@ export interface QueryArmReceipt {
165
169
  productTypeIds: string[];
166
170
  residual: QueryResidualReceipt;
167
171
  registryVersion: string;
168
- }
169
- export interface QueryAmbiguityReceipt {
172
+ };
173
+ export type QueryAmbiguityReceipt = {
170
174
  outcome: OpenEnum<"applied" | "abstained" | "refused" | "timeout">;
171
175
  modelId: string | null;
172
176
  providerRan: boolean;
@@ -178,24 +182,24 @@ export interface QueryAmbiguityReceipt {
178
182
  routing: OpenEnum<"compound" | "descriptive"> | null;
179
183
  productTypeIds: string[];
180
184
  changedArm: boolean;
181
- }
185
+ };
182
186
  export interface QueryCategoryScopeReceipt {
183
187
  source: OpenEnum<"caller" | "anchor">;
184
- mechanism: OpenEnum<"sql-predicate" | "allowlist" | "prune">;
188
+ mechanism: OpenEnum<"sql-predicate" | "provider-filter" | "allowlist" | "prune">;
185
189
  variantCount: number | null;
186
190
  ceiling: number;
187
191
  specScanBounded?: boolean;
188
192
  [key: string]: unknown;
189
193
  }
190
- export interface QuerySpecAllowlistReceipt {
194
+ export type QuerySpecAllowlistReceipt = {
191
195
  limit: number;
192
196
  returned: number;
193
197
  retrieved?: number;
194
198
  truncated: boolean;
195
199
  emptyMeansScarcity: boolean;
196
200
  outcome?: OpenEnum<"corpus-scarcity" | "retrieval-miss" | "unknown">;
197
- }
198
- export interface QueryUnsatisfiableNarrowing {
201
+ };
202
+ export type QueryUnsatisfiableNarrowing = {
199
203
  narrowing: OpenEnum<"product-type">;
200
204
  gate: OpenEnum<"hard">;
201
205
  productTypeId: string;
@@ -203,8 +207,11 @@ export interface QueryUnsatisfiableNarrowing {
203
207
  productTypeIds: string[];
204
208
  pass: string;
205
209
  evidence: OpenEnum<"zero-accepted-variants">;
206
- relaxedTo: OpenEnum<"none">;
207
- }
210
+ relaxedDisplayName?: string;
211
+ relaxedProductTypeId?: string;
212
+ relaxedProductTypeIds?: string[];
213
+ relaxedTo: OpenEnum<"head-noun" | "none">;
214
+ };
208
215
  /** Inspectable interpretation of the raw query by ordinary MaterialGraph search. */
209
216
  export interface QueryUnderstanding {
210
217
  version: OpenEnum<"1">;
@@ -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 interface RenderAssetFreshness {
5
+ export type RenderAssetFreshness = {
6
6
  revision: string;
7
7
  updatedAt: string | null;
8
8
  checkedAt: string | null;
9
- }
10
- export interface RenderAssetChannel {
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 interface MaterialRenderAssetsAvailable {
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 interface MaterialRenderAssetsUnavailable {
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;
@@ -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 function resolvePhrasesRequest(transport: HttpTransport, phrases: string[], scope?: ResolvePhrasesScope): Promise<ResolveResponse>;
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 function searchVocabularyRequest(transport: HttpTransport, query: string, options?: VocabularySearchOptions, signal?: AbortSignal): Promise<VocabularySearchResponse>;
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 function resolvePhrasesRequest(transport, phrases, scope) {
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 function searchVocabularyRequest(transport, query, options, signal) {
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 });
@@ -1,20 +1,22 @@
1
+ import type { MatchTarget } from "@instruments/colorscope/match";
1
2
  /**
2
3
  * Colour-name resolution (GET `/api/v1/search/colours/resolve`): the resolved
3
4
  * colour, and whether the named paint is a variant in the catalogue.
4
5
  */
6
+ import type { ColorResolution } from "@instruments/colorscope/naming";
5
7
  import type { CorpusScope } from "./corpus-scope-types.js";
6
8
  import type { VariantId } from "./identifiers.js";
7
9
  import type { OpenEnum } from "./types.js";
8
10
  /** Options for `resolveColour`. */
9
- export interface ResolveColourOptions {
11
+ export type ResolveColourOptions = {
10
12
  /**
11
13
  * Sets `inScope` on each catalogue variant the lookup reports. It never
12
14
  * narrows the lookup. Absent leaves every `inScope` null.
13
15
  */
14
16
  corpusScope?: CorpusScope;
15
- }
17
+ };
16
18
  /** One catalogue variant carrying the named paint. */
17
- export interface ResolveColourCatalogueVariant {
19
+ export type ResolveColourCatalogueVariant = {
18
20
  variantId: VariantId;
19
21
  /** The brand exactly as stored, suspect or not. */
20
22
  brand: {
@@ -30,7 +32,7 @@ export interface ResolveColourCatalogueVariant {
30
32
  * made it. The variant is still the right one for the name.
31
33
  */
32
34
  parentageSuspect: boolean;
33
- }
35
+ };
34
36
  /**
35
37
  * Whether the named paint is a variant in the catalogue. Exact, global, and
36
38
  * never narrowed by `corpusScope`, and run only for a `brand` library hit.
@@ -48,8 +50,22 @@ export type ResolveColourVariant = ({
48
50
  status: "not-looked-up";
49
51
  reason: OpenEnum<"reference-colour" | "descriptive-colour" | "no-paint-identity" | "generic-colour" | "several-paints">;
50
52
  };
51
- export interface ResolveColourResponse {
53
+ export type ResolveColourResponse = {
54
+ /** Examples within the governed range. They do not replace its representative or bounds. */
55
+ rangeSamples?: string[];
56
+ /** Explicit manufacturer choices for an ambiguous paint name. Never selected automatically. */
57
+ alternatives?: {
58
+ query: string;
59
+ name: string;
60
+ hex: string;
61
+ libraryId: string;
62
+ libraryName: string;
63
+ code?: string;
64
+ }[];
65
+ /** Generic meaning; maker-specific paint identity is carried by match. */
66
+ genericResolution: ColorResolution;
52
67
  match: {
68
+ matchTarget: MatchTarget;
53
69
  hex: string;
54
70
  name: string;
55
71
  code?: string;
@@ -64,4 +80,4 @@ export interface ResolveColourResponse {
64
80
  /** The catalogue lookup for the name. Absent from servers that predate it. */
65
81
  variant?: ResolveColourVariant;
66
82
  } | null;
67
- }
83
+ };
@@ -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 interface ResolvedMeaning {
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 interface MeaningCoverage {
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 interface PhraseResolution {
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 interface ResolvePhrasesOptions {
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 interface ResolveResponse {
168
+ export type ResolveResponse = {
169
169
  /** One per phrase, in request order — never reordered, never deduplicated. */
170
170
  resolutions: PhraseResolution[];
171
- }
171
+ };