@howells/motif-sdk 6.0.0 → 7.0.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/README.md +5 -5
- package/dist/image.js +7 -605
- package/dist/index.cjs +11 -746
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -746
- package/dist/registry.d.ts +1757 -0
- package/dist/registry.js +2714 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@ Every Task function returns `Result<TaskOutput, MotifError>` from `neverthrow` a
|
|
|
34
34
|
|
|
35
35
|
## Curated Models and Tiers
|
|
36
36
|
|
|
37
|
-
The Task client curates
|
|
37
|
+
The Task client curates 23 generation Models, with separate rankings for generation and editing. Both follow Arena, read 29 October 2026. `TASKS.generate` and `TASKS.vary` expose the current choices, Tiers and evidence in `basis` and `rankedAt`. A generation with `references` uses the editing ranking.
|
|
38
38
|
|
|
39
39
|
| Tier | Generation default | Editing default |
|
|
40
40
|
| -------------------- | ------------------ | ----------------- |
|
|
@@ -42,11 +42,11 @@ The Task client curates 24 generation Models, with separate rankings for generat
|
|
|
42
42
|
| `balanced` (default) | Nano Banana 2.1 | Grok Image 2 |
|
|
43
43
|
| `fast` | Nano Banana 2 Lite | Grok |
|
|
44
44
|
|
|
45
|
-
These are the first choices when the request's capabilities and available keys permit them. Explicit Models, Looks and pins take precedence. Selected specialists remain for typography, transparency, control and inexpensive drafts.
|
|
45
|
+
These are the first choices when the request's capabilities and available keys permit them. Explicit Models, Looks and pins take precedence. Selected specialists remain for typography, transparency, control and inexpensive drafts.
|
|
46
46
|
|
|
47
47
|
Nano Banana 2.1 (`banana21`) supports up to 14 References and 1K/2K/4K output, with no 0.5K output. Its balanced placement uses preliminary Arena evidence. Sunburst and Flare run GPT Image 2.6 on fal and default to `quality: "max"`; `params: { quality: "high" }` with an explicit `model` overrides it. Both also return an animated GIF (`outputFormat: "gif"`, with `params.frame_count` and `params.frame_duration_ms`) or, from text, an SVG (`outputFormat: "svg"`), and take `markup`: a transparent PNG of arrows, circles and notes the size of the image being edited, which guides a vary or an edit with References. Asking for a format or markup limits the choice to Models that support it. The direct provider image layer described below has its own adapter capabilities and chooses no Model.
|
|
48
48
|
|
|
49
|
-
Token-billed Task plans, including Sunburst, Flare, Nano Banana 2.1, Banana Lite and MAI 2.5, report `cost: { usd: null, basis: "unknown" }`; a published representative price is not an exact total.
|
|
49
|
+
Token-billed Task plans, including Sunburst, Flare, Nano Banana 2.1, Banana Lite and MAI 2.5, report `cost: { usd: null, basis: "unknown" }`; a published representative price is not an exact total.
|
|
50
50
|
|
|
51
51
|
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.
|
|
52
52
|
|
|
@@ -73,7 +73,7 @@ if (plan.isOk()) {
|
|
|
73
73
|
|
|
74
74
|
## Stream a Task
|
|
75
75
|
|
|
76
|
-
`stream(task, input, options?)` opens a direct inference stream on the resolved route. Streaming is explicitly supported for GPT Image 1.5
|
|
76
|
+
`stream(task, input, options?)` opens a direct inference stream on the resolved route. Streaming is explicitly supported for GPT Image 1.5, including its edit route. Other routes return `STREAMING_UNSUPPORTED` before any provider request; Motif never substitutes another model or retries a stream.
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
79
|
const controller = new AbortController();
|
|
@@ -100,7 +100,7 @@ Events use `images`, `progress` or `provider` types. Images carry the same `Task
|
|
|
100
100
|
|
|
101
101
|
The handle exposes `plan`, optional `requestId` and `abort()`. Consume its events once. Abort, iterator exit and the overall deadline close local consumption; this does not guarantee cancellation of provider work or a refund. There is no queue submission, reconnection or retry. `plan()` remains a normal execution plan, so its `queued` flag describes `run()`, not `stream()`.
|
|
102
102
|
|
|
103
|
-
For a local checkout, `node packages/motif-sdk/examples/stream.mjs
|
|
103
|
+
For a local checkout, `node packages/motif-sdk/examples/stream.mjs` prints the resolved request without a provider call. Adding `--run` spends provider credits; it requires `FAL_KEY` and a built SDK. The runner is a repository example, not a packaged public API.
|
|
104
104
|
|
|
105
105
|
## Main Exports
|
|
106
106
|
|