@cueframe/kernel 0.1.3 → 0.2.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/_members/account-model/validators/contextFile.d.ts +3 -21
- package/dist/_members/account-model/validators/conversation.d.ts +12 -42
- package/dist/_members/account-model/validators/dashboardInsight.d.ts +3 -17
- package/dist/_members/account-model/validators/sessionToken.d.ts +10 -36
- package/dist/_members/account-model/validators/uploadToken.d.ts +11 -21
- package/dist/_members/account-model/validators/userSettings.d.ts +3 -13
- package/dist/_members/account-model/validators/workingComposition.d.ts +3 -19
- package/dist/_members/authoring/agent/errors.d.ts +8 -0
- package/dist/_members/authoring/capabilities.d.ts +0 -9
- package/dist/_members/authoring/index.d.ts +1 -1
- package/dist/_members/authoring/models/defaultModels.d.ts +12 -0
- package/dist/_members/authoring/models/modelFactory.d.ts +1 -0
- package/dist/_members/authoring/motion/materializeMotionPresetOps.d.ts +5 -7
- package/dist/_members/authoring/types.d.ts +1 -2
- package/dist/_members/cloud-import/CloudImportService.d.ts +3 -4
- package/dist/_members/cloud-import/ImportProvider.d.ts +3 -7
- package/dist/_members/cloud-import/cloudConfig.d.ts +0 -6
- package/dist/_members/cloud-import/index.d.ts +2 -4
- package/dist/_members/component-runtime/assetServer.d.ts +18 -0
- package/dist/_members/component-runtime/assetServer.d.ts.map +1 -0
- package/dist/_members/component-runtime/bake.d.ts +12 -0
- package/dist/_members/component-runtime/bake.d.ts.map +1 -0
- package/dist/_members/component-runtime/browserFirewall.d.ts +21 -0
- package/dist/_members/component-runtime/browserFirewall.d.ts.map +1 -0
- package/dist/_members/component-runtime/browserIdentity.d.ts +14 -0
- package/dist/_members/component-runtime/browserIdentity.d.ts.map +1 -0
- package/dist/_members/component-runtime/browserOptions.d.ts +8 -0
- package/dist/_members/component-runtime/browserOptions.d.ts.map +1 -0
- package/dist/_members/component-runtime/canonicalIdentity.d.ts +14 -0
- package/dist/_members/component-runtime/canonicalIdentity.d.ts.map +1 -0
- package/dist/_members/component-runtime/contracts.d.ts +443 -0
- package/dist/_members/component-runtime/contracts.d.ts.map +1 -0
- package/dist/_members/component-runtime/determinism.d.ts +18 -0
- package/dist/_members/component-runtime/determinism.d.ts.map +1 -0
- package/dist/_members/component-runtime/fixtures/webgpuTiledRefraction.d.ts +9 -0
- package/dist/_members/component-runtime/fixtures/webgpuTiledRefraction.d.ts.map +1 -0
- package/dist/_members/component-runtime/identity.d.ts +16 -0
- package/dist/_members/component-runtime/identity.d.ts.map +1 -0
- package/dist/_members/component-runtime/importPolicy.d.ts +3 -0
- package/dist/_members/component-runtime/importPolicy.d.ts.map +1 -0
- package/dist/_members/component-runtime/index.d.ts +11 -0
- package/dist/_members/component-runtime/index.d.ts.map +1 -0
- package/dist/_members/component-runtime/outputVerifier.d.ts +29 -0
- package/dist/_members/component-runtime/outputVerifier.d.ts.map +1 -0
- package/dist/_members/{render-harness/localRender.d.ts → component-runtime/render.d.ts} +25 -15
- package/dist/_members/component-runtime/render.d.ts.map +1 -0
- package/dist/_members/component-runtime/sourceWorkspace.d.ts +10 -0
- package/dist/_members/component-runtime/sourceWorkspace.d.ts.map +1 -0
- package/dist/_members/compose/index.d.ts +0 -5
- package/dist/_members/composition/graphics-plan/schemas.d.ts +299 -1309
- package/dist/_members/composition/primitive-catalog/index.d.ts +2 -2
- package/dist/_members/composition/primitive-catalog/projection.d.ts +2 -15
- package/dist/_members/composition/projection/behind-readiness.d.ts +4 -2
- package/dist/_members/composition/reframe/index.d.ts +56 -528
- package/dist/_members/composition/validators/brandKit.d.ts +251 -1252
- package/dist/_members/composition/validators/composePlan.d.ts +106 -818
- package/dist/_members/composition/validators/composition.d.ts +1328 -5886
- package/dist/_members/composition/validators/font.d.ts +35 -91
- package/dist/_members/composition/validators/index.d.ts +1 -0
- package/dist/_members/composition/validators/opaqueId.d.ts +13 -0
- package/dist/_members/composition/validators/project.d.ts +17 -52
- package/dist/_members/composition/validators/registry.d.ts +53 -135
- package/dist/_members/composition/validators/render.d.ts +811 -7443
- package/dist/_members/composition/validators/session.d.ts +41 -99
- package/dist/_members/composition/validators/webhook.d.ts +25 -60
- package/dist/_members/composition-ops/alphaLayers.d.ts +3 -2
- package/dist/_members/composition-ops/index.d.ts +412 -4348
- package/dist/_members/core/render/compositionAudioAndDepth.d.ts +6 -0
- package/dist/_members/core/render/compositionRender.d.ts +3 -4
- package/dist/_members/core/render/compositionValidation.d.ts +4 -0
- package/dist/_members/core/render/index.d.ts +2 -2
- package/dist/_members/core/render/types.d.ts +16 -8
- package/dist/_members/director/ai-sdk/messages.d.ts +67 -217
- package/dist/_members/director/domain/chat.d.ts +70 -293
- package/dist/_members/director/testing/contract.d.ts +10 -10
- package/dist/_members/errors/registry.d.ts +201 -3
- package/dist/_members/foundation/primitives/index.d.ts +1 -1
- package/dist/_members/mcp/adapter.d.ts +22 -0
- package/dist/_members/mcp/burnedNames.d.ts +0 -1
- package/dist/_members/mcp/core.d.ts +6 -3
- package/dist/_members/mcp/curation.d.ts +3 -34
- package/dist/_members/mcp/curationTypes.d.ts +34 -0
- package/dist/_members/mcp/generated/harness.d.ts +1 -1
- package/dist/_members/mcp/generated/operations.d.ts +12 -2
- package/dist/_members/mcp/main.d.ts +1 -0
- package/dist/_members/mcp/mediaContextFormat.d.ts +4 -0
- package/dist/_members/mcp/prompts.d.ts +1 -1
- package/dist/_members/mcp/query.d.ts +4 -0
- package/dist/_members/mcp/resources.d.ts +1 -1
- package/dist/_members/mcp/server.d.ts +1 -2
- package/dist/_members/mcp/wireSchema.d.ts +13 -0
- package/dist/_members/media-model/api.d.ts +123 -727
- package/dist/_members/media-model/generation.d.ts +141 -228
- package/dist/_members/media-model/index.d.ts +1 -0
- package/dist/_members/media-model/opaqueId.d.ts +10 -0
- package/dist/_members/plane/contract.d.ts +16 -19
- package/dist/_members/primitives/backgrounds/animated-bar-chart/config.d.ts +3 -27
- package/dist/_members/primitives/backgrounds/animated-line-chart/config.d.ts +2 -26
- package/dist/_members/primitives/backgrounds/dither-gradient-bg/config.d.ts +1 -17
- package/dist/_members/primitives/backgrounds/dynamic-grid/config.d.ts +6 -14
- package/dist/_members/primitives/backgrounds/ecosystem-constellation/config.d.ts +1 -11
- package/dist/_members/primitives/backgrounds/infinite-marquee/config.d.ts +1 -21
- package/dist/_members/primitives/backgrounds/mesh-gradient-bg/config.d.ts +2 -12
- package/dist/_members/primitives/backgrounds/perspective-marquee/config.d.ts +2 -26
- package/dist/_members/primitives/backgrounds/silk-flow-bg/config.d.ts +2 -22
- package/dist/_members/primitives/backgrounds/vector-field/config.d.ts +1 -17
- package/dist/_members/primitives/backgrounds/volumetric-rays/config.d.ts +1 -19
- package/dist/_members/primitives/effects/blur/config.d.ts +5 -14
- package/dist/_members/primitives/effects/color-grade/config.d.ts +10 -18
- package/dist/_members/primitives/effects/grain/config.d.ts +9 -12
- package/dist/_members/primitives/effects/parallax/config.d.ts +8 -12
- package/dist/_members/primitives/effects/particles/config.d.ts +9 -20
- package/dist/_members/primitives/effects/pulsing-indicator/config.d.ts +1 -13
- package/dist/_members/primitives/effects/spotlight-card/config.d.ts +1 -25
- package/dist/_members/primitives/effects/spring-pop-in/config.d.ts +1 -15
- package/dist/_members/primitives/effects/success-confetti/config.d.ts +2 -26
- package/dist/_members/primitives/effects/vignette/config.d.ts +5 -12
- package/dist/_members/primitives/hero-text/config.d.ts +9 -24
- package/dist/_members/primitives/layouts/chat-to-preview-layout/config.d.ts +1 -11
- package/dist/_members/primitives/layouts/infinite-bento-pan/config.d.ts +1 -9
- package/dist/_members/primitives/layouts/letterbox/config.d.ts +1 -9
- package/dist/_members/primitives/layouts/photo-grid/config.d.ts +2 -12
- package/dist/_members/primitives/layouts/picture-in-picture/config.d.ts +7 -12
- package/dist/_members/primitives/layouts/split-screen/config.d.ts +1 -7
- package/dist/_members/primitives/layouts/staggered-bento-grid/config.d.ts +3 -51
- package/dist/_members/primitives/lib/schema.d.ts +1 -1
- package/dist/_members/primitives/scenes/changelog-bite/config.d.ts +7 -24
- package/dist/_members/primitives/scenes/hero-device-assemble/config.d.ts +5 -14
- package/dist/_members/primitives/scenes/landing-code-showcase/config.d.ts +1 -7
- package/dist/_members/primitives/scenes/live-code-compilation/config.d.ts +1 -7
- package/dist/_members/primitives/scenes/pricing-tier-focus/config.d.ts +2 -12
- package/dist/_members/primitives/scenes/product-launch-trailer/config.d.ts +1 -19
- package/dist/_members/primitives/scenes/terminal-to-browser-deploy/config.d.ts +1 -11
- package/dist/_members/primitives/text/blur-reveal/config.d.ts +1 -17
- package/dist/_members/primitives/text/cinematic-title/config.d.ts +13 -73
- package/dist/_members/primitives/text/inline-highlight/config.d.ts +1 -21
- package/dist/_members/primitives/text/karaoke/config.d.ts +10 -93
- package/dist/_members/primitives/text/kinetic-type/config.d.ts +14 -49
- package/dist/_members/primitives/text/lower-third/config.d.ts +8 -70
- package/dist/_members/primitives/text/marker-highlight/config.d.ts +1 -23
- package/dist/_members/primitives/text/masked-slide-reveal/config.d.ts +1 -17
- package/dist/_members/primitives/text/matrix-decode/config.d.ts +1 -19
- package/dist/_members/primitives/text/quote-card/config.d.ts +1 -11
- package/dist/_members/primitives/text/rgb-glitch-text/config.d.ts +1 -23
- package/dist/_members/primitives/text/shimmer-sweep/config.d.ts +1 -17
- package/dist/_members/primitives/text/slot-machine-roll/config.d.ts +1 -17
- package/dist/_members/primitives/text/staggered-fade-up/config.d.ts +2 -24
- package/dist/_members/primitives/text/stat-counter/config.d.ts +6 -20
- package/dist/_members/primitives/text/strikethrough-replace/config.d.ts +1 -19
- package/dist/_members/primitives/text/text-effect/config.d.ts +10 -15
- package/dist/_members/primitives/text/text-fade-replace/config.d.ts +1 -17
- package/dist/_members/primitives/text/token-stream/config.d.ts +1 -11
- package/dist/_members/primitives/text/tracking-in/config.d.ts +1 -19
- package/dist/_members/primitives/text/typewriter/config.d.ts +1 -21
- package/dist/_members/primitives/transitions/chromatic-aberration-wipe/config.d.ts +5 -8
- package/dist/_members/primitives/transitions/code-diff-wipe/config.d.ts +1 -21
- package/dist/_members/primitives/transitions/directional-wipe/config.d.ts +7 -6
- package/dist/_members/primitives/transitions/frosted-glass-wipe/config.d.ts +1 -5
- package/dist/_members/primitives/transitions/glitch-cut/config.d.ts +1 -7
- package/dist/_members/primitives/transitions/grid-pixelate-wipe/config.d.ts +6 -12
- package/dist/_members/primitives/transitions/ink-wipe/config.d.ts +7 -8
- package/dist/_members/primitives/transitions/kinetic-type-mask/config.d.ts +1 -7
- package/dist/_members/primitives/transitions/light-leak/config.d.ts +1 -7
- package/dist/_members/primitives/transitions/luma-matte/config.d.ts +6 -6
- package/dist/_members/primitives/transitions/morph/config.d.ts +5 -6
- package/dist/_members/primitives/transitions/spatial-push/config.d.ts +7 -6
- package/dist/_members/primitives/transitions/swipe-transition-wipe/config.d.ts +5 -10
- package/dist/_members/primitives/transitions/zoom-through/config.d.ts +2 -30
- package/dist/_members/primitives/transitions/zoom-through-transition/config.d.ts +1 -13
- package/dist/_members/primitives/ui-blocks/ai-generate-overlay/config.d.ts +1 -29
- package/dist/_members/primitives/ui-blocks/ai-generation-canvas/config.d.ts +1 -11
- package/dist/_members/primitives/ui-blocks/badge-pop/config.d.ts +8 -16
- package/dist/_members/primitives/ui-blocks/before-after-slider/config.d.ts +1 -11
- package/dist/_members/primitives/ui-blocks/benchmark-bars/config.d.ts +3 -73
- package/dist/_members/primitives/ui-blocks/bounding-box-selector/config.d.ts +1 -15
- package/dist/_members/primitives/ui-blocks/browser-flow/config.d.ts +1 -7
- package/dist/_members/primitives/ui-blocks/brush-stroke-simulator/config.d.ts +1 -21
- package/dist/_members/primitives/ui-blocks/chat-exchange/config.d.ts +1 -15
- package/dist/_members/primitives/ui-blocks/code-accordion/config.d.ts +2 -26
- package/dist/_members/primitives/ui-blocks/context-meter/config.d.ts +1 -13
- package/dist/_members/primitives/ui-blocks/cursor-flow/config.d.ts +2 -66
- package/dist/_members/primitives/ui-blocks/dashboard-populate/config.d.ts +1 -9
- package/dist/_members/primitives/ui-blocks/data-flow-pipes/config.d.ts +3 -97
- package/dist/_members/primitives/ui-blocks/device-mockup-zoom/config.d.ts +5 -14
- package/dist/_members/primitives/ui-blocks/drag-and-drop-flow/config.d.ts +1 -13
- package/dist/_members/primitives/ui-blocks/eval-scorecard/config.d.ts +2 -36
- package/dist/_members/primitives/ui-blocks/glass-code-block/config.d.ts +1 -23
- package/dist/_members/primitives/ui-blocks/image-expand-to-fullscreen/config.d.ts +3 -113
- package/dist/_members/primitives/ui-blocks/metric-gauge/config.d.ts +2 -34
- package/dist/_members/primitives/ui-blocks/morphing-modal/config.d.ts +3 -113
- package/dist/_members/primitives/ui-blocks/pipeline-journey/config.d.ts +1 -9
- package/dist/_members/primitives/ui-blocks/progress-steps/config.d.ts +6 -37
- package/dist/_members/primitives/ui-blocks/reasoning-trace/config.d.ts +2 -12
- package/dist/_members/primitives/ui-blocks/simulated-cursor/config.d.ts +2 -54
- package/dist/_members/primitives/ui-blocks/terminal-simulator/config.d.ts +9 -48
- package/dist/_members/primitives/ui-blocks/toast-notification/config.d.ts +7 -20
- package/dist/_members/primitives/ui-blocks/tool-call-stack/config.d.ts +2 -42
- package/dist/_members/primitives/ui-blocks/tool-menu-slide-in/config.d.ts +1 -19
- package/dist/_members/primitives/ui-blocks/visual-docs-snippet/config.d.ts +3 -71
- package/dist/_members/primitives/ui-blocks/voice-waveform/config.d.ts +5 -14
- package/dist/_members/primitives/workspace.d.ts +1 -5
- package/dist/_members/render-harness/cardAssetAdmission.d.ts +3 -0
- package/dist/_members/render-harness/cardAssetAdmission.d.ts.map +1 -0
- package/dist/_members/render-harness/cardRender.d.ts.map +1 -1
- package/dist/_members/render-harness/index.d.ts +1 -5
- package/dist/_members/render-harness/index.d.ts.map +1 -1
- package/dist/_members/render-harness/materializeSources.d.ts.map +1 -1
- package/dist/_members/render-harness/remotion-runtime.d.ts +20 -0
- package/dist/_members/render-harness/renderInputAssets.d.ts +2 -1
- package/dist/_members/render-harness/renderInputAssets.d.ts.map +1 -1
- package/dist/_members/render-harness/resolveAssets.d.ts.map +1 -1
- package/dist/authoring/build-tools.js +8 -8
- package/dist/authoring/context.js +5 -5
- package/dist/authoring/models.js +3 -1
- package/dist/authoring/resource-routing.js +1 -1
- package/dist/authoring/resources.js +1 -1
- package/dist/authoring/tools.js +7 -7
- package/dist/authoring.js +28 -27
- package/dist/{chunk-AW57IWNW.js → chunk-4FOOBSEE.js} +53 -3
- package/dist/{chunk-KFECIHED.js → chunk-4JRUGT2Y.js} +41 -106
- package/dist/{chunk-FMODQD5P.js → chunk-4ZE564YF.js} +16 -9
- package/dist/chunk-5OTQ7M43.js +718 -0
- package/dist/{chunk-GMD33ZD7.js → chunk-6ID2J64H.js} +1 -1
- package/dist/{chunk-NQSMEUJ6.js → chunk-6XI57FZZ.js} +362 -212
- package/dist/chunk-7KEUL3FI.js +500 -0
- package/dist/{chunk-GIA2SVVB.js → chunk-AD5HWBCE.js} +9 -4
- package/dist/{chunk-DCVJWGIA.js → chunk-C5SEPOWD.js} +165 -173
- package/dist/chunk-CGHTMZNC.js +6 -0
- package/dist/chunk-DHKQ47Q6.js +57 -0
- package/dist/{chunk-RP4SXXLJ.js → chunk-DQKSCHFC.js} +1 -1
- package/dist/{chunk-TO4BFNLJ.js → chunk-EEXCDFY5.js} +1 -1
- package/dist/{chunk-ZT7MHRQU.js → chunk-GCQ7Z7S7.js} +15 -5
- package/dist/{chunk-TPA6PYN2.js → chunk-GEGRJKKO.js} +25 -10
- package/dist/chunk-HHFDHJ3I.js +392 -0
- package/dist/{chunk-ICSZF37W.js → chunk-IBMJ33EL.js} +3 -3
- package/dist/{chunk-TFGKUWHY.js → chunk-IHFREGFA.js} +24 -22
- package/dist/chunk-IJ7PVJTK.js +114 -0
- package/dist/{chunk-UQSOS726.js → chunk-KKEY5MIW.js} +8 -8
- package/dist/{chunk-ZPRBGW4Y.js → chunk-LNBVTDFR.js} +1 -1
- package/dist/chunk-LQUWKBST.js +195 -0
- package/dist/chunk-M2TLRXEO.js +41 -0
- package/dist/{chunk-SDCEJAO2.js → chunk-NOEBAV2G.js} +58 -2
- package/dist/{chunk-DL7WYISQ.js → chunk-QBKDEO7J.js} +1601 -1435
- package/dist/chunk-RFXR7ATW.js +244 -0
- package/dist/chunk-SIAXP3ZO.js +131 -0
- package/dist/{chunk-MCBUX5XV.js → chunk-SLN5UKLT.js} +2 -2
- package/dist/{chunk-GH27OS5S.js → chunk-VCBLGZQQ.js} +19 -4
- package/dist/{chunk-TMB5AY6Q.js → chunk-XHUYWVYK.js} +1 -1
- package/dist/{chunk-BZZTVOGG.js → chunk-XVBOSPZI.js} +15 -17
- package/dist/{chunk-HBVAZXYO.js → chunk-Y3QGYASW.js} +14 -14
- package/dist/{chunk-DWLNPNC4.js → chunk-ZCAQHNPI.js} +1 -1
- package/dist/{chunk-DJW3UGBH.js → chunk-ZN6P3KOJ.js} +90 -39
- package/dist/chunk-ZZRBKGDA.js +109 -0
- package/dist/cloud-import.js +20 -116
- package/dist/component-runtime/browserOptions.d.ts +1 -0
- package/dist/component-runtime/browserOptions.js +7 -0
- package/dist/component-runtime/contracts.d.ts +1 -0
- package/dist/component-runtime/contracts.js +49 -0
- package/dist/component-runtime/identity/browser.d.ts +1 -0
- package/dist/component-runtime/identity/browser.js +35 -0
- package/dist/component-runtime/identity.d.ts +1 -0
- package/dist/component-runtime/identity.js +21 -0
- package/dist/component-runtime/importPolicy.d.ts +1 -0
- package/dist/component-runtime/importPolicy.js +10 -0
- package/dist/component-runtime/render.d.ts +1 -0
- package/dist/component-runtime/render.js +34 -0
- package/dist/component-runtime.d.ts +1 -0
- package/dist/component-runtime.js +132 -0
- package/dist/compose.js +16 -30
- package/dist/composition/graphics-plan.js +1 -1
- package/dist/composition/ops.js +4 -4
- package/dist/composition/primitive-catalog.js +1 -3
- package/dist/composition/projection.js +2 -2
- package/dist/composition/timeline.js +2 -2
- package/dist/composition/validators.js +4 -2
- package/dist/composition-ops.js +23 -17
- package/dist/composition.js +17 -15
- package/dist/{context-JLLU3MYD.js → context-4GSDBFT3.js} +5 -5
- package/dist/core/render.js +8 -8
- package/dist/core/select.js +2 -2
- package/dist/core.js +6 -6
- package/dist/director/ai-sdk.js +3 -3
- package/dist/director/domain.js +2 -2
- package/dist/director.js +3 -3
- package/dist/errors.js +1 -1
- package/dist/mcp/adapter.js +33 -33
- package/dist/mcp/core.js +1 -1
- package/dist/mcp/curation.js +5 -1
- package/dist/mcp/executor.js +1 -1
- package/dist/mcp/server.js +4 -6
- package/dist/mcp/wire-schema.d.ts +1 -0
- package/dist/mcp/wire-schema.js +37 -0
- package/dist/mcp.js +6 -29
- package/dist/media-model/media-kind.js +98 -9
- package/dist/media-model.js +83 -77
- package/dist/nle-export.js +15 -24
- package/dist/plane/conformance.js +1 -1
- package/dist/plane/contract.js +7 -0
- package/dist/plane.js +1 -1
- package/dist/primitives/effects.js +1 -1
- package/dist/primitives/hero-text.js +2 -2
- package/dist/primitives/layouts.js +1 -1
- package/dist/primitives/lib/index.js +18 -18
- package/dist/primitives/lib/schema.js +1 -1
- package/dist/primitives/lib.js +18 -18
- package/dist/primitives/scenes.js +2 -2
- package/dist/primitives/text.js +2 -2
- package/dist/primitives.js +10 -10
- package/dist/render-harness/cardAssetAdmission.d.ts +1 -0
- package/dist/render-harness/cardAssetAdmission.js +8 -0
- package/dist/render-harness/renderInputAssets.d.ts +1 -0
- package/dist/render-harness/renderInputAssets.js +17 -0
- package/dist/render-harness.js +44 -572
- package/package.json +69 -61
- package/dist/_members/authoring/prompts/designReviewerPrompt.d.ts +0 -2
- package/dist/_members/authoring/transpileComponent.d.ts +0 -6
- package/dist/_members/authoring/transpileHelper.d.ts +0 -8
- package/dist/_members/cloud-import/MediaItemPreprocessor.d.ts +0 -18
- package/dist/_members/cloud-import/multipartUpload.d.ts +0 -12
- package/dist/_members/compose/CompositionRenderer.d.ts +0 -6
- package/dist/_members/compose/sceneToRenderInput.d.ts +0 -25
- package/dist/_members/compose/schema.d.ts +0 -30
- package/dist/_members/compose/tokenResolver.d.ts +0 -17
- package/dist/_members/convex-api/api.d.ts +0 -5
- package/dist/_members/convex-api/api.generated.d.ts +0 -1444
- package/dist/_members/convex-api/dataModel.d.ts +0 -6
- package/dist/_members/render-harness/browserOptions.d.ts +0 -11
- package/dist/_members/render-harness/browserOptions.d.ts.map +0 -1
- package/dist/_members/render-harness/contractRender.d.ts +0 -27
- package/dist/_members/render-harness/contractRender.d.ts.map +0 -1
- package/dist/_members/render-harness/localRender.d.ts.map +0 -1
- package/dist/_members/render-harness/sandboxGlobalSpecs.d.ts +0 -9
- package/dist/_members/render-harness/sandboxGlobalSpecs.d.ts.map +0 -1
- package/dist/authoring/transpileComponent.d.ts +0 -1
- package/dist/authoring/transpileComponent.js +0 -31
- package/dist/authoring/transpileHelper.d.ts +0 -1
- package/dist/authoring/transpileHelper.js +0 -9
- package/dist/chunk-6IU2UQI5.js +0 -107
- package/dist/chunk-EP2Y6M2J.js +0 -64
- package/dist/chunk-MHOQTPOB.js +0 -124
- package/dist/chunk-RHVLQNYF.js +0 -20
- package/dist/chunk-TXSFYUZH.js +0 -85
- package/dist/chunk-V24L35GM.js +0 -61
- package/dist/chunk-WZH57M53.js +0 -494
- package/dist/cloud-import/multipart.d.ts +0 -1
- package/dist/cloud-import/multipart.js +0 -8
- package/dist/compose/renderer.d.ts +0 -1
- package/dist/compose/renderer.js +0 -170
- package/dist/convex-api/dataModel.d.ts +0 -1
- package/dist/convex-api/dataModel.js +0 -0
- package/dist/convex-api.d.ts +0 -1
- package/dist/convex-api.js +0 -8
- package/dist/render-harness/sandboxGlobalSpecs.d.ts +0 -1
- package/dist/render-harness/sandboxGlobalSpecs.js +0 -13
- package/dist/{chunk-SAMQUUO5.js → chunk-BIBYZJL3.js} +3 -3
- package/dist/{chunk-23HFEKV7.js → chunk-QISFYLBB.js} +4 -4
- package/dist/{chunk-DYZE7JZA.js → chunk-TMIBBD5E.js} +3 -3
|
@@ -20,11 +20,11 @@ import {
|
|
|
20
20
|
scoreAndRank,
|
|
21
21
|
segmentShots,
|
|
22
22
|
stabilizeSelectionHysteresis
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-LNBVTDFR.js";
|
|
24
24
|
import {
|
|
25
25
|
flattenCompoundClips,
|
|
26
26
|
hasCompoundClips
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-QISFYLBB.js";
|
|
28
28
|
import {
|
|
29
29
|
compositionHasVo,
|
|
30
30
|
roleDefaultGainDb
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
import {
|
|
37
37
|
CueframeError,
|
|
38
38
|
encodeError
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-4FOOBSEE.js";
|
|
40
40
|
|
|
41
41
|
// ../execution/core/src/render/emphasis.ts
|
|
42
42
|
function buildEmphasisSet(emphasisWords) {
|
|
@@ -177,99 +177,276 @@ function resolveBookendTimeline(brandKit, bodyFrames, fps) {
|
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
// ../execution/core/src/render/
|
|
181
|
-
function
|
|
182
|
-
|
|
183
|
-
if (!effects || effects.length === 0) return [];
|
|
184
|
-
return effects.map((e, idx) => ({
|
|
185
|
-
id: `${renderClipId}::effect:${idx}`,
|
|
186
|
-
primitiveId: e.primitiveId,
|
|
187
|
-
params: e.params ?? {},
|
|
188
|
-
target: { kind: "clip", clipId: renderClipId }
|
|
189
|
-
}));
|
|
190
|
-
}
|
|
191
|
-
function compositionFormatDimensions(format) {
|
|
192
|
-
const fps = format.fps ?? 30;
|
|
193
|
-
const resolution = format.resolution ?? "fhd";
|
|
194
|
-
const dims = {
|
|
195
|
-
"9:16": {
|
|
196
|
-
hd: { width: 720, height: 1280 },
|
|
197
|
-
fhd: { width: 1080, height: 1920 },
|
|
198
|
-
"4k": { width: 2160, height: 3840 }
|
|
199
|
-
},
|
|
200
|
-
"1:1": {
|
|
201
|
-
hd: { width: 720, height: 720 },
|
|
202
|
-
fhd: { width: 1080, height: 1080 },
|
|
203
|
-
"4k": { width: 2160, height: 2160 }
|
|
204
|
-
},
|
|
205
|
-
"4:5": {
|
|
206
|
-
hd: { width: 720, height: 900 },
|
|
207
|
-
fhd: { width: 1080, height: 1350 },
|
|
208
|
-
"4k": { width: 2160, height: 2700 }
|
|
209
|
-
},
|
|
210
|
-
"16:9": {
|
|
211
|
-
hd: { width: 1280, height: 720 },
|
|
212
|
-
fhd: { width: 1920, height: 1080 },
|
|
213
|
-
"4k": { width: 3840, height: 2160 }
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
return { ...dims[format.aspectRatio][resolution], fps };
|
|
180
|
+
// ../execution/core/src/render/compositionValidation.ts
|
|
181
|
+
function renderInputError(code, message, locator) {
|
|
182
|
+
return new CueframeError(code, message, void 0, locator);
|
|
217
183
|
}
|
|
218
184
|
function validateComposition(raw) {
|
|
219
185
|
if (!raw || typeof raw !== "object") {
|
|
220
|
-
throw
|
|
186
|
+
throw renderInputError("invalid_composition", "composition: expected object, got " + typeof raw, {
|
|
187
|
+
compositionPath: "composition"
|
|
188
|
+
});
|
|
221
189
|
}
|
|
222
190
|
const obj = raw;
|
|
223
191
|
if (obj.v !== 1) {
|
|
224
|
-
throw
|
|
192
|
+
throw renderInputError("invalid_composition", "composition.v: expected literal 1", {
|
|
193
|
+
compositionPath: "composition.v"
|
|
194
|
+
});
|
|
225
195
|
}
|
|
226
196
|
const fmt = obj.format;
|
|
227
197
|
if (!fmt || typeof fmt.aspectRatio !== "string") {
|
|
228
|
-
throw
|
|
198
|
+
throw renderInputError("invalid_composition", "composition.format.aspectRatio: required string", {
|
|
199
|
+
compositionPath: "composition.format.aspectRatio"
|
|
200
|
+
});
|
|
229
201
|
}
|
|
230
202
|
if (!Array.isArray(obj.tracks)) {
|
|
231
|
-
throw
|
|
203
|
+
throw renderInputError("invalid_composition", "composition.tracks: expected array", {
|
|
204
|
+
compositionPath: "composition.tracks"
|
|
205
|
+
});
|
|
232
206
|
}
|
|
233
207
|
for (let i = 0; i < obj.tracks.length; i++) {
|
|
234
208
|
const t = obj.tracks[i];
|
|
235
209
|
if (!t || typeof t !== "object") {
|
|
236
|
-
throw
|
|
210
|
+
throw renderInputError("invalid_composition", `composition.tracks[${i}]: expected object`, {
|
|
211
|
+
compositionPath: `composition.tracks[${i}]`
|
|
212
|
+
});
|
|
237
213
|
}
|
|
238
214
|
if (typeof t.id !== "string") {
|
|
239
|
-
throw
|
|
215
|
+
throw renderInputError("invalid_composition", `composition.tracks[${i}].id: expected string`, {
|
|
216
|
+
compositionPath: `composition.tracks[${i}].id`
|
|
217
|
+
});
|
|
240
218
|
}
|
|
241
219
|
if (!["video", "audio", "image", "overlay", "effect"].includes(t.kind)) {
|
|
242
|
-
throw
|
|
220
|
+
throw renderInputError("invalid_composition", `composition.tracks[${i}].kind: invalid value`, {
|
|
221
|
+
compositionPath: `composition.tracks[${i}].kind`,
|
|
222
|
+
...typeof t.id === "string" ? { trackId: t.id } : {}
|
|
223
|
+
});
|
|
243
224
|
}
|
|
244
225
|
if (!Array.isArray(t.contents)) {
|
|
245
|
-
throw
|
|
226
|
+
throw renderInputError("invalid_composition", `composition.tracks[${i}].contents: expected array`, {
|
|
227
|
+
compositionPath: `composition.tracks[${i}].contents`,
|
|
228
|
+
trackId: t.id
|
|
229
|
+
});
|
|
246
230
|
}
|
|
247
231
|
}
|
|
248
232
|
if (obj.markers !== void 0 && !Array.isArray(obj.markers)) {
|
|
249
|
-
throw
|
|
233
|
+
throw renderInputError("invalid_composition", "composition.markers: expected array when present", {
|
|
234
|
+
compositionPath: "composition.markers"
|
|
235
|
+
});
|
|
250
236
|
}
|
|
251
237
|
if (obj.captions !== void 0) {
|
|
252
238
|
const c = obj.captions;
|
|
253
239
|
if (!c || typeof c !== "object") {
|
|
254
|
-
throw
|
|
240
|
+
throw renderInputError("invalid_composition", "composition.captions: expected object when present", {
|
|
241
|
+
compositionPath: "composition.captions"
|
|
242
|
+
});
|
|
255
243
|
}
|
|
256
244
|
if (!Array.isArray(c.segments)) {
|
|
257
|
-
throw
|
|
245
|
+
throw renderInputError("invalid_composition", "composition.captions.segments: expected array", {
|
|
246
|
+
compositionPath: "composition.captions.segments"
|
|
247
|
+
});
|
|
258
248
|
}
|
|
259
249
|
if (c.style !== void 0 && (typeof c.style !== "object" || c.style === null)) {
|
|
260
|
-
throw
|
|
250
|
+
throw renderInputError("invalid_composition", "composition.captions.style: expected object when present", {
|
|
251
|
+
compositionPath: "composition.captions.style"
|
|
252
|
+
});
|
|
261
253
|
}
|
|
262
254
|
if (c.style !== void 0) {
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
265
|
-
throw
|
|
266
|
-
|
|
255
|
+
const fontSize = c.style.fontSize;
|
|
256
|
+
if (fontSize !== void 0 && (typeof fontSize !== "number" || fontSize < 1 || fontSize > 15)) {
|
|
257
|
+
throw renderInputError(
|
|
258
|
+
"invalid_composition",
|
|
259
|
+
`composition.captions.style.fontSize: PERCENT of composition height (1-15, default 5) \u2014 got ${String(fontSize)}. px values are not accepted; a px-intent value renders giant band-overflowing captions. Re-author the style with a percent value.`,
|
|
260
|
+
{ compositionPath: "composition.captions.style.fontSize" }
|
|
267
261
|
);
|
|
268
262
|
}
|
|
269
263
|
}
|
|
270
264
|
}
|
|
271
265
|
return obj;
|
|
272
266
|
}
|
|
267
|
+
|
|
268
|
+
// ../execution/core/src/render/compositionAudioAndDepth.ts
|
|
269
|
+
function buildCaptionSpeechSpans(composition, fps) {
|
|
270
|
+
const words = (composition.captions?.segments ?? []).flatMap((seg) => seg.words).filter((w) => w.endMs > w.startMs).sort((a, b) => a.startMs - b.startMs);
|
|
271
|
+
if (words.length === 0) return [];
|
|
272
|
+
const MERGE_GAP_MS = 300;
|
|
273
|
+
const MIN_SPAN_MS = 200;
|
|
274
|
+
const spans = [];
|
|
275
|
+
let cur = { startMs: words[0].startMs, endMs: words[0].endMs };
|
|
276
|
+
for (let i = 1; i < words.length; i++) {
|
|
277
|
+
const w = words[i];
|
|
278
|
+
if (w.startMs - cur.endMs < MERGE_GAP_MS) {
|
|
279
|
+
if (w.endMs > cur.endMs) cur.endMs = w.endMs;
|
|
280
|
+
} else {
|
|
281
|
+
spans.push(cur);
|
|
282
|
+
cur = { startMs: w.startMs, endMs: w.endMs };
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
spans.push(cur);
|
|
286
|
+
return spans.filter((s) => s.endMs - s.startMs >= MIN_SPAN_MS).map((s) => ({
|
|
287
|
+
startFrame: Math.round(s.startMs / 1e3 * fps),
|
|
288
|
+
endFrame: Math.round(s.endMs / 1e3 * fps)
|
|
289
|
+
}));
|
|
290
|
+
}
|
|
291
|
+
function applyRoleDefaultGains(audioTracks, composition) {
|
|
292
|
+
let voPresent;
|
|
293
|
+
for (const track of composition.tracks) {
|
|
294
|
+
if (track.kind !== "audio" || track.enabled === false) continue;
|
|
295
|
+
for (const c of track.contents) {
|
|
296
|
+
if (!("source" in c)) continue;
|
|
297
|
+
const src = c.source;
|
|
298
|
+
if (src.kind !== "media") continue;
|
|
299
|
+
const role = src.audioRole;
|
|
300
|
+
if (!role) continue;
|
|
301
|
+
if (src.volumeDb !== void 0 || src.volume !== void 0) continue;
|
|
302
|
+
if (voPresent === void 0) voPresent = compositionHasVo(composition);
|
|
303
|
+
const gain = Math.pow(10, roleDefaultGainDb(role, voPresent) / 20);
|
|
304
|
+
for (const t of audioTracks) {
|
|
305
|
+
if (t.id === c.id || t.id.startsWith(`${c.id}#`)) t.volume = gain;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
function applyDuckEnvelopes(audioTracks, composition, fps) {
|
|
311
|
+
const captionSpansFrames = buildCaptionSpeechSpans(composition, fps);
|
|
312
|
+
for (const track of composition.tracks) {
|
|
313
|
+
if (track.kind !== "audio" || track.enabled === false) continue;
|
|
314
|
+
for (const c of track.contents) {
|
|
315
|
+
if (!("source" in c)) continue;
|
|
316
|
+
const src = c.source;
|
|
317
|
+
if (src.kind !== "media") continue;
|
|
318
|
+
const duck = src.duck;
|
|
319
|
+
const role = src.audioRole;
|
|
320
|
+
if (!duck || role !== "music" && role !== "vo") continue;
|
|
321
|
+
const absWindows = duck.windows && duck.windows.length > 0 ? duck.windows.map((w) => ({
|
|
322
|
+
startFrame: Math.round(w.startMs / 1e3 * fps),
|
|
323
|
+
endFrame: Math.round(w.endMs / 1e3 * fps)
|
|
324
|
+
})) : captionSpansFrames;
|
|
325
|
+
if (absWindows.length === 0) continue;
|
|
326
|
+
const duckVolume = Math.pow(10, duck.duckDb / 20);
|
|
327
|
+
const attackFrames = Math.max(0, Math.round(duck.attackMs / 1e3 * fps));
|
|
328
|
+
const releaseFrames = Math.max(0, Math.round(duck.releaseMs / 1e3 * fps));
|
|
329
|
+
for (const t of audioTracks) {
|
|
330
|
+
if (t.id !== c.id && !t.id.startsWith(`${c.id}#`)) continue;
|
|
331
|
+
const rel = [];
|
|
332
|
+
for (const w of absWindows) {
|
|
333
|
+
const s = Math.max(0, w.startFrame - t.startFrame);
|
|
334
|
+
const e = Math.min(t.durationInFrames, w.endFrame - t.startFrame);
|
|
335
|
+
if (e > s) rel.push({ startFrame: s, endFrame: e });
|
|
336
|
+
}
|
|
337
|
+
if (rel.length === 0) continue;
|
|
338
|
+
t.duckWindows = rel;
|
|
339
|
+
t.duckVolume = duckVolume;
|
|
340
|
+
t.duckAttackFrames = attackFrames;
|
|
341
|
+
t.duckReleaseFrames = releaseFrames;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
function bindBehindSubjectHosts(overlays, clips) {
|
|
347
|
+
const packedClips = clips.filter((clip) => clip.packedUrl !== void 0);
|
|
348
|
+
for (const overlay of overlays) {
|
|
349
|
+
if (overlay.zPlane !== "behind-subject") continue;
|
|
350
|
+
const overlayEnd = overlay.startFrame + overlay.durationInFrames;
|
|
351
|
+
const covering = packedClips.filter((clip) => {
|
|
352
|
+
const clipEnd = clip.timelineStartFrames + clip.durationInFrames;
|
|
353
|
+
return clip.timelineStartFrames <= overlay.startFrame && clipEnd >= overlayEnd;
|
|
354
|
+
});
|
|
355
|
+
if (covering.length === 1) {
|
|
356
|
+
overlay.hostClipId = covering[0].id;
|
|
357
|
+
continue;
|
|
358
|
+
}
|
|
359
|
+
const overlapping = packedClips.filter((clip) => {
|
|
360
|
+
const clipEnd = clip.timelineStartFrames + clip.durationInFrames;
|
|
361
|
+
return clip.timelineStartFrames < overlayEnd && clipEnd > overlay.startFrame;
|
|
362
|
+
});
|
|
363
|
+
const candidates = covering.length > 1 ? covering : overlapping;
|
|
364
|
+
const code = candidates.length > 1 ? "behind_subject_host_ambiguous" : "behind_subject_host_missing";
|
|
365
|
+
throw renderInputError(
|
|
366
|
+
code,
|
|
367
|
+
candidates.length > 1 ? `Behind-subject overlay '${overlay.id}' is covered by multiple packed clips (${candidates.map((clip) => clip.id).join(", ")}); host selection must be unambiguous.` : `Behind-subject overlay '${overlay.id}' is not fully covered by one packed clip; bake an exact matte for its host interval.`,
|
|
368
|
+
{
|
|
369
|
+
trackId: overlay.trackId,
|
|
370
|
+
clipId: overlay.id,
|
|
371
|
+
compositionPath: `composition.tracks[${overlay.trackId}]`,
|
|
372
|
+
candidateClipIds: candidates.map((clip) => clip.id)
|
|
373
|
+
}
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function assertBehindSubjectCaptionCoverage(captionSegments, clips, fps) {
|
|
378
|
+
const packed = clips.filter((clip) => clip.packedUrl !== void 0);
|
|
379
|
+
for (const segment of captionSegments ?? []) {
|
|
380
|
+
for (const word of segment) {
|
|
381
|
+
const startFrame = Math.round(word.startMs / 1e3 * fps);
|
|
382
|
+
const endFrame = Math.max(startFrame + 1, Math.round(word.endMs / 1e3 * fps));
|
|
383
|
+
const covering = packed.filter((clip) => {
|
|
384
|
+
const clipEnd = clip.timelineStartFrames + clip.durationInFrames;
|
|
385
|
+
return clip.timelineStartFrames <= startFrame && clipEnd >= endFrame;
|
|
386
|
+
});
|
|
387
|
+
if (covering.length === 1) continue;
|
|
388
|
+
const overlapping = packed.filter((clip) => {
|
|
389
|
+
const clipEnd = clip.timelineStartFrames + clip.durationInFrames;
|
|
390
|
+
return clip.timelineStartFrames < endFrame && clipEnd > startFrame;
|
|
391
|
+
});
|
|
392
|
+
const candidates = covering.length > 1 ? covering : overlapping;
|
|
393
|
+
const code = candidates.length > 1 ? "behind_subject_caption_host_ambiguous" : "behind_subject_caption_host_missing";
|
|
394
|
+
throw renderInputError(
|
|
395
|
+
code,
|
|
396
|
+
candidates.length > 1 ? `Behind-subject caption word '${word.text}' is covered by multiple packed clips (${candidates.map((clip) => clip.id).join(", ")}).` : `Behind-subject caption word '${word.text}' is not fully covered by one packed clip; an exact matte is required for its entire interval.`,
|
|
397
|
+
{ candidateClipIds: candidates.map((clip) => clip.id), startFrame, endFrame }
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
// ../execution/core/src/render/compositionRender.ts
|
|
404
|
+
function projectClipEffects(clip, renderClipId, identity) {
|
|
405
|
+
const effects = clip.effects;
|
|
406
|
+
if (!effects || effects.length === 0) return [];
|
|
407
|
+
return effects.map((e, idx) => ({
|
|
408
|
+
...identity,
|
|
409
|
+
id: `${renderClipId}::effect:${idx}`,
|
|
410
|
+
primitiveId: e.primitiveId,
|
|
411
|
+
params: e.params ?? {},
|
|
412
|
+
target: { kind: "clip", clipId: renderClipId }
|
|
413
|
+
}));
|
|
414
|
+
}
|
|
415
|
+
function visualIdentity(track, trackIndex, trackCount, contentIndex) {
|
|
416
|
+
return {
|
|
417
|
+
trackId: track.id,
|
|
418
|
+
trackIndex,
|
|
419
|
+
layerIndex: trackCount - trackIndex,
|
|
420
|
+
contentIndex
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function compositionFormatDimensions(format) {
|
|
424
|
+
const fps = format.fps ?? 30;
|
|
425
|
+
const resolution = format.resolution ?? "fhd";
|
|
426
|
+
const dims = {
|
|
427
|
+
"9:16": {
|
|
428
|
+
hd: { width: 720, height: 1280 },
|
|
429
|
+
fhd: { width: 1080, height: 1920 },
|
|
430
|
+
"4k": { width: 2160, height: 3840 }
|
|
431
|
+
},
|
|
432
|
+
"1:1": {
|
|
433
|
+
hd: { width: 720, height: 720 },
|
|
434
|
+
fhd: { width: 1080, height: 1080 },
|
|
435
|
+
"4k": { width: 2160, height: 2160 }
|
|
436
|
+
},
|
|
437
|
+
"4:5": {
|
|
438
|
+
hd: { width: 720, height: 900 },
|
|
439
|
+
fhd: { width: 1080, height: 1350 },
|
|
440
|
+
"4k": { width: 2160, height: 2700 }
|
|
441
|
+
},
|
|
442
|
+
"16:9": {
|
|
443
|
+
hd: { width: 1280, height: 720 },
|
|
444
|
+
fhd: { width: 1920, height: 1080 },
|
|
445
|
+
"4k": { width: 3840, height: 2160 }
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
return { ...dims[format.aspectRatio][resolution], fps };
|
|
449
|
+
}
|
|
273
450
|
function frames(seconds, fps) {
|
|
274
451
|
return Math.max(0, Math.round(seconds * fps));
|
|
275
452
|
}
|
|
@@ -299,11 +476,13 @@ function overlayTransitionFields(c, fps) {
|
|
|
299
476
|
function rendersNoFrames(c) {
|
|
300
477
|
return !(c.duration > 0);
|
|
301
478
|
}
|
|
302
|
-
function resolveSrcUrl(mediaId, srcUrls) {
|
|
479
|
+
function resolveSrcUrl(mediaId, srcUrls, locator) {
|
|
303
480
|
const url = srcUrls[mediaId];
|
|
304
481
|
if (!url) {
|
|
305
|
-
throw
|
|
306
|
-
|
|
482
|
+
throw renderInputError(
|
|
483
|
+
"source_media_not_found",
|
|
484
|
+
`Composition references mediaId '${mediaId}' but no presigned URL was supplied. Pre-sign every unique mediaId before calling compositionToRenderInput.`,
|
|
485
|
+
{ ...locator, mediaId }
|
|
307
486
|
);
|
|
308
487
|
}
|
|
309
488
|
return url;
|
|
@@ -321,7 +500,7 @@ function playableSpans(trimStart, trimEnd, excluded) {
|
|
|
321
500
|
if (cursor < trimEnd) out.push({ start: cursor, end: trimEnd });
|
|
322
501
|
return out;
|
|
323
502
|
}
|
|
324
|
-
function projectMediaTrack(track, fps, srcUrls, trajectoryUrls, coViewUrls, trajectories) {
|
|
503
|
+
function projectMediaTrack(track, trackIndex, trackCount, fps, srcUrls, trajectoryUrls, coViewUrls, trajectories) {
|
|
325
504
|
const clips = [];
|
|
326
505
|
const audio = [];
|
|
327
506
|
const effects = [];
|
|
@@ -329,15 +508,38 @@ function projectMediaTrack(track, fps, srcUrls, trajectoryUrls, coViewUrls, traj
|
|
|
329
508
|
const c = track.contents[i];
|
|
330
509
|
if (!("source" in c) || !c.source) continue;
|
|
331
510
|
if (c.source.kind !== "media") {
|
|
332
|
-
throw
|
|
333
|
-
|
|
511
|
+
throw renderInputError(
|
|
512
|
+
"clip_source_track_mismatch",
|
|
513
|
+
`composition.tracks[${track.id}].contents[${i}]: kind=${c.source.kind} is invalid on a ${track.kind} track (expected 'media')`,
|
|
514
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].source` }
|
|
334
515
|
);
|
|
335
516
|
}
|
|
336
517
|
if (rendersNoFrames(c)) continue;
|
|
337
|
-
const src = resolveSrcUrl(c.source.mediaId, srcUrls
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
518
|
+
const src = resolveSrcUrl(c.source.mediaId, srcUrls, {
|
|
519
|
+
trackId: track.id,
|
|
520
|
+
clipId: c.id,
|
|
521
|
+
compositionPath: `composition.tracks[${track.id}].contents[${i}].source.mediaId`
|
|
522
|
+
});
|
|
523
|
+
const packedUrl = coViewUrls?.[c.id];
|
|
524
|
+
const packedEnvelopeFields = packedUrl === void 0 ? [] : [
|
|
525
|
+
c.region !== void 0 && !(c.region.x === 0 && c.region.y === 0 && c.region.w === 1 && c.region.h === 1) ? "region" : null,
|
|
526
|
+
c.fit !== void 0 && c.fit !== "cover" ? "fit" : null,
|
|
527
|
+
c.opacity !== void 0 && c.opacity !== 1 ? "opacity" : null,
|
|
528
|
+
c.scale !== void 0 && c.scale !== 1 ? "scale" : null,
|
|
529
|
+
c.rotation !== void 0 && c.rotation !== 0 ? "rotation" : null,
|
|
530
|
+
c.animate !== void 0 ? "animate" : null,
|
|
531
|
+
c.transitionIn !== void 0 && c.transitionIn.type !== "none" && c.transitionIn.type !== "cut" ? "transitionIn" : null
|
|
532
|
+
].filter((field) => field !== null);
|
|
533
|
+
if (packedEnvelopeFields.length > 0) {
|
|
534
|
+
throw renderInputError(
|
|
535
|
+
"packed_visual_envelope_unsupported",
|
|
536
|
+
`composition.tracks[${track.id}].contents[${i}] (clip ${c.id}): the packed co-view render path cannot yet preserve ${packedEnvelopeFields.join(", ")}. Remove those fields or render without behind-subject depth; ignoring them would produce false evidence.`,
|
|
537
|
+
{
|
|
538
|
+
trackId: track.id,
|
|
539
|
+
clipId: c.id,
|
|
540
|
+
compositionPath: `composition.tracks[${track.id}].contents[${i}]`,
|
|
541
|
+
fields: packedEnvelopeFields
|
|
542
|
+
}
|
|
341
543
|
);
|
|
342
544
|
}
|
|
343
545
|
if (track.kind === "audio") {
|
|
@@ -389,7 +591,9 @@ function projectMediaTrack(track, fps, srcUrls, trajectoryUrls, coViewUrls, traj
|
|
|
389
591
|
const subId = spans.length === 1 ? c.id : `${c.id}#${s}`;
|
|
390
592
|
if (firstEmittedSubId === void 0) firstEmittedSubId = subId;
|
|
391
593
|
clips.push({
|
|
594
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
392
595
|
id: subId,
|
|
596
|
+
...spans.length > 1 ? { parentId: c.id } : {},
|
|
393
597
|
src,
|
|
394
598
|
sourceInFrames,
|
|
395
599
|
sourceOutFrames: sourceInFrames + subDurationFrames,
|
|
@@ -412,44 +616,38 @@ function projectMediaTrack(track, fps, srcUrls, trajectoryUrls, coViewUrls, traj
|
|
|
412
616
|
} : {},
|
|
413
617
|
...trajectoryUrls?.[c.id] !== void 0 ? { cropTrajectoryUrl: trajectoryUrls[c.id] } : {},
|
|
414
618
|
...trajectories?.[c.id] !== void 0 ? { cropTrajectory: trajectories[c.id] } : {},
|
|
415
|
-
...
|
|
619
|
+
...packedUrl !== void 0 ? { packedUrl } : {}
|
|
416
620
|
});
|
|
417
621
|
}
|
|
418
622
|
if (firstEmittedSubId !== void 0) {
|
|
419
|
-
effects.push(...projectClipEffects(
|
|
623
|
+
effects.push(...projectClipEffects(
|
|
624
|
+
c,
|
|
625
|
+
firstEmittedSubId,
|
|
626
|
+
visualIdentity(track, trackIndex, trackCount, i)
|
|
627
|
+
));
|
|
420
628
|
}
|
|
421
629
|
}
|
|
422
|
-
for (let i = 1; i < clips.length; i++) {
|
|
423
|
-
const prev = clips[i - 1];
|
|
424
|
-
const cur = clips[i];
|
|
425
|
-
if (prev.src !== cur.src) continue;
|
|
426
|
-
if ((prev.playbackRate ?? 1) !== (cur.playbackRate ?? 1)) continue;
|
|
427
|
-
if (JSON.stringify(prev.region) !== JSON.stringify(cur.region)) continue;
|
|
428
|
-
if ((prev.fit ?? "cover") !== (cur.fit ?? "cover")) continue;
|
|
429
|
-
if (prev.cropTrajectoryUrl !== cur.cropTrajectoryUrl) continue;
|
|
430
|
-
if (prev.cropTrajectory !== cur.cropTrajectory) continue;
|
|
431
|
-
if ((prev.trimStartFrames ?? 0) !== (cur.trimStartFrames ?? 0)) continue;
|
|
432
|
-
const prevEnd = prev.timelineStartFrames + prev.durationInFrames;
|
|
433
|
-
if (Math.abs(prevEnd - cur.timelineStartFrames) > 1) continue;
|
|
434
|
-
const parent = prev.parentId ?? prev.id;
|
|
435
|
-
cur.parentId = parent;
|
|
436
|
-
if (prev.parentId === void 0) prev.parentId = parent;
|
|
437
|
-
}
|
|
438
630
|
return { clips, audio, effects };
|
|
439
631
|
}
|
|
440
|
-
function projectImageTrack(track, fps, srcUrls) {
|
|
632
|
+
function projectImageTrack(track, trackIndex, trackCount, fps, srcUrls) {
|
|
441
633
|
const clips = [];
|
|
442
634
|
const effects = [];
|
|
443
635
|
for (let i = 0; i < track.contents.length; i++) {
|
|
444
636
|
const c = track.contents[i];
|
|
445
637
|
if (!("source" in c) || !c.source) continue;
|
|
446
638
|
if (c.source.kind !== "media") {
|
|
447
|
-
throw
|
|
448
|
-
|
|
639
|
+
throw renderInputError(
|
|
640
|
+
"clip_source_track_mismatch",
|
|
641
|
+
`composition.tracks[${track.id}].contents[${i}]: kind=${c.source.kind} is invalid on an image track (expected 'media')`,
|
|
642
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].source` }
|
|
449
643
|
);
|
|
450
644
|
}
|
|
451
645
|
if (rendersNoFrames(c)) continue;
|
|
452
|
-
const src = resolveSrcUrl(c.source.mediaId, srcUrls
|
|
646
|
+
const src = resolveSrcUrl(c.source.mediaId, srcUrls, {
|
|
647
|
+
trackId: track.id,
|
|
648
|
+
clipId: c.id,
|
|
649
|
+
compositionPath: `composition.tracks[${track.id}].contents[${i}].source.mediaId`
|
|
650
|
+
});
|
|
453
651
|
const { startFrame: timelineStartFrames, durationInFrames } = timelineSpanFrames(
|
|
454
652
|
c.startTime,
|
|
455
653
|
c.startTime + c.duration,
|
|
@@ -457,6 +655,7 @@ function projectImageTrack(track, fps, srcUrls) {
|
|
|
457
655
|
);
|
|
458
656
|
if (durationInFrames === 0) continue;
|
|
459
657
|
clips.push({
|
|
658
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
460
659
|
id: c.id,
|
|
461
660
|
src,
|
|
462
661
|
sourceInFrames: 0,
|
|
@@ -473,7 +672,11 @@ function projectImageTrack(track, fps, srcUrls) {
|
|
|
473
672
|
...c.region !== void 0 ? { region: c.region } : {},
|
|
474
673
|
...c.fit !== void 0 ? { fit: c.fit } : {}
|
|
475
674
|
});
|
|
476
|
-
effects.push(...projectClipEffects(
|
|
675
|
+
effects.push(...projectClipEffects(
|
|
676
|
+
c,
|
|
677
|
+
c.id,
|
|
678
|
+
visualIdentity(track, trackIndex, trackCount, i)
|
|
679
|
+
));
|
|
477
680
|
}
|
|
478
681
|
return { clips, effects };
|
|
479
682
|
}
|
|
@@ -487,11 +690,18 @@ function clipTransformChannel(c) {
|
|
|
487
690
|
...c.animate !== void 0 ? { animate: c.animate } : {}
|
|
488
691
|
};
|
|
489
692
|
}
|
|
490
|
-
function projectOverlayTrack(track,
|
|
693
|
+
function projectOverlayTrack(track, trackIndex, trackCount, fps, alphaUrls = {}) {
|
|
491
694
|
const overlays = [];
|
|
492
695
|
for (let i = 0; i < track.contents.length; i++) {
|
|
493
696
|
const c = track.contents[i];
|
|
494
697
|
if (!("source" in c) || !c.source) continue;
|
|
698
|
+
if (c.effects && c.effects.length > 0) {
|
|
699
|
+
throw renderInputError(
|
|
700
|
+
"clip_effect_scope_unsupported",
|
|
701
|
+
`Overlay clip '${c.id}' has clip effects that cannot yet preserve the overlay alpha/region envelope. Move the effect to an effect track or remove it.`,
|
|
702
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].effects` }
|
|
703
|
+
);
|
|
704
|
+
}
|
|
495
705
|
if (c.source.kind === "alpha-layer") {
|
|
496
706
|
const { startFrame: startFrame2, durationInFrames: durationInFrames2 } = timelineSpanFrames(
|
|
497
707
|
c.startTime,
|
|
@@ -501,11 +711,19 @@ function projectOverlayTrack(track, fps, alphaUrls = {}, jsSourceByClipId = {})
|
|
|
501
711
|
if (durationInFrames2 === 0) continue;
|
|
502
712
|
const src = alphaUrls[c.id];
|
|
503
713
|
if (!src) {
|
|
504
|
-
throw
|
|
505
|
-
|
|
714
|
+
throw renderInputError(
|
|
715
|
+
"variant_not_baked",
|
|
716
|
+
`composition.tracks[${track.id}].contents[${i}]: alpha-layer clip ${c.id} has no baked alpha (alphaUrls[${c.id}] missing) \u2014 bake before render`,
|
|
717
|
+
{
|
|
718
|
+
trackId: track.id,
|
|
719
|
+
clipId: c.id,
|
|
720
|
+
componentId: c.source.componentId,
|
|
721
|
+
compositionPath: `composition.tracks[${track.id}].contents[${i}].source`
|
|
722
|
+
}
|
|
506
723
|
);
|
|
507
724
|
}
|
|
508
725
|
overlays.push({
|
|
726
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
509
727
|
id: c.id,
|
|
510
728
|
template: "alpha-layer",
|
|
511
729
|
startFrame: startFrame2,
|
|
@@ -527,6 +745,7 @@ function projectOverlayTrack(track, fps, alphaUrls = {}, jsSourceByClipId = {})
|
|
|
527
745
|
);
|
|
528
746
|
if (durationInFrames2 === 0) continue;
|
|
529
747
|
overlays.push({
|
|
748
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
530
749
|
id: c.id,
|
|
531
750
|
template: "card",
|
|
532
751
|
startFrame: startFrame2,
|
|
@@ -544,8 +763,10 @@ function projectOverlayTrack(track, fps, alphaUrls = {}, jsSourceByClipId = {})
|
|
|
544
763
|
continue;
|
|
545
764
|
}
|
|
546
765
|
if (c.source.kind !== "overlay") {
|
|
547
|
-
throw
|
|
548
|
-
|
|
766
|
+
throw renderInputError(
|
|
767
|
+
"clip_source_track_mismatch",
|
|
768
|
+
`composition.tracks[${track.id}].contents[${i}]: kind=${c.source.kind} is invalid on an overlay track (expected 'overlay', 'alpha-layer', or 'card')`,
|
|
769
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].source` }
|
|
549
770
|
);
|
|
550
771
|
}
|
|
551
772
|
const { startFrame, durationInFrames } = timelineSpanFrames(
|
|
@@ -556,19 +777,14 @@ function projectOverlayTrack(track, fps, alphaUrls = {}, jsSourceByClipId = {})
|
|
|
556
777
|
if (durationInFrames === 0) continue;
|
|
557
778
|
let overlayParams = c.source.params ?? {};
|
|
558
779
|
if (c.source.primitiveId === "custom") {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
const { componentId: _cid, sourceCode: _sc, ...props } = overlayParams;
|
|
567
|
-
void _cid;
|
|
568
|
-
void _sc;
|
|
569
|
-
overlayParams = { sourceCode: sc, ...props };
|
|
780
|
+
throw renderInputError(
|
|
781
|
+
"invalid_composition",
|
|
782
|
+
`composition.tracks[${track.id}].contents[${i}].source: custom overlays must be baked to a verified alpha-layer before rendering`,
|
|
783
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].source` }
|
|
784
|
+
);
|
|
570
785
|
}
|
|
571
786
|
overlays.push({
|
|
787
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
572
788
|
id: c.id,
|
|
573
789
|
template: c.source.primitiveId,
|
|
574
790
|
startFrame,
|
|
@@ -585,14 +801,16 @@ function projectOverlayTrack(track, fps, alphaUrls = {}, jsSourceByClipId = {})
|
|
|
585
801
|
}
|
|
586
802
|
return overlays;
|
|
587
803
|
}
|
|
588
|
-
function projectEffectTrack(track, fps) {
|
|
804
|
+
function projectEffectTrack(track, trackIndex, trackCount, fps) {
|
|
589
805
|
const effects = [];
|
|
590
806
|
for (let i = 0; i < track.contents.length; i++) {
|
|
591
807
|
const c = track.contents[i];
|
|
592
808
|
if (!("source" in c) || !c.source) continue;
|
|
593
809
|
if (c.source.kind !== "effect") {
|
|
594
|
-
throw
|
|
595
|
-
|
|
810
|
+
throw renderInputError(
|
|
811
|
+
"clip_source_track_mismatch",
|
|
812
|
+
`composition.tracks[${track.id}].contents[${i}]: kind=${c.source.kind} is invalid on an effect track (expected 'effect')`,
|
|
813
|
+
{ trackId: track.id, clipId: c.id, compositionPath: `composition.tracks[${track.id}].contents[${i}].source` }
|
|
596
814
|
);
|
|
597
815
|
}
|
|
598
816
|
const { startFrame, durationInFrames } = timelineSpanFrames(
|
|
@@ -602,6 +820,7 @@ function projectEffectTrack(track, fps) {
|
|
|
602
820
|
);
|
|
603
821
|
if (durationInFrames === 0) continue;
|
|
604
822
|
effects.push({
|
|
823
|
+
...visualIdentity(track, trackIndex, trackCount, i),
|
|
605
824
|
id: c.id,
|
|
606
825
|
primitiveId: c.source.primitiveId,
|
|
607
826
|
params: c.source.params ?? {},
|
|
@@ -612,83 +831,6 @@ function projectEffectTrack(track, fps) {
|
|
|
612
831
|
}
|
|
613
832
|
return effects;
|
|
614
833
|
}
|
|
615
|
-
function buildCaptionSpeechSpans(composition, fps) {
|
|
616
|
-
const words = (composition.captions?.segments ?? []).flatMap((seg) => seg.words).filter((w) => w.endMs > w.startMs).sort((a, b) => a.startMs - b.startMs);
|
|
617
|
-
if (words.length === 0) return [];
|
|
618
|
-
const MERGE_GAP_MS = 300;
|
|
619
|
-
const MIN_SPAN_MS = 200;
|
|
620
|
-
const spans = [];
|
|
621
|
-
let cur = { startMs: words[0].startMs, endMs: words[0].endMs };
|
|
622
|
-
for (let i = 1; i < words.length; i++) {
|
|
623
|
-
const w = words[i];
|
|
624
|
-
if (w.startMs - cur.endMs < MERGE_GAP_MS) {
|
|
625
|
-
if (w.endMs > cur.endMs) cur.endMs = w.endMs;
|
|
626
|
-
} else {
|
|
627
|
-
spans.push(cur);
|
|
628
|
-
cur = { startMs: w.startMs, endMs: w.endMs };
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
spans.push(cur);
|
|
632
|
-
return spans.filter((s) => s.endMs - s.startMs >= MIN_SPAN_MS).map((s) => ({
|
|
633
|
-
startFrame: Math.round(s.startMs / 1e3 * fps),
|
|
634
|
-
endFrame: Math.round(s.endMs / 1e3 * fps)
|
|
635
|
-
}));
|
|
636
|
-
}
|
|
637
|
-
function applyRoleDefaultGains(audioTracks, composition) {
|
|
638
|
-
let voPresent;
|
|
639
|
-
for (const track of composition.tracks) {
|
|
640
|
-
if (track.kind !== "audio" || track.enabled === false) continue;
|
|
641
|
-
for (const c of track.contents) {
|
|
642
|
-
if (!("source" in c)) continue;
|
|
643
|
-
const src = c.source;
|
|
644
|
-
if (src.kind !== "media") continue;
|
|
645
|
-
const role = src.audioRole;
|
|
646
|
-
if (!role) continue;
|
|
647
|
-
if (src.volumeDb !== void 0 || src.volume !== void 0) continue;
|
|
648
|
-
if (voPresent === void 0) voPresent = compositionHasVo(composition);
|
|
649
|
-
const gain = Math.pow(10, roleDefaultGainDb(role, voPresent) / 20);
|
|
650
|
-
for (const t of audioTracks) {
|
|
651
|
-
if (t.id === c.id || t.id.startsWith(`${c.id}#`)) t.volume = gain;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
function applyDuckEnvelopes(audioTracks, composition, fps) {
|
|
657
|
-
const captionSpansFrames = buildCaptionSpeechSpans(composition, fps);
|
|
658
|
-
for (const track of composition.tracks) {
|
|
659
|
-
if (track.kind !== "audio" || track.enabled === false) continue;
|
|
660
|
-
for (const c of track.contents) {
|
|
661
|
-
if (!("source" in c)) continue;
|
|
662
|
-
const src = c.source;
|
|
663
|
-
if (src.kind !== "media") continue;
|
|
664
|
-
const duck = src.duck;
|
|
665
|
-
const role = src.audioRole;
|
|
666
|
-
if (!duck || role !== "music" && role !== "vo") continue;
|
|
667
|
-
const absWindows = duck.windows && duck.windows.length > 0 ? duck.windows.map((w) => ({
|
|
668
|
-
startFrame: Math.round(w.startMs / 1e3 * fps),
|
|
669
|
-
endFrame: Math.round(w.endMs / 1e3 * fps)
|
|
670
|
-
})) : captionSpansFrames;
|
|
671
|
-
if (absWindows.length === 0) continue;
|
|
672
|
-
const duckVolume = Math.pow(10, duck.duckDb / 20);
|
|
673
|
-
const attackFrames = Math.max(0, Math.round(duck.attackMs / 1e3 * fps));
|
|
674
|
-
const releaseFrames = Math.max(0, Math.round(duck.releaseMs / 1e3 * fps));
|
|
675
|
-
for (const t of audioTracks) {
|
|
676
|
-
if (t.id !== c.id && !t.id.startsWith(`${c.id}#`)) continue;
|
|
677
|
-
const rel = [];
|
|
678
|
-
for (const w of absWindows) {
|
|
679
|
-
const s = Math.max(0, w.startFrame - t.startFrame);
|
|
680
|
-
const e = Math.min(t.durationInFrames, w.endFrame - t.startFrame);
|
|
681
|
-
if (e > s) rel.push({ startFrame: s, endFrame: e });
|
|
682
|
-
}
|
|
683
|
-
if (rel.length === 0) continue;
|
|
684
|
-
t.duckWindows = rel;
|
|
685
|
-
t.duckVolume = duckVolume;
|
|
686
|
-
t.duckAttackFrames = attackFrames;
|
|
687
|
-
t.duckReleaseFrames = releaseFrames;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
834
|
function referencedMediaIds(composition) {
|
|
693
835
|
const ids = /* @__PURE__ */ new Set();
|
|
694
836
|
for (const track of composition.tracks) {
|
|
@@ -701,24 +843,7 @@ function referencedMediaIds(composition) {
|
|
|
701
843
|
}
|
|
702
844
|
return [...ids];
|
|
703
845
|
}
|
|
704
|
-
function
|
|
705
|
-
const refs = {};
|
|
706
|
-
for (const track of composition.tracks) {
|
|
707
|
-
if (track.kind !== "overlay") continue;
|
|
708
|
-
for (const c of track.contents) {
|
|
709
|
-
if (!("source" in c) || !c.source) continue;
|
|
710
|
-
const src = c.source;
|
|
711
|
-
if (src.kind !== "overlay" || src.primitiveId !== "custom") continue;
|
|
712
|
-
const params = src.params ?? {};
|
|
713
|
-
if (typeof params.sourceCode === "string" && params.sourceCode.length > 0) continue;
|
|
714
|
-
if (typeof params.componentId === "string" && params.componentId.length > 0) {
|
|
715
|
-
refs[c.id] = params.componentId;
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
}
|
|
719
|
-
return refs;
|
|
720
|
-
}
|
|
721
|
-
function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUrls, alphaUrls, jsSourceByClipId, subCompositions, trajectories) {
|
|
846
|
+
function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUrls, alphaUrls, subCompositions, trajectories) {
|
|
722
847
|
const flattened = hasCompoundClips(composition) ? flattenCompoundClips(composition, (id) => subCompositions?.[id]) : composition;
|
|
723
848
|
composition = flattened;
|
|
724
849
|
const { width, height, fps } = compositionFormatDimensions(composition.format);
|
|
@@ -726,23 +851,46 @@ function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUr
|
|
|
726
851
|
const overlays = [];
|
|
727
852
|
const audioTracks = [];
|
|
728
853
|
const effects = [];
|
|
729
|
-
|
|
854
|
+
const trackCount = composition.tracks.length;
|
|
855
|
+
for (const [trackIndex, track] of composition.tracks.entries()) {
|
|
730
856
|
if (track.enabled === false) continue;
|
|
731
857
|
if (track.kind === "video" || track.kind === "audio") {
|
|
732
|
-
const { clips: c, audio, effects: clipEffects } = projectMediaTrack(
|
|
858
|
+
const { clips: c, audio, effects: clipEffects } = projectMediaTrack(
|
|
859
|
+
track,
|
|
860
|
+
trackIndex,
|
|
861
|
+
trackCount,
|
|
862
|
+
fps,
|
|
863
|
+
srcUrls,
|
|
864
|
+
trajectoryUrls,
|
|
865
|
+
coViewUrls,
|
|
866
|
+
trajectories
|
|
867
|
+
);
|
|
733
868
|
clips.push(...c);
|
|
734
869
|
audioTracks.push(...audio);
|
|
735
870
|
effects.push(...clipEffects);
|
|
736
871
|
} else if (track.kind === "image") {
|
|
737
|
-
const { clips: c, effects: clipEffects } = projectImageTrack(
|
|
872
|
+
const { clips: c, effects: clipEffects } = projectImageTrack(
|
|
873
|
+
track,
|
|
874
|
+
trackIndex,
|
|
875
|
+
trackCount,
|
|
876
|
+
fps,
|
|
877
|
+
srcUrls
|
|
878
|
+
);
|
|
738
879
|
clips.push(...c);
|
|
739
880
|
effects.push(...clipEffects);
|
|
740
881
|
} else if (track.kind === "overlay") {
|
|
741
|
-
overlays.push(...projectOverlayTrack(
|
|
882
|
+
overlays.push(...projectOverlayTrack(
|
|
883
|
+
track,
|
|
884
|
+
trackIndex,
|
|
885
|
+
trackCount,
|
|
886
|
+
fps,
|
|
887
|
+
alphaUrls ?? {}
|
|
888
|
+
));
|
|
742
889
|
} else if (track.kind === "effect") {
|
|
743
|
-
effects.push(...projectEffectTrack(track, fps));
|
|
890
|
+
effects.push(...projectEffectTrack(track, trackIndex, trackCount, fps));
|
|
744
891
|
}
|
|
745
892
|
}
|
|
893
|
+
bindBehindSubjectHosts(overlays, clips);
|
|
746
894
|
if (audioTracks.length > 0) {
|
|
747
895
|
applyRoleDefaultGains(audioTracks, composition);
|
|
748
896
|
}
|
|
@@ -773,6 +921,9 @@ function compositionToRenderInput(composition, srcUrls, trajectoryUrls, coViewUr
|
|
|
773
921
|
}
|
|
774
922
|
const bodyDurationInFrames = maxBackgroundEndFrames > 0 ? Math.min(maxEndFrames, maxBackgroundEndFrames) : maxEndFrames;
|
|
775
923
|
const captionSegments = composition.captions?.segments.map((seg) => seg.words).filter((words) => words.length > 0);
|
|
924
|
+
if (composition.captions?.zPlane === "behind-subject") {
|
|
925
|
+
assertBehindSubjectCaptionCoverage(captionSegments, clips, fps);
|
|
926
|
+
}
|
|
776
927
|
const brandKit = composition.brandKit;
|
|
777
928
|
const { totalFrames: durationInFrames } = resolveBookendTimeline(
|
|
778
929
|
brandKit,
|
|
@@ -838,8 +989,7 @@ function assembleRenderInput(composition, resolved) {
|
|
|
838
989
|
resolved.srcUrls,
|
|
839
990
|
resolved.trajectoryUrls ?? {},
|
|
840
991
|
resolved.coViewUrls ?? {},
|
|
841
|
-
resolved.alphaUrls ?? {}
|
|
842
|
-
resolved.jsSourceByClipId ?? {}
|
|
992
|
+
resolved.alphaUrls ?? {}
|
|
843
993
|
);
|
|
844
994
|
if (renderInput.brandKit && resolved.fontAssets && resolved.fontAssets.length > 0) {
|
|
845
995
|
renderInput.brandKit.fontAssets = resolved.fontAssets;
|
|
@@ -1824,11 +1974,11 @@ export {
|
|
|
1824
1974
|
VIDEO_BOOKEND_DEFAULT_MS,
|
|
1825
1975
|
bookendFrames,
|
|
1826
1976
|
resolveBookendTimeline,
|
|
1827
|
-
compositionFormatDimensions,
|
|
1828
1977
|
validateComposition,
|
|
1978
|
+
assertBehindSubjectCaptionCoverage,
|
|
1979
|
+
compositionFormatDimensions,
|
|
1829
1980
|
playableSpans,
|
|
1830
1981
|
referencedMediaIds,
|
|
1831
|
-
componentRefsByClipId,
|
|
1832
1982
|
compositionToRenderInput,
|
|
1833
1983
|
assembleRenderInput,
|
|
1834
1984
|
DEFAULT_FPS,
|