@howells/motif-sdk 5.0.0 → 5.0.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/README.md CHANGED
@@ -32,7 +32,7 @@ console.log(result.value.model, result.value.files[0]?.url, result.value.cost);
32
32
 
33
33
  Every Task function returns `Result<TaskOutput, MotifError>` from `neverthrow` and does not throw for fal request failures; check `isErr()` / `isOk()`.
34
34
 
35
- Pass `onProgress(status, queuePosition)` to hear fal's queue state while a run waits: `"queued"` with its place in line, then `"in_progress"`, then `"completed"`. Passing it sends the run through fal's queue, since only the queue reports state. Models without streaming report state, not a percentage.
35
+ Pass `onProgress(status, queuePosition)` to hear fal's queue state while a run waits: `"queued"` with its place in line, then `"processing"`, then `"completed"` (or `"failed"`). Passing it sends the run through fal's queue, since only the queue reports state. Models without streaming report state, not a percentage.
36
36
 
37
37
  ## Plan Without Calling fal
38
38
 
package/dist/index.d.cts CHANGED
@@ -262,6 +262,15 @@ interface ImageSizeBounds {
262
262
  /** Both edges must be multiples of this. Motif uses 16 when absent. */
263
263
  multipleOf?: number;
264
264
  }
265
+ interface JobStatus {
266
+ error?: string;
267
+ logs?: {
268
+ message: string;
269
+ timestamp: string;
270
+ }[];
271
+ queuePosition?: number;
272
+ status: "queued" | "processing" | "completed" | "failed";
273
+ }
265
274
  /** ─── Configuration ──────────────────────────────────────────── */
266
275
  /** The network seam: a `fetch`-shaped function. */
267
276
  type FalFetch = (url: string, init: RequestInit) => Promise<Response>;
@@ -1189,10 +1198,10 @@ interface TaskInput {
1189
1198
  ephemeral?: boolean;
1190
1199
  /**
1191
1200
  * Called on each poll of fal's queue with its status ("queued",
1192
- * "in_progress", "completed") and, while queued, the place in line. Passing
1201
+ * "processing", "completed", "failed") and, while queued, the place in line. Passing
1193
1202
  * it runs a fal generation through the queue, since only the queue reports.
1194
1203
  */
1195
- onProgress?: (status: string, queuePosition?: number) => void;
1204
+ onProgress?: (status: JobStatus["status"], queuePosition?: number) => void;
1196
1205
  }
1197
1206
  interface TaskFile {
1198
1207
  /** Output key the URL came from, e.g. "image", "masks", "model_glb". */
package/dist/index.d.ts CHANGED
@@ -262,6 +262,15 @@ interface ImageSizeBounds {
262
262
  /** Both edges must be multiples of this. Motif uses 16 when absent. */
263
263
  multipleOf?: number;
264
264
  }
265
+ interface JobStatus {
266
+ error?: string;
267
+ logs?: {
268
+ message: string;
269
+ timestamp: string;
270
+ }[];
271
+ queuePosition?: number;
272
+ status: "queued" | "processing" | "completed" | "failed";
273
+ }
265
274
  /** ─── Configuration ──────────────────────────────────────────── */
266
275
  /** The network seam: a `fetch`-shaped function. */
267
276
  type FalFetch = (url: string, init: RequestInit) => Promise<Response>;
@@ -1189,10 +1198,10 @@ interface TaskInput {
1189
1198
  ephemeral?: boolean;
1190
1199
  /**
1191
1200
  * Called on each poll of fal's queue with its status ("queued",
1192
- * "in_progress", "completed") and, while queued, the place in line. Passing
1201
+ * "processing", "completed", "failed") and, while queued, the place in line. Passing
1193
1202
  * it runs a fal generation through the queue, since only the queue reports.
1194
1203
  */
1195
- onProgress?: (status: string, queuePosition?: number) => void;
1204
+ onProgress?: (status: JobStatus["status"], queuePosition?: number) => void;
1196
1205
  }
1197
1206
  interface TaskFile {
1198
1207
  /** Output key the URL came from, e.g. "image", "masks", "model_glb". */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@howells/motif-sdk",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Node SDK for Motif: image, video and 3D Tasks on fal.ai, with Motif choosing the Model.",
5
5
  "keywords": [
6
6
  "fal",