@instruments/materialgraph 0.26.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 (113) hide show
  1. package/association-types.d.ts +18 -7
  2. package/attribution-types.d.ts +2 -2
  3. package/brand-types.d.ts +8 -0
  4. package/brands-client.d.ts +5 -36
  5. package/brands-client.js +7 -33
  6. package/by-colour-types.d.ts +40 -13
  7. package/by-spec-types.d.ts +0 -67
  8. package/by-spec-types.js +7 -5
  9. package/catalog-discovery-types.d.ts +1 -16
  10. package/catalogue-client.d.ts +12 -31
  11. package/catalogue-client.js +10 -46
  12. package/catalogue-types.d.ts +40 -0
  13. package/categories-client.d.ts +63 -0
  14. package/categories-client.js +48 -0
  15. package/category-types.d.ts +114 -0
  16. package/client-config.d.ts +2 -4
  17. package/client-config.js +2 -4
  18. package/client-vocabulary.d.ts +2 -4
  19. package/client-vocabulary.js +11 -9
  20. package/client.d.ts +103 -203
  21. package/client.js +126 -251
  22. package/codes-types.d.ts +21 -0
  23. package/colours-client.d.ts +4 -9
  24. package/colours-client.js +0 -8
  25. package/errors.d.ts +1 -1
  26. package/errors.js +1 -0
  27. package/identify-types.d.ts +49 -39
  28. package/identify-types.js +5 -3
  29. package/index.d.ts +11 -21
  30. package/index.js +4 -4
  31. package/list-variant-facets-types.d.ts +60 -0
  32. package/list-variants-types.d.ts +142 -0
  33. package/list-variants-types.js +12 -0
  34. package/match-stream-types.d.ts +13 -0
  35. package/match-stream-types.js +2 -0
  36. package/match-stream.js +12 -8
  37. package/match-types.d.ts +24 -0
  38. package/material-asset-types.d.ts +69 -49
  39. package/material-block-types.d.ts +2 -0
  40. package/material-composition-client.d.ts +21 -0
  41. package/material-composition-client.js +13 -0
  42. package/material-composition-types.d.ts +403 -0
  43. package/material-query-plan-types.d.ts +57 -141
  44. package/material-resources-client.d.ts +9 -7
  45. package/material-resources-client.js +19 -4
  46. package/material-types.d.ts +6 -14
  47. package/operations.d.ts +1 -1
  48. package/operations.js +20 -117
  49. package/package.json +5 -1
  50. package/palette-search-types.d.ts +59 -24
  51. package/query-understanding-types.d.ts +27 -5
  52. package/resolve-client.d.ts +6 -10
  53. package/resolve-client.js +5 -7
  54. package/response-schemas.d.ts +20 -0
  55. package/response-schemas.generated.d.ts +5 -0
  56. package/response-schemas.generated.js +160 -0
  57. package/response-schemas.js +113 -0
  58. package/run-types.d.ts +12 -93
  59. package/runs.d.ts +1 -37
  60. package/runs.js +2 -79
  61. package/schema-resource-types.d.ts +14 -1
  62. package/search-card-types.d.ts +22 -0
  63. package/search-index-plan-types.d.ts +70 -0
  64. package/search-refinement-types.d.ts +8 -38
  65. package/search-refinement-types.js +1 -0
  66. package/search-request-types.d.ts +117 -200
  67. package/search-response-receipt-types.d.ts +12 -268
  68. package/search-result-validation.d.ts +0 -16
  69. package/search-result-validation.js +22 -180
  70. package/spec-facet-types.d.ts +3 -8
  71. package/spec-types.d.ts +17 -10
  72. package/spec-types.js +8 -7
  73. package/specifications.d.ts +13 -55
  74. package/specifications.js +29 -73
  75. package/suggest-types.d.ts +4 -10
  76. package/suggest-types.js +1 -1
  77. package/types.d.ts +135 -338
  78. package/webmcp.d.ts +1 -1
  79. package/webmcp.generated.js +10 -94
  80. package/brand-most-sampled-types.d.ts +0 -33
  81. package/browse-types.d.ts +0 -236
  82. package/client-browse.d.ts +0 -78
  83. package/client-browse.js +0 -71
  84. package/client-exploration.d.ts +0 -9
  85. package/client-exploration.js +0 -5
  86. package/compare-types.d.ts +0 -89
  87. package/composition-client.d.ts +0 -33
  88. package/composition-client.js +0 -28
  89. package/composition-types.d.ts +0 -455
  90. package/composition-types.js +0 -10
  91. package/correction-types.d.ts +0 -88
  92. package/exploration-types.d.ts +0 -118
  93. package/exploration-types.js +0 -1
  94. package/fan-deck-types.d.ts +0 -42
  95. package/fan-deck-types.js +0 -9
  96. package/match-rejection-types.d.ts +0 -43
  97. package/match-rejection-types.js +0 -7
  98. package/palette-completion-types.d.ts +0 -115
  99. package/palette-completion-types.js +0 -1
  100. package/render-assets-types.d.ts +0 -65
  101. package/render-assets-types.js +0 -1
  102. package/search-collapse-types.d.ts +0 -69
  103. package/search-collapse-types.js +0 -1
  104. package/search-mood-types.d.ts +0 -6
  105. package/search-mood-types.js +0 -1
  106. package/search-window-types.d.ts +0 -25
  107. package/search-window-types.js +0 -1
  108. package/slot-pool-types.d.ts +0 -372
  109. package/slot-pool-types.js +0 -1
  110. /package/{brand-most-sampled-types.js → category-types.js} +0 -0
  111. /package/{browse-types.js → list-variant-facets-types.js} +0 -0
  112. /package/{compare-types.js → material-composition-types.js} +0 -0
  113. /package/{correction-types.js → search-index-plan-types.js} +0 -0
@@ -1,42 +0,0 @@
1
- /**
2
- * Wire types for a maker's whole range — GET `/api/v1/brands/{brandSlug}/colours`.
3
- *
4
- * The one read in the SDK that is deliberately UNPAGINATED. Family order is only
5
- * correct over a complete range: the greys cannot be placed against the browns
6
- * while holding one page of each. So the response carries the brand, and
7
- * `truncatedAt` appears only if a range ever exceeds the server's ceiling.
8
- */
9
- export type FanDeckSwatch = {
10
- /** Opaque token. Never parse or construct one. */
11
- variantId: string;
12
- brand: string;
13
- /** The maker's own colour name. Null when the catalogue publishes none. */
14
- name: string | null;
15
- /** The maker's PUBLISHED hex. This read never returns a derived colour. */
16
- hex: string;
17
- /** colorscope's family id, lower case (`cream`, `gray`, `blue`). */
18
- family: string;
19
- /** OKLab L, 0–1. The sort key within a family: light to dark. */
20
- lightness: number;
21
- imageUrl: string | null;
22
- };
23
- export type FanDeckFamily = {
24
- family: string;
25
- /** Count over the WHOLE range, computed before any truncation. */
26
- count: number;
27
- };
28
- export type BrandFanDeck = {
29
- /**
30
- * The brand SLUGS the deck resolved to — round-trippable identifiers, not
31
- * display names. The maker's name as it should be shown is on every swatch.
32
- */
33
- brands: string[];
34
- /** Grouped by `families` order, light to dark within each family. */
35
- swatches: FanDeckSwatch[];
36
- families: FanDeckFamily[];
37
- /**
38
- * Present ONLY when the range exceeded the server ceiling. Absent means the
39
- * deck is complete — absent is not zero.
40
- */
41
- truncatedAt?: number;
42
- };
package/fan-deck-types.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Wire types for a maker's whole range — GET `/api/v1/brands/{brandSlug}/colours`.
3
- *
4
- * The one read in the SDK that is deliberately UNPAGINATED. Family order is only
5
- * correct over a complete range: the greys cannot be placed against the browns
6
- * while holding one page of each. So the response carries the brand, and
7
- * `truncatedAt` appears only if a range ever exceeds the server's ceiling.
8
- */
9
- export {};
@@ -1,43 +0,0 @@
1
- /**
2
- * "Not this" on a photo match result (MG-1859). A rejection is feedback on the
3
- * match ranking, recorded against the response that showed the result. It is
4
- * never a catalogue correction; wrong facts about a product go through
5
- * `createCorrection`.
6
- */
7
- export type RejectMatchResultInput = {
8
- /**
9
- * The surface the result was shown under - `surfaces[].surface.id` on a scene
10
- * match. Omit it for a result from the run-level `results` list.
11
- */
12
- surfaceId?: string;
13
- /** The rejected result's `variantId`, verbatim. */
14
- variantId: string;
15
- /** Optional free text, up to 500 characters. Stored as given. */
16
- reason?: string;
17
- };
18
- /** The receipt for one rejection. A repeat of the same rejection returns the original. */
19
- export type MatchRejection = {
20
- rejectionId: string;
21
- /** The match response's `attribution.responseId`. */
22
- responseId: string;
23
- /** Null when the result came from the run-level list. */
24
- surfaceId: string | null;
25
- variantId: string;
26
- /** The 1-based position the match response showed this result at, within its surface. */
27
- rank: number;
28
- reason: string | null;
29
- /** ISO-8601. */
30
- rejectedAt: string;
31
- };
32
- /** One match response and every rejection recorded against it. */
33
- export type MatchRejectionList = {
34
- responseId: string;
35
- /** `stream` for a scene match, `buffered` for the single-image JSON response. */
36
- lane: "buffered" | "stream";
37
- /** ISO-8601 time the match response was issued. */
38
- issuedAt: string;
39
- /** Ranked results the response showed, across every surface - a rejection rate's denominator. */
40
- resultCount: number;
41
- /** Oldest first. Empty means nothing was rejected. */
42
- rejections: MatchRejection[];
43
- };
@@ -1,7 +0,0 @@
1
- /**
2
- * "Not this" on a photo match result (MG-1859). A rejection is feedback on the
3
- * match ranking, recorded against the response that showed the result. It is
4
- * never a catalogue correction; wrong facts about a product go through
5
- * `createCorrection`.
6
- */
7
- export {};
@@ -1,115 +0,0 @@
1
- /** Public wire types; the SDK does not load the producer corpus. */
2
- export type CompositionalRole = "Foundation" | "Supporting" | "Accent";
3
- export type RetainedColor = {
4
- readonly id: string;
5
- readonly hex: string;
6
- readonly role?: CompositionalRole;
7
- readonly paintVariantId?: string;
8
- };
9
- export type CompletionRequest = {
10
- readonly inputs: readonly RetainedColor[];
11
- readonly maxDistance?: number;
12
- readonly limit?: number;
13
- readonly white?: "published" | "perceptual";
14
- readonly memberCount?: number;
15
- readonly excludeHexes?: readonly string[];
16
- };
17
- export type CompletionAssignment = {
18
- readonly input: RetainedColor;
19
- readonly referenceIndex: number;
20
- readonly referenceHex: string;
21
- readonly distance: number;
22
- };
23
- export type CompletionMember = {
24
- readonly hex: string;
25
- readonly referenceHex: string;
26
- readonly referenceIndex: number;
27
- readonly inputIds: readonly string[];
28
- readonly role: CompositionalRole;
29
- readonly proportion: number;
30
- readonly sourceRole: string | null;
31
- readonly sourceRelation: string | null;
32
- };
33
- export type PaletteCompletion = {
34
- readonly uses?: readonly {
35
- readonly inputId: string;
36
- readonly role: CompositionalRole;
37
- readonly proportions: readonly number[];
38
- }[];
39
- readonly id: string;
40
- readonly reference: {
41
- readonly anchorIndex?: number | null;
42
- readonly libraryId: string;
43
- readonly paletteId: string;
44
- readonly name: string | null;
45
- readonly maker: string | null;
46
- readonly intent: "joint" | "alternatives";
47
- readonly provenance: "authored" | "derived" | "generated";
48
- };
49
- readonly assignments: readonly CompletionAssignment[];
50
- readonly members: readonly CompletionMember[];
51
- readonly evidenceBasis: "published-composition" | "published-pair" | "nearby-adaptation";
52
- readonly proportionBasis: "sourced" | "proposed";
53
- readonly worstDistance: number;
54
- readonly totalDistance: number;
55
- };
56
- export type PaletteCompleteInput = CompletionRequest & {
57
- sourceVersion: string;
58
- };
59
- export type PaletteDiscoverInput = {
60
- sourceVersion: string;
61
- character?: "warm" | "cool" | "very-light" | "light" | "dark" | "muted" | "soft" | "vivid";
62
- moreLike?: string;
63
- cursor?: string;
64
- limit?: number;
65
- };
66
- export type MaterializedPalette = {
67
- completion: PaletteCompletion;
68
- samples: {
69
- retainedPaint?: {
70
- variantId: string;
71
- name: string;
72
- maker: string;
73
- };
74
- referenceIndex: number;
75
- inputIds: readonly string[];
76
- hex: string;
77
- product: {
78
- variantId: string;
79
- productId: string;
80
- hex: string;
81
- name: string;
82
- brand: {
83
- slug: string;
84
- name: string;
85
- };
86
- } | null;
87
- status: string;
88
- distance: number | null;
89
- units: "oklab-euclidean";
90
- }[];
91
- };
92
- type PaletteVersions = {
93
- sourceVersion: string;
94
- corpusVersion: string;
95
- algorithmVersion: string;
96
- transport: "colorscope-package";
97
- };
98
- export type PaletteCompleteResponse = {
99
- results: MaterializedPalette[];
100
- coverage: {
101
- status: string;
102
- supported: number;
103
- };
104
- tolerance: {
105
- bound: number;
106
- units: string;
107
- policy: string;
108
- };
109
- } & PaletteVersions;
110
- export type PaletteDiscoverResponse = {
111
- results: MaterializedPalette[];
112
- total: number;
113
- nextCursor: string | null;
114
- } & PaletteVersions;
115
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,65 +0,0 @@
1
- import type { VariantId } from "./identifiers.js";
2
- export type RenderAssetChannelRole = "base-color" | "normal" | "roughness" | "metalness" | "height" | "ambient-occlusion";
3
- export type RenderAssetSourceBasis = "catalog_feed" | "declared" | "derived";
4
- export type RenderAssetUnavailableReason = "no_accepted_appearance" | "pending" | "withheld" | "rejected" | "superseded" | "variant_inactive" | "delivery_unverified" | "integrity_error";
5
- export type RenderAssetFreshness = {
6
- revision: string;
7
- updatedAt: string | null;
8
- checkedAt: string | null;
9
- };
10
- export type RenderAssetChannel = {
11
- role: RenderAssetChannelRole;
12
- url: string;
13
- sha256: string;
14
- byteSize: number;
15
- mimeType: "image/png";
16
- width: number;
17
- height: number;
18
- bitDepth: 8 | 16;
19
- colorSpace: "srgb" | "linear";
20
- };
21
- export type MaterialRenderAssetsAvailable = {
22
- schemaVersion: "pbr-render-assets/v1";
23
- variantId: VariantId;
24
- status: "available";
25
- setId: string;
26
- state: "accepted";
27
- sourceBasis: "derived";
28
- fidelity: "unassessed";
29
- acceptance: {
30
- id: string;
31
- verificationDecisionId: string;
32
- acceptedAt: string;
33
- checkVersion: string;
34
- qa: {
35
- status: "passed";
36
- checkCount: number;
37
- };
38
- checkCount: number;
39
- };
40
- physicalRepeat: {
41
- uMm: number;
42
- vMm: number;
43
- basis: "declared" | "measured";
44
- };
45
- tiling: {
46
- u: boolean;
47
- v: boolean;
48
- };
49
- normalConvention: "opengl" | "directx";
50
- heightAmplitudeMm?: number;
51
- channels: RenderAssetChannel[];
52
- supersedesSetIds: string[];
53
- freshness: RenderAssetFreshness;
54
- };
55
- export type MaterialRenderAssetsUnavailable = {
56
- schemaVersion: "pbr-render-assets/v1";
57
- variantId: VariantId;
58
- status: "unavailable";
59
- setId: string | null;
60
- state: "pending" | "withheld" | "rejected" | "superseded" | "accepted" | null;
61
- sourceBasis: RenderAssetSourceBasis | null;
62
- reasonCodes: RenderAssetUnavailableReason[];
63
- freshness: RenderAssetFreshness;
64
- };
65
- export type MaterialRenderAssets = MaterialRenderAssetsAvailable | MaterialRenderAssetsUnavailable;
@@ -1 +0,0 @@
1
- export {};
@@ -1,69 +0,0 @@
1
- /**
2
- * The product-collapsed view of a search result — what `collapse: "product"`
3
- * hands back beside each card. Kept out of `types.ts` for the same reason
4
- * `palette-search-types.ts` and `by-colour-types.ts` are: that file is at its
5
- * source-size ceiling, and this is a self-contained corner of the contract.
6
- *
7
- * READ THIS FIRST, because the default is the opposite of what "duplicates"
8
- * intuition suggests. MaterialGraph search is VARIANT-based: without `collapse`,
9
- * every matching variant comes back as its own result, and that is correct —
10
- * twelve SKUs of one tile are twelve separately orderable products, not twelve
11
- * copies of one. Product grouping is an optional VIEW over that, not a fix for
12
- * it.
13
- *
14
- * When you do ask for the view, the product arrives CARRYING its variants
15
- * (`SearchResultItem.variants`) rather than a bare count, so a colourway strip
16
- * renders from the same response as the card. That array is CAPPED at 12, while
17
- * `SearchResultItem.siblingCount` stays the complete tally — so a truncated list
18
- * is decidable from the response alone: `(siblingCount ?? 0) + 1 >
19
- * variants.length`. A full-length array is never on its own evidence that the
20
- * product holds no further variants.
21
- */
22
- import type { VariantId } from "./identifiers.js";
23
- import type { SearchResultSignals } from "./types.js";
24
- /**
25
- * One variant of a product-collapsed result.
26
- *
27
- * A slim shape, deliberately: the fields a colourway strip renders, projected
28
- * from the row the engine already held in memory, so the array costs no extra
29
- * query. It is NOT a nested search result — no `attributes`, `palette`,
30
- * `verdict` or `productType` — because those come from per-result reads the
31
- * engine issues for the card only. Fetch the variant by `variantId` when you
32
- * need its full record.
33
- */
34
- export type CollapsedVariant = {
35
- /** Opaque — round-trip verbatim. */
36
- variantId: VariantId;
37
- /** The variant's own label; for paint, the colourway name. Null when unnamed. */
38
- variantName: string | null;
39
- /** The variant's coarse colour family. */
40
- color: string | null;
41
- /**
42
- * `#rrggbb` dominant colour EXTRACTED FROM the variant's image — a visual
43
- * likeness, never a manufacturer-declared colour specification. ABSENT means
44
- * no palette is on record: unknown, never "this variant has no colour".
45
- */
46
- hex?: string;
47
- imageUrl: string | null;
48
- /**
49
- * The variant's Material Bank SKU, on the same contract as the result item's:
50
- * ABSENT means no MB identity is on record, never that it cannot be ordered.
51
- */
52
- materialBankId?: string;
53
- /** This variant's own mode-primary score — the value the array is ordered by. */
54
- score: number;
55
- };
56
- /**
57
- * One member of a collapsed result's `SearchResultItem.anatomy` — the
58
- * EXPLAIN-only readout of the same grouping {@link CollapsedVariant} publishes.
59
- * Where a collapsed variant is what a surface renders, this is what an operator
60
- * inspects: it carries the per-arm `signals` that made the variant a candidate.
61
- */
62
- export type SearchAnatomyMember = {
63
- /** Opaque — round-trip verbatim. */
64
- variantId: VariantId;
65
- variantName: string | null;
66
- color: string | null;
67
- score: number;
68
- signals: SearchResultSignals;
69
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
1
- /** What a standard search did, and did not, recognize as a governed mood. */
2
- export type MoodInterpretation = {
3
- query: string | null;
4
- moodId: string | null;
5
- supersededMoodId: string | null;
6
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,25 +0,0 @@
1
- /** The bounded candidate window that produced a search page. */
2
- export type SearchWindowReceipt = {
3
- /** Versioned budget profile; interpret the remaining fields under this version. */
4
- profile: "interactive-r1" | (string & {});
5
- /** Candidate depth used by the final retrieval. */
6
- candidateTier: number;
7
- /** Candidate retrieval count; `searchMaterials` reports exactly one selected retrieval. */
8
- retrievalRounds: number;
9
- /** Candidate-retrieval wall time only, in milliseconds. */
10
- retrievalMs: number;
11
- /** True when the serving source proved there were no more candidates. */
12
- exhaustive: boolean;
13
- /**
14
- * Candidate attrition through the selected retrieval source. Absent when the
15
- * response path did not perform ordinary retrieval (for example typeahead).
16
- */
17
- candidateCounts?: {
18
- /** Provider-returned matches before bounded selection; null for SQL/exact arms. */
19
- rawProviderMatches: number | null;
20
- /** Matches selected from that provider response; null for SQL/exact arms. */
21
- selectedMatches: number | null;
22
- /** Canonical candidates returned by the selected retrieval arm. */
23
- hydratedCanonicalCandidates: number;
24
- };
25
- };
@@ -1 +0,0 @@
1
- export {};