@broberg/ai-sdk 0.41.0 → 0.42.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/dist/pricing.d.ts CHANGED
@@ -90,14 +90,21 @@ interface MediaModelPrice extends BasePrice {
90
90
  /** The price, in USD, for one of whatever `unit` names. ALWAYS set on a media row —
91
91
  * read this rather than the unit-specific aliases below. */
92
92
  usd: number;
93
- /** USD per second. Set ONLY when `unit === "per_sec"`.
93
+ /** @deprecated Read {@link MediaModelPrice.usd} with {@link MediaModelPrice.unit}.
94
+ * Kept working because it shipped in 0.40.0 and consumers read it.
94
95
  *
95
- * 0.40.0 set this-or-`perImage` from a TWO-armed ternary over SIX units, so every
96
- * non-per-second price was labelled `perImage`: `azure:tts` reported
97
- * `perImage: 0.016` for a price that is per 1000 CHARACTERS. A confident wrong number
98
- * under a name that lies about its own unit — worse than the 0 that was reported. */
96
+ * USD per second, set ONLY when `unit === "per_sec"` — and DERIVED from `usd`, never
97
+ * stored twice. super's point, and the precedent is on the fleet's books: two fields
98
+ * that must be kept equal are not wrong the day they are written, they are wrong the
99
+ * day one of them is corrected. (torrent-search-api F013.4: a duplicated counter
100
+ * showed two different numbers a week after the fix landed on one of its two sites.)
101
+ *
102
+ * It also carries this repo's own scar: 0.40.0 set this-or-`perImage` from a TWO-armed
103
+ * ternary over SIX units, so every non-per-second price was labelled `perImage` —
104
+ * `azure:tts` reported `perImage: 0.016` for a price that is per 1000 CHARACTERS. */
99
105
  perSec?: number;
100
- /** USD per generated image. Set ONLY when `unit === "per_image"`. */
106
+ /** @deprecated Read {@link MediaModelPrice.usd} with {@link MediaModelPrice.unit}.
107
+ * USD per generated image, set ONLY when `unit === "per_image"`, derived from `usd`. */
101
108
  perImage?: number;
102
109
  }
103
110
  /** A price row. Narrow on `unit` before reading rates:
package/dist/pricing.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  pricingGeneratedAt,
13
13
  resetPricingWarningForTests,
14
14
  warnIfPricingStale
15
- } from "./chunk-B74RSBT5.js";
15
+ } from "./chunk-OWXXPBKN.js";
16
16
  export {
17
17
  DEFAULT_CLIP_SEC,
18
18
  MEDIA_PRICING_CHECKED_AT,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@broberg/ai-sdk",
3
- "version": "0.41.0",
4
- "description": "Unified AI/LLM SDK \u2014 one facade, all providers, all capabilities, first-class cost control on every call.",
3
+ "version": "0.42.0",
4
+ "description": "Unified AI/LLM SDK — one facade, all providers, all capabilities, first-class cost control on every call.",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
7
7
  "author": "Christian Broberg <cb@webhouse.dk>",