@hypit/hypit 0.1.4 → 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 +4 -2
- 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 +77 -15
- 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 +32 -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 +28 -17
- 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 +11 -0
- package/packages/build-result/src/decode.ts +2 -0
- package/packages/build-result/src/execution-log.ts +17 -0
- package/packages/build-result/src/index.ts +1 -0
- package/packages/build-result/src/store.ts +14 -1
- package/packages/build-result/src/types.ts +3 -0
- package/packages/build-result-s3/src/repository.ts +4 -0
- 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 +14 -9
- 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 +26 -17
- package/packages/caption-fine/src/recipe.ts +7 -0
- package/packages/caption-fine/src/render.ts +14 -13
- 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 +3 -1
- package/packages/caption-fine-studio/src/activation.ts +3 -3
- package/packages/caption-fine-studio/src/index.ts +54 -42
- package/packages/cli/README.md +57 -4
- package/packages/cli/package.json +1 -0
- package/packages/cli/src/arguments.ts +25 -6
- package/packages/cli/src/build-planning.ts +3 -2
- package/packages/cli/src/command.ts +6 -0
- package/packages/cli/src/commands/environment.ts +28 -18
- 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 +3 -2
- package/packages/cli/src/main.ts +34 -42
- package/packages/cli/src/observation.ts +7 -1
- package/packages/cli/src/output.ts +65 -23
- 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/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/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/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 +16 -11
- 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/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 +22 -26
- package/packages/ranking/src/schedule.ts +16 -19
- package/packages/ranking/src/surface.ts +12 -13
- package/packages/ranking-studio/README.md +18 -0
- package/packages/ranking-studio/src/index.ts +61 -9
- 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/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 +24 -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 +92 -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 +2 -1
- package/packages/runtime-local/src/result-writer.ts +2 -0
- package/packages/runtime-local/src/runtime.ts +8 -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 +15 -2
- package/packages/script/src/manifest.ts +2 -2
- package/packages/script/src/narrative.ts +1 -0
- package/packages/script/src/surface.ts +4 -3
- package/packages/script/src/types.ts +1 -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 +7 -1
- 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/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 +15 -2
- package/packages/studio/README.md +88 -14
- package/packages/studio/package.json +8 -7
- 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/parameter-values.ts +43 -1
- package/packages/studio/src/parameters.ts +114 -24
- 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 +10 -6
- package/packages/studio/src/shared.ts +4 -2
- package/packages/studio/src/snapshot.ts +21 -132
- package/packages/studio/src/studio-preflight.ts +3 -3
- package/packages/studio/src/studio-registry.ts +50 -6
- package/packages/studio/src/style.css +209 -48
- package/packages/studio/src/ui/comments.ts +233 -0
- package/packages/studio/src/ui/icons.ts +5 -0
- package/packages/studio/src/ui/main.ts +145 -86
- package/packages/studio/src/ui/overlay.ts +12 -8
- package/packages/studio/src/ui/scrub-preview.ts +108 -0
- package/packages/studio/src/ui/stage.ts +67 -4
- package/packages/studio/src/ui/timeline.ts +177 -108
- package/packages/studio/start.ts +4 -2
- package/packages/studio-adapter/README.md +130 -11
- package/packages/studio-adapter/src/index.ts +100 -13
- 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 +2 -2
- package/packages/temporal-markup/README.md +27 -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/video-cli/README.md +4 -1
- package/packages/video-cli/package.json +2 -1
- package/packages/video-cli/src/creation.ts +14 -4
- 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 +1 -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
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
"private": true,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
|
-
".": "./src/index.ts"
|
|
8
|
+
".": "./src/index.ts",
|
|
9
|
+
"./module-scope": "./src/module-scope.ts"
|
|
9
10
|
},
|
|
10
11
|
"dependencies": {
|
|
11
12
|
"@hypit/component-kit": "workspace:*",
|
|
12
13
|
"@hypit/host": "workspace:*",
|
|
13
|
-
"@hypit/protocol": "workspace:*"
|
|
14
|
+
"@hypit/protocol": "workspace:*",
|
|
15
|
+
"cjs-module-lexer": "2.2.1",
|
|
16
|
+
"typescript": "5.9.3"
|
|
14
17
|
}
|
|
15
18
|
}
|
|
@@ -5,6 +5,7 @@ import { pathToFileURL } from "node:url";
|
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
distributionPackageDirectory,
|
|
8
|
+
declaredExternalPackageRoot,
|
|
8
9
|
setActiveDistributionPackageRoots,
|
|
9
10
|
setActiveExternalPackageRoots,
|
|
10
11
|
} from "./location.js";
|
|
@@ -100,7 +101,7 @@ export function installDistributionPackageResolution(roots: readonly string[]):
|
|
|
100
101
|
}
|
|
101
102
|
for (const root of installed) {
|
|
102
103
|
const entry = resolveDistributionPackageImport(root, specifier);
|
|
103
|
-
if (entry !== undefined) return
|
|
104
|
+
if (entry !== undefined) return nextResolve(pathToFileURL(entry).href, context);
|
|
104
105
|
}
|
|
105
106
|
throw new Error(`Active Hypit Distribution does not provide ${specifier}`);
|
|
106
107
|
}
|
|
@@ -123,7 +124,6 @@ export function installExternalPackageResolution(roots: readonly string[]): void
|
|
|
123
124
|
}
|
|
124
125
|
externalInstalled = next;
|
|
125
126
|
setActiveExternalPackageRoots(externalInstalled);
|
|
126
|
-
const parentUrls = externalInstalled.map((root) => pathToFileURL(join(root, "__hypit_external__.mjs")).href);
|
|
127
127
|
registerHooks({
|
|
128
128
|
resolve(specifier, context, nextResolve) {
|
|
129
129
|
if (specifier.startsWith("@hypit/") || !barePackageSpecifier(specifier)) {
|
|
@@ -132,8 +132,15 @@ export function installExternalPackageResolution(roots: readonly string[]): void
|
|
|
132
132
|
try {
|
|
133
133
|
return nextResolve(specifier, context);
|
|
134
134
|
} catch (original) {
|
|
135
|
-
|
|
135
|
+
if (context.parentURL === undefined || !context.parentURL.startsWith("file:")) throw original;
|
|
136
|
+
if (installed.length > 0 && !installed.some((root) =>
|
|
137
|
+
context.parentURL!.startsWith(pathToFileURL(`${root}/`).href))) throw original;
|
|
138
|
+
for (const root of externalInstalled) {
|
|
136
139
|
try {
|
|
140
|
+
const name = packageAddress(specifier)?.name;
|
|
141
|
+
const selected = name === undefined ? undefined : declaredExternalPackageRoot(root, context.parentURL, name);
|
|
142
|
+
if (selected === undefined) continue;
|
|
143
|
+
const parentURL = pathToFileURL(join(selected, "__hypit_external__.mjs")).href;
|
|
137
144
|
return nextResolve(specifier, { ...context, parentURL });
|
|
138
145
|
} catch {
|
|
139
146
|
// Try the next machine package root before preserving Node's error.
|
|
@@ -97,10 +97,12 @@ function activationPath(item: ResolvedPackage): string {
|
|
|
97
97
|
return target;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
async function importContribution(item: ResolvedPackage): Promise<NodePackageContribution> {
|
|
100
|
+
async function importContribution(item: ResolvedPackage, options: NodePackageLoadOptions): Promise<NodePackageContribution> {
|
|
101
101
|
const target = activationPath(item);
|
|
102
102
|
assert((await stat(target)).isFile(), `${item.json.name} activation is not a file`);
|
|
103
|
-
const
|
|
103
|
+
const url = pathToFileURL(target).href;
|
|
104
|
+
const imported = await (options.importModule !== undefined && !item.json.name.startsWith("@hypit/")
|
|
105
|
+
? options.importModule(url) : import(url)) as { readonly default?: unknown };
|
|
104
106
|
assert(imported.default !== null && typeof imported.default === "object", `${item.json.name} activation has no default package export`);
|
|
105
107
|
const contribution = imported.default as Partial<NodePackageContribution>;
|
|
106
108
|
assert(contribution.format === "hypit.node-package@1", `${item.json.name} activation has an unsupported package format`);
|
|
@@ -185,7 +187,7 @@ export async function distributionExternalPackageRequirements(
|
|
|
185
187
|
const root = resolve(distributionRoot);
|
|
186
188
|
const queue = [...new Set(specifiers.filter((name) => name.startsWith("@hypit/")))].sort();
|
|
187
189
|
const visited = new Set<string>();
|
|
188
|
-
const external = new Map<string, string>();
|
|
190
|
+
const external = new Map<string, { readonly name: string; readonly version: string; readonly specifier: string }>();
|
|
189
191
|
while (queue.length > 0) {
|
|
190
192
|
const name = queue.shift()!;
|
|
191
193
|
if (visited.has(name)) continue;
|
|
@@ -196,16 +198,11 @@ export async function distributionExternalPackageRequirements(
|
|
|
196
198
|
queue.push(dependency);
|
|
197
199
|
continue;
|
|
198
200
|
}
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
throw new Error(`${dependency} is required at both ${previous} and ${version} by the selected Distribution packages`);
|
|
202
|
-
}
|
|
203
|
-
external.set(dependency, version);
|
|
201
|
+
const specifier = `${dependency}@${version}`;
|
|
202
|
+
external.set(specifier, { name: dependency, version, specifier });
|
|
204
203
|
}
|
|
205
204
|
}
|
|
206
|
-
return [...external.
|
|
207
|
-
.sort(([left], [right]) => left.localeCompare(right))
|
|
208
|
-
.map(([name, version]) => ({ name, version, specifier: `${name}@${version}` }));
|
|
205
|
+
return [...external.values()].sort((left, right) => left.specifier.localeCompare(right.specifier));
|
|
209
206
|
}
|
|
210
207
|
|
|
211
208
|
/**
|
|
@@ -256,8 +253,8 @@ export async function loadNodePackageSelection(
|
|
|
256
253
|
for (const item of await Promise.all(roots.map(async (physical) => ({
|
|
257
254
|
physical,
|
|
258
255
|
contribution: await (async () => {
|
|
259
|
-
await assertExternalDependencies(physical, distributionRoots, externalRoots);
|
|
260
|
-
return await importContribution(physical);
|
|
256
|
+
if (!options.deferExternalDependencies) await assertExternalDependencies(physical, distributionRoots, externalRoots);
|
|
257
|
+
return await importContribution(physical, options);
|
|
261
258
|
})(),
|
|
262
259
|
})))) add(item);
|
|
263
260
|
|
|
@@ -270,8 +267,8 @@ export async function loadNodePackageSelection(
|
|
|
270
267
|
providerPackage,
|
|
271
268
|
resolutionRoots(providerPackage, [requirement.from, root], distributionRoots),
|
|
272
269
|
);
|
|
273
|
-
await assertExternalDependencies(physical, distributionRoots, externalRoots);
|
|
274
|
-
const provider = { physical, contribution: await importContribution(physical) };
|
|
270
|
+
if (!options.deferExternalDependencies) await assertExternalDependencies(physical, distributionRoots, externalRoots);
|
|
271
|
+
const provider = { physical, contribution: await importContribution(physical, options) };
|
|
275
272
|
add(provider);
|
|
276
273
|
assert(providedModules.has(requirement.key), `${providerPackage} does not provide the required ${requirement.key}`);
|
|
277
274
|
}
|
|
@@ -66,6 +66,31 @@ function packageName(value: string): string {
|
|
|
66
66
|
return value;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
/** One ordinary npm installation per exact upstream release; no shared mutable node_modules. */
|
|
70
|
+
export function externalPackageInstallRoot(root: string, name: string, version: string): string {
|
|
71
|
+
packageName(name);
|
|
72
|
+
if (!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/u.test(version)) {
|
|
73
|
+
throw new Error(`${name}@${version} must select an exact upstream version`);
|
|
74
|
+
}
|
|
75
|
+
return join(resolve(root), ...name.split("/"), version);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/** The importing package's own manifest owns its upstream version selection. */
|
|
79
|
+
export function declaredExternalPackageRoot(root: string, from: string | URL, name: string): string | undefined {
|
|
80
|
+
let cursor = dirname(fromPath(from));
|
|
81
|
+
while (true) {
|
|
82
|
+
const manifest = join(cursor, "package.json");
|
|
83
|
+
if (existsSync(manifest)) {
|
|
84
|
+
const value = JSON.parse(readFileSync(manifest, "utf8")) as { dependencies?: Record<string, string> };
|
|
85
|
+
const version = value.dependencies?.[name];
|
|
86
|
+
return version === undefined ? undefined : externalPackageInstallRoot(root, name, version);
|
|
87
|
+
}
|
|
88
|
+
const parent = dirname(cursor);
|
|
89
|
+
if (parent === cursor) return undefined;
|
|
90
|
+
cursor = parent;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
69
94
|
function packageSourceAddress(value: string): { readonly name: string; readonly subpath: string } {
|
|
70
95
|
if (value.startsWith(".") || value.startsWith("/") || value.startsWith("#") || value.includes(":")) {
|
|
71
96
|
throw new Error(`${value} must be one npm package Source export`);
|
|
@@ -187,7 +212,8 @@ export function locateNodePackage(nameValue: string, options: LocateNodePackageO
|
|
|
187
212
|
?? distributionRoots.some((root) => within(root, dirname(from)));
|
|
188
213
|
if (allowExternal) {
|
|
189
214
|
for (const root of externalRoots) {
|
|
190
|
-
const
|
|
215
|
+
const installation = declaredExternalPackageRoot(root, from, name);
|
|
216
|
+
const found = installation === undefined ? undefined : nodeModulesPackage(installation, name);
|
|
191
217
|
if (found !== undefined) return found;
|
|
192
218
|
}
|
|
193
219
|
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import Module, { createRequire, findPackageJSON, isBuiltin, registerHooks } from "node:module";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, extname, isAbsolute, join, sep } from "node:path";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
+
import { compileFunction } from "node:vm";
|
|
7
|
+
import { initSync, parse as parseCommonJs } from "cjs-module-lexer";
|
|
8
|
+
import { transpileModule, ModuleKind, ScriptTarget, JsxEmit } from "typescript";
|
|
9
|
+
|
|
10
|
+
/** A module identity namespace, not a filesystem directory. No files are written here. */
|
|
11
|
+
const prefix = pathToFileURL(join(tmpdir(), ".hypit-module-scopes", String(process.pid)) + sep).href;
|
|
12
|
+
const bridge = "hypit-internal:module-scope";
|
|
13
|
+
const requestPrefix = "hypit-module-request:";
|
|
14
|
+
const scopes = new Map<string, NodeModuleScope>();
|
|
15
|
+
let serial = 0;
|
|
16
|
+
let installed = false;
|
|
17
|
+
|
|
18
|
+
function address(value: string | undefined): { scope: string; url: string } | undefined {
|
|
19
|
+
if (value === undefined) return undefined;
|
|
20
|
+
const url = isAbsolute(value) ? pathToFileURL(value).href : value;
|
|
21
|
+
if (!url.startsWith(prefix)) return undefined;
|
|
22
|
+
const [scope, encoded] = url.slice(prefix.length).split("/");
|
|
23
|
+
if (!scope || !encoded) return undefined;
|
|
24
|
+
return { scope, url: Buffer.from(encoded.slice(0, -4), "base64url").toString("utf8") };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function moduleUrl(scope: string, url: string): string {
|
|
28
|
+
return `${prefix}${scope}/${Buffer.from(url).toString("base64url")}.mjs`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function commonJsSource(filename: string): string {
|
|
32
|
+
const source = readFileSync(filename, "utf8").replace(/^#!/u, "//");
|
|
33
|
+
return /\.[cm]?tsx?$|\.jsx$/u.test(filename) ? transpileModule(source, {
|
|
34
|
+
fileName: filename,
|
|
35
|
+
compilerOptions: { module: ModuleKind.CommonJS, target: ScriptTarget.ES2023, jsx: JsxEmit.ReactJSX, esModuleInterop: true },
|
|
36
|
+
}).outputText : source;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function esmSource(filename: string): string {
|
|
40
|
+
const source = readFileSync(filename, "utf8").replace(/^#!/u, "//");
|
|
41
|
+
return /\.[cm]?tsx?$|\.jsx$/u.test(filename)
|
|
42
|
+
? transpileModule(source, {
|
|
43
|
+
fileName: filename,
|
|
44
|
+
compilerOptions: { module: ModuleKind.ESNext, target: ScriptTarget.ES2023, jsx: JsxEmit.ReactJSX, esModuleInterop: true },
|
|
45
|
+
}).outputText : source;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function exportNames(filename: string, visited = new Set<string>()): readonly string[] {
|
|
49
|
+
// Node's CJS named-export discovery does not infer names from ESM or JSON reexports.
|
|
50
|
+
if (visited.has(filename) || isEsModule(filename) || extname(filename) === ".json") return [];
|
|
51
|
+
visited.add(filename);
|
|
52
|
+
const parsed = parseCommonJs(commonJsSource(filename));
|
|
53
|
+
const require = createRequire(filename);
|
|
54
|
+
return [...new Set([...parsed.exports, ...parsed.reexports.flatMap((specifier) => {
|
|
55
|
+
const target = require.resolve(specifier);
|
|
56
|
+
return isBuiltin(target) || target.endsWith(".node") ? Object.keys(require(specifier) as object) : exportNames(target, visited);
|
|
57
|
+
})])].filter((name) => name !== "default" && name !== "module.exports");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isEsModule(filename: string): boolean {
|
|
61
|
+
const extension = extname(filename);
|
|
62
|
+
if (extension === ".mjs" || extension === ".mts") return true;
|
|
63
|
+
if (extension === ".cjs" || extension === ".cts") return false;
|
|
64
|
+
const manifest = findPackageJSON(pathToFileURL(filename));
|
|
65
|
+
return manifest !== undefined && (JSON.parse(readFileSync(manifest, "utf8")) as { type?: string }).type === "module";
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function scopeFor(id: string): NodeModuleScope {
|
|
69
|
+
const scope = scopes.get(id);
|
|
70
|
+
if (scope === undefined) throw new Error(`Module scope ${id} has ended`);
|
|
71
|
+
return scope;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Internal bridge used by Node's ESM/CommonJS interop. */
|
|
75
|
+
export function scopedCommonJs(id: string, filename: string): unknown { return scopeFor(id).commonJs(filename); }
|
|
76
|
+
|
|
77
|
+
function install(): void {
|
|
78
|
+
if (installed) return;
|
|
79
|
+
initSync();
|
|
80
|
+
installed = true;
|
|
81
|
+
registerHooks({
|
|
82
|
+
resolve(specifier, context, nextResolve) {
|
|
83
|
+
if (specifier === bridge) return { url: import.meta.url, shortCircuit: true };
|
|
84
|
+
if (specifier.startsWith(requestPrefix)) {
|
|
85
|
+
const [scope, request, parentURL] = JSON.parse(Buffer.from(specifier.slice(requestPrefix.length), "base64url").toString("utf8")) as [string, string, string];
|
|
86
|
+
scopeFor(scope);
|
|
87
|
+
const found = nextResolve(request, { ...context, parentURL });
|
|
88
|
+
return found.url.startsWith("file:") && !request.startsWith("@hypit/") ? { ...found, url: moduleUrl(scope, found.url) } : found;
|
|
89
|
+
}
|
|
90
|
+
const direct = address(specifier);
|
|
91
|
+
const parent = address(context.parentURL);
|
|
92
|
+
const scope = direct?.scope ?? parent?.scope;
|
|
93
|
+
const target = direct === undefined ? specifier
|
|
94
|
+
: new Set(context.conditions).has("require") ? fileURLToPath(direct.url) : direct.url;
|
|
95
|
+
const found = nextResolve(target, parent ? { ...context, parentURL: parent.url } : context);
|
|
96
|
+
// The installed Distribution is process code. Its package APIs remain shared; each
|
|
97
|
+
// invocation still creates the Build's own registries, adapters and configuration.
|
|
98
|
+
if (scope === undefined || !found.url.startsWith("file:") || specifier.startsWith("@hypit/")) return found;
|
|
99
|
+
scopeFor(scope);
|
|
100
|
+
return { ...found, url: moduleUrl(scope, found.url) };
|
|
101
|
+
},
|
|
102
|
+
load(url, context, nextLoad) {
|
|
103
|
+
const item = address(url);
|
|
104
|
+
if (item === undefined) return nextLoad(url, context);
|
|
105
|
+
scopeFor(item.scope);
|
|
106
|
+
const filename = fileURLToPath(item.url);
|
|
107
|
+
// The scope owns loading its JS/TS implementation closure. It must not rely
|
|
108
|
+
// on an outer TS hook recognizing the namespace's synthetic .mjs address.
|
|
109
|
+
if (!/\.[cm]?[jt]sx?$/u.test(filename)) return nextLoad(item.url, { ...context, format: undefined });
|
|
110
|
+
if (!isEsModule(filename)) {
|
|
111
|
+
const names = exportNames(filename);
|
|
112
|
+
return { format: "module", shortCircuit: true, source: [
|
|
113
|
+
`import {scopedCommonJs} from ${JSON.stringify(bridge)};`,
|
|
114
|
+
`const value=scopedCommonJs(${JSON.stringify(item.scope)},${JSON.stringify(filename)});`,
|
|
115
|
+
"export default value; export {value as 'module.exports'};",
|
|
116
|
+
...names.map((name, i) => `const e${i}=value[${JSON.stringify(name)}];export {e${i} as ${JSON.stringify(name)}};`),
|
|
117
|
+
].join("\n") };
|
|
118
|
+
}
|
|
119
|
+
const source = esmSource(filename);
|
|
120
|
+
// Author-visible filesystem addresses stay real, including import.meta.resolve().
|
|
121
|
+
// Keep metadata restoration local: requiring a synchronous project ESM module
|
|
122
|
+
// must not add an edge back into the asynchronously bootstrapped loader.
|
|
123
|
+
const prelude = `import.meta.url=${JSON.stringify(item.url)};import.meta.filename=${JSON.stringify(filename)};` +
|
|
124
|
+
`import.meta.dirname=${JSON.stringify(dirname(filename))};` +
|
|
125
|
+
`{const resolve=import.meta.resolve;import.meta.resolve=(id)=>{const url=resolve(id);` +
|
|
126
|
+
`if(!url.startsWith(${JSON.stringify(prefix)}))return url;` +
|
|
127
|
+
`return globalThis.Buffer.from(url.slice(${prefix.length}).split('/')[1].slice(0,-4),'base64url').toString('utf8');};}\n`;
|
|
128
|
+
return { format: "module", shortCircuit: true, source: prelude + source };
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Independent loaded bindings in a shared trusted Node process; not a security sandbox. */
|
|
134
|
+
export class NodeModuleScope {
|
|
135
|
+
readonly #id = String(++serial);
|
|
136
|
+
readonly #commonJs: Record<string, NodeJS.Module> = Object.create(null) as Record<string, NodeJS.Module>;
|
|
137
|
+
constructor() { install(); scopes.set(this.#id, this); }
|
|
138
|
+
|
|
139
|
+
async import(url: string): Promise<unknown> { return await import(moduleUrl(this.#id, url)); }
|
|
140
|
+
|
|
141
|
+
commonJs(filename: string, parent?: NodeJS.Module): unknown {
|
|
142
|
+
const cached = this.#commonJs[filename];
|
|
143
|
+
if (cached !== undefined) return cached.exports;
|
|
144
|
+
const nativeRequire = createRequire(filename);
|
|
145
|
+
const mod = new Module(filename, parent);
|
|
146
|
+
mod.filename = filename;
|
|
147
|
+
mod.path = dirname(filename);
|
|
148
|
+
mod.paths = nativeRequire.resolve.paths("module") ?? [];
|
|
149
|
+
const require = Object.assign((specifier: string): unknown => {
|
|
150
|
+
if (isBuiltin(specifier)) return nativeRequire(specifier);
|
|
151
|
+
const resolved = nativeRequire.resolve(specifier);
|
|
152
|
+
if (specifier.startsWith("@hypit/") || resolved.endsWith(".node")) return nativeRequire(specifier);
|
|
153
|
+
if (resolved.endsWith(".json")) {
|
|
154
|
+
if (this.#commonJs[resolved] === undefined) {
|
|
155
|
+
const json = new Module(resolved, mod);
|
|
156
|
+
json.exports = JSON.parse(readFileSync(resolved, "utf8")); json.loaded = true;
|
|
157
|
+
this.#commonJs[resolved] = json;
|
|
158
|
+
}
|
|
159
|
+
return this.#commonJs[resolved]!.exports;
|
|
160
|
+
}
|
|
161
|
+
if (isEsModule(resolved)) return nativeRequire(fileURLToPath(moduleUrl(this.#id, pathToFileURL(resolved).href)));
|
|
162
|
+
return this.commonJs(resolved, mod);
|
|
163
|
+
}, { resolve: nativeRequire.resolve, cache: this.#commonJs, extensions: nativeRequire.extensions, main: undefined }) as NodeRequire;
|
|
164
|
+
mod.require = require;
|
|
165
|
+
this.#commonJs[filename] = mod;
|
|
166
|
+
try {
|
|
167
|
+
compileFunction(commonJsSource(filename), ["exports", "require", "module", "__filename", "__dirname"], {
|
|
168
|
+
filename,
|
|
169
|
+
importModuleDynamically: async (specifier) => await import(requestPrefix + Buffer.from(JSON.stringify([
|
|
170
|
+
this.#id, specifier, pathToFileURL(filename).href,
|
|
171
|
+
])).toString("base64url")),
|
|
172
|
+
})
|
|
173
|
+
.call(mod.exports, mod.exports, require, mod, filename, dirname(filename));
|
|
174
|
+
mod.loaded = true;
|
|
175
|
+
return mod.exports;
|
|
176
|
+
} catch (error) { delete this.#commonJs[filename]; throw error; }
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
close(): void {
|
|
180
|
+
scopes.delete(this.#id);
|
|
181
|
+
for (const key of Object.keys(this.#commonJs)) delete this.#commonJs[key];
|
|
182
|
+
}
|
|
183
|
+
}
|
|
@@ -47,6 +47,8 @@ export type NodePackageSelectionRequest = {
|
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export type NodePackageLoadOptions = {
|
|
50
|
+
/** Host-owned module scope. Omitting this uses Node's ordinary process imports. */
|
|
51
|
+
readonly importModule?: (url: string) => Promise<unknown>;
|
|
50
52
|
/**
|
|
51
53
|
* Additional read-only Distribution roots. They are fallbacks for project-scoped packages;
|
|
52
54
|
* the reserved @hypit namespace resolves only from these roots when they are present.
|
|
@@ -57,4 +59,6 @@ export type NodePackageLoadOptions = {
|
|
|
57
59
|
* dependencies. Defaults to the roots installed by the Hypit launcher.
|
|
58
60
|
*/
|
|
59
61
|
readonly externalRoots?: readonly string[];
|
|
62
|
+
/** Runtime declarations can be read before their optional execution tools are prepared. */
|
|
63
|
+
readonly deferExternalDependencies?: boolean;
|
|
60
64
|
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Performance
|
|
2
|
+
|
|
3
|
+
Performance presents footage already placed on a Timeline. Media Items receive independent assets;
|
|
4
|
+
Performance Uses select how the existing footage appears. [Sound](../sound/README.md) presents existing audio. Include the wanted visual and audio outputs
|
|
5
|
+
separately in Film.
|
|
6
|
+
|
|
7
|
+
```svml
|
|
8
|
+
<import as="performance" from="@hypit/performance@1"/>
|
|
9
|
+
<performance:Style id="full" frame={layout.full} appearance={recipes.media.presenter}/>
|
|
10
|
+
<performance:Style id="side" frame={layout.side} appearance={recipes.media.presenter}/>
|
|
11
|
+
<performance:Track id="presenter" timeline={program.timeline} canvas={canvas}>
|
|
12
|
+
<performance:Use style={full}/>
|
|
13
|
+
<performance:Use during={story.selection.explanation} style={side}/>
|
|
14
|
+
</performance:Track>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Select `presenter.visual` in Film. A Style's appearance uses Media fitting, clipping, radius, padding,
|
|
18
|
+
border, shadows and sample appearance. `stack-order` places its Presents among Film contributions.
|
|
19
|
+
A Use with no time selector covers the complete Timeline. Later Uses replace earlier rules locally;
|
|
20
|
+
they do not add another copy of the picture. No matching Use means no picture. An empty winning
|
|
21
|
+
Style stays empty. Separate Performance Tracks can independently show the same material.
|
|
22
|
+
|
|
23
|
+
## Time, sources and visibility
|
|
24
|
+
|
|
25
|
+
Use accepts shared `during`, `at` + `for`, `until` + `for`, or `start` + `end`. A Window says when a
|
|
26
|
+
presentation applies. Timeline determines source positions: a Take placed at second 5 shows source
|
|
27
|
+
second 2 at program second 7. Styles receive the original Use Window even when partially covered.
|
|
28
|
+
Visibility does not restart playback or animation. The ordinary Style presents available videos in
|
|
29
|
+
Timeline declaration order, later above earlier; no Takes, audio-only Takes and source gaps supply
|
|
30
|
+
no picture. The Timeline can extend past all material without filling that time with a clip.
|
|
31
|
+
|
|
32
|
+
Two independently bound endpoints can describe a physical overlap that is backwards in Script order:
|
|
33
|
+
|
|
34
|
+
```svml
|
|
35
|
+
<performance:Use style={mix}
|
|
36
|
+
start-source={story.segment.next} start="segment.start"
|
|
37
|
+
end-source={story.segment.previous} end="segment.end"/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The concrete Style determines which sources are outgoing/incoming. Window endpoints do not select
|
|
41
|
+
those roles implicitly. There is no automatic crossfade when source spans overlap.
|
|
42
|
+
|
|
43
|
+
## Write a project Style
|
|
44
|
+
|
|
45
|
+
`performanceStyle(fragment, bindings)` creates an authored Style. The fragment takes `timeline`,
|
|
46
|
+
`canvas`, and `window`, plus any family-defined typed inputs, and exports `visual: VisualTrack`.
|
|
47
|
+
`bindings` binds those extra inputs to resolved author references. A Style Surface returns this as
|
|
48
|
+
an inline Record of `performanceTypes.style`. At each Use, the Track expands the fragment and turns
|
|
49
|
+
every binding into a normal graph edge, including references to generated outputs. No family
|
|
50
|
+
registry or effect-name dispatch is involved. The Style is an author-time definition, not a
|
|
51
|
+
runtime-produced choice of executable code.
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
const style = performanceStyle(fragment, {
|
|
55
|
+
from: resolveFrame("from"),
|
|
56
|
+
to: resolveFrame("to"),
|
|
57
|
+
});
|
|
58
|
+
// Each value is a SurfaceResolvedReference; all fragment inputs except the three
|
|
59
|
+
// occurrence inputs above must be bound. Your Surface owns its parameter names.
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A family may bind Segment references, Moments, prepared assets, Frames, Recipes or computed outputs.
|
|
63
|
+
Its Producers use the Timeline and shared projections to obtain exact source spans and event times.
|
|
64
|
+
`projectTimelineMedia` returns zero, one or several sources with their identities and native source
|
|
65
|
+
positions. Known sources without visual material differ from invalid references. Rendering can use
|
|
66
|
+
ordinary structural elements, Media helpers or a browser program with HTML, CSS and frame code.
|
|
67
|
+
`ordinaryPerformance` provides reusable fixed framing; a whole coordinated diagram/presenter scene
|
|
68
|
+
can instead be an independent component.
|
|
69
|
+
|
|
70
|
+
The [project Style example](../../examples/semantic-composition/packages/performance-styles/README.md)
|
|
71
|
+
implements movement and two-source blending through these public interfaces. It demonstrates an
|
|
72
|
+
extension path, not a required library of built-in transitions.
|
|
73
|
+
|
|
74
|
+
## Implementation boundary
|
|
75
|
+
|
|
76
|
+
`resolvePerformance` resolves last-declared Window coverage. It retains each Present's original
|
|
77
|
+
`span` and intersects its optional `visibility` subranges with the winning intervals. The renderer
|
|
78
|
+
uses `span` for animation and sampling and `visibility` only for display. Empty Uses still participate
|
|
79
|
+
in coverage. Nothing in this package changes audio, Script, Timeline placement or generation.
|
|
80
|
+
|
|
81
|
+
`Track.visual` is the resolved picture. `Track.program` retains the ordered Use windows and their
|
|
82
|
+
unresolved VisualTracks, including covered and empty applications. The
|
|
83
|
+
[Studio Companion](../performance-studio/README.md) uses this program to expose individual Uses.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@hypit/performance",
|
|
3
|
+
"version": "0.0.0-dev",
|
|
4
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
5
|
+
"private": true,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./src/index.ts"
|
|
9
|
+
},
|
|
10
|
+
"hypit": {
|
|
11
|
+
"activation": "./src/activation.ts"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@hypit/artifact": "workspace:*",
|
|
15
|
+
"@hypit/component-kit": "workspace:*",
|
|
16
|
+
"@hypit/composition": "workspace:*",
|
|
17
|
+
"@hypit/elaborator": "workspace:*",
|
|
18
|
+
"@hypit/media": "workspace:*",
|
|
19
|
+
"@hypit/narrative": "workspace:*",
|
|
20
|
+
"@hypit/program-space": "workspace:*",
|
|
21
|
+
"@hypit/protocol": "workspace:*",
|
|
22
|
+
"@hypit/timeline": "workspace:*",
|
|
23
|
+
"@hypit/spatial": "workspace:*",
|
|
24
|
+
"@hypit/svs": "workspace:*",
|
|
25
|
+
"@hypit/markup": "workspace:*",
|
|
26
|
+
"@hypit/temporal": "workspace:*",
|
|
27
|
+
"@hypit/temporal-markup": "workspace:*",
|
|
28
|
+
"@hypit/media-track": "workspace:*"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createMarkupSurfaceHostFacet } from "@hypit/markup";
|
|
2
|
+
import { performanceManifest, performanceModuleRef, performanceMarkupSurfaces } from "./manifest.js";
|
|
3
|
+
import { performanceComponent } from "./component.js";
|
|
4
|
+
import { decodePerformanceStyleSurface, decodePerformanceTrackSurface } from "./surface.js";
|
|
5
|
+
export const hypitPackage = {
|
|
6
|
+
format: "hypit.node-package@1" as const,
|
|
7
|
+
modules: [{ manifest: performanceManifest }], components: [performanceComponent],
|
|
8
|
+
hostFacets: performanceMarkupSurfaces.map(declaration => createMarkupSurfaceHostFacet({ module: performanceModuleRef, declaration,
|
|
9
|
+
handler: declaration.name === "style" ? decodePerformanceStyleSurface : decodePerformanceTrackSurface })),
|
|
10
|
+
};
|
|
11
|
+
export default hypitPackage;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { canonicalize } from "@hypit/protocol";
|
|
2
|
+
import type { StoredValue } from "@hypit/protocol";
|
|
3
|
+
import type { ComponentPackage } from "@hypit/component-kit";
|
|
4
|
+
import type { Timeline } from "@hypit/timeline";
|
|
5
|
+
import { sealVisualTrack } from "@hypit/composition";
|
|
6
|
+
import type { VisualTrack } from "@hypit/composition";
|
|
7
|
+
import type { CanvasSpace, SpatialFrame, ContentFit } from "@hypit/spatial";
|
|
8
|
+
import type { TemporalWindow } from "@hypit/temporal";
|
|
9
|
+
import { createMediaLayerSet, createMediaSoundSet, createMediaTrackSet, finalizeMediaTrack, projectMediaVisualTrack } from "@hypit/media-track";
|
|
10
|
+
import type { MediaItemSpec, MediaSampleLayerSpec } from "@hypit/media-track";
|
|
11
|
+
import { appendMediaPerformance } from "./media.js";
|
|
12
|
+
import { appendPerformanceUse, resolvePerformance } from "./program.js";
|
|
13
|
+
import type { PerformanceSet } from "./program.js";
|
|
14
|
+
import { performanceProducers } from "./manifest.js";
|
|
15
|
+
|
|
16
|
+
function inline<T>(value: StoredValue | undefined): T {
|
|
17
|
+
if (value?.kind !== "inline") throw new Error("Performance input must be inline.");
|
|
18
|
+
return value.value as unknown as T;
|
|
19
|
+
}
|
|
20
|
+
const output = (value: unknown) => ({ kind: "inline" as const, value: canonicalize(value) });
|
|
21
|
+
export function ordinaryPerformance(input: {
|
|
22
|
+
timeline: Timeline; canvas: CanvasSpace; window: TemporalWindow; frame: SpatialFrame;
|
|
23
|
+
fit: ContentFit; sample: MediaSampleLayerSpec; spec: MediaItemSpec;
|
|
24
|
+
}): VisualTrack {
|
|
25
|
+
const id = input.window.subjectId;
|
|
26
|
+
const header = { id };
|
|
27
|
+
const set = appendMediaPerformance({ ...input, header, set: createMediaTrackSet(), layers: createMediaLayerSet(),
|
|
28
|
+
sounds: createMediaSoundSet(), spec: { ...input.spec, id } }, input.fit, input.sample);
|
|
29
|
+
if (set.items.length === 0) return sealVisualTrack({ id, programSpaceId: input.timeline.id, visualIr: "hypit.visual-ir@1", presents: [] });
|
|
30
|
+
return projectMediaVisualTrack(input.timeline, finalizeMediaTrack(set, header, input.timeline));
|
|
31
|
+
}
|
|
32
|
+
export const performanceComponent: ComponentPackage = {
|
|
33
|
+
producers: [
|
|
34
|
+
{ producer: performanceProducers.create, handler: () => ({ outputs: { set: output({ uses: [] }) }, needs: {} }) },
|
|
35
|
+
{ producer: performanceProducers.append, handler: ({ inputs }) => ({ outputs: { set: output(appendPerformanceUse(
|
|
36
|
+
inline<PerformanceSet>(inputs.set?.value), inline<TemporalWindow>(inputs.window?.value), inline<VisualTrack>(inputs.visual?.value),
|
|
37
|
+
)) }, needs: {} }) },
|
|
38
|
+
{ producer: performanceProducers.resolve, handler: ({ inputs }) => ({ outputs: { visual: output(resolvePerformance(
|
|
39
|
+
inline<Timeline>(inputs.timeline?.value), inline<{ id: string }>(inputs.header?.value).id, inline<PerformanceSet>(inputs.set?.value),
|
|
40
|
+
)) }, needs: {} }) },
|
|
41
|
+
{ producer: performanceProducers.ordinary, handler: ({ inputs }) => ({ outputs: { visual: output(ordinaryPerformance({
|
|
42
|
+
timeline: inline(inputs.timeline?.value), canvas: inline(inputs.canvas?.value), window: inline(inputs.window?.value),
|
|
43
|
+
frame: inline(inputs.frame?.value), fit: inline(inputs.fit?.value), sample: inline(inputs.sample?.value), spec: inline(inputs.spec?.value),
|
|
44
|
+
})) }, needs: {} }) },
|
|
45
|
+
],
|
|
46
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { compositionDependency, compositionTypes } from "@hypit/composition";
|
|
2
|
+
import { timelineDependency, timelineTypes } from "@hypit/timeline";
|
|
3
|
+
import { spatialDependency, spatialTypes } from "@hypit/spatial";
|
|
4
|
+
import { temporalDependency, temporalTypes } from "@hypit/temporal";
|
|
5
|
+
import { mediaTrackDependency, mediaTrackTypes } from "@hypit/media-track";
|
|
6
|
+
import { svsRecipeType } from "@hypit/svs";
|
|
7
|
+
import { temporalWindowAttributeVocabulary } from "@hypit/temporal-markup";
|
|
8
|
+
import type { ModuleManifest, ProducerRef, TypeRef } from "@hypit/protocol";
|
|
9
|
+
|
|
10
|
+
export const performanceModuleRef = { name: "@hypit/performance", version: "1" } as const;
|
|
11
|
+
export const performanceTypes = Object.fromEntries(["Style", "Set", "Header"].map(name => [name.toLowerCase(), { module: performanceModuleRef, name: `Performance${name}` }])) as Record<"style" | "set" | "header", TypeRef>;
|
|
12
|
+
export const performanceProducers = Object.fromEntries(["create", "append", "resolve", "ordinary"].map(name => [name, { module: performanceModuleRef, name }])) as Record<"create" | "append" | "resolve" | "ordinary", ProducerRef>;
|
|
13
|
+
export const ordinaryInputs = [
|
|
14
|
+
{ name: "timeline", type: timelineTypes.track }, { name: "canvas", type: spatialTypes.canvas },
|
|
15
|
+
{ name: "window", type: temporalTypes.window }, { name: "frame", type: spatialTypes.frame },
|
|
16
|
+
{ name: "fit", type: spatialTypes.fit }, { name: "sample", type: mediaTrackTypes.sampleLayerSpec },
|
|
17
|
+
{ name: "spec", type: mediaTrackTypes.itemSpec },
|
|
18
|
+
];
|
|
19
|
+
export const performanceManifest: ModuleManifest = {
|
|
20
|
+
format: "hypit.module@1", ...performanceModuleRef,
|
|
21
|
+
dependencies: [compositionDependency, timelineDependency, spatialDependency, temporalDependency, mediaTrackDependency],
|
|
22
|
+
types: Object.values(performanceTypes).map(type => ({ name: type.name })), capabilities: [],
|
|
23
|
+
producers: [
|
|
24
|
+
{ name: "create", inputs: [], outputs: [{ name: "set", type: performanceTypes.set }], needs: [] },
|
|
25
|
+
{ name: "append", inputs: [{ name: "set", type: performanceTypes.set }, { name: "window", type: temporalTypes.window }, { name: "visual", type: compositionTypes.visualTrack }], outputs: [{ name: "set", type: performanceTypes.set }], needs: [] },
|
|
26
|
+
{ name: "resolve", inputs: [{ name: "set", type: performanceTypes.set }, { name: "timeline", type: timelineTypes.track }, { name: "header", type: performanceTypes.header }], outputs: [{ name: "visual", type: compositionTypes.visualTrack }], needs: [] },
|
|
27
|
+
{ name: "ordinary", inputs: ordinaryInputs, outputs: [{ name: "visual", type: compositionTypes.visualTrack }], needs: [] },
|
|
28
|
+
],
|
|
29
|
+
};
|
|
30
|
+
export const performanceMarkupSurfaces = [
|
|
31
|
+
{ name: "style", tag: "Style", mode: "structured", outputs: [performanceTypes.style, spatialTypes.fit, mediaTrackTypes.sampleLayerSpec, mediaTrackTypes.itemSpec], vocabulary: {
|
|
32
|
+
summary: "Defines ordinary A-roll framing using Media appearance properties.",
|
|
33
|
+
example: `<performance:Style id="full" frame={layout.full} appearance={recipes.media.presenter}/>`,
|
|
34
|
+
attributes: [
|
|
35
|
+
{ name: "id", kind: "identifier", required: true, summary: "Style name." },
|
|
36
|
+
{ name: "frame", kind: "reference", required: true, accepts: [spatialTypes.frame], summary: "Destination Frame." },
|
|
37
|
+
{ name: "appearance", kind: "reference", required: true, accepts: [svsRecipeType], summary: "Media appearance Recipe: fitting, clipping, border and color." },
|
|
38
|
+
],
|
|
39
|
+
} },
|
|
40
|
+
{ name: "track", tag: "Track", mode: "structured", outputs: [compositionTypes.visualTrack, performanceTypes.set, performanceTypes.header, temporalTypes.instantSpec, temporalTypes.windowSpec, temporalTypes.instant, temporalTypes.window], vocabulary: {
|
|
41
|
+
summary: "Presents Timeline footage through ordered Use rules, retaining source playback time.",
|
|
42
|
+
example: `<performance:Track id="presenter" timeline={program.timeline} canvas={canvas}><performance:Use style={full}/></performance:Track>`,
|
|
43
|
+
attributes: [
|
|
44
|
+
{ name: "id", kind: "identifier", required: true, summary: "Presentation name." },
|
|
45
|
+
{ name: "timeline", kind: "reference", required: true, accepts: [timelineTypes.track], summary: "Placed material and film time." },
|
|
46
|
+
{ name: "canvas", kind: "reference", required: true, accepts: [spatialTypes.canvas], summary: "Composition Canvas." },
|
|
47
|
+
], children: [{ tag: "Use", cardinality: "many", summary: "Last matching Use wins. No time selector means the whole Timeline.", attributes: [
|
|
48
|
+
{ name: "id", kind: "identifier", required: false, summary: "Optional occurrence identity." },
|
|
49
|
+
{ name: "style", kind: "reference", required: true, accepts: [performanceTypes.style], summary: "Ordinary or project-authored presentation Style." },
|
|
50
|
+
...temporalWindowAttributeVocabulary,
|
|
51
|
+
] }],
|
|
52
|
+
} },
|
|
53
|
+
] as const;
|