@nodaro/shared 3.62.0 → 3.64.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/{chunk-C7POAYFE.js → chunk-36VWLB4J.js} +3 -3
- package/dist/{chunk-C7POAYFE.js.map → chunk-36VWLB4J.js.map} +1 -1
- package/dist/{chunk-S24ZBUB4.js → chunk-3AYM47GW.js} +6 -32
- package/dist/chunk-3AYM47GW.js.map +1 -0
- package/dist/{chunk-YCXRSWCQ.js → chunk-3KTWYYCN.js} +8 -5
- package/dist/chunk-3KTWYYCN.js.map +1 -0
- package/dist/{chunk-ZES6EZC4.js → chunk-4IUE2JB7.js} +3 -3
- package/dist/{chunk-ZES6EZC4.js.map → chunk-4IUE2JB7.js.map} +1 -1
- package/dist/{chunk-MYJQELFN.cjs → chunk-5OBTGNUQ.cjs} +547 -29
- package/dist/chunk-5OBTGNUQ.cjs.map +1 -0
- package/dist/{chunk-TWF2OSH4.cjs → chunk-67CMMTLN.cjs} +4 -4
- package/dist/{chunk-TWF2OSH4.cjs.map → chunk-67CMMTLN.cjs.map} +1 -1
- package/dist/{chunk-WRSWH7US.cjs → chunk-6BRWPJPP.cjs} +17 -2
- package/dist/chunk-6BRWPJPP.cjs.map +1 -0
- package/dist/{chunk-S5TMRJMX.js → chunk-6YIV37V7.js} +4 -4
- package/dist/{chunk-S5TMRJMX.js.map → chunk-6YIV37V7.js.map} +1 -1
- package/dist/{chunk-3M4BNKFJ.cjs → chunk-7AJGUI7L.cjs} +202 -16
- package/dist/chunk-7AJGUI7L.cjs.map +1 -0
- package/dist/{chunk-JZGZ26YB.js → chunk-7KQ6W5DS.js} +4 -4
- package/dist/{chunk-JZGZ26YB.js.map → chunk-7KQ6W5DS.js.map} +1 -1
- package/dist/{chunk-IWWVPR3W.cjs → chunk-ACZZHHFZ.cjs} +149 -34
- package/dist/chunk-ACZZHHFZ.cjs.map +1 -0
- package/dist/{chunk-2W745U4A.cjs → chunk-AZNZ5WNZ.cjs} +42 -70
- package/dist/chunk-AZNZ5WNZ.cjs.map +1 -0
- package/dist/{chunk-HSHCCBIV.js → chunk-BQYCZLMF.js} +16 -3
- package/dist/chunk-BQYCZLMF.js.map +1 -0
- package/dist/chunk-CHS2SIP6.cjs +504 -0
- package/dist/chunk-CHS2SIP6.cjs.map +1 -0
- package/dist/{chunk-CIPPPT7E.cjs → chunk-CHTZZRAL.cjs} +6 -6
- package/dist/{chunk-CIPPPT7E.cjs.map → chunk-CHTZZRAL.cjs.map} +1 -1
- package/dist/{chunk-AOJ6B7K4.cjs → chunk-D4KWNDPH.cjs} +12 -12
- package/dist/chunk-D4KWNDPH.cjs.map +1 -0
- package/dist/{chunk-5YYN5X57.js → chunk-DZ4IOP3Q.js} +536 -30
- package/dist/chunk-DZ4IOP3Q.js.map +1 -0
- package/dist/{chunk-VACPZPUA.cjs → chunk-EXEVT6D2.cjs} +15 -5
- package/dist/chunk-EXEVT6D2.cjs.map +1 -0
- package/dist/{chunk-5M43XMRB.cjs → chunk-FHGRKQVZ.cjs} +8 -8
- package/dist/{chunk-5M43XMRB.cjs.map → chunk-FHGRKQVZ.cjs.map} +1 -1
- package/dist/{chunk-KJSRPHJ2.cjs → chunk-GTWUS6MQ.cjs} +165 -54
- package/dist/chunk-GTWUS6MQ.cjs.map +1 -0
- package/dist/{chunk-Q6IES3U2.js → chunk-H5KHWTAE.js} +5 -2
- package/dist/chunk-H5KHWTAE.js.map +1 -0
- package/dist/{chunk-G3KVK7OU.cjs → chunk-HDPJNNMF.cjs} +21 -21
- package/dist/{chunk-G3KVK7OU.cjs.map → chunk-HDPJNNMF.cjs.map} +1 -1
- package/dist/{chunk-3OYO3XCC.js → chunk-IYSOVS7O.js} +118 -24
- package/dist/chunk-IYSOVS7O.js.map +1 -0
- package/dist/{chunk-AFYTX4AI.cjs → chunk-J6B7J73J.cjs} +110 -50
- package/dist/chunk-J6B7J73J.cjs.map +1 -0
- package/dist/{chunk-I2RQB7VG.js → chunk-KB2SQAR3.js} +3 -3
- package/dist/{chunk-I2RQB7VG.js.map → chunk-KB2SQAR3.js.map} +1 -1
- package/dist/{chunk-BLJUCPMV.cjs → chunk-KSHAAPQF.cjs} +5 -2
- package/dist/chunk-KSHAAPQF.cjs.map +1 -0
- package/dist/{chunk-6G7NN4S4.js → chunk-NIAFR5EE.js} +2 -2
- package/dist/chunk-NIAFR5EE.js.map +1 -0
- package/dist/{chunk-CF4S4N5X.js → chunk-O2QOBA6Q.js} +2 -2
- package/dist/{chunk-CF4S4N5X.js.map → chunk-O2QOBA6Q.js.map} +1 -1
- package/dist/{chunk-IDTKF5EX.cjs → chunk-O4RPXBDZ.cjs} +12 -8
- package/dist/chunk-O4RPXBDZ.cjs.map +1 -0
- package/dist/{chunk-4GGLKRYI.cjs → chunk-O6TBB4IF.cjs} +2 -2
- package/dist/{chunk-4GGLKRYI.cjs.map → chunk-O6TBB4IF.cjs.map} +1 -1
- package/dist/{chunk-PTD6EDUU.js → chunk-OBOOHG3N.js} +13 -4
- package/dist/chunk-OBOOHG3N.js.map +1 -0
- package/dist/{chunk-2D5LQFV4.cjs → chunk-OOZW2MM6.cjs} +9 -9
- package/dist/{chunk-2D5LQFV4.cjs.map → chunk-OOZW2MM6.cjs.map} +1 -1
- package/dist/{chunk-A2PX5IRC.cjs → chunk-PERUFUVH.cjs} +13 -13
- package/dist/{chunk-A2PX5IRC.cjs.map → chunk-PERUFUVH.cjs.map} +1 -1
- package/dist/{chunk-G4U3HW6W.js → chunk-PJJAZQVZ.js} +3 -3
- package/dist/{chunk-G4U3HW6W.js.map → chunk-PJJAZQVZ.js.map} +1 -1
- package/dist/{chunk-E2HZTGYX.js → chunk-Q2Y4JHF7.js} +7 -7
- package/dist/chunk-Q2Y4JHF7.js.map +1 -0
- package/dist/{chunk-FVII3KHN.js → chunk-QYU7J5EQ.js} +198 -17
- package/dist/chunk-QYU7J5EQ.js.map +1 -0
- package/dist/{chunk-JJNNM23P.js → chunk-S3UGLZSF.js} +3 -3
- package/dist/{chunk-JJNNM23P.js.map → chunk-S3UGLZSF.js.map} +1 -1
- package/dist/{chunk-CC4V2B7S.js → chunk-SHH2T4CR.js} +3 -3
- package/dist/{chunk-CC4V2B7S.js.map → chunk-SHH2T4CR.js.map} +1 -1
- package/dist/{chunk-4ZEFP2FQ.cjs → chunk-SPAHI7DY.cjs} +4 -4
- package/dist/{chunk-4ZEFP2FQ.cjs.map → chunk-SPAHI7DY.cjs.map} +1 -1
- package/dist/{chunk-Y6X7UJSD.js → chunk-SXHHLZ22.js} +122 -15
- package/dist/chunk-SXHHLZ22.js.map +1 -0
- package/dist/{chunk-HRY7KGAE.cjs → chunk-T2OVDF2M.cjs} +6 -6
- package/dist/{chunk-HRY7KGAE.cjs.map → chunk-T2OVDF2M.cjs.map} +1 -1
- package/dist/{chunk-2QKF7M2Z.js → chunk-TAPBDT47.js} +3 -3
- package/dist/{chunk-2QKF7M2Z.js.map → chunk-TAPBDT47.js.map} +1 -1
- package/dist/{chunk-NGKKNSK6.js → chunk-TPQJKS7D.js} +139 -16
- package/dist/chunk-TPQJKS7D.js.map +1 -0
- package/dist/{chunk-N7OUQK7E.cjs → chunk-TQW3R44P.cjs} +8 -8
- package/dist/{chunk-N7OUQK7E.cjs.map → chunk-TQW3R44P.cjs.map} +1 -1
- package/dist/{chunk-GSFB537T.js → chunk-TTGZ2L3O.js} +23 -4
- package/dist/chunk-TTGZ2L3O.js.map +1 -0
- package/dist/{chunk-SYWR5G3T.js → chunk-VPTA4Z7G.js} +54 -7
- package/dist/chunk-VPTA4Z7G.js.map +1 -0
- package/dist/{chunk-2HZGDZZN.cjs → chunk-VZ6TE23U.cjs} +6 -6
- package/dist/{chunk-2HZGDZZN.cjs.map → chunk-VZ6TE23U.cjs.map} +1 -1
- package/dist/{chunk-TRVWMKNE.cjs → chunk-W6VJAUGM.cjs} +285 -64
- package/dist/chunk-W6VJAUGM.cjs.map +1 -0
- package/dist/{chunk-UDDVDQMF.js → chunk-W7KHHNZR.js} +235 -37
- package/dist/chunk-W7KHHNZR.js.map +1 -0
- package/dist/{chunk-KYMHFVAZ.cjs → chunk-Y4GCJJPF.cjs} +2 -2
- package/dist/chunk-Y4GCJJPF.cjs.map +1 -0
- package/dist/{chunk-6CSXMWL4.cjs → chunk-YQV53HRR.cjs} +27 -4
- package/dist/chunk-YQV53HRR.cjs.map +1 -0
- package/dist/{chunk-7FCTCWHD.js → chunk-ZI3QDUHO.js} +3 -3
- package/dist/{chunk-7FCTCWHD.js.map → chunk-ZI3QDUHO.js.map} +1 -1
- package/dist/entries/apps.cjs +43 -42
- package/dist/entries/apps.js +8 -7
- package/dist/entries/captions.cjs +38 -30
- package/dist/entries/captions.d.cts +47 -1
- package/dist/entries/captions.d.ts +47 -1
- package/dist/entries/captions.js +1 -1
- package/dist/entries/credits.cjs +354 -174
- package/dist/entries/credits.d.cts +378 -27
- package/dist/entries/credits.d.ts +378 -27
- package/dist/entries/credits.js +11 -11
- package/dist/entries/llm-models.cjs +77 -57
- package/dist/entries/llm-models.d.cts +108 -7
- package/dist/entries/llm-models.d.ts +108 -7
- package/dist/entries/llm-models.js +2 -2
- package/dist/entries/media.cjs +63 -63
- package/dist/entries/media.d.cts +8 -0
- package/dist/entries/media.d.ts +8 -0
- package/dist/entries/media.js +1 -1
- package/dist/entries/model-catalog.cjs +161 -105
- package/dist/entries/model-catalog.d.cts +109 -22
- package/dist/entries/model-catalog.d.ts +109 -22
- package/dist/entries/model-catalog.js +4 -4
- package/dist/entries/models.cjs +466 -322
- package/dist/entries/models.d.cts +71 -5
- package/dist/entries/models.d.ts +71 -5
- package/dist/entries/models.js +5 -5
- package/dist/entries/nodes.cjs +226 -209
- package/dist/entries/nodes.d.cts +66 -7
- package/dist/entries/nodes.d.ts +66 -7
- package/dist/entries/nodes.js +10 -9
- package/dist/entries/pipeline.cjs +156 -152
- package/dist/entries/pipeline.d.cts +14 -4
- package/dist/entries/pipeline.d.ts +14 -4
- package/dist/entries/pipeline.js +3 -3
- package/dist/entries/runtime-config.cjs +29 -29
- package/dist/entries/runtime-config.d.cts +10 -7
- package/dist/entries/runtime-config.d.ts +10 -7
- package/dist/entries/runtime-config.js +1 -1
- package/dist/entries/social.cjs +177 -177
- package/dist/entries/social.js +2 -2
- package/dist/entries/types.d.cts +8 -0
- package/dist/entries/types.d.ts +8 -0
- package/dist/entries/ugc.cjs +71 -71
- package/dist/entries/ugc.js +4 -4
- package/dist/entries/video.cjs +154 -150
- package/dist/entries/video.d.cts +11 -2
- package/dist/entries/video.d.ts +11 -2
- package/dist/entries/video.js +6 -6
- package/dist/entries/workflow.cjs +150 -150
- package/dist/entries/workflow.d.cts +1 -1
- package/dist/entries/workflow.d.ts +1 -1
- package/dist/entries/workflow.js +2 -2
- package/dist/index.cjs +2136 -1704
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +27 -27
- package/dist/{model-catalog-CCEcv08q.d.ts → model-catalog-Cf9fkEUp.d.cts} +45 -2
- package/dist/{model-catalog-CCEcv08q.d.cts → model-catalog-Cf9fkEUp.d.ts} +45 -2
- package/dist/{model-constants-B88p6XR0.d.ts → model-constants-BxjiWVQ9.d.ts} +215 -32
- package/dist/{model-constants-Cf3zaITt.d.cts → model-constants-C_Nyft_i.d.cts} +215 -32
- package/package.json +1 -1
- package/src/__tests__/add-captions-nemotron-pricing.test.ts +111 -0
- package/src/__tests__/credit-identifiers.test.ts +29 -0
- package/src/__tests__/extend-providers.test.ts +359 -39
- package/src/__tests__/fixtures/mask-composite-quote-parity.json +1 -1
- package/src/__tests__/fixtures/measured-input-quote-parity.json +1435 -0
- package/src/__tests__/fixtures/planned-length-quote-parity.json +1866 -0
- package/src/__tests__/fixtures/video-utility-quote-parity.json +2343 -0
- package/src/__tests__/flux-3-klein.test.ts +203 -0
- package/src/__tests__/gpt-image-2-6-formats.test.ts +3 -1
- package/src/__tests__/gvp-supported-providers.test.ts +27 -2
- package/src/__tests__/lip-sync-audio-rate.test.ts +74 -0
- package/src/__tests__/lip-sync-levers.test.ts +31 -0
- package/src/__tests__/llm-models.test.ts +139 -12
- package/src/__tests__/llm-price-key.test.ts +164 -1
- package/src/__tests__/model-makers.test.ts +3 -0
- package/src/__tests__/nemotron-transcribe-pricing.test.ts +61 -0
- package/src/__tests__/node-runtime-keys.test.ts +7 -0
- package/src/__tests__/normalize-node-params.test.ts +172 -1
- package/src/__tests__/pixverse-v6-max-catalog.test.ts +271 -0
- package/src/__tests__/prompt-length-limits.test.ts +4 -0
- package/src/__tests__/retired-lip-sync-providers.test.ts +43 -0
- package/src/__tests__/seedance-extend-source-credit-id.test.ts +89 -0
- package/src/__tests__/seedance-task-type.test.ts +13 -3
- package/src/__tests__/sequence-execution.test.ts +22 -1
- package/src/__tests__/suno-credit-type.test.ts +21 -2
- package/src/__tests__/transcribe-capabilities.test.ts +41 -2
- package/src/__tests__/transcribe-preflight.test.ts +50 -1
- package/src/__tests__/video-analysis-catalog-sync.test.ts +4 -2
- package/src/__tests__/video-analysis-pricing.test.ts +10 -9
- package/src/__tests__/video-audio-capability.test.ts +35 -6
- package/src/__tests__/video-resolution-billed-as-named.test.ts +30 -0
- package/src/__tests__/video-upscale-params.test.ts +62 -0
- package/src/caption-styles.ts +62 -0
- package/src/catalog-projection.ts +8 -0
- package/src/credit-estimators/add-captions-nemotron.ts +73 -0
- package/src/credit-estimators/index.ts +20 -0
- package/src/credit-estimators/nemotron-transcribe.ts +87 -0
- package/src/credit-identifiers.ts +351 -41
- package/src/entries/captions.ts +2 -0
- package/src/entries/credits.ts +37 -2
- package/src/entries/llm-models.ts +6 -0
- package/src/entries/model-catalog.ts +22 -0
- package/src/entries/models.ts +50 -0
- package/src/entries/nodes.ts +4 -0
- package/src/entries/pipeline.ts +1 -1
- package/src/entries/video.ts +1 -1
- package/src/flux-3-klein.ts +69 -0
- package/src/freecut-protocol.ts +8 -0
- package/src/input-image-pricing.ts +23 -6
- package/src/lip-sync-levers.ts +56 -0
- package/src/lip-sync-pricing.ts +91 -1
- package/src/llm-models.ts +305 -16
- package/src/model-catalog.ts +529 -28
- package/src/model-constants.ts +417 -41
- package/src/model-tree.ts +2 -1
- package/src/nodaro-video-upscale.ts +48 -0
- package/src/node-default-mappings.ts +6 -0
- package/src/node-runtime-keys.ts +3 -0
- package/src/normalize-node-params.ts +172 -3
- package/src/runtime-config/contract.ts +10 -7
- package/src/seedance-draft.ts +2 -1
- package/src/seedance-extend-rate.ts +116 -0
- package/src/sequence-execution.ts +24 -0
- package/src/transcribe-preflight.ts +81 -7
- package/src/video-analysis-pricing.ts +28 -15
- package/src/video-duration.ts +9 -0
- package/src/video-ui-defaults.ts +5 -3
- package/src/video-upscale-params.ts +67 -0
- package/dist/chunk-2W745U4A.cjs.map +0 -1
- package/dist/chunk-3M4BNKFJ.cjs.map +0 -1
- package/dist/chunk-3OYO3XCC.js.map +0 -1
- package/dist/chunk-5YYN5X57.js.map +0 -1
- package/dist/chunk-6CSXMWL4.cjs.map +0 -1
- package/dist/chunk-6G7NN4S4.js.map +0 -1
- package/dist/chunk-AFYTX4AI.cjs.map +0 -1
- package/dist/chunk-AOJ6B7K4.cjs.map +0 -1
- package/dist/chunk-BLJUCPMV.cjs.map +0 -1
- package/dist/chunk-E2HZTGYX.js.map +0 -1
- package/dist/chunk-FVII3KHN.js.map +0 -1
- package/dist/chunk-GSFB537T.js.map +0 -1
- package/dist/chunk-HSHCCBIV.js.map +0 -1
- package/dist/chunk-IDTKF5EX.cjs.map +0 -1
- package/dist/chunk-IWWVPR3W.cjs.map +0 -1
- package/dist/chunk-KJSRPHJ2.cjs.map +0 -1
- package/dist/chunk-KYMHFVAZ.cjs.map +0 -1
- package/dist/chunk-MYJQELFN.cjs.map +0 -1
- package/dist/chunk-NGKKNSK6.js.map +0 -1
- package/dist/chunk-PTD6EDUU.js.map +0 -1
- package/dist/chunk-Q6IES3U2.js.map +0 -1
- package/dist/chunk-QWYFHQYK.cjs +0 -357
- package/dist/chunk-QWYFHQYK.cjs.map +0 -1
- package/dist/chunk-S24ZBUB4.js.map +0 -1
- package/dist/chunk-SYWR5G3T.js.map +0 -1
- package/dist/chunk-TRVWMKNE.cjs.map +0 -1
- package/dist/chunk-UDDVDQMF.js.map +0 -1
- package/dist/chunk-VACPZPUA.cjs.map +0 -1
- package/dist/chunk-WRSWH7US.cjs.map +0 -1
- package/dist/chunk-Y6X7UJSD.js.map +0 -1
- package/dist/chunk-YCXRSWCQ.js.map +0 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk44I73CQS_cjs = require('./chunk-44I73CQS.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
4
|
+
var chunkT2OVDF2M_cjs = require('./chunk-T2OVDF2M.cjs');
|
|
5
|
+
var chunkW6VJAUGM_cjs = require('./chunk-W6VJAUGM.cjs');
|
|
6
|
+
var chunk5OBTGNUQ_cjs = require('./chunk-5OBTGNUQ.cjs');
|
|
7
7
|
var zod = require('zod');
|
|
8
8
|
|
|
9
9
|
// src/video-character-refs.ts
|
|
10
10
|
var VIDEO_CHARACTER_REFS_WIRE_MAX = Math.max(
|
|
11
11
|
0,
|
|
12
|
-
...Object.values(
|
|
12
|
+
...Object.values(chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER).map((l) => l?.characters ?? 0)
|
|
13
13
|
);
|
|
14
14
|
var VIDEO_CHARACTER_EXTRA_IMAGES_MAX = 3;
|
|
15
15
|
var VIDEO_CHARACTER_DESCRIPTION_MAX = 2e3;
|
|
@@ -17,10 +17,10 @@ var VIDEO_CHARACTER_NAME_MAX = 100;
|
|
|
17
17
|
var VIDEO_CHARACTER_VOICE_DESCRIPTION_MAX = 2e3;
|
|
18
18
|
var VIDEO_CHARACTER_VOICE_EXAMPLE_MAX = 120;
|
|
19
19
|
function videoCharacterRefCap(provider) {
|
|
20
|
-
return provider ?
|
|
20
|
+
return provider ? chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.characters ?? 0 : 0;
|
|
21
21
|
}
|
|
22
22
|
function videoCharacterVoiceCap(provider) {
|
|
23
|
-
return provider ?
|
|
23
|
+
return provider ? chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.voices ?? 0 : 0;
|
|
24
24
|
}
|
|
25
25
|
function videoCharacterVoiceKey(ref) {
|
|
26
26
|
const voice = ref.voice;
|
|
@@ -36,7 +36,7 @@ function videoCharacterDistinctVoices(characterReferences) {
|
|
|
36
36
|
return keys.size;
|
|
37
37
|
}
|
|
38
38
|
function videoCharacterRefProviders() {
|
|
39
|
-
return Object.entries(
|
|
39
|
+
return Object.entries(chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER).filter(([, l]) => (l?.characters ?? 0) > 0).map(([id]) => id);
|
|
40
40
|
}
|
|
41
41
|
function videoCharacterRefUnits(characterReferences) {
|
|
42
42
|
let units = 0;
|
|
@@ -77,7 +77,7 @@ function videoCharacterRefProblem(args) {
|
|
|
77
77
|
message: `${provider} accepts at most ${cap} character references; got ${characterReferences.length}.`
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
|
-
const limits =
|
|
80
|
+
const limits = chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider];
|
|
81
81
|
const materials = limits?.materials;
|
|
82
82
|
if (materials !== void 0) {
|
|
83
83
|
const audioSeats = limits?.audioBindsToCharacters ? 0 : args.audioCount ?? 0;
|
|
@@ -102,7 +102,7 @@ function videoCharacterRefProblem(args) {
|
|
|
102
102
|
message: `${provider} does not use an end frame (endFrameUrl) together with characterReferences. Drop the end frame, or drop characterReferences.`
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
const budget =
|
|
105
|
+
const budget = chunkW6VJAUGM_cjs.VIDEO_REF_LIMITS_BY_PROVIDER[provider]?.images ?? 7;
|
|
106
106
|
const used = args.imageCount + args.videoCount * 2 + videoCharacterRefUnits(characterReferences);
|
|
107
107
|
if (used > budget) {
|
|
108
108
|
return {
|
|
@@ -135,37 +135,11 @@ function characterReferencesFromWired(refs) {
|
|
|
135
135
|
}));
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
// src/video-duration.ts
|
|
139
|
-
function extractVideoDurationFromNode(data) {
|
|
140
|
-
if (!data) return void 0;
|
|
141
|
-
const results = data.generatedResults;
|
|
142
|
-
const idx = data.activeResultIndex ?? 0;
|
|
143
|
-
const fromResult = results?.[idx]?.duration;
|
|
144
|
-
if (typeof fromResult === "number" && Number.isFinite(fromResult) && fromResult > 0) {
|
|
145
|
-
return fromResult;
|
|
146
|
-
}
|
|
147
|
-
const fromConfig = data.duration;
|
|
148
|
-
if (typeof fromConfig === "number" && Number.isFinite(fromConfig) && fromConfig > 0) {
|
|
149
|
-
return fromConfig;
|
|
150
|
-
}
|
|
151
|
-
return void 0;
|
|
152
|
-
}
|
|
153
|
-
function editPlanSourceDurationSec(data) {
|
|
154
|
-
const fromVideo = extractVideoDurationFromNode(data);
|
|
155
|
-
if (fromVideo !== void 0) return fromVideo;
|
|
156
|
-
const meta = data?.metadata;
|
|
157
|
-
if (typeof meta?.mediaUrl === "string" && meta.mediaUrl !== data?.extractedAudioUrl && meta.mediaUrl !== data?.url) {
|
|
158
|
-
return void 0;
|
|
159
|
-
}
|
|
160
|
-
const d = meta?.durationSeconds;
|
|
161
|
-
return typeof d === "number" && Number.isFinite(d) && d > 0 ? d : void 0;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
138
|
// src/video-overlay-geometry.ts
|
|
165
139
|
var evenFloor = (n) => Math.max(2, Math.floor(n / 2) * 2);
|
|
166
140
|
function videoOverlayCanvas(display, outputAspect) {
|
|
167
|
-
if (
|
|
168
|
-
const d =
|
|
141
|
+
if (chunkT2OVDF2M_cjs.isVideoOverlayOutputAspect(outputAspect)) {
|
|
142
|
+
const d = chunkW6VJAUGM_cjs.ASPECT_RATIO_DIMENSIONS[outputAspect];
|
|
169
143
|
return { w: d.width, h: d.height };
|
|
170
144
|
}
|
|
171
145
|
if (!display || !(display.width > 0) || !(display.height > 0)) return null;
|
|
@@ -227,13 +201,13 @@ function videoOverlayLayoutPlacesBase(id) {
|
|
|
227
201
|
}
|
|
228
202
|
|
|
229
203
|
// src/video-overlay-validate.ts
|
|
230
|
-
var inTimeRange = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <=
|
|
231
|
-
var BOUNDED_FIELDS = Object.keys(
|
|
204
|
+
var inTimeRange = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC;
|
|
205
|
+
var BOUNDED_FIELDS = Object.keys(chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOUNDS);
|
|
232
206
|
function outOfBounds(l) {
|
|
233
207
|
for (const f of BOUNDED_FIELDS) {
|
|
234
208
|
const v = l[f];
|
|
235
209
|
if (v === void 0 || v === null) continue;
|
|
236
|
-
const [min, max] =
|
|
210
|
+
const [min, max] = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOUNDS[f];
|
|
237
211
|
const integer = f === "zIndex";
|
|
238
212
|
if (typeof v !== "number" || !Number.isFinite(v) || v < min || v > max || integer && !Number.isInteger(v)) {
|
|
239
213
|
return { field: f, allowed: `${integer ? "integers " : ""}${min}..${max}` };
|
|
@@ -242,25 +216,25 @@ function outOfBounds(l) {
|
|
|
242
216
|
if (l.anchor != null && !chunk44I73CQS_cjs.OVERLAY_ANCHORS.includes(l.anchor)) {
|
|
243
217
|
return { field: "anchor", allowed: chunk44I73CQS_cjs.OVERLAY_ANCHORS.join(", ") };
|
|
244
218
|
}
|
|
245
|
-
if (l.fit != null && !
|
|
219
|
+
if (l.fit != null && !chunkT2OVDF2M_cjs.isFit(l.fit)) return { field: "fit", allowed: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_FITS.join(", ") };
|
|
246
220
|
if (l.animate != null && typeof l.animate !== "boolean") return { field: "animate", allowed: "true, false" };
|
|
247
221
|
return null;
|
|
248
222
|
}
|
|
249
223
|
function soundOutOfBounds(sound) {
|
|
250
224
|
if (sound === void 0 || sound === null) return null;
|
|
251
|
-
const [min, max] =
|
|
225
|
+
const [min, max] = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_VOLUME_BOUNDS;
|
|
252
226
|
const v = typeof sound === "object" && !Array.isArray(sound) ? sound.volume : void 0;
|
|
253
227
|
return typeof v === "number" && Number.isFinite(v) && v >= min && v <= max ? null : { field: "sound.volume", allowed: `${min}..${max}` };
|
|
254
228
|
}
|
|
255
229
|
function baseBoxIssue(raw) {
|
|
256
|
-
const own =
|
|
257
|
-
const box = Object.fromEntries(
|
|
230
|
+
const own = chunkT2OVDF2M_cjs.asLayer(raw) ?? {};
|
|
231
|
+
const box = Object.fromEntries(chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS.map((f) => [f, own[f]]));
|
|
258
232
|
if (box.anchor == null || box.width == null) return { ok: false, code: "incomplete_box", params: { field: "baseBox" } };
|
|
259
233
|
const bad = outOfBounds(box);
|
|
260
234
|
return bad ? { ok: false, code: "field_out_of_bounds", params: { ...bad, field: `baseBox.${bad.field}` } } : null;
|
|
261
235
|
}
|
|
262
236
|
function hasDrawableVideoOverlayBox(layer) {
|
|
263
|
-
const l =
|
|
237
|
+
const l = chunkT2OVDF2M_cjs.asLayer(layer);
|
|
264
238
|
if (!l) return false;
|
|
265
239
|
if (!chunk44I73CQS_cjs.OVERLAY_ANCHORS.includes(l.anchor)) return false;
|
|
266
240
|
if (typeof l.width !== "number" || !Number.isFinite(l.width)) return false;
|
|
@@ -270,15 +244,15 @@ function validateVideoOverlayRequest(body) {
|
|
|
270
244
|
if (body.planError) return { ok: false, code: "invalid_layer_plan", params: {} };
|
|
271
245
|
const layers = Array.isArray(body.layers) ? body.layers : [];
|
|
272
246
|
if (layers.length === 0) return { ok: false, code: "no_layers", params: {} };
|
|
273
|
-
if (layers.length >
|
|
274
|
-
return { ok: false, code: "too_many_layers", params: { max:
|
|
247
|
+
if (layers.length > chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_LAYERS) {
|
|
248
|
+
return { ok: false, code: "too_many_layers", params: { max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_LAYERS, count: layers.length } };
|
|
275
249
|
}
|
|
276
|
-
const videoCount = layers.filter(
|
|
277
|
-
if (videoCount >
|
|
278
|
-
return { ok: false, code: "too_many_video_layers", params: { max:
|
|
250
|
+
const videoCount = layers.filter(chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer).length;
|
|
251
|
+
if (videoCount > chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_VIDEO_LAYERS) {
|
|
252
|
+
return { ok: false, code: "too_many_video_layers", params: { max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_VIDEO_LAYERS, count: videoCount } };
|
|
279
253
|
}
|
|
280
254
|
for (let i = 0; i < layers.length; i++) {
|
|
281
|
-
const l =
|
|
255
|
+
const l = chunkT2OVDF2M_cjs.asLayer(layers[i]) ?? {};
|
|
282
256
|
const at = (code, params = {}) => ({
|
|
283
257
|
ok: false,
|
|
284
258
|
code,
|
|
@@ -287,25 +261,25 @@ function validateVideoOverlayRequest(body) {
|
|
|
287
261
|
...typeof l.planLayer === "number" ? { planLayer: l.planLayer } : {},
|
|
288
262
|
params
|
|
289
263
|
});
|
|
290
|
-
const boxFields =
|
|
291
|
-
if (!
|
|
264
|
+
const boxFields = chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS.filter((f) => l[f] !== void 0 && l[f] !== null);
|
|
265
|
+
if (!chunkT2OVDF2M_cjs.isVideoOverlayPresetId(l.preset) && boxFields.length > 0 && (l.anchor == null || l.width == null)) return at("incomplete_box");
|
|
292
266
|
const bad = outOfBounds(l) ?? soundOutOfBounds(l.sound);
|
|
293
267
|
if (bad) return at("field_out_of_bounds", bad);
|
|
294
|
-
const hasVideo =
|
|
295
|
-
if (
|
|
296
|
-
if (!
|
|
268
|
+
const hasVideo = chunkT2OVDF2M_cjs.nonEmpty(l.videoUrl);
|
|
269
|
+
if (chunkT2OVDF2M_cjs.nonEmpty(l.imageUrl) && hasVideo) return at("layer_two_sources");
|
|
270
|
+
if (!chunkT2OVDF2M_cjs.nonEmpty(l.imageUrl) && !hasVideo) return at("layer_without_image");
|
|
297
271
|
if (l.sound != null && !hasVideo) return at("sound_without_video");
|
|
298
|
-
if (!inTimeRange(l.start)) return at("time_out_of_range", { field: "start", max:
|
|
272
|
+
if (!inTimeRange(l.start)) return at("time_out_of_range", { field: "start", max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC });
|
|
299
273
|
if (l.end !== void 0 && l.end !== null) {
|
|
300
|
-
if (!inTimeRange(l.end)) return at("time_out_of_range", { field: "end", max:
|
|
274
|
+
if (!inTimeRange(l.end)) return at("time_out_of_range", { field: "end", max: chunkT2OVDF2M_cjs.VIDEO_OVERLAY_MAX_TIME_SEC });
|
|
301
275
|
if (!(l.end > l.start)) return at("end_before_start", { start: l.start, end: l.end });
|
|
302
276
|
}
|
|
303
277
|
}
|
|
304
|
-
const hasAspect =
|
|
278
|
+
const hasAspect = chunkT2OVDF2M_cjs.isVideoOverlayOutputAspect(body.outputAspect);
|
|
305
279
|
if (!hasAspect && (body.baseFit != null || body.backgroundColor != null)) {
|
|
306
280
|
return { ok: false, code: "fit_without_aspect", params: {} };
|
|
307
281
|
}
|
|
308
|
-
const stored =
|
|
282
|
+
const stored = chunkT2OVDF2M_cjs.storedLayout(body.layout);
|
|
309
283
|
if (stored !== void 0 && !isVideoOverlayLayoutId(stored)) {
|
|
310
284
|
return { ok: false, code: "field_out_of_bounds", params: { field: "layout", allowed: VIDEO_OVERLAY_LAYOUT_IDS.join(", ") } };
|
|
311
285
|
}
|
|
@@ -314,7 +288,7 @@ function validateVideoOverlayRequest(body) {
|
|
|
314
288
|
const boxIssue = body.baseBox != null ? baseBoxIssue(body.baseBox) : null;
|
|
315
289
|
if (boxIssue) return boxIssue;
|
|
316
290
|
if (layout && !hasAspect && videoOverlayLayoutNeedsAspect(layout)) return { ok: false, code: "layout_needs_aspect", params: { layout } };
|
|
317
|
-
if (layout && videoOverlayLayoutNeedsVideoLayer(layout) && !layers.some(
|
|
291
|
+
if (layout && videoOverlayLayoutNeedsVideoLayer(layout) && !layers.some(chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer)) {
|
|
318
292
|
return { ok: false, code: "layout_needs_video_layer", params: { layout } };
|
|
319
293
|
}
|
|
320
294
|
if (body.baseBox != null && !hasAspect) return { ok: false, code: "base_box_needs_aspect", params: {} };
|
|
@@ -375,7 +349,7 @@ function sameShallow(a, b) {
|
|
|
375
349
|
}
|
|
376
350
|
function firstVideoLayerIndex(layers) {
|
|
377
351
|
if (!Array.isArray(layers)) return -1;
|
|
378
|
-
return
|
|
352
|
+
return chunkT2OVDF2M_cjs.videoOverlayRenderOrder(layers).find((i) => chunkT2OVDF2M_cjs.isVideoOverlayVideoLayer(layers[i])) ?? -1;
|
|
379
353
|
}
|
|
380
354
|
function expandBaseBox(raw) {
|
|
381
355
|
if (typeof raw !== "object" || Array.isArray(raw) || raw.anchor == null || raw.width == null) return raw;
|
|
@@ -393,10 +367,10 @@ function placeFirstVideoLayer(layout, layer) {
|
|
|
393
367
|
if (!acceptedAlone(layer)) return layer;
|
|
394
368
|
if (layout !== "pip") return layer.animate === false ? layer : { ...layer, animate: false };
|
|
395
369
|
const rest = { ...layer };
|
|
396
|
-
for (const f of
|
|
370
|
+
for (const f of chunkT2OVDF2M_cjs.VIDEO_OVERLAY_BOX_FIELDS) delete rest[f];
|
|
397
371
|
delete rest.preset;
|
|
398
|
-
const corner =
|
|
399
|
-
const next =
|
|
372
|
+
const corner = chunkT2OVDF2M_cjs.isVideoOverlayCorner(layer.corner) ? layer.corner : "bottom-right";
|
|
373
|
+
const next = chunkT2OVDF2M_cjs.expandVideoOverlayLayer({ ...rest, ...pipBox(corner), animate: false });
|
|
400
374
|
return sameShallow(next, layer) ? layer : next;
|
|
401
375
|
}
|
|
402
376
|
function expandVideoOverlayLayout(req) {
|
|
@@ -1013,7 +987,7 @@ function parseAspectToken(token) {
|
|
|
1013
987
|
function resolveFrameFitAspect(args) {
|
|
1014
988
|
const requested = args.requestedAspect?.trim();
|
|
1015
989
|
if (requested && !OPEN_ASPECT_TOKENS.has(requested.toLowerCase())) return requested;
|
|
1016
|
-
const ratios = args.provider ?
|
|
990
|
+
const ratios = args.provider ? chunk5OBTGNUQ_cjs.getModel(args.provider)?.aspectRatios : void 0;
|
|
1017
991
|
if (!ratios?.length || !(args.sourceWidth > 0) || !(args.sourceHeight > 0)) return void 0;
|
|
1018
992
|
const source = args.sourceWidth / args.sourceHeight;
|
|
1019
993
|
let best;
|
|
@@ -1125,11 +1099,9 @@ exports.computeFrameFitPlan = computeFrameFitPlan;
|
|
|
1125
1099
|
exports.deriveSlotRefs = deriveSlotRefs;
|
|
1126
1100
|
exports.dropUnknownBindings = dropUnknownBindings;
|
|
1127
1101
|
exports.dropUnknownSpeakers = dropUnknownSpeakers;
|
|
1128
|
-
exports.editPlanSourceDurationSec = editPlanSourceDurationSec;
|
|
1129
1102
|
exports.entitySlotSchema = entitySlotSchema;
|
|
1130
1103
|
exports.evenVideoOverlayRect = evenVideoOverlayRect;
|
|
1131
1104
|
exports.expandVideoOverlayLayout = expandVideoOverlayLayout;
|
|
1132
|
-
exports.extractVideoDurationFromNode = extractVideoDurationFromNode;
|
|
1133
1105
|
exports.firstVideoLayerIndex = firstVideoLayerIndex;
|
|
1134
1106
|
exports.formatVideoOverlayError = formatVideoOverlayError;
|
|
1135
1107
|
exports.hasDrawableVideoOverlayBox = hasDrawableVideoOverlayBox;
|
|
@@ -1170,5 +1142,5 @@ exports.videoOverlayLayoutNeedsAspect = videoOverlayLayoutNeedsAspect;
|
|
|
1170
1142
|
exports.videoOverlayLayoutNeedsVideoLayer = videoOverlayLayoutNeedsVideoLayer;
|
|
1171
1143
|
exports.videoOverlayLayoutPlacesBase = videoOverlayLayoutPlacesBase;
|
|
1172
1144
|
exports.windowAnalysisSchema = windowAnalysisSchema;
|
|
1173
|
-
//# sourceMappingURL=chunk-
|
|
1174
|
-
//# sourceMappingURL=chunk-
|
|
1145
|
+
//# sourceMappingURL=chunk-AZNZ5WNZ.cjs.map
|
|
1146
|
+
//# sourceMappingURL=chunk-AZNZ5WNZ.cjs.map
|