@nodaro/shared 3.58.0 → 3.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/dist/{chunk-OWNPYQSH.cjs → chunk-4GGLKRYI.cjs} +16 -3
  2. package/dist/chunk-4GGLKRYI.cjs.map +1 -0
  3. package/dist/{chunk-5PJC4ZWO.cjs → chunk-5G23AJBU.cjs} +6 -6
  4. package/dist/{chunk-5PJC4ZWO.cjs.map → chunk-5G23AJBU.cjs.map} +1 -1
  5. package/dist/{chunk-IKOKRJDI.cjs → chunk-5HK5Z5OB.cjs} +4 -4
  6. package/dist/{chunk-IKOKRJDI.cjs.map → chunk-5HK5Z5OB.cjs.map} +1 -1
  7. package/dist/{chunk-WLFT5UVV.cjs → chunk-5Y42RIGY.cjs} +8 -8
  8. package/dist/{chunk-WLFT5UVV.cjs.map → chunk-5Y42RIGY.cjs.map} +1 -1
  9. package/dist/{chunk-L26G7B27.js → chunk-6AJOTEVC.js} +3 -3
  10. package/dist/{chunk-L26G7B27.js.map → chunk-6AJOTEVC.js.map} +1 -1
  11. package/dist/{chunk-OMUYZKRB.js → chunk-6Q6SI7AG.js} +3 -3
  12. package/dist/{chunk-OMUYZKRB.js.map → chunk-6Q6SI7AG.js.map} +1 -1
  13. package/dist/{chunk-4ZZ6SVIQ.cjs → chunk-A6HRY3WF.cjs} +269 -37
  14. package/dist/chunk-A6HRY3WF.cjs.map +1 -0
  15. package/dist/{chunk-ZX6RRM6R.cjs → chunk-AXT7YNOR.cjs} +51 -51
  16. package/dist/{chunk-ZX6RRM6R.cjs.map → chunk-AXT7YNOR.cjs.map} +1 -1
  17. package/dist/{chunk-ODTZV3BW.js → chunk-AZGONXWV.js} +4 -4
  18. package/dist/{chunk-ODTZV3BW.js.map → chunk-AZGONXWV.js.map} +1 -1
  19. package/dist/{chunk-S5VBJJUT.cjs → chunk-BDXXOEBZ.cjs} +80 -57
  20. package/dist/chunk-BDXXOEBZ.cjs.map +1 -0
  21. package/dist/{chunk-QPBBIRLF.cjs → chunk-BGIJO5V4.cjs} +39 -39
  22. package/dist/{chunk-QPBBIRLF.cjs.map → chunk-BGIJO5V4.cjs.map} +1 -1
  23. package/dist/{chunk-NZRG5CXQ.cjs → chunk-BLJUCPMV.cjs} +5 -2
  24. package/dist/chunk-BLJUCPMV.cjs.map +1 -0
  25. package/dist/{chunk-KYHDKKUJ.cjs → chunk-BXNPO3PL.cjs} +8 -8
  26. package/dist/{chunk-KYHDKKUJ.cjs.map → chunk-BXNPO3PL.cjs.map} +1 -1
  27. package/dist/{chunk-S7FCFQ6X.js → chunk-CF4S4N5X.js} +16 -4
  28. package/dist/chunk-CF4S4N5X.js.map +1 -0
  29. package/dist/{chunk-4UUX62S3.cjs → chunk-CIOXUPCJ.cjs} +12 -12
  30. package/dist/{chunk-4UUX62S3.cjs.map → chunk-CIOXUPCJ.cjs.map} +1 -1
  31. package/dist/{chunk-5UVBFY2G.cjs → chunk-DQIJPDHC.cjs} +11 -11
  32. package/dist/{chunk-5UVBFY2G.cjs.map → chunk-DQIJPDHC.cjs.map} +1 -1
  33. package/dist/{chunk-UMPZR56R.js → chunk-DS2TOM32.js} +3 -3
  34. package/dist/{chunk-UMPZR56R.js.map → chunk-DS2TOM32.js.map} +1 -1
  35. package/dist/{chunk-K6UMB37V.js → chunk-EN2YI5TV.js} +3 -3
  36. package/dist/{chunk-K6UMB37V.js.map → chunk-EN2YI5TV.js.map} +1 -1
  37. package/dist/{chunk-SEQ5L72K.js → chunk-G6GMY5BC.js} +21 -4
  38. package/dist/chunk-G6GMY5BC.js.map +1 -0
  39. package/dist/chunk-G7ZYZQKO.cjs +27 -0
  40. package/dist/{chunk-QCW6J6BQ.cjs.map → chunk-G7ZYZQKO.cjs.map} +1 -1
  41. package/dist/{chunk-WBERPAXE.cjs → chunk-GNPJ2JLE.cjs} +6 -6
  42. package/dist/{chunk-WBERPAXE.cjs.map → chunk-GNPJ2JLE.cjs.map} +1 -1
  43. package/dist/{chunk-VZXRDSWA.cjs → chunk-GWBQ3GPO.cjs} +43 -21
  44. package/dist/chunk-GWBQ3GPO.cjs.map +1 -0
  45. package/dist/{chunk-DCP7JFSE.cjs → chunk-HDHLZK7C.cjs} +5 -5
  46. package/dist/{chunk-DCP7JFSE.cjs.map → chunk-HDHLZK7C.cjs.map} +1 -1
  47. package/dist/{chunk-QVPIO2NU.cjs → chunk-HNEF2N5C.cjs} +5 -5
  48. package/dist/{chunk-QVPIO2NU.cjs.map → chunk-HNEF2N5C.cjs.map} +1 -1
  49. package/dist/{chunk-7JM5EZF3.cjs → chunk-HOKWJXHA.cjs} +13 -13
  50. package/dist/{chunk-7JM5EZF3.cjs.map → chunk-HOKWJXHA.cjs.map} +1 -1
  51. package/dist/{chunk-FVKCNAEQ.js → chunk-HP3YIWNJ.js} +9 -4
  52. package/dist/chunk-HP3YIWNJ.js.map +1 -0
  53. package/dist/{chunk-UJJUX6NW.cjs → chunk-HW6TLOK4.cjs} +9 -3
  54. package/dist/chunk-HW6TLOK4.cjs.map +1 -0
  55. package/dist/{chunk-A5ESI2NY.js → chunk-ICDLYU4I.js} +9 -9
  56. package/dist/{chunk-A5ESI2NY.js.map → chunk-ICDLYU4I.js.map} +1 -1
  57. package/dist/{chunk-JUEFRVHZ.js → chunk-IV6IDECY.js} +4 -4
  58. package/dist/{chunk-JUEFRVHZ.js.map → chunk-IV6IDECY.js.map} +1 -1
  59. package/dist/{chunk-HEUWAIXG.js → chunk-JKZVRKN3.js} +36 -14
  60. package/dist/chunk-JKZVRKN3.js.map +1 -0
  61. package/dist/{chunk-ZMH56CLL.js → chunk-KJZVQIN4.js} +3 -3
  62. package/dist/{chunk-ZMH56CLL.js.map → chunk-KJZVQIN4.js.map} +1 -1
  63. package/dist/{chunk-6CYS7VRH.js → chunk-KOLC7AF2.js} +262 -38
  64. package/dist/chunk-KOLC7AF2.js.map +1 -0
  65. package/dist/{chunk-CNSRCZYY.js → chunk-LN3EVFRS.js} +5 -5
  66. package/dist/{chunk-CNSRCZYY.js.map → chunk-LN3EVFRS.js.map} +1 -1
  67. package/dist/{chunk-DC2QPACA.js → chunk-MHY47BLL.js} +4 -4
  68. package/dist/{chunk-DC2QPACA.js.map → chunk-MHY47BLL.js.map} +1 -1
  69. package/dist/{chunk-AWS4BWEC.js → chunk-Q6IES3U2.js} +5 -2
  70. package/dist/chunk-Q6IES3U2.js.map +1 -0
  71. package/dist/{chunk-PK4ZR2SK.cjs → chunk-RRPPXZ36.cjs} +4 -4
  72. package/dist/{chunk-PK4ZR2SK.cjs.map → chunk-RRPPXZ36.cjs.map} +1 -1
  73. package/dist/{chunk-6TFWFYYI.js → chunk-SCYBGTX6.js} +3 -3
  74. package/dist/{chunk-6TFWFYYI.js.map → chunk-SCYBGTX6.js.map} +1 -1
  75. package/dist/{chunk-I7NG2D6X.cjs → chunk-SKFJIFEV.cjs} +21 -21
  76. package/dist/{chunk-I7NG2D6X.cjs.map → chunk-SKFJIFEV.cjs.map} +1 -1
  77. package/dist/{chunk-VVGSIWNL.js → chunk-TZ42IVSF.js} +4 -4
  78. package/dist/{chunk-VVGSIWNL.js.map → chunk-TZ42IVSF.js.map} +1 -1
  79. package/dist/{chunk-IQBIH3AE.js → chunk-URLDVK67.js} +3 -3
  80. package/dist/{chunk-IQBIH3AE.js.map → chunk-URLDVK67.js.map} +1 -1
  81. package/dist/{chunk-IOET54EV.js → chunk-VB2ARGQ6.js} +35 -3
  82. package/dist/chunk-VB2ARGQ6.js.map +1 -0
  83. package/dist/{chunk-BSENM6HM.js → chunk-VYQ25YQF.js} +3 -3
  84. package/dist/{chunk-BSENM6HM.js.map → chunk-VYQ25YQF.js.map} +1 -1
  85. package/dist/{chunk-QSWUSXRL.cjs → chunk-WGKAOUEQ.cjs} +41 -2
  86. package/dist/chunk-WGKAOUEQ.cjs.map +1 -0
  87. package/dist/{chunk-M7SMSAOU.js → chunk-YHVEZVAO.js} +4 -4
  88. package/dist/{chunk-M7SMSAOU.js.map → chunk-YHVEZVAO.js.map} +1 -1
  89. package/dist/entries/apps.cjs +43 -43
  90. package/dist/entries/apps.js +8 -8
  91. package/dist/entries/credits.cjs +155 -151
  92. package/dist/entries/credits.d.cts +32 -3
  93. package/dist/entries/credits.d.ts +32 -3
  94. package/dist/entries/credits.js +8 -8
  95. package/dist/entries/edl.cjs +63 -59
  96. package/dist/entries/edl.d.cts +15 -1
  97. package/dist/entries/edl.d.ts +15 -1
  98. package/dist/entries/edl.js +1 -1
  99. package/dist/entries/llm-models.d.cts +1 -1
  100. package/dist/entries/llm-models.d.ts +1 -1
  101. package/dist/entries/model-catalog.cjs +144 -84
  102. package/dist/entries/model-catalog.d.cts +4 -47
  103. package/dist/entries/model-catalog.d.ts +4 -47
  104. package/dist/entries/model-catalog.js +5 -5
  105. package/dist/entries/models.cjs +308 -288
  106. package/dist/entries/models.d.cts +3 -3
  107. package/dist/entries/models.d.ts +3 -3
  108. package/dist/entries/models.js +4 -4
  109. package/dist/entries/nodes.cjs +208 -208
  110. package/dist/entries/nodes.d.cts +1 -1
  111. package/dist/entries/nodes.d.ts +1 -1
  112. package/dist/entries/nodes.js +10 -10
  113. package/dist/entries/pipeline.cjs +152 -152
  114. package/dist/entries/pipeline.d.cts +1 -1
  115. package/dist/entries/pipeline.d.ts +1 -1
  116. package/dist/entries/pipeline.js +3 -3
  117. package/dist/entries/runtime-config.cjs +32 -28
  118. package/dist/entries/runtime-config.d.cts +24 -2
  119. package/dist/entries/runtime-config.d.ts +24 -2
  120. package/dist/entries/runtime-config.js +1 -1
  121. package/dist/entries/ugc.cjs +71 -71
  122. package/dist/entries/ugc.js +4 -4
  123. package/dist/entries/video.cjs +117 -117
  124. package/dist/entries/video.js +4 -4
  125. package/dist/entries/workflow.cjs +147 -147
  126. package/dist/entries/workflow.d.cts +8 -0
  127. package/dist/entries/workflow.d.ts +8 -0
  128. package/dist/entries/workflow.js +2 -2
  129. package/dist/gpt-image-2-6-BeZdT-pW.d.cts +98 -0
  130. package/dist/gpt-image-2-6-BeZdT-pW.d.ts +98 -0
  131. package/dist/index.cjs +1412 -1320
  132. package/dist/index.d.cts +7 -6
  133. package/dist/index.d.ts +7 -6
  134. package/dist/index.js +22 -22
  135. package/dist/{model-catalog-CCsA1isC.d.ts → model-catalog-D6Es7VG-.d.cts} +59 -3
  136. package/dist/{model-catalog-CCsA1isC.d.cts → model-catalog-D6Es7VG-.d.ts} +59 -3
  137. package/dist/{model-constants-BtXkUsX3.d.cts → model-constants-22k3fjp1.d.cts} +22 -1
  138. package/dist/{model-constants-BtXkUsX3.d.ts → model-constants-22k3fjp1.d.ts} +22 -1
  139. package/package.json +1 -1
  140. package/src/__tests__/camera-switch-contract.test.ts +12 -3
  141. package/src/__tests__/credit-identifiers.test.ts +18 -9
  142. package/src/__tests__/gpt-image-2-6-formats.test.ts +171 -0
  143. package/src/__tests__/gpt-image-2-size-rules.test.ts +80 -0
  144. package/src/__tests__/normalize-model-input.test.ts +10 -10
  145. package/src/__tests__/runtime-config.test.ts +28 -0
  146. package/src/camera-switch-contract.ts +13 -1
  147. package/src/credit-identifiers.ts +63 -3
  148. package/src/entries/credits.ts +1 -0
  149. package/src/entries/model-catalog.ts +17 -0
  150. package/src/entries/models.ts +7 -0
  151. package/src/entries/runtime-config.ts +1 -0
  152. package/src/gpt-image-2-6.ts +72 -0
  153. package/src/model-catalog.ts +350 -40
  154. package/src/model-constants.ts +40 -0
  155. package/src/node-execution-state.ts +8 -0
  156. package/src/node-runtime-keys.ts +3 -0
  157. package/src/runtime-config/contract.ts +34 -0
  158. package/dist/chunk-4ZZ6SVIQ.cjs.map +0 -1
  159. package/dist/chunk-6CYS7VRH.js.map +0 -1
  160. package/dist/chunk-AWS4BWEC.js.map +0 -1
  161. package/dist/chunk-FVKCNAEQ.js.map +0 -1
  162. package/dist/chunk-HEUWAIXG.js.map +0 -1
  163. package/dist/chunk-IOET54EV.js.map +0 -1
  164. package/dist/chunk-NZRG5CXQ.cjs.map +0 -1
  165. package/dist/chunk-OWNPYQSH.cjs.map +0 -1
  166. package/dist/chunk-QCW6J6BQ.cjs +0 -27
  167. package/dist/chunk-QSWUSXRL.cjs.map +0 -1
  168. package/dist/chunk-S5VBJJUT.cjs.map +0 -1
  169. package/dist/chunk-S7FCFQ6X.js.map +0 -1
  170. package/dist/chunk-SEQ5L72K.js.map +0 -1
  171. package/dist/chunk-UJJUX6NW.cjs.map +0 -1
  172. package/dist/chunk-VZXRDSWA.cjs.map +0 -1
@@ -53,6 +53,21 @@ type ImageQuality = typeof IMAGE_QUALITY_VALUES[number];
53
53
  /** The `background` vocabulary of the same two routes (vocabulary bound; the catalog snap gates per model). */
54
54
  declare const IMAGE_BACKGROUND_VALUES: readonly ["auto", "opaque", "transparent"];
55
55
  type ImageBackground = typeof IMAGE_BACKGROUND_VALUES[number];
56
+ /**
57
+ * The `outputFormat` vocabulary of the same two routes: the file a run writes
58
+ * (vocabulary bound; the catalog snap gates per model, `outputFormats`). No
59
+ * value is PNG. `gif` is an animation of square frames, `svg` a vector drawing.
60
+ */
61
+ declare const IMAGE_OUTPUT_FORMAT_VALUES: readonly ["png", "jpeg", "webp", "gif", "svg"];
62
+ type ImageOutputFormat = typeof IMAGE_OUTPUT_FORMAT_VALUES[number];
63
+ /** The `svgLevel` vocabulary: how much detail an SVG is drawn with, Standard to Max. */
64
+ declare const IMAGE_SVG_LEVEL_VALUES: readonly ["standard", "detailed", "max"];
65
+ type ImageSvgLevel = typeof IMAGE_SVG_LEVEL_VALUES[number];
66
+
67
+ /** The MIME type of each output format, as it is stored and served. */
68
+ declare const IMAGE_OUTPUT_FORMAT_MIME: Readonly<Record<ImageOutputFormat, string>>;
69
+ /** The file extension each output format is stored under. */
70
+ declare const IMAGE_OUTPUT_FORMAT_EXT: Readonly<Record<ImageOutputFormat, string>>;
56
71
  /** The `renderingSpeed` vocabulary (Ideogram's speed tiers — see {@link RENDERING_SPEED_SUPPORT}). */
57
72
  declare const IMAGE_RENDERING_SPEED_VALUES: readonly ["TURBO", "BALANCED", "QUALITY"];
58
73
  type ImageRenderingSpeed = typeof IMAGE_RENDERING_SPEED_VALUES[number];
@@ -551,6 +566,12 @@ declare function isSeedanceVideoEditProvider(provider: string | undefined): prov
551
566
  * plus the Seedance edit models dispatched through the text-to-video lane. */
552
567
  declare const VIDEO_TO_VIDEO_NODE_PROVIDERS: readonly ["wan", "wan-flash", "wan-videoedit", "luma-modify", "runway-aleph", "happyhorse-edit", "seedance-2-5"];
553
568
  type VideoToVideoNodeProvider = typeof VIDEO_TO_VIDEO_NODE_PROVIDERS[number];
569
+ /**
570
+ * The model a Video to Video request or node that names none runs on: the
571
+ * route's and the worker's default, and what the node's model menu shows for an
572
+ * unset model. One constant, so the server and the editor cannot disagree.
573
+ */
574
+ declare const DEFAULT_VIDEO_TO_VIDEO_PROVIDER: VideoToVideoNodeProvider;
554
575
  /**
555
576
  * The request shape Seedance edit mode requires, sent UP FRONT by the Video to
556
577
  * Video node: the output takes the source clip's own ratio and length
@@ -1729,4 +1750,4 @@ declare function applyDefaultVideoSelection<D>(input: {
1729
1750
  duration: D | number | undefined;
1730
1751
  };
1731
1752
 
1732
- export { IMAGE_MASK_MODE as $, AI_WRITER_PROVIDERS as A, type FaceSwapProvider as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, GEMINI_OMNI_12_MAX_SOURCE_SEC as G, GEMINI_OMNI_PER_SECOND_PROVIDERS as H, GEMINI_OMNI_PROVIDERS as I, GUIDANCE_SCALE_SUPPORT as J, GVP_ANCHOR_CHOICES as K, GVP_DEFAULT_PROVIDER as L, GVP_END_FRAME_PROVIDERS as M, GVP_EXTEND_PROVIDERS as N, GVP_SUPPORTED_PROVIDERS as O, type GvpAnchorChoice as P, type GvpAnchorWireMode as Q, HIGH_QUALITY_PROVIDERS as R, I2I_MASK_SUPPORT as S, I2I_STRENGTH_SUPPORT as T, IDEOGRAM_PROVIDERS as U, IMAGE_ASPECT_RATIO_VALUES as V, IMAGE_BACKGROUND_VALUES as W, IMAGE_EDIT_PROVIDERS as X, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Y, IMAGE_GEN_PROVIDERS as Z, IMAGE_I2I_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a, SEEDANCE_2_CONTINUATION_REF_SEC as a$, IMAGE_PROMPT_MAX as a0, IMAGE_QUALITY_VALUES as a1, IMAGE_RENDERING_SPEED_VALUES as a2, IMAGE_RESOLUTION_VALUES as a3, IMAGE_TO_VIDEO_PROVIDERS as a4, type ImageAspectRatio as a5, type ImageBackground as a6, type ImageEditProvider as a7, type ImageEditTargetResolution as a8, type ImageGenProvider as a9, MUSIC_PROVIDERS as aA, MUSIC_PROVIDER_LABELS as aB, type ModelPromptingStyle as aC, type ModifyImageProvider as aD, type MotionTransferProviderType as aE, type MusicProvider as aF, NATIVE_ADAPTIVE_ASPECT as aG, NATIVE_NEGATIVE_PROMPT_MODELS as aH, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aI, NEGATIVE_PROMPT_MAX as aJ, OBJECT_MOTION_PROVIDERS as aK, type ObjectMotionProvider as aL, PRICING_DEFAULT_DURATION_SEC as aM, PRICING_DEFAULT_RESOLUTION as aN, PROMPT_HARD_CEILING as aO, QA_CHECK_PROVIDERS as aP, type QaCheckProvider as aQ, REF_IMAGE_MAX_LIMITS as aR, RENDERING_SPEED_SUPPORT as aS, REPLICATE_LIP_SYNC_PROVIDERS as aT, RETIRED_VIDEO_PROVIDERS as aU, type RefAudioCheck as aV, type RefAudioProbe as aW, type RefAudioRule as aX, type RefVideoDurationLimit as aY, SCRIPT_PROVIDERS as aZ, SEEDANCE_2_5_REF_LIMITS as a_, type ImageI2IProvider as aa, type ImageMaskMode as ab, type ImageQuality as ac, type ImageRenderingSpeed as ad, type ImageResolution as ae, type ImageToVideoProvider as af, KLING_4_DEFAULT_RESOLUTION as ag, KLING_4_MAX_MIDDLE_FRAMES as ah, KLING_4_PROVIDERS as ai, LIP_SYNC_PROVIDERS as aj, LLM_STRUCTURED_SYSTEM_MAX as ak, LLM_TEXT_INPUT_MAX as al, LOCATION_ATMOSPHERE_PROVIDERS as am, type LipSyncProvider as an, type LocationAtmosphereProvider as ao, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as ap, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as aq, MAX_REQUEST_IMAGE_LIMIT as ar, MAX_TTS_CHARS_BY_PROVIDER as as, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as at, MINIMAX_H3_DEFAULT_RESOLUTION as au, MINIMAX_H3_PROVIDERS as av, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as aw, MODIFY_IMAGE_PROVIDERS as ax, MOTION_TRANSFER_PROVIDERS as ay, MUSIC_CREDIT_ID as az, AUDIO_ADDON_PROVIDERS as b, VIDEO_TO_VIDEO_PROVIDERS as b$, SEEDANCE_2_EXTEND_STITCH as b0, SEEDANCE_2_PROVIDERS as b1, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as b2, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as b3, SEEDANCE_2_REF_LIMITS as b4, SEEDANCE_LIP_SYNC_PROVIDERS as b5, SEEDANCE_VIDEO_EDIT_PROVIDERS as b6, SEEDANCE_VIDEO_EDIT_SHAPE as b7, SEED_SUPPORT as b8, SUNO_ACTIVE_MODELS as b9, type TaskChainedEditProvider as bA, type TextToAudioProvider as bB, type TextToVideoProvider as bC, type TranscribeLane as bD, type TranscribeProvider as bE, type TtsOutputFormat as bF, type TtsProvider as bG, UPSCALE_IMAGE_PROVIDERS as bH, type UpscaleImageProvider as bI, VARIABLE_PRICING_MODELS as bJ, VEO_PROVIDERS as bK, VIDEO_AUDIO_CAPABILITY as bL, VIDEO_DURATION_TIERS as bM, VIDEO_GEN_COLLAPSED_T2V_IDS as bN, VIDEO_GEN_PROVIDERS as bO, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bP, VIDEO_MODEL_CAPS as bQ, VIDEO_MODE_ALIASES as bR, VIDEO_PROMPT_MAX as bS, VIDEO_PROVIDERS_REQUIRING_IMAGE as bT, VIDEO_PROVIDERS_WITHOUT_DISPATCH as bU, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as bV, VIDEO_REF_AUDIO_RULES as bW, VIDEO_REF_LIMITS_BY_PROVIDER as bX, VIDEO_REF_RATE_PROVIDERS as bY, VIDEO_REF_VIDEO_DURATION_LIMITS as bZ, VIDEO_TO_VIDEO_NODE_PROVIDERS as b_, SUNO_ADD_TRACK_MODELS as ba, SUNO_DURATION_MODELS as bb, SUNO_HARD_CEILING as bc, SUNO_LEGACY_MODELS as bd, SUNO_MODELS as be, SUNO_TEXT_MAX as bf, SUNO_TITLE_MAX as bg, type SceneInputMode as bh, SceneInputModeSchema as bi, type ScriptProvider as bj, type SeedanceVideoEditProvider as bk, type SunoAddTrackModel as bl, type SunoModel as bm, T2I_TO_I2I_VARIANT as bn, TASK_CHAINED_EDIT_PROVIDERS as bo, TASK_CHAINED_EDIT_PROVIDER_IDS as bp, TEXT_TO_AUDIO_PROVIDERS as bq, TEXT_TO_VIDEO_PROVIDERS as br, TRANSCRIBE_LANES as bs, TRANSCRIBE_PROVIDERS as bt, TRANSCRIBE_PROVIDER_CAPABILITIES as bu, TTS_OUTPUT_FORMATS as bv, TTS_OUTPUT_FORMAT_FILES as bw, TTS_PROVIDERS as bx, TTS_TEXT_MAX as by, TWO_K_RESOLUTION_PROVIDERS as bz, type AiWriterProvider as c, seedance2AudioLimitSec as c$, VIDEO_UPSCALE_PROVIDERS as c0, VIDEO_VARIABLE_PRICING as c1, VIDU_Q4_DEFAULT_RESOLUTION as c2, VIDU_Q4_PROVIDERS as c3, VOICE_DESIGN_MODELS as c4, type VideoAudioCapability as c5, type VideoAudioMode as c6, type VideoGenProvider as c7, type VideoModeAlias as c8, type VideoModelCapabilities as c9, isGeminiOmniProvider as cA, isGvpSupportedProvider as cB, isKling4Provider as cC, isLegacySunoModel as cD, isMinimaxH3Provider as cE, isSeedance2Provider as cF, isSeedanceVideoEditProvider as cG, isVeoProvider as cH, isViduQ4Provider as cI, isWan3Provider as cJ, kling4KeyframeFrameCap as cK, maxSegmentSecFor as cL, maxSegmentsFor as cM, maxVideoDurationSec as cN, minSegmentSecFor as cO, modelsForInputMode as cP, normalizeKling4Resolution as cQ, normalizeMinimaxH3Resolution as cR, normalizeViduQ4Resolution as cS, normalizeWan3Resolution as cT, preferredInputModeForModel as cU, pricedOutputDurationSec as cV, requestImageLimit as cW, resolveGvpAnchorWire as cX, resolveMusicProvider as cY, resolveVideoModeForInputs as cZ, resolveVideoProviderForMode as c_, type VideoReferenceSyntax as ca, type VideoToVideoNodeProvider as cb, type VideoToVideoProvider as cc, type VideoUpscaleProvider as cd, type VoiceDesignModel as ce, WAN_3_DEFAULT_RESOLUTION as cf, WAN_3_PROVIDERS as cg, applyDefaultVideoSelection as ch, applyVideoAudioToggle as ci, applyVideoNegativePrompt as cj, billsReferenceVideoSeconds as ck, canonicalVideoProvider as cl, checkRefAudioRules as cm, checkRefVideoDurations as cn, defaultVideoAspectRatio as co, findSeedance2AudioOverLimit as cp, getMaxImagePromptChars as cq, getMaxNegativePromptChars as cr, getMaxSunoPromptChars as cs, getMaxSunoStyleChars as ct, getMaxTtsChars as cu, getMaxVideoPromptChars as cv, getVideoAudioCapability as cw, hasContiguousSegmentDurations as cx, imageReferenceLimit as cy, isGeminiOmniPerSecondProvider as cz, COMPOSER_PLAN_FIELDS as d, segmentDurationsFor as d0, snapToNearestDuration as d1, sunoModelHonoursDuration as d2, supportsAutoVideoDuration as d3, supportsEndAnchor as d4, supportsExtendRender as d5, transcribeLaneSupportsWordTimestamps as d6, transcribeProvidersWithWordTimestamps as d7, videoDefaultDurationSec as d8, videoModelCanSpeakDialogue as d9, videoModelSupportsAudio as da, videoNegativeSuffix as db, videoProviderAppendsFrames as dc, videoProviderFoldsLoneEndFrame as dd, videoProviderRefModeFrameSeats as de, videoProviderReferenceSyntax as df, videoProviderRequiresImage as dg, videoProviderRunsFromReferences as dh, videoSourceTrimMaxSec as di, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_REQUEST_IMAGE_LIMIT as j, DEFAULT_SUNO_MODEL as k, DEFAULT_TEXT_TO_AUDIO_PROVIDER as l, DEFAULT_TRANSCRIBE_NODE_PROVIDER as m, DEFAULT_TRANSCRIBE_PROVIDER as n, DEFAULT_TTS_OUTPUT_FORMAT as o, DEFAULT_TTS_PROVIDER as p, DEFAULT_VIDEO_DURATION_SEC as q, DEFAULT_VIDEO_PROVIDER as r, DEFAULT_VOICE_DESIGN_MODEL as s, DIALOGUE_PROVIDERS as t, DURATION_PRICED_PROVIDERS as u, type DialogueProvider as v, type ExtendVideoProvider as w, FAL_LIP_SYNC_PROVIDERS as x, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as y, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as z };
1753
+ export { IMAGE_I2I_PROVIDERS as $, AI_WRITER_PROVIDERS as A, FRAME_MODE_ADAPTIVE_ONLY_ASPECT as B, CHARACTER_MOTION_PROVIDERS as C, DEFAULT_DIALOGUE_PROVIDER as D, EXTEND_VIDEO_PROVIDERS as E, FACE_SWAP_PROVIDERS as F, type FaceSwapProvider as G, GEMINI_OMNI_12_MAX_SOURCE_SEC as H, GEMINI_OMNI_PER_SECOND_PROVIDERS as I, GEMINI_OMNI_PROVIDERS as J, GUIDANCE_SCALE_SUPPORT as K, GVP_ANCHOR_CHOICES as L, GVP_DEFAULT_PROVIDER as M, GVP_END_FRAME_PROVIDERS as N, GVP_EXTEND_PROVIDERS as O, GVP_SUPPORTED_PROVIDERS as P, type GvpAnchorChoice as Q, type GvpAnchorWireMode as R, HIGH_QUALITY_PROVIDERS as S, I2I_MASK_SUPPORT as T, I2I_STRENGTH_SUPPORT as U, IDEOGRAM_PROVIDERS as V, IMAGE_ASPECT_RATIO_VALUES as W, IMAGE_BACKGROUND_VALUES as X, IMAGE_EDIT_PROVIDERS as Y, IMAGE_EDIT_TARGET_RESOLUTION_VALUES as Z, IMAGE_GEN_PROVIDERS as _, ASPECT_RATIO_DIMENSIONS as a, RETIRED_VIDEO_PROVIDERS as a$, IMAGE_MASK_MODE as a0, IMAGE_OUTPUT_FORMAT_EXT as a1, IMAGE_OUTPUT_FORMAT_MIME as a2, IMAGE_OUTPUT_FORMAT_VALUES as a3, IMAGE_PROMPT_MAX as a4, IMAGE_QUALITY_VALUES as a5, IMAGE_RENDERING_SPEED_VALUES as a6, IMAGE_RESOLUTION_VALUES as a7, IMAGE_SVG_LEVEL_VALUES as a8, IMAGE_TO_VIDEO_PROVIDERS as a9, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER as aA, MINIMAX_H3_DEFAULT_RESOLUTION as aB, MINIMAX_H3_PROVIDERS as aC, MODELS_WITH_REFERENCE_IMAGE_SUPPORT as aD, MODIFY_IMAGE_PROVIDERS as aE, MOTION_TRANSFER_PROVIDERS as aF, MUSIC_CREDIT_ID as aG, MUSIC_PROVIDERS as aH, MUSIC_PROVIDER_LABELS as aI, type ModelPromptingStyle as aJ, type ModifyImageProvider as aK, type MotionTransferProviderType as aL, type MusicProvider as aM, NATIVE_ADAPTIVE_ASPECT as aN, NATIVE_NEGATIVE_PROMPT_MODELS as aO, NATIVE_NEGATIVE_VIDEO_PROVIDERS as aP, NEGATIVE_PROMPT_MAX as aQ, OBJECT_MOTION_PROVIDERS as aR, type ObjectMotionProvider as aS, PRICING_DEFAULT_DURATION_SEC as aT, PRICING_DEFAULT_RESOLUTION as aU, PROMPT_HARD_CEILING as aV, QA_CHECK_PROVIDERS as aW, type QaCheckProvider as aX, REF_IMAGE_MAX_LIMITS as aY, RENDERING_SPEED_SUPPORT as aZ, REPLICATE_LIP_SYNC_PROVIDERS as a_, type ImageAspectRatio as aa, type ImageBackground as ab, type ImageEditProvider as ac, type ImageEditTargetResolution as ad, type ImageGenProvider as ae, type ImageI2IProvider as af, type ImageMaskMode as ag, type ImageOutputFormat as ah, type ImageQuality as ai, type ImageRenderingSpeed as aj, type ImageResolution as ak, type ImageSvgLevel as al, type ImageToVideoProvider as am, KLING_4_DEFAULT_RESOLUTION as an, KLING_4_MAX_MIDDLE_FRAMES as ao, KLING_4_PROVIDERS as ap, LIP_SYNC_PROVIDERS as aq, LLM_STRUCTURED_SYSTEM_MAX as ar, LLM_TEXT_INPUT_MAX as as, LOCATION_ATMOSPHERE_PROVIDERS as at, type LipSyncProvider as au, type LocationAtmosphereProvider as av, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER as aw, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER as ax, MAX_REQUEST_IMAGE_LIMIT as ay, MAX_TTS_CHARS_BY_PROVIDER as az, AUDIO_ADDON_PROVIDERS as b, VIDEO_PROVIDERS_WITHOUT_DISPATCH as b$, type RefAudioCheck as b0, type RefAudioProbe as b1, type RefAudioRule as b2, type RefVideoDurationLimit as b3, SCRIPT_PROVIDERS as b4, SEEDANCE_2_5_REF_LIMITS as b5, SEEDANCE_2_CONTINUATION_REF_SEC as b6, SEEDANCE_2_EXTEND_STITCH as b7, SEEDANCE_2_PROVIDERS as b8, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER as b9, TRANSCRIBE_PROVIDERS as bA, TRANSCRIBE_PROVIDER_CAPABILITIES as bB, TTS_OUTPUT_FORMATS as bC, TTS_OUTPUT_FORMAT_FILES as bD, TTS_PROVIDERS as bE, TTS_TEXT_MAX as bF, TWO_K_RESOLUTION_PROVIDERS as bG, type TaskChainedEditProvider as bH, type TextToAudioProvider as bI, type TextToVideoProvider as bJ, type TranscribeLane as bK, type TranscribeProvider as bL, type TtsOutputFormat as bM, type TtsProvider as bN, UPSCALE_IMAGE_PROVIDERS as bO, type UpscaleImageProvider as bP, VARIABLE_PRICING_MODELS as bQ, VEO_PROVIDERS as bR, VIDEO_AUDIO_CAPABILITY as bS, VIDEO_DURATION_TIERS as bT, VIDEO_GEN_COLLAPSED_T2V_IDS as bU, VIDEO_GEN_PROVIDERS as bV, VIDEO_INPUT_LIP_SYNC_PROVIDERS as bW, VIDEO_MODEL_CAPS as bX, VIDEO_MODE_ALIASES as bY, VIDEO_PROMPT_MAX as bZ, VIDEO_PROVIDERS_REQUIRING_IMAGE as b_, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC as ba, SEEDANCE_2_REF_LIMITS as bb, SEEDANCE_LIP_SYNC_PROVIDERS as bc, SEEDANCE_VIDEO_EDIT_PROVIDERS as bd, SEEDANCE_VIDEO_EDIT_SHAPE as be, SEED_SUPPORT as bf, SUNO_ACTIVE_MODELS as bg, SUNO_ADD_TRACK_MODELS as bh, SUNO_DURATION_MODELS as bi, SUNO_HARD_CEILING as bj, SUNO_LEGACY_MODELS as bk, SUNO_MODELS as bl, SUNO_TEXT_MAX as bm, SUNO_TITLE_MAX as bn, type SceneInputMode as bo, SceneInputModeSchema as bp, type ScriptProvider as bq, type SeedanceVideoEditProvider as br, type SunoAddTrackModel as bs, type SunoModel as bt, T2I_TO_I2I_VARIANT as bu, TASK_CHAINED_EDIT_PROVIDERS as bv, TASK_CHAINED_EDIT_PROVIDER_IDS as bw, TEXT_TO_AUDIO_PROVIDERS as bx, TEXT_TO_VIDEO_PROVIDERS as by, TRANSCRIBE_LANES as bz, type AiWriterProvider as c, preferredInputModeForModel as c$, VIDEO_PROVIDERS_WITH_SEPARATE_FRAME_CHANNEL as c0, VIDEO_REF_AUDIO_RULES as c1, VIDEO_REF_LIMITS_BY_PROVIDER as c2, VIDEO_REF_RATE_PROVIDERS as c3, VIDEO_REF_VIDEO_DURATION_LIMITS as c4, VIDEO_TO_VIDEO_NODE_PROVIDERS as c5, VIDEO_TO_VIDEO_PROVIDERS as c6, VIDEO_UPSCALE_PROVIDERS as c7, VIDEO_VARIABLE_PRICING as c8, VIDU_Q4_DEFAULT_RESOLUTION as c9, getMaxSunoStyleChars as cA, getMaxTtsChars as cB, getMaxVideoPromptChars as cC, getVideoAudioCapability as cD, hasContiguousSegmentDurations as cE, imageReferenceLimit as cF, isGeminiOmniPerSecondProvider as cG, isGeminiOmniProvider as cH, isGvpSupportedProvider as cI, isKling4Provider as cJ, isLegacySunoModel as cK, isMinimaxH3Provider as cL, isSeedance2Provider as cM, isSeedanceVideoEditProvider as cN, isVeoProvider as cO, isViduQ4Provider as cP, isWan3Provider as cQ, kling4KeyframeFrameCap as cR, maxSegmentSecFor as cS, maxSegmentsFor as cT, maxVideoDurationSec as cU, minSegmentSecFor as cV, modelsForInputMode as cW, normalizeKling4Resolution as cX, normalizeMinimaxH3Resolution as cY, normalizeViduQ4Resolution as cZ, normalizeWan3Resolution as c_, VIDU_Q4_PROVIDERS as ca, VOICE_DESIGN_MODELS as cb, type VideoAudioCapability as cc, type VideoAudioMode as cd, type VideoGenProvider as ce, type VideoModeAlias as cf, type VideoModelCapabilities as cg, type VideoReferenceSyntax as ch, type VideoToVideoNodeProvider as ci, type VideoToVideoProvider as cj, type VideoUpscaleProvider as ck, type VoiceDesignModel as cl, WAN_3_DEFAULT_RESOLUTION as cm, WAN_3_PROVIDERS as cn, applyDefaultVideoSelection as co, applyVideoAudioToggle as cp, applyVideoNegativePrompt as cq, billsReferenceVideoSeconds as cr, canonicalVideoProvider as cs, checkRefAudioRules as ct, checkRefVideoDurations as cu, defaultVideoAspectRatio as cv, findSeedance2AudioOverLimit as cw, getMaxImagePromptChars as cx, getMaxNegativePromptChars as cy, getMaxSunoPromptChars as cz, COMPOSER_PLAN_FIELDS as d, pricedOutputDurationSec as d0, requestImageLimit as d1, resolveGvpAnchorWire as d2, resolveMusicProvider as d3, resolveVideoModeForInputs as d4, resolveVideoProviderForMode as d5, seedance2AudioLimitSec as d6, segmentDurationsFor as d7, snapToNearestDuration as d8, sunoModelHonoursDuration as d9, supportsAutoVideoDuration as da, supportsEndAnchor as db, supportsExtendRender as dc, transcribeLaneSupportsWordTimestamps as dd, transcribeProvidersWithWordTimestamps as de, videoDefaultDurationSec as df, videoModelCanSpeakDialogue as dg, videoModelSupportsAudio as dh, videoNegativeSuffix as di, videoProviderAppendsFrames as dj, videoProviderFoldsLoneEndFrame as dk, videoProviderRefModeFrameSeats as dl, videoProviderReferenceSyntax as dm, videoProviderRequiresImage as dn, videoProviderRunsFromReferences as dp, videoSourceTrimMaxSec as dq, COMPOSER_PLAN_MAP as e, CREDIT_BASE_USD as f, type CharacterMotionProvider as g, DEFAULT_MUSIC_PROVIDER as h, DEFAULT_REF_IMAGE_MAX as i, DEFAULT_REQUEST_IMAGE_LIMIT as j, DEFAULT_SUNO_MODEL as k, DEFAULT_TEXT_TO_AUDIO_PROVIDER as l, DEFAULT_TRANSCRIBE_NODE_PROVIDER as m, DEFAULT_TRANSCRIBE_PROVIDER as n, DEFAULT_TTS_OUTPUT_FORMAT as o, DEFAULT_TTS_PROVIDER as p, DEFAULT_VIDEO_DURATION_SEC as q, DEFAULT_VIDEO_PROVIDER as r, DEFAULT_VIDEO_TO_VIDEO_PROVIDER as s, DEFAULT_VOICE_DESIGN_MODEL as t, DIALOGUE_PROVIDERS as u, DURATION_PRICED_PROVIDERS as v, type DialogueProvider as w, type ExtendVideoProvider as x, FAL_LIP_SYNC_PROVIDERS as y, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nodaro/shared",
3
- "version": "3.58.0",
3
+ "version": "3.60.0",
4
4
  "description": "Shared types, model catalog, wire contracts, and structural vocabularies for the Nodaro platform and SDK.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  import { describe, it, expect } from "vitest"
2
2
  import {
3
- CAMERA_SWITCH_BOUNDS, CAMERA_SWITCH_DEFAULTS, CAMERA_SWITCH_NAME_MAX, cameraSwitchCameras, cameraSwitchEdlProblem,
3
+ CAMERA_SWITCH_BOUNDS, CAMERA_SWITCH_DEFAULTS, CAMERA_SWITCH_NAME_MAX, CAMERA_SWITCH_NODE_SETTINGS, cameraSwitchCameras, cameraSwitchEdlProblem,
4
4
  cameraSwitchSettingsPayload, cameraSwitchSpeakerMap, clampCameraSwitchSetting, cleanSpeakerNames, defaultSpeakerMap, transcriptSpeakerLabels,
5
5
  } from "../camera-switch-contract.js"
6
6
 
@@ -51,7 +51,7 @@ describe("defaultSpeakerMap — the table pre-filled by order (decided 2026-10-0
51
51
  })
52
52
 
53
53
  it("the defaults are the decided ones", () => {
54
- expect(CAMERA_SWITCH_DEFAULTS).toEqual({ minShotMs: 2_500, leadMs: 200, maxShotMs: 20_000, wideEvery: 0, layoutHints: false })
54
+ expect(CAMERA_SWITCH_DEFAULTS).toEqual({ minShotMs: 2_500, leadMs: 200, lagMs: 0, maxShotMs: 20_000, wideEvery: 0, layoutHints: false })
55
55
  })
56
56
 
57
57
  // The Cloud route answers 400 outside these ranges — every caller clamps first
@@ -59,10 +59,19 @@ it("the defaults are the decided ones", () => {
59
59
  describe("settings bounds", () => {
60
60
  it("are the route's ranges", () => {
61
61
  expect(CAMERA_SWITCH_BOUNDS).toEqual({
62
- minShotMs: { min: 500, max: 60_000 }, leadMs: { min: 0, max: 5_000 }, maxShotMs: { min: 0, max: 600_000 }, wideEvery: { min: 0, max: 20 },
62
+ minShotMs: { min: 500, max: 60_000 }, leadMs: { min: 0, max: 5_000 }, lagMs: { min: 0, max: 5_000 }, maxShotMs: { min: 0, max: 600_000 }, wideEvery: { min: 0, max: 20 },
63
63
  })
64
64
  expect(CAMERA_SWITCH_NAME_MAX).toBe(80)
65
65
  })
66
+ it("lagMs is a route setting only: a node's data never sends it (the node settings are the other four)", () => {
67
+ expect(CAMERA_SWITCH_NODE_SETTINGS).toEqual(["minShotMs", "leadMs", "maxShotMs", "wideEvery"])
68
+ expect(Object.keys(CAMERA_SWITCH_BOUNDS).filter((k) => !(CAMERA_SWITCH_NODE_SETTINGS as readonly string[]).includes(k))).toEqual(["lagMs"])
69
+ const edl = { version: 1, clock: "master", sources: [{ id: "a", url: "https://x/a.mp4", kind: "video" }], segments: [{ inMs: 0, outMs: 1000, video: "a" }] }
70
+ const transcript = { version: 1, words: [{ text: "hi", startMs: 0, endMs: 400, speaker: "s0" }] }
71
+ const sent = cameraSwitchSettingsPayload({ leadMs: 300, lagMs: 400 } as Parameters<typeof cameraSwitchSettingsPayload>[0], edl, transcript)
72
+ expect(sent).toMatchObject({ leadMs: 300 })
73
+ expect(sent).not.toHaveProperty("lagMs")
74
+ })
66
75
  it("clamp into range as whole numbers; unset stays unset", () => {
67
76
  expect(clampCameraSwitchSetting("minShotMs", 0)).toBe(500)
68
77
  expect(clampCameraSwitchSetting("minShotMs", 2_499.6)).toBe(2_500)
@@ -941,24 +941,33 @@ describe("resolveNormalizedImageGen", () => {
941
941
  refCount: 0,
942
942
  swapToI2i: true,
943
943
  })
944
- // 3:2 is not in GPT_IMAGE_2_RATIOS -> allowed[0] ("auto"), which then
945
- // cascades resolution to 1K via the model's cross-field rule.
944
+ // 3:2 is not in GPT_IMAGE_2_RATIOS -> allowed[0] ("auto"), which renders
945
+ // 4K too: the size, and so the price, stay as asked.
946
946
  expect(out.aspectRatio).toBe("auto")
947
- expect(out.resolution).toBe("1K")
948
- expect(out.identifier).toBe("gpt-image-2")
949
- expect(out.adjustments.map((a) => a.field)).toEqual(["aspectRatio", "resolution"])
947
+ expect(out.resolution).toBe("4K")
948
+ expect(out.identifier).toBe("gpt-image-2:4K")
949
+ expect(out.adjustments.map((a) => a.field)).toEqual(["aspectRatio"])
950
950
  })
951
951
 
952
- it("prices the SNAPPED resolution — gpt-image-2 auto + 2K reserves the 1K tier", () => {
952
+ it("prices the SNAPPED resolution — GPT Image 2.5 Flare at 9:8 + 2K reserves the 1K tier", () => {
953
953
  const out = resolveNormalizedImageGen({
954
- provider: "gpt-image-2",
955
- aspectRatio: "auto",
954
+ provider: "gpt-image-2-5-flare",
955
+ aspectRatio: "9:8",
956
956
  resolution: "2K",
957
957
  refCount: 0,
958
958
  swapToI2i: true,
959
959
  })
960
960
  expect(out.resolution).toBe("1K")
961
- expect(out.identifier).toBe("gpt-image-2")
961
+ expect(out.identifier).toBe("gpt-image-2-5-flare")
962
+ })
963
+
964
+ it("prices gpt-image-2 at auto and 1:1 at the size asked", () => {
965
+ for (const [aspectRatio, resolution, id] of [["auto", "2K", "gpt-image-2:2K"], ["auto", "4K", "gpt-image-2:4K"], ["1:1", "4K", "gpt-image-2:4K"]] as const) {
966
+ const out = resolveNormalizedImageGen({ provider: "gpt-image-2", aspectRatio, resolution, refCount: 0, swapToI2i: true })
967
+ expect(out.resolution).toBe(resolution)
968
+ expect(out.identifier).toBe(id)
969
+ expect(out.adjustments).toEqual([])
970
+ }
962
971
  })
963
972
 
964
973
  it("drops a lever the model does not have, and reports it", () => {
@@ -0,0 +1,171 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import { buildCreditModelIdentifier, imageFormatInputOf, resolveNormalizedImageGen } from "../credit-identifiers.js"
3
+ import { MODEL_CATALOG, normalizeModelInput, outputFormatOptionsByKind, svgLevelOptionsByKind } from "../model-catalog.js"
4
+ import { GPT_IMAGE_2_6_GIF_BANDS, gptImage26GifBand, gptImage26PricedFormat } from "../gpt-image-2-6.js"
5
+
6
+ const FLARE = "gpt-image-2-6-flare"
7
+ const fields = (n: ReturnType<typeof normalizeModelInput>) => n.adjustments.map((a) => a.field)
8
+
9
+ describe("which models write which files", () => {
10
+ it("Flare and Sunburst write five formats from a prompt and from an edit, Economy fewer", () => {
11
+ for (const id of ["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"]) {
12
+ expect(MODEL_CATALOG[id]!.outputFormats).toEqual(["png", "jpeg", "webp", "gif", "svg"])
13
+ expect(MODEL_CATALOG[id]!.svgLevels).toEqual(["standard", "detailed", "max"])
14
+ expect(MODEL_CATALOG[id]!.gifFrames).toEqual({ min: 2, max: 16, default: 9 })
15
+ expect(MODEL_CATALOG[id]!.gifFrameDurationMs).toEqual({ min: 20, max: 2000, step: 10, default: 200 })
16
+ }
17
+ expect(MODEL_CATALOG["gpt-image-2-6-economy"]!.outputFormats).toEqual(["png", "gif"])
18
+ expect(MODEL_CATALOG["gpt-image-2-6-economy"]!.gifFrames?.values).toEqual([4, 9, 16])
19
+ expect(MODEL_CATALOG["gpt-image-2-6-economy-i2i"]!.outputFormats).toEqual(["png"])
20
+ })
21
+
22
+ it("a menu offers a format only on a model that writes more than one", () => {
23
+ const formats = outputFormatOptionsByKind("image")
24
+ expect(Object.keys(formats).sort()).toEqual(["gpt-image-2-6-economy", "gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])
25
+ expect(formats[FLARE]!.map((o) => o.value)).toEqual(["png", "jpeg", "webp", "gif", "svg"])
26
+ expect(Object.keys(svgLevelOptionsByKind("image")).sort()).toEqual(["gpt-image-2-6-flare", "gpt-image-2-6-flare-i2i", "gpt-image-2-6-sunburst", "gpt-image-2-6-sunburst-i2i"])
27
+ expect(svgLevelOptionsByKind("image")[FLARE]!.map((o) => o.label)).toEqual(["SVG Standard", "SVG Detailed", "SVG Max"])
28
+ })
29
+
30
+ it("the bands of frames cover 2 to 16 without a gap", () => {
31
+ const frames = GPT_IMAGE_2_6_GIF_BANDS.flatMap((b) => Array.from({ length: b.max - b.min + 1 }, (_, i) => b.min + i))
32
+ expect(frames).toEqual(Array.from({ length: 15 }, (_, i) => i + 2))
33
+ expect(gptImage26GifBand(1)).toBe("2-8")
34
+ expect(gptImage26GifBand(40)).toBe("13-16")
35
+ expect(gptImage26GifBand("14")).toBe("13-16")
36
+ expect(gptImage26GifBand(undefined)).toBe("9-12")
37
+ })
38
+ })
39
+
40
+ describe("a GIF's levers", () => {
41
+ it("ignores the ratio and the size, and says so", () => {
42
+ const n = normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "16:9", resolution: "4K", quality: "high" })
43
+ expect(n).toMatchObject({ outputFormat: "gif", aspectRatio: "1:1", resolution: undefined, quality: "high", gifFrames: 9, gifFrameDurationMs: 200 })
44
+ expect(fields(n)).toEqual(["aspectRatio", "resolution"])
45
+ expect(n.adjustments[0]!.reason).toContain("square")
46
+ })
47
+
48
+ it("auto and a square ratio say nothing", () => {
49
+ expect(normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "auto" }).adjustments).toEqual([])
50
+ expect(normalizeModelInput(FLARE, { outputFormat: "gif", aspectRatio: "1:1" }).adjustments).toEqual([])
51
+ })
52
+
53
+ it("keeps its frames and speed in range, and the speed on its step", () => {
54
+ const n = normalizeModelInput(FLARE, { outputFormat: "gif", gifFrames: 30, gifFrameDurationMs: 155 })
55
+ expect(n).toMatchObject({ gifFrames: 16, gifFrameDurationMs: 160 })
56
+ expect(fields(n)).toEqual(["gifFrames", "gifFrameDurationMs"])
57
+ expect(normalizeModelInput(FLARE, { outputFormat: "gif", gifFrames: 1, gifFrameDurationMs: 5000 })).toMatchObject({ gifFrames: 2, gifFrameDurationMs: 2000 })
58
+ })
59
+
60
+ it("Economy takes 4, 9 or 16 frames: the nearest", () => {
61
+ expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 6 }).gifFrames).toBe(4)
62
+ expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 12 }).gifFrames).toBe(9)
63
+ expect(normalizeModelInput("gpt-image-2-6-economy", { outputFormat: "gif", gifFrames: 15 }).gifFrames).toBe(16)
64
+ })
65
+
66
+ it("moves a transparent background to auto, and keeps an opaque one", () => {
67
+ const n = normalizeModelInput(FLARE, { outputFormat: "gif", background: "transparent" })
68
+ expect(n.background).toBe("auto")
69
+ expect(fields(n)).toEqual(["background"])
70
+ expect(normalizeModelInput(FLARE, { outputFormat: "gif", background: "opaque" }).background).toBe("opaque")
71
+ })
72
+
73
+ it("is not moved to 1K by a transparent background", () => {
74
+ const n = normalizeModelInput(FLARE, { outputFormat: "gif", background: "transparent", resolution: "4K" })
75
+ expect(n.resolution).toBeUndefined()
76
+ expect(n.adjustments.some((a) => a.to === "1K")).toBe(false)
77
+ })
78
+ })
79
+
80
+ describe("an SVG's levers", () => {
81
+ it("takes its level, Standard when none is named", () => {
82
+ expect(normalizeModelInput(FLARE, { outputFormat: "svg" }).svgLevel).toBe("standard")
83
+ expect(normalizeModelInput(FLARE, { outputFormat: "svg", svgLevel: "Detailed" }).svgLevel).toBe("detailed")
84
+ const n = normalizeModelInput(FLARE, { outputFormat: "svg", svgLevel: "ultra" })
85
+ expect(n.svgLevel).toBe("standard")
86
+ expect(fields(n)).toEqual(["svgLevel"])
87
+ })
88
+
89
+ it("keeps the ratio and size of a PNG", () => {
90
+ expect(normalizeModelInput(FLARE, { outputFormat: "svg", aspectRatio: "16:9", resolution: "2K" })).toMatchObject({ aspectRatio: "16:9", resolution: "2K", adjustments: [] })
91
+ })
92
+
93
+ it("takes no background: any but auto becomes auto, said once", () => {
94
+ for (const background of ["transparent", "opaque"]) {
95
+ const n = normalizeModelInput(FLARE, { outputFormat: "svg", background, resolution: "4K" })
96
+ expect(n.background).toBe("auto")
97
+ expect(n.resolution).toBe("4K")
98
+ expect(fields(n)).toEqual(["background"])
99
+ }
100
+ })
101
+ })
102
+
103
+ describe("JPEG and WebP", () => {
104
+ it("JPEG moves a transparent background to auto at the size asked; WebP keeps it, at 1K", () => {
105
+ const jpeg = normalizeModelInput(FLARE, { outputFormat: "jpeg", background: "transparent", resolution: "4K" })
106
+ expect(jpeg).toMatchObject({ outputFormat: "jpeg", background: "auto", resolution: "4K" })
107
+ const webp = normalizeModelInput(FLARE, { outputFormat: "webp", background: "transparent", resolution: "4K" })
108
+ expect(webp).toMatchObject({ outputFormat: "webp", background: "transparent", resolution: "1K" })
109
+ })
110
+
111
+ it("jpg is jpeg, in any case", () => {
112
+ expect(normalizeModelInput(FLARE, { outputFormat: "JPG" }).outputFormat).toBe("jpeg")
113
+ })
114
+ })
115
+
116
+ describe("the format and the model", () => {
117
+ it("a format the model does not write moves to its first, and says so", () => {
118
+ const n = normalizeModelInput("gpt-image-2-6-economy-i2i", { outputFormat: "svg", svgLevel: "max" })
119
+ expect(n.outputFormat).toBe("png")
120
+ expect(n.svgLevel).toBeUndefined()
121
+ expect(fields(n)).toEqual(["outputFormat"])
122
+ })
123
+
124
+ it("a model with no format setting drops it", () => {
125
+ const n = normalizeModelInput("nano-banana-2", { outputFormat: "gif", gifFrames: 9 })
126
+ expect(n.outputFormat).toBeUndefined()
127
+ expect(n.gifFrames).toBeUndefined()
128
+ expect(fields(n)).toEqual(["outputFormat"])
129
+ })
130
+
131
+ it("a GIF's and an SVG's levers are left out for any other format, saying nothing", () => {
132
+ const n = normalizeModelInput(FLARE, { outputFormat: "png", gifFrames: 9, gifFrameDurationMs: 200, svgLevel: "max" })
133
+ expect(n).toMatchObject({ outputFormat: "png", gifFrames: undefined, gifFrameDurationMs: undefined, svgLevel: undefined, adjustments: [] })
134
+ })
135
+
136
+ it("a text-to-image Economy GIF with references swaps to its edit sibling and becomes a PNG", () => {
137
+ const n = resolveNormalizedImageGen({ provider: "gpt-image-2-6-economy", outputFormat: "gif", gifFrames: 9, refCount: 1, swapToI2i: true })
138
+ expect(n.modelId).toBe("gpt-image-2-6-economy-i2i")
139
+ expect(n.outputFormat).toBe("png")
140
+ expect(n.identifier).toBe("gpt-image-2-6-economy-i2i")
141
+ })
142
+ })
143
+
144
+ describe("the price follows the snapped levers", () => {
145
+ it("a GIF's id is its band; the ratio and size it ignored do not price it", () => {
146
+ const n = resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: 14, quality: "low", resolution: "4K", aspectRatio: "16:9", refCount: 0 })
147
+ expect(n.identifier).toBe("gpt-image-2-6-flare:low:gif-13-16")
148
+ expect(n).toMatchObject({ gifFrames: 14, gifFrameDurationMs: 200, resolution: undefined, aspectRatio: "1:1" })
149
+ })
150
+
151
+ it("a GIF's frames off the range are priced where they land", () => {
152
+ expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: 40, refCount: 0 }).identifier).toBe("gpt-image-2-6-flare:medium:gif-13-16")
153
+ })
154
+
155
+ it("an SVG edit is priced at its size, level and images", () => {
156
+ expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "svg", svgLevel: "max", resolution: "2K", refCount: 3, swapToI2i: true }).identifier)
157
+ .toBe("gpt-image-2-6-flare-i2i:medium:2K:svg-max:3ref")
158
+ })
159
+
160
+ it("numeric strings from a form or a mapping are read as their numbers", () => {
161
+ expect(imageFormatInputOf({ outputFormat: "gif", gifFrames: "12", gifFrameDurationMs: " 300 " })).toEqual({ outputFormat: "gif", gifFrames: 12, gifFrameDurationMs: 300, svgLevel: undefined })
162
+ expect(resolveNormalizedImageGen({ provider: FLARE, outputFormat: "gif", gifFrames: "3", refCount: 0 }).identifier).toBe("gpt-image-2-6-flare:medium:gif-2-8")
163
+ })
164
+
165
+ it("the priced format reads a format in any case, as the snap does", () => {
166
+ expect(gptImage26PricedFormat({ outputFormat: "GIF", gifFrames: 16 })).toEqual({ kind: "gif", band: "13-16" })
167
+ expect(gptImage26PricedFormat({ outputFormat: "svg", svgLevel: "MAX" })).toEqual({ kind: "svg", level: "max" })
168
+ expect(gptImage26PricedFormat({ outputFormat: "webp" })).toBeUndefined()
169
+ expect(buildCreditModelIdentifier(FLARE, "medium", "1K", undefined, undefined, 0, { outputFormat: "Svg" })).toBe("gpt-image-2-6-flare:medium:1K:svg-standard")
170
+ })
171
+ })
@@ -0,0 +1,80 @@
1
+ import { describe, it, expect } from "vitest"
2
+ import { MODEL_CATALOG, normalizeModelInput, resolutionAtAspectRatio, resolutionsAtAspectRatio } from "../model-catalog.js"
3
+ import { resolveNormalizedImageGen } from "../credit-identifiers.js"
4
+
5
+ /**
6
+ * GPT Image 2 (`gpt-image-2`, `gpt-image-2-i2i`) renders every ratio it offers
7
+ * at every size it lists: "auto" and 1:1 included. It used to carry two size
8
+ * rules ("auto" at 1K only, 1:1 at 1K or 2K) taken from older provider docs;
9
+ * live runs on 2026-11-10 rendered 1:1 at 4K (2880x2880), "auto" at 2K
10
+ * (2048x2048) and an edit at "auto" and 2K (1536x2048 from a 768x1024 photo),
11
+ * each billed as its own size. So nothing is snapped by size, there is no
12
+ * adjustment, and a run is priced at the size it asks for.
13
+ */
14
+
15
+ const MODELS = ["gpt-image-2", "gpt-image-2-i2i"] as const
16
+
17
+ /** The price id's size suffix: 1K is the base id. */
18
+ const tier = (size: string | undefined) => (size === undefined || size === "1K" ? "" : `:${size}`)
19
+
20
+ describe.each(MODELS)("%s: every offered ratio renders every size", (model) => {
21
+ const entry = MODEL_CATALOG[model]!
22
+ const ratios = entry.aspectRatios!
23
+ const sizes = entry.resolutions!
24
+
25
+ it("offers auto, 1:1, 16:9, 9:16, 4:3 and 3:4 at 1K, 2K and 4K", () => {
26
+ expect(ratios).toEqual(["auto", "1:1", "16:9", "9:16", "4:3", "3:4"])
27
+ expect(sizes).toEqual(["1K", "2K", "4K"])
28
+ })
29
+
30
+ it("declares no size rule per ratio", () => {
31
+ expect(entry.resolutionsByAspectRatio).toBeUndefined()
32
+ })
33
+
34
+ const cells = ratios.flatMap((ratio) => [undefined, ...sizes].map((size) => [ratio, size ?? null] as const))
35
+
36
+ it.each(cells)("ratio %s, size %s: sent as asked, no adjustment, priced at that size", (ratio, sizeOrNull) => {
37
+ const size = sizeOrNull ?? undefined
38
+ const out = normalizeModelInput(model, { aspectRatio: ratio, resolution: size })
39
+ expect(out.aspectRatio).toBe(ratio)
40
+ expect(out.resolution).toBe(size)
41
+ expect(out.adjustments).toEqual([])
42
+
43
+ // The price id the image routes reserve, with and without a reference
44
+ // photo (which swaps the text-to-image id to its edit).
45
+ const t2i = resolveNormalizedImageGen({ provider: model, aspectRatio: ratio, resolution: size, refCount: 0, swapToI2i: true })
46
+ expect(t2i.identifier).toBe(`${model}${tier(size)}`)
47
+ const withRef = resolveNormalizedImageGen({ provider: model, aspectRatio: ratio, resolution: size, refCount: 1, swapToI2i: true })
48
+ expect(withRef.identifier).toBe(`gpt-image-2-i2i${tier(size)}`)
49
+ })
50
+
51
+ it.each(ratios)("the sizes on offer at %s are all of them, and none moves", (ratio) => {
52
+ expect(resolutionsAtAspectRatio(model, ratio)).toEqual(sizes)
53
+ for (const size of sizes) expect(resolutionAtAspectRatio(model, ratio, size)).toBe(size)
54
+ })
55
+
56
+ it("every 2K and 4K price row exists in the catalog", () => {
57
+ const ids = entry.pricing.map((p) => p.identifier)
58
+ for (const size of sizes) expect(ids).toContain(`${model}${tier(size)}`)
59
+ })
60
+
61
+ // Off-list values are still the per-lever snaps, and only those: a ratio the
62
+ // model does not offer moves to its first ("auto") and keeps its size; a
63
+ // size it does not list moves to its first (1K). Spelling is canonicalised.
64
+ it.each([
65
+ ["21:9", "4K", "auto", "4K", ["aspectRatio"]],
66
+ ["21:9", "2K", "auto", "2K", ["aspectRatio"]],
67
+ ["1x1", "4K", "auto", "4K", ["aspectRatio"]],
68
+ ["1:1", "8K", "1:1", "1K", ["resolution"]],
69
+ ["1:1", "4k", "1:1", "4K", []],
70
+ ["auto", "2k", "auto", "2K", []],
71
+ ["AUTO", "4K", "auto", "4K", []],
72
+ ] as const)("%s at %s goes as %s at %s", (ratio, size, sentRatio, sentSize, adjusted) => {
73
+ const out = normalizeModelInput(model, { aspectRatio: ratio, resolution: size })
74
+ expect(out.aspectRatio).toBe(sentRatio)
75
+ expect(out.resolution).toBe(sentSize)
76
+ expect(out.adjustments.map((a) => a.field)).toEqual(adjusted)
77
+ const t2i = resolveNormalizedImageGen({ provider: model, aspectRatio: ratio, resolution: size, refCount: 0, swapToI2i: true })
78
+ expect(t2i.identifier).toBe(`${model}${tier(sentSize)}`)
79
+ })
80
+ })
@@ -71,24 +71,24 @@ describe("normalizeModelInput", () => {
71
71
  expect(out.resolution).toBe("2 MP")
72
72
  })
73
73
 
74
- it("applies the gpt-image-2 cross-field rules after snapping", () => {
75
- expect(normalizeModelInput("gpt-image-2", { aspectRatio: "auto", resolution: "4K" }).resolution).toBe("1K")
76
- expect(normalizeModelInput("gpt-image-2", { aspectRatio: "1:1", resolution: "4K" }).resolution).toBe("2K")
74
+ it("keeps gpt-image-2's size at auto and 1:1: it renders every size there", () => {
75
+ for (const aspectRatio of ["auto", "1:1"]) {
76
+ const out = normalizeModelInput("gpt-image-2", { aspectRatio, resolution: "4K" })
77
+ expect(out.resolution).toBe("4K")
78
+ expect(out.adjustments).toEqual([])
79
+ }
77
80
  })
78
81
 
79
- // GPT Image 2.5 is NOT GPT Image 2. Its docs
80
- // (docs.kie.ai/market/gpt/gpt-image-2-5-*) limit four ratios to 1K and
81
- // nothing else, so GPT Image 2's own rules (auto → 1K, 1:1 not at 4K) must
82
- // NOT be widened to these ids "for consistency" — that would downgrade a paid
83
- // 4K render to 1K. The four ratios are the catalog's
84
- // `resolutionsByAspectRatio`, tested below.
82
+ // GPT Image 2.5's docs (docs.kie.ai/market/gpt/gpt-image-2-5-*) limit four
83
+ // ratios to 1K and nothing else, so auto and 1:1 keep 4K. The four ratios are
84
+ // the catalog's `resolutionsByAspectRatio`, tested below.
85
85
  const GPT_IMAGE_2_5_IDS = [
86
86
  "gpt-image-2-5-flare",
87
87
  "gpt-image-2-5-flare-i2i",
88
88
  "gpt-image-2-5-sunburst",
89
89
  "gpt-image-2-5-sunburst-i2i",
90
90
  ]
91
- it.each(GPT_IMAGE_2_5_IDS)("%s keeps 4K at auto and at 1:1 (GPT Image 2's rules are not its own)", (modelId) => {
91
+ it.each(GPT_IMAGE_2_5_IDS)("%s keeps 4K at auto and at 1:1", (modelId) => {
92
92
  const auto4k = normalizeModelInput(modelId, { aspectRatio: "auto", resolution: "4K" })
93
93
  expect(auto4k.resolution).toBe("4K")
94
94
  expect(auto4k.adjustments).toEqual([])
@@ -173,6 +173,24 @@ describe("parseRuntimeConfig — typed, lenient, never throws", () => {
173
173
  expect(parseRuntimeConfig(raw)).toEqual({})
174
174
  })
175
175
 
176
+ it("keeps legacyUiHosts as the host names it lists, and nothing else", () => {
177
+ expect(parseRuntimeConfig({ legacyUiHosts: ["app.example.com", "", 7, "Bad Host", "next.app.example.com"] })).toEqual({ legacyUiHosts: ["app.example.com", "next.app.example.com"] })
178
+ expect("legacyUiHosts" in parseRuntimeConfig({ legacyUiHosts: [] })).toBe(false)
179
+ expect("legacyUiHosts" in parseRuntimeConfig({ legacyUiHosts: "app.example.com" })).toBe(false)
180
+ })
181
+
182
+ it("keeps flowUiOrigin and linkOrigin only when each is an https origin", () => {
183
+ expect(parseRuntimeConfig({ apiUrl: "/", flowUiOrigin: "https://flow.example.com", linkOrigin: "https://app.example.com" })).toEqual({
184
+ apiUrl: "/",
185
+ flowUiOrigin: "https://flow.example.com",
186
+ linkOrigin: "https://app.example.com",
187
+ })
188
+ for (const malformed of ["http://flow.example.com", "https://flow.example.com/", "nope", ""]) {
189
+ expect(parseRuntimeConfig({ flowUiOrigin: malformed, linkOrigin: malformed })).toEqual({})
190
+ }
191
+ expect("flowUiOrigin" in parseRuntimeConfig({ apiUrl: "/" })).toBe(false)
192
+ })
193
+
176
194
  it("keeps mediaOrigin only when it is an https origin", () => {
177
195
  expect(parseRuntimeConfig({ apiUrl: "/", mediaOrigin: "https://media.example.com" })).toEqual({ apiUrl: "/", mediaOrigin: "https://media.example.com" })
178
196
  for (const malformed of ["http://media.example.com", "https://media.example.com/", "https://media.example.com/bucket", "media.example.com", "", " ", 7, null, ["https://media.example.com"]]) {
@@ -396,3 +414,13 @@ describe("the UI-string key manifest", () => {
396
414
  expect(JSON.stringify(manifest)).not.toContain("left of")
397
415
  })
398
416
  })
417
+
418
+ describe("isLegacyUiHost: the one rule for a host the app's pages move away from", () => {
419
+ it("is a bare host name, lower case, nothing around it", async () => {
420
+ const { isLegacyUiHost } = await import("../runtime-config/contract.js")
421
+ for (const host of ["app.example.com", "next.app.example.com", "localhost"]) expect(isLegacyUiHost(host), host).toBe(true)
422
+ for (const bad of ["app.example.com\n", "https://app.example.com", "app.example.com:443", "app.example.com/", "a.test\tb.test", "App.example.com", "", " app.example.com", 42, null]) {
423
+ expect(isLegacyUiHost(bad), JSON.stringify(bad)).toBe(false)
424
+ }
425
+ })
426
+ })
@@ -13,6 +13,9 @@ export const CAMERA_SWITCH_DEFAULTS = Object.freeze({
13
13
  minShotMs: 2_500,
14
14
  /** Cut this long before the new speaker starts. */
15
15
  leadMs: 200,
16
+ /** Delay each cut by this long — `leadMs`'s counterpart. A route setting
17
+ * only: no node carries it (`CAMERA_SWITCH_NODE_SETTINGS`). */
18
+ lagMs: 0,
16
19
  /** With a `wide` camera: break to it after this long on one camera. */
17
20
  maxShotMs: 20_000,
18
21
  /** With a `wide` camera: every N-th cut goes to the wide (0 = off). */
@@ -60,6 +63,7 @@ export function cameraSwitchCameras(edl: unknown): Array<{ id: string; role?: st
60
63
  export const CAMERA_SWITCH_BOUNDS = Object.freeze({
61
64
  minShotMs: Object.freeze({ min: 500, max: 60_000 }),
62
65
  leadMs: Object.freeze({ min: 0, max: 5_000 }),
66
+ lagMs: Object.freeze({ min: 0, max: 5_000 }),
63
67
  maxShotMs: Object.freeze({ min: 0, max: 600_000 }),
64
68
  wideEvery: Object.freeze({ min: 0, max: 20 }),
65
69
  })
@@ -69,6 +73,14 @@ export const CAMERA_SWITCH_NAME_MAX = 80
69
73
 
70
74
  export type CameraSwitchNumericSetting = keyof typeof CAMERA_SWITCH_BOUNDS
71
75
 
76
+ /**
77
+ * The numeric settings a Camera Switch NODE carries (its data, which the
78
+ * canvas and the server's executor send through `cameraSwitchSettingsPayload`).
79
+ * `lagMs` is a setting of the route alone — the API, the SDK and the CLI send
80
+ * it; no node does — so it is not one of them.
81
+ */
82
+ export const CAMERA_SWITCH_NODE_SETTINGS = Object.freeze(["minShotMs", "leadMs", "maxShotMs", "wideEvery"] as const satisfies readonly CameraSwitchNumericSetting[])
83
+
72
84
  /** A setting as a whole number inside its range; undefined when unset. */
73
85
  export function clampCameraSwitchSetting(key: CameraSwitchNumericSetting, value: unknown): number | undefined {
74
86
  if (typeof value !== "number" || !Number.isFinite(value)) return undefined
@@ -195,7 +207,7 @@ export function cameraSwitchSettingsPayload(
195
207
  speakerNames: cleanSpeakerNames(data.speakerNames),
196
208
  layoutHints: data.layoutHints === true,
197
209
  }
198
- for (const key of Object.keys(CAMERA_SWITCH_BOUNDS) as CameraSwitchNumericSetting[]) {
210
+ for (const key of CAMERA_SWITCH_NODE_SETTINGS) {
199
211
  const v = clampCameraSwitchSetting(key, data[key])
200
212
  if (v !== undefined) out[key] = v
201
213
  }