@instruments/materialgraph 0.29.0 → 0.31.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 (89) 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 +85 -174
  9. package/client.js +98 -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/errors.d.ts +1 -1
  14. package/errors.js +1 -0
  15. package/find-companions-types.d.ts +70 -0
  16. package/find-companions-types.js +12 -0
  17. package/find-variants-by-colour-types.d.ts +197 -0
  18. package/find-variants-by-vector-types.d.ts +67 -0
  19. package/find-variants-by-vector-types.js +5 -0
  20. package/get-variant-types.d.ts +50 -0
  21. package/get-variant-types.js +10 -0
  22. package/http-transport.d.ts +1 -1
  23. package/identifiers.d.ts +1 -1
  24. package/identifiers.js +1 -1
  25. package/image-reference-types.d.ts +18 -0
  26. package/index.d.ts +9 -7
  27. package/index.js +1 -1
  28. package/list-enum-values-types.d.ts +58 -0
  29. package/list-variants-types.d.ts +6 -2
  30. package/material-asset-types.d.ts +2 -2
  31. package/material-types.d.ts +13 -151
  32. package/operations.d.ts +1 -1
  33. package/operations.js +27 -88
  34. package/package.json +1 -1
  35. package/palette-search-types.d.ts +3 -49
  36. package/resolve-colour-types.d.ts +5 -5
  37. package/resolve-variant-types.d.ts +75 -0
  38. package/{identify-types.js → resolve-variant-types.js} +2 -2
  39. package/response-schemas.generated.d.ts +1 -1
  40. package/response-schemas.generated.js +46 -84
  41. package/run-types.d.ts +23 -216
  42. package/runs.d.ts +10 -58
  43. package/runs.js +19 -106
  44. package/schema-resource-types.d.ts +2 -139
  45. package/schema-resource-types.js +0 -8
  46. package/search-card-types.d.ts +1 -1
  47. package/search-index-plan-types.d.ts +6 -2
  48. package/search-request-types.d.ts +10 -2
  49. package/spec-types.d.ts +4 -4
  50. package/spec-types.js +2 -2
  51. package/specifications.d.ts +1 -9
  52. package/specifications.js +0 -12
  53. package/sse.d.ts +2 -2
  54. package/sse.js +2 -2
  55. package/types.d.ts +4 -38
  56. package/validation.d.ts +0 -74
  57. package/validation.js +2 -116
  58. package/webmcp.generated.js +9 -9
  59. package/workflows-client.d.ts +54 -0
  60. package/workflows-client.js +41 -0
  61. package/client-source-material-comments.d.ts +0 -51
  62. package/client-source-material-comments.js +0 -6
  63. package/codes-client.d.ts +0 -118
  64. package/codes-client.js +0 -99
  65. package/codes-types.d.ts +0 -325
  66. package/colour-aggregate-types.d.ts +0 -163
  67. package/coordinate-client.d.ts +0 -23
  68. package/coordinate-client.js +0 -13
  69. package/demand-batch-types.d.ts +0 -118
  70. package/demand-types.d.ts +0 -154
  71. package/identify-types.d.ts +0 -82
  72. package/material-composition-client.d.ts +0 -21
  73. package/material-composition-client.js +0 -13
  74. package/material-composition-types.d.ts +0 -403
  75. package/material-composition-types.js +0 -1
  76. package/source-material-validation.d.ts +0 -7
  77. package/source-material-validation.js +0 -214
  78. package/spec-facet-types.d.ts +0 -48
  79. package/spec-facet-types.js +0 -7
  80. package/substitute-types.d.ts +0 -102
  81. package/substitute-types.js +0 -1
  82. package/suggest-types.d.ts +0 -67
  83. package/suggest-types.js +0 -28
  84. package/taxonomy-coverage-types.d.ts +0 -34
  85. package/taxonomy-coverage-types.js +0 -1
  86. /package/{codes-types.js → colour-region-types.js} +0 -0
  87. /package/{colour-aggregate-types.js → find-variants-by-colour-types.js} +0 -0
  88. /package/{demand-batch-types.js → image-reference-types.js} +0 -0
  89. /package/{demand-types.js → list-enum-values-types.js} +0 -0
@@ -1,102 +0,0 @@
1
- import type { BySpecVerdict } from "./by-spec-types.js";
2
- import type { VariantId } from "./identifiers.js";
3
- import type { MaterialSuccessor } from "./material-types.js";
4
- export type SubstituteSignatureFamily = "textile" | "tile" | "coating" | "lighting_electrical" | "acoustic" | "surface" | "furniture" | "sanitaryware" | "fittings" | "architectural_hardware";
5
- export type SubstituteSignatureCriterion = {
6
- role: "primary_material" | "performance";
7
- attributeId: string;
8
- term: string;
9
- };
10
- export type AvailableSubstituteSignature = {
11
- family: SubstituteSignatureFamily;
12
- form: string;
13
- criteria: [SubstituteSignatureCriterion, SubstituteSignatureCriterion];
14
- };
15
- export type UnsupportedSubstituteSignature = {
16
- family: SubstituteSignatureFamily;
17
- form: string;
18
- reason: string;
19
- };
20
- export type InsufficientSubstituteSignature = {
21
- family: SubstituteSignatureFamily;
22
- form: string;
23
- missingRoles: ("primary_material" | "performance")[];
24
- };
25
- export type FindSubstitutesOptions = {
26
- excludeBrands?: string[];
27
- diversityBoost?: number;
28
- limit?: number;
29
- cursor?: string;
30
- includeSamplingArtifacts?: boolean;
31
- includeUnavailable?: boolean;
32
- };
33
- export type SubstituteMatchedCriterion = {
34
- attributeId: string;
35
- confidence: number | null;
36
- sourceBasis: string | null;
37
- };
38
- export type SubstituteResultItem = {
39
- variantId: VariantId;
40
- brandSlug: string;
41
- brand: string;
42
- product: string;
43
- variant: string;
44
- color: string | null;
45
- imageUrl: string | null;
46
- hex: string | null;
47
- matched: SubstituteMatchedCriterion[];
48
- minConfidence: number | null;
49
- baseScore: number;
50
- diversityAdjustment: number;
51
- score: number;
52
- verdict: BySpecVerdict;
53
- };
54
- export type AvailableSubstitutesResponse = {
55
- status: "available";
56
- signatureUsed: AvailableSubstituteSignature;
57
- items: SubstituteResultItem[];
58
- candidatePoolSize: number;
59
- droppedUnavailable: number;
60
- /**
61
- * MG-1686, MG-1783. True when the candidate read hit the bounded pool ceiling,
62
- * so more materials match the signature than were ranked. A cut pool is an
63
- * even SAMPLE across the id keyspace rather than its lowest window, so the
64
- * ranked set is representative of the match set without being all of it —
65
- * treat the items as the best of a sample, never as the best that exist. A cut
66
- * pool that produced NO items answers `inconclusive` instead, so `available`
67
- * with an empty `items` always means a complete search that found nothing.
68
- */
69
- poolTruncated: boolean;
70
- supersededBy: MaterialSuccessor | null;
71
- nextCursor?: string;
72
- };
73
- /**
74
- * MG-1686. The search read a bounded window of the matches and nothing in it
75
- * reached the page, while more matches existed past the window. It is not an
76
- * answer of "nothing can replace this" — that answer is `available` with an
77
- * empty `items`. `reason` names what happened and the next move; follow
78
- * `nextCursor` when it is present.
79
- */
80
- export type InconclusiveSubstitutesResponse = {
81
- status: "inconclusive";
82
- signatureUsed: AvailableSubstituteSignature;
83
- items: [];
84
- candidatePoolSize: number;
85
- droppedUnavailable: number;
86
- reason: string;
87
- supersededBy: MaterialSuccessor | null;
88
- nextCursor?: string;
89
- };
90
- export type UnsupportedSubstitutesResponse = {
91
- status: "unsupported";
92
- signature: UnsupportedSubstituteSignature;
93
- items: [];
94
- supersededBy: MaterialSuccessor | null;
95
- };
96
- export type InsufficientSubstitutesResponse = {
97
- status: "insufficient_signature";
98
- signature: InsufficientSubstituteSignature;
99
- items: [];
100
- supersededBy: MaterialSuccessor | null;
101
- };
102
- export type FindSubstitutesResponse = AvailableSubstitutesResponse | InconclusiveSubstitutesResponse | UnsupportedSubstitutesResponse | InsufficientSubstitutesResponse;
@@ -1 +0,0 @@
1
- export {};
@@ -1,67 +0,0 @@
1
- /**
2
- * Entity typeahead (MG-654) — the hand-mirrored wire types for
3
- * `GET /api/v1/search/suggest`, plus the one query-shaping rule the endpoint
4
- * imposes.
5
- *
6
- * Split out of `types.ts` for the repository's source-file size budget, the same
7
- * reason `catalog-discovery-types.ts` sits beside it; both are re-exported from
8
- * `types.ts`, so importers see no difference.
9
- *
10
- * THE LENS: entity typeahead — it ranks NAMES, not materials. `mg.search()` is
11
- * what answers a committed query; `mg.suggestColour()` covers colour names and
12
- * `mg.listAttributes({ query })` covers attributes. Suggestions are a page
13
- * of the best matches, never a census of matching entities.
14
- */
15
- /** Which kind of entity a suggestion is — and therefore what `refId` means. */
16
- export type SuggestKind = "product" | "brand" | "category";
17
- /** How the query met the suggestion's label. Strongest first. */
18
- export type SuggestMatch = "prefix" | "word" | "fuzzy";
19
- /** One ranked typeahead suggestion, carrying the identity it resolves to. */
20
- export type Suggestion = {
21
- kind: SuggestKind;
22
- /** The entity's name as written, for display. */
23
- label: string;
24
- /**
25
- * The resolvable identity: a product id, a brand slug, or a product-type key.
26
- * Selecting a suggestion should navigate to this, not re-search `label`.
27
- */
28
- refId: string;
29
- match: SuggestMatch;
30
- brandSlug: string | null;
31
- brandName: string | null;
32
- categoryKey: string | null;
33
- /**
34
- * A representative variant, so a client can open a material record directly.
35
- * Opaque, and null when none was picked — not a product without variants.
36
- */
37
- variantId: string | null;
38
- /** How many of this entity's variants the search index holds: a coverage figure. */
39
- variantCount: number;
40
- };
41
- /** The suggest response: the query as interpreted, plus the ranked suggestions. */
42
- export type SuggestResponse = {
43
- /** The typed words the search index was matched against. */
44
- query: string;
45
- /** Ranked best-match-first. Empty when nothing came close: a miss, not an error. */
46
- suggestions: Suggestion[];
47
- };
48
- /** Options for {@link MaterialGraphClient.suggest}. */
49
- export type SuggestOptions = {
50
- /** How many suggestions to return (1–20, default 8). */
51
- limit?: number;
52
- /** Restrict to these kinds. Omit for all of them. */
53
- kind?: SuggestKind | SuggestKind[];
54
- };
55
- /**
56
- * Shape the query string for a suggest call.
57
- *
58
- * The only non-obvious rule: `kind` is a COMMA LIST on the wire (`product,brand`),
59
- * which is the house convention for multi-value v1 params, so an array is joined
60
- * here rather than being sent as repeated `?kind=` pairs the route would ignore.
61
- * Undefined members are dropped by the transport.
62
- */
63
- export declare const suggestQuery: (q: string, options?: SuggestOptions) => {
64
- q: string;
65
- limit?: number;
66
- kind?: string;
67
- };
package/suggest-types.js DELETED
@@ -1,28 +0,0 @@
1
- /**
2
- * Entity typeahead (MG-654) — the hand-mirrored wire types for
3
- * `GET /api/v1/search/suggest`, plus the one query-shaping rule the endpoint
4
- * imposes.
5
- *
6
- * Split out of `types.ts` for the repository's source-file size budget, the same
7
- * reason `catalog-discovery-types.ts` sits beside it; both are re-exported from
8
- * `types.ts`, so importers see no difference.
9
- *
10
- * THE LENS: entity typeahead — it ranks NAMES, not materials. `mg.search()` is
11
- * what answers a committed query; `mg.suggestColour()` covers colour names and
12
- * `mg.listAttributes({ query })` covers attributes. Suggestions are a page
13
- * of the best matches, never a census of matching entities.
14
- */
15
- /**
16
- * Shape the query string for a suggest call.
17
- *
18
- * The only non-obvious rule: `kind` is a COMMA LIST on the wire (`product,brand`),
19
- * which is the house convention for multi-value v1 params, so an array is joined
20
- * here rather than being sent as repeated `?kind=` pairs the route would ignore.
21
- * Undefined members are dropped by the transport.
22
- */
23
- export const suggestQuery = (q, options) => {
24
- const kind = Array.isArray(options?.kind)
25
- ? options.kind.join(",")
26
- : options?.kind;
27
- return { kind, limit: options?.limit, q };
28
- };
@@ -1,34 +0,0 @@
1
- /** Exact, source-path-grained status coverage for primary product typing. */
2
- export type ProductTypeStatusCoverageCounts = {
3
- variants: number;
4
- accepted: number;
5
- proposed: number;
6
- proposedBelowThreshold: number;
7
- /** Proposed rows with no confidence remain explicit rather than thresholded. */
8
- proposedUnknownConfidence: number;
9
- otherStatus: number;
10
- missingPrimary: number;
11
- };
12
- export type ProductTypeStatusCoverageSourcePath = {
13
- /** Complete stored source path; null means the product retained no path. */
14
- sourcePath: string | null;
15
- } & ProductTypeStatusCoverageCounts;
16
- /** Current primary-assignment coverage, never an inferred acceptance decision. */
17
- export type ProductTypeStatusCoverage = {
18
- computedAt: string;
19
- basis: {
20
- count: "exact";
21
- universe: "non_superseded_variants";
22
- assignment: "variant_primary_only";
23
- sourcePath: "products.source_category_path";
24
- /** Reporting cutoff only: higher-confidence proposals remain proposed. */
25
- comparisonThreshold: number;
26
- };
27
- totals: ProductTypeStatusCoverageCounts;
28
- sourcePaths: ProductTypeStatusCoverageSourcePath[];
29
- };
30
- export type ProductTypeCoverageOptions = {
31
- [key: string]: number | undefined;
32
- /** Reporting cutoff in [0,1], default 0.85; it never accepts a proposal. */
33
- comparisonThreshold?: number;
34
- };
@@ -1 +0,0 @@
1
- export {};
File without changes
File without changes