@shop-os/modelkit 0.1.7 → 0.1.9

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/CHANGELOG.md ADDED
@@ -0,0 +1,166 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@shop-os/modelkit`. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Dates are npm publish dates.
5
+
6
+ A release is a PR that touches only `packages/modelkit/**` and bumps `version`; merging it to
7
+ `dev` publishes. Add an entry under **Unreleased** with the change, and move it under the version
8
+ header in the release PR.
9
+
10
+ ## [Unreleased]
11
+
12
+ ## [0.1.9] - unreleased (publish pending)
13
+
14
+ ### Added
15
+ - `display.sortOrder`: pickers show lower values first, then catalog order; set it to surface a
16
+ new model at the top.
17
+ - `usage.slug` and `usage.providerLabel`: an app's historic usage-event names for a row, so
18
+ metering continuity no longer needs a per-model table in the app.
19
+ - Text rows carry their stream tuning: `providerOptions` (Anthropic thinking / adaptive, OpenAI
20
+ reasoning summaries, DeepSeek thinking), `capabilities.reasoning`, and `defaults.temperature`
21
+ (Kimi rows).
22
+ - `constraints.exactSizes` on the gpt-image-2 rows: the historic WxH per aspect ratio that Cowork
23
+ sends as `exactSize`.
24
+
25
+ ### Changed
26
+ - `deepseek-flash` (DeepSeek V4.1 Flash) replaces the `deepseek-v4-flash` row; the old id is an
27
+ alias, so stored selections and plan lists keep resolving. DeepSeek retired V4 Flash upstream and
28
+ serves the old id from V4.1 Flash at Flash rates.
29
+ - `resolveVideoOptions` enforces conditioning compatibility: a `sourceVideo` on a row without
30
+ `capabilities.acceptsSourceVideo`, or frames next to references on a row with
31
+ `framesExcludeReferences`, is an `unsupported_option` error, or is dropped with a warning
32
+ under `onUnsupported: "coerce"`.
33
+
34
+ ## [0.1.8] - 2026-09-11
35
+
36
+ ### Added
37
+ - `exposure: "catalog" | "internal"` is required on every row. `catalog` rows are offered in
38
+ product pickers (Creative Studio, chat, Space Builder); `internal` rows are callable by id
39
+ only. 47 rows are `catalog`. A snapshot test pins the set.
40
+ - `display.costTier` (1 to 3) and `display.recommended` on text rows, for the chat picker.
41
+ - `constraints.qualityOptions` on rows that support `quality`; `constraints.durationPresets`
42
+ where the UI offers a short list over a duration range. `resolveOptions` ignores both.
43
+ - `@shop-os/modelkit/catalog`: a browser-safe subpath with `Catalog`, `MODELS`, the per-type
44
+ arrays, `resolveOptions`, the error types and every type. No adapter, client, key handling
45
+ or provider SDK is reachable from it; a test walks the import graph.
46
+ - Alias `meta-muse` on `muse-image-1.0`.
47
+
48
+ ### Changed
49
+ - Labels: `gemini-3.1-flash-image-preview` is "Nano Banana 2" again and `gpt-image-2` is
50
+ "GPT-image-2" (the 0.1.7 labels read as different models in the picker).
51
+ - `Catalog` rejects duplicate ids and aliases across rows.
52
+ - `veo-3.1-lite` offers 720p and 1080p only; Google publishes no 4k rate for it.
53
+
54
+ ## [0.1.7] - 2026-09-10
55
+
56
+ ### Added
57
+ - `display { provider, description, logo? }` and `capabilities` (`imageGenerate`,
58
+ `imageEdit`, `acceptsSourceVideo`, `framesExcludeReferences`, `vision`, `tools`,
59
+ `structuredOutput`, `contextWindow`) on every active row, so a UI can render a picker from
60
+ `kit.catalog.list()` without a hand-written catalog. The nine Cowork picker rows keep their
61
+ descriptions and logos verbatim.
62
+
63
+ ## [0.1.6] - 2026-09-10
64
+
65
+ ### Added
66
+ - `MediaRef.label`: a text part before the media on Gemini image and Omni.
67
+ - `ImageRequest.temperature` (Gemini image) and `ImageRequest.upscale` (Topaz enhance model,
68
+ subject detection, face enhancement with creativity and strength; face enhancement off by
69
+ default).
70
+ - `VideoRequest.watermark` (Seedance) and `VideoRequest.safetyChecker` (fal MiniMax).
71
+ - MiniMax base rows accept `lastFrame`; Seedream 4.5 gets the 4K tier and 9:21.
72
+
73
+ ### Changed
74
+ - `onUnsupported: "error"` now covers aspect ratio and duration as well as size and
75
+ resolution. **Breaking** for callers that relied on silent snapping: pass `"coerce"`.
76
+ - Aborts are never retried and are forwarded to OpenAI, Replicate, Prodia, Ark and reference
77
+ downloads. One retry policy across adapters.
78
+ - Gateway token is required only for vendors that go through the gateway; the
79
+ enterprise-to-pro key fallback is logged.
80
+ - Seedance poll keeps usage, duration, fps and resolution on `raw`; the token split lands on
81
+ the usage event. Grok sends `resolution` only when the caller set it.
82
+ - The unused OpenRouter text route is removed.
83
+
84
+ ## [0.1.5] - 2026-09-10
85
+
86
+ ### Fixed
87
+ - `size: "512"` reaches the adapter (Gemini 3.1 Flash requests were generated at 1K).
88
+ - Every status-less SDK throw is a retryable transport error; five adapters had classified
89
+ them as permanent.
90
+ - Grok `firstFrame` maps to the SDK's first frame (image-to-video); references capped at 7.
91
+ - Omni: `delivery: "uri"` and `store: true`, `firstFrame` runs image-to-video, references run
92
+ reference-to-video, no `resolution` on 1.0, uploads deleted after create.
93
+
94
+ ### Changed
95
+ - `constraints.supports` undefined means "supports nothing"; every row carries an explicit list.
96
+ - `aspectRatio: "adaptive"` means "send no ratio" and is never coerced or defaulted.
97
+ - Usage `unit` comes from the catalog row; adapters supply quantities.
98
+ - Gemini `safetySettings` are per-call opt-in.
99
+ - fal direct video is queue submit plus poll, only the submit is retried; the fal client takes
100
+ the kit's `fetch`. Cloudflare gateway slugs `anthropic/v1` and `grok/v1`.
101
+
102
+ ## [0.1.4] - 2026-09-10
103
+
104
+ ### Added
105
+ - `topaz` row takes references and `scaleFactor` and returns `outputUrl` next to the bytes.
106
+ - Gemini image usage events carry input and output token counts.
107
+ - Aliases `claude-haiku-4` and `claude-sonnet-4-5-20250929`.
108
+
109
+ ## [0.1.3] - 2026-09-10
110
+
111
+ ### Fixed
112
+ - The remaining medium findings from the adoption review.
113
+
114
+ ## [0.1.2] - 2026-09-10
115
+
116
+ ### Added
117
+ - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare` with the `xhigh` and `max` quality tiers.
118
+ - Aliases `gpt-5.1-mini` and `gpt-5.2-mini` on `gpt-5.4-mini`.
119
+
120
+ ### Changed
121
+ - Google text goes through the gateway at `/google-ai-studio/v1beta`.
122
+ - Reasoning defaults are dropped from the text catalog.
123
+ - Seedance and Kling Omni keep last frames and seeds; Google transport failures retry.
124
+
125
+ ### Fixed
126
+ - The seven blocking findings from the adoption review.
127
+
128
+ ## [0.1.1] - 2026-09-09
129
+
130
+ ### Added
131
+ - `generateText`, `streamText`, `generateObject`, `streamObject` with catalog models. The
132
+ package re-exports every `ai` export, so `from "ai"` becomes `from "@shop-os/modelkit"`.
133
+ - `generateAudio` (Lyria 3, Lyria 2, MMAudio) and `prepareMediaPart` for video understanding.
134
+ - `generateImage` accepts the `upscale` and `bg-remove` catalog types, `n`, exact `WxH` sizes.
135
+ - Catalog rows for every id the apps still sent to direct SDKs; retired Claude 4.0 ids alias to
136
+ Sonnet 4.6 and Opus 4.8; fal passthrough with a gateway-stored key.
137
+
138
+ ### Fixed
139
+ - Text keys fall back per provider; dotted Claude aliases; native DeepSeek, Moonshot and
140
+ Perplexity providers; AI SDK-shaped `providerOptions`.
141
+ - gpt-image-2 edit sent `input_fidelity`, which the API rejects; a filtered Gemini prompt maps
142
+ to `content_blocked`; `@google/genai` no longer switches to Vertex from the host env.
143
+
144
+ ## [0.1.0] - 2026-09-09
145
+
146
+ First publish, renamed from `@shop-os/model-sdk`.
147
+
148
+ - Catalog of 74 models. The id is the pro-backend pricing key; every historical id is an alias.
149
+ - `resolveOptions` fills defaults, snaps the aspect ratio, errors or coerces on unsupported
150
+ size, resolution and duration, trims references.
151
+ - Ten adapters by provider API: AI SDK text, Gemini image, gpt-image-2, Google GenAI (Veo,
152
+ Omni, Lyria 3, video understanding), Ark, fal, Replicate, Prodia, Higgsfield, xAI video.
153
+ - Keys per tier (pro, enterprise with per-provider fallback); one retry classifier, one error
154
+ type, one usage event with the canonical id.
155
+
156
+ [Unreleased]: https://github.com/Shop-OS/shopos-backend-ts/compare/modelkit-0.1.9...dev
157
+ [0.1.9]: https://github.com/Shop-OS/shopos-backend-ts/compare/modelkit-0.1.8...dev
158
+ [0.1.8]: https://github.com/Shop-OS/shopos-backend-ts/commit/9661a109d
159
+ [0.1.7]: https://github.com/Shop-OS/shopos-backend-ts/commit/2d3d19ac2
160
+ [0.1.6]: https://github.com/Shop-OS/shopos-backend-ts/commit/f67fee08f
161
+ [0.1.5]: https://github.com/Shop-OS/shopos-backend-ts/commit/7f3f745ec
162
+ [0.1.4]: https://github.com/Shop-OS/shopos-backend-ts/commit/a2f3ffcc7
163
+ [0.1.3]: https://github.com/Shop-OS/shopos-backend-ts/commit/785960dbd
164
+ [0.1.2]: https://github.com/Shop-OS/shopos-backend-ts/commit/4581615e6
165
+ [0.1.1]: https://github.com/Shop-OS/shopos-backend-ts/commit/c159c97d3
166
+ [0.1.0]: https://github.com/Shop-OS/shopos-backend-ts/commit/6b70c91cf
package/README.md CHANGED
@@ -53,6 +53,18 @@ await clip.cleanup?.();
53
53
 
54
54
  Keys come from `process.env` by default: bare names for pro (`OPENAI_API_KEY`, `FAL_KEY`, `ARK_API_KEY` ...) and the `ENTERPRISE_` prefix for enterprise. Pass `keys: { pro, enterprise }` to override.
55
55
 
56
+ ## Browser-safe catalog
57
+
58
+ ```ts
59
+ import { Catalog, MODELS, resolveOptions } from "@shop-os/modelkit/catalog";
60
+ ```
61
+
62
+ The catalog subpath carries the model rows (`MODELS` plus the per-type
63
+ arrays), `Catalog`, the option resolvers (`resolveOptions` and the per-type
64
+ resolvers), `ModelKitError` and the catalog types. It includes no adapters, no
65
+ client, no keys, no text helpers and no provider SDKs, and builds for
66
+ `es2022` / neutral so it bundles straight into the browser.
67
+
56
68
  ## A superset of `ai`
57
69
 
58
70
  Every export of `ai` (the Vercel AI SDK) is re-exported here, so this import swap is
@@ -169,3 +181,7 @@ Prompt construction, agent tools, node schemas and UI, S3 upload, credit reserve
169
181
  ## Live smoke test
170
182
 
171
183
  `pnpm smoke [filter...]` runs one cheap real call per adapter (about $5 for the full matrix, 15 minutes, mostly video polling). Keys load from the `trigger-workflows`, `cowork`, and `vibe-triggers` env files next to this monorepo. Outputs land in `scripts/smoke-out/`. Run it before every release and after any adapter change. Never wire it into CI.
184
+
185
+ ## Changelog
186
+
187
+ See [CHANGELOG.md](./CHANGELOG.md). Add an entry under Unreleased with every change; the release PR moves it under the version header.