@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,250 @@
|
|
|
1
|
+
export function resolveWorkbenchWidgetZone(composition, zoneId) {
|
|
2
|
+
const zone = composition.zones.find((entry) => entry.id === zoneId);
|
|
3
|
+
if (!zone) {
|
|
4
|
+
return null;
|
|
5
|
+
}
|
|
6
|
+
const allPlacements = listWorkbenchWidgetZonePlacements(composition, zoneId, { includeHidden: true });
|
|
7
|
+
const placements = listWorkbenchWidgetZonePlacements(composition, zoneId);
|
|
8
|
+
const activePlacementId = composition.activePlacementByZoneId?.[zoneId] ?? null;
|
|
9
|
+
const activePlacement = placements.find((placement) => placement.id === activePlacementId) ??
|
|
10
|
+
placements.find((placement) => placement.isPinned) ??
|
|
11
|
+
placements[0] ??
|
|
12
|
+
null;
|
|
13
|
+
return {
|
|
14
|
+
zone,
|
|
15
|
+
allPlacements,
|
|
16
|
+
placements,
|
|
17
|
+
activePlacement
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function listWorkbenchWidgetZonePlacements(composition, zoneId, options = {}) {
|
|
21
|
+
return composition.placements
|
|
22
|
+
.filter((placement) => placement.zoneId === zoneId && (options.includeHidden || placement.isVisible !== false))
|
|
23
|
+
.sort(compareWorkbenchWidgetPlacements);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Returns the placements rendered by a zone without transferring placement
|
|
27
|
+
* authority to the host component. Tab zones project only the active entity;
|
|
28
|
+
* stack zones project every visible entity in canonical order.
|
|
29
|
+
*/
|
|
30
|
+
export function listWorkbenchWidgetZoneRenderedPlacements(resolvedZone) {
|
|
31
|
+
if (!resolvedZone) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
return resolvedZone.zone.presentation === 'stack'
|
|
35
|
+
? resolvedZone.placements
|
|
36
|
+
: resolvedZone.activePlacement
|
|
37
|
+
? [resolvedZone.activePlacement]
|
|
38
|
+
: [];
|
|
39
|
+
}
|
|
40
|
+
export function compareWorkbenchWidgetPlacements(left, right) {
|
|
41
|
+
const leftOrder = Number.isFinite(left.order) ? Number(left.order) : 0;
|
|
42
|
+
const rightOrder = Number.isFinite(right.order) ? Number(right.order) : 0;
|
|
43
|
+
return leftOrder - rightOrder || left.title.localeCompare(right.title) || left.id.localeCompare(right.id);
|
|
44
|
+
}
|
|
45
|
+
export function activateWorkbenchWidgetPlacement(composition, zoneId, placementId) {
|
|
46
|
+
const placement = listWorkbenchWidgetZonePlacements(composition, zoneId)
|
|
47
|
+
.find((candidate) => candidate.id === placementId);
|
|
48
|
+
if (!placement) {
|
|
49
|
+
return composition;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
...composition,
|
|
53
|
+
activePlacementByZoneId: {
|
|
54
|
+
...composition.activePlacementByZoneId,
|
|
55
|
+
[zoneId]: placement.id
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export function moveWorkbenchWidgetPlacement(composition, move) {
|
|
60
|
+
const movingPlacement = composition.placements.find((placement) => placement.id === move.placementId);
|
|
61
|
+
const targetZone = composition.zones.find((zone) => zone.id === move.zoneId);
|
|
62
|
+
if (!movingPlacement || !targetZone) {
|
|
63
|
+
return composition;
|
|
64
|
+
}
|
|
65
|
+
const sourceZoneId = movingPlacement.zoneId;
|
|
66
|
+
const targetZoneId = targetZone.id;
|
|
67
|
+
const sourceWasActive = composition.activePlacementByZoneId?.[sourceZoneId] === movingPlacement.id;
|
|
68
|
+
const targetPlacements = listWorkbenchWidgetZonePlacements(composition, targetZoneId, { includeHidden: true })
|
|
69
|
+
.filter((placement) => placement.id !== movingPlacement.id);
|
|
70
|
+
const insertedTargetPlacements = insertWorkbenchWidgetPlacement(targetPlacements, movingPlacement, {
|
|
71
|
+
beforePlacementId: move.beforePlacementId ?? null,
|
|
72
|
+
afterPlacementId: move.afterPlacementId ?? null
|
|
73
|
+
});
|
|
74
|
+
const nextTargetOrders = createWorkbenchWidgetPlacementOrderMap(insertedTargetPlacements);
|
|
75
|
+
const nextSourceOrders = createWorkbenchWidgetPlacementOrderMap(listWorkbenchWidgetZonePlacements(composition, sourceZoneId, { includeHidden: true })
|
|
76
|
+
.filter((placement) => placement.id !== movingPlacement.id));
|
|
77
|
+
const nextPlacements = composition.placements.map((placement) => {
|
|
78
|
+
if (placement.id === movingPlacement.id) {
|
|
79
|
+
return {
|
|
80
|
+
...placement,
|
|
81
|
+
zoneId: targetZoneId,
|
|
82
|
+
order: nextTargetOrders.get(placement.id) ?? 0,
|
|
83
|
+
isVisible: true
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
if (placement.zoneId === targetZoneId) {
|
|
87
|
+
return {
|
|
88
|
+
...placement,
|
|
89
|
+
order: nextTargetOrders.get(placement.id) ?? placement.order
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (placement.zoneId === sourceZoneId) {
|
|
93
|
+
return {
|
|
94
|
+
...placement,
|
|
95
|
+
order: nextSourceOrders.get(placement.id) ?? placement.order
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return placement;
|
|
99
|
+
});
|
|
100
|
+
const nextComposition = {
|
|
101
|
+
...composition,
|
|
102
|
+
placements: nextPlacements,
|
|
103
|
+
activePlacementByZoneId: {
|
|
104
|
+
...composition.activePlacementByZoneId,
|
|
105
|
+
[targetZoneId]: movingPlacement.id
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
if (sourceWasActive && sourceZoneId !== targetZoneId) {
|
|
109
|
+
nextComposition.activePlacementByZoneId = {
|
|
110
|
+
...nextComposition.activePlacementByZoneId,
|
|
111
|
+
[sourceZoneId]: resolveWorkbenchWidgetZone(nextComposition, sourceZoneId)?.activePlacement?.id ?? null
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return nextComposition;
|
|
115
|
+
}
|
|
116
|
+
export function createWorkbenchWidgetZoneLayoutState(composition, zoneId) {
|
|
117
|
+
const zonePlacements = composition.placements
|
|
118
|
+
.filter((placement) => placement.zoneId === zoneId)
|
|
119
|
+
.sort(compareWorkbenchWidgetPlacements);
|
|
120
|
+
const zone = composition.zones.find((candidate) => candidate.id === zoneId);
|
|
121
|
+
const resolvedZone = resolveWorkbenchWidgetZone(composition, zoneId);
|
|
122
|
+
return {
|
|
123
|
+
activePlacementId: resolvedZone?.activePlacement?.id ?? null,
|
|
124
|
+
placementOrder: zonePlacements.map((placement) => placement.id),
|
|
125
|
+
hiddenPlacementIds: zonePlacements
|
|
126
|
+
.filter((placement) => placement.isVisible === false)
|
|
127
|
+
.map((placement) => placement.id),
|
|
128
|
+
pinnedPlacementIds: zonePlacements
|
|
129
|
+
.filter((placement) => placement.isPinned === true)
|
|
130
|
+
.map((placement) => placement.id),
|
|
131
|
+
presentation: zone?.presentation,
|
|
132
|
+
axis: zone?.axis
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export function applyWorkbenchWidgetZoneLayoutState(composition, layoutStateByZoneId) {
|
|
136
|
+
const nextZones = composition.zones.map((zone) => {
|
|
137
|
+
const layoutState = layoutStateByZoneId[zone.id];
|
|
138
|
+
if (!layoutState) {
|
|
139
|
+
return zone;
|
|
140
|
+
}
|
|
141
|
+
return {
|
|
142
|
+
...zone,
|
|
143
|
+
...(layoutState.presentation ? { presentation: layoutState.presentation } : {}),
|
|
144
|
+
...(layoutState.axis ? { axis: layoutState.axis } : {})
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
const nextPlacements = composition.placements.map((placement) => {
|
|
148
|
+
const layoutState = layoutStateByZoneId[placement.zoneId];
|
|
149
|
+
if (!layoutState) {
|
|
150
|
+
return placement;
|
|
151
|
+
}
|
|
152
|
+
const nextPlacement = { ...placement };
|
|
153
|
+
const orderIndex = layoutState.placementOrder?.indexOf(placement.id) ?? -1;
|
|
154
|
+
if (orderIndex >= 0) {
|
|
155
|
+
nextPlacement.order = orderIndex * 10;
|
|
156
|
+
}
|
|
157
|
+
if (layoutState.hiddenPlacementIds) {
|
|
158
|
+
nextPlacement.isVisible = !layoutState.hiddenPlacementIds.includes(placement.id);
|
|
159
|
+
}
|
|
160
|
+
if (layoutState.pinnedPlacementIds) {
|
|
161
|
+
nextPlacement.isPinned = layoutState.pinnedPlacementIds.includes(placement.id);
|
|
162
|
+
}
|
|
163
|
+
return nextPlacement;
|
|
164
|
+
});
|
|
165
|
+
let nextComposition = {
|
|
166
|
+
...composition,
|
|
167
|
+
zones: nextZones,
|
|
168
|
+
placements: nextPlacements,
|
|
169
|
+
activePlacementByZoneId: {
|
|
170
|
+
...composition.activePlacementByZoneId
|
|
171
|
+
}
|
|
172
|
+
};
|
|
173
|
+
for (const [zoneId, layoutState] of Object.entries(layoutStateByZoneId)) {
|
|
174
|
+
if (!layoutState) {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
const activePlacementId = layoutState.activePlacementId ?? null;
|
|
178
|
+
const activePlacement = activePlacementId
|
|
179
|
+
? listWorkbenchWidgetZonePlacements(nextComposition, zoneId).find((placement) => placement.id === activePlacementId)
|
|
180
|
+
: null;
|
|
181
|
+
const resolvedZone = resolveWorkbenchWidgetZone({
|
|
182
|
+
...nextComposition,
|
|
183
|
+
activePlacementByZoneId: {
|
|
184
|
+
...nextComposition.activePlacementByZoneId,
|
|
185
|
+
[zoneId]: activePlacement?.id ?? null
|
|
186
|
+
}
|
|
187
|
+
}, zoneId);
|
|
188
|
+
nextComposition = {
|
|
189
|
+
...nextComposition,
|
|
190
|
+
activePlacementByZoneId: {
|
|
191
|
+
...nextComposition.activePlacementByZoneId,
|
|
192
|
+
[zoneId]: activePlacement?.id ?? resolvedZone?.activePlacement?.id ?? null
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
return nextComposition;
|
|
197
|
+
}
|
|
198
|
+
export function createWorkbenchWidgetZoneComposition(input) {
|
|
199
|
+
const placements = input.placements.map((placement) => ({
|
|
200
|
+
...placement,
|
|
201
|
+
zoneId: input.zone.id,
|
|
202
|
+
isVisible: placement.isVisible ?? true
|
|
203
|
+
}));
|
|
204
|
+
const visiblePlacementIds = new Set(placements.filter((placement) => placement.isVisible !== false).map((placement) => placement.id));
|
|
205
|
+
const activePlacementId = input.activePlacementId && visiblePlacementIds.has(input.activePlacementId)
|
|
206
|
+
? input.activePlacementId
|
|
207
|
+
: placements.find((placement) => placement.isPinned && placement.isVisible !== false)?.id ??
|
|
208
|
+
placements.find((placement) => placement.isVisible !== false)?.id ??
|
|
209
|
+
null;
|
|
210
|
+
return {
|
|
211
|
+
zones: [input.zone],
|
|
212
|
+
placements,
|
|
213
|
+
activePlacementByZoneId: {
|
|
214
|
+
[input.zone.id]: activePlacementId
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
export function createSingleWorkbenchWidgetZoneComposition(input) {
|
|
219
|
+
return createWorkbenchWidgetZoneComposition({
|
|
220
|
+
zone: input.zone,
|
|
221
|
+
placements: [input.placement],
|
|
222
|
+
activePlacementId: input.placement.id
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
function insertWorkbenchWidgetPlacement(placements, movingPlacement, placement) {
|
|
226
|
+
const beforeIndex = placement.beforePlacementId
|
|
227
|
+
? placements.findIndex((candidate) => candidate.id === placement.beforePlacementId)
|
|
228
|
+
: -1;
|
|
229
|
+
if (beforeIndex >= 0) {
|
|
230
|
+
return [
|
|
231
|
+
...placements.slice(0, beforeIndex),
|
|
232
|
+
movingPlacement,
|
|
233
|
+
...placements.slice(beforeIndex)
|
|
234
|
+
];
|
|
235
|
+
}
|
|
236
|
+
const afterIndex = placement.afterPlacementId
|
|
237
|
+
? placements.findIndex((candidate) => candidate.id === placement.afterPlacementId)
|
|
238
|
+
: -1;
|
|
239
|
+
if (afterIndex >= 0) {
|
|
240
|
+
return [
|
|
241
|
+
...placements.slice(0, afterIndex + 1),
|
|
242
|
+
movingPlacement,
|
|
243
|
+
...placements.slice(afterIndex + 1)
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
return [...placements, movingPlacement];
|
|
247
|
+
}
|
|
248
|
+
function createWorkbenchWidgetPlacementOrderMap(placements) {
|
|
249
|
+
return new Map(placements.map((placement, index) => [placement.id, index * 10]));
|
|
250
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { WorkbenchIconInput } from "../icon/model.js";
|
|
2
|
+
import type { WorkbenchReadingLevel, WorkbenchReadingLevelPresentation } from "../presentation/readingLevel.js";
|
|
3
|
+
import type { WorkbenchWidgetPlacement, WorkbenchWidgetZoneDefinition, WorkbenchWidgetZoneSurface } from "./composition.js";
|
|
4
|
+
export type WorkbenchWidgetContext = Record<string, unknown>;
|
|
5
|
+
export interface WorkbenchWidgetDefinition {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
icon?: WorkbenchIconInput;
|
|
10
|
+
supportedSurfaces?: WorkbenchWidgetZoneSurface[];
|
|
11
|
+
presentation?: {
|
|
12
|
+
readingLevel?: WorkbenchReadingLevelPresentation;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface WorkbenchWidgetCatalogPort {
|
|
16
|
+
getDefinition(widgetId: string): WorkbenchWidgetDefinition | undefined;
|
|
17
|
+
list?(): WorkbenchWidgetDefinition[];
|
|
18
|
+
}
|
|
19
|
+
export interface WorkbenchWidgetRuntimeContext {
|
|
20
|
+
zone: WorkbenchWidgetZoneDefinition;
|
|
21
|
+
placement: WorkbenchWidgetPlacement;
|
|
22
|
+
context: WorkbenchWidgetContext;
|
|
23
|
+
/** Reading projection resolved by the Widget container, never by its content. */
|
|
24
|
+
readingLevel: WorkbenchReadingLevel;
|
|
25
|
+
}
|
|
26
|
+
export interface HostedWorkbenchWidgetProps {
|
|
27
|
+
definition: WorkbenchWidgetDefinition;
|
|
28
|
+
runtime: WorkbenchWidgetRuntimeContext;
|
|
29
|
+
}
|
|
30
|
+
export declare function createWorkbenchWidgetRuntimeContext(input: {
|
|
31
|
+
zone: WorkbenchWidgetZoneDefinition;
|
|
32
|
+
placement: WorkbenchWidgetPlacement;
|
|
33
|
+
context?: WorkbenchWidgetContext | null;
|
|
34
|
+
readingLevel?: WorkbenchReadingLevel;
|
|
35
|
+
}): WorkbenchWidgetRuntimeContext;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ShellRegionId, ShellRegionPresentation } from "../shell/model.js";
|
|
2
|
+
import type { JsonObject } from "../shared/json.js";
|
|
3
|
+
export type WorkbenchToolDockActionSide = 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
export interface WorkbenchToolDockVisibilityConfig {
|
|
5
|
+
dockId: string;
|
|
6
|
+
legacyVisibleKey?: string | null;
|
|
7
|
+
defaultVisible?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkbenchToolDockRootConfig extends WorkbenchToolDockVisibilityConfig {
|
|
10
|
+
commandId: string;
|
|
11
|
+
widgetId: string;
|
|
12
|
+
defaultRegionId: ShellRegionId;
|
|
13
|
+
}
|
|
14
|
+
export interface WorkbenchToolDockRootLocation {
|
|
15
|
+
regionId: ShellRegionId;
|
|
16
|
+
isVisible: boolean;
|
|
17
|
+
isOpen: boolean;
|
|
18
|
+
activeWidgetId: string | null;
|
|
19
|
+
presentation?: ShellRegionPresentation;
|
|
20
|
+
}
|
|
21
|
+
export declare function resolveWorkbenchToolDockSide(regionId: ShellRegionId | null | undefined): WorkbenchToolDockActionSide;
|
|
22
|
+
export declare function readWorkbenchToolDockVisibility(state: unknown, config: WorkbenchToolDockVisibilityConfig): boolean;
|
|
23
|
+
export declare function resolveWorkbenchToolDockEffectiveVisibility(input: {
|
|
24
|
+
rootLocation: WorkbenchToolDockRootLocation | null;
|
|
25
|
+
internalVisible: boolean;
|
|
26
|
+
widgetId: string;
|
|
27
|
+
}): boolean;
|
|
28
|
+
export declare function patchWorkbenchToolDockVisibilityState(state: unknown, input: WorkbenchToolDockVisibilityConfig & {
|
|
29
|
+
isVisible: boolean;
|
|
30
|
+
}): JsonObject;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function resolveWorkbenchToolDockSide(regionId) {
|
|
2
|
+
if (regionId === 'left' || regionId === 'right' || regionId === 'bottom') {
|
|
3
|
+
return regionId;
|
|
4
|
+
}
|
|
5
|
+
return 'left';
|
|
6
|
+
}
|
|
7
|
+
export function readWorkbenchToolDockVisibility(state, config) {
|
|
8
|
+
if (!isRecord(state)) {
|
|
9
|
+
return config.defaultVisible ?? false;
|
|
10
|
+
}
|
|
11
|
+
const dockContainers = state.dockContainers;
|
|
12
|
+
if (isRecord(dockContainers)) {
|
|
13
|
+
const dock = dockContainers[config.dockId];
|
|
14
|
+
if (isRecord(dock) && typeof dock.isVisible === 'boolean') {
|
|
15
|
+
return dock.isVisible;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (config.legacyVisibleKey && typeof state[config.legacyVisibleKey] === 'boolean') {
|
|
19
|
+
return state[config.legacyVisibleKey] === true;
|
|
20
|
+
}
|
|
21
|
+
return config.defaultVisible ?? false;
|
|
22
|
+
}
|
|
23
|
+
export function resolveWorkbenchToolDockEffectiveVisibility(input) {
|
|
24
|
+
const location = input.rootLocation;
|
|
25
|
+
if (!location) {
|
|
26
|
+
return input.internalVisible;
|
|
27
|
+
}
|
|
28
|
+
return location.isVisible && location.isOpen && (location.presentation === 'stack' || location.activeWidgetId === input.widgetId);
|
|
29
|
+
}
|
|
30
|
+
export function patchWorkbenchToolDockVisibilityState(state, input) {
|
|
31
|
+
const currentState = isRecord(state) ? state : {};
|
|
32
|
+
const dockContainers = isRecord(currentState.dockContainers) ? currentState.dockContainers : {};
|
|
33
|
+
const currentDock = dockContainers[input.dockId];
|
|
34
|
+
const currentDockState = isRecord(currentDock) ? currentDock : {};
|
|
35
|
+
const nextState = {
|
|
36
|
+
...currentState,
|
|
37
|
+
dockContainers: {
|
|
38
|
+
...dockContainers,
|
|
39
|
+
[input.dockId]: {
|
|
40
|
+
...currentDockState,
|
|
41
|
+
isVisible: input.isVisible
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (input.legacyVisibleKey) {
|
|
46
|
+
nextState[input.legacyVisibleKey] = input.isVisible;
|
|
47
|
+
}
|
|
48
|
+
return nextState;
|
|
49
|
+
}
|
|
50
|
+
function isRecord(value) {
|
|
51
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
52
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface WorkbenchDefinition {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
/**
|
|
6
|
+
* Ordered list of tools exposed inside this contextualized workbench.
|
|
7
|
+
* The first entry can be used as a sensible launcher fallback.
|
|
8
|
+
*/
|
|
9
|
+
toolIds: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Optional preferred tool opened when the workbench boots.
|
|
12
|
+
* Must belong to `toolIds` when provided.
|
|
13
|
+
*/
|
|
14
|
+
defaultToolId?: string | null;
|
|
15
|
+
/**
|
|
16
|
+
* Optional workspace preset reference resolved by the app layer.
|
|
17
|
+
* Kept as a string on purpose so `core` does not depend on product-specific preset ids yet.
|
|
18
|
+
*/
|
|
19
|
+
layoutPresetId?: string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Optional shell widget subset exposed by this workbench.
|
|
22
|
+
*/
|
|
23
|
+
shellWidgetIds?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Optional route handle used by the app layer to bind URLs to a contextual workbench.
|
|
26
|
+
*/
|
|
27
|
+
route?: {
|
|
28
|
+
page?: string | null;
|
|
29
|
+
workbench?: string | null;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface WorkbenchCatalog {
|
|
33
|
+
getDefinition(workbenchId: string): WorkbenchDefinition | undefined;
|
|
34
|
+
list(): WorkbenchDefinition[];
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type WorkbenchRoute = {
|
|
2
|
+
kind: 'workspace';
|
|
3
|
+
} | {
|
|
4
|
+
kind: 'docs';
|
|
5
|
+
tab?: string | null;
|
|
6
|
+
} | {
|
|
7
|
+
kind: 'lab';
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'tool';
|
|
10
|
+
toolId: string;
|
|
11
|
+
} | {
|
|
12
|
+
kind: 'shell';
|
|
13
|
+
region: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function parseWorkbenchRoute(href: string): WorkbenchRoute;
|
|
16
|
+
export declare function createWorkbenchRouteHref(currentHref: string, route: WorkbenchRoute): string;
|
|
17
|
+
export declare function createWorkbenchRoutePath(route: WorkbenchRoute): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
const ROUTE_SEARCH_PARAMS = ['view', 'docsTab', 'page', 'tool'];
|
|
2
|
+
const WORKBENCH_ROUTE_BASE_SEGMENTS = new Set(['__workbench_dev__']);
|
|
3
|
+
export function parseWorkbenchRoute(href) {
|
|
4
|
+
const url = new URL(href, 'http://workbench.local');
|
|
5
|
+
const parts = getWorkbenchRouteParts(url.pathname);
|
|
6
|
+
if (parts[0] === 'docs') {
|
|
7
|
+
return { kind: 'docs', tab: parts[1] ?? null };
|
|
8
|
+
}
|
|
9
|
+
if (parts[0] === 'shortcuts') {
|
|
10
|
+
return { kind: 'docs', tab: 'shortcuts' };
|
|
11
|
+
}
|
|
12
|
+
if (parts[0] === 'forge' || parts[0] === 'lab') {
|
|
13
|
+
return { kind: 'lab' };
|
|
14
|
+
}
|
|
15
|
+
if (parts[0] === 'tools' && parts[1]) {
|
|
16
|
+
return { kind: 'tool', toolId: parts[1] };
|
|
17
|
+
}
|
|
18
|
+
if (parts[0] === 'shell' && parts[1]) {
|
|
19
|
+
return { kind: 'shell', region: parts.slice(1).join('/') };
|
|
20
|
+
}
|
|
21
|
+
return { kind: 'workspace' };
|
|
22
|
+
}
|
|
23
|
+
export function createWorkbenchRouteHref(currentHref, route) {
|
|
24
|
+
const url = new URL(currentHref, 'http://workbench.local');
|
|
25
|
+
url.pathname = joinWorkbenchRoutePath(getWorkbenchRouteBasePath(url.pathname), createWorkbenchRoutePath(route));
|
|
26
|
+
for (const param of ROUTE_SEARCH_PARAMS) {
|
|
27
|
+
url.searchParams.delete(param);
|
|
28
|
+
}
|
|
29
|
+
return url.toString();
|
|
30
|
+
}
|
|
31
|
+
export function createWorkbenchRoutePath(route) {
|
|
32
|
+
switch (route.kind) {
|
|
33
|
+
case 'docs':
|
|
34
|
+
return route.tab ? `/docs/${encodeURIComponent(route.tab)}` : '/docs';
|
|
35
|
+
case 'lab':
|
|
36
|
+
return '/forge';
|
|
37
|
+
case 'tool':
|
|
38
|
+
return `/tools/${encodeURIComponent(route.toolId)}`;
|
|
39
|
+
case 'shell':
|
|
40
|
+
return `/shell/${route.region.split('/').filter(Boolean).map(encodeURIComponent).join('/')}`;
|
|
41
|
+
case 'workspace':
|
|
42
|
+
default:
|
|
43
|
+
return '/';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function normalizeWorkbenchPath(path) {
|
|
47
|
+
if (!path || path === '/') {
|
|
48
|
+
return '/';
|
|
49
|
+
}
|
|
50
|
+
return path.replace(/\/+$/, '') || '/';
|
|
51
|
+
}
|
|
52
|
+
function getWorkbenchRouteParts(pathname) {
|
|
53
|
+
const parts = normalizeWorkbenchPath(pathname).split('/').filter(Boolean).map(decodeURIComponent);
|
|
54
|
+
return WORKBENCH_ROUTE_BASE_SEGMENTS.has(parts[0] ?? '') ? parts.slice(1) : parts;
|
|
55
|
+
}
|
|
56
|
+
function getWorkbenchRouteBasePath(pathname) {
|
|
57
|
+
const firstPart = normalizeWorkbenchPath(pathname).split('/').filter(Boolean)[0];
|
|
58
|
+
if (!firstPart) {
|
|
59
|
+
return '';
|
|
60
|
+
}
|
|
61
|
+
const decodedFirstPart = decodeURIComponent(firstPart);
|
|
62
|
+
return WORKBENCH_ROUTE_BASE_SEGMENTS.has(decodedFirstPart) ? `/${encodeURIComponent(decodedFirstPart)}` : '';
|
|
63
|
+
}
|
|
64
|
+
function joinWorkbenchRoutePath(basePath, routePath) {
|
|
65
|
+
if (!basePath) {
|
|
66
|
+
return routePath;
|
|
67
|
+
}
|
|
68
|
+
if (routePath === '/') {
|
|
69
|
+
return `${basePath}/`;
|
|
70
|
+
}
|
|
71
|
+
return `${basePath}${routePath}`;
|
|
72
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NonEmptyArray, SplitOrientation, SplitNode, StackNode } from "../layout/model.js";
|
|
2
|
+
import type { PanelNode } from "../panel/model.js";
|
|
3
|
+
import type { Workspace, WorkspaceWindow } from "./model.js";
|
|
4
|
+
import type { LayoutNode } from "../layout/model.js";
|
|
5
|
+
export declare function createPanel(title?: string): PanelNode;
|
|
6
|
+
export declare function createStack(panels?: NonEmptyArray<PanelNode>): StackNode;
|
|
7
|
+
export declare function createSplit(orientation: SplitOrientation, children: readonly [StackNode | SplitNode, StackNode | SplitNode], sizes?: [number, number]): SplitNode;
|
|
8
|
+
export declare function createWorkspaceWindow(root?: LayoutNode, title?: string): WorkspaceWindow;
|
|
9
|
+
export declare function createWorkspaceShell(window?: WorkspaceWindow): Workspace;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { createId } from "../shared/id.js";
|
|
2
|
+
import { normalizeSplitSizes } from "../layout/validation.js";
|
|
3
|
+
import { WORKSPACE_SNAPSHOT_VERSION } from "./validation.js";
|
|
4
|
+
export function createPanel(title = 'Untitled panel') {
|
|
5
|
+
return {
|
|
6
|
+
id: createId('panel'),
|
|
7
|
+
title,
|
|
8
|
+
toolInstanceId: null,
|
|
9
|
+
showFullscreenToggle: true
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export function createStack(panels = [createPanel()]) {
|
|
13
|
+
return {
|
|
14
|
+
id: createId('stack'),
|
|
15
|
+
kind: 'stack',
|
|
16
|
+
activeChildId: panels[0].id,
|
|
17
|
+
headerVisible: true,
|
|
18
|
+
children: panels
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export function createSplit(orientation, children, sizes = [1, 1]) {
|
|
22
|
+
return {
|
|
23
|
+
id: createId('split'),
|
|
24
|
+
kind: 'split',
|
|
25
|
+
orientation,
|
|
26
|
+
sizes: normalizeSplitSizes(sizes),
|
|
27
|
+
children
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function createWorkspaceWindow(root = createStack(), title = 'Primary Window') {
|
|
31
|
+
return {
|
|
32
|
+
id: createId('window'),
|
|
33
|
+
title,
|
|
34
|
+
root
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function createWorkspaceShell(window = createWorkspaceWindow()) {
|
|
38
|
+
return {
|
|
39
|
+
id: createId('workspace'),
|
|
40
|
+
version: WORKSPACE_SNAPSHOT_VERSION,
|
|
41
|
+
activeWindowId: window.id,
|
|
42
|
+
fullscreenPanelId: null,
|
|
43
|
+
designSystemThemeSession: null,
|
|
44
|
+
windows: [window],
|
|
45
|
+
toolInstances: {}
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { LayoutNode } from "../layout/model.js";
|
|
2
|
+
import type { ToolInstance } from "../tool/model.js";
|
|
3
|
+
import type { DesignSystemThemeSession } from "../design-system/themeSession.js";
|
|
4
|
+
export interface WorkspaceWindow {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
root: LayoutNode;
|
|
8
|
+
}
|
|
9
|
+
export interface WorkspacePresetProvenance {
|
|
10
|
+
id: string;
|
|
11
|
+
version: string | null;
|
|
12
|
+
status: 'exact' | 'customized';
|
|
13
|
+
}
|
|
14
|
+
export interface Workspace {
|
|
15
|
+
id: string;
|
|
16
|
+
version: number;
|
|
17
|
+
activeWindowId: string;
|
|
18
|
+
fullscreenPanelId?: string | null;
|
|
19
|
+
designSystemThemeSession?: DesignSystemThemeSession | null;
|
|
20
|
+
presetProvenance?: WorkspacePresetProvenance | null;
|
|
21
|
+
windows: WorkspaceWindow[];
|
|
22
|
+
toolInstances: Record<string, ToolInstance>;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { PanelNode } from "../panel/model.js";
|
|
2
|
+
import type { ToolInstance } from "../tool/model.js";
|
|
3
|
+
import type { Workspace, WorkspaceWindow } from "./model.js";
|
|
4
|
+
export declare function getWindowById(workspace: Workspace, windowId: string): WorkspaceWindow | undefined;
|
|
5
|
+
export declare function getActiveWindow(workspace: Workspace): WorkspaceWindow | undefined;
|
|
6
|
+
export declare function findWindowContainingPanel(workspace: Workspace, panelId: string): WorkspaceWindow | undefined;
|
|
7
|
+
export declare function findPanelInWorkspace(workspace: Workspace, panelId: string): PanelNode | undefined;
|
|
8
|
+
export declare function findStackInWorkspace(workspace: Workspace, stackId: string): import("../../index.js").StackNode | undefined;
|
|
9
|
+
export declare function findStackContainingPanelInWorkspace(workspace: Workspace, panelId: string): import("../../index.js").StackNode | undefined;
|
|
10
|
+
export declare function findSplitInWorkspace(workspace: Workspace, splitId: string): import("../../index.js").SplitNode | undefined;
|
|
11
|
+
export declare function listPanelsInWorkspace(workspace: Workspace): PanelNode[];
|
|
12
|
+
export declare function findToolPlacementByToolId(workspace: Workspace, toolId: string): {
|
|
13
|
+
panelId: string;
|
|
14
|
+
toolInstanceId: string;
|
|
15
|
+
toolInstance: ToolInstance;
|
|
16
|
+
} | undefined;
|
|
17
|
+
export declare function collectReferencedToolInstanceIds(workspace: Workspace): Set<string>;
|
|
18
|
+
export declare function getPreferredFocusedPanelId(workspace: Workspace): string | null;
|
|
19
|
+
export declare function listToolInstances(workspace: Workspace): ToolInstance[];
|