@shop-os/modelkit 0.19.1 → 0.21.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/CHANGELOG.md CHANGED
@@ -9,7 +9,48 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
- ## [0.19.1] - Unreleased
12
+ ## [0.21.0] - Unreleased
13
+
14
+ ### Added
15
+ - `constraints.inputBilling` (ENG-3226): how a video row's provider bills what the request sends,
16
+ on top of what it renders: `seedance`, `omni`, `h3-max-reference`, `h3-reference`,
17
+ `grok-input-image`, `source-video-rate`, `kling-v4` or `input-plus-output`. Set on the Gemini
18
+ Omni, MiniMax H3 reference and insert, Grok Imagine, Kling 4.0 (and Flash, and their edits) and
19
+ Wan 3 rows. The rule only; the apps keep the rates.
20
+ - `inputBillingOf(row)` (also on `@shop-os/modelkit/catalog`) reads it: the row's own value, else
21
+ the kit row of the same id (a live row an older seed wrote), else `seedance` for an `ark` row,
22
+ else the data-only `flux-3` row's `source-video-rate`, else null. An invalid value reads as not
23
+ set. `INPUT_BILLINGS` lists the rules. The write path (`CatalogModelSchema`) rejects an unknown
24
+ rule; the read path keeps the row.
25
+
26
+ ## [0.20.0] - Unreleased
27
+
28
+ ### Added
29
+ - New `alibaba` adapter (ENG-3881): Alibaba Cloud Model Studio direct, US (Virginia) with the
30
+ Global deployment scope. Keys: `DASHSCOPE_API_KEY` plus `DASHSCOPE_WORKSPACE_ID` (the key works
31
+ only on its own workspace endpoint, `https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1`);
32
+ the pair switches together like Higgsfield key + secret, and the `ENTERPRISE_` / `SLOOSH_`
33
+ prefixes apply. Base-url override: `endpoints.alibaba`. Video runs as an async task
34
+ (`X-DashScope-Async`), polled every 15 s for up to 20 minutes; `resumeVideo` reconnects by task
35
+ id. Not a BYOK provider.
36
+
37
+ ### Changed
38
+ - `wan-3.0` and `wan-3.0-prime` move from fal to `alibaba` (`wan3.0-video`, `wan3.0-video-prime`).
39
+ Same constraints; `safetyChecker` is gone (Model Studio has none). A request with reference
40
+ videos is billed for the input seconds too: the usage event's `quantity` is Alibaba's
41
+ `usage.duration` (input plus output), `durationSeconds` stays the clip length.
42
+ - `happy-horse-1.1` moves from fal to `alibaba` (`happyhorse-1.1-t2v` / `-i2v` / `-r2v`, picked from
43
+ the inputs). Watermark is sent off (Alibaba stamps one by default); `safetyChecker` is gone.
44
+ `happy-horse-video-edit` stays on fal.
45
+ - `qwen-image-3` moves from fal to `alibaba` (`qwen-image-3.0-pro`, whose list price matches fal's
46
+ row). png output only: another `outputFormat` warns `option_ignored`. The usage tier is the one
47
+ Alibaba bills (`output_image_type`). Alibaba also bills each input image; the usage event does
48
+ not carry it yet.
49
+
50
+ ### Removed
51
+ - The fal mappings for Wan 3 / Wan 3 Prime, Happy Horse 1.1 generation and Qwen Image 3.
52
+
53
+ ## [0.19.1] - 2026-11-11
13
54
 
14
55
  ### Added
15
56
  - `seedream-5.5` (ENG-3884): ByteDance Seedream 5.5 on the `ark` adapter
package/README.md CHANGED
@@ -115,7 +115,7 @@ before submit), and `model3dPricingSku(row, options, inputs)` names the flat pri
115
115
  bills under; `model3dSkus(row)` lists them all, and pro-backend keeps a `credit_pricing_flat`
116
116
  row for each. All three are in the browser-safe catalog entry.
117
117
 
118
- Keys come from `process.env` by default: bare names for pro (`OPENAI_API_KEY`, `FAL_KEY`, `BYTEDANCE_API_KEY`, `LUMA_API_KEY` ...), the `ENTERPRISE_` prefix for enterprise and the `SLOOSH_` prefix for sloosh (sloosh reads `SLOOSH_LUMA_API_KEY` for Luma). Pass `keys: { pro, enterprise, sloosh }` to override. `tier: "sloosh"` uses the sloosh keys only: a missing key is a `ModelKitError` with code `auth`, never a fallback to pro.
118
+ Keys come from `process.env` by default: bare names for pro (`OPENAI_API_KEY`, `FAL_KEY`, `BYTEDANCE_API_KEY`, `LUMA_API_KEY` ...), the `ENTERPRISE_` prefix for enterprise and the `SLOOSH_` prefix for sloosh (sloosh reads `SLOOSH_LUMA_API_KEY` for Luma; Alibaba needs `DASHSCOPE_API_KEY` and `DASHSCOPE_WORKSPACE_ID` on each tier). Pass `keys: { pro, enterprise, sloosh }` to override. `tier: "sloosh"` uses the sloosh keys only: a missing key is a `ModelKitError` with code `auth`, never a fallback to pro.
119
119
 
120
120
  ## Customer keys (BYOK)
121
121
 
@@ -378,7 +378,7 @@ app's secrets, not a Cloudflare gateway token.
378
378
 
379
379
  ## Adapters
380
380
 
381
- `ai-sdk-text`, `google-image`, `openai-image`, `google-genai` (Veo, Omni with `delivery: "uri"`, Lyria 3, Files API media parts), `ark` (Seedream, Seedance), `fal`, `replicate` (images, video, Lyria 2, MMAudio), `prodia`, `higgsfield`, `xai-video`, `luma` (Uni images, Ray 3.2 video via the Agents API; `LUMA_API_KEY`, base-url override `endpoints.luma`), `fish` (Fish Audio speech, `createVoice` / `designVoice` / `deleteVoice`; `FISH_AUDIO_API_KEY`, base-url override `endpoints.fish`), `elevenlabs` (direct ElevenLabs speech, `createVoice` / `deleteVoice`; `ELEVENLABS_API_KEY`, base-url override `endpoints.elevenlabs`). See `src/adapters/`.
381
+ `ai-sdk-text`, `google-image`, `openai-image`, `google-genai` (Veo, Omni with `delivery: "uri"`, Lyria 3, Files API media parts), `ark` (Seedream, Seedance), `fal`, `replicate` (images, video, Lyria 2, MMAudio), `prodia`, `higgsfield`, `xai-video`, `luma` (Uni images, Ray 3.2 video via the Agents API; `LUMA_API_KEY`, base-url override `endpoints.luma`), `alibaba` (Model Studio direct in US Virginia: Wan 3 and Happy Horse 1.1 video, Qwen Image 3; `DASHSCOPE_API_KEY` + `DASHSCOPE_WORKSPACE_ID`, base-url override `endpoints.alibaba`), `fish` (Fish Audio speech, `createVoice` / `designVoice` / `deleteVoice`; `FISH_AUDIO_API_KEY`, base-url override `endpoints.fish`), `elevenlabs` (direct ElevenLabs speech, `createVoice` / `deleteVoice`; `ELEVENLABS_API_KEY`, base-url override `endpoints.elevenlabs`). See `src/adapters/`.
382
382
 
383
383
  ## Not in the package
384
384
 
package/dist/catalog.cjs CHANGED
@@ -28,6 +28,7 @@ __export(catalog_entry_exports, {
28
28
  CatalogSchema: () => CatalogSchema,
29
29
  ExposureSchema: () => ExposureSchema,
30
30
  IMAGE_MODELS: () => IMAGE_MODELS,
31
+ INPUT_BILLINGS: () => INPUT_BILLINGS,
31
32
  MEDIA_METHODS: () => MEDIA_METHODS,
32
33
  MEDIA_NODE_MODELS: () => MEDIA_NODE_MODELS,
33
34
  MODEL3D_IMAGE_SLOTS: () => MODEL3D_IMAGE_SLOTS,
@@ -45,6 +46,7 @@ __export(catalog_entry_exports, {
45
46
  VideoResolutionSchema: () => VideoResolutionSchema,
46
47
  billedAudio: () => billedAudio,
47
48
  compareCatalogOrder: () => compareCatalogOrder,
49
+ inputBillingOf: () => inputBillingOf,
48
50
  isListed: () => isListed,
49
51
  isListedOn: () => isListedOn,
50
52
  isModelKitError: () => isModelKitError,
@@ -349,14 +351,15 @@ var FAL_IMAGE_MODELS = [
349
351
  }
350
352
  },
351
353
  {
352
- // alibaba/qwen-image-3/text-to-image; references switch to .../edit (1-3 images, addressed
353
- // as "image 1".."image 3"). $0.04 per image at 1K, $0.075 at 2K.
354
+ // Alibaba Model Studio direct (qwen-image-3.0-pro; fal's qwen-image-3 bills its prices).
355
+ // 1-3 input images make it an edit, addressed as "image 1".."image 3". png output only.
356
+ // https://www.alibabacloud.com/help/en/model-studio/qwen-image-generation-and-editing-api-reference
354
357
  id: "qwen-image-3",
355
358
  aliases: [],
356
359
  label: "Qwen Image 3",
357
360
  type: "image",
358
- adapter: "fal",
359
- providerModelId: "alibaba/qwen-image-3/text-to-image",
361
+ adapter: "alibaba",
362
+ providerModelId: "qwen-image-3.0-pro",
360
363
  lifecycle: "active",
361
364
  exposure: EXPOSURE,
362
365
  constraints: {
@@ -5451,6 +5454,7 @@ var VIDEO_FAMILY_MODELS = [
5451
5454
  lifecycle: "active",
5452
5455
  exposure: ["cowork", "space_builder"],
5453
5456
  constraints: {
5457
+ inputBilling: "kling-v4",
5454
5458
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5455
5459
  resolutions: ["720p", "1080p"],
5456
5460
  durations: { min: 3, max: 30 },
@@ -5490,6 +5494,7 @@ var VIDEO_FAMILY_MODELS = [
5490
5494
  lifecycle: "active",
5491
5495
  exposure: ["cowork", "space_builder"],
5492
5496
  constraints: {
5497
+ inputBilling: "kling-v4",
5493
5498
  resolutions: ["720p", "1080p"],
5494
5499
  durations: { min: 3, max: 30 },
5495
5500
  references: { ...NO_REFERENCES, images: 10 },
@@ -5525,6 +5530,7 @@ var VIDEO_FAMILY_MODELS = [
5525
5530
  lifecycle: "active",
5526
5531
  exposure: ["cowork", "space_builder"],
5527
5532
  constraints: {
5533
+ inputBilling: "kling-v4",
5528
5534
  aspectRatios: ["adaptive", "16:9", "9:16", "1:1", "21:9"],
5529
5535
  resolutions: ["720p"],
5530
5536
  durations: { min: 3, max: 20 },
@@ -5563,6 +5569,7 @@ var VIDEO_FAMILY_MODELS = [
5563
5569
  lifecycle: "active",
5564
5570
  exposure: ["cowork", "space_builder"],
5565
5571
  constraints: {
5572
+ inputBilling: "kling-v4",
5566
5573
  resolutions: ["720p"],
5567
5574
  durations: { min: 3, max: 20 },
5568
5575
  references: {
@@ -5644,6 +5651,7 @@ var VIDEO_FAMILY_MODELS = [
5644
5651
  lifecycle: "active",
5645
5652
  exposure: ["cowork", "space_builder"],
5646
5653
  constraints: {
5654
+ inputBilling: "h3-max-reference",
5647
5655
  resolutions: ["480p", "768p"],
5648
5656
  durations: { min: 5, max: 13 },
5649
5657
  references: { images: 9, videos: 3, audios: 0 },
@@ -5723,14 +5731,15 @@ var VIDEO_FAMILY_MODELS = [
5723
5731
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
5724
5732
  },
5725
5733
  {
5726
- // https://fal.ai/models/alibaba/happy-horse/v1.1/text-to-video/api (+ /image-to-video,
5727
- // /reference-to-video): one row; references, else a start frame, else text.
5734
+ // Alibaba Model Studio direct: one row for happyhorse-1.1-t2v / -i2v / -r2v; references,
5735
+ // else a start frame, else text. 480P exists too, unpriced, so it stays out.
5736
+ // https://www.alibabacloud.com/help/en/model-studio/happyhorse-reference-to-video-api-reference
5728
5737
  id: "happy-horse-1.1",
5729
5738
  aliases: ["happy-horse"],
5730
5739
  label: "Happy Horse 1.1",
5731
5740
  type: "video",
5732
- adapter: "fal",
5733
- providerModelId: "alibaba/happy-horse/v1.1",
5741
+ adapter: "alibaba",
5742
+ providerModelId: "happyhorse-1.1",
5734
5743
  lifecycle: "active",
5735
5744
  exposure: ["cowork", "space_builder"],
5736
5745
  constraints: {
@@ -5739,7 +5748,7 @@ var VIDEO_FAMILY_MODELS = [
5739
5748
  durations: range(3, 15),
5740
5749
  ratioIgnoredWith: ["firstFrame"],
5741
5750
  references: { ...NO_REFERENCES, images: 9 },
5742
- supports: ["seed", "safetyChecker"],
5751
+ supports: ["seed"],
5743
5752
  prompt: { referenceSyntax: "numbered", maxChars: 2500 },
5744
5753
  audio: "always"
5745
5754
  },
@@ -5880,6 +5889,7 @@ var VIDEO_FAMILY_MODELS = [
5880
5889
  lifecycle: "active",
5881
5890
  exposure: ["cowork", "space_builder"],
5882
5891
  constraints: {
5892
+ inputBilling: "grok-input-image",
5883
5893
  aspectRatios: [...GROK_15_RATIOS],
5884
5894
  resolutions: ["480p", "720p", "1080p"],
5885
5895
  durations: { min: 1, max: 15 },
@@ -6157,6 +6167,7 @@ var VIDEO_MODELS = [
6157
6167
  replacedBy: "gemini-omni-1.1-flash",
6158
6168
  exposure: [],
6159
6169
  constraints: {
6170
+ inputBilling: "omni",
6160
6171
  // 1.0 rejects `resolution`; it renders 720p. No defaults: the adapter
6161
6172
  // sends ratio and duration only when the caller set them, so a
6162
6173
  // reference clip keeps its own framing.
@@ -6188,6 +6199,7 @@ var VIDEO_MODELS = [
6188
6199
  lifecycle: "active",
6189
6200
  exposure: ["cowork", "space_builder"],
6190
6201
  constraints: {
6202
+ inputBilling: "omni",
6191
6203
  aspectRatios: [...OMNI_RATIOS],
6192
6204
  resolutions: ["360p", "720p", "1080p", "4k"],
6193
6205
  durations: [3, 4, 5, 6, 7, 8, 9, 10],
@@ -6232,6 +6244,7 @@ var VIDEO_MODELS = [
6232
6244
  lifecycle: "active",
6233
6245
  exposure: ["cowork", "space_builder"],
6234
6246
  constraints: {
6247
+ inputBilling: "omni",
6235
6248
  aspectRatios: [...OMNI_RATIOS],
6236
6249
  resolutions: ["360p", "720p", "1080p", "4k"],
6237
6250
  durations: { min: 3, max: 15 },
@@ -6408,6 +6421,7 @@ var VIDEO_MODELS = [
6408
6421
  lifecycle: "active",
6409
6422
  exposure: ["cowork", "space_builder"],
6410
6423
  constraints: {
6424
+ inputBilling: "grok-input-image",
6411
6425
  aspectRatios: [...GROK_RATIOS],
6412
6426
  resolutions: ["480p", "720p"],
6413
6427
  durations: { min: 1, max: 15 },
@@ -6609,6 +6623,7 @@ var VIDEO_MODELS = [
6609
6623
  lifecycle: "active",
6610
6624
  exposure: ["cowork", "space_builder"],
6611
6625
  constraints: {
6626
+ inputBilling: "h3-reference",
6612
6627
  aspectRatios: [...H3_REFERENCE_RATIOS],
6613
6628
  resolutions: ["480p", "768p", "2k", "4k"],
6614
6629
  durations: { min: 5, max: 15 },
@@ -6653,6 +6668,7 @@ var VIDEO_MODELS = [
6653
6668
  lifecycle: "active",
6654
6669
  exposure: ["cowork", "space_builder"],
6655
6670
  constraints: {
6671
+ inputBilling: "h3-max-reference",
6656
6672
  aspectRatios: [...H3_REFERENCE_RATIOS],
6657
6673
  resolutions: ["480p", "768p", "1080p"],
6658
6674
  durations: { min: 5, max: 15 },
@@ -6688,18 +6704,19 @@ var VIDEO_MODELS = [
6688
6704
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }
6689
6705
  },
6690
6706
  {
6691
- // One row for fal's three Wan 3.0 endpoints; the adapter picks text-, image- or
6692
- // reference-to-video from the inputs. Each takes aspect_ratio, so none is ignored.
6693
- // https://fal.ai/models/alibaba/wan-3.0/reference-to-video/api
6707
+ // Alibaba Model Studio direct, one model id for text-, image- (first/last frame) and
6708
+ // reference-to-video. Reference-video seconds bill on top of the output seconds.
6709
+ // https://www.alibabacloud.com/help/en/model-studio/wan3-video-generation-api-reference
6694
6710
  id: "wan-3.0",
6695
6711
  aliases: ["wan-3", "wan3"],
6696
6712
  label: "Wan 3",
6697
6713
  type: "video",
6698
- adapter: "fal",
6699
- providerModelId: "alibaba/wan-3.0",
6714
+ adapter: "alibaba",
6715
+ providerModelId: "wan3.0-video",
6700
6716
  lifecycle: "active",
6701
6717
  exposure: ["cowork", "space_builder"],
6702
6718
  constraints: {
6719
+ inputBilling: "input-plus-output",
6703
6720
  aspectRatios: [...WAN_RATIOS],
6704
6721
  resolutions: ["480p", "720p", "1080p"],
6705
6722
  durations: { min: 2, max: 30 },
@@ -6711,7 +6728,7 @@ var VIDEO_MODELS = [
6711
6728
  videoSeconds: { total: 15 },
6712
6729
  audioSeconds: { total: 15 }
6713
6730
  },
6714
- supports: ["seed", "lastFrame", "generateAudio", "safetyChecker"],
6731
+ supports: ["seed", "lastFrame", "generateAudio"],
6715
6732
  prompt: WAN_PROMPT,
6716
6733
  audio: "optional"
6717
6734
  },
@@ -6730,18 +6747,18 @@ var VIDEO_MODELS = [
6730
6747
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES, lastFrameRequiresFirstFrame: true }
6731
6748
  },
6732
6749
  {
6733
- // fal's Wan 3.0 Prime endpoints share Wan 3.0's input schemas field for field but bill
6734
- // more per second, so Prime is its own row (the id is the pricing key).
6735
- // https://fal.ai/models/alibaba/wan-3.0-prime/reference-to-video/api
6750
+ // Wan 3.0 Prime takes Wan 3.0's request field for field but bills more per second, so
6751
+ // Prime is its own row (the id is the pricing key).
6736
6752
  id: "wan-3.0-prime",
6737
6753
  aliases: ["wan-3-prime", "wan3-prime"],
6738
6754
  label: "Wan 3 Prime",
6739
6755
  type: "video",
6740
- adapter: "fal",
6741
- providerModelId: "alibaba/wan-3.0-prime",
6756
+ adapter: "alibaba",
6757
+ providerModelId: "wan3.0-video-prime",
6742
6758
  lifecycle: "active",
6743
6759
  exposure: ["cowork", "space_builder"],
6744
6760
  constraints: {
6761
+ inputBilling: "input-plus-output",
6745
6762
  aspectRatios: [...WAN_RATIOS],
6746
6763
  resolutions: ["480p", "720p", "1080p"],
6747
6764
  durations: { min: 2, max: 30 },
@@ -6753,7 +6770,7 @@ var VIDEO_MODELS = [
6753
6770
  videoSeconds: { total: 15 },
6754
6771
  audioSeconds: { total: 15 }
6755
6772
  },
6756
- supports: ["seed", "lastFrame", "generateAudio", "safetyChecker"],
6773
+ supports: ["seed", "lastFrame", "generateAudio"],
6757
6774
  prompt: WAN_PROMPT,
6758
6775
  audio: "optional"
6759
6776
  },
@@ -7405,7 +7422,18 @@ var PromptConventionsSchema = import_zod.z.strictObject({
7405
7422
  referenceSyntax: ReferenceSyntaxSchema,
7406
7423
  maxChars: MaxCharsSchema.optional()
7407
7424
  });
7425
+ var InputBillingSchema = import_zod.z.enum([
7426
+ "seedance",
7427
+ "omni",
7428
+ "h3-max-reference",
7429
+ "h3-reference",
7430
+ "grok-input-image",
7431
+ "source-video-rate",
7432
+ "kling-v4",
7433
+ "input-plus-output"
7434
+ ]);
7408
7435
  var AUDIO_OUTPUTS = AudioOutputSchema.options;
7436
+ var INPUT_BILLINGS = InputBillingSchema.options;
7409
7437
  var REFERENCE_SYNTAXES = ReferenceSyntaxSchema.options;
7410
7438
  var ConstraintsReadView = import_zod.z.looseObject({
7411
7439
  audio: AudioOutputSchema.optional().catch(void 0),
@@ -8072,6 +8100,7 @@ var ADAPTER_IDS = [
8072
8100
  "higgsfield",
8073
8101
  "xai-video",
8074
8102
  "luma",
8103
+ "alibaba",
8075
8104
  "fish",
8076
8105
  "elevenlabs"
8077
8106
  ];
@@ -8323,6 +8352,7 @@ var ModelConstraintsSchema = import_zod3.z.looseObject({
8323
8352
  // Loose on purpose: the read path keeps a row whose value is invalid (the accessors in
8324
8353
  // conventions.ts read it as "not set"); CatalogModelSchema below rejects it on write.
8325
8354
  audio: import_zod3.z.unknown().optional(),
8355
+ inputBilling: import_zod3.z.unknown().optional(),
8326
8356
  prompt: import_zod3.z.unknown().optional()
8327
8357
  });
8328
8358
  var MediaRefSchema = import_zod3.z.union([
@@ -8515,6 +8545,14 @@ var CatalogModelSchema = CatalogModelSchemaBase.superRefine(
8515
8545
  message: 'audio must be "always", "optional" or "never"'
8516
8546
  });
8517
8547
  }
8548
+ const inputBilling = row2.constraints.inputBilling;
8549
+ if (inputBilling !== void 0 && !InputBillingSchema.safeParse(inputBilling).success) {
8550
+ ctx.addIssue({
8551
+ code: "custom",
8552
+ path: ["constraints", "inputBilling"],
8553
+ message: `inputBilling must be one of ${INPUT_BILLINGS.join(", ")}`
8554
+ });
8555
+ }
8518
8556
  const refs = row2.constraints.references;
8519
8557
  for (const kind of ["images", "videos", "audios"]) {
8520
8558
  const least = refs?.min?.[kind];
@@ -9330,7 +9368,8 @@ var QWEN_EXACT = {
9330
9368
  maxSide: 14142,
9331
9369
  minArea: 512 * 512,
9332
9370
  maxArea: 2048 * 2048,
9333
- multipleOf: 1
9371
+ multipleOf: 1,
9372
+ maxAspect: 8
9334
9373
  };
9335
9374
  var MINIMAX_H3_IMAGE_EXACT = {
9336
9375
  minSide: 1,
@@ -9382,7 +9421,8 @@ var FAL_IMAGE_SPECS = /* @__PURE__ */ new Map([
9382
9421
  }
9383
9422
  ],
9384
9423
  [
9385
- "alibaba/qwen-image-3/text-to-image",
9424
+ // Alibaba direct (adapters/alibaba-image.ts); png only, which the adapter warns about.
9425
+ "qwen-image-3.0-pro",
9386
9426
  {
9387
9427
  label: "Qwen Image 3",
9388
9428
  maxReferences: 3,
@@ -9549,7 +9589,7 @@ function falExactSize(spec, req) {
9549
9589
  return check.ok ? check.size : void 0;
9550
9590
  }
9551
9591
  function applyFalImageRules(model, req, callerSize, warnings) {
9552
- if (model.adapter !== "fal") return;
9592
+ if (model.adapter !== "fal" && model.adapter !== "alibaba") return;
9553
9593
  const spec = falImageSpec(model.providerModelId);
9554
9594
  if (spec === void 0) return;
9555
9595
  const problem = falImageProblem(spec, withPromptForResolve(req));
@@ -9612,7 +9652,7 @@ var KLING_V4_FLASH_EDIT = "kling/v4/flash/video-to-video";
9612
9652
  var H3_TURBO = "minimax/h3-max-turbo";
9613
9653
  var H3_RECAST = "minimax/h3-max/recast";
9614
9654
  var H3_RELIGHT = "minimax/h3-max/relight";
9615
- var HAPPY_HORSE = "alibaba/happy-horse/v1.1";
9655
+ var HAPPY_HORSE = "happyhorse-1.1";
9616
9656
  var HAPPY_HORSE_EDIT = "alibaba/happy-horse/video-edit";
9617
9657
  var VIDU_Q4 = "fal-ai/vidu/q4";
9618
9658
  var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
@@ -9817,7 +9857,7 @@ function fillKlingModeResolution(model, req) {
9817
9857
  }
9818
9858
  }
9819
9859
  function applyFalVideoRules(model, req, callerRatio, warnings) {
9820
- if (model.adapter !== "fal") return;
9860
+ if (model.adapter !== "fal" && model.adapter !== "alibaba") return;
9821
9861
  const problem = falVideoProblem(model.providerModelId, withPromptForResolve(req));
9822
9862
  if (problem !== void 0) throw ruleRefusal(model, problem.message, problem.code);
9823
9863
  const id = model.providerModelId.toLowerCase();
@@ -11006,4 +11046,23 @@ function referenceImageConformPlan(model, probe) {
11006
11046
  } : { ...frame };
11007
11047
  return { ...frame, image, reasons };
11008
11048
  }
11049
+
11050
+ // src/catalog/input-billing.ts
11051
+ var import_zod7 = require("zod");
11052
+ var DATA_ONLY_INPUT_BILLING = /* @__PURE__ */ new Map([
11053
+ ["flux-3", "source-video-rate"]
11054
+ ]);
11055
+ var KIT_INPUT_BILLING = new Map(
11056
+ MODELS.flatMap(
11057
+ (row2) => row2.constraints.inputBilling ? [[row2.id, row2.constraints.inputBilling]] : []
11058
+ )
11059
+ );
11060
+ var ConstraintsReadView2 = import_zod7.z.looseObject({
11061
+ inputBilling: InputBillingSchema.optional().catch(void 0)
11062
+ });
11063
+ function inputBillingOf(row2) {
11064
+ const view = ConstraintsReadView2.safeParse(row2.constraints);
11065
+ const own = view.success ? view.data.inputBilling : void 0;
11066
+ return own ?? KIT_INPUT_BILLING.get(row2.id) ?? (row2.adapter === "ark" ? "seedance" : void 0) ?? DATA_ONLY_INPUT_BILLING.get(row2.id) ?? null;
11067
+ }
11009
11068
  //# sourceMappingURL=catalog.cjs.map