@koda-sl/baker-cli 0.216.0 → 0.218.0-dev.68a8bd23c
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/README.md +94 -1
- package/dist/{chunk-54GMUYWN.js → chunk-CMPAHYLB.js} +126 -7
- package/dist/chunk-CMPAHYLB.js.map +1 -0
- package/dist/cli.js +2852 -1887
- package/dist/cli.js.map +1 -1
- package/dist/engine/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-54GMUYWN.js.map +0 -1
package/README.md
CHANGED
|
@@ -1151,6 +1151,34 @@ Each finding: `{id, area, check, status, severity, evidence, fix: {explanation,
|
|
|
1151
1151
|
|
|
1152
1152
|
---
|
|
1153
1153
|
|
|
1154
|
+
### First-party web analytics (`baker analytics`)
|
|
1155
|
+
|
|
1156
|
+
Baker's own measurement of the pages it publishes. No connection to set up and nothing to configure — data exists from the moment a page is published — and it is the only source that reports drop-off **per Form step**.
|
|
1157
|
+
|
|
1158
|
+
Preset-first; `overview` answers most questions in one call.
|
|
1159
|
+
|
|
1160
|
+
```bash
|
|
1161
|
+
baker analytics overview # traffic, top pages, sources, and every Form's worst step
|
|
1162
|
+
baker analytics overview --days 7
|
|
1163
|
+
baker analytics traffic --days 90 --full # full breakdowns plus the per-day trend
|
|
1164
|
+
baker analytics funnel --flow contact # which step loses people
|
|
1165
|
+
baker analytics page --path /pricing/ # one page in detail
|
|
1166
|
+
baker analytics presets # what each report answers
|
|
1167
|
+
```
|
|
1168
|
+
|
|
1169
|
+
Shared flags: `--days <n>` (default 30) or `--start-date` / `--end-date` (`YYYY-MM-DD`, end inclusive); `--full`. Every call reads live — there is no cache layer, so there is nothing to bypass.
|
|
1170
|
+
|
|
1171
|
+
Reading the output:
|
|
1172
|
+
|
|
1173
|
+
- `visitors` and `sessions` are counted from explicit `visitor_new` / `session_start` events, so a session begins when the page says it did rather than when a query guesses.
|
|
1174
|
+
- `pageViews` prefers the server-side count, which ad blockers cannot suppress, so it usually exceeds what GA4 reports for the same period.
|
|
1175
|
+
- Rates are `null`, never `0`, when there is no denominator — `null` means "no data", `0` means "genuinely none".
|
|
1176
|
+
- `warnings[]` and `hints[]` carry caveats (small sample, sampled data) that belong in the answer, not in the footnotes.
|
|
1177
|
+
|
|
1178
|
+
Data is retained for 400 days; a window reaching further back comes back with a `BEYOND_RETENTION` warning, and the older part is missing rather than zero.
|
|
1179
|
+
|
|
1180
|
+
---
|
|
1181
|
+
|
|
1154
1182
|
### Google Analytics 4 (`baker ga4`)
|
|
1155
1183
|
|
|
1156
1184
|
GA4 commands for multi-channel audits **and** for configuring what the property measures. Playbook-aligned report presets, property health audits, free-form Data API queries, and staged Admin API writes.
|
|
@@ -1835,7 +1863,7 @@ Research data is cached server-side (shared across all callers). No local cache
|
|
|
1835
1863
|
|
|
1836
1864
|
---
|
|
1837
1865
|
|
|
1838
|
-
### Assets (`baker images`, `baker videos`, `baker testimonials`)
|
|
1866
|
+
### Assets (`baker images`, `baker videos`, `baker avatars`, `baker testimonials`)
|
|
1839
1867
|
|
|
1840
1868
|
#### Image sourcing — verb-per-provider overview
|
|
1841
1869
|
|
|
@@ -2602,6 +2630,69 @@ baker testimonials tags
|
|
|
2602
2630
|
|
|
2603
2631
|
---
|
|
2604
2632
|
|
|
2633
|
+
### Avatars (`baker avatars`)
|
|
2634
|
+
|
|
2635
|
+
Reusable AI presenters a company casts into images and video. An avatar holds one settled identity: an **identity sheet** (`sheetUrl`, a generated multi-view turnaround) plus the **subject description** (`subjectDescription`) that person is described with. Every render grounds on the sheet via `--reference` and reuses the subject description verbatim — that pairing is what keeps the same face across a whole campaign.
|
|
2636
|
+
|
|
2637
|
+
`status` is `generating | ready | error | archived`; only `ready` can be cast. `create` returns immediately with `generating` because the identity sheet renders in the background (~30s). `likeness` is `synthetic` (invented from a description) or `licensed` (built from photographs of a real person, which requires `--likeness-confirmed`).
|
|
2638
|
+
|
|
2639
|
+
#### `baker avatars list`
|
|
2640
|
+
|
|
2641
|
+
List the company's avatars. Retired ones are hidden unless you ask for them. Rows are compact and deliberately omit `subjectDescription` — read it with `get`.
|
|
2642
|
+
|
|
2643
|
+
```bash
|
|
2644
|
+
baker avatars list
|
|
2645
|
+
baker avatars list --status ready --output md
|
|
2646
|
+
baker avatars list --status archived --limit 10
|
|
2647
|
+
```
|
|
2648
|
+
|
|
2649
|
+
#### `baker avatars get <handle>`
|
|
2650
|
+
|
|
2651
|
+
Read one avatar: status, `sheetUrl` for `--reference`, and the `subjectDescription` to reuse verbatim. `--full` adds the whole written profile (persona, speech, motion, wardrobe, setting, guardrails, voice, source photos, created date).
|
|
2652
|
+
|
|
2653
|
+
```bash
|
|
2654
|
+
baker avatars get marta
|
|
2655
|
+
baker avatars get marta --full --output md
|
|
2656
|
+
```
|
|
2657
|
+
|
|
2658
|
+
#### `baker avatars create`
|
|
2659
|
+
|
|
2660
|
+
Cast a new presenter. `--name` and `--subject` are required; `--subject` describes one person plainly (age, build, hair, skin, face) with no scene, lighting, camera, or wardrobe.
|
|
2661
|
+
|
|
2662
|
+
```bash
|
|
2663
|
+
baker avatars create --name "Marta" \
|
|
2664
|
+
--subject "woman in her early 40s, shoulder-length dark brown hair, light olive skin, warm open face" \
|
|
2665
|
+
--persona "friendly product expert" --wardrobe "plain knit sweater" \
|
|
2666
|
+
--guardrails "no competitor logos, no medical claims"
|
|
2667
|
+
|
|
2668
|
+
# From photographs of a real person — both flags required together
|
|
2669
|
+
baker avatars create --name "Marta" --subject "…" \
|
|
2670
|
+
--source-image "<imageId1>,<imageId2>" --likeness-confirmed
|
|
2671
|
+
```
|
|
2672
|
+
|
|
2673
|
+
Optional: `--handle`, `--speech`, `--motion`, `--setting`, `--voice-id`, `--voice-description`. Returns `{ avatarId, handle, likeness, status }`.
|
|
2674
|
+
|
|
2675
|
+
#### `baker avatars update <handle>`
|
|
2676
|
+
|
|
2677
|
+
Edit an avatar. Profile flags are merged over the stored profile, so `--persona` alone keeps the subject description intact; an empty value clears the field it names (except `--subject`, which can only be replaced). Changing `--subject` requires `--regenerate-sheet` in the same call — otherwise the sheet still shows the person described before.
|
|
2678
|
+
|
|
2679
|
+
```bash
|
|
2680
|
+
baker avatars update marta --wardrobe "charcoal blazer over a white tee"
|
|
2681
|
+
baker avatars update marta --subject "woman in her early 50s, silver bob, …" --regenerate-sheet
|
|
2682
|
+
baker avatars update marta --new-handle marta-founder --voice-id <voiceId>
|
|
2683
|
+
```
|
|
2684
|
+
|
|
2685
|
+
#### `baker avatars delete <handle>`
|
|
2686
|
+
|
|
2687
|
+
Remove an avatar. `--archive` retires it — it leaves the roster but past work and `@handle` mentions keep resolving. Without `--archive` it is deleted for good.
|
|
2688
|
+
|
|
2689
|
+
```bash
|
|
2690
|
+
baker avatars delete marta --archive --dry-run
|
|
2691
|
+
baker avatars delete marta --archive
|
|
2692
|
+
```
|
|
2693
|
+
|
|
2694
|
+
---
|
|
2695
|
+
|
|
2605
2696
|
### Winning Ads (`baker winning-ads`)
|
|
2606
2697
|
|
|
2607
2698
|
Search the **ad-dna** corpus of scored "winning" competitor ads for reference creatives to reproduce (e.g. with `baker canvas`), and manage the brands your library tracks (`follow` / `following` / `feed` / `unfollow`). Each result carries a presigned media URL (~1h TTL), the ad's DNA summary, and scores. The CLI authenticates with the normal `BAKER_API_KEY`; the Baker backend proxies the request to the ad-dna service with a server-held token — no extra credential in the sandbox.
|
|
@@ -5524,6 +5615,8 @@ This CLI is designed for AI agent consumption. Key patterns:
|
|
|
5524
5615
|
- **0.180.1**: `baker tag-manager --help` said the container version Baker cuts at publish is **NOT** published, and told the agent to have the user publish it in Tag Manager. The executor publishes it — a clean run takes the client's container live — so the help understated an irreversible change to a production site. Corrected, and the stale `versionPendingMessage` helper (no callers, same wrong claim) removed from `@baker/api/tag-manager`. `draft list` already reported both outcomes correctly and is unchanged.
|
|
5525
5616
|
- **0.191.0**: `baker ads google draft list` now flags a Search campaign staged with fewer than **3 image assets**, alongside the sitelink/callout/structured-snippet/negative-list advisories it already prints. The completeness pass counted `MARKETING_IMAGE` links but only ever checked them on Performance Max and Demand Gen, so a Search campaign could be staged and published with no images at all and nothing said a word — it just performed worse, which is exactly the failure advisories exist to catch. This is the same gap Google raises as its "Add images to your ads" recommendation, moved to the point where the agent can act on it: an image-less text ad is visibly smaller in the SERP than a competitor's. Images are the one asset kind an agent cannot write inline, so the advisory names the route — build with the `creative-canvas-ads` flow and its new `google_search` platform preset (1:1 required, 1.91:1 cropped from a rendered 16:9), then `assets create` + `assets attach --file` at `"fieldType": "MARKETING_IMAGE"` — and repeats the playbook's two rejections: never stock, never a logo on a plain background. Non-blocking, like every other advisory; publish is never gated on it.
|
|
5526
5617
|
|
|
5618
|
+
- **0.217.0**: new family `baker avatars list|get|create|update|delete`, plus `--avatar <handle>` on `baker studio generate` and `baker studio animate` — company-scoped reusable presenters, typed from the shared `@baker/api` avatars contract. `--avatar` is the way to cast one: it grounds the render on the identity sheet, reuses the subject description verbatim, and records the avatar on the batch. Passing the sheet through `--reference` instead does none of those and leaves the batch unattributed, so the avatar can never show what it has appeared in; the route refuses a handle that is not `ready`, because generating a stranger is worse than an error. `get` returns the sheet URL and that description; every command's `hints` carry the next move (still building → re-check with `get`; changed `--subject` without `--regenerate-sheet` → the sheet is stale). `create` refuses `--source-image` without `--likeness-confirmed` and returns an `error.fix` telling the agent to ask the user for that permission, since only they can give it; an unknown handle returns an `error.fix` pointing at `baker avatars list`. Profile flags on `update` merge over the stored profile instead of replacing it.
|
|
5619
|
+
|
|
5527
5620
|
## Publishing
|
|
5528
5621
|
|
|
5529
5622
|
### Auto-publish (CI)
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
shouldEscalate
|
|
17
17
|
} from "./chunk-DZUVUGEP.js";
|
|
18
18
|
|
|
19
|
-
//
|
|
19
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/index.js
|
|
20
20
|
var require_safe_stable_stringify = __commonJS({
|
|
21
|
-
"
|
|
21
|
+
"../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/index.js"(exports, module) {
|
|
22
22
|
"use strict";
|
|
23
23
|
var { hasOwnProperty } = Object.prototype;
|
|
24
24
|
var stringify = configure2();
|
|
@@ -1092,7 +1092,7 @@ function resolveAdaptFormats(params) {
|
|
|
1092
1092
|
return params.formats ?? [];
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
|
-
//
|
|
1095
|
+
// ../../.pnpm-store/v10/links/@/safe-stable-stringify/2.5.0/810146e81bae4e3a061fe487864f2fde80c4b03b886877dc0f1fffbc6480b67e/node_modules/safe-stable-stringify/esm/wrapper.js
|
|
1096
1096
|
var import__ = __toESM(require_safe_stable_stringify(), 1);
|
|
1097
1097
|
var configure = import__.default.configure;
|
|
1098
1098
|
var wrapper_default = import__.default;
|
|
@@ -1192,6 +1192,9 @@ var KLING_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
|
1192
1192
|
var GEMINI_OMNI_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10];
|
|
1193
1193
|
var GEMINI_OMNI_ASPECT_RATIOS = ["16:9", "9:16"];
|
|
1194
1194
|
var GEMINI_OMNI_IMAGE_MIMES = ["image/png", "image/jpeg", "image/webp"];
|
|
1195
|
+
var GROK_IMAGINE_DURATIONS = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
1196
|
+
var WAN_27_DURATIONS = [2, 3, 4, 5, 6, 7, 8, 9, 10];
|
|
1197
|
+
var HAPPYHORSE_DURATIONS = [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15];
|
|
1195
1198
|
var ELEVENLABS_OUTPUT_FORMATS = [
|
|
1196
1199
|
"mp3_22050_32",
|
|
1197
1200
|
"mp3_44100_32",
|
|
@@ -1224,13 +1227,20 @@ var VIDEO_GENERATE_MODELS = [
|
|
|
1224
1227
|
"google/gemini-omni-flash",
|
|
1225
1228
|
"google/veo-3.1",
|
|
1226
1229
|
"google/veo-3.1-fast",
|
|
1227
|
-
"
|
|
1230
|
+
"google/veo-3.1-lite",
|
|
1231
|
+
"kwaivgi/kling-v3.0-pro",
|
|
1232
|
+
"x-ai/grok-imagine-video",
|
|
1233
|
+
"alibaba/wan-2.7",
|
|
1234
|
+
"alibaba/happyhorse-1.1"
|
|
1228
1235
|
];
|
|
1229
1236
|
var DEFAULT_VIDEO_GENERATE_MODEL = "google/gemini-omni-flash";
|
|
1230
1237
|
var REFERENCE_TO_VIDEO_MODELS = [
|
|
1231
1238
|
"bytedance/seedance-2.0",
|
|
1232
1239
|
"bytedance/seedance-2.5",
|
|
1233
|
-
"google/gemini-omni-flash"
|
|
1240
|
+
"google/gemini-omni-flash",
|
|
1241
|
+
"x-ai/grok-imagine-video",
|
|
1242
|
+
"alibaba/wan-2.7",
|
|
1243
|
+
"alibaba/happyhorse-1.1"
|
|
1234
1244
|
];
|
|
1235
1245
|
function supportsReferenceToVideo(model) {
|
|
1236
1246
|
return REFERENCE_TO_VIDEO_MODELS.includes(model);
|
|
@@ -1681,6 +1691,89 @@ var MODEL_REGISTRY = {
|
|
|
1681
1691
|
cfg_scale: { kind: "number", min: 0, max: 1 }
|
|
1682
1692
|
}
|
|
1683
1693
|
},
|
|
1694
|
+
"x-ai/grok-imagine-video": {
|
|
1695
|
+
// The avatar workhorse. Measured best of the reference-capable models on
|
|
1696
|
+
// identity retention AND aspect-ratio obedience, at the lowest rate of any
|
|
1697
|
+
// video model we carry ($0.05/s at 480p). No audio at all — `generate_audio`
|
|
1698
|
+
// is absent from its OpenRouter listing, so a talking head goes to Wan 2.7.
|
|
1699
|
+
// NOTE: `x-ai/grok-imagine-video-1.5` is NOT a drop-in upgrade — it is
|
|
1700
|
+
// described as plain image-to-video and drops the reference conditioning
|
|
1701
|
+
// this entry exists for.
|
|
1702
|
+
label: "Grok Imagine Video",
|
|
1703
|
+
inputs: [],
|
|
1704
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1705
|
+
required: ["prompt"],
|
|
1706
|
+
params: {
|
|
1707
|
+
prompt: { kind: "string" },
|
|
1708
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "3:2", "2:3"] },
|
|
1709
|
+
resolution: { kind: "string", enum: ["480p", "720p"] },
|
|
1710
|
+
duration: { kind: "number", enum: GROK_IMAGINE_DURATIONS }
|
|
1711
|
+
}
|
|
1712
|
+
},
|
|
1713
|
+
"alibaba/wan-2.7": {
|
|
1714
|
+
// Reference-to-video AND native audio — the only model we carry with both,
|
|
1715
|
+
// which makes it the landscape talking-head option.
|
|
1716
|
+
//
|
|
1717
|
+
// LANDSCAPE ONLY, measured. It advertises 9:16, 1:1, 4:3 and 3:4, and
|
|
1718
|
+
// delivers 16:9 regardless: asked for vertical via `aspect_ratio: "9:16"`
|
|
1719
|
+
// it returned 1280x720, and asked again via an explicit
|
|
1720
|
+
// `size: "720x1280"` from its own `supported_sizes` it returned 1280x720
|
|
1721
|
+
// again. The enum below is therefore what it DOES, not what it claims, so
|
|
1722
|
+
// nobody pays for a vertical clip that comes back landscape. For a vertical
|
|
1723
|
+
// avatar clip use `x-ai/grok-imagine-video` (silent) or animate a generated
|
|
1724
|
+
// still with `google/veo-3.1-lite` (native audio, honours 9:16).
|
|
1725
|
+
label: "Alibaba Wan 2.7",
|
|
1726
|
+
inputs: [],
|
|
1727
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1728
|
+
required: ["prompt"],
|
|
1729
|
+
params: {
|
|
1730
|
+
prompt: { kind: "string" },
|
|
1731
|
+
negative_prompt: { kind: "string" },
|
|
1732
|
+
aspect_ratio: { kind: "string", enum: ["16:9"] },
|
|
1733
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1734
|
+
duration: { kind: "number", enum: WAN_27_DURATIONS },
|
|
1735
|
+
seed: { kind: "number" },
|
|
1736
|
+
generate_audio: { kind: "boolean" }
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
"alibaba/happyhorse-1.1": {
|
|
1740
|
+
// Third reference-capable option: strong identity, correct ratios, no audio.
|
|
1741
|
+
// First-frame only (no `last_frame`), so it cannot close a beat on a
|
|
1742
|
+
// specified end pose the way Wan and Veo can.
|
|
1743
|
+
label: "Alibaba HappyHorse 1.1",
|
|
1744
|
+
inputs: [],
|
|
1745
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1746
|
+
required: ["prompt"],
|
|
1747
|
+
params: {
|
|
1748
|
+
prompt: { kind: "string" },
|
|
1749
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9", "9:21"] },
|
|
1750
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1751
|
+
duration: { kind: "number", enum: HAPPYHORSE_DURATIONS },
|
|
1752
|
+
seed: { kind: "number" }
|
|
1753
|
+
}
|
|
1754
|
+
},
|
|
1755
|
+
"google/veo-3.1-lite": {
|
|
1756
|
+
// The cheapest way to animate a still that carries a real face: same Veo
|
|
1757
|
+
// family and the same escape from ByteDance's filter, at $0.05/s with audio
|
|
1758
|
+
// at 720p against Veo 3.1's $0.40. That 8x is the difference between an
|
|
1759
|
+
// avatar clip you iterate on and one you think twice about.
|
|
1760
|
+
label: "Google Veo 3.1 Lite",
|
|
1761
|
+
inputs: [],
|
|
1762
|
+
optional_inputs: [{ kind: "image", mimes: OPENROUTER_IMAGE_MIMES }],
|
|
1763
|
+
required: ["prompt"],
|
|
1764
|
+
params: {
|
|
1765
|
+
prompt: { kind: "string" },
|
|
1766
|
+
negative_prompt: { kind: "string" },
|
|
1767
|
+
aspect_ratio: { kind: "string", enum: ["16:9", "9:16"] },
|
|
1768
|
+
resolution: { kind: "string", enum: ["720p", "1080p"] },
|
|
1769
|
+
duration: { kind: "number", enum: [4, 6, 8] },
|
|
1770
|
+
seed: { kind: "number" },
|
|
1771
|
+
generate_audio: { kind: "boolean" },
|
|
1772
|
+
person_generation: { kind: "string", enum: ["allow_all", "allow_adult"] },
|
|
1773
|
+
enhance_prompt: { kind: "boolean" },
|
|
1774
|
+
conditioning_scale: { kind: "number" }
|
|
1775
|
+
}
|
|
1776
|
+
},
|
|
1684
1777
|
"google/veo-3.1-fast": {
|
|
1685
1778
|
// Cheap test/iteration model. Forwarded by the backend via
|
|
1686
1779
|
// `provider.options.google-vertex.parameters` (camelCased on the wire).
|
|
@@ -2055,6 +2148,7 @@ function validateValue(key, value, schema, model) {
|
|
|
2055
2148
|
|
|
2056
2149
|
// ../canvas-contract/src/videoCost.ts
|
|
2057
2150
|
var CREDITS_PER_USD = 100;
|
|
2151
|
+
var OPENING_FRAME_CREDITS = Math.ceil(0.03 * CREDITS_PER_USD);
|
|
2058
2152
|
var SEEDANCE_USD_PER_SECOND = {
|
|
2059
2153
|
"480p": 0.18,
|
|
2060
2154
|
"720p": 0.5,
|
|
@@ -2075,12 +2169,37 @@ function seedance25UsdPerSecond(resolution) {
|
|
|
2075
2169
|
return SEEDANCE_25_USD_PER_SECOND[resolution ?? DEFAULT_VIDEO_RESOLUTION] ?? SEEDANCE_25_FALLBACK_USD_PER_SECOND;
|
|
2076
2170
|
}
|
|
2077
2171
|
var FALLBACK_USD_PER_SECOND = 0.5;
|
|
2172
|
+
var MIN_BILLED_SECONDS = 5;
|
|
2173
|
+
var MODELS_WITH_BILLING_FLOOR = /* @__PURE__ */ new Set(["alibaba/wan-2.7", "alibaba/happyhorse-1.1"]);
|
|
2174
|
+
function billedSeconds(model, duration) {
|
|
2175
|
+
return MODELS_WITH_BILLING_FLOOR.has(model) ? Math.max(duration, MIN_BILLED_SECONDS) : duration;
|
|
2176
|
+
}
|
|
2078
2177
|
function seedanceUsdPerSecond(resolution) {
|
|
2079
2178
|
return SEEDANCE_USD_PER_SECOND[resolution ?? DEFAULT_VIDEO_RESOLUTION] ?? FALLBACK_USD_PER_SECOND;
|
|
2080
2179
|
}
|
|
2081
2180
|
var USD_PER_SECOND = {
|
|
2082
2181
|
// Kling publishes one flat rate across every resolution and mode.
|
|
2083
2182
|
"kwaivgi/kling-v3.0-pro": { silent: 0.112, audio: 0.168 },
|
|
2183
|
+
// The three reference-capable avatar models. Rates are the published
|
|
2184
|
+
// per-second SKUs; see MIN_BILLED_SECONDS below for why a short clip still
|
|
2185
|
+
// costs more than rate x duration.
|
|
2186
|
+
"x-ai/grok-imagine-video": {
|
|
2187
|
+
silent: 0.07,
|
|
2188
|
+
audio: 0.07,
|
|
2189
|
+
byResolution: { "480p": { silent: 0.05, audio: 0.05 }, "720p": { silent: 0.07, audio: 0.07 } }
|
|
2190
|
+
},
|
|
2191
|
+
// Flat $0.10/s across resolutions and modes, audio included.
|
|
2192
|
+
"alibaba/wan-2.7": { silent: 0.1, audio: 0.1 },
|
|
2193
|
+
"alibaba/happyhorse-1.1": {
|
|
2194
|
+
silent: 0.1278,
|
|
2195
|
+
audio: 0.1278,
|
|
2196
|
+
byResolution: { "720p": { silent: 0.0988, audio: 0.0988 } }
|
|
2197
|
+
},
|
|
2198
|
+
"google/veo-3.1-lite": {
|
|
2199
|
+
silent: 0.05,
|
|
2200
|
+
audio: 0.08,
|
|
2201
|
+
byResolution: { "720p": { silent: 0.03, audio: 0.05 } }
|
|
2202
|
+
},
|
|
2084
2203
|
// Veo prices 4K far above the base tier — and 4K is a selectable resolution,
|
|
2085
2204
|
// so folding it into the base rate under-quotes the dearest clip we can make.
|
|
2086
2205
|
"google/veo-3.1": {
|
|
@@ -2117,7 +2236,7 @@ function falSeedanceUsdPerSecond(resolution, buildsOnSourceClip = false) {
|
|
|
2117
2236
|
}
|
|
2118
2237
|
function estimateVideoCostUsd(input) {
|
|
2119
2238
|
const { model, duration, resolution, generateAudio, buildsOnSourceClip } = input;
|
|
2120
|
-
const seconds = duration ?? DEFAULT_VIDEO_DURATION_S;
|
|
2239
|
+
const seconds = billedSeconds(model, duration ?? DEFAULT_VIDEO_DURATION_S);
|
|
2121
2240
|
const sourceClipPremium = buildsOnSourceClip ? VIDEO_SOURCE_COST_MULTIPLIER : 1;
|
|
2122
2241
|
if (isGeminiOmniModel(model)) {
|
|
2123
2242
|
return GEMINI_OMNI_WINDOW_SECONDS * GEMINI_OMNI_USD_PER_SECOND * GEMINI_OMNI_WINDOW_MARGIN;
|
|
@@ -8955,4 +9074,4 @@ export {
|
|
|
8955
9074
|
defaultRegistry,
|
|
8956
9075
|
createEngineFromEnv
|
|
8957
9076
|
};
|
|
8958
|
-
//# sourceMappingURL=chunk-
|
|
9077
|
+
//# sourceMappingURL=chunk-CMPAHYLB.js.map
|