@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,48 @@
|
|
|
1
|
+
import type { LaunchState } from "../../domain/launch/model.js";
|
|
2
|
+
import type { RuntimeDebugEventLevel, RuntimeLaunchSnapshot, RuntimeLaunchTransition, RuntimeLaunchProgressSnapshot } from "../../domain/runtime/model.js";
|
|
3
|
+
import type { RuntimeStoreMutationInput } from "../../domain/runtime/observability.js";
|
|
4
|
+
export interface RuntimeLaunchTransitionRecordInput {
|
|
5
|
+
id: string;
|
|
6
|
+
message: string;
|
|
7
|
+
previousPhase: LaunchState['phase'] | null;
|
|
8
|
+
state: LaunchState;
|
|
9
|
+
timestamp: string;
|
|
10
|
+
}
|
|
11
|
+
export interface RuntimeLaunchSnapshotFromStateInput {
|
|
12
|
+
state: LaunchState;
|
|
13
|
+
timestamp: string;
|
|
14
|
+
transitions: RuntimeLaunchTransition[];
|
|
15
|
+
}
|
|
16
|
+
export interface RuntimeLaunchStoreMutationValueInput {
|
|
17
|
+
previousPhase: LaunchState['phase'] | null;
|
|
18
|
+
progress: RuntimeLaunchProgressSnapshot;
|
|
19
|
+
state: LaunchState;
|
|
20
|
+
}
|
|
21
|
+
export interface RuntimeLaunchStoreMutationInput {
|
|
22
|
+
id: string;
|
|
23
|
+
previousPhase: LaunchState['phase'] | null;
|
|
24
|
+
progress: RuntimeLaunchProgressSnapshot;
|
|
25
|
+
state: LaunchState;
|
|
26
|
+
timestamp: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RuntimeLaunchPhaseDebugEventInput {
|
|
29
|
+
id?: string;
|
|
30
|
+
level?: RuntimeDebugEventLevel;
|
|
31
|
+
type: string;
|
|
32
|
+
message?: string;
|
|
33
|
+
scope?: string | null;
|
|
34
|
+
payload?: unknown;
|
|
35
|
+
timestamp?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface RuntimeLaunchPhaseDebugEventInputOptions {
|
|
38
|
+
launchSnapshot: RuntimeLaunchSnapshot;
|
|
39
|
+
previousPhase: LaunchState['phase'] | null;
|
|
40
|
+
state: LaunchState;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
transition: RuntimeLaunchTransition;
|
|
43
|
+
}
|
|
44
|
+
export declare function createRuntimeLaunchTransitionRecord(input: RuntimeLaunchTransitionRecordInput): RuntimeLaunchTransition;
|
|
45
|
+
export declare function createRuntimeLaunchSnapshotFromState(input: RuntimeLaunchSnapshotFromStateInput): RuntimeLaunchSnapshot;
|
|
46
|
+
export declare function createRuntimeLaunchStoreMutationValue(input: RuntimeLaunchStoreMutationValueInput): NonNullable<RuntimeStoreMutationInput['value']>;
|
|
47
|
+
export declare function createRuntimeLaunchStoreMutationInput(input: RuntimeLaunchStoreMutationInput): RuntimeStoreMutationInput;
|
|
48
|
+
export declare function createRuntimeLaunchPhaseDebugEventInput(input: RuntimeLaunchPhaseDebugEventInputOptions): RuntimeLaunchPhaseDebugEventInput;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { createRuntimeLaunchProgressSnapshot } from "./RuntimeLaunchProgress.js";
|
|
2
|
+
import { sanitizeRuntimeJson } from "./WorkbenchRuntimeSanitizers.js";
|
|
3
|
+
export function createRuntimeLaunchTransitionRecord(input) {
|
|
4
|
+
return {
|
|
5
|
+
id: input.id,
|
|
6
|
+
phase: input.state.phase,
|
|
7
|
+
previousPhase: input.previousPhase,
|
|
8
|
+
target: input.state.target
|
|
9
|
+
? sanitizeRuntimeJson(input.state.target)
|
|
10
|
+
: null,
|
|
11
|
+
timestamp: input.timestamp,
|
|
12
|
+
message: input.message
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function createRuntimeLaunchSnapshotFromState(input) {
|
|
16
|
+
return {
|
|
17
|
+
phase: input.state.phase,
|
|
18
|
+
target: input.state.target
|
|
19
|
+
? sanitizeRuntimeJson(input.state.target)
|
|
20
|
+
: null,
|
|
21
|
+
preflight: input.state.preflight
|
|
22
|
+
? sanitizeRuntimeJson(input.state.preflight)
|
|
23
|
+
: null,
|
|
24
|
+
plan: input.state.plan ? sanitizeRuntimeJson(input.state.plan) : null,
|
|
25
|
+
initialization: input.state.initialization
|
|
26
|
+
? sanitizeRuntimeJson(input.state.initialization)
|
|
27
|
+
: null,
|
|
28
|
+
hydration: input.state.hydration
|
|
29
|
+
? sanitizeRuntimeJson(input.state.hydration)
|
|
30
|
+
: null,
|
|
31
|
+
progress: createRuntimeLaunchProgressSnapshot(input.state),
|
|
32
|
+
state: sanitizeRuntimeJson(input.state),
|
|
33
|
+
transitions: input.transitions,
|
|
34
|
+
updatedAt: input.timestamp
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export function createRuntimeLaunchStoreMutationValue(input) {
|
|
38
|
+
return {
|
|
39
|
+
phase: input.state.phase,
|
|
40
|
+
previousPhase: input.previousPhase,
|
|
41
|
+
targetKind: input.state.target?.kind ?? null,
|
|
42
|
+
profile: input.state.target?.profile ?? null,
|
|
43
|
+
progress: input.progress,
|
|
44
|
+
error: input.state.error
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function createRuntimeLaunchStoreMutationInput(input) {
|
|
48
|
+
return {
|
|
49
|
+
id: input.id,
|
|
50
|
+
storeId: 'launch.state',
|
|
51
|
+
kind: input.previousPhase ? 'update' : 'snapshot',
|
|
52
|
+
timestamp: input.timestamp,
|
|
53
|
+
value: createRuntimeLaunchStoreMutationValue(input)
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export function createRuntimeLaunchPhaseDebugEventInput(input) {
|
|
57
|
+
return {
|
|
58
|
+
id: input.transition.id,
|
|
59
|
+
level: input.state.phase === 'RECOVERY' || input.state.phase === 'SAFE_MODE' ? 'warning' : 'info',
|
|
60
|
+
type: 'launch.phase.changed',
|
|
61
|
+
message: input.transition.message,
|
|
62
|
+
scope: 'launch',
|
|
63
|
+
timestamp: input.timestamp,
|
|
64
|
+
payload: {
|
|
65
|
+
phase: input.state.phase,
|
|
66
|
+
previousPhase: input.previousPhase,
|
|
67
|
+
target: input.state.target,
|
|
68
|
+
preflight: input.state.preflight,
|
|
69
|
+
progress: input.launchSnapshot.progress,
|
|
70
|
+
error: input.state.error
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RuntimeDebugEvent, RuntimeStackTrace } from "../../domain/runtime/model.js";
|
|
2
|
+
import type { RuntimeCrashReport, RuntimeCrashReportInput, RuntimeEntityLifecycleEntry, RuntimeEntityLifecycleInput, RuntimeHealthCheck, RuntimeHealthCheckInput, RuntimeObservabilitySnapshot, RuntimePerformanceMarker, RuntimePerformanceMarkerInput, RuntimeStoreMutationEntry, RuntimeStoreMutationInput, RuntimeStructuredLog, RuntimeStructuredLogInput, RuntimeTelemetryTrace, RuntimeTelemetryTraceInput } from "../../domain/runtime/observability.js";
|
|
3
|
+
export interface RuntimeObservabilityHubOptions {
|
|
4
|
+
maxEntries?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class RuntimeObservabilityHub {
|
|
7
|
+
private readonly maxEntries;
|
|
8
|
+
private traces;
|
|
9
|
+
private logs;
|
|
10
|
+
private performanceMarkers;
|
|
11
|
+
private healthChecks;
|
|
12
|
+
private storeMutations;
|
|
13
|
+
private lifecycleEntries;
|
|
14
|
+
private crashReports;
|
|
15
|
+
private sequence;
|
|
16
|
+
constructor(options?: RuntimeObservabilityHubOptions);
|
|
17
|
+
createSnapshot(timestamp?: string): RuntimeObservabilitySnapshot;
|
|
18
|
+
recordTrace(input: RuntimeTelemetryTraceInput): RuntimeTelemetryTrace;
|
|
19
|
+
recordDebugEvent(event: RuntimeDebugEvent): RuntimeTelemetryTrace;
|
|
20
|
+
recordStackTrace(trace: RuntimeStackTrace): RuntimeTelemetryTrace;
|
|
21
|
+
recordLog(input: RuntimeStructuredLogInput): RuntimeStructuredLog;
|
|
22
|
+
recordPerformanceMarker(input: RuntimePerformanceMarkerInput): RuntimePerformanceMarker;
|
|
23
|
+
recordHealthCheck(input: RuntimeHealthCheckInput): RuntimeHealthCheck;
|
|
24
|
+
recordStoreMutation(input: RuntimeStoreMutationInput): RuntimeStoreMutationEntry;
|
|
25
|
+
recordEntityLifecycle(input: RuntimeEntityLifecycleInput): RuntimeEntityLifecycleEntry;
|
|
26
|
+
captureCrashReport(error: Error | string, input?: RuntimeCrashReportInput): RuntimeCrashReport;
|
|
27
|
+
private createId;
|
|
28
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
export class RuntimeObservabilityHub {
|
|
2
|
+
maxEntries;
|
|
3
|
+
traces = [];
|
|
4
|
+
logs = [];
|
|
5
|
+
performanceMarkers = [];
|
|
6
|
+
healthChecks = [];
|
|
7
|
+
storeMutations = [];
|
|
8
|
+
lifecycleEntries = [];
|
|
9
|
+
crashReports = [];
|
|
10
|
+
sequence = 0;
|
|
11
|
+
constructor(options = {}) {
|
|
12
|
+
this.maxEntries = options.maxEntries ?? 100;
|
|
13
|
+
}
|
|
14
|
+
createSnapshot(timestamp = new Date().toISOString()) {
|
|
15
|
+
return {
|
|
16
|
+
generatedAt: timestamp,
|
|
17
|
+
traces: [...this.traces],
|
|
18
|
+
logs: [...this.logs],
|
|
19
|
+
performanceMarkers: [...this.performanceMarkers],
|
|
20
|
+
healthChecks: [...this.healthChecks],
|
|
21
|
+
storeMutations: [...this.storeMutations],
|
|
22
|
+
lifecycleEntries: [...this.lifecycleEntries],
|
|
23
|
+
crashReports: [...this.crashReports]
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
recordTrace(input) {
|
|
27
|
+
const trace = {
|
|
28
|
+
id: input.id ?? this.createId('trace'),
|
|
29
|
+
type: input.type,
|
|
30
|
+
level: input.level ?? 'info',
|
|
31
|
+
scope: normalizeNullableText(input.scope, 160),
|
|
32
|
+
label: sanitizeText(input.label ?? input.type, 160),
|
|
33
|
+
message: sanitizeText(input.message ?? input.label ?? input.type, 500),
|
|
34
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
35
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
36
|
+
};
|
|
37
|
+
this.traces = prependRing(this.traces, trace, this.maxEntries);
|
|
38
|
+
return trace;
|
|
39
|
+
}
|
|
40
|
+
recordDebugEvent(event) {
|
|
41
|
+
return this.recordTrace({
|
|
42
|
+
id: event.id,
|
|
43
|
+
type: 'debug-event',
|
|
44
|
+
level: event.level,
|
|
45
|
+
scope: event.scope,
|
|
46
|
+
label: event.type,
|
|
47
|
+
message: event.message,
|
|
48
|
+
timestamp: event.timestamp,
|
|
49
|
+
payload: event.payload
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
recordStackTrace(trace) {
|
|
53
|
+
return this.recordTrace({
|
|
54
|
+
id: trace.id,
|
|
55
|
+
type: 'stack-trace',
|
|
56
|
+
level: 'error',
|
|
57
|
+
scope: trace.scope,
|
|
58
|
+
label: trace.message,
|
|
59
|
+
message: trace.message,
|
|
60
|
+
timestamp: trace.timestamp,
|
|
61
|
+
payload: {
|
|
62
|
+
frames: trace.frames,
|
|
63
|
+
cause: trace.cause
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
recordLog(input) {
|
|
68
|
+
const log = {
|
|
69
|
+
id: input.id ?? this.createId('log'),
|
|
70
|
+
level: input.level ?? 'info',
|
|
71
|
+
scope: normalizeNullableText(input.scope, 160),
|
|
72
|
+
message: sanitizeText(input.message, 500),
|
|
73
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
74
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
75
|
+
};
|
|
76
|
+
this.logs = prependRing(this.logs, log, this.maxEntries);
|
|
77
|
+
this.recordTrace({
|
|
78
|
+
id: log.id,
|
|
79
|
+
type: 'debug-event',
|
|
80
|
+
level: log.level,
|
|
81
|
+
scope: log.scope,
|
|
82
|
+
label: 'structured log',
|
|
83
|
+
message: log.message,
|
|
84
|
+
timestamp: log.timestamp,
|
|
85
|
+
payload: log.payload
|
|
86
|
+
});
|
|
87
|
+
return log;
|
|
88
|
+
}
|
|
89
|
+
recordPerformanceMarker(input) {
|
|
90
|
+
const marker = {
|
|
91
|
+
id: input.id ?? this.createId('perf'),
|
|
92
|
+
label: sanitizeText(input.label, 160),
|
|
93
|
+
scope: normalizeNullableText(input.scope, 160),
|
|
94
|
+
startTime: normalizeFiniteNumber(input.startTime) ?? 0,
|
|
95
|
+
durationMs: normalizeFiniteNumber(input.durationMs),
|
|
96
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
97
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
98
|
+
};
|
|
99
|
+
this.performanceMarkers = prependRing(this.performanceMarkers, marker, this.maxEntries);
|
|
100
|
+
this.recordTrace({
|
|
101
|
+
id: marker.id,
|
|
102
|
+
type: 'performance-marker',
|
|
103
|
+
level: 'debug',
|
|
104
|
+
scope: marker.scope,
|
|
105
|
+
label: marker.label,
|
|
106
|
+
message: marker.durationMs === null ? marker.label : `${marker.label} ${marker.durationMs}ms`,
|
|
107
|
+
timestamp: marker.timestamp,
|
|
108
|
+
payload: marker.payload
|
|
109
|
+
});
|
|
110
|
+
return marker;
|
|
111
|
+
}
|
|
112
|
+
recordHealthCheck(input) {
|
|
113
|
+
const healthCheck = {
|
|
114
|
+
id: input.id ?? this.createId('health'),
|
|
115
|
+
targetId: sanitizeText(input.targetId, 160),
|
|
116
|
+
targetType: input.targetType,
|
|
117
|
+
status: normalizeStatus(input.status),
|
|
118
|
+
checkedAt: input.checkedAt ?? new Date().toISOString(),
|
|
119
|
+
latencyMs: normalizeFiniteNumber(input.latencyMs),
|
|
120
|
+
message: normalizeNullableText(input.message, 500),
|
|
121
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
122
|
+
};
|
|
123
|
+
this.healthChecks = prependRing(this.healthChecks, healthCheck, this.maxEntries);
|
|
124
|
+
this.recordTrace({
|
|
125
|
+
id: healthCheck.id,
|
|
126
|
+
type: 'health-check',
|
|
127
|
+
level: healthCheck.status === 'error' ? 'error' : healthCheck.status === 'degraded' ? 'warning' : 'info',
|
|
128
|
+
scope: healthCheck.targetType,
|
|
129
|
+
label: healthCheck.targetId,
|
|
130
|
+
message: healthCheck.message ?? `Health ${healthCheck.status}`,
|
|
131
|
+
timestamp: healthCheck.checkedAt,
|
|
132
|
+
payload: healthCheck.payload
|
|
133
|
+
});
|
|
134
|
+
return healthCheck;
|
|
135
|
+
}
|
|
136
|
+
recordStoreMutation(input) {
|
|
137
|
+
const mutation = {
|
|
138
|
+
id: input.id ?? this.createId('store'),
|
|
139
|
+
storeId: sanitizeText(input.storeId, 160),
|
|
140
|
+
kind: input.kind,
|
|
141
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
142
|
+
value: input.value === undefined ? undefined : sanitizeJson(input.value)
|
|
143
|
+
};
|
|
144
|
+
this.storeMutations = prependRing(this.storeMutations, mutation, this.maxEntries);
|
|
145
|
+
this.recordTrace({
|
|
146
|
+
id: mutation.id,
|
|
147
|
+
type: 'store-mutation',
|
|
148
|
+
level: 'debug',
|
|
149
|
+
scope: 'store',
|
|
150
|
+
label: mutation.storeId,
|
|
151
|
+
message: `Store ${mutation.kind}`,
|
|
152
|
+
timestamp: mutation.timestamp,
|
|
153
|
+
payload: mutation.value
|
|
154
|
+
});
|
|
155
|
+
return mutation;
|
|
156
|
+
}
|
|
157
|
+
recordEntityLifecycle(input) {
|
|
158
|
+
const entry = {
|
|
159
|
+
id: input.id ?? this.createId('lifecycle'),
|
|
160
|
+
entityId: sanitizeText(input.entityId, 160),
|
|
161
|
+
entityType: input.entityType,
|
|
162
|
+
kind: input.kind,
|
|
163
|
+
status: normalizeStatus(input.status ?? (input.kind === 'error' ? 'error' : 'active')),
|
|
164
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
165
|
+
message: normalizeNullableText(input.message, 500),
|
|
166
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
167
|
+
};
|
|
168
|
+
this.lifecycleEntries = prependRing(this.lifecycleEntries, entry, this.maxEntries);
|
|
169
|
+
this.recordTrace({
|
|
170
|
+
id: entry.id,
|
|
171
|
+
type: 'lifecycle',
|
|
172
|
+
level: entry.status === 'error' ? 'error' : entry.status === 'degraded' ? 'warning' : 'info',
|
|
173
|
+
scope: entry.entityType,
|
|
174
|
+
label: entry.entityId,
|
|
175
|
+
message: entry.message ?? `${entry.entityType} ${entry.kind}`,
|
|
176
|
+
timestamp: entry.timestamp,
|
|
177
|
+
payload: entry.payload
|
|
178
|
+
});
|
|
179
|
+
return entry;
|
|
180
|
+
}
|
|
181
|
+
captureCrashReport(error, input = {}) {
|
|
182
|
+
const resolvedError = error instanceof Error ? error : null;
|
|
183
|
+
const stackSource = resolvedError?.stack ?? (typeof error === 'string' ? error : '');
|
|
184
|
+
const cause = resolvedError && 'cause' in resolvedError ? resolvedError.cause : null;
|
|
185
|
+
const report = {
|
|
186
|
+
id: input.id ?? this.createId('crash'),
|
|
187
|
+
message: sanitizeText(input.message ?? resolvedError?.message ?? String(error), 500),
|
|
188
|
+
scope: normalizeNullableText(input.scope, 160),
|
|
189
|
+
timestamp: input.timestamp ?? new Date().toISOString(),
|
|
190
|
+
stackFrames: stackSource
|
|
191
|
+
.split('\n')
|
|
192
|
+
.map((frame) => sanitizeText(frame.trim(), 500))
|
|
193
|
+
.filter(Boolean)
|
|
194
|
+
.slice(0, 24),
|
|
195
|
+
cause: cause instanceof Error ? sanitizeText(cause.message, 500) : null,
|
|
196
|
+
payload: input.payload === undefined ? undefined : sanitizeJson(input.payload)
|
|
197
|
+
};
|
|
198
|
+
this.crashReports = prependRing(this.crashReports, report, this.maxEntries);
|
|
199
|
+
this.recordTrace({
|
|
200
|
+
id: report.id,
|
|
201
|
+
type: 'crash',
|
|
202
|
+
level: 'error',
|
|
203
|
+
scope: report.scope,
|
|
204
|
+
label: 'crash report',
|
|
205
|
+
message: report.message,
|
|
206
|
+
timestamp: report.timestamp,
|
|
207
|
+
payload: {
|
|
208
|
+
cause: report.cause,
|
|
209
|
+
frames: report.stackFrames,
|
|
210
|
+
context: report.payload
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return report;
|
|
214
|
+
}
|
|
215
|
+
createId(prefix) {
|
|
216
|
+
this.sequence += 1;
|
|
217
|
+
return `${prefix}:${this.sequence}`;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
function prependRing(items, item, maxEntries) {
|
|
221
|
+
return [item, ...items].slice(0, maxEntries);
|
|
222
|
+
}
|
|
223
|
+
function normalizeStatus(status) {
|
|
224
|
+
return status === 'active' || status === 'idle' || status === 'degraded' || status === 'error' || status === 'unknown'
|
|
225
|
+
? status
|
|
226
|
+
: 'unknown';
|
|
227
|
+
}
|
|
228
|
+
function normalizeFiniteNumber(value) {
|
|
229
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : null;
|
|
230
|
+
}
|
|
231
|
+
function normalizeNullableText(value, maxLength) {
|
|
232
|
+
return typeof value === 'string' ? sanitizeText(value, maxLength) : null;
|
|
233
|
+
}
|
|
234
|
+
function sanitizeText(value, maxLength = 2000) {
|
|
235
|
+
return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}...`;
|
|
236
|
+
}
|
|
237
|
+
function sanitizeJson(value, depth = 0) {
|
|
238
|
+
if (value === null || typeof value === 'boolean') {
|
|
239
|
+
return value;
|
|
240
|
+
}
|
|
241
|
+
if (typeof value === 'string') {
|
|
242
|
+
return sanitizeText(value);
|
|
243
|
+
}
|
|
244
|
+
if (typeof value === 'number') {
|
|
245
|
+
return Number.isFinite(value) ? value : null;
|
|
246
|
+
}
|
|
247
|
+
if (Array.isArray(value)) {
|
|
248
|
+
if (depth >= 4) {
|
|
249
|
+
return `[Array(${value.length})]`;
|
|
250
|
+
}
|
|
251
|
+
return value.slice(0, 50).map((entry) => sanitizeJson(entry, depth + 1));
|
|
252
|
+
}
|
|
253
|
+
if (value && typeof value === 'object') {
|
|
254
|
+
if (depth >= 4) {
|
|
255
|
+
return '[Object]';
|
|
256
|
+
}
|
|
257
|
+
return Object.fromEntries(Object.entries(value)
|
|
258
|
+
.slice(0, 50)
|
|
259
|
+
.map(([key, entry]) => [sanitizeText(key, 120), sanitizeJson(entry, depth + 1)]));
|
|
260
|
+
}
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeObservationEvent, WorkbenchRuntimeProjectionCatalogEntry, WorkbenchRuntimeSharedStateEntry } from "../../domain/runtime/model.js";
|
|
2
|
+
export interface RuntimeObservationEventReducerInput {
|
|
3
|
+
projectionCatalog: WorkbenchRuntimeProjectionCatalogEntry[];
|
|
4
|
+
sharedState: WorkbenchRuntimeSharedStateEntry[];
|
|
5
|
+
events: WorkbenchRuntimeObservationEvent[];
|
|
6
|
+
event: WorkbenchRuntimeObservationEvent;
|
|
7
|
+
maxEvents: number;
|
|
8
|
+
}
|
|
9
|
+
export interface RuntimeObservationEventReducerPatch {
|
|
10
|
+
projectionCatalog: WorkbenchRuntimeProjectionCatalogEntry[];
|
|
11
|
+
sharedState: WorkbenchRuntimeSharedStateEntry[];
|
|
12
|
+
events: WorkbenchRuntimeObservationEvent[];
|
|
13
|
+
}
|
|
14
|
+
export declare function appendRuntimeObservationEvent(events: WorkbenchRuntimeObservationEvent[], event: WorkbenchRuntimeObservationEvent, maxEvents: number): WorkbenchRuntimeObservationEvent[];
|
|
15
|
+
export declare function applyRuntimeObservationEvent(input: RuntimeObservationEventReducerInput): RuntimeObservationEventReducerPatch;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { normalizeProjectionCatalogFromEvent } from "./RuntimeProjectionCatalog.js";
|
|
2
|
+
import { upsertSharedStateEntryFromEvent } from "./RuntimeSharedState.js";
|
|
3
|
+
export function appendRuntimeObservationEvent(events, event, maxEvents) {
|
|
4
|
+
return [event, ...events].slice(0, maxEvents);
|
|
5
|
+
}
|
|
6
|
+
export function applyRuntimeObservationEvent(input) {
|
|
7
|
+
const projectionCatalog = input.event.type === 'projection.catalog'
|
|
8
|
+
? normalizeProjectionCatalogFromEvent(input.event.payload, input.projectionCatalog)
|
|
9
|
+
: input.projectionCatalog;
|
|
10
|
+
const sharedState = input.event.type === 'shared-state.updated'
|
|
11
|
+
? upsertSharedStateEntryFromEvent(input.sharedState, input.event.payload)
|
|
12
|
+
: input.sharedState;
|
|
13
|
+
return {
|
|
14
|
+
projectionCatalog,
|
|
15
|
+
sharedState,
|
|
16
|
+
events: appendRuntimeObservationEvent(input.events, input.event, input.maxEvents)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type RuntimeOffloadEvent, type RuntimeOffloadSnapshot, type RuntimeOffloadTask, type RuntimeOffloadTaskInput } from "../../domain/runtime/offload.js";
|
|
2
|
+
export interface RuntimeOffloadManagerOptions {
|
|
3
|
+
maxConcurrentTasks?: number;
|
|
4
|
+
now?: () => string;
|
|
5
|
+
onEvent?: (event: RuntimeOffloadEvent) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class RuntimeOffloadManager {
|
|
8
|
+
private readonly maxConcurrentTasks;
|
|
9
|
+
private readonly now;
|
|
10
|
+
private readonly onEvent;
|
|
11
|
+
private tasks;
|
|
12
|
+
private sequence;
|
|
13
|
+
constructor(options?: RuntimeOffloadManagerOptions);
|
|
14
|
+
enqueue(input: RuntimeOffloadTaskInput): RuntimeOffloadTask;
|
|
15
|
+
startNext(): RuntimeOffloadTask | null;
|
|
16
|
+
updateProgress(taskId: string, progress: number): RuntimeOffloadTask | null;
|
|
17
|
+
complete(taskId: string, result?: unknown): RuntimeOffloadTask | null;
|
|
18
|
+
fail(taskId: string, error: string): RuntimeOffloadTask | null;
|
|
19
|
+
cancel(taskId: string): RuntimeOffloadTask | null;
|
|
20
|
+
createSnapshot(timestamp?: string): RuntimeOffloadSnapshot;
|
|
21
|
+
private findTask;
|
|
22
|
+
private replaceTask;
|
|
23
|
+
private emit;
|
|
24
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { cancelRuntimeOffloadTask, completeRuntimeOffloadTask, createRuntimeOffloadSnapshot, createRuntimeOffloadTask, failRuntimeOffloadTask, startRuntimeOffloadTask, updateRuntimeOffloadTaskProgress } from "../../domain/runtime/offload.js";
|
|
2
|
+
export class RuntimeOffloadManager {
|
|
3
|
+
maxConcurrentTasks;
|
|
4
|
+
now;
|
|
5
|
+
onEvent;
|
|
6
|
+
tasks = [];
|
|
7
|
+
sequence = 0;
|
|
8
|
+
constructor(options = {}) {
|
|
9
|
+
this.maxConcurrentTasks = Math.max(1, Math.floor(options.maxConcurrentTasks ?? 1));
|
|
10
|
+
this.now = options.now ?? (() => new Date().toISOString());
|
|
11
|
+
this.onEvent = options.onEvent ?? null;
|
|
12
|
+
}
|
|
13
|
+
enqueue(input) {
|
|
14
|
+
const task = createRuntimeOffloadTask(input, this.now());
|
|
15
|
+
this.tasks = [...this.tasks, task];
|
|
16
|
+
this.emit(task, 'queued', `${task.label} queued`);
|
|
17
|
+
return task;
|
|
18
|
+
}
|
|
19
|
+
startNext() {
|
|
20
|
+
const runningCount = this.tasks.filter((task) => task.status === 'running').length;
|
|
21
|
+
if (runningCount >= this.maxConcurrentTasks) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
const nextTask = createRuntimeOffloadSnapshot(this.tasks, this.now()).tasks.find((task) => task.status === 'queued') ?? null;
|
|
25
|
+
if (!nextTask) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
const startedTask = startRuntimeOffloadTask(nextTask, this.now());
|
|
29
|
+
this.replaceTask(startedTask);
|
|
30
|
+
this.emit(startedTask, 'started', `${startedTask.label} started`);
|
|
31
|
+
return startedTask;
|
|
32
|
+
}
|
|
33
|
+
updateProgress(taskId, progress) {
|
|
34
|
+
const task = this.findTask(taskId);
|
|
35
|
+
if (!task) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
const updatedTask = updateRuntimeOffloadTaskProgress(task, progress, this.now());
|
|
39
|
+
this.replaceTask(updatedTask);
|
|
40
|
+
this.emit(updatedTask, 'progress', `${updatedTask.label} ${updatedTask.progress}%`);
|
|
41
|
+
return updatedTask;
|
|
42
|
+
}
|
|
43
|
+
complete(taskId, result) {
|
|
44
|
+
const task = this.findTask(taskId);
|
|
45
|
+
if (!task) {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
const completedTask = completeRuntimeOffloadTask(task, result, this.now());
|
|
49
|
+
this.replaceTask(completedTask);
|
|
50
|
+
this.emit(completedTask, 'completed', `${completedTask.label} completed`);
|
|
51
|
+
this.startNext();
|
|
52
|
+
return completedTask;
|
|
53
|
+
}
|
|
54
|
+
fail(taskId, error) {
|
|
55
|
+
const task = this.findTask(taskId);
|
|
56
|
+
if (!task) {
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const failedTask = failRuntimeOffloadTask(task, error, this.now());
|
|
60
|
+
this.replaceTask(failedTask);
|
|
61
|
+
this.emit(failedTask, 'failed', error);
|
|
62
|
+
this.startNext();
|
|
63
|
+
return failedTask;
|
|
64
|
+
}
|
|
65
|
+
cancel(taskId) {
|
|
66
|
+
const task = this.findTask(taskId);
|
|
67
|
+
if (!task) {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
const cancelledTask = cancelRuntimeOffloadTask(task, this.now());
|
|
71
|
+
this.replaceTask(cancelledTask);
|
|
72
|
+
this.emit(cancelledTask, 'cancelled', `${cancelledTask.label} cancelled`);
|
|
73
|
+
this.startNext();
|
|
74
|
+
return cancelledTask;
|
|
75
|
+
}
|
|
76
|
+
createSnapshot(timestamp = this.now()) {
|
|
77
|
+
return createRuntimeOffloadSnapshot(this.tasks, timestamp);
|
|
78
|
+
}
|
|
79
|
+
findTask(taskId) {
|
|
80
|
+
return this.tasks.find((task) => task.id === taskId) ?? null;
|
|
81
|
+
}
|
|
82
|
+
replaceTask(task) {
|
|
83
|
+
this.tasks = this.tasks.map((candidate) => candidate.id === task.id ? task : candidate);
|
|
84
|
+
}
|
|
85
|
+
emit(task, kind, message) {
|
|
86
|
+
this.sequence += 1;
|
|
87
|
+
this.onEvent?.({
|
|
88
|
+
id: `offload-event:${this.sequence}`,
|
|
89
|
+
taskId: task.id,
|
|
90
|
+
kind,
|
|
91
|
+
timestamp: this.now(),
|
|
92
|
+
message,
|
|
93
|
+
progress: task.progress
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { LaunchPreflightSummary, LaunchTarget } from "../../domain/launch/model.js";
|
|
2
|
+
import type { RuntimePlan } from "../../domain/runtime/plan.js";
|
|
3
|
+
export interface CreateRuntimePlanInput {
|
|
4
|
+
target: LaunchTarget;
|
|
5
|
+
preflight?: LaunchPreflightSummary | null;
|
|
6
|
+
dryRun?: boolean;
|
|
7
|
+
now?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class RuntimePlanEngine {
|
|
10
|
+
createPlan(input: CreateRuntimePlanInput): RuntimePlan;
|
|
11
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export class RuntimePlanEngine {
|
|
2
|
+
createPlan(input) {
|
|
3
|
+
const timestamp = input.now ?? new Date().toISOString();
|
|
4
|
+
const blockedChecks = (input.preflight?.checks ?? []).filter((check) => check.status === 'blocked');
|
|
5
|
+
const warningChecks = (input.preflight?.checks ?? []).filter((check) => check.status === 'warning');
|
|
6
|
+
const steps = createStepsForTarget(input.target, blockedChecks);
|
|
7
|
+
return {
|
|
8
|
+
id: `runtime-plan:${input.target.kind}:${input.target.profile}:${timestamp}`,
|
|
9
|
+
target: input.target,
|
|
10
|
+
profile: input.target.profile,
|
|
11
|
+
createdAt: timestamp,
|
|
12
|
+
dryRun: input.dryRun ?? false,
|
|
13
|
+
canExecute: blockedChecks.length === 0 && steps.every((step) => step.status !== 'blocked'),
|
|
14
|
+
steps,
|
|
15
|
+
warnings: createWarnings([...blockedChecks, ...warningChecks]),
|
|
16
|
+
preflight: input.preflight ?? null
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createStepsForTarget(target, blockedChecks) {
|
|
21
|
+
const hasBlockedPreflight = blockedChecks.length > 0;
|
|
22
|
+
const baseSteps = [
|
|
23
|
+
createStep('runtime.observability', 'observability-hook', 'Attach observability hooks', !hasBlockedPreflight),
|
|
24
|
+
createStep('runtime.teardown', 'teardown-hook', 'Register teardown hooks', !hasBlockedPreflight),
|
|
25
|
+
createStep('runtime.rollback', 'rollback-hook', 'Register rollback hooks', !hasBlockedPreflight)
|
|
26
|
+
];
|
|
27
|
+
if (target.kind === 'self' || target.profile === 'core-only' || target.profile === 'recovery-mode') {
|
|
28
|
+
return [
|
|
29
|
+
...baseSteps,
|
|
30
|
+
createStep('tool.runtime-inspector', 'register-tool', 'Register Runtime Inspector', !hasBlockedPreflight),
|
|
31
|
+
createStep('manager.core-observability', 'initialize-manager', 'Initialize core observability manager', !hasBlockedPreflight)
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
if (target.profile === 'repo-inspect-only') {
|
|
35
|
+
return [
|
|
36
|
+
...baseSteps,
|
|
37
|
+
createStep('service.repo-inspection', 'start-service', 'Start repository inspection service', !hasBlockedPreflight),
|
|
38
|
+
createStep('worker.repo-index', 'launch-worker', 'Launch repository indexing worker', !hasBlockedPreflight),
|
|
39
|
+
createStep('tool.runtime-inspector', 'register-tool', 'Register Runtime Inspector', !hasBlockedPreflight)
|
|
40
|
+
];
|
|
41
|
+
}
|
|
42
|
+
return [
|
|
43
|
+
...baseSteps,
|
|
44
|
+
createStep('store.workspace', 'mount-store', 'Mount workspace stores', !hasBlockedPreflight),
|
|
45
|
+
createStep('service.runtime-api', 'start-service', 'Start runtime API services', !hasBlockedPreflight),
|
|
46
|
+
createStep('manager.workspace', 'initialize-manager', 'Initialize workspace managers', !hasBlockedPreflight),
|
|
47
|
+
createStep('tool.registry', 'register-tool', 'Register workspace tools', !hasBlockedPreflight),
|
|
48
|
+
createStep('watcher.workspace', 'activate-watcher', 'Activate workspace watchers', !hasBlockedPreflight),
|
|
49
|
+
createStep('worker.background', 'launch-worker', 'Launch background workers', !hasBlockedPreflight)
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
function createStep(id, kind, label, enabled) {
|
|
53
|
+
return {
|
|
54
|
+
id,
|
|
55
|
+
kind,
|
|
56
|
+
label,
|
|
57
|
+
status: enabled ? 'planned' : 'blocked',
|
|
58
|
+
critical: kind !== 'activate-watcher' && kind !== 'launch-worker',
|
|
59
|
+
reason: enabled ? null : 'Blocked by preflight.'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function createWarnings(checks) {
|
|
63
|
+
return checks.map((check) => ({
|
|
64
|
+
id: check.id,
|
|
65
|
+
message: `${check.label}: ${check.message}`
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { WorkbenchRuntimeProjectionCatalogEntry, WorkbenchRuntimeSnapshot } from "../../domain/runtime/model.js";
|
|
2
|
+
export declare function normalizeProjectionCatalogFromWorkspace(workspace: WorkbenchRuntimeSnapshot['workspace']): WorkbenchRuntimeProjectionCatalogEntry[];
|
|
3
|
+
export declare function normalizeProjectionCatalogFromEvent(payload: unknown, fallback: WorkbenchRuntimeProjectionCatalogEntry[]): WorkbenchRuntimeProjectionCatalogEntry[];
|
|
4
|
+
export declare function normalizeProjectionCatalogEntry(value: unknown): WorkbenchRuntimeProjectionCatalogEntry | null;
|
|
5
|
+
export declare function compareProjectionCatalogEntries(left: WorkbenchRuntimeProjectionCatalogEntry, right: WorkbenchRuntimeProjectionCatalogEntry): number;
|