@instruments/materialgraph 0.25.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 (158) hide show
  1. package/association-types.d.ts +38 -27
  2. package/associations-client.d.ts +4 -4
  3. package/associations-client.js +3 -10
  4. package/attribution-types.d.ts +4 -4
  5. package/brand-types.d.ts +14 -6
  6. package/brands-client.d.ts +7 -38
  7. package/brands-client.js +10 -40
  8. package/by-colour-types.d.ts +58 -31
  9. package/by-spec-types.d.ts +6 -73
  10. package/by-spec-types.js +7 -5
  11. package/catalog-discovery-types.d.ts +11 -26
  12. package/catalogue-client.d.ts +16 -35
  13. package/catalogue-client.js +32 -67
  14. package/catalogue-types.d.ts +44 -4
  15. package/categories-client.d.ts +63 -0
  16. package/categories-client.js +48 -0
  17. package/category-types.d.ts +114 -0
  18. package/citation-types.d.ts +4 -4
  19. package/client-config.d.ts +4 -6
  20. package/client-config.js +2 -4
  21. package/client-source-material-comments.d.ts +4 -4
  22. package/client-source-material-comments.js +4 -38
  23. package/client-vocabulary.d.ts +7 -9
  24. package/client-vocabulary.js +22 -30
  25. package/client.d.ts +110 -244
  26. package/client.js +217 -387
  27. package/codes-client.d.ts +2 -2
  28. package/codes-client.js +8 -8
  29. package/codes-types.d.ts +55 -34
  30. package/colour-aggregate-types.d.ts +24 -24
  31. package/colours-client.d.ts +6 -11
  32. package/colours-client.js +11 -19
  33. package/coordinate-client.d.ts +2 -2
  34. package/coordinate-client.js +1 -13
  35. package/corpus-scope-types.d.ts +3 -3
  36. package/corpus-scope-types.js +1 -25
  37. package/demand-batch-types.d.ts +18 -18
  38. package/demand-types.d.ts +24 -24
  39. package/errors.d.ts +13 -13
  40. package/errors.js +54 -52
  41. package/http-transport.d.ts +13 -21
  42. package/http-transport.js +31 -28
  43. package/identify-types.d.ts +54 -44
  44. package/identify-types.js +5 -3
  45. package/index.d.ts +11 -27
  46. package/index.js +4 -6
  47. package/list-variant-facets-types.d.ts +60 -0
  48. package/list-variants-types.d.ts +142 -0
  49. package/list-variants-types.js +12 -0
  50. package/match-stream-types.d.ts +45 -32
  51. package/match-stream-types.js +2 -0
  52. package/match-stream.d.ts +2 -2
  53. package/match-stream.js +67 -49
  54. package/match-types.d.ts +32 -8
  55. package/material-asset-types.d.ts +89 -69
  56. package/material-block-types.d.ts +8 -6
  57. package/material-composition-client.d.ts +21 -0
  58. package/material-composition-client.js +13 -0
  59. package/material-composition-types.d.ts +403 -0
  60. package/material-query-plan-types.d.ts +61 -145
  61. package/material-resources-client.d.ts +12 -10
  62. package/material-resources-client.js +27 -22
  63. package/material-types.d.ts +16 -24
  64. package/ndjson.js +16 -8
  65. package/operations.d.ts +6 -6
  66. package/operations.js +29 -156
  67. package/package.json +5 -1
  68. package/palette-search-types.d.ts +87 -52
  69. package/query-understanding-types.d.ts +65 -40
  70. package/resolve-client.d.ts +8 -12
  71. package/resolve-client.js +9 -13
  72. package/resolve-colour-types.d.ts +8 -8
  73. package/resolve-types.d.ts +10 -10
  74. package/response-schemas.d.ts +20 -0
  75. package/response-schemas.generated.d.ts +5 -0
  76. package/response-schemas.generated.js +160 -0
  77. package/response-schemas.js +113 -0
  78. package/run-types.d.ts +64 -145
  79. package/runs.d.ts +9 -58
  80. package/runs.js +60 -149
  81. package/samplize-catalogue-types.d.ts +18 -18
  82. package/samplize-colorvec.d.ts +20 -20
  83. package/samplize-colorvec.js +66 -42
  84. package/schema-resource-types.d.ts +52 -39
  85. package/schema-resource-types.js +5 -5
  86. package/search-card-types.d.ts +26 -4
  87. package/search-index-plan-types.d.ts +70 -0
  88. package/search-refinement-types.d.ts +10 -40
  89. package/search-refinement-types.js +1 -0
  90. package/search-request-types.d.ts +121 -204
  91. package/search-response-receipt-types.d.ts +13 -253
  92. package/search-response-types.d.ts +2 -2
  93. package/search-result-validation.d.ts +3 -19
  94. package/search-result-validation.js +42 -183
  95. package/source-material-validation.d.ts +3 -3
  96. package/source-material-validation.js +35 -39
  97. package/spec-facet-types.d.ts +11 -16
  98. package/spec-types.d.ts +23 -16
  99. package/spec-types.js +8 -7
  100. package/specifications.d.ts +14 -72
  101. package/specifications.js +39 -89
  102. package/sse.d.ts +2 -2
  103. package/sse.js +32 -16
  104. package/substitute-types.d.ts +22 -22
  105. package/suggest-types.d.ts +11 -17
  106. package/suggest-types.js +3 -3
  107. package/taxonomy-coverage-types.d.ts +8 -8
  108. package/types.d.ts +202 -405
  109. package/validation.d.ts +26 -26
  110. package/validation.js +97 -92
  111. package/webmcp.d.ts +3 -3
  112. package/webmcp.generated.js +10 -93
  113. package/brand-most-sampled-types.d.ts +0 -33
  114. package/browse-types.d.ts +0 -236
  115. package/client-browse.d.ts +0 -78
  116. package/client-browse.js +0 -72
  117. package/client-exploration.d.ts +0 -9
  118. package/client-exploration.js +0 -7
  119. package/compare-types.d.ts +0 -89
  120. package/composition-client.d.ts +0 -33
  121. package/composition-client.js +0 -27
  122. package/composition-types.d.ts +0 -455
  123. package/composition-types.js +0 -10
  124. package/correction-types.d.ts +0 -88
  125. package/exploration-types.d.ts +0 -118
  126. package/exploration-types.js +0 -1
  127. package/fan-deck-types.d.ts +0 -42
  128. package/fan-deck-types.js +0 -9
  129. package/match-rejection-types.d.ts +0 -43
  130. package/match-rejection-types.js +0 -7
  131. package/palette-completion-types.d.ts +0 -115
  132. package/palette-completion-types.js +0 -1
  133. package/project-types.d.ts +0 -79
  134. package/project-types.js +0 -9
  135. package/projects.d.ts +0 -13
  136. package/projects.js +0 -46
  137. package/render-assets-types.d.ts +0 -65
  138. package/render-assets-types.js +0 -1
  139. package/run-events.d.ts +0 -106
  140. package/run-events.js +0 -32
  141. package/schedule-reference-types.d.ts +0 -46
  142. package/schedule-reference-types.js +0 -1
  143. package/schedule-references-client.d.ts +0 -14
  144. package/schedule-references-client.js +0 -26
  145. package/schedule-types.d.ts +0 -261
  146. package/schedule-types.js +0 -1
  147. package/search-collapse-types.d.ts +0 -69
  148. package/search-collapse-types.js +0 -1
  149. package/search-mood-types.d.ts +0 -6
  150. package/search-mood-types.js +0 -1
  151. package/search-window-types.d.ts +0 -25
  152. package/search-window-types.js +0 -1
  153. package/slot-pool-types.d.ts +0 -372
  154. package/slot-pool-types.js +0 -1
  155. /package/{brand-most-sampled-types.js → category-types.js} +0 -0
  156. /package/{browse-types.js → list-variant-facets-types.js} +0 -0
  157. /package/{compare-types.js → material-composition-types.js} +0 -0
  158. /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 interface 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 interface FanDeckFamily {
24
- family: string;
25
- /** Count over the WHOLE range, computed before any truncation. */
26
- count: number;
27
- }
28
- export interface 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 interface 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 interface 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 interface 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 interface RetainedColor {
4
- readonly id: string;
5
- readonly hex: string;
6
- readonly role?: CompositionalRole;
7
- readonly paintVariantId?: string;
8
- }
9
- export interface 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 interface CompletionAssignment {
18
- readonly input: RetainedColor;
19
- readonly referenceIndex: number;
20
- readonly referenceHex: string;
21
- readonly distance: number;
22
- }
23
- export interface 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 interface 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 interface 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 interface MaterializedPalette {
67
- completion: PaletteCompletion;
68
- samples: Array<{
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
- interface PaletteVersions {
93
- sourceVersion: string;
94
- corpusVersion: string;
95
- algorithmVersion: string;
96
- transport: "colorscope-package";
97
- }
98
- export interface PaletteCompleteResponse extends PaletteVersions {
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
- }
110
- export interface PaletteDiscoverResponse extends PaletteVersions {
111
- results: MaterializedPalette[];
112
- total: number;
113
- nextCursor: string | null;
114
- }
115
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,79 +0,0 @@
1
- /**
2
- * Wire types for the persistent Material Box project surface (`/api/v1/projects`).
3
- * Hand-mirrored from `@materialgraph/products/projects`' Zod contract — the SDK
4
- * has zero runtime dependency on `@materialgraph/*`. Kept shape-identical to the
5
- * server contract; the OpenAPI parity test gates method/path/operationId, and the
6
- * server route schemas gate the body shapes.
7
- *
8
- * THE LENS: a project is the DESIGNER'S OWN record — an append-only trail of
9
- * what they attached, asked, preferred and adopted. It holds no material data of
10
- * its own; every `variantId`, `batchId` and `runId` in it is a reference into
11
- * the other lenses. Read the folded collections on {@link ProjectState}; the raw
12
- * `events` log is there for audit, not for reconstruction.
13
- *
14
- * Every id here is OPAQUE — round-trip verbatim, never parse or construct one.
15
- */
16
- import type { BatchId, ProjectId, RunId, VariantId } from "./identifiers.js";
17
- /** The six governed project-event kinds. */
18
- export type ProjectEventKind = "batch-attached" | "run-started" | "clarifying-answer" | "pairwise-preference" | "reference-chosen" | "scheme-adopted";
19
- /** The frozen tuple of every project-event kind, for enumeration. */
20
- export declare const PROJECT_EVENT_KINDS: readonly ProjectEventKind[];
21
- /** One clarifying question and the designer's answer. */
22
- export interface ClarifyingAnswer {
23
- question: string;
24
- answer: string;
25
- }
26
- /** One pairwise preference; `chosenId` is `leftId` or `rightId`. All three opaque. */
27
- export interface PairwisePreference {
28
- leftId: VariantId;
29
- rightId: VariantId;
30
- chosenId: VariantId;
31
- }
32
- /** One stored event; `payload` is validated to the shape of `kind`. */
33
- export interface ProjectEvent {
34
- eventId: string;
35
- kind: ProjectEventKind;
36
- payload: Record<string, unknown>;
37
- createdAt: string;
38
- }
39
- /** A lightweight project row for list views (no event fold). */
40
- export interface ProjectSummary {
41
- /** Opaque — round-trip verbatim. */
42
- projectId: ProjectId;
43
- principalId: string;
44
- name: string;
45
- createdAt: string;
46
- updatedAt: string;
47
- }
48
- /** A project's assembled read model — identity plus the folded event collections. */
49
- export interface ProjectState extends ProjectSummary {
50
- /** Source-material batches attached, oldest first. Opaque. */
51
- batchIds: BatchId[];
52
- /** Runs started from this project, oldest first. Opaque. */
53
- runIds: RunId[];
54
- answers: ClarifyingAnswer[];
55
- preferences: PairwisePreference[];
56
- chosenReferences: string[];
57
- adoptedSchemes: string[];
58
- events: ProjectEvent[];
59
- }
60
- /** `GET /api/v1/projects` — the caller's projects, newest first. */
61
- export interface ProjectListResponse {
62
- projects: ProjectSummary[];
63
- }
64
- /** `POST /api/v1/projects` request body. */
65
- export interface CreateProjectRequest {
66
- name?: string;
67
- }
68
- /** `POST /api/v1/projects/{projectId}/events` request body. */
69
- export interface AppendProjectEventRequest {
70
- kind: ProjectEventKind;
71
- payload: Record<string, unknown>;
72
- }
73
- /** `POST /api/v1/projects/{projectId}/events` response — the appended event receipt. */
74
- export interface ProjectEventReceipt {
75
- eventId: string;
76
- projectId: ProjectId;
77
- kind: ProjectEventKind;
78
- createdAt: string;
79
- }
package/project-types.js DELETED
@@ -1,9 +0,0 @@
1
- /** The frozen tuple of every project-event kind, for enumeration. */
2
- export const PROJECT_EVENT_KINDS = Object.freeze([
3
- "batch-attached",
4
- "run-started",
5
- "clarifying-answer",
6
- "pairwise-preference",
7
- "reference-chosen",
8
- "scheme-adopted",
9
- ]);
package/projects.d.ts DELETED
@@ -1,13 +0,0 @@
1
- import { HttpTransport } from "./http-transport.js";
2
- import type { AppendProjectEventRequest, CreateProjectRequest, ProjectEventReceipt, ProjectListResponse, ProjectState } from "./project-types.js";
3
- /** Create a project (`POST /api/v1/projects`). Requires the `mg:ingest` scope. */
4
- export declare function createProject(transport: HttpTransport, body?: CreateProjectRequest, signal?: AbortSignal): Promise<ProjectState>;
5
- /** Read a project's assembled state (`GET /api/v1/projects/{projectId}`). */
6
- export declare function getProject(transport: HttpTransport, projectId: string, signal?: AbortSignal): Promise<ProjectState>;
7
- /**
8
- * Append one event to a project's process trail
9
- * (`POST /api/v1/projects/{projectId}/events`). Requires the `mg:ingest` scope.
10
- */
11
- export declare function appendProjectEvent(transport: HttpTransport, projectId: string, body: AppendProjectEventRequest, signal?: AbortSignal): Promise<ProjectEventReceipt>;
12
- /** List your own projects, newest first (`GET /api/v1/projects`). */
13
- export declare function listProjects(transport: HttpTransport, signal?: AbortSignal): Promise<ProjectListResponse>;
package/projects.js DELETED
@@ -1,46 +0,0 @@
1
- /**
2
- * The persistent-project namespace of the SDK. Thin wrappers over the shared
3
- * {@link HttpTransport} for the `/api/v1/projects` surface: create a project,
4
- * read its assembled state, append process-trail events, and list your own.
5
- * Box's proxy routes are thin wrappers over exactly these calls.
6
- */
7
- import { MaterialGraphError } from "./errors.js";
8
- import { HttpTransport } from "./http-transport.js";
9
- import { findSdkOperation } from "./operations.js";
10
- function projectOperation(operationId) {
11
- const match = findSdkOperation(operationId);
12
- if (!match)
13
- throw MaterialGraphError.unexpected(`Unknown SDK operation: ${operationId}`);
14
- return match;
15
- }
16
- /** Create a project (`POST /api/v1/projects`). Requires the `mg:ingest` scope. */
17
- export function createProject(transport, body = {}, signal) {
18
- return transport.requestJson(projectOperation("create_box_project"), {
19
- body,
20
- signal,
21
- });
22
- }
23
- /** Read a project's assembled state (`GET /api/v1/projects/{projectId}`). */
24
- export function getProject(transport, projectId, signal) {
25
- return transport.requestJson(projectOperation("get_box_project"), {
26
- pathParams: { projectId },
27
- signal,
28
- });
29
- }
30
- /**
31
- * Append one event to a project's process trail
32
- * (`POST /api/v1/projects/{projectId}/events`). Requires the `mg:ingest` scope.
33
- */
34
- export function appendProjectEvent(transport, projectId, body, signal) {
35
- return transport.requestJson(projectOperation("append_box_project_event"), {
36
- body,
37
- pathParams: { projectId },
38
- signal,
39
- });
40
- }
41
- /** List your own projects, newest first (`GET /api/v1/projects`). */
42
- export function listProjects(transport, signal) {
43
- return transport.requestJson(projectOperation("list_box_projects"), {
44
- signal,
45
- });
46
- }
@@ -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 interface RenderAssetFreshness {
6
- revision: string;
7
- updatedAt: string | null;
8
- checkedAt: string | null;
9
- }
10
- export interface 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 interface 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 interface 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 {};
package/run-events.d.ts DELETED
@@ -1,106 +0,0 @@
1
- import type { RunEvent } from "./run-types.js";
2
- /**
3
- * Typed payloads for the composition Run event family — the friction fix flagged
4
- * by the MG-443 walk. These narrow the loose {@link RunEvent.payloadJson} so
5
- * consumers (the Box console) can render phase progress, the parsed programme,
6
- * and the criteria-correction UI without re-typing each payload at the call
7
- * site.
8
- *
9
- * Both wire generations are covered: the CURRENT `composition.*` strings the
10
- * server emits today, and the LEGACY `material-box.*` strings kept for read-side
11
- * dual-read compatibility. Shapes mirror
12
- * `packages/mastra/src/workflow/composition/events.ts` and the
13
- * `reviewCriteriaSuspendPayloadSchema` in `@materialgraph/products` — expressed
14
- * as standalone TS types (no cross-package import; the SDK is publishable).
15
- */
16
- import type { OpenEnum } from "./types.js";
17
- export declare const COMPOSITION_PHASE_EVENT_TYPES: readonly ["composition.phase", "material-box.phase"];
18
- export declare const COMPOSITION_PROGRAMME_EVENT_TYPES: readonly ["composition.programme", "material-box.brief"];
19
- export declare const COMPOSITION_REVIEW_CRITERIA_EVENT_TYPES: readonly ["composition.review-criteria", "material-box.review-criteria"];
20
- export type CompositionPhaseEventType = (typeof COMPOSITION_PHASE_EVENT_TYPES)[number];
21
- export type CompositionProgrammeEventType = (typeof COMPOSITION_PROGRAMME_EVENT_TYPES)[number];
22
- export type CompositionReviewCriteriaEventType = (typeof COMPOSITION_REVIEW_CRITERIA_EVENT_TYPES)[number];
23
- /** Payload of a `composition.phase` / `material-box.phase` progress event. */
24
- export interface CompositionPhasePayload {
25
- workflow: OpenEnum<"parse-material-brief" | "compose-material-schemes">;
26
- phase: string;
27
- label: string;
28
- state: OpenEnum<"started" | "completed" | "failed">;
29
- /** Additive narration (file names, error messages); absent on older events. */
30
- detail?: string;
31
- /** Additive tallies (slot/candidate/scheme counts); absent on older events. */
32
- counts?: Record<string, number>;
33
- }
34
- /**
35
- * Payload of a `composition.programme` / `material-box.brief` event. The current
36
- * generation carries `programme`; the legacy generation carried `brief`. Both
37
- * are read structurally (the parsed programme document).
38
- */
39
- export interface CompositionProgrammePayload {
40
- programme?: unknown;
41
- brief?: unknown;
42
- }
43
- /** One unresolved brief phrase offered for human correction at the review step. */
44
- export interface CompositionReviewCriteriaSuggestion {
45
- attributeId: string;
46
- name: string;
47
- term?: string;
48
- score: number;
49
- }
50
- /** Exact UTF-16 passage retained from the brief; no page coordinate is implied. */
51
- export interface CompositionBriefCriterionSourceRef {
52
- sourceId: string;
53
- quote: string;
54
- textRange: {
55
- start: number;
56
- end: number;
57
- unit: "utf16";
58
- };
59
- }
60
- export interface CompositionReviewCriteriaUnresolved {
61
- slotId: string;
62
- /** Unresolved negative language requires an explicit review decision. */
63
- polarity?: "exclusion";
64
- raw: string;
65
- sourceRefs?: CompositionBriefCriterionSourceRef[];
66
- /**
67
- * Ranked corrections, best first. MG-994: every one of these is an attribute
68
- * the slot's own category holds accepted values for, so accepting the top
69
- * suggestion can never leave the slot unfillable.
70
- */
71
- suggestions: CompositionReviewCriteriaSuggestion[];
72
- /**
73
- * MG-994: attribute ids ranked for this phrase and then withheld — the slot's
74
- * category holds no accepted value for them. ABSENT when nothing was withheld
75
- * (absent means nothing was removed, not that nothing could be).
76
- */
77
- withheld?: string[];
78
- }
79
- /**
80
- * Payload of a `composition.review-criteria` / `material-box.review-criteria`
81
- * suspend event — the correction grammar the Box review step renders.
82
- */
83
- export interface CompositionReviewCriteriaPayload {
84
- unresolved: CompositionReviewCriteriaUnresolved[];
85
- }
86
- export interface CompositionPhaseEvent extends RunEvent {
87
- type: CompositionPhaseEventType;
88
- payloadJson: CompositionPhasePayload;
89
- }
90
- export interface CompositionProgrammeEvent extends RunEvent {
91
- type: CompositionProgrammeEventType;
92
- payloadJson: CompositionProgrammePayload;
93
- }
94
- export interface CompositionReviewCriteriaEvent extends RunEvent {
95
- type: CompositionReviewCriteriaEventType;
96
- payloadJson: CompositionReviewCriteriaPayload;
97
- }
98
- /** The discriminated union of all composition Run events. */
99
- export type CompositionEvent = CompositionPhaseEvent | CompositionProgrammeEvent | CompositionReviewCriteriaEvent;
100
- /**
101
- * Narrow a {@link RunEvent} to the composition family by its `type`, returning
102
- * `null` for lifecycle events (`queued`, `running`, `succeeded`, …) and any
103
- * unknown type. Narrowing is by the discriminating `type` only — payloads are
104
- * trusted structurally per the tolerant-parsing contract, never re-validated.
105
- */
106
- export declare function parseRunEvent(event: RunEvent): CompositionEvent | null;
package/run-events.js DELETED
@@ -1,32 +0,0 @@
1
- // ── Wire event-type strings (both generations) ───────────────────────────────
2
- export const COMPOSITION_PHASE_EVENT_TYPES = [
3
- "composition.phase",
4
- "material-box.phase",
5
- ];
6
- export const COMPOSITION_PROGRAMME_EVENT_TYPES = [
7
- "composition.programme",
8
- "material-box.brief",
9
- ];
10
- export const COMPOSITION_REVIEW_CRITERIA_EVENT_TYPES = [
11
- "composition.review-criteria",
12
- "material-box.review-criteria",
13
- ];
14
- const includesType = (types, type) => types.includes(type);
15
- /**
16
- * Narrow a {@link RunEvent} to the composition family by its `type`, returning
17
- * `null` for lifecycle events (`queued`, `running`, `succeeded`, …) and any
18
- * unknown type. Narrowing is by the discriminating `type` only — payloads are
19
- * trusted structurally per the tolerant-parsing contract, never re-validated.
20
- */
21
- export function parseRunEvent(event) {
22
- if (includesType(COMPOSITION_PHASE_EVENT_TYPES, event.type)) {
23
- return event;
24
- }
25
- if (includesType(COMPOSITION_PROGRAMME_EVENT_TYPES, event.type)) {
26
- return event;
27
- }
28
- if (includesType(COMPOSITION_REVIEW_CRITERIA_EVENT_TYPES, event.type)) {
29
- return event;
30
- }
31
- return null;
32
- }
@@ -1,46 +0,0 @@
1
- /** A personal preference; diminished references stay on the research board. */
2
- export type ScheduleReferenceInfluence = "kept" | "diminished";
3
- export interface PutScheduleReferenceFeedback {
4
- /** Reuse unchanged after an uncertain response; a different command needs a new id. */
5
- requestId: string;
6
- /** The version last read for this reference, or zero before its first decision. */
7
- expectedFeedbackVersion: number;
8
- sourceRunId: string;
9
- influence: ScheduleReferenceInfluence;
10
- }
11
- export type ScheduleReferenceSource = {
12
- kind: "image";
13
- laneId: string;
14
- imageRef: string;
15
- sourceName: string;
16
- sourceDomain: string;
17
- url: string | null;
18
- caption: string;
19
- } | {
20
- kind: "web";
21
- domain: string;
22
- url: string;
23
- statement: string;
24
- implication: string;
25
- };
26
- /** Immutable receipt for one decision, including the exact research frame it came from. */
27
- export interface ScheduleReferenceFeedback {
28
- eventId: string;
29
- scheduleId: string;
30
- referenceId: string;
31
- version: number;
32
- requestId: string;
33
- sourceRunId: string;
34
- sourceEventSequence: number;
35
- source: ScheduleReferenceSource;
36
- scope: {
37
- kind: "project";
38
- };
39
- originalVerdict: "kept" | "set-aside";
40
- influence: ScheduleReferenceInfluence;
41
- decidedByPrincipalId: string;
42
- decidedAt: string;
43
- }
44
- export interface ScheduleReferenceFeedbackList {
45
- items: ScheduleReferenceFeedback[];
46
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,14 +0,0 @@
1
- import type { HttpTransport } from "./http-transport.js";
2
- import type { PutScheduleReferenceFeedback, ScheduleReferenceFeedback, ScheduleReferenceFeedbackList } from "./schedule-reference-types.js";
3
- /** Schedule-owned preferences, independent of an issued document's revision. */
4
- export declare class ScheduleReferencesClient {
5
- #private;
6
- constructor(transport: HttpTransport);
7
- /** Read the latest saved preference for each reference. Empty means no decisions yet. */
8
- list(scheduleId: string, signal?: AbortSignal): Promise<ScheduleReferenceFeedbackList>;
9
- /**
10
- * Save or reverse a preference. An exact request replay returns its original receipt;
11
- * it does not undo newer decisions. A stale reference version raises a 409.
12
- */
13
- put(scheduleId: string, referenceId: string, input: PutScheduleReferenceFeedback, signal?: AbortSignal): Promise<ScheduleReferenceFeedback>;
14
- }