@nodaro/shared 3.20.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 +2287 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1938 -82
- package/dist/index.d.ts +1938 -82
- package/dist/index.js +2119 -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__/default-tts-provider.test.ts +46 -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 +83 -5
- 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 +180 -1
- package/src/model-catalog.ts +125 -15
- package/src/model-constants.ts +37 -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/src/voices.ts +11 -7
package/dist/index.cjs
CHANGED
|
@@ -53,6 +53,7 @@ function isAutoVideoDuration(duration) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
// src/model-catalog.ts
|
|
56
|
+
var SPEECH_UNIT_PRICE_NOTE = "per started 100 characters, at least 8 units \u2014 where length pricing is on";
|
|
56
57
|
var MODEL_RECOMMENDATIONS = [
|
|
57
58
|
// image
|
|
58
59
|
{ intent: "best for typography / logos / text-heavy", modelIds: ["nano-banana-pro", "gpt-image-2"], note: "Nano Banana Pro for diagrams / complex text; GPT Image 2 for logos and short copy." },
|
|
@@ -69,7 +70,7 @@ var MODEL_RECOMMENDATIONS = [
|
|
|
69
70
|
{ intent: "cheap batch video clips", modelIds: ["veo3.1", "wan-turbo", "bytedance-lite"], note: "VEO 3.1 Fast is the best price/quality balance with native audio." },
|
|
70
71
|
{ intent: "video with start + end frame", modelIds: ["veo3", "veo3.1", "kling-turbo", "minimax", "hailuo-standard", "seedance-2"], note: "All listed support an end frame; VEO uses imageUrls[start, end]." },
|
|
71
72
|
{ intent: "music / song generation", modelIds: ["suno-v6", "suno-v6_wild", "suno-v6_mini", "suno-v5_5"], note: "V6 is the default flagship; V6 Wild for bolder, less predictable results; V6 Mini when speed matters; v5.5 / v5 / v4 keep their own character. Same price." },
|
|
72
|
-
{ intent: "voice over / narration", modelIds: ["elevenlabs-v3", "elevenlabs-turbo"], note: "
|
|
73
|
+
{ intent: "voice over / narration", modelIds: ["elevenlabs-v4", "elevenlabs-v3", "elevenlabs-turbo"], note: "v4 is the default: [audio tags] for emotion and up to 10,000 characters per request. v3 is the previous expressive model, still selectable. Turbo is cheaper for plain narration." },
|
|
73
74
|
{ intent: "lip-sync a portrait to audio", modelIds: ["kling-avatar-pro", "kling-avatar", "infinitalk"], note: "Pro for best mouth shape; InfiniTalk for resolution control." },
|
|
74
75
|
{ intent: "transcription / captions", modelIds: ["elevenlabs-stt", "incredibly-fast-whisper", "whisper"], note: "Captions need WORD timestamps: ElevenLabs STT (always) or Incredibly Fast Whisper. Plain Whisper returns phrase segments only." },
|
|
75
76
|
{ intent: "motion transfer (drive a subject by another video)", modelIds: ["motion-transfer", "kling-3.0-motion"], note: "Kling 2.6 base is cheap; Kling 3.0 is premium." }
|
|
@@ -2288,6 +2289,7 @@ var TTS_LANGS_V3 = [
|
|
|
2288
2289
|
"sw"
|
|
2289
2290
|
];
|
|
2290
2291
|
var TTS_LEVERS_V2 = ["stability", "similarity", "style", "speed", "speakerBoost"];
|
|
2292
|
+
var DIALOGUE_V4_MAX_CHARS = 5e3;
|
|
2291
2293
|
var AUDIO_MODELS = {
|
|
2292
2294
|
// ── ElevenLabs TTS ──
|
|
2293
2295
|
"elevenlabs-v3": {
|
|
@@ -2300,13 +2302,19 @@ var AUDIO_MODELS = {
|
|
|
2300
2302
|
description: "Expressive ElevenLabs TTS \u2014 supports [audio tags] for emotion / pacing. Direct API.",
|
|
2301
2303
|
useCases: ["tts", "voice-over", "narration", "expressive"],
|
|
2302
2304
|
features: ["audio-tags", "voice-cloning"],
|
|
2303
|
-
pricing: [
|
|
2304
|
-
|
|
2305
|
+
pricing: [
|
|
2306
|
+
{ identifier: "elevenlabs-v3", credits: 30 },
|
|
2307
|
+
{ identifier: "elevenlabs-v3:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2308
|
+
],
|
|
2305
2309
|
tts: {
|
|
2306
2310
|
audioTags: true,
|
|
2307
2311
|
ssmlBreaks: false,
|
|
2308
2312
|
levers: ["stability"],
|
|
2309
2313
|
languageCode: true,
|
|
2314
|
+
timestamps: true,
|
|
2315
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2316
|
+
// Rejects previous_text / next_text with a 400 (probed 2026-10-04).
|
|
2317
|
+
stitching: false,
|
|
2310
2318
|
maxChars: 5e3,
|
|
2311
2319
|
// official cap (probed: 5,200 chars accepted; keep the clamp)
|
|
2312
2320
|
languages: TTS_LANGS_V3
|
|
@@ -2322,12 +2330,21 @@ var AUDIO_MODELS = {
|
|
|
2322
2330
|
description: "Newest ElevenLabs TTS \u2014 [audio tags], stability and similarity control, up to 10,000 characters per request. Direct API.",
|
|
2323
2331
|
useCases: ["tts", "voice-over", "narration", "expressive", "long-form"],
|
|
2324
2332
|
features: ["audio-tags", "voice-cloning"],
|
|
2325
|
-
pricing: [
|
|
2333
|
+
pricing: [
|
|
2334
|
+
{ identifier: "elevenlabs-v4", credits: 30 },
|
|
2335
|
+
{ identifier: "elevenlabs-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2336
|
+
],
|
|
2337
|
+
// The default speech model (DEFAULT_TTS_PROVIDER) carries the star.
|
|
2338
|
+
featured: true,
|
|
2326
2339
|
tts: {
|
|
2327
2340
|
audioTags: true,
|
|
2328
2341
|
ssmlBreaks: false,
|
|
2329
2342
|
levers: ["stability", "similarity"],
|
|
2330
2343
|
languageCode: true,
|
|
2344
|
+
timestamps: true,
|
|
2345
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2346
|
+
// Accepts previous_text / next_text (probed 2026-10-04).
|
|
2347
|
+
stitching: true,
|
|
2331
2348
|
maxChars: 1e4,
|
|
2332
2349
|
// The curated picker, the same 46 as v3. The model itself lists 85
|
|
2333
2350
|
// (it adds e.g. Cantonese, Maltese, Mongolian, Burmese, Uzbek); widening
|
|
@@ -2344,12 +2361,21 @@ var AUDIO_MODELS = {
|
|
|
2344
2361
|
series: "ElevenLabs",
|
|
2345
2362
|
description: "Fast, cheap ElevenLabs TTS via the direct ElevenLabs API. Good for narration.",
|
|
2346
2363
|
useCases: ["tts", "narration", "fast"],
|
|
2347
|
-
|
|
2364
|
+
// The flat row carries no note (a "per 1K chars" note once described a
|
|
2365
|
+
// scaling that never existed; the minimum under length pricing is 8 units, 16).
|
|
2366
|
+
pricing: [
|
|
2367
|
+
{ identifier: "elevenlabs-turbo", credits: 15 },
|
|
2368
|
+
{ identifier: "elevenlabs-turbo:per-100-chars", credits: 2, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2369
|
+
],
|
|
2348
2370
|
tts: {
|
|
2349
2371
|
audioTags: false,
|
|
2350
2372
|
ssmlBreaks: true,
|
|
2351
2373
|
levers: TTS_LEVERS_V2,
|
|
2352
2374
|
languageCode: true,
|
|
2375
|
+
timestamps: true,
|
|
2376
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2377
|
+
// Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
|
|
2378
|
+
stitching: true,
|
|
2353
2379
|
maxChars: 4e4,
|
|
2354
2380
|
// == eleven_flash_v2_5 (functionally equivalent)
|
|
2355
2381
|
languages: TTS_LANGS_FLASH_V25
|
|
@@ -2364,13 +2390,21 @@ var AUDIO_MODELS = {
|
|
|
2364
2390
|
series: "ElevenLabs",
|
|
2365
2391
|
description: "Multi-language ElevenLabs TTS via the direct ElevenLabs API.",
|
|
2366
2392
|
useCases: ["tts", "multilingual"],
|
|
2367
|
-
|
|
2393
|
+
// The flat row carries no note (the old "per 1K chars" described a scaling that never existed).
|
|
2394
|
+
pricing: [
|
|
2395
|
+
{ identifier: "elevenlabs-multilingual", credits: 30 },
|
|
2396
|
+
{ identifier: "elevenlabs-multilingual:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2397
|
+
],
|
|
2368
2398
|
tts: {
|
|
2369
2399
|
audioTags: false,
|
|
2370
2400
|
ssmlBreaks: true,
|
|
2371
2401
|
levers: TTS_LEVERS_V2,
|
|
2372
2402
|
// The API reference: "This parameter is not supported for multilingual_v2 models."
|
|
2373
2403
|
languageCode: false,
|
|
2404
|
+
timestamps: true,
|
|
2405
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2406
|
+
// Measured 2026-10-06: the direct API accepts previous_text / next_text on this model (200).
|
|
2407
|
+
stitching: true,
|
|
2374
2408
|
maxChars: 1e4,
|
|
2375
2409
|
languages: TTS_LANGS_MULTILINGUAL_V2
|
|
2376
2410
|
}
|
|
@@ -2388,18 +2422,61 @@ var AUDIO_MODELS = {
|
|
|
2388
2422
|
description: "Multi-speaker dialogue via the direct ElevenLabs API \u2014 give it a script, it voices each role (any voice: premade, library, or cloned).",
|
|
2389
2423
|
useCases: ["tts", "dialogue", "multi-speaker"],
|
|
2390
2424
|
features: ["audio-tags", "voice-cloning"],
|
|
2391
|
-
|
|
2425
|
+
// Flat per request, whatever the length (decided 2026-10-06: the old
|
|
2426
|
+
// "per 1K chars" note described a scaling that never existed).
|
|
2427
|
+
pricing: [
|
|
2428
|
+
{ identifier: "elevenlabs-dialogue", credits: 25 },
|
|
2429
|
+
{ identifier: "elevenlabs-dialogue:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2430
|
+
],
|
|
2392
2431
|
tts: {
|
|
2393
2432
|
audioTags: true,
|
|
2394
2433
|
ssmlBreaks: false,
|
|
2395
2434
|
levers: ["stability"],
|
|
2435
|
+
// The dialogue route has offered exactly these three since it shipped
|
|
2436
|
+
// (routes/text-to-dialogue.ts). Kept as the platform's v3 dialogue contract.
|
|
2437
|
+
stabilitySteps: [0, 0.5, 1],
|
|
2396
2438
|
languageCode: true,
|
|
2439
|
+
timestamps: true,
|
|
2440
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2441
|
+
// The dialogue funnel does not read this field (its own lane; phase 2 declares
|
|
2442
|
+
// the v4 dialogue model's value). v3 underneath.
|
|
2443
|
+
stitching: false,
|
|
2397
2444
|
// Total across lines. The documented 2,000 is a recommendation, not a
|
|
2398
2445
|
// limit (2,500 and 5,000 both probed 200); capped like v3, the model underneath.
|
|
2399
2446
|
maxChars: 5e3,
|
|
2400
2447
|
languages: TTS_LANGS_V3
|
|
2401
2448
|
}
|
|
2402
2449
|
},
|
|
2450
|
+
"elevenlabs-dialogue-v4": {
|
|
2451
|
+
id: "elevenlabs-dialogue-v4",
|
|
2452
|
+
kind: "audio",
|
|
2453
|
+
// Its own mode, never "tts" — the same reason as v3 dialogue above.
|
|
2454
|
+
modes: ["dialogue"],
|
|
2455
|
+
family: "ElevenLabs",
|
|
2456
|
+
label: "ElevenLabs Dialogue v4",
|
|
2457
|
+
series: "ElevenLabs",
|
|
2458
|
+
description: "Multi-speaker dialogue on ElevenLabs v4 \u2014 [audio tags], stability and similarity control. Direct API.",
|
|
2459
|
+
useCases: ["tts", "dialogue", "multi-speaker"],
|
|
2460
|
+
features: ["audio-tags", "voice-cloning"],
|
|
2461
|
+
// Flat per request, the same as v3 dialogue (decided 2026-10-06).
|
|
2462
|
+
pricing: [
|
|
2463
|
+
{ identifier: "elevenlabs-dialogue-v4", credits: 25 },
|
|
2464
|
+
{ identifier: "elevenlabs-dialogue-v4:per-100-chars", credits: 4, note: SPEECH_UNIT_PRICE_NOTE }
|
|
2465
|
+
],
|
|
2466
|
+
tts: {
|
|
2467
|
+
audioTags: true,
|
|
2468
|
+
ssmlBreaks: false,
|
|
2469
|
+
levers: ["stability", "similarity"],
|
|
2470
|
+
languageCode: true,
|
|
2471
|
+
timestamps: true,
|
|
2472
|
+
// measured 2026-10-06: /with-timestamps answers 200 at the same character cost
|
|
2473
|
+
// Dialogue models never stitch neighbour text (the funnel does not read this).
|
|
2474
|
+
stitching: false,
|
|
2475
|
+
maxChars: DIALOGUE_V4_MAX_CHARS,
|
|
2476
|
+
// The curated picker, v3's 46 (v4 lists 85; widening is its own change).
|
|
2477
|
+
languages: TTS_LANGS_V3
|
|
2478
|
+
}
|
|
2479
|
+
},
|
|
2403
2480
|
// ── ElevenLabs voice utilities ──
|
|
2404
2481
|
// (voice cloning was retired platform-wide on 2026-09-15 — no catalog entry,
|
|
2405
2482
|
// no price, no MCP tool; existing clones still resolve as TTS voice ids.)
|
|
@@ -3747,6 +3824,9 @@ var TTS_PROVIDERS = [
|
|
|
3747
3824
|
"elevenlabs-multilingual",
|
|
3748
3825
|
"elevenlabs"
|
|
3749
3826
|
];
|
|
3827
|
+
var DIALOGUE_PROVIDERS = ["elevenlabs-dialogue", "elevenlabs-dialogue-v4"];
|
|
3828
|
+
var DEFAULT_DIALOGUE_PROVIDER = "elevenlabs-dialogue";
|
|
3829
|
+
var DEFAULT_TTS_PROVIDER = "elevenlabs-v4";
|
|
3750
3830
|
var TEXT_TO_AUDIO_PROVIDERS = [
|
|
3751
3831
|
// Replicate disabled
|
|
3752
3832
|
// "tangoflux",
|
|
@@ -4136,10 +4216,16 @@ var VIDEO_REF_LIMITS_BY_PROVIDER = {
|
|
|
4136
4216
|
"wan-3": { images: 10, videos: 5, audio: 5 },
|
|
4137
4217
|
"wan-3-prime": { images: 10, videos: 5, audio: 5 },
|
|
4138
4218
|
// Multi-image reference providers.
|
|
4139
|
-
|
|
4219
|
+
// `characters` = the dedicated identity input (KIE `character_ids`, max 3).
|
|
4220
|
+
// It is NOT an image-reference lane: it draws from the SAME 7-unit budget as
|
|
4221
|
+
// `images` (images + 2×videos + character units ≤ 7) — see
|
|
4222
|
+
// `video-character-refs.ts`, the one place that budget is computed.
|
|
4223
|
+
// `voices` = distinct audio personas per task (`audio_ids`, max 3). NOT part
|
|
4224
|
+
// of the 7-unit quota: audio ids are a separate input.
|
|
4225
|
+
"gemini-omni-video": { images: 7, videos: 1, characters: 3, voices: 3 },
|
|
4140
4226
|
// Gemini Omni Flash 1.1 — identical quota to the pro sibling
|
|
4141
4227
|
// (images + 2×videos + character_ids ≤ 7).
|
|
4142
|
-
"gemini-omni-flash": { images: 7, videos: 1 },
|
|
4228
|
+
"gemini-omni-flash": { images: 7, videos: 1, characters: 3, voices: 3 },
|
|
4143
4229
|
"kling-3-omni": { images: 7 },
|
|
4144
4230
|
// catalog/docs: "end frame + up to 7 reference images"
|
|
4145
4231
|
"grok-i2v": { images: 7 },
|
|
@@ -4320,7 +4406,9 @@ var VIDEO_AUDIO_CAPABILITY = {
|
|
|
4320
4406
|
// - NOT audio_driven either: "Uploading audio references is unsupported in
|
|
4321
4407
|
// the current version of the API", and "any audio in a video reference is
|
|
4322
4408
|
// ignored" — there is no reference-audio transport to be driven by, and
|
|
4323
|
-
// runGeminiOmni
|
|
4409
|
+
// runGeminiOmni sends `audio_ids` ONLY for a
|
|
4410
|
+
// character's pinned voice persona (a preset voice, never a recording), which
|
|
4411
|
+
// is not a reference-audio transport and leaves the mode `ambient`.
|
|
4324
4412
|
// Audio is priced into the per-tier rate, so NOT cost-affecting.
|
|
4325
4413
|
"gemini-omni-video": { mode: "ambient", alwaysOn: true },
|
|
4326
4414
|
"gemini-omni-flash": { mode: "ambient", alwaysOn: true }
|
|
@@ -4922,6 +5010,134 @@ function getFeaturedEntities(type) {
|
|
|
4922
5010
|
return FEATURED_ENTITIES[type] ?? [];
|
|
4923
5011
|
}
|
|
4924
5012
|
|
|
5013
|
+
// src/video-character-refs.ts
|
|
5014
|
+
var VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(
|
|
5015
|
+
0,
|
|
5016
|
+
...Object.values(VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0)
|
|
5017
|
+
);
|
|
5018
|
+
var VIDEO_CHARACTER_DESCRIPTION_MAX = 2e3;
|
|
5019
|
+
var VIDEO_CHARACTER_NAME_MAX = 100;
|
|
5020
|
+
var VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2e3;
|
|
5021
|
+
var VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
|
|
5022
|
+
function videoCharacterRefCap(provider) {
|
|
5023
|
+
return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0 : 0;
|
|
5024
|
+
}
|
|
5025
|
+
function videoCharacterVoiceCap(provider) {
|
|
5026
|
+
return provider ? VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0 : 0;
|
|
5027
|
+
}
|
|
5028
|
+
function videoCharacterVoiceKey(ref) {
|
|
5029
|
+
const voice = ref.voice;
|
|
5030
|
+
if (!voice) return null;
|
|
5031
|
+
return JSON.stringify([voice.preset, voice.description?.trim() ?? "", voice.exampleLine?.trim() ?? "", ref.name?.trim() ?? ""]);
|
|
5032
|
+
}
|
|
5033
|
+
function videoCharacterDistinctVoices(characterReferences) {
|
|
5034
|
+
const keys = /* @__PURE__ */ new Set();
|
|
5035
|
+
for (const c of characterReferences ?? []) {
|
|
5036
|
+
const key = videoCharacterVoiceKey(c);
|
|
5037
|
+
if (key) keys.add(key);
|
|
5038
|
+
}
|
|
5039
|
+
return keys.size;
|
|
5040
|
+
}
|
|
5041
|
+
function videoCharacterRefProviders() {
|
|
5042
|
+
return Object.entries(VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => (l?.characters ?? 0) > 0).map(([id]) => id);
|
|
5043
|
+
}
|
|
5044
|
+
function videoCharacterRefUnits(characterReferences) {
|
|
5045
|
+
let units = 0;
|
|
5046
|
+
for (const c of characterReferences ?? []) units += c.bodyImageUrl ? 2 : 1;
|
|
5047
|
+
return units;
|
|
5048
|
+
}
|
|
5049
|
+
function videoCharacterVoiceProblem(args) {
|
|
5050
|
+
const distinct = videoCharacterDistinctVoices(args.characterReferences);
|
|
5051
|
+
if (distinct === 0) return null;
|
|
5052
|
+
const cap = args.cap ?? videoCharacterVoiceCap(args.provider);
|
|
5053
|
+
if (cap === 0) {
|
|
5054
|
+
return {
|
|
5055
|
+
code: "character_voice_unsupported",
|
|
5056
|
+
message: `A character voice is not supported by ${args.provider ?? "the selected model"}. Drop the voice, or pick a model that takes characterReferences.`
|
|
5057
|
+
};
|
|
5058
|
+
}
|
|
5059
|
+
if (distinct > cap) {
|
|
5060
|
+
return {
|
|
5061
|
+
code: "character_voices_over_limit",
|
|
5062
|
+
message: `${args.provider} accepts at most ${cap} distinct character voices per video; got ${distinct}. Give some characters the same voice, or drop some.`
|
|
5063
|
+
};
|
|
5064
|
+
}
|
|
5065
|
+
return null;
|
|
5066
|
+
}
|
|
5067
|
+
function videoCharacterRefProblem(args) {
|
|
5068
|
+
const { provider, characterReferences } = args;
|
|
5069
|
+
if (!characterReferences || characterReferences.length === 0) return null;
|
|
5070
|
+
const cap = videoCharacterRefCap(provider);
|
|
5071
|
+
if (cap === 0) {
|
|
5072
|
+
return {
|
|
5073
|
+
code: "character_references_unsupported",
|
|
5074
|
+
message: `characterReferences is not supported by ${provider ?? "the selected model"}. Models that take them: ${videoCharacterRefProviders().join(", ")}. Otherwise send the portrait as a reference image instead.`
|
|
5075
|
+
};
|
|
5076
|
+
}
|
|
5077
|
+
if (characterReferences.length > cap) {
|
|
5078
|
+
return {
|
|
5079
|
+
code: "character_references_over_limit",
|
|
5080
|
+
message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`
|
|
5081
|
+
};
|
|
5082
|
+
}
|
|
5083
|
+
if (args.hasStartFrame) {
|
|
5084
|
+
return {
|
|
5085
|
+
code: "character_references_with_start_frame",
|
|
5086
|
+
message: `${provider} does not yet support combining characterReferences with a start frame (imageUrl) \u2014 the frame and the characters would compete for the same input slots without a defined role. Drop the start frame (the character's portrait carries the face), or drop characterReferences.`
|
|
5087
|
+
};
|
|
5088
|
+
}
|
|
5089
|
+
if (args.hasEndFrame) {
|
|
5090
|
+
return {
|
|
5091
|
+
code: "character_references_with_end_frame",
|
|
5092
|
+
message: `${provider} does not use an end frame (endFrameUrl) together with characterReferences. Drop the end frame, or drop characterReferences.`
|
|
5093
|
+
};
|
|
5094
|
+
}
|
|
5095
|
+
const budget = VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.images ?? 7;
|
|
5096
|
+
const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences);
|
|
5097
|
+
if (used > budget) {
|
|
5098
|
+
return {
|
|
5099
|
+
code: "character_references_quota",
|
|
5100
|
+
message: `${provider} takes at most ${budget} input units: reference images count 1, each reference video 2, each character 1 (2 with a body image). This request uses ${used}. Remove some reference images or characters.`
|
|
5101
|
+
};
|
|
5102
|
+
}
|
|
5103
|
+
return videoCharacterVoiceProblem({ provider, characterReferences });
|
|
5104
|
+
}
|
|
5105
|
+
|
|
5106
|
+
// src/gemini-omni-voices.ts
|
|
5107
|
+
var GEMINI_OMNI_VOICE_PRESETS = [
|
|
5108
|
+
{ id: "achernar", gender: "female", style: "soft", pitch: "high" },
|
|
5109
|
+
{ id: "achird", gender: "male", style: "friendly", pitch: "mid" },
|
|
5110
|
+
{ id: "algenib", gender: "male", style: "raspy", pitch: "low" },
|
|
5111
|
+
{ id: "algieba", gender: "male", style: "easygoing", pitch: "mid-low" },
|
|
5112
|
+
{ id: "alnilam", gender: "male", style: "steady", pitch: "mid-low" },
|
|
5113
|
+
{ id: "aoede", gender: "female", style: "brisk", pitch: "mid" },
|
|
5114
|
+
{ id: "autonoe", gender: "female", style: "bright", pitch: "mid" },
|
|
5115
|
+
{ id: "callirrhoe", gender: "female", style: "easygoing", pitch: "mid" },
|
|
5116
|
+
{ id: "charon", gender: "male", style: "intellectual", pitch: "low" },
|
|
5117
|
+
{ id: "despina", gender: "female", style: "smooth", pitch: "mid" },
|
|
5118
|
+
{ id: "enceladus", gender: "male", style: "breathy", pitch: "low" },
|
|
5119
|
+
{ id: "erinome", gender: "female", style: "clear", pitch: "mid" },
|
|
5120
|
+
{ id: "fenrir", gender: "male", style: "lively", pitch: "younger" },
|
|
5121
|
+
{ id: "gacrux", gender: "female", style: "mature", pitch: "mid" },
|
|
5122
|
+
{ id: "iapetus", gender: "male", style: "clear", pitch: "mid-low" },
|
|
5123
|
+
{ id: "kore", gender: "female", style: "capable", pitch: "mid" },
|
|
5124
|
+
{ id: "laomedeia", gender: "female", style: "cheerful", pitch: "mid-high" },
|
|
5125
|
+
{ id: "leda", gender: "female", style: "young", pitch: "mid-high" },
|
|
5126
|
+
{ id: "orus", gender: "male", style: "steady", pitch: "mid-low" },
|
|
5127
|
+
{ id: "puck", gender: "male", style: "cheerful", pitch: "mid" },
|
|
5128
|
+
{ id: "pulcherrima", gender: "genderless", style: "forward", pitch: "mid-high" },
|
|
5129
|
+
{ id: "rasalgethi", gender: "male", style: "intellectual", pitch: "mid" },
|
|
5130
|
+
{ id: "sadachbia", gender: "male", style: "vivid", pitch: "low" },
|
|
5131
|
+
{ id: "sadaltager", gender: "male", style: "knowledgeable", pitch: "mid" },
|
|
5132
|
+
{ id: "schedar", gender: "male", style: "smooth", pitch: "mid-low" },
|
|
5133
|
+
{ id: "sulafat", gender: "female", style: "warm", pitch: "mid" },
|
|
5134
|
+
{ id: "umbriel", gender: "male", style: "smooth", pitch: "low" },
|
|
5135
|
+
{ id: "vindemiatrix", gender: "female", style: "gentle", pitch: "mid" },
|
|
5136
|
+
{ id: "zephyr", gender: "female", style: "bright", pitch: "mid-high" },
|
|
5137
|
+
{ id: "zubenelgenubi", gender: "male", style: "casual", pitch: "mid-low" }
|
|
5138
|
+
];
|
|
5139
|
+
var GEMINI_OMNI_VOICE_PRESET_IDS = GEMINI_OMNI_VOICE_PRESETS.map((v) => v.id);
|
|
5140
|
+
|
|
4925
5141
|
// src/inpaint-region.ts
|
|
4926
5142
|
function band(center) {
|
|
4927
5143
|
if (center < 1 / 3) return "low";
|
|
@@ -4931,10 +5147,10 @@ function band(center) {
|
|
|
4931
5147
|
var VERT = { low: "upper", mid: "middle", high: "lower" };
|
|
4932
5148
|
var HORZ = { low: "left", mid: "center", high: "right" };
|
|
4933
5149
|
function describeMaskRegion(box, image) {
|
|
4934
|
-
const
|
|
5150
|
+
const clamp014 = (n) => Math.max(0, Math.min(1, n));
|
|
4935
5151
|
const round2 = (n) => Math.round(n * 100) / 100;
|
|
4936
|
-
const nx =
|
|
4937
|
-
const ny =
|
|
5152
|
+
const nx = clamp014(box.x / image.width);
|
|
5153
|
+
const ny = clamp014(box.y / image.height);
|
|
4938
5154
|
const normBbox = {
|
|
4939
5155
|
x: round2(nx),
|
|
4940
5156
|
y: round2(ny),
|
|
@@ -5147,20 +5363,20 @@ function buildCreditModelIdentifier(provider, quality, resolution, renderingSpee
|
|
|
5147
5363
|
return provider;
|
|
5148
5364
|
}
|
|
5149
5365
|
function resolveNormalizedImageGen(opts) {
|
|
5150
|
-
const
|
|
5151
|
-
const provider =
|
|
5366
|
+
const str7 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
5367
|
+
const provider = str7(opts.provider) ?? "nano-banana";
|
|
5152
5368
|
const modelId = opts.swapToI2i && opts.refCount > 0 ? T2I_TO_I2I_VARIANT[provider] ?? provider : provider;
|
|
5153
5369
|
const n = normalizeModelInput(modelId, {
|
|
5154
|
-
aspectRatio:
|
|
5155
|
-
resolution:
|
|
5156
|
-
quality:
|
|
5370
|
+
aspectRatio: str7(opts.aspectRatio),
|
|
5371
|
+
resolution: str7(opts.resolution),
|
|
5372
|
+
quality: str7(opts.quality)
|
|
5157
5373
|
});
|
|
5158
5374
|
return {
|
|
5159
5375
|
identifier: buildCreditModelIdentifier(
|
|
5160
5376
|
modelId,
|
|
5161
5377
|
n.quality,
|
|
5162
5378
|
n.resolution,
|
|
5163
|
-
|
|
5379
|
+
str7(opts.renderingSpeed),
|
|
5164
5380
|
void 0,
|
|
5165
5381
|
opts.refCount
|
|
5166
5382
|
),
|
|
@@ -5541,6 +5757,58 @@ function ltxRetakeDurationSec(raw) {
|
|
|
5541
5757
|
return Math.max(LTX_RETAKE_MIN_DURATION_SEC, n);
|
|
5542
5758
|
}
|
|
5543
5759
|
|
|
5760
|
+
// src/tts-capabilities.ts
|
|
5761
|
+
var TTS_PROVIDER_ALIASES = {
|
|
5762
|
+
elevenlabs: "elevenlabs-turbo"
|
|
5763
|
+
};
|
|
5764
|
+
var TTS_FALLBACK_PROVIDER = "elevenlabs-turbo";
|
|
5765
|
+
function canonicalTtsProvider(provider) {
|
|
5766
|
+
return typeof provider === "string" && Object.hasOwn(TTS_PROVIDER_ALIASES, provider) ? TTS_PROVIDER_ALIASES[provider] : provider;
|
|
5767
|
+
}
|
|
5768
|
+
function findTtsCapabilities(provider) {
|
|
5769
|
+
if (typeof provider !== "string" || !provider) return void 0;
|
|
5770
|
+
const id = canonicalTtsProvider(provider);
|
|
5771
|
+
if (!Object.hasOwn(MODEL_CATALOG, id)) return void 0;
|
|
5772
|
+
const entry = MODEL_CATALOG[id];
|
|
5773
|
+
return entry.modes.includes("tts") ? entry.tts : void 0;
|
|
5774
|
+
}
|
|
5775
|
+
function getTtsCapabilities(provider) {
|
|
5776
|
+
return findTtsCapabilities(provider) ?? MODEL_CATALOG[TTS_FALLBACK_PROVIDER].tts;
|
|
5777
|
+
}
|
|
5778
|
+
function ttsSupportsAudioTags(provider) {
|
|
5779
|
+
return getTtsCapabilities(provider).audioTags;
|
|
5780
|
+
}
|
|
5781
|
+
function ttsSupportsSsmlBreaks(provider) {
|
|
5782
|
+
return getTtsCapabilities(provider).ssmlBreaks;
|
|
5783
|
+
}
|
|
5784
|
+
function ttsSupportsStitching(provider) {
|
|
5785
|
+
return getTtsCapabilities(provider).stitching;
|
|
5786
|
+
}
|
|
5787
|
+
function ttsHasLever(provider, lever) {
|
|
5788
|
+
return getTtsCapabilities(provider).levers.includes(lever);
|
|
5789
|
+
}
|
|
5790
|
+
function ttsSupportsTimestamps(provider) {
|
|
5791
|
+
return getTtsCapabilities(provider).timestamps;
|
|
5792
|
+
}
|
|
5793
|
+
function ttsLanguageCodes(provider) {
|
|
5794
|
+
return getTtsCapabilities(provider).languages;
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
// src/credit-estimators/speech.ts
|
|
5798
|
+
var SPEECH_PRICE_UNIT_CHARS = 100;
|
|
5799
|
+
var SPEECH_FLOOR_UNITS = 8;
|
|
5800
|
+
var SPEECH_UNIT_CREDIT_SUFFIX = ":per-100-chars";
|
|
5801
|
+
function speechUnitCreditId(modelId) {
|
|
5802
|
+
return `${canonicalTtsProvider(modelId)}${SPEECH_UNIT_CREDIT_SUFFIX}`;
|
|
5803
|
+
}
|
|
5804
|
+
function speechPriceUnits(chars) {
|
|
5805
|
+
const started = Number.isFinite(chars) && chars > 0 ? Math.ceil(chars / SPEECH_PRICE_UNIT_CHARS) : 0;
|
|
5806
|
+
return Math.max(SPEECH_FLOOR_UNITS, started);
|
|
5807
|
+
}
|
|
5808
|
+
function speechCredits(chars, perUnitCredits) {
|
|
5809
|
+
return speechPriceUnits(chars) * perUnitCredits;
|
|
5810
|
+
}
|
|
5811
|
+
|
|
5544
5812
|
// src/video-duration.ts
|
|
5545
5813
|
function extractVideoDurationFromNode(data) {
|
|
5546
5814
|
if (!data) return void 0;
|
|
@@ -5789,6 +6057,42 @@ var AUDIO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
|
5789
6057
|
// Extract Audio: demuxes a video's audio track to a standalone MP3.
|
|
5790
6058
|
"extract-audio"
|
|
5791
6059
|
]);
|
|
6060
|
+
var IMAGE_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
6061
|
+
"upload-image",
|
|
6062
|
+
"generate-image",
|
|
6063
|
+
"edit-image",
|
|
6064
|
+
"image-to-image",
|
|
6065
|
+
"modify-image",
|
|
6066
|
+
"upscale-image",
|
|
6067
|
+
"remove-background",
|
|
6068
|
+
// extract-frame produces a single still image extracted from a video source.
|
|
6069
|
+
"extract-frame",
|
|
6070
|
+
// generate-mask emits the source image AND a mask PNG; its `image` source
|
|
6071
|
+
// pip is the passthrough (the same image as the input).
|
|
6072
|
+
"generate-mask",
|
|
6073
|
+
// paint-mask emits the hand-painted mask PNG (a plain image at runtime).
|
|
6074
|
+
// Membership is what makes mask targets accept it — mask is an advisory
|
|
6075
|
+
// color, not a gated type.
|
|
6076
|
+
"paint-mask",
|
|
6077
|
+
// reference-sheet's `sheet` is one composited image and `panels` carries
|
|
6078
|
+
// clean reference images; both resolve to image URLs at runtime.
|
|
6079
|
+
"reference-sheet",
|
|
6080
|
+
// reference-board's `image` pip emits a real generated board image.
|
|
6081
|
+
"reference-board",
|
|
6082
|
+
// image-collage composites N images → ONE image.
|
|
6083
|
+
"image-collage",
|
|
6084
|
+
// image-overlay places layers on a base → ONE image.
|
|
6085
|
+
"image-overlay",
|
|
6086
|
+
// 3D Render Pro's `stills` handle carries one PNG per shot of the exported
|
|
6087
|
+
// composition (spread into referenceImageUrls like reference-sheet
|
|
6088
|
+
// `panels`). A validator sees only the source NODE type, so this also makes
|
|
6089
|
+
// its `video` pip droppable on an image input — the handle-blind trade
|
|
6090
|
+
// reference-sheet and split-media already make; the input resolvers route
|
|
6091
|
+
// by handle, so only `stills` becomes an image at runtime. Deliberately NOT
|
|
6092
|
+
// in IMAGE_SOURCE_TYPES on either engine: that set types the node's PRIMARY
|
|
6093
|
+
// asset, and 3D Render Pro's is the MP4.
|
|
6094
|
+
"pro-3d-render"
|
|
6095
|
+
]);
|
|
5792
6096
|
var FAN_OUT_EACH_TYPES = /* @__PURE__ */ new Set([
|
|
5793
6097
|
"list",
|
|
5794
6098
|
"split-text",
|
|
@@ -5816,6 +6120,7 @@ var FAN_OUT_EACH_HANDLES = {
|
|
|
5816
6120
|
// (decided 2026-10-04).
|
|
5817
6121
|
"camera-switch": { each: ["edl"], primary: "edl" }
|
|
5818
6122
|
};
|
|
6123
|
+
var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
|
|
5819
6124
|
var OWN_LIST_NODE_TYPES = /* @__PURE__ */ new Set(["extract-field", "json-process"]);
|
|
5820
6125
|
function ownsItsList(nodeType) {
|
|
5821
6126
|
return typeof nodeType === "string" && OWN_LIST_NODE_TYPES.has(nodeType);
|
|
@@ -5840,7 +6145,19 @@ var FAN_IN_TARGETS = {
|
|
|
5840
6145
|
// Telegram Reply — one message per run, whatever is wired into its text
|
|
5841
6146
|
// input: a list (or a writer that ran once per item) arrives as one
|
|
5842
6147
|
// message, never as a burst of sends to the owner's chat.
|
|
5843
|
-
"telegram-account-send": ["in"]
|
|
6148
|
+
"telegram-account-send": ["in"],
|
|
6149
|
+
// The list operators — they READ the whole list wired into them (their
|
|
6150
|
+
// executors collect every upstream item themselves) and emit a list. Run
|
|
6151
|
+
// once per item by an "each" wire (a Split Text, a List, a node that ran per
|
|
6152
|
+
// item), every iteration saw the same whole list and answered with its
|
|
6153
|
+
// first match: a Filter List fed 11 stories handed 11 copies of story one
|
|
6154
|
+
// downstream, and every paid stage after it ran 11 times on it
|
|
6155
|
+
// (2026-10-06). A list operator is never fanned out, on any wire.
|
|
6156
|
+
"filter-list": "*",
|
|
6157
|
+
deduplicate: "*",
|
|
6158
|
+
"merge-lists": "*",
|
|
6159
|
+
"sort-list": "*",
|
|
6160
|
+
selector: "*"
|
|
5844
6161
|
};
|
|
5845
6162
|
function isFanInNodeType(nodeType) {
|
|
5846
6163
|
return typeof nodeType === "string" && Object.prototype.hasOwnProperty.call(FAN_IN_TARGETS, nodeType);
|
|
@@ -5875,6 +6192,36 @@ function canonicalizeOverrideKeys(nodeType, overrides) {
|
|
|
5875
6192
|
return out ?? overrides;
|
|
5876
6193
|
}
|
|
5877
6194
|
|
|
6195
|
+
// src/render-nodes.ts
|
|
6196
|
+
var outputSettingMedium = (data) => data.output === "audio" ? "audio" : "video";
|
|
6197
|
+
var descriptor = (d) => Object.freeze({ ...d });
|
|
6198
|
+
var RENDER_NODE_TYPES = Object.freeze({
|
|
6199
|
+
"apply-edl": descriptor({
|
|
6200
|
+
mediumOf: outputSettingMedium,
|
|
6201
|
+
creditId: (quality) => applyEdlCreditId(quality),
|
|
6202
|
+
clockMapFrom: "input",
|
|
6203
|
+
ownerOnlyListing: true,
|
|
6204
|
+
latestBatch: true,
|
|
6205
|
+
jsonKind: "transcript"
|
|
6206
|
+
})
|
|
6207
|
+
});
|
|
6208
|
+
var RENDER_NODE_TYPE_IDS = Object.freeze(Object.keys(RENDER_NODE_TYPES));
|
|
6209
|
+
function renderNodeOf(type) {
|
|
6210
|
+
return typeof type === "string" && Object.hasOwn(RENDER_NODE_TYPES, type) ? RENDER_NODE_TYPES[type] : void 0;
|
|
6211
|
+
}
|
|
6212
|
+
function isRenderNodeType(type) {
|
|
6213
|
+
return renderNodeOf(type) !== void 0;
|
|
6214
|
+
}
|
|
6215
|
+
function rendersLatestBatch(type) {
|
|
6216
|
+
return renderNodeOf(type)?.latestBatch === true;
|
|
6217
|
+
}
|
|
6218
|
+
function rendersTranscriptJson(type) {
|
|
6219
|
+
return renderNodeOf(type)?.jsonKind === "transcript";
|
|
6220
|
+
}
|
|
6221
|
+
var OWNER_ONLY_LISTING_RENDER_TYPES = Object.freeze(
|
|
6222
|
+
RENDER_NODE_TYPE_IDS.filter((t2) => RENDER_NODE_TYPES[t2].ownerOnlyListing)
|
|
6223
|
+
);
|
|
6224
|
+
|
|
5878
6225
|
// src/presentation-utils.ts
|
|
5879
6226
|
var INPUT_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
5880
6227
|
"text-prompt",
|
|
@@ -6004,13 +6351,14 @@ var VIDEO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
|
|
|
6004
6351
|
"video-upscale",
|
|
6005
6352
|
"add-captions",
|
|
6006
6353
|
"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
|
-
|
|
6354
|
+
// A render (Apply EDL) renders an EDL into video OR audio. Its medium is
|
|
6355
|
+
// decided at run time (DYNAMIC_PRODUCER_TYPES), so getOutputType would answer
|
|
6356
|
+
// "data" and a published app would render the cut as a JSON blob. Declaring
|
|
6357
|
+
// every render here — as the voice-changer/dubbing precedent does for their
|
|
6358
|
+
// default medium — makes the classifier answer "video" (the common case; an
|
|
6359
|
+
// audio-only cut still plays in a video element). Asserted in
|
|
6360
|
+
// producer-types.test.ts.
|
|
6361
|
+
...RENDER_NODE_TYPE_IDS
|
|
6014
6362
|
]);
|
|
6015
6363
|
var AUDIO_OUTPUT_TYPES = /* @__PURE__ */ new Set([
|
|
6016
6364
|
"text-to-speech",
|
|
@@ -6166,8 +6514,16 @@ var INPUT_FIELD_MAP = {
|
|
|
6166
6514
|
"music-mood": { key: "emotion", type: "select" },
|
|
6167
6515
|
"instrumentation": { key: "production", type: "select" },
|
|
6168
6516
|
"voice-character": { key: "timbre", type: "select" },
|
|
6169
|
-
"voice-delivery": { key: "archetype", type: "select" }
|
|
6517
|
+
"voice-delivery": { key: "archetype", type: "select" },
|
|
6518
|
+
// --- UGC (Cloud) ---
|
|
6519
|
+
"ugc-creator": { key: "source", type: "select" }
|
|
6520
|
+
};
|
|
6521
|
+
var INPUT_FIELD_EXTRA_KEYS = {
|
|
6522
|
+
"ugc-creator": [{ key: "gender", type: "select" }, { key: "photoUrl", type: "image-url" }]
|
|
6170
6523
|
};
|
|
6524
|
+
function getInputFieldExtraKeys(nodeType) {
|
|
6525
|
+
return Object.hasOwn(INPUT_FIELD_EXTRA_KEYS, nodeType) ? INPUT_FIELD_EXTRA_KEYS[nodeType] : [];
|
|
6526
|
+
}
|
|
6171
6527
|
function getInputFieldSchema(nodeType) {
|
|
6172
6528
|
return INPUT_FIELD_MAP[nodeType];
|
|
6173
6529
|
}
|
|
@@ -6222,6 +6578,32 @@ function cleanOrphanedItems(items, nodeIds) {
|
|
|
6222
6578
|
});
|
|
6223
6579
|
}
|
|
6224
6580
|
|
|
6581
|
+
// src/picker-restrictions.ts
|
|
6582
|
+
var valuesOf = (v) => (Array.isArray(v) ? v : [v]).filter((x) => x !== void 0 && x !== null && x !== "").map(String);
|
|
6583
|
+
function findRestrictedPickerValue(input) {
|
|
6584
|
+
if (!input.cardMeta || !input.inputValues) return null;
|
|
6585
|
+
for (const node of input.nodes) {
|
|
6586
|
+
const meta = input.cardMeta[node.id];
|
|
6587
|
+
const submitted = input.inputValues[node.id];
|
|
6588
|
+
if (!meta || !submitted) continue;
|
|
6589
|
+
const rules = [];
|
|
6590
|
+
const rep = node.type ? INPUT_FIELD_MAP[node.type]?.key : void 0;
|
|
6591
|
+
if (rep && meta.pickerAllowedValues && meta.pickerAllowedValues.length > 0) rules.push([rep, meta.pickerAllowedValues]);
|
|
6592
|
+
for (const [field, allowed] of Object.entries(meta.pickerAllowedValuesByField ?? {})) {
|
|
6593
|
+
if (allowed.length > 0) rules.push([field, allowed]);
|
|
6594
|
+
}
|
|
6595
|
+
for (const [field, allowed] of rules) {
|
|
6596
|
+
for (const [key, raw] of Object.entries(submitted)) {
|
|
6597
|
+
if (canonicalExposedFieldKey(node.type, key) !== field) continue;
|
|
6598
|
+
for (const value of valuesOf(raw)) {
|
|
6599
|
+
if (!allowed.includes(value)) return `Invalid value for ${field}: ${value}. Allowed: ${allowed.join(", ")}`;
|
|
6600
|
+
}
|
|
6601
|
+
}
|
|
6602
|
+
}
|
|
6603
|
+
}
|
|
6604
|
+
return null;
|
|
6605
|
+
}
|
|
6606
|
+
|
|
6225
6607
|
// src/clone-utils.ts
|
|
6226
6608
|
var ITER_CLONE_PATTERN = /_iter_\d+$/;
|
|
6227
6609
|
function isExpandedClone(node) {
|
|
@@ -6281,14 +6663,14 @@ function isCollectInEdge(e) {
|
|
|
6281
6663
|
return (e.targetHandle ?? COLLECT_IN_HANDLE) === COLLECT_IN_HANDLE;
|
|
6282
6664
|
}
|
|
6283
6665
|
function computeAggregateLanes(nodeId, wiredTypes, buckets, edges) {
|
|
6284
|
-
const
|
|
6285
|
-
for (const t2 of presentTypes(buckets))
|
|
6666
|
+
const present2 = new Set(wiredTypes);
|
|
6667
|
+
for (const t2 of presentTypes(buckets)) present2.add(t2);
|
|
6286
6668
|
for (const e of edges) {
|
|
6287
6669
|
if (e.source !== nodeId) continue;
|
|
6288
6670
|
const lane = parseGroupHandle(e.sourceHandle);
|
|
6289
|
-
if (lane)
|
|
6671
|
+
if (lane) present2.add(lane);
|
|
6290
6672
|
}
|
|
6291
|
-
return AGGREGATEABLE_TYPES.filter((t2) =>
|
|
6673
|
+
return AGGREGATEABLE_TYPES.filter((t2) => present2.has(t2));
|
|
6292
6674
|
}
|
|
6293
6675
|
|
|
6294
6676
|
// src/llm-models.ts
|
|
@@ -7570,9 +7952,9 @@ function evalNode(node, input, ctx) {
|
|
|
7570
7952
|
return input;
|
|
7571
7953
|
}
|
|
7572
7954
|
if (typeof input === "object" && input !== null) {
|
|
7573
|
-
const
|
|
7574
|
-
ctx.objectSourcedArrays.add(
|
|
7575
|
-
return
|
|
7955
|
+
const arr2 = [input];
|
|
7956
|
+
ctx.objectSourcedArrays.add(arr2);
|
|
7957
|
+
return arr2;
|
|
7576
7958
|
}
|
|
7577
7959
|
throw new Error(`Cannot iterate over ${typeof input}`);
|
|
7578
7960
|
}
|
|
@@ -7704,10 +8086,10 @@ function evalNode(node, input, ctx) {
|
|
|
7704
8086
|
}
|
|
7705
8087
|
}
|
|
7706
8088
|
}
|
|
7707
|
-
function markExpanded(
|
|
7708
|
-
ctx.expandedArrays.add(
|
|
7709
|
-
if (objectSourced) ctx.objectSourcedArrays.add(
|
|
7710
|
-
return
|
|
8089
|
+
function markExpanded(arr2, objectSourced, ctx) {
|
|
8090
|
+
ctx.expandedArrays.add(arr2);
|
|
8091
|
+
if (objectSourced) ctx.objectSourcedArrays.add(arr2);
|
|
8092
|
+
return arr2;
|
|
7711
8093
|
}
|
|
7712
8094
|
function isExpandedArray(node, val, ctx) {
|
|
7713
8095
|
if (!Array.isArray(val)) return false;
|
|
@@ -7825,8 +8207,8 @@ function combineSameLabelRefs(candidates) {
|
|
|
7825
8207
|
for (const c of candidates) {
|
|
7826
8208
|
if (c.category < 0) continue;
|
|
7827
8209
|
const key = canonicalVarName(c.label);
|
|
7828
|
-
const
|
|
7829
|
-
if (
|
|
8210
|
+
const arr2 = byLabel.get(key);
|
|
8211
|
+
if (arr2) arr2.push(c);
|
|
7830
8212
|
else byLabel.set(key, [c]);
|
|
7831
8213
|
}
|
|
7832
8214
|
const combined = /* @__PURE__ */ new Map();
|
|
@@ -8633,6 +9015,8 @@ var NON_PROMPT_TEXT_LANES = {
|
|
|
8633
9015
|
silence: ["edit-plan"],
|
|
8634
9016
|
offsets: ["edit-plan"],
|
|
8635
9017
|
qrText: ["image-overlay"],
|
|
9018
|
+
layerPlan: ["video-overlay"],
|
|
9019
|
+
captionPlan: ["add-captions"],
|
|
8636
9020
|
transition: ["slideshow"],
|
|
8637
9021
|
// Content Recipe's `link` carries the post's address (inputs.sourceLink), not
|
|
8638
9022
|
// the material it analyzes — a list of links fanned through it must not be
|
|
@@ -8655,6 +9039,16 @@ function compactWithRows(aligned) {
|
|
|
8655
9039
|
});
|
|
8656
9040
|
return { items, rowIndices };
|
|
8657
9041
|
}
|
|
9042
|
+
function pickHeldRow(rows, edge, iterating) {
|
|
9043
|
+
if (rows.length === 0) return { kind: "unaffected" };
|
|
9044
|
+
const mode = edge?.outputMode ?? "each";
|
|
9045
|
+
const held = (row) => isBlank(row) ? { kind: "none" } : { kind: "value", value: row };
|
|
9046
|
+
if (mode === "item") return held(rows[resolveIndex(edge?.itemIndex ?? "1", rows.length)]);
|
|
9047
|
+
if (mode.startsWith("item:")) return held(rows[parseInt(mode.slice(5), 10)]);
|
|
9048
|
+
if (mode !== "each" || iterating || isDefaultSelectorConfig(edge)) return { kind: "unaffected" };
|
|
9049
|
+
const kept = compactWithRows(selectListItems([...rows], edge)).items;
|
|
9050
|
+
return kept.length > 0 ? { kind: "value", value: kept[0] } : { kind: "none" };
|
|
9051
|
+
}
|
|
8658
9052
|
function liveRowColumn(rows, colIndex) {
|
|
8659
9053
|
return rows.filter((row) => row.some((cell) => !isBlank(cell))).map((row) => typeof row[colIndex] === "string" ? row[colIndex].trim() : "");
|
|
8660
9054
|
}
|
|
@@ -8663,7 +9057,7 @@ function resolveListFanOut(candidates, nodeType) {
|
|
|
8663
9057
|
const held = (c) => compactWithRows(c.aligned).items.length;
|
|
8664
9058
|
const primary = candidates.reduce((best, c) => held(c) > held(best) ? c : best);
|
|
8665
9059
|
const space = candidates.filter((c) => c.aligned.length === primary.aligned.length);
|
|
8666
|
-
const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned);
|
|
9060
|
+
const feedsPrompt = (c) => fanOutTextFeedsPrompt(nodeType, c.targetHandle) && isTextList(c.aligned, nodeType, c.targetHandle);
|
|
8667
9061
|
const driver = feedsPrompt(primary) ? primary : space.find(feedsPrompt) ?? primary;
|
|
8668
9062
|
const rowIndices = [];
|
|
8669
9063
|
for (let row = 0; row < primary.aligned.length; row++) {
|
|
@@ -8676,11 +9070,21 @@ function resolveListFanOut(candidates, nodeType) {
|
|
|
8676
9070
|
};
|
|
8677
9071
|
}
|
|
8678
9072
|
function isFanOutUrlItem(item) {
|
|
8679
|
-
|
|
9073
|
+
const s = item.trim();
|
|
9074
|
+
if (s.length === 0 || /\s/.test(s) || s.startsWith("{") || s.startsWith("[")) return false;
|
|
9075
|
+
return s.startsWith("http") || /\.(png|jpg|jpeg|webp|gif|mp4|mov|webm|mp3|wav|ogg)(\?|$)/i.test(s);
|
|
9076
|
+
}
|
|
9077
|
+
var URL_ITEM_IS_TEXT_LANES = {
|
|
9078
|
+
"collection-write": ["in"]
|
|
9079
|
+
};
|
|
9080
|
+
function fanOutUrlItemIsText(nodeType, targetHandle) {
|
|
9081
|
+
const lanes = URL_ITEM_IS_TEXT_LANES[nodeType ?? ""];
|
|
9082
|
+
return lanes !== void 0 && lanes.includes(targetHandle ?? "");
|
|
8680
9083
|
}
|
|
8681
|
-
function isTextList(aligned) {
|
|
9084
|
+
function isTextList(aligned, nodeType, targetHandle) {
|
|
8682
9085
|
const first = aligned.find((v) => !isBlank(v));
|
|
8683
|
-
|
|
9086
|
+
if (first === void 0) return false;
|
|
9087
|
+
return !isFanOutUrlItem(first) || fanOutUrlItemIsText(nodeType, targetHandle);
|
|
8684
9088
|
}
|
|
8685
9089
|
function planFanOut(fanOut, nodeType, nodeData) {
|
|
8686
9090
|
const items = expandItemsWithRepeat(fanOut?.items, nodeType, nodeData);
|
|
@@ -9961,7 +10365,13 @@ var NODE_MAPPABLE_FIELDS = {
|
|
|
9961
10365
|
"edit-video-pro": ["prompt"],
|
|
9962
10366
|
"video-analysis": ["analysisFocus", "youtubeUrl"],
|
|
9963
10367
|
"video-to-video": ["prompt"],
|
|
9964
|
-
|
|
10368
|
+
// + the two neighbour-text fields (continuity across clips): a wired Text node can feed
|
|
10369
|
+
// what is spoken before / after this clip, and {} injection works in them as in directText.
|
|
10370
|
+
"text-to-speech": ["directText", "previousText", "nextText"],
|
|
10371
|
+
// Save to Collection: the record's own fields, each mappable from an upstream
|
|
10372
|
+
// node or a {Ref}; the link field is `link` (node-data keys ending in url are
|
|
10373
|
+
// locked by the Copilot's deny-list).
|
|
10374
|
+
"collection-write": ["title", "text", "link", "dedupeKey"],
|
|
9965
10375
|
"lip-sync": ["prompt"],
|
|
9966
10376
|
"generate-music": ["prompt", "lyrics", "genre", "mood"],
|
|
9967
10377
|
"text-to-audio": ["prompt"],
|
|
@@ -10183,6 +10593,136 @@ function nodeFeedsAnything(nodes, edges, nodeId) {
|
|
|
10183
10593
|
return (buildFeedMaps(nodes, edges).children.get(nodeId) ?? []).length > 0;
|
|
10184
10594
|
}
|
|
10185
10595
|
|
|
10596
|
+
// src/preview-gate.ts
|
|
10597
|
+
var PREVIEW_RENDER_NODE_TYPES = new Set(RENDER_NODE_TYPE_IDS);
|
|
10598
|
+
var PREVIEW_REVIEW_REQUIRED = "preview_review_required";
|
|
10599
|
+
var PREVIEW_RENDER_NESTED = "preview_render_nested";
|
|
10600
|
+
var NO_SAVED_RENDER_STAMPS = {
|
|
10601
|
+
output: () => void 0,
|
|
10602
|
+
batch: () => void 0
|
|
10603
|
+
};
|
|
10604
|
+
var SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
|
|
10605
|
+
var dataOf = (n) => n.data && typeof n.data === "object" ? n.data : {};
|
|
10606
|
+
var isPreviewStamp = (stamp) => stamp?.quality === "proxy";
|
|
10607
|
+
function rendersAsPreview(node) {
|
|
10608
|
+
return PREVIEW_RENDER_NODE_TYPES.has(node.type ?? "") && dataOf(node).quality === "proxy";
|
|
10609
|
+
}
|
|
10610
|
+
var TELEPORT_TYPES = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
|
|
10611
|
+
var isTeleport = (n) => TELEPORT_TYPES.has(n?.type ?? "");
|
|
10612
|
+
var outputModeOf = (edge) => {
|
|
10613
|
+
const mode = edge.data && typeof edge.data === "object" ? edge.data.outputMode : void 0;
|
|
10614
|
+
return typeof mode === "string" ? mode : void 0;
|
|
10615
|
+
};
|
|
10616
|
+
function readsEach(render, consumerEdge, renderHandle) {
|
|
10617
|
+
return (outputModeOf(consumerEdge) ?? defaultEdgeOutputMode(render.type, renderHandle)) === "each";
|
|
10618
|
+
}
|
|
10619
|
+
function savedPreviewConsumers(render, children, nodeById, edges, reader) {
|
|
10620
|
+
const data = dataOf(render);
|
|
10621
|
+
const scalarIsPreview = isPreviewStamp(reader.output(data));
|
|
10622
|
+
const batch = reader.batch(data);
|
|
10623
|
+
const eachIsPreview = batch ? batch.some(isPreviewStamp) : scalarIsPreview;
|
|
10624
|
+
const out = /* @__PURE__ */ new Set();
|
|
10625
|
+
const visited = /* @__PURE__ */ new Set([render.id]);
|
|
10626
|
+
const walk3 = (from, renderHandle, isRender) => {
|
|
10627
|
+
const wires = edges.filter((e) => e.source === from);
|
|
10628
|
+
for (const child of children.get(from) ?? []) {
|
|
10629
|
+
const wiresToChild = wires.filter((e) => e.target === child);
|
|
10630
|
+
if (isTeleport(nodeById.get(child))) {
|
|
10631
|
+
if (visited.has(child)) continue;
|
|
10632
|
+
visited.add(child);
|
|
10633
|
+
if (isRender && wiresToChild.length > 0) for (const w of wiresToChild) walk3(child, w.sourceHandle, false);
|
|
10634
|
+
else walk3(child, renderHandle, false);
|
|
10635
|
+
continue;
|
|
10636
|
+
}
|
|
10637
|
+
const preview = wiresToChild.length === 0 ? scalarIsPreview : wiresToChild.some(
|
|
10638
|
+
(e) => readsEach(render, e, isRender ? e.sourceHandle : renderHandle) ? eachIsPreview : scalarIsPreview
|
|
10639
|
+
);
|
|
10640
|
+
if (preview) out.add(child);
|
|
10641
|
+
}
|
|
10642
|
+
};
|
|
10643
|
+
walk3(render.id, void 0, true);
|
|
10644
|
+
return [...out];
|
|
10645
|
+
}
|
|
10646
|
+
function previewStops(nodes, edges, run = {}) {
|
|
10647
|
+
const nodeById = new Map(nodes.map((n) => [n.id, n]));
|
|
10648
|
+
const executes = run.executes ?? ((id) => {
|
|
10649
|
+
const n = nodeById.get(id);
|
|
10650
|
+
return !!n && dataOf(n).skipped !== true;
|
|
10651
|
+
});
|
|
10652
|
+
const reader = run.savedRenders ?? SAVED_RENDER_STAMPS;
|
|
10653
|
+
const { children } = buildFeedMaps(nodes, edges);
|
|
10654
|
+
const previewRenderIds = [];
|
|
10655
|
+
const savedPreviewRenderIds = [];
|
|
10656
|
+
const seeds = [];
|
|
10657
|
+
for (const n of nodes) {
|
|
10658
|
+
if (!PREVIEW_RENDER_NODE_TYPES.has(n.type ?? "")) continue;
|
|
10659
|
+
const kids = children.get(n.id) ?? [];
|
|
10660
|
+
if (executes(n.id)) {
|
|
10661
|
+
if (!rendersAsPreview(n)) continue;
|
|
10662
|
+
previewRenderIds.push(n.id);
|
|
10663
|
+
seeds.push(...kids);
|
|
10664
|
+
} else {
|
|
10665
|
+
const consumers = savedPreviewConsumers(n, children, nodeById, edges, reader);
|
|
10666
|
+
if (consumers.length === 0) continue;
|
|
10667
|
+
savedPreviewRenderIds.push(n.id);
|
|
10668
|
+
seeds.push(...consumers);
|
|
10669
|
+
}
|
|
10670
|
+
}
|
|
10671
|
+
const gated = /* @__PURE__ */ new Set();
|
|
10672
|
+
const queue = [...seeds];
|
|
10673
|
+
while (queue.length > 0) {
|
|
10674
|
+
const id = queue.shift();
|
|
10675
|
+
if (gated.has(id)) continue;
|
|
10676
|
+
gated.add(id);
|
|
10677
|
+
for (const next of children.get(id) ?? []) if (!gated.has(next)) queue.push(next);
|
|
10678
|
+
}
|
|
10679
|
+
return { previewRenderIds, savedPreviewRenderIds, gatedNodeIds: gated };
|
|
10680
|
+
}
|
|
10681
|
+
function previewGatedNodeIds(nodes, edges, run) {
|
|
10682
|
+
return new Set(previewStops(nodes, edges, run).gatedNodeIds);
|
|
10683
|
+
}
|
|
10684
|
+
function holdsPreviewRender(nodes, edges, run) {
|
|
10685
|
+
const stops = previewStops(nodes, edges, run);
|
|
10686
|
+
return stops.previewRenderIds.length > 0 || stops.savedPreviewRenderIds.length > 0;
|
|
10687
|
+
}
|
|
10688
|
+
var RUN_OVERRIDE_CLEARED_FIELDS = [
|
|
10689
|
+
"generatedResults",
|
|
10690
|
+
"activeResultIndex",
|
|
10691
|
+
"generatedImageUrl",
|
|
10692
|
+
"generatedVideoUrl",
|
|
10693
|
+
"generatedAudioUrl",
|
|
10694
|
+
"generatedText"
|
|
10695
|
+
];
|
|
10696
|
+
function withRunOverrides(nodes, overrides) {
|
|
10697
|
+
if (!overrides) return [...nodes];
|
|
10698
|
+
return nodes.map((n) => {
|
|
10699
|
+
const fields = overrides[n.id];
|
|
10700
|
+
if (!fields) return n;
|
|
10701
|
+
const merged = mergeNodeInputOverrides(n.type ?? void 0, { ...dataOf(n) }, { ...fields });
|
|
10702
|
+
for (const key of RUN_OVERRIDE_CLEARED_FIELDS) delete merged[key];
|
|
10703
|
+
return { ...n, data: merged };
|
|
10704
|
+
});
|
|
10705
|
+
}
|
|
10706
|
+
|
|
10707
|
+
// src/run-continuation.ts
|
|
10708
|
+
var CONTINUATION_NOT_FOUND = "continuation_not_found";
|
|
10709
|
+
var CONTINUATION_WORKFLOW_MISMATCH = "continuation_workflow_mismatch";
|
|
10710
|
+
var CONTINUATION_VERSION_MISMATCH = "continuation_version_mismatch";
|
|
10711
|
+
var CONTINUATION_NOT_COMPLETED = "continuation_not_completed";
|
|
10712
|
+
var CONTINUATION_SUBSET_REQUIRED = "continuation_subset_required";
|
|
10713
|
+
var RUN_CONTINUATION_CODES = [
|
|
10714
|
+
CONTINUATION_NOT_FOUND,
|
|
10715
|
+
CONTINUATION_WORKFLOW_MISMATCH,
|
|
10716
|
+
CONTINUATION_VERSION_MISMATCH,
|
|
10717
|
+
CONTINUATION_NOT_COMPLETED,
|
|
10718
|
+
CONTINUATION_SUBSET_REQUIRED
|
|
10719
|
+
];
|
|
10720
|
+
|
|
10721
|
+
// src/render-final.ts
|
|
10722
|
+
var RENDER_FINAL_NODE_NOT_FOUND = "render_final_node_not_found";
|
|
10723
|
+
var RENDER_FINAL_NOT_A_RENDER = "render_final_not_a_render";
|
|
10724
|
+
var RENDER_FINAL_CODES = [RENDER_FINAL_NODE_NOT_FOUND, RENDER_FINAL_NOT_A_RENDER];
|
|
10725
|
+
|
|
10186
10726
|
// src/schedule-rules.ts
|
|
10187
10727
|
var SCHEDULE_RULE_KINDS = ["minutes", "hours", "days", "weeks", "months", "cron"];
|
|
10188
10728
|
var SCHEDULE_EVERY_LIMITS = {
|
|
@@ -10378,8 +10918,8 @@ function matchesCronField(field, value, min, max) {
|
|
|
10378
10918
|
if (start === null || end === null) return false;
|
|
10379
10919
|
return value >= start && value <= end;
|
|
10380
10920
|
}
|
|
10381
|
-
const
|
|
10382
|
-
return !Number.isNaN(
|
|
10921
|
+
const num3 = parseInt(field, 10);
|
|
10922
|
+
return !Number.isNaN(num3) && num3 === value;
|
|
10383
10923
|
}
|
|
10384
10924
|
function parseRange(range) {
|
|
10385
10925
|
const parts = range.split("-");
|
|
@@ -11088,6 +11628,213 @@ function normalizeSavedPostTags(tags) {
|
|
|
11088
11628
|
return Array.from(new Set(clean2)).slice(0, SAVED_POST_MAX_TAGS);
|
|
11089
11629
|
}
|
|
11090
11630
|
|
|
11631
|
+
// src/collections.ts
|
|
11632
|
+
var COLLECTION_NAME_MAX = 80;
|
|
11633
|
+
var COLLECTION_DESCRIPTION_MAX = 500;
|
|
11634
|
+
var COLLECTION_RECORD_TITLE_MAX = 500;
|
|
11635
|
+
var COLLECTION_RECORD_TEXT_MAX = 2e4;
|
|
11636
|
+
var COLLECTION_RECORD_URL_MAX = 2e3;
|
|
11637
|
+
var COLLECTION_RECORD_MEDIA_MAX = 20;
|
|
11638
|
+
var COLLECTION_RECORD_FIELDS_MAX = 50;
|
|
11639
|
+
var COLLECTION_RECORD_FIELDS_BYTES_MAX = 16 * 1024;
|
|
11640
|
+
var COLLECTION_DEDUPE_KEY_MAX = 300;
|
|
11641
|
+
var COLLECTION_IDEMPOTENCY_KEY_MAX = 200;
|
|
11642
|
+
var COLLECTIONS_PAGE_MAX = 100;
|
|
11643
|
+
var COLLECTIONS_PAGE_DEFAULT = 50;
|
|
11644
|
+
var COLLECTION_HEADLINE_MAX = 120;
|
|
11645
|
+
var COLLECTION_MEDIA_TYPES = ["image", "video", "audio", "link"];
|
|
11646
|
+
var COLLECTION_TIER_CAPS = {
|
|
11647
|
+
free: { collections: 3, records: 500 },
|
|
11648
|
+
payg: { collections: 10, records: 5e3 },
|
|
11649
|
+
basic: { collections: 10, records: 5e3 },
|
|
11650
|
+
standard: { collections: 30, records: 2e4 },
|
|
11651
|
+
pro: { collections: 100, records: 1e5 },
|
|
11652
|
+
business: { collections: 300, records: 25e4 },
|
|
11653
|
+
enterprise: { collections: 300, records: 25e4 }
|
|
11654
|
+
};
|
|
11655
|
+
function collectionCapsForTier(tier) {
|
|
11656
|
+
return tier ? COLLECTION_TIER_CAPS[tier] : void 0;
|
|
11657
|
+
}
|
|
11658
|
+
var COLLECTION_DIGEST_SEPARATOR = "\n\n---\n\n";
|
|
11659
|
+
var COLLECTION_READ_WINDOW_HOURS_MAX = 720;
|
|
11660
|
+
var COLLECTION_READ_LIMIT_MAX = 200;
|
|
11661
|
+
function collectionReadSince(amount, unit, now = Date.now()) {
|
|
11662
|
+
const hours = Math.min(COLLECTION_READ_WINDOW_HOURS_MAX, Math.max(1, Math.floor(Number.isFinite(amount) ? amount : 24)) * (unit === "days" ? 24 : 1));
|
|
11663
|
+
return new Date(now - hours * 36e5).toISOString();
|
|
11664
|
+
}
|
|
11665
|
+
var isRecord2 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
11666
|
+
var str2 = (v) => typeof v === "string" && v.trim().length > 0 ? v : void 0;
|
|
11667
|
+
var isScalar = (v) => typeof v === "string" || typeof v === "number" && Number.isFinite(v) || typeof v === "boolean";
|
|
11668
|
+
function isCollectionUrl(v) {
|
|
11669
|
+
return typeof v === "string" && /^https?:\/\/\S+$/i.test(v) && v.length <= COLLECTION_RECORD_URL_MAX;
|
|
11670
|
+
}
|
|
11671
|
+
var isHttpUrl = isCollectionUrl;
|
|
11672
|
+
function clampChars(text, max) {
|
|
11673
|
+
if (text.length <= max) return text;
|
|
11674
|
+
const points2 = Array.from(text);
|
|
11675
|
+
return points2.length <= max ? text : points2.slice(0, max).join("");
|
|
11676
|
+
}
|
|
11677
|
+
function normalizeDedupeKey(raw) {
|
|
11678
|
+
if (typeof raw === "number" && Number.isFinite(raw)) raw = String(raw);
|
|
11679
|
+
if (typeof raw !== "string") return null;
|
|
11680
|
+
const compact = raw.trim().replace(/\s+/g, " ");
|
|
11681
|
+
const key = clampChars(looksLikeLink(compact) ? canonicalUrl(compact) : compact.toLowerCase(), COLLECTION_DEDUPE_KEY_MAX).trim();
|
|
11682
|
+
return key.length > 0 ? key : null;
|
|
11683
|
+
}
|
|
11684
|
+
var looksLikeLink = (s) => isCollectionUrl(s);
|
|
11685
|
+
var COLLECTION_EVICT_MAX_PER_WRITE = 100;
|
|
11686
|
+
function canonicalUrl(url) {
|
|
11687
|
+
try {
|
|
11688
|
+
return new URL(url).href;
|
|
11689
|
+
} catch {
|
|
11690
|
+
return url;
|
|
11691
|
+
}
|
|
11692
|
+
}
|
|
11693
|
+
function isCollectionMedia(v) {
|
|
11694
|
+
return isRecord2(v) && COLLECTION_MEDIA_TYPES.includes(v.type) && isHttpUrl(v.url) && (v.posterUrl === void 0 || v.posterUrl === null || isHttpUrl(v.posterUrl));
|
|
11695
|
+
}
|
|
11696
|
+
function normalizeCollectionMedia(value) {
|
|
11697
|
+
if (!Array.isArray(value)) return [];
|
|
11698
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11699
|
+
const out = [];
|
|
11700
|
+
for (const item of value) {
|
|
11701
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
|
|
11702
|
+
if (!isCollectionMedia(item) || seen.has(item.url)) continue;
|
|
11703
|
+
seen.add(item.url);
|
|
11704
|
+
out.push({ type: item.type, url: item.url, ...item.posterUrl ? { posterUrl: item.posterUrl } : {} });
|
|
11705
|
+
}
|
|
11706
|
+
return out;
|
|
11707
|
+
}
|
|
11708
|
+
function normalizeCollectionFields(value) {
|
|
11709
|
+
if (!isRecord2(value)) return {};
|
|
11710
|
+
const out = {};
|
|
11711
|
+
let bytes = 2;
|
|
11712
|
+
let count = 0;
|
|
11713
|
+
for (const [key, v] of Object.entries(value)) {
|
|
11714
|
+
if (count >= COLLECTION_RECORD_FIELDS_MAX) break;
|
|
11715
|
+
if (!isScalar(v) || key.length === 0 || key.length > 100) continue;
|
|
11716
|
+
const entry = JSON.stringify(key) + ":" + JSON.stringify(v) + ",";
|
|
11717
|
+
if (bytes + entry.length > COLLECTION_RECORD_FIELDS_BYTES_MAX) break;
|
|
11718
|
+
out[key] = v;
|
|
11719
|
+
bytes += entry.length;
|
|
11720
|
+
count += 1;
|
|
11721
|
+
}
|
|
11722
|
+
return out;
|
|
11723
|
+
}
|
|
11724
|
+
function collectionRecordHeadline(record) {
|
|
11725
|
+
const title = (typeof record.title === "string" ? record.title : "").trim();
|
|
11726
|
+
if (title) return clampChars(title, COLLECTION_HEADLINE_MAX);
|
|
11727
|
+
const line = (typeof record.text === "string" ? record.text : "").split(/\r?\n/).map((l) => l.trim()).find((l) => l.length > 0);
|
|
11728
|
+
if (line) return line.length > COLLECTION_HEADLINE_MAX ? `${clampChars(line, COLLECTION_HEADLINE_MAX - 1)}\u2026` : line;
|
|
11729
|
+
return typeof record.url === "string" ? record.url : "";
|
|
11730
|
+
}
|
|
11731
|
+
function collectionRecordsDigest(records, format = "headlines") {
|
|
11732
|
+
const rows = records.filter((r) => typeof r === "object" && r !== null);
|
|
11733
|
+
const str7 = (v) => typeof v === "string" ? v : "";
|
|
11734
|
+
if (format === "full") {
|
|
11735
|
+
return rows.map((r) => {
|
|
11736
|
+
const head = collectionRecordHeadline(r);
|
|
11737
|
+
const body = str7(r.text).trim();
|
|
11738
|
+
const lines = [head ? `### ${head}` : "", body && body !== head ? body : "", str7(r.url)].filter((l) => l.length > 0);
|
|
11739
|
+
return lines.join("\n");
|
|
11740
|
+
}).filter((block) => block.length > 0).join(COLLECTION_DIGEST_SEPARATOR);
|
|
11741
|
+
}
|
|
11742
|
+
return rows.map((r) => {
|
|
11743
|
+
const parts = [collectionRecordHeadline(r)];
|
|
11744
|
+
const created = str7(r.createdAt);
|
|
11745
|
+
if (created) parts.push(created.slice(0, 10));
|
|
11746
|
+
const url = str7(r.url);
|
|
11747
|
+
if (url && url !== parts[0]) parts.push(url);
|
|
11748
|
+
return `- ${parts.filter((p) => p.length > 0).join(" \xB7 ")}`;
|
|
11749
|
+
}).join("\n");
|
|
11750
|
+
}
|
|
11751
|
+
var TITLE_KEYS = ["title", "headline", "name", "subject"];
|
|
11752
|
+
var TEXT_KEYS = ["text", "body", "caption", "description", "content", "summary", "dek"];
|
|
11753
|
+
var URL_KEYS = ["url", "postUrl", "link", "href", "permalink"];
|
|
11754
|
+
var DEDUPE_KEYS = ["slug", "postId", "externalId", "id"];
|
|
11755
|
+
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);
|
|
11756
|
+
var IMAGE_KEYS = ["imageUrl", "thumbnailUrl", "image", "thumbnail"];
|
|
11757
|
+
var VIDEO_KEYS = ["videoUrl", "video"];
|
|
11758
|
+
var AUDIO_KEYS = ["audioUrl", "audio"];
|
|
11759
|
+
var MEDIA_SHAPED_KEYS = /* @__PURE__ */ new Set(["media", ...IMAGE_KEYS, ...VIDEO_KEYS, ...AUDIO_KEYS]);
|
|
11760
|
+
function firstString(item, keys) {
|
|
11761
|
+
for (const key of keys) {
|
|
11762
|
+
const v = str2(item[key]);
|
|
11763
|
+
if (v !== void 0) return v;
|
|
11764
|
+
}
|
|
11765
|
+
return void 0;
|
|
11766
|
+
}
|
|
11767
|
+
function firstUrl(item, keys) {
|
|
11768
|
+
for (const key of keys) {
|
|
11769
|
+
const v = item[key];
|
|
11770
|
+
if (typeof v === "string" && isHttpUrl(v.trim())) return v.trim();
|
|
11771
|
+
}
|
|
11772
|
+
return null;
|
|
11773
|
+
}
|
|
11774
|
+
function mediaFromItem(item) {
|
|
11775
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11776
|
+
const out = [];
|
|
11777
|
+
const push = (m) => {
|
|
11778
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) return false;
|
|
11779
|
+
if (!seen.has(m.url)) {
|
|
11780
|
+
seen.add(m.url);
|
|
11781
|
+
out.push(m);
|
|
11782
|
+
}
|
|
11783
|
+
return true;
|
|
11784
|
+
};
|
|
11785
|
+
if (Array.isArray(item.media)) {
|
|
11786
|
+
for (const entry of item.media) {
|
|
11787
|
+
if (out.length >= COLLECTION_RECORD_MEDIA_MAX) break;
|
|
11788
|
+
if (!isRecord2(entry)) continue;
|
|
11789
|
+
const type = entry.type === "photo" ? "image" : entry.type;
|
|
11790
|
+
const poster = isHttpUrl(entry.posterUrl) ? entry.posterUrl : void 0;
|
|
11791
|
+
if (type === "video" && !isHttpUrl(entry.url) && poster) {
|
|
11792
|
+
push({ type: "image", url: poster });
|
|
11793
|
+
continue;
|
|
11794
|
+
}
|
|
11795
|
+
if (isCollectionMedia({ ...entry, type })) push({ type, url: entry.url, ...poster ? { posterUrl: poster } : {} });
|
|
11796
|
+
}
|
|
11797
|
+
} else if (isRecord2(item.media)) {
|
|
11798
|
+
const m = item.media;
|
|
11799
|
+
if (isHttpUrl(m.videoUrl)) push({ type: "video", url: m.videoUrl, ...isHttpUrl(m.thumbnailUrl) ? { posterUrl: m.thumbnailUrl } : {} });
|
|
11800
|
+
else if (isHttpUrl(m.thumbnailUrl)) push({ type: "image", url: m.thumbnailUrl });
|
|
11801
|
+
}
|
|
11802
|
+
for (const key of IMAGE_KEYS) if (isHttpUrl(item[key]) && !push({ type: "image", url: item[key] })) break;
|
|
11803
|
+
for (const key of VIDEO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "video", url: item[key] })) break;
|
|
11804
|
+
for (const key of AUDIO_KEYS) if (isHttpUrl(item[key]) && !push({ type: "audio", url: item[key] })) break;
|
|
11805
|
+
return out;
|
|
11806
|
+
}
|
|
11807
|
+
function ingestRecordFromJson(item) {
|
|
11808
|
+
if (!isRecord2(item)) {
|
|
11809
|
+
const text2 = typeof item === "string" ? item : item === void 0 || item === null ? "" : JSON.stringify(item);
|
|
11810
|
+
return { title: "", text: clampChars(text2, COLLECTION_RECORD_TEXT_MAX), url: null, media: [], fields: {}, dedupeKey: null };
|
|
11811
|
+
}
|
|
11812
|
+
const title = clampChars((firstString(item, TITLE_KEYS) ?? "").trim(), COLLECTION_RECORD_TITLE_MAX);
|
|
11813
|
+
const text = clampChars(firstString(item, TEXT_KEYS) ?? "", COLLECTION_RECORD_TEXT_MAX);
|
|
11814
|
+
const url = firstUrl(item, URL_KEYS);
|
|
11815
|
+
const media = mediaFromItem(item);
|
|
11816
|
+
const taken = /* @__PURE__ */ new Set([...TITLE_KEYS, ...TEXT_KEYS, ...URL_KEYS, ...MEDIA_SHAPED_KEYS]);
|
|
11817
|
+
const fields = {};
|
|
11818
|
+
let kept = 0;
|
|
11819
|
+
for (const [key, v] of Object.entries(item)) {
|
|
11820
|
+
if (kept >= COLLECTION_RECORD_FIELDS_MAX) break;
|
|
11821
|
+
if (taken.has(key)) continue;
|
|
11822
|
+
if (isScalar(v)) fields[key] = v;
|
|
11823
|
+
else if (isRecord2(v) && typeof v.name === "string" && v.name.trim()) fields[key] = v.name;
|
|
11824
|
+
else continue;
|
|
11825
|
+
kept += 1;
|
|
11826
|
+
}
|
|
11827
|
+
const dedupeSource = url ?? DEDUPE_KEYS.filter((k) => isDedupeValue(k, item[k])).map((k) => item[k])[0];
|
|
11828
|
+
return {
|
|
11829
|
+
title,
|
|
11830
|
+
text,
|
|
11831
|
+
url,
|
|
11832
|
+
media,
|
|
11833
|
+
fields: normalizeCollectionFields(fields),
|
|
11834
|
+
dedupeKey: normalizeDedupeKey(dedupeSource)
|
|
11835
|
+
};
|
|
11836
|
+
}
|
|
11837
|
+
|
|
11091
11838
|
// src/competitors.ts
|
|
11092
11839
|
var COMPETITOR_ACCOUNT_KEYS = ["tiktok", "instagram", "youtube", "x", "linkedin", "meta_ads"];
|
|
11093
11840
|
var COMPETITOR_ABOUT_PLATFORMS = ["tiktok", "instagram", "youtube", "x", "reddit", "linkedin"];
|
|
@@ -12444,35 +13191,49 @@ function togglePick(current, id, maxSelected) {
|
|
|
12444
13191
|
return [...current.slice(1), id];
|
|
12445
13192
|
}
|
|
12446
13193
|
|
|
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;
|
|
13194
|
+
// src/tts-neighbour-text.ts
|
|
13195
|
+
var TTS_NEIGHBOUR_TEXT_MAX_CHARS = 1e3;
|
|
13196
|
+
function usableText(value) {
|
|
13197
|
+
if (typeof value !== "string") return void 0;
|
|
13198
|
+
const trimmed2 = value.trim();
|
|
13199
|
+
return trimmed2 ? trimmed2 : void 0;
|
|
12454
13200
|
}
|
|
12455
|
-
function
|
|
13201
|
+
function normalizeTtsNeighbourText(options) {
|
|
13202
|
+
const out = {};
|
|
13203
|
+
const previous = usableText(options?.previousText);
|
|
13204
|
+
if (previous !== void 0) {
|
|
13205
|
+
out.previousText = previous.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? previous.slice(-TTS_NEIGHBOUR_TEXT_MAX_CHARS) : previous;
|
|
13206
|
+
}
|
|
13207
|
+
const next = usableText(options?.nextText);
|
|
13208
|
+
if (next !== void 0) {
|
|
13209
|
+
out.nextText = next.length > TTS_NEIGHBOUR_TEXT_MAX_CHARS ? next.slice(0, TTS_NEIGHBOUR_TEXT_MAX_CHARS) : next;
|
|
13210
|
+
}
|
|
13211
|
+
return out;
|
|
13212
|
+
}
|
|
13213
|
+
|
|
13214
|
+
// src/dialogue-capabilities.ts
|
|
13215
|
+
function findDialogueCapabilities(provider) {
|
|
12456
13216
|
if (typeof provider !== "string" || !provider) return void 0;
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
return entry.modes.includes("tts") ? entry.tts : void 0;
|
|
13217
|
+
if (!Object.hasOwn(MODEL_CATALOG, provider)) return void 0;
|
|
13218
|
+
const entry = MODEL_CATALOG[provider];
|
|
13219
|
+
return entry.modes.includes("dialogue") ? entry.tts : void 0;
|
|
12461
13220
|
}
|
|
12462
|
-
function
|
|
12463
|
-
return
|
|
13221
|
+
function dialogueProviderOf(provider) {
|
|
13222
|
+
return findDialogueCapabilities(provider) ? provider : DEFAULT_DIALOGUE_PROVIDER;
|
|
12464
13223
|
}
|
|
12465
|
-
function
|
|
12466
|
-
return
|
|
13224
|
+
function getDialogueCapabilities(provider) {
|
|
13225
|
+
return MODEL_CATALOG[dialogueProviderOf(provider)].tts;
|
|
12467
13226
|
}
|
|
12468
|
-
function
|
|
12469
|
-
return
|
|
13227
|
+
function dialogueHasLever(provider, lever) {
|
|
13228
|
+
return getDialogueCapabilities(provider).levers.includes(lever);
|
|
12470
13229
|
}
|
|
12471
|
-
function
|
|
12472
|
-
return
|
|
13230
|
+
function dialogueSupportsTimestamps(provider) {
|
|
13231
|
+
return getDialogueCapabilities(provider).timestamps;
|
|
12473
13232
|
}
|
|
12474
|
-
function
|
|
12475
|
-
|
|
13233
|
+
function dialogueStabilityAccepted(provider, value) {
|
|
13234
|
+
if (!Number.isFinite(value) || value < 0 || value > 1) return false;
|
|
13235
|
+
const steps = getDialogueCapabilities(provider).stabilitySteps;
|
|
13236
|
+
return steps ? steps.includes(value) : true;
|
|
12476
13237
|
}
|
|
12477
13238
|
|
|
12478
13239
|
// src/safety-retry-policy.ts
|
|
@@ -12580,31 +13341,188 @@ function resolveCaptionLevers(style, look, explicit, fontSize) {
|
|
|
12580
13341
|
return resolveCaptionLook(effective, explicit, fontSize);
|
|
12581
13342
|
}
|
|
12582
13343
|
|
|
12583
|
-
// src/
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
13344
|
+
// src/caption-plan.ts
|
|
13345
|
+
var nonNegative = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
|
|
13346
|
+
function parseCaptionPlan(raw) {
|
|
13347
|
+
let value = raw;
|
|
13348
|
+
if (typeof raw === "string") {
|
|
13349
|
+
try {
|
|
13350
|
+
value = JSON.parse(raw);
|
|
13351
|
+
} catch {
|
|
13352
|
+
return { error: "Caption plan: not valid JSON." };
|
|
13353
|
+
}
|
|
13354
|
+
}
|
|
13355
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return { error: "Caption plan: not an object." };
|
|
13356
|
+
const o = value;
|
|
13357
|
+
if (o.v !== 1) return { error: "Caption plan: v must be 1." };
|
|
13358
|
+
if (typeof o.hookText !== "string") return { error: "Caption plan: hookText must be text." };
|
|
13359
|
+
for (const f of ["hookEndMs", "bodyEndMs"]) {
|
|
13360
|
+
if (!nonNegative(o[f])) return { error: `Caption plan: ${f} must be a non-negative number.` };
|
|
13361
|
+
}
|
|
13362
|
+
if (o.videoDurationMs !== void 0 && !nonNegative(o.videoDurationMs)) {
|
|
13363
|
+
return { error: "Caption plan: videoDurationMs must be a non-negative number." };
|
|
13364
|
+
}
|
|
13365
|
+
if (o.language !== void 0 && typeof o.language !== "string") return { error: "Caption plan: language must be text." };
|
|
13366
|
+
if (!Array.isArray(o.captions)) return { error: "Caption plan: captions must be a list." };
|
|
13367
|
+
const captions = [];
|
|
13368
|
+
for (let i = 0; i < o.captions.length; i++) {
|
|
13369
|
+
const c = o.captions[i];
|
|
13370
|
+
if (!c || typeof c !== "object" || typeof c.text !== "string" || !nonNegative(c.startMs) || !nonNegative(c.endMs)) {
|
|
13371
|
+
return { error: `Caption plan: captions[${i}] needs text, startMs and endMs.` };
|
|
13372
|
+
}
|
|
13373
|
+
if (c.endMs < c.startMs) return { error: `Caption plan: captions[${i}] ends before it starts.` };
|
|
13374
|
+
captions.push({ text: c.text, startMs: c.startMs, endMs: c.endMs });
|
|
13375
|
+
}
|
|
13376
|
+
return {
|
|
13377
|
+
plan: {
|
|
13378
|
+
v: 1,
|
|
13379
|
+
hookText: o.hookText,
|
|
13380
|
+
hookEndMs: o.hookEndMs,
|
|
13381
|
+
bodyEndMs: o.bodyEndMs,
|
|
13382
|
+
captions,
|
|
13383
|
+
...o.videoDurationMs !== void 0 ? { videoDurationMs: o.videoDurationMs } : {},
|
|
13384
|
+
...o.language !== void 0 ? { language: o.language } : {}
|
|
13385
|
+
}
|
|
13386
|
+
};
|
|
12588
13387
|
}
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
var
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
13388
|
+
|
|
13389
|
+
// src/supported-fonts.ts
|
|
13390
|
+
var SUPPORTED_FONT_NAMES = [
|
|
13391
|
+
"Inter",
|
|
13392
|
+
"Roboto",
|
|
13393
|
+
"Open Sans",
|
|
13394
|
+
"Montserrat",
|
|
13395
|
+
"Poppins",
|
|
13396
|
+
"Raleway",
|
|
13397
|
+
"Nunito",
|
|
13398
|
+
"Lato",
|
|
13399
|
+
"Playfair Display",
|
|
13400
|
+
"Merriweather",
|
|
13401
|
+
"Lora",
|
|
13402
|
+
"EB Garamond",
|
|
13403
|
+
"Bebas Neue",
|
|
13404
|
+
"Oswald",
|
|
13405
|
+
"Anton",
|
|
13406
|
+
"Dancing Script",
|
|
13407
|
+
"Pacifico",
|
|
13408
|
+
"Caveat",
|
|
13409
|
+
"Roboto Mono",
|
|
13410
|
+
"Fira Code",
|
|
13411
|
+
"Rubik",
|
|
13412
|
+
"Heebo",
|
|
13413
|
+
"Cairo",
|
|
13414
|
+
"Tajawal"
|
|
13415
|
+
];
|
|
13416
|
+
|
|
13417
|
+
// src/caption-segment-schema.ts
|
|
13418
|
+
var captionFontWeightSchema = zod.z.number().int().min(100).max(900).multipleOf(100);
|
|
13419
|
+
var nonBlankCaptionText = zod.z.string().min(1).refine((t2) => /\S/.test(t2), { message: "text must contain a non-whitespace character" });
|
|
13420
|
+
var captionInputSchema = zod.z.object({
|
|
13421
|
+
text: zod.z.string(),
|
|
13422
|
+
// startMs/endMs are the visibility window and drive the highlight; timestampMs
|
|
13423
|
+
// is the word timestamp used by tiktok-words token timing; confidence is
|
|
13424
|
+
// metadata, ignored by rendering. timestampMs/confidence default to null.
|
|
13425
|
+
startMs: zod.z.number().min(0),
|
|
13426
|
+
endMs: zod.z.number().min(0),
|
|
13427
|
+
timestampMs: zod.z.number().min(0).nullable().default(null),
|
|
13428
|
+
confidence: zod.z.number().min(0).max(1).nullable().default(null)
|
|
13429
|
+
});
|
|
13430
|
+
var captionSegmentInputSchema = zod.z.object({
|
|
13431
|
+
startMs: zod.z.number().min(0),
|
|
13432
|
+
endMs: zod.z.number().min(0),
|
|
13433
|
+
style: zod.z.enum(ALL_CAPTION_STYLES).optional(),
|
|
13434
|
+
position: zod.z.enum(["bottom", "top", "center"]).optional(),
|
|
13435
|
+
fontSize: zod.z.number().min(12).max(200).optional(),
|
|
13436
|
+
color: zod.z.string().optional(),
|
|
13437
|
+
backgroundColor: zod.z.string().optional(),
|
|
13438
|
+
// A named look preset (outline/clean); explicit levers below override it.
|
|
13439
|
+
look: zod.z.enum(CAPTION_LOOK_IDS).optional(),
|
|
13440
|
+
fontFamily: zod.z.enum(SUPPORTED_FONT_NAMES).optional(),
|
|
13441
|
+
fontWeight: captionFontWeightSchema.optional(),
|
|
13442
|
+
strokeColor: zod.z.string().optional(),
|
|
13443
|
+
strokeWidth: zod.z.number().min(0).max(40).optional(),
|
|
13444
|
+
highlightColor: zod.z.string().optional(),
|
|
13445
|
+
uppercase: zod.z.boolean().optional(),
|
|
13446
|
+
positionY: zod.z.number().min(0).max(100).optional(),
|
|
13447
|
+
animate: zod.z.boolean().optional(),
|
|
13448
|
+
maxWordsPerLine: zod.z.number().int().min(CAPTION_MAX_WORDS_PER_LINE_MIN).max(CAPTION_MAX_WORDS_PER_LINE_MAX).optional(),
|
|
13449
|
+
text: nonBlankCaptionText.optional(),
|
|
13450
|
+
captions: zod.z.array(captionInputSchema).optional()
|
|
13451
|
+
}).refine((s) => s.endMs > s.startMs, { message: "segment endMs must be greater than startMs" });
|
|
13452
|
+
var CAPTION_SEGMENT_SCHEMA_KEYS = Object.keys(captionSegmentInputSchema.shape);
|
|
13453
|
+
function findSegmentOverlap(segments) {
|
|
13454
|
+
const sorted = [...segments].sort((a, b) => a.startMs - b.startMs);
|
|
13455
|
+
for (let i = 1; i < sorted.length; i++) {
|
|
13456
|
+
if (sorted[i].startMs < sorted[i - 1].endMs) {
|
|
13457
|
+
return `segments overlap: [${sorted[i - 1].startMs}, ${sorted[i - 1].endMs}) and [${sorted[i].startMs}, ${sorted[i].endMs})`;
|
|
13458
|
+
}
|
|
13459
|
+
}
|
|
13460
|
+
return null;
|
|
13461
|
+
}
|
|
13462
|
+
|
|
13463
|
+
// src/add-captions-plan.ts
|
|
13464
|
+
function captionPlanBodyLevers(nodeData, leverKeys) {
|
|
13465
|
+
const levers = {};
|
|
13466
|
+
for (const k of leverKeys) {
|
|
13467
|
+
const v = nodeData[k];
|
|
13468
|
+
if (v !== void 0 && v !== null) levers[k] = v;
|
|
13469
|
+
}
|
|
13470
|
+
return Object.keys(levers).length > 0 ? levers : void 0;
|
|
13471
|
+
}
|
|
13472
|
+
function styleCaptionPlan(raw, nodeData, styler) {
|
|
13473
|
+
const parsed = parseCaptionPlan(raw);
|
|
13474
|
+
if ("error" in parsed) return { error: parsed.error };
|
|
13475
|
+
const bodyLevers = captionPlanBodyLevers(nodeData, styler.leverKeys);
|
|
13476
|
+
const { segments } = styler.segmentsFor(parsed.plan, bodyLevers ? { bodyLevers } : void 0);
|
|
13477
|
+
for (let i = 0; i < segments.length; i++) {
|
|
13478
|
+
const r = captionSegmentInputSchema.safeParse(segments[i]);
|
|
13479
|
+
if (!r.success) return { error: `Caption plan: segment ${i + 1}: ${r.error.issues[0]?.message ?? "invalid"}.` };
|
|
13480
|
+
}
|
|
13481
|
+
const overlap = findSegmentOverlap(segments);
|
|
13482
|
+
if (overlap) return { error: `Caption plan: ${overlap}.` };
|
|
13483
|
+
return { segments };
|
|
13484
|
+
}
|
|
13485
|
+
|
|
13486
|
+
// src/node-pass-through.ts
|
|
13487
|
+
var present = (u) => typeof u === "string" && u.length > 0;
|
|
13488
|
+
function combineVideosPassThrough(videoUrls) {
|
|
13489
|
+
const urls = videoUrls.filter(present);
|
|
13490
|
+
return urls.length === 1 ? { videoUrl: urls[0], warning: "single_input" } : null;
|
|
13491
|
+
}
|
|
13492
|
+
function videoOverlayPassThrough(input) {
|
|
13493
|
+
if (!input.planWired || input.layerCount > 0 || !present(input.videoUrl)) return null;
|
|
13494
|
+
return { videoUrl: input.videoUrl, warning: "no_layers" };
|
|
13495
|
+
}
|
|
13496
|
+
function captionPlanPassThrough(input) {
|
|
13497
|
+
if (!input.planWired || input.segmentCount > 0 || !present(input.videoUrl)) return null;
|
|
13498
|
+
return { videoUrl: input.videoUrl, warning: "no_captions" };
|
|
13499
|
+
}
|
|
13500
|
+
|
|
13501
|
+
// src/transcribe-preflight.ts
|
|
13502
|
+
function transcribeWordTimestampsRefusal(provider) {
|
|
13503
|
+
const lane = provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
|
|
13504
|
+
if (transcribeLaneSupportsWordTimestamps(lane)) return null;
|
|
13505
|
+
return `the "${lane}" engine does not return word timings \u2014 pick ${transcribeProvidersWithWordTimestamps().join(" or ")}`;
|
|
13506
|
+
}
|
|
13507
|
+
var TRANSCRIBE_JSON_OUT = "json";
|
|
13508
|
+
var TRANSCRIPT_IN = "transcript";
|
|
13509
|
+
var RENDER_JSON_OUT = "json";
|
|
13510
|
+
function findWordlessTranscriptFeeds(nodes, edges) {
|
|
13511
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
13512
|
+
const isSkipped = (n) => !n || n.data?.skipped === true;
|
|
13513
|
+
const out = [];
|
|
13514
|
+
for (const node of nodes) {
|
|
13515
|
+
if (node.type !== "transcribe" || isSkipped(node)) continue;
|
|
13516
|
+
const provider = typeof node.data?.provider === "string" && node.data.provider || DEFAULT_TRANSCRIBE_NODE_PROVIDER;
|
|
13517
|
+
const refusal = transcribeWordTimestampsRefusal(provider);
|
|
13518
|
+
if (!refusal) continue;
|
|
13519
|
+
const seen = /* @__PURE__ */ new Set();
|
|
13520
|
+
const frontier = [{ id: node.id, outHandle: TRANSCRIBE_JSON_OUT }];
|
|
13521
|
+
while (frontier.length > 0) {
|
|
13522
|
+
const { id, outHandle } = frontier.pop();
|
|
13523
|
+
for (const e of edges) {
|
|
13524
|
+
if (e.source !== id || (e.sourceHandle ?? null) !== outHandle || e.targetHandle !== TRANSCRIPT_IN) continue;
|
|
13525
|
+
const target = byId.get(e.target);
|
|
12608
13526
|
if (isSkipped(target)) continue;
|
|
12609
13527
|
if (target.type === "add-captions") {
|
|
12610
13528
|
out.push({
|
|
@@ -12613,9 +13531,9 @@ function findWordlessTranscriptFeeds(nodes, edges) {
|
|
|
12613
13531
|
provider,
|
|
12614
13532
|
message: `Captions need word timings, but ${refusal}.`
|
|
12615
13533
|
});
|
|
12616
|
-
} else if (target.type
|
|
13534
|
+
} else if (rendersTranscriptJson(target.type) && !seen.has(target.id)) {
|
|
12617
13535
|
seen.add(target.id);
|
|
12618
|
-
frontier.push({ id: target.id, outHandle:
|
|
13536
|
+
frontier.push({ id: target.id, outHandle: RENDER_JSON_OUT });
|
|
12619
13537
|
}
|
|
12620
13538
|
}
|
|
12621
13539
|
}
|
|
@@ -12780,9 +13698,16 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
12780
13698
|
// Row-aligned twin of __listResults (Extract Field, List output) — read only
|
|
12781
13699
|
// by the fan-out so two lists cut from one array pair by row.
|
|
12782
13700
|
"__alignedListResults",
|
|
13701
|
+
// A render's fan-out row stamps, row-aligned with __listResults: each row's
|
|
13702
|
+
// take identity, and the clip every row was sent for (a failed row too).
|
|
13703
|
+
"__listResultStamps",
|
|
12783
13704
|
// List fan-out window flag (abandon-guard exemption). Set/cleared by
|
|
12784
13705
|
// executeNodeForList — purely execution-related, never user-edited.
|
|
12785
13706
|
"__listRunning",
|
|
13707
|
+
// Why the last server run skipped this node (`empty_input`): a chip on the
|
|
13708
|
+
// card for the run that just ended, never a saved result — also in
|
|
13709
|
+
// TRANSIENT_RUNTIME_KEYS below.
|
|
13710
|
+
"__runSkipReason",
|
|
12786
13711
|
// One token per paid run still out on this node that no executor mark
|
|
12787
13712
|
// covers (the editor's `withRunInFlight`, around each paid call outside the
|
|
12788
13713
|
// executors). Purely execution-related, never user-edited; also in
|
|
@@ -12849,6 +13774,12 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
12849
13774
|
"searchResults",
|
|
12850
13775
|
"pickedIds",
|
|
12851
13776
|
"searchWarnings",
|
|
13777
|
+
// Save to Collection: how the last run ended for this node (inserted /
|
|
13778
|
+
// duplicate / replayed) and how many old records the cap evicted. RESULTS of
|
|
13779
|
+
// a run — Clear results wipes them, and a template, a preset or a run-only
|
|
13780
|
+
// patch never carries them as configuration.
|
|
13781
|
+
"lastOutcome",
|
|
13782
|
+
"lastEvicted",
|
|
12852
13783
|
// When the editor's "Clear results" last emptied this node (ISO time). Not a
|
|
12853
13784
|
// result and not config: bookkeeping that tells the load-time recovery lanes
|
|
12854
13785
|
// "this node is empty ON PURPOSE" — without it, every reload reads an empty
|
|
@@ -12878,6 +13809,7 @@ var TRANSIENT_RUNTIME_KEYS = /* @__PURE__ */ new Set([
|
|
|
12878
13809
|
"__listTotal",
|
|
12879
13810
|
"__listCompleted",
|
|
12880
13811
|
"__listRunning",
|
|
13812
|
+
"__runSkipReason",
|
|
12881
13813
|
// A paid run still out, held by the editor tab that started it. Never
|
|
12882
13814
|
// saved, so a reload, which has no such run, starts without one.
|
|
12883
13815
|
"__runsInFlight",
|
|
@@ -15500,6 +16432,24 @@ function resolveAudioCrossfadeCurve(id) {
|
|
|
15500
16432
|
return CURVES_BY_ID.get(id)?.ffmpeg ?? "tri";
|
|
15501
16433
|
}
|
|
15502
16434
|
|
|
16435
|
+
// src/fan-out-meta.ts
|
|
16436
|
+
function fanOutItemMeta(output) {
|
|
16437
|
+
const w = output?.clipWarnings;
|
|
16438
|
+
const d = output?.durationSec;
|
|
16439
|
+
return {
|
|
16440
|
+
warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
|
|
16441
|
+
durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
|
|
16442
|
+
};
|
|
16443
|
+
}
|
|
16444
|
+
function clipNotesFrom(meta, single) {
|
|
16445
|
+
const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
|
|
16446
|
+
return rows.map((m, i) => ({
|
|
16447
|
+
clip: i + 1,
|
|
16448
|
+
warnings: m?.warnings ?? [],
|
|
16449
|
+
...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
|
|
16450
|
+
}));
|
|
16451
|
+
}
|
|
16452
|
+
|
|
15503
16453
|
// src/suno-track-sources.ts
|
|
15504
16454
|
var SUNO_TRACK_SOURCE_TYPES = /* @__PURE__ */ new Set([
|
|
15505
16455
|
"suno-generate",
|
|
@@ -15616,6 +16566,20 @@ function nodeStateMayCarryOutput(status) {
|
|
|
15616
16566
|
return status !== void 0 && OUTPUT_BEARING_NODE_STATUSES.has(status);
|
|
15617
16567
|
}
|
|
15618
16568
|
|
|
16569
|
+
// src/execution-outcome.ts
|
|
16570
|
+
var EMPTY_INPUT = "empty_input";
|
|
16571
|
+
function countEmptyInputSkips(nodeStates) {
|
|
16572
|
+
let count = 0;
|
|
16573
|
+
for (const state of Object.values(nodeStates ?? {})) {
|
|
16574
|
+
if (state && state.status === "skipped" && state.skipReason === EMPTY_INPUT) count += 1;
|
|
16575
|
+
}
|
|
16576
|
+
return count;
|
|
16577
|
+
}
|
|
16578
|
+
function executionOutcome(status, nodeStates) {
|
|
16579
|
+
if (status !== "completed") return void 0;
|
|
16580
|
+
return countEmptyInputSkips(nodeStates) > 0 ? "nothing_new" : "succeeded";
|
|
16581
|
+
}
|
|
16582
|
+
|
|
15619
16583
|
// src/normalize-node-params.ts
|
|
15620
16584
|
var MODEL_PARAM_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
15621
16585
|
"generate-image",
|
|
@@ -16340,6 +17304,10 @@ var ENUM_TARGETS = [
|
|
|
16340
17304
|
[LIP_SYNC_PROVIDERS, "lip-sync"],
|
|
16341
17305
|
[FACE_SWAP_PROVIDERS, "face-swap"],
|
|
16342
17306
|
[TTS_PROVIDERS, "text-to-speech"],
|
|
17307
|
+
// A dialogue model's id is the node's `provider`: without this row the Models
|
|
17308
|
+
// tab would create a BARE dialogue node, which runs as the default (v3) whatever
|
|
17309
|
+
// the user picked.
|
|
17310
|
+
[DIALOGUE_PROVIDERS, "text-to-dialogue"],
|
|
16343
17311
|
[TEXT_TO_AUDIO_PROVIDERS, "text-to-audio"],
|
|
16344
17312
|
[TRANSCRIBE_PROVIDERS, "transcribe"],
|
|
16345
17313
|
[MUSIC_PROVIDERS, "suno-generate"]
|
|
@@ -16463,34 +17431,6 @@ var AUDIO_FX_REVERB_PRESETS = /* @__PURE__ */ new Set([
|
|
|
16463
17431
|
"outdoor"
|
|
16464
17432
|
]);
|
|
16465
17433
|
|
|
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
17434
|
// src/image-overlay-shapes.ts
|
|
16495
17435
|
var OVERLAY_SHAPES = [
|
|
16496
17436
|
"rect",
|
|
@@ -16709,7 +17649,8 @@ var VIDEO_OVERLAY_ERROR_CODES = [
|
|
|
16709
17649
|
"time_out_of_range",
|
|
16710
17650
|
"end_before_start",
|
|
16711
17651
|
"fit_without_aspect",
|
|
16712
|
-
"field_out_of_bounds"
|
|
17652
|
+
"field_out_of_bounds",
|
|
17653
|
+
"invalid_layer_plan"
|
|
16713
17654
|
];
|
|
16714
17655
|
var badge = (anchor, sx, sy) => ({
|
|
16715
17656
|
anchor,
|
|
@@ -16779,13 +17720,13 @@ function sameShallow(a, b) {
|
|
|
16779
17720
|
function expandVideoOverlayLayer(raw) {
|
|
16780
17721
|
const obj = asLayer(raw);
|
|
16781
17722
|
const layer = obj ? clean(obj) : {};
|
|
16782
|
-
const
|
|
17723
|
+
const present2 = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => layer[f] !== void 0);
|
|
16783
17724
|
let out;
|
|
16784
17725
|
if (isVideoOverlayPresetId(layer.preset)) {
|
|
16785
17726
|
const box = videoOverlayPresetBox(layer.preset, layer.corner);
|
|
16786
17727
|
out = { ...box, ...layer };
|
|
16787
|
-
if (
|
|
16788
|
-
} else if (
|
|
17728
|
+
if (present2.some((f) => layer[f] !== box[f])) delete out.preset;
|
|
17729
|
+
} else if (present2.length === 0) {
|
|
16789
17730
|
out = { ...DEFAULT_VIDEO_OVERLAY_LAYER, ...videoOverlayPresetBox("corner-badge", layer.corner), ...layer };
|
|
16790
17731
|
} else if (layer.anchor === void 0 || layer.width === void 0) {
|
|
16791
17732
|
return raw;
|
|
@@ -16861,11 +17802,12 @@ function normalizeVideoOverlayNodes(nodes, edges) {
|
|
|
16861
17802
|
});
|
|
16862
17803
|
return changed ? out : nodes;
|
|
16863
17804
|
}
|
|
17805
|
+
var PLAN_LAYER_Z_BASE = 1e3;
|
|
16864
17806
|
var isSlot = (v) => typeof v === "number" && Number.isInteger(v) && v >= 1;
|
|
16865
17807
|
var isIndex = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
16866
17808
|
function videoOverlayRenderOrder(layers) {
|
|
16867
17809
|
return layers.map((l, i) => {
|
|
16868
|
-
const own = isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
|
|
17810
|
+
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
17811
|
return { i, z: typeof l?.zIndex === "number" && Number.isFinite(l.zIndex) ? l.zIndex : own };
|
|
16870
17812
|
}).sort((a, b) => a.z - b.z || a.i - b.i).map((e) => e.i);
|
|
16871
17813
|
}
|
|
@@ -16941,6 +17883,7 @@ function hasDrawableVideoOverlayBox(layer) {
|
|
|
16941
17883
|
return outOfBounds(l) === null;
|
|
16942
17884
|
}
|
|
16943
17885
|
function validateVideoOverlayRequest(body) {
|
|
17886
|
+
if (body.planError) return { ok: false, code: "invalid_layer_plan", params: {} };
|
|
16944
17887
|
const layers = Array.isArray(body.layers) ? body.layers : [];
|
|
16945
17888
|
if (layers.length === 0) return { ok: false, code: "no_layers", params: {} };
|
|
16946
17889
|
if (layers.length > VIDEO_OVERLAY_MAX_LAYERS) {
|
|
@@ -16953,6 +17896,7 @@ function validateVideoOverlayRequest(body) {
|
|
|
16953
17896
|
code,
|
|
16954
17897
|
layer: i,
|
|
16955
17898
|
...typeof l.slot === "number" ? { slot: l.slot } : {},
|
|
17899
|
+
...typeof l.planLayer === "number" ? { planLayer: l.planLayer } : {},
|
|
16956
17900
|
params
|
|
16957
17901
|
});
|
|
16958
17902
|
const boxFields = VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== void 0 && l[f] !== null);
|
|
@@ -16979,16 +17923,33 @@ var MESSAGES = {
|
|
|
16979
17923
|
time_out_of_range: (p) => `${p.field} must be between 0 and ${p.max} s`,
|
|
16980
17924
|
end_before_start: (p) => `end (${p.end} s) must be after start (${p.start} s)`,
|
|
16981
17925
|
fit_without_aspect: () => "baseFit and backgroundColor need an outputAspect",
|
|
16982
|
-
field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})
|
|
17926
|
+
field_out_of_bounds: (p) => `${p.field} is out of range (allowed: ${p.allowed})`,
|
|
17927
|
+
invalid_layer_plan: () => "the layer plan must be a list of layers"
|
|
16983
17928
|
};
|
|
17929
|
+
var PLAN_LAYER_WITHOUT_IMAGE = "no image \u2014 set imageUrl on this layer in the plan.";
|
|
16984
17930
|
function videoOverlayLayerLabel(ref) {
|
|
17931
|
+
if (typeof ref.planLayer === "number") return `Plan layer ${ref.planLayer}`;
|
|
16985
17932
|
return typeof ref.slot === "number" ? `Layer ${ref.slot}` : typeof ref.layer === "number" ? `layers[${ref.layer}]` : "";
|
|
16986
17933
|
}
|
|
16987
17934
|
function formatVideoOverlayError(issue2) {
|
|
16988
17935
|
const label = videoOverlayLayerLabel(issue2);
|
|
16989
|
-
const text = MESSAGES[issue2.code](issue2.params);
|
|
17936
|
+
const text = issue2.code === "layer_without_image" && typeof issue2.planLayer === "number" ? PLAN_LAYER_WITHOUT_IMAGE : MESSAGES[issue2.code](issue2.params);
|
|
16990
17937
|
return label ? `${label}: ${text}` : text;
|
|
16991
17938
|
}
|
|
17939
|
+
function parseVideoOverlayLayerPlan(raw) {
|
|
17940
|
+
let value = raw;
|
|
17941
|
+
if (typeof raw === "string") {
|
|
17942
|
+
try {
|
|
17943
|
+
value = JSON.parse(raw);
|
|
17944
|
+
} catch {
|
|
17945
|
+
return { error: "invalid_layer_plan" };
|
|
17946
|
+
}
|
|
17947
|
+
}
|
|
17948
|
+
if (!Array.isArray(value) || !value.every((l) => l !== null && typeof l === "object" && !Array.isArray(l))) {
|
|
17949
|
+
return { error: "invalid_layer_plan" };
|
|
17950
|
+
}
|
|
17951
|
+
return { layers: value };
|
|
17952
|
+
}
|
|
16992
17953
|
function assembleVideoOverlayRequest(input) {
|
|
16993
17954
|
const stored = Array.isArray(input.data.layers) ? input.data.layers : [];
|
|
16994
17955
|
const wired = input.wiredImageUrls.slice(0, VIDEO_OVERLAY_HANDLE_IDS.length);
|
|
@@ -17005,13 +17966,19 @@ function assembleVideoOverlayRequest(input) {
|
|
|
17005
17966
|
const outputAspect = isVideoOverlayOutputAspect(input.data.outputAspect) ? input.data.outputAspect : void 0;
|
|
17006
17967
|
const baseFit = isFit(input.data.baseFit) ? input.data.baseFit : void 0;
|
|
17007
17968
|
const backgroundColor = typeof input.data.backgroundColor === "string" && HEX6.test(input.data.backgroundColor) ? input.data.backgroundColor : void 0;
|
|
17008
|
-
|
|
17009
|
-
videoUrl: input.videoUrl,
|
|
17010
|
-
layers,
|
|
17969
|
+
const rest = {
|
|
17011
17970
|
...outputAspect ? { outputAspect } : {},
|
|
17012
17971
|
...baseFit ? { baseFit } : {},
|
|
17013
17972
|
...backgroundColor ? { backgroundColor } : {}
|
|
17014
17973
|
};
|
|
17974
|
+
if (input.planLayers === void 0) return { videoUrl: input.videoUrl, layers, ...rest };
|
|
17975
|
+
const plan = parseVideoOverlayLayerPlan(input.planLayers);
|
|
17976
|
+
if ("error" in plan) return { videoUrl: input.videoUrl, layers, ...rest, planError: plan.error };
|
|
17977
|
+
const planned = expandVideoOverlayPresets(plan.layers).map((l, i) => {
|
|
17978
|
+
const { slot: _slot, ...own } = l;
|
|
17979
|
+
return { ...own, planLayer: i + 1 };
|
|
17980
|
+
});
|
|
17981
|
+
return { videoUrl: input.videoUrl, layers: [...planned, ...layers], ...rest };
|
|
17015
17982
|
}
|
|
17016
17983
|
function videoOverlaySlotSources(layers, wiredImageUrls) {
|
|
17017
17984
|
const stored = Array.isArray(layers) ? layers : [];
|
|
@@ -17039,16 +18006,19 @@ var VIDEO_OVERLAY_MAX_COMPOSITION_KEY_LENGTH = 65536;
|
|
|
17039
18006
|
function videoOverlayCompositionKey(c) {
|
|
17040
18007
|
const sources = c.sources.map((s) => typeof s === "string" && s.length > 0 ? s : null);
|
|
17041
18008
|
while (sources.length > 0 && sources[sources.length - 1] === null) sources.pop();
|
|
17042
|
-
|
|
17043
|
-
|
|
17044
|
-
|
|
17045
|
-
|
|
17046
|
-
|
|
17047
|
-
|
|
17048
|
-
|
|
17049
|
-
|
|
17050
|
-
|
|
17051
|
-
|
|
18009
|
+
const parts = [
|
|
18010
|
+
c.baseUrl || null,
|
|
18011
|
+
sources,
|
|
18012
|
+
Array.isArray(c.data.layers) ? c.data.layers : [],
|
|
18013
|
+
c.data.outputAspect ?? null,
|
|
18014
|
+
c.data.baseFit ?? null,
|
|
18015
|
+
c.data.backgroundColor ?? null
|
|
18016
|
+
];
|
|
18017
|
+
if (c.planLayers !== void 0) {
|
|
18018
|
+
const plan = parseVideoOverlayLayerPlan(c.planLayers);
|
|
18019
|
+
parts.push("error" in plan ? "invalid" : plan.layers);
|
|
18020
|
+
}
|
|
18021
|
+
return JSON.stringify(canonicalValue(parts));
|
|
17052
18022
|
}
|
|
17053
18023
|
|
|
17054
18024
|
// src/entity-image-handle.ts
|
|
@@ -19475,8 +20445,8 @@ function scene3DCameraTrackIssues(track) {
|
|
|
19475
20445
|
}
|
|
19476
20446
|
const quaternionTolerance = SCENE3D_CAMERA_TRACK_LIMITS.quaternionTolerance;
|
|
19477
20447
|
track.samples.forEach((sample, index) => {
|
|
19478
|
-
const [x, y,
|
|
19479
|
-
const norm = Math.sqrt(x * x + y * y +
|
|
20448
|
+
const [x, y, z26, w] = sample.quaternion;
|
|
20449
|
+
const norm = Math.sqrt(x * x + y * y + z26 * z26 + w * w);
|
|
19480
20450
|
if (Math.abs(norm - 1) > quaternionTolerance) {
|
|
19481
20451
|
issues.push({
|
|
19482
20452
|
path: ["samples", index, "quaternion"],
|
|
@@ -19889,7 +20859,7 @@ var STUDIO_KEYFRAME_TRANSIENT_KEYS = ["pendingImages"];
|
|
|
19889
20859
|
var STUDIO_KEYFRAME_REVIEW_KEYS = ["rejections"];
|
|
19890
20860
|
var STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS = ["waivedReason"];
|
|
19891
20861
|
var STUDIO_KEYFRAME_PRIVATE_KEYS = [...STUDIO_KEYFRAME_TRANSIENT_KEYS, ...STUDIO_KEYFRAME_REVIEW_KEYS];
|
|
19892
|
-
function
|
|
20862
|
+
function isRecord3(value) {
|
|
19893
20863
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
19894
20864
|
}
|
|
19895
20865
|
function withoutKeys(source, drop) {
|
|
@@ -19916,9 +20886,9 @@ function stripPrevizRunState(value) {
|
|
|
19916
20886
|
if (!Array.isArray(value)) return value;
|
|
19917
20887
|
let changed = false;
|
|
19918
20888
|
const out = value.map((entry) => {
|
|
19919
|
-
if (!
|
|
20889
|
+
if (!isRecord3(entry)) return entry;
|
|
19920
20890
|
const previz = entry.previsualization;
|
|
19921
|
-
if (!
|
|
20891
|
+
if (!isRecord3(previz) || !STUDIO_PREVIZ_RUN_STATE_KEYS.some((key) => key in previz)) return entry;
|
|
19922
20892
|
changed = true;
|
|
19923
20893
|
return { ...entry, previsualization: withoutKeys(previz, STUDIO_PREVIZ_RUN_STATE_KEYS) };
|
|
19924
20894
|
});
|
|
@@ -19942,8 +20912,8 @@ function stripStudioTakeVoiceRecords(nodes) {
|
|
|
19942
20912
|
if (!Array.isArray(nodes)) return nodes;
|
|
19943
20913
|
let changed = false;
|
|
19944
20914
|
const out = nodes.map((node) => {
|
|
19945
|
-
const data =
|
|
19946
|
-
if (!
|
|
20915
|
+
const data = isRecord3(node) ? node.data : void 0;
|
|
20916
|
+
if (!isRecord3(data)) return node;
|
|
19947
20917
|
const results = stripRows(data.generatedResults, STUDIO_TAKE_PRIVATE_KEYS);
|
|
19948
20918
|
const unitResults = stripRows(data.sequenceUnitResults, STUDIO_SEQUENCE_UNIT_MANIFEST_KEYS);
|
|
19949
20919
|
const running = STUDIO_KEYFRAME_NODE_TRANSIENT_KEYS.some((key) => key in data);
|
|
@@ -19960,7 +20930,7 @@ function stripRows(value, drop) {
|
|
|
19960
20930
|
if (!Array.isArray(value)) return value;
|
|
19961
20931
|
let changed = false;
|
|
19962
20932
|
const out = value.map((row) => {
|
|
19963
|
-
if (!
|
|
20933
|
+
if (!isRecord3(row) || !drop.some((key) => key in row)) return row;
|
|
19964
20934
|
changed = true;
|
|
19965
20935
|
return withoutKeys(row, drop);
|
|
19966
20936
|
});
|
|
@@ -19971,7 +20941,7 @@ function stripLinkedOwnerState(studio) {
|
|
|
19971
20941
|
const keyframes = stripKeyframes(studio.keyframes);
|
|
19972
20942
|
const preferences = STUDIO_SEQUENCE_POLICY_KEYS.filter((key) => {
|
|
19973
20943
|
const value = studio[key];
|
|
19974
|
-
return
|
|
20944
|
+
return isRecord3(value) && Object.keys(value).length > 0;
|
|
19975
20945
|
});
|
|
19976
20946
|
if (!STUDIO_SEQUENCE_PLANNING_KEYS.some((key) => key in studio) && takes === studio.sequenceTakes && keyframes === studio.keyframes && preferences.length === 0) return studio;
|
|
19977
20947
|
const kept = withoutKeys(studio, STUDIO_SEQUENCE_PLANNING_KEYS);
|
|
@@ -19984,10 +20954,10 @@ function stripTakeUnitReviews(value) {
|
|
|
19984
20954
|
if (!Array.isArray(value)) return value;
|
|
19985
20955
|
let changed = false;
|
|
19986
20956
|
const out = value.map((take) => {
|
|
19987
|
-
if (!
|
|
20957
|
+
if (!isRecord3(take) || !Array.isArray(take.units)) return take;
|
|
19988
20958
|
let touched = false;
|
|
19989
20959
|
const units = take.units.map((unit) => {
|
|
19990
|
-
if (!
|
|
20960
|
+
if (!isRecord3(unit) || !STUDIO_SEQUENCE_UNIT_REVIEW_KEYS.some((key) => key in unit)) return unit;
|
|
19991
20961
|
touched = true;
|
|
19992
20962
|
return withoutKeys(unit, STUDIO_SEQUENCE_UNIT_REVIEW_KEYS);
|
|
19993
20963
|
});
|
|
@@ -20001,7 +20971,7 @@ function stripKeyframes(value) {
|
|
|
20001
20971
|
if (!Array.isArray(value)) return value;
|
|
20002
20972
|
let changed = false;
|
|
20003
20973
|
const out = value.map((frame) => {
|
|
20004
|
-
if (!
|
|
20974
|
+
if (!isRecord3(frame)) return frame;
|
|
20005
20975
|
const kept = keyframeForReader(frame, STUDIO_KEYFRAME_REVIEW_KEYS);
|
|
20006
20976
|
if (kept !== frame) changed = true;
|
|
20007
20977
|
return kept;
|
|
@@ -20010,7 +20980,7 @@ function stripKeyframes(value) {
|
|
|
20010
20980
|
}
|
|
20011
20981
|
function keyframeForReader(frame, drop) {
|
|
20012
20982
|
const acceptance = frame.acceptance;
|
|
20013
|
-
const waived =
|
|
20983
|
+
const waived = isRecord3(acceptance) && STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS.some((key) => key in acceptance);
|
|
20014
20984
|
if (!waived && !drop.some((key) => key in frame)) return frame;
|
|
20015
20985
|
const kept = withoutKeys(frame, drop);
|
|
20016
20986
|
if (waived) kept.acceptance = withoutKeys(acceptance, STUDIO_KEYFRAME_ACCEPTANCE_PRIVATE_KEYS);
|
|
@@ -20019,7 +20989,7 @@ function keyframeForReader(frame, drop) {
|
|
|
20019
20989
|
function stripStudioDraftSettings(settings) {
|
|
20020
20990
|
if (!settings || typeof settings !== "object") return settings;
|
|
20021
20991
|
const studio = settings.studio;
|
|
20022
|
-
if (!
|
|
20992
|
+
if (!isRecord3(studio)) return settings;
|
|
20023
20993
|
const shots = stripShots(studio.shots, STUDIO_SHOT_PRIVATE_KEYS);
|
|
20024
20994
|
const trash = stripBin(studio.trash);
|
|
20025
20995
|
const planned = stripLinkedOwnerState(studio);
|
|
@@ -20034,11 +21004,11 @@ function stripBin(trash) {
|
|
|
20034
21004
|
let changed = false;
|
|
20035
21005
|
const out = [];
|
|
20036
21006
|
for (const entry of trash) {
|
|
20037
|
-
if (
|
|
21007
|
+
if (isRecord3(entry) && entry.kind === "slot") {
|
|
20038
21008
|
changed = true;
|
|
20039
21009
|
continue;
|
|
20040
21010
|
}
|
|
20041
|
-
const kept = !
|
|
21011
|
+
const kept = !isRecord3(entry) ? entry : entry.kind === "shot" ? binSceneForReader(entry) : entry.kind === "keyframe" ? binKeyframeForReader(entry) : binTakeForReader(entry);
|
|
20042
21012
|
if (kept !== entry) changed = true;
|
|
20043
21013
|
out.push(kept);
|
|
20044
21014
|
}
|
|
@@ -20046,7 +21016,7 @@ function stripBin(trash) {
|
|
|
20046
21016
|
}
|
|
20047
21017
|
function binSceneForReader(entry) {
|
|
20048
21018
|
const graph = entry.graph;
|
|
20049
|
-
if (!
|
|
21019
|
+
if (!isRecord3(graph)) return entry;
|
|
20050
21020
|
const nodes = stripStudioTakeVoiceRecords(graph.nodes);
|
|
20051
21021
|
const settings = stripStudioDraftSettings(graph.settings);
|
|
20052
21022
|
if (nodes === graph.nodes && settings === graph.settings) return entry;
|
|
@@ -20054,12 +21024,12 @@ function binSceneForReader(entry) {
|
|
|
20054
21024
|
}
|
|
20055
21025
|
function binTakeForReader(entry) {
|
|
20056
21026
|
const result = entry.result;
|
|
20057
|
-
if (!
|
|
21027
|
+
if (!isRecord3(result) || !STUDIO_TAKE_PRIVATE_KEYS.some((key) => key in result)) return entry;
|
|
20058
21028
|
return { ...entry, result: withoutKeys(result, STUDIO_TAKE_PRIVATE_KEYS) };
|
|
20059
21029
|
}
|
|
20060
21030
|
function binKeyframeForReader(entry) {
|
|
20061
21031
|
const keyframe = entry.keyframe;
|
|
20062
|
-
if (!
|
|
21032
|
+
if (!isRecord3(keyframe)) return entry;
|
|
20063
21033
|
const kept = keyframeForReader(keyframe, STUDIO_KEYFRAME_PRIVATE_KEYS);
|
|
20064
21034
|
return kept === keyframe ? entry : { ...entry, keyframe: kept };
|
|
20065
21035
|
}
|
|
@@ -20828,6 +21798,9 @@ function edlDurationMs(edl) {
|
|
|
20828
21798
|
const last = edl.segments[edl.segments.length - 1];
|
|
20829
21799
|
return Math.max(0, Math.round(starts[starts.length - 1] + Math.max(0, last.outMs - last.inMs)));
|
|
20830
21800
|
}
|
|
21801
|
+
function edlSegmentOutputStarts(edl) {
|
|
21802
|
+
return segmentOutputStarts(edl);
|
|
21803
|
+
}
|
|
20831
21804
|
function segmentOutputStarts(edl) {
|
|
20832
21805
|
const starts = [];
|
|
20833
21806
|
let cursor = 0;
|
|
@@ -20958,6 +21931,16 @@ function remapMsThroughEdl(edl, sourceMs, sourceId) {
|
|
|
20958
21931
|
}
|
|
20959
21932
|
return null;
|
|
20960
21933
|
}
|
|
21934
|
+
function outputMsToMasterMs(edl, outputMs) {
|
|
21935
|
+
if (!Number.isFinite(outputMs) || outputMs < 0) return null;
|
|
21936
|
+
const starts = segmentOutputStarts(edl);
|
|
21937
|
+
for (let i = edl.segments.length - 1; i >= 0; i--) {
|
|
21938
|
+
const seg = edl.segments[i];
|
|
21939
|
+
const dur = Math.max(0, seg.outMs - seg.inMs);
|
|
21940
|
+
if (outputMs >= starts[i] && outputMs < starts[i] + dur) return Math.round(seg.inMs + (outputMs - starts[i]));
|
|
21941
|
+
}
|
|
21942
|
+
return null;
|
|
21943
|
+
}
|
|
20961
21944
|
function remapTranscriptThroughEdl(edl, transcript) {
|
|
20962
21945
|
const off = offsetFor(edl, transcript.sourceId);
|
|
20963
21946
|
const starts = segmentOutputStarts(edl);
|
|
@@ -21030,7 +22013,7 @@ function speakerTurns(transcript, opts) {
|
|
|
21030
22013
|
}
|
|
21031
22014
|
var num = (v, fallback = 0) => typeof v === "number" && Number.isFinite(v) ? v : fallback;
|
|
21032
22015
|
var clamp012 = (v) => Math.min(1, Math.max(0, v));
|
|
21033
|
-
var
|
|
22016
|
+
var str3 = (v) => typeof v === "string" ? v : void 0;
|
|
21034
22017
|
function normalizeRegion(r) {
|
|
21035
22018
|
if (!r || typeof r !== "object") return void 0;
|
|
21036
22019
|
const o = r;
|
|
@@ -21047,11 +22030,11 @@ function normalizeEdl(input) {
|
|
|
21047
22030
|
const sources = Array.isArray(o.sources) ? o.sources.map((raw, i) => {
|
|
21048
22031
|
const s = raw ?? {};
|
|
21049
22032
|
const src = {
|
|
21050
|
-
id:
|
|
21051
|
-
url:
|
|
22033
|
+
id: str3(s.id) ?? `src-${i}`,
|
|
22034
|
+
url: str3(s.url) ?? "",
|
|
21052
22035
|
kind: s.kind === "audio" ? "audio" : "video",
|
|
21053
22036
|
...s.offsetMs !== void 0 ? { offsetMs: Math.round(num(s.offsetMs)) } : {},
|
|
21054
|
-
...
|
|
22037
|
+
...str3(s.role) ? { role: s.role } : {},
|
|
21055
22038
|
...Array.isArray(s.speakers) ? { speakers: s.speakers.filter((x) => typeof x === "string") } : {},
|
|
21056
22039
|
...normalizeRegion(s.region) ? { region: normalizeRegion(s.region) } : {}
|
|
21057
22040
|
};
|
|
@@ -21064,12 +22047,12 @@ function normalizeEdl(input) {
|
|
|
21064
22047
|
const t2 = isFirst ? void 0 : s.transition;
|
|
21065
22048
|
const layout = normalizeLayout(s.layout, isFirst);
|
|
21066
22049
|
const seg = {
|
|
21067
|
-
id:
|
|
22050
|
+
id: str3(s.id) ?? `seg-${i}`,
|
|
21068
22051
|
inMs: Math.round(num(s.inMs)),
|
|
21069
22052
|
outMs: Math.round(num(s.outMs)),
|
|
21070
|
-
...
|
|
21071
|
-
...
|
|
21072
|
-
...
|
|
22053
|
+
...str3(s.video) ? { video: str3(s.video) } : {},
|
|
22054
|
+
...str3(s.audio) ? { audio: str3(s.audio) } : {},
|
|
22055
|
+
...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
|
|
21073
22056
|
...t2 && (t2.type === "cut" || t2.type === "crossfade") ? { transition: { type: t2.type, durationMs: t2.type === "cut" ? 0 : Math.round(num(t2.durationMs)) } } : {},
|
|
21074
22057
|
...region ? { region } : {},
|
|
21075
22058
|
...layout ? { layout } : {},
|
|
@@ -21079,7 +22062,7 @@ function normalizeEdl(input) {
|
|
|
21079
22062
|
}) : [];
|
|
21080
22063
|
const dropped = Array.isArray(o.dropped) ? o.dropped.map((raw) => {
|
|
21081
22064
|
const d = raw ?? {};
|
|
21082
|
-
return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason:
|
|
22065
|
+
return { inMs: Math.round(num(d.inMs)), outMs: Math.round(num(d.outMs)), reason: str3(d.reason) ?? "manual" };
|
|
21083
22066
|
}) : void 0;
|
|
21084
22067
|
const meta = o.meta && typeof o.meta === "object" ? o.meta : void 0;
|
|
21085
22068
|
return {
|
|
@@ -21088,28 +22071,28 @@ function normalizeEdl(input) {
|
|
|
21088
22071
|
sources,
|
|
21089
22072
|
segments,
|
|
21090
22073
|
...dropped ? { dropped } : {},
|
|
21091
|
-
...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId:
|
|
22074
|
+
...o.derivedFrom && typeof o.derivedFrom === "object" ? { derivedFrom: { edlId: str3(o.derivedFrom.edlId) ?? "", clock: "output" } } : {},
|
|
21092
22075
|
...meta ? { meta } : {}
|
|
21093
22076
|
};
|
|
21094
22077
|
}
|
|
21095
22078
|
function normalizeLayout(input, dropTransition = false) {
|
|
21096
22079
|
if (!input || typeof input !== "object") return void 0;
|
|
21097
22080
|
const o = input;
|
|
21098
|
-
const mode =
|
|
22081
|
+
const mode = str3(o.mode) || "single";
|
|
21099
22082
|
const slots = Array.isArray(o.slots) ? o.slots.map((raw) => {
|
|
21100
22083
|
const s = raw ?? {};
|
|
21101
|
-
const source =
|
|
22084
|
+
const source = str3(s.source);
|
|
21102
22085
|
if (!source) return null;
|
|
21103
22086
|
const region = normalizeRegion(s.region);
|
|
21104
22087
|
return {
|
|
21105
22088
|
source,
|
|
21106
22089
|
...region ? { region } : {},
|
|
21107
|
-
...
|
|
22090
|
+
...str3(s.speaker) ? { speaker: str3(s.speaker) } : {},
|
|
21108
22091
|
...s.weight !== void 0 ? { weight: clamp012(num(s.weight)) } : {}
|
|
21109
22092
|
};
|
|
21110
22093
|
}).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:
|
|
22094
|
+
const emphasis = o.emphasis && typeof o.emphasis === "object" ? { style: str3(o.emphasis.style) ?? "none", durationMs: Math.round(num(o.emphasis.durationMs)) } : void 0;
|
|
22095
|
+
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
22096
|
return {
|
|
21114
22097
|
mode,
|
|
21115
22098
|
...slots ? { slots } : {},
|
|
@@ -21123,29 +22106,372 @@ function normalizeTranscript(input) {
|
|
|
21123
22106
|
const w = raw ?? {};
|
|
21124
22107
|
const startMs = Math.round(num(w.startMs));
|
|
21125
22108
|
return {
|
|
21126
|
-
text:
|
|
22109
|
+
text: str3(w.text) ?? "",
|
|
21127
22110
|
startMs,
|
|
21128
22111
|
// Never inverted: an endMs < startMs (garbage upstream) would be
|
|
21129
22112
|
// silently dropped at remap; clamp it to a non-negative width.
|
|
21130
22113
|
endMs: Math.max(startMs, Math.round(num(w.endMs))),
|
|
21131
|
-
...
|
|
22114
|
+
...str3(w.speaker) ? { speaker: str3(w.speaker) } : {},
|
|
21132
22115
|
...typeof w.confidence === "number" ? { confidence: w.confidence } : {}
|
|
21133
22116
|
};
|
|
21134
22117
|
}) : [];
|
|
21135
22118
|
const segments = Array.isArray(o.segments) ? o.segments.map((raw) => {
|
|
21136
22119
|
const s = raw ?? {};
|
|
21137
22120
|
const startMs = Math.round(num(s.startMs));
|
|
21138
|
-
return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text:
|
|
22121
|
+
return { startMs, endMs: Math.max(startMs, Math.round(num(s.endMs))), text: str3(s.text) ?? "", ...str3(s.speaker) ? { speaker: str3(s.speaker) } : {} };
|
|
21139
22122
|
}) : void 0;
|
|
21140
22123
|
return {
|
|
21141
22124
|
version: EDL_VERSION,
|
|
21142
|
-
...
|
|
21143
|
-
...
|
|
22125
|
+
...str3(o.sourceId) ? { sourceId: str3(o.sourceId) } : {},
|
|
22126
|
+
...str3(o.language) ? { language: str3(o.language) } : {},
|
|
21144
22127
|
words,
|
|
21145
22128
|
...segments ? { segments } : {}
|
|
21146
22129
|
};
|
|
21147
22130
|
}
|
|
21148
22131
|
|
|
22132
|
+
// src/speaker-tracks.ts
|
|
22133
|
+
var SPEAKER_TRACKS_VERSION = 1;
|
|
22134
|
+
var SPEAKER_TRACK_ATTRIBUTION_METHODS = ["source-map", "region", "mouth-motion", "manual"];
|
|
22135
|
+
var KNOWN_METHODS = new Set(SPEAKER_TRACK_ATTRIBUTION_METHODS);
|
|
22136
|
+
var SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE = 1e5;
|
|
22137
|
+
var SPEAKER_TRACKS_MAX_BYTES = 64 * 1024 * 1024;
|
|
22138
|
+
var isObj = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
22139
|
+
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
22140
|
+
var num2 = (v, fallback = 0) => isNum(v) ? v : fallback;
|
|
22141
|
+
var str4 = (v) => typeof v === "string" ? v : void 0;
|
|
22142
|
+
var clamp013 = (v) => Math.min(1, Math.max(0, v));
|
|
22143
|
+
var arr = (v) => Array.isArray(v) ? v : [];
|
|
22144
|
+
var int2 = (v) => {
|
|
22145
|
+
const r = Math.round(v);
|
|
22146
|
+
return r === 0 ? 0 : r;
|
|
22147
|
+
};
|
|
22148
|
+
function cropAxis(p, s) {
|
|
22149
|
+
if (!(s > 0)) return void 0;
|
|
22150
|
+
if (p >= 0 && p + s <= 1) return [p, s];
|
|
22151
|
+
const lo = clamp013(p);
|
|
22152
|
+
const hi = clamp013(p + s);
|
|
22153
|
+
return hi > lo ? [lo, hi - lo] : void 0;
|
|
22154
|
+
}
|
|
22155
|
+
function normalizeBox(raw) {
|
|
22156
|
+
if (!isObj(raw)) return void 0;
|
|
22157
|
+
if (![raw.ms, raw.x, raw.y, raw.w, raw.h].every(isNum)) return void 0;
|
|
22158
|
+
const xs = cropAxis(raw.x, raw.w);
|
|
22159
|
+
const ys = cropAxis(raw.y, raw.h);
|
|
22160
|
+
if (!xs || !ys) return void 0;
|
|
22161
|
+
const [x, w] = xs;
|
|
22162
|
+
const [y, h] = ys;
|
|
22163
|
+
return { ms: int2(raw.ms), x, y, w, h, ...isNum(raw.score) ? { score: clamp013(raw.score) } : {} };
|
|
22164
|
+
}
|
|
22165
|
+
function normalizeSpans(raw) {
|
|
22166
|
+
if (!Array.isArray(raw)) return [];
|
|
22167
|
+
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);
|
|
22168
|
+
const merged = [];
|
|
22169
|
+
for (const s of spans) {
|
|
22170
|
+
const last = merged[merged.length - 1];
|
|
22171
|
+
if (last && s.startMs <= last.endMs) merged[merged.length - 1] = { startMs: last.startMs, endMs: Math.max(last.endMs, s.endMs) };
|
|
22172
|
+
else merged.push(s);
|
|
22173
|
+
}
|
|
22174
|
+
return merged;
|
|
22175
|
+
}
|
|
22176
|
+
function normalizeCuts(raw) {
|
|
22177
|
+
if (!Array.isArray(raw)) return [];
|
|
22178
|
+
const sorted = raw.filter(isNum).map(int2).sort((a, b) => a - b);
|
|
22179
|
+
return sorted.filter((c, i) => i === 0 || c !== sorted[i - 1]);
|
|
22180
|
+
}
|
|
22181
|
+
function normalizeAttribution(raw) {
|
|
22182
|
+
if (!isObj(raw)) return void 0;
|
|
22183
|
+
const method = str4(raw.method);
|
|
22184
|
+
if (!method) return void 0;
|
|
22185
|
+
const rawSpeaker = str4(raw.rawSpeaker);
|
|
22186
|
+
return { method, confidence: clamp013(num2(raw.confidence)), ...rawSpeaker ? { rawSpeaker } : {} };
|
|
22187
|
+
}
|
|
22188
|
+
function normalizeHeader(raw, fallbackId) {
|
|
22189
|
+
const speaker = str4(raw.speaker);
|
|
22190
|
+
const attribution = normalizeAttribution(raw.attribution);
|
|
22191
|
+
return {
|
|
22192
|
+
id: str4(raw.id) || fallbackId,
|
|
22193
|
+
...speaker ? { speaker } : {},
|
|
22194
|
+
...attribution ? { attribution } : {}
|
|
22195
|
+
};
|
|
22196
|
+
}
|
|
22197
|
+
function normalizeSetFields(o) {
|
|
22198
|
+
const detector = isObj(o.detector) ? o.detector : {};
|
|
22199
|
+
const detectorVersion = str4(detector.version);
|
|
22200
|
+
return {
|
|
22201
|
+
// Only an ABSENT version defaults to 1. Any present value — another
|
|
22202
|
+
// number, "2", null — is kept as is so validate refuses it rather than
|
|
22203
|
+
// reading a newer (or broken) body as this one.
|
|
22204
|
+
version: o.version === void 0 ? SPEAKER_TRACKS_VERSION : o.version,
|
|
22205
|
+
sampleFps: num2(o.sampleFps),
|
|
22206
|
+
detector: { id: str4(detector.id) ?? "", ...detectorVersion ? { version: detectorVersion } : {} }
|
|
22207
|
+
};
|
|
22208
|
+
}
|
|
22209
|
+
function normalizeSources(raw, track) {
|
|
22210
|
+
if (!Array.isArray(raw)) return [];
|
|
22211
|
+
return raw.map((r) => {
|
|
22212
|
+
const s = isObj(r) ? r : {};
|
|
22213
|
+
const sourceId = str4(s.sourceId) ?? "";
|
|
22214
|
+
const frame = isObj(s.frame) ? s.frame : {};
|
|
22215
|
+
const cuts = normalizeCuts(s.cuts);
|
|
22216
|
+
const tracks = Array.isArray(s.tracks) ? s.tracks.map((t2, k) => track(isObj(t2) ? t2 : {}, `${sourceId}/t${k + 1}`)) : [];
|
|
22217
|
+
return {
|
|
22218
|
+
sourceId,
|
|
22219
|
+
// A clock other than "source" cannot be repaired: boxes on another clock
|
|
22220
|
+
// would land offsetMs away from their frame. Keep it for validate to refuse.
|
|
22221
|
+
clock: typeof s.clock === "string" ? s.clock : "source",
|
|
22222
|
+
frame: { w: int2(num2(frame.w)), h: int2(num2(frame.h)) },
|
|
22223
|
+
sampledSpans: normalizeSpans(s.sampledSpans),
|
|
22224
|
+
tracks,
|
|
22225
|
+
...cuts.length > 0 ? { cuts } : {}
|
|
22226
|
+
};
|
|
22227
|
+
});
|
|
22228
|
+
}
|
|
22229
|
+
function normalizeSpeakerTracks(input) {
|
|
22230
|
+
const o = isObj(input) ? input : {};
|
|
22231
|
+
return {
|
|
22232
|
+
...normalizeSetFields(o),
|
|
22233
|
+
sources: normalizeSources(o.sources, (t2, fallbackId) => {
|
|
22234
|
+
const boxes = Array.isArray(t2.boxes) ? t2.boxes.map(normalizeBox).filter((b) => b !== void 0) : [];
|
|
22235
|
+
return { ...normalizeHeader(t2, fallbackId), boxes: [...boxes].sort((a, b) => a.ms - b.ms) };
|
|
22236
|
+
})
|
|
22237
|
+
};
|
|
22238
|
+
}
|
|
22239
|
+
function normalizeSpeakerTrackSetDescriptor(input) {
|
|
22240
|
+
const o = isObj(input) ? input : {};
|
|
22241
|
+
return {
|
|
22242
|
+
...normalizeSetFields(o),
|
|
22243
|
+
sources: normalizeSources(o.sources, (t2, fallbackId) => ({
|
|
22244
|
+
...normalizeHeader(t2, fallbackId),
|
|
22245
|
+
boxCount: Math.max(0, int2(num2(t2.boxCount)))
|
|
22246
|
+
})),
|
|
22247
|
+
url: str4(o.url) ?? "",
|
|
22248
|
+
sha256: str4(o.sha256) ?? "",
|
|
22249
|
+
bytes: int2(num2(o.bytes))
|
|
22250
|
+
};
|
|
22251
|
+
}
|
|
22252
|
+
function describeSpeakerTracks(set, artifact) {
|
|
22253
|
+
return {
|
|
22254
|
+
version: set.version,
|
|
22255
|
+
sampleFps: set.sampleFps,
|
|
22256
|
+
detector: { ...set.detector },
|
|
22257
|
+
sources: set.sources.map((s) => ({
|
|
22258
|
+
sourceId: s.sourceId,
|
|
22259
|
+
clock: s.clock,
|
|
22260
|
+
frame: { ...s.frame },
|
|
22261
|
+
sampledSpans: s.sampledSpans.map((sp) => ({ ...sp })),
|
|
22262
|
+
tracks: s.tracks.map((t2) => ({
|
|
22263
|
+
id: t2.id,
|
|
22264
|
+
...t2.speaker !== void 0 ? { speaker: t2.speaker } : {},
|
|
22265
|
+
...t2.attribution ? { attribution: { ...t2.attribution } } : {},
|
|
22266
|
+
boxCount: t2.boxes.length
|
|
22267
|
+
})),
|
|
22268
|
+
...s.cuts && s.cuts.length > 0 ? { cuts: [...s.cuts] } : {}
|
|
22269
|
+
})),
|
|
22270
|
+
url: artifact.url,
|
|
22271
|
+
sha256: artifact.sha256,
|
|
22272
|
+
bytes: artifact.bytes
|
|
22273
|
+
};
|
|
22274
|
+
}
|
|
22275
|
+
function edlSpeakerSpace(edl) {
|
|
22276
|
+
const out = /* @__PURE__ */ new Set();
|
|
22277
|
+
const add = (v) => {
|
|
22278
|
+
if (typeof v === "string" && v) out.add(v);
|
|
22279
|
+
};
|
|
22280
|
+
for (const e of edlList(edl)) {
|
|
22281
|
+
for (const s of Array.isArray(e.sources) ? e.sources : []) {
|
|
22282
|
+
for (const sp of Array.isArray(s?.speakers) ? s.speakers : []) add(sp);
|
|
22283
|
+
}
|
|
22284
|
+
for (const seg of Array.isArray(e.segments) ? e.segments : []) {
|
|
22285
|
+
add(seg?.speaker);
|
|
22286
|
+
for (const slot of Array.isArray(seg?.layout?.slots) ? seg.layout.slots : []) add(slot?.speaker);
|
|
22287
|
+
}
|
|
22288
|
+
}
|
|
22289
|
+
return [...out].sort();
|
|
22290
|
+
}
|
|
22291
|
+
function edlList(edl) {
|
|
22292
|
+
if (!edl) return [];
|
|
22293
|
+
const all = Array.isArray(edl) ? edl : [edl];
|
|
22294
|
+
return all.filter((e) => isObj(e));
|
|
22295
|
+
}
|
|
22296
|
+
var SHA256_HEX = /^[0-9a-f]{64}$/;
|
|
22297
|
+
function validateCommon(set, opts, perTrack) {
|
|
22298
|
+
const f = { issues: [], warnings: [] };
|
|
22299
|
+
const { issues, warnings } = f;
|
|
22300
|
+
const sources = arr(set.sources);
|
|
22301
|
+
const maxBoxes = opts.maxBoxesPerSource ?? SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE;
|
|
22302
|
+
if (set.version !== SPEAKER_TRACKS_VERSION) issues.push(`version must be ${SPEAKER_TRACKS_VERSION}`);
|
|
22303
|
+
if (!(isNum(set.sampleFps) && set.sampleFps > 0)) issues.push("sampleFps must be a finite number > 0");
|
|
22304
|
+
const edls = edlList(opts.edl);
|
|
22305
|
+
const edlSources = /* @__PURE__ */ new Map();
|
|
22306
|
+
for (const e of edls) {
|
|
22307
|
+
for (const s of Array.isArray(e.sources) ? e.sources : []) {
|
|
22308
|
+
if (s && typeof s.id === "string" && !edlSources.has(s.id)) edlSources.set(s.id, s);
|
|
22309
|
+
}
|
|
22310
|
+
}
|
|
22311
|
+
const sourceIds = /* @__PURE__ */ new Set();
|
|
22312
|
+
const trackIds = /* @__PURE__ */ new Set();
|
|
22313
|
+
sources.forEach((s, i) => {
|
|
22314
|
+
const sid = s.sourceId;
|
|
22315
|
+
const at = `source "${sid}"`;
|
|
22316
|
+
if (!sid) issues.push(`source[${i}]: sourceId is empty`);
|
|
22317
|
+
else if (sourceIds.has(sid)) issues.push(`duplicate source id "${sid}"`);
|
|
22318
|
+
sourceIds.add(sid);
|
|
22319
|
+
if (sid && edls.length > 0) {
|
|
22320
|
+
const es = edlSources.get(sid);
|
|
22321
|
+
if (!es) issues.push(`${at}: not a source of the EDL`);
|
|
22322
|
+
else if (es.kind !== "video") issues.push(`${at}: the EDL source is kind:"${es.kind}", tracks need a video source`);
|
|
22323
|
+
}
|
|
22324
|
+
if (s.clock !== "source") issues.push(`${at}: clock must be "source"`);
|
|
22325
|
+
if (!(isObj(s.frame) && isNum(s.frame.w) && isNum(s.frame.h) && s.frame.w > 0 && s.frame.h > 0)) {
|
|
22326
|
+
issues.push(`${at}: frame w/h must be positive`);
|
|
22327
|
+
}
|
|
22328
|
+
const spans = arr(s.sampledSpans);
|
|
22329
|
+
spans.forEach((sp, j) => {
|
|
22330
|
+
const startMs = sp?.startMs;
|
|
22331
|
+
const endMs = sp?.endMs;
|
|
22332
|
+
if (!(isNum(startMs) && isNum(endMs) && endMs > startMs)) {
|
|
22333
|
+
issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not positive`);
|
|
22334
|
+
return;
|
|
22335
|
+
}
|
|
22336
|
+
if (!(Number.isInteger(startMs) && Number.isInteger(endMs))) issues.push(`${at}: sampledSpans[${j}] [${startMs},${endMs}) is not integer ms`);
|
|
22337
|
+
if (startMs < 0) issues.push(`${at}: sampledSpans[${j}] starts before 0`);
|
|
22338
|
+
const prevEnd = spans[j - 1]?.endMs;
|
|
22339
|
+
if (j > 0 && isNum(prevEnd) && startMs < prevEnd) {
|
|
22340
|
+
issues.push(`${at}: sampledSpans must be sorted and non-overlapping (span ${j})`);
|
|
22341
|
+
}
|
|
22342
|
+
});
|
|
22343
|
+
const cuts = s.cuts;
|
|
22344
|
+
if (cuts !== void 0) {
|
|
22345
|
+
const okCuts = Array.isArray(cuts) && cuts.every((c, k) => Number.isInteger(c) && c >= 0 && (k === 0 || c > cuts[k - 1]));
|
|
22346
|
+
if (!okCuts) issues.push(`${at}: cuts must be ascending non-negative ms`);
|
|
22347
|
+
}
|
|
22348
|
+
let boxes = 0;
|
|
22349
|
+
const tracks = arr(s.tracks);
|
|
22350
|
+
tracks.forEach((t2, k) => {
|
|
22351
|
+
if (!t2?.id) issues.push(`${at} track[${k}]: id is empty`);
|
|
22352
|
+
else if (trackIds.has(t2.id)) issues.push(`duplicate track id "${t2.id}"`);
|
|
22353
|
+
if (t2?.id) trackIds.add(t2.id);
|
|
22354
|
+
const a = t2?.attribution;
|
|
22355
|
+
if (a) {
|
|
22356
|
+
if (!(isNum(a.confidence) && a.confidence >= 0 && a.confidence <= 1)) {
|
|
22357
|
+
issues.push(`track "${t2.id}": attribution.confidence=${a.confidence} out of 0..1`);
|
|
22358
|
+
}
|
|
22359
|
+
if (!KNOWN_METHODS.has(a.method)) {
|
|
22360
|
+
warnings.push(`track "${t2.id}": unknown attribution method "${a.method}" (known: ${SPEAKER_TRACK_ATTRIBUTION_METHODS.join(", ")})`);
|
|
22361
|
+
}
|
|
22362
|
+
}
|
|
22363
|
+
boxes += perTrack(t2, s, f);
|
|
22364
|
+
});
|
|
22365
|
+
if (boxes > maxBoxes) issues.push(`${at}: ${boxes} boxes is over the cap of ${maxBoxes}`);
|
|
22366
|
+
});
|
|
22367
|
+
if (edls.length > 0) {
|
|
22368
|
+
const space = edlSpeakerSpace(edls);
|
|
22369
|
+
const attributed = sources.flatMap((s) => Array.isArray(s.tracks) ? s.tracks : []).filter((t2) => !!t2?.speaker);
|
|
22370
|
+
if (space.length > 0 && attributed.length > 0) {
|
|
22371
|
+
const inSpace = new Set(space);
|
|
22372
|
+
const matches = (t2) => inSpace.has(t2.speaker) || !!t2.attribution?.rawSpeaker && inSpace.has(t2.attribution.rawSpeaker);
|
|
22373
|
+
if (!attributed.some(matches)) {
|
|
22374
|
+
const labels = [...new Set(attributed.map((t2) => t2.speaker))].sort();
|
|
22375
|
+
issues.push(
|
|
22376
|
+
`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`
|
|
22377
|
+
);
|
|
22378
|
+
} else {
|
|
22379
|
+
for (const t2 of attributed) {
|
|
22380
|
+
if (!matches(t2)) warnings.push(`track "${t2.id}": speaker "${t2.speaker}" is not in the edit's speaker set`);
|
|
22381
|
+
}
|
|
22382
|
+
}
|
|
22383
|
+
}
|
|
22384
|
+
}
|
|
22385
|
+
return f;
|
|
22386
|
+
}
|
|
22387
|
+
var BOX_FINDINGS_PER_RULE = 5;
|
|
22388
|
+
var MAX_LISTED_FINDINGS = 100;
|
|
22389
|
+
function boxIssues(b, at) {
|
|
22390
|
+
const out = [];
|
|
22391
|
+
for (const k of ["x", "y", "w", "h"]) {
|
|
22392
|
+
const v = b?.[k];
|
|
22393
|
+
if (!isNum(v) || v < 0 || v > 1) out.push([`with ${k} out of 0..1`, `${at}: ${k}=${v} out of 0..1`]);
|
|
22394
|
+
}
|
|
22395
|
+
if (out.length > 0) return out;
|
|
22396
|
+
if (b.w <= 0 || b.h <= 0) out.push(["with a non-positive w/h", `${at}: non-positive w/h`]);
|
|
22397
|
+
if (b.x + b.w > 1 + 1e-9) out.push(["extending past the right edge", `${at}: extends past the right edge (x+w>1)`]);
|
|
22398
|
+
if (b.y + b.h > 1 + 1e-9) out.push(["extending past the bottom edge", `${at}: extends past the bottom edge (y+h>1)`]);
|
|
22399
|
+
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`]);
|
|
22400
|
+
return out;
|
|
22401
|
+
}
|
|
22402
|
+
function capListed(list, noun) {
|
|
22403
|
+
if (list.length <= MAX_LISTED_FINDINGS) return [...list];
|
|
22404
|
+
return [...list.slice(0, MAX_LISTED_FINDINGS), `${list.length - MAX_LISTED_FINDINGS} more ${noun} not listed`];
|
|
22405
|
+
}
|
|
22406
|
+
function inSpans(spans, ms) {
|
|
22407
|
+
let lo = 0;
|
|
22408
|
+
let hi = spans.length - 1;
|
|
22409
|
+
while (lo <= hi) {
|
|
22410
|
+
const mid = lo + hi >> 1;
|
|
22411
|
+
const sp = spans[mid];
|
|
22412
|
+
if (ms < sp.startMs) hi = mid - 1;
|
|
22413
|
+
else if (ms >= sp.endMs) lo = mid + 1;
|
|
22414
|
+
else return true;
|
|
22415
|
+
}
|
|
22416
|
+
return false;
|
|
22417
|
+
}
|
|
22418
|
+
function validateSpeakerTracks(set, opts = {}) {
|
|
22419
|
+
const safe = isObj(set) ? set : {};
|
|
22420
|
+
const f = validateCommon(safe, opts, (t2, source, { issues }) => {
|
|
22421
|
+
const boxes = Array.isArray(t2?.boxes) ? t2.boxes : [];
|
|
22422
|
+
const spans = Array.isArray(source.sampledSpans) ? source.sampledSpans : [];
|
|
22423
|
+
let first = Infinity;
|
|
22424
|
+
let last = -Infinity;
|
|
22425
|
+
const seen = /* @__PURE__ */ new Map();
|
|
22426
|
+
const report = ([rule, message]) => {
|
|
22427
|
+
const n = (seen.get(rule) ?? 0) + 1;
|
|
22428
|
+
seen.set(rule, n);
|
|
22429
|
+
if (n <= BOX_FINDINGS_PER_RULE) issues.push(message);
|
|
22430
|
+
};
|
|
22431
|
+
const outside = `outside every sampled span of source "${source.sourceId}"`;
|
|
22432
|
+
boxes.forEach((b, j) => {
|
|
22433
|
+
const at = `track "${t2.id}" box[${j}]`;
|
|
22434
|
+
boxIssues(b, at).forEach(report);
|
|
22435
|
+
if (!isNum(b?.ms)) {
|
|
22436
|
+
report(["whose ms is not a number", `${at}: ms is not a number`]);
|
|
22437
|
+
return;
|
|
22438
|
+
}
|
|
22439
|
+
if (!Number.isInteger(b.ms)) report(["whose ms is not an integer", `${at}: ms ${b.ms} is not an integer`]);
|
|
22440
|
+
const prev = boxes[j - 1]?.ms;
|
|
22441
|
+
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})`]);
|
|
22442
|
+
if (!inSpans(spans, b.ms)) report([outside, `${at}: ms ${b.ms} is ${outside}`]);
|
|
22443
|
+
first = Math.min(first, b.ms);
|
|
22444
|
+
last = Math.max(last, b.ms);
|
|
22445
|
+
});
|
|
22446
|
+
for (const [rule, n] of seen) {
|
|
22447
|
+
if (n > BOX_FINDINGS_PER_RULE) issues.push(`track "${t2.id}": ${n - BOX_FINDINGS_PER_RULE} more boxes ${rule}`);
|
|
22448
|
+
}
|
|
22449
|
+
const cut = (Array.isArray(source.cuts) ? source.cuts : []).find((c) => first < c && c <= last);
|
|
22450
|
+
if (cut !== void 0) issues.push(`track "${t2.id}": spans the cut at ${cut} ms (boxes ${first}..${last})`);
|
|
22451
|
+
return boxes.length;
|
|
22452
|
+
});
|
|
22453
|
+
const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
|
|
22454
|
+
const bytes = opts.serializedBytes ?? new TextEncoder().encode(JSON.stringify(safe)).length;
|
|
22455
|
+
if (bytes > maxBytes) f.issues.push(`the track set is ${bytes} bytes, over the cap of ${maxBytes}`);
|
|
22456
|
+
return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
|
|
22457
|
+
}
|
|
22458
|
+
function validateSpeakerTrackSetDescriptor(d, opts = {}) {
|
|
22459
|
+
const safe = isObj(d) ? d : {};
|
|
22460
|
+
const f = validateCommon(safe, opts, (t2, _source, { issues }) => {
|
|
22461
|
+
if (!(Number.isInteger(t2?.boxCount) && t2.boxCount >= 0)) {
|
|
22462
|
+
issues.push(`track "${t2?.id}": boxCount must be a non-negative integer`);
|
|
22463
|
+
return 0;
|
|
22464
|
+
}
|
|
22465
|
+
return t2.boxCount;
|
|
22466
|
+
});
|
|
22467
|
+
if (!(typeof safe.url === "string" && safe.url.trim())) f.issues.push("url is empty");
|
|
22468
|
+
if (!(typeof safe.sha256 === "string" && SHA256_HEX.test(safe.sha256))) f.issues.push("sha256 must be 64 lowercase hex characters");
|
|
22469
|
+
const maxBytes = opts.maxBytes ?? SPEAKER_TRACKS_MAX_BYTES;
|
|
22470
|
+
if (!(Number.isInteger(safe.bytes) && safe.bytes > 0)) f.issues.push("bytes must be a positive integer");
|
|
22471
|
+
else if (safe.bytes > maxBytes) f.issues.push(`the track set is ${safe.bytes} bytes, over the cap of ${maxBytes}`);
|
|
22472
|
+
return { ok: f.issues.length === 0, issues: capListed(f.issues, "issues"), warnings: capListed(f.warnings, "warnings") };
|
|
22473
|
+
}
|
|
22474
|
+
|
|
21149
22475
|
// src/camera-switch-contract.ts
|
|
21150
22476
|
var CAMERA_SWITCH_DEFAULTS = Object.freeze({
|
|
21151
22477
|
/** The shortest shot; a shorter turn (an interjection) holds the shot. */
|
|
@@ -21210,10 +22536,10 @@ function cameraSwitchEdlProblem(edl) {
|
|
|
21210
22536
|
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
22537
|
if (!Array.isArray(v.sources) || !Array.isArray(v.segments)) return "camera-switch: `edl` needs `sources` and `segments`.";
|
|
21212
22538
|
if (v.segments.length === 0) return "camera-switch: `edl` has no segments.";
|
|
21213
|
-
const
|
|
22539
|
+
const num3 = (x) => typeof x === "number" && Number.isFinite(x) ? x : void 0;
|
|
21214
22540
|
for (const [i, row] of v.segments.entries()) {
|
|
21215
22541
|
const seg = row;
|
|
21216
|
-
const inMs =
|
|
22542
|
+
const inMs = num3(seg?.inMs), outMs = num3(seg?.outMs);
|
|
21217
22543
|
if (inMs === void 0 || outMs === void 0 || !(outMs > inMs)) return `camera-switch: segment ${i} needs a numeric inMs < outMs.`;
|
|
21218
22544
|
}
|
|
21219
22545
|
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 +22572,7 @@ function cameraSwitchSettingsPayload(data, edl, transcript) {
|
|
|
21246
22572
|
}
|
|
21247
22573
|
|
|
21248
22574
|
// src/edit-plan-contract.ts
|
|
21249
|
-
var EDIT_PLAN_MODES = ["tighten", "clips", "chapters"];
|
|
22575
|
+
var EDIT_PLAN_MODES = ["tighten", "clips", "chapters", "trailer"];
|
|
21250
22576
|
var EDIT_PLAN_TIERS = ["economy", "standard", "premium"];
|
|
21251
22577
|
var EDIT_PLAN_BUCKET_MINUTES = [15, 30, 60, 90, 120, 180];
|
|
21252
22578
|
var EDIT_PLAN_MAX_MINUTES = 180;
|
|
@@ -21268,7 +22594,10 @@ function buildEditPlanCreditId(mode, tier, durationSec) {
|
|
|
21268
22594
|
return `edit-plan:${mode}:${tier}:${editPlanBucketMinutes(durationSec)}m`;
|
|
21269
22595
|
}
|
|
21270
22596
|
function asEditPlanMode(v) {
|
|
21271
|
-
return v
|
|
22597
|
+
return parseEditPlanMode(v) ?? "tighten";
|
|
22598
|
+
}
|
|
22599
|
+
function parseEditPlanMode(v) {
|
|
22600
|
+
return typeof v === "string" && EDIT_PLAN_MODES.includes(v) ? v : void 0;
|
|
21272
22601
|
}
|
|
21273
22602
|
function asEditPlanTier(v) {
|
|
21274
22603
|
return v === "economy" || v === "premium" ? v : "standard";
|
|
@@ -21343,18 +22672,24 @@ function fnv1a64(text) {
|
|
|
21343
22672
|
}
|
|
21344
22673
|
return hi.toString(16).padStart(8, "0") + lo.toString(16).padStart(8, "0");
|
|
21345
22674
|
}
|
|
22675
|
+
var basisByPlan = /* @__PURE__ */ new WeakMap();
|
|
21346
22676
|
function editPlanBasis(plan) {
|
|
21347
|
-
return fnv1a64(canonicalJson(plan) ?? "");
|
|
22677
|
+
if (typeof plan !== "object" || plan === null) return fnv1a64(canonicalJson(plan) ?? "");
|
|
22678
|
+
const cached = basisByPlan.get(plan);
|
|
22679
|
+
if (cached !== void 0) return cached;
|
|
22680
|
+
const basis = fnv1a64(canonicalJson(plan) ?? "");
|
|
22681
|
+
basisByPlan.set(plan, basis);
|
|
22682
|
+
return basis;
|
|
21348
22683
|
}
|
|
21349
|
-
var
|
|
22684
|
+
var isRecord4 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
21350
22685
|
function planShape(plan) {
|
|
21351
22686
|
if (Array.isArray(plan)) return "clips";
|
|
21352
|
-
if (
|
|
22687
|
+
if (isRecord4(plan) && Array.isArray(plan.segments)) return "edl";
|
|
21353
22688
|
return "other";
|
|
21354
22689
|
}
|
|
21355
22690
|
function checkEnvelope(edited, plan) {
|
|
21356
22691
|
if (edited === void 0 || edited === null) return { status: "none" };
|
|
21357
|
-
if (!
|
|
22692
|
+
if (!isRecord4(edited)) return { status: "invalid", issue: "editedEdl must be an object" };
|
|
21358
22693
|
if (edited.v !== EDITED_EDL_VERSION) return { status: "invalid", issue: `editedEdl.v must be ${EDITED_EDL_VERSION}` };
|
|
21359
22694
|
if (typeof edited.basis !== "string" || edited.basis.length === 0) {
|
|
21360
22695
|
return { status: "invalid", issue: "editedEdl.basis must be a non-empty string" };
|
|
@@ -21369,7 +22704,7 @@ function checkEnvelope(edited, plan) {
|
|
|
21369
22704
|
if (edited.kind === "edl") {
|
|
21370
22705
|
if (shape !== "edl") return { status: "invalid", issue: `an "edl" edit needs a Tighten plan (one EDL); this plan is ${describeShape(shape)}` };
|
|
21371
22706
|
const edl = edited.edl;
|
|
21372
|
-
if (!
|
|
22707
|
+
if (!isRecord4(edl) || !Array.isArray(edl.segments) || !Array.isArray(edl.dropped)) {
|
|
21373
22708
|
return { status: "invalid", issue: "editedEdl.edl must hold a segments array and a dropped array" };
|
|
21374
22709
|
}
|
|
21375
22710
|
} else if (edited.kind === "clips") {
|
|
@@ -21381,7 +22716,7 @@ function checkEnvelope(edited, plan) {
|
|
|
21381
22716
|
return { status: "invalid", issue: `editedEdl.clips holds ${clips.length} decisions; the plan has ${planned} clips` };
|
|
21382
22717
|
}
|
|
21383
22718
|
const bad = clips.findIndex(
|
|
21384
|
-
(c) => !
|
|
22719
|
+
(c) => !isRecord4(c) || typeof c.keep !== "boolean" || c.hook !== void 0 && typeof c.hook !== "string"
|
|
21385
22720
|
);
|
|
21386
22721
|
if (bad >= 0) return { status: "invalid", issue: `editedEdl.clips[${bad}] must be {keep: boolean, hook?: string}` };
|
|
21387
22722
|
}
|
|
@@ -21406,8 +22741,8 @@ function withHook(clip, hook) {
|
|
|
21406
22741
|
return clip;
|
|
21407
22742
|
}
|
|
21408
22743
|
}
|
|
21409
|
-
if (!
|
|
21410
|
-
const meta =
|
|
22744
|
+
if (!isRecord4(value)) return clip;
|
|
22745
|
+
const meta = isRecord4(value.meta) ? value.meta : {};
|
|
21411
22746
|
return { ...value, meta: { ...meta, hook } };
|
|
21412
22747
|
}
|
|
21413
22748
|
function resolveEditPlanOutput(plan, editedEdl) {
|
|
@@ -21434,6 +22769,11 @@ function editPlanSavedOutput(data) {
|
|
|
21434
22769
|
const { status: _status, ...output } = resolveEditPlanOutput(plan, data.editedEdl);
|
|
21435
22770
|
return output;
|
|
21436
22771
|
}
|
|
22772
|
+
function editPlanResultPatch(plan, editedEdl) {
|
|
22773
|
+
const basis = isRecord4(editedEdl) ? editedEdl.basis : void 0;
|
|
22774
|
+
const madeOnThisPlan = typeof basis === "string" && basis.length > 0 && basis === editPlanBasis(plan);
|
|
22775
|
+
return madeOnThisPlan ? { generatedJson: plan } : { generatedJson: plan, editedEdl: void 0 };
|
|
22776
|
+
}
|
|
21437
22777
|
function validateEditedEdl(editedEdl, plan) {
|
|
21438
22778
|
const check = checkEnvelope(editedEdl, plan);
|
|
21439
22779
|
if (check.status === "none") return { ok: false, issues: ["there is no edit"], warnings: [] };
|
|
@@ -21443,6 +22783,589 @@ function validateEditedEdl(editedEdl, plan) {
|
|
|
21443
22783
|
return validateEdl(resolved);
|
|
21444
22784
|
}
|
|
21445
22785
|
|
|
22786
|
+
// src/render-output.ts
|
|
22787
|
+
var MEDIUM_FIELD = {
|
|
22788
|
+
video: "generatedVideoUrl",
|
|
22789
|
+
audio: "generatedAudioUrl"
|
|
22790
|
+
};
|
|
22791
|
+
var str5 = (v) => typeof v === "string" && v.length > 0 ? v : void 0;
|
|
22792
|
+
var BASIS = /^[0-9a-f]{16}$/;
|
|
22793
|
+
var basisOf = (v) => typeof v === "string" && BASIS.test(v) ? v : void 0;
|
|
22794
|
+
function renderResultStamp(output) {
|
|
22795
|
+
const o = output && typeof output === "object" ? output : {};
|
|
22796
|
+
const quality = o.quality === "proxy" || o.quality === "final" ? o.quality : void 0;
|
|
22797
|
+
const clipKey = str5(o.clipKey);
|
|
22798
|
+
const planBasis = basisOf(o.planBasis);
|
|
22799
|
+
const renderBasis = basisOf(o.renderBasis);
|
|
22800
|
+
return {
|
|
22801
|
+
...quality ? { quality } : {},
|
|
22802
|
+
...clipKey ? { clipKey } : {},
|
|
22803
|
+
...planBasis ? { planBasis } : {},
|
|
22804
|
+
...renderBasis ? { renderBasis } : {}
|
|
22805
|
+
};
|
|
22806
|
+
}
|
|
22807
|
+
function mediumOf(data) {
|
|
22808
|
+
return data.output === "audio" ? "audio" : "video";
|
|
22809
|
+
}
|
|
22810
|
+
function resultsOf(data) {
|
|
22811
|
+
return Array.isArray(data.generatedResults) ? data.generatedResults : [];
|
|
22812
|
+
}
|
|
22813
|
+
function itemOf(url, medium, entry) {
|
|
22814
|
+
const jobId = str5(entry?.jobId);
|
|
22815
|
+
const thumbnailUrl = str5(entry?.thumbnailUrl);
|
|
22816
|
+
return {
|
|
22817
|
+
url,
|
|
22818
|
+
medium,
|
|
22819
|
+
...jobId ? { jobId } : {},
|
|
22820
|
+
...thumbnailUrl ? { thumbnailUrl } : {},
|
|
22821
|
+
...entry ? renderResultStamp(entry) : {}
|
|
22822
|
+
};
|
|
22823
|
+
}
|
|
22824
|
+
function savedRenderOutput(data) {
|
|
22825
|
+
const medium = mediumOf(data);
|
|
22826
|
+
const results = resultsOf(data);
|
|
22827
|
+
const index = typeof data.activeResultIndex === "number" ? data.activeResultIndex : 0;
|
|
22828
|
+
const selected = results[index] ?? results[0];
|
|
22829
|
+
const selectedUrl = str5(selected?.url);
|
|
22830
|
+
if (selectedUrl) return itemOf(selectedUrl, medium, selected);
|
|
22831
|
+
const own = str5(data[MEDIUM_FIELD[medium]]);
|
|
22832
|
+
if (own) return { url: own, medium };
|
|
22833
|
+
const other = medium === "video" ? "audio" : "video";
|
|
22834
|
+
const otherUrl = str5(data[MEDIUM_FIELD[other]]);
|
|
22835
|
+
return otherUrl ? { url: otherUrl, medium: other } : void 0;
|
|
22836
|
+
}
|
|
22837
|
+
function savedRenderBatch(data) {
|
|
22838
|
+
const batch = data.__listResults;
|
|
22839
|
+
if (!Array.isArray(batch) || batch.length === 0) return void 0;
|
|
22840
|
+
const medium = mediumOf(data);
|
|
22841
|
+
const byUrl = /* @__PURE__ */ new Map();
|
|
22842
|
+
for (const entry of resultsOf(data)) {
|
|
22843
|
+
const url = str5(entry.url);
|
|
22844
|
+
if (url && !byUrl.has(url)) byUrl.set(url, entry);
|
|
22845
|
+
}
|
|
22846
|
+
return batch.map((row) => {
|
|
22847
|
+
const url = str5(row);
|
|
22848
|
+
return url ? itemOf(url, medium, byUrl.get(url)) : null;
|
|
22849
|
+
});
|
|
22850
|
+
}
|
|
22851
|
+
function savedRenderBatchUrls(data) {
|
|
22852
|
+
const batch = savedRenderBatch(data);
|
|
22853
|
+
return batch ? batch.map((item) => item?.url ?? "") : void 0;
|
|
22854
|
+
}
|
|
22855
|
+
function edlSpanKey(edl) {
|
|
22856
|
+
if (!edl || typeof edl !== "object" || Array.isArray(edl)) return void 0;
|
|
22857
|
+
let segments;
|
|
22858
|
+
try {
|
|
22859
|
+
segments = normalizeEdl(edl).segments;
|
|
22860
|
+
} catch {
|
|
22861
|
+
return void 0;
|
|
22862
|
+
}
|
|
22863
|
+
if (segments.length === 0) return void 0;
|
|
22864
|
+
let min = Infinity;
|
|
22865
|
+
let max = -Infinity;
|
|
22866
|
+
for (const s of segments) {
|
|
22867
|
+
if (s.inMs < min) min = s.inMs;
|
|
22868
|
+
if (s.outMs > max) max = s.outMs;
|
|
22869
|
+
}
|
|
22870
|
+
return Number.isFinite(min) && Number.isFinite(max) ? `${min}-${max}` : void 0;
|
|
22871
|
+
}
|
|
22872
|
+
function planClipKeyAt(plan, row) {
|
|
22873
|
+
if (!Array.isArray(plan)) return void 0;
|
|
22874
|
+
let clip = plan[row];
|
|
22875
|
+
if (typeof clip === "string") {
|
|
22876
|
+
if (!clip.trim()) return void 0;
|
|
22877
|
+
try {
|
|
22878
|
+
clip = JSON.parse(clip);
|
|
22879
|
+
} catch {
|
|
22880
|
+
return void 0;
|
|
22881
|
+
}
|
|
22882
|
+
}
|
|
22883
|
+
return edlSpanKey(clip);
|
|
22884
|
+
}
|
|
22885
|
+
var TELEPORT_TYPES2 = /* @__PURE__ */ new Set(["teleport-send", "teleport-receive"]);
|
|
22886
|
+
var EDL_PASS_THROUGH_TYPES = /* @__PURE__ */ new Set(["camera-switch"]);
|
|
22887
|
+
function outputModeOf2(data) {
|
|
22888
|
+
const mode = data && typeof data === "object" ? data.outputMode : void 0;
|
|
22889
|
+
return typeof mode === "string" ? mode : void 0;
|
|
22890
|
+
}
|
|
22891
|
+
function renderPlanPath(renderId, nodes, edges) {
|
|
22892
|
+
const byId = new Map(nodes.map((n) => [n.id, n]));
|
|
22893
|
+
const lastEdlInto = (id) => edges.filter((e) => e.target === id && e.targetHandle === "edl").at(-1);
|
|
22894
|
+
const teleportInput = (id) => edges.find((e) => e.target === id);
|
|
22895
|
+
const visited = /* @__PURE__ */ new Set();
|
|
22896
|
+
const hops = [];
|
|
22897
|
+
let consumer = lastEdlInto(renderId);
|
|
22898
|
+
let edge = consumer;
|
|
22899
|
+
while (edge && consumer) {
|
|
22900
|
+
const node = byId.get(edge.source);
|
|
22901
|
+
if (!node || visited.has(node.id)) return void 0;
|
|
22902
|
+
visited.add(node.id);
|
|
22903
|
+
if (TELEPORT_TYPES2.has(node.type ?? "")) {
|
|
22904
|
+
edge = teleportInput(node.id);
|
|
22905
|
+
continue;
|
|
22906
|
+
}
|
|
22907
|
+
const mode = outputModeOf2(consumer.data) ?? defaultEdgeOutputMode(node.type, edge.sourceHandle);
|
|
22908
|
+
hops.unshift({ edge: consumer, each: mode === "each", ...node.type ? { source: node.type } : {} });
|
|
22909
|
+
if (node.type === "edit-plan") return { planId: node.id, hops };
|
|
22910
|
+
if (!EDL_PASS_THROUGH_TYPES.has(node.type ?? "")) return void 0;
|
|
22911
|
+
consumer = lastEdlInto(node.id);
|
|
22912
|
+
edge = consumer;
|
|
22913
|
+
}
|
|
22914
|
+
return void 0;
|
|
22915
|
+
}
|
|
22916
|
+
function passThroughRan(path, ranIds) {
|
|
22917
|
+
return path.hops.slice(0, -1).every((hop) => ranIds.has(hop.edge.target));
|
|
22918
|
+
}
|
|
22919
|
+
function renderPlanNodeId(renderId, nodes, edges) {
|
|
22920
|
+
return renderPlanPath(renderId, nodes, edges)?.planId;
|
|
22921
|
+
}
|
|
22922
|
+
var isHole = (clip) => clip == null || typeof clip === "string" && !clip.trim();
|
|
22923
|
+
var keptClips = (clips) => clips.filter((clip) => !isHole(clip));
|
|
22924
|
+
function singlePick(clips, hop) {
|
|
22925
|
+
const data = hop.edge.data;
|
|
22926
|
+
const mode = outputModeOf2(hop.edge.data);
|
|
22927
|
+
if (mode === "item") {
|
|
22928
|
+
const expr = typeof data?.itemIndex === "string" ? data.itemIndex : "1";
|
|
22929
|
+
return [clips[resolveIndex(expr, clips.length)] ?? clips[0]];
|
|
22930
|
+
}
|
|
22931
|
+
if (mode?.startsWith("item:")) return [clips[parseInt(mode.slice(5), 10)] ?? clips[0]];
|
|
22932
|
+
if (mode === "all") return selectListItems(clips, data);
|
|
22933
|
+
if (hop.source === "edit-plan") return keptClips(clips).slice(0, 1);
|
|
22934
|
+
return clips.length === 1 ? clips : [];
|
|
22935
|
+
}
|
|
22936
|
+
function renderPlanValue(plan, row, hops = []) {
|
|
22937
|
+
if (!Array.isArray(plan)) return plan === null || typeof plan !== "object" ? void 0 : plan;
|
|
22938
|
+
let clips = plan;
|
|
22939
|
+
for (const [i, hop] of hops.entries()) {
|
|
22940
|
+
if (clips.length === 0) return void 0;
|
|
22941
|
+
if (hop.each) {
|
|
22942
|
+
clips = selectListItems(clips, hop.edge.data);
|
|
22943
|
+
if (i < hops.length - 1) clips = keptClips(clips);
|
|
22944
|
+
} else {
|
|
22945
|
+
clips = singlePick(clips, hop);
|
|
22946
|
+
if (clips.length !== 1) return void 0;
|
|
22947
|
+
}
|
|
22948
|
+
}
|
|
22949
|
+
if (clips.length === 0) return void 0;
|
|
22950
|
+
const rowed = row !== void 0 && (hops.at(-1)?.each ?? true);
|
|
22951
|
+
if (rowed) {
|
|
22952
|
+
const clip = clips[row % clips.length];
|
|
22953
|
+
return isHole(clip) ? void 0 : clip;
|
|
22954
|
+
}
|
|
22955
|
+
const kept = keptClips(clips);
|
|
22956
|
+
return kept.length === 1 ? kept[0] : void 0;
|
|
22957
|
+
}
|
|
22958
|
+
function renderClipKey(plan, row, hops = []) {
|
|
22959
|
+
if (!Array.isArray(plan)) return void 0;
|
|
22960
|
+
const clip = renderPlanValue(plan, row, hops);
|
|
22961
|
+
return clip === void 0 ? void 0 : planClipKeyAt([clip], 0);
|
|
22962
|
+
}
|
|
22963
|
+
function renderPlanClipKey(renderId, nodes, edges, planClips, row) {
|
|
22964
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
22965
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
22966
|
+
if (!path || !planNode) return void 0;
|
|
22967
|
+
return renderClipKey(planClips(planNode), row, path.hops);
|
|
22968
|
+
}
|
|
22969
|
+
function renderPlanRowClipKeys(renderId, nodes, edges, planClips, rows, ranIds) {
|
|
22970
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
22971
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
22972
|
+
if (!path || !planNode || !passThroughRan(path, ranIds)) return rows.map(() => void 0);
|
|
22973
|
+
const plan = planClips(planNode);
|
|
22974
|
+
return rows.map((row) => renderClipKey(plan, row, path.hops));
|
|
22975
|
+
}
|
|
22976
|
+
function renderRunQuality(data) {
|
|
22977
|
+
return data?.quality === "proxy" ? "proxy" : "final";
|
|
22978
|
+
}
|
|
22979
|
+
function renderSentRowStamps(quality, clipKeys) {
|
|
22980
|
+
return clipKeys.map((clipKey) => ({ quality, ...clipKey ? { clipKey } : {} }));
|
|
22981
|
+
}
|
|
22982
|
+
var readBasisByValue = /* @__PURE__ */ new WeakMap();
|
|
22983
|
+
var isPlainObject2 = (v) => !!v && typeof v === "object" && !Array.isArray(v);
|
|
22984
|
+
function renderReadBasis(value) {
|
|
22985
|
+
let v = value;
|
|
22986
|
+
if (typeof v === "string") {
|
|
22987
|
+
if (!v.trim()) return void 0;
|
|
22988
|
+
try {
|
|
22989
|
+
v = JSON.parse(v);
|
|
22990
|
+
} catch {
|
|
22991
|
+
return void 0;
|
|
22992
|
+
}
|
|
22993
|
+
}
|
|
22994
|
+
if (!isPlainObject2(v)) return void 0;
|
|
22995
|
+
const cached = readBasisByValue.get(v);
|
|
22996
|
+
if (cached !== void 0) return cached;
|
|
22997
|
+
const { meta: _meta, ...rest } = v;
|
|
22998
|
+
const basis = editPlanBasis(rest);
|
|
22999
|
+
readBasisByValue.set(v, basis);
|
|
23000
|
+
return basis;
|
|
23001
|
+
}
|
|
23002
|
+
function renderSettingsBasis(settings, sources = []) {
|
|
23003
|
+
const raw = settings.crossfadeMs;
|
|
23004
|
+
const crossfadeMs = typeof raw === "number" && Number.isFinite(raw) ? Math.max(0, Math.round(raw)) : 0;
|
|
23005
|
+
return editPlanBasis({
|
|
23006
|
+
crossfadeMs,
|
|
23007
|
+
output: settings.output === "audio" ? "audio" : "video",
|
|
23008
|
+
sources: sources.map((url) => typeof url === "string" ? url : "")
|
|
23009
|
+
});
|
|
23010
|
+
}
|
|
23011
|
+
function renderPlanBasis(renderId, nodes, edges, planOutput, row, ranIds) {
|
|
23012
|
+
const path = renderPlanPath(renderId, nodes, edges);
|
|
23013
|
+
const planNode = path ? nodes.find((n) => n.id === path.planId) : void 0;
|
|
23014
|
+
if (!path || !planNode) return void 0;
|
|
23015
|
+
if (!passThroughRan(path, ranIds)) return void 0;
|
|
23016
|
+
return renderReadBasis(renderPlanValue(planOutput(planNode), row, path.hops));
|
|
23017
|
+
}
|
|
23018
|
+
|
|
23019
|
+
// src/handle-aliases.ts
|
|
23020
|
+
var LEGACY_SOURCE_HANDLE_ALIASES = {
|
|
23021
|
+
// Batch 1
|
|
23022
|
+
"generate-music": { "audio-out": "audio" },
|
|
23023
|
+
// Batch 2 — Suno output id normalization
|
|
23024
|
+
"suno-add-instrumental": { "audio-out": "audio" },
|
|
23025
|
+
"suno-add-vocals": { "audio-out": "audio" },
|
|
23026
|
+
"suno-convert-wav": { "audio-out": "audio" },
|
|
23027
|
+
"suno-mashup": { "audio-out": "audio" },
|
|
23028
|
+
"suno-replace-section": { "audio-out": "audio" },
|
|
23029
|
+
"suno-upload-extend": { "audio-out": "audio" },
|
|
23030
|
+
"suno-music-video": { "video-out": "video" },
|
|
23031
|
+
"suno-style-boost": { "text-out": "text" },
|
|
23032
|
+
"suno-separate": { "vocal-out": "vocals", "instrumental-out": "instrumental" },
|
|
23033
|
+
// Batch 4 — Processing output id normalization (non-ffmpeg ones only)
|
|
23034
|
+
"split-text": { out: "text" },
|
|
23035
|
+
// split-media produces dual-typed outputs; map each leg of the legacy
|
|
23036
|
+
// `*-out` pair to the new single-word form.
|
|
23037
|
+
"split-media": { "audio-out": "audio", "video-out": "video" },
|
|
23038
|
+
// Phase 20 — Image-producer output id normalization. Pre-migration these
|
|
23039
|
+
// nodes shipped a single generic `out` source handle; after the typed-handle
|
|
23040
|
+
// migration their source pip is the canonical type name.
|
|
23041
|
+
"edit-image": { out: "image" },
|
|
23042
|
+
"modify-image": { out: "image" },
|
|
23043
|
+
"image-to-image": { out: "image" },
|
|
23044
|
+
"upscale-image": { out: "image" },
|
|
23045
|
+
"remove-background": { out: "image" },
|
|
23046
|
+
"face-swap": { out: "video" },
|
|
23047
|
+
// Phase 21 — Video-producer output id normalization.
|
|
23048
|
+
"motion-transfer": { out: "video" },
|
|
23049
|
+
// Phase 22 — Upload/source-node output id normalization.
|
|
23050
|
+
"reference-audio": { "audio-out": "audio" },
|
|
23051
|
+
// Phase 24c — Compositing-stragglers output id normalization.
|
|
23052
|
+
"speed-ramp": { "video-out": "video" },
|
|
23053
|
+
"fade-video": { "video-out": "video" },
|
|
23054
|
+
"transcode-video": { "video-out": "video" },
|
|
23055
|
+
"manual-edit": { "video-out": "video" },
|
|
23056
|
+
"social-media-format": { "media-out": "media", "text-out": "text" },
|
|
23057
|
+
// Telegram Channel Feed: the pip was `out` until it took the platform's
|
|
23058
|
+
// text id (`text`), which its definition and docs always named.
|
|
23059
|
+
"telegram-channel-feed": { out: "text" },
|
|
23060
|
+
// Telegram Trigger: the docs once named six outputs; the component renders
|
|
23061
|
+
// one, `out`, and media rides it by kind on both engines.
|
|
23062
|
+
"telegram-trigger": { text: "out", imageUrl: "out", videoUrl: "out", audioUrl: "out" }
|
|
23063
|
+
};
|
|
23064
|
+
var LEGACY_TARGET_HANDLE_ALIASES = {
|
|
23065
|
+
// Batch 1
|
|
23066
|
+
"text-to-speech": { in: "prompt" },
|
|
23067
|
+
"text-to-audio": { in: "prompt" },
|
|
23068
|
+
"generate-music": { in: "prompt" },
|
|
23069
|
+
"audio-isolation": { in: "audio" },
|
|
23070
|
+
"text-to-dialogue": { in: "prompt" },
|
|
23071
|
+
"voice-changer": { in: "audio" },
|
|
23072
|
+
dubbing: { in: "audio" },
|
|
23073
|
+
// voice-remix / voice-design keep the legacy `audio-style` target id intact
|
|
23074
|
+
// — that name is hard-coded in the runtime hint composers. Only `in` moves.
|
|
23075
|
+
"voice-remix": { in: "audio" },
|
|
23076
|
+
"voice-design": { in: "prompt" },
|
|
23077
|
+
"forced-alignment": { in: "audio" },
|
|
23078
|
+
// Batch 2 — Suno target id normalization
|
|
23079
|
+
"suno-generate": { in: "prompt" },
|
|
23080
|
+
"suno-lyrics": { in: "prompt" },
|
|
23081
|
+
"suno-style-boost": { text: "prompt" },
|
|
23082
|
+
// Batch 3 — Script & Text target id normalization
|
|
23083
|
+
"generate-script": { in: "prompt" },
|
|
23084
|
+
transcribe: { in: "audio" },
|
|
23085
|
+
// Batch 4 — Processing target id normalization (non-ffmpeg only)
|
|
23086
|
+
"combine-text": { in: "text" },
|
|
23087
|
+
"split-text": { in: "text" },
|
|
23088
|
+
"split-media": { "video-in": "video", "audio-in": "audio" },
|
|
23089
|
+
// Phase 20 — Image-producer target id normalization.
|
|
23090
|
+
"face-swap": { in: "video" },
|
|
23091
|
+
// Phase 21 — Video-producer target id normalization.
|
|
23092
|
+
"video-to-video": { in: "video" },
|
|
23093
|
+
"video-upscale": { in: "video" },
|
|
23094
|
+
"extend-video": { in: "video" },
|
|
23095
|
+
"motion-transfer": { in: "video" },
|
|
23096
|
+
"lip-sync": { videoIn: "video" },
|
|
23097
|
+
// Phase 24c — Compositing-stragglers target id normalization.
|
|
23098
|
+
"after-effects": { in: "video" },
|
|
23099
|
+
"motion-graphics": { in: "video" },
|
|
23100
|
+
"lottie-overlay": { in: "video" },
|
|
23101
|
+
// video-composer renders ONE target pip, `in` ("Media"). An earlier table
|
|
23102
|
+
// sent saved edges to a `video` pip the node never had; this heals those.
|
|
23103
|
+
"video-composer": { video: "in" },
|
|
23104
|
+
"render-video": { in: "composition" },
|
|
23105
|
+
"speed-ramp": { in: "video" },
|
|
23106
|
+
"fade-video": { in: "video" },
|
|
23107
|
+
"transcode-video": { in: "video" },
|
|
23108
|
+
// (manual-edit keeps `in` as a multi-asset target.)
|
|
23109
|
+
"social-media-format": { "media-in": "media", "text-in": "text" }
|
|
23110
|
+
};
|
|
23111
|
+
var DYNAMIC_HANDLE_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
23112
|
+
"list",
|
|
23113
|
+
"loop",
|
|
23114
|
+
"group",
|
|
23115
|
+
"collect",
|
|
23116
|
+
"router",
|
|
23117
|
+
"component",
|
|
23118
|
+
"sub-workflow",
|
|
23119
|
+
"sub-workflow-input",
|
|
23120
|
+
"sub-workflow-output",
|
|
23121
|
+
"selector",
|
|
23122
|
+
// Payload parameters become handles.
|
|
23123
|
+
"webhook-trigger",
|
|
23124
|
+
// One `variant:<id>` handle per layer.
|
|
23125
|
+
"image-overlay"
|
|
23126
|
+
]);
|
|
23127
|
+
function canonicalSourceHandle(nodeType, handle) {
|
|
23128
|
+
return nodeType && LEGACY_SOURCE_HANDLE_ALIASES[nodeType]?.[handle] || handle;
|
|
23129
|
+
}
|
|
23130
|
+
function canonicalTargetHandle(nodeType, handle) {
|
|
23131
|
+
return nodeType && LEGACY_TARGET_HANDLE_ALIASES[nodeType]?.[handle] || handle;
|
|
23132
|
+
}
|
|
23133
|
+
var SUNO_IN_CLASSIFIER_TARGETS = /* @__PURE__ */ new Set([
|
|
23134
|
+
"suno-cover",
|
|
23135
|
+
"suno-extend",
|
|
23136
|
+
"suno-replace-section",
|
|
23137
|
+
"suno-upload-extend"
|
|
23138
|
+
]);
|
|
23139
|
+
var SUNO_VOICE_CAPABLE_TARGETS = /* @__PURE__ */ new Set(["suno-generate", "suno-cover", "suno-extend"]);
|
|
23140
|
+
var IMAGE_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
|
|
23141
|
+
"generate-image",
|
|
23142
|
+
"upload-image",
|
|
23143
|
+
"edit-image",
|
|
23144
|
+
"image-to-image",
|
|
23145
|
+
"modify-image",
|
|
23146
|
+
"upscale-image",
|
|
23147
|
+
"remove-background",
|
|
23148
|
+
"generate-mask",
|
|
23149
|
+
"scene"
|
|
23150
|
+
]);
|
|
23151
|
+
var IDENTITY_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([
|
|
23152
|
+
"character",
|
|
23153
|
+
"face",
|
|
23154
|
+
"object",
|
|
23155
|
+
"creature",
|
|
23156
|
+
"location"
|
|
23157
|
+
]);
|
|
23158
|
+
var VIDEO_SOURCE_TYPES_FOR_CLASSIFIER = VIDEO_PRODUCER_TYPES;
|
|
23159
|
+
var AUDIO_SOURCE_TYPES_FOR_CLASSIFIER = /* @__PURE__ */ new Set([...AUDIO_PRODUCER_TYPES, "youtube-video"]);
|
|
23160
|
+
var DUAL_MODE_REVOICE_TARGETS = /* @__PURE__ */ new Set(["voice-changer", "voice-changer-pro", "dubbing"]);
|
|
23161
|
+
function classifyLegacyTargetHandle(targetType, handle, sourceType, sentHandle = handle) {
|
|
23162
|
+
if (!targetType) return handle;
|
|
23163
|
+
const source = sourceType ?? "";
|
|
23164
|
+
if (source === "suno-voice" && SUNO_VOICE_CAPABLE_TARGETS.has(targetType) && (handle === "in" || handle === "prompt" || handle == null)) {
|
|
23165
|
+
return "voice";
|
|
23166
|
+
}
|
|
23167
|
+
if (SUNO_IN_CLASSIFIER_TARGETS.has(targetType) && (handle === "in" || handle == null)) {
|
|
23168
|
+
return AUDIO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "audio" : "prompt";
|
|
23169
|
+
}
|
|
23170
|
+
if (targetType === "motion-transfer" && handle === "video") {
|
|
23171
|
+
if (IDENTITY_TYPES_FOR_CLASSIFIER.has(source)) return "assets";
|
|
23172
|
+
if (IMAGE_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "image";
|
|
23173
|
+
if (!VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) return "prompt";
|
|
23174
|
+
return handle;
|
|
23175
|
+
}
|
|
23176
|
+
if ((targetType === "video-to-video" || targetType === "extend-video") && handle === "video" && !VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source)) {
|
|
23177
|
+
return "prompt";
|
|
23178
|
+
}
|
|
23179
|
+
if (DUAL_MODE_REVOICE_TARGETS.has(targetType) && (sentHandle === "in" || sentHandle == null)) {
|
|
23180
|
+
return VIDEO_SOURCE_TYPES_FOR_CLASSIFIER.has(source) ? "video" : "audio";
|
|
23181
|
+
}
|
|
23182
|
+
return handle;
|
|
23183
|
+
}
|
|
23184
|
+
var RENDERED_OUTPUT_HANDLES = {
|
|
23185
|
+
// The ffmpeg family shipped `video-out` / `audio-out` pips through a
|
|
23186
|
+
// different migration (single `in` retained) and was left out of the alias
|
|
23187
|
+
// pass on purpose.
|
|
23188
|
+
"add-captions": ["video-out"],
|
|
23189
|
+
"adjust-volume": ["audio-out", "video-out"],
|
|
23190
|
+
"audio-fx": ["audio-out"],
|
|
23191
|
+
"combine-audio": ["audio-out"],
|
|
23192
|
+
"loop-video": ["video-out"],
|
|
23193
|
+
"merge-video-audio": ["video-out"],
|
|
23194
|
+
"mix-audio": ["audio-out"],
|
|
23195
|
+
"resize-video": ["video-out"],
|
|
23196
|
+
"trim-video": ["video-out"],
|
|
23197
|
+
// Output nodes: a pass-through `out` pip the definition does not declare.
|
|
23198
|
+
"save-to-storage": ["out"],
|
|
23199
|
+
"sub-workflow-output": ["out"],
|
|
23200
|
+
"webhook-output": ["out"],
|
|
23201
|
+
// Stem separator: one declared `audio` output, a pip per stem rendered.
|
|
23202
|
+
"audio-separation": ["bass", "drums", "guitar", "instrumental", "other", "piano", "vocals"],
|
|
23203
|
+
// Dual-mode revoice: the video pip is rendered but undeclared.
|
|
23204
|
+
"voice-changer": ["audio", "video"]
|
|
23205
|
+
};
|
|
23206
|
+
function renderedSourceHandle(nodeType, handle, declaredOutputs) {
|
|
23207
|
+
if (!nodeType || !handle) return null;
|
|
23208
|
+
const rendered = RENDERED_OUTPUT_HANDLES[nodeType];
|
|
23209
|
+
if (!rendered || rendered.includes(handle) || !declaredOutputs?.includes(handle)) return null;
|
|
23210
|
+
if (rendered.includes(`${handle}-out`)) return `${handle}-out`;
|
|
23211
|
+
return rendered.length === 1 ? rendered[0] : null;
|
|
23212
|
+
}
|
|
23213
|
+
|
|
23214
|
+
// src/telegram-channel.ts
|
|
23215
|
+
var TELEGRAM_FEED_LIMIT_MAX = 30;
|
|
23216
|
+
var TELEGRAM_FEED_PEEK_MAX = 20;
|
|
23217
|
+
var TELEGRAM_FEED_PAGE_SIZE = 20;
|
|
23218
|
+
var TELEGRAM_FEED_DEFAULT_LIMIT = 5;
|
|
23219
|
+
var TELEGRAM_FEED_DIGEST_SEPARATOR = "\n\n---\n\n";
|
|
23220
|
+
function telegramFeedDigest(posts) {
|
|
23221
|
+
return posts.map((p) => p.text).filter((t2) => typeof t2 === "string" && t2.trim().length > 0).join(TELEGRAM_FEED_DIGEST_SEPARATOR);
|
|
23222
|
+
}
|
|
23223
|
+
var isRecord5 = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
23224
|
+
var str6 = (v) => typeof v === "string" ? v : void 0;
|
|
23225
|
+
function telegramPostsFrom(value) {
|
|
23226
|
+
if (!Array.isArray(value)) return [];
|
|
23227
|
+
const out = [];
|
|
23228
|
+
for (const item of value) {
|
|
23229
|
+
if (!isRecord5(item) || typeof item.id !== "number" || !Number.isFinite(item.id) || typeof item.text !== "string") continue;
|
|
23230
|
+
const media = Array.isArray(item.media) ? item.media.filter((m) => isRecord5(m) && (m.type === "photo" || m.type === "video")) : [];
|
|
23231
|
+
const forwarded = isRecord5(item.forwardedFrom) && typeof item.forwardedFrom.name === "string" ? { name: item.forwardedFrom.name, ...str6(item.forwardedFrom.url) ? { url: item.forwardedFrom.url } : {} } : void 0;
|
|
23232
|
+
const channel2 = str6(item.channel) ?? "";
|
|
23233
|
+
out.push({
|
|
23234
|
+
id: item.id,
|
|
23235
|
+
channel: channel2,
|
|
23236
|
+
postUrl: str6(item.postUrl) ?? str6(item.url) ?? (channel2 ? `https://t.me/${channel2}/${item.id}` : ""),
|
|
23237
|
+
text: item.text,
|
|
23238
|
+
...str6(item.date) ? { date: item.date } : {},
|
|
23239
|
+
...forwarded ? { forwardedFrom: forwarded } : {},
|
|
23240
|
+
media,
|
|
23241
|
+
...str6(item.imageUrl) ? { imageUrl: item.imageUrl } : {},
|
|
23242
|
+
...str6(item.views) ? { views: item.views } : {}
|
|
23243
|
+
});
|
|
23244
|
+
}
|
|
23245
|
+
return out;
|
|
23246
|
+
}
|
|
23247
|
+
function planFeedEmission(posts, since, limit, pageMaxId) {
|
|
23248
|
+
const cap = Math.max(1, Math.min(TELEGRAM_FEED_LIMIT_MAX, Math.floor(Number.isFinite(limit) ? limit : TELEGRAM_FEED_DEFAULT_LIMIT) || 1));
|
|
23249
|
+
const byId = /* @__PURE__ */ new Map();
|
|
23250
|
+
for (const post of posts) byId.set(post.id, post);
|
|
23251
|
+
const sorted = [...byId.values()].sort((a, b) => a.id - b.id);
|
|
23252
|
+
if (since === void 0) {
|
|
23253
|
+
const emitted2 = sorted.slice(-cap);
|
|
23254
|
+
return { emitted: emitted2, latestId: sorted.length > 0 ? sorted[sorted.length - 1].id : void 0 };
|
|
23255
|
+
}
|
|
23256
|
+
const fresh = sorted.filter((p) => p.id > since);
|
|
23257
|
+
const emitted = fresh.slice(0, cap);
|
|
23258
|
+
if (emitted.length > 0) return { emitted, latestId: emitted[emitted.length - 1].id };
|
|
23259
|
+
const pastUnreadable = pageMaxId !== void 0 && Number.isFinite(pageMaxId) && pageMaxId > since;
|
|
23260
|
+
return { emitted, latestId: pastUnreadable ? pageMaxId : since };
|
|
23261
|
+
}
|
|
23262
|
+
|
|
23263
|
+
// src/ugc-run-state.ts
|
|
23264
|
+
var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"]);
|
|
23265
|
+
var UGC_NODE_RUN_STATE_KEYS = {
|
|
23266
|
+
"ugc-creator": ["result", "keepResult", "ugcOutputs"],
|
|
23267
|
+
"ugc-script": ["result", "keepResult", "ugcOutputs"],
|
|
23268
|
+
"ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
|
|
23269
|
+
"ugc-clip": ["warnings", "rerender", "__listResults", "__listResultMeta", "clipWarnings", "durationSec", "ugcOutputs"],
|
|
23270
|
+
"ugc-cards": ["result", "ugcOutputs"]
|
|
23271
|
+
};
|
|
23272
|
+
var UGC_OVERRIDABLE_FIELDS = {
|
|
23273
|
+
"ugc-creator": ["source", "gender", "photoUrl"],
|
|
23274
|
+
"ugc-script": ["targetDurationSec"],
|
|
23275
|
+
"ugc-clips": [],
|
|
23276
|
+
"ugc-clip": [],
|
|
23277
|
+
"ugc-cards": []
|
|
23278
|
+
};
|
|
23279
|
+
var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
|
|
23280
|
+
function stripUgcRunState(nodes) {
|
|
23281
|
+
return nodes.map((node) => {
|
|
23282
|
+
const type = typeof node.type === "string" ? node.type : "";
|
|
23283
|
+
if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
|
|
23284
|
+
const data = { ...node.data };
|
|
23285
|
+
for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
|
|
23286
|
+
if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
|
|
23287
|
+
return { ...node, data };
|
|
23288
|
+
});
|
|
23289
|
+
}
|
|
23290
|
+
function findUgcLockedFields(nodes, inputOverrides) {
|
|
23291
|
+
if (!nodes || !inputOverrides) return [];
|
|
23292
|
+
const found = [];
|
|
23293
|
+
for (const node of nodes) {
|
|
23294
|
+
const type = node?.type;
|
|
23295
|
+
if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
|
|
23296
|
+
const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
|
|
23297
|
+
const fields = inputOverrides[node.id];
|
|
23298
|
+
if (!fields || typeof fields !== "object") continue;
|
|
23299
|
+
for (const field of Object.keys(fields)) {
|
|
23300
|
+
if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
|
|
23301
|
+
}
|
|
23302
|
+
}
|
|
23303
|
+
return found;
|
|
23304
|
+
}
|
|
23305
|
+
|
|
23306
|
+
// src/ugc-call-body.ts
|
|
23307
|
+
var pick = (a, from, to) => a[from] !== void 0 && a[from] !== null ? { [to]: a[from] } : {};
|
|
23308
|
+
function llmFields(a) {
|
|
23309
|
+
return {
|
|
23310
|
+
...pick(a, "llmModel", "llmModel"),
|
|
23311
|
+
...pick(a, "reasoning_effort", "reasoningEffort"),
|
|
23312
|
+
...a.advanced_mode === true ? { advancedMode: true } : {},
|
|
23313
|
+
...pick(a, "temperature", "temperature"),
|
|
23314
|
+
...pick(a, "max_tokens", "maxTokens")
|
|
23315
|
+
};
|
|
23316
|
+
}
|
|
23317
|
+
function ugcCallToRouteBody(call, opts = {}) {
|
|
23318
|
+
const args = { ...call.args };
|
|
23319
|
+
if (call.imageArg) {
|
|
23320
|
+
if (!opts.image) return { error: `${call.tool} needs the previous step's image` };
|
|
23321
|
+
args[call.imageArg] = opts.image;
|
|
23322
|
+
}
|
|
23323
|
+
switch (call.tool) {
|
|
23324
|
+
case "generate_image":
|
|
23325
|
+
return {
|
|
23326
|
+
path: "/v1/generate-image",
|
|
23327
|
+
body: {
|
|
23328
|
+
...pick(args, "prompt", "prompt"),
|
|
23329
|
+
...pick(args, "model", "provider"),
|
|
23330
|
+
...pick(args, "aspect_ratio", "aspectRatio"),
|
|
23331
|
+
...pick(args, "resolution", "resolution"),
|
|
23332
|
+
...pick(args, "quality", "quality"),
|
|
23333
|
+
...pick(args, "negative_prompt", "negativePrompt")
|
|
23334
|
+
}
|
|
23335
|
+
};
|
|
23336
|
+
case "image_to_image":
|
|
23337
|
+
return {
|
|
23338
|
+
path: "/v1/image-to-image",
|
|
23339
|
+
body: {
|
|
23340
|
+
...pick(args, "image_url", "imageUrl"),
|
|
23341
|
+
...pick(args, "prompt", "prompt"),
|
|
23342
|
+
...pick(args, "model", "provider"),
|
|
23343
|
+
...pick(args, "resolution", "resolution"),
|
|
23344
|
+
...pick(args, "quality", "quality"),
|
|
23345
|
+
...pick(args, "strength", "strength"),
|
|
23346
|
+
...pick(args, "aspect_ratio", "aspectRatio"),
|
|
23347
|
+
...pick(args, "negative_prompt", "negativePrompt"),
|
|
23348
|
+
...pick(args, "seed", "seed")
|
|
23349
|
+
}
|
|
23350
|
+
};
|
|
23351
|
+
case "image_to_text": {
|
|
23352
|
+
const image = opts.image ?? (typeof args.image_url === "string" ? args.image_url : void 0);
|
|
23353
|
+
if (!image) return { error: "image_to_text needs an image" };
|
|
23354
|
+
return {
|
|
23355
|
+
path: "/v1/image-to-text/describe",
|
|
23356
|
+
body: {
|
|
23357
|
+
imageUrl: image,
|
|
23358
|
+
...pick(args, "detail_level", "detailLevel"),
|
|
23359
|
+
...pick(args, "custom_prompt", "customPrompt"),
|
|
23360
|
+
...llmFields(args)
|
|
23361
|
+
}
|
|
23362
|
+
};
|
|
23363
|
+
}
|
|
23364
|
+
default:
|
|
23365
|
+
return void 0;
|
|
23366
|
+
}
|
|
23367
|
+
}
|
|
23368
|
+
|
|
21446
23369
|
exports.ACCESS_LEVELS = ACCESS_LEVELS;
|
|
21447
23370
|
exports.ACTION_CARD_KINDS = ACTION_CARD_KINDS;
|
|
21448
23371
|
exports.ACTIVE_SCENE_HELPERS = ACTIVE_SCENE_HELPERS;
|
|
@@ -21495,6 +23418,7 @@ exports.CAPTION_LOOKS = CAPTION_LOOKS;
|
|
|
21495
23418
|
exports.CAPTION_LOOK_IDS = CAPTION_LOOK_IDS;
|
|
21496
23419
|
exports.CAPTION_MAX_WORDS_PER_LINE_MAX = CAPTION_MAX_WORDS_PER_LINE_MAX;
|
|
21497
23420
|
exports.CAPTION_MAX_WORDS_PER_LINE_MIN = CAPTION_MAX_WORDS_PER_LINE_MIN;
|
|
23421
|
+
exports.CAPTION_SEGMENT_SCHEMA_KEYS = CAPTION_SEGMENT_SCHEMA_KEYS;
|
|
21498
23422
|
exports.CARD_OUTCOME_STATES = CARD_OUTCOME_STATES;
|
|
21499
23423
|
exports.CATEGORY_DURATION_DEFAULTS = CATEGORY_DURATION_DEFAULTS;
|
|
21500
23424
|
exports.CHARACTER_ASPECT_DEFAULTS = CHARACTER_ASPECT_DEFAULTS;
|
|
@@ -21525,6 +23449,25 @@ exports.CINEMATIC_MIN_LOOKS = CINEMATIC_MIN_LOOKS;
|
|
|
21525
23449
|
exports.CINEMATIC_PROMPT_MAX = CINEMATIC_PROMPT_MAX;
|
|
21526
23450
|
exports.CINEMATIC_RESERVE_IDS = CINEMATIC_RESERVE_IDS;
|
|
21527
23451
|
exports.COLLABORATOR_ROLES = COLLABORATOR_ROLES;
|
|
23452
|
+
exports.COLLECTIONS_PAGE_DEFAULT = COLLECTIONS_PAGE_DEFAULT;
|
|
23453
|
+
exports.COLLECTIONS_PAGE_MAX = COLLECTIONS_PAGE_MAX;
|
|
23454
|
+
exports.COLLECTION_DEDUPE_KEY_MAX = COLLECTION_DEDUPE_KEY_MAX;
|
|
23455
|
+
exports.COLLECTION_DESCRIPTION_MAX = COLLECTION_DESCRIPTION_MAX;
|
|
23456
|
+
exports.COLLECTION_DIGEST_SEPARATOR = COLLECTION_DIGEST_SEPARATOR;
|
|
23457
|
+
exports.COLLECTION_EVICT_MAX_PER_WRITE = COLLECTION_EVICT_MAX_PER_WRITE;
|
|
23458
|
+
exports.COLLECTION_HEADLINE_MAX = COLLECTION_HEADLINE_MAX;
|
|
23459
|
+
exports.COLLECTION_IDEMPOTENCY_KEY_MAX = COLLECTION_IDEMPOTENCY_KEY_MAX;
|
|
23460
|
+
exports.COLLECTION_MEDIA_TYPES = COLLECTION_MEDIA_TYPES;
|
|
23461
|
+
exports.COLLECTION_NAME_MAX = COLLECTION_NAME_MAX;
|
|
23462
|
+
exports.COLLECTION_READ_LIMIT_MAX = COLLECTION_READ_LIMIT_MAX;
|
|
23463
|
+
exports.COLLECTION_READ_WINDOW_HOURS_MAX = COLLECTION_READ_WINDOW_HOURS_MAX;
|
|
23464
|
+
exports.COLLECTION_RECORD_FIELDS_BYTES_MAX = COLLECTION_RECORD_FIELDS_BYTES_MAX;
|
|
23465
|
+
exports.COLLECTION_RECORD_FIELDS_MAX = COLLECTION_RECORD_FIELDS_MAX;
|
|
23466
|
+
exports.COLLECTION_RECORD_MEDIA_MAX = COLLECTION_RECORD_MEDIA_MAX;
|
|
23467
|
+
exports.COLLECTION_RECORD_TEXT_MAX = COLLECTION_RECORD_TEXT_MAX;
|
|
23468
|
+
exports.COLLECTION_RECORD_TITLE_MAX = COLLECTION_RECORD_TITLE_MAX;
|
|
23469
|
+
exports.COLLECTION_RECORD_URL_MAX = COLLECTION_RECORD_URL_MAX;
|
|
23470
|
+
exports.COLLECTION_TIER_CAPS = COLLECTION_TIER_CAPS;
|
|
21528
23471
|
exports.COLLECT_IN_HANDLE = COLLECT_IN_HANDLE;
|
|
21529
23472
|
exports.COMBINE_TRANSITIONS = COMBINE_TRANSITIONS;
|
|
21530
23473
|
exports.COMBINE_TRANSITION_GROUP_LABELS = COMBINE_TRANSITION_GROUP_LABELS;
|
|
@@ -21549,6 +23492,11 @@ exports.CONTENT_IDEAS_PER_CHARGE = CONTENT_IDEAS_PER_CHARGE;
|
|
|
21549
23492
|
exports.CONTENT_RECIPE_IDEAS_CREDIT_IDS = CONTENT_RECIPE_IDEAS_CREDIT_IDS;
|
|
21550
23493
|
exports.CONTENT_RECIPE_SOURCE_MAX = CONTENT_RECIPE_SOURCE_MAX;
|
|
21551
23494
|
exports.CONTENT_TYPES_BY_PLATFORM = CONTENT_TYPES_BY_PLATFORM;
|
|
23495
|
+
exports.CONTINUATION_NOT_COMPLETED = CONTINUATION_NOT_COMPLETED;
|
|
23496
|
+
exports.CONTINUATION_NOT_FOUND = CONTINUATION_NOT_FOUND;
|
|
23497
|
+
exports.CONTINUATION_SUBSET_REQUIRED = CONTINUATION_SUBSET_REQUIRED;
|
|
23498
|
+
exports.CONTINUATION_VERSION_MISMATCH = CONTINUATION_VERSION_MISMATCH;
|
|
23499
|
+
exports.CONTINUATION_WORKFLOW_MISMATCH = CONTINUATION_WORKFLOW_MISMATCH;
|
|
21552
23500
|
exports.CREATURE_ATTACH_COLUMNS = CREATURE_ATTACH_COLUMNS;
|
|
21553
23501
|
exports.CREDIT_BASE_USD = CREDIT_BASE_USD;
|
|
21554
23502
|
exports.CREDIT_ROUNDING_RESOLUTION = CREDIT_ROUNDING_RESOLUTION;
|
|
@@ -21563,6 +23511,7 @@ exports.DEFAULT_CARRIED_FRACTION = DEFAULT_CARRIED_FRACTION;
|
|
|
21563
23511
|
exports.DEFAULT_CHARACTER_ANGLE_COUNT = DEFAULT_CHARACTER_ANGLE_COUNT;
|
|
21564
23512
|
exports.DEFAULT_CHARACTER_EXPRESSION_COUNT = DEFAULT_CHARACTER_EXPRESSION_COUNT;
|
|
21565
23513
|
exports.DEFAULT_CHARACTER_FACET = DEFAULT_CHARACTER_FACET;
|
|
23514
|
+
exports.DEFAULT_DIALOGUE_PROVIDER = DEFAULT_DIALOGUE_PROVIDER;
|
|
21566
23515
|
exports.DEFAULT_FRAME_DELIVERY = DEFAULT_FRAME_DELIVERY;
|
|
21567
23516
|
exports.DEFAULT_FRAME_FIT = DEFAULT_FRAME_FIT;
|
|
21568
23517
|
exports.DEFAULT_LABEL_BY_SOURCE = DEFAULT_LABEL_BY_SOURCE;
|
|
@@ -21580,6 +23529,7 @@ exports.DEFAULT_TEMPLATE_CATEGORY = DEFAULT_TEMPLATE_CATEGORY;
|
|
|
21580
23529
|
exports.DEFAULT_TEXT_TO_AUDIO_PROVIDER = DEFAULT_TEXT_TO_AUDIO_PROVIDER;
|
|
21581
23530
|
exports.DEFAULT_TRANSCRIBE_NODE_PROVIDER = DEFAULT_TRANSCRIBE_NODE_PROVIDER;
|
|
21582
23531
|
exports.DEFAULT_TRANSCRIBE_PROVIDER = DEFAULT_TRANSCRIBE_PROVIDER;
|
|
23532
|
+
exports.DEFAULT_TTS_PROVIDER = DEFAULT_TTS_PROVIDER;
|
|
21583
23533
|
exports.DEFAULT_USAGE_MODE = DEFAULT_USAGE_MODE;
|
|
21584
23534
|
exports.DEFAULT_VIDEO_ANALYSIS_MODEL = DEFAULT_VIDEO_ANALYSIS_MODEL;
|
|
21585
23535
|
exports.DEFAULT_VIDEO_ANALYSIS_TIER = DEFAULT_VIDEO_ANALYSIS_TIER;
|
|
@@ -21590,7 +23540,9 @@ exports.DEFAULT_VIDEO_PROVIDER = DEFAULT_VIDEO_PROVIDER;
|
|
|
21590
23540
|
exports.DEFAULT_VOICE_CHANGER_MODEL = DEFAULT_VOICE_CHANGER_MODEL;
|
|
21591
23541
|
exports.DEFAULT_VOICE_DESIGN_MODEL = DEFAULT_VOICE_DESIGN_MODEL;
|
|
21592
23542
|
exports.DETAIL_VARIANTS = DETAIL_VARIANTS;
|
|
23543
|
+
exports.DIALOGUE_PROVIDERS = DIALOGUE_PROVIDERS;
|
|
21593
23544
|
exports.DURATION_PRICED_PROVIDERS = DURATION_PRICED_PROVIDERS;
|
|
23545
|
+
exports.DYNAMIC_HANDLE_NODE_TYPES = DYNAMIC_HANDLE_NODE_TYPES;
|
|
21594
23546
|
exports.DYNAMIC_PRODUCER_TYPES = DYNAMIC_PRODUCER_TYPES;
|
|
21595
23547
|
exports.DetectionResultSchema = DetectionResultSchema;
|
|
21596
23548
|
exports.EDITED_EDL_VERSION = EDITED_EDL_VERSION;
|
|
@@ -21630,6 +23582,7 @@ exports.EntityStateChangeEventSchema = EntityStateChangeEventSchema;
|
|
|
21630
23582
|
exports.FACE_SWAP_PROVIDERS = FACE_SWAP_PROVIDERS;
|
|
21631
23583
|
exports.FAL_LIP_SYNC_PROVIDERS = FAL_LIP_SYNC_PROVIDERS;
|
|
21632
23584
|
exports.FAN_IN_TARGETS = FAN_IN_TARGETS;
|
|
23585
|
+
exports.FAN_OUT_ALL_OR_NOTHING_TYPES = FAN_OUT_ALL_OR_NOTHING_TYPES;
|
|
21633
23586
|
exports.FAN_OUT_EACH_HANDLES = FAN_OUT_EACH_HANDLES;
|
|
21634
23587
|
exports.FAN_OUT_EACH_TYPES = FAN_OUT_EACH_TYPES;
|
|
21635
23588
|
exports.FEATURED_ENTITIES = FEATURED_ENTITIES;
|
|
@@ -21653,6 +23606,8 @@ exports.FURNITURE_SUBCATEGORY_ORDER = FURNITURE_SUBCATEGORY_ORDER;
|
|
|
21653
23606
|
exports.FixContinuityInputSchema = FixContinuityInputSchema;
|
|
21654
23607
|
exports.FixContinuityResultSchema = FixContinuityResultSchema;
|
|
21655
23608
|
exports.GEMINI_OMNI_PROVIDERS = GEMINI_OMNI_PROVIDERS;
|
|
23609
|
+
exports.GEMINI_OMNI_VOICE_PRESETS = GEMINI_OMNI_VOICE_PRESETS;
|
|
23610
|
+
exports.GEMINI_OMNI_VOICE_PRESET_IDS = GEMINI_OMNI_VOICE_PRESET_IDS;
|
|
21656
23611
|
exports.GENERATE_TEXT_DELIMITER = GENERATE_TEXT_DELIMITER;
|
|
21657
23612
|
exports.GLOBAL_MAX_DURATION_SECONDS = GLOBAL_MAX_DURATION_SECONDS;
|
|
21658
23613
|
exports.GRANTED_ACCESS = GRANTED_ACCESS;
|
|
@@ -21685,9 +23640,11 @@ exports.IMAGE_I2I_PROVIDERS = IMAGE_I2I_PROVIDERS;
|
|
|
21685
23640
|
exports.IMAGE_MASK_MODE = IMAGE_MASK_MODE;
|
|
21686
23641
|
exports.IMAGE_OVERLAY_BASE_CREDITS = IMAGE_OVERLAY_BASE_CREDITS;
|
|
21687
23642
|
exports.IMAGE_OVERLAY_VARIANT_CREDITS = IMAGE_OVERLAY_VARIANT_CREDITS;
|
|
23643
|
+
exports.IMAGE_PRODUCER_TYPES = IMAGE_PRODUCER_TYPES;
|
|
21688
23644
|
exports.IMAGE_PROMPT_MAX = IMAGE_PROMPT_MAX;
|
|
21689
23645
|
exports.IMAGE_REF_TYPES = IMAGE_REF_TYPES;
|
|
21690
23646
|
exports.IMAGE_TO_VIDEO_PROVIDERS = IMAGE_TO_VIDEO_PROVIDERS;
|
|
23647
|
+
exports.INPUT_FIELD_EXTRA_KEYS = INPUT_FIELD_EXTRA_KEYS;
|
|
21691
23648
|
exports.INPUT_FIELD_MAP = INPUT_FIELD_MAP2;
|
|
21692
23649
|
exports.INPUT_NODE_TYPES = INPUT_NODE_TYPES;
|
|
21693
23650
|
exports.INSTAGRAM_ANALYSIS_CREDIT_ID = INSTAGRAM_ANALYSIS_CREDIT_ID;
|
|
@@ -21716,6 +23673,8 @@ exports.KINETIC_ONLY_CAPTION_LEVER_KEYS = KINETIC_ONLY_CAPTION_LEVER_KEYS;
|
|
|
21716
23673
|
exports.LANGUAGES = LANGUAGES;
|
|
21717
23674
|
exports.LEGACY_EXPOSED_FIELD_KEYS = LEGACY_EXPOSED_FIELD_KEYS;
|
|
21718
23675
|
exports.LEGACY_LOTTIE_HOST_REMAP = LEGACY_LOTTIE_HOST_REMAP;
|
|
23676
|
+
exports.LEGACY_SOURCE_HANDLE_ALIASES = LEGACY_SOURCE_HANDLE_ALIASES;
|
|
23677
|
+
exports.LEGACY_TARGET_HANDLE_ALIASES = LEGACY_TARGET_HANDLE_ALIASES;
|
|
21719
23678
|
exports.LEGACY_TEMPLATE_CATEGORIES = LEGACY_TEMPLATE_CATEGORIES;
|
|
21720
23679
|
exports.LIP_SYNC_DURATION_BUCKETS = LIP_SYNC_DURATION_BUCKETS;
|
|
21721
23680
|
exports.LIP_SYNC_MAX_AUDIO_SECONDS = LIP_SYNC_MAX_AUDIO_SECONDS;
|
|
@@ -21806,6 +23765,7 @@ exports.NODE_PRESET_EXPORT_KIND = NODE_PRESET_EXPORT_KIND;
|
|
|
21806
23765
|
exports.NODE_REF_PATTERN = NODE_REF_PATTERN;
|
|
21807
23766
|
exports.NON_EN_LOCALE_IDS = NON_EN_LOCALE_IDS;
|
|
21808
23767
|
exports.NON_PROMPT_TEXT_LANES = NON_PROMPT_TEXT_LANES;
|
|
23768
|
+
exports.NO_SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
|
|
21809
23769
|
exports.NO_SPLIT_DELIMITER = NO_SPLIT_DELIMITER;
|
|
21810
23770
|
exports.OAUTH_SCOPES = OAUTH_SCOPES;
|
|
21811
23771
|
exports.OBJECT_ASPECT_DEFAULTS = OBJECT_ASPECT_DEFAULTS;
|
|
@@ -21833,6 +23793,7 @@ exports.OVERLAY_PLATFORM_IDS = OVERLAY_PLATFORM_IDS;
|
|
|
21833
23793
|
exports.OVERLAY_SHAPES = OVERLAY_SHAPES;
|
|
21834
23794
|
exports.OVERLAY_TEXT_ALIGNS = OVERLAY_TEXT_ALIGNS;
|
|
21835
23795
|
exports.OVERLAY_VARIANT_HANDLE_PREFIX = OVERLAY_VARIANT_HANDLE_PREFIX;
|
|
23796
|
+
exports.OWNER_ONLY_LISTING_RENDER_TYPES = OWNER_ONLY_LISTING_RENDER_TYPES;
|
|
21836
23797
|
exports.OWN_LIST_NODE_TYPES = OWN_LIST_NODE_TYPES;
|
|
21837
23798
|
exports.ObjectMetadataSchema = ObjectMetadataSchema;
|
|
21838
23799
|
exports.OptimizeForModelInputSchema = OptimizeForModelInputSchema;
|
|
@@ -21863,6 +23824,9 @@ exports.PRESET_EXCLUDED_KEYS = PRESET_EXCLUDED_KEYS;
|
|
|
21863
23824
|
exports.PRESET_LABELS = PRESET_LABELS;
|
|
21864
23825
|
exports.PRESET_LEVER_GROUPS = PRESET_LEVER_GROUPS;
|
|
21865
23826
|
exports.PRESET_SETTING_KEYS = PRESET_SETTING_KEYS;
|
|
23827
|
+
exports.PREVIEW_RENDER_NESTED = PREVIEW_RENDER_NESTED;
|
|
23828
|
+
exports.PREVIEW_RENDER_NODE_TYPES = PREVIEW_RENDER_NODE_TYPES;
|
|
23829
|
+
exports.PREVIEW_REVIEW_REQUIRED = PREVIEW_REVIEW_REQUIRED;
|
|
21866
23830
|
exports.PRICING_DEFAULT_DURATION_SEC = PRICING_DEFAULT_DURATION_SEC;
|
|
21867
23831
|
exports.PRICING_DEFAULT_RESOLUTION = PRICING_DEFAULT_RESOLUTION;
|
|
21868
23832
|
exports.PRO3D_RENDER_ASPECT_RATIOS = PRO3D_RENDER_ASPECT_RATIOS;
|
|
@@ -21911,18 +23875,27 @@ exports.REFERENCE_ROLE_PRESETS = REFERENCE_ROLE_PRESETS;
|
|
|
21911
23875
|
exports.REF_HANDLE_CATEGORY = REF_HANDLE_CATEGORY;
|
|
21912
23876
|
exports.REF_IMAGE_MAX_LIMITS = REF_IMAGE_MAX_LIMITS;
|
|
21913
23877
|
exports.REF_TOKEN_NAMESPACE_PREFIXES = REF_TOKEN_NAMESPACE_PREFIXES;
|
|
23878
|
+
exports.RENDERED_OUTPUT_HANDLES = RENDERED_OUTPUT_HANDLES;
|
|
21914
23879
|
exports.RENDERING_SPEED_SUPPORT = RENDERING_SPEED_SUPPORT;
|
|
23880
|
+
exports.RENDER_FINAL_CODES = RENDER_FINAL_CODES;
|
|
23881
|
+
exports.RENDER_FINAL_NODE_NOT_FOUND = RENDER_FINAL_NODE_NOT_FOUND;
|
|
23882
|
+
exports.RENDER_FINAL_NOT_A_RENDER = RENDER_FINAL_NOT_A_RENDER;
|
|
23883
|
+
exports.RENDER_NODE_TYPES = RENDER_NODE_TYPES;
|
|
23884
|
+
exports.RENDER_NODE_TYPE_IDS = RENDER_NODE_TYPE_IDS;
|
|
21915
23885
|
exports.RENDER_VIDEO_CREDIT_ID = RENDER_VIDEO_CREDIT_ID;
|
|
21916
23886
|
exports.REPEATABLE_NODE_TYPES = REPEATABLE_NODE_TYPES;
|
|
21917
23887
|
exports.REPEAT_PLACEHOLDER = REPEAT_PLACEHOLDER;
|
|
21918
23888
|
exports.REPLICATE_LIP_SYNC_PROVIDERS = REPLICATE_LIP_SYNC_PROVIDERS;
|
|
21919
23889
|
exports.RESERVED_TEMPLATE_VARS = RESERVED_TEMPLATE_VARS;
|
|
23890
|
+
exports.RUN_CONTINUATION_CODES = RUN_CONTINUATION_CODES;
|
|
23891
|
+
exports.RUN_OVERRIDE_CLEARED_FIELDS = RUN_OVERRIDE_CLEARED_FIELDS;
|
|
21920
23892
|
exports.SAVED_POSTS_LOOKUP_MAX = SAVED_POSTS_LOOKUP_MAX;
|
|
21921
23893
|
exports.SAVED_POSTS_PAGE_MAX = SAVED_POSTS_PAGE_MAX;
|
|
21922
23894
|
exports.SAVED_POST_MAX_TAGS = SAVED_POST_MAX_TAGS;
|
|
21923
23895
|
exports.SAVED_POST_NOTE_MAX = SAVED_POST_NOTE_MAX;
|
|
21924
23896
|
exports.SAVED_POST_SOURCES = SAVED_POST_SOURCES;
|
|
21925
23897
|
exports.SAVED_POST_TAG_MAX = SAVED_POST_TAG_MAX;
|
|
23898
|
+
exports.SAVED_RENDER_STAMPS = SAVED_RENDER_STAMPS;
|
|
21926
23899
|
exports.SCENE3D_ASSERTION_RESTORED_CODE = SCENE3D_ASSERTION_RESTORED_CODE;
|
|
21927
23900
|
exports.SCENE3D_ASSET_KINDS = SCENE3D_ASSET_KINDS;
|
|
21928
23901
|
exports.SCENE3D_ASSET_ROLES = SCENE3D_ASSET_ROLES;
|
|
@@ -22037,6 +24010,14 @@ exports.SPEAKER_LAYOUTS = SPEAKER_LAYOUTS;
|
|
|
22037
24010
|
exports.SPEAKER_LAYOUT_IDS = SPEAKER_LAYOUT_IDS;
|
|
22038
24011
|
exports.SPEAKER_SWITCHES = SPEAKER_SWITCHES;
|
|
22039
24012
|
exports.SPEAKER_SWITCH_IDS = SPEAKER_SWITCH_IDS;
|
|
24013
|
+
exports.SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE = SPEAKER_TRACKS_MAX_BOXES_PER_SOURCE;
|
|
24014
|
+
exports.SPEAKER_TRACKS_MAX_BYTES = SPEAKER_TRACKS_MAX_BYTES;
|
|
24015
|
+
exports.SPEAKER_TRACKS_VERSION = SPEAKER_TRACKS_VERSION;
|
|
24016
|
+
exports.SPEAKER_TRACK_ATTRIBUTION_METHODS = SPEAKER_TRACK_ATTRIBUTION_METHODS;
|
|
24017
|
+
exports.SPEECH_FLOOR_UNITS = SPEECH_FLOOR_UNITS;
|
|
24018
|
+
exports.SPEECH_PRICE_UNIT_CHARS = SPEECH_PRICE_UNIT_CHARS;
|
|
24019
|
+
exports.SPEECH_UNIT_CREDIT_SUFFIX = SPEECH_UNIT_CREDIT_SUFFIX;
|
|
24020
|
+
exports.SPEECH_UNIT_PRICE_NOTE = SPEECH_UNIT_PRICE_NOTE;
|
|
22040
24021
|
exports.STAGE_PATCH_SCHEMA = STAGE_PATCH_SCHEMA;
|
|
22041
24022
|
exports.STATIC_CAPTION_STYLES = STATIC_CAPTION_STYLES;
|
|
22042
24023
|
exports.STRUCTURAL_SECTIONS = STRUCTURAL_SECTIONS;
|
|
@@ -22095,6 +24076,11 @@ exports.TELEGRAM_ACCOUNT_TRIGGER_MESSAGE_HANDLE = TELEGRAM_ACCOUNT_TRIGGER_MESSA
|
|
|
22095
24076
|
exports.TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE = TELEGRAM_ACCOUNT_TRIGGER_NODE_TYPE;
|
|
22096
24077
|
exports.TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES = TELEGRAM_ACCOUNT_TRIGGER_OUTPUT_HANDLES;
|
|
22097
24078
|
exports.TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS = TELEGRAM_ACCOUNT_TRIGGER_POST_FIELDS;
|
|
24079
|
+
exports.TELEGRAM_FEED_DEFAULT_LIMIT = TELEGRAM_FEED_DEFAULT_LIMIT;
|
|
24080
|
+
exports.TELEGRAM_FEED_DIGEST_SEPARATOR = TELEGRAM_FEED_DIGEST_SEPARATOR;
|
|
24081
|
+
exports.TELEGRAM_FEED_LIMIT_MAX = TELEGRAM_FEED_LIMIT_MAX;
|
|
24082
|
+
exports.TELEGRAM_FEED_PAGE_SIZE = TELEGRAM_FEED_PAGE_SIZE;
|
|
24083
|
+
exports.TELEGRAM_FEED_PEEK_MAX = TELEGRAM_FEED_PEEK_MAX;
|
|
22098
24084
|
exports.TELEGRAM_SEND_AS = TELEGRAM_SEND_AS;
|
|
22099
24085
|
exports.TELEGRAM_SEND_DESTINATIONS = TELEGRAM_SEND_DESTINATIONS;
|
|
22100
24086
|
exports.TELEGRAM_TRIGGER_NODE_TYPE = TELEGRAM_TRIGGER_NODE_TYPE;
|
|
@@ -22113,11 +24099,15 @@ exports.TRANSCRIBE_PROVIDERS = TRANSCRIBE_PROVIDERS;
|
|
|
22113
24099
|
exports.TRANSCRIBE_PROVIDER_CAPABILITIES = TRANSCRIBE_PROVIDER_CAPABILITIES;
|
|
22114
24100
|
exports.TRANSIENT_RUNTIME_KEYS = TRANSIENT_RUNTIME_KEYS;
|
|
22115
24101
|
exports.TTS_FALLBACK_PROVIDER = TTS_FALLBACK_PROVIDER;
|
|
24102
|
+
exports.TTS_NEIGHBOUR_TEXT_MAX_CHARS = TTS_NEIGHBOUR_TEXT_MAX_CHARS;
|
|
22116
24103
|
exports.TTS_PROVIDERS = TTS_PROVIDERS;
|
|
22117
24104
|
exports.TTS_PROVIDER_ALIASES = TTS_PROVIDER_ALIASES;
|
|
22118
24105
|
exports.TTS_TEXT_MAX = TTS_TEXT_MAX;
|
|
22119
24106
|
exports.TWO_K_RESOLUTION_PROVIDERS = TWO_K_RESOLUTION_PROVIDERS;
|
|
22120
24107
|
exports.TransitionTypeSchema = TransitionTypeSchema;
|
|
24108
|
+
exports.UGC_NODE_RUN_STATE_KEYS = UGC_NODE_RUN_STATE_KEYS;
|
|
24109
|
+
exports.UGC_NODE_TYPES = UGC_NODE_TYPES;
|
|
24110
|
+
exports.UGC_OVERRIDABLE_FIELDS = UGC_OVERRIDABLE_FIELDS;
|
|
22121
24111
|
exports.UPSCALE_IMAGE_PROVIDERS = UPSCALE_IMAGE_PROVIDERS;
|
|
22122
24112
|
exports.USAGE_GROUP_BYS = USAGE_GROUP_BYS;
|
|
22123
24113
|
exports.USAGE_MODES = USAGE_MODES;
|
|
@@ -22156,6 +24146,11 @@ exports.VIDEO_ANALYSIS_VISUAL_EFFECTS = VIDEO_ANALYSIS_VISUAL_EFFECTS;
|
|
|
22156
24146
|
exports.VIDEO_ANALYSIS_WINDOW = VIDEO_ANALYSIS_WINDOW;
|
|
22157
24147
|
exports.VIDEO_AUDIO_CAPABILITY = VIDEO_AUDIO_CAPABILITY;
|
|
22158
24148
|
exports.VIDEO_AUDIT_BUCKET_CREDITS = VIDEO_AUDIT_BUCKET_CREDITS;
|
|
24149
|
+
exports.VIDEO_CHARACTER_DESCRIPTION_MAX = VIDEO_CHARACTER_DESCRIPTION_MAX;
|
|
24150
|
+
exports.VIDEO_CHARACTER_NAME_MAX = VIDEO_CHARACTER_NAME_MAX;
|
|
24151
|
+
exports.VIDEO_CHARACTER_REFS_WIRE_MAX = VIDEO_CHARACTER_REFS_WIRE_MAX;
|
|
24152
|
+
exports.VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX;
|
|
24153
|
+
exports.VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = VIDEO_CHARACTER_VOICE_EXAMPLE_MAX;
|
|
22159
24154
|
exports.VIDEO_CLIP_CREDITS = VIDEO_CLIP_CREDITS;
|
|
22160
24155
|
exports.VIDEO_CRITIC_CREDITS_PER_SHOT = VIDEO_CRITIC_CREDITS_PER_SHOT;
|
|
22161
24156
|
exports.VIDEO_CRITIC_FRAME_MODES = VIDEO_CRITIC_FRAME_MODES;
|
|
@@ -22288,10 +24283,17 @@ exports.cameraSwitchEdlProblem = cameraSwitchEdlProblem;
|
|
|
22288
24283
|
exports.cameraSwitchSettingsPayload = cameraSwitchSettingsPayload;
|
|
22289
24284
|
exports.canonicalExposedFieldKey = canonicalExposedFieldKey;
|
|
22290
24285
|
exports.canonicalScene3DPlanV2Json = canonicalScene3DPlanV2Json;
|
|
24286
|
+
exports.canonicalSourceHandle = canonicalSourceHandle;
|
|
24287
|
+
exports.canonicalTargetHandle = canonicalTargetHandle;
|
|
22291
24288
|
exports.canonicalTtsProvider = canonicalTtsProvider;
|
|
22292
24289
|
exports.canonicalVarName = canonicalVarName;
|
|
22293
24290
|
exports.canonicalizeOverrideKeys = canonicalizeOverrideKeys;
|
|
24291
|
+
exports.captionFontWeightSchema = captionFontWeightSchema;
|
|
24292
|
+
exports.captionInputSchema = captionInputSchema;
|
|
24293
|
+
exports.captionPlanBodyLevers = captionPlanBodyLevers;
|
|
24294
|
+
exports.captionPlanPassThrough = captionPlanPassThrough;
|
|
22294
24295
|
exports.captionRoutesToRemotion = captionRoutesToRemotion;
|
|
24296
|
+
exports.captionSegmentInputSchema = captionSegmentInputSchema;
|
|
22295
24297
|
exports.centreCropToAspect = centreCropToAspect;
|
|
22296
24298
|
exports.characterBoardItems = characterBoardItems;
|
|
22297
24299
|
exports.characterBucketDisplayRank = characterBucketDisplayRank;
|
|
@@ -22302,6 +24304,7 @@ exports.characterVariantAssetArrays = characterVariantAssetArrays;
|
|
|
22302
24304
|
exports.checkRefVideoDurations = checkRefVideoDurations;
|
|
22303
24305
|
exports.cinematicCreditId = cinematicCreditId;
|
|
22304
24306
|
exports.clampCameraSwitchSetting = clampCameraSwitchSetting;
|
|
24307
|
+
exports.clampChars = clampChars;
|
|
22305
24308
|
exports.clampCinematicDuration = clampCinematicDuration;
|
|
22306
24309
|
exports.clampContentIdeasCount = clampContentIdeasCount;
|
|
22307
24310
|
exports.clampEditPlanClipCount = clampEditPlanClipCount;
|
|
@@ -22309,6 +24312,7 @@ exports.clampInstagramFeaturedIndex = clampInstagramFeaturedIndex;
|
|
|
22309
24312
|
exports.clampMetaAdsFeaturedIndex = clampMetaAdsFeaturedIndex;
|
|
22310
24313
|
exports.clampSmartCutWindow = clampSmartCutWindow;
|
|
22311
24314
|
exports.classifyCreativeFormat = classifyCreativeFormat;
|
|
24315
|
+
exports.classifyLegacyTargetHandle = classifyLegacyTargetHandle;
|
|
22312
24316
|
exports.classifyRefToken = classifyRefToken;
|
|
22313
24317
|
exports.cleanOrphanedItems = cleanOrphanedItems;
|
|
22314
24318
|
exports.cleanSpeakerNames = cleanSpeakerNames;
|
|
@@ -22316,8 +24320,14 @@ exports.clearImageCriticMetadata = clearImageCriticMetadata;
|
|
|
22316
24320
|
exports.clearVideoCriticMetadata = clearVideoCriticMetadata;
|
|
22317
24321
|
exports.clearWiredVideoOverlayImageUrls = clearWiredVideoOverlayImageUrls;
|
|
22318
24322
|
exports.clipLookSchema = clipLookSchema;
|
|
24323
|
+
exports.clipNotesFrom = clipNotesFrom;
|
|
22319
24324
|
exports.collectAncestorRefs = collectAncestorRefs;
|
|
24325
|
+
exports.collectionCapsForTier = collectionCapsForTier;
|
|
24326
|
+
exports.collectionReadSince = collectionReadSince;
|
|
24327
|
+
exports.collectionRecordHeadline = collectionRecordHeadline;
|
|
24328
|
+
exports.collectionRecordsDigest = collectionRecordsDigest;
|
|
22320
24329
|
exports.combineSameLabelRefs = combineSameLabelRefs;
|
|
24330
|
+
exports.combineVideosPassThrough = combineVideosPassThrough;
|
|
22321
24331
|
exports.compactWithRows = compactWithRows;
|
|
22322
24332
|
exports.competitorScanCreditId = competitorScanCreditId;
|
|
22323
24333
|
exports.competitorScanCredits = competitorScanCredits;
|
|
@@ -22329,6 +24339,7 @@ exports.connectedSettingsSources = connectedSettingsSources;
|
|
|
22329
24339
|
exports.contentIdeasCreditFeature = contentIdeasCreditFeature;
|
|
22330
24340
|
exports.contentIdeasCreditId = contentIdeasCreditId;
|
|
22331
24341
|
exports.contentRecipeCreditId = contentRecipeCreditId;
|
|
24342
|
+
exports.countEmptyInputSkips = countEmptyInputSkips;
|
|
22332
24343
|
exports.countRefModalityEdges = countRefModalityEdges;
|
|
22333
24344
|
exports.creditRangesAll = creditRangesAll;
|
|
22334
24345
|
exports.creditsToUsd = creditsToUsd;
|
|
@@ -22347,16 +24358,25 @@ exports.describeEdgeBehavior = describeEdgeBehavior;
|
|
|
22347
24358
|
exports.describeMaskRegion = describeMaskRegion;
|
|
22348
24359
|
exports.describeNodeAdjustments = describeNodeAdjustments;
|
|
22349
24360
|
exports.describeSlotControl = describeSlotControl;
|
|
24361
|
+
exports.describeSpeakerTracks = describeSpeakerTracks;
|
|
22350
24362
|
exports.detectVideoLinkPlatform = detectVideoLinkPlatform;
|
|
24363
|
+
exports.dialogueHasLever = dialogueHasLever;
|
|
24364
|
+
exports.dialogueProviderOf = dialogueProviderOf;
|
|
24365
|
+
exports.dialogueStabilityAccepted = dialogueStabilityAccepted;
|
|
24366
|
+
exports.dialogueSupportsTimestamps = dialogueSupportsTimestamps;
|
|
22351
24367
|
exports.dropUnknownBindings = dropUnknownBindings;
|
|
22352
24368
|
exports.dropUnknownSpeakers = dropUnknownSpeakers;
|
|
22353
24369
|
exports.durationsByMode = durationsByMode;
|
|
22354
24370
|
exports.editPlanBasis = editPlanBasis;
|
|
22355
24371
|
exports.editPlanBucketMinutes = editPlanBucketMinutes;
|
|
24372
|
+
exports.editPlanResultPatch = editPlanResultPatch;
|
|
22356
24373
|
exports.editPlanSavedOutput = editPlanSavedOutput;
|
|
22357
24374
|
exports.editPlanSourceDurationSec = editPlanSourceDurationSec;
|
|
22358
24375
|
exports.editPlanTranscriptOrigin = editPlanTranscriptOrigin;
|
|
22359
24376
|
exports.edlDurationMs = edlDurationMs;
|
|
24377
|
+
exports.edlSegmentOutputStarts = edlSegmentOutputStarts;
|
|
24378
|
+
exports.edlSpanKey = edlSpanKey;
|
|
24379
|
+
exports.edlSpeakerSpace = edlSpeakerSpace;
|
|
22360
24380
|
exports.effectiveContentModel = effectiveContentModel;
|
|
22361
24381
|
exports.effectiveReasoningEffort = effectiveReasoningEffort;
|
|
22362
24382
|
exports.encodeProviderItem = encodeProviderItem;
|
|
@@ -22378,6 +24398,7 @@ exports.evaluateCondition = evaluateCondition;
|
|
|
22378
24398
|
exports.evaluateConditionGroup = evaluateConditionGroup;
|
|
22379
24399
|
exports.evaluateJsonExpression = evaluateJsonExpression;
|
|
22380
24400
|
exports.evaluateJsonPath = evaluateJsonPath;
|
|
24401
|
+
exports.executionOutcome = executionOutcome;
|
|
22381
24402
|
exports.expandExtraRefsToConnectedReferences = expandExtraRefsToConnectedReferences;
|
|
22382
24403
|
exports.expandItemsWithRepeat = expandItemsWithRepeat;
|
|
22383
24404
|
exports.expandVideoOverlayLayer = expandVideoOverlayLayer;
|
|
@@ -22388,16 +24409,22 @@ exports.extractGeneratedJsonAsList = extractGeneratedJsonAsList;
|
|
|
22388
24409
|
exports.extractPresetData = extractPresetData;
|
|
22389
24410
|
exports.extractReferencedLabels = extractReferencedLabels;
|
|
22390
24411
|
exports.extractVideoDurationFromNode = extractVideoDurationFromNode;
|
|
24412
|
+
exports.fanOutItemMeta = fanOutItemMeta;
|
|
22391
24413
|
exports.fanOutTextFeedsPrompt = fanOutTextFeedsPrompt;
|
|
24414
|
+
exports.fanOutUrlItemIsText = fanOutUrlItemIsText;
|
|
22392
24415
|
exports.featuredInstagramOutputs = featuredInstagramOutputs;
|
|
22393
24416
|
exports.featuredMetaAdOutputs = featuredMetaAdOutputs;
|
|
22394
24417
|
exports.fieldKeyFromHandle = fieldKeyFromHandle;
|
|
22395
24418
|
exports.filterCloneNodes = filterCloneNodes;
|
|
22396
24419
|
exports.findCharacterMentionTokens = findCharacterMentionTokens;
|
|
24420
|
+
exports.findDialogueCapabilities = findDialogueCapabilities;
|
|
22397
24421
|
exports.findEntityMentionTokens = findEntityMentionTokens;
|
|
22398
24422
|
exports.findImageMentionTokens = findImageMentionTokens;
|
|
22399
24423
|
exports.findLocationMentionTokens = findLocationMentionTokens;
|
|
24424
|
+
exports.findRestrictedPickerValue = findRestrictedPickerValue;
|
|
22400
24425
|
exports.findSeedance2AudioOverLimit = findSeedance2AudioOverLimit;
|
|
24426
|
+
exports.findSegmentOverlap = findSegmentOverlap;
|
|
24427
|
+
exports.findUgcLockedFields = findUgcLockedFields;
|
|
22401
24428
|
exports.findWordlessTranscriptFeeds = findWordlessTranscriptFeeds;
|
|
22402
24429
|
exports.firstSightExtraRole = firstSightExtraRole;
|
|
22403
24430
|
exports.fitAspectRatioToModel = fitAspectRatioToModel;
|
|
@@ -22412,11 +24439,13 @@ exports.getAudioCrossfadeCurve = getAudioCrossfadeCurve;
|
|
|
22412
24439
|
exports.getCharacterFacet = getCharacterFacet;
|
|
22413
24440
|
exports.getCombineTransition = getCombineTransition;
|
|
22414
24441
|
exports.getCreditRange = getCreditRange;
|
|
24442
|
+
exports.getDialogueCapabilities = getDialogueCapabilities;
|
|
22415
24443
|
exports.getDurationsForModel = getDurationsForModel;
|
|
22416
24444
|
exports.getEffectiveRepeatCount = getEffectiveRepeatCount;
|
|
22417
24445
|
exports.getFeaturedEntities = getFeaturedEntities;
|
|
22418
24446
|
exports.getFurniture = getFurniture;
|
|
22419
24447
|
exports.getFurnitureLabel = getFurnitureLabel;
|
|
24448
|
+
exports.getInputFieldExtraKeys = getInputFieldExtraKeys;
|
|
22420
24449
|
exports.getInputFieldSchema = getInputFieldSchema;
|
|
22421
24450
|
exports.getInputNodes = getInputNodes;
|
|
22422
24451
|
exports.getItemSortId = getItemSortId;
|
|
@@ -22460,6 +24489,7 @@ exports.hasDrawableVideoOverlayBox = hasDrawableVideoOverlayBox;
|
|
|
22460
24489
|
exports.hasFeature = hasFeature;
|
|
22461
24490
|
exports.hasUrlParserHazard = hasUrlParserHazard;
|
|
22462
24491
|
exports.hexToRgbaArray = hexToRgbaArray;
|
|
24492
|
+
exports.holdsPreviewRender = holdsPreviewRender;
|
|
22463
24493
|
exports.hostnameMatchesAllowlist = hostnameMatchesAllowlist;
|
|
22464
24494
|
exports.humanizeSlotSid = humanizeSlotSid;
|
|
22465
24495
|
exports.imageMentionSlug = imageMentionSlug;
|
|
@@ -22468,6 +24498,7 @@ exports.imageOverlayBillableVariants = imageOverlayBillableVariants;
|
|
|
22468
24498
|
exports.imageOverlayCredits = imageOverlayCredits;
|
|
22469
24499
|
exports.imageReferenceLimit = imageReferenceLimit;
|
|
22470
24500
|
exports.inferMusicVideo = inferMusicVideo;
|
|
24501
|
+
exports.ingestRecordFromJson = ingestRecordFromJson;
|
|
22471
24502
|
exports.instagramAnalysisCreditId = instagramAnalysisCreditId;
|
|
22472
24503
|
exports.instagramAnalysisTierFrom = instagramAnalysisTierFrom;
|
|
22473
24504
|
exports.instagramPostLink = instagramPostLink;
|
|
@@ -22480,6 +24511,8 @@ exports.isAggregateableType = isAggregateableType;
|
|
|
22480
24511
|
exports.isAutoVideoDuration = isAutoVideoDuration;
|
|
22481
24512
|
exports.isCharacterAspectRatio = isCharacterAspectRatio;
|
|
22482
24513
|
exports.isCollectInEdge = isCollectInEdge;
|
|
24514
|
+
exports.isCollectionMedia = isCollectionMedia;
|
|
24515
|
+
exports.isCollectionUrl = isCollectionUrl;
|
|
22483
24516
|
exports.isCompetitorAboutPlatform = isCompetitorAboutPlatform;
|
|
22484
24517
|
exports.isCronExpression = isCronExpression;
|
|
22485
24518
|
exports.isDefaultSelectorConfig = isDefaultSelectorConfig;
|
|
@@ -22515,6 +24548,7 @@ exports.isPro3DRenderJobOutput = isPro3DRenderJobOutput;
|
|
|
22515
24548
|
exports.isPro3DRenderQuote = isPro3DRenderQuote;
|
|
22516
24549
|
exports.isPro3DRenderRenderOnly = isPro3DRenderRenderOnly;
|
|
22517
24550
|
exports.isProjectedTriggerNodeType = isProjectedTriggerNodeType;
|
|
24551
|
+
exports.isRenderNodeType = isRenderNodeType;
|
|
22518
24552
|
exports.isRtlText = isRtlText;
|
|
22519
24553
|
exports.isScene3DAuthoringEngine = isScene3DAuthoringEngine;
|
|
22520
24554
|
exports.isScene3DCameraTrack = isScene3DCameraTrack;
|
|
@@ -22598,7 +24632,11 @@ exports.newScene3DRevisionId = newScene3DRevisionId;
|
|
|
22598
24632
|
exports.nextScheduleRuns = nextScheduleRuns;
|
|
22599
24633
|
exports.nodeFeedsAnything = nodeFeedsAnything;
|
|
22600
24634
|
exports.nodeStateMayCarryOutput = nodeStateMayCarryOutput;
|
|
24635
|
+
exports.nonBlankCaptionText = nonBlankCaptionText;
|
|
22601
24636
|
exports.normalizeCaptionNumericLevers = normalizeCaptionNumericLevers;
|
|
24637
|
+
exports.normalizeCollectionFields = normalizeCollectionFields;
|
|
24638
|
+
exports.normalizeCollectionMedia = normalizeCollectionMedia;
|
|
24639
|
+
exports.normalizeDedupeKey = normalizeDedupeKey;
|
|
22602
24640
|
exports.normalizeEdl = normalizeEdl;
|
|
22603
24641
|
exports.normalizeLottieLayers = normalizeLottieLayers;
|
|
22604
24642
|
exports.normalizeMinimaxH3Resolution = normalizeMinimaxH3Resolution;
|
|
@@ -22609,12 +24647,16 @@ exports.normalizeRoleSlug = normalizeRoleSlug;
|
|
|
22609
24647
|
exports.normalizeSavedPostTags = normalizeSavedPostTags;
|
|
22610
24648
|
exports.normalizeScheduleRule = normalizeScheduleRule;
|
|
22611
24649
|
exports.normalizeScheduleRules = normalizeScheduleRules;
|
|
24650
|
+
exports.normalizeSpeakerTrackSetDescriptor = normalizeSpeakerTrackSetDescriptor;
|
|
24651
|
+
exports.normalizeSpeakerTracks = normalizeSpeakerTracks;
|
|
22612
24652
|
exports.normalizeTemplateCategory = normalizeTemplateCategory;
|
|
22613
24653
|
exports.normalizeTranscript = normalizeTranscript;
|
|
24654
|
+
exports.normalizeTtsNeighbourText = normalizeTtsNeighbourText;
|
|
22614
24655
|
exports.normalizeVideoOverlayNodes = normalizeVideoOverlayNodes;
|
|
22615
24656
|
exports.normalizeVideoRequestParams = normalizeVideoRequestParams;
|
|
22616
24657
|
exports.normalizeWan3Resolution = normalizeWan3Resolution;
|
|
22617
24658
|
exports.orderedLlmModels = orderedLlmModels;
|
|
24659
|
+
exports.outputMsToMasterMs = outputMsToMasterMs;
|
|
22618
24660
|
exports.overlayFontById = overlayFontById;
|
|
22619
24661
|
exports.overlayImageEffectsSchema = overlayImageEffectsSchema;
|
|
22620
24662
|
exports.overlayPlatformById = overlayPlatformById;
|
|
@@ -22628,7 +24670,9 @@ exports.overlayVariantIdFromHandle = overlayVariantIdFromHandle;
|
|
|
22628
24670
|
exports.ownsItsList = ownsItsList;
|
|
22629
24671
|
exports.parseAspectToken = parseAspectToken;
|
|
22630
24672
|
exports.parseAttributedDialogue = parseAttributedDialogue;
|
|
24673
|
+
exports.parseCaptionPlan = parseCaptionPlan;
|
|
22631
24674
|
exports.parseCharacterMentionToken = parseCharacterMentionToken;
|
|
24675
|
+
exports.parseEditPlanMode = parseEditPlanMode;
|
|
22632
24676
|
exports.parseEntityMentionToken = parseEntityMentionToken;
|
|
22633
24677
|
exports.parseGroupHandle = parseGroupHandle;
|
|
22634
24678
|
exports.parseHandleId = parseHandleId;
|
|
@@ -22640,13 +24684,17 @@ exports.parseNodeRef = parseNodeRef;
|
|
|
22640
24684
|
exports.parseScene3DCameraTrackJson = parseScene3DCameraTrackJson;
|
|
22641
24685
|
exports.parseScene3DPlanV2Json = parseScene3DPlanV2Json;
|
|
22642
24686
|
exports.parseSpeakerEmphasisStyle = parseSpeakerEmphasisStyle;
|
|
24687
|
+
exports.parseVideoOverlayLayerPlan = parseVideoOverlayLayerPlan;
|
|
22643
24688
|
exports.pickAiAvatarBucket = pickAiAvatarBucket;
|
|
24689
|
+
exports.pickHeldRow = pickHeldRow;
|
|
22644
24690
|
exports.pickIds = pickIds;
|
|
22645
24691
|
exports.pickLipSyncBucket = pickLipSyncBucket;
|
|
22646
24692
|
exports.pickSocialPosts = pickSocialPosts;
|
|
22647
24693
|
exports.pickSwitchXFrameTier = pickSwitchXFrameTier;
|
|
22648
24694
|
exports.pickVideoAnalysisBucket = pickVideoAnalysisBucket;
|
|
24695
|
+
exports.planClipKeyAt = planClipKeyAt;
|
|
22649
24696
|
exports.planFanOut = planFanOut;
|
|
24697
|
+
exports.planFeedEmission = planFeedEmission;
|
|
22650
24698
|
exports.planSheetGeneration = planSheetGeneration;
|
|
22651
24699
|
exports.planSheetPanels = planSheetPanels;
|
|
22652
24700
|
exports.preferredInputModeForModel = preferredInputModeForModel;
|
|
@@ -22655,7 +24703,9 @@ exports.presetApplyClearKeys = presetApplyClearKeys;
|
|
|
22655
24703
|
exports.presetDataMatches = presetDataMatches;
|
|
22656
24704
|
exports.presetEntries = presetEntries;
|
|
22657
24705
|
exports.presetLeverClearKeys = presetLeverClearKeys;
|
|
24706
|
+
exports.previewGatedNodeIds = previewGatedNodeIds;
|
|
22658
24707
|
exports.previewHorizonMs = previewHorizonMs;
|
|
24708
|
+
exports.previewStops = previewStops;
|
|
22659
24709
|
exports.pricedOutputDurationSec = pricedOutputDurationSec;
|
|
22660
24710
|
exports.pricedVideoSelection = pricedVideoSelection;
|
|
22661
24711
|
exports.pro3DRenderCoreOutputSchema = pro3DRenderCoreOutputSchema;
|
|
@@ -22679,7 +24729,24 @@ exports.registerSidecarLoaders = registerSidecarLoaders;
|
|
|
22679
24729
|
exports.remapMsThroughEdl = remapMsThroughEdl;
|
|
22680
24730
|
exports.remapTranscriptThroughEdl = remapTranscriptThroughEdl;
|
|
22681
24731
|
exports.renderAnalyzedScene = renderAnalyzedScene;
|
|
24732
|
+
exports.renderClipKey = renderClipKey;
|
|
24733
|
+
exports.renderNodeOf = renderNodeOf;
|
|
24734
|
+
exports.renderPlanBasis = renderPlanBasis;
|
|
24735
|
+
exports.renderPlanClipKey = renderPlanClipKey;
|
|
24736
|
+
exports.renderPlanNodeId = renderPlanNodeId;
|
|
24737
|
+
exports.renderPlanPath = renderPlanPath;
|
|
24738
|
+
exports.renderPlanRowClipKeys = renderPlanRowClipKeys;
|
|
24739
|
+
exports.renderPlanValue = renderPlanValue;
|
|
24740
|
+
exports.renderReadBasis = renderReadBasis;
|
|
24741
|
+
exports.renderResultStamp = renderResultStamp;
|
|
24742
|
+
exports.renderRunQuality = renderRunQuality;
|
|
24743
|
+
exports.renderSentRowStamps = renderSentRowStamps;
|
|
24744
|
+
exports.renderSettingsBasis = renderSettingsBasis;
|
|
22682
24745
|
exports.renderVideoCreditId = renderVideoCreditId;
|
|
24746
|
+
exports.renderedSourceHandle = renderedSourceHandle;
|
|
24747
|
+
exports.rendersAsPreview = rendersAsPreview;
|
|
24748
|
+
exports.rendersLatestBatch = rendersLatestBatch;
|
|
24749
|
+
exports.rendersTranscriptJson = rendersTranscriptJson;
|
|
22683
24750
|
exports.requiresSequenceExecution = requiresSequenceExecution;
|
|
22684
24751
|
exports.resetCatalogSidecars = resetCatalogSidecars;
|
|
22685
24752
|
exports.resolutionOptionsByKind = resolutionOptionsByKind;
|
|
@@ -22749,6 +24816,9 @@ exports.ruleMatches = ruleMatches;
|
|
|
22749
24816
|
exports.runSelector = runSelector;
|
|
22750
24817
|
exports.safetyRetryPolicy = safetyRetryPolicy;
|
|
22751
24818
|
exports.sanitizeRole = sanitizeRole;
|
|
24819
|
+
exports.savedRenderBatch = savedRenderBatch;
|
|
24820
|
+
exports.savedRenderBatchUrls = savedRenderBatchUrls;
|
|
24821
|
+
exports.savedRenderOutput = savedRenderOutput;
|
|
22752
24822
|
exports.scaleVec3Schema = scaleVec3Schema;
|
|
22753
24823
|
exports.scene3DAcceptedSchemaVersionsSchema = scene3DAcceptedSchemaVersionsSchema;
|
|
22754
24824
|
exports.scene3DAnchorNameSchema = scene3DAnchorNameSchema;
|
|
@@ -22872,6 +24942,9 @@ exports.speakerLayoutAllows = speakerLayoutAllows;
|
|
|
22872
24942
|
exports.speakerPresentationWarnings = speakerPresentationWarnings;
|
|
22873
24943
|
exports.speakerSwitchOverlaps = speakerSwitchOverlaps;
|
|
22874
24944
|
exports.speakerTurns = speakerTurns;
|
|
24945
|
+
exports.speechCredits = speechCredits;
|
|
24946
|
+
exports.speechPriceUnits = speechPriceUnits;
|
|
24947
|
+
exports.speechUnitCreditId = speechUnitCreditId;
|
|
22875
24948
|
exports.speedRampCreditId = speedRampCreditId;
|
|
22876
24949
|
exports.spliceDelimitedRows = spliceDelimitedRows;
|
|
22877
24950
|
exports.splitByLoopDelimiter = splitByLoopDelimiter;
|
|
@@ -22888,7 +24961,9 @@ exports.stripStudioDraftWorkflow = stripStudioDraftWorkflow;
|
|
|
22888
24961
|
exports.stripStudioTakeVoiceRecords = stripStudioTakeVoiceRecords;
|
|
22889
24962
|
exports.stripStudioTransientSettings = stripStudioTransientSettings;
|
|
22890
24963
|
exports.stripTransientRuntimeData = stripTransientRuntimeData;
|
|
24964
|
+
exports.stripUgcRunState = stripUgcRunState;
|
|
22891
24965
|
exports.stripUnownedRefs = stripUnownedRefs;
|
|
24966
|
+
exports.styleCaptionPlan = styleCaptionPlan;
|
|
22892
24967
|
exports.summarizeScene3DOperations = summarizeScene3DOperations;
|
|
22893
24968
|
exports.sunoCreditType = sunoCreditType;
|
|
22894
24969
|
exports.sunoModelHonoursDuration = sunoModelHonoursDuration;
|
|
@@ -22899,6 +24974,8 @@ exports.supportsEndAnchor = supportsEndAnchor;
|
|
|
22899
24974
|
exports.supportsExtendRender = supportsExtendRender;
|
|
22900
24975
|
exports.telegramAccountListeningSignature = telegramAccountListeningSignature;
|
|
22901
24976
|
exports.telegramAccountTriggerOutputs = telegramAccountTriggerOutputs;
|
|
24977
|
+
exports.telegramFeedDigest = telegramFeedDigest;
|
|
24978
|
+
exports.telegramPostsFrom = telegramPostsFrom;
|
|
22902
24979
|
exports.telegramSendAsOf = telegramSendAsOf;
|
|
22903
24980
|
exports.telegramSendDestinationOf = telegramSendDestinationOf;
|
|
22904
24981
|
exports.templateCategoryStoredValues = templateCategoryStoredValues;
|
|
@@ -22919,6 +24996,9 @@ exports.ttsHasLever = ttsHasLever;
|
|
|
22919
24996
|
exports.ttsLanguageCodes = ttsLanguageCodes;
|
|
22920
24997
|
exports.ttsSupportsAudioTags = ttsSupportsAudioTags;
|
|
22921
24998
|
exports.ttsSupportsSsmlBreaks = ttsSupportsSsmlBreaks;
|
|
24999
|
+
exports.ttsSupportsStitching = ttsSupportsStitching;
|
|
25000
|
+
exports.ttsSupportsTimestamps = ttsSupportsTimestamps;
|
|
25001
|
+
exports.ugcCallToRouteBody = ugcCallToRouteBody;
|
|
22922
25002
|
exports.uiAspectRatioFill = uiAspectRatioFill;
|
|
22923
25003
|
exports.uiDurationFill = uiDurationFill;
|
|
22924
25004
|
exports.uiResolutionFill = uiResolutionFill;
|
|
@@ -22940,6 +25020,8 @@ exports.validateModelInput = validateModelInput;
|
|
|
22940
25020
|
exports.validateNoNestedGroups = validateNoNestedGroups;
|
|
22941
25021
|
exports.validateObjects = validateObjects;
|
|
22942
25022
|
exports.validateProviderForNodeType = validateProviderForNodeType;
|
|
25023
|
+
exports.validateSpeakerTrackSetDescriptor = validateSpeakerTrackSetDescriptor;
|
|
25024
|
+
exports.validateSpeakerTracks = validateSpeakerTracks;
|
|
22943
25025
|
exports.validateSubWorkflowRoutes = validateSubWorkflowRoutes;
|
|
22944
25026
|
exports.validateVideoOverlayRequest = validateVideoOverlayRequest;
|
|
22945
25027
|
exports.variantJobId = variantJobId;
|
|
@@ -22949,6 +25031,14 @@ exports.videoAnalysisCreditSegment = videoAnalysisCreditSegment;
|
|
|
22949
25031
|
exports.videoAnalysisNumWindows = videoAnalysisNumWindows;
|
|
22950
25032
|
exports.videoAnalysisResultSchema = videoAnalysisResultSchema;
|
|
22951
25033
|
exports.videoAuditCreditsForBucket = videoAuditCreditsForBucket;
|
|
25034
|
+
exports.videoCharacterDistinctVoices = videoCharacterDistinctVoices;
|
|
25035
|
+
exports.videoCharacterRefCap = videoCharacterRefCap;
|
|
25036
|
+
exports.videoCharacterRefProblem = videoCharacterRefProblem;
|
|
25037
|
+
exports.videoCharacterRefProviders = videoCharacterRefProviders;
|
|
25038
|
+
exports.videoCharacterRefUnits = videoCharacterRefUnits;
|
|
25039
|
+
exports.videoCharacterVoiceCap = videoCharacterVoiceCap;
|
|
25040
|
+
exports.videoCharacterVoiceKey = videoCharacterVoiceKey;
|
|
25041
|
+
exports.videoCharacterVoiceProblem = videoCharacterVoiceProblem;
|
|
22952
25042
|
exports.videoLinkDownloadedFile = videoLinkDownloadedFile;
|
|
22953
25043
|
exports.videoLinkNeedsDownload = videoLinkNeedsDownload;
|
|
22954
25044
|
exports.videoLinkPageUrl = videoLinkPageUrl;
|
|
@@ -22958,6 +25048,7 @@ exports.videoNegativeSuffix = videoNegativeSuffix;
|
|
|
22958
25048
|
exports.videoOverlayCanvas = videoOverlayCanvas;
|
|
22959
25049
|
exports.videoOverlayCompositionKey = videoOverlayCompositionKey;
|
|
22960
25050
|
exports.videoOverlayLayerLabel = videoOverlayLayerLabel;
|
|
25051
|
+
exports.videoOverlayPassThrough = videoOverlayPassThrough;
|
|
22961
25052
|
exports.videoOverlayPresetBox = videoOverlayPresetBox;
|
|
22962
25053
|
exports.videoOverlayRenderOrder = videoOverlayRenderOrder;
|
|
22963
25054
|
exports.videoOverlaySlotOfHandle = videoOverlaySlotOfHandle;
|
|
@@ -22966,6 +25057,7 @@ exports.videoProviderFoldsLoneEndFrame = videoProviderFoldsLoneEndFrame;
|
|
|
22966
25057
|
exports.videoProviderRequiresImage = videoProviderRequiresImage;
|
|
22967
25058
|
exports.videoSfxCreditId = videoSfxCreditId;
|
|
22968
25059
|
exports.windowAnalysisSchema = windowAnalysisSchema;
|
|
25060
|
+
exports.withRunOverrides = withRunOverrides;
|
|
22969
25061
|
exports.withWiredSettings = withWiredSettings;
|
|
22970
25062
|
exports.zipMergeLists = zipMergeLists;
|
|
22971
25063
|
//# sourceMappingURL=index.cjs.map
|