@instruments/materialgraph 0.20.0 → 0.22.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.
- package/brand-most-sampled-types.d.ts +33 -0
- package/brand-most-sampled-types.js +1 -0
- package/catalogue-client.d.ts +19 -0
- package/catalogue-client.js +32 -0
- package/compare-types.d.ts +89 -0
- package/compare-types.js +1 -0
- package/correction-types.d.ts +88 -0
- package/correction-types.js +1 -0
- package/exploration-types.d.ts +1 -0
- package/http-transport.d.ts +2 -0
- package/http-transport.js +6 -1
- package/index.d.ts +3 -0
- package/operations.d.ts +1 -1
- package/operations.js +15 -0
- package/package.json +5 -1
- package/samplize-catalogue-types.d.ts +6 -0
- package/search-card-types.d.ts +6 -4
- package/search-response-types.d.ts +11 -0
- package/search-response-types.js +1 -0
- package/types.d.ts +2 -2
- package/webmcp.d.ts +17 -0
- package/webmcp.generated.d.ts +2 -0
- package/webmcp.generated.js +90 -0
- package/webmcp.js +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CandidateReadCard } from "./exploration-types.js";
|
|
2
|
+
export interface BrandMostSampledResponse {
|
|
3
|
+
data: {
|
|
4
|
+
brand: {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
status: "ready" | "unavailable";
|
|
9
|
+
metric: "sample_order_lines";
|
|
10
|
+
provenance: {
|
|
11
|
+
source: "material_bank_order_history";
|
|
12
|
+
signal: "sampled";
|
|
13
|
+
sessionId: string;
|
|
14
|
+
window: "trailing_36mo";
|
|
15
|
+
windowStart: string;
|
|
16
|
+
windowEnd: string;
|
|
17
|
+
} | null;
|
|
18
|
+
products: Array<{
|
|
19
|
+
rank: number;
|
|
20
|
+
sampleOrderLines: number;
|
|
21
|
+
representativeVariantSampleOrderLines: number;
|
|
22
|
+
card: CandidateReadCard & {
|
|
23
|
+
category: string | null;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
meta: {
|
|
28
|
+
operationId: "brands.most_sampled";
|
|
29
|
+
requestId: string;
|
|
30
|
+
};
|
|
31
|
+
links: Record<string, never>;
|
|
32
|
+
warnings: never[];
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/catalogue-client.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import type { BrandMostSampledResponse } from "./brand-most-sampled-types.js";
|
|
1
2
|
import type { CatalogDocumentList, CatalogPageListResult, CatalogProductReferenceReadResult, CatalogueChannelCollectionsResponse, CatalogueCollectionsOptions, CatalogueDocumentAccessResult, CataloguePageRepresentationReadResult, CatalogueReferenceBatchResponse } from "./catalogue-types.js";
|
|
3
|
+
import type { CompareInput, CompareResponse } from "./compare-types.js";
|
|
4
|
+
import type { CreateCorrectionInput, CorrectionResponse, CorrectionsListResponse } from "./correction-types.js";
|
|
2
5
|
import type { HttpTransport } from "./http-transport.js";
|
|
3
6
|
import type { VariantId } from "./identifiers.js";
|
|
4
7
|
import type { IdentifySelectedPageInput, IdentifySelectedPageResult } from "./identify-types.js";
|
|
@@ -8,6 +11,22 @@ import type { SamplizeColorVecCache } from "./samplize-colorvec.js";
|
|
|
8
11
|
export declare class CatalogueClient {
|
|
9
12
|
#private;
|
|
10
13
|
protected constructor(transport: HttpTransport);
|
|
14
|
+
/** Brand products ranked by observed Material Bank sample-order lines, with window provenance. */
|
|
15
|
+
brandMostSampled(brandId: string, options?: {
|
|
16
|
+
limit?: number;
|
|
17
|
+
}, signal?: AbortSignal): Promise<BrandMostSampledResponse>;
|
|
18
|
+
/** Compare canonical Variants without searching or ranking them. */
|
|
19
|
+
compare(input: CompareInput, signal?: AbortSignal): Promise<CompareResponse>;
|
|
20
|
+
/** Submit confirmed caller-authored review work; never changes accepted truth. */
|
|
21
|
+
createCorrection(input: CreateCorrectionInput, options: {
|
|
22
|
+
idempotencyKey: string;
|
|
23
|
+
signal?: AbortSignal;
|
|
24
|
+
}): Promise<CorrectionResponse>;
|
|
25
|
+
getCorrection(correctionId: string, signal?: AbortSignal): Promise<CorrectionResponse>;
|
|
26
|
+
listCorrections(input?: {
|
|
27
|
+
cursor?: string;
|
|
28
|
+
limit?: number;
|
|
29
|
+
}, signal?: AbortSignal): Promise<CorrectionsListResponse>;
|
|
11
30
|
/** Identify the canonical graph subject for one explicitly selected page. */
|
|
12
31
|
identify(input: IdentifySelectedPageInput, signal?: AbortSignal): Promise<IdentifySelectedPageResult>;
|
|
13
32
|
/** Complete producer-owned vectors and classifications for portable colour matching. */
|
package/catalogue-client.js
CHANGED
|
@@ -5,6 +5,38 @@ export class CatalogueClient {
|
|
|
5
5
|
constructor(transport) {
|
|
6
6
|
this.#transport = transport;
|
|
7
7
|
}
|
|
8
|
+
/** Brand products ranked by observed Material Bank sample-order lines, with window provenance. */
|
|
9
|
+
brandMostSampled(brandId, options = {}, signal) {
|
|
10
|
+
return this.#transport.requestJson(resolveOperation("brands.most_sampled"), { query: { brandId, ...options }, signal });
|
|
11
|
+
}
|
|
12
|
+
/** Compare canonical Variants without searching or ranking them. */
|
|
13
|
+
compare(input, signal) {
|
|
14
|
+
return this.#transport.requestJson(resolveOperation("retrieval.compare"), {
|
|
15
|
+
body: input,
|
|
16
|
+
signal,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/** Submit confirmed caller-authored review work; never changes accepted truth. */
|
|
20
|
+
createCorrection(input, options) {
|
|
21
|
+
if (!/^[\x21-\x7e]{1,200}$/.test(options.idempotencyKey))
|
|
22
|
+
throw new Error("A valid Idempotency-Key is required for Correction submission.");
|
|
23
|
+
return this.#transport.requestJson(resolveOperation("corrections.create"), {
|
|
24
|
+
body: input,
|
|
25
|
+
...options,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getCorrection(correctionId, signal) {
|
|
29
|
+
return this.#transport.requestJson(resolveOperation("corrections.get"), {
|
|
30
|
+
pathParams: { correctionId },
|
|
31
|
+
signal,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
listCorrections(input = {}, signal) {
|
|
35
|
+
return this.#transport.requestJson(resolveOperation("corrections.list"), {
|
|
36
|
+
query: input,
|
|
37
|
+
signal,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
8
40
|
/** Identify the canonical graph subject for one explicitly selected page. */
|
|
9
41
|
identify(input, signal) {
|
|
10
42
|
return this.#transport.requestJson(resolveOperation("retrieval.identify"), { body: input, signal });
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface CompareInput {
|
|
2
|
+
variantIds: string[];
|
|
3
|
+
selection?: {
|
|
4
|
+
kind: "blocks";
|
|
5
|
+
blockIds: string[];
|
|
6
|
+
} | {
|
|
7
|
+
kind: "attributes";
|
|
8
|
+
attributeIds: string[];
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
type Availability = "available" | "discontinued" | "superseded" | "unknown";
|
|
12
|
+
type ClaimScope = "variant" | "product" | "brand";
|
|
13
|
+
export interface CompareTarget {
|
|
14
|
+
variantId: string;
|
|
15
|
+
version: string;
|
|
16
|
+
freshness: {
|
|
17
|
+
oldestAt: string | null;
|
|
18
|
+
newestAt: string | null;
|
|
19
|
+
};
|
|
20
|
+
identity: {
|
|
21
|
+
variantId: string;
|
|
22
|
+
variantName: string | null;
|
|
23
|
+
brand: string;
|
|
24
|
+
brandSlug: string;
|
|
25
|
+
product: string;
|
|
26
|
+
productId: string;
|
|
27
|
+
colourName: string | null;
|
|
28
|
+
category: string | null;
|
|
29
|
+
categoryPath: string[];
|
|
30
|
+
imageUrl: string | null;
|
|
31
|
+
installationImageUrl: string | null;
|
|
32
|
+
dominantHex: string | null;
|
|
33
|
+
siblingCount: number;
|
|
34
|
+
};
|
|
35
|
+
availability: {
|
|
36
|
+
state: Availability;
|
|
37
|
+
label: string | null;
|
|
38
|
+
supersededBy: {
|
|
39
|
+
variantId: string;
|
|
40
|
+
brandSlug: string;
|
|
41
|
+
productId: string;
|
|
42
|
+
brand: string;
|
|
43
|
+
product: string;
|
|
44
|
+
variant: string;
|
|
45
|
+
color: string | null;
|
|
46
|
+
availability: Availability;
|
|
47
|
+
} | null;
|
|
48
|
+
};
|
|
49
|
+
sampleability: boolean | null;
|
|
50
|
+
}
|
|
51
|
+
export interface CompareCell {
|
|
52
|
+
variantId: string;
|
|
53
|
+
state: "known" | "unknown" | "conflicting" | "inapplicable";
|
|
54
|
+
recordState: "stated" | "conflicting" | "stale" | "unknown" | "missing" | "not_applicable" | "not_evaluated";
|
|
55
|
+
value: unknown;
|
|
56
|
+
unit: string | null;
|
|
57
|
+
verification: "verified" | "unverified" | "unbacked";
|
|
58
|
+
confidence: number | null;
|
|
59
|
+
sourceBasis: string | null;
|
|
60
|
+
sourceRef: string | null;
|
|
61
|
+
freshnessAt: string | null;
|
|
62
|
+
claimScope: ClaimScope | null;
|
|
63
|
+
competingClaims: {
|
|
64
|
+
scope: ClaimScope;
|
|
65
|
+
value: unknown;
|
|
66
|
+
sourceRef: string | null;
|
|
67
|
+
}[];
|
|
68
|
+
}
|
|
69
|
+
export interface CompareResult {
|
|
70
|
+
targets: CompareTarget[];
|
|
71
|
+
rows: {
|
|
72
|
+
blockId: string;
|
|
73
|
+
blockName: string;
|
|
74
|
+
attributeId: string;
|
|
75
|
+
label: string;
|
|
76
|
+
outcome: "same" | "different" | "incomplete" | "indeterminate" | "not_applicable";
|
|
77
|
+
cells: CompareCell[];
|
|
78
|
+
}[];
|
|
79
|
+
}
|
|
80
|
+
export interface CompareResponse {
|
|
81
|
+
data: CompareResult;
|
|
82
|
+
meta: {
|
|
83
|
+
operationId: "retrieval.compare";
|
|
84
|
+
requestId: string;
|
|
85
|
+
};
|
|
86
|
+
links: Record<string, never>;
|
|
87
|
+
warnings: never[];
|
|
88
|
+
}
|
|
89
|
+
export {};
|
package/compare-types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export type CorrectionJson = null | boolean | number | string | CorrectionJson[] | {
|
|
2
|
+
[key: string]: CorrectionJson;
|
|
3
|
+
};
|
|
4
|
+
export type CorrectionSubject = {
|
|
5
|
+
kind: "brand" | "product" | "variant";
|
|
6
|
+
id: string;
|
|
7
|
+
};
|
|
8
|
+
export type CorrectionTarget = {
|
|
9
|
+
kind: "identity";
|
|
10
|
+
subject: CorrectionSubject;
|
|
11
|
+
} | {
|
|
12
|
+
kind: "attribute";
|
|
13
|
+
subject: CorrectionSubject;
|
|
14
|
+
blockId: string;
|
|
15
|
+
attributeId: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: "relationship";
|
|
18
|
+
subject: CorrectionSubject;
|
|
19
|
+
relationship: string;
|
|
20
|
+
relatedSubject: CorrectionSubject;
|
|
21
|
+
} | {
|
|
22
|
+
kind: "source_interpretation";
|
|
23
|
+
sourceMaterialId: string;
|
|
24
|
+
subject?: CorrectionSubject;
|
|
25
|
+
} | {
|
|
26
|
+
kind: "missing_record";
|
|
27
|
+
url: string;
|
|
28
|
+
};
|
|
29
|
+
/** Caller-supplied evidence is not an independently verified graph reading. */
|
|
30
|
+
export interface CorrectionEvidence {
|
|
31
|
+
state: "known" | "unknown" | "conflicting" | "not_applicable";
|
|
32
|
+
value?: CorrectionJson;
|
|
33
|
+
sourceUrl?: string;
|
|
34
|
+
note?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface CreateCorrectionInput {
|
|
37
|
+
target: CorrectionTarget;
|
|
38
|
+
pageEvidence: CorrectionEvidence;
|
|
39
|
+
graphEvidence: CorrectionEvidence;
|
|
40
|
+
proposedChange: CorrectionJson;
|
|
41
|
+
rationale: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Correction {
|
|
44
|
+
id: string;
|
|
45
|
+
submission: CreateCorrectionInput;
|
|
46
|
+
status: "submitted" | "in_review" | "resolved" | "withdrawn";
|
|
47
|
+
resolution: "substantiated" | "not_substantiated" | "duplicate" | "superseded" | "cannot_determine" | null;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
acceptedTruthChanged: false;
|
|
51
|
+
}
|
|
52
|
+
export interface CorrectionResponse {
|
|
53
|
+
data: Correction;
|
|
54
|
+
meta: {
|
|
55
|
+
operationId: "corrections.create";
|
|
56
|
+
requestId: string;
|
|
57
|
+
idempotency: {
|
|
58
|
+
replayed: boolean;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
operationId: "corrections.get";
|
|
62
|
+
requestId: string;
|
|
63
|
+
};
|
|
64
|
+
links: {
|
|
65
|
+
self: string;
|
|
66
|
+
};
|
|
67
|
+
warnings: never[];
|
|
68
|
+
}
|
|
69
|
+
export interface CorrectionsListResponse {
|
|
70
|
+
data: Correction[];
|
|
71
|
+
meta: {
|
|
72
|
+
operationId: "corrections.list";
|
|
73
|
+
requestId: string;
|
|
74
|
+
page: {
|
|
75
|
+
returned: number;
|
|
76
|
+
total: {
|
|
77
|
+
value: null;
|
|
78
|
+
basis: "unavailable";
|
|
79
|
+
};
|
|
80
|
+
nextCursor: string | null;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
links: {
|
|
84
|
+
self: string;
|
|
85
|
+
next: string | null;
|
|
86
|
+
};
|
|
87
|
+
warnings: never[];
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/exploration-types.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface GraphOperatorEvidence {
|
|
|
18
18
|
export interface CandidateReadInput {
|
|
19
19
|
operator: "looks_like";
|
|
20
20
|
corpusScope?: CorpusScope;
|
|
21
|
+
/** Return up to 24 ranked candidates (default 8), from one bounded retrieval. */
|
|
21
22
|
limit?: number;
|
|
22
23
|
excludeVariantIds?: VariantId[];
|
|
23
24
|
}
|
package/http-transport.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { type SdkOperation } from "./operations.js";
|
|
|
11
11
|
export type QueryValue = string | number | boolean | undefined | null | Array<string | number | boolean>;
|
|
12
12
|
export type QueryParams = Record<string, QueryValue>;
|
|
13
13
|
export interface RequestOptions {
|
|
14
|
+
/** Required by state-changing operations that support safe retries. */
|
|
15
|
+
idempotencyKey?: string;
|
|
14
16
|
query?: QueryParams;
|
|
15
17
|
body?: unknown;
|
|
16
18
|
signal?: AbortSignal;
|
package/http-transport.js
CHANGED
|
@@ -211,7 +211,12 @@ export class HttpTransport {
|
|
|
211
211
|
const { parsed } = await this.send({
|
|
212
212
|
method: sdkOperation.method,
|
|
213
213
|
url,
|
|
214
|
-
headers: this.authHeaders(
|
|
214
|
+
headers: this.authHeaders({
|
|
215
|
+
...(hasBody ? { "Content-Type": "application/json" } : {}),
|
|
216
|
+
...(options.idempotencyKey
|
|
217
|
+
? { "Idempotency-Key": options.idempotencyKey }
|
|
218
|
+
: {}),
|
|
219
|
+
}),
|
|
215
220
|
body: hasBody ? JSON.stringify(options.body) : undefined,
|
|
216
221
|
signal: options.signal,
|
|
217
222
|
});
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { MaterialGraphClient, DEFAULT_BASE_URL, MAX_BATCH_IDS, } from "./client.js";
|
|
2
|
+
export type { CompareInput, CompareTarget, CompareCell, CompareResult, CompareResponse, } from "./compare-types.js";
|
|
3
|
+
export type { CorrectionJson, CorrectionSubject, CorrectionTarget, CorrectionEvidence, CreateCorrectionInput, Correction, CorrectionResponse, CorrectionsListResponse, } from "./correction-types.js";
|
|
2
4
|
export type { MaterialGraphClientOptions, BrowseNamespace, ExplorationNamespace, SourceMaterialCommentsNamespace, } from "./client.js";
|
|
3
5
|
export { MATERIALGRAPH_API_VERSION, SDK_OPERATIONS } from "./operations.js";
|
|
4
6
|
export type { SdkOperation, SdkOperationId } from "./operations.js";
|
|
@@ -53,3 +55,4 @@ export type * from "./spec-types.js";
|
|
|
53
55
|
export { certificationProgramme, certificationProgrammeCriterion, hasSpec, specCriterion, specRangeCriterion, specTerm, } from "./specifications.js";
|
|
54
56
|
export type { SamplizePublicationSource, SamplizeLrvObservation, SamplizeDemand, SamplizeCollectionMembership, SamplizeCatalogueOptions, SamplizeCataloguePage, SamplizeCatalogueProduct, SamplizeHexObservation, } from "./samplize-catalogue-types.js";
|
|
55
57
|
export type { PaletteCompleteInput, PaletteCompleteResponse, PaletteDiscoverInput, PaletteDiscoverResponse, } from "./palette-completion-types.js";
|
|
58
|
+
export type { BrandMostSampledResponse } from "./brand-most-sampled-types.js";
|
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 ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["scheduleReferences.list", "GET", "/api/v1/schedules/{scheduleId}/references", "list_schedule_reference_feedback"], readonly ["scheduleReferences.put", "PUT", "/api/v1/schedules/{scheduleId}/references/{referenceId}", "put_schedule_reference_feedback"], 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 ["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 ["match", "POST", "/api/v1/search/match", "match_material"], 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 ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["materialRenderAssets", "GET", "/api/v1/materials/{variantId}/render-assets", "get_material_render_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["exploration.operators", "GET", "/api/v1/materials/{variantId}/operators", "list_material_operators"], readonly ["exploration.candidates", "POST", "/api/v1/materials/{variantId}/candidates", "read_material_candidates"], 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 ["findSubstitutes", "POST", "/api/v1/materials/{variantId}/substitutes", "find_material_substitutes"], 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 ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], 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 ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["brandColourDeck", "GET", "/api/v1/brands/{brandSlug}/colours", "brand_colour_deck"], 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 ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], 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 ["brandMostSampled", "GET", "/api/v1/brands/most-sampled", "brands.most_sampled"], readonly ["colours.complete", "POST", "/api/v1/colours/palettes/complete", "complete_interior_palette"], readonly ["colours.discover", "GET", "/api/v1/colours/palettes", "discover_interior_palettes"], readonly ["samplizeColorVecCache", "GET", "/api/v1/catalogues/samplize/colorvec", "samplize_colorvec_cache"], readonly ["samplizeCatalogueSearch", "POST", "/api/v1/catalogues/samplize/search", "samplize_catalogue_search"], readonly ["scheduleReferences.list", "GET", "/api/v1/schedules/{scheduleId}/references", "list_schedule_reference_feedback"], readonly ["scheduleReferences.put", "PUT", "/api/v1/schedules/{scheduleId}/references/{referenceId}", "put_schedule_reference_feedback"], 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 ["compare", "POST", "/api/v1/compare", "retrieval.compare"], readonly ["createCorrection", "POST", "/api/v1/corrections", "corrections.create"], readonly ["getCorrection", "GET", "/api/v1/corrections/{correctionId}", "corrections.get"], readonly ["listCorrections", "GET", "/api/v1/corrections", "corrections.list"], 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 ["match", "POST", "/api/v1/search/match", "match_material"], 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 ["siblings", "GET", "/api/v1/materials/{variantId}/siblings", "get_material_siblings"], readonly ["materialBlocks", "GET", "/api/v1/materials/{variantId}/blocks", "list_material_blocks"], readonly ["materialAssets", "GET", "/api/v1/materials/{variantId}/assets", "list_material_assets"], readonly ["materialRenderAssets", "GET", "/api/v1/materials/{variantId}/render-assets", "get_material_render_assets"], readonly ["materialDocuments", "GET", "/api/v1/materials/{variantId}/documents", "list_material_documents"], readonly ["exploration.operators", "GET", "/api/v1/materials/{variantId}/operators", "list_material_operators"], readonly ["exploration.candidates", "POST", "/api/v1/materials/{variantId}/candidates", "read_material_candidates"], 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 ["findSubstitutes", "POST", "/api/v1/materials/{variantId}/substitutes", "find_material_substitutes"], 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 ["materials", "POST", "/api/v1/materials/batch", "get_materials_batch_post"], readonly ["materialsCached", "GET", "/api/v1/materials/batch", "get_materials_batch_get"], readonly ["browse", "GET", "/api/v1/search/browse", "search_browse_by_colour"], readonly ["colourFacets", "GET", "/api/v1/colours/facets", "get_colour_facets"], readonly ["colours.profiles", "GET", "/api/v1/colours/profiles", "get_category_colour_profiles"], readonly ["colours.stats", "GET", "/api/v1/colours/stats", "get_colour_stats"], readonly ["resolveColour", "GET", "/api/v1/search/colours/resolve", "resolve_colour_name"], readonly ["suggestColour", "GET", "/api/v1/search/colours/suggest", "suggest_colour_names"], readonly ["suggest", "GET", "/api/v1/search/suggest", "search_suggest"], readonly ["resolveAttribute", "GET", "/api/v1/catalog/attributes/resolve", "catalog_resolve_attribute"], readonly ["resolveAttributeValue", "GET", "/api/v1/catalog/attributes/{attributeId}/values/resolve", "catalog_resolve_value"], readonly ["searchVocabulary", "GET", "/api/v1/catalog/vocabulary/search", "catalog_vocabulary_search"], readonly ["resolve", "POST", "/api/v1/resolve", "resolve_phrases"], readonly ["bySpec", "GET", "/api/v1/search/specifications", "catalog_by_spec"], readonly ["taxonomy", "GET", "/api/v1/taxonomy/categories", "get_category_taxonomy"], readonly ["productTypeCoverage", "GET", "/api/v1/taxonomy/coverage", "get_product_type_status_coverage"], readonly ["whoami", "GET", "/api/v1/whoami", "whoami"], readonly ["coordinate", "POST", "/api/v1/pairings/coordinate", "coordinate_materials"], 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 ["attributeValues", "GET", "/api/v1/catalog/attributes/{attributeId}/values", "list_attribute_values"], readonly ["applicableSpecs", "GET", "/api/v1/taxonomy/categories/{key}/specs", "get_applicable_specs"], readonly ["glossary", "GET", "/api/v1/glossary/{term}", "explain_material_term"], readonly ["brands", "GET", "/api/v1/brands", "list_brands"], readonly ["brand", "GET", "/api/v1/brands/{brandSlug}", "get_brand_profile"], readonly ["brandColourDeck", "GET", "/api/v1/brands/{brandSlug}/colours", "brand_colour_deck"], 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 ["capabilities", "GET", "/api/v1/capabilities", "list_public_capabilities"], readonly ["createRun", "POST", "/api/v1/runs", "create_public_run"], readonly ["listRuns", "GET", "/api/v1/runs", "list_public_runs"], readonly ["run", "GET", "/api/v1/runs/{runId}", "get_public_run"], readonly ["runSchedule", "GET", "/api/v1/runs/{runId}/schedule", "get_run_finish_schedule"], readonly ["citation", "GET", "/api/v1/citations/{citationId}", "get_verdict_citation"], readonly ["streamRunEvents", "GET", "/api/v1/runs/{runId}/events", "list_public_run_events"], readonly ["resumeRun", "POST", "/api/v1/runs/{runId}/resume", "resume_public_run"], readonly ["cancelRun", "POST", "/api/v1/runs/{runId}/cancel", "cancel_public_run"], readonly ["varyScheme", "POST", "/api/v1/schemes/vary", "vary_schemes"], readonly ["slotPools", "POST", "/api/v1/schemes/pools", "slot_pools"], readonly ["createProject", "POST", "/api/v1/projects", "create_box_project"], readonly ["listProjects", "GET", "/api/v1/projects", "list_box_projects"], readonly ["getProject", "GET", "/api/v1/projects/{projectId}", "get_box_project"], readonly ["appendProjectEvent", "POST", "/api/v1/projects/{projectId}/events", "append_box_project_event"], 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"]];
|
|
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
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { MaterialGraphError } from "./errors.js";
|
|
2
2
|
export const MATERIALGRAPH_API_VERSION = "0.7.0";
|
|
3
3
|
const OPERATION_DEFINITIONS = [
|
|
4
|
+
[
|
|
5
|
+
"brandMostSampled",
|
|
6
|
+
"GET",
|
|
7
|
+
"/api/v1/brands/most-sampled",
|
|
8
|
+
"brands.most_sampled",
|
|
9
|
+
],
|
|
4
10
|
[
|
|
5
11
|
"colours.complete",
|
|
6
12
|
"POST",
|
|
@@ -58,6 +64,15 @@ const OPERATION_DEFINITIONS = [
|
|
|
58
64
|
],
|
|
59
65
|
["search", "POST", "/api/v1/search", "search_materials_post"],
|
|
60
66
|
["identify", "POST", "/api/v1/identify", "retrieval.identify"],
|
|
67
|
+
["compare", "POST", "/api/v1/compare", "retrieval.compare"],
|
|
68
|
+
["createCorrection", "POST", "/api/v1/corrections", "corrections.create"],
|
|
69
|
+
[
|
|
70
|
+
"getCorrection",
|
|
71
|
+
"GET",
|
|
72
|
+
"/api/v1/corrections/{correctionId}",
|
|
73
|
+
"corrections.get",
|
|
74
|
+
],
|
|
75
|
+
["listCorrections", "GET", "/api/v1/corrections", "corrections.list"],
|
|
61
76
|
["planQuery", "POST", "/api/v1/search/plan", "plan_material_query"],
|
|
62
77
|
[
|
|
63
78
|
"samplizeCatalogue",
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instruments/materialgraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
7
|
"types": "./index.d.ts",
|
|
8
8
|
"import": "./index.js"
|
|
9
9
|
},
|
|
10
|
+
"./webmcp": {
|
|
11
|
+
"types": "./webmcp.d.ts",
|
|
12
|
+
"import": "./webmcp.js"
|
|
13
|
+
},
|
|
10
14
|
"./samplize-colorvec": {
|
|
11
15
|
"types": "./samplize-colorvec.d.ts",
|
|
12
16
|
"import": "./samplize-colorvec.js"
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export interface SamplizeCatalogueOptions {
|
|
2
2
|
limit?: number;
|
|
3
|
+
/** Continue with unchanged filters and sourceVersion; omit when filters change. */
|
|
3
4
|
after?: string;
|
|
5
|
+
/** Exact canonical identities, at most 100. Unknown/ineligible IDs are omitted; no substitution. Combined filters intersect. */
|
|
6
|
+
variantIds?: string[];
|
|
7
|
+
/** Exact source collection handle; publisher remains Samplize. */
|
|
8
|
+
collectionHandle?: string;
|
|
4
9
|
/** Pin every subsequent page to the version returned by the first page. */
|
|
5
10
|
sourceVersion?: string;
|
|
6
11
|
}
|
|
@@ -49,6 +54,7 @@ export interface SamplizeCataloguePage {
|
|
|
49
54
|
corpusScope: "samplizeCatalogue";
|
|
50
55
|
sourceVersion: string;
|
|
51
56
|
source: Record<string, unknown>;
|
|
57
|
+
/** Number of eligible records matching the supplied filters. */
|
|
52
58
|
total: number;
|
|
53
59
|
items: SamplizeCatalogueProduct[];
|
|
54
60
|
nextCursor: string | null;
|
package/search-card-types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* which this module reads `SearchResponse` from.
|
|
10
10
|
*/
|
|
11
11
|
import type { ProductId, VariantId } from "./identifiers.js";
|
|
12
|
-
import type { OpenEnum, SearchResponse } from "./types.js";
|
|
12
|
+
import type { OpenEnum, SearchData, SearchResponse } from "./types.js";
|
|
13
13
|
/**
|
|
14
14
|
* The lean `view:"card"` result item — identity + name + thumbnail + score.
|
|
15
15
|
*
|
|
@@ -47,7 +47,9 @@ export interface SearchCardItem {
|
|
|
47
47
|
attributes?: Record<string, string | string[] | null>;
|
|
48
48
|
}
|
|
49
49
|
/** The `view:"card"` response form — the lean grid projection of {@link SearchResponse}. */
|
|
50
|
-
export interface SearchCardResponse extends Omit<SearchResponse, "
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
export interface SearchCardResponse extends Omit<SearchResponse, "data"> {
|
|
51
|
+
data: Omit<SearchData, "view" | "results"> & {
|
|
52
|
+
view: OpenEnum<"card">;
|
|
53
|
+
results: SearchCardItem[];
|
|
54
|
+
};
|
|
53
55
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SearchData } from "./types.js";
|
|
2
|
+
/** Canonical Search wire response. Raw SDK methods preserve this envelope. */
|
|
3
|
+
export interface SearchResponse {
|
|
4
|
+
data: SearchData;
|
|
5
|
+
meta: {
|
|
6
|
+
operationId: "search_materials_post" | "search_materials_get";
|
|
7
|
+
requestId: string;
|
|
8
|
+
};
|
|
9
|
+
links: Record<string, never>;
|
|
10
|
+
warnings: never[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
export type { SearchResponse } from "./search-response-types.js";
|
|
1
2
|
import type { ResponseAttribution } from "./attribution-types.js";
|
|
2
3
|
import type { BySpecVerdict } from "./by-spec-types.js";
|
|
3
4
|
/**
|
|
4
5
|
* Hand-mirrored wire types for the MaterialGraph public API (spec 0.5.0).
|
|
5
|
-
*
|
|
6
6
|
* These interfaces intentionally have NO runtime dependency on any
|
|
7
7
|
* `@materialgraph/*` package — they are a standalone, publishable mirror of the
|
|
8
8
|
* shapes in `apps/web/public/openapi.yaml` and the captured fixtures under
|
|
@@ -358,7 +358,7 @@ export interface SearchFacets {
|
|
|
358
358
|
* you asked for it. Follow `cursor` for the rest. "I found 24 materials" is
|
|
359
359
|
* wrong whenever `limit` was 24.
|
|
360
360
|
*/
|
|
361
|
-
export interface
|
|
361
|
+
export interface SearchData extends SearchResponseExplainReceipts {
|
|
362
362
|
/** Result attribution — see {@link ResponseAttribution}. `basis` is `mode` verbatim here. */
|
|
363
363
|
attribution?: ResponseAttribution;
|
|
364
364
|
view: OpenEnum<"full" | "card">;
|
package/webmcp.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Canonical operation contracts. Consumers validate both boundaries and supply their own transport. */
|
|
2
|
+
export interface WebMcpToolContract {
|
|
3
|
+
readonly name: "identify" | "search" | "compare" | "create_correction";
|
|
4
|
+
readonly operationId: string;
|
|
5
|
+
readonly path: string;
|
|
6
|
+
readonly method: "POST";
|
|
7
|
+
readonly description: string;
|
|
8
|
+
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly outputSchema: Readonly<Record<string, unknown>>;
|
|
10
|
+
readonly annotations: {
|
|
11
|
+
readonly readOnlyHint: boolean;
|
|
12
|
+
readonly untrustedContentHint: boolean;
|
|
13
|
+
};
|
|
14
|
+
readonly requiresVisibleConfirmation: boolean;
|
|
15
|
+
readonly requiredHeaders: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export { WEBMCP_TOOLS } from "./webmcp.generated.js";
|