@nodaro/shared 3.21.0 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2284 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1915 -75
- package/dist/index.d.ts +1915 -75
- package/dist/index.js +2117 -196
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/add-captions-plan.test.ts +33 -0
- package/src/__tests__/caption-plan-parse.test.ts +23 -0
- package/src/__tests__/caption-segment-schema.test.ts +30 -0
- package/src/__tests__/collections.test.ts +253 -0
- package/src/__tests__/dialogue-capabilities.test.ts +157 -0
- package/src/__tests__/edit-plan-review.test.ts +70 -0
- package/src/__tests__/edl-clocks.test.ts +97 -0
- package/src/__tests__/edl.test.ts +34 -0
- package/src/__tests__/execution-outcome.test.ts +44 -0
- package/src/__tests__/fan-out-meta.test.ts +23 -0
- package/src/__tests__/fan-out-rows.test.ts +36 -0
- package/src/__tests__/fan-out-url-item.test.ts +44 -0
- package/src/__tests__/fixtures/speaker-tracks.fixtures.json +622 -0
- package/src/__tests__/input-field-extra-keys.test.ts +34 -0
- package/src/__tests__/list-consumers-fan-in.test.ts +40 -0
- package/src/__tests__/model-tree.test.ts +7 -0
- package/src/__tests__/node-pass-through.test.ts +23 -0
- package/src/__tests__/node-runtime-keys.test.ts +1 -0
- package/src/__tests__/picker-restrictions.test.ts +36 -0
- package/src/__tests__/preview-gate.test.ts +305 -0
- package/src/__tests__/render-basis.test.ts +176 -0
- package/src/__tests__/render-nodes.test.ts +73 -0
- package/src/__tests__/render-output.test.ts +392 -0
- package/src/__tests__/run-continuation.test.ts +32 -0
- package/src/__tests__/speaker-tracks.test.ts +474 -0
- package/src/__tests__/speech-pricing.test.ts +69 -0
- package/src/__tests__/telegram-channel.test.ts +91 -0
- package/src/__tests__/tts-capabilities.test.ts +81 -4
- package/src/__tests__/tts-neighbour-text.test.ts +19 -0
- package/src/__tests__/ugc-call-body.test.ts +38 -0
- package/src/__tests__/ugc-run-state.test.ts +68 -0
- package/src/__tests__/video-character-refs.test.ts +213 -0
- package/src/__tests__/video-overlay-layer-plan.test.ts +94 -0
- package/src/add-captions-plan.ts +50 -0
- package/src/caption-plan.ts +45 -0
- package/src/caption-segment-schema.ts +82 -0
- package/src/collections.ts +462 -0
- package/src/competitors.ts +77 -0
- package/src/credit-estimators/index.ts +9 -0
- package/src/credit-estimators/speech.ts +51 -0
- package/src/dialogue-capabilities.ts +48 -0
- package/src/edit-plan-contract.ts +20 -9
- package/src/edit-plan-review.ts +40 -1
- package/src/edl.ts +27 -1
- package/src/execution-outcome.ts +41 -0
- package/src/fan-out-meta.ts +23 -0
- package/src/fan-out-rows.ts +74 -5
- package/src/gemini-omni-voices.ts +59 -0
- package/src/handle-aliases.ts +295 -0
- package/src/i18n/camera-motions.pt-BR.ts +14 -14
- package/src/i18n/transitions.pt-BR.ts +13 -13
- package/src/index.ts +179 -1
- package/src/model-catalog.ts +122 -13
- package/src/model-constants.ts +24 -4
- package/src/model-tree.ts +5 -1
- package/src/node-execution-state.ts +13 -0
- package/src/node-mappable-fields.ts +7 -1
- package/src/node-pass-through.ts +37 -0
- package/src/node-runtime-keys.ts +14 -0
- package/src/picker-restrictions.ts +49 -0
- package/src/presentation-types.ts +26 -2
- package/src/presentation-utils.ts +25 -7
- package/src/preview-gate.ts +279 -0
- package/src/producer-types.ts +58 -0
- package/src/render-final.ts +20 -0
- package/src/render-nodes.ts +92 -0
- package/src/render-output.ts +565 -0
- package/src/run-continuation.ts +39 -0
- package/src/speaker-tracks.ts +638 -0
- package/src/telegram-channel.ts +140 -0
- package/src/transcribe-preflight.ts +8 -4
- package/src/tts-capabilities.ts +19 -5
- package/src/tts-neighbour-text.ts +46 -0
- package/src/ugc-call-body.ts +86 -0
- package/src/ugc-run-state.ts +64 -0
- package/src/video-character-refs.ts +233 -0
- package/src/video-overlay.ts +78 -21
package/dist/index.js
CHANGED
|
@@ -51,6 +51,7 @@ function isAutoVideoDuration(duration) {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// src/model-catalog.ts
|
|
54
|
+
var SPEECH_UNIT_PRICE_NOTE = "per started 100 characters, at least 8 units \u2014 where length pricing is on";
|
|
54
55
|
var MODEL_RECOMMENDATIONS = [
|
|
55
56
|
// image
|
|
56
57
|
{ 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." },
|
|
@@ -2286,6 +2287,7 @@ var TTS_LANGS_V3 = [
|
|
|
2286
2287
|
"sw"
|
|
2287
2288
|
];
|
|
2288
2289
|
var TTS_LEVERS_V2 = ["stability", "similarity", "style", "speed", "speakerBoost"];
|
|
2290
|
+
var DIALOGUE_V4_MAX_CHARS = 5e3;
|
|
2289
2291
|
var AUDIO_MODELS = {
|
|
2290
2292
|
// ── ElevenLabs TTS ──
|
|
2291
2293
|
"elevenlabs-v3": {
|
|
@@ -2298,12 +2300,19 @@ var AUDIO_MODELS = {
|
|
|
2298
2300
|
description: "Expressive ElevenLabs TTS \u2014 supports [audio tags] for emotion / pacing. Direct API.",
|
|
2299
2301
|
useCases: ["tts", "voice-over", "narration", "expressive"],
|
|
2300
2302
|
features: ["audio-tags", "voice-cloning"],
|
|
2301
|
-
pricing: [
|
|
2303
|
+
pricing: [
|
|
2304
|
+
{ identifier: "elevenlabs-v3", credits: 30 },
|
|
2305
|
+
{ identifier: "elevenlabs-v3:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2306
|
+
],
|
|
2302
2307
|
tts: {
|
|
2303
2308
|
audioTags: true,
|
|
2304
2309
|
ssmlBreaks: false,
|
|
2305
2310
|
levers: ["stability"],
|
|
2306
2311
|
languageCode: true,
|
|
2312
|
+
timestamps: true,
|
|
2313
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2314
|
+
// Rejects previous_text / next_text with a 400 (probed 2026-10-04).
|
|
2315
|
+
stitching: false,
|
|
2307
2316
|
maxChars: 5e3,
|
|
2308
2317
|
// official cap (probed: 5,200 chars accepted; keep the clamp)
|
|
2309
2318
|
languages: TTS_LANGS_V3
|
|
@@ -2319,7 +2328,10 @@ var AUDIO_MODELS = {
|
|
|
2319
2328
|
description: "Newest ElevenLabs TTS \u2014 [audio tags], stability and similarity control, up to 10,000 characters per request. Direct API.",
|
|
2320
2329
|
useCases: ["tts", "voice-over", "narration", "expressive", "long-form"],
|
|
2321
2330
|
features: ["audio-tags", "voice-cloning"],
|
|
2322
|
-
pricing: [
|
|
2331
|
+
pricing: [
|
|
2332
|
+
{ identifier: "elevenlabs-v4", credits: 30 },
|
|
2333
|
+
{ identifier: "elevenlabs-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2334
|
+
],
|
|
2323
2335
|
// The default speech model (DEFAULT_TTS_PROVIDER) carries the star.
|
|
2324
2336
|
featured: true,
|
|
2325
2337
|
tts: {
|
|
@@ -2327,6 +2339,10 @@ var AUDIO_MODELS = {
|
|
|
2327
2339
|
ssmlBreaks: false,
|
|
2328
2340
|
levers: ["stability", "similarity"],
|
|
2329
2341
|
languageCode: true,
|
|
2342
|
+
timestamps: true,
|
|
2343
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2344
|
+
// Accepts previous_text / next_text (probed 2026-10-04).
|
|
2345
|
+
stitching: true,
|
|
2330
2346
|
maxChars: 1e4,
|
|
2331
2347
|
// The curated picker, the same 46 as v3. The model itself lists 85
|
|
2332
2348
|
// (it adds e.g. Cantonese, Maltese, Mongolian, Burmese, Uzbek); widening
|
|
@@ -2343,12 +2359,21 @@ var AUDIO_MODELS = {
|
|
|
2343
2359
|
series: "ElevenLabs",
|
|
2344
2360
|
description: "Fast, cheap ElevenLabs TTS via the direct ElevenLabs API. Good for narration.",
|
|
2345
2361
|
useCases: ["tts", "narration", "fast"],
|
|
2346
|
-
|
|
2362
|
+
// The flat row carries no note (a "per 1K chars" note once described a
|
|
2363
|
+
// scaling that never existed; the minimum under length pricing is 8 units, 16).
|
|
2364
|
+
pricing: [
|
|
2365
|
+
{ identifier: "elevenlabs-turbo", credits: 15 },
|
|
2366
|
+
{ identifier: "elevenlabs-turbo:per-100-chars", credits: 2, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2367
|
+
],
|
|
2347
2368
|
tts: {
|
|
2348
2369
|
audioTags: false,
|
|
2349
2370
|
ssmlBreaks: true,
|
|
2350
2371
|
levers: TTS_LEVERS_V2,
|
|
2351
2372
|
languageCode: true,
|
|
2373
|
+
timestamps: true,
|
|
2374
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2375
|
+
// Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
|
|
2376
|
+
stitching: true,
|
|
2352
2377
|
maxChars: 4e4,
|
|
2353
2378
|
// == eleven_flash_v2_5 (functionally equivalent)
|
|
2354
2379
|
languages: TTS_LANGS_FLASH_V25
|
|
@@ -2363,13 +2388,21 @@ var AUDIO_MODELS = {
|
|
|
2363
2388
|
series: "ElevenLabs",
|
|
2364
2389
|
description: "Multi-language ElevenLabs TTS via the direct ElevenLabs API.",
|
|
2365
2390
|
useCases: ["tts", "multilingual"],
|
|
2366
|
-
|
|
2391
|
+
// The flat row carries no note (the old "per 1K chars" described a scaling that never existed).
|
|
2392
|
+
pricing: [
|
|
2393
|
+
{ identifier: "elevenlabs-multilingual", credits: 30 },
|
|
2394
|
+
{ identifier: "elevenlabs-multilingual:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2395
|
+
],
|
|
2367
2396
|
tts: {
|
|
2368
2397
|
audioTags: false,
|
|
2369
2398
|
ssmlBreaks: true,
|
|
2370
2399
|
levers: TTS_LEVERS_V2,
|
|
2371
2400
|
// The API reference: "This parameter is not supported for multilingual_v2 models."
|
|
2372
2401
|
languageCode: false,
|
|
2402
|
+
timestamps: true,
|
|
2403
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2404
|
+
// Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
|
|
2405
|
+
stitching: true,
|
|
2373
2406
|
maxChars: 1e4,
|
|
2374
2407
|
languages: TTS_LANGS_MULTILINGUAL_V2
|
|
2375
2408
|
}
|
|
@@ -2387,18 +2420,61 @@ var AUDIO_MODELS = {
|
|
|
2387
2420
|
description: "Multi-speaker dialogue via the direct ElevenLabs API \u2014 give it a script, it voices each role (any voice: premade, library, or cloned).",
|
|
2388
2421
|
useCases: ["tts", "dialogue", "multi-speaker"],
|
|
2389
2422
|
features: ["audio-tags", "voice-cloning"],
|
|
2390
|
-
|
|
2423
|
+
// Flat per request, whatever the length (decided 2026-10-06: the old
|
|
2424
|
+
// "per 1K chars" note described a scaling that never existed).
|
|
2425
|
+
pricing: [
|
|
2426
|
+
{ identifier: "elevenlabs-dialogue", credits: 25 },
|
|
2427
|
+
{ identifier: "elevenlabs-dialogue:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2428
|
+
],
|
|
2391
2429
|
tts: {
|
|
2392
2430
|
audioTags: true,
|
|
2393
2431
|
ssmlBreaks: false,
|
|
2394
2432
|
levers: ["stability"],
|
|
2433
|
+
// The dialogue route has offered exactly these three since it shipped
|
|
2434
|
+
// (routes/text-to-dialogue.ts). Kept as the platform's v3 dialogue contract.
|
|
2435
|
+
stabilitySteps: [0, 0.5, 1],
|
|
2395
2436
|
languageCode: true,
|
|
2437
|
+
timestamps: true,
|
|
2438
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2439
|
+
// The dialogue funnel does not read this field (its own lane; phase 2 declares
|
|
2440
|
+
// the v4 dialogue model's value). v3 underneath.
|
|
2441
|
+
stitching: false,
|
|
2396
2442
|
// Total across lines. The documented 2,000 is a recommendation, not a
|
|
2397
2443
|
// limit (2,500 and 5,000 both probed 200); capped like v3, the model underneath.
|
|
2398
2444
|
maxChars: 5e3,
|
|
2399
2445
|
languages: TTS_LANGS_V3
|
|
2400
2446
|
}
|
|
2401
2447
|
},
|
|
2448
|
+
"elevenlabs-dialogue-v4": {
|
|
2449
|
+
id: "elevenlabs-dialogue-v4",
|
|
2450
|
+
kind: "audio",
|
|
2451
|
+
// Its own mode, never "tts" — the same reason as v3 dialogue above.
|
|
2452
|
+
modes: ["dialogue"],
|
|
2453
|
+
family: "ElevenLabs",
|
|
2454
|
+
label: "ElevenLabs Dialogue v4",
|
|
2455
|
+
series: "ElevenLabs",
|
|
2456
|
+
description: "Multi-speaker dialogue on ElevenLabs v4 \u2014 [audio tags], stability and similarity control. Direct API.",
|
|
2457
|
+
useCases: ["tts", "dialogue", "multi-speaker"],
|
|
2458
|
+
features: ["audio-tags", "voice-cloning"],
|
|
2459
|
+
// Flat per request, the same as v3 dialogue (decided 2026-10-06).
|
|
2460
|
+
pricing: [
|
|
2461
|
+
{ identifier: "elevenlabs-dialogue-v4", credits: 25 },
|
|
2462
|
+
{ identifier: "elevenlabs-dialogue-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2463
|
+
],
|
|
2464
|
+
tts: {
|
|
2465
|
+
audioTags: true,
|
|
2466
|
+
ssmlBreaks: false,
|
|
2467
|
+
levers: ["stability", "similarity"],
|
|
2468
|
+
languageCode: true,
|
|
2469
|
+
timestamps: true,
|
|
2470
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2471
|
+
// Dialogue models never stitch neighbour text (the funnel does not read this).
|
|
2472
|
+
stitching: false,
|
|
2473
|
+
maxChars: DIALOGUE_V4_MAX_CHARS,
|
|
2474
|
+
// The curated picker, v3's 46 (v4 lists 85; widening is its own change).
|
|
2475
|
+
languages: TTS_LANGS_V3
|
|
2476
|
+
}
|
|
2477
|
+
},
|
|
2402
2478
|
// ── ElevenLabs voice utilities ──
|
|
2403
2479
|
// (voice cloning was retired platform-wide on 2026-09-15 — no catalog entry,
|
|
2404
2480
|
// no price, no MCP tool; existing clones still resolve as TTS voice ids.)
|
|
@@ -3746,6 +3822,8 @@ var TTS_PROVIDERS = [
|
|
|
3746
3822
|
"elevenlabs-multilingual",
|
|
3747
3823
|
"elevenlabs"
|
|
3748
3824
|
];
|
|
3825
|
+
var DIALOGUE_PROVIDERS = ["elevenlabs-dialogue", "elevenlabs-dialogue-v4"];
|
|
3826
|
+
var DEFAULT_DIALOGUE_PROVIDER = "elevenlabs-dialogue";
|
|
3749
3827
|
var DEFAULT_TTS_PROVIDER = "elevenlabs-v4";
|
|
3750
3828
|
var TEXT_TO_AUDIO_PROVIDERS = [
|
|
3751
3829
|
// Replicate disabled
|
|
@@ -4136,10 +4214,16 @@ var VIDEO_REF_LIMITS_BY_PROVIDER = {
|
|
|
4136
4214
|
"wan-3": { images: 10, videos: 5, audio: 5 },
|
|
4137
4215
|
"wan-3-prime": { images: 10, videos: 5, audio: 5 },
|
|
4138
4216
|
// Multi-image reference providers.
|
|
4139
|
-
|
|
4217
|
+
// `characters` = the dedicated identity input (KIE `character_ids`, max 3).
|
|
4218
|
+
// It is NOT an image-reference lane: it draws from the SAME 7-unit budget as
|
|
4219
|
+
// `images` (images + 2×videos + character units ≤ 7) — see
|
|
4220
|
+
// `video-character-refs.ts`, the one place that budget is computed.
|
|
4221
|
+
// `voices` = distinct audio personas per task (`audio_ids`, max 3). NOT part
|
|
4222
|
+
// of the 7-unit quota: audio ids are a separate input.
|
|
4223
|
+
"gemini-omni-video": { images: 7, videos: 1, characters: 3, voices: 3 },
|
|
4140
4224
|
// Gemini Omni Flash 1.1 — identical quota to the pro sibling
|
|
4141
4225
|
// (images + 2×videos + character_ids ≤ 7).
|
|
4142
|
-
"gemini-omni-flash": { images: 7, videos: 1 },
|
|
4226
|
+
"gemini-omni-flash": { images: 7, videos: 1, characters: 3, voices: 3 },
|
|
4143
4227
|
"kling-3-omni": { images: 7 },
|
|
4144
4228
|
// catalog/docs: "end frame + up to 7 reference images"
|
|
4145
4229
|
"grok-i2v": { images: 7 },
|
|
@@ -4320,7 +4404,9 @@ var VIDEO_AUDIO_CAPABILITY = {
|
|
|
4320
4404
|
// - NOT audio_driven either: "Uploading audio references is unsupported in
|
|
4321
4405
|
// the current version of the API", and "any audio in a video reference is
|
|
4322
4406
|
// ignored" — there is no reference-audio transport to be driven by, and
|
|
4323
|
-
// runGeminiOmni
|
|
4407
|
+
// runGeminiOmni sends `audio_ids` ONLY for a
|
|
4408
|
+
// character's pinned voice persona (a preset voice, never a recording), which
|
|
4409
|
+
// is not a reference-audio transport and leaves the mode `ambient`.
|
|
4324
4410
|
// Audio is priced into the per-tier rate, so NOT cost-affecting.
|
|
4325
4411
|
"gemini-omni-video": { mode: "ambient", alwaysOn: true },
|
|
4326
4412
|
"gemini-omni-flash": { mode: "ambient", alwaysOn: true }
|
|
@@ -4922,6 +5008,134 @@ function getFeaturedEntities(type) {
|
|
|
4922
5008
|
return FEATURED_ENTITIES[type] ?? [];
|
|
4923
5009
|
}
|
|
4924
5010
|
|
|
5011
|
+
// src/video-character-refs.ts
|
|
5012
|
+
var VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(
|
|
5013
|
+
0,
|
|
5014
|
+
...Object.values(VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0)
|
|
5015
|
+
);
|
|
5016
|
+
var VIDEO_CHARACTER_DESCRIPTION_MAX = 2e3;
|
|
5017
|
+
var VIDEO_CHARACTER_NAME_MAX = 100;
|
|
5018
|
+
var VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2e3;
|
|
5019
|
+
var VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
|
|
5020
|
+
function videoCharacterRefCap(provider) {
|
|
5021
|
+
return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0 : 0;
|
|
5022
|
+
}
|
|
5023
|
+
function videoCharacterVoiceCap(provider) {
|
|
5024
|
+
return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0 : 0;
|
|
5025
|
+
}
|
|
5026
|
+
function videoCharacterVoiceKey(ref) {
|
|
5027
|
+
const voice = ref.voice;
|
|
5028
|
+
if (!voice) return null;
|
|
5029
|
+
return JSON.stringify([voice.preset, voice.description?.trim() ?? "", voice.exampleLine?.trim() ?? "", ref.name?.trim() ?? ""]);
|
|
5030
|
+
}
|
|
5031
|
+
function videoCharacterDistinctVoices(characterReferences) {
|
|
5032
|
+
const keys = /* @__PURE__ */ new Set();
|
|
5033
|
+
for (const c of characterReferences ?? []) {
|
|
5034
|
+
const key = videoCharacterVoiceKey(c);
|
|
5035
|
+
if (key) keys.add(key);
|
|
5036
|
+
}
|
|
5037
|
+
return keys.size;
|
|
5038
|
+
}
|
|
5039
|
+
function videoCharacterRefProviders() {
|
|
5040
|
+
return Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => (l?.characters ?? 0) > 0).map(([id]) => id);
|
|
5041
|
+
}
|
|
5042
|
+
function videoCharacterRefUnits(characterReferences) {
|
|
5043
|
+
let units = 0;
|
|
5044
|
+
for (const c of characterReferences ?? []) units += c.bodyImageUrl ? 2 : 1;
|
|
5045
|
+
return units;
|
|
5046
|
+
}
|
|
5047
|
+
function videoCharacterVoiceProblem(args) {
|
|
5048
|
+
const distinct = videoCharacterDistinctVoices(args.characterReferences);
|
|
5049
|
+
if (distinct === 0) return null;
|
|
5050
|
+
const cap = args.cap ?? videoCharacterVoiceCap(args.provider);
|
|
5051
|
+
if (cap === 0) {
|
|
5052
|
+
return {
|
|
5053
|
+
code: "character_voice_unsupported",
|
|
5054
|
+
message: `A character voice is not supported by ${args.provider ?? "the selected model"}. Drop the voice, or pick a model that takes characterReferences.`
|
|
5055
|
+
};
|
|
5056
|
+
}
|
|
5057
|
+
if (distinct > cap) {
|
|
5058
|
+
return {
|
|
5059
|
+
code: "character_voices_over_limit",
|
|
5060
|
+
message: `${args.provider} accepts at most ${cap} distinct character voices per video; got ${distinct}. Give some characters the same voice, or drop some.`
|
|
5061
|
+
};
|
|
5062
|
+
}
|
|
5063
|
+
return null;
|
|
5064
|
+
}
|
|
5065
|
+
function videoCharacterRefProblem(args) {
|
|
5066
|
+
const { provider, characterReferences } = args;
|
|
5067
|
+
if (!characterReferences || characterReferences.length === 0) return null;
|
|
5068
|
+
const cap = videoCharacterRefCap(provider);
|
|
5069
|
+
if (cap === 0) {
|
|
5070
|
+
return {
|
|
5071
|
+
code: "character_references_unsupported",
|
|
5072
|
+
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.`
|
|
5073
|
+
};
|
|
5074
|
+
}
|
|
5075
|
+
if (characterReferences.length > cap) {
|
|
5076
|
+
return {
|
|
5077
|
+
code: "character_references_over_limit",
|
|
5078
|
+
message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`
|
|
5079
|
+
};
|
|
5080
|
+
}
|
|
5081
|
+
if (args.hasStartFrame) {
|
|
5082
|
+
return {
|
|
5083
|
+
code: "character_references_with_start_frame",
|
|
5084
|
+
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.`
|
|
5085
|
+
};
|
|
5086
|
+
}
|
|
5087
|
+
if (args.hasEndFrame) {
|
|
5088
|
+
return {
|
|
5089
|
+
code: "character_references_with_end_frame",
|
|
5090
|
+
message: `${provider} does not use an end frame (endFrameUrl) together with characterReferences. Drop the end frame, or drop characterReferences.`
|
|
5091
|
+
};
|
|
5092
|
+
}
|
|
5093
|
+
const budget = VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.images ?? 7;
|
|
5094
|
+
const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences);
|
|
5095
|
+
if (used > budget) {
|
|
5096
|
+
return {
|
|
5097
|
+
code: "character_references_quota",
|
|
5098
|
+
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.`
|
|
5099
|
+
};
|
|
5100
|
+
}
|
|
5101
|
+
return videoCharacterVoiceProblem({ provider, characterReferences });
|
|
5102
|
+
}
|
|
5103
|
+
|
|
5104
|
+
// src/gemini-omni-voices.ts
|
|
5105
|
+
var GEMINI_OMNI_VOICE_PRESETS = [
|
|
5106
|
+
{ id: "achernar", gender: "female", style: "soft", pitch: "high" },
|
|
5107
|
+
{ id: "achird", gender: "male", style: "friendly", pitch: "mid" },
|
|
5108
|
+
{ id: "algenib", gender: "male", style: "raspy", pitch: "low" },
|
|
5109
|
+
{ id: "algieba", gender: "male", style: "easygoing", pitch: "mid-low" },
|
|
5110
|
+
{ id: "alnilam", gender: "male", style: "steady", pitch: "mid-low" },
|
|
5111
|
+
{ id: "aoede", gender: "female", style: "brisk", pitch: "mid" },
|
|
5112
|
+
{ id: "autonoe", gender: "female", style: "bright", pitch: "mid" },
|
|
5113
|
+
{ id: "callirrhoe", gender: "female", style: "easygoing", pitch: "mid" },
|
|
5114
|
+
{ id: "charon", gender: "male", style: "intellectual", pitch: "low" },
|
|
5115
|
+
{ id: "despina", gender: "female", style: "smooth", pitch: "mid" },
|
|
5116
|
+
{ id: "enceladus", gender: "male", style: "breathy", pitch: "low" },
|
|
5117
|
+
{ id: "erinome", gender: "female", style: "clear", pitch: "mid" },
|
|
5118
|
+
{ id: "fenrir", gender: "male", style: "lively", pitch: "younger" },
|
|
5119
|
+
{ id: "gacrux", gender: "female", style: "mature", pitch: "mid" },
|
|
5120
|
+
{ id: "iapetus", gender: "male", style: "clear", pitch: "mid-low" },
|
|
5121
|
+
{ id: "kore", gender: "female", style: "capable", pitch: "mid" },
|
|
5122
|
+
{ id: "laomedeia", gender: "female", style: "cheerful", pitch: "mid-high" },
|
|
5123
|
+
{ id: "leda", gender: "female", style: "young", pitch: "mid-high" },
|
|
5124
|
+
{ id: "orus", gender: "male", style: "steady", pitch: "mid-low" },
|
|
5125
|
+
{ id: "puck", gender: "male", style: "cheerful", pitch: "mid" },
|
|
5126
|
+
{ id: "pulcherrima", gender: "genderless", style: "forward", pitch: "mid-high" },
|
|
5127
|
+
{ id: "rasalgethi", gender: "male", style: "intellectual", pitch: "mid" },
|
|
5128
|
+
{ id: "sadachbia", gender: "male", style: "vivid", pitch: "low" },
|
|
5129
|
+
{ id: "sadaltager", gender: "male", style: "knowledgeable", pitch: "mid" },
|
|
5130
|
+
{ id: "schedar", gender: "male", style: "smooth", pitch: "mid-low" },
|
|
5131
|
+
{ id: "sulafat", gender: "female", style: "warm", pitch: "mid" },
|
|
5132
|
+
{ id: "umbriel", gender: "male", style: "smooth", pitch: "low" },
|
|
5133
|
+
{ id: "vindemiatrix", gender: "female", style: "gentle", pitch: "mid" },
|
|
5134
|
+
{ id: "zephyr", gender: "female", style: "bright", pitch: "mid-high" },
|
|
5135
|
+
{ id: "zubenelgenubi", gender: "male", style: "casual", pitch: "mid-low" }
|
|
5136
|
+
];
|
|
5137
|
+
var GEMINI_OMNI_VOICE_PRESET_IDS = GEMINI_OMNI_VOICE_PRESETS.map((v) => v.id);
|
|
5138
|
+
|
|
4925
5139
|
// src/inpaint-region.ts
|
|
4926
5140
|
function band(center) {
|
|
4927
5141
|
if (center < 1 / 3) return "low";
|
|
@@ -4931,10 +5145,10 @@ function band(center) {
|
|
|
4931
5145
|
var VERT = { low: "upper", mid: "middle", high: "lower" };
|
|
4932
5146
|
var HORZ = { low: "left", mid: "center", high: "right" };
|
|
4933
5147
|
function describeMaskRegion(box, image) {
|
|
4934
|
-
const
|
|
5148
|
+
const clamp014 = (n) => Math.max(0, Math.min(1, n));
|
|
4935
5149
|
const round2 = (n) => Math.round(n * 100) / 100;
|
|
4936
|
-
const nx =
|
|
4937
|
-
const ny =
|
|
5150
|
+
const nx = clamp014(box.x / image.width);
|
|
5151
|
+
const ny = clamp014(box.y / image.height);
|
|
4938
5152
|
const normBbox = {
|
|
4939
5153
|
x: round2(nx),
|
|
4940
5154
|
y: round2(ny),
|
|
@@ -5147,20 +5361,20 @@ function buildCreditModelIdentifier(provider, quality, resolution, renderingSpee
|
|
|
5147
5361
|
return provider;
|
|
5148
5362
|
}
|
|
5149
5363
|
function resolveNormalizedImageGen(opts) {
|
|
5150
|
-
const
|
|
5151
|
-
const provider =
|
|
5364
|
+
const str7 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
5365
|
+
const provider = str7(opts.provider) ?? "nano-banana";
|
|
5152
5366
|
const modelId = opts.swapToI2i && opts.refCount > 0 ? T2I_TO_I2I_VARIANT[provider] ?? provider : provider;
|
|
5153
5367
|
const n = normalizeModelInput(modelId, {
|
|
5154
|
-
aspectRatio:
|
|
5155
|
-
resolution:
|
|
5156
|
-
quality:
|
|
5368
|
+
aspectRatio: str7(opts.aspectRatio),
|
|
5369
|
+
resolution: str7(opts.resolution),
|
|
5370
|
+
quality: str7(opts.quality)
|
|
5157
5371
|
});
|
|
5158
5372
|
return {
|
|
5159
5373
|
identifier: buildCreditModelIdentifier(
|
|
5160
5374
|
modelId,
|
|
5161
5375
|
n.quality,
|
|
5162
5376
|
n.resolution,
|
|
5163
|
-
|
|
5377
|
+
str7(opts.renderingSpeed),
|
|
5164
5378
|
void 0,
|
|
5165
5379
|
opts.refCount
|
|
5166
5380
|
),
|
|
@@ -5541,6 +5755,58 @@ function ltxRetakeDurationSec(raw) {
|
|
|
5541
5755
|
return Math.max(LTX_RETAKE_MIN_DURATION_SEC, n);
|
|
5542
5756
|
}
|
|
5543
5757
|
|
|
5758
|
+
// src/tts-capabilities.ts
|
|
5759
|
+
var TTS_PROVIDER_ALIASES = {
|
|
5760
|
+
elevenlabs: "elevenlabs-turbo"
|
|
5761
|
+
};
|
|
5762
|
+
var TTS_FALLBACK_PROVIDER = "elevenlabs-turbo";
|
|
5763
|
+
function canonicalTtsProvider(provider) {
|
|
5764
|
+
return typeof provider === "string" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider] : provider;
|
|
5765
|
+
}
|
|
5766
|
+
function findTtsCapabilities(provider) {
|
|
5767
|
+
if (typeof provider !== "string" || !provider) return void 0;
|
|
5768
|
+
const id = canonicalTtsProvider(provider);
|
|
5769
|
+
if (!Object.hasOwn(MODEL_CATALOG, id)) return void 0;
|
|
5770
|
+
const entry = MODEL_CATALOG[id];
|
|
5771
|
+
return entry.modes.includes("tts") ? entry.tts : void 0;
|
|
5772
|
+
}
|
|
5773
|
+
function getTtsCapabilities(provider) {
|
|
5774
|
+
return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
|
|
5775
|
+
}
|
|
5776
|
+
function ttsSupportsAudioTags(provider) {
|
|
5777
|
+
return getTtsCapabilities(provider).audioTags;
|
|
5778
|
+
}
|
|
5779
|
+
function ttsSupportsSsmlBreaks(provider) {
|
|
5780
|
+
return getTtsCapabilities(provider).ssmlBreaks;
|
|
5781
|
+
}
|
|
5782
|
+
function ttsSupportsStitching(provider) {
|
|
5783
|
+
return getTtsCapabilities(provider).stitching;
|
|
5784
|
+
}
|
|
5785
|
+
function ttsHasLever(provider, lever) {
|
|
5786
|
+
return getTtsCapabilities(provider).levers.includes(lever);
|
|
5787
|
+
}
|
|
5788
|
+
function ttsSupportsTimestamps(provider) {
|
|
5789
|
+
return getTtsCapabilities(provider).timestamps;
|
|
5790
|
+
}
|
|
5791
|
+
function ttsLanguageCodes(provider) {
|
|
5792
|
+
return getTtsCapabilities(provider).languages;
|
|
5793
|
+
}
|
|
5794
|
+
|
|
5795
|
+
// src/credit-estimators/speech.ts
|
|
5796
|
+
var SPEECH_PRICE_UNIT_CHARS = 100;
|
|
5797
|
+
var SPEECH_FLOOR_UNITS = 8;
|
|
5798
|
+
var SPEECH_UNIT_CREDIT_SUFFIX = ":per-100-chars";
|
|
5799
|
+
function speechUnitCreditId(modelId) {
|
|
5800
|
+
return `${canonicalTtsProvider(modelId)}${SPEECH_UNIT_CREDIT_SUFFIX}`;
|
|
5801
|
+
}
|
|
5802
|
+
function speechPriceUnits(chars) {
|
|
5803
|
+
const started = Number.isFinite(chars) && chars > 0 ? Math.ceil(chars / SPEECH_PRICE_UNIT_CHARS) : 0;
|
|
5804
|
+
return Math.max(SPEECH_FLOOR_UNITS, started);
|
|
5805
|
+
}
|
|
5806
|
+
function speechCredits(chars, perUnitCredits) {
|
|
5807
|
+
return speechPriceUnits(chars) * perUnitCredits;
|
|
5808
|
+
}
|
|
5809
|
+
|
|
5544
5810
|
// src/video-duration.ts
|
|
5545
5811
|
function extractVideoDurationFromNode(data) {
|
|
5546
5812
|
if (!data) return void 0;
|
|
@@ -5789,6 +6055,42 @@ var AUDIO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
|
5789
6055
|
// Extract Audio: demuxes a video's audio track to a standalone MP3.
|
|
5790
6056
|
"extract-audio"
|
|
5791
6057
|
]);
|
|
6058
|
+
var IMAGE_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
6059
|
+
"upload-image",
|
|
6060
|
+
"generate-image",
|
|
6061
|
+
"edit-image",
|
|
6062
|
+
"image-to-image",
|
|
6063
|
+
"modify-image",
|
|
6064
|
+
"upscale-image",
|
|
6065
|
+
"remove-background",
|
|
6066
|
+
// extract-frame produces a single still image extracted from a video source.
|
|
6067
|
+
"extract-frame",
|
|
6068
|
+
// generate-mask emits the source image AND a mask PNG; its `image` source
|
|
6069
|
+
// pip is the passthrough (the same image as the input).
|
|
6070
|
+
"generate-mask",
|
|
6071
|
+
// paint-mask emits the hand-painted mask PNG (a plain image at runtime).
|
|
6072
|
+
// Membership is what makes mask targets accept it — mask is an advisory
|
|
6073
|
+
// color, not a gated type.
|
|
6074
|
+
"paint-mask",
|
|
6075
|
+
// reference-sheet's `sheet` is one composited image and `panels` carries
|
|
6076
|
+
// clean reference images; both resolve to image URLs at runtime.
|
|
6077
|
+
"reference-sheet",
|
|
6078
|
+
// reference-board's `image` pip emits a real generated board image.
|
|
6079
|
+
"reference-board",
|
|
6080
|
+
// image-collage composites N images → ONE image.
|
|
6081
|
+
"image-collage",
|
|
6082
|
+
// image-overlay places layers on a base → ONE image.
|
|
6083
|
+
"image-overlay",
|
|
6084
|
+
// 3D Render Pro's `stills` handle carries one PNG per shot of the exported
|
|
6085
|
+
// composition (spread into referenceImageUrls like reference-sheet
|
|
6086
|
+
// `panels`). A validator sees only the source NODE type, so this also makes
|
|
6087
|
+
// its `video` pip droppable on an image input — the handle-blind trade
|
|
6088
|
+
// reference-sheet and split-media already make; the input resolvers route
|
|
6089
|
+
// by handle, so only `stills` becomes an image at runtime. Deliberately NOT
|
|
6090
|
+
// in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY
|
|
6091
|
+
// asset, and 3D Render Pro's is the MP4.
|
|
6092
|
+
"pro-3d-render"
|
|
6093
|
+
]);
|
|
5792
6094
|
var FAN_OUT_EACH_TYPES = /* @__PURE__ */ new Set([
|
|
5793
6095
|
"list",
|
|
5794
6096
|
"split-text",
|
|
@@ -5816,6 +6118,7 @@ var FAN_OUT_EACH_HANDLES = {
|
|
|
5816
6118
|
// (decided 2026-10-04).
|
|
5817
6119
|
"camera-switch": { each: ["edl"], primary: "edl" }
|
|
5818
6120
|
};
|
|
6121
|
+
var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
|
|
5819
6122
|
var OWN_LIST_NODE_TYPES = /* @__PURE__ */ new Set(["extract-field", "json-process"]);
|
|
5820
6123
|
function ownsItsList(nodeType) {
|
|
5821
6124
|
return typeof nodeType === "string" && OWN_LIST_NODE_TYPES.has(nodeType);
|
|
@@ -5840,7 +6143,19 @@ var FAN_IN_TARGETS = {
|
|
|
5840
6143
|
// Telegram Reply — one message per run, whatever is wired into its text
|
|
5841
6144
|
// input: a list (or a writer that ran once per item) arrives as one
|
|
5842
6145
|
// message, never as a burst of sends to the owner's chat.
|
|
5843
|
-
"telegram-account-send": ["in"]
|
|
6146
|
+
"telegram-account-send": ["in"],
|
|
6147
|
+
// The list operators — they READ the whole list wired into them (their
|
|
6148
|
+
// executors collect every upstream item themselves) and emit a list. Run
|
|
6149
|
+
// once per item by an "each" wire (a Split Text, a List, a node that ran per
|
|
6150
|
+
// item), every iteration saw the same whole list and answered with its
|
|
6151
|
+
// first match: a Filter List fed 11 stories handed 11 copies of story one
|
|
6152
|
+
// downstream, and every paid stage after it ran 11 times on it
|
|
6153
|
+
// (2026-10-06). A list operator is never fanned out, on any wire.
|
|
6154
|
+
"filter-list": "*",
|
|
6155
|
+
deduplicate: "*",
|
|
6156
|
+
"merge-lists": "*",
|
|
6157
|
+
"sort-list": "*",
|
|
6158
|
+
selector: "*"
|
|
5844
6159
|
};
|
|
5845
6160
|
function isFanInNodeType(nodeType) {
|
|
5846
6161
|
return typeof nodeType === "string" && Object.prototype.hasOwnProperty.call(FAN_IN_TARGETS, nodeType);
|
|
@@ -5875,6 +6190,36 @@ function canonicalizeOverrideKeys(nodeType, overrides) {
|
|
|
5875
6190
|
return out ?? overrides;
|
|
5876
6191
|
}
|
|
5877
6192
|
|
|
6193
|
+
// src/render-nodes.ts
|
|
6194
|
+
var outputSettingMedium = (data) => data.output === "audio" ? "audio" : "video";
|
|
6195
|
+
var descriptor = (d) => Object.freeze({ ...d });
|
|
6196
|
+
var RENDER_NODE_TYPES = Object.freeze({
|
|
6197
|
+
"apply-edl": descriptor({
|
|
6198
|
+
mediumOf: outputSettingMedium,
|
|
6199
|
+
creditId: (quality) => applyEdlCreditId(quality),
|
|
6200
|
+
clockMapFrom: "input",
|
|
6201
|
+
ownerOnlyListing: true,
|
|
6202
|
+
latestBatch: true,
|
|
6203
|
+
jsonKind: "transcript"
|
|
6204
|
+
})
|
|
6205
|
+
});
|
|
6206
|
+
var RENDER_NODE_TYPE_IDS = Object.freeze(Object.keys(RENDER_NODE_TYPES));
|
|
6207
|
+
function renderNodeOf(type) {
|
|
6208
|
+
return typeof type === "string" && Object.hasOwn(RENDER_NODE_TYPES, type) ? RENDER_NODE_TYPES[type] : void 0;
|
|
6209
|
+
}
|
|
6210
|
+
function isRenderNodeType(type) {
|
|
6211
|
+
return renderNodeOf(type) !== void 0;
|
|
6212
|
+
}
|
|
6213
|
+
function rendersLatestBatch(type) {
|
|
6214
|
+
return renderNodeOf(type)?.latestBatch === true;
|
|
6215
|
+
}
|
|
6216
|
+
function rendersTranscriptJson(type) {
|
|
6217
|
+
return renderNodeOf(type)?.jsonKind === "transcript";
|
|
6218
|
+
}
|
|
6219
|
+
var OWNER_ONLY_LISTING_RENDER_TYPES = Object.freeze(
|
|
6220
|
+
RENDER_NODE_TYPE_IDS.filter((t2) => RENDER_NODE_TYPES[t2].ownerOnlyListing)
|
|
6221
|
+
);
|
|
6222
|
+
|
|
5878
6223
|
// src/presentation-utils.ts
|
|
5879
6224
|
var INPUT_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
5880
6225
|
"text-prompt",
|
|
@@ -6004,13 +6349,14 @@ var VIDEO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
|
|
|
6004
6349
|
"video-upscale",
|
|
6005
6350
|
"add-captions",
|
|
6006
6351
|
"social-media-format",
|
|
6007
|
-
//
|
|
6008
|
-
// time (DYNAMIC_PRODUCER_TYPES), so getOutputType would answer
|
|
6009
|
-
// published app would render the cut as a JSON blob. Declaring
|
|
6010
|
-
// the voice-changer/dubbing precedent does for their
|
|
6011
|
-
// the classifier answer "video" (the common case; an
|
|
6012
|
-
// plays in a video element). Asserted in
|
|
6013
|
-
|
|
6352
|
+
// A render (Apply EDL) renders an EDL into video OR audio. Its medium is
|
|
6353
|
+
// decided at run time (DYNAMIC_PRODUCER_TYPES), so getOutputType would answer
|
|
6354
|
+
// "data" and a published app would render the cut as a JSON blob. Declaring
|
|
6355
|
+
// every render here — as the voice-changer/dubbing precedent does for their
|
|
6356
|
+
// default medium — makes the classifier answer "video" (the common case; an
|
|
6357
|
+
// audio-only cut still plays in a video element). Asserted in
|
|
6358
|
+
// producer-types.test.ts.
|
|
6359
|
+
...RENDER_NODE_TYPE_IDS
|
|
6014
6360
|
]);
|
|
6015
6361
|
var AUDIO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
|
|
6016
6362
|
"text-to-speech",
|
|
@@ -6166,8 +6512,16 @@ var INPUT_FIELD_MAP = {
|
|
|
6166
6512
|
"music-mood": { key: "emotion", type: "select" },
|
|
6167
6513
|
"instrumentation": { key: "production", type: "select" },
|
|
6168
6514
|
"voice-character": { key: "timbre", type: "select" },
|
|
6169
|
-
"voice-delivery": { key: "archetype", type: "select" }
|
|
6515
|
+
"voice-delivery": { key: "archetype", type: "select" },
|
|
6516
|
+
// --- UGC (Cloud) ---
|
|
6517
|
+
"ugc-creator": { key: "source", type: "select" }
|
|
6518
|
+
};
|
|
6519
|
+
var INPUT_FIELD_EXTRA_KEYS = {
|
|
6520
|
+
"ugc-creator": [{ key: "gender", type: "select" }, { key: "photoUrl", type: "image-url" }]
|
|
6170
6521
|
};
|
|
6522
|
+
function getInputFieldExtraKeys(nodeType) {
|
|
6523
|
+
return Object.hasOwn(INPUT_FIELD_EXTRA_KEYS, nodeType) ? INPUT_FIELD_EXTRA_KEYS[nodeType] : [];
|
|
6524
|
+
}
|
|
6171
6525
|
function getInputFieldSchema(nodeType) {
|
|
6172
6526
|
return INPUT_FIELD_MAP[nodeType];
|
|
6173
6527
|
}
|
|
@@ -6222,6 +6576,32 @@ function cleanOrphanedItems(items, nodeIds) {
|
|
|
6222
6576
|
});
|
|
6223
6577
|
}
|
|
6224
6578
|
|
|
6579
|
+
// src/picker-restrictions.ts
|
|
6580
|
+
var valuesOf = (v) => (Array.isArray(v) ? v : [v]).filter((x) => x !== void 0 && x !== null && x !== "").map(String);
|
|
6581
|
+
function findRestrictedPickerValue(input) {
|
|
6582
|
+
if (!input.cardMeta || !input.inputValues) return null;
|
|
6583
|
+
for (const node of input.nodes) {
|
|
6584
|
+
const meta = input.cardMeta[node.id];
|
|
6585
|
+
const submitted = input.inputValues[node.id];
|
|
6586
|
+
if (!meta || !submitted) continue;
|
|
6587
|
+
const rules = [];
|
|
6588
|
+
const rep = node.type ? INPUT_FIELD_MAP[node.type]?.key : void 0;
|
|
6589
|
+
if (rep && meta.pickerAllowedValues && meta.pickerAllowedValues.length > 0) rules.push([rep, meta.pickerAllowedValues]);
|
|
6590
|
+
for (const [field, allowed] of Object.entries(meta.pickerAllowedValuesByField ?? {})) {
|
|
6591
|
+
if (allowed.length > 0) rules.push([field, allowed]);
|
|
6592
|
+
}
|
|
6593
|
+
for (const [field, allowed] of rules) {
|
|
6594
|
+
for (const [key, raw] of Object.entries(submitted)) {
|
|
6595
|
+
if (canonicalExposedFieldKey(node.type, key) !== field) continue;
|
|
6596
|
+
for (const value of valuesOf(raw)) {
|
|
6597
|
+
if (!allowed.includes(value)) return `Invalid value for ${field}: ${value}. Allowed: ${allowed.join(", ")}`;
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
}
|
|
6601
|
+
}
|
|
6602
|
+
return null;
|
|
6603
|
+
}
|
|
6604
|
+
|
|
6225
6605
|
// src/clone-utils.ts
|
|
6226
6606
|
var ITER_CLONE_PATTERN = /_iter_\d+$/;
|
|
6227
6607
|
function isExpandedClone(node) {
|
|
@@ -6281,14 +6661,14 @@ function isCollectInEdge(e) {
|
|
|
6281
6661
|
return (e.targetHandle ?? COLLECT_IN_HANDLE) === COLLECT_IN_HANDLE;
|
|
6282
6662
|
}
|
|
6283
6663
|
function computeAggregateLanes(nodeId, wiredTypes, buckets, edges) {
|
|
6284
|
-
const
|
|
6285
|
-
for (const t2 of presentTypes(buckets))
|
|
6664
|
+
const present2 = new Set(wiredTypes);
|
|
6665
|
+
for (const t2 of presentTypes(buckets)) present2.add(t2);
|
|
6286
6666
|
for (const e of edges) {
|
|
6287
6667
|
if (e.source !== nodeId) continue;
|
|
6288
6668
|
const lane = parseGroupHandle(e.sourceHandle);
|
|
6289
|
-
if (lane)
|
|
6669
|
+
if (lane) present2.add(lane);
|
|
6290
6670
|
}
|
|
6291
|
-
return AGGREGATEABLE_TYPES.filter((t2) =>
|
|
6671
|
+
return AGGREGATEABLE_TYPES.filter((t2) => present2.has(t2));
|
|
6292
6672
|
}
|
|
6293
6673
|
|
|
6294
6674
|
// src/llm-models.ts
|
|
@@ -7570,9 +7950,9 @@ function evalNode(node, input, ctx) {
|
|
|
7570
7950
|
return input;
|
|
7571
7951
|
}
|
|
7572
7952
|
if (typeof input === "object" && input !== null) {
|
|
7573
|
-
const
|
|
7574
|
-
ctx.objectSourcedArrays.add(
|
|
7575
|
-
return
|
|
7953
|
+
const arr2 = [input];
|
|
7954
|
+
ctx.objectSourcedArrays.add(arr2);
|
|
7955
|
+
return arr2;
|
|
7576
7956
|
}
|
|
7577
7957
|
throw new Error(`Cannot iterate over ${typeof input}`);
|
|
7578
7958
|
}
|
|
@@ -7704,10 +8084,10 @@ function evalNode(node, input, ctx) {
|
|
|
7704
8084
|
}
|
|
7705
8085
|
}
|
|
7706
8086
|
}
|
|
7707
|
-
function markExpanded(
|
|
7708
|
-
ctx.expandedArrays.add(
|
|
7709
|
-
if (objectSourced) ctx.objectSourcedArrays.add(
|
|
7710
|
-
return
|
|
8087
|
+
function markExpanded(arr2, objectSourced, ctx) {
|
|
8088
|
+
ctx.expandedArrays.add(arr2);
|
|
8089
|
+
if (objectSourced) ctx.objectSourcedArrays.add(arr2);
|
|
8090
|
+
return arr2;
|
|
7711
8091
|
}
|
|
7712
8092
|
function isExpandedArray(node, val, ctx) {
|
|
7713
8093
|
if (!Array.isArray(val)) return false;
|
|
@@ -7825,8 +8205,8 @@ function combineSameLabelRefs(candidates) {
|
|
|
7825
8205
|
for (const c of candidates) {
|
|
7826
8206
|
if (c.category < 0) continue;
|
|
7827
8207
|
const key = canonicalVarName(c.label);
|
|
7828
|
-
const
|
|
7829
|
-
if (
|
|
8208
|
+
const arr2 = byLabel.get(key);
|
|
8209
|
+
if (arr2) arr2.push(c);
|
|
7830
8210
|
else byLabel.set(key, [c]);
|
|
7831
8211
|
}
|
|
7832
8212
|
const combined = /* @__PURE__ */ new Map();
|
|
@@ -8633,6 +9013,8 @@ var NON_PROMPT_TEXT_LANES = {
|
|
|
8633
9013
|
silence: ["edit-plan"],
|
|
8634
9014
|
offsets: ["edit-plan"],
|
|
8635
9015
|
qrText: ["image-overlay"],
|
|
9016
|
+
layerPlan: ["video-overlay"],
|
|
9017
|
+
captionPlan: ["add-captions"],
|
|
8636
9018
|
transition: ["slideshow"],
|
|
8637
9019
|
// Content Recipe's `link` carries the post's address (inputs.sourceLink), not
|
|
8638
9020
|
// the material it analyzes — a list of links fanned through it must not be
|
|
@@ -8655,6 +9037,16 @@ function compactWithRows(aligned) {
|
|
|
8655
9037
|
});
|
|
8656
9038
|
return { items, rowIndices };
|
|
8657
9039
|
}
|
|
9040
|
+
function pickHeldRow(rows, edge, iterating) {
|
|
9041
|
+
if (rows.length === 0) return { kind: "unaffected" };
|
|
9042
|
+
const mode = edge?.outputMode ?? "each";
|
|
9043
|
+
const held = (row) => isBlank(row) ? { kind: "none" } : { kind: "value", value: row };
|
|
9044
|
+
if (mode === "item") return held(rows[resolveIndex(edge?.itemIndex ?? "1", rows.length)]);
|
|
9045
|
+
if (mode.startsWith("item:")) return held(rows[parseInt(mode.slice(5), 10)]);
|
|
9046
|
+
if (mode !== "each" || iterating || isDefaultSelectorConfig(edge)) return { kind: "unaffected" };
|
|
9047
|
+
const kept = compactWithRows(selectListItems([...rows], edge)).items;
|
|
9048
|
+
return kept.length > 0 ? { kind: "value", value: kept[0] } : { kind: "none" };
|
|
9049
|
+
}
|
|
8658
9050
|
function liveRowColumn(rows, colIndex) {
|
|
8659
9051
|
return rows.filter((row) => row.some((cell) => !isBlank(cell))).map((row) => typeof row[colIndex] === "string" ? row[colIndex].trim() : "");
|
|
8660
9052
|
}
|
|
@@ -8663,7 +9055,7 @@ function resolveListFanOut(candidates, nodeType) {
|
|
|
8663
9055
|
const held = (c) => compactWithRows(c.aligned).items.length;
|
|
8664
9056
|
const primary = candidates.reduce((best, c) => held(c) > held(best) ? c : best);
|
|
8665
9057
|
const space = candidates.filter((c) => c.aligned.length === primary.aligned.length);
|
|
8666
|
-
const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned);
|
|
9058
|
+
const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned, nodeType, c.targetHandle);
|
|
8667
9059
|
const driver = feedsPrompt(primary) ? primary : space.find(feedsPrompt) ?? primary;
|
|
8668
9060
|
const rowIndices = [];
|
|
8669
9061
|
for (let row = 0; row < primary.aligned.length; row++) {
|
|
@@ -8676,11 +9068,21 @@ function resolveListFanOut(candidates, nodeType) {
|
|
|
8676
9068
|
};
|
|
8677
9069
|
}
|
|
8678
9070
|
function isFanOutUrlItem(item) {
|
|
8679
|
-
|
|
9071
|
+
const s = item.trim();
|
|
9072
|
+
if (s.length === 0 || /\s/.test(s) || s.startsWith("{") || s.startsWith("[")) return false;
|
|
9073
|
+
return s.startsWith("http") || /\.(png|jpg|jpeg|webp|gif|mp4|mov|webm|mp3|wav|ogg)(\?|$)/i.test(s);
|
|
9074
|
+
}
|
|
9075
|
+
var URL_ITEM_IS_TEXT_LANES = {
|
|
9076
|
+
"collection-write": ["in"]
|
|
9077
|
+
};
|
|
9078
|
+
function fanOutUrlItemIsText(nodeType, targetHandle) {
|
|
9079
|
+
const lanes = URL_ITEM_IS_TEXT_LANES[nodeType ?? ""];
|
|
9080
|
+
return lanes !== void 0 && lanes.includes(targetHandle ?? "");
|
|
8680
9081
|
}
|
|
8681
|
-
function isTextList(aligned) {
|
|
9082
|
+
function isTextList(aligned, nodeType, targetHandle) {
|
|
8682
9083
|
const first = aligned.find((v) => !isBlank(v));
|
|
8683
|
-
|
|
9084
|
+
if (first === void 0) return false;
|
|
9085
|
+
return !isFanOutUrlItem(first) || fanOutUrlItemIsText(nodeType, targetHandle);
|
|
8684
9086
|
}
|
|
8685
9087
|
function planFanOut(fanOut, nodeType, nodeData) {
|
|
8686
9088
|
const items = expandItemsWithRepeat(fanOut?.items, nodeType, nodeData);
|
|
@@ -9961,7 +10363,13 @@ var NODE_MAPPABLE_FIELDS = {
|
|
|
9961
10363
|
"edit-video-pro": ["prompt"],
|
|
9962
10364
|
"video-analysis": ["analysisFocus", "youtubeUrl"],
|
|
9963
10365
|
"video-to-video": ["prompt"],
|
|
9964
|
-
|
|
10366
|
+
// + the two neighbour-text fields (continuity across clips): a wired Text node can feed
|
|
10367
|
+
// what is spoken before / after this clip, and {} injection works in them as in directText.
|
|
10368
|
+
"text-to-speech": ["directText", "previousText", "nextText"],
|
|
10369
|
+
// Save to Collection: the record's own fields, each mappable from an upstream
|
|
10370
|
+
// node or a {Ref}; the link field is `link` (node-data keys ending in url are
|
|
10371
|
+
// locked by the Copilot's deny-list).
|
|
10372
|
+
"collection-write": ["title", "text", "link", "dedupeKey"],
|
|
9965
10373
|
"lip-sync": ["prompt"],
|
|
9966
10374
|
"generate-music": ["prompt", "lyrics", "genre", "mood"],
|
|
9967
10375
|
"text-to-audio": ["prompt"],
|
|
@@ -10183,6 +10591,136 @@ function nodeFeedsAnything(nodes, edges, nodeId) {
|
|
|
10183
10591
|
return (buildFeedMaps(nodes, edges).children.get(nodeId) ?? []).length > 0;
|
|
10184
10592
|
}
|
|
10185
10593
|
|
|
10594
|
+
// src/preview-gate.ts
|
|
10595
|
+
var PREVIEW_RENDER_NODE_TYPES = new Set(RENDER_NODE_TYPE_IDS);
|
|
10596
|
+
var PREVIEW_REVIEW_REQUIRED = "preview_review_required";
|
|
10597
|
+
var PREVIEW_RENDER_NESTED = "preview_render_nested";
|
|
10598
|
+
var NO_SAVED_RENDER_STAMPS = {
|
|
10599
|
+
output: () => void 0,
|
|
10600
|
+
batch: () => void 0
|
|
10601
|
+
};
|
|
10602
|
+
var SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
|
|
10603
|
+
var dataOf = (n) => n.data && typeof n.data === "object" ? n.data : {};
|
|
10604
|
+
var isPreviewStamp = (stamp) => stamp?.quality === "proxy";
|
|
10605
|
+
function rendersAsPreview(node) {
|
|
10606
|
+
return PREVIEW_RENDER_NODE_TYPES.has(node.type ?? "") && dataOf(node).quality === "proxy";
|
|
10607
|
+
}
|
|
10608
|
+
var TELEPORT_TYPES = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
|
|
10609
|
+
var isTeleport = (n) => TELEPORT_TYPES.has(n?.type ?? "");
|
|
10610
|
+
var outputModeOf = (edge) => {
|
|
10611
|
+
const mode = edge.data && typeof edge.data === "object" ? edge.data.outputMode : void 0;
|
|
10612
|
+
return typeof mode === "string" ? mode : void 0;
|
|
10613
|
+
};
|
|
10614
|
+
function readsEach(render, consumerEdge, renderHandle) {
|
|
10615
|
+
return (outputModeOf(consumerEdge) ?? defaultEdgeOutputMode(render.type, renderHandle)) === "each";
|
|
10616
|
+
}
|
|
10617
|
+
function savedPreviewConsumers(render, children, nodeById, edges, reader) {
|
|
10618
|
+
const data = dataOf(render);
|
|
10619
|
+
const scalarIsPreview = isPreviewStamp(reader.output(data));
|
|
10620
|
+
const batch = reader.batch(data);
|
|
10621
|
+
const eachIsPreview = batch ? batch.some(isPreviewStamp) : scalarIsPreview;
|
|
10622
|
+
const out = /* @__PURE__ */ new Set();
|
|
10623
|
+
const visited = /* @__PURE__ */ new Set([render.id]);
|
|
10624
|
+
const walk3 = (from, renderHandle, isRender) => {
|
|
10625
|
+
const wires = edges.filter((e) => e.source === from);
|
|
10626
|
+
for (const child of children.get(from) ?? []) {
|
|
10627
|
+
const wiresToChild = wires.filter((e) => e.target === child);
|
|
10628
|
+
if (isTeleport(nodeById.get(child))) {
|
|
10629
|
+
if (visited.has(child)) continue;
|
|
10630
|
+
visited.add(child);
|
|
10631
|
+
if (isRender && wiresToChild.length > 0) for (const w of wiresToChild) walk3(child, w.sourceHandle, false);
|
|
10632
|
+
else walk3(child, renderHandle, false);
|
|
10633
|
+
continue;
|
|
10634
|
+
}
|
|
10635
|
+
const preview = wiresToChild.length === 0 ? scalarIsPreview : wiresToChild.some(
|
|
10636
|
+
(e) => readsEach(render, e, isRender ? e.sourceHandle : renderHandle) ? eachIsPreview : scalarIsPreview
|
|
10637
|
+
);
|
|
10638
|
+
if (preview) out.add(child);
|
|
10639
|
+
}
|
|
10640
|
+
};
|
|
10641
|
+
walk3(render.id, void 0, true);
|
|
10642
|
+
return [...out];
|
|
10643
|
+
}
|
|
10644
|
+
function previewStops(nodes, edges, run = {}) {
|
|
10645
|
+
const nodeById = new Map(nodes.map((n) => [n.id, n]));
|
|
10646
|
+
const executes = run.executes ?? ((id) => {
|
|
10647
|
+
const n = nodeById.get(id);
|
|
10648
|
+
return !!n && dataOf(n).skipped !== true;
|
|
10649
|
+
});
|
|
10650
|
+
const reader = run.savedRenders ?? SAVED_RENDER_STAMPS;
|
|
10651
|
+
const { children } = buildFeedMaps(nodes, edges);
|
|
10652
|
+
const previewRenderIds = [];
|
|
10653
|
+
const savedPreviewRenderIds = [];
|
|
10654
|
+
const seeds = [];
|
|
10655
|
+
for (const n of nodes) {
|
|
10656
|
+
if (!PREVIEW_RENDER_NODE_TYPES.has(n.type ?? "")) continue;
|
|
10657
|
+
const kids = children.get(n.id) ?? [];
|
|
10658
|
+
if (executes(n.id)) {
|
|
10659
|
+
if (!rendersAsPreview(n)) continue;
|
|
10660
|
+
previewRenderIds.push(n.id);
|
|
10661
|
+
seeds.push(...kids);
|
|
10662
|
+
} else {
|
|
10663
|
+
const consumers = savedPreviewConsumers(n, children, nodeById, edges, reader);
|
|
10664
|
+
if (consumers.length === 0) continue;
|
|
10665
|
+
savedPreviewRenderIds.push(n.id);
|
|
10666
|
+
seeds.push(...consumers);
|
|
10667
|
+
}
|
|
10668
|
+
}
|
|
10669
|
+
const gated = /* @__PURE__ */ new Set();
|
|
10670
|
+
const queue = [...seeds];
|
|
10671
|
+
while (queue.length > 0) {
|
|
10672
|
+
const id = queue.shift();
|
|
10673
|
+
if (gated.has(id)) continue;
|
|
10674
|
+
gated.add(id);
|
|
10675
|
+
for (const next of children.get(id) ?? []) if (!gated.has(next)) queue.push(next);
|
|
10676
|
+
}
|
|
10677
|
+
return { previewRenderIds, savedPreviewRenderIds, gatedNodeIds: gated };
|
|
10678
|
+
}
|
|
10679
|
+
function previewGatedNodeIds(nodes, edges, run) {
|
|
10680
|
+
return new Set(previewStops(nodes, edges, run).gatedNodeIds);
|
|
10681
|
+
}
|
|
10682
|
+
function holdsPreviewRender(nodes, edges, run) {
|
|
10683
|
+
const stops = previewStops(nodes, edges, run);
|
|
10684
|
+
return stops.previewRenderIds.length > 0 || stops.savedPreviewRenderIds.length > 0;
|
|
10685
|
+
}
|
|
10686
|
+
var RUN_OVERRIDE_CLEARED_FIELDS = [
|
|
10687
|
+
"generatedResults",
|
|
10688
|
+
"activeResultIndex",
|
|
10689
|
+
"generatedImageUrl",
|
|
10690
|
+
"generatedVideoUrl",
|
|
10691
|
+
"generatedAudioUrl",
|
|
10692
|
+
"generatedText"
|
|
10693
|
+
];
|
|
10694
|
+
function withRunOverrides(nodes, overrides) {
|
|
10695
|
+
if (!overrides) return [...nodes];
|
|
10696
|
+
return nodes.map((n) => {
|
|
10697
|
+
const fields = overrides[n.id];
|
|
10698
|
+
if (!fields) return n;
|
|
10699
|
+
const merged = mergeNodeInputOverrides(n.type ?? void 0, { ...dataOf(n) }, { ...fields });
|
|
10700
|
+
for (const key of RUN_OVERRIDE_CLEARED_FIELDS) delete merged[key];
|
|
10701
|
+
return { ...n, data: merged };
|
|
10702
|
+
});
|
|
10703
|
+
}
|
|
10704
|
+
|
|
10705
|
+
// src/run-continuation.ts
|
|
10706
|
+
var CONTINUATION_NOT_FOUND = "continuation_not_found";
|
|
10707
|
+
var CONTINUATION_WORKFLOW_MISMATCH = "continuation_workflow_mismatch";
|
|
10708
|
+
var CONTINUATION_VERSION_MISMATCH = "continuation_version_mismatch";
|
|
10709
|
+
var CONTINUATION_NOT_COMPLETED = "continuation_not_completed";
|
|
10710
|
+
var CONTINUATION_SUBSET_REQUIRED = "continuation_subset_required";
|
|
10711
|
+
var RUN_CONTINUATION_CODES = [
|
|
10712
|
+
CONTINUATION_NOT_FOUND,
|
|
10713
|
+
CONTINUATION_WORKFLOW_MISMATCH,
|
|
10714
|
+
CONTINUATION_VERSION_MISMATCH,
|
|
10715
|
+
CONTINUATION_NOT_COMPLETED,
|
|
10716
|
+
CONTINUATION_SUBSET_REQUIRED
|
|
10717
|
+
];
|
|
10718
|
+
|
|
10719
|
+
// src/render-final.ts
|
|
10720
|
+
var RENDER_FINAL_NODE_NOT_FOUND = "render_final_node_not_found";
|
|
10721
|
+
var RENDER_FINAL_NOT_A_RENDER = "render_final_not_a_render";
|
|
10722
|
+
var RENDER_FINAL_CODES = [RENDER_FINAL_NODE_NOT_FOUND, RENDER_FINAL_NOT_A_RENDER];
|
|
10723
|
+
|
|
10186
10724
|
// src/schedule-rules.ts
|
|
10187
10725
|
var SCHEDULE_RULE_KINDS = ["minutes", "hours", "days", "weeks", "months", "cron"];
|
|
10188
10726
|
var SCHEDULE_EVERY_LIMITS = {
|
|
@@ -10378,8 +10916,8 @@ function matchesCronField(field, value, min, max) {
|
|
|
10378
10916
|
if (start === null || end === null) return false;
|
|
10379
10917
|
return value >= start && value <= end;
|
|
10380
10918
|
}
|
|
10381
|
-
const
|
|
10382
|
-
return !Number.isNaN(
|
|
10919
|
+
const num3 = parseInt(field, 10);
|
|
10920
|
+
return !Number.isNaN(num3) && num3 === value;
|
|
10383
10921
|
}
|
|
10384
10922
|
function parseRange(range) {
|
|
10385
10923
|
const parts = range.split("-");
|
|
@@ -11088,6 +11626,213 @@ function normalizeSavedPostTags(tags) {
|
|
|
11088
11626
|
return Array.from(new Set(clean2)).slice(0, SAVED_POST_MAX_TAGS);
|
|
11089
11627
|
}
|
|
11090
11628
|
|
|
11629
|
+
// src/collections.ts
|
|
11630
|
+
var COLLECTION_NAME_MAX = 80;
|
|
11631
|
+
var COLLECTION_DESCRIPTION_MAX = 500;
|
|
11632
|
+
var COLLECTION_RECORD_TITLE_MAX = 500;
|
|
11633
|
+
var COLLECTION_RECORD_TEXT_MAX = 2e4;
|
|
11634
|
+
var COLLECTION_RECORD_URL_MAX = 2e3;
|
|
11635
|
+
var COLLECTION_RECORD_MEDIA_MAX = 20;
|
|
11636
|
+
var COLLECTION_RECORD_FIELDS_MAX = 50;
|
|
11637
|
+
var COLLECTION_RECORD_FIELDS_BYTES_MAX = 16 * 1024;
|
|
11638
|
+
var COLLECTION_DEDUPE_KEY_MAX = 300;
|
|
11639
|
+
var COLLECTION_IDEMPOTENCY_KEY_MAX = 200;
|
|
11640
|
+
var COLLECTIONS_PAGE_MAX = 100;
|
|
11641
|
+
var COLLECTIONS_PAGE_DEFAULT = 50;
|
|
11642
|
+
var COLLECTION_HEADLINE_MAX = 120;
|
|
11643
|
+
var COLLECTION_MEDIA_TYPES = ["image", "video", "audio", "link"];
|
|
11644
|
+
var COLLECTION_TIER_CAPS = {
|
|
11645
|
+
free: { collections: 3, records: 500 },
|
|
11646
|
+
payg: { collections: 10, records: 5e3 },
|
|
11647
|
+
basic: { collections: 10, records: 5e3 },
|
|
11648
|
+
standard: { collections: 30, records: 2e4 },
|
|
11649
|
+
pro: { collections: 100, records: 1e5 },
|
|
11650
|
+
business: { collections: 300, records: 25e4 },
|
|
11651
|
+
enterprise: { collections: 300, records: 25e4 }
|
|
11652
|
+
};
|
|
11653
|
+
function collectionCapsForTier(tier) {
|
|
11654
|
+
return tier ? COLLECTION_TIER_CAPS[tier] : void 0;
|
|
11655
|
+
}
|
|
11656
|
+
var COLLECTION_DIGEST_SEPARATOR = "\n\n---\n\n";
|
|
11657
|
+
var COLLECTION_READ_WINDOW_HOURS_MAX = 720;
|
|
11658
|
+
var COLLECTION_READ_LIMIT_MAX = 200;
|
|
11659
|
+
function collectionReadSince(amount, unit, now = Date.now()) {
|
|
11660
|
+
const hours = Math.min(COLLECTION_READ_WINDOW_HOURS_MAX, Math.max(1, Math.floor(Number.isFinite(amount) ? amount : 24)) * (unit === "days" ? 24 : 1));
|
|
11661
|
+
return new Date(now - hours * 36e5).toISOString();
|
|
11662
|
+
}
|
|
11663
|
+
var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
11664
|
+
var str2 = (v) => typeof v === "string" && v.trim().length > 0 ? v : void 0;
|
|
11665
|
+
var isScalar = (v) => typeof v === "string" || typeof v === "number" && Number.isFinite(v) || typeof v === "boolean";
|
|
11666
|
+
function isCollectionUrl(v) {
|
|
11667
|
+
return typeof v === "string" && /^https?:\/\/\S+$/i.test(v) && v.length <= COLLECTION_RECORD_URL_MAX;
|
|
11668
|
+
}
|
|
11669
|
+
var isHttpUrl = isCollectionUrl;
|
|
11670
|
+
function clampChars(text, max) {
|
|
11671
|
+
if (text.length <= max) return text;
|
|
11672
|
+
const points2 = Array.from(text);
|
|
11673
|
+
return points2.length <= max ? text : points2.slice(0, max).join("");
|
|
11674
|
+
}
|
|
11675
|
+
function normalizeDedupeKey(raw) {
|
|
11676
|
+
if (typeof raw === "number" && Number.isFinite(raw)) raw = String(raw);
|
|
11677
|
+
if (typeof raw !== "string") return null;
|
|
11678
|
+
const compact = raw.trim().replace(/\s+/g, " ");
|
|
11679
|
+
const key = clampChars(looksLikeLink(compact) ? canonicalUrl(compact) : compact.toLowerCase(), COLLECTION_DEDUPE_KEY_MAX).trim();
|
|
11680
|
+
return key.length > 0 ? key : null;
|
|
11681
|
+
}
|
|
11682
|
+
var looksLikeLink = (s) => isCollectionUrl(s);
|
|
11683
|
+
var COLLECTION_EVICT_MAX_PER_WRITE = 100;
|
|
11684
|
+
function canonicalUrl(url) {
|
|
11685
|
+
try {
|
|
11686
|
+
return new URL(url).href;
|
|
11687
|
+
} catch {
|
|
11688
|
+
return url;
|
|
11689
|
+
}
|
|
11690
|
+
}
|
|
11691
|
+
function isCollectionMedia(v) {
|
|
11692
|
+
return isRecord2(v) && COLLECTION_MEDIA_TYPES.includes(v.type) && isHttpUrl(v.url) && (v.posterUrl === void 0 || v.posterUrl === null || isHttpUrl(v.posterUrl));
|
|
11693
|
+
}
|
|
11694
|
+
function normalizeCollectionMedia(value) {
|
|
11695
|
+
if (!Array.isArray(value)) return [];
|
|
11696
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11697
|
+
const out = [];
|
|
11698
|
+
for (const item of value) {
|
|
11699
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
|
|
11700
|
+
if (!isCollectionMedia(item) || seen.has(item.url)) continue;
|
|
11701
|
+
seen.add(item.url);
|
|
11702
|
+
out.push({ type: item.type, url: item.url, ...item.posterUrl ? { posterUrl: item.posterUrl } : {} });
|
|
11703
|
+
}
|
|
11704
|
+
return out;
|
|
11705
|
+
}
|
|
11706
|
+
function normalizeCollectionFields(value) {
|
|
11707
|
+
if (!isRecord2(value)) return {};
|
|
11708
|
+
const out = {};
|
|
11709
|
+
let bytes = 2;
|
|
11710
|
+
let count = 0;
|
|
11711
|
+
for (const [key, v] of Object.entries(value)) {
|
|
11712
|
+
if (count >= COLLECTION_RECORD_FIELDS_MAX) break;
|
|
11713
|
+
if (!isScalar(v) || key.length === 0 || key.length > 100) continue;
|
|
11714
|
+
const entry = JSON.stringify(key) + ":" + JSON.stringify(v) + ",";
|
|
11715
|
+
if (bytes + entry.length > COLLECTION_RECORD_FIELDS_BYTES_MAX) break;
|
|
11716
|
+
out[key] = v;
|
|
11717
|
+
bytes += entry.length;
|
|
11718
|
+
count += 1;
|
|
11719
|
+
}
|
|
11720
|
+
return out;
|
|
11721
|
+
}
|
|
11722
|
+
function collectionRecordHeadline(record) {
|
|
11723
|
+
const title = (typeof record.title === "string" ? record.title : "").trim();
|
|
11724
|
+
if (title) return clampChars(title, COLLECTION_HEADLINE_MAX);
|
|
11725
|
+
const line = (typeof record.text === "string" ? record.text : "").split(/\r?\n/).map((l) => l.trim()).find((l) => l.length > 0);
|
|
11726
|
+
if (line) return line.length > COLLECTION_HEADLINE_MAX ? `${clampChars(line, COLLECTION_HEADLINE_MAX - 1)}\u2026` : line;
|
|
11727
|
+
return typeof record.url === "string" ? record.url : "";
|
|
11728
|
+
}
|
|
11729
|
+
function collectionRecordsDigest(records, format = "headlines") {
|
|
11730
|
+
const rows = records.filter((r) => typeof r === "object" && r !== null);
|
|
11731
|
+
const str7 = (v) => typeof v === "string" ? v : "";
|
|
11732
|
+
if (format === "full") {
|
|
11733
|
+
return rows.map((r) => {
|
|
11734
|
+
const head = collectionRecordHeadline(r);
|
|
11735
|
+
const body = str7(r.text).trim();
|
|
11736
|
+
const lines = [head ? `### ${head}` : "", body && body !== head ? body : "", str7(r.url)].filter((l) => l.length > 0);
|
|
11737
|
+
return lines.join("\n");
|
|
11738
|
+
}).filter((block) => block.length > 0).join(COLLECTION_DIGEST_SEPARATOR);
|
|
11739
|
+
}
|
|
11740
|
+
return rows.map((r) => {
|
|
11741
|
+
const parts = [collectionRecordHeadline(r)];
|
|
11742
|
+
const created = str7(r.createdAt);
|
|
11743
|
+
if (created) parts.push(created.slice(0, 10));
|
|
11744
|
+
const url = str7(r.url);
|
|
11745
|
+
if (url && url !== parts[0]) parts.push(url);
|
|
11746
|
+
return `- ${parts.filter((p) => p.length > 0).join(" \xB7 ")}`;
|
|
11747
|
+
}).join("\n");
|
|
11748
|
+
}
|
|
11749
|
+
var TITLE_KEYS = ["title", "headline", "name", "subject"];
|
|
11750
|
+
var TEXT_KEYS = ["text", "body", "caption", "description", "content", "summary", "dek"];
|
|
11751
|
+
var URL_KEYS = ["url", "postUrl", "link", "href", "permalink"];
|
|
11752
|
+
var DEDUPE_KEYS = ["slug", "postId", "externalId", "id"];
|
|
11753
|
+
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);
|
|
11754
|
+
var IMAGE_KEYS = ["imageUrl", "thumbnailUrl", "image", "thumbnail"];
|
|
11755
|
+
var VIDEO_KEYS = ["videoUrl", "video"];
|
|
11756
|
+
var AUDIO_KEYS = ["audioUrl", "audio"];
|
|
11757
|
+
var MEDIA_SHAPED_KEYS = /* @__PURE__ */ new Set(["media", ...IMAGE_KEYS, ...VIDEO_KEYS, ...AUDIO_KEYS]);
|
|
11758
|
+
function firstString(item, keys) {
|
|
11759
|
+
for (const key of keys) {
|
|
11760
|
+
const v = str2(item[key]);
|
|
11761
|
+
if (v !== void 0) return v;
|
|
11762
|
+
}
|
|
11763
|
+
return void 0;
|
|
11764
|
+
}
|
|
11765
|
+
function firstUrl(item, keys) {
|
|
11766
|
+
for (const key of keys) {
|
|
11767
|
+
const v = item[key];
|
|
11768
|
+
if (typeof v === "string" && isHttpUrl(v.trim())) return v.trim();
|
|
11769
|
+
}
|
|
11770
|
+
return null;
|
|
11771
|
+
}
|
|
11772
|
+
function mediaFromItem(item) {
|
|
11773
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11774
|
+
const out = [];
|
|
11775
|
+
const push = (m) => {
|
|
11776
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) return false;
|
|
11777
|
+
if (!seen.has(m.url)) {
|
|
11778
|
+
seen.add(m.url);
|
|
11779
|
+
out.push(m);
|
|
11780
|
+
}
|
|
11781
|
+
return true;
|
|
11782
|
+
};
|
|
11783
|
+
if (Array.isArray(item.media)) {
|
|
11784
|
+
for (const entry of item.media) {
|
|
11785
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
|
|
11786
|
+
if (!isRecord2(entry)) continue;
|
|
11787
|
+
const type = entry.type === "photo" ? "image" : entry.type;
|
|
11788
|
+
const poster = isHttpUrl(entry.posterUrl) ? entry.posterUrl : void 0;
|
|
11789
|
+
if (type === "video" && !isHttpUrl(entry.url) && poster) {
|
|
11790
|
+
push({ type: "image", url: poster });
|
|
11791
|
+
continue;
|
|
11792
|
+
}
|
|
11793
|
+
if (isCollectionMedia({ ...entry, type })) push({ type, url: entry.url, ...poster ? { posterUrl: poster } : {} });
|
|
11794
|
+
}
|
|
11795
|
+
} else if (isRecord2(item.media)) {
|
|
11796
|
+
const m = item.media;
|
|
11797
|
+
if (isHttpUrl(m.videoUrl)) push({ type: "video", url: m.videoUrl, ...isHttpUrl(m.thumbnailUrl) ? { posterUrl: m.thumbnailUrl } : {} });
|
|
11798
|
+
else if (isHttpUrl(m.thumbnailUrl)) push({ type: "image", url: m.thumbnailUrl });
|
|
11799
|
+
}
|
|
11800
|
+
for (const key of IMAGE_KEYS) if (isHttpUrl(item[key]) && !push({ type: "image", url: item[key] })) break;
|
|
11801
|
+
for (const key of VIDEO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "video", url: item[key] })) break;
|
|
11802
|
+
for (const key of AUDIO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "audio", url: item[key] })) break;
|
|
11803
|
+
return out;
|
|
11804
|
+
}
|
|
11805
|
+
function ingestRecordFromJson(item) {
|
|
11806
|
+
if (!isRecord2(item)) {
|
|
11807
|
+
const text2 = typeof item === "string" ? item : item === void 0 || item === null ? "" : JSON.stringify(item);
|
|
11808
|
+
return { title: "", text: clampChars(text2, COLLECTION_RECORD_TEXT_MAX), url: null, media: [], fields: {}, dedupeKey: null };
|
|
11809
|
+
}
|
|
11810
|
+
const title = clampChars((firstString(item, TITLE_KEYS) ?? "").trim(), COLLECTION_RECORD_TITLE_MAX);
|
|
11811
|
+
const text = clampChars(firstString(item, TEXT_KEYS) ?? "", COLLECTION_RECORD_TEXT_MAX);
|
|
11812
|
+
const url = firstUrl(item, URL_KEYS);
|
|
11813
|
+
const media = mediaFromItem(item);
|
|
11814
|
+
const taken = /* @__PURE__ */ new Set([...TITLE_KEYS, ...TEXT_KEYS, ...URL_KEYS, ...MEDIA_SHAPED_KEYS]);
|
|
11815
|
+
const fields = {};
|
|
11816
|
+
let kept = 0;
|
|
11817
|
+
for (const [key, v] of Object.entries(item)) {
|
|
11818
|
+
if (kept >= COLLECTION_RECORD_FIELDS_MAX) break;
|
|
11819
|
+
if (taken.has(key)) continue;
|
|
11820
|
+
if (isScalar(v)) fields[key] = v;
|
|
11821
|
+
else if (isRecord2(v) && typeof v.name === "string" && v.name.trim()) fields[key] = v.name;
|
|
11822
|
+
else continue;
|
|
11823
|
+
kept += 1;
|
|
11824
|
+
}
|
|
11825
|
+
const dedupeSource = url ?? DEDUPE_KEYS.filter((k) => isDedupeValue(k, item[k])).map((k) => item[k])[0];
|
|
11826
|
+
return {
|
|
11827
|
+
title,
|
|
11828
|
+
text,
|
|
11829
|
+
url,
|
|
11830
|
+
media,
|
|
11831
|
+
fields: normalizeCollectionFields(fields),
|
|
11832
|
+
dedupeKey: normalizeDedupeKey(dedupeSource)
|
|
11833
|
+
};
|
|
11834
|
+
}
|
|
11835
|
+
|
|
11091
11836
|
// src/competitors.ts
|
|
11092
11837
|
var COMPETITOR_ACCOUNT_KEYS = ["tiktok", "instagram", "youtube", "x", "linkedin", "meta_ads"];
|
|
11093
11838
|
var COMPETITOR_ABOUT_PLATFORMS = ["tiktok", "instagram", "youtube", "x", "reddit", "linkedin"];
|
|
@@ -12444,35 +13189,49 @@ function togglePick(current, id, maxSelected) {
|
|
|
12444
13189
|
return [...current.slice(1), id];
|
|
12445
13190
|
}
|
|
12446
13191
|
|
|
12447
|
-
// src/tts-
|
|
12448
|
-
var
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
return typeof provider === "string" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider] : provider;
|
|
13192
|
+
// src/tts-neighbour-text.ts
|
|
13193
|
+
var TTS_NEIGHBOUR_TEXT_MAX_CHARS = 1e3;
|
|
13194
|
+
function usableText(value) {
|
|
13195
|
+
if (typeof value !== "string") return void 0;
|
|
13196
|
+
const trimmed2 = value.trim();
|
|
13197
|
+
return trimmed2 ? trimmed2 : void 0;
|
|
12454
13198
|
}
|
|
12455
|
-
function
|
|
13199
|
+
function normalizeTtsNeighbourText(options) {
|
|
13200
|
+
const out = {};
|
|
13201
|
+
const previous = usableText(options?.previousText);
|
|
13202
|
+
if (previous !== void 0) {
|
|
13203
|
+
out.previousText = previous.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? previous.slice(-TTS_NEIGHBOUR_TEXT_MAX_CHARS) : previous;
|
|
13204
|
+
}
|
|
13205
|
+
const next = usableText(options?.nextText);
|
|
13206
|
+
if (next !== void 0) {
|
|
13207
|
+
out.nextText = next.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? next.slice(0, TTS_NEIGHBOUR_TEXT_MAX_CHARS) : next;
|
|
13208
|
+
}
|
|
13209
|
+
return out;
|
|
13210
|
+
}
|
|
13211
|
+
|
|
13212
|
+
// src/dialogue-capabilities.ts
|
|
13213
|
+
function findDialogueCapabilities(provider) {
|
|
12456
13214
|
if (typeof provider !== "string" || !provider) return void 0;
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
return entry.modes.includes("tts") ? entry.tts : void 0;
|
|
13215
|
+
if (!Object.hasOwn(MODEL_CATALOG, provider)) return void 0;
|
|
13216
|
+
const entry = MODEL_CATALOG[provider];
|
|
13217
|
+
return entry.modes.includes("dialogue") ? entry.tts : void 0;
|
|
12461
13218
|
}
|
|
12462
|
-
function
|
|
12463
|
-
return
|
|
13219
|
+
function dialogueProviderOf(provider) {
|
|
13220
|
+
return findDialogueCapabilities(provider) ? provider : DEFAULT_DIALOGUE_PROVIDER;
|
|
12464
13221
|
}
|
|
12465
|
-
function
|
|
12466
|
-
return
|
|
13222
|
+
function getDialogueCapabilities(provider) {
|
|
13223
|
+
return MODEL_CATALOG[dialogueProviderOf(provider)].tts;
|
|
12467
13224
|
}
|
|
12468
|
-
function
|
|
12469
|
-
return
|
|
13225
|
+
function dialogueHasLever(provider, lever) {
|
|
13226
|
+
return getDialogueCapabilities(provider).levers.includes(lever);
|
|
12470
13227
|
}
|
|
12471
|
-
function
|
|
12472
|
-
return
|
|
13228
|
+
function dialogueSupportsTimestamps(provider) {
|
|
13229
|
+
return getDialogueCapabilities(provider).timestamps;
|
|
12473
13230
|
}
|
|
12474
|
-
function
|
|
12475
|
-
|
|
13231
|
+
function dialogueStabilityAccepted(provider, value) {
|
|
13232
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) return false;
|
|
13233
|
+
const steps = getDialogueCapabilities(provider).stabilitySteps;
|
|
13234
|
+
return steps ? steps.includes(value) : true;
|
|
12476
13235
|
}
|
|
12477
13236
|
|
|
12478
13237
|
// src/safety-retry-policy.ts
|
|
@@ -12580,42 +13339,199 @@ function resolveCaptionLevers(style, look, explicit, fontSize) {
|
|
|
12580
13339
|
return resolveCaptionLook(effective, explicit, fontSize);
|
|
12581
13340
|
}
|
|
12582
13341
|
|
|
12583
|
-
// src/
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
13342
|
+
// src/caption-plan.ts
|
|
13343
|
+
var nonNegative = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
|
|
13344
|
+
function parseCaptionPlan(raw) {
|
|
13345
|
+
let value = raw;
|
|
13346
|
+
if (typeof raw === "string") {
|
|
13347
|
+
try {
|
|
13348
|
+
value = JSON.parse(raw);
|
|
13349
|
+
} catch {
|
|
13350
|
+
return { error: "Caption plan: not valid JSON." };
|
|
13351
|
+
}
|
|
13352
|
+
}
|
|
13353
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return { error: "Caption plan: not an object." };
|
|
13354
|
+
const o = value;
|
|
13355
|
+
if (o.v !== 1) return { error: "Caption plan: v must be 1." };
|
|
13356
|
+
if (typeof o.hookText !== "string") return { error: "Caption plan: hookText must be text." };
|
|
13357
|
+
for (const f of ["hookEndMs", "bodyEndMs"]) {
|
|
13358
|
+
if (!nonNegative(o[f])) return { error: `Caption plan: ${f} must be a non-negative number.` };
|
|
13359
|
+
}
|
|
13360
|
+
if (o.videoDurationMs !== void 0 && !nonNegative(o.videoDurationMs)) {
|
|
13361
|
+
return { error: "Caption plan: videoDurationMs must be a non-negative number." };
|
|
13362
|
+
}
|
|
13363
|
+
if (o.language !== void 0 && typeof o.language !== "string") return { error: "Caption plan: language must be text." };
|
|
13364
|
+
if (!Array.isArray(o.captions)) return { error: "Caption plan: captions must be a list." };
|
|
13365
|
+
const captions = [];
|
|
13366
|
+
for (let i = 0; i < o.captions.length; i++) {
|
|
13367
|
+
const c = o.captions[i];
|
|
13368
|
+
if (!c || typeof c !== "object" || typeof c.text !== "string" || !nonNegative(c.startMs) || !nonNegative(c.endMs)) {
|
|
13369
|
+
return { error: `Caption plan: captions[${i}] needs text, startMs and endMs.` };
|
|
13370
|
+
}
|
|
13371
|
+
if (c.endMs < c.startMs) return { error: `Caption plan: captions[${i}] ends before it starts.` };
|
|
13372
|
+
captions.push({ text: c.text, startMs: c.startMs, endMs: c.endMs });
|
|
13373
|
+
}
|
|
13374
|
+
return {
|
|
13375
|
+
plan: {
|
|
13376
|
+
v: 1,
|
|
13377
|
+
hookText: o.hookText,
|
|
13378
|
+
hookEndMs: o.hookEndMs,
|
|
13379
|
+
bodyEndMs: o.bodyEndMs,
|
|
13380
|
+
captions,
|
|
13381
|
+
...o.videoDurationMs !== void 0 ? { videoDurationMs: o.videoDurationMs } : {},
|
|
13382
|
+
...o.language !== void 0 ? { language: o.language } : {}
|
|
13383
|
+
}
|
|
13384
|
+
};
|
|
12588
13385
|
}
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
var
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
13386
|
+
|
|
13387
|
+
// src/supported-fonts.ts
|
|
13388
|
+
var SUPPORTED_FONT_NAMES = [
|
|
13389
|
+
"Inter",
|
|
13390
|
+
"Roboto",
|
|
13391
|
+
"Open Sans",
|
|
13392
|
+
"Montserrat",
|
|
13393
|
+
"Poppins",
|
|
13394
|
+
"Raleway",
|
|
13395
|
+
"Nunito",
|
|
13396
|
+
"Lato",
|
|
13397
|
+
"Playfair Display",
|
|
13398
|
+
"Merriweather",
|
|
13399
|
+
"Lora",
|
|
13400
|
+
"EB Garamond",
|
|
13401
|
+
"Bebas Neue",
|
|
13402
|
+
"Oswald",
|
|
13403
|
+
"Anton",
|
|
13404
|
+
"Dancing Script",
|
|
13405
|
+
"Pacifico",
|
|
13406
|
+
"Caveat",
|
|
13407
|
+
"Roboto Mono",
|
|
13408
|
+
"Fira Code",
|
|
13409
|
+
"Rubik",
|
|
13410
|
+
"Heebo",
|
|
13411
|
+
"Cairo",
|
|
13412
|
+
"Tajawal"
|
|
13413
|
+
];
|
|
13414
|
+
|
|
13415
|
+
// src/caption-segment-schema.ts
|
|
13416
|
+
var captionFontWeightSchema = z.number().int().min(100).max(900).multipleOf(100);
|
|
13417
|
+
var nonBlankCaptionText = z.string().min(1).refine((t2) => /\S/.test(t2), { message: "text must contain a non-whitespace character" });
|
|
13418
|
+
var captionInputSchema = z.object({
|
|
13419
|
+
text: z.string(),
|
|
13420
|
+
// startMs/endMs are the visibility window and drive the highlight; timestampMs
|
|
13421
|
+
// is the word timestamp used by tiktok-words token timing; confidence is
|
|
13422
|
+
// metadata, ignored by rendering. timestampMs/confidence default to null.
|
|
13423
|
+
startMs: z.number().min(0),
|
|
13424
|
+
endMs: z.number().min(0),
|
|
13425
|
+
timestampMs: z.number().min(0).nullable().default(null),
|
|
13426
|
+
confidence: z.number().min(0).max(1).nullable().default(null)
|
|
13427
|
+
});
|
|
13428
|
+
var captionSegmentInputSchema = z.object({
|
|
13429
|
+
startMs: z.number().min(0),
|
|
13430
|
+
endMs: z.number().min(0),
|
|
13431
|
+
style: z.enum(ALL_CAPTION_STYLES).optional(),
|
|
13432
|
+
position: z.enum(["bottom", "top", "center"]).optional(),
|
|
13433
|
+
fontSize: z.number().min(12).max(200).optional(),
|
|
13434
|
+
color: z.string().optional(),
|
|
13435
|
+
backgroundColor: z.string().optional(),
|
|
13436
|
+
// A named look preset (outline/clean); explicit levers below override it.
|
|
13437
|
+
look: z.enum(CAPTION_LOOK_IDS).optional(),
|
|
13438
|
+
fontFamily: z.enum(SUPPORTED_FONT_NAMES).optional(),
|
|
13439
|
+
fontWeight: captionFontWeightSchema.optional(),
|
|
13440
|
+
strokeColor: z.string().optional(),
|
|
13441
|
+
strokeWidth: z.number().min(0).max(40).optional(),
|
|
13442
|
+
highlightColor: z.string().optional(),
|
|
13443
|
+
uppercase: z.boolean().optional(),
|
|
13444
|
+
positionY: z.number().min(0).max(100).optional(),
|
|
13445
|
+
animate: z.boolean().optional(),
|
|
13446
|
+
maxWordsPerLine: z.number().int().min(CAPTION_MAX_WORDS_PER_LINE_MIN).max(CAPTION_MAX_WORDS_PER_LINE_MAX).optional(),
|
|
13447
|
+
text: nonBlankCaptionText.optional(),
|
|
13448
|
+
captions: z.array(captionInputSchema).optional()
|
|
13449
|
+
}).refine((s) => s.endMs > s.startMs, { message: "segment endMs must be greater than startMs" });
|
|
13450
|
+
var CAPTION_SEGMENT_SCHEMA_KEYS = Object.keys(captionSegmentInputSchema.shape);
|
|
13451
|
+
function findSegmentOverlap(segments) {
|
|
13452
|
+
const sorted = [...segments].sort((a, b) => a.startMs - b.startMs);
|
|
13453
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
13454
|
+
if (sorted[i].startMs < sorted[i - 1].endMs) {
|
|
13455
|
+
return `segments overlap: [${sorted[i - 1].startMs}, ${sorted[i - 1].endMs}) and [${sorted[i].startMs}, ${sorted[i].endMs})`;
|
|
13456
|
+
}
|
|
13457
|
+
}
|
|
13458
|
+
return null;
|
|
13459
|
+
}
|
|
13460
|
+
|
|
13461
|
+
// src/add-captions-plan.ts
|
|
13462
|
+
function captionPlanBodyLevers(nodeData, leverKeys) {
|
|
13463
|
+
const levers = {};
|
|
13464
|
+
for (const k of leverKeys) {
|
|
13465
|
+
const v = nodeData[k];
|
|
13466
|
+
if (v !== void 0 && v !== null) levers[k] = v;
|
|
13467
|
+
}
|
|
13468
|
+
return Object.keys(levers).length > 0 ? levers : void 0;
|
|
13469
|
+
}
|
|
13470
|
+
function styleCaptionPlan(raw, nodeData, styler) {
|
|
13471
|
+
const parsed = parseCaptionPlan(raw);
|
|
13472
|
+
if ("error" in parsed) return { error: parsed.error };
|
|
13473
|
+
const bodyLevers = captionPlanBodyLevers(nodeData, styler.leverKeys);
|
|
13474
|
+
const { segments } = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : void 0);
|
|
13475
|
+
for (let i = 0; i < segments.length; i++) {
|
|
13476
|
+
const r = captionSegmentInputSchema.safeParse(segments[i]);
|
|
13477
|
+
if (!r.success) return { error: `Caption plan: segment ${i + 1}: ${r.error.issues[0]?.message ?? "invalid"}.` };
|
|
13478
|
+
}
|
|
13479
|
+
const overlap = findSegmentOverlap(segments);
|
|
13480
|
+
if (overlap) return { error: `Caption plan: ${overlap}.` };
|
|
13481
|
+
return { segments };
|
|
13482
|
+
}
|
|
13483
|
+
|
|
13484
|
+
// src/node-pass-through.ts
|
|
13485
|
+
var present = (u) => typeof u === "string" && u.length > 0;
|
|
13486
|
+
function combineVideosPassThrough(videoUrls) {
|
|
13487
|
+
const urls = videoUrls.filter(present);
|
|
13488
|
+
return urls.length === 1 ? { videoUrl: urls[0], warning: "single_input" } : null;
|
|
13489
|
+
}
|
|
13490
|
+
function videoOverlayPassThrough(input) {
|
|
13491
|
+
if (!input.planWired || input.layerCount > 0 || !present(input.videoUrl)) return null;
|
|
13492
|
+
return { videoUrl: input.videoUrl, warning: "no_layers" };
|
|
13493
|
+
}
|
|
13494
|
+
function captionPlanPassThrough(input) {
|
|
13495
|
+
if (!input.planWired || input.segmentCount > 0 || !present(input.videoUrl)) return null;
|
|
13496
|
+
return { videoUrl: input.videoUrl, warning: "no_captions" };
|
|
13497
|
+
}
|
|
13498
|
+
|
|
13499
|
+
// src/transcribe-preflight.ts
|
|
13500
|
+
function transcribeWordTimestampsRefusal(provider) {
|
|
13501
|
+
const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
|
|
13502
|
+
if (transcribeLaneSupportsWordTimestamps(lane)) return null;
|
|
13503
|
+
return `the "${lane}" engine does not return word timings \u2014 pick ${transcribeProvidersWithWordTimestamps().join(" or ")}`;
|
|
13504
|
+
}
|
|
13505
|
+
var TRANSCRIBE_JSON_OUT = "json";
|
|
13506
|
+
var TRANSCRIPT_IN = "transcript";
|
|
13507
|
+
var RENDER_JSON_OUT = "json";
|
|
13508
|
+
function findWordlessTranscriptFeeds(nodes, edges) {
|
|
13509
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
13510
|
+
const isSkipped = (n) => !n || n.data?.skipped === true;
|
|
13511
|
+
const out = [];
|
|
13512
|
+
for (const node of nodes) {
|
|
13513
|
+
if (node.type !== "transcribe" || isSkipped(node)) continue;
|
|
13514
|
+
const provider = typeof node.data?.provider === "string" && node.data.provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
|
|
13515
|
+
const refusal = transcribeWordTimestampsRefusal(provider);
|
|
13516
|
+
if (!refusal) continue;
|
|
13517
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13518
|
+
const frontier = [{ id: node.id, outHandle: TRANSCRIBE_JSON_OUT }];
|
|
13519
|
+
while (frontier.length > 0) {
|
|
13520
|
+
const { id, outHandle } = frontier.pop();
|
|
13521
|
+
for (const e of edges) {
|
|
13522
|
+
if (e.source !== id || (e.sourceHandle ?? null) !== outHandle || e.targetHandle !== TRANSCRIPT_IN) continue;
|
|
13523
|
+
const target = byId.get(e.target);
|
|
13524
|
+
if (isSkipped(target)) continue;
|
|
13525
|
+
if (target.type === "add-captions") {
|
|
12610
13526
|
out.push({
|
|
12611
13527
|
transcribeNodeId: node.id,
|
|
12612
13528
|
consumerNodeId: target.id,
|
|
12613
13529
|
provider,
|
|
12614
13530
|
message: `Captions need word timings, but ${refusal}.`
|
|
12615
13531
|
});
|
|
12616
|
-
} else if (target.type
|
|
13532
|
+
} else if (rendersTranscriptJson(target.type) && !seen.has(target.id)) {
|
|
12617
13533
|
seen.add(target.id);
|
|
12618
|
-
frontier.push({ id: target.id, outHandle:
|
|
13534
|
+
frontier.push({ id: target.id, outHandle: RENDER_JSON_OUT });
|
|
12619
13535
|
}
|
|
12620
13536
|
}
|
|
12621
13537
|
}
|
|
@@ -12780,9 +13696,16 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
12780
13696
|
// Row-aligned twin of __listResults (Extract Field, List output) — read only
|
|
12781
13697
|
// by the fan-out so two lists cut from one array pair by row.
|
|
12782
13698
|
"__alignedListResults",
|
|
13699
|
+
// A render's fan-out row stamps, row-aligned with __listResults: each row's
|
|
13700
|
+
// take identity, and the clip every row was sent for (a failed row too).
|
|
13701
|
+
"__listResultStamps",
|
|
12783
13702
|
// List fan-out window flag (abandon-guard exemption). Set/cleared by
|
|
12784
13703
|
// executeNodeForList — purely execution-related, never user-edited.
|
|
12785
13704
|
"__listRunning",
|
|
13705
|
+
// Why the last server run skipped this node (`empty_input`): a chip on the
|
|
13706
|
+
// card for the run that just ended, never a saved result — also in
|
|
13707
|
+
// TRANSIENT_RUNTIME_KEYS below.
|
|
13708
|
+
"__runSkipReason",
|
|
12786
13709
|
// One token per paid run still out on this node that no executor mark
|
|
12787
13710
|
// covers (the editor's `withRunInFlight`, around each paid call outside the
|
|
12788
13711
|
// executors). Purely execution-related, never user-edited; also in
|
|
@@ -12849,6 +13772,12 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
12849
13772
|
"searchResults",
|
|
12850
13773
|
"pickedIds",
|
|
12851
13774
|
"searchWarnings",
|
|
13775
|
+
// Save to Collection: how the last run ended for this node (inserted /
|
|
13776
|
+
// duplicate / replayed) and how many old records the cap evicted. RESULTS of
|
|
13777
|
+
// a run — Clear results wipes them, and a template, a preset or a run-only
|
|
13778
|
+
// patch never carries them as configuration.
|
|
13779
|
+
"lastOutcome",
|
|
13780
|
+
"lastEvicted",
|
|
12852
13781
|
// When the editor's "Clear results" last emptied this node (ISO time). Not a
|
|
12853
13782
|
// result and not config: bookkeeping that tells the load-time recovery lanes
|
|
12854
13783
|
// "this node is empty ON PURPOSE" — without it, every reload reads an empty
|
|
@@ -12878,6 +13807,7 @@ var TRANSIENT_RUNTIME_KEYS = /* @__PURE__ */ new Set([
|
|
|
12878
13807
|
"__listTotal",
|
|
12879
13808
|
"__listCompleted",
|
|
12880
13809
|
"__listRunning",
|
|
13810
|
+
"__runSkipReason",
|
|
12881
13811
|
// A paid run still out, held by the editor tab that started it. Never
|
|
12882
13812
|
// saved, so a reload, which has no such run, starts without one.
|
|
12883
13813
|
"__runsInFlight",
|
|
@@ -15500,6 +16430,24 @@ function resolveAudioCrossfadeCurve(id) {
|
|
|
15500
16430
|
return CURVES_BY_ID.get(id)?.ffmpeg ?? "tri";
|
|
15501
16431
|
}
|
|
15502
16432
|
|
|
16433
|
+
// src/fan-out-meta.ts
|
|
16434
|
+
function fanOutItemMeta(output) {
|
|
16435
|
+
const w = output?.clipWarnings;
|
|
16436
|
+
const d = output?.durationSec;
|
|
16437
|
+
return {
|
|
16438
|
+
warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
|
|
16439
|
+
durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
|
|
16440
|
+
};
|
|
16441
|
+
}
|
|
16442
|
+
function clipNotesFrom(meta, single) {
|
|
16443
|
+
const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
|
|
16444
|
+
return rows.map((m, i) => ({
|
|
16445
|
+
clip: i + 1,
|
|
16446
|
+
warnings: m?.warnings ?? [],
|
|
16447
|
+
...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
|
|
16448
|
+
}));
|
|
16449
|
+
}
|
|
16450
|
+
|
|
15503
16451
|
// src/suno-track-sources.ts
|
|
15504
16452
|
var SUNO_TRACK_SOURCE_TYPES = /* @__PURE__ */ new Set([
|
|
15505
16453
|
"suno-generate",
|
|
@@ -15616,6 +16564,20 @@ function nodeStateMayCarryOutput(status) {
|
|
|
15616
16564
|
return status !== void 0 && OUTPUT_BEARING_NODE_STATUSES.has(status);
|
|
15617
16565
|
}
|
|
15618
16566
|
|
|
16567
|
+
// src/execution-outcome.ts
|
|
16568
|
+
var EMPTY_INPUT = "empty_input";
|
|
16569
|
+
function countEmptyInputSkips(nodeStates) {
|
|
16570
|
+
let count = 0;
|
|
16571
|
+
for (const state of Object.values(nodeStates ?? {})) {
|
|
16572
|
+
if (state && state.status === "skipped" && state.skipReason === EMPTY_INPUT) count += 1;
|
|
16573
|
+
}
|
|
16574
|
+
return count;
|
|
16575
|
+
}
|
|
16576
|
+
function executionOutcome(status, nodeStates) {
|
|
16577
|
+
if (status !== "completed") return void 0;
|
|
16578
|
+
return countEmptyInputSkips(nodeStates) > 0 ? "nothing_new" : "succeeded";
|
|
16579
|
+
}
|
|
16580
|
+
|
|
15619
16581
|
// src/normalize-node-params.ts
|
|
15620
16582
|
var MODEL_PARAM_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
15621
16583
|
"generate-image",
|
|
@@ -16340,6 +17302,10 @@ var ENUM_TARGETS = [
|
|
|
16340
17302
|
[LIP_SYNC_PROVIDERS, "lip-sync"],
|
|
16341
17303
|
[FACE_SWAP_PROVIDERS, "face-swap"],
|
|
16342
17304
|
[TTS_PROVIDERS, "text-to-speech"],
|
|
17305
|
+
// A dialogue model's id is the node's `provider`: without this row the Models
|
|
17306
|
+
// tab would create a BARE dialogue node, which runs as the default (v3) whatever
|
|
17307
|
+
// the user picked.
|
|
17308
|
+
[DIALOGUE_PROVIDERS, "text-to-dialogue"],
|
|
16343
17309
|
[TEXT_TO_AUDIO_PROVIDERS, "text-to-audio"],
|
|
16344
17310
|
[TRANSCRIBE_PROVIDERS, "transcribe"],
|
|
16345
17311
|
[MUSIC_PROVIDERS, "suno-generate"]
|
|
@@ -16463,34 +17429,6 @@ var AUDIO_FX_REVERB_PRESETS = /* @__PURE__ */ new Set([
|
|
|
16463
17429
|
"outdoor"
|
|
16464
17430
|
]);
|
|
16465
17431
|
|
|
16466
|
-
// src/supported-fonts.ts
|
|
16467
|
-
var SUPPORTED_FONT_NAMES = [
|
|
16468
|
-
"Inter",
|
|
16469
|
-
"Roboto",
|
|
16470
|
-
"Open Sans",
|
|
16471
|
-
"Montserrat",
|
|
16472
|
-
"Poppins",
|
|
16473
|
-
"Raleway",
|
|
16474
|
-
"Nunito",
|
|
16475
|
-
"Lato",
|
|
16476
|
-
"Playfair Display",
|
|
16477
|
-
"Merriweather",
|
|
16478
|
-
"Lora",
|
|
16479
|
-
"EB Garamond",
|
|
16480
|
-
"Bebas Neue",
|
|
16481
|
-
"Oswald",
|
|
16482
|
-
"Anton",
|
|
16483
|
-
"Dancing Script",
|
|
16484
|
-
"Pacifico",
|
|
16485
|
-
"Caveat",
|
|
16486
|
-
"Roboto Mono",
|
|
16487
|
-
"Fira Code",
|
|
16488
|
-
"Rubik",
|
|
16489
|
-
"Heebo",
|
|
16490
|
-
"Cairo",
|
|
16491
|
-
"Tajawal"
|
|
16492
|
-
];
|
|
16493
|
-
|
|
16494
17432
|
// src/image-overlay-shapes.ts
|
|
16495
17433
|
var OVERLAY_SHAPES = [
|
|
16496
17434
|
"rect",
|
|
@@ -16709,7 +17647,8 @@ var VIDEO_OVERLAY_ERROR_CODES = [
|
|
|
16709
17647
|
"time_out_of_range",
|
|
16710
17648
|
"end_before_start",
|
|
16711
17649
|
"fit_without_aspect",
|
|
16712
|
-
"field_out_of_bounds"
|
|
17650
|
+
"field_out_of_bounds",
|
|
17651
|
+
"invalid_layer_plan"
|
|
16713
17652
|
];
|
|
16714
17653
|
var badge = (anchor, sx, sy) => ({
|
|
16715
17654
|
anchor,
|
|
@@ -16779,13 +17718,13 @@ function sameShallow(a, b) {
|
|
|
16779
17718
|
function expandVideoOverlayLayer(raw) {
|
|
16780
17719
|
const obj = asLayer(raw);
|
|
16781
17720
|
const layer = obj ? clean(obj) : {};
|
|
16782
|
-
const
|
|
17721
|
+
const present2 = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => layer[f] !== void 0);
|
|
16783
17722
|
let out;
|
|
16784
17723
|
if (isVideoOverlayPresetId(layer.preset)) {
|
|
16785
17724
|
const box = videoOverlayPresetBox(layer.preset, layer.corner);
|
|
16786
17725
|
out = { ...box, ...layer };
|
|
16787
|
-
if (
|
|
16788
|
-
} else if (
|
|
17726
|
+
if (present2.some((f) => layer[f] !== box[f])) delete out.preset;
|
|
17727
|
+
} else if (present2.length === 0) {
|
|
16789
17728
|
out = { ...DEFAULT_VIDEO_OVERLAY_LAYER, ...videoOverlayPresetBox("corner-badge", layer.corner), ...layer };
|
|
16790
17729
|
} else if (layer.anchor === void 0 || layer.width === void 0) {
|
|
16791
17730
|
return raw;
|
|
@@ -16861,11 +17800,12 @@ function normalizeVideoOverlayNodes(nodes, edges) {
|
|
|
16861
17800
|
});
|
|
16862
17801
|
return changed ? out : nodes;
|
|
16863
17802
|
}
|
|
17803
|
+
var PLAN_LAYER_Z_BASE = 1e3;
|
|
16864
17804
|
var isSlot = (v) => typeof v === "number" && Number.isInteger(v) && v >= 1;
|
|
16865
17805
|
var isIndex = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
16866
17806
|
function videoOverlayRenderOrder(layers) {
|
|
16867
17807
|
return layers.map((l, i) => {
|
|
16868
|
-
const own = isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
|
|
17808
|
+
const own = isSlot(l?.planLayer) ? l.planLayer - 1 - PLAN_LAYER_Z_BASE : isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
|
|
16869
17809
|
return { i, z: typeof l?.zIndex === "number" && Number.isFinite(l.zIndex) ? l.zIndex : own };
|
|
16870
17810
|
}).sort((a, b) => a.z - b.z || a.i - b.i).map((e) => e.i);
|
|
16871
17811
|
}
|
|
@@ -16941,6 +17881,7 @@ function hasDrawableVideoOverlayBox(layer) {
|
|
|
16941
17881
|
return outOfBounds(l) === null;
|
|
16942
17882
|
}
|
|
16943
17883
|
function validateVideoOverlayRequest(body) {
|
|
17884
|
+
if (body.planError) return { ok: false, code: "invalid_layer_plan", params: {} };
|
|
16944
17885
|
const layers = Array.isArray(body.layers) ? body.layers : [];
|
|
16945
17886
|
if (layers.length === 0) return { ok: false, code: "no_layers", params: {} };
|
|
16946
17887
|
if (layers.length > VIDEO_OVERLAY_MAX_LAYERS) {
|
|
@@ -16953,6 +17894,7 @@ function validateVideoOverlayRequest(body) {
|
|
|
16953
17894
|
code,
|
|
16954
17895
|
layer: i,
|
|
16955
17896
|
...typeof l.slot === "number" ? { slot: l.slot } : {},
|
|
17897
|
+
...typeof l.planLayer === "number" ? { planLayer: l.planLayer } : {},
|
|
16956
17898
|
params
|
|
16957
17899
|
});
|
|
16958
17900
|
const boxFields = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== void 0 && l[f] !== null);
|
|
@@ -16979,16 +17921,33 @@ var MESSAGES = {
|
|
|
16979
17921
|
time_out_of_range: (p) => `${p.field} must be between 0 and ${p.max} s`,
|
|
16980
17922
|
end_before_start: (p) => `end (${p.end} s) must be after start (${p.start} s)`,
|
|
16981
17923
|
fit_without_aspect: () => "baseFit and backgroundColor need an outputAspect",
|
|
16982
|
-
field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})
|
|
17924
|
+
field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})`,
|
|
17925
|
+
invalid_layer_plan: () => "the layer plan must be a list of layers"
|
|
16983
17926
|
};
|
|
17927
|
+
var PLAN_LAYER_WITHOUT_IMAGE = "no image \u2014 set imageUrl on this layer in the plan.";
|
|
16984
17928
|
function videoOverlayLayerLabel(ref) {
|
|
17929
|
+
if (typeof ref.planLayer === "number") return `Plan layer ${ref.planLayer}`;
|
|
16985
17930
|
return typeof ref.slot === "number" ? `Layer ${ref.slot}` : typeof ref.layer === "number" ? `layers[${ref.layer}]` : "";
|
|
16986
17931
|
}
|
|
16987
17932
|
function formatVideoOverlayError(issue2) {
|
|
16988
17933
|
const label = videoOverlayLayerLabel(issue2);
|
|
16989
|
-
const text = MESSAGES[issue2.code](issue2.params);
|
|
17934
|
+
const text = issue2.code === "layer_without_image" && typeof issue2.planLayer === "number" ? PLAN_LAYER_WITHOUT_IMAGE : MESSAGES[issue2.code](issue2.params);
|
|
16990
17935
|
return label ? `${label}: ${text}` : text;
|
|
16991
17936
|
}
|
|
17937
|
+
function parseVideoOverlayLayerPlan(raw) {
|
|
17938
|
+
let value = raw;
|
|
17939
|
+
if (typeof raw === "string") {
|
|
17940
|
+
try {
|
|
17941
|
+
value = JSON.parse(raw);
|
|
17942
|
+
} catch {
|
|
17943
|
+
return { error: "invalid_layer_plan" };
|
|
17944
|
+
}
|
|
17945
|
+
}
|
|
17946
|
+
if (!Array.isArray(value) || !value.every((l) => l !== null && typeof l === "object" && !Array.isArray(l))) {
|
|
17947
|
+
return { error: "invalid_layer_plan" };
|
|
17948
|
+
}
|
|
17949
|
+
return { layers: value };
|
|
17950
|
+
}
|
|
16992
17951
|
function assembleVideoOverlayRequest(input) {
|
|
16993
17952
|
const stored = Array.isArray(input.data.layers) ? input.data.layers : [];
|
|
16994
17953
|
const wired = input.wiredImageUrls.slice(0, VIDEO_OVERLAY_HANDLE_IDS.length);
|
|
@@ -17005,13 +17964,19 @@ function assembleVideoOverlayRequest(input) {
|
|
|
17005
17964
|
const outputAspect = isVideoOverlayOutputAspect(input.data.outputAspect) ? input.data.outputAspect : void 0;
|
|
17006
17965
|
const baseFit = isFit(input.data.baseFit) ? input.data.baseFit : void 0;
|
|
17007
17966
|
const backgroundColor = typeof input.data.backgroundColor === "string" && HEX6.test(input.data.backgroundColor) ? input.data.backgroundColor : void 0;
|
|
17008
|
-
|
|
17009
|
-
videoUrl: input.videoUrl,
|
|
17010
|
-
layers,
|
|
17967
|
+
const rest = {
|
|
17011
17968
|
...outputAspect ? { outputAspect } : {},
|
|
17012
17969
|
...baseFit ? { baseFit } : {},
|
|
17013
17970
|
...backgroundColor ? { backgroundColor } : {}
|
|
17014
17971
|
};
|
|
17972
|
+
if (input.planLayers === void 0) return { videoUrl: input.videoUrl, layers, ...rest };
|
|
17973
|
+
const plan = parseVideoOverlayLayerPlan(input.planLayers);
|
|
17974
|
+
if ("error" in plan) return { videoUrl: input.videoUrl, layers, ...rest, planError: plan.error };
|
|
17975
|
+
const planned = expandVideoOverlayPresets(plan.layers).map((l, i) => {
|
|
17976
|
+
const { slot: _slot, ...own } = l;
|
|
17977
|
+
return { ...own, planLayer: i + 1 };
|
|
17978
|
+
});
|
|
17979
|
+
return { videoUrl: input.videoUrl, layers: [...planned, ...layers], ...rest };
|
|
17015
17980
|
}
|
|
17016
17981
|
function videoOverlaySlotSources(layers, wiredImageUrls) {
|
|
17017
17982
|
const stored = Array.isArray(layers) ? layers : [];
|
|
@@ -17039,16 +18004,19 @@ var VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH = 65536;
|
|
|
17039
18004
|
function videoOverlayCompositionKey(c) {
|
|
17040
18005
|
const sources = c.sources.map((s) => typeof s === "string" && s.length > 0 ? s : null);
|
|
17041
18006
|
while (sources.length > 0 && sources[sources.length - 1] === null) sources.pop();
|
|
17042
|
-
|
|
17043
|
-
|
|
17044
|
-
|
|
17045
|
-
|
|
17046
|
-
|
|
17047
|
-
|
|
17048
|
-
|
|
17049
|
-
|
|
17050
|
-
|
|
17051
|
-
|
|
18007
|
+
const parts = [
|
|
18008
|
+
c.baseUrl || null,
|
|
18009
|
+
sources,
|
|
18010
|
+
Array.isArray(c.data.layers) ? c.data.layers : [],
|
|
18011
|
+
c.data.outputAspect ?? null,
|
|
18012
|
+
c.data.baseFit ?? null,
|
|
18013
|
+
c.data.backgroundColor ?? null
|
|
18014
|
+
];
|
|
18015
|
+
if (c.planLayers !== void 0) {
|
|
18016
|
+
const plan = parseVideoOverlayLayerPlan(c.planLayers);
|
|
18017
|
+
parts.push("error" in plan ? "invalid" : plan.layers);
|
|
18018
|
+
}
|
|
18019
|
+
return JSON.stringify(canonicalValue(parts));
|
|
17052
18020
|
}
|
|
17053
18021
|
|
|
17054
18022
|
// src/entity-image-handle.ts
|
|
@@ -19475,8 +20443,8 @@ function scene3DCameraTrackIssues(track) {
|
|
|
19475
20443
|
}
|
|
19476
20444
|
const quaternionTolerance = SCENE3D_CAMERA_TRACK_LIMITS.quaternionTolerance;
|
|
19477
20445
|
track.samples.forEach((sample, index) => {
|
|
19478
|
-
const [x, y,
|
|
19479
|
-
const norm = Math.sqrt(x * x + y * y +
|
|
20446
|
+
const [x, y, z26, w] = sample.quaternion;
|
|
20447
|
+
const norm = Math.sqrt(x * x + y * y + z26 * z26 + w * w);
|
|
19480
20448
|
if (Math.abs(norm - 1) > quaternionTolerance) {
|
|
19481
20449
|
issues.push({
|
|
19482
20450
|
path: ["samples", index, "quaternion"],
|
|
@@ -19889,7 +20857,7 @@ var STUDIO_KEYFRAME_TRANSIENT_KEYS = ["pendingImages"];
|
|
|
19889
20857
|
var STUDIO_KEYFRAME_REVIEW_KEYS = ["rejections"];
|
|
19890
20858
|
var STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS = ["waivedReason"];
|
|
19891
20859
|
var STUDIO_KEYFRAME_PRIVATE_KEYS = [...STUDIO_KEYFRAME_TRANSIENT_KEYS, ...STUDIO_KEYFRAME_REVIEW_KEYS];
|
|
19892
|
-
function
|
|
20860
|
+
function isRecord3(value) {
|
|
19893
20861
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
19894
20862
|
}
|
|
19895
20863
|
function withoutKeys(source, drop) {
|
|
@@ -19916,9 +20884,9 @@ function stripPrevizRunState(value) {
|
|
|
19916
20884
|
if (!Array.isArray(value)) return value;
|
|
19917
20885
|
let changed = false;
|
|
19918
20886
|
const out = value.map((entry) => {
|
|
19919
|
-
if (!
|
|
20887
|
+
if (!isRecord3(entry)) return entry;
|
|
19920
20888
|
const previz = entry.previsualization;
|
|
19921
|
-
if (!
|
|
20889
|
+
if (!isRecord3(previz) || !STUDIO_PREVIZ_RUN_STATE_KEYS.some((key) => key in previz)) return entry;
|
|
19922
20890
|
changed = true;
|
|
19923
20891
|
return { ...entry, previsualization: withoutKeys(previz, STUDIO_PREVIZ_RUN_STATE_KEYS) };
|
|
19924
20892
|
});
|
|
@@ -19942,8 +20910,8 @@ function stripStudioTakeVoiceRecords(nodes) {
|
|
|
19942
20910
|
if (!Array.isArray(nodes)) return nodes;
|
|
19943
20911
|
let changed = false;
|
|
19944
20912
|
const out = nodes.map((node) => {
|
|
19945
|
-
const data =
|
|
19946
|
-
if (!
|
|
20913
|
+
const data = isRecord3(node) ? node.data : void 0;
|
|
20914
|
+
if (!isRecord3(data)) return node;
|
|
19947
20915
|
const results = stripRows(data.generatedResults, STUDIO_TAKE_PRIVATE_KEYS);
|
|
19948
20916
|
const unitResults = stripRows(data.sequenceUnitResults, STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS);
|
|
19949
20917
|
const running = STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS.some((key) => key in data);
|
|
@@ -19960,7 +20928,7 @@ function stripRows(value, drop) {
|
|
|
19960
20928
|
if (!Array.isArray(value)) return value;
|
|
19961
20929
|
let changed = false;
|
|
19962
20930
|
const out = value.map((row) => {
|
|
19963
|
-
if (!
|
|
20931
|
+
if (!isRecord3(row) || !drop.some((key) => key in row)) return row;
|
|
19964
20932
|
changed = true;
|
|
19965
20933
|
return withoutKeys(row, drop);
|
|
19966
20934
|
});
|
|
@@ -19971,7 +20939,7 @@ function stripLinkedOwnerState(studio) {
|
|
|
19971
20939
|
const keyframes = stripKeyframes(studio.keyframes);
|
|
19972
20940
|
const preferences = STUDIO_SEQUENCE_POLICY_KEYS.filter((key) => {
|
|
19973
20941
|
const value = studio[key];
|
|
19974
|
-
return
|
|
20942
|
+
return isRecord3(value) && Object.keys(value).length > 0;
|
|
19975
20943
|
});
|
|
19976
20944
|
if (!STUDIO_SEQUENCE_PLANNING_KEYS.some((key) => key in studio) && takes === studio.sequenceTakes && keyframes === studio.keyframes && preferences.length === 0) return studio;
|
|
19977
20945
|
const kept = withoutKeys(studio, STUDIO_SEQUENCE_PLANNING_KEYS);
|
|
@@ -19984,10 +20952,10 @@ function stripTakeUnitReviews(value) {
|
|
|
19984
20952
|
if (!Array.isArray(value)) return value;
|
|
19985
20953
|
let changed = false;
|
|
19986
20954
|
const out = value.map((take) => {
|
|
19987
|
-
if (!
|
|
20955
|
+
if (!isRecord3(take) || !Array.isArray(take.units)) return take;
|
|
19988
20956
|
let touched = false;
|
|
19989
20957
|
const units = take.units.map((unit) => {
|
|
19990
|
-
if (!
|
|
20958
|
+
if (!isRecord3(unit) || !STUDIO_SEQUENCE_UNIT_REVIEW_KEYS.some((key) => key in unit)) return unit;
|
|
19991
20959
|
touched = true;
|
|
19992
20960
|
return withoutKeys(unit, STUDIO_SEQUENCE_UNIT_REVIEW_KEYS);
|
|
19993
20961
|
});
|
|
@@ -20001,7 +20969,7 @@ function stripKeyframes(value) {
|
|
|
20001
20969
|
if (!Array.isArray(value)) return value;
|
|
20002
20970
|
let changed = false;
|
|
20003
20971
|
const out = value.map((frame) => {
|
|
20004
|
-
if (!
|
|
20972
|
+
if (!isRecord3(frame)) return frame;
|
|
20005
20973
|
const kept = keyframeForReader(frame, STUDIO_KEYFRAME_REVIEW_KEYS);
|
|
20006
20974
|
if (kept !== frame) changed = true;
|
|
20007
20975
|
return kept;
|
|
@@ -20010,7 +20978,7 @@ function stripKeyframes(value) {
|
|
|
20010
20978
|
}
|
|
20011
20979
|
function keyframeForReader(frame, drop) {
|
|
20012
20980
|
const acceptance = frame.acceptance;
|
|
20013
|
-
const waived =
|
|
20981
|
+
const waived = isRecord3(acceptance) && STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS.some((key) => key in acceptance);
|
|
20014
20982
|
if (!waived && !drop.some((key) => key in frame)) return frame;
|
|
20015
20983
|
const kept = withoutKeys(frame, drop);
|
|
20016
20984
|
if (waived) kept.acceptance = withoutKeys(acceptance, STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS);
|
|
@@ -20019,7 +20987,7 @@ function keyframeForReader(frame, drop) {
|
|
|
20019
20987
|
function stripStudioDraftSettings(settings) {
|
|
20020
20988
|
if (!settings || typeof settings !== "object") return settings;
|
|
20021
20989
|
const studio = settings.studio;
|
|
20022
|
-
if (!
|
|
20990
|
+
if (!isRecord3(studio)) return settings;
|
|
20023
20991
|
const shots = stripShots(studio.shots, STUDIO_SHOT_PRIVATE_KEYS);
|
|
20024
20992
|
const trash = stripBin(studio.trash);
|
|
20025
20993
|
const planned = stripLinkedOwnerState(studio);
|
|
@@ -20034,11 +21002,11 @@ function stripBin(trash) {
|
|
|
20034
21002
|
let changed = false;
|
|
20035
21003
|
const out = [];
|
|
20036
21004
|
for (const entry of trash) {
|
|
20037
|
-
if (
|
|
21005
|
+
if (isRecord3(entry) && entry.kind === "slot") {
|
|
20038
21006
|
changed = true;
|
|
20039
21007
|
continue;
|
|
20040
21008
|
}
|
|
20041
|
-
const kept = !
|
|
21009
|
+
const kept = !isRecord3(entry) ? entry : entry.kind === "shot" ? binSceneForReader(entry) : entry.kind === "keyframe" ? binKeyframeForReader(entry) : binTakeForReader(entry);
|
|
20042
21010
|
if (kept !== entry) changed = true;
|
|
20043
21011
|
out.push(kept);
|
|
20044
21012
|
}
|
|
@@ -20046,7 +21014,7 @@ function stripBin(trash) {
|
|
|
20046
21014
|
}
|
|
20047
21015
|
function binSceneForReader(entry) {
|
|
20048
21016
|
const graph = entry.graph;
|
|
20049
|
-
if (!
|
|
21017
|
+
if (!isRecord3(graph)) return entry;
|
|
20050
21018
|
const nodes = stripStudioTakeVoiceRecords(graph.nodes);
|
|
20051
21019
|
const settings = stripStudioDraftSettings(graph.settings);
|
|
20052
21020
|
if (nodes === graph.nodes && settings === graph.settings) return entry;
|
|
@@ -20054,12 +21022,12 @@ function binSceneForReader(entry) {
|
|
|
20054
21022
|
}
|
|
20055
21023
|
function binTakeForReader(entry) {
|
|
20056
21024
|
const result = entry.result;
|
|
20057
|
-
if (!
|
|
21025
|
+
if (!isRecord3(result) || !STUDIO_TAKE_PRIVATE_KEYS.some((key) => key in result)) return entry;
|
|
20058
21026
|
return { ...entry, result: withoutKeys(result, STUDIO_TAKE_PRIVATE_KEYS) };
|
|
20059
21027
|
}
|
|
20060
21028
|
function binKeyframeForReader(entry) {
|
|
20061
21029
|
const keyframe = entry.keyframe;
|
|
20062
|
-
if (!
|
|
21030
|
+
if (!isRecord3(keyframe)) return entry;
|
|
20063
21031
|
const kept = keyframeForReader(keyframe, STUDIO_KEYFRAME_PRIVATE_KEYS);
|
|
20064
21032
|
return kept === keyframe ? entry : { ...entry, keyframe: kept };
|
|
20065
21033
|
}
|
|
@@ -20828,6 +21796,9 @@ function edlDurationMs(edl) {
|
|
|
20828
21796
|
const last = edl.segments[edl.segments.length - 1];
|
|
20829
21797
|
return Math.max(0, Math.round(starts[starts.length - 1] + Math.max(0, last.outMs - last.inMs)));
|
|
20830
21798
|
}
|
|
21799
|
+
function edlSegmentOutputStarts(edl) {
|
|
21800
|
+
return segmentOutputStarts(edl);
|
|
21801
|
+
}
|
|
20831
21802
|
function segmentOutputStarts(edl) {
|
|
20832
21803
|
const starts = [];
|
|
20833
21804
|
let cursor = 0;
|
|
@@ -20958,6 +21929,16 @@ function remapMsThroughEdl(edl, sourceMs, sourceId) {
|
|
|
20958
21929
|
}
|
|
20959
21930
|
return null;
|
|
20960
21931
|
}
|
|
21932
|
+
function outputMsToMasterMs(edl, outputMs) {
|
|
21933
|
+
if (!Number.isFinite(outputMs) || outputMs < 0) return null;
|
|
21934
|
+
const starts = segmentOutputStarts(edl);
|
|
21935
|
+
for (let i = edl.segments.length - 1; i >= 0; i--) {
|
|
21936
|
+
const seg = edl.segments[i];
|
|
21937
|
+
const dur = Math.max(0, seg.outMs - seg.inMs);
|
|
21938
|
+
if (outputMs >= starts[i] && outputMs < starts[i] + dur) return Math.round(seg.inMs + (outputMs - starts[i]));
|
|
21939
|
+
}
|
|
21940
|
+
return null;
|
|
21941
|
+
}
|
|
20961
21942
|
function remapTranscriptThroughEdl(edl, transcript) {
|
|
20962
21943
|
const off = offsetFor(edl, transcript.sourceId);
|
|
20963
21944
|
const starts = segmentOutputStarts(edl);
|
|
@@ -21030,7 +22011,7 @@ function speakerTurns(transcript, opts) {
|
|
|
21030
22011
|
}
|
|
21031
22012
|
var num = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
21032
22013
|
var clamp012 = (v) => Math.min(1, Math.max(0, v));
|
|
21033
|
-
var
|
|
22014
|
+
var str3 = (v) => typeof v === "string" ? v : void 0;
|
|
21034
22015
|
function normalizeRegion(r) {
|
|
21035
22016
|
if (!r || typeof r !== "object") return void 0;
|
|
21036
22017
|
const o = r;
|
|
@@ -21047,11 +22028,11 @@ function normalizeEdl(input) {
|
|
|
21047
22028
|
const sources = Array.isArray(o.sources) ? o.sources.map((raw, i) => {
|
|
21048
22029
|
const s = raw ?? {};
|
|
21049
22030
|
const src = {
|
|
21050
|
-
id:
|
|
21051
|
-
url:
|
|
22031
|
+
id: str3(s.id) ?? `src-${i}`,
|
|
22032
|
+
url: str3(s.url) ?? "",
|
|
21052
22033
|
kind: s.kind === "audio" ? "audio" : "video",
|
|
21053
22034
|
...s.offsetMs !== void 0 ? { offsetMs: Math.round(num(s.offsetMs)) } : {},
|
|
21054
|
-
...
|
|
22035
|
+
...str3(s.role) ? { role: s.role } : {},
|
|
21055
22036
|
...Array.isArray(s.speakers) ? { speakers: s.speakers.filter((x) => typeof x === "string") } : {},
|
|
21056
22037
|
...normalizeRegion(s.region) ? { region: normalizeRegion(s.region) } : {}
|
|
21057
22038
|
};
|
|
@@ -21064,12 +22045,12 @@ function normalizeEdl(input) {
|
|
|
21064
22045
|
const t2 = isFirst ? void 0 : s.transition;
|
|
21065
22046
|
const layout = normalizeLayout(s.layout, isFirst);
|
|
21066
22047
|
const seg = {
|
|
21067
|
-
id:
|
|
22048
|
+
id: str3(s.id) ?? `seg-${i}`,
|
|
21068
22049
|
inMs: Math.round(num(s.inMs)),
|
|
21069
22050
|
outMs: Math.round(num(s.outMs)),
|
|
21070
|
-
...
|
|
21071
|
-
...
|
|
21072
|
-
...
|
|
22051
|
+
...str3(s.video) ? { video: str3(s.video) } : {},
|
|
22052
|
+
...str3(s.audio) ? { audio: str3(s.audio) } : {},
|
|
22053
|
+
...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
|
|
21073
22054
|
...t2 && (t2.type === "cut" || t2.type === "crossfade") ? { transition: { type: t2.type, durationMs: t2.type === "cut" ? 0 : Math.round(num(t2.durationMs)) } } : {},
|
|
21074
22055
|
...region ? { region } : {},
|
|
21075
22056
|
...layout ? { layout } : {},
|
|
@@ -21079,7 +22060,7 @@ function normalizeEdl(input) {
|
|
|
21079
22060
|
}) : [];
|
|
21080
22061
|
const dropped = Array.isArray(o.dropped) ? o.dropped.map((raw) => {
|
|
21081
22062
|
const d = raw ?? {};
|
|
21082
|
-
return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason:
|
|
22063
|
+
return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason: str3(d.reason) ?? "manual" };
|
|
21083
22064
|
}) : void 0;
|
|
21084
22065
|
const meta = o.meta && typeof o.meta === "object" ? o.meta : void 0;
|
|
21085
22066
|
return {
|
|
@@ -21088,28 +22069,28 @@ function normalizeEdl(input) {
|
|
|
21088
22069
|
sources,
|
|
21089
22070
|
segments,
|
|
21090
22071
|
...dropped ? { dropped } : {},
|
|
21091
|
-
...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId:
|
|
22072
|
+
...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId: str3(o.derivedFrom.edlId) ?? "", clock: "output" } } : {},
|
|
21092
22073
|
...meta ? { meta } : {}
|
|
21093
22074
|
};
|
|
21094
22075
|
}
|
|
21095
22076
|
function normalizeLayout(input, dropTransition = false) {
|
|
21096
22077
|
if (!input || typeof input !== "object") return void 0;
|
|
21097
22078
|
const o = input;
|
|
21098
|
-
const mode =
|
|
22079
|
+
const mode = str3(o.mode) || "single";
|
|
21099
22080
|
const slots = Array.isArray(o.slots) ? o.slots.map((raw) => {
|
|
21100
22081
|
const s = raw ?? {};
|
|
21101
|
-
const source =
|
|
22082
|
+
const source = str3(s.source);
|
|
21102
22083
|
if (!source) return null;
|
|
21103
22084
|
const region = normalizeRegion(s.region);
|
|
21104
22085
|
return {
|
|
21105
22086
|
source,
|
|
21106
22087
|
...region ? { region } : {},
|
|
21107
|
-
...
|
|
22088
|
+
...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
|
|
21108
22089
|
...s.weight !== void 0 ? { weight: clamp012(num(s.weight)) } : {}
|
|
21109
22090
|
};
|
|
21110
22091
|
}).filter((x) => x !== null) : void 0;
|
|
21111
|
-
const emphasis = o.emphasis && typeof o.emphasis === "object" ? { style:
|
|
21112
|
-
const transition = !dropTransition && o.transition && typeof o.transition === "object" ? { type:
|
|
22092
|
+
const emphasis = o.emphasis && typeof o.emphasis === "object" ? { style: str3(o.emphasis.style) ?? "none", durationMs: Math.round(num(o.emphasis.durationMs)) } : void 0;
|
|
22093
|
+
const transition = !dropTransition && o.transition && typeof o.transition === "object" ? { type: str3(o.transition.type) ?? "cut", durationMs: Math.round(num(o.transition.durationMs)) } : void 0;
|
|
21113
22094
|
return {
|
|
21114
22095
|
mode,
|
|
21115
22096
|
...slots ? { slots } : {},
|
|
@@ -21123,29 +22104,372 @@ function normalizeTranscript(input) {
|
|
|
21123
22104
|
const w = raw ?? {};
|
|
21124
22105
|
const startMs = Math.round(num(w.startMs));
|
|
21125
22106
|
return {
|
|
21126
|
-
text:
|
|
22107
|
+
text: str3(w.text) ?? "",
|
|
21127
22108
|
startMs,
|
|
21128
22109
|
// Never inverted: an endMs < startMs (garbage upstream) would be
|
|
21129
22110
|
// silently dropped at remap; clamp it to a non-negative width.
|
|
21130
22111
|
endMs: Math.max(startMs, Math.round(num(w.endMs))),
|
|
21131
|
-
...
|
|
22112
|
+
...str3(w.speaker) ? { speaker: str3(w.speaker) } : {},
|
|
21132
22113
|
...typeof w.confidence === "number" ? { confidence: w.confidence } : {}
|
|
21133
22114
|
};
|
|
21134
22115
|
}) : [];
|
|
21135
22116
|
const segments = Array.isArray(o.segments) ? o.segments.map((raw) => {
|
|
21136
22117
|
const s = raw ?? {};
|
|
21137
22118
|
const startMs = Math.round(num(s.startMs));
|
|
21138
|
-
return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text:
|
|
22119
|
+
return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text: str3(s.text) ?? "", ...str3(s.speaker) ? { speaker: str3(s.speaker) } : {} };
|
|
21139
22120
|
}) : void 0;
|
|
21140
22121
|
return {
|
|
21141
22122
|
version: EDL_VERSION,
|
|
21142
|
-
...
|
|
21143
|
-
...
|
|
22123
|
+
...str3(o.sourceId) ? { sourceId: str3(o.sourceId) } : {},
|
|
22124
|
+
...str3(o.language) ? { language: str3(o.language) } : {},
|
|
21144
22125
|
words,
|
|
21145
22126
|
...segments ? { segments } : {}
|
|
21146
22127
|
};
|
|
21147
22128
|
}
|
|
21148
22129
|
|
|
22130
|
+
// src/speaker-tracks.ts
|
|
22131
|
+
var SPEAKER_TRACKS_VERSION = 1;
|
|
22132
|
+
var SPEAKER_TRACK_ATTRIBUTION_METHODS = ["source-map", "region", "mouth-motion", "manual"];
|
|
22133
|
+
var KNOWN_METHODS = new Set(SPEAKER_TRACK_ATTRIBUTION_METHODS);
|
|
22134
|
+
var SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE = 1e5;
|
|
22135
|
+
var SPEAKER_TRACKS_MAX_BYTES = 64 * 1024 * 1024;
|
|
22136
|
+
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
22137
|
+
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
22138
|
+
var num2 = (v, fallback = 0) => isNum(v) ? v : fallback;
|
|
22139
|
+
var str4 = (v) => typeof v === "string" ? v : void 0;
|
|
22140
|
+
var clamp013 = (v) => Math.min(1, Math.max(0, v));
|
|
22141
|
+
var arr = (v) => Array.isArray(v) ? v : [];
|
|
22142
|
+
var int2 = (v) => {
|
|
22143
|
+
const r = Math.round(v);
|
|
22144
|
+
return r === 0 ? 0 : r;
|
|
22145
|
+
};
|
|
22146
|
+
function cropAxis(p, s) {
|
|
22147
|
+
if (!(s > 0)) return void 0;
|
|
22148
|
+
if (p >= 0 && p + s <= 1) return [p, s];
|
|
22149
|
+
const lo = clamp013(p);
|
|
22150
|
+
const hi = clamp013(p + s);
|
|
22151
|
+
return hi > lo ? [lo, hi - lo] : void 0;
|
|
22152
|
+
}
|
|
22153
|
+
function normalizeBox(raw) {
|
|
22154
|
+
if (!isObj(raw)) return void 0;
|
|
22155
|
+
if (![raw.ms, raw.x, raw.y, raw.w, raw.h].every(isNum)) return void 0;
|
|
22156
|
+
const xs = cropAxis(raw.x, raw.w);
|
|
22157
|
+
const ys = cropAxis(raw.y, raw.h);
|
|
22158
|
+
if (!xs || !ys) return void 0;
|
|
22159
|
+
const [x, w] = xs;
|
|
22160
|
+
const [y, h] = ys;
|
|
22161
|
+
return { ms: int2(raw.ms), x, y, w, h, ...isNum(raw.score) ? { score: clamp013(raw.score) } : {} };
|
|
22162
|
+
}
|
|
22163
|
+
function normalizeSpans(raw) {
|
|
22164
|
+
if (!Array.isArray(raw)) return [];
|
|
22165
|
+
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);
|
|
22166
|
+
const merged = [];
|
|
22167
|
+
for (const s of spans) {
|
|
22168
|
+
const last = merged[merged.length - 1];
|
|
22169
|
+
if (last && s.startMs <= last.endMs) merged[merged.length - 1] = { startMs: last.startMs, endMs: Math.max(last.endMs, s.endMs) };
|
|
22170
|
+
else merged.push(s);
|
|
22171
|
+
}
|
|
22172
|
+
return merged;
|
|
22173
|
+
}
|
|
22174
|
+
function normalizeCuts(raw) {
|
|
22175
|
+
if (!Array.isArray(raw)) return [];
|
|
22176
|
+
const sorted = raw.filter(isNum).map(int2).sort((a, b) => a - b);
|
|
22177
|
+
return sorted.filter((c, i) => i === 0 || c !== sorted[i - 1]);
|
|
22178
|
+
}
|
|
22179
|
+
function normalizeAttribution(raw) {
|
|
22180
|
+
if (!isObj(raw)) return void 0;
|
|
22181
|
+
const method = str4(raw.method);
|
|
22182
|
+
if (!method) return void 0;
|
|
22183
|
+
const rawSpeaker = str4(raw.rawSpeaker);
|
|
22184
|
+
return { method, confidence: clamp013(num2(raw.confidence)), ...rawSpeaker ? { rawSpeaker } : {} };
|
|
22185
|
+
}
|
|
22186
|
+
function normalizeHeader(raw, fallbackId) {
|
|
22187
|
+
const speaker = str4(raw.speaker);
|
|
22188
|
+
const attribution = normalizeAttribution(raw.attribution);
|
|
22189
|
+
return {
|
|
22190
|
+
id: str4(raw.id) || fallbackId,
|
|
22191
|
+
...speaker ? { speaker } : {},
|
|
22192
|
+
...attribution ? { attribution } : {}
|
|
22193
|
+
};
|
|
22194
|
+
}
|
|
22195
|
+
function normalizeSetFields(o) {
|
|
22196
|
+
const detector = isObj(o.detector) ? o.detector : {};
|
|
22197
|
+
const detectorVersion = str4(detector.version);
|
|
22198
|
+
return {
|
|
22199
|
+
// Only an ABSENT version defaults to 1. Any present value — another
|
|
22200
|
+
// number, "2", null — is kept as is so validate refuses it rather than
|
|
22201
|
+
// reading a newer (or broken) body as this one.
|
|
22202
|
+
version: o.version === void 0 ? SPEAKER_TRACKS_VERSION : o.version,
|
|
22203
|
+
sampleFps: num2(o.sampleFps),
|
|
22204
|
+
detector: { id: str4(detector.id) ?? "", ...detectorVersion ? { version: detectorVersion } : {} }
|
|
22205
|
+
};
|
|
22206
|
+
}
|
|
22207
|
+
function normalizeSources(raw, track) {
|
|
22208
|
+
if (!Array.isArray(raw)) return [];
|
|
22209
|
+
return raw.map((r) => {
|
|
22210
|
+
const s = isObj(r) ? r : {};
|
|
22211
|
+
const sourceId = str4(s.sourceId) ?? "";
|
|
22212
|
+
const frame = isObj(s.frame) ? s.frame : {};
|
|
22213
|
+
const cuts = normalizeCuts(s.cuts);
|
|
22214
|
+
const tracks = Array.isArray(s.tracks) ? s.tracks.map((t2, k) => track(isObj(t2) ? t2 : {}, `${sourceId}/t${k + 1}`)) : [];
|
|
22215
|
+
return {
|
|
22216
|
+
sourceId,
|
|
22217
|
+
// A clock other than "source" cannot be repaired: boxes on another clock
|
|
22218
|
+
// would land offsetMs away from their frame. Keep it for validate to refuse.
|
|
22219
|
+
clock: typeof s.clock === "string" ? s.clock : "source",
|
|
22220
|
+
frame: { w: int2(num2(frame.w)), h: int2(num2(frame.h)) },
|
|
22221
|
+
sampledSpans: normalizeSpans(s.sampledSpans),
|
|
22222
|
+
tracks,
|
|
22223
|
+
...cuts.length > 0 ? { cuts } : {}
|
|
22224
|
+
};
|
|
22225
|
+
});
|
|
22226
|
+
}
|
|
22227
|
+
function normalizeSpeakerTracks(input) {
|
|
22228
|
+
const o = isObj(input) ? input : {};
|
|
22229
|
+
return {
|
|
22230
|
+
...normalizeSetFields(o),
|
|
22231
|
+
sources: normalizeSources(o.sources, (t2, fallbackId) => {
|
|
22232
|
+
const boxes = Array.isArray(t2.boxes) ? t2.boxes.map(normalizeBox).filter((b) => b !== void 0) : [];
|
|
22233
|
+
return { ...normalizeHeader(t2, fallbackId), boxes: [...boxes].sort((a, b) => a.ms - b.ms) };
|
|
22234
|
+
})
|
|
22235
|
+
};
|
|
22236
|
+
}
|
|
22237
|
+
function normalizeSpeakerTrackSetDescriptor(input) {
|
|
22238
|
+
const o = isObj(input) ? input : {};
|
|
22239
|
+
return {
|
|
22240
|
+
...normalizeSetFields(o),
|
|
22241
|
+
sources: normalizeSources(o.sources, (t2, fallbackId) => ({
|
|
22242
|
+
...normalizeHeader(t2, fallbackId),
|
|
22243
|
+
boxCount: Math.max(0, int2(num2(t2.boxCount)))
|
|
22244
|
+
})),
|
|
22245
|
+
url: str4(o.url) ?? "",
|
|
22246
|
+
sha256: str4(o.sha256) ?? "",
|
|
22247
|
+
bytes: int2(num2(o.bytes))
|
|
22248
|
+
};
|
|
22249
|
+
}
|
|
22250
|
+
function describeSpeakerTracks(set, artifact) {
|
|
22251
|
+
return {
|
|
22252
|
+
version: set.version,
|
|
22253
|
+
sampleFps: set.sampleFps,
|
|
22254
|
+
detector: { ...set.detector },
|
|
22255
|
+
sources: set.sources.map((s) => ({
|
|
22256
|
+
sourceId: s.sourceId,
|
|
22257
|
+
clock: s.clock,
|
|
22258
|
+
frame: { ...s.frame },
|
|
22259
|
+
sampledSpans: s.sampledSpans.map((sp) => ({ ...sp })),
|
|
22260
|
+
tracks: s.tracks.map((t2) => ({
|
|
22261
|
+
id: t2.id,
|
|
22262
|
+
...t2.speaker !== void 0 ? { speaker: t2.speaker } : {},
|
|
22263
|
+
...t2.attribution ? { attribution: { ...t2.attribution } } : {},
|
|
22264
|
+
boxCount: t2.boxes.length
|
|
22265
|
+
})),
|
|
22266
|
+
...s.cuts && s.cuts.length > 0 ? { cuts: [...s.cuts] } : {}
|
|
22267
|
+
})),
|
|
22268
|
+
url: artifact.url,
|
|
22269
|
+
sha256: artifact.sha256,
|
|
22270
|
+
bytes: artifact.bytes
|
|
22271
|
+
};
|
|
22272
|
+
}
|
|
22273
|
+
function edlSpeakerSpace(edl) {
|
|
22274
|
+
const out = /* @__PURE__ */ new Set();
|
|
22275
|
+
const add = (v) => {
|
|
22276
|
+
if (typeof v === "string" && v) out.add(v);
|
|
22277
|
+
};
|
|
22278
|
+
for (const e of edlList(edl)) {
|
|
22279
|
+
for (const s of Array.isArray(e.sources) ? e.sources : []) {
|
|
22280
|
+
for (const sp of Array.isArray(s?.speakers) ? s.speakers : []) add(sp);
|
|
22281
|
+
}
|
|
22282
|
+
for (const seg of Array.isArray(e.segments) ? e.segments : []) {
|
|
22283
|
+
add(seg?.speaker);
|
|
22284
|
+
for (const slot of Array.isArray(seg?.layout?.slots) ? seg.layout.slots : []) add(slot?.speaker);
|
|
22285
|
+
}
|
|
22286
|
+
}
|
|
22287
|
+
return [...out].sort();
|
|
22288
|
+
}
|
|
22289
|
+
function edlList(edl) {
|
|
22290
|
+
if (!edl) return [];
|
|
22291
|
+
const all = Array.isArray(edl) ? edl : [edl];
|
|
22292
|
+
return all.filter((e) => isObj(e));
|
|
22293
|
+
}
|
|
22294
|
+
var SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
22295
|
+
function validateCommon(set, opts, perTrack) {
|
|
22296
|
+
const f = { issues: [], warnings: [] };
|
|
22297
|
+
const { issues, warnings } = f;
|
|
22298
|
+
const sources = arr(set.sources);
|
|
22299
|
+
const maxBoxes = opts.maxBoxesPerSource ?? SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE;
|
|
22300
|
+
if (set.version !== SPEAKER_TRACKS_VERSION) issues.push(`version must be ${SPEAKER_TRACKS_VERSION}`);
|
|
22301
|
+
if (!(isNum(set.sampleFps) && set.sampleFps > 0)) issues.push("sampleFps must be a finite number > 0");
|
|
22302
|
+
const edls = edlList(opts.edl);
|
|
22303
|
+
const edlSources = /* @__PURE__ */ new Map();
|
|
22304
|
+
for (const e of edls) {
|
|
22305
|
+
for (const s of Array.isArray(e.sources) ? e.sources : []) {
|
|
22306
|
+
if (s && typeof s.id === "string" && !edlSources.has(s.id)) edlSources.set(s.id, s);
|
|
22307
|
+
}
|
|
22308
|
+
}
|
|
22309
|
+
const sourceIds = /* @__PURE__ */ new Set();
|
|
22310
|
+
const trackIds = /* @__PURE__ */ new Set();
|
|
22311
|
+
sources.forEach((s, i) => {
|
|
22312
|
+
const sid = s.sourceId;
|
|
22313
|
+
const at = `source "${sid}"`;
|
|
22314
|
+
if (!sid) issues.push(`source[${i}]: sourceId is empty`);
|
|
22315
|
+
else if (sourceIds.has(sid)) issues.push(`duplicate source id "${sid}"`);
|
|
22316
|
+
sourceIds.add(sid);
|
|
22317
|
+
if (sid && edls.length > 0) {
|
|
22318
|
+
const es = edlSources.get(sid);
|
|
22319
|
+
if (!es) issues.push(`${at}: not a source of the EDL`);
|
|
22320
|
+
else if (es.kind !== "video") issues.push(`${at}: the EDL source is kind:"${es.kind}", tracks need a video source`);
|
|
22321
|
+
}
|
|
22322
|
+
if (s.clock !== "source") issues.push(`${at}: clock must be "source"`);
|
|
22323
|
+
if (!(isObj(s.frame) && isNum(s.frame.w) && isNum(s.frame.h) && s.frame.w > 0 && s.frame.h > 0)) {
|
|
22324
|
+
issues.push(`${at}: frame w/h must be positive`);
|
|
22325
|
+
}
|
|
22326
|
+
const spans = arr(s.sampledSpans);
|
|
22327
|
+
spans.forEach((sp, j) => {
|
|
22328
|
+
const startMs = sp?.startMs;
|
|
22329
|
+
const endMs = sp?.endMs;
|
|
22330
|
+
if (!(isNum(startMs) && isNum(endMs) && endMs > startMs)) {
|
|
22331
|
+
issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not positive`);
|
|
22332
|
+
return;
|
|
22333
|
+
}
|
|
22334
|
+
if (!(Number.isInteger(startMs) && Number.isInteger(endMs))) issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not integer ms`);
|
|
22335
|
+
if (startMs < 0) issues.push(`${at}: sampledSpans[${j}] starts before 0`);
|
|
22336
|
+
const prevEnd = spans[j - 1]?.endMs;
|
|
22337
|
+
if (j > 0 && isNum(prevEnd) && startMs < prevEnd) {
|
|
22338
|
+
issues.push(`${at}: sampledSpans must be sorted and non-overlapping (span ${j})`);
|
|
22339
|
+
}
|
|
22340
|
+
});
|
|
22341
|
+
const cuts = s.cuts;
|
|
22342
|
+
if (cuts !== void 0) {
|
|
22343
|
+
const okCuts = Array.isArray(cuts) && cuts.every((c, k) => Number.isInteger(c) && c >= 0 && (k === 0 || c > cuts[k - 1]));
|
|
22344
|
+
if (!okCuts) issues.push(`${at}: cuts must be ascending non-negative ms`);
|
|
22345
|
+
}
|
|
22346
|
+
let boxes = 0;
|
|
22347
|
+
const tracks = arr(s.tracks);
|
|
22348
|
+
tracks.forEach((t2, k) => {
|
|
22349
|
+
if (!t2?.id) issues.push(`${at} track[${k}]: id is empty`);
|
|
22350
|
+
else if (trackIds.has(t2.id)) issues.push(`duplicate track id "${t2.id}"`);
|
|
22351
|
+
if (t2?.id) trackIds.add(t2.id);
|
|
22352
|
+
const a = t2?.attribution;
|
|
22353
|
+
if (a) {
|
|
22354
|
+
if (!(isNum(a.confidence) && a.confidence >= 0 && a.confidence <= 1)) {
|
|
22355
|
+
issues.push(`track "${t2.id}": attribution.confidence=${a.confidence} out of 0..1`);
|
|
22356
|
+
}
|
|
22357
|
+
if (!KNOWN_METHODS.has(a.method)) {
|
|
22358
|
+
warnings.push(`track "${t2.id}": unknown attribution method "${a.method}" (known: ${SPEAKER_TRACK_ATTRIBUTION_METHODS.join(", ")})`);
|
|
22359
|
+
}
|
|
22360
|
+
}
|
|
22361
|
+
boxes += perTrack(t2, s, f);
|
|
22362
|
+
});
|
|
22363
|
+
if (boxes > maxBoxes) issues.push(`${at}: ${boxes} boxes is over the cap of ${maxBoxes}`);
|
|
22364
|
+
});
|
|
22365
|
+
if (edls.length > 0) {
|
|
22366
|
+
const space = edlSpeakerSpace(edls);
|
|
22367
|
+
const attributed = sources.flatMap((s) => Array.isArray(s.tracks) ? s.tracks : []).filter((t2) => !!t2?.speaker);
|
|
22368
|
+
if (space.length > 0 && attributed.length > 0) {
|
|
22369
|
+
const inSpace = new Set(space);
|
|
22370
|
+
const matches = (t2) => inSpace.has(t2.speaker) || !!t2.attribution?.rawSpeaker && inSpace.has(t2.attribution.rawSpeaker);
|
|
22371
|
+
if (!attributed.some(matches)) {
|
|
22372
|
+
const labels = [...new Set(attributed.map((t2) => t2.speaker))].sort();
|
|
22373
|
+
issues.push(
|
|
22374
|
+
`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`
|
|
22375
|
+
);
|
|
22376
|
+
} else {
|
|
22377
|
+
for (const t2 of attributed) {
|
|
22378
|
+
if (!matches(t2)) warnings.push(`track "${t2.id}": speaker "${t2.speaker}" is not in the edit's speaker set`);
|
|
22379
|
+
}
|
|
22380
|
+
}
|
|
22381
|
+
}
|
|
22382
|
+
}
|
|
22383
|
+
return f;
|
|
22384
|
+
}
|
|
22385
|
+
var BOX_FINDINGS_PER_RULE = 5;
|
|
22386
|
+
var MAX_LISTED_FINDINGS = 100;
|
|
22387
|
+
function boxIssues(b, at) {
|
|
22388
|
+
const out = [];
|
|
22389
|
+
for (const k of ["x", "y", "w", "h"]) {
|
|
22390
|
+
const v = b?.[k];
|
|
22391
|
+
if (!isNum(v) || v < 0 || v > 1) out.push([`with ${k} out of 0..1`, `${at}: ${k}=${v} out of 0..1`]);
|
|
22392
|
+
}
|
|
22393
|
+
if (out.length > 0) return out;
|
|
22394
|
+
if (b.w <= 0 || b.h <= 0) out.push(["with a non-positive w/h", `${at}: non-positive w/h`]);
|
|
22395
|
+
if (b.x + b.w > 1 + 1e-9) out.push(["extending past the right edge", `${at}: extends past the right edge (x+w>1)`]);
|
|
22396
|
+
if (b.y + b.h > 1 + 1e-9) out.push(["extending past the bottom edge", `${at}: extends past the bottom edge (y+h>1)`]);
|
|
22397
|
+
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`]);
|
|
22398
|
+
return out;
|
|
22399
|
+
}
|
|
22400
|
+
function capListed(list, noun) {
|
|
22401
|
+
if (list.length <= MAX_LISTED_FINDINGS) return [...list];
|
|
22402
|
+
return [...list.slice(0, MAX_LISTED_FINDINGS), `${list.length - MAX_LISTED_FINDINGS} more ${noun} not listed`];
|
|
22403
|
+
}
|
|
22404
|
+
function inSpans(spans, ms) {
|
|
22405
|
+
let lo = 0;
|
|
22406
|
+
let hi = spans.length - 1;
|
|
22407
|
+
while (lo <= hi) {
|
|
22408
|
+
const mid = lo + hi >> 1;
|
|
22409
|
+
const sp = spans[mid];
|
|
22410
|
+
if (ms < sp.startMs) hi = mid - 1;
|
|
22411
|
+
else if (ms >= sp.endMs) lo = mid + 1;
|
|
22412
|
+
else return true;
|
|
22413
|
+
}
|
|
22414
|
+
return false;
|
|
22415
|
+
}
|
|
22416
|
+
function validateSpeakerTracks(set, opts = {}) {
|
|
22417
|
+
const safe = isObj(set) ? set : {};
|
|
22418
|
+
const f = validateCommon(safe, opts, (t2, source, { issues }) => {
|
|
22419
|
+
const boxes = Array.isArray(t2?.boxes) ? t2.boxes : [];
|
|
22420
|
+
const spans = Array.isArray(source.sampledSpans) ? source.sampledSpans : [];
|
|
22421
|
+
let first = Infinity;
|
|
22422
|
+
let last = -Infinity;
|
|
22423
|
+
const seen = /* @__PURE__ */ new Map();
|
|
22424
|
+
const report = ([rule, message]) => {
|
|
22425
|
+
const n = (seen.get(rule) ?? 0) + 1;
|
|
22426
|
+
seen.set(rule, n);
|
|
22427
|
+
if (n <= BOX_FINDINGS_PER_RULE) issues.push(message);
|
|
22428
|
+
};
|
|
22429
|
+
const outside = `outside every sampled span of source "${source.sourceId}"`;
|
|
22430
|
+
boxes.forEach((b, j) => {
|
|
22431
|
+
const at = `track "${t2.id}" box[${j}]`;
|
|
22432
|
+
boxIssues(b, at).forEach(report);
|
|
22433
|
+
if (!isNum(b?.ms)) {
|
|
22434
|
+
report(["whose ms is not a number", `${at}: ms is not a number`]);
|
|
22435
|
+
return;
|
|
22436
|
+
}
|
|
22437
|
+
if (!Number.isInteger(b.ms)) report(["whose ms is not an integer", `${at}: ms ${b.ms} is not an integer`]);
|
|
22438
|
+
const prev = boxes[j - 1]?.ms;
|
|
22439
|
+
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})`]);
|
|
22440
|
+
if (!inSpans(spans, b.ms)) report([outside, `${at}: ms ${b.ms} is ${outside}`]);
|
|
22441
|
+
first = Math.min(first, b.ms);
|
|
22442
|
+
last = Math.max(last, b.ms);
|
|
22443
|
+
});
|
|
22444
|
+
for (const [rule, n] of seen) {
|
|
22445
|
+
if (n > BOX_FINDINGS_PER_RULE) issues.push(`track "${t2.id}": ${n - BOX_FINDINGS_PER_RULE} more boxes ${rule}`);
|
|
22446
|
+
}
|
|
22447
|
+
const cut = (Array.isArray(source.cuts) ? source.cuts : []).find((c) => first < c && c <= last);
|
|
22448
|
+
if (cut !== void 0) issues.push(`track "${t2.id}": spans the cut at ${cut} ms (boxes ${first}..${last})`);
|
|
22449
|
+
return boxes.length;
|
|
22450
|
+
});
|
|
22451
|
+
const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
|
|
22452
|
+
const bytes = opts.serializedBytes ?? new TextEncoder().encode(JSON.stringify(safe)).length;
|
|
22453
|
+
if (bytes > maxBytes) f.issues.push(`the track set is ${bytes} bytes, over the cap of ${maxBytes}`);
|
|
22454
|
+
return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
|
|
22455
|
+
}
|
|
22456
|
+
function validateSpeakerTrackSetDescriptor(d, opts = {}) {
|
|
22457
|
+
const safe = isObj(d) ? d : {};
|
|
22458
|
+
const f = validateCommon(safe, opts, (t2, _source, { issues }) => {
|
|
22459
|
+
if (!(Number.isInteger(t2?.boxCount) && t2.boxCount >= 0)) {
|
|
22460
|
+
issues.push(`track "${t2?.id}": boxCount must be a non-negative integer`);
|
|
22461
|
+
return 0;
|
|
22462
|
+
}
|
|
22463
|
+
return t2.boxCount;
|
|
22464
|
+
});
|
|
22465
|
+
if (!(typeof safe.url === "string" && safe.url.trim())) f.issues.push("url is empty");
|
|
22466
|
+
if (!(typeof safe.sha256 === "string" && SHA256_HEX.test(safe.sha256))) f.issues.push("sha256 must be 64 lowercase hex characters");
|
|
22467
|
+
const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
|
|
22468
|
+
if (!(Number.isInteger(safe.bytes) && safe.bytes > 0)) f.issues.push("bytes must be a positive integer");
|
|
22469
|
+
else if (safe.bytes > maxBytes) f.issues.push(`the track set is ${safe.bytes} bytes, over the cap of ${maxBytes}`);
|
|
22470
|
+
return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
|
|
22471
|
+
}
|
|
22472
|
+
|
|
21149
22473
|
// src/camera-switch-contract.ts
|
|
21150
22474
|
var CAMERA_SWITCH_DEFAULTS = Object.freeze({
|
|
21151
22475
|
/** The shortest shot; a shorter turn (an interjection) holds the shot. */
|
|
@@ -21210,10 +22534,10 @@ function cameraSwitchEdlProblem(edl) {
|
|
|
21210
22534
|
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).";
|
|
21211
22535
|
if (!Array.isArray(v.sources) || !Array.isArray(v.segments)) return "camera-switch: `edl` needs `sources` and `segments`.";
|
|
21212
22536
|
if (v.segments.length === 0) return "camera-switch: `edl` has no segments.";
|
|
21213
|
-
const
|
|
22537
|
+
const num3 = (x) => typeof x === "number" && Number.isFinite(x) ? x : void 0;
|
|
21214
22538
|
for (const [i, row] of v.segments.entries()) {
|
|
21215
22539
|
const seg = row;
|
|
21216
|
-
const inMs =
|
|
22540
|
+
const inMs = num3(seg?.inMs), outMs = num3(seg?.outMs);
|
|
21217
22541
|
if (inMs === void 0 || outMs === void 0 || !(outMs > inMs)) return `camera-switch: segment ${i} needs a numeric inMs < outMs.`;
|
|
21218
22542
|
}
|
|
21219
22543
|
if (v.clock === "output") return "camera-switch: the edit must be on the master clock (an edit-plan EDL), not a rendered output's.";
|
|
@@ -21246,7 +22570,7 @@ function cameraSwitchSettingsPayload(data, edl, transcript) {
|
|
|
21246
22570
|
}
|
|
21247
22571
|
|
|
21248
22572
|
// src/edit-plan-contract.ts
|
|
21249
|
-
var EDIT_PLAN_MODES = ["tighten", "clips", "chapters"];
|
|
22573
|
+
var EDIT_PLAN_MODES = ["tighten", "clips", "chapters", "trailer"];
|
|
21250
22574
|
var EDIT_PLAN_TIERS = ["economy", "standard", "premium"];
|
|
21251
22575
|
var EDIT_PLAN_BUCKET_MINUTES = [15, 30, 60, 90, 120, 180];
|
|
21252
22576
|
var EDIT_PLAN_MAX_MINUTES = 180;
|
|
@@ -21268,7 +22592,10 @@ function buildEditPlanCreditId(mode, tier, durationSec) {
|
|
|
21268
22592
|
return `edit-plan:${mode}:${tier}:${editPlanBucketMinutes(durationSec)}m`;
|
|
21269
22593
|
}
|
|
21270
22594
|
function asEditPlanMode(v) {
|
|
21271
|
-
return v
|
|
22595
|
+
return parseEditPlanMode(v) ?? "tighten";
|
|
22596
|
+
}
|
|
22597
|
+
function parseEditPlanMode(v) {
|
|
22598
|
+
return typeof v === "string" && EDIT_PLAN_MODES.includes(v) ? v : void 0;
|
|
21272
22599
|
}
|
|
21273
22600
|
function asEditPlanTier(v) {
|
|
21274
22601
|
return v === "economy" || v === "premium" ? v : "standard";
|
|
@@ -21343,18 +22670,24 @@ function fnv1a64(text) {
|
|
|
21343
22670
|
}
|
|
21344
22671
|
return hi.toString(16).padStart(8, "0") + lo.toString(16).padStart(8, "0");
|
|
21345
22672
|
}
|
|
22673
|
+
var basisByPlan = /* @__PURE__ */ new WeakMap();
|
|
21346
22674
|
function editPlanBasis(plan) {
|
|
21347
|
-
return fnv1a64(canonicalJson(plan) ?? "");
|
|
22675
|
+
if (typeof plan !== "object" || plan === null) return fnv1a64(canonicalJson(plan) ?? "");
|
|
22676
|
+
const cached = basisByPlan.get(plan);
|
|
22677
|
+
if (cached !== void 0) return cached;
|
|
22678
|
+
const basis = fnv1a64(canonicalJson(plan) ?? "");
|
|
22679
|
+
basisByPlan.set(plan, basis);
|
|
22680
|
+
return basis;
|
|
21348
22681
|
}
|
|
21349
|
-
var
|
|
22682
|
+
var isRecord4 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
21350
22683
|
function planShape(plan) {
|
|
21351
22684
|
if (Array.isArray(plan)) return "clips";
|
|
21352
|
-
if (
|
|
22685
|
+
if (isRecord4(plan) && Array.isArray(plan.segments)) return "edl";
|
|
21353
22686
|
return "other";
|
|
21354
22687
|
}
|
|
21355
22688
|
function checkEnvelope(edited, plan) {
|
|
21356
22689
|
if (edited === void 0 || edited === null) return { status: "none" };
|
|
21357
|
-
if (!
|
|
22690
|
+
if (!isRecord4(edited)) return { status: "invalid", issue: "editedEdl must be an object" };
|
|
21358
22691
|
if (edited.v !== EDITED_EDL_VERSION) return { status: "invalid", issue: `editedEdl.v must be ${EDITED_EDL_VERSION}` };
|
|
21359
22692
|
if (typeof edited.basis !== "string" || edited.basis.length === 0) {
|
|
21360
22693
|
return { status: "invalid", issue: "editedEdl.basis must be a non-empty string" };
|
|
@@ -21369,7 +22702,7 @@ function checkEnvelope(edited, plan) {
|
|
|
21369
22702
|
if (edited.kind === "edl") {
|
|
21370
22703
|
if (shape !== "edl") return { status: "invalid", issue: `an "edl" edit needs a Tighten plan (one EDL); this plan is ${describeShape(shape)}` };
|
|
21371
22704
|
const edl = edited.edl;
|
|
21372
|
-
if (!
|
|
22705
|
+
if (!isRecord4(edl) || !Array.isArray(edl.segments) || !Array.isArray(edl.dropped)) {
|
|
21373
22706
|
return { status: "invalid", issue: "editedEdl.edl must hold a segments array and a dropped array" };
|
|
21374
22707
|
}
|
|
21375
22708
|
} else if (edited.kind === "clips") {
|
|
@@ -21381,7 +22714,7 @@ function checkEnvelope(edited, plan) {
|
|
|
21381
22714
|
return { status: "invalid", issue: `editedEdl.clips holds ${clips.length} decisions; the plan has ${planned} clips` };
|
|
21382
22715
|
}
|
|
21383
22716
|
const bad = clips.findIndex(
|
|
21384
|
-
(c) => !
|
|
22717
|
+
(c) => !isRecord4(c) || typeof c.keep !== "boolean" || c.hook !== void 0 && typeof c.hook !== "string"
|
|
21385
22718
|
);
|
|
21386
22719
|
if (bad >= 0) return { status: "invalid", issue: `editedEdl.clips[${bad}] must be {keep: boolean, hook?: string}` };
|
|
21387
22720
|
}
|
|
@@ -21406,8 +22739,8 @@ function withHook(clip, hook) {
|
|
|
21406
22739
|
return clip;
|
|
21407
22740
|
}
|
|
21408
22741
|
}
|
|
21409
|
-
if (!
|
|
21410
|
-
const meta =
|
|
22742
|
+
if (!isRecord4(value)) return clip;
|
|
22743
|
+
const meta = isRecord4(value.meta) ? value.meta : {};
|
|
21411
22744
|
return { ...value, meta: { ...meta, hook } };
|
|
21412
22745
|
}
|
|
21413
22746
|
function resolveEditPlanOutput(plan, editedEdl) {
|
|
@@ -21434,6 +22767,11 @@ function editPlanSavedOutput(data) {
|
|
|
21434
22767
|
const { status: _status, ...output } = resolveEditPlanOutput(plan, data.editedEdl);
|
|
21435
22768
|
return output;
|
|
21436
22769
|
}
|
|
22770
|
+
function editPlanResultPatch(plan, editedEdl) {
|
|
22771
|
+
const basis = isRecord4(editedEdl) ? editedEdl.basis : void 0;
|
|
22772
|
+
const madeOnThisPlan = typeof basis === "string" && basis.length > 0 && basis === editPlanBasis(plan);
|
|
22773
|
+
return madeOnThisPlan ? { generatedJson: plan } : { generatedJson: plan, editedEdl: void 0 };
|
|
22774
|
+
}
|
|
21437
22775
|
function validateEditedEdl(editedEdl, plan) {
|
|
21438
22776
|
const check = checkEnvelope(editedEdl, plan);
|
|
21439
22777
|
if (check.status === "none") return { ok: false, issues: ["there is no edit"], warnings: [] };
|
|
@@ -21443,6 +22781,589 @@ function validateEditedEdl(editedEdl, plan) {
|
|
|
21443
22781
|
return validateEdl(resolved);
|
|
21444
22782
|
}
|
|
21445
22783
|
|
|
21446
|
-
export { ACCESS_LEVELS, ACTION_CARD_KINDS, ACTIVE_SCENE_HELPERS, ADVANCED_MODE_UNAVAILABLE_REASON, ADVICE_FAMILIES, AGGREGATEABLE_TYPES, AGGREGATE_LANE_SOURCE_TYPES, AI_AVATAR_DURATION_BUCKETS, AI_AVATAR_MAX_AUDIO_SEC, AI_AVATAR_MAX_DURATION_SEC, AI_AVATAR_RESERVE_IDS, AI_WRITER_PROVIDERS, ALA_CARTE_BOARDS, ALL_CAPTION_STYLES, ANIMALS, ANIMAL_SUBCATEGORY_LABELS, ANIMAL_SUBCATEGORY_ORDER, ANIMATE_SUB_GATES, ASPECT_RATIO_DIMENSIONS, AUDIO_ADDON_PROVIDERS, AUDIO_CROSSFADE_CURVES, AUDIO_CROSSFADE_CURVE_IDS, AUDIO_FX_PRESETS, AUDIO_FX_PRESET_LABELS, AUDIO_FX_PRESET_SET, AUDIO_FX_REVERB_PRESETS, AUDIO_PRODUCER_TYPES, AUDIO_SYNC_MIN_CONFIDENCE, AddBRollResultSchema, AnchorSceneStyleResultSchema, AnimateSubGateSchema, AssetRefSchema, AuditImagesResultSchema, AuditImagesShotEntrySchema, AuditPromptIssueSchema, AuditPromptResultSchema, AvatarPayloadError, BOARD_TO_ASSET_TYPE, BOARD_TO_COLUMN, BOARD_VARIANTS, BRAND_LESSON_KINDS, BridgeToNextSceneInputSchema, BridgeToNextSceneResultSchema, CAMERA_SWITCH_BOUNDS, CAMERA_SWITCH_CREDIT_ID, CAMERA_SWITCH_DEFAULTS, CAMERA_SWITCH_NAME_MAX, CAPTION_LEVER_BOUNDS, CAPTION_LOOKS, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MAX, CAPTION_MAX_WORDS_PER_LINE_MIN, CARD_OUTCOME_STATES, CATEGORY_DURATION_DEFAULTS, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_ASSET_TYPES, CHARACTER_ASSET_VARIANTS, CHARACTER_ATTACH_COLUMNS, CHARACTER_FACETS, CHARACTER_FACET_IDS, CHARACTER_LORA_TRAINING_JOB_TYPE, CHARACTER_MOTION_PROVIDERS, CHARACTER_PICKER_DISPLAY_ORDER, CHARACTER_REFERENCE_PHOTO_KINDS, CHARACTER_STYLES, CHARACTER_VARIANT_ASSET_BUCKETS, CHAT_ENABLED_STAGES, CHAT_STAGES, CHAT_TURN_CAPS, CHAT_WIRED_STAGES, CINEMATIC_DEFAULT_DURATION_SEC, CINEMATIC_DEFAULT_RESOLUTION, CINEMATIC_MAX_DURATION_SEC, CINEMATIC_MAX_LOOKS, CINEMATIC_MAX_REFERENCE_IMAGES, CINEMATIC_MAX_REFERENCE_VIDEOS, CINEMATIC_MIN_DURATION_SEC, CINEMATIC_MIN_LOOKS, CINEMATIC_PROMPT_MAX, CINEMATIC_RESERVE_IDS, COLLABORATOR_ROLES, COLLECT_IN_HANDLE, COMBINE_TRANSITIONS, COMBINE_TRANSITION_GROUP_LABELS, COMBINE_TRANSITION_GROUP_ORDER, COMBINE_TRANSITION_IDS, COMPETITORS_MAX, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_ACCOUNT_KEYS, COMPETITOR_DEFAULT_ABOUT_PLATFORMS, COMPETITOR_SCAN_CREDIT_COSTS, COMPETITOR_SCAN_MAX_SEARCHES, COMPETITOR_SCAN_NODE_TYPE, COMPETITOR_SCHEDULES, COMPOSER_PLAN_FIELDS, COMPOSER_PLAN_MAP, CONTENT_IDEAS_BRAND_MAX, CONTENT_IDEAS_DEFAULT_COUNT, CONTENT_IDEAS_LANGUAGE_MAX, CONTENT_IDEAS_MAX_COUNT, CONTENT_IDEAS_MAX_RECIPE_INPUTS, CONTENT_IDEAS_PER_CHARGE, CONTENT_RECIPE_IDEAS_CREDIT_IDS, CONTENT_RECIPE_SOURCE_MAX, CONTENT_TYPES_BY_PLATFORM, CREATURE_ATTACH_COLUMNS, CREDIT_BASE_USD, CREDIT_ROUNDING_RESOLUTION, CastCoverageCriticVerdictSchema, CharacterImageCriticVerdictSchema, CharacterMetadataSchema, ChatTurnResponseSchema, CriticIssueSchema, DEFAULT_AUDIO_CROSSFADE_CURVE_ID, DEFAULT_CAPTION_LOOK, DEFAULT_CARRIED_FRACTION, DEFAULT_CHARACTER_ANGLE_COUNT, DEFAULT_CHARACTER_EXPRESSION_COUNT, DEFAULT_CHARACTER_FACET, DEFAULT_FRAME_DELIVERY, DEFAULT_FRAME_FIT, DEFAULT_LABEL_BY_SOURCE, DEFAULT_LOCATION_USAGE_MODE, DEFAULT_MUSIC_PROVIDER, DEFAULT_OVERLAY_QR, DEFAULT_OVERLAY_SHAPE, DEFAULT_OVERLAY_TEXT, DEFAULT_PANEL_COUNT, DEFAULT_REF_IMAGE_MAX, DEFAULT_SECTIONS, DEFAULT_SUBTITLE_LOOK, DEFAULT_SUNO_MODEL, DEFAULT_TEMPLATE_CATEGORY, DEFAULT_TEXT_TO_AUDIO_PROVIDER, DEFAULT_TRANSCRIBE_NODE_PROVIDER, DEFAULT_TRANSCRIBE_PROVIDER, DEFAULT_TTS_PROVIDER, DEFAULT_USAGE_MODE, DEFAULT_VIDEO_ANALYSIS_MODEL, DEFAULT_VIDEO_ANALYSIS_TIER, DEFAULT_VIDEO_CLIP_COST, DEFAULT_VIDEO_DURATION_SEC, DEFAULT_VIDEO_OVERLAY_LAYER, DEFAULT_VIDEO_PROVIDER, DEFAULT_VOICE_CHANGER_MODEL, DEFAULT_VOICE_DESIGN_MODEL, DETAIL_VARIANTS, DURATION_PRICED_PROVIDERS, DYNAMIC_PRODUCER_TYPES, DetectionResultSchema, EDITED_EDL_VERSION, EDIT_PLAN_BASE_CREDIT_ID, EDIT_PLAN_BUCKET_MINUTES, EDIT_PLAN_DEFAULT_CLIP_COUNT, EDIT_PLAN_MAX_CLIP_COUNT, EDIT_PLAN_MAX_MINUTES, EDIT_PLAN_MODES, EDIT_PLAN_TIERS, EDL_FULL_FRAME, EDL_SOURCE_ROLES, EDL_TARGET_ASPECTS, EDL_VERSION, EFFORT_TIER_BUMP, EMOTIONAL_BEAT, ENTITY_ASPECT_DEFAULTS, ENTITY_BUCKET_FIELDS, ENTITY_DB_ID_FIELD, ENTITY_IMAGE_HANDLE_TYPES, ENTITY_KIND_SCALAR_FIELDS, ENTITY_NAME_FIELD, ENTITY_NODE_KINDS, ENTITY_SCALAR_FIELDS, ENTITY_SECTIONS, ENTITY_STATUSES, ENTITY_TABLE, ENTITY_TOOL_RETRY_CAP, ENTITY_TYPES, EXECUTION_DATA_KEYS, EXECUTION_GRAPH_COMPOSED_PARAMETER_TYPES, EXTEND_VIDEO_PROVIDERS, EntityMetadataSchema, EntityRejectInputSchema, EntityStaleEventSchema, EntityStateChangeEventSchema, FACE_SWAP_PROVIDERS, FAL_LIP_SYNC_PROVIDERS, FAN_IN_TARGETS, FAN_OUT_EACH_HANDLES, FAN_OUT_EACH_TYPES, FEATURED_ENTITIES, FILM_BASE_CREDITS, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS, FLUX2_RES_MP, FLUX_LORA_CHARACTER_MODEL_ID, FRAME_DELIVERIES, FRAME_DELIVERY_BY_PROVIDER, FRAME_FITS, FRAME_FIT_STRETCH_TOLERANCE, FRAME_MODE_ADAPTIVE_ONLY_ASPECT, FRAME_TARGET_HANDLES, FREECUT_EXPORT_COMPLETE, FREECUT_EXPORT_PROGRESS, FREECUT_READY, FREECUT_REQUEST_IMPORT, FURNITURE, FURNITURE_SUBCATEGORY_LABELS, FURNITURE_SUBCATEGORY_ORDER, FixContinuityInputSchema, FixContinuityResultSchema, GEMINI_OMNI_PROVIDERS, GENERATE_TEXT_DELIMITER, GLOBAL_MAX_DURATION_SECONDS, GRANTED_ACCESS, GROUP_HANDLE_PREFIX, GUIDANCE_SCALE_SUPPORT, GVP_ANCHOR_CHOICES, GVP_DEFAULT_PROVIDER, GVP_END_FRAME_PROVIDERS, GVP_EXTEND_PROVIDERS, GVP_SUPPORTED_PROVIDERS, GenerateMotionInputSchema, GenerateMotionResultSchema, HANDLE_PORT_SEPARATOR, HELPERS_SHIPPED_IN_1B3, HIGH_QUALITY_PROVIDERS, HINT_EXEMPT_PARAMETER_TYPES, I2I_MASK_SUPPORT, I2I_STRENGTH_SUPPORT, IDEOGRAM_PROVIDERS, IMAGE_ASPECT_RATIO_VALUES, IMAGE_CRITIC_LEAF_MODES, IMAGE_CRITIC_MAX_RETRIES, IMAGE_CRITIC_METADATA_KEYS, IMAGE_CRITIC_MIN_ADHERENCE_SCORE, IMAGE_CRITIC_MODES, IMAGE_CRITIC_UNRESOLVABLE, IMAGE_EDIT_PROVIDERS, IMAGE_GEN_PROVIDERS, IMAGE_I2I_PROVIDERS, IMAGE_MASK_MODE, IMAGE_OVERLAY_BASE_CREDITS, IMAGE_OVERLAY_VARIANT_CREDITS, IMAGE_PROMPT_MAX, IMAGE_REF_TYPES, IMAGE_TO_VIDEO_PROVIDERS, INPUT_FIELD_MAP2 as INPUT_FIELD_MAP, INPUT_NODE_TYPES, INSTAGRAM_ANALYSIS_CREDIT_ID, INSTAGRAM_CAROUSEL_MAX_ITEMS, INSTAGRAM_CAROUSEL_MIN_ITEMS, INSTAGRAM_HOSTS, INSTAGRAM_SCRAPE_CREDIT_COSTS, INSTAGRAM_SCRAPE_DEFAULT_COUNT, INSTAGRAM_SCRAPE_FALLBACK_CREDIT_ID, INSTAGRAM_SCRAPE_MAX_COUNT, INSTAGRAM_SCRAPE_MAX_SOURCES, INSTAGRAM_SCRAPE_MAX_TARGET_LENGTH, INSTAGRAM_SCRAPE_MODES, INSTAGRAM_SCRAPE_NODE_TYPE, INSTAGRAM_SCRAPE_PERIODS, INSTAGRAM_SCRAPE_TIERS, ITER_CLONE_PATTERN, ImageCriticIssueSchema, ImageCriticResultSchema, ImageCriticVerdictSchema, ImprovePromptInputSchema, ImprovePromptResultSchema, KEYFRAME_CREDITS_PER_SHOT, KINETIC_CAPTION_STYLES, KINETIC_ONLY_CAPTION_LEVER_KEYS, LANGUAGES, LEGACY_EXPOSED_FIELD_KEYS, LEGACY_LOTTIE_HOST_REMAP, LEGACY_TEMPLATE_CATEGORIES, LIP_SYNC_DURATION_BUCKETS, LIP_SYNC_MAX_AUDIO_SECONDS, LIP_SYNC_PROVIDERS, LLM_FEATURE_DEFAULTS, LLM_MODALITY_CAPS, LLM_MODELS, LLM_MODEL_IDS, LLM_REASONING_EFFORTS, LLM_ROUTE_DEFAULTS, LLM_TEXT_INPUT_MAX, LLM_VENDOR_LABELS, LLM_VENDOR_ORDER, LOCATION_ASSET_TYPES, LOCATION_ASSET_VARIANTS, LOCATION_ATMOSPHERE_PROVIDERS, LOCATION_ATTACH_COLUMNS, LOCATION_BUCKET_TO_CATALOG_ID, LOCATION_PRESET_TO_CATALOG, LOCATION_REFERENCE_PHOTO_KINDS, LOCATION_REFERENCE_PHOTO_KIND_LABELS, LOCATION_USAGE_MODES, LOTTIE_OVERLAY_CATALOG, LOTTIE_SLOT_FIELD_PREFIX, LTX_EXTEND_DURATION, LTX_EXTEND_PER_SECOND_CREDIT_ID, LTX_RETAKE_MIN_DURATION_SEC, LTX_RETAKE_PER_SECOND_CREDIT_ID, LocationImageCriticVerdictSchema, LocationMetadataSchema, LocationsCoverageCriticIssueSchema, LocationsCoverageCriticVerdictSchema, MATCH_CUT_BREAK_GATE, MAX_CUSTOM_ENTRIES_PER_BOARD, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER, MAX_LOCATION_VARIANTS, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER, MAX_PANELS_PER_SHEET, MAX_TTS_CHARS_BY_PROVIDER, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER, MEMBER_STATUSES, META_ADS_ADVERTISER_MAX_RESULTS, META_ADS_ANALYSIS_CREDITS_PER_AD, META_ADS_ANALYSIS_CREDIT_ID, META_ADS_ANALYSIS_FOCUS_MAX, META_ADS_ANALYSIS_TIERS, META_ADS_FORMATS, META_ADS_NODE_MODES, META_ADS_PLATFORMS, META_ADS_SCRAPE_COUNT_OPTIONS, META_ADS_SCRAPE_CREDIT_COSTS, META_ADS_SCRAPE_DEFAULT_COUNT, META_ADS_SCRAPE_DEFAULT_COUNTRY, META_ADS_SCRAPE_FALLBACK_CREDIT_ID, META_ADS_SCRAPE_MAX_COUNT, META_ADS_SCRAPE_MAX_QUERY_LENGTH, META_ADS_SCRAPE_MAX_SOURCES, META_ADS_SCRAPE_MODES, META_ADS_SCRAPE_NODE_TYPE, META_ADS_SCRAPE_PERIODS, META_ADS_SCRAPE_STATUSES, META_ADS_SCRAPE_TIERS, MINIMAX_H3_DEFAULT_RESOLUTION, MINIMAX_H3_PROVIDERS, MODELS_WITH_REFERENCE_IMAGE_SUPPORT, MODEL_CATALOG, MODEL_KINDS, MODEL_PARAM_NODE_TYPES, MODEL_RECOMMENDATIONS, MODIFY_IMAGE_PROVIDERS, MOTION_COLUMN, MOTION_TRANSFER_PROVIDERS, MUSIC_CREDIT_ID, MUSIC_PROVIDERS, MUSIC_PROVIDER_LABELS, MatchCutVerdictSchema, NATIVE_ADAPTIVE_ASPECT, NATIVE_NEGATIVE_PROMPT_MODELS, NATIVE_NEGATIVE_VIDEO_PROVIDERS, NEGATIVE_PROMPT_MAX, NODARO_IMPORT_FILES, NODARO_LOAD_TIMELINE, NODARO_LOAD_VIDEO, NODARO_RESET_PROJECT, NODE_DEFAULT_TYPES, NODE_MAPPABLE_FIELDS, NODE_PRESET_EXPORT_KIND, NODE_REF_PATTERN, NON_EN_LOCALE_IDS, NON_PROMPT_TEXT_LANES, NO_SPLIT_DELIMITER, OAUTH_SCOPES, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ASSET_VARIANTS, OBJECT_ATTACH_COLUMNS, OBJECT_MOTION_PROVIDERS, OBJECT_PICKER_NODE_TYPES, ORG_ERROR_CODES, ORG_KINDS, ORG_ROLES, ORG_STATUSES, OUTPUT_BEARING_NODE_STATUSES, OUTPUT_FIELD_MAP, OUTPUT_FORMATS, OVERLAY_ANCHORS, OVERLAY_FONTS, OVERLAY_FONT_IDS, OVERLAY_IMAGE_MASKS, OVERLAY_LAYER_KINDS, OVERLAY_MAX_VARIANTS, OVERLAY_PLATFORMS, OVERLAY_PLATFORM_IDS, OVERLAY_SHAPES, OVERLAY_TEXT_ALIGNS, OVERLAY_VARIANT_HANDLE_PREFIX, OWN_LIST_NODE_TYPES, ObjectMetadataSchema, OptimizeForModelInputSchema, OptimizeForModelResultSchema, OrgSettingsSchema, PARAMETER_NODE_TYPES, PASSTHROUGH_TYPES, PAYG_RETENTION_DAYS, PER_FORMAT_DURATION_BOUNDS, PICKER_TO_COMBINE_TRANSITION, PIPELINE_ACTIVATION_MODES, PIPELINE_FORMATS, PIPELINE_HARD_TIMEOUT_MS, PIPELINE_MODEL_STAGES, PIPELINE_MODES, PIPELINE_OUTPUT_RESOLUTIONS, PIPELINE_PINNABLE_IMAGE_MODELS, PIPELINE_PINNABLE_SCRIPT_LLMS, PIPELINE_PINNABLE_VIDEO_MODELS, PIPELINE_STAGE_NAMES, PIPELINE_STAGE_TIMEOUT_MS, PIPELINE_TYPES, PLACEHOLDER_CHARACTER_NAME, PLATFORM_LABELS, PLATFORM_SPECS, PRESET_APPLY_CLEAR_KEYS, PRESET_EXCLUDED_KEYS, PRESET_LABELS, PRESET_LEVER_GROUPS, PRESET_SETTING_KEYS, PRICING_DEFAULT_DURATION_SEC, PRICING_DEFAULT_RESOLUTION, PRO3D_RENDER_ASPECT_RATIOS, PRO3D_RENDER_CREDIT_ID, PRO3D_RENDER_DEFAULT_ENGINE, PRO3D_RENDER_DEFAULT_QUALITY, PRO3D_RENDER_DEFAULT_REPAIR_PASSES, PRO3D_RENDER_DEFAULT_STYLE, PRO3D_RENDER_ENGINES, PRO3D_RENDER_LABEL, PRO3D_RENDER_LIMITS, PRO3D_RENDER_MAX_REPAIR_PASSES, PRO3D_RENDER_MIN_REPAIR_PASSES, PRO3D_RENDER_NODE_TYPE, PRO3D_RENDER_PROMPT_MAX, PRO3D_RENDER_QUALITY_PROFILES, PRO3D_RENDER_SOURCE_KINDS, PRO3D_RENDER_STYLES, PROJECTED_TRIGGER_NODE_TYPES, PROMPT_HARD_CEILING, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PROVIDER_DIRECTIVE_DEFAULTS, PROVIDER_PLACEHOLDER_PREFIX, PipelineCompletedEventSchema, PipelineConfigSchema, PipelineDriftSummarySchema, PipelineEditorDecisionsReadyEventSchema, PipelineForkedEventSchema, PipelineInputSchema, PipelineMusicReadyEventSchema, PipelineStageNameSchema, PipelineStageStatusSchema, PipelineStateSchema, PipelineStatusSchema, PresetSettingsSchema, QA_CHECK_PROVIDERS, REASONING_OUTPUT_FLOOR, RECAST_SEGMENT_PACKS, REDUCE_STRATEGIES, REDUCE_STRATEGY_IDS, REFERENCE_BOARD_PROVIDERS, REFERENCE_BOARD_TEMPLATES, REFERENCE_HANDLE_MAP, REFERENCE_ROLE_PRESETS, REF_HANDLE_CATEGORY, REF_IMAGE_MAX_LIMITS, REF_TOKEN_NAMESPACE_PREFIXES, RENDERING_SPEED_SUPPORT, RENDER_VIDEO_CREDIT_ID, REPEATABLE_NODE_TYPES, REPEAT_PLACEHOLDER, REPLICATE_LIP_SYNC_PROVIDERS, RESERVED_TEMPLATE_VARS, SAVED_POSTS_LOOKUP_MAX, SAVED_POSTS_PAGE_MAX, SAVED_POST_MAX_TAGS, SAVED_POST_NOTE_MAX, SAVED_POST_SOURCES, SAVED_POST_TAG_MAX, SCENE3D_ASSERTION_RESTORED_CODE, SCENE3D_ASSET_KINDS, SCENE3D_ASSET_ROLES, SCENE3D_ASSET_ROLE_KINDS, SCENE3D_AUTHORING_ASSUMPTION_CODE, SCENE3D_AUTHORING_ENGINES, SCENE3D_BASIC_ENGINE, SCENE3D_BASIC_SCHEMA_VERSION, SCENE3D_CAMERA_TRACK_FORMAT, SCENE3D_CAMERA_TRACK_LIMITS, SCENE3D_CAMERA_TRACK_VERSION, SCENE3D_CLAY_LIGHTING_PRESETS, SCENE3D_DEFAULT_ADVANCED_ENGINE, SCENE3D_DEFAULT_DURATION_SECONDS, SCENE3D_DEFAULT_ENTITY_CAPABILITIES, SCENE3D_DEFAULT_FPS, SCENE3D_EDIT_NODE_TYPE, SCENE3D_ENTITY_CAPABILITIES, SCENE3D_ENTITY_ROLES, SCENE3D_GENERATE_NODE_TYPE, SCENE3D_GLB_EXTRAS_ALLOWLIST, SCENE3D_GLB_EXTRAS_ENTITY_ID, SCENE3D_GLB_EXTRAS_MATERIAL_ROLE, SCENE3D_GLB_EXTRAS_SUBPART_ID, SCENE3D_LIMITS, SCENE3D_PLAN_FIELD, SCENE3D_PLAN_TYPE, SCENE3D_PRIMITIVES, SCENE3D_PRIMITIVE_MATERIAL_ROLE, SCENE3D_REMEDY_AUTO_APPLIED_CODE, SCENE3D_RENDERER_ASSET_KINDS, SCENE3D_RENDER_BASE_MAX_PX, SCENE3D_RENDER_TIERS, SCENE3D_RENDER_TIER_MULTIPLIERS, SCENE3D_RENDER_XLARGE_MIN_AREA_PX, SCENE3D_REVIEW_REFUSED_CODE, SCENE3D_REVIEW_UNAVAILABLE_CODE, SCENE3D_REVIEW_UNAVAILABLE_REASONS, SCENE3D_SCHEMA_VERSION, SCENE3D_SCHEMA_VERSION_V2, SCENE3D_SUPPORTED_SCHEMA_VERSIONS, SCENE3D_V2_CONTENT_HASH_EXCLUDED, SCENE3D_V2_ENGINES, SCENE3D_V2_LIMITS, SCENE3D_V2_OVERRIDE_OPERATION_VERSION, SCENE3D_V2_PRIMITIVES, SCENE_HELPER_NAMES, SCHEDULE_EVERY_LIMITS, SCHEDULE_RULE_KINDS, SCHEDULE_TRIGGER_NODE_TYPE, SCRAPER_ACTOR_LABELS, SCRAPER_CREDIT_COSTS, SCRAPER_OUTPUT_FIELDS, SCRIPT_PROVIDERS, SCRIPT_SCENE_COUNT_DEFAULT, SCRIPT_SCENE_COUNT_RANGE, SCRIPT_STYLE_GUIDE_MAX_LENGTH, SCRIPT_TARGET_DURATION_DEFAULT, SCRIPT_TARGET_DURATION_RANGE, SCRIPT_TONE_MAX_LENGTH, SEASONS, SECTION_BOARD, SECTION_KINDS, SEEDANCE_2_5_REF_LIMITS, SEEDANCE_2_CONTINUATION_REF_SEC, SEEDANCE_2_EXTEND_STITCH, SEEDANCE_2_PROVIDERS, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC, SEEDANCE_2_REF_LIMITS, SEEDANCE_LIP_SYNC_PROVIDERS, SEEDANCE_VIDEO_EDIT_PROVIDERS, SEEDANCE_VIDEO_EDIT_SHAPE, SEED_SUPPORT, SEPARATOR_DISPLAY, SEPARATOR_PRESETS, SETTINGS_HINT_SOURCES, SETTINGS_INPUT_CONSUMERS, SETTINGS_INPUT_HANDLE, SETTINGS_SOURCE_FIELDS, SETTINGS_SOURCE_TYPES, SHEET_ASPECTS, SHEET_BACKGROUNDS, SHEET_PRESETS, SHEET_SKINS, SHEET_TYPES, SHORT_FILM_ANGLE_COUNT, SHORT_FILM_EXPRESSION_COUNT, SHORT_FILM_VARIANT_THRESHOLD_SEC, SLOT_TOKEN_RE, SMART_CUT_WINDOW_DEFAULT, SMART_CUT_WINDOW_MAX, SMART_CUT_WINDOW_MIN, SOCIAL_PLATFORMS, SOCIAL_POST_NODE_TYPES, SOCIAL_POST_VIDEO_LINK_MARGIN_MS, SOCIAL_SEARCH_COUNTS, SOCIAL_SEARCH_CREDITS_PER_PAGE, SOCIAL_SEARCH_CREDIT_COSTS, SOCIAL_SEARCH_DEFAULT_PICK_TOP, SOCIAL_SEARCH_MAX_QUERY_LENGTH, SOCIAL_SEARCH_MODES, SOCIAL_SEARCH_NODE_TYPE, SOCIAL_SEARCH_PAGED_MODES, SOCIAL_SEARCH_PERIODS, SOCIAL_SEARCH_PLATFORM_MODES, SOCIAL_SEARCH_SORTS, SOCIAL_SEARCH_VIDEO_KINDS, SOCIAL_VIDEO_HOSTS, SPEAKER_EMPHASIS_STYLES, SPEAKER_LAYOUTS, SPEAKER_LAYOUT_IDS, SPEAKER_SWITCHES, SPEAKER_SWITCH_IDS, STAGE_PATCH_SCHEMA, STATIC_CAPTION_STYLES, STRUCTURAL_SECTIONS, STRUCTURED_VISION_MODELS, STUDIO_DEPENDENT_FRAMES_CAPABILITY, STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS, STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS, STUDIO_KEYFRAME_REVIEW_KEYS, STUDIO_KEYFRAME_TRANSIENT_KEYS, STUDIO_PREVIZ_RUN_STATE_KEYS, STUDIO_SEQUENCE_PLANNING_KEYS, STUDIO_SEQUENCE_POLICY_KEYS, STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS, STUDIO_SEQUENCE_UNIT_REVIEW_KEYS, STUDIO_SHOT_DRAFT_KEYS, STUDIO_SHOT_TRANSIENT_KEYS, STUDIO_TAKE_SEQUENCE_KEYS, STUDIO_TAKE_VOICE_KEYS, STUDIO_TRANSIENT_KEYS, SUBMISSION_STATUSES, SUNO_ACTIVE_MODELS, SUNO_ADD_TRACK_MODELS, SUNO_DURATION_MODELS, SUNO_FIELD_HANDLE_FIELDS, SUNO_HARD_CEILING, SUNO_LEGACY_MODELS, SUNO_MODELS, SUNO_SELECT_OPERATIONS, SUNO_TEXT_MAX, SUNO_TITLE_MAX, SUNO_TRACK_SOURCE_TYPES, SUNO_VERSION_CREDIT_KEYS, SUNO_VERSION_PRICED_OPERATIONS, SUPPORTED_FONT_NAMES, SURROUND_DIRECTIONS, SWITCHX_BLOCK_FRAMES, SWITCHX_FRAME_TIERS, SceneHelperNameSchema, SceneInputModeSchema, SceneMetadataSchema, SceneNodeDataSchema, SceneSpecSchema, ScriptCriticVerdictSchema, SequenceExecutionRequiredError, ShotSpecSchema, ShowrunnerPlanSchema, StageAwaitingSubGateEventSchema, StoryboardCohesionCriticVerdictSchema, StyleDirectivesSchema, SubGateNameSchema, T2I_TO_I2I_VARIANT, TASK_CHAINED_EDIT_PROVIDERS, TELEGRAM_ACCOUNT_SEND_NODE_TYPE, TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_FIELDS, TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE, TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE, TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES, TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS, TELEGRAM_SEND_AS, TELEGRAM_SEND_DESTINATIONS, TELEGRAM_TRIGGER_NODE_TYPE, TEMPLATE_CATEGORIES, TEXT_TO_AUDIO_PRICING, TEXT_TO_AUDIO_PROVIDERS, TEXT_TO_AUDIO_SFX_CREDIT_IDS, TEXT_TO_VIDEO_PROVIDERS, TIER_MAX_PIPELINE_COST_CREDITS, TIER_PIPELINE_PARALLELISM, TILT_CARRIED_FRACTION, TOPAZ_DEFAULT_UPSCALE_FACTOR, TOPAZ_UPSCALE_FACTORS, TRANSCRIBE_LANES, TRANSCRIBE_PROVIDERS, TRANSCRIBE_PROVIDER_CAPABILITIES, TRANSIENT_RUNTIME_KEYS, TTS_FALLBACK_PROVIDER, TTS_PROVIDERS, TTS_PROVIDER_ALIASES, TTS_TEXT_MAX, TWO_K_RESOLUTION_PROVIDERS, TransitionTypeSchema, UPSCALE_IMAGE_PROVIDERS, USAGE_GROUP_BYS, USAGE_MODES, VARIABLES_HANDLE_ID, VARIABLE_PRICING_MODELS, VEHICLES, VEHICLE_SUBCATEGORY_LABELS, VEHICLE_SUBCATEGORY_ORDER, VEO_PROVIDERS, VIDEO_ANALYSIS_AUDIO_MODES, VIDEO_ANALYSIS_BUCKET_CREDITS, VIDEO_ANALYSIS_BUCKET_GRACE_SEC, VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN, VIDEO_ANALYSIS_DEFAULT_VARIATION, VIDEO_ANALYSIS_DURATION_BUCKETS, VIDEO_ANALYSIS_DURATION_TOLERANCE_SEC, VIDEO_ANALYSIS_ENTITY_SOURCES, VIDEO_ANALYSIS_FACELESS_ANGLES, VIDEO_ANALYSIS_LEGACY_MODELS, VIDEO_ANALYSIS_LLM_MODELS, VIDEO_ANALYSIS_MAX_DURATION_SEC, VIDEO_ANALYSIS_MAX_SCENE_SEC, VIDEO_ANALYSIS_MAX_VARIATIONS, VIDEO_ANALYSIS_MIXED_TIERS, VIDEO_ANALYSIS_SHOT_ANGLES, VIDEO_ANALYSIS_SPEED_EFFECTS, VIDEO_ANALYSIS_STORY_JUMPS, VIDEO_ANALYSIS_TEXT_KINDS, VIDEO_ANALYSIS_TIERS, VIDEO_ANALYSIS_TIER_LABELS, VIDEO_ANALYSIS_TIER_ORDER, VIDEO_ANALYSIS_TIMES_OF_DAY, VIDEO_ANALYSIS_TRANSITIONS, VIDEO_ANALYSIS_VARIATION_SLUGS, VIDEO_ANALYSIS_VISUAL_EFFECTS, VIDEO_ANALYSIS_WINDOW, VIDEO_AUDIO_CAPABILITY, VIDEO_AUDIT_BUCKET_CREDITS, VIDEO_CLIP_CREDITS, VIDEO_CRITIC_CREDITS_PER_SHOT, VIDEO_CRITIC_FRAME_MODES, VIDEO_CRITIC_MAX_RETRIES, VIDEO_CRITIC_METADATA_KEYS, VIDEO_CRITIC_MIN_ADHERENCE_SCORE, VIDEO_CRITIC_RESERVED_CREDITS_PER_SHOT, VIDEO_DURATION_AUTO, VIDEO_DURATION_TIERS, VIDEO_GEN_COLLAPSED_T2V_IDS, VIDEO_GEN_PROVIDERS, VIDEO_INPUT_LIP_SYNC_PROVIDERS, VIDEO_LINK_TOLERANT_CONSUMER_TYPES, VIDEO_MODEL_CAPS, VIDEO_MODE_ALIASES, VIDEO_ONLY_PARAMETER_NODE_TYPES, VIDEO_OUTPUT_CANVAS, VIDEO_OVERLAY_ANIMATION_MIN_SCALE, VIDEO_OVERLAY_ANIMATION_SEC, VIDEO_OVERLAY_BADGE_INSET, VIDEO_OVERLAY_BADGE_WIDTH, VIDEO_OVERLAY_BOUNDS, VIDEO_OVERLAY_BOX_FIELDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_DEFAULT_BACKGROUND, VIDEO_OVERLAY_ERROR_CODES, VIDEO_OVERLAY_FITS, VIDEO_OVERLAY_HANDLE_IDS, VIDEO_OVERLAY_LAYER_PLAN_HANDLE, VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH, VIDEO_OVERLAY_MAX_LAYERS, VIDEO_OVERLAY_MAX_TIME_SEC, VIDEO_OVERLAY_MAX_TOTAL_LAYER_BYTES, VIDEO_OVERLAY_OUTPUT_ASPECTS, VIDEO_OVERLAY_PRESETS, VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_WARNING_CODES, VIDEO_PRODUCER_TYPES, VIDEO_PROMPT_MAX, VIDEO_PROVIDERS_REQUIRING_IMAGE, VIDEO_PROVIDERS_WITHOUT_DISPATCH, VIDEO_REF_LIMITS_BY_PROVIDER, VIDEO_REF_VIDEO_DURATION_LIMITS, VIDEO_SFX_PRICING, VIDEO_TO_VIDEO_NODE_PROVIDERS, VIDEO_TO_VIDEO_PROVIDERS, VIDEO_UPSCALE_PROVIDERS, VIDEO_UTIL_PRICING, VIDEO_VARIABLE_PRICING, VOICE_CHANGER_MODELS, VOICE_CHANGER_MODEL_IDS, VOICE_DESIGN_MODELS, ValidateMatchCutInputSchema, ValidateMatchCutResultSchema, VideoCriticVerdictSchema, VoiceMatchSchema, WAN_3_DEFAULT_RESOLUTION, WAN_3_PROVIDERS, WARDROBE_VARIANTS, WEAPONS, WEAPON_SUBCATEGORY_LABELS, WEAPON_SUBCATEGORY_ORDER, WEBHOOK_TRIGGER_NODE_TYPE, WORKFLOW_VISIBILITIES, WORKSPACE_HEADER, WORKSPACE_HEADER_LOWER, WORKSPACE_ROLES, WorkspaceSettingsSchema, YOUTUBE_HOSTS, adCreativeAnalysisFrom, adviceFamilyOf, aggregateByType, aiAvatarReserveCreditId, alignedFieldList, analyzedSceneSchema, applyAudioSyncOffsets, applyDefaultVideoSelection, applyEdlCreditId, applyHandleInputOverride, applyRange, applyRangeIndices, applyScene3DEditOperations, applyScene3DV2EditOperations, applySettingsInput, applySlots, applyVideoAudioToggle, applyVideoNegativePrompt, applyVideoOverlayPreset, asEditPlanMode, asEditPlanTier, aspectRatioFromDims, aspectRatioOptionsByKind, aspectRatioToNumber, assembleNarratedVideoCredits, assembleVideoOverlayRequest, assertCanvasExecutionAllowed, autoStrokeWidth, availableReasoningEfforts, bucketSecondsFromAuditCreditId, bucketSecondsFromCreditId, buildBoardPrompt, buildChildrenByParent, buildConditionVariables, buildCreditModelIdentifier, buildEditPlanCreditId, buildExpressionFromVisual, buildFeedMaps, buildInstagramScrapeCreditId, buildLipSyncCreditId, buildLlmCreditIdentifier, buildMetaAdsScrapeCreditId, buildModelMenu, buildModelTree, buildMotionCreditModelIdentifier, buildNodePresetExport, buildPanelPrompt, buildPro3DRenderSource, buildProgressSegments, buildRangeLabel, buildScraperCreditId, buildVideoAnalysisCreditId, buildVideoAuditCreditId, buildVideoCreditModelIdentifier, calculateCombinedProgress, calculateMonetizationMarkup, calculateMonetizedCost, calculateProgress, cameraSwitchCameras, cameraSwitchEdlProblem, cameraSwitchSettingsPayload, canonicalExposedFieldKey, canonicalScene3DPlanV2Json, canonicalTtsProvider, canonicalVarName, canonicalizeOverrideKeys, captionRoutesToRemotion, centreCropToAspect, characterBoardItems, characterBucketDisplayRank, characterMentionSlug, characterMentionableAssetArrays, characterSheetRefItems, characterVariantAssetArrays, checkRefVideoDurations, cinematicCreditId, clampCameraSwitchSetting, clampCinematicDuration, clampContentIdeasCount, clampEditPlanClipCount, clampInstagramFeaturedIndex, clampMetaAdsFeaturedIndex, clampSmartCutWindow, classifyCreativeFormat, classifyRefToken, cleanOrphanedItems, cleanSpeakerNames, clearImageCriticMetadata, clearVideoCriticMetadata, clearWiredVideoOverlayImageUrls, clipLookSchema, collectAncestorRefs, combineSameLabelRefs, compactWithRows, competitorScanCreditId, competitorScanCredits, competitorScanSearches, computeAggregateLanes, computeFrameFitPlan, computeScene3DPlanV2ContentHash, connectedSettingsSources, contentIdeasCreditFeature, contentIdeasCreditId, contentRecipeCreditId, countRefModalityEdges, creditRangesAll, creditsToUsd, decodeProviderItem, defaultCarriedFraction, defaultEdgeOutputMode, defaultResolutionFor, defaultRoleForSource, defaultSpeakerMap, defaultVideoAspectRatio, deriveLinkedFields, deriveLottieSlotFields, deriveSlotRefs, describeAudioSyncOffsetIssue, describeEdgeBehavior, describeMaskRegion, describeNodeAdjustments, describeSlotControl, detectVideoLinkPlatform, dropUnknownBindings, dropUnknownSpeakers, durationsByMode, editPlanBasis, editPlanBucketMinutes, editPlanSavedOutput, editPlanSourceDurationSec, editPlanTranscriptOrigin, edlDurationMs, effectiveContentModel, effectiveReasoningEffort, encodeProviderItem, ensureLocaleCatalogLoaded, entityHydrationColumns, entityMentionSlug, entityMentionSlugForRef, entityScalarFields, entitySlotSchema, entryMatchesQuery, estimateCombineVideosCredits, estimateFilmCredits, estimateLoopTrimAddonCredits, estimateLoopVideoCredits, estimateScriptDurationSec, estimateSheetCost, estimateTrimVideoCredits, evaluateCondition, evaluateConditionGroup, evaluateJsonExpression, evaluateJsonPath, expandExtraRefsToConnectedReferences, expandItemsWithRepeat, expandVideoOverlayLayer, expandVideoOverlayPresets, extractAllGeneratedResults, extractCharacterLoraFields, extractGeneratedJsonAsList, extractPresetData, extractReferencedLabels, extractVideoDurationFromNode, fanOutTextFeedsPrompt, featuredInstagramOutputs, featuredMetaAdOutputs, fieldKeyFromHandle, filterCloneNodes, findCharacterMentionTokens, findEntityMentionTokens, findImageMentionTokens, findLocationMentionTokens, findSeedance2AudioOverLimit, findWordlessTranscriptFeeds, firstSightExtraRole, fitAspectRatioToModel, flattenItems, formatVideoOverlayError, getAnimal, getAnimalLabel, getAnimalPromptHint, getAnimalTerm, getAspectRatioOptions, getAudioCrossfadeCurve, getCharacterFacet, getCombineTransition, getCreditRange, getDurationsForModel, getEffectiveRepeatCount, getFeaturedEntities, getFurniture, getFurnitureLabel, getInputFieldSchema, getInputNodes, getItemSortId, getLipSyncMaxAudioSeconds, getLlmModalityCaps, getLlmModel, getLlmTier, getLocaleDirection, getMaxImagePromptChars, getMaxNegativePromptChars, getMaxSunoPromptChars, getMaxSunoStyleChars, getMaxTtsChars, getMaxVideoPromptChars, getModel, getNodeLabel, getNodeResult, getOutputNodes, getOutputType, getParameterValue, getQualityOptions, getResolutionOptions, getRouteReachableNodeIds, getSpeakerLayout, getSpeakerSwitch, getStrategy, getTargetField, getTtsCapabilities, getValidValues, getVehicle, getVehicleLabel, getVideoAudioCapability, getWeapon, getWeaponLabel, groupByFamily, groupByKindAndFamily, groupHandleId, groupLlmModelsByVendor, hasContiguousSegmentDurations, hasDrawableVideoOverlayBox, hasFeature, hasUrlParserHazard, hexToRgbaArray, hostnameMatchesAllowlist, humanizeSlotSid, imageMentionSlug, imageMentionSlugForRef, imageOverlayBillableVariants, imageOverlayCredits, imageReferenceLimit, inferMusicVideo, instagramAnalysisCreditId, instagramAnalysisTierFrom, instagramPostLink, instagramRequestedCount, instagramScrapeCreditIdFromNode, instagramScrapeMode, instagramScrapeSources, instagramScrapeTier, isAggregateableType, isAutoVideoDuration, isCharacterAspectRatio, isCollectInEdge, isCompetitorAboutPlatform, isCronExpression, isDefaultSelectorConfig, isEdlTargetAspect, isExpandedClone, isFacebookPageUrl, isFanInEdge, isFanInNodeType, isFanOutUrlItem, isFlux2Model, isGeminiOmniProvider, isGvpSupportedProvider, isHandleInputWired, isInstagramScrapeCount, isInstagramScrapeMode, isKineticCaptionStyle, isKnownScene3DEngine, isKnownSpeakerEmphasisStyle, isLegacySunoModel, isLocationUsageMode, isMeasurableCard, isMetaAdsFormat, isMetaAdsPlatform, isMetaAdsScrapeCount, isMetaAdsScrapeMode, isMetaCdnImageUrl, isMinimaxH3Provider, isObjectAspectRatio, isOversizedScene, isPaygRetentionActive, isPerSecondLipSyncProvider, isPro3DRenderJobOutput, isPro3DRenderQuote, isPro3DRenderRenderOnly, isProjectedTriggerNodeType, isRtlText, isScene3DAuthoringEngine, isScene3DCameraTrack, isScene3DHttpUrl, isScene3DPlan, isScene3DPlanV1, isScene3DPlanV2, isScene3DReviewUnavailableReason, isScene3DSchemaVersionSupported, isScraperActor, isSeedance2Provider, isSeedanceVideoEditProvider, isSettingsHintEdge, isSettingsHintSource, isSettingsSourceType, isSocialPost, isSocialSearchPickFrozen, isSocialVideoUrl, isTelegramAccountTriggerNamedHandle, isTemplateCategory, isTiltDirection, isUsageMode, isValidTimezone, isVeoProvider, isVideoAnalysisMixedTier, isVideoAnalysisTier, isVideoOverlayCorner, isVideoOverlayOutputAspect, isVideoOverlayPresetId, isWan3Provider, jsonResultToList, knownEntitySlugsFromRefs, knownImageSlugsFromRefs, legacyScheduleToRules, listBoardTemplates, listModels, listResultsServeHandle, listSlotSids, liveRowColumn, llmRouteDefaults, localMinuteKey, localTimeIn, locationMentionSlug, locationReferencePhotoKindLabel, locationUsageModeLabel, ltxExtendDurationSec, ltxRetakeDurationSec, mapAspectRatio, mapQuality, mapShotIntentToProviderDirectives, matchVariant, matchesCron, matchesCronField, maxSegmentSecFor, maxSegmentsFor, maxVideoDurationSec, measuredCanvasCombinations, mergeClipLook, mergeEdlSourceOffsets, mergeExposedSettings, mergeNodeInputOverrides, metaAdsAdvertisersFrom, metaAdsAnalysisCreditId, metaAdsAnalysisTier, metaAdsAnalysisTierFrom, metaAdsNodeMode, metaAdsScrapeCreditIdFromNode, metaAdsScrapeSources, metaAdsScrapeTier, metaAdsScrapeWireSources, migrateEdgeOutputMode, migrateToItems, minSegmentSecFor, minimalRatioDimensions, modelIdsByKindMode, modelToNodeTarget, modelsForInputMode, modelsWithFeature, motionGraphicsFeature, newScene3DRevisionId, nextScheduleRuns, nodeFeedsAnything, nodeStateMayCarryOutput, normalizeCaptionNumericLevers, normalizeEdl, normalizeLottieLayers, normalizeMinimaxH3Resolution, normalizeModelInput, normalizeNodeModelParams, normalizePinterestUrl, normalizeRoleSlug, normalizeSavedPostTags, normalizeScheduleRule, normalizeScheduleRules, normalizeTemplateCategory, normalizeTranscript, normalizeVideoOverlayNodes, normalizeVideoRequestParams, normalizeWan3Resolution, orderedLlmModels, overlayFontById, overlayImageEffectsSchema, overlayPlatformById, overlayQrStyleSchema, overlayShapeElement, overlayShapeStyleSchema, overlayStrokeSchema, overlayTextStyleSchema, overlayVariantHandle, overlayVariantIdFromHandle, ownsItsList, parseAspectToken, parseAttributedDialogue, parseCharacterMentionToken, parseEntityMentionToken, parseGroupHandle, parseHandleId, parseImageMentionToken, parseListExpression, parseLocationMentionToken, parseNodePresetExport, parseNodeRef, parseScene3DCameraTrackJson, parseScene3DPlanV2Json, parseSpeakerEmphasisStyle, pickAiAvatarBucket, pickIds, pickLipSyncBucket, pickSocialPosts, pickSwitchXFrameTier, pickVideoAnalysisBucket, planFanOut, planSheetGeneration, planSheetPanels, preferredInputModeForModel, presentTypes, presetApplyClearKeys, presetDataMatches, presetEntries, presetLeverClearKeys, previewHorizonMs, pricedOutputDurationSec, pricedVideoSelection, pro3DRenderCoreOutputSchema, pro3DRenderFrameUnit, pro3DRenderJobOutputSchema, pro3DRenderProducedSchemaVersion, pro3DRenderQuoteSchema, pro3DRenderReviewVerdictSchema, pro3DRenderShotStillSchema, pro3DRenderShotStills, pro3DRenderTimingOverrides, qualityOptionsByKind, readPromptAffixes, readScriptSettings, reasoningOutputFloor, refHandleCategory, referenceModalityForHandle, referenceSheetCreditId, registerCatalogSidecars, registerSidecarLoaders, remapMsThroughEdl, remapTranscriptThroughEdl, renderAnalyzedScene, renderVideoCreditId, requiresSequenceExecution, resetCatalogSidecars, resolutionOptionsByKind, resolveAiAvatarCreditId, resolveAudioCrossfadeCurve, resolveCaptionLevers, resolveCaptionLook, resolveCharacterAspectRatio, resolveCinematicCreditId, resolveConditionValue, resolveDefaultRole, resolveDescription, resolveDialogueVoices, resolveEditPlanOutput, resolveEditPlanSources, resolveEdlSegmentSlots, resolveEffectiveSourceType, resolveEffectiveTier, resolveEntityAspect, resolveFieldMappings, resolveFrameDelivery, resolveFrameFitAspect, resolveGvpAnchorWire, resolveImageGenCreditIdentifier, resolveIndex, resolveInstagramScrapeCreditId, resolveLabel, resolveListExpression, resolveListFanOut, resolveLlmCreditId, resolveLocationFields, resolveLocationPresetCatalog, resolveLottieOverlaySrc, resolveMetaAdsScrapeCreditId, resolveMusicProvider, resolveNodeRefs, resolveNormalizedImageGen, resolveObjectAspectRatio, resolveOutputCanvas, resolvePipelineModel, resolveRelativeWindowToken, resolveScene3DAuthoringEngine, resolveScraperCreditId, resolveSelectorRefs, resolveSeparator, resolveSheetSections, resolveSlideshowTransition, resolveSourceThroughConnectedList, resolveStoredTier, resolveSwitchXCreditId, resolveTemplateCategory, resolveTopazUpscale, resolveVideoAnalysisModel, resolveVideoLinkOutput, resolveVideoModeForInputs, resolveVideoOverlayGeometry, resolveVideoProviderForMode, resolveWiredSettings, resolveXfadeName, rewriteSceneBindings, rewriteSlotTokens, rewriteSpeakerSlots, rgbaArrayToHex, roleToPhrase, rotationVec3Schema, ruleMatches, runSelector, safetyRetryPolicy, sanitizeRole, scaleVec3Schema, scene3DAcceptedSchemaVersionsSchema, scene3DAnchorNameSchema, scene3DAnchorSchema, scene3DAnyPlanSchema, scene3DAssetAnimationSchema, scene3DAssetIdSchema, scene3DAssetRefSchema, scene3DCameraChangesSchema, scene3DCameraKeyframeSchema, scene3DCameraSampleSchema, scene3DCameraSchema, scene3DCameraTrackIssues, scene3DCameraTrackObjectSchema, scene3DCameraTrackPlanIssues, scene3DCameraTrackSchema, scene3DClayLightingSchema, scene3DColorSchema, scene3DDeepEqual, scene3DEasingSchema, scene3DEditOperationSchema, scene3DEditOperationsSchema, scene3DEngineIdSchema, scene3DEntityAcceptsOverlay, scene3DEntityCapabilitySchema, scene3DEntityV2Schema, scene3DEntityVisualSchema, scene3DIdSchema, scene3DInputAssetSchema, scene3DInputAssetsForEngine, scene3DInputAssetsSchema, scene3DJsonByteLength, scene3DLightingChangesSchema, scene3DLightingSchema, scene3DMaterialBindingSchema, scene3DMaterialNameSchema, scene3DMaterialRoleSchema, scene3DNodeIdSchema, scene3DNodeNameSchema, scene3DObjectChangesSchema, scene3DObjectKeyframeSchema, scene3DObjectSchema, scene3DOverrideSchema, scene3DPlanIssues, scene3DPlanSchema, scene3DPlanSchemaVersion, scene3DPlanV1Issues, scene3DPlanV1ObjectSchema, scene3DPlanV1Schema, scene3DPlanV2Issues, scene3DPlanV2ObjectSchema, scene3DPlanV2Schema, scene3DPrimitiveSchema, scene3DProjectionIssues, scene3DProvenanceSchema, scene3DReferenceSchema, scene3DRenderTier, scene3DRenderTierCredits, scene3DReviewNote, scene3DReviewVerdictOf, scene3DSampleForFrame, scene3DSha256Schema, scene3DShotForFrame, scene3DShotIndexForFrame, scene3DShotSchema, scene3DUrlSchema, scene3DV2AdmissionIssues, scene3DV2EditOperationSchema, scene3DV2EditOperationsSchema, scene3DV2HierarchyDepth, scene3DV2NormalizationIssues, scene3DV2OverrideInputSchema, scene3DV2ResourceUsage, scene3DVersionTokenSchema, scene3DZodIssues, scheduleMatchesAt, scheduleOccurrences, searchModelVariants, seedance2AudioLimitSec, seedanceVideoEditCreditId, segmentDurationsFor, selectByModulo, selectByNamedKey, selectByPredicate, selectListItems, selectLoraRoutingForMentions, selectRandom, setRegisteredPersonPackFields, settingsInputAccepts, settingsInputFields, settingsProviderModels, settingsSourceForField, settingsSourceForType, settledWithLimit, signedLinkExpiresAt, sizeVec3Schema, slotVariationSchema, snapToModelDuration, socialPostDigestLine, socialPostsDigest, socialPostsFrom, socialPostsLongestVideoSec, socialSearchCount, socialSearchCountry, socialSearchCreditId, socialSearchCreditIdFromNode, socialSearchEffectiveCount, socialSearchMaxCount, socialSearchMode, socialSearchPages, socialSearchPickTop, socialSearchPlatform, socialSearchPostLink, socialSearchPostVideo, socialSearchRegion, socialSearchRequestFromNode, sortCharacterEntriesForDisplay, sortListItems, sourceRefKey, speakerLayoutAllows, speakerPresentationWarnings, speakerSwitchOverlaps, speakerTurns, speedRampCreditId, spliceDelimitedRows, splitByLoopDelimiter, splitGeneratedItems, splitInstagramTargets, splitMetaAdsAdvertiserNames, splitMetaAdsPageUrls, spreadJsonArrayIfSingleton, stringifyPathResults, stripDerivedAnalysisFields, stripExportContent, stripStudioDraftSettings, stripStudioDraftWorkflow, stripStudioTakeVoiceRecords, stripStudioTransientSettings, stripTransientRuntimeData, stripUnownedRefs, summarizeScene3DOperations, sunoCreditType, sunoModelHonoursDuration, supportedDefaultDimensions, supportsAdvancedMode, supportsAutoVideoDuration, supportsEndAnchor, supportsExtendRender, telegramAccountListeningSignature, telegramAccountTriggerOutputs, telegramSendAsOf, telegramSendDestinationOf, templateCategoryStoredValues, textToAudioBilledSeconds, textToAudioCreditId, timezoneOffsetMinutes, toConnectedReference, toConnectedReferences, toCustomVideoOverlayLayer, togglePick, transcribeLaneSupportsWordTimestamps, transcribeProvidersWithWordTimestamps, transcribeWordTimestampsRefusal, transcriptDurationSec, transcriptSpeakerLabels, tryParseJson, ttsHasLever, ttsLanguageCodes, ttsSupportsAudioTags, ttsSupportsSsmlBreaks, uiAspectRatioFill, uiDurationFill, uiResolutionFill, unresolvedRefTokens, unwrapEditPlanOutput, unwrapUnresolvedTokens, usageModeDirective, usageModeIncludesName, usageModeLabel, usdToCredits, validateAiAvatarPayload, validateCinematicAvatarPayload, validateDurationForFormat, validateEditedEdl, validateEdl, validateEdlClipSet, validateModeActivation, validateModelInput, validateNoNestedGroups, validateObjects, validateProviderForNodeType, validateSubWorkflowRoutes, validateVideoOverlayRequest, variantJobId, vec3Schema, verifyScene3DPlanV2ContentHash, videoAnalysisCreditSegment, videoAnalysisNumWindows, videoAnalysisResultSchema, videoAuditCreditsForBucket, videoLinkDownloadedFile, videoLinkNeedsDownload, videoLinkPageUrl, videoModelCanSpeakDialogue, videoModelSupportsAudio, videoNegativeSuffix, videoOverlayCanvas, videoOverlayCompositionKey, videoOverlayLayerLabel, videoOverlayPresetBox, videoOverlayRenderOrder, videoOverlaySlotOfHandle, videoOverlaySlotSources, videoProviderFoldsLoneEndFrame, videoProviderRequiresImage, videoSfxCreditId, windowAnalysisSchema, withWiredSettings, zipMergeLists };
|
|
22784
|
+
// src/render-output.ts
|
|
22785
|
+
var MEDIUM_FIELD = {
|
|
22786
|
+
video: "generatedVideoUrl",
|
|
22787
|
+
audio: "generatedAudioUrl"
|
|
22788
|
+
};
|
|
22789
|
+
var str5 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
22790
|
+
var BASIS = /^[0-9a-f]{16}$/;
|
|
22791
|
+
var basisOf = (v) => typeof v === "string" && BASIS.test(v) ? v : void 0;
|
|
22792
|
+
function renderResultStamp(output) {
|
|
22793
|
+
const o = output && typeof output === "object" ? output : {};
|
|
22794
|
+
const quality = o.quality === "proxy" || o.quality === "final" ? o.quality : void 0;
|
|
22795
|
+
const clipKey = str5(o.clipKey);
|
|
22796
|
+
const planBasis = basisOf(o.planBasis);
|
|
22797
|
+
const renderBasis = basisOf(o.renderBasis);
|
|
22798
|
+
return {
|
|
22799
|
+
...quality ? { quality } : {},
|
|
22800
|
+
...clipKey ? { clipKey } : {},
|
|
22801
|
+
...planBasis ? { planBasis } : {},
|
|
22802
|
+
...renderBasis ? { renderBasis } : {}
|
|
22803
|
+
};
|
|
22804
|
+
}
|
|
22805
|
+
function mediumOf(data) {
|
|
22806
|
+
return data.output === "audio" ? "audio" : "video";
|
|
22807
|
+
}
|
|
22808
|
+
function resultsOf(data) {
|
|
22809
|
+
return Array.isArray(data.generatedResults) ? data.generatedResults : [];
|
|
22810
|
+
}
|
|
22811
|
+
function itemOf(url, medium, entry) {
|
|
22812
|
+
const jobId = str5(entry?.jobId);
|
|
22813
|
+
const thumbnailUrl = str5(entry?.thumbnailUrl);
|
|
22814
|
+
return {
|
|
22815
|
+
url,
|
|
22816
|
+
medium,
|
|
22817
|
+
...jobId ? { jobId } : {},
|
|
22818
|
+
...thumbnailUrl ? { thumbnailUrl } : {},
|
|
22819
|
+
...entry ? renderResultStamp(entry) : {}
|
|
22820
|
+
};
|
|
22821
|
+
}
|
|
22822
|
+
function savedRenderOutput(data) {
|
|
22823
|
+
const medium = mediumOf(data);
|
|
22824
|
+
const results = resultsOf(data);
|
|
22825
|
+
const index = typeof data.activeResultIndex === "number" ? data.activeResultIndex : 0;
|
|
22826
|
+
const selected = results[index] ?? results[0];
|
|
22827
|
+
const selectedUrl = str5(selected?.url);
|
|
22828
|
+
if (selectedUrl) return itemOf(selectedUrl, medium, selected);
|
|
22829
|
+
const own = str5(data[MEDIUM_FIELD[medium]]);
|
|
22830
|
+
if (own) return { url: own, medium };
|
|
22831
|
+
const other = medium === "video" ? "audio" : "video";
|
|
22832
|
+
const otherUrl = str5(data[MEDIUM_FIELD[other]]);
|
|
22833
|
+
return otherUrl ? { url: otherUrl, medium: other } : void 0;
|
|
22834
|
+
}
|
|
22835
|
+
function savedRenderBatch(data) {
|
|
22836
|
+
const batch = data.__listResults;
|
|
22837
|
+
if (!Array.isArray(batch) || batch.length === 0) return void 0;
|
|
22838
|
+
const medium = mediumOf(data);
|
|
22839
|
+
const byUrl = /* @__PURE__ */ new Map();
|
|
22840
|
+
for (const entry of resultsOf(data)) {
|
|
22841
|
+
const url = str5(entry.url);
|
|
22842
|
+
if (url && !byUrl.has(url)) byUrl.set(url, entry);
|
|
22843
|
+
}
|
|
22844
|
+
return batch.map((row) => {
|
|
22845
|
+
const url = str5(row);
|
|
22846
|
+
return url ? itemOf(url, medium, byUrl.get(url)) : null;
|
|
22847
|
+
});
|
|
22848
|
+
}
|
|
22849
|
+
function savedRenderBatchUrls(data) {
|
|
22850
|
+
const batch = savedRenderBatch(data);
|
|
22851
|
+
return batch ? batch.map((item) => item?.url ?? "") : void 0;
|
|
22852
|
+
}
|
|
22853
|
+
function edlSpanKey(edl) {
|
|
22854
|
+
if (!edl || typeof edl !== "object" || Array.isArray(edl)) return void 0;
|
|
22855
|
+
let segments;
|
|
22856
|
+
try {
|
|
22857
|
+
segments = normalizeEdl(edl).segments;
|
|
22858
|
+
} catch {
|
|
22859
|
+
return void 0;
|
|
22860
|
+
}
|
|
22861
|
+
if (segments.length === 0) return void 0;
|
|
22862
|
+
let min = Infinity;
|
|
22863
|
+
let max = -Infinity;
|
|
22864
|
+
for (const s of segments) {
|
|
22865
|
+
if (s.inMs < min) min = s.inMs;
|
|
22866
|
+
if (s.outMs > max) max = s.outMs;
|
|
22867
|
+
}
|
|
22868
|
+
return Number.isFinite(min) && Number.isFinite(max) ? `${min}-${max}` : void 0;
|
|
22869
|
+
}
|
|
22870
|
+
function planClipKeyAt(plan, row) {
|
|
22871
|
+
if (!Array.isArray(plan)) return void 0;
|
|
22872
|
+
let clip = plan[row];
|
|
22873
|
+
if (typeof clip === "string") {
|
|
22874
|
+
if (!clip.trim()) return void 0;
|
|
22875
|
+
try {
|
|
22876
|
+
clip = JSON.parse(clip);
|
|
22877
|
+
} catch {
|
|
22878
|
+
return void 0;
|
|
22879
|
+
}
|
|
22880
|
+
}
|
|
22881
|
+
return edlSpanKey(clip);
|
|
22882
|
+
}
|
|
22883
|
+
var TELEPORT_TYPES2 = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
|
|
22884
|
+
var EDL_PASS_THROUGH_TYPES = /* @__PURE__ */ new Set(["camera-switch"]);
|
|
22885
|
+
function outputModeOf2(data) {
|
|
22886
|
+
const mode = data && typeof data === "object" ? data.outputMode : void 0;
|
|
22887
|
+
return typeof mode === "string" ? mode : void 0;
|
|
22888
|
+
}
|
|
22889
|
+
function renderPlanPath(renderId, nodes, edges) {
|
|
22890
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
22891
|
+
const lastEdlInto = (id) => edges.filter((e) => e.target === id && e.targetHandle === "edl").at(-1);
|
|
22892
|
+
const teleportInput = (id) => edges.find((e) => e.target === id);
|
|
22893
|
+
const visited = /* @__PURE__ */ new Set();
|
|
22894
|
+
const hops = [];
|
|
22895
|
+
let consumer = lastEdlInto(renderId);
|
|
22896
|
+
let edge = consumer;
|
|
22897
|
+
while (edge && consumer) {
|
|
22898
|
+
const node = byId.get(edge.source);
|
|
22899
|
+
if (!node || visited.has(node.id)) return void 0;
|
|
22900
|
+
visited.add(node.id);
|
|
22901
|
+
if (TELEPORT_TYPES2.has(node.type ?? "")) {
|
|
22902
|
+
edge = teleportInput(node.id);
|
|
22903
|
+
continue;
|
|
22904
|
+
}
|
|
22905
|
+
const mode = outputModeOf2(consumer.data) ?? defaultEdgeOutputMode(node.type, edge.sourceHandle);
|
|
22906
|
+
hops.unshift({ edge: consumer, each: mode === "each", ...node.type ? { source: node.type } : {} });
|
|
22907
|
+
if (node.type === "edit-plan") return { planId: node.id, hops };
|
|
22908
|
+
if (!EDL_PASS_THROUGH_TYPES.has(node.type ?? "")) return void 0;
|
|
22909
|
+
consumer = lastEdlInto(node.id);
|
|
22910
|
+
edge = consumer;
|
|
22911
|
+
}
|
|
22912
|
+
return void 0;
|
|
22913
|
+
}
|
|
22914
|
+
function passThroughRan(path, ranIds) {
|
|
22915
|
+
return path.hops.slice(0, -1).every((hop) => ranIds.has(hop.edge.target));
|
|
22916
|
+
}
|
|
22917
|
+
function renderPlanNodeId(renderId, nodes, edges) {
|
|
22918
|
+
return renderPlanPath(renderId, nodes, edges)?.planId;
|
|
22919
|
+
}
|
|
22920
|
+
var isHole = (clip) => clip == null || typeof clip === "string" && !clip.trim();
|
|
22921
|
+
var keptClips = (clips) => clips.filter((clip) => !isHole(clip));
|
|
22922
|
+
function singlePick(clips, hop) {
|
|
22923
|
+
const data = hop.edge.data;
|
|
22924
|
+
const mode = outputModeOf2(hop.edge.data);
|
|
22925
|
+
if (mode === "item") {
|
|
22926
|
+
const expr = typeof data?.itemIndex === "string" ? data.itemIndex : "1";
|
|
22927
|
+
return [clips[resolveIndex(expr, clips.length)] ?? clips[0]];
|
|
22928
|
+
}
|
|
22929
|
+
if (mode?.startsWith("item:")) return [clips[parseInt(mode.slice(5), 10)] ?? clips[0]];
|
|
22930
|
+
if (mode === "all") return selectListItems(clips, data);
|
|
22931
|
+
if (hop.source === "edit-plan") return keptClips(clips).slice(0, 1);
|
|
22932
|
+
return clips.length === 1 ? clips : [];
|
|
22933
|
+
}
|
|
22934
|
+
function renderPlanValue(plan, row, hops = []) {
|
|
22935
|
+
if (!Array.isArray(plan)) return plan === null || typeof plan !== "object" ? void 0 : plan;
|
|
22936
|
+
let clips = plan;
|
|
22937
|
+
for (const [i, hop] of hops.entries()) {
|
|
22938
|
+
if (clips.length === 0) return void 0;
|
|
22939
|
+
if (hop.each) {
|
|
22940
|
+
clips = selectListItems(clips, hop.edge.data);
|
|
22941
|
+
if (i < hops.length - 1) clips = keptClips(clips);
|
|
22942
|
+
} else {
|
|
22943
|
+
clips = singlePick(clips, hop);
|
|
22944
|
+
if (clips.length !== 1) return void 0;
|
|
22945
|
+
}
|
|
22946
|
+
}
|
|
22947
|
+
if (clips.length === 0) return void 0;
|
|
22948
|
+
const rowed = row !== void 0 && (hops.at(-1)?.each ?? true);
|
|
22949
|
+
if (rowed) {
|
|
22950
|
+
const clip = clips[row % clips.length];
|
|
22951
|
+
return isHole(clip) ? void 0 : clip;
|
|
22952
|
+
}
|
|
22953
|
+
const kept = keptClips(clips);
|
|
22954
|
+
return kept.length === 1 ? kept[0] : void 0;
|
|
22955
|
+
}
|
|
22956
|
+
function renderClipKey(plan, row, hops = []) {
|
|
22957
|
+
if (!Array.isArray(plan)) return void 0;
|
|
22958
|
+
const clip = renderPlanValue(plan, row, hops);
|
|
22959
|
+
return clip === void 0 ? void 0 : planClipKeyAt([clip], 0);
|
|
22960
|
+
}
|
|
22961
|
+
function renderPlanClipKey(renderId, nodes, edges, planClips, row) {
|
|
22962
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
22963
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
22964
|
+
if (!path || !planNode) return void 0;
|
|
22965
|
+
return renderClipKey(planClips(planNode), row, path.hops);
|
|
22966
|
+
}
|
|
22967
|
+
function renderPlanRowClipKeys(renderId, nodes, edges, planClips, rows, ranIds) {
|
|
22968
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
22969
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
22970
|
+
if (!path || !planNode || !passThroughRan(path, ranIds)) return rows.map(() => void 0);
|
|
22971
|
+
const plan = planClips(planNode);
|
|
22972
|
+
return rows.map((row) => renderClipKey(plan, row, path.hops));
|
|
22973
|
+
}
|
|
22974
|
+
function renderRunQuality(data) {
|
|
22975
|
+
return data?.quality === "proxy" ? "proxy" : "final";
|
|
22976
|
+
}
|
|
22977
|
+
function renderSentRowStamps(quality, clipKeys) {
|
|
22978
|
+
return clipKeys.map((clipKey) => ({ quality, ...clipKey ? { clipKey } : {} }));
|
|
22979
|
+
}
|
|
22980
|
+
var readBasisByValue = /* @__PURE__ */ new WeakMap();
|
|
22981
|
+
var isPlainObject2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
22982
|
+
function renderReadBasis(value) {
|
|
22983
|
+
let v = value;
|
|
22984
|
+
if (typeof v === "string") {
|
|
22985
|
+
if (!v.trim()) return void 0;
|
|
22986
|
+
try {
|
|
22987
|
+
v = JSON.parse(v);
|
|
22988
|
+
} catch {
|
|
22989
|
+
return void 0;
|
|
22990
|
+
}
|
|
22991
|
+
}
|
|
22992
|
+
if (!isPlainObject2(v)) return void 0;
|
|
22993
|
+
const cached = readBasisByValue.get(v);
|
|
22994
|
+
if (cached !== void 0) return cached;
|
|
22995
|
+
const { meta: _meta, ...rest } = v;
|
|
22996
|
+
const basis = editPlanBasis(rest);
|
|
22997
|
+
readBasisByValue.set(v, basis);
|
|
22998
|
+
return basis;
|
|
22999
|
+
}
|
|
23000
|
+
function renderSettingsBasis(settings, sources = []) {
|
|
23001
|
+
const raw = settings.crossfadeMs;
|
|
23002
|
+
const crossfadeMs = typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.round(raw)) : 0;
|
|
23003
|
+
return editPlanBasis({
|
|
23004
|
+
crossfadeMs,
|
|
23005
|
+
output: settings.output === "audio" ? "audio" : "video",
|
|
23006
|
+
sources: sources.map((url) => typeof url === "string" ? url : "")
|
|
23007
|
+
});
|
|
23008
|
+
}
|
|
23009
|
+
function renderPlanBasis(renderId, nodes, edges, planOutput, row, ranIds) {
|
|
23010
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
23011
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
23012
|
+
if (!path || !planNode) return void 0;
|
|
23013
|
+
if (!passThroughRan(path, ranIds)) return void 0;
|
|
23014
|
+
return renderReadBasis(renderPlanValue(planOutput(planNode), row, path.hops));
|
|
23015
|
+
}
|
|
23016
|
+
|
|
23017
|
+
// src/handle-aliases.ts
|
|
23018
|
+
var LEGACY_SOURCE_HANDLE_ALIASES = {
|
|
23019
|
+
// Batch 1
|
|
23020
|
+
"generate-music": { "audio-out": "audio" },
|
|
23021
|
+
// Batch 2 — Suno output id normalization
|
|
23022
|
+
"suno-add-instrumental": { "audio-out": "audio" },
|
|
23023
|
+
"suno-add-vocals": { "audio-out": "audio" },
|
|
23024
|
+
"suno-convert-wav": { "audio-out": "audio" },
|
|
23025
|
+
"suno-mashup": { "audio-out": "audio" },
|
|
23026
|
+
"suno-replace-section": { "audio-out": "audio" },
|
|
23027
|
+
"suno-upload-extend": { "audio-out": "audio" },
|
|
23028
|
+
"suno-music-video": { "video-out": "video" },
|
|
23029
|
+
"suno-style-boost": { "text-out": "text" },
|
|
23030
|
+
"suno-separate": { "vocal-out": "vocals", "instrumental-out": "instrumental" },
|
|
23031
|
+
// Batch 4 — Processing output id normalization (non-ffmpeg ones only)
|
|
23032
|
+
"split-text": { out: "text" },
|
|
23033
|
+
// split-media produces dual-typed outputs; map each leg of the legacy
|
|
23034
|
+
// `*-out` pair to the new single-word form.
|
|
23035
|
+
"split-media": { "audio-out": "audio", "video-out": "video" },
|
|
23036
|
+
// Phase 20 — Image-producer output id normalization. Pre-migration these
|
|
23037
|
+
// nodes shipped a single generic `out` source handle; after the typed-handle
|
|
23038
|
+
// migration their source pip is the canonical type name.
|
|
23039
|
+
"edit-image": { out: "image" },
|
|
23040
|
+
"modify-image": { out: "image" },
|
|
23041
|
+
"image-to-image": { out: "image" },
|
|
23042
|
+
"upscale-image": { out: "image" },
|
|
23043
|
+
"remove-background": { out: "image" },
|
|
23044
|
+
"face-swap": { out: "video" },
|
|
23045
|
+
// Phase 21 — Video-producer output id normalization.
|
|
23046
|
+
"motion-transfer": { out: "video" },
|
|
23047
|
+
// Phase 22 — Upload/source-node output id normalization.
|
|
23048
|
+
"reference-audio": { "audio-out": "audio" },
|
|
23049
|
+
// Phase 24c — Compositing-stragglers output id normalization.
|
|
23050
|
+
"speed-ramp": { "video-out": "video" },
|
|
23051
|
+
"fade-video": { "video-out": "video" },
|
|
23052
|
+
"transcode-video": { "video-out": "video" },
|
|
23053
|
+
"manual-edit": { "video-out": "video" },
|
|
23054
|
+
"social-media-format": { "media-out": "media", "text-out": "text" },
|
|
23055
|
+
// Telegram Channel Feed: the pip was `out` until it took the platform's
|
|
23056
|
+
// text id (`text`), which its definition and docs always named.
|
|
23057
|
+
"telegram-channel-feed": { out: "text" },
|
|
23058
|
+
// Telegram Trigger: the docs once named six outputs; the component renders
|
|
23059
|
+
// one, `out`, and media rides it by kind on both engines.
|
|
23060
|
+
"telegram-trigger": { text: "out", imageUrl: "out", videoUrl: "out", audioUrl: "out" }
|
|
23061
|
+
};
|
|
23062
|
+
var LEGACY_TARGET_HANDLE_ALIASES = {
|
|
23063
|
+
// Batch 1
|
|
23064
|
+
"text-to-speech": { in: "prompt" },
|
|
23065
|
+
"text-to-audio": { in: "prompt" },
|
|
23066
|
+
"generate-music": { in: "prompt" },
|
|
23067
|
+
"audio-isolation": { in: "audio" },
|
|
23068
|
+
"text-to-dialogue": { in: "prompt" },
|
|
23069
|
+
"voice-changer": { in: "audio" },
|
|
23070
|
+
dubbing: { in: "audio" },
|
|
23071
|
+
// voice-remix / voice-design keep the legacy `audio-style` target id intact
|
|
23072
|
+
// — that name is hard-coded in the runtime hint composers. Only `in` moves.
|
|
23073
|
+
"voice-remix": { in: "audio" },
|
|
23074
|
+
"voice-design": { in: "prompt" },
|
|
23075
|
+
"forced-alignment": { in: "audio" },
|
|
23076
|
+
// Batch 2 — Suno target id normalization
|
|
23077
|
+
"suno-generate": { in: "prompt" },
|
|
23078
|
+
"suno-lyrics": { in: "prompt" },
|
|
23079
|
+
"suno-style-boost": { text: "prompt" },
|
|
23080
|
+
// Batch 3 — Script & Text target id normalization
|
|
23081
|
+
"generate-script": { in: "prompt" },
|
|
23082
|
+
transcribe: { in: "audio" },
|
|
23083
|
+
// Batch 4 — Processing target id normalization (non-ffmpeg only)
|
|
23084
|
+
"combine-text": { in: "text" },
|
|
23085
|
+
"split-text": { in: "text" },
|
|
23086
|
+
"split-media": { "video-in": "video", "audio-in": "audio" },
|
|
23087
|
+
// Phase 20 — Image-producer target id normalization.
|
|
23088
|
+
"face-swap": { in: "video" },
|
|
23089
|
+
// Phase 21 — Video-producer target id normalization.
|
|
23090
|
+
"video-to-video": { in: "video" },
|
|
23091
|
+
"video-upscale": { in: "video" },
|
|
23092
|
+
"extend-video": { in: "video" },
|
|
23093
|
+
"motion-transfer": { in: "video" },
|
|
23094
|
+
"lip-sync": { videoIn: "video" },
|
|
23095
|
+
// Phase 24c — Compositing-stragglers target id normalization.
|
|
23096
|
+
"after-effects": { in: "video" },
|
|
23097
|
+
"motion-graphics": { in: "video" },
|
|
23098
|
+
"lottie-overlay": { in: "video" },
|
|
23099
|
+
// video-composer renders ONE target pip, `in` ("Media"). An earlier table
|
|
23100
|
+
// sent saved edges to a `video` pip the node never had; this heals those.
|
|
23101
|
+
"video-composer": { video: "in" },
|
|
23102
|
+
"render-video": { in: "composition" },
|
|
23103
|
+
"speed-ramp": { in: "video" },
|
|
23104
|
+
"fade-video": { in: "video" },
|
|
23105
|
+
"transcode-video": { in: "video" },
|
|
23106
|
+
// (manual-edit keeps `in` as a multi-asset target.)
|
|
23107
|
+
"social-media-format": { "media-in": "media", "text-in": "text" }
|
|
23108
|
+
};
|
|
23109
|
+
var DYNAMIC_HANDLE_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
23110
|
+
"list",
|
|
23111
|
+
"loop",
|
|
23112
|
+
"group",
|
|
23113
|
+
"collect",
|
|
23114
|
+
"router",
|
|
23115
|
+
"component",
|
|
23116
|
+
"sub-workflow",
|
|
23117
|
+
"sub-workflow-input",
|
|
23118
|
+
"sub-workflow-output",
|
|
23119
|
+
"selector",
|
|
23120
|
+
// Payload parameters become handles.
|
|
23121
|
+
"webhook-trigger",
|
|
23122
|
+
// One `variant:<id>` handle per layer.
|
|
23123
|
+
"image-overlay"
|
|
23124
|
+
]);
|
|
23125
|
+
function canonicalSourceHandle(nodeType, handle) {
|
|
23126
|
+
return nodeType && LEGACY_SOURCE_HANDLE_ALIASES[nodeType]?.[handle] || handle;
|
|
23127
|
+
}
|
|
23128
|
+
function canonicalTargetHandle(nodeType, handle) {
|
|
23129
|
+
return nodeType && LEGACY_TARGET_HANDLE_ALIASES[nodeType]?.[handle] || handle;
|
|
23130
|
+
}
|
|
23131
|
+
var SUNO_IN_CLASSIFIER_TARGETS = /* @__PURE__ */ new Set([
|
|
23132
|
+
"suno-cover",
|
|
23133
|
+
"suno-extend",
|
|
23134
|
+
"suno-replace-section",
|
|
23135
|
+
"suno-upload-extend"
|
|
23136
|
+
]);
|
|
23137
|
+
var SUNO_VOICE_CAPABLE_TARGETS = /* @__PURE__ */ new Set(["suno-generate", "suno-cover", "suno-extend"]);
|
|
23138
|
+
var IMAGE_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
|
|
23139
|
+
"generate-image",
|
|
23140
|
+
"upload-image",
|
|
23141
|
+
"edit-image",
|
|
23142
|
+
"image-to-image",
|
|
23143
|
+
"modify-image",
|
|
23144
|
+
"upscale-image",
|
|
23145
|
+
"remove-background",
|
|
23146
|
+
"generate-mask",
|
|
23147
|
+
"scene"
|
|
23148
|
+
]);
|
|
23149
|
+
var IDENTITY_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
|
|
23150
|
+
"character",
|
|
23151
|
+
"face",
|
|
23152
|
+
"object",
|
|
23153
|
+
"creature",
|
|
23154
|
+
"location"
|
|
23155
|
+
]);
|
|
23156
|
+
var VIDEO_SOURCE_TYPES_FOR_CLASSIFIER = VIDEO_PRODUCER_TYPES;
|
|
23157
|
+
var AUDIO_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([...AUDIO_PRODUCER_TYPES, "youtube-video"]);
|
|
23158
|
+
var DUAL_MODE_REVOICE_TARGETS = /* @__PURE__ */ new Set(["voice-changer", "voice-changer-pro", "dubbing"]);
|
|
23159
|
+
function classifyLegacyTargetHandle(targetType, handle, sourceType, sentHandle = handle) {
|
|
23160
|
+
if (!targetType) return handle;
|
|
23161
|
+
const source = sourceType ?? "";
|
|
23162
|
+
if (source === "suno-voice" && SUNO_VOICE_CAPABLE_TARGETS.has(targetType) && (handle === "in" || handle === "prompt" || handle == null)) {
|
|
23163
|
+
return "voice";
|
|
23164
|
+
}
|
|
23165
|
+
if (SUNO_IN_CLASSIFIER_TARGETS.has(targetType) && (handle === "in" || handle == null)) {
|
|
23166
|
+
return AUDIO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "audio" : "prompt";
|
|
23167
|
+
}
|
|
23168
|
+
if (targetType === "motion-transfer" && handle === "video") {
|
|
23169
|
+
if (IDENTITY_TYPES_FOR_CLASSIFIER.has(source)) return "assets";
|
|
23170
|
+
if (IMAGE_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "image";
|
|
23171
|
+
if (!VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "prompt";
|
|
23172
|
+
return handle;
|
|
23173
|
+
}
|
|
23174
|
+
if ((targetType === "video-to-video" || targetType === "extend-video") && handle === "video" && !VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) {
|
|
23175
|
+
return "prompt";
|
|
23176
|
+
}
|
|
23177
|
+
if (DUAL_MODE_REVOICE_TARGETS.has(targetType) && (sentHandle === "in" || sentHandle == null)) {
|
|
23178
|
+
return VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "video" : "audio";
|
|
23179
|
+
}
|
|
23180
|
+
return handle;
|
|
23181
|
+
}
|
|
23182
|
+
var RENDERED_OUTPUT_HANDLES = {
|
|
23183
|
+
// The ffmpeg family shipped `video-out` / `audio-out` pips through a
|
|
23184
|
+
// different migration (single `in` retained) and was left out of the alias
|
|
23185
|
+
// pass on purpose.
|
|
23186
|
+
"add-captions": ["video-out"],
|
|
23187
|
+
"adjust-volume": ["audio-out", "video-out"],
|
|
23188
|
+
"audio-fx": ["audio-out"],
|
|
23189
|
+
"combine-audio": ["audio-out"],
|
|
23190
|
+
"loop-video": ["video-out"],
|
|
23191
|
+
"merge-video-audio": ["video-out"],
|
|
23192
|
+
"mix-audio": ["audio-out"],
|
|
23193
|
+
"resize-video": ["video-out"],
|
|
23194
|
+
"trim-video": ["video-out"],
|
|
23195
|
+
// Output nodes: a pass-through `out` pip the definition does not declare.
|
|
23196
|
+
"save-to-storage": ["out"],
|
|
23197
|
+
"sub-workflow-output": ["out"],
|
|
23198
|
+
"webhook-output": ["out"],
|
|
23199
|
+
// Stem separator: one declared `audio` output, a pip per stem rendered.
|
|
23200
|
+
"audio-separation": ["bass", "drums", "guitar", "instrumental", "other", "piano", "vocals"],
|
|
23201
|
+
// Dual-mode revoice: the video pip is rendered but undeclared.
|
|
23202
|
+
"voice-changer": ["audio", "video"]
|
|
23203
|
+
};
|
|
23204
|
+
function renderedSourceHandle(nodeType, handle, declaredOutputs) {
|
|
23205
|
+
if (!nodeType || !handle) return null;
|
|
23206
|
+
const rendered = RENDERED_OUTPUT_HANDLES[nodeType];
|
|
23207
|
+
if (!rendered || rendered.includes(handle) || !declaredOutputs?.includes(handle)) return null;
|
|
23208
|
+
if (rendered.includes(`${handle}-out`)) return `${handle}-out`;
|
|
23209
|
+
return rendered.length === 1 ? rendered[0] : null;
|
|
23210
|
+
}
|
|
23211
|
+
|
|
23212
|
+
// src/telegram-channel.ts
|
|
23213
|
+
var TELEGRAM_FEED_LIMIT_MAX = 30;
|
|
23214
|
+
var TELEGRAM_FEED_PEEK_MAX = 20;
|
|
23215
|
+
var TELEGRAM_FEED_PAGE_SIZE = 20;
|
|
23216
|
+
var TELEGRAM_FEED_DEFAULT_LIMIT = 5;
|
|
23217
|
+
var TELEGRAM_FEED_DIGEST_SEPARATOR = "\n\n---\n\n";
|
|
23218
|
+
function telegramFeedDigest(posts) {
|
|
23219
|
+
return posts.map((p) => p.text).filter((t2) => typeof t2 === "string" && t2.trim().length > 0).join(TELEGRAM_FEED_DIGEST_SEPARATOR);
|
|
23220
|
+
}
|
|
23221
|
+
var isRecord5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
23222
|
+
var str6 = (v) => typeof v === "string" ? v : void 0;
|
|
23223
|
+
function telegramPostsFrom(value) {
|
|
23224
|
+
if (!Array.isArray(value)) return [];
|
|
23225
|
+
const out = [];
|
|
23226
|
+
for (const item of value) {
|
|
23227
|
+
if (!isRecord5(item) || typeof item.id !== "number" || !Number.isFinite(item.id) || typeof item.text !== "string") continue;
|
|
23228
|
+
const media = Array.isArray(item.media) ? item.media.filter((m) => isRecord5(m) && (m.type === "photo" || m.type === "video")) : [];
|
|
23229
|
+
const forwarded = isRecord5(item.forwardedFrom) && typeof item.forwardedFrom.name === "string" ? { name: item.forwardedFrom.name, ...str6(item.forwardedFrom.url) ? { url: item.forwardedFrom.url } : {} } : void 0;
|
|
23230
|
+
const channel2 = str6(item.channel) ?? "";
|
|
23231
|
+
out.push({
|
|
23232
|
+
id: item.id,
|
|
23233
|
+
channel: channel2,
|
|
23234
|
+
postUrl: str6(item.postUrl) ?? str6(item.url) ?? (channel2 ? `https://t.me/${channel2}/${item.id}` : ""),
|
|
23235
|
+
text: item.text,
|
|
23236
|
+
...str6(item.date) ? { date: item.date } : {},
|
|
23237
|
+
...forwarded ? { forwardedFrom: forwarded } : {},
|
|
23238
|
+
media,
|
|
23239
|
+
...str6(item.imageUrl) ? { imageUrl: item.imageUrl } : {},
|
|
23240
|
+
...str6(item.views) ? { views: item.views } : {}
|
|
23241
|
+
});
|
|
23242
|
+
}
|
|
23243
|
+
return out;
|
|
23244
|
+
}
|
|
23245
|
+
function planFeedEmission(posts, since, limit, pageMaxId) {
|
|
23246
|
+
const cap = Math.max(1, Math.min(TELEGRAM_FEED_LIMIT_MAX, Math.floor(Number.isFinite(limit) ? limit : TELEGRAM_FEED_DEFAULT_LIMIT) || 1));
|
|
23247
|
+
const byId = /* @__PURE__ */ new Map();
|
|
23248
|
+
for (const post of posts) byId.set(post.id, post);
|
|
23249
|
+
const sorted = [...byId.values()].sort((a, b) => a.id - b.id);
|
|
23250
|
+
if (since === void 0) {
|
|
23251
|
+
const emitted2 = sorted.slice(-cap);
|
|
23252
|
+
return { emitted: emitted2, latestId: sorted.length > 0 ? sorted[sorted.length - 1].id : void 0 };
|
|
23253
|
+
}
|
|
23254
|
+
const fresh = sorted.filter((p) => p.id > since);
|
|
23255
|
+
const emitted = fresh.slice(0, cap);
|
|
23256
|
+
if (emitted.length > 0) return { emitted, latestId: emitted[emitted.length - 1].id };
|
|
23257
|
+
const pastUnreadable = pageMaxId !== void 0 && Number.isFinite(pageMaxId) && pageMaxId > since;
|
|
23258
|
+
return { emitted, latestId: pastUnreadable ? pageMaxId : since };
|
|
23259
|
+
}
|
|
23260
|
+
|
|
23261
|
+
// src/ugc-run-state.ts
|
|
23262
|
+
var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"]);
|
|
23263
|
+
var UGC_NODE_RUN_STATE_KEYS = {
|
|
23264
|
+
"ugc-creator": ["result", "keepResult", "ugcOutputs"],
|
|
23265
|
+
"ugc-script": ["result", "keepResult", "ugcOutputs"],
|
|
23266
|
+
"ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
|
|
23267
|
+
"ugc-clip": ["warnings", "rerender", "__listResults", "__listResultMeta", "clipWarnings", "durationSec", "ugcOutputs"],
|
|
23268
|
+
"ugc-cards": ["result", "ugcOutputs"]
|
|
23269
|
+
};
|
|
23270
|
+
var UGC_OVERRIDABLE_FIELDS = {
|
|
23271
|
+
"ugc-creator": ["source", "gender", "photoUrl"],
|
|
23272
|
+
"ugc-script": ["targetDurationSec"],
|
|
23273
|
+
"ugc-clips": [],
|
|
23274
|
+
"ugc-clip": [],
|
|
23275
|
+
"ugc-cards": []
|
|
23276
|
+
};
|
|
23277
|
+
var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
|
|
23278
|
+
function stripUgcRunState(nodes) {
|
|
23279
|
+
return nodes.map((node) => {
|
|
23280
|
+
const type = typeof node.type === "string" ? node.type : "";
|
|
23281
|
+
if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
|
|
23282
|
+
const data = { ...node.data };
|
|
23283
|
+
for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
|
|
23284
|
+
if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
|
|
23285
|
+
return { ...node, data };
|
|
23286
|
+
});
|
|
23287
|
+
}
|
|
23288
|
+
function findUgcLockedFields(nodes, inputOverrides) {
|
|
23289
|
+
if (!nodes || !inputOverrides) return [];
|
|
23290
|
+
const found = [];
|
|
23291
|
+
for (const node of nodes) {
|
|
23292
|
+
const type = node?.type;
|
|
23293
|
+
if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
|
|
23294
|
+
const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
|
|
23295
|
+
const fields = inputOverrides[node.id];
|
|
23296
|
+
if (!fields || typeof fields !== "object") continue;
|
|
23297
|
+
for (const field of Object.keys(fields)) {
|
|
23298
|
+
if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
|
|
23299
|
+
}
|
|
23300
|
+
}
|
|
23301
|
+
return found;
|
|
23302
|
+
}
|
|
23303
|
+
|
|
23304
|
+
// src/ugc-call-body.ts
|
|
23305
|
+
var pick = (a, from, to) => a[from] !== void 0 && a[from] !== null ? { [to]: a[from] } : {};
|
|
23306
|
+
function llmFields(a) {
|
|
23307
|
+
return {
|
|
23308
|
+
...pick(a, "llmModel", "llmModel"),
|
|
23309
|
+
...pick(a, "reasoning_effort", "reasoningEffort"),
|
|
23310
|
+
...a.advanced_mode === true ? { advancedMode: true } : {},
|
|
23311
|
+
...pick(a, "temperature", "temperature"),
|
|
23312
|
+
...pick(a, "max_tokens", "maxTokens")
|
|
23313
|
+
};
|
|
23314
|
+
}
|
|
23315
|
+
function ugcCallToRouteBody(call, opts = {}) {
|
|
23316
|
+
const args = { ...call.args };
|
|
23317
|
+
if (call.imageArg) {
|
|
23318
|
+
if (!opts.image) return { error: `${call.tool} needs the previous step's image` };
|
|
23319
|
+
args[call.imageArg] = opts.image;
|
|
23320
|
+
}
|
|
23321
|
+
switch (call.tool) {
|
|
23322
|
+
case "generate_image":
|
|
23323
|
+
return {
|
|
23324
|
+
path: "/v1/generate-image",
|
|
23325
|
+
body: {
|
|
23326
|
+
...pick(args, "prompt", "prompt"),
|
|
23327
|
+
...pick(args, "model", "provider"),
|
|
23328
|
+
...pick(args, "aspect_ratio", "aspectRatio"),
|
|
23329
|
+
...pick(args, "resolution", "resolution"),
|
|
23330
|
+
...pick(args, "quality", "quality"),
|
|
23331
|
+
...pick(args, "negative_prompt", "negativePrompt")
|
|
23332
|
+
}
|
|
23333
|
+
};
|
|
23334
|
+
case "image_to_image":
|
|
23335
|
+
return {
|
|
23336
|
+
path: "/v1/image-to-image",
|
|
23337
|
+
body: {
|
|
23338
|
+
...pick(args, "image_url", "imageUrl"),
|
|
23339
|
+
...pick(args, "prompt", "prompt"),
|
|
23340
|
+
...pick(args, "model", "provider"),
|
|
23341
|
+
...pick(args, "resolution", "resolution"),
|
|
23342
|
+
...pick(args, "quality", "quality"),
|
|
23343
|
+
...pick(args, "strength", "strength"),
|
|
23344
|
+
...pick(args, "aspect_ratio", "aspectRatio"),
|
|
23345
|
+
...pick(args, "negative_prompt", "negativePrompt"),
|
|
23346
|
+
...pick(args, "seed", "seed")
|
|
23347
|
+
}
|
|
23348
|
+
};
|
|
23349
|
+
case "image_to_text": {
|
|
23350
|
+
const image = opts.image ?? (typeof args.image_url === "string" ? args.image_url : void 0);
|
|
23351
|
+
if (!image) return { error: "image_to_text needs an image" };
|
|
23352
|
+
return {
|
|
23353
|
+
path: "/v1/image-to-text/describe",
|
|
23354
|
+
body: {
|
|
23355
|
+
imageUrl: image,
|
|
23356
|
+
...pick(args, "detail_level", "detailLevel"),
|
|
23357
|
+
...pick(args, "custom_prompt", "customPrompt"),
|
|
23358
|
+
...llmFields(args)
|
|
23359
|
+
}
|
|
23360
|
+
};
|
|
23361
|
+
}
|
|
23362
|
+
default:
|
|
23363
|
+
return void 0;
|
|
23364
|
+
}
|
|
23365
|
+
}
|
|
23366
|
+
|
|
23367
|
+
export { ACCESS_LEVELS, ACTION_CARD_KINDS, ACTIVE_SCENE_HELPERS, ADVANCED_MODE_UNAVAILABLE_REASON, ADVICE_FAMILIES, AGGREGATEABLE_TYPES, AGGREGATE_LANE_SOURCE_TYPES, AI_AVATAR_DURATION_BUCKETS, AI_AVATAR_MAX_AUDIO_SEC, AI_AVATAR_MAX_DURATION_SEC, AI_AVATAR_RESERVE_IDS, AI_WRITER_PROVIDERS, ALA_CARTE_BOARDS, ALL_CAPTION_STYLES, ANIMALS, ANIMAL_SUBCATEGORY_LABELS, ANIMAL_SUBCATEGORY_ORDER, ANIMATE_SUB_GATES, ASPECT_RATIO_DIMENSIONS, AUDIO_ADDON_PROVIDERS, AUDIO_CROSSFADE_CURVES, AUDIO_CROSSFADE_CURVE_IDS, AUDIO_FX_PRESETS, AUDIO_FX_PRESET_LABELS, AUDIO_FX_PRESET_SET, AUDIO_FX_REVERB_PRESETS, AUDIO_PRODUCER_TYPES, AUDIO_SYNC_MIN_CONFIDENCE, AddBRollResultSchema, AnchorSceneStyleResultSchema, AnimateSubGateSchema, AssetRefSchema, AuditImagesResultSchema, AuditImagesShotEntrySchema, AuditPromptIssueSchema, AuditPromptResultSchema, AvatarPayloadError, BOARD_TO_ASSET_TYPE, BOARD_TO_COLUMN, BOARD_VARIANTS, BRAND_LESSON_KINDS, BridgeToNextSceneInputSchema, BridgeToNextSceneResultSchema, CAMERA_SWITCH_BOUNDS, CAMERA_SWITCH_CREDIT_ID, CAMERA_SWITCH_DEFAULTS, CAMERA_SWITCH_NAME_MAX, CAPTION_LEVER_BOUNDS, CAPTION_LOOKS, CAPTION_LOOK_IDS, CAPTION_MAX_WORDS_PER_LINE_MAX, CAPTION_MAX_WORDS_PER_LINE_MIN, CAPTION_SEGMENT_SCHEMA_KEYS, CARD_OUTCOME_STATES, CATEGORY_DURATION_DEFAULTS, CHARACTER_ASPECT_DEFAULTS, CHARACTER_ASPECT_OPTIONS, CHARACTER_ASSET_TYPES, CHARACTER_ASSET_VARIANTS, CHARACTER_ATTACH_COLUMNS, CHARACTER_FACETS, CHARACTER_FACET_IDS, CHARACTER_LORA_TRAINING_JOB_TYPE, CHARACTER_MOTION_PROVIDERS, CHARACTER_PICKER_DISPLAY_ORDER, CHARACTER_REFERENCE_PHOTO_KINDS, CHARACTER_STYLES, CHARACTER_VARIANT_ASSET_BUCKETS, CHAT_ENABLED_STAGES, CHAT_STAGES, CHAT_TURN_CAPS, CHAT_WIRED_STAGES, CINEMATIC_DEFAULT_DURATION_SEC, CINEMATIC_DEFAULT_RESOLUTION, CINEMATIC_MAX_DURATION_SEC, CINEMATIC_MAX_LOOKS, CINEMATIC_MAX_REFERENCE_IMAGES, CINEMATIC_MAX_REFERENCE_VIDEOS, CINEMATIC_MIN_DURATION_SEC, CINEMATIC_MIN_LOOKS, CINEMATIC_PROMPT_MAX, CINEMATIC_RESERVE_IDS, COLLABORATOR_ROLES, COLLECTIONS_PAGE_DEFAULT, COLLECTIONS_PAGE_MAX, COLLECTION_DEDUPE_KEY_MAX, COLLECTION_DESCRIPTION_MAX, COLLECTION_DIGEST_SEPARATOR, COLLECTION_EVICT_MAX_PER_WRITE, COLLECTION_HEADLINE_MAX, COLLECTION_IDEMPOTENCY_KEY_MAX, COLLECTION_MEDIA_TYPES, COLLECTION_NAME_MAX, COLLECTION_READ_LIMIT_MAX, COLLECTION_READ_WINDOW_HOURS_MAX, COLLECTION_RECORD_FIELDS_BYTES_MAX, COLLECTION_RECORD_FIELDS_MAX, COLLECTION_RECORD_MEDIA_MAX, COLLECTION_RECORD_TEXT_MAX, COLLECTION_RECORD_TITLE_MAX, COLLECTION_RECORD_URL_MAX, COLLECTION_TIER_CAPS, COLLECT_IN_HANDLE, COMBINE_TRANSITIONS, COMBINE_TRANSITION_GROUP_LABELS, COMBINE_TRANSITION_GROUP_ORDER, COMBINE_TRANSITION_IDS, COMPETITORS_MAX, COMPETITOR_ABOUT_PLATFORMS, COMPETITOR_ACCOUNT_KEYS, COMPETITOR_DEFAULT_ABOUT_PLATFORMS, COMPETITOR_SCAN_CREDIT_COSTS, COMPETITOR_SCAN_MAX_SEARCHES, COMPETITOR_SCAN_NODE_TYPE, COMPETITOR_SCHEDULES, COMPOSER_PLAN_FIELDS, COMPOSER_PLAN_MAP, CONTENT_IDEAS_BRAND_MAX, CONTENT_IDEAS_DEFAULT_COUNT, CONTENT_IDEAS_LANGUAGE_MAX, CONTENT_IDEAS_MAX_COUNT, CONTENT_IDEAS_MAX_RECIPE_INPUTS, CONTENT_IDEAS_PER_CHARGE, CONTENT_RECIPE_IDEAS_CREDIT_IDS, CONTENT_RECIPE_SOURCE_MAX, CONTENT_TYPES_BY_PLATFORM, CONTINUATION_NOT_COMPLETED, CONTINUATION_NOT_FOUND, CONTINUATION_SUBSET_REQUIRED, CONTINUATION_VERSION_MISMATCH, CONTINUATION_WORKFLOW_MISMATCH, CREATURE_ATTACH_COLUMNS, CREDIT_BASE_USD, CREDIT_ROUNDING_RESOLUTION, CastCoverageCriticVerdictSchema, CharacterImageCriticVerdictSchema, CharacterMetadataSchema, ChatTurnResponseSchema, CriticIssueSchema, DEFAULT_AUDIO_CROSSFADE_CURVE_ID, DEFAULT_CAPTION_LOOK, DEFAULT_CARRIED_FRACTION, DEFAULT_CHARACTER_ANGLE_COUNT, DEFAULT_CHARACTER_EXPRESSION_COUNT, DEFAULT_CHARACTER_FACET, DEFAULT_DIALOGUE_PROVIDER, DEFAULT_FRAME_DELIVERY, DEFAULT_FRAME_FIT, DEFAULT_LABEL_BY_SOURCE, DEFAULT_LOCATION_USAGE_MODE, DEFAULT_MUSIC_PROVIDER, DEFAULT_OVERLAY_QR, DEFAULT_OVERLAY_SHAPE, DEFAULT_OVERLAY_TEXT, DEFAULT_PANEL_COUNT, DEFAULT_REF_IMAGE_MAX, DEFAULT_SECTIONS, DEFAULT_SUBTITLE_LOOK, DEFAULT_SUNO_MODEL, DEFAULT_TEMPLATE_CATEGORY, DEFAULT_TEXT_TO_AUDIO_PROVIDER, DEFAULT_TRANSCRIBE_NODE_PROVIDER, DEFAULT_TRANSCRIBE_PROVIDER, DEFAULT_TTS_PROVIDER, DEFAULT_USAGE_MODE, DEFAULT_VIDEO_ANALYSIS_MODEL, DEFAULT_VIDEO_ANALYSIS_TIER, DEFAULT_VIDEO_CLIP_COST, DEFAULT_VIDEO_DURATION_SEC, DEFAULT_VIDEO_OVERLAY_LAYER, DEFAULT_VIDEO_PROVIDER, DEFAULT_VOICE_CHANGER_MODEL, DEFAULT_VOICE_DESIGN_MODEL, DETAIL_VARIANTS, DIALOGUE_PROVIDERS, DURATION_PRICED_PROVIDERS, DYNAMIC_HANDLE_NODE_TYPES, DYNAMIC_PRODUCER_TYPES, DetectionResultSchema, EDITED_EDL_VERSION, EDIT_PLAN_BASE_CREDIT_ID, EDIT_PLAN_BUCKET_MINUTES, EDIT_PLAN_DEFAULT_CLIP_COUNT, EDIT_PLAN_MAX_CLIP_COUNT, EDIT_PLAN_MAX_MINUTES, EDIT_PLAN_MODES, EDIT_PLAN_TIERS, EDL_FULL_FRAME, EDL_SOURCE_ROLES, EDL_TARGET_ASPECTS, EDL_VERSION, EFFORT_TIER_BUMP, EMOTIONAL_BEAT, ENTITY_ASPECT_DEFAULTS, ENTITY_BUCKET_FIELDS, ENTITY_DB_ID_FIELD, ENTITY_IMAGE_HANDLE_TYPES, ENTITY_KIND_SCALAR_FIELDS, ENTITY_NAME_FIELD, ENTITY_NODE_KINDS, ENTITY_SCALAR_FIELDS, ENTITY_SECTIONS, ENTITY_STATUSES, ENTITY_TABLE, ENTITY_TOOL_RETRY_CAP, ENTITY_TYPES, EXECUTION_DATA_KEYS, EXECUTION_GRAPH_COMPOSED_PARAMETER_TYPES, EXTEND_VIDEO_PROVIDERS, EntityMetadataSchema, EntityRejectInputSchema, EntityStaleEventSchema, EntityStateChangeEventSchema, FACE_SWAP_PROVIDERS, FAL_LIP_SYNC_PROVIDERS, FAN_IN_TARGETS, FAN_OUT_ALL_OR_NOTHING_TYPES, FAN_OUT_EACH_HANDLES, FAN_OUT_EACH_TYPES, FEATURED_ENTITIES, FILM_BASE_CREDITS, FLEXIBLE_INPUT_LIP_SYNC_PROVIDERS, FLUX2_RES_MP, FLUX_LORA_CHARACTER_MODEL_ID, FRAME_DELIVERIES, FRAME_DELIVERY_BY_PROVIDER, FRAME_FITS, FRAME_FIT_STRETCH_TOLERANCE, FRAME_MODE_ADAPTIVE_ONLY_ASPECT, FRAME_TARGET_HANDLES, FREECUT_EXPORT_COMPLETE, FREECUT_EXPORT_PROGRESS, FREECUT_READY, FREECUT_REQUEST_IMPORT, FURNITURE, FURNITURE_SUBCATEGORY_LABELS, FURNITURE_SUBCATEGORY_ORDER, FixContinuityInputSchema, FixContinuityResultSchema, GEMINI_OMNI_PROVIDERS, GEMINI_OMNI_VOICE_PRESETS, GEMINI_OMNI_VOICE_PRESET_IDS, GENERATE_TEXT_DELIMITER, GLOBAL_MAX_DURATION_SECONDS, GRANTED_ACCESS, GROUP_HANDLE_PREFIX, GUIDANCE_SCALE_SUPPORT, GVP_ANCHOR_CHOICES, GVP_DEFAULT_PROVIDER, GVP_END_FRAME_PROVIDERS, GVP_EXTEND_PROVIDERS, GVP_SUPPORTED_PROVIDERS, GenerateMotionInputSchema, GenerateMotionResultSchema, HANDLE_PORT_SEPARATOR, HELPERS_SHIPPED_IN_1B3, HIGH_QUALITY_PROVIDERS, HINT_EXEMPT_PARAMETER_TYPES, I2I_MASK_SUPPORT, I2I_STRENGTH_SUPPORT, IDEOGRAM_PROVIDERS, IMAGE_ASPECT_RATIO_VALUES, IMAGE_CRITIC_LEAF_MODES, IMAGE_CRITIC_MAX_RETRIES, IMAGE_CRITIC_METADATA_KEYS, IMAGE_CRITIC_MIN_ADHERENCE_SCORE, IMAGE_CRITIC_MODES, IMAGE_CRITIC_UNRESOLVABLE, IMAGE_EDIT_PROVIDERS, IMAGE_GEN_PROVIDERS, IMAGE_I2I_PROVIDERS, IMAGE_MASK_MODE, IMAGE_OVERLAY_BASE_CREDITS, IMAGE_OVERLAY_VARIANT_CREDITS, IMAGE_PRODUCER_TYPES, IMAGE_PROMPT_MAX, IMAGE_REF_TYPES, IMAGE_TO_VIDEO_PROVIDERS, INPUT_FIELD_EXTRA_KEYS, INPUT_FIELD_MAP2 as INPUT_FIELD_MAP, INPUT_NODE_TYPES, INSTAGRAM_ANALYSIS_CREDIT_ID, INSTAGRAM_CAROUSEL_MAX_ITEMS, INSTAGRAM_CAROUSEL_MIN_ITEMS, INSTAGRAM_HOSTS, INSTAGRAM_SCRAPE_CREDIT_COSTS, INSTAGRAM_SCRAPE_DEFAULT_COUNT, INSTAGRAM_SCRAPE_FALLBACK_CREDIT_ID, INSTAGRAM_SCRAPE_MAX_COUNT, INSTAGRAM_SCRAPE_MAX_SOURCES, INSTAGRAM_SCRAPE_MAX_TARGET_LENGTH, INSTAGRAM_SCRAPE_MODES, INSTAGRAM_SCRAPE_NODE_TYPE, INSTAGRAM_SCRAPE_PERIODS, INSTAGRAM_SCRAPE_TIERS, ITER_CLONE_PATTERN, ImageCriticIssueSchema, ImageCriticResultSchema, ImageCriticVerdictSchema, ImprovePromptInputSchema, ImprovePromptResultSchema, KEYFRAME_CREDITS_PER_SHOT, KINETIC_CAPTION_STYLES, KINETIC_ONLY_CAPTION_LEVER_KEYS, LANGUAGES, LEGACY_EXPOSED_FIELD_KEYS, LEGACY_LOTTIE_HOST_REMAP, LEGACY_SOURCE_HANDLE_ALIASES, LEGACY_TARGET_HANDLE_ALIASES, LEGACY_TEMPLATE_CATEGORIES, LIP_SYNC_DURATION_BUCKETS, LIP_SYNC_MAX_AUDIO_SECONDS, LIP_SYNC_PROVIDERS, LLM_FEATURE_DEFAULTS, LLM_MODALITY_CAPS, LLM_MODELS, LLM_MODEL_IDS, LLM_REASONING_EFFORTS, LLM_ROUTE_DEFAULTS, LLM_TEXT_INPUT_MAX, LLM_VENDOR_LABELS, LLM_VENDOR_ORDER, LOCATION_ASSET_TYPES, LOCATION_ASSET_VARIANTS, LOCATION_ATMOSPHERE_PROVIDERS, LOCATION_ATTACH_COLUMNS, LOCATION_BUCKET_TO_CATALOG_ID, LOCATION_PRESET_TO_CATALOG, LOCATION_REFERENCE_PHOTO_KINDS, LOCATION_REFERENCE_PHOTO_KIND_LABELS, LOCATION_USAGE_MODES, LOTTIE_OVERLAY_CATALOG, LOTTIE_SLOT_FIELD_PREFIX, LTX_EXTEND_DURATION, LTX_EXTEND_PER_SECOND_CREDIT_ID, LTX_RETAKE_MIN_DURATION_SEC, LTX_RETAKE_PER_SECOND_CREDIT_ID, LocationImageCriticVerdictSchema, LocationMetadataSchema, LocationsCoverageCriticIssueSchema, LocationsCoverageCriticVerdictSchema, MATCH_CUT_BREAK_GATE, MAX_CUSTOM_ENTRIES_PER_BOARD, MAX_IMAGE_PROMPT_CHARS_BY_PROVIDER, MAX_LOCATION_VARIANTS, MAX_NEGATIVE_PROMPT_CHARS_BY_PROVIDER, MAX_PANELS_PER_SHEET, MAX_TTS_CHARS_BY_PROVIDER, MAX_VIDEO_PROMPT_CHARS_BY_PROVIDER, MEMBER_STATUSES, META_ADS_ADVERTISER_MAX_RESULTS, META_ADS_ANALYSIS_CREDITS_PER_AD, META_ADS_ANALYSIS_CREDIT_ID, META_ADS_ANALYSIS_FOCUS_MAX, META_ADS_ANALYSIS_TIERS, META_ADS_FORMATS, META_ADS_NODE_MODES, META_ADS_PLATFORMS, META_ADS_SCRAPE_COUNT_OPTIONS, META_ADS_SCRAPE_CREDIT_COSTS, META_ADS_SCRAPE_DEFAULT_COUNT, META_ADS_SCRAPE_DEFAULT_COUNTRY, META_ADS_SCRAPE_FALLBACK_CREDIT_ID, META_ADS_SCRAPE_MAX_COUNT, META_ADS_SCRAPE_MAX_QUERY_LENGTH, META_ADS_SCRAPE_MAX_SOURCES, META_ADS_SCRAPE_MODES, META_ADS_SCRAPE_NODE_TYPE, META_ADS_SCRAPE_PERIODS, META_ADS_SCRAPE_STATUSES, META_ADS_SCRAPE_TIERS, MINIMAX_H3_DEFAULT_RESOLUTION, MINIMAX_H3_PROVIDERS, MODELS_WITH_REFERENCE_IMAGE_SUPPORT, MODEL_CATALOG, MODEL_KINDS, MODEL_PARAM_NODE_TYPES, MODEL_RECOMMENDATIONS, MODIFY_IMAGE_PROVIDERS, MOTION_COLUMN, MOTION_TRANSFER_PROVIDERS, MUSIC_CREDIT_ID, MUSIC_PROVIDERS, MUSIC_PROVIDER_LABELS, MatchCutVerdictSchema, NATIVE_ADAPTIVE_ASPECT, NATIVE_NEGATIVE_PROMPT_MODELS, NATIVE_NEGATIVE_VIDEO_PROVIDERS, NEGATIVE_PROMPT_MAX, NODARO_IMPORT_FILES, NODARO_LOAD_TIMELINE, NODARO_LOAD_VIDEO, NODARO_RESET_PROJECT, NODE_DEFAULT_TYPES, NODE_MAPPABLE_FIELDS, NODE_PRESET_EXPORT_KIND, NODE_REF_PATTERN, NON_EN_LOCALE_IDS, NON_PROMPT_TEXT_LANES, NO_SAVED_RENDER_STAMPS, NO_SPLIT_DELIMITER, OAUTH_SCOPES, OBJECT_ASPECT_DEFAULTS, OBJECT_ASPECT_OPTIONS, OBJECT_ASSET_TYPES, OBJECT_ASSET_VARIANTS, OBJECT_ATTACH_COLUMNS, OBJECT_MOTION_PROVIDERS, OBJECT_PICKER_NODE_TYPES, ORG_ERROR_CODES, ORG_KINDS, ORG_ROLES, ORG_STATUSES, OUTPUT_BEARING_NODE_STATUSES, OUTPUT_FIELD_MAP, OUTPUT_FORMATS, OVERLAY_ANCHORS, OVERLAY_FONTS, OVERLAY_FONT_IDS, OVERLAY_IMAGE_MASKS, OVERLAY_LAYER_KINDS, OVERLAY_MAX_VARIANTS, OVERLAY_PLATFORMS, OVERLAY_PLATFORM_IDS, OVERLAY_SHAPES, OVERLAY_TEXT_ALIGNS, OVERLAY_VARIANT_HANDLE_PREFIX, OWNER_ONLY_LISTING_RENDER_TYPES, OWN_LIST_NODE_TYPES, ObjectMetadataSchema, OptimizeForModelInputSchema, OptimizeForModelResultSchema, OrgSettingsSchema, PARAMETER_NODE_TYPES, PASSTHROUGH_TYPES, PAYG_RETENTION_DAYS, PER_FORMAT_DURATION_BOUNDS, PICKER_TO_COMBINE_TRANSITION, PIPELINE_ACTIVATION_MODES, PIPELINE_FORMATS, PIPELINE_HARD_TIMEOUT_MS, PIPELINE_MODEL_STAGES, PIPELINE_MODES, PIPELINE_OUTPUT_RESOLUTIONS, PIPELINE_PINNABLE_IMAGE_MODELS, PIPELINE_PINNABLE_SCRIPT_LLMS, PIPELINE_PINNABLE_VIDEO_MODELS, PIPELINE_STAGE_NAMES, PIPELINE_STAGE_TIMEOUT_MS, PIPELINE_TYPES, PLACEHOLDER_CHARACTER_NAME, PLATFORM_LABELS, PLATFORM_SPECS, PRESET_APPLY_CLEAR_KEYS, PRESET_EXCLUDED_KEYS, PRESET_LABELS, PRESET_LEVER_GROUPS, PRESET_SETTING_KEYS, PREVIEW_RENDER_NESTED, PREVIEW_RENDER_NODE_TYPES, PREVIEW_REVIEW_REQUIRED, PRICING_DEFAULT_DURATION_SEC, PRICING_DEFAULT_RESOLUTION, PRO3D_RENDER_ASPECT_RATIOS, PRO3D_RENDER_CREDIT_ID, PRO3D_RENDER_DEFAULT_ENGINE, PRO3D_RENDER_DEFAULT_QUALITY, PRO3D_RENDER_DEFAULT_REPAIR_PASSES, PRO3D_RENDER_DEFAULT_STYLE, PRO3D_RENDER_ENGINES, PRO3D_RENDER_LABEL, PRO3D_RENDER_LIMITS, PRO3D_RENDER_MAX_REPAIR_PASSES, PRO3D_RENDER_MIN_REPAIR_PASSES, PRO3D_RENDER_NODE_TYPE, PRO3D_RENDER_PROMPT_MAX, PRO3D_RENDER_QUALITY_PROFILES, PRO3D_RENDER_SOURCE_KINDS, PRO3D_RENDER_STYLES, PROJECTED_TRIGGER_NODE_TYPES, PROMPT_HARD_CEILING, PROMPT_PREFIX_KEY, PROMPT_SUFFIX_KEY, PROVIDER_DIRECTIVE_DEFAULTS, PROVIDER_PLACEHOLDER_PREFIX, PipelineCompletedEventSchema, PipelineConfigSchema, PipelineDriftSummarySchema, PipelineEditorDecisionsReadyEventSchema, PipelineForkedEventSchema, PipelineInputSchema, PipelineMusicReadyEventSchema, PipelineStageNameSchema, PipelineStageStatusSchema, PipelineStateSchema, PipelineStatusSchema, PresetSettingsSchema, QA_CHECK_PROVIDERS, REASONING_OUTPUT_FLOOR, RECAST_SEGMENT_PACKS, REDUCE_STRATEGIES, REDUCE_STRATEGY_IDS, REFERENCE_BOARD_PROVIDERS, REFERENCE_BOARD_TEMPLATES, REFERENCE_HANDLE_MAP, REFERENCE_ROLE_PRESETS, REF_HANDLE_CATEGORY, REF_IMAGE_MAX_LIMITS, REF_TOKEN_NAMESPACE_PREFIXES, RENDERED_OUTPUT_HANDLES, RENDERING_SPEED_SUPPORT, RENDER_FINAL_CODES, RENDER_FINAL_NODE_NOT_FOUND, RENDER_FINAL_NOT_A_RENDER, RENDER_NODE_TYPES, RENDER_NODE_TYPE_IDS, RENDER_VIDEO_CREDIT_ID, REPEATABLE_NODE_TYPES, REPEAT_PLACEHOLDER, REPLICATE_LIP_SYNC_PROVIDERS, RESERVED_TEMPLATE_VARS, RUN_CONTINUATION_CODES, RUN_OVERRIDE_CLEARED_FIELDS, SAVED_POSTS_LOOKUP_MAX, SAVED_POSTS_PAGE_MAX, SAVED_POST_MAX_TAGS, SAVED_POST_NOTE_MAX, SAVED_POST_SOURCES, SAVED_POST_TAG_MAX, SAVED_RENDER_STAMPS, SCENE3D_ASSERTION_RESTORED_CODE, SCENE3D_ASSET_KINDS, SCENE3D_ASSET_ROLES, SCENE3D_ASSET_ROLE_KINDS, SCENE3D_AUTHORING_ASSUMPTION_CODE, SCENE3D_AUTHORING_ENGINES, SCENE3D_BASIC_ENGINE, SCENE3D_BASIC_SCHEMA_VERSION, SCENE3D_CAMERA_TRACK_FORMAT, SCENE3D_CAMERA_TRACK_LIMITS, SCENE3D_CAMERA_TRACK_VERSION, SCENE3D_CLAY_LIGHTING_PRESETS, SCENE3D_DEFAULT_ADVANCED_ENGINE, SCENE3D_DEFAULT_DURATION_SECONDS, SCENE3D_DEFAULT_ENTITY_CAPABILITIES, SCENE3D_DEFAULT_FPS, SCENE3D_EDIT_NODE_TYPE, SCENE3D_ENTITY_CAPABILITIES, SCENE3D_ENTITY_ROLES, SCENE3D_GENERATE_NODE_TYPE, SCENE3D_GLB_EXTRAS_ALLOWLIST, SCENE3D_GLB_EXTRAS_ENTITY_ID, SCENE3D_GLB_EXTRAS_MATERIAL_ROLE, SCENE3D_GLB_EXTRAS_SUBPART_ID, SCENE3D_LIMITS, SCENE3D_PLAN_FIELD, SCENE3D_PLAN_TYPE, SCENE3D_PRIMITIVES, SCENE3D_PRIMITIVE_MATERIAL_ROLE, SCENE3D_REMEDY_AUTO_APPLIED_CODE, SCENE3D_RENDERER_ASSET_KINDS, SCENE3D_RENDER_BASE_MAX_PX, SCENE3D_RENDER_TIERS, SCENE3D_RENDER_TIER_MULTIPLIERS, SCENE3D_RENDER_XLARGE_MIN_AREA_PX, SCENE3D_REVIEW_REFUSED_CODE, SCENE3D_REVIEW_UNAVAILABLE_CODE, SCENE3D_REVIEW_UNAVAILABLE_REASONS, SCENE3D_SCHEMA_VERSION, SCENE3D_SCHEMA_VERSION_V2, SCENE3D_SUPPORTED_SCHEMA_VERSIONS, SCENE3D_V2_CONTENT_HASH_EXCLUDED, SCENE3D_V2_ENGINES, SCENE3D_V2_LIMITS, SCENE3D_V2_OVERRIDE_OPERATION_VERSION, SCENE3D_V2_PRIMITIVES, SCENE_HELPER_NAMES, SCHEDULE_EVERY_LIMITS, SCHEDULE_RULE_KINDS, SCHEDULE_TRIGGER_NODE_TYPE, SCRAPER_ACTOR_LABELS, SCRAPER_CREDIT_COSTS, SCRAPER_OUTPUT_FIELDS, SCRIPT_PROVIDERS, SCRIPT_SCENE_COUNT_DEFAULT, SCRIPT_SCENE_COUNT_RANGE, SCRIPT_STYLE_GUIDE_MAX_LENGTH, SCRIPT_TARGET_DURATION_DEFAULT, SCRIPT_TARGET_DURATION_RANGE, SCRIPT_TONE_MAX_LENGTH, SEASONS, SECTION_BOARD, SECTION_KINDS, SEEDANCE_2_5_REF_LIMITS, SEEDANCE_2_CONTINUATION_REF_SEC, SEEDANCE_2_EXTEND_STITCH, SEEDANCE_2_PROVIDERS, SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER, SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC, SEEDANCE_2_REF_LIMITS, SEEDANCE_LIP_SYNC_PROVIDERS, SEEDANCE_VIDEO_EDIT_PROVIDERS, SEEDANCE_VIDEO_EDIT_SHAPE, SEED_SUPPORT, SEPARATOR_DISPLAY, SEPARATOR_PRESETS, SETTINGS_HINT_SOURCES, SETTINGS_INPUT_CONSUMERS, SETTINGS_INPUT_HANDLE, SETTINGS_SOURCE_FIELDS, SETTINGS_SOURCE_TYPES, SHEET_ASPECTS, SHEET_BACKGROUNDS, SHEET_PRESETS, SHEET_SKINS, SHEET_TYPES, SHORT_FILM_ANGLE_COUNT, SHORT_FILM_EXPRESSION_COUNT, SHORT_FILM_VARIANT_THRESHOLD_SEC, SLOT_TOKEN_RE, SMART_CUT_WINDOW_DEFAULT, SMART_CUT_WINDOW_MAX, SMART_CUT_WINDOW_MIN, SOCIAL_PLATFORMS, SOCIAL_POST_NODE_TYPES, SOCIAL_POST_VIDEO_LINK_MARGIN_MS, SOCIAL_SEARCH_COUNTS, SOCIAL_SEARCH_CREDITS_PER_PAGE, SOCIAL_SEARCH_CREDIT_COSTS, SOCIAL_SEARCH_DEFAULT_PICK_TOP, SOCIAL_SEARCH_MAX_QUERY_LENGTH, SOCIAL_SEARCH_MODES, SOCIAL_SEARCH_NODE_TYPE, SOCIAL_SEARCH_PAGED_MODES, SOCIAL_SEARCH_PERIODS, SOCIAL_SEARCH_PLATFORM_MODES, SOCIAL_SEARCH_SORTS, SOCIAL_SEARCH_VIDEO_KINDS, SOCIAL_VIDEO_HOSTS, SPEAKER_EMPHASIS_STYLES, SPEAKER_LAYOUTS, SPEAKER_LAYOUT_IDS, SPEAKER_SWITCHES, SPEAKER_SWITCH_IDS, SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE, SPEAKER_TRACKS_MAX_BYTES, SPEAKER_TRACKS_VERSION, SPEAKER_TRACK_ATTRIBUTION_METHODS, SPEECH_FLOOR_UNITS, SPEECH_PRICE_UNIT_CHARS, SPEECH_UNIT_CREDIT_SUFFIX, SPEECH_UNIT_PRICE_NOTE, STAGE_PATCH_SCHEMA, STATIC_CAPTION_STYLES, STRUCTURAL_SECTIONS, STRUCTURED_VISION_MODELS, STUDIO_DEPENDENT_FRAMES_CAPABILITY, STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS, STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS, STUDIO_KEYFRAME_REVIEW_KEYS, STUDIO_KEYFRAME_TRANSIENT_KEYS, STUDIO_PREVIZ_RUN_STATE_KEYS, STUDIO_SEQUENCE_PLANNING_KEYS, STUDIO_SEQUENCE_POLICY_KEYS, STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS, STUDIO_SEQUENCE_UNIT_REVIEW_KEYS, STUDIO_SHOT_DRAFT_KEYS, STUDIO_SHOT_TRANSIENT_KEYS, STUDIO_TAKE_SEQUENCE_KEYS, STUDIO_TAKE_VOICE_KEYS, STUDIO_TRANSIENT_KEYS, SUBMISSION_STATUSES, SUNO_ACTIVE_MODELS, SUNO_ADD_TRACK_MODELS, SUNO_DURATION_MODELS, SUNO_FIELD_HANDLE_FIELDS, SUNO_HARD_CEILING, SUNO_LEGACY_MODELS, SUNO_MODELS, SUNO_SELECT_OPERATIONS, SUNO_TEXT_MAX, SUNO_TITLE_MAX, SUNO_TRACK_SOURCE_TYPES, SUNO_VERSION_CREDIT_KEYS, SUNO_VERSION_PRICED_OPERATIONS, SUPPORTED_FONT_NAMES, SURROUND_DIRECTIONS, SWITCHX_BLOCK_FRAMES, SWITCHX_FRAME_TIERS, SceneHelperNameSchema, SceneInputModeSchema, SceneMetadataSchema, SceneNodeDataSchema, SceneSpecSchema, ScriptCriticVerdictSchema, SequenceExecutionRequiredError, ShotSpecSchema, ShowrunnerPlanSchema, StageAwaitingSubGateEventSchema, StoryboardCohesionCriticVerdictSchema, StyleDirectivesSchema, SubGateNameSchema, T2I_TO_I2I_VARIANT, TASK_CHAINED_EDIT_PROVIDERS, TELEGRAM_ACCOUNT_SEND_NODE_TYPE, TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_FIELDS, TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE, TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE, TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES, TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS, TELEGRAM_FEED_DEFAULT_LIMIT, TELEGRAM_FEED_DIGEST_SEPARATOR, TELEGRAM_FEED_LIMIT_MAX, TELEGRAM_FEED_PAGE_SIZE, TELEGRAM_FEED_PEEK_MAX, TELEGRAM_SEND_AS, TELEGRAM_SEND_DESTINATIONS, TELEGRAM_TRIGGER_NODE_TYPE, TEMPLATE_CATEGORIES, TEXT_TO_AUDIO_PRICING, TEXT_TO_AUDIO_PROVIDERS, TEXT_TO_AUDIO_SFX_CREDIT_IDS, TEXT_TO_VIDEO_PROVIDERS, TIER_MAX_PIPELINE_COST_CREDITS, TIER_PIPELINE_PARALLELISM, TILT_CARRIED_FRACTION, TOPAZ_DEFAULT_UPSCALE_FACTOR, TOPAZ_UPSCALE_FACTORS, TRANSCRIBE_LANES, TRANSCRIBE_PROVIDERS, TRANSCRIBE_PROVIDER_CAPABILITIES, TRANSIENT_RUNTIME_KEYS, TTS_FALLBACK_PROVIDER, TTS_NEIGHBOUR_TEXT_MAX_CHARS, TTS_PROVIDERS, TTS_PROVIDER_ALIASES, TTS_TEXT_MAX, TWO_K_RESOLUTION_PROVIDERS, TransitionTypeSchema, UGC_NODE_RUN_STATE_KEYS, UGC_NODE_TYPES, UGC_OVERRIDABLE_FIELDS, UPSCALE_IMAGE_PROVIDERS, USAGE_GROUP_BYS, USAGE_MODES, VARIABLES_HANDLE_ID, VARIABLE_PRICING_MODELS, VEHICLES, VEHICLE_SUBCATEGORY_LABELS, VEHICLE_SUBCATEGORY_ORDER, VEO_PROVIDERS, VIDEO_ANALYSIS_AUDIO_MODES, VIDEO_ANALYSIS_BUCKET_CREDITS, VIDEO_ANALYSIS_BUCKET_GRACE_SEC, VIDEO_ANALYSIS_CLIP_TRANSITIONS_IN, VIDEO_ANALYSIS_DEFAULT_VARIATION, VIDEO_ANALYSIS_DURATION_BUCKETS, VIDEO_ANALYSIS_DURATION_TOLERANCE_SEC, VIDEO_ANALYSIS_ENTITY_SOURCES, VIDEO_ANALYSIS_FACELESS_ANGLES, VIDEO_ANALYSIS_LEGACY_MODELS, VIDEO_ANALYSIS_LLM_MODELS, VIDEO_ANALYSIS_MAX_DURATION_SEC, VIDEO_ANALYSIS_MAX_SCENE_SEC, VIDEO_ANALYSIS_MAX_VARIATIONS, VIDEO_ANALYSIS_MIXED_TIERS, VIDEO_ANALYSIS_SHOT_ANGLES, VIDEO_ANALYSIS_SPEED_EFFECTS, VIDEO_ANALYSIS_STORY_JUMPS, VIDEO_ANALYSIS_TEXT_KINDS, VIDEO_ANALYSIS_TIERS, VIDEO_ANALYSIS_TIER_LABELS, VIDEO_ANALYSIS_TIER_ORDER, VIDEO_ANALYSIS_TIMES_OF_DAY, VIDEO_ANALYSIS_TRANSITIONS, VIDEO_ANALYSIS_VARIATION_SLUGS, VIDEO_ANALYSIS_VISUAL_EFFECTS, VIDEO_ANALYSIS_WINDOW, VIDEO_AUDIO_CAPABILITY, VIDEO_AUDIT_BUCKET_CREDITS, VIDEO_CHARACTER_DESCRIPTION_MAX, VIDEO_CHARACTER_NAME_MAX, VIDEO_CHARACTER_REFS_WIRE_MAX, VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX, VIDEO_CHARACTER_VOICE_EXAMPLE_MAX, VIDEO_CLIP_CREDITS, VIDEO_CRITIC_CREDITS_PER_SHOT, VIDEO_CRITIC_FRAME_MODES, VIDEO_CRITIC_MAX_RETRIES, VIDEO_CRITIC_METADATA_KEYS, VIDEO_CRITIC_MIN_ADHERENCE_SCORE, VIDEO_CRITIC_RESERVED_CREDITS_PER_SHOT, VIDEO_DURATION_AUTO, VIDEO_DURATION_TIERS, VIDEO_GEN_COLLAPSED_T2V_IDS, VIDEO_GEN_PROVIDERS, VIDEO_INPUT_LIP_SYNC_PROVIDERS, VIDEO_LINK_TOLERANT_CONSUMER_TYPES, VIDEO_MODEL_CAPS, VIDEO_MODE_ALIASES, VIDEO_ONLY_PARAMETER_NODE_TYPES, VIDEO_OUTPUT_CANVAS, VIDEO_OVERLAY_ANIMATION_MIN_SCALE, VIDEO_OVERLAY_ANIMATION_SEC, VIDEO_OVERLAY_BADGE_INSET, VIDEO_OVERLAY_BADGE_WIDTH, VIDEO_OVERLAY_BOUNDS, VIDEO_OVERLAY_BOX_FIELDS, VIDEO_OVERLAY_CORNERS, VIDEO_OVERLAY_DEFAULT_BACKGROUND, VIDEO_OVERLAY_ERROR_CODES, VIDEO_OVERLAY_FITS, VIDEO_OVERLAY_HANDLE_IDS, VIDEO_OVERLAY_LAYER_PLAN_HANDLE, VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH, VIDEO_OVERLAY_MAX_LAYERS, VIDEO_OVERLAY_MAX_TIME_SEC, VIDEO_OVERLAY_MAX_TOTAL_LAYER_BYTES, VIDEO_OVERLAY_OUTPUT_ASPECTS, VIDEO_OVERLAY_PRESETS, VIDEO_OVERLAY_PRESET_IDS, VIDEO_OVERLAY_WARNING_CODES, VIDEO_PRODUCER_TYPES, VIDEO_PROMPT_MAX, VIDEO_PROVIDERS_REQUIRING_IMAGE, VIDEO_PROVIDERS_WITHOUT_DISPATCH, VIDEO_REF_LIMITS_BY_PROVIDER, VIDEO_REF_VIDEO_DURATION_LIMITS, VIDEO_SFX_PRICING, VIDEO_TO_VIDEO_NODE_PROVIDERS, VIDEO_TO_VIDEO_PROVIDERS, VIDEO_UPSCALE_PROVIDERS, VIDEO_UTIL_PRICING, VIDEO_VARIABLE_PRICING, VOICE_CHANGER_MODELS, VOICE_CHANGER_MODEL_IDS, VOICE_DESIGN_MODELS, ValidateMatchCutInputSchema, ValidateMatchCutResultSchema, VideoCriticVerdictSchema, VoiceMatchSchema, WAN_3_DEFAULT_RESOLUTION, WAN_3_PROVIDERS, WARDROBE_VARIANTS, WEAPONS, WEAPON_SUBCATEGORY_LABELS, WEAPON_SUBCATEGORY_ORDER, WEBHOOK_TRIGGER_NODE_TYPE, WORKFLOW_VISIBILITIES, WORKSPACE_HEADER, WORKSPACE_HEADER_LOWER, WORKSPACE_ROLES, WorkspaceSettingsSchema, YOUTUBE_HOSTS, adCreativeAnalysisFrom, adviceFamilyOf, aggregateByType, aiAvatarReserveCreditId, alignedFieldList, analyzedSceneSchema, applyAudioSyncOffsets, applyDefaultVideoSelection, applyEdlCreditId, applyHandleInputOverride, applyRange, applyRangeIndices, applyScene3DEditOperations, applyScene3DV2EditOperations, applySettingsInput, applySlots, applyVideoAudioToggle, applyVideoNegativePrompt, applyVideoOverlayPreset, asEditPlanMode, asEditPlanTier, aspectRatioFromDims, aspectRatioOptionsByKind, aspectRatioToNumber, assembleNarratedVideoCredits, assembleVideoOverlayRequest, assertCanvasExecutionAllowed, autoStrokeWidth, availableReasoningEfforts, bucketSecondsFromAuditCreditId, bucketSecondsFromCreditId, buildBoardPrompt, buildChildrenByParent, buildConditionVariables, buildCreditModelIdentifier, buildEditPlanCreditId, buildExpressionFromVisual, buildFeedMaps, buildInstagramScrapeCreditId, buildLipSyncCreditId, buildLlmCreditIdentifier, buildMetaAdsScrapeCreditId, buildModelMenu, buildModelTree, buildMotionCreditModelIdentifier, buildNodePresetExport, buildPanelPrompt, buildPro3DRenderSource, buildProgressSegments, buildRangeLabel, buildScraperCreditId, buildVideoAnalysisCreditId, buildVideoAuditCreditId, buildVideoCreditModelIdentifier, calculateCombinedProgress, calculateMonetizationMarkup, calculateMonetizedCost, calculateProgress, cameraSwitchCameras, cameraSwitchEdlProblem, cameraSwitchSettingsPayload, canonicalExposedFieldKey, canonicalScene3DPlanV2Json, canonicalSourceHandle, canonicalTargetHandle, canonicalTtsProvider, canonicalVarName, canonicalizeOverrideKeys, captionFontWeightSchema, captionInputSchema, captionPlanBodyLevers, captionPlanPassThrough, captionRoutesToRemotion, captionSegmentInputSchema, centreCropToAspect, characterBoardItems, characterBucketDisplayRank, characterMentionSlug, characterMentionableAssetArrays, characterSheetRefItems, characterVariantAssetArrays, checkRefVideoDurations, cinematicCreditId, clampCameraSwitchSetting, clampChars, clampCinematicDuration, clampContentIdeasCount, clampEditPlanClipCount, clampInstagramFeaturedIndex, clampMetaAdsFeaturedIndex, clampSmartCutWindow, classifyCreativeFormat, classifyLegacyTargetHandle, classifyRefToken, cleanOrphanedItems, cleanSpeakerNames, clearImageCriticMetadata, clearVideoCriticMetadata, clearWiredVideoOverlayImageUrls, clipLookSchema, clipNotesFrom, collectAncestorRefs, collectionCapsForTier, collectionReadSince, collectionRecordHeadline, collectionRecordsDigest, combineSameLabelRefs, combineVideosPassThrough, compactWithRows, competitorScanCreditId, competitorScanCredits, competitorScanSearches, computeAggregateLanes, computeFrameFitPlan, computeScene3DPlanV2ContentHash, connectedSettingsSources, contentIdeasCreditFeature, contentIdeasCreditId, contentRecipeCreditId, countEmptyInputSkips, countRefModalityEdges, creditRangesAll, creditsToUsd, decodeProviderItem, defaultCarriedFraction, defaultEdgeOutputMode, defaultResolutionFor, defaultRoleForSource, defaultSpeakerMap, defaultVideoAspectRatio, deriveLinkedFields, deriveLottieSlotFields, deriveSlotRefs, describeAudioSyncOffsetIssue, describeEdgeBehavior, describeMaskRegion, describeNodeAdjustments, describeSlotControl, describeSpeakerTracks, detectVideoLinkPlatform, dialogueHasLever, dialogueProviderOf, dialogueStabilityAccepted, dialogueSupportsTimestamps, dropUnknownBindings, dropUnknownSpeakers, durationsByMode, editPlanBasis, editPlanBucketMinutes, editPlanResultPatch, editPlanSavedOutput, editPlanSourceDurationSec, editPlanTranscriptOrigin, edlDurationMs, edlSegmentOutputStarts, edlSpanKey, edlSpeakerSpace, effectiveContentModel, effectiveReasoningEffort, encodeProviderItem, ensureLocaleCatalogLoaded, entityHydrationColumns, entityMentionSlug, entityMentionSlugForRef, entityScalarFields, entitySlotSchema, entryMatchesQuery, estimateCombineVideosCredits, estimateFilmCredits, estimateLoopTrimAddonCredits, estimateLoopVideoCredits, estimateScriptDurationSec, estimateSheetCost, estimateTrimVideoCredits, evaluateCondition, evaluateConditionGroup, evaluateJsonExpression, evaluateJsonPath, executionOutcome, expandExtraRefsToConnectedReferences, expandItemsWithRepeat, expandVideoOverlayLayer, expandVideoOverlayPresets, extractAllGeneratedResults, extractCharacterLoraFields, extractGeneratedJsonAsList, extractPresetData, extractReferencedLabels, extractVideoDurationFromNode, fanOutItemMeta, fanOutTextFeedsPrompt, fanOutUrlItemIsText, featuredInstagramOutputs, featuredMetaAdOutputs, fieldKeyFromHandle, filterCloneNodes, findCharacterMentionTokens, findDialogueCapabilities, findEntityMentionTokens, findImageMentionTokens, findLocationMentionTokens, findRestrictedPickerValue, findSeedance2AudioOverLimit, findSegmentOverlap, findUgcLockedFields, findWordlessTranscriptFeeds, firstSightExtraRole, fitAspectRatioToModel, flattenItems, formatVideoOverlayError, getAnimal, getAnimalLabel, getAnimalPromptHint, getAnimalTerm, getAspectRatioOptions, getAudioCrossfadeCurve, getCharacterFacet, getCombineTransition, getCreditRange, getDialogueCapabilities, getDurationsForModel, getEffectiveRepeatCount, getFeaturedEntities, getFurniture, getFurnitureLabel, getInputFieldExtraKeys, getInputFieldSchema, getInputNodes, getItemSortId, getLipSyncMaxAudioSeconds, getLlmModalityCaps, getLlmModel, getLlmTier, getLocaleDirection, getMaxImagePromptChars, getMaxNegativePromptChars, getMaxSunoPromptChars, getMaxSunoStyleChars, getMaxTtsChars, getMaxVideoPromptChars, getModel, getNodeLabel, getNodeResult, getOutputNodes, getOutputType, getParameterValue, getQualityOptions, getResolutionOptions, getRouteReachableNodeIds, getSpeakerLayout, getSpeakerSwitch, getStrategy, getTargetField, getTtsCapabilities, getValidValues, getVehicle, getVehicleLabel, getVideoAudioCapability, getWeapon, getWeaponLabel, groupByFamily, groupByKindAndFamily, groupHandleId, groupLlmModelsByVendor, hasContiguousSegmentDurations, hasDrawableVideoOverlayBox, hasFeature, hasUrlParserHazard, hexToRgbaArray, holdsPreviewRender, hostnameMatchesAllowlist, humanizeSlotSid, imageMentionSlug, imageMentionSlugForRef, imageOverlayBillableVariants, imageOverlayCredits, imageReferenceLimit, inferMusicVideo, ingestRecordFromJson, instagramAnalysisCreditId, instagramAnalysisTierFrom, instagramPostLink, instagramRequestedCount, instagramScrapeCreditIdFromNode, instagramScrapeMode, instagramScrapeSources, instagramScrapeTier, isAggregateableType, isAutoVideoDuration, isCharacterAspectRatio, isCollectInEdge, isCollectionMedia, isCollectionUrl, isCompetitorAboutPlatform, isCronExpression, isDefaultSelectorConfig, isEdlTargetAspect, isExpandedClone, isFacebookPageUrl, isFanInEdge, isFanInNodeType, isFanOutUrlItem, isFlux2Model, isGeminiOmniProvider, isGvpSupportedProvider, isHandleInputWired, isInstagramScrapeCount, isInstagramScrapeMode, isKineticCaptionStyle, isKnownScene3DEngine, isKnownSpeakerEmphasisStyle, isLegacySunoModel, isLocationUsageMode, isMeasurableCard, isMetaAdsFormat, isMetaAdsPlatform, isMetaAdsScrapeCount, isMetaAdsScrapeMode, isMetaCdnImageUrl, isMinimaxH3Provider, isObjectAspectRatio, isOversizedScene, isPaygRetentionActive, isPerSecondLipSyncProvider, isPro3DRenderJobOutput, isPro3DRenderQuote, isPro3DRenderRenderOnly, isProjectedTriggerNodeType, isRenderNodeType, isRtlText, isScene3DAuthoringEngine, isScene3DCameraTrack, isScene3DHttpUrl, isScene3DPlan, isScene3DPlanV1, isScene3DPlanV2, isScene3DReviewUnavailableReason, isScene3DSchemaVersionSupported, isScraperActor, isSeedance2Provider, isSeedanceVideoEditProvider, isSettingsHintEdge, isSettingsHintSource, isSettingsSourceType, isSocialPost, isSocialSearchPickFrozen, isSocialVideoUrl, isTelegramAccountTriggerNamedHandle, isTemplateCategory, isTiltDirection, isUsageMode, isValidTimezone, isVeoProvider, isVideoAnalysisMixedTier, isVideoAnalysisTier, isVideoOverlayCorner, isVideoOverlayOutputAspect, isVideoOverlayPresetId, isWan3Provider, jsonResultToList, knownEntitySlugsFromRefs, knownImageSlugsFromRefs, legacyScheduleToRules, listBoardTemplates, listModels, listResultsServeHandle, listSlotSids, liveRowColumn, llmRouteDefaults, localMinuteKey, localTimeIn, locationMentionSlug, locationReferencePhotoKindLabel, locationUsageModeLabel, ltxExtendDurationSec, ltxRetakeDurationSec, mapAspectRatio, mapQuality, mapShotIntentToProviderDirectives, matchVariant, matchesCron, matchesCronField, maxSegmentSecFor, maxSegmentsFor, maxVideoDurationSec, measuredCanvasCombinations, mergeClipLook, mergeEdlSourceOffsets, mergeExposedSettings, mergeNodeInputOverrides, metaAdsAdvertisersFrom, metaAdsAnalysisCreditId, metaAdsAnalysisTier, metaAdsAnalysisTierFrom, metaAdsNodeMode, metaAdsScrapeCreditIdFromNode, metaAdsScrapeSources, metaAdsScrapeTier, metaAdsScrapeWireSources, migrateEdgeOutputMode, migrateToItems, minSegmentSecFor, minimalRatioDimensions, modelIdsByKindMode, modelToNodeTarget, modelsForInputMode, modelsWithFeature, motionGraphicsFeature, newScene3DRevisionId, nextScheduleRuns, nodeFeedsAnything, nodeStateMayCarryOutput, nonBlankCaptionText, normalizeCaptionNumericLevers, normalizeCollectionFields, normalizeCollectionMedia, normalizeDedupeKey, normalizeEdl, normalizeLottieLayers, normalizeMinimaxH3Resolution, normalizeModelInput, normalizeNodeModelParams, normalizePinterestUrl, normalizeRoleSlug, normalizeSavedPostTags, normalizeScheduleRule, normalizeScheduleRules, normalizeSpeakerTrackSetDescriptor, normalizeSpeakerTracks, normalizeTemplateCategory, normalizeTranscript, normalizeTtsNeighbourText, normalizeVideoOverlayNodes, normalizeVideoRequestParams, normalizeWan3Resolution, orderedLlmModels, outputMsToMasterMs, overlayFontById, overlayImageEffectsSchema, overlayPlatformById, overlayQrStyleSchema, overlayShapeElement, overlayShapeStyleSchema, overlayStrokeSchema, overlayTextStyleSchema, overlayVariantHandle, overlayVariantIdFromHandle, ownsItsList, parseAspectToken, parseAttributedDialogue, parseCaptionPlan, parseCharacterMentionToken, parseEditPlanMode, parseEntityMentionToken, parseGroupHandle, parseHandleId, parseImageMentionToken, parseListExpression, parseLocationMentionToken, parseNodePresetExport, parseNodeRef, parseScene3DCameraTrackJson, parseScene3DPlanV2Json, parseSpeakerEmphasisStyle, parseVideoOverlayLayerPlan, pickAiAvatarBucket, pickHeldRow, pickIds, pickLipSyncBucket, pickSocialPosts, pickSwitchXFrameTier, pickVideoAnalysisBucket, planClipKeyAt, planFanOut, planFeedEmission, planSheetGeneration, planSheetPanels, preferredInputModeForModel, presentTypes, presetApplyClearKeys, presetDataMatches, presetEntries, presetLeverClearKeys, previewGatedNodeIds, previewHorizonMs, previewStops, pricedOutputDurationSec, pricedVideoSelection, pro3DRenderCoreOutputSchema, pro3DRenderFrameUnit, pro3DRenderJobOutputSchema, pro3DRenderProducedSchemaVersion, pro3DRenderQuoteSchema, pro3DRenderReviewVerdictSchema, pro3DRenderShotStillSchema, pro3DRenderShotStills, pro3DRenderTimingOverrides, qualityOptionsByKind, readPromptAffixes, readScriptSettings, reasoningOutputFloor, refHandleCategory, referenceModalityForHandle, referenceSheetCreditId, registerCatalogSidecars, registerSidecarLoaders, remapMsThroughEdl, remapTranscriptThroughEdl, renderAnalyzedScene, renderClipKey, renderNodeOf, renderPlanBasis, renderPlanClipKey, renderPlanNodeId, renderPlanPath, renderPlanRowClipKeys, renderPlanValue, renderReadBasis, renderResultStamp, renderRunQuality, renderSentRowStamps, renderSettingsBasis, renderVideoCreditId, renderedSourceHandle, rendersAsPreview, rendersLatestBatch, rendersTranscriptJson, requiresSequenceExecution, resetCatalogSidecars, resolutionOptionsByKind, resolveAiAvatarCreditId, resolveAudioCrossfadeCurve, resolveCaptionLevers, resolveCaptionLook, resolveCharacterAspectRatio, resolveCinematicCreditId, resolveConditionValue, resolveDefaultRole, resolveDescription, resolveDialogueVoices, resolveEditPlanOutput, resolveEditPlanSources, resolveEdlSegmentSlots, resolveEffectiveSourceType, resolveEffectiveTier, resolveEntityAspect, resolveFieldMappings, resolveFrameDelivery, resolveFrameFitAspect, resolveGvpAnchorWire, resolveImageGenCreditIdentifier, resolveIndex, resolveInstagramScrapeCreditId, resolveLabel, resolveListExpression, resolveListFanOut, resolveLlmCreditId, resolveLocationFields, resolveLocationPresetCatalog, resolveLottieOverlaySrc, resolveMetaAdsScrapeCreditId, resolveMusicProvider, resolveNodeRefs, resolveNormalizedImageGen, resolveObjectAspectRatio, resolveOutputCanvas, resolvePipelineModel, resolveRelativeWindowToken, resolveScene3DAuthoringEngine, resolveScraperCreditId, resolveSelectorRefs, resolveSeparator, resolveSheetSections, resolveSlideshowTransition, resolveSourceThroughConnectedList, resolveStoredTier, resolveSwitchXCreditId, resolveTemplateCategory, resolveTopazUpscale, resolveVideoAnalysisModel, resolveVideoLinkOutput, resolveVideoModeForInputs, resolveVideoOverlayGeometry, resolveVideoProviderForMode, resolveWiredSettings, resolveXfadeName, rewriteSceneBindings, rewriteSlotTokens, rewriteSpeakerSlots, rgbaArrayToHex, roleToPhrase, rotationVec3Schema, ruleMatches, runSelector, safetyRetryPolicy, sanitizeRole, savedRenderBatch, savedRenderBatchUrls, savedRenderOutput, scaleVec3Schema, scene3DAcceptedSchemaVersionsSchema, scene3DAnchorNameSchema, scene3DAnchorSchema, scene3DAnyPlanSchema, scene3DAssetAnimationSchema, scene3DAssetIdSchema, scene3DAssetRefSchema, scene3DCameraChangesSchema, scene3DCameraKeyframeSchema, scene3DCameraSampleSchema, scene3DCameraSchema, scene3DCameraTrackIssues, scene3DCameraTrackObjectSchema, scene3DCameraTrackPlanIssues, scene3DCameraTrackSchema, scene3DClayLightingSchema, scene3DColorSchema, scene3DDeepEqual, scene3DEasingSchema, scene3DEditOperationSchema, scene3DEditOperationsSchema, scene3DEngineIdSchema, scene3DEntityAcceptsOverlay, scene3DEntityCapabilitySchema, scene3DEntityV2Schema, scene3DEntityVisualSchema, scene3DIdSchema, scene3DInputAssetSchema, scene3DInputAssetsForEngine, scene3DInputAssetsSchema, scene3DJsonByteLength, scene3DLightingChangesSchema, scene3DLightingSchema, scene3DMaterialBindingSchema, scene3DMaterialNameSchema, scene3DMaterialRoleSchema, scene3DNodeIdSchema, scene3DNodeNameSchema, scene3DObjectChangesSchema, scene3DObjectKeyframeSchema, scene3DObjectSchema, scene3DOverrideSchema, scene3DPlanIssues, scene3DPlanSchema, scene3DPlanSchemaVersion, scene3DPlanV1Issues, scene3DPlanV1ObjectSchema, scene3DPlanV1Schema, scene3DPlanV2Issues, scene3DPlanV2ObjectSchema, scene3DPlanV2Schema, scene3DPrimitiveSchema, scene3DProjectionIssues, scene3DProvenanceSchema, scene3DReferenceSchema, scene3DRenderTier, scene3DRenderTierCredits, scene3DReviewNote, scene3DReviewVerdictOf, scene3DSampleForFrame, scene3DSha256Schema, scene3DShotForFrame, scene3DShotIndexForFrame, scene3DShotSchema, scene3DUrlSchema, scene3DV2AdmissionIssues, scene3DV2EditOperationSchema, scene3DV2EditOperationsSchema, scene3DV2HierarchyDepth, scene3DV2NormalizationIssues, scene3DV2OverrideInputSchema, scene3DV2ResourceUsage, scene3DVersionTokenSchema, scene3DZodIssues, scheduleMatchesAt, scheduleOccurrences, searchModelVariants, seedance2AudioLimitSec, seedanceVideoEditCreditId, segmentDurationsFor, selectByModulo, selectByNamedKey, selectByPredicate, selectListItems, selectLoraRoutingForMentions, selectRandom, setRegisteredPersonPackFields, settingsInputAccepts, settingsInputFields, settingsProviderModels, settingsSourceForField, settingsSourceForType, settledWithLimit, signedLinkExpiresAt, sizeVec3Schema, slotVariationSchema, snapToModelDuration, socialPostDigestLine, socialPostsDigest, socialPostsFrom, socialPostsLongestVideoSec, socialSearchCount, socialSearchCountry, socialSearchCreditId, socialSearchCreditIdFromNode, socialSearchEffectiveCount, socialSearchMaxCount, socialSearchMode, socialSearchPages, socialSearchPickTop, socialSearchPlatform, socialSearchPostLink, socialSearchPostVideo, socialSearchRegion, socialSearchRequestFromNode, sortCharacterEntriesForDisplay, sortListItems, sourceRefKey, speakerLayoutAllows, speakerPresentationWarnings, speakerSwitchOverlaps, speakerTurns, speechCredits, speechPriceUnits, speechUnitCreditId, speedRampCreditId, spliceDelimitedRows, splitByLoopDelimiter, splitGeneratedItems, splitInstagramTargets, splitMetaAdsAdvertiserNames, splitMetaAdsPageUrls, spreadJsonArrayIfSingleton, stringifyPathResults, stripDerivedAnalysisFields, stripExportContent, stripStudioDraftSettings, stripStudioDraftWorkflow, stripStudioTakeVoiceRecords, stripStudioTransientSettings, stripTransientRuntimeData, stripUgcRunState, stripUnownedRefs, styleCaptionPlan, summarizeScene3DOperations, sunoCreditType, sunoModelHonoursDuration, supportedDefaultDimensions, supportsAdvancedMode, supportsAutoVideoDuration, supportsEndAnchor, supportsExtendRender, telegramAccountListeningSignature, telegramAccountTriggerOutputs, telegramFeedDigest, telegramPostsFrom, telegramSendAsOf, telegramSendDestinationOf, templateCategoryStoredValues, textToAudioBilledSeconds, textToAudioCreditId, timezoneOffsetMinutes, toConnectedReference, toConnectedReferences, toCustomVideoOverlayLayer, togglePick, transcribeLaneSupportsWordTimestamps, transcribeProvidersWithWordTimestamps, transcribeWordTimestampsRefusal, transcriptDurationSec, transcriptSpeakerLabels, tryParseJson, ttsHasLever, ttsLanguageCodes, ttsSupportsAudioTags, ttsSupportsSsmlBreaks, ttsSupportsStitching, ttsSupportsTimestamps, ugcCallToRouteBody, uiAspectRatioFill, uiDurationFill, uiResolutionFill, unresolvedRefTokens, unwrapEditPlanOutput, unwrapUnresolvedTokens, usageModeDirective, usageModeIncludesName, usageModeLabel, usdToCredits, validateAiAvatarPayload, validateCinematicAvatarPayload, validateDurationForFormat, validateEditedEdl, validateEdl, validateEdlClipSet, validateModeActivation, validateModelInput, validateNoNestedGroups, validateObjects, validateProviderForNodeType, validateSpeakerTrackSetDescriptor, validateSpeakerTracks, validateSubWorkflowRoutes, validateVideoOverlayRequest, variantJobId, vec3Schema, verifyScene3DPlanV2ContentHash, videoAnalysisCreditSegment, videoAnalysisNumWindows, videoAnalysisResultSchema, videoAuditCreditsForBucket, videoCharacterDistinctVoices, videoCharacterRefCap, videoCharacterRefProblem, videoCharacterRefProviders, videoCharacterRefUnits, videoCharacterVoiceCap, videoCharacterVoiceKey, videoCharacterVoiceProblem, videoLinkDownloadedFile, videoLinkNeedsDownload, videoLinkPageUrl, videoModelCanSpeakDialogue, videoModelSupportsAudio, videoNegativeSuffix, videoOverlayCanvas, videoOverlayCompositionKey, videoOverlayLayerLabel, videoOverlayPassThrough, videoOverlayPresetBox, videoOverlayRenderOrder, videoOverlaySlotOfHandle, videoOverlaySlotSources, videoProviderFoldsLoneEndFrame, videoProviderRequiresImage, videoSfxCreditId, windowAnalysisSchema, withRunOverrides, withWiredSettings, zipMergeLists };
|
|
21447
23368
|
//# sourceMappingURL=index.js.map
|
|
21448
23369
|
//# sourceMappingURL=index.js.map
|