@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,128 @@
|
|
|
1
|
+
import { containsPanel } from "../../domain/layout/selectors.js";
|
|
2
|
+
import { getActiveWindow } from "../../domain/workspace/selectors.js";
|
|
3
|
+
import { createPanel, createSplit, createStack } from "../../domain/workspace/factories.js";
|
|
4
|
+
import { canonicalizeLayout } from "./canonicalizeLayout.js";
|
|
5
|
+
import { replaceStackContainingPanel, updateActiveWindowRoot } from "./layoutTree.js";
|
|
6
|
+
import { updateWorkspaceTargetWindow } from "./targetWindow.js";
|
|
7
|
+
const MIN_SUBDIVISION_CUTS = 1;
|
|
8
|
+
const MAX_SUBDIVISION_CUTS = 5;
|
|
9
|
+
const MIN_POINTER_RATIO = 0.12;
|
|
10
|
+
const MAX_POINTER_RATIO = 0.88;
|
|
11
|
+
export function clampSubdivisionCuts(cuts) {
|
|
12
|
+
return Math.max(MIN_SUBDIVISION_CUTS, Math.min(MAX_SUBDIVISION_CUTS, Math.round(cuts)));
|
|
13
|
+
}
|
|
14
|
+
export function clampSubdivisionPointerRatio(pointerRatio) {
|
|
15
|
+
return Math.max(MIN_POINTER_RATIO, Math.min(MAX_POINTER_RATIO, Number(pointerRatio.toFixed(4))));
|
|
16
|
+
}
|
|
17
|
+
export function resolveSubdivisionAxis(orientation) {
|
|
18
|
+
return orientation === 'vertical' ? 'columns' : 'rows';
|
|
19
|
+
}
|
|
20
|
+
export function resolveLayoutOrientationForSubdivision(orientation) {
|
|
21
|
+
return orientation === 'vertical' ? 'horizontal' : 'vertical';
|
|
22
|
+
}
|
|
23
|
+
export function getSubdivisionSegmentSizes(edge, cuts, pointerRatio) {
|
|
24
|
+
const safeCuts = clampSubdivisionCuts(cuts);
|
|
25
|
+
const safePointerRatio = clampSubdivisionPointerRatio(pointerRatio);
|
|
26
|
+
const segmentCount = safeCuts + 1;
|
|
27
|
+
void edge;
|
|
28
|
+
void safePointerRatio;
|
|
29
|
+
const unit = Number((1 / segmentCount).toFixed(4));
|
|
30
|
+
const segments = Array.from({ length: segmentCount }, () => unit);
|
|
31
|
+
const normalizedTotal = Number(segments.reduce((sum, size) => sum + size, 0).toFixed(4));
|
|
32
|
+
const correction = Number((1 - normalizedTotal).toFixed(4));
|
|
33
|
+
if (correction !== 0) {
|
|
34
|
+
segments[segments.length - 1] = Number((segments[segments.length - 1] + correction).toFixed(4));
|
|
35
|
+
}
|
|
36
|
+
return segments;
|
|
37
|
+
}
|
|
38
|
+
export function getSubdivisionPreview(orientation, edge, cuts, pointerRatio) {
|
|
39
|
+
const segmentSizes = getSubdivisionSegmentSizes(edge, cuts, pointerRatio);
|
|
40
|
+
let cursor = 0;
|
|
41
|
+
const segmentRanges = segmentSizes.map((size, index) => {
|
|
42
|
+
const start = cursor * 100;
|
|
43
|
+
cursor += size;
|
|
44
|
+
const end = cursor * 100;
|
|
45
|
+
return {
|
|
46
|
+
index,
|
|
47
|
+
start: Number(start.toFixed(3)),
|
|
48
|
+
end: Number(end.toFixed(3)),
|
|
49
|
+
center: Number((((start + end) / 2)).toFixed(3))
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
axis: resolveSubdivisionAxis(orientation),
|
|
54
|
+
cutCount: clampSubdivisionCuts(cuts),
|
|
55
|
+
pointerRatio: clampSubdivisionPointerRatio(pointerRatio),
|
|
56
|
+
linePositions: segmentRanges.slice(0, -1).map((segment) => segment.end),
|
|
57
|
+
preservedSegmentIndex: resolveSubdivisionPreservedSegmentIndex(edge, cuts, pointerRatio),
|
|
58
|
+
segmentRanges
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export function resolveDefaultSubdivisionPreservedSegmentIndex(edge, cuts) {
|
|
62
|
+
const segmentCount = clampSubdivisionCuts(cuts) + 1;
|
|
63
|
+
return edge === 'left' || edge === 'top' ? segmentCount - 1 : 0;
|
|
64
|
+
}
|
|
65
|
+
export function resolveSubdivisionPreservedSegmentIndex(edge, cuts, pointerRatio) {
|
|
66
|
+
const safePointerRatio = clampSubdivisionPointerRatio(pointerRatio);
|
|
67
|
+
const segmentCount = clampSubdivisionCuts(cuts) + 1;
|
|
68
|
+
const layoutSegmentIndex = Math.min(segmentCount - 1, Math.floor(safePointerRatio * segmentCount));
|
|
69
|
+
return edge === 'left' || edge === 'top' ? layoutSegmentIndex : segmentCount - 1 - layoutSegmentIndex;
|
|
70
|
+
}
|
|
71
|
+
export function resolveSubdivisionSegmentPointerRatio(edge, cuts, segmentIndex) {
|
|
72
|
+
const safeCuts = clampSubdivisionCuts(cuts);
|
|
73
|
+
const segmentCount = safeCuts + 1;
|
|
74
|
+
const safeIndex = Math.max(0, Math.min(segmentCount - 1, Math.round(segmentIndex)));
|
|
75
|
+
const layoutSegmentIndex = edge === 'left' || edge === 'top' ? safeIndex : segmentCount - 1 - safeIndex;
|
|
76
|
+
return clampSubdivisionPointerRatio((layoutSegmentIndex + 0.5) / segmentCount);
|
|
77
|
+
}
|
|
78
|
+
export function subdividePanel(workspace, input) {
|
|
79
|
+
let result;
|
|
80
|
+
const nextWorkspace = updateWorkspaceTargetWindow(workspace, input.panelId, (selected) => {
|
|
81
|
+
result = subdividePanelInActiveWindow(selected, input);
|
|
82
|
+
return result.workspace;
|
|
83
|
+
});
|
|
84
|
+
return { ...result, workspace: nextWorkspace };
|
|
85
|
+
}
|
|
86
|
+
function subdividePanelInActiveWindow(workspace, input) {
|
|
87
|
+
const activeWindow = getActiveWindow(workspace);
|
|
88
|
+
if (!activeWindow || !containsPanel(activeWindow.root, input.panelId)) {
|
|
89
|
+
return {
|
|
90
|
+
workspace,
|
|
91
|
+
createdPanelIds: [],
|
|
92
|
+
originalPanelId: input.panelId
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const createdPanelIds = [];
|
|
96
|
+
const orientation = resolveLayoutOrientationForSubdivision(input.orientation);
|
|
97
|
+
const sizes = getSubdivisionSegmentSizes(input.edge, input.cuts, input.pointerRatio);
|
|
98
|
+
const preservedSegmentIndex = resolveSubdivisionPreservedSegmentIndex(input.edge, input.cuts, input.pointerRatio);
|
|
99
|
+
const nextRoot = replaceStackContainingPanel(activeWindow.root, input.panelId, (stack) => {
|
|
100
|
+
const replacementNodes = sizes.map((_, index) => {
|
|
101
|
+
const shouldPreserveOriginal = index === preservedSegmentIndex;
|
|
102
|
+
if (shouldPreserveOriginal) {
|
|
103
|
+
return stack;
|
|
104
|
+
}
|
|
105
|
+
const panel = createPanel('New panel');
|
|
106
|
+
createdPanelIds.push(panel.id);
|
|
107
|
+
return createStack([panel]);
|
|
108
|
+
});
|
|
109
|
+
return buildSubdivisionTree(orientation, replacementNodes, sizes);
|
|
110
|
+
});
|
|
111
|
+
return {
|
|
112
|
+
workspace: updateActiveWindowRoot(workspace, () => canonicalizeLayout(nextRoot)),
|
|
113
|
+
createdPanelIds,
|
|
114
|
+
originalPanelId: input.panelId
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function buildSubdivisionTree(orientation, nodes, sizes) {
|
|
118
|
+
if (nodes.length === 1) {
|
|
119
|
+
return nodes[0];
|
|
120
|
+
}
|
|
121
|
+
if (nodes.length === 2) {
|
|
122
|
+
return createSplit(orientation, [nodes[0], nodes[1]], [sizes[0], sizes[1]]);
|
|
123
|
+
}
|
|
124
|
+
const [headNode, ...tailNodes] = nodes;
|
|
125
|
+
const [headSize, ...tailSizes] = sizes;
|
|
126
|
+
const tailTotal = tailSizes.reduce((sum, size) => sum + size, 0);
|
|
127
|
+
return createSplit(orientation, [headNode, buildSubdivisionTree(orientation, tailNodes, tailSizes)], [headSize, tailTotal]);
|
|
128
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LayoutEdge } from "../../domain/layout/interaction.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
interface SwapPanelAreaInput {
|
|
4
|
+
panelId: string;
|
|
5
|
+
edge: LayoutEdge;
|
|
6
|
+
sourceAreaPanelIds?: readonly string[];
|
|
7
|
+
siblingAreaPanelIds?: readonly string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function canSwapPanelArea(workspace: Workspace, input: SwapPanelAreaInput): boolean;
|
|
10
|
+
export declare function swapPanelArea(workspace: Workspace, input: SwapPanelAreaInput): Workspace;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { containsPanel, listPanels } from "../../domain/layout/selectors.js";
|
|
2
|
+
import { getActiveWindow } from "../../domain/workspace/selectors.js";
|
|
3
|
+
import { canonicalizeLayout } from "./canonicalizeLayout.js";
|
|
4
|
+
import { updateActiveWindowRoot, updateSplitById } from "./layoutTree.js";
|
|
5
|
+
import { selectWorkspaceTargetWindow, updateWorkspaceTargetWindow } from "./targetWindow.js";
|
|
6
|
+
export function canSwapPanelArea(workspace, input) {
|
|
7
|
+
const activeWindow = getActiveWindow(selectWorkspaceTargetWindow(workspace, input.panelId));
|
|
8
|
+
if (!activeWindow || !containsPanel(activeWindow.root, input.panelId)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return findExplicitSwapCandidate(activeWindow.root, input) !== null || findSwapCandidate(activeWindow.root, input) !== null;
|
|
12
|
+
}
|
|
13
|
+
export function swapPanelArea(workspace, input) {
|
|
14
|
+
return updateWorkspaceTargetWindow(workspace, input.panelId, (selected) => swapPanelAreaInActiveWindow(selected, input));
|
|
15
|
+
}
|
|
16
|
+
function swapPanelAreaInActiveWindow(workspace, input) {
|
|
17
|
+
const activeWindow = getActiveWindow(workspace);
|
|
18
|
+
if (!activeWindow || !containsPanel(activeWindow.root, input.panelId)) {
|
|
19
|
+
return workspace;
|
|
20
|
+
}
|
|
21
|
+
const explicitCandidate = findExplicitSwapCandidate(activeWindow.root, input);
|
|
22
|
+
if (explicitCandidate) {
|
|
23
|
+
return updateActiveWindowRoot(workspace, (root) => canonicalizeLayout(swapNodesById(root, explicitCandidate.sourceNodeId, explicitCandidate.siblingNodeId)));
|
|
24
|
+
}
|
|
25
|
+
const candidate = findSwapCandidate(activeWindow.root, input);
|
|
26
|
+
if (!candidate) {
|
|
27
|
+
return workspace;
|
|
28
|
+
}
|
|
29
|
+
return updateActiveWindowRoot(workspace, (root) => canonicalizeLayout(updateSplitById(root, candidate.splitId, (split) => swapSplitChildren(split))));
|
|
30
|
+
}
|
|
31
|
+
function swapSplitChildren(split) {
|
|
32
|
+
return {
|
|
33
|
+
...split,
|
|
34
|
+
children: [split.children[1], split.children[0]],
|
|
35
|
+
sizes: [split.sizes[1], split.sizes[0]]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function findSwapCandidate(root, input) {
|
|
39
|
+
const { panelId, edge } = input;
|
|
40
|
+
const ancestors = findLayoutBranchAncestors(root, panelId);
|
|
41
|
+
const targetOrientation = edge === 'left' || edge === 'right' ? 'horizontal' : 'vertical';
|
|
42
|
+
const expectedChildIndex = edge === 'left' || edge === 'top' ? 1 : 0;
|
|
43
|
+
if (!ancestors) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
for (let index = ancestors.length - 1; index >= 0; index -= 1) {
|
|
47
|
+
const ancestor = ancestors[index];
|
|
48
|
+
if (ancestor.orientation === targetOrientation && ancestor.childIndex === expectedChildIndex) {
|
|
49
|
+
return {
|
|
50
|
+
splitId: ancestor.splitId
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
function findExplicitSwapCandidate(root, input) {
|
|
57
|
+
if (!input.sourceAreaPanelIds || !input.siblingAreaPanelIds) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
const expectedSourceIds = normalizePanelIdSet(input.sourceAreaPanelIds);
|
|
61
|
+
const expectedSiblingIds = normalizePanelIdSet(input.siblingAreaPanelIds);
|
|
62
|
+
if (expectedSourceIds.length === 0 || expectedSiblingIds.length === 0) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const sourceNode = findNodeByExactPanelSet(root, expectedSourceIds);
|
|
66
|
+
const siblingNode = findNodeByExactPanelSet(root, expectedSiblingIds);
|
|
67
|
+
if (!sourceNode ||
|
|
68
|
+
!siblingNode ||
|
|
69
|
+
sourceNode.id === siblingNode.id ||
|
|
70
|
+
containsNodeId(sourceNode, siblingNode.id) ||
|
|
71
|
+
containsNodeId(siblingNode, sourceNode.id)) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
sourceNodeId: sourceNode.id,
|
|
76
|
+
siblingNodeId: siblingNode.id
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function findNodeByExactPanelSet(node, expectedPanelIds) {
|
|
80
|
+
if (matchesPanelIdSet(normalizePanelIdSet(listPanelIds(node)), expectedPanelIds)) {
|
|
81
|
+
return node;
|
|
82
|
+
}
|
|
83
|
+
if (node.kind === 'stack') {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
return findNodeByExactPanelSet(node.children[0], expectedPanelIds) ?? findNodeByExactPanelSet(node.children[1], expectedPanelIds);
|
|
87
|
+
}
|
|
88
|
+
function listPanelIds(node) {
|
|
89
|
+
return listPanels(node).map((panel) => panel.id);
|
|
90
|
+
}
|
|
91
|
+
function normalizePanelIdSet(panelIds) {
|
|
92
|
+
return Array.from(new Set(panelIds)).sort();
|
|
93
|
+
}
|
|
94
|
+
function matchesPanelIdSet(left, right) {
|
|
95
|
+
if (left.length !== right.length) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
return left.every((panelId, index) => panelId === right[index]);
|
|
99
|
+
}
|
|
100
|
+
function swapNodesById(root, sourceNodeId, siblingNodeId) {
|
|
101
|
+
const sourceNode = findNodeById(root, sourceNodeId);
|
|
102
|
+
const siblingNode = findNodeById(root, siblingNodeId);
|
|
103
|
+
if (!sourceNode || !siblingNode) {
|
|
104
|
+
return root;
|
|
105
|
+
}
|
|
106
|
+
return replaceNodes(root, sourceNodeId, siblingNodeId, sourceNode, siblingNode);
|
|
107
|
+
}
|
|
108
|
+
function findNodeById(node, nodeId) {
|
|
109
|
+
if (node.id === nodeId) {
|
|
110
|
+
return node;
|
|
111
|
+
}
|
|
112
|
+
if (node.kind === 'stack') {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
return findNodeById(node.children[0], nodeId) ?? findNodeById(node.children[1], nodeId);
|
|
116
|
+
}
|
|
117
|
+
function containsNodeId(node, nodeId) {
|
|
118
|
+
if (node.id === nodeId) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
if (node.kind === 'stack') {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
return containsNodeId(node.children[0], nodeId) || containsNodeId(node.children[1], nodeId);
|
|
125
|
+
}
|
|
126
|
+
function replaceNodes(node, sourceNodeId, siblingNodeId, sourceNode, siblingNode) {
|
|
127
|
+
if (node.id === sourceNodeId) {
|
|
128
|
+
return siblingNode;
|
|
129
|
+
}
|
|
130
|
+
if (node.id === siblingNodeId) {
|
|
131
|
+
return sourceNode;
|
|
132
|
+
}
|
|
133
|
+
if (node.kind === 'stack') {
|
|
134
|
+
return node;
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
...node,
|
|
138
|
+
children: [
|
|
139
|
+
replaceNodes(node.children[0], sourceNodeId, siblingNodeId, sourceNode, siblingNode),
|
|
140
|
+
replaceNodes(node.children[1], sourceNodeId, siblingNodeId, sourceNode, siblingNode)
|
|
141
|
+
]
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
function findLayoutBranchAncestors(node, panelId, trail = []) {
|
|
145
|
+
if (node.kind === 'stack') {
|
|
146
|
+
return node.children.some((panel) => panel.id === panelId) ? trail : null;
|
|
147
|
+
}
|
|
148
|
+
for (let childIndex = 0; childIndex < node.children.length; childIndex = (childIndex + 1)) {
|
|
149
|
+
const child = node.children[childIndex];
|
|
150
|
+
const match = findLayoutBranchAncestors(child, panelId, [
|
|
151
|
+
...trail,
|
|
152
|
+
{
|
|
153
|
+
splitId: node.id,
|
|
154
|
+
orientation: node.orientation,
|
|
155
|
+
childIndex
|
|
156
|
+
}
|
|
157
|
+
]);
|
|
158
|
+
if (match) {
|
|
159
|
+
return match;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return null;
|
|
163
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
2
|
+
/** Resolve the mutation context from an explicit layout target, not remote focus. */
|
|
3
|
+
export declare function selectWorkspaceTargetWindow(workspace: Workspace, targetId: string | null | undefined): Workspace;
|
|
4
|
+
export declare function updateWorkspaceTargetWindow(workspace: Workspace, targetId: string, update: (selected: Workspace) => Workspace): Workspace;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { containsPanel, findStack, findSplit } from "../../domain/layout/selectors.js";
|
|
2
|
+
/** Resolve the mutation context from an explicit layout target, not remote focus. */
|
|
3
|
+
export function selectWorkspaceTargetWindow(workspace, targetId) {
|
|
4
|
+
if (!targetId)
|
|
5
|
+
return workspace;
|
|
6
|
+
const owner = workspace.windows.find(({ root }) => containsPanel(root, targetId) || findStack(root, targetId) || findSplit(root, targetId));
|
|
7
|
+
return owner && owner.id !== workspace.activeWindowId
|
|
8
|
+
? { ...workspace, activeWindowId: owner.id }
|
|
9
|
+
: workspace;
|
|
10
|
+
}
|
|
11
|
+
export function updateWorkspaceTargetWindow(workspace, targetId, update) {
|
|
12
|
+
const selected = selectWorkspaceTargetWindow(workspace, targetId);
|
|
13
|
+
const next = update(selected);
|
|
14
|
+
// A refused/no-op mutation must not change the active window by itself.
|
|
15
|
+
const unchangedWindows = next.windows.length === selected.windows.length && next.windows.every((window, index) => {
|
|
16
|
+
const previous = selected.windows[index];
|
|
17
|
+
return window.id === previous.id && window.root === previous.root && window.title === previous.title;
|
|
18
|
+
});
|
|
19
|
+
return unchangedWindows && next.toolInstances === selected.toolInstances
|
|
20
|
+
? workspace
|
|
21
|
+
: next;
|
|
22
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolDefinition } from "../../domain/tool/model.js";
|
|
2
|
+
import type { ToolRuntimeCapabilitySnapshot } from "../../domain/tool/runtime.js";
|
|
3
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
4
|
+
import type { WorkspaceFocus } from "./session.js";
|
|
5
|
+
export interface ResolveToolRuntimeCapabilitySnapshotInput {
|
|
6
|
+
consumerDefinition: ToolDefinition;
|
|
7
|
+
registeredDefinitions: readonly ToolDefinition[];
|
|
8
|
+
workspace: Workspace;
|
|
9
|
+
focus: WorkspaceFocus;
|
|
10
|
+
}
|
|
11
|
+
export declare function resolveToolRuntimeCapabilitySnapshot(input: ResolveToolRuntimeCapabilitySnapshotInput): ToolRuntimeCapabilitySnapshot;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isKonitifCapabilityVersionCompatible } from '@konitif/core';
|
|
2
|
+
import { listPanelsInWorkspace } from "../../domain/workspace/selectors.js";
|
|
3
|
+
export function resolveToolRuntimeCapabilitySnapshot(input) {
|
|
4
|
+
const placementsByToolId = collectToolPlacements(input.workspace);
|
|
5
|
+
const projections = Object.freeze((input.consumerDefinition.capabilities?.consumes ?? []).map((requirement) => {
|
|
6
|
+
const declaredProviders = input.registeredDefinitions.flatMap((definition) => (definition.capabilities?.provides ?? [])
|
|
7
|
+
.filter((provided) => provided.id === requirement.id)
|
|
8
|
+
.map((provided) => ({ definition, provided })));
|
|
9
|
+
const compatibleProviders = declaredProviders.filter(({ provided }) => isKonitifCapabilityVersionCompatible(provided.version, requirement.versionRange));
|
|
10
|
+
const providers = compatibleProviders.map(({ definition, provided }) => {
|
|
11
|
+
const placements = placementsByToolId.get(definition.id) ?? [];
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
toolId: definition.id,
|
|
14
|
+
capabilityVersion: provided.version,
|
|
15
|
+
toolVersion: null,
|
|
16
|
+
availability: resolveProviderAvailability(placements, input.focus),
|
|
17
|
+
panelIds: Object.freeze(placements.map((placement) => placement.panelId)),
|
|
18
|
+
toolInstanceIds: Object.freeze(placements.map((placement) => placement.toolInstance.id))
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
return Object.freeze({
|
|
22
|
+
requirement: Object.freeze({ ...requirement }),
|
|
23
|
+
availability: providers.some((provider) => provider.availability === 'active')
|
|
24
|
+
? 'active'
|
|
25
|
+
: providers.some((provider) => provider.availability === 'mounted')
|
|
26
|
+
? 'mounted'
|
|
27
|
+
: providers.length > 0
|
|
28
|
+
? 'available'
|
|
29
|
+
: declaredProviders.length > 0
|
|
30
|
+
? 'incompatible'
|
|
31
|
+
: 'missing',
|
|
32
|
+
providers: Object.freeze(providers)
|
|
33
|
+
});
|
|
34
|
+
}));
|
|
35
|
+
const projectionById = new Map(projections.map((projection) => [projection.requirement.id, projection]));
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
list: () => projections,
|
|
38
|
+
get: (capabilityId) => projectionById.get(capabilityId) ?? null
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function collectToolPlacements(workspace) {
|
|
42
|
+
const placements = new Map();
|
|
43
|
+
for (const panel of listPanelsInWorkspace(workspace)) {
|
|
44
|
+
const toolInstance = panel.toolInstanceId ? workspace.toolInstances[panel.toolInstanceId] : null;
|
|
45
|
+
if (!toolInstance) {
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
const entries = placements.get(toolInstance.toolId) ?? [];
|
|
49
|
+
entries.push({ panelId: panel.id, toolInstance });
|
|
50
|
+
placements.set(toolInstance.toolId, entries);
|
|
51
|
+
}
|
|
52
|
+
return placements;
|
|
53
|
+
}
|
|
54
|
+
function resolveProviderAvailability(placements, focus) {
|
|
55
|
+
if (placements.some((placement) => placement.toolInstance.id === focus.activeToolInstanceId)) {
|
|
56
|
+
return 'active';
|
|
57
|
+
}
|
|
58
|
+
return placements.length > 0 ? 'mounted' : 'available';
|
|
59
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { JsonObject } from "../../domain/shared/json.js";
|
|
2
|
+
import type { ToolRuntimeCapabilitySnapshot, ToolRuntimeContext } from "../../domain/tool/runtime.js";
|
|
3
|
+
import type { RuntimeProjectionSessionPatch } from "../runtime/RuntimeProjectionSessionTypes.js";
|
|
4
|
+
import type { ToolPanelLoadingState, ToolResourceLoadingState, ToolShellStatus } from "../../domain/tool/model.js";
|
|
5
|
+
import type { WorkbenchReadingLevel } from "../../domain/presentation/readingLevel.js";
|
|
6
|
+
import type { WorkspaceFocus } from "./session.js";
|
|
7
|
+
export interface ToolRuntimeHostActions {
|
|
8
|
+
updateToolState(toolInstanceId: string, nextState: JsonObject): boolean;
|
|
9
|
+
setToolPanelTitleOverride(panelId: string, toolInstanceId: string, nextTitle: string | null): boolean;
|
|
10
|
+
setToolShellStatus(toolInstanceId: string, nextStatus: ToolShellStatus | null): boolean;
|
|
11
|
+
setToolPanelLoading(toolInstanceId: string, nextLoading: ToolPanelLoadingState | null): boolean;
|
|
12
|
+
setToolResourceLoading(toolInstanceId: string, nextLoading: ToolResourceLoadingState | null): boolean;
|
|
13
|
+
patchRuntimeProjectionSession?(patch: RuntimeProjectionSessionPatch): boolean;
|
|
14
|
+
runToolCommand(panelId: string, toolInstanceId: string, commandId: string): boolean;
|
|
15
|
+
openTool(toolId: string): boolean;
|
|
16
|
+
canUndoHistory(): boolean;
|
|
17
|
+
canRedoHistory(): boolean;
|
|
18
|
+
undoHistory(): boolean;
|
|
19
|
+
redoHistory(): boolean;
|
|
20
|
+
}
|
|
21
|
+
interface CreateToolRuntimeContextInput {
|
|
22
|
+
panelId: string;
|
|
23
|
+
toolInstanceId: string;
|
|
24
|
+
focus: WorkspaceFocus;
|
|
25
|
+
hostActions: ToolRuntimeHostActions;
|
|
26
|
+
layoutEditingEnabled?: boolean;
|
|
27
|
+
readingLevel?: WorkbenchReadingLevel;
|
|
28
|
+
capabilities?: ToolRuntimeCapabilitySnapshot;
|
|
29
|
+
requestCapability?: (capabilityId: string) => boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function createToolRuntimeContext(input: CreateToolRuntimeContextInput): ToolRuntimeContext;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
const EMPTY_TOOL_RUNTIME_CAPABILITY_SNAPSHOT = Object.freeze({
|
|
2
|
+
list: () => [],
|
|
3
|
+
get: () => null
|
|
4
|
+
});
|
|
5
|
+
export function createToolRuntimeContext(input) {
|
|
6
|
+
const capabilitySnapshot = input.capabilities ?? EMPTY_TOOL_RUNTIME_CAPABILITY_SNAPSHOT;
|
|
7
|
+
return {
|
|
8
|
+
toolInstanceId: input.toolInstanceId,
|
|
9
|
+
panelId: input.panelId,
|
|
10
|
+
readingLevel: input.readingLevel ?? 'casual',
|
|
11
|
+
session: {
|
|
12
|
+
activePanelId: input.focus.activePanelId,
|
|
13
|
+
activeToolInstanceId: input.focus.activeToolInstanceId,
|
|
14
|
+
isActivePanel: input.focus.activePanelId === input.panelId,
|
|
15
|
+
isActiveToolInstance: input.focus.activeToolInstanceId === input.toolInstanceId,
|
|
16
|
+
layoutEditingEnabled: input.layoutEditingEnabled === true
|
|
17
|
+
},
|
|
18
|
+
capabilities: Object.freeze({
|
|
19
|
+
list: capabilitySnapshot.list,
|
|
20
|
+
get: capabilitySnapshot.get,
|
|
21
|
+
request(capabilityId) {
|
|
22
|
+
return (capabilitySnapshot.get(capabilityId) !== null && (input.requestCapability?.(capabilityId) ?? false));
|
|
23
|
+
}
|
|
24
|
+
}),
|
|
25
|
+
setState(nextState) {
|
|
26
|
+
return input.hostActions.updateToolState(input.toolInstanceId, nextState);
|
|
27
|
+
},
|
|
28
|
+
setPanelTitleOverride(nextTitle) {
|
|
29
|
+
return input.hostActions.setToolPanelTitleOverride(input.panelId, input.toolInstanceId, nextTitle);
|
|
30
|
+
},
|
|
31
|
+
setShellStatus(nextStatus) {
|
|
32
|
+
return input.hostActions.setToolShellStatus(input.toolInstanceId, nextStatus);
|
|
33
|
+
},
|
|
34
|
+
setPanelLoading(nextLoading) {
|
|
35
|
+
return input.hostActions.setToolPanelLoading(input.toolInstanceId, nextLoading);
|
|
36
|
+
},
|
|
37
|
+
setResourceLoading(nextLoading) {
|
|
38
|
+
return input.hostActions.setToolResourceLoading(input.toolInstanceId, nextLoading);
|
|
39
|
+
},
|
|
40
|
+
publishRuntimeProjectionSession(patch) {
|
|
41
|
+
return (input.hostActions.patchRuntimeProjectionSession?.({
|
|
42
|
+
...patch,
|
|
43
|
+
toolInstanceId: input.toolInstanceId
|
|
44
|
+
}) ?? false);
|
|
45
|
+
},
|
|
46
|
+
runCommand(commandId) {
|
|
47
|
+
return input.hostActions.runToolCommand(input.panelId, input.toolInstanceId, commandId);
|
|
48
|
+
},
|
|
49
|
+
openTool(toolId) {
|
|
50
|
+
return input.hostActions.openTool(toolId);
|
|
51
|
+
},
|
|
52
|
+
canUndoHistory() {
|
|
53
|
+
return input.hostActions.canUndoHistory();
|
|
54
|
+
},
|
|
55
|
+
canRedoHistory() {
|
|
56
|
+
return input.hostActions.canRedoHistory();
|
|
57
|
+
},
|
|
58
|
+
undoHistory() {
|
|
59
|
+
return input.hostActions.undoHistory();
|
|
60
|
+
},
|
|
61
|
+
redoHistory() {
|
|
62
|
+
return input.hostActions.redoHistory();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { JsonObject } from "../../domain/shared/json.js";
|
|
2
|
+
import type { Workspace } from "../../domain/workspace/model.js";
|
|
3
|
+
interface UpdateToolStateInput {
|
|
4
|
+
toolInstanceId: string;
|
|
5
|
+
nextState: JsonObject;
|
|
6
|
+
}
|
|
7
|
+
export declare function updateToolState(workspace: Workspace, input: UpdateToolStateInput): Workspace;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cloneJsonObject, isJsonObject } from "../../domain/shared/json.js";
|
|
2
|
+
export function updateToolState(workspace, input) {
|
|
3
|
+
if (!isJsonObject(input.nextState)) {
|
|
4
|
+
return workspace;
|
|
5
|
+
}
|
|
6
|
+
const toolInstance = workspace.toolInstances[input.toolInstanceId];
|
|
7
|
+
if (!toolInstance) {
|
|
8
|
+
return workspace;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
...workspace,
|
|
12
|
+
toolInstances: {
|
|
13
|
+
...workspace.toolInstances,
|
|
14
|
+
[input.toolInstanceId]: {
|
|
15
|
+
...toolInstance,
|
|
16
|
+
state: cloneJsonObject(input.nextState)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../application/boot/applicationBoot.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { BootExecutionState, BootPhase } from "./types.js";
|
|
2
|
+
export type BootEvent = {
|
|
3
|
+
type: 'boot:start';
|
|
4
|
+
executionId: string;
|
|
5
|
+
state: BootExecutionState;
|
|
6
|
+
} | {
|
|
7
|
+
type: 'boot:success';
|
|
8
|
+
executionId: string;
|
|
9
|
+
state: BootExecutionState;
|
|
10
|
+
} | {
|
|
11
|
+
type: 'boot:failed';
|
|
12
|
+
executionId: string;
|
|
13
|
+
state: BootExecutionState;
|
|
14
|
+
error: unknown;
|
|
15
|
+
} | {
|
|
16
|
+
type: 'phase:start';
|
|
17
|
+
executionId: string;
|
|
18
|
+
phase: BootPhase;
|
|
19
|
+
} | {
|
|
20
|
+
type: 'step:start';
|
|
21
|
+
executionId: string;
|
|
22
|
+
stepId: string;
|
|
23
|
+
} | {
|
|
24
|
+
type: 'step:success';
|
|
25
|
+
executionId: string;
|
|
26
|
+
stepId: string;
|
|
27
|
+
} | {
|
|
28
|
+
type: 'step:failed';
|
|
29
|
+
executionId: string;
|
|
30
|
+
stepId: string;
|
|
31
|
+
error: unknown;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'step:blocked';
|
|
34
|
+
executionId: string;
|
|
35
|
+
stepId: string;
|
|
36
|
+
reason: string;
|
|
37
|
+
};
|
|
38
|
+
export type BootEventSubscriber = (event: BootEvent) => void;
|
|
39
|
+
export interface BootEventBus {
|
|
40
|
+
subscribe(subscriber: BootEventSubscriber): () => void;
|
|
41
|
+
emit(event: BootEvent): void;
|
|
42
|
+
}
|
|
43
|
+
export declare function createBootEventBus(): BootEventBus;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function createBootEventBus() {
|
|
2
|
+
const subscribers = new Set();
|
|
3
|
+
return {
|
|
4
|
+
subscribe(subscriber) {
|
|
5
|
+
subscribers.add(subscriber);
|
|
6
|
+
return () => {
|
|
7
|
+
subscribers.delete(subscriber);
|
|
8
|
+
};
|
|
9
|
+
},
|
|
10
|
+
emit(event) {
|
|
11
|
+
for (const subscriber of subscribers) {
|
|
12
|
+
subscriber(event);
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type BootEventBus } from "./events.js";
|
|
2
|
+
import type { BootContext, BootExecutionState, BootGraph } from "./types.js";
|
|
3
|
+
export interface BootExecutor {
|
|
4
|
+
run(graph: BootGraph, ctx: BootContext): Promise<BootExecutionState>;
|
|
5
|
+
teardown(ctx: BootContext): Promise<BootExecutionState>;
|
|
6
|
+
getState(): BootExecutionState;
|
|
7
|
+
}
|
|
8
|
+
export interface CreateBootExecutorOptions {
|
|
9
|
+
eventBus?: BootEventBus;
|
|
10
|
+
now?: () => number;
|
|
11
|
+
createExecutionId?: () => string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createBootExecutor(options?: CreateBootExecutorOptions): BootExecutor;
|