@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.
Files changed (373) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +54 -0
  3. package/dist/application/boot/applicationBoot.d.ts +48 -0
  4. package/dist/application/boot/applicationBoot.js +174 -0
  5. package/dist/application/experiment/ControlledExperimentCampaign.d.ts +12 -0
  6. package/dist/application/experiment/ControlledExperimentCampaign.js +159 -0
  7. package/dist/application/experiment/ControlledExperimentRecorder.d.ts +17 -0
  8. package/dist/application/experiment/ControlledExperimentRecorder.js +215 -0
  9. package/dist/application/i18n/WorkbenchTranslationRegistry.d.ts +19 -0
  10. package/dist/application/i18n/WorkbenchTranslationRegistry.js +179 -0
  11. package/dist/application/layout/surfaceCommandRouter.d.ts +18 -0
  12. package/dist/application/layout/surfaceCommandRouter.js +247 -0
  13. package/dist/application/physics/NoopPhysicsBackend.d.ts +2 -0
  14. package/dist/application/physics/NoopPhysicsBackend.js +2 -0
  15. package/dist/application/physics/PhysicsService.d.ts +2 -0
  16. package/dist/application/physics/PhysicsService.js +2 -0
  17. package/dist/application/project/ProjectManifest.d.ts +15 -0
  18. package/dist/application/project/ProjectManifest.js +107 -0
  19. package/dist/application/repository/RepositoryPreflightEngine.d.ts +6 -0
  20. package/dist/application/repository/RepositoryPreflightEngine.js +301 -0
  21. package/dist/application/runtime/RuntimeBackendConnection.d.ts +9 -0
  22. package/dist/application/runtime/RuntimeBackendConnection.js +34 -0
  23. package/dist/application/runtime/RuntimeBackendSubscription.d.ts +8 -0
  24. package/dist/application/runtime/RuntimeBackendSubscription.js +52 -0
  25. package/dist/application/runtime/RuntimeCheckpointStore.d.ts +20 -0
  26. package/dist/application/runtime/RuntimeCheckpointStore.js +65 -0
  27. package/dist/application/runtime/RuntimeLaunchProgress.d.ts +3 -0
  28. package/dist/application/runtime/RuntimeLaunchProgress.js +38 -0
  29. package/dist/application/runtime/RuntimeLaunchStateSnapshot.d.ts +48 -0
  30. package/dist/application/runtime/RuntimeLaunchStateSnapshot.js +73 -0
  31. package/dist/application/runtime/RuntimeObservabilityHub.d.ts +28 -0
  32. package/dist/application/runtime/RuntimeObservabilityHub.js +262 -0
  33. package/dist/application/runtime/RuntimeObservationEvents.d.ts +15 -0
  34. package/dist/application/runtime/RuntimeObservationEvents.js +18 -0
  35. package/dist/application/runtime/RuntimeOffloadManager.d.ts +24 -0
  36. package/dist/application/runtime/RuntimeOffloadManager.js +96 -0
  37. package/dist/application/runtime/RuntimePlanEngine.d.ts +11 -0
  38. package/dist/application/runtime/RuntimePlanEngine.js +67 -0
  39. package/dist/application/runtime/RuntimeProjectionCatalog.d.ts +5 -0
  40. package/dist/application/runtime/RuntimeProjectionCatalog.js +48 -0
  41. package/dist/application/runtime/RuntimeProjectionSession.d.ts +5 -0
  42. package/dist/application/runtime/RuntimeProjectionSession.js +4 -0
  43. package/dist/application/runtime/RuntimeProjectionSessionKeys.d.ts +5 -0
  44. package/dist/application/runtime/RuntimeProjectionSessionKeys.js +10 -0
  45. package/dist/application/runtime/RuntimeProjectionSessionReducers.d.ts +7 -0
  46. package/dist/application/runtime/RuntimeProjectionSessionReducers.js +101 -0
  47. package/dist/application/runtime/RuntimeProjectionSessionSerialization.d.ts +5 -0
  48. package/dist/application/runtime/RuntimeProjectionSessionSerialization.js +89 -0
  49. package/dist/application/runtime/RuntimeProjectionSessionSharedState.d.ts +3 -0
  50. package/dist/application/runtime/RuntimeProjectionSessionSharedState.js +53 -0
  51. package/dist/application/runtime/RuntimeProjectionSessionTypes.d.ts +38 -0
  52. package/dist/application/runtime/RuntimeProjectionSessionTypes.js +1 -0
  53. package/dist/application/runtime/RuntimeProjectionViewerSessionSync.d.ts +29 -0
  54. package/dist/application/runtime/RuntimeProjectionViewerSessionSync.js +39 -0
  55. package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.d.ts +27 -0
  56. package/dist/application/runtime/RuntimeProjectionViewerSessionUpdates.js +38 -0
  57. package/dist/application/runtime/RuntimeRegistryOwner.d.ts +20 -0
  58. package/dist/application/runtime/RuntimeRegistryOwner.js +71 -0
  59. package/dist/application/runtime/RuntimeRegistrySnapshots.d.ts +6 -0
  60. package/dist/application/runtime/RuntimeRegistrySnapshots.js +51 -0
  61. package/dist/application/runtime/RuntimeRegistryTypes.d.ts +29 -0
  62. package/dist/application/runtime/RuntimeRegistryTypes.js +1 -0
  63. package/dist/application/runtime/RuntimeSharedState.d.ts +6 -0
  64. package/dist/application/runtime/RuntimeSharedState.js +47 -0
  65. package/dist/application/runtime/WorkbenchRuntimeCore.d.ts +82 -0
  66. package/dist/application/runtime/WorkbenchRuntimeCore.js +463 -0
  67. package/dist/application/runtime/WorkbenchRuntimeSanitizers.d.ts +9 -0
  68. package/dist/application/runtime/WorkbenchRuntimeSanitizers.js +62 -0
  69. package/dist/application/shell/state.d.ts +22 -0
  70. package/dist/application/shell/state.js +308 -0
  71. package/dist/application/widgets/createWorkbenchWidgetAdapter.d.ts +9 -0
  72. package/dist/application/widgets/createWorkbenchWidgetAdapter.js +30 -0
  73. package/dist/application/workspace/canonicalizeLayout.d.ts +2 -0
  74. package/dist/application/workspace/canonicalizeLayout.js +91 -0
  75. package/dist/application/workspace/closePanel.d.ts +6 -0
  76. package/dist/application/workspace/closePanel.js +43 -0
  77. package/dist/application/workspace/collapseSplit.d.ts +7 -0
  78. package/dist/application/workspace/collapseSplit.js +45 -0
  79. package/dist/application/workspace/collapseSplitBoundary.d.ts +8 -0
  80. package/dist/application/workspace/collapseSplitBoundary.js +106 -0
  81. package/dist/application/workspace/commands.d.ts +71 -0
  82. package/dist/application/workspace/commands.js +216 -0
  83. package/dist/application/workspace/createPeripheralBands.d.ts +14 -0
  84. package/dist/application/workspace/createPeripheralBands.js +62 -0
  85. package/dist/application/workspace/createWorkspace.d.ts +7 -0
  86. package/dist/application/workspace/createWorkspace.js +12 -0
  87. package/dist/application/workspace/detachPanelToWindow.d.ts +12 -0
  88. package/dist/application/workspace/detachPanelToWindow.js +57 -0
  89. package/dist/application/workspace/dockPanel.d.ts +10 -0
  90. package/dist/application/workspace/dockPanel.js +399 -0
  91. package/dist/application/workspace/finalizeWorkspace.d.ts +4 -0
  92. package/dist/application/workspace/finalizeWorkspace.js +23 -0
  93. package/dist/application/workspace/focusPanel.d.ts +2 -0
  94. package/dist/application/workspace/focusPanel.js +19 -0
  95. package/dist/application/workspace/joinPanelArea.d.ts +13 -0
  96. package/dist/application/workspace/joinPanelArea.js +281 -0
  97. package/dist/application/workspace/layoutInteraction.d.ts +176 -0
  98. package/dist/application/workspace/layoutInteraction.js +852 -0
  99. package/dist/application/workspace/layoutTree.d.ts +34 -0
  100. package/dist/application/workspace/layoutTree.js +135 -0
  101. package/dist/application/workspace/openTool.d.ts +15 -0
  102. package/dist/application/workspace/openTool.js +89 -0
  103. package/dist/application/workspace/presetArtifacts.d.ts +60 -0
  104. package/dist/application/workspace/presetArtifacts.js +231 -0
  105. package/dist/application/workspace/presets.d.ts +5 -0
  106. package/dist/application/workspace/presets.js +12 -0
  107. package/dist/application/workspace/reattachWorkspaceWindow.d.ts +7 -0
  108. package/dist/application/workspace/reattachWorkspaceWindow.js +24 -0
  109. package/dist/application/workspace/resizeSplit.d.ts +7 -0
  110. package/dist/application/workspace/resizeSplit.js +12 -0
  111. package/dist/application/workspace/resizeSplitBoundary.d.ts +10 -0
  112. package/dist/application/workspace/resizeSplitBoundary.js +115 -0
  113. package/dist/application/workspace/runToolShellCommand.d.ts +11 -0
  114. package/dist/application/workspace/runToolShellCommand.js +133 -0
  115. package/dist/application/workspace/session.d.ts +9 -0
  116. package/dist/application/workspace/session.js +36 -0
  117. package/dist/application/workspace/setActiveStackChild.d.ts +7 -0
  118. package/dist/application/workspace/setActiveStackChild.js +12 -0
  119. package/dist/application/workspace/setDesignSystemThemeSession.d.ts +3 -0
  120. package/dist/application/workspace/setDesignSystemThemeSession.js +12 -0
  121. package/dist/application/workspace/setPanelFullscreenToggleVisibility.d.ts +7 -0
  122. package/dist/application/workspace/setPanelFullscreenToggleVisibility.js +7 -0
  123. package/dist/application/workspace/setStackHeaderVisibility.d.ts +7 -0
  124. package/dist/application/workspace/setStackHeaderVisibility.js +7 -0
  125. package/dist/application/workspace/setToolPanelTitleOverride.d.ts +9 -0
  126. package/dist/application/workspace/setToolPanelTitleOverride.js +33 -0
  127. package/dist/application/workspace/setToolShellStatus.d.ts +8 -0
  128. package/dist/application/workspace/setToolShellStatus.js +32 -0
  129. package/dist/application/workspace/setWorkspaceFullscreenPanel.d.ts +3 -0
  130. package/dist/application/workspace/setWorkspaceFullscreenPanel.js +26 -0
  131. package/dist/application/workspace/snapshots.d.ts +10 -0
  132. package/dist/application/workspace/snapshots.js +34 -0
  133. package/dist/application/workspace/splitPanel.d.ts +10 -0
  134. package/dist/application/workspace/splitPanel.js +21 -0
  135. package/dist/application/workspace/subdividePanel.d.ts +39 -0
  136. package/dist/application/workspace/subdividePanel.js +128 -0
  137. package/dist/application/workspace/swapPanelArea.d.ts +11 -0
  138. package/dist/application/workspace/swapPanelArea.js +163 -0
  139. package/dist/application/workspace/targetWindow.d.ts +4 -0
  140. package/dist/application/workspace/targetWindow.js +22 -0
  141. package/dist/application/workspace/toolCapabilities.d.ts +11 -0
  142. package/dist/application/workspace/toolCapabilities.js +59 -0
  143. package/dist/application/workspace/toolRuntime.d.ts +32 -0
  144. package/dist/application/workspace/toolRuntime.js +65 -0
  145. package/dist/application/workspace/updateToolState.d.ts +8 -0
  146. package/dist/application/workspace/updateToolState.js +20 -0
  147. package/dist/boot/applicationBoot.d.ts +1 -0
  148. package/dist/boot/applicationBoot.js +2 -0
  149. package/dist/boot/events.d.ts +43 -0
  150. package/dist/boot/events.js +16 -0
  151. package/dist/boot/executor.d.ts +13 -0
  152. package/dist/boot/executor.js +210 -0
  153. package/dist/boot/graph.d.ts +16 -0
  154. package/dist/boot/graph.js +126 -0
  155. package/dist/boot/index.d.ts +2 -0
  156. package/dist/boot/index.js +3 -0
  157. package/dist/boot/mechanism.d.ts +5 -0
  158. package/dist/boot/mechanism.js +6 -0
  159. package/dist/boot/projection.d.ts +72 -0
  160. package/dist/boot/projection.js +398 -0
  161. package/dist/boot/types.d.ts +80 -0
  162. package/dist/boot/types.js +46 -0
  163. package/dist/domain/composition/dockArrangement.d.ts +57 -0
  164. package/dist/domain/composition/dockArrangement.js +304 -0
  165. package/dist/domain/composition/docking.d.ts +68 -0
  166. package/dist/domain/composition/docking.js +187 -0
  167. package/dist/domain/design-system/themeSession.d.ts +12 -0
  168. package/dist/domain/design-system/themeSession.js +42 -0
  169. package/dist/domain/experiment/model.d.ts +149 -0
  170. package/dist/domain/experiment/model.js +1 -0
  171. package/dist/domain/i18n/languageRegistry.d.ts +57 -0
  172. package/dist/domain/i18n/languageRegistry.js +1 -0
  173. package/dist/domain/i18n/model.d.ts +31 -0
  174. package/dist/domain/i18n/model.js +1 -0
  175. package/dist/domain/icon/model.d.ts +8 -0
  176. package/dist/domain/icon/model.js +1 -0
  177. package/dist/domain/input/interactionBindings.d.ts +2 -0
  178. package/dist/domain/input/interactionBindings.js +2 -0
  179. package/dist/domain/launch/model.d.ts +58 -0
  180. package/dist/domain/launch/model.js +109 -0
  181. package/dist/domain/layout/interaction.d.ts +90 -0
  182. package/dist/domain/layout/interaction.js +1 -0
  183. package/dist/domain/layout/model.d.ts +28 -0
  184. package/dist/domain/layout/model.js +1 -0
  185. package/dist/domain/layout/selectors.d.ts +12 -0
  186. package/dist/domain/layout/selectors.js +84 -0
  187. package/dist/domain/layout/surfaceProjection.d.ts +56 -0
  188. package/dist/domain/layout/surfaceProjection.js +249 -0
  189. package/dist/domain/layout/validation.d.ts +9 -0
  190. package/dist/domain/layout/validation.js +71 -0
  191. package/dist/domain/panel/model.d.ts +9 -0
  192. package/dist/domain/panel/model.js +1 -0
  193. package/dist/domain/physics/colliderGeometry.d.ts +2 -0
  194. package/dist/domain/physics/colliderGeometry.js +1 -0
  195. package/dist/domain/physics/contracts.d.ts +2 -0
  196. package/dist/domain/physics/contracts.js +1 -0
  197. package/dist/domain/physics/kinematicBinding.d.ts +22 -0
  198. package/dist/domain/physics/kinematicBinding.js +1 -0
  199. package/dist/domain/physics/model.d.ts +4 -0
  200. package/dist/domain/physics/model.js +1 -0
  201. package/dist/domain/physics/mujoco.d.ts +5 -0
  202. package/dist/domain/physics/mujoco.js +1 -0
  203. package/dist/domain/physics/observationProfile.d.ts +2 -0
  204. package/dist/domain/physics/observationProfile.js +1 -0
  205. package/dist/domain/physics/presentationBinding.d.ts +6 -0
  206. package/dist/domain/physics/presentationBinding.js +1 -0
  207. package/dist/domain/physics/simulationProfile.d.ts +2 -0
  208. package/dist/domain/physics/simulationProfile.js +1 -0
  209. package/dist/domain/physics/visualAlignment.d.ts +17 -0
  210. package/dist/domain/physics/visualAlignment.js +1 -0
  211. package/dist/domain/presentation/readingLevel.d.ts +12 -0
  212. package/dist/domain/presentation/readingLevel.js +29 -0
  213. package/dist/domain/project/model.d.ts +55 -0
  214. package/dist/domain/project/model.js +1 -0
  215. package/dist/domain/repo-quality/model.d.ts +111 -0
  216. package/dist/domain/repo-quality/model.js +1 -0
  217. package/dist/domain/repository/model.d.ts +110 -0
  218. package/dist/domain/repository/model.js +1 -0
  219. package/dist/domain/runtime/checkpoint.d.ts +37 -0
  220. package/dist/domain/runtime/checkpoint.js +87 -0
  221. package/dist/domain/runtime/hydration.d.ts +26 -0
  222. package/dist/domain/runtime/hydration.js +92 -0
  223. package/dist/domain/runtime/initialization.d.ts +25 -0
  224. package/dist/domain/runtime/initialization.js +87 -0
  225. package/dist/domain/runtime/lifecycle.d.ts +51 -0
  226. package/dist/domain/runtime/lifecycle.js +118 -0
  227. package/dist/domain/runtime/model.d.ts +252 -0
  228. package/dist/domain/runtime/model.js +13 -0
  229. package/dist/domain/runtime/observability.d.ts +142 -0
  230. package/dist/domain/runtime/observability.js +1 -0
  231. package/dist/domain/runtime/offload.d.ts +56 -0
  232. package/dist/domain/runtime/offload.js +129 -0
  233. package/dist/domain/runtime/plan.d.ts +26 -0
  234. package/dist/domain/runtime/plan.js +1 -0
  235. package/dist/domain/runtime/qualityPolicy.d.ts +28 -0
  236. package/dist/domain/runtime/qualityPolicy.js +97 -0
  237. package/dist/domain/runtime/recovery.d.ts +61 -0
  238. package/dist/domain/runtime/recovery.js +129 -0
  239. package/dist/domain/runtime/suspension.d.ts +32 -0
  240. package/dist/domain/runtime/suspension.js +107 -0
  241. package/dist/domain/runtime/teardown.d.ts +33 -0
  242. package/dist/domain/runtime/teardown.js +109 -0
  243. package/dist/domain/shared/id.d.ts +1 -0
  244. package/dist/domain/shared/id.js +5 -0
  245. package/dist/domain/shared/json.d.ts +9 -0
  246. package/dist/domain/shared/json.js +24 -0
  247. package/dist/domain/shell/model.d.ts +40 -0
  248. package/dist/domain/shell/model.js +1 -0
  249. package/dist/domain/shell/runtime.d.ts +76 -0
  250. package/dist/domain/shell/runtime.js +40 -0
  251. package/dist/domain/surface/model.d.ts +97 -0
  252. package/dist/domain/surface/model.js +71 -0
  253. package/dist/domain/temporal/model.d.ts +95 -0
  254. package/dist/domain/temporal/model.js +45 -0
  255. package/dist/domain/tool/internalTab.d.ts +11 -0
  256. package/dist/domain/tool/internalTab.js +20 -0
  257. package/dist/domain/tool/model.d.ts +207 -0
  258. package/dist/domain/tool/model.js +1 -0
  259. package/dist/domain/tool/runtime.d.ts +122 -0
  260. package/dist/domain/tool/runtime.js +2 -0
  261. package/dist/domain/tool/shell.d.ts +38 -0
  262. package/dist/domain/tool/shell.js +175 -0
  263. package/dist/domain/widget/composition.d.ts +79 -0
  264. package/dist/domain/widget/composition.js +250 -0
  265. package/dist/domain/widget/model.d.ts +35 -0
  266. package/dist/domain/widget/model.js +8 -0
  267. package/dist/domain/widget/toolDock.d.ts +30 -0
  268. package/dist/domain/widget/toolDock.js +52 -0
  269. package/dist/domain/workbench/model.d.ts +35 -0
  270. package/dist/domain/workbench/model.js +1 -0
  271. package/dist/domain/workbench/routing.d.ts +17 -0
  272. package/dist/domain/workbench/routing.js +72 -0
  273. package/dist/domain/workspace/factories.d.ts +9 -0
  274. package/dist/domain/workspace/factories.js +47 -0
  275. package/dist/domain/workspace/model.d.ts +23 -0
  276. package/dist/domain/workspace/model.js +1 -0
  277. package/dist/domain/workspace/persistence.d.ts +5 -0
  278. package/dist/domain/workspace/persistence.js +1 -0
  279. package/dist/domain/workspace/selectors.d.ts +19 -0
  280. package/dist/domain/workspace/selectors.js +90 -0
  281. package/dist/domain/workspace/session.d.ts +9 -0
  282. package/dist/domain/workspace/session.js +1 -0
  283. package/dist/domain/workspace/validation.d.ts +10 -0
  284. package/dist/domain/workspace/validation.js +231 -0
  285. package/dist/hosting.d.ts +15 -0
  286. package/dist/hosting.js +12 -0
  287. package/dist/index.d.ts +111 -0
  288. package/dist/index.js +111 -0
  289. package/dist/infrastructure/audio/WorkbenchAudioManager.d.ts +36 -0
  290. package/dist/infrastructure/audio/WorkbenchAudioManager.js +100 -0
  291. package/dist/infrastructure/backend/HttpWorkbenchBackendClient.d.ts +30 -0
  292. package/dist/infrastructure/backend/HttpWorkbenchBackendClient.js +314 -0
  293. package/dist/infrastructure/persistence/LocalWorkspacePersistence.d.ts +8 -0
  294. package/dist/infrastructure/persistence/LocalWorkspacePersistence.js +29 -0
  295. package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.d.ts +58 -0
  296. package/dist/infrastructure/surfaces/InMemorySurfaceViewerRegistry.js +121 -0
  297. package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.d.ts +8 -0
  298. package/dist/infrastructure/temporal/InMemoryTemporalDialectRegistry.js +38 -0
  299. package/dist/infrastructure/tools/InMemoryToolRegistry.d.ts +46 -0
  300. package/dist/infrastructure/tools/InMemoryToolRegistry.js +82 -0
  301. package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.d.ts +42 -0
  302. package/dist/infrastructure/widgets/InMemoryShellWidgetRegistry.js +66 -0
  303. package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.d.ts +20 -0
  304. package/dist/infrastructure/widgets/InMemoryWorkbenchWidgetRegistry.js +35 -0
  305. package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.d.ts +7 -0
  306. package/dist/infrastructure/workbenches/InMemoryWorkbenchRegistry.js +28 -0
  307. package/dist/physics-runtime.d.ts +4 -0
  308. package/dist/physics-runtime.js +2 -0
  309. package/dist/stage/easing.d.ts +5 -0
  310. package/dist/stage/easing.js +15 -0
  311. package/dist/stage/index.d.ts +6 -0
  312. package/dist/stage/index.js +6 -0
  313. package/dist/stage/projection.d.ts +4 -0
  314. package/dist/stage/projection.js +74 -0
  315. package/dist/stage/stageRuntime.d.ts +2 -0
  316. package/dist/stage/stageRuntime.js +32 -0
  317. package/dist/stage/timeline.d.ts +3 -0
  318. package/dist/stage/timeline.js +69 -0
  319. package/dist/stage/tween.d.ts +3 -0
  320. package/dist/stage/tween.js +104 -0
  321. package/dist/stage/types.d.ts +104 -0
  322. package/dist/stage/types.js +30 -0
  323. package/dist/temporal/clock/audioClock.d.ts +1 -0
  324. package/dist/temporal/clock/audioClock.js +1 -0
  325. package/dist/temporal/clock/clockGraph.d.ts +1 -0
  326. package/dist/temporal/clock/clockGraph.js +1 -0
  327. package/dist/temporal/clock/clockTypes.d.ts +1 -0
  328. package/dist/temporal/clock/clockTypes.js +1 -0
  329. package/dist/temporal/clock/fixedStepClock.d.ts +1 -0
  330. package/dist/temporal/clock/fixedStepClock.js +1 -0
  331. package/dist/temporal/clock/musicalClock.d.ts +7 -0
  332. package/dist/temporal/clock/musicalClock.js +35 -0
  333. package/dist/temporal/clock/rootClock.d.ts +1 -0
  334. package/dist/temporal/clock/rootClock.js +1 -0
  335. package/dist/temporal/clock/videoClock.d.ts +1 -0
  336. package/dist/temporal/clock/videoClock.js +1 -0
  337. package/dist/temporal/easing/easingFunctions.d.ts +2 -0
  338. package/dist/temporal/easing/easingFunctions.js +19 -0
  339. package/dist/temporal/easing/easingRegistry.d.ts +10 -0
  340. package/dist/temporal/easing/easingRegistry.js +32 -0
  341. package/dist/temporal/easing/easingShaderSource.d.ts +2 -0
  342. package/dist/temporal/easing/easingShaderSource.js +16 -0
  343. package/dist/temporal/easing/easingTypes.d.ts +9 -0
  344. package/dist/temporal/easing/easingTypes.js +1 -0
  345. package/dist/temporal/history/runtimeHistory.d.ts +77 -0
  346. package/dist/temporal/history/runtimeHistory.js +5 -0
  347. package/dist/temporal/history/temporalHistoryCore.d.ts +1 -0
  348. package/dist/temporal/history/temporalHistoryCore.js +1 -0
  349. package/dist/temporal/index.d.ts +20 -0
  350. package/dist/temporal/index.js +20 -0
  351. package/dist/temporal/invalidation/invalidationController.d.ts +1 -0
  352. package/dist/temporal/invalidation/invalidationController.js +1 -0
  353. package/dist/temporal/scheduler/browserSchedulerHost.d.ts +3 -0
  354. package/dist/temporal/scheduler/browserSchedulerHost.js +19 -0
  355. package/dist/temporal/scheduler/frameBudget.d.ts +1 -0
  356. package/dist/temporal/scheduler/frameBudget.js +1 -0
  357. package/dist/temporal/scheduler/temporalScheduler.d.ts +4 -0
  358. package/dist/temporal/scheduler/temporalScheduler.js +6 -0
  359. package/dist/temporal/scheduler/temporalSchedulerCore.d.ts +1 -0
  360. package/dist/temporal/scheduler/temporalSchedulerCore.js +1 -0
  361. package/dist/temporal/scheduler/visibilityPolicy.d.ts +2 -0
  362. package/dist/temporal/scheduler/visibilityPolicy.js +1 -0
  363. package/dist/temporal/transport/temporalTransport.d.ts +1 -0
  364. package/dist/temporal/transport/temporalTransport.js +1 -0
  365. package/dist/temporal/transport/transportScope.d.ts +7 -0
  366. package/dist/temporal/transport/transportScope.js +3 -0
  367. package/dist/temporal/transport/transportTimeline.d.ts +22 -0
  368. package/dist/temporal/transport/transportTimeline.js +36 -0
  369. package/dist/temporal/transport/transportTypes.d.ts +1 -0
  370. package/dist/temporal/transport/transportTypes.js +1 -0
  371. package/dist/workspace-contracts.d.ts +36 -0
  372. package/dist/workspace-contracts.js +28 -0
  373. package/package.json +57 -0
@@ -0,0 +1,111 @@
1
+ export type RepoQualityDimensionId = 'tests' | 'docs' | 'decoupling';
2
+ export type RepoQualityGranularity = 'repo' | 'workspace' | 'file';
3
+ export type RepoQualityStatus = 'covered' | 'partial' | 'missing' | 'risk';
4
+ export interface RepoQualityDimensionScore {
5
+ id: RepoQualityDimensionId;
6
+ label: string;
7
+ score: number;
8
+ status: RepoQualityStatus;
9
+ total: number;
10
+ covered: number;
11
+ partial: number;
12
+ missing: number;
13
+ risk: number;
14
+ }
15
+ export interface RepoQualityRule {
16
+ id: string;
17
+ dimension: RepoQualityDimensionId;
18
+ label: string;
19
+ summary: string;
20
+ targetScore: number;
21
+ severity: 'info' | 'warning' | 'error';
22
+ }
23
+ export interface RepoQualityEvidence {
24
+ kind: 'test' | 'doc' | 'source';
25
+ path: string;
26
+ confidence: 'direct' | 'related' | 'inferred';
27
+ }
28
+ export interface RepoQualityFileEvaluation {
29
+ id: string;
30
+ granularity: 'file';
31
+ path: string;
32
+ owner: string;
33
+ layer: string;
34
+ kind: string;
35
+ lineCount: number;
36
+ importCount: number;
37
+ exportedSymbolCount: number;
38
+ scores: Record<RepoQualityDimensionId, number>;
39
+ statuses: Record<RepoQualityDimensionId, RepoQualityStatus>;
40
+ evidences: RepoQualityEvidence[];
41
+ findings: string[];
42
+ }
43
+ export interface RepoQualityCoverageSummary {
44
+ sourceFiles: number;
45
+ testEvidenceFiles: number;
46
+ docEvidenceFiles: number;
47
+ fullyCoveredFiles: number;
48
+ score: number;
49
+ status: RepoQualityStatus;
50
+ }
51
+ export interface RepoQualityWorkspaceEvaluation {
52
+ id: string;
53
+ granularity: 'workspace';
54
+ path: string;
55
+ fileCount: number;
56
+ lineCount: number;
57
+ coverage: RepoQualityCoverageSummary;
58
+ scores: Record<RepoQualityDimensionId, number>;
59
+ statuses: Record<RepoQualityDimensionId, RepoQualityStatus>;
60
+ riskCount: number;
61
+ missingCount: number;
62
+ findings: string[];
63
+ }
64
+ export interface RepoQualityEntryRootEvaluation {
65
+ id: string;
66
+ path: string;
67
+ kind: 'app' | 'package' | 'tooling';
68
+ sourceFileCount: number;
69
+ lineCount: number;
70
+ coverage: RepoQualityCoverageSummary;
71
+ status: RepoQualityStatus;
72
+ findings: string[];
73
+ }
74
+ export interface RepoQualityHistorySnapshot {
75
+ step: number;
76
+ generatedAt: string;
77
+ totals: {
78
+ sourceFiles: number;
79
+ sourceLines: number;
80
+ workspaces: number;
81
+ entryRoots: number;
82
+ };
83
+ dimensions: Record<RepoQualityDimensionId, {
84
+ score: number;
85
+ status: RepoQualityStatus;
86
+ total: number;
87
+ covered: number;
88
+ partial: number;
89
+ missing: number;
90
+ risk: number;
91
+ }>;
92
+ }
93
+ export interface RepoQualityEvaluation {
94
+ schemaVersion: 'repo-quality-evaluation.v1';
95
+ generatedAt: string;
96
+ repoRoot: string;
97
+ rules: RepoQualityRule[];
98
+ totals: {
99
+ sourceFiles: number;
100
+ testFiles: number;
101
+ docFiles: number;
102
+ workspaces: number;
103
+ entryRoots: number;
104
+ sourceLines: number;
105
+ };
106
+ dimensions: RepoQualityDimensionScore[];
107
+ entryRoots: RepoQualityEntryRootEvaluation[];
108
+ workspaces: RepoQualityWorkspaceEvaluation[];
109
+ files: RepoQualityFileEvaluation[];
110
+ history: RepoQualityHistorySnapshot[];
111
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,110 @@
1
+ export type RepositoryPackageManager = 'pnpm' | 'npm' | 'yarn' | 'bun' | 'unknown';
2
+ export type RepositoryInspectionSeverity = 'info' | 'warning' | 'blocked';
3
+ export type RepositoryFramework = 'svelte' | 'react' | 'vue' | 'solid' | 'unknown';
4
+ export type RepositoryBuildTool = 'vite' | 'sveltekit' | 'next' | 'nuxt' | 'vitest' | 'playwright' | 'typescript' | 'unknown';
5
+ export type RepositoryScriptKind = 'dev' | 'build' | 'test' | 'lint' | 'format' | 'preview' | 'check' | 'other';
6
+ export interface RepositoryInspectionFinding {
7
+ id: string;
8
+ severity: RepositoryInspectionSeverity;
9
+ title: string;
10
+ message: string;
11
+ }
12
+ export interface RepositoryScriptSnapshot {
13
+ name: string;
14
+ command: string;
15
+ kind: RepositoryScriptKind;
16
+ }
17
+ export interface RepositoryWorkspaceSnapshot {
18
+ patterns: string[];
19
+ }
20
+ export interface RepositoryGitSnapshot {
21
+ branch: string | null;
22
+ commit: string | null;
23
+ dirty: boolean;
24
+ }
25
+ export interface RepositoryInspectionSummary {
26
+ primaryFramework: RepositoryFramework;
27
+ primaryBuildTool: RepositoryBuildTool;
28
+ launchCommand: string | null;
29
+ testCommand: string | null;
30
+ scriptKinds: RepositoryScriptKind[];
31
+ configCount: number;
32
+ workspacePackageCount: number;
33
+ }
34
+ export interface RepositoryInspectionSnapshot {
35
+ id: string;
36
+ label: string;
37
+ root: string;
38
+ generatedAt: string;
39
+ packageName: string | null;
40
+ packageVersion: string | null;
41
+ packageManager: RepositoryPackageManager;
42
+ frameworks: RepositoryFramework[];
43
+ buildTools: RepositoryBuildTool[];
44
+ scripts: RepositoryScriptSnapshot[];
45
+ workspaces: RepositoryWorkspaceSnapshot | null;
46
+ git: RepositoryGitSnapshot | null;
47
+ configs: string[];
48
+ summary: RepositoryInspectionSummary;
49
+ findings: RepositoryInspectionFinding[];
50
+ inspectOnly: boolean;
51
+ canLaunch: boolean;
52
+ }
53
+ export interface RepositoryInspectionInput {
54
+ label?: string | null;
55
+ root: string;
56
+ files?: string[];
57
+ packageJson?: {
58
+ name?: string;
59
+ version?: string;
60
+ scripts?: Record<string, string>;
61
+ workspaces?: string[] | {
62
+ packages?: string[];
63
+ };
64
+ dependencies?: Record<string, string>;
65
+ devDependencies?: Record<string, string>;
66
+ } | null;
67
+ git?: Partial<RepositoryGitSnapshot> | null;
68
+ inspectOnly?: boolean;
69
+ }
70
+ export type RepositoryCoverageEntityKind = 'route' | 'design-system' | 'test' | 'doc' | 'language' | 'usecase' | 'infrastructure' | 'decoupling';
71
+ export interface RepositoryCoverageEntity {
72
+ id: string;
73
+ kind: RepositoryCoverageEntityKind;
74
+ label: string;
75
+ sourceFile: string;
76
+ detail: string;
77
+ meta?: string | null;
78
+ }
79
+ export interface RepositoryCoverageSection {
80
+ id: RepositoryCoverageEntityKind;
81
+ label: string;
82
+ count: number;
83
+ items: RepositoryCoverageEntity[];
84
+ }
85
+ export interface RepositoryCoverageDiagnostic {
86
+ id: string;
87
+ severity: RepositoryInspectionSeverity;
88
+ message: string;
89
+ }
90
+ export interface RepositoryCoverageSnapshot {
91
+ id: string;
92
+ projectRoot: string;
93
+ projectLabel: string;
94
+ generatedAt: string;
95
+ source: 'runtime' | 'script';
96
+ routes: RepositoryCoverageSection;
97
+ designSystem: RepositoryCoverageSection;
98
+ tests: RepositoryCoverageSection;
99
+ docs: RepositoryCoverageSection;
100
+ languages: RepositoryCoverageSection;
101
+ usecases: RepositoryCoverageSection;
102
+ infrastructure: RepositoryCoverageSection;
103
+ decoupling: RepositoryCoverageSection;
104
+ diagnostics: RepositoryCoverageDiagnostic[];
105
+ totals: {
106
+ files: number;
107
+ sections: number;
108
+ entities: number;
109
+ };
110
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ import type { LaunchProfile, LaunchTarget } from "../launch/model.js";
2
+ import type { JsonValue } from "../shared/json.js";
3
+ export type RuntimeCheckpointKind = 'project-state' | 'workspace-state' | 'runtime-session' | 'launch-profile' | 'tool-session' | 'last-known-good' | 'crash-snapshot' | 'restore-point';
4
+ export interface RuntimeCheckpointInput {
5
+ id?: string;
6
+ kind: RuntimeCheckpointKind;
7
+ label: string;
8
+ target?: LaunchTarget | null;
9
+ profile?: LaunchProfile | null;
10
+ data?: unknown;
11
+ tags?: string[];
12
+ source?: string | null;
13
+ }
14
+ export interface RuntimeCheckpoint {
15
+ schemaVersion: 'runtime-checkpoint.v1';
16
+ id: string;
17
+ kind: RuntimeCheckpointKind;
18
+ label: string;
19
+ target: LaunchTarget | null;
20
+ profile: LaunchProfile | null;
21
+ data: JsonValue;
22
+ tags: string[];
23
+ source: string | null;
24
+ sizeBytes: number;
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ }
28
+ export interface RuntimeCheckpointSnapshot {
29
+ generatedAt: string;
30
+ checkpoints: RuntimeCheckpoint[];
31
+ lastKnownGoodId: string | null;
32
+ restorePointIds: string[];
33
+ totals: Record<RuntimeCheckpointKind, number>;
34
+ }
35
+ export declare function createRuntimeCheckpoint(input: RuntimeCheckpointInput, timestamp?: string): RuntimeCheckpoint;
36
+ export declare function updateRuntimeCheckpoint(checkpoint: RuntimeCheckpoint, data: unknown, timestamp?: string): RuntimeCheckpoint;
37
+ export declare function createRuntimeCheckpointSnapshot(checkpoints: RuntimeCheckpoint[], lastKnownGoodId?: string | null, timestamp?: string): RuntimeCheckpointSnapshot;
@@ -0,0 +1,87 @@
1
+ export function createRuntimeCheckpoint(input, timestamp = new Date().toISOString()) {
2
+ const data = sanitizeJson(input.data ?? null);
3
+ return {
4
+ schemaVersion: 'runtime-checkpoint.v1',
5
+ id: input.id ?? `checkpoint:${input.kind}:${timestamp}`,
6
+ kind: input.kind,
7
+ label: sanitizeText(input.label, 160),
8
+ target: input.target ?? null,
9
+ profile: input.profile ?? input.target?.profile ?? null,
10
+ data,
11
+ tags: (input.tags ?? []).map((tag) => sanitizeText(tag, 80)).slice(0, 20),
12
+ source: normalizeNullableText(input.source, 160),
13
+ sizeBytes: estimateJsonSize(data),
14
+ createdAt: timestamp,
15
+ updatedAt: timestamp
16
+ };
17
+ }
18
+ export function updateRuntimeCheckpoint(checkpoint, data, timestamp = new Date().toISOString()) {
19
+ const sanitizedData = sanitizeJson(data);
20
+ return {
21
+ ...checkpoint,
22
+ data: sanitizedData,
23
+ sizeBytes: estimateJsonSize(sanitizedData),
24
+ updatedAt: timestamp
25
+ };
26
+ }
27
+ export function createRuntimeCheckpointSnapshot(checkpoints, lastKnownGoodId = null, timestamp = new Date().toISOString()) {
28
+ const sortedCheckpoints = [...checkpoints].sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
29
+ return {
30
+ generatedAt: timestamp,
31
+ checkpoints: sortedCheckpoints,
32
+ lastKnownGoodId,
33
+ restorePointIds: sortedCheckpoints
34
+ .filter((checkpoint) => checkpoint.kind === 'restore-point' || checkpoint.id === lastKnownGoodId)
35
+ .map((checkpoint) => checkpoint.id),
36
+ totals: createCheckpointTotals(sortedCheckpoints)
37
+ };
38
+ }
39
+ const checkpointKinds = [
40
+ 'project-state',
41
+ 'workspace-state',
42
+ 'runtime-session',
43
+ 'launch-profile',
44
+ 'tool-session',
45
+ 'last-known-good',
46
+ 'crash-snapshot',
47
+ 'restore-point'
48
+ ];
49
+ function createCheckpointTotals(checkpoints) {
50
+ const totals = Object.fromEntries(checkpointKinds.map((kind) => [kind, 0]));
51
+ for (const checkpoint of checkpoints) {
52
+ totals[checkpoint.kind] += 1;
53
+ }
54
+ return totals;
55
+ }
56
+ function estimateJsonSize(value) {
57
+ return JSON.stringify(value).length;
58
+ }
59
+ function normalizeNullableText(value, maxLength) {
60
+ return typeof value === 'string' ? sanitizeText(value, maxLength) : null;
61
+ }
62
+ function sanitizeText(value, maxLength = 2000) {
63
+ return value.length <= maxLength ? value : `${value.slice(0, maxLength - 1)}...`;
64
+ }
65
+ function sanitizeJson(value, depth = 0) {
66
+ if (value === null || typeof value === 'boolean') {
67
+ return value;
68
+ }
69
+ if (typeof value === 'string') {
70
+ return sanitizeText(value);
71
+ }
72
+ if (typeof value === 'number') {
73
+ return Number.isFinite(value) ? value : null;
74
+ }
75
+ if (Array.isArray(value)) {
76
+ return depth >= 4 ? `[Array(${value.length})]` : value.slice(0, 50).map((entry) => sanitizeJson(entry, depth + 1));
77
+ }
78
+ if (value && typeof value === 'object') {
79
+ if (depth >= 4) {
80
+ return '[Object]';
81
+ }
82
+ return Object.fromEntries(Object.entries(value)
83
+ .slice(0, 50)
84
+ .map(([key, entry]) => [sanitizeText(key, 120), sanitizeJson(entry, depth + 1)]));
85
+ }
86
+ return null;
87
+ }
@@ -0,0 +1,26 @@
1
+ import type { RuntimePlan } from "./plan.js";
2
+ export type RuntimeHydrationStepKind = 'documents' | 'graphs' | 'layouts' | 'sessions' | 'tools' | 'stores';
3
+ export type RuntimeHydrationStepStatus = 'pending' | 'running' | 'completed' | 'failed';
4
+ export interface RuntimeHydrationStep {
5
+ id: string;
6
+ kind: RuntimeHydrationStepKind;
7
+ label: string;
8
+ status: RuntimeHydrationStepStatus;
9
+ startedAt: string | null;
10
+ completedAt: string | null;
11
+ message: string | null;
12
+ }
13
+ export interface RuntimeHydrationSnapshot {
14
+ planId: string;
15
+ status: 'idle' | 'running' | 'completed' | 'failed' | 'partial';
16
+ activeStepId: string | null;
17
+ progress: number;
18
+ steps: RuntimeHydrationStep[];
19
+ startedAt: string;
20
+ updatedAt: string;
21
+ completedAt: string | null;
22
+ error: string | null;
23
+ }
24
+ export declare function createRuntimeHydrationSnapshot(plan: RuntimePlan, timestamp?: string): RuntimeHydrationSnapshot;
25
+ export declare function completeRuntimeHydrationStep(snapshot: RuntimeHydrationSnapshot, stepId: string, timestamp?: string, message?: string | null): RuntimeHydrationSnapshot;
26
+ export declare function failRuntimeHydrationStep(snapshot: RuntimeHydrationSnapshot, stepId: string, error: string, timestamp?: string): RuntimeHydrationSnapshot;
@@ -0,0 +1,92 @@
1
+ const DEFAULT_HYDRATION_STEPS = [
2
+ { kind: 'documents', label: 'Hydrate documents' },
3
+ { kind: 'graphs', label: 'Hydrate graphs' },
4
+ { kind: 'layouts', label: 'Hydrate layouts' },
5
+ { kind: 'sessions', label: 'Hydrate sessions' },
6
+ { kind: 'tools', label: 'Hydrate tools' },
7
+ { kind: 'stores', label: 'Hydrate stores' }
8
+ ];
9
+ export function createRuntimeHydrationSnapshot(plan, timestamp = new Date().toISOString()) {
10
+ const steps = DEFAULT_HYDRATION_STEPS.map((step) => ({
11
+ id: `hydrate:${step.kind}`,
12
+ kind: step.kind,
13
+ label: step.label,
14
+ status: 'pending',
15
+ startedAt: null,
16
+ completedAt: null,
17
+ message: null
18
+ }));
19
+ const firstStep = steps[0] ?? null;
20
+ return {
21
+ planId: plan.id,
22
+ status: 'running',
23
+ activeStepId: firstStep?.id ?? null,
24
+ progress: 0,
25
+ steps: firstStep
26
+ ? steps.map((step) => step.id === firstStep.id ? { ...step, status: 'running', startedAt: timestamp } : step)
27
+ : steps,
28
+ startedAt: timestamp,
29
+ updatedAt: timestamp,
30
+ completedAt: null,
31
+ error: null
32
+ };
33
+ }
34
+ export function completeRuntimeHydrationStep(snapshot, stepId, timestamp = new Date().toISOString(), message = null) {
35
+ const steps = snapshot.steps.map((step) => step.id === stepId
36
+ ? {
37
+ ...step,
38
+ status: 'completed',
39
+ completedAt: timestamp,
40
+ message
41
+ }
42
+ : step);
43
+ const nextPendingStep = steps.find((step) => step.status === 'pending') ?? null;
44
+ const nextSteps = nextPendingStep
45
+ ? steps.map((step) => step.id === nextPendingStep.id
46
+ ? {
47
+ ...step,
48
+ status: 'running',
49
+ startedAt: timestamp
50
+ }
51
+ : step)
52
+ : steps;
53
+ const progress = calculateHydrationProgress(nextSteps);
54
+ const completed = progress >= 100;
55
+ return {
56
+ ...snapshot,
57
+ status: completed ? 'completed' : 'running',
58
+ activeStepId: completed ? null : nextPendingStep?.id ?? null,
59
+ progress,
60
+ steps: nextSteps,
61
+ updatedAt: timestamp,
62
+ completedAt: completed ? timestamp : null,
63
+ error: null
64
+ };
65
+ }
66
+ export function failRuntimeHydrationStep(snapshot, stepId, error, timestamp = new Date().toISOString()) {
67
+ const steps = snapshot.steps.map((step) => step.id === stepId
68
+ ? {
69
+ ...step,
70
+ status: 'failed',
71
+ completedAt: timestamp,
72
+ message: error
73
+ }
74
+ : step);
75
+ return {
76
+ ...snapshot,
77
+ status: 'failed',
78
+ activeStepId: null,
79
+ progress: calculateHydrationProgress(steps),
80
+ steps,
81
+ updatedAt: timestamp,
82
+ completedAt: timestamp,
83
+ error
84
+ };
85
+ }
86
+ function calculateHydrationProgress(steps) {
87
+ if (steps.length === 0) {
88
+ return 100;
89
+ }
90
+ const resolvedSteps = steps.filter((step) => step.status === 'completed').length;
91
+ return Math.round((resolvedSteps / steps.length) * 100);
92
+ }
@@ -0,0 +1,25 @@
1
+ import type { RuntimePlan } from "./plan.js";
2
+ export type RuntimeInitializationStepStatus = 'pending' | 'running' | 'completed' | 'skipped' | 'failed';
3
+ export interface RuntimeInitializationStep {
4
+ id: string;
5
+ planStepId: string;
6
+ label: string;
7
+ status: RuntimeInitializationStepStatus;
8
+ startedAt: string | null;
9
+ completedAt: string | null;
10
+ message: string | null;
11
+ }
12
+ export interface RuntimeInitializationSnapshot {
13
+ planId: string;
14
+ status: 'idle' | 'running' | 'completed' | 'failed';
15
+ activeStepId: string | null;
16
+ progress: number;
17
+ steps: RuntimeInitializationStep[];
18
+ startedAt: string;
19
+ updatedAt: string;
20
+ completedAt: string | null;
21
+ error: string | null;
22
+ }
23
+ export declare function createRuntimeInitializationSnapshot(plan: RuntimePlan, timestamp?: string): RuntimeInitializationSnapshot;
24
+ export declare function completeRuntimeInitializationStep(snapshot: RuntimeInitializationSnapshot, stepId: string, timestamp?: string, message?: string | null): RuntimeInitializationSnapshot;
25
+ export declare function failRuntimeInitializationStep(snapshot: RuntimeInitializationSnapshot, stepId: string, error: string, timestamp?: string): RuntimeInitializationSnapshot;
@@ -0,0 +1,87 @@
1
+ export function createRuntimeInitializationSnapshot(plan, timestamp = new Date().toISOString()) {
2
+ const steps = plan.steps.map((step) => createInitializationStep(step, timestamp));
3
+ const firstPendingStep = steps.find((step) => step.status === 'pending') ?? null;
4
+ return {
5
+ planId: plan.id,
6
+ status: plan.canExecute ? 'running' : 'failed',
7
+ activeStepId: firstPendingStep?.id ?? null,
8
+ progress: calculateInitializationProgress(steps),
9
+ steps: firstPendingStep
10
+ ? steps.map((step) => step.id === firstPendingStep.id ? { ...step, status: 'running', startedAt: timestamp } : step)
11
+ : steps,
12
+ startedAt: timestamp,
13
+ updatedAt: timestamp,
14
+ completedAt: null,
15
+ error: plan.canExecute ? null : 'Runtime plan is blocked.'
16
+ };
17
+ }
18
+ export function completeRuntimeInitializationStep(snapshot, stepId, timestamp = new Date().toISOString(), message = null) {
19
+ const steps = snapshot.steps.map((step) => step.id === stepId
20
+ ? {
21
+ ...step,
22
+ status: 'completed',
23
+ completedAt: timestamp,
24
+ message
25
+ }
26
+ : step);
27
+ const nextPendingStep = steps.find((step) => step.status === 'pending') ?? null;
28
+ const nextSteps = nextPendingStep
29
+ ? steps.map((step) => step.id === nextPendingStep.id
30
+ ? {
31
+ ...step,
32
+ status: 'running',
33
+ startedAt: timestamp
34
+ }
35
+ : step)
36
+ : steps;
37
+ const progress = calculateInitializationProgress(nextSteps);
38
+ const completed = progress >= 100;
39
+ return {
40
+ ...snapshot,
41
+ status: completed ? 'completed' : 'running',
42
+ activeStepId: completed ? null : nextPendingStep?.id ?? null,
43
+ progress,
44
+ steps: nextSteps,
45
+ updatedAt: timestamp,
46
+ completedAt: completed ? timestamp : null,
47
+ error: null
48
+ };
49
+ }
50
+ export function failRuntimeInitializationStep(snapshot, stepId, error, timestamp = new Date().toISOString()) {
51
+ const steps = snapshot.steps.map((step) => step.id === stepId
52
+ ? {
53
+ ...step,
54
+ status: 'failed',
55
+ completedAt: timestamp,
56
+ message: error
57
+ }
58
+ : step);
59
+ return {
60
+ ...snapshot,
61
+ status: 'failed',
62
+ activeStepId: null,
63
+ progress: calculateInitializationProgress(steps),
64
+ steps,
65
+ updatedAt: timestamp,
66
+ completedAt: timestamp,
67
+ error
68
+ };
69
+ }
70
+ function createInitializationStep(step, timestamp) {
71
+ return {
72
+ id: `init:${step.id}`,
73
+ planStepId: step.id,
74
+ label: step.label,
75
+ status: step.status === 'skipped' ? 'skipped' : step.status === 'blocked' ? 'failed' : 'pending',
76
+ startedAt: null,
77
+ completedAt: step.status === 'skipped' || step.status === 'blocked' ? timestamp : null,
78
+ message: step.reason
79
+ };
80
+ }
81
+ function calculateInitializationProgress(steps) {
82
+ if (steps.length === 0) {
83
+ return 100;
84
+ }
85
+ const resolvedSteps = steps.filter((step) => step.status === 'completed' || step.status === 'skipped').length;
86
+ return Math.round((resolvedSteps / steps.length) * 100);
87
+ }
@@ -0,0 +1,51 @@
1
+ import type { LaunchPhase } from "../launch/model.js";
2
+ export type RuntimeLifecycleState = LaunchPhase;
3
+ export type RuntimeLifecycleMacroPhase = 'boot' | 'launch' | 'planning' | 'initialization' | 'hydration' | 'running' | 'suspension' | 'teardown' | 'recovery';
4
+ export type RuntimeLifecycleHealth = 'idle' | 'progressing' | 'healthy' | 'recovering' | 'safe-mode' | 'blocked';
5
+ export interface RuntimeLifecycleTransition {
6
+ id: string;
7
+ from: RuntimeLifecycleState | null;
8
+ to: RuntimeLifecycleState;
9
+ accepted: boolean;
10
+ timestamp: string;
11
+ message: string;
12
+ }
13
+ export interface RuntimeLifecycleTransitionError {
14
+ id: string;
15
+ from: RuntimeLifecycleState | null;
16
+ to: RuntimeLifecycleState;
17
+ timestamp: string;
18
+ message: string;
19
+ }
20
+ export interface RuntimeLifecycleSnapshot {
21
+ state: RuntimeLifecycleState;
22
+ previousState: RuntimeLifecycleState | null;
23
+ transitions: RuntimeLifecycleTransition[];
24
+ errors: RuntimeLifecycleTransitionError[];
25
+ updatedAt: string;
26
+ }
27
+ export interface RuntimeLifecycleSummary {
28
+ state: RuntimeLifecycleState;
29
+ previousState: RuntimeLifecycleState | null;
30
+ macroPhase: RuntimeLifecycleMacroPhase;
31
+ health: RuntimeLifecycleHealth;
32
+ acceptedTransitions: number;
33
+ rejectedTransitions: number;
34
+ latestTransitionAt: string | null;
35
+ updatedAt: string;
36
+ }
37
+ export interface RuntimeLifecycleTransitionInput {
38
+ id: string;
39
+ timestamp: string;
40
+ message?: string;
41
+ maxTransitions?: number;
42
+ maxErrors?: number;
43
+ }
44
+ export declare const RUNTIME_LIFECYCLE_ALLOWED_TRANSITIONS: Record<RuntimeLifecycleState, readonly RuntimeLifecycleState[]>;
45
+ export declare const RUNTIME_LIFECYCLE_MACRO_PHASES: Record<RuntimeLifecycleState, RuntimeLifecycleMacroPhase>;
46
+ export declare function createRuntimeLifecycleSnapshot(state?: RuntimeLifecycleState, timestamp?: string): RuntimeLifecycleSnapshot;
47
+ export declare function canTransitionRuntimeLifecycle(from: RuntimeLifecycleState | null, to: RuntimeLifecycleState): boolean;
48
+ export declare function transitionRuntimeLifecycleSnapshot(snapshot: RuntimeLifecycleSnapshot, to: RuntimeLifecycleState, input: RuntimeLifecycleTransitionInput): RuntimeLifecycleSnapshot;
49
+ export declare function resolveRuntimeLifecycleMacroPhase(state: RuntimeLifecycleState): RuntimeLifecycleMacroPhase;
50
+ export declare function resolveRuntimeLifecycleHealth(snapshot: RuntimeLifecycleSnapshot): RuntimeLifecycleHealth;
51
+ export declare function createRuntimeLifecycleSummary(snapshot: RuntimeLifecycleSnapshot): RuntimeLifecycleSummary;