@nodaro/shared 3.61.0 → 3.63.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-4KYLNTR7.cjs → chunk-2PU3AGGS.cjs} +27 -4
- package/dist/chunk-2PU3AGGS.cjs.map +1 -0
- package/dist/{chunk-43TGSZRJ.js → chunk-2QKF7M2Z.js} +3 -3
- package/dist/{chunk-43TGSZRJ.js.map → chunk-2QKF7M2Z.js.map} +1 -1
- package/dist/{chunk-B6BG3LV2.js → chunk-34QLPTSA.js} +3 -3
- package/dist/{chunk-B6BG3LV2.js.map → chunk-34QLPTSA.js.map} +1 -1
- package/dist/chunk-3K24DWOH.js +453 -0
- package/dist/chunk-3K24DWOH.js.map +1 -0
- package/dist/{chunk-IRQ3SPX7.js → chunk-4DVWXEB6.js} +23 -4
- package/dist/chunk-4DVWXEB6.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4MMZD63H.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4MMZD63H.js.map} +1 -1
- package/dist/{chunk-MQZRQ5LM.cjs → chunk-63H4C56Q.cjs} +8 -8
- package/dist/{chunk-MQZRQ5LM.cjs.map → chunk-63H4C56Q.cjs.map} +1 -1
- package/dist/{chunk-IVXSNW2B.cjs → chunk-6BZC2ZHC.cjs} +18 -332
- package/dist/chunk-6BZC2ZHC.cjs.map +1 -0
- package/dist/{chunk-M3SXUUWC.cjs → chunk-6FQBKI2A.cjs} +4 -11
- package/dist/chunk-6FQBKI2A.cjs.map +1 -0
- package/dist/{chunk-673E4KYC.js → chunk-6M563QE6.js} +134 -8
- package/dist/chunk-6M563QE6.js.map +1 -0
- package/dist/chunk-6TGB7ECA.cjs +48 -0
- package/dist/chunk-6TGB7ECA.cjs.map +1 -0
- package/dist/{chunk-XUJC6GHE.cjs → chunk-6XUG4L7X.cjs} +6 -6
- package/dist/{chunk-XUJC6GHE.cjs.map → chunk-6XUG4L7X.cjs.map} +1 -1
- package/dist/{chunk-XZKFZMRT.cjs → chunk-77WU3V3J.cjs} +6 -6
- package/dist/{chunk-XZKFZMRT.cjs.map → chunk-77WU3V3J.cjs.map} +1 -1
- package/dist/{chunk-ZFJN23V4.cjs → chunk-A2PX5IRC.cjs} +4 -4
- package/dist/{chunk-ZFJN23V4.cjs.map → chunk-A2PX5IRC.cjs.map} +1 -1
- package/dist/{chunk-ZDBPQBAA.js → chunk-AE3AAJ4O.js} +3 -3
- package/dist/{chunk-ZDBPQBAA.js.map → chunk-AE3AAJ4O.js.map} +1 -1
- package/dist/chunk-ALRXY4QH.cjs +13 -0
- package/dist/chunk-ALRXY4QH.cjs.map +1 -0
- package/dist/{chunk-UARGJ5IZ.js → chunk-BMJVKYVB.js} +56 -12
- package/dist/chunk-BMJVKYVB.js.map +1 -0
- package/dist/{chunk-6XVHYD5R.js → chunk-CLAKSLXF.js} +4 -9
- package/dist/chunk-CLAKSLXF.js.map +1 -0
- package/dist/chunk-CTANEPMY.js +61 -0
- package/dist/chunk-CTANEPMY.js.map +1 -0
- package/dist/chunk-CZ5IQB3L.js +42 -0
- package/dist/chunk-CZ5IQB3L.js.map +1 -0
- package/dist/{chunk-WGKAOUEQ.cjs → chunk-D34K455O.cjs} +3 -2
- package/dist/chunk-D34K455O.cjs.map +1 -0
- package/dist/chunk-EPXGG27L.js +331 -0
- package/dist/chunk-EPXGG27L.js.map +1 -0
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-F6WGGYQW.cjs} +167 -3
- package/dist/chunk-F6WGGYQW.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-FXGNRYQQ.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-FXGNRYQQ.js.map} +1 -1
- package/dist/{chunk-ZNM2LW3D.cjs → chunk-GMBDLNLD.cjs} +105 -56
- package/dist/chunk-GMBDLNLD.cjs.map +1 -0
- package/dist/{chunk-NJVOJXBS.cjs → chunk-GSKLPI3J.cjs} +104 -49
- package/dist/chunk-GSKLPI3J.cjs.map +1 -0
- package/dist/{chunk-EWS2VFO4.js → chunk-HBXF6RUU.js} +4 -4
- package/dist/{chunk-EWS2VFO4.js.map → chunk-HBXF6RUU.js.map} +1 -1
- package/dist/{chunk-MOMFX32D.js → chunk-HWQ2SYNA.js} +194 -325
- package/dist/chunk-HWQ2SYNA.js.map +1 -0
- package/dist/{chunk-SCMTN57Y.js → chunk-IY3Y462W.js} +3 -3
- package/dist/{chunk-SCMTN57Y.js.map → chunk-IY3Y462W.js.map} +1 -1
- package/dist/{chunk-ZZGQRRN7.js → chunk-KCZHQH2O.js} +6 -306
- package/dist/chunk-KCZHQH2O.js.map +1 -0
- package/dist/{chunk-XROE3CAS.cjs → chunk-KHH54GRP.cjs} +120 -79
- package/dist/chunk-KHH54GRP.cjs.map +1 -0
- package/dist/{chunk-FVVD6XY2.js → chunk-KL6GAYTT.js} +13 -4
- package/dist/chunk-KL6GAYTT.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-KMGCHV6O.js} +163 -4
- package/dist/chunk-KMGCHV6O.js.map +1 -0
- package/dist/{chunk-FMXFHJWX.cjs → chunk-L2TVY6XN.cjs} +4 -4
- package/dist/{chunk-FMXFHJWX.cjs.map → chunk-L2TVY6XN.cjs.map} +1 -1
- package/dist/{chunk-FQXRYPCX.cjs → chunk-LH72PQO2.cjs} +505 -68
- package/dist/chunk-LH72PQO2.cjs.map +1 -0
- package/dist/chunk-LMAQUR55.cjs +506 -0
- package/dist/chunk-LMAQUR55.cjs.map +1 -0
- package/dist/{chunk-F5YEMSNK.cjs → chunk-M5OCFGHF.cjs} +571 -30
- package/dist/chunk-M5OCFGHF.cjs.map +1 -0
- package/dist/{chunk-VOWJCUMR.js → chunk-MD4XHED4.js} +3 -3
- package/dist/{chunk-VOWJCUMR.js.map → chunk-MD4XHED4.js.map} +1 -1
- package/dist/chunk-N5HH46JF.cjs +68 -0
- package/dist/chunk-N5HH46JF.cjs.map +1 -0
- package/dist/{chunk-G4XWVWRI.js → chunk-NIAFR5EE.js} +5 -4
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-SWVGHAYO.js → chunk-O7RZRUMZ.js} +110 -74
- package/dist/chunk-O7RZRUMZ.js.map +1 -0
- package/dist/{chunk-LLOIAGFB.js → chunk-OV3JTKBY.js} +449 -51
- package/dist/chunk-OV3JTKBY.js.map +1 -0
- package/dist/{chunk-A3FHTSLB.js → chunk-PSKZKLDG.js} +550 -31
- package/dist/chunk-PSKZKLDG.js.map +1 -0
- package/dist/{chunk-VB2ARGQ6.js → chunk-RGNHHIMN.js} +3 -3
- package/dist/chunk-RGNHHIMN.js.map +1 -0
- package/dist/chunk-SMOO5FAH.js +10 -0
- package/dist/chunk-SMOO5FAH.js.map +1 -0
- package/dist/{chunk-5XRRENHD.cjs → chunk-TM5JYSJF.cjs} +170 -17
- package/dist/chunk-TM5JYSJF.cjs.map +1 -0
- package/dist/{chunk-PONP5J5E.cjs → chunk-V24EPI5N.cjs} +13 -3
- package/dist/chunk-V24EPI5N.cjs.map +1 -0
- package/dist/{chunk-RQ4F3AJH.cjs → chunk-V5EEQR2U.cjs} +21 -21
- package/dist/{chunk-RQ4F3AJH.cjs.map → chunk-V5EEQR2U.cjs.map} +1 -1
- package/dist/chunk-WZVIBAKN.cjs +351 -0
- package/dist/chunk-WZVIBAKN.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-X5BAFW3Q.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-X5BAFW3Q.cjs.map} +1 -1
- package/dist/{chunk-RUHKBEFF.js → chunk-XBTYGQ6Z.js} +63 -10
- package/dist/chunk-XBTYGQ6Z.js.map +1 -0
- package/dist/{chunk-JHTT2V4A.cjs → chunk-XGGZWA4A.cjs} +118 -52
- package/dist/chunk-XGGZWA4A.cjs.map +1 -0
- package/dist/{chunk-5I4T4QR5.cjs → chunk-XGVJGNZW.cjs} +5 -5
- package/dist/{chunk-5I4T4QR5.cjs.map → chunk-XGVJGNZW.cjs.map} +1 -1
- package/dist/{chunk-7ARKVJTN.cjs → chunk-Y35JQPT6.cjs} +228 -383
- package/dist/chunk-Y35JQPT6.cjs.map +1 -0
- package/dist/{chunk-AFQFGZN7.cjs → chunk-Y4GCJJPF.cjs} +8 -6
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-C77F4ZTL.js → chunk-YUER7TJG.js} +3 -3
- package/dist/{chunk-C77F4ZTL.js.map → chunk-YUER7TJG.js.map} +1 -1
- package/dist/{chunk-HGI2VKIV.js → chunk-YX6TFX7H.js} +67 -14
- package/dist/chunk-YX6TFX7H.js.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-ZPE2ZTJ4.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-ZPE2ZTJ4.cjs.map} +1 -1
- package/dist/entries/apps.cjs +44 -44
- package/dist/entries/apps.js +9 -9
- package/dist/entries/credits.cjs +286 -153
- package/dist/entries/credits.d.cts +254 -5
- package/dist/entries/credits.d.ts +254 -5
- package/dist/entries/credits.js +14 -9
- package/dist/entries/entities.cjs +188 -143
- package/dist/entries/entities.d.cts +122 -1
- package/dist/entries/entities.d.ts +122 -1
- package/dist/entries/entities.js +2 -1
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +85 -5
- package/dist/entries/llm-models.d.ts +85 -5
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +92 -87
- package/dist/entries/media.d.cts +19 -1
- package/dist/entries/media.d.ts +19 -1
- package/dist/entries/media.js +3 -2
- package/dist/entries/model-catalog.cjs +211 -103
- package/dist/entries/model-catalog.d.cts +135 -19
- package/dist/entries/model-catalog.d.ts +135 -19
- package/dist/entries/model-catalog.js +5 -5
- package/dist/entries/models.cjs +504 -295
- package/dist/entries/models.d.cts +71 -4
- package/dist/entries/models.d.ts +71 -4
- package/dist/entries/models.js +7 -6
- package/dist/entries/nodes.cjs +249 -233
- package/dist/entries/nodes.d.cts +35 -6
- package/dist/entries/nodes.d.ts +35 -6
- package/dist/entries/nodes.js +10 -10
- package/dist/entries/pipeline.cjs +152 -152
- package/dist/entries/pipeline.d.cts +3 -2
- package/dist/entries/pipeline.d.ts +3 -2
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +316 -208
- package/dist/entries/video.d.cts +490 -99
- package/dist/entries/video.d.ts +490 -99
- package/dist/entries/video.js +8 -4
- package/dist/entries/workflow.cjs +102 -102
- package/dist/entries/workflow.d.cts +5 -4
- package/dist/entries/workflow.d.ts +5 -4
- package/dist/entries/workflow.js +2 -2
- package/dist/{gpt-image-2-6-BeZdT-pW.d.cts → gpt-image-2-6-jIRQBRag.d.cts} +6 -0
- package/dist/{gpt-image-2-6-BeZdT-pW.d.ts → gpt-image-2-6-jIRQBRag.d.ts} +6 -0
- package/dist/index.cjs +2727 -2092
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +30 -27
- package/dist/{model-catalog-BgSvskgY.d.ts → model-catalog-C_Eo35tL.d.cts} +158 -14
- package/dist/{model-catalog-BgSvskgY.d.cts → model-catalog-C_Eo35tL.d.ts} +158 -14
- package/dist/{model-constants-DHd9jwQ7.d.cts → model-constants-Bg4ccSQb.d.ts} +427 -34
- package/dist/{model-constants-DHd9jwQ7.d.ts → model-constants-DWcxOmaY.d.cts} +427 -34
- package/package.json +1 -1
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +194 -0
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +118 -0
- package/src/__tests__/fixtures/root-exports.baseline.json +68 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +4 -1
- package/src/__tests__/grok-video-15-catalog.test.ts +189 -0
- package/src/__tests__/gvp-supported-providers.test.ts +32 -4
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +132 -3
- package/src/__tests__/llm-price-key.test.ts +152 -1
- package/src/__tests__/minimax-h3-image.test.ts +140 -0
- package/src/__tests__/model-makers.test.ts +49 -11
- package/src/__tests__/model-tree.test.ts +13 -0
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/normalize-node-params.test.ts +25 -0
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- package/src/__tests__/retired-video-provider.test.ts +15 -5
- package/src/__tests__/seedance-25-catalog-modes.test.ts +1 -1
- package/src/__tests__/seedance-task-type.test.ts +188 -0
- package/src/__tests__/seedream-5-5.test.ts +117 -0
- package/src/__tests__/transcribe-capabilities.test.ts +39 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/unit-contract-compose.test.ts +27 -1
- package/src/__tests__/unit-contracts.test.ts +20 -6
- package/src/__tests__/upscale-factors.test.ts +107 -0
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-character-refs.test.ts +20 -2
- package/src/__tests__/video-collapse-parity.test.ts +19 -0
- package/src/__tests__/video-overlay-geometry.test.ts +68 -0
- package/src/__tests__/video-overlay-layer-plan.test.ts +3 -4
- package/src/__tests__/video-overlay-layouts.test.ts +529 -0
- package/src/__tests__/video-overlay-pricing.test.ts +61 -0
- package/src/__tests__/video-overlay-validate.test.ts +128 -0
- package/src/__tests__/video-overlay-wired-kind.test.ts +207 -0
- package/src/__tests__/video-overlay.test.ts +280 -194
- package/src/__tests__/video-ref-limits.test.ts +2 -1
- package/src/__tests__/video-reference-only.test.ts +6 -2
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-start-frame-only.test.ts +98 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/__tests__/wired-character-names.test.ts +220 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/index.ts +18 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-estimators/video-overlay.ts +70 -0
- package/src/credit-identifiers.ts +183 -16
- package/src/entity-image-url.ts +21 -0
- package/src/entries/credits.ts +26 -1
- package/src/entries/entities.ts +14 -0
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +44 -1
- package/src/entries/models.ts +69 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/video.ts +7 -1
- package/src/freecut-protocol.ts +8 -0
- package/src/generated/unit-contracts.ts +8 -1
- package/src/gpt-image-2-6.ts +6 -0
- package/src/input-image-pricing.ts +76 -0
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +249 -4
- package/src/mask-composite.ts +11 -0
- package/src/minimax-h3-image.ts +61 -0
- package/src/model-catalog.ts +604 -40
- package/src/model-constants.ts +860 -55
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +15 -2
- package/src/node-execution-state.ts +4 -3
- package/src/normalize-node-params.ts +49 -1
- package/src/producer-types.ts +23 -1
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-task-type.ts +37 -0
- package/src/seedream-5-5.ts +45 -0
- package/src/transcribe-preflight.ts +58 -7
- package/src/unit-contract-compose.ts +4 -1
- package/src/upscale-factors.ts +111 -0
- package/src/video-character-refs.ts +7 -4
- package/src/video-duration.ts +9 -0
- package/src/video-overlay-geometry.ts +99 -0
- package/src/video-overlay-input.ts +25 -0
- package/src/video-overlay-layout-ids.ts +48 -0
- package/src/video-overlay-layouts.ts +315 -0
- package/src/video-overlay-validate.ts +223 -0
- package/src/video-overlay-video-layers.ts +304 -0
- package/src/video-overlay.ts +165 -297
- package/src/video-ui-defaults.ts +11 -7
- package/src/video-upscale-params.ts +67 -0
- package/src/wired-character-names.ts +202 -0
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-4KYLNTR7.cjs.map +0 -1
- package/dist/chunk-5XRRENHD.cjs.map +0 -1
- package/dist/chunk-673E4KYC.js.map +0 -1
- package/dist/chunk-6XVHYD5R.js.map +0 -1
- package/dist/chunk-7ARKVJTN.cjs.map +0 -1
- package/dist/chunk-7WGKP3EU.js +0 -23
- package/dist/chunk-7WGKP3EU.js.map +0 -1
- package/dist/chunk-A3FHTSLB.js.map +0 -1
- package/dist/chunk-AFQFGZN7.cjs.map +0 -1
- package/dist/chunk-F5YEMSNK.cjs.map +0 -1
- package/dist/chunk-FQXRYPCX.cjs.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-FVVD6XY2.js.map +0 -1
- package/dist/chunk-G4XWVWRI.js.map +0 -1
- package/dist/chunk-HGI2VKIV.js.map +0 -1
- package/dist/chunk-IRQ3SPX7.js.map +0 -1
- package/dist/chunk-IVXSNW2B.cjs.map +0 -1
- package/dist/chunk-JHTT2V4A.cjs.map +0 -1
- package/dist/chunk-KHZAQGRP.js +0 -17
- package/dist/chunk-KHZAQGRP.js.map +0 -1
- package/dist/chunk-LLOIAGFB.js.map +0 -1
- package/dist/chunk-M3SXUUWC.cjs.map +0 -1
- package/dist/chunk-MOMFX32D.js.map +0 -1
- package/dist/chunk-NCOGGRRP.cjs +0 -27
- package/dist/chunk-NCOGGRRP.cjs.map +0 -1
- package/dist/chunk-NJVOJXBS.cjs.map +0 -1
- package/dist/chunk-PONP5J5E.cjs.map +0 -1
- package/dist/chunk-RUHKBEFF.js.map +0 -1
- package/dist/chunk-SWVGHAYO.js.map +0 -1
- package/dist/chunk-UARGJ5IZ.js.map +0 -1
- package/dist/chunk-VB2ARGQ6.js.map +0 -1
- package/dist/chunk-WGKAOUEQ.cjs.map +0 -1
- package/dist/chunk-XROE3CAS.cjs.map +0 -1
- package/dist/chunk-ZLDFPVVI.cjs +0 -19
- package/dist/chunk-ZLDFPVVI.cjs.map +0 -1
- package/dist/chunk-ZNM2LW3D.cjs.map +0 -1
- package/dist/chunk-ZZGQRRN7.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/entity-image-handle.ts"],"names":[],"mappings":";AAcO,IAAM,yBAAA,uBAAqD,GAAA,CAAI;AAAA,EACpE,WAAA;AAAA,EACA,UAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAC;AAWM,IAAM,8CAAmD,IAAI,GAAA,CAAI,CAAC,OAAA,EAAS,SAAS,CAAC;AAY5F,IAAM,6BAAA,GAAkE;AAAA,EACtE,WAAA,EAAa,cAAA;AAAA,EACb,WAAA,EAAa,cAAA;AAAA,EACb,WAAA,EAAa,cAAA;AAAA,EACb,UAAA,EAAY;AACd,CAAA;AAWA,IAAM,6BAAA,GAAkE;AAAA,EACtE,IAAA,EAAM,cAAA;AAAA,EACN,KAAA,EAAO,cAAA;AAAA,EACP,KAAA,EAAO;AACT,CAAA;AACA,IAAM,uCAAuB,IAAI,GAAA,CAAI,CAAC,iBAAA,EAAmB,kBAAkB,CAAC,CAAA;AAgBrE,IAAM,0BAAA,GAAyF,OAAO,MAAA,CAAO;AAAA;AAAA,EAElH,eAAe,MAAA,CAAO,MAAA,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,IAAkB,EAAE,CAAA;AACpE,IAAA,IAAI,WAAW,OAAO,SAAA;AAAA,EACxB;AACA,EAAA,IAAI,oBAAA,CAAqB,GAAA,CAAI,aAAA,IAAiB,EAAE,CAAA,EAAG;AACjD,IAAA,MAAM,SAAA,GAAY,6BAAA,CAA8B,cAAA,IAAkB,EAAE,CAAA;AACpE,IAAA,IAAI,WAAW,OAAO,SAAA;AAAA,EACxB;AACA,EAAA,OAAO,aAAA,IAAiB,EAAA;AAC1B;AAcO,SAAS,YAAA,CACd,MAAA,EACA,cAAA,EACA,aAAA,EACQ;AACR,EAAA,OAAO,cAAA,KAAmB,WAAW,yBAAA,CAA0B,GAAA,CAAI,iBAAiB,EAAE,CAAA,GAClF,CAAA,EAAG,MAAM,CAAA,OAAA,CAAA,GACT,MAAA;AACN","file":"chunk-CTANEPMY.js","sourcesContent":["/**\n * Entity node types that expose a plain `image` source handle (emitting the\n * portrait URL) in addition to their identity `*Ref` handle. When a wire leaves\n * the `image` handle, the entity is treated as a plain image PRODUCER\n * (substituted to \"upload-image\") so it reaches image inputs and lists exactly\n * like generate-image / upload-image, while the `*Ref` handle stays identity.\n *\n * SINGLE SOURCE OF TRUTH — consumed by:\n * - frontend connection validation (drop validator, drag-glow, popover),\n * - frontend run assemblers (execute-node, video-prompt-assembly),\n * - frontend config-panel reference preview builders,\n * - backend payload-builder identity-injection guards.\n * Add future per-handle output-type remaps HERE so every surface inherits them.\n */\nexport const ENTITY_IMAGE_HANDLE_TYPES: ReadonlySet<string> = new Set([\n \"character\",\n \"location\",\n \"object\",\n \"creature\",\n])\n\n/**\n * Aggregate node types (Group / Collect) whose source handles are typed LANES\n * — `out-text` / `out-image` / `out-video` / `out-audio` — each emitting that\n * media type. Like an entity's `image` handle, a wire leaving a lane is a plain\n * producer of that lane's type, so it must reach the typed inputs of every\n * consumer (Image Collage, Combine Videos, Merge Lists, prompts, …) exactly as\n * an upload node of that type would. Neither node type is in any producer set\n * itself: the NODE emits nothing, its LANES do.\n */\nexport const AGGREGATE_LANE_SOURCE_TYPES: ReadonlySet<string> = new Set([\"group\", \"collect\"])\n\n/**\n * The plain producer each aggregate lane behaves as. `upload-*` are the\n * canonical single-media producers present in every typed accepts set\n * (IMAGE/VIDEO/AUDIO_PRODUCER_TYPES). `out-text` maps to `list`, not\n * `text-prompt`: the lane is a LIST of texts, so it must reach both prompt\n * inputs (TEXT_PRODUCER_TYPES) and the list consumers (Merge Lists / Sort /\n * Dedup / Selector — LIST_PRODUCER_TYPES), exactly like a List text column.\n * (`list` is also a DYNAMIC producer, so the text lane is admitted at media\n * inputs too — the same latitude a List column already has on canvas.)\n */\nconst AGGREGATE_LANE_EFFECTIVE_TYPE: Readonly<Record<string, string>> = {\n \"out-image\": \"upload-image\",\n \"out-video\": \"upload-video\",\n \"out-audio\": \"upload-audio\",\n \"out-text\": \"list\",\n}\n\n/**\n * Meta Ads scraper: besides its `json` handle it emits the FEATURED ad's\n * copy, creative image and creative video on typed handles. Each behaves as\n * the canonical single-media producer of that type — `text` maps to\n * `combine-text` (ONE string, not a list), so it reaches prompt inputs but\n * not the list consumers.\n */\n// Shared by every scraper node (Meta Ads, Instagram, …): the typed\n// text / image / video handles emit the canonical single-media producers.\nconst SCRAPER_HANDLE_EFFECTIVE_TYPE: Readonly<Record<string, string>> = {\n text: \"combine-text\",\n image: \"upload-image\",\n video: \"upload-video\",\n}\nconst SCRAPER_SOURCE_TYPES = new Set([\"meta-ads-scrape\", \"instagram-scrape\"])\n\n/**\n * Output pips that emit a plain medium although their node is no producer of\n * it: node type → pip → the canonical single-media producer the pip behaves\n * as. A row here is NOT an identity remap (`ENTITY_IMAGE_HANDLE_TYPES`, which\n * the identity gates and `sourceRefKey` read) and adds the node to no producer\n * set: only a wire leaving THIS pip is that producer, so the node's other pips\n * (UGC Creator's `creator` record) stay what they are. A frontend guard holds\n * every row to a declared output drawn in that medium's colour.\n *\n * Both engines' input resolvers route a wire leaving one of these pips as the\n * producer it names, and the editor's validators judge it the same way. A\n * UGC wire input (a pip that reads one output of one UGC node) still judges\n * the RAW node and pip, so a text pip keeps feeding the UGC input made for it.\n */\nexport const OUTPUT_PIP_EFFECTIVE_TYPES: Readonly<Record<string, Readonly<Record<string, string>>>> = Object.freeze({\n // UGC Creator's `image`: the creator's first image, for any image input.\n \"ugc-creator\": Object.freeze({ image: \"upload-image\" }),\n // Site Capture's `image`: its section stills — the first on a plain wire, each or all on an Each / Bundle wire.\n \"site-capture\": Object.freeze({ image: \"upload-image\" }),\n // The UGC nodes' plain-text pips — the script's product category, the clips'\n // transcript, the cards' Notes — are one text each (`combine-text`: one\n // string, not a list): they reach text and prompt inputs, never a JSON input.\n \"ugc-script\": Object.freeze({ category: \"combine-text\" }),\n \"ugc-clips\": Object.freeze({ transcript: \"combine-text\" }),\n \"ugc-cards\": Object.freeze({ report: \"combine-text\" }),\n})\n\nconst own = <T>(table: Readonly<Record<string, T>>, key: string): T | undefined =>\n Object.hasOwn(table, key) ? table[key] : undefined\n\n/**\n * The source type a legacy-handle classifier judges an edge by: the raw node\n * type, unless the edge leaves an `OUTPUT_PIP_EFFECTIVE_TYPES` pip. Only that\n * table: the entity, aggregate and scraper remaps of `resolveEffectiveSourceType`\n * keep the classifiers' rewiring of existing graphs as it was. Read by the\n * editor's load-time pass and the server's write-time normalizer alike.\n */\nexport function outputPipSourceType(\n rawSourceType: string | undefined | null,\n sourceHandleId: string | undefined | null,\n): string {\n const type = rawSourceType ?? \"\"\n const pips = own(OUTPUT_PIP_EFFECTIVE_TYPES, type)\n return (pips && typeof sourceHandleId === \"string\" ? own(pips, sourceHandleId) : undefined) ?? type\n}\n\n/**\n * The effective output TYPE a given source handle emits. Returns the raw node\n * type for every `(type, handle)` pair EXCEPT:\n * - an entity `image` handle → `\"upload-image\"` (a plain image producer);\n * - an aggregate (group / collect) lane handle → the plain producer of that\n * lane's media type (see AGGREGATE_LANE_EFFECTIVE_TYPE);\n * - a Meta Ads `text` / `image` / `video` handle → the plain producer of\n * that type (see META_ADS_HANDLE_EFFECTIVE_TYPE); its `json` handle keeps\n * the raw type;\n * - an `OUTPUT_PIP_EFFECTIVE_TYPES` pip → the producer its row names.\n * Pure — safe for both frontend and backend.\n */\nexport function resolveEffectiveSourceType(\n rawSourceType: string | undefined | null,\n sourceHandleId: string | undefined | null,\n): string {\n if (sourceHandleId === \"image\" && ENTITY_IMAGE_HANDLE_TYPES.has(rawSourceType ?? \"\")) {\n return \"upload-image\"\n }\n const pipType = outputPipSourceType(rawSourceType, sourceHandleId)\n if (pipType !== (rawSourceType ?? \"\")) return pipType\n if (AGGREGATE_LANE_SOURCE_TYPES.has(rawSourceType ?? \"\")) {\n const effective = AGGREGATE_LANE_EFFECTIVE_TYPE[sourceHandleId ?? \"\"]\n if (effective) return effective\n }\n if (SCRAPER_SOURCE_TYPES.has(rawSourceType ?? \"\")) {\n const effective = SCRAPER_HANDLE_EFFECTIVE_TYPE[sourceHandleId ?? \"\"]\n if (effective) return effective\n }\n return rawSourceType ?? \"\"\n}\n\n/**\n * The ref-assembly map key (and `ConnectedReference.id`) for a wired source.\n *\n * An entity's `image` handle emits a plain image that is DISTINCT from the\n * entity's identity `*Ref` handle, yet both edges carry the SAME source node\n * id. Every ref-assembly map that keyed by the bare node id therefore had the\n * two edges collide — silently dropping one (identity → a literal `@abi:N`\n * token + lost character, or the plain image → missing from the picker),\n * non-deterministically by edge order. Scoping the entity-`image`-handle ref to\n * `${nodeId}::image` keeps the two refs distinct so BOTH survive. Every other\n * (type, handle) keeps the bare node id, so nothing else changes.\n */\nexport function sourceRefKey(\n nodeId: string,\n sourceHandleId: string | undefined | null,\n rawSourceType: string | undefined | null,\n): string {\n return sourceHandleId === \"image\" && ENTITY_IMAGE_HANDLE_TYPES.has(rawSourceType ?? \"\")\n ? `${nodeId}::image`\n : nodeId\n}\n"]}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { isGptImage26Tiered, isGptImage26I2i, GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES } from './chunk-RGNHHIMN.js';
|
|
2
|
+
import { isMinimaxH3Image, isSeedream55, isMinimaxH3ImageI2i, isSeedream55I2i, getModel } from './chunk-PSKZKLDG.js';
|
|
3
|
+
|
|
4
|
+
// src/input-image-pricing.ts
|
|
5
|
+
function isPricedPerInputImage(model) {
|
|
6
|
+
return typeof model === "string" && (isGptImage26Tiered(model) || isMinimaxH3Image(model) || isSeedream55(model));
|
|
7
|
+
}
|
|
8
|
+
function isPricedPerInputImageEdit(model) {
|
|
9
|
+
return typeof model === "string" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model));
|
|
10
|
+
}
|
|
11
|
+
function pricedSentImages(provider, references, baseImageUrl) {
|
|
12
|
+
const countsBase = isPricedPerInputImage(provider) && typeof baseImageUrl === "string" && baseImageUrl.length > 0 && !references.includes(baseImageUrl);
|
|
13
|
+
return references.length + (countsBase ? 1 : 0);
|
|
14
|
+
}
|
|
15
|
+
function namesMoodboard(direction) {
|
|
16
|
+
if (direction === null || typeof direction !== "object") return false;
|
|
17
|
+
const style = direction.style;
|
|
18
|
+
return (Array.isArray(style) ? style : [style]).some(
|
|
19
|
+
(value) => typeof value === "string" && value.startsWith("moodboard:")
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
function pricedEstimatedImages(model, data, wiredImages) {
|
|
23
|
+
const listed = (v) => Array.isArray(v) ? v.length : 0;
|
|
24
|
+
const single = (v) => typeof v === "string" && v.length > 0 ? 1 : 0;
|
|
25
|
+
return listed(data.referenceImageUrls) + listed(data.characterDefinitionIds) + listed(data.extraRefs) + single(data.referenceImageUrl) + single(data.baseImageUrl) + single(data.sourceImageUrl) + wiredImages + (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) + (isPricedPerInputImageEdit(model) ? 1 : 0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// src/safety-retry-policy.ts
|
|
29
|
+
function safetyRetryPolicy(modelId) {
|
|
30
|
+
const entry = getModel(modelId);
|
|
31
|
+
const safetyFilter = entry?.safetyFilter;
|
|
32
|
+
if (!safetyFilter?.stochastic) return { maxAttempts: 1 };
|
|
33
|
+
const fallback = safetyFilter.fallback;
|
|
34
|
+
if (fallback && getModel(fallback)) {
|
|
35
|
+
return { maxAttempts: 2, fallback };
|
|
36
|
+
}
|
|
37
|
+
return { maxAttempts: 2 };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { isPricedPerInputImage, isPricedPerInputImageEdit, pricedEstimatedImages, pricedSentImages, safetyRetryPolicy };
|
|
41
|
+
//# sourceMappingURL=chunk-CZ5IQB3L.js.map
|
|
42
|
+
//# sourceMappingURL=chunk-CZ5IQB3L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/input-image-pricing.ts","../src/safety-retry-policy.ts"],"names":[],"mappings":";;;;AAeO,SAAS,sBAAsB,KAAA,EAAyB;AAC7D,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,KAAa,kBAAA,CAAmB,KAAK,KAAK,gBAAA,CAAiB,KAAK,CAAA,IAAK,YAAA,CAAa,KAAK,CAAA,CAAA;AACjH;AAGO,SAAS,0BAA0B,KAAA,EAAyB;AACjE,EAAA,OAAO,OAAO,KAAA,KAAU,QAAA,KAAa,eAAA,CAAgB,KAAK,KAAK,mBAAA,CAAoB,KAAK,CAAA,IAAK,eAAA,CAAgB,KAAK,CAAA,CAAA;AACpH;AAQO,SAAS,gBAAA,CACd,QAAA,EACA,UAAA,EACA,YAAA,EACQ;AACR,EAAA,MAAM,UAAA,GACJ,qBAAA,CAAsB,QAAQ,CAAA,IAC9B,OAAO,YAAA,KAAiB,QAAA,IACxB,YAAA,CAAa,MAAA,GAAS,CAAA,IACtB,CAAC,UAAA,CAAW,SAAS,YAAY,CAAA;AACnC,EAAA,OAAO,UAAA,CAAW,MAAA,IAAU,UAAA,GAAa,CAAA,GAAI,CAAA,CAAA;AAC/C;AAEA,SAAS,eAAe,SAAA,EA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EvD,EAAA,MAAM,WAAW,YAAA,CAAa,QAAA;AAC9B,EAAA,IAAI,QAAA,IAAY,QAAA,CAAS,QAAQ,CAAA,EAAG;AAClC,IAAA,OAAO,EAAE,WAAA,EAAa,CAAA,EAAG,QAAA,EAAS;AAAA,EACpC;AACA,EAAA,OAAO,EAAE,aAAa,CAAA,EAAE;AAC1B","file":"chunk-CZ5IQB3L.js","sourcesContent":["/**\n * The image models whose price depends on how many input images a run sends:\n * GPT Image 2.6 Flare and Sunburst, MiniMax H3 Image and Seedream 5.5. Every place that\n * prices a run counts those images through here, so a model that joins\n * `isPricedPerInputImage` is counted on every path at once.\n */\nimport {\n GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES,\n isGptImage26I2i,\n isGptImage26Tiered,\n} from \"./gpt-image-2-6.js\"\nimport { isMinimaxH3Image, isMinimaxH3ImageI2i } from \"./minimax-h3-image.js\"\nimport { isSeedream55, isSeedream55I2i } from \"./seedream-5-5.js\"\n\n/** True for a model whose price counts the input images a run sends. */\nexport function isPricedPerInputImage(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26Tiered(model) || isMinimaxH3Image(model) || isSeedream55(model))\n}\n\n/** True for the edit id of such a model: it always sends at least its source. */\nexport function isPricedPerInputImageEdit(model: unknown): boolean {\n return typeof model === \"string\" && (isGptImage26I2i(model) || isMinimaxH3ImageI2i(model) || isSeedream55I2i(model))\n}\n\n/**\n * The images a Generate Image run sends its provider: its references and, when\n * it edits a base image, that image too (the worker puts it first, unless it is\n * already one of the references). Counted only on a model priced per input\n * image; any other model is priced on its references alone, as before.\n */\nexport function pricedSentImages(\n provider: string | undefined,\n references: readonly string[],\n baseImageUrl: unknown,\n): number {\n const countsBase =\n isPricedPerInputImage(provider) &&\n typeof baseImageUrl === \"string\" &&\n baseImageUrl.length > 0 &&\n !references.includes(baseImageUrl)\n return references.length + (countsBase ? 1 : 0)\n}\n\nfunction namesMoodboard(direction: unknown): boolean {\n if (direction === null || typeof direction !== \"object\") return false\n const style = (direction as Record<string, unknown>).style\n return (Array.isArray(style) ? style : [style]).some(\n (value) => typeof value === \"string\" && value.startsWith(\"moodboard:\"),\n )\n}\n\n/**\n * The input images a workflow estimate counts for one node on a model priced\n * per input image: every list on the node, its source or base image, what is\n * wired in, a moodboard its direction names (at the most a moodboard holds),\n * and an edit model's own source. An estimate may over-quote, never under.\n */\nexport function pricedEstimatedImages(\n model: string,\n data: Record<string, unknown>,\n wiredImages: number,\n): number {\n const listed = (v: unknown) => (Array.isArray(v) ? v.length : 0)\n const single = (v: unknown) => (typeof v === \"string\" && v.length > 0 ? 1 : 0)\n return (\n listed(data.referenceImageUrls) +\n listed(data.characterDefinitionIds) +\n listed(data.extraRefs) +\n single(data.referenceImageUrl) +\n single(data.baseImageUrl) +\n single(data.sourceImageUrl) +\n wiredImages +\n (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) +\n (isPricedPerInputImageEdit(model) ? 1 : 0)\n )\n}\n","import { getModel } from \"./model-catalog.js\"\n\n/**\n * Retry/fallback behavior derived from a catalog entry's `safetyFilter`\n * flag (see `ModelCatalogEntry.safetyFilter` in `model-catalog.ts`).\n */\nexport interface SafetyRetryPolicy {\n /** 2 when the model declares `safetyFilter.stochastic`, else 1. */\n maxAttempts: 1 | 2\n /**\n * Catalog model id to offer when the retry also blocks. Only present\n * when the entry declares one AND it resolves to a real catalog entry.\n */\n fallback?: string\n}\n\n/**\n * The provider's safety filter is known to be non-deterministic on some\n * catalog models — a benign prompt can trip it once and pass on an\n * identical retry. For those models the platform retries a blocked\n * request once (`maxAttempts: 2`) before giving up; `fallback` names the\n * catalog model to offer the user when the retry also blocks.\n *\n * Every model not flagged this way — including an unrecognized id —\n * gets a single attempt and no fallback.\n */\nexport function safetyRetryPolicy(modelId: string): SafetyRetryPolicy {\n const entry = getModel(modelId)\n const safetyFilter = entry?.safetyFilter\n if (!safetyFilter?.stochastic) return { maxAttempts: 1 }\n\n const fallback = safetyFilter.fallback\n if (fallback && getModel(fallback)) {\n return { maxAttempts: 2, fallback }\n }\n return { maxAttempts: 2 }\n}\n"]}
|
|
@@ -75,6 +75,7 @@ exports.GPT_IMAGE_2_6_GIF_BANDS = GPT_IMAGE_2_6_GIF_BANDS;
|
|
|
75
75
|
exports.GPT_IMAGE_2_6_GIF_DEFAULT_FRAMES = GPT_IMAGE_2_6_GIF_DEFAULT_FRAMES;
|
|
76
76
|
exports.GPT_IMAGE_2_6_MAX_INPUT_IMAGES = GPT_IMAGE_2_6_MAX_INPUT_IMAGES;
|
|
77
77
|
exports.GPT_IMAGE_2_6_METERED_QUALITY = GPT_IMAGE_2_6_METERED_QUALITY;
|
|
78
|
+
exports.GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES = GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES;
|
|
78
79
|
exports.GPT_IMAGE_2_6_QUALITIES = GPT_IMAGE_2_6_QUALITIES;
|
|
79
80
|
exports.GPT_IMAGE_2_6_RESOLUTIONS = GPT_IMAGE_2_6_RESOLUTIONS;
|
|
80
81
|
exports.GPT_IMAGE_2_6_SVG_LEVELS = GPT_IMAGE_2_6_SVG_LEVELS;
|
|
@@ -88,5 +89,5 @@ exports.imageFormatLeversOf = imageFormatLeversOf;
|
|
|
88
89
|
exports.isGptImage26AutoRun = isGptImage26AutoRun;
|
|
89
90
|
exports.isGptImage26I2i = isGptImage26I2i;
|
|
90
91
|
exports.isGptImage26Tiered = isGptImage26Tiered;
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
92
|
-
//# sourceMappingURL=chunk-
|
|
92
|
+
//# sourceMappingURL=chunk-D34K455O.cjs.map
|
|
93
|
+
//# sourceMappingURL=chunk-D34K455O.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gpt-image-2-6.ts"],"names":[],"mappings":";;;AASO,IAAM,wBAAA,GAA2B,CAAC,qBAAA,EAAuB,wBAAwB;AACjF,IAAM,wBAAA,GAA2B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AK,kBAAkB,CAAA,GAC9B,OAAO,IAAA,CAAK,sBAAsB,CAAA,GAClC,MAAA,CAAO,KAAK,SAAS,CAAA,GACrB,MAAA,CAAO,IAAA,CAAK,iBAAiB,CAAA,GAC7B,MAAA,CAAO,IAAA,CAAK,YAAY,CAAA,GACxB,MAAA,CAAO,IAAA,CAAK,cAAc,IAC1B,WAAA,IACC,cAAA,CAAe,IAAA,CAAK,SAAS,IAAI,kCAAA,GAAqC,CAAA,CAAA,IACtE,eAAA,CAAgB,KAAK,IAAI,CAAA,GAAI,CAAA,CAAA;AAElC","file":"chunk-D34K455O.cjs","sourcesContent":["/**\n * What makes GPT Image 2.6 Flare and Sunburst price differently from every\n * other image model: a quality setting AND a size, and on an edit the number of\n * input images as well. Economy is a flat price and is not listed here.\n *\n * Only the ids and levers live in this published package. The rates and the\n * formula are `backend/src/ee/billing/gpt-image-2-6-pricing.ts`.\n */\n\nexport const GPT_IMAGE_2_6_TIERED_T2I = [\"gpt-image-2-6-flare\", \"gpt-image-2-6-sunburst\"] as const\nexport const GPT_IMAGE_2_6_TIERED_I2I = [\"gpt-image-2-6-flare-i2i\", \"gpt-image-2-6-sunburst-i2i\"] as const\nexport type GptImage26TieredModel =\n | (typeof GPT_IMAGE_2_6_TIERED_T2I)[number]\n | (typeof GPT_IMAGE_2_6_TIERED_I2I)[number]\n\nexport const GPT_IMAGE_2_6_QUALITIES = [\"auto\", \"low\", \"medium\", \"high\", \"xhigh\", \"max\"] as const\nexport type GptImage26Quality = (typeof GPT_IMAGE_2_6_QUALITIES)[number]\n/**\n * The quality whose price is known only after the run: KIE picks the level. It\n * is reserved at the Max row and settled on what KIE really billed; every other\n * quality keeps its fixed row.\n */\nexport const GPT_IMAGE_2_6_METERED_QUALITY: GptImage26Quality = \"auto\"\nexport const GPT_IMAGE_2_6_RESOLUTIONS = [\"1K\", \"2K\", \"4K\"] as const\nexport type GptImage26Resolution = (typeof GPT_IMAGE_2_6_RESOLUTIONS)[number]\n\nexport const GPT_IMAGE_2_6_DEFAULT_QUALITY: GptImage26Quality = \"medium\"\nexport const GPT_IMAGE_2_6_DEFAULT_RESOLUTION: GptImage26Resolution = \"1K\"\n/** The most input images an edit is priced for (`REF_IMAGE_MAX_LIMITS`). */\nexport const GPT_IMAGE_2_6_MAX_INPUT_IMAGES = 16\n\n/**\n * A GIF is priced by quality and by how many frames it has, in three bands:\n * KIE draws every frame of a GIF on one sheet, and the frames of a band share a\n * sheet size. Its price does not depend on the ratio or size (a GIF is always\n * square, 512 pixels a frame). Ten to twelve frames take nine's price, so the\n * bands rise in order.\n */\nexport const GPT_IMAGE_2_6_GIF_BANDS = [\n { id: \"2-8\", min: 2, max: 8 },\n { id: \"9-12\", min: 9, max: 12 },\n { id: \"13-16\", min: 13, max: 16 },\n] as const\nexport type GptImage26GifBand = (typeof GPT_IMAGE_2_6_GIF_BANDS)[number][\"id\"]\n/** The frames a GIF has when none are asked for (KIE's own default). */\nexport const GPT_IMAGE_2_6_GIF_DEFAULT_FRAMES = 9\n\n/**\n * The band a GIF of `frames` frames is priced in. A value that is not a whole\n * number of frames, or is off the range, lands where the run lands: no value is\n * the default nine frames, others are rounded and kept inside 2 to 16.\n */\nexport function gptImage26GifBand(frames: unknown): GptImage26GifBand {\n // A numeric string counts as its number, as the run reads it (a form field, a FieldMapping).\n const asked = typeof frames === \"number\" ? frames : typeof frames === \"string\" && frames.trim() !== \"\" ? Number(frames) : Number.NaN\n const n = Number.isFinite(asked) ? Math.round(asked) : GPT_IMAGE_2_6_GIF_DEFAULT_FRAMES\n const first = GPT_IMAGE_2_6_GIF_BANDS[0]\n const last = GPT_IMAGE_2_6_GIF_BANDS[GPT_IMAGE_2_6_GIF_BANDS.length - 1]!\n const clamped = Math.min(Math.max(n, first.min), last.max)\n return (GPT_IMAGE_2_6_GIF_BANDS.find((b) => clamped >= b.min && clamped <= b.max) ?? first).id\n}\n\n/**\n * An SVG is drawn at one of three levels of detail (Standard, Detailed, Max),\n * each priced as the same image in PNG plus a fixed amount for the drawing.\n */\nexport const GPT_IMAGE_2_6_SVG_LEVELS = [\"standard\", \"detailed\", \"max\"] as const\nexport type GptImage26SvgLevel = (typeof GPT_IMAGE_2_6_SVG_LEVELS)[number]\nexport const GPT_IMAGE_2_6_DEFAULT_SVG_LEVEL: GptImage26SvgLevel = \"standard\"\n\n/** The format part of a GPT Image 2.6 price: a GIF's band, an SVG's level, or none (PNG, JPEG and WebP cost the same). */\nexport type GptImage26PricedFormat =\n | { readonly kind: \"gif\"; readonly band: GptImage26GifBand }\n | { readonly kind: \"svg\"; readonly level: GptImage26SvgLevel }\n\n/** The levers a format is priced from, as a request or a node carries them (unchecked). */\nexport interface ImageFormatLevers {\n outputFormat?: unknown\n gifFrames?: unknown\n svgLevel?: unknown\n}\n\n/** The format levers of a request body or a node's data, for a price. */\nexport function imageFormatLeversOf(record: Record<string, unknown> | undefined): ImageFormatLevers {\n return { outputFormat: record?.outputFormat, gifFrames: record?.gifFrames, svgLevel: record?.svgLevel }\n}\n\n/** Read in any case, as the catalog snap reads it (`normalizeModelInput`). */\nfunction lowered(value: unknown): string | undefined {\n return typeof value === \"string\" ? value.trim().toLowerCase() : undefined\n}\n\nexport function gptImage26PricedFormat(levers: ImageFormatLevers | undefined): GptImage26PricedFormat | undefined {\n const format = lowered(levers?.outputFormat)\n if (format === \"gif\") return { kind: \"gif\", band: gptImage26GifBand(levers?.gifFrames) }\n if (format === \"svg\") {\n const asked = lowered(levers?.svgLevel)\n const level = GPT_IMAGE_2_6_SVG_LEVELS.find((l) => l === asked) ?? GPT_IMAGE_2_6_DEFAULT_SVG_LEVEL\n return { kind: \"svg\", level }\n }\n return undefined\n}\n\nexport function isGptImage26I2i(model: string): boolean {\n return (GPT_IMAGE_2_6_TIERED_I2I as readonly string[]).includes(model)\n}\n\nexport function isGptImage26Tiered(model: string): model is GptImage26TieredModel {\n return isGptImage26I2i(model) || (GPT_IMAGE_2_6_TIERED_T2I as readonly string[]).includes(model)\n}\n\n/** True for a run whose charge is settled on KIE's own bill: Flare or Sunburst at quality Auto. */\nexport function isGptImage26AutoRun(provider: unknown, quality: unknown): boolean {\n return typeof provider === \"string\" && isGptImage26Tiered(provider) && quality === GPT_IMAGE_2_6_METERED_QUALITY\n}\n\n/**\n * The images a Generate Image run sends to KIE on GPT Image 2.6: its references\n * and, when it edits a base image, that image too (the worker puts it first,\n * unless it is already one of the references). Any other model is priced on its\n * references alone.\n *\n * @deprecated Use `pricedSentImages` (`input-image-pricing.ts`), which counts\n * the base for every model priced per input image, MiniMax H3 Image included.\n */\nexport function gptImage26SentImages(\n provider: string | undefined,\n references: readonly string[],\n baseImageUrl: unknown,\n): number {\n const countsBase =\n provider !== undefined &&\n isGptImage26Tiered(provider) &&\n typeof baseImageUrl === \"string\" &&\n baseImageUrl.length > 0 &&\n !references.includes(baseImageUrl)\n return references.length + (countsBase ? 1 : 0)\n}\n\n/**\n * The most pictures a saved moodboard holds. A run sends them as references in\n * the seats the node's own images leave free. An estimate cannot read the\n * moodboard, so it counts this many.\n */\nexport const GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES = 12\n\nfunction namesMoodboard(direction: unknown): boolean {\n if (direction === null || typeof direction !== \"object\") return false\n const style = (direction as Record<string, unknown>).style\n return (Array.isArray(style) ? style : [style]).some(\n (value) => typeof value === \"string\" && value.startsWith(\"moodboard:\"),\n )\n}\n\n/**\n * The input images a workflow estimate counts for one node on a model priced\n * per input image: every list on the node, its source or base image, what is\n * wired in, a moodboard its direction names, and an image-to-image model's own\n * source. An estimate may over-quote, never under.\n *\n * @deprecated Use `pricedEstimatedImages` (`input-image-pricing.ts`), which\n * counts for every model priced per input image, MiniMax H3 Image included.\n */\nexport function gptImage26EstimatedImages(\n model: string,\n data: Record<string, unknown>,\n wiredImages: number,\n): number {\n const listed = (v: unknown) => (Array.isArray(v) ? v.length : 0)\n const single = (v: unknown) => (typeof v === \"string\" && v.length > 0 ? 1 : 0)\n return (\n listed(data.referenceImageUrls) +\n listed(data.characterDefinitionIds) +\n listed(data.extraRefs) +\n single(data.referenceImageUrl) +\n single(data.baseImageUrl) +\n single(data.sourceImageUrl) +\n wiredImages +\n (namesMoodboard(data.direction) ? GPT_IMAGE_2_6_MOODBOARD_MAX_IMAGES : 0) +\n (isGptImage26I2i(model) ? 1 : 0)\n )\n}\n"]}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
import { UGC_PRIMARY_HANDLE } from './chunk-MD4XHED4.js';
|
|
2
|
+
import { composeUnitSet, unitProducers, composeUnitRecord, unitFanOutEach, unitListPips } from './chunk-KL6GAYTT.js';
|
|
3
|
+
import { isSeedance2Provider, isMinimaxH3Provider, isWan3Provider, isKling4RunnerProvider, isViduQ4Provider, isGeminiOmniPerSecondProvider, isPixverseV6MaxProvider, PRICING_DEFAULT_RESOLUTION, isGeminiOmniProvider } from './chunk-OV3JTKBY.js';
|
|
4
|
+
import { MODEL_CATALOG } from './chunk-PSKZKLDG.js';
|
|
5
|
+
|
|
6
|
+
// src/producer-types.ts
|
|
7
|
+
var VIDEO_PRODUCER_TYPES = composeUnitSet("VIDEO_PRODUCER_TYPES", [
|
|
8
|
+
"image-to-video",
|
|
9
|
+
"video-to-video",
|
|
10
|
+
"switchx",
|
|
11
|
+
// Beeble SwitchX relight/composite
|
|
12
|
+
"text-to-video",
|
|
13
|
+
// Unified video node — emits videoUrl identically to i2v/t2v (its payload-builder
|
|
14
|
+
// case dispatches dynamically to "image-to-video" or "text-to-video" jobName based
|
|
15
|
+
// on whether a start frame is wired). Without this, getPrimaryOutput would fall
|
|
16
|
+
// through to the imageUrl/videoUrl/audioUrl/text default and downstream consumers
|
|
17
|
+
// could silently misroute the output.
|
|
18
|
+
"generate-video",
|
|
19
|
+
// Generate Video Pro — Seedance-2-family multi-segment stitch variant of
|
|
20
|
+
// generate-video (same "emits videoUrl" contract; a trimmed provider +
|
|
21
|
+
// handle set). Must mirror generate-video here or its output can't connect
|
|
22
|
+
// downstream (the recurring "cannot connect the outputs" bug class).
|
|
23
|
+
"generate-video-pro",
|
|
24
|
+
// Edit Video Pro — Seedance-2-family span-replace sibling of generate-
|
|
25
|
+
// video-pro (same "emits videoUrl" contract; source video + prompt in,
|
|
26
|
+
// ONE video out). Must mirror generate-video-pro here or its output can't
|
|
27
|
+
// connect downstream (the recurring "cannot connect the outputs" bug class).
|
|
28
|
+
"edit-video-pro",
|
|
29
|
+
"upload-video",
|
|
30
|
+
"youtube-video",
|
|
31
|
+
"combine-videos",
|
|
32
|
+
"lip-sync",
|
|
33
|
+
"speech-to-video",
|
|
34
|
+
"motion-transfer",
|
|
35
|
+
"video-upscale",
|
|
36
|
+
"video-depth",
|
|
37
|
+
"extend-video",
|
|
38
|
+
// face-swap output is video (writes generatedVideoUrl, per-result `url`).
|
|
39
|
+
// Frontend execution-graph already includes it in VIDEO_SOURCE_TYPES; this
|
|
40
|
+
// entry brings the shared set in line so canvas typed-handle validation
|
|
41
|
+
// doesn't reject face-swap → video-consumer edges that the orchestrator
|
|
42
|
+
// would happily route at runtime.
|
|
43
|
+
"face-swap",
|
|
44
|
+
// Speaker View (C3.2): an EDL rendered with its speakers framed — one VIDEO
|
|
45
|
+
// out (no audio-only render). Registered in RENDER_NODE_TYPES as well.
|
|
46
|
+
"speaker-view",
|
|
47
|
+
"video-retake",
|
|
48
|
+
// video-sfx: adds an SFX track to a video → emits a video URL. Belongs here so
|
|
49
|
+
// canvas handle validation accepts video-sfx → video-consumer edges and the
|
|
50
|
+
// backend routes its output as video (it was previously relying on a fallback).
|
|
51
|
+
"video-sfx",
|
|
52
|
+
"suno-music-video",
|
|
53
|
+
"merge-video-audio",
|
|
54
|
+
"add-captions",
|
|
55
|
+
"resize-video",
|
|
56
|
+
"social-media-format",
|
|
57
|
+
"trim-video",
|
|
58
|
+
"render-video",
|
|
59
|
+
"speed-ramp",
|
|
60
|
+
"loop-video",
|
|
61
|
+
"fade-video",
|
|
62
|
+
// Video Mask emits its mask as a video; Mask Composite its composite.
|
|
63
|
+
"video-mask",
|
|
64
|
+
"mask-composite",
|
|
65
|
+
"transcode-video",
|
|
66
|
+
"manual-edit",
|
|
67
|
+
// AI Avatar (HeyGen): avatar + voice/audio → video.
|
|
68
|
+
"ai-avatar",
|
|
69
|
+
// Cinematic Avatar (HeyGen cinematic_avatar): prompt + 1–3 avatar looks → video.
|
|
70
|
+
"cinematic-avatar",
|
|
71
|
+
// Assemble Narrated Video: fits N (clip, voice) blocks into one MP4 → video.
|
|
72
|
+
"assemble-narrated-video",
|
|
73
|
+
// Still to Video: one still image + one audio track → MP4 (local FFmpeg,
|
|
74
|
+
// no provider). Emits generatedVideoUrl like every other ffmpeg video node.
|
|
75
|
+
"still-to-video",
|
|
76
|
+
// Slideshow: 2-100 stills + one optional audio track → MP4 (local FFmpeg,
|
|
77
|
+
// no provider). Same contract; images arrive via the image-collage lane.
|
|
78
|
+
"slideshow",
|
|
79
|
+
// 3D Render Pro: authors a scene AND exports it in one operation, settling
|
|
80
|
+
// with the standard `videoUrl` field. It is a video producer as much as it
|
|
81
|
+
// is a composition producer — omitting it here is the "cannot connect the
|
|
82
|
+
// outputs" bug, and its `composition` handle is typed separately.
|
|
83
|
+
"pro-3d-render",
|
|
84
|
+
// Video Overlay: timed image layers over a video in one local FFmpeg pass
|
|
85
|
+
// (the base audio copied) — emits a video URL on `video-out`.
|
|
86
|
+
"video-overlay",
|
|
87
|
+
// UGC Clip: renders one clip of a UGC video from its ticket — emits a video
|
|
88
|
+
// URL on `video-out` (one per fan-out iteration).
|
|
89
|
+
"ugc-clip",
|
|
90
|
+
// UGC Finish: the video's clips, finished, as one ordered list — a registered producer, so a
|
|
91
|
+
// Bundle edge into Combine Videos routes each one as a video, in order.
|
|
92
|
+
"ugc-finish-clips"
|
|
93
|
+
], unitProducers("video"));
|
|
94
|
+
var DYNAMIC_PRODUCER_TYPES = composeUnitSet("DYNAMIC_PRODUCER_TYPES", [
|
|
95
|
+
"list",
|
|
96
|
+
"sub-workflow",
|
|
97
|
+
"adjust-volume",
|
|
98
|
+
// Pitch & Tempo: audio in → audio out, video in → video out (picture
|
|
99
|
+
// copied). Dual-mode like adjust-volume; stays in AUDIO_PRODUCER_TYPES as
|
|
100
|
+
// its default.
|
|
101
|
+
"pitch-tempo",
|
|
102
|
+
// Dual-mode: audio in → audio out; video in → video out (+ revoiced audio).
|
|
103
|
+
// Listed here so canvas validators accept its output on BOTH audio and video
|
|
104
|
+
// input handles (it also stays in AUDIO_PRODUCER_TYPES as its default).
|
|
105
|
+
"voice-changer",
|
|
106
|
+
// voice-changer-pro (renamed from voice-recast in #3581) is a behavioral
|
|
107
|
+
// twin of voice-changer — identical dual-mode output. Must mirror it in
|
|
108
|
+
// EVERY producer set or its outputs can't connect (was the "cannot connect
|
|
109
|
+
// the outputs of voice-changer-pro" bug). Guarded by producer-types.test.ts.
|
|
110
|
+
"voice-changer-pro",
|
|
111
|
+
// Dubbing joined the dual-mode family with the full-surface upgrade:
|
|
112
|
+
// audio in → dubbed audio; video in (or a video sourceUrl) → dubbed VIDEO
|
|
113
|
+
// (+ audio sidecar). Same wiring contract as voice-changer; stays in
|
|
114
|
+
// AUDIO_PRODUCER_TYPES as its default. Explicitly asserted in
|
|
115
|
+
// producer-types.test.ts (the suite does not fail on omission).
|
|
116
|
+
"dubbing",
|
|
117
|
+
"reduce",
|
|
118
|
+
// Dual-output time chunker (UI label "Split into Chunks"; type id stays
|
|
119
|
+
// "split-media"): video in → video chunks, audio in → audio chunks — two
|
|
120
|
+
// independent lanes on two output handles. Like voice-changer, the canvas
|
|
121
|
+
// validator only sees the source NODE type, not which handle a wire leaves,
|
|
122
|
+
// so it lives here to be accepted on BOTH audio and video input handles. The
|
|
123
|
+
// backend routes the correct lane by sourceHandle in getPrimaryOutput
|
|
124
|
+
// (output-extractor.ts); the frontend does so in extractNodeOutput.
|
|
125
|
+
"split-media",
|
|
126
|
+
// apply-edl renders an EDL into ONE media output whose type is decided at
|
|
127
|
+
// run time by the node's `output` setting (video OR audio) — so its static
|
|
128
|
+
// medium is genuinely unknown and it belongs here, letting canvas validators
|
|
129
|
+
// accept its default media handle on BOTH audio and video input handles. It
|
|
130
|
+
// ALSO emits a fixed `json` handle (the remapped Transcript); that half lives
|
|
131
|
+
// in JSON_PRODUCER_TYPES (frontend/src/lib/data-handles.ts). The FIRST node
|
|
132
|
+
// with both a dynamic media handle and a fixed json handle. Because
|
|
133
|
+
// getOutputType (presentation-utils.ts) deliberately returns "data" for
|
|
134
|
+
// DYNAMIC members, apply-edl is ALSO added to the literal VIDEO_OUTPUT_TYPES
|
|
135
|
+
// there so a published app renders the cut as video, mirroring the
|
|
136
|
+
// voice-changer/dubbing precedent. Asserted in producer-types.test.ts (the
|
|
137
|
+
// suite does not fail on omission).
|
|
138
|
+
"apply-edl"
|
|
139
|
+
], unitProducers("dynamic"));
|
|
140
|
+
var AUDIO_PRODUCER_TYPES = composeUnitSet("AUDIO_PRODUCER_TYPES", [
|
|
141
|
+
"text-to-speech",
|
|
142
|
+
"text-to-audio",
|
|
143
|
+
"generate-music",
|
|
144
|
+
"upload-audio",
|
|
145
|
+
"suno-generate",
|
|
146
|
+
"suno-cover",
|
|
147
|
+
"suno-extend",
|
|
148
|
+
"suno-separate",
|
|
149
|
+
"audio-separation",
|
|
150
|
+
"suno-mashup",
|
|
151
|
+
"suno-replace-section",
|
|
152
|
+
"suno-add-instrumental",
|
|
153
|
+
"suno-add-vocals",
|
|
154
|
+
"suno-convert-wav",
|
|
155
|
+
"suno-upload-extend",
|
|
156
|
+
"trim-audio",
|
|
157
|
+
"mix-audio",
|
|
158
|
+
"combine-audio",
|
|
159
|
+
"adjust-volume",
|
|
160
|
+
"audio-fx",
|
|
161
|
+
"pitch-tempo",
|
|
162
|
+
"reference-audio",
|
|
163
|
+
"audio-isolation",
|
|
164
|
+
"text-to-dialogue",
|
|
165
|
+
"voice-changer",
|
|
166
|
+
// Twin of voice-changer (see DYNAMIC_PRODUCER_TYPES note). Audio is its
|
|
167
|
+
// default output mode; video mode is handled via DYNAMIC membership.
|
|
168
|
+
"voice-changer-pro",
|
|
169
|
+
"dubbing",
|
|
170
|
+
"voice-remix",
|
|
171
|
+
"voice-design",
|
|
172
|
+
// Extract Audio: demuxes a video's audio track to a standalone MP3.
|
|
173
|
+
"extract-audio"
|
|
174
|
+
], unitProducers("audio"));
|
|
175
|
+
var IMAGE_PRODUCER_TYPES = composeUnitSet("IMAGE_PRODUCER_TYPES", [
|
|
176
|
+
"upload-image",
|
|
177
|
+
"generate-image",
|
|
178
|
+
"edit-image",
|
|
179
|
+
"image-to-image",
|
|
180
|
+
"modify-image",
|
|
181
|
+
"upscale-image",
|
|
182
|
+
"remove-background",
|
|
183
|
+
// extract-frame produces a single still image extracted from a video source.
|
|
184
|
+
"extract-frame",
|
|
185
|
+
// generate-mask emits the source image AND a mask PNG; its `image` source
|
|
186
|
+
// pip is the passthrough (the same image as the input).
|
|
187
|
+
"generate-mask",
|
|
188
|
+
// paint-mask emits the hand-painted mask PNG (a plain image at runtime).
|
|
189
|
+
// Membership is what makes mask targets accept it — mask is an advisory
|
|
190
|
+
// color, not a gated type.
|
|
191
|
+
"paint-mask",
|
|
192
|
+
// reference-sheet's `sheet` is one composited image and `panels` carries
|
|
193
|
+
// clean reference images; both resolve to image URLs at runtime.
|
|
194
|
+
"reference-sheet",
|
|
195
|
+
// reference-board's `image` pip emits a real generated board image.
|
|
196
|
+
"reference-board",
|
|
197
|
+
// image-collage composites N images → ONE image.
|
|
198
|
+
"image-collage",
|
|
199
|
+
// image-overlay places layers on a base → ONE image.
|
|
200
|
+
"image-overlay",
|
|
201
|
+
// 3D Render Pro's `stills` handle carries one PNG per shot of the exported
|
|
202
|
+
// composition (spread into referenceImageUrls like reference-sheet
|
|
203
|
+
// `panels`). A validator sees only the source NODE type, so this also makes
|
|
204
|
+
// its `video` pip droppable on an image input — the handle-blind trade
|
|
205
|
+
// reference-sheet and split-media already make; the input resolvers route
|
|
206
|
+
// by handle, so only `stills` becomes an image at runtime. Deliberately NOT
|
|
207
|
+
// in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY
|
|
208
|
+
// asset, and 3D Render Pro's is the MP4.
|
|
209
|
+
"pro-3d-render"
|
|
210
|
+
], unitProducers("image"));
|
|
211
|
+
var FAN_OUT_EACH_TYPES = /* @__PURE__ */ new Set([
|
|
212
|
+
"list",
|
|
213
|
+
"split-text",
|
|
214
|
+
"filter-list",
|
|
215
|
+
"deduplicate",
|
|
216
|
+
"merge-lists",
|
|
217
|
+
"sort-list",
|
|
218
|
+
"selector",
|
|
219
|
+
// edit-plan `clips` mode emits a bare `Edl[]` on `data.generatedJson`, so an
|
|
220
|
+
// edge leaving it defaults to "each" — one downstream execution (typically an
|
|
221
|
+
// apply-edl render) per clip. The `tighten`/`chapters` modes emit an OBJECT,
|
|
222
|
+
// for which the list extractors return undefined, so an "each" edge falls back
|
|
223
|
+
// to the scalar `edl` value (no fan-out) — the same graceful degradation
|
|
224
|
+
// web-scrape relies on. See `unwrapEditPlanOutput` in `edit-plan-contract.ts`.
|
|
225
|
+
"edit-plan",
|
|
226
|
+
// Content Ideas emits one creative brief per idea on `listResults`, so an
|
|
227
|
+
// edge leaving it defaults to "each" — the node after it (typically
|
|
228
|
+
// Generate Script) runs once per idea, on the server too.
|
|
229
|
+
"content-ideas"
|
|
230
|
+
]);
|
|
231
|
+
var FAN_OUT_EACH_HANDLES = composeUnitRecord("FAN_OUT_EACH_HANDLES", {
|
|
232
|
+
// Camera Switch run once per clip (Edit Plan in clips mode): each clip's
|
|
233
|
+
// switched EDL is its own Apply EDL render. Its transcript is the same for
|
|
234
|
+
// every clip (the master clock, renamed), so that handle stays one value
|
|
235
|
+
// (decided 2026-10-04).
|
|
236
|
+
"camera-switch": { each: ["edl"], primary: "edl" },
|
|
237
|
+
// UGC Clips: one ticket per clip on `clips` (each); `plan-out` and
|
|
238
|
+
// `transcript` carry one value. Not a FAN_OUT_EACH_TYPES member — every
|
|
239
|
+
// handle of such a member would fan out. Its one run writes the tickets as
|
|
240
|
+
// its list (`listResults`, the editor's `__listResults`). The pip an edge
|
|
241
|
+
// with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
242
|
+
"ugc-clips": { each: ["clips"], primary: UGC_PRIMARY_HANDLE["ugc-clips"] }
|
|
243
|
+
// A node unit declares its row in unit.json (contract.fanOutEach); it is added after these.
|
|
244
|
+
}, unitFanOutEach());
|
|
245
|
+
var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
|
|
246
|
+
var OWN_LIST_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
247
|
+
"extract-field",
|
|
248
|
+
"json-process",
|
|
249
|
+
// Site Capture: its stills, in page order — the last capture's, never every capture's (site-capture-node.ts).
|
|
250
|
+
"site-capture"
|
|
251
|
+
]);
|
|
252
|
+
function ownsItsList(nodeType) {
|
|
253
|
+
return typeof nodeType === "string" && OWN_LIST_NODE_TYPES.has(nodeType);
|
|
254
|
+
}
|
|
255
|
+
var LIST_OUTPUT_HANDLES = composeUnitRecord("LIST_OUTPUT_HANDLES", {}, unitListPips());
|
|
256
|
+
function isListOutputHandle(sourceType, sourceHandle) {
|
|
257
|
+
if (typeof sourceType !== "string" || typeof sourceHandle !== "string" || !Object.hasOwn(LIST_OUTPUT_HANDLES, sourceType)) return false;
|
|
258
|
+
return LIST_OUTPUT_HANDLES[sourceType].includes(sourceHandle);
|
|
259
|
+
}
|
|
260
|
+
function defaultEdgeOutputMode(sourceType, sourceHandle) {
|
|
261
|
+
if (typeof sourceType !== "string") return "last";
|
|
262
|
+
if (FAN_OUT_EACH_TYPES.has(sourceType)) return "each";
|
|
263
|
+
if (isListOutputHandle(sourceType, sourceHandle)) return "each";
|
|
264
|
+
const entry = FAN_OUT_EACH_HANDLES[sourceType];
|
|
265
|
+
if (!entry) return "last";
|
|
266
|
+
return entry.each.includes(sourceHandle || entry.primary) ? "each" : "last";
|
|
267
|
+
}
|
|
268
|
+
function listResultsServeHandle(sourceType, sourceHandle) {
|
|
269
|
+
const entry = typeof sourceType === "string" ? FAN_OUT_EACH_HANDLES[sourceType] : void 0;
|
|
270
|
+
return !entry || entry.each.includes(sourceHandle || entry.primary);
|
|
271
|
+
}
|
|
272
|
+
var FAN_IN_TARGETS = {
|
|
273
|
+
// Choose Best — every wire is a candidate.
|
|
274
|
+
reduce: "*",
|
|
275
|
+
// Content Ideas — one or more recipes, from several Content Recipe nodes
|
|
276
|
+
// and/or one that ran once per post.
|
|
277
|
+
"content-ideas": ["recipes"],
|
|
278
|
+
// Telegram Reply — one message per run, whatever is wired into its text
|
|
279
|
+
// input: a list (or a writer that ran once per item) arrives as one
|
|
280
|
+
// message, never as a burst of sends to the owner's chat.
|
|
281
|
+
"telegram-account-send": ["in"],
|
|
282
|
+
// The list operators — they READ the whole list wired into them (their
|
|
283
|
+
// executors collect every upstream item themselves) and emit a list. Run
|
|
284
|
+
// once per item by an "each" wire (a Split Text, a List, a node that ran per
|
|
285
|
+
// item), every iteration saw the same whole list and answered with its
|
|
286
|
+
// first match: a Filter List fed 11 stories handed 11 copies of story one
|
|
287
|
+
// downstream, and every paid stage after it ran 11 times on it
|
|
288
|
+
// (2026-10-06). A list operator is never fanned out, on any wire.
|
|
289
|
+
"filter-list": "*",
|
|
290
|
+
deduplicate: "*",
|
|
291
|
+
"merge-lists": "*",
|
|
292
|
+
"sort-list": "*",
|
|
293
|
+
selector: "*",
|
|
294
|
+
// Speaker Frames on a clip pack (P3-24 (a), decided 2026-10-06): ONE run over
|
|
295
|
+
// the union of the clips' spans — the pack's EDLs fold onto its `edl` wire
|
|
296
|
+
// instead of running one detection job (and one minimum charge) per clip.
|
|
297
|
+
"speaker-frames": ["edl"],
|
|
298
|
+
// UGC Finish: ONE run over every clip of the video, in clip order — the finish plans its
|
|
299
|
+
// cut and its sound over all of them at once, so it is never run once per clip.
|
|
300
|
+
"ugc-finish-clips": ["clips"]
|
|
301
|
+
};
|
|
302
|
+
function isFanInNodeType(nodeType) {
|
|
303
|
+
return typeof nodeType === "string" && Object.prototype.hasOwnProperty.call(FAN_IN_TARGETS, nodeType);
|
|
304
|
+
}
|
|
305
|
+
function isFanInEdge(targetType, targetHandle) {
|
|
306
|
+
if (!isFanInNodeType(targetType)) return false;
|
|
307
|
+
const spec = FAN_IN_TARGETS[targetType];
|
|
308
|
+
if (spec === "*") return true;
|
|
309
|
+
return targetHandle == null || targetHandle === "" || spec.includes(targetHandle);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// src/video-ui-defaults.ts
|
|
313
|
+
function uiAspectRatioFill(provider) {
|
|
314
|
+
if (isSeedance2Provider(provider) || isMinimaxH3Provider(provider) || isWan3Provider(provider)) return "adaptive";
|
|
315
|
+
if (isKling4RunnerProvider(provider)) return "auto";
|
|
316
|
+
return void 0;
|
|
317
|
+
}
|
|
318
|
+
function uiResolutionFill(provider) {
|
|
319
|
+
if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4RunnerProvider(provider) || isGeminiOmniPerSecondProvider(provider) || isPixverseV6MaxProvider(provider)) return PRICING_DEFAULT_RESOLUTION[provider];
|
|
320
|
+
if (isSeedance2Provider(provider)) return MODEL_CATALOG[provider]?.resolutions?.[0];
|
|
321
|
+
return void 0;
|
|
322
|
+
}
|
|
323
|
+
function uiDurationFill(provider) {
|
|
324
|
+
if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4RunnerProvider(provider) || isPixverseV6MaxProvider(provider)) return 5;
|
|
325
|
+
if (isGeminiOmniProvider(provider)) return 8;
|
|
326
|
+
return void 0;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
export { AUDIO_PRODUCER_TYPES, DYNAMIC_PRODUCER_TYPES, FAN_IN_TARGETS, FAN_OUT_ALL_OR_NOTHING_TYPES, FAN_OUT_EACH_HANDLES, FAN_OUT_EACH_TYPES, IMAGE_PRODUCER_TYPES, LIST_OUTPUT_HANDLES, OWN_LIST_NODE_TYPES, VIDEO_PRODUCER_TYPES, defaultEdgeOutputMode, isFanInEdge, isFanInNodeType, isListOutputHandle, listResultsServeHandle, ownsItsList, uiAspectRatioFill, uiDurationFill, uiResolutionFill };
|
|
330
|
+
//# sourceMappingURL=chunk-EPXGG27L.js.map
|
|
331
|
+
//# sourceMappingURL=chunk-EPXGG27L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/producer-types.ts","../src/video-ui-defaults.ts"],"names":[],"mappings":";;;;;;AA2BO,IAAM,oBAAA,GAA4C,eAAe,sBAAA,EAAwB;AAAA,EAC9F,gBAAA;AAAA,EACA,gBAAA;AAAA,EACA,SAAA;AAAA;AAAA,EACA,eAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,gBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,oBAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,gBAAA;AAAA,EACA,cAAA;AAAA,EACA,eAAA;AAAA,EACA,gBAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,eAAA;AAAA,EACA,aAAA;AAAA,EACA,cAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,WAAA;AAAA;AAAA;AAAA,EAGA,cAAA;AAAA,EACA,cAAA;AAAA;AAAA;AAAA;AAAA,EAIA,WAAA;AAAA,EACA,kBAAA;AAAA,EACA,mBAAA;AAAA,EACA,cAAA;AAAA,EACA,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,YAAA;AAAA,EACA,cAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA,EACA,YAAA;AAAA;AAAA,EAEA,YAAA;AAAA,EACA,gBAAA;AAAA,EACA,iBAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAEA,WAAA;AAAA;AAAA,EAEA,kBAAA;AAAA;AAAA,EAEA,yBAAA;AAAA;AAAA;AAAA,EAGA,gBAAA;AAAA;AAAA;AAAA,EAGA,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,eAAA;AAAA;AAAA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,CAAA,IAAK,6BAAA,CAA8B,QAAQ,CAAA,IAAK,uBAAA,CAAwB,QAAQ,CAAA,EAAG,OAAO,2BAA2B,QAAQ,CAAA;AAC1N,EAAA,IAAI,mBAAA,CAAoB,QAAQ,CAAA,EAAG,OAAO,cAAc,QAAQ,CAAA,EAAG,cAAc,CAAC,CAAA;AAClF,EAAA,OAAO,MAAA;AACT;AAWO,SAAS,eAAe,QAAA,EAAsC;AACnE,EAAA,IAAI,cAAA,CAAe,QAAQ,CAAA,IAAK,gBAAA,CAAiB,QAAQ,CAAA,IAAK,sBAAA,CAAuB,QAAQ,CAAA,IAAK,uBAAA,CAAwB,QAAQ,CAAA,EAAG,OAAO,CAAA;AAC5I,EAAA,IAAI,oBAAA,CAAqB,QAAQ,CAAA,EAAG,OAAO,CAAA;AAC3C,EAAA,OAAO,MAAA;AACT","file":"chunk-EPXGG27L.js","sourcesContent":["/**\n * Producer-type sets — single source of truth for the node types whose\n * primary output is a video URL, audio URL, etc.\n *\n * Consumed by:\n * - backend/src/services/workflow-engine/execution-graph.ts (orchestrator\n * dispatch + asset-type tagging in payload-builder, output-extractor,\n * inline-executor — re-exported there as VIDEO_SOURCE_TYPES /\n * AUDIO_SOURCE_TYPES for backwards compatibility).\n * - frontend/src/lib/generate-video-handles.ts (handle connection\n * validation on the Generate Video node).\n *\n * Lifting these here ensures the frontend handle validator can never reject\n * a connection from a node type that the backend would happily route at\n * execution time (the prior drift bug, see issue 1 of the Task 4.1 review).\n */\nimport { UGC_PRIMARY_HANDLE } from \"./ugc-node-wires.js\"\nimport { composeUnitRecord, composeUnitSet, unitFanOutEach, unitListPips, unitProducers } from \"./unit-contract-compose.js\"\n\n// Each producer set below is its hand-written members ∪ the node units\n// (tools/units/README.md) of that producer kind, from their generated contract\n// rows, in that order — a type in both throws at load (composeUnitSet).\n\n/**\n * Source node types whose primary output is a video URL.\n * Mirrors the backend execution-graph VIDEO_SOURCE_TYPES verbatim.\n */\nexport const VIDEO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet(\"VIDEO_PRODUCER_TYPES\", [\n \"image-to-video\",\n \"video-to-video\",\n \"switchx\", // Beeble SwitchX relight/composite\n \"text-to-video\",\n // Unified video node — emits videoUrl identically to i2v/t2v (its payload-builder\n // case dispatches dynamically to \"image-to-video\" or \"text-to-video\" jobName based\n // on whether a start frame is wired). Without this, getPrimaryOutput would fall\n // through to the imageUrl/videoUrl/audioUrl/text default and downstream consumers\n // could silently misroute the output.\n \"generate-video\",\n // Generate Video Pro — Seedance-2-family multi-segment stitch variant of\n // generate-video (same \"emits videoUrl\" contract; a trimmed provider +\n // handle set). Must mirror generate-video here or its output can't connect\n // downstream (the recurring \"cannot connect the outputs\" bug class).\n \"generate-video-pro\",\n // Edit Video Pro — Seedance-2-family span-replace sibling of generate-\n // video-pro (same \"emits videoUrl\" contract; source video + prompt in,\n // ONE video out). Must mirror generate-video-pro here or its output can't\n // connect downstream (the recurring \"cannot connect the outputs\" bug class).\n \"edit-video-pro\",\n \"upload-video\",\n \"youtube-video\",\n \"combine-videos\",\n \"lip-sync\",\n \"speech-to-video\",\n \"motion-transfer\",\n \"video-upscale\",\n \"video-depth\",\n \"extend-video\",\n // face-swap output is video (writes generatedVideoUrl, per-result `url`).\n // Frontend execution-graph already includes it in VIDEO_SOURCE_TYPES; this\n // entry brings the shared set in line so canvas typed-handle validation\n // doesn't reject face-swap → video-consumer edges that the orchestrator\n // would happily route at runtime.\n \"face-swap\",\n // Speaker View (C3.2): an EDL rendered with its speakers framed — one VIDEO\n // out (no audio-only render). Registered in RENDER_NODE_TYPES as well.\n \"speaker-view\",\n \"video-retake\",\n // video-sfx: adds an SFX track to a video → emits a video URL. Belongs here so\n // canvas handle validation accepts video-sfx → video-consumer edges and the\n // backend routes its output as video (it was previously relying on a fallback).\n \"video-sfx\",\n \"suno-music-video\",\n \"merge-video-audio\",\n \"add-captions\",\n \"resize-video\",\n \"social-media-format\",\n \"trim-video\",\n \"render-video\",\n \"speed-ramp\",\n \"loop-video\",\n \"fade-video\",\n // Video Mask emits its mask as a video; Mask Composite its composite.\n \"video-mask\",\n \"mask-composite\",\n \"transcode-video\",\n \"manual-edit\",\n // AI Avatar (HeyGen): avatar + voice/audio → video.\n \"ai-avatar\",\n // Cinematic Avatar (HeyGen cinematic_avatar): prompt + 1–3 avatar looks → video.\n \"cinematic-avatar\",\n // Assemble Narrated Video: fits N (clip, voice) blocks into one MP4 → video.\n \"assemble-narrated-video\",\n // Still to Video: one still image + one audio track → MP4 (local FFmpeg,\n // no provider). Emits generatedVideoUrl like every other ffmpeg video node.\n \"still-to-video\",\n // Slideshow: 2-100 stills + one optional audio track → MP4 (local FFmpeg,\n // no provider). Same contract; images arrive via the image-collage lane.\n \"slideshow\",\n // 3D Render Pro: authors a scene AND exports it in one operation, settling\n // with the standard `videoUrl` field. It is a video producer as much as it\n // is a composition producer — omitting it here is the \"cannot connect the\n // outputs\" bug, and its `composition` handle is typed separately.\n \"pro-3d-render\",\n // Video Overlay: timed image layers over a video in one local FFmpeg pass\n // (the base audio copied) — emits a video URL on `video-out`.\n \"video-overlay\",\n // UGC Clip: renders one clip of a UGC video from its ticket — emits a video\n // URL on `video-out` (one per fan-out iteration).\n \"ugc-clip\",\n // UGC Finish: the video's clips, finished, as one ordered list — a registered producer, so a\n // Bundle edge into Combine Videos routes each one as a video, in order.\n \"ugc-finish-clips\",\n], unitProducers(\"video\"))\n\n/**\n * Source node types whose output media-type cannot be classified\n * statically — iterators, dynamic dispatchers, sub-workflow wrappers.\n * The orchestrator decides their actual output type at execution time\n * based on what's wired upstream (loop iterates upstream column type;\n * sub-workflow emits its leaf node's type; adjust-volume passes through\n * video or audio based on its `lastInputType` runtime field;\n * voice-changer emits audio in audio mode, video+audio in video mode).\n *\n * Typed-handle validators (frontend/src/lib/{generate-image,generate-\n * video,ffmpeg}-handles.ts) must include these as acceptors on EVERY\n * media-typed input handle — otherwise the canvas validator hard-\n * rejects edges that the orchestrator would happily route at runtime.\n *\n * Lifted here from `frontend/src/lib/ffmpeg-handles.ts` (where the\n * escape hatch was first added) so the same set drives ALL handle\n * validators uniformly. Adding a new dynamic-output node type means\n * one edit here instead of N across sibling validator files.\n *\n * Intentionally OMITTED:\n * - `webhook-trigger` / `schedule-trigger` — their outputs are\n * user-defined JSON shapes, not media URLs. Accepting them as\n * media producers creates false-positive drops at the canvas\n * that fail at execution. Users wanting trigger → media flows\n * should wire through an upload node.\n */\nexport const DYNAMIC_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet(\"DYNAMIC_PRODUCER_TYPES\", [\n \"list\",\n \"sub-workflow\",\n \"adjust-volume\",\n // Pitch & Tempo: audio in → audio out, video in → video out (picture\n // copied). Dual-mode like adjust-volume; stays in AUDIO_PRODUCER_TYPES as\n // its default.\n \"pitch-tempo\",\n // Dual-mode: audio in → audio out; video in → video out (+ revoiced audio).\n // Listed here so canvas validators accept its output on BOTH audio and video\n // input handles (it also stays in AUDIO_PRODUCER_TYPES as its default).\n \"voice-changer\",\n // voice-changer-pro (renamed from voice-recast in #3581) is a behavioral\n // twin of voice-changer — identical dual-mode output. Must mirror it in\n // EVERY producer set or its outputs can't connect (was the \"cannot connect\n // the outputs of voice-changer-pro\" bug). Guarded by producer-types.test.ts.\n \"voice-changer-pro\",\n // Dubbing joined the dual-mode family with the full-surface upgrade:\n // audio in → dubbed audio; video in (or a video sourceUrl) → dubbed VIDEO\n // (+ audio sidecar). Same wiring contract as voice-changer; stays in\n // AUDIO_PRODUCER_TYPES as its default. Explicitly asserted in\n // producer-types.test.ts (the suite does not fail on omission).\n \"dubbing\",\n \"reduce\",\n // Dual-output time chunker (UI label \"Split into Chunks\"; type id stays\n // \"split-media\"): video in → video chunks, audio in → audio chunks — two\n // independent lanes on two output handles. Like voice-changer, the canvas\n // validator only sees the source NODE type, not which handle a wire leaves,\n // so it lives here to be accepted on BOTH audio and video input handles. The\n // backend routes the correct lane by sourceHandle in getPrimaryOutput\n // (output-extractor.ts); the frontend does so in extractNodeOutput.\n \"split-media\",\n // apply-edl renders an EDL into ONE media output whose type is decided at\n // run time by the node's `output` setting (video OR audio) — so its static\n // medium is genuinely unknown and it belongs here, letting canvas validators\n // accept its default media handle on BOTH audio and video input handles. It\n // ALSO emits a fixed `json` handle (the remapped Transcript); that half lives\n // in JSON_PRODUCER_TYPES (frontend/src/lib/data-handles.ts). The FIRST node\n // with both a dynamic media handle and a fixed json handle. Because\n // getOutputType (presentation-utils.ts) deliberately returns \"data\" for\n // DYNAMIC members, apply-edl is ALSO added to the literal VIDEO_OUTPUT_TYPES\n // there so a published app renders the cut as video, mirroring the\n // voice-changer/dubbing precedent. Asserted in producer-types.test.ts (the\n // suite does not fail on omission).\n \"apply-edl\",\n], unitProducers(\"dynamic\"))\n\n/**\n * Source node types whose primary output is an audio URL.\n * Mirrors the backend execution-graph AUDIO_SOURCE_TYPES verbatim.\n */\nexport const AUDIO_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet(\"AUDIO_PRODUCER_TYPES\", [\n \"text-to-speech\",\n \"text-to-audio\",\n \"generate-music\",\n \"upload-audio\",\n \"suno-generate\",\n \"suno-cover\",\n \"suno-extend\",\n \"suno-separate\",\n \"audio-separation\",\n \"suno-mashup\",\n \"suno-replace-section\",\n \"suno-add-instrumental\",\n \"suno-add-vocals\",\n \"suno-convert-wav\",\n \"suno-upload-extend\",\n \"trim-audio\",\n \"mix-audio\",\n \"combine-audio\",\n \"adjust-volume\",\n \"audio-fx\",\n \"pitch-tempo\",\n \"reference-audio\",\n \"audio-isolation\",\n \"text-to-dialogue\",\n \"voice-changer\",\n // Twin of voice-changer (see DYNAMIC_PRODUCER_TYPES note). Audio is its\n // default output mode; video mode is handled via DYNAMIC membership.\n \"voice-changer-pro\",\n \"dubbing\",\n \"voice-remix\",\n \"voice-design\",\n // Extract Audio: demuxes a video's audio track to a standalone MP3.\n \"extract-audio\",\n], unitProducers(\"audio\"))\n\n/**\n * Source node types whose output is an IMAGE URL — what feeds a References\n * input. ONE set for the canvas validators (`frontend/src/lib/\n * generate-image-handles.ts` re-exports it), the backend's Generate Image\n * handle migration and the MCP edge normalizer (`llm-chat`'s legacy `in`):\n * they used to keep separate copies, and the backend's lagged by eight types.\n */\nexport const IMAGE_PRODUCER_TYPES: ReadonlySet<string> = composeUnitSet(\"IMAGE_PRODUCER_TYPES\", [\n \"upload-image\", \"generate-image\", \"edit-image\", \"image-to-image\", \"modify-image\", \"upscale-image\", \"remove-background\",\n // extract-frame produces a single still image extracted from a video source.\n \"extract-frame\",\n // generate-mask emits the source image AND a mask PNG; its `image` source\n // pip is the passthrough (the same image as the input).\n \"generate-mask\",\n // paint-mask emits the hand-painted mask PNG (a plain image at runtime).\n // Membership is what makes mask targets accept it — mask is an advisory\n // color, not a gated type.\n \"paint-mask\",\n // reference-sheet's `sheet` is one composited image and `panels` carries\n // clean reference images; both resolve to image URLs at runtime.\n \"reference-sheet\",\n // reference-board's `image` pip emits a real generated board image.\n \"reference-board\",\n // image-collage composites N images → ONE image.\n \"image-collage\",\n // image-overlay places layers on a base → ONE image.\n \"image-overlay\",\n // 3D Render Pro's `stills` handle carries one PNG per shot of the exported\n // composition (spread into referenceImageUrls like reference-sheet\n // `panels`). A validator sees only the source NODE type, so this also makes\n // its `video` pip droppable on an image input — the handle-blind trade\n // reference-sheet and split-media already make; the input resolvers route\n // by handle, so only `stills` becomes an image at runtime. Deliberately NOT\n // in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY\n // asset, and 3D Render Pro's is the MP4.\n \"pro-3d-render\",\n], unitProducers(\"image\"))\n\n/**\n * Source node types whose primary output is a LIST that, by default, fans out\n * one downstream execution per element when an edge leaves them WITHOUT an\n * explicit `outputMode` (all other edges default to \"last\"). `selector` is\n * included because its picked/rest channels are lists too.\n *\n * Single source of truth for the fan-out \"each\" default, consumed by:\n * - backend/src/services/workflow-engine/input-resolver.ts (DEFAULT_EACH_TYPES)\n * - frontend/src/components/editor/workflow-editor/types.ts (FAN_OUT_EACH_TYPES)\n * - frontend/src/components/editor/workflow-editor/node-input-resolver.ts\n *\n * These three previously kept independent copies; the backend copy drifted\n * (missing the four list-transform types), so server-side workflow runs\n * silently dropped all-but-the-first item for filter-list / deduplicate /\n * merge-lists / sort-list sources while the canvas fanned out N ways. Lifting\n * the set here makes that drift impossible.\n */\nexport const FAN_OUT_EACH_TYPES: ReadonlySet<string> = new Set([\n \"list\",\n \"split-text\",\n \"filter-list\",\n \"deduplicate\",\n \"merge-lists\",\n \"sort-list\",\n \"selector\",\n // edit-plan `clips` mode emits a bare `Edl[]` on `data.generatedJson`, so an\n // edge leaving it defaults to \"each\" — one downstream execution (typically an\n // apply-edl render) per clip. The `tighten`/`chapters` modes emit an OBJECT,\n // for which the list extractors return undefined, so an \"each\" edge falls back\n // to the scalar `edl` value (no fan-out) — the same graceful degradation\n // web-scrape relies on. See `unwrapEditPlanOutput` in `edit-plan-contract.ts`.\n \"edit-plan\",\n // Content Ideas emits one creative brief per idea on `listResults`, so an\n // edge leaving it defaults to \"each\" — the node after it (typically\n // Generate Script) runs once per idea, on the server too.\n \"content-ideas\",\n])\n\n/**\n * Per-HANDLE \"each\" defaults, for a node whose outputs differ in kind: on the\n * `each` handles an edge without an explicit `outputMode` defaults to \"each\",\n * on its other handles to \"last\". `primary` is the handle an edge with no\n * `sourceHandle` reads (agent-written workflow JSON often omits it).\n *\n * The list an \"each\" edge reads is the node's per-iteration results\n * (`listResults`) — it exists only when the node itself ran once per item, so\n * after a single run the edge degrades to the single value, exactly like a\n * `FAN_OUT_EACH_TYPES` member with one item.\n *\n * Its hand-written rows ∪ the node units' rows (`contract.fanOutEach`,\n * generated/unit-contracts.ts); a type in both refuses to load.\n */\nexport const FAN_OUT_EACH_HANDLES: Readonly<Record<string, { readonly each: readonly string[]; readonly primary: string }>> = composeUnitRecord(\"FAN_OUT_EACH_HANDLES\", {\n // Camera Switch run once per clip (Edit Plan in clips mode): each clip's\n // switched EDL is its own Apply EDL render. Its transcript is the same for\n // every clip (the master clock, renamed), so that handle stays one value\n // (decided 2026-10-04).\n \"camera-switch\": { each: [\"edl\"], primary: \"edl\" },\n // UGC Clips: one ticket per clip on `clips` (each); `plan-out` and\n // `transcript` carry one value. Not a FAN_OUT_EACH_TYPES member — every\n // handle of such a member would fan out. Its one run writes the tickets as\n // its list (`listResults`, the editor's `__listResults`). The pip an edge\n // with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).\n \"ugc-clips\": { each: [\"clips\"], primary: UGC_PRIMARY_HANDLE[\"ugc-clips\"]! },\n // A node unit declares its row in unit.json (contract.fanOutEach); it is added after these.\n}, unitFanOutEach())\n\n/**\n * Fan-out nodes whose iterations must ALL succeed: one failed item fails the\n * node (today's rule tolerates a partial list). UGC Clip — a missing clip\n * silently drops a beat from the script (spec R17). Already-started items\n * finish and settle; their jobs are reused on the next run.\n */\nexport const FAN_OUT_ALL_OR_NOTHING_TYPES: ReadonlySet<string> = new Set([\"ugc-clip\"])\n\n/**\n * Nodes whose saved list is the list their last run PRODUCED — `__listResults`\n * (Extract Field's JSON value on `generatedJson`) — and never a history in\n * `generatedResults`: Extract Field, JSON Process and Site Capture. No run of the first two writes\n * one; earlier builds' server runs did (the run's text, the links of a list of\n * links), and both engines' list readers leave it out for these two (decided\n * 2026-10-05). Single source of truth for the backend engine and the editor.\n */\nexport const OWN_LIST_NODE_TYPES: ReadonlySet<string> = new Set([\n \"extract-field\",\n \"json-process\",\n // Site Capture: its stills, in page order — the last capture's, never every capture's (site-capture-node.ts).\n \"site-capture\",\n])\n\n/** Whether a node's saved list is its own `__listResults`, never a history. */\nexport function ownsItsList(nodeType: string | null | undefined): boolean {\n return typeof nodeType === \"string\" && OWN_LIST_NODE_TYPES.has(nodeType)\n}\n\n/**\n * The output pips that carry the LIST one run produced — several files on one\n * pip (a node unit's `handles.outputs[].list`: each layer of a split image). An\n * edge leaving one runs the next node once per item by default (\"each\"); a\n * Bundle hands the whole list to a node that takes several. Unlike\n * FAN_OUT_EACH_HANDLES, the list is what ONE run made on that pip, never the\n * node's per-iteration results. An edge naming no pip reads the node's primary\n * output, which is never a list pip (tools/units/json-output-rules.mjs).\n * Node units only (generated/unit-contracts.ts UNIT_LIST_PIPS).\n */\nexport const LIST_OUTPUT_HANDLES: Readonly<Record<string, readonly string[]>> = composeUnitRecord(\"LIST_OUTPUT_HANDLES\", {}, unitListPips())\n\n/** Whether an edge leaving `sourceHandle` of a `sourceType` node carries a list one run produced (LIST_OUTPUT_HANDLES). */\nexport function isListOutputHandle(\n sourceType: string | null | undefined,\n sourceHandle: string | null | undefined,\n): boolean {\n if (typeof sourceType !== \"string\" || typeof sourceHandle !== \"string\" || !Object.hasOwn(LIST_OUTPUT_HANDLES, sourceType)) return false\n return LIST_OUTPUT_HANDLES[sourceType]!.includes(sourceHandle)\n}\n\n/** The `outputMode` an edge has when none is set on it — the ONE rule both\n * engines, the credit estimate and the editor read. */\nexport function defaultEdgeOutputMode(\n sourceType: string | null | undefined,\n sourceHandle: string | null | undefined,\n): \"each\" | \"last\" {\n if (typeof sourceType !== \"string\") return \"last\"\n if (FAN_OUT_EACH_TYPES.has(sourceType)) return \"each\"\n if (isListOutputHandle(sourceType, sourceHandle)) return \"each\"\n const entry = FAN_OUT_EACH_HANDLES[sourceType]\n if (!entry) return \"last\"\n return entry.each.includes(sourceHandle || entry.primary) ? \"each\" : \"last\"\n}\n\n/** Whether an edge from `sourceHandle` reads the node's per-iteration results\n * (`listResults` — each iteration's PRIMARY output). False on the other\n * handles of a `FAN_OUT_EACH_HANDLES` node: Camera Switch's transcript is one\n * value, never the list of switched EDLs, whatever mode its edge is set to. */\nexport function listResultsServeHandle(\n sourceType: string | null | undefined,\n sourceHandle: string | null | undefined,\n): boolean {\n const entry = typeof sourceType === \"string\" ? FAN_OUT_EACH_HANDLES[sourceType] : undefined\n return !entry || entry.each.includes(sourceHandle || entry.primary)\n}\n\n/**\n * FAN-IN targets: nodes that FOLD everything wired into them into ONE run,\n * instead of running once per upstream item. Keyed by node type; the value\n * names the target handles that fold (`\"*\"` = every handle). An edge into any\n * other handle of such a node is routed normally — Content Ideas folds its\n * recipes but reads its brand from a `field-brand` wire like any field.\n *\n * Single source of truth for both engines' input resolvers (the backend and\n * the editor each used to keep a private `new Set([\"reduce\"])`). A fan-in\n * node is never itself fanned out by an upstream list.\n */\nexport const FAN_IN_TARGETS: Readonly<Record<string, \"*\" | readonly string[]>> = {\n // Choose Best — every wire is a candidate.\n reduce: \"*\",\n // Content Ideas — one or more recipes, from several Content Recipe nodes\n // and/or one that ran once per post.\n \"content-ideas\": [\"recipes\"],\n // Telegram Reply — one message per run, whatever is wired into its text\n // input: a list (or a writer that ran once per item) arrives as one\n // message, never as a burst of sends to the owner's chat.\n \"telegram-account-send\": [\"in\"],\n // The list operators — they READ the whole list wired into them (their\n // executors collect every upstream item themselves) and emit a list. Run\n // once per item by an \"each\" wire (a Split Text, a List, a node that ran per\n // item), every iteration saw the same whole list and answered with its\n // first match: a Filter List fed 11 stories handed 11 copies of story one\n // downstream, and every paid stage after it ran 11 times on it\n // (2026-10-06). A list operator is never fanned out, on any wire.\n \"filter-list\": \"*\",\n deduplicate: \"*\",\n \"merge-lists\": \"*\",\n \"sort-list\": \"*\",\n selector: \"*\",\n // Speaker Frames on a clip pack (P3-24 (a), decided 2026-10-06): ONE run over\n // the union of the clips' spans — the pack's EDLs fold onto its `edl` wire\n // instead of running one detection job (and one minimum charge) per clip.\n \"speaker-frames\": [\"edl\"],\n // UGC Finish: ONE run over every clip of the video, in clip order — the finish plans its\n // cut and its sound over all of them at once, so it is never run once per clip.\n \"ugc-finish-clips\": [\"clips\"],\n}\n\nexport function isFanInNodeType(nodeType: string | undefined | null): boolean {\n return typeof nodeType === \"string\" && Object.prototype.hasOwnProperty.call(FAN_IN_TARGETS, nodeType)\n}\n\n/** True when an edge into `targetHandle` of a `targetType` node is folded.\n * An edge with NO target handle (workflow JSON written by an agent often\n * omits it) lands on the node's primary input, which is the folding one. */\nexport function isFanInEdge(targetType: string | undefined | null, targetHandle: string | null | undefined): boolean {\n if (!isFanInNodeType(targetType)) return false\n const spec = FAN_IN_TARGETS[targetType as string]!\n if (spec === \"*\") return true\n return targetHandle == null || targetHandle === \"\" || spec.includes(targetHandle)\n}\n","/**\n * UI-default fills for the unified video nodes — the ONE source of truth shared\n * by the backend DAG payload builder, the config-panel fail-safe snaps and the\n * node's hover/run strip.\n *\n * Several config panels RENDER a default without persisting it to node data, so\n * an untouched node submits `aspectRatio` / `resolution` undefined and the\n * enqueued job row (and the /v1/jobs echo) then disagrees with what actually\n * renders. Worse, the panels' generic snap writes `resolutions[0]` for a stale\n * value, which is the CHEAPEST tier under the repo's ascending-resolution\n * convention — not necessarily the tier the model renders and bills.\n *\n * These helpers were local to `backend/src/services/workflow-engine/payload-builder.ts`\n * until the Wan 3.0 launch gave the platform its first provider whose declared\n * billing default differs from `resolutions[0]`; three surfaces then had to\n * agree, so they live here.\n *\n * The resolution fill is per-family ON PURPOSE. Wan 3.0 (and Vidu Q4, whose\n * ascending list starts at 540p) reads its DECLARED\n * billing default (PRICING_DEFAULT_RESOLUTION = 720p) because its catalog list\n * is ascending, so an index-0 fill would write 480p — a tier both `runWan3`\n * (which renders 720P) and the credit identifier (which bills the 720p row)\n * disagree with. The Seedance family keeps its historical first-catalog-tier\n * fill, deliberately: switching it to PRICING_DEFAULT_RESOLUTION would reprice\n * live seedance-2-5 runs, whose declared default (720p) differs from the 480p\n * this has always filled. That 480p-fill vs 720p-billing-default divergence on\n * seedance-2-5 is a KNOWN pre-existing gap, out of scope here — do not \"align\"\n * the branches without repricing it deliberately.\n */\n\nimport {\n PRICING_DEFAULT_RESOLUTION,\n isSeedance2Provider,\n isMinimaxH3Provider,\n isWan3Provider,\n isViduQ4Provider,\n isKling4RunnerProvider,\n isGeminiOmniProvider,\n isGeminiOmniPerSecondProvider,\n isPixverseV6MaxProvider,\n} from \"./model-constants.js\"\nimport { MODEL_CATALOG } from \"./model-catalog.js\"\n\n/** `adaptive` is the aspect default for Seedance 2, MiniMax H3 and Wan 3.0. */\nexport function uiAspectRatioFill(provider: string): string | undefined {\n if (isSeedance2Provider(provider) || isMinimaxH3Provider(provider) || isWan3Provider(provider)) return \"adaptive\"\n // Kling 4.0 (and Flash): `auto` follows the materials (frames / references)\n // and renders 16:9 with none — KIE's own default when the field is omitted.\n // Flash's keyframe endpoint has no `auto`, but it runs only with a start\n // frame, where the ratio is never sent (the clip follows the frame).\n if (isKling4RunnerProvider(provider)) return \"auto\"\n return undefined\n}\n\n/** See the file docstring — per-family on purpose; never a generic\n * PRICING_DEFAULT_RESOLUTION read (that would reprice seedance-2-5). */\nexport function uiResolutionFill(provider: string): string | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4RunnerProvider(provider) || isGeminiOmniPerSecondProvider(provider) || isPixverseV6MaxProvider(provider)) return PRICING_DEFAULT_RESOLUTION[provider]\n if (isSeedance2Provider(provider)) return MODEL_CATALOG[provider]?.resolutions?.[0]\n return undefined\n}\n\n/**\n * Duration the node RENDERS and BILLS when `data.duration` is unset, for the\n * families whose credit identifier declares a duration fallback that is NOT\n * `durations[0]`. Wan 3.0's bare identifier is the 5s tier while its ladder\n * starts at 2s; Vidu Q4's is the 5s tier while its ladder starts at 3s;\n * PixVerse V6 Max's is the 5s tier while its ladder starts at 1s; the\n * Gemini Omni family's is the 8s tier while its ladder starts at 4s. Everyone else falls back to the first listed duration, so this returns\n * undefined and the caller keeps `durations[0]`.\n */\nexport function uiDurationFill(provider: string): number | undefined {\n if (isWan3Provider(provider) || isViduQ4Provider(provider) || isKling4RunnerProvider(provider) || isPixverseV6MaxProvider(provider)) return 5\n if (isGeminiOmniProvider(provider)) return 8\n return undefined\n}\n"]}
|