@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,115 @@
|
|
|
1
|
+
import { LAYOUT_MIN_SPLIT_SIZE, normalizeSplitSizes } from "../../domain/layout/validation.js";
|
|
2
|
+
import { updateActiveWindowRoot } from "./layoutTree.js";
|
|
3
|
+
import { updateWorkspaceTargetWindow } from "./targetWindow.js";
|
|
4
|
+
const MIN_CHAIN_SEGMENT_SIZE = LAYOUT_MIN_SPLIT_SIZE;
|
|
5
|
+
export function resizeSplitBoundary(workspace, input) {
|
|
6
|
+
return updateWorkspaceTargetWindow(workspace, input.rootSplitId, (selected) => resizeSplitBoundaryInActiveWindow(selected, input));
|
|
7
|
+
}
|
|
8
|
+
function resizeSplitBoundaryInActiveWindow(workspace, input) {
|
|
9
|
+
if (!Number.isFinite(input.deltaRatio) || Math.abs(input.deltaRatio) < Number.EPSILON) {
|
|
10
|
+
return workspace;
|
|
11
|
+
}
|
|
12
|
+
return updateActiveWindowRoot(workspace, (root) => resizeSplitBoundaryInNode(root, input.rootSplitId, input.boundaryIndex, input.deltaRatio, input.mode ?? 'local'));
|
|
13
|
+
}
|
|
14
|
+
function resizeSplitBoundaryInNode(node, rootSplitId, boundaryIndex, deltaRatio, mode) {
|
|
15
|
+
if (node.kind !== 'split') {
|
|
16
|
+
return node;
|
|
17
|
+
}
|
|
18
|
+
if (node.id === rootSplitId) {
|
|
19
|
+
const chain = flattenSameOrientationChain(node, node.orientation, 1);
|
|
20
|
+
if (boundaryIndex < 0 || boundaryIndex >= chain.sizes.length - 1) {
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
const nextSizes = mode === 'proportional'
|
|
24
|
+
? resizeBoundaryProportionally(chain.sizes, boundaryIndex, deltaRatio)
|
|
25
|
+
: resizeBoundaryLocally(chain.sizes, boundaryIndex, deltaRatio);
|
|
26
|
+
if (!nextSizes) {
|
|
27
|
+
return node;
|
|
28
|
+
}
|
|
29
|
+
const [nextNode] = applyFlattenedChainSizes(node, node.orientation, nextSizes, 0);
|
|
30
|
+
return nextNode;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
...node,
|
|
34
|
+
children: [
|
|
35
|
+
resizeSplitBoundaryInNode(node.children[0], rootSplitId, boundaryIndex, deltaRatio, mode),
|
|
36
|
+
resizeSplitBoundaryInNode(node.children[1], rootSplitId, boundaryIndex, deltaRatio, mode)
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function flattenSameOrientationChain(node, orientation, size) {
|
|
41
|
+
if (node.kind !== 'split' || node.orientation !== orientation) {
|
|
42
|
+
return {
|
|
43
|
+
orientation,
|
|
44
|
+
sizes: [size]
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const left = flattenSameOrientationChain(node.children[0], orientation, size * node.sizes[0]);
|
|
48
|
+
const right = flattenSameOrientationChain(node.children[1], orientation, size * node.sizes[1]);
|
|
49
|
+
return {
|
|
50
|
+
orientation,
|
|
51
|
+
sizes: [...left.sizes, ...right.sizes]
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function applyFlattenedChainSizes(node, orientation, sizes, offset) {
|
|
55
|
+
if (node.kind !== 'split' || node.orientation !== orientation) {
|
|
56
|
+
return [node, offset + 1, sizes[offset] ?? 0];
|
|
57
|
+
}
|
|
58
|
+
const [leftChild, leftOffset, leftSize] = applyFlattenedChainSizes(node.children[0], orientation, sizes, offset);
|
|
59
|
+
const [rightChild, rightOffset, rightSize] = applyFlattenedChainSizes(node.children[1], orientation, sizes, leftOffset);
|
|
60
|
+
return [
|
|
61
|
+
{
|
|
62
|
+
...node,
|
|
63
|
+
children: [leftChild, rightChild],
|
|
64
|
+
sizes: normalizeSplitSizes([leftSize, rightSize])
|
|
65
|
+
},
|
|
66
|
+
rightOffset,
|
|
67
|
+
leftSize + rightSize
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
function resizeBoundaryLocally(sizes, boundaryIndex, deltaRatio) {
|
|
71
|
+
const nextSizes = [...sizes];
|
|
72
|
+
const leftIndex = boundaryIndex;
|
|
73
|
+
const rightIndex = boundaryIndex + 1;
|
|
74
|
+
const clampedDelta = clamp(deltaRatio, -(nextSizes[leftIndex] - MIN_CHAIN_SEGMENT_SIZE), nextSizes[rightIndex] - MIN_CHAIN_SEGMENT_SIZE);
|
|
75
|
+
if (!Number.isFinite(clampedDelta) || Math.abs(clampedDelta) < Number.EPSILON) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
nextSizes[leftIndex] += clampedDelta;
|
|
79
|
+
nextSizes[rightIndex] -= clampedDelta;
|
|
80
|
+
return nextSizes;
|
|
81
|
+
}
|
|
82
|
+
function resizeBoundaryProportionally(sizes, boundaryIndex, deltaRatio) {
|
|
83
|
+
const leftSizes = sizes.slice(0, boundaryIndex + 1);
|
|
84
|
+
const rightSizes = sizes.slice(boundaryIndex + 1);
|
|
85
|
+
const leftTotal = sum(leftSizes);
|
|
86
|
+
const minLeftTotal = leftSizes.length * MIN_CHAIN_SEGMENT_SIZE;
|
|
87
|
+
const minRightTotal = rightSizes.length * MIN_CHAIN_SEGMENT_SIZE;
|
|
88
|
+
const nextLeftTotal = clamp(deltaRatio + leftTotal, minLeftTotal, 1 - minRightTotal);
|
|
89
|
+
const nextRightTotal = 1 - nextLeftTotal;
|
|
90
|
+
if (!Number.isFinite(nextLeftTotal) ||
|
|
91
|
+
!Number.isFinite(nextRightTotal) ||
|
|
92
|
+
Math.abs(nextLeftTotal - leftTotal) < Number.EPSILON) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
return [
|
|
96
|
+
...scaleSegmentGroup(leftSizes, nextLeftTotal),
|
|
97
|
+
...scaleSegmentGroup(rightSizes, nextRightTotal)
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
function scaleSegmentGroup(sizes, nextTotal) {
|
|
101
|
+
const currentTotal = sum(sizes);
|
|
102
|
+
if (currentTotal <= 0) {
|
|
103
|
+
return sizes.map(() => nextTotal / Math.max(sizes.length, 1));
|
|
104
|
+
}
|
|
105
|
+
const scaled = sizes.map((size) => size / currentTotal * nextTotal);
|
|
106
|
+
const clamped = scaled.map((size) => Math.max(MIN_CHAIN_SEGMENT_SIZE, size));
|
|
107
|
+
const clampedTotal = sum(clamped);
|
|
108
|
+
return clamped.map((size) => size / clampedTotal * nextTotal);
|
|
109
|
+
}
|
|
110
|
+
function sum(values) {
|
|
111
|
+
return values.reduce((total, value) => total + value, 0);
|
|
112
|
+
}
|
|
113
|
+
function clamp(value, min, max) {
|
|
114
|
+
return Math.min(max, Math.max(min, value));
|
|
115
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolCatalogPort } from "../../domain/tool/model.js";
|
|
2
|
+
import { type WorkbenchReadingLevel } from "../../domain/presentation/readingLevel.js";
|
|
3
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
4
|
+
interface RunToolShellCommandInput {
|
|
5
|
+
panelId: string;
|
|
6
|
+
toolInstanceId: string;
|
|
7
|
+
commandId: string;
|
|
8
|
+
inheritedReadingLevel?: WorkbenchReadingLevel;
|
|
9
|
+
}
|
|
10
|
+
export declare function runToolShellCommand(workspace: Workspace, input: RunToolShellCommandInput, toolCatalog: ToolCatalogPort): Workspace;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { cloneJsonObject, isJsonObject } from "../../domain/shared/json.js";
|
|
2
|
+
import { CYCLE_TOOL_READING_LEVEL_COMMAND_ID, INHERIT_TOOL_READING_LEVEL_COMMAND_ID, normalizePanelTitleOverride, normalizeToolShellStatus, resolvePanelTitle, resolveToolReadingLevel, SET_TOOL_READING_LEVEL_ADVANCED_COMMAND_ID, SET_TOOL_READING_LEVEL_CASUAL_COMMAND_ID, SET_TOOL_READING_LEVEL_EXPERT_COMMAND_ID } from "../../domain/tool/shell.js";
|
|
3
|
+
import { normalizeWorkbenchReadingLevels } from "../../domain/presentation/readingLevel.js";
|
|
4
|
+
import { findPanelInWorkspace } from "../../domain/workspace/selectors.js";
|
|
5
|
+
import { updatePanelById } from "./layoutTree.js";
|
|
6
|
+
export function runToolShellCommand(workspace, input, toolCatalog) {
|
|
7
|
+
const panel = findPanelInWorkspace(workspace, input.panelId);
|
|
8
|
+
const toolInstance = workspace.toolInstances[input.toolInstanceId];
|
|
9
|
+
if (!panel || panel.toolInstanceId !== input.toolInstanceId || !toolInstance) {
|
|
10
|
+
return workspace;
|
|
11
|
+
}
|
|
12
|
+
const toolDefinition = toolCatalog.getDefinition(toolInstance.toolId);
|
|
13
|
+
if (toolDefinition) {
|
|
14
|
+
const nextReadingLevel = resolveReadingLevelCommand(toolDefinition, toolInstance, input.commandId, input.inheritedReadingLevel);
|
|
15
|
+
if (nextReadingLevel) {
|
|
16
|
+
const inheritedShellState = { ...(toolInstance.shellState ?? {
|
|
17
|
+
status: null
|
|
18
|
+
}) };
|
|
19
|
+
delete inheritedShellState.readingLevel;
|
|
20
|
+
return {
|
|
21
|
+
...workspace,
|
|
22
|
+
toolInstances: {
|
|
23
|
+
...workspace.toolInstances,
|
|
24
|
+
[input.toolInstanceId]: {
|
|
25
|
+
...toolInstance,
|
|
26
|
+
shellState: {
|
|
27
|
+
...inheritedShellState,
|
|
28
|
+
status: toolInstance.shellState?.status ?? null,
|
|
29
|
+
...(nextReadingLevel === 'inherit' ? {} : { readingLevel: nextReadingLevel })
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const shell = toolDefinition?.shell;
|
|
37
|
+
const command = shell?.commands?.find((entry) => entry.id === input.commandId);
|
|
38
|
+
if (!toolDefinition || !shell || !command || !shell.executeCommand) {
|
|
39
|
+
return workspace;
|
|
40
|
+
}
|
|
41
|
+
const result = shell.executeCommand({
|
|
42
|
+
commandId: input.commandId,
|
|
43
|
+
definition: toolDefinition,
|
|
44
|
+
instance: toolInstance
|
|
45
|
+
});
|
|
46
|
+
if (!result) {
|
|
47
|
+
return workspace;
|
|
48
|
+
}
|
|
49
|
+
if ('nextState' in result && result.nextState !== undefined && !isJsonObject(result.nextState)) {
|
|
50
|
+
return workspace;
|
|
51
|
+
}
|
|
52
|
+
let nextToolInstance = toolInstance;
|
|
53
|
+
let shouldUpdateToolInstance = false;
|
|
54
|
+
let shouldUpdatePanelTitle = false;
|
|
55
|
+
if ('nextState' in result && result.nextState !== undefined) {
|
|
56
|
+
nextToolInstance = {
|
|
57
|
+
...nextToolInstance,
|
|
58
|
+
state: cloneJsonObject(result.nextState)
|
|
59
|
+
};
|
|
60
|
+
shouldUpdateToolInstance = true;
|
|
61
|
+
}
|
|
62
|
+
if ('nextStatus' in result) {
|
|
63
|
+
const nextStatus = normalizeToolShellStatus(result.nextStatus);
|
|
64
|
+
if (result.nextStatus !== null && nextStatus === null) {
|
|
65
|
+
return workspace;
|
|
66
|
+
}
|
|
67
|
+
nextToolInstance = {
|
|
68
|
+
...nextToolInstance,
|
|
69
|
+
shellState: {
|
|
70
|
+
...nextToolInstance.shellState,
|
|
71
|
+
status: nextStatus
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
shouldUpdateToolInstance = true;
|
|
75
|
+
}
|
|
76
|
+
if ('nextPanelTitleOverride' in result) {
|
|
77
|
+
nextToolInstance = {
|
|
78
|
+
...nextToolInstance,
|
|
79
|
+
panelTitleOverride: normalizePanelTitleOverride(result.nextPanelTitleOverride ?? null)
|
|
80
|
+
};
|
|
81
|
+
shouldUpdateToolInstance = true;
|
|
82
|
+
shouldUpdatePanelTitle = true;
|
|
83
|
+
}
|
|
84
|
+
if (!shouldUpdateToolInstance) {
|
|
85
|
+
return workspace;
|
|
86
|
+
}
|
|
87
|
+
const nextWorkspace = {
|
|
88
|
+
...workspace,
|
|
89
|
+
toolInstances: {
|
|
90
|
+
...workspace.toolInstances,
|
|
91
|
+
[input.toolInstanceId]: nextToolInstance
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
if (!shouldUpdatePanelTitle) {
|
|
95
|
+
return nextWorkspace;
|
|
96
|
+
}
|
|
97
|
+
return {
|
|
98
|
+
...nextWorkspace,
|
|
99
|
+
windows: nextWorkspace.windows.map((window) => ({
|
|
100
|
+
...window,
|
|
101
|
+
root: updatePanelById(window.root, input.panelId, (currentPanel) => ({
|
|
102
|
+
...currentPanel,
|
|
103
|
+
title: resolvePanelTitle(toolDefinition, nextToolInstance)
|
|
104
|
+
}))
|
|
105
|
+
}))
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function resolveReadingLevelCommand(definition, instance, commandId, inheritedReadingLevel) {
|
|
109
|
+
const presentation = definition.panelPresentation?.readingLevel;
|
|
110
|
+
if (!presentation)
|
|
111
|
+
return null;
|
|
112
|
+
const availableLevels = normalizeWorkbenchReadingLevels(presentation);
|
|
113
|
+
if (availableLevels.length <= 1)
|
|
114
|
+
return null;
|
|
115
|
+
if (commandId === INHERIT_TOOL_READING_LEVEL_COMMAND_ID) {
|
|
116
|
+
return 'inherit';
|
|
117
|
+
}
|
|
118
|
+
const requestedLevelByCommand = {
|
|
119
|
+
[SET_TOOL_READING_LEVEL_CASUAL_COMMAND_ID]: 'casual',
|
|
120
|
+
[SET_TOOL_READING_LEVEL_ADVANCED_COMMAND_ID]: 'advanced',
|
|
121
|
+
[SET_TOOL_READING_LEVEL_EXPERT_COMMAND_ID]: 'expert'
|
|
122
|
+
};
|
|
123
|
+
const requestedLevel = requestedLevelByCommand[commandId];
|
|
124
|
+
if (requestedLevel) {
|
|
125
|
+
return availableLevels.includes(requestedLevel) ? requestedLevel : null;
|
|
126
|
+
}
|
|
127
|
+
if (commandId !== CYCLE_TOOL_READING_LEVEL_COMMAND_ID && commandId !== 'workbench.tool.reading-level') {
|
|
128
|
+
return null;
|
|
129
|
+
}
|
|
130
|
+
const currentLevel = resolveToolReadingLevel(definition, instance, inheritedReadingLevel);
|
|
131
|
+
const currentIndex = Math.max(0, availableLevels.indexOf(currentLevel));
|
|
132
|
+
return availableLevels[(currentIndex + 1) % availableLevels.length] ?? presentation.defaultLevel;
|
|
133
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PanelNode } from "../../domain/panel/model.js";
|
|
2
|
+
import type { ToolInstance } from "../../domain/tool/model.js";
|
|
3
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
4
|
+
import type { WorkspaceFocus, WorkspaceSessionState } from "../../domain/workspace/session.js";
|
|
5
|
+
export type { WorkspaceFocus, WorkspaceSessionState } from "../../domain/workspace/session.js";
|
|
6
|
+
export declare function createWorkspaceSessionState(workspace: Workspace, focus?: Partial<WorkspaceFocus>): WorkspaceSessionState;
|
|
7
|
+
export declare function normalizeWorkspaceFocus(workspace: Workspace, focus?: Partial<WorkspaceFocus>): WorkspaceFocus;
|
|
8
|
+
export declare function getFocusedPanel(state: WorkspaceSessionState): PanelNode | undefined;
|
|
9
|
+
export declare function getFocusedToolInstance(state: WorkspaceSessionState): ToolInstance | undefined;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { getPreferredFocusedPanelId, findPanelInWorkspace } from "../../domain/workspace/selectors.js";
|
|
2
|
+
export function createWorkspaceSessionState(workspace, focus = {}) {
|
|
3
|
+
return {
|
|
4
|
+
workspace,
|
|
5
|
+
focus: normalizeWorkspaceFocus(workspace, focus)
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
export function normalizeWorkspaceFocus(workspace, focus = {}) {
|
|
9
|
+
const requestedPanelId = focus.activePanelId ?? getPreferredFullscreenPanelId(workspace) ?? getPreferredFocusedPanelId(workspace);
|
|
10
|
+
const requestedPanel = requestedPanelId ? findPanelInWorkspace(workspace, requestedPanelId) : undefined;
|
|
11
|
+
const panel = requestedPanel ?? getFallbackFocusedPanel(workspace);
|
|
12
|
+
return {
|
|
13
|
+
activePanelId: panel?.id ?? null,
|
|
14
|
+
activeToolInstanceId: panel?.toolInstanceId ?? null
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export function getFocusedPanel(state) {
|
|
18
|
+
return state.focus.activePanelId ? findPanelInWorkspace(state.workspace, state.focus.activePanelId) : undefined;
|
|
19
|
+
}
|
|
20
|
+
export function getFocusedToolInstance(state) {
|
|
21
|
+
if (!state.focus.activeToolInstanceId) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
return state.workspace.toolInstances[state.focus.activeToolInstanceId];
|
|
25
|
+
}
|
|
26
|
+
function getFallbackFocusedPanel(workspace) {
|
|
27
|
+
const fallbackPanelId = getPreferredFullscreenPanelId(workspace) ?? getPreferredFocusedPanelId(workspace);
|
|
28
|
+
return fallbackPanelId ? findPanelInWorkspace(workspace, fallbackPanelId) : undefined;
|
|
29
|
+
}
|
|
30
|
+
function getPreferredFullscreenPanelId(workspace) {
|
|
31
|
+
const fullscreenPanelId = workspace.fullscreenPanelId ?? null;
|
|
32
|
+
if (!fullscreenPanelId) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return findPanelInWorkspace(workspace, fullscreenPanelId)?.id ?? null;
|
|
36
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
interface SetActiveStackChildInput {
|
|
3
|
+
stackId: string;
|
|
4
|
+
panelId: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function setActiveStackChild(workspace: Workspace, input: SetActiveStackChildInput): Workspace;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { updateActiveWindowRoot, updateStackById } from "./layoutTree.js";
|
|
2
|
+
export function setActiveStackChild(workspace, input) {
|
|
3
|
+
return updateActiveWindowRoot(workspace, (root) => updateStackById(root, input.stackId, (stack) => {
|
|
4
|
+
if (!stack.children.some((panel) => panel.id === input.panelId)) {
|
|
5
|
+
return stack;
|
|
6
|
+
}
|
|
7
|
+
return {
|
|
8
|
+
...stack,
|
|
9
|
+
activeChildId: input.panelId
|
|
10
|
+
};
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DesignSystemThemeSession } from "../../domain/design-system/themeSession.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
export declare function setDesignSystemThemeSession(workspace: Workspace, nextSession: DesignSystemThemeSession | null): Workspace;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { normalizeDesignSystemThemeSession } from "../../domain/design-system/themeSession.js";
|
|
2
|
+
export function setDesignSystemThemeSession(workspace, nextSession) {
|
|
3
|
+
const normalizedSession = nextSession ? normalizeDesignSystemThemeSession(nextSession) : null;
|
|
4
|
+
const currentSession = workspace.designSystemThemeSession ?? null;
|
|
5
|
+
if (JSON.stringify(currentSession) === JSON.stringify(normalizedSession)) {
|
|
6
|
+
return workspace;
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
...workspace,
|
|
10
|
+
designSystemThemeSession: normalizedSession
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
interface SetPanelFullscreenToggleVisibilityInput {
|
|
3
|
+
panelId: string;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function setPanelFullscreenToggleVisibility(workspace: Workspace, input: SetPanelFullscreenToggleVisibilityInput): Workspace;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { updateActiveWindowRoot, updatePanelById } from "./layoutTree.js";
|
|
2
|
+
export function setPanelFullscreenToggleVisibility(workspace, input) {
|
|
3
|
+
return updateActiveWindowRoot(workspace, (root) => updatePanelById(root, input.panelId, (panel) => ({
|
|
4
|
+
...panel,
|
|
5
|
+
showFullscreenToggle: input.visible
|
|
6
|
+
})));
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
interface SetStackHeaderVisibilityInput {
|
|
3
|
+
stackId: string;
|
|
4
|
+
visible: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function setStackHeaderVisibility(workspace: Workspace, input: SetStackHeaderVisibilityInput): Workspace;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { updateActiveWindowRoot, updateStackById } from "./layoutTree.js";
|
|
2
|
+
export function setStackHeaderVisibility(workspace, input) {
|
|
3
|
+
return updateActiveWindowRoot(workspace, (root) => updateStackById(root, input.stackId, (stack) => ({
|
|
4
|
+
...stack,
|
|
5
|
+
headerVisible: input.visible
|
|
6
|
+
})));
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolCatalogPort } from "../../domain/tool/model.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
interface SetToolPanelTitleOverrideInput {
|
|
4
|
+
panelId: string;
|
|
5
|
+
toolInstanceId: string;
|
|
6
|
+
panelTitleOverride: string | null;
|
|
7
|
+
}
|
|
8
|
+
export declare function setToolPanelTitleOverride(workspace: Workspace, input: SetToolPanelTitleOverrideInput, toolCatalog: ToolCatalogPort): Workspace;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { updatePanelById } from "./layoutTree.js";
|
|
2
|
+
import { normalizePanelTitleOverride, resolvePanelTitle } from "../../domain/tool/shell.js";
|
|
3
|
+
import { findPanelInWorkspace } from "../../domain/workspace/selectors.js";
|
|
4
|
+
export function setToolPanelTitleOverride(workspace, input, toolCatalog) {
|
|
5
|
+
const panel = findPanelInWorkspace(workspace, input.panelId);
|
|
6
|
+
const toolInstance = workspace.toolInstances[input.toolInstanceId];
|
|
7
|
+
if (!panel || panel.toolInstanceId !== input.toolInstanceId || !toolInstance) {
|
|
8
|
+
return workspace;
|
|
9
|
+
}
|
|
10
|
+
const toolDefinition = toolCatalog.getDefinition(toolInstance.toolId);
|
|
11
|
+
if (!toolDefinition) {
|
|
12
|
+
return workspace;
|
|
13
|
+
}
|
|
14
|
+
const normalizedOverride = normalizePanelTitleOverride(input.panelTitleOverride);
|
|
15
|
+
const nextToolInstance = {
|
|
16
|
+
...toolInstance,
|
|
17
|
+
panelTitleOverride: normalizedOverride
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
...workspace,
|
|
21
|
+
toolInstances: {
|
|
22
|
+
...workspace.toolInstances,
|
|
23
|
+
[input.toolInstanceId]: nextToolInstance
|
|
24
|
+
},
|
|
25
|
+
windows: workspace.windows.map((window) => ({
|
|
26
|
+
...window,
|
|
27
|
+
root: updatePanelById(window.root, input.panelId, (currentPanel) => ({
|
|
28
|
+
...currentPanel,
|
|
29
|
+
title: resolvePanelTitle(toolDefinition, nextToolInstance)
|
|
30
|
+
}))
|
|
31
|
+
}))
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
import type { ToolShellStatus } from "../../domain/tool/model.js";
|
|
3
|
+
interface SetToolShellStatusInput {
|
|
4
|
+
toolInstanceId: string;
|
|
5
|
+
nextStatus: ToolShellStatus | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function setToolShellStatus(workspace: Workspace, input: SetToolShellStatusInput): Workspace;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { normalizeToolShellStatus } from "../../domain/tool/shell.js";
|
|
2
|
+
export function setToolShellStatus(workspace, input) {
|
|
3
|
+
const toolInstance = workspace.toolInstances[input.toolInstanceId];
|
|
4
|
+
if (!toolInstance) {
|
|
5
|
+
return workspace;
|
|
6
|
+
}
|
|
7
|
+
const nextStatus = normalizeToolShellStatus(input.nextStatus);
|
|
8
|
+
if (input.nextStatus !== null && nextStatus === null) {
|
|
9
|
+
return workspace;
|
|
10
|
+
}
|
|
11
|
+
const currentStatusValue = toolInstance.shellState?.status ?? null;
|
|
12
|
+
const currentStatus = normalizeToolShellStatus(currentStatusValue);
|
|
13
|
+
const currentStatusIsWellFormed = currentStatusValue === null || currentStatus !== null;
|
|
14
|
+
if (currentStatusIsWellFormed &&
|
|
15
|
+
currentStatus?.label === nextStatus?.label &&
|
|
16
|
+
currentStatus?.tone === nextStatus?.tone) {
|
|
17
|
+
return workspace;
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
...workspace,
|
|
21
|
+
toolInstances: {
|
|
22
|
+
...workspace.toolInstances,
|
|
23
|
+
[input.toolInstanceId]: {
|
|
24
|
+
...toolInstance,
|
|
25
|
+
shellState: {
|
|
26
|
+
...toolInstance.shellState,
|
|
27
|
+
status: nextStatus
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { findPanelInWorkspace } from "../../domain/workspace/selectors.js";
|
|
2
|
+
export function normalizeWorkspaceFullscreenPanel(workspace) {
|
|
3
|
+
const fullscreenPanelId = workspace.fullscreenPanelId ?? null;
|
|
4
|
+
if (fullscreenPanelId === null) {
|
|
5
|
+
return workspace.fullscreenPanelId === null ? workspace : { ...workspace, fullscreenPanelId: null };
|
|
6
|
+
}
|
|
7
|
+
return findPanelInWorkspace(workspace, fullscreenPanelId)
|
|
8
|
+
? workspace
|
|
9
|
+
: {
|
|
10
|
+
...workspace,
|
|
11
|
+
fullscreenPanelId: null
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function setWorkspaceFullscreenPanel(workspace, panelId) {
|
|
15
|
+
const nextFullscreenPanelId = panelId ?? null;
|
|
16
|
+
if (nextFullscreenPanelId !== null && !findPanelInWorkspace(workspace, nextFullscreenPanelId)) {
|
|
17
|
+
return normalizeWorkspaceFullscreenPanel(workspace);
|
|
18
|
+
}
|
|
19
|
+
if ((workspace.fullscreenPanelId ?? null) === nextFullscreenPanelId) {
|
|
20
|
+
return normalizeWorkspaceFullscreenPanel(workspace);
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
...workspace,
|
|
24
|
+
fullscreenPanelId: nextFullscreenPanelId
|
|
25
|
+
};
|
|
26
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { WorkspaceValidationIssue } from "../../domain/workspace/validation.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
export interface WorkspaceSnapshotImportResult {
|
|
4
|
+
ok: boolean;
|
|
5
|
+
workspace?: Workspace;
|
|
6
|
+
error?: string;
|
|
7
|
+
issues?: WorkspaceValidationIssue[];
|
|
8
|
+
}
|
|
9
|
+
export declare function exportWorkspaceSnapshot(workspace: Workspace): string;
|
|
10
|
+
export declare function importWorkspaceSnapshot(source: string): WorkspaceSnapshotImportResult;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { parseWorkspaceSnapshot, validateWorkspaceSnapshot } from "../../domain/workspace/validation.js";
|
|
2
|
+
export function exportWorkspaceSnapshot(workspace) {
|
|
3
|
+
return JSON.stringify(workspace, null, 2);
|
|
4
|
+
}
|
|
5
|
+
export function importWorkspaceSnapshot(source) {
|
|
6
|
+
try {
|
|
7
|
+
const parsedValue = JSON.parse(source);
|
|
8
|
+
const issues = validateWorkspaceSnapshot(parsedValue);
|
|
9
|
+
if (issues.length > 0) {
|
|
10
|
+
return {
|
|
11
|
+
ok: false,
|
|
12
|
+
error: issues[0].message,
|
|
13
|
+
issues
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
const workspace = parseWorkspaceSnapshot(parsedValue);
|
|
17
|
+
if (!workspace) {
|
|
18
|
+
return {
|
|
19
|
+
ok: false,
|
|
20
|
+
error: 'Workspace snapshot could not be normalized.'
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
ok: true,
|
|
25
|
+
workspace
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return {
|
|
30
|
+
ok: false,
|
|
31
|
+
error: 'Workspace snapshot must be valid JSON.'
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LayoutDockSide } from "../../domain/layout/interaction.js";
|
|
2
|
+
import type { SplitOrientation } from "../../domain/layout/model.js";
|
|
3
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
4
|
+
interface SplitPanelInput {
|
|
5
|
+
panelId: string;
|
|
6
|
+
orientation: SplitOrientation;
|
|
7
|
+
side?: LayoutDockSide;
|
|
8
|
+
}
|
|
9
|
+
export declare function splitPanel(workspace: Workspace, input: SplitPanelInput): Workspace;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { containsPanel } from "../../domain/layout/selectors.js";
|
|
2
|
+
import { getActiveWindow } from "../../domain/workspace/selectors.js";
|
|
3
|
+
import { createPanel, createSplit, createStack } from "../../domain/workspace/factories.js";
|
|
4
|
+
import { canonicalizeLayout } from "./canonicalizeLayout.js";
|
|
5
|
+
import { replaceStackContainingPanel, updateActiveWindowRoot } from "./layoutTree.js";
|
|
6
|
+
export function splitPanel(workspace, input) {
|
|
7
|
+
const activeWindow = getActiveWindow(workspace);
|
|
8
|
+
if (!activeWindow || !containsPanel(activeWindow.root, input.panelId)) {
|
|
9
|
+
return workspace;
|
|
10
|
+
}
|
|
11
|
+
const nextRoot = replaceStackContainingPanel(activeWindow.root, input.panelId, (stack) => {
|
|
12
|
+
const newStack = createStack([createPanel('New panel')]);
|
|
13
|
+
const nextChildren = input.orientation === 'horizontal' && input.side === 'left'
|
|
14
|
+
? [newStack, stack]
|
|
15
|
+
: input.orientation === 'vertical' && input.side === 'top'
|
|
16
|
+
? [newStack, stack]
|
|
17
|
+
: [stack, newStack];
|
|
18
|
+
return createSplit(input.orientation, nextChildren);
|
|
19
|
+
});
|
|
20
|
+
return updateActiveWindowRoot(workspace, () => canonicalizeLayout(nextRoot));
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { LayoutEdge } from "../../domain/layout/interaction.js";
|
|
2
|
+
import type { SplitOrientation } from "../../domain/layout/model.js";
|
|
3
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
4
|
+
export type PanelSubdivisionAxis = 'columns' | 'rows';
|
|
5
|
+
export interface PanelSubdivisionPreview {
|
|
6
|
+
axis: PanelSubdivisionAxis;
|
|
7
|
+
cutCount: number;
|
|
8
|
+
pointerRatio: number;
|
|
9
|
+
linePositions: number[];
|
|
10
|
+
preservedSegmentIndex: number;
|
|
11
|
+
segmentRanges: Array<{
|
|
12
|
+
index: number;
|
|
13
|
+
start: number;
|
|
14
|
+
end: number;
|
|
15
|
+
center: number;
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
18
|
+
export interface SubdividePanelInput {
|
|
19
|
+
panelId: string;
|
|
20
|
+
orientation: SplitOrientation;
|
|
21
|
+
edge: LayoutEdge;
|
|
22
|
+
cuts: number;
|
|
23
|
+
pointerRatio: number;
|
|
24
|
+
}
|
|
25
|
+
export interface SubdividePanelResult {
|
|
26
|
+
workspace: Workspace;
|
|
27
|
+
createdPanelIds: string[];
|
|
28
|
+
originalPanelId: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function clampSubdivisionCuts(cuts: number): number;
|
|
31
|
+
export declare function clampSubdivisionPointerRatio(pointerRatio: number): number;
|
|
32
|
+
export declare function resolveSubdivisionAxis(orientation: SplitOrientation): PanelSubdivisionAxis;
|
|
33
|
+
export declare function resolveLayoutOrientationForSubdivision(orientation: SplitOrientation): SplitOrientation;
|
|
34
|
+
export declare function getSubdivisionSegmentSizes(edge: LayoutEdge, cuts: number, pointerRatio: number): number[];
|
|
35
|
+
export declare function getSubdivisionPreview(orientation: SplitOrientation, edge: LayoutEdge, cuts: number, pointerRatio: number): PanelSubdivisionPreview;
|
|
36
|
+
export declare function resolveDefaultSubdivisionPreservedSegmentIndex(edge: LayoutEdge, cuts: number): number;
|
|
37
|
+
export declare function resolveSubdivisionPreservedSegmentIndex(edge: LayoutEdge, cuts: number, pointerRatio: number): number;
|
|
38
|
+
export declare function resolveSubdivisionSegmentPointerRatio(edge: LayoutEdge, cuts: number, segmentIndex: number): number;
|
|
39
|
+
export declare function subdividePanel(workspace: Workspace, input: SubdividePanelInput): SubdividePanelResult;
|