@cueframe/kernel 0.2.57 → 0.2.59-rc.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/THIRD_PARTY_NOTICES.md +111 -0
- package/dist/_members/account-model/testing/conversationStoreContract.d.ts +3 -4
- package/dist/_members/account-model/testing/restorePointStoreContract.d.ts +3 -4
- package/dist/_members/account-model/validators/index.d.ts +0 -1
- package/dist/_members/animate/index.d.ts +0 -2
- package/dist/_members/authoring/index.d.ts +1 -1
- package/dist/_members/authoring/prompts/index.d.ts +0 -1
- package/dist/_members/authoring/resources.d.ts +2 -11
- package/dist/_members/cloud-import/CloudImportService.d.ts +0 -1
- package/dist/_members/cloud-import/index.d.ts +0 -2
- package/dist/_members/component-runtime/allowedImports.d.ts +6 -0
- package/dist/_members/component-runtime/allowedImports.d.ts.map +1 -1
- package/dist/_members/component-runtime/browserIdentity.d.ts +2 -12
- package/dist/_members/component-runtime/browserIdentity.d.ts.map +1 -1
- package/dist/_members/component-runtime/canonicalIdentity.d.ts +8 -1
- package/dist/_members/component-runtime/canonicalIdentity.d.ts.map +1 -1
- package/dist/_members/component-runtime/contracts.d.ts +2 -1
- package/dist/_members/component-runtime/contracts.d.ts.map +1 -1
- package/dist/_members/component-runtime/identity.d.ts +2 -3
- package/dist/_members/component-runtime/identity.d.ts.map +1 -1
- package/dist/_members/component-runtime/importPolicy.d.ts +5 -0
- package/dist/_members/component-runtime/importPolicy.d.ts.map +1 -1
- package/dist/_members/component-runtime/template/bind.d.ts +22 -0
- package/dist/_members/component-runtime/template/bind.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/checks.d.ts +71 -0
- package/dist/_members/component-runtime/template/checks.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/extract.d.ts +35 -0
- package/dist/_members/component-runtime/template/extract.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/index.d.ts +6 -0
- package/dist/_members/component-runtime/template/index.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/schema.d.ts +1581 -0
- package/dist/_members/component-runtime/template/schema.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/testing/fixtures.d.ts +33 -0
- package/dist/_members/component-runtime/template/testing/fixtures.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/testing/index.d.ts +3 -0
- package/dist/_members/component-runtime/template/testing/index.d.ts.map +1 -0
- package/dist/_members/component-runtime/template/testing/templateApplyContract.d.ts +53 -0
- package/dist/_members/component-runtime/template/testing/templateApplyContract.d.ts.map +1 -0
- package/dist/_members/component-runtime/testing/sourcePolicyCases.d.ts +15 -0
- package/dist/_members/component-runtime/testing/sourcePolicyCases.d.ts.map +1 -0
- package/dist/_members/component-runtime/webglProbe.d.ts.map +1 -1
- package/dist/_members/compose/index.d.ts +1 -1
- package/dist/_members/compose/primitiveRegistry.d.ts +0 -2
- package/dist/_members/composition/audio/audioMix.d.ts +0 -1
- package/dist/_members/composition/audio/mixStaging.d.ts +0 -5
- package/dist/_members/composition/fixtures/index.d.ts +0 -1
- package/dist/_members/composition/graphics-plan/index.d.ts +0 -2
- package/dist/_members/composition/graphics-plan/schemas.d.ts +4 -4
- package/dist/_members/composition/invariants/etag.d.ts +0 -1
- package/dist/_members/composition/invariants/index.d.ts +0 -1
- package/dist/_members/composition/ops/compositionOps.d.ts +0 -1
- package/dist/_members/composition/ops/compositionOps.shared.d.ts +6 -0
- package/dist/_members/composition/ops/index.d.ts +2 -1
- package/dist/_members/composition/primitive-catalog/index.d.ts +2 -3
- package/dist/_members/composition/primitive-catalog/types.d.ts +3 -1
- package/dist/_members/composition/projection/behind-readiness.d.ts +0 -6
- package/dist/_members/composition/timeline/link.d.ts +0 -4
- package/dist/_members/composition/timeline/plan.d.ts +0 -1
- package/dist/_members/composition/validators/brandKit.d.ts +11 -4
- package/dist/_members/composition/validators/brandKitBody.d.ts +543 -0
- package/dist/_members/composition/validators/cardHtml.d.ts +11 -0
- package/dist/_members/composition/validators/composition.d.ts +2 -5
- package/dist/_members/composition/validators/css-tree-subpaths.d.ts +16 -0
- package/dist/_members/composition/validators/index.d.ts +0 -3
- package/dist/_members/composition/validators/session.d.ts +3 -3
- package/dist/_members/composition/validators/webhook.d.ts +4 -4
- package/dist/_members/composition-ops/alphaLayers.d.ts +0 -5
- package/dist/_members/composition-ops/index.d.ts +2 -2
- package/dist/_members/composition-ops/opRecorder.d.ts +23 -3
- package/dist/_members/core/render/exportSettings.d.ts +4 -2
- package/dist/_members/core/render/index.d.ts +1 -1
- package/dist/_members/core/render/vcam/requiredRegion.d.ts +0 -1
- package/dist/_members/director/ai-sdk/index.d.ts +0 -1
- package/dist/_members/director/ai-sdk/messages.d.ts +0 -1
- package/dist/_members/director/domain/chat.d.ts +0 -78
- package/dist/_members/director/domain/index.d.ts +0 -1
- package/dist/_members/errors/registry.d.ts +42 -0
- package/dist/_members/foundation/canonical/index.d.ts +14 -0
- package/dist/_members/foundation/index.d.ts +1 -1
- package/dist/_members/foundation/primitives/index.d.ts +0 -2
- package/dist/_members/foundation/testing/index.d.ts +1 -0
- package/dist/_members/foundation/testing/knownRed.d.ts +13 -0
- package/dist/_members/mcp/adapter.d.ts +21 -0
- package/dist/_members/mcp/compositionOps.d.ts +10 -0
- package/dist/_members/mcp/server.d.ts +0 -2
- package/dist/_members/mcp/wait.d.ts +3 -1
- package/dist/_members/media-model/generation.d.ts +0 -25
- package/dist/_members/nle-export/xml-utils.d.ts +0 -8
- package/dist/_members/plane/conformance.d.ts +20 -0
- package/dist/_members/primitives/backgrounds/dynamic-grid/config.d.ts +1 -1
- package/dist/_members/primitives/effects/blur/config.d.ts +1 -1
- package/dist/_members/primitives/effects/color-grade/config.d.ts +2 -2
- package/dist/_members/primitives/effects/grain/config.d.ts +3 -3
- package/dist/_members/primitives/effects/particles/config.d.ts +2 -2
- package/dist/_members/primitives/effects/stage-camera/config.d.ts +6 -6
- package/dist/_members/primitives/effects/vignette/config.d.ts +1 -1
- package/dist/_members/primitives/index.d.ts +1 -11
- package/dist/_members/primitives/layouts/flex-layout/config.d.ts +3 -3
- package/dist/_members/primitives/layouts/picture-in-picture/config.d.ts +2 -2
- package/dist/_members/primitives/lib/index.d.ts +1 -1
- package/dist/_members/primitives/lib/tokens.d.ts +0 -16
- package/dist/_members/primitives/lib/types.d.ts +1 -1
- package/dist/_members/primitives/scenes/device-showcase/config.d.ts +7 -7
- package/dist/_members/primitives/text/cinematic-title/config.d.ts +3 -3
- package/dist/_members/primitives/text/karaoke/config.d.ts +1 -1
- package/dist/_members/primitives/text/kinetic-type/config.d.ts +3 -3
- package/dist/_members/primitives/text/stat-counter/config.d.ts +1 -1
- package/dist/_members/primitives/text/text-effect/config.d.ts +2 -2
- package/dist/_members/primitives/transitions/grid-pixelate-wipe/config.d.ts +1 -1
- package/dist/_members/primitives/ui-blocks/badge-pop/config.d.ts +3 -3
- package/dist/_members/primitives/ui-blocks/terminal-simulator/config.d.ts +2 -2
- package/dist/_members/primitives/ui-blocks/toast-notification/config.d.ts +2 -2
- package/dist/_members/render-harness/cardAssetAdmission.d.ts +1 -0
- package/dist/_members/render-harness/cardAssetAdmission.d.ts.map +1 -1
- package/dist/_members/render-harness/cardRender.d.ts.map +1 -1
- package/dist/_members/render-harness/materializeSources.d.ts.map +1 -1
- package/dist/_members/render-harness/mediaServer.d.ts +6 -1
- package/dist/_members/render-harness/mediaServer.d.ts.map +1 -1
- package/dist/account-model/testing.js +15 -5
- package/dist/account-model/validators.js +5 -7
- package/dist/account-model.js +5 -7
- package/dist/animate/preparation-facts.js +1 -1
- package/dist/animate.js +2 -6
- package/dist/authoring/composer.js +1 -1
- package/dist/authoring/context.js +8 -6
- package/dist/authoring/models/defaults.d.ts +1 -0
- package/dist/authoring/models/defaults.js +7 -0
- package/dist/authoring/models.js +5 -3
- package/dist/authoring/motion.d.ts +1 -0
- package/dist/authoring/motion.js +25 -0
- package/dist/authoring/prompts.js +4 -14
- package/dist/authoring/providers.js +1 -1
- package/dist/authoring/resource-routing.js +2 -2
- package/dist/authoring/resources.js +4 -22
- package/dist/authoring/scene.js +3 -2
- package/dist/authoring.js +662 -218
- package/dist/brand-derivation/constants.js +1 -1
- package/dist/brand-derivation.js +1 -1
- package/dist/{chunk-TKFLSGAS.js → chunk-25JH5QZA.js} +2 -2
- package/dist/{chunk-LBJ5LI5V.js → chunk-2K2GBFLU.js} +17 -8
- package/dist/{chunk-RAXHCRVV.js → chunk-2PAP5LO5.js} +1 -1
- package/dist/{chunk-JPMVNMF3.js → chunk-3HLDIIWA.js} +1 -1
- package/dist/{chunk-PTVTWQ4T.js → chunk-3JEUNKDK.js} +2 -2
- package/dist/chunk-3VWJ3H4X.js +68 -0
- package/dist/{chunk-S5H6GH6M.js → chunk-3Z7CN54H.js} +1 -1
- package/dist/{chunk-FVDFPJHT.js → chunk-46WBCUPE.js} +1 -1
- package/dist/chunk-4VBLQIM5.js +30 -0
- package/dist/{chunk-N2OZDD44.js → chunk-6HA55CRU.js} +4 -5
- package/dist/{chunk-WL2MLKWU.js → chunk-6HPEMDQW.js} +1 -1
- package/dist/chunk-6KZCXAYL.js +257 -0
- package/dist/{chunk-IEXAKOEX.js → chunk-6QGARSV6.js} +2 -15
- package/dist/{chunk-3YVIAWET.js → chunk-7II5OM7R.js} +13 -1
- package/dist/{chunk-VLJOIUHL.js → chunk-7PSQUTL5.js} +3 -3
- package/dist/{chunk-UFD4EZHM.js → chunk-AFUITAH6.js} +4 -5
- package/dist/{chunk-HGCYZMII.js → chunk-AK6QPX7A.js} +9 -9
- package/dist/{chunk-EC6VFQE6.js → chunk-BZVOCVQV.js} +1 -0
- package/dist/{chunk-RBWS5XHE.js → chunk-CAF7BRNE.js} +2 -2
- package/dist/chunk-CEO47DIE.js +199 -0
- package/dist/chunk-CIOUDOGN.js +12 -0
- package/dist/{chunk-BDFAA747.js → chunk-DCKADD5B.js} +1 -1
- package/dist/{chunk-7AZLFN26.js → chunk-EISHFHU5.js} +20 -20
- package/dist/chunk-EQH37KNZ.js +224 -0
- package/dist/{chunk-EXY4JJPH.js → chunk-F6PLDBAK.js} +2 -11
- package/dist/{chunk-DAARYRNT.js → chunk-FKSXKS35.js} +6 -6
- package/dist/{chunk-KBDUEU4W.js → chunk-FZB7UX44.js} +1 -1
- package/dist/chunk-H2ZZXISB.js +24 -0
- package/dist/{chunk-WSMCZRJ2.js → chunk-I2HNC4PQ.js} +1 -1
- package/dist/{chunk-VXGA7LQQ.js → chunk-IUJABAG2.js} +14 -10
- package/dist/{chunk-MZB4ZXYW.js → chunk-IVFMOHAC.js} +1 -9
- package/dist/{chunk-UKDBU7HM.js → chunk-JNBNDHEF.js} +3 -3
- package/dist/{chunk-JWMWVP64.js → chunk-KC4LNZL5.js} +4 -9
- package/dist/{chunk-GCQ7Z7S7.js → chunk-KKATUGRU.js} +3 -9
- package/dist/{chunk-Q5P5UFOP.js → chunk-KLQ53NX3.js} +13 -1
- package/dist/{chunk-UMXES6ED.js → chunk-LVMWPFV4.js} +1 -1
- package/dist/chunk-NECN7TT4.js +367 -0
- package/dist/{chunk-4ZE564YF.js → chunk-NM7NWXGF.js} +0 -146
- package/dist/{chunk-KSRFYFUZ.js → chunk-NY6EI5YW.js} +4 -4
- package/dist/{chunk-4PV3UYJF.js → chunk-ONSGT6UJ.js} +257 -226
- package/dist/{chunk-VZ7TYX6Z.js → chunk-P3EFZDM5.js} +0 -17
- package/dist/{chunk-BEFSJMFF.js → chunk-P6RVYHLT.js} +9 -9
- package/dist/{chunk-TBHSOEYK.js → chunk-PLWDYWK6.js} +4 -34
- package/dist/{chunk-KYRDKK2D.js → chunk-Q6CJ6HCU.js} +1 -6
- package/dist/{chunk-FWSJLHSV.js → chunk-R642352J.js} +1 -1
- package/dist/{chunk-XELS2BGA.js → chunk-R6HTIP3N.js} +1 -3
- package/dist/{chunk-RL5SO653.js → chunk-RQRPSSRT.js} +1 -1
- package/dist/chunk-RR7UBEBV.js +172 -0
- package/dist/{chunk-FHMTAZD4.js → chunk-RWJHZCOR.js} +1 -71
- package/dist/{chunk-73DQTUWY.js → chunk-TIAJMEQ4.js} +2 -22
- package/dist/{chunk-2ESYSVXG.js → chunk-U67V476Y.js} +2 -15
- package/dist/{chunk-N54EGUVM.js → chunk-U7KSOA2L.js} +4 -21
- package/dist/{chunk-K66NLMGX.js → chunk-UGWJC4GA.js} +62 -18
- package/dist/chunk-VBYINB74.js +136 -0
- package/dist/{chunk-W2245F6G.js → chunk-WTQRLFR2.js} +1 -1
- package/dist/{chunk-Z4G3VM3H.js → chunk-X2RTLS6K.js} +2 -23
- package/dist/chunk-XHMKPTHV.js +20 -0
- package/dist/{chunk-R7G2PNEZ.js → chunk-XOT2VWCO.js} +13 -28
- package/dist/{chunk-E63UEO5C.js → chunk-XQGQ5EFS.js} +16 -1
- package/dist/chunk-XR76OZKC.js +21 -0
- package/dist/chunk-ZCEYEIRB.js +179 -0
- package/dist/{chunk-IMIUHG2E.js → chunk-ZPJQ3TQL.js} +1 -3
- package/dist/cloud-import.js +1 -16
- package/dist/component-runtime/browserOptions.js +4 -3
- package/dist/component-runtime/contracts.js +2 -2
- package/dist/component-runtime/identity/browser.js +2 -17
- package/dist/component-runtime/identity.js +5 -7
- package/dist/component-runtime/importPolicy.js +3 -3
- package/dist/component-runtime/mediaResolution.js +1 -1
- package/dist/component-runtime/render.js +8 -7
- package/dist/component-runtime/sourceAdmission.js +3 -3
- package/dist/component-runtime/template/testing.d.ts +1 -0
- package/dist/component-runtime/template/testing.js +383 -0
- package/dist/component-runtime/template.d.ts +1 -0
- package/dist/component-runtime/template.js +251 -0
- package/dist/component-runtime.js +27 -28
- package/dist/compose.js +22 -39
- package/dist/composition/audio.js +4 -8
- package/dist/composition/brand-kit.js +1 -1
- package/dist/composition/brief.js +1 -1
- package/dist/composition/card-html.d.ts +1 -0
- package/dist/composition/card-html.js +15 -0
- package/dist/composition/depth.js +1 -1
- package/dist/composition/floors.js +2 -2
- package/dist/composition/fonts.js +1 -1
- package/dist/composition/graphics-plan.js +4 -44
- package/dist/composition/invariants.js +5 -12
- package/dist/composition/ops.js +7 -5
- package/dist/composition/primitive-catalog.js +4 -6
- package/dist/composition/projection.js +3 -5
- package/dist/composition/reframe/coverage.js +1 -1
- package/dist/composition/reframe/kenBurns.js +1 -1
- package/dist/composition/reframe/shotScale.js +1 -1
- package/dist/composition/reframe/trajectory.js +1 -1
- package/dist/composition/reframe.js +1 -1
- package/dist/composition/scene/budget-policy.js +1 -1
- package/dist/composition/scene.js +1 -1
- package/dist/composition/timeline.js +4 -8
- package/dist/composition/validators/brand-kit-body.d.ts +1 -0
- package/dist/composition/validators/brand-kit-body.js +18 -0
- package/dist/composition/validators/graphic-kinds.js +1 -1
- package/dist/composition/validators.js +16 -69
- package/dist/composition-ops.js +17 -15
- package/dist/composition.js +21 -83
- package/dist/context-7SWSVJ6Z.js +17 -0
- package/dist/core/render.js +13 -9
- package/dist/core/select.js +3 -3
- package/dist/core.js +9 -9
- package/dist/director/ai-sdk.js +7 -11
- package/dist/director/domain.js +9 -17
- package/dist/director.js +9 -21
- package/dist/{dist-LAJ2363K.js → dist-6FO67KVA.js} +1 -1
- package/dist/errors.js +2 -2
- package/dist/foundation/canonical.d.ts +1 -0
- package/dist/foundation/canonical.js +7 -0
- package/dist/foundation/primitives.js +4 -6
- package/dist/foundation/testing.d.ts +1 -0
- package/dist/foundation/testing.js +7 -0
- package/dist/foundation.js +7 -9
- package/dist/{magic-string.es-SDTMJBWP.js → magic-string.es-KVSW34UD.js} +1 -1
- package/dist/mcp/adapter.js +8 -16
- package/dist/mcp/composition-ops.d.ts +1 -0
- package/dist/mcp/composition-ops.js +11 -0
- package/dist/mcp/core.js +2 -2
- package/dist/mcp/curation.js +1 -1
- package/dist/mcp/executor.js +1 -1
- package/dist/mcp/scene-shot.js +3 -3
- package/dist/mcp/server.js +6 -30
- package/dist/mcp/wire-schema.js +13 -2
- package/dist/mcp.js +11 -33
- package/dist/media-model/generation.js +6 -8
- package/dist/media-model/media-kind.js +1 -1
- package/dist/media-model/testing.js +2 -2
- package/dist/media-model/transcriptSearch.js +1 -1
- package/dist/media-model.js +6 -8
- package/dist/nle-export/xml.js +1 -1
- package/dist/nle-export.js +2 -2
- package/dist/perception.js +1 -1
- package/dist/plane/conformance.js +8 -4
- package/dist/plane/contract.js +1 -1
- package/dist/plane.js +8 -4
- package/dist/primitives/backgrounds.js +3 -3
- package/dist/primitives/captions.js +5 -5
- package/dist/primitives/effects.js +4 -4
- package/dist/primitives/hero-text.js +4 -4
- package/dist/primitives/layouts.js +4 -4
- package/dist/primitives/lib/easings.js +1 -1
- package/dist/primitives/lib/frameScale.js +1 -1
- package/dist/primitives/lib/index.js +7 -13
- package/dist/primitives/lib/palette.js +2 -2
- package/dist/primitives/lib/preview.js +1 -1
- package/dist/primitives/lib/schema.js +1 -1
- package/dist/primitives/lib/seeded-random.js +1 -1
- package/dist/primitives/lib/text/contrast.js +3 -3
- package/dist/primitives/lib/text/fill.js +1 -1
- package/dist/primitives/lib/text/fitText.js +1 -1
- package/dist/primitives/lib/text/marker.js +1 -1
- package/dist/primitives/lib/text/motion.js +1 -1
- package/dist/primitives/lib/text/recolor.js +1 -1
- package/dist/primitives/lib/text/stage.js +1 -1
- package/dist/primitives/lib/text/typeface.js +1 -1
- package/dist/primitives/lib/tokens.js +4 -11
- package/dist/primitives/lib.js +7 -13
- package/dist/primitives/scenes.js +5 -5
- package/dist/primitives/subject-foreground.js +1 -1
- package/dist/primitives/text.js +4 -4
- package/dist/primitives/transitions.js +3 -3
- package/dist/primitives/ui-blocks.js +5 -5
- package/dist/primitives/workspace.js +1 -1
- package/dist/primitives.js +18 -32
- package/dist/render-harness/cardAssetAdmission.js +4 -4
- package/dist/render-harness/cardFonts.js +3 -3
- package/dist/render-harness/renderInputAssets.js +4 -4
- package/dist/render-harness.js +100 -82
- package/dist/src-XI5MULKD.js +71 -0
- package/package.json +51 -61
- package/dist/_members/account-model/validators/workingComposition.d.ts +0 -11
- package/dist/_members/animate/animations/index.d.ts +0 -9
- package/dist/_members/animate/easing/index.d.ts +0 -3
- package/dist/_members/animate/mobjects/index.d.ts +0 -4
- package/dist/_members/animate/scene/internal.d.ts +0 -29
- package/dist/_members/authoring/prompts/graphics.d.ts +0 -9
- package/dist/_members/cloud-import/cloudConfig.d.ts +0 -2
- package/dist/_members/composition/autozoom/index.d.ts +0 -25
- package/dist/_members/composition/graphics-plan/instantiateMotif.d.ts +0 -34
- package/dist/_members/composition/invariants/time.d.ts +0 -14
- package/dist/_members/composition/types/index.d.ts +0 -8
- package/dist/_members/composition/validators/font.d.ts +0 -58
- package/dist/_members/composition/validators/registry.d.ts +0 -79
- package/dist/_members/composition/validators/render.d.ts +0 -2068
- package/dist/_members/director/ai-sdk/chunks.d.ts +0 -14
- package/dist/_members/director/domain/ports.d.ts +0 -32
- package/dist/_members/director/testing/contract.d.ts +0 -52
- package/dist/_members/director/testing/index.d.ts +0 -1
- package/dist/_members/foundation/codes/index.d.ts +0 -10
- package/dist/_members/nle-export/server/index.d.ts +0 -1
- package/dist/_members/nle-export/server/pack-zip.d.ts +0 -6
- package/dist/_members/render-harness/assetRefs.d.ts +0 -26
- package/dist/_members/render-harness/assetRefs.d.ts.map +0 -1
- package/dist/_members/render-harness/remotion-runtime.d.ts +0 -87
- package/dist/authoring/build-tools.d.ts +0 -1
- package/dist/authoring/build-tools.js +0 -27
- package/dist/authoring/capabilities.d.ts +0 -1
- package/dist/authoring/capabilities.js +0 -11
- package/dist/authoring/pipelineTrace.d.ts +0 -1
- package/dist/authoring/pipelineTrace.js +0 -7
- package/dist/authoring/tools.d.ts +0 -1
- package/dist/authoring/tools.js +0 -30
- package/dist/chunk-AXRSCHQX.js +0 -661
- package/dist/chunk-DV7ZFVL4.js +0 -116
- package/dist/chunk-GF52TW4I.js +0 -51
- package/dist/chunk-JOURGVOR.js +0 -27
- package/dist/chunk-LBN5KQC6.js +0 -384
- package/dist/chunk-OSMXQV5V.js +0 -18
- package/dist/chunk-QDBVYZSF.js +0 -128
- package/dist/chunk-RERR5JLM.js +0 -197
- package/dist/chunk-U3JPILZS.js +0 -15
- package/dist/chunk-Y4HPN4BC.js +0 -364
- package/dist/composition/autozoom.d.ts +0 -1
- package/dist/composition/autozoom.js +0 -76
- package/dist/composition/fixtures.d.ts +0 -1
- package/dist/composition/fixtures.js +0 -154
- package/dist/composition/types.d.ts +0 -1
- package/dist/composition/types.js +0 -0
- package/dist/context-6HPUO36M.js +0 -15
- package/dist/director/testing.d.ts +0 -1
- package/dist/director/testing.js +0 -22
- package/dist/foundation/codes.d.ts +0 -1
- package/dist/foundation/codes.js +0 -7
- package/dist/nle-export/server.d.ts +0 -1
- package/dist/nle-export/server.js +0 -25856
- /package/dist/{chunk-FTVZF4GO.js → chunk-S432RE6G.js} +0 -0
|
@@ -3,6 +3,10 @@ import {
|
|
|
3
3
|
buildEasedZooms,
|
|
4
4
|
buildPannedCenters
|
|
5
5
|
} from "./chunk-QH3YI3ND.js";
|
|
6
|
+
import {
|
|
7
|
+
flattenCompoundClips,
|
|
8
|
+
hasCompoundClips
|
|
9
|
+
} from "./chunk-ZPJQ3TQL.js";
|
|
6
10
|
import {
|
|
7
11
|
DOMINANCE_WEIGHTS,
|
|
8
12
|
ENTER_SEC,
|
|
@@ -20,26 +24,22 @@ import {
|
|
|
20
24
|
scoreAndRank,
|
|
21
25
|
segmentShots,
|
|
22
26
|
stabilizeSelectionHysteresis
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
flattenCompoundClips,
|
|
26
|
-
hasCompoundClips
|
|
27
|
-
} from "./chunk-IMIUHG2E.js";
|
|
27
|
+
} from "./chunk-3HLDIIWA.js";
|
|
28
28
|
import {
|
|
29
29
|
compositionHasVo,
|
|
30
30
|
roleDefaultGainDb
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
resolveBrandRef
|
|
34
|
-
} from "./chunk-DKBFAQCW.js";
|
|
31
|
+
} from "./chunk-P3EFZDM5.js";
|
|
35
32
|
import {
|
|
36
33
|
SHOT_SCALE_TARGET,
|
|
37
34
|
shotScaleZoom
|
|
38
35
|
} from "./chunk-WREYUH2E.js";
|
|
36
|
+
import {
|
|
37
|
+
resolveBrandRef
|
|
38
|
+
} from "./chunk-DKBFAQCW.js";
|
|
39
39
|
import {
|
|
40
40
|
CueframeError,
|
|
41
41
|
encodeError
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-XQGQ5EFS.js";
|
|
43
43
|
import {
|
|
44
44
|
SCENE_CAPTURE_IDENTITY_FIELDS_V1,
|
|
45
45
|
SCENE_PRESET_TRIANGLES,
|
|
@@ -2212,6 +2212,8 @@ async function assemblePreparedRenderInput(composition, resolved, dependencies)
|
|
|
2212
2212
|
}
|
|
2213
2213
|
|
|
2214
2214
|
// ../execution/core/src/render/exportSettings.ts
|
|
2215
|
+
var EXPORT_QUALITIES = ["maximum", "social", "web", "potato", "source"];
|
|
2216
|
+
var EXPORT_RESOLUTIONS = ["source", "1080p", "1440p", "4k"];
|
|
2215
2217
|
var DEFAULT_FPS = 30;
|
|
2216
2218
|
var DEFAULT_WIDTH = 1920;
|
|
2217
2219
|
var DEFAULT_HEIGHT = 1080;
|
|
@@ -3222,6 +3224,8 @@ export {
|
|
|
3222
3224
|
compositionToRenderInput,
|
|
3223
3225
|
assembleRenderInput,
|
|
3224
3226
|
assemblePreparedRenderInput,
|
|
3227
|
+
EXPORT_QUALITIES,
|
|
3228
|
+
EXPORT_RESOLUTIONS,
|
|
3225
3229
|
DEFAULT_FPS,
|
|
3226
3230
|
DEFAULT_WIDTH,
|
|
3227
3231
|
DEFAULT_HEIGHT,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
CueframeError,
|
|
8
8
|
encodeError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XQGQ5EFS.js";
|
|
10
10
|
|
|
11
11
|
// ../composition/src/projection/cardTokens.ts
|
|
12
12
|
var CARD_MOTION_VAR_NAMES = [
|
|
@@ -206,13 +206,6 @@ function primaryClipForOverlay(composition, overlayId) {
|
|
|
206
206
|
}
|
|
207
207
|
return null;
|
|
208
208
|
}
|
|
209
|
-
async function behindReadinessForOverlay(input) {
|
|
210
|
-
const target = primaryClipForOverlay(input.composition, input.overlayId);
|
|
211
|
-
return behindReadinessForTarget(
|
|
212
|
-
target,
|
|
213
|
-
target ? input.mattesByMediaId[target.mediaId] : void 0
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
209
|
async function behindReadinessForTarget(target, mattes) {
|
|
217
210
|
if (!target) return { state: "no-clip" };
|
|
218
211
|
const key = await matteIntentKey({ ...target.window, subjectClass: "person" });
|
|
@@ -605,7 +598,6 @@ export {
|
|
|
605
598
|
isCurrentMatteBakeVersion,
|
|
606
599
|
matteIntentKey,
|
|
607
600
|
primaryClipForOverlay,
|
|
608
|
-
behindReadinessForOverlay,
|
|
609
601
|
behindReadinessForTarget,
|
|
610
602
|
clipOverlapsBehind,
|
|
611
603
|
matteWindowsByMediaId,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-QGAWDLYX.js";
|
|
5
5
|
import {
|
|
6
6
|
DashboardPopulate
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-3Z7CN54H.js";
|
|
8
8
|
import {
|
|
9
9
|
useFrameScale
|
|
10
10
|
} from "./chunk-QAGGJHAF.js";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
TEXT_MUTED,
|
|
36
36
|
VIOLET,
|
|
37
37
|
WARNING
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WTQRLFR2.js";
|
|
39
39
|
import {
|
|
40
40
|
CAMERA_PRESETS,
|
|
41
41
|
DEFAULT_CAMERA,
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
makeDefaultScreenTexture,
|
|
44
44
|
resolveCamera,
|
|
45
45
|
useImageTexture
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-RWJHZCOR.js";
|
|
47
47
|
import {
|
|
48
48
|
DEVICE_GLASS_OPACITY_ENCODED,
|
|
49
49
|
DeviceMesh,
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComponentHostAttestationV2,
|
|
3
3
|
ComponentRuntimeError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-BZVOCVQV.js";
|
|
5
|
+
import {
|
|
6
|
+
canonicalJson
|
|
7
|
+
} from "./chunk-XHMKPTHV.js";
|
|
5
8
|
import {
|
|
6
9
|
STUDIO_SHADOW_MAP_BUDGET
|
|
7
10
|
} from "./chunk-CL5Y6V6K.js";
|
|
@@ -46,14 +49,6 @@ async function readGpuAttestation(browser) {
|
|
|
46
49
|
}).filter(([, value]) => value !== void 0 && value !== null && value !== "")
|
|
47
50
|
);
|
|
48
51
|
const hasDeviceOrDriverIdentity = Array.isArray(gpu?.devices) && gpu.devices.length > 0 || typeof aux.driverVendor === "string" && aux.driverVendor.length > 0 || typeof aux.driverVersion === "string" && aux.driverVersion.length > 0;
|
|
49
|
-
const canonicalJson = (value) => {
|
|
50
|
-
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
51
|
-
if (value !== null && typeof value === "object") {
|
|
52
|
-
const object = value;
|
|
53
|
-
return `{${Object.keys(object).sort().map((key) => `${JSON.stringify(key)}:${canonicalJson(object[key])}`).join(",")}}`;
|
|
54
|
-
}
|
|
55
|
-
return JSON.stringify(value);
|
|
56
|
-
};
|
|
57
52
|
return {
|
|
58
53
|
renderer: typeof aux.glRenderer === "string" ? aux.glRenderer : "",
|
|
59
54
|
featureStatus: gpu?.featureStatus ?? {},
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
openai: "gpt-4.1",
|
|
5
|
-
ollama: "llama3.1",
|
|
6
|
-
/** Cheaper model used for fast-mode / low-effort turns. */
|
|
7
|
-
fast: "claude-haiku-4-5"
|
|
8
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_MODEL_IDS
|
|
3
|
+
} from "./chunk-CIOUDOGN.js";
|
|
9
4
|
|
|
10
5
|
// ../authoring/src/models/modelFactory.ts
|
|
11
6
|
import { createAnthropic } from "@ai-sdk/anthropic";
|
|
@@ -106,7 +101,6 @@ function buildFastModel(settings, langfuse) {
|
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
export {
|
|
109
|
-
DEFAULT_MODEL_IDS,
|
|
110
104
|
withRequestTimeout,
|
|
111
105
|
makeLangfuseFetch,
|
|
112
106
|
buildModel,
|
|
@@ -60,10 +60,22 @@ var PREVIEW_FRAME_CASES = [
|
|
|
60
60
|
function isKnownRed(c, lane) {
|
|
61
61
|
return c.knownRed?.includes(lane) ?? false;
|
|
62
62
|
}
|
|
63
|
+
function meetsExpectation(c, answer) {
|
|
64
|
+
return answer.status === c.expect.status && (c.expect.code === void 0 || answer.code === c.expect.code);
|
|
65
|
+
}
|
|
66
|
+
function conformanceVerdict(c, lane, answer) {
|
|
67
|
+
const meets = meetsExpectation(c, answer);
|
|
68
|
+
if (isKnownRed(c, lane)) {
|
|
69
|
+
return meets ? { ok: false, reason: `"${c.name}" conforms on ${lane} now: remove "${lane}" from its knownRed.` } : { ok: true };
|
|
70
|
+
}
|
|
71
|
+
return meets ? { ok: true } : { ok: false, reason: `${c.name}: ${lane} answered ${answer.status} ${answer.code ?? ""}, expected ${c.expect.status} ${c.expect.code ?? ""}. ${c.why}` };
|
|
72
|
+
}
|
|
63
73
|
|
|
64
74
|
export {
|
|
65
75
|
CONFORMANCE_COMPOSITION,
|
|
66
76
|
CONFORMANCE_DURATION_SEC,
|
|
67
77
|
PREVIEW_FRAME_CASES,
|
|
68
|
-
isKnownRed
|
|
78
|
+
isKnownRed,
|
|
79
|
+
meetsExpectation,
|
|
80
|
+
conformanceVerdict
|
|
69
81
|
};
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BrandKitBodySchema
|
|
3
|
+
} from "./chunk-CEO47DIE.js";
|
|
4
|
+
import {
|
|
5
|
+
ComponentSourceV2
|
|
6
|
+
} from "./chunk-BZVOCVQV.js";
|
|
7
|
+
import {
|
|
8
|
+
Composition
|
|
9
|
+
} from "./chunk-AFUITAH6.js";
|
|
10
|
+
import {
|
|
11
|
+
SceneShotSpecV2,
|
|
12
|
+
sceneShotImageSlots,
|
|
13
|
+
sceneShotVideoSlots
|
|
14
|
+
} from "./chunk-CL5Y6V6K.js";
|
|
15
|
+
|
|
16
|
+
// ../execution/component-runtime/src/template/schema.ts
|
|
17
|
+
import { z } from "zod";
|
|
18
|
+
var TEMPLATE_MAX_BYTES = 1048576;
|
|
19
|
+
var MATTE_KEY = /^[a-f0-9]{12}$/;
|
|
20
|
+
var name = z.string().regex(/^[A-Za-z_][A-Za-z0-9_]*$/);
|
|
21
|
+
var slug = z.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, "slug must be kebab-case").max(80);
|
|
22
|
+
var preparedMatte = z.object({
|
|
23
|
+
url: z.string().url(),
|
|
24
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/),
|
|
25
|
+
mimeType: z.literal("video/mp4"),
|
|
26
|
+
bakeVersion: z.string().min(1),
|
|
27
|
+
presenceFraction: z.number().min(0).max(1).optional()
|
|
28
|
+
}).strict();
|
|
29
|
+
var base = { name, required: z.boolean(), label: z.string().max(120).optional() };
|
|
30
|
+
var TemplateParameterSchema = z.discriminatedUnion("type", [
|
|
31
|
+
z.object({ ...base, type: z.literal("string"), default: z.string().optional(), maxLength: z.number().int().positive().optional() }).strict(),
|
|
32
|
+
z.object({ ...base, type: z.literal("number"), default: z.number().optional(), min: z.number().optional(), max: z.number().optional() }).strict(),
|
|
33
|
+
z.object({ ...base, type: z.literal("color"), default: z.string().optional() }).strict(),
|
|
34
|
+
z.object({ ...base, type: z.literal("url"), default: z.string().optional() }).strict(),
|
|
35
|
+
z.object({ ...base, type: z.literal("enum"), options: z.array(z.string().min(1)).min(1), default: z.string().optional() }).strict().superRefine((p, ctx) => {
|
|
36
|
+
if (p.default !== void 0 && !p.options.includes(p.default)) {
|
|
37
|
+
ctx.addIssue({ code: "custom", path: ["default"], message: `${p.name}: enum default must be one of options` });
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
z.object({ ...base, type: z.literal("boolean"), default: z.boolean().optional() }).strict(),
|
|
41
|
+
z.object({
|
|
42
|
+
...base,
|
|
43
|
+
type: z.literal("media"),
|
|
44
|
+
kind: z.enum(["video", "image", "audio"]),
|
|
45
|
+
default: z.string().optional(),
|
|
46
|
+
prepared: z.object({ mattes: z.record(z.string().regex(MATTE_KEY, "mattes keys are 12 lowercase hex chars"), preparedMatte).optional() }).strict().optional(),
|
|
47
|
+
sample: z.object({
|
|
48
|
+
url: z.string().url().startsWith("https://"),
|
|
49
|
+
sha256: z.string().regex(/^[a-f0-9]{64}$/, "sample sha256 is 64 hex chars"),
|
|
50
|
+
mimeType: z.string().min(1),
|
|
51
|
+
durationSec: z.number().positive().optional()
|
|
52
|
+
}).strict().optional()
|
|
53
|
+
}).strict()
|
|
54
|
+
]);
|
|
55
|
+
var PRESET_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
56
|
+
function coerceParameterValue(param, raw) {
|
|
57
|
+
switch (param.type) {
|
|
58
|
+
case "string": {
|
|
59
|
+
if (typeof raw !== "string") return { ok: false, reason: "expected a string" };
|
|
60
|
+
if (param.maxLength !== void 0 && raw.length > param.maxLength) return { ok: false, reason: `longer than ${param.maxLength}` };
|
|
61
|
+
return { ok: true, value: raw };
|
|
62
|
+
}
|
|
63
|
+
case "number": {
|
|
64
|
+
const n = typeof raw === "string" && raw.trim() !== "" ? Number(raw) : raw;
|
|
65
|
+
if (typeof n !== "number" || Number.isNaN(n)) return { ok: false, reason: "expected a number" };
|
|
66
|
+
if (param.min !== void 0 && n < param.min) return { ok: false, reason: `below ${param.min}` };
|
|
67
|
+
if (param.max !== void 0 && n > param.max) return { ok: false, reason: `above ${param.max}` };
|
|
68
|
+
return { ok: true, value: n };
|
|
69
|
+
}
|
|
70
|
+
case "color":
|
|
71
|
+
return typeof raw === "string" && /^#[0-9a-fA-F]{6}([0-9a-fA-F]{2})?$/.test(raw) ? { ok: true, value: raw } : { ok: false, reason: "expected #rrggbb" };
|
|
72
|
+
case "url": {
|
|
73
|
+
try {
|
|
74
|
+
const { protocol } = new URL(String(raw));
|
|
75
|
+
if (protocol === "https:" || protocol === "http:") return { ok: true, value: String(raw) };
|
|
76
|
+
} catch {
|
|
77
|
+
}
|
|
78
|
+
return { ok: false, reason: "expected an http(s) URL" };
|
|
79
|
+
}
|
|
80
|
+
case "enum":
|
|
81
|
+
return typeof raw === "string" && param.options.includes(raw) ? { ok: true, value: raw } : { ok: false, reason: `expected one of ${param.options.join(", ")}` };
|
|
82
|
+
case "boolean": {
|
|
83
|
+
if (typeof raw === "boolean") return { ok: true, value: raw };
|
|
84
|
+
if (raw === "true" || raw === "false") return { ok: true, value: raw === "true" };
|
|
85
|
+
return { ok: false, reason: "expected true or false" };
|
|
86
|
+
}
|
|
87
|
+
case "media":
|
|
88
|
+
return typeof raw === "string" && raw.length > 0 ? { ok: true, value: raw } : { ok: false, reason: "expected a media id" };
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var TemplateBrandKitSchema = BrandKitBodySchema.superRefine((kit, ctx) => {
|
|
92
|
+
const sources = { logo: kit.logo?.src, watermark: kit.watermark?.src, intro: kit.intro?.src, outro: kit.outro?.src };
|
|
93
|
+
for (const [field, src] of Object.entries(sources)) {
|
|
94
|
+
if (src !== void 0 && !src.startsWith("https://")) {
|
|
95
|
+
ctx.addIssue({ code: "custom", path: [field, "src"], message: `${field}.src must be an https URL; a template kit never names a storage key` });
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var TemplatePresetSchema = z.object({
|
|
100
|
+
label: z.string().min(1).max(120),
|
|
101
|
+
values: z.record(z.string(), z.unknown()),
|
|
102
|
+
brandKit: TemplateBrandKitSchema.optional(),
|
|
103
|
+
gallery: z.object({ poster: z.string().url().optional(), render: z.string().url().optional(), description: z.string().max(2e3).optional() }).strict().optional()
|
|
104
|
+
}).strict();
|
|
105
|
+
var TemplateComponentSchema = z.object({
|
|
106
|
+
source: ComponentSourceV2,
|
|
107
|
+
name: z.string().min(1).max(120),
|
|
108
|
+
description: z.string().min(1).max(2e3),
|
|
109
|
+
category: z.enum(["text", "effects", "transitions", "layouts", "backgrounds", "ui-blocks", "scenes"]),
|
|
110
|
+
propSchema: z.record(z.string(), z.unknown())
|
|
111
|
+
}).strict();
|
|
112
|
+
var TemplateDocumentSchema = z.object({
|
|
113
|
+
v: z.literal(1),
|
|
114
|
+
slug,
|
|
115
|
+
name: z.string().min(1).max(120),
|
|
116
|
+
description: z.string().max(2e3).optional(),
|
|
117
|
+
composition: Composition,
|
|
118
|
+
parameters: z.array(TemplateParameterSchema).superRefine((ps, ctx) => {
|
|
119
|
+
const seen = /* @__PURE__ */ new Set();
|
|
120
|
+
ps.forEach((p, i) => {
|
|
121
|
+
const issue = (message) => ctx.addIssue({ code: "custom", path: [i], message: `${p.name}: ${message}` });
|
|
122
|
+
if (seen.has(p.name)) issue("duplicate parameter");
|
|
123
|
+
seen.add(p.name);
|
|
124
|
+
if (p.type === "number" && p.min !== void 0 && p.max !== void 0 && p.min > p.max) issue("min is above max");
|
|
125
|
+
if (p.type === "enum") for (const o of new Set(p.options.filter((o2, j) => p.options.indexOf(o2) !== j))) issue(`duplicate option ${o}`);
|
|
126
|
+
if (p.default !== void 0 && p.type !== "media" && p.type !== "enum") {
|
|
127
|
+
const r = coerceParameterValue(p, p.default);
|
|
128
|
+
if (!r.ok) issue(`default ${r.reason}`);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}),
|
|
132
|
+
components: z.record(z.string(), TemplateComponentSchema),
|
|
133
|
+
brandKit: TemplateBrandKitSchema.optional(),
|
|
134
|
+
rubric: z.string().optional(),
|
|
135
|
+
provenance: z.object({ label: z.string(), href: z.string().url().optional(), notes: z.string().optional() }).strict().optional(),
|
|
136
|
+
gallery: z.object({
|
|
137
|
+
status: z.enum(["published", "draft"]),
|
|
138
|
+
category: z.string().optional(),
|
|
139
|
+
format: z.string().optional(),
|
|
140
|
+
duration: z.string().optional(),
|
|
141
|
+
render: z.string().url().optional(),
|
|
142
|
+
poster: z.string().url().optional(),
|
|
143
|
+
prompt: z.string().optional(),
|
|
144
|
+
details: z.array(z.string()).optional(),
|
|
145
|
+
transcriptExcerpt: z.string().nullable().optional(),
|
|
146
|
+
loop: z.boolean().optional()
|
|
147
|
+
}).strict().optional(),
|
|
148
|
+
presets: z.record(z.string().regex(PRESET_NAME, "preset names are kebab-case"), TemplatePresetSchema).optional()
|
|
149
|
+
}).strict().superRefine((doc, ctx) => {
|
|
150
|
+
const byName = new Map(doc.parameters.map((p) => [p.name, p]));
|
|
151
|
+
for (const [presetName, preset] of Object.entries(doc.presets ?? {})) {
|
|
152
|
+
for (const [key, raw] of Object.entries(preset.values)) {
|
|
153
|
+
const param = byName.get(key);
|
|
154
|
+
if (!param) {
|
|
155
|
+
ctx.addIssue({ code: "custom", path: ["presets", presetName, "values", key], message: `preset ${presetName} names undeclared parameter ${key}` });
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
if (param.type === "media") {
|
|
159
|
+
ctx.addIssue({ code: "custom", path: ["presets", presetName, "values", key], message: `preset ${presetName}: ${key} is a media parameter; presets never carry media` });
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const r = coerceParameterValue(param, raw);
|
|
163
|
+
if (!r.ok) ctx.addIssue({ code: "custom", path: ["presets", presetName, "values", key], message: `preset ${presetName}: ${key} ${r.reason}` });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
var TemplateError = class extends Error {
|
|
168
|
+
constructor(code, message, fields = []) {
|
|
169
|
+
super(message);
|
|
170
|
+
this.code = code;
|
|
171
|
+
this.fields = fields;
|
|
172
|
+
}
|
|
173
|
+
code;
|
|
174
|
+
fields;
|
|
175
|
+
};
|
|
176
|
+
function parseTemplateDocument(raw) {
|
|
177
|
+
const bytes = new TextEncoder().encode(JSON.stringify(raw)).byteLength;
|
|
178
|
+
if (bytes > TEMPLATE_MAX_BYTES) throw new TemplateError("payload_too_large", `template document exceeds 1 MiB (${bytes} bytes)`);
|
|
179
|
+
const r = TemplateDocumentSchema.safeParse(raw);
|
|
180
|
+
if (!r.success) throw new TemplateError("template_values_invalid", r.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; "));
|
|
181
|
+
return r.data;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
// ../execution/component-runtime/src/template/bind.ts
|
|
185
|
+
var REF = /^\{\{([A-Za-z_][A-Za-z0-9_]*)\}\}$/;
|
|
186
|
+
var INLINE = /\\\{\{|\{\{([A-Za-z_][A-Za-z0-9_]*)\}\}/g;
|
|
187
|
+
var STRING_LEAF_ROOTS = ["source.props", "source.params", "source.html", "source.tokens", "source.mediaId", "source.assets", "metadata", "text"];
|
|
188
|
+
var TYPED_VALUE_SITE = /^(tracks\.\d+\.contents\.\d+\.(source\.props|source\.params|metadata)|markers\.\d+\.metadata)(\.|$)/;
|
|
189
|
+
var HTML_SITE = /^tracks\.\d+\.contents\.\d+\.source\.html$/;
|
|
190
|
+
var MEDIA_SITE = /^tracks\.\d+\.contents\.\d+\.source\.(mediaId|assets\.[^.]+)$/;
|
|
191
|
+
var OMIT = /* @__PURE__ */ Symbol("omit");
|
|
192
|
+
function referenceAllowed(path) {
|
|
193
|
+
const p = path.join(".");
|
|
194
|
+
if (/^captions\./.test(p) && /\.text$/.test(p)) return true;
|
|
195
|
+
if (/^markers\.\d+\.metadata\b/.test(p)) return true;
|
|
196
|
+
const m = p.match(/^tracks\.\d+\.contents\.\d+\.(.*)$/);
|
|
197
|
+
return !!m && STRING_LEAF_ROOTS.some((root) => m[1] === root || m[1].startsWith(root + "."));
|
|
198
|
+
}
|
|
199
|
+
function findReferences(doc) {
|
|
200
|
+
const out = [];
|
|
201
|
+
const walk = (v, path) => {
|
|
202
|
+
if (typeof v === "string") {
|
|
203
|
+
const whole = v.match(REF);
|
|
204
|
+
if (whole) {
|
|
205
|
+
out.push({ path, name: whole[1], wholeLeaf: true });
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
for (const m of v.matchAll(INLINE)) if (m[1] !== void 0) out.push({ path, name: m[1], wholeLeaf: false });
|
|
209
|
+
} else if (Array.isArray(v)) v.forEach((x, i) => walk(x, [...path, String(i)]));
|
|
210
|
+
else if (v && typeof v === "object") for (const [k, x] of Object.entries(v)) walk(x, [...path, k]);
|
|
211
|
+
};
|
|
212
|
+
walk(doc.composition, []);
|
|
213
|
+
return out;
|
|
214
|
+
}
|
|
215
|
+
function slotKind(doc, clip, slot) {
|
|
216
|
+
const component = doc.components[clip.source?.componentId];
|
|
217
|
+
if (component) return { kind: component.source.manifest.assets[slot]?.kind };
|
|
218
|
+
const scene = clip.source?.props?.scene;
|
|
219
|
+
if (scene === void 0) return {};
|
|
220
|
+
const parsed = SceneShotSpecV2.safeParse(scene);
|
|
221
|
+
if (!parsed.success) return { error: `clip ${clip.id} props.scene is not a scene-shot spec` };
|
|
222
|
+
return { kind: sceneShotImageSlots(parsed.data).includes(slot) ? "image" : sceneShotVideoSlots(parsed.data).includes(slot) ? "video" : void 0 };
|
|
223
|
+
}
|
|
224
|
+
function checkReferences(doc) {
|
|
225
|
+
const declared = new Map(doc.parameters.map((p) => [p.name, p]));
|
|
226
|
+
const refs = findReferences(doc);
|
|
227
|
+
const used = new Set(refs.map((r) => r.name));
|
|
228
|
+
const mediaSiteErrors = [];
|
|
229
|
+
for (const r of refs) {
|
|
230
|
+
const p = declared.get(r.name);
|
|
231
|
+
if (!p) continue;
|
|
232
|
+
const at = r.path.join(".");
|
|
233
|
+
const site = at.match(MEDIA_SITE);
|
|
234
|
+
if (p.type !== "media") {
|
|
235
|
+
if (site) mediaSiteErrors.push(`${r.name}: ${at} takes a media parameter`);
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (!site || !r.wholeLeaf) {
|
|
239
|
+
mediaSiteErrors.push(`${r.name}: media parameters bind only as a whole-leaf mediaId or asset slot`);
|
|
240
|
+
continue;
|
|
241
|
+
}
|
|
242
|
+
const clip = doc.composition.tracks[Number(r.path[1])].contents[Number(r.path[3])];
|
|
243
|
+
if (site[1] === "mediaId") {
|
|
244
|
+
if (!p.required) mediaSiteErrors.push(`${r.name}: a clip's mediaId needs a required media parameter`);
|
|
245
|
+
else if (clip.kind !== p.kind) mediaSiteErrors.push(`${r.name}: clip ${clip.id} is ${clip.kind}, parameter is ${p.kind}`);
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
const slot = r.path[r.path.length - 1];
|
|
249
|
+
const k = slotKind(doc, clip, slot);
|
|
250
|
+
if (k.error) mediaSiteErrors.push(`${r.name}: ${k.error}`);
|
|
251
|
+
else if (k.kind !== p.kind) mediaSiteErrors.push(`${r.name}: slot ${slot} of ${clip.source.componentId} is ${k.kind ?? "undeclared"}, parameter is ${p.kind}`);
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
undeclared: [...new Set(refs.filter((r) => !declared.has(r.name)).map((r) => r.name))],
|
|
255
|
+
unused: doc.parameters.filter((p) => !used.has(p.name)).map((p) => p.name),
|
|
256
|
+
misplaced: refs.filter((r) => !referenceAllowed(r.path)).map((r) => r.path.join(".")),
|
|
257
|
+
mediaSiteErrors
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
var escapeHtml = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
261
|
+
function bindTemplate(doc, values, media, opts = {}) {
|
|
262
|
+
const { undeclared, misplaced, mediaSiteErrors } = checkReferences(doc);
|
|
263
|
+
if (undeclared.length) throw new TemplateError("template_parameter_undeclared", `undeclared: ${undeclared.join(", ")}`);
|
|
264
|
+
if (misplaced.length || mediaSiteErrors.length) throw new TemplateError("template_values_invalid", [...misplaced.map((m) => `reference outside a string leaf: ${m}`), ...mediaSiteErrors].join("; "));
|
|
265
|
+
const byName = new Map(doc.parameters.map((p) => [p.name, p]));
|
|
266
|
+
const stray = [
|
|
267
|
+
...Object.keys(values).filter((k) => byName.get(k) === void 0 || byName.get(k).type === "media"),
|
|
268
|
+
...Object.keys(media).filter((k) => byName.get(k)?.type !== "media")
|
|
269
|
+
];
|
|
270
|
+
if (stray.length) throw new TemplateError("template_parameter_undeclared", `not declared by this template: ${stray.join(", ")}`, stray.map((param) => ({ param, reason: "not declared" })));
|
|
271
|
+
let base2 = {};
|
|
272
|
+
if (opts.preset !== void 0) {
|
|
273
|
+
const preset = doc.presets?.[opts.preset];
|
|
274
|
+
if (!preset) throw new TemplateError("template_values_invalid", `unknown preset ${opts.preset}`, [{ param: "preset", reason: `unknown preset ${opts.preset}` }]);
|
|
275
|
+
base2 = preset.values;
|
|
276
|
+
}
|
|
277
|
+
const merged = { ...base2, ...values };
|
|
278
|
+
const fields = [];
|
|
279
|
+
const resolved = /* @__PURE__ */ new Map();
|
|
280
|
+
const swapped = /* @__PURE__ */ new Map();
|
|
281
|
+
for (const p of doc.parameters) {
|
|
282
|
+
if (p.type === "media") {
|
|
283
|
+
const m = media[p.name];
|
|
284
|
+
if (!m) {
|
|
285
|
+
if (p.required) fields.push({ param: p.name, reason: "required" });
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
if (m.kind !== p.kind) throw new TemplateError("template_media_kind_mismatch", `${p.name}: expected ${p.kind}, got ${m.kind}`, [{ param: p.name, reason: `expected ${p.kind}` }]);
|
|
289
|
+
resolved.set(p.name, m.mediaId);
|
|
290
|
+
swapped.set(m.mediaId, m);
|
|
291
|
+
continue;
|
|
292
|
+
}
|
|
293
|
+
const raw = merged[p.name];
|
|
294
|
+
if (raw === void 0) {
|
|
295
|
+
if (p.default !== void 0) resolved.set(p.name, p.default);
|
|
296
|
+
else if (p.required) fields.push({ param: p.name, reason: "required" });
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const r = coerceParameterValue(p, raw);
|
|
300
|
+
if (r.ok) resolved.set(p.name, r.value);
|
|
301
|
+
else fields.push({ param: p.name, reason: r.reason });
|
|
302
|
+
}
|
|
303
|
+
for (const track of doc.composition.tracks) for (const clip of track.contents) {
|
|
304
|
+
const src = clip.source;
|
|
305
|
+
const ref = typeof src?.mediaId === "string" ? src.mediaId.match(REF)?.[1] : void 0;
|
|
306
|
+
const m = ref ? media[ref] : void 0;
|
|
307
|
+
if (m?.durationSec === void 0 || m.kind === "image" || src.loop) continue;
|
|
308
|
+
const excluded = (src.excludedRanges ?? []).reduce((sum, r) => sum + Math.max(0, r.end - r.start), 0);
|
|
309
|
+
const needs = src.trim ? src.trim.end : clip.duration * (src.playbackRate ?? 1) + excluded;
|
|
310
|
+
if (needs <= m.durationSec) continue;
|
|
311
|
+
fields.push({ param: ref, reason: src.trim ? `media is ${m.durationSec}s, template trims to ${src.trim.end}s` : `media is ${m.durationSec}s, clip needs ${needs}s` });
|
|
312
|
+
}
|
|
313
|
+
if (fields.length) throw new TemplateError("template_values_invalid", fields.map((f) => `${f.param}: ${f.reason}`).join("; "), fields);
|
|
314
|
+
const sub = (v, path) => {
|
|
315
|
+
if (typeof v === "string") {
|
|
316
|
+
const at = path.join(".");
|
|
317
|
+
const text = (x) => HTML_SITE.test(at) ? escapeHtml(String(x)) : String(x);
|
|
318
|
+
const whole = v.match(REF);
|
|
319
|
+
if (whole) {
|
|
320
|
+
const value = resolved.get(whole[1]);
|
|
321
|
+
if (value === void 0) return OMIT;
|
|
322
|
+
return TYPED_VALUE_SITE.test(at) ? value : text(value);
|
|
323
|
+
}
|
|
324
|
+
return v.replace(INLINE, (_, name2) => name2 === void 0 ? "{{" : text(resolved.get(name2) ?? ""));
|
|
325
|
+
}
|
|
326
|
+
if (Array.isArray(v)) {
|
|
327
|
+
return v.map((x, i) => {
|
|
328
|
+
const out2 = sub(x, [...path, String(i)]);
|
|
329
|
+
if (out2 === OMIT) fields.push({ param: String(x).match(REF)[1], reason: "required: it fills an array element" });
|
|
330
|
+
return out2;
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
if (v && typeof v === "object") {
|
|
334
|
+
return Object.fromEntries(Object.entries(v).map(([k, x]) => [k, sub(x, [...path, k])]).filter(([, x]) => x !== OMIT));
|
|
335
|
+
}
|
|
336
|
+
return v;
|
|
337
|
+
};
|
|
338
|
+
const out = sub(doc.composition, []);
|
|
339
|
+
if (fields.length) throw new TemplateError("template_values_invalid", fields.map((f) => `${f.param}: ${f.reason}`).join("; "), fields);
|
|
340
|
+
for (const track of out.tracks) for (const clip of track.contents) {
|
|
341
|
+
if (swapped.get(clip.source?.mediaId)?.kind === "image") {
|
|
342
|
+
delete clip.source.trim;
|
|
343
|
+
delete clip.source.excludedRanges;
|
|
344
|
+
delete clip.source.playbackRate;
|
|
345
|
+
delete clip.source.reframe;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
const valid = Composition.safeParse(out);
|
|
349
|
+
if (!valid.success) {
|
|
350
|
+
throw new TemplateError("template_values_invalid", `bound composition is invalid: ${valid.error.issues.map((i) => `${i.path.join(".")}: ${i.message}`).join("; ")}`);
|
|
351
|
+
}
|
|
352
|
+
return out;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export {
|
|
356
|
+
TEMPLATE_MAX_BYTES,
|
|
357
|
+
MATTE_KEY,
|
|
358
|
+
TemplateParameterSchema,
|
|
359
|
+
PRESET_NAME,
|
|
360
|
+
coerceParameterValue,
|
|
361
|
+
TemplateDocumentSchema,
|
|
362
|
+
TemplateError,
|
|
363
|
+
parseTemplateDocument,
|
|
364
|
+
findReferences,
|
|
365
|
+
checkReferences,
|
|
366
|
+
bindTemplate
|
|
367
|
+
};
|