@konitif/workbench 0.284.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +54 -0
- package/dist/application/boot/applicationBoot.d.ts +48 -0
- package/dist/application/boot/applicationBoot.js +174 -0
- package/dist/application/experiment/ControlledExperimentCampaign.d.ts +12 -0
- package/dist/application/experiment/ControlledExperimentCampaign.js +159 -0
- package/dist/application/experiment/ControlledExperimentRecorder.d.ts +17 -0
- package/dist/application/experiment/ControlledExperimentRecorder.js +215 -0
- package/dist/application/i18n/WorkbenchTranslationRegistry.d.ts +19 -0
- package/dist/application/i18n/WorkbenchTranslationRegistry.js +179 -0
- package/dist/application/layout/surfaceCommandRouter.d.ts +18 -0
- package/dist/application/layout/surfaceCommandRouter.js +247 -0
- package/dist/application/physics/NoopPhysicsBackend.d.ts +2 -0
- package/dist/application/physics/NoopPhysicsBackend.js +2 -0
- package/dist/application/physics/PhysicsService.d.ts +2 -0
- package/dist/application/physics/PhysicsService.js +2 -0
- package/dist/application/project/ProjectManifest.d.ts +15 -0
- package/dist/application/project/ProjectManifest.js +107 -0
- package/dist/application/repository/RepositoryPreflightEngine.d.ts +6 -0
- package/dist/application/repository/RepositoryPreflightEngine.js +301 -0
- package/dist/application/runtime/RuntimeBackendConnection.d.ts +9 -0
- package/dist/application/runtime/RuntimeBackendConnection.js +34 -0
- package/dist/application/runtime/RuntimeBackendSubscription.d.ts +8 -0
- package/dist/application/runtime/RuntimeBackendSubscription.js +52 -0
- package/dist/application/runtime/RuntimeCheckpointStore.d.ts +20 -0
- package/dist/application/runtime/RuntimeCheckpointStore.js +65 -0
- package/dist/application/runtime/RuntimeLaunchProgress.d.ts +3 -0
- package/dist/application/runtime/RuntimeLaunchProgress.js +38 -0
- package/dist/application/runtime/RuntimeLaunchStateSnapshot.d.ts +48 -0
- package/dist/application/runtime/RuntimeLaunchStateSnapshot.js +73 -0
- package/dist/application/runtime/RuntimeObservabilityHub.d.ts +28 -0
- package/dist/application/runtime/RuntimeObservabilityHub.js +262 -0
- package/dist/application/runtime/RuntimeObservationEvents.d.ts +15 -0
- package/dist/application/runtime/RuntimeObservationEvents.js +18 -0
- package/dist/application/runtime/RuntimeOffloadManager.d.ts +24 -0
- package/dist/application/runtime/RuntimeOffloadManager.js +96 -0
- package/dist/application/runtime/RuntimePlanEngine.d.ts +11 -0
- package/dist/application/runtime/RuntimePlanEngine.js +67 -0
- package/dist/application/runtime/RuntimeProjectionCatalog.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionCatalog.js +48 -0
- package/dist/application/runtime/RuntimeProjectionSession.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSession.js +4 -0
- package/dist/application/runtime/RuntimeProjectionSessionKeys.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSessionKeys.js +10 -0
- package/dist/application/runtime/RuntimeProjectionSessionReducers.d.ts +7 -0
- package/dist/application/runtime/RuntimeProjectionSessionReducers.js +101 -0
- package/dist/application/runtime/RuntimeProjectionSessionSerialization.d.ts +5 -0
- package/dist/application/runtime/RuntimeProjectionSessionSerialization.js +89 -0
- package/dist/application/runtime/RuntimeProjectionSessionSharedState.d.ts +3 -0
- package/dist/application/runtime/RuntimeProjectionSessionSharedState.js +53 -0
- package/dist/application/runtime/RuntimeProjectionSessionTypes.d.ts +38 -0
- package/dist/application/runtime/RuntimeProjectionSessionTypes.js +1 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionSync.d.ts +29 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionSync.js +39 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.d.ts +27 -0
- package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.js +38 -0
- package/dist/application/runtime/RuntimeRegistryOwner.d.ts +20 -0
- package/dist/application/runtime/RuntimeRegistryOwner.js +71 -0
- package/dist/application/runtime/RuntimeRegistrySnapshots.d.ts +6 -0
- package/dist/application/runtime/RuntimeRegistrySnapshots.js +51 -0
- package/dist/application/runtime/RuntimeRegistryTypes.d.ts +29 -0
- package/dist/application/runtime/RuntimeRegistryTypes.js +1 -0
- package/dist/application/runtime/RuntimeSharedState.d.ts +6 -0
- package/dist/application/runtime/RuntimeSharedState.js +47 -0
- package/dist/application/runtime/WorkbenchRuntimeCore.d.ts +82 -0
- package/dist/application/runtime/WorkbenchRuntimeCore.js +463 -0
- package/dist/application/runtime/WorkbenchRuntimeSanitizers.d.ts +9 -0
- package/dist/application/runtime/WorkbenchRuntimeSanitizers.js +62 -0
- package/dist/application/shell/state.d.ts +22 -0
- package/dist/application/shell/state.js +308 -0
- package/dist/application/widgets/createWorkbenchWidgetAdapter.d.ts +9 -0
- package/dist/application/widgets/createWorkbenchWidgetAdapter.js +30 -0
- package/dist/application/workspace/canonicalizeLayout.d.ts +2 -0
- package/dist/application/workspace/canonicalizeLayout.js +91 -0
- package/dist/application/workspace/closePanel.d.ts +6 -0
- package/dist/application/workspace/closePanel.js +43 -0
- package/dist/application/workspace/collapseSplit.d.ts +7 -0
- package/dist/application/workspace/collapseSplit.js +45 -0
- package/dist/application/workspace/collapseSplitBoundary.d.ts +8 -0
- package/dist/application/workspace/collapseSplitBoundary.js +106 -0
- package/dist/application/workspace/commands.d.ts +71 -0
- package/dist/application/workspace/commands.js +216 -0
- package/dist/application/workspace/createPeripheralBands.d.ts +14 -0
- package/dist/application/workspace/createPeripheralBands.js +62 -0
- package/dist/application/workspace/createWorkspace.d.ts +7 -0
- package/dist/application/workspace/createWorkspace.js +12 -0
- package/dist/application/workspace/detachPanelToWindow.d.ts +12 -0
- package/dist/application/workspace/detachPanelToWindow.js +57 -0
- package/dist/application/workspace/dockPanel.d.ts +10 -0
- package/dist/application/workspace/dockPanel.js +399 -0
- package/dist/application/workspace/finalizeWorkspace.d.ts +4 -0
- package/dist/application/workspace/finalizeWorkspace.js +23 -0
- package/dist/application/workspace/focusPanel.d.ts +2 -0
- package/dist/application/workspace/focusPanel.js +19 -0
- package/dist/application/workspace/joinPanelArea.d.ts +13 -0
- package/dist/application/workspace/joinPanelArea.js +281 -0
- package/dist/application/workspace/layoutInteraction.d.ts +176 -0
- package/dist/application/workspace/layoutInteraction.js +852 -0
- package/dist/application/workspace/layoutTree.d.ts +34 -0
- package/dist/application/workspace/layoutTree.js +135 -0
- package/dist/application/workspace/openTool.d.ts +15 -0
- package/dist/application/workspace/openTool.js +89 -0
- package/dist/application/workspace/presetArtifacts.d.ts +60 -0
- package/dist/application/workspace/presetArtifacts.js +231 -0
- package/dist/application/workspace/presets.d.ts +5 -0
- package/dist/application/workspace/presets.js +12 -0
- package/dist/application/workspace/reattachWorkspaceWindow.d.ts +7 -0
- package/dist/application/workspace/reattachWorkspaceWindow.js +24 -0
- package/dist/application/workspace/resizeSplit.d.ts +7 -0
- package/dist/application/workspace/resizeSplit.js +12 -0
- package/dist/application/workspace/resizeSplitBoundary.d.ts +10 -0
- package/dist/application/workspace/resizeSplitBoundary.js +115 -0
- package/dist/application/workspace/runToolShellCommand.d.ts +11 -0
- package/dist/application/workspace/runToolShellCommand.js +133 -0
- package/dist/application/workspace/session.d.ts +9 -0
- package/dist/application/workspace/session.js +36 -0
- package/dist/application/workspace/setActiveStackChild.d.ts +7 -0
- package/dist/application/workspace/setActiveStackChild.js +12 -0
- package/dist/application/workspace/setDesignSystemThemeSession.d.ts +3 -0
- package/dist/application/workspace/setDesignSystemThemeSession.js +12 -0
- package/dist/application/workspace/setPanelFullscreenToggleVisibility.d.ts +7 -0
- package/dist/application/workspace/setPanelFullscreenToggleVisibility.js +7 -0
- package/dist/application/workspace/setStackHeaderVisibility.d.ts +7 -0
- package/dist/application/workspace/setStackHeaderVisibility.js +7 -0
- package/dist/application/workspace/setToolPanelTitleOverride.d.ts +9 -0
- package/dist/application/workspace/setToolPanelTitleOverride.js +33 -0
- package/dist/application/workspace/setToolShellStatus.d.ts +8 -0
- package/dist/application/workspace/setToolShellStatus.js +32 -0
- package/dist/application/workspace/setWorkspaceFullscreenPanel.d.ts +3 -0
- package/dist/application/workspace/setWorkspaceFullscreenPanel.js +26 -0
- package/dist/application/workspace/snapshots.d.ts +10 -0
- package/dist/application/workspace/snapshots.js +34 -0
- package/dist/application/workspace/splitPanel.d.ts +10 -0
- package/dist/application/workspace/splitPanel.js +21 -0
- package/dist/application/workspace/subdividePanel.d.ts +39 -0
- package/dist/application/workspace/subdividePanel.js +128 -0
- package/dist/application/workspace/swapPanelArea.d.ts +11 -0
- package/dist/application/workspace/swapPanelArea.js +163 -0
- package/dist/application/workspace/targetWindow.d.ts +4 -0
- package/dist/application/workspace/targetWindow.js +22 -0
- package/dist/application/workspace/toolCapabilities.d.ts +11 -0
- package/dist/application/workspace/toolCapabilities.js +59 -0
- package/dist/application/workspace/toolRuntime.d.ts +32 -0
- package/dist/application/workspace/toolRuntime.js +65 -0
- package/dist/application/workspace/updateToolState.d.ts +8 -0
- package/dist/application/workspace/updateToolState.js +20 -0
- package/dist/boot/applicationBoot.d.ts +1 -0
- package/dist/boot/applicationBoot.js +2 -0
- package/dist/boot/events.d.ts +43 -0
- package/dist/boot/events.js +16 -0
- package/dist/boot/executor.d.ts +13 -0
- package/dist/boot/executor.js +210 -0
- package/dist/boot/graph.d.ts +16 -0
- package/dist/boot/graph.js +126 -0
- package/dist/boot/index.d.ts +2 -0
- package/dist/boot/index.js +3 -0
- package/dist/boot/mechanism.d.ts +5 -0
- package/dist/boot/mechanism.js +6 -0
- package/dist/boot/projection.d.ts +72 -0
- package/dist/boot/projection.js +398 -0
- package/dist/boot/types.d.ts +80 -0
- package/dist/boot/types.js +46 -0
- package/dist/domain/composition/dockArrangement.d.ts +57 -0
- package/dist/domain/composition/dockArrangement.js +304 -0
- package/dist/domain/composition/docking.d.ts +68 -0
- package/dist/domain/composition/docking.js +187 -0
- package/dist/domain/design-system/themeSession.d.ts +12 -0
- package/dist/domain/design-system/themeSession.js +42 -0
- package/dist/domain/experiment/model.d.ts +149 -0
- package/dist/domain/experiment/model.js +1 -0
- package/dist/domain/i18n/languageRegistry.d.ts +57 -0
- package/dist/domain/i18n/languageRegistry.js +1 -0
- package/dist/domain/i18n/model.d.ts +31 -0
- package/dist/domain/i18n/model.js +1 -0
- package/dist/domain/icon/model.d.ts +8 -0
- package/dist/domain/icon/model.js +1 -0
- package/dist/domain/input/interactionBindings.d.ts +2 -0
- package/dist/domain/input/interactionBindings.js +2 -0
- package/dist/domain/launch/model.d.ts +58 -0
- package/dist/domain/launch/model.js +109 -0
- package/dist/domain/layout/interaction.d.ts +90 -0
- package/dist/domain/layout/interaction.js +1 -0
- package/dist/domain/layout/model.d.ts +28 -0
- package/dist/domain/layout/model.js +1 -0
- package/dist/domain/layout/selectors.d.ts +12 -0
- package/dist/domain/layout/selectors.js +84 -0
- package/dist/domain/layout/surfaceProjection.d.ts +56 -0
- package/dist/domain/layout/surfaceProjection.js +249 -0
- package/dist/domain/layout/validation.d.ts +9 -0
- package/dist/domain/layout/validation.js +71 -0
- package/dist/domain/panel/model.d.ts +9 -0
- package/dist/domain/panel/model.js +1 -0
- package/dist/domain/physics/colliderGeometry.d.ts +2 -0
- package/dist/domain/physics/colliderGeometry.js +1 -0
- package/dist/domain/physics/contracts.d.ts +2 -0
- package/dist/domain/physics/contracts.js +1 -0
- package/dist/domain/physics/kinematicBinding.d.ts +22 -0
- package/dist/domain/physics/kinematicBinding.js +1 -0
- package/dist/domain/physics/model.d.ts +4 -0
- package/dist/domain/physics/model.js +1 -0
- package/dist/domain/physics/mujoco.d.ts +5 -0
- package/dist/domain/physics/mujoco.js +1 -0
- package/dist/domain/physics/observationProfile.d.ts +2 -0
- package/dist/domain/physics/observationProfile.js +1 -0
- package/dist/domain/physics/presentationBinding.d.ts +6 -0
- package/dist/domain/physics/presentationBinding.js +1 -0
- package/dist/domain/physics/simulationProfile.d.ts +2 -0
- package/dist/domain/physics/simulationProfile.js +1 -0
- package/dist/domain/physics/visualAlignment.d.ts +17 -0
- package/dist/domain/physics/visualAlignment.js +1 -0
- package/dist/domain/presentation/readingLevel.d.ts +12 -0
- package/dist/domain/presentation/readingLevel.js +29 -0
- package/dist/domain/project/model.d.ts +55 -0
- package/dist/domain/project/model.js +1 -0
- package/dist/domain/repo-quality/model.d.ts +111 -0
- package/dist/domain/repo-quality/model.js +1 -0
- package/dist/domain/repository/model.d.ts +110 -0
- package/dist/domain/repository/model.js +1 -0
- package/dist/domain/runtime/checkpoint.d.ts +37 -0
- package/dist/domain/runtime/checkpoint.js +87 -0
- package/dist/domain/runtime/hydration.d.ts +26 -0
- package/dist/domain/runtime/hydration.js +92 -0
- package/dist/domain/runtime/initialization.d.ts +25 -0
- package/dist/domain/runtime/initialization.js +87 -0
- package/dist/domain/runtime/lifecycle.d.ts +51 -0
- package/dist/domain/runtime/lifecycle.js +118 -0
- package/dist/domain/runtime/model.d.ts +252 -0
- package/dist/domain/runtime/model.js +13 -0
- package/dist/domain/runtime/observability.d.ts +142 -0
- package/dist/domain/runtime/observability.js +1 -0
- package/dist/domain/runtime/offload.d.ts +56 -0
- package/dist/domain/runtime/offload.js +129 -0
- package/dist/domain/runtime/plan.d.ts +26 -0
- package/dist/domain/runtime/plan.js +1 -0
- package/dist/domain/runtime/qualityPolicy.d.ts +28 -0
- package/dist/domain/runtime/qualityPolicy.js +97 -0
- package/dist/domain/runtime/recovery.d.ts +61 -0
- package/dist/domain/runtime/recovery.js +129 -0
- package/dist/domain/runtime/suspension.d.ts +32 -0
- package/dist/domain/runtime/suspension.js +107 -0
- package/dist/domain/runtime/teardown.d.ts +33 -0
- package/dist/domain/runtime/teardown.js +109 -0
- package/dist/domain/shared/id.d.ts +1 -0
- package/dist/domain/shared/id.js +5 -0
- package/dist/domain/shared/json.d.ts +9 -0
- package/dist/domain/shared/json.js +24 -0
- package/dist/domain/shell/model.d.ts +40 -0
- package/dist/domain/shell/model.js +1 -0
- package/dist/domain/shell/runtime.d.ts +76 -0
- package/dist/domain/shell/runtime.js +40 -0
- package/dist/domain/surface/model.d.ts +97 -0
- package/dist/domain/surface/model.js +71 -0
- package/dist/domain/temporal/model.d.ts +95 -0
- package/dist/domain/temporal/model.js +45 -0
- package/dist/domain/tool/internalTab.d.ts +11 -0
- package/dist/domain/tool/internalTab.js +20 -0
- package/dist/domain/tool/model.d.ts +207 -0
- package/dist/domain/tool/model.js +1 -0
- package/dist/domain/tool/runtime.d.ts +122 -0
- package/dist/domain/tool/runtime.js +2 -0
- package/dist/domain/tool/shell.d.ts +38 -0
- package/dist/domain/tool/shell.js +175 -0
- package/dist/domain/widget/composition.d.ts +79 -0
- package/dist/domain/widget/composition.js +250 -0
- package/dist/domain/widget/model.d.ts +35 -0
- package/dist/domain/widget/model.js +8 -0
- package/dist/domain/widget/toolDock.d.ts +30 -0
- package/dist/domain/widget/toolDock.js +52 -0
- package/dist/domain/workbench/model.d.ts +35 -0
- package/dist/domain/workbench/model.js +1 -0
- package/dist/domain/workbench/routing.d.ts +17 -0
- package/dist/domain/workbench/routing.js +72 -0
- package/dist/domain/workspace/factories.d.ts +9 -0
- package/dist/domain/workspace/factories.js +47 -0
- package/dist/domain/workspace/model.d.ts +23 -0
- package/dist/domain/workspace/model.js +1 -0
- package/dist/domain/workspace/persistence.d.ts +5 -0
- package/dist/domain/workspace/persistence.js +1 -0
- package/dist/domain/workspace/selectors.d.ts +19 -0
- package/dist/domain/workspace/selectors.js +90 -0
- package/dist/domain/workspace/session.d.ts +9 -0
- package/dist/domain/workspace/session.js +1 -0
- package/dist/domain/workspace/validation.d.ts +10 -0
- package/dist/domain/workspace/validation.js +231 -0
- package/dist/hosting.d.ts +15 -0
- package/dist/hosting.js +12 -0
- package/dist/index.d.ts +111 -0
- package/dist/index.js +111 -0
- package/dist/infrastructure/audio/WorkbenchAudioManager.d.ts +36 -0
- package/dist/infrastructure/audio/WorkbenchAudioManager.js +100 -0
- package/dist/infrastructure/backend/HttpWorkbenchBackendClient.d.ts +30 -0
- package/dist/infrastructure/backend/HttpWorkbenchBackendClient.js +314 -0
- package/dist/infrastructure/persistence/LocalWorkspacePersistence.d.ts +8 -0
- package/dist/infrastructure/persistence/LocalWorkspacePersistence.js +29 -0
- package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.d.ts +58 -0
- package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.js +121 -0
- package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.d.ts +8 -0
- package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.js +38 -0
- package/dist/infrastructure/tools/InMemoryToolRegistry.d.ts +46 -0
- package/dist/infrastructure/tools/InMemoryToolRegistry.js +82 -0
- package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.d.ts +42 -0
- package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.js +66 -0
- package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.d.ts +20 -0
- package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.js +35 -0
- package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.d.ts +7 -0
- package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.js +28 -0
- package/dist/physics-runtime.d.ts +4 -0
- package/dist/physics-runtime.js +2 -0
- package/dist/stage/easing.d.ts +5 -0
- package/dist/stage/easing.js +15 -0
- package/dist/stage/index.d.ts +6 -0
- package/dist/stage/index.js +6 -0
- package/dist/stage/projection.d.ts +4 -0
- package/dist/stage/projection.js +74 -0
- package/dist/stage/stageRuntime.d.ts +2 -0
- package/dist/stage/stageRuntime.js +32 -0
- package/dist/stage/timeline.d.ts +3 -0
- package/dist/stage/timeline.js +69 -0
- package/dist/stage/tween.d.ts +3 -0
- package/dist/stage/tween.js +104 -0
- package/dist/stage/types.d.ts +104 -0
- package/dist/stage/types.js +30 -0
- package/dist/temporal/clock/audioClock.d.ts +1 -0
- package/dist/temporal/clock/audioClock.js +1 -0
- package/dist/temporal/clock/clockGraph.d.ts +1 -0
- package/dist/temporal/clock/clockGraph.js +1 -0
- package/dist/temporal/clock/clockTypes.d.ts +1 -0
- package/dist/temporal/clock/clockTypes.js +1 -0
- package/dist/temporal/clock/fixedStepClock.d.ts +1 -0
- package/dist/temporal/clock/fixedStepClock.js +1 -0
- package/dist/temporal/clock/musicalClock.d.ts +7 -0
- package/dist/temporal/clock/musicalClock.js +35 -0
- package/dist/temporal/clock/rootClock.d.ts +1 -0
- package/dist/temporal/clock/rootClock.js +1 -0
- package/dist/temporal/clock/videoClock.d.ts +1 -0
- package/dist/temporal/clock/videoClock.js +1 -0
- package/dist/temporal/easing/easingFunctions.d.ts +2 -0
- package/dist/temporal/easing/easingFunctions.js +19 -0
- package/dist/temporal/easing/easingRegistry.d.ts +10 -0
- package/dist/temporal/easing/easingRegistry.js +32 -0
- package/dist/temporal/easing/easingShaderSource.d.ts +2 -0
- package/dist/temporal/easing/easingShaderSource.js +16 -0
- package/dist/temporal/easing/easingTypes.d.ts +9 -0
- package/dist/temporal/easing/easingTypes.js +1 -0
- package/dist/temporal/history/runtimeHistory.d.ts +77 -0
- package/dist/temporal/history/runtimeHistory.js +5 -0
- package/dist/temporal/history/temporalHistoryCore.d.ts +1 -0
- package/dist/temporal/history/temporalHistoryCore.js +1 -0
- package/dist/temporal/index.d.ts +20 -0
- package/dist/temporal/index.js +20 -0
- package/dist/temporal/invalidation/invalidationController.d.ts +1 -0
- package/dist/temporal/invalidation/invalidationController.js +1 -0
- package/dist/temporal/scheduler/browserSchedulerHost.d.ts +3 -0
- package/dist/temporal/scheduler/browserSchedulerHost.js +19 -0
- package/dist/temporal/scheduler/frameBudget.d.ts +1 -0
- package/dist/temporal/scheduler/frameBudget.js +1 -0
- package/dist/temporal/scheduler/temporalScheduler.d.ts +4 -0
- package/dist/temporal/scheduler/temporalScheduler.js +6 -0
- package/dist/temporal/scheduler/temporalSchedulerCore.d.ts +1 -0
- package/dist/temporal/scheduler/temporalSchedulerCore.js +1 -0
- package/dist/temporal/scheduler/visibilityPolicy.d.ts +2 -0
- package/dist/temporal/scheduler/visibilityPolicy.js +1 -0
- package/dist/temporal/transport/temporalTransport.d.ts +1 -0
- package/dist/temporal/transport/temporalTransport.js +1 -0
- package/dist/temporal/transport/transportScope.d.ts +7 -0
- package/dist/temporal/transport/transportScope.js +3 -0
- package/dist/temporal/transport/transportTimeline.d.ts +22 -0
- package/dist/temporal/transport/transportTimeline.js +36 -0
- package/dist/temporal/transport/transportTypes.d.ts +1 -0
- package/dist/temporal/transport/transportTypes.js +1 -0
- package/dist/workspace-contracts.d.ts +36 -0
- package/dist/workspace-contracts.js +28 -0
- package/package.json +57 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export class InMemoryTemporalDialectRegistry {
|
|
2
|
+
entries = new Map();
|
|
3
|
+
register(definition) {
|
|
4
|
+
this.entries.set(definition.id, cloneTemporalDialectDefinition(definition));
|
|
5
|
+
}
|
|
6
|
+
getDefinition(dialectId) {
|
|
7
|
+
const definition = this.entries.get(dialectId);
|
|
8
|
+
return definition ? cloneTemporalDialectDefinition(definition) : undefined;
|
|
9
|
+
}
|
|
10
|
+
list() {
|
|
11
|
+
return [...this.entries.values()]
|
|
12
|
+
.map(cloneTemporalDialectDefinition)
|
|
13
|
+
.sort(compareTemporalDialects);
|
|
14
|
+
}
|
|
15
|
+
listCompatible(input) {
|
|
16
|
+
return this.list().filter((definition) => isCompatibleTemporalDialect(definition, input));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function isCompatibleTemporalDialect(definition, input) {
|
|
20
|
+
const requiredCapabilities = input.requiredCapabilities ?? [];
|
|
21
|
+
const projectionKinds = definition.projectionKinds ?? [];
|
|
22
|
+
return ((!input.dialect || definition.id === input.dialect) &&
|
|
23
|
+
(!input.unit || definition.unit === input.unit) &&
|
|
24
|
+
(!input.projectionKind || projectionKinds.includes(input.projectionKind)) &&
|
|
25
|
+
requiredCapabilities.every((capability) => definition.capabilities.includes(capability)));
|
|
26
|
+
}
|
|
27
|
+
function compareTemporalDialects(left, right) {
|
|
28
|
+
const titleDelta = left.title.localeCompare(right.title);
|
|
29
|
+
return titleDelta !== 0 ? titleDelta : left.id.localeCompare(right.id);
|
|
30
|
+
}
|
|
31
|
+
function cloneTemporalDialectDefinition(definition) {
|
|
32
|
+
return {
|
|
33
|
+
...definition,
|
|
34
|
+
itemKinds: [...definition.itemKinds],
|
|
35
|
+
capabilities: [...definition.capabilities],
|
|
36
|
+
projectionKinds: definition.projectionKinds ? [...definition.projectionKinds] : undefined
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ToolCatalogPort, ToolDefinition } from "../../domain/tool/model.js";
|
|
2
|
+
export type RegisteredToolComponent = unknown;
|
|
3
|
+
export type RegisteredToolComponentModule = {
|
|
4
|
+
default: RegisteredToolComponent;
|
|
5
|
+
};
|
|
6
|
+
export type RegisteredToolComponentLoader = () => Promise<RegisteredToolComponent | RegisteredToolComponentModule>;
|
|
7
|
+
export interface RegisteredTool {
|
|
8
|
+
definition: ToolDefinition;
|
|
9
|
+
component?: RegisteredToolComponent;
|
|
10
|
+
loadComponent?: RegisteredToolComponentLoader;
|
|
11
|
+
configComponent?: RegisteredToolComponent;
|
|
12
|
+
loadConfigComponent?: RegisteredToolComponentLoader;
|
|
13
|
+
}
|
|
14
|
+
export type ToolRegistryDuplicateResolutionPolicy = 'first-registration-wins';
|
|
15
|
+
export interface ToolRegistryEntryMetadata {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
panelTitle: string;
|
|
19
|
+
description: string;
|
|
20
|
+
componentMode: 'component' | 'loader' | 'component-and-loader';
|
|
21
|
+
}
|
|
22
|
+
export interface ToolRegistryDuplicateDiagnostic {
|
|
23
|
+
kind: 'duplicate-id';
|
|
24
|
+
registryKind: 'tool';
|
|
25
|
+
duplicateId: string;
|
|
26
|
+
existing: ToolRegistryEntryMetadata;
|
|
27
|
+
incoming: ToolRegistryEntryMetadata;
|
|
28
|
+
existingRegistrationOrder: number;
|
|
29
|
+
incomingRegistrationOrder: number;
|
|
30
|
+
resolutionPolicy: ToolRegistryDuplicateResolutionPolicy;
|
|
31
|
+
}
|
|
32
|
+
export declare class InMemoryToolRegistry implements ToolCatalogPort {
|
|
33
|
+
private readonly entries;
|
|
34
|
+
private readonly registrationOrders;
|
|
35
|
+
private readonly duplicateDiagnostics;
|
|
36
|
+
private nextRegistrationOrder;
|
|
37
|
+
private revision;
|
|
38
|
+
private readonly revisionListeners;
|
|
39
|
+
/** Observe admitted registrations, not duplicate diagnostics or direct object mutations. */
|
|
40
|
+
subscribeRevision(listener: (revision: number) => void): () => void;
|
|
41
|
+
register(entry: RegisteredTool): void;
|
|
42
|
+
get(toolId: string): RegisteredTool | undefined;
|
|
43
|
+
getDefinition(toolId: string): ToolDefinition | undefined;
|
|
44
|
+
list(): RegisteredTool[];
|
|
45
|
+
listDiagnostics(): ToolRegistryDuplicateDiagnostic[];
|
|
46
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export class InMemoryToolRegistry {
|
|
2
|
+
entries = new Map();
|
|
3
|
+
registrationOrders = new Map();
|
|
4
|
+
duplicateDiagnostics = [];
|
|
5
|
+
nextRegistrationOrder = 0;
|
|
6
|
+
revision = 0;
|
|
7
|
+
revisionListeners = new Set();
|
|
8
|
+
/** Observe admitted registrations, not duplicate diagnostics or direct object mutations. */
|
|
9
|
+
subscribeRevision(listener) {
|
|
10
|
+
const subscriber = (revision) => listener(revision);
|
|
11
|
+
this.revisionListeners.add(subscriber);
|
|
12
|
+
try {
|
|
13
|
+
subscriber(this.revision);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
this.revisionListeners.delete(subscriber);
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
return () => { this.revisionListeners.delete(subscriber); };
|
|
20
|
+
}
|
|
21
|
+
register(entry) {
|
|
22
|
+
if (!entry.component && !entry.loadComponent) {
|
|
23
|
+
throw new Error(`Tool "${entry.definition.id}" must register a component or component loader.`);
|
|
24
|
+
}
|
|
25
|
+
const incomingRegistrationOrder = ++this.nextRegistrationOrder;
|
|
26
|
+
const existingEntry = this.entries.get(entry.definition.id);
|
|
27
|
+
if (existingEntry) {
|
|
28
|
+
this.duplicateDiagnostics.push({
|
|
29
|
+
kind: 'duplicate-id',
|
|
30
|
+
registryKind: 'tool',
|
|
31
|
+
duplicateId: entry.definition.id,
|
|
32
|
+
existing: createToolRegistryEntryMetadata(existingEntry),
|
|
33
|
+
incoming: createToolRegistryEntryMetadata(entry),
|
|
34
|
+
existingRegistrationOrder: this.registrationOrders.get(entry.definition.id) ?? 0,
|
|
35
|
+
incomingRegistrationOrder,
|
|
36
|
+
resolutionPolicy: 'first-registration-wins'
|
|
37
|
+
});
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
this.entries.set(entry.definition.id, entry);
|
|
41
|
+
this.registrationOrders.set(entry.definition.id, incomingRegistrationOrder);
|
|
42
|
+
this.revision += 1;
|
|
43
|
+
for (const listener of [...this.revisionListeners]) {
|
|
44
|
+
if (this.revisionListeners.has(listener))
|
|
45
|
+
listener(this.revision);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
get(toolId) {
|
|
49
|
+
return this.entries.get(toolId);
|
|
50
|
+
}
|
|
51
|
+
getDefinition(toolId) {
|
|
52
|
+
return this.entries.get(toolId)?.definition;
|
|
53
|
+
}
|
|
54
|
+
list() {
|
|
55
|
+
return [...this.entries.values()];
|
|
56
|
+
}
|
|
57
|
+
listDiagnostics() {
|
|
58
|
+
return this.duplicateDiagnostics.map(cloneToolRegistryDuplicateDiagnostic);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function createToolRegistryEntryMetadata(entry) {
|
|
62
|
+
return {
|
|
63
|
+
id: entry.definition.id,
|
|
64
|
+
title: entry.definition.title,
|
|
65
|
+
panelTitle: entry.definition.panelTitle,
|
|
66
|
+
description: entry.definition.description,
|
|
67
|
+
componentMode: resolveToolComponentMode(entry)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function resolveToolComponentMode(entry) {
|
|
71
|
+
if (entry.component && entry.loadComponent) {
|
|
72
|
+
return 'component-and-loader';
|
|
73
|
+
}
|
|
74
|
+
return entry.component ? 'component' : 'loader';
|
|
75
|
+
}
|
|
76
|
+
function cloneToolRegistryDuplicateDiagnostic(diagnostic) {
|
|
77
|
+
return {
|
|
78
|
+
...diagnostic,
|
|
79
|
+
existing: { ...diagnostic.existing },
|
|
80
|
+
incoming: { ...diagnostic.incoming }
|
|
81
|
+
};
|
|
82
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { ShellWidgetCatalogPort, ShellWidgetDefinition, ShellRegionId } from "../../domain/shell/model.js";
|
|
2
|
+
export type RegisteredShellWidgetComponent = unknown;
|
|
3
|
+
export type RegisteredShellWidgetComponentModule = {
|
|
4
|
+
default: RegisteredShellWidgetComponent;
|
|
5
|
+
};
|
|
6
|
+
export type RegisteredShellWidgetComponentLoader = () => Promise<RegisteredShellWidgetComponent | RegisteredShellWidgetComponentModule>;
|
|
7
|
+
export interface RegisteredShellWidget {
|
|
8
|
+
definition: ShellWidgetDefinition;
|
|
9
|
+
component?: RegisteredShellWidgetComponent;
|
|
10
|
+
loadComponent?: RegisteredShellWidgetComponentLoader;
|
|
11
|
+
}
|
|
12
|
+
export type ShellWidgetRegistryDuplicateResolutionPolicy = 'first-registration-wins';
|
|
13
|
+
export interface ShellWidgetRegistryEntryMetadata {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
defaultRegion: ShellRegionId;
|
|
18
|
+
scope: ShellWidgetDefinition['scope'];
|
|
19
|
+
componentMode: 'component' | 'loader' | 'component-and-loader';
|
|
20
|
+
}
|
|
21
|
+
export interface ShellWidgetRegistryDuplicateDiagnostic {
|
|
22
|
+
kind: 'duplicate-id';
|
|
23
|
+
registryKind: 'shell-widget';
|
|
24
|
+
duplicateId: string;
|
|
25
|
+
existing: ShellWidgetRegistryEntryMetadata;
|
|
26
|
+
incoming: ShellWidgetRegistryEntryMetadata;
|
|
27
|
+
existingRegistrationOrder: number;
|
|
28
|
+
incomingRegistrationOrder: number;
|
|
29
|
+
resolutionPolicy: ShellWidgetRegistryDuplicateResolutionPolicy;
|
|
30
|
+
}
|
|
31
|
+
export declare class InMemoryShellWidgetRegistry implements ShellWidgetCatalogPort {
|
|
32
|
+
private readonly entries;
|
|
33
|
+
private readonly registrationOrders;
|
|
34
|
+
private readonly duplicateDiagnostics;
|
|
35
|
+
private nextRegistrationOrder;
|
|
36
|
+
register(entry: RegisteredShellWidget): void;
|
|
37
|
+
get(widgetId: string): RegisteredShellWidget | undefined;
|
|
38
|
+
getDefinition(widgetId: string): ShellWidgetDefinition | undefined;
|
|
39
|
+
list(): ShellWidgetDefinition[];
|
|
40
|
+
listByRegion(regionId: ShellRegionId): RegisteredShellWidget[];
|
|
41
|
+
listDiagnostics(): ShellWidgetRegistryDuplicateDiagnostic[];
|
|
42
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export class InMemoryShellWidgetRegistry {
|
|
2
|
+
entries = new Map();
|
|
3
|
+
registrationOrders = new Map();
|
|
4
|
+
duplicateDiagnostics = [];
|
|
5
|
+
nextRegistrationOrder = 0;
|
|
6
|
+
register(entry) {
|
|
7
|
+
if (!entry.component && !entry.loadComponent) {
|
|
8
|
+
throw new Error(`Shell widget "${entry.definition.id}" must register a component or component loader.`);
|
|
9
|
+
}
|
|
10
|
+
const incomingRegistrationOrder = ++this.nextRegistrationOrder;
|
|
11
|
+
const existingEntry = this.entries.get(entry.definition.id);
|
|
12
|
+
if (existingEntry) {
|
|
13
|
+
this.duplicateDiagnostics.push({
|
|
14
|
+
kind: 'duplicate-id',
|
|
15
|
+
registryKind: 'shell-widget',
|
|
16
|
+
duplicateId: entry.definition.id,
|
|
17
|
+
existing: createShellWidgetRegistryEntryMetadata(existingEntry),
|
|
18
|
+
incoming: createShellWidgetRegistryEntryMetadata(entry),
|
|
19
|
+
existingRegistrationOrder: this.registrationOrders.get(entry.definition.id) ?? 0,
|
|
20
|
+
incomingRegistrationOrder,
|
|
21
|
+
resolutionPolicy: 'first-registration-wins'
|
|
22
|
+
});
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.entries.set(entry.definition.id, entry);
|
|
26
|
+
this.registrationOrders.set(entry.definition.id, incomingRegistrationOrder);
|
|
27
|
+
}
|
|
28
|
+
get(widgetId) {
|
|
29
|
+
return this.entries.get(widgetId);
|
|
30
|
+
}
|
|
31
|
+
getDefinition(widgetId) {
|
|
32
|
+
return this.entries.get(widgetId)?.definition;
|
|
33
|
+
}
|
|
34
|
+
list() {
|
|
35
|
+
return [...this.entries.values()].map((entry) => entry.definition);
|
|
36
|
+
}
|
|
37
|
+
listByRegion(regionId) {
|
|
38
|
+
return [...this.entries.values()].filter((entry) => entry.definition.defaultRegion === regionId);
|
|
39
|
+
}
|
|
40
|
+
listDiagnostics() {
|
|
41
|
+
return this.duplicateDiagnostics.map(cloneShellWidgetRegistryDuplicateDiagnostic);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function createShellWidgetRegistryEntryMetadata(entry) {
|
|
45
|
+
return {
|
|
46
|
+
id: entry.definition.id,
|
|
47
|
+
title: entry.definition.title,
|
|
48
|
+
description: entry.definition.description,
|
|
49
|
+
defaultRegion: entry.definition.defaultRegion,
|
|
50
|
+
scope: entry.definition.scope,
|
|
51
|
+
componentMode: resolveShellWidgetComponentMode(entry)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function resolveShellWidgetComponentMode(entry) {
|
|
55
|
+
if (entry.component && entry.loadComponent) {
|
|
56
|
+
return 'component-and-loader';
|
|
57
|
+
}
|
|
58
|
+
return entry.component ? 'component' : 'loader';
|
|
59
|
+
}
|
|
60
|
+
function cloneShellWidgetRegistryDuplicateDiagnostic(diagnostic) {
|
|
61
|
+
return {
|
|
62
|
+
...diagnostic,
|
|
63
|
+
existing: { ...diagnostic.existing },
|
|
64
|
+
incoming: { ...diagnostic.incoming }
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WorkbenchWidgetCatalogPort, WorkbenchWidgetDefinition } from "../../domain/widget/model.js";
|
|
2
|
+
import type { WorkbenchWidgetZoneSurface } from "../../domain/widget/composition.js";
|
|
3
|
+
export type RegisteredWorkbenchWidgetComponent = unknown;
|
|
4
|
+
export type RegisteredWorkbenchWidgetComponentModule = {
|
|
5
|
+
default: RegisteredWorkbenchWidgetComponent;
|
|
6
|
+
};
|
|
7
|
+
export type RegisteredWorkbenchWidgetComponentLoader = () => Promise<RegisteredWorkbenchWidgetComponent | RegisteredWorkbenchWidgetComponentModule>;
|
|
8
|
+
export interface RegisteredWorkbenchWidget {
|
|
9
|
+
definition: WorkbenchWidgetDefinition;
|
|
10
|
+
component?: RegisteredWorkbenchWidgetComponent;
|
|
11
|
+
loadComponent?: RegisteredWorkbenchWidgetComponentLoader;
|
|
12
|
+
}
|
|
13
|
+
export declare class InMemoryWorkbenchWidgetRegistry implements WorkbenchWidgetCatalogPort {
|
|
14
|
+
private readonly entries;
|
|
15
|
+
register(entry: RegisteredWorkbenchWidget): void;
|
|
16
|
+
get(widgetId: string): RegisteredWorkbenchWidget | undefined;
|
|
17
|
+
getDefinition(widgetId: string): WorkbenchWidgetDefinition | undefined;
|
|
18
|
+
list(): WorkbenchWidgetDefinition[];
|
|
19
|
+
listBySurface(surface: WorkbenchWidgetZoneSurface): RegisteredWorkbenchWidget[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export class InMemoryWorkbenchWidgetRegistry {
|
|
2
|
+
entries = new Map();
|
|
3
|
+
register(entry) {
|
|
4
|
+
if (!entry.component && !entry.loadComponent) {
|
|
5
|
+
throw new Error(`Workbench widget "${entry.definition.id}" must register a component or component loader.`);
|
|
6
|
+
}
|
|
7
|
+
this.entries.set(entry.definition.id, {
|
|
8
|
+
...entry,
|
|
9
|
+
definition: cloneWorkbenchWidgetDefinition(entry.definition)
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
get(widgetId) {
|
|
13
|
+
return this.entries.get(widgetId);
|
|
14
|
+
}
|
|
15
|
+
getDefinition(widgetId) {
|
|
16
|
+
const definition = this.entries.get(widgetId)?.definition;
|
|
17
|
+
return definition ? cloneWorkbenchWidgetDefinition(definition) : undefined;
|
|
18
|
+
}
|
|
19
|
+
list() {
|
|
20
|
+
return [...this.entries.values()].map((entry) => cloneWorkbenchWidgetDefinition(entry.definition));
|
|
21
|
+
}
|
|
22
|
+
listBySurface(surface) {
|
|
23
|
+
return [...this.entries.values()]
|
|
24
|
+
.filter((entry) => {
|
|
25
|
+
const supportedSurfaces = entry.definition.supportedSurfaces;
|
|
26
|
+
return !supportedSurfaces?.length || supportedSurfaces.includes(surface);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function cloneWorkbenchWidgetDefinition(definition) {
|
|
31
|
+
return {
|
|
32
|
+
...definition,
|
|
33
|
+
supportedSurfaces: definition.supportedSurfaces ? [...definition.supportedSurfaces] : undefined
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorkbenchCatalog, WorkbenchDefinition } from "../../domain/workbench/model.js";
|
|
2
|
+
export declare class InMemoryWorkbenchRegistry implements WorkbenchCatalog {
|
|
3
|
+
private readonly entries;
|
|
4
|
+
register(definition: WorkbenchDefinition): void;
|
|
5
|
+
getDefinition(workbenchId: string): WorkbenchDefinition | undefined;
|
|
6
|
+
list(): WorkbenchDefinition[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class InMemoryWorkbenchRegistry {
|
|
2
|
+
entries = new Map();
|
|
3
|
+
register(definition) {
|
|
4
|
+
this.entries.set(definition.id, {
|
|
5
|
+
...definition,
|
|
6
|
+
toolIds: [...definition.toolIds],
|
|
7
|
+
shellWidgetIds: definition.shellWidgetIds ? [...definition.shellWidgetIds] : undefined
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
getDefinition(workbenchId) {
|
|
11
|
+
const entry = this.entries.get(workbenchId);
|
|
12
|
+
if (!entry) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
...entry,
|
|
17
|
+
toolIds: [...entry.toolIds],
|
|
18
|
+
shellWidgetIds: entry.shellWidgetIds ? [...entry.shellWidgetIds] : undefined
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
list() {
|
|
22
|
+
return [...this.entries.values()].map((entry) => ({
|
|
23
|
+
...entry,
|
|
24
|
+
toolIds: [...entry.toolIds],
|
|
25
|
+
shellWidgetIds: entry.shellWidgetIds ? [...entry.shellWidgetIds] : undefined
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Headless physics kernel. Backend construction and stepping remain caller-driven. */
|
|
2
|
+
export type * from "./domain/physics/contracts.js";
|
|
3
|
+
export { PhysicsService, type PhysicsServiceOptions } from "./application/physics/PhysicsService.js";
|
|
4
|
+
export { NoopPhysicsBackend } from "./application/physics/NoopPhysicsBackend.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StageEasingName } from "./types.js";
|
|
2
|
+
export type StageEasingFunction = (t: number) => number;
|
|
3
|
+
export declare const stageEasing: Record<StageEasingName, StageEasingFunction>;
|
|
4
|
+
export declare function clampStageProgress(value: number): number;
|
|
5
|
+
export declare function easeStageProgress(value: number, easing?: StageEasingName): number;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const stageEasing = {
|
|
2
|
+
linear: (t) => t,
|
|
3
|
+
easeIn: (t) => t * t,
|
|
4
|
+
easeOut: (t) => 1 - (1 - t) * (1 - t),
|
|
5
|
+
easeInOut: (t) => (t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2),
|
|
6
|
+
};
|
|
7
|
+
export function clampStageProgress(value) {
|
|
8
|
+
if (!Number.isFinite(value)) {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
return Math.min(1, Math.max(0, value));
|
|
12
|
+
}
|
|
13
|
+
export function easeStageProgress(value, easing = 'linear') {
|
|
14
|
+
return stageEasing[easing](clampStageProgress(value));
|
|
15
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { StageAmbientProjection, StageAmbientState, StageCamera, StageNode, StageProjectedNode, StageProjection, StageState, StageViewport } from "./types.js";
|
|
2
|
+
export declare function projectStageState(state: StageState, viewport: StageViewport): StageProjection;
|
|
3
|
+
export declare function projectStageNode(node: StageNode, camera: StageCamera, viewport: StageViewport): StageProjectedNode;
|
|
4
|
+
export declare function projectStageAmbient(ambient: StageAmbientState | undefined, nodes: readonly StageProjectedNode[], viewport: StageViewport): StageAmbientProjection;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export function projectStageState(state, viewport) {
|
|
2
|
+
const projectedNodes = Object.values(state.nodes)
|
|
3
|
+
.map((node) => projectStageNode(node, state.camera, viewport))
|
|
4
|
+
.sort((a, b) => a.zIndex - b.zIndex || a.depth - b.depth);
|
|
5
|
+
return {
|
|
6
|
+
viewport: { ...viewport },
|
|
7
|
+
camera: {
|
|
8
|
+
position: { ...state.camera.position },
|
|
9
|
+
rotation: { ...state.camera.rotation },
|
|
10
|
+
perspective: state.camera.perspective,
|
|
11
|
+
},
|
|
12
|
+
nodes: projectedNodes,
|
|
13
|
+
ambient: projectStageAmbient(state.ambient, projectedNodes, viewport),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function projectStageNode(node, camera, viewport) {
|
|
17
|
+
const relativeX = node.position.x - camera.position.x;
|
|
18
|
+
const relativeY = node.position.y - camera.position.y;
|
|
19
|
+
const relativeZ = node.position.z - camera.position.z;
|
|
20
|
+
const depth = Math.max(1, camera.perspective + relativeZ);
|
|
21
|
+
const perspectiveScale = camera.perspective / depth;
|
|
22
|
+
const scale = ((node.scale.x + node.scale.y) / 2) * perspectiveScale;
|
|
23
|
+
const x = viewport.width / 2 + relativeX * perspectiveScale;
|
|
24
|
+
const y = viewport.height / 2 + relativeY * perspectiveScale;
|
|
25
|
+
const zIndex = node.zIndex ?? Math.round(10000 - depth);
|
|
26
|
+
return {
|
|
27
|
+
id: node.id,
|
|
28
|
+
kind: node.kind,
|
|
29
|
+
visible: node.visible,
|
|
30
|
+
opacity: node.opacity,
|
|
31
|
+
x,
|
|
32
|
+
y,
|
|
33
|
+
depth,
|
|
34
|
+
scale,
|
|
35
|
+
zIndex,
|
|
36
|
+
transform: createStageNodeTransform(x, y, node.rotation.z - camera.rotation.z, scale),
|
|
37
|
+
metadata: node.metadata ? { ...node.metadata } : undefined,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export function projectStageAmbient(ambient, nodes, viewport) {
|
|
41
|
+
const focusNode = ambient?.focusNodeId
|
|
42
|
+
? nodes.find((node) => node.id === ambient.focusNodeId && node.visible)
|
|
43
|
+
: nodes.find((node) => node.visible);
|
|
44
|
+
const focusPoint = focusNode
|
|
45
|
+
? { x: focusNode.x / Math.max(1, viewport.width), y: focusNode.y / Math.max(1, viewport.height) }
|
|
46
|
+
: { x: 0.5, y: 0.5 };
|
|
47
|
+
const focusDepth = focusNode ? normalizeStageDepth(focusNode.depth) : 0.5;
|
|
48
|
+
return {
|
|
49
|
+
focusPoint,
|
|
50
|
+
focusDepth,
|
|
51
|
+
depthIntensity: clampAmbientValue(ambient?.depthIntensity ?? 0.5),
|
|
52
|
+
fogIntensity: clampAmbientValue(ambient?.fogIntensity ?? 0.32),
|
|
53
|
+
lightIntensity: clampAmbientValue(ambient?.lightIntensity ?? 0.55),
|
|
54
|
+
motionIntensity: clampAmbientValue(ambient?.motionIntensity ?? 0.22),
|
|
55
|
+
parallaxIntensity: clampAmbientValue(ambient?.parallaxIntensity ?? 0.35),
|
|
56
|
+
tint: ambient?.tint,
|
|
57
|
+
metadata: ambient?.metadata ? { ...ambient.metadata } : undefined,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function createStageNodeTransform(x, y, rotationZ, scale) {
|
|
61
|
+
return `translate3d(${roundStageNumber(x)}px, ${roundStageNumber(y)}px, 0) rotate(${roundStageNumber(rotationZ)}deg) scale(${roundStageNumber(scale)})`;
|
|
62
|
+
}
|
|
63
|
+
function normalizeStageDepth(depth) {
|
|
64
|
+
return clampAmbientValue(depth / 1800);
|
|
65
|
+
}
|
|
66
|
+
function clampAmbientValue(value) {
|
|
67
|
+
if (!Number.isFinite(value)) {
|
|
68
|
+
return 0;
|
|
69
|
+
}
|
|
70
|
+
return Math.min(1, Math.max(0, value));
|
|
71
|
+
}
|
|
72
|
+
function roundStageNumber(value) {
|
|
73
|
+
return Math.round(value * 1000) / 1000;
|
|
74
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { applyStageTimeline, cloneStageState } from "./timeline.js";
|
|
2
|
+
export function createStageRuntime(initialState) {
|
|
3
|
+
let state = cloneStageState(initialState);
|
|
4
|
+
const listeners = new Set();
|
|
5
|
+
function notify() {
|
|
6
|
+
const snapshot = cloneStageState(state);
|
|
7
|
+
for (const listener of listeners) {
|
|
8
|
+
listener(cloneStageState(snapshot));
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
getState() {
|
|
13
|
+
return cloneStageState(state);
|
|
14
|
+
},
|
|
15
|
+
setState(nextState) {
|
|
16
|
+
state = cloneStageState(nextState);
|
|
17
|
+
notify();
|
|
18
|
+
},
|
|
19
|
+
subscribe(listener) {
|
|
20
|
+
listeners.add(listener);
|
|
21
|
+
listener(cloneStageState(state));
|
|
22
|
+
return () => {
|
|
23
|
+
listeners.delete(listener);
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
applyTimeline(timeline, timeMs) {
|
|
27
|
+
state = applyStageTimeline(state, timeline, timeMs);
|
|
28
|
+
notify();
|
|
29
|
+
return cloneStageState(state);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { resolveStageTrackValue, setStageTweenValue } from "./tween.js";
|
|
2
|
+
export function applyStageTimeline(state, timeline, timeMs) {
|
|
3
|
+
const nextState = cloneStageState(state);
|
|
4
|
+
const clampedTime = Math.min(Math.max(0, timeMs), Math.max(0, timeline.duration));
|
|
5
|
+
for (const track of timeline.tracks) {
|
|
6
|
+
const value = resolveStageTrackValue(track, clampedTime);
|
|
7
|
+
if (value !== undefined) {
|
|
8
|
+
setStageTweenValue(nextState, track.targetId, track.property, value);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return nextState;
|
|
12
|
+
}
|
|
13
|
+
export function cloneStageState(state) {
|
|
14
|
+
return {
|
|
15
|
+
camera: {
|
|
16
|
+
position: { ...state.camera.position },
|
|
17
|
+
rotation: { ...state.camera.rotation },
|
|
18
|
+
perspective: state.camera.perspective,
|
|
19
|
+
},
|
|
20
|
+
ambient: state.ambient
|
|
21
|
+
? {
|
|
22
|
+
...state.ambient,
|
|
23
|
+
metadata: state.ambient.metadata ? cloneStageMetadata(state.ambient.metadata) : undefined,
|
|
24
|
+
}
|
|
25
|
+
: undefined,
|
|
26
|
+
nodes: Object.fromEntries(Object.entries(state.nodes).map(([id, node]) => [
|
|
27
|
+
id,
|
|
28
|
+
{
|
|
29
|
+
...node,
|
|
30
|
+
position: { ...node.position },
|
|
31
|
+
rotation: { ...node.rotation },
|
|
32
|
+
scale: { ...node.scale },
|
|
33
|
+
metadata: node.metadata ? cloneStageMetadata(node.metadata) : undefined,
|
|
34
|
+
},
|
|
35
|
+
])),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/** Stage metadata is data, not a container for runtime resources or callbacks. */
|
|
39
|
+
function cloneStageMetadata(value) {
|
|
40
|
+
const ancestors = new Set();
|
|
41
|
+
function copy(input) {
|
|
42
|
+
if (input === null || input === undefined || typeof input === 'string' || typeof input === 'boolean')
|
|
43
|
+
return input;
|
|
44
|
+
if (typeof input === 'number' && Number.isFinite(input))
|
|
45
|
+
return input;
|
|
46
|
+
if (typeof input !== 'object' || input === null)
|
|
47
|
+
throw new TypeError('Unsupported Stage metadata value');
|
|
48
|
+
const array = Array.isArray(input);
|
|
49
|
+
if (!array && Object.getPrototypeOf(input) !== Object.prototype && Object.getPrototypeOf(input) !== null) {
|
|
50
|
+
throw new TypeError('Stage metadata must contain plain data');
|
|
51
|
+
}
|
|
52
|
+
if (ancestors.has(input))
|
|
53
|
+
throw new TypeError('Cyclic Stage metadata');
|
|
54
|
+
ancestors.add(input);
|
|
55
|
+
const result = array ? new Array(input.length) : {};
|
|
56
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
57
|
+
if (array && key === 'length')
|
|
58
|
+
continue;
|
|
59
|
+
const descriptor = Object.getOwnPropertyDescriptor(input, key);
|
|
60
|
+
if (typeof key !== 'string' || !('value' in descriptor))
|
|
61
|
+
throw new TypeError('Stage metadata cannot contain symbols or accessors');
|
|
62
|
+
Object.defineProperty(result, key, { value: copy(descriptor.value), enumerable: descriptor.enumerable,
|
|
63
|
+
configurable: true, writable: true });
|
|
64
|
+
}
|
|
65
|
+
ancestors.delete(input);
|
|
66
|
+
return result;
|
|
67
|
+
}
|
|
68
|
+
return copy(value);
|
|
69
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { StageState, StageTimelineTrack, StageTweenProperty } from "./types.js";
|
|
2
|
+
export declare function resolveStageTrackValue(track: StageTimelineTrack, timeMs: number): number | boolean | undefined;
|
|
3
|
+
export declare function setStageTweenValue(state: StageState, targetId: string, property: StageTweenProperty, value: number | boolean): void;
|