@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,48 @@
|
|
|
1
|
+
export function normalizeProjectionCatalogFromWorkspace(workspace) {
|
|
2
|
+
if (!workspace) {
|
|
3
|
+
return [];
|
|
4
|
+
}
|
|
5
|
+
return Object.entries(workspace.projections)
|
|
6
|
+
.map(([projectionKind, sources]) => ({
|
|
7
|
+
projectionKind,
|
|
8
|
+
version: 'workspace-catalog',
|
|
9
|
+
sources: Array.isArray(sources) ? [...sources] : []
|
|
10
|
+
}))
|
|
11
|
+
.sort(compareProjectionCatalogEntries);
|
|
12
|
+
}
|
|
13
|
+
export function normalizeProjectionCatalogFromEvent(payload, fallback) {
|
|
14
|
+
if (!payload || typeof payload !== 'object') {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
const eventPayload = payload;
|
|
18
|
+
const projectors = Array.isArray(eventPayload.projectors) ? eventPayload.projectors : null;
|
|
19
|
+
if (projectors) {
|
|
20
|
+
return projectors
|
|
21
|
+
.map(normalizeProjectionCatalogEntry)
|
|
22
|
+
.filter((entry) => Boolean(entry))
|
|
23
|
+
.sort(compareProjectionCatalogEntries);
|
|
24
|
+
}
|
|
25
|
+
const entry = normalizeProjectionCatalogEntry(eventPayload);
|
|
26
|
+
return entry ? [entry] : fallback;
|
|
27
|
+
}
|
|
28
|
+
export function normalizeProjectionCatalogEntry(value) {
|
|
29
|
+
if (!value || typeof value !== 'object') {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const payload = value;
|
|
33
|
+
const projectionKind = typeof payload.projectionKind === 'string' ? payload.projectionKind : null;
|
|
34
|
+
const version = typeof payload.version === 'string' ? payload.version : 'runtime-catalog';
|
|
35
|
+
const sources = Array.isArray(payload.sources)
|
|
36
|
+
? payload.sources.filter((source) => typeof source === 'string')
|
|
37
|
+
: [];
|
|
38
|
+
return projectionKind
|
|
39
|
+
? {
|
|
40
|
+
projectionKind,
|
|
41
|
+
version,
|
|
42
|
+
sources
|
|
43
|
+
}
|
|
44
|
+
: null;
|
|
45
|
+
}
|
|
46
|
+
export function compareProjectionCatalogEntries(left, right) {
|
|
47
|
+
return left.projectionKind.localeCompare(right.projectionKind);
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX, createRuntimeProjectionSessionKey, createRuntimeProjectionSessionSharedStateKey, isRuntimeProjectionSessionSharedStateKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
export { createRuntimeProjectionSessionPatchFromEntry, normalizeRuntimeProjectionSessionEntry, serializeRuntimeProjectionSessionEntry } from "./RuntimeProjectionSessionSerialization.js";
|
|
3
|
+
export { mergeRuntimeProjectionSessionSharedStateEntries } from "./RuntimeProjectionSessionSharedState.js";
|
|
4
|
+
export { createRuntimeProjectionSessionState, getActiveRuntimeProjectionSessionEntry, listRuntimeProjectionSessionEntries, patchRuntimeProjectionSessionEntry, removeRuntimeProjectionSessionToolInstance, upsertRuntimeProjectionSessionEntry } from "./RuntimeProjectionSessionReducers.js";
|
|
5
|
+
export type { RuntimeProjectionSessionEntry, RuntimeProjectionSessionOpenInput, RuntimeProjectionSessionPatch, RuntimeProjectionSessionSharedStateMergeResult, RuntimeProjectionSessionState, RuntimeProjectionSessionStatus } from "./RuntimeProjectionSessionTypes.js";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX, createRuntimeProjectionSessionKey, createRuntimeProjectionSessionSharedStateKey, isRuntimeProjectionSessionSharedStateKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
export { createRuntimeProjectionSessionPatchFromEntry, normalizeRuntimeProjectionSessionEntry, serializeRuntimeProjectionSessionEntry } from "./RuntimeProjectionSessionSerialization.js";
|
|
3
|
+
export { mergeRuntimeProjectionSessionSharedStateEntries } from "./RuntimeProjectionSessionSharedState.js";
|
|
4
|
+
export { createRuntimeProjectionSessionState, getActiveRuntimeProjectionSessionEntry, listRuntimeProjectionSessionEntries, patchRuntimeProjectionSessionEntry, removeRuntimeProjectionSessionToolInstance, upsertRuntimeProjectionSessionEntry } from "./RuntimeProjectionSessionReducers.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeProjectionTarget } from "../../domain/runtime/model.js";
|
|
2
|
+
export declare const RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX = "runtime.projection-session:";
|
|
3
|
+
export declare function createRuntimeProjectionSessionKey(target: WorkbenchRuntimeProjectionTarget): string;
|
|
4
|
+
export declare function createRuntimeProjectionSessionSharedStateKey(target: WorkbenchRuntimeProjectionTarget): string;
|
|
5
|
+
export declare function isRuntimeProjectionSessionSharedStateKey(key: string): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX = 'runtime.projection-session:';
|
|
2
|
+
export function createRuntimeProjectionSessionKey(target) {
|
|
3
|
+
return `${target.projectionKind}:${target.sourceFile}`;
|
|
4
|
+
}
|
|
5
|
+
export function createRuntimeProjectionSessionSharedStateKey(target) {
|
|
6
|
+
return `${RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX}${createRuntimeProjectionSessionKey(target)}`;
|
|
7
|
+
}
|
|
8
|
+
export function isRuntimeProjectionSessionSharedStateKey(key) {
|
|
9
|
+
return key.startsWith(RUNTIME_PROJECTION_SESSION_SHARED_STATE_PREFIX);
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RuntimeProjectionSessionEntry, RuntimeProjectionSessionOpenInput, RuntimeProjectionSessionPatch, RuntimeProjectionSessionState } from "./RuntimeProjectionSessionTypes.js";
|
|
2
|
+
export declare function createRuntimeProjectionSessionState(entries?: RuntimeProjectionSessionEntry[], activeKey?: string | null): RuntimeProjectionSessionState;
|
|
3
|
+
export declare function upsertRuntimeProjectionSessionEntry(state: RuntimeProjectionSessionState, input: RuntimeProjectionSessionOpenInput): RuntimeProjectionSessionState;
|
|
4
|
+
export declare function patchRuntimeProjectionSessionEntry(state: RuntimeProjectionSessionState, patch: RuntimeProjectionSessionPatch): RuntimeProjectionSessionState;
|
|
5
|
+
export declare function removeRuntimeProjectionSessionToolInstance(state: RuntimeProjectionSessionState, toolInstanceId: string): RuntimeProjectionSessionState;
|
|
6
|
+
export declare function listRuntimeProjectionSessionEntries(state: RuntimeProjectionSessionState): RuntimeProjectionSessionEntry[];
|
|
7
|
+
export declare function getActiveRuntimeProjectionSessionEntry(state: RuntimeProjectionSessionState): RuntimeProjectionSessionEntry | null;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { createRuntimeProjectionSessionKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
export function createRuntimeProjectionSessionState(entries = [], activeKey = null) {
|
|
3
|
+
const entriesByKey = Object.fromEntries(entries.map((entry) => [entry.key, cloneRuntimeProjectionSessionEntry(entry)]));
|
|
4
|
+
const fallbackActiveKey = activeKey && entriesByKey[activeKey] ? activeKey : entries[0]?.key ?? null;
|
|
5
|
+
return {
|
|
6
|
+
activeKey: fallbackActiveKey,
|
|
7
|
+
entries: entriesByKey
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function upsertRuntimeProjectionSessionEntry(state, input) {
|
|
11
|
+
const key = createRuntimeProjectionSessionKey(input.target);
|
|
12
|
+
const now = input.now ?? new Date().toISOString();
|
|
13
|
+
const previous = state.entries[key] ?? null;
|
|
14
|
+
const toolInstanceIds = input.toolInstanceId
|
|
15
|
+
? appendUnique(previous?.toolInstanceIds ?? [], input.toolInstanceId)
|
|
16
|
+
: previous?.toolInstanceIds ?? [];
|
|
17
|
+
return {
|
|
18
|
+
activeKey: key,
|
|
19
|
+
entries: {
|
|
20
|
+
...state.entries,
|
|
21
|
+
[key]: {
|
|
22
|
+
key,
|
|
23
|
+
target: { ...input.target },
|
|
24
|
+
viewerId: input.viewerId,
|
|
25
|
+
viewerTitle: input.viewerTitle ?? previous?.viewerTitle ?? input.viewerId,
|
|
26
|
+
toolInstanceIds,
|
|
27
|
+
status: input.status ?? 'open',
|
|
28
|
+
selectedEntityId: previous?.selectedEntityId ?? null,
|
|
29
|
+
focusedEntityId: previous?.focusedEntityId ?? null,
|
|
30
|
+
openedAt: previous?.openedAt ?? now,
|
|
31
|
+
updatedAt: now,
|
|
32
|
+
lastError: null
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function patchRuntimeProjectionSessionEntry(state, patch) {
|
|
38
|
+
const key = createRuntimeProjectionSessionKey(patch.target);
|
|
39
|
+
const previous = state.entries[key];
|
|
40
|
+
if (!previous) {
|
|
41
|
+
return state;
|
|
42
|
+
}
|
|
43
|
+
const now = patch.now ?? new Date().toISOString();
|
|
44
|
+
const nextToolInstanceIds = patch.toolInstanceId
|
|
45
|
+
? appendUnique(previous.toolInstanceIds, patch.toolInstanceId)
|
|
46
|
+
: previous.toolInstanceIds;
|
|
47
|
+
return {
|
|
48
|
+
...state,
|
|
49
|
+
activeKey: state.activeKey ?? key,
|
|
50
|
+
entries: {
|
|
51
|
+
...state.entries,
|
|
52
|
+
[key]: {
|
|
53
|
+
...previous,
|
|
54
|
+
viewerId: patch.viewerId ?? previous.viewerId,
|
|
55
|
+
toolInstanceIds: nextToolInstanceIds,
|
|
56
|
+
status: patch.status ?? previous.status,
|
|
57
|
+
selectedEntityId: patch.selectedEntityId === undefined ? previous.selectedEntityId : patch.selectedEntityId,
|
|
58
|
+
focusedEntityId: patch.focusedEntityId === undefined ? previous.focusedEntityId : patch.focusedEntityId,
|
|
59
|
+
updatedAt: now,
|
|
60
|
+
lastError: patch.lastError === undefined ? previous.lastError : patch.lastError
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function removeRuntimeProjectionSessionToolInstance(state, toolInstanceId) {
|
|
66
|
+
const nextEntries = {};
|
|
67
|
+
for (const [key, entry] of Object.entries(state.entries)) {
|
|
68
|
+
const nextToolInstanceIds = entry.toolInstanceIds.filter((id) => id !== toolInstanceId);
|
|
69
|
+
if (nextToolInstanceIds.length > 0) {
|
|
70
|
+
nextEntries[key] = {
|
|
71
|
+
...entry,
|
|
72
|
+
toolInstanceIds: nextToolInstanceIds
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const activeKey = state.activeKey && nextEntries[state.activeKey] ? state.activeKey : Object.keys(nextEntries)[0] ?? null;
|
|
77
|
+
return {
|
|
78
|
+
activeKey,
|
|
79
|
+
entries: nextEntries
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
export function listRuntimeProjectionSessionEntries(state) {
|
|
83
|
+
return Object.values(state.entries)
|
|
84
|
+
.map(cloneRuntimeProjectionSessionEntry)
|
|
85
|
+
.sort((left, right) => Date.parse(right.updatedAt) - Date.parse(left.updatedAt));
|
|
86
|
+
}
|
|
87
|
+
export function getActiveRuntimeProjectionSessionEntry(state) {
|
|
88
|
+
return state.activeKey && state.entries[state.activeKey]
|
|
89
|
+
? cloneRuntimeProjectionSessionEntry(state.entries[state.activeKey])
|
|
90
|
+
: null;
|
|
91
|
+
}
|
|
92
|
+
function cloneRuntimeProjectionSessionEntry(entry) {
|
|
93
|
+
return {
|
|
94
|
+
...entry,
|
|
95
|
+
target: { ...entry.target },
|
|
96
|
+
toolInstanceIds: [...entry.toolInstanceIds]
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
function appendUnique(values, nextValue) {
|
|
100
|
+
return values.includes(nextValue) ? values : [...values, nextValue];
|
|
101
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonObject } from "../../domain/shared/json.js";
|
|
2
|
+
import type { RuntimeProjectionSessionEntry, RuntimeProjectionSessionPatch } from "./RuntimeProjectionSessionTypes.js";
|
|
3
|
+
export declare function serializeRuntimeProjectionSessionEntry(entry: RuntimeProjectionSessionEntry): JsonObject;
|
|
4
|
+
export declare function createRuntimeProjectionSessionPatchFromEntry(entry: RuntimeProjectionSessionEntry): RuntimeProjectionSessionPatch;
|
|
5
|
+
export declare function normalizeRuntimeProjectionSessionEntry(input: unknown): RuntimeProjectionSessionEntry | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createRuntimeProjectionSessionKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
export function serializeRuntimeProjectionSessionEntry(entry) {
|
|
3
|
+
return {
|
|
4
|
+
key: entry.key,
|
|
5
|
+
target: {
|
|
6
|
+
projectionKind: entry.target.projectionKind,
|
|
7
|
+
sourceFile: entry.target.sourceFile
|
|
8
|
+
},
|
|
9
|
+
viewerId: entry.viewerId,
|
|
10
|
+
viewerTitle: entry.viewerTitle,
|
|
11
|
+
toolInstanceIds: [...entry.toolInstanceIds],
|
|
12
|
+
status: entry.status,
|
|
13
|
+
selectedEntityId: entry.selectedEntityId,
|
|
14
|
+
focusedEntityId: entry.focusedEntityId,
|
|
15
|
+
openedAt: entry.openedAt,
|
|
16
|
+
updatedAt: entry.updatedAt,
|
|
17
|
+
lastError: entry.lastError
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function createRuntimeProjectionSessionPatchFromEntry(entry) {
|
|
21
|
+
return {
|
|
22
|
+
target: {
|
|
23
|
+
projectionKind: entry.target.projectionKind,
|
|
24
|
+
sourceFile: entry.target.sourceFile
|
|
25
|
+
},
|
|
26
|
+
viewerId: entry.viewerId,
|
|
27
|
+
status: entry.status,
|
|
28
|
+
selectedEntityId: entry.selectedEntityId,
|
|
29
|
+
focusedEntityId: entry.focusedEntityId,
|
|
30
|
+
lastError: entry.lastError,
|
|
31
|
+
now: entry.updatedAt
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function normalizeRuntimeProjectionSessionEntry(input) {
|
|
35
|
+
if (!input || typeof input !== 'object') {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const record = input;
|
|
39
|
+
const target = normalizeRuntimeProjectionSessionTarget(record.target);
|
|
40
|
+
if (!target) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
const key = typeof record.key === 'string' ? record.key : createRuntimeProjectionSessionKey(target);
|
|
44
|
+
const viewerId = typeof record.viewerId === 'string' ? record.viewerId : null;
|
|
45
|
+
if (key !== createRuntimeProjectionSessionKey(target) || !viewerId) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
key,
|
|
50
|
+
target,
|
|
51
|
+
viewerId,
|
|
52
|
+
viewerTitle: typeof record.viewerTitle === 'string' ? record.viewerTitle : viewerId,
|
|
53
|
+
toolInstanceIds: Array.isArray(record.toolInstanceIds)
|
|
54
|
+
? record.toolInstanceIds.filter((id) => typeof id === 'string')
|
|
55
|
+
: [],
|
|
56
|
+
status: normalizeRuntimeProjectionSessionStatus(record.status),
|
|
57
|
+
selectedEntityId: normalizeNullableString(record.selectedEntityId),
|
|
58
|
+
focusedEntityId: normalizeNullableString(record.focusedEntityId),
|
|
59
|
+
openedAt: typeof record.openedAt === 'string' ? record.openedAt : '',
|
|
60
|
+
updatedAt: typeof record.updatedAt === 'string' ? record.updatedAt : '',
|
|
61
|
+
lastError: normalizeNullableString(record.lastError)
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function normalizeRuntimeProjectionSessionTarget(input) {
|
|
65
|
+
if (!input || typeof input !== 'object') {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const record = input;
|
|
69
|
+
const projectionKind = typeof record.projectionKind === 'string' ? record.projectionKind : null;
|
|
70
|
+
const sourceFile = typeof record.sourceFile === 'string' ? record.sourceFile : null;
|
|
71
|
+
return projectionKind && sourceFile
|
|
72
|
+
? {
|
|
73
|
+
projectionKind,
|
|
74
|
+
sourceFile
|
|
75
|
+
}
|
|
76
|
+
: null;
|
|
77
|
+
}
|
|
78
|
+
function normalizeRuntimeProjectionSessionStatus(input) {
|
|
79
|
+
return input === 'opening' ||
|
|
80
|
+
input === 'open' ||
|
|
81
|
+
input === 'refreshing' ||
|
|
82
|
+
input === 'stale' ||
|
|
83
|
+
input === 'error'
|
|
84
|
+
? input
|
|
85
|
+
: 'open';
|
|
86
|
+
}
|
|
87
|
+
function normalizeNullableString(input) {
|
|
88
|
+
return typeof input === 'string' ? input : null;
|
|
89
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeSharedStateEntry } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { RuntimeProjectionSessionSharedStateMergeResult, RuntimeProjectionSessionState } from "./RuntimeProjectionSessionTypes.js";
|
|
3
|
+
export declare function mergeRuntimeProjectionSessionSharedStateEntries(state: RuntimeProjectionSessionState, sharedStateEntries: WorkbenchRuntimeSharedStateEntry[]): RuntimeProjectionSessionSharedStateMergeResult;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { createRuntimeProjectionSessionSharedStateKey, isRuntimeProjectionSessionSharedStateKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
import { normalizeRuntimeProjectionSessionEntry, serializeRuntimeProjectionSessionEntry } from "./RuntimeProjectionSessionSerialization.js";
|
|
3
|
+
export function mergeRuntimeProjectionSessionSharedStateEntries(state, sharedStateEntries) {
|
|
4
|
+
let nextState = state;
|
|
5
|
+
const signatures = {};
|
|
6
|
+
const changedEntries = [];
|
|
7
|
+
let changed = false;
|
|
8
|
+
for (const sharedStateEntry of sharedStateEntries) {
|
|
9
|
+
if (sharedStateEntry.scope !== 'session' ||
|
|
10
|
+
!isRuntimeProjectionSessionSharedStateKey(sharedStateEntry.key)) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const entry = normalizeRuntimeProjectionSessionEntry(sharedStateEntry.value);
|
|
14
|
+
if (!entry || createRuntimeProjectionSessionSharedStateKey(entry.target) !== sharedStateEntry.key) {
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
signatures[entry.key] = JSON.stringify(serializeRuntimeProjectionSessionEntry(entry));
|
|
18
|
+
const previous = nextState.entries[entry.key] ?? null;
|
|
19
|
+
if (previous && compareRuntimeProjectionSessionUpdatedAt(previous.updatedAt, entry.updatedAt) >= 0) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
nextState = {
|
|
23
|
+
activeKey: nextState.activeKey ?? entry.key,
|
|
24
|
+
entries: {
|
|
25
|
+
...nextState.entries,
|
|
26
|
+
[entry.key]: cloneRuntimeProjectionSessionEntry(entry)
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
changedEntries.push(cloneRuntimeProjectionSessionEntry(entry));
|
|
30
|
+
changed = true;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
state: nextState,
|
|
34
|
+
signatures,
|
|
35
|
+
changedEntries,
|
|
36
|
+
changed
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function cloneRuntimeProjectionSessionEntry(entry) {
|
|
40
|
+
return {
|
|
41
|
+
...entry,
|
|
42
|
+
target: { ...entry.target },
|
|
43
|
+
toolInstanceIds: [...entry.toolInstanceIds]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function compareRuntimeProjectionSessionUpdatedAt(left, right) {
|
|
47
|
+
const leftTime = Date.parse(left);
|
|
48
|
+
const rightTime = Date.parse(right);
|
|
49
|
+
if (Number.isFinite(leftTime) && Number.isFinite(rightTime)) {
|
|
50
|
+
return leftTime - rightTime;
|
|
51
|
+
}
|
|
52
|
+
return left.localeCompare(right);
|
|
53
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeProjectionSessionPatch, WorkbenchRuntimeProjectionSessionStatus, WorkbenchRuntimeProjectionTarget } from "../../domain/runtime/model.js";
|
|
2
|
+
export type RuntimeProjectionSessionStatus = WorkbenchRuntimeProjectionSessionStatus;
|
|
3
|
+
export interface RuntimeProjectionSessionEntry {
|
|
4
|
+
key: string;
|
|
5
|
+
target: WorkbenchRuntimeProjectionTarget;
|
|
6
|
+
viewerId: string;
|
|
7
|
+
viewerTitle: string;
|
|
8
|
+
toolInstanceIds: string[];
|
|
9
|
+
status: RuntimeProjectionSessionStatus;
|
|
10
|
+
selectedEntityId: string | null;
|
|
11
|
+
focusedEntityId: string | null;
|
|
12
|
+
openedAt: string;
|
|
13
|
+
updatedAt: string;
|
|
14
|
+
lastError: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface RuntimeProjectionSessionState {
|
|
17
|
+
activeKey: string | null;
|
|
18
|
+
entries: Record<string, RuntimeProjectionSessionEntry>;
|
|
19
|
+
}
|
|
20
|
+
export interface RuntimeProjectionSessionOpenInput {
|
|
21
|
+
target: WorkbenchRuntimeProjectionTarget;
|
|
22
|
+
viewerId: string;
|
|
23
|
+
viewerTitle?: string;
|
|
24
|
+
toolInstanceId?: string | null;
|
|
25
|
+
status?: RuntimeProjectionSessionStatus;
|
|
26
|
+
now?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RuntimeProjectionSessionPatch extends WorkbenchRuntimeProjectionSessionPatch {
|
|
29
|
+
viewerId?: string | null;
|
|
30
|
+
toolInstanceId?: string | null;
|
|
31
|
+
now?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface RuntimeProjectionSessionSharedStateMergeResult {
|
|
34
|
+
state: RuntimeProjectionSessionState;
|
|
35
|
+
signatures: Record<string, string>;
|
|
36
|
+
changedEntries: RuntimeProjectionSessionEntry[];
|
|
37
|
+
changed: boolean;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeSharedStateEntry } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { JsonObject } from "../../domain/shared/json.js";
|
|
3
|
+
import type { ToolInstance } from "../../domain/tool/model.js";
|
|
4
|
+
import type { InMemorySurfaceViewerRegistry } from "../../infrastructure/surfaces/InMemorySurfaceViewerRegistry.js";
|
|
5
|
+
import type { RuntimeProjectionSessionPatch, RuntimeProjectionSessionState } from "./RuntimeProjectionSessionTypes.js";
|
|
6
|
+
export { createRuntimeProjectionSharedStateSignature, filterRuntimeProjectionSharedStateEntriesByOrigin } from "./RuntimeProjectionViewerSessionUpdates.js";
|
|
7
|
+
export interface RuntimeProjectionViewerSessionSyncInput {
|
|
8
|
+
surfaceViewerRegistry: InMemorySurfaceViewerRegistry;
|
|
9
|
+
toolInstances: Record<string, ToolInstance>;
|
|
10
|
+
patch: RuntimeProjectionSessionPatch;
|
|
11
|
+
}
|
|
12
|
+
export interface RuntimeProjectionViewerSessionUpdate {
|
|
13
|
+
toolInstanceId: string;
|
|
14
|
+
nextState: JsonObject;
|
|
15
|
+
}
|
|
16
|
+
export interface RuntimeProjectionSharedStateViewerSessionSyncInput {
|
|
17
|
+
surfaceViewerRegistry: InMemorySurfaceViewerRegistry;
|
|
18
|
+
toolInstances: Record<string, ToolInstance>;
|
|
19
|
+
sessionState: RuntimeProjectionSessionState;
|
|
20
|
+
sharedStateEntries: WorkbenchRuntimeSharedStateEntry[];
|
|
21
|
+
}
|
|
22
|
+
export interface RuntimeProjectionSharedStateViewerSessionSyncResult {
|
|
23
|
+
sessionState: RuntimeProjectionSessionState;
|
|
24
|
+
signatures: Record<string, string>;
|
|
25
|
+
viewerUpdates: RuntimeProjectionViewerSessionUpdate[];
|
|
26
|
+
changed: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function collectRuntimeProjectionViewerSessionUpdates(input: RuntimeProjectionViewerSessionSyncInput): RuntimeProjectionViewerSessionUpdate[];
|
|
29
|
+
export declare function collectRuntimeProjectionSharedStateViewerSessionUpdates(input: RuntimeProjectionSharedStateViewerSessionSyncInput): RuntimeProjectionSharedStateViewerSessionSyncResult;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { collectRuntimeProjectionSharedStateViewerSessionUpdatePlan, collectRuntimeProjectionViewerSessionUpdateRequests } from "./RuntimeProjectionViewerSessionUpdates.js";
|
|
2
|
+
export { createRuntimeProjectionSharedStateSignature, filterRuntimeProjectionSharedStateEntriesByOrigin } from "./RuntimeProjectionViewerSessionUpdates.js";
|
|
3
|
+
export function collectRuntimeProjectionViewerSessionUpdates(input) {
|
|
4
|
+
const updates = [];
|
|
5
|
+
for (const request of collectRuntimeProjectionViewerSessionUpdateRequests(input)) {
|
|
6
|
+
const viewer = input.surfaceViewerRegistry.get(request.toolId);
|
|
7
|
+
if (!viewer?.applyRuntimeProjectionSession ||
|
|
8
|
+
!viewer.definition.projectionKinds.includes(request.patch.target.projectionKind)) {
|
|
9
|
+
continue;
|
|
10
|
+
}
|
|
11
|
+
const nextState = viewer.applyRuntimeProjectionSession({
|
|
12
|
+
toolInstanceId: request.toolInstanceId,
|
|
13
|
+
toolInstance: request.toolInstance,
|
|
14
|
+
viewer: viewer.definition,
|
|
15
|
+
patch: request.patch
|
|
16
|
+
});
|
|
17
|
+
if (nextState) {
|
|
18
|
+
updates.push({
|
|
19
|
+
toolInstanceId: request.toolInstanceId,
|
|
20
|
+
nextState
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return updates;
|
|
25
|
+
}
|
|
26
|
+
export function collectRuntimeProjectionSharedStateViewerSessionUpdates(input) {
|
|
27
|
+
const updatePlan = collectRuntimeProjectionSharedStateViewerSessionUpdatePlan(input);
|
|
28
|
+
const viewerUpdates = updatePlan.patches.flatMap((patch) => collectRuntimeProjectionViewerSessionUpdates({
|
|
29
|
+
surfaceViewerRegistry: input.surfaceViewerRegistry,
|
|
30
|
+
toolInstances: input.toolInstances,
|
|
31
|
+
patch
|
|
32
|
+
}));
|
|
33
|
+
return {
|
|
34
|
+
sessionState: updatePlan.sessionState,
|
|
35
|
+
signatures: updatePlan.signatures,
|
|
36
|
+
viewerUpdates,
|
|
37
|
+
changed: updatePlan.changed
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeSharedStateEntry } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { ToolInstance } from "../../domain/tool/model.js";
|
|
3
|
+
import type { RuntimeProjectionSessionPatch, RuntimeProjectionSessionState } from "./RuntimeProjectionSessionTypes.js";
|
|
4
|
+
export interface RuntimeProjectionViewerSessionUpdateRequestInput {
|
|
5
|
+
toolInstances: Record<string, ToolInstance>;
|
|
6
|
+
patch: RuntimeProjectionSessionPatch;
|
|
7
|
+
}
|
|
8
|
+
export interface RuntimeProjectionViewerSessionUpdateRequest {
|
|
9
|
+
toolInstanceId: string;
|
|
10
|
+
toolId: string;
|
|
11
|
+
toolInstance: ToolInstance;
|
|
12
|
+
patch: RuntimeProjectionSessionPatch;
|
|
13
|
+
}
|
|
14
|
+
export interface RuntimeProjectionSharedStateViewerSessionUpdatePlanInput {
|
|
15
|
+
sessionState: RuntimeProjectionSessionState;
|
|
16
|
+
sharedStateEntries: WorkbenchRuntimeSharedStateEntry[];
|
|
17
|
+
}
|
|
18
|
+
export interface RuntimeProjectionSharedStateViewerSessionUpdatePlan {
|
|
19
|
+
sessionState: RuntimeProjectionSessionState;
|
|
20
|
+
signatures: Record<string, string>;
|
|
21
|
+
patches: RuntimeProjectionSessionPatch[];
|
|
22
|
+
changed: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare function collectRuntimeProjectionViewerSessionUpdateRequests(input: RuntimeProjectionViewerSessionUpdateRequestInput): RuntimeProjectionViewerSessionUpdateRequest[];
|
|
25
|
+
export declare function collectRuntimeProjectionSharedStateViewerSessionUpdatePlan(input: RuntimeProjectionSharedStateViewerSessionUpdatePlanInput): RuntimeProjectionSharedStateViewerSessionUpdatePlan;
|
|
26
|
+
export declare function createRuntimeProjectionSharedStateSignature(entries: WorkbenchRuntimeSharedStateEntry[]): string;
|
|
27
|
+
export declare function filterRuntimeProjectionSharedStateEntriesByOrigin(entries: WorkbenchRuntimeSharedStateEntry[], originClientId: string | null): WorkbenchRuntimeSharedStateEntry[];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { isRuntimeProjectionSessionSharedStateKey } from "./RuntimeProjectionSessionKeys.js";
|
|
2
|
+
import { createRuntimeProjectionSessionPatchFromEntry } from "./RuntimeProjectionSessionSerialization.js";
|
|
3
|
+
import { mergeRuntimeProjectionSessionSharedStateEntries } from "./RuntimeProjectionSessionSharedState.js";
|
|
4
|
+
export function collectRuntimeProjectionViewerSessionUpdateRequests(input) {
|
|
5
|
+
const requests = [];
|
|
6
|
+
for (const [toolInstanceId, toolInstance] of Object.entries(input.toolInstances)) {
|
|
7
|
+
if (toolInstanceId === input.patch.toolInstanceId || !toolInstance.toolId) {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
requests.push({
|
|
11
|
+
toolInstanceId,
|
|
12
|
+
toolId: toolInstance.toolId,
|
|
13
|
+
toolInstance,
|
|
14
|
+
patch: input.patch
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
return requests;
|
|
18
|
+
}
|
|
19
|
+
export function collectRuntimeProjectionSharedStateViewerSessionUpdatePlan(input) {
|
|
20
|
+
const mergeResult = mergeRuntimeProjectionSessionSharedStateEntries(input.sessionState, input.sharedStateEntries);
|
|
21
|
+
return {
|
|
22
|
+
sessionState: mergeResult.state,
|
|
23
|
+
signatures: mergeResult.signatures,
|
|
24
|
+
patches: mergeResult.changedEntries.map(createRuntimeProjectionSessionPatchFromEntry),
|
|
25
|
+
changed: mergeResult.changed
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export function createRuntimeProjectionSharedStateSignature(entries) {
|
|
29
|
+
return entries
|
|
30
|
+
.filter((entry) => isRuntimeProjectionSessionSharedStateKey(entry.key))
|
|
31
|
+
.map((entry) => `${entry.key}:${entry.revision}:${entry.originClientId ?? ''}`)
|
|
32
|
+
.join('|');
|
|
33
|
+
}
|
|
34
|
+
export function filterRuntimeProjectionSharedStateEntriesByOrigin(entries, originClientId) {
|
|
35
|
+
return originClientId
|
|
36
|
+
? entries.filter((entry) => entry.originClientId !== originClientId)
|
|
37
|
+
: entries;
|
|
38
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RuntimeManagerSnapshot, RuntimeServiceSnapshot, RuntimeStoreSnapshot, WorkbenchRuntimeSubscription } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { RuntimeManagerRegistration, RuntimeServiceRegistration, RuntimeStoreRegistration } from "./RuntimeRegistryTypes.js";
|
|
3
|
+
export interface RuntimeRegistryOwnerCallbacks {
|
|
4
|
+
onChanged?: () => void;
|
|
5
|
+
onManagerDisposed?: (registration: RuntimeManagerRegistration) => void;
|
|
6
|
+
onManagerRegistered?: (registration: RuntimeManagerRegistration) => void;
|
|
7
|
+
onServiceDisposed?: (registration: RuntimeServiceRegistration) => void;
|
|
8
|
+
onServiceRegistered?: (registration: RuntimeServiceRegistration) => void;
|
|
9
|
+
onStoreDisposed?: (registration: RuntimeStoreRegistration) => void;
|
|
10
|
+
onStoreRegistered?: (registration: RuntimeStoreRegistration) => void;
|
|
11
|
+
}
|
|
12
|
+
export interface RuntimeRegistryOwner {
|
|
13
|
+
getManagerSnapshots(): RuntimeManagerSnapshot[];
|
|
14
|
+
getServiceSnapshots(): RuntimeServiceSnapshot[];
|
|
15
|
+
getStoreSnapshots(): RuntimeStoreSnapshot[];
|
|
16
|
+
registerManager(registration: RuntimeManagerRegistration): WorkbenchRuntimeSubscription;
|
|
17
|
+
registerService(registration: RuntimeServiceRegistration): WorkbenchRuntimeSubscription;
|
|
18
|
+
registerStore(registration: RuntimeStoreRegistration): WorkbenchRuntimeSubscription;
|
|
19
|
+
}
|
|
20
|
+
export declare function createRuntimeRegistryOwner(callbacks?: RuntimeRegistryOwnerCallbacks): RuntimeRegistryOwner;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createRuntimeManagerSnapshot, createRuntimeServiceSnapshot, createRuntimeStoreSnapshot } from "./RuntimeRegistrySnapshots.js";
|
|
2
|
+
export function createRuntimeRegistryOwner(callbacks = {}) {
|
|
3
|
+
const stores = new Map();
|
|
4
|
+
const services = new Map();
|
|
5
|
+
const managers = new Map();
|
|
6
|
+
return {
|
|
7
|
+
getManagerSnapshots() {
|
|
8
|
+
return [...managers.values()].map((registration) => createRuntimeManagerSnapshot(registration));
|
|
9
|
+
},
|
|
10
|
+
getServiceSnapshots() {
|
|
11
|
+
return [...services.values()].map((registration) => createRuntimeServiceSnapshot(registration));
|
|
12
|
+
},
|
|
13
|
+
getStoreSnapshots() {
|
|
14
|
+
return [...stores.values()].map((registration) => createRuntimeStoreSnapshot(registration));
|
|
15
|
+
},
|
|
16
|
+
registerManager(registration) {
|
|
17
|
+
let disposed = false;
|
|
18
|
+
managers.set(registration.id, registration);
|
|
19
|
+
callbacks.onManagerRegistered?.(registration);
|
|
20
|
+
callbacks.onChanged?.();
|
|
21
|
+
return {
|
|
22
|
+
dispose: () => {
|
|
23
|
+
if (disposed || managers.get(registration.id) !== registration) {
|
|
24
|
+
disposed = true;
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
disposed = true;
|
|
28
|
+
managers.delete(registration.id);
|
|
29
|
+
callbacks.onManagerDisposed?.(registration);
|
|
30
|
+
callbacks.onChanged?.();
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
registerService(registration) {
|
|
35
|
+
let disposed = false;
|
|
36
|
+
services.set(registration.id, registration);
|
|
37
|
+
callbacks.onServiceRegistered?.(registration);
|
|
38
|
+
callbacks.onChanged?.();
|
|
39
|
+
return {
|
|
40
|
+
dispose: () => {
|
|
41
|
+
if (disposed || services.get(registration.id) !== registration) {
|
|
42
|
+
disposed = true;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
disposed = true;
|
|
46
|
+
services.delete(registration.id);
|
|
47
|
+
callbacks.onServiceDisposed?.(registration);
|
|
48
|
+
callbacks.onChanged?.();
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
},
|
|
52
|
+
registerStore(registration) {
|
|
53
|
+
let disposed = false;
|
|
54
|
+
stores.set(registration.id, registration);
|
|
55
|
+
callbacks.onStoreRegistered?.(registration);
|
|
56
|
+
callbacks.onChanged?.();
|
|
57
|
+
return {
|
|
58
|
+
dispose: () => {
|
|
59
|
+
if (disposed || stores.get(registration.id) !== registration) {
|
|
60
|
+
disposed = true;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
disposed = true;
|
|
64
|
+
stores.delete(registration.id);
|
|
65
|
+
callbacks.onStoreDisposed?.(registration);
|
|
66
|
+
callbacks.onChanged?.();
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { RuntimeManagerSnapshot, RuntimeServiceSnapshot, RuntimeStoreSnapshot } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { RuntimeManagerRegistration, RuntimeServiceRegistration, RuntimeStoreRegistration } from "./RuntimeRegistryTypes.js";
|
|
3
|
+
export declare function createRuntimeStoreSnapshot(registration: RuntimeStoreRegistration): RuntimeStoreSnapshot;
|
|
4
|
+
export declare function createRuntimeServiceSnapshot(registration: RuntimeServiceRegistration): RuntimeServiceSnapshot;
|
|
5
|
+
export declare function createRuntimeManagerSnapshot(registration: RuntimeManagerRegistration): RuntimeManagerSnapshot;
|
|
6
|
+
export declare function safeReadRuntimeValue(read: (() => unknown) | undefined, fallback: unknown): unknown;
|