@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,398 @@
|
|
|
1
|
+
import { BOOT_PHASES, } from "./types.js";
|
|
2
|
+
const STEP_STATUSES = [
|
|
3
|
+
'pending',
|
|
4
|
+
'running',
|
|
5
|
+
'success',
|
|
6
|
+
'failed',
|
|
7
|
+
'skipped',
|
|
8
|
+
'blocked',
|
|
9
|
+
];
|
|
10
|
+
export function createBootExecutionProjection(state, mode = 'normal', lastEvent, events = []) {
|
|
11
|
+
const steps = Object.values(state.nodes).map((node) => {
|
|
12
|
+
const { state: stepState } = node;
|
|
13
|
+
const durationMs = stepState.startedAt !== undefined && stepState.endedAt !== undefined
|
|
14
|
+
? stepState.endedAt - stepState.startedAt
|
|
15
|
+
: undefined;
|
|
16
|
+
return {
|
|
17
|
+
id: stepState.id,
|
|
18
|
+
label: stepState.label,
|
|
19
|
+
phase: stepState.phase,
|
|
20
|
+
status: stepState.status,
|
|
21
|
+
criticality: stepState.criticality,
|
|
22
|
+
dependencies: stepState.dependencies.map((dependency) => ({ ...dependency })),
|
|
23
|
+
attempts: node.attempts,
|
|
24
|
+
warnings: [...node.warnings],
|
|
25
|
+
metadata: sanitizeMetadata(node.metadata),
|
|
26
|
+
startedAt: stepState.startedAt,
|
|
27
|
+
endedAt: stepState.endedAt,
|
|
28
|
+
durationMs,
|
|
29
|
+
error: stepState.error === undefined ? undefined : stringifyError(stepState.error),
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
const phases = BOOT_PHASES.map((phase) => createPhaseProjection(phase, steps));
|
|
33
|
+
const status = resolveExecutionStatus(state);
|
|
34
|
+
const durationMs = state.startedAt !== undefined && state.endedAt !== undefined
|
|
35
|
+
? state.endedAt - state.startedAt
|
|
36
|
+
: undefined;
|
|
37
|
+
return {
|
|
38
|
+
executionId: state.executionId,
|
|
39
|
+
mode,
|
|
40
|
+
currentPhase: state.phase,
|
|
41
|
+
failed: state.failed,
|
|
42
|
+
phase: state.phase,
|
|
43
|
+
status,
|
|
44
|
+
startedAt: state.startedAt,
|
|
45
|
+
endedAt: state.endedAt,
|
|
46
|
+
durationMs,
|
|
47
|
+
phases,
|
|
48
|
+
steps,
|
|
49
|
+
lastEvent: lastEvent ? sanitizeBootEvent(lastEvent) : undefined,
|
|
50
|
+
events: events.map((event) => sanitizeBootEvent(event)),
|
|
51
|
+
errors: state.errors.map((entry) => ({
|
|
52
|
+
stepId: entry.stepId,
|
|
53
|
+
error: stringifyError(entry.error),
|
|
54
|
+
})),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
export function createBootProjection(state, mode = 'normal', lastEvent, events = []) {
|
|
58
|
+
const projection = createBootExecutionProjection(state, mode, lastEvent, events);
|
|
59
|
+
return {
|
|
60
|
+
executionId: projection.executionId,
|
|
61
|
+
mode: projection.mode,
|
|
62
|
+
currentPhase: projection.currentPhase,
|
|
63
|
+
failed: projection.failed,
|
|
64
|
+
startedAt: projection.startedAt,
|
|
65
|
+
endedAt: projection.endedAt,
|
|
66
|
+
phases: projection.phases,
|
|
67
|
+
steps: projection.steps,
|
|
68
|
+
lastEvent: projection.lastEvent,
|
|
69
|
+
events: projection.events,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function getBootStepDurationMs(step, now = () => Date.now()) {
|
|
73
|
+
if (step.startedAt !== undefined && step.endedAt !== undefined) {
|
|
74
|
+
return step.endedAt - step.startedAt;
|
|
75
|
+
}
|
|
76
|
+
if (step.startedAt !== undefined && step.status === 'running') {
|
|
77
|
+
return now() - step.startedAt;
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
export const getStepDurationMs = getBootStepDurationMs;
|
|
82
|
+
export function createBootEventTimelineRows(projection, events = projection?.events ?? []) {
|
|
83
|
+
if (!projection) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const startedAt = projection.startedAt;
|
|
87
|
+
const endedAt = projection.endedAt ?? Date.now();
|
|
88
|
+
const totalDuration = startedAt !== undefined ? Math.max(1, endedAt - startedAt) : 1;
|
|
89
|
+
const rows = new Map();
|
|
90
|
+
events.forEach((event, index) => {
|
|
91
|
+
const step = 'stepId' in event ? projection.steps.find((entry) => entry.id === event.stepId) : undefined;
|
|
92
|
+
const phase = 'phase' in event
|
|
93
|
+
? projection.phases.find((entry) => entry.phase === event.phase)
|
|
94
|
+
: step
|
|
95
|
+
? projection.phases.find((entry) => entry.phase === step.phase)
|
|
96
|
+
: undefined;
|
|
97
|
+
const eventTime = resolveBootEventTime(event, projection);
|
|
98
|
+
const scope = resolveBootEventTimelineScope(event);
|
|
99
|
+
const scopeId = resolveBootEventTimelineScopeId(event, step, phase);
|
|
100
|
+
const key = `${scope}:${scopeId}`;
|
|
101
|
+
const existing = rows.get(key);
|
|
102
|
+
const kind = resolveBootEventTimelineKind(event);
|
|
103
|
+
const status = resolveBootEventTimelineStatus(event);
|
|
104
|
+
const row = existing ?? {
|
|
105
|
+
id: `${event.executionId}:${key}:${index}`,
|
|
106
|
+
executionId: event.executionId,
|
|
107
|
+
scope,
|
|
108
|
+
scopeId,
|
|
109
|
+
scopeLabel: resolveBootEventTimelineScopeLabel(scope, scopeId, step, phase),
|
|
110
|
+
level: resolveBootEventTimelineLevel(scope),
|
|
111
|
+
name: resolveBootEventTimelineName(event, scopeId),
|
|
112
|
+
status,
|
|
113
|
+
kind,
|
|
114
|
+
eventTypes: [],
|
|
115
|
+
startTime: undefined,
|
|
116
|
+
endTime: undefined,
|
|
117
|
+
durationMs: undefined,
|
|
118
|
+
startPercent: 0,
|
|
119
|
+
timelinePercent: 1,
|
|
120
|
+
};
|
|
121
|
+
row.eventTypes = [...row.eventTypes, event.type];
|
|
122
|
+
if (!existing && kind !== 'open') {
|
|
123
|
+
row.startTime = step?.startedAt ?? phase?.startedAt ?? projection.startedAt ?? eventTime;
|
|
124
|
+
}
|
|
125
|
+
if (kind === 'open') {
|
|
126
|
+
row.startTime = eventTime ?? row.startTime;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
row.endTime = eventTime ?? step?.endedAt ?? phase?.endedAt ?? projection.endedAt;
|
|
130
|
+
row.status = status;
|
|
131
|
+
row.kind = kind;
|
|
132
|
+
}
|
|
133
|
+
if (scope === 'phase' && phase && row.kind === 'open') {
|
|
134
|
+
const inferredPhaseStatus = resolveBootPhaseTimelineStatus(phase);
|
|
135
|
+
if (inferredPhaseStatus !== 'start') {
|
|
136
|
+
row.endTime = phase.endedAt ?? row.endTime;
|
|
137
|
+
row.status = inferredPhaseStatus;
|
|
138
|
+
row.kind = inferredPhaseStatus === 'success' ? 'close' : 'error';
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const fallbackDuration = step?.durationMs ?? phase?.durationMs;
|
|
142
|
+
row.durationMs =
|
|
143
|
+
row.startTime !== undefined && row.endTime !== undefined
|
|
144
|
+
? row.endTime - row.startTime
|
|
145
|
+
: fallbackDuration;
|
|
146
|
+
const rowStart = row.startTime ?? eventTime;
|
|
147
|
+
const rowEnd = row.endTime ?? eventTime ?? rowStart;
|
|
148
|
+
row.startPercent =
|
|
149
|
+
startedAt !== undefined && rowStart !== undefined
|
|
150
|
+
? clampPercent(((rowStart - startedAt) / totalDuration) * 100)
|
|
151
|
+
: 0;
|
|
152
|
+
row.timelinePercent =
|
|
153
|
+
rowStart !== undefined && rowEnd !== undefined
|
|
154
|
+
? Math.max(1, Math.min(100 - row.startPercent, ((rowEnd - rowStart) / totalDuration) * 100))
|
|
155
|
+
: Math.max(1, row.timelinePercent);
|
|
156
|
+
rows.set(key, row);
|
|
157
|
+
});
|
|
158
|
+
return [...rows.values()];
|
|
159
|
+
}
|
|
160
|
+
function createPhaseProjection(phase, allSteps) {
|
|
161
|
+
const steps = allSteps.filter((step) => step.phase === phase);
|
|
162
|
+
const counts = Object.fromEntries(STEP_STATUSES.map((status) => [status, 0]));
|
|
163
|
+
for (const step of steps) {
|
|
164
|
+
counts[step.status] += 1;
|
|
165
|
+
}
|
|
166
|
+
const startedAt = minDefined(steps.map((step) => step.startedAt));
|
|
167
|
+
const endedAt = maxDefined(steps.map((step) => step.endedAt));
|
|
168
|
+
return {
|
|
169
|
+
phase,
|
|
170
|
+
status: resolvePhaseStatus(steps),
|
|
171
|
+
steps,
|
|
172
|
+
counts,
|
|
173
|
+
startedAt,
|
|
174
|
+
endedAt,
|
|
175
|
+
durationMs: startedAt !== undefined && endedAt !== undefined ? endedAt - startedAt : undefined,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
function resolvePhaseStatus(steps) {
|
|
179
|
+
if (steps.length === 0) {
|
|
180
|
+
return 'empty';
|
|
181
|
+
}
|
|
182
|
+
if (steps.some((step) => step.status === 'failed')) {
|
|
183
|
+
return 'failed';
|
|
184
|
+
}
|
|
185
|
+
if (steps.some((step) => step.status === 'blocked')) {
|
|
186
|
+
return 'blocked';
|
|
187
|
+
}
|
|
188
|
+
if (steps.some((step) => step.status === 'running')) {
|
|
189
|
+
return 'running';
|
|
190
|
+
}
|
|
191
|
+
if (steps.every((step) => step.status === 'success')) {
|
|
192
|
+
return 'success';
|
|
193
|
+
}
|
|
194
|
+
if (steps.every((step) => step.status === 'skipped')) {
|
|
195
|
+
return 'skipped';
|
|
196
|
+
}
|
|
197
|
+
return 'pending';
|
|
198
|
+
}
|
|
199
|
+
function resolveExecutionStatus(state) {
|
|
200
|
+
if (state.failed) {
|
|
201
|
+
return 'failed';
|
|
202
|
+
}
|
|
203
|
+
if (state.endedAt !== undefined && state.startedAt !== undefined) {
|
|
204
|
+
return 'success';
|
|
205
|
+
}
|
|
206
|
+
if (state.startedAt !== undefined) {
|
|
207
|
+
return 'running';
|
|
208
|
+
}
|
|
209
|
+
return 'idle';
|
|
210
|
+
}
|
|
211
|
+
function resolveBootEventTime(event, projection) {
|
|
212
|
+
if (event.type === 'boot:start' || event.type === 'boot:success' || event.type === 'boot:failed') {
|
|
213
|
+
return event.type === 'boot:start' ? event.state.startedAt : event.state.endedAt;
|
|
214
|
+
}
|
|
215
|
+
if ('stepId' in event) {
|
|
216
|
+
const step = projection.steps.find((entry) => entry.id === event.stepId);
|
|
217
|
+
if (event.type === 'step:start') {
|
|
218
|
+
return step?.startedAt;
|
|
219
|
+
}
|
|
220
|
+
return step?.endedAt ?? step?.startedAt;
|
|
221
|
+
}
|
|
222
|
+
if ('phase' in event) {
|
|
223
|
+
return projection.phases.find((entry) => entry.phase === event.phase)?.startedAt;
|
|
224
|
+
}
|
|
225
|
+
return undefined;
|
|
226
|
+
}
|
|
227
|
+
function resolveBootEventTimelineScope(event) {
|
|
228
|
+
if ('stepId' in event) {
|
|
229
|
+
return 'step';
|
|
230
|
+
}
|
|
231
|
+
if ('phase' in event) {
|
|
232
|
+
return 'phase';
|
|
233
|
+
}
|
|
234
|
+
return 'boot';
|
|
235
|
+
}
|
|
236
|
+
function resolveBootEventTimelineScopeId(event, step, phase) {
|
|
237
|
+
if ('stepId' in event) {
|
|
238
|
+
return event.stepId;
|
|
239
|
+
}
|
|
240
|
+
if ('phase' in event) {
|
|
241
|
+
return event.phase;
|
|
242
|
+
}
|
|
243
|
+
return step?.id ?? phase?.phase ?? event.executionId;
|
|
244
|
+
}
|
|
245
|
+
function resolveBootEventTimelineScopeLabel(scope, scopeId, step, phase) {
|
|
246
|
+
if (scope === 'step') {
|
|
247
|
+
return `${formatBootPhaseLabel(step?.phase)} / step`;
|
|
248
|
+
}
|
|
249
|
+
if (scope === 'phase') {
|
|
250
|
+
return `${formatBootPhaseLabel(phase?.phase ?? scopeId)} / phase`;
|
|
251
|
+
}
|
|
252
|
+
return 'Boot / root';
|
|
253
|
+
}
|
|
254
|
+
function resolveBootEventTimelineLevel(scope) {
|
|
255
|
+
if (scope === 'boot') {
|
|
256
|
+
return 0;
|
|
257
|
+
}
|
|
258
|
+
if (scope === 'phase') {
|
|
259
|
+
return 1;
|
|
260
|
+
}
|
|
261
|
+
return 2;
|
|
262
|
+
}
|
|
263
|
+
function resolveBootEventTimelineName(event, fallback) {
|
|
264
|
+
if ('stepId' in event) {
|
|
265
|
+
return event.stepId;
|
|
266
|
+
}
|
|
267
|
+
if ('phase' in event) {
|
|
268
|
+
return event.phase;
|
|
269
|
+
}
|
|
270
|
+
return fallback;
|
|
271
|
+
}
|
|
272
|
+
function resolveBootEventTimelineStatus(event) {
|
|
273
|
+
if (event.type.endsWith(':start')) {
|
|
274
|
+
return 'start';
|
|
275
|
+
}
|
|
276
|
+
if (event.type.endsWith(':success')) {
|
|
277
|
+
return 'success';
|
|
278
|
+
}
|
|
279
|
+
if (event.type.endsWith(':failed')) {
|
|
280
|
+
return 'failed';
|
|
281
|
+
}
|
|
282
|
+
if (event.type.endsWith(':blocked')) {
|
|
283
|
+
return 'blocked';
|
|
284
|
+
}
|
|
285
|
+
return 'event';
|
|
286
|
+
}
|
|
287
|
+
function resolveBootEventTimelineKind(event) {
|
|
288
|
+
if (event.type.endsWith(':start')) {
|
|
289
|
+
return 'open';
|
|
290
|
+
}
|
|
291
|
+
if (event.type.endsWith(':success')) {
|
|
292
|
+
return 'close';
|
|
293
|
+
}
|
|
294
|
+
if (event.type.endsWith(':failed') || event.type.endsWith(':blocked')) {
|
|
295
|
+
return 'error';
|
|
296
|
+
}
|
|
297
|
+
return 'event';
|
|
298
|
+
}
|
|
299
|
+
function resolveBootPhaseTimelineStatus(phase) {
|
|
300
|
+
if (phase.status === 'success' || phase.status === 'skipped') {
|
|
301
|
+
return 'success';
|
|
302
|
+
}
|
|
303
|
+
if (phase.status === 'failed') {
|
|
304
|
+
return 'failed';
|
|
305
|
+
}
|
|
306
|
+
if (phase.status === 'blocked') {
|
|
307
|
+
return 'blocked';
|
|
308
|
+
}
|
|
309
|
+
return 'start';
|
|
310
|
+
}
|
|
311
|
+
function formatBootPhaseLabel(phase) {
|
|
312
|
+
return phase ? phase.replace(/^\w/, (letter) => letter.toUpperCase()) : 'Unknown';
|
|
313
|
+
}
|
|
314
|
+
function clampPercent(value) {
|
|
315
|
+
return Math.max(0, Math.min(100, Number.isFinite(value) ? value : 0));
|
|
316
|
+
}
|
|
317
|
+
function sanitizeBootEvent(event) {
|
|
318
|
+
if (event.type === 'boot:start' || event.type === 'boot:success') {
|
|
319
|
+
return {
|
|
320
|
+
...event,
|
|
321
|
+
state: sanitizeExecutionState(event.state),
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
if (event.type === 'boot:failed') {
|
|
325
|
+
return {
|
|
326
|
+
...event,
|
|
327
|
+
state: sanitizeExecutionState(event.state),
|
|
328
|
+
error: stringifyError(event.error),
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
if (event.type === 'step:failed') {
|
|
332
|
+
return {
|
|
333
|
+
...event,
|
|
334
|
+
error: stringifyError(event.error),
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
return { ...event };
|
|
338
|
+
}
|
|
339
|
+
function sanitizeExecutionState(state) {
|
|
340
|
+
return {
|
|
341
|
+
...state,
|
|
342
|
+
steps: Object.fromEntries(Object.entries(state.steps).map(([stepId, step]) => [
|
|
343
|
+
stepId,
|
|
344
|
+
{
|
|
345
|
+
...step,
|
|
346
|
+
dependencies: step.dependencies.map((dependency) => ({ ...dependency })),
|
|
347
|
+
error: step.error === undefined ? undefined : stringifyError(step.error),
|
|
348
|
+
},
|
|
349
|
+
])),
|
|
350
|
+
nodes: Object.fromEntries(Object.entries(state.nodes).map(([stepId, node]) => [
|
|
351
|
+
stepId,
|
|
352
|
+
{
|
|
353
|
+
...node,
|
|
354
|
+
state: {
|
|
355
|
+
...node.state,
|
|
356
|
+
dependencies: node.state.dependencies.map((dependency) => ({ ...dependency })),
|
|
357
|
+
error: node.state.error === undefined ? undefined : stringifyError(node.state.error),
|
|
358
|
+
},
|
|
359
|
+
warnings: [...node.warnings],
|
|
360
|
+
metadata: sanitizeMetadata(node.metadata),
|
|
361
|
+
},
|
|
362
|
+
])),
|
|
363
|
+
errors: state.errors.map((entry) => ({
|
|
364
|
+
stepId: entry.stepId,
|
|
365
|
+
error: stringifyError(entry.error),
|
|
366
|
+
})),
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
function sanitizeMetadata(metadata) {
|
|
370
|
+
try {
|
|
371
|
+
return JSON.parse(JSON.stringify(metadata));
|
|
372
|
+
}
|
|
373
|
+
catch {
|
|
374
|
+
return Object.fromEntries(Object.entries(metadata).map(([key, value]) => [key, stringifyError(value)]));
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
function stringifyError(error) {
|
|
378
|
+
if (error instanceof Error) {
|
|
379
|
+
return error.message;
|
|
380
|
+
}
|
|
381
|
+
if (typeof error === 'string') {
|
|
382
|
+
return error;
|
|
383
|
+
}
|
|
384
|
+
try {
|
|
385
|
+
return JSON.stringify(error);
|
|
386
|
+
}
|
|
387
|
+
catch {
|
|
388
|
+
return String(error);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
function minDefined(values) {
|
|
392
|
+
const defined = values.filter((value) => value !== undefined);
|
|
393
|
+
return defined.length === 0 ? undefined : Math.min(...defined);
|
|
394
|
+
}
|
|
395
|
+
function maxDefined(values) {
|
|
396
|
+
const defined = values.filter((value) => value !== undefined);
|
|
397
|
+
return defined.length === 0 ? undefined : Math.max(...defined);
|
|
398
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export type BootPhase = 'plan' | 'initialize' | 'hydrate' | 'run';
|
|
2
|
+
export declare const BOOT_PHASES: readonly BootPhase[];
|
|
3
|
+
export type BootStepStatus = 'pending' | 'running' | 'success' | 'failed' | 'skipped' | 'blocked';
|
|
4
|
+
export type BootStepCriticality = 'critical' | 'optional';
|
|
5
|
+
export type BootMode = 'normal' | 'safe' | 'recovery' | 'readonly' | 'diagnostic';
|
|
6
|
+
export interface BootContext {
|
|
7
|
+
mode: BootMode;
|
|
8
|
+
services: Map<string, unknown>;
|
|
9
|
+
capabilities: Map<string, unknown>;
|
|
10
|
+
runtime: Map<string, unknown>;
|
|
11
|
+
options: Map<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
export interface CreateBootContextOptions {
|
|
14
|
+
mode?: BootMode;
|
|
15
|
+
services?: Iterable<readonly [string, unknown]>;
|
|
16
|
+
capabilities?: Iterable<readonly [string, unknown]>;
|
|
17
|
+
runtime?: Iterable<readonly [string, unknown]>;
|
|
18
|
+
options?: Iterable<readonly [string, unknown]>;
|
|
19
|
+
}
|
|
20
|
+
export declare function createBootContext(options?: CreateBootContextOptions): BootContext;
|
|
21
|
+
export declare function getService<T>(ctx: BootContext, key: string): T;
|
|
22
|
+
export declare function setService(ctx: BootContext, key: string, value: unknown): void;
|
|
23
|
+
export declare function getCapability<T>(ctx: BootContext, key: string): T;
|
|
24
|
+
export declare function setCapability(ctx: BootContext, key: string, value: unknown): void;
|
|
25
|
+
export declare function getRuntimeValue<T>(ctx: BootContext, key: string): T;
|
|
26
|
+
export declare function setRuntimeValue(ctx: BootContext, key: string, value: unknown): void;
|
|
27
|
+
export declare function getBootOption<T>(ctx: BootContext, key: string): T;
|
|
28
|
+
export declare function setBootOption(ctx: BootContext, key: string, value: unknown): void;
|
|
29
|
+
export interface BootDependency {
|
|
30
|
+
stepId: string;
|
|
31
|
+
optional?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface BootStepResult {
|
|
34
|
+
warnings?: string[];
|
|
35
|
+
metadata?: Record<string, unknown>;
|
|
36
|
+
}
|
|
37
|
+
export interface BootStep {
|
|
38
|
+
id: string;
|
|
39
|
+
label: string;
|
|
40
|
+
phase: BootPhase;
|
|
41
|
+
dependsOn?: BootDependency[];
|
|
42
|
+
criticality?: BootStepCriticality;
|
|
43
|
+
run(ctx: BootContext): Promise<BootStepResult | void> | BootStepResult | void;
|
|
44
|
+
rollback?(ctx: BootContext): Promise<BootStepResult | void> | BootStepResult | void;
|
|
45
|
+
teardown?(ctx: BootContext): Promise<BootStepResult | void> | BootStepResult | void;
|
|
46
|
+
}
|
|
47
|
+
export interface BootGraph {
|
|
48
|
+
steps: BootStep[];
|
|
49
|
+
}
|
|
50
|
+
export interface BootStepState {
|
|
51
|
+
id: string;
|
|
52
|
+
label: string;
|
|
53
|
+
phase: BootPhase;
|
|
54
|
+
status: BootStepStatus;
|
|
55
|
+
criticality: BootStepCriticality;
|
|
56
|
+
dependencies: BootDependency[];
|
|
57
|
+
startedAt?: number;
|
|
58
|
+
endedAt?: number;
|
|
59
|
+
error?: unknown;
|
|
60
|
+
}
|
|
61
|
+
export interface BootNodeRuntime {
|
|
62
|
+
state: BootStepState;
|
|
63
|
+
attempts: number;
|
|
64
|
+
warnings: string[];
|
|
65
|
+
metadata: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
export interface BootExecutionError {
|
|
68
|
+
stepId?: string;
|
|
69
|
+
error: unknown;
|
|
70
|
+
}
|
|
71
|
+
export interface BootExecutionState {
|
|
72
|
+
executionId: string;
|
|
73
|
+
phase: BootPhase;
|
|
74
|
+
steps: Record<string, BootStepState>;
|
|
75
|
+
nodes: Record<string, BootNodeRuntime>;
|
|
76
|
+
startedAt?: number;
|
|
77
|
+
endedAt?: number;
|
|
78
|
+
failed: boolean;
|
|
79
|
+
errors: BootExecutionError[];
|
|
80
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export const BOOT_PHASES = ['plan', 'initialize', 'hydrate', 'run'];
|
|
2
|
+
export function createBootContext(options = {}) {
|
|
3
|
+
return {
|
|
4
|
+
mode: options.mode ?? 'normal',
|
|
5
|
+
services: new Map(options.services),
|
|
6
|
+
capabilities: new Map(options.capabilities),
|
|
7
|
+
runtime: new Map(options.runtime),
|
|
8
|
+
options: new Map(options.options),
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export function getService(ctx, key) {
|
|
12
|
+
if (!ctx.services.has(key)) {
|
|
13
|
+
throw new Error(`Boot service "${key}" is not registered.`);
|
|
14
|
+
}
|
|
15
|
+
return ctx.services.get(key);
|
|
16
|
+
}
|
|
17
|
+
export function setService(ctx, key, value) {
|
|
18
|
+
ctx.services.set(key, value);
|
|
19
|
+
}
|
|
20
|
+
export function getCapability(ctx, key) {
|
|
21
|
+
if (!ctx.capabilities.has(key)) {
|
|
22
|
+
throw new Error(`Boot capability "${key}" is not registered.`);
|
|
23
|
+
}
|
|
24
|
+
return ctx.capabilities.get(key);
|
|
25
|
+
}
|
|
26
|
+
export function setCapability(ctx, key, value) {
|
|
27
|
+
ctx.capabilities.set(key, value);
|
|
28
|
+
}
|
|
29
|
+
export function getRuntimeValue(ctx, key) {
|
|
30
|
+
if (!ctx.runtime.has(key)) {
|
|
31
|
+
throw new Error(`Boot runtime value "${key}" is not registered.`);
|
|
32
|
+
}
|
|
33
|
+
return ctx.runtime.get(key);
|
|
34
|
+
}
|
|
35
|
+
export function setRuntimeValue(ctx, key, value) {
|
|
36
|
+
ctx.runtime.set(key, value);
|
|
37
|
+
}
|
|
38
|
+
export function getBootOption(ctx, key) {
|
|
39
|
+
if (!ctx.options.has(key)) {
|
|
40
|
+
throw new Error(`Boot option "${key}" is not registered.`);
|
|
41
|
+
}
|
|
42
|
+
return ctx.options.get(key);
|
|
43
|
+
}
|
|
44
|
+
export function setBootOption(ctx, key, value) {
|
|
45
|
+
ctx.options.set(key, value);
|
|
46
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { DockableEntity, DockableEntityKind, DockAxis, DockContainerRuntimeState, DockPlacement } from "./docking.js";
|
|
2
|
+
export declare const DOCK_ARRANGEMENT_SCHEMA_VERSION: 1;
|
|
3
|
+
export type DockArrangementPresentation = 'tabs' | 'stack' | 'split';
|
|
4
|
+
export interface DockArrangementEntityNode {
|
|
5
|
+
nodeType: 'entity';
|
|
6
|
+
nodeId: string;
|
|
7
|
+
entity: DockableEntity;
|
|
8
|
+
}
|
|
9
|
+
export interface DockArrangementGroupNode {
|
|
10
|
+
nodeType: 'group';
|
|
11
|
+
nodeId: string;
|
|
12
|
+
presentation: DockArrangementPresentation;
|
|
13
|
+
axis: DockAxis;
|
|
14
|
+
children: DockArrangementNode[];
|
|
15
|
+
activeChildId: string | null;
|
|
16
|
+
sizes?: number[];
|
|
17
|
+
}
|
|
18
|
+
export type DockArrangementNode = DockArrangementEntityNode | DockArrangementGroupNode;
|
|
19
|
+
export interface DockArrangement {
|
|
20
|
+
schemaVersion: typeof DOCK_ARRANGEMENT_SCHEMA_VERSION;
|
|
21
|
+
root: DockArrangementGroupNode;
|
|
22
|
+
}
|
|
23
|
+
export type DockArrangementIssueCode = 'empty-node-id' | 'duplicate-node-id' | 'empty-entity-id' | 'duplicate-entity' | 'invalid-active-child' | 'invalid-axis' | 'invalid-size-count';
|
|
24
|
+
export interface DockArrangementIssue {
|
|
25
|
+
code: DockArrangementIssueCode;
|
|
26
|
+
nodeId: string;
|
|
27
|
+
entityKey?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface DockArrangementEntityPlacement extends DockPlacement {
|
|
30
|
+
targetGroupId?: string | null;
|
|
31
|
+
activate?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function createDockArrangement(input: {
|
|
34
|
+
id: string;
|
|
35
|
+
presentation?: DockArrangementPresentation;
|
|
36
|
+
axis?: DockAxis;
|
|
37
|
+
entities?: DockableEntity[];
|
|
38
|
+
activeEntityId?: string | null;
|
|
39
|
+
}): DockArrangement;
|
|
40
|
+
export declare function createDockArrangementEntityNode(entity: DockableEntity): DockArrangementEntityNode | null;
|
|
41
|
+
export declare function createDockArrangementGroup(input: {
|
|
42
|
+
id: string;
|
|
43
|
+
presentation: DockArrangementPresentation;
|
|
44
|
+
axis?: DockAxis;
|
|
45
|
+
children?: DockArrangementNode[];
|
|
46
|
+
activeChildId?: string | null;
|
|
47
|
+
sizes?: number[];
|
|
48
|
+
}): DockArrangementGroupNode;
|
|
49
|
+
export declare function getDockableEntityKey(entity: Pick<DockableEntity, 'id' | 'kind'>): string;
|
|
50
|
+
export declare function listDockArrangementEntities(arrangement: DockArrangement): DockableEntity[];
|
|
51
|
+
export declare function findDockArrangementGroup(arrangement: DockArrangement, groupId: string): DockArrangementGroupNode | null;
|
|
52
|
+
export declare function upsertDockArrangementEntity(arrangement: DockArrangement, entity: DockableEntity, placement?: DockArrangementEntityPlacement): DockArrangement;
|
|
53
|
+
export declare function removeDockArrangementEntity(arrangement: DockArrangement, entity: Pick<DockableEntity, 'id' | 'kind'>): DockArrangement;
|
|
54
|
+
export declare function setDockArrangementActiveEntity(arrangement: DockArrangement, entity: Pick<DockableEntity, 'id' | 'kind'>): DockArrangement;
|
|
55
|
+
export declare function createDockArrangementFromContainerRuntimeState(state: DockContainerRuntimeState, entityKind: DockableEntityKind, presentation?: DockArrangementPresentation): DockArrangement;
|
|
56
|
+
export declare function projectDockArrangementToContainerRuntimeState(arrangement: DockArrangement, fallback: Pick<DockContainerRuntimeState, 'id' | 'kind' | 'isVisible'>): DockContainerRuntimeState;
|
|
57
|
+
export declare function validateDockArrangement(arrangement: DockArrangement): DockArrangementIssue[];
|