@nodaro/shared 3.63.0 → 3.64.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 (209) hide show
  1. package/dist/{chunk-AE3AAJ4O.js → chunk-36VWLB4J.js} +3 -3
  2. package/dist/{chunk-AE3AAJ4O.js.map → chunk-36VWLB4J.js.map} +1 -1
  3. package/dist/{chunk-HWQ2SYNA.js → chunk-3AYM47GW.js} +5 -5
  4. package/dist/{chunk-HWQ2SYNA.js.map → chunk-3AYM47GW.js.map} +1 -1
  5. package/dist/{chunk-CZ5IQB3L.js → chunk-3KTWYYCN.js} +8 -5
  6. package/dist/chunk-3KTWYYCN.js.map +1 -0
  7. package/dist/{chunk-4MMZD63H.js → chunk-4IUE2JB7.js} +3 -3
  8. package/dist/{chunk-4MMZD63H.js.map → chunk-4IUE2JB7.js.map} +1 -1
  9. package/dist/{chunk-M5OCFGHF.cjs → chunk-5OBTGNUQ.cjs} +296 -25
  10. package/dist/chunk-5OBTGNUQ.cjs.map +1 -0
  11. package/dist/{chunk-ZPE2ZTJ4.cjs → chunk-67CMMTLN.cjs} +4 -4
  12. package/dist/{chunk-ZPE2ZTJ4.cjs.map → chunk-67CMMTLN.cjs.map} +1 -1
  13. package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
  14. package/dist/chunk-6BRWPJPP.cjs.map +1 -0
  15. package/dist/{chunk-HBXF6RUU.js → chunk-6YIV37V7.js} +4 -4
  16. package/dist/{chunk-HBXF6RUU.js.map → chunk-6YIV37V7.js.map} +1 -1
  17. package/dist/{chunk-F6WGGYQW.cjs → chunk-7AJGUI7L.cjs} +37 -15
  18. package/dist/chunk-7AJGUI7L.cjs.map +1 -0
  19. package/dist/{chunk-KCZHQH2O.js → chunk-7KQ6W5DS.js} +4 -4
  20. package/dist/{chunk-KCZHQH2O.js.map → chunk-7KQ6W5DS.js.map} +1 -1
  21. package/dist/{chunk-TM5JYSJF.cjs → chunk-ACZZHHFZ.cjs} +72 -33
  22. package/dist/chunk-ACZZHHFZ.cjs.map +1 -0
  23. package/dist/{chunk-Y35JQPT6.cjs → chunk-AZNZ5WNZ.cjs} +42 -42
  24. package/dist/{chunk-Y35JQPT6.cjs.map → chunk-AZNZ5WNZ.cjs.map} +1 -1
  25. package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
  26. package/dist/chunk-BQYCZLMF.js.map +1 -0
  27. package/dist/{chunk-GMBDLNLD.cjs → chunk-CHS2SIP6.cjs} +183 -60
  28. package/dist/chunk-CHS2SIP6.cjs.map +1 -0
  29. package/dist/{chunk-77WU3V3J.cjs → chunk-CHTZZRAL.cjs} +6 -6
  30. package/dist/{chunk-77WU3V3J.cjs.map → chunk-CHTZZRAL.cjs.map} +1 -1
  31. package/dist/{chunk-WZVIBAKN.cjs → chunk-D4KWNDPH.cjs} +12 -12
  32. package/dist/{chunk-WZVIBAKN.cjs.map → chunk-D4KWNDPH.cjs.map} +1 -1
  33. package/dist/{chunk-PSKZKLDG.js → chunk-DZ4IOP3Q.js} +288 -26
  34. package/dist/chunk-DZ4IOP3Q.js.map +1 -0
  35. package/dist/{chunk-XGVJGNZW.cjs → chunk-EXEVT6D2.cjs} +15 -5
  36. package/dist/chunk-EXEVT6D2.cjs.map +1 -0
  37. package/dist/{chunk-X5BAFW3Q.cjs → chunk-FHGRKQVZ.cjs} +8 -8
  38. package/dist/{chunk-X5BAFW3Q.cjs.map → chunk-FHGRKQVZ.cjs.map} +1 -1
  39. package/dist/{chunk-GSKLPI3J.cjs → chunk-GTWUS6MQ.cjs} +118 -61
  40. package/dist/chunk-GTWUS6MQ.cjs.map +1 -0
  41. package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
  42. package/dist/chunk-H5KHWTAE.js.map +1 -0
  43. package/dist/{chunk-V5EEQR2U.cjs → chunk-HDPJNNMF.cjs} +21 -21
  44. package/dist/{chunk-V5EEQR2U.cjs.map → chunk-HDPJNNMF.cjs.map} +1 -1
  45. package/dist/{chunk-6M563QE6.js → chunk-IYSOVS7O.js} +55 -23
  46. package/dist/chunk-IYSOVS7O.js.map +1 -0
  47. package/dist/{chunk-XGGZWA4A.cjs → chunk-J6B7J73J.cjs} +52 -49
  48. package/dist/chunk-J6B7J73J.cjs.map +1 -0
  49. package/dist/{chunk-MD4XHED4.js → chunk-KB2SQAR3.js} +3 -3
  50. package/dist/{chunk-MD4XHED4.js.map → chunk-KB2SQAR3.js.map} +1 -1
  51. package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
  52. package/dist/chunk-KSHAAPQF.cjs.map +1 -0
  53. package/dist/{chunk-6TGB7ECA.cjs → chunk-O4RPXBDZ.cjs} +12 -8
  54. package/dist/chunk-O4RPXBDZ.cjs.map +1 -0
  55. package/dist/{chunk-YUER7TJG.js → chunk-OBOOHG3N.js} +13 -4
  56. package/dist/chunk-OBOOHG3N.js.map +1 -0
  57. package/dist/{chunk-6BZC2ZHC.cjs → chunk-OOZW2MM6.cjs} +9 -9
  58. package/dist/{chunk-6BZC2ZHC.cjs.map → chunk-OOZW2MM6.cjs.map} +1 -1
  59. package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
  60. package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
  61. package/dist/{chunk-3K24DWOH.js → chunk-PJJAZQVZ.js} +3 -3
  62. package/dist/{chunk-3K24DWOH.js.map → chunk-PJJAZQVZ.js.map} +1 -1
  63. package/dist/{chunk-EPXGG27L.js → chunk-Q2Y4JHF7.js} +5 -5
  64. package/dist/{chunk-EPXGG27L.js.map → chunk-Q2Y4JHF7.js.map} +1 -1
  65. package/dist/{chunk-KMGCHV6O.js → chunk-QYU7J5EQ.js} +37 -15
  66. package/dist/chunk-QYU7J5EQ.js.map +1 -0
  67. package/dist/{chunk-IY3Y462W.js → chunk-S3UGLZSF.js} +3 -3
  68. package/dist/{chunk-IY3Y462W.js.map → chunk-S3UGLZSF.js.map} +1 -1
  69. package/dist/{chunk-34QLPTSA.js → chunk-SHH2T4CR.js} +3 -3
  70. package/dist/{chunk-34QLPTSA.js.map → chunk-SHH2T4CR.js.map} +1 -1
  71. package/dist/{chunk-L2TVY6XN.cjs → chunk-SPAHI7DY.cjs} +4 -4
  72. package/dist/{chunk-L2TVY6XN.cjs.map → chunk-SPAHI7DY.cjs.map} +1 -1
  73. package/dist/{chunk-YX6TFX7H.js → chunk-SXHHLZ22.js} +66 -11
  74. package/dist/chunk-SXHHLZ22.js.map +1 -0
  75. package/dist/{chunk-LMAQUR55.cjs → chunk-T2OVDF2M.cjs} +6 -6
  76. package/dist/{chunk-LMAQUR55.cjs.map → chunk-T2OVDF2M.cjs.map} +1 -1
  77. package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
  78. package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
  79. package/dist/{chunk-BMJVKYVB.js → chunk-TPQJKS7D.js} +109 -7
  80. package/dist/chunk-TPQJKS7D.js.map +1 -0
  81. package/dist/{chunk-63H4C56Q.cjs → chunk-TQW3R44P.cjs} +8 -8
  82. package/dist/{chunk-63H4C56Q.cjs.map → chunk-TQW3R44P.cjs.map} +1 -1
  83. package/dist/{chunk-4DVWXEB6.js → chunk-TTGZ2L3O.js} +3 -3
  84. package/dist/{chunk-4DVWXEB6.js.map → chunk-TTGZ2L3O.js.map} +1 -1
  85. package/dist/{chunk-XBTYGQ6Z.js → chunk-VPTA4Z7G.js} +8 -5
  86. package/dist/chunk-VPTA4Z7G.js.map +1 -0
  87. package/dist/{chunk-6XUG4L7X.cjs → chunk-VZ6TE23U.cjs} +6 -6
  88. package/dist/{chunk-6XUG4L7X.cjs.map → chunk-VZ6TE23U.cjs.map} +1 -1
  89. package/dist/{chunk-LH72PQO2.cjs → chunk-W6VJAUGM.cjs} +114 -45
  90. package/dist/chunk-W6VJAUGM.cjs.map +1 -0
  91. package/dist/{chunk-OV3JTKBY.js → chunk-W7KHHNZR.js} +74 -17
  92. package/dist/chunk-W7KHHNZR.js.map +1 -0
  93. package/dist/{chunk-2PU3AGGS.cjs → chunk-YQV53HRR.cjs} +7 -7
  94. package/dist/{chunk-2PU3AGGS.cjs.map → chunk-YQV53HRR.cjs.map} +1 -1
  95. package/dist/{chunk-FXGNRYQQ.js → chunk-ZI3QDUHO.js} +3 -3
  96. package/dist/{chunk-FXGNRYQQ.js.map → chunk-ZI3QDUHO.js.map} +1 -1
  97. package/dist/entries/apps.cjs +43 -42
  98. package/dist/entries/apps.js +8 -7
  99. package/dist/entries/captions.cjs +38 -30
  100. package/dist/entries/captions.d.cts +47 -1
  101. package/dist/entries/captions.d.ts +47 -1
  102. package/dist/entries/captions.js +1 -1
  103. package/dist/entries/credits.cjs +303 -191
  104. package/dist/entries/credits.d.cts +219 -15
  105. package/dist/entries/credits.d.ts +219 -15
  106. package/dist/entries/credits.js +11 -11
  107. package/dist/entries/llm-models.cjs +62 -62
  108. package/dist/entries/llm-models.d.cts +29 -7
  109. package/dist/entries/llm-models.d.ts +29 -7
  110. package/dist/entries/llm-models.js +2 -2
  111. package/dist/entries/model-catalog.cjs +149 -109
  112. package/dist/entries/model-catalog.d.cts +64 -7
  113. package/dist/entries/model-catalog.d.ts +64 -7
  114. package/dist/entries/model-catalog.js +4 -4
  115. package/dist/entries/models.cjs +394 -346
  116. package/dist/entries/models.d.cts +4 -4
  117. package/dist/entries/models.d.ts +4 -4
  118. package/dist/entries/models.js +5 -5
  119. package/dist/entries/nodes.cjs +220 -211
  120. package/dist/entries/nodes.d.cts +46 -3
  121. package/dist/entries/nodes.d.ts +46 -3
  122. package/dist/entries/nodes.js +10 -9
  123. package/dist/entries/pipeline.cjs +156 -152
  124. package/dist/entries/pipeline.d.cts +13 -3
  125. package/dist/entries/pipeline.d.ts +13 -3
  126. package/dist/entries/pipeline.js +3 -3
  127. package/dist/entries/social.cjs +177 -177
  128. package/dist/entries/social.js +2 -2
  129. package/dist/entries/ugc.cjs +71 -71
  130. package/dist/entries/ugc.js +4 -4
  131. package/dist/entries/video.cjs +145 -145
  132. package/dist/entries/video.js +6 -6
  133. package/dist/entries/workflow.cjs +150 -150
  134. package/dist/entries/workflow.d.cts +1 -1
  135. package/dist/entries/workflow.d.ts +1 -1
  136. package/dist/entries/workflow.js +2 -2
  137. package/dist/index.cjs +1879 -1659
  138. package/dist/index.d.cts +7 -7
  139. package/dist/index.d.ts +7 -7
  140. package/dist/index.js +25 -25
  141. package/dist/{model-catalog-C_Eo35tL.d.cts → model-catalog-Cf9fkEUp.d.cts} +15 -2
  142. package/dist/{model-catalog-C_Eo35tL.d.ts → model-catalog-Cf9fkEUp.d.ts} +15 -2
  143. package/dist/{model-constants-DWcxOmaY.d.cts → model-constants-BxjiWVQ9.d.ts} +89 -19
  144. package/dist/{model-constants-Bg4ccSQb.d.ts → model-constants-C_Nyft_i.d.cts} +89 -19
  145. package/package.json +1 -1
  146. package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
  147. package/src/__tests__/extend-providers.test.ts +266 -26
  148. package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
  149. package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
  150. package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
  151. package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
  152. package/src/__tests__/flux-3-klein.test.ts +203 -0
  153. package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
  154. package/src/__tests__/llm-models.test.ts +7 -9
  155. package/src/__tests__/llm-price-key.test.ts +12 -0
  156. package/src/__tests__/model-makers.test.ts +3 -0
  157. package/src/__tests__/node-runtime-keys.test.ts +7 -0
  158. package/src/__tests__/normalize-node-params.test.ts +147 -1
  159. package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
  160. package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
  161. package/src/__tests__/sequence-execution.test.ts +22 -1
  162. package/src/__tests__/suno-credit-type.test.ts +21 -2
  163. package/src/__tests__/transcribe-capabilities.test.ts +4 -2
  164. package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
  165. package/src/__tests__/video-analysis-pricing.test.ts +10 -9
  166. package/src/caption-styles.ts +62 -0
  167. package/src/credit-estimators/add-captions-nemotron.ts +73 -0
  168. package/src/credit-estimators/index.ts +10 -0
  169. package/src/credit-identifiers.ts +249 -13
  170. package/src/entries/captions.ts +2 -0
  171. package/src/entries/credits.ts +25 -1
  172. package/src/entries/model-catalog.ts +13 -0
  173. package/src/entries/models.ts +15 -0
  174. package/src/entries/nodes.ts +2 -0
  175. package/src/entries/pipeline.ts +1 -1
  176. package/src/flux-3-klein.ts +69 -0
  177. package/src/input-image-pricing.ts +23 -6
  178. package/src/llm-models.ts +60 -16
  179. package/src/model-catalog.ts +280 -25
  180. package/src/model-constants.ts +146 -17
  181. package/src/node-default-mappings.ts +3 -0
  182. package/src/node-runtime-keys.ts +3 -0
  183. package/src/normalize-node-params.ts +123 -2
  184. package/src/seedance-extend-rate.ts +116 -0
  185. package/src/sequence-execution.ts +24 -0
  186. package/src/transcribe-preflight.ts +23 -0
  187. package/src/video-analysis-pricing.ts +28 -15
  188. package/dist/chunk-6M563QE6.js.map +0 -1
  189. package/dist/chunk-6TGB7ECA.cjs.map +0 -1
  190. package/dist/chunk-BLJUCPMV.cjs.map +0 -1
  191. package/dist/chunk-BMJVKYVB.js.map +0 -1
  192. package/dist/chunk-CZ5IQB3L.js.map +0 -1
  193. package/dist/chunk-F6WGGYQW.cjs.map +0 -1
  194. package/dist/chunk-GMBDLNLD.cjs.map +0 -1
  195. package/dist/chunk-GSKLPI3J.cjs.map +0 -1
  196. package/dist/chunk-HSHCCBIV.js.map +0 -1
  197. package/dist/chunk-KMGCHV6O.js.map +0 -1
  198. package/dist/chunk-LH72PQO2.cjs.map +0 -1
  199. package/dist/chunk-M5OCFGHF.cjs.map +0 -1
  200. package/dist/chunk-OV3JTKBY.js.map +0 -1
  201. package/dist/chunk-PSKZKLDG.js.map +0 -1
  202. package/dist/chunk-Q6IES3U2.js.map +0 -1
  203. package/dist/chunk-TM5JYSJF.cjs.map +0 -1
  204. package/dist/chunk-WRSWH7US.cjs.map +0 -1
  205. package/dist/chunk-XBTYGQ6Z.js.map +0 -1
  206. package/dist/chunk-XGGZWA4A.cjs.map +0 -1
  207. package/dist/chunk-XGVJGNZW.cjs.map +0 -1
  208. package/dist/chunk-YUER7TJG.js.map +0 -1
  209. package/dist/chunk-YX6TFX7H.js.map +0 -1
@@ -26,6 +26,16 @@ export {
26
26
  seedanceVideoEditCreditId,
27
27
  tailExtendCreditId,
28
28
  tailExtendResolution,
29
+ seedanceExtendRateCreditId,
30
+ seedanceExtendFullWindowCreditId,
31
+ seedanceExtendSourceCreditId,
32
+ pixverseExtendCreditId,
33
+ pixverseExtendQuality,
34
+ catalogExtendCreditId,
35
+ catalogExtendResolution,
36
+ grokExtendCreditId,
37
+ grokExtendSeconds,
38
+ grokExtendWiredSourceResolution,
29
39
  seedanceExtendCreditId,
30
40
  seedanceExtendResolution,
31
41
  videoGenerationCreditId,
@@ -45,7 +55,21 @@ export {
45
55
  SUNO_VERSION_PRICED_OPERATIONS,
46
56
  SUNO_SELECT_OPERATIONS,
47
57
  } from "../credit-identifiers.js"
48
- export type { NormalizedImageGen, PricedVideoSelection } from "../credit-identifiers.js"
58
+ export type { NormalizedImageGen, PricedVideoSelection, GrokExtendSourceResolution } from "../credit-identifiers.js"
59
+ export {
60
+ SEEDANCE_EXTEND_SENT_PRICED_PROVIDER,
61
+ SEEDANCE_EXTEND_CONTEXT_MAX_SEC,
62
+ SEEDANCE_EXTEND_RATE_SECONDS,
63
+ SEEDANCE_EXTEND_RATE_CREDIT_IDS,
64
+ isSeedanceExtendPricedBySecondsSent,
65
+ isSeedanceExtendRateCreditId,
66
+ seedanceExtendAddedSec,
67
+ seedanceExtendRefusesSource,
68
+ seedanceExtendSourceSec,
69
+ seedanceExtendSentSec,
70
+ seedanceExtendUnits,
71
+ type SentPricedSeedanceExtendProvider,
72
+ } from "../seedance-extend-rate.js"
49
73
  export * from "../credit-estimators/index.js"
50
74
  export {
51
75
  resolveTopazUpscale,
@@ -53,10 +53,23 @@ export {
53
53
  seedream55Resolution,
54
54
  } from "../seedream-5-5.js"
55
55
  export type { Seedream55Model, Seedream55Resolution } from "../seedream-5-5.js"
56
+ export {
57
+ FLUX_3_KLEIN_DEFAULT_RESOLUTION,
58
+ FLUX_3_KLEIN_I2I,
59
+ FLUX_3_KLEIN_MAX_INPUT_IMAGES,
60
+ FLUX_3_KLEIN_RESOLUTIONS,
61
+ FLUX_3_KLEIN_T2I,
62
+ flux3KleinCreditId,
63
+ flux3KleinResolution,
64
+ isFlux3Klein,
65
+ isFlux3KleinI2i,
66
+ } from "../flux-3-klein.js"
67
+ export type { Flux3KleinModel, Flux3KleinResolution } from "../flux-3-klein.js"
56
68
  // The models priced by the input images a run sends, and how a run's images are counted.
57
69
  export {
58
70
  isPricedPerInputImage,
59
71
  isPricedPerInputImageEdit,
72
+ priceReadsInputImages,
60
73
  pricedEstimatedImages,
61
74
  pricedSentImages,
62
75
  } from "../input-image-pricing.js"
@@ -90,7 +90,18 @@ export {
90
90
  EXTEND_VIDEO_PROVIDERS,
91
91
  isSeedanceExtendProvider,
92
92
  isTailExtendProvider,
93
+ PIXVERSE_V6_EXTEND_PROVIDER,
94
+ isPixverseExtendProvider,
95
+ isCatalogExtendProvider,
96
+ extendHasSoundSwitch,
97
+ GROK_EXTEND_PROVIDER,
98
+ isGrokExtendProvider,
99
+ GROK_EXTEND_SOURCE_MODELS,
100
+ isGrokExtendSourceModel,
93
101
  LIP_SYNC_PROVIDERS,
102
+ RETIRED_LIP_SYNC_PROVIDERS,
103
+ retiredLipSyncProviderName,
104
+ retiredLipSyncProviderMessage,
94
105
  REPLICATE_LIP_SYNC_PROVIDERS,
95
106
  FAL_LIP_SYNC_PROVIDERS,
96
107
  VIDEO_INPUT_LIP_SYNC_PROVIDERS,
@@ -247,6 +258,7 @@ export {
247
258
  VIDEO_REF_AUDIO_RULES,
248
259
  checkRefAudioRules,
249
260
  DEFAULT_VIDEO_PROVIDER,
261
+ LEGACY_VIDEO_NODE_DEFAULT_PROVIDER,
250
262
  DEFAULT_VIDEO_DURATION_SEC,
251
263
  applyDefaultVideoSelection,
252
264
  PRICING_DEFAULT_DURATION_SEC,
@@ -314,6 +326,9 @@ export type {
314
326
  ExtendVideoProvider,
315
327
  SeedanceExtendProvider,
316
328
  TailExtendProvider,
329
+ PixverseExtendProvider,
330
+ CatalogExtendProvider,
331
+ GrokExtendProvider,
317
332
  FaceSwapProvider,
318
333
  LipSyncProvider,
319
334
  MotionTransferProviderType,
@@ -194,6 +194,7 @@ export {
194
194
  transcribeTranslationRefusal,
195
195
  transcribeTargetLanguageOf,
196
196
  findWordlessTranscriptFeeds,
197
+ transcribeNodeReturnsWords,
197
198
  } from "../transcribe-preflight.js"
198
199
  export type { PreflightGraphNode, PreflightGraphEdge, WordlessTranscriptFeed } from "../transcribe-preflight.js"
199
200
  export {
@@ -224,6 +225,7 @@ export {
224
225
  PHOTO_AUTO_ASPECT_NODE_TYPES,
225
226
  nodeAspectRatio,
226
227
  normalizeNodeModelParams,
228
+ withListedReferenceTaskTypes,
227
229
  describeNodeAdjustments,
228
230
  } from "../normalize-node-params.js"
229
231
  export type { NodeParamAdjustment, NormalizedNodes } from "../normalize-node-params.js"
@@ -40,4 +40,4 @@ export {
40
40
  STUDIO_KEYFRAME_REVIEW_KEYS,
41
41
  STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS,
42
42
  } from "../studio-transient.js"
43
- export { STUDIO_DEPENDENT_FRAMES_CAPABILITY, SequenceExecutionRequiredError, requiresSequenceExecution, assertCanvasExecutionAllowed } from "../sequence-execution"
43
+ export { STUDIO_DEPENDENT_FRAMES_CAPABILITY, SequenceExecutionRequiredError, requiresSequenceExecution, assertCanvasExecutionAllowed, isCodecOwnedDocument } from "../sequence-execution"
@@ -0,0 +1,69 @@
1
+ /**
2
+ * FLUX 3 Klein: a text-to-image id and its edit sibling, priced by size alone
3
+ * (1K, 2K or 4K). An edit's reference images cost nothing extra, so the edit
4
+ * id has the same rows as the text-to-image id.
5
+ *
6
+ * Only the ids and levers live in this published package. The rates are
7
+ * `backend/src/ee/billing/flux-3-klein-pricing.ts`.
8
+ *
9
+ * A different model from FLUX 2 Klein (`flux-2-klein`, which runs elsewhere):
10
+ * neither id may join a set keyed on the FLUX 2 family (`isFlux2Model`).
11
+ */
12
+
13
+ export const FLUX_3_KLEIN_T2I = "flux-3-klein"
14
+ export const FLUX_3_KLEIN_I2I = "flux-3-klein-i2i"
15
+ export type Flux3KleinModel = typeof FLUX_3_KLEIN_T2I | typeof FLUX_3_KLEIN_I2I
16
+
17
+ /** The sizes it renders, smallest first. */
18
+ export const FLUX_3_KLEIN_RESOLUTIONS = ["1K", "2K", "4K"] as const
19
+ export type Flux3KleinResolution = (typeof FLUX_3_KLEIN_RESOLUTIONS)[number]
20
+
21
+ /**
22
+ * The size a run renders when it names none: the provider's own default, and
23
+ * the size an unset or unknown value is priced and sent at.
24
+ */
25
+ export const FLUX_3_KLEIN_DEFAULT_RESOLUTION: Flux3KleinResolution = "1K"
26
+
27
+ /** The most reference images one edit takes (`REF_IMAGE_MAX_LIMITS`). */
28
+ export const FLUX_3_KLEIN_MAX_INPUT_IMAGES = 10
29
+
30
+ export function isFlux3Klein(model: unknown): model is Flux3KleinModel {
31
+ return model === FLUX_3_KLEIN_T2I || model === FLUX_3_KLEIN_I2I
32
+ }
33
+
34
+ export function isFlux3KleinI2i(model: unknown): model is typeof FLUX_3_KLEIN_I2I {
35
+ return model === FLUX_3_KLEIN_I2I
36
+ }
37
+
38
+ /**
39
+ * The size a FLUX 3 Klein run is priced and sent at: the one asked for when it
40
+ * is one of its sizes (any case), else the default. Unset is the default.
41
+ */
42
+ export function flux3KleinResolution(resolution: unknown): Flux3KleinResolution {
43
+ const asked = typeof resolution === "string" ? resolution.trim().toUpperCase() : ""
44
+ return FLUX_3_KLEIN_RESOLUTIONS.find((r) => r === asked) ?? FLUX_3_KLEIN_DEFAULT_RESOLUTION
45
+ }
46
+
47
+ /**
48
+ * The price id of a FLUX 3 Klein run: `flux-3-klein:<size>`, or
49
+ * `flux-3-klein-i2i:<size>` for an edit. The bare ids are never built here.
50
+ *
51
+ * A size off its list (a stored node, the multi-model preview pricing one
52
+ * node's data against every model) or none is priced at the default, 1K, which
53
+ * is what the provider renders with none. A text-to-image id sent any image
54
+ * runs on the edit endpoint (the KIE provider swaps it), so it is priced on the
55
+ * edit id whenever `referenceImageCount` is above 0. Every caller passes the
56
+ * images the run sends (`priceReadsInputImages` in `input-image-pricing.ts`: a
57
+ * base image, references, wired images, an entity's source), so the id priced
58
+ * is the id run. Both ids cost the same at each size.
59
+ */
60
+ export function flux3KleinCreditId(
61
+ provider: Flux3KleinModel,
62
+ resolution: unknown,
63
+ referenceImageCount: number | undefined,
64
+ ): string {
65
+ const size = flux3KleinResolution(resolution)
66
+ const images = Number.isFinite(referenceImageCount) ? Math.trunc(referenceImageCount as number) : 0
67
+ const model = provider === FLUX_3_KLEIN_I2I || images > 0 ? FLUX_3_KLEIN_I2I : FLUX_3_KLEIN_T2I
68
+ return `${model}:${size}`
69
+ }
@@ -2,7 +2,9 @@
2
2
  * The image models whose price depends on how many input images a run sends:
3
3
  * GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image and Seedream 5.5. Every place that
4
4
  * prices a run counts those images through here, so a model that joins
5
- * `isPricedPerInputImage` is counted on every path at once.
5
+ * `isPricedPerInputImage` is counted on every path at once. FLUX 3 Klein is
6
+ * counted the same way (`priceReadsInputImages`): its price does not move with
7
+ * the images, but whether any go decides the id it runs, and is priced, on.
6
8
  */
7
9
  import {
8
10
  GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES,
@@ -11,6 +13,7 @@ import {
11
13
  } from "./gpt-image-2-6.js"
12
14
  import { isMinimaxH3Image, isMinimaxH3ImageI2i } from "./minimax-h3-image.js"
13
15
  import { isSeedream55, isSeedream55I2i } from "./seedream-5-5.js"
16
+ import { isFlux3Klein } from "./flux-3-klein.js"
14
17
 
15
18
  /** True for a model whose price counts the input images a run sends. */
16
19
  export function isPricedPerInputImage(model: unknown): boolean {
@@ -22,11 +25,25 @@ export function isPricedPerInputImageEdit(model: unknown): boolean {
22
25
  return typeof model === "string" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model))
23
26
  }
24
27
 
28
+ /**
29
+ * True for a model whose price id reads the input images a run sends: one
30
+ * priced per input image ({@link isPricedPerInputImage}), or FLUX 3 Klein, which
31
+ * runs on its edit id whenever an image goes (its text-to-image endpoint takes
32
+ * none) and is priced on that id, at the same price. Every place that prices a
33
+ * run counts the images through {@link pricedSentImages} and
34
+ * {@link pricedEstimatedImages} for such a model, so the id priced is the id
35
+ * the provider runs.
36
+ */
37
+ export function priceReadsInputImages(model: unknown): boolean {
38
+ return isPricedPerInputImage(model) || isFlux3Klein(model)
39
+ }
40
+
25
41
  /**
26
42
  * The images a Generate Image run sends its provider: its references and, when
27
43
  * it edits a base image, that image too (the worker puts it first, unless it is
28
- * already one of the references). Counted only on a model priced per input
29
- * image; any other model is priced on its references alone, as before.
44
+ * already one of the references). The base is counted only on a model whose
45
+ * price reads the images ({@link priceReadsInputImages}); any other model is
46
+ * priced, and held to its image limit, on its references alone, as before.
30
47
  */
31
48
  export function pricedSentImages(
32
49
  provider: string | undefined,
@@ -34,7 +51,7 @@ export function pricedSentImages(
34
51
  baseImageUrl: unknown,
35
52
  ): number {
36
53
  const countsBase =
37
- isPricedPerInputImage(provider) &&
54
+ priceReadsInputImages(provider) &&
38
55
  typeof baseImageUrl === "string" &&
39
56
  baseImageUrl.length > 0 &&
40
57
  !references.includes(baseImageUrl)
@@ -50,8 +67,8 @@ function namesMoodboard(direction: unknown): boolean {
50
67
  }
51
68
 
52
69
  /**
53
- * The input images a workflow estimate counts for one node on a model priced
54
- * per input image: every list on the node, its source or base image, what is
70
+ * The input images a workflow estimate counts for one node on a model whose
71
+ * price reads them ({@link priceReadsInputImages}): every list on the node, its source or base image, what is
55
72
  * wired in, a moodboard its direction names (at the most a moodboard holds),
56
73
  * and an edit model's own source. An estimate may over-quote, never under.
57
74
  */
package/src/llm-models.ts CHANGED
@@ -87,6 +87,26 @@ export interface LlmModelDef {
87
87
  * any model. Never set together with `structuredOutputMode` (registry test).
88
88
  */
89
89
  structuredOutputHint?: "kie-response-format" | "responses-json-schema"
90
+ /**
91
+ * The KIE lane sends this model's structured calls NO `response_format`: the
92
+ * schema rides the system prompt instead (the one-object rule and the schema,
93
+ * as the KIE Claude lane's prompt-JSON), in the wire form `response_format`
94
+ * sent (keyword-named properties aliased and restored on the answer; Google's
95
+ * compact form), and `llmCompleteStructured` parses, validates and re-asks the
96
+ * answer as it does for any model. When every KIE answer of an unpinned call
97
+ * fails validation, the direct lane, which enforces the schema, is asked once
98
+ * before the call fails. For a model whose KIE endpoint fails a request that
99
+ * carries `response_format`.
100
+ *
101
+ * Per LANE, not per model: `structuredOutputMode` stays, so the trust readers
102
+ * (STRUCTURED_VISION_MODELS, the structured-model filters) and the direct
103
+ * lane's enforced `responseJsonSchema` are unchanged. Nothing reads trust to
104
+ * skip validation, and only an `anthropic-tool` model streams partial values,
105
+ * so a KIE-served answer here is checked like any untrusted one. Only on a
106
+ * `kieFormat: "chat-completions"` model whose wire mode is
107
+ * `kie-response-format` (registry test).
108
+ */
109
+ kieSchemaInPrompt?: true
90
110
  /** If set, fallback to direct Anthropic SDK with this model ID when KIE.ai fails */
91
111
  directFallbackModel?: string
92
112
  /**
@@ -350,6 +370,9 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
350
370
  retired: true,
351
371
  vendor: "google",
352
372
  structuredOutputMode: "kie-response-format",
373
+ // The KIE endpoint is 3.8's, so it takes 3.8's rule: no `response_format`
374
+ // there, the schema in the prompt (see gemini-3.8-flash below).
375
+ kieSchemaInPrompt: true,
353
376
  supportsImages: true,
354
377
  // Google's own cap is 65,536, but the field feeds BOTH lanes and the KIE
355
378
  // flash endpoints cap at 8192 (the measured 3.6 posture) — stay at the
@@ -372,8 +395,9 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
372
395
  series: "Gemini",
373
396
  // Inherits "Newest" from 3.7 (demoted above). Deliberately does NOT name
374
397
  // agentic video: that capability exists only on the direct Google lane
375
- // (Interactions API, not wired here) and the modality caps below withhold
376
- // video — a picker desc must not promise a lever this entry cannot expose.
398
+ // (Interactions API, not wired here). Plain video + audio input is wired
399
+ // (LLM_MODALITY_CAPS below) — a picker desc must not promise a lever this
400
+ // entry cannot expose.
377
401
  desc: "Newest fast Gemini, agentic-tuned",
378
402
  tier: "economy",
379
403
  kieFormat: "chat-completions",
@@ -387,6 +411,16 @@ export const LLM_MODELS: readonly LlmModelDef[] = [
387
411
  // is ENFORCED (the reply came back exact-schema valid, credits_consumed
388
412
  // present) — not merely accepted-and-ignored.
389
413
  structuredOutputMode: "kie-response-format",
414
+ // Since 2026-11-13 the KIE endpoint answers ANY request carrying
415
+ // `response_format` (json_schema strict or not, json_object; any effort or
416
+ // none; with or without media) with HTTP 200 and an in-band
417
+ // `{"code":500}` after ~34 s, while the same request without it answers;
418
+ // 3.6 Flash, 3.1 Pro and Carbon take the same body. So the KIE lane sends
419
+ // the schema in the prompt (measured: a real Video Analysis roll, video
420
+ // included, answered schema-valid that way). The direct lane keeps its
421
+ // enforced `responseJsonSchema` (asked once when a call's KIE answers never
422
+ // validate), and the trust this mode carries stays.
423
+ kieSchemaInPrompt: true,
390
424
  supportsImages: true,
391
425
  // 16384 here, NOT the 8192 its 3.6 / 3.7 siblings sit at. Those two stay at
392
426
  // the KIE-safe intersection because nobody measured their endpoints past
@@ -1268,10 +1302,12 @@ export function structuredWireMode(
1268
1302
  }
1269
1303
 
1270
1304
  /**
1271
- * Does a structured call on `modelId` (unset = `feature`'s default model) put
1272
- * its schema on the wire ({@link structuredWireMode})? What a request's size
1273
- * counts the schema by — a schema that is not sent is not read by the model.
1274
- * A model the registry does not know counts as yes (the larger size).
1305
+ * Does a structured call on `modelId` (unset = `feature`'s default model) send
1306
+ * its schema ({@link structuredWireMode})? On the wire, or in the system prompt
1307
+ * on a lane that carries it there (`kieSchemaInPrompt`): either way the model
1308
+ * reads it, so a request's size counts it. A schema that is not sent is not
1309
+ * read by the model. A model the registry does not know counts as yes (the
1310
+ * larger size).
1275
1311
  */
1276
1312
  export function llmSendsSchema(modelId: string | undefined, feature?: string): boolean {
1277
1313
  const id = modelId || (feature ? LLM_FEATURE_DEFAULTS[feature as LlmFeature] : undefined)
@@ -1532,6 +1568,10 @@ export function defaultReasoningEffort(feature: string, modelId?: string): LlmRe
1532
1568
  * input requires a separate audio-capable model we don't route to today.
1533
1569
  */
1534
1570
  export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean; audio: boolean }> = {
1571
+ // Keeps full caps after KIE dropped its channel (2026-11-13): it stays a
1572
+ // VIDEO_ANALYSIS_LLM_MODELS member as the legacy `fast` backing (below), so a
1573
+ // stored raw `llmModel: "gemini-3-flash"` still resolves and prices under its
1574
+ // own credit family.
1535
1575
  "gemini-3-flash": { image: true, video: true, audio: true },
1536
1576
  "gemini-3.6-flash": { image: true, video: true, audio: true },
1537
1577
  // gemini-3.7-flash is IMAGE-ONLY by DECISION, not omission: full video+audio
@@ -1540,15 +1580,13 @@ export const LLM_MODALITY_CAPS: Record<string, { image: boolean; video: boolean;
1540
1580
  // deferred while the smart-family A/B routes this model internally (#747).
1541
1581
  // Flip these two flags ONLY together with that VA-side decision.
1542
1582
  "gemini-3.7-flash": { image: true, video: false, audio: false },
1543
- // gemini-3.8-flash is IMAGE-ONLY by DECISION, not omission — 3.7's rationale
1544
- // exactly: full video+audio caps would auto-enroll it in
1545
- // VIDEO_ANALYSIS_LLM_MODELS (derived below) and force a video-analysis tier +
1546
- // pricing decision that stays deferred until the 3.8-vs-3.7 analysis A/B
1547
- // concludes. Google's own 3.8 lane DOES understand video (agentic video, via
1548
- // the Interactions API we don't wire) — which is precisely why withholding it
1549
- // has to be a decision rather than a gap. Flip these two flags ONLY together
1550
- // with that VA-side decision.
1551
- "gemini-3.8-flash": { image: true, video: false, audio: false },
1583
+ // gemini-3.8-flash takes video + audio (decided 2026-11-13): it backs the
1584
+ // video-analysis `fast` tier (VIDEO_ANALYSIS_TIERS below) since KIE dropped
1585
+ // gemini-3-flash's channel, which is what enrols it in
1586
+ // VIDEO_ANALYSIS_LLM_MODELS. Its KIE lane reads a video URL sent as an
1587
+ // `image_url` part, the same channel gemini-3-flash used (live-verified
1588
+ // 2026-11-13 with the analysis request: prompt tokens include the clip).
1589
+ "gemini-3.8-flash": { image: true, video: true, audio: true },
1552
1590
  "gemini-3.1-pro": { image: true, video: true, audio: true },
1553
1591
  // gemini-4-argon is IMAGE-ONLY by DECISION, not omission (decided 2026-10-17):
1554
1592
  // the model DOES read video and audio, but full caps would
@@ -1960,7 +1998,7 @@ export const VIDEO_ANALYSIS_LLM_MODELS: string[] = LLM_MODELS
1960
1998
  * VIDEO_ANALYSIS_LLM_MODELS member AND every such model is reachable by a tier,
1961
1999
  * so adding a video model forces a tier decision instead of silently leaking.
1962
2000
  */
1963
- export const VIDEO_ANALYSIS_TIERS = { fast: "gemini-3-flash", pro: "gemini-3.1-pro" } as const
2001
+ export const VIDEO_ANALYSIS_TIERS = { fast: "gemini-3.8-flash", pro: "gemini-3.1-pro" } as const
1964
2002
  export type VideoAnalysisModelTier = keyof typeof VIDEO_ANALYSIS_TIERS
1965
2003
  /**
1966
2004
  * Models that PREVIOUSLY backed a tier, mapped to the tier they backed.
@@ -1981,6 +2019,12 @@ export const VIDEO_ANALYSIS_LEGACY_MODELS: Record<string, VideoAnalysisModelTier
1981
2019
  // belongs here: stored raw `llmModel` values keep resolving and keep pricing
1982
2020
  // under their own credit family.
1983
2021
  "gemini-3.6-flash": "fast",
2022
+ // Backed the fast tier from 2026-07-29 until 2026-11-13, when KIE dropped its
2023
+ // channel (every call answers `code 422 "The channel is not supported"`) and
2024
+ // the fast tier moved to gemini-3.8-flash. Stored raw `llmModel` values keep
2025
+ // resolving and keep pricing under their own credit family; the analysis
2026
+ // engine serves their rolls with the current fast model.
2027
+ "gemini-3-flash": "fast",
1984
2028
  }
1985
2029
  /**
1986
2030
  * MIXED tiers — advanced multi-engine analysis plans whose identifier resolves