@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,106 @@
1
+ import { listPanels } from "../../domain/layout/selectors.js";
2
+ import { createSplit } from "../../domain/workspace/factories.js";
3
+ import { normalizeSplitSizes } from "../../domain/layout/validation.js";
4
+ import { pruneUnusedToolInstances, updateCanonicalizedActiveWindowRoot } from "./finalizeWorkspace.js";
5
+ import { updateWorkspaceTargetWindow } from "./targetWindow.js";
6
+ export function collapseSplitBoundary(workspace, input) {
7
+ return updateWorkspaceTargetWindow(workspace, input.rootSplitId, (selected) => collapseSplitBoundaryInActiveWindow(selected, input));
8
+ }
9
+ function collapseSplitBoundaryInActiveWindow(workspace, input) {
10
+ let removedNode = null;
11
+ let didCollapse = false;
12
+ const nextWorkspace = updateCanonicalizedActiveWindowRoot(workspace, (root) => {
13
+ const nextRoot = collapseSplitBoundaryInNode(root, input, (node) => {
14
+ removedNode = node;
15
+ didCollapse = true;
16
+ });
17
+ return didCollapse ? nextRoot : root;
18
+ });
19
+ if (!didCollapse || !removedNode) {
20
+ return workspace;
21
+ }
22
+ const removedToolInstanceIds = new Set(listPanels(removedNode)
23
+ .map((panel) => panel.toolInstanceId)
24
+ .filter((toolInstanceId) => !!toolInstanceId));
25
+ if (removedToolInstanceIds.size === 0) {
26
+ return nextWorkspace;
27
+ }
28
+ return pruneUnusedToolInstances(nextWorkspace, removedToolInstanceIds);
29
+ }
30
+ function collapseSplitBoundaryInNode(node, input, onCollapse) {
31
+ if (node.kind !== 'split') {
32
+ return node;
33
+ }
34
+ if (node.id === input.rootSplitId) {
35
+ const segments = collectCanonicalSegments(node, node.orientation, 1);
36
+ const removeIndex = input.removeSide === 'start' ? input.boundaryIndex : input.boundaryIndex + 1;
37
+ if (removeIndex < 0 || removeIndex >= segments.length) {
38
+ return node;
39
+ }
40
+ const removedSegment = segments[removeIndex];
41
+ if (!removedSegment) {
42
+ return node;
43
+ }
44
+ onCollapse(removedSegment.node);
45
+ const remainingSegments = segments.filter((_, index) => index !== removeIndex);
46
+ return buildCanonicalSplitChain(node.orientation, remainingSegments, node.id);
47
+ }
48
+ return {
49
+ ...node,
50
+ children: [
51
+ collapseSplitBoundaryInNode(node.children[0], input, onCollapse),
52
+ collapseSplitBoundaryInNode(node.children[1], input, onCollapse)
53
+ ]
54
+ };
55
+ }
56
+ function collectCanonicalSegments(node, orientation, size) {
57
+ if (node.kind !== 'split' || node.orientation !== orientation) {
58
+ return [{ node, size }];
59
+ }
60
+ return [
61
+ ...collectCanonicalSegments(node.children[0], orientation, size * node.sizes[0]),
62
+ ...collectCanonicalSegments(node.children[1], orientation, size * node.sizes[1])
63
+ ];
64
+ }
65
+ function buildCanonicalSplitChain(orientation, segments, rootSplitId) {
66
+ if (segments.length === 1) {
67
+ return segments[0].node;
68
+ }
69
+ if (segments.length === 2) {
70
+ const nextSizes = normalizeSplitSizes([segments[0].size, segments[1].size]);
71
+ if (rootSplitId) {
72
+ return {
73
+ id: rootSplitId,
74
+ kind: 'split',
75
+ orientation,
76
+ children: [segments[0].node, segments[1].node],
77
+ sizes: nextSizes
78
+ };
79
+ }
80
+ return createSplit(orientation, [segments[0].node, segments[1].node], nextSizes);
81
+ }
82
+ const splitIndex = resolveBalancedSplitIndex(segments);
83
+ const leftSegments = segments.slice(0, splitIndex);
84
+ const rightSegments = segments.slice(splitIndex);
85
+ const leftTotal = leftSegments.reduce((sum, segment) => sum + segment.size, 0);
86
+ const rightTotal = rightSegments.reduce((sum, segment) => sum + segment.size, 0);
87
+ const nextSizes = normalizeSplitSizes([leftTotal, rightTotal]);
88
+ const leftNode = buildCanonicalSplitChain(orientation, leftSegments);
89
+ const rightNode = buildCanonicalSplitChain(orientation, rightSegments);
90
+ if (rootSplitId) {
91
+ return {
92
+ id: rootSplitId,
93
+ kind: 'split',
94
+ orientation,
95
+ children: [leftNode, rightNode],
96
+ sizes: nextSizes
97
+ };
98
+ }
99
+ return createSplit(orientation, [leftNode, rightNode], nextSizes);
100
+ }
101
+ function resolveBalancedSplitIndex(segments) {
102
+ if (segments.length <= 2) {
103
+ return 1;
104
+ }
105
+ return Math.max(1, Math.min(segments.length - 1, Math.floor(segments.length / 2)));
106
+ }
@@ -0,0 +1,71 @@
1
+ import type { LayoutDockSide, LayoutEdge } from "../../domain/layout/interaction.js";
2
+ import type { WorkbenchReadingLevel } from "../../domain/presentation/readingLevel.js";
3
+ import type { ToolCatalogPort } from "../../domain/tool/model.js";
4
+ import { type WorkspaceSessionState } from "./session.js";
5
+ export type WorkspaceCommand = {
6
+ type: 'open-tool';
7
+ toolId: string;
8
+ } | {
9
+ type: 'open-tool-in-panel';
10
+ panelId: string;
11
+ toolId: string;
12
+ } | {
13
+ type: 'open-tool-in-new-tab';
14
+ panelId: string;
15
+ toolId: string;
16
+ } | {
17
+ type: 'split-panel-horizontal';
18
+ } | {
19
+ type: 'split-panel-vertical';
20
+ } | {
21
+ type: 'split-panel-to-side';
22
+ orientation: 'horizontal' | 'vertical';
23
+ side: LayoutDockSide;
24
+ panelId?: string;
25
+ } | {
26
+ type: 'join-panel-area';
27
+ panelId: string;
28
+ edge: LayoutEdge;
29
+ } | {
30
+ type: 'swap-panel-area';
31
+ panelId: string;
32
+ edge: LayoutEdge;
33
+ } | {
34
+ type: 'close-active-panel';
35
+ } | {
36
+ type: 'close-panel';
37
+ panelId: string;
38
+ } | {
39
+ type: 'detach-panel-to-window';
40
+ panelId: string;
41
+ } | {
42
+ type: 'focus-panel';
43
+ panelId: string;
44
+ } | {
45
+ type: 'activate-tab';
46
+ stackId: string;
47
+ panelId: string;
48
+ } | {
49
+ type: 'set-stack-header-visibility';
50
+ stackId: string;
51
+ visible: boolean;
52
+ } | {
53
+ type: 'set-panel-fullscreen-toggle-visibility';
54
+ panelId: string;
55
+ visible: boolean;
56
+ } | {
57
+ type: 'run-tool-shell-command';
58
+ panelId: string;
59
+ toolInstanceId: string;
60
+ commandId: string;
61
+ /** Current shell default used only to resolve an inherited Tool reading level. */
62
+ inheritedReadingLevel?: WorkbenchReadingLevel;
63
+ };
64
+ interface WorkspaceCommandContext {
65
+ toolCatalog: ToolCatalogPort;
66
+ }
67
+ /**
68
+ * Command handling owns focus transitions so Svelte components only emit user intent.
69
+ */
70
+ export declare function dispatchWorkspaceCommand(state: WorkspaceSessionState, command: WorkspaceCommand, context: WorkspaceCommandContext): WorkspaceSessionState;
71
+ export {};
@@ -0,0 +1,216 @@
1
+ import { listPanelsInWorkspace, findPanelInWorkspace, findStackContainingPanelInWorkspace, findStackInWorkspace, findWindowContainingPanel, findToolPlacementByToolId, getPreferredFocusedPanelId } from "../../domain/workspace/selectors.js";
2
+ import { closePanel } from "./closePanel.js";
3
+ import { detachPanelToWindow } from "./detachPanelToWindow.js";
4
+ import { joinPanelArea } from "./joinPanelArea.js";
5
+ import { openTool } from "./openTool.js";
6
+ import { runToolShellCommand } from "./runToolShellCommand.js";
7
+ import { setPanelFullscreenToggleVisibility } from "./setPanelFullscreenToggleVisibility.js";
8
+ import { setStackHeaderVisibility } from "./setStackHeaderVisibility.js";
9
+ import { setActiveStackChild } from "./setActiveStackChild.js";
10
+ import { focusPanel } from "./focusPanel.js";
11
+ import { selectWorkspaceTargetWindow } from "./targetWindow.js";
12
+ import { splitPanel } from "./splitPanel.js";
13
+ import { swapPanelArea } from "./swapPanelArea.js";
14
+ import { createPanel } from "../../domain/workspace/factories.js";
15
+ import { updateActiveWindowRoot, updateStackById } from "./layoutTree.js";
16
+ import { createWorkspaceSessionState, getFocusedPanel } from "./session.js";
17
+ /**
18
+ * Command handling owns focus transitions so Svelte components only emit user intent.
19
+ */
20
+ export function dispatchWorkspaceCommand(state, command, context) {
21
+ const targetId = command.type === 'set-stack-header-visibility' ? command.stackId :
22
+ command.type === 'set-panel-fullscreen-toggle-visibility' ||
23
+ command.type === 'close-panel' || command.type === 'join-panel-area' ||
24
+ command.type === 'swap-panel-area' ? command.panelId :
25
+ command.type === 'split-panel-to-side' ? command.panelId ?? state.focus.activePanelId :
26
+ command.type === 'split-panel-horizontal' || command.type === 'split-panel-vertical' ||
27
+ command.type === 'close-active-panel' || command.type === 'open-tool' ? state.focus.activePanelId : null;
28
+ const normalizedState = createWorkspaceSessionState(selectWorkspaceTargetWindow(state.workspace, targetId), state.focus);
29
+ switch (command.type) {
30
+ case 'focus-panel':
31
+ return focusPanel(normalizedState, command.panelId);
32
+ case 'activate-tab':
33
+ return activateTab(normalizedState, command.stackId, command.panelId);
34
+ case 'set-stack-header-visibility':
35
+ return setStackHeaderVisibilityFromCommand(normalizedState, command.stackId, command.visible);
36
+ case 'set-panel-fullscreen-toggle-visibility':
37
+ return setPanelFullscreenToggleVisibilityFromCommand(normalizedState, command.panelId, command.visible);
38
+ case 'open-tool':
39
+ return openToolFromFocus(normalizedState, command.toolId, context.toolCatalog);
40
+ case 'open-tool-in-panel':
41
+ return openToolInPanel(normalizedState, command.panelId, command.toolId, context.toolCatalog);
42
+ case 'open-tool-in-new-tab':
43
+ return openToolInNewTab(normalizedState, command.panelId, command.toolId, context.toolCatalog);
44
+ case 'run-tool-shell-command':
45
+ return runFocusedToolShellCommand(normalizedState, command, context.toolCatalog);
46
+ case 'split-panel-horizontal':
47
+ return splitFocusedPanel(normalizedState, 'horizontal');
48
+ case 'split-panel-vertical':
49
+ return splitFocusedPanel(normalizedState, 'vertical');
50
+ case 'split-panel-to-side':
51
+ return splitPanelToSide(normalizedState, command.orientation, command.side, command.panelId ?? null);
52
+ case 'join-panel-area':
53
+ return joinPanelAreaFromCommand(normalizedState, command.panelId, command.edge);
54
+ case 'swap-panel-area':
55
+ return swapPanelAreaFromCommand(normalizedState, command.panelId, command.edge);
56
+ case 'close-active-panel':
57
+ return closeFocusedPanel(normalizedState);
58
+ case 'close-panel':
59
+ return closePanelById(normalizedState, command.panelId);
60
+ case 'detach-panel-to-window':
61
+ return detachPanelFromCommand(normalizedState, command.panelId);
62
+ }
63
+ }
64
+ function runFocusedToolShellCommand(state, command, toolCatalog) {
65
+ const nextWorkspace = runToolShellCommand(state.workspace, {
66
+ panelId: command.panelId,
67
+ toolInstanceId: command.toolInstanceId,
68
+ commandId: command.commandId,
69
+ inheritedReadingLevel: command.inheritedReadingLevel
70
+ }, toolCatalog);
71
+ return createWorkspaceSessionState(nextWorkspace, { activePanelId: command.panelId });
72
+ }
73
+ function activateTab(state, stackId, panelId) {
74
+ const stack = findStackInWorkspace(state.workspace, stackId);
75
+ if (!stack || !stack.children.some((panel) => panel.id === panelId)) {
76
+ return state;
77
+ }
78
+ // A tab belongs to its containing window, not necessarily the window last
79
+ // activated by a synchronized client. Reuse the canonical focus transition.
80
+ return focusPanel(state, panelId);
81
+ }
82
+ function setStackHeaderVisibilityFromCommand(state, stackId, visible) {
83
+ const stack = findStackInWorkspace(state.workspace, stackId);
84
+ if (!stack) {
85
+ return state;
86
+ }
87
+ const nextWorkspace = setStackHeaderVisibility(state.workspace, { stackId, visible });
88
+ return createWorkspaceSessionState(nextWorkspace, state.focus);
89
+ }
90
+ function setPanelFullscreenToggleVisibilityFromCommand(state, panelId, visible) {
91
+ const panel = findPanelInWorkspace(state.workspace, panelId);
92
+ if (!panel) {
93
+ return state;
94
+ }
95
+ const nextWorkspace = setPanelFullscreenToggleVisibility(state.workspace, { panelId, visible });
96
+ return createWorkspaceSessionState(nextWorkspace, state.focus);
97
+ }
98
+ function openToolFromFocus(state, toolId, toolCatalog) {
99
+ const focusedPanel = getFocusedPanel(state);
100
+ if (!focusedPanel) {
101
+ return state;
102
+ }
103
+ const focusedWorkspace = ensurePanelVisible(state.workspace, focusedPanel.id);
104
+ const openToolResult = openTool(focusedWorkspace, { panelId: focusedPanel.id, toolId }, toolCatalog);
105
+ return createWorkspaceSessionState(openToolResult.workspace, {
106
+ activePanelId: openToolResult.panelId ?? focusedPanel.id
107
+ });
108
+ }
109
+ function openToolInPanel(state, panelId, toolId, toolCatalog) {
110
+ const targetPanel = findPanelInWorkspace(state.workspace, panelId);
111
+ if (!targetPanel) {
112
+ return state;
113
+ }
114
+ const visibleState = focusPanel(state, panelId);
115
+ const visibleWorkspace = ensurePanelVisible(visibleState.workspace, panelId);
116
+ const openToolResult = openTool(visibleWorkspace, { panelId, toolId, singletonPlacement: 'move-to-panel' }, toolCatalog);
117
+ return createWorkspaceSessionState(openToolResult.workspace, {
118
+ activePanelId: openToolResult.panelId ?? panelId
119
+ });
120
+ }
121
+ function openToolInNewTab(state, panelId, toolId, toolCatalog) {
122
+ const targetPanel = findPanelInWorkspace(state.workspace, panelId);
123
+ const toolDefinition = toolCatalog.getDefinition(toolId);
124
+ if (!targetPanel || !toolDefinition) {
125
+ return state;
126
+ }
127
+ const existingPlacement = findToolPlacementByToolId(state.workspace, toolId);
128
+ if (toolDefinition.openingPolicy.mode === 'singleton-global' && existingPlacement &&
129
+ findWindowContainingPanel(state.workspace, existingPlacement.panelId)?.id ===
130
+ findWindowContainingPanel(state.workspace, panelId)?.id) {
131
+ return focusPanel(state, existingPlacement.panelId);
132
+ }
133
+ const visibleState = focusPanel(state, panelId);
134
+ const containingStack = findStackContainingPanelInWorkspace(visibleState.workspace, panelId);
135
+ if (!containingStack) {
136
+ return state;
137
+ }
138
+ const panel = createPanel('New panel');
139
+ const nextWorkspace = updateActiveWindowRoot(visibleState.workspace, (root) => updateStackById(root, containingStack.id, (stack) => ({
140
+ ...stack,
141
+ activeChildId: panel.id,
142
+ children: [...stack.children, panel]
143
+ })));
144
+ // Explicit addition targets this window. Reuse a remote singleton rather
145
+ // than focusing a logical window whose browser tab may no longer exist.
146
+ const openToolResult = openTool(nextWorkspace, { panelId: panel.id, toolId, singletonPlacement: 'move-to-panel' }, toolCatalog);
147
+ return createWorkspaceSessionState(openToolResult.workspace, {
148
+ activePanelId: openToolResult.panelId ?? panel.id
149
+ });
150
+ }
151
+ function splitFocusedPanel(state, orientation) {
152
+ return splitPanelToSide(state, orientation, orientation === 'horizontal' ? 'right' : 'bottom');
153
+ }
154
+ function splitPanelToSide(state, orientation, side, panelId = null) {
155
+ const focusedPanel = getFocusedPanel(state);
156
+ const targetPanelId = panelId ?? focusedPanel?.id ?? null;
157
+ if (!targetPanelId) {
158
+ return state;
159
+ }
160
+ const baseWorkspace = ensurePanelVisible(state.workspace, targetPanelId);
161
+ const previousPanelIds = new Set(listPanelsInWorkspace(baseWorkspace).map((panel) => panel.id));
162
+ const nextWorkspace = splitPanel(baseWorkspace, { panelId: targetPanelId, orientation, side });
163
+ const newPanel = listPanelsInWorkspace(nextWorkspace).find((panel) => !previousPanelIds.has(panel.id));
164
+ return createWorkspaceSessionState(nextWorkspace, { activePanelId: newPanel?.id ?? targetPanelId });
165
+ }
166
+ function closeFocusedPanel(state) {
167
+ const focusedPanel = getFocusedPanel(state);
168
+ if (!focusedPanel) {
169
+ return state;
170
+ }
171
+ return closePanelById(state, focusedPanel.id);
172
+ }
173
+ function closePanelById(state, panelId) {
174
+ const sourceStack = findStackContainingPanelInWorkspace(state.workspace, panelId);
175
+ if (!sourceStack) {
176
+ return state;
177
+ }
178
+ const nextWorkspace = closePanel(state.workspace, { panelId });
179
+ const survivingStack = findStackInWorkspace(nextWorkspace, sourceStack.id);
180
+ const nextFocusedPanelId = state.focus.activePanelId === panelId
181
+ ? (survivingStack?.activeChildId ?? getPreferredFocusedPanelId(nextWorkspace))
182
+ : state.focus.activePanelId;
183
+ return createWorkspaceSessionState(nextWorkspace, { activePanelId: nextFocusedPanelId ?? null });
184
+ }
185
+ function detachPanelFromCommand(state, panelId) {
186
+ const result = detachPanelToWindow(state.workspace, { panelId });
187
+ if (!result) {
188
+ return state;
189
+ }
190
+ const nextFocusedPanelId = state.focus.activePanelId === panelId
191
+ ? getPreferredFocusedPanelId(result.workspace)
192
+ : state.focus.activePanelId;
193
+ return createWorkspaceSessionState(result.workspace, { activePanelId: nextFocusedPanelId ?? null });
194
+ }
195
+ function joinPanelAreaFromCommand(state, panelId, edge) {
196
+ const side = edge;
197
+ const nextWorkspace = joinPanelArea(state.workspace, { panelId, edge, side });
198
+ const nextFocusedPanelId = findPanelInWorkspace(nextWorkspace, panelId)?.id ??
199
+ getPreferredFocusedPanelId(nextWorkspace) ??
200
+ state.focus.activePanelId;
201
+ return createWorkspaceSessionState(nextWorkspace, { activePanelId: nextFocusedPanelId ?? null });
202
+ }
203
+ function swapPanelAreaFromCommand(state, panelId, edge) {
204
+ const nextWorkspace = swapPanelArea(state.workspace, { panelId, edge });
205
+ const nextFocusedPanelId = findPanelInWorkspace(nextWorkspace, panelId)?.id ??
206
+ getPreferredFocusedPanelId(nextWorkspace) ??
207
+ state.focus.activePanelId;
208
+ return createWorkspaceSessionState(nextWorkspace, { activePanelId: nextFocusedPanelId ?? null });
209
+ }
210
+ function ensurePanelVisible(workspace, panelId) {
211
+ const containingStack = findStackContainingPanelInWorkspace(workspace, panelId);
212
+ if (!containingStack || containingStack.activeChildId === panelId) {
213
+ return workspace;
214
+ }
215
+ return setActiveStackChild(workspace, { stackId: containingStack.id, panelId });
216
+ }
@@ -0,0 +1,14 @@
1
+ import type { Workspace } from "../../domain/workspace/model.js";
2
+ interface CreatePeripheralBandsInput {
3
+ windowId?: string;
4
+ left?: number;
5
+ right?: number;
6
+ top?: number;
7
+ bottom?: number;
8
+ }
9
+ export interface CreatePeripheralBandsResult {
10
+ workspace: Workspace;
11
+ createdPanelIds: string[];
12
+ }
13
+ export declare function createPeripheralBands(workspace: Workspace, input: CreatePeripheralBandsInput): CreatePeripheralBandsResult;
14
+ export {};
@@ -0,0 +1,62 @@
1
+ import { createPanel, createSplit, createStack } from "../../domain/workspace/factories.js";
2
+ import { canonicalizeLayout } from "./canonicalizeLayout.js";
3
+ import { updateActiveWindowRoot } from "./layoutTree.js";
4
+ const MIN_BAND_RATIO = 0.14;
5
+ const MAX_BAND_RATIO = 0.42;
6
+ function clampBandRatio(value) {
7
+ return Math.max(MIN_BAND_RATIO, Math.min(MAX_BAND_RATIO, Number(value.toFixed(4))));
8
+ }
9
+ export function createPeripheralBands(workspace, input) {
10
+ const createdPanelIds = [];
11
+ const orderedBands = resolveOrderedBands(input);
12
+ const targetWindowId = input.windowId ?? workspace.activeWindowId;
13
+ if (orderedBands.length === 0 || !workspace.windows.some((window) => window.id === targetWindowId)) {
14
+ return {
15
+ workspace,
16
+ createdPanelIds
17
+ };
18
+ }
19
+ const targetWorkspace = targetWindowId === workspace.activeWindowId
20
+ ? workspace : { ...workspace, activeWindowId: targetWindowId };
21
+ const nextWorkspace = updateActiveWindowRoot(targetWorkspace, (root) => {
22
+ let nextRoot = root;
23
+ for (const band of orderedBands) {
24
+ const panel = createPanel('New panel');
25
+ createdPanelIds.push(panel.id);
26
+ nextRoot = wrapRootWithPeripheralBand(nextRoot, band.edge, band.ratio, createStack([panel]));
27
+ }
28
+ return canonicalizeLayout(nextRoot);
29
+ });
30
+ return {
31
+ workspace: nextWorkspace,
32
+ createdPanelIds
33
+ };
34
+ }
35
+ function resolveOrderedBands(input) {
36
+ const bands = [];
37
+ if (typeof input.left === 'number') {
38
+ bands.push({ edge: 'left', ratio: clampBandRatio(input.left) });
39
+ }
40
+ if (typeof input.right === 'number') {
41
+ bands.push({ edge: 'right', ratio: clampBandRatio(input.right) });
42
+ }
43
+ if (typeof input.top === 'number') {
44
+ bands.push({ edge: 'top', ratio: clampBandRatio(input.top) });
45
+ }
46
+ if (typeof input.bottom === 'number') {
47
+ bands.push({ edge: 'bottom', ratio: clampBandRatio(input.bottom) });
48
+ }
49
+ // Columns first, then rows, so corner pulls yield a top/bottom band spanning
50
+ // the full width while left/right bands occupy the remaining height.
51
+ return bands.sort((leftBand, rightBand) => getBandPriority(leftBand.edge) - getBandPriority(rightBand.edge));
52
+ }
53
+ function getBandPriority(edge) {
54
+ return edge === 'left' || edge === 'right' ? 0 : 1;
55
+ }
56
+ function wrapRootWithPeripheralBand(root, edge, ratio, bandStack) {
57
+ const orientation = edge === 'left' || edge === 'right' ? 'horizontal' : 'vertical';
58
+ if (edge === 'left' || edge === 'top') {
59
+ return createSplit(orientation, [bandStack, root], [ratio, 1 - ratio]);
60
+ }
61
+ return createSplit(orientation, [root, bandStack], [1 - ratio, ratio]);
62
+ }
@@ -0,0 +1,7 @@
1
+ import type { ToolCatalogPort } from "../../domain/tool/model.js";
2
+ import type { Workspace } from "../../domain/workspace/model.js";
3
+ interface CreateWorkspaceOptions {
4
+ initialToolId?: string;
5
+ }
6
+ export declare function createWorkspace(toolCatalog?: ToolCatalogPort, options?: CreateWorkspaceOptions): Workspace;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { createPanel, createStack, createWorkspaceShell, createWorkspaceWindow } from "../../domain/workspace/factories.js";
2
+ import { openTool } from "./openTool.js";
3
+ export function createWorkspace(toolCatalog, options = {}) {
4
+ const initialPanel = createPanel('Welcome');
5
+ const initialStack = createStack([initialPanel]);
6
+ const initialWindow = createWorkspaceWindow(initialStack);
7
+ const workspace = createWorkspaceShell(initialWindow);
8
+ if (!options.initialToolId || !toolCatalog) {
9
+ return workspace;
10
+ }
11
+ return openTool(workspace, { panelId: initialPanel.id, toolId: options.initialToolId }, toolCatalog).workspace;
12
+ }
@@ -0,0 +1,12 @@
1
+ import type { Workspace } from "../../domain/workspace/model.js";
2
+ export interface DetachPanelToWindowInput {
3
+ panelId: string;
4
+ }
5
+ export interface DetachPanelToWindowResult {
6
+ workspace: Workspace;
7
+ panelId: string;
8
+ sourceWindowId: string;
9
+ sourceStackId: string;
10
+ windowId: string;
11
+ }
12
+ export declare function detachPanelToWindow(workspace: Workspace, input: DetachPanelToWindowInput): DetachPanelToWindowResult | null;
@@ -0,0 +1,57 @@
1
+ import { createStack, createWorkspaceWindow } from "../../domain/workspace/factories.js";
2
+ import { canonicalizeLayout } from "./canonicalizeLayout.js";
3
+ import { findPanelPathById, replaceNodeAtPathAllowingRemoval } from "./layoutTree.js";
4
+ export function detachPanelToWindow(workspace, input) {
5
+ for (const sourceWindow of workspace.windows) {
6
+ const panelPath = findPanelPathById(sourceWindow.root, input.panelId);
7
+ if (!panelPath) {
8
+ continue;
9
+ }
10
+ const nextSourceRoot = replaceNodeAtPathAllowingRemoval(sourceWindow.root, panelPath.trail, removePanelFromStack(panelPath.stack, input.panelId)) ?? createStack();
11
+ const detachedWindow = createWorkspaceWindow(createStack([panelPath.panel]), panelPath.panel.title);
12
+ const nextWorkspace = {
13
+ ...workspace,
14
+ activeWindowId: sourceWindow.id,
15
+ fullscreenPanelId: workspace.fullscreenPanelId === input.panelId ? null : workspace.fullscreenPanelId ?? null,
16
+ windows: [
17
+ ...workspace.windows.map((window) => window.id === sourceWindow.id
18
+ ? {
19
+ ...window,
20
+ root: canonicalizeLayout(nextSourceRoot)
21
+ }
22
+ : window),
23
+ detachedWindow
24
+ ]
25
+ };
26
+ return {
27
+ workspace: nextWorkspace,
28
+ panelId: panelPath.panel.id,
29
+ sourceWindowId: sourceWindow.id,
30
+ sourceStackId: panelPath.stack.id,
31
+ windowId: detachedWindow.id
32
+ };
33
+ }
34
+ return null;
35
+ }
36
+ function removePanelFromStack(stack, panelId) {
37
+ const removedPanelIndex = stack.children.findIndex((panel) => panel.id === panelId);
38
+ if (removedPanelIndex === -1) {
39
+ return stack;
40
+ }
41
+ const nextChildren = stack.children.filter((panel) => panel.id !== panelId);
42
+ if (nextChildren.length === 0) {
43
+ return null;
44
+ }
45
+ const normalizedChildren = nextChildren;
46
+ return {
47
+ ...stack,
48
+ children: normalizedChildren,
49
+ activeChildId: selectActivePanelAfterDetach(stack, panelId, removedPanelIndex, normalizedChildren)
50
+ };
51
+ }
52
+ function selectActivePanelAfterDetach(stack, panelId, removedPanelIndex, nextChildren) {
53
+ if (stack.activeChildId !== panelId) {
54
+ return stack.activeChildId;
55
+ }
56
+ return stack.children[removedPanelIndex - 1]?.id ?? nextChildren[0].id;
57
+ }
@@ -0,0 +1,10 @@
1
+ import type { LayoutDockPlacement, LayoutDockSide, LayoutDockTarget } from "../../domain/layout/interaction.js";
2
+ import type { Workspace } from "../../domain/workspace/model.js";
3
+ export interface DockPanelInput {
4
+ panelId: string;
5
+ target: LayoutDockTarget;
6
+ }
7
+ export declare function dockPanel(workspace: Workspace, input: DockPanelInput): Workspace;
8
+ export declare function createStackDockTarget(stackId: string, placement: LayoutDockPlacement, tabIndex?: number | null): LayoutDockTarget;
9
+ export declare function createWorkspaceEdgeDockTarget(side: LayoutDockSide): LayoutDockTarget;
10
+ export declare function isEdgeDockPlacement(placement: LayoutDockPlacement): placement is LayoutDockSide;