@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,9 @@
|
|
|
1
|
+
import type { RuntimeInspectableStatus } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { JsonValue } from "../../domain/shared/json.js";
|
|
3
|
+
export declare function normalizeRuntimeObjectSnapshot(value: unknown): Record<string, unknown>;
|
|
4
|
+
export declare function normalizeRuntimeInspectableStatus(value: unknown): RuntimeInspectableStatus | null;
|
|
5
|
+
export declare function normalizeRuntimeStringArray(value: unknown): string[] | null;
|
|
6
|
+
export declare function normalizeRuntimeNullableString(value: unknown): string | null;
|
|
7
|
+
export declare function sanitizeRuntimeJson(value: unknown, depth?: number): JsonValue;
|
|
8
|
+
export declare function sanitizeRuntimeText(value: string, maxLength?: number): string;
|
|
9
|
+
export declare function isJsonValue(value: unknown): value is JsonValue;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export function normalizeRuntimeObjectSnapshot(value) {
|
|
2
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : {};
|
|
3
|
+
}
|
|
4
|
+
export function normalizeRuntimeInspectableStatus(value) {
|
|
5
|
+
return value === 'active' || value === 'idle' || value === 'degraded' || value === 'error' || value === 'unknown'
|
|
6
|
+
? value
|
|
7
|
+
: null;
|
|
8
|
+
}
|
|
9
|
+
export function normalizeRuntimeStringArray(value) {
|
|
10
|
+
return Array.isArray(value)
|
|
11
|
+
? value.filter((entry) => typeof entry === 'string').map((entry) => sanitizeRuntimeText(entry, 120))
|
|
12
|
+
: null;
|
|
13
|
+
}
|
|
14
|
+
export function normalizeRuntimeNullableString(value) {
|
|
15
|
+
return typeof value === 'string' ? sanitizeRuntimeText(value, 500) : null;
|
|
16
|
+
}
|
|
17
|
+
export function sanitizeRuntimeJson(value, depth = 0) {
|
|
18
|
+
if (value === null || typeof value === 'boolean') {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
if (typeof value === 'string') {
|
|
22
|
+
return sanitizeRuntimeText(value);
|
|
23
|
+
}
|
|
24
|
+
if (typeof value === 'number') {
|
|
25
|
+
return Number.isFinite(value) ? value : null;
|
|
26
|
+
}
|
|
27
|
+
if (Array.isArray(value)) {
|
|
28
|
+
if (depth >= 4) {
|
|
29
|
+
return `[Array(${value.length})]`;
|
|
30
|
+
}
|
|
31
|
+
return value.slice(0, 50).map((entry) => sanitizeRuntimeJson(entry, depth + 1));
|
|
32
|
+
}
|
|
33
|
+
if (value && typeof value === 'object') {
|
|
34
|
+
if (depth >= 4) {
|
|
35
|
+
return '[Object]';
|
|
36
|
+
}
|
|
37
|
+
return Object.fromEntries(Object.entries(value)
|
|
38
|
+
.slice(0, 50)
|
|
39
|
+
.map(([key, entry]) => [sanitizeRuntimeText(key, 120), sanitizeRuntimeJson(entry, depth + 1)]));
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
export function sanitizeRuntimeText(value, maxLength = 2000) {
|
|
44
|
+
return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}…`;
|
|
45
|
+
}
|
|
46
|
+
export function isJsonValue(value) {
|
|
47
|
+
if (value === null ||
|
|
48
|
+
typeof value === 'string' ||
|
|
49
|
+
typeof value === 'boolean') {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (typeof value === 'number') {
|
|
53
|
+
return Number.isFinite(value);
|
|
54
|
+
}
|
|
55
|
+
if (Array.isArray(value)) {
|
|
56
|
+
return value.every(isJsonValue);
|
|
57
|
+
}
|
|
58
|
+
if (typeof value === 'object') {
|
|
59
|
+
return Object.values(value).every(isJsonValue);
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ShellState, ShellRegionId, ShellRegionState, ShellRegionAxis, ShellRegionPresentation, ShellWidgetCatalogPort, ShellWidgetPlacement } from "../../domain/shell/model.js";
|
|
2
|
+
export declare const DEFAULT_SHELL_REGION_SIZES: Record<ShellRegionId, number>;
|
|
3
|
+
export declare const MIN_SHELL_REGION_SIZES: Record<ShellRegionId, number>;
|
|
4
|
+
export declare const SHELL_REGION_RESIZE_CLOSE_OFFSET_PX = 32;
|
|
5
|
+
export declare function resolveShellRegionPresentation(region: ShellRegionState): ShellRegionPresentation;
|
|
6
|
+
export declare function resolveShellRegionAxis(region: ShellRegionState): ShellRegionAxis;
|
|
7
|
+
export declare function isShellRegionWidgetVisible(region: ShellRegionState, widgetId: string): boolean;
|
|
8
|
+
export declare function listVisibleShellRegionWidgetIds(region: ShellRegionState): string[];
|
|
9
|
+
export declare function setShellRegionArrangement(shellState: ShellState, regionId: ShellRegionId, presentation: ShellRegionPresentation, axis?: ShellRegionAxis): ShellState;
|
|
10
|
+
export declare function createShellState(widgetCatalog: ShellWidgetCatalogPort, options?: {
|
|
11
|
+
openRegionIds?: ShellRegionId[];
|
|
12
|
+
}): ShellState;
|
|
13
|
+
export declare function setShellRegionVisible(shellState: ShellState, regionId: ShellRegionId, isVisible: boolean): ShellState;
|
|
14
|
+
export declare function setShellRegionOpen(shellState: ShellState, regionId: ShellRegionId, isOpen: boolean): ShellState;
|
|
15
|
+
export declare function toggleShellRegionOpen(shellState: ShellState, regionId: ShellRegionId): ShellState;
|
|
16
|
+
export declare function setShellRegionSize(shellState: ShellState, regionId: ShellRegionId, size: number): ShellState;
|
|
17
|
+
export declare function shouldCloseShellRegionFromResize(regionId: ShellRegionId, requestedSize: number): boolean;
|
|
18
|
+
export declare function activateShellWidget(shellState: ShellState, regionId: ShellRegionId, widgetId: string): ShellState;
|
|
19
|
+
export declare function setShellRegionWidgetVisible(shellState: ShellState, regionId: ShellRegionId, widgetId: string, isVisible: boolean): ShellState;
|
|
20
|
+
export declare function addShellWidgetToRegion(shellState: ShellState, regionId: ShellRegionId, widgetId: string, placement?: ShellWidgetPlacement): ShellState;
|
|
21
|
+
export declare function moveShellWidgetToRegion(shellState: ShellState, targetRegionId: ShellRegionId, widgetId: string, placement?: ShellWidgetPlacement): ShellState;
|
|
22
|
+
export declare function removeShellWidgetFromRegion(shellState: ShellState, regionId: ShellRegionId, widgetId: string): ShellState;
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { hasDockPlacement, insertDockableEntityId } from "../../domain/composition/docking.js";
|
|
2
|
+
export const DEFAULT_SHELL_REGION_SIZES = {
|
|
3
|
+
left: 240,
|
|
4
|
+
right: 320,
|
|
5
|
+
bottom: 220
|
|
6
|
+
};
|
|
7
|
+
export const MIN_SHELL_REGION_SIZES = {
|
|
8
|
+
left: 180,
|
|
9
|
+
right: 180,
|
|
10
|
+
bottom: 124
|
|
11
|
+
};
|
|
12
|
+
export const SHELL_REGION_RESIZE_CLOSE_OFFSET_PX = 32;
|
|
13
|
+
export function resolveShellRegionPresentation(region) {
|
|
14
|
+
return region.presentation ?? 'tabs';
|
|
15
|
+
}
|
|
16
|
+
export function resolveShellRegionAxis(region) {
|
|
17
|
+
return region.axis ?? (region.id === 'bottom' ? 'horizontal' : 'vertical');
|
|
18
|
+
}
|
|
19
|
+
export function isShellRegionWidgetVisible(region, widgetId) {
|
|
20
|
+
return region.widgetIds.includes(widgetId) && !(region.hiddenWidgetIds ?? []).includes(widgetId);
|
|
21
|
+
}
|
|
22
|
+
export function listVisibleShellRegionWidgetIds(region) {
|
|
23
|
+
const hiddenWidgetIds = new Set(region.hiddenWidgetIds ?? []);
|
|
24
|
+
return region.widgetIds.filter((widgetId) => !hiddenWidgetIds.has(widgetId));
|
|
25
|
+
}
|
|
26
|
+
export function setShellRegionArrangement(shellState, regionId, presentation, axis) {
|
|
27
|
+
const region = shellState.regions[regionId];
|
|
28
|
+
if (!region) {
|
|
29
|
+
return shellState;
|
|
30
|
+
}
|
|
31
|
+
const nextAxis = axis ?? resolveShellRegionAxis(region);
|
|
32
|
+
if (resolveShellRegionPresentation(region) === presentation && resolveShellRegionAxis(region) === nextAxis) {
|
|
33
|
+
return shellState;
|
|
34
|
+
}
|
|
35
|
+
return updateShellRegion(shellState, regionId, {
|
|
36
|
+
...region,
|
|
37
|
+
presentation,
|
|
38
|
+
axis: nextAxis
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
export function createShellState(widgetCatalog, options = {}) {
|
|
42
|
+
return {
|
|
43
|
+
regions: {
|
|
44
|
+
left: createShellRegionState('left', widgetCatalog, options),
|
|
45
|
+
right: createShellRegionState('right', widgetCatalog, options),
|
|
46
|
+
bottom: createShellRegionState('bottom', widgetCatalog, options)
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function setShellRegionVisible(shellState, regionId, isVisible) {
|
|
51
|
+
const region = shellState.regions[regionId];
|
|
52
|
+
if (!region || region.isVisible === isVisible) {
|
|
53
|
+
return shellState;
|
|
54
|
+
}
|
|
55
|
+
return updateShellRegion(shellState, regionId, {
|
|
56
|
+
...region,
|
|
57
|
+
isVisible
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
export function setShellRegionOpen(shellState, regionId, isOpen) {
|
|
61
|
+
const region = shellState.regions[regionId];
|
|
62
|
+
if (!region || region.isOpen === isOpen) {
|
|
63
|
+
return shellState;
|
|
64
|
+
}
|
|
65
|
+
return updateShellRegion(shellState, regionId, {
|
|
66
|
+
...region,
|
|
67
|
+
isOpen
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export function toggleShellRegionOpen(shellState, regionId) {
|
|
71
|
+
const region = shellState.regions[regionId];
|
|
72
|
+
return region ? setShellRegionOpen(shellState, regionId, !region.isOpen) : shellState;
|
|
73
|
+
}
|
|
74
|
+
export function setShellRegionSize(shellState, regionId, size) {
|
|
75
|
+
const region = shellState.regions[regionId];
|
|
76
|
+
if (!region || !Number.isFinite(size)) {
|
|
77
|
+
return shellState;
|
|
78
|
+
}
|
|
79
|
+
const normalizedSize = Math.max(MIN_SHELL_REGION_SIZES[regionId], Math.round(size));
|
|
80
|
+
if (region.size === normalizedSize) {
|
|
81
|
+
return shellState;
|
|
82
|
+
}
|
|
83
|
+
return updateShellRegion(shellState, regionId, {
|
|
84
|
+
...region,
|
|
85
|
+
size: normalizedSize
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
export function shouldCloseShellRegionFromResize(regionId, requestedSize) {
|
|
89
|
+
if (!Number.isFinite(requestedSize)) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
return Math.round(requestedSize) <= MIN_SHELL_REGION_SIZES[regionId] - SHELL_REGION_RESIZE_CLOSE_OFFSET_PX;
|
|
93
|
+
}
|
|
94
|
+
export function activateShellWidget(shellState, regionId, widgetId) {
|
|
95
|
+
const region = shellState.regions[regionId];
|
|
96
|
+
if (!region || !region.widgetIds.includes(widgetId)) {
|
|
97
|
+
return shellState;
|
|
98
|
+
}
|
|
99
|
+
if (region.activeWidgetId === widgetId &&
|
|
100
|
+
region.isVisible &&
|
|
101
|
+
region.isOpen &&
|
|
102
|
+
isShellRegionWidgetVisible(region, widgetId)) {
|
|
103
|
+
return shellState;
|
|
104
|
+
}
|
|
105
|
+
return updateShellRegion(shellState, regionId, {
|
|
106
|
+
...region,
|
|
107
|
+
isVisible: true,
|
|
108
|
+
isOpen: true,
|
|
109
|
+
activeWidgetId: widgetId,
|
|
110
|
+
hiddenWidgetIds: (region.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== widgetId)
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
export function setShellRegionWidgetVisible(shellState, regionId, widgetId, isVisible) {
|
|
114
|
+
const region = shellState.regions[regionId];
|
|
115
|
+
if (!region || !region.widgetIds.includes(widgetId)) {
|
|
116
|
+
return shellState;
|
|
117
|
+
}
|
|
118
|
+
const currentlyVisible = isShellRegionWidgetVisible(region, widgetId);
|
|
119
|
+
if (currentlyVisible === isVisible) {
|
|
120
|
+
return isVisible && (!region.isVisible || !region.isOpen || region.activeWidgetId !== widgetId)
|
|
121
|
+
? activateShellWidget(shellState, regionId, widgetId)
|
|
122
|
+
: shellState;
|
|
123
|
+
}
|
|
124
|
+
const hiddenWidgetIds = isVisible
|
|
125
|
+
? (region.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== widgetId)
|
|
126
|
+
: [...new Set([...(region.hiddenWidgetIds ?? []), widgetId])];
|
|
127
|
+
const visibleWidgetIds = region.widgetIds.filter((candidateId) => !hiddenWidgetIds.includes(candidateId));
|
|
128
|
+
const activeWidgetId = visibleWidgetIds.includes(region.activeWidgetId ?? '')
|
|
129
|
+
? region.activeWidgetId
|
|
130
|
+
: visibleWidgetIds[0] ?? null;
|
|
131
|
+
return updateShellRegion(shellState, regionId, {
|
|
132
|
+
...region,
|
|
133
|
+
isVisible: visibleWidgetIds.length > 0 ? (isVisible ? true : region.isVisible) : false,
|
|
134
|
+
isOpen: visibleWidgetIds.length > 0 ? (isVisible ? true : region.isOpen) : false,
|
|
135
|
+
activeWidgetId: isVisible ? widgetId : activeWidgetId,
|
|
136
|
+
hiddenWidgetIds
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
export function addShellWidgetToRegion(shellState, regionId, widgetId, placement = {}) {
|
|
140
|
+
const region = shellState.regions[regionId];
|
|
141
|
+
const normalizedWidgetId = widgetId.trim();
|
|
142
|
+
if (!region || !normalizedWidgetId) {
|
|
143
|
+
return shellState;
|
|
144
|
+
}
|
|
145
|
+
if (region.widgetIds.includes(normalizedWidgetId) && !hasShellWidgetPlacement(placement)) {
|
|
146
|
+
return activateShellWidget(shellState, regionId, normalizedWidgetId);
|
|
147
|
+
}
|
|
148
|
+
let nextShellState = shellState;
|
|
149
|
+
const regionIds = ['left', 'right', 'bottom'];
|
|
150
|
+
for (const currentRegionId of regionIds) {
|
|
151
|
+
const currentRegion = nextShellState.regions[currentRegionId];
|
|
152
|
+
if (currentRegionId === regionId || !currentRegion?.widgetIds.includes(normalizedWidgetId)) {
|
|
153
|
+
continue;
|
|
154
|
+
}
|
|
155
|
+
const widgetIds = currentRegion.widgetIds.filter((currentWidgetId) => currentWidgetId !== normalizedWidgetId);
|
|
156
|
+
const hiddenWidgetIds = (currentRegion.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId);
|
|
157
|
+
const visibleWidgetIds = widgetIds.filter((widgetId) => !hiddenWidgetIds.includes(widgetId));
|
|
158
|
+
nextShellState = updateShellRegion(nextShellState, currentRegionId, {
|
|
159
|
+
...currentRegion,
|
|
160
|
+
isVisible: visibleWidgetIds.length > 0 ? currentRegion.isVisible : false,
|
|
161
|
+
isOpen: visibleWidgetIds.length > 0 ? currentRegion.isOpen : false,
|
|
162
|
+
activeWidgetId: visibleWidgetIds.includes(currentRegion.activeWidgetId ?? '')
|
|
163
|
+
? currentRegion.activeWidgetId
|
|
164
|
+
: visibleWidgetIds[0] ?? null,
|
|
165
|
+
widgetIds,
|
|
166
|
+
hiddenWidgetIds
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const nextRegion = nextShellState.regions[regionId];
|
|
170
|
+
const widgetIds = insertShellWidgetId(nextRegion.widgetIds, normalizedWidgetId, placement);
|
|
171
|
+
return updateShellRegion(nextShellState, regionId, {
|
|
172
|
+
...nextRegion,
|
|
173
|
+
isVisible: true,
|
|
174
|
+
isOpen: true,
|
|
175
|
+
activeWidgetId: normalizedWidgetId,
|
|
176
|
+
widgetIds,
|
|
177
|
+
hiddenWidgetIds: (nextRegion.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId)
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
export function moveShellWidgetToRegion(shellState, targetRegionId, widgetId, placement = {}) {
|
|
181
|
+
const normalizedWidgetId = widgetId.trim();
|
|
182
|
+
const targetRegion = shellState.regions[targetRegionId];
|
|
183
|
+
if (!targetRegion || !normalizedWidgetId) {
|
|
184
|
+
return shellState;
|
|
185
|
+
}
|
|
186
|
+
let sourceRegionId = null;
|
|
187
|
+
let nextShellState = shellState;
|
|
188
|
+
const regionIds = ['left', 'right', 'bottom'];
|
|
189
|
+
for (const regionId of regionIds) {
|
|
190
|
+
const region = nextShellState.regions[regionId];
|
|
191
|
+
if (!region?.widgetIds.includes(normalizedWidgetId)) {
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
sourceRegionId = regionId;
|
|
195
|
+
if (regionId === targetRegionId) {
|
|
196
|
+
const widgetIds = insertShellWidgetId(region.widgetIds, normalizedWidgetId, placement);
|
|
197
|
+
return updateShellRegion(shellState, targetRegionId, {
|
|
198
|
+
...region,
|
|
199
|
+
isVisible: true,
|
|
200
|
+
isOpen: true,
|
|
201
|
+
activeWidgetId: normalizedWidgetId,
|
|
202
|
+
widgetIds,
|
|
203
|
+
hiddenWidgetIds: (region.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId)
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
const widgetIds = region.widgetIds.filter((currentWidgetId) => currentWidgetId !== normalizedWidgetId);
|
|
207
|
+
const hiddenWidgetIds = (region.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId);
|
|
208
|
+
const visibleWidgetIds = widgetIds.filter((widgetId) => !hiddenWidgetIds.includes(widgetId));
|
|
209
|
+
nextShellState = updateShellRegion(nextShellState, regionId, {
|
|
210
|
+
...region,
|
|
211
|
+
isVisible: visibleWidgetIds.length > 0 ? region.isVisible : false,
|
|
212
|
+
isOpen: visibleWidgetIds.length > 0 ? region.isOpen : false,
|
|
213
|
+
activeWidgetId: visibleWidgetIds.includes(region.activeWidgetId ?? '')
|
|
214
|
+
? region.activeWidgetId
|
|
215
|
+
: visibleWidgetIds[0] ?? null,
|
|
216
|
+
widgetIds,
|
|
217
|
+
hiddenWidgetIds
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (!sourceRegionId) {
|
|
221
|
+
return addShellWidgetToRegion(shellState, targetRegionId, normalizedWidgetId, placement);
|
|
222
|
+
}
|
|
223
|
+
const nextTargetRegion = nextShellState.regions[targetRegionId];
|
|
224
|
+
const widgetIds = insertShellWidgetId(nextTargetRegion.widgetIds, normalizedWidgetId, placement);
|
|
225
|
+
return updateShellRegion(nextShellState, targetRegionId, {
|
|
226
|
+
...nextTargetRegion,
|
|
227
|
+
isVisible: true,
|
|
228
|
+
isOpen: true,
|
|
229
|
+
activeWidgetId: normalizedWidgetId,
|
|
230
|
+
widgetIds,
|
|
231
|
+
hiddenWidgetIds: (nextTargetRegion.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId)
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
export function removeShellWidgetFromRegion(shellState, regionId, widgetId) {
|
|
235
|
+
const region = shellState.regions[regionId];
|
|
236
|
+
const normalizedWidgetId = widgetId.trim();
|
|
237
|
+
if (!region || !normalizedWidgetId || !region.widgetIds.includes(normalizedWidgetId)) {
|
|
238
|
+
return shellState;
|
|
239
|
+
}
|
|
240
|
+
const widgetIds = region.widgetIds.filter((currentWidgetId) => currentWidgetId !== normalizedWidgetId);
|
|
241
|
+
const hiddenWidgetIds = (region.hiddenWidgetIds ?? []).filter((hiddenWidgetId) => hiddenWidgetId !== normalizedWidgetId);
|
|
242
|
+
const visibleWidgetIds = widgetIds.filter((candidateId) => !hiddenWidgetIds.includes(candidateId));
|
|
243
|
+
const activeWidgetId = visibleWidgetIds.includes(region.activeWidgetId ?? '')
|
|
244
|
+
? region.activeWidgetId
|
|
245
|
+
: visibleWidgetIds[0] ?? null;
|
|
246
|
+
return updateShellRegion(shellState, regionId, {
|
|
247
|
+
...region,
|
|
248
|
+
isVisible: visibleWidgetIds.length > 0 ? region.isVisible : false,
|
|
249
|
+
isOpen: visibleWidgetIds.length > 0 ? region.isOpen : false,
|
|
250
|
+
activeWidgetId,
|
|
251
|
+
widgetIds,
|
|
252
|
+
hiddenWidgetIds
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function createShellRegionState(regionId, widgetCatalog, options = {}) {
|
|
256
|
+
const widgetIds = listShellWidgetsForRegion(widgetCatalog, regionId);
|
|
257
|
+
const shouldOpen = widgetIds.length > 0 && Boolean(options.openRegionIds?.includes(regionId));
|
|
258
|
+
return {
|
|
259
|
+
id: regionId,
|
|
260
|
+
isVisible: shouldOpen,
|
|
261
|
+
isOpen: shouldOpen,
|
|
262
|
+
size: DEFAULT_SHELL_REGION_SIZES[regionId],
|
|
263
|
+
activeWidgetId: widgetIds[0] ?? null,
|
|
264
|
+
widgetIds,
|
|
265
|
+
hiddenWidgetIds: [],
|
|
266
|
+
presentation: 'tabs',
|
|
267
|
+
axis: regionId === 'bottom' ? 'horizontal' : 'vertical'
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
function listShellWidgetsForRegion(widgetCatalog, regionId) {
|
|
271
|
+
const widgetIds = [];
|
|
272
|
+
if (!('list' in widgetCatalog) || typeof widgetCatalog.list !== 'function') {
|
|
273
|
+
return widgetIds;
|
|
274
|
+
}
|
|
275
|
+
for (const widget of widgetCatalog.list()) {
|
|
276
|
+
if (widget.defaultRegion === regionId && widget.initiallyConnected !== false) {
|
|
277
|
+
widgetIds.push(widget.id);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return widgetIds;
|
|
281
|
+
}
|
|
282
|
+
function isPlaceholderShellWidgetId(widgetId) {
|
|
283
|
+
return widgetId.endsWith('.empty');
|
|
284
|
+
}
|
|
285
|
+
function hasShellWidgetPlacement(placement) {
|
|
286
|
+
return hasDockPlacement(toDockPlacement(placement));
|
|
287
|
+
}
|
|
288
|
+
function insertShellWidgetId(widgetIds, widgetId, placement = {}) {
|
|
289
|
+
const baseWidgetIds = widgetIds
|
|
290
|
+
.filter((currentWidgetId) => !isPlaceholderShellWidgetId(currentWidgetId))
|
|
291
|
+
.filter((currentWidgetId) => currentWidgetId !== widgetId);
|
|
292
|
+
return insertDockableEntityId(baseWidgetIds, widgetId, toDockPlacement(placement));
|
|
293
|
+
}
|
|
294
|
+
function toDockPlacement(placement = {}) {
|
|
295
|
+
return {
|
|
296
|
+
beforeEntityId: placement.beforeWidgetId,
|
|
297
|
+
afterEntityId: placement.afterWidgetId
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function updateShellRegion(shellState, regionId, nextRegion) {
|
|
301
|
+
return {
|
|
302
|
+
...shellState,
|
|
303
|
+
regions: {
|
|
304
|
+
...shellState.regions,
|
|
305
|
+
[regionId]: nextRegion
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkbenchWidgetDefinition } from "../../domain/widget/model.js";
|
|
2
|
+
import type { RegisteredWorkbenchWidget, RegisteredWorkbenchWidgetComponentLoader } from "../../infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.js";
|
|
3
|
+
import { type WidgetDefinitionCatalog } from '@konitif/widgets';
|
|
4
|
+
export type WorkbenchWidgetHosting = Pick<WorkbenchWidgetDefinition, 'icon' | 'supportedSurfaces' | 'presentation'>;
|
|
5
|
+
/** Candidate bridge; neither registers nor loads, and owns no placement state. */
|
|
6
|
+
export declare function createWorkbenchWidgetAdapter(catalog: WidgetDefinitionCatalog, widgetId: string, load: RegisteredWorkbenchWidgetComponentLoader): Readonly<{
|
|
7
|
+
source: import("@konitif/widgets").WidgetDefinition;
|
|
8
|
+
project(host?: WorkbenchWidgetHosting): RegisteredWorkbenchWidget;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { bindWidgetImplementation } from '@konitif/widgets';
|
|
2
|
+
/** Candidate bridge; neither registers nor loads, and owns no placement state. */
|
|
3
|
+
export function createWorkbenchWidgetAdapter(catalog, widgetId, load) {
|
|
4
|
+
const binding = bindWidgetImplementation(catalog, widgetId, load);
|
|
5
|
+
return Object.freeze({
|
|
6
|
+
source: binding.definition,
|
|
7
|
+
project(host = {}) {
|
|
8
|
+
for (const key of ['id', 'title', 'description']) {
|
|
9
|
+
if (key in host)
|
|
10
|
+
throw new Error(`Host override of widget ${key} refused`);
|
|
11
|
+
}
|
|
12
|
+
const readingLevel = host.presentation?.readingLevel;
|
|
13
|
+
// This record is a disposable compatibility snapshot, not a second catalog.
|
|
14
|
+
const definition = {
|
|
15
|
+
id: binding.definition.id,
|
|
16
|
+
title: binding.definition.title,
|
|
17
|
+
description: binding.definition.description,
|
|
18
|
+
...(host.icon === undefined ? {} : { icon: typeof host.icon === 'string' ? host.icon : { ...host.icon } }),
|
|
19
|
+
...(host.supportedSurfaces === undefined ? {} : { supportedSurfaces: [...host.supportedSurfaces] }),
|
|
20
|
+
...(host.presentation === undefined ? {} : { presentation: {
|
|
21
|
+
...(readingLevel === undefined ? {} : { readingLevel: {
|
|
22
|
+
...readingLevel,
|
|
23
|
+
...(readingLevel.availableLevels === undefined ? {} : { availableLevels: [...readingLevel.availableLevels] })
|
|
24
|
+
} })
|
|
25
|
+
} })
|
|
26
|
+
};
|
|
27
|
+
return { definition, loadComponent: binding.load };
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createSplit } from "../../domain/workspace/factories.js";
|
|
2
|
+
import { normalizeSplitSizes } from "../../domain/layout/validation.js";
|
|
3
|
+
export function canonicalizeLayout(node) {
|
|
4
|
+
if (node.kind === 'stack') {
|
|
5
|
+
return node;
|
|
6
|
+
}
|
|
7
|
+
const leftChild = canonicalizeLayout(node.children[0]);
|
|
8
|
+
const rightChild = canonicalizeLayout(node.children[1]);
|
|
9
|
+
const segments = [
|
|
10
|
+
...collectCanonicalSegments(leftChild, node.orientation, node.sizes[0]),
|
|
11
|
+
...collectCanonicalSegments(rightChild, node.orientation, node.sizes[1])
|
|
12
|
+
];
|
|
13
|
+
if (segments.length === 2 && segments[0].node === leftChild && segments[1].node === rightChild) {
|
|
14
|
+
if (leftChild === node.children[0] && rightChild === node.children[1]) {
|
|
15
|
+
return node;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
...node,
|
|
19
|
+
children: [leftChild, rightChild],
|
|
20
|
+
sizes: normalizeSplitSizes(node.sizes)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const splitIds = collectCanonicalSplitIds(node, node.orientation).slice(0, Math.max(0, segments.length - 1));
|
|
24
|
+
return buildCanonicalSplitChain(node.orientation, segments, splitIds);
|
|
25
|
+
}
|
|
26
|
+
function collectCanonicalSegments(node, orientation, size) {
|
|
27
|
+
if (node.kind !== 'split' || node.orientation !== orientation) {
|
|
28
|
+
return [{ node, size }];
|
|
29
|
+
}
|
|
30
|
+
return [
|
|
31
|
+
...collectCanonicalSegments(node.children[0], orientation, size * node.sizes[0]),
|
|
32
|
+
...collectCanonicalSegments(node.children[1], orientation, size * node.sizes[1])
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
function buildCanonicalSplitChain(orientation, segments, splitIds) {
|
|
36
|
+
if (segments.length === 1) {
|
|
37
|
+
return segments[0].node;
|
|
38
|
+
}
|
|
39
|
+
if (segments.length === 2) {
|
|
40
|
+
const nextSizes = normalizeSplitSizes([segments[0].size, segments[1].size]);
|
|
41
|
+
const splitId = splitIds[0];
|
|
42
|
+
if (splitId) {
|
|
43
|
+
return {
|
|
44
|
+
id: splitId,
|
|
45
|
+
kind: 'split',
|
|
46
|
+
orientation,
|
|
47
|
+
children: [segments[0].node, segments[1].node],
|
|
48
|
+
sizes: nextSizes
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return createSplit(orientation, [segments[0].node, segments[1].node], nextSizes);
|
|
52
|
+
}
|
|
53
|
+
const splitIndex = resolveBalancedSplitIndex(segments);
|
|
54
|
+
const leftSegments = segments.slice(0, splitIndex);
|
|
55
|
+
const rightSegments = segments.slice(splitIndex);
|
|
56
|
+
const leftTotal = leftSegments.reduce((sum, segment) => sum + segment.size, 0);
|
|
57
|
+
const rightTotal = rightSegments.reduce((sum, segment) => sum + segment.size, 0);
|
|
58
|
+
const nextSizes = normalizeSplitSizes([leftTotal, rightTotal]);
|
|
59
|
+
const currentSplitId = splitIds[0];
|
|
60
|
+
const leftSplitCount = Math.max(0, leftSegments.length - 1);
|
|
61
|
+
const leftSplitIds = splitIds.slice(1, 1 + leftSplitCount);
|
|
62
|
+
const rightSplitIds = splitIds.slice(1 + leftSplitCount);
|
|
63
|
+
const leftNode = buildCanonicalSplitChain(orientation, leftSegments, leftSplitIds);
|
|
64
|
+
const rightNode = buildCanonicalSplitChain(orientation, rightSegments, rightSplitIds);
|
|
65
|
+
if (currentSplitId) {
|
|
66
|
+
return {
|
|
67
|
+
id: currentSplitId,
|
|
68
|
+
kind: 'split',
|
|
69
|
+
orientation,
|
|
70
|
+
children: [leftNode, rightNode],
|
|
71
|
+
sizes: nextSizes
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return createSplit(orientation, [leftNode, rightNode], nextSizes);
|
|
75
|
+
}
|
|
76
|
+
function collectCanonicalSplitIds(node, orientation) {
|
|
77
|
+
if (node.kind !== 'split' || node.orientation !== orientation) {
|
|
78
|
+
return [];
|
|
79
|
+
}
|
|
80
|
+
return [
|
|
81
|
+
node.id,
|
|
82
|
+
...collectCanonicalSplitIds(node.children[0], orientation),
|
|
83
|
+
...collectCanonicalSplitIds(node.children[1], orientation)
|
|
84
|
+
];
|
|
85
|
+
}
|
|
86
|
+
function resolveBalancedSplitIndex(segments) {
|
|
87
|
+
if (segments.length <= 2) {
|
|
88
|
+
return 1;
|
|
89
|
+
}
|
|
90
|
+
return Math.max(1, Math.min(segments.length - 1, Math.floor(segments.length / 2)));
|
|
91
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createStack } from "../../domain/workspace/factories.js";
|
|
2
|
+
import { getActiveWindow } from "../../domain/workspace/selectors.js";
|
|
3
|
+
import { pruneUnusedToolInstances, updateCanonicalizedActiveWindowRoot } from "./finalizeWorkspace.js";
|
|
4
|
+
import { findStackPathContainingPanel, replaceNodeAtPathAllowingRemoval } from "./layoutTree.js";
|
|
5
|
+
export function closePanel(workspace, input) {
|
|
6
|
+
const activeWindow = getActiveWindow(workspace);
|
|
7
|
+
if (!activeWindow) {
|
|
8
|
+
return workspace;
|
|
9
|
+
}
|
|
10
|
+
const stackPath = findStackPathContainingPanel(activeWindow.root, input.panelId);
|
|
11
|
+
if (!stackPath) {
|
|
12
|
+
return workspace;
|
|
13
|
+
}
|
|
14
|
+
const nextWorkspace = updateCanonicalizedActiveWindowRoot(workspace, () => replaceNodeAtPathAllowingRemoval(activeWindow.root, stackPath.trail, closePanelFromStack(stackPath.stack, input.panelId)) ?? createStack());
|
|
15
|
+
return pruneUnusedToolInstances(nextWorkspace);
|
|
16
|
+
}
|
|
17
|
+
function closePanelFromStack(stack, panelId) {
|
|
18
|
+
const closedPanelIndex = stack.children.findIndex((panel) => panel.id === panelId);
|
|
19
|
+
if (closedPanelIndex === -1) {
|
|
20
|
+
return stack;
|
|
21
|
+
}
|
|
22
|
+
const nextChildren = stack.children.filter((panel) => panel.id !== panelId);
|
|
23
|
+
if (nextChildren.length === 0) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const normalizedChildren = nextChildren;
|
|
27
|
+
const nextActiveChildId = selectActiveChildIdAfterClose(stack, panelId, closedPanelIndex, normalizedChildren);
|
|
28
|
+
return {
|
|
29
|
+
...stack,
|
|
30
|
+
children: normalizedChildren,
|
|
31
|
+
activeChildId: nextActiveChildId
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function selectActiveChildIdAfterClose(stack, panelId, closedPanelIndex, nextChildren) {
|
|
35
|
+
if (stack.activeChildId !== panelId) {
|
|
36
|
+
return stack.activeChildId;
|
|
37
|
+
}
|
|
38
|
+
const previousPanel = stack.children[closedPanelIndex - 1];
|
|
39
|
+
if (previousPanel) {
|
|
40
|
+
return previousPanel.id;
|
|
41
|
+
}
|
|
42
|
+
return nextChildren[0].id;
|
|
43
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { listPanels } from "../../domain/layout/selectors.js";
|
|
2
|
+
import { pruneUnusedToolInstances, updateCanonicalizedActiveWindowRoot } from "./finalizeWorkspace.js";
|
|
3
|
+
import { updateWorkspaceTargetWindow } from "./targetWindow.js";
|
|
4
|
+
export function collapseSplit(workspace, input) {
|
|
5
|
+
return updateWorkspaceTargetWindow(workspace, input.splitId, (selected) => collapseSplitInActiveWindow(selected, input));
|
|
6
|
+
}
|
|
7
|
+
function collapseSplitInActiveWindow(workspace, input) {
|
|
8
|
+
let removedNode = null;
|
|
9
|
+
let didCollapse = false;
|
|
10
|
+
const nextWorkspace = updateCanonicalizedActiveWindowRoot(workspace, (root) => {
|
|
11
|
+
const nextRoot = collapseSplitNode(root, input.splitId, input.removeChildIndex, (node) => {
|
|
12
|
+
removedNode = node;
|
|
13
|
+
didCollapse = true;
|
|
14
|
+
});
|
|
15
|
+
return didCollapse ? nextRoot : root;
|
|
16
|
+
});
|
|
17
|
+
if (!didCollapse || !removedNode) {
|
|
18
|
+
return workspace;
|
|
19
|
+
}
|
|
20
|
+
const removedToolInstanceIds = new Set(listPanels(removedNode)
|
|
21
|
+
.map((panel) => panel.toolInstanceId)
|
|
22
|
+
.filter((toolInstanceId) => !!toolInstanceId));
|
|
23
|
+
if (removedToolInstanceIds.size === 0) {
|
|
24
|
+
return nextWorkspace;
|
|
25
|
+
}
|
|
26
|
+
return pruneUnusedToolInstances(nextWorkspace, removedToolInstanceIds);
|
|
27
|
+
}
|
|
28
|
+
function collapseSplitNode(node, splitId, removeChildIndex, onCollapse) {
|
|
29
|
+
if (node.kind === 'stack') {
|
|
30
|
+
return node;
|
|
31
|
+
}
|
|
32
|
+
if (node.id === splitId) {
|
|
33
|
+
const removedNode = node.children[removeChildIndex];
|
|
34
|
+
const survivor = node.children[removeChildIndex === 0 ? 1 : 0];
|
|
35
|
+
onCollapse(removedNode);
|
|
36
|
+
return survivor;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
...node,
|
|
40
|
+
children: [
|
|
41
|
+
collapseSplitNode(node.children[0], splitId, removeChildIndex, onCollapse),
|
|
42
|
+
collapseSplitNode(node.children[1], splitId, removeChildIndex, onCollapse)
|
|
43
|
+
]
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
interface CollapseSplitBoundaryInput {
|
|
3
|
+
rootSplitId: string;
|
|
4
|
+
boundaryIndex: number;
|
|
5
|
+
removeSide: 'start' | 'end';
|
|
6
|
+
}
|
|
7
|
+
export declare function collapseSplitBoundary(workspace: Workspace, input: CollapseSplitBoundaryInput): Workspace;
|
|
8
|
+
export {};
|