@instruments/materialgraph 0.25.0 → 0.27.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 (158) hide show
  1. package/association-types.d.ts +38 -27
  2. package/associations-client.d.ts +4 -4
  3. package/associations-client.js +3 -10
  4. package/attribution-types.d.ts +4 -4
  5. package/brand-types.d.ts +14 -6
  6. package/brands-client.d.ts +7 -38
  7. package/brands-client.js +10 -40
  8. package/by-colour-types.d.ts +58 -31
  9. package/by-spec-types.d.ts +6 -73
  10. package/by-spec-types.js +7 -5
  11. package/catalog-discovery-types.d.ts +11 -26
  12. package/catalogue-client.d.ts +16 -35
  13. package/catalogue-client.js +32 -67
  14. package/catalogue-types.d.ts +44 -4
  15. package/categories-client.d.ts +63 -0
  16. package/categories-client.js +48 -0
  17. package/category-types.d.ts +114 -0
  18. package/citation-types.d.ts +4 -4
  19. package/client-config.d.ts +4 -6
  20. package/client-config.js +2 -4
  21. package/client-source-material-comments.d.ts +4 -4
  22. package/client-source-material-comments.js +4 -38
  23. package/client-vocabulary.d.ts +7 -9
  24. package/client-vocabulary.js +22 -30
  25. package/client.d.ts +110 -244
  26. package/client.js +217 -387
  27. package/codes-client.d.ts +2 -2
  28. package/codes-client.js +8 -8
  29. package/codes-types.d.ts +55 -34
  30. package/colour-aggregate-types.d.ts +24 -24
  31. package/colours-client.d.ts +6 -11
  32. package/colours-client.js +11 -19
  33. package/coordinate-client.d.ts +2 -2
  34. package/coordinate-client.js +1 -13
  35. package/corpus-scope-types.d.ts +3 -3
  36. package/corpus-scope-types.js +1 -25
  37. package/demand-batch-types.d.ts +18 -18
  38. package/demand-types.d.ts +24 -24
  39. package/errors.d.ts +13 -13
  40. package/errors.js +54 -52
  41. package/http-transport.d.ts +13 -21
  42. package/http-transport.js +31 -28
  43. package/identify-types.d.ts +54 -44
  44. package/identify-types.js +5 -3
  45. package/index.d.ts +11 -27
  46. package/index.js +4 -6
  47. package/list-variant-facets-types.d.ts +60 -0
  48. package/list-variants-types.d.ts +142 -0
  49. package/list-variants-types.js +12 -0
  50. package/match-stream-types.d.ts +45 -32
  51. package/match-stream-types.js +2 -0
  52. package/match-stream.d.ts +2 -2
  53. package/match-stream.js +67 -49
  54. package/match-types.d.ts +32 -8
  55. package/material-asset-types.d.ts +89 -69
  56. package/material-block-types.d.ts +8 -6
  57. package/material-composition-client.d.ts +21 -0
  58. package/material-composition-client.js +13 -0
  59. package/material-composition-types.d.ts +403 -0
  60. package/material-query-plan-types.d.ts +61 -145
  61. package/material-resources-client.d.ts +12 -10
  62. package/material-resources-client.js +27 -22
  63. package/material-types.d.ts +16 -24
  64. package/ndjson.js +16 -8
  65. package/operations.d.ts +6 -6
  66. package/operations.js +29 -156
  67. package/package.json +5 -1
  68. package/palette-search-types.d.ts +87 -52
  69. package/query-understanding-types.d.ts +65 -40
  70. package/resolve-client.d.ts +8 -12
  71. package/resolve-client.js +9 -13
  72. package/resolve-colour-types.d.ts +8 -8
  73. package/resolve-types.d.ts +10 -10
  74. package/response-schemas.d.ts +20 -0
  75. package/response-schemas.generated.d.ts +5 -0
  76. package/response-schemas.generated.js +160 -0
  77. package/response-schemas.js +113 -0
  78. package/run-types.d.ts +64 -145
  79. package/runs.d.ts +9 -58
  80. package/runs.js +60 -149
  81. package/samplize-catalogue-types.d.ts +18 -18
  82. package/samplize-colorvec.d.ts +20 -20
  83. package/samplize-colorvec.js +66 -42
  84. package/schema-resource-types.d.ts +52 -39
  85. package/schema-resource-types.js +5 -5
  86. package/search-card-types.d.ts +26 -4
  87. package/search-index-plan-types.d.ts +70 -0
  88. package/search-refinement-types.d.ts +10 -40
  89. package/search-refinement-types.js +1 -0
  90. package/search-request-types.d.ts +121 -204
  91. package/search-response-receipt-types.d.ts +13 -253
  92. package/search-response-types.d.ts +2 -2
  93. package/search-result-validation.d.ts +3 -19
  94. package/search-result-validation.js +42 -183
  95. package/source-material-validation.d.ts +3 -3
  96. package/source-material-validation.js +35 -39
  97. package/spec-facet-types.d.ts +11 -16
  98. package/spec-types.d.ts +23 -16
  99. package/spec-types.js +8 -7
  100. package/specifications.d.ts +14 -72
  101. package/specifications.js +39 -89
  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 +11 -17
  106. package/suggest-types.js +3 -3
  107. package/taxonomy-coverage-types.d.ts +8 -8
  108. package/types.d.ts +202 -405
  109. package/validation.d.ts +26 -26
  110. package/validation.js +97 -92
  111. package/webmcp.d.ts +3 -3
  112. package/webmcp.generated.js +10 -93
  113. package/brand-most-sampled-types.d.ts +0 -33
  114. package/browse-types.d.ts +0 -236
  115. package/client-browse.d.ts +0 -78
  116. package/client-browse.js +0 -72
  117. package/client-exploration.d.ts +0 -9
  118. package/client-exploration.js +0 -7
  119. package/compare-types.d.ts +0 -89
  120. package/composition-client.d.ts +0 -33
  121. package/composition-client.js +0 -27
  122. package/composition-types.d.ts +0 -455
  123. package/composition-types.js +0 -10
  124. package/correction-types.d.ts +0 -88
  125. package/exploration-types.d.ts +0 -118
  126. package/exploration-types.js +0 -1
  127. package/fan-deck-types.d.ts +0 -42
  128. package/fan-deck-types.js +0 -9
  129. package/match-rejection-types.d.ts +0 -43
  130. package/match-rejection-types.js +0 -7
  131. package/palette-completion-types.d.ts +0 -115
  132. package/palette-completion-types.js +0 -1
  133. package/project-types.d.ts +0 -79
  134. package/project-types.js +0 -9
  135. package/projects.d.ts +0 -13
  136. package/projects.js +0 -46
  137. package/render-assets-types.d.ts +0 -65
  138. package/render-assets-types.js +0 -1
  139. package/run-events.d.ts +0 -106
  140. package/run-events.js +0 -32
  141. package/schedule-reference-types.d.ts +0 -46
  142. package/schedule-reference-types.js +0 -1
  143. package/schedule-references-client.d.ts +0 -14
  144. package/schedule-references-client.js +0 -26
  145. package/schedule-types.d.ts +0 -261
  146. package/schedule-types.js +0 -1
  147. package/search-collapse-types.d.ts +0 -69
  148. package/search-collapse-types.js +0 -1
  149. package/search-mood-types.d.ts +0 -6
  150. package/search-mood-types.js +0 -1
  151. package/search-window-types.d.ts +0 -25
  152. package/search-window-types.js +0 -1
  153. package/slot-pool-types.d.ts +0 -372
  154. package/slot-pool-types.js +0 -1
  155. /package/{brand-most-sampled-types.js → category-types.js} +0 -0
  156. /package/{browse-types.js → list-variant-facets-types.js} +0 -0
  157. /package/{compare-types.js → material-composition-types.js} +0 -0
  158. /package/{correction-types.js → search-index-plan-types.js} +0 -0
package/codes-client.d.ts CHANGED
@@ -27,10 +27,10 @@ import type { CodeAdvisoryInput, CodeAdvisoryResponse, CodeContextRequest, CodeC
27
27
  import type { QueryParams } from "./http-transport.js";
28
28
  import type { SdkOperationId } from "./operations.js";
29
29
  /** The client's own request primitives, handed down so this file owns no transport. */
30
- export interface CodesTransport {
30
+ export type CodesTransport = {
31
31
  get<T>(operationId: SdkOperationId, query?: QueryParams, signal?: AbortSignal): Promise<T>;
32
32
  post<T>(operationId: SdkOperationId, body: unknown, signal?: AbortSignal): Promise<T>;
33
- }
33
+ };
34
34
  export declare class CodesClient {
35
35
  #private;
36
36
  constructor(transport: CodesTransport);
package/codes-client.js CHANGED
@@ -27,8 +27,8 @@ export class CodesClient {
27
27
  * // `model_baseline` means unamended model IBC stood in for this AHJ's own table.
28
28
  * console.log(texas?.coverage, texas?.adoptionNote);
29
29
  */
30
- context(signal) {
31
- return this.#transport.get("list_code_context", undefined, signal);
30
+ async context(signal) {
31
+ return await this.#transport.get("list_code_context", undefined, signal);
32
32
  }
33
33
  /**
34
34
  * THE QUESTION: "what does this space DEMAND?" — before any candidate exists.
@@ -53,13 +53,13 @@ export class CodesClient {
53
53
  * });
54
54
  * requirements.map((r) => `${r.dimension}: ${r.label} (${r.section})`);
55
55
  */
56
- requirements(input, signal) {
57
- return this.#transport.get("list_code_requirements", {
56
+ async requirements(input, signal) {
57
+ return await this.#transport.get("list_code_requirements", {
58
58
  jurisdiction: input.jurisdictionId,
59
- sprinklered: input.sprinklered,
60
59
  occupancy: input.occupancyGroup,
61
- space: input.spaceType,
62
60
  room: input.roomType,
61
+ space: input.spaceType,
62
+ sprinklered: input.sprinklered,
63
63
  }, signal);
64
64
  }
65
65
  /**
@@ -93,7 +93,7 @@ export class CodesClient {
93
93
  * // `unverified` means no comparable rating is on file — common, never a pass.
94
94
  * const blocked = advisory.results.filter((r) => r.summary?.status === "shortfall");
95
95
  */
96
- advisory(input, signal) {
97
- return this.#transport.post("resolveCodeAdvisory", input, signal);
96
+ async advisory(input, signal) {
97
+ return await this.#transport.post("resolveCodeAdvisory", input, signal);
98
98
  }
99
99
  }
package/codes-types.d.ts CHANGED
@@ -14,6 +14,7 @@
14
14
  * model code as adopted, never a legal determination.
15
15
  */
16
16
  import type { VariantId } from "./identifiers.js";
17
+ import type { FilterGroups } from "./list-variants-types.js";
17
18
  import type { OpenEnum } from "./types.js";
18
19
  /**
19
20
  * A code context: the space the registry is queried for.
@@ -47,7 +48,7 @@ import type { OpenEnum } from "./types.js";
47
48
  * locations, and the room correlations themselves — from
48
49
  * {@link CodesClient.context}. Nothing here should be hardcoded.
49
50
  */
50
- export interface CodeContextRequest {
51
+ export type CodeContextRequest = {
51
52
  /** A seeded jurisdiction id (e.g. `"us-tx"`); an unknown id is a 400 listing the seeded set. */
52
53
  jurisdictionId: string;
53
54
  /**
@@ -69,29 +70,29 @@ export interface CodeContextRequest {
69
70
  roomType?: string;
70
71
  /** Whether the space is sprinklered — relaxes several fire-finish floors. No default. */
71
72
  sprinklered: boolean;
72
- }
73
- export interface CodeAdvisoryInput extends CodeContextRequest {
73
+ };
74
+ export type CodeAdvisoryInput = {
74
75
  /**
75
76
  * 1–100 opaque variant ids to badge, echoed back in `results` in this exact
76
77
  * order and cardinality (duplicates are echoed, never collapsed). Preserve
77
78
  * them verbatim — never parse or construct one.
78
79
  */
79
80
  variantIds: VariantId[];
80
- }
81
+ } & CodeContextRequest;
81
82
  /** The resolved jurisdiction the verdicts were evaluated against. */
82
- export interface CodeAdvisoryJurisdiction {
83
+ export type CodeAdvisoryJurisdiction = {
83
84
  id: string;
84
85
  name: string;
85
86
  codeFamily: string;
86
87
  edition: string;
87
88
  adoptionNote: string;
88
- }
89
+ };
89
90
  /** The echoed evaluation context (the space the badges apply to). */
90
- export interface CodeAdvisoryContext {
91
+ export type CodeAdvisoryContext = {
91
92
  occupancyGroup: string;
92
93
  spaceType: string;
93
94
  sprinklered: boolean;
94
- }
95
+ };
95
96
  /**
96
97
  * What one material is, and therefore what it was held to. `dimensions` are the
97
98
  * regulatory dimensions the material can be scored on; `basis` names which
@@ -104,7 +105,7 @@ export interface CodeAdvisoryContext {
104
105
  * list under `product_type` / `application` / `both` is a genuine intersection;
105
106
  * a full list under `unresolved` is the map falling short.
106
107
  */
107
- export interface MaterialCodeProfile {
108
+ export type MaterialCodeProfile = {
108
109
  /** The variant's accepted primary product type, or null if it has none. */
109
110
  productTypeId: string | null;
110
111
  /** The variant's accepted `applications` terms, as stored. */
@@ -112,17 +113,17 @@ export interface MaterialCodeProfile {
112
113
  /** Regulatory dimensions this material can be held to. Empty ONLY when `basis` is `unresolved`. */
113
114
  dimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
114
115
  basis: OpenEnum<"product_type" | "application" | "both" | "unresolved">;
115
- }
116
+ };
116
117
  /** Why one requirement the space imposes was excluded from this material's `requirements`. */
117
- export interface CodeRequirementExclusion {
118
+ export type CodeRequirementExclusion = {
118
119
  requirementId: string;
119
120
  dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
120
121
  reason: OpenEnum<"not_a_material_dimension">;
121
122
  /** One readable line, e.g. `"Slip resistance is not a dimension wallcovering answers for."`. */
122
123
  detail: string;
123
- }
124
+ };
124
125
  /** The threshold one requirement imposes: a class floor and/or a numeric floor. */
125
- export interface CodeRequirementThreshold {
126
+ export type CodeRequirementThreshold = {
126
127
  /** The IBC classification scale this requirement is measured on (open id). */
127
128
  scale: string;
128
129
  /** The minimum acceptable class on `scale`, or null when only a numeric floor applies. */
@@ -133,7 +134,7 @@ export interface CodeRequirementThreshold {
133
134
  value: number;
134
135
  unit: string;
135
136
  } | null;
136
- }
137
+ };
137
138
  /**
138
139
  * The accepted fact a verdict was decided from — null when the material carried
139
140
  * none, which is exactly the case that produces `verdict: "unknown"`.
@@ -143,14 +144,14 @@ export interface CodeRequirementThreshold {
143
144
  * `derived` value at low confidence is a materially different statement from one
144
145
  * resting on a `tested` figure.
145
146
  */
146
- export interface CodeRequirementEvidence {
147
+ export type CodeRequirementEvidence = {
147
148
  attributeId: OpenEnum<"fire_classifications" | "slip_resistance_dcof">;
148
149
  value: string;
149
150
  confidence: number | null;
150
151
  sourceBasis: string | null;
151
- }
152
+ };
152
153
  /** One requirement badged against one material. */
153
- export interface CodeRequirementVerdict {
154
+ export type CodeRequirementVerdict = {
154
155
  requirementId: string;
155
156
  dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
156
157
  section: string;
@@ -167,13 +168,13 @@ export interface CodeRequirementVerdict {
167
168
  evidence: CodeRequirementEvidence | null;
168
169
  /** The AHJ advisory caveat — model code as adopted, never a legal determination. */
169
170
  caveat: string;
170
- }
171
+ };
171
172
  /**
172
173
  * One candidate's requirement verdicts folded into a single status and sentence.
173
174
  * A shortfall outranks an unknown, and an unknown NEVER rolls up to a pass:
174
175
  * `not_applicable` (nothing applied) is deliberately distinct from `meets`.
175
176
  */
176
- export interface CodeAdvisorySummary {
177
+ export type CodeAdvisorySummary = {
177
178
  /**
178
179
  * The rolled-up card, and what each token licenses:
179
180
  * - `meets` — every applicable requirement was `meets`. Advisory pass.
@@ -189,9 +190,9 @@ export interface CodeAdvisorySummary {
189
190
  headline: string;
190
191
  shortfallDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
191
192
  unverifiedDimensions: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
192
- }
193
+ };
193
194
  /** Per-variant advisory outcome, in input order. */
194
- export interface CodeAdvisoryVariantResult {
195
+ export type CodeAdvisoryVariantResult = {
195
196
  /** Opaque — echoed verbatim from `variantIds`, in that position. */
196
197
  variantId: VariantId;
197
198
  /** `evaluated` when the id resolved; `unknown_variant` (with `requirements: []`) when it did not. */
@@ -204,9 +205,9 @@ export interface CodeAdvisoryVariantResult {
204
205
  notApplicable: CodeRequirementExclusion[];
205
206
  /** The rolled-up card, or null for an id that resolved to nothing. */
206
207
  summary: CodeAdvisorySummary | null;
207
- }
208
+ };
208
209
  /** The `POST /api/v1/codes/advisory` envelope — per-variant, per-requirement verdicts. */
209
- export interface CodeAdvisoryResponse {
210
+ export type CodeAdvisoryResponse = {
210
211
  jurisdiction: CodeAdvisoryJurisdiction;
211
212
  /** The context AS SUPPLIED, echoed verbatim. */
212
213
  context: CodeAdvisoryContext;
@@ -215,9 +216,9 @@ export interface CodeAdvisoryResponse {
215
216
  /** The AHJ advisory caveat, at the envelope level too. */
216
217
  caveat: string;
217
218
  results: CodeAdvisoryVariantResult[];
218
- }
219
+ };
219
220
  /** Where a resolved axis came from: stated outright, or correlated from a room type. */
220
- export interface ResolvedCodeContext {
221
+ export type ResolvedCodeContext = {
221
222
  jurisdictionId: string;
222
223
  occupancyGroup: string;
223
224
  /** The canonical finish-location term id the registry was queried with. */
@@ -226,7 +227,7 @@ export interface ResolvedCodeContext {
226
227
  basis: OpenEnum<"explicit" | "derived_from_room">;
227
228
  /** The `room` term the axes were correlated from, or null. */
228
229
  roomType: string | null;
229
- }
230
+ };
230
231
  /**
231
232
  * How far a jurisdiction's rows have been reviewed against that AHJ's own tables.
232
233
  *
@@ -236,7 +237,7 @@ export interface ResolvedCodeContext {
236
237
  * say "per model IBC" rather than naming the jurisdiction as the authority.
237
238
  */
238
239
  export type CodeCoverageTier = OpenEnum<"thorough" | "model_baseline">;
239
- export interface CodeJurisdictionSummary {
240
+ export type CodeJurisdictionSummary = {
240
241
  id: string;
241
242
  name: string;
242
243
  codeFamily: string;
@@ -244,9 +245,9 @@ export interface CodeJurisdictionSummary {
244
245
  coverage: CodeCoverageTier;
245
246
  /** One honest line on how the model code actually applies in this jurisdiction. */
246
247
  adoptionNote: string;
247
- }
248
+ };
248
249
  /** The `GET /api/v1/codes/context` envelope — the vocabulary for stating a context. */
249
- export interface CodeContextResponse {
250
+ export type CodeContextResponse = {
250
251
  jurisdictions: CodeJurisdictionSummary[];
251
252
  occupancyGroups: {
252
253
  id: string;
@@ -280,9 +281,9 @@ export interface CodeContextResponse {
280
281
  }[];
281
282
  /** The AHJ advisory caveat. */
282
283
  caveat: string;
283
- }
284
+ };
284
285
  /** One requirement a context imposes, independent of any candidate material. */
285
- export interface CodeRequirementListing {
286
+ export type CodeRequirementListing = {
286
287
  requirementId: string;
287
288
  dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
288
289
  /** The code section this demand is cited from. */
@@ -291,14 +292,34 @@ export interface CodeRequirementListing {
291
292
  requirement: CodeRequirementThreshold;
292
293
  /** One readable line, e.g. `"Class A or better · ASTM E84 / UL 723"`. */
293
294
  label: string;
294
- }
295
+ };
296
+ /** Why one requirement the context imposes could not become a `list_variants` filter predicate. */
297
+ export type CodeSpecFilterUnexpressible = {
298
+ requirementId: string;
299
+ dimension: OpenEnum<"fire" | "floor" | "slip" | "decorative">;
300
+ reason: OpenEnum<"no_matchable_tokens" | "unsupported_scale" | "no_floor">;
301
+ /** One readable line naming why, e.g. `"Scale ... has no ordinal definition..."`. */
302
+ detail: string;
303
+ };
295
304
  /**
296
305
  * The `GET /api/v1/codes/requirements` envelope. An empty `requirements` array
297
306
  * means the registry holds nothing for this context — it is not a pass.
298
307
  */
299
- export interface CodeRequirementsResponse {
308
+ export type CodeRequirementsResponse = {
300
309
  jurisdiction: CodeJurisdictionSummary;
301
310
  context: ResolvedCodeContext;
302
311
  requirements: CodeRequirementListing[];
312
+ /**
313
+ * The same requirements as a ready-to-use `list_variants` `filters` group
314
+ * (MG-2222, `{terms, numbers, presence}`) — pass it straight through as
315
+ * `listVariants({ filters })`.
316
+ * `null` when nothing here is filterable; read `specFilterUnexpressible`
317
+ * for why, not an empty `requirements` list.
318
+ */
319
+ specFilter: FilterGroups | null;
320
+ /** The dimensions `specFilter` actually narrows on — a subset of `requirements`' dimensions. */
321
+ specFilterApplied: OpenEnum<"fire" | "floor" | "slip" | "decorative">[];
322
+ /** Requirements that could not be turned into a filter predicate, and why. */
323
+ specFilterUnexpressible: CodeSpecFilterUnexpressible[];
303
324
  caveat: string;
304
- }
325
+ };
@@ -17,7 +17,7 @@ export type CategoryTier = OpenEnum<"group" | "type" | "merged">;
17
17
  /** How the endpoint picks which colours to keep. */
18
18
  export type ColourProfileSelect = OpenEnum<"frequency" | "diverse">;
19
19
  /** One representative colour bucket of a category. */
20
- export interface CategoryColour {
20
+ export type CategoryColour = {
21
21
  hex: string;
22
22
  oklab: {
23
23
  l: number;
@@ -27,8 +27,8 @@ export interface CategoryColour {
27
27
  variantCount: number;
28
28
  /** This bucket's share of the category's coloured variants, 0–1. */
29
29
  proportion: number;
30
- }
31
- export interface CategoryColourProfile {
30
+ };
31
+ export type CategoryColourProfile = {
32
32
  categoryKey: string;
33
33
  level: CategoryTier;
34
34
  name: string;
@@ -42,22 +42,22 @@ export interface CategoryColourProfile {
42
42
  avgLightness: number;
43
43
  avgChroma: number;
44
44
  colours: CategoryColour[];
45
- }
45
+ };
46
46
  /**
47
47
  * The snapshot a profile response was computed from. Compare `variantCount`
48
48
  * against `colours/stats`' `corpus.withColour` to see how complete the
49
49
  * underlying materialized view currently is, and `refreshedAt` for its age.
50
50
  */
51
- export interface CategoryColourProfilesBasis {
51
+ export type CategoryColourProfilesBasis = {
52
52
  variantCount: number;
53
53
  refreshedAt: string | null;
54
- }
55
- export interface CategoryColourProfilesResponse {
54
+ };
55
+ export type CategoryColourProfilesResponse = {
56
56
  profiles: CategoryColourProfile[];
57
57
  basis: CategoryColourProfilesBasis;
58
- }
58
+ };
59
59
  /** Request parameters for `colours.profiles()`. */
60
- export interface ColourProfilesParams {
60
+ export type ColourProfilesParams = {
61
61
  /** 1–8 category keys, at the tier named by `groupBy`. */
62
62
  productTypeIds: readonly string[];
63
63
  /**
@@ -69,31 +69,31 @@ export interface ColourProfilesParams {
69
69
  topN?: number;
70
70
  /** `"diverse"` maximises visual distinctness instead of frequency. */
71
71
  select?: "frequency" | "diverse";
72
- }
73
- export interface ColourStatsCorpus {
72
+ };
73
+ export type ColourStatsCorpus = {
74
74
  variants: number;
75
75
  withColour: number;
76
76
  /** `withColour / variants`, 0–1. */
77
77
  coverage: number;
78
- }
79
- export interface ColourStatsFamily {
78
+ };
79
+ export type ColourStatsFamily = {
80
80
  id: string;
81
81
  label: string;
82
82
  variants: number;
83
83
  brands: number;
84
- }
85
- export interface ColourStatsGroup {
84
+ };
85
+ export type ColourStatsGroup = {
86
86
  key: string;
87
87
  name: string;
88
88
  productTypes: number;
89
89
  variants: number;
90
- }
90
+ };
91
91
  /**
92
92
  * One cell of the brand x category x colour-family matrix — the shape that
93
93
  * answers questions no single dimension can, such as "how many whites does
94
94
  * Benjamin Moore offer in paint".
95
95
  */
96
- export interface ColourStatsRow {
96
+ export type ColourStatsRow = {
97
97
  /** Opaque brand id — the join key for brand reads. Never parse it. */
98
98
  brandId: string;
99
99
  brandSlug: string;
@@ -110,9 +110,9 @@ export interface ColourStatsRow {
110
110
  * `colour_family`. Not every variant of the brand.
111
111
  */
112
112
  variants: number;
113
- }
113
+ };
114
114
  /** How to narrow the matrix. Passing ANY of these asks for `rows`. */
115
- export interface ColourStatsParams {
115
+ export type ColourStatsParams = {
116
116
  /** `"brand,category"` — ask for the whole matrix, unscoped. */
117
117
  groupBy?: string;
118
118
  brandId?: string;
@@ -124,9 +124,9 @@ export interface ColourStatsParams {
124
124
  categoryKey?: string;
125
125
  family?: string;
126
126
  limit?: number;
127
- }
127
+ };
128
128
  /** Where each section came from, how fresh it is, and what it does NOT answer. */
129
- export interface ColourStatsBasis {
129
+ export type ColourStatsBasis = {
130
130
  corpus: string;
131
131
  families: string;
132
132
  groups: string;
@@ -139,8 +139,8 @@ export interface ColourStatsBasis {
139
139
  */
140
140
  rows?: string;
141
141
  omissions: string[];
142
- }
143
- export interface ColourStatsResponse {
142
+ };
143
+ export type ColourStatsResponse = {
144
144
  corpus: ColourStatsCorpus;
145
145
  families: ColourStatsFamily[];
146
146
  groups: ColourStatsGroup[];
@@ -160,4 +160,4 @@ export interface ColourStatsResponse {
160
160
  /** TRUE when the matrix exceeded the cap and `rows` is a prefix. */
161
161
  rowsTruncated?: boolean;
162
162
  basis: ColourStatsBasis;
163
- }
163
+ };
@@ -9,8 +9,8 @@ import type { SdkOperationId } from "./operations.js";
9
9
  * client facade: "how much colour does the graph hold at all" (`stats`), "what
10
10
  * colours does this category come in" (`profiles`), "what goes with these
11
11
  * colours" (`palette`), and "what moves from this colour to that one"
12
- * (`gradient`). `mg.codes` and `mg.browse` set the precedent for a namespace
13
- * when a capability is a family rather than a single verb.
12
+ * (`gradient`). `mg.codes` sets the precedent for a namespace when a
13
+ * capability is a family rather than a single verb.
14
14
  *
15
15
  * The namespace holds no transport of its own: the client hands it a bound
16
16
  * `get`/`post`, so auth, rate-limit accounting and error shaping stay in one
@@ -28,27 +28,22 @@ import type { SdkOperationId } from "./operations.js";
28
28
  * convenience wrapper.
29
29
  * - A colour NAME rather than a hex → `mg.resolveColour(name)` first.
30
30
  * - Colour WORDS (families, moods, undertones) → `mg.colourFacets()`.
31
- * - Walking the corpus by lightness/vividness → `mg.browse({ sort })`.
32
- * - Colour as one signal among words, a seed and a mood → `mg.search(...)`.
31
+ * - Walking the corpus by lightness/vividness → `mg.listVariants({ orderBy })`.
32
+ * - Colour as one signal among words and a seed → `mg.search(...)`.
33
33
  *
34
34
  * And the honesty rule the whole lens rests on: every colour here is DERIVED
35
35
  * FROM PRODUCT IMAGERY, not declared by the manufacturer. Report visual
36
36
  * likeness, never a stated colour specification.
37
37
  */
38
- import type { PaletteCompleteInput, PaletteCompleteResponse, PaletteDiscoverInput, PaletteDiscoverResponse } from "./palette-completion-types.js";
39
38
  import type { SearchGradientInput, SearchGradientResponse, SearchPaletteInput, SearchPaletteResponse } from "./palette-search-types.js";
40
39
  /** The client's own request primitives, handed down so this file owns no transport. */
41
- export interface ColoursTransport {
40
+ export type ColoursTransport = {
42
41
  get<T>(operationId: SdkOperationId, query?: QueryParams, signal?: AbortSignal): Promise<T>;
43
42
  post<T>(operationId: SdkOperationId, body: unknown, signal?: AbortSignal): Promise<T>;
44
- }
43
+ };
45
44
  export declare class ColoursClient {
46
45
  #private;
47
46
  constructor(transport: ColoursTransport);
48
- /** Complete exact retained colors against a shared published interior reference. No Cart mutation. */
49
- complete(input: PaletteCompleteInput, signal?: AbortSignal): Promise<PaletteCompleteResponse>;
50
- /** Browse diverse published interior compositions against a version-pinned eligible catalogue. */
51
- discover(input: PaletteDiscoverInput, signal?: AbortSignal): Promise<PaletteDiscoverResponse>;
52
47
  /**
53
48
  * THE QUESTION: "what colours does this CATEGORY come in?" — the representative
54
49
  * palette of 1–8 categories in ONE call (GET `/api/v1/colours/profiles`).
package/colours-client.js CHANGED
@@ -3,14 +3,6 @@ export class ColoursClient {
3
3
  constructor(transport) {
4
4
  this.#transport = transport;
5
5
  }
6
- /** Complete exact retained colors against a shared published interior reference. No Cart mutation. */
7
- complete(input, signal) {
8
- return this.#transport.post("complete_interior_palette", input, signal);
9
- }
10
- /** Browse diverse published interior compositions against a version-pinned eligible catalogue. */
11
- discover(input, signal) {
12
- return this.#transport.get("discover_interior_palettes", { ...input }, signal);
13
- }
14
6
  /**
15
7
  * THE QUESTION: "what colours does this CATEGORY come in?" — the representative
16
8
  * palette of 1–8 categories in ONE call (GET `/api/v1/colours/profiles`).
@@ -39,12 +31,12 @@ export class ColoursClient {
39
31
  * A selected category with no colour data comes back as a zero-count profile,
40
32
  * not a missing key.
41
33
  */
42
- profiles(params, signal) {
43
- return this.#transport.get("get_category_colour_profiles", {
44
- productTypeIds: params.productTypeIds.join(","),
34
+ async profiles(params, signal) {
35
+ return await this.#transport.get("get_category_colour_profiles", {
45
36
  groupBy: params.groupBy,
46
- topN: params.topN,
37
+ productTypeIds: params.productTypeIds.join(","),
47
38
  select: params.select,
39
+ topN: params.topN,
48
40
  }, signal);
49
41
  }
50
42
  /**
@@ -68,13 +60,13 @@ export class ColoursClient {
68
60
  * `brandSlug` to join on. Without any of those parameters the payload is the
69
61
  * platform-wide one and `rows` is absent. `families` is never scoped by them.
70
62
  */
71
- stats(params = {}, signal) {
72
- return this.#transport.get("get_colour_stats", {
73
- groupBy: params.groupBy,
63
+ async stats(params = {}, signal) {
64
+ return await this.#transport.get("get_colour_stats", {
74
65
  brandId: params.brandId,
75
66
  brandSlug: params.brandSlug,
76
67
  categoryKey: params.categoryKey,
77
68
  family: params.family,
69
+ groupBy: params.groupBy,
78
70
  limit: params.limit,
79
71
  }, signal);
80
72
  }
@@ -109,8 +101,8 @@ export class ColoursClient {
109
101
  * ],
110
102
  * });
111
103
  */
112
- palette(input, signal) {
113
- return this.#transport.post("search_by_palette", input, signal);
104
+ async palette(input, signal) {
105
+ return await this.#transport.post("search_by_palette", input, signal);
114
106
  }
115
107
  /**
116
108
  * THE QUESTION: "what moves from this colour to that one?" — materials that
@@ -124,7 +116,7 @@ export class ColoursClient {
124
116
  * one that travels the whole way, and a flat single-colour material is
125
117
  * rejected outright however close its hue sits to the path.
126
118
  */
127
- gradient(input, signal) {
128
- return this.#transport.post("search_by_gradient", input, signal);
119
+ async gradient(input, signal) {
120
+ return await this.#transport.post("search_by_gradient", input, signal);
129
121
  }
130
122
  }
@@ -7,7 +7,7 @@
7
7
  * limit, in the same per-lens shape as `brands-client` / `codes-client` /
8
8
  * `colours-client`. Behaviour is unchanged.
9
9
  */
10
- import { HttpTransport } from "./http-transport.js";
10
+ import type { HttpTransport } from "./http-transport.js";
11
11
  import type { CoordinateInput, CoordinateResponse } from "./types.js";
12
12
  /**
13
13
  * THE QUESTION: "here is my whole scheme so far — what completes it?" The
@@ -20,4 +20,4 @@ import type { CoordinateInput, CoordinateResponse } from "./types.js";
20
20
  * scheme is COLOURS rather than materials. Check `unresolved` before presenting:
21
21
  * a reference that resolved to nothing is named there, not dropped.
22
22
  */
23
- export declare function coordinate(transport: HttpTransport, input: CoordinateInput, signal?: AbortSignal): Promise<CoordinateResponse>;
23
+ export declare const coordinate: (transport: HttpTransport, input: CoordinateInput, signal?: AbortSignal) => Promise<CoordinateResponse>;
@@ -1,13 +1,3 @@
1
- /**
2
- * The COORDINATION lens: given several materials already chosen, what completes
3
- * them. A thin wrapper over the shared {@link HttpTransport};
4
- * `MaterialGraphClient.coordinate` delegates here.
5
- *
6
- * Extracted from `client.ts`, which sits above the repository's source-size
7
- * limit, in the same per-lens shape as `brands-client` / `codes-client` /
8
- * `colours-client`. Behaviour is unchanged.
9
- */
10
- import { HttpTransport } from "./http-transport.js";
11
1
  import { resolveOperation } from "./operations.js";
12
2
  /**
13
3
  * THE QUESTION: "here is my whole scheme so far — what completes it?" The
@@ -20,6 +10,4 @@ import { resolveOperation } from "./operations.js";
20
10
  * scheme is COLOURS rather than materials. Check `unresolved` before presenting:
21
11
  * a reference that resolved to nothing is named there, not dropped.
22
12
  */
23
- export function coordinate(transport, input, signal) {
24
- return transport.requestJson(resolveOperation("coordinate_materials"), { body: input, signal });
25
- }
13
+ export const coordinate = async (transport, input, signal) => await transport.requestJson(resolveOperation("coordinate_materials"), { body: input, signal });
@@ -22,7 +22,7 @@
22
22
  * and this build does not, so a new scope is not a compile error in a client
23
23
  * that simply has not been republished yet.
24
24
  */
25
- import { type OpenEnum } from "./types.js";
25
+ import type { OpenEnum } from "./types.js";
26
26
  /**
27
27
  * Every corpus a caller may ask for.
28
28
  *
@@ -50,8 +50,8 @@ export type CorpusScope = OpenEnum<"samplizeCatalogue" | "all" | "designShopOrde
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 interface CorpusScopeReceipt {
53
+ export type CorpusScopeReceipt = {
54
54
  scope: CorpusScope;
55
55
  /** What the scope admits, in one sentence, for a human reader. */
56
56
  description: string;
57
- }
57
+ };
@@ -1,25 +1 @@
1
- /**
2
- * The corpus scope vocabulary, declared ONCE for the whole client.
3
- *
4
- * ── Why this file exists ──
5
- * Until MG-1168 the union was spelled inline at six places across the SDK, and
6
- * five of them had gone stale: `designShopOrderable` shipped in MG-1144 and
7
- * reached only the search request type, so a TypeScript consumer could send the
8
- * scope to `/search` and not to `/browse` — against a server that had accepted
9
- * it on both since the day it landed. The narrowed RECEIPT types were worse
10
- * than the request ones, because a caller could not even name the scope it got
11
- * back.
12
- *
13
- * That is the third hop of the reachability checklist failing quietly: server
14
- * correct, published client unable to reach the surface. One alias means the
15
- * next member is one edit here rather than six edits nobody is reminded to
16
- * make. `corpus-scope-parity.test.ts` in `apps/web/config` fails if this file
17
- * falls behind `CORPUS_SCOPES`.
18
- *
19
- * ── Why `OpenEnum` ──
20
- * The server may add a scope before a consumer upgrades. `OpenEnum` keeps the
21
- * known members as autocomplete while still accepting a string the server knows
22
- * and this build does not, so a new scope is not a compile error in a client
23
- * that simply has not been republished yet.
24
- */
25
- import {} from "./types.js";
1
+ export {};