@automovie/template 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +37 -2
- package/build/resolveTemplateVersions.ts +92 -0
- package/build/syncScaffoldInstructions.ts +28 -0
- package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.d.ts +14 -0
- package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js +52 -0
- package/lib/AUTOMOVIE_TEMPLATE_CATALOGS.js.map +1 -0
- package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.d.ts +2 -0
- package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js +42 -0
- package/lib/AUTOMOVIE_TEMPLATE_VERSIONS.js.map +1 -0
- package/lib/AutoMovieScaffoldLayer.d.ts +15 -0
- package/lib/AutoMovieScaffoldLayer.js +3 -0
- package/lib/AutoMovieScaffoldLayer.js.map +1 -0
- package/lib/FILE_ATTRIBUTE_DIRECTORY.d.ts +2 -0
- package/lib/FILE_ATTRIBUTE_DIRECTORY.js +6 -0
- package/lib/FILE_ATTRIBUTE_DIRECTORY.js.map +1 -0
- package/lib/IAutoMovieCatalogVersionProps.d.ts +16 -0
- package/lib/IAutoMovieCatalogVersionProps.js +3 -0
- package/lib/IAutoMovieCatalogVersionProps.js.map +1 -0
- package/lib/IAutoMovieScaffoldProps.d.ts +14 -0
- package/lib/IAutoMovieScaffoldProps.js +3 -0
- package/lib/IAutoMovieScaffoldProps.js.map +1 -0
- package/lib/IAutoMovieScaffoldSourceEntry.d.ts +18 -0
- package/lib/IAutoMovieScaffoldSourceEntry.js +3 -0
- package/lib/IAutoMovieScaffoldSourceEntry.js.map +1 -0
- package/lib/IAutoMovieTemplateDependencyVersionsProps.d.ts +17 -0
- package/lib/IAutoMovieTemplateDependencyVersionsProps.js +3 -0
- package/lib/IAutoMovieTemplateDependencyVersionsProps.js.map +1 -0
- package/lib/IAutoMovieWorkspacePackageVersions.d.ts +34 -0
- package/lib/IAutoMovieWorkspacePackageVersions.js +3 -0
- package/lib/IAutoMovieWorkspacePackageVersions.js.map +1 -0
- package/lib/IBoundChild.d.ts +71 -0
- package/lib/IBoundChild.js +3 -0
- package/lib/IBoundChild.js.map +1 -0
- package/lib/IBoundChildStatus.d.ts +20 -0
- package/lib/IBoundChildStatus.js +3 -0
- package/lib/IBoundChildStatus.js.map +1 -0
- package/lib/IBoundParent.d.ts +61 -0
- package/lib/IBoundParent.js +3 -0
- package/lib/IBoundParent.js.map +1 -0
- package/lib/IBoundParentStatus.d.ts +14 -0
- package/lib/IBoundParentStatus.js +3 -0
- package/lib/IBoundParentStatus.js.map +1 -0
- package/lib/ICreateResult.d.ts +27 -0
- package/lib/ICreateResult.js +3 -0
- package/lib/ICreateResult.js.map +1 -0
- package/lib/IScaffoldCompletedFilePublicationOutcome.d.ts +16 -0
- package/lib/IScaffoldCompletedFilePublicationOutcome.js +3 -0
- package/lib/IScaffoldCompletedFilePublicationOutcome.js.map +1 -0
- package/lib/IScaffoldCompletedPublication.d.ts +15 -0
- package/lib/IScaffoldCompletedPublication.js +3 -0
- package/lib/IScaffoldCompletedPublication.js.map +1 -0
- package/lib/IScaffoldFileSnapshot.d.ts +24 -0
- package/lib/IScaffoldFileSnapshot.js +3 -0
- package/lib/IScaffoldFileSnapshot.js.map +1 -0
- package/lib/IScaffoldParentPublicationRequest.d.ts +26 -0
- package/lib/IScaffoldParentPublicationRequest.js +3 -0
- package/lib/IScaffoldParentPublicationRequest.js.map +1 -0
- package/lib/IScaffoldPartialFilePublicationOutcome.d.ts +22 -0
- package/lib/IScaffoldPartialFilePublicationOutcome.js +3 -0
- package/lib/IScaffoldPartialFilePublicationOutcome.js.map +1 -0
- package/lib/IScaffoldPhysicalDirectory.d.ts +20 -0
- package/lib/IScaffoldPhysicalDirectory.js +3 -0
- package/lib/IScaffoldPhysicalDirectory.js.map +1 -0
- package/lib/IScaffoldPosixConstants.d.ts +24 -0
- package/lib/IScaffoldPosixConstants.js +3 -0
- package/lib/IScaffoldPosixConstants.js.map +1 -0
- package/lib/IScaffoldPublicationEntry.d.ts +20 -0
- package/lib/IScaffoldPublicationEntry.js +3 -0
- package/lib/IScaffoldPublicationEntry.js.map +1 -0
- package/lib/IScaffoldPublicationFailure.d.ts +18 -0
- package/lib/IScaffoldPublicationFailure.js +3 -0
- package/lib/IScaffoldPublicationFailure.js.map +1 -0
- package/lib/IScaffoldPublicationOptions.d.ts +17 -0
- package/lib/IScaffoldPublicationOptions.js +3 -0
- package/lib/IScaffoldPublicationOptions.js.map +1 -0
- package/lib/IScaffoldPublicationReceipt.d.ts +25 -0
- package/lib/IScaffoldPublicationReceipt.js +3 -0
- package/lib/IScaffoldPublicationReceipt.js.map +1 -0
- package/lib/IScaffoldRefusedFilePublicationOutcome.d.ts +18 -0
- package/lib/IScaffoldRefusedFilePublicationOutcome.js +3 -0
- package/lib/IScaffoldRefusedFilePublicationOutcome.js.map +1 -0
- package/lib/IScaffoldSyncPlan.d.ts +25 -0
- package/lib/IScaffoldSyncPlan.js +3 -0
- package/lib/IScaffoldSyncPlan.js.map +1 -0
- package/lib/IScaffoldSyncProps.d.ts +16 -0
- package/lib/IScaffoldSyncProps.js +3 -0
- package/lib/IScaffoldSyncProps.js.map +1 -0
- package/lib/IWindowsFileInformation.d.ts +20 -0
- package/lib/IWindowsFileInformation.js +3 -0
- package/lib/IWindowsFileInformation.js.map +1 -0
- package/lib/IWindowsLibrary.d.ts +127 -0
- package/lib/IWindowsLibrary.js +3 -0
- package/lib/IWindowsLibrary.js.map +1 -0
- package/lib/SCAFFOLD_SYNC_STATE_FILE.d.ts +4 -0
- package/lib/SCAFFOLD_SYNC_STATE_FILE.js +8 -0
- package/lib/SCAFFOLD_SYNC_STATE_FILE.js.map +1 -0
- package/lib/ScaffoldFilePublicationOutcome.d.ts +14 -0
- package/lib/ScaffoldFilePublicationOutcome.js +3 -0
- package/lib/ScaffoldFilePublicationOutcome.js.map +1 -0
- package/lib/ScaffoldParentChangedError.d.ts +11 -0
- package/lib/ScaffoldParentChangedError.js +19 -0
- package/lib/ScaffoldParentChangedError.js.map +1 -0
- package/lib/ScaffoldPublicationError.d.ts +17 -0
- package/lib/ScaffoldPublicationError.js +46 -0
- package/lib/ScaffoldPublicationError.js.map +1 -0
- package/lib/assertOrdinaryFile.d.ts +13 -0
- package/lib/assertOrdinaryFile.js +20 -0
- package/lib/assertOrdinaryFile.js.map +1 -0
- package/lib/assertOrdinarySingleLinkFile.d.ts +13 -0
- package/lib/assertOrdinarySingleLinkFile.js +22 -0
- package/lib/assertOrdinarySingleLinkFile.js.map +1 -0
- package/lib/assertScaffoldOwnership.d.ts +13 -0
- package/lib/assertScaffoldOwnership.js +24 -0
- package/lib/assertScaffoldOwnership.js.map +1 -0
- package/lib/assertScaffoldPhysicalDirectory.d.ts +16 -0
- package/lib/assertScaffoldPhysicalDirectory.js +26 -0
- package/lib/assertScaffoldPhysicalDirectory.js.map +1 -0
- package/lib/assertScaffoldProjectName.d.ts +18 -0
- package/lib/assertScaffoldProjectName.js +34 -0
- package/lib/assertScaffoldProjectName.js.map +1 -0
- package/lib/attachScaffoldSyncState.d.ts +18 -0
- package/lib/attachScaffoldSyncState.js +30 -0
- package/lib/attachScaffoldSyncState.js.map +1 -0
- package/lib/captureEmptyScaffoldPhysicalDirectory.d.ts +13 -0
- package/lib/captureEmptyScaffoldPhysicalDirectory.js +69 -0
- package/lib/captureEmptyScaffoldPhysicalDirectory.js.map +1 -0
- package/lib/captureScaffoldFile.d.ts +13 -0
- package/lib/captureScaffoldFile.js +67 -0
- package/lib/captureScaffoldFile.js.map +1 -0
- package/lib/captureScaffoldPhysicalDirectory.d.ts +13 -0
- package/lib/captureScaffoldPhysicalDirectory.js +63 -0
- package/lib/captureScaffoldPhysicalDirectory.js.map +1 -0
- package/lib/combineScaffoldFailures.d.ts +19 -0
- package/lib/combineScaffoldFailures.js +32 -0
- package/lib/combineScaffoldFailures.js.map +1 -0
- package/lib/createAutoMovieCatalogVersionResolver.d.ts +17 -0
- package/lib/createAutoMovieCatalogVersionResolver.js +64 -0
- package/lib/createAutoMovieCatalogVersionResolver.js.map +1 -0
- package/lib/createScaffoldSyncState.d.ts +12 -0
- package/lib/createScaffoldSyncState.js +26 -0
- package/lib/createScaffoldSyncState.js.map +1 -0
- package/lib/createScaffoldVariables.d.ts +25 -0
- package/lib/createScaffoldVariables.js +41 -0
- package/lib/createScaffoldVariables.js.map +1 -0
- package/lib/ensureScaffoldBaseDirectory.d.ts +19 -0
- package/lib/ensureScaffoldBaseDirectory.js +89 -0
- package/lib/ensureScaffoldBaseDirectory.js.map +1 -0
- package/lib/ensureScaffoldFileDirectory.d.ts +25 -0
- package/lib/ensureScaffoldFileDirectory.js +103 -0
- package/lib/ensureScaffoldFileDirectory.js.map +1 -0
- package/lib/index.d.ts +47 -0
- package/lib/index.js +64 -0
- package/lib/index.js.map +1 -0
- package/lib/inside.d.ts +12 -0
- package/lib/inside.js +57 -0
- package/lib/inside.js.map +1 -0
- package/lib/isScaffoldInstruction.d.ts +12 -0
- package/lib/isScaffoldInstruction.js +29 -0
- package/lib/isScaffoldInstruction.js.map +1 -0
- package/lib/listAutoMovieScaffoldFiles.d.ts +17 -0
- package/lib/listAutoMovieScaffoldFiles.js +87 -0
- package/lib/listAutoMovieScaffoldFiles.js.map +1 -0
- package/lib/loadWindowsLibrary.d.ts +13 -0
- package/lib/loadWindowsLibrary.js +180 -0
- package/lib/loadWindowsLibrary.js.map +1 -0
- package/lib/mergeScaffoldFiles.d.ts +18 -0
- package/lib/mergeScaffoldFiles.js +37 -0
- package/lib/mergeScaffoldFiles.js.map +1 -0
- package/lib/missingPath.d.ts +12 -0
- package/lib/missingPath.js +18 -0
- package/lib/missingPath.js.map +1 -0
- package/lib/nativeError.d.ts +12 -0
- package/lib/nativeError.js +17 -0
- package/lib/nativeError.js.map +1 -0
- package/lib/openPosixParent.d.ts +13 -0
- package/lib/openPosixParent.js +135 -0
- package/lib/openPosixParent.js.map +1 -0
- package/lib/openWindowsParent.d.ts +13 -0
- package/lib/openWindowsParent.js +224 -0
- package/lib/openWindowsParent.js.map +1 -0
- package/lib/overwriteScaffoldFile.d.ts +22 -0
- package/lib/overwriteScaffoldFile.js +214 -0
- package/lib/overwriteScaffoldFile.js.map +1 -0
- package/lib/physicalDirectoryIdentity.d.ts +15 -0
- package/lib/physicalDirectoryIdentity.js +65 -0
- package/lib/physicalDirectoryIdentity.js.map +1 -0
- package/lib/physicalVersion.d.ts +13 -0
- package/lib/physicalVersion.js +18 -0
- package/lib/physicalVersion.js.map +1 -0
- package/lib/planScaffoldPublication.d.ts +22 -0
- package/lib/planScaffoldPublication.js +100 -0
- package/lib/planScaffoldPublication.js.map +1 -0
- package/lib/planScaffoldSync.d.ts +14 -0
- package/lib/planScaffoldSync.js +102 -0
- package/lib/planScaffoldSync.js.map +1 -0
- package/lib/publishFiles.d.ts +23 -0
- package/lib/publishFiles.js +124 -0
- package/lib/publishFiles.js.map +1 -0
- package/lib/publishNativeScaffoldFile.d.ts +21 -0
- package/lib/publishNativeScaffoldFile.js +211 -0
- package/lib/publishNativeScaffoldFile.js.map +1 -0
- package/lib/publishScaffoldCandidate.d.ts +24 -0
- package/lib/publishScaffoldCandidate.js +70 -0
- package/lib/publishScaffoldCandidate.js.map +1 -0
- package/lib/readAutoMovieScaffoldSources.d.ts +20 -0
- package/lib/readAutoMovieScaffoldSources.js +103 -0
- package/lib/readAutoMovieScaffoldSources.js.map +1 -0
- package/lib/readScaffoldSyncFile.d.ts +16 -0
- package/lib/readScaffoldSyncFile.js +64 -0
- package/lib/readScaffoldSyncFile.js.map +1 -0
- package/lib/renderScaffold.d.ts +19 -0
- package/lib/renderScaffold.js +33 -0
- package/lib/renderScaffold.js.map +1 -0
- package/lib/renderScaffoldEntries.d.ts +20 -0
- package/lib/renderScaffoldEntries.js +106 -0
- package/lib/renderScaffoldEntries.js.map +1 -0
- package/lib/renderScaffoldInstructions.d.ts +17 -0
- package/lib/renderScaffoldInstructions.js +23 -0
- package/lib/renderScaffoldInstructions.js.map +1 -0
- package/lib/renderScaffoldLayer.d.ts +20 -0
- package/lib/renderScaffoldLayer.js +28 -0
- package/lib/renderScaffoldLayer.js.map +1 -0
- package/lib/renderTemplate.d.ts +19 -0
- package/lib/renderTemplate.js +56 -0
- package/lib/renderTemplate.js.map +1 -0
- package/lib/renderWorkspaceProductionScaffold.d.ts +19 -0
- package/lib/renderWorkspaceProductionScaffold.js +30 -0
- package/lib/renderWorkspaceProductionScaffold.js.map +1 -0
- package/lib/renderWorkspaceScaffold.d.ts +19 -0
- package/lib/renderWorkspaceScaffold.js +33 -0
- package/lib/renderWorkspaceScaffold.js.map +1 -0
- package/lib/replaceSharedScaffoldFile.d.ts +30 -0
- package/lib/replaceSharedScaffoldFile.js +106 -0
- package/lib/replaceSharedScaffoldFile.js.map +1 -0
- package/lib/resolveAutoMovieCatalogVersion.d.ts +19 -0
- package/lib/resolveAutoMovieCatalogVersion.js +24 -0
- package/lib/resolveAutoMovieCatalogVersion.js.map +1 -0
- package/lib/resolveAutoMovieTemplateDependencyVersions.d.ts +19 -0
- package/lib/resolveAutoMovieTemplateDependencyVersions.js +62 -0
- package/lib/resolveAutoMovieTemplateDependencyVersions.js.map +1 -0
- package/lib/resolveScaffoldPosixConstants.d.ts +13 -0
- package/lib/resolveScaffoldPosixConstants.js +44 -0
- package/lib/resolveScaffoldPosixConstants.js.map +1 -0
- package/lib/scaffoldAssetDirectory.d.ts +19 -0
- package/lib/scaffoldAssetDirectory.js +63 -0
- package/lib/scaffoldAssetDirectory.js.map +1 -0
- package/lib/scaffoldPhysicalIdentity.d.ts +18 -0
- package/lib/scaffoldPhysicalIdentity.js +22 -0
- package/lib/scaffoldPhysicalIdentity.js.map +1 -0
- package/lib/scaffoldSharedSkillDirectory.d.ts +17 -0
- package/lib/scaffoldSharedSkillDirectory.js +62 -0
- package/lib/scaffoldSharedSkillDirectory.js.map +1 -0
- package/lib/scaffoldSharedSkillPath.d.ts +17 -0
- package/lib/scaffoldSharedSkillPath.js +66 -0
- package/lib/scaffoldSharedSkillPath.js.map +1 -0
- package/lib/skills/3d-modeling/conditioning.md +82 -0
- package/lib/skills/3d-modeling/crafting.md +82 -0
- package/lib/skills/3d-modeling/diffusion.md +34 -0
- package/lib/skills/3d-modeling/inspection.md +54 -0
- package/lib/skills/3d-modeling/lofting.md +43 -0
- package/lib/skills/3d-modeling/modularization.md +31 -0
- package/lib/skills/3d-modeling/recovery.md +29 -0
- package/lib/skills/3d-modeling/rigging.md +97 -0
- package/lib/skills/3d-modeling/sources.md +29 -0
- package/lib/skills/contracts/development/common.md +13 -0
- package/lib/skills/contracts/development/design.md +28 -0
- package/lib/skills/contracts/development/implementation.md +49 -0
- package/lib/skills/contracts/development/testing.md +27 -0
- package/lib/skills/development/repair.md +13 -0
- package/lib/skills/documentation/SKILL.md +25 -0
- package/lib/skills/documentation/writing.md +51 -0
- package/lib/skills/motion/authoring.md +51 -0
- package/lib/skills/motion/contacts.md +39 -0
- package/lib/skills/motion/laws.md +23 -0
- package/lib/skills/motion/layers.md +7 -0
- package/lib/skills/motion/transitions.md +27 -0
- package/lib/skills/motion/variation.md +23 -0
- package/lib/skills/motion/verification.md +36 -0
- package/lib/skills/prompting/SKILL.md +80 -0
- package/lib/skills/visual-debugging/capture.md +60 -0
- package/lib/skills/visual-debugging/comparison.md +35 -0
- package/lib/skills/visual-debugging/correction-rounds.md +34 -0
- package/lib/skills/visual-debugging/passes.md +29 -0
- package/lib/skills/visual-debugging/rendering-cost.md +5 -0
- package/lib/syncScaffold.d.ts +19 -0
- package/lib/syncScaffold.js +28 -0
- package/lib/syncScaffold.js.map +1 -0
- package/lib/writeFiles.d.ts +20 -0
- package/lib/writeFiles.js +33 -0
- package/lib/writeFiles.js.map +1 -0
- package/lib/writeScaffoldFile.d.ts +35 -0
- package/lib/writeScaffoldFile.js +107 -0
- package/lib/writeScaffoldFile.js.map +1 -0
- package/lib/writtenVersion.d.ts +13 -0
- package/lib/writtenVersion.js +18 -0
- package/lib/writtenVersion.js.map +1 -0
- package/package.json +59 -3
- package/scaffold/instructions/.agents/skills/$documentation +0 -0
- package/scaffold/instructions/.agents/skills/$prompting +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$conditioning.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$crafting.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$diffusion.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$inspection.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$lofting.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$modularization.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$recovery.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$rigging.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/$sources.md +0 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/SKILL.md +32 -0
- package/scaffold/instructions/.agents/skills/3d-modeling/coarse-forms.md +25 -0
- package/scaffold/instructions/.agents/skills/audio/SKILL.md +28 -0
- package/scaffold/instructions/.agents/skills/audio/acquisition.md +25 -0
- package/scaffold/instructions/.agents/skills/audio/local-speech.md +11 -0
- package/scaffold/instructions/.agents/skills/audio/sound-effects.md +29 -0
- package/scaffold/instructions/.agents/skills/contracts/SKILL.md +41 -0
- package/scaffold/instructions/.agents/skills/contracts/development/$common.md +0 -0
- package/scaffold/instructions/.agents/skills/contracts/development/$design.md +0 -0
- package/scaffold/instructions/.agents/skills/contracts/development/$implementation.md +0 -0
- package/scaffold/instructions/.agents/skills/contracts/development/$testing.md +0 -0
- package/scaffold/instructions/.agents/skills/contracts/development/SKILL.md +22 -0
- package/scaffold/instructions/.agents/skills/contracts/development/behaviors.md +25 -0
- package/scaffold/instructions/.agents/skills/contracts/development/composition.md +29 -0
- package/scaffold/instructions/.agents/skills/contracts/development/entities.md +27 -0
- package/scaffold/instructions/.agents/skills/contracts/development/statements/behaviors.md +42 -0
- package/scaffold/instructions/.agents/skills/contracts/development/statements/composition.md +32 -0
- package/scaffold/instructions/.agents/skills/contracts/development/statements/entities.md +34 -0
- package/scaffold/instructions/.agents/skills/contracts/story/SKILL.md +44 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/brief.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/common.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/narratives.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/screenplay.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/scripts.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/settings.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/discovery/treatments.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/common.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/common.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/realized.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/screenplay.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/obligations/scripts.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/realized.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/screenplay.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/naturalness/scripts.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/brief.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/common.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/index.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/narratives.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/review.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/screenplay.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/scripts.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/settings.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/obligations/treatments.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/brief.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/common.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/index.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/narratives.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/realized.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/research.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/review.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/screenplay.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/scripts.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/settings.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/principles/treatments.md +13 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/brief.md +21 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/common.md +42 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/narratives.md +8 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/screenplay.md +15 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/scripts.md +11 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/settings.md +25 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/discovery/treatments.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/common.md +94 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/common.md +20 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/realized.md +15 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/screenplay.md +11 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/obligations/scripts.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/realized.md +19 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/screenplay.md +25 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/naturalness/scripts.md +19 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/brief.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/common.md +31 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/index.md +15 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/narratives.md +43 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/review.md +37 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/screenplay.md +26 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/scripts.md +26 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/settings.md +38 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/obligations/treatments.md +31 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/brief.md +21 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/common.md +15 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/index.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/narratives.md +41 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/realized.md +17 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/research.md +34 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/review.md +37 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/screenplay.md +82 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/scripts.md +45 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/settings.md +34 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/principles/treatments.md +27 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/screenplay.md +14 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/scripts.md +12 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/statements/upstream/treatments.md +10 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/screenplay.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/scripts.md +9 -0
- package/scaffold/instructions/.agents/skills/contracts/story/shared/upstream/treatments.md +9 -0
- package/scaffold/instructions/.agents/skills/development/$repair.md +0 -0
- package/scaffold/instructions/.agents/skills/development/SKILL.md +33 -0
- package/scaffold/instructions/.agents/skills/development/entities.md +43 -0
- package/scaffold/instructions/.agents/skills/development/reuse.md +47 -0
- package/scaffold/instructions/.agents/skills/development/source-layout.md +69 -0
- package/scaffold/instructions/.agents/skills/development/testing.md +27 -0
- package/scaffold/instructions/.agents/skills/evidence/SKILL.md +16 -0
- package/scaffold/instructions/.agents/skills/evidence/adoption.md +11 -0
- package/scaffold/instructions/.agents/skills/evidence/answering.md +11 -0
- package/scaffold/instructions/.agents/skills/evidence/configuration.md +23 -0
- package/scaffold/instructions/.agents/skills/image/SKILL.md +69 -0
- package/scaffold/instructions/.agents/skills/motion/$authoring.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$contacts.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$laws.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$layers.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$transitions.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$variation.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/$verification.md +0 -0
- package/scaffold/instructions/.agents/skills/motion/SKILL.md +55 -0
- package/scaffold/instructions/.agents/skills/motion/catalog-cases.md +11 -0
- package/scaffold/instructions/.agents/skills/motion/control-channels.md +19 -0
- package/scaffold/instructions/.agents/skills/motion/frame-evaluation.md +25 -0
- package/scaffold/instructions/.agents/skills/motion/method-references.md +23 -0
- package/scaffold/instructions/.agents/skills/motion/physical-feedback.md +31 -0
- package/scaffold/instructions/.agents/skills/motion/retargeting.md +23 -0
- package/scaffold/instructions/.agents/skills/motion/segment-review.md +17 -0
- package/scaffold/instructions/.agents/skills/motion/staging.md +29 -0
- package/scaffold/instructions/.agents/skills/production/SKILL.md +45 -0
- package/scaffold/instructions/.agents/skills/production/assembly.md +30 -0
- package/scaffold/instructions/.agents/skills/production/media-records.md +29 -0
- package/scaffold/instructions/.agents/skills/production/project-context.md +25 -0
- package/scaffold/instructions/.agents/skills/production/stage-caches.md +30 -0
- package/scaffold/instructions/.agents/skills/production/sustained-runs.md +21 -0
- package/scaffold/instructions/.agents/skills/production/sync-and-reorganization.md +21 -0
- package/scaffold/instructions/.agents/skills/review/SKILL.md +24 -0
- package/scaffold/instructions/.agents/skills/review/delivery-review.md +65 -0
- package/scaffold/instructions/.agents/skills/review/estimation.md +48 -0
- package/scaffold/instructions/.agents/skills/review/independent-reading.md +39 -0
- package/scaffold/instructions/.agents/skills/review/narrative-rounds.md +53 -0
- package/scaffold/instructions/.agents/skills/review/source-review.md +31 -0
- package/scaffold/instructions/.agents/skills/story/SKILL.md +20 -0
- package/scaffold/instructions/.agents/skills/story/correction/SKILL.md +13 -0
- package/scaffold/instructions/.agents/skills/story/correction/inspection.md +29 -0
- package/scaffold/instructions/.agents/skills/story/correction/repair.md +35 -0
- package/scaffold/instructions/.agents/skills/story/document-layout.md +38 -0
- package/scaffold/instructions/.agents/skills/story/evidence/SKILL.md +13 -0
- package/scaffold/instructions/.agents/skills/story/evidence/answer-placement.md +13 -0
- package/scaffold/instructions/.agents/skills/story/evidence/answer-writing.md +23 -0
- package/scaffold/instructions/.agents/skills/story/layers/SKILL.md +17 -0
- package/scaffold/instructions/.agents/skills/story/layers/brief.md +29 -0
- package/scaffold/instructions/.agents/skills/story/layers/notation.md +34 -0
- package/scaffold/instructions/.agents/skills/story/layers/screenplay.md +15 -0
- package/scaffold/instructions/.agents/skills/story/layers/scripts.md +11 -0
- package/scaffold/instructions/.agents/skills/story/layers/settings.md +39 -0
- package/scaffold/instructions/.agents/skills/story/layers/treatments.md +9 -0
- package/scaffold/instructions/.agents/skills/story/naturalness/SKILL.md +13 -0
- package/scaffold/instructions/.agents/skills/story/naturalness/rewriting.md +17 -0
- package/scaffold/instructions/.agents/skills/story/naturalness/transfer.md +11 -0
- package/scaffold/instructions/.agents/skills/story/planning/SKILL.md +15 -0
- package/scaffold/instructions/.agents/skills/story/planning/direction.md +14 -0
- package/scaffold/instructions/.agents/skills/story/planning/discovery.md +20 -0
- package/scaffold/instructions/.agents/skills/story/planning/requirements.md +25 -0
- package/scaffold/instructions/.agents/skills/story/planning/research.md +25 -0
- package/scaffold/instructions/.agents/skills/story/workflow.md +61 -0
- package/scaffold/instructions/.agents/skills/video/SKILL.md +29 -0
- package/scaffold/instructions/.agents/skills/video/diffusion.md +33 -0
- package/scaffold/instructions/.agents/skills/video/generation.md +27 -0
- package/scaffold/instructions/.agents/skills/video/prompts.md +51 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/$capture.md +0 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/$comparison.md +0 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/$correction-rounds.md +0 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/$passes.md +0 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/$rendering-cost.md +0 -0
- package/scaffold/instructions/.agents/skills/visual-debugging/SKILL.md +30 -0
- package/scaffold/instructions/AGENTS.md +96 -0
- package/scaffold/instructions/CLAUDE.md +1 -0
- package/scaffold/production/PROJECT.md +3 -0
- package/scaffold/production/README.md +146 -0
- package/scaffold/production/_gitignore +20 -0
- package/scaffold/production/evidence.config.ts +12 -0
- package/scaffold/production/index.html +20 -0
- package/scaffold/production/lint.config.ts +46 -0
- package/scaffold/production/package.json +54 -0
- package/scaffold/production/src/IFilm.ts +41 -0
- package/scaffold/production/src/IFilmProduction.ts +80 -0
- package/scaffold/production/src/clampProductionSeconds.ts +21 -0
- package/scaffold/production/src/composition/films/index.ts +10 -0
- package/scaffold/production/src/composition/films/starter.ts +45 -0
- package/scaffold/production/src/executable/capture.ts +489 -0
- package/scaffold/production/src/executable/physics.ts +48 -0
- package/scaffold/production/src/executable/planCaptureStills.ts +65 -0
- package/scaffold/production/src/executable/recovery/node/artifact/archiveAutoMovieRecoveryModel.ts +171 -0
- package/scaffold/production/src/executable/recovery/node/artifact/createAutoMovieRecoveryArtifact.ts +268 -0
- package/scaffold/production/src/executable/recovery/node/artifact/index.ts +3 -0
- package/scaffold/production/src/executable/recovery/node/artifact/writeAutoMovieRecoveryArtifact.ts +303 -0
- package/scaffold/production/src/executable/recovery/node/cli.ts +12 -0
- package/scaffold/production/src/executable/recovery/node/index.ts +9 -0
- package/scaffold/production/src/executable/recovery/node/internal/IAutoMovieRecoveryMemoryUsage.ts +25 -0
- package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTable.ts +95 -0
- package/scaffold/production/src/executable/recovery/node/internal/RecoveryFileVectorTableInput.ts +50 -0
- package/scaffold/production/src/executable/recovery/node/internal/createRecoveryFileVectorTable.ts +181 -0
- package/scaffold/production/src/executable/recovery/node/internal/observeRecoveryAtlas.ts +492 -0
- package/scaffold/production/src/executable/recovery/node/internal/readAutoMovieRecoveryBoundedFile.ts +57 -0
- package/scaffold/production/src/executable/recovery/node/internal/readRecoveryCameraImages.ts +80 -0
- package/scaffold/production/src/executable/recovery/node/internal/readRecoveryFixedReference.ts +26 -0
- package/scaffold/production/src/executable/recovery/node/internal/recovery.ts +272 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryAtlas.ts +152 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraMap.ts +113 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryCameraScene.ts +117 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryCameras.ts +158 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryContourPath.ts +185 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryImages.ts +176 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryLocal.ts +151 -0
- package/scaffold/production/src/executable/recovery/node/internal/recoveryOpen.ts +237 -0
- package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryContourFileMesh.ts +265 -0
- package/scaffold/production/src/executable/recovery/node/mesh/createAutoMovieRecoveryMeshSpool.ts +252 -0
- package/scaffold/production/src/executable/recovery/node/mesh/index.ts +3 -0
- package/scaffold/production/src/executable/recovery/node/mesh/readAutoMovieRecoveryMeshFrontier.ts +239 -0
- package/scaffold/production/src/executable/recovery/node/publishAutoMovieRecoveryArtifact.ts +63 -0
- package/scaffold/production/src/executable/recovery/node/reconstruction/index.ts +1 -0
- package/scaffold/production/src/executable/recovery/node/reconstruction/reconstructAutoMovieRecoveryLocal.ts +473 -0
- package/scaffold/production/src/executable/recovery/node/runAutoMovieRecoveryCommand.ts +148 -0
- package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureError.ts +1 -0
- package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessCaptureErrorCode.ts +1 -0
- package/scaffold/production/src/executable/render/headlessCapture/AutoMovieHeadlessWaitUntil.ts +1 -0
- package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureOptions.ts +79 -0
- package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessCaptureSession.ts +39 -0
- package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessFrameWriter.ts +20 -0
- package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessLocator.ts +1 -0
- package/scaffold/production/src/executable/render/headlessCapture/IAutoMovieHeadlessPage.ts +1 -0
- package/scaffold/production/src/executable/render/headlessCapture/createHeadlessCaptureAdapter.ts +92 -0
- package/scaffold/production/src/executable/render/headlessCapture/index.ts +9 -0
- package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoOptions.ts +128 -0
- package/scaffold/production/src/executable/render/node/IAutoMovieViewerVideoResult.ts +43 -0
- package/scaffold/production/src/executable/render/node/IProductionRenditionClip.ts +44 -0
- package/scaffold/production/src/executable/render/node/acquireViewerBrowser.ts +24 -0
- package/scaffold/production/src/executable/render/node/addProductionMp4Sample.ts +89 -0
- package/scaffold/production/src/executable/render/node/appendLosslessVideoClip.ts +62 -0
- package/scaffold/production/src/executable/render/node/assembleProductionChunkVideoMp4.ts +167 -0
- package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionClips.ts +184 -0
- package/scaffold/production/src/executable/render/node/assertProductionFeatureUsesRenditionVideo.ts +127 -0
- package/scaffold/production/src/executable/render/node/assertProductionRenditionClipDelivery.ts +102 -0
- package/scaffold/production/src/executable/render/node/cache/IAutoMovieDirectoryArtifactStore.ts +59 -0
- package/scaffold/production/src/executable/render/node/cache/IAutoMovieViewerFrameCacheReport.ts +30 -0
- package/scaffold/production/src/executable/render/node/cache/cacheViewerCaptureSession.ts +187 -0
- package/scaffold/production/src/executable/render/node/cache/composeViewerFrameKeys.ts +55 -0
- package/scaffold/production/src/executable/render/node/cache/createAutoMovieArtifactMiddleware.ts +107 -0
- package/scaffold/production/src/executable/render/node/cache/createAutoMovieDirectoryArtifactStore.ts +203 -0
- package/scaffold/production/src/executable/render/node/cache/digestAutoMovieSourceTree.ts +66 -0
- package/scaffold/production/src/executable/render/node/cache/readViewerFrameStates.ts +95 -0
- package/scaffold/production/src/executable/render/node/capture/DEFAULT_CHROME_EXECUTABLE.ts +11 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageOperationFailure.ts +13 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeArtifact.ts +30 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageRenderAndSeeOptions.ts +51 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceMetadata.ts +27 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderArtifact.ts +44 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMoviePageSequenceRenderOptions.ts +43 -0
- package/scaffold/production/src/executable/render/node/capture/IAutoMovieSequenceDissolvePixelCheck.ts +39 -0
- package/scaffold/production/src/executable/render/node/capture/captureRenderAndSee.ts +233 -0
- package/scaffold/production/src/executable/render/node/capture/captureSequenceRenderAndSee.ts +377 -0
- package/scaffold/production/src/executable/render/node/capture/index.ts +14 -0
- package/scaffold/production/src/executable/render/node/capture/preserveCleanupFailure.ts +34 -0
- package/scaffold/production/src/executable/render/node/capture/renderAndSeeCommand.ts +169 -0
- package/scaffold/production/src/executable/render/node/capture/renderSequenceAndSeeCommand.ts +165 -0
- package/scaffold/production/src/executable/render/node/capture/verifySequenceDissolvePixels.ts +179 -0
- package/scaffold/production/src/executable/render/node/conformProductionRenditionVideoMp4.ts +86 -0
- package/scaffold/production/src/executable/render/node/conformProductionVisualDeliveryVideoMp4.ts +230 -0
- package/scaffold/production/src/executable/render/node/decodeAutoMovieDelivery.ts +253 -0
- package/scaffold/production/src/executable/render/node/equalRational.ts +36 -0
- package/scaffold/production/src/executable/render/node/exactProductionClockProduct.ts +26 -0
- package/scaffold/production/src/executable/render/node/exportModelToGLB.ts +267 -0
- package/scaffold/production/src/executable/render/node/index.ts +27 -0
- package/scaffold/production/src/executable/render/node/loadModelGltfCore.ts +18 -0
- package/scaffold/production/src/executable/render/node/mixAutoMovieAudioCues.ts +74 -0
- package/scaffold/production/src/executable/render/node/muxProductionFeatureMp4.ts +170 -0
- package/scaffold/production/src/executable/render/node/neutralTrackPresentation.ts +59 -0
- package/scaffold/production/src/executable/render/node/normalizeProductionH264Mp4.ts +110 -0
- package/scaffold/production/src/executable/render/node/openLosslessVideoTrack.ts +81 -0
- package/scaffold/production/src/executable/render/node/parseMp4.ts +46 -0
- package/scaffold/production/src/executable/render/node/parseProductionMp4Output.ts +70 -0
- package/scaffold/production/src/executable/render/node/parseProductionRenditionClip.ts +92 -0
- package/scaffold/production/src/executable/render/node/planViewerVideo.ts +140 -0
- package/scaffold/production/src/executable/render/node/probeParsedProductionVideoMp4.ts +48 -0
- package/scaffold/production/src/executable/render/node/probeProductionPngPicture.ts +223 -0
- package/scaffold/production/src/executable/render/node/probeProductionRenderedMedia.ts +355 -0
- package/scaffold/production/src/executable/render/node/probeProductionVideoMp4.ts +27 -0
- package/scaffold/production/src/executable/render/node/probeVideoTrack.ts +220 -0
- package/scaffold/production/src/executable/render/node/productionRenditionVideoPlan.ts +149 -0
- package/scaffold/production/src/executable/render/node/recordViewerPlayback.ts +137 -0
- package/scaffold/production/src/executable/render/node/renderViewerFrames.ts +139 -0
- package/scaffold/production/src/executable/render/node/renderViewerVideo.ts +301 -0
- package/scaffold/production/src/executable/render/node/renderViewerVideoSession.ts +75 -0
- package/scaffold/production/src/executable/render/node/residentMp4Box.ts +36 -0
- package/scaffold/production/src/executable/render/node/residentPngJs.ts +26 -0
- package/scaffold/production/src/executable/render/node/runViewerVideoEncoder.ts +58 -0
- package/scaffold/production/src/executable/render/node/sameSampleDescription.ts +43 -0
- package/scaffold/production/src/executable/render/node/sameSampleFlags.ts +28 -0
- package/scaffold/production/src/executable/render/node/sampleBytes.ts +46 -0
- package/scaffold/production/src/executable/render/node/sampleDescription.ts +40 -0
- package/scaffold/production/src/executable/render/node/sampleOptions.ts +37 -0
- package/scaffold/production/src/executable/render/node/serializeDescriptionBox.ts +29 -0
- package/scaffold/production/src/executable/render/node/trimProductionAudioPresentation.ts +115 -0
- package/scaffold/production/src/executable/render/node/verifySampleStorage.ts +86 -0
- package/scaffold/production/src/executable/render/node/writeViewerFrameSheet.ts +101 -0
- package/scaffold/production/src/executable/render.ts +92 -0
- package/scaffold/production/src/executable/review.ts +54 -0
- package/scaffold/production/src/executable/viewer/inspection/createViewerDiskSource.ts +119 -0
- package/scaffold/production/src/executable/viewer/inspection/readViewerMaintainedSourceFiles.ts +64 -0
- package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureError.ts +41 -0
- package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessCaptureErrorCode.ts +22 -0
- package/scaffold/production/src/executable/viewer/node/capture/AutoMovieHeadlessWaitUntil.ts +18 -0
- package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessLocator.ts +32 -0
- package/scaffold/production/src/executable/viewer/node/capture/IAutoMovieHeadlessPage.ts +130 -0
- package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureOptions.ts +38 -0
- package/scaffold/production/src/executable/viewer/node/capture/IViewerCaptureSession.ts +41 -0
- package/scaffold/production/src/executable/viewer/node/capture/createViewerCaptureSession.ts +154 -0
- package/scaffold/production/src/executable/viewer/node/capture/index.ts +8 -0
- package/scaffold/production/src/executable/viewer/node/index.ts +2 -0
- package/scaffold/production/src/executable/viewer/process/ProcessOwnership.ts +102 -0
- package/scaffold/production/src/executable/viewer/process/internal/IProcessChildObservation.ts +18 -0
- package/scaffold/production/src/executable/viewer/process/internal/IProcessOwnershipHost.ts +70 -0
- package/scaffold/production/src/executable/viewer/process/internal/ProcessOwnershipController.ts +125 -0
- package/scaffold/production/src/executable/viewer/process/internal/WindowsProcessOwnershipPrograms.ts +52 -0
- package/scaffold/production/src/executable/viewer/process/internal/createNodeProcessOwnershipHost.ts +41 -0
- package/scaffold/production/src/executable/viewer/process/internal/decodeLinuxProcessIdentity.ts +22 -0
- package/scaffold/production/src/executable/viewer/process/internal/decodePosixProcessIdentity.ts +24 -0
- package/scaffold/production/src/executable/viewer/process/internal/decodeWindowsProcessResult.ts +24 -0
- package/scaffold/production/src/executable/viewer/process/internal/readNativeProcessIdentity.ts +45 -0
- package/scaffold/production/src/executable/viewer/process/internal/requireProcessId.ts +15 -0
- package/scaffold/production/src/executable/viewer/process/internal/resolveProcessIdentityReadError.ts +15 -0
- package/scaffold/production/src/executable/viewer/process/internal/runWindowsProcessOperation.ts +41 -0
- package/scaffold/production/src/executable/viewer/process/internal/selectProcessOwnershipTree.ts +68 -0
- package/scaffold/production/src/main.ts +197 -0
- package/scaffold/production/src/selectFilm.ts +34 -0
- package/scaffold/production/test/features/executable/test_plan_capture_stills.ts +75 -0
- package/scaffold/production/test/features/test_clamp_production_seconds.ts +39 -0
- package/scaffold/production/test/features/test_select_film.ts +59 -0
- package/scaffold/production/test/features/testing/test_test_execution.ts +57 -0
- package/scaffold/production/test/features/testing/test_test_selection.ts +78 -0
- package/scaffold/production/test/helpers/assessTestExecution.ts +22 -0
- package/scaffold/production/test/helpers/selectTestFiles.ts +79 -0
- package/scaffold/production/test/index.ts +64 -0
- package/scaffold/production/test/tsconfig.json +6 -0
- package/scaffold/production/tsconfig.json +34 -0
- package/scaffold/production/tsconfig.test.json +9 -0
- package/scaffold/production/vite.config.ts +35 -0
- package/scaffold/workspace/README.md +42 -0
- package/scaffold/workspace/_gitignore +9 -0
- package/scaffold/workspace/package.json +19 -0
- package/scaffold/workspace/pnpm-workspace.yaml +46 -0
- package/src/AUTOMOVIE_TEMPLATE_CATALOGS.ts +48 -0
- package/src/AUTOMOVIE_TEMPLATE_VERSIONS.ts +39 -0
- package/src/AutoMovieScaffoldLayer.ts +18 -0
- package/src/FILE_ATTRIBUTE_DIRECTORY.ts +2 -0
- package/src/IAutoMovieCatalogVersionProps.ts +18 -0
- package/src/IAutoMovieScaffoldProps.ts +14 -0
- package/src/IAutoMovieScaffoldSourceEntry.ts +19 -0
- package/src/IAutoMovieTemplateDependencyVersionsProps.ts +19 -0
- package/src/IAutoMovieWorkspacePackageVersions.ts +44 -0
- package/src/IBoundChild.ts +86 -0
- package/src/IBoundChildStatus.ts +24 -0
- package/src/IBoundParent.ts +65 -0
- package/src/IBoundParentStatus.ts +15 -0
- package/src/ICreateResult.ts +35 -0
- package/src/IScaffoldCompletedFilePublicationOutcome.ts +17 -0
- package/src/IScaffoldCompletedPublication.ts +17 -0
- package/src/IScaffoldFileSnapshot.ts +28 -0
- package/src/IScaffoldParentPublicationRequest.ts +29 -0
- package/src/IScaffoldPartialFilePublicationOutcome.ts +25 -0
- package/src/IScaffoldPhysicalDirectory.ts +22 -0
- package/src/IScaffoldPosixConstants.ts +30 -0
- package/src/IScaffoldPublicationEntry.ts +22 -0
- package/src/IScaffoldPublicationFailure.ts +18 -0
- package/src/IScaffoldPublicationOptions.ts +19 -0
- package/src/IScaffoldPublicationReceipt.ts +29 -0
- package/src/IScaffoldRefusedFilePublicationOutcome.ts +20 -0
- package/src/IScaffoldSyncPlan.ts +26 -0
- package/src/IScaffoldSyncProps.ts +16 -0
- package/src/IWindowsFileInformation.ts +24 -0
- package/src/IWindowsLibrary.ts +148 -0
- package/src/SCAFFOLD_SYNC_STATE_FILE.ts +5 -0
- package/src/ScaffoldFilePublicationOutcome.ts +18 -0
- package/src/ScaffoldParentChangedError.ts +14 -0
- package/src/ScaffoldPublicationError.ts +58 -0
- package/src/assertOrdinaryFile.ts +20 -0
- package/src/assertOrdinarySingleLinkFile.ts +26 -0
- package/src/assertScaffoldOwnership.ts +29 -0
- package/src/assertScaffoldPhysicalDirectory.ts +29 -0
- package/src/assertScaffoldProjectName.ts +34 -0
- package/src/attachScaffoldSyncState.ts +30 -0
- package/src/captureEmptyScaffoldPhysicalDirectory.ts +45 -0
- package/src/captureScaffoldFile.ts +34 -0
- package/src/captureScaffoldPhysicalDirectory.ts +34 -0
- package/src/combineScaffoldFailures.ts +35 -0
- package/src/createAutoMovieCatalogVersionResolver.ts +117 -0
- package/src/createScaffoldSyncState.ts +33 -0
- package/src/createScaffoldVariables.ts +50 -0
- package/src/ensureScaffoldBaseDirectory.ts +55 -0
- package/src/ensureScaffoldFileDirectory.ts +75 -0
- package/src/index.ts +48 -0
- package/src/inside.ts +25 -0
- package/src/isScaffoldInstruction.ts +29 -0
- package/src/listAutoMovieScaffoldFiles.ts +56 -0
- package/src/loadWindowsLibrary.ts +277 -0
- package/src/mergeScaffoldFiles.ts +39 -0
- package/src/missingPath.ts +16 -0
- package/src/nativeError.ts +15 -0
- package/src/openPosixParent.ts +155 -0
- package/src/openWindowsParent.ts +305 -0
- package/src/overwriteScaffoldFile.ts +262 -0
- package/src/physicalDirectoryIdentity.ts +33 -0
- package/src/physicalVersion.ts +18 -0
- package/src/planScaffoldPublication.ts +100 -0
- package/src/planScaffoldSync.ts +122 -0
- package/src/publishFiles.ts +120 -0
- package/src/publishNativeScaffoldFile.ts +287 -0
- package/src/publishScaffoldCandidate.ts +94 -0
- package/src/readAutoMovieScaffoldSources.ts +82 -0
- package/src/readScaffoldSyncFile.ts +66 -0
- package/src/renderScaffold.ts +43 -0
- package/src/renderScaffoldEntries.ts +110 -0
- package/src/renderScaffoldInstructions.ts +22 -0
- package/src/renderScaffoldLayer.ts +38 -0
- package/src/renderTemplate.ts +62 -0
- package/src/renderWorkspaceProductionScaffold.ts +35 -0
- package/src/renderWorkspaceScaffold.ts +43 -0
- package/src/replaceSharedScaffoldFile.ts +88 -0
- package/src/resolveAutoMovieCatalogVersion.ts +27 -0
- package/src/resolveAutoMovieTemplateDependencyVersions.ts +70 -0
- package/src/resolveScaffoldPosixConstants.ts +50 -0
- package/src/scaffoldAssetDirectory.ts +30 -0
- package/src/scaffoldPhysicalIdentity.ts +21 -0
- package/src/scaffoldSharedSkillDirectory.ts +25 -0
- package/src/scaffoldSharedSkillPath.ts +31 -0
- package/src/syncScaffold.ts +38 -0
- package/src/writeFiles.ts +48 -0
- package/src/writeScaffoldFile.ts +88 -0
- package/src/writtenVersion.ts +19 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_CHROME_EXECUTABLE } from "./DEFAULT_CHROME_EXECUTABLE.js";
|
|
4
|
+
import type { IAutoMoviePageSequenceRenderArtifact } from "./IAutoMoviePageSequenceRenderArtifact.js";
|
|
5
|
+
import type { IAutoMoviePageSequenceRenderOptions } from "./IAutoMoviePageSequenceRenderOptions.js";
|
|
6
|
+
import { captureSequenceRenderAndSee } from "./captureSequenceRenderAndSee.js";
|
|
7
|
+
|
|
8
|
+
const DEFAULT_BASE: string = process.env.BASE ?? "http://127.0.0.1:5173";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Parse this existing capture CLI's arguments and print its completed artifact summary. Help returns before capture; invalid numeric options or capture failures reject. Relative destinations resolve against the existing repository-root convention, and the default base URL is read once when this module loads.
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* @evidence contracts/development/implementation.md#principled-implementation CLI flags configure the canonical sequence capture, with finite positive fps and positive even dimensions checked before loading the page.
|
|
15
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure The command handles CLI input and summary output while captureSequenceRenderAndSee owns metadata, browser capture and encoding.
|
|
16
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Help performs no capture, invalid numbers reject, and null target resolves from the actual page metadata.
|
|
17
|
+
* @evidence contracts/development/common.md#meaningful-documentation The help states defaults, destinations and sequence target behavior; cwd resolution is documented on the command.
|
|
18
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Argument parsing is O(A); sequence capture and encoding dominate subsequent work.
|
|
19
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work The command parses once and prints the completed artifact including its existing dissolve observations.
|
|
20
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Parsed values and the artifact reference live through this invocation; the delegated capture owns resource teardown and persistent output files.
|
|
21
|
+
*/
|
|
22
|
+
export const renderSequenceAndSeeCommand: (
|
|
23
|
+
argv?: string[],
|
|
24
|
+
) => Promise<void> = async (
|
|
25
|
+
argv: string[] = process.argv.slice(2),
|
|
26
|
+
): Promise<void> => {
|
|
27
|
+
const options: IAutoMoviePageSequenceRenderOptions | null = parseArgs(argv);
|
|
28
|
+
if (options === null) {
|
|
29
|
+
printHelp();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const artifact: IAutoMoviePageSequenceRenderArtifact =
|
|
33
|
+
await captureSequenceRenderAndSee(options);
|
|
34
|
+
console.log(
|
|
35
|
+
JSON.stringify(
|
|
36
|
+
{
|
|
37
|
+
output: artifact.output,
|
|
38
|
+
json: artifact.jsonPath,
|
|
39
|
+
frames: artifact.frameCount,
|
|
40
|
+
route: artifact.route,
|
|
41
|
+
dissolveChecks: artifact.dissolveChecks,
|
|
42
|
+
},
|
|
43
|
+
null,
|
|
44
|
+
2,
|
|
45
|
+
),
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const parseArgs: (
|
|
50
|
+
argv: string[],
|
|
51
|
+
) => IAutoMoviePageSequenceRenderOptions | null = (
|
|
52
|
+
argv: string[],
|
|
53
|
+
): IAutoMoviePageSequenceRenderOptions | null => {
|
|
54
|
+
if (argv.includes("--help") || argv.includes("-h")) return null;
|
|
55
|
+
const flags: Record<string, string | undefined> = readFlags(argv);
|
|
56
|
+
const root: string = repoRoot();
|
|
57
|
+
const outputPath: string = resolveFromRoot(
|
|
58
|
+
root,
|
|
59
|
+
flags.out ?? ".shots/_render-see/film-sequence.mp4",
|
|
60
|
+
);
|
|
61
|
+
const stem: string = path.basename(outputPath, path.extname(outputPath));
|
|
62
|
+
const frameDir: string = resolveFromRoot(
|
|
63
|
+
root,
|
|
64
|
+
flags.frames ?? path.join(".shots/_render-see", `${stem}-frames`),
|
|
65
|
+
);
|
|
66
|
+
const jsonPath: string = resolveFromRoot(
|
|
67
|
+
root,
|
|
68
|
+
flags.json ?? path.join(".shots/_render-see", `${stem}.json`),
|
|
69
|
+
);
|
|
70
|
+
return {
|
|
71
|
+
page: flags.page ?? "film.html",
|
|
72
|
+
query: flags.query ?? "",
|
|
73
|
+
base: flags.base ?? DEFAULT_BASE,
|
|
74
|
+
chrome: flags.chrome ?? DEFAULT_CHROME_EXECUTABLE,
|
|
75
|
+
fps: positiveNumber(flags.fps, 12, "--fps"),
|
|
76
|
+
width: positiveEvenInteger(flags.width, 640, "--width"),
|
|
77
|
+
height: positiveEvenInteger(flags.height, 360, "--height"),
|
|
78
|
+
target: flags.target ?? null,
|
|
79
|
+
outputPath,
|
|
80
|
+
frameDir,
|
|
81
|
+
jsonPath,
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const readFlags: (argv: string[]) => Record<string, string | undefined> = (
|
|
86
|
+
argv: string[],
|
|
87
|
+
): Record<string, string | undefined> => {
|
|
88
|
+
const flags: Record<string, string | undefined> = {};
|
|
89
|
+
for (let i: number = 0; i < argv.length; ++i) {
|
|
90
|
+
const arg: string = argv[i]!;
|
|
91
|
+
if (!arg.startsWith("--")) continue;
|
|
92
|
+
const eq: number = arg.indexOf("=");
|
|
93
|
+
if (eq >= 0) {
|
|
94
|
+
flags[arg.slice(2, eq)] = arg.slice(eq + 1);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const next: string = argv[i + 1];
|
|
98
|
+
flags[arg.slice(2)] = next && !next.startsWith("--") ? next : "true";
|
|
99
|
+
if (next && !next.startsWith("--")) ++i;
|
|
100
|
+
}
|
|
101
|
+
return flags;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const positiveNumber: (
|
|
105
|
+
value: string | undefined,
|
|
106
|
+
fallback: number,
|
|
107
|
+
label: string,
|
|
108
|
+
) => number = (
|
|
109
|
+
value: string | undefined,
|
|
110
|
+
fallback: number,
|
|
111
|
+
label: string,
|
|
112
|
+
): number => {
|
|
113
|
+
if (value === undefined) return fallback;
|
|
114
|
+
const parsed: number = Number(value);
|
|
115
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
116
|
+
throw new Error(`${label} must be a positive finite number`);
|
|
117
|
+
return parsed;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const positiveEvenInteger: (
|
|
121
|
+
value: string | undefined,
|
|
122
|
+
fallback: number,
|
|
123
|
+
label: string,
|
|
124
|
+
) => number = (
|
|
125
|
+
value: string | undefined,
|
|
126
|
+
fallback: number,
|
|
127
|
+
label: string,
|
|
128
|
+
): number => {
|
|
129
|
+
const parsed: number = positiveNumber(value, fallback, label);
|
|
130
|
+
if (!Number.isInteger(parsed) || parsed % 2 !== 0)
|
|
131
|
+
throw new Error(`${label} must be a positive even integer`);
|
|
132
|
+
return parsed;
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
const repoRoot: () => string = (): string => {
|
|
136
|
+
const cwd: string = process.cwd();
|
|
137
|
+
return path.basename(cwd) === "render" &&
|
|
138
|
+
path.basename(path.dirname(cwd)) === "packages"
|
|
139
|
+
? path.resolve(cwd, "../..")
|
|
140
|
+
: cwd;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const resolveFromRoot: (root: string, value: string) => string = (
|
|
144
|
+
root: string,
|
|
145
|
+
value: string,
|
|
146
|
+
): string => (path.isAbsolute(value) ? value : path.resolve(root, value));
|
|
147
|
+
|
|
148
|
+
const printHelp: () => void = (): void => {
|
|
149
|
+
console.log(`Usage:
|
|
150
|
+
pnpm render:sequence -- [options]
|
|
151
|
+
|
|
152
|
+
Options:
|
|
153
|
+
--page <file> Viewer page, default film.html
|
|
154
|
+
--query <query> Query string without cap=1
|
|
155
|
+
--fps <number> Frames per second, default 12
|
|
156
|
+
--width <px> Viewport width, default 640
|
|
157
|
+
--height <px> Viewport height, default 360
|
|
158
|
+
--out <path> MP4 output, default .shots/_render-see/film-sequence.mp4
|
|
159
|
+
--frames <path> PNG frame directory
|
|
160
|
+
--json <path> JSON artifact path
|
|
161
|
+
--target <id> Render target id, default sequence id exposed by the page
|
|
162
|
+
--base <url> Dev server base, default ${DEFAULT_BASE}
|
|
163
|
+
--chrome <path> Chrome executable, default from CHROME/env platform
|
|
164
|
+
`);
|
|
165
|
+
};
|
package/scaffold/production/src/executable/render/node/capture/verifySequenceDissolvePixels.ts
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IAutoMovieSequenceRenderFrame,
|
|
3
|
+
IAutoMovieSequenceRenderPlan,
|
|
4
|
+
IAutoMovieSequenceRenderTransitionSpan,
|
|
5
|
+
} from "@automovie/render";
|
|
6
|
+
import fs from "node:fs/promises";
|
|
7
|
+
import { PNG } from "pngjs";
|
|
8
|
+
|
|
9
|
+
import type { IAutoMovieSequenceDissolvePixelCheck } from "./IAutoMovieSequenceDissolvePixelCheck.js";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Observe each declared dissolve using the sampled blend nearest alpha 0.5, the existing saved PNG and two isolated-shot PNGs at their local times. Mean absolute RGB byte distances use the existing baseline>0.1 and probe-distance>0.01/<baseline predicate; alpha/distance reports round to three decimals. False observations carry a reason and do not throw merely because the heuristic fails.
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
* @evidence contracts/development/implementation.md#principled-implementation Each transition selects its sampled blend nearest alpha 0.5, decodes the mixed and two isolated PNGs, and compares mean absolute RGB distances using the documented predicate.
|
|
17
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure One observation per transition keeps failed conditions and measured distances visible without changing sequence rendering.
|
|
18
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts The thresholds are the existing diagnostic heuristic, not an exact compositor oracle; failed observations retain a reason rather than throwing as a quality verdict.
|
|
19
|
+
* @evidence contracts/development/common.md#meaningful-documentation The comment specifies midpoint selection, thresholds, rounding and the distinction between false observations and I/O or dimension failures.
|
|
20
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms For T transitions and F frames, sample selection costs O(TF); each selected check scans three W by H decoded images, O(TWH) pixel work.
|
|
21
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work The observer reads the existing mixed-frame PNG and asks the borrowed session only for the two isolated shots; it does not recapture mixed frames.
|
|
22
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources The caller owns saved PNGs and the borrowed session; each iteration retains three decoded images until its check completes and the returned O(T) array holds numeric metadata only.
|
|
23
|
+
*/
|
|
24
|
+
export const verifySequenceDissolvePixels: (props: {
|
|
25
|
+
/** Saved mixed-frame PNG paths keyed by their canonical sequence frame index. */
|
|
26
|
+
captured: Map<number, string>;
|
|
27
|
+
|
|
28
|
+
/** Canonical sampled sequence frames used to choose the nearest midpoint blend. */
|
|
29
|
+
frames: IAutoMovieSequenceRenderFrame[];
|
|
30
|
+
|
|
31
|
+
/** Declared transition spans whose sampled blends receive diagnostic observations. */
|
|
32
|
+
transitions: IAutoMovieSequenceRenderPlan["transitionSpans"];
|
|
33
|
+
|
|
34
|
+
/** Draw and return an isolated original shot PNG through the borrowed capture session. */
|
|
35
|
+
captureShot(sample: {
|
|
36
|
+
/** Known shot identity from the compiled page metadata. */
|
|
37
|
+
shot: string;
|
|
38
|
+
|
|
39
|
+
/** Shot-local time in seconds, matching the chosen mixed frame's sample. */
|
|
40
|
+
shotTimeSeconds: number;
|
|
41
|
+
}): Promise<Uint8Array>;
|
|
42
|
+
}) => Promise<IAutoMovieSequenceDissolvePixelCheck[]> = async (props: {
|
|
43
|
+
/** Saved mixed-frame PNG paths keyed by their canonical sequence frame index. */
|
|
44
|
+
captured: Map<number, string>;
|
|
45
|
+
|
|
46
|
+
/** Canonical sampled sequence frames used to choose the nearest midpoint blend. */
|
|
47
|
+
frames: IAutoMovieSequenceRenderFrame[];
|
|
48
|
+
|
|
49
|
+
/** Declared transition spans whose sampled blends receive diagnostic observations. */
|
|
50
|
+
transitions: IAutoMovieSequenceRenderPlan["transitionSpans"];
|
|
51
|
+
|
|
52
|
+
/** Draw and return an isolated original shot PNG through the borrowed capture session. */
|
|
53
|
+
captureShot(sample: {
|
|
54
|
+
/** Known shot identity from the compiled page metadata. */
|
|
55
|
+
shot: string;
|
|
56
|
+
|
|
57
|
+
/** Shot-local time in seconds, matching the chosen mixed frame's sample. */
|
|
58
|
+
shotTimeSeconds: number;
|
|
59
|
+
}): Promise<Uint8Array>;
|
|
60
|
+
}): Promise<IAutoMovieSequenceDissolvePixelCheck[]> => {
|
|
61
|
+
const checks: IAutoMovieSequenceDissolvePixelCheck[] = [];
|
|
62
|
+
for (const transition of props.transitions) {
|
|
63
|
+
const candidates: IAutoMovieSequenceRenderFrame[] = props.frames.filter(
|
|
64
|
+
(frame: IAutoMovieSequenceRenderFrame): boolean =>
|
|
65
|
+
frame.blend !== null &&
|
|
66
|
+
frame.timeSeconds >= transition.start &&
|
|
67
|
+
frame.timeSeconds < transition.end &&
|
|
68
|
+
frame.blend.alpha > 0 &&
|
|
69
|
+
frame.blend.alpha < 1,
|
|
70
|
+
);
|
|
71
|
+
const frame: IAutoMovieSequenceRenderFrame | null =
|
|
72
|
+
nearestMidBlend(candidates);
|
|
73
|
+
if (frame === null || frame.blend === null) {
|
|
74
|
+
checks.push(emptyDissolveCheck(transition, "no blended frame sampled"));
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const actualPath: string | undefined = props.captured.get(frame.index);
|
|
78
|
+
if (actualPath === undefined) {
|
|
79
|
+
checks.push(emptyDissolveCheck(transition, "captured frame missing"));
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const actual: ReturnType<typeof PNG.sync.read> = PNG.sync.read(
|
|
83
|
+
await fs.readFile(actualPath),
|
|
84
|
+
);
|
|
85
|
+
const outgoing: ReturnType<typeof PNG.sync.read> = PNG.sync.read(
|
|
86
|
+
Buffer.from(
|
|
87
|
+
await props.captureShot({
|
|
88
|
+
shot: frame.blend.shot,
|
|
89
|
+
shotTimeSeconds: frame.blend.shotTimeSeconds,
|
|
90
|
+
}),
|
|
91
|
+
),
|
|
92
|
+
);
|
|
93
|
+
const incoming: ReturnType<typeof PNG.sync.read> = PNG.sync.read(
|
|
94
|
+
Buffer.from(
|
|
95
|
+
await props.captureShot({
|
|
96
|
+
shot: frame.shot,
|
|
97
|
+
shotTimeSeconds: frame.shotTimeSeconds,
|
|
98
|
+
}),
|
|
99
|
+
),
|
|
100
|
+
);
|
|
101
|
+
const baseline: number = rgbDistance(outgoing, incoming);
|
|
102
|
+
const actualToIncoming: number = rgbDistance(actual, incoming);
|
|
103
|
+
const actualToOutgoing: number = rgbDistance(actual, outgoing);
|
|
104
|
+
const verified: boolean =
|
|
105
|
+
baseline > 0.1 &&
|
|
106
|
+
actualToIncoming > 0.01 &&
|
|
107
|
+
actualToOutgoing > 0.01 &&
|
|
108
|
+
actualToIncoming < baseline &&
|
|
109
|
+
actualToOutgoing < baseline;
|
|
110
|
+
checks.push({
|
|
111
|
+
transition: transitionSlice(transition),
|
|
112
|
+
frame: frame.index,
|
|
113
|
+
alpha: round(frame.blend.alpha),
|
|
114
|
+
baselineDistance: round(baseline),
|
|
115
|
+
actualToIncoming: round(actualToIncoming),
|
|
116
|
+
actualToOutgoing: round(actualToOutgoing),
|
|
117
|
+
verified,
|
|
118
|
+
reason: verified
|
|
119
|
+
? null
|
|
120
|
+
: "captured dissolve frame did not sit between outgoing and incoming probes",
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return checks;
|
|
124
|
+
};
|
|
125
|
+
const nearestMidBlend: (
|
|
126
|
+
frames: IAutoMovieSequenceRenderFrame[],
|
|
127
|
+
) => IAutoMovieSequenceRenderFrame | null = (
|
|
128
|
+
frames: IAutoMovieSequenceRenderFrame[],
|
|
129
|
+
): IAutoMovieSequenceRenderFrame | null => {
|
|
130
|
+
let best: IAutoMovieSequenceRenderFrame | null = null;
|
|
131
|
+
for (const frame of frames)
|
|
132
|
+
if (
|
|
133
|
+
frame.blend !== null &&
|
|
134
|
+
(best === null ||
|
|
135
|
+
Math.abs(frame.blend.alpha - 0.5) < Math.abs(best.blend!.alpha - 0.5))
|
|
136
|
+
)
|
|
137
|
+
best = frame;
|
|
138
|
+
return best;
|
|
139
|
+
};
|
|
140
|
+
const emptyDissolveCheck: (
|
|
141
|
+
transition: IAutoMovieSequenceRenderTransitionSpan,
|
|
142
|
+
reason: string,
|
|
143
|
+
) => IAutoMovieSequenceDissolvePixelCheck = (
|
|
144
|
+
transition: IAutoMovieSequenceRenderTransitionSpan,
|
|
145
|
+
reason: string,
|
|
146
|
+
): IAutoMovieSequenceDissolvePixelCheck => ({
|
|
147
|
+
transition: transitionSlice(transition),
|
|
148
|
+
frame: null,
|
|
149
|
+
alpha: null,
|
|
150
|
+
baselineDistance: 0,
|
|
151
|
+
actualToIncoming: 0,
|
|
152
|
+
actualToOutgoing: 0,
|
|
153
|
+
verified: false,
|
|
154
|
+
reason,
|
|
155
|
+
});
|
|
156
|
+
const transitionSlice: (
|
|
157
|
+
transition: IAutoMovieSequenceRenderTransitionSpan,
|
|
158
|
+
) => IAutoMovieSequenceDissolvePixelCheck["transition"] = (
|
|
159
|
+
transition: IAutoMovieSequenceRenderTransitionSpan,
|
|
160
|
+
): IAutoMovieSequenceDissolvePixelCheck["transition"] => ({
|
|
161
|
+
from: transition.from,
|
|
162
|
+
to: transition.to,
|
|
163
|
+
start: transition.start,
|
|
164
|
+
end: transition.end,
|
|
165
|
+
});
|
|
166
|
+
const rgbDistance: (a: PNG, b: PNG) => number = (a: PNG, b: PNG): number => {
|
|
167
|
+
if (a.width !== b.width || a.height !== b.height)
|
|
168
|
+
throw new Error("cannot compare dissolve probes with different dimensions");
|
|
169
|
+
let sum: number = 0;
|
|
170
|
+
const pixels: number = a.width * a.height;
|
|
171
|
+
for (let i: number = 0; i < a.data.length; i += 4) {
|
|
172
|
+
sum += Math.abs(a.data[i]! - b.data[i]!);
|
|
173
|
+
sum += Math.abs(a.data[i + 1]! - b.data[i + 1]!);
|
|
174
|
+
sum += Math.abs(a.data[i + 2]! - b.data[i + 2]!);
|
|
175
|
+
}
|
|
176
|
+
return sum / (pixels * 3);
|
|
177
|
+
};
|
|
178
|
+
const round: (value: number) => number = (value: number): number =>
|
|
179
|
+
Math.round(value * 1_000) / 1_000;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { resolveProductionFrameRate } from "@automovie/engine";
|
|
2
|
+
import type {
|
|
3
|
+
IAutoMovieFilmTimeline,
|
|
4
|
+
IAutoMovieProductionVideoProbe,
|
|
5
|
+
} from "@automovie/interface";
|
|
6
|
+
import {
|
|
7
|
+
assertProductionVideoProfile,
|
|
8
|
+
resolveProductionVideoProfile,
|
|
9
|
+
} from "@automovie/render";
|
|
10
|
+
|
|
11
|
+
import { appendLosslessVideoClip } from "./appendLosslessVideoClip";
|
|
12
|
+
import { openLosslessVideoTrack } from "./openLosslessVideoTrack";
|
|
13
|
+
import { probeProductionVideoMp4 } from "./probeProductionVideoMp4";
|
|
14
|
+
import { productionRenditionVideoPlan } from "./productionRenditionVideoPlan";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Splice one immutable repaint clip per timeline segment into a single
|
|
18
|
+
* feature video track, in timeline order, without decoding.
|
|
19
|
+
*
|
|
20
|
+
* `clips` maps each segment's `shot` to its clip bytes. The plan
|
|
21
|
+
* (`productionRenditionVideoPlan`) refuses transitions, partial trims, a
|
|
22
|
+
* missing clip, a frame rate other than the timeline's, a gap or overlap
|
|
23
|
+
* between segments, and a raster or decoder configuration that changes
|
|
24
|
+
* between clips; silently falling back to deterministic pixels would
|
|
25
|
+
* misrepresent the selected product. The written video is re-probed, must pass
|
|
26
|
+
* the delivery profile at the timeline's rational frame rate, and must hold
|
|
27
|
+
* exactly `timeline.totalFrames` samples.
|
|
28
|
+
*
|
|
29
|
+
* No production module calls this function at present; only tests reach it.
|
|
30
|
+
*
|
|
31
|
+
* @evidence contracts/development/implementation.md#principled-implementation The splice copies coded samples with equal declared sample entries and re-bases timing in whole frames, including clips whose media clocks differ by a whole factor. Each clip starts at a declared sync sample; independent decoding remains a premise because container checks do not decode H.264 payloads or verify an IDR picture.
|
|
32
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure Validation of the segment-to-clip mapping is the shared plan, which the feature proof `assertProductionFeatureUsesRenditionClips` also reads, the container comes from `openLosslessVideoTrack`, and re-timing from `appendLosslessVideoClip`; this function only writes and verifies. The gap is that no production consumer remains.
|
|
33
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Every unsupported edit or mismatched clip is refused rather than re-encoded, trimmed or replaced with deterministic frames, and the final checks re-read the written bytes rather than trusting the writer.
|
|
34
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the input mapping, every refusal the plan applies and why fallback is refused, and the verification of the written video.
|
|
35
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms Each segment occurrence invokes the clip parser, including repeated shots; a clip with S samples and M media boxes adds O(M + S log(M+1)) residency work plus description inspection. Appending copies coded bytes and subsample tables, then serialization and an independent output probe repeat output parsing/residency work. The complete operation is not strictly linear in unique clip bytes.
|
|
36
|
+
* @evidenceExclude contracts/development/implementation.md#reuse-equivalent-work A call conforms one timeline from caller-held bytes and keeps no cache; equal inputs give byte-identical output, which a caller may store.
|
|
37
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Input parses and copied buffers, source sample views, output payload copies and fragment boxes, serialized output and its verification parse can coexist. Bytes, samples, descriptions and boxes are uncapped here and no peak multiplier is established. Invocation-local references become collectable after completion or refusal; the caller retains the returned bytes, with no acquired OS handle or task.
|
|
38
|
+
*/
|
|
39
|
+
export const conformProductionRenditionVideoMp4: (props: {
|
|
40
|
+
timeline: IAutoMovieFilmTimeline;
|
|
41
|
+
clips: ReadonlyMap<string, Uint8Array>;
|
|
42
|
+
}) => Uint8Array = (props: {
|
|
43
|
+
/** Current cut-only film timeline the clips must cover exactly. */
|
|
44
|
+
timeline: IAutoMovieFilmTimeline;
|
|
45
|
+
|
|
46
|
+
/** Repaint clip bytes keyed by segment `shot`. */
|
|
47
|
+
clips: ReadonlyMap<string, Uint8Array>;
|
|
48
|
+
}): Uint8Array => {
|
|
49
|
+
const plan: ReturnType<typeof productionRenditionVideoPlan> =
|
|
50
|
+
productionRenditionVideoPlan(props);
|
|
51
|
+
const output: ReturnType<typeof openLosslessVideoTrack> =
|
|
52
|
+
openLosslessVideoTrack({
|
|
53
|
+
label: "Repainted feature",
|
|
54
|
+
name: "AutoMovie receipt-bound repaint feature",
|
|
55
|
+
timescale: plan.first.track.timescale,
|
|
56
|
+
sampleDuration: plan.sampleDuration,
|
|
57
|
+
frames: props.timeline.totalFrames,
|
|
58
|
+
description: plan.description,
|
|
59
|
+
width: plan.first.probe.width,
|
|
60
|
+
height: plan.first.probe.height,
|
|
61
|
+
language: plan.first.track.language,
|
|
62
|
+
});
|
|
63
|
+
let frame: number = 0;
|
|
64
|
+
for (const clip of plan.parsed)
|
|
65
|
+
frame = appendLosslessVideoClip({
|
|
66
|
+
...output,
|
|
67
|
+
clip,
|
|
68
|
+
frame,
|
|
69
|
+
sampleDuration: plan.sampleDuration,
|
|
70
|
+
});
|
|
71
|
+
const bytes: Uint8Array = new Uint8Array(output.file.getBuffer().buffer);
|
|
72
|
+
const probe: IAutoMovieProductionVideoProbe = probeProductionVideoMp4(bytes);
|
|
73
|
+
assertProductionVideoProfile({
|
|
74
|
+
expected: resolveProductionVideoProfile({
|
|
75
|
+
width: plan.first.probe.width,
|
|
76
|
+
height: plan.first.probe.height,
|
|
77
|
+
frameRate: resolveProductionFrameRate(props.timeline),
|
|
78
|
+
}),
|
|
79
|
+
actual: probe,
|
|
80
|
+
});
|
|
81
|
+
if (probe.frameCount !== props.timeline.totalFrames)
|
|
82
|
+
throw new Error(
|
|
83
|
+
"Conformed repaint video failed exact parser verification.",
|
|
84
|
+
);
|
|
85
|
+
return bytes;
|
|
86
|
+
};
|
package/scaffold/production/src/executable/render/node/conformProductionVisualDeliveryVideoMp4.ts
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { resolveProductionFrameRate } from "@automovie/engine";
|
|
2
|
+
import type { IAutoMovieFilmTimeline } from "@automovie/interface";
|
|
3
|
+
import {
|
|
4
|
+
assertProductionVideoProfile,
|
|
5
|
+
productionVisualDeliveryOccurrence,
|
|
6
|
+
resolveProductionVideoProfile,
|
|
7
|
+
} from "@automovie/render";
|
|
8
|
+
import type { Sample } from "mp4box";
|
|
9
|
+
|
|
10
|
+
import type { IProductionRenditionClip } from "./IProductionRenditionClip";
|
|
11
|
+
import { appendLosslessVideoClip } from "./appendLosslessVideoClip";
|
|
12
|
+
import { openLosslessVideoTrack } from "./openLosslessVideoTrack";
|
|
13
|
+
import { parseProductionRenditionClip } from "./parseProductionRenditionClip";
|
|
14
|
+
import { probeProductionVideoMp4 } from "./probeProductionVideoMp4";
|
|
15
|
+
import { sameSampleDescription } from "./sameSampleDescription";
|
|
16
|
+
import { sampleDescription } from "./sampleDescription";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Splice a cut-only timeline whose occurrences each come from one of two
|
|
20
|
+
* lanes, a range of the deterministic feature or a full repaint clip, into
|
|
21
|
+
* one video track without decoding.
|
|
22
|
+
*
|
|
23
|
+
* `sources[i]` must belong to timeline segment `i`, joined by
|
|
24
|
+
* `productionVisualDeliveryOccurrence`. Segments must be cuts, non-empty and
|
|
25
|
+
* contiguous from frame 0 to `timeline.totalFrames`. Every deterministic
|
|
26
|
+
* source must be the same bytes, a feature of exactly `totalFrames` frames,
|
|
27
|
+
* and its occurrence copies that feature's samples `startFrame` through
|
|
28
|
+
* `endFrame - 1` in decode order; that range must present exactly the
|
|
29
|
+
* segment's frames, and must start at a sync sample when the previous
|
|
30
|
+
* occurrence is a repaint. A repainted occurrence must be a full-shot clip of
|
|
31
|
+
* exactly the segment's length. Every occurrence must share the first one's
|
|
32
|
+
* raster, media timescale, sample duration and decoder configuration. The
|
|
33
|
+
* written video must pass the delivery profile at the timeline's rational
|
|
34
|
+
* frame rate.
|
|
35
|
+
*
|
|
36
|
+
* Each refusal throws an `Error` naming the occurrence index where one is
|
|
37
|
+
* responsible, or an `unsupported-video-profile.<field>` error from the final
|
|
38
|
+
* profile check.
|
|
39
|
+
*
|
|
40
|
+
* No production module calls this function at present; only tests reach it.
|
|
41
|
+
*
|
|
42
|
+
* @evidence contracts/development/implementation.md#principled-implementation A deterministic range is copied only when its decode-order samples present exactly the segment's whole-frame slots; a crossing from repaint requires a declared sync sample, while consecutive deterministic ranges continue the same source stream. Truthful sync declarations and decoder independence remain premises for both lanes, since the clip parser does not decode payloads or verify IDR pictures.
|
|
43
|
+
* @evidence contracts/development/implementation.md#clear-and-simple-structure This function owns the lane rules and the timeline join; clip parsing, the container and re-timing are the shared `parseProductionRenditionClip`, `openLosslessVideoTrack` and `appendLosslessVideoClip`. The gap is that no production consumer remains.
|
|
44
|
+
* @evidence contracts/development/implementation.md#prohibited-implementation-shortcuts Transitions, trims, gaps, a range that would need reordered frames from a neighbor, and mismatched clips are refused instead of being re-encoded or patched, and no occurrence is special-cased.
|
|
45
|
+
* @evidence contracts/development/common.md#meaningful-documentation The doc states the source join, the timeline shape, every deterministic and repaint lane rule including frame closure and the sync rule, the shared presentation contract, the final profile check, and how refusals name the occurrence.
|
|
46
|
+
* @evidence contracts/development/implementation.md#efficient-algorithms The deterministic source is parsed once, while each repaint occurrence is parsed independently. Every parse/probe includes its sample and media-box residency cost O(M + S log(M+1)) plus descriptions and box inspection. Distinct arrays claiming the deterministic source incur whole-source byte comparisons, ranges scan their samples, and appending/serialization/output verification add payload, subsample and output-parse work; total work is not bounded by the bytes spliced alone.
|
|
47
|
+
* @evidence contracts/development/implementation.md#reuse-equivalent-work The parsed deterministic feature is shared by every deterministic occurrence after its bytes are proved identical to the first one's, so equality of content, not of the array reference alone, decides the reuse; nothing is cached across calls.
|
|
48
|
+
* @evidence contracts/development/implementation.md#bound-retention-and-release-resources Parsed sources and copied input buffers, range sample arrays, output payload copies/fragment boxes, serialized output and its verification parse can coexist. A short deterministic range still references the entire deterministic source. No byte, sample, box or occurrence cap or measured peak multiplier is established; local objects become collectable after completion or refusal, and the caller retains only returned bytes from this function.
|
|
49
|
+
*/
|
|
50
|
+
export const conformProductionVisualDeliveryVideoMp4: (props: {
|
|
51
|
+
timeline: IAutoMovieFilmTimeline;
|
|
52
|
+
sources: ReadonlyArray<{
|
|
53
|
+
occurrence: string;
|
|
54
|
+
lane: "deterministic" | "repainted";
|
|
55
|
+
bytes: Uint8Array;
|
|
56
|
+
}>;
|
|
57
|
+
}) => Uint8Array = (props: {
|
|
58
|
+
/** Current cut-only film timeline the sources must cover exactly. */
|
|
59
|
+
timeline: IAutoMovieFilmTimeline;
|
|
60
|
+
|
|
61
|
+
/** One source per timeline segment, in segment order. */
|
|
62
|
+
sources: ReadonlyArray<{
|
|
63
|
+
/** Occurrence key from `productionVisualDeliveryOccurrence`. */
|
|
64
|
+
occurrence: string;
|
|
65
|
+
|
|
66
|
+
/** Whether the bytes are the deterministic feature or a repaint clip. */
|
|
67
|
+
lane: "deterministic" | "repainted";
|
|
68
|
+
|
|
69
|
+
/** The deterministic feature MP4 or the repaint clip MP4. */
|
|
70
|
+
bytes: Uint8Array;
|
|
71
|
+
}>;
|
|
72
|
+
}): Uint8Array => {
|
|
73
|
+
if (
|
|
74
|
+
props.sources.length !== props.timeline.segments.length ||
|
|
75
|
+
props.sources.some(
|
|
76
|
+
(source: (typeof props.sources)[number], index: number): boolean =>
|
|
77
|
+
source.occurrence !==
|
|
78
|
+
productionVisualDeliveryOccurrence(
|
|
79
|
+
props.timeline.segments[index]!,
|
|
80
|
+
index,
|
|
81
|
+
),
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
throw new Error(
|
|
85
|
+
"Visual delivery sources must exactly join the current timeline occurrences.",
|
|
86
|
+
);
|
|
87
|
+
let deterministic: IProductionRenditionClip | undefined;
|
|
88
|
+
let nextFrame: number = 0;
|
|
89
|
+
const parsed: IProductionRenditionClip[] = props.timeline.segments.map(
|
|
90
|
+
(
|
|
91
|
+
segment: IAutoMovieFilmTimeline["segments"][number],
|
|
92
|
+
index: number,
|
|
93
|
+
): IProductionRenditionClip => {
|
|
94
|
+
if (
|
|
95
|
+
segment.transitionIn.kind !== "cut" ||
|
|
96
|
+
segment.transitionOut.kind !== "cut"
|
|
97
|
+
)
|
|
98
|
+
throw new Error(
|
|
99
|
+
`Mixed visual delivery currently requires cut-only editing at occurrence ${index}.`,
|
|
100
|
+
);
|
|
101
|
+
if (
|
|
102
|
+
segment.startFrame !== nextFrame ||
|
|
103
|
+
segment.endFrame <= segment.startFrame
|
|
104
|
+
)
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Visual delivery occurrence ${index} does not occupy the next continuous film frames.`,
|
|
107
|
+
);
|
|
108
|
+
nextFrame = segment.endFrame;
|
|
109
|
+
const source: (typeof props.sources)[number] = props.sources[index]!;
|
|
110
|
+
if (source.lane === "repainted") {
|
|
111
|
+
const clip: IProductionRenditionClip = parseProductionRenditionClip(
|
|
112
|
+
source.bytes,
|
|
113
|
+
`Repaint occurrence ${index}`,
|
|
114
|
+
);
|
|
115
|
+
if (
|
|
116
|
+
segment.sourceInFrame !== 0 ||
|
|
117
|
+
segment.sourceOutFrame !== clip.probe.frameCount ||
|
|
118
|
+
segment.endFrame - segment.startFrame !== clip.probe.frameCount
|
|
119
|
+
)
|
|
120
|
+
throw new Error(
|
|
121
|
+
`Repaint occurrence ${index} must supply the exact full-shot clip.`,
|
|
122
|
+
);
|
|
123
|
+
return clip;
|
|
124
|
+
}
|
|
125
|
+
deterministic ??= parseProductionRenditionClip(
|
|
126
|
+
source.bytes,
|
|
127
|
+
"Deterministic feature source",
|
|
128
|
+
);
|
|
129
|
+
if (
|
|
130
|
+
deterministic.probe.frameCount !== props.timeline.totalFrames ||
|
|
131
|
+
(source.bytes !== deterministic.bytes &&
|
|
132
|
+
Buffer.compare(source.bytes, deterministic.bytes) !== 0)
|
|
133
|
+
)
|
|
134
|
+
throw new Error(
|
|
135
|
+
"Every deterministic lane must cite the same exact current feature source.",
|
|
136
|
+
);
|
|
137
|
+
const samples: Sample[] = deterministic.samples.slice(
|
|
138
|
+
segment.startFrame,
|
|
139
|
+
segment.endFrame,
|
|
140
|
+
);
|
|
141
|
+
if (
|
|
142
|
+
samples.length !== segment.endFrame - segment.startFrame ||
|
|
143
|
+
(index > 0 &&
|
|
144
|
+
props.sources[index - 1]!.lane !== "deterministic" &&
|
|
145
|
+
samples[0]!.is_sync !== true)
|
|
146
|
+
)
|
|
147
|
+
throw new Error(
|
|
148
|
+
`Deterministic occurrence ${index} cannot begin losslessly at its declared lane crossing.`,
|
|
149
|
+
);
|
|
150
|
+
// The parser proved presentation times a whole-frame permutation from
|
|
151
|
+
// the feature's origin, so a range of n samples whose times all fall in
|
|
152
|
+
// the segment's n frame slots presents exactly those frames.
|
|
153
|
+
const presentationStart: number =
|
|
154
|
+
deterministic.presentationStart +
|
|
155
|
+
segment.startFrame * deterministic.sampleDuration;
|
|
156
|
+
const presentationEnd: number =
|
|
157
|
+
deterministic.presentationStart +
|
|
158
|
+
segment.endFrame * deterministic.sampleDuration;
|
|
159
|
+
if (
|
|
160
|
+
samples.some(
|
|
161
|
+
(sample: Sample): boolean =>
|
|
162
|
+
sample.cts < presentationStart || sample.cts >= presentationEnd,
|
|
163
|
+
)
|
|
164
|
+
)
|
|
165
|
+
throw new Error(
|
|
166
|
+
`Deterministic occurrence ${index} does not present exactly its own frames in decode order.`,
|
|
167
|
+
);
|
|
168
|
+
return {
|
|
169
|
+
...deterministic,
|
|
170
|
+
samples,
|
|
171
|
+
decodeStart: samples[0]!.dts,
|
|
172
|
+
presentationStart,
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
);
|
|
176
|
+
const first: IProductionRenditionClip | undefined = parsed[0];
|
|
177
|
+
if (first === undefined)
|
|
178
|
+
throw new Error("Mixed visual delivery requires a non-empty timeline.");
|
|
179
|
+
if (nextFrame !== props.timeline.totalFrames)
|
|
180
|
+
throw new Error("Visual delivery sources do not cover the current film.");
|
|
181
|
+
const description: ReturnType<typeof sampleDescription> = sampleDescription(
|
|
182
|
+
first.samples[0]!,
|
|
183
|
+
);
|
|
184
|
+
for (const [index, clip] of parsed.entries())
|
|
185
|
+
if (
|
|
186
|
+
clip.probe.width !== first.probe.width ||
|
|
187
|
+
clip.probe.height !== first.probe.height ||
|
|
188
|
+
clip.track.timescale !== first.track.timescale ||
|
|
189
|
+
clip.sampleDuration !== first.sampleDuration ||
|
|
190
|
+
sameSampleDescription(
|
|
191
|
+
description,
|
|
192
|
+
sampleDescription(clip.samples[0]!),
|
|
193
|
+
) === false
|
|
194
|
+
)
|
|
195
|
+
throw new Error(
|
|
196
|
+
`Visual delivery occurrence ${index} changes the exact video presentation contract.`,
|
|
197
|
+
);
|
|
198
|
+
const output: ReturnType<typeof openLosslessVideoTrack> =
|
|
199
|
+
openLosslessVideoTrack({
|
|
200
|
+
label: "Visual delivery feature",
|
|
201
|
+
name: "AutoMovie explicit visual-lane feature",
|
|
202
|
+
timescale: first.track.timescale,
|
|
203
|
+
sampleDuration: first.sampleDuration,
|
|
204
|
+
frames: props.timeline.totalFrames,
|
|
205
|
+
description,
|
|
206
|
+
width: first.probe.width,
|
|
207
|
+
height: first.probe.height,
|
|
208
|
+
language: first.track.language,
|
|
209
|
+
});
|
|
210
|
+
let frame: number = 0;
|
|
211
|
+
for (const clip of parsed)
|
|
212
|
+
frame = appendLosslessVideoClip({
|
|
213
|
+
...output,
|
|
214
|
+
clip,
|
|
215
|
+
frame,
|
|
216
|
+
sampleDuration: first.sampleDuration,
|
|
217
|
+
});
|
|
218
|
+
const bytes: Uint8Array = new Uint8Array(output.file.getBuffer().buffer);
|
|
219
|
+
// Coverage was proved before writing, and the profile assertion proves the
|
|
220
|
+
// exact rational clock of every written sample.
|
|
221
|
+
assertProductionVideoProfile({
|
|
222
|
+
expected: resolveProductionVideoProfile({
|
|
223
|
+
width: first.probe.width,
|
|
224
|
+
height: first.probe.height,
|
|
225
|
+
frameRate: resolveProductionFrameRate(props.timeline),
|
|
226
|
+
}),
|
|
227
|
+
actual: probeProductionVideoMp4(bytes),
|
|
228
|
+
});
|
|
229
|
+
return bytes;
|
|
230
|
+
};
|