@shop-os/modelkit 0.2.22 → 0.2.24

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 CHANGED
@@ -9,6 +9,19 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.2.24] - Unreleased
13
+
14
+ ### Added
15
+ - `ideogram-4.5` image row on the fal adapter (`ideogram/v4.5`). Without references it calls fal's text-to-image endpoint; `aspectRatio` + `size` (`1K` or `2K`, default `2K`) pick one of fal's fixed sizes, and `exactSize` is sent as given. With references it calls `ideogram/v4.5/edit`: the first reference is the image to edit (`image_url`), the rest (up to 4) are `reference_image_urls`, the output keeps the source size, and `edit_precision` is always `high` (Ideogram's Precise Edit, same price as `regular`). `quality` is `low`, `medium` or `high`; `auto` sends nothing and fal uses `medium`. fal's prompt expansion is off on text-to-image (the edit endpoint has no such field). Masked edits and the edit-only `very_low` tier are not exposed.
16
+
17
+ ### Live rows to add after publish
18
+ Add the `ideogram-4.5` row to pro-backend's `model_catalog` only after its per-quality image price exists and every app that will call it runs 0.2.24. An older kit accepts the row and sends it down the Muse path, so every edit fails.
19
+
20
+ ## [0.2.23] - Unreleased
21
+
22
+ ### Added
23
+ - `billedAudio(row, requested?)` on `@shop-os/modelkit/catalog`, next to `outputAudio`: whether a video request is billed as having sound. `always` rows are true, `never` rows false; an `optional` row takes `requested`, then the row's `defaults.generateAudio`, then true. A row with no valid `constraints.audio` is true. Every fallback is true because pro-backend's base video price is the sound-on price and a silent rate applies only to a line item that says `with_audio: false`, so a guess can overcharge but never undercharge. Callers (cowork Studio and chat, vibe-api's pricing classifier) pass the same `requested` value they dispatch with, so the billed and the generated sound cannot drift apart.
24
+
12
25
  ## [0.2.22] - Unreleased
13
26
 
14
27
  ### Added
package/dist/catalog.cjs CHANGED
@@ -36,6 +36,7 @@ __export(catalog_entry_exports, {
36
36
  SurfaceSchema: () => SurfaceSchema,
37
37
  TEXT_MODELS: () => TEXT_MODELS,
38
38
  VIDEO_MODELS: () => VIDEO_MODELS,
39
+ billedAudio: () => billedAudio,
39
40
  compareCatalogOrder: () => compareCatalogOrder,
40
41
  isListed: () => isListed,
41
42
  isListedOn: () => isListedOn,
@@ -444,6 +445,32 @@ var IMAGE_MODELS = [
444
445
  logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/characters/1787909065794-k9a7zz.png"
445
446
  }
446
447
  },
448
+ {
449
+ // References switch to the edit endpoint: the first is the image to edit,
450
+ // the rest (up to 4) guide it.
451
+ id: "ideogram-4.5",
452
+ aliases: [],
453
+ label: "Ideogram 4.5",
454
+ type: "image",
455
+ adapter: "fal",
456
+ providerModelId: "ideogram/v4.5",
457
+ lifecycle: "active",
458
+ exposure: ["cowork", "space_builder"],
459
+ constraints: {
460
+ aspectRatios: ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "5:4", "4:5"],
461
+ sizes: ["1K", "2K"],
462
+ qualityOptions: ["auto", "low", "medium", "high"],
463
+ references: { images: 5 },
464
+ supports: ["quality", "count", "seed"]
465
+ },
466
+ defaults: { size: "2K", aspectRatio: "1:1", quality: "medium", count: 1 },
467
+ usage: { ...IMAGE_USAGE, slug: "ideogram" },
468
+ pricingKind: "image_size",
469
+ display: {
470
+ provider: "ideogram",
471
+ description: "Ideogram's precise edit model: repeated edits keep the untouched pixels and colours intact, at the source's native resolution. Also generates from text."
472
+ }
473
+ },
447
474
  {
448
475
  id: "seedream-5-0-pro",
449
476
  aliases: ["seedream-4-5"],
@@ -2070,6 +2097,17 @@ function outputAudio(row) {
2070
2097
  const view = ConstraintsReadView.safeParse(row.constraints);
2071
2098
  return view.success ? view.data.audio : void 0;
2072
2099
  }
2100
+ var DefaultsReadView = import_zod.z.looseObject({
2101
+ generateAudio: import_zod.z.boolean().optional().catch(void 0)
2102
+ });
2103
+ function billedAudio(row, requested) {
2104
+ const audio = outputAudio(row);
2105
+ if (audio === "never") return false;
2106
+ if (audio !== "optional") return true;
2107
+ if (requested !== void 0) return requested;
2108
+ const defaults = DefaultsReadView.safeParse(row.defaults);
2109
+ return (defaults.success ? defaults.data.generateAudio : void 0) ?? true;
2110
+ }
2073
2111
  function promptConventions(row) {
2074
2112
  const view = ConstraintsReadView.safeParse(row.constraints);
2075
2113
  const prompt = view.success ? view.data.prompt : void 0;