@nodaro/shared 3.21.0 → 3.24.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 (84) hide show
  1. package/dist/index.cjs +2291 -195
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +1929 -75
  4. package/dist/index.d.ts +1929 -75
  5. package/dist/index.js +2123 -196
  6. package/dist/index.js.map +1 -1
  7. package/package.json +1 -1
  8. package/src/__tests__/add-captions-plan.test.ts +33 -0
  9. package/src/__tests__/caption-plan-parse.test.ts +23 -0
  10. package/src/__tests__/caption-segment-schema.test.ts +30 -0
  11. package/src/__tests__/collections.test.ts +253 -0
  12. package/src/__tests__/dialogue-capabilities.test.ts +157 -0
  13. package/src/__tests__/edit-plan-review.test.ts +70 -0
  14. package/src/__tests__/edl-clocks.test.ts +97 -0
  15. package/src/__tests__/edl.test.ts +34 -0
  16. package/src/__tests__/execution-outcome.test.ts +44 -0
  17. package/src/__tests__/fan-out-meta.test.ts +23 -0
  18. package/src/__tests__/fan-out-rows.test.ts +36 -0
  19. package/src/__tests__/fan-out-url-item.test.ts +44 -0
  20. package/src/__tests__/fixtures/speaker-tracks.fixtures.json +622 -0
  21. package/src/__tests__/input-field-extra-keys.test.ts +34 -0
  22. package/src/__tests__/list-consumers-fan-in.test.ts +40 -0
  23. package/src/__tests__/model-tree.test.ts +7 -0
  24. package/src/__tests__/node-pass-through.test.ts +23 -0
  25. package/src/__tests__/node-runtime-keys.test.ts +1 -0
  26. package/src/__tests__/picker-restrictions.test.ts +36 -0
  27. package/src/__tests__/preview-gate.test.ts +305 -0
  28. package/src/__tests__/render-basis.test.ts +176 -0
  29. package/src/__tests__/render-nodes.test.ts +73 -0
  30. package/src/__tests__/render-output.test.ts +392 -0
  31. package/src/__tests__/run-continuation.test.ts +32 -0
  32. package/src/__tests__/speaker-tracks.test.ts +474 -0
  33. package/src/__tests__/speech-pricing.test.ts +69 -0
  34. package/src/__tests__/telegram-channel.test.ts +91 -0
  35. package/src/__tests__/tts-capabilities.test.ts +81 -4
  36. package/src/__tests__/tts-neighbour-text.test.ts +19 -0
  37. package/src/__tests__/ugc-call-body.test.ts +38 -0
  38. package/src/__tests__/ugc-run-state.test.ts +68 -0
  39. package/src/__tests__/video-character-refs.test.ts +213 -0
  40. package/src/__tests__/video-overlay-layer-plan.test.ts +94 -0
  41. package/src/add-captions-plan.ts +50 -0
  42. package/src/caption-plan.ts +45 -0
  43. package/src/caption-segment-schema.ts +82 -0
  44. package/src/collections.ts +482 -0
  45. package/src/competitors.ts +77 -0
  46. package/src/credit-estimators/index.ts +9 -0
  47. package/src/credit-estimators/speech.ts +51 -0
  48. package/src/dialogue-capabilities.ts +48 -0
  49. package/src/edit-plan-contract.ts +20 -9
  50. package/src/edit-plan-review.ts +40 -1
  51. package/src/edl.ts +27 -1
  52. package/src/execution-outcome.ts +41 -0
  53. package/src/fan-out-meta.ts +23 -0
  54. package/src/fan-out-rows.ts +74 -5
  55. package/src/gemini-omni-voices.ts +59 -0
  56. package/src/handle-aliases.ts +298 -0
  57. package/src/i18n/camera-motions.pt-BR.ts +14 -14
  58. package/src/i18n/transitions.pt-BR.ts +13 -13
  59. package/src/index.ts +180 -1
  60. package/src/model-catalog.ts +122 -13
  61. package/src/model-constants.ts +24 -4
  62. package/src/model-tree.ts +5 -1
  63. package/src/node-execution-state.ts +13 -0
  64. package/src/node-mappable-fields.ts +7 -1
  65. package/src/node-pass-through.ts +37 -0
  66. package/src/node-runtime-keys.ts +14 -0
  67. package/src/picker-restrictions.ts +49 -0
  68. package/src/presentation-types.ts +26 -2
  69. package/src/presentation-utils.ts +25 -7
  70. package/src/preview-gate.ts +279 -0
  71. package/src/producer-types.ts +58 -0
  72. package/src/render-final.ts +20 -0
  73. package/src/render-nodes.ts +92 -0
  74. package/src/render-output.ts +565 -0
  75. package/src/run-continuation.ts +39 -0
  76. package/src/speaker-tracks.ts +638 -0
  77. package/src/telegram-channel.ts +140 -0
  78. package/src/transcribe-preflight.ts +8 -4
  79. package/src/tts-capabilities.ts +19 -5
  80. package/src/tts-neighbour-text.ts +46 -0
  81. package/src/ugc-call-body.ts +86 -0
  82. package/src/ugc-run-state.ts +64 -0
  83. package/src/video-character-refs.ts +233 -0
  84. package/src/video-overlay.ts +78 -21
package/dist/index.cjs CHANGED
@@ -53,6 +53,7 @@ function isAutoVideoDuration(duration) {
53
53
  }
54
54
 
55
55
  // src/model-catalog.ts
56
+ var SPEECH_UNIT_PRICE_NOTE = "per started 100 characters, at least 8 units \u2014 where length pricing is on";
56
57
  var MODEL_RECOMMENDATIONS = [
57
58
  // image
58
59
  { intent: "best for typography / logos / text-heavy", modelIds: ["nano-banana-pro", "gpt-image-2"], note: "Nano Banana Pro for diagrams / complex text; GPT Image 2 for logos and short copy." },
@@ -2288,6 +2289,7 @@ var TTS_LANGS_V3 = [
2288
2289
  "sw"
2289
2290
  ];
2290
2291
  var TTS_LEVERS_V2 = ["stability", "similarity", "style", "speed", "speakerBoost"];
2292
+ var DIALOGUE_V4_MAX_CHARS = 5e3;
2291
2293
  var AUDIO_MODELS = {
2292
2294
  // ── ElevenLabs TTS ──
2293
2295
  "elevenlabs-v3": {
@@ -2300,12 +2302,19 @@ var AUDIO_MODELS = {
2300
2302
  description: "Expressive ElevenLabs TTS \u2014 supports [audio tags] for emotion / pacing. Direct API.",
2301
2303
  useCases: ["tts", "voice-over", "narration", "expressive"],
2302
2304
  features: ["audio-tags", "voice-cloning"],
2303
- pricing: [{ identifier: "elevenlabs-v3", credits: 30 }],
2305
+ pricing: [
2306
+ { identifier: "elevenlabs-v3", credits: 30 },
2307
+ { identifier: "elevenlabs-v3:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
2308
+ ],
2304
2309
  tts: {
2305
2310
  audioTags: true,
2306
2311
  ssmlBreaks: false,
2307
2312
  levers: ["stability"],
2308
2313
  languageCode: true,
2314
+ timestamps: true,
2315
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2316
+ // Rejects previous_text / next_text with a 400 (probed 2026-10-04).
2317
+ stitching: false,
2309
2318
  maxChars: 5e3,
2310
2319
  // official cap (probed: 5,200 chars accepted; keep the clamp)
2311
2320
  languages: TTS_LANGS_V3
@@ -2321,7 +2330,10 @@ var AUDIO_MODELS = {
2321
2330
  description: "Newest ElevenLabs TTS \u2014 [audio tags], stability and similarity control, up to 10,000 characters per request. Direct API.",
2322
2331
  useCases: ["tts", "voice-over", "narration", "expressive", "long-form"],
2323
2332
  features: ["audio-tags", "voice-cloning"],
2324
- pricing: [{ identifier: "elevenlabs-v4", credits: 30 }],
2333
+ pricing: [
2334
+ { identifier: "elevenlabs-v4", credits: 30 },
2335
+ { identifier: "elevenlabs-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
2336
+ ],
2325
2337
  // The default speech model (DEFAULT_TTS_PROVIDER) carries the star.
2326
2338
  featured: true,
2327
2339
  tts: {
@@ -2329,6 +2341,10 @@ var AUDIO_MODELS = {
2329
2341
  ssmlBreaks: false,
2330
2342
  levers: ["stability", "similarity"],
2331
2343
  languageCode: true,
2344
+ timestamps: true,
2345
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2346
+ // Accepts previous_text / next_text (probed 2026-10-04).
2347
+ stitching: true,
2332
2348
  maxChars: 1e4,
2333
2349
  // The curated picker, the same 46 as v3. The model itself lists 85
2334
2350
  // (it adds e.g. Cantonese, Maltese, Mongolian, Burmese, Uzbek); widening
@@ -2345,12 +2361,21 @@ var AUDIO_MODELS = {
2345
2361
  series: "ElevenLabs",
2346
2362
  description: "Fast, cheap ElevenLabs TTS via the direct ElevenLabs API. Good for narration.",
2347
2363
  useCases: ["tts", "narration", "fast"],
2348
- pricing: [{ identifier: "elevenlabs-turbo", credits: 15, note: "per 1K chars" }],
2364
+ // The flat row carries no note (a "per 1K chars" note once described a
2365
+ // scaling that never existed; the minimum under length pricing is 8 units, 16).
2366
+ pricing: [
2367
+ { identifier: "elevenlabs-turbo", credits: 15 },
2368
+ { identifier: "elevenlabs-turbo:per-100-chars", credits: 2, note: SPEECH_UNIT_PRICE_NOTE }
2369
+ ],
2349
2370
  tts: {
2350
2371
  audioTags: false,
2351
2372
  ssmlBreaks: true,
2352
2373
  levers: TTS_LEVERS_V2,
2353
2374
  languageCode: true,
2375
+ timestamps: true,
2376
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2377
+ // Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
2378
+ stitching: true,
2354
2379
  maxChars: 4e4,
2355
2380
  // == eleven_flash_v2_5 (functionally equivalent)
2356
2381
  languages: TTS_LANGS_FLASH_V25
@@ -2365,13 +2390,21 @@ var AUDIO_MODELS = {
2365
2390
  series: "ElevenLabs",
2366
2391
  description: "Multi-language ElevenLabs TTS via the direct ElevenLabs API.",
2367
2392
  useCases: ["tts", "multilingual"],
2368
- pricing: [{ identifier: "elevenlabs-multilingual", credits: 30, note: "per 1K chars" }],
2393
+ // The flat row carries no note (the old "per 1K chars" described a scaling that never existed).
2394
+ pricing: [
2395
+ { identifier: "elevenlabs-multilingual", credits: 30 },
2396
+ { identifier: "elevenlabs-multilingual:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
2397
+ ],
2369
2398
  tts: {
2370
2399
  audioTags: false,
2371
2400
  ssmlBreaks: true,
2372
2401
  levers: TTS_LEVERS_V2,
2373
2402
  // The API reference: "This parameter is not supported for multilingual_v2 models."
2374
2403
  languageCode: false,
2404
+ timestamps: true,
2405
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2406
+ // Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
2407
+ stitching: true,
2375
2408
  maxChars: 1e4,
2376
2409
  languages: TTS_LANGS_MULTILINGUAL_V2
2377
2410
  }
@@ -2389,18 +2422,61 @@ var AUDIO_MODELS = {
2389
2422
  description: "Multi-speaker dialogue via the direct ElevenLabs API \u2014 give it a script, it voices each role (any voice: premade, library, or cloned).",
2390
2423
  useCases: ["tts", "dialogue", "multi-speaker"],
2391
2424
  features: ["audio-tags", "voice-cloning"],
2392
- pricing: [{ identifier: "elevenlabs-dialogue", credits: 25, note: "per 1K chars" }],
2425
+ // Flat per request, whatever the length (decided 2026-10-06: the old
2426
+ // "per 1K chars" note described a scaling that never existed).
2427
+ pricing: [
2428
+ { identifier: "elevenlabs-dialogue", credits: 25 },
2429
+ { identifier: "elevenlabs-dialogue:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
2430
+ ],
2393
2431
  tts: {
2394
2432
  audioTags: true,
2395
2433
  ssmlBreaks: false,
2396
2434
  levers: ["stability"],
2435
+ // The dialogue route has offered exactly these three since it shipped
2436
+ // (routes/text-to-dialogue.ts). Kept as the platform's v3 dialogue contract.
2437
+ stabilitySteps: [0, 0.5, 1],
2397
2438
  languageCode: true,
2439
+ timestamps: true,
2440
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2441
+ // The dialogue funnel does not read this field (its own lane; phase 2 declares
2442
+ // the v4 dialogue model's value). v3 underneath.
2443
+ stitching: false,
2398
2444
  // Total across lines. The documented 2,000 is a recommendation, not a
2399
2445
  // limit (2,500 and 5,000 both probed 200); capped like v3, the model underneath.
2400
2446
  maxChars: 5e3,
2401
2447
  languages: TTS_LANGS_V3
2402
2448
  }
2403
2449
  },
2450
+ "elevenlabs-dialogue-v4": {
2451
+ id: "elevenlabs-dialogue-v4",
2452
+ kind: "audio",
2453
+ // Its own mode, never "tts" — the same reason as v3 dialogue above.
2454
+ modes: ["dialogue"],
2455
+ family: "ElevenLabs",
2456
+ label: "ElevenLabs Dialogue v4",
2457
+ series: "ElevenLabs",
2458
+ description: "Multi-speaker dialogue on ElevenLabs v4 \u2014 [audio tags], stability and similarity control. Direct API.",
2459
+ useCases: ["tts", "dialogue", "multi-speaker"],
2460
+ features: ["audio-tags", "voice-cloning"],
2461
+ // Flat per request, the same as v3 dialogue (decided 2026-10-06).
2462
+ pricing: [
2463
+ { identifier: "elevenlabs-dialogue-v4", credits: 25 },
2464
+ { identifier: "elevenlabs-dialogue-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
2465
+ ],
2466
+ tts: {
2467
+ audioTags: true,
2468
+ ssmlBreaks: false,
2469
+ levers: ["stability", "similarity"],
2470
+ languageCode: true,
2471
+ timestamps: true,
2472
+ // measured 2026-10-06: /with-timestamps answers 200 at the same character cost
2473
+ // Dialogue models never stitch neighbour text (the funnel does not read this).
2474
+ stitching: false,
2475
+ maxChars: DIALOGUE_V4_MAX_CHARS,
2476
+ // The curated picker, v3's 46 (v4 lists 85; widening is its own change).
2477
+ languages: TTS_LANGS_V3
2478
+ }
2479
+ },
2404
2480
  // ── ElevenLabs voice utilities ──
2405
2481
  // (voice cloning was retired platform-wide on 2026-09-15 — no catalog entry,
2406
2482
  // no price, no MCP tool; existing clones still resolve as TTS voice ids.)
@@ -3748,6 +3824,8 @@ var TTS_PROVIDERS = [
3748
3824
  "elevenlabs-multilingual",
3749
3825
  "elevenlabs"
3750
3826
  ];
3827
+ var DIALOGUE_PROVIDERS = ["elevenlabs-dialogue", "elevenlabs-dialogue-v4"];
3828
+ var DEFAULT_DIALOGUE_PROVIDER = "elevenlabs-dialogue";
3751
3829
  var DEFAULT_TTS_PROVIDER = "elevenlabs-v4";
3752
3830
  var TEXT_TO_AUDIO_PROVIDERS = [
3753
3831
  // Replicate disabled
@@ -4138,10 +4216,16 @@ var VIDEO_REF_LIMITS_BY_PROVIDER = {
4138
4216
  "wan-3": { images: 10, videos: 5, audio: 5 },
4139
4217
  "wan-3-prime": { images: 10, videos: 5, audio: 5 },
4140
4218
  // Multi-image reference providers.
4141
- "gemini-omni-video": { images: 7, videos: 1 },
4219
+ // `characters` = the dedicated identity input (KIE `character_ids`, max 3).
4220
+ // It is NOT an image-reference lane: it draws from the SAME 7-unit budget as
4221
+ // `images` (images + 2×videos + character units ≤ 7) — see
4222
+ // `video-character-refs.ts`, the one place that budget is computed.
4223
+ // `voices` = distinct audio personas per task (`audio_ids`, max 3). NOT part
4224
+ // of the 7-unit quota: audio ids are a separate input.
4225
+ "gemini-omni-video": { images: 7, videos: 1, characters: 3, voices: 3 },
4142
4226
  // Gemini Omni Flash 1.1 — identical quota to the pro sibling
4143
4227
  // (images + 2×videos + character_ids ≤ 7).
4144
- "gemini-omni-flash": { images: 7, videos: 1 },
4228
+ "gemini-omni-flash": { images: 7, videos: 1, characters: 3, voices: 3 },
4145
4229
  "kling-3-omni": { images: 7 },
4146
4230
  // catalog/docs: "end frame + up to 7 reference images"
4147
4231
  "grok-i2v": { images: 7 },
@@ -4322,7 +4406,9 @@ var VIDEO_AUDIO_CAPABILITY = {
4322
4406
  // - NOT audio_driven either: "Uploading audio references is unsupported in
4323
4407
  // the current version of the API", and "any audio in a video reference is
4324
4408
  // ignored" — there is no reference-audio transport to be driven by, and
4325
- // runGeminiOmni never sends `audio_ids`.
4409
+ // runGeminiOmni sends `audio_ids` ONLY for a
4410
+ // character's pinned voice persona (a preset voice, never a recording), which
4411
+ // is not a reference-audio transport and leaves the mode `ambient`.
4326
4412
  // Audio is priced into the per-tier rate, so NOT cost-affecting.
4327
4413
  "gemini-omni-video": { mode: "ambient", alwaysOn: true },
4328
4414
  "gemini-omni-flash": { mode: "ambient", alwaysOn: true }
@@ -4924,6 +5010,134 @@ function getFeaturedEntities(type) {
4924
5010
  return FEATURED_ENTITIES[type] ?? [];
4925
5011
  }
4926
5012
 
5013
+ // src/video-character-refs.ts
5014
+ var VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(
5015
+ 0,
5016
+ ...Object.values(VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0)
5017
+ );
5018
+ var VIDEO_CHARACTER_DESCRIPTION_MAX = 2e3;
5019
+ var VIDEO_CHARACTER_NAME_MAX = 100;
5020
+ var VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2e3;
5021
+ var VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
5022
+ function videoCharacterRefCap(provider) {
5023
+ return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0 : 0;
5024
+ }
5025
+ function videoCharacterVoiceCap(provider) {
5026
+ return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0 : 0;
5027
+ }
5028
+ function videoCharacterVoiceKey(ref) {
5029
+ const voice = ref.voice;
5030
+ if (!voice) return null;
5031
+ return JSON.stringify([voice.preset, voice.description?.trim() ?? "", voice.exampleLine?.trim() ?? "", ref.name?.trim() ?? ""]);
5032
+ }
5033
+ function videoCharacterDistinctVoices(characterReferences) {
5034
+ const keys = /* @__PURE__ */ new Set();
5035
+ for (const c of characterReferences ?? []) {
5036
+ const key = videoCharacterVoiceKey(c);
5037
+ if (key) keys.add(key);
5038
+ }
5039
+ return keys.size;
5040
+ }
5041
+ function videoCharacterRefProviders() {
5042
+ return Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => (l?.characters ?? 0) > 0).map(([id]) => id);
5043
+ }
5044
+ function videoCharacterRefUnits(characterReferences) {
5045
+ let units = 0;
5046
+ for (const c of characterReferences ?? []) units += c.bodyImageUrl ? 2 : 1;
5047
+ return units;
5048
+ }
5049
+ function videoCharacterVoiceProblem(args) {
5050
+ const distinct = videoCharacterDistinctVoices(args.characterReferences);
5051
+ if (distinct === 0) return null;
5052
+ const cap = args.cap ?? videoCharacterVoiceCap(args.provider);
5053
+ if (cap === 0) {
5054
+ return {
5055
+ code: "character_voice_unsupported",
5056
+ message: `A character voice is not supported by ${args.provider ?? "the selected model"}. Drop the voice, or pick a model that takes characterReferences.`
5057
+ };
5058
+ }
5059
+ if (distinct > cap) {
5060
+ return {
5061
+ code: "character_voices_over_limit",
5062
+ message: `${args.provider} accepts at most ${cap} distinct character voices per video; got ${distinct}. Give some characters the same voice, or drop some.`
5063
+ };
5064
+ }
5065
+ return null;
5066
+ }
5067
+ function videoCharacterRefProblem(args) {
5068
+ const { provider, characterReferences } = args;
5069
+ if (!characterReferences || characterReferences.length === 0) return null;
5070
+ const cap = videoCharacterRefCap(provider);
5071
+ if (cap === 0) {
5072
+ return {
5073
+ code: "character_references_unsupported",
5074
+ message: `characterReferences is not supported by ${provider ?? "the selected model"}. Models that take them: ${videoCharacterRefProviders().join(", ")}. Otherwise send the portrait as a reference image instead.`
5075
+ };
5076
+ }
5077
+ if (characterReferences.length > cap) {
5078
+ return {
5079
+ code: "character_references_over_limit",
5080
+ message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`
5081
+ };
5082
+ }
5083
+ if (args.hasStartFrame) {
5084
+ return {
5085
+ code: "character_references_with_start_frame",
5086
+ message: `${provider} does not yet support combining characterReferences with a start frame (imageUrl) \u2014 the frame and the characters would compete for the same input slots without a defined role. Drop the start frame (the character's portrait carries the face), or drop characterReferences.`
5087
+ };
5088
+ }
5089
+ if (args.hasEndFrame) {
5090
+ return {
5091
+ code: "character_references_with_end_frame",
5092
+ message: `${provider} does not use an end frame (endFrameUrl) together with characterReferences. Drop the end frame, or drop characterReferences.`
5093
+ };
5094
+ }
5095
+ const budget = VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.images ?? 7;
5096
+ const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences);
5097
+ if (used > budget) {
5098
+ return {
5099
+ code: "character_references_quota",
5100
+ message: `${provider} takes at most ${budget} input units: reference images count 1, each reference video 2, each character 1 (2 with a body image). This request uses ${used}. Remove some reference images or characters.`
5101
+ };
5102
+ }
5103
+ return videoCharacterVoiceProblem({ provider, characterReferences });
5104
+ }
5105
+
5106
+ // src/gemini-omni-voices.ts
5107
+ var GEMINI_OMNI_VOICE_PRESETS = [
5108
+ { id: "achernar", gender: "female", style: "soft", pitch: "high" },
5109
+ { id: "achird", gender: "male", style: "friendly", pitch: "mid" },
5110
+ { id: "algenib", gender: "male", style: "raspy", pitch: "low" },
5111
+ { id: "algieba", gender: "male", style: "easygoing", pitch: "mid-low" },
5112
+ { id: "alnilam", gender: "male", style: "steady", pitch: "mid-low" },
5113
+ { id: "aoede", gender: "female", style: "brisk", pitch: "mid" },
5114
+ { id: "autonoe", gender: "female", style: "bright", pitch: "mid" },
5115
+ { id: "callirrhoe", gender: "female", style: "easygoing", pitch: "mid" },
5116
+ { id: "charon", gender: "male", style: "intellectual", pitch: "low" },
5117
+ { id: "despina", gender: "female", style: "smooth", pitch: "mid" },
5118
+ { id: "enceladus", gender: "male", style: "breathy", pitch: "low" },
5119
+ { id: "erinome", gender: "female", style: "clear", pitch: "mid" },
5120
+ { id: "fenrir", gender: "male", style: "lively", pitch: "younger" },
5121
+ { id: "gacrux", gender: "female", style: "mature", pitch: "mid" },
5122
+ { id: "iapetus", gender: "male", style: "clear", pitch: "mid-low" },
5123
+ { id: "kore", gender: "female", style: "capable", pitch: "mid" },
5124
+ { id: "laomedeia", gender: "female", style: "cheerful", pitch: "mid-high" },
5125
+ { id: "leda", gender: "female", style: "young", pitch: "mid-high" },
5126
+ { id: "orus", gender: "male", style: "steady", pitch: "mid-low" },
5127
+ { id: "puck", gender: "male", style: "cheerful", pitch: "mid" },
5128
+ { id: "pulcherrima", gender: "genderless", style: "forward", pitch: "mid-high" },
5129
+ { id: "rasalgethi", gender: "male", style: "intellectual", pitch: "mid" },
5130
+ { id: "sadachbia", gender: "male", style: "vivid", pitch: "low" },
5131
+ { id: "sadaltager", gender: "male", style: "knowledgeable", pitch: "mid" },
5132
+ { id: "schedar", gender: "male", style: "smooth", pitch: "mid-low" },
5133
+ { id: "sulafat", gender: "female", style: "warm", pitch: "mid" },
5134
+ { id: "umbriel", gender: "male", style: "smooth", pitch: "low" },
5135
+ { id: "vindemiatrix", gender: "female", style: "gentle", pitch: "mid" },
5136
+ { id: "zephyr", gender: "female", style: "bright", pitch: "mid-high" },
5137
+ { id: "zubenelgenubi", gender: "male", style: "casual", pitch: "mid-low" }
5138
+ ];
5139
+ var GEMINI_OMNI_VOICE_PRESET_IDS = GEMINI_OMNI_VOICE_PRESETS.map((v) => v.id);
5140
+
4927
5141
  // src/inpaint-region.ts
4928
5142
  function band(center) {
4929
5143
  if (center < 1 / 3) return "low";
@@ -4933,10 +5147,10 @@ function band(center) {
4933
5147
  var VERT = { low: "upper", mid: "middle", high: "lower" };
4934
5148
  var HORZ = { low: "left", mid: "center", high: "right" };
4935
5149
  function describeMaskRegion(box, image) {
4936
- const clamp013 = (n) => Math.max(0, Math.min(1, n));
5150
+ const clamp014 = (n) => Math.max(0, Math.min(1, n));
4937
5151
  const round2 = (n) => Math.round(n * 100) / 100;
4938
- const nx = clamp013(box.x / image.width);
4939
- const ny = clamp013(box.y / image.height);
5152
+ const nx = clamp014(box.x / image.width);
5153
+ const ny = clamp014(box.y / image.height);
4940
5154
  const normBbox = {
4941
5155
  x: round2(nx),
4942
5156
  y: round2(ny),
@@ -5149,20 +5363,20 @@ function buildCreditModelIdentifier(provider, quality, resolution, renderingSpee
5149
5363
  return provider;
5150
5364
  }
5151
5365
  function resolveNormalizedImageGen(opts) {
5152
- const str3 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
5153
- const provider = str3(opts.provider) ?? "nano-banana";
5366
+ const str7 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
5367
+ const provider = str7(opts.provider) ?? "nano-banana";
5154
5368
  const modelId = opts.swapToI2i && opts.refCount > 0 ? T2I_TO_I2I_VARIANT[provider] ?? provider : provider;
5155
5369
  const n = normalizeModelInput(modelId, {
5156
- aspectRatio: str3(opts.aspectRatio),
5157
- resolution: str3(opts.resolution),
5158
- quality: str3(opts.quality)
5370
+ aspectRatio: str7(opts.aspectRatio),
5371
+ resolution: str7(opts.resolution),
5372
+ quality: str7(opts.quality)
5159
5373
  });
5160
5374
  return {
5161
5375
  identifier: buildCreditModelIdentifier(
5162
5376
  modelId,
5163
5377
  n.quality,
5164
5378
  n.resolution,
5165
- str3(opts.renderingSpeed),
5379
+ str7(opts.renderingSpeed),
5166
5380
  void 0,
5167
5381
  opts.refCount
5168
5382
  ),
@@ -5543,6 +5757,58 @@ function ltxRetakeDurationSec(raw) {
5543
5757
  return Math.max(LTX_RETAKE_MIN_DURATION_SEC, n);
5544
5758
  }
5545
5759
 
5760
+ // src/tts-capabilities.ts
5761
+ var TTS_PROVIDER_ALIASES = {
5762
+ elevenlabs: "elevenlabs-turbo"
5763
+ };
5764
+ var TTS_FALLBACK_PROVIDER = "elevenlabs-turbo";
5765
+ function canonicalTtsProvider(provider) {
5766
+ return typeof provider === "string" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider] : provider;
5767
+ }
5768
+ function findTtsCapabilities(provider) {
5769
+ if (typeof provider !== "string" || !provider) return void 0;
5770
+ const id = canonicalTtsProvider(provider);
5771
+ if (!Object.hasOwn(MODEL_CATALOG, id)) return void 0;
5772
+ const entry = MODEL_CATALOG[id];
5773
+ return entry.modes.includes("tts") ? entry.tts : void 0;
5774
+ }
5775
+ function getTtsCapabilities(provider) {
5776
+ return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
5777
+ }
5778
+ function ttsSupportsAudioTags(provider) {
5779
+ return getTtsCapabilities(provider).audioTags;
5780
+ }
5781
+ function ttsSupportsSsmlBreaks(provider) {
5782
+ return getTtsCapabilities(provider).ssmlBreaks;
5783
+ }
5784
+ function ttsSupportsStitching(provider) {
5785
+ return getTtsCapabilities(provider).stitching;
5786
+ }
5787
+ function ttsHasLever(provider, lever) {
5788
+ return getTtsCapabilities(provider).levers.includes(lever);
5789
+ }
5790
+ function ttsSupportsTimestamps(provider) {
5791
+ return getTtsCapabilities(provider).timestamps;
5792
+ }
5793
+ function ttsLanguageCodes(provider) {
5794
+ return getTtsCapabilities(provider).languages;
5795
+ }
5796
+
5797
+ // src/credit-estimators/speech.ts
5798
+ var SPEECH_PRICE_UNIT_CHARS = 100;
5799
+ var SPEECH_FLOOR_UNITS = 8;
5800
+ var SPEECH_UNIT_CREDIT_SUFFIX = ":per-100-chars";
5801
+ function speechUnitCreditId(modelId) {
5802
+ return `${canonicalTtsProvider(modelId)}${SPEECH_UNIT_CREDIT_SUFFIX}`;
5803
+ }
5804
+ function speechPriceUnits(chars) {
5805
+ const started = Number.isFinite(chars) && chars > 0 ? Math.ceil(chars / SPEECH_PRICE_UNIT_CHARS) : 0;
5806
+ return Math.max(SPEECH_FLOOR_UNITS, started);
5807
+ }
5808
+ function speechCredits(chars, perUnitCredits) {
5809
+ return speechPriceUnits(chars) * perUnitCredits;
5810
+ }
5811
+
5546
5812
  // src/video-duration.ts
5547
5813
  function extractVideoDurationFromNode(data) {
5548
5814
  if (!data) return void 0;
@@ -5791,6 +6057,42 @@ var AUDIO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
5791
6057
  // Extract Audio: demuxes a video's audio track to a standalone MP3.
5792
6058
  "extract-audio"
5793
6059
  ]);
6060
+ var IMAGE_PRODUCER_TYPES = /* @__PURE__ */ new Set([
6061
+ "upload-image",
6062
+ "generate-image",
6063
+ "edit-image",
6064
+ "image-to-image",
6065
+ "modify-image",
6066
+ "upscale-image",
6067
+ "remove-background",
6068
+ // extract-frame produces a single still image extracted from a video source.
6069
+ "extract-frame",
6070
+ // generate-mask emits the source image AND a mask PNG; its `image` source
6071
+ // pip is the passthrough (the same image as the input).
6072
+ "generate-mask",
6073
+ // paint-mask emits the hand-painted mask PNG (a plain image at runtime).
6074
+ // Membership is what makes mask targets accept it — mask is an advisory
6075
+ // color, not a gated type.
6076
+ "paint-mask",
6077
+ // reference-sheet's `sheet` is one composited image and `panels` carries
6078
+ // clean reference images; both resolve to image URLs at runtime.
6079
+ "reference-sheet",
6080
+ // reference-board's `image` pip emits a real generated board image.
6081
+ "reference-board",
6082
+ // image-collage composites N images → ONE image.
6083
+ "image-collage",
6084
+ // image-overlay places layers on a base → ONE image.
6085
+ "image-overlay",
6086
+ // 3D Render Pro's `stills` handle carries one PNG per shot of the exported
6087
+ // composition (spread into referenceImageUrls like reference-sheet
6088
+ // `panels`). A validator sees only the source NODE type, so this also makes
6089
+ // its `video` pip droppable on an image input — the handle-blind trade
6090
+ // reference-sheet and split-media already make; the input resolvers route
6091
+ // by handle, so only `stills` becomes an image at runtime. Deliberately NOT
6092
+ // in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY
6093
+ // asset, and 3D Render Pro's is the MP4.
6094
+ "pro-3d-render"
6095
+ ]);
5794
6096
  var FAN_OUT_EACH_TYPES = /* @__PURE__ */ new Set([
5795
6097
  "list",
5796
6098
  "split-text",
@@ -5818,6 +6120,7 @@ var FAN_OUT_EACH_HANDLES = {
5818
6120
  // (decided 2026-10-04).
5819
6121
  "camera-switch": { each: ["edl"], primary: "edl" }
5820
6122
  };
6123
+ var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
5821
6124
  var OWN_LIST_NODE_TYPES = /* @__PURE__ */ new Set(["extract-field", "json-process"]);
5822
6125
  function ownsItsList(nodeType) {
5823
6126
  return typeof nodeType === "string" && OWN_LIST_NODE_TYPES.has(nodeType);
@@ -5842,7 +6145,19 @@ var FAN_IN_TARGETS = {
5842
6145
  // Telegram Reply — one message per run, whatever is wired into its text
5843
6146
  // input: a list (or a writer that ran once per item) arrives as one
5844
6147
  // message, never as a burst of sends to the owner's chat.
5845
- "telegram-account-send": ["in"]
6148
+ "telegram-account-send": ["in"],
6149
+ // The list operators — they READ the whole list wired into them (their
6150
+ // executors collect every upstream item themselves) and emit a list. Run
6151
+ // once per item by an "each" wire (a Split Text, a List, a node that ran per
6152
+ // item), every iteration saw the same whole list and answered with its
6153
+ // first match: a Filter List fed 11 stories handed 11 copies of story one
6154
+ // downstream, and every paid stage after it ran 11 times on it
6155
+ // (2026-10-06). A list operator is never fanned out, on any wire.
6156
+ "filter-list": "*",
6157
+ deduplicate: "*",
6158
+ "merge-lists": "*",
6159
+ "sort-list": "*",
6160
+ selector: "*"
5846
6161
  };
5847
6162
  function isFanInNodeType(nodeType) {
5848
6163
  return typeof nodeType === "string" && Object.prototype.hasOwnProperty.call(FAN_IN_TARGETS, nodeType);
@@ -5877,6 +6192,36 @@ function canonicalizeOverrideKeys(nodeType, overrides) {
5877
6192
  return out ?? overrides;
5878
6193
  }
5879
6194
 
6195
+ // src/render-nodes.ts
6196
+ var outputSettingMedium = (data) => data.output === "audio" ? "audio" : "video";
6197
+ var descriptor = (d) => Object.freeze({ ...d });
6198
+ var RENDER_NODE_TYPES = Object.freeze({
6199
+ "apply-edl": descriptor({
6200
+ mediumOf: outputSettingMedium,
6201
+ creditId: (quality) => applyEdlCreditId(quality),
6202
+ clockMapFrom: "input",
6203
+ ownerOnlyListing: true,
6204
+ latestBatch: true,
6205
+ jsonKind: "transcript"
6206
+ })
6207
+ });
6208
+ var RENDER_NODE_TYPE_IDS = Object.freeze(Object.keys(RENDER_NODE_TYPES));
6209
+ function renderNodeOf(type) {
6210
+ return typeof type === "string" && Object.hasOwn(RENDER_NODE_TYPES, type) ? RENDER_NODE_TYPES[type] : void 0;
6211
+ }
6212
+ function isRenderNodeType(type) {
6213
+ return renderNodeOf(type) !== void 0;
6214
+ }
6215
+ function rendersLatestBatch(type) {
6216
+ return renderNodeOf(type)?.latestBatch === true;
6217
+ }
6218
+ function rendersTranscriptJson(type) {
6219
+ return renderNodeOf(type)?.jsonKind === "transcript";
6220
+ }
6221
+ var OWNER_ONLY_LISTING_RENDER_TYPES = Object.freeze(
6222
+ RENDER_NODE_TYPE_IDS.filter((t2) => RENDER_NODE_TYPES[t2].ownerOnlyListing)
6223
+ );
6224
+
5880
6225
  // src/presentation-utils.ts
5881
6226
  var INPUT_NODE_TYPES = /* @__PURE__ */ new Set([
5882
6227
  "text-prompt",
@@ -6006,13 +6351,14 @@ var VIDEO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
6006
6351
  "video-upscale",
6007
6352
  "add-captions",
6008
6353
  "social-media-format",
6009
- // apply-edl renders an EDL into video OR audio. Its medium is decided at run
6010
- // time (DYNAMIC_PRODUCER_TYPES), so getOutputType would answer "data" and a
6011
- // published app would render the cut as a JSON blob. Declaring it here — as
6012
- // the voice-changer/dubbing precedent does for their default medium — makes
6013
- // the classifier answer "video" (the common case; an audio-only cut still
6014
- // plays in a video element). Asserted in producer-types.test.ts.
6015
- "apply-edl"
6354
+ // A render (Apply EDL) renders an EDL into video OR audio. Its medium is
6355
+ // decided at run time (DYNAMIC_PRODUCER_TYPES), so getOutputType would answer
6356
+ // "data" and a published app would render the cut as a JSON blob. Declaring
6357
+ // every render here — as the voice-changer/dubbing precedent does for their
6358
+ // default medium — makes the classifier answer "video" (the common case; an
6359
+ // audio-only cut still plays in a video element). Asserted in
6360
+ // producer-types.test.ts.
6361
+ ...RENDER_NODE_TYPE_IDS
6016
6362
  ]);
6017
6363
  var AUDIO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
6018
6364
  "text-to-speech",
@@ -6168,8 +6514,16 @@ var INPUT_FIELD_MAP = {
6168
6514
  "music-mood": { key: "emotion", type: "select" },
6169
6515
  "instrumentation": { key: "production", type: "select" },
6170
6516
  "voice-character": { key: "timbre", type: "select" },
6171
- "voice-delivery": { key: "archetype", type: "select" }
6517
+ "voice-delivery": { key: "archetype", type: "select" },
6518
+ // --- UGC (Cloud) ---
6519
+ "ugc-creator": { key: "source", type: "select" }
6520
+ };
6521
+ var INPUT_FIELD_EXTRA_KEYS = {
6522
+ "ugc-creator": [{ key: "gender", type: "select" }, { key: "photoUrl", type: "image-url" }]
6172
6523
  };
6524
+ function getInputFieldExtraKeys(nodeType) {
6525
+ return Object.hasOwn(INPUT_FIELD_EXTRA_KEYS, nodeType) ? INPUT_FIELD_EXTRA_KEYS[nodeType] : [];
6526
+ }
6173
6527
  function getInputFieldSchema(nodeType) {
6174
6528
  return INPUT_FIELD_MAP[nodeType];
6175
6529
  }
@@ -6224,6 +6578,32 @@ function cleanOrphanedItems(items, nodeIds) {
6224
6578
  });
6225
6579
  }
6226
6580
 
6581
+ // src/picker-restrictions.ts
6582
+ var valuesOf = (v) => (Array.isArray(v) ? v : [v]).filter((x) => x !== void 0 && x !== null && x !== "").map(String);
6583
+ function findRestrictedPickerValue(input) {
6584
+ if (!input.cardMeta || !input.inputValues) return null;
6585
+ for (const node of input.nodes) {
6586
+ const meta = input.cardMeta[node.id];
6587
+ const submitted = input.inputValues[node.id];
6588
+ if (!meta || !submitted) continue;
6589
+ const rules = [];
6590
+ const rep = node.type ? INPUT_FIELD_MAP[node.type]?.key : void 0;
6591
+ if (rep && meta.pickerAllowedValues && meta.pickerAllowedValues.length > 0) rules.push([rep, meta.pickerAllowedValues]);
6592
+ for (const [field, allowed] of Object.entries(meta.pickerAllowedValuesByField ?? {})) {
6593
+ if (allowed.length > 0) rules.push([field, allowed]);
6594
+ }
6595
+ for (const [field, allowed] of rules) {
6596
+ for (const [key, raw] of Object.entries(submitted)) {
6597
+ if (canonicalExposedFieldKey(node.type, key) !== field) continue;
6598
+ for (const value of valuesOf(raw)) {
6599
+ if (!allowed.includes(value)) return `Invalid value for ${field}: ${value}. Allowed: ${allowed.join(", ")}`;
6600
+ }
6601
+ }
6602
+ }
6603
+ }
6604
+ return null;
6605
+ }
6606
+
6227
6607
  // src/clone-utils.ts
6228
6608
  var ITER_CLONE_PATTERN = /_iter_\d+$/;
6229
6609
  function isExpandedClone(node) {
@@ -6283,14 +6663,14 @@ function isCollectInEdge(e) {
6283
6663
  return (e.targetHandle ?? COLLECT_IN_HANDLE) === COLLECT_IN_HANDLE;
6284
6664
  }
6285
6665
  function computeAggregateLanes(nodeId, wiredTypes, buckets, edges) {
6286
- const present = new Set(wiredTypes);
6287
- for (const t2 of presentTypes(buckets)) present.add(t2);
6666
+ const present2 = new Set(wiredTypes);
6667
+ for (const t2 of presentTypes(buckets)) present2.add(t2);
6288
6668
  for (const e of edges) {
6289
6669
  if (e.source !== nodeId) continue;
6290
6670
  const lane = parseGroupHandle(e.sourceHandle);
6291
- if (lane) present.add(lane);
6671
+ if (lane) present2.add(lane);
6292
6672
  }
6293
- return AGGREGATEABLE_TYPES.filter((t2) => present.has(t2));
6673
+ return AGGREGATEABLE_TYPES.filter((t2) => present2.has(t2));
6294
6674
  }
6295
6675
 
6296
6676
  // src/llm-models.ts
@@ -7572,9 +7952,9 @@ function evalNode(node, input, ctx) {
7572
7952
  return input;
7573
7953
  }
7574
7954
  if (typeof input === "object" && input !== null) {
7575
- const arr = [input];
7576
- ctx.objectSourcedArrays.add(arr);
7577
- return arr;
7955
+ const arr2 = [input];
7956
+ ctx.objectSourcedArrays.add(arr2);
7957
+ return arr2;
7578
7958
  }
7579
7959
  throw new Error(`Cannot iterate over ${typeof input}`);
7580
7960
  }
@@ -7706,10 +8086,10 @@ function evalNode(node, input, ctx) {
7706
8086
  }
7707
8087
  }
7708
8088
  }
7709
- function markExpanded(arr, objectSourced, ctx) {
7710
- ctx.expandedArrays.add(arr);
7711
- if (objectSourced) ctx.objectSourcedArrays.add(arr);
7712
- return arr;
8089
+ function markExpanded(arr2, objectSourced, ctx) {
8090
+ ctx.expandedArrays.add(arr2);
8091
+ if (objectSourced) ctx.objectSourcedArrays.add(arr2);
8092
+ return arr2;
7713
8093
  }
7714
8094
  function isExpandedArray(node, val, ctx) {
7715
8095
  if (!Array.isArray(val)) return false;
@@ -7827,8 +8207,8 @@ function combineSameLabelRefs(candidates) {
7827
8207
  for (const c of candidates) {
7828
8208
  if (c.category < 0) continue;
7829
8209
  const key = canonicalVarName(c.label);
7830
- const arr = byLabel.get(key);
7831
- if (arr) arr.push(c);
8210
+ const arr2 = byLabel.get(key);
8211
+ if (arr2) arr2.push(c);
7832
8212
  else byLabel.set(key, [c]);
7833
8213
  }
7834
8214
  const combined = /* @__PURE__ */ new Map();
@@ -8635,6 +9015,8 @@ var NON_PROMPT_TEXT_LANES = {
8635
9015
  silence: ["edit-plan"],
8636
9016
  offsets: ["edit-plan"],
8637
9017
  qrText: ["image-overlay"],
9018
+ layerPlan: ["video-overlay"],
9019
+ captionPlan: ["add-captions"],
8638
9020
  transition: ["slideshow"],
8639
9021
  // Content Recipe's `link` carries the post's address (inputs.sourceLink), not
8640
9022
  // the material it analyzes — a list of links fanned through it must not be
@@ -8657,6 +9039,16 @@ function compactWithRows(aligned) {
8657
9039
  });
8658
9040
  return { items, rowIndices };
8659
9041
  }
9042
+ function pickHeldRow(rows, edge, iterating) {
9043
+ if (rows.length === 0) return { kind: "unaffected" };
9044
+ const mode = edge?.outputMode ?? "each";
9045
+ const held = (row) => isBlank(row) ? { kind: "none" } : { kind: "value", value: row };
9046
+ if (mode === "item") return held(rows[resolveIndex(edge?.itemIndex ?? "1", rows.length)]);
9047
+ if (mode.startsWith("item:")) return held(rows[parseInt(mode.slice(5), 10)]);
9048
+ if (mode !== "each" || iterating || isDefaultSelectorConfig(edge)) return { kind: "unaffected" };
9049
+ const kept = compactWithRows(selectListItems([...rows], edge)).items;
9050
+ return kept.length > 0 ? { kind: "value", value: kept[0] } : { kind: "none" };
9051
+ }
8660
9052
  function liveRowColumn(rows, colIndex) {
8661
9053
  return rows.filter((row) => row.some((cell) => !isBlank(cell))).map((row) => typeof row[colIndex] === "string" ? row[colIndex].trim() : "");
8662
9054
  }
@@ -8665,7 +9057,7 @@ function resolveListFanOut(candidates, nodeType) {
8665
9057
  const held = (c) => compactWithRows(c.aligned).items.length;
8666
9058
  const primary = candidates.reduce((best, c) => held(c) > held(best) ? c : best);
8667
9059
  const space = candidates.filter((c) => c.aligned.length === primary.aligned.length);
8668
- const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned);
9060
+ const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned, nodeType, c.targetHandle);
8669
9061
  const driver = feedsPrompt(primary) ? primary : space.find(feedsPrompt) ?? primary;
8670
9062
  const rowIndices = [];
8671
9063
  for (let row = 0; row < primary.aligned.length; row++) {
@@ -8678,11 +9070,21 @@ function resolveListFanOut(candidates, nodeType) {
8678
9070
  };
8679
9071
  }
8680
9072
  function isFanOutUrlItem(item) {
8681
- return item.startsWith("http") || /\.(png|jpg|jpeg|webp|gif|mp4|mov|webm|mp3|wav|ogg)(\?|$)/i.test(item);
9073
+ const s = item.trim();
9074
+ if (s.length === 0 || /\s/.test(s) || s.startsWith("{") || s.startsWith("[")) return false;
9075
+ return s.startsWith("http") || /\.(png|jpg|jpeg|webp|gif|mp4|mov|webm|mp3|wav|ogg)(\?|$)/i.test(s);
9076
+ }
9077
+ var URL_ITEM_IS_TEXT_LANES = {
9078
+ "collection-write": ["in"]
9079
+ };
9080
+ function fanOutUrlItemIsText(nodeType, targetHandle) {
9081
+ const lanes = URL_ITEM_IS_TEXT_LANES[nodeType ?? ""];
9082
+ return lanes !== void 0 && lanes.includes(targetHandle ?? "");
8682
9083
  }
8683
- function isTextList(aligned) {
9084
+ function isTextList(aligned, nodeType, targetHandle) {
8684
9085
  const first = aligned.find((v) => !isBlank(v));
8685
- return first !== void 0 && !isFanOutUrlItem(first);
9086
+ if (first === void 0) return false;
9087
+ return !isFanOutUrlItem(first) || fanOutUrlItemIsText(nodeType, targetHandle);
8686
9088
  }
8687
9089
  function planFanOut(fanOut, nodeType, nodeData) {
8688
9090
  const items = expandItemsWithRepeat(fanOut?.items, nodeType, nodeData);
@@ -9963,7 +10365,13 @@ var NODE_MAPPABLE_FIELDS = {
9963
10365
  "edit-video-pro": ["prompt"],
9964
10366
  "video-analysis": ["analysisFocus", "youtubeUrl"],
9965
10367
  "video-to-video": ["prompt"],
9966
- "text-to-speech": ["directText"],
10368
+ // + the two neighbour-text fields (continuity across clips): a wired Text node can feed
10369
+ // what is spoken before / after this clip, and {} injection works in them as in directText.
10370
+ "text-to-speech": ["directText", "previousText", "nextText"],
10371
+ // Save to Collection: the record's own fields, each mappable from an upstream
10372
+ // node or a {Ref}; the link field is `link` (node-data keys ending in url are
10373
+ // locked by the Copilot's deny-list).
10374
+ "collection-write": ["title", "text", "link", "dedupeKey"],
9967
10375
  "lip-sync": ["prompt"],
9968
10376
  "generate-music": ["prompt", "lyrics", "genre", "mood"],
9969
10377
  "text-to-audio": ["prompt"],
@@ -10185,6 +10593,136 @@ function nodeFeedsAnything(nodes, edges, nodeId) {
10185
10593
  return (buildFeedMaps(nodes, edges).children.get(nodeId) ?? []).length > 0;
10186
10594
  }
10187
10595
 
10596
+ // src/preview-gate.ts
10597
+ var PREVIEW_RENDER_NODE_TYPES = new Set(RENDER_NODE_TYPE_IDS);
10598
+ var PREVIEW_REVIEW_REQUIRED = "preview_review_required";
10599
+ var PREVIEW_RENDER_NESTED = "preview_render_nested";
10600
+ var NO_SAVED_RENDER_STAMPS = {
10601
+ output: () => void 0,
10602
+ batch: () => void 0
10603
+ };
10604
+ var SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
10605
+ var dataOf = (n) => n.data && typeof n.data === "object" ? n.data : {};
10606
+ var isPreviewStamp = (stamp) => stamp?.quality === "proxy";
10607
+ function rendersAsPreview(node) {
10608
+ return PREVIEW_RENDER_NODE_TYPES.has(node.type ?? "") && dataOf(node).quality === "proxy";
10609
+ }
10610
+ var TELEPORT_TYPES = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
10611
+ var isTeleport = (n) => TELEPORT_TYPES.has(n?.type ?? "");
10612
+ var outputModeOf = (edge) => {
10613
+ const mode = edge.data && typeof edge.data === "object" ? edge.data.outputMode : void 0;
10614
+ return typeof mode === "string" ? mode : void 0;
10615
+ };
10616
+ function readsEach(render, consumerEdge, renderHandle) {
10617
+ return (outputModeOf(consumerEdge) ?? defaultEdgeOutputMode(render.type, renderHandle)) === "each";
10618
+ }
10619
+ function savedPreviewConsumers(render, children, nodeById, edges, reader) {
10620
+ const data = dataOf(render);
10621
+ const scalarIsPreview = isPreviewStamp(reader.output(data));
10622
+ const batch = reader.batch(data);
10623
+ const eachIsPreview = batch ? batch.some(isPreviewStamp) : scalarIsPreview;
10624
+ const out = /* @__PURE__ */ new Set();
10625
+ const visited = /* @__PURE__ */ new Set([render.id]);
10626
+ const walk3 = (from, renderHandle, isRender) => {
10627
+ const wires = edges.filter((e) => e.source === from);
10628
+ for (const child of children.get(from) ?? []) {
10629
+ const wiresToChild = wires.filter((e) => e.target === child);
10630
+ if (isTeleport(nodeById.get(child))) {
10631
+ if (visited.has(child)) continue;
10632
+ visited.add(child);
10633
+ if (isRender && wiresToChild.length > 0) for (const w of wiresToChild) walk3(child, w.sourceHandle, false);
10634
+ else walk3(child, renderHandle, false);
10635
+ continue;
10636
+ }
10637
+ const preview = wiresToChild.length === 0 ? scalarIsPreview : wiresToChild.some(
10638
+ (e) => readsEach(render, e, isRender ? e.sourceHandle : renderHandle) ? eachIsPreview : scalarIsPreview
10639
+ );
10640
+ if (preview) out.add(child);
10641
+ }
10642
+ };
10643
+ walk3(render.id, void 0, true);
10644
+ return [...out];
10645
+ }
10646
+ function previewStops(nodes, edges, run = {}) {
10647
+ const nodeById = new Map(nodes.map((n) => [n.id, n]));
10648
+ const executes = run.executes ?? ((id) => {
10649
+ const n = nodeById.get(id);
10650
+ return !!n && dataOf(n).skipped !== true;
10651
+ });
10652
+ const reader = run.savedRenders ?? SAVED_RENDER_STAMPS;
10653
+ const { children } = buildFeedMaps(nodes, edges);
10654
+ const previewRenderIds = [];
10655
+ const savedPreviewRenderIds = [];
10656
+ const seeds = [];
10657
+ for (const n of nodes) {
10658
+ if (!PREVIEW_RENDER_NODE_TYPES.has(n.type ?? "")) continue;
10659
+ const kids = children.get(n.id) ?? [];
10660
+ if (executes(n.id)) {
10661
+ if (!rendersAsPreview(n)) continue;
10662
+ previewRenderIds.push(n.id);
10663
+ seeds.push(...kids);
10664
+ } else {
10665
+ const consumers = savedPreviewConsumers(n, children, nodeById, edges, reader);
10666
+ if (consumers.length === 0) continue;
10667
+ savedPreviewRenderIds.push(n.id);
10668
+ seeds.push(...consumers);
10669
+ }
10670
+ }
10671
+ const gated = /* @__PURE__ */ new Set();
10672
+ const queue = [...seeds];
10673
+ while (queue.length > 0) {
10674
+ const id = queue.shift();
10675
+ if (gated.has(id)) continue;
10676
+ gated.add(id);
10677
+ for (const next of children.get(id) ?? []) if (!gated.has(next)) queue.push(next);
10678
+ }
10679
+ return { previewRenderIds, savedPreviewRenderIds, gatedNodeIds: gated };
10680
+ }
10681
+ function previewGatedNodeIds(nodes, edges, run) {
10682
+ return new Set(previewStops(nodes, edges, run).gatedNodeIds);
10683
+ }
10684
+ function holdsPreviewRender(nodes, edges, run) {
10685
+ const stops = previewStops(nodes, edges, run);
10686
+ return stops.previewRenderIds.length > 0 || stops.savedPreviewRenderIds.length > 0;
10687
+ }
10688
+ var RUN_OVERRIDE_CLEARED_FIELDS = [
10689
+ "generatedResults",
10690
+ "activeResultIndex",
10691
+ "generatedImageUrl",
10692
+ "generatedVideoUrl",
10693
+ "generatedAudioUrl",
10694
+ "generatedText"
10695
+ ];
10696
+ function withRunOverrides(nodes, overrides) {
10697
+ if (!overrides) return [...nodes];
10698
+ return nodes.map((n) => {
10699
+ const fields = overrides[n.id];
10700
+ if (!fields) return n;
10701
+ const merged = mergeNodeInputOverrides(n.type ?? void 0, { ...dataOf(n) }, { ...fields });
10702
+ for (const key of RUN_OVERRIDE_CLEARED_FIELDS) delete merged[key];
10703
+ return { ...n, data: merged };
10704
+ });
10705
+ }
10706
+
10707
+ // src/run-continuation.ts
10708
+ var CONTINUATION_NOT_FOUND = "continuation_not_found";
10709
+ var CONTINUATION_WORKFLOW_MISMATCH = "continuation_workflow_mismatch";
10710
+ var CONTINUATION_VERSION_MISMATCH = "continuation_version_mismatch";
10711
+ var CONTINUATION_NOT_COMPLETED = "continuation_not_completed";
10712
+ var CONTINUATION_SUBSET_REQUIRED = "continuation_subset_required";
10713
+ var RUN_CONTINUATION_CODES = [
10714
+ CONTINUATION_NOT_FOUND,
10715
+ CONTINUATION_WORKFLOW_MISMATCH,
10716
+ CONTINUATION_VERSION_MISMATCH,
10717
+ CONTINUATION_NOT_COMPLETED,
10718
+ CONTINUATION_SUBSET_REQUIRED
10719
+ ];
10720
+
10721
+ // src/render-final.ts
10722
+ var RENDER_FINAL_NODE_NOT_FOUND = "render_final_node_not_found";
10723
+ var RENDER_FINAL_NOT_A_RENDER = "render_final_not_a_render";
10724
+ var RENDER_FINAL_CODES = [RENDER_FINAL_NODE_NOT_FOUND, RENDER_FINAL_NOT_A_RENDER];
10725
+
10188
10726
  // src/schedule-rules.ts
10189
10727
  var SCHEDULE_RULE_KINDS = ["minutes", "hours", "days", "weeks", "months", "cron"];
10190
10728
  var SCHEDULE_EVERY_LIMITS = {
@@ -10380,8 +10918,8 @@ function matchesCronField(field, value, min, max) {
10380
10918
  if (start === null || end === null) return false;
10381
10919
  return value >= start && value <= end;
10382
10920
  }
10383
- const num2 = parseInt(field, 10);
10384
- return !Number.isNaN(num2) && num2 === value;
10921
+ const num3 = parseInt(field, 10);
10922
+ return !Number.isNaN(num3) && num3 === value;
10385
10923
  }
10386
10924
  function parseRange(range) {
10387
10925
  const parts = range.split("-");
@@ -11090,6 +11628,225 @@ function normalizeSavedPostTags(tags) {
11090
11628
  return Array.from(new Set(clean2)).slice(0, SAVED_POST_MAX_TAGS);
11091
11629
  }
11092
11630
 
11631
+ // src/collections.ts
11632
+ var COLLECTION_NAME_MAX = 80;
11633
+ var COLLECTION_DESCRIPTION_MAX = 500;
11634
+ var COLLECTION_RECORD_TITLE_MAX = 500;
11635
+ var COLLECTION_RECORD_TEXT_MAX = 2e4;
11636
+ var COLLECTION_RECORD_URL_MAX = 2e3;
11637
+ var COLLECTION_RECORD_MEDIA_MAX = 20;
11638
+ var COLLECTION_RECORD_FIELDS_MAX = 50;
11639
+ var COLLECTION_RECORD_FIELDS_BYTES_MAX = 16 * 1024;
11640
+ var COLLECTION_DEDUPE_KEY_MAX = 300;
11641
+ var COLLECTION_IDEMPOTENCY_KEY_MAX = 200;
11642
+ var COLLECTIONS_PAGE_MAX = 100;
11643
+ var COLLECTIONS_PAGE_DEFAULT = 50;
11644
+ var COLLECTION_HEADLINE_MAX = 120;
11645
+ var COLLECTION_MEDIA_TYPES = ["image", "video", "audio", "link"];
11646
+ var COLLECTION_TIER_CAPS = {
11647
+ free: { collections: 3, records: 500 },
11648
+ payg: { collections: 10, records: 5e3 },
11649
+ basic: { collections: 10, records: 5e3 },
11650
+ standard: { collections: 30, records: 2e4 },
11651
+ pro: { collections: 100, records: 1e5 },
11652
+ business: { collections: 300, records: 25e4 },
11653
+ enterprise: { collections: 300, records: 25e4 }
11654
+ };
11655
+ function collectionCapsForTier(tier) {
11656
+ return tier ? COLLECTION_TIER_CAPS[tier] : void 0;
11657
+ }
11658
+ var COLLECTION_DIGEST_SEPARATOR = "\n\n---\n\n";
11659
+ var COLLECTION_READ_WINDOW_HOURS_MAX = 720;
11660
+ var COLLECTION_READ_LIMIT_MAX = 200;
11661
+ function collectionReadSince(amount, unit, now = Date.now()) {
11662
+ const hours = Math.min(COLLECTION_READ_WINDOW_HOURS_MAX, Math.max(1, Math.floor(Number.isFinite(amount) ? amount : 24)) * (unit === "days" ? 24 : 1));
11663
+ return new Date(now - hours * 36e5).toISOString();
11664
+ }
11665
+ var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
11666
+ var str2 = (v) => typeof v === "string" && v.trim().length > 0 ? v : void 0;
11667
+ var isScalar = (v) => typeof v === "string" || typeof v === "number" && Number.isFinite(v) || typeof v === "boolean";
11668
+ function isCollectionUrl(v) {
11669
+ return typeof v === "string" && /^https?:\/\/\S+$/i.test(v) && v.length <= COLLECTION_RECORD_URL_MAX;
11670
+ }
11671
+ var isHttpUrl = isCollectionUrl;
11672
+ function clampChars(text, max) {
11673
+ if (text.length <= max) return text;
11674
+ const points2 = Array.from(text);
11675
+ return points2.length <= max ? text : points2.slice(0, max).join("");
11676
+ }
11677
+ function fitCollectionField(key, value) {
11678
+ switch (key) {
11679
+ case "title":
11680
+ return clampChars(value, COLLECTION_RECORD_TITLE_MAX);
11681
+ case "text":
11682
+ return clampChars(value, COLLECTION_RECORD_TEXT_MAX);
11683
+ case "dedupeKey":
11684
+ return clampChars(value, COLLECTION_DEDUPE_KEY_MAX);
11685
+ case "link":
11686
+ return value.length <= COLLECTION_RECORD_URL_MAX ? value : void 0;
11687
+ }
11688
+ }
11689
+ function normalizeDedupeKey(raw) {
11690
+ if (typeof raw === "number" && Number.isFinite(raw)) raw = String(raw);
11691
+ if (typeof raw !== "string") return null;
11692
+ const compact = raw.trim().replace(/\s+/g, " ");
11693
+ const key = clampChars(looksLikeLink(compact) ? canonicalUrl(compact) : compact.toLowerCase(), COLLECTION_DEDUPE_KEY_MAX).trim();
11694
+ return key.length > 0 ? key : null;
11695
+ }
11696
+ var looksLikeLink = (s) => isCollectionUrl(s);
11697
+ var COLLECTION_EVICT_MAX_PER_WRITE = 100;
11698
+ function canonicalUrl(url) {
11699
+ try {
11700
+ return new URL(url).href;
11701
+ } catch {
11702
+ return url;
11703
+ }
11704
+ }
11705
+ function isCollectionMedia(v) {
11706
+ return isRecord2(v) && COLLECTION_MEDIA_TYPES.includes(v.type) && isHttpUrl(v.url) && (v.posterUrl === void 0 || v.posterUrl === null || isHttpUrl(v.posterUrl));
11707
+ }
11708
+ function normalizeCollectionMedia(value) {
11709
+ if (!Array.isArray(value)) return [];
11710
+ const seen = /* @__PURE__ */ new Set();
11711
+ const out = [];
11712
+ for (const item of value) {
11713
+ if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
11714
+ if (!isCollectionMedia(item) || seen.has(item.url)) continue;
11715
+ seen.add(item.url);
11716
+ out.push({ type: item.type, url: item.url, ...item.posterUrl ? { posterUrl: item.posterUrl } : {} });
11717
+ }
11718
+ return out;
11719
+ }
11720
+ function normalizeCollectionFields(value) {
11721
+ if (!isRecord2(value)) return {};
11722
+ const out = {};
11723
+ let bytes = 2;
11724
+ let count = 0;
11725
+ for (const [key, v] of Object.entries(value)) {
11726
+ if (count >= COLLECTION_RECORD_FIELDS_MAX) break;
11727
+ if (!isScalar(v) || key.length === 0 || key.length > 100) continue;
11728
+ const entry = JSON.stringify(key) + ":" + JSON.stringify(v) + ",";
11729
+ if (bytes + entry.length > COLLECTION_RECORD_FIELDS_BYTES_MAX) break;
11730
+ out[key] = v;
11731
+ bytes += entry.length;
11732
+ count += 1;
11733
+ }
11734
+ return out;
11735
+ }
11736
+ function collectionRecordHeadline(record) {
11737
+ const title = (typeof record.title === "string" ? record.title : "").trim();
11738
+ if (title) return clampChars(title, COLLECTION_HEADLINE_MAX);
11739
+ const line = (typeof record.text === "string" ? record.text : "").split(/\r?\n/).map((l) => l.trim()).find((l) => l.length > 0);
11740
+ if (line) return line.length > COLLECTION_HEADLINE_MAX ? `${clampChars(line, COLLECTION_HEADLINE_MAX - 1)}\u2026` : line;
11741
+ return typeof record.url === "string" ? record.url : "";
11742
+ }
11743
+ function collectionRecordsDigest(records, format = "headlines") {
11744
+ const rows = records.filter((r) => typeof r === "object" && r !== null);
11745
+ const str7 = (v) => typeof v === "string" ? v : "";
11746
+ if (format === "full") {
11747
+ return rows.map((r) => {
11748
+ const head = collectionRecordHeadline(r);
11749
+ const body = str7(r.text).trim();
11750
+ const lines = [head ? `### ${head}` : "", body && body !== head ? body : "", str7(r.url)].filter((l) => l.length > 0);
11751
+ return lines.join("\n");
11752
+ }).filter((block) => block.length > 0).join(COLLECTION_DIGEST_SEPARATOR);
11753
+ }
11754
+ return rows.map((r) => {
11755
+ const parts = [collectionRecordHeadline(r)];
11756
+ const created = str7(r.createdAt);
11757
+ if (created) parts.push(created.slice(0, 10));
11758
+ const url = str7(r.url);
11759
+ if (url && url !== parts[0]) parts.push(url);
11760
+ return `- ${parts.filter((p) => p.length > 0).join(" \xB7 ")}`;
11761
+ }).join("\n");
11762
+ }
11763
+ var TITLE_KEYS = ["title", "headline", "name", "subject"];
11764
+ var TEXT_KEYS = ["text", "body", "caption", "description", "content", "summary", "dek"];
11765
+ var URL_KEYS = ["url", "postUrl", "link", "href", "permalink"];
11766
+ var DEDUPE_KEYS = ["slug", "postId", "externalId", "id"];
11767
+ var isDedupeValue = (key, v) => key === "id" ? typeof v === "string" && v.trim().length > 0 && !/^\d+$/.test(v.trim()) : typeof v === "string" && v.trim().length > 0 || typeof v === "number" && Number.isFinite(v);
11768
+ var IMAGE_KEYS = ["imageUrl", "thumbnailUrl", "image", "thumbnail"];
11769
+ var VIDEO_KEYS = ["videoUrl", "video"];
11770
+ var AUDIO_KEYS = ["audioUrl", "audio"];
11771
+ var MEDIA_SHAPED_KEYS = /* @__PURE__ */ new Set(["media", ...IMAGE_KEYS, ...VIDEO_KEYS, ...AUDIO_KEYS]);
11772
+ function firstString(item, keys) {
11773
+ for (const key of keys) {
11774
+ const v = str2(item[key]);
11775
+ if (v !== void 0) return v;
11776
+ }
11777
+ return void 0;
11778
+ }
11779
+ function firstUrl(item, keys) {
11780
+ for (const key of keys) {
11781
+ const v = item[key];
11782
+ if (typeof v === "string" && isHttpUrl(v.trim())) return v.trim();
11783
+ }
11784
+ return null;
11785
+ }
11786
+ function mediaFromItem(item) {
11787
+ const seen = /* @__PURE__ */ new Set();
11788
+ const out = [];
11789
+ const push = (m) => {
11790
+ if (out.length >= COLLECTION_RECORD_MEDIA_MAX) return false;
11791
+ if (!seen.has(m.url)) {
11792
+ seen.add(m.url);
11793
+ out.push(m);
11794
+ }
11795
+ return true;
11796
+ };
11797
+ if (Array.isArray(item.media)) {
11798
+ for (const entry of item.media) {
11799
+ if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
11800
+ if (!isRecord2(entry)) continue;
11801
+ const type = entry.type === "photo" ? "image" : entry.type;
11802
+ const poster = isHttpUrl(entry.posterUrl) ? entry.posterUrl : void 0;
11803
+ if (type === "video" && !isHttpUrl(entry.url) && poster) {
11804
+ push({ type: "image", url: poster });
11805
+ continue;
11806
+ }
11807
+ if (isCollectionMedia({ ...entry, type })) push({ type, url: entry.url, ...poster ? { posterUrl: poster } : {} });
11808
+ }
11809
+ } else if (isRecord2(item.media)) {
11810
+ const m = item.media;
11811
+ if (isHttpUrl(m.videoUrl)) push({ type: "video", url: m.videoUrl, ...isHttpUrl(m.thumbnailUrl) ? { posterUrl: m.thumbnailUrl } : {} });
11812
+ else if (isHttpUrl(m.thumbnailUrl)) push({ type: "image", url: m.thumbnailUrl });
11813
+ }
11814
+ for (const key of IMAGE_KEYS) if (isHttpUrl(item[key]) && !push({ type: "image", url: item[key] })) break;
11815
+ for (const key of VIDEO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "video", url: item[key] })) break;
11816
+ for (const key of AUDIO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "audio", url: item[key] })) break;
11817
+ return out;
11818
+ }
11819
+ function ingestRecordFromJson(item) {
11820
+ if (!isRecord2(item)) {
11821
+ const text2 = typeof item === "string" ? item : item === void 0 || item === null ? "" : JSON.stringify(item);
11822
+ return { title: "", text: clampChars(text2, COLLECTION_RECORD_TEXT_MAX), url: null, media: [], fields: {}, dedupeKey: null };
11823
+ }
11824
+ const title = clampChars((firstString(item, TITLE_KEYS) ?? "").trim(), COLLECTION_RECORD_TITLE_MAX);
11825
+ const text = clampChars(firstString(item, TEXT_KEYS) ?? "", COLLECTION_RECORD_TEXT_MAX);
11826
+ const url = firstUrl(item, URL_KEYS);
11827
+ const media = mediaFromItem(item);
11828
+ const taken = /* @__PURE__ */ new Set([...TITLE_KEYS, ...TEXT_KEYS, ...URL_KEYS, ...MEDIA_SHAPED_KEYS]);
11829
+ const fields = {};
11830
+ let kept = 0;
11831
+ for (const [key, v] of Object.entries(item)) {
11832
+ if (kept >= COLLECTION_RECORD_FIELDS_MAX) break;
11833
+ if (taken.has(key)) continue;
11834
+ if (isScalar(v)) fields[key] = v;
11835
+ else if (isRecord2(v) && typeof v.name === "string" && v.name.trim()) fields[key] = v.name;
11836
+ else continue;
11837
+ kept += 1;
11838
+ }
11839
+ const dedupeSource = url ?? DEDUPE_KEYS.filter((k) => isDedupeValue(k, item[k])).map((k) => item[k])[0];
11840
+ return {
11841
+ title,
11842
+ text,
11843
+ url,
11844
+ media,
11845
+ fields: normalizeCollectionFields(fields),
11846
+ dedupeKey: normalizeDedupeKey(dedupeSource)
11847
+ };
11848
+ }
11849
+
11093
11850
  // src/competitors.ts
11094
11851
  var COMPETITOR_ACCOUNT_KEYS = ["tiktok", "instagram", "youtube", "x", "linkedin", "meta_ads"];
11095
11852
  var COMPETITOR_ABOUT_PLATFORMS = ["tiktok", "instagram", "youtube", "x", "reddit", "linkedin"];
@@ -12446,35 +13203,49 @@ function togglePick(current, id, maxSelected) {
12446
13203
  return [...current.slice(1), id];
12447
13204
  }
12448
13205
 
12449
- // src/tts-capabilities.ts
12450
- var TTS_PROVIDER_ALIASES = {
12451
- elevenlabs: "elevenlabs-turbo"
12452
- };
12453
- var TTS_FALLBACK_PROVIDER = "elevenlabs-turbo";
12454
- function canonicalTtsProvider(provider) {
12455
- return typeof provider === "string" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider] : provider;
13206
+ // src/tts-neighbour-text.ts
13207
+ var TTS_NEIGHBOUR_TEXT_MAX_CHARS = 1e3;
13208
+ function usableText(value) {
13209
+ if (typeof value !== "string") return void 0;
13210
+ const trimmed2 = value.trim();
13211
+ return trimmed2 ? trimmed2 : void 0;
12456
13212
  }
12457
- function findTtsCapabilities(provider) {
13213
+ function normalizeTtsNeighbourText(options) {
13214
+ const out = {};
13215
+ const previous = usableText(options?.previousText);
13216
+ if (previous !== void 0) {
13217
+ out.previousText = previous.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? previous.slice(-TTS_NEIGHBOUR_TEXT_MAX_CHARS) : previous;
13218
+ }
13219
+ const next = usableText(options?.nextText);
13220
+ if (next !== void 0) {
13221
+ out.nextText = next.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? next.slice(0, TTS_NEIGHBOUR_TEXT_MAX_CHARS) : next;
13222
+ }
13223
+ return out;
13224
+ }
13225
+
13226
+ // src/dialogue-capabilities.ts
13227
+ function findDialogueCapabilities(provider) {
12458
13228
  if (typeof provider !== "string" || !provider) return void 0;
12459
- const id = canonicalTtsProvider(provider);
12460
- if (!Object.hasOwn(MODEL_CATALOG, id)) return void 0;
12461
- const entry = MODEL_CATALOG[id];
12462
- return entry.modes.includes("tts") ? entry.tts : void 0;
13229
+ if (!Object.hasOwn(MODEL_CATALOG, provider)) return void 0;
13230
+ const entry = MODEL_CATALOG[provider];
13231
+ return entry.modes.includes("dialogue") ? entry.tts : void 0;
12463
13232
  }
12464
- function getTtsCapabilities(provider) {
12465
- return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
13233
+ function dialogueProviderOf(provider) {
13234
+ return findDialogueCapabilities(provider) ? provider : DEFAULT_DIALOGUE_PROVIDER;
12466
13235
  }
12467
- function ttsSupportsAudioTags(provider) {
12468
- return getTtsCapabilities(provider).audioTags;
13236
+ function getDialogueCapabilities(provider) {
13237
+ return MODEL_CATALOG[dialogueProviderOf(provider)].tts;
12469
13238
  }
12470
- function ttsSupportsSsmlBreaks(provider) {
12471
- return getTtsCapabilities(provider).ssmlBreaks;
13239
+ function dialogueHasLever(provider, lever) {
13240
+ return getDialogueCapabilities(provider).levers.includes(lever);
12472
13241
  }
12473
- function ttsHasLever(provider, lever) {
12474
- return getTtsCapabilities(provider).levers.includes(lever);
13242
+ function dialogueSupportsTimestamps(provider) {
13243
+ return getDialogueCapabilities(provider).timestamps;
12475
13244
  }
12476
- function ttsLanguageCodes(provider) {
12477
- return getTtsCapabilities(provider).languages;
13245
+ function dialogueStabilityAccepted(provider, value) {
13246
+ if (!Number.isFinite(value) || value < 0 || value > 1) return false;
13247
+ const steps = getDialogueCapabilities(provider).stabilitySteps;
13248
+ return steps ? steps.includes(value) : true;
12478
13249
  }
12479
13250
 
12480
13251
  // src/safety-retry-policy.ts
@@ -12582,42 +13353,199 @@ function resolveCaptionLevers(style, look, explicit, fontSize) {
12582
13353
  return resolveCaptionLook(effective, explicit, fontSize);
12583
13354
  }
12584
13355
 
12585
- // src/transcribe-preflight.ts
12586
- function transcribeWordTimestampsRefusal(provider) {
12587
- const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
12588
- if (transcribeLaneSupportsWordTimestamps(lane)) return null;
12589
- return `the "${lane}" engine does not return word timings \u2014 pick ${transcribeProvidersWithWordTimestamps().join(" or ")}`;
13356
+ // src/caption-plan.ts
13357
+ var nonNegative = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
13358
+ function parseCaptionPlan(raw) {
13359
+ let value = raw;
13360
+ if (typeof raw === "string") {
13361
+ try {
13362
+ value = JSON.parse(raw);
13363
+ } catch {
13364
+ return { error: "Caption plan: not valid JSON." };
13365
+ }
13366
+ }
13367
+ if (!value || typeof value !== "object" || Array.isArray(value)) return { error: "Caption plan: not an object." };
13368
+ const o = value;
13369
+ if (o.v !== 1) return { error: "Caption plan: v must be 1." };
13370
+ if (typeof o.hookText !== "string") return { error: "Caption plan: hookText must be text." };
13371
+ for (const f of ["hookEndMs", "bodyEndMs"]) {
13372
+ if (!nonNegative(o[f])) return { error: `Caption plan: ${f} must be a non-negative number.` };
13373
+ }
13374
+ if (o.videoDurationMs !== void 0 && !nonNegative(o.videoDurationMs)) {
13375
+ return { error: "Caption plan: videoDurationMs must be a non-negative number." };
13376
+ }
13377
+ if (o.language !== void 0 && typeof o.language !== "string") return { error: "Caption plan: language must be text." };
13378
+ if (!Array.isArray(o.captions)) return { error: "Caption plan: captions must be a list." };
13379
+ const captions = [];
13380
+ for (let i = 0; i < o.captions.length; i++) {
13381
+ const c = o.captions[i];
13382
+ if (!c || typeof c !== "object" || typeof c.text !== "string" || !nonNegative(c.startMs) || !nonNegative(c.endMs)) {
13383
+ return { error: `Caption plan: captions[${i}] needs text, startMs and endMs.` };
13384
+ }
13385
+ if (c.endMs < c.startMs) return { error: `Caption plan: captions[${i}] ends before it starts.` };
13386
+ captions.push({ text: c.text, startMs: c.startMs, endMs: c.endMs });
13387
+ }
13388
+ return {
13389
+ plan: {
13390
+ v: 1,
13391
+ hookText: o.hookText,
13392
+ hookEndMs: o.hookEndMs,
13393
+ bodyEndMs: o.bodyEndMs,
13394
+ captions,
13395
+ ...o.videoDurationMs !== void 0 ? { videoDurationMs: o.videoDurationMs } : {},
13396
+ ...o.language !== void 0 ? { language: o.language } : {}
13397
+ }
13398
+ };
12590
13399
  }
12591
- var TRANSCRIBE_JSON_OUT = "json";
12592
- var TRANSCRIPT_IN = "transcript";
12593
- var APPLY_EDL_JSON_OUT = "json";
12594
- function findWordlessTranscriptFeeds(nodes, edges) {
12595
- const byId = new Map(nodes.map((n) => [n.id, n]));
12596
- const isSkipped = (n) => !n || n.data?.skipped === true;
12597
- const out = [];
12598
- for (const node of nodes) {
12599
- if (node.type !== "transcribe" || isSkipped(node)) continue;
12600
- const provider = typeof node.data?.provider === "string" && node.data.provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
12601
- const refusal = transcribeWordTimestampsRefusal(provider);
12602
- if (!refusal) continue;
12603
- const seen = /* @__PURE__ */ new Set();
12604
- const frontier = [{ id: node.id, outHandle: TRANSCRIBE_JSON_OUT }];
12605
- while (frontier.length > 0) {
12606
- const { id, outHandle } = frontier.pop();
12607
- for (const e of edges) {
12608
- if (e.source !== id || (e.sourceHandle ?? null) !== outHandle || e.targetHandle !== TRANSCRIPT_IN) continue;
12609
- const target = byId.get(e.target);
12610
- if (isSkipped(target)) continue;
12611
- if (target.type === "add-captions") {
13400
+
13401
+ // src/supported-fonts.ts
13402
+ var SUPPORTED_FONT_NAMES = [
13403
+ "Inter",
13404
+ "Roboto",
13405
+ "Open Sans",
13406
+ "Montserrat",
13407
+ "Poppins",
13408
+ "Raleway",
13409
+ "Nunito",
13410
+ "Lato",
13411
+ "Playfair Display",
13412
+ "Merriweather",
13413
+ "Lora",
13414
+ "EB Garamond",
13415
+ "Bebas Neue",
13416
+ "Oswald",
13417
+ "Anton",
13418
+ "Dancing Script",
13419
+ "Pacifico",
13420
+ "Caveat",
13421
+ "Roboto Mono",
13422
+ "Fira Code",
13423
+ "Rubik",
13424
+ "Heebo",
13425
+ "Cairo",
13426
+ "Tajawal"
13427
+ ];
13428
+
13429
+ // src/caption-segment-schema.ts
13430
+ var captionFontWeightSchema = zod.z.number().int().min(100).max(900).multipleOf(100);
13431
+ var nonBlankCaptionText = zod.z.string().min(1).refine((t2) => /\S/.test(t2), { message: "text must contain a non-whitespace character" });
13432
+ var captionInputSchema = zod.z.object({
13433
+ text: zod.z.string(),
13434
+ // startMs/endMs are the visibility window and drive the highlight; timestampMs
13435
+ // is the word timestamp used by tiktok-words token timing; confidence is
13436
+ // metadata, ignored by rendering. timestampMs/confidence default to null.
13437
+ startMs: zod.z.number().min(0),
13438
+ endMs: zod.z.number().min(0),
13439
+ timestampMs: zod.z.number().min(0).nullable().default(null),
13440
+ confidence: zod.z.number().min(0).max(1).nullable().default(null)
13441
+ });
13442
+ var captionSegmentInputSchema = zod.z.object({
13443
+ startMs: zod.z.number().min(0),
13444
+ endMs: zod.z.number().min(0),
13445
+ style: zod.z.enum(ALL_CAPTION_STYLES).optional(),
13446
+ position: zod.z.enum(["bottom", "top", "center"]).optional(),
13447
+ fontSize: zod.z.number().min(12).max(200).optional(),
13448
+ color: zod.z.string().optional(),
13449
+ backgroundColor: zod.z.string().optional(),
13450
+ // A named look preset (outline/clean); explicit levers below override it.
13451
+ look: zod.z.enum(CAPTION_LOOK_IDS).optional(),
13452
+ fontFamily: zod.z.enum(SUPPORTED_FONT_NAMES).optional(),
13453
+ fontWeight: captionFontWeightSchema.optional(),
13454
+ strokeColor: zod.z.string().optional(),
13455
+ strokeWidth: zod.z.number().min(0).max(40).optional(),
13456
+ highlightColor: zod.z.string().optional(),
13457
+ uppercase: zod.z.boolean().optional(),
13458
+ positionY: zod.z.number().min(0).max(100).optional(),
13459
+ animate: zod.z.boolean().optional(),
13460
+ maxWordsPerLine: zod.z.number().int().min(CAPTION_MAX_WORDS_PER_LINE_MIN).max(CAPTION_MAX_WORDS_PER_LINE_MAX).optional(),
13461
+ text: nonBlankCaptionText.optional(),
13462
+ captions: zod.z.array(captionInputSchema).optional()
13463
+ }).refine((s) => s.endMs > s.startMs, { message: "segment endMs must be greater than startMs" });
13464
+ var CAPTION_SEGMENT_SCHEMA_KEYS = Object.keys(captionSegmentInputSchema.shape);
13465
+ function findSegmentOverlap(segments) {
13466
+ const sorted = [...segments].sort((a, b) => a.startMs - b.startMs);
13467
+ for (let i = 1; i < sorted.length; i++) {
13468
+ if (sorted[i].startMs < sorted[i - 1].endMs) {
13469
+ return `segments overlap: [${sorted[i - 1].startMs}, ${sorted[i - 1].endMs}) and [${sorted[i].startMs}, ${sorted[i].endMs})`;
13470
+ }
13471
+ }
13472
+ return null;
13473
+ }
13474
+
13475
+ // src/add-captions-plan.ts
13476
+ function captionPlanBodyLevers(nodeData, leverKeys) {
13477
+ const levers = {};
13478
+ for (const k of leverKeys) {
13479
+ const v = nodeData[k];
13480
+ if (v !== void 0 && v !== null) levers[k] = v;
13481
+ }
13482
+ return Object.keys(levers).length > 0 ? levers : void 0;
13483
+ }
13484
+ function styleCaptionPlan(raw, nodeData, styler) {
13485
+ const parsed = parseCaptionPlan(raw);
13486
+ if ("error" in parsed) return { error: parsed.error };
13487
+ const bodyLevers = captionPlanBodyLevers(nodeData, styler.leverKeys);
13488
+ const { segments } = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : void 0);
13489
+ for (let i = 0; i < segments.length; i++) {
13490
+ const r = captionSegmentInputSchema.safeParse(segments[i]);
13491
+ if (!r.success) return { error: `Caption plan: segment ${i + 1}: ${r.error.issues[0]?.message ?? "invalid"}.` };
13492
+ }
13493
+ const overlap = findSegmentOverlap(segments);
13494
+ if (overlap) return { error: `Caption plan: ${overlap}.` };
13495
+ return { segments };
13496
+ }
13497
+
13498
+ // src/node-pass-through.ts
13499
+ var present = (u) => typeof u === "string" && u.length > 0;
13500
+ function combineVideosPassThrough(videoUrls) {
13501
+ const urls = videoUrls.filter(present);
13502
+ return urls.length === 1 ? { videoUrl: urls[0], warning: "single_input" } : null;
13503
+ }
13504
+ function videoOverlayPassThrough(input) {
13505
+ if (!input.planWired || input.layerCount > 0 || !present(input.videoUrl)) return null;
13506
+ return { videoUrl: input.videoUrl, warning: "no_layers" };
13507
+ }
13508
+ function captionPlanPassThrough(input) {
13509
+ if (!input.planWired || input.segmentCount > 0 || !present(input.videoUrl)) return null;
13510
+ return { videoUrl: input.videoUrl, warning: "no_captions" };
13511
+ }
13512
+
13513
+ // src/transcribe-preflight.ts
13514
+ function transcribeWordTimestampsRefusal(provider) {
13515
+ const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
13516
+ if (transcribeLaneSupportsWordTimestamps(lane)) return null;
13517
+ return `the "${lane}" engine does not return word timings \u2014 pick ${transcribeProvidersWithWordTimestamps().join(" or ")}`;
13518
+ }
13519
+ var TRANSCRIBE_JSON_OUT = "json";
13520
+ var TRANSCRIPT_IN = "transcript";
13521
+ var RENDER_JSON_OUT = "json";
13522
+ function findWordlessTranscriptFeeds(nodes, edges) {
13523
+ const byId = new Map(nodes.map((n) => [n.id, n]));
13524
+ const isSkipped = (n) => !n || n.data?.skipped === true;
13525
+ const out = [];
13526
+ for (const node of nodes) {
13527
+ if (node.type !== "transcribe" || isSkipped(node)) continue;
13528
+ const provider = typeof node.data?.provider === "string" && node.data.provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
13529
+ const refusal = transcribeWordTimestampsRefusal(provider);
13530
+ if (!refusal) continue;
13531
+ const seen = /* @__PURE__ */ new Set();
13532
+ const frontier = [{ id: node.id, outHandle: TRANSCRIBE_JSON_OUT }];
13533
+ while (frontier.length > 0) {
13534
+ const { id, outHandle } = frontier.pop();
13535
+ for (const e of edges) {
13536
+ if (e.source !== id || (e.sourceHandle ?? null) !== outHandle || e.targetHandle !== TRANSCRIPT_IN) continue;
13537
+ const target = byId.get(e.target);
13538
+ if (isSkipped(target)) continue;
13539
+ if (target.type === "add-captions") {
12612
13540
  out.push({
12613
13541
  transcribeNodeId: node.id,
12614
13542
  consumerNodeId: target.id,
12615
13543
  provider,
12616
13544
  message: `Captions need word timings, but ${refusal}.`
12617
13545
  });
12618
- } else if (target.type === "apply-edl" && !seen.has(target.id)) {
13546
+ } else if (rendersTranscriptJson(target.type) && !seen.has(target.id)) {
12619
13547
  seen.add(target.id);
12620
- frontier.push({ id: target.id, outHandle: APPLY_EDL_JSON_OUT });
13548
+ frontier.push({ id: target.id, outHandle: RENDER_JSON_OUT });
12621
13549
  }
12622
13550
  }
12623
13551
  }
@@ -12782,9 +13710,16 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
12782
13710
  // Row-aligned twin of __listResults (Extract Field, List output) — read only
12783
13711
  // by the fan-out so two lists cut from one array pair by row.
12784
13712
  "__alignedListResults",
13713
+ // A render's fan-out row stamps, row-aligned with __listResults: each row's
13714
+ // take identity, and the clip every row was sent for (a failed row too).
13715
+ "__listResultStamps",
12785
13716
  // List fan-out window flag (abandon-guard exemption). Set/cleared by
12786
13717
  // executeNodeForList — purely execution-related, never user-edited.
12787
13718
  "__listRunning",
13719
+ // Why the last server run skipped this node (`empty_input`): a chip on the
13720
+ // card for the run that just ended, never a saved result — also in
13721
+ // TRANSIENT_RUNTIME_KEYS below.
13722
+ "__runSkipReason",
12788
13723
  // One token per paid run still out on this node that no executor mark
12789
13724
  // covers (the editor's `withRunInFlight`, around each paid call outside the
12790
13725
  // executors). Purely execution-related, never user-edited; also in
@@ -12851,6 +13786,12 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
12851
13786
  "searchResults",
12852
13787
  "pickedIds",
12853
13788
  "searchWarnings",
13789
+ // Save to Collection: how the last run ended for this node (inserted /
13790
+ // duplicate / replayed) and how many old records the cap evicted. RESULTS of
13791
+ // a run — Clear results wipes them, and a template, a preset or a run-only
13792
+ // patch never carries them as configuration.
13793
+ "lastOutcome",
13794
+ "lastEvicted",
12854
13795
  // When the editor's "Clear results" last emptied this node (ISO time). Not a
12855
13796
  // result and not config: bookkeeping that tells the load-time recovery lanes
12856
13797
  // "this node is empty ON PURPOSE" — without it, every reload reads an empty
@@ -12880,6 +13821,7 @@ var TRANSIENT_RUNTIME_KEYS = /* @__PURE__ */ new Set([
12880
13821
  "__listTotal",
12881
13822
  "__listCompleted",
12882
13823
  "__listRunning",
13824
+ "__runSkipReason",
12883
13825
  // A paid run still out, held by the editor tab that started it. Never
12884
13826
  // saved, so a reload, which has no such run, starts without one.
12885
13827
  "__runsInFlight",
@@ -15502,6 +16444,24 @@ function resolveAudioCrossfadeCurve(id) {
15502
16444
  return CURVES_BY_ID.get(id)?.ffmpeg ?? "tri";
15503
16445
  }
15504
16446
 
16447
+ // src/fan-out-meta.ts
16448
+ function fanOutItemMeta(output) {
16449
+ const w = output?.clipWarnings;
16450
+ const d = output?.durationSec;
16451
+ return {
16452
+ warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
16453
+ durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
16454
+ };
16455
+ }
16456
+ function clipNotesFrom(meta, single) {
16457
+ const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
16458
+ return rows.map((m, i) => ({
16459
+ clip: i + 1,
16460
+ warnings: m?.warnings ?? [],
16461
+ ...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
16462
+ }));
16463
+ }
16464
+
15505
16465
  // src/suno-track-sources.ts
15506
16466
  var SUNO_TRACK_SOURCE_TYPES = /* @__PURE__ */ new Set([
15507
16467
  "suno-generate",
@@ -15618,6 +16578,20 @@ function nodeStateMayCarryOutput(status) {
15618
16578
  return status !== void 0 && OUTPUT_BEARING_NODE_STATUSES.has(status);
15619
16579
  }
15620
16580
 
16581
+ // src/execution-outcome.ts
16582
+ var EMPTY_INPUT = "empty_input";
16583
+ function countEmptyInputSkips(nodeStates) {
16584
+ let count = 0;
16585
+ for (const state of Object.values(nodeStates ?? {})) {
16586
+ if (state && state.status === "skipped" && state.skipReason === EMPTY_INPUT) count += 1;
16587
+ }
16588
+ return count;
16589
+ }
16590
+ function executionOutcome(status, nodeStates) {
16591
+ if (status !== "completed") return void 0;
16592
+ return countEmptyInputSkips(nodeStates) > 0 ? "nothing_new" : "succeeded";
16593
+ }
16594
+
15621
16595
  // src/normalize-node-params.ts
15622
16596
  var MODEL_PARAM_NODE_TYPES = /* @__PURE__ */ new Set([
15623
16597
  "generate-image",
@@ -16342,6 +17316,10 @@ var ENUM_TARGETS = [
16342
17316
  [LIP_SYNC_PROVIDERS, "lip-sync"],
16343
17317
  [FACE_SWAP_PROVIDERS, "face-swap"],
16344
17318
  [TTS_PROVIDERS, "text-to-speech"],
17319
+ // A dialogue model's id is the node's `provider`: without this row the Models
17320
+ // tab would create a BARE dialogue node, which runs as the default (v3) whatever
17321
+ // the user picked.
17322
+ [DIALOGUE_PROVIDERS, "text-to-dialogue"],
16345
17323
  [TEXT_TO_AUDIO_PROVIDERS, "text-to-audio"],
16346
17324
  [TRANSCRIBE_PROVIDERS, "transcribe"],
16347
17325
  [MUSIC_PROVIDERS, "suno-generate"]
@@ -16465,34 +17443,6 @@ var AUDIO_FX_REVERB_PRESETS = /* @__PURE__ */ new Set([
16465
17443
  "outdoor"
16466
17444
  ]);
16467
17445
 
16468
- // src/supported-fonts.ts
16469
- var SUPPORTED_FONT_NAMES = [
16470
- "Inter",
16471
- "Roboto",
16472
- "Open Sans",
16473
- "Montserrat",
16474
- "Poppins",
16475
- "Raleway",
16476
- "Nunito",
16477
- "Lato",
16478
- "Playfair Display",
16479
- "Merriweather",
16480
- "Lora",
16481
- "EB Garamond",
16482
- "Bebas Neue",
16483
- "Oswald",
16484
- "Anton",
16485
- "Dancing Script",
16486
- "Pacifico",
16487
- "Caveat",
16488
- "Roboto Mono",
16489
- "Fira Code",
16490
- "Rubik",
16491
- "Heebo",
16492
- "Cairo",
16493
- "Tajawal"
16494
- ];
16495
-
16496
17446
  // src/image-overlay-shapes.ts
16497
17447
  var OVERLAY_SHAPES = [
16498
17448
  "rect",
@@ -16711,7 +17661,8 @@ var VIDEO_OVERLAY_ERROR_CODES = [
16711
17661
  "time_out_of_range",
16712
17662
  "end_before_start",
16713
17663
  "fit_without_aspect",
16714
- "field_out_of_bounds"
17664
+ "field_out_of_bounds",
17665
+ "invalid_layer_plan"
16715
17666
  ];
16716
17667
  var badge = (anchor, sx, sy) => ({
16717
17668
  anchor,
@@ -16781,13 +17732,13 @@ function sameShallow(a, b) {
16781
17732
  function expandVideoOverlayLayer(raw) {
16782
17733
  const obj = asLayer(raw);
16783
17734
  const layer = obj ? clean(obj) : {};
16784
- const present = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => layer[f] !== void 0);
17735
+ const present2 = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => layer[f] !== void 0);
16785
17736
  let out;
16786
17737
  if (isVideoOverlayPresetId(layer.preset)) {
16787
17738
  const box = videoOverlayPresetBox(layer.preset, layer.corner);
16788
17739
  out = { ...box, ...layer };
16789
- if (present.some((f) => layer[f] !== box[f])) delete out.preset;
16790
- } else if (present.length === 0) {
17740
+ if (present2.some((f) => layer[f] !== box[f])) delete out.preset;
17741
+ } else if (present2.length === 0) {
16791
17742
  out = { ...DEFAULT_VIDEO_OVERLAY_LAYER, ...videoOverlayPresetBox("corner-badge", layer.corner), ...layer };
16792
17743
  } else if (layer.anchor === void 0 || layer.width === void 0) {
16793
17744
  return raw;
@@ -16863,11 +17814,12 @@ function normalizeVideoOverlayNodes(nodes, edges) {
16863
17814
  });
16864
17815
  return changed ? out : nodes;
16865
17816
  }
17817
+ var PLAN_LAYER_Z_BASE = 1e3;
16866
17818
  var isSlot = (v) => typeof v === "number" && Number.isInteger(v) && v >= 1;
16867
17819
  var isIndex = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
16868
17820
  function videoOverlayRenderOrder(layers) {
16869
17821
  return layers.map((l, i) => {
16870
- const own = isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
17822
+ const own = isSlot(l?.planLayer) ? l.planLayer - 1 - PLAN_LAYER_Z_BASE : isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
16871
17823
  return { i, z: typeof l?.zIndex === "number" && Number.isFinite(l.zIndex) ? l.zIndex : own };
16872
17824
  }).sort((a, b) => a.z - b.z || a.i - b.i).map((e) => e.i);
16873
17825
  }
@@ -16943,6 +17895,7 @@ function hasDrawableVideoOverlayBox(layer) {
16943
17895
  return outOfBounds(l) === null;
16944
17896
  }
16945
17897
  function validateVideoOverlayRequest(body) {
17898
+ if (body.planError) return { ok: false, code: "invalid_layer_plan", params: {} };
16946
17899
  const layers = Array.isArray(body.layers) ? body.layers : [];
16947
17900
  if (layers.length === 0) return { ok: false, code: "no_layers", params: {} };
16948
17901
  if (layers.length > VIDEO_OVERLAY_MAX_LAYERS) {
@@ -16955,6 +17908,7 @@ function validateVideoOverlayRequest(body) {
16955
17908
  code,
16956
17909
  layer: i,
16957
17910
  ...typeof l.slot === "number" ? { slot: l.slot } : {},
17911
+ ...typeof l.planLayer === "number" ? { planLayer: l.planLayer } : {},
16958
17912
  params
16959
17913
  });
16960
17914
  const boxFields = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== void 0 && l[f] !== null);
@@ -16981,16 +17935,33 @@ var MESSAGES = {
16981
17935
  time_out_of_range: (p) => `${p.field} must be between 0 and ${p.max} s`,
16982
17936
  end_before_start: (p) => `end (${p.end} s) must be after start (${p.start} s)`,
16983
17937
  fit_without_aspect: () => "baseFit and backgroundColor need an outputAspect",
16984
- field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})`
17938
+ field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})`,
17939
+ invalid_layer_plan: () => "the layer plan must be a list of layers"
16985
17940
  };
17941
+ var PLAN_LAYER_WITHOUT_IMAGE = "no image \u2014 set imageUrl on this layer in the plan.";
16986
17942
  function videoOverlayLayerLabel(ref) {
17943
+ if (typeof ref.planLayer === "number") return `Plan layer ${ref.planLayer}`;
16987
17944
  return typeof ref.slot === "number" ? `Layer ${ref.slot}` : typeof ref.layer === "number" ? `layers[${ref.layer}]` : "";
16988
17945
  }
16989
17946
  function formatVideoOverlayError(issue2) {
16990
17947
  const label = videoOverlayLayerLabel(issue2);
16991
- const text = MESSAGES[issue2.code](issue2.params);
17948
+ const text = issue2.code === "layer_without_image" && typeof issue2.planLayer === "number" ? PLAN_LAYER_WITHOUT_IMAGE : MESSAGES[issue2.code](issue2.params);
16992
17949
  return label ? `${label}: ${text}` : text;
16993
17950
  }
17951
+ function parseVideoOverlayLayerPlan(raw) {
17952
+ let value = raw;
17953
+ if (typeof raw === "string") {
17954
+ try {
17955
+ value = JSON.parse(raw);
17956
+ } catch {
17957
+ return { error: "invalid_layer_plan" };
17958
+ }
17959
+ }
17960
+ if (!Array.isArray(value) || !value.every((l) => l !== null && typeof l === "object" && !Array.isArray(l))) {
17961
+ return { error: "invalid_layer_plan" };
17962
+ }
17963
+ return { layers: value };
17964
+ }
16994
17965
  function assembleVideoOverlayRequest(input) {
16995
17966
  const stored = Array.isArray(input.data.layers) ? input.data.layers : [];
16996
17967
  const wired = input.wiredImageUrls.slice(0, VIDEO_OVERLAY_HANDLE_IDS.length);
@@ -17007,13 +17978,19 @@ function assembleVideoOverlayRequest(input) {
17007
17978
  const outputAspect = isVideoOverlayOutputAspect(input.data.outputAspect) ? input.data.outputAspect : void 0;
17008
17979
  const baseFit = isFit(input.data.baseFit) ? input.data.baseFit : void 0;
17009
17980
  const backgroundColor = typeof input.data.backgroundColor === "string" && HEX6.test(input.data.backgroundColor) ? input.data.backgroundColor : void 0;
17010
- return {
17011
- videoUrl: input.videoUrl,
17012
- layers,
17981
+ const rest = {
17013
17982
  ...outputAspect ? { outputAspect } : {},
17014
17983
  ...baseFit ? { baseFit } : {},
17015
17984
  ...backgroundColor ? { backgroundColor } : {}
17016
17985
  };
17986
+ if (input.planLayers === void 0) return { videoUrl: input.videoUrl, layers, ...rest };
17987
+ const plan = parseVideoOverlayLayerPlan(input.planLayers);
17988
+ if ("error" in plan) return { videoUrl: input.videoUrl, layers, ...rest, planError: plan.error };
17989
+ const planned = expandVideoOverlayPresets(plan.layers).map((l, i) => {
17990
+ const { slot: _slot, ...own } = l;
17991
+ return { ...own, planLayer: i + 1 };
17992
+ });
17993
+ return { videoUrl: input.videoUrl, layers: [...planned, ...layers], ...rest };
17017
17994
  }
17018
17995
  function videoOverlaySlotSources(layers, wiredImageUrls) {
17019
17996
  const stored = Array.isArray(layers) ? layers : [];
@@ -17041,16 +18018,19 @@ var VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH = 65536;
17041
18018
  function videoOverlayCompositionKey(c) {
17042
18019
  const sources = c.sources.map((s) => typeof s === "string" && s.length > 0 ? s : null);
17043
18020
  while (sources.length > 0 && sources[sources.length - 1] === null) sources.pop();
17044
- return JSON.stringify(
17045
- canonicalValue([
17046
- c.baseUrl || null,
17047
- sources,
17048
- Array.isArray(c.data.layers) ? c.data.layers : [],
17049
- c.data.outputAspect ?? null,
17050
- c.data.baseFit ?? null,
17051
- c.data.backgroundColor ?? null
17052
- ])
17053
- );
18021
+ const parts = [
18022
+ c.baseUrl || null,
18023
+ sources,
18024
+ Array.isArray(c.data.layers) ? c.data.layers : [],
18025
+ c.data.outputAspect ?? null,
18026
+ c.data.baseFit ?? null,
18027
+ c.data.backgroundColor ?? null
18028
+ ];
18029
+ if (c.planLayers !== void 0) {
18030
+ const plan = parseVideoOverlayLayerPlan(c.planLayers);
18031
+ parts.push("error" in plan ? "invalid" : plan.layers);
18032
+ }
18033
+ return JSON.stringify(canonicalValue(parts));
17054
18034
  }
17055
18035
 
17056
18036
  // src/entity-image-handle.ts
@@ -19477,8 +20457,8 @@ function scene3DCameraTrackIssues(track) {
19477
20457
  }
19478
20458
  const quaternionTolerance = SCENE3D_CAMERA_TRACK_LIMITS.quaternionTolerance;
19479
20459
  track.samples.forEach((sample, index) => {
19480
- const [x, y, z25, w] = sample.quaternion;
19481
- const norm = Math.sqrt(x * x + y * y + z25 * z25 + w * w);
20460
+ const [x, y, z26, w] = sample.quaternion;
20461
+ const norm = Math.sqrt(x * x + y * y + z26 * z26 + w * w);
19482
20462
  if (Math.abs(norm - 1) > quaternionTolerance) {
19483
20463
  issues.push({
19484
20464
  path: ["samples", index, "quaternion"],
@@ -19891,7 +20871,7 @@ var STUDIO_KEYFRAME_TRANSIENT_KEYS = ["pendingImages"];
19891
20871
  var STUDIO_KEYFRAME_REVIEW_KEYS = ["rejections"];
19892
20872
  var STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS = ["waivedReason"];
19893
20873
  var STUDIO_KEYFRAME_PRIVATE_KEYS = [...STUDIO_KEYFRAME_TRANSIENT_KEYS, ...STUDIO_KEYFRAME_REVIEW_KEYS];
19894
- function isRecord2(value) {
20874
+ function isRecord3(value) {
19895
20875
  return !!value && typeof value === "object" && !Array.isArray(value);
19896
20876
  }
19897
20877
  function withoutKeys(source, drop) {
@@ -19918,9 +20898,9 @@ function stripPrevizRunState(value) {
19918
20898
  if (!Array.isArray(value)) return value;
19919
20899
  let changed = false;
19920
20900
  const out = value.map((entry) => {
19921
- if (!isRecord2(entry)) return entry;
20901
+ if (!isRecord3(entry)) return entry;
19922
20902
  const previz = entry.previsualization;
19923
- if (!isRecord2(previz) || !STUDIO_PREVIZ_RUN_STATE_KEYS.some((key) => key in previz)) return entry;
20903
+ if (!isRecord3(previz) || !STUDIO_PREVIZ_RUN_STATE_KEYS.some((key) => key in previz)) return entry;
19924
20904
  changed = true;
19925
20905
  return { ...entry, previsualization: withoutKeys(previz, STUDIO_PREVIZ_RUN_STATE_KEYS) };
19926
20906
  });
@@ -19944,8 +20924,8 @@ function stripStudioTakeVoiceRecords(nodes) {
19944
20924
  if (!Array.isArray(nodes)) return nodes;
19945
20925
  let changed = false;
19946
20926
  const out = nodes.map((node) => {
19947
- const data = isRecord2(node) ? node.data : void 0;
19948
- if (!isRecord2(data)) return node;
20927
+ const data = isRecord3(node) ? node.data : void 0;
20928
+ if (!isRecord3(data)) return node;
19949
20929
  const results = stripRows(data.generatedResults, STUDIO_TAKE_PRIVATE_KEYS);
19950
20930
  const unitResults = stripRows(data.sequenceUnitResults, STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS);
19951
20931
  const running = STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS.some((key) => key in data);
@@ -19962,7 +20942,7 @@ function stripRows(value, drop) {
19962
20942
  if (!Array.isArray(value)) return value;
19963
20943
  let changed = false;
19964
20944
  const out = value.map((row) => {
19965
- if (!isRecord2(row) || !drop.some((key) => key in row)) return row;
20945
+ if (!isRecord3(row) || !drop.some((key) => key in row)) return row;
19966
20946
  changed = true;
19967
20947
  return withoutKeys(row, drop);
19968
20948
  });
@@ -19973,7 +20953,7 @@ function stripLinkedOwnerState(studio) {
19973
20953
  const keyframes = stripKeyframes(studio.keyframes);
19974
20954
  const preferences = STUDIO_SEQUENCE_POLICY_KEYS.filter((key) => {
19975
20955
  const value = studio[key];
19976
- return isRecord2(value) && Object.keys(value).length > 0;
20956
+ return isRecord3(value) && Object.keys(value).length > 0;
19977
20957
  });
19978
20958
  if (!STUDIO_SEQUENCE_PLANNING_KEYS.some((key) => key in studio) && takes === studio.sequenceTakes && keyframes === studio.keyframes && preferences.length === 0) return studio;
19979
20959
  const kept = withoutKeys(studio, STUDIO_SEQUENCE_PLANNING_KEYS);
@@ -19986,10 +20966,10 @@ function stripTakeUnitReviews(value) {
19986
20966
  if (!Array.isArray(value)) return value;
19987
20967
  let changed = false;
19988
20968
  const out = value.map((take) => {
19989
- if (!isRecord2(take) || !Array.isArray(take.units)) return take;
20969
+ if (!isRecord3(take) || !Array.isArray(take.units)) return take;
19990
20970
  let touched = false;
19991
20971
  const units = take.units.map((unit) => {
19992
- if (!isRecord2(unit) || !STUDIO_SEQUENCE_UNIT_REVIEW_KEYS.some((key) => key in unit)) return unit;
20972
+ if (!isRecord3(unit) || !STUDIO_SEQUENCE_UNIT_REVIEW_KEYS.some((key) => key in unit)) return unit;
19993
20973
  touched = true;
19994
20974
  return withoutKeys(unit, STUDIO_SEQUENCE_UNIT_REVIEW_KEYS);
19995
20975
  });
@@ -20003,7 +20983,7 @@ function stripKeyframes(value) {
20003
20983
  if (!Array.isArray(value)) return value;
20004
20984
  let changed = false;
20005
20985
  const out = value.map((frame) => {
20006
- if (!isRecord2(frame)) return frame;
20986
+ if (!isRecord3(frame)) return frame;
20007
20987
  const kept = keyframeForReader(frame, STUDIO_KEYFRAME_REVIEW_KEYS);
20008
20988
  if (kept !== frame) changed = true;
20009
20989
  return kept;
@@ -20012,7 +20992,7 @@ function stripKeyframes(value) {
20012
20992
  }
20013
20993
  function keyframeForReader(frame, drop) {
20014
20994
  const acceptance = frame.acceptance;
20015
- const waived = isRecord2(acceptance) && STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS.some((key) => key in acceptance);
20995
+ const waived = isRecord3(acceptance) && STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS.some((key) => key in acceptance);
20016
20996
  if (!waived && !drop.some((key) => key in frame)) return frame;
20017
20997
  const kept = withoutKeys(frame, drop);
20018
20998
  if (waived) kept.acceptance = withoutKeys(acceptance, STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS);
@@ -20021,7 +21001,7 @@ function keyframeForReader(frame, drop) {
20021
21001
  function stripStudioDraftSettings(settings) {
20022
21002
  if (!settings || typeof settings !== "object") return settings;
20023
21003
  const studio = settings.studio;
20024
- if (!isRecord2(studio)) return settings;
21004
+ if (!isRecord3(studio)) return settings;
20025
21005
  const shots = stripShots(studio.shots, STUDIO_SHOT_PRIVATE_KEYS);
20026
21006
  const trash = stripBin(studio.trash);
20027
21007
  const planned = stripLinkedOwnerState(studio);
@@ -20036,11 +21016,11 @@ function stripBin(trash) {
20036
21016
  let changed = false;
20037
21017
  const out = [];
20038
21018
  for (const entry of trash) {
20039
- if (isRecord2(entry) && entry.kind === "slot") {
21019
+ if (isRecord3(entry) && entry.kind === "slot") {
20040
21020
  changed = true;
20041
21021
  continue;
20042
21022
  }
20043
- const kept = !isRecord2(entry) ? entry : entry.kind === "shot" ? binSceneForReader(entry) : entry.kind === "keyframe" ? binKeyframeForReader(entry) : binTakeForReader(entry);
21023
+ const kept = !isRecord3(entry) ? entry : entry.kind === "shot" ? binSceneForReader(entry) : entry.kind === "keyframe" ? binKeyframeForReader(entry) : binTakeForReader(entry);
20044
21024
  if (kept !== entry) changed = true;
20045
21025
  out.push(kept);
20046
21026
  }
@@ -20048,7 +21028,7 @@ function stripBin(trash) {
20048
21028
  }
20049
21029
  function binSceneForReader(entry) {
20050
21030
  const graph = entry.graph;
20051
- if (!isRecord2(graph)) return entry;
21031
+ if (!isRecord3(graph)) return entry;
20052
21032
  const nodes = stripStudioTakeVoiceRecords(graph.nodes);
20053
21033
  const settings = stripStudioDraftSettings(graph.settings);
20054
21034
  if (nodes === graph.nodes && settings === graph.settings) return entry;
@@ -20056,12 +21036,12 @@ function binSceneForReader(entry) {
20056
21036
  }
20057
21037
  function binTakeForReader(entry) {
20058
21038
  const result = entry.result;
20059
- if (!isRecord2(result) || !STUDIO_TAKE_PRIVATE_KEYS.some((key) => key in result)) return entry;
21039
+ if (!isRecord3(result) || !STUDIO_TAKE_PRIVATE_KEYS.some((key) => key in result)) return entry;
20060
21040
  return { ...entry, result: withoutKeys(result, STUDIO_TAKE_PRIVATE_KEYS) };
20061
21041
  }
20062
21042
  function binKeyframeForReader(entry) {
20063
21043
  const keyframe = entry.keyframe;
20064
- if (!isRecord2(keyframe)) return entry;
21044
+ if (!isRecord3(keyframe)) return entry;
20065
21045
  const kept = keyframeForReader(keyframe, STUDIO_KEYFRAME_PRIVATE_KEYS);
20066
21046
  return kept === keyframe ? entry : { ...entry, keyframe: kept };
20067
21047
  }
@@ -20830,6 +21810,9 @@ function edlDurationMs(edl) {
20830
21810
  const last = edl.segments[edl.segments.length - 1];
20831
21811
  return Math.max(0, Math.round(starts[starts.length - 1] + Math.max(0, last.outMs - last.inMs)));
20832
21812
  }
21813
+ function edlSegmentOutputStarts(edl) {
21814
+ return segmentOutputStarts(edl);
21815
+ }
20833
21816
  function segmentOutputStarts(edl) {
20834
21817
  const starts = [];
20835
21818
  let cursor = 0;
@@ -20960,6 +21943,16 @@ function remapMsThroughEdl(edl, sourceMs, sourceId) {
20960
21943
  }
20961
21944
  return null;
20962
21945
  }
21946
+ function outputMsToMasterMs(edl, outputMs) {
21947
+ if (!Number.isFinite(outputMs) || outputMs < 0) return null;
21948
+ const starts = segmentOutputStarts(edl);
21949
+ for (let i = edl.segments.length - 1; i >= 0; i--) {
21950
+ const seg = edl.segments[i];
21951
+ const dur = Math.max(0, seg.outMs - seg.inMs);
21952
+ if (outputMs >= starts[i] && outputMs < starts[i] + dur) return Math.round(seg.inMs + (outputMs - starts[i]));
21953
+ }
21954
+ return null;
21955
+ }
20963
21956
  function remapTranscriptThroughEdl(edl, transcript) {
20964
21957
  const off = offsetFor(edl, transcript.sourceId);
20965
21958
  const starts = segmentOutputStarts(edl);
@@ -21032,7 +22025,7 @@ function speakerTurns(transcript, opts) {
21032
22025
  }
21033
22026
  var num = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
21034
22027
  var clamp012 = (v) => Math.min(1, Math.max(0, v));
21035
- var str2 = (v) => typeof v === "string" ? v : void 0;
22028
+ var str3 = (v) => typeof v === "string" ? v : void 0;
21036
22029
  function normalizeRegion(r) {
21037
22030
  if (!r || typeof r !== "object") return void 0;
21038
22031
  const o = r;
@@ -21049,11 +22042,11 @@ function normalizeEdl(input) {
21049
22042
  const sources = Array.isArray(o.sources) ? o.sources.map((raw, i) => {
21050
22043
  const s = raw ?? {};
21051
22044
  const src = {
21052
- id: str2(s.id) ?? `src-${i}`,
21053
- url: str2(s.url) ?? "",
22045
+ id: str3(s.id) ?? `src-${i}`,
22046
+ url: str3(s.url) ?? "",
21054
22047
  kind: s.kind === "audio" ? "audio" : "video",
21055
22048
  ...s.offsetMs !== void 0 ? { offsetMs: Math.round(num(s.offsetMs)) } : {},
21056
- ...str2(s.role) ? { role: s.role } : {},
22049
+ ...str3(s.role) ? { role: s.role } : {},
21057
22050
  ...Array.isArray(s.speakers) ? { speakers: s.speakers.filter((x) => typeof x === "string") } : {},
21058
22051
  ...normalizeRegion(s.region) ? { region: normalizeRegion(s.region) } : {}
21059
22052
  };
@@ -21066,12 +22059,12 @@ function normalizeEdl(input) {
21066
22059
  const t2 = isFirst ? void 0 : s.transition;
21067
22060
  const layout = normalizeLayout(s.layout, isFirst);
21068
22061
  const seg = {
21069
- id: str2(s.id) ?? `seg-${i}`,
22062
+ id: str3(s.id) ?? `seg-${i}`,
21070
22063
  inMs: Math.round(num(s.inMs)),
21071
22064
  outMs: Math.round(num(s.outMs)),
21072
- ...str2(s.video) ? { video: str2(s.video) } : {},
21073
- ...str2(s.audio) ? { audio: str2(s.audio) } : {},
21074
- ...str2(s.speaker) ? { speaker: str2(s.speaker) } : {},
22065
+ ...str3(s.video) ? { video: str3(s.video) } : {},
22066
+ ...str3(s.audio) ? { audio: str3(s.audio) } : {},
22067
+ ...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
21075
22068
  ...t2 && (t2.type === "cut" || t2.type === "crossfade") ? { transition: { type: t2.type, durationMs: t2.type === "cut" ? 0 : Math.round(num(t2.durationMs)) } } : {},
21076
22069
  ...region ? { region } : {},
21077
22070
  ...layout ? { layout } : {},
@@ -21081,7 +22074,7 @@ function normalizeEdl(input) {
21081
22074
  }) : [];
21082
22075
  const dropped = Array.isArray(o.dropped) ? o.dropped.map((raw) => {
21083
22076
  const d = raw ?? {};
21084
- return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason: str2(d.reason) ?? "manual" };
22077
+ return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason: str3(d.reason) ?? "manual" };
21085
22078
  }) : void 0;
21086
22079
  const meta = o.meta && typeof o.meta === "object" ? o.meta : void 0;
21087
22080
  return {
@@ -21090,28 +22083,28 @@ function normalizeEdl(input) {
21090
22083
  sources,
21091
22084
  segments,
21092
22085
  ...dropped ? { dropped } : {},
21093
- ...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId: str2(o.derivedFrom.edlId) ?? "", clock: "output" } } : {},
22086
+ ...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId: str3(o.derivedFrom.edlId) ?? "", clock: "output" } } : {},
21094
22087
  ...meta ? { meta } : {}
21095
22088
  };
21096
22089
  }
21097
22090
  function normalizeLayout(input, dropTransition = false) {
21098
22091
  if (!input || typeof input !== "object") return void 0;
21099
22092
  const o = input;
21100
- const mode = str2(o.mode) || "single";
22093
+ const mode = str3(o.mode) || "single";
21101
22094
  const slots = Array.isArray(o.slots) ? o.slots.map((raw) => {
21102
22095
  const s = raw ?? {};
21103
- const source = str2(s.source);
22096
+ const source = str3(s.source);
21104
22097
  if (!source) return null;
21105
22098
  const region = normalizeRegion(s.region);
21106
22099
  return {
21107
22100
  source,
21108
22101
  ...region ? { region } : {},
21109
- ...str2(s.speaker) ? { speaker: str2(s.speaker) } : {},
22102
+ ...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
21110
22103
  ...s.weight !== void 0 ? { weight: clamp012(num(s.weight)) } : {}
21111
22104
  };
21112
22105
  }).filter((x) => x !== null) : void 0;
21113
- const emphasis = o.emphasis && typeof o.emphasis === "object" ? { style: str2(o.emphasis.style) ?? "none", durationMs: Math.round(num(o.emphasis.durationMs)) } : void 0;
21114
- const transition = !dropTransition && o.transition && typeof o.transition === "object" ? { type: str2(o.transition.type) ?? "cut", durationMs: Math.round(num(o.transition.durationMs)) } : void 0;
22106
+ const emphasis = o.emphasis && typeof o.emphasis === "object" ? { style: str3(o.emphasis.style) ?? "none", durationMs: Math.round(num(o.emphasis.durationMs)) } : void 0;
22107
+ const transition = !dropTransition && o.transition && typeof o.transition === "object" ? { type: str3(o.transition.type) ?? "cut", durationMs: Math.round(num(o.transition.durationMs)) } : void 0;
21115
22108
  return {
21116
22109
  mode,
21117
22110
  ...slots ? { slots } : {},
@@ -21125,29 +22118,372 @@ function normalizeTranscript(input) {
21125
22118
  const w = raw ?? {};
21126
22119
  const startMs = Math.round(num(w.startMs));
21127
22120
  return {
21128
- text: str2(w.text) ?? "",
22121
+ text: str3(w.text) ?? "",
21129
22122
  startMs,
21130
22123
  // Never inverted: an endMs < startMs (garbage upstream) would be
21131
22124
  // silently dropped at remap; clamp it to a non-negative width.
21132
22125
  endMs: Math.max(startMs, Math.round(num(w.endMs))),
21133
- ...str2(w.speaker) ? { speaker: str2(w.speaker) } : {},
22126
+ ...str3(w.speaker) ? { speaker: str3(w.speaker) } : {},
21134
22127
  ...typeof w.confidence === "number" ? { confidence: w.confidence } : {}
21135
22128
  };
21136
22129
  }) : [];
21137
22130
  const segments = Array.isArray(o.segments) ? o.segments.map((raw) => {
21138
22131
  const s = raw ?? {};
21139
22132
  const startMs = Math.round(num(s.startMs));
21140
- return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text: str2(s.text) ?? "", ...str2(s.speaker) ? { speaker: str2(s.speaker) } : {} };
22133
+ return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text: str3(s.text) ?? "", ...str3(s.speaker) ? { speaker: str3(s.speaker) } : {} };
21141
22134
  }) : void 0;
21142
22135
  return {
21143
22136
  version: EDL_VERSION,
21144
- ...str2(o.sourceId) ? { sourceId: str2(o.sourceId) } : {},
21145
- ...str2(o.language) ? { language: str2(o.language) } : {},
22137
+ ...str3(o.sourceId) ? { sourceId: str3(o.sourceId) } : {},
22138
+ ...str3(o.language) ? { language: str3(o.language) } : {},
21146
22139
  words,
21147
22140
  ...segments ? { segments } : {}
21148
22141
  };
21149
22142
  }
21150
22143
 
22144
+ // src/speaker-tracks.ts
22145
+ var SPEAKER_TRACKS_VERSION = 1;
22146
+ var SPEAKER_TRACK_ATTRIBUTION_METHODS = ["source-map", "region", "mouth-motion", "manual"];
22147
+ var KNOWN_METHODS = new Set(SPEAKER_TRACK_ATTRIBUTION_METHODS);
22148
+ var SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE = 1e5;
22149
+ var SPEAKER_TRACKS_MAX_BYTES = 64 * 1024 * 1024;
22150
+ var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
22151
+ var isNum = (v) => typeof v === "number" && Number.isFinite(v);
22152
+ var num2 = (v, fallback = 0) => isNum(v) ? v : fallback;
22153
+ var str4 = (v) => typeof v === "string" ? v : void 0;
22154
+ var clamp013 = (v) => Math.min(1, Math.max(0, v));
22155
+ var arr = (v) => Array.isArray(v) ? v : [];
22156
+ var int2 = (v) => {
22157
+ const r = Math.round(v);
22158
+ return r === 0 ? 0 : r;
22159
+ };
22160
+ function cropAxis(p, s) {
22161
+ if (!(s > 0)) return void 0;
22162
+ if (p >= 0 && p + s <= 1) return [p, s];
22163
+ const lo = clamp013(p);
22164
+ const hi = clamp013(p + s);
22165
+ return hi > lo ? [lo, hi - lo] : void 0;
22166
+ }
22167
+ function normalizeBox(raw) {
22168
+ if (!isObj(raw)) return void 0;
22169
+ if (![raw.ms, raw.x, raw.y, raw.w, raw.h].every(isNum)) return void 0;
22170
+ const xs = cropAxis(raw.x, raw.w);
22171
+ const ys = cropAxis(raw.y, raw.h);
22172
+ if (!xs || !ys) return void 0;
22173
+ const [x, w] = xs;
22174
+ const [y, h] = ys;
22175
+ return { ms: int2(raw.ms), x, y, w, h, ...isNum(raw.score) ? { score: clamp013(raw.score) } : {} };
22176
+ }
22177
+ function normalizeSpans(raw) {
22178
+ if (!Array.isArray(raw)) return [];
22179
+ const spans = raw.filter(isObj).filter((s) => isNum(s.startMs) && isNum(s.endMs)).map((s) => ({ startMs: int2(s.startMs), endMs: int2(s.endMs) })).filter((s) => s.endMs > s.startMs).sort((a, b) => a.startMs - b.startMs || a.endMs - b.endMs);
22180
+ const merged = [];
22181
+ for (const s of spans) {
22182
+ const last = merged[merged.length - 1];
22183
+ if (last && s.startMs <= last.endMs) merged[merged.length - 1] = { startMs: last.startMs, endMs: Math.max(last.endMs, s.endMs) };
22184
+ else merged.push(s);
22185
+ }
22186
+ return merged;
22187
+ }
22188
+ function normalizeCuts(raw) {
22189
+ if (!Array.isArray(raw)) return [];
22190
+ const sorted = raw.filter(isNum).map(int2).sort((a, b) => a - b);
22191
+ return sorted.filter((c, i) => i === 0 || c !== sorted[i - 1]);
22192
+ }
22193
+ function normalizeAttribution(raw) {
22194
+ if (!isObj(raw)) return void 0;
22195
+ const method = str4(raw.method);
22196
+ if (!method) return void 0;
22197
+ const rawSpeaker = str4(raw.rawSpeaker);
22198
+ return { method, confidence: clamp013(num2(raw.confidence)), ...rawSpeaker ? { rawSpeaker } : {} };
22199
+ }
22200
+ function normalizeHeader(raw, fallbackId) {
22201
+ const speaker = str4(raw.speaker);
22202
+ const attribution = normalizeAttribution(raw.attribution);
22203
+ return {
22204
+ id: str4(raw.id) || fallbackId,
22205
+ ...speaker ? { speaker } : {},
22206
+ ...attribution ? { attribution } : {}
22207
+ };
22208
+ }
22209
+ function normalizeSetFields(o) {
22210
+ const detector = isObj(o.detector) ? o.detector : {};
22211
+ const detectorVersion = str4(detector.version);
22212
+ return {
22213
+ // Only an ABSENT version defaults to 1. Any present value — another
22214
+ // number, "2", null — is kept as is so validate refuses it rather than
22215
+ // reading a newer (or broken) body as this one.
22216
+ version: o.version === void 0 ? SPEAKER_TRACKS_VERSION : o.version,
22217
+ sampleFps: num2(o.sampleFps),
22218
+ detector: { id: str4(detector.id) ?? "", ...detectorVersion ? { version: detectorVersion } : {} }
22219
+ };
22220
+ }
22221
+ function normalizeSources(raw, track) {
22222
+ if (!Array.isArray(raw)) return [];
22223
+ return raw.map((r) => {
22224
+ const s = isObj(r) ? r : {};
22225
+ const sourceId = str4(s.sourceId) ?? "";
22226
+ const frame = isObj(s.frame) ? s.frame : {};
22227
+ const cuts = normalizeCuts(s.cuts);
22228
+ const tracks = Array.isArray(s.tracks) ? s.tracks.map((t2, k) => track(isObj(t2) ? t2 : {}, `${sourceId}/t${k + 1}`)) : [];
22229
+ return {
22230
+ sourceId,
22231
+ // A clock other than "source" cannot be repaired: boxes on another clock
22232
+ // would land offsetMs away from their frame. Keep it for validate to refuse.
22233
+ clock: typeof s.clock === "string" ? s.clock : "source",
22234
+ frame: { w: int2(num2(frame.w)), h: int2(num2(frame.h)) },
22235
+ sampledSpans: normalizeSpans(s.sampledSpans),
22236
+ tracks,
22237
+ ...cuts.length > 0 ? { cuts } : {}
22238
+ };
22239
+ });
22240
+ }
22241
+ function normalizeSpeakerTracks(input) {
22242
+ const o = isObj(input) ? input : {};
22243
+ return {
22244
+ ...normalizeSetFields(o),
22245
+ sources: normalizeSources(o.sources, (t2, fallbackId) => {
22246
+ const boxes = Array.isArray(t2.boxes) ? t2.boxes.map(normalizeBox).filter((b) => b !== void 0) : [];
22247
+ return { ...normalizeHeader(t2, fallbackId), boxes: [...boxes].sort((a, b) => a.ms - b.ms) };
22248
+ })
22249
+ };
22250
+ }
22251
+ function normalizeSpeakerTrackSetDescriptor(input) {
22252
+ const o = isObj(input) ? input : {};
22253
+ return {
22254
+ ...normalizeSetFields(o),
22255
+ sources: normalizeSources(o.sources, (t2, fallbackId) => ({
22256
+ ...normalizeHeader(t2, fallbackId),
22257
+ boxCount: Math.max(0, int2(num2(t2.boxCount)))
22258
+ })),
22259
+ url: str4(o.url) ?? "",
22260
+ sha256: str4(o.sha256) ?? "",
22261
+ bytes: int2(num2(o.bytes))
22262
+ };
22263
+ }
22264
+ function describeSpeakerTracks(set, artifact) {
22265
+ return {
22266
+ version: set.version,
22267
+ sampleFps: set.sampleFps,
22268
+ detector: { ...set.detector },
22269
+ sources: set.sources.map((s) => ({
22270
+ sourceId: s.sourceId,
22271
+ clock: s.clock,
22272
+ frame: { ...s.frame },
22273
+ sampledSpans: s.sampledSpans.map((sp) => ({ ...sp })),
22274
+ tracks: s.tracks.map((t2) => ({
22275
+ id: t2.id,
22276
+ ...t2.speaker !== void 0 ? { speaker: t2.speaker } : {},
22277
+ ...t2.attribution ? { attribution: { ...t2.attribution } } : {},
22278
+ boxCount: t2.boxes.length
22279
+ })),
22280
+ ...s.cuts && s.cuts.length > 0 ? { cuts: [...s.cuts] } : {}
22281
+ })),
22282
+ url: artifact.url,
22283
+ sha256: artifact.sha256,
22284
+ bytes: artifact.bytes
22285
+ };
22286
+ }
22287
+ function edlSpeakerSpace(edl) {
22288
+ const out = /* @__PURE__ */ new Set();
22289
+ const add = (v) => {
22290
+ if (typeof v === "string" && v) out.add(v);
22291
+ };
22292
+ for (const e of edlList(edl)) {
22293
+ for (const s of Array.isArray(e.sources) ? e.sources : []) {
22294
+ for (const sp of Array.isArray(s?.speakers) ? s.speakers : []) add(sp);
22295
+ }
22296
+ for (const seg of Array.isArray(e.segments) ? e.segments : []) {
22297
+ add(seg?.speaker);
22298
+ for (const slot of Array.isArray(seg?.layout?.slots) ? seg.layout.slots : []) add(slot?.speaker);
22299
+ }
22300
+ }
22301
+ return [...out].sort();
22302
+ }
22303
+ function edlList(edl) {
22304
+ if (!edl) return [];
22305
+ const all = Array.isArray(edl) ? edl : [edl];
22306
+ return all.filter((e) => isObj(e));
22307
+ }
22308
+ var SHA256_HEX = /^[0-9a-f]{64}$/;
22309
+ function validateCommon(set, opts, perTrack) {
22310
+ const f = { issues: [], warnings: [] };
22311
+ const { issues, warnings } = f;
22312
+ const sources = arr(set.sources);
22313
+ const maxBoxes = opts.maxBoxesPerSource ?? SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE;
22314
+ if (set.version !== SPEAKER_TRACKS_VERSION) issues.push(`version must be ${SPEAKER_TRACKS_VERSION}`);
22315
+ if (!(isNum(set.sampleFps) && set.sampleFps > 0)) issues.push("sampleFps must be a finite number > 0");
22316
+ const edls = edlList(opts.edl);
22317
+ const edlSources = /* @__PURE__ */ new Map();
22318
+ for (const e of edls) {
22319
+ for (const s of Array.isArray(e.sources) ? e.sources : []) {
22320
+ if (s && typeof s.id === "string" && !edlSources.has(s.id)) edlSources.set(s.id, s);
22321
+ }
22322
+ }
22323
+ const sourceIds = /* @__PURE__ */ new Set();
22324
+ const trackIds = /* @__PURE__ */ new Set();
22325
+ sources.forEach((s, i) => {
22326
+ const sid = s.sourceId;
22327
+ const at = `source "${sid}"`;
22328
+ if (!sid) issues.push(`source[${i}]: sourceId is empty`);
22329
+ else if (sourceIds.has(sid)) issues.push(`duplicate source id "${sid}"`);
22330
+ sourceIds.add(sid);
22331
+ if (sid && edls.length > 0) {
22332
+ const es = edlSources.get(sid);
22333
+ if (!es) issues.push(`${at}: not a source of the EDL`);
22334
+ else if (es.kind !== "video") issues.push(`${at}: the EDL source is kind:"${es.kind}", tracks need a video source`);
22335
+ }
22336
+ if (s.clock !== "source") issues.push(`${at}: clock must be "source"`);
22337
+ if (!(isObj(s.frame) && isNum(s.frame.w) && isNum(s.frame.h) && s.frame.w > 0 && s.frame.h > 0)) {
22338
+ issues.push(`${at}: frame w/h must be positive`);
22339
+ }
22340
+ const spans = arr(s.sampledSpans);
22341
+ spans.forEach((sp, j) => {
22342
+ const startMs = sp?.startMs;
22343
+ const endMs = sp?.endMs;
22344
+ if (!(isNum(startMs) && isNum(endMs) && endMs > startMs)) {
22345
+ issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not positive`);
22346
+ return;
22347
+ }
22348
+ if (!(Number.isInteger(startMs) && Number.isInteger(endMs))) issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not integer ms`);
22349
+ if (startMs < 0) issues.push(`${at}: sampledSpans[${j}] starts before 0`);
22350
+ const prevEnd = spans[j - 1]?.endMs;
22351
+ if (j > 0 && isNum(prevEnd) && startMs < prevEnd) {
22352
+ issues.push(`${at}: sampledSpans must be sorted and non-overlapping (span ${j})`);
22353
+ }
22354
+ });
22355
+ const cuts = s.cuts;
22356
+ if (cuts !== void 0) {
22357
+ const okCuts = Array.isArray(cuts) && cuts.every((c, k) => Number.isInteger(c) && c >= 0 && (k === 0 || c > cuts[k - 1]));
22358
+ if (!okCuts) issues.push(`${at}: cuts must be ascending non-negative ms`);
22359
+ }
22360
+ let boxes = 0;
22361
+ const tracks = arr(s.tracks);
22362
+ tracks.forEach((t2, k) => {
22363
+ if (!t2?.id) issues.push(`${at} track[${k}]: id is empty`);
22364
+ else if (trackIds.has(t2.id)) issues.push(`duplicate track id "${t2.id}"`);
22365
+ if (t2?.id) trackIds.add(t2.id);
22366
+ const a = t2?.attribution;
22367
+ if (a) {
22368
+ if (!(isNum(a.confidence) && a.confidence >= 0 && a.confidence <= 1)) {
22369
+ issues.push(`track "${t2.id}": attribution.confidence=${a.confidence} out of 0..1`);
22370
+ }
22371
+ if (!KNOWN_METHODS.has(a.method)) {
22372
+ warnings.push(`track "${t2.id}": unknown attribution method "${a.method}" (known: ${SPEAKER_TRACK_ATTRIBUTION_METHODS.join(", ")})`);
22373
+ }
22374
+ }
22375
+ boxes += perTrack(t2, s, f);
22376
+ });
22377
+ if (boxes > maxBoxes) issues.push(`${at}: ${boxes} boxes is over the cap of ${maxBoxes}`);
22378
+ });
22379
+ if (edls.length > 0) {
22380
+ const space = edlSpeakerSpace(edls);
22381
+ const attributed = sources.flatMap((s) => Array.isArray(s.tracks) ? s.tracks : []).filter((t2) => !!t2?.speaker);
22382
+ if (space.length > 0 && attributed.length > 0) {
22383
+ const inSpace = new Set(space);
22384
+ const matches = (t2) => inSpace.has(t2.speaker) || !!t2.attribution?.rawSpeaker && inSpace.has(t2.attribution.rawSpeaker);
22385
+ if (!attributed.some(matches)) {
22386
+ const labels = [...new Set(attributed.map((t2) => t2.speaker))].sort();
22387
+ issues.push(
22388
+ `no tracked speaker is in the edit's speaker set: the tracks are labelled ${labels.map((l) => `"${l}"`).join(", ")} and the edit uses ${space.map((l) => `"${l}"`).join(", ")} \u2014 wire Speaker Frames to the same transcript as Camera Switch`
22389
+ );
22390
+ } else {
22391
+ for (const t2 of attributed) {
22392
+ if (!matches(t2)) warnings.push(`track "${t2.id}": speaker "${t2.speaker}" is not in the edit's speaker set`);
22393
+ }
22394
+ }
22395
+ }
22396
+ }
22397
+ return f;
22398
+ }
22399
+ var BOX_FINDINGS_PER_RULE = 5;
22400
+ var MAX_LISTED_FINDINGS = 100;
22401
+ function boxIssues(b, at) {
22402
+ const out = [];
22403
+ for (const k of ["x", "y", "w", "h"]) {
22404
+ const v = b?.[k];
22405
+ if (!isNum(v) || v < 0 || v > 1) out.push([`with ${k} out of 0..1`, `${at}: ${k}=${v} out of 0..1`]);
22406
+ }
22407
+ if (out.length > 0) return out;
22408
+ if (b.w <= 0 || b.h <= 0) out.push(["with a non-positive w/h", `${at}: non-positive w/h`]);
22409
+ if (b.x + b.w > 1 + 1e-9) out.push(["extending past the right edge", `${at}: extends past the right edge (x+w>1)`]);
22410
+ if (b.y + b.h > 1 + 1e-9) out.push(["extending past the bottom edge", `${at}: extends past the bottom edge (y+h>1)`]);
22411
+ if (b.score !== void 0 && !(isNum(b.score) && b.score >= 0 && b.score <= 1)) out.push(["with a score out of 0..1", `${at}: score=${b.score} out of 0..1`]);
22412
+ return out;
22413
+ }
22414
+ function capListed(list, noun) {
22415
+ if (list.length <= MAX_LISTED_FINDINGS) return [...list];
22416
+ return [...list.slice(0, MAX_LISTED_FINDINGS), `${list.length - MAX_LISTED_FINDINGS} more ${noun} not listed`];
22417
+ }
22418
+ function inSpans(spans, ms) {
22419
+ let lo = 0;
22420
+ let hi = spans.length - 1;
22421
+ while (lo <= hi) {
22422
+ const mid = lo + hi >> 1;
22423
+ const sp = spans[mid];
22424
+ if (ms < sp.startMs) hi = mid - 1;
22425
+ else if (ms >= sp.endMs) lo = mid + 1;
22426
+ else return true;
22427
+ }
22428
+ return false;
22429
+ }
22430
+ function validateSpeakerTracks(set, opts = {}) {
22431
+ const safe = isObj(set) ? set : {};
22432
+ const f = validateCommon(safe, opts, (t2, source, { issues }) => {
22433
+ const boxes = Array.isArray(t2?.boxes) ? t2.boxes : [];
22434
+ const spans = Array.isArray(source.sampledSpans) ? source.sampledSpans : [];
22435
+ let first = Infinity;
22436
+ let last = -Infinity;
22437
+ const seen = /* @__PURE__ */ new Map();
22438
+ const report = ([rule, message]) => {
22439
+ const n = (seen.get(rule) ?? 0) + 1;
22440
+ seen.set(rule, n);
22441
+ if (n <= BOX_FINDINGS_PER_RULE) issues.push(message);
22442
+ };
22443
+ const outside = `outside every sampled span of source "${source.sourceId}"`;
22444
+ boxes.forEach((b, j) => {
22445
+ const at = `track "${t2.id}" box[${j}]`;
22446
+ boxIssues(b, at).forEach(report);
22447
+ if (!isNum(b?.ms)) {
22448
+ report(["whose ms is not a number", `${at}: ms is not a number`]);
22449
+ return;
22450
+ }
22451
+ if (!Number.isInteger(b.ms)) report(["whose ms is not an integer", `${at}: ms ${b.ms} is not an integer`]);
22452
+ const prev = boxes[j - 1]?.ms;
22453
+ if (j > 0 && isNum(prev) && !(b.ms > prev)) report(["not after the previous box", `${at}: ms ${b.ms} is not after the previous box (${prev})`]);
22454
+ if (!inSpans(spans, b.ms)) report([outside, `${at}: ms ${b.ms} is ${outside}`]);
22455
+ first = Math.min(first, b.ms);
22456
+ last = Math.max(last, b.ms);
22457
+ });
22458
+ for (const [rule, n] of seen) {
22459
+ if (n > BOX_FINDINGS_PER_RULE) issues.push(`track "${t2.id}": ${n - BOX_FINDINGS_PER_RULE} more boxes ${rule}`);
22460
+ }
22461
+ const cut = (Array.isArray(source.cuts) ? source.cuts : []).find((c) => first < c && c <= last);
22462
+ if (cut !== void 0) issues.push(`track "${t2.id}": spans the cut at ${cut} ms (boxes ${first}..${last})`);
22463
+ return boxes.length;
22464
+ });
22465
+ const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
22466
+ const bytes = opts.serializedBytes ?? new TextEncoder().encode(JSON.stringify(safe)).length;
22467
+ if (bytes > maxBytes) f.issues.push(`the track set is ${bytes} bytes, over the cap of ${maxBytes}`);
22468
+ return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
22469
+ }
22470
+ function validateSpeakerTrackSetDescriptor(d, opts = {}) {
22471
+ const safe = isObj(d) ? d : {};
22472
+ const f = validateCommon(safe, opts, (t2, _source, { issues }) => {
22473
+ if (!(Number.isInteger(t2?.boxCount) && t2.boxCount >= 0)) {
22474
+ issues.push(`track "${t2?.id}": boxCount must be a non-negative integer`);
22475
+ return 0;
22476
+ }
22477
+ return t2.boxCount;
22478
+ });
22479
+ if (!(typeof safe.url === "string" && safe.url.trim())) f.issues.push("url is empty");
22480
+ if (!(typeof safe.sha256 === "string" && SHA256_HEX.test(safe.sha256))) f.issues.push("sha256 must be 64 lowercase hex characters");
22481
+ const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
22482
+ if (!(Number.isInteger(safe.bytes) && safe.bytes > 0)) f.issues.push("bytes must be a positive integer");
22483
+ else if (safe.bytes > maxBytes) f.issues.push(`the track set is ${safe.bytes} bytes, over the cap of ${maxBytes}`);
22484
+ return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
22485
+ }
22486
+
21151
22487
  // src/camera-switch-contract.ts
21152
22488
  var CAMERA_SWITCH_DEFAULTS = Object.freeze({
21153
22489
  /** The shortest shot; a shorter turn (an interjection) holds the shot. */
@@ -21212,10 +22548,10 @@ function cameraSwitchEdlProblem(edl) {
21212
22548
  if (Array.isArray(v.clips)) return "camera-switch: `edl` is a clip set \u2014 pass one clip's EDL (a clip set fans out one run per clip on the canvas).";
21213
22549
  if (!Array.isArray(v.sources) || !Array.isArray(v.segments)) return "camera-switch: `edl` needs `sources` and `segments`.";
21214
22550
  if (v.segments.length === 0) return "camera-switch: `edl` has no segments.";
21215
- const num2 = (x) => typeof x === "number" && Number.isFinite(x) ? x : void 0;
22551
+ const num3 = (x) => typeof x === "number" && Number.isFinite(x) ? x : void 0;
21216
22552
  for (const [i, row] of v.segments.entries()) {
21217
22553
  const seg = row;
21218
- const inMs = num2(seg?.inMs), outMs = num2(seg?.outMs);
22554
+ const inMs = num3(seg?.inMs), outMs = num3(seg?.outMs);
21219
22555
  if (inMs === void 0 || outMs === void 0 || !(outMs > inMs)) return `camera-switch: segment ${i} needs a numeric inMs < outMs.`;
21220
22556
  }
21221
22557
  if (v.clock === "output") return "camera-switch: the edit must be on the master clock (an edit-plan EDL), not a rendered output's.";
@@ -21248,7 +22584,7 @@ function cameraSwitchSettingsPayload(data, edl, transcript) {
21248
22584
  }
21249
22585
 
21250
22586
  // src/edit-plan-contract.ts
21251
- var EDIT_PLAN_MODES = ["tighten", "clips", "chapters"];
22587
+ var EDIT_PLAN_MODES = ["tighten", "clips", "chapters", "trailer"];
21252
22588
  var EDIT_PLAN_TIERS = ["economy", "standard", "premium"];
21253
22589
  var EDIT_PLAN_BUCKET_MINUTES = [15, 30, 60, 90, 120, 180];
21254
22590
  var EDIT_PLAN_MAX_MINUTES = 180;
@@ -21270,7 +22606,10 @@ function buildEditPlanCreditId(mode, tier, durationSec) {
21270
22606
  return `edit-plan:${mode}:${tier}:${editPlanBucketMinutes(durationSec)}m`;
21271
22607
  }
21272
22608
  function asEditPlanMode(v) {
21273
- return v === "clips" || v === "chapters" ? v : "tighten";
22609
+ return parseEditPlanMode(v) ?? "tighten";
22610
+ }
22611
+ function parseEditPlanMode(v) {
22612
+ return typeof v === "string" && EDIT_PLAN_MODES.includes(v) ? v : void 0;
21274
22613
  }
21275
22614
  function asEditPlanTier(v) {
21276
22615
  return v === "economy" || v === "premium" ? v : "standard";
@@ -21345,18 +22684,24 @@ function fnv1a64(text) {
21345
22684
  }
21346
22685
  return hi.toString(16).padStart(8, "0") + lo.toString(16).padStart(8, "0");
21347
22686
  }
22687
+ var basisByPlan = /* @__PURE__ */ new WeakMap();
21348
22688
  function editPlanBasis(plan) {
21349
- return fnv1a64(canonicalJson(plan) ?? "");
22689
+ if (typeof plan !== "object" || plan === null) return fnv1a64(canonicalJson(plan) ?? "");
22690
+ const cached = basisByPlan.get(plan);
22691
+ if (cached !== void 0) return cached;
22692
+ const basis = fnv1a64(canonicalJson(plan) ?? "");
22693
+ basisByPlan.set(plan, basis);
22694
+ return basis;
21350
22695
  }
21351
- var isRecord3 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
22696
+ var isRecord4 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
21352
22697
  function planShape(plan) {
21353
22698
  if (Array.isArray(plan)) return "clips";
21354
- if (isRecord3(plan) && Array.isArray(plan.segments)) return "edl";
22699
+ if (isRecord4(plan) && Array.isArray(plan.segments)) return "edl";
21355
22700
  return "other";
21356
22701
  }
21357
22702
  function checkEnvelope(edited, plan) {
21358
22703
  if (edited === void 0 || edited === null) return { status: "none" };
21359
- if (!isRecord3(edited)) return { status: "invalid", issue: "editedEdl must be an object" };
22704
+ if (!isRecord4(edited)) return { status: "invalid", issue: "editedEdl must be an object" };
21360
22705
  if (edited.v !== EDITED_EDL_VERSION) return { status: "invalid", issue: `editedEdl.v must be ${EDITED_EDL_VERSION}` };
21361
22706
  if (typeof edited.basis !== "string" || edited.basis.length === 0) {
21362
22707
  return { status: "invalid", issue: "editedEdl.basis must be a non-empty string" };
@@ -21371,7 +22716,7 @@ function checkEnvelope(edited, plan) {
21371
22716
  if (edited.kind === "edl") {
21372
22717
  if (shape !== "edl") return { status: "invalid", issue: `an "edl" edit needs a Tighten plan (one EDL); this plan is ${describeShape(shape)}` };
21373
22718
  const edl = edited.edl;
21374
- if (!isRecord3(edl) || !Array.isArray(edl.segments) || !Array.isArray(edl.dropped)) {
22719
+ if (!isRecord4(edl) || !Array.isArray(edl.segments) || !Array.isArray(edl.dropped)) {
21375
22720
  return { status: "invalid", issue: "editedEdl.edl must hold a segments array and a dropped array" };
21376
22721
  }
21377
22722
  } else if (edited.kind === "clips") {
@@ -21383,7 +22728,7 @@ function checkEnvelope(edited, plan) {
21383
22728
  return { status: "invalid", issue: `editedEdl.clips holds ${clips.length} decisions; the plan has ${planned} clips` };
21384
22729
  }
21385
22730
  const bad = clips.findIndex(
21386
- (c) => !isRecord3(c) || typeof c.keep !== "boolean" || c.hook !== void 0 && typeof c.hook !== "string"
22731
+ (c) => !isRecord4(c) || typeof c.keep !== "boolean" || c.hook !== void 0 && typeof c.hook !== "string"
21387
22732
  );
21388
22733
  if (bad >= 0) return { status: "invalid", issue: `editedEdl.clips[${bad}] must be {keep: boolean, hook?: string}` };
21389
22734
  }
@@ -21408,8 +22753,8 @@ function withHook(clip, hook) {
21408
22753
  return clip;
21409
22754
  }
21410
22755
  }
21411
- if (!isRecord3(value)) return clip;
21412
- const meta = isRecord3(value.meta) ? value.meta : {};
22756
+ if (!isRecord4(value)) return clip;
22757
+ const meta = isRecord4(value.meta) ? value.meta : {};
21413
22758
  return { ...value, meta: { ...meta, hook } };
21414
22759
  }
21415
22760
  function resolveEditPlanOutput(plan, editedEdl) {
@@ -21436,6 +22781,11 @@ function editPlanSavedOutput(data) {
21436
22781
  const { status: _status, ...output } = resolveEditPlanOutput(plan, data.editedEdl);
21437
22782
  return output;
21438
22783
  }
22784
+ function editPlanResultPatch(plan, editedEdl) {
22785
+ const basis = isRecord4(editedEdl) ? editedEdl.basis : void 0;
22786
+ const madeOnThisPlan = typeof basis === "string" && basis.length > 0 && basis === editPlanBasis(plan);
22787
+ return madeOnThisPlan ? { generatedJson: plan } : { generatedJson: plan, editedEdl: void 0 };
22788
+ }
21439
22789
  function validateEditedEdl(editedEdl, plan) {
21440
22790
  const check = checkEnvelope(editedEdl, plan);
21441
22791
  if (check.status === "none") return { ok: false, issues: ["there is no edit"], warnings: [] };
@@ -21445,6 +22795,583 @@ function validateEditedEdl(editedEdl, plan) {
21445
22795
  return validateEdl(resolved);
21446
22796
  }
21447
22797
 
22798
+ // src/render-output.ts
22799
+ var MEDIUM_FIELD = {
22800
+ video: "generatedVideoUrl",
22801
+ audio: "generatedAudioUrl"
22802
+ };
22803
+ var str5 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
22804
+ var BASIS = /^[0-9a-f]{16}$/;
22805
+ var basisOf = (v) => typeof v === "string" && BASIS.test(v) ? v : void 0;
22806
+ function renderResultStamp(output) {
22807
+ const o = output && typeof output === "object" ? output : {};
22808
+ const quality = o.quality === "proxy" || o.quality === "final" ? o.quality : void 0;
22809
+ const clipKey = str5(o.clipKey);
22810
+ const planBasis = basisOf(o.planBasis);
22811
+ const renderBasis = basisOf(o.renderBasis);
22812
+ return {
22813
+ ...quality ? { quality } : {},
22814
+ ...clipKey ? { clipKey } : {},
22815
+ ...planBasis ? { planBasis } : {},
22816
+ ...renderBasis ? { renderBasis } : {}
22817
+ };
22818
+ }
22819
+ function mediumOf(data) {
22820
+ return data.output === "audio" ? "audio" : "video";
22821
+ }
22822
+ function resultsOf(data) {
22823
+ return Array.isArray(data.generatedResults) ? data.generatedResults : [];
22824
+ }
22825
+ function itemOf(url, medium, entry) {
22826
+ const jobId = str5(entry?.jobId);
22827
+ const thumbnailUrl = str5(entry?.thumbnailUrl);
22828
+ return {
22829
+ url,
22830
+ medium,
22831
+ ...jobId ? { jobId } : {},
22832
+ ...thumbnailUrl ? { thumbnailUrl } : {},
22833
+ ...entry ? renderResultStamp(entry) : {}
22834
+ };
22835
+ }
22836
+ function savedRenderOutput(data) {
22837
+ const medium = mediumOf(data);
22838
+ const results = resultsOf(data);
22839
+ const index = typeof data.activeResultIndex === "number" ? data.activeResultIndex : 0;
22840
+ const selected = results[index] ?? results[0];
22841
+ const selectedUrl = str5(selected?.url);
22842
+ if (selectedUrl) return itemOf(selectedUrl, medium, selected);
22843
+ const own = str5(data[MEDIUM_FIELD[medium]]);
22844
+ if (own) return { url: own, medium };
22845
+ const other = medium === "video" ? "audio" : "video";
22846
+ const otherUrl = str5(data[MEDIUM_FIELD[other]]);
22847
+ return otherUrl ? { url: otherUrl, medium: other } : void 0;
22848
+ }
22849
+ function savedRenderBatch(data) {
22850
+ const batch = data.__listResults;
22851
+ if (!Array.isArray(batch) || batch.length === 0) return void 0;
22852
+ const medium = mediumOf(data);
22853
+ const byUrl = /* @__PURE__ */ new Map();
22854
+ for (const entry of resultsOf(data)) {
22855
+ const url = str5(entry.url);
22856
+ if (url && !byUrl.has(url)) byUrl.set(url, entry);
22857
+ }
22858
+ return batch.map((row) => {
22859
+ const url = str5(row);
22860
+ return url ? itemOf(url, medium, byUrl.get(url)) : null;
22861
+ });
22862
+ }
22863
+ function savedRenderBatchUrls(data) {
22864
+ const batch = savedRenderBatch(data);
22865
+ return batch ? batch.map((item) => item?.url ?? "") : void 0;
22866
+ }
22867
+ function edlSpanKey(edl) {
22868
+ if (!edl || typeof edl !== "object" || Array.isArray(edl)) return void 0;
22869
+ let segments;
22870
+ try {
22871
+ segments = normalizeEdl(edl).segments;
22872
+ } catch {
22873
+ return void 0;
22874
+ }
22875
+ if (segments.length === 0) return void 0;
22876
+ let min = Infinity;
22877
+ let max = -Infinity;
22878
+ for (const s of segments) {
22879
+ if (s.inMs < min) min = s.inMs;
22880
+ if (s.outMs > max) max = s.outMs;
22881
+ }
22882
+ return Number.isFinite(min) && Number.isFinite(max) ? `${min}-${max}` : void 0;
22883
+ }
22884
+ function planClipKeyAt(plan, row) {
22885
+ if (!Array.isArray(plan)) return void 0;
22886
+ let clip = plan[row];
22887
+ if (typeof clip === "string") {
22888
+ if (!clip.trim()) return void 0;
22889
+ try {
22890
+ clip = JSON.parse(clip);
22891
+ } catch {
22892
+ return void 0;
22893
+ }
22894
+ }
22895
+ return edlSpanKey(clip);
22896
+ }
22897
+ var TELEPORT_TYPES2 = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
22898
+ var EDL_PASS_THROUGH_TYPES = /* @__PURE__ */ new Set(["camera-switch"]);
22899
+ function outputModeOf2(data) {
22900
+ const mode = data && typeof data === "object" ? data.outputMode : void 0;
22901
+ return typeof mode === "string" ? mode : void 0;
22902
+ }
22903
+ function renderPlanPath(renderId, nodes, edges) {
22904
+ const byId = new Map(nodes.map((n) => [n.id, n]));
22905
+ const lastEdlInto = (id) => edges.filter((e) => e.target === id && e.targetHandle === "edl").at(-1);
22906
+ const teleportInput = (id) => edges.find((e) => e.target === id);
22907
+ const visited = /* @__PURE__ */ new Set();
22908
+ const hops = [];
22909
+ let consumer = lastEdlInto(renderId);
22910
+ let edge = consumer;
22911
+ while (edge && consumer) {
22912
+ const node = byId.get(edge.source);
22913
+ if (!node || visited.has(node.id)) return void 0;
22914
+ visited.add(node.id);
22915
+ if (TELEPORT_TYPES2.has(node.type ?? "")) {
22916
+ edge = teleportInput(node.id);
22917
+ continue;
22918
+ }
22919
+ const mode = outputModeOf2(consumer.data) ?? defaultEdgeOutputMode(node.type, edge.sourceHandle);
22920
+ hops.unshift({ edge: consumer, each: mode === "each", ...node.type ? { source: node.type } : {} });
22921
+ if (node.type === "edit-plan") return { planId: node.id, hops };
22922
+ if (!EDL_PASS_THROUGH_TYPES.has(node.type ?? "")) return void 0;
22923
+ consumer = lastEdlInto(node.id);
22924
+ edge = consumer;
22925
+ }
22926
+ return void 0;
22927
+ }
22928
+ function passThroughRan(path, ranIds) {
22929
+ return path.hops.slice(0, -1).every((hop) => ranIds.has(hop.edge.target));
22930
+ }
22931
+ function renderPlanNodeId(renderId, nodes, edges) {
22932
+ return renderPlanPath(renderId, nodes, edges)?.planId;
22933
+ }
22934
+ var isHole = (clip) => clip == null || typeof clip === "string" && !clip.trim();
22935
+ var keptClips = (clips) => clips.filter((clip) => !isHole(clip));
22936
+ function singlePick(clips, hop) {
22937
+ const data = hop.edge.data;
22938
+ const mode = outputModeOf2(hop.edge.data);
22939
+ if (mode === "item") {
22940
+ const expr = typeof data?.itemIndex === "string" ? data.itemIndex : "1";
22941
+ return [clips[resolveIndex(expr, clips.length)] ?? clips[0]];
22942
+ }
22943
+ if (mode?.startsWith("item:")) return [clips[parseInt(mode.slice(5), 10)] ?? clips[0]];
22944
+ if (mode === "all") return selectListItems(clips, data);
22945
+ if (hop.source === "edit-plan") return keptClips(clips).slice(0, 1);
22946
+ return clips.length === 1 ? clips : [];
22947
+ }
22948
+ function renderPlanValue(plan, row, hops = []) {
22949
+ if (!Array.isArray(plan)) return plan === null || typeof plan !== "object" ? void 0 : plan;
22950
+ let clips = plan;
22951
+ for (const [i, hop] of hops.entries()) {
22952
+ if (clips.length === 0) return void 0;
22953
+ if (hop.each) {
22954
+ clips = selectListItems(clips, hop.edge.data);
22955
+ if (i < hops.length - 1) clips = keptClips(clips);
22956
+ } else {
22957
+ clips = singlePick(clips, hop);
22958
+ if (clips.length !== 1) return void 0;
22959
+ }
22960
+ }
22961
+ if (clips.length === 0) return void 0;
22962
+ const rowed = row !== void 0 && (hops.at(-1)?.each ?? true);
22963
+ if (rowed) {
22964
+ const clip = clips[row % clips.length];
22965
+ return isHole(clip) ? void 0 : clip;
22966
+ }
22967
+ const kept = keptClips(clips);
22968
+ return kept.length === 1 ? kept[0] : void 0;
22969
+ }
22970
+ function renderClipKey(plan, row, hops = []) {
22971
+ if (!Array.isArray(plan)) return void 0;
22972
+ const clip = renderPlanValue(plan, row, hops);
22973
+ return clip === void 0 ? void 0 : planClipKeyAt([clip], 0);
22974
+ }
22975
+ function renderPlanClipKey(renderId, nodes, edges, planClips, row) {
22976
+ const path = renderPlanPath(renderId, nodes, edges);
22977
+ const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
22978
+ if (!path || !planNode) return void 0;
22979
+ return renderClipKey(planClips(planNode), row, path.hops);
22980
+ }
22981
+ function renderPlanRowClipKeys(renderId, nodes, edges, planClips, rows, ranIds) {
22982
+ const path = renderPlanPath(renderId, nodes, edges);
22983
+ const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
22984
+ if (!path || !planNode || !passThroughRan(path, ranIds)) return rows.map(() => void 0);
22985
+ const plan = planClips(planNode);
22986
+ return rows.map((row) => renderClipKey(plan, row, path.hops));
22987
+ }
22988
+ function renderRunQuality(data) {
22989
+ return data?.quality === "proxy" ? "proxy" : "final";
22990
+ }
22991
+ function renderSentRowStamps(quality, clipKeys) {
22992
+ return clipKeys.map((clipKey) => ({ quality, ...clipKey ? { clipKey } : {} }));
22993
+ }
22994
+ var readBasisByValue = /* @__PURE__ */ new WeakMap();
22995
+ var isPlainObject2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
22996
+ function renderReadBasis(value) {
22997
+ let v = value;
22998
+ if (typeof v === "string") {
22999
+ if (!v.trim()) return void 0;
23000
+ try {
23001
+ v = JSON.parse(v);
23002
+ } catch {
23003
+ return void 0;
23004
+ }
23005
+ }
23006
+ if (!isPlainObject2(v)) return void 0;
23007
+ const cached = readBasisByValue.get(v);
23008
+ if (cached !== void 0) return cached;
23009
+ const { meta: _meta, ...rest } = v;
23010
+ const basis = editPlanBasis(rest);
23011
+ readBasisByValue.set(v, basis);
23012
+ return basis;
23013
+ }
23014
+ function renderSettingsBasis(settings, sources = []) {
23015
+ const raw = settings.crossfadeMs;
23016
+ const crossfadeMs = typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.round(raw)) : 0;
23017
+ return editPlanBasis({
23018
+ crossfadeMs,
23019
+ output: settings.output === "audio" ? "audio" : "video",
23020
+ sources: sources.map((url) => typeof url === "string" ? url : "")
23021
+ });
23022
+ }
23023
+ function renderPlanBasis(renderId, nodes, edges, planOutput, row, ranIds) {
23024
+ const path = renderPlanPath(renderId, nodes, edges);
23025
+ const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
23026
+ if (!path || !planNode) return void 0;
23027
+ if (!passThroughRan(path, ranIds)) return void 0;
23028
+ return renderReadBasis(renderPlanValue(planOutput(planNode), row, path.hops));
23029
+ }
23030
+
23031
+ // src/handle-aliases.ts
23032
+ var LEGACY_SOURCE_HANDLE_ALIASES = {
23033
+ // Batch 1
23034
+ "generate-music": { "audio-out": "audio" },
23035
+ // Batch 2 — Suno output id normalization
23036
+ "suno-add-instrumental": { "audio-out": "audio" },
23037
+ "suno-add-vocals": { "audio-out": "audio" },
23038
+ "suno-convert-wav": { "audio-out": "audio" },
23039
+ "suno-mashup": { "audio-out": "audio" },
23040
+ "suno-replace-section": { "audio-out": "audio" },
23041
+ "suno-upload-extend": { "audio-out": "audio" },
23042
+ "suno-music-video": { "video-out": "video" },
23043
+ "suno-style-boost": { "text-out": "text" },
23044
+ "suno-separate": { "vocal-out": "vocals", "instrumental-out": "instrumental" },
23045
+ // Batch 4 — Processing output id normalization (non-ffmpeg ones only)
23046
+ "split-text": { out: "text" },
23047
+ // split-media produces dual-typed outputs; map each leg of the legacy
23048
+ // `*-out` pair to the new single-word form.
23049
+ "split-media": { "audio-out": "audio", "video-out": "video" },
23050
+ // Phase 20 — Image-producer output id normalization. Pre-migration these
23051
+ // nodes shipped a single generic `out` source handle; after the typed-handle
23052
+ // migration their source pip is the canonical type name.
23053
+ "edit-image": { out: "image" },
23054
+ "modify-image": { out: "image" },
23055
+ "image-to-image": { out: "image" },
23056
+ "upscale-image": { out: "image" },
23057
+ "remove-background": { out: "image" },
23058
+ "face-swap": { out: "video" },
23059
+ // Phase 21 — Video-producer output id normalization.
23060
+ "motion-transfer": { out: "video" },
23061
+ // Phase 22 — Upload/source-node output id normalization.
23062
+ "reference-audio": { "audio-out": "audio" },
23063
+ // Phase 24c — Compositing-stragglers output id normalization.
23064
+ "speed-ramp": { "video-out": "video" },
23065
+ "fade-video": { "video-out": "video" },
23066
+ "transcode-video": { "video-out": "video" },
23067
+ "manual-edit": { "video-out": "video" },
23068
+ "social-media-format": { "media-out": "media", "text-out": "text" },
23069
+ // Telegram Channel Feed: the pip was `out` until it took the platform's
23070
+ // text id (`text`), which its definition and docs always named.
23071
+ "telegram-channel-feed": { out: "text" },
23072
+ // Telegram Trigger: the docs once named six outputs; the component renders
23073
+ // one, `out`, and media rides it by kind on both engines.
23074
+ "telegram-trigger": { text: "out", imageUrl: "out", videoUrl: "out", audioUrl: "out" },
23075
+ // #1877 — the definitions now declare the pips these components render. The
23076
+ // id they used to declare (what MCP clients and the docs were told) moves
23077
+ // onto the pip that draws, so an edge written with it still connects.
23078
+ "add-captions": { video: "video-out" },
23079
+ "adjust-volume": { audio: "audio-out" },
23080
+ "audio-fx": { audio: "audio-out" },
23081
+ "combine-audio": { audio: "audio-out" },
23082
+ "loop-video": { video: "video-out" },
23083
+ "merge-video-audio": { video: "video-out" },
23084
+ "mix-audio": { audio: "audio-out" },
23085
+ "resize-video": { video: "video-out" },
23086
+ "trim-video": { video: "video-out" },
23087
+ "save-to-storage": { asset: "out" }
23088
+ // (audio-separation's old `audio` is NOT aliased: it could mean any of the
23089
+ // seven stems, and a stem is never guessed.)
23090
+ };
23091
+ var LEGACY_TARGET_HANDLE_ALIASES = {
23092
+ // Batch 1
23093
+ "text-to-speech": { in: "prompt" },
23094
+ "text-to-audio": { in: "prompt" },
23095
+ "generate-music": { in: "prompt" },
23096
+ "audio-isolation": { in: "audio" },
23097
+ "text-to-dialogue": { in: "prompt" },
23098
+ "voice-changer": { in: "audio" },
23099
+ dubbing: { in: "audio" },
23100
+ // voice-remix / voice-design keep the legacy `audio-style` target id intact
23101
+ // — that name is hard-coded in the runtime hint composers. Only `in` moves.
23102
+ "voice-remix": { in: "audio" },
23103
+ "voice-design": { in: "prompt" },
23104
+ "forced-alignment": { in: "audio" },
23105
+ // Batch 2 — Suno target id normalization
23106
+ "suno-generate": { in: "prompt" },
23107
+ "suno-lyrics": { in: "prompt" },
23108
+ "suno-style-boost": { text: "prompt" },
23109
+ // Batch 3 — Script & Text target id normalization
23110
+ "generate-script": { in: "prompt" },
23111
+ transcribe: { in: "audio" },
23112
+ // Batch 4 — Processing target id normalization (non-ffmpeg only)
23113
+ "combine-text": { in: "text" },
23114
+ "split-text": { in: "text" },
23115
+ "split-media": { "video-in": "video", "audio-in": "audio" },
23116
+ // Phase 20 — Image-producer target id normalization.
23117
+ "face-swap": { in: "video" },
23118
+ // Phase 21 — Video-producer target id normalization.
23119
+ "video-to-video": { in: "video" },
23120
+ "video-upscale": { in: "video" },
23121
+ "extend-video": { in: "video" },
23122
+ "motion-transfer": { in: "video" },
23123
+ "lip-sync": { videoIn: "video" },
23124
+ // Phase 24c — Compositing-stragglers target id normalization.
23125
+ "after-effects": { in: "video" },
23126
+ "motion-graphics": { in: "video" },
23127
+ "lottie-overlay": { in: "video" },
23128
+ // video-composer renders ONE target pip, `in` ("Media"). An earlier table
23129
+ // sent saved edges to a `video` pip the node never had; this heals those.
23130
+ "video-composer": { video: "in" },
23131
+ "render-video": { in: "composition" },
23132
+ "speed-ramp": { in: "video" },
23133
+ "fade-video": { in: "video" },
23134
+ "transcode-video": { in: "video" },
23135
+ // (manual-edit keeps `in` as a multi-asset target.)
23136
+ "social-media-format": { "media-in": "media", "text-in": "text" }
23137
+ };
23138
+ var DYNAMIC_HANDLE_NODE_TYPES = /* @__PURE__ */ new Set([
23139
+ "list",
23140
+ "loop",
23141
+ "group",
23142
+ "collect",
23143
+ "router",
23144
+ "component",
23145
+ "sub-workflow",
23146
+ "sub-workflow-input",
23147
+ "sub-workflow-output",
23148
+ "selector",
23149
+ // Payload parameters become handles.
23150
+ "webhook-trigger",
23151
+ // One `variant:<id>` handle per layer.
23152
+ "image-overlay"
23153
+ ]);
23154
+ function canonicalSourceHandle(nodeType, handle) {
23155
+ return nodeType && LEGACY_SOURCE_HANDLE_ALIASES[nodeType]?.[handle] || handle;
23156
+ }
23157
+ function canonicalTargetHandle(nodeType, handle) {
23158
+ return nodeType && LEGACY_TARGET_HANDLE_ALIASES[nodeType]?.[handle] || handle;
23159
+ }
23160
+ var SUNO_IN_CLASSIFIER_TARGETS = /* @__PURE__ */ new Set([
23161
+ "suno-cover",
23162
+ "suno-extend",
23163
+ "suno-replace-section",
23164
+ "suno-upload-extend"
23165
+ ]);
23166
+ var SUNO_VOICE_CAPABLE_TARGETS = /* @__PURE__ */ new Set(["suno-generate", "suno-cover", "suno-extend"]);
23167
+ var IMAGE_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
23168
+ "generate-image",
23169
+ "upload-image",
23170
+ "edit-image",
23171
+ "image-to-image",
23172
+ "modify-image",
23173
+ "upscale-image",
23174
+ "remove-background",
23175
+ "generate-mask",
23176
+ "scene"
23177
+ ]);
23178
+ var IDENTITY_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
23179
+ "character",
23180
+ "face",
23181
+ "object",
23182
+ "creature",
23183
+ "location"
23184
+ ]);
23185
+ var VIDEO_SOURCE_TYPES_FOR_CLASSIFIER = VIDEO_PRODUCER_TYPES;
23186
+ var AUDIO_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([...AUDIO_PRODUCER_TYPES, "youtube-video"]);
23187
+ var DUAL_MODE_REVOICE_TARGETS = /* @__PURE__ */ new Set(["voice-changer", "voice-changer-pro", "dubbing"]);
23188
+ function classifyLegacyTargetHandle(targetType, handle, sourceType, sentHandle = handle) {
23189
+ if (!targetType) return handle;
23190
+ const source = sourceType ?? "";
23191
+ if (source === "suno-voice" && SUNO_VOICE_CAPABLE_TARGETS.has(targetType) && (handle === "in" || handle === "prompt" || handle == null)) {
23192
+ return "voice";
23193
+ }
23194
+ if (SUNO_IN_CLASSIFIER_TARGETS.has(targetType) && (handle === "in" || handle == null)) {
23195
+ return AUDIO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "audio" : "prompt";
23196
+ }
23197
+ if (targetType === "motion-transfer" && handle === "video") {
23198
+ if (IDENTITY_TYPES_FOR_CLASSIFIER.has(source)) return "assets";
23199
+ if (IMAGE_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "image";
23200
+ if (!VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "prompt";
23201
+ return handle;
23202
+ }
23203
+ if ((targetType === "video-to-video" || targetType === "extend-video") && handle === "video" && !VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) {
23204
+ return "prompt";
23205
+ }
23206
+ if (DUAL_MODE_REVOICE_TARGETS.has(targetType) && (sentHandle === "in" || sentHandle == null)) {
23207
+ return VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "video" : "audio";
23208
+ }
23209
+ return handle;
23210
+ }
23211
+ var RENDERED_OUTPUT_HANDLES = {};
23212
+ function renderedSourceHandle(nodeType, handle, declaredOutputs) {
23213
+ if (!nodeType || !handle) return null;
23214
+ const rendered = RENDERED_OUTPUT_HANDLES[nodeType];
23215
+ if (!rendered || rendered.includes(handle) || !declaredOutputs?.includes(handle)) return null;
23216
+ if (rendered.includes(`${handle}-out`)) return `${handle}-out`;
23217
+ return rendered.length === 1 ? rendered[0] : null;
23218
+ }
23219
+
23220
+ // src/telegram-channel.ts
23221
+ var TELEGRAM_FEED_LIMIT_MAX = 30;
23222
+ var TELEGRAM_FEED_PEEK_MAX = 20;
23223
+ var TELEGRAM_FEED_PAGE_SIZE = 20;
23224
+ var TELEGRAM_FEED_DEFAULT_LIMIT = 5;
23225
+ var TELEGRAM_FEED_DIGEST_SEPARATOR = "\n\n---\n\n";
23226
+ function telegramFeedDigest(posts) {
23227
+ return posts.map((p) => p.text).filter((t2) => typeof t2 === "string" && t2.trim().length > 0).join(TELEGRAM_FEED_DIGEST_SEPARATOR);
23228
+ }
23229
+ var isRecord5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
23230
+ var str6 = (v) => typeof v === "string" ? v : void 0;
23231
+ function telegramPostsFrom(value) {
23232
+ if (!Array.isArray(value)) return [];
23233
+ const out = [];
23234
+ for (const item of value) {
23235
+ if (!isRecord5(item) || typeof item.id !== "number" || !Number.isFinite(item.id) || typeof item.text !== "string") continue;
23236
+ const media = Array.isArray(item.media) ? item.media.filter((m) => isRecord5(m) && (m.type === "photo" || m.type === "video")) : [];
23237
+ const forwarded = isRecord5(item.forwardedFrom) && typeof item.forwardedFrom.name === "string" ? { name: item.forwardedFrom.name, ...str6(item.forwardedFrom.url) ? { url: item.forwardedFrom.url } : {} } : void 0;
23238
+ const channel2 = str6(item.channel) ?? "";
23239
+ out.push({
23240
+ id: item.id,
23241
+ channel: channel2,
23242
+ postUrl: str6(item.postUrl) ?? str6(item.url) ?? (channel2 ? `https://t.me/${channel2}/${item.id}` : ""),
23243
+ text: item.text,
23244
+ ...str6(item.date) ? { date: item.date } : {},
23245
+ ...forwarded ? { forwardedFrom: forwarded } : {},
23246
+ media,
23247
+ ...str6(item.imageUrl) ? { imageUrl: item.imageUrl } : {},
23248
+ ...str6(item.views) ? { views: item.views } : {}
23249
+ });
23250
+ }
23251
+ return out;
23252
+ }
23253
+ function planFeedEmission(posts, since, limit, pageMaxId) {
23254
+ const cap = Math.max(1, Math.min(TELEGRAM_FEED_LIMIT_MAX, Math.floor(Number.isFinite(limit) ? limit : TELEGRAM_FEED_DEFAULT_LIMIT) || 1));
23255
+ const byId = /* @__PURE__ */ new Map();
23256
+ for (const post of posts) byId.set(post.id, post);
23257
+ const sorted = [...byId.values()].sort((a, b) => a.id - b.id);
23258
+ if (since === void 0) {
23259
+ const emitted2 = sorted.slice(-cap);
23260
+ return { emitted: emitted2, latestId: sorted.length > 0 ? sorted[sorted.length - 1].id : void 0 };
23261
+ }
23262
+ const fresh = sorted.filter((p) => p.id > since);
23263
+ const emitted = fresh.slice(0, cap);
23264
+ if (emitted.length > 0) return { emitted, latestId: emitted[emitted.length - 1].id };
23265
+ const pastUnreadable = pageMaxId !== void 0 && Number.isFinite(pageMaxId) && pageMaxId > since;
23266
+ return { emitted, latestId: pastUnreadable ? pageMaxId : since };
23267
+ }
23268
+
23269
+ // src/ugc-run-state.ts
23270
+ var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"]);
23271
+ var UGC_NODE_RUN_STATE_KEYS = {
23272
+ "ugc-creator": ["result", "keepResult", "ugcOutputs"],
23273
+ "ugc-script": ["result", "keepResult", "ugcOutputs"],
23274
+ "ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
23275
+ "ugc-clip": ["warnings", "rerender", "__listResults", "__listResultMeta", "clipWarnings", "durationSec", "ugcOutputs"],
23276
+ "ugc-cards": ["result", "ugcOutputs"]
23277
+ };
23278
+ var UGC_OVERRIDABLE_FIELDS = {
23279
+ "ugc-creator": ["source", "gender", "photoUrl"],
23280
+ "ugc-script": ["targetDurationSec"],
23281
+ "ugc-clips": [],
23282
+ "ugc-clip": [],
23283
+ "ugc-cards": []
23284
+ };
23285
+ var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
23286
+ function stripUgcRunState(nodes) {
23287
+ return nodes.map((node) => {
23288
+ const type = typeof node.type === "string" ? node.type : "";
23289
+ if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
23290
+ const data = { ...node.data };
23291
+ for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
23292
+ if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
23293
+ return { ...node, data };
23294
+ });
23295
+ }
23296
+ function findUgcLockedFields(nodes, inputOverrides) {
23297
+ if (!nodes || !inputOverrides) return [];
23298
+ const found = [];
23299
+ for (const node of nodes) {
23300
+ const type = node?.type;
23301
+ if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
23302
+ const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
23303
+ const fields = inputOverrides[node.id];
23304
+ if (!fields || typeof fields !== "object") continue;
23305
+ for (const field of Object.keys(fields)) {
23306
+ if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
23307
+ }
23308
+ }
23309
+ return found;
23310
+ }
23311
+
23312
+ // src/ugc-call-body.ts
23313
+ var pick = (a, from, to) => a[from] !== void 0 && a[from] !== null ? { [to]: a[from] } : {};
23314
+ function llmFields(a) {
23315
+ return {
23316
+ ...pick(a, "llmModel", "llmModel"),
23317
+ ...pick(a, "reasoning_effort", "reasoningEffort"),
23318
+ ...a.advanced_mode === true ? { advancedMode: true } : {},
23319
+ ...pick(a, "temperature", "temperature"),
23320
+ ...pick(a, "max_tokens", "maxTokens")
23321
+ };
23322
+ }
23323
+ function ugcCallToRouteBody(call, opts = {}) {
23324
+ const args = { ...call.args };
23325
+ if (call.imageArg) {
23326
+ if (!opts.image) return { error: `${call.tool} needs the previous step's image` };
23327
+ args[call.imageArg] = opts.image;
23328
+ }
23329
+ switch (call.tool) {
23330
+ case "generate_image":
23331
+ return {
23332
+ path: "/v1/generate-image",
23333
+ body: {
23334
+ ...pick(args, "prompt", "prompt"),
23335
+ ...pick(args, "model", "provider"),
23336
+ ...pick(args, "aspect_ratio", "aspectRatio"),
23337
+ ...pick(args, "resolution", "resolution"),
23338
+ ...pick(args, "quality", "quality"),
23339
+ ...pick(args, "negative_prompt", "negativePrompt")
23340
+ }
23341
+ };
23342
+ case "image_to_image":
23343
+ return {
23344
+ path: "/v1/image-to-image",
23345
+ body: {
23346
+ ...pick(args, "image_url", "imageUrl"),
23347
+ ...pick(args, "prompt", "prompt"),
23348
+ ...pick(args, "model", "provider"),
23349
+ ...pick(args, "resolution", "resolution"),
23350
+ ...pick(args, "quality", "quality"),
23351
+ ...pick(args, "strength", "strength"),
23352
+ ...pick(args, "aspect_ratio", "aspectRatio"),
23353
+ ...pick(args, "negative_prompt", "negativePrompt"),
23354
+ ...pick(args, "seed", "seed")
23355
+ }
23356
+ };
23357
+ case "image_to_text": {
23358
+ const image = opts.image ?? (typeof args.image_url === "string" ? args.image_url : void 0);
23359
+ if (!image) return { error: "image_to_text needs an image" };
23360
+ return {
23361
+ path: "/v1/image-to-text/describe",
23362
+ body: {
23363
+ imageUrl: image,
23364
+ ...pick(args, "detail_level", "detailLevel"),
23365
+ ...pick(args, "custom_prompt", "customPrompt"),
23366
+ ...llmFields(args)
23367
+ }
23368
+ };
23369
+ }
23370
+ default:
23371
+ return void 0;
23372
+ }
23373
+ }
23374
+
21448
23375
  exports.ACCESS_LEVELS = ACCESS_LEVELS;
21449
23376
  exports.ACTION_CARD_KINDS = ACTION_CARD_KINDS;
21450
23377
  exports.ACTIVE_SCENE_HELPERS = ACTIVE_SCENE_HELPERS;
@@ -21497,6 +23424,7 @@ exports.CAPTION_LOOKS = CAPTION_LOOKS;
21497
23424
  exports.CAPTION_LOOK_IDS = CAPTION_LOOK_IDS;
21498
23425
  exports.CAPTION_MAX_WORDS_PER_LINE_MAX = CAPTION_MAX_WORDS_PER_LINE_MAX;
21499
23426
  exports.CAPTION_MAX_WORDS_PER_LINE_MIN = CAPTION_MAX_WORDS_PER_LINE_MIN;
23427
+ exports.CAPTION_SEGMENT_SCHEMA_KEYS = CAPTION_SEGMENT_SCHEMA_KEYS;
21500
23428
  exports.CARD_OUTCOME_STATES = CARD_OUTCOME_STATES;
21501
23429
  exports.CATEGORY_DURATION_DEFAULTS = CATEGORY_DURATION_DEFAULTS;
21502
23430
  exports.CHARACTER_ASPECT_DEFAULTS = CHARACTER_ASPECT_DEFAULTS;
@@ -21527,6 +23455,25 @@ exports.CINEMATIC_MIN_LOOKS = CINEMATIC_MIN_LOOKS;
21527
23455
  exports.CINEMATIC_PROMPT_MAX = CINEMATIC_PROMPT_MAX;
21528
23456
  exports.CINEMATIC_RESERVE_IDS = CINEMATIC_RESERVE_IDS;
21529
23457
  exports.COLLABORATOR_ROLES = COLLABORATOR_ROLES;
23458
+ exports.COLLECTIONS_PAGE_DEFAULT = COLLECTIONS_PAGE_DEFAULT;
23459
+ exports.COLLECTIONS_PAGE_MAX = COLLECTIONS_PAGE_MAX;
23460
+ exports.COLLECTION_DEDUPE_KEY_MAX = COLLECTION_DEDUPE_KEY_MAX;
23461
+ exports.COLLECTION_DESCRIPTION_MAX = COLLECTION_DESCRIPTION_MAX;
23462
+ exports.COLLECTION_DIGEST_SEPARATOR = COLLECTION_DIGEST_SEPARATOR;
23463
+ exports.COLLECTION_EVICT_MAX_PER_WRITE = COLLECTION_EVICT_MAX_PER_WRITE;
23464
+ exports.COLLECTION_HEADLINE_MAX = COLLECTION_HEADLINE_MAX;
23465
+ exports.COLLECTION_IDEMPOTENCY_KEY_MAX = COLLECTION_IDEMPOTENCY_KEY_MAX;
23466
+ exports.COLLECTION_MEDIA_TYPES = COLLECTION_MEDIA_TYPES;
23467
+ exports.COLLECTION_NAME_MAX = COLLECTION_NAME_MAX;
23468
+ exports.COLLECTION_READ_LIMIT_MAX = COLLECTION_READ_LIMIT_MAX;
23469
+ exports.COLLECTION_READ_WINDOW_HOURS_MAX = COLLECTION_READ_WINDOW_HOURS_MAX;
23470
+ exports.COLLECTION_RECORD_FIELDS_BYTES_MAX = COLLECTION_RECORD_FIELDS_BYTES_MAX;
23471
+ exports.COLLECTION_RECORD_FIELDS_MAX = COLLECTION_RECORD_FIELDS_MAX;
23472
+ exports.COLLECTION_RECORD_MEDIA_MAX = COLLECTION_RECORD_MEDIA_MAX;
23473
+ exports.COLLECTION_RECORD_TEXT_MAX = COLLECTION_RECORD_TEXT_MAX;
23474
+ exports.COLLECTION_RECORD_TITLE_MAX = COLLECTION_RECORD_TITLE_MAX;
23475
+ exports.COLLECTION_RECORD_URL_MAX = COLLECTION_RECORD_URL_MAX;
23476
+ exports.COLLECTION_TIER_CAPS = COLLECTION_TIER_CAPS;
21530
23477
  exports.COLLECT_IN_HANDLE = COLLECT_IN_HANDLE;
21531
23478
  exports.COMBINE_TRANSITIONS = COMBINE_TRANSITIONS;
21532
23479
  exports.COMBINE_TRANSITION_GROUP_LABELS = COMBINE_TRANSITION_GROUP_LABELS;
@@ -21551,6 +23498,11 @@ exports.CONTENT_IDEAS_PER_CHARGE = CONTENT_IDEAS_PER_CHARGE;
21551
23498
  exports.CONTENT_RECIPE_IDEAS_CREDIT_IDS = CONTENT_RECIPE_IDEAS_CREDIT_IDS;
21552
23499
  exports.CONTENT_RECIPE_SOURCE_MAX = CONTENT_RECIPE_SOURCE_MAX;
21553
23500
  exports.CONTENT_TYPES_BY_PLATFORM = CONTENT_TYPES_BY_PLATFORM;
23501
+ exports.CONTINUATION_NOT_COMPLETED = CONTINUATION_NOT_COMPLETED;
23502
+ exports.CONTINUATION_NOT_FOUND = CONTINUATION_NOT_FOUND;
23503
+ exports.CONTINUATION_SUBSET_REQUIRED = CONTINUATION_SUBSET_REQUIRED;
23504
+ exports.CONTINUATION_VERSION_MISMATCH = CONTINUATION_VERSION_MISMATCH;
23505
+ exports.CONTINUATION_WORKFLOW_MISMATCH = CONTINUATION_WORKFLOW_MISMATCH;
21554
23506
  exports.CREATURE_ATTACH_COLUMNS = CREATURE_ATTACH_COLUMNS;
21555
23507
  exports.CREDIT_BASE_USD = CREDIT_BASE_USD;
21556
23508
  exports.CREDIT_ROUNDING_RESOLUTION = CREDIT_ROUNDING_RESOLUTION;
@@ -21565,6 +23517,7 @@ exports.DEFAULT_CARRIED_FRACTION = DEFAULT_CARRIED_FRACTION;
21565
23517
  exports.DEFAULT_CHARACTER_ANGLE_COUNT = DEFAULT_CHARACTER_ANGLE_COUNT;
21566
23518
  exports.DEFAULT_CHARACTER_EXPRESSION_COUNT = DEFAULT_CHARACTER_EXPRESSION_COUNT;
21567
23519
  exports.DEFAULT_CHARACTER_FACET = DEFAULT_CHARACTER_FACET;
23520
+ exports.DEFAULT_DIALOGUE_PROVIDER = DEFAULT_DIALOGUE_PROVIDER;
21568
23521
  exports.DEFAULT_FRAME_DELIVERY = DEFAULT_FRAME_DELIVERY;
21569
23522
  exports.DEFAULT_FRAME_FIT = DEFAULT_FRAME_FIT;
21570
23523
  exports.DEFAULT_LABEL_BY_SOURCE = DEFAULT_LABEL_BY_SOURCE;
@@ -21593,7 +23546,9 @@ exports.DEFAULT_VIDEO_PROVIDER = DEFAULT_VIDEO_PROVIDER;
21593
23546
  exports.DEFAULT_VOICE_CHANGER_MODEL = DEFAULT_VOICE_CHANGER_MODEL;
21594
23547
  exports.DEFAULT_VOICE_DESIGN_MODEL = DEFAULT_VOICE_DESIGN_MODEL;
21595
23548
  exports.DETAIL_VARIANTS = DETAIL_VARIANTS;
23549
+ exports.DIALOGUE_PROVIDERS = DIALOGUE_PROVIDERS;
21596
23550
  exports.DURATION_PRICED_PROVIDERS = DURATION_PRICED_PROVIDERS;
23551
+ exports.DYNAMIC_HANDLE_NODE_TYPES = DYNAMIC_HANDLE_NODE_TYPES;
21597
23552
  exports.DYNAMIC_PRODUCER_TYPES = DYNAMIC_PRODUCER_TYPES;
21598
23553
  exports.DetectionResultSchema = DetectionResultSchema;
21599
23554
  exports.EDITED_EDL_VERSION = EDITED_EDL_VERSION;
@@ -21633,6 +23588,7 @@ exports.EntityStateChangeEventSchema = EntityStateChangeEventSchema;
21633
23588
  exports.FACE_SWAP_PROVIDERS = FACE_SWAP_PROVIDERS;
21634
23589
  exports.FAL_LIP_SYNC_PROVIDERS = FAL_LIP_SYNC_PROVIDERS;
21635
23590
  exports.FAN_IN_TARGETS = FAN_IN_TARGETS;
23591
+ exports.FAN_OUT_ALL_OR_NOTHING_TYPES = FAN_OUT_ALL_OR_NOTHING_TYPES;
21636
23592
  exports.FAN_OUT_EACH_HANDLES = FAN_OUT_EACH_HANDLES;
21637
23593
  exports.FAN_OUT_EACH_TYPES = FAN_OUT_EACH_TYPES;
21638
23594
  exports.FEATURED_ENTITIES = FEATURED_ENTITIES;
@@ -21656,6 +23612,8 @@ exports.FURNITURE_SUBCATEGORY_ORDER = FURNITURE_SUBCATEGORY_ORDER;
21656
23612
  exports.FixContinuityInputSchema = FixContinuityInputSchema;
21657
23613
  exports.FixContinuityResultSchema = FixContinuityResultSchema;
21658
23614
  exports.GEMINI_OMNI_PROVIDERS = GEMINI_OMNI_PROVIDERS;
23615
+ exports.GEMINI_OMNI_VOICE_PRESETS = GEMINI_OMNI_VOICE_PRESETS;
23616
+ exports.GEMINI_OMNI_VOICE_PRESET_IDS = GEMINI_OMNI_VOICE_PRESET_IDS;
21659
23617
  exports.GENERATE_TEXT_DELIMITER = GENERATE_TEXT_DELIMITER;
21660
23618
  exports.GLOBAL_MAX_DURATION_SECONDS = GLOBAL_MAX_DURATION_SECONDS;
21661
23619
  exports.GRANTED_ACCESS = GRANTED_ACCESS;
@@ -21688,9 +23646,11 @@ exports.IMAGE_I2I_PROVIDERS = IMAGE_I2I_PROVIDERS;
21688
23646
  exports.IMAGE_MASK_MODE = IMAGE_MASK_MODE;
21689
23647
  exports.IMAGE_OVERLAY_BASE_CREDITS = IMAGE_OVERLAY_BASE_CREDITS;
21690
23648
  exports.IMAGE_OVERLAY_VARIANT_CREDITS = IMAGE_OVERLAY_VARIANT_CREDITS;
23649
+ exports.IMAGE_PRODUCER_TYPES = IMAGE_PRODUCER_TYPES;
21691
23650
  exports.IMAGE_PROMPT_MAX = IMAGE_PROMPT_MAX;
21692
23651
  exports.IMAGE_REF_TYPES = IMAGE_REF_TYPES;
21693
23652
  exports.IMAGE_TO_VIDEO_PROVIDERS = IMAGE_TO_VIDEO_PROVIDERS;
23653
+ exports.INPUT_FIELD_EXTRA_KEYS = INPUT_FIELD_EXTRA_KEYS;
21694
23654
  exports.INPUT_FIELD_MAP = INPUT_FIELD_MAP2;
21695
23655
  exports.INPUT_NODE_TYPES = INPUT_NODE_TYPES;
21696
23656
  exports.INSTAGRAM_ANALYSIS_CREDIT_ID = INSTAGRAM_ANALYSIS_CREDIT_ID;
@@ -21719,6 +23679,8 @@ exports.KINETIC_ONLY_CAPTION_LEVER_KEYS = KINETIC_ONLY_CAPTION_LEVER_KEYS;
21719
23679
  exports.LANGUAGES = LANGUAGES;
21720
23680
  exports.LEGACY_EXPOSED_FIELD_KEYS = LEGACY_EXPOSED_FIELD_KEYS;
21721
23681
  exports.LEGACY_LOTTIE_HOST_REMAP = LEGACY_LOTTIE_HOST_REMAP;
23682
+ exports.LEGACY_SOURCE_HANDLE_ALIASES = LEGACY_SOURCE_HANDLE_ALIASES;
23683
+ exports.LEGACY_TARGET_HANDLE_ALIASES = LEGACY_TARGET_HANDLE_ALIASES;
21722
23684
  exports.LEGACY_TEMPLATE_CATEGORIES = LEGACY_TEMPLATE_CATEGORIES;
21723
23685
  exports.LIP_SYNC_DURATION_BUCKETS = LIP_SYNC_DURATION_BUCKETS;
21724
23686
  exports.LIP_SYNC_MAX_AUDIO_SECONDS = LIP_SYNC_MAX_AUDIO_SECONDS;
@@ -21809,6 +23771,7 @@ exports.NODE_PRESET_EXPORT_KIND = NODE_PRESET_EXPORT_KIND;
21809
23771
  exports.NODE_REF_PATTERN = NODE_REF_PATTERN;
21810
23772
  exports.NON_EN_LOCALE_IDS = NON_EN_LOCALE_IDS;
21811
23773
  exports.NON_PROMPT_TEXT_LANES = NON_PROMPT_TEXT_LANES;
23774
+ exports.NO_SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
21812
23775
  exports.NO_SPLIT_DELIMITER = NO_SPLIT_DELIMITER;
21813
23776
  exports.OAUTH_SCOPES = OAUTH_SCOPES;
21814
23777
  exports.OBJECT_ASPECT_DEFAULTS = OBJECT_ASPECT_DEFAULTS;
@@ -21836,6 +23799,7 @@ exports.OVERLAY_PLATFORM_IDS = OVERLAY_PLATFORM_IDS;
21836
23799
  exports.OVERLAY_SHAPES = OVERLAY_SHAPES;
21837
23800
  exports.OVERLAY_TEXT_ALIGNS = OVERLAY_TEXT_ALIGNS;
21838
23801
  exports.OVERLAY_VARIANT_HANDLE_PREFIX = OVERLAY_VARIANT_HANDLE_PREFIX;
23802
+ exports.OWNER_ONLY_LISTING_RENDER_TYPES = OWNER_ONLY_LISTING_RENDER_TYPES;
21839
23803
  exports.OWN_LIST_NODE_TYPES = OWN_LIST_NODE_TYPES;
21840
23804
  exports.ObjectMetadataSchema = ObjectMetadataSchema;
21841
23805
  exports.OptimizeForModelInputSchema = OptimizeForModelInputSchema;
@@ -21866,6 +23830,9 @@ exports.PRESET_EXCLUDED_KEYS = PRESET_EXCLUDED_KEYS;
21866
23830
  exports.PRESET_LABELS = PRESET_LABELS;
21867
23831
  exports.PRESET_LEVER_GROUPS = PRESET_LEVER_GROUPS;
21868
23832
  exports.PRESET_SETTING_KEYS = PRESET_SETTING_KEYS;
23833
+ exports.PREVIEW_RENDER_NESTED = PREVIEW_RENDER_NESTED;
23834
+ exports.PREVIEW_RENDER_NODE_TYPES = PREVIEW_RENDER_NODE_TYPES;
23835
+ exports.PREVIEW_REVIEW_REQUIRED = PREVIEW_REVIEW_REQUIRED;
21869
23836
  exports.PRICING_DEFAULT_DURATION_SEC = PRICING_DEFAULT_DURATION_SEC;
21870
23837
  exports.PRICING_DEFAULT_RESOLUTION = PRICING_DEFAULT_RESOLUTION;
21871
23838
  exports.PRO3D_RENDER_ASPECT_RATIOS = PRO3D_RENDER_ASPECT_RATIOS;
@@ -21914,18 +23881,27 @@ exports.REFERENCE_ROLE_PRESETS = REFERENCE_ROLE_PRESETS;
21914
23881
  exports.REF_HANDLE_CATEGORY = REF_HANDLE_CATEGORY;
21915
23882
  exports.REF_IMAGE_MAX_LIMITS = REF_IMAGE_MAX_LIMITS;
21916
23883
  exports.REF_TOKEN_NAMESPACE_PREFIXES = REF_TOKEN_NAMESPACE_PREFIXES;
23884
+ exports.RENDERED_OUTPUT_HANDLES = RENDERED_OUTPUT_HANDLES;
21917
23885
  exports.RENDERING_SPEED_SUPPORT = RENDERING_SPEED_SUPPORT;
23886
+ exports.RENDER_FINAL_CODES = RENDER_FINAL_CODES;
23887
+ exports.RENDER_FINAL_NODE_NOT_FOUND = RENDER_FINAL_NODE_NOT_FOUND;
23888
+ exports.RENDER_FINAL_NOT_A_RENDER = RENDER_FINAL_NOT_A_RENDER;
23889
+ exports.RENDER_NODE_TYPES = RENDER_NODE_TYPES;
23890
+ exports.RENDER_NODE_TYPE_IDS = RENDER_NODE_TYPE_IDS;
21918
23891
  exports.RENDER_VIDEO_CREDIT_ID = RENDER_VIDEO_CREDIT_ID;
21919
23892
  exports.REPEATABLE_NODE_TYPES = REPEATABLE_NODE_TYPES;
21920
23893
  exports.REPEAT_PLACEHOLDER = REPEAT_PLACEHOLDER;
21921
23894
  exports.REPLICATE_LIP_SYNC_PROVIDERS = REPLICATE_LIP_SYNC_PROVIDERS;
21922
23895
  exports.RESERVED_TEMPLATE_VARS = RESERVED_TEMPLATE_VARS;
23896
+ exports.RUN_CONTINUATION_CODES = RUN_CONTINUATION_CODES;
23897
+ exports.RUN_OVERRIDE_CLEARED_FIELDS = RUN_OVERRIDE_CLEARED_FIELDS;
21923
23898
  exports.SAVED_POSTS_LOOKUP_MAX = SAVED_POSTS_LOOKUP_MAX;
21924
23899
  exports.SAVED_POSTS_PAGE_MAX = SAVED_POSTS_PAGE_MAX;
21925
23900
  exports.SAVED_POST_MAX_TAGS = SAVED_POST_MAX_TAGS;
21926
23901
  exports.SAVED_POST_NOTE_MAX = SAVED_POST_NOTE_MAX;
21927
23902
  exports.SAVED_POST_SOURCES = SAVED_POST_SOURCES;
21928
23903
  exports.SAVED_POST_TAG_MAX = SAVED_POST_TAG_MAX;
23904
+ exports.SAVED_RENDER_STAMPS = SAVED_RENDER_STAMPS;
21929
23905
  exports.SCENE3D_ASSERTION_RESTORED_CODE = SCENE3D_ASSERTION_RESTORED_CODE;
21930
23906
  exports.SCENE3D_ASSET_KINDS = SCENE3D_ASSET_KINDS;
21931
23907
  exports.SCENE3D_ASSET_ROLES = SCENE3D_ASSET_ROLES;
@@ -22040,6 +24016,14 @@ exports.SPEAKER_LAYOUTS = SPEAKER_LAYOUTS;
22040
24016
  exports.SPEAKER_LAYOUT_IDS = SPEAKER_LAYOUT_IDS;
22041
24017
  exports.SPEAKER_SWITCHES = SPEAKER_SWITCHES;
22042
24018
  exports.SPEAKER_SWITCH_IDS = SPEAKER_SWITCH_IDS;
24019
+ exports.SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE = SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE;
24020
+ exports.SPEAKER_TRACKS_MAX_BYTES = SPEAKER_TRACKS_MAX_BYTES;
24021
+ exports.SPEAKER_TRACKS_VERSION = SPEAKER_TRACKS_VERSION;
24022
+ exports.SPEAKER_TRACK_ATTRIBUTION_METHODS = SPEAKER_TRACK_ATTRIBUTION_METHODS;
24023
+ exports.SPEECH_FLOOR_UNITS = SPEECH_FLOOR_UNITS;
24024
+ exports.SPEECH_PRICE_UNIT_CHARS = SPEECH_PRICE_UNIT_CHARS;
24025
+ exports.SPEECH_UNIT_CREDIT_SUFFIX = SPEECH_UNIT_CREDIT_SUFFIX;
24026
+ exports.SPEECH_UNIT_PRICE_NOTE = SPEECH_UNIT_PRICE_NOTE;
22043
24027
  exports.STAGE_PATCH_SCHEMA = STAGE_PATCH_SCHEMA;
22044
24028
  exports.STATIC_CAPTION_STYLES = STATIC_CAPTION_STYLES;
22045
24029
  exports.STRUCTURAL_SECTIONS = STRUCTURAL_SECTIONS;
@@ -22098,6 +24082,11 @@ exports.TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE = TELEGRAM_ACCOUNT_TRIGGER_MESSA
22098
24082
  exports.TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE = TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE;
22099
24083
  exports.TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES = TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES;
22100
24084
  exports.TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS = TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS;
24085
+ exports.TELEGRAM_FEED_DEFAULT_LIMIT = TELEGRAM_FEED_DEFAULT_LIMIT;
24086
+ exports.TELEGRAM_FEED_DIGEST_SEPARATOR = TELEGRAM_FEED_DIGEST_SEPARATOR;
24087
+ exports.TELEGRAM_FEED_LIMIT_MAX = TELEGRAM_FEED_LIMIT_MAX;
24088
+ exports.TELEGRAM_FEED_PAGE_SIZE = TELEGRAM_FEED_PAGE_SIZE;
24089
+ exports.TELEGRAM_FEED_PEEK_MAX = TELEGRAM_FEED_PEEK_MAX;
22101
24090
  exports.TELEGRAM_SEND_AS = TELEGRAM_SEND_AS;
22102
24091
  exports.TELEGRAM_SEND_DESTINATIONS = TELEGRAM_SEND_DESTINATIONS;
22103
24092
  exports.TELEGRAM_TRIGGER_NODE_TYPE = TELEGRAM_TRIGGER_NODE_TYPE;
@@ -22116,11 +24105,15 @@ exports.TRANSCRIBE_PROVIDERS = TRANSCRIBE_PROVIDERS;
22116
24105
  exports.TRANSCRIBE_PROVIDER_CAPABILITIES = TRANSCRIBE_PROVIDER_CAPABILITIES;
22117
24106
  exports.TRANSIENT_RUNTIME_KEYS = TRANSIENT_RUNTIME_KEYS;
22118
24107
  exports.TTS_FALLBACK_PROVIDER = TTS_FALLBACK_PROVIDER;
24108
+ exports.TTS_NEIGHBOUR_TEXT_MAX_CHARS = TTS_NEIGHBOUR_TEXT_MAX_CHARS;
22119
24109
  exports.TTS_PROVIDERS = TTS_PROVIDERS;
22120
24110
  exports.TTS_PROVIDER_ALIASES = TTS_PROVIDER_ALIASES;
22121
24111
  exports.TTS_TEXT_MAX = TTS_TEXT_MAX;
22122
24112
  exports.TWO_K_RESOLUTION_PROVIDERS = TWO_K_RESOLUTION_PROVIDERS;
22123
24113
  exports.TransitionTypeSchema = TransitionTypeSchema;
24114
+ exports.UGC_NODE_RUN_STATE_KEYS = UGC_NODE_RUN_STATE_KEYS;
24115
+ exports.UGC_NODE_TYPES = UGC_NODE_TYPES;
24116
+ exports.UGC_OVERRIDABLE_FIELDS = UGC_OVERRIDABLE_FIELDS;
22124
24117
  exports.UPSCALE_IMAGE_PROVIDERS = UPSCALE_IMAGE_PROVIDERS;
22125
24118
  exports.USAGE_GROUP_BYS = USAGE_GROUP_BYS;
22126
24119
  exports.USAGE_MODES = USAGE_MODES;
@@ -22159,6 +24152,11 @@ exports.VIDEO_ANALYSIS_VISUAL_EFFECTS = VIDEO_ANALYSIS_VISUAL_EFFECTS;
22159
24152
  exports.VIDEO_ANALYSIS_WINDOW = VIDEO_ANALYSIS_WINDOW;
22160
24153
  exports.VIDEO_AUDIO_CAPABILITY = VIDEO_AUDIO_CAPABILITY;
22161
24154
  exports.VIDEO_AUDIT_BUCKET_CREDITS = VIDEO_AUDIT_BUCKET_CREDITS;
24155
+ exports.VIDEO_CHARACTER_DESCRIPTION_MAX = VIDEO_CHARACTER_DESCRIPTION_MAX;
24156
+ exports.VIDEO_CHARACTER_NAME_MAX = VIDEO_CHARACTER_NAME_MAX;
24157
+ exports.VIDEO_CHARACTER_REFS_WIRE_MAX = VIDEO_CHARACTER_REFS_WIRE_MAX;
24158
+ exports.VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX;
24159
+ exports.VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = VIDEO_CHARACTER_VOICE_EXAMPLE_MAX;
22162
24160
  exports.VIDEO_CLIP_CREDITS = VIDEO_CLIP_CREDITS;
22163
24161
  exports.VIDEO_CRITIC_CREDITS_PER_SHOT = VIDEO_CRITIC_CREDITS_PER_SHOT;
22164
24162
  exports.VIDEO_CRITIC_FRAME_MODES = VIDEO_CRITIC_FRAME_MODES;
@@ -22291,10 +24289,17 @@ exports.cameraSwitchEdlProblem = cameraSwitchEdlProblem;
22291
24289
  exports.cameraSwitchSettingsPayload = cameraSwitchSettingsPayload;
22292
24290
  exports.canonicalExposedFieldKey = canonicalExposedFieldKey;
22293
24291
  exports.canonicalScene3DPlanV2Json = canonicalScene3DPlanV2Json;
24292
+ exports.canonicalSourceHandle = canonicalSourceHandle;
24293
+ exports.canonicalTargetHandle = canonicalTargetHandle;
22294
24294
  exports.canonicalTtsProvider = canonicalTtsProvider;
22295
24295
  exports.canonicalVarName = canonicalVarName;
22296
24296
  exports.canonicalizeOverrideKeys = canonicalizeOverrideKeys;
24297
+ exports.captionFontWeightSchema = captionFontWeightSchema;
24298
+ exports.captionInputSchema = captionInputSchema;
24299
+ exports.captionPlanBodyLevers = captionPlanBodyLevers;
24300
+ exports.captionPlanPassThrough = captionPlanPassThrough;
22297
24301
  exports.captionRoutesToRemotion = captionRoutesToRemotion;
24302
+ exports.captionSegmentInputSchema = captionSegmentInputSchema;
22298
24303
  exports.centreCropToAspect = centreCropToAspect;
22299
24304
  exports.characterBoardItems = characterBoardItems;
22300
24305
  exports.characterBucketDisplayRank = characterBucketDisplayRank;
@@ -22305,6 +24310,7 @@ exports.characterVariantAssetArrays = characterVariantAssetArrays;
22305
24310
  exports.checkRefVideoDurations = checkRefVideoDurations;
22306
24311
  exports.cinematicCreditId = cinematicCreditId;
22307
24312
  exports.clampCameraSwitchSetting = clampCameraSwitchSetting;
24313
+ exports.clampChars = clampChars;
22308
24314
  exports.clampCinematicDuration = clampCinematicDuration;
22309
24315
  exports.clampContentIdeasCount = clampContentIdeasCount;
22310
24316
  exports.clampEditPlanClipCount = clampEditPlanClipCount;
@@ -22312,6 +24318,7 @@ exports.clampInstagramFeaturedIndex = clampInstagramFeaturedIndex;
22312
24318
  exports.clampMetaAdsFeaturedIndex = clampMetaAdsFeaturedIndex;
22313
24319
  exports.clampSmartCutWindow = clampSmartCutWindow;
22314
24320
  exports.classifyCreativeFormat = classifyCreativeFormat;
24321
+ exports.classifyLegacyTargetHandle = classifyLegacyTargetHandle;
22315
24322
  exports.classifyRefToken = classifyRefToken;
22316
24323
  exports.cleanOrphanedItems = cleanOrphanedItems;
22317
24324
  exports.cleanSpeakerNames = cleanSpeakerNames;
@@ -22319,8 +24326,14 @@ exports.clearImageCriticMetadata = clearImageCriticMetadata;
22319
24326
  exports.clearVideoCriticMetadata = clearVideoCriticMetadata;
22320
24327
  exports.clearWiredVideoOverlayImageUrls = clearWiredVideoOverlayImageUrls;
22321
24328
  exports.clipLookSchema = clipLookSchema;
24329
+ exports.clipNotesFrom = clipNotesFrom;
22322
24330
  exports.collectAncestorRefs = collectAncestorRefs;
24331
+ exports.collectionCapsForTier = collectionCapsForTier;
24332
+ exports.collectionReadSince = collectionReadSince;
24333
+ exports.collectionRecordHeadline = collectionRecordHeadline;
24334
+ exports.collectionRecordsDigest = collectionRecordsDigest;
22323
24335
  exports.combineSameLabelRefs = combineSameLabelRefs;
24336
+ exports.combineVideosPassThrough = combineVideosPassThrough;
22324
24337
  exports.compactWithRows = compactWithRows;
22325
24338
  exports.competitorScanCreditId = competitorScanCreditId;
22326
24339
  exports.competitorScanCredits = competitorScanCredits;
@@ -22332,6 +24345,7 @@ exports.connectedSettingsSources = connectedSettingsSources;
22332
24345
  exports.contentIdeasCreditFeature = contentIdeasCreditFeature;
22333
24346
  exports.contentIdeasCreditId = contentIdeasCreditId;
22334
24347
  exports.contentRecipeCreditId = contentRecipeCreditId;
24348
+ exports.countEmptyInputSkips = countEmptyInputSkips;
22335
24349
  exports.countRefModalityEdges = countRefModalityEdges;
22336
24350
  exports.creditRangesAll = creditRangesAll;
22337
24351
  exports.creditsToUsd = creditsToUsd;
@@ -22350,16 +24364,25 @@ exports.describeEdgeBehavior = describeEdgeBehavior;
22350
24364
  exports.describeMaskRegion = describeMaskRegion;
22351
24365
  exports.describeNodeAdjustments = describeNodeAdjustments;
22352
24366
  exports.describeSlotControl = describeSlotControl;
24367
+ exports.describeSpeakerTracks = describeSpeakerTracks;
22353
24368
  exports.detectVideoLinkPlatform = detectVideoLinkPlatform;
24369
+ exports.dialogueHasLever = dialogueHasLever;
24370
+ exports.dialogueProviderOf = dialogueProviderOf;
24371
+ exports.dialogueStabilityAccepted = dialogueStabilityAccepted;
24372
+ exports.dialogueSupportsTimestamps = dialogueSupportsTimestamps;
22354
24373
  exports.dropUnknownBindings = dropUnknownBindings;
22355
24374
  exports.dropUnknownSpeakers = dropUnknownSpeakers;
22356
24375
  exports.durationsByMode = durationsByMode;
22357
24376
  exports.editPlanBasis = editPlanBasis;
22358
24377
  exports.editPlanBucketMinutes = editPlanBucketMinutes;
24378
+ exports.editPlanResultPatch = editPlanResultPatch;
22359
24379
  exports.editPlanSavedOutput = editPlanSavedOutput;
22360
24380
  exports.editPlanSourceDurationSec = editPlanSourceDurationSec;
22361
24381
  exports.editPlanTranscriptOrigin = editPlanTranscriptOrigin;
22362
24382
  exports.edlDurationMs = edlDurationMs;
24383
+ exports.edlSegmentOutputStarts = edlSegmentOutputStarts;
24384
+ exports.edlSpanKey = edlSpanKey;
24385
+ exports.edlSpeakerSpace = edlSpeakerSpace;
22363
24386
  exports.effectiveContentModel = effectiveContentModel;
22364
24387
  exports.effectiveReasoningEffort = effectiveReasoningEffort;
22365
24388
  exports.encodeProviderItem = encodeProviderItem;
@@ -22381,6 +24404,7 @@ exports.evaluateCondition = evaluateCondition;
22381
24404
  exports.evaluateConditionGroup = evaluateConditionGroup;
22382
24405
  exports.evaluateJsonExpression = evaluateJsonExpression;
22383
24406
  exports.evaluateJsonPath = evaluateJsonPath;
24407
+ exports.executionOutcome = executionOutcome;
22384
24408
  exports.expandExtraRefsToConnectedReferences = expandExtraRefsToConnectedReferences;
22385
24409
  exports.expandItemsWithRepeat = expandItemsWithRepeat;
22386
24410
  exports.expandVideoOverlayLayer = expandVideoOverlayLayer;
@@ -22391,19 +24415,26 @@ exports.extractGeneratedJsonAsList = extractGeneratedJsonAsList;
22391
24415
  exports.extractPresetData = extractPresetData;
22392
24416
  exports.extractReferencedLabels = extractReferencedLabels;
22393
24417
  exports.extractVideoDurationFromNode = extractVideoDurationFromNode;
24418
+ exports.fanOutItemMeta = fanOutItemMeta;
22394
24419
  exports.fanOutTextFeedsPrompt = fanOutTextFeedsPrompt;
24420
+ exports.fanOutUrlItemIsText = fanOutUrlItemIsText;
22395
24421
  exports.featuredInstagramOutputs = featuredInstagramOutputs;
22396
24422
  exports.featuredMetaAdOutputs = featuredMetaAdOutputs;
22397
24423
  exports.fieldKeyFromHandle = fieldKeyFromHandle;
22398
24424
  exports.filterCloneNodes = filterCloneNodes;
22399
24425
  exports.findCharacterMentionTokens = findCharacterMentionTokens;
24426
+ exports.findDialogueCapabilities = findDialogueCapabilities;
22400
24427
  exports.findEntityMentionTokens = findEntityMentionTokens;
22401
24428
  exports.findImageMentionTokens = findImageMentionTokens;
22402
24429
  exports.findLocationMentionTokens = findLocationMentionTokens;
24430
+ exports.findRestrictedPickerValue = findRestrictedPickerValue;
22403
24431
  exports.findSeedance2AudioOverLimit = findSeedance2AudioOverLimit;
24432
+ exports.findSegmentOverlap = findSegmentOverlap;
24433
+ exports.findUgcLockedFields = findUgcLockedFields;
22404
24434
  exports.findWordlessTranscriptFeeds = findWordlessTranscriptFeeds;
22405
24435
  exports.firstSightExtraRole = firstSightExtraRole;
22406
24436
  exports.fitAspectRatioToModel = fitAspectRatioToModel;
24437
+ exports.fitCollectionField = fitCollectionField;
22407
24438
  exports.flattenItems = flattenItems;
22408
24439
  exports.formatVideoOverlayError = formatVideoOverlayError;
22409
24440
  exports.getAnimal = getAnimal;
@@ -22415,11 +24446,13 @@ exports.getAudioCrossfadeCurve = getAudioCrossfadeCurve;
22415
24446
  exports.getCharacterFacet = getCharacterFacet;
22416
24447
  exports.getCombineTransition = getCombineTransition;
22417
24448
  exports.getCreditRange = getCreditRange;
24449
+ exports.getDialogueCapabilities = getDialogueCapabilities;
22418
24450
  exports.getDurationsForModel = getDurationsForModel;
22419
24451
  exports.getEffectiveRepeatCount = getEffectiveRepeatCount;
22420
24452
  exports.getFeaturedEntities = getFeaturedEntities;
22421
24453
  exports.getFurniture = getFurniture;
22422
24454
  exports.getFurnitureLabel = getFurnitureLabel;
24455
+ exports.getInputFieldExtraKeys = getInputFieldExtraKeys;
22423
24456
  exports.getInputFieldSchema = getInputFieldSchema;
22424
24457
  exports.getInputNodes = getInputNodes;
22425
24458
  exports.getItemSortId = getItemSortId;
@@ -22463,6 +24496,7 @@ exports.hasDrawableVideoOverlayBox = hasDrawableVideoOverlayBox;
22463
24496
  exports.hasFeature = hasFeature;
22464
24497
  exports.hasUrlParserHazard = hasUrlParserHazard;
22465
24498
  exports.hexToRgbaArray = hexToRgbaArray;
24499
+ exports.holdsPreviewRender = holdsPreviewRender;
22466
24500
  exports.hostnameMatchesAllowlist = hostnameMatchesAllowlist;
22467
24501
  exports.humanizeSlotSid = humanizeSlotSid;
22468
24502
  exports.imageMentionSlug = imageMentionSlug;
@@ -22471,6 +24505,7 @@ exports.imageOverlayBillableVariants = imageOverlayBillableVariants;
22471
24505
  exports.imageOverlayCredits = imageOverlayCredits;
22472
24506
  exports.imageReferenceLimit = imageReferenceLimit;
22473
24507
  exports.inferMusicVideo = inferMusicVideo;
24508
+ exports.ingestRecordFromJson = ingestRecordFromJson;
22474
24509
  exports.instagramAnalysisCreditId = instagramAnalysisCreditId;
22475
24510
  exports.instagramAnalysisTierFrom = instagramAnalysisTierFrom;
22476
24511
  exports.instagramPostLink = instagramPostLink;
@@ -22483,6 +24518,8 @@ exports.isAggregateableType = isAggregateableType;
22483
24518
  exports.isAutoVideoDuration = isAutoVideoDuration;
22484
24519
  exports.isCharacterAspectRatio = isCharacterAspectRatio;
22485
24520
  exports.isCollectInEdge = isCollectInEdge;
24521
+ exports.isCollectionMedia = isCollectionMedia;
24522
+ exports.isCollectionUrl = isCollectionUrl;
22486
24523
  exports.isCompetitorAboutPlatform = isCompetitorAboutPlatform;
22487
24524
  exports.isCronExpression = isCronExpression;
22488
24525
  exports.isDefaultSelectorConfig = isDefaultSelectorConfig;
@@ -22518,6 +24555,7 @@ exports.isPro3DRenderJobOutput = isPro3DRenderJobOutput;
22518
24555
  exports.isPro3DRenderQuote = isPro3DRenderQuote;
22519
24556
  exports.isPro3DRenderRenderOnly = isPro3DRenderRenderOnly;
22520
24557
  exports.isProjectedTriggerNodeType = isProjectedTriggerNodeType;
24558
+ exports.isRenderNodeType = isRenderNodeType;
22521
24559
  exports.isRtlText = isRtlText;
22522
24560
  exports.isScene3DAuthoringEngine = isScene3DAuthoringEngine;
22523
24561
  exports.isScene3DCameraTrack = isScene3DCameraTrack;
@@ -22601,7 +24639,11 @@ exports.newScene3DRevisionId = newScene3DRevisionId;
22601
24639
  exports.nextScheduleRuns = nextScheduleRuns;
22602
24640
  exports.nodeFeedsAnything = nodeFeedsAnything;
22603
24641
  exports.nodeStateMayCarryOutput = nodeStateMayCarryOutput;
24642
+ exports.nonBlankCaptionText = nonBlankCaptionText;
22604
24643
  exports.normalizeCaptionNumericLevers = normalizeCaptionNumericLevers;
24644
+ exports.normalizeCollectionFields = normalizeCollectionFields;
24645
+ exports.normalizeCollectionMedia = normalizeCollectionMedia;
24646
+ exports.normalizeDedupeKey = normalizeDedupeKey;
22605
24647
  exports.normalizeEdl = normalizeEdl;
22606
24648
  exports.normalizeLottieLayers = normalizeLottieLayers;
22607
24649
  exports.normalizeMinimaxH3Resolution = normalizeMinimaxH3Resolution;
@@ -22612,12 +24654,16 @@ exports.normalizeRoleSlug = normalizeRoleSlug;
22612
24654
  exports.normalizeSavedPostTags = normalizeSavedPostTags;
22613
24655
  exports.normalizeScheduleRule = normalizeScheduleRule;
22614
24656
  exports.normalizeScheduleRules = normalizeScheduleRules;
24657
+ exports.normalizeSpeakerTrackSetDescriptor = normalizeSpeakerTrackSetDescriptor;
24658
+ exports.normalizeSpeakerTracks = normalizeSpeakerTracks;
22615
24659
  exports.normalizeTemplateCategory = normalizeTemplateCategory;
22616
24660
  exports.normalizeTranscript = normalizeTranscript;
24661
+ exports.normalizeTtsNeighbourText = normalizeTtsNeighbourText;
22617
24662
  exports.normalizeVideoOverlayNodes = normalizeVideoOverlayNodes;
22618
24663
  exports.normalizeVideoRequestParams = normalizeVideoRequestParams;
22619
24664
  exports.normalizeWan3Resolution = normalizeWan3Resolution;
22620
24665
  exports.orderedLlmModels = orderedLlmModels;
24666
+ exports.outputMsToMasterMs = outputMsToMasterMs;
22621
24667
  exports.overlayFontById = overlayFontById;
22622
24668
  exports.overlayImageEffectsSchema = overlayImageEffectsSchema;
22623
24669
  exports.overlayPlatformById = overlayPlatformById;
@@ -22631,7 +24677,9 @@ exports.overlayVariantIdFromHandle = overlayVariantIdFromHandle;
22631
24677
  exports.ownsItsList = ownsItsList;
22632
24678
  exports.parseAspectToken = parseAspectToken;
22633
24679
  exports.parseAttributedDialogue = parseAttributedDialogue;
24680
+ exports.parseCaptionPlan = parseCaptionPlan;
22634
24681
  exports.parseCharacterMentionToken = parseCharacterMentionToken;
24682
+ exports.parseEditPlanMode = parseEditPlanMode;
22635
24683
  exports.parseEntityMentionToken = parseEntityMentionToken;
22636
24684
  exports.parseGroupHandle = parseGroupHandle;
22637
24685
  exports.parseHandleId = parseHandleId;
@@ -22643,13 +24691,17 @@ exports.parseNodeRef = parseNodeRef;
22643
24691
  exports.parseScene3DCameraTrackJson = parseScene3DCameraTrackJson;
22644
24692
  exports.parseScene3DPlanV2Json = parseScene3DPlanV2Json;
22645
24693
  exports.parseSpeakerEmphasisStyle = parseSpeakerEmphasisStyle;
24694
+ exports.parseVideoOverlayLayerPlan = parseVideoOverlayLayerPlan;
22646
24695
  exports.pickAiAvatarBucket = pickAiAvatarBucket;
24696
+ exports.pickHeldRow = pickHeldRow;
22647
24697
  exports.pickIds = pickIds;
22648
24698
  exports.pickLipSyncBucket = pickLipSyncBucket;
22649
24699
  exports.pickSocialPosts = pickSocialPosts;
22650
24700
  exports.pickSwitchXFrameTier = pickSwitchXFrameTier;
22651
24701
  exports.pickVideoAnalysisBucket = pickVideoAnalysisBucket;
24702
+ exports.planClipKeyAt = planClipKeyAt;
22652
24703
  exports.planFanOut = planFanOut;
24704
+ exports.planFeedEmission = planFeedEmission;
22653
24705
  exports.planSheetGeneration = planSheetGeneration;
22654
24706
  exports.planSheetPanels = planSheetPanels;
22655
24707
  exports.preferredInputModeForModel = preferredInputModeForModel;
@@ -22658,7 +24710,9 @@ exports.presetApplyClearKeys = presetApplyClearKeys;
22658
24710
  exports.presetDataMatches = presetDataMatches;
22659
24711
  exports.presetEntries = presetEntries;
22660
24712
  exports.presetLeverClearKeys = presetLeverClearKeys;
24713
+ exports.previewGatedNodeIds = previewGatedNodeIds;
22661
24714
  exports.previewHorizonMs = previewHorizonMs;
24715
+ exports.previewStops = previewStops;
22662
24716
  exports.pricedOutputDurationSec = pricedOutputDurationSec;
22663
24717
  exports.pricedVideoSelection = pricedVideoSelection;
22664
24718
  exports.pro3DRenderCoreOutputSchema = pro3DRenderCoreOutputSchema;
@@ -22682,7 +24736,24 @@ exports.registerSidecarLoaders = registerSidecarLoaders;
22682
24736
  exports.remapMsThroughEdl = remapMsThroughEdl;
22683
24737
  exports.remapTranscriptThroughEdl = remapTranscriptThroughEdl;
22684
24738
  exports.renderAnalyzedScene = renderAnalyzedScene;
24739
+ exports.renderClipKey = renderClipKey;
24740
+ exports.renderNodeOf = renderNodeOf;
24741
+ exports.renderPlanBasis = renderPlanBasis;
24742
+ exports.renderPlanClipKey = renderPlanClipKey;
24743
+ exports.renderPlanNodeId = renderPlanNodeId;
24744
+ exports.renderPlanPath = renderPlanPath;
24745
+ exports.renderPlanRowClipKeys = renderPlanRowClipKeys;
24746
+ exports.renderPlanValue = renderPlanValue;
24747
+ exports.renderReadBasis = renderReadBasis;
24748
+ exports.renderResultStamp = renderResultStamp;
24749
+ exports.renderRunQuality = renderRunQuality;
24750
+ exports.renderSentRowStamps = renderSentRowStamps;
24751
+ exports.renderSettingsBasis = renderSettingsBasis;
22685
24752
  exports.renderVideoCreditId = renderVideoCreditId;
24753
+ exports.renderedSourceHandle = renderedSourceHandle;
24754
+ exports.rendersAsPreview = rendersAsPreview;
24755
+ exports.rendersLatestBatch = rendersLatestBatch;
24756
+ exports.rendersTranscriptJson = rendersTranscriptJson;
22686
24757
  exports.requiresSequenceExecution = requiresSequenceExecution;
22687
24758
  exports.resetCatalogSidecars = resetCatalogSidecars;
22688
24759
  exports.resolutionOptionsByKind = resolutionOptionsByKind;
@@ -22752,6 +24823,9 @@ exports.ruleMatches = ruleMatches;
22752
24823
  exports.runSelector = runSelector;
22753
24824
  exports.safetyRetryPolicy = safetyRetryPolicy;
22754
24825
  exports.sanitizeRole = sanitizeRole;
24826
+ exports.savedRenderBatch = savedRenderBatch;
24827
+ exports.savedRenderBatchUrls = savedRenderBatchUrls;
24828
+ exports.savedRenderOutput = savedRenderOutput;
22755
24829
  exports.scaleVec3Schema = scaleVec3Schema;
22756
24830
  exports.scene3DAcceptedSchemaVersionsSchema = scene3DAcceptedSchemaVersionsSchema;
22757
24831
  exports.scene3DAnchorNameSchema = scene3DAnchorNameSchema;
@@ -22875,6 +24949,9 @@ exports.speakerLayoutAllows = speakerLayoutAllows;
22875
24949
  exports.speakerPresentationWarnings = speakerPresentationWarnings;
22876
24950
  exports.speakerSwitchOverlaps = speakerSwitchOverlaps;
22877
24951
  exports.speakerTurns = speakerTurns;
24952
+ exports.speechCredits = speechCredits;
24953
+ exports.speechPriceUnits = speechPriceUnits;
24954
+ exports.speechUnitCreditId = speechUnitCreditId;
22878
24955
  exports.speedRampCreditId = speedRampCreditId;
22879
24956
  exports.spliceDelimitedRows = spliceDelimitedRows;
22880
24957
  exports.splitByLoopDelimiter = splitByLoopDelimiter;
@@ -22891,7 +24968,9 @@ exports.stripStudioDraftWorkflow = stripStudioDraftWorkflow;
22891
24968
  exports.stripStudioTakeVoiceRecords = stripStudioTakeVoiceRecords;
22892
24969
  exports.stripStudioTransientSettings = stripStudioTransientSettings;
22893
24970
  exports.stripTransientRuntimeData = stripTransientRuntimeData;
24971
+ exports.stripUgcRunState = stripUgcRunState;
22894
24972
  exports.stripUnownedRefs = stripUnownedRefs;
24973
+ exports.styleCaptionPlan = styleCaptionPlan;
22895
24974
  exports.summarizeScene3DOperations = summarizeScene3DOperations;
22896
24975
  exports.sunoCreditType = sunoCreditType;
22897
24976
  exports.sunoModelHonoursDuration = sunoModelHonoursDuration;
@@ -22902,6 +24981,8 @@ exports.supportsEndAnchor = supportsEndAnchor;
22902
24981
  exports.supportsExtendRender = supportsExtendRender;
22903
24982
  exports.telegramAccountListeningSignature = telegramAccountListeningSignature;
22904
24983
  exports.telegramAccountTriggerOutputs = telegramAccountTriggerOutputs;
24984
+ exports.telegramFeedDigest = telegramFeedDigest;
24985
+ exports.telegramPostsFrom = telegramPostsFrom;
22905
24986
  exports.telegramSendAsOf = telegramSendAsOf;
22906
24987
  exports.telegramSendDestinationOf = telegramSendDestinationOf;
22907
24988
  exports.templateCategoryStoredValues = templateCategoryStoredValues;
@@ -22922,6 +25003,9 @@ exports.ttsHasLever = ttsHasLever;
22922
25003
  exports.ttsLanguageCodes = ttsLanguageCodes;
22923
25004
  exports.ttsSupportsAudioTags = ttsSupportsAudioTags;
22924
25005
  exports.ttsSupportsSsmlBreaks = ttsSupportsSsmlBreaks;
25006
+ exports.ttsSupportsStitching = ttsSupportsStitching;
25007
+ exports.ttsSupportsTimestamps = ttsSupportsTimestamps;
25008
+ exports.ugcCallToRouteBody = ugcCallToRouteBody;
22925
25009
  exports.uiAspectRatioFill = uiAspectRatioFill;
22926
25010
  exports.uiDurationFill = uiDurationFill;
22927
25011
  exports.uiResolutionFill = uiResolutionFill;
@@ -22943,6 +25027,8 @@ exports.validateModelInput = validateModelInput;
22943
25027
  exports.validateNoNestedGroups = validateNoNestedGroups;
22944
25028
  exports.validateObjects = validateObjects;
22945
25029
  exports.validateProviderForNodeType = validateProviderForNodeType;
25030
+ exports.validateSpeakerTrackSetDescriptor = validateSpeakerTrackSetDescriptor;
25031
+ exports.validateSpeakerTracks = validateSpeakerTracks;
22946
25032
  exports.validateSubWorkflowRoutes = validateSubWorkflowRoutes;
22947
25033
  exports.validateVideoOverlayRequest = validateVideoOverlayRequest;
22948
25034
  exports.variantJobId = variantJobId;
@@ -22952,6 +25038,14 @@ exports.videoAnalysisCreditSegment = videoAnalysisCreditSegment;
22952
25038
  exports.videoAnalysisNumWindows = videoAnalysisNumWindows;
22953
25039
  exports.videoAnalysisResultSchema = videoAnalysisResultSchema;
22954
25040
  exports.videoAuditCreditsForBucket = videoAuditCreditsForBucket;
25041
+ exports.videoCharacterDistinctVoices = videoCharacterDistinctVoices;
25042
+ exports.videoCharacterRefCap = videoCharacterRefCap;
25043
+ exports.videoCharacterRefProblem = videoCharacterRefProblem;
25044
+ exports.videoCharacterRefProviders = videoCharacterRefProviders;
25045
+ exports.videoCharacterRefUnits = videoCharacterRefUnits;
25046
+ exports.videoCharacterVoiceCap = videoCharacterVoiceCap;
25047
+ exports.videoCharacterVoiceKey = videoCharacterVoiceKey;
25048
+ exports.videoCharacterVoiceProblem = videoCharacterVoiceProblem;
22955
25049
  exports.videoLinkDownloadedFile = videoLinkDownloadedFile;
22956
25050
  exports.videoLinkNeedsDownload = videoLinkNeedsDownload;
22957
25051
  exports.videoLinkPageUrl = videoLinkPageUrl;
@@ -22961,6 +25055,7 @@ exports.videoNegativeSuffix = videoNegativeSuffix;
22961
25055
  exports.videoOverlayCanvas = videoOverlayCanvas;
22962
25056
  exports.videoOverlayCompositionKey = videoOverlayCompositionKey;
22963
25057
  exports.videoOverlayLayerLabel = videoOverlayLayerLabel;
25058
+ exports.videoOverlayPassThrough = videoOverlayPassThrough;
22964
25059
  exports.videoOverlayPresetBox = videoOverlayPresetBox;
22965
25060
  exports.videoOverlayRenderOrder = videoOverlayRenderOrder;
22966
25061
  exports.videoOverlaySlotOfHandle = videoOverlaySlotOfHandle;
@@ -22969,6 +25064,7 @@ exports.videoProviderFoldsLoneEndFrame = videoProviderFoldsLoneEndFrame;
22969
25064
  exports.videoProviderRequiresImage = videoProviderRequiresImage;
22970
25065
  exports.videoSfxCreditId = videoSfxCreditId;
22971
25066
  exports.windowAnalysisSchema = windowAnalysisSchema;
25067
+ exports.withRunOverrides = withRunOverrides;
22972
25068
  exports.withWiredSettings = withWiredSettings;
22973
25069
  exports.zipMergeLists = zipMergeLists;
22974
25070
  //# sourceMappingURL=index.cjs.map