@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,15 @@
|
|
|
1
|
+
import type { WorkbenchProjectApp, WorkbenchProjectLaunchProfile, WorkbenchProjectManifest, WorkbenchProjectRepository, WorkbenchProjectTargetKind } from "../../domain/project/model.js";
|
|
2
|
+
export interface CreateWorkbenchProjectManifestInput {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
apps?: WorkbenchProjectApp[];
|
|
6
|
+
repositories?: WorkbenchProjectRepository[];
|
|
7
|
+
launchProfiles?: WorkbenchProjectLaunchProfile[];
|
|
8
|
+
createdAt?: string;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function createWorkbenchProjectManifest(input: CreateWorkbenchProjectManifestInput, now?: string): WorkbenchProjectManifest;
|
|
12
|
+
export declare function createDefaultProjectLaunchProfiles(): WorkbenchProjectLaunchProfile[];
|
|
13
|
+
export declare function addProjectRepository(manifest: WorkbenchProjectManifest, repository: WorkbenchProjectRepository, now?: string): WorkbenchProjectManifest;
|
|
14
|
+
export declare function addProjectApp(manifest: WorkbenchProjectManifest, app: WorkbenchProjectApp, now?: string): WorkbenchProjectManifest;
|
|
15
|
+
export declare function resolveProjectDefaultLaunchProfile(manifest: WorkbenchProjectManifest, targetKind: WorkbenchProjectTargetKind | 'self', targetProfileId?: string | null): WorkbenchProjectLaunchProfile | null;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export function createWorkbenchProjectManifest(input, now = new Date().toISOString()) {
|
|
2
|
+
return {
|
|
3
|
+
id: input.id,
|
|
4
|
+
label: input.label,
|
|
5
|
+
version: 1,
|
|
6
|
+
apps: dedupeById(input.apps ?? []),
|
|
7
|
+
repositories: dedupeById(input.repositories ?? []),
|
|
8
|
+
launchProfiles: dedupeById(input.launchProfiles ?? createDefaultProjectLaunchProfiles()),
|
|
9
|
+
policies: {
|
|
10
|
+
allowLocalRepositories: true,
|
|
11
|
+
allowSandboxRepositories: true,
|
|
12
|
+
requirePreflight: true
|
|
13
|
+
},
|
|
14
|
+
recentSessions: [],
|
|
15
|
+
observability: {
|
|
16
|
+
quality: 'medium',
|
|
17
|
+
persistSnapshots: false,
|
|
18
|
+
captureStackTraces: true
|
|
19
|
+
},
|
|
20
|
+
createdAt: input.createdAt ?? now,
|
|
21
|
+
updatedAt: input.updatedAt ?? now
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function createDefaultProjectLaunchProfiles() {
|
|
25
|
+
return [
|
|
26
|
+
{
|
|
27
|
+
id: 'profile.core-only',
|
|
28
|
+
label: 'Core-only',
|
|
29
|
+
kind: 'core-only',
|
|
30
|
+
targetKind: 'self',
|
|
31
|
+
defaultFor: 'self',
|
|
32
|
+
inspectOnly: true,
|
|
33
|
+
safeMode: true
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'profile.repo-inspect-only',
|
|
37
|
+
label: 'Repo inspect-only',
|
|
38
|
+
kind: 'repo-inspect-only',
|
|
39
|
+
targetKind: 'repository',
|
|
40
|
+
defaultFor: null,
|
|
41
|
+
inspectOnly: true,
|
|
42
|
+
safeMode: true
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'profile.app-safe-mode',
|
|
46
|
+
label: 'App safe mode',
|
|
47
|
+
kind: 'app-safe-mode',
|
|
48
|
+
targetKind: 'app',
|
|
49
|
+
defaultFor: null,
|
|
50
|
+
inspectOnly: false,
|
|
51
|
+
safeMode: true
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'profile.app-full-runtime',
|
|
55
|
+
label: 'App full runtime',
|
|
56
|
+
kind: 'app-full-runtime',
|
|
57
|
+
targetKind: 'app',
|
|
58
|
+
defaultFor: 'app',
|
|
59
|
+
inspectOnly: false,
|
|
60
|
+
safeMode: false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: 'profile.sandbox-runtime',
|
|
64
|
+
label: 'Sandbox runtime',
|
|
65
|
+
kind: 'sandbox-runtime',
|
|
66
|
+
targetKind: 'repository',
|
|
67
|
+
defaultFor: 'repository',
|
|
68
|
+
inspectOnly: false,
|
|
69
|
+
safeMode: false
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: 'profile.recovery-mode',
|
|
73
|
+
label: 'Recovery mode',
|
|
74
|
+
kind: 'recovery-mode',
|
|
75
|
+
targetKind: 'self',
|
|
76
|
+
defaultFor: null,
|
|
77
|
+
inspectOnly: true,
|
|
78
|
+
safeMode: true
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
export function addProjectRepository(manifest, repository, now = new Date().toISOString()) {
|
|
83
|
+
return {
|
|
84
|
+
...manifest,
|
|
85
|
+
repositories: upsertById(manifest.repositories, repository),
|
|
86
|
+
updatedAt: now
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
export function addProjectApp(manifest, app, now = new Date().toISOString()) {
|
|
90
|
+
return {
|
|
91
|
+
...manifest,
|
|
92
|
+
apps: upsertById(manifest.apps, app),
|
|
93
|
+
updatedAt: now
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export function resolveProjectDefaultLaunchProfile(manifest, targetKind, targetProfileId) {
|
|
97
|
+
return (manifest.launchProfiles.find((profile) => profile.id === targetProfileId) ??
|
|
98
|
+
manifest.launchProfiles.find((profile) => profile.defaultFor === targetKind) ??
|
|
99
|
+
null);
|
|
100
|
+
}
|
|
101
|
+
function dedupeById(items) {
|
|
102
|
+
return [...new Map(items.map((item) => [item.id, item])).values()];
|
|
103
|
+
}
|
|
104
|
+
function upsertById(items, nextItem) {
|
|
105
|
+
const nextItems = items.filter((item) => item.id !== nextItem.id);
|
|
106
|
+
return [...nextItems, nextItem];
|
|
107
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { LaunchPreflightSummary, LaunchTarget } from "../../domain/launch/model.js";
|
|
2
|
+
import type { RepositoryInspectionInput, RepositoryInspectionSnapshot } from "../../domain/repository/model.js";
|
|
3
|
+
export declare class RepositoryPreflightEngine {
|
|
4
|
+
inspect(input: RepositoryInspectionInput, now?: string): RepositoryInspectionSnapshot;
|
|
5
|
+
}
|
|
6
|
+
export declare function createRepositoryLaunchPreflightSummary(target: LaunchTarget, report: RepositoryInspectionSnapshot, now?: string): LaunchPreflightSummary;
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
const CONFIG_FILES = [
|
|
2
|
+
'package.json',
|
|
3
|
+
'pnpm-workspace.yaml',
|
|
4
|
+
'vite.config.ts',
|
|
5
|
+
'vite.config.js',
|
|
6
|
+
'svelte.config.js',
|
|
7
|
+
'svelte.config.ts',
|
|
8
|
+
'tsconfig.json',
|
|
9
|
+
'eslint.config.js',
|
|
10
|
+
'playwright.config.ts',
|
|
11
|
+
'vitest.config.ts'
|
|
12
|
+
];
|
|
13
|
+
export class RepositoryPreflightEngine {
|
|
14
|
+
inspect(input, now = new Date().toISOString()) {
|
|
15
|
+
const root = input.root.trim();
|
|
16
|
+
const files = new Set((input.files ?? []).map(normalizeRepoPath));
|
|
17
|
+
const packageManager = detectPackageManager(files);
|
|
18
|
+
const dependencies = normalizeDependencies(input.packageJson);
|
|
19
|
+
const frameworks = detectFrameworks(files, dependencies);
|
|
20
|
+
const buildTools = detectBuildTools(files, dependencies, input.packageJson?.scripts);
|
|
21
|
+
const scripts = normalizeScripts(input.packageJson?.scripts);
|
|
22
|
+
const workspaces = normalizeWorkspaces(input.packageJson?.workspaces);
|
|
23
|
+
const configs = CONFIG_FILES.filter((file) => files.has(file));
|
|
24
|
+
const summary = createRepositoryInspectionSummary({
|
|
25
|
+
frameworks,
|
|
26
|
+
buildTools,
|
|
27
|
+
scripts,
|
|
28
|
+
configs,
|
|
29
|
+
workspaces
|
|
30
|
+
});
|
|
31
|
+
const inspectOnly = input.inspectOnly ?? false;
|
|
32
|
+
const findings = createRepositoryFindings({
|
|
33
|
+
root,
|
|
34
|
+
packageManager,
|
|
35
|
+
hasPackageJson: Boolean(input.packageJson) || files.has('package.json'),
|
|
36
|
+
scripts,
|
|
37
|
+
gitDirty: input.git?.dirty ?? false
|
|
38
|
+
});
|
|
39
|
+
const hasBlockedFinding = findings.some((finding) => finding.severity === 'blocked');
|
|
40
|
+
return {
|
|
41
|
+
id: `repository:${root || 'unresolved'}`,
|
|
42
|
+
label: input.label?.trim() || deriveRepositoryLabel(root),
|
|
43
|
+
root,
|
|
44
|
+
generatedAt: now,
|
|
45
|
+
packageName: normalizeNullableString(input.packageJson?.name),
|
|
46
|
+
packageVersion: normalizeNullableString(input.packageJson?.version),
|
|
47
|
+
packageManager,
|
|
48
|
+
frameworks,
|
|
49
|
+
buildTools,
|
|
50
|
+
scripts,
|
|
51
|
+
workspaces: workspaces.length > 0 ? { patterns: workspaces } : null,
|
|
52
|
+
git: input.git
|
|
53
|
+
? {
|
|
54
|
+
branch: normalizeNullableString(input.git.branch),
|
|
55
|
+
commit: normalizeNullableString(input.git.commit),
|
|
56
|
+
dirty: input.git.dirty ?? false
|
|
57
|
+
}
|
|
58
|
+
: null,
|
|
59
|
+
configs,
|
|
60
|
+
summary,
|
|
61
|
+
findings,
|
|
62
|
+
inspectOnly,
|
|
63
|
+
canLaunch: !hasBlockedFinding && !inspectOnly
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export function createRepositoryLaunchPreflightSummary(target, report, now = new Date().toISOString()) {
|
|
68
|
+
const checks = [
|
|
69
|
+
{
|
|
70
|
+
id: 'launch.project.target',
|
|
71
|
+
label: 'Project target',
|
|
72
|
+
status: report.root ? 'ready' : 'blocked',
|
|
73
|
+
message: report.root || 'No project root selected.'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: 'launch.repository.package-manager',
|
|
77
|
+
label: 'Package manager',
|
|
78
|
+
status: report.packageManager === 'unknown' ? 'warning' : 'ready',
|
|
79
|
+
message: report.packageManager === 'unknown'
|
|
80
|
+
? 'No lockfile was detected in the repository projection.'
|
|
81
|
+
: `${report.packageManager} lockfile detected.`
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'launch.repository.scripts',
|
|
85
|
+
label: 'Scripts',
|
|
86
|
+
status: report.scripts.length > 0 ? 'ready' : 'warning',
|
|
87
|
+
message: report.scripts.length > 0
|
|
88
|
+
? `${report.scripts.length} package script(s) available.`
|
|
89
|
+
: 'No package scripts were provided in the repository projection.'
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
id: 'launch.repository.git',
|
|
93
|
+
label: 'Git state',
|
|
94
|
+
status: report.git?.dirty ? 'warning' : 'ready',
|
|
95
|
+
message: report.git
|
|
96
|
+
? `${report.git.branch ?? 'detached'}${report.git.dirty ? ' has local changes.' : ' is clean.'}`
|
|
97
|
+
: 'No git metadata provided.'
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'launch.repository.mode',
|
|
101
|
+
label: 'Launch mode',
|
|
102
|
+
status: report.canLaunch ? 'ready' : report.inspectOnly ? 'warning' : 'blocked',
|
|
103
|
+
message: report.inspectOnly
|
|
104
|
+
? 'Repository is configured for inspect-only preflight.'
|
|
105
|
+
: report.canLaunch
|
|
106
|
+
? 'Repository can enter workspace initialization.'
|
|
107
|
+
: 'Repository cannot launch until blocked findings are resolved.'
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
return {
|
|
111
|
+
target,
|
|
112
|
+
checks,
|
|
113
|
+
generatedAt: now,
|
|
114
|
+
repository: report
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function detectPackageManager(files) {
|
|
118
|
+
if (files.has('pnpm-lock.yaml')) {
|
|
119
|
+
return 'pnpm';
|
|
120
|
+
}
|
|
121
|
+
if (files.has('package-lock.json')) {
|
|
122
|
+
return 'npm';
|
|
123
|
+
}
|
|
124
|
+
if (files.has('yarn.lock')) {
|
|
125
|
+
return 'yarn';
|
|
126
|
+
}
|
|
127
|
+
if (files.has('bun.lockb') || files.has('bun.lock')) {
|
|
128
|
+
return 'bun';
|
|
129
|
+
}
|
|
130
|
+
return 'unknown';
|
|
131
|
+
}
|
|
132
|
+
function normalizeScripts(scripts) {
|
|
133
|
+
return Object.entries(scripts ?? {})
|
|
134
|
+
.filter((entry) => typeof entry[0] === 'string' && typeof entry[1] === 'string')
|
|
135
|
+
.map(([name, command]) => ({
|
|
136
|
+
name,
|
|
137
|
+
command,
|
|
138
|
+
kind: classifyScript(name, command)
|
|
139
|
+
}))
|
|
140
|
+
.sort((left, right) => left.name.localeCompare(right.name));
|
|
141
|
+
}
|
|
142
|
+
function classifyScript(name, command) {
|
|
143
|
+
const normalizedName = name.toLowerCase();
|
|
144
|
+
const normalizedCommand = command.toLowerCase();
|
|
145
|
+
if (normalizedName.includes('dev') || normalizedCommand.includes(' dev')) {
|
|
146
|
+
return 'dev';
|
|
147
|
+
}
|
|
148
|
+
if (normalizedName.includes('build') || normalizedCommand.includes(' build')) {
|
|
149
|
+
return 'build';
|
|
150
|
+
}
|
|
151
|
+
if (normalizedName.includes('test') || normalizedCommand.includes('vitest') || normalizedCommand.includes('playwright')) {
|
|
152
|
+
return 'test';
|
|
153
|
+
}
|
|
154
|
+
if (normalizedName.includes('lint') || normalizedCommand.includes('eslint')) {
|
|
155
|
+
return 'lint';
|
|
156
|
+
}
|
|
157
|
+
if (normalizedName.includes('format') || normalizedCommand.includes('prettier')) {
|
|
158
|
+
return 'format';
|
|
159
|
+
}
|
|
160
|
+
if (normalizedName.includes('preview') || normalizedCommand.includes(' preview')) {
|
|
161
|
+
return 'preview';
|
|
162
|
+
}
|
|
163
|
+
if (normalizedName.includes('check') || normalizedCommand.includes('svelte-check') || normalizedCommand.includes('tsc')) {
|
|
164
|
+
return 'check';
|
|
165
|
+
}
|
|
166
|
+
return 'other';
|
|
167
|
+
}
|
|
168
|
+
function createRepositoryInspectionSummary(input) {
|
|
169
|
+
return {
|
|
170
|
+
primaryFramework: input.frameworks.find((framework) => framework !== 'unknown') ?? 'unknown',
|
|
171
|
+
primaryBuildTool: input.buildTools.find((tool) => tool !== 'unknown') ?? 'unknown',
|
|
172
|
+
launchCommand: input.scripts.find((script) => script.kind === 'dev')?.command ??
|
|
173
|
+
input.scripts.find((script) => script.kind === 'preview')?.command ??
|
|
174
|
+
input.scripts.find((script) => script.kind === 'build')?.command ??
|
|
175
|
+
null,
|
|
176
|
+
testCommand: input.scripts.find((script) => script.kind === 'test')?.command ??
|
|
177
|
+
input.scripts.find((script) => script.kind === 'check')?.command ??
|
|
178
|
+
null,
|
|
179
|
+
scriptKinds: [...new Set(input.scripts.map((script) => script.kind))].sort((left, right) => left.localeCompare(right)),
|
|
180
|
+
configCount: input.configs.length,
|
|
181
|
+
workspacePackageCount: input.workspaces.length
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
function normalizeDependencies(packageJson) {
|
|
185
|
+
return new Set([
|
|
186
|
+
...Object.keys(packageJson?.dependencies ?? {}),
|
|
187
|
+
...Object.keys(packageJson?.devDependencies ?? {})
|
|
188
|
+
]);
|
|
189
|
+
}
|
|
190
|
+
function detectFrameworks(files, dependencies) {
|
|
191
|
+
const frameworks = [];
|
|
192
|
+
if (files.has('svelte.config.js') || files.has('svelte.config.ts') || dependencies.has('svelte') || dependencies.has('@sveltejs/kit')) {
|
|
193
|
+
frameworks.push('svelte');
|
|
194
|
+
}
|
|
195
|
+
if (dependencies.has('react') || dependencies.has('react-dom') || dependencies.has('next')) {
|
|
196
|
+
frameworks.push('react');
|
|
197
|
+
}
|
|
198
|
+
if (dependencies.has('vue') || dependencies.has('nuxt')) {
|
|
199
|
+
frameworks.push('vue');
|
|
200
|
+
}
|
|
201
|
+
if (dependencies.has('solid-js')) {
|
|
202
|
+
frameworks.push('solid');
|
|
203
|
+
}
|
|
204
|
+
return frameworks.length > 0 ? frameworks : ['unknown'];
|
|
205
|
+
}
|
|
206
|
+
function detectBuildTools(files, dependencies, scripts) {
|
|
207
|
+
const tools = new Set();
|
|
208
|
+
const scriptText = Object.values(scripts ?? {}).join(' ').toLowerCase();
|
|
209
|
+
if (files.has('vite.config.ts') || files.has('vite.config.js') || dependencies.has('vite') || scriptText.includes('vite')) {
|
|
210
|
+
tools.add('vite');
|
|
211
|
+
}
|
|
212
|
+
if (dependencies.has('@sveltejs/kit') || scriptText.includes('svelte-kit')) {
|
|
213
|
+
tools.add('sveltekit');
|
|
214
|
+
}
|
|
215
|
+
if (dependencies.has('next') || scriptText.includes('next ')) {
|
|
216
|
+
tools.add('next');
|
|
217
|
+
}
|
|
218
|
+
if (dependencies.has('nuxt') || scriptText.includes('nuxt')) {
|
|
219
|
+
tools.add('nuxt');
|
|
220
|
+
}
|
|
221
|
+
if (files.has('vitest.config.ts') || dependencies.has('vitest') || scriptText.includes('vitest')) {
|
|
222
|
+
tools.add('vitest');
|
|
223
|
+
}
|
|
224
|
+
if (files.has('playwright.config.ts') || dependencies.has('@playwright/test') || scriptText.includes('playwright')) {
|
|
225
|
+
tools.add('playwright');
|
|
226
|
+
}
|
|
227
|
+
if (files.has('tsconfig.json') || dependencies.has('typescript') || scriptText.includes('tsc')) {
|
|
228
|
+
tools.add('typescript');
|
|
229
|
+
}
|
|
230
|
+
return tools.size > 0 ? [...tools] : ['unknown'];
|
|
231
|
+
}
|
|
232
|
+
function normalizeWorkspaces(workspaces) {
|
|
233
|
+
const patterns = Array.isArray(workspaces) ? workspaces : workspaces?.packages ?? [];
|
|
234
|
+
return patterns
|
|
235
|
+
.filter((pattern) => typeof pattern === 'string' && pattern.trim().length > 0)
|
|
236
|
+
.map((pattern) => normalizeRepoPath(pattern))
|
|
237
|
+
.sort((left, right) => left.localeCompare(right));
|
|
238
|
+
}
|
|
239
|
+
function createRepositoryFindings(input) {
|
|
240
|
+
const findings = [];
|
|
241
|
+
if (!input.root) {
|
|
242
|
+
findings.push({
|
|
243
|
+
id: 'repo.root.missing',
|
|
244
|
+
severity: 'blocked',
|
|
245
|
+
title: 'Repository root missing',
|
|
246
|
+
message: 'Select a repository root before running preflight.'
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
if (!input.hasPackageJson) {
|
|
250
|
+
findings.push({
|
|
251
|
+
id: 'repo.package.missing',
|
|
252
|
+
severity: 'warning',
|
|
253
|
+
title: 'Package manifest missing',
|
|
254
|
+
message: 'No package.json was provided in the repository projection.'
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
if (input.packageManager === 'unknown') {
|
|
258
|
+
findings.push({
|
|
259
|
+
id: 'repo.package-manager.unknown',
|
|
260
|
+
severity: 'warning',
|
|
261
|
+
title: 'Package manager unknown',
|
|
262
|
+
message: 'No known lockfile was detected.'
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
if (input.scripts.length === 0) {
|
|
266
|
+
findings.push({
|
|
267
|
+
id: 'repo.scripts.empty',
|
|
268
|
+
severity: 'warning',
|
|
269
|
+
title: 'No scripts detected',
|
|
270
|
+
message: 'Preflight cannot infer build or test commands from package scripts.'
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
if (input.gitDirty) {
|
|
274
|
+
findings.push({
|
|
275
|
+
id: 'repo.git.dirty',
|
|
276
|
+
severity: 'warning',
|
|
277
|
+
title: 'Local changes detected',
|
|
278
|
+
message: 'The repository projection reports uncommitted local changes.'
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
if (findings.length === 0) {
|
|
282
|
+
findings.push({
|
|
283
|
+
id: 'repo.preflight.ready',
|
|
284
|
+
severity: 'info',
|
|
285
|
+
title: 'Repository ready',
|
|
286
|
+
message: 'Repository projection contains enough metadata for launch planning.'
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
return findings;
|
|
290
|
+
}
|
|
291
|
+
function normalizeRepoPath(path) {
|
|
292
|
+
return path.replace(/\\/g, '/').replace(/^\.\/+/, '').trim();
|
|
293
|
+
}
|
|
294
|
+
function normalizeNullableString(value) {
|
|
295
|
+
return typeof value === 'string' && value.trim() ? value.trim() : null;
|
|
296
|
+
}
|
|
297
|
+
function deriveRepositoryLabel(root) {
|
|
298
|
+
const normalized = normalizeRepoPath(root);
|
|
299
|
+
const segments = normalized.split('/').filter(Boolean);
|
|
300
|
+
return segments[segments.length - 1] ?? 'Repository';
|
|
301
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeAppPreviewDescriptor, WorkbenchRuntimeBackendPort, WorkbenchRuntimeProjectionInvalidationResult, WorkbenchRuntimeSharedStatePatch } from "../../domain/runtime/model.js";
|
|
2
|
+
export type RuntimeBackendConnection = {
|
|
3
|
+
loadProjection<TProjection = unknown>(kind: string, params?: Record<string, string>): Promise<TProjection>;
|
|
4
|
+
invalidateProjection(kind: string, params?: Record<string, string>): Promise<WorkbenchRuntimeProjectionInvalidationResult>;
|
|
5
|
+
startAppPreview(root?: string): Promise<WorkbenchRuntimeAppPreviewDescriptor>;
|
|
6
|
+
listSharedState(): Promise<unknown[]>;
|
|
7
|
+
patchSharedState(key: string, patch: WorkbenchRuntimeSharedStatePatch): Promise<unknown>;
|
|
8
|
+
};
|
|
9
|
+
export declare function createRuntimeBackendConnection(backend: WorkbenchRuntimeBackendPort | null): RuntimeBackendConnection;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export function createRuntimeBackendConnection(backend) {
|
|
2
|
+
return {
|
|
3
|
+
async loadProjection(kind, params) {
|
|
4
|
+
if (!backend) {
|
|
5
|
+
throw new Error('Runtime backend is unavailable.');
|
|
6
|
+
}
|
|
7
|
+
return backend.getProjection(kind, params);
|
|
8
|
+
},
|
|
9
|
+
async invalidateProjection(kind, params) {
|
|
10
|
+
if (!backend) {
|
|
11
|
+
throw new Error('Runtime backend is unavailable.');
|
|
12
|
+
}
|
|
13
|
+
return backend.invalidateProjection(kind, params);
|
|
14
|
+
},
|
|
15
|
+
async startAppPreview(root) {
|
|
16
|
+
if (!backend?.startAppPreview) {
|
|
17
|
+
throw new Error('Backend app preview is unavailable.');
|
|
18
|
+
}
|
|
19
|
+
return backend.startAppPreview(root);
|
|
20
|
+
},
|
|
21
|
+
async listSharedState() {
|
|
22
|
+
if (!backend?.listSharedState) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
return backend.listSharedState();
|
|
26
|
+
},
|
|
27
|
+
async patchSharedState(key, patch) {
|
|
28
|
+
if (!backend?.patchSharedState) {
|
|
29
|
+
throw new Error('Backend shared state is unavailable.');
|
|
30
|
+
}
|
|
31
|
+
return backend.patchSharedState(key, patch);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeSubscription } from "../../domain/runtime/model.js";
|
|
2
|
+
export type RuntimeBackendSubscriptionOwner = {
|
|
3
|
+
replace(subscription: WorkbenchRuntimeSubscription): void;
|
|
4
|
+
replaceWith(create: () => WorkbenchRuntimeSubscription): void;
|
|
5
|
+
disconnect(): void;
|
|
6
|
+
hasActiveSubscription(): boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare function createRuntimeBackendSubscriptionOwner(): RuntimeBackendSubscriptionOwner;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export function createRuntimeBackendSubscriptionOwner() {
|
|
2
|
+
// Retain failed cleanup too: a thrown dispose never relinquishes ownership.
|
|
3
|
+
const owned = new Set();
|
|
4
|
+
function release(subscription, errors) {
|
|
5
|
+
try {
|
|
6
|
+
subscription.dispose();
|
|
7
|
+
owned.delete(subscription);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
errors.push(error);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
function report(errors) {
|
|
14
|
+
if (errors.length === 1)
|
|
15
|
+
throw errors[0];
|
|
16
|
+
if (errors.length > 1)
|
|
17
|
+
throw new AggregateError(errors, 'Subscription cleanup failed');
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
replaceWith(create) {
|
|
21
|
+
const errors = [];
|
|
22
|
+
for (const subscription of [...owned])
|
|
23
|
+
release(subscription, errors);
|
|
24
|
+
report(errors);
|
|
25
|
+
// No acquisition until every previous release has succeeded.
|
|
26
|
+
// The factory owns cleanup of any partial acquisition if it throws.
|
|
27
|
+
owned.add(create());
|
|
28
|
+
},
|
|
29
|
+
replace(subscription) {
|
|
30
|
+
if (owned.has(subscription))
|
|
31
|
+
return;
|
|
32
|
+
const errors = [];
|
|
33
|
+
for (const previous of [...owned])
|
|
34
|
+
release(previous, errors);
|
|
35
|
+
owned.add(subscription);
|
|
36
|
+
// The already-acquired candidate transfers to this owner even on failure.
|
|
37
|
+
// Reject it by cleanup, retaining it if that cleanup also fails.
|
|
38
|
+
if (errors.length > 0)
|
|
39
|
+
release(subscription, errors);
|
|
40
|
+
report(errors);
|
|
41
|
+
},
|
|
42
|
+
disconnect() {
|
|
43
|
+
const errors = [];
|
|
44
|
+
for (const subscription of [...owned])
|
|
45
|
+
release(subscription, errors);
|
|
46
|
+
report(errors);
|
|
47
|
+
},
|
|
48
|
+
hasActiveSubscription() {
|
|
49
|
+
return owned.size > 0;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type RuntimeCheckpoint, type RuntimeCheckpointInput, type RuntimeCheckpointSnapshot } from "../../domain/runtime/checkpoint.js";
|
|
2
|
+
export interface RuntimeCheckpointStoreOptions {
|
|
3
|
+
maxEntries?: number;
|
|
4
|
+
now?: () => string;
|
|
5
|
+
}
|
|
6
|
+
export declare class RuntimeCheckpointStore {
|
|
7
|
+
private readonly maxEntries;
|
|
8
|
+
private readonly now;
|
|
9
|
+
private checkpoints;
|
|
10
|
+
private lastKnownGoodId;
|
|
11
|
+
constructor(options?: RuntimeCheckpointStoreOptions);
|
|
12
|
+
save(input: RuntimeCheckpointInput): RuntimeCheckpoint;
|
|
13
|
+
update(id: string, data: unknown): RuntimeCheckpoint | null;
|
|
14
|
+
get(id: string): RuntimeCheckpoint | null;
|
|
15
|
+
list(): RuntimeCheckpoint[];
|
|
16
|
+
remove(id: string): boolean;
|
|
17
|
+
markLastKnownGood(id: string): RuntimeCheckpoint | null;
|
|
18
|
+
restore(id: string): RuntimeCheckpoint | null;
|
|
19
|
+
createSnapshot(timestamp?: string): RuntimeCheckpointSnapshot;
|
|
20
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createRuntimeCheckpoint, createRuntimeCheckpointSnapshot, updateRuntimeCheckpoint } from "../../domain/runtime/checkpoint.js";
|
|
2
|
+
export class RuntimeCheckpointStore {
|
|
3
|
+
maxEntries;
|
|
4
|
+
now;
|
|
5
|
+
checkpoints = [];
|
|
6
|
+
lastKnownGoodId = null;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.maxEntries = Math.max(1, Math.floor(options.maxEntries ?? 50));
|
|
9
|
+
this.now = options.now ?? (() => new Date().toISOString());
|
|
10
|
+
}
|
|
11
|
+
save(input) {
|
|
12
|
+
const checkpoint = createRuntimeCheckpoint(input, this.now());
|
|
13
|
+
const existing = this.checkpoints.filter((candidate) => candidate.id !== checkpoint.id);
|
|
14
|
+
this.checkpoints = [checkpoint, ...existing].slice(0, this.maxEntries);
|
|
15
|
+
if (checkpoint.kind === 'last-known-good') {
|
|
16
|
+
this.lastKnownGoodId = checkpoint.id;
|
|
17
|
+
}
|
|
18
|
+
return checkpoint;
|
|
19
|
+
}
|
|
20
|
+
update(id, data) {
|
|
21
|
+
const checkpoint = this.get(id);
|
|
22
|
+
if (!checkpoint) {
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
const updated = updateRuntimeCheckpoint(checkpoint, data, this.now());
|
|
26
|
+
this.checkpoints = this.checkpoints.map((candidate) => candidate.id === id ? updated : candidate);
|
|
27
|
+
return updated;
|
|
28
|
+
}
|
|
29
|
+
get(id) {
|
|
30
|
+
return this.checkpoints.find((checkpoint) => checkpoint.id === id) ?? null;
|
|
31
|
+
}
|
|
32
|
+
list() {
|
|
33
|
+
return [...this.checkpoints];
|
|
34
|
+
}
|
|
35
|
+
remove(id) {
|
|
36
|
+
const previousLength = this.checkpoints.length;
|
|
37
|
+
this.checkpoints = this.checkpoints.filter((checkpoint) => checkpoint.id !== id);
|
|
38
|
+
if (this.lastKnownGoodId === id) {
|
|
39
|
+
this.lastKnownGoodId = null;
|
|
40
|
+
}
|
|
41
|
+
return this.checkpoints.length !== previousLength;
|
|
42
|
+
}
|
|
43
|
+
markLastKnownGood(id) {
|
|
44
|
+
const checkpoint = this.get(id);
|
|
45
|
+
if (!checkpoint) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const lastKnownGood = {
|
|
49
|
+
...checkpoint,
|
|
50
|
+
id: `last-known-good:${checkpoint.id}`,
|
|
51
|
+
kind: 'last-known-good',
|
|
52
|
+
label: `Last known good - ${checkpoint.label}`,
|
|
53
|
+
updatedAt: this.now()
|
|
54
|
+
};
|
|
55
|
+
this.checkpoints = [lastKnownGood, ...this.checkpoints].slice(0, this.maxEntries);
|
|
56
|
+
this.lastKnownGoodId = lastKnownGood.id;
|
|
57
|
+
return lastKnownGood;
|
|
58
|
+
}
|
|
59
|
+
restore(id) {
|
|
60
|
+
return this.get(id);
|
|
61
|
+
}
|
|
62
|
+
createSnapshot(timestamp = this.now()) {
|
|
63
|
+
return createRuntimeCheckpointSnapshot(this.checkpoints, this.lastKnownGoodId, timestamp);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function createRuntimeLaunchProgressSnapshot(state) {
|
|
2
|
+
const checks = state.preflight?.checks ?? [];
|
|
3
|
+
const readyChecks = checks.filter((check) => check.status === 'ready').length;
|
|
4
|
+
const warningChecks = checks.filter((check) => check.status === 'warning').length;
|
|
5
|
+
const blockedChecks = checks.filter((check) => check.status === 'blocked').length;
|
|
6
|
+
if (state.hydration) {
|
|
7
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, state.hydration.status, state.hydration.progress, state.hydration.activeStepId, state.hydration.steps.filter((step) => step.status === 'completed').length, state.hydration.steps.length, readyChecks, warningChecks, blockedChecks);
|
|
8
|
+
}
|
|
9
|
+
if (state.initialization) {
|
|
10
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, state.initialization.status, state.initialization.progress, state.initialization.activeStepId, state.initialization.steps.filter((step) => step.status === 'completed' || step.status === 'skipped').length, state.initialization.steps.length, readyChecks, warningChecks, blockedChecks);
|
|
11
|
+
}
|
|
12
|
+
if (state.phase === 'RUNNING') {
|
|
13
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, 'running', 100, null, 0, 0, readyChecks, warningChecks, blockedChecks);
|
|
14
|
+
}
|
|
15
|
+
if (state.plan) {
|
|
16
|
+
const plannedSteps = state.plan.steps.filter((step) => step.status === 'planned').length;
|
|
17
|
+
const blockedSteps = state.plan.steps.filter((step) => step.status === 'blocked').length;
|
|
18
|
+
const executable = state.plan.canExecute && blockedSteps === 0;
|
|
19
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, executable ? 'planned' : 'blocked', executable ? 100 : 0, null, plannedSteps, state.plan.steps.length, readyChecks, warningChecks, blockedChecks);
|
|
20
|
+
}
|
|
21
|
+
if (checks.length > 0) {
|
|
22
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, blockedChecks > 0 ? 'blocked' : warningChecks > 0 ? 'warning' : readyChecks === checks.length ? 'ready' : 'pending', checks.length ? Math.round((readyChecks / checks.length) * 100) : 0, checks.find((check) => check.status === 'pending' || check.status === 'blocked')?.id ?? null, readyChecks, checks.length, readyChecks, warningChecks, blockedChecks);
|
|
23
|
+
}
|
|
24
|
+
return createRuntimeLaunchStepProgressSnapshot(state.phase, state.error ? 'error' : state.phase.toLowerCase(), 0, null, 0, 0, 0, 0, 0);
|
|
25
|
+
}
|
|
26
|
+
function createRuntimeLaunchStepProgressSnapshot(phase, status, progress, activeStepId, completedSteps, totalSteps, readyChecks, warningChecks, blockedChecks) {
|
|
27
|
+
return {
|
|
28
|
+
phase,
|
|
29
|
+
status,
|
|
30
|
+
progress: Math.max(0, Math.min(100, Math.round(progress))),
|
|
31
|
+
activeStepId,
|
|
32
|
+
completedSteps,
|
|
33
|
+
totalSteps,
|
|
34
|
+
readyChecks,
|
|
35
|
+
warningChecks,
|
|
36
|
+
blockedChecks
|
|
37
|
+
};
|
|
38
|
+
}
|