@instruments/materialgraph 0.28.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 +4 -3
  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
@@ -1,7 +1,7 @@
1
- import type { ProductId, VariantId } from "./identifiers.js";
1
+ import type { VariantId } from "./identifiers.js";
2
2
  /**
3
- * Hand-mirrored wire types for the material projections — the grid-card tile,
4
- * the detail record, and the availability/successor block they carry.
3
+ * Hand-mirrored wire types for the material projections — the grid-card tile
4
+ * and the availability it carries.
5
5
  *
6
6
  * Extracted from `./types.ts` (which re-exports everything here) so that module
7
7
  * stays within the repository's source-size budget. Same contract, same
@@ -9,20 +9,15 @@ import type { ProductId, VariantId } from "./identifiers.js";
9
9
  * widened — a new server state still type-checks.
10
10
  *
11
11
  * ABSENT IS NOT FALSE, and it is the rule this whole file hangs on. A material
12
- * record reports what the graph HOLDS, never what is true of the object in the
13
- * world. `null` and a missing key both mean UNKNOWN:
14
- * - `dimensions: null` does not mean the material has no dimensions.
15
- * - `supersededBy: null` does not mean the product is current.
16
- * - a `facets` array without an attribute does not mean the material lacks that
17
- * property — it means nobody has recorded one.
18
- * - most dangerously, no boolean here may be inverted from an absence. Never
19
- * render "not certified" / "no fire rating" from a missing entry; render
20
- * "not on record".
12
+ * projection reports what the graph HOLDS, never what is true of the object in
13
+ * the world. `null` and a missing key both mean UNKNOWN, and no boolean here may
14
+ * be inverted from an absence: never render "not certified" / "no fire rating"
15
+ * from a missing entry; render "not on record".
21
16
  * Read {@link MaterialBlockProjection} when you need to tell "we looked and
22
17
  * there is none" apart from "nobody has looked" — that is the only projection
23
18
  * that says which.
24
19
  */
25
- import type { ImageSource, MaterialColour, OpenEnum, PaletteSwatch } from "./types.js";
20
+ import type { ImageSource, MaterialColour, OpenEnum } from "./types.js";
26
21
  /**
27
22
  * Whether a material can still be bought.
28
23
  *
@@ -31,30 +26,13 @@ import type { ImageSource, MaterialColour, OpenEnum, PaletteSwatch } from "./typ
31
26
  * listing state, not a reviewed manufacturer-discontinuation claim; do not
32
27
  * present it as the manufacturer having discontinued the product.
33
28
  * - `superseded` — a reviewed product relationship names a successor and the
34
- * material is no longer listed. See `MaterialDetail.supersededBy`.
29
+ * material is no longer listed.
35
30
  * - `unknown` — never checked. A real answer, not an error.
36
31
  */
37
32
  export type MaterialAvailability = OpenEnum<"available" | "discontinued" | "superseded" | "unknown">;
38
33
  /**
39
- * The variant a reviewed product relationship names as replacing another.
40
- * `availability` is the successor's OWN state, resolved ONE HOP only — a
41
- * successor that has itself been superseded reports `discontinued`/`unknown`
42
- * here; follow `variantId` for the next link in the chain.
43
- */
44
- export type MaterialSuccessor = {
45
- /** Opaque — round-trip verbatim to read the successor. */
46
- variantId: VariantId;
47
- brandSlug: string;
48
- productId: ProductId;
49
- brand: string;
50
- product: string;
51
- variant: string;
52
- color: string | null;
53
- availability: MaterialAvailability;
54
- };
55
- /**
56
- * The grid-card projection of a material. Tiles carry `availability` but not the
57
- * successor record — read the detail projection for that.
34
+ * The grid-card projection of a material. Tiles carry `availability` but not a
35
+ * successor record.
58
36
  */
59
37
  export type MaterialTile = {
60
38
  /** Accepted sampleability fact. Absent means unknown, never false. */
@@ -78,24 +56,6 @@ export type MaterialTile = {
78
56
  */
79
57
  colourName?: string;
80
58
  };
81
- /**
82
- * A canonical attribute/term pair carried on a detail record.
83
- *
84
- * `attributeId` and `term` are canonical VOCABULARY, not opaque ids — the same
85
- * tokens `bySpec` / `search({ filters })` accept, discoverable through
86
- * `specificationFacets()` and `attributeValues()`. An attribute absent from
87
- * `facets` is unrecorded, never known-false.
88
- */
89
- export type MaterialFacet = {
90
- attributeId: string;
91
- term: string;
92
- /**
93
- * Whether this value identifies the variant or specifies its performance /
94
- * composition. Present on current responses; optional for captured older
95
- * payloads. Only `specification` facets are valid inputs to `bySpec`.
96
- */
97
- role?: "identity" | "specification";
98
- };
99
59
  /** A retained product-type proposal. It is review evidence, never a category. */
100
60
  export type ProposedProductType = {
101
61
  id: string;
@@ -111,102 +71,3 @@ export type ProductTypeReceipt = {
111
71
  state: "accepted" | "proposed" | "unknown";
112
72
  proposedProductTypes: ProposedProductType[];
113
73
  };
114
- /**
115
- * One dimensional configuration of a material. Numeric fields are millimetres
116
- * (mass in kilograms); string fields are the source's own descriptors. The
117
- * index signature preserves the corpus's long tail of rarer keys.
118
- */
119
- export interface DimensionEntry {
120
- label?: string;
121
- tile_size?: string;
122
- measurement_basis?: string;
123
- width_mm?: number;
124
- length_mm?: number;
125
- height_mm?: number;
126
- depth_mm?: number;
127
- thickness_mm?: number;
128
- diameter_mm?: number;
129
- visible_projection_mm?: number;
130
- weight_kg?: number;
131
- [key: string]: unknown;
132
- }
133
- /**
134
- * The record projection of a material — the tile plus detail-only fields.
135
- *
136
- * The deepest read of ONE material, and still not an assertion about the object:
137
- * every `| null` below is UNKNOWN, not "none". See the module docblock.
138
- */
139
- export interface MaterialDetail extends MaterialTile {
140
- brandSlug: string;
141
- /** Opaque — the product family; siblings share it. */
142
- productId: ProductId;
143
- color: string | null;
144
- /** The variant's Material Bank SKU. Null means none is recorded, not unknown. */
145
- materialBankId: string | null;
146
- /**
147
- * The manufacturer's own item code from `variants.code`, the same key search
148
- * results carry. ABSENT means no code is recorded, never an invented one.
149
- */
150
- manufacturerCode?: string;
151
- /**
152
- * Explicit source-governed permission to save this exact source-coded variant
153
- * to a Project. Absent means unknown/not allowed; never infer it from identity.
154
- */
155
- projectSaveCapability?: "allowed";
156
- /**
157
- * The governed source status behind Project capture. Provisional remains
158
- * source-backed, but is not a verified catalogue claim.
159
- */
160
- sourceStatus?: "provisional";
161
- installationImageUrl: string | null;
162
- displayCategory: string | null;
163
- productTypeReceipt: ProductTypeReceipt;
164
- categoryPath: string[];
165
- /** Durable state of image-colour extraction and its variant projection. */
166
- colourEvidence: {
167
- status: "no_eligible_asset";
168
- } | {
169
- status: "extractor_not_run";
170
- origin: {
171
- assetId: string;
172
- method: "colorscope_primary_image";
173
- };
174
- } | {
175
- status: "available";
176
- basis: "palette" | "palette_and_dominant_oklab" | "dominant_oklab";
177
- extractedAt: string;
178
- extractionVersion: string | null;
179
- origin: {
180
- assetId: string;
181
- method: "colorscope_primary_image";
182
- };
183
- } | {
184
- status: "projection_missing";
185
- extractedAt: string;
186
- extractionVersion: string | null;
187
- origin: {
188
- assetId: string;
189
- method: "colorscope_primary_image";
190
- };
191
- } | {
192
- status: "genuinely_colourless";
193
- extractedAt: string;
194
- extractionVersion: string | null;
195
- origin: {
196
- assetId: string;
197
- method: "colorscope_primary_image";
198
- };
199
- };
200
- /** Extracted from imagery — visual likeness, never a declared colour spec. */
201
- palette: PaletteSwatch[];
202
- /** What is ON RECORD. An absent attribute is unrecorded, never known-false. */
203
- facets: MaterialFacet[];
204
- /** `null` = no dimensions recorded, NOT a dimensionless material. */
205
- dimensions: DimensionEntry[] | null;
206
- /**
207
- * The declared successor, or null when NO REVIEWED RELATIONSHIP NAMES ONE —
208
- * which is not the same as "this product is current". Read `availability` for
209
- * that, and even then `unknown` is a real answer.
210
- */
211
- supersededBy: MaterialSuccessor | null;
212
- }
package/operations.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export declare const MATERIALGRAPH_API_VERSION = "0.7.0";
2
- declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["identify", "POST", "/api/v1/identify", "retrieval.identify"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["material", "GET", "/api/v1/materials/{variantId}", "get_material"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["listVariantAssets", "GET", "/api/v1/variants/{variantId}/assets", "list_variant_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["compositionReport", "GET", "/api/v1/composition/report", "get_composition_report"], readonly ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"], readonly ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"], readonly ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"], readonly ["schema", "GET", "/api/v1/schema/product-types", "list_schema_product_types"], readonly ["schema", "GET", "/api/v1/schema/units", "list_schema_units"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["schema", "GET", "/api/v1/schema/source-requirements", "list_schema_source_requirements"], readonly ["schema", "GET", "/api/v1/schema/product-type-templates", "list_schema_product_type_templates"], readonly ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["applicability", "GET", "/api/v1/applicability", "get_applicability"], readonly ["listVariants", "GET", "/api/v1/variants", "list_variants"], readonly ["listVariantFacets", "POST", "/api/v1/variants/facets", "list_variant_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["listAttributes", "GET", "/api/v1/catalog/attributes", "catalog_list_attributes"], readonly ["categories.list", "GET", "/api/v1/categories", "list_categories"], readonly ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["demand", "GET", "/api/v1/demand", "get_material_demand"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["colours.gradient", "POST", "/api/v1/search/gradients", "search_by_gradient"], readonly ["specificationFacets", "GET", "/api/v1/catalog/specifications/facets", "list_spec_facets"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["sourceMaterialBatch", "GET", "/api/v1/source-material/{batchId}", "get_source_material_batch"], readonly ["sourceMaterialComments.list", "GET", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "list_source_material_comments"], readonly ["sourceMaterialComments.post", "POST", "/api/v1/source-material/{batchId}/sources/{sourceId}/comments", "post_source_material_comment"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"], readonly ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"], readonly ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"], readonly ["codes.requirements", "GET", "/api/v1/codes/requirements", "list_code_requirements"]];
2
+ declare const OPERATION_DEFINITIONS: readonly [readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["catalogs", "GET", "/api/v1/catalogs", "list_catalog_documents"], readonly ["catalogPages", "GET", "/api/v1/catalogs/{catalogId}/pages", "list_catalog_pages"], readonly ["catalogPageRepresentation", "GET", "/api/v1/catalog-pages/{pageId}/representation", "get_catalog_page_representation"], readonly ["catalogReferences", "GET", "/api/v1/catalogs/{catalogId}/references", "list_catalog_product_references"], readonly ["search", "POST", "/api/v1/search", "search_materials_post"], readonly ["match", "POST", "/api/v1/search/match", "match_material"], readonly ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"], readonly ["samplizeCatalogue", "GET", "/api/v1/catalogues/samplize/products", "samplize_catalogue_products"], readonly ["searchGet", "GET", "/api/v1/search", "search_materials_get"], readonly ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"], readonly ["catalogueReferences", "POST", "/api/v1/catalogues/references", "get_catalogue_references_batch"], readonly ["catalogueCollections", "GET", "/api/v1/catalogues/collections", "list_catalogue_channel_collections"], readonly ["catalogueDocumentAccess", "GET", "/api/v1/catalogues/documents/{documentId}", "get_catalogue_document_access"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["listVariantAssets", "GET", "/api/v1/variants/{variantId}/assets", "list_variant_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["schema", "GET", "/api/v1/schema/value-dictionaries", "list_schema_value_dictionaries"], readonly ["pairings", "GET", "/api/v1/materials/{variantId}/pairings", "get_material_pairings"], readonly ["associatedFinishes", "GET", "/api/v1/associated/finishes", "list_associated_finishes"], readonly ["associatedProducts", "GET", "/api/v1/associated/products", "list_associated_products"], readonly ["applicability", "GET", "/api/v1/applicability", "get_applicability"], readonly ["listVariants", "GET", "/api/v1/variants", "list_variants"], readonly ["listVariantFacets", "POST", "/api/v1/variants/facets", "list_variant_facets"], readonly ["findVariantsByColour", "POST", "/api/v1/variants/by-colour", "find_variants_by_colour"], readonly ["findVariantsByVector", "POST", "/api/v1/variants/by-vector", "find_variants_by_vector"], readonly ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"], readonly ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["listAttributes", "GET", "/api/v1/catalog/attributes", "catalog_list_attributes"], readonly ["listEnumValues", "GET", "/api/v1/catalog/enum-values", "catalog_list_enum_values"], readonly ["categories.list", "GET", "/api/v1/categories", "list_categories"], readonly ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"], readonly ["extractPalette", "POST", "/api/v1/search/palettes/extract", "extract_image_palette"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["uploadSourceMaterial", "POST", "/api/v1/source-material", "upload_source_material"], readonly ["workflows.start", "POST", "/api/v1/workflows/{workflowId}/runs", "create_public_run"], readonly ["workflows.run", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}", "get_public_run"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["workflows.streamRunEvents", "GET", "/api/v1/workflows/{workflowId}/runs/{runId}/events", "list_public_run_events"]];
3
3
  export type SdkOperationId = (typeof OPERATION_DEFINITIONS)[number][3];
4
4
  export type SdkOperation = Readonly<{
5
5
  clientMethod: (typeof OPERATION_DEFINITIONS)[number][0];
package/operations.js CHANGED
@@ -33,11 +33,7 @@ const OPERATION_DEFINITIONS = [
33
33
  "list_catalog_product_references",
34
34
  ],
35
35
  ["search", "POST", "/api/v1/search", "search_materials_post"],
36
- ["identify", "POST", "/api/v1/identify", "retrieval.identify"],
37
36
  ["match", "POST", "/api/v1/search/match", "match_material"],
38
- ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"],
39
- ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"],
40
- ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"],
41
37
  ["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"],
42
38
  [
43
39
  "samplizeCatalogue",
@@ -47,7 +43,6 @@ const OPERATION_DEFINITIONS = [
47
43
  ],
48
44
  ["searchGet", "GET", "/api/v1/search", "search_materials_get"],
49
45
  ["byColour", "GET", "/api/v1/search/colours", "search_by_colour"],
50
- ["material", "GET", "/api/v1/materials/{variantId}", "get_material"],
51
46
  [
52
47
  "catalogueReferences",
53
48
  "POST",
@@ -84,41 +79,12 @@ const OPERATION_DEFINITIONS = [
84
79
  "/api/v1/materials/{variantId}/documents",
85
80
  "list_material_documents",
86
81
  ],
87
- [
88
- "compositionReport",
89
- "GET",
90
- "/api/v1/composition/report",
91
- "get_composition_report",
92
- ],
93
- ["schema", "GET", "/api/v1/schema/blocks", "list_schema_blocks"],
94
- ["schema", "GET", "/api/v1/schema/attributes", "list_schema_attributes"],
95
- ["schema", "GET", "/api/v1/schema/verticals", "list_schema_verticals"],
96
- [
97
- "schema",
98
- "GET",
99
- "/api/v1/schema/product-types",
100
- "list_schema_product_types",
101
- ],
102
- ["schema", "GET", "/api/v1/schema/units", "list_schema_units"],
103
82
  [
104
83
  "schema",
105
84
  "GET",
106
85
  "/api/v1/schema/value-dictionaries",
107
86
  "list_schema_value_dictionaries",
108
87
  ],
109
- [
110
- "schema",
111
- "GET",
112
- "/api/v1/schema/source-requirements",
113
- "list_schema_source_requirements",
114
- ],
115
- [
116
- "schema",
117
- "GET",
118
- "/api/v1/schema/product-type-templates",
119
- "list_schema_product_type_templates",
120
- ],
121
- ["schema", "GET", "/api/v1/schema/mappings", "list_schema_mappings"],
122
88
  [
123
89
  "pairings",
124
90
  "GET",
@@ -146,39 +112,40 @@ const OPERATION_DEFINITIONS = [
146
112
  "list_variant_facets",
147
113
  ],
148
114
  [
149
- "colours.profiles",
150
- "GET",
151
- "/api/v1/colours/profiles",
152
- "get_category_colour_profiles",
115
+ "findVariantsByColour",
116
+ "POST",
117
+ "/api/v1/variants/by-colour",
118
+ "find_variants_by_colour",
153
119
  ],
120
+ [
121
+ "findVariantsByVector",
122
+ "POST",
123
+ "/api/v1/variants/by-vector",
124
+ "find_variants_by_vector",
125
+ ],
126
+ ["resolveVariant", "POST", "/api/v1/variants/resolve", "resolve_variant"],
127
+ ["getVariant", "GET", "/api/v1/variants/{variantId}", "get_variant"],
154
128
  [
155
129
  "resolveColour",
156
130
  "GET",
157
131
  "/api/v1/search/colours/resolve",
158
132
  "resolve_colour_name",
159
133
  ],
160
- [
161
- "suggestColour",
162
- "GET",
163
- "/api/v1/search/colours/suggest",
164
- "suggest_colour_names",
165
- ],
166
134
  [
167
135
  "listAttributes",
168
136
  "GET",
169
137
  "/api/v1/catalog/attributes",
170
138
  "catalog_list_attributes",
171
139
  ],
172
- ["categories.list", "GET", "/api/v1/categories", "list_categories"],
173
- ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"],
174
140
  [
175
- "productTypeCoverage",
141
+ "listEnumValues",
176
142
  "GET",
177
- "/api/v1/taxonomy/coverage",
178
- "get_product_type_status_coverage",
143
+ "/api/v1/catalog/enum-values",
144
+ "catalog_list_enum_values",
179
145
  ],
146
+ ["categories.list", "GET", "/api/v1/categories", "list_categories"],
147
+ ["categories.get", "GET", "/api/v1/categories/{id}", "get_category"],
180
148
  ["whoami", "GET", "/api/v1/whoami", "whoami"],
181
- ["demand", "GET", "/api/v1/demand", "get_material_demand"],
182
149
  ["colours.palette", "POST", "/api/v1/search/palettes", "search_by_palette"],
183
150
  [
184
151
  "extractPalette",
@@ -186,18 +153,6 @@ const OPERATION_DEFINITIONS = [
186
153
  "/api/v1/search/palettes/extract",
187
154
  "extract_image_palette",
188
155
  ],
189
- [
190
- "colours.gradient",
191
- "POST",
192
- "/api/v1/search/gradients",
193
- "search_by_gradient",
194
- ],
195
- [
196
- "specificationFacets",
197
- "GET",
198
- "/api/v1/catalog/specifications/facets",
199
- "list_spec_facets",
200
- ],
201
156
  ["brands", "GET", "/api/v1/brands", "list_brands"],
202
157
  [
203
158
  "uploadSourceMaterial",
@@ -206,41 +161,24 @@ const OPERATION_DEFINITIONS = [
206
161
  "upload_source_material",
207
162
  ],
208
163
  [
209
- "sourceMaterialBatch",
210
- "GET",
211
- "/api/v1/source-material/{batchId}",
212
- "get_source_material_batch",
164
+ "workflows.start",
165
+ "POST",
166
+ "/api/v1/workflows/{workflowId}/runs",
167
+ "create_public_run",
213
168
  ],
214
169
  [
215
- "sourceMaterialComments.list",
170
+ "workflows.run",
216
171
  "GET",
217
- "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
218
- "list_source_material_comments",
219
- ],
220
- [
221
- "sourceMaterialComments.post",
222
- "POST",
223
- "/api/v1/source-material/{batchId}/sources/{sourceId}/comments",
224
- "post_source_material_comment",
172
+ "/api/v1/workflows/{workflowId}/runs/{runId}",
173
+ "get_public_run",
225
174
  ],
226
- ["createRun", "POST", "/api/v1/runs", "create_public_run"],
227
- ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"],
228
175
  ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"],
229
176
  [
230
- "streamRunEvents",
177
+ "workflows.streamRunEvents",
231
178
  "GET",
232
- "/api/v1/runs/{runId}/events",
179
+ "/api/v1/workflows/{workflowId}/runs/{runId}/events",
233
180
  "list_public_run_events",
234
181
  ],
235
- ["demandBatch", "POST", "/api/v1/demand/batch", "get_demand_batch"],
236
- ["codeAdvisory", "POST", "/api/v1/codes/advisory", "resolveCodeAdvisory"],
237
- ["codes.context", "GET", "/api/v1/codes/context", "list_code_context"],
238
- [
239
- "codes.requirements",
240
- "GET",
241
- "/api/v1/codes/requirements",
242
- "list_code_requirements",
243
- ],
244
182
  ];
245
183
  export const SDK_OPERATIONS = Object.freeze(OPERATION_DEFINITIONS.map(([clientMethod, method, path, operationId]) => Object.freeze({ clientMethod, method, operationId, path })));
246
184
  /** Look up a registered operation by its OpenAPI `operationId`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instruments/materialgraph",
3
- "version": "0.28.0",
3
+ "version": "0.30.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,17 +1,14 @@
1
1
  import type { ColourCategoryGate } from "./by-colour-types.js";
2
2
  import type { CorpusScope, CorpusScopeReceipt } from "./corpus-scope-types.js";
3
3
  /**
4
- * Wire types for MULTI-COLOUR search — `POST /api/v1/search/palettes` and
5
- * `POST /api/v1/search/gradients`.
4
+ * Wire types for MULTI-COLOUR search — `POST /api/v1/search/palettes`.
6
5
  *
7
- * Kept out of `types.ts` for the same reason `colour-aggregate-types.ts` and
8
- * `codes-types.ts` are: the shared mirror is at its source-size budget. Same
6
+ * Kept out of `types.ts` for the repository's source-file size budget. Same
9
7
  * tolerant-parsing contract as the rest of the mirror — response enums are
10
8
  * widened so a new server value still type-checks.
11
9
  *
12
10
  * The MATCH SEMANTICS these types carry are the server's, stated on
13
- * {@link SearchPaletteInput.logic} and {@link GradientMatch.coverage} rather
14
- * than left to the endpoint docs.
11
+ * {@link SearchPaletteInput.logic} rather than left to the endpoint docs.
15
12
  */
16
13
  import type { VariantId } from "./identifiers.js";
17
14
  import type { OklabTriple, OpenEnum } from "./types.js";
@@ -30,11 +27,6 @@ export type PaletteQueryColour = {
30
27
  /** Relative importance. Not applied: a palette is ordered by its first colour. */
31
28
  weight?: number;
32
29
  };
33
- /** One gradient stop — exactly one of `hex` or `oklab`. Order is meaningful. */
34
- export type GradientStop = {
35
- hex?: string;
36
- oklab?: OklabTriple;
37
- };
38
30
  export type SearchPaletteInput = {
39
31
  /**
40
32
  * HARD category filter: category-group or product-type names or keys.
@@ -57,19 +49,6 @@ export type SearchPaletteInput = {
57
49
  /** Results to return; defaults to 24, capped at 48. */
58
50
  limit?: number;
59
51
  };
60
- export type SearchGradientInput = {
61
- /**
62
- * HARD category filter: category-group or product-type names or keys.
63
- * Absent, the page holds surface materials only, so lights, taps and
64
- * furniture are left out.
65
- */
66
- category?: string[];
67
- corpusScope?: CorpusScope;
68
- /** The ordered colour transition, 2–6 stops. */
69
- stops: GradientStop[];
70
- /** Results to return; defaults to 24, capped at 48. */
71
- limit?: number;
72
- };
73
52
  /**
74
53
  * One swatch used for scoring. Samplize paint uses its selected published hex;
75
54
  * other materials use colorscope palettes extracted from imagery. `name` is null when no human
@@ -143,15 +122,6 @@ export type PaletteMatch = {
143
122
  /** One receipt per queried colour, in query order. */
144
123
  colours: ColourMatchReceipt[];
145
124
  } & MultiColourMatchBase;
146
- export type GradientMatch = {
147
- /**
148
- * Thirds of the path where the material holds a swatch near a sampled point,
149
- * over 3. A receipt beside the order, which is by the first stop.
150
- */
151
- coverage: number;
152
- /** One receipt per sampled point along the path, in path order. */
153
- samples: ColourMatchReceipt[];
154
- } & MultiColourMatchBase;
155
125
  /**
156
126
  * The thresholds behind every receipt's `hueCompatible`: the exact values
157
127
  * passed to colorscope's `isHueCompatible`, fixed server-side with no request
@@ -199,19 +169,3 @@ export type SearchPaletteResponse = {
199
169
  count: number;
200
170
  matches: PaletteMatch[];
201
171
  };
202
- /** A PAGE, NOT A CORPUS — see {@link SearchPaletteResponse}. */
203
- export type SearchGradientResponse = {
204
- /** The category gate the page ran under. */
205
- categoryGate?: ColourCategoryGate;
206
- corpusScope?: CorpusScopeReceipt;
207
- query: {
208
- stops: string[];
209
- /** The sampled path points the search actually ran against. */
210
- samples: string[];
211
- };
212
- /** The thresholds behind each sample receipt's `hueCompatible`. */
213
- hueGate?: HueGateReceipt;
214
- /** `matches.length`, capped by `limit`. Never a corpus total. */
215
- count: number;
216
- matches: GradientMatch[];
217
- };
@@ -28,7 +28,7 @@ export type ResolveColourCatalogueVariant = {
28
28
  inScope: boolean | null;
29
29
  /**
30
30
  * True when the stored brand is Samplize, a sampling channel, and the listing
31
- * is not Samplize's own: the colour is another maker's, so `brand` is not who
31
+ * is not Samplize's own: the colour is another brand's, so `brand` is not who
32
32
  * made it. The variant is still the right one for the name.
33
33
  */
34
34
  parentageSuspect: boolean;
@@ -37,7 +37,7 @@ export type ResolveColourCatalogueVariant = {
37
37
  * Whether the named paint is a variant in the catalogue. Exact, global, and
38
38
  * never narrowed by `corpusScope`, and run only for a `brand` library hit.
39
39
  * `not-in-catalogue` means the catalogue was searched and nothing carries the
40
- * paint; `not-looked-up` means there was no one maker's paint to search for.
40
+ * paint; `not-looked-up` means there was no one brand's paint to search for.
41
41
  */
42
42
  export type ResolveColourVariant = ({
43
43
  status: "matched";
@@ -62,17 +62,17 @@ export type ResolveColourResponse = {
62
62
  libraryName: string;
63
63
  code?: string;
64
64
  }[];
65
- /** Generic meaning; maker-specific paint identity is carried by match. */
65
+ /** Generic meaning; brand-specific paint identity is carried by match. */
66
66
  genericResolution: ColorResolution;
67
67
  match: {
68
68
  matchTarget: MatchTarget;
69
69
  hex: string;
70
70
  name: string;
71
71
  code?: string;
72
- /** The ColorScope library the colour resolved in. Not necessarily a maker. */
72
+ /** The ColorScope library the colour resolved in. Not necessarily a brand. */
73
73
  libraryId?: string;
74
74
  /**
75
- * The library's own type: `brand` is a maker's paint, `reference` a colour
75
+ * The library's own type: `brand` is a brand's paint, `reference` a colour
76
76
  * standard (RAL, Pantone, HKS), `core` ColorScope's descriptive vocabulary.
77
77
  * Present exactly when `libraryId` is. Only a `brand` hit is looked up.
78
78
  */
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Public wire types for `POST /api/v1/variants/resolve` (MG-1672's
3
+ * `resolve_variant` contract).
4
+ *
5
+ * These intentionally mirror the domain-owned Zod contract
6
+ * (`@materialgraph/products/identify-contract`) rather than importing it: the
7
+ * published SDK must carry no workspace package dependency.
8
+ */
9
+ /**
10
+ * What `mg.resolveVariant()` accepts. Give `url` alone, or `code` with
11
+ * `brandId` (from `mg.brands()`) when there is no page to read. `labels` are
12
+ * product names visible on the page, sent only to tell several URL candidates
13
+ * apart - they never widen a search or invent an identity on their own.
14
+ */
15
+ export type ResolveVariantInput = {
16
+ url?: string;
17
+ code?: string;
18
+ brandId?: string;
19
+ labels?: string[];
20
+ };
21
+ /** One identified, placed or bounded-candidate subject. */
22
+ export type ResolveVariantSubject = {
23
+ kind: "variant" | "brand";
24
+ id: string;
25
+ name: string;
26
+ code?: string;
27
+ brand?: {
28
+ id: string;
29
+ name: string;
30
+ };
31
+ };
32
+ /** What stood behind an outcome. Exact and scoreless: never a similarity guess. */
33
+ export type ResolveVariantEvidence = {
34
+ kind: "brand-url" | "brand-homepage" | "brand-code" | "visible-label";
35
+ url?: string;
36
+ detail: string;
37
+ };
38
+ /** The submitted URL, normalised, and the steps that normalisation took. Absent for a code-only call. */
39
+ export type ResolveVariantReceipt = {
40
+ submittedUrl: string;
41
+ normalizedUrl: string;
42
+ normalizationSteps: string[];
43
+ };
44
+ type ResolveVariantOutputBase = {
45
+ evidence: ResolveVariantEvidence[];
46
+ receipt?: ResolveVariantReceipt;
47
+ };
48
+ /**
49
+ * Why nothing was resolved. Absent and empty differ: this names what was
50
+ * looked for and not found, never a similarity guess.
51
+ */
52
+ export type ResolveVariantUnresolvedReason = "no-stored-url" | "no-code-match";
53
+ /**
54
+ * What `mg.resolveVariant()` returns: the `resolve_variant` tool's own output,
55
+ * unwrapped. Exact identities only - no rung carries a similarity score.
56
+ */
57
+ export type ResolveVariantOutput = (ResolveVariantOutputBase & {
58
+ outcome: "identified";
59
+ subject: ResolveVariantSubject & {
60
+ kind: "variant";
61
+ };
62
+ }) | (ResolveVariantOutputBase & {
63
+ outcome: "placed";
64
+ subject: ResolveVariantSubject & {
65
+ kind: "brand";
66
+ };
67
+ }) | (ResolveVariantOutputBase & {
68
+ outcome: "ambiguous";
69
+ candidates: ResolveVariantSubject[];
70
+ truncated: boolean;
71
+ }) | (ResolveVariantOutputBase & {
72
+ outcome: "unresolved";
73
+ reason: ResolveVariantUnresolvedReason;
74
+ });
75
+ export {};
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Public wire types for `POST /api/v1/identify` (MG-1672's `resolve_variant`
3
- * contract).
2
+ * Public wire types for `POST /api/v1/variants/resolve` (MG-1672's
3
+ * `resolve_variant` contract).
4
4
  *
5
5
  * These intentionally mirror the domain-owned Zod contract
6
6
  * (`@materialgraph/products/identify-contract`) rather than importing it: the