@nodaro/shared 3.33.0 → 3.36.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/{chunk-CK3GK34R.js → chunk-2HIDE3QV.js} +9 -3
- package/dist/chunk-2HIDE3QV.js.map +1 -0
- package/dist/{chunk-WDIBOWAA.js → chunk-2HVFF5SS.js} +6 -6
- package/dist/chunk-2HVFF5SS.js.map +1 -0
- package/dist/{chunk-PVJBAPYJ.js → chunk-56VQ7V3V.js} +8 -5
- package/dist/chunk-56VQ7V3V.js.map +1 -0
- package/dist/{chunk-Z2OL5AJD.cjs → chunk-6F6GGX2W.cjs} +4 -3
- package/dist/chunk-6F6GGX2W.cjs.map +1 -0
- package/dist/{chunk-HKFMXNVQ.cjs → chunk-75ZMA34U.cjs} +11 -11
- package/dist/{chunk-HKFMXNVQ.cjs.map → chunk-75ZMA34U.cjs.map} +1 -1
- package/dist/{chunk-6WZ2VN7V.js → chunk-7AB3AE5L.js} +6 -6
- package/dist/{chunk-6WZ2VN7V.js.map → chunk-7AB3AE5L.js.map} +1 -1
- package/dist/{chunk-VXPLKQWY.cjs → chunk-7VQPHLZ5.cjs} +30 -40
- package/dist/chunk-7VQPHLZ5.cjs.map +1 -0
- package/dist/{chunk-BG5D5CZ6.js → chunk-ANOQWAMU.js} +23 -6
- package/dist/chunk-ANOQWAMU.js.map +1 -0
- package/dist/{chunk-PRYE7AZQ.cjs → chunk-AWWOQH46.cjs} +7 -7
- package/dist/chunk-AWWOQH46.cjs.map +1 -0
- package/dist/{chunk-PXFQVLBX.js → chunk-AXUW64ZY.js} +26 -36
- package/dist/chunk-AXUW64ZY.js.map +1 -0
- package/dist/{chunk-FT5CF6IA.js → chunk-AZBIXGM5.js} +3 -3
- package/dist/{chunk-FT5CF6IA.js.map → chunk-AZBIXGM5.js.map} +1 -1
- package/dist/{chunk-D6GNRSCV.cjs → chunk-BBLE4UTG.cjs} +23 -6
- package/dist/chunk-BBLE4UTG.cjs.map +1 -0
- package/dist/{chunk-HUR6ZJ7S.cjs → chunk-BSQCKTXH.cjs} +6 -6
- package/dist/{chunk-HUR6ZJ7S.cjs.map → chunk-BSQCKTXH.cjs.map} +1 -1
- package/dist/{chunk-HGC5JNVA.cjs → chunk-BVVKMQKR.cjs} +9 -2
- package/dist/chunk-BVVKMQKR.cjs.map +1 -0
- package/dist/{chunk-SAW5OK36.cjs → chunk-BYP62B7F.cjs} +6 -6
- package/dist/{chunk-SAW5OK36.cjs.map → chunk-BYP62B7F.cjs.map} +1 -1
- package/dist/{chunk-YYV35XOS.js → chunk-C4R7BTBQ.js} +4 -3
- package/dist/chunk-C4R7BTBQ.js.map +1 -0
- package/dist/{chunk-UCFWI6D4.js → chunk-CMH2ACOX.js} +3 -3
- package/dist/{chunk-UCFWI6D4.js.map → chunk-CMH2ACOX.js.map} +1 -1
- package/dist/{chunk-WD6HJRBG.cjs → chunk-DE3PEIIP.cjs} +21 -21
- package/dist/{chunk-WD6HJRBG.cjs.map → chunk-DE3PEIIP.cjs.map} +1 -1
- package/dist/{chunk-SFW3UB2P.js → chunk-DKTRVOU5.js} +4 -4
- package/dist/{chunk-SFW3UB2P.js.map → chunk-DKTRVOU5.js.map} +1 -1
- package/dist/{chunk-YBPBK5KI.js → chunk-FKQJYMCO.js} +97 -23
- package/dist/chunk-FKQJYMCO.js.map +1 -0
- package/dist/{chunk-ZDFHA2EC.js → chunk-FVKCNAEQ.js} +51 -7
- package/dist/chunk-FVKCNAEQ.js.map +1 -0
- package/dist/{chunk-OZSACQ2V.js → chunk-GW54ANCH.js} +3 -3
- package/dist/{chunk-OZSACQ2V.js.map → chunk-GW54ANCH.js.map} +1 -1
- package/dist/chunk-GZH2SIOF.cjs +99 -0
- package/dist/chunk-GZH2SIOF.cjs.map +1 -0
- package/dist/{chunk-M7GQBRZU.cjs → chunk-HABDAHZR.cjs} +153 -24
- package/dist/chunk-HABDAHZR.cjs.map +1 -0
- package/dist/{chunk-CUH22J4D.js → chunk-IIGKJYWL.js} +3 -3
- package/dist/{chunk-CUH22J4D.js.map → chunk-IIGKJYWL.js.map} +1 -1
- package/dist/{chunk-JL4C5VJ7.cjs → chunk-J65CAOUV.cjs} +14 -2
- package/dist/chunk-J65CAOUV.cjs.map +1 -0
- package/dist/{chunk-HRXEZ3SX.cjs → chunk-JABZNRXL.cjs} +4 -4
- package/dist/{chunk-HRXEZ3SX.cjs.map → chunk-JABZNRXL.cjs.map} +1 -1
- package/dist/{chunk-5RYLK3MQ.js → chunk-JMUHMLJP.js} +11 -6
- package/dist/chunk-JMUHMLJP.js.map +1 -0
- package/dist/{chunk-K3LLGRK7.cjs → chunk-KOP7UTQR.cjs} +72 -15
- package/dist/chunk-KOP7UTQR.cjs.map +1 -0
- package/dist/{chunk-HC7VKIV5.cjs → chunk-LT5IJO4Y.cjs} +49 -46
- package/dist/chunk-LT5IJO4Y.cjs.map +1 -0
- package/dist/{chunk-VA42637J.cjs → chunk-MSDECC3A.cjs} +46 -41
- package/dist/chunk-MSDECC3A.cjs.map +1 -0
- package/dist/{chunk-JFS3NWZ5.cjs → chunk-MSIIC6MY.cjs} +7 -4
- package/dist/chunk-MSIIC6MY.cjs.map +1 -0
- package/dist/{chunk-D26ENTN2.cjs → chunk-NITAUX3A.cjs} +80 -52
- package/dist/chunk-NITAUX3A.cjs.map +1 -0
- package/dist/{chunk-23FJQTEA.js → chunk-NTHRTRQK.js} +38 -15
- package/dist/chunk-NTHRTRQK.js.map +1 -0
- package/dist/{chunk-OTATNBMD.js → chunk-NYMOHNYV.js} +3 -3
- package/dist/{chunk-OTATNBMD.js.map → chunk-NYMOHNYV.js.map} +1 -1
- package/dist/{chunk-PQHS255G.js → chunk-OHSIVNJO.js} +3 -3
- package/dist/chunk-OHSIVNJO.js.map +1 -0
- package/dist/{chunk-7Z5LUTGU.js → chunk-QXTCIJP5.js} +6 -3
- package/dist/{chunk-JFS3NWZ5.cjs.map → chunk-QXTCIJP5.js.map} +1 -1
- package/dist/{chunk-5PC6JBGJ.cjs → chunk-R2VF5NQG.cjs} +3 -3
- package/dist/chunk-R2VF5NQG.cjs.map +1 -0
- package/dist/{chunk-UTQSSKSG.js → chunk-SPP6HQMM.js} +4 -4
- package/dist/{chunk-UTQSSKSG.js.map → chunk-SPP6HQMM.js.map} +1 -1
- package/dist/chunk-TCBHVIMD.js +89 -0
- package/dist/chunk-TCBHVIMD.js.map +1 -0
- package/dist/{chunk-SES6GDBQ.cjs → chunk-UJJUX6NW.cjs} +59 -8
- package/dist/chunk-UJJUX6NW.cjs.map +1 -0
- package/dist/{chunk-ZRL2UFTH.cjs → chunk-V3N56Z2S.cjs} +101 -22
- package/dist/chunk-V3N56Z2S.cjs.map +1 -0
- package/dist/{chunk-PHZ23DP3.js → chunk-VRLRPGO7.js} +125 -12
- package/dist/chunk-VRLRPGO7.js.map +1 -0
- package/dist/{chunk-WKOIGLQX.cjs → chunk-VRUN5TG2.cjs} +8 -8
- package/dist/{chunk-WKOIGLQX.cjs.map → chunk-VRUN5TG2.cjs.map} +1 -1
- package/dist/{chunk-QA3MVQ32.js → chunk-W4GABGRD.js} +6 -6
- package/dist/chunk-W4GABGRD.js.map +1 -0
- package/dist/{chunk-M36G6SRP.js → chunk-WXNQMJ67.js} +14 -3
- package/dist/chunk-WXNQMJ67.js.map +1 -0
- package/dist/chunk-XJ3HJSO5.cjs +25 -0
- package/dist/chunk-XJ3HJSO5.cjs.map +1 -0
- package/dist/{chunk-XGFTL5XY.js → chunk-YHCG3HOR.js} +3 -3
- package/dist/{chunk-XGFTL5XY.js.map → chunk-YHCG3HOR.js.map} +1 -1
- package/dist/{chunk-VNQRI2RO.cjs → chunk-YN6AXDN5.cjs} +16 -16
- package/dist/{chunk-VNQRI2RO.cjs.map → chunk-YN6AXDN5.cjs.map} +1 -1
- package/dist/{chunk-2NQLSLSN.cjs → chunk-YNJ44IAL.cjs} +5 -5
- package/dist/{chunk-2NQLSLSN.cjs.map → chunk-YNJ44IAL.cjs.map} +1 -1
- package/dist/{chunk-ZL7UM6PU.cjs → chunk-YSEM7JDE.cjs} +4 -4
- package/dist/{chunk-ZL7UM6PU.cjs.map → chunk-YSEM7JDE.cjs.map} +1 -1
- package/dist/{chunk-ZO5PBBFX.js → chunk-ZG4XSEZV.js} +72 -15
- package/dist/chunk-ZG4XSEZV.js.map +1 -0
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.d.cts +2 -2
- package/dist/entries/apps.d.ts +2 -2
- package/dist/entries/apps.js +8 -7
- package/dist/entries/catalogs.d.cts +1 -1
- package/dist/entries/catalogs.d.ts +1 -1
- package/dist/entries/credits.cjs +153 -153
- package/dist/entries/credits.d.cts +1 -1
- package/dist/entries/credits.d.ts +1 -1
- package/dist/entries/credits.js +8 -8
- package/dist/entries/edl.cjs +130 -102
- package/dist/entries/edl.d.cts +74 -3
- package/dist/entries/edl.d.ts +74 -3
- package/dist/entries/edl.js +2 -2
- package/dist/entries/entities.cjs +126 -122
- package/dist/entries/entities.d.cts +2 -2
- package/dist/entries/entities.d.ts +2 -2
- package/dist/entries/entities.js +1 -1
- package/dist/entries/i18n.cjs +11 -11
- package/dist/entries/i18n.d.cts +2 -2
- package/dist/entries/i18n.d.ts +2 -2
- package/dist/entries/i18n.js +1 -1
- package/dist/entries/llm-models.cjs +63 -43
- package/dist/entries/llm-models.d.cts +71 -4
- package/dist/entries/llm-models.d.ts +71 -4
- package/dist/entries/llm-models.js +1 -1
- package/dist/entries/media.cjs +45 -41
- package/dist/entries/media.d.cts +39 -1
- package/dist/entries/media.d.ts +39 -1
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +66 -66
- package/dist/entries/model-catalog.d.cts +2 -2
- package/dist/entries/model-catalog.d.ts +2 -2
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +274 -210
- package/dist/entries/models.d.cts +3 -3
- package/dist/entries/models.d.ts +3 -3
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +222 -201
- package/dist/entries/nodes.d.cts +48 -8
- package/dist/entries/nodes.d.ts +48 -8
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +149 -149
- package/dist/entries/pipeline.d.cts +8 -4
- package/dist/entries/pipeline.d.ts +8 -4
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/social.cjs +174 -174
- package/dist/entries/social.d.cts +13 -5
- package/dist/entries/social.d.ts +13 -5
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +1 -1
- package/dist/entries/types.d.ts +1 -1
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +115 -115
- package/dist/entries/video.d.cts +4 -3
- package/dist/entries/video.d.ts +4 -3
- package/dist/entries/video.js +4 -4
- package/dist/entries/workflow.cjs +96 -95
- package/dist/entries/workflow.d.cts +7 -18
- package/dist/entries/workflow.d.ts +7 -18
- package/dist/entries/workflow.js +2 -1
- package/dist/index.cjs +1708 -1567
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +26 -25
- package/dist/{model-catalog-V-ZNzRSd.d.ts → model-catalog-I48SvalA.d.cts} +25 -0
- package/dist/{model-catalog-V-ZNzRSd.d.cts → model-catalog-I48SvalA.d.ts} +25 -0
- package/dist/{presentation-utils-D0kxsWf9.d.cts → presentation-utils-A4i92SYo.d.cts} +1 -1
- package/dist/{presentation-utils-pZwlEAzo.d.ts → presentation-utils-DjdPtM9k.d.ts} +1 -1
- package/dist/{scene-node-types-C3kl_zyK.d.ts → scene-node-types-Cvbtf-0a.d.cts} +147 -6
- package/dist/{scene-node-types-C3kl_zyK.d.cts → scene-node-types-Cvbtf-0a.d.ts} +147 -6
- package/dist/{types-DffyGSy5.d.cts → types-CU6SQnMS.d.cts} +0 -5
- package/dist/{types-DffyGSy5.d.ts → types-CU6SQnMS.d.ts} +0 -5
- package/dist/{types-BRlFPEru.d.ts → types-DzUBR7yr.d.cts} +8 -1
- package/dist/{types-BRlFPEru.d.cts → types-DzUBR7yr.d.ts} +8 -1
- package/package.json +1 -1
- package/src/__tests__/camera-switch-contract.test.ts +33 -1
- package/src/__tests__/character-mention-slug.test.ts +0 -8
- package/src/__tests__/effective-tier.test.ts +3 -14
- package/src/__tests__/fixtures/camera-switch-speaker-map-parity.json +178 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +21 -0
- package/src/__tests__/fixtures/speaker-map-camera-ids.json +26 -0
- package/src/__tests__/gvp-supported-providers.test.ts +1 -0
- package/src/__tests__/i18n-locale-completeness.test.ts +38 -3
- package/src/__tests__/llm-models.test.ts +200 -20
- package/src/__tests__/node-preset-extract.test.ts +10 -0
- package/src/__tests__/preview-gate-use-case.test.ts +16 -1
- package/src/__tests__/producer-types.test.ts +19 -0
- package/src/__tests__/run-continuation.test.ts +4 -1
- package/src/__tests__/speaker-map-contract.test.ts +48 -0
- package/src/__tests__/unit-contract-compose.test.ts +129 -0
- package/src/__tests__/unit-contracts.test.ts +134 -0
- package/src/__tests__/use-case-types.test.ts +33 -0
- package/src/__tests__/video-catalog-totality.test.ts +15 -1
- package/src/__tests__/video-collapse-parity.test.ts +10 -0
- package/src/__tests__/video-frame-slot.test.ts +85 -0
- package/src/__tests__/video-mode-aliases.test.ts +1 -0
- package/src/__tests__/video-reference-only.test.ts +117 -0
- package/src/__tests__/vidu-q4-catalog.test.ts +230 -0
- package/src/camera-switch-contract.ts +36 -2
- package/src/credit-identifiers.ts +19 -6
- package/src/entity-asset-types.ts +13 -0
- package/src/entries/edl.ts +2 -0
- package/src/entries/llm-models.ts +5 -0
- package/src/entries/media.ts +1 -0
- package/src/entries/models.ts +25 -0
- package/src/entries/nodes.ts +5 -1
- package/src/fan-out-rows.ts +36 -3
- package/src/generate-mask.ts +40 -0
- package/src/generated/unit-contracts.ts +58 -0
- package/src/i18n/types.ts +13 -2
- package/src/json-kinds.ts +24 -4
- package/src/llm-models.ts +184 -31
- package/src/meta-ads-scrape.ts +16 -8
- package/src/model-catalog.ts +91 -13
- package/src/model-constants.ts +260 -5
- package/src/node-default-mappings.ts +3 -0
- package/src/node-preset-extract.ts +8 -0
- package/src/pipeline-types.ts +3 -0
- package/src/presentation-utils.ts +12 -12
- package/src/preview-gate.ts +4 -2
- package/src/producer-types.ts +19 -19
- package/src/run-continuation.ts +26 -4
- package/src/speaker-layouts.ts +8 -3
- package/src/speaker-map-contract.ts +77 -0
- package/src/unit-contract-compose.ts +55 -0
- package/src/use-case-types.ts +19 -0
- package/src/video-ui-defaults.ts +7 -5
- package/dist/chunk-23FJQTEA.js.map +0 -1
- package/dist/chunk-5PC6JBGJ.cjs.map +0 -1
- package/dist/chunk-5RYLK3MQ.js.map +0 -1
- package/dist/chunk-7Z5LUTGU.js.map +0 -1
- package/dist/chunk-BG5D5CZ6.js.map +0 -1
- package/dist/chunk-CK3GK34R.js.map +0 -1
- package/dist/chunk-D26ENTN2.cjs.map +0 -1
- package/dist/chunk-D6GNRSCV.cjs.map +0 -1
- package/dist/chunk-HC7VKIV5.cjs.map +0 -1
- package/dist/chunk-HGC5JNVA.cjs.map +0 -1
- package/dist/chunk-JL4C5VJ7.cjs.map +0 -1
- package/dist/chunk-K3LLGRK7.cjs.map +0 -1
- package/dist/chunk-M36G6SRP.js.map +0 -1
- package/dist/chunk-M7GQBRZU.cjs.map +0 -1
- package/dist/chunk-PHZ23DP3.js.map +0 -1
- package/dist/chunk-PQHS255G.js.map +0 -1
- package/dist/chunk-PRYE7AZQ.cjs.map +0 -1
- package/dist/chunk-PVJBAPYJ.js.map +0 -1
- package/dist/chunk-PXFQVLBX.js.map +0 -1
- package/dist/chunk-QA3MVQ32.js.map +0 -1
- package/dist/chunk-SES6GDBQ.cjs.map +0 -1
- package/dist/chunk-TU33KYKW.cjs +0 -25
- package/dist/chunk-TU33KYKW.cjs.map +0 -1
- package/dist/chunk-VA42637J.cjs.map +0 -1
- package/dist/chunk-VXPLKQWY.cjs.map +0 -1
- package/dist/chunk-WDIBOWAA.js.map +0 -1
- package/dist/chunk-YBPBK5KI.js.map +0 -1
- package/dist/chunk-YYV35XOS.js.map +0 -1
- package/dist/chunk-Z2OL5AJD.cjs.map +0 -1
- package/dist/chunk-ZDFHA2EC.js.map +0 -1
- package/dist/chunk-ZO5PBBFX.js.map +0 -1
- package/dist/chunk-ZRL2UFTH.cjs.map +0 -1
- package/src/__tests__/__snapshots__/prompt-builder-segments.test.ts.snap +0 -65
package/src/model-constants.ts
CHANGED
|
@@ -53,6 +53,28 @@ export const IMAGE_ASPECT_RATIO_VALUES = [
|
|
|
53
53
|
/** A ratio string the image routes accept (pre-snap vocabulary, not a per-model guarantee). */
|
|
54
54
|
export type ImageAspectRatio = typeof IMAGE_ASPECT_RATIO_VALUES[number]
|
|
55
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The `resolution` vocabulary `/v1/generate-image` and `/v1/image-to-image`
|
|
58
|
+
* accept: the K tiers (`1K`/`2K`/`4K`) and the Flux 2 megapixel tiers. Like
|
|
59
|
+
* {@link IMAGE_ASPECT_RATIO_VALUES} it is a vocabulary bound, not a per-model
|
|
60
|
+
* gate — the catalog snap corrects a value the chosen model does not declare.
|
|
61
|
+
* One tuple for the route Zod enums and the SDK's `ImageResolution`.
|
|
62
|
+
*/
|
|
63
|
+
export const IMAGE_RESOLUTION_VALUES = ["1K", "2K", "4K", "0.5 MP", "1 MP", "2 MP", "4 MP"] as const
|
|
64
|
+
export type ImageResolution = typeof IMAGE_RESOLUTION_VALUES[number]
|
|
65
|
+
|
|
66
|
+
/** The `quality` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
|
|
67
|
+
export const IMAGE_QUALITY_VALUES = ["medium", "high", "basic"] as const
|
|
68
|
+
export type ImageQuality = typeof IMAGE_QUALITY_VALUES[number]
|
|
69
|
+
|
|
70
|
+
/** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
|
|
71
|
+
export const IMAGE_RENDERING_SPEED_VALUES = ["TURBO", "BALANCED", "QUALITY"] as const
|
|
72
|
+
export type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number]
|
|
73
|
+
|
|
74
|
+
/** `/v1/edit-image`'s `targetResolution` (the upscalers' output tier; topaz maps it to a factor). */
|
|
75
|
+
export const IMAGE_EDIT_TARGET_RESOLUTION_VALUES = ["2K", "4K", "8K"] as const
|
|
76
|
+
export type ImageEditTargetResolution = typeof IMAGE_EDIT_TARGET_RESOLUTION_VALUES[number]
|
|
77
|
+
|
|
56
78
|
/**
|
|
57
79
|
* Per-provider maximum ASSEMBLED image-prompt length (chars), VERIFIED against
|
|
58
80
|
* each model's official docs.kie.ai schema (2026-06). Providers absent here use
|
|
@@ -222,6 +244,9 @@ export const MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER: Record<string, number> = {
|
|
|
222
244
|
// (docs.kie.ai/market/wan/3-0-video and /3-0-video-prime).
|
|
223
245
|
"wan-3": 20000,
|
|
224
246
|
"wan-3-prime": 20000,
|
|
247
|
+
// Vidu Q4 — 20000 chars on both endpoints
|
|
248
|
+
// (docs.kie.ai/market/vidu-q4/image-to-video and /reference-to-video).
|
|
249
|
+
"vidu-q4": 20000,
|
|
225
250
|
"bytedance-lite": 10000,
|
|
226
251
|
"bytedance-pro": 10000,
|
|
227
252
|
"bytedance-pro-fast": 10000,
|
|
@@ -816,12 +841,17 @@ export const IMAGE_EDIT_PROVIDERS = [
|
|
|
816
841
|
* (`imageParam: "task_id"`) places it in the request body. Membership here
|
|
817
842
|
* must match the KIE configs with `imageParam: "task_id"` — guarded by
|
|
818
843
|
* backend/src/routes/__tests__/edit-image.test.ts.
|
|
844
|
+
*
|
|
845
|
+
* The ids as a tuple ({@link TaskChainedEditProvider} is its type); the Set is
|
|
846
|
+
* built from it, so the two cannot disagree.
|
|
819
847
|
*/
|
|
820
|
-
export const
|
|
848
|
+
export const TASK_CHAINED_EDIT_PROVIDER_IDS = [
|
|
821
849
|
"grok-upscale",
|
|
822
850
|
"grok-2-edit",
|
|
823
851
|
"grok-2-segment",
|
|
824
|
-
])
|
|
852
|
+
] as const satisfies readonly (typeof IMAGE_EDIT_PROVIDERS)[number][]
|
|
853
|
+
export type TaskChainedEditProvider = typeof TASK_CHAINED_EDIT_PROVIDER_IDS[number]
|
|
854
|
+
export const TASK_CHAINED_EDIT_PROVIDERS: ReadonlySet<string> = new Set(TASK_CHAINED_EDIT_PROVIDER_IDS)
|
|
825
855
|
|
|
826
856
|
/** Modify image providers (I2I + edit-with-prompt) */
|
|
827
857
|
export const MODIFY_IMAGE_PROVIDERS = [
|
|
@@ -878,6 +908,10 @@ export const IMAGE_TO_VIDEO_PROVIDERS = [
|
|
|
878
908
|
// so each id is listed in this array AND in TEXT_TO_VIDEO_PROVIDERS.
|
|
879
909
|
"wan-3",
|
|
880
910
|
"wan-3-prime",
|
|
911
|
+
// Vidu Q4 — one id over KIE's image-to-video and reference-to-video
|
|
912
|
+
// endpoints. No text-to-video mode: also listed in TEXT_TO_VIDEO_PROVIDERS's
|
|
913
|
+
// image-required section so the t2v route answers with the friendly 400.
|
|
914
|
+
"vidu-q4",
|
|
881
915
|
"ltx-2.3-pro",
|
|
882
916
|
"ltx-2.3-fast",
|
|
883
917
|
// xAI Grok Imagine Video 1.5 — KIE i2v (image_urls required). Also listed in
|
|
@@ -939,6 +973,7 @@ export const TEXT_TO_VIDEO_PROVIDERS = [
|
|
|
939
973
|
"hailuo-2.3-pro",
|
|
940
974
|
"bytedance-pro-fast",
|
|
941
975
|
"happyhorse-ref2v",
|
|
976
|
+
"vidu-q4",
|
|
942
977
|
// Replicate disabled
|
|
943
978
|
// "runway",
|
|
944
979
|
// "pika",
|
|
@@ -1024,8 +1059,16 @@ export function resolveVideoProviderForMode(
|
|
|
1024
1059
|
* `grok` → silently dropped (#861). When refs are present and ONLY the i2v
|
|
1025
1060
|
* twin can carry them, the run is image-to-video with the refs as its images.
|
|
1026
1061
|
* Derived from VIDEO_REF_LIMITS_BY_PROVIDER (= the catalog's `reference-image`
|
|
1027
|
-
* feature), never from a provider name
|
|
1028
|
-
*
|
|
1062
|
+
* feature), never from a provider name.
|
|
1063
|
+
*
|
|
1064
|
+
* A SINGLE-id model with no text-to-video mode is the other nuance: its t2v
|
|
1065
|
+
* lane is image-gated (VIDEO_PROVIDERS_REQUIRING_IMAGE), so a references-only
|
|
1066
|
+
* run sent there was refused even when the provider runs happily from
|
|
1067
|
+
* references alone (Vidu Q4, HappyHorse Ref2V). When the catalog declares the
|
|
1068
|
+
* `reference-to-video` capability ({@link videoProviderRunsFromReferences}),
|
|
1069
|
+
* such a run takes the image-to-video lane with the refs as its images —
|
|
1070
|
+
* exactly what `/v1/generate-video` already did for the direct API. A single-id
|
|
1071
|
+
* model WITH a text-to-video mode keeps the t2v lane, which carries its refs.
|
|
1029
1072
|
*/
|
|
1030
1073
|
export function resolveVideoModeForInputs(
|
|
1031
1074
|
provider: string | undefined,
|
|
@@ -1035,11 +1078,85 @@ export function resolveVideoModeForInputs(
|
|
|
1035
1078
|
if (!provider || !inputs.hasImageRefs) return "text-to-video"
|
|
1036
1079
|
const i2v = resolveVideoProviderForMode(provider, "image-to-video")
|
|
1037
1080
|
const t2v = resolveVideoProviderForMode(provider, "text-to-video")
|
|
1038
|
-
if (i2v === t2v)
|
|
1081
|
+
if (i2v === t2v) {
|
|
1082
|
+
const entry = MODEL_CATALOG[i2v]
|
|
1083
|
+
const noTextMode = !!entry && !(entry.modes as readonly string[]).includes("t2v")
|
|
1084
|
+
return noTextMode && videoProviderRunsFromReferences(i2v) ? "image-to-video" : "text-to-video"
|
|
1085
|
+
}
|
|
1039
1086
|
const carriesImageRefs = (id: string) => (VIDEO_REF_LIMITS_BY_PROVIDER[id]?.images ?? 0) > 0
|
|
1040
1087
|
return carriesImageRefs(i2v) && !carriesImageRefs(t2v) ? "image-to-video" : "text-to-video"
|
|
1041
1088
|
}
|
|
1042
1089
|
|
|
1090
|
+
/** The prompt syntax a video provider addresses its images in, by array order. */
|
|
1091
|
+
export type VideoReferenceSyntax = "@image_N" | "@image(n)" | "[Image N]"
|
|
1092
|
+
|
|
1093
|
+
/**
|
|
1094
|
+
* The syntax this video model's frame / identity binding sentences are written
|
|
1095
|
+
* in — the catalog's `referenceSyntax`, else the platform's `@image_N`. One
|
|
1096
|
+
* descriptor for the app's resolvers and for a client (the cloud plugins) that
|
|
1097
|
+
* cites references by ordinal.
|
|
1098
|
+
*/
|
|
1099
|
+
export function videoProviderReferenceSyntax(provider: string | undefined): VideoReferenceSyntax {
|
|
1100
|
+
return (provider ? MODEL_CATALOG[provider]?.referenceSyntax : undefined) ?? "@image_N"
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
/**
|
|
1104
|
+
* Reference-capable video models whose start/end frames ride a channel of
|
|
1105
|
+
* their OWN (separate frame parameters next to the reference list), so a frame
|
|
1106
|
+
* never occupies a reference seat. `kling-3-omni` (Replicate `start_image` /
|
|
1107
|
+
* `end_image`) is the only one — and it has no dispatch path today.
|
|
1108
|
+
*/
|
|
1109
|
+
export const VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL: ReadonlySet<string> = new Set([
|
|
1110
|
+
"kling-3-omni",
|
|
1111
|
+
])
|
|
1112
|
+
|
|
1113
|
+
/**
|
|
1114
|
+
* True when this video model puts a start (and end) frame AFTER the caller's
|
|
1115
|
+
* own reference images in ONE shared image list, bound in the prompt as the
|
|
1116
|
+
* opening / closing frame in its own syntax — the platform convention, so the
|
|
1117
|
+
* caller's image token N always means their Nth reference. At the image cap
|
|
1118
|
+
* the frames are kept and trailing caller references are dropped.
|
|
1119
|
+
*
|
|
1120
|
+
* Every reference-capable video model, except one whose frames ride a separate
|
|
1121
|
+
* channel ({@link VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL}).
|
|
1122
|
+
*/
|
|
1123
|
+
export function videoProviderAppendsFrames(provider: string | undefined): boolean {
|
|
1124
|
+
if (!provider) return false
|
|
1125
|
+
const entry = MODEL_CATALOG[provider]
|
|
1126
|
+
return !!entry && entry.kind === "video" &&
|
|
1127
|
+
entry.features?.includes("reference-image") === true &&
|
|
1128
|
+
!VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL.has(provider)
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* How many of a reference run's image seats the wired frames take on this
|
|
1133
|
+
* model: the start frame, plus the end frame where the model takes one (the
|
|
1134
|
+
* catalog `end-frame` feature). 0 on a model whose frames do not share its
|
|
1135
|
+
* reference list. A caller budgeting its own references subtracts this from
|
|
1136
|
+
* the provider's image cap so no reference of its is dropped.
|
|
1137
|
+
*/
|
|
1138
|
+
export function videoProviderRefModeFrameSeats(
|
|
1139
|
+
provider: string | undefined,
|
|
1140
|
+
frames: { readonly hasStartFrame: boolean; readonly hasEndFrame: boolean },
|
|
1141
|
+
): number {
|
|
1142
|
+
if (!provider) return 0
|
|
1143
|
+
if (!videoProviderAppendsFrames(provider)) return 0
|
|
1144
|
+
const start = frames.hasStartFrame ? 1 : 0
|
|
1145
|
+
const end = frames.hasEndFrame && MODEL_CATALOG[provider]?.features?.includes("end-frame") === true ? 1 : 0
|
|
1146
|
+
return start + end
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* True when the model's provider endpoint runs from reference images ALONE —
|
|
1151
|
+
* no start frame (the catalog's `reference-to-video` feature, declared only on
|
|
1152
|
+
* provider-spec evidence). The single capability every surface reads to decide
|
|
1153
|
+
* whether wired references satisfy "needs an image": the mode resolver above,
|
|
1154
|
+
* and through it the editor gate, the browser DAG and the orchestrator.
|
|
1155
|
+
*/
|
|
1156
|
+
export function videoProviderRunsFromReferences(provider: string | undefined): boolean {
|
|
1157
|
+
return !!provider && MODEL_CATALOG[provider]?.features?.includes("reference-to-video") === true
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1043
1160
|
/**
|
|
1044
1161
|
* t2v twin ids hidden from the unified Generate Video picker — the i2v/base
|
|
1045
1162
|
* entry already represents both modes (execution remaps by image presence).
|
|
@@ -1631,6 +1748,9 @@ export const DURATION_PRICED_PROVIDERS = new Set([
|
|
|
1631
1748
|
// this gate is consulted.
|
|
1632
1749
|
"wan-3",
|
|
1633
1750
|
"wan-3-prime",
|
|
1751
|
+
// Vidu Q4 — per-second billing at five resolution rates, identical on both
|
|
1752
|
+
// endpoints and with audio on or off.
|
|
1753
|
+
"vidu-q4",
|
|
1634
1754
|
])
|
|
1635
1755
|
|
|
1636
1756
|
/**
|
|
@@ -1736,6 +1856,45 @@ export function normalizeWan3Resolution(resolution: string | undefined): "480P"
|
|
|
1736
1856
|
}
|
|
1737
1857
|
}
|
|
1738
1858
|
|
|
1859
|
+
/**
|
|
1860
|
+
* Vidu Q4 family — the KIE "vidu-q4" market model. One Nodaro id covers two KIE
|
|
1861
|
+
* endpoints (image-to-video / reference-to-video); the provider layer picks the
|
|
1862
|
+
* endpoint by which inputs are wired. Exact-membership set, like the other
|
|
1863
|
+
* family predicates.
|
|
1864
|
+
*/
|
|
1865
|
+
export const VIDU_Q4_PROVIDERS = new Set<string>([
|
|
1866
|
+
"vidu-q4",
|
|
1867
|
+
])
|
|
1868
|
+
|
|
1869
|
+
export function isViduQ4Provider(provider: string | undefined): boolean {
|
|
1870
|
+
return !!provider && VIDU_Q4_PROVIDERS.has(provider)
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
/** Vidu Q4 resolution the platform renders when the param is omitted or
|
|
1874
|
+
* unknown — the tier the bare credit identifier prices (also KIE's own
|
|
1875
|
+
* default). Never `resolutions[0]`, which is the cheaper 540p. */
|
|
1876
|
+
export const VIDU_Q4_DEFAULT_RESOLUTION = "720p"
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* SINGLE normalization for the Vidu Q4 resolution lever. The KIE wire enum is
|
|
1880
|
+
* LOWERCASE ("540p" | "720p" | "1080p" | "2k" | "4k") — the same spelling as
|
|
1881
|
+
* the catalog and every credit identifier — so this only folds case and
|
|
1882
|
+
* collapses anything else (undefined, garbage, a stale "480p") to
|
|
1883
|
+
* {@link VIDU_Q4_DEFAULT_RESOLUTION}. The provider layer sends what this
|
|
1884
|
+
* returns and the credit identifier bills what this returns, so the two can
|
|
1885
|
+
* never disagree.
|
|
1886
|
+
*/
|
|
1887
|
+
export function normalizeViduQ4Resolution(resolution: string | undefined): "540p" | "720p" | "1080p" | "2k" | "4k" {
|
|
1888
|
+
switch (resolution?.trim().toLowerCase()) {
|
|
1889
|
+
case "540p": return "540p"
|
|
1890
|
+
case "1080p": return "1080p"
|
|
1891
|
+
case "2k": return "2k"
|
|
1892
|
+
case "4k": return "4k"
|
|
1893
|
+
case "720p": return "720p"
|
|
1894
|
+
default: return VIDU_Q4_DEFAULT_RESOLUTION
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
|
|
1739
1898
|
/**
|
|
1740
1899
|
* Google Gemini Omni family — the KIE "gemini-omni-video" market model and its
|
|
1741
1900
|
* faster/cheaper "google/gemini-omni-flash-1-1" sibling. Both take the SAME
|
|
@@ -2148,6 +2307,70 @@ export function findSeedance2AudioOverLimit(
|
|
|
2148
2307
|
return null
|
|
2149
2308
|
}
|
|
2150
2309
|
|
|
2310
|
+
/** A provider's documented contract for each REFERENCE AUDIO clip. */
|
|
2311
|
+
export interface RefAudioRule {
|
|
2312
|
+
/** Accepted containers, as ffprobe's `format_name` spells them ("mp3"). */
|
|
2313
|
+
formats?: readonly string[]
|
|
2314
|
+
minSec?: number
|
|
2315
|
+
maxSec?: number
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
/**
|
|
2319
|
+
* Reference-audio rules that apply on EVERY lane — the video routes' preHandler
|
|
2320
|
+
* and the DAG's `executeWorkerNode` both run `checkRefAudioRules` before any
|
|
2321
|
+
* reservation, so a clip the provider would refuse never costs a run.
|
|
2322
|
+
*
|
|
2323
|
+
* Data-driven like VIDEO_REF_VIDEO_DURATION_LIMITS: only providers with a
|
|
2324
|
+
* DOCUMENTED rule are listed. (The older max-only
|
|
2325
|
+
* SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER above is checked by the routes
|
|
2326
|
+
* alone.)
|
|
2327
|
+
*
|
|
2328
|
+
* Vidu Q4: "MP3 only, each 3-12 seconds and up to 50 MB"
|
|
2329
|
+
* (docs.kie.ai/market/vidu-q4/reference-to-video). Nothing converts a clip for
|
|
2330
|
+
* it, so a WAV / M4A from the audio tray is refused with a clear message rather
|
|
2331
|
+
* than failing at the provider.
|
|
2332
|
+
*/
|
|
2333
|
+
export const VIDEO_REF_AUDIO_RULES: Record<string, RefAudioRule | undefined> = {
|
|
2334
|
+
"vidu-q4": { formats: ["mp3"], minSec: 3, maxSec: 12 },
|
|
2335
|
+
}
|
|
2336
|
+
|
|
2337
|
+
/** One probed reference-audio clip. A field the probe could not read is absent. */
|
|
2338
|
+
export interface RefAudioProbe {
|
|
2339
|
+
/** ffprobe `format_name`, split on commas ("mp3", "wav", "mov,mp4,m4a,…"). */
|
|
2340
|
+
formatNames?: readonly string[]
|
|
2341
|
+
durationSec?: number
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
export type RefAudioCheck =
|
|
2345
|
+
| { ok: true }
|
|
2346
|
+
| { ok: false; code: "audio_format_unsupported" | "audio_too_short" | "audio_too_long"; message: string }
|
|
2347
|
+
|
|
2348
|
+
/**
|
|
2349
|
+
* Check probed reference-audio clips against {@link VIDEO_REF_AUDIO_RULES}.
|
|
2350
|
+
* An unreadable field is IGNORED, never rejected — a probe blip must not block
|
|
2351
|
+
* a legal run (the provider still has the final say).
|
|
2352
|
+
*/
|
|
2353
|
+
export function checkRefAudioRules(provider: string | undefined, probes: readonly RefAudioProbe[]): RefAudioCheck {
|
|
2354
|
+
const rule = provider ? VIDEO_REF_AUDIO_RULES[provider] : undefined
|
|
2355
|
+
if (!rule) return { ok: true }
|
|
2356
|
+
for (const [i, p] of probes.entries()) {
|
|
2357
|
+
const n = i + 1
|
|
2358
|
+
if (rule.formats && p.formatNames && p.formatNames.length > 0 && !p.formatNames.some((f) => rule.formats!.includes(f))) {
|
|
2359
|
+
const want = rule.formats.map((f) => f.toUpperCase()).join(" or ")
|
|
2360
|
+
return { ok: false, code: "audio_format_unsupported", message: `Reference audio ${n} must be ${want} for this model. Convert the clip to ${want} and try again.` }
|
|
2361
|
+
}
|
|
2362
|
+
const d = p.durationSec
|
|
2363
|
+
if (d === undefined || !Number.isFinite(d) || d <= 0) continue
|
|
2364
|
+
if (rule.minSec !== undefined && d < rule.minSec) {
|
|
2365
|
+
return { ok: false, code: "audio_too_short", message: `Reference audio ${n} is too short for this model: ${d.toFixed(1)}s is under the ${rule.minSec}s minimum.` }
|
|
2366
|
+
}
|
|
2367
|
+
if (rule.maxSec !== undefined && d > rule.maxSec) {
|
|
2368
|
+
return { ok: false, code: "audio_too_long", message: `Reference audio ${n} is too long for this model: ${d.toFixed(1)}s exceeds the ${rule.maxSec}s limit. Please use a shorter audio clip.` }
|
|
2369
|
+
}
|
|
2370
|
+
}
|
|
2371
|
+
return { ok: true }
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2151
2374
|
/**
|
|
2152
2375
|
* Per-provider connection caps for the typed reference handles on Generate Video
|
|
2153
2376
|
* AND the cap for the server-side `connectedReferences` assembly (`imageCap`).
|
|
@@ -2182,6 +2405,10 @@ export const VIDEO_REF_LIMITS_BY_PROVIDER: Record<
|
|
|
2182
2405
|
// provider (docs.kie.ai/market/wan/3-0-video).
|
|
2183
2406
|
"wan-3": { images: 10, videos: 5, audio: 5 },
|
|
2184
2407
|
"wan-3-prime": { images: 10, videos: 5, audio: 5 },
|
|
2408
|
+
// Vidu Q4 — reference-to-video takes 1-15 reference images and up to 3
|
|
2409
|
+
// reference audio clips (MP3 only, each 3-12s — VIDEO_REF_AUDIO_RULES), and
|
|
2410
|
+
// no reference videos (docs.kie.ai/market/vidu-q4/reference-to-video).
|
|
2411
|
+
"vidu-q4": { images: 15, audio: 3 },
|
|
2185
2412
|
// Multi-image reference providers.
|
|
2186
2413
|
// `characters` = the dedicated identity input (KIE `character_ids`, max 3).
|
|
2187
2414
|
// It is NOT an image-reference lane: it draws from the SAME 7-unit budget as
|
|
@@ -2336,6 +2563,11 @@ export const RESOLUTION_DURATION_PRICING: Record<string, readonly string[]> = {
|
|
|
2336
2563
|
// the provider layer pins the same 720P so render == billed.
|
|
2337
2564
|
"wan-3": ["480p", "720p", "1080p"],
|
|
2338
2565
|
"wan-3-prime": ["480p", "720p", "1080p"],
|
|
2566
|
+
// Vidu Q4 — per-second billing at five resolution rates, one ladder for both
|
|
2567
|
+
// endpoints. Ascending; the billed default (720p) is declared in
|
|
2568
|
+
// PRICING_DEFAULT_RESOLUTION, and normalizeViduQ4Resolution pins the same
|
|
2569
|
+
// 720p at the wire.
|
|
2570
|
+
"vidu-q4": ["540p", "720p", "1080p", "2k", "4k"],
|
|
2339
2571
|
}
|
|
2340
2572
|
|
|
2341
2573
|
/**
|
|
@@ -2558,6 +2790,12 @@ export const VIDEO_AUDIO_CAPABILITY: Record<string, VideoAudioCapability> = {
|
|
|
2558
2790
|
// per-second rate, so NOT cost-affecting (no `:audio` composite).
|
|
2559
2791
|
"wan-3": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2560
2792
|
"wan-3-prime": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2793
|
+
// Vidu Q4 — the same boolean `audio` lever (KIE default true). The schema
|
|
2794
|
+
// says "dialogue and sound effects", but classified "ambient" on the Wan 3.0
|
|
2795
|
+
// rule: no live probe has verified lip-synced speech, and `native_speech` /
|
|
2796
|
+
// `audio_driven` would reroute the Story→Video dialogue pipeline. Audio is
|
|
2797
|
+
// priced into the uniform per-second rate (no `:audio` composite).
|
|
2798
|
+
"vidu-q4": { mode: "ambient", field: "audio", defaultOn: true },
|
|
2561
2799
|
// Gemini Omni (both SKUs — the pro `gemini-omni-video` and the faster
|
|
2562
2800
|
// `gemini-omni-flash`; one model at two speeds, so their rows are identical
|
|
2563
2801
|
// and a test pins that). Settled 2026-09-03 from Google's own documentation
|
|
@@ -2723,6 +2961,9 @@ export const VIDEO_VARIABLE_PRICING: Record<string, "duration" | "duration+audio
|
|
|
2723
2961
|
// entry, mirroring gemini-omni-video which has none either.
|
|
2724
2962
|
"wan-3": "duration+resolution",
|
|
2725
2963
|
"wan-3-prime": "duration+resolution",
|
|
2964
|
+
// Vidu Q4 — per-second billing at five resolution rates; no reference or
|
|
2965
|
+
// audio dimension.
|
|
2966
|
+
"vidu-q4": "duration+resolution",
|
|
2726
2967
|
}
|
|
2727
2968
|
|
|
2728
2969
|
/**
|
|
@@ -2835,6 +3076,9 @@ export const PRICING_DEFAULT_RESOLUTION: Record<string, string> = {
|
|
|
2835
3076
|
// first tier, so the catalog can stay ascending without repricing anything.
|
|
2836
3077
|
"wan-3": "720p",
|
|
2837
3078
|
"wan-3-prime": "720p",
|
|
3079
|
+
// Vidu Q4 — KIE renders 720p when `resolution` is omitted, and
|
|
3080
|
+
// normalizeViduQ4Resolution pins the same tier for anything unknown.
|
|
3081
|
+
"vidu-q4": "720p",
|
|
2838
3082
|
}
|
|
2839
3083
|
|
|
2840
3084
|
/** HappyHorse 1.1 per-second tiers — one per allowed duration (3–15s), shared
|
|
@@ -2874,6 +3118,16 @@ const WAN_3_DURATION_TIERS: Array<{ maxSeconds: number; suffix: string }> = Arra
|
|
|
2874
3118
|
(_, i) => ({ maxSeconds: i + 2, suffix: `${i + 2}s` }),
|
|
2875
3119
|
)
|
|
2876
3120
|
|
|
3121
|
+
/**
|
|
3122
|
+
* Vidu Q4 per-second tiers — one per allowed duration (3-16s). Per-second for
|
|
3123
|
+
* the same reason as Wan 3.0: a coarse ladder would snap a long render down to
|
|
3124
|
+
* a shorter tier's price, which `commit_credits` can never collect afterwards.
|
|
3125
|
+
*/
|
|
3126
|
+
const VIDU_Q4_DURATION_TIERS: Array<{ maxSeconds: number; suffix: string }> = Array.from(
|
|
3127
|
+
{ length: 14 },
|
|
3128
|
+
(_, i) => ({ maxSeconds: i + 3, suffix: `${i + 3}s` }),
|
|
3129
|
+
)
|
|
3130
|
+
|
|
2877
3131
|
/**
|
|
2878
3132
|
* Duration tier breakpoints for variable-priced video models.
|
|
2879
3133
|
* Maps provider → array of { maxSeconds, suffix } in ascending order.
|
|
@@ -2956,6 +3210,7 @@ export const VIDEO_DURATION_TIERS: Record<string, Array<{ maxSeconds: number; su
|
|
|
2956
3210
|
"seedance-2-5": SEEDANCE_2_5_DURATION_TIERS,
|
|
2957
3211
|
"wan-3": WAN_3_DURATION_TIERS,
|
|
2958
3212
|
"wan-3-prime": WAN_3_DURATION_TIERS,
|
|
3213
|
+
"vidu-q4": VIDU_Q4_DURATION_TIERS,
|
|
2959
3214
|
// MiniMax Hailuo 3 — true per-second billing (KIE 36.5 cr/s @2K, 22.5 cr/s
|
|
2960
3215
|
// @768P). One tier per allowed second (4-15s) so the composite identifier
|
|
2961
3216
|
// maps 1:1 to the seeded price — no rounding/overcharge for any on-menu
|
|
@@ -199,6 +199,9 @@ const QUALITY_MAP: Record<string, QualityMapping> = {
|
|
|
199
199
|
// uppercase KIE wire form is produced only by normalizeWan3Resolution).
|
|
200
200
|
"wan-3": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
201
201
|
"wan-3-prime": { field: "resolution", values: { low: "480p", mid: "720p", high: "1080p" } },
|
|
202
|
+
// Vidu Q4 — five tiers; the quality rungs stop at 1080p so "high" never
|
|
203
|
+
// lands on the 2k/4k ladder (4k is closed to the free tier).
|
|
204
|
+
"vidu-q4": { field: "resolution", values: { low: "540p", mid: "720p", high: "1080p" } },
|
|
202
205
|
"wan-2.7-i2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
203
206
|
"wan-2.7-t2v": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
204
207
|
"happyhorse": { field: "resolution", values: { low: "720p", mid: "1080p", high: "1080p" } },
|
|
@@ -134,6 +134,12 @@ export function presetLeverClearKeys(
|
|
|
134
134
|
* - `__promptFinalView`: field keys currently showing the final-prompt view (Edit ⇄ Final
|
|
135
135
|
* per-field toggle). Node-local UI state, never part of a preset's own config.
|
|
136
136
|
*
|
|
137
|
+
* Editor-only memory:
|
|
138
|
+
* - `settingsBeforeAudio`: the picture settings an audio recording turned off on a use-case node
|
|
139
|
+
* (Tighten Episode, Clip Pack), kept to give back when a video is wired again. It belongs to
|
|
140
|
+
* THIS node's wiring, never a reusable configuration — a preset applied elsewhere would hand
|
|
141
|
+
* another node values to restore on its next video wire.
|
|
142
|
+
*
|
|
137
143
|
* NOTE: manual reference image urls (`referenceImageUrl` / `referenceImageUrls`) are deliberately
|
|
138
144
|
* KEPT — they are self-contained R2 urls a user set as input, and portable across nodes.
|
|
139
145
|
*
|
|
@@ -157,6 +163,8 @@ export const PRESET_EXCLUDED_KEYS: ReadonlySet<string> = new Set([
|
|
|
157
163
|
"suppressedCanonicalLocationIds",
|
|
158
164
|
"identityMeta",
|
|
159
165
|
"extraRefs",
|
|
166
|
+
// editor-only memory of the node's own wiring (an audio recording's lock)
|
|
167
|
+
"settingsBeforeAudio",
|
|
160
168
|
// structural identifiers
|
|
161
169
|
"routes",
|
|
162
170
|
"routeId",
|
package/src/pipeline-types.ts
CHANGED
|
@@ -96,6 +96,9 @@ export type PipelinePinnableVideoModel = (typeof PIPELINE_PINNABLE_VIDEO_MODELS)
|
|
|
96
96
|
// through `lib/llm-client.ts` first; until then, keep this list tight.
|
|
97
97
|
export const PIPELINE_PINNABLE_SCRIPT_LLMS = [
|
|
98
98
|
"claude-haiku-5-5",
|
|
99
|
+
// The pipeline's own default (Auto) since 2026-10-16; callLLM asks it with
|
|
100
|
+
// tool_choice auto, as it refuses a forced tool choice.
|
|
101
|
+
"claude-sonnet-5-5",
|
|
99
102
|
"claude-sonnet-4-6",
|
|
100
103
|
"claude-opus-4-7",
|
|
101
104
|
"claude-opus-5",
|
|
@@ -9,6 +9,7 @@ import { AUDIO_PRODUCER_TYPES, VIDEO_PRODUCER_TYPES } from "./producer-types.js"
|
|
|
9
9
|
import { canonicalizeOverrideKeys } from "./exposed-field-keys.js"
|
|
10
10
|
import { RENDER_NODE_TYPE_IDS } from "./render-nodes.js"
|
|
11
11
|
import { dropStaleVideoLinkFields } from "./video-link.js"
|
|
12
|
+
import { composeUnitSet, unitsPresenting } from "./unit-contract-compose.js"
|
|
12
13
|
|
|
13
14
|
// ---------------------------------------------------------------------------
|
|
14
15
|
// Node type sets
|
|
@@ -130,18 +131,20 @@ const MEDIA_PRODUCING_TYPES = new Set([
|
|
|
130
131
|
"video-depth",
|
|
131
132
|
])
|
|
132
133
|
|
|
133
|
-
// Output type categorizations
|
|
134
|
-
|
|
134
|
+
// Output type categorizations — each the hand-written list ∪ the node units
|
|
135
|
+
// that declare the same presentation (contract.presents, generated rows); a
|
|
136
|
+
// type in both throws at load (composeUnitSet).
|
|
137
|
+
const IMAGE_OUTPUT_TYPES = composeUnitSet("IMAGE_OUTPUT_TYPES", [
|
|
135
138
|
"generate-image", "edit-image", "image-to-image",
|
|
136
139
|
"upload-image",
|
|
137
|
-
])
|
|
140
|
+
], unitsPresenting("image"))
|
|
138
141
|
|
|
139
142
|
/**
|
|
140
143
|
* Video-output types NOT already declared by `VIDEO_PRODUCER_TYPES` — the two
|
|
141
144
|
* are unioned in `getOutputType`, which is where the reading order (and the
|
|
142
145
|
* reason the literal sets win) is documented.
|
|
143
146
|
*/
|
|
144
|
-
const VIDEO_OUTPUT_TYPES =
|
|
147
|
+
const VIDEO_OUTPUT_TYPES = composeUnitSet("VIDEO_OUTPUT_TYPES", [
|
|
145
148
|
"image-to-video", "text-to-video", "video-to-video", "extend-video",
|
|
146
149
|
"render-video", "video-composer", "after-effects", "lottie-overlay",
|
|
147
150
|
"3d-title", "motion-graphics", "composite",
|
|
@@ -158,27 +161,24 @@ const VIDEO_OUTPUT_TYPES = new Set([
|
|
|
158
161
|
// audio-only cut still plays in a video element). Asserted in
|
|
159
162
|
// producer-types.test.ts.
|
|
160
163
|
...RENDER_NODE_TYPE_IDS,
|
|
161
|
-
|
|
162
|
-
// (it is not a render, so RENDER_NODE_TYPE_IDS does not bring it).
|
|
163
|
-
"tighten-episode",
|
|
164
|
-
])
|
|
164
|
+
], unitsPresenting("video"))
|
|
165
165
|
|
|
166
|
-
const AUDIO_OUTPUT_TYPES =
|
|
166
|
+
const AUDIO_OUTPUT_TYPES = composeUnitSet("AUDIO_OUTPUT_TYPES", [
|
|
167
167
|
"text-to-speech", "generate-music", "text-to-audio",
|
|
168
168
|
"text-to-dialogue", "voice-changer", "dubbing", "voice-remix",
|
|
169
169
|
"voice-design", "mix-audio", "adjust-volume", "audio-fx", "pitch-tempo", "trim-audio",
|
|
170
170
|
"audio-isolation",
|
|
171
171
|
"audio-separation",
|
|
172
172
|
"upload-audio",
|
|
173
|
-
])
|
|
173
|
+
], unitsPresenting("audio"))
|
|
174
174
|
|
|
175
|
-
const TEXT_OUTPUT_TYPES =
|
|
175
|
+
const TEXT_OUTPUT_TYPES = composeUnitSet("TEXT_OUTPUT_TYPES", [
|
|
176
176
|
"generate-script", "ai-writer", "llm-chat", "transcribe", "image-to-text", "qa-check",
|
|
177
177
|
"text-prompt",
|
|
178
178
|
// UGC Cards' output card is its Notes: a run hands it on as the node's text
|
|
179
179
|
// (`output.text`, `generatedText` on the canvas).
|
|
180
180
|
"ugc-cards",
|
|
181
|
-
])
|
|
181
|
+
], unitsPresenting("text"))
|
|
182
182
|
|
|
183
183
|
// ---------------------------------------------------------------------------
|
|
184
184
|
// Output type enum
|
package/src/preview-gate.ts
CHANGED
|
@@ -26,6 +26,7 @@ import { buildFeedMaps } from "./trigger-feeds.js"
|
|
|
26
26
|
import { defaultEdgeOutputMode } from "./producer-types.js"
|
|
27
27
|
import { mergeNodeInputOverrides } from "./presentation-utils.js"
|
|
28
28
|
import { RENDER_NODE_TYPE_IDS } from "./render-nodes.js"
|
|
29
|
+
import { unitReviewHolds } from "./unit-contract-compose.js"
|
|
29
30
|
|
|
30
31
|
/** Render nodes a run can stop at: every render in the registry (SV18). */
|
|
31
32
|
export const PREVIEW_RENDER_NODE_TYPES: ReadonlySet<string> = new Set(RENDER_NODE_TYPE_IDS)
|
|
@@ -34,9 +35,10 @@ export const PREVIEW_RENDER_NODE_TYPES: ReadonlySet<string> = new Set(RENDER_NOD
|
|
|
34
35
|
* Use-case nodes whose review-on run ends at a Preview of their own: what
|
|
35
36
|
* follows them waits for their Render final, exactly as after a render at
|
|
36
37
|
* Preview. They are not render nodes (`PREVIEW_RENDER_NODE_TYPES` stays the
|
|
37
|
-
* renders), so they join the hold here
|
|
38
|
+
* renders), so they join the hold here: the node units that declare
|
|
39
|
+
* `contract.reviewHold` (generated/unit-contracts.ts).
|
|
38
40
|
*/
|
|
39
|
-
export const REVIEW_HOLDING_USE_CASE_TYPES: ReadonlySet<string> = new Set(
|
|
41
|
+
export const REVIEW_HOLDING_USE_CASE_TYPES: ReadonlySet<string> = new Set(unitReviewHolds())
|
|
40
42
|
|
|
41
43
|
/** A node whose take can be a Preview that holds what follows it. */
|
|
42
44
|
export function isPreviewHoldingType(type: string | null | undefined): boolean {
|
package/src/producer-types.ts
CHANGED
|
@@ -15,12 +15,17 @@
|
|
|
15
15
|
* execution time (the prior drift bug, see issue 1 of the Task 4.1 review).
|
|
16
16
|
*/
|
|
17
17
|
import { UGC_PRIMARY_HANDLE } from "./ugc-node-wires.js"
|
|
18
|
+
import { composeUnitRecord, composeUnitSet, unitFanOutEach, unitProducers } from "./unit-contract-compose.js"
|
|
19
|
+
|
|
20
|
+
// Each producer set below is its hand-written members ∪ the node units
|
|
21
|
+
// (tools/units/README.md) of that producer kind, from their generated contract
|
|
22
|
+
// rows, in that order — a type in both throws at load (composeUnitSet).
|
|
18
23
|
|
|
19
24
|
/**
|
|
20
25
|
* Source node types whose primary output is a video URL.
|
|
21
26
|
* Mirrors the backend execution-graph VIDEO_SOURCE_TYPES verbatim.
|
|
22
27
|
*/
|
|
23
|
-
export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> =
|
|
28
|
+
export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("VIDEO_PRODUCER_TYPES", [
|
|
24
29
|
"image-to-video",
|
|
25
30
|
"video-to-video",
|
|
26
31
|
"switchx", // Beeble SwitchX relight/composite
|
|
@@ -79,8 +84,6 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
79
84
|
"mask-composite",
|
|
80
85
|
"transcode-video",
|
|
81
86
|
"manual-edit",
|
|
82
|
-
// Remove Audio: strips the audio track, emits a silent video.
|
|
83
|
-
"remove-audio",
|
|
84
87
|
// AI Avatar (HeyGen): avatar + voice/audio → video.
|
|
85
88
|
"ai-avatar",
|
|
86
89
|
// Cinematic Avatar (HeyGen cinematic_avatar): prompt + 1–3 avatar looks → video.
|
|
@@ -93,10 +96,6 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
93
96
|
// Slideshow: 2-100 stills + one optional audio track → MP4 (local FFmpeg,
|
|
94
97
|
// no provider). Same contract; images arrive via the image-collage lane.
|
|
95
98
|
"slideshow",
|
|
96
|
-
// GIF to Video: animated GIF → H.264 MP4 (local FFmpeg, no provider).
|
|
97
|
-
// Emits generatedVideoUrl so it connects to any downstream video consumer
|
|
98
|
-
// (e.g. a Seedance video-reference input) by an ordinary edge.
|
|
99
|
-
"gif-to-video",
|
|
100
99
|
// 3D Render Pro: authors a scene AND exports it in one operation, settling
|
|
101
100
|
// with the standard `videoUrl` field. It is a video producer as much as it
|
|
102
101
|
// is a composition producer — omitting it here is the "cannot connect the
|
|
@@ -111,7 +110,7 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
111
110
|
// UGC Finish: the video's clips, finished, as one ordered list — a registered producer, so a
|
|
112
111
|
// Bundle edge into Combine Videos routes each one as a video, in order.
|
|
113
112
|
"ugc-finish-clips",
|
|
114
|
-
])
|
|
113
|
+
], unitProducers("video"))
|
|
115
114
|
|
|
116
115
|
/**
|
|
117
116
|
* Source node types whose output media-type cannot be classified
|
|
@@ -139,7 +138,7 @@ export const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
139
138
|
* that fail at execution. Users wanting trigger → media flows
|
|
140
139
|
* should wire through an upload node.
|
|
141
140
|
*/
|
|
142
|
-
export const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> =
|
|
141
|
+
export const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("DYNAMIC_PRODUCER_TYPES", [
|
|
143
142
|
"list",
|
|
144
143
|
"sub-workflow",
|
|
145
144
|
"adjust-volume",
|
|
@@ -184,16 +183,13 @@ export const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
184
183
|
// voice-changer/dubbing precedent. Asserted in producer-types.test.ts (the
|
|
185
184
|
// suite does not fail on omission).
|
|
186
185
|
"apply-edl",
|
|
187
|
-
|
|
188
|
-
// its `output` setting (an audio recording forces audio) — runtime-decided.
|
|
189
|
-
"tighten-episode",
|
|
190
|
-
])
|
|
186
|
+
], unitProducers("dynamic"))
|
|
191
187
|
|
|
192
188
|
/**
|
|
193
189
|
* Source node types whose primary output is an audio URL.
|
|
194
190
|
* Mirrors the backend execution-graph AUDIO_SOURCE_TYPES verbatim.
|
|
195
191
|
*/
|
|
196
|
-
export const AUDIO_PRODUCER_TYPES: ReadonlySet<string> =
|
|
192
|
+
export const AUDIO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("AUDIO_PRODUCER_TYPES", [
|
|
197
193
|
"text-to-speech",
|
|
198
194
|
"text-to-audio",
|
|
199
195
|
"generate-music",
|
|
@@ -227,7 +223,7 @@ export const AUDIO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
227
223
|
"voice-design",
|
|
228
224
|
// Extract Audio: demuxes a video's audio track to a standalone MP3.
|
|
229
225
|
"extract-audio",
|
|
230
|
-
])
|
|
226
|
+
], unitProducers("audio"))
|
|
231
227
|
|
|
232
228
|
/**
|
|
233
229
|
* Source node types whose output is an IMAGE URL — what feeds a References
|
|
@@ -236,7 +232,7 @@ export const AUDIO_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
236
232
|
* handle migration and the MCP edge normalizer (`llm-chat`'s legacy `in`):
|
|
237
233
|
* they used to keep separate copies, and the backend's lagged by eight types.
|
|
238
234
|
*/
|
|
239
|
-
export const IMAGE_PRODUCER_TYPES: ReadonlySet<string> =
|
|
235
|
+
export const IMAGE_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet("IMAGE_PRODUCER_TYPES", [
|
|
240
236
|
"upload-image", "generate-image", "edit-image", "image-to-image", "modify-image", "upscale-image", "remove-background",
|
|
241
237
|
// extract-frame produces a single still image extracted from a video source.
|
|
242
238
|
"extract-frame",
|
|
@@ -265,7 +261,7 @@ export const IMAGE_PRODUCER_TYPES: ReadonlySet<string> = new Set([
|
|
|
265
261
|
// in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY
|
|
266
262
|
// asset, and 3D Render Pro's is the MP4.
|
|
267
263
|
"pro-3d-render",
|
|
268
|
-
])
|
|
264
|
+
], unitProducers("image"))
|
|
269
265
|
|
|
270
266
|
/**
|
|
271
267
|
* Source node types whose primary output is a LIST that, by default, fans out
|
|
@@ -315,8 +311,11 @@ export const FAN_OUT_EACH_TYPES: ReadonlySet<string> = new Set([
|
|
|
315
311
|
* (`listResults`) — it exists only when the node itself ran once per item, so
|
|
316
312
|
* after a single run the edge degrades to the single value, exactly like a
|
|
317
313
|
* `FAN_OUT_EACH_TYPES` member with one item.
|
|
314
|
+
*
|
|
315
|
+
* Its hand-written rows ∪ the node units' rows (`contract.fanOutEach`,
|
|
316
|
+
* generated/unit-contracts.ts); a type in both refuses to load.
|
|
318
317
|
*/
|
|
319
|
-
export const FAN_OUT_EACH_HANDLES: Readonly<Record<string, { readonly each: readonly string[]; readonly primary: string }>> = {
|
|
318
|
+
export const FAN_OUT_EACH_HANDLES: Readonly<Record<string, { readonly each: readonly string[]; readonly primary: string }>> = composeUnitRecord("FAN_OUT_EACH_HANDLES", {
|
|
320
319
|
// Camera Switch run once per clip (Edit Plan in clips mode): each clip's
|
|
321
320
|
// switched EDL is its own Apply EDL render. Its transcript is the same for
|
|
322
321
|
// every clip (the master clock, renamed), so that handle stays one value
|
|
@@ -328,7 +327,8 @@ export const FAN_OUT_EACH_HANDLES: Readonly<Record<string, { readonly each: read
|
|
|
328
327
|
// its list (`listResults`, the editor's `__listResults`). The pip an edge
|
|
329
328
|
// with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
330
329
|
"ugc-clips": { each: ["clips"], primary: UGC_PRIMARY_HANDLE["ugc-clips"]! },
|
|
331
|
-
|
|
330
|
+
// A node unit declares its row in unit.json (contract.fanOutEach); it is added after these.
|
|
331
|
+
}, unitFanOutEach())
|
|
332
332
|
|
|
333
333
|
/**
|
|
334
334
|
* Fan-out nodes whose iterations must ALL succeed: one failed item fails the
|