@shop-os/modelkit 0.2.22 → 0.2.23

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,11 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
+ ## [0.2.23] - Unreleased
13
+
14
+ ### Added
15
+ - `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.
16
+
12
17
  ## [0.2.22] - Unreleased
13
18
 
14
19
  ### 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,
@@ -2070,6 +2071,17 @@ function outputAudio(row) {
2070
2071
  const view = ConstraintsReadView.safeParse(row.constraints);
2071
2072
  return view.success ? view.data.audio : void 0;
2072
2073
  }
2074
+ var DefaultsReadView = import_zod.z.looseObject({
2075
+ generateAudio: import_zod.z.boolean().optional().catch(void 0)
2076
+ });
2077
+ function billedAudio(row, requested) {
2078
+ const audio = outputAudio(row);
2079
+ if (audio === "never") return false;
2080
+ if (audio !== "optional") return true;
2081
+ if (requested !== void 0) return requested;
2082
+ const defaults = DefaultsReadView.safeParse(row.defaults);
2083
+ return (defaults.success ? defaults.data.generateAudio : void 0) ?? true;
2084
+ }
2073
2085
  function promptConventions(row) {
2074
2086
  const view = ConstraintsReadView.safeParse(row.constraints);
2075
2087
  const prompt = view.success ? view.data.prompt : void 0;