@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
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { canonicalize, defineEndpointPackage, wakeAfter } from "@hypit/hypit/endpoint-kit";
|
|
2
|
+
import type { AsyncEndpoint, CredentialRef, EndpointRequest } from "@hypit/hypit/endpoint-kit";
|
|
3
|
+
import { compileWireRequest, generationTypes, sealGeneratedImageSet } from "@hypit/hypit/generation";
|
|
4
|
+
import type { GenerationRequest, GenerationWireMapping } from "@hypit/hypit/generation";
|
|
5
|
+
|
|
6
|
+
export const providerModule = { name: "@example/provider-images", version: "1" } as const;
|
|
7
|
+
export const capability = { module: { name: "@hypit/gpt-image", version: "1" }, name: "gpt-image-2" } as const;
|
|
8
|
+
|
|
9
|
+
// This example service implements only this subset of the model. Its API is described in README.
|
|
10
|
+
const mapping: GenerationWireMapping = {
|
|
11
|
+
capability, result: "image", routes: [{ model: "gpt-image-2" }],
|
|
12
|
+
fields: {
|
|
13
|
+
prompt: { as: "value", field: "prompt" },
|
|
14
|
+
aspectRatio: { as: "value", field: "ratio" },
|
|
15
|
+
resolution: { as: "value", field: "size" },
|
|
16
|
+
images: { as: "urlArray", field: "references" },
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
function object(value: unknown): Record<string, unknown> {
|
|
21
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new Error("Expected service object");
|
|
22
|
+
return value as Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
function text(value: unknown): string {
|
|
25
|
+
if (typeof value !== "string" || value.length === 0) throw new Error("Expected nonempty service text");
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
function address(value: string): string {
|
|
29
|
+
const url = new URL(value);
|
|
30
|
+
if (url.protocol !== "https:" && !(url.protocol === "http:" && ["localhost", "127.0.0.1"].includes(url.hostname))) {
|
|
31
|
+
throw new Error("Service URLs require HTTPS or loopback HTTP");
|
|
32
|
+
}
|
|
33
|
+
return url.href;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function support(request: EndpointRequest) {
|
|
37
|
+
const ports = (request.constraints as unknown as GenerationRequest).ports;
|
|
38
|
+
const unsupported = ports.resolution?.[0] !== "1K"
|
|
39
|
+
|| !["1:1", "9:16", "16:9"].includes(String(ports.aspectRatio?.[0]))
|
|
40
|
+
|| Object.keys(ports).some((port) => !(port in mapping.fields))
|
|
41
|
+
|| request.pendingInputs?.some((slot) => !(slot.input in mapping.fields));
|
|
42
|
+
return unsupported
|
|
43
|
+
? { status: "unsupported" as const, reason: "This service offers 1K at 1:1, 9:16 or 16:9, without background control" }
|
|
44
|
+
: { status: "supported" as const };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function createImageProvider(options: {
|
|
48
|
+
instance: string; pool: string; baseUrl: string; apiKey: CredentialRef;
|
|
49
|
+
concurrency?: number; pollIntervalMs?: number; fetch?: typeof globalThis.fetch;
|
|
50
|
+
}) {
|
|
51
|
+
const base = address(options.baseUrl).replace(/\/$/u, "");
|
|
52
|
+
const fetcher = options.fetch ?? globalThis.fetch;
|
|
53
|
+
const interval = options.pollIntervalMs ?? 2_000;
|
|
54
|
+
const key = (credentials: Readonly<Record<string, { secret: string }>>) => text(credentials.apiKey?.secret);
|
|
55
|
+
async function json(path: string, secret: string, init: RequestInit = {}) {
|
|
56
|
+
const response = await fetcher(`${base}${path}`, {
|
|
57
|
+
...init, headers: { ...init.headers, authorization: `Bearer ${secret}` },
|
|
58
|
+
signal: AbortSignal.timeout(30_000),
|
|
59
|
+
});
|
|
60
|
+
if (!response.ok) throw new Error(`Image service ${path} returned HTTP ${response.status}`);
|
|
61
|
+
return object(await response.json());
|
|
62
|
+
}
|
|
63
|
+
const endpoint: AsyncEndpoint = {
|
|
64
|
+
async start(context) {
|
|
65
|
+
const supported = support(context.need);
|
|
66
|
+
if (supported.status === "unsupported") throw new Error(supported.reason);
|
|
67
|
+
const secret = key(context.credentials);
|
|
68
|
+
const request = await compileWireRequest(mapping, context.need.constraints as unknown as GenerationRequest,
|
|
69
|
+
async (artifact) => {
|
|
70
|
+
const bytes = await context.resources.get(artifact.resource);
|
|
71
|
+
if (bytes === undefined) throw new Error("Reference image is unavailable");
|
|
72
|
+
const upload = await json("/uploads", secret, {
|
|
73
|
+
method: "POST", headers: { "content-type": artifact.mediaType }, body: new Blob([new Uint8Array(bytes)]),
|
|
74
|
+
});
|
|
75
|
+
return address(text(upload.url));
|
|
76
|
+
});
|
|
77
|
+
const task = await json("/tasks", secret, {
|
|
78
|
+
method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify(request),
|
|
79
|
+
});
|
|
80
|
+
const id = text(task.id), handle = { id }, receipt = { id };
|
|
81
|
+
await context.checkpoint?.({ handle, receipt });
|
|
82
|
+
return { ...wakeAfter(handle, interval), receipt };
|
|
83
|
+
},
|
|
84
|
+
async poll(context) {
|
|
85
|
+
const id = text(object(context.handle).id);
|
|
86
|
+
const task = await json(`/tasks/${encodeURIComponent(id)}`, key(context.credentials));
|
|
87
|
+
if (task.state === "queued" || task.state === "running") {
|
|
88
|
+
return wakeAfter({ id }, interval, Date.now(), { phase: task.state });
|
|
89
|
+
}
|
|
90
|
+
if (task.state === "failed") return {
|
|
91
|
+
status: "failed", failure: { code: "IMAGE_SERVICE_FAILED", message: "Image service task failed" },
|
|
92
|
+
};
|
|
93
|
+
if (task.state !== "succeeded") throw new Error("Image service returned an unknown task state");
|
|
94
|
+
return { status: "ready", handle: { id, url: address(text(task.url)) } };
|
|
95
|
+
},
|
|
96
|
+
async collect(context) {
|
|
97
|
+
// The service returns a signed asset URL; account credentials go only to its API.
|
|
98
|
+
const url = address(text(object(context.handle).url));
|
|
99
|
+
const response = await fetcher(url, { signal: AbortSignal.timeout(60_000) });
|
|
100
|
+
if (!response.ok) throw new Error(`Image download returned HTTP ${response.status}`);
|
|
101
|
+
const mediaType = response.headers.get("content-type")?.split(";")[0]?.trim();
|
|
102
|
+
if (!mediaType?.startsWith("image/")) throw new Error("Image service returned a non-image result");
|
|
103
|
+
const artifact = await context.resources.put(new Uint8Array(await response.arrayBuffer()), mediaType);
|
|
104
|
+
return { status: "completed", result: { value: {
|
|
105
|
+
kind: "inline", value: canonicalize(sealGeneratedImageSet({ images: [artifact] })),
|
|
106
|
+
} } };
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
return defineEndpointPackage({
|
|
110
|
+
module: providerModule, facet: "images", instance: options.instance, pool: options.pool,
|
|
111
|
+
credentials: { apiKey: options.apiKey }, credentialInputs: { apiKey: { label: "Image service API key" } },
|
|
112
|
+
defaultConcurrency: options.concurrency ?? 1,
|
|
113
|
+
actionLimits: { submit: { concurrency: 1 }, poll: { concurrency: 4 }, collect: { concurrency: 1 } },
|
|
114
|
+
pricing: { kind: "page", url: `${base}/pricing` },
|
|
115
|
+
async readPricing(context) {
|
|
116
|
+
const source = `${base}/rates?model=gpt-image-2`;
|
|
117
|
+
const rates = await json("/rates?model=gpt-image-2", key(await context.credentials()));
|
|
118
|
+
return [{ source, data: canonicalize(rates), summary: text(rates.description) }];
|
|
119
|
+
},
|
|
120
|
+
capabilities: [{ capability, returns: generationTypes.imageSet, lifecycle: "asynchronous", supports: support, endpoint }],
|
|
121
|
+
});
|
|
122
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023", "module": "NodeNext", "moduleResolution": "NodeNext",
|
|
4
|
+
"lib": ["ES2023", "DOM"], "strict": true, "noUncheckedIndexedAccess": true,
|
|
5
|
+
"exactOptionalPropertyTypes": true, "verbatimModuleSyntax": true,
|
|
6
|
+
"declaration": true, "rootDir": "src", "outDir": "dist", "skipLibCheck": true
|
|
7
|
+
},
|
|
8
|
+
"include": ["src/**/*.ts"]
|
|
9
|
+
}
|
|
@@ -33,3 +33,9 @@ there is no hosted generation account in this example. The final Output is `fina
|
|
|
33
33
|
Run can be opened in Studio, where its component lane and physical clock work without a Script lane.
|
|
34
34
|
For an independent project, install `@hypit/hypit`, copy the component into `packages/`, replace its workspace
|
|
35
35
|
dependency with the installed Hypit version, and build the package normally.
|
|
36
|
+
|
|
37
|
+
## Sound presentation Styles
|
|
38
|
+
|
|
39
|
+
`packages/sound-styles` defines a project crossfade with explicit outgoing and incoming Segments.
|
|
40
|
+
It uses Sound Uses over the same Timeline and preserves original source playback through the blend.
|
|
41
|
+
Its README explains authoring and the public fragment interface.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?svml using="@hypit/markup@1"?>
|
|
2
2
|
<svml>
|
|
3
|
-
<import as="time" from="@hypit/
|
|
3
|
+
<import as="time" from="@hypit/timeline-author@1"/>
|
|
4
4
|
<import as="spatial" from="@hypit/spatial@1"/>
|
|
5
5
|
<import as="fonts" from="@hypit/fonts-open@1"/>
|
|
6
6
|
<import as="chat" from="@example/chat-scene@1"/>
|
|
@@ -8,18 +8,19 @@
|
|
|
8
8
|
<import as="render" from="@hypit/render-hyperframes@1"/>
|
|
9
9
|
<import as="style" source="./chat.svs"/>
|
|
10
10
|
|
|
11
|
-
<time:
|
|
11
|
+
<time:Clock id="animation-clock" frame-rate="30"/>
|
|
12
|
+
<time:Timeline id="animation" clock={animation-clock} end="8s"/>
|
|
12
13
|
<spatial:Canvas id="canvas" width="540" height="960"/>
|
|
13
14
|
<fonts:Stack id="font" family="inter" weight="600" style="normal"/>
|
|
14
|
-
<chat:Scene id="conversation"
|
|
15
|
+
<chat:Scene id="conversation" timeline={animation.timeline} canvas={canvas} font={font}
|
|
15
16
|
during="program" title="Launch crew">
|
|
16
17
|
<chat:Message id="question" sender="Maya" side="left" at="0.5s" text="Are we ready to launch?"/>
|
|
17
18
|
<chat:Message id="reply" sender="Leo" side="right" at="2s" text="The video is ready."/>
|
|
18
19
|
<chat:Message id="turn" sender="Maya" side="left" at="3.5s" text="Great. One tiny change..."/>
|
|
19
20
|
<chat:Message id="reveal" sender="Leo" side="right" at="5.2s" text="I left the whole scene editable."/>
|
|
20
21
|
</chat:Scene>
|
|
21
|
-
<film:Film id="main" canvas={canvas}
|
|
22
|
+
<film:Film id="main" canvas={canvas} timeline={animation.timeline} appearance={style.film.main}>
|
|
22
23
|
<film:Track source={conversation.track}/>
|
|
23
24
|
</film:Film>
|
|
24
|
-
<render:Video id="final" composition={main.composition}
|
|
25
|
+
<render:Video id="final" composition={main.composition} timeline={animation.timeline}/>
|
|
25
26
|
</svml>
|
|
@@ -6,20 +6,20 @@ Content lives in Source. Every Message has its own `at`; there is no fixed messa
|
|
|
6
6
|
For speech-led work, bind the message to the words that introduce it:
|
|
7
7
|
|
|
8
8
|
```svml
|
|
9
|
-
<chat:Scene id="conversation"
|
|
9
|
+
<chat:Scene id="conversation" timeline={speech.timeline} canvas={canvas} font={font}
|
|
10
10
|
during={story.selection.demo} title="Conversation">
|
|
11
11
|
<chat:Message id="answer" sender="Maya" side="left" text="Here it is."
|
|
12
12
|
at={story.moment.answer}/>
|
|
13
13
|
</chat:Scene>
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The same component can receive `
|
|
16
|
+
The same component can receive a zero-Take `timeline={animation.timeline}` and `at="2s"` for authored animation. A Scene
|
|
17
17
|
has an outer Window; its message Instants trigger persistent state. `entrance-frames` controls arrival
|
|
18
18
|
and scrolling duration independently of those triggers (default 10). Messages stay visible or scroll
|
|
19
19
|
up as the conversation develops. Message times are on the film clock and must fall inside the Scene.
|
|
20
20
|
|
|
21
21
|
The Surface uses the shared temporal helpers and expands children to a finite create/append/render
|
|
22
|
-
graph. The rendering function receives
|
|
22
|
+
graph. The rendering function receives Timeline, Window and Instants, so it knows nothing about
|
|
23
23
|
Script parsing, speech models or Runtime. The browser program evaluates any requested frame directly,
|
|
24
24
|
including frames reached by scrubbing, range rendering or concurrent workers.
|
|
25
25
|
|
|
@@ -3,14 +3,13 @@ import type { ComponentPackage, FragmentOperation, ModuleManifest, StructuredSur
|
|
|
3
3
|
import { compositionTypes } from "@hypit/hypit/composition";
|
|
4
4
|
import { mediaTypes } from "@hypit/hypit/media";
|
|
5
5
|
import type { FontStackRef } from "@hypit/hypit/media";
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import { semanticTrackTypes } from "@hypit/hypit/semantic-track";
|
|
6
|
+
import type { Timeline } from "@hypit/hypit/timeline";
|
|
7
|
+
import { timelineTypes } from "@hypit/hypit/timeline";
|
|
9
8
|
import { spatialTypes } from "@hypit/hypit/spatial";
|
|
10
9
|
import type { CanvasSpace } from "@hypit/hypit/spatial";
|
|
11
10
|
import { assertTemporalInstantFor, temporalTypes } from "@hypit/hypit/temporal";
|
|
12
11
|
import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";
|
|
13
|
-
import { createTemporalInstantProjection,
|
|
12
|
+
import { createTemporalInstantProjection, createTemporalWindowProjection, resolveTemporalContext,
|
|
14
13
|
temporalContextAttributeVocabulary, temporalInstantAttributeNames, temporalInstantAttributeVocabulary,
|
|
15
14
|
temporalWindowAttributeNames, temporalWindowAttributeVocabulary } from "@hypit/hypit/temporal-markup";
|
|
16
15
|
import { renderChat } from "./render.js";
|
|
@@ -20,14 +19,13 @@ const module = { name: "@example/chat-scene", version: "1" } as const;
|
|
|
20
19
|
const types = Object.fromEntries(["Options", "Message", "Messages"].map(name => [name, { module, name }])) as Record<"Options" | "Message" | "Messages", TypeRef>;
|
|
21
20
|
const producers = Object.fromEntries(["empty", "append", "render"].map(name => [name, { module, name }])) as Record<"empty" | "append" | "render", { module: typeof module; name: string }>;
|
|
22
21
|
export const manifest: ModuleManifest = { format: "hypit.module@1", ...module,
|
|
23
|
-
dependencies: [compositionTypes.visualTrack, mediaTypes.fontStack,
|
|
24
|
-
semanticTrackTypes.track, spatialTypes.canvas, temporalTypes.instant].map(type => ({ module: type.module })),
|
|
22
|
+
dependencies: [compositionTypes.visualTrack, mediaTypes.fontStack, timelineTypes.track, spatialTypes.canvas, temporalTypes.instant].map(type => ({ module: type.module })),
|
|
25
23
|
types: Object.values(types).map(type => ({ name: type.name })), capabilities: [], producers: [
|
|
26
24
|
{ name: "empty", inputs: [], outputs: [{ name: "messages", type: types.Messages }], needs: [] },
|
|
27
25
|
{ name: "append", inputs: [{ name: "messages", type: types.Messages }, { name: "message", type: types.Message },
|
|
28
|
-
{ name: "at", type: temporalTypes.instant }, { name: "
|
|
26
|
+
{ name: "at", type: temporalTypes.instant }, { name: "timeline", type: timelineTypes.track }], outputs: [{ name: "messages", type: types.Messages }], needs: [] },
|
|
29
27
|
{ name: "render", inputs: [{ name: "messages", type: types.Messages }, { name: "options", type: types.Options },
|
|
30
|
-
{ name: "
|
|
28
|
+
{ name: "timeline", type: timelineTypes.track }, { name: "canvas", type: spatialTypes.canvas },
|
|
31
29
|
{ name: "window", type: temporalTypes.window }, { name: "font", type: mediaTypes.fontStack }], outputs: [{ name: "track", type: compositionTypes.visualTrack }], needs: [] },
|
|
32
30
|
],
|
|
33
31
|
};
|
|
@@ -41,20 +39,19 @@ const component: ComponentPackage = { producers: [
|
|
|
41
39
|
{ producer: producers.append, handler: ({ inputs }) => {
|
|
42
40
|
const message = inline<Omit<Message, "at">>(inputs.message), at = inline<TemporalInstant>(inputs.at);
|
|
43
41
|
const messages = inline<Message[]>(inputs.messages);
|
|
44
|
-
assertTemporalInstantFor(at, { subjectId: message.id, space: inline<
|
|
42
|
+
assertTemporalInstantFor(at, { subjectId: message.id, space: inline<Timeline>(inputs.timeline) });
|
|
45
43
|
if (messages.some(item => item.id === message.id) || (messages.at(-1)?.at.frame ?? -1) > at.frame) throw new Error("Chat messages need unique ids and chronological arrival times.");
|
|
46
44
|
return { outputs: { messages: value([...messages, { ...message, at }]) }, needs: {} };
|
|
47
45
|
} },
|
|
48
|
-
{ producer: producers.render, handler: ({ inputs }) => ({ outputs: { track: value(renderChat(inline<
|
|
46
|
+
{ producer: producers.render, handler: ({ inputs }) => ({ outputs: { track: value(renderChat(inline<Timeline>(inputs.timeline),
|
|
49
47
|
inline<CanvasSpace>(inputs.canvas), inline<TemporalWindow>(inputs.window), inline<FontStackRef>(inputs.font),
|
|
50
48
|
inline<Message[]>(inputs.messages), inline<ChatOptions>(inputs.options))) }, needs: {} }) },
|
|
51
49
|
] };
|
|
52
50
|
|
|
53
51
|
export const decodeSurface: StructuredSurfaceHandler = ({ element, resolveReference }) => {
|
|
54
|
-
assertAttributes(element, ["id", "
|
|
52
|
+
assertAttributes(element, ["id", "timeline", "canvas", "font", "title", "entrance-frames", ...temporalWindowAttributeNames]);
|
|
55
53
|
const id = textAttribute(element, "id"), context = resolveTemporalContext({ element, resolveReference });
|
|
56
|
-
const
|
|
57
|
-
const window = createTemporalWindowProjection({ id: `${id}.window`, subjectId: id, element, ...context, space: time.space, resolveReference });
|
|
54
|
+
const window = createTemporalWindowProjection({ id: `${id}.window`, subjectId: id, element, ...context, resolveReference });
|
|
58
55
|
const reference = (name: string, type: TypeRef): SurfaceResolvedReference => {
|
|
59
56
|
const raw = element.attributes[name];
|
|
60
57
|
if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${name} must be a reference.`);
|
|
@@ -64,10 +61,10 @@ export const decodeSurface: StructuredSurfaceHandler = ({ element, resolveRefere
|
|
|
64
61
|
};
|
|
65
62
|
const options: ChatOptions = { id, title: textAttribute(element, "title"), entranceFrames: Number(element.attributes["entrance-frames"] ?? "10") };
|
|
66
63
|
const records = [...window.records, { id: `${id}.options`, type: types.Options, value: value(options), range: element.range }];
|
|
67
|
-
const components = [...
|
|
68
|
-
const inputs = [{ name: "
|
|
64
|
+
const components = [...window.components], fragments = [...window.fragments];
|
|
65
|
+
const inputs = [{ name: "timeline", type: timelineTypes.track }, { name: "canvas", type: spatialTypes.canvas },
|
|
69
66
|
{ name: "font", type: mediaTypes.fontStack }, { name: "window", type: temporalTypes.window }, { name: "options", type: types.Options }];
|
|
70
|
-
const bindings: Record<string, SurfaceResolvedReference["ref"]> = {
|
|
67
|
+
const bindings: Record<string, SurfaceResolvedReference["ref"]> = { timeline: context.timeline.ref, canvas: reference("canvas", spatialTypes.canvas).ref,
|
|
71
68
|
font: reference("font", mediaTypes.fontStack).ref, window: window.ref, options: { kind: "record", id: `${id}.options` } };
|
|
72
69
|
const input = (name: string) => ({ kind: "fragment-input" as const, name });
|
|
73
70
|
const operation = (name: string) => ({ kind: "fragment-operation" as const, operation: name });
|
|
@@ -79,24 +76,24 @@ export const decodeSurface: StructuredSurfaceHandler = ({ element, resolveRefere
|
|
|
79
76
|
assertAttributes(child, ["id", "sender", "text", "side", ...temporalInstantAttributeNames]); assertEmptyElement(child);
|
|
80
77
|
const messageId = textAttribute(child, "id"), side = textAttribute(child, "side");
|
|
81
78
|
if (side !== "left" && side !== "right") throw new Error("Message side must be left or right.");
|
|
82
|
-
const at = createTemporalInstantProjection({ id: `${id}.${messageId}`, subjectId: messageId, element: child, ...context,
|
|
79
|
+
const at = createTemporalInstantProjection({ id: `${id}.${messageId}`, subjectId: messageId, element: child, ...context, resolveReference });
|
|
83
80
|
records.push(...at.records); components.push(...at.components); fragments.push(...at.fragments);
|
|
84
81
|
const key = `message-${++index}`;
|
|
85
82
|
records.push({ id: `${id}.${key}`, type: types.Message, value: value({ id: messageId, sender: textAttribute(child, "sender"), text: textAttribute(child, "text"), side }), range: child.range });
|
|
86
83
|
inputs.push({ name: key, type: types.Message }, { name: `${key}-at`, type: temporalTypes.instant });
|
|
87
84
|
bindings[key] = { kind: "record", id: `${id}.${key}` }; bindings[`${key}-at`] = at.ref;
|
|
88
|
-
operations.push({ id: key, producer: producers.append, inputs: { messages: operation(previous), message: input(key), at: input(`${key}-at`),
|
|
85
|
+
operations.push({ id: key, producer: producers.append, inputs: { messages: operation(previous), message: input(key), at: input(`${key}-at`), timeline: input("timeline") }, result: { kind: "output", name: "messages" } });
|
|
89
86
|
previous = key;
|
|
90
87
|
}
|
|
91
88
|
if (!index) throw new Error("Chat Scene requires a Message.");
|
|
92
89
|
operations.push({ id: "render", producer: producers.render, inputs: { messages: operation(previous), options: input("options"),
|
|
93
|
-
|
|
90
|
+
timeline: input("timeline"), canvas: input("canvas"), font: input("font"), window: input("window") }, result: { kind: "output", name: "track" } });
|
|
94
91
|
const fragment = sealGraphFragment({ inputs, operations, exports: [{ name: "track", type: compositionTypes.visualTrack, root: operation("render") }] });
|
|
95
92
|
return { records, fragments: [...fragments, fragment], components: [...components,
|
|
96
93
|
{ id, fragment: fragment.id, inputs: bindings, outputs: { track: `${id}.track` }, range: element.range }], exports: [`${id}.track`] };
|
|
97
94
|
};
|
|
98
95
|
const declaration = { name: "scene", tag: "Scene", mode: "structured" as const,
|
|
99
|
-
outputs: [compositionTypes.visualTrack,
|
|
96
|
+
outputs: [compositionTypes.visualTrack, timelineTypes.track, temporalTypes.window, temporalTypes.instant, temporalTypes.windowSpec, temporalTypes.instantSpec, ...Object.values(types)],
|
|
100
97
|
vocabulary: { summary: "A conversation whose message arrivals and scrolling form one visual scene.", attributes: [
|
|
101
98
|
...temporalContextAttributeVocabulary, ...temporalWindowAttributeVocabulary,
|
|
102
99
|
...["id", "title", "canvas", "font"].map(name => ({ name, kind: "expression" as const, required: true, summary: name })),
|
|
@@ -104,7 +101,7 @@ const declaration = { name: "scene", tag: "Scene", mode: "structured" as const,
|
|
|
104
101
|
], children: [{ tag: "Message", cardinality: "many" as const, summary: "One authored message and the event that reveals it.", attributes: [
|
|
105
102
|
...["id", "sender", "text", "side"].map(name => ({ name, kind: "literal" as const, required: true, summary: name })), ...temporalInstantAttributeVocabulary,
|
|
106
103
|
] }], ports: [{ name: "track", type: compositionTypes.visualTrack, summary: "The complete conversation scene." }],
|
|
107
|
-
example: '<chat:Scene id="chat"
|
|
104
|
+
example: '<chat:Scene id="chat" timeline={speech.timeline} canvas={canvas} font={font} during="program" title="Conversation"><chat:Message id="answer" sender="Maya" side="left" text="Here it is." at={story.moment.answer}/></chat:Scene>',
|
|
108
105
|
},
|
|
109
106
|
};
|
|
110
107
|
export const hypitPackage = { format: "hypit.node-package@1" as const, modules: [{ manifest }], components: [component],
|
|
@@ -2,7 +2,7 @@ import { sealVisualTrack } from "@hypit/hypit/composition";
|
|
|
2
2
|
import type { VisualElement } from "@hypit/hypit/composition";
|
|
3
3
|
import { browserProgram } from "@hypit/hypit/hyperframes";
|
|
4
4
|
import type { FontStackRef } from "@hypit/hypit/media";
|
|
5
|
-
import type {
|
|
5
|
+
import type { Timeline } from "@hypit/hypit/timeline";
|
|
6
6
|
import type { CanvasSpace } from "@hypit/hypit/spatial";
|
|
7
7
|
import { assertTemporalWindowFor } from "@hypit/hypit/temporal";
|
|
8
8
|
import type { TemporalInstant, TemporalWindow } from "@hypit/hypit/temporal";
|
|
@@ -11,9 +11,9 @@ export type Message = { id: string; sender: string; text: string; side: "left" |
|
|
|
11
11
|
export type ChatOptions = { id: string; title: string; entranceFrames: number };
|
|
12
12
|
|
|
13
13
|
/** Layout, arrival and scrolling share one visual component; timing is already resolved. */
|
|
14
|
-
export function renderChat(
|
|
14
|
+
export function renderChat(timeline: Timeline, canvas: CanvasSpace, window: TemporalWindow,
|
|
15
15
|
font: FontStackRef, messages: readonly Message[], options: ChatOptions) {
|
|
16
|
-
assertTemporalWindowFor(window, { subjectId: options.id, space });
|
|
16
|
+
assertTemporalWindowFor(window, { subjectId: options.id, space: timeline });
|
|
17
17
|
if (!Number.isSafeInteger(options.entranceFrames) || options.entranceFrames < 1) throw new Error("Chat entrance-frames must be a positive integer.");
|
|
18
18
|
if (messages.some(message => message.at.frame < window.span.startFrame || message.at.frame >= window.span.endFrameExclusive)) throw new Error("Chat messages must appear inside the scene's window.");
|
|
19
19
|
let order = 0;
|
|
@@ -56,7 +56,7 @@ export function renderChat(space: ProgramSpace, canvas: CanvasSpace, window: Tem
|
|
|
56
56
|
[...dots.children].forEach((dot,i)=>dot.style.transform='translateY('+(-3*(1+Math.sin(frame*.18-i)))+'px)');
|
|
57
57
|
};`,
|
|
58
58
|
});
|
|
59
|
-
return sealVisualTrack({ id: options.id, programSpaceId:
|
|
59
|
+
return sealVisualTrack({ id: options.id, programSpaceId: timeline.id, visualIr: "hypit.visual-ir@1",
|
|
60
60
|
presents: [{ id: options.id, span: window.span, stacking: { order: 0, tieBreak: options.id },
|
|
61
61
|
elements: [{ id: "chat", kind: "program", order: 0, program,
|
|
62
62
|
style: [{ name: "position", value: "absolute" }, { name: "inset", value: 0 },
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Project-authored Performance Styles
|
|
2
|
+
|
|
3
|
+
This package demonstrates two ordinary project families: a viewport moving between Frames and a
|
|
4
|
+
crossfade between explicitly selected Segments. Both export the common PerformanceStyle, so they
|
|
5
|
+
work alongside the ordinary fixed Style inside one Performance Track.
|
|
6
|
+
|
|
7
|
+
```svml
|
|
8
|
+
<import as="performance" from="@hypit/performance@1"/>
|
|
9
|
+
<import as="styles" from="@example/performance-styles@1"/>
|
|
10
|
+
<performance:Style id="full" frame={layout.full} appearance={recipes.media.presenter}/>
|
|
11
|
+
<performance:Style id="side" frame={layout.side} appearance={recipes.media.presenter}/>
|
|
12
|
+
<styles:Move id="full-to-side" from={layout.full} to={layout.side}/>
|
|
13
|
+
<styles:Crossfade id="mix" outgoing={story.segment.previous}
|
|
14
|
+
incoming={story.segment.next} frame={layout.side}/>
|
|
15
|
+
<performance:Track id="presenter" timeline={program.timeline} canvas={canvas}>
|
|
16
|
+
<performance:Use style={full}/>
|
|
17
|
+
<performance:Use moment={story.moment.explain}
|
|
18
|
+
start="moment.cue" end="program.end" style={side}/>
|
|
19
|
+
<performance:Use at={story.moment.explain} for="2s" style={full-to-side}/>
|
|
20
|
+
<performance:Use start-source={story.segment.next} start="segment.start"
|
|
21
|
+
end-source={story.segment.previous} end="segment.end" style={mix}/>
|
|
22
|
+
</performance:Track>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
The two-second movement overrides the beginning of the already declared side treatment. Changing
|
|
26
|
+
its duration requires no reference to a Use id. Shared endpoint Frames keep the fixed and moving
|
|
27
|
+
layouts aligned. All timing belongs to Uses; each Style is independently reusable.
|
|
28
|
+
|
|
29
|
+
Crossfade requires known outgoing/incoming Segment identities. A known audio-only source supplies
|
|
30
|
+
transparent picture, giving a fade in or out; an unknown reference reports the actual error. This
|
|
31
|
+
example uses isolated additive blending of weighted pictures. `projectTimelineMedia` preserves the
|
|
32
|
+
original source positions; animation progress comes from the original Use Window.
|
|
33
|
+
|
|
34
|
+
Read `activation.ts` for the complete author Surface, bound fragment and Producer wiring, and
|
|
35
|
+
`render.ts` for the browser program. A project can add its own parameters or additional events without
|
|
36
|
+
changing Performance. Compile with `npm run build`; install the package in the video project's
|
|
37
|
+
ordinary package dependencies. The rendering test exercises these same functions with actual video.
|
|
38
|
+
|
|
39
|
+
The package also includes `src/studio.ts`. Move exposes its `from` and `to` Frame coordinates;
|
|
40
|
+
Crossfade exposes its Frame and read-only source references. These parameter Companions match the
|
|
41
|
+
project's own Style Surfaces and are composed into any consuming Performance Use. The Track
|
|
42
|
+
Companion and Studio require no knowledge of these Style names.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@example/performance-styles",
|
|
3
|
+
"version": "0.0.0-dev",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"hypit": {
|
|
7
|
+
"activation": "./dist/activation.js"
|
|
8
|
+
},
|
|
9
|
+
"exports": {
|
|
10
|
+
".": "./dist/render.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc -p tsconfig.json",
|
|
18
|
+
"prepack": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@hypit/hypit": "workspace:*",
|
|
22
|
+
"typescript": "5.9.3",
|
|
23
|
+
"@types/node": "24.10.1"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { styleStudioFacet } from "./studio.js";
|
|
2
|
+
import { assertAttributes, assertEmptyElement, canonicalize, createMarkupSurfaceHostFacet, sameType, sealGraphFragment, textAttribute } from "@hypit/hypit/author-kit";
|
|
3
|
+
import type { ComponentPackage, ModuleManifest, StructuredSurfaceHandler, SurfaceResolvedReference } from "@hypit/hypit/author-kit";
|
|
4
|
+
import { compositionTypes } from "@hypit/hypit/composition";
|
|
5
|
+
import { performanceStyle, performanceTypes, performanceModuleRef } from "@hypit/hypit/performance";
|
|
6
|
+
import { timelineTypes } from "@hypit/hypit/timeline";
|
|
7
|
+
import type { Timeline } from "@hypit/hypit/timeline";
|
|
8
|
+
import { spatialTypes } from "@hypit/hypit/spatial";
|
|
9
|
+
import type { SpatialFrame } from "@hypit/hypit/spatial";
|
|
10
|
+
import { temporalTypes } from "@hypit/hypit/temporal";
|
|
11
|
+
import type { TemporalWindow } from "@hypit/hypit/temporal";
|
|
12
|
+
import { narrativeTypes } from "@hypit/hypit/narrative";
|
|
13
|
+
import type { NarrativeExcerpt } from "@hypit/hypit/narrative";
|
|
14
|
+
import { movingFrame, crossfade } from "./render.js";
|
|
15
|
+
|
|
16
|
+
const module = { name: "@example/performance-styles", version: "1" } as const;
|
|
17
|
+
const common = [{ name: "timeline", type: timelineTypes.track }, { name: "canvas", type: spatialTypes.canvas }, { name: "window", type: temporalTypes.window }];
|
|
18
|
+
const moveInputs = [...common, { name: "from", type: spatialTypes.frame }, { name: "to", type: spatialTypes.frame }];
|
|
19
|
+
const mixInputs = [...common, { name: "outgoing", type: narrativeTypes.excerpt }, { name: "incoming", type: narrativeTypes.excerpt }, { name: "frame", type: spatialTypes.frame }];
|
|
20
|
+
const families = [{ name: "move", tag: "Move", ports: moveInputs }, { name: "crossfade", tag: "Crossfade", ports: mixInputs }];
|
|
21
|
+
export const manifest: ModuleManifest = { format: "hypit.module@1", ...module,
|
|
22
|
+
dependencies: [performanceModuleRef, compositionTypes.visualTrack.module, timelineTypes.track.module, spatialTypes.canvas.module, temporalTypes.window.module, narrativeTypes.excerpt.module].map(module => ({ module })),
|
|
23
|
+
types: [], capabilities: [], producers: families.map(family => ({ name: family.name, inputs: family.ports, outputs: [{ name: "visual", type: compositionTypes.visualTrack }], needs: [] })) };
|
|
24
|
+
const fragments = families.map(family => sealGraphFragment({ inputs: family.ports,
|
|
25
|
+
operations: [{ id: "render", producer: { module, name: family.name }, inputs: Object.fromEntries(family.ports.map(port => [port.name, { kind: "fragment-input" as const, name: port.name }])), result: { kind: "output", name: "visual" } }],
|
|
26
|
+
exports: [{ name: "visual", type: compositionTypes.visualTrack, root: { kind: "fragment-operation", operation: "render" } }] }));
|
|
27
|
+
const component: ComponentPackage = { producers: families.map(family => ({ producer: { module, name: family.name }, handler: ({ inputs }) => {
|
|
28
|
+
const values = Object.fromEntries(Object.entries(inputs).map(([key, record]) => {
|
|
29
|
+
if (record.value.kind !== "inline") throw new Error(`${key} must be inline`);
|
|
30
|
+
return [key, record.value.value];
|
|
31
|
+
}));
|
|
32
|
+
const visual = family.name === "move" ? movingFrame(values.timeline as unknown as Timeline, values.window as unknown as TemporalWindow, values.from as unknown as SpatialFrame, values.to as unknown as SpatialFrame)
|
|
33
|
+
: crossfade(values.timeline as unknown as Timeline, values.window as unknown as TemporalWindow, values.outgoing as unknown as NarrativeExcerpt, values.incoming as unknown as NarrativeExcerpt, values.frame as unknown as SpatialFrame);
|
|
34
|
+
return { outputs: { visual: { kind: "inline", value: canonicalize(visual) } }, needs: {} };
|
|
35
|
+
} })) };
|
|
36
|
+
const hostFacets = families.map((family,index) => {
|
|
37
|
+
const params = family.ports.slice(common.length);
|
|
38
|
+
const handler: StructuredSurfaceHandler = ({ element, resolveReference }) => {
|
|
39
|
+
assertAttributes(element, ["id", ...params.map(port => port.name)]); assertEmptyElement(element);
|
|
40
|
+
const bindings: Record<string, SurfaceResolvedReference> = {};
|
|
41
|
+
for (const param of params) {
|
|
42
|
+
const raw = element.attributes[param.name];
|
|
43
|
+
if (typeof raw !== "object" || raw.kind !== "reference") throw new Error(`${param.name} must be a reference`);
|
|
44
|
+
const value = resolveReference(raw.path);
|
|
45
|
+
if (value === undefined || !sameType(value.type,param.type)) throw new Error(`${param.name} has the wrong Type`);
|
|
46
|
+
bindings[param.name] = value;
|
|
47
|
+
}
|
|
48
|
+
return { records: [{ id: textAttribute(element,"id"), type: performanceTypes.style,
|
|
49
|
+
value: { kind: "inline", value: canonicalize(performanceStyle(fragments[index]!,bindings)) }, range: element.range }], components: [], fragments: [] };
|
|
50
|
+
};
|
|
51
|
+
return createMarkupSurfaceHostFacet({ module, declaration: { name: family.name, tag: family.tag, mode: "structured", outputs: [performanceTypes.style], vocabulary: {
|
|
52
|
+
summary: `Project-owned ${family.name} presentation Style.`, example: `<styles:${family.tag} id="look" ${params.map(port => `${port.name}={${port.name}}`).join(' ')}/>`,
|
|
53
|
+
attributes: [{ name: "id", kind: "identifier", required: true, summary: "Style identity." }, ...params.map(port => ({ name: port.name, kind: "reference" as const, required: true, accepts: [port.type], summary: `Explicit ${port.name} input.` }))],
|
|
54
|
+
} }, handler });
|
|
55
|
+
});
|
|
56
|
+
export const hypitPackage = { format: "hypit.node-package@1" as const, modules: [{ manifest }], components: [component], hostFacets: [...hostFacets, styleStudioFacet(module)] };
|
|
57
|
+
export default hypitPackage;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { sealVisualTrack } from "@hypit/hypit/composition";
|
|
2
|
+
import type { VisualElement } from "@hypit/hypit/composition";
|
|
3
|
+
import { browserProgram } from "@hypit/hypit/hyperframes";
|
|
4
|
+
import { projectTimelineMedia } from "@hypit/hypit/timeline";
|
|
5
|
+
import type { Timeline } from "@hypit/hypit/timeline";
|
|
6
|
+
import type { TemporalWindow } from "@hypit/hypit/temporal";
|
|
7
|
+
import type { SpatialFrame } from "@hypit/hypit/spatial";
|
|
8
|
+
import type { NarrativeExcerpt } from "@hypit/hypit/narrative";
|
|
9
|
+
|
|
10
|
+
/** Project behavior, not a registered special effect: the original Use window owns progress. */
|
|
11
|
+
export function movingFrame(timeline: Timeline, window: TemporalWindow, from: SpatialFrame, to: SpatialFrame) {
|
|
12
|
+
return render(timeline, window, { from, to });
|
|
13
|
+
}
|
|
14
|
+
export function crossfade(timeline: Timeline, window: TemporalWindow, outgoing: NarrativeExcerpt, incoming: NarrativeExcerpt, frame: SpatialFrame) {
|
|
15
|
+
for (const ref of [outgoing, incoming]) {
|
|
16
|
+
if (ref.narrativeId !== timeline.narrativeId || !timeline.items.some(item => item.take.segment.segmentId === ref.id)) {
|
|
17
|
+
throw new Error(`Unknown crossfade source ${ref.id}.`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return render(timeline, window, { outgoing: outgoing.id, incoming: incoming.id, from: frame, to: frame });
|
|
21
|
+
}
|
|
22
|
+
function render(timeline: Timeline, window: TemporalWindow, options: { from: SpatialFrame; to: SpatialFrame; outgoing?: string; incoming?: string }) {
|
|
23
|
+
const id = window.subjectId;
|
|
24
|
+
const clips = projectTimelineMedia(timeline, window.span).filter(clip => clip.media.visual !== undefined
|
|
25
|
+
&& (options.outgoing === undefined || clip.segmentId === options.outgoing || clip.segmentId === options.incoming));
|
|
26
|
+
const videos: VisualElement[] = clips.map((clip, index) => ({
|
|
27
|
+
id: `source-${index}`, parent: "scene", order: index + 1, kind: "video", muted: true,
|
|
28
|
+
artifact: clip.media.visual!.artifact,
|
|
29
|
+
attributes: [{ name: "data-source-role", value: options.incoming === clip.segmentId ? "incoming" : "outgoing" }],
|
|
30
|
+
style: [{ name: "position", value: "absolute" }, { name: "inset", value: 0 }, { name: "width", value: "100%" }, { name: "height", value: "100%" }, { name: "object-fit", value: "cover" }],
|
|
31
|
+
sampling: { sourceFrameRate: clip.media.timeline.frameRate, sourceFrameCount: clip.media.timeline.frameCount, segments: [{
|
|
32
|
+
target: { startFrame: clip.span.startFrame - window.span.startFrame, endFrameExclusive: clip.span.endFrameExclusive - window.span.startFrame },
|
|
33
|
+
sourceFrame: { numerator: clip.source.startFrame, denominator: 1 }, rate: { numerator: 1, denominator: 1 },
|
|
34
|
+
}] },
|
|
35
|
+
}));
|
|
36
|
+
const program = browserProgram({
|
|
37
|
+
html: `<div class="viewport">${videos.map((video,index) => `<div class="source" data-role="${clips[index]!.segmentId === options.incoming ? "incoming" : "outgoing"}">{{${video.id}}}</div>`).join("")}</div>`,
|
|
38
|
+
css: `.viewport{position:absolute;overflow:hidden;isolation:isolate}.source{position:absolute;inset:0;${options.outgoing === undefined ? '' : 'mix-blend-mode:plus-lighter'}}`,
|
|
39
|
+
data: { from: options.from, to: options.to, mixing: options.outgoing !== undefined, duration: window.span.endFrameExclusive - window.span.startFrame },
|
|
40
|
+
setup: `const view=root.querySelector('.viewport'), sources=view.querySelectorAll('.source');
|
|
41
|
+
return frame => {
|
|
42
|
+
const p=Math.max(0,Math.min(1,frame/Math.max(1,data.duration-1)));
|
|
43
|
+
const q=p*p*(3-2*p), a=data.from, b=data.to;
|
|
44
|
+
Object.assign(view.style,{left:(a.xPx+(b.xPx-a.xPx)*q)+'px',top:(a.yPx+(b.yPx-a.yPx)*q)+'px',
|
|
45
|
+
width:(a.widthPx+(b.widthPx-a.widthPx)*q)+'px',height:(a.heightPx+(b.heightPx-a.heightPx)*q)+'px'});
|
|
46
|
+
if(data.mixing) for(const child of sources) {
|
|
47
|
+
const role=child.dataset.role;
|
|
48
|
+
child.style.opacity=String(role==='incoming'?p:1-p);
|
|
49
|
+
}
|
|
50
|
+
};`,
|
|
51
|
+
});
|
|
52
|
+
return sealVisualTrack({ id, programSpaceId: timeline.id, visualIr: "hypit.visual-ir@1", presents: videos.length ? [{ id, span: window.span,
|
|
53
|
+
stacking: { order: 0, tieBreak: id }, elements: [{ id: "scene", kind: "program", order: 0, style: [{ name: "position", value: "absolute" }, { name: "inset", value: 0 }], program }, ...videos] }] : [] });
|
|
54
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createStudioCompanionHostFacet } from "@hypit/hypit/studio-adapter";
|
|
2
|
+
import type { StudioParameterCompanion } from "@hypit/hypit/studio-adapter";
|
|
3
|
+
|
|
4
|
+
/** The project Style owns its inputs; Performance only owns its Use interval. */
|
|
5
|
+
export function styleStudioFacet(module: { readonly name: string; readonly version: string }) {
|
|
6
|
+
const coordinates = ["left", "top", "right", "bottom", "x", "y", "width", "height"];
|
|
7
|
+
const definitions = [
|
|
8
|
+
{ surface: "move", frames: ["from", "to"], sources: [] },
|
|
9
|
+
{ surface: "crossfade", frames: ["frame"], sources: ["outgoing", "incoming"] },
|
|
10
|
+
];
|
|
11
|
+
const parameters: StudioParameterCompanion[] = definitions.map(({ surface, frames, sources }) => ({
|
|
12
|
+
id: surface, match: { module, surface },
|
|
13
|
+
bindings: [
|
|
14
|
+
...frames.map(name => ({ name, referenced: coordinates.map(name => ({ name, writable: true })) })),
|
|
15
|
+
...sources.map(name => ({ name })),
|
|
16
|
+
],
|
|
17
|
+
inspector: [
|
|
18
|
+
...frames.flatMap(frame => coordinates.map(name => ({
|
|
19
|
+
binding: `${frame}.${name}`, label: name, domain: "where" as const,
|
|
20
|
+
page: { id: frame, label: frame }, section: { id: "frame", label: "Frame" },
|
|
21
|
+
control: "number" as const, number: { suffixes: ["%", "px"], step: 1 },
|
|
22
|
+
}))),
|
|
23
|
+
...sources.map(name => ({ binding: name, label: name, domain: "how" as const,
|
|
24
|
+
section: { id: "sources", label: "Sources" }, control: "text" as const })),
|
|
25
|
+
],
|
|
26
|
+
}));
|
|
27
|
+
return createStudioCompanionHostFacet({ parameters });
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2023",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2023"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noUncheckedIndexedAccess": true,
|
|
9
|
+
"exactOptionalPropertyTypes": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"sourceMap": true,
|
|
13
|
+
"rootDir": "src",
|
|
14
|
+
"outDir": "dist",
|
|
15
|
+
"skipLibCheck": true
|
|
16
|
+
},
|
|
17
|
+
"include": ["src/**/*.ts"]
|
|
18
|
+
}
|