@shop-os/modelkit 0.2.11 → 0.2.13
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 +21 -0
- package/README.md +17 -1
- package/dist/catalog.cjs +419 -147
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +289 -1
- package/dist/catalog.d.ts +289 -1
- package/dist/catalog.js +419 -147
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +5651 -5140
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +370 -38
- package/dist/index.d.ts +370 -38
- package/dist/index.js +3991 -3489
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,27 @@ header in the release PR.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.2.13] - 2026-09-18
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- `dataOnlyCapable(row)`: reports whether a database catalog row would be served by a generic path, a hard-coded kind, or a valid `inputSpec`. The modality check is derived from the adapter's `generateImage` / `generateVideo` / `generateAudio` / `languageModel` surface, so a wrong-modality row reports `ok: false`. Replicate video and audio rows also need a known kind or a valid `inputSpec`.
|
|
16
|
+
- `providerOptions.modelkit.inputSpec`: per-row Replicate video and audio field mapping (`fields`, `values`, `static`) with the shared `applyInputSpec` mapper, read by the Replicate adapter only. Video rows use `VIDEO_INPUT_SPEC_KEYS`; audio rows use `AUDIO_INPUT_SPEC_KEYS` (`prompt`, `durationSeconds`, `seed`, `negativePrompt`, `references`, `sourceVideo`, `instrumental`).
|
|
17
|
+
- `validateInputSpec(raw, row)`: the shared Replicate-only `inputSpec` contract (schema, values-need-fields entries, no duplicate provider names, `constraints.supports` cross-check including `instrumental`, video/audio modality check) used by the write schema, `dataOnlyCapable`, and the Replicate mapper.
|
|
18
|
+
- `PrimeCatalogResult.droppedRows`: count of catalog rows dropped by the per-row quarantine on the read path.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
- Replicate and fal video or audio ids with no input mapper now throw `unsupported_option` instead of using a default mapper.
|
|
22
|
+
- Higgsfield Kling rows with an absolute-URL `providerModelId` are rejected with `unsupported_option`; the id must be a platform path.
|
|
23
|
+
- The catalog read path drops invalid rows with one warning each instead of rejecting the whole envelope.
|
|
24
|
+
|
|
25
|
+
## [0.2.12] - 2026-09-17
|
|
26
|
+
|
|
27
|
+
### Changed
|
|
28
|
+
- Usage events for Anthropic calls that Bedrock serves carry `provider: "bedrock"`. They carried `"anthropic"` in 0.2.11. `model` is still the catalog id, and token pricing is keyed by the model id alone, so billing does not change; usage reports get one group per transport. Calls on the Anthropic API still carry `"anthropic"`. The AI SDK provider id of the model (`model.provider`) stays `anthropic.messages` on both transports.
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
- `kit.usageProvider(modelId, call?)` and `LanguageModelHandle.usageProvider`: the `provider` an app puts on a usage event it emits itself. It follows the resolved transport, including the credential fallback, without building the model.
|
|
32
|
+
|
|
12
33
|
## [0.2.11] - 2026-09-17
|
|
13
34
|
|
|
14
35
|
### Added
|
package/README.md
CHANGED
|
@@ -131,7 +131,11 @@ The kit keeps its `Warning` type for coercions; the SDK's warning type is `AiWar
|
|
|
131
131
|
|
|
132
132
|
Anthropic catalog rows can go through AWS Bedrock InvokeModel instead of the
|
|
133
133
|
Anthropic API. The call surface is the same, and usage events and
|
|
134
|
-
`response.modelId` still carry the catalog id.
|
|
134
|
+
`response.modelId` still carry the catalog id. Usage events for calls that
|
|
135
|
+
Bedrock serves carry `provider: "bedrock"`, so reports get one group per
|
|
136
|
+
transport; pricing is keyed by the model id alone and does not change. An app
|
|
137
|
+
that emits its own usage events takes the provider from
|
|
138
|
+
`kit.usageProvider(modelId)`.
|
|
135
139
|
|
|
136
140
|
The transport of a row is decided in this order:
|
|
137
141
|
|
|
@@ -161,6 +165,18 @@ The Bedrock model id is `<routing.bedrockProfile>.anthropic.<providerModelId>`
|
|
|
161
165
|
breaks the pattern sets `providerOptions.modelkit.bedrockModelId` on its row.
|
|
162
166
|
See the CHANGELOG entry for the caller-visible Bedrock limits.
|
|
163
167
|
|
|
168
|
+
A Replicate video or audio row for a new model carries `providerOptions.modelkit.inputSpec`
|
|
169
|
+
instead of a kit change. It is read by the Replicate adapter only. `fields` maps a canonical key to the provider field name,
|
|
170
|
+
`values` remaps canonical values per key, and `static` merges literal provider fields
|
|
171
|
+
last. Video rows use `VIDEO_INPUT_SPEC_KEYS` (`prompt`, `durationSeconds`,
|
|
172
|
+
`aspectRatio`, `resolution`, `firstFrame`, `lastFrame`, `seed`, `negativePrompt`,
|
|
173
|
+
`generateAudio`, `cfgScale`, `promptExpansion`, `referenceImages`); audio rows use
|
|
174
|
+
`AUDIO_INPUT_SPEC_KEYS` (`prompt`, `durationSeconds`, `seed`, `negativePrompt`,
|
|
175
|
+
`references`, `sourceVideo`, `instrumental`). `aspectRatio: "adaptive"` is omitted.
|
|
176
|
+
`validateInputSpec` is the shared contract the write schema, `dataOnlyCapable`, and
|
|
177
|
+
the Replicate mapper all check. `dataOnlyCapable(row)` reports whether such a row would
|
|
178
|
+
be served.
|
|
179
|
+
|
|
164
180
|
```ts
|
|
165
181
|
import { defaultProvider } from "@aws-sdk/credential-provider-node";
|
|
166
182
|
import { createDefaultModelKit, keysFromEnv } from "@shop-os/modelkit";
|