@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,207 @@
1
+ import type { JsonObject } from "../shared/json.js";
2
+ import type { KonitifToolCapabilities } from '@konitif/core';
3
+ import type { WorkbenchIconInput } from "../icon/model.js";
4
+ import type { ShellRegionId } from "../shell/model.js";
5
+ import type { WorkbenchReadingLevel, WorkbenchReadingLevelPresentation } from "../presentation/readingLevel.js";
6
+ export type ToolOpeningPolicy = {
7
+ mode: 'singleton-global';
8
+ onOpen: 'focus-existing';
9
+ } | {
10
+ mode: 'multi-instance';
11
+ };
12
+ export type ToolPanelSplitPolicy = {
13
+ mode: 'fresh-instance';
14
+ } | {
15
+ mode: 'clone-serializable-state';
16
+ } | {
17
+ mode: 'share-instance';
18
+ } | {
19
+ mode: 'custom';
20
+ };
21
+ export type ToolShellStatusTone = 'neutral' | 'attention' | 'success';
22
+ export interface ToolShellStatus {
23
+ label: string;
24
+ tone?: ToolShellStatusTone;
25
+ }
26
+ export interface ToolPanelLoadingState {
27
+ label: string;
28
+ detail?: string;
29
+ }
30
+ export interface ToolResourceLoadingState {
31
+ label: string;
32
+ detail?: string;
33
+ /**
34
+ * Normalized progress ratio in the [0, 1] range.
35
+ * `null` or `undefined` means indeterminate.
36
+ */
37
+ progress?: number | null;
38
+ }
39
+ export interface ToolShellState {
40
+ status: ToolShellStatus | null;
41
+ /** Optional user override persisted for this Tool instance only. */
42
+ readingLevel?: WorkbenchReadingLevel;
43
+ }
44
+ export interface ToolShellCommand {
45
+ id: string;
46
+ title: string;
47
+ description: string;
48
+ keywords?: string[];
49
+ }
50
+ export interface ToolShellHeaderActionLabelContext {
51
+ command: ToolShellCommand;
52
+ definition: ToolDefinition;
53
+ instance: ToolInstance;
54
+ }
55
+ export interface ToolShellHeaderAction {
56
+ commandId: string;
57
+ label: string;
58
+ icon?: WorkbenchIconInput;
59
+ group?: 'tool' | 'dock';
60
+ frequency?: 'common' | 'advanced' | 'debug';
61
+ headerButton?: boolean;
62
+ labelTranslationKey?: string;
63
+ resolveLabel?(context: ToolShellHeaderActionLabelContext): string;
64
+ resolveLabelTranslationKey?(context: ToolShellHeaderActionLabelContext): string | null;
65
+ resolveActive?(context: ToolShellHeaderActionLabelContext): boolean;
66
+ children?: ToolShellHeaderAction[];
67
+ }
68
+ export interface ToolShellWidgetDock {
69
+ commandId: string;
70
+ dockId: string;
71
+ title: string;
72
+ icon?: WorkbenchIconInput;
73
+ defaultRegionId: ShellRegionId;
74
+ defaultVisible?: boolean;
75
+ legacyVisibleKey?: string | null;
76
+ rootWidgetId?: string | null;
77
+ showLabel?: string;
78
+ hideLabel?: string;
79
+ showTranslationKey?: string;
80
+ hideTranslationKey?: string;
81
+ }
82
+ export interface ToolShellCommandContext {
83
+ commandId: string;
84
+ definition: ToolDefinition;
85
+ instance: ToolInstance;
86
+ }
87
+ export interface ToolShellCommandResult {
88
+ nextState?: JsonObject;
89
+ nextPanelTitleOverride?: string | null;
90
+ nextStatus?: ToolShellStatus | null;
91
+ }
92
+ export interface ToolShellContributionDefinition {
93
+ initialStatus?: ToolShellStatus | null;
94
+ /**
95
+ * Selects the single surface responsible for rendering the Tool status.
96
+ * The panel chrome remains the compatibility default; Tools that already
97
+ * expose the status in their own header must opt into `tool-header` to avoid
98
+ * projecting the same information twice.
99
+ */
100
+ statusPlacement?: 'panel-chrome' | 'tool-header';
101
+ commands?: ToolShellCommand[];
102
+ headerActions?: ToolShellHeaderAction[];
103
+ widgetDocks?: ToolShellWidgetDock[];
104
+ executeCommand?(context: ToolShellCommandContext): ToolShellCommandResult | null;
105
+ }
106
+ export type ToolFullscreenCompanionPlacement = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
107
+ export interface ToolFullscreenCompanionSize {
108
+ width: number;
109
+ height: number;
110
+ }
111
+ export interface ToolFullscreenCompanionChromePolicy {
112
+ header?: boolean;
113
+ menu?: boolean;
114
+ fullscreen?: boolean;
115
+ dockButtons?: boolean;
116
+ }
117
+ export interface ToolFullscreenCompanionBehaviorPolicy {
118
+ pinned?: boolean;
119
+ draggable?: boolean;
120
+ collapsible?: boolean;
121
+ passthroughWhenCollapsed?: boolean;
122
+ }
123
+ export interface ToolFullscreenCompanionActivationPolicy {
124
+ sourceStateKey: string;
125
+ defaultEnabled?: boolean;
126
+ }
127
+ export interface ToolFullscreenCompanionDefinition {
128
+ id: string;
129
+ toolId: string;
130
+ mode: string;
131
+ sourceStateKeys?: string[];
132
+ placement: ToolFullscreenCompanionPlacement;
133
+ size: ToolFullscreenCompanionSize;
134
+ chrome?: ToolFullscreenCompanionChromePolicy;
135
+ behavior?: ToolFullscreenCompanionBehaviorPolicy;
136
+ activation?: ToolFullscreenCompanionActivationPolicy;
137
+ }
138
+ export interface ToolDefinition {
139
+ id: string;
140
+ title: string;
141
+ icon?: WorkbenchIconInput;
142
+ /**
143
+ * Default panel title applied when a tool is opened into a panel.
144
+ */
145
+ panelTitle: string;
146
+ description: string;
147
+ keywords?: string[];
148
+ openingPolicy: ToolOpeningPolicy;
149
+ /**
150
+ * Versioned capabilities supplied and consumed by the Tool.
151
+ * The Workbench resolves these declarations against its registered catalog and
152
+ * projects availability to the hosted Tool without exposing neighboring state.
153
+ */
154
+ capabilities?: KonitifToolCapabilities;
155
+ /**
156
+ * Future-facing split semantics:
157
+ * - `fresh-instance`: create a brand new tool instance in the new panel
158
+ * - `clone-serializable-state`: duplicate from current serializable state into a new instance
159
+ * - `share-instance`: point both panels at the same tool instance
160
+ * - `custom`: reserved for tool-specific logic later
161
+ *
162
+ * Current workbench behavior still preserves the existing panel/tool instance during layout reorganizations,
163
+ * and does not yet automatically duplicate tools on split.
164
+ */
165
+ panelSplitPolicy?: ToolPanelSplitPolicy;
166
+ /** Generic shell presentation preferences declared by the hosted tool. */
167
+ panelPresentation?: {
168
+ immersiveWhenTabsHidden?: boolean;
169
+ /** Optional shared Casual / Advanced / Expert projection contract. */
170
+ readingLevel?: WorkbenchReadingLevelPresentation;
171
+ };
172
+ /**
173
+ * Serializable default instance state used when creating a new tool instance.
174
+ */
175
+ initialState: JsonObject;
176
+ /**
177
+ * Optional shell-facing contribution surface resolved by the workbench.
178
+ */
179
+ shell?: ToolShellContributionDefinition;
180
+ /**
181
+ * Optional companion tools rendered by the shell when this tool owns a fullscreen panel.
182
+ * The fullscreen tool declares the companion relationship; the companion tool provides a
183
+ * mode-specific projection through its normal component surface.
184
+ */
185
+ fullscreenCompanions?: ToolFullscreenCompanionDefinition[];
186
+ }
187
+ export interface ToolInstance {
188
+ id: string;
189
+ toolId: string;
190
+ /**
191
+ * Serializable instance state owned by the workspace snapshot.
192
+ */
193
+ state: JsonObject;
194
+ /**
195
+ * Optional serializable title override requested by the hosted tool runtime.
196
+ * `null` means "use the ToolDefinition.panelTitle default".
197
+ */
198
+ panelTitleOverride: string | null;
199
+ /**
200
+ * Optional serializable shell-facing state controlled through the tool runtime.
201
+ */
202
+ shellState?: ToolShellState;
203
+ }
204
+ export interface ToolCatalogPort {
205
+ getDefinition(toolId: string): ToolDefinition | undefined;
206
+ }
207
+ export type ToolCatalog = ToolCatalogPort;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,122 @@
1
+ import type { JsonObject } from "../shared/json.js";
2
+ import type { KonitifToolConsumedCapability } from '@konitif/core';
3
+ import type { WorkbenchRuntimeProjectionSessionPatch } from "../runtime/model.js";
4
+ import type { WorkbenchReadingLevel } from "../presentation/readingLevel.js";
5
+ import type { ToolDefinition, ToolInstance, ToolPanelLoadingState, ToolResourceLoadingState, ToolShellStatus } from "./model.js";
6
+ export * from "./shell.js";
7
+ export interface ToolRuntimeSessionInfo {
8
+ activePanelId: string | null;
9
+ activeToolInstanceId: string | null;
10
+ isActivePanel: boolean;
11
+ isActiveToolInstance: boolean;
12
+ layoutEditingEnabled: boolean;
13
+ }
14
+ export type ToolRuntimeCapabilityAvailability = 'missing' | 'incompatible' | 'available' | 'mounted' | 'active';
15
+ export interface ToolRuntimeCapabilityProvider {
16
+ toolId: string;
17
+ capabilityVersion: string;
18
+ toolVersion: string | null;
19
+ availability: 'available' | 'mounted' | 'active';
20
+ panelIds: readonly string[];
21
+ toolInstanceIds: readonly string[];
22
+ }
23
+ export interface ToolRuntimeCapabilityProjection {
24
+ requirement: Readonly<KonitifToolConsumedCapability>;
25
+ availability: ToolRuntimeCapabilityAvailability;
26
+ providers: readonly ToolRuntimeCapabilityProvider[];
27
+ }
28
+ export interface ToolRuntimeCapabilitySnapshot {
29
+ list(): readonly ToolRuntimeCapabilityProjection[];
30
+ get(capabilityId: string): ToolRuntimeCapabilityProjection | null;
31
+ }
32
+ export interface ToolRuntimeCapabilityAccess extends ToolRuntimeCapabilitySnapshot {
33
+ /** Ask the shell to focus an existing compatible provider or open one. */
34
+ request(capabilityId: string): boolean;
35
+ }
36
+ export interface ToolRuntimeContext {
37
+ /**
38
+ * Stable identity for the currently hosted tool instance.
39
+ */
40
+ toolInstanceId: string;
41
+ /**
42
+ * Stable identity for the panel currently hosting the tool.
43
+ */
44
+ panelId: string;
45
+ /** Shell-owned reading projection for the hosted Tool. */
46
+ readingLevel: WorkbenchReadingLevel;
47
+ /**
48
+ * Readonly session/focus snapshot for the current render.
49
+ */
50
+ session: Readonly<ToolRuntimeSessionInfo>;
51
+ /** Shell-owned, readonly projection of the capabilities declared by this Tool. */
52
+ capabilities: ToolRuntimeCapabilityAccess;
53
+ /**
54
+ * Replace the tool's serializable state snapshot.
55
+ * Returns `false` when the payload is rejected.
56
+ */
57
+ setState(nextState: JsonObject): boolean;
58
+ /**
59
+ * Override the displayed panel title. Pass `null` to restore the definition default.
60
+ * Returns `false` when the target panel or instance can no longer be resolved.
61
+ */
62
+ setPanelTitleOverride(nextTitle: string | null): boolean;
63
+ /**
64
+ * Update the tool's serializable shell status contribution. Pass `null` to clear it.
65
+ * Returns `false` when the target instance can no longer be resolved.
66
+ */
67
+ setShellStatus(nextStatus: ToolShellStatus | null): boolean;
68
+ /**
69
+ * Update the panel-scoped loading overlay controlled by the hosted tool.
70
+ * Returns `false` when the target instance can no longer be resolved.
71
+ */
72
+ setPanelLoading(nextLoading: ToolPanelLoadingState | null): boolean;
73
+ /**
74
+ * Update the top docked resource loading indicator controlled by the hosted tool.
75
+ * Returns `false` when the target instance can no longer be resolved.
76
+ */
77
+ setResourceLoading(nextLoading: ToolResourceLoadingState | null): boolean;
78
+ /**
79
+ * Publish session-level projection metadata such as selected/focused entities.
80
+ * Returns `false` when the host does not expose a projection session bridge.
81
+ */
82
+ publishRuntimeProjectionSession(patch: WorkbenchRuntimeProjectionSessionPatch): boolean;
83
+ /**
84
+ * Execute a registered shell command against the current tool instance.
85
+ * Returns `false` when the command cannot be resolved or does not change state.
86
+ */
87
+ runCommand(commandId: string): boolean;
88
+ /**
89
+ * Ask the workspace host to open or focus a registered tool.
90
+ * Returns `false` when the tool cannot be resolved or workspace state is unchanged.
91
+ */
92
+ openTool(toolId: string): boolean;
93
+ /**
94
+ * Returns whether the global app history currently exposes an undo step.
95
+ */
96
+ canUndoHistory(): boolean;
97
+ /**
98
+ * Returns whether the global app history currently exposes a redo step.
99
+ */
100
+ canRedoHistory(): boolean;
101
+ /**
102
+ * Undo the last app-scoped workspace mutation.
103
+ * Returns `false` when no history step is available.
104
+ */
105
+ undoHistory(): boolean;
106
+ /**
107
+ * Redo the last reverted app-scoped workspace mutation.
108
+ * Returns `false` when no history step is available.
109
+ */
110
+ redoHistory(): boolean;
111
+ }
112
+ /**
113
+ * Lifecycle boundaries for hosted tools:
114
+ * - mount: the tool component is instantiated by ToolHost for a resolved panel/tool pair
115
+ * - restore: serialized ToolInstance.state is provided as normal props on mount; there is no separate hydrate hook
116
+ * - unmount: the component is removed when the host panel closes, changes tool instance, or leaves the tree
117
+ */
118
+ export interface HostedToolProps {
119
+ definition: ToolDefinition;
120
+ instance: ToolInstance;
121
+ runtime: ToolRuntimeContext;
122
+ }
@@ -0,0 +1,2 @@
1
+ // Compatibility facade: shell helpers have one implementation, independent of runtime services.
2
+ export * from "./shell.js";
@@ -0,0 +1,38 @@
1
+ import { type WorkbenchReadingLevel } from "../presentation/readingLevel.js";
2
+ import type { WorkbenchIconInput } from "../icon/model.js";
3
+ import type { ToolDefinition, ToolInstance, ToolPanelLoadingState, ToolResourceLoadingState, ToolShellCommand, ToolShellWidgetDock, ToolShellState, ToolShellStatus } from "./model.js";
4
+ export declare function normalizePanelTitleOverride(value: string | null): string | null;
5
+ export declare function normalizeToolShellStatus(value: unknown): ToolShellStatus | null;
6
+ export declare function normalizeToolPanelLoadingState(value: ToolPanelLoadingState | null | undefined): ToolPanelLoadingState | null;
7
+ export declare function normalizeToolResourceLoadingState(value: ToolResourceLoadingState | null | undefined): ToolResourceLoadingState | null;
8
+ export declare function createInitialToolShellState(definition: ToolDefinition): ToolShellState;
9
+ export declare const TOOL_READING_LEVEL_MENU_COMMAND_ID = "workbench.tool.reading-level";
10
+ export declare const CYCLE_TOOL_READING_LEVEL_COMMAND_ID = "workbench.tool.reading-level.cycle";
11
+ export declare const INHERIT_TOOL_READING_LEVEL_COMMAND_ID = "workbench.tool.reading-level.inherit";
12
+ export declare const SET_TOOL_READING_LEVEL_CASUAL_COMMAND_ID = "workbench.tool.reading-level.casual";
13
+ export declare const SET_TOOL_READING_LEVEL_ADVANCED_COMMAND_ID = "workbench.tool.reading-level.advanced";
14
+ export declare const SET_TOOL_READING_LEVEL_EXPERT_COMMAND_ID = "workbench.tool.reading-level.expert";
15
+ export declare function resolveToolReadingLevel(definition: ToolDefinition, instance: ToolInstance, inheritedDefault?: WorkbenchReadingLevel): WorkbenchReadingLevel;
16
+ export declare function resolvePanelTitle(definition: ToolDefinition, instance: ToolInstance): string;
17
+ export interface ResolvedToolShellHeaderAction {
18
+ commandId: string;
19
+ label: string;
20
+ icon?: WorkbenchIconInput;
21
+ group: 'tool' | 'dock';
22
+ frequency?: 'common' | 'advanced' | 'debug';
23
+ headerButton?: boolean;
24
+ active?: boolean;
25
+ labelTranslationKey?: string;
26
+ title: string;
27
+ description: string;
28
+ keywords?: string[];
29
+ children?: ResolvedToolShellHeaderAction[];
30
+ }
31
+ export interface ResolvedToolShellContribution {
32
+ status: ToolShellStatus | null;
33
+ statusPlacement: 'panel-chrome' | 'tool-header';
34
+ commands: ToolShellCommand[];
35
+ headerActions: ResolvedToolShellHeaderAction[];
36
+ widgetDocks: ToolShellWidgetDock[];
37
+ }
38
+ export declare function resolveToolShellContribution(definition: ToolDefinition, instance: ToolInstance, inheritedReadingLevel?: WorkbenchReadingLevel): ResolvedToolShellContribution;
@@ -0,0 +1,175 @@
1
+ import { normalizeWorkbenchReadingLevels, resolveWorkbenchReadingLevel } from "../presentation/readingLevel.js";
2
+ export function normalizePanelTitleOverride(value) {
3
+ if (value === null) {
4
+ return null;
5
+ }
6
+ const normalizedValue = value.trim();
7
+ return normalizedValue.length > 0 ? normalizedValue : null;
8
+ }
9
+ export function normalizeToolShellStatus(value) {
10
+ if (value === null || typeof value !== 'object') {
11
+ return null;
12
+ }
13
+ const candidate = value;
14
+ if (typeof candidate.label !== 'string') {
15
+ return null;
16
+ }
17
+ const label = candidate.label.trim();
18
+ if (label.length === 0) {
19
+ return null;
20
+ }
21
+ const tone = candidate.tone ?? 'neutral';
22
+ return {
23
+ label,
24
+ tone: tone === 'attention' || tone === 'success' ? tone : 'neutral'
25
+ };
26
+ }
27
+ export function normalizeToolPanelLoadingState(value) {
28
+ if (!value) {
29
+ return null;
30
+ }
31
+ const label = value.label.trim();
32
+ if (label.length === 0) {
33
+ return null;
34
+ }
35
+ const detail = value.detail?.trim();
36
+ return detail
37
+ ? {
38
+ label,
39
+ detail
40
+ }
41
+ : {
42
+ label
43
+ };
44
+ }
45
+ export function normalizeToolResourceLoadingState(value) {
46
+ if (!value) {
47
+ return null;
48
+ }
49
+ const label = value.label.trim();
50
+ if (label.length === 0) {
51
+ return null;
52
+ }
53
+ const detail = value.detail?.trim();
54
+ const rawProgress = value.progress;
55
+ const progress = typeof rawProgress === 'number' && Number.isFinite(rawProgress)
56
+ ? Math.max(0, Math.min(rawProgress, 1))
57
+ : null;
58
+ return {
59
+ label,
60
+ ...(detail ? { detail } : {}),
61
+ ...(progress === null ? {} : { progress })
62
+ };
63
+ }
64
+ export function createInitialToolShellState(definition) {
65
+ return {
66
+ status: normalizeToolShellStatus(definition.shell?.initialStatus)
67
+ };
68
+ }
69
+ export const TOOL_READING_LEVEL_MENU_COMMAND_ID = 'workbench.tool.reading-level';
70
+ export const CYCLE_TOOL_READING_LEVEL_COMMAND_ID = 'workbench.tool.reading-level.cycle';
71
+ export const INHERIT_TOOL_READING_LEVEL_COMMAND_ID = 'workbench.tool.reading-level.inherit';
72
+ export const SET_TOOL_READING_LEVEL_CASUAL_COMMAND_ID = 'workbench.tool.reading-level.casual';
73
+ export const SET_TOOL_READING_LEVEL_ADVANCED_COMMAND_ID = 'workbench.tool.reading-level.advanced';
74
+ export const SET_TOOL_READING_LEVEL_EXPERT_COMMAND_ID = 'workbench.tool.reading-level.expert';
75
+ export function resolveToolReadingLevel(definition, instance, inheritedDefault) {
76
+ return resolveWorkbenchReadingLevel(instance.shellState?.readingLevel, definition.panelPresentation?.readingLevel, inheritedDefault);
77
+ }
78
+ export function resolvePanelTitle(definition, instance) {
79
+ return normalizePanelTitleOverride(instance.panelTitleOverride) ?? definition.panelTitle;
80
+ }
81
+ export function resolveToolShellContribution(definition, instance, inheritedReadingLevel) {
82
+ const readingLevelPresentation = definition.panelPresentation?.readingLevel;
83
+ const availableReadingLevels = normalizeWorkbenchReadingLevels(readingLevelPresentation);
84
+ const readingLevel = resolveToolReadingLevel(definition, instance, inheritedReadingLevel);
85
+ const exposesReadingLevelChoice = availableReadingLevels.length > 1;
86
+ const readingCommands = exposesReadingLevelChoice
87
+ ? [
88
+ {
89
+ id: TOOL_READING_LEVEL_MENU_COMMAND_ID,
90
+ title: 'Reading level',
91
+ description: 'Cycle the Tool projection through its available reading levels.'
92
+ },
93
+ {
94
+ id: INHERIT_TOOL_READING_LEVEL_COMMAND_ID,
95
+ title: 'Use default reading level',
96
+ description: 'Remove the local override and use the Tool or shell default.'
97
+ },
98
+ ...availableReadingLevels.map((level) => ({
99
+ id: `workbench.tool.reading-level.${level}`,
100
+ title: `${level[0]?.toUpperCase()}${level.slice(1)} reading level`,
101
+ description: `Project this Tool at the ${level} reading level.`
102
+ }))
103
+ ]
104
+ : [];
105
+ const commands = [...(definition.shell?.commands ?? []), ...readingCommands];
106
+ const commandsById = new Map(commands.map((command) => [command.id, command]));
107
+ const resolveHeaderAction = (action) => {
108
+ const command = commandsById.get(action.commandId);
109
+ if (!command) {
110
+ return null;
111
+ }
112
+ const children = (action.children ?? []).flatMap((child) => {
113
+ const resolvedChild = resolveHeaderAction(child);
114
+ return resolvedChild ? [resolvedChild] : [];
115
+ });
116
+ const active = action.resolveActive?.({ command, definition, instance }) ?? false;
117
+ return {
118
+ commandId: action.commandId,
119
+ label: action.resolveLabel?.({ command, definition, instance }) || action.label,
120
+ icon: action.icon,
121
+ group: action.group ?? 'tool',
122
+ frequency: action.frequency,
123
+ ...(action.headerButton ? { headerButton: true } : {}),
124
+ ...(active ? { active } : {}),
125
+ labelTranslationKey: action.resolveLabelTranslationKey?.({ command, definition, instance }) ?? action.labelTranslationKey,
126
+ title: command.title,
127
+ description: command.description,
128
+ keywords: command.keywords,
129
+ ...(children.length > 0 ? { children } : {})
130
+ };
131
+ };
132
+ const readingLevelAction = exposesReadingLevelChoice
133
+ ? [
134
+ {
135
+ commandId: TOOL_READING_LEVEL_MENU_COMMAND_ID,
136
+ label: 'Reading level',
137
+ labelTranslationKey: 'ui.shell.tool.readingLevel.label',
138
+ icon: 'action.settings',
139
+ group: 'tool',
140
+ frequency: 'advanced',
141
+ children: [
142
+ {
143
+ commandId: INHERIT_TOOL_READING_LEVEL_COMMAND_ID,
144
+ label: 'Use default',
145
+ labelTranslationKey: 'ui.shell.readingLevel.inherit',
146
+ group: 'tool',
147
+ frequency: 'advanced',
148
+ resolveActive: () => instance.shellState?.readingLevel === undefined
149
+ },
150
+ ...availableReadingLevels.map((level) => ({
151
+ commandId: `workbench.tool.reading-level.${level}`,
152
+ label: `${level[0]?.toUpperCase()}${level.slice(1)}`,
153
+ labelTranslationKey: `ui.shell.readingLevel.${level}`,
154
+ group: 'tool',
155
+ frequency: 'advanced',
156
+ resolveActive: () => instance.shellState?.readingLevel !== undefined && readingLevel === level
157
+ }))
158
+ ]
159
+ }
160
+ ]
161
+ : [];
162
+ const headerActions = [...(definition.shell?.headerActions ?? []), ...readingLevelAction].flatMap((action) => {
163
+ const resolvedAction = resolveHeaderAction(action);
164
+ return resolvedAction ? [resolvedAction] : [];
165
+ });
166
+ return {
167
+ status: instance.shellState
168
+ ? normalizeToolShellStatus(instance.shellState.status)
169
+ : normalizeToolShellStatus(definition.shell?.initialStatus),
170
+ statusPlacement: definition.shell?.statusPlacement ?? 'panel-chrome',
171
+ commands,
172
+ headerActions,
173
+ widgetDocks: (definition.shell?.widgetDocks ?? []).map((dock) => ({ ...dock }))
174
+ };
175
+ }
@@ -0,0 +1,79 @@
1
+ import type { WorkbenchIconInput } from "../icon/model.js";
2
+ import type { JsonObject } from "../shared/json.js";
3
+ export type WorkbenchWidgetZoneSurface = 'shell' | 'panel' | 'panel-header' | 'panel-footer' | 'side' | 'tool' | 'tool-dock';
4
+ export type WorkbenchWidgetZoneChrome = 'none' | 'header' | 'tabs';
5
+ export type WorkbenchWidgetZonePresentation = 'tabs' | 'stack';
6
+ export type WorkbenchWidgetZoneAxis = 'horizontal' | 'vertical';
7
+ export interface WorkbenchWidgetZoneDefinition {
8
+ id: string;
9
+ title: string;
10
+ surface: WorkbenchWidgetZoneSurface;
11
+ chrome?: WorkbenchWidgetZoneChrome;
12
+ /** How multiple placements are projected inside the zone. Defaults to tabs. */
13
+ presentation?: WorkbenchWidgetZonePresentation;
14
+ /** Ordering axis used by stacked zones and their drag/drop projection. */
15
+ axis?: WorkbenchWidgetZoneAxis;
16
+ icon?: WorkbenchIconInput;
17
+ description?: string;
18
+ }
19
+ export interface WorkbenchWidgetPlacement {
20
+ id: string;
21
+ widgetId: string;
22
+ zoneId: string;
23
+ title: string;
24
+ order?: number;
25
+ icon?: WorkbenchIconInput;
26
+ isVisible?: boolean;
27
+ isPinned?: boolean;
28
+ state?: JsonObject;
29
+ }
30
+ export interface WorkbenchWidgetZoneComposition {
31
+ zones: WorkbenchWidgetZoneDefinition[];
32
+ placements: WorkbenchWidgetPlacement[];
33
+ activePlacementByZoneId?: Record<string, string | null | undefined>;
34
+ }
35
+ export interface WorkbenchWidgetZoneLayoutState {
36
+ activePlacementId?: string | null;
37
+ placementOrder?: string[];
38
+ hiddenPlacementIds?: string[];
39
+ pinnedPlacementIds?: string[];
40
+ presentation?: WorkbenchWidgetZonePresentation;
41
+ axis?: WorkbenchWidgetZoneAxis;
42
+ }
43
+ export type WorkbenchWidgetZoneLayoutStateByZoneId = Record<string, WorkbenchWidgetZoneLayoutState | undefined>;
44
+ export interface WorkbenchWidgetPlacementMove {
45
+ placementId: string;
46
+ zoneId: string;
47
+ beforePlacementId?: string | null;
48
+ afterPlacementId?: string | null;
49
+ }
50
+ export interface ResolvedWorkbenchWidgetZone {
51
+ zone: WorkbenchWidgetZoneDefinition;
52
+ allPlacements: WorkbenchWidgetPlacement[];
53
+ placements: WorkbenchWidgetPlacement[];
54
+ activePlacement: WorkbenchWidgetPlacement | null;
55
+ }
56
+ export declare function resolveWorkbenchWidgetZone(composition: WorkbenchWidgetZoneComposition, zoneId: string): ResolvedWorkbenchWidgetZone | null;
57
+ export declare function listWorkbenchWidgetZonePlacements(composition: WorkbenchWidgetZoneComposition, zoneId: string, options?: {
58
+ includeHidden?: boolean;
59
+ }): WorkbenchWidgetPlacement[];
60
+ /**
61
+ * Returns the placements rendered by a zone without transferring placement
62
+ * authority to the host component. Tab zones project only the active entity;
63
+ * stack zones project every visible entity in canonical order.
64
+ */
65
+ export declare function listWorkbenchWidgetZoneRenderedPlacements(resolvedZone: ResolvedWorkbenchWidgetZone | null): WorkbenchWidgetPlacement[];
66
+ export declare function compareWorkbenchWidgetPlacements(left: WorkbenchWidgetPlacement, right: WorkbenchWidgetPlacement): number;
67
+ export declare function activateWorkbenchWidgetPlacement(composition: WorkbenchWidgetZoneComposition, zoneId: string, placementId: string): WorkbenchWidgetZoneComposition;
68
+ export declare function moveWorkbenchWidgetPlacement(composition: WorkbenchWidgetZoneComposition, move: WorkbenchWidgetPlacementMove): WorkbenchWidgetZoneComposition;
69
+ export declare function createWorkbenchWidgetZoneLayoutState(composition: WorkbenchWidgetZoneComposition, zoneId: string): WorkbenchWidgetZoneLayoutState;
70
+ export declare function applyWorkbenchWidgetZoneLayoutState(composition: WorkbenchWidgetZoneComposition, layoutStateByZoneId: WorkbenchWidgetZoneLayoutStateByZoneId): WorkbenchWidgetZoneComposition;
71
+ export declare function createWorkbenchWidgetZoneComposition(input: {
72
+ zone: WorkbenchWidgetZoneDefinition;
73
+ placements: WorkbenchWidgetPlacement[];
74
+ activePlacementId?: string | null;
75
+ }): WorkbenchWidgetZoneComposition;
76
+ export declare function createSingleWorkbenchWidgetZoneComposition(input: {
77
+ zone: WorkbenchWidgetZoneDefinition;
78
+ placement: WorkbenchWidgetPlacement;
79
+ }): WorkbenchWidgetZoneComposition;