@instruments/materialgraph 0.24.0 → 0.26.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 (124) hide show
  1. package/association-types.d.ts +20 -20
  2. package/associations-client.d.ts +4 -4
  3. package/associations-client.js +3 -10
  4. package/attribution-types.d.ts +3 -3
  5. package/brand-most-sampled-types.d.ts +4 -4
  6. package/brand-types.d.ts +6 -6
  7. package/brands-client.d.ts +4 -4
  8. package/brands-client.js +9 -13
  9. package/browse-types.d.ts +8 -8
  10. package/by-colour-types.d.ts +18 -18
  11. package/by-spec-types.d.ts +14 -14
  12. package/catalog-discovery-types.d.ts +14 -14
  13. package/catalogue-client.d.ts +4 -4
  14. package/catalogue-client.js +38 -37
  15. package/catalogue-types.d.ts +4 -4
  16. package/citation-types.d.ts +4 -4
  17. package/client-browse.d.ts +4 -4
  18. package/client-browse.js +24 -25
  19. package/client-config.d.ts +2 -2
  20. package/client-exploration.d.ts +3 -3
  21. package/client-exploration.js +4 -6
  22. package/client-source-material-comments.d.ts +4 -4
  23. package/client-source-material-comments.js +4 -38
  24. package/client-vocabulary.d.ts +8 -8
  25. package/client-vocabulary.js +20 -30
  26. package/client.d.ts +11 -45
  27. package/client.js +143 -188
  28. package/codes-client.d.ts +2 -2
  29. package/codes-client.js +8 -8
  30. package/codes-types.d.ts +34 -34
  31. package/colour-aggregate-types.d.ts +24 -24
  32. package/colours-client.d.ts +2 -2
  33. package/colours-client.js +15 -15
  34. package/compare-types.d.ts +10 -10
  35. package/composition-client.d.ts +3 -3
  36. package/composition-client.js +8 -7
  37. package/composition-types.d.ts +12 -12
  38. package/coordinate-client.d.ts +2 -2
  39. package/coordinate-client.js +1 -13
  40. package/corpus-scope-types.d.ts +3 -3
  41. package/corpus-scope-types.js +1 -25
  42. package/correction-types.d.ts +10 -10
  43. package/demand-batch-types.d.ts +18 -18
  44. package/demand-types.d.ts +24 -24
  45. package/errors.d.ts +12 -12
  46. package/errors.js +53 -52
  47. package/exploration-types.d.ts +29 -22
  48. package/fan-deck-types.d.ts +6 -6
  49. package/http-transport.d.ts +13 -21
  50. package/http-transport.js +31 -28
  51. package/identify-types.d.ts +10 -10
  52. package/index.d.ts +0 -6
  53. package/index.js +0 -2
  54. package/match-rejection-types.d.ts +6 -6
  55. package/match-stream-types.d.ts +32 -32
  56. package/match-stream.d.ts +2 -2
  57. package/match-stream.js +55 -41
  58. package/match-types.d.ts +8 -8
  59. package/material-asset-types.d.ts +26 -26
  60. package/material-block-types.d.ts +6 -6
  61. package/material-query-plan-types.d.ts +26 -26
  62. package/material-resources-client.d.ts +5 -5
  63. package/material-resources-client.js +10 -20
  64. package/material-types.d.ts +12 -12
  65. package/ndjson.js +16 -8
  66. package/operations.d.ts +6 -6
  67. package/operations.js +9 -39
  68. package/package.json +2 -2
  69. package/palette-completion-types.d.ts +22 -22
  70. package/palette-search-types.d.ts +28 -28
  71. package/query-understanding-types.d.ts +43 -36
  72. package/render-assets-types.d.ts +8 -8
  73. package/resolve-client.d.ts +2 -2
  74. package/resolve-client.js +4 -6
  75. package/resolve-colour-types.d.ts +22 -6
  76. package/resolve-types.d.ts +10 -10
  77. package/run-types.d.ts +70 -70
  78. package/runs.d.ts +13 -26
  79. package/runs.js +77 -89
  80. package/samplize-catalogue-types.d.ts +18 -18
  81. package/samplize-colorvec.d.ts +20 -20
  82. package/samplize-colorvec.js +66 -42
  83. package/schema-resource-types.d.ts +38 -38
  84. package/schema-resource-types.js +5 -5
  85. package/search-card-types.d.ts +14 -5
  86. package/search-collapse-types.d.ts +4 -4
  87. package/search-mood-types.d.ts +2 -2
  88. package/search-refinement-types.d.ts +8 -8
  89. package/search-request-types.d.ts +6 -6
  90. package/search-response-receipt-types.d.ts +135 -34
  91. package/search-response-types.d.ts +2 -2
  92. package/search-result-validation.d.ts +3 -3
  93. package/search-result-validation.js +53 -36
  94. package/search-window-types.d.ts +2 -2
  95. package/slot-pool-types.d.ts +20 -20
  96. package/source-material-validation.d.ts +3 -3
  97. package/source-material-validation.js +35 -39
  98. package/spec-facet-types.d.ts +10 -10
  99. package/spec-types.d.ts +6 -6
  100. package/specifications.d.ts +9 -25
  101. package/specifications.js +15 -21
  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 +7 -7
  106. package/suggest-types.js +3 -3
  107. package/taxonomy-coverage-types.d.ts +8 -8
  108. package/types.d.ts +119 -119
  109. package/validation.d.ts +26 -26
  110. package/validation.js +97 -92
  111. package/webmcp.d.ts +2 -2
  112. package/webmcp.generated.js +94 -87
  113. package/project-types.d.ts +0 -79
  114. package/project-types.js +0 -9
  115. package/projects.d.ts +0 -13
  116. package/projects.js +0 -46
  117. package/run-events.d.ts +0 -106
  118. package/run-events.js +0 -32
  119. package/schedule-reference-types.d.ts +0 -46
  120. package/schedule-reference-types.js +0 -1
  121. package/schedule-references-client.d.ts +0 -14
  122. package/schedule-references-client.js +0 -26
  123. package/schedule-types.d.ts +0 -261
  124. package/schedule-types.js +0 -1
package/runs.js CHANGED
@@ -6,67 +6,72 @@
6
6
  * wrappers over exactly these calls.
7
7
  */
8
8
  import { MaterialGraphError } from "./errors.js";
9
- import { HttpTransport } from "./http-transport.js";
10
- import { findSdkOperation, operationPath, } from "./operations.js";
11
- import { TERMINAL_RUN_EVENT_TYPES, } from "./run-types.js";
9
+ import { findSdkOperation, operationPath } from "./operations.js";
10
+ import { TERMINAL_RUN_EVENT_TYPES } from "./run-types.js";
12
11
  import { checkPostSourceMaterialCommentResult, checkSourceMaterialBatchDetail, checkSourceMaterialCommentThread, } from "./source-material-validation.js";
13
12
  import { readSseFrames } from "./sse.js";
14
- function runOperation(operationId) {
13
+ const runOperation = (operationId) => {
15
14
  const match = findSdkOperation(operationId);
16
- if (!match)
15
+ if (!match) {
17
16
  throw MaterialGraphError.unexpected(`Unknown SDK operation: ${operationId}`);
17
+ }
18
18
  return match;
19
- }
19
+ };
20
20
  /** Build a `Blob` from raw bytes, normalising to an ArrayBuffer-backed view. */
21
- function bytesToBlob(input) {
21
+ const bytesToBlob = (input) => {
22
22
  const type = input.contentType ? { type: input.contentType } : {};
23
- if (input.data instanceof ArrayBuffer)
23
+ if (input.data instanceof ArrayBuffer) {
24
24
  return new Blob([input.data], type);
25
+ }
25
26
  // A Uint8Array may be SharedArrayBuffer-backed; copy into a fresh view so the
26
27
  // Blob part is unambiguously ArrayBuffer-backed (no cast needed).
27
28
  const copy = new Uint8Array(input.data.byteLength);
28
29
  copy.set(input.data);
29
30
  return new Blob([copy], type);
30
- }
31
+ };
31
32
  /** Append one file to the multipart body, from either input form. */
32
- function appendFile(form, field, input) {
33
+ const appendFile = (form, field, input) => {
33
34
  if (input instanceof Blob) {
34
- if (input instanceof File)
35
+ if (input instanceof File) {
35
36
  form.append(field, input, input.name);
36
- else
37
+ }
38
+ else {
37
39
  form.append(field, input);
40
+ }
38
41
  return;
39
42
  }
40
43
  form.append(field, bytesToBlob(input), input.filename);
41
- }
44
+ };
42
45
  /**
43
46
  * Upload one atomic source-material batch (`POST /api/v1/source-material`).
44
47
  * Accepts the pile-of-files shape (`{ files }` → repeatable `files` field) or
45
48
  * the legacy `{ brief, references }` shape (→ `brief` + repeatable `references`
46
49
  * fields). Both wire to multipart the server accepts.
47
50
  */
48
- export async function uploadSourceMaterial(transport, input, signal) {
51
+ export const uploadSourceMaterial = async (transport, input, signal) => {
49
52
  const form = new FormData();
50
53
  if ("files" in input) {
51
- for (const file of input.files)
54
+ for (const file of input.files) {
52
55
  appendFile(form, "files", file);
56
+ }
53
57
  }
54
58
  else {
55
59
  appendFile(form, "brief", input.brief);
56
- for (const reference of input.references ?? [])
60
+ for (const reference of input.references ?? []) {
57
61
  appendFile(form, "references", reference);
62
+ }
58
63
  }
59
64
  const url = transport.buildUrl(operationPath(runOperation("upload_source_material")));
60
65
  // No Content-Type header: fetch sets multipart/form-data with the boundary.
61
66
  const { parsed } = await transport.send({
62
- method: "POST",
63
- url,
64
- headers: transport.authHeaders(),
65
67
  body: form,
68
+ headers: transport.authHeaders(),
69
+ method: "POST",
66
70
  signal,
71
+ url,
67
72
  });
68
73
  return parsed;
69
- }
74
+ };
70
75
  /**
71
76
  * Read back one uploaded batch (`GET /api/v1/source-material/{batchId}`): every
72
77
  * file with a fetchable `url`, and every analysis computed over its bytes
@@ -79,13 +84,13 @@ export async function uploadSourceMaterial(transport, input, signal) {
79
84
  * the server's Zod contract so a malformed response fails here with a path into
80
85
  * the payload rather than as an undefined three frames away in caller code.
81
86
  */
82
- export async function getSourceMaterialBatch(transport, batchId, signal) {
87
+ export const getSourceMaterialBatch = async (transport, batchId, signal) => {
83
88
  const body = await transport.requestJson(runOperation("get_source_material_batch"), {
84
89
  pathParams: { batchId },
85
90
  signal,
86
91
  });
87
92
  return checkSourceMaterialBatchDetail(body, batchId);
88
- }
93
+ };
89
94
  /**
90
95
  * Read one file's comment thread
91
96
  * (`GET /api/v1/source-material/{batchId}/sources/{sourceId}/comments`).
@@ -103,13 +108,13 @@ export async function getSourceMaterialBatch(transport, batchId, signal) {
103
108
  * A file that is not in that batch, or a batch you do not own, raises the same
104
109
  * 404 as a file that never existed.
105
110
  */
106
- export async function listSourceMaterialComments(transport, batchId, sourceId, signal) {
111
+ export const listSourceMaterialComments = async (transport, batchId, sourceId, signal) => {
107
112
  const body = await transport.requestJson(runOperation("list_source_material_comments"), {
108
113
  pathParams: { batchId, sourceId },
109
114
  signal,
110
115
  });
111
116
  return checkSourceMaterialCommentThread(body, sourceId);
112
- }
117
+ };
113
118
  /**
114
119
  * Add one remark to a file's thread
115
120
  * (`POST /api/v1/source-material/{batchId}/sources/{sourceId}/comments`).
@@ -125,7 +130,7 @@ export async function listSourceMaterialComments(transport, batchId, sourceId, s
125
130
  * The result is discriminated on `kind`: switch on it rather than reaching for
126
131
  * `replies`, which a `reply` does not have.
127
132
  */
128
- export async function postSourceMaterialComment(transport, batchId, sourceId, input, signal) {
133
+ export const postSourceMaterialComment = async (transport, batchId, sourceId, input, signal) => {
129
134
  const body = await transport.requestJson(runOperation("post_source_material_comment"), {
130
135
  // Built key by key rather than spread: `parentCommentId` and
131
136
  // `idempotencyKey` are forwarded only when PRESENT, so a caller that
@@ -145,20 +150,16 @@ export async function postSourceMaterialComment(transport, batchId, sourceId, in
145
150
  signal,
146
151
  });
147
152
  return checkPostSourceMaterialCommentResult(body, sourceId);
148
- }
153
+ };
149
154
  /** List invocable agents, workflows, and tools (`GET /api/v1/capabilities`). */
150
- export function capabilities(transport, signal) {
151
- return transport.requestJson(runOperation("list_public_capabilities"), {
152
- signal,
153
- });
154
- }
155
+ export const capabilities = async (transport, signal) => await transport.requestJson(runOperation("list_public_capabilities"), {
156
+ signal,
157
+ });
155
158
  /** Start an asynchronous capability Run (`POST /api/v1/runs`). */
156
- export function createRun(transport, body, signal) {
157
- return transport.requestJson(runOperation("create_public_run"), {
158
- body,
159
- signal,
160
- });
161
- }
159
+ export const createRun = async (transport, body, signal) => await transport.requestJson(runOperation("create_public_run"), {
160
+ body,
161
+ signal,
162
+ });
162
163
  /**
163
164
  * List your own Runs, newest first (`GET /api/v1/runs`).
164
165
  *
@@ -172,42 +173,22 @@ export function createRun(transport, body, signal) {
172
173
  * Page by following `nextCursor` until it is ABSENT — a full page is not the
173
174
  * signal to stop, and an absent cursor is the only one.
174
175
  */
175
- export function listRuns(transport, options = {}) {
176
+ export const listRuns = async (transport, options = {}) => {
176
177
  const query = {
177
178
  ...(options.status === undefined ? {} : { status: options.status }),
178
179
  ...(options.limit === undefined ? {} : { limit: options.limit }),
179
180
  ...(options.cursor === undefined ? {} : { cursor: options.cursor }),
180
181
  };
181
- return transport.requestJson(runOperation("list_public_runs"), {
182
+ return await transport.requestJson(runOperation("list_public_runs"), {
182
183
  ...(Object.keys(query).length > 0 ? { query } : {}),
183
184
  ...(options.signal ? { signal: options.signal } : {}),
184
185
  });
185
- }
186
+ };
186
187
  /** Get a Run's current state (`GET /api/v1/runs/{runId}`). */
187
- export function getRun(transport, runId, signal) {
188
- return transport.requestJson(runOperation("get_public_run"), {
189
- pathParams: { runId },
190
- signal,
191
- });
192
- }
193
- /**
194
- * Export a completed compose Run's scheme as a finish schedule — one row per
195
- * slot, every attribute value carrying its source and verification state
196
- * (`GET /api/v1/runs/{runId}/schedule`).
197
- *
198
- * The `.xlsx` form of the same export is deliberately NOT an SDK method: this
199
- * transport parses every response as text/JSON and has no binary read path, so
200
- * a bytes-returning method would mean a second transport surface for one file.
201
- * Fetch `GET /api/v1/runs/{runId}/schedule.xlsx` directly with the same bearer
202
- * key when you want the workbook.
203
- */
204
- export function getRunSchedule(transport, runId, options = {}) {
205
- return transport.requestJson(runOperation("get_run_finish_schedule"), {
206
- pathParams: { runId },
207
- ...(options.schemeId ? { query: { schemeId: options.schemeId } } : {}),
208
- ...(options.signal ? { signal: options.signal } : {}),
209
- });
210
- }
188
+ export const getRun = async (transport, runId, signal) => await transport.requestJson(runOperation("get_public_run"), {
189
+ pathParams: { runId },
190
+ signal,
191
+ });
211
192
  /**
212
193
  * Normalise `resumeRun`'s overloaded third argument.
213
194
  *
@@ -219,11 +200,12 @@ export function getRunSchedule(transport, runId, options = {}) {
219
200
  * `{ signal }` with no `stepId` is a perfectly valid options object, and a
220
201
  * key-presence test would misread it as a signal and silently drop the abort.
221
202
  */
222
- function resumeOptions(value) {
223
- if (value === undefined)
203
+ const resumeOptions = (value) => {
204
+ if (value === undefined) {
224
205
  return {};
206
+ }
225
207
  return value instanceof AbortSignal ? { signal: value } : value;
226
- }
208
+ };
227
209
  /**
228
210
  * Resume a suspended Run (`POST /api/v1/runs/{runId}/resume`).
229
211
  *
@@ -241,26 +223,25 @@ function resumeOptions(value) {
241
223
  * `JSON.stringify` drops both — so the distinction here is construction
242
224
  * intent, kept so the serialised body is provably unchanged for old callers.
243
225
  */
244
- export function resumeRun(transport, runId, resumeData, signalOrOptions) {
226
+ export const resumeRun = async (transport, runId, resumeData, signalOrOptions) => {
245
227
  const { stepId, signal } = resumeOptions(signalOrOptions);
246
- return transport.requestJson(runOperation("resume_public_run"), {
247
- body: { resumeData, ...(stepId !== undefined ? { stepId } : {}) },
228
+ return await transport.requestJson(runOperation("resume_public_run"), {
229
+ body: { resumeData, ...(stepId === undefined ? {} : { stepId }) },
248
230
  pathParams: { runId },
249
231
  signal,
250
232
  });
251
- }
233
+ };
252
234
  /** Request durable Run cancellation (`POST /api/v1/runs/{runId}/cancel`). */
253
- export function cancelRun(transport, runId, signal) {
254
- return transport.requestJson(runOperation("cancel_public_run"), {
255
- body: {},
256
- pathParams: { runId },
257
- signal,
258
- });
259
- }
235
+ export const cancelRun = async (transport, runId, signal) => await transport.requestJson(runOperation("cancel_public_run"), {
236
+ body: {},
237
+ pathParams: { runId },
238
+ signal,
239
+ });
260
240
  /** Decode one SSE `data:` frame into a {@link RunEvent}, or `null` when unusable. */
261
- function decodeRunEvent(data) {
262
- if (data.length === 0)
241
+ const decodeRunEvent = (data) => {
242
+ if (data.length === 0) {
263
243
  return null;
244
+ }
264
245
  let parsed;
265
246
  try {
266
247
  parsed = JSON.parse(data);
@@ -268,13 +249,15 @@ function decodeRunEvent(data) {
268
249
  catch (cause) {
269
250
  throw MaterialGraphError.unexpected(`MaterialGraph run-event stream sent an unparseable data frame: ${String(cause)}`);
270
251
  }
271
- if (typeof parsed !== "object" || parsed === null)
252
+ if (typeof parsed !== "object" || parsed === null) {
272
253
  return null;
254
+ }
273
255
  const record = parsed;
274
- if (typeof record.sequence !== "number" || typeof record.type !== "string")
256
+ if (typeof record.sequence !== "number" || typeof record.type !== "string") {
275
257
  return null;
258
+ }
276
259
  return parsed;
277
- }
260
+ };
278
261
  /**
279
262
  * Stream ordered Run events as an async iterator (`GET
280
263
  * /api/v1/runs/{runId}/events`, SSE). Iterates until the stream ends or
@@ -293,8 +276,9 @@ export async function* streamRunEvents(transport, runId, options = {}) {
293
276
  });
294
277
  for await (const frame of readSseFrames(body, options.signal)) {
295
278
  const event = decodeRunEvent(frame.data);
296
- if (event)
279
+ if (event) {
297
280
  yield event;
281
+ }
298
282
  }
299
283
  }
300
284
  /**
@@ -312,30 +296,34 @@ export async function* streamRunEvents(transport, runId, options = {}) {
312
296
  * failure (a real 4xx/5xx or transport error) still propagates, keeping the
313
297
  * fail-fast surface for genuine upstream problems.
314
298
  */
315
- export async function drainRunEvents(transport, runId, options) {
299
+ export const drainRunEvents = async (transport, runId, options) => {
316
300
  const collected = [];
317
301
  const controller = new AbortController();
318
- const timer = setTimeout(() => controller.abort(), options.deadlineMs);
302
+ const timer = setTimeout(() => {
303
+ controller.abort();
304
+ }, options.deadlineMs);
319
305
  try {
320
306
  for await (const event of streamRunEvents(transport, runId, {
321
307
  after: options.after,
322
308
  signal: controller.signal,
323
309
  })) {
324
310
  collected.push(event);
325
- if (TERMINAL_RUN_EVENT_TYPES.has(event.type))
311
+ if (TERMINAL_RUN_EVENT_TYPES.has(event.type)) {
326
312
  break;
313
+ }
327
314
  }
328
315
  }
329
316
  catch (error) {
330
317
  const causedByDeadline = controller.signal.aborted &&
331
318
  error instanceof MaterialGraphError &&
332
319
  error.kind === "aborted";
333
- if (!causedByDeadline)
320
+ if (!causedByDeadline) {
334
321
  throw error;
322
+ }
335
323
  }
336
324
  finally {
337
325
  clearTimeout(timer);
338
326
  controller.abort();
339
327
  }
340
328
  return collected;
341
- }
329
+ };
@@ -1,4 +1,4 @@
1
- export interface SamplizeCatalogueOptions {
1
+ export type SamplizeCatalogueOptions = {
2
2
  limit?: number;
3
3
  /** Continue with unchanged filters and sourceVersion; omit when filters change. */
4
4
  after?: string;
@@ -8,8 +8,8 @@ export interface SamplizeCatalogueOptions {
8
8
  collectionHandle?: string;
9
9
  /** Pin every subsequent page to the version returned by the first page. */
10
10
  sourceVersion?: string;
11
- }
12
- export interface SamplizeCatalogueProduct {
11
+ };
12
+ export type SamplizeCatalogueProduct = {
13
13
  variantId: string;
14
14
  productId: string;
15
15
  name: string;
@@ -38,18 +38,18 @@ export interface SamplizeCatalogueProduct {
38
38
  };
39
39
  sourceProductId: string;
40
40
  url: string;
41
- sizeVariants: Array<{
41
+ sizeVariants: {
42
42
  sourceVariantId: string;
43
43
  sku: string | null;
44
44
  title: string | null;
45
45
  price: number | null;
46
46
  inventoryAvailable: boolean;
47
47
  demand: SamplizeDemand | null;
48
- }>;
48
+ }[];
49
49
  publishedHexes: SamplizeHexObservation[];
50
50
  hexObservations: SamplizeHexObservation[];
51
- }
52
- export interface SamplizeCataloguePage {
51
+ };
52
+ export type SamplizeCataloguePage = {
53
53
  schemaVersion: 2;
54
54
  corpusScope: "samplizeCatalogue";
55
55
  sourceVersion: string;
@@ -60,8 +60,8 @@ export interface SamplizeCataloguePage {
60
60
  nextCursor: string | null;
61
61
  /** True on the final page; completeness requires collecting total unique IDs. */
62
62
  complete: boolean;
63
- }
64
- export interface SamplizeHexObservation {
63
+ };
64
+ export type SamplizeHexObservation = {
65
65
  hex: string;
66
66
  publisher: string;
67
67
  source: string;
@@ -69,30 +69,30 @@ export interface SamplizeHexObservation {
69
69
  sourceBasis: string;
70
70
  observedAt: string | null;
71
71
  differsFromSelected: boolean;
72
- }
73
- export interface SamplizePublicationSource {
72
+ };
73
+ export type SamplizePublicationSource = {
74
74
  publisher: "Samplize";
75
75
  source: "algolia_shopify_products";
76
76
  sourceUrl: string;
77
77
  observedAt: string | null;
78
- }
79
- export interface SamplizeLrvObservation extends SamplizePublicationSource {
78
+ };
79
+ export type SamplizeLrvObservation = {
80
80
  field: string;
81
81
  value: number;
82
- }
83
- export interface SamplizeDemand extends SamplizePublicationSource {
82
+ } & SamplizePublicationSource;
83
+ export type SamplizeDemand = {
84
84
  field: "recently_ordered_count";
85
85
  sourceVariantId: string;
86
86
  grain: "shopify_variant";
87
87
  recentlyOrderedCount: number;
88
88
  /** The publisher does not supply the time window. */
89
89
  window: null;
90
- }
91
- export interface SamplizeCollectionMembership {
90
+ } & SamplizePublicationSource;
91
+ export type SamplizeCollectionMembership = {
92
92
  sourceCollectionId: string;
93
93
  handle: string;
94
94
  url: string;
95
95
  publisher: "Samplize";
96
96
  source: "algolia_shopify_products";
97
97
  observedAt: string | null;
98
- }
98
+ };
@@ -1,6 +1,6 @@
1
1
  export declare const SAMPLIZE_COLORVEC_RANKING_VERSION = "solid-colorvec-cosine-v2";
2
2
  export declare const SAMPLIZE_COLORVEC_EMBEDDING_VERSION = "oklch-anchor-quantiles-v12";
3
- export interface SamplizeColorVecPaint {
3
+ export type SamplizeColorVecPaint = {
4
4
  variantId: string;
5
5
  hex: string;
6
6
  brand: string;
@@ -13,22 +13,22 @@ export interface SamplizeColorVecPaint {
13
13
  lightness: string;
14
14
  intensity: string;
15
15
  vector: number[] | string;
16
- }
17
- export interface SamplizeColorVecCache {
16
+ };
17
+ export type SamplizeColorVecCache = {
18
18
  sourceVersion: string;
19
19
  dictionaryVersion: string;
20
20
  embeddingVersion: string;
21
21
  rankingVersion: string;
22
22
  generatedAt: string;
23
23
  paints: SamplizeColorVecPaint[];
24
- }
25
- export interface SamplizeColorVecInput {
24
+ };
25
+ export type SamplizeColorVecInput = {
26
26
  hex?: string;
27
27
  reference?: string;
28
- palette?: Array<{
28
+ palette?: {
29
29
  hex: string;
30
30
  proportion: number;
31
- }>;
31
+ }[];
32
32
  direction?: "similar" | "lighter" | "darker" | "muted";
33
33
  brand?: string[];
34
34
  family?: string[];
@@ -39,32 +39,32 @@ export interface SamplizeColorVecInput {
39
39
  temperatureMin?: number;
40
40
  temperatureMax?: number;
41
41
  limit?: number;
42
- }
42
+ };
43
43
  export declare const samplizeSolidColorVector: (hex: string) => number[];
44
44
  /** Canonical constraints are shared by full-cache similarity and constrained text retrieval. */
45
- export declare function selectSamplizeEligiblePaints<T extends Omit<SamplizeColorVecPaint, "vector">>(paints: T[], input: SamplizeColorVecInput): {
46
- reference: T | undefined;
47
- eligible: T[];
45
+ export declare const selectSamplizeEligiblePaints: <T extends Omit<SamplizeColorVecPaint, "vector">>(paints: T[], input: SamplizeColorVecInput) => {
48
46
  counts: Record<"brand" | "family" | "intensity" | "lightness", Record<string, number>>;
47
+ eligible: T[];
48
+ reference: T | undefined;
49
49
  };
50
50
  /** Official portable MG ranking over its complete versioned sampling-channel projection. */
51
- export declare function createSamplizeColorVecIndex(cache: SamplizeColorVecCache): {
51
+ export declare const createSamplizeColorVecIndex: (cache: SamplizeColorVecCache) => {
52
52
  search(input: SamplizeColorVecInput): {
53
- ids: string[];
53
+ countBasis: "complete-catalogue";
54
+ counts: Record<"brand" | "family" | "intensity" | "lightness", Record<string, number>>;
55
+ dictionaryVersion: string;
56
+ eligibleCount: number;
57
+ embeddingVersion: string;
54
58
  groups: {
55
59
  hex: string;
60
+ ids: string[];
56
61
  proportion: number;
57
62
  quota: number;
58
- ids: string[];
59
63
  shortfall: number;
60
64
  }[];
65
+ ids: string[];
61
66
  limited: boolean;
62
- eligibleCount: number;
63
- counts: Record<"brand" | "family" | "intensity" | "lightness", Record<string, number>>;
64
- sourceVersion: string;
65
- dictionaryVersion: string;
66
- embeddingVersion: string;
67
67
  rankingVersion: string;
68
- countBasis: "complete-catalogue";
68
+ sourceVersion: string;
69
69
  };
70
70
  };