@instruments/materialgraph 0.9.0 → 0.9.1
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/match-stream-types.d.ts +35 -5
- package/match-stream-types.js +16 -2
- package/package.json +1 -1
package/match-stream-types.d.ts
CHANGED
|
@@ -26,8 +26,16 @@ export type MatchMaterialFunction = (typeof MATCH_MATERIAL_FUNCTIONS)[number];
|
|
|
26
26
|
/** The workflow's coarse progress phase, narrated by a `step` event. */
|
|
27
27
|
export declare const MATCH_WORKFLOW_STEPS: readonly ["classifying", "decomposing", "matching", "complete"];
|
|
28
28
|
export type MatchWorkflowStep = (typeof MATCH_WORKFLOW_STEPS)[number];
|
|
29
|
-
/**
|
|
30
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Where one surface stands in the run.
|
|
31
|
+
*
|
|
32
|
+
* `colour_fallback` (appended, additive): the surface completed, but through
|
|
33
|
+
* the colour lane — its visible sample was too small to read texture, so the
|
|
34
|
+
* results match the region's palette, scoped to the detected category. Such a
|
|
35
|
+
* surface carries a `note` saying so and no `senseCheck` verdicts (there is no
|
|
36
|
+
* texture to verify).
|
|
37
|
+
*/
|
|
38
|
+
export declare const MATCH_SURFACE_STATUSES: readonly ["pending", "matching", "complete", "error", "colour_fallback"];
|
|
31
39
|
export type MatchSurfaceStatus = (typeof MATCH_SURFACE_STATUSES)[number];
|
|
32
40
|
/** Every frame type the stream can carry — the union's discriminant values. */
|
|
33
41
|
export declare const MATCH_STREAM_EVENT_TYPES: readonly ["step", "classified", "surfaces", "surface", "heartbeat", "complete", "error"];
|
|
@@ -112,9 +120,10 @@ export interface MatchSurfaceResult {
|
|
|
112
120
|
senseCheck?: MatchSenseCheckCell[];
|
|
113
121
|
/**
|
|
114
122
|
* TRUE on the interim frame that delivers finished results while the verifier
|
|
115
|
-
* is still reading them.
|
|
116
|
-
*
|
|
117
|
-
*
|
|
123
|
+
* is still reading them. Render the rows immediately. The follow-up frame
|
|
124
|
+
* carries the SAME rows with verdicts attached, settled once into verdict
|
|
125
|
+
* bands (confirmed → abstained → rejected, stable within each band) — the
|
|
126
|
+
* page's one settling reorder. Nothing is ever removed.
|
|
118
127
|
*/
|
|
119
128
|
senseCheckPending?: boolean;
|
|
120
129
|
/**
|
|
@@ -128,6 +137,12 @@ export interface MatchSurfaceResult {
|
|
|
128
137
|
hex: string;
|
|
129
138
|
proportion: number;
|
|
130
139
|
}>;
|
|
140
|
+
/**
|
|
141
|
+
* One sentence of provenance a consumer may render verbatim, when the server
|
|
142
|
+
* sent one — e.g. the `colour_fallback` explanation carrying the refused
|
|
143
|
+
* sample's pixel size. Absent on ordinary surfaces.
|
|
144
|
+
*/
|
|
145
|
+
note?: string;
|
|
131
146
|
/** Present only on `status: "error"` — why this one surface failed. */
|
|
132
147
|
error?: string;
|
|
133
148
|
}
|
|
@@ -161,6 +176,21 @@ export interface MatchWorkflowResult {
|
|
|
161
176
|
* "nothing above the floor". Do not fold `surfaces[]` to tell those apart.
|
|
162
177
|
*/
|
|
163
178
|
totals: MatchRunTotals;
|
|
179
|
+
/**
|
|
180
|
+
* Whole-image palette matches, sent ONLY when an installation photo yielded
|
|
181
|
+
* no usable surfaces at all. These match the image's overall palette — they
|
|
182
|
+
* are not material identifications, and the note says so. A consumer that
|
|
183
|
+
* ignores this field sees exactly the empty run it saw before the field
|
|
184
|
+
* existed.
|
|
185
|
+
*/
|
|
186
|
+
paletteMatches?: {
|
|
187
|
+
results: SearchResultItem[];
|
|
188
|
+
palette: Array<{
|
|
189
|
+
hex: string;
|
|
190
|
+
proportion: number;
|
|
191
|
+
}>;
|
|
192
|
+
note: string;
|
|
193
|
+
};
|
|
164
194
|
/**
|
|
165
195
|
* What a SWATCH run compared against — a swatch detects no surfaces, so it has
|
|
166
196
|
* nowhere else to put this. A scene run reports per surface instead.
|
package/match-stream-types.js
CHANGED
|
@@ -14,8 +14,22 @@ export const MATCH_MATERIAL_FUNCTIONS = [
|
|
|
14
14
|
];
|
|
15
15
|
/** The workflow's coarse progress phase, narrated by a `step` event. */
|
|
16
16
|
export const MATCH_WORKFLOW_STEPS = ["classifying", "decomposing", "matching", "complete"];
|
|
17
|
-
/**
|
|
18
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Where one surface stands in the run.
|
|
19
|
+
*
|
|
20
|
+
* `colour_fallback` (appended, additive): the surface completed, but through
|
|
21
|
+
* the colour lane — its visible sample was too small to read texture, so the
|
|
22
|
+
* results match the region's palette, scoped to the detected category. Such a
|
|
23
|
+
* surface carries a `note` saying so and no `senseCheck` verdicts (there is no
|
|
24
|
+
* texture to verify).
|
|
25
|
+
*/
|
|
26
|
+
export const MATCH_SURFACE_STATUSES = [
|
|
27
|
+
"pending",
|
|
28
|
+
"matching",
|
|
29
|
+
"complete",
|
|
30
|
+
"error",
|
|
31
|
+
"colour_fallback",
|
|
32
|
+
];
|
|
19
33
|
/** Every frame type the stream can carry — the union's discriminant values. */
|
|
20
34
|
export const MATCH_STREAM_EVENT_TYPES = [
|
|
21
35
|
"step",
|