@nodaro/shared 3.68.0 → 3.69.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.
Files changed (157) hide show
  1. package/dist/{chunk-T4GIHHXY.cjs → chunk-25C2E2GI.cjs} +6 -6
  2. package/dist/{chunk-T4GIHHXY.cjs.map → chunk-25C2E2GI.cjs.map} +1 -1
  3. package/dist/{chunk-OXTF4Y3P.cjs → chunk-3AB3YIFM.cjs} +6 -6
  4. package/dist/{chunk-OXTF4Y3P.cjs.map → chunk-3AB3YIFM.cjs.map} +1 -1
  5. package/dist/{chunk-BCY3A62O.cjs → chunk-3OHRFSQL.cjs} +51 -49
  6. package/dist/{chunk-BCY3A62O.cjs.map → chunk-3OHRFSQL.cjs.map} +1 -1
  7. package/dist/{chunk-GNLA5NTT.cjs → chunk-4IMEJQVQ.cjs} +4 -4
  8. package/dist/{chunk-GNLA5NTT.cjs.map → chunk-4IMEJQVQ.cjs.map} +1 -1
  9. package/dist/{chunk-4XR66IWF.cjs → chunk-54E2JO4E.cjs} +51 -22
  10. package/dist/chunk-54E2JO4E.cjs.map +1 -0
  11. package/dist/{chunk-HTDKEYMY.cjs → chunk-5EQRIUGI.cjs} +139 -91
  12. package/dist/chunk-5EQRIUGI.cjs.map +1 -0
  13. package/dist/{chunk-AT53ZQUC.js → chunk-5WHU7CYE.js} +3 -3
  14. package/dist/{chunk-AT53ZQUC.js.map → chunk-5WHU7CYE.js.map} +1 -1
  15. package/dist/{chunk-BNR5FKL5.js → chunk-5ZCZL73I.js} +3 -3
  16. package/dist/{chunk-BNR5FKL5.js.map → chunk-5ZCZL73I.js.map} +1 -1
  17. package/dist/{chunk-WZG6GZIL.cjs → chunk-6QJHSN6J.cjs} +4 -4
  18. package/dist/{chunk-WZG6GZIL.cjs.map → chunk-6QJHSN6J.cjs.map} +1 -1
  19. package/dist/{chunk-OFQ6CU6S.js → chunk-7EQJIGVT.js} +3 -3
  20. package/dist/{chunk-OFQ6CU6S.js.map → chunk-7EQJIGVT.js.map} +1 -1
  21. package/dist/{chunk-XEPKONJC.js → chunk-7OSUEYZ4.js} +3 -3
  22. package/dist/{chunk-XEPKONJC.js.map → chunk-7OSUEYZ4.js.map} +1 -1
  23. package/dist/{chunk-3L7GMQ4M.cjs → chunk-7PC2YHBN.cjs} +54 -49
  24. package/dist/chunk-7PC2YHBN.cjs.map +1 -0
  25. package/dist/{chunk-BMDOPJBP.cjs → chunk-AGIG5HUU.cjs} +17 -17
  26. package/dist/{chunk-BMDOPJBP.cjs.map → chunk-AGIG5HUU.cjs.map} +1 -1
  27. package/dist/{chunk-5LWYX4GV.js → chunk-AH6OQXLW.js} +3 -3
  28. package/dist/{chunk-5LWYX4GV.js.map → chunk-AH6OQXLW.js.map} +1 -1
  29. package/dist/{chunk-BHL7TAQO.js → chunk-BDW25A7Y.js} +32 -9
  30. package/dist/chunk-BDW25A7Y.js.map +1 -0
  31. package/dist/{chunk-5J2LIQYU.js → chunk-DE55SA2X.js} +5 -5
  32. package/dist/{chunk-5J2LIQYU.js.map → chunk-DE55SA2X.js.map} +1 -1
  33. package/dist/{chunk-VBP4DH37.js → chunk-DNWFFVC6.js} +130 -15
  34. package/dist/chunk-DNWFFVC6.js.map +1 -0
  35. package/dist/{chunk-MVXZP6VB.js → chunk-FUYBUT65.js} +97 -2
  36. package/dist/chunk-FUYBUT65.js.map +1 -0
  37. package/dist/{chunk-SW5ZD7BO.js → chunk-G6AOKNAY.js} +3 -3
  38. package/dist/{chunk-SW5ZD7BO.js.map → chunk-G6AOKNAY.js.map} +1 -1
  39. package/dist/{chunk-EFYWV2V5.cjs → chunk-I6TBKTW3.cjs} +61 -61
  40. package/dist/{chunk-EFYWV2V5.cjs.map → chunk-I6TBKTW3.cjs.map} +1 -1
  41. package/dist/{chunk-3YWZ5SOZ.js → chunk-KLEKJUQI.js} +5 -5
  42. package/dist/{chunk-3YWZ5SOZ.js.map → chunk-KLEKJUQI.js.map} +1 -1
  43. package/dist/{chunk-OXBU5AGH.js → chunk-LSX2OFNB.js} +3 -3
  44. package/dist/{chunk-OXBU5AGH.js.map → chunk-LSX2OFNB.js.map} +1 -1
  45. package/dist/{chunk-66QSUUB4.cjs → chunk-LY6IR5LL.cjs} +12 -12
  46. package/dist/{chunk-66QSUUB4.cjs.map → chunk-LY6IR5LL.cjs.map} +1 -1
  47. package/dist/{chunk-5GG4CG4Y.js → chunk-LZPG4XHT.js} +3 -3
  48. package/dist/{chunk-5GG4CG4Y.js.map → chunk-LZPG4XHT.js.map} +1 -1
  49. package/dist/{chunk-PGDR7CO3.cjs → chunk-MGSGLRHZ.cjs} +8 -8
  50. package/dist/{chunk-PGDR7CO3.cjs.map → chunk-MGSGLRHZ.cjs.map} +1 -1
  51. package/dist/{chunk-Z77M7Q2R.js → chunk-ML55U7WM.js} +3 -3
  52. package/dist/{chunk-Z77M7Q2R.js.map → chunk-ML55U7WM.js.map} +1 -1
  53. package/dist/{chunk-IWUW3YPM.cjs → chunk-NTCSXKZ3.cjs} +5 -5
  54. package/dist/{chunk-IWUW3YPM.cjs.map → chunk-NTCSXKZ3.cjs.map} +1 -1
  55. package/dist/{chunk-SCDE676D.js → chunk-OEOOXL3F.js} +65 -23
  56. package/dist/chunk-OEOOXL3F.js.map +1 -0
  57. package/dist/{chunk-GF7ZA26H.js → chunk-OOUJZR4K.js} +4 -4
  58. package/dist/{chunk-GF7ZA26H.js.map → chunk-OOUJZR4K.js.map} +1 -1
  59. package/dist/{chunk-5IZHECUP.js → chunk-OZA4DE23.js} +3 -3
  60. package/dist/{chunk-5IZHECUP.js.map → chunk-OZA4DE23.js.map} +1 -1
  61. package/dist/{chunk-XNJDAW3M.js → chunk-PHQVAPSD.js} +7 -5
  62. package/dist/{chunk-XNJDAW3M.js.map → chunk-PHQVAPSD.js.map} +1 -1
  63. package/dist/{chunk-5NVGKXJV.cjs → chunk-PLANUXQL.cjs} +89 -3
  64. package/dist/chunk-PLANUXQL.cjs.map +1 -0
  65. package/dist/{chunk-PJAJCFLP.cjs → chunk-QNPYYSLT.cjs} +168 -44
  66. package/dist/chunk-QNPYYSLT.cjs.map +1 -0
  67. package/dist/{chunk-G2G7XGFU.cjs → chunk-RURPG6IS.cjs} +7 -7
  68. package/dist/{chunk-G2G7XGFU.cjs.map → chunk-RURPG6IS.cjs.map} +1 -1
  69. package/dist/{chunk-PAUWEWTY.js → chunk-TDU45K6Z.js} +12 -7
  70. package/dist/chunk-TDU45K6Z.js.map +1 -0
  71. package/dist/{chunk-X2YHKP4D.cjs → chunk-TWUFC32F.cjs} +8 -8
  72. package/dist/{chunk-X2YHKP4D.cjs.map → chunk-TWUFC32F.cjs.map} +1 -1
  73. package/dist/{chunk-F6XIH3TZ.cjs → chunk-UJREE6EQ.cjs} +9 -9
  74. package/dist/{chunk-F6XIH3TZ.cjs.map → chunk-UJREE6EQ.cjs.map} +1 -1
  75. package/dist/{chunk-37ZSFS6A.cjs → chunk-WML66SUV.cjs} +9 -9
  76. package/dist/{chunk-37ZSFS6A.cjs.map → chunk-WML66SUV.cjs.map} +1 -1
  77. package/dist/{chunk-M5QY464F.cjs → chunk-XZYZYWKG.cjs} +21 -21
  78. package/dist/{chunk-M5QY464F.cjs.map → chunk-XZYZYWKG.cjs.map} +1 -1
  79. package/dist/{chunk-3QJ3UR5Z.js → chunk-YT4ZTJVC.js} +9 -9
  80. package/dist/{chunk-3QJ3UR5Z.js.map → chunk-YT4ZTJVC.js.map} +1 -1
  81. package/dist/{chunk-V6OXSXIX.js → chunk-YVQFYW2U.js} +86 -4
  82. package/dist/chunk-YVQFYW2U.js.map +1 -0
  83. package/dist/{chunk-E62W5I6A.cjs → chunk-ZWEVRMFN.cjs} +97 -2
  84. package/dist/chunk-ZWEVRMFN.cjs.map +1 -0
  85. package/dist/entries/apps.cjs +42 -42
  86. package/dist/entries/apps.js +7 -7
  87. package/dist/entries/credits.cjs +273 -225
  88. package/dist/entries/credits.d.cts +152 -66
  89. package/dist/entries/credits.d.ts +152 -66
  90. package/dist/entries/credits.js +10 -10
  91. package/dist/entries/llm-models.cjs +84 -68
  92. package/dist/entries/llm-models.d.cts +36 -3
  93. package/dist/entries/llm-models.d.ts +36 -3
  94. package/dist/entries/llm-models.js +2 -2
  95. package/dist/entries/model-catalog.cjs +133 -133
  96. package/dist/entries/model-catalog.js +4 -4
  97. package/dist/entries/models.cjs +431 -395
  98. package/dist/entries/models.d.cts +2 -2
  99. package/dist/entries/models.d.ts +2 -2
  100. package/dist/entries/models.js +6 -6
  101. package/dist/entries/nodes.cjs +212 -212
  102. package/dist/entries/nodes.js +8 -8
  103. package/dist/entries/pipeline.cjs +153 -153
  104. package/dist/entries/pipeline.d.cts +1 -1
  105. package/dist/entries/pipeline.d.ts +1 -1
  106. package/dist/entries/pipeline.js +3 -3
  107. package/dist/entries/social.cjs +177 -177
  108. package/dist/entries/social.js +2 -2
  109. package/dist/entries/ugc.cjs +71 -71
  110. package/dist/entries/ugc.js +4 -4
  111. package/dist/entries/video.cjs +152 -152
  112. package/dist/entries/video.d.cts +2 -1
  113. package/dist/entries/video.d.ts +2 -1
  114. package/dist/entries/video.js +6 -6
  115. package/dist/index.cjs +1697 -1597
  116. package/dist/index.d.cts +3 -3
  117. package/dist/index.d.ts +3 -3
  118. package/dist/index.js +21 -21
  119. package/dist/{model-constants-DZ3tPGFO.d.ts → model-constants-B5DNHIP8.d.ts} +156 -12
  120. package/dist/{model-constants-BstsUup6.d.cts → model-constants-CQr_d3Kw.d.cts} +156 -12
  121. package/package.json +1 -1
  122. package/src/__tests__/extend-providers.test.ts +43 -6
  123. package/src/__tests__/fixtures/measured-input-quote-parity.json +537 -1
  124. package/src/__tests__/fixtures/planned-length-quote-parity.json +46 -1
  125. package/src/__tests__/fixtures/probed-node-quote-parity.json +132 -0
  126. package/src/__tests__/fixtures/video-utility-quote-parity.json +112 -1
  127. package/src/__tests__/gemini-omni-extend.test.ts +110 -0
  128. package/src/__tests__/gvp-supported-providers.test.ts +3 -0
  129. package/src/__tests__/llm-models.test.ts +116 -2
  130. package/src/__tests__/llm-price-key.test.ts +2 -0
  131. package/src/__tests__/seedance-2-5-flash-catalog.test.ts +194 -0
  132. package/src/__tests__/video-character-refs.test.ts +48 -0
  133. package/src/credit-identifiers.ts +51 -32
  134. package/src/entries/credits.ts +17 -0
  135. package/src/entries/llm-models.ts +4 -0
  136. package/src/entries/models.ts +11 -0
  137. package/src/gemini-omni-extend-quote.ts +76 -0
  138. package/src/lip-sync-pricing.ts +1 -1
  139. package/src/llm-models.ts +117 -2
  140. package/src/model-catalog.ts +95 -0
  141. package/src/model-constants.ts +274 -11
  142. package/src/node-default-mappings.ts +2 -0
  143. package/src/seedance-extend-rate.ts +83 -20
  144. package/src/seedance-lip-sync.ts +68 -0
  145. package/src/video-character-refs.ts +26 -6
  146. package/dist/chunk-3L7GMQ4M.cjs.map +0 -1
  147. package/dist/chunk-4XR66IWF.cjs.map +0 -1
  148. package/dist/chunk-5NVGKXJV.cjs.map +0 -1
  149. package/dist/chunk-BHL7TAQO.js.map +0 -1
  150. package/dist/chunk-E62W5I6A.cjs.map +0 -1
  151. package/dist/chunk-HTDKEYMY.cjs.map +0 -1
  152. package/dist/chunk-MVXZP6VB.js.map +0 -1
  153. package/dist/chunk-PAUWEWTY.js.map +0 -1
  154. package/dist/chunk-PJAJCFLP.cjs.map +0 -1
  155. package/dist/chunk-SCDE676D.js.map +0 -1
  156. package/dist/chunk-V6OXSXIX.js.map +0 -1
  157. package/dist/chunk-VBP4DH37.js.map +0 -1
@@ -0,0 +1,194 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, normalizeVideoRequestParams } from "../model-catalog.js"
3
+ import {
4
+ EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS,
5
+ FRAME_MODE_ADAPTIVE_ONLY_ASPECT,
6
+ IMAGE_TO_VIDEO_PROVIDERS,
7
+ LIP_SYNC_PROVIDERS,
8
+ NATIVE_ADAPTIVE_ASPECT,
9
+ PRICING_DEFAULT_RESOLUTION,
10
+ PROMPT_HARD_CEILING,
11
+ SEEDANCE_2_5_FLASH_REF_LIMITS,
12
+ SEEDANCE_LIP_SYNC_PROVIDERS,
13
+ TEXT_TO_VIDEO_PROVIDERS,
14
+ VIDEO_DURATION_TIERS,
15
+ VIDEO_REF_AUDIO_RULES,
16
+ VIDEO_REF_LIMITS_BY_PROVIDER,
17
+ VIDEO_REF_VIDEO_DURATION_LIMITS,
18
+ VIDEO_TO_VIDEO_NODE_PROVIDERS,
19
+ billsReferenceVideoSeconds,
20
+ checkRefAudioRules,
21
+ getMaxVideoPromptChars,
22
+ isEditVideoProProvider,
23
+ isSeedance2Provider,
24
+ isSeedanceVideoEditProvider,
25
+ editVideoProProviderRefusal,
26
+ seedance2AudioLimitSec,
27
+ trimVideoReferencesToLimits,
28
+ videoReferencesOverLimitProblem,
29
+ supportsAutoVideoDuration,
30
+ } from "../model-constants.js"
31
+ import { SEEDANCE_DRAFT_MODELS, isSeedanceDraftCapable } from "../seedance-draft.js"
32
+ import { buildVideoCreditModelIdentifier } from "../credit-identifiers.js"
33
+
34
+ const ID = "seedance-2-5-flash"
35
+
36
+ /**
37
+ * Seedance 2.5 Flash — the fast tier of Seedance 2.5, from its own KIE schema
38
+ * (docs.kie.ai/market/bytedance/seedance-2-5-flash). Its id EXTENDS
39
+ * `seedance-2-5`, so every family set and prefix match is pinned here: it
40
+ * shares the family's behaviour, never 2.5's own facts (1080p, 30/10/10
41
+ * references, the 30000-char prompt, draft and the HD finalize).
42
+ */
43
+ describe("seedance-2-5-flash catalog", () => {
44
+ it("is a ByteDance video model beside Seedance 2.5, with its own label", () => {
45
+ const m = MODEL_CATALOG[ID]!
46
+ expect(m.kind).toBe("video")
47
+ expect(m.label).toBe("Seedance 2.5 Flash")
48
+ expect(m.maker).toBe("bytedance")
49
+ expect(m.modes).toEqual(["i2v", "t2v", "v2v"])
50
+ expect(m.noSeed).toBe(true)
51
+ expect(m.referenceTaskTypes).toEqual(["reference", "edit", "extend"])
52
+ })
53
+
54
+ it("is 480p/720p only — never Seedance 2.5's 1080p — and defaults to 720p for pricing", () => {
55
+ expect(MODEL_CATALOG[ID]!.resolutions).toEqual(["480p", "720p"])
56
+ expect(PRICING_DEFAULT_RESOLUTION[ID]).toBe("720p")
57
+ // A stale 1080p (copied from a 2.5 node) is moved before it is priced or sent.
58
+ expect(normalizeVideoRequestParams(ID, { resolution: "1080p" }).resolution).toBe("720p")
59
+ })
60
+
61
+ it("runs 4-30s, one price tier per second, and takes Auto length", () => {
62
+ const d = MODEL_CATALOG[ID]!.durations!
63
+ expect(d[0]).toBe(4)
64
+ expect(d[d.length - 1]).toBe(30)
65
+ expect(d).toHaveLength(27)
66
+ expect(MODEL_CATALOG[ID]!.defaultDuration).toBe(8)
67
+ expect(VIDEO_DURATION_TIERS[ID]).toHaveLength(27)
68
+ expect(supportsAutoVideoDuration(ID)).toBe(true)
69
+ })
70
+
71
+ it("takes 10 images / 5 videos / 5 audio references — not 2.5's 30/10/10, not the 2.0 family's 9/3/3", () => {
72
+ expect(SEEDANCE_2_5_FLASH_REF_LIMITS).toEqual({ images: 10, videos: 5, audio: 5 })
73
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER[ID]).toEqual({ images: 10, videos: 5, audio: 5, requestRefusesOverLimit: true })
74
+ expect(VIDEO_REF_VIDEO_DURATION_LIMITS[ID]).toEqual({ minSec: 2, maxSec: 30, maxTotalSec: 30 })
75
+ expect(seedance2AudioLimitSec(ID)).toBe(30)
76
+ })
77
+
78
+ it("converts reference audio that is not WAV or MP3 (never refused for its format), and refuses a clip outside 2-30s or more than 30s together", () => {
79
+ expect(VIDEO_REF_AUDIO_RULES[ID]).toEqual({ formats: ["wav", "mp3"], convertsTo: "mp3", minSec: 2, maxSec: 30, maxTotalSec: 30 })
80
+ expect(VIDEO_REF_AUDIO_RULES["seedance-2-5"]).toBeUndefined()
81
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 5 }])).toEqual({ ok: true })
82
+ expect(checkRefAudioRules(ID, [{ formatNames: ["wav"], durationSec: 5 }])).toEqual({ ok: true })
83
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mov", "mp4", "m4a"], durationSec: 5 }])).toEqual({ ok: true })
84
+ expect(checkRefAudioRules(ID, [{ formatNames: ["ogg"], durationSec: 5 }])).toEqual({ ok: true })
85
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 1.5 }])).toMatchObject({ ok: false, code: "audio_too_short" })
86
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 31 }])).toMatchObject({ ok: false, code: "audio_too_long" })
87
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 20 }, { formatNames: ["m4a"], durationSec: 11 }])).toMatchObject({ ok: false, code: "audio_total_too_long" })
88
+ expect(checkRefAudioRules(ID, [{ formatNames: ["mp3"], durationSec: 15 }, { formatNames: ["m4a"], durationSec: 15 }])).toEqual({ ok: true })
89
+ // A rule without the conversion still refuses the format (Vidu Q4).
90
+ expect(checkRefAudioRules("vidu-q4", [{ formatNames: ["wav"], durationSec: 5 }])).toMatchObject({ ok: false, code: "audio_format_unsupported" })
91
+ })
92
+
93
+ it("forces adaptive aspect on frame requests (documented for Flash)", () => {
94
+ expect(FRAME_MODE_ADAPTIVE_ONLY_ASPECT.has(ID)).toBe(true)
95
+ expect(NATIVE_ADAPTIVE_ASPECT[ID]).toBe("adaptive")
96
+ })
97
+
98
+ it("keeps its own 20480-char prompt limit, under the route ceiling", () => {
99
+ expect(getMaxVideoPromptChars(ID)).toBe(20480)
100
+ expect(getMaxVideoPromptChars("seedance-2-5")).toBe(30000)
101
+ expect(PROMPT_HARD_CEILING).toBeGreaterThanOrEqual(20480)
102
+ })
103
+ })
104
+
105
+ describe("seedance-2-5-flash — the family it joins, and what it never inherits", () => {
106
+ it("joins the Seedance 2 family, reference-video billing, the edit lane and the lip-sync menu", () => {
107
+ expect(isSeedance2Provider(ID)).toBe(true)
108
+ expect(billsReferenceVideoSeconds(ID)).toBe(true)
109
+ expect(isSeedanceVideoEditProvider(ID)).toBe(true)
110
+ expect((VIDEO_TO_VIDEO_NODE_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
111
+ expect((LIP_SYNC_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
112
+ expect(SEEDANCE_LIP_SYNC_PROVIDERS.has(ID)).toBe(true)
113
+ })
114
+
115
+ it("is on both route provider lists (it runs from text and from a frame)", () => {
116
+ expect((TEXT_TO_VIDEO_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
117
+ expect((IMAGE_TO_VIDEO_PROVIDERS as readonly string[]).includes(ID)).toBe(true)
118
+ })
119
+
120
+ it("has no draft mode and no HD finalize", () => {
121
+ expect(isSeedanceDraftCapable(ID)).toBe(false)
122
+ expect(SEEDANCE_DRAFT_MODELS as readonly string[]).not.toContain(ID)
123
+ // A draft flag on a Flash request is ignored: priced and sent at the resolution asked.
124
+ expect(normalizeVideoRequestParams(ID, { resolution: "720p", draft: true }).resolution).toBe("720p")
125
+ })
126
+
127
+ it("is held back from Edit Video Pro (a separate decision); the rest of the family is not", () => {
128
+ expect(EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS.has(ID)).toBe(true)
129
+ expect(isEditVideoProProvider(ID)).toBe(false)
130
+ for (const p of ["seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5"]) {
131
+ expect(isEditVideoProProvider(p), p).toBe(true)
132
+ }
133
+ })
134
+ })
135
+
136
+ describe("seedance-2-5-flash pricing identifiers", () => {
137
+ const build = (duration?: number, resolution?: string, hasVideoRef?: boolean) =>
138
+ buildVideoCreditModelIdentifier(ID, duration, undefined, undefined, undefined, resolution, hasVideoRef)
139
+
140
+ it("prices its own rows, never Seedance 2.5's", () => {
141
+ expect(build(8, "720p")).toBe("seedance-2-5-flash:8s:720p")
142
+ expect(build(23, "480p")).toBe("seedance-2-5-flash:23s:480p")
143
+ expect(build(8, "720p", true)).toBe("seedance-2-5-flash:8s:720p-ref")
144
+ })
145
+
146
+ it("prices an omitted resolution at 720p and clamps 1080p / 4k to 720p — no 1080p row exists", () => {
147
+ expect(build(8)).toBe("seedance-2-5-flash:8s:720p")
148
+ expect(build(8, "1080p")).toBe("seedance-2-5-flash:8s:720p")
149
+ expect(build(8, "4k", true)).toBe("seedance-2-5-flash:8s:720p-ref")
150
+ })
151
+
152
+ it("resolves every duration x resolution x ref-mode to its own id (108 in all)", () => {
153
+ const seen = new Set<string>()
154
+ for (const d of MODEL_CATALOG[ID]!.durations!) {
155
+ for (const res of ["480p", "720p"]) {
156
+ for (const ref of [false, true]) {
157
+ const id = build(d, res, ref)
158
+ expect(id).toBe(`${ID}:${d}s:${res}${ref ? "-ref" : ""}`)
159
+ seen.add(id)
160
+ }
161
+ }
162
+ }
163
+ expect(seen.size).toBe(108)
164
+ })
165
+ })
166
+
167
+ describe("seedance-2-5-flash — too many references (decided 2026-11-16)", () => {
168
+ it("a direct request over 10 / 5 / 5 is refused with the limit named; a frame counts toward the images once a reference is sent", () => {
169
+ expect(videoReferencesOverLimitProblem(ID, { images: 10, videos: 5, audio: 5 })).toBeUndefined()
170
+ expect(videoReferencesOverLimitProblem(ID, { images: 11, videos: 0, audio: 0 })).toMatch(/at most 10 reference images; this request sends 11\. Remove 1\./)
171
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 6, audio: 0 })).toMatch(/at most 5 reference videos/)
172
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 0, audio: 6 })).toMatch(/at most 5 reference audio clips/)
173
+ expect(videoReferencesOverLimitProblem(ID, { images: 10, videos: 0, audio: 0, frames: 1 })).toMatch(/sends 11/)
174
+ // Frames alone (no reference) are frames, not references.
175
+ expect(videoReferencesOverLimitProblem(ID, { images: 0, videos: 0, audio: 0, frames: 2 })).toBeUndefined()
176
+ })
177
+
178
+ it("every other model keeps the provider's trim (nothing refused here)", () => {
179
+ for (const p of ["seedance-2", "seedance-2-5", "kling-4", "wan-3"]) {
180
+ expect(videoReferencesOverLimitProblem(p, { images: 99, videos: 99, audio: 99 }), p).toBeUndefined()
181
+ }
182
+ })
183
+
184
+ it("the editor's Run sends the first references up to the caps, less the frames that join the images", () => {
185
+ const n = (k: number) => Array.from({ length: k }, (_, i) => `u${i}`)
186
+ expect(trimVideoReferencesToLimits(ID, { images: n(12), videos: n(7), audio: n(6), frames: 1 })).toEqual({ images: n(9), videos: n(5), audio: n(5) })
187
+ expect(trimVideoReferencesToLimits("seedance-2-5", { images: n(40), videos: n(12) })).toEqual({ images: n(40), videos: n(12), audio: undefined })
188
+ })
189
+
190
+ it("Edit Video Pro refuses Flash with one sentence, and offers the rest of the family", () => {
191
+ expect(editVideoProProviderRefusal(ID)).toBe("seedance-2-5-flash is not offered on Edit Video Pro. Pick another Edit Video Pro model.")
192
+ for (const p of ["seedance-2", "seedance-2-fast", "seedance-2-mini", "seedance-2-5"]) expect(editVideoProProviderRefusal(p), p).toBeUndefined()
193
+ })
194
+ })
@@ -25,6 +25,7 @@ describe("character reference capability (data-driven)", () => {
25
25
  it("both Gemini Omni SKUs declare a 3-character cap, Kling 4.0 and Kling 4.0 Flash a 7-subject cap; nothing else does", () => {
26
26
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-video"]?.characters).toBe(3)
27
27
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash"]?.characters).toBe(3)
28
+ expect(VIDEO_REF_LIMITS_BY_PROVIDER["gemini-omni-flash-1-2"]?.characters).toBe(2)
28
29
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4"]?.characters).toBe(7)
29
30
  expect(VIDEO_REF_LIMITS_BY_PROVIDER["kling-4-flash"]?.characters).toBe(7)
30
31
  const others = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER)
@@ -114,6 +115,53 @@ describe("videoCharacterRefProblem", () => {
114
115
  expect(over?.message).toContain("7")
115
116
  })
116
117
 
118
+ describe("Gemini Omni Flash 1.2 (characters outside the image budget, decided 2026-11-17)", () => {
119
+ const omni12 = { ...base, provider: "gemini-omni-flash-1-2" }
120
+
121
+ it("is the only model whose characters sit outside its budget, and it takes no voices", () => {
122
+ const outside = Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => l?.charactersOutsideImageBudget).map(([id]) => id)
123
+ expect(outside).toEqual(["gemini-omni-flash-1-2"])
124
+ expect(videoCharacterRefCap("gemini-omni-flash-1-2")).toBe(2)
125
+ expect(videoCharacterVoiceCap("gemini-omni-flash-1-2")).toBe(0)
126
+ })
127
+
128
+ it("takes 1 or 2 characters beside a full image list and a source video — they count toward no quota", () => {
129
+ expect(videoCharacterRefProblem({ ...omni12, characterReferences: [portrait()] })).toBeNull()
130
+ expect(videoCharacterRefProblem({ ...omni12, imageCount: 6, characterReferences: [portrait(), portrait()] })).toBeNull()
131
+ const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
132
+ expect(videoCharacterRefProblem({ ...omni12, imageCount: 5, videoCount: 1, characterReferences: [withBody, withBody] })).toBeNull()
133
+ })
134
+
135
+ it("a third character is over its limit, as on 1.1", () => {
136
+ const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait(), portrait(), portrait()] })
137
+ expect(p?.code).toBe("character_references_over_limit")
138
+ expect(p?.message).toContain("at most 2")
139
+ })
140
+
141
+ it("a start or end frame beside characters is refused with the same codes as 1.1, worded as what the platform does, not a budget", () => {
142
+ const start = videoCharacterRefProblem({ ...omni12, hasStartFrame: true, characterReferences: [portrait()] })
143
+ expect(start?.code).toBe("character_references_with_start_frame")
144
+ expect(start?.message).not.toContain("compete for the same input slots")
145
+ expect(start?.message).toContain("imageUrl")
146
+ const end = videoCharacterRefProblem({ ...omni12, hasEndFrame: true, characterReferences: [portrait()] })
147
+ expect(end?.code).toBe("character_references_with_end_frame")
148
+ })
149
+
150
+ it("a pinned voice is refused, naming the models that take one", () => {
151
+ const p = videoCharacterRefProblem({ ...omni12, characterReferences: [portrait({ voice: { preset: "kore" } })] })
152
+ expect(p?.code).toBe("character_voice_unsupported")
153
+ expect(p?.message).toContain("gemini-omni-video, gemini-omni-flash.")
154
+ expect(p?.message).toMatch(/takes one: gemini-omni-video, gemini-omni-flash\.$/)
155
+ })
156
+
157
+ it("1.1 keeps its 7-unit budget and its own start-frame sentence", () => {
158
+ const p = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", imageCount: 5, characterReferences: [portrait(), portrait(), portrait()] })
159
+ expect(p?.code).toBe("character_references_quota")
160
+ const start = videoCharacterRefProblem({ ...base, provider: "gemini-omni-flash", hasStartFrame: true, characterReferences: [portrait()] })
161
+ expect(start?.message).toContain("compete for the same input slots")
162
+ })
163
+ })
164
+
117
165
  it("a body image costs a second unit in the quota", () => {
118
166
  const withBody = portrait({ bodyImageUrl: "https://cdn.example/b.png" })
119
167
  // 2 body-sets (4) + 3 images = 7 → ok; + 1 more image = 8 → rejected
@@ -46,6 +46,7 @@ import {
46
46
  PIXVERSE_V6_EXTEND_PROVIDER,
47
47
  isGrokExtendProvider,
48
48
  isGrokExtendSourceModel,
49
+ GROK_EXTEND_SOURCE_NODE_TYPES,
49
50
  GROK_EXTEND_PROVIDER,
50
51
  type CatalogExtendProvider,
51
52
  type SeedanceExtendProvider,
@@ -53,14 +54,16 @@ import {
53
54
  } from "./model-constants.js"
54
55
  import {
55
56
  SEEDANCE_EXTEND_CONTEXT_MAX_SEC,
56
- SEEDANCE_EXTEND_RATE_CREDIT_IDS,
57
+ SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER,
57
58
  SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
58
59
  isSeedanceExtendPricedBySecondsSent,
60
+ type SentPricedSeedanceExtendProvider,
59
61
  seedanceExtendAddedSec,
60
- seedanceExtendRefusesSource,
62
+ seedanceExtendSourceRefused,
61
63
  seedanceExtendSentSec,
62
64
  seedanceExtendUnits,
63
65
  } from "./seedance-extend-rate.js"
66
+ import { geminiOmniExtendQuoteCreditId } from "./gemini-omni-extend-quote.js"
64
67
  import { unitQuoteCreditId } from "./credit-estimators/unit-quote.js"
65
68
  import { isFlux2Model, FLUX2_RES_MP, type Flux2Model } from "./flux2-pricing.js"
66
69
  import {
@@ -817,20 +820,25 @@ export function tailExtendResolution(provider: TailExtendProvider, resolution?:
817
820
  }
818
821
 
819
822
  /**
820
- * The rate row a Seedance 2.5 Extend run at `resolution` is charged a multiple
821
- * of: the row of the resolution the run is priced and rendered at
822
- * ({@link tailExtendResolution}: one the model offers, else 720p).
823
+ * The rate row a sent-priced Extend Video run at `resolution` is charged a
824
+ * multiple of: `provider`'s row (Seedance 2.5 Extend when none is named) of the
825
+ * resolution the run is priced and rendered at ({@link tailExtendResolution}:
826
+ * one the model offers, else 720p).
823
827
  */
824
- export function seedanceExtendRateCreditId(resolution: unknown): string {
825
- const res = tailExtendResolution(SEEDANCE_EXTEND_SENT_PRICED_PROVIDER, resolution) as keyof typeof SEEDANCE_EXTEND_RATE_CREDIT_IDS
826
- return SEEDANCE_EXTEND_RATE_CREDIT_IDS[res] ?? SEEDANCE_EXTEND_RATE_CREDIT_IDS["720p"]
828
+ export function seedanceExtendRateCreditId(
829
+ resolution: unknown,
830
+ provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
831
+ ): string {
832
+ const rows = SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER[provider]
833
+ return rows[tailExtendResolution(provider, resolution)] ?? rows[TAIL_EXTEND_DEFAULT_RESOLUTION]!
827
834
  }
828
835
 
829
836
  /**
830
- * The ONE id a Seedance 2.5 Extend run on a known source is charged: the
831
- * whole-run quote (`<rate row>:<units>u`, {@link unitQuoteCreditId}) of that
832
- * run, which the price lookups (`GET /v1/credits/model-cost`,
833
- * `POST /v1/credits/model-costs`) answer with exactly what the run is charged.
837
+ * The ONE id a sent-priced Extend Video run (Seedance 2.5 Extend, Seedance 2.5
838
+ * Flash Extend) on a known source is charged: the whole-run quote
839
+ * (`<rate row>:<units>u`, {@link unitQuoteCreditId}) of that run, which the
840
+ * price lookups (`GET /v1/credits/model-cost`, `POST /v1/credits/model-costs`)
841
+ * answer with exactly what the run is charged.
834
842
  *
835
843
  * The units are (seconds sent + seconds added) ÷ 2, by the rule the server
836
844
  * charges a run by (seedance-extend-rate.ts): the seconds sent are the
@@ -845,9 +853,10 @@ export function seedanceExtendRateCreditId(resolution: unknown): string {
845
853
  * the most a run of that length costs.
846
854
  * @param duration the seconds added (the request's `duration`).
847
855
  * @param resolution the request's resolution (one the model does not offer is 720p).
856
+ * @param provider the extend provider (Seedance 2.5 Extend when none is named).
848
857
  * @returns the id, or `undefined` for a source the extend refuses: a measured
849
858
  * picture shorter than the shortest source it takes
850
- * (`SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC`, 1.8 s, compared as measured, as the
859
+ * (`SEEDANCE_EXTEND_MIN_SOURCE_SEC`: 1.8 s, 2 s on Flash; compared as measured, as the
851
860
  * route and the worker compare it), whatever the seconds added. No run on
852
861
  * such a source is made or charged, so there is no price to name.
853
862
  */
@@ -855,19 +864,25 @@ export function seedanceExtendSourceCreditId(
855
864
  sourcePictureSec: number | null | undefined,
856
865
  duration?: number | string,
857
866
  resolution?: unknown,
867
+ provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
858
868
  ): string | undefined {
859
- if (seedanceExtendRefusesSource(sourcePictureSec)) return undefined
860
- return seedanceExtendWholeRunCreditId(seedanceExtendSentSec(sourcePictureSec), duration, resolution)
869
+ if (seedanceExtendSourceRefused(provider, sourcePictureSec)) return undefined
870
+ return seedanceExtendWholeRunCreditId(provider, seedanceExtendSentSec(sourcePictureSec), duration, resolution)
861
871
  }
862
872
 
863
- /** The whole-run quote of a Seedance 2.5 Extend run that sends `sentSec` and adds `duration` at `resolution`. */
864
- function seedanceExtendWholeRunCreditId(sentSec: number, duration: number | string | undefined, resolution: unknown): string {
865
- const units = seedanceExtendUnits(sentSec, seedanceExtendAddedSec(SEEDANCE_EXTEND_SENT_PRICED_PROVIDER, duration))
866
- return unitQuoteCreditId(seedanceExtendRateCreditId(resolution), units)
873
+ /** The whole-run quote of a sent-priced extend run that sends `sentSec` and adds `duration` at `resolution`. */
874
+ function seedanceExtendWholeRunCreditId(
875
+ provider: SentPricedSeedanceExtendProvider,
876
+ sentSec: number,
877
+ duration: number | string | undefined,
878
+ resolution: unknown,
879
+ ): string {
880
+ const units = seedanceExtendUnits(sentSec, seedanceExtendAddedSec(provider, duration))
881
+ return unitQuoteCreditId(seedanceExtendRateCreditId(resolution, provider), units)
867
882
  }
868
883
 
869
884
  /**
870
- * The most a Seedance 2.5 Extend run that adds `duration` seconds at
885
+ * The most a sent-priced Extend Video run that adds `duration` seconds at
871
886
  * `resolution` can cost, as ONE id: the whole-run quote
872
887
  * (`<rate row>:<units>u`, {@link unitQuoteCreditId}) of a run that sends the
873
888
  * whole {@link SEEDANCE_EXTEND_CONTEXT_MAX_SEC}-second window — the units are
@@ -875,13 +890,17 @@ function seedanceExtendWholeRunCreditId(sentSec: number, duration: number | stri
875
890
  * never below what a run of that length is charged; the price lookups answer
876
891
  * it at the rate row's current price. A client that knows the source names
877
892
  * its run exactly with {@link seedanceExtendSourceCreditId}; this is that id
878
- * for a source not known.
893
+ * for a source not known. `provider`: Seedance 2.5 Extend when none is named.
879
894
  *
880
895
  * The seconds added snap into the catalog window exactly as
881
896
  * {@link tailExtendCreditId} reads them for every tail-recipe provider.
882
897
  */
883
- export function seedanceExtendFullWindowCreditId(duration?: number | string, resolution?: unknown): string {
884
- return seedanceExtendWholeRunCreditId(seedanceExtendSentSec(undefined), duration, resolution)
898
+ export function seedanceExtendFullWindowCreditId(
899
+ duration?: number | string,
900
+ resolution?: unknown,
901
+ provider: SentPricedSeedanceExtendProvider = SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
902
+ ): string {
903
+ return seedanceExtendWholeRunCreditId(provider, seedanceExtendSentSec(undefined), duration, resolution)
885
904
  }
886
905
 
887
906
  /**
@@ -896,11 +915,11 @@ export function seedanceExtendFullWindowCreditId(duration?: number | string, res
896
915
  * - Seedance 2.0 Extend (4–15 s) and Kling 4 Extend (3–30 s): their own rows,
897
916
  * one per second of the window and resolution, `<provider>:<N>s:<res>`
898
917
  * (480p / 720p / 1080p; Kling 4 720p / 1080p) — the price a run is charged.
899
- * - Seedance 2.5 Extend (4–30 s) is charged per second it sends and adds, and
900
- * how much it sends depends on the source: this names the most a run of
901
- * that length costs, the whole 10-second window sent
902
- * ({@link seedanceExtendFullWindowCreditId},
903
- * `seedance-2-5-extend:<res>:per-2s:<units>u`). A client that knows the
918
+ * - Seedance 2.5 Extend and Seedance 2.5 Flash Extend (4–30 s) are charged
919
+ * per second they send and add, and how much is sent depends on the
920
+ * source: this names the most a run of that length costs, the whole
921
+ * 10-second window sent ({@link seedanceExtendFullWindowCreditId},
922
+ * `<provider>:<res>:per-2s:<units>u`). A client that knows the
904
923
  * source names the run's own id with {@link seedanceExtendSourceCreditId}.
905
924
  *
906
925
  * A retired id (`seedance-2-extend`) is not a {@link TailExtendProvider}:
@@ -912,7 +931,10 @@ export function tailExtendCreditId(
912
931
  duration?: number | string,
913
932
  resolution?: string,
914
933
  ): string {
915
- if (isSeedanceExtendPricedBySecondsSent(provider)) return seedanceExtendFullWindowCreditId(duration, resolution)
934
+ if (isSeedanceExtendPricedBySecondsSent(provider)) return seedanceExtendFullWindowCreditId(duration, resolution, provider)
935
+ // Gemini Omni Flash 1.2 Extend: the whole-run quote of a run that sends the
936
+ // whole 10 s window (`geminiOmniExtendQuoteCreditId`, no source known).
937
+ if (provider === "gemini-omni-flash-1-2-extend") return geminiOmniExtendQuoteCreditId({ duration, resolution })
916
938
  return `${provider}:${pricedOutputDurationSec(provider, duration)}s:${tailExtendResolution(provider, resolution)}`
917
939
  }
918
940
 
@@ -1006,9 +1028,6 @@ export function grokExtendCreditId(duration?: unknown, sourceResolution?: unknow
1006
1028
  return `${GROK_EXTEND_PROVIDER}:${grokExtendSeconds(duration)}s:${resolution}`
1007
1029
  }
1008
1030
 
1009
- /** The video node types whose run Grok Extend can extend, set to a Grok Imagine model. */
1010
- const GROK_EXTEND_SOURCE_NODE_TYPES: ReadonlySet<string> = new Set(["generate-video", "text-to-video", "image-to-video"])
1011
-
1012
1031
  /**
1013
1032
  * The resolution a Grok Extend is quoted at from the clip a Grok Imagine node
1014
1033
  * already made — the clip the run extends: the take its task (`kieTaskId`, the
@@ -58,6 +58,9 @@ export {
58
58
  export type { NormalizedImageGen, PricedVideoSelection, GrokExtendSourceResolution } from "../credit-identifiers.js"
59
59
  export {
60
60
  SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
61
+ SEEDANCE_EXTEND_SENT_PRICED_PROVIDERS,
62
+ SEEDANCE_EXTEND_RATE_CREDIT_IDS_BY_PROVIDER,
63
+ SEEDANCE_EXTEND_MIN_SOURCE_SEC,
61
64
  SEEDANCE_EXTEND_CONTEXT_MAX_SEC,
62
65
  SEEDANCE_EXTEND_RATE_SECONDS,
63
66
  SEEDANCE_EXTEND_RATE_CREDIT_IDS,
@@ -65,11 +68,17 @@ export {
65
68
  isSeedanceExtendRateCreditId,
66
69
  seedanceExtendAddedSec,
67
70
  seedanceExtendRefusesSource,
71
+ seedanceExtendSourceRefused,
68
72
  seedanceExtendSourceSec,
69
73
  seedanceExtendSentSec,
70
74
  seedanceExtendUnits,
71
75
  type SentPricedSeedanceExtendProvider,
72
76
  } from "../seedance-extend-rate.js"
77
+ export {
78
+ geminiOmniExtendQuoteCreditId,
79
+ parseGeminiOmniExtendQuoteCreditId,
80
+ type GeminiOmniExtendQuoteCreditIdParts,
81
+ } from "../gemini-omni-extend-quote.js"
73
82
  export * from "../credit-estimators/index.js"
74
83
  export {
75
84
  resolveTopazUpscale,
@@ -109,6 +118,14 @@ export {
109
118
  LIP_SYNC_UNMEASURED_ESTIMATE_SECONDS,
110
119
  } from "../lip-sync-pricing.js"
111
120
  export type { LipSyncDurationBucket, LipSyncAudioRate } from "../lip-sync-pricing.js"
121
+ export {
122
+ SEEDANCE_LIP_SYNC_SECONDS,
123
+ isSeedanceLipSyncProvider,
124
+ seedanceLipSyncResolution,
125
+ seedanceLipSyncCreditId,
126
+ MINIMAX_H3_LIP_SYNC_CREDIT_ID,
127
+ referenceAudioLipSyncCreditId,
128
+ } from "../seedance-lip-sync.js"
112
129
  export {
113
130
  AI_AVATAR_MAX_DURATION_SEC,
114
131
  AI_AVATAR_MAX_AUDIO_SEC,
@@ -45,6 +45,10 @@ export {
45
45
  getLlmModel,
46
46
  getLlmTier,
47
47
  getLlmModalityCaps,
48
+ LLM_NODE_ONLY_MEDIA_MODELS,
49
+ readsMediaOnLlmNodesOnly,
50
+ readsVideoOutsideLlmNodes,
51
+ readsAudioOutsideLlmNodes,
48
52
  type LlmModalityCaps,
49
53
  llmAcceptsFiles,
50
54
  LLM_FILE_MODELS,
@@ -101,6 +101,7 @@ export {
101
101
  isGrokExtendProvider,
102
102
  GROK_EXTEND_SOURCE_MODELS,
103
103
  isGrokExtendSourceModel,
104
+ GROK_EXTEND_SOURCE_NODE_TYPES,
104
105
  LIP_SYNC_PROVIDERS,
105
106
  RETIRED_LIP_SYNC_PROVIDERS,
106
107
  retiredLipSyncProviderName,
@@ -160,6 +161,9 @@ export {
160
161
  SEEDANCE_2_PROVIDERS,
161
162
  SEEDANCE_2_REF_LIMITS,
162
163
  SEEDANCE_2_5_REF_LIMITS,
164
+ SEEDANCE_2_5_FLASH_REF_LIMITS,
165
+ videoReferencesOverLimitProblem,
166
+ trimVideoReferencesToLimits,
163
167
  SEEDANCE_2_EXTEND_STITCH,
164
168
  SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC,
165
169
  SEEDANCE_2_CONTINUATION_REF_SEC,
@@ -167,6 +171,8 @@ export {
167
171
  FRAME_MODE_ADAPTIVE_ONLY_ASPECT,
168
172
  VIDEO_REF_LIMITS_BY_PROVIDER,
169
173
  VIDEO_REF_VIDEO_DURATION_LIMITS,
174
+ VIDEO_REF_VIDEO_PICTURE_LIMITS,
175
+ refVideoAspectProblem,
170
176
  checkRefVideoDurations,
171
177
  VIDEO_CHARACTER_CLIP_DURATION_LIMITS,
172
178
  checkCharacterClipDurations,
@@ -191,6 +197,9 @@ export {
191
197
  videoProviderRefModeFrameSeats,
192
198
  VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL,
193
199
  isSeedance2Provider,
200
+ isEditVideoProProvider,
201
+ editVideoProProviderRefusal,
202
+ EDIT_VIDEO_PRO_HELD_BACK_PROVIDERS,
194
203
  MINIMAX_H3_PROVIDERS,
195
204
  isMinimaxH3Provider,
196
205
  MINIMAX_H3_DEFAULT_RESOLUTION,
@@ -280,6 +289,7 @@ export {
280
289
  } from "../model-constants.js"
281
290
  export type { VideoStartFrameOnlyProblem } from "../model-constants.js"
282
291
  export type { ImageRunKind } from "../model-constants.js"
292
+ export type { VideoReferenceCounts } from "../model-constants.js"
283
293
  export {
284
294
  CAST_SWAP_POST_PROMPT_MAX,
285
295
  TREND_PROMPT_LIMITS,
@@ -367,6 +377,7 @@ export type {
367
377
  GvpAnchorChoice,
368
378
  GvpAnchorWireMode,
369
379
  RefVideoDurationLimit,
380
+ RefVideoPictureLimit,
370
381
  RefAudioRule,
371
382
  RefAudioProbe,
372
383
  RefAudioCheck,
@@ -0,0 +1,76 @@
1
+ /**
2
+ * The price of ONE Gemini Omni Flash 1.2 Extend run (`gemini-omni-flash-1-2-extend`),
3
+ * as ONE id (decided 2026-11-17) — part of the public credit-id contract.
4
+ *
5
+ * Such a run is charged per second of video it sends and adds, on two rows
6
+ * the server reads, the total rounded up once: no single row × units can name
7
+ * it. `geminiOmniExtendQuoteCreditId` names the whole run instead:
8
+ *
9
+ * `gemini-omni-flash-1-2-extend:<resolution>:sent-<S>s:added-<A>s`
10
+ *
11
+ * - `<resolution>`: the one the run renders at and is priced by (360p / 720p /
12
+ * 1080p / 4k; any other is 720p, as the run reads it);
13
+ * - `<S>`: the seconds of the source sent — its last 10 seconds, or all of a
14
+ * shorter source, read by the platform's container-overhang rule (8.04 s is
15
+ * 8 s, 8.3 s is 8.3 s); with no known source, the whole 10 s window, the
16
+ * most a run sends;
17
+ * - `<A>`: the whole seconds added, held in the engine's 3–10 s window (8
18
+ * when none is asked).
19
+ *
20
+ * `GET /v1/credits/model-cost` and `POST /v1/credits/model-costs` answer it
21
+ * with exactly what such a run is charged; an id the server does not price (a
22
+ * resolution, a length or a source it refuses) lands in `missing`. Numbers are
23
+ * written exactly as JavaScript prints them.
24
+ */
25
+ import { MODEL_CATALOG } from "./model-catalog.js"
26
+ import { seedanceExtendAddedSec, seedanceExtendSentSec } from "./seedance-extend-rate.js"
27
+
28
+ const PROVIDER = "gemini-omni-flash-1-2-extend"
29
+ const DEFAULT_RESOLUTION = "720p"
30
+ const PREFIX = `${PROVIDER}:`
31
+ const NUMBER = String.raw`\d{1,7}(?:\.\d{1,20})?`
32
+ const QUOTE_ID = new RegExp(`^${PROVIDER}:([0-9a-z]+):sent-(${NUMBER})s:added-(\\d{1,3})s$`)
33
+
34
+ /** A `gemini-omni-flash-1-2-extend:<res>:sent-<S>s:added-<A>s` id, read back. */
35
+ export interface GeminiOmniExtendQuoteCreditIdParts {
36
+ /** The resolution the run renders at. */
37
+ readonly resolution: string
38
+ /** The seconds of the source sent. */
39
+ readonly sentSec: number
40
+ /** The whole seconds added. */
41
+ readonly addedSec: number
42
+ }
43
+
44
+ /**
45
+ * The id of the whole price of one Gemini Omni Flash 1.2 Extend run that adds
46
+ * `duration` seconds at `resolution` to a source whose picture lasts
47
+ * `sourcePictureSec` (undefined, or not a positive number: not known — the
48
+ * whole 10 s window, the most a run of that length costs).
49
+ */
50
+ export function geminiOmniExtendQuoteCreditId(args: {
51
+ readonly sourcePictureSec?: number | null
52
+ readonly duration?: number | string
53
+ readonly resolution?: unknown
54
+ }): string {
55
+ const resolution = typeof args.resolution === "string" && MODEL_CATALOG[PROVIDER]?.resolutions?.includes(args.resolution)
56
+ ? args.resolution
57
+ : DEFAULT_RESOLUTION
58
+ const sent = seedanceExtendSentSec(args.sourcePictureSec)
59
+ const added = seedanceExtendAddedSec(PROVIDER, args.duration)
60
+ return `${PREFIX}${resolution}:sent-${String(sent)}s:added-${String(added)}s`
61
+ }
62
+
63
+ /**
64
+ * The parts of such an id by its shape alone, or undefined. Which
65
+ * resolutions, lengths and sources the server prices is the server's to say:
66
+ * an id it does not price lands in `missing`.
67
+ */
68
+ export function parseGeminiOmniExtendQuoteCreditId(id: string): GeminiOmniExtendQuoteCreditIdParts | undefined {
69
+ if (typeof id !== "string" || !id.startsWith(PREFIX)) return undefined
70
+ const m = QUOTE_ID.exec(id)
71
+ if (!m) return undefined
72
+ const sentSec = Number(m[2])
73
+ const addedSec = Number(m[3])
74
+ if (!Number.isFinite(sentSec) || sentSec <= 0 || !Number.isInteger(addedSec) || addedSec <= 0) return undefined
75
+ return { resolution: m[1]!, sentSec, addedSec }
76
+ }
@@ -128,7 +128,7 @@ export const LIP_SYNC_MAX_AUDIO_SECONDS: Record<string, number> = {
128
128
  "sync-lipsync-v3": 300,
129
129
  // Volcengine (KIE) — video-to-video dubbing, per-second, 5-min ceiling.
130
130
  "volcengine-lipsync": 300,
131
- // The per-second-rate models: their own maximum (longer audio is refused, never trimmed).
131
+ // The per-second-rate models: their own maximum (longer audio is refused; up to the 0.05 s its hold forgives past it, held at the maximum and cut to it).
132
132
  ...Object.fromEntries(Object.entries(LIP_SYNC_AUDIO_RATES).map(([provider, rate]) => [provider, rate.maxSeconds])),
133
133
  }
134
134