@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,111 @@
|
|
|
1
|
+
export type RepoQualityDimensionId = 'tests' | 'docs' | 'decoupling';
|
|
2
|
+
export type RepoQualityGranularity = 'repo' | 'workspace' | 'file';
|
|
3
|
+
export type RepoQualityStatus = 'covered' | 'partial' | 'missing' | 'risk';
|
|
4
|
+
export interface RepoQualityDimensionScore {
|
|
5
|
+
id: RepoQualityDimensionId;
|
|
6
|
+
label: string;
|
|
7
|
+
score: number;
|
|
8
|
+
status: RepoQualityStatus;
|
|
9
|
+
total: number;
|
|
10
|
+
covered: number;
|
|
11
|
+
partial: number;
|
|
12
|
+
missing: number;
|
|
13
|
+
risk: number;
|
|
14
|
+
}
|
|
15
|
+
export interface RepoQualityRule {
|
|
16
|
+
id: string;
|
|
17
|
+
dimension: RepoQualityDimensionId;
|
|
18
|
+
label: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
targetScore: number;
|
|
21
|
+
severity: 'info' | 'warning' | 'error';
|
|
22
|
+
}
|
|
23
|
+
export interface RepoQualityEvidence {
|
|
24
|
+
kind: 'test' | 'doc' | 'source';
|
|
25
|
+
path: string;
|
|
26
|
+
confidence: 'direct' | 'related' | 'inferred';
|
|
27
|
+
}
|
|
28
|
+
export interface RepoQualityFileEvaluation {
|
|
29
|
+
id: string;
|
|
30
|
+
granularity: 'file';
|
|
31
|
+
path: string;
|
|
32
|
+
owner: string;
|
|
33
|
+
layer: string;
|
|
34
|
+
kind: string;
|
|
35
|
+
lineCount: number;
|
|
36
|
+
importCount: number;
|
|
37
|
+
exportedSymbolCount: number;
|
|
38
|
+
scores: Record<RepoQualityDimensionId, number>;
|
|
39
|
+
statuses: Record<RepoQualityDimensionId, RepoQualityStatus>;
|
|
40
|
+
evidences: RepoQualityEvidence[];
|
|
41
|
+
findings: string[];
|
|
42
|
+
}
|
|
43
|
+
export interface RepoQualityCoverageSummary {
|
|
44
|
+
sourceFiles: number;
|
|
45
|
+
testEvidenceFiles: number;
|
|
46
|
+
docEvidenceFiles: number;
|
|
47
|
+
fullyCoveredFiles: number;
|
|
48
|
+
score: number;
|
|
49
|
+
status: RepoQualityStatus;
|
|
50
|
+
}
|
|
51
|
+
export interface RepoQualityWorkspaceEvaluation {
|
|
52
|
+
id: string;
|
|
53
|
+
granularity: 'workspace';
|
|
54
|
+
path: string;
|
|
55
|
+
fileCount: number;
|
|
56
|
+
lineCount: number;
|
|
57
|
+
coverage: RepoQualityCoverageSummary;
|
|
58
|
+
scores: Record<RepoQualityDimensionId, number>;
|
|
59
|
+
statuses: Record<RepoQualityDimensionId, RepoQualityStatus>;
|
|
60
|
+
riskCount: number;
|
|
61
|
+
missingCount: number;
|
|
62
|
+
findings: string[];
|
|
63
|
+
}
|
|
64
|
+
export interface RepoQualityEntryRootEvaluation {
|
|
65
|
+
id: string;
|
|
66
|
+
path: string;
|
|
67
|
+
kind: 'app' | 'package' | 'tooling';
|
|
68
|
+
sourceFileCount: number;
|
|
69
|
+
lineCount: number;
|
|
70
|
+
coverage: RepoQualityCoverageSummary;
|
|
71
|
+
status: RepoQualityStatus;
|
|
72
|
+
findings: string[];
|
|
73
|
+
}
|
|
74
|
+
export interface RepoQualityHistorySnapshot {
|
|
75
|
+
step: number;
|
|
76
|
+
generatedAt: string;
|
|
77
|
+
totals: {
|
|
78
|
+
sourceFiles: number;
|
|
79
|
+
sourceLines: number;
|
|
80
|
+
workspaces: number;
|
|
81
|
+
entryRoots: number;
|
|
82
|
+
};
|
|
83
|
+
dimensions: Record<RepoQualityDimensionId, {
|
|
84
|
+
score: number;
|
|
85
|
+
status: RepoQualityStatus;
|
|
86
|
+
total: number;
|
|
87
|
+
covered: number;
|
|
88
|
+
partial: number;
|
|
89
|
+
missing: number;
|
|
90
|
+
risk: number;
|
|
91
|
+
}>;
|
|
92
|
+
}
|
|
93
|
+
export interface RepoQualityEvaluation {
|
|
94
|
+
schemaVersion: 'repo-quality-evaluation.v1';
|
|
95
|
+
generatedAt: string;
|
|
96
|
+
repoRoot: string;
|
|
97
|
+
rules: RepoQualityRule[];
|
|
98
|
+
totals: {
|
|
99
|
+
sourceFiles: number;
|
|
100
|
+
testFiles: number;
|
|
101
|
+
docFiles: number;
|
|
102
|
+
workspaces: number;
|
|
103
|
+
entryRoots: number;
|
|
104
|
+
sourceLines: number;
|
|
105
|
+
};
|
|
106
|
+
dimensions: RepoQualityDimensionScore[];
|
|
107
|
+
entryRoots: RepoQualityEntryRootEvaluation[];
|
|
108
|
+
workspaces: RepoQualityWorkspaceEvaluation[];
|
|
109
|
+
files: RepoQualityFileEvaluation[];
|
|
110
|
+
history: RepoQualityHistorySnapshot[];
|
|
111
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export type RepositoryPackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun' | 'unknown';
|
|
2
|
+
export type RepositoryInspectionSeverity = 'info' | 'warning' | 'blocked';
|
|
3
|
+
export type RepositoryFramework = 'svelte' | 'react' | 'vue' | 'solid' | 'unknown';
|
|
4
|
+
export type RepositoryBuildTool = 'vite' | 'sveltekit' | 'next' | 'nuxt' | 'vitest' | 'playwright' | 'typescript' | 'unknown';
|
|
5
|
+
export type RepositoryScriptKind = 'dev' | 'build' | 'test' | 'lint' | 'format' | 'preview' | 'check' | 'other';
|
|
6
|
+
export interface RepositoryInspectionFinding {
|
|
7
|
+
id: string;
|
|
8
|
+
severity: RepositoryInspectionSeverity;
|
|
9
|
+
title: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RepositoryScriptSnapshot {
|
|
13
|
+
name: string;
|
|
14
|
+
command: string;
|
|
15
|
+
kind: RepositoryScriptKind;
|
|
16
|
+
}
|
|
17
|
+
export interface RepositoryWorkspaceSnapshot {
|
|
18
|
+
patterns: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface RepositoryGitSnapshot {
|
|
21
|
+
branch: string | null;
|
|
22
|
+
commit: string | null;
|
|
23
|
+
dirty: boolean;
|
|
24
|
+
}
|
|
25
|
+
export interface RepositoryInspectionSummary {
|
|
26
|
+
primaryFramework: RepositoryFramework;
|
|
27
|
+
primaryBuildTool: RepositoryBuildTool;
|
|
28
|
+
launchCommand: string | null;
|
|
29
|
+
testCommand: string | null;
|
|
30
|
+
scriptKinds: RepositoryScriptKind[];
|
|
31
|
+
configCount: number;
|
|
32
|
+
workspacePackageCount: number;
|
|
33
|
+
}
|
|
34
|
+
export interface RepositoryInspectionSnapshot {
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
root: string;
|
|
38
|
+
generatedAt: string;
|
|
39
|
+
packageName: string | null;
|
|
40
|
+
packageVersion: string | null;
|
|
41
|
+
packageManager: RepositoryPackageManager;
|
|
42
|
+
frameworks: RepositoryFramework[];
|
|
43
|
+
buildTools: RepositoryBuildTool[];
|
|
44
|
+
scripts: RepositoryScriptSnapshot[];
|
|
45
|
+
workspaces: RepositoryWorkspaceSnapshot | null;
|
|
46
|
+
git: RepositoryGitSnapshot | null;
|
|
47
|
+
configs: string[];
|
|
48
|
+
summary: RepositoryInspectionSummary;
|
|
49
|
+
findings: RepositoryInspectionFinding[];
|
|
50
|
+
inspectOnly: boolean;
|
|
51
|
+
canLaunch: boolean;
|
|
52
|
+
}
|
|
53
|
+
export interface RepositoryInspectionInput {
|
|
54
|
+
label?: string | null;
|
|
55
|
+
root: string;
|
|
56
|
+
files?: string[];
|
|
57
|
+
packageJson?: {
|
|
58
|
+
name?: string;
|
|
59
|
+
version?: string;
|
|
60
|
+
scripts?: Record<string, string>;
|
|
61
|
+
workspaces?: string[] | {
|
|
62
|
+
packages?: string[];
|
|
63
|
+
};
|
|
64
|
+
dependencies?: Record<string, string>;
|
|
65
|
+
devDependencies?: Record<string, string>;
|
|
66
|
+
} | null;
|
|
67
|
+
git?: Partial<RepositoryGitSnapshot> | null;
|
|
68
|
+
inspectOnly?: boolean;
|
|
69
|
+
}
|
|
70
|
+
export type RepositoryCoverageEntityKind = 'route' | 'design-system' | 'test' | 'doc' | 'language' | 'usecase' | 'infrastructure' | 'decoupling';
|
|
71
|
+
export interface RepositoryCoverageEntity {
|
|
72
|
+
id: string;
|
|
73
|
+
kind: RepositoryCoverageEntityKind;
|
|
74
|
+
label: string;
|
|
75
|
+
sourceFile: string;
|
|
76
|
+
detail: string;
|
|
77
|
+
meta?: string | null;
|
|
78
|
+
}
|
|
79
|
+
export interface RepositoryCoverageSection {
|
|
80
|
+
id: RepositoryCoverageEntityKind;
|
|
81
|
+
label: string;
|
|
82
|
+
count: number;
|
|
83
|
+
items: RepositoryCoverageEntity[];
|
|
84
|
+
}
|
|
85
|
+
export interface RepositoryCoverageDiagnostic {
|
|
86
|
+
id: string;
|
|
87
|
+
severity: RepositoryInspectionSeverity;
|
|
88
|
+
message: string;
|
|
89
|
+
}
|
|
90
|
+
export interface RepositoryCoverageSnapshot {
|
|
91
|
+
id: string;
|
|
92
|
+
projectRoot: string;
|
|
93
|
+
projectLabel: string;
|
|
94
|
+
generatedAt: string;
|
|
95
|
+
source: 'runtime' | 'script';
|
|
96
|
+
routes: RepositoryCoverageSection;
|
|
97
|
+
designSystem: RepositoryCoverageSection;
|
|
98
|
+
tests: RepositoryCoverageSection;
|
|
99
|
+
docs: RepositoryCoverageSection;
|
|
100
|
+
languages: RepositoryCoverageSection;
|
|
101
|
+
usecases: RepositoryCoverageSection;
|
|
102
|
+
infrastructure: RepositoryCoverageSection;
|
|
103
|
+
decoupling: RepositoryCoverageSection;
|
|
104
|
+
diagnostics: RepositoryCoverageDiagnostic[];
|
|
105
|
+
totals: {
|
|
106
|
+
files: number;
|
|
107
|
+
sections: number;
|
|
108
|
+
entities: number;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { LaunchProfile, LaunchTarget } from "../launch/model.js";
|
|
2
|
+
import type { JsonValue } from "../shared/json.js";
|
|
3
|
+
export type RuntimeCheckpointKind = 'project-state' | 'workspace-state' | 'runtime-session' | 'launch-profile' | 'tool-session' | 'last-known-good' | 'crash-snapshot' | 'restore-point';
|
|
4
|
+
export interface RuntimeCheckpointInput {
|
|
5
|
+
id?: string;
|
|
6
|
+
kind: RuntimeCheckpointKind;
|
|
7
|
+
label: string;
|
|
8
|
+
target?: LaunchTarget | null;
|
|
9
|
+
profile?: LaunchProfile | null;
|
|
10
|
+
data?: unknown;
|
|
11
|
+
tags?: string[];
|
|
12
|
+
source?: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface RuntimeCheckpoint {
|
|
15
|
+
schemaVersion: 'runtime-checkpoint.v1';
|
|
16
|
+
id: string;
|
|
17
|
+
kind: RuntimeCheckpointKind;
|
|
18
|
+
label: string;
|
|
19
|
+
target: LaunchTarget | null;
|
|
20
|
+
profile: LaunchProfile | null;
|
|
21
|
+
data: JsonValue;
|
|
22
|
+
tags: string[];
|
|
23
|
+
source: string | null;
|
|
24
|
+
sizeBytes: number;
|
|
25
|
+
createdAt: string;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RuntimeCheckpointSnapshot {
|
|
29
|
+
generatedAt: string;
|
|
30
|
+
checkpoints: RuntimeCheckpoint[];
|
|
31
|
+
lastKnownGoodId: string | null;
|
|
32
|
+
restorePointIds: string[];
|
|
33
|
+
totals: Record<RuntimeCheckpointKind, number>;
|
|
34
|
+
}
|
|
35
|
+
export declare function createRuntimeCheckpoint(input: RuntimeCheckpointInput, timestamp?: string): RuntimeCheckpoint;
|
|
36
|
+
export declare function updateRuntimeCheckpoint(checkpoint: RuntimeCheckpoint, data: unknown, timestamp?: string): RuntimeCheckpoint;
|
|
37
|
+
export declare function createRuntimeCheckpointSnapshot(checkpoints: RuntimeCheckpoint[], lastKnownGoodId?: string | null, timestamp?: string): RuntimeCheckpointSnapshot;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export function createRuntimeCheckpoint(input, timestamp = new Date().toISOString()) {
|
|
2
|
+
const data = sanitizeJson(input.data ?? null);
|
|
3
|
+
return {
|
|
4
|
+
schemaVersion: 'runtime-checkpoint.v1',
|
|
5
|
+
id: input.id ?? `checkpoint:${input.kind}:${timestamp}`,
|
|
6
|
+
kind: input.kind,
|
|
7
|
+
label: sanitizeText(input.label, 160),
|
|
8
|
+
target: input.target ?? null,
|
|
9
|
+
profile: input.profile ?? input.target?.profile ?? null,
|
|
10
|
+
data,
|
|
11
|
+
tags: (input.tags ?? []).map((tag) => sanitizeText(tag, 80)).slice(0, 20),
|
|
12
|
+
source: normalizeNullableText(input.source, 160),
|
|
13
|
+
sizeBytes: estimateJsonSize(data),
|
|
14
|
+
createdAt: timestamp,
|
|
15
|
+
updatedAt: timestamp
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function updateRuntimeCheckpoint(checkpoint, data, timestamp = new Date().toISOString()) {
|
|
19
|
+
const sanitizedData = sanitizeJson(data);
|
|
20
|
+
return {
|
|
21
|
+
...checkpoint,
|
|
22
|
+
data: sanitizedData,
|
|
23
|
+
sizeBytes: estimateJsonSize(sanitizedData),
|
|
24
|
+
updatedAt: timestamp
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export function createRuntimeCheckpointSnapshot(checkpoints, lastKnownGoodId = null, timestamp = new Date().toISOString()) {
|
|
28
|
+
const sortedCheckpoints = [...checkpoints].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
29
|
+
return {
|
|
30
|
+
generatedAt: timestamp,
|
|
31
|
+
checkpoints: sortedCheckpoints,
|
|
32
|
+
lastKnownGoodId,
|
|
33
|
+
restorePointIds: sortedCheckpoints
|
|
34
|
+
.filter((checkpoint) => checkpoint.kind === 'restore-point' || checkpoint.id === lastKnownGoodId)
|
|
35
|
+
.map((checkpoint) => checkpoint.id),
|
|
36
|
+
totals: createCheckpointTotals(sortedCheckpoints)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const checkpointKinds = [
|
|
40
|
+
'project-state',
|
|
41
|
+
'workspace-state',
|
|
42
|
+
'runtime-session',
|
|
43
|
+
'launch-profile',
|
|
44
|
+
'tool-session',
|
|
45
|
+
'last-known-good',
|
|
46
|
+
'crash-snapshot',
|
|
47
|
+
'restore-point'
|
|
48
|
+
];
|
|
49
|
+
function createCheckpointTotals(checkpoints) {
|
|
50
|
+
const totals = Object.fromEntries(checkpointKinds.map((kind) => [kind, 0]));
|
|
51
|
+
for (const checkpoint of checkpoints) {
|
|
52
|
+
totals[checkpoint.kind] += 1;
|
|
53
|
+
}
|
|
54
|
+
return totals;
|
|
55
|
+
}
|
|
56
|
+
function estimateJsonSize(value) {
|
|
57
|
+
return JSON.stringify(value).length;
|
|
58
|
+
}
|
|
59
|
+
function normalizeNullableText(value, maxLength) {
|
|
60
|
+
return typeof value === 'string' ? sanitizeText(value, maxLength) : null;
|
|
61
|
+
}
|
|
62
|
+
function sanitizeText(value, maxLength = 2000) {
|
|
63
|
+
return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}...`;
|
|
64
|
+
}
|
|
65
|
+
function sanitizeJson(value, depth = 0) {
|
|
66
|
+
if (value === null || typeof value === 'boolean') {
|
|
67
|
+
return value;
|
|
68
|
+
}
|
|
69
|
+
if (typeof value === 'string') {
|
|
70
|
+
return sanitizeText(value);
|
|
71
|
+
}
|
|
72
|
+
if (typeof value === 'number') {
|
|
73
|
+
return Number.isFinite(value) ? value : null;
|
|
74
|
+
}
|
|
75
|
+
if (Array.isArray(value)) {
|
|
76
|
+
return depth >= 4 ? `[Array(${value.length})]` : value.slice(0, 50).map((entry) => sanitizeJson(entry, depth + 1));
|
|
77
|
+
}
|
|
78
|
+
if (value && typeof value === 'object') {
|
|
79
|
+
if (depth >= 4) {
|
|
80
|
+
return '[Object]';
|
|
81
|
+
}
|
|
82
|
+
return Object.fromEntries(Object.entries(value)
|
|
83
|
+
.slice(0, 50)
|
|
84
|
+
.map(([key, entry]) => [sanitizeText(key, 120), sanitizeJson(entry, depth + 1)]));
|
|
85
|
+
}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RuntimePlan } from "./plan.js";
|
|
2
|
+
export type RuntimeHydrationStepKind = 'documents' | 'graphs' | 'layouts' | 'sessions' | 'tools' | 'stores';
|
|
3
|
+
export type RuntimeHydrationStepStatus = 'pending' | 'running' | 'completed' | 'failed';
|
|
4
|
+
export interface RuntimeHydrationStep {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: RuntimeHydrationStepKind;
|
|
7
|
+
label: string;
|
|
8
|
+
status: RuntimeHydrationStepStatus;
|
|
9
|
+
startedAt: string | null;
|
|
10
|
+
completedAt: string | null;
|
|
11
|
+
message: string | null;
|
|
12
|
+
}
|
|
13
|
+
export interface RuntimeHydrationSnapshot {
|
|
14
|
+
planId: string;
|
|
15
|
+
status: 'idle' | 'running' | 'completed' | 'failed' | 'partial';
|
|
16
|
+
activeStepId: string | null;
|
|
17
|
+
progress: number;
|
|
18
|
+
steps: RuntimeHydrationStep[];
|
|
19
|
+
startedAt: string;
|
|
20
|
+
updatedAt: string;
|
|
21
|
+
completedAt: string | null;
|
|
22
|
+
error: string | null;
|
|
23
|
+
}
|
|
24
|
+
export declare function createRuntimeHydrationSnapshot(plan: RuntimePlan, timestamp?: string): RuntimeHydrationSnapshot;
|
|
25
|
+
export declare function completeRuntimeHydrationStep(snapshot: RuntimeHydrationSnapshot, stepId: string, timestamp?: string, message?: string | null): RuntimeHydrationSnapshot;
|
|
26
|
+
export declare function failRuntimeHydrationStep(snapshot: RuntimeHydrationSnapshot, stepId: string, error: string, timestamp?: string): RuntimeHydrationSnapshot;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const DEFAULT_HYDRATION_STEPS = [
|
|
2
|
+
{ kind: 'documents', label: 'Hydrate documents' },
|
|
3
|
+
{ kind: 'graphs', label: 'Hydrate graphs' },
|
|
4
|
+
{ kind: 'layouts', label: 'Hydrate layouts' },
|
|
5
|
+
{ kind: 'sessions', label: 'Hydrate sessions' },
|
|
6
|
+
{ kind: 'tools', label: 'Hydrate tools' },
|
|
7
|
+
{ kind: 'stores', label: 'Hydrate stores' }
|
|
8
|
+
];
|
|
9
|
+
export function createRuntimeHydrationSnapshot(plan, timestamp = new Date().toISOString()) {
|
|
10
|
+
const steps = DEFAULT_HYDRATION_STEPS.map((step) => ({
|
|
11
|
+
id: `hydrate:${step.kind}`,
|
|
12
|
+
kind: step.kind,
|
|
13
|
+
label: step.label,
|
|
14
|
+
status: 'pending',
|
|
15
|
+
startedAt: null,
|
|
16
|
+
completedAt: null,
|
|
17
|
+
message: null
|
|
18
|
+
}));
|
|
19
|
+
const firstStep = steps[0] ?? null;
|
|
20
|
+
return {
|
|
21
|
+
planId: plan.id,
|
|
22
|
+
status: 'running',
|
|
23
|
+
activeStepId: firstStep?.id ?? null,
|
|
24
|
+
progress: 0,
|
|
25
|
+
steps: firstStep
|
|
26
|
+
? steps.map((step) => step.id === firstStep.id ? { ...step, status: 'running', startedAt: timestamp } : step)
|
|
27
|
+
: steps,
|
|
28
|
+
startedAt: timestamp,
|
|
29
|
+
updatedAt: timestamp,
|
|
30
|
+
completedAt: null,
|
|
31
|
+
error: null
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export function completeRuntimeHydrationStep(snapshot, stepId, timestamp = new Date().toISOString(), message = null) {
|
|
35
|
+
const steps = snapshot.steps.map((step) => step.id === stepId
|
|
36
|
+
? {
|
|
37
|
+
...step,
|
|
38
|
+
status: 'completed',
|
|
39
|
+
completedAt: timestamp,
|
|
40
|
+
message
|
|
41
|
+
}
|
|
42
|
+
: step);
|
|
43
|
+
const nextPendingStep = steps.find((step) => step.status === 'pending') ?? null;
|
|
44
|
+
const nextSteps = nextPendingStep
|
|
45
|
+
? steps.map((step) => step.id === nextPendingStep.id
|
|
46
|
+
? {
|
|
47
|
+
...step,
|
|
48
|
+
status: 'running',
|
|
49
|
+
startedAt: timestamp
|
|
50
|
+
}
|
|
51
|
+
: step)
|
|
52
|
+
: steps;
|
|
53
|
+
const progress = calculateHydrationProgress(nextSteps);
|
|
54
|
+
const completed = progress >= 100;
|
|
55
|
+
return {
|
|
56
|
+
...snapshot,
|
|
57
|
+
status: completed ? 'completed' : 'running',
|
|
58
|
+
activeStepId: completed ? null : nextPendingStep?.id ?? null,
|
|
59
|
+
progress,
|
|
60
|
+
steps: nextSteps,
|
|
61
|
+
updatedAt: timestamp,
|
|
62
|
+
completedAt: completed ? timestamp : null,
|
|
63
|
+
error: null
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export function failRuntimeHydrationStep(snapshot, stepId, error, timestamp = new Date().toISOString()) {
|
|
67
|
+
const steps = snapshot.steps.map((step) => step.id === stepId
|
|
68
|
+
? {
|
|
69
|
+
...step,
|
|
70
|
+
status: 'failed',
|
|
71
|
+
completedAt: timestamp,
|
|
72
|
+
message: error
|
|
73
|
+
}
|
|
74
|
+
: step);
|
|
75
|
+
return {
|
|
76
|
+
...snapshot,
|
|
77
|
+
status: 'failed',
|
|
78
|
+
activeStepId: null,
|
|
79
|
+
progress: calculateHydrationProgress(steps),
|
|
80
|
+
steps,
|
|
81
|
+
updatedAt: timestamp,
|
|
82
|
+
completedAt: timestamp,
|
|
83
|
+
error
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function calculateHydrationProgress(steps) {
|
|
87
|
+
if (steps.length === 0) {
|
|
88
|
+
return 100;
|
|
89
|
+
}
|
|
90
|
+
const resolvedSteps = steps.filter((step) => step.status === 'completed').length;
|
|
91
|
+
return Math.round((resolvedSteps / steps.length) * 100);
|
|
92
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RuntimePlan } from "./plan.js";
|
|
2
|
+
export type RuntimeInitializationStepStatus = 'pending' | 'running' | 'completed' | 'skipped' | 'failed';
|
|
3
|
+
export interface RuntimeInitializationStep {
|
|
4
|
+
id: string;
|
|
5
|
+
planStepId: string;
|
|
6
|
+
label: string;
|
|
7
|
+
status: RuntimeInitializationStepStatus;
|
|
8
|
+
startedAt: string | null;
|
|
9
|
+
completedAt: string | null;
|
|
10
|
+
message: string | null;
|
|
11
|
+
}
|
|
12
|
+
export interface RuntimeInitializationSnapshot {
|
|
13
|
+
planId: string;
|
|
14
|
+
status: 'idle' | 'running' | 'completed' | 'failed';
|
|
15
|
+
activeStepId: string | null;
|
|
16
|
+
progress: number;
|
|
17
|
+
steps: RuntimeInitializationStep[];
|
|
18
|
+
startedAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
completedAt: string | null;
|
|
21
|
+
error: string | null;
|
|
22
|
+
}
|
|
23
|
+
export declare function createRuntimeInitializationSnapshot(plan: RuntimePlan, timestamp?: string): RuntimeInitializationSnapshot;
|
|
24
|
+
export declare function completeRuntimeInitializationStep(snapshot: RuntimeInitializationSnapshot, stepId: string, timestamp?: string, message?: string | null): RuntimeInitializationSnapshot;
|
|
25
|
+
export declare function failRuntimeInitializationStep(snapshot: RuntimeInitializationSnapshot, stepId: string, error: string, timestamp?: string): RuntimeInitializationSnapshot;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export function createRuntimeInitializationSnapshot(plan, timestamp = new Date().toISOString()) {
|
|
2
|
+
const steps = plan.steps.map((step) => createInitializationStep(step, timestamp));
|
|
3
|
+
const firstPendingStep = steps.find((step) => step.status === 'pending') ?? null;
|
|
4
|
+
return {
|
|
5
|
+
planId: plan.id,
|
|
6
|
+
status: plan.canExecute ? 'running' : 'failed',
|
|
7
|
+
activeStepId: firstPendingStep?.id ?? null,
|
|
8
|
+
progress: calculateInitializationProgress(steps),
|
|
9
|
+
steps: firstPendingStep
|
|
10
|
+
? steps.map((step) => step.id === firstPendingStep.id ? { ...step, status: 'running', startedAt: timestamp } : step)
|
|
11
|
+
: steps,
|
|
12
|
+
startedAt: timestamp,
|
|
13
|
+
updatedAt: timestamp,
|
|
14
|
+
completedAt: null,
|
|
15
|
+
error: plan.canExecute ? null : 'Runtime plan is blocked.'
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export function completeRuntimeInitializationStep(snapshot, stepId, timestamp = new Date().toISOString(), message = null) {
|
|
19
|
+
const steps = snapshot.steps.map((step) => step.id === stepId
|
|
20
|
+
? {
|
|
21
|
+
...step,
|
|
22
|
+
status: 'completed',
|
|
23
|
+
completedAt: timestamp,
|
|
24
|
+
message
|
|
25
|
+
}
|
|
26
|
+
: step);
|
|
27
|
+
const nextPendingStep = steps.find((step) => step.status === 'pending') ?? null;
|
|
28
|
+
const nextSteps = nextPendingStep
|
|
29
|
+
? steps.map((step) => step.id === nextPendingStep.id
|
|
30
|
+
? {
|
|
31
|
+
...step,
|
|
32
|
+
status: 'running',
|
|
33
|
+
startedAt: timestamp
|
|
34
|
+
}
|
|
35
|
+
: step)
|
|
36
|
+
: steps;
|
|
37
|
+
const progress = calculateInitializationProgress(nextSteps);
|
|
38
|
+
const completed = progress >= 100;
|
|
39
|
+
return {
|
|
40
|
+
...snapshot,
|
|
41
|
+
status: completed ? 'completed' : 'running',
|
|
42
|
+
activeStepId: completed ? null : nextPendingStep?.id ?? null,
|
|
43
|
+
progress,
|
|
44
|
+
steps: nextSteps,
|
|
45
|
+
updatedAt: timestamp,
|
|
46
|
+
completedAt: completed ? timestamp : null,
|
|
47
|
+
error: null
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export function failRuntimeInitializationStep(snapshot, stepId, error, timestamp = new Date().toISOString()) {
|
|
51
|
+
const steps = snapshot.steps.map((step) => step.id === stepId
|
|
52
|
+
? {
|
|
53
|
+
...step,
|
|
54
|
+
status: 'failed',
|
|
55
|
+
completedAt: timestamp,
|
|
56
|
+
message: error
|
|
57
|
+
}
|
|
58
|
+
: step);
|
|
59
|
+
return {
|
|
60
|
+
...snapshot,
|
|
61
|
+
status: 'failed',
|
|
62
|
+
activeStepId: null,
|
|
63
|
+
progress: calculateInitializationProgress(steps),
|
|
64
|
+
steps,
|
|
65
|
+
updatedAt: timestamp,
|
|
66
|
+
completedAt: timestamp,
|
|
67
|
+
error
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
function createInitializationStep(step, timestamp) {
|
|
71
|
+
return {
|
|
72
|
+
id: `init:${step.id}`,
|
|
73
|
+
planStepId: step.id,
|
|
74
|
+
label: step.label,
|
|
75
|
+
status: step.status === 'skipped' ? 'skipped' : step.status === 'blocked' ? 'failed' : 'pending',
|
|
76
|
+
startedAt: null,
|
|
77
|
+
completedAt: step.status === 'skipped' || step.status === 'blocked' ? timestamp : null,
|
|
78
|
+
message: step.reason
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function calculateInitializationProgress(steps) {
|
|
82
|
+
if (steps.length === 0) {
|
|
83
|
+
return 100;
|
|
84
|
+
}
|
|
85
|
+
const resolvedSteps = steps.filter((step) => step.status === 'completed' || step.status === 'skipped').length;
|
|
86
|
+
return Math.round((resolvedSteps / steps.length) * 100);
|
|
87
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { LaunchPhase } from "../launch/model.js";
|
|
2
|
+
export type RuntimeLifecycleState = LaunchPhase;
|
|
3
|
+
export type RuntimeLifecycleMacroPhase = 'boot' | 'launch' | 'planning' | 'initialization' | 'hydration' | 'running' | 'suspension' | 'teardown' | 'recovery';
|
|
4
|
+
export type RuntimeLifecycleHealth = 'idle' | 'progressing' | 'healthy' | 'recovering' | 'safe-mode' | 'blocked';
|
|
5
|
+
export interface RuntimeLifecycleTransition {
|
|
6
|
+
id: string;
|
|
7
|
+
from: RuntimeLifecycleState | null;
|
|
8
|
+
to: RuntimeLifecycleState;
|
|
9
|
+
accepted: boolean;
|
|
10
|
+
timestamp: string;
|
|
11
|
+
message: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RuntimeLifecycleTransitionError {
|
|
14
|
+
id: string;
|
|
15
|
+
from: RuntimeLifecycleState | null;
|
|
16
|
+
to: RuntimeLifecycleState;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
message: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RuntimeLifecycleSnapshot {
|
|
21
|
+
state: RuntimeLifecycleState;
|
|
22
|
+
previousState: RuntimeLifecycleState | null;
|
|
23
|
+
transitions: RuntimeLifecycleTransition[];
|
|
24
|
+
errors: RuntimeLifecycleTransitionError[];
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
export interface RuntimeLifecycleSummary {
|
|
28
|
+
state: RuntimeLifecycleState;
|
|
29
|
+
previousState: RuntimeLifecycleState | null;
|
|
30
|
+
macroPhase: RuntimeLifecycleMacroPhase;
|
|
31
|
+
health: RuntimeLifecycleHealth;
|
|
32
|
+
acceptedTransitions: number;
|
|
33
|
+
rejectedTransitions: number;
|
|
34
|
+
latestTransitionAt: string | null;
|
|
35
|
+
updatedAt: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RuntimeLifecycleTransitionInput {
|
|
38
|
+
id: string;
|
|
39
|
+
timestamp: string;
|
|
40
|
+
message?: string;
|
|
41
|
+
maxTransitions?: number;
|
|
42
|
+
maxErrors?: number;
|
|
43
|
+
}
|
|
44
|
+
export declare const RUNTIME_LIFECYCLE_ALLOWED_TRANSITIONS: Record<RuntimeLifecycleState, readonly RuntimeLifecycleState[]>;
|
|
45
|
+
export declare const RUNTIME_LIFECYCLE_MACRO_PHASES: Record<RuntimeLifecycleState, RuntimeLifecycleMacroPhase>;
|
|
46
|
+
export declare function createRuntimeLifecycleSnapshot(state?: RuntimeLifecycleState, timestamp?: string): RuntimeLifecycleSnapshot;
|
|
47
|
+
export declare function canTransitionRuntimeLifecycle(from: RuntimeLifecycleState | null, to: RuntimeLifecycleState): boolean;
|
|
48
|
+
export declare function transitionRuntimeLifecycleSnapshot(snapshot: RuntimeLifecycleSnapshot, to: RuntimeLifecycleState, input: RuntimeLifecycleTransitionInput): RuntimeLifecycleSnapshot;
|
|
49
|
+
export declare function resolveRuntimeLifecycleMacroPhase(state: RuntimeLifecycleState): RuntimeLifecycleMacroPhase;
|
|
50
|
+
export declare function resolveRuntimeLifecycleHealth(snapshot: RuntimeLifecycleSnapshot): RuntimeLifecycleHealth;
|
|
51
|
+
export declare function createRuntimeLifecycleSummary(snapshot: RuntimeLifecycleSnapshot): RuntimeLifecycleSummary;
|