@nodaro/shared 3.30.0 → 3.31.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 +733 -93
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +501 -36
- package/dist/index.d.ts +501 -36
- package/dist/index.js +673 -94
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/entity-image-handle.test.ts +61 -1
- package/src/__tests__/json-kinds.test.ts +10 -0
- package/src/__tests__/model-seed-capability.test.ts +34 -0
- package/src/__tests__/node-preset-extract.test.ts +8 -0
- package/src/__tests__/node-run-routes.test.ts +63 -0
- package/src/__tests__/node-runtime-keys.test.ts +61 -0
- package/src/__tests__/presentation-utils.test.ts +14 -0
- package/src/__tests__/producer-types.test.ts +15 -0
- package/src/__tests__/seedance-draft.test.ts +74 -0
- package/src/__tests__/ugc-clip-saved-list.test.ts +19 -0
- package/src/__tests__/ugc-node-wires.test.ts +600 -0
- package/src/__tests__/ugc-run-state.test.ts +80 -3
- package/src/__tests__/workflow-export-strip.test.ts +14 -0
- package/src/entity-image-handle.ts +48 -1
- package/src/index.ts +8 -1
- package/src/json-kinds.ts +9 -0
- package/src/model-catalog.ts +61 -2
- package/src/model-constants.ts +3 -0
- package/src/node-preset-export.ts +2 -2
- package/src/node-preset-extract.ts +6 -4
- package/src/node-run-routes.ts +76 -0
- package/src/node-runtime-keys.ts +42 -1
- package/src/presentation-utils.ts +3 -0
- package/src/producer-types.ts +10 -0
- package/src/seedance-draft.ts +64 -0
- package/src/social-post.ts +13 -0
- package/src/ugc-node-wires.ts +623 -0
- package/src/ugc-run-state.ts +60 -5
- package/src/workflow-export.ts +3 -1
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,25 @@ var FREECUT_EXPORT_COMPLETE = "FREECUT_EXPORT_COMPLETE";
|
|
|
39
39
|
var FREECUT_EXPORT_PROGRESS = "FREECUT_EXPORT_PROGRESS";
|
|
40
40
|
var FREECUT_REQUEST_IMPORT = "FREECUT_REQUEST_IMPORT";
|
|
41
41
|
|
|
42
|
+
// src/seedance-draft.ts
|
|
43
|
+
var SEEDANCE_DRAFT_MODELS = ["seedance-2-5"];
|
|
44
|
+
function isSeedanceDraftCapable(provider) {
|
|
45
|
+
return !!provider && SEEDANCE_DRAFT_MODELS.includes(provider);
|
|
46
|
+
}
|
|
47
|
+
var SEEDANCE_DRAFT_RESOLUTION = "480p";
|
|
48
|
+
var SEEDANCE_DRAFT_FINALIZE_PROVIDER = "seedance-2-5-hd";
|
|
49
|
+
var SEEDANCE_DRAFT_FINALIZE_RESOLUTION = "1080p";
|
|
50
|
+
var SEEDANCE_DRAFT_FINALIZE_MIN_SEC = 4;
|
|
51
|
+
var SEEDANCE_DRAFT_FINALIZE_MAX_SEC = 30;
|
|
52
|
+
function seedanceDraftFinalizeBillableSec(measuredSec) {
|
|
53
|
+
const whole = Math.max(1, Math.ceil(measuredSec - 0.25));
|
|
54
|
+
return Math.min(SEEDANCE_DRAFT_FINALIZE_MAX_SEC, Math.max(SEEDANCE_DRAFT_FINALIZE_MIN_SEC, whole));
|
|
55
|
+
}
|
|
56
|
+
function seedanceDraftFinalizeCreditId(durationSec, hasRefVideo) {
|
|
57
|
+
const n = seedanceDraftFinalizeBillableSec(durationSec);
|
|
58
|
+
return `${SEEDANCE_DRAFT_FINALIZE_PROVIDER}:${n}s${hasRefVideo ? "-ref" : ""}`;
|
|
59
|
+
}
|
|
60
|
+
|
|
42
61
|
// src/flux2-pricing.ts
|
|
43
62
|
var FLUX2_RES_MP = ["0.5", "1", "2", "4"];
|
|
44
63
|
function isFlux2Model(m) {
|
|
@@ -1522,6 +1541,8 @@ var VIDEO_MODELS = {
|
|
|
1522
1541
|
defaultDuration: 8,
|
|
1523
1542
|
autoDuration: true,
|
|
1524
1543
|
resolutions: ["480p", "720p", "1080p"],
|
|
1544
|
+
// KIE refuses a seed on Seedance 2.5 (422) — the provider config omits it.
|
|
1545
|
+
noSeed: true,
|
|
1525
1546
|
pricing: [
|
|
1526
1547
|
{ identifier: "seedance-2-5", credits: 1260, note: "default 8s 720p \u2014 see :Ns:res variants for exact" },
|
|
1527
1548
|
{ identifier: "seedance-2-5:8s:480p", credits: 560, note: "8s 480p" },
|
|
@@ -1838,6 +1859,8 @@ var VIDEO_MODELS = {
|
|
|
1838
1859
|
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1839
1860
|
defaultDuration: 5,
|
|
1840
1861
|
resolutions: ["720p", "1080p"],
|
|
1862
|
+
noSeed: true,
|
|
1863
|
+
// HappyHorse 1.1 dropped `seed` from its schema
|
|
1841
1864
|
pricing: [
|
|
1842
1865
|
{ identifier: "happyhorse", credits: 282, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
|
|
1843
1866
|
]
|
|
@@ -1854,6 +1877,8 @@ var VIDEO_MODELS = {
|
|
|
1854
1877
|
durations: [3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
|
|
1855
1878
|
defaultDuration: 5,
|
|
1856
1879
|
resolutions: ["720p", "1080p"],
|
|
1880
|
+
noSeed: true,
|
|
1881
|
+
// HappyHorse 1.1 dropped `seed` from its schema
|
|
1857
1882
|
pricing: [
|
|
1858
1883
|
{ identifier: "happyhorse-i2v", credits: 282, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
|
|
1859
1884
|
]
|
|
@@ -1872,6 +1897,8 @@ var VIDEO_MODELS = {
|
|
|
1872
1897
|
defaultDuration: 5,
|
|
1873
1898
|
resolutions: ["720p", "1080p"],
|
|
1874
1899
|
features: ["reference-image"],
|
|
1900
|
+
noSeed: true,
|
|
1901
|
+
// HappyHorse 1.1 dropped `seed` from its schema
|
|
1875
1902
|
pricing: [
|
|
1876
1903
|
{ identifier: "happyhorse-ref2v", credits: 282, note: "5s 720p default \u2014 per-second: ~5.7 cr/s @720p, ~7.3 cr/s @1080p" }
|
|
1877
1904
|
]
|
|
@@ -2034,6 +2061,27 @@ var VIDEO_MODELS = {
|
|
|
2034
2061
|
useCases: ["upscale", "high-res"],
|
|
2035
2062
|
pricing: [{ identifier: "veo-4k", credits: 380 }]
|
|
2036
2063
|
},
|
|
2064
|
+
// Seedance 2.5 Draft finalize (seedance-draft.ts): re-renders a Seedance 2.5
|
|
2065
|
+
// DRAFT as the same take at 1080p. Priced per output second of the draft; a
|
|
2066
|
+
// draft made with a reference VIDEO bills its `-ref` rate on input + output
|
|
2067
|
+
// seconds. Only works on a completed Seedance 2.5 draft.
|
|
2068
|
+
"seedance-2-5-hd": {
|
|
2069
|
+
id: "seedance-2-5-hd",
|
|
2070
|
+
kind: "video",
|
|
2071
|
+
modes: ["video-upscale"],
|
|
2072
|
+
family: "Bytedance",
|
|
2073
|
+
label: "Seedance 2.5 HD (from draft)",
|
|
2074
|
+
series: "Seedance",
|
|
2075
|
+
description: "Finalize a Seedance 2.5 draft: the same take, frame for frame, re-rendered at 1080p.",
|
|
2076
|
+
useCases: ["upscale", "high-res"],
|
|
2077
|
+
pricing: [
|
|
2078
|
+
{ identifier: "seedance-2-5-hd", credits: 3160, note: "default 8s \u2014 see :Ns variants for exact" },
|
|
2079
|
+
{ identifier: "seedance-2-5-hd:4s", credits: 1580, note: "4s draft" },
|
|
2080
|
+
{ identifier: "seedance-2-5-hd:8s", credits: 3160, note: "8s draft" },
|
|
2081
|
+
{ identifier: "seedance-2-5-hd:30s", credits: 11850, note: "30s draft (max)" },
|
|
2082
|
+
{ identifier: "seedance-2-5-hd:8s-ref", credits: 1900, note: "per-second rate of a draft made with a reference video; billed on input + output seconds" }
|
|
2083
|
+
]
|
|
2084
|
+
},
|
|
2037
2085
|
"topaz-video": {
|
|
2038
2086
|
id: "topaz-video",
|
|
2039
2087
|
kind: "video",
|
|
@@ -3129,8 +3177,18 @@ function readOptionToken(value) {
|
|
|
3129
3177
|
function normalizeVideoRequestParams(modelId, input) {
|
|
3130
3178
|
const m = MODEL_CATALOG[modelId];
|
|
3131
3179
|
const aspect = readOptionToken(input.aspectRatio);
|
|
3132
|
-
const
|
|
3180
|
+
const requestedRes = readOptionToken(input.resolution);
|
|
3181
|
+
const draft = input.draft === true && isSeedanceDraftCapable(modelId);
|
|
3182
|
+
const res = draft ? SEEDANCE_DRAFT_RESOLUTION : requestedRes;
|
|
3133
3183
|
const out = { aspectRatio: aspect, resolution: res, adjustments: [] };
|
|
3184
|
+
if (draft && requestedRes !== void 0 && requestedRes.toLowerCase() !== SEEDANCE_DRAFT_RESOLUTION) {
|
|
3185
|
+
out.adjustments.push({
|
|
3186
|
+
field: "resolution",
|
|
3187
|
+
from: requestedRes,
|
|
3188
|
+
to: SEEDANCE_DRAFT_RESOLUTION,
|
|
3189
|
+
reason: `A Seedance draft renders at ${SEEDANCE_DRAFT_RESOLUTION} only \u2014 using "${SEEDANCE_DRAFT_RESOLUTION}" instead of "${requestedRes}". Finalize the draft to get the same take at 1080p.`
|
|
3190
|
+
});
|
|
3191
|
+
}
|
|
3134
3192
|
if (!m) return out;
|
|
3135
3193
|
if (m.aspectRatios?.length && aspect && !PASSTHROUGH_ASPECT_TOKENS.has(aspect.toLowerCase())) {
|
|
3136
3194
|
const next = fitAspectRatioToModel(modelId, aspect);
|
|
@@ -3223,6 +3281,10 @@ function getCreditRange(modelId) {
|
|
|
3223
3281
|
function hasFeature(modelId, feature) {
|
|
3224
3282
|
return MODEL_CATALOG[modelId]?.features?.includes(feature) ?? false;
|
|
3225
3283
|
}
|
|
3284
|
+
function modelTakesSeed(modelId) {
|
|
3285
|
+
if (!modelId) return true;
|
|
3286
|
+
return MODEL_CATALOG[modelId]?.noSeed !== true;
|
|
3287
|
+
}
|
|
3226
3288
|
function modelsWithFeature(feature) {
|
|
3227
3289
|
return Object.values(MODEL_CATALOG).filter((m) => m.features?.includes(feature)).map((m) => m.id);
|
|
3228
3290
|
}
|
|
@@ -3948,7 +4010,10 @@ var FACE_SWAP_PROVIDERS = [
|
|
|
3948
4010
|
var VIDEO_UPSCALE_PROVIDERS = [
|
|
3949
4011
|
"topaz",
|
|
3950
4012
|
"veo-1080p",
|
|
3951
|
-
"veo-4k"
|
|
4013
|
+
"veo-4k",
|
|
4014
|
+
// Seedance 2.5 Draft finalize: re-renders a Seedance 2.5 DRAFT (by its task
|
|
4015
|
+
// id) as the same take at 1080p. See seedance-draft.ts.
|
|
4016
|
+
"seedance-2-5-hd"
|
|
3952
4017
|
];
|
|
3953
4018
|
var EXTEND_VIDEO_PROVIDERS = [
|
|
3954
4019
|
"veo-extend",
|
|
@@ -6193,6 +6258,458 @@ function resolveTopazUpscale(input) {
|
|
|
6193
6258
|
};
|
|
6194
6259
|
}
|
|
6195
6260
|
|
|
6261
|
+
// src/fan-out-meta.ts
|
|
6262
|
+
function fanOutItemMeta(output) {
|
|
6263
|
+
const w = output?.clipWarnings;
|
|
6264
|
+
const d = output?.durationSec;
|
|
6265
|
+
return {
|
|
6266
|
+
warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
|
|
6267
|
+
durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
|
|
6268
|
+
};
|
|
6269
|
+
}
|
|
6270
|
+
function clipNotesFrom(meta, single) {
|
|
6271
|
+
const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
|
|
6272
|
+
return rows.map((m, i) => ({
|
|
6273
|
+
clip: i + 1,
|
|
6274
|
+
warnings: m?.warnings ?? [],
|
|
6275
|
+
...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
|
|
6276
|
+
}));
|
|
6277
|
+
}
|
|
6278
|
+
|
|
6279
|
+
// src/ugc-run-state.ts
|
|
6280
|
+
var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"]);
|
|
6281
|
+
var UGC_CREATOR_CANDIDATES_KEY = "candidates";
|
|
6282
|
+
var UGC_PICK_FIRST_MESSAGE = "Pick a creator first.";
|
|
6283
|
+
var UGC_NODE_RUN_STATE_KEYS = {
|
|
6284
|
+
"ugc-creator": ["result", "keepResult", "ugcOutputs", UGC_CREATOR_CANDIDATES_KEY, "optionFailed", "generatedImageUrl"],
|
|
6285
|
+
// `exampleLines`: a template's example run, shown until the node's own first script (display only).
|
|
6286
|
+
"ugc-script": ["result", "keepResult", "ugcOutputs", "exampleLines"],
|
|
6287
|
+
"ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
|
|
6288
|
+
"ugc-clip": [
|
|
6289
|
+
"warnings",
|
|
6290
|
+
"rerender",
|
|
6291
|
+
"rerenderPending",
|
|
6292
|
+
"__listResults",
|
|
6293
|
+
"__listResultMeta",
|
|
6294
|
+
"clipWarnings",
|
|
6295
|
+
"durationSec",
|
|
6296
|
+
"ugcOutputs",
|
|
6297
|
+
"generatedVideoUrl",
|
|
6298
|
+
"generatedResults",
|
|
6299
|
+
"activeResultIndex"
|
|
6300
|
+
],
|
|
6301
|
+
"ugc-cards": ["result", "ugcOutputs", "generatedText", "text"]
|
|
6302
|
+
};
|
|
6303
|
+
var UGC_OVERRIDABLE_FIELDS = {
|
|
6304
|
+
"ugc-creator": ["source", "gender", "photoUrl"],
|
|
6305
|
+
"ugc-script": ["targetDurationSec"],
|
|
6306
|
+
"ugc-clips": [],
|
|
6307
|
+
"ugc-clip": [],
|
|
6308
|
+
"ugc-cards": []
|
|
6309
|
+
};
|
|
6310
|
+
var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
|
|
6311
|
+
function ugcPickPending(data) {
|
|
6312
|
+
const candidates = data && typeof data === "object" ? data[UGC_CREATOR_CANDIDATES_KEY] : void 0;
|
|
6313
|
+
return Array.isArray(candidates) && candidates.length > 0;
|
|
6314
|
+
}
|
|
6315
|
+
function ugcRunWaitsForPick(runNodes, opts = {}) {
|
|
6316
|
+
return runNodes.some((n) => n.type === "ugc-creator" && n.id !== opts.redrawId && ugcPickPending(n.data));
|
|
6317
|
+
}
|
|
6318
|
+
var UGC_PUBLISH_PRIVATE_FIELDS = {
|
|
6319
|
+
"ugc-creator": ["photoUrl"]
|
|
6320
|
+
};
|
|
6321
|
+
function stripUgcRunState(nodes) {
|
|
6322
|
+
return nodes.map((node) => {
|
|
6323
|
+
const type = typeof node.type === "string" ? node.type : "";
|
|
6324
|
+
if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
|
|
6325
|
+
const data = { ...node.data };
|
|
6326
|
+
for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
|
|
6327
|
+
for (const key of UGC_PUBLISH_PRIVATE_FIELDS[type] ?? []) delete data[key];
|
|
6328
|
+
if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
|
|
6329
|
+
return { ...node, data };
|
|
6330
|
+
});
|
|
6331
|
+
}
|
|
6332
|
+
function findUgcLockedFields(nodes, inputOverrides) {
|
|
6333
|
+
if (!nodes || !inputOverrides) return [];
|
|
6334
|
+
const found = [];
|
|
6335
|
+
for (const node of nodes) {
|
|
6336
|
+
const type = node?.type;
|
|
6337
|
+
if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
|
|
6338
|
+
const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
|
|
6339
|
+
const fields = inputOverrides[node.id];
|
|
6340
|
+
if (!fields || typeof fields !== "object") continue;
|
|
6341
|
+
for (const field of Object.keys(fields)) {
|
|
6342
|
+
if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
|
|
6343
|
+
}
|
|
6344
|
+
}
|
|
6345
|
+
return found;
|
|
6346
|
+
}
|
|
6347
|
+
|
|
6348
|
+
// src/ugc-node-wires.ts
|
|
6349
|
+
var UGC_NOT_SERVED_MESSAGE = "UGC videos are a Nodaro Cloud feature and are not served on this deployment.";
|
|
6350
|
+
var UGC_VERSION_MESSAGE = "This workflow was made with a newer version of the UGC nodes.";
|
|
6351
|
+
var UGC_NEWER_APP_MESSAGE = "This step needs a newer app version.";
|
|
6352
|
+
var UGC_PICK_GONE_MESSAGE = "These creator options are no longer available. Run UGC Creator again.";
|
|
6353
|
+
var UGC_CREATOR_MISSING_MESSAGE = "UGC Creator has no creator yet. Run it, or pick one of its options.";
|
|
6354
|
+
var UGC_SCRIPT_DEFAULT_TARGET_SEC = 15;
|
|
6355
|
+
var UGC_SCRIPT_MIN_TARGET_SEC = 4;
|
|
6356
|
+
var UGC_SCRIPT_MAX_TARGET_SEC = 300;
|
|
6357
|
+
var MINOR_AGE_MESSAGE = "That age can't be used: UGC creators are adults only.";
|
|
6358
|
+
var NEEDS_GENDER = "Choose woman or man.";
|
|
6359
|
+
var NEEDS_PHOTO = "Connect or upload a photo of yourself.";
|
|
6360
|
+
var NEEDS_CATEGORY = "Run UGC Script first, or pick a product category.";
|
|
6361
|
+
var NEEDS_SITE = "Add the product name or website.";
|
|
6362
|
+
var UGC_SCRIPT_NEEDS_CHANGES = "The script needs changes:";
|
|
6363
|
+
var NEEDS_PLAN_OUT = "Connect the Script (sized) output of UGC Clips.";
|
|
6364
|
+
var NEEDS_PLAN = "Connect the Script output of UGC Script.";
|
|
6365
|
+
var NEEDS_TICKET = "Connect the Clips output of UGC Clips.";
|
|
6366
|
+
var NEEDS_VIDEO = "Connect the joined video.";
|
|
6367
|
+
var NEEDS_TRANSCRIPT = "Connect the Transcript output of UGC Clips.";
|
|
6368
|
+
var UGC_NODE_MESSAGES = Object.freeze({
|
|
6369
|
+
notServed: UGC_NOT_SERVED_MESSAGE,
|
|
6370
|
+
version: UGC_VERSION_MESSAGE,
|
|
6371
|
+
newerApp: UGC_NEWER_APP_MESSAGE,
|
|
6372
|
+
pickGone: UGC_PICK_GONE_MESSAGE,
|
|
6373
|
+
creatorMissing: UGC_CREATOR_MISSING_MESSAGE,
|
|
6374
|
+
minorAge: MINOR_AGE_MESSAGE,
|
|
6375
|
+
needsGender: NEEDS_GENDER,
|
|
6376
|
+
needsPhoto: NEEDS_PHOTO,
|
|
6377
|
+
needsCategory: NEEDS_CATEGORY,
|
|
6378
|
+
needsSite: NEEDS_SITE,
|
|
6379
|
+
needsPlanOut: NEEDS_PLAN_OUT,
|
|
6380
|
+
needsPlan: NEEDS_PLAN,
|
|
6381
|
+
needsTicket: NEEDS_TICKET,
|
|
6382
|
+
needsVideo: NEEDS_VIDEO,
|
|
6383
|
+
needsTranscript: NEEDS_TRANSCRIPT
|
|
6384
|
+
});
|
|
6385
|
+
var UGC_SCREENSHOT_HANDLES = [
|
|
6386
|
+
"screenshot",
|
|
6387
|
+
"screenshot2",
|
|
6388
|
+
"screenshot3",
|
|
6389
|
+
"screenshot4",
|
|
6390
|
+
"screenshot5",
|
|
6391
|
+
"screenshot6",
|
|
6392
|
+
"screenshot7",
|
|
6393
|
+
"screenshot8"
|
|
6394
|
+
];
|
|
6395
|
+
var UGC_PRIMARY_HANDLE = {
|
|
6396
|
+
"ugc-creator": "creator",
|
|
6397
|
+
"ugc-script": "plan",
|
|
6398
|
+
"ugc-clips": "clips",
|
|
6399
|
+
"ugc-clip": "video-out",
|
|
6400
|
+
"ugc-cards": "layerPlan"
|
|
6401
|
+
};
|
|
6402
|
+
var isObject = (x) => !!x && typeof x === "object" && !Array.isArray(x);
|
|
6403
|
+
function ugcPlanLengthSec(plan) {
|
|
6404
|
+
const value = savedPlanOf(plan);
|
|
6405
|
+
if (!value) return void 0;
|
|
6406
|
+
const sec2 = value.targetDurationSec;
|
|
6407
|
+
return typeof sec2 === "number" && Number.isInteger(sec2) && sec2 >= UGC_SCRIPT_MIN_TARGET_SEC && sec2 <= UGC_SCRIPT_MAX_TARGET_SEC ? sec2 : void 0;
|
|
6408
|
+
}
|
|
6409
|
+
function ugcPlanScreenshotCount(plan) {
|
|
6410
|
+
const value = savedPlanOf(plan);
|
|
6411
|
+
if (!value || !Array.isArray(value.beats)) return void 0;
|
|
6412
|
+
return value.beats.filter((beat) => isObject(beat) && isObject(beat.screenshot)).length;
|
|
6413
|
+
}
|
|
6414
|
+
function savedPlanOf(plan) {
|
|
6415
|
+
let value = plan;
|
|
6416
|
+
if (typeof value === "string") {
|
|
6417
|
+
try {
|
|
6418
|
+
value = JSON.parse(value);
|
|
6419
|
+
} catch {
|
|
6420
|
+
return void 0;
|
|
6421
|
+
}
|
|
6422
|
+
}
|
|
6423
|
+
return isObject(value) ? value : void 0;
|
|
6424
|
+
}
|
|
6425
|
+
var filled = (x) => typeof x === "string" && x.trim() !== "" ? x : void 0;
|
|
6426
|
+
function ugcPipValue(outputs, sourceType, sourceHandle) {
|
|
6427
|
+
const pip = sourceHandle || (Object.hasOwn(UGC_PRIMARY_HANDLE, sourceType) ? UGC_PRIMARY_HANDLE[sourceType] : void 0);
|
|
6428
|
+
if (pip === void 0 || !isObject(outputs) || !Object.hasOwn(outputs, pip)) return void 0;
|
|
6429
|
+
const value = outputs[pip];
|
|
6430
|
+
return typeof value === "string" ? value : void 0;
|
|
6431
|
+
}
|
|
6432
|
+
function readUgcWire(raw, unreadable = UGC_VERSION_MESSAGE) {
|
|
6433
|
+
let parsed = raw;
|
|
6434
|
+
if (typeof raw === "string") {
|
|
6435
|
+
try {
|
|
6436
|
+
parsed = JSON.parse(raw);
|
|
6437
|
+
} catch {
|
|
6438
|
+
return { error: unreadable };
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6441
|
+
if (!isObject(parsed) || parsed.v === void 0) return { error: unreadable };
|
|
6442
|
+
if (parsed.v !== 1) return { error: UGC_VERSION_MESSAGE };
|
|
6443
|
+
return { value: parsed };
|
|
6444
|
+
}
|
|
6445
|
+
function routeErrorOf(body) {
|
|
6446
|
+
let parsed;
|
|
6447
|
+
try {
|
|
6448
|
+
parsed = JSON.parse(body);
|
|
6449
|
+
} catch {
|
|
6450
|
+
return {};
|
|
6451
|
+
}
|
|
6452
|
+
if (!isObject(parsed)) return {};
|
|
6453
|
+
if (isObject(parsed.error)) {
|
|
6454
|
+
const { code, message } = parsed.error;
|
|
6455
|
+
return { code: typeof code === "string" ? code : void 0, message: filled(message) };
|
|
6456
|
+
}
|
|
6457
|
+
return { message: filled(parsed.message) };
|
|
6458
|
+
}
|
|
6459
|
+
function ugcFailure(status, body) {
|
|
6460
|
+
const error = routeErrorOf(body);
|
|
6461
|
+
if (status === 404 && error.code === void 0) return UGC_NOT_SERVED_MESSAGE;
|
|
6462
|
+
if (error.code === "minor_age_refused") return MINOR_AGE_MESSAGE;
|
|
6463
|
+
if ((status === 503 || status >= 400 && status < 500) && error.message) return error.message;
|
|
6464
|
+
return `UGC step failed (${status})`;
|
|
6465
|
+
}
|
|
6466
|
+
var UGC_CREATOR_PICKER_TYPES = /* @__PURE__ */ new Set(["person", "styling", "setting", "lighting"]);
|
|
6467
|
+
function previousTraits(data) {
|
|
6468
|
+
if (ugcPickPending(data)) {
|
|
6469
|
+
const first = data.candidates[0];
|
|
6470
|
+
const record = isObject(first) ? first.record : void 0;
|
|
6471
|
+
return isObject(record) ? record.traits : void 0;
|
|
6472
|
+
}
|
|
6473
|
+
return !data.keepResult && isObject(data.result) ? data.result.traits : void 0;
|
|
6474
|
+
}
|
|
6475
|
+
function setPickers(pickers) {
|
|
6476
|
+
if (!pickers) return void 0;
|
|
6477
|
+
const set = Object.entries(pickers).filter(([, fields]) => isObject(fields) && Object.keys(fields).length > 0);
|
|
6478
|
+
return set.length > 0 ? Object.fromEntries(set) : void 0;
|
|
6479
|
+
}
|
|
6480
|
+
function ugcCreatorBody(input) {
|
|
6481
|
+
const { data } = input;
|
|
6482
|
+
const gender = data.gender;
|
|
6483
|
+
if (gender !== "woman" && gender !== "man") return { error: NEEDS_GENDER };
|
|
6484
|
+
if (data.source === "photo") {
|
|
6485
|
+
const imageUrl = filled(input.photoUrl) ?? filled(data.photoUrl);
|
|
6486
|
+
if (!imageUrl) return { error: NEEDS_PHOTO };
|
|
6487
|
+
return { body: { source: { kind: "photo", imageUrl, gender } } };
|
|
6488
|
+
}
|
|
6489
|
+
const productCategory = filled(data.categoryOverride) ?? filled(input.category);
|
|
6490
|
+
if (!productCategory) return { error: NEEDS_CATEGORY };
|
|
6491
|
+
const pickers = setPickers(input.pickers);
|
|
6492
|
+
const traits = previousTraits(data);
|
|
6493
|
+
return {
|
|
6494
|
+
body: {
|
|
6495
|
+
...typeof data.seed === "number" ? { seed: data.seed } : {},
|
|
6496
|
+
source: {
|
|
6497
|
+
kind: "sampled",
|
|
6498
|
+
gender,
|
|
6499
|
+
productCategory,
|
|
6500
|
+
...pickers ? { pickers } : {},
|
|
6501
|
+
...isObject(traits) ? { previous: traits } : {}
|
|
6502
|
+
}
|
|
6503
|
+
}
|
|
6504
|
+
};
|
|
6505
|
+
}
|
|
6506
|
+
function ugcCreatorOutputs(answer, identityImages) {
|
|
6507
|
+
const record = {
|
|
6508
|
+
v: 1,
|
|
6509
|
+
kind: answer.kind,
|
|
6510
|
+
gender: answer.gender,
|
|
6511
|
+
identityImages: [...identityImages],
|
|
6512
|
+
traits: answer.traits ?? null,
|
|
6513
|
+
seed: answer.seed ?? null,
|
|
6514
|
+
promptsVersion: answer.promptsVersion,
|
|
6515
|
+
productCategory: answer.productCategory ?? null
|
|
6516
|
+
};
|
|
6517
|
+
const imageUrl = identityImages[0] ?? "";
|
|
6518
|
+
return { outputs: { creator: JSON.stringify(record), ...imageUrl ? { image: imageUrl } : {} }, imageUrl, record };
|
|
6519
|
+
}
|
|
6520
|
+
var callOf = (raw) => {
|
|
6521
|
+
if (!raw || typeof raw !== "object") return void 0;
|
|
6522
|
+
const { tool, args } = raw;
|
|
6523
|
+
if (typeof tool !== "string" || !args || typeof args !== "object" || Array.isArray(args)) return void 0;
|
|
6524
|
+
return { tool, args };
|
|
6525
|
+
};
|
|
6526
|
+
var fallbackOf = (image) => image && typeof image === "object" ? image.fallback : void 0;
|
|
6527
|
+
function ugcCreatorCandidates(answer) {
|
|
6528
|
+
const listed = answer.candidates;
|
|
6529
|
+
const noList = listed === void 0 || listed === null || Array.isArray(listed) && listed.length === 0;
|
|
6530
|
+
const noImage = answer.image === void 0 || answer.image === null;
|
|
6531
|
+
if (noList && noImage) return { calls: [], fallback: null, pick: null };
|
|
6532
|
+
if (noList) {
|
|
6533
|
+
const image = callOf(answer.image);
|
|
6534
|
+
if (!image) return { error: UGC_NEWER_APP_MESSAGE };
|
|
6535
|
+
return { calls: [image], fallback: callOf(fallbackOf(answer.image)) ?? null, pick: "primary" };
|
|
6536
|
+
}
|
|
6537
|
+
if (!Array.isArray(listed)) return { error: UGC_NEWER_APP_MESSAGE };
|
|
6538
|
+
const calls = listed.map(callOf);
|
|
6539
|
+
if (calls.some((c) => c === void 0)) return { error: UGC_NEWER_APP_MESSAGE };
|
|
6540
|
+
const how = answer.pick?.how;
|
|
6541
|
+
return {
|
|
6542
|
+
calls,
|
|
6543
|
+
fallback: callOf(answer.fallback) ?? callOf(fallbackOf(answer.image)) ?? null,
|
|
6544
|
+
pick: how === "user" && calls.length > 1 ? "user" : "primary"
|
|
6545
|
+
};
|
|
6546
|
+
}
|
|
6547
|
+
function ugcCreatorCallsToRender(c, opts) {
|
|
6548
|
+
return opts.personPicks && c.pick === "user" ? c.calls : c.calls.slice(0, 1);
|
|
6549
|
+
}
|
|
6550
|
+
function ugcCreatorCandidate(answer, images) {
|
|
6551
|
+
const out = ugcCreatorOutputs(answer, images);
|
|
6552
|
+
return { imageUrl: out.imageUrl, record: out.record };
|
|
6553
|
+
}
|
|
6554
|
+
function ugcAwaitsPick(output) {
|
|
6555
|
+
const candidates = isObject(output) ? output.ugcCandidates : void 0;
|
|
6556
|
+
return Array.isArray(candidates) && candidates.length >= 2;
|
|
6557
|
+
}
|
|
6558
|
+
function ugcCreatorPick(candidates, index) {
|
|
6559
|
+
const entry = Array.isArray(candidates) && Number.isInteger(index) && index >= 0 ? candidates[index] : void 0;
|
|
6560
|
+
const imageUrl = entry?.imageUrl;
|
|
6561
|
+
const record = entry?.record;
|
|
6562
|
+
if (typeof imageUrl !== "string" || !record || typeof record !== "object" || Array.isArray(record)) return { error: UGC_PICK_GONE_MESSAGE };
|
|
6563
|
+
const r = record;
|
|
6564
|
+
if (r.v !== 1) return { error: UGC_VERSION_MESSAGE };
|
|
6565
|
+
if (!Array.isArray(r.identityImages) || r.identityImages[0] !== imageUrl) return { error: UGC_PICK_GONE_MESSAGE };
|
|
6566
|
+
return { result: r, outputs: { creator: JSON.stringify(r), image: imageUrl }, imageUrl };
|
|
6567
|
+
}
|
|
6568
|
+
function ugcScriptBody(input) {
|
|
6569
|
+
const site = filled(input.site)?.trim();
|
|
6570
|
+
if (!site) return { error: NEEDS_SITE };
|
|
6571
|
+
const productImage = filled(input.productImage);
|
|
6572
|
+
return {
|
|
6573
|
+
body: {
|
|
6574
|
+
site,
|
|
6575
|
+
screenshots: input.screenshots.filter((s) => filled(s) !== void 0),
|
|
6576
|
+
...productImage ? { productImage } : {},
|
|
6577
|
+
targetDurationSec: typeof input.targetDurationSec === "number" ? input.targetDurationSec : UGC_SCRIPT_DEFAULT_TARGET_SEC,
|
|
6578
|
+
language: "en"
|
|
6579
|
+
}
|
|
6580
|
+
};
|
|
6581
|
+
}
|
|
6582
|
+
function ugcScriptOutputs(outputData) {
|
|
6583
|
+
const plan = outputData.plan;
|
|
6584
|
+
const category = filled(outputData.productCategory);
|
|
6585
|
+
return {
|
|
6586
|
+
...isObject(plan) ? { plan: JSON.stringify({ v: 1, ...plan }) } : {},
|
|
6587
|
+
...category ? { category } : {}
|
|
6588
|
+
};
|
|
6589
|
+
}
|
|
6590
|
+
function ugcScriptResult(outputData) {
|
|
6591
|
+
const { plan, productCategory, warnings, notes, rounds } = outputData;
|
|
6592
|
+
if (!isObject(plan)) return void 0;
|
|
6593
|
+
return {
|
|
6594
|
+
plan,
|
|
6595
|
+
productCategory: filled(productCategory) ?? "",
|
|
6596
|
+
warnings: Array.isArray(warnings) ? [...warnings] : [],
|
|
6597
|
+
notes: Array.isArray(notes) ? notes.filter((n) => typeof n === "string") : [],
|
|
6598
|
+
rounds: typeof rounds === "number" && Number.isFinite(rounds) ? rounds : 0
|
|
6599
|
+
};
|
|
6600
|
+
}
|
|
6601
|
+
function ugcKeptOutputs(type, data) {
|
|
6602
|
+
if (type === "ugc-creator" && ugcPickPending(data)) return null;
|
|
6603
|
+
const result = data.keepResult === true ? data.result : void 0;
|
|
6604
|
+
if (!isObject(result)) return null;
|
|
6605
|
+
if (type === "ugc-creator") {
|
|
6606
|
+
const image = Array.isArray(result.identityImages) ? filled(result.identityImages[0]) : void 0;
|
|
6607
|
+
return image ? { creator: JSON.stringify(result), image } : null;
|
|
6608
|
+
}
|
|
6609
|
+
if (type === "ugc-script") return isObject(result.plan) ? ugcScriptOutputs(result) : null;
|
|
6610
|
+
return null;
|
|
6611
|
+
}
|
|
6612
|
+
function ugcClipsBody(input) {
|
|
6613
|
+
const plan = readUgcWire(input.planWire, NEEDS_PLAN);
|
|
6614
|
+
if ("error" in plan) return plan;
|
|
6615
|
+
const creator = readUgcWire(input.creatorWire, UGC_CREATOR_MISSING_MESSAGE);
|
|
6616
|
+
if ("error" in creator) return creator;
|
|
6617
|
+
const voiceId = filled(input.voiceId);
|
|
6618
|
+
return {
|
|
6619
|
+
body: {
|
|
6620
|
+
plan: plan.value,
|
|
6621
|
+
gender: creator.value.gender,
|
|
6622
|
+
traits: creator.value.traits ?? null,
|
|
6623
|
+
identityImages: creator.value.identityImages,
|
|
6624
|
+
surface: "canvas",
|
|
6625
|
+
...voiceId ? { voiceId } : {}
|
|
6626
|
+
}
|
|
6627
|
+
};
|
|
6628
|
+
}
|
|
6629
|
+
function ugcClipsOutputs(answer) {
|
|
6630
|
+
const errors = Array.isArray(answer.errors) ? answer.errors : [];
|
|
6631
|
+
if (errors.length > 0) {
|
|
6632
|
+
const said = errors.flatMap((e) => isObject(e) ? [filled(e.message), filled(e.fix)] : []).filter((s) => s !== void 0);
|
|
6633
|
+
return { error: said.length > 0 ? `${UGC_SCRIPT_NEEDS_CHANGES} ${said.join(" ")}` : UGC_NEWER_APP_MESSAGE };
|
|
6634
|
+
}
|
|
6635
|
+
const { tickets, sizedPlan, transcript, speechCheckCall } = answer;
|
|
6636
|
+
if (!Array.isArray(tickets) || tickets.length === 0 || !tickets.every(isObject) || !isObject(sizedPlan) || typeof transcript !== "string") {
|
|
6637
|
+
return { error: UGC_NEWER_APP_MESSAGE };
|
|
6638
|
+
}
|
|
6639
|
+
const wires = tickets.map((t2) => JSON.stringify(t2));
|
|
6640
|
+
const transcribeArgs = isObject(speechCheckCall) && isObject(speechCheckCall.args) ? speechCheckCall.args : {};
|
|
6641
|
+
return {
|
|
6642
|
+
outputs: { clips: wires[0], "plan-out": JSON.stringify({ v: 1, plan: sizedPlan, transcribeArgs }), transcript },
|
|
6643
|
+
tickets: wires,
|
|
6644
|
+
hasCards: answer.hasCards === true
|
|
6645
|
+
};
|
|
6646
|
+
}
|
|
6647
|
+
function ugcClipBody(input) {
|
|
6648
|
+
const read = readUgcWire(input.ticketWire, NEEDS_TICKET);
|
|
6649
|
+
if ("error" in read) return read;
|
|
6650
|
+
const ticket = read.value;
|
|
6651
|
+
const { index, durationSec } = ticket;
|
|
6652
|
+
if (typeof index !== "number" || !Number.isInteger(index) || index < 0) return { error: NEEDS_TICKET };
|
|
6653
|
+
if (typeof durationSec !== "number" || !Number.isFinite(durationSec) || durationSec <= 0) return { error: NEEDS_TICKET };
|
|
6654
|
+
const clipNumber = index + 1;
|
|
6655
|
+
const count = input.rerender?.[String(clipNumber)];
|
|
6656
|
+
const nonce = typeof count === "number" && Number.isInteger(count) && count >= 0 ? count : 0;
|
|
6657
|
+
const runKey = filled(input.runKey);
|
|
6658
|
+
return { body: { ticket, nonce, ...runKey ? { runKey } : {} }, clipNumber, durationSec };
|
|
6659
|
+
}
|
|
6660
|
+
function ugcClipOutputs(outputData) {
|
|
6661
|
+
const videoUrl = filled(outputData.videoUrl) ?? "";
|
|
6662
|
+
const meta = fanOutItemMeta(outputData);
|
|
6663
|
+
return { outputs: videoUrl ? { "video-out": videoUrl } : {}, videoUrl, durationSec: meta.durationSec, clipWarnings: [...meta.warnings] };
|
|
6664
|
+
}
|
|
6665
|
+
function ugcClipSavedList(data) {
|
|
6666
|
+
if (!isObject(data)) return void 0;
|
|
6667
|
+
const batch = Array.isArray(data.__listResults) ? data.__listResults.filter((u) => typeof u === "string" && u !== "") : [];
|
|
6668
|
+
if (batch.length > 0) return batch;
|
|
6669
|
+
const results = Array.isArray(data.generatedResults) ? data.generatedResults : [];
|
|
6670
|
+
const index = typeof data.activeResultIndex === "number" && Number.isInteger(data.activeResultIndex) ? data.activeResultIndex : 0;
|
|
6671
|
+
const active = results[index];
|
|
6672
|
+
const url = (isObject(active) ? filled(active.url) : void 0) ?? filled(data.generatedVideoUrl);
|
|
6673
|
+
return url ? [url] : void 0;
|
|
6674
|
+
}
|
|
6675
|
+
function ugcCardsJobs(input) {
|
|
6676
|
+
const read = readUgcWire(input.planOutWire, NEEDS_PLAN_OUT);
|
|
6677
|
+
if ("error" in read) return read;
|
|
6678
|
+
const { plan, transcribeArgs } = read.value;
|
|
6679
|
+
if (!isObject(plan) || !isObject(transcribeArgs)) return { error: NEEDS_PLAN_OUT };
|
|
6680
|
+
const videoUrl = filled(input.videoUrl);
|
|
6681
|
+
if (!videoUrl) return { error: NEEDS_VIDEO };
|
|
6682
|
+
const transcript = input.transcript;
|
|
6683
|
+
if (typeof transcript !== "string") return { error: NEEDS_TRANSCRIPT };
|
|
6684
|
+
return {
|
|
6685
|
+
alignment: { path: "/v1/forced-alignment", body: { audioUrl: videoUrl, transcript } },
|
|
6686
|
+
transcribe: { path: "/v1/transcribe", body: { ...transcribeArgs, audioUrl: videoUrl, provider: DEFAULT_TRANSCRIBE_NODE_PROVIDER, wordTimestamps: true } },
|
|
6687
|
+
plan
|
|
6688
|
+
};
|
|
6689
|
+
}
|
|
6690
|
+
function ugcCardsBody(input) {
|
|
6691
|
+
return {
|
|
6692
|
+
surface: "canvas",
|
|
6693
|
+
plan: input.plan,
|
|
6694
|
+
videoUrl: input.videoUrl,
|
|
6695
|
+
...Array.isArray(input.alignment) ? { alignment: input.alignment } : {},
|
|
6696
|
+
...Array.isArray(input.words) ? { words: input.words } : {},
|
|
6697
|
+
failed: [...input.failed],
|
|
6698
|
+
clipNotes: [...input.clipNotes]
|
|
6699
|
+
};
|
|
6700
|
+
}
|
|
6701
|
+
var EMPTY_CAPTION_PLAN = { v: 1, hookText: "", hookEndMs: 0, bodyEndMs: 0, captions: [] };
|
|
6702
|
+
function ugcCardsOutputs(answer) {
|
|
6703
|
+
const timing = answer.captionTiming;
|
|
6704
|
+
const report = answer.report;
|
|
6705
|
+
const lines = isObject(report) && Array.isArray(report.lines) ? report.lines.filter((l) => typeof l === "string") : [];
|
|
6706
|
+
return {
|
|
6707
|
+
layerPlan: JSON.stringify(Array.isArray(answer.layerPlan) ? answer.layerPlan : []),
|
|
6708
|
+
captionPlan: JSON.stringify(isObject(timing) ? { v: 1, ...timing } : EMPTY_CAPTION_PLAN),
|
|
6709
|
+
report: lines.join("\n")
|
|
6710
|
+
};
|
|
6711
|
+
}
|
|
6712
|
+
|
|
6196
6713
|
// src/producer-types.ts
|
|
6197
6714
|
var VIDEO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
6198
6715
|
"image-to-video",
|
|
@@ -6279,7 +6796,10 @@ var VIDEO_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
|
6279
6796
|
"pro-3d-render",
|
|
6280
6797
|
// Video Overlay: timed image layers over a video in one local FFmpeg pass
|
|
6281
6798
|
// (the base audio copied) — emits a video URL on `video-out`.
|
|
6282
|
-
"video-overlay"
|
|
6799
|
+
"video-overlay",
|
|
6800
|
+
// UGC Clip: renders one clip of a UGC video from its ticket — emits a video
|
|
6801
|
+
// URL on `video-out` (one per fan-out iteration).
|
|
6802
|
+
"ugc-clip"
|
|
6283
6803
|
]);
|
|
6284
6804
|
var DYNAMIC_PRODUCER_TYPES = /* @__PURE__ */ new Set([
|
|
6285
6805
|
"list",
|
|
@@ -6423,7 +6943,13 @@ var FAN_OUT_EACH_HANDLES = {
|
|
|
6423
6943
|
// switched EDL is its own Apply EDL render. Its transcript is the same for
|
|
6424
6944
|
// every clip (the master clock, renamed), so that handle stays one value
|
|
6425
6945
|
// (decided 2026-10-04).
|
|
6426
|
-
"camera-switch": { each: ["edl"], primary: "edl" }
|
|
6946
|
+
"camera-switch": { each: ["edl"], primary: "edl" },
|
|
6947
|
+
// UGC Clips: one ticket per clip on `clips` (each); `plan-out` and
|
|
6948
|
+
// `transcript` carry one value. Not a FAN_OUT_EACH_TYPES member — every
|
|
6949
|
+
// handle of such a member would fan out. Its one run writes the tickets as
|
|
6950
|
+
// its list (`listResults`, the editor's `__listResults`). The pip an edge
|
|
6951
|
+
// with no handle reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
6952
|
+
"ugc-clips": { each: ["clips"], primary: UGC_PRIMARY_HANDLE["ugc-clips"] }
|
|
6427
6953
|
};
|
|
6428
6954
|
var FAN_OUT_ALL_OR_NOTHING_TYPES = /* @__PURE__ */ new Set(["ugc-clip"]);
|
|
6429
6955
|
var OWN_LIST_NODE_TYPES = /* @__PURE__ */ new Set(["extract-field", "json-process"]);
|
|
@@ -6914,7 +7440,10 @@ var TEXT_OUTPUT_TYPES = /* @__PURE__ */ new Set([
|
|
|
6914
7440
|
"transcribe",
|
|
6915
7441
|
"image-to-text",
|
|
6916
7442
|
"qa-check",
|
|
6917
|
-
"text-prompt"
|
|
7443
|
+
"text-prompt",
|
|
7444
|
+
// UGC Cards' output card is its Notes: a run hands it on as the node's text
|
|
7445
|
+
// (`output.text`, `generatedText` on the canvas).
|
|
7446
|
+
"ugc-cards"
|
|
6918
7447
|
]);
|
|
6919
7448
|
function getInputNodes(nodes, curatedOnly = true) {
|
|
6920
7449
|
return nodes.filter((n) => {
|
|
@@ -10942,9 +11471,73 @@ var SOCIAL_POST_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
|
10942
11471
|
"telegram-post",
|
|
10943
11472
|
"publish-social"
|
|
10944
11473
|
]);
|
|
11474
|
+
var SOCIAL_POST_NODE_PLATFORM = Object.freeze({
|
|
11475
|
+
"instagram-post": "instagram",
|
|
11476
|
+
"tiktok-post": "tiktok",
|
|
11477
|
+
"youtube-upload": "youtube",
|
|
11478
|
+
"linkedin-post": "linkedin",
|
|
11479
|
+
"x-post": "x",
|
|
11480
|
+
"facebook-post": "facebook",
|
|
11481
|
+
"telegram-post": "telegram"
|
|
11482
|
+
});
|
|
10945
11483
|
var INSTAGRAM_CAROUSEL_MIN_ITEMS = 2;
|
|
10946
11484
|
var INSTAGRAM_CAROUSEL_MAX_ITEMS = 10;
|
|
10947
11485
|
|
|
11486
|
+
// src/node-run-routes.ts
|
|
11487
|
+
var SOCIAL_PUBLISH_ROUTE = "/v1/social/publish";
|
|
11488
|
+
var NODE_RUN_ROUTES = Object.freeze({
|
|
11489
|
+
"generate-3d-scene": "/v1/3d-scene/generate",
|
|
11490
|
+
"edit-3d-scene": "/v1/3d-scene/edit",
|
|
11491
|
+
"ai-writer": "/v1/ai-writer/generate",
|
|
11492
|
+
"llm-chat": "/v1/llm-chat/generate",
|
|
11493
|
+
"video-composer": "/v1/scene-graph/generate",
|
|
11494
|
+
"after-effects": "/v1/after-effects/generate",
|
|
11495
|
+
"lottie-overlay": "/v1/lottie-overlay/generate",
|
|
11496
|
+
"3d-title": "/v1/3d-title/generate",
|
|
11497
|
+
"motion-graphics": "/v1/motion-graphics/generate",
|
|
11498
|
+
"image-to-text": "/v1/image-to-text/describe",
|
|
11499
|
+
"telegram-channel-feed": "/v1/telegram-channel/fetch",
|
|
11500
|
+
"suno-generate": "/v1/suno/generate",
|
|
11501
|
+
"suno-cover": "/v1/suno/cover",
|
|
11502
|
+
"suno-extend": "/v1/suno/extend",
|
|
11503
|
+
"suno-lyrics": "/v1/suno/lyrics",
|
|
11504
|
+
"suno-separate": "/v1/suno/separate",
|
|
11505
|
+
"suno-music-video": "/v1/suno/music-video",
|
|
11506
|
+
"suno-mashup": "/v1/suno/mashup",
|
|
11507
|
+
"suno-replace-section": "/v1/suno/replace-section",
|
|
11508
|
+
"suno-style-boost": "/v1/suno/style-boost",
|
|
11509
|
+
"suno-add-instrumental": "/v1/suno/add-instrumental",
|
|
11510
|
+
"suno-add-vocals": "/v1/suno/add-vocals",
|
|
11511
|
+
"suno-convert-wav": "/v1/suno/convert-wav",
|
|
11512
|
+
"suno-upload-extend": "/v1/suno/upload-extend",
|
|
11513
|
+
"suno-voice": "/v1/suno/voice/generate",
|
|
11514
|
+
// The UGC nodes' routes, served by the Nodaro Cloud plugin.
|
|
11515
|
+
"ugc-creator": "/v1/ugc/creator",
|
|
11516
|
+
"ugc-script": "/v1/ugc/script",
|
|
11517
|
+
"ugc-clips": "/v1/ugc/clips",
|
|
11518
|
+
"ugc-clip": "/v1/ugc/clip",
|
|
11519
|
+
"ugc-cards": "/v1/ugc/cards",
|
|
11520
|
+
// Every social post node publishes through the one route; the body's
|
|
11521
|
+
// `platform` says where (SOCIAL_POST_NODE_PLATFORM).
|
|
11522
|
+
...Object.fromEntries([...SOCIAL_POST_NODE_TYPES].map((type) => [type, SOCIAL_PUBLISH_ROUTE]))
|
|
11523
|
+
});
|
|
11524
|
+
var NODE_TYPES_WITHOUT_RUN_ROUTE = Object.freeze({
|
|
11525
|
+
"modify-image": 'run "image-to-image" instead (or "edit-image" for the nano-banana-edit provider)',
|
|
11526
|
+
"upscale-image": 'run "edit-image" with an upscale provider instead (e.g. provider "recraft-upscale")',
|
|
11527
|
+
"remove-background": 'run "edit-image" with provider "recraft-remove-bg" instead',
|
|
11528
|
+
"image-to-video": 'run "generate-video" with a start frame instead',
|
|
11529
|
+
composite: "it runs only as part of a workflow (client.workflows.run)",
|
|
11530
|
+
"manual-edit": "it opens the in-browser editor and runs only inside a workflow",
|
|
11531
|
+
"paint-mask": "it is painted in the editor and never runs; use its mask output inside a workflow",
|
|
11532
|
+
scene: "it is run by the pipeline orchestrator (client.pipelines)",
|
|
11533
|
+
"generative-pipeline": "it is run by the pipeline orchestrator (client.pipelines)"
|
|
11534
|
+
});
|
|
11535
|
+
function nodeRunRoute(type) {
|
|
11536
|
+
if (Object.prototype.hasOwnProperty.call(NODE_TYPES_WITHOUT_RUN_ROUTE, type)) return null;
|
|
11537
|
+
if (Object.prototype.hasOwnProperty.call(NODE_RUN_ROUTES, type)) return NODE_RUN_ROUTES[type];
|
|
11538
|
+
return `/v1/${encodeURIComponent(type)}`;
|
|
11539
|
+
}
|
|
11540
|
+
|
|
10948
11541
|
// src/effective-tier.ts
|
|
10949
11542
|
function resolveStoredTier(p) {
|
|
10950
11543
|
return p.tier ?? p.subscription_tier ?? "free";
|
|
@@ -11592,7 +12185,15 @@ var JSON_OUTPUT_KINDS = Object.freeze({
|
|
|
11592
12185
|
"inspiration-read": { primary: "json", pips: { json: "other" } },
|
|
11593
12186
|
"competitor-read": { primary: "json", pips: { json: "other" } },
|
|
11594
12187
|
// Describe to Picker: the picker values read off an image.
|
|
11595
|
-
"describe-to-picker": { primary: "picker-json", pips: { "picker-json": "other" } }
|
|
12188
|
+
"describe-to-picker": { primary: "picker-json", pips: { "picker-json": "other" } },
|
|
12189
|
+
// The UGC video nodes: their own versioned JSON (a creator record, a plan, the
|
|
12190
|
+
// clip tickets, the sized plan), and UGC Cards' layer plan and caption plan.
|
|
12191
|
+
// Their text pips (category, transcript, report) are not JSON pips. The pip an
|
|
12192
|
+
// edge with no `sourceHandle` reads is the UGC wires' own (UGC_PRIMARY_HANDLE).
|
|
12193
|
+
"ugc-creator": { primary: UGC_PRIMARY_HANDLE["ugc-creator"], pips: { creator: "other" } },
|
|
12194
|
+
"ugc-script": { primary: UGC_PRIMARY_HANDLE["ugc-script"], pips: { plan: "other" } },
|
|
12195
|
+
"ugc-clips": { primary: UGC_PRIMARY_HANDLE["ugc-clips"], pips: { clips: "other", "plan-out": "other" } },
|
|
12196
|
+
"ugc-cards": { primary: UGC_PRIMARY_HANDLE["ugc-cards"], pips: { layerPlan: "other", captionPlan: "other" } }
|
|
11596
12197
|
});
|
|
11597
12198
|
var JSON_INPUT_KINDS = Object.freeze({
|
|
11598
12199
|
transcript: "transcript",
|
|
@@ -12277,8 +12878,8 @@ function metaAdsScrapeWireSources(data, upstream) {
|
|
|
12277
12878
|
const upstreamText = typeof upstream === "string" ? upstream : void 0;
|
|
12278
12879
|
switch (metaAdsNodeMode(data.mode)) {
|
|
12279
12880
|
case "pages": {
|
|
12280
|
-
const
|
|
12281
|
-
return { mode: "pages", pageUrls:
|
|
12881
|
+
const own3 = splitMetaAdsPageUrls(data.pageUrls);
|
|
12882
|
+
return { mode: "pages", pageUrls: own3.length > 0 ? own3 : splitMetaAdsPageUrls(upstreamText) };
|
|
12282
12883
|
}
|
|
12283
12884
|
case "advertiser": {
|
|
12284
12885
|
const picks = metaAdsAdvertisersFrom(data.advertisers);
|
|
@@ -12287,8 +12888,8 @@ function metaAdsScrapeWireSources(data, upstream) {
|
|
|
12287
12888
|
return { mode: "pages", pageUrls: [], advertiserNames: names };
|
|
12288
12889
|
}
|
|
12289
12890
|
default: {
|
|
12290
|
-
const
|
|
12291
|
-
return { mode: "search", query:
|
|
12891
|
+
const own3 = typeof data.query === "string" ? data.query : "";
|
|
12892
|
+
return { mode: "search", query: own3 || upstreamText };
|
|
12292
12893
|
}
|
|
12293
12894
|
}
|
|
12294
12895
|
}
|
|
@@ -14993,8 +15594,28 @@ var EXECUTION_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
14993
15594
|
// that run. Bookkeeping, persisted for the same reason.
|
|
14994
15595
|
"resultsRunEndedAt",
|
|
14995
15596
|
// A trigger's last run values (also in TRANSIENT_RUNTIME_KEYS: never saved).
|
|
14996
|
-
"__triggerData"
|
|
15597
|
+
"__triggerData",
|
|
15598
|
+
// A fan-out's notes rows, every fan-out's (row-aligned with __listResults):
|
|
15599
|
+
// a row's warnings and length. A RESULT: persisted.
|
|
15600
|
+
"__listResultMeta"
|
|
14997
15601
|
]);
|
|
15602
|
+
var NODE_TYPE_EXECUTION_DATA_KEYS = {
|
|
15603
|
+
"ugc-creator": ["ugcOutputs", "candidates", "optionFailed"],
|
|
15604
|
+
"ugc-script": ["ugcOutputs"],
|
|
15605
|
+
"ugc-clips": ["ugcOutputs", "quote"],
|
|
15606
|
+
"ugc-clip": ["ugcOutputs", "clipWarnings", "durationSec", "rerenderPending"],
|
|
15607
|
+
"ugc-cards": ["ugcOutputs"]
|
|
15608
|
+
};
|
|
15609
|
+
function isExecutionDataKey(key, type) {
|
|
15610
|
+
if (EXECUTION_DATA_KEYS.has(key)) return true;
|
|
15611
|
+
return typeof type === "string" && Object.hasOwn(NODE_TYPE_EXECUTION_DATA_KEYS, type) && NODE_TYPE_EXECUTION_DATA_KEYS[type].includes(key);
|
|
15612
|
+
}
|
|
15613
|
+
var EXECUTION_DATA_KEYS_BY_TYPE = new Map(
|
|
15614
|
+
Object.entries(NODE_TYPE_EXECUTION_DATA_KEYS).map(([type, keys]) => [type, /* @__PURE__ */ new Set([...EXECUTION_DATA_KEYS, ...keys])])
|
|
15615
|
+
);
|
|
15616
|
+
function executionDataKeysOf(type) {
|
|
15617
|
+
return (typeof type === "string" ? EXECUTION_DATA_KEYS_BY_TYPE.get(type) : void 0) ?? EXECUTION_DATA_KEYS;
|
|
15618
|
+
}
|
|
14998
15619
|
var TRANSIENT_RUNTIME_KEYS = /* @__PURE__ */ new Set([
|
|
14999
15620
|
"executionStatus",
|
|
15000
15621
|
"currentJobId",
|
|
@@ -15107,6 +15728,7 @@ function stripExportContent(nodes) {
|
|
|
15107
15728
|
return stripUnownedRefs(nodes).map((node) => {
|
|
15108
15729
|
const data = { ...node.data };
|
|
15109
15730
|
for (const field of GENERATED_FIELDS) delete data[field];
|
|
15731
|
+
for (const field of NODE_TYPE_EXECUTION_DATA_KEYS[node.type] ?? []) delete data[field];
|
|
15110
15732
|
const extras = NODE_EXTRA_FIELDS[node.type] ?? [];
|
|
15111
15733
|
for (const field of extras) delete data[field];
|
|
15112
15734
|
return { ...node, data };
|
|
@@ -17641,24 +18263,6 @@ function resolveAudioCrossfadeCurve(id) {
|
|
|
17641
18263
|
return CURVES_BY_ID.get(id)?.ffmpeg ?? "tri";
|
|
17642
18264
|
}
|
|
17643
18265
|
|
|
17644
|
-
// src/fan-out-meta.ts
|
|
17645
|
-
function fanOutItemMeta(output) {
|
|
17646
|
-
const w = output?.clipWarnings;
|
|
17647
|
-
const d = output?.durationSec;
|
|
17648
|
-
return {
|
|
17649
|
-
warnings: Array.isArray(w) ? w.filter((x) => typeof x === "string") : [],
|
|
17650
|
-
durationSec: typeof d === "number" && Number.isFinite(d) && d > 0 ? d : null
|
|
17651
|
-
};
|
|
17652
|
-
}
|
|
17653
|
-
function clipNotesFrom(meta, single) {
|
|
17654
|
-
const rows = meta && meta.length > 0 ? meta : single ? [single] : [];
|
|
17655
|
-
return rows.map((m, i) => ({
|
|
17656
|
-
clip: i + 1,
|
|
17657
|
-
warnings: m?.warnings ?? [],
|
|
17658
|
-
...typeof m?.durationSec === "number" ? { durationSec: m.durationSec } : {}
|
|
17659
|
-
}));
|
|
17660
|
-
}
|
|
17661
|
-
|
|
17662
18266
|
// src/suno-track-sources.ts
|
|
17663
18267
|
var SUNO_TRACK_SOURCE_TYPES = /* @__PURE__ */ new Set([
|
|
17664
18268
|
"suno-generate",
|
|
@@ -17912,10 +18516,10 @@ var PRESET_EXCLUDED_KEYS = /* @__PURE__ */ new Set([
|
|
|
17912
18516
|
// generated composer-plan state (derived from COMPOSER_PLAN_MAP + lottieUrl)
|
|
17913
18517
|
...PRESET_APPLY_CLEAR_KEYS
|
|
17914
18518
|
]);
|
|
17915
|
-
function extractPresetData(data) {
|
|
18519
|
+
function extractPresetData(data, nodeType) {
|
|
17916
18520
|
const out = {};
|
|
17917
18521
|
for (const key of Object.keys(data)) {
|
|
17918
|
-
if (
|
|
18522
|
+
if (isExecutionDataKey(key, nodeType)) continue;
|
|
17919
18523
|
if (PRESET_EXCLUDED_KEYS.has(key)) continue;
|
|
17920
18524
|
out[key] = data[key];
|
|
17921
18525
|
}
|
|
@@ -17963,14 +18567,14 @@ function buildNodePresetExport(presets, exportedAtIso) {
|
|
|
17963
18567
|
kind: NODE_PRESET_EXPORT_KIND,
|
|
17964
18568
|
version: 1,
|
|
17965
18569
|
exportedAt: exportedAtIso,
|
|
17966
|
-
presets: presets.map((p) => ({ ...p, data: extractPresetData(p.data) }))
|
|
18570
|
+
presets: presets.map((p) => ({ ...p, data: extractPresetData(p.data, p.nodeType) }))
|
|
17967
18571
|
};
|
|
17968
18572
|
}
|
|
17969
18573
|
function parseNodePresetExport(input) {
|
|
17970
18574
|
const parsed = envelopeSchema.parse(input);
|
|
17971
18575
|
return {
|
|
17972
18576
|
...parsed,
|
|
17973
|
-
presets: parsed.presets.map((p) => ({ ...p, data: extractPresetData(p.data) }))
|
|
18577
|
+
presets: parsed.presets.map((p) => ({ ...p, data: extractPresetData(p.data, p.nodeType) }))
|
|
17974
18578
|
};
|
|
17975
18579
|
}
|
|
17976
18580
|
|
|
@@ -19009,8 +19613,8 @@ var isSlot = (v) => typeof v === "number" && Number.isInteger(v) && v >= 1;
|
|
|
19009
19613
|
var isIndex = (v) => typeof v === "number" && Number.isInteger(v) && v >= 0;
|
|
19010
19614
|
function videoOverlayRenderOrder(layers) {
|
|
19011
19615
|
return layers.map((l, i) => {
|
|
19012
|
-
const
|
|
19013
|
-
return { i, z: typeof l?.zIndex === "number" && Number.isFinite(l.zIndex) ? l.zIndex :
|
|
19616
|
+
const own3 = isSlot(l?.planLayer) ? l.planLayer - 1 - PLAN_LAYER_Z_BASE : isSlot(l?.slot) ? l.slot - 1 : isIndex(l?.index) ? l.index : i;
|
|
19617
|
+
return { i, z: typeof l?.zIndex === "number" && Number.isFinite(l.zIndex) ? l.zIndex : own3 };
|
|
19014
19618
|
}).sort((a, b) => a.z - b.z || a.i - b.i).map((e) => e.i);
|
|
19015
19619
|
}
|
|
19016
19620
|
var evenFloor = (n) => Math.max(2, Math.floor(n / 2) * 2);
|
|
@@ -19160,8 +19764,8 @@ function assembleVideoOverlayRequest(input) {
|
|
|
19160
19764
|
for (let i = 0; i < slots; i++) {
|
|
19161
19765
|
const raw = asLayer(stored[i]);
|
|
19162
19766
|
const wiredUrl = wired[i];
|
|
19163
|
-
const
|
|
19164
|
-
const image = typeof wiredUrl === "string" && wiredUrl.length > 0 ? wiredUrl : typeof
|
|
19767
|
+
const own3 = raw?.imageUrl;
|
|
19768
|
+
const image = typeof wiredUrl === "string" && wiredUrl.length > 0 ? wiredUrl : typeof own3 === "string" && own3.length > 0 ? own3 : void 0;
|
|
19165
19769
|
if (!image) continue;
|
|
19166
19770
|
layers.push(expandVideoOverlayLayer({ ...raw ?? {}, imageUrl: image, slot: i + 1 }));
|
|
19167
19771
|
}
|
|
@@ -19177,8 +19781,8 @@ function assembleVideoOverlayRequest(input) {
|
|
|
19177
19781
|
const plan = parseVideoOverlayLayerPlan(input.planLayers);
|
|
19178
19782
|
if ("error" in plan) return { videoUrl: input.videoUrl, layers, ...rest, planError: plan.error };
|
|
19179
19783
|
const planned = expandVideoOverlayPresets(plan.layers).map((l, i) => {
|
|
19180
|
-
const { slot: _slot, ...
|
|
19181
|
-
return { ...
|
|
19784
|
+
const { slot: _slot, ...own3 } = l;
|
|
19785
|
+
return { ...own3, planLayer: i + 1 };
|
|
19182
19786
|
});
|
|
19183
19787
|
return { videoUrl: input.videoUrl, layers: [...planned, ...layers], ...rest };
|
|
19184
19788
|
}
|
|
@@ -19188,8 +19792,8 @@ function videoOverlaySlotSources(layers, wiredImageUrls) {
|
|
|
19188
19792
|
return Array.from({ length: Math.max(stored.length, wired.length) }, (_, i) => {
|
|
19189
19793
|
const w = wired[i];
|
|
19190
19794
|
if (typeof w === "string" && w.length > 0) return w;
|
|
19191
|
-
const
|
|
19192
|
-
return typeof
|
|
19795
|
+
const own3 = asLayer(stored[i])?.imageUrl;
|
|
19796
|
+
return typeof own3 === "string" && own3.length > 0 ? own3 : void 0;
|
|
19193
19797
|
});
|
|
19194
19798
|
}
|
|
19195
19799
|
function canonicalValue(v) {
|
|
@@ -19320,10 +19924,28 @@ var SCRAPER_HANDLE_EFFECTIVE_TYPE = {
|
|
|
19320
19924
|
video: "upload-video"
|
|
19321
19925
|
};
|
|
19322
19926
|
var SCRAPER_SOURCE_TYPES = /* @__PURE__ */ new Set(["meta-ads-scrape", "instagram-scrape"]);
|
|
19927
|
+
var OUTPUT_PIP_EFFECTIVE_TYPES = Object.freeze({
|
|
19928
|
+
// UGC Creator's `image`: the creator's first image, for any image input.
|
|
19929
|
+
"ugc-creator": Object.freeze({ image: "upload-image" }),
|
|
19930
|
+
// The UGC nodes' plain-text pips — the script's product category, the clips'
|
|
19931
|
+
// transcript, the cards' Notes — are one text each (`combine-text`: one
|
|
19932
|
+
// string, not a list): they reach text and prompt inputs, never a JSON input.
|
|
19933
|
+
"ugc-script": Object.freeze({ category: "combine-text" }),
|
|
19934
|
+
"ugc-clips": Object.freeze({ transcript: "combine-text" }),
|
|
19935
|
+
"ugc-cards": Object.freeze({ report: "combine-text" })
|
|
19936
|
+
});
|
|
19937
|
+
var own2 = (table, key) => Object.hasOwn(table, key) ? table[key] : void 0;
|
|
19938
|
+
function outputPipSourceType(rawSourceType, sourceHandleId) {
|
|
19939
|
+
const type = rawSourceType ?? "";
|
|
19940
|
+
const pips = own2(OUTPUT_PIP_EFFECTIVE_TYPES, type);
|
|
19941
|
+
return (pips && typeof sourceHandleId === "string" ? own2(pips, sourceHandleId) : void 0) ?? type;
|
|
19942
|
+
}
|
|
19323
19943
|
function resolveEffectiveSourceType(rawSourceType, sourceHandleId) {
|
|
19324
19944
|
if (sourceHandleId === "image" && ENTITY_IMAGE_HANDLE_TYPES.has(rawSourceType ?? "")) {
|
|
19325
19945
|
return "upload-image";
|
|
19326
19946
|
}
|
|
19947
|
+
const pipType = outputPipSourceType(rawSourceType, sourceHandleId);
|
|
19948
|
+
if (pipType !== (rawSourceType ?? "")) return pipType;
|
|
19327
19949
|
if (AGGREGATE_LANE_SOURCE_TYPES.has(rawSourceType ?? "")) {
|
|
19328
19950
|
const effective = AGGREGATE_LANE_EFFECTIVE_TYPE[sourceHandleId ?? ""];
|
|
19329
19951
|
if (effective) return effective;
|
|
@@ -22905,22 +23527,22 @@ function isKnownSpeakerEmphasisStyle(style) {
|
|
|
22905
23527
|
if (new Set(atoms).size !== atoms.length) return false;
|
|
22906
23528
|
return !(atoms.includes("none") && atoms.length > 1);
|
|
22907
23529
|
}
|
|
22908
|
-
var
|
|
23530
|
+
var isObject2 = (v) => !!v && typeof v === "object";
|
|
22909
23531
|
function speakerPresentationWarnings(edl) {
|
|
22910
23532
|
const warnings = [];
|
|
22911
|
-
if (!
|
|
23533
|
+
if (!isObject2(edl)) return warnings;
|
|
22912
23534
|
const safe = {
|
|
22913
23535
|
...edl,
|
|
22914
23536
|
sources: Array.isArray(edl.sources) ? edl.sources : [],
|
|
22915
23537
|
segments: Array.isArray(edl.segments) ? edl.segments : []
|
|
22916
23538
|
};
|
|
22917
|
-
const rawAspect =
|
|
23539
|
+
const rawAspect = isObject2(safe.meta) ? safe.meta.targetAspect : void 0;
|
|
22918
23540
|
const aspect = isEdlTargetAspect(rawAspect) ? rawAspect : void 0;
|
|
22919
23541
|
if (rawAspect != null && aspect === void 0) {
|
|
22920
23542
|
warnings.push(`meta.targetAspect "${String(rawAspect)}" is not a known target aspect (known: ${EDL_TARGET_ASPECTS.join(", ")})`);
|
|
22921
23543
|
}
|
|
22922
23544
|
safe.segments.forEach((seg, i) => {
|
|
22923
|
-
if (!
|
|
23545
|
+
if (!isObject2(seg) || !isObject2(seg.layout)) return;
|
|
22924
23546
|
const at = `segment[${i}] "${seg.id}"`;
|
|
22925
23547
|
const layout = seg.layout;
|
|
22926
23548
|
const sheet = typeof layout.mode === "string" ? getSpeakerLayout(layout.mode) : void 0;
|
|
@@ -22936,7 +23558,7 @@ function speakerPresentationWarnings(edl) {
|
|
|
22936
23558
|
warnings.push(`${at}: layout "${sheet.id}" is not drawn for targetAspect ${aspect} (drawn for: ${sheet.aspects.join(", ")})`);
|
|
22937
23559
|
}
|
|
22938
23560
|
}
|
|
22939
|
-
if (
|
|
23561
|
+
if (isObject2(layout.transition)) {
|
|
22940
23562
|
const type = layout.transition.type;
|
|
22941
23563
|
const sw = typeof type === "string" ? getSpeakerSwitch(type) : void 0;
|
|
22942
23564
|
if (!sw) {
|
|
@@ -22944,13 +23566,13 @@ function speakerPresentationWarnings(edl) {
|
|
|
22944
23566
|
} else if (sw.requiresSameSource && i > 0) {
|
|
22945
23567
|
const prev = safe.segments[i - 1];
|
|
22946
23568
|
const cur = resolveEdlSegmentSlots(safe, seg);
|
|
22947
|
-
const before =
|
|
23569
|
+
const before = isObject2(prev) ? resolveEdlSegmentSlots(safe, prev) : [];
|
|
22948
23570
|
if (cur.length === 1 && before.length === 1 && cur[0].source !== before[0].source) {
|
|
22949
23571
|
warnings.push(`${at}: switch "${sw.id}" moves within ONE picture source, but the previous segment shows "${before[0].source}" and this one "${cur[0].source}"`);
|
|
22950
23572
|
}
|
|
22951
23573
|
}
|
|
22952
23574
|
}
|
|
22953
|
-
if (
|
|
23575
|
+
if (isObject2(layout.emphasis) && !isKnownSpeakerEmphasisStyle(layout.emphasis.style)) {
|
|
22954
23576
|
const style = String(layout.emphasis.style);
|
|
22955
23577
|
const atoms = parseSpeakerEmphasisStyle(layout.emphasis.style);
|
|
22956
23578
|
warnings.push(atoms.length > 0 && atoms.every((a) => EMPHASIS_STYLE_SET.has(a)) ? `${at}: emphasis style "${style}" \u2014 "none" must stand alone and no style may repeat` : `${at}: unknown emphasis style "${style}" (a "+"-joined set of: ${SPEAKER_EMPHASIS_STYLES.join(", ")})`);
|
|
@@ -24108,8 +24730,8 @@ function savedRenderOutput(data) {
|
|
|
24108
24730
|
const selected = results[index] ?? results[0];
|
|
24109
24731
|
const selectedUrl = str5(selected?.url);
|
|
24110
24732
|
if (selectedUrl) return itemOf(selectedUrl, medium, selected);
|
|
24111
|
-
const
|
|
24112
|
-
if (
|
|
24733
|
+
const own3 = str5(data[MEDIUM_FIELD[medium]]);
|
|
24734
|
+
if (own3) return { url: own3, medium };
|
|
24113
24735
|
const other = medium === "video" ? "audio" : "video";
|
|
24114
24736
|
const otherUrl = str5(data[MEDIUM_FIELD[other]]);
|
|
24115
24737
|
return otherUrl ? { url: otherUrl, medium: other } : void 0;
|
|
@@ -24534,49 +25156,6 @@ function planFeedEmission(posts, since, limit, pageMaxId) {
|
|
|
24534
25156
|
return { emitted, latestId: pastUnreadable ? pageMaxId : since };
|
|
24535
25157
|
}
|
|
24536
25158
|
|
|
24537
|
-
// src/ugc-run-state.ts
|
|
24538
|
-
var UGC_NODE_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script", "ugc-clips", "ugc-clip", "ugc-cards"]);
|
|
24539
|
-
var UGC_NODE_RUN_STATE_KEYS = {
|
|
24540
|
-
"ugc-creator": ["result", "keepResult", "ugcOutputs"],
|
|
24541
|
-
"ugc-script": ["result", "keepResult", "ugcOutputs"],
|
|
24542
|
-
"ugc-clips": ["result", "quote", "__listResults", "ugcOutputs"],
|
|
24543
|
-
"ugc-clip": ["warnings", "rerender", "__listResults", "__listResultMeta", "clipWarnings", "durationSec", "ugcOutputs"],
|
|
24544
|
-
"ugc-cards": ["result", "ugcOutputs"]
|
|
24545
|
-
};
|
|
24546
|
-
var UGC_OVERRIDABLE_FIELDS = {
|
|
24547
|
-
"ugc-creator": ["source", "gender", "photoUrl"],
|
|
24548
|
-
"ugc-script": ["targetDurationSec"],
|
|
24549
|
-
"ugc-clips": [],
|
|
24550
|
-
"ugc-clip": [],
|
|
24551
|
-
"ugc-cards": []
|
|
24552
|
-
};
|
|
24553
|
-
var KEEP_RESULT_TYPES = /* @__PURE__ */ new Set(["ugc-creator", "ugc-script"]);
|
|
24554
|
-
function stripUgcRunState(nodes) {
|
|
24555
|
-
return nodes.map((node) => {
|
|
24556
|
-
const type = typeof node.type === "string" ? node.type : "";
|
|
24557
|
-
if (!UGC_NODE_TYPES.has(type) || !node.data || typeof node.data !== "object") return node;
|
|
24558
|
-
const data = { ...node.data };
|
|
24559
|
-
for (const key of UGC_NODE_RUN_STATE_KEYS[type] ?? []) delete data[key];
|
|
24560
|
-
if (KEEP_RESULT_TYPES.has(type)) data.keepResult = false;
|
|
24561
|
-
return { ...node, data };
|
|
24562
|
-
});
|
|
24563
|
-
}
|
|
24564
|
-
function findUgcLockedFields(nodes, inputOverrides) {
|
|
24565
|
-
if (!nodes || !inputOverrides) return [];
|
|
24566
|
-
const found = [];
|
|
24567
|
-
for (const node of nodes) {
|
|
24568
|
-
const type = node?.type;
|
|
24569
|
-
if (typeof type !== "string" || !UGC_NODE_TYPES.has(type)) continue;
|
|
24570
|
-
const allowed = UGC_OVERRIDABLE_FIELDS[type] ?? [];
|
|
24571
|
-
const fields = inputOverrides[node.id];
|
|
24572
|
-
if (!fields || typeof fields !== "object") continue;
|
|
24573
|
-
for (const field of Object.keys(fields)) {
|
|
24574
|
-
if (!allowed.includes(field)) found.push({ nodeId: String(node.id), nodeType: type, field });
|
|
24575
|
-
}
|
|
24576
|
-
}
|
|
24577
|
-
return found;
|
|
24578
|
-
}
|
|
24579
|
-
|
|
24580
25159
|
// src/ugc-call-body.ts
|
|
24581
25160
|
var pick = (a, from, to) => a[from] !== void 0 && a[from] !== null ? { [to]: a[from] } : {};
|
|
24582
25161
|
function llmFields(a) {
|
|
@@ -25060,6 +25639,9 @@ exports.NODE_DEFAULT_TYPES = NODE_DEFAULT_TYPES;
|
|
|
25060
25639
|
exports.NODE_MAPPABLE_FIELDS = NODE_MAPPABLE_FIELDS;
|
|
25061
25640
|
exports.NODE_PRESET_EXPORT_KIND = NODE_PRESET_EXPORT_KIND;
|
|
25062
25641
|
exports.NODE_REF_PATTERN = NODE_REF_PATTERN;
|
|
25642
|
+
exports.NODE_RUN_ROUTES = NODE_RUN_ROUTES;
|
|
25643
|
+
exports.NODE_TYPES_WITHOUT_RUN_ROUTE = NODE_TYPES_WITHOUT_RUN_ROUTE;
|
|
25644
|
+
exports.NODE_TYPE_EXECUTION_DATA_KEYS = NODE_TYPE_EXECUTION_DATA_KEYS;
|
|
25063
25645
|
exports.NON_EN_LOCALE_IDS = NON_EN_LOCALE_IDS;
|
|
25064
25646
|
exports.NON_PROMPT_TEXT_LANES = NON_PROMPT_TEXT_LANES;
|
|
25065
25647
|
exports.NO_SAVED_RENDER_STAMPS = NO_SAVED_RENDER_STAMPS;
|
|
@@ -25079,6 +25661,7 @@ exports.ORG_STATUSES = ORG_STATUSES;
|
|
|
25079
25661
|
exports.OUTPUT_BEARING_NODE_STATUSES = OUTPUT_BEARING_NODE_STATUSES;
|
|
25080
25662
|
exports.OUTPUT_FIELD_MAP = OUTPUT_FIELD_MAP;
|
|
25081
25663
|
exports.OUTPUT_FORMATS = OUTPUT_FORMATS;
|
|
25664
|
+
exports.OUTPUT_PIP_EFFECTIVE_TYPES = OUTPUT_PIP_EFFECTIVE_TYPES;
|
|
25082
25665
|
exports.OVERLAY_ANCHORS = OVERLAY_ANCHORS;
|
|
25083
25666
|
exports.OVERLAY_FONTS = OVERLAY_FONTS;
|
|
25084
25667
|
exports.OVERLAY_FONT_IDS = OVERLAY_FONT_IDS;
|
|
@@ -25271,6 +25854,12 @@ exports.SEEDANCE_2_PROVIDERS = SEEDANCE_2_PROVIDERS;
|
|
|
25271
25854
|
exports.SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER = SEEDANCE_2_R2V_MAX_AUDIO_SEC_BY_PROVIDER;
|
|
25272
25855
|
exports.SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC = SEEDANCE_2_R2V_MIN_REF_VIDEO_SEC;
|
|
25273
25856
|
exports.SEEDANCE_2_REF_LIMITS = SEEDANCE_2_REF_LIMITS;
|
|
25857
|
+
exports.SEEDANCE_DRAFT_FINALIZE_MAX_SEC = SEEDANCE_DRAFT_FINALIZE_MAX_SEC;
|
|
25858
|
+
exports.SEEDANCE_DRAFT_FINALIZE_MIN_SEC = SEEDANCE_DRAFT_FINALIZE_MIN_SEC;
|
|
25859
|
+
exports.SEEDANCE_DRAFT_FINALIZE_PROVIDER = SEEDANCE_DRAFT_FINALIZE_PROVIDER;
|
|
25860
|
+
exports.SEEDANCE_DRAFT_FINALIZE_RESOLUTION = SEEDANCE_DRAFT_FINALIZE_RESOLUTION;
|
|
25861
|
+
exports.SEEDANCE_DRAFT_MODELS = SEEDANCE_DRAFT_MODELS;
|
|
25862
|
+
exports.SEEDANCE_DRAFT_RESOLUTION = SEEDANCE_DRAFT_RESOLUTION;
|
|
25274
25863
|
exports.SEEDANCE_LIP_SYNC_PROVIDERS = SEEDANCE_LIP_SYNC_PROVIDERS;
|
|
25275
25864
|
exports.SEEDANCE_VIDEO_EDIT_PROVIDERS = SEEDANCE_VIDEO_EDIT_PROVIDERS;
|
|
25276
25865
|
exports.SEEDANCE_VIDEO_EDIT_SHAPE = SEEDANCE_VIDEO_EDIT_SHAPE;
|
|
@@ -25295,6 +25884,7 @@ exports.SMART_CUT_WINDOW_DEFAULT = SMART_CUT_WINDOW_DEFAULT;
|
|
|
25295
25884
|
exports.SMART_CUT_WINDOW_MAX = SMART_CUT_WINDOW_MAX;
|
|
25296
25885
|
exports.SMART_CUT_WINDOW_MIN = SMART_CUT_WINDOW_MIN;
|
|
25297
25886
|
exports.SOCIAL_PLATFORMS = SOCIAL_PLATFORMS;
|
|
25887
|
+
exports.SOCIAL_POST_NODE_PLATFORM = SOCIAL_POST_NODE_PLATFORM;
|
|
25298
25888
|
exports.SOCIAL_POST_NODE_TYPES = SOCIAL_POST_NODE_TYPES;
|
|
25299
25889
|
exports.SOCIAL_POST_READER_NODE_TYPES = SOCIAL_POST_READER_NODE_TYPES;
|
|
25300
25890
|
exports.SOCIAL_POST_VIDEO_LINK_MARGIN_MS = SOCIAL_POST_VIDEO_LINK_MARGIN_MS;
|
|
@@ -25420,9 +26010,25 @@ exports.TTS_PROVIDER_ALIASES = TTS_PROVIDER_ALIASES;
|
|
|
25420
26010
|
exports.TTS_TEXT_MAX = TTS_TEXT_MAX;
|
|
25421
26011
|
exports.TWO_K_RESOLUTION_PROVIDERS = TWO_K_RESOLUTION_PROVIDERS;
|
|
25422
26012
|
exports.TransitionTypeSchema = TransitionTypeSchema;
|
|
26013
|
+
exports.UGC_CREATOR_CANDIDATES_KEY = UGC_CREATOR_CANDIDATES_KEY;
|
|
26014
|
+
exports.UGC_CREATOR_MISSING_MESSAGE = UGC_CREATOR_MISSING_MESSAGE;
|
|
26015
|
+
exports.UGC_CREATOR_PICKER_TYPES = UGC_CREATOR_PICKER_TYPES;
|
|
26016
|
+
exports.UGC_NEWER_APP_MESSAGE = UGC_NEWER_APP_MESSAGE;
|
|
26017
|
+
exports.UGC_NODE_MESSAGES = UGC_NODE_MESSAGES;
|
|
25423
26018
|
exports.UGC_NODE_RUN_STATE_KEYS = UGC_NODE_RUN_STATE_KEYS;
|
|
25424
26019
|
exports.UGC_NODE_TYPES = UGC_NODE_TYPES;
|
|
26020
|
+
exports.UGC_NOT_SERVED_MESSAGE = UGC_NOT_SERVED_MESSAGE;
|
|
25425
26021
|
exports.UGC_OVERRIDABLE_FIELDS = UGC_OVERRIDABLE_FIELDS;
|
|
26022
|
+
exports.UGC_PICK_FIRST_MESSAGE = UGC_PICK_FIRST_MESSAGE;
|
|
26023
|
+
exports.UGC_PICK_GONE_MESSAGE = UGC_PICK_GONE_MESSAGE;
|
|
26024
|
+
exports.UGC_PRIMARY_HANDLE = UGC_PRIMARY_HANDLE;
|
|
26025
|
+
exports.UGC_PUBLISH_PRIVATE_FIELDS = UGC_PUBLISH_PRIVATE_FIELDS;
|
|
26026
|
+
exports.UGC_SCREENSHOT_HANDLES = UGC_SCREENSHOT_HANDLES;
|
|
26027
|
+
exports.UGC_SCRIPT_DEFAULT_TARGET_SEC = UGC_SCRIPT_DEFAULT_TARGET_SEC;
|
|
26028
|
+
exports.UGC_SCRIPT_MAX_TARGET_SEC = UGC_SCRIPT_MAX_TARGET_SEC;
|
|
26029
|
+
exports.UGC_SCRIPT_MIN_TARGET_SEC = UGC_SCRIPT_MIN_TARGET_SEC;
|
|
26030
|
+
exports.UGC_SCRIPT_NEEDS_CHANGES = UGC_SCRIPT_NEEDS_CHANGES;
|
|
26031
|
+
exports.UGC_VERSION_MESSAGE = UGC_VERSION_MESSAGE;
|
|
25426
26032
|
exports.UPSCALE_IMAGE_PROVIDERS = UPSCALE_IMAGE_PROVIDERS;
|
|
25427
26033
|
exports.USAGE_GROUP_BYS = USAGE_GROUP_BYS;
|
|
25428
26034
|
exports.USAGE_MODES = USAGE_MODES;
|
|
@@ -25738,6 +26344,7 @@ exports.evaluateCondition = evaluateCondition;
|
|
|
25738
26344
|
exports.evaluateConditionGroup = evaluateConditionGroup;
|
|
25739
26345
|
exports.evaluateJsonExpression = evaluateJsonExpression;
|
|
25740
26346
|
exports.evaluateJsonPath = evaluateJsonPath;
|
|
26347
|
+
exports.executionDataKeysOf = executionDataKeysOf;
|
|
25741
26348
|
exports.executionOutcome = executionOutcome;
|
|
25742
26349
|
exports.expandExtraRefsToConnectedReferences = expandExtraRefsToConnectedReferences;
|
|
25743
26350
|
exports.expandItemsWithRepeat = expandItemsWithRepeat;
|
|
@@ -25862,6 +26469,7 @@ exports.isCronExpression = isCronExpression;
|
|
|
25862
26469
|
exports.isDefaultSelectorConfig = isDefaultSelectorConfig;
|
|
25863
26470
|
exports.isDirectVideoFileUrl = isDirectVideoFileUrl;
|
|
25864
26471
|
exports.isEdlTargetAspect = isEdlTargetAspect;
|
|
26472
|
+
exports.isExecutionDataKey = isExecutionDataKey;
|
|
25865
26473
|
exports.isExpandedClone = isExpandedClone;
|
|
25866
26474
|
exports.isFacebookPageUrl = isFacebookPageUrl;
|
|
25867
26475
|
exports.isFanInEdge = isFanInEdge;
|
|
@@ -25909,6 +26517,7 @@ exports.isScene3DReviewUnavailableReason = isScene3DReviewUnavailableReason;
|
|
|
25909
26517
|
exports.isScene3DSchemaVersionSupported = isScene3DSchemaVersionSupported;
|
|
25910
26518
|
exports.isScraperActor = isScraperActor;
|
|
25911
26519
|
exports.isSeedance2Provider = isSeedance2Provider;
|
|
26520
|
+
exports.isSeedanceDraftCapable = isSeedanceDraftCapable;
|
|
25912
26521
|
exports.isSeedanceVideoEditProvider = isSeedanceVideoEditProvider;
|
|
25913
26522
|
exports.isSettingsHintEdge = isSettingsHintEdge;
|
|
25914
26523
|
exports.isSettingsHintSource = isSettingsHintSource;
|
|
@@ -25983,6 +26592,7 @@ exports.migrateToItems = migrateToItems;
|
|
|
25983
26592
|
exports.minSegmentSecFor = minSegmentSecFor;
|
|
25984
26593
|
exports.minimalRatioDimensions = minimalRatioDimensions;
|
|
25985
26594
|
exports.modelIdsByKindMode = modelIdsByKindMode;
|
|
26595
|
+
exports.modelTakesSeed = modelTakesSeed;
|
|
25986
26596
|
exports.modelToNodeTarget = modelToNodeTarget;
|
|
25987
26597
|
exports.modelsForInputMode = modelsForInputMode;
|
|
25988
26598
|
exports.modelsWithFeature = modelsWithFeature;
|
|
@@ -25991,6 +26601,7 @@ exports.nearestCatalogAspectRatio = nearestCatalogAspectRatio;
|
|
|
25991
26601
|
exports.newScene3DRevisionId = newScene3DRevisionId;
|
|
25992
26602
|
exports.nextScheduleRuns = nextScheduleRuns;
|
|
25993
26603
|
exports.nodeFeedsAnything = nodeFeedsAnything;
|
|
26604
|
+
exports.nodeRunRoute = nodeRunRoute;
|
|
25994
26605
|
exports.nodeStateMayCarryOutput = nodeStateMayCarryOutput;
|
|
25995
26606
|
exports.nonBlankCaptionText = nonBlankCaptionText;
|
|
25996
26607
|
exports.normalizeCaptionNumericLevers = normalizeCaptionNumericLevers;
|
|
@@ -26018,6 +26629,7 @@ exports.normalizeWan3Resolution = normalizeWan3Resolution;
|
|
|
26018
26629
|
exports.normalizedImageGenModelId = normalizedImageGenModelId;
|
|
26019
26630
|
exports.orderedLlmModels = orderedLlmModels;
|
|
26020
26631
|
exports.outputMsToMasterMs = outputMsToMasterMs;
|
|
26632
|
+
exports.outputPipSourceType = outputPipSourceType;
|
|
26021
26633
|
exports.overlayFontById = overlayFontById;
|
|
26022
26634
|
exports.overlayImageEffectsSchema = overlayImageEffectsSchema;
|
|
26023
26635
|
exports.overlayPlatformById = overlayPlatformById;
|
|
@@ -26086,6 +26698,7 @@ exports.pro3DRenderTimingOverrides = pro3DRenderTimingOverrides;
|
|
|
26086
26698
|
exports.qualityOptionsByKind = qualityOptionsByKind;
|
|
26087
26699
|
exports.readPromptAffixes = readPromptAffixes;
|
|
26088
26700
|
exports.readScriptSettings = readScriptSettings;
|
|
26701
|
+
exports.readUgcWire = readUgcWire;
|
|
26089
26702
|
exports.reasoningOutputFloor = reasoningOutputFloor;
|
|
26090
26703
|
exports.refHandleCategory = refHandleCategory;
|
|
26091
26704
|
exports.referenceModalityForHandle = referenceModalityForHandle;
|
|
@@ -26272,6 +26885,8 @@ exports.scheduleMatchesAt = scheduleMatchesAt;
|
|
|
26272
26885
|
exports.scheduleOccurrences = scheduleOccurrences;
|
|
26273
26886
|
exports.searchModelVariants = searchModelVariants;
|
|
26274
26887
|
exports.seedance2AudioLimitSec = seedance2AudioLimitSec;
|
|
26888
|
+
exports.seedanceDraftFinalizeBillableSec = seedanceDraftFinalizeBillableSec;
|
|
26889
|
+
exports.seedanceDraftFinalizeCreditId = seedanceDraftFinalizeCreditId;
|
|
26275
26890
|
exports.seedanceVideoEditCreditId = seedanceVideoEditCreditId;
|
|
26276
26891
|
exports.segmentDurationsFor = segmentDurationsFor;
|
|
26277
26892
|
exports.selectByModulo = selectByModulo;
|
|
@@ -26375,7 +26990,32 @@ exports.ttsSupportsAudioTags = ttsSupportsAudioTags;
|
|
|
26375
26990
|
exports.ttsSupportsSsmlBreaks = ttsSupportsSsmlBreaks;
|
|
26376
26991
|
exports.ttsSupportsStitching = ttsSupportsStitching;
|
|
26377
26992
|
exports.ttsSupportsTimestamps = ttsSupportsTimestamps;
|
|
26993
|
+
exports.ugcAwaitsPick = ugcAwaitsPick;
|
|
26378
26994
|
exports.ugcCallToRouteBody = ugcCallToRouteBody;
|
|
26995
|
+
exports.ugcCardsBody = ugcCardsBody;
|
|
26996
|
+
exports.ugcCardsJobs = ugcCardsJobs;
|
|
26997
|
+
exports.ugcCardsOutputs = ugcCardsOutputs;
|
|
26998
|
+
exports.ugcClipBody = ugcClipBody;
|
|
26999
|
+
exports.ugcClipOutputs = ugcClipOutputs;
|
|
27000
|
+
exports.ugcClipSavedList = ugcClipSavedList;
|
|
27001
|
+
exports.ugcClipsBody = ugcClipsBody;
|
|
27002
|
+
exports.ugcClipsOutputs = ugcClipsOutputs;
|
|
27003
|
+
exports.ugcCreatorBody = ugcCreatorBody;
|
|
27004
|
+
exports.ugcCreatorCallsToRender = ugcCreatorCallsToRender;
|
|
27005
|
+
exports.ugcCreatorCandidate = ugcCreatorCandidate;
|
|
27006
|
+
exports.ugcCreatorCandidates = ugcCreatorCandidates;
|
|
27007
|
+
exports.ugcCreatorOutputs = ugcCreatorOutputs;
|
|
27008
|
+
exports.ugcCreatorPick = ugcCreatorPick;
|
|
27009
|
+
exports.ugcFailure = ugcFailure;
|
|
27010
|
+
exports.ugcKeptOutputs = ugcKeptOutputs;
|
|
27011
|
+
exports.ugcPickPending = ugcPickPending;
|
|
27012
|
+
exports.ugcPipValue = ugcPipValue;
|
|
27013
|
+
exports.ugcPlanLengthSec = ugcPlanLengthSec;
|
|
27014
|
+
exports.ugcPlanScreenshotCount = ugcPlanScreenshotCount;
|
|
27015
|
+
exports.ugcRunWaitsForPick = ugcRunWaitsForPick;
|
|
27016
|
+
exports.ugcScriptBody = ugcScriptBody;
|
|
27017
|
+
exports.ugcScriptOutputs = ugcScriptOutputs;
|
|
27018
|
+
exports.ugcScriptResult = ugcScriptResult;
|
|
26379
27019
|
exports.uiAspectRatioFill = uiAspectRatioFill;
|
|
26380
27020
|
exports.uiDurationFill = uiDurationFill;
|
|
26381
27021
|
exports.uiResolutionFill = uiResolutionFill;
|