@hypit/hypit 0.1.3 → 0.1.5
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/README.md +5 -3
- package/dist/public/caption.d.ts +206 -183
- package/dist/public/composition.d.ts +25 -3
- package/dist/public/endpoint-kit.d.ts +24 -2
- package/dist/public/generation.d.ts +5 -1
- package/dist/public/hyperframes.d.ts +19 -1
- package/dist/public/narrative.d.ts +17 -3
- package/dist/public/performance.d.ts +1590 -0
- package/dist/public/program-space.d.ts +179 -32
- package/dist/public/runtime-kit.d.ts +21 -8
- package/dist/public/sound.d.ts +822 -0
- package/dist/public/speech.d.ts +41 -0
- package/dist/public/studio-adapter.d.ts +107 -16
- package/dist/public/temporal-markup.d.ts +9 -44
- package/dist/public/temporal.d.ts +37 -28
- package/dist/public/{semantic-track.d.ts → timeline.d.ts} +62 -49
- package/examples/README.md +18 -10
- package/examples/minimal-author-package/packages/example-component/preview/preview.svml +19 -12
- package/examples/minimal-author-package/packages/example-component/src/component.ts +5 -5
- package/examples/minimal-author-package/packages/example-component/src/fragment.ts +3 -5
- package/examples/minimal-author-package/packages/example-component/src/manifest.ts +8 -10
- package/examples/minimal-author-package/packages/example-component/src/surface.ts +2 -2
- package/examples/provider-package/README.md +78 -0
- package/examples/provider-package/hypit.runtime.json +12 -0
- package/examples/provider-package/packages/provider-images/package.json +11 -0
- package/examples/provider-package/packages/provider-images/src/activation.ts +24 -0
- package/examples/provider-package/packages/provider-images/src/provider.ts +122 -0
- package/examples/provider-package/packages/provider-images/tsconfig.json +9 -0
- package/examples/semantic-composition/README.md +6 -0
- package/examples/semantic-composition/chat.svml +6 -5
- package/examples/semantic-composition/packages/chat-scene/README.md +3 -3
- package/examples/semantic-composition/packages/chat-scene/src/activation.ts +18 -21
- package/examples/semantic-composition/packages/chat-scene/src/render.ts +4 -4
- package/examples/semantic-composition/packages/performance-styles/README.md +42 -0
- package/examples/semantic-composition/packages/performance-styles/package.json +25 -0
- package/examples/semantic-composition/packages/performance-styles/src/activation.ts +57 -0
- package/examples/semantic-composition/packages/performance-styles/src/render.ts +54 -0
- package/examples/semantic-composition/packages/performance-styles/src/studio.ts +28 -0
- package/examples/semantic-composition/packages/performance-styles/tsconfig.json +18 -0
- package/examples/semantic-composition/packages/responsive-explainer/README.md +16 -9
- package/examples/semantic-composition/packages/responsive-explainer/src/activation.ts +12 -12
- package/examples/semantic-composition/packages/responsive-explainer/src/render.ts +5 -5
- package/examples/semantic-composition/packages/sound-styles/README.md +36 -0
- package/examples/semantic-composition/packages/sound-styles/package.json +25 -0
- package/examples/semantic-composition/packages/sound-styles/src/activation.ts +53 -0
- package/examples/semantic-composition/packages/sound-styles/src/render.ts +14 -0
- package/examples/semantic-composition/packages/sound-styles/tsconfig.json +18 -0
- package/package.json +35 -15
- package/packages/audio-track/README.md +20 -13
- package/packages/audio-track/package.json +1 -1
- package/packages/audio-track/src/component.ts +4 -4
- package/packages/audio-track/src/fragment.ts +6 -5
- package/packages/audio-track/src/index.ts +1 -1
- package/packages/audio-track/src/manifest.ts +17 -16
- package/packages/audio-track/src/program.ts +21 -25
- package/packages/audio-track/src/surface.ts +19 -18
- package/packages/audio-track-studio/README.md +23 -0
- package/packages/audio-track-studio/src/index.ts +33 -19
- package/packages/author-kit/README.md +1 -1
- package/packages/background-removal/README.md +4 -7
- package/packages/browser-capture/package.json +1 -1
- package/packages/build-result/README.md +69 -0
- package/packages/build-result/package.json +2 -1
- package/packages/build-result/src/decode.ts +12 -8
- package/packages/build-result/src/execution-log.ts +17 -0
- package/packages/build-result/src/file-reference.ts +42 -0
- package/packages/build-result/src/index.ts +4 -0
- package/packages/build-result/src/replace-file-windows.ts +58 -0
- package/packages/build-result/src/replace-file.ts +11 -0
- package/packages/build-result/src/store.ts +58 -14
- package/packages/build-result/src/types.ts +41 -8
- package/packages/build-result/src/writer.ts +12 -1
- package/packages/build-result-fs/README.md +23 -1
- package/packages/build-result-s3/README.md +5 -0
- package/packages/build-result-s3/src/repository.ts +23 -5
- package/packages/caption/README.md +61 -73
- package/packages/caption/package.json +3 -2
- package/packages/caption/src/activation.ts +2 -2
- package/packages/caption/src/component.ts +20 -5
- package/packages/caption/src/display.ts +3 -18
- package/packages/caption/src/fragment.ts +3 -7
- package/packages/caption/src/index.ts +6 -5
- package/packages/caption/src/manifest.ts +29 -46
- package/packages/caption/src/style.ts +24 -135
- package/packages/caption/src/surface.ts +12 -92
- package/packages/caption/src/temporalize.ts +18 -53
- package/packages/caption/src/types.ts +8 -35
- package/packages/caption/src/visibility.ts +23 -0
- package/packages/caption-fine/README.md +31 -11
- package/packages/caption-fine/package.json +4 -2
- package/packages/caption-fine/src/component.ts +3 -3
- package/packages/caption-fine/src/fragment.ts +7 -19
- package/packages/caption-fine/src/index.ts +2 -0
- package/packages/caption-fine/src/manifest.ts +27 -18
- package/packages/caption-fine/src/recipe.ts +7 -0
- package/packages/caption-fine/src/render.ts +62 -49
- package/packages/caption-fine/src/schedule.ts +39 -35
- package/packages/caption-fine/src/style.ts +10 -9
- package/packages/caption-fine/src/surface.ts +62 -35
- package/packages/caption-fine/src/types.ts +2 -0
- package/packages/caption-fine-studio/README.md +24 -2
- package/packages/caption-fine-studio/package.json +10 -3
- package/packages/caption-fine-studio/src/activation.ts +3 -3
- package/packages/caption-fine-studio/src/index.ts +61 -40
- package/packages/cli/README.md +81 -3
- package/packages/cli/package.json +1 -0
- package/packages/cli/src/arguments.ts +39 -15
- package/packages/cli/src/build-planning.ts +9 -3
- package/packages/cli/src/command.ts +7 -1
- package/packages/cli/src/commands/environment.ts +66 -27
- package/packages/cli/src/commands/execution.ts +81 -26
- package/packages/cli/src/commands/results.ts +7 -11
- package/packages/cli/src/index.ts +2 -2
- package/packages/cli/src/machine-view.ts +15 -5
- package/packages/cli/src/main.ts +38 -42
- package/packages/cli/src/observation.ts +7 -1
- package/packages/cli/src/output.ts +92 -34
- package/packages/cli/src/result-export.ts +22 -13
- package/packages/cli/src/run-file.ts +19 -8
- package/packages/cli/src/view.ts +64 -18
- package/packages/comment-sticker/README.md +3 -3
- package/packages/comment-sticker/package.json +1 -1
- package/packages/comment-sticker/src/component.ts +4 -4
- package/packages/comment-sticker/src/fragment.ts +5 -4
- package/packages/comment-sticker/src/manifest.ts +7 -6
- package/packages/comment-sticker/src/program.ts +9 -9
- package/packages/comment-sticker/src/surface.ts +6 -7
- package/packages/comment-sticker-studio/src/index.ts +2 -1
- package/packages/compiler-node/src/compiler.ts +1 -0
- package/packages/composition/README.md +21 -0
- package/packages/composition/src/audio-presentation.ts +44 -0
- package/packages/composition/src/index.ts +3 -0
- package/packages/composition/src/schema.ts +8 -3
- package/packages/composition/src/track.ts +15 -1
- package/packages/credential-store-env/README.md +1 -1
- package/packages/deck-track/README.md +3 -3
- package/packages/deck-track/package.json +1 -1
- package/packages/deck-track/src/component.ts +5 -5
- package/packages/deck-track/src/fragment.ts +6 -5
- package/packages/deck-track/src/lower.ts +12 -12
- package/packages/deck-track/src/manifest.ts +8 -7
- package/packages/deck-track/src/program.ts +13 -16
- package/packages/deck-track/src/surface.ts +9 -10
- package/packages/driver-node/src/driver.ts +41 -3
- package/packages/elevenlabs-speech/README.md +27 -0
- package/packages/{provider-xiaomi-mimo → elevenlabs-speech}/package.json +5 -8
- package/packages/elevenlabs-speech/src/activation.ts +26 -0
- package/packages/elevenlabs-speech/src/fragment.ts +11 -0
- package/packages/elevenlabs-speech/src/index.ts +111 -0
- package/packages/elevenlabs-speech/src/surface.ts +167 -0
- package/packages/endpoint-kit/README.md +24 -0
- package/packages/endpoint-kit/src/index.ts +7 -1
- package/packages/estimate/README.md +56 -3
- package/packages/estimate/src/program.ts +7 -8
- package/packages/film/README.md +12 -7
- package/packages/film/package.json +1 -1
- package/packages/film/src/component.ts +4 -4
- package/packages/film/src/fragment.ts +6 -5
- package/packages/film/src/manifest.ts +11 -10
- package/packages/film/src/program.ts +5 -5
- package/packages/film/src/recipe.ts +2 -1
- package/packages/film/src/surface.ts +6 -6
- package/packages/film-studio/package.json +1 -1
- package/packages/film-studio/src/index.ts +2 -2
- package/packages/fishaudio-speech/README.md +33 -0
- package/packages/fishaudio-speech/package.json +21 -0
- package/packages/fishaudio-speech/src/activation.ts +32 -0
- package/packages/fishaudio-speech/src/fragment.ts +11 -0
- package/packages/fishaudio-speech/src/index.ts +156 -0
- package/packages/fishaudio-speech/src/surface.ts +192 -0
- package/packages/fonts-open/README.md +5 -0
- package/packages/fonts-open/package.json +5 -1
- package/packages/fonts-open/src/studio.ts +21 -0
- package/packages/generation/README.md +11 -1
- package/packages/generation/src/mapping.ts +28 -30
- package/packages/gpt-image/README.md +1 -2
- package/packages/grok-imagine/README.md +1 -2
- package/packages/hyperframes/README.md +7 -3
- package/packages/hyperframes/src/browser-program.ts +11 -2
- package/packages/hyperframes/src/document.ts +15 -2
- package/packages/interview-emoji-reveal/README.md +4 -4
- package/packages/interview-emoji-reveal/package.json +1 -1
- package/packages/interview-emoji-reveal/src/component.ts +4 -4
- package/packages/interview-emoji-reveal/src/fragment.ts +6 -5
- package/packages/interview-emoji-reveal/src/manifest.ts +9 -8
- package/packages/interview-emoji-reveal/src/program.ts +14 -14
- package/packages/interview-emoji-reveal/src/surface.ts +8 -9
- package/packages/media-execution/README.md +7 -3
- package/packages/media-execution/src/audio-presentation.ts +23 -0
- package/packages/media-execution/src/execute.ts +2 -0
- package/packages/media-pipeline/README.md +7 -3
- package/packages/media-pipeline/src/audio-plan.ts +4 -1
- package/packages/media-pipeline/src/component.ts +16 -2
- package/packages/media-pipeline/src/manifest.ts +3 -1
- package/packages/media-pipeline/src/types.ts +2 -1
- package/packages/media-track/README.md +14 -47
- package/packages/media-track/package.json +1 -1
- package/packages/media-track/preview/preview.svml +5 -5
- package/packages/media-track/src/author.ts +12 -6
- package/packages/media-track/src/component.ts +10 -16
- package/packages/media-track/src/fragment.ts +8 -7
- package/packages/media-track/src/index.ts +3 -1
- package/packages/media-track/src/lower.ts +7 -7
- package/packages/media-track/src/manifest.ts +16 -38
- package/packages/media-track/src/program.ts +62 -67
- package/packages/media-track/src/sampling.ts +6 -6
- package/packages/media-track/src/sequence.ts +8 -8
- package/packages/media-track/src/surface.ts +25 -43
- package/packages/media-track-studio/README.md +9 -0
- package/packages/media-track-studio/src/index.ts +23 -13
- package/packages/mimo-speech/README.md +1 -1
- package/packages/minimax-h3/README.md +1 -1
- package/packages/nano-banana/README.md +1 -1
- package/packages/narrative/README.md +23 -1
- package/packages/narrative/src/identity.ts +11 -0
- package/packages/narrative/src/index.ts +3 -0
- package/packages/narrative/src/schema.ts +28 -27
- package/packages/narrative/src/selection.ts +52 -0
- package/packages/narrative/src/types.ts +2 -0
- package/packages/package-loader-node/README.md +30 -0
- package/packages/package-loader-node/package.json +5 -2
- package/packages/package-loader-node/src/distribution-resolution.ts +10 -3
- package/packages/package-loader-node/src/index.ts +1 -0
- package/packages/package-loader-node/src/loader.ts +12 -15
- package/packages/package-loader-node/src/location.ts +27 -1
- package/packages/package-loader-node/src/module-scope.ts +183 -0
- package/packages/package-loader-node/src/types.ts +4 -0
- package/packages/performance/README.md +83 -0
- package/packages/performance/package.json +30 -0
- package/packages/performance/src/activation.ts +11 -0
- package/packages/performance/src/component.ts +46 -0
- package/packages/performance/src/index.ts +6 -0
- package/packages/performance/src/manifest.ts +53 -0
- package/packages/{media-track/src/performance.ts → performance/src/media.ts} +9 -10
- package/packages/performance/src/program.ts +51 -0
- package/packages/performance/src/style.ts +35 -0
- package/packages/performance/src/surface.ts +99 -0
- package/packages/performance-studio/README.md +25 -0
- package/packages/performance-studio/package.json +21 -0
- package/packages/performance-studio/src/activation.ts +6 -0
- package/packages/performance-studio/src/index.ts +84 -0
- package/packages/program-space/README.md +9 -18
- package/packages/program-space/src/activation.ts +1 -5
- package/packages/program-space/src/index.ts +2 -11
- package/packages/program-space/src/surface.ts +1 -20
- package/packages/project-context-node/README.md +20 -0
- package/packages/project-context-node/package.json +10 -0
- package/packages/project-context-node/src/index.ts +3 -0
- package/packages/{cli → project-context-node}/src/runtime-selection.ts +7 -2
- package/packages/provider-hyperframes-local/README.md +43 -15
- package/packages/provider-hyperframes-local/src/activation.ts +4 -3
- package/packages/provider-hyperframes-local/src/capture-process.ts +26 -4
- package/packages/provider-hyperframes-local/src/capture.ts +96 -26
- package/packages/provider-hyperframes-local/src/concurrency.ts +86 -0
- package/packages/provider-hyperframes-local/src/opaque-capture.ts +92 -0
- package/packages/provider-hyperframes-local/src/options.ts +2 -0
- package/packages/provider-hyperframes-local/src/program.ts +6 -3
- package/packages/provider-hyperframes-local/src/progress.ts +53 -0
- package/packages/provider-hyperframes-local/src/provider.ts +18 -5
- package/packages/provider-hyperframes-local/src/render.ts +48 -7
- package/packages/provider-hypihub/README.md +48 -17
- package/packages/provider-hypihub/package.json +2 -0
- package/packages/provider-hypihub/src/mapping.ts +31 -7
- package/packages/provider-hypihub/src/oauth.ts +6 -0
- package/packages/provider-hypihub/src/provider.ts +25 -13
- package/packages/provider-hypihub/src/routes.ts +1 -2
- package/packages/provider-hypihub/src/upload.ts +2 -0
- package/packages/provider-media-local/README.md +3 -4
- package/packages/provider-whisperx-local/README.md +57 -0
- package/packages/provider-whisperx-local/src/program.ts +1 -0
- package/packages/provider-whisperx-local/src/provider.ts +3 -0
- package/packages/ranking/README.md +8 -6
- package/packages/ranking/package.json +1 -1
- package/packages/ranking/src/component.ts +6 -6
- package/packages/ranking/src/fragment.ts +11 -7
- package/packages/ranking/src/manifest.ts +21 -14
- package/packages/ranking/src/render.ts +33 -35
- package/packages/ranking/src/schedule.ts +16 -19
- package/packages/ranking/src/surface.ts +12 -13
- package/packages/ranking-studio/README.md +29 -0
- package/packages/ranking-studio/package.json +8 -3
- package/packages/ranking-studio/src/index.ts +71 -12
- package/packages/render-hyperframes/README.md +7 -7
- package/packages/render-hyperframes/package.json +1 -1
- package/packages/render-hyperframes/src/component.ts +11 -1
- package/packages/render-hyperframes/src/fragment.ts +7 -4
- package/packages/render-hyperframes/src/manifest.ts +4 -4
- package/packages/render-hyperframes/src/surface.ts +6 -6
- package/packages/runtime/README.md +8 -1
- package/packages/runtime/src/catalog.ts +2 -0
- package/packages/runtime/src/execution.ts +15 -4
- package/packages/runtime/src/index.ts +2 -1
- package/packages/runtime/src/log.ts +51 -0
- package/packages/runtime/src/types.ts +5 -8
- package/packages/runtime-host-node/README.md +30 -0
- package/packages/runtime-host-node/package.json +1 -0
- package/packages/runtime-host-node/src/index.ts +25 -9
- package/packages/runtime-host-node/src/packages.ts +47 -50
- package/packages/runtime-kit/README.md +5 -0
- package/packages/runtime-kit/src/index.ts +3 -1
- package/packages/runtime-local/README.md +111 -4
- package/packages/runtime-local/src/config.ts +202 -56
- package/packages/runtime-local/src/control.ts +9 -1
- package/packages/runtime-local/src/executor.ts +66 -0
- package/packages/runtime-local/src/host.ts +37 -17
- package/packages/runtime-local/src/log.ts +48 -0
- package/packages/runtime-local/src/programs.ts +41 -25
- package/packages/runtime-local/src/result-writer.ts +2 -0
- package/packages/runtime-local/src/runtime.ts +10 -6
- package/packages/runtime-local/src/supervisor.ts +142 -0
- package/packages/runtime-local/src/types.ts +9 -2
- package/packages/runtime-local/src/worker-process.ts +7 -24
- package/packages/runtime-local/src/worker.ts +55 -83
- package/packages/screen-overlay/README.md +3 -3
- package/packages/screen-overlay/package.json +1 -1
- package/packages/screen-overlay/src/component.ts +3 -3
- package/packages/screen-overlay/src/fragment.ts +5 -4
- package/packages/screen-overlay/src/manifest.ts +7 -6
- package/packages/screen-overlay/src/program.ts +9 -9
- package/packages/screen-overlay/src/surface.ts +6 -7
- package/packages/script/README.md +37 -2
- package/packages/script/src/edit.ts +123 -73
- package/packages/script/src/lexical.ts +40 -6
- package/packages/script/src/manifest.ts +2 -2
- package/packages/script/src/narrative.ts +1 -0
- package/packages/script/src/parser.ts +36 -8
- package/packages/script/src/surface.ts +4 -3
- package/packages/script/src/types.ts +5 -1
- package/packages/script-studio/package.json +9 -3
- package/packages/script-studio/src/index.ts +2 -0
- package/packages/script-studio/src/projection.ts +105 -0
- package/packages/seedance/README.md +30 -1
- package/packages/seedance/src/index.ts +18 -7
- package/packages/seedance/src/surface.ts +17 -4
- package/packages/seedance-kits/README.md +10 -2
- package/packages/seedance-kits/kits/speaker-v1.svs +5 -5
- package/packages/seedream/README.md +1 -1
- package/packages/sound/README.md +81 -0
- package/packages/sound/package.json +25 -0
- package/packages/sound/src/activation.ts +11 -0
- package/packages/sound/src/component.ts +28 -0
- package/packages/sound/src/index.ts +5 -0
- package/packages/sound/src/manifest.ts +47 -0
- package/packages/sound/src/program.ts +84 -0
- package/packages/sound/src/style.ts +34 -0
- package/packages/sound/src/surface.ts +90 -0
- package/packages/sound-studio/README.md +22 -0
- package/packages/sound-studio/package.json +20 -0
- package/packages/sound-studio/src/activation.ts +6 -0
- package/packages/sound-studio/src/index.ts +74 -0
- package/packages/speech/README.md +2 -2
- package/packages/speech-alignment/src/align.ts +45 -21
- package/packages/speech-alignment/src/local.ts +8 -0
- package/packages/speech-alignment/src/locate.ts +1 -1
- package/packages/store-sqlite/README.md +7 -0
- package/packages/store-sqlite/src/store.ts +84 -83
- package/packages/studio/INSPECTOR.md +117 -0
- package/packages/studio/README.md +149 -14
- package/packages/studio/package.json +8 -7
- package/packages/studio/src/build-library.ts +99 -84
- package/packages/studio/src/companion-assembly.ts +1 -0
- package/packages/studio/src/domain.ts +1 -1
- package/packages/studio/src/fallback-companions.ts +3 -3
- package/packages/studio/src/feedback-server.ts +51 -0
- package/packages/studio/src/feedback-store.ts +66 -0
- package/packages/studio/src/feedback.ts +60 -0
- package/packages/studio/src/library-media.ts +19 -0
- package/packages/studio/src/parameter-values.ts +83 -1
- package/packages/studio/src/parameters.ts +132 -43
- package/packages/studio/src/preview/render.ts +5 -1
- package/packages/studio/src/preview/runtime-shim.ts +49 -3
- package/packages/studio/src/programme.ts +14 -30
- package/packages/studio/src/server.ts +66 -34
- package/packages/studio/src/shared.ts +24 -8
- package/packages/studio/src/snapshot.ts +21 -132
- package/packages/studio/src/studio-preflight.ts +3 -3
- package/packages/studio/src/studio-registry.ts +72 -6
- package/packages/studio/src/style.css +342 -190
- package/packages/studio/src/temporal-edit.ts +131 -0
- package/packages/studio/src/ui/artifact-name.ts +80 -0
- package/packages/studio/src/ui/artifact-preview.ts +99 -0
- package/packages/studio/src/ui/comments.ts +233 -0
- package/packages/studio/src/ui/icons.ts +10 -1
- package/packages/studio/src/ui/library.ts +373 -192
- package/packages/studio/src/ui/main.ts +291 -110
- package/packages/studio/src/ui/material-preview.ts +1 -1
- package/packages/studio/src/ui/overlay.ts +31 -26
- package/packages/studio/src/ui/scrub-preview.ts +108 -0
- package/packages/studio/src/ui/sidebar-panel.ts +31 -0
- package/packages/studio/src/ui/stage.ts +188 -9
- package/packages/studio/src/ui/timeline.ts +187 -281
- package/packages/studio/start.ts +19 -5
- package/packages/studio-adapter/README.md +151 -11
- package/packages/studio-adapter/src/index.ts +126 -14
- package/packages/temporal/README.md +6 -6
- package/packages/temporal/package.json +1 -1
- package/packages/temporal/src/component.ts +5 -6
- package/packages/temporal/src/index.ts +8 -6
- package/packages/temporal/src/location.ts +11 -11
- package/packages/temporal/src/projection.ts +19 -19
- package/packages/temporal/src/rational.ts +4 -4
- package/packages/temporal-markup/EDITING.md +183 -0
- package/packages/temporal-markup/README.md +31 -11
- package/packages/temporal-markup/package.json +1 -1
- package/packages/temporal-markup/src/index.ts +20 -25
- package/packages/temporal-markup/src/space.ts +10 -41
- package/packages/timeline/README.md +31 -0
- package/packages/{semantic-track → timeline}/package.json +1 -1
- package/packages/timeline/src/activation.ts +8 -0
- package/packages/timeline/src/component.ts +24 -0
- package/packages/timeline/src/identity.ts +60 -0
- package/packages/timeline/src/index.ts +6 -0
- package/packages/{semantic-track → timeline}/src/location.ts +20 -20
- package/packages/timeline/src/manifest.ts +39 -0
- package/packages/{semantic-track → timeline}/src/projection.ts +14 -14
- package/packages/timeline/src/types.ts +24 -0
- package/packages/timeline-author/README.md +68 -0
- package/packages/{speech-track → timeline-author}/package.json +6 -4
- package/packages/timeline-author/src/activation.ts +22 -0
- package/packages/{speech-track → timeline-author}/src/component.ts +15 -13
- package/packages/{speech-track → timeline-author}/src/fragment.ts +14 -23
- package/packages/timeline-author/src/index.ts +7 -0
- package/packages/timeline-author/src/manifest.ts +78 -0
- package/packages/timeline-author/src/program.ts +107 -0
- package/packages/timeline-author/src/surface.ts +46 -0
- package/packages/timeline-author/src/types.ts +6 -0
- package/packages/typography-track/README.md +4 -4
- package/packages/typography-track/package.json +1 -1
- package/packages/typography-track/src/component.ts +4 -4
- package/packages/typography-track/src/fragment.ts +4 -3
- package/packages/typography-track/src/manifest.ts +11 -9
- package/packages/typography-track/src/program.ts +15 -15
- package/packages/typography-track/src/surface.ts +17 -18
- package/packages/typography-track-studio/package.json +8 -3
- package/packages/typography-track-studio/src/index.ts +5 -1
- package/packages/video-cli/README.md +16 -4
- package/packages/video-cli/package.json +2 -1
- package/packages/video-cli/src/creation.ts +25 -9
- package/packages/video-cli/src/index.ts +1 -1
- package/packages/video-cli/src/studio-distribution.ts +2 -1
- package/packages/volcengine-matting/README.md +3 -3
- package/packages/whisperx/README.md +8 -1
- package/packages/workspace/src/index.ts +2 -0
- package/packages/workspace-fs-node/README.md +4 -1
- package/packages/workspace-fs-node/src/workspace.ts +3 -1
- package/services/whisperx/README.md +14 -0
- package/services/whisperx/pyproject.toml +2 -0
- package/services/whisperx/uv.lock +20 -20
- package/packages/provider-hyperframes-aws-lambda/README.md +0 -30
- package/packages/provider-hyperframes-aws-lambda/package.json +0 -30
- package/packages/provider-hyperframes-aws-lambda/src/activation.ts +0 -97
- package/packages/provider-hyperframes-aws-lambda/src/client.ts +0 -114
- package/packages/provider-hyperframes-aws-lambda/src/index.ts +0 -21
- package/packages/provider-hyperframes-aws-lambda/src/provider.ts +0 -522
- package/packages/provider-kie/README.md +0 -134
- package/packages/provider-kie/package.json +0 -43
- package/packages/provider-kie/src/activation.ts +0 -71
- package/packages/provider-kie/src/index.ts +0 -10
- package/packages/provider-kie/src/mapping.ts +0 -182
- package/packages/provider-kie/src/provider.ts +0 -657
- package/packages/provider-kie/src/routes.ts +0 -150
- package/packages/provider-xiaomi-mimo/README.md +0 -32
- package/packages/provider-xiaomi-mimo/src/activation.ts +0 -57
- package/packages/provider-xiaomi-mimo/src/index.ts +0 -5
- package/packages/provider-xiaomi-mimo/src/provider.ts +0 -214
- package/packages/runtime/src/environment.ts +0 -6
- package/packages/semantic-track/README.md +0 -21
- package/packages/semantic-track/src/activation.ts +0 -8
- package/packages/semantic-track/src/component.ts +0 -24
- package/packages/semantic-track/src/identity.ts +0 -58
- package/packages/semantic-track/src/index.ts +0 -6
- package/packages/semantic-track/src/manifest.ts +0 -38
- package/packages/semantic-track/src/types.ts +0 -26
- package/packages/speech-track/README.md +0 -51
- package/packages/speech-track/src/activation.ts +0 -19
- package/packages/speech-track/src/index.ts +0 -7
- package/packages/speech-track/src/manifest.ts +0 -73
- package/packages/speech-track/src/program.ts +0 -64
- package/packages/speech-track/src/surface.ts +0 -35
- package/packages/speech-track/src/types.ts +0 -6
- package/packages/speech-track-studio/README.md +0 -3
- package/packages/speech-track-studio/package.json +0 -14
- package/packages/speech-track-studio/src/activation.ts +0 -7
- package/packages/speech-track-studio/src/index.ts +0 -40
- /package/packages/{cli → project-context-node}/src/project-context.ts +0 -0
- /package/packages/{speech-track → timeline-author}/preview/Track.png +0 -0
|
@@ -9,10 +9,8 @@ import type {
|
|
|
9
9
|
SurfaceResolvedReference,
|
|
10
10
|
} from "@hypit/markup";
|
|
11
11
|
import { narrativeTypes } from "@hypit/narrative";
|
|
12
|
-
import { programSpaceTypes } from "@hypit/program-space";
|
|
13
|
-
import { createTemporalSpace } from "./space.js";
|
|
14
12
|
export * from "./space.js";
|
|
15
|
-
import {
|
|
13
|
+
import { timelineTypes } from "@hypit/timeline";
|
|
16
14
|
import {
|
|
17
15
|
temporalProducers,
|
|
18
16
|
temporalTypes,
|
|
@@ -41,6 +39,9 @@ export const temporalWindowAttributeVocabulary: readonly SurfaceAttributeVocabul
|
|
|
41
39
|
summary: "Sets a projected start expression; write it together with end." },
|
|
42
40
|
{ name: "end", kind: "literal", required: false,
|
|
43
41
|
summary: "Sets a projected end expression; write it together with start." },
|
|
42
|
+
...["start-source", "end-source"].map(name => ({ name, kind: "reference" as const, required: false,
|
|
43
|
+
accepts: [narrativeTypes.selection, narrativeTypes.excerpt, narrativeTypes.moment],
|
|
44
|
+
summary: "Binds this endpoint's semantic source independently; its expression determines the boundary." })),
|
|
44
45
|
{ name: "selection", kind: "reference", required: false, accepts: [narrativeTypes.selection],
|
|
45
46
|
summary: "Resolves selection.start or selection.end used by a projected start/end expression." },
|
|
46
47
|
{ name: "segment", kind: "reference", required: false, accepts: [narrativeTypes.excerpt],
|
|
@@ -205,12 +206,13 @@ function sourceReference(
|
|
|
205
206
|
element: StructuredElement,
|
|
206
207
|
kind: SourceKind,
|
|
207
208
|
resolveReference: ResolveReference,
|
|
209
|
+
attribute = kind as string,
|
|
208
210
|
): SurfaceResolvedReference | undefined {
|
|
209
211
|
if (kind === "program") return undefined;
|
|
210
212
|
const expected = kind === "selection"
|
|
211
213
|
? narrativeTypes.selection
|
|
212
214
|
: kind === "segment" ? narrativeTypes.excerpt : narrativeTypes.moment;
|
|
213
|
-
return resolve(element.attributes[
|
|
215
|
+
return resolve(element.attributes[attribute], `${element.name}.${attribute}`, expected, resolveReference);
|
|
214
216
|
}
|
|
215
217
|
|
|
216
218
|
function projectionFragment(input: {
|
|
@@ -224,8 +226,7 @@ function projectionFragment(input: {
|
|
|
224
226
|
? [["instant", input.start] as const]
|
|
225
227
|
: [["start", input.start] as const, ["end", input.end] as const];
|
|
226
228
|
const inputs = [
|
|
227
|
-
{ name: "
|
|
228
|
-
...(endpoints.some(([, endpoint]) => endpoint.source !== "program") ? [{ name: "semantic", type: semanticTrackTypes.track }] : []),
|
|
229
|
+
{ name: "timeline", type: timelineTypes.track },
|
|
229
230
|
...endpoints.map(([name]) => ({ name: `${name}-spec`, type: temporalTypes.instantSpec })),
|
|
230
231
|
...endpoints.flatMap(([name, endpoint]) => endpoint.source === "program" ? [] : [{
|
|
231
232
|
name: `${name}-${endpoint.source}`,
|
|
@@ -241,7 +242,7 @@ function projectionFragment(input: {
|
|
|
241
242
|
: endpoint.source === "segment" ? temporalProducers.projectSegmentInstant
|
|
242
243
|
: temporalProducers.projectMomentInstant,
|
|
243
244
|
inputs: {
|
|
244
|
-
|
|
245
|
+
timeline: fragmentInput("timeline"),
|
|
245
246
|
spec: fragmentInput(`${name}-spec`),
|
|
246
247
|
...(endpoint.source === "program" ? {} : {
|
|
247
248
|
[endpoint.source]: fragmentInput(`${name}-${endpoint.source}`),
|
|
@@ -274,15 +275,10 @@ function projectionDraft(input: {
|
|
|
274
275
|
readonly id: string;
|
|
275
276
|
readonly subjectId?: string;
|
|
276
277
|
readonly element: StructuredElement;
|
|
277
|
-
readonly
|
|
278
|
-
readonly space?: SurfaceResolvedReference;
|
|
278
|
+
readonly timeline: SurfaceResolvedReference;
|
|
279
279
|
readonly start: InstantDraft;
|
|
280
280
|
readonly end?: InstantDraft;
|
|
281
281
|
}): TemporalMarkupProjection {
|
|
282
|
-
if ([input.start, input.end].some((endpoint) => endpoint !== undefined && endpoint.source !== "program") && input.semantic === undefined) {
|
|
283
|
-
throw new Error(`${input.element.name} needs semantic to resolve this Script reference.`);
|
|
284
|
-
}
|
|
285
|
-
const time = createTemporalSpace(input);
|
|
286
282
|
const output = input.end === undefined ? "instant" : "window";
|
|
287
283
|
const subjectId = input.subjectId ?? input.id;
|
|
288
284
|
if (subjectId.length === 0) throw new Error("Temporal projection subjectId must not be empty.");
|
|
@@ -291,8 +287,7 @@ function projectionDraft(input: {
|
|
|
291
287
|
const records: SurfaceRecordDraft[] = [];
|
|
292
288
|
const componentInputs: SurfaceComponentDraft["inputs"] extends infer _T
|
|
293
289
|
? Record<string, SurfaceResolvedReference["ref"] | { readonly kind: "record"; readonly id: string }>
|
|
294
|
-
: never = {
|
|
295
|
-
if ([input.start, input.end].every((endpoint) => endpoint === undefined || endpoint.source === "program")) delete componentInputs.semantic;
|
|
290
|
+
: never = { timeline: input.timeline.ref };
|
|
296
291
|
const endpoints = input.end === undefined
|
|
297
292
|
? [["instant", input.start] as const]
|
|
298
293
|
: [["start", input.start] as const, ["end", input.end] as const];
|
|
@@ -327,14 +322,14 @@ function projectionDraft(input: {
|
|
|
327
322
|
}
|
|
328
323
|
return {
|
|
329
324
|
records,
|
|
330
|
-
components: [
|
|
325
|
+
components: [{
|
|
331
326
|
id: componentId,
|
|
332
327
|
fragment: fragment.id,
|
|
333
328
|
inputs: componentInputs,
|
|
334
329
|
outputs: { [output]: `${input.id}.__temporal.${output}` },
|
|
335
330
|
range: input.element.range,
|
|
336
331
|
}],
|
|
337
|
-
fragments: [
|
|
332
|
+
fragments: [fragment],
|
|
338
333
|
ref: { kind: "component-output", component: componentId, output },
|
|
339
334
|
};
|
|
340
335
|
}
|
|
@@ -344,8 +339,7 @@ export function createTemporalWindowProjection(input: {
|
|
|
344
339
|
readonly id: string;
|
|
345
340
|
readonly subjectId?: string;
|
|
346
341
|
readonly element: StructuredElement;
|
|
347
|
-
readonly
|
|
348
|
-
readonly space?: SurfaceResolvedReference;
|
|
342
|
+
readonly timeline: SurfaceResolvedReference;
|
|
349
343
|
readonly resolveReference: ResolveReference;
|
|
350
344
|
}): TemporalMarkupProjection {
|
|
351
345
|
const { element, resolveReference } = input;
|
|
@@ -422,13 +416,15 @@ export function createTemporalWindowProjection(input: {
|
|
|
422
416
|
const endExpression = parseTemporalInstant(end, `${element.name}.end`);
|
|
423
417
|
const startSource = expressionSource(startExpression);
|
|
424
418
|
const endSource = expressionSource(endExpression);
|
|
419
|
+
const startBinding = element.attributes["start-source"] === undefined ? startSource : "start-source";
|
|
420
|
+
const endBinding = element.attributes["end-source"] === undefined ? endSource : "end-source";
|
|
425
421
|
rejectUnusedTemporalAttributes(element, temporalWindowAttributeNames, [
|
|
426
422
|
"start", "end",
|
|
427
|
-
...(startSource === "program" ? [] : [
|
|
428
|
-
...(endSource === "program" ? [] : [
|
|
423
|
+
...(startSource === "program" ? [] : [startBinding]),
|
|
424
|
+
...(endSource === "program" ? [] : [endBinding]),
|
|
429
425
|
]);
|
|
430
|
-
const startReference =
|
|
431
|
-
const endReference =
|
|
426
|
+
const startReference = sourceReference(element, startSource, resolveReference, startBinding);
|
|
427
|
+
const endReference = sourceReference(element, endSource, resolveReference, endBinding);
|
|
432
428
|
return projectionDraft({
|
|
433
429
|
...input,
|
|
434
430
|
start: {
|
|
@@ -451,8 +447,7 @@ export function createTemporalInstantProjection(input: {
|
|
|
451
447
|
readonly id: string;
|
|
452
448
|
readonly subjectId?: string;
|
|
453
449
|
readonly element: StructuredElement;
|
|
454
|
-
readonly
|
|
455
|
-
readonly space?: SurfaceResolvedReference;
|
|
450
|
+
readonly timeline: SurfaceResolvedReference;
|
|
456
451
|
readonly resolveReference: ResolveReference;
|
|
457
452
|
readonly semanticAttribute?: string;
|
|
458
453
|
readonly boundaryAttribute?: string;
|
|
@@ -1,59 +1,28 @@
|
|
|
1
|
-
import { sealGraphFragment } from "@hypit/elaborator";
|
|
2
1
|
import type { StructuredElement, SurfaceAttributeVocabulary, SurfaceResolvedReference } from "@hypit/markup";
|
|
3
|
-
import {
|
|
4
|
-
import { semanticTrackProducers, semanticTrackTypes } from "@hypit/semantic-track";
|
|
2
|
+
import { timelineTypes } from "@hypit/timeline";
|
|
5
3
|
|
|
6
4
|
export type TemporalContext = {
|
|
7
|
-
readonly
|
|
8
|
-
readonly space?: SurfaceResolvedReference;
|
|
5
|
+
readonly timeline: SurfaceResolvedReference;
|
|
9
6
|
};
|
|
10
7
|
|
|
11
8
|
export const temporalContextAttributeVocabulary = [
|
|
12
|
-
{ name: "
|
|
13
|
-
summary: "
|
|
14
|
-
{ name: "space", kind: "reference", required: false, accepts: [programSpaceTypes.programSpace],
|
|
15
|
-
summary: "Uses a declared film time axis for authored animation. Supply semantic or space." },
|
|
9
|
+
{ name: "timeline", kind: "reference", required: true, accepts: [timelineTypes.track],
|
|
10
|
+
summary: "The complete film Timeline, with any placed material and semantic anchors." },
|
|
16
11
|
] as const satisfies readonly SurfaceAttributeVocabulary[];
|
|
17
12
|
|
|
18
|
-
/**
|
|
13
|
+
/** One author-facing Timeline; projections share its range and evidence. */
|
|
19
14
|
export function resolveTemporalContext(input: {
|
|
20
15
|
readonly element: StructuredElement;
|
|
21
16
|
readonly resolveReference: (path: string) => SurfaceResolvedReference | undefined;
|
|
22
17
|
}): TemporalContext {
|
|
23
18
|
const { element, resolveReference } = input;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
const name = element.attributes.semantic === undefined ? "space" : "semantic";
|
|
28
|
-
const raw = element.attributes[name];
|
|
29
|
-
if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${element.name}.${name} must be a reference.`);
|
|
19
|
+
const raw = element.attributes.timeline;
|
|
20
|
+
if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${element.name}.timeline must be a reference.`);
|
|
30
21
|
const found = resolveReference(raw.path);
|
|
31
|
-
const expected =
|
|
22
|
+
const expected = timelineTypes.track;
|
|
32
23
|
if (found === undefined || found.type.module.name !== expected.module.name
|
|
33
24
|
|| found.type.module.version !== expected.module.version || found.type.name !== expected.name) {
|
|
34
|
-
throw new Error(`${element.name}
|
|
25
|
+
throw new Error(`${element.name}.timeline must reference a Timeline.`);
|
|
35
26
|
}
|
|
36
|
-
return {
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Give consumers a ProgramSpace while preserving semantic context for word-bound projections. */
|
|
40
|
-
export function createTemporalSpace(input: TemporalContext & { readonly id: string; readonly element: StructuredElement }) {
|
|
41
|
-
if (input.space !== undefined) return { records: [], components: [], fragments: [], space: input.space };
|
|
42
|
-
if (input.semantic === undefined) throw new Error(`${input.element.name} requires a film time source.`);
|
|
43
|
-
const fragment = sealGraphFragment({
|
|
44
|
-
inputs: [{ name: "semantic", type: semanticTrackTypes.track }],
|
|
45
|
-
operations: [{ id: "project-space", producer: semanticTrackProducers.projectProgramSpace,
|
|
46
|
-
inputs: { track: { kind: "fragment-input", name: "semantic" } }, result: { kind: "output", name: "space" } }],
|
|
47
|
-
exports: [{ name: "space", type: programSpaceTypes.programSpace,
|
|
48
|
-
root: { kind: "fragment-operation", operation: "project-space" } }],
|
|
49
|
-
});
|
|
50
|
-
const id = `${input.id}.__space`;
|
|
51
|
-
const space: SurfaceResolvedReference = { path: `${id}.space`, type: programSpaceTypes.programSpace,
|
|
52
|
-
ref: { kind: "component-output", component: id, output: "space" } };
|
|
53
|
-
return {
|
|
54
|
-
records: [],
|
|
55
|
-
components: [{ id, fragment: fragment.id, inputs: { semantic: input.semantic.ref }, outputs: { space: `${id}.space` }, range: input.element.range }],
|
|
56
|
-
fragments: [fragment],
|
|
57
|
-
space,
|
|
58
|
-
};
|
|
27
|
+
return { timeline: found };
|
|
59
28
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# `@hypit/timeline`
|
|
2
|
+
|
|
3
|
+
One Timeline describes the complete film time range and the prepared Takes placed within it.
|
|
4
|
+
Semantic anchors exist wherever those Takes supply them; no second kind of time axis is needed
|
|
5
|
+
for authored animation. The value stores `id`, `durationSec`, `frameRate`, optional `narrativeId`,
|
|
6
|
+
and `items` containing `take` and `startFrame`. A zero-Take Timeline has no Narrative identity.
|
|
7
|
+
|
|
8
|
+
Each Take retains its normalized local media and semantic evidence. Global positions are its
|
|
9
|
+
placement start plus local positions. Items can leave gaps or overlap; their declaration order is
|
|
10
|
+
preserved. Frame rates and Narrative ownership agree, identities remain unique, and every complete
|
|
11
|
+
Take fits inside the positive Program range. Assembly is owned by
|
|
12
|
+
[Timeline authoring](../timeline-author/README.md).
|
|
13
|
+
|
|
14
|
+
`projectTimelineSpace` supplies the lightweight `ProgramSpace` range used by rendering.
|
|
15
|
+
`semanticAnchorFrames`, `selectionFrameSpan`, `segmentFrameSpan`, `tokenFrameSpan` and `momentFrame`
|
|
16
|
+
locate evidence without copying another word table. Program boundaries are available even with zero
|
|
17
|
+
Takes. Selection endpoints retain their authored identities; projection/consumption determines
|
|
18
|
+
whether a requested physical Window is usable.
|
|
19
|
+
|
|
20
|
+
## Project prepared material
|
|
21
|
+
|
|
22
|
+
`projectTimelineMedia(timeline, window?)` returns every intersecting Take's `media`, `segmentId`,
|
|
23
|
+
global `span` and local `source` frame span. The default Window is the complete Timeline. Gaps
|
|
24
|
+
return no source; overlaps return all intersecting sources. Audio-only Takes remain represented.
|
|
25
|
+
Starting presentation inside a Take retains the matching source frame. This projection chooses no
|
|
26
|
+
layout, winning picture, held frame or transition.
|
|
27
|
+
|
|
28
|
+
`projectTimelineAudio` places original audio at each Take's position at native speed and gain.
|
|
29
|
+
Takes without audio contribute no clip; gaps are silent and overlapping Takes contribute simultaneous
|
|
30
|
+
clips. Film explicitly includes that audio contribution. These functions perform no media I/O,
|
|
31
|
+
transcription, rendering or generation.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ComponentPackage } from "@hypit/component-kit";
|
|
2
|
+
import type { StoredValue } from "@hypit/protocol";
|
|
3
|
+
import { canonicalize } from "@hypit/protocol";
|
|
4
|
+
|
|
5
|
+
import { timelineProducers, timelineTypes } from "./manifest.js";
|
|
6
|
+
import { assertTimelineIdentity } from "./identity.js";
|
|
7
|
+
import { projectTimelineAudio, projectTimelineSpace } from "./projection.js";
|
|
8
|
+
import type { Timeline } from "./types.js";
|
|
9
|
+
|
|
10
|
+
function track(value: StoredValue | undefined): Timeline {
|
|
11
|
+
if (value?.kind !== "inline") throw new Error("Timeline must be inline.");
|
|
12
|
+
return value.value as unknown as Timeline;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const timelineComponent = {
|
|
16
|
+
producers: [
|
|
17
|
+
{ producer: timelineProducers.projectProgramSpace, handler: ({ inputs }) => ({ outputs: { space: { kind: "inline", value: canonicalize(projectTimelineSpace(track(inputs.track?.value))) } }, needs: {} }) },
|
|
18
|
+
{ producer: timelineProducers.projectAudio, handler: ({ inputs }) => ({ outputs: { audio: { kind: "inline", value: canonicalize(projectTimelineAudio(track(inputs.track?.value))) } }, needs: {} }) },
|
|
19
|
+
],
|
|
20
|
+
validators: [{
|
|
21
|
+
type: timelineTypes.track,
|
|
22
|
+
handler: ({ value }) => assertTimelineIdentity(track(value)),
|
|
23
|
+
}],
|
|
24
|
+
} satisfies ComponentPackage;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { assertProgramSpaceIdentity, programSpaceFrameCount } from "@hypit/program-space";
|
|
2
|
+
import { assertSemanticTakeIdentity } from "@hypit/speech";
|
|
3
|
+
|
|
4
|
+
import type { Timeline, TimelineSpan } from "./types.js";
|
|
5
|
+
|
|
6
|
+
export function sealTimeline(value: Timeline): Timeline {
|
|
7
|
+
const track = structuredClone(value);
|
|
8
|
+
assertTimelineIdentity(track);
|
|
9
|
+
return track;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function assertTimelineIdentity(track: Timeline): void {
|
|
13
|
+
assertProgramSpaceIdentity(track);
|
|
14
|
+
const frameCount = programSpaceFrameCount(track);
|
|
15
|
+
if (track.items.length > 0 && !track.narrativeId?.trim()) throw new Error("A Timeline with Takes requires their Narrative identity.");
|
|
16
|
+
if (track.items.length === 0 && track.narrativeId !== undefined) throw new Error("An empty Timeline has no Narrative identity.");
|
|
17
|
+
const segmentIds = new Set<string>();
|
|
18
|
+
const tokenIds = new Set<string>();
|
|
19
|
+
const anchorIds = new Set<string>();
|
|
20
|
+
const frameRate = track.frameRate;
|
|
21
|
+
for (const item of track.items) {
|
|
22
|
+
assertSemanticTakeIdentity(item.take);
|
|
23
|
+
if (!Number.isSafeInteger(item.startFrame) || item.startFrame < 0
|
|
24
|
+
|| item.startFrame + item.take.media.timeline.frameCount > frameCount) {
|
|
25
|
+
throw new Error(`Timeline placement for ${item.take.segment.segmentId} is outside its Program range.`);
|
|
26
|
+
}
|
|
27
|
+
if (item.take.narrativeId !== track.narrativeId) {
|
|
28
|
+
throw new Error(`Timeline ${track.id} mixes Narrative ${item.take.narrativeId} into ${track.narrativeId}.`);
|
|
29
|
+
}
|
|
30
|
+
const rate = item.take.media.timeline.frameRate;
|
|
31
|
+
if (frameRate.numerator !== rate.numerator || frameRate.denominator !== rate.denominator) {
|
|
32
|
+
throw new Error("Timeline items must use one frame rate.");
|
|
33
|
+
}
|
|
34
|
+
const segmentId = item.take.segment.segmentId;
|
|
35
|
+
if (segmentIds.has(segmentId)) throw new Error(`Timeline repeats Segment ${segmentId}.`);
|
|
36
|
+
segmentIds.add(segmentId);
|
|
37
|
+
for (const token of item.take.tokens) {
|
|
38
|
+
if (tokenIds.has(token.tokenId)) throw new Error(`Timeline repeats Token ${token.tokenId}.`);
|
|
39
|
+
tokenIds.add(token.tokenId);
|
|
40
|
+
}
|
|
41
|
+
for (const anchor of item.take.anchors) {
|
|
42
|
+
if (anchor.identity === "program:start" || anchor.identity === "program:end") {
|
|
43
|
+
throw new Error(`SemanticTake cannot declare reserved Program Anchor ${anchor.identity}.`);
|
|
44
|
+
}
|
|
45
|
+
if (anchorIds.has(anchor.identity)) throw new Error(`Timeline repeats Anchor ${anchor.identity}.`);
|
|
46
|
+
anchorIds.add(anchor.identity);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function timelineSpans(track: Timeline): readonly TimelineSpan[] {
|
|
52
|
+
assertTimelineIdentity(track);
|
|
53
|
+
return track.items.map(item => ({ item, startFrame: item.startFrame,
|
|
54
|
+
endFrameExclusive: item.startFrame + item.take.media.timeline.frameCount }));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function timelineFrameCount(track: Timeline): number {
|
|
58
|
+
assertTimelineIdentity(track);
|
|
59
|
+
return programSpaceFrameCount(track);
|
|
60
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { timelineComponent } from "./component.js";
|
|
2
|
+
export { assertTimelineIdentity, sealTimeline, timelineFrameCount, timelineSpans } from "./identity.js";
|
|
3
|
+
export { assertNarrativeMomentIdentity, assertNarrativeSelectionIdentity, momentFrame, segmentFrameSpan, selectionFrameSpan, semanticAnchorFrames, tokenFrameSpan } from "./location.js";
|
|
4
|
+
export { timelineDependency, timelineManifest, timelineModuleRef, timelineProducers, timelineSchema, timelineTypes } from "./manifest.js";
|
|
5
|
+
export { projectTimelineAudio, projectTimelineSpace, projectTimelineMedia } from "./projection.js";
|
|
6
|
+
export type * from "./types.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { NarrativeExcerpt, NarrativeMomentRef, NarrativeSelectionRef } from "@hypit/narrative";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import type { LocatedFrameSpan,
|
|
3
|
+
import { assertTimelineIdentity, timelineFrameCount, timelineSpans } from "./identity.js";
|
|
4
|
+
import type { LocatedFrameSpan, Timeline } from "./types.js";
|
|
5
5
|
|
|
6
6
|
export function assertNarrativeSelectionIdentity(selection: NarrativeSelectionRef): void {
|
|
7
7
|
if (!selection.narrativeId || !selection.id || !selection.startAnchorId || !selection.endAnchorId) throw new Error("NarrativeSelection is invalid");
|
|
@@ -11,33 +11,33 @@ export function assertNarrativeMomentIdentity(moment: NarrativeMomentRef): void
|
|
|
11
11
|
if (!moment.narrativeId || !moment.id || !moment.anchorId) throw new Error("NarrativeMoment is invalid");
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
function assertNarrativeOwner(track:
|
|
14
|
+
function assertNarrativeOwner(track: Timeline, narrativeId: string, label: string): void {
|
|
15
15
|
if (narrativeId !== track.narrativeId) {
|
|
16
|
-
throw new Error(`${label} belongs to Narrative ${narrativeId}, not
|
|
16
|
+
throw new Error(`${label} belongs to Narrative ${narrativeId}, not Timeline ${track.id}.`);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function semanticAnchorFrames(track:
|
|
21
|
-
|
|
20
|
+
export function semanticAnchorFrames(track: Timeline): ReadonlyMap<string, number> {
|
|
21
|
+
assertTimelineIdentity(track);
|
|
22
22
|
return new Map([
|
|
23
23
|
["program:start", 0] as const,
|
|
24
|
-
...
|
|
24
|
+
...timelineSpans(track).flatMap(({ item, startFrame }) =>
|
|
25
25
|
item.take.anchors.map((anchor) => [anchor.identity, startFrame + anchor.frame] as const)),
|
|
26
|
-
["program:end",
|
|
26
|
+
["program:end", timelineFrameCount(track)] as const,
|
|
27
27
|
]);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function frameFor(frames: ReadonlyMap<string, number>, anchorId: string, owner: string): number {
|
|
31
31
|
const frame = frames.get(anchorId);
|
|
32
|
-
if (frame === undefined) throw new Error(`${owner} names Anchor ${anchorId}, which this
|
|
32
|
+
if (frame === undefined) throw new Error(`${owner} names Anchor ${anchorId}, which this Timeline does not contain.`);
|
|
33
33
|
return frame;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export function selectionFrameSpan(
|
|
37
|
-
track:
|
|
37
|
+
track: Timeline,
|
|
38
38
|
selection: NarrativeSelectionRef,
|
|
39
39
|
): LocatedFrameSpan {
|
|
40
|
-
|
|
40
|
+
assertTimelineIdentity(track);
|
|
41
41
|
assertNarrativeSelectionIdentity(selection);
|
|
42
42
|
assertNarrativeOwner(track, selection.narrativeId, `NarrativeSelection ${selection.id}`);
|
|
43
43
|
const frames = semanticAnchorFrames(track);
|
|
@@ -47,19 +47,19 @@ export function selectionFrameSpan(
|
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
export function segmentFrameSpan(track:
|
|
51
|
-
|
|
50
|
+
export function segmentFrameSpan(track: Timeline, segment: NarrativeExcerpt): LocatedFrameSpan {
|
|
51
|
+
assertTimelineIdentity(track);
|
|
52
52
|
if (segment.kind !== "segment" || !segment.id) throw new Error("Narrative Segment excerpt is invalid");
|
|
53
53
|
assertNarrativeOwner(track, segment.narrativeId, `Narrative Segment ${segment.id}`);
|
|
54
|
-
const found =
|
|
55
|
-
if (found === undefined) throw new Error(`
|
|
54
|
+
const found = timelineSpans(track).find(({ item }) => item.take.segment.segmentId === segment.id);
|
|
55
|
+
if (found === undefined) throw new Error(`Timeline does not contain Segment ${segment.id}.`);
|
|
56
56
|
return { startFrame: found.startFrame, endFrameExclusive: found.endFrameExclusive };
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export function tokenFrameSpan(track:
|
|
60
|
-
|
|
59
|
+
export function tokenFrameSpan(track: Timeline, tokenIds: readonly string[]): LocatedFrameSpan | undefined {
|
|
60
|
+
assertTimelineIdentity(track);
|
|
61
61
|
if (tokenIds.length === 0) return undefined;
|
|
62
|
-
const timing = new Map(
|
|
62
|
+
const timing = new Map(timelineSpans(track).flatMap(({ item, startFrame }) =>
|
|
63
63
|
item.take.tokens.map((token) => [token.tokenId, {
|
|
64
64
|
startFrame: startFrame + token.startFrame,
|
|
65
65
|
endFrameExclusive: startFrame + token.endFrameExclusive,
|
|
@@ -72,8 +72,8 @@ export function tokenFrameSpan(track: SemanticTrack, tokenIds: readonly string[]
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
export function momentFrame(track:
|
|
76
|
-
|
|
75
|
+
export function momentFrame(track: Timeline, moment: NarrativeMomentRef): number {
|
|
76
|
+
assertTimelineIdentity(track);
|
|
77
77
|
assertNarrativeMomentIdentity(moment);
|
|
78
78
|
assertNarrativeOwner(track, moment.narrativeId, `NarrativeMoment ${moment.id}`);
|
|
79
79
|
const frames = semanticAnchorFrames(track);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { compositionDependency, compositionTypes } from "@hypit/composition";
|
|
2
|
+
import { narrativeDependency } from "@hypit/narrative";
|
|
3
|
+
import { programSpaceDependency, programSpaceSchema, programSpaceTypes } from "@hypit/program-space";
|
|
4
|
+
import type { ModuleManifest, ProducerRef, TypeRef, ValueSchema } from "@hypit/protocol";
|
|
5
|
+
import { semanticTakeSchema, speechDependency } from "@hypit/speech";
|
|
6
|
+
|
|
7
|
+
export const timelineModuleRef = { name: "@hypit/timeline", version: "1" } as const;
|
|
8
|
+
export const timelineTypes = {
|
|
9
|
+
track: { module: timelineModuleRef, name: "Timeline" },
|
|
10
|
+
} satisfies Record<string, TypeRef>;
|
|
11
|
+
export const timelineProducers = {
|
|
12
|
+
projectProgramSpace: { module: timelineModuleRef, name: "project-program-space" },
|
|
13
|
+
projectAudio: { module: timelineModuleRef, name: "project-audio-track" },
|
|
14
|
+
} satisfies Record<string, ProducerRef>;
|
|
15
|
+
|
|
16
|
+
const string = { kind: "string", minLength: 1 } as const;
|
|
17
|
+
const object = (fields: Readonly<Record<string, { readonly schema: ValueSchema; readonly optional?: boolean }>>): ValueSchema => ({ kind: "object", fields });
|
|
18
|
+
export const timelineSchema: ValueSchema = object({
|
|
19
|
+
...(programSpaceSchema.kind === "object" ? programSpaceSchema.fields : {}),
|
|
20
|
+
narrativeId: { schema: string, optional: true },
|
|
21
|
+
items: { schema: { kind: "array", items: object({
|
|
22
|
+
startFrame: { schema: { kind: "number", integer: true, minimum: 0 } },
|
|
23
|
+
take: { schema: semanticTakeSchema },
|
|
24
|
+
}) } },
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const timelineManifest: ModuleManifest = {
|
|
28
|
+
format: "hypit.module@1",
|
|
29
|
+
name: timelineModuleRef.name,
|
|
30
|
+
version: timelineModuleRef.version,
|
|
31
|
+
dependencies: [speechDependency, narrativeDependency, programSpaceDependency, compositionDependency],
|
|
32
|
+
types: [{ name: timelineTypes.track.name }],
|
|
33
|
+
capabilities: [],
|
|
34
|
+
producers: [
|
|
35
|
+
{ name: timelineProducers.projectProgramSpace.name, inputs: [{ name: "track", type: timelineTypes.track }], outputs: [{ name: "space", type: programSpaceTypes.programSpace }], needs: [] },
|
|
36
|
+
{ name: timelineProducers.projectAudio.name, inputs: [{ name: "track", type: timelineTypes.track }], outputs: [{ name: "audio", type: compositionTypes.audioTrack }], needs: [] },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
export const timelineDependency = { module: timelineModuleRef } as const;
|
|
@@ -7,18 +7,18 @@ import {
|
|
|
7
7
|
} from "@hypit/program-space";
|
|
8
8
|
import type { ProgramSpace } from "@hypit/program-space";
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import type {
|
|
10
|
+
import { assertTimelineIdentity, timelineFrameCount, timelineSpans } from "./identity.js";
|
|
11
|
+
import type { Timeline } from "./types.js";
|
|
12
12
|
|
|
13
13
|
/** Prepared material in an authored program interval, with its original source position retained. */
|
|
14
|
-
export function
|
|
15
|
-
startFrame: 0, endFrameExclusive:
|
|
14
|
+
export function projectTimelineMedia(track: Timeline, window = {
|
|
15
|
+
startFrame: 0, endFrameExclusive: timelineFrameCount(track),
|
|
16
16
|
}) {
|
|
17
|
-
|
|
17
|
+
assertTimelineIdentity(track);
|
|
18
18
|
if (!Number.isSafeInteger(window.startFrame) || !Number.isSafeInteger(window.endFrameExclusive)
|
|
19
19
|
|| window.startFrame < 0 || window.endFrameExclusive <= window.startFrame
|
|
20
|
-
|| window.endFrameExclusive >
|
|
21
|
-
return
|
|
20
|
+
|| window.endFrameExclusive > timelineFrameCount(track)) throw new Error("Semantic media window is outside the performance.");
|
|
21
|
+
return timelineSpans(track).flatMap(({ item, startFrame, endFrameExclusive }) => {
|
|
22
22
|
const start = Math.max(window.startFrame, startFrame);
|
|
23
23
|
const end = Math.min(window.endFrameExclusive, endFrameExclusive);
|
|
24
24
|
return end <= start ? [] : [{
|
|
@@ -30,19 +30,19 @@ export function projectSemanticMedia(track: SemanticTrack, window = {
|
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export function
|
|
34
|
-
|
|
35
|
-
const frameRate = track.
|
|
33
|
+
export function projectTimelineSpace(track: Timeline): ProgramSpace {
|
|
34
|
+
assertTimelineIdentity(track);
|
|
35
|
+
const frameRate = track.frameRate;
|
|
36
36
|
return sealProgramSpace({
|
|
37
37
|
id: track.id,
|
|
38
|
-
durationSec:
|
|
38
|
+
durationSec: track.durationSec,
|
|
39
39
|
frameRate,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
export function
|
|
44
|
-
const space =
|
|
45
|
-
const clips =
|
|
43
|
+
export function projectTimelineAudio(track: Timeline): AudioTrack {
|
|
44
|
+
const space = projectTimelineSpace(track);
|
|
45
|
+
const clips = timelineSpans(track).flatMap(({ item, startFrame, endFrameExclusive }) => {
|
|
46
46
|
const audio = item.take.media.audio;
|
|
47
47
|
if (audio === undefined) return [];
|
|
48
48
|
const sourceSampleFrames = synchronizedMediaSampleFrames(item.take.media);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ProgramSpace } from "@hypit/program-space";
|
|
2
|
+
import type { SemanticTake } from "@hypit/speech";
|
|
3
|
+
|
|
4
|
+
export type TimelineItem = {
|
|
5
|
+
readonly take: SemanticTake;
|
|
6
|
+
readonly startFrame: number;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/** One complete film time range, with prepared material placed where it belongs. */
|
|
10
|
+
export type Timeline = ProgramSpace & {
|
|
11
|
+
readonly narrativeId?: string;
|
|
12
|
+
readonly items: readonly TimelineItem[];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type TimelineSpan = {
|
|
16
|
+
readonly item: TimelineItem;
|
|
17
|
+
readonly startFrame: number;
|
|
18
|
+
readonly endFrameExclusive: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type LocatedFrameSpan = {
|
|
22
|
+
readonly startFrame: number;
|
|
23
|
+
readonly endFrameExclusive: number;
|
|
24
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# `@hypit/timeline-author`
|
|
2
|
+
|
|
3
|
+
Declare one complete Timeline and place prepared Takes within it. Spoken work, mixed spoken/MG
|
|
4
|
+
work and pure authored animation use the same declaration. The separate
|
|
5
|
+
[Timeline value package](../timeline/README.md) owns the data and projections; this author package
|
|
6
|
+
owns the markup and deterministic assembly.
|
|
7
|
+
|
|
8
|
+
```svml
|
|
9
|
+
<import as="time" from="@hypit/timeline-author@1"/>
|
|
10
|
+
<time:Clock id="clock" frame-rate="30"/>
|
|
11
|
+
<time:Timeline id="program" clock={clock} end="content.end+2s">
|
|
12
|
+
<time:Take source={opening.take} at="2s"/>
|
|
13
|
+
<time:Take source={explanation.take} at="previous.end+3s"/>
|
|
14
|
+
<time:Take source={closing.take} at="previous.end-12f"/>
|
|
15
|
+
</time:Timeline>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
The first Take begins at two seconds. The second starts three seconds after the preceding Take ends.
|
|
19
|
+
The third overlaps its predecessor by twelve frames. The complete Timeline ends two seconds after
|
|
20
|
+
all Takes have ended. Durations come from prepared material, so authoring these relations does not
|
|
21
|
+
require knowing generated lengths beforehand or serializing generation.
|
|
22
|
+
|
|
23
|
+
| Declaration | Meaning |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `clock={clock}` | Required frame-rate input, also usable by upstream normalization. |
|
|
26
|
+
| Take `source={clip.take}` | Complete normalized, semantically prepared local Take. A wordless Take is valid real media. |
|
|
27
|
+
| First omitted `at` | `0f`. |
|
|
28
|
+
| Later omitted `at` | `previous.end`. |
|
|
29
|
+
| `at="20s"` | Absolute start. |
|
|
30
|
+
| `at="previous.end+2s"` | Start relative to the preceding Take declaration's end. Negative offsets permit overlap. |
|
|
31
|
+
| Omitted `end` | `content.end`, the maximum end across all placed Takes. |
|
|
32
|
+
| `end="content.end+2s"` | Reserve a trailing interval after all Takes finish. |
|
|
33
|
+
| `end="30s"` | Fixed complete extent, including every placed Take. |
|
|
34
|
+
|
|
35
|
+
Positions and offsets accept seconds, milliseconds and frames, and must resolve to exact frame
|
|
36
|
+
boundaries on the Clock. Negative placements, a missing predecessor, or a fixed end shorter than
|
|
37
|
+
placed content produce an error. A positive predecessor offset does not promise globally empty
|
|
38
|
+
time if another long Take remains active. Placement is translation at native speed; trimming or
|
|
39
|
+
retiming material belongs before its semantic preparation.
|
|
40
|
+
|
|
41
|
+
For ordinary sequential assembly, omit all Take `at` attributes and Timeline `end`. For wholly
|
|
42
|
+
authored animation, supply the extent and no Takes:
|
|
43
|
+
|
|
44
|
+
```svml
|
|
45
|
+
<time:Timeline id="animation" clock={clock} end="30s"/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This produces no blank video or fabricated Script. Empty content cannot supply an implicit positive
|
|
49
|
+
extent. Program boundaries remain available for MG, media, titles and sound.
|
|
50
|
+
|
|
51
|
+
| Output | Use |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `.timeline` | Complete time range and placed material/evidence, consumed through `timeline={program.timeline}`. |
|
|
54
|
+
|
|
55
|
+
[Performance](../performance/README.md) presents footage already
|
|
56
|
+
held by the Timeline. It can show it full-frame, in an inset or as a cutout; project components can
|
|
57
|
+
own coordinated video and graphics. Sampling a new presentation Window preserves each Take's source
|
|
58
|
+
position. Overlap supplies multiple sources, not an automatic dissolve. Independent Media Items
|
|
59
|
+
still receive their own assets and may coexist. Caption reads the authored words and placed timing.
|
|
60
|
+
|
|
61
|
+
[Sound](../sound/README.md) presents existing Timeline audio through ordered Uses.
|
|
62
|
+
[Audio Track](../audio-track/README.md) handles independent music and effects. Include the wanted
|
|
63
|
+
presentation outputs explicitly in Film. Timeline itself exports only `.timeline`; holding material
|
|
64
|
+
does not add a picture or sound contribution.
|
|
65
|
+
|
|
66
|
+
Timeline placement is authored with `at` and `end`. Studio shows placed Takes and the complete range
|
|
67
|
+
as reference information. Use-window and Script-marker controls edit presentation timing and semantic
|
|
68
|
+
anchors respectively; they do not move Takes or change the Timeline extent.
|