@instruments/materialgraph 0.29.0 → 0.30.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 (80) hide show
  1. package/brands-client.d.ts +1 -1
  2. package/by-colour-types.d.ts +4 -4
  3. package/catalogue-client.d.ts +3 -3
  4. package/catalogue-client.js +3 -3
  5. package/catalogue-types.d.ts +1 -1
  6. package/client-vocabulary.d.ts +3 -5
  7. package/client-vocabulary.js +9 -6
  8. package/client.d.ts +73 -174
  9. package/client.js +85 -211
  10. package/colour-region-types.d.ts +18 -0
  11. package/colours-client.d.ts +10 -83
  12. package/colours-client.js +1 -85
  13. package/find-variants-by-colour-types.d.ts +197 -0
  14. package/find-variants-by-vector-types.d.ts +67 -0
  15. package/find-variants-by-vector-types.js +5 -0
  16. package/get-variant-types.d.ts +50 -0
  17. package/get-variant-types.js +10 -0
  18. package/identifiers.d.ts +1 -1
  19. package/identifiers.js +1 -1
  20. package/image-reference-types.d.ts +18 -0
  21. package/index.d.ts +8 -7
  22. package/index.js +1 -1
  23. package/list-enum-values-types.d.ts +58 -0
  24. package/list-variants-types.d.ts +6 -2
  25. package/material-asset-types.d.ts +2 -2
  26. package/material-types.d.ts +11 -150
  27. package/operations.d.ts +1 -1
  28. package/operations.js +26 -88
  29. package/package.json +1 -1
  30. package/palette-search-types.d.ts +3 -49
  31. package/resolve-colour-types.d.ts +5 -5
  32. package/resolve-variant-types.d.ts +75 -0
  33. package/{identify-types.js → resolve-variant-types.js} +2 -2
  34. package/response-schemas.generated.d.ts +1 -1
  35. package/response-schemas.generated.js +45 -84
  36. package/run-types.d.ts +23 -216
  37. package/runs.d.ts +10 -58
  38. package/runs.js +19 -106
  39. package/schema-resource-types.d.ts +2 -139
  40. package/schema-resource-types.js +0 -8
  41. package/search-card-types.d.ts +1 -1
  42. package/search-index-plan-types.d.ts +4 -1
  43. package/search-request-types.d.ts +10 -2
  44. package/spec-types.d.ts +4 -4
  45. package/spec-types.js +2 -2
  46. package/sse.d.ts +2 -2
  47. package/sse.js +2 -2
  48. package/types.d.ts +4 -38
  49. package/webmcp.generated.js +3 -3
  50. package/workflows-client.d.ts +54 -0
  51. package/workflows-client.js +41 -0
  52. package/client-source-material-comments.d.ts +0 -51
  53. package/client-source-material-comments.js +0 -6
  54. package/codes-client.d.ts +0 -118
  55. package/codes-client.js +0 -99
  56. package/codes-types.d.ts +0 -325
  57. package/colour-aggregate-types.d.ts +0 -163
  58. package/coordinate-client.d.ts +0 -23
  59. package/coordinate-client.js +0 -13
  60. package/demand-batch-types.d.ts +0 -118
  61. package/demand-types.d.ts +0 -154
  62. package/identify-types.d.ts +0 -82
  63. package/material-composition-client.d.ts +0 -21
  64. package/material-composition-client.js +0 -13
  65. package/material-composition-types.d.ts +0 -403
  66. package/material-composition-types.js +0 -1
  67. package/source-material-validation.d.ts +0 -7
  68. package/source-material-validation.js +0 -214
  69. package/spec-facet-types.d.ts +0 -48
  70. package/spec-facet-types.js +0 -7
  71. package/substitute-types.d.ts +0 -102
  72. package/substitute-types.js +0 -1
  73. package/suggest-types.d.ts +0 -67
  74. package/suggest-types.js +0 -28
  75. package/taxonomy-coverage-types.d.ts +0 -34
  76. package/taxonomy-coverage-types.js +0 -1
  77. /package/{codes-types.js → colour-region-types.js} +0 -0
  78. /package/{colour-aggregate-types.js → find-variants-by-colour-types.js} +0 -0
  79. /package/{demand-batch-types.js → image-reference-types.js} +0 -0
  80. /package/{demand-types.js → list-enum-values-types.js} +0 -0
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * A brand is a COMPANY, not a catalogue. Every count this read returns is
7
7
  * coverage — what MaterialGraph has ingested — and never a claim about how
8
- * many products the maker sells.
8
+ * many products the brand sells.
9
9
  */
10
10
  import type { BrandCatalogListPage, BrandsOptions } from "./brand-types.js";
11
11
  import type { HttpTransport } from "./http-transport.js";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Wire types for the single-colour lane — GET `/api/v1/search/colours`.
3
3
  *
4
- * Kept out of `types.ts` for the same reason `palette-search-types.ts` and
5
- * `colour-aggregate-types.ts` are: the shared mirror is at its source-size
6
- * budget. Same tolerant-parsing contract as the rest of the mirror — response
7
- * enums are widened so a new server value still type-checks.
4
+ * Kept out of `types.ts` for the same reason `palette-search-types.ts` is: the
5
+ * shared mirror is at its source-size budget. Same tolerant-parsing contract as
6
+ * the rest of the mirror — response enums are widened so a new server value
7
+ * still type-checks.
8
8
  */
9
9
  import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
10
10
  import type { VariantId } from "./identifiers.js";
@@ -1,7 +1,7 @@
1
1
  import type { CatalogDocumentList, CatalogPageListResult, CatalogProductReferenceReadResult, CatalogueChannelCollectionsResponse, CatalogueCollectionsOptions, CatalogueDocumentAccessResult, CataloguePageRepresentationReadResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
2
2
  import type { HttpTransport } from "./http-transport.js";
3
3
  import type { VariantId } from "./identifiers.js";
4
- import type { IdentifyResponse, IdentifyVariantInput } from "./identify-types.js";
4
+ import type { ResolveVariantInput, ResolveVariantOutput } from "./resolve-variant-types.js";
5
5
  import type { SamplizeCatalogueOptions, SamplizeCataloguePage } from "./samplize-catalogue-types.js";
6
6
  import type { SamplizeColorVecCache } from "./samplize-colorvec.js";
7
7
  /** Catalogue publication operations inherited by the public SDK client. */
@@ -15,12 +15,12 @@ export declare class CatalogueClient {
15
15
  * when there is no page to read.
16
16
  *
17
17
  * Exact and scoreless: a sibling colourway, a similar image or a brand match
18
- * alone never identifies a variant. Read `data.outcome` - `identified` names
18
+ * alone never identifies a variant. Read `outcome` - `identified` names
19
19
  * an exact stored variant, `placed` an exact brand with no variant match,
20
20
  * `ambiguous` carries bounded `candidates`, and `unresolved` states why,
21
21
  * never a guess. The submitted URL is never persisted.
22
22
  */
23
- identify(input: IdentifyVariantInput, signal?: AbortSignal): Promise<IdentifyResponse>;
23
+ resolveVariant(input: ResolveVariantInput, signal?: AbortSignal): Promise<ResolveVariantOutput>;
24
24
  /** Complete producer-owned vectors and classifications for portable colour matching. */
25
25
  samplizeColorVecCache(sourceVersion: string, signal?: AbortSignal): Promise<SamplizeColorVecCache>;
26
26
  /** MG-owned full-catalogue facets and directional colour refinement before page limiting. */
@@ -12,13 +12,13 @@ export class CatalogueClient {
12
12
  * when there is no page to read.
13
13
  *
14
14
  * Exact and scoreless: a sibling colourway, a similar image or a brand match
15
- * alone never identifies a variant. Read `data.outcome` - `identified` names
15
+ * alone never identifies a variant. Read `outcome` - `identified` names
16
16
  * an exact stored variant, `placed` an exact brand with no variant match,
17
17
  * `ambiguous` carries bounded `candidates`, and `unresolved` states why,
18
18
  * never a guess. The submitted URL is never persisted.
19
19
  */
20
- async identify(input, signal) {
21
- return await this.#transport.requestJson(resolveOperation("retrieval.identify"), { body: input, signal });
20
+ async resolveVariant(input, signal) {
21
+ return await this.#transport.requestJson(resolveOperation("resolve_variant"), { body: input, signal });
22
22
  }
23
23
  /** Complete producer-owned vectors and classifications for portable colour matching. */
24
24
  async samplizeColorVecCache(sourceVersion, signal) {
@@ -65,7 +65,7 @@ export interface CatalogueReference {
65
65
  export type CatalogueReferenceAbsenceReason =
66
66
  /**
67
67
  * The registry retains no publication for the variant's brand. It says
68
- * nothing about whether the maker publishes one.
68
+ * nothing about whether the brand publishes one.
69
69
  */
70
70
  "no_publication_on_record"
71
71
  /** The edition is known but its document is not retained. */
@@ -1,8 +1,6 @@
1
1
  import type { HttpTransport } from "./http-transport.js";
2
- import type { ListAttributesOptions, ListAttributesResult, ResolveColourOptions, ResolveColourResponse, SuggestColourResponse, SuggestOptions, SuggestResponse } from "./types.js";
2
+ import type { ListEnumValuesOptions, ListEnumValuesResult } from "./list-enum-values-types.js";
3
+ import type { ListAttributesOptions, ListAttributesResult, ResolveColourOptions, ResolveColourResponse } from "./types.js";
3
4
  export declare const resolveColour: (transport: HttpTransport, name: string, signal?: AbortSignal, options?: ResolveColourOptions) => Promise<ResolveColourResponse>;
4
- export declare const suggestColour: (transport: HttpTransport, q: string, options?: {
5
- limit?: number;
6
- }, signal?: AbortSignal) => Promise<SuggestColourResponse>;
7
- export declare const suggest: (transport: HttpTransport, q: string, options?: SuggestOptions, signal?: AbortSignal) => Promise<SuggestResponse>;
8
5
  export declare const listAttributes: (transport: HttpTransport, options?: ListAttributesOptions, signal?: AbortSignal) => Promise<ListAttributesResult>;
6
+ export declare const listEnumValues: (transport: HttpTransport, options?: ListEnumValuesOptions, signal?: AbortSignal) => Promise<ListEnumValuesResult>;
@@ -1,11 +1,5 @@
1
1
  import { resolveOperation } from "./operations.js";
2
- import { suggestQuery } from "./suggest-types.js";
3
2
  export const resolveColour = async (transport, name, signal, options) => await transport.requestJson(resolveOperation("resolve_colour_name"), { query: { corpusScope: options?.corpusScope, name }, signal });
4
- export const suggestColour = async (transport, q, options, signal) => await transport.requestJson(resolveOperation("suggest_colour_names"), { query: { limit: options?.limit, q }, signal });
5
- export const suggest = async (transport, q, options, signal) => await transport.requestJson(resolveOperation("search_suggest"), {
6
- query: suggestQuery(q, options),
7
- signal,
8
- });
9
3
  /**
10
4
  * A comma list, or nothing at all for an empty one. `[].join(",")` is `""`, and
11
5
  * an absent parameter is the one honest spelling of "no restriction".
@@ -22,3 +16,12 @@ export const listAttributes = async (transport, options, signal) => await transp
22
16
  },
23
17
  signal,
24
18
  });
19
+ export const listEnumValues = async (transport, options, signal) => await transport.requestJson(resolveOperation("catalog_list_enum_values"), {
20
+ query: {
21
+ cursor: options?.cursor,
22
+ dictionaryId: options?.dictionaryId,
23
+ limit: options?.limit,
24
+ query: options?.query,
25
+ },
26
+ signal,
27
+ });
package/client.d.ts CHANGED
@@ -5,26 +5,25 @@ import { CatalogueClient } from "./catalogue-client.js";
5
5
  import { CategoriesClient } from "./categories-client.js";
6
6
  import type { ResolvedVerdictCitation } from "./citation-types.js";
7
7
  import type { MaterialGraphClientOptions } from "./client-config.js";
8
- import type { SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
9
- import { CodesClient } from "./codes-client.js";
10
- import type { CodeAdvisoryInput, CodeAdvisoryResponse } from "./codes-types.js";
11
8
  import { ColoursClient } from "./colours-client.js";
12
9
  import type { RateLimit } from "./errors.js";
13
- import type { BatchId, RunId, VariantId } from "./identifiers.js";
10
+ import type { FindVariantsByColourInput, FindVariantsByColourOutput } from "./find-variants-by-colour-types.js";
11
+ import type { FindVariantsByVectorInput, FindVariantsByVectorOutput } from "./find-variants-by-vector-types.js";
12
+ import type { GetVariantOptions, GetVariantOutput } from "./get-variant-types.js";
13
+ import type { VariantId } from "./identifiers.js";
14
+ import type { ListEnumValuesOptions, ListEnumValuesResult } from "./list-enum-values-types.js";
14
15
  import type { ListVariantFacetsInput, ListVariantFacetsOutput } from "./list-variant-facets-types.js";
15
16
  import type { ListVariantsInput, ListVariantsOutput } from "./list-variants-types.js";
16
17
  import type { MatchStreamEvent } from "./match-stream-types.js";
17
18
  import type { MatchAnswer, MatchInput } from "./match-types.js";
18
19
  import type { ListVariantAssetsOptions, MaterialDocumentPageOptions, VariantAssetPage } from "./material-asset-types.js";
19
- import type { CompositionCorpusSummary } from "./material-composition-types.js";
20
20
  import type { MaterialQueryPlan } from "./material-query-plan-types.js";
21
- import type { CreatePublicRunRequest, CreatePublicRunResponse, DrainRunEventsOptions, PublicRunResponse, RunEvent, SourceMaterialBatchDetail, SourceMaterialBatchReceipt, StreamRunEventsOptions, UploadSourceMaterialInput } from "./run-types.js";
21
+ import type { SourceMaterialBatchReceipt, UploadSourceMaterialInput } from "./run-types.js";
22
22
  import type { SchemaResource, SchemaResourceResponse } from "./schema-resource-types.js";
23
23
  import type { CardProjectionRequest, SearchCardResponse } from "./search-card-types.js";
24
- import type { ProductTypeCoverageOptions, ProductTypeStatusCoverage } from "./taxonomy-coverage-types.js";
25
- import type { CoordinateInput, CoordinateResponse, DemandBatchInput, DemandBatchResponse, DemandParams, DemandResponse, ExtractPaletteInput, ExtractPaletteResponse, ListAttributesOptions, ListAttributesResult, MaterialResponse, PairingsOptions, PairingsResponse, ResolveColourOptions, ResolveColourResponse, SearchGetParams, SearchInput, SearchResponse, SpecFacetsListResponse, SuggestColourResponse, SuggestOptions, SuggestResponse, WhoamiResponse } from "./types.js";
24
+ import type { ExtractPaletteInput, ExtractPaletteResponse, ListAttributesOptions, ListAttributesResult, PairingsOptions, PairingsResponse, ResolveColourOptions, ResolveColourResponse, SearchGetParams, SearchInput, SearchResponse, WhoamiResponse } from "./types.js";
25
+ import { WorkflowsClient } from "./workflows-client.js";
26
26
  export * from "./client-config.js";
27
- export type { SourceMaterialCommentsNamespace } from "./client-source-material-comments.js";
28
27
  /**
29
28
  * The MaterialGraph client — every lens on the graph, on one object.
30
29
  *
@@ -34,16 +33,15 @@ export type { SourceMaterialCommentsNamespace } from "./client-source-material-c
34
33
  * | The question | The lens |
35
34
  * | --- | --- |
36
35
  * | "find me something like this / matching these words" | {@link MaterialGraphClient.search} |
36
+ * | "tell me about THIS variant" | {@link MaterialGraphClient.getVariant} |
37
37
  * | "what's IN this photo?" | {@link MaterialGraphClient.match} / {@link MaterialGraphClient.matchStream} |
38
38
  * | "which materials, from anyone, meet this hard spec?" | {@link MaterialGraphClient.listVariants} |
39
- * | "what's near this colour / this palette / this gradient?" | {@link MaterialGraphClient.byColour}, `colours.palette()`, `colours.gradient()` |
40
- * | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways), {@link MaterialGraphClient.coordinate} |
39
+ * | "what's near this colour / this palette?" | {@link MaterialGraphClient.byColour}, `colours.palette()` |
40
+ * | "what goes with THIS material?" | {@link MaterialGraphClient.pairings}, {@link MaterialGraphClient.listVariants} (same product, other colourways) |
41
41
  * | "what does the manufacturer say is AVAILABLE on this?" | {@link MaterialGraphClient.associatedFinishes}, {@link MaterialGraphClient.associatedProducts} |
42
- * | "how much is this specified?" | {@link MaterialGraphClient.demand}, {@link MaterialGraphClient.demandBatch} |
43
- * | "is this allowed in an A-2 corridor?" | `codes.*` |
44
- * | "what can I even ask for?" | {@link MaterialGraphClient.specificationFacets}, `categories.list()` |
42
+ * | "what can I even ask for?" | {@link MaterialGraphClient.listVariantFacets}, `categories.list()` |
45
43
  * | "what is this word called here?" | {@link MaterialGraphClient.listAttributes} |
46
- * | "do the whole job for me, async" | {@link MaterialGraphClient.createRun} + `mg:compose` |
44
+ * | "do the whole job for me, async" | `workflows.start()` + `mg:compose` |
47
45
  *
48
46
  * Three structural rules that fall out of that table:
49
47
  * - **Colour is a separate lens.** {@link MaterialGraphClient.search} matches
@@ -78,35 +76,25 @@ export declare class MaterialGraphClient extends CatalogueClient {
78
76
  */
79
77
  readonly categories: CategoriesClient;
80
78
  /**
81
- * THE QUESTION: "is this material allowed HERE?" — a jurisdiction + occupancy +
82
- * finish location, not a property of the material alone. `codes.context()`
83
- * discovers the vocabulary, `codes.requirements()` states a space,
84
- * `codes.advisory()` badges candidates.
85
- *
86
- * Instead use {@link MaterialGraphClient.listVariants} to find materials by a
87
- * classification you already know you need; codes is what tells you WHICH one
88
- * the space demands. ADVISORY ONLY: model code as adopted, never a
89
- * determination for an authority having jurisdiction.
90
- */
91
- readonly codes: CodesClient;
92
- /**
93
- * THE QUESTION: "what colours exist here?" (`profiles`, `stats`) and "what
94
- * matches this whole SET of colours?" (`palette`, `gradient`).
79
+ * THE QUESTION: "what colours exist here?" and "what matches this whole SET
80
+ * of colours?" (`palette`).
95
81
  *
96
82
  * Instead use {@link MaterialGraphClient.byColour} for ONE colour and
97
83
  * {@link MaterialGraphClient.listVariants} to page through a colour's family.
98
84
  * Colour is usually derived from product imagery, which is visual likeness,
99
- * not a colour specification. A maker's declared colour, such as a paint's
85
+ * not a colour specification. A brand's declared colour, such as a paint's
100
86
  * published hex, wins where MaterialGraph holds one, and each value's
101
87
  * source basis says which.
102
88
  */
103
89
  readonly colours: ColoursClient;
104
90
  /**
105
- * THE QUESTION: "what did people say about this uploaded file, and record what
106
- * they said." Names on these remarks are REPORTED, never verified — see
107
- * {@link SourceMaterialCommentsNamespace}.
91
+ * THE QUESTION: "do a whole job for me" — the ASYNC lens. `start()` begins a
92
+ * Run of one registered workflow, `run()` polls it, `streamRunEvents()` and
93
+ * `drainRunEvents()` follow it live. Everything else on this client answers
94
+ * in one round trip; a Run may suspend for human input and finish minutes
95
+ * later. Replaces the flat `createRun()` / `run()` family, with no shim.
108
96
  */
109
- readonly sourceMaterialComments: SourceMaterialCommentsNamespace;
97
+ readonly workflows: WorkflowsClient;
110
98
  constructor(options: MaterialGraphClientOptions);
111
99
  get lastRateLimit(): RateLimit | null;
112
100
  /**
@@ -184,7 +172,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
184
172
  * palette), ranked by OKLab closeness to colour extracted from product imagery.
185
173
  *
186
174
  * Instead use `colours.palette()` for N colours at stated proportions (a
187
- * different ranking, not a wrapper), `colours.gradient()` for a transition,
175
+ * different ranking, not a wrapper),
188
176
  * {@link MaterialGraphClient.resolveColour} first if you hold a NAME,
189
177
  * {@link MaterialGraphClient.listVariants} to page through a category or a brand, and
190
178
  * {@link MaterialGraphClient.search} when colour is one signal among many.
@@ -193,36 +181,30 @@ export declare class MaterialGraphClient extends CatalogueClient {
193
181
  */
194
182
  byColour(params: ByColourParams, signal?: AbortSignal): Promise<ByColourResponse>;
195
183
  /**
196
- * THE QUESTION: "tell me everything about THIS material" (GET
197
- * `/api/v1/materials/{variantId}`).
184
+ * THE QUESTION: "tell me about THIS variant" (GET
185
+ * `/api/v1/variants/{variantId}`, `get_variant`).
198
186
  *
199
187
  * The hinge of the API: every relationship lens
200
- * ({@link MaterialGraphClient.listVariants}, {@link MaterialGraphClient.pairings},
201
- * {@link MaterialGraphClient.demand}, `codes.advisory()`) hangs off a
202
- * `variantId`. Instead use {@link MaterialGraphClient.listVariants} for many
203
- * ids, or for the other colourways of the same product (MG-2222 retired
204
- * this route's `?include=siblings`; ask `listVariants` with a `product in`
205
- * filter instead), {@link MaterialGraphClient.materialBlocks} to tell "no
206
- * value" from "not checked", {@link MaterialGraphClient.search} when you
207
- * have no id yet.
188
+ * ({@link MaterialGraphClient.listVariants}, {@link MaterialGraphClient.pairings})
189
+ * hangs off a `variantId`. The answer is compact on purpose: name, code,
190
+ * product, brand, category, image and page. Name `attributes` and `blocks`
191
+ * to add their values under `specifications`; a null value is unknown, never
192
+ * false or zero. Instead use {@link MaterialGraphClient.listVariants} for many
193
+ * ids, or for the other colourways of the same product (ask `listVariants`
194
+ * with a `product in` filter),
195
+ * {@link MaterialGraphClient.materialBlocks} to tell "no value" from "not
196
+ * checked", {@link MaterialGraphClient.search} when you have no id yet.
208
197
  *
209
198
  * @param variantId Opaque — pass back exactly what you were given.
210
199
  */
211
- material(variantId: VariantId, signal?: AbortSignal): Promise<MaterialResponse>;
200
+ getVariant(variantId: VariantId, options?: GetVariantOptions, signal?: AbortSignal): Promise<GetVariantOutput>;
212
201
  materialBlocks(variantId: VariantId, signal?: AbortSignal): Promise<import("./material-block-types.js").MaterialBlockProjection>;
213
- /**
214
- * THE QUESTION: "which product types can composition be answered for yet?"
215
- *
216
- * Coverage per product type, in Live SKUs as well as tuples. Read the SKU
217
- * figure: one tuple can carry a hundred thousand SKUs or one.
218
- */
219
- compositionReport(signal?: AbortSignal): Promise<CompositionCorpusSummary>;
220
202
  listVariantAssets(variantId: VariantId, options?: ListVariantAssetsOptions, signal?: AbortSignal): Promise<VariantAssetPage>;
221
203
  materialDocuments(variantId: VariantId, options?: MaterialDocumentPageOptions, signal?: AbortSignal): Promise<import("./material-asset-types.js").MaterialDocumentPage>;
222
204
  /**
223
205
  * THE QUESTION: "what does the schema DEFINE?" — the governed static registry.
224
206
  *
225
- * Definitions, not data: use {@link MaterialGraphClient.specificationFacets} for
207
+ * Definitions, not data: use {@link MaterialGraphClient.listVariantFacets} for
226
208
  * what the corpus actually holds.
227
209
  */
228
210
  schema<K extends SchemaResource>(resource: K, signal?: AbortSignal): Promise<SchemaResourceResponse<K>>;
@@ -230,8 +212,7 @@ export declare class MaterialGraphClient extends CatalogueClient {
230
212
  * THE QUESTION: "what goes WITH this material?" — the companionship rail, hung
231
213
  * off one resolved material (GET `/api/v1/materials/{variantId}/pairings`).
232
214
  *
233
- * Instead use {@link MaterialGraphClient.coordinate} for a whole palette of
234
- * picks, {@link MaterialGraphClient.listVariants} for the same product in
215
+ * Instead use {@link MaterialGraphClient.listVariants} for the same product in
235
216
  * another colour, and `search({ similarTo })` for a LIKE-THIS substitute —
236
217
  * similar and complementary are opposite questions.
237
218
  *
@@ -254,10 +235,11 @@ export declare class MaterialGraphClient extends CatalogueClient {
254
235
  * of a product (`{terms: [{field: "product", op: "in", values:
255
236
  * [productId]}, {field: "variant", op: "not_in", values: [variantId]}]}` —
256
237
  * `filters` is kind-grouped, `{terms, numbers, presence}`, every condition
257
- * across all three ANDed), or a category/maker listing. An explicit
238
+ * across all three ANDed), or a category/brand listing. An explicit
258
239
  * `variant in` id that does not resolve to an eligible variant is
259
- * reported in `unresolvedVariantIds`, never silently dropped from the
260
- * page.
240
+ * reported in `unresolvedVariantIds`, or in `excludedByCorpusScope` when
241
+ * it names a real variant outside the materials catalogue, never silently
242
+ * dropped from the page.
261
243
  *
262
244
  * `filters`/`optionalFilters`/`orderBy` are sent as URL-encoded JSON;
263
245
  * `attributes`/`include` as comma-separated lists — the server validates,
@@ -272,14 +254,29 @@ export declare class MaterialGraphClient extends CatalogueClient {
272
254
  * `listVariants()` takes; the server validates both.
273
255
  */
274
256
  listVariantFacets(input: ListVariantFacetsInput, signal?: AbortSignal): Promise<ListVariantFacetsOutput>;
257
+ /**
258
+ * THE QUESTION: "which variants hold, resemble, or can be ranked by, this
259
+ * colour?" (POST `/api/v1/variants/by-colour`, MG-2217/MG-2230/MG-2247).
260
+ * One required `mode`: `contains` (a swatch for every required `colours[]`
261
+ * condition), `palette` (whole-palette closeness to `colours[]`, an
262
+ * image's extracted palette, or `targetVariantId`'s own palette) or
263
+ * `rerank` (reorder a held `variantIds` set by colour closeness). Use
264
+ * {@link MaterialGraphClient.byColour} instead for ONE colour against the
265
+ * search index rather than the canonical variant graph.
266
+ */
267
+ findVariantsByColour(input: FindVariantsByColourInput, signal?: AbortSignal): Promise<FindVariantsByColourOutput>;
268
+ /**
269
+ * THE QUESTION: "what looks or feels like this?" (POST
270
+ * `/api/v1/variants/by-vector`, MG-2231). Eligible variants ranked by
271
+ * semantic or visual similarity to a text description (mood words count),
272
+ * an image reference, or both fused into one embedding. `filters` is the
273
+ * same tree {@link MaterialGraphClient.listVariants} takes. `query.mode`
274
+ * values other than `"text"` embed through Voyage and spend the shared
275
+ * per-key `embed` rate budget.
276
+ */
277
+ findVariantsByVector(input: FindVariantsByVectorInput, signal?: AbortSignal): Promise<FindVariantsByVectorOutput>;
275
278
  /** Resolve a colour name to its hex, and the named paint's catalogue variant. */
276
279
  resolveColour(name: string, signal?: AbortSignal, options?: ResolveColourOptions): Promise<ResolveColourResponse>;
277
- /** Ranked colour-name typeahead (GET `/api/v1/search/colours/suggest`). */
278
- suggestColour(q: string, options?: {
279
- limit?: number;
280
- }, signal?: AbortSignal): Promise<SuggestColourResponse>;
281
- /** Entity typeahead. Navigate using the selected `refId`; use `search()` for materials. */
282
- suggest(q: string, options?: SuggestOptions, signal?: AbortSignal): Promise<SuggestResponse>;
283
280
  /**
284
281
  * THE QUESTION: "which attribute means this phrase?" or "what could a
285
282
  * <category> be specified by?" (GET `/api/v1/catalog/attributes`). One page of
@@ -291,67 +288,22 @@ export declare class MaterialGraphClient extends CatalogueClient {
291
288
  */
292
289
  listAttributes(options?: ListAttributesOptions, signal?: AbortSignal): Promise<ListAttributesResult>;
293
290
  /**
294
- * Exact current primary-type status counts by retained source category path.
295
- * `comparisonThreshold` is a reporting cutoff only: it never promotes a
296
- * proposal into an accepted category.
291
+ * THE QUESTION: "which value means this phrase?" or "what may this attribute
292
+ * be set to?" (GET `/api/v1/catalog/enum-values`). One page of a value
293
+ * dictionary's allowed values, browsed by `dictionaryId` (from a
294
+ * {@link MaterialGraphClient.listAttributes} item) or found by name, alias,
295
+ * misspelling or meaning across every dictionary. Pass an item's `valueId`
296
+ * with one of its `attributeIds` to {@link MaterialGraphClient.listVariants};
297
+ * an item with no `attributeIds` cannot be filtered on. Follow
298
+ * `pageInfo.endCursor` for the next page.
297
299
  */
298
- productTypeCoverage(options?: ProductTypeCoverageOptions, signal?: AbortSignal): Promise<ProductTypeStatusCoverage>;
300
+ listEnumValues(options?: ListEnumValuesOptions, signal?: AbortSignal): Promise<ListEnumValuesResult>;
299
301
  /**
300
302
  * THE QUESTION: "what is this key allowed to do?" Check `scopes` before
301
303
  * offering a capability: the write surfaces need `mg:ingest` / `mg:compose`,
302
304
  * and `mg:admin` unlocks extra evidence fields.
303
305
  */
304
306
  whoami(signal?: AbortSignal): Promise<WhoamiResponse>;
305
- /** What completes a scheme already part-chosen. See {@link coordinateCall}. */
306
- coordinate(input: CoordinateInput, signal?: AbortSignal): Promise<CoordinateResponse>;
307
- /**
308
- * THE QUESTION: "how much is this material actually specified, and what gets
309
- * specified alongside it?" — real order behaviour, trailing 36 months.
310
- *
311
- * Instead use {@link MaterialGraphClient.demandBatch} for many ids (this one
312
- * also resolves free text, which the batch deliberately does not) and
313
- * {@link MaterialGraphClient.pairings} for a presentable rail. A null `demand`
314
- * means UNREAD, never zero. Provide EXACTLY ONE of `variantId` or `material`.
315
- */
316
- demand(params: DemandParams, signal?: AbortSignal): Promise<DemandResponse>;
317
- /**
318
- * THE QUESTION: "for each of these picks I already hold, how much momentum does
319
- * it have?" Enrichment, never discovery or ranking. Instead use
320
- * {@link MaterialGraphClient.demand} for one material named in free text and
321
- * {@link MaterialGraphClient.search} to find candidates at all. Only
322
- * `state: "available"` carries numbers; the other three mean "no number", never
323
- * "no demand".
324
- *
325
- * Enrich a bounded set of ALREADY-CHOSEN candidate ids with their real
326
- * specification demand (POST `/api/v1/demand/batch`, 1–48 ids). The bounded
327
- * batch complement to {@link demand}: no fuzzy resolution, ranking, or
328
- * reordering — each id yields one discriminated `state` (`available` /
329
- * `insufficient_data` / `no_signal` / `unknown_variant`) in input order and
330
- * cardinality. This is the Desk's "show demand momentum for every pick in this
331
- * scheme" read; an `mg:admin` key additionally sees per-result `evidence`.
332
- *
333
- * @example
334
- * // Rank a shortlist by real specification momentum before locking the scheme.
335
- * const { results } = await mg.demandBatch({
336
- * variantIds: scheme.picks.map((p) => p.variantId),
337
- * signal: "sampled",
338
- * context: { projectType: "hospitality" },
339
- * });
340
- * const rising = results.filter(
341
- * (r) => r.state === "available" && r.momentum.state === "rising",
342
- * );
343
- */
344
- demandBatch(input: DemandBatchInput, signal?: AbortSignal): Promise<DemandBatchResponse>;
345
- /**
346
- * THE QUESTION: "may I put these materials in an A-2 corridor in Texas?"
347
- *
348
- * Badge materials against the advisory building-code registry (POST
349
- * `/api/v1/codes/advisory`). Identical to {@link CodesClient.advisory}, kept
350
- * flat because it shipped before the `codes` namespace existed — prefer
351
- * `mg.codes.advisory()` in new code, and start at `mg.codes.context()` to
352
- * discover every accepted context value. `unverified` is not a pass.
353
- */
354
- codeAdvisory(input: CodeAdvisoryInput, signal?: AbortSignal): Promise<CodeAdvisoryResponse>;
355
307
  /**
356
308
  * THE QUESTION: "what colours are in this image?" — the palette only, no
357
309
  * materials. The bridge from an inspiration image into the colour lens: extract
@@ -360,68 +312,15 @@ export declare class MaterialGraphClient extends CatalogueClient {
360
312
  * {@link MaterialGraphClient.match} for the MATERIALS in the photo.
361
313
  */
362
314
  extractPalette(input: ExtractPaletteInput, signal?: AbortSignal): Promise<ExtractPaletteResponse>;
363
- /**
364
- * THE QUESTION: "what can I even filter on, and what values does the corpus
365
- * actually hold?" The start of every spec-driven workflow. Instead use
366
- * {@link MaterialGraphClient.listAttributes} with `categoryIds` for what a
367
- * product type COULD carry, {@link MaterialGraphClient.schema} for the definition.
368
- *
369
- * Discover the live specification vocabulary (GET
370
- * `/api/v1/catalog/specifications/facets`) — the facetable spec attributes that
371
- * have real product-graph data, each with its top canonical values and the
372
- * variants/brands behind them. This is where a caller LEARNS that the data
373
- * exists: LEED, GREENGUARD, ASTM E84 Class A, FloorScore, EPDs all surface here
374
- * with counts. Includes the virtual `certification_programme` facet (its values
375
- * are programme names). Learn an `attribute:value` here, then reuse it as a
376
- * {@link MaterialGraphClient.listVariants} filter leaf or a {@link search}
377
- * `filters` entry. NOTE: continuous
378
- * numeric specs (e.g. `slip_resistance_dcof`, a 0–1 DCOF range) are NOT
379
- * token-facetable and do not appear here — read those per-attribute.
380
- */
381
- specificationFacets(signal?: AbortSignal): Promise<SpecFacetsListResponse>;
382
315
  /** "Whose catalogs are in here, and how big is each?" — {@link listBrands}. */
383
316
  brands(options?: BrandsOptions, signal?: AbortSignal): Promise<import("./brand-types.js").BrandCatalogListPage>;
384
317
  /**
385
318
  * Upload one atomic source-material batch (POST `/api/v1/source-material`,
386
319
  * multipart). Pass a heterogeneous pile via `{ files }` (any mix of PDF,
387
- * text/markdown, and images — the server classifies each) or the legacy
388
- * `{ brief, references }` shape. Requires the `mg:ingest` scope.
320
+ * text/markdown, and images — the server classifies each). Requires the
321
+ * `mg:source` scope, which a `source`, `ingest` or `admin` key carries.
389
322
  */
390
323
  uploadSourceMaterial(input: UploadSourceMaterialInput, signal?: AbortSignal): Promise<SourceMaterialBatchReceipt>;
391
- /**
392
- * Read back an uploaded batch (GET `/api/v1/source-material/{batchId}`): every
393
- * file with a fetchable `url` and its analyses inlined. `analyses` is always
394
- * an array — `[]` means nothing has been computed yet. Analyses are shared by
395
- * content hash, so re-uploading an already-analysed image returns its analysis
396
- * immediately. A batch you do not own raises the same 404 as one that does not
397
- * exist. Requires the `mg:compose` scope.
398
- */
399
- sourceMaterialBatch(batchId: BatchId, signal?: AbortSignal): Promise<SourceMaterialBatchDetail>;
400
- /**
401
- * THE QUESTION: "do a whole job for me" — the ASYNC lens. Everything else here
402
- * answers in one round trip; a Run may suspend for human input and finish
403
- * minutes later. Follow with {@link MaterialGraphClient.streamRunEvents} (live)
404
- * or {@link MaterialGraphClient.run} (poll). Pass `idempotencyKey` so a retry
405
- * replays rather than duplicates.
406
- */
407
- createRun(body: CreatePublicRunRequest, signal?: AbortSignal): Promise<CreatePublicRunResponse>;
408
- /**
409
- * THE QUESTION: "where has this Run got to?" — the caller-owned, redacted
410
- * ledger record. Polling; prefer {@link MaterialGraphClient.streamRunEvents}
411
- * when a human is waiting.
412
- */
413
- run(runId: RunId, signal?: AbortSignal): Promise<PublicRunResponse>;
414
324
  /** Follow a verdict cell's citation handle to its canonical claim source. */
415
325
  citation(citationId: string, signal?: AbortSignal): Promise<ResolvedVerdictCitation>;
416
- /**
417
- * Stream ordered Run events as an async iterator (GET
418
- * `/api/v1/runs/{runId}/events`, SSE). Iterates until the stream ends or the
419
- * signal aborts; pass `after` to resume from the last observed sequence.
420
- */
421
- streamRunEvents(runId: RunId, options?: StreamRunEventsOptions): AsyncGenerator<RunEvent>;
422
- /**
423
- * Collect Run events until a terminal event, the deadline, or the stream ends
424
- * — the bounded events-log pattern (a single pass over {@link streamRunEvents}).
425
- */
426
- drainRunEvents(runId: RunId, options: DrainRunEventsOptions): Promise<RunEvent[]>;
427
326
  }