@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,109 @@
1
+ const TEARDOWN_STEPS = [
2
+ { kind: 'stop-services', label: 'Stop services' },
3
+ { kind: 'dispose-managers', label: 'Dispose managers' },
4
+ { kind: 'terminate-workers', label: 'Terminate workers' },
5
+ { kind: 'unsubscribe-stores', label: 'Unsubscribe stores' },
6
+ { kind: 'flush-logs', label: 'Flush logs' },
7
+ { kind: 'persist-final-checkpoint', label: 'Persist final checkpoint' },
8
+ { kind: 'close-repo-handles', label: 'Close repository handles' },
9
+ { kind: 'return-launch-gate', label: 'Return launch gate' }
10
+ ];
11
+ export function createRuntimeTeardownSnapshot(timestamp = new Date().toISOString(), reason = 'User requested teardown.') {
12
+ const steps = TEARDOWN_STEPS.map((step) => ({
13
+ id: `teardown:${step.kind}`,
14
+ kind: step.kind,
15
+ label: step.label,
16
+ status: 'pending',
17
+ startedAt: null,
18
+ completedAt: null,
19
+ message: null
20
+ }));
21
+ const firstStep = steps[0] ?? null;
22
+ return {
23
+ status: 'running',
24
+ activeStepId: firstStep?.id ?? null,
25
+ progress: 0,
26
+ reason,
27
+ report: null,
28
+ steps: firstStep
29
+ ? steps.map((step) => step.id === firstStep.id ? { ...step, status: 'running', startedAt: timestamp } : step)
30
+ : steps,
31
+ startedAt: timestamp,
32
+ updatedAt: timestamp,
33
+ completedAt: null,
34
+ error: null
35
+ };
36
+ }
37
+ export function completeRuntimeTeardownStep(snapshot, stepId, timestamp = new Date().toISOString(), message = null) {
38
+ const steps = snapshot.steps.map((step) => step.id === stepId
39
+ ? {
40
+ ...step,
41
+ status: 'completed',
42
+ completedAt: timestamp,
43
+ message
44
+ }
45
+ : step);
46
+ const nextPendingStep = steps.find((step) => step.status === 'pending') ?? null;
47
+ const nextSteps = nextPendingStep
48
+ ? steps.map((step) => step.id === nextPendingStep.id
49
+ ? {
50
+ ...step,
51
+ status: 'running',
52
+ startedAt: timestamp
53
+ }
54
+ : step)
55
+ : steps;
56
+ const progress = calculateTeardownProgress(nextSteps);
57
+ const completed = progress >= 100;
58
+ const report = completed
59
+ ? createTeardownReport(snapshot.reason, nextSteps, timestamp, null)
60
+ : snapshot.report;
61
+ return {
62
+ ...snapshot,
63
+ status: completed ? 'completed' : 'running',
64
+ activeStepId: completed ? null : nextPendingStep?.id ?? null,
65
+ progress,
66
+ report,
67
+ steps: nextSteps,
68
+ updatedAt: timestamp,
69
+ completedAt: completed ? timestamp : null,
70
+ error: null
71
+ };
72
+ }
73
+ export function failRuntimeTeardownStep(snapshot, stepId, error, timestamp = new Date().toISOString()) {
74
+ const steps = snapshot.steps.map((step) => step.id === stepId
75
+ ? {
76
+ ...step,
77
+ status: 'failed',
78
+ completedAt: timestamp,
79
+ message: error
80
+ }
81
+ : step);
82
+ return {
83
+ ...snapshot,
84
+ status: 'failed',
85
+ activeStepId: null,
86
+ progress: calculateTeardownProgress(steps),
87
+ report: createTeardownReport(snapshot.reason, steps, timestamp, stepId),
88
+ steps,
89
+ updatedAt: timestamp,
90
+ completedAt: timestamp,
91
+ error
92
+ };
93
+ }
94
+ function createTeardownReport(reason, steps, timestamp, failedStepId) {
95
+ return {
96
+ id: `teardown-report:${timestamp}`,
97
+ createdAt: timestamp,
98
+ reason,
99
+ completedSteps: steps.filter((step) => step.status === 'completed').length,
100
+ failedStepId
101
+ };
102
+ }
103
+ function calculateTeardownProgress(steps) {
104
+ if (steps.length === 0) {
105
+ return 100;
106
+ }
107
+ const resolvedSteps = steps.filter((step) => step.status === 'completed').length;
108
+ return Math.round((resolvedSteps / steps.length) * 100);
109
+ }
@@ -0,0 +1 @@
1
+ export declare function createId(prefix: string): string;
@@ -0,0 +1,5 @@
1
+ let sequence = 0;
2
+ export function createId(prefix) {
3
+ sequence += 1;
4
+ return `${prefix}-${Date.now().toString(36)}-${sequence.toString(36)}`;
5
+ }
@@ -0,0 +1,9 @@
1
+ export type JsonPrimitive = string | number | boolean | null;
2
+ export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
3
+ export type JsonArray = JsonValue[];
4
+ export type JsonObject = {
5
+ [key: string]: JsonValue;
6
+ };
7
+ export declare function isJsonValue(value: unknown): value is JsonValue;
8
+ export declare function isJsonObject(value: unknown): value is JsonObject;
9
+ export declare function cloneJsonObject<T extends JsonObject>(value: T): T;
@@ -0,0 +1,24 @@
1
+ export function isJsonValue(value) {
2
+ if (value === null) {
3
+ return true;
4
+ }
5
+ switch (typeof value) {
6
+ case 'string':
7
+ case 'number':
8
+ case 'boolean':
9
+ return Number.isFinite(value) || typeof value !== 'number';
10
+ case 'object':
11
+ if (Array.isArray(value)) {
12
+ return value.every((entry) => isJsonValue(entry));
13
+ }
14
+ return Object.values(value).every((entry) => isJsonValue(entry));
15
+ default:
16
+ return false;
17
+ }
18
+ }
19
+ export function isJsonObject(value) {
20
+ return !!value && typeof value === 'object' && !Array.isArray(value) && isJsonValue(value);
21
+ }
22
+ export function cloneJsonObject(value) {
23
+ return JSON.parse(JSON.stringify(value));
24
+ }
@@ -0,0 +1,40 @@
1
+ import type { WorkbenchIconInput } from "../icon/model.js";
2
+ export type ShellRegionId = 'left' | 'right' | 'bottom';
3
+ export type ShellRegionPresentation = 'tabs' | 'stack';
4
+ export type ShellRegionAxis = 'horizontal' | 'vertical';
5
+ export type ShellWidgetScope = 'global' | 'contextual';
6
+ export interface ShellRegionState {
7
+ id: ShellRegionId;
8
+ isVisible: boolean;
9
+ isOpen: boolean;
10
+ size: number;
11
+ activeWidgetId: string | null;
12
+ widgetIds: string[];
13
+ hiddenWidgetIds?: string[];
14
+ presentation?: ShellRegionPresentation;
15
+ axis?: ShellRegionAxis;
16
+ }
17
+ export interface ShellState {
18
+ regions: Record<ShellRegionId, ShellRegionState>;
19
+ }
20
+ export interface ShellWidgetPlacement {
21
+ beforeWidgetId?: string | null;
22
+ afterWidgetId?: string | null;
23
+ }
24
+ export interface ShellWidgetDefinition {
25
+ id: string;
26
+ capabilityId?: string | null;
27
+ title: string;
28
+ icon?: WorkbenchIconInput;
29
+ description: string;
30
+ defaultRegion: ShellRegionId;
31
+ scope: ShellWidgetScope;
32
+ contextToolIds?: string[];
33
+ hidePanelHeader?: boolean;
34
+ initiallyConnected?: boolean;
35
+ }
36
+ export interface ShellWidgetCatalogPort {
37
+ getDefinition(widgetId: string): ShellWidgetDefinition | undefined;
38
+ list?(): ShellWidgetDefinition[];
39
+ }
40
+ export type ShellWidgetCatalog = ShellWidgetCatalogPort;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,76 @@
1
+ import type { DesignSystemThemeSession } from "../design-system/themeSession.js";
2
+ import type { JsonObject } from "../shared/json.js";
3
+ import type { ToolCatalogPort } from "../tool/model.js";
4
+ import type { Workspace } from "../workspace/model.js";
5
+ import type { WorkspaceFocus } from "../workspace/session.js";
6
+ import type { WorkbenchReadingLevel } from "../presentation/readingLevel.js";
7
+ import type { ShellRegionId, ShellWidgetDefinition } from "./model.js";
8
+ export interface ShellWidgetSessionInfo {
9
+ activePanelId: string | null;
10
+ activePanelTitle: string | null;
11
+ activeToolInstanceId: string | null;
12
+ activeToolId: string | null;
13
+ activeToolTitle: string | null;
14
+ }
15
+ export interface ShellWidgetDesignSystemEntity {
16
+ id: string;
17
+ kind: string;
18
+ title: string;
19
+ summary: string;
20
+ status: string;
21
+ source: string;
22
+ designNodeIds: string[];
23
+ tokens: string[];
24
+ cssVariables: string[];
25
+ widgetIds: string[];
26
+ toolIds: string[];
27
+ runtimeProjectionKinds: string[];
28
+ capabilities: string[];
29
+ }
30
+ export interface ShellWidgetDesignSystemRelation {
31
+ id: string;
32
+ from: string;
33
+ to: string;
34
+ kind: string;
35
+ }
36
+ export interface ShellWidgetDesignSystemContext {
37
+ themeSession: DesignSystemThemeSession | null;
38
+ entities: ShellWidgetDesignSystemEntity[];
39
+ relations: ShellWidgetDesignSystemRelation[];
40
+ totals: {
41
+ entities: number;
42
+ widgets: number;
43
+ tools: number;
44
+ panels: number;
45
+ runtimeProjections: number;
46
+ undoBridges: number;
47
+ };
48
+ }
49
+ export interface ShellWidgetRuntimeContext {
50
+ regionId: ShellRegionId;
51
+ widgetId: string;
52
+ workspace: Workspace;
53
+ focus: WorkspaceFocus;
54
+ session: Readonly<ShellWidgetSessionInfo>;
55
+ designSystem: Readonly<ShellWidgetDesignSystemContext> | null;
56
+ /** Reading projection inherited from the active Tool when one exists. */
57
+ readingLevel: WorkbenchReadingLevel;
58
+ setActiveToolState(nextState: JsonObject): boolean;
59
+ setToolState(toolInstanceId: string, nextState: JsonObject): boolean;
60
+ }
61
+ export interface HostedShellWidgetProps {
62
+ definition: ShellWidgetDefinition;
63
+ runtime: ShellWidgetRuntimeContext;
64
+ }
65
+ interface CreateShellWidgetRuntimeContextInput {
66
+ regionId: ShellRegionId;
67
+ widgetId: string;
68
+ workspace: Workspace;
69
+ focus: WorkspaceFocus;
70
+ toolCatalog: ToolCatalogPort;
71
+ designSystem?: ShellWidgetDesignSystemContext | null;
72
+ updateToolState?: (toolInstanceId: string, nextState: JsonObject) => boolean;
73
+ inheritedReadingLevel?: WorkbenchReadingLevel;
74
+ }
75
+ export declare function createShellWidgetRuntimeContext(input: CreateShellWidgetRuntimeContextInput): ShellWidgetRuntimeContext;
76
+ export {};
@@ -0,0 +1,40 @@
1
+ import { findPanelInWorkspace } from "../workspace/selectors.js";
2
+ import { resolveToolReadingLevel } from "../tool/shell.js";
3
+ export function createShellWidgetRuntimeContext(input) {
4
+ const focusedPanel = input.focus.activePanelId
5
+ ? findPanelInWorkspace(input.workspace, input.focus.activePanelId)
6
+ : undefined;
7
+ const focusedToolInstance = input.focus.activeToolInstanceId
8
+ ? input.workspace.toolInstances[input.focus.activeToolInstanceId]
9
+ : undefined;
10
+ const focusedToolDefinition = focusedToolInstance
11
+ ? input.toolCatalog.getDefinition(focusedToolInstance.toolId)
12
+ : undefined;
13
+ return {
14
+ regionId: input.regionId,
15
+ widgetId: input.widgetId,
16
+ workspace: input.workspace,
17
+ focus: input.focus,
18
+ session: createShellWidgetSessionInfo(focusedPanel, focusedToolInstance, focusedToolDefinition),
19
+ designSystem: input.designSystem ?? null,
20
+ readingLevel: focusedToolInstance && focusedToolDefinition
21
+ ? resolveToolReadingLevel(focusedToolDefinition, focusedToolInstance, input.inheritedReadingLevel)
22
+ : input.inheritedReadingLevel ?? 'casual',
23
+ setActiveToolState(nextState) {
24
+ const toolInstanceId = input.focus.activeToolInstanceId;
25
+ return toolInstanceId ? input.updateToolState?.(toolInstanceId, nextState) ?? false : false;
26
+ },
27
+ setToolState(toolInstanceId, nextState) {
28
+ return toolInstanceId ? input.updateToolState?.(toolInstanceId, nextState) ?? false : false;
29
+ }
30
+ };
31
+ }
32
+ function createShellWidgetSessionInfo(panel, toolInstance, toolDefinition) {
33
+ return {
34
+ activePanelId: panel?.id ?? null,
35
+ activePanelTitle: panel?.title ?? null,
36
+ activeToolInstanceId: toolInstance?.id ?? null,
37
+ activeToolId: toolInstance?.toolId ?? null,
38
+ activeToolTitle: toolDefinition?.title ?? null
39
+ };
40
+ }
@@ -0,0 +1,97 @@
1
+ export type ToolSurfaceKind = 'dom' | 'canvas-2d' | 'scene-3d';
2
+ export type EmbeddableSurfacePlacement = 'tool' | 'widget' | 'sideDock';
3
+ export type EmbeddableSurfaceCapability = 'compact' | 'richList' | 'grid' | 'previewFooter' | 'dragSource' | 'dropTarget' | 'import' | 'multiSelect' | (string & {});
4
+ export interface EmbeddableSurfaceContribution {
5
+ id: string;
6
+ ownerToolId?: string;
7
+ supportedPlacements: EmbeddableSurfacePlacement[];
8
+ capabilities: EmbeddableSurfaceCapability[];
9
+ }
10
+ export interface EmbeddableSurfaceHostRequest {
11
+ placement: EmbeddableSurfacePlacement;
12
+ requiredCapabilities?: EmbeddableSurfaceCapability[];
13
+ }
14
+ export type ToolSurfaceCapability = 'inspect.selection' | 'inspect.diagnostics' | 'inspect.bounds' | 'viewport.pan' | 'viewport.zoom' | 'viewport.fit' | 'viewport.orbit' | 'render.static' | 'render.interactive' | (string & {});
15
+ export type ToolSurfaceViewerCapability = ToolSurfaceCapability;
16
+ export interface ToolSurfaceDefinition {
17
+ id: string;
18
+ toolId: string;
19
+ kind: ToolSurfaceKind;
20
+ title: string;
21
+ summary: string;
22
+ capabilities: ToolSurfaceCapability[];
23
+ projectionKinds: string[];
24
+ }
25
+ export declare function canHostEmbeddableSurface(contribution: EmbeddableSurfaceContribution, request: EmbeddableSurfaceHostRequest): boolean;
26
+ export declare function resolveEmbeddableSurfaceCapabilities(contribution: EmbeddableSurfaceContribution, requestedCapabilities: readonly EmbeddableSurfaceCapability[]): EmbeddableSurfaceCapability[];
27
+ export interface ToolSurfaceViewerDefinition {
28
+ id: string;
29
+ title: string;
30
+ version: string;
31
+ summary: string;
32
+ surfaceKinds: ToolSurfaceKind[];
33
+ projectionKinds: string[];
34
+ capabilities: ToolSurfaceCapability[];
35
+ priority?: number;
36
+ }
37
+ export interface ToolSurfaceViewerCompatibilityInput {
38
+ surfaceKind: ToolSurfaceKind;
39
+ projectionKind: string;
40
+ requiredCapabilities?: ToolSurfaceCapability[];
41
+ }
42
+ export interface ToolSurfaceViewerCatalogPort {
43
+ getDefinition(viewerId: string): ToolSurfaceViewerDefinition | undefined;
44
+ list(): ToolSurfaceViewerDefinition[];
45
+ listCompatible(input: ToolSurfaceViewerCompatibilityInput): ToolSurfaceViewerDefinition[];
46
+ }
47
+ export type SurfaceViewerCatalogPort = ToolSurfaceViewerCatalogPort;
48
+ export type ToolSurfaceViewerCatalog = ToolSurfaceViewerCatalogPort;
49
+ export type ProjectionSurfaceKind = 'web_development' | 'tauri_development' | 'tauri_release' | 'tauri_installed' | 'desktop_internal_qa' | 'unknown';
50
+ export type ProjectionSurfaceHostKind = 'browser' | 'tauri' | 'unknown';
51
+ export type ProjectionSurfaceDiagnosticProfile = 'none' | 'desktop_internal_qa';
52
+ export type ProjectionSurfaceSupportStatus = 'supported' | 'supported_with_warnings' | 'blocked' | 'failed' | 'not_applicable' | 'unknown';
53
+ export interface ProjectionSurfaceCapabilities {
54
+ pointer: ProjectionSurfaceSupportStatus;
55
+ keyboard: ProjectionSurfaceSupportStatus;
56
+ contextMenu: ProjectionSurfaceSupportStatus;
57
+ portalRoot: ProjectionSurfaceSupportStatus;
58
+ nativeWindow: ProjectionSurfaceSupportStatus;
59
+ }
60
+ export interface ProjectionSurfaceDiagnostic {
61
+ severity: 'info' | 'warning' | 'error';
62
+ code: string;
63
+ message: string;
64
+ }
65
+ export interface ProjectionSurfaceDescriptor {
66
+ kind: ProjectionSurfaceKind;
67
+ hostKind: ProjectionSurfaceHostKind;
68
+ webviewKind: 'browser' | 'webview2' | 'unknown';
69
+ inputCapabilities: ProjectionSurfaceCapabilities;
70
+ nativeWindowCapabilities: ProjectionSurfaceCapabilities;
71
+ portalRootId: string;
72
+ applicationRootId: string;
73
+ bootRootId: string;
74
+ diagnosticProfile: ProjectionSurfaceDiagnosticProfile;
75
+ viewport: {
76
+ width: number;
77
+ height: number;
78
+ devicePixelRatio: number;
79
+ zoomFactor: number | null;
80
+ };
81
+ focusState: 'focused' | 'blurred' | 'unknown';
82
+ diagnostics: ProjectionSurfaceDiagnostic[];
83
+ }
84
+ export declare const WORKBENCH_PORTAL_ROOT_ID = "workbench-portal-root";
85
+ export declare function createProjectionSurfaceDescriptor(input?: {
86
+ kind?: ProjectionSurfaceKind | null;
87
+ hostKind?: ProjectionSurfaceHostKind | null;
88
+ webviewKind?: ProjectionSurfaceDescriptor['webviewKind'] | null;
89
+ diagnosticProfile?: ProjectionSurfaceDiagnosticProfile | null;
90
+ applicationRootId?: string | null;
91
+ bootRootId?: string | null;
92
+ viewport?: Partial<ProjectionSurfaceDescriptor['viewport']> | null;
93
+ focusState?: ProjectionSurfaceDescriptor['focusState'] | null;
94
+ hasPortalRoot?: boolean;
95
+ diagnostics?: ProjectionSurfaceDiagnostic[];
96
+ }): ProjectionSurfaceDescriptor;
97
+ export declare function resolveProjectionSurfaceKind(hostKind: ProjectionSurfaceHostKind, isDevelopment: boolean, isInstalled: boolean): ProjectionSurfaceKind;
@@ -0,0 +1,71 @@
1
+ export function canHostEmbeddableSurface(contribution, request) {
2
+ if (!contribution.supportedPlacements.includes(request.placement)) {
3
+ return false;
4
+ }
5
+ const availableCapabilities = new Set(contribution.capabilities);
6
+ return (request.requiredCapabilities ?? []).every((capability) => availableCapabilities.has(capability));
7
+ }
8
+ export function resolveEmbeddableSurfaceCapabilities(contribution, requestedCapabilities) {
9
+ const availableCapabilities = new Set(contribution.capabilities);
10
+ return requestedCapabilities.filter((capability) => availableCapabilities.has(capability));
11
+ }
12
+ export const WORKBENCH_PORTAL_ROOT_ID = 'workbench-portal-root';
13
+ export function createProjectionSurfaceDescriptor(input = {}) {
14
+ const hostKind = input.hostKind ?? 'unknown';
15
+ const kind = input.kind ?? resolveProjectionSurfaceKind(hostKind, false, false);
16
+ const hasPortalRoot = input.hasPortalRoot ?? false;
17
+ const portalStatus = hasPortalRoot ? 'supported' : 'supported_with_warnings';
18
+ const diagnostics = [...(input.diagnostics ?? [])];
19
+ if (!hasPortalRoot) {
20
+ diagnostics.push({
21
+ severity: 'warning',
22
+ code: 'projection-surface.portal-root-unobserved',
23
+ message: 'Workbench portal root was not observed for this surface.'
24
+ });
25
+ }
26
+ return {
27
+ kind,
28
+ hostKind,
29
+ webviewKind: input.webviewKind ?? 'unknown',
30
+ inputCapabilities: {
31
+ pointer: 'supported',
32
+ keyboard: 'supported',
33
+ contextMenu: 'supported_with_warnings',
34
+ portalRoot: portalStatus,
35
+ nativeWindow: hostKind === 'tauri' ? 'supported' : 'not_applicable'
36
+ },
37
+ nativeWindowCapabilities: {
38
+ pointer: hostKind === 'tauri' ? 'supported' : 'not_applicable',
39
+ keyboard: hostKind === 'tauri' ? 'supported' : 'not_applicable',
40
+ contextMenu: hostKind === 'tauri' ? 'supported_with_warnings' : 'not_applicable',
41
+ portalRoot: portalStatus,
42
+ nativeWindow: hostKind === 'tauri' ? 'supported' : 'not_applicable'
43
+ },
44
+ portalRootId: WORKBENCH_PORTAL_ROOT_ID,
45
+ applicationRootId: input.applicationRootId ?? 'app',
46
+ bootRootId: input.bootRootId ?? 'workbench-boot-surface',
47
+ diagnosticProfile: input.diagnosticProfile ?? 'none',
48
+ viewport: {
49
+ width: Math.max(0, input.viewport?.width ?? 0),
50
+ height: Math.max(0, input.viewport?.height ?? 0),
51
+ devicePixelRatio: Math.max(0, input.viewport?.devicePixelRatio ?? 1),
52
+ zoomFactor: typeof input.viewport?.zoomFactor === 'number'
53
+ ? Math.max(0, input.viewport.zoomFactor)
54
+ : null
55
+ },
56
+ focusState: input.focusState ?? 'unknown',
57
+ diagnostics
58
+ };
59
+ }
60
+ export function resolveProjectionSurfaceKind(hostKind, isDevelopment, isInstalled) {
61
+ if (hostKind === 'browser') {
62
+ return 'web_development';
63
+ }
64
+ if (hostKind === 'tauri') {
65
+ if (isDevelopment) {
66
+ return 'tauri_development';
67
+ }
68
+ return isInstalled ? 'tauri_installed' : 'tauri_release';
69
+ }
70
+ return 'unknown';
71
+ }
@@ -0,0 +1,95 @@
1
+ import type { JsonObject, JsonValue } from "../shared/json.js";
2
+ export type TemporalScalar = number | string;
3
+ export type TemporalUnit = 'step' | 'frame' | 'second' | 'millisecond' | 'timestamp' | 'revision' | (string & {});
4
+ export type TemporalItemShape = 'instant' | 'segment' | 'range';
5
+ export type TemporalCapability = 'viewport.pan' | 'viewport.zoom' | 'viewport.fit' | 'playback.discrete' | 'playback.continuous' | 'selection.item' | 'selection.range' | 'lanes.group' | 'markers' | 'inspect.payload' | 'inspect.artifacts' | 'diff.snapshot' | (string & {});
6
+ export interface TemporalRange {
7
+ start: TemporalScalar;
8
+ end: TemporalScalar;
9
+ unit: TemporalUnit;
10
+ }
11
+ export interface TemporalCursor {
12
+ value: TemporalScalar;
13
+ unit: TemporalUnit;
14
+ itemId?: string | null;
15
+ }
16
+ export interface TemporalLane {
17
+ id: string;
18
+ title: string;
19
+ summary?: string;
20
+ groupId?: string | null;
21
+ order?: number;
22
+ color?: string;
23
+ metadata?: JsonObject;
24
+ }
25
+ export interface TemporalMarker {
26
+ id: string;
27
+ value: TemporalScalar;
28
+ unit: TemporalUnit;
29
+ title: string;
30
+ kind?: string;
31
+ metadata?: JsonObject;
32
+ }
33
+ export interface TemporalArtifactRef {
34
+ kind: 'doc' | 'source' | 'test' | 'schema' | 'fixture' | 'runtime' | 'event' | 'commit' | (string & {});
35
+ path?: string;
36
+ ref?: string;
37
+ label?: string;
38
+ }
39
+ export interface TemporalItem {
40
+ id: string;
41
+ laneId: string;
42
+ kind: string;
43
+ shape: TemporalItemShape;
44
+ start: TemporalScalar;
45
+ end?: TemporalScalar;
46
+ unit: TemporalUnit;
47
+ title: string;
48
+ summary?: string;
49
+ status?: string;
50
+ source?: TemporalArtifactRef;
51
+ artifacts?: TemporalArtifactRef[];
52
+ payload?: JsonValue;
53
+ metadata?: JsonObject;
54
+ }
55
+ export interface TemporalDiagnostic {
56
+ id: string;
57
+ severity: 'info' | 'warning' | 'error';
58
+ message: string;
59
+ itemId?: string;
60
+ }
61
+ export interface TemporalProjection {
62
+ id: string;
63
+ dialect: string;
64
+ title: string;
65
+ summary?: string;
66
+ range: TemporalRange;
67
+ cursor?: TemporalCursor;
68
+ lanes: TemporalLane[];
69
+ items: TemporalItem[];
70
+ markers?: TemporalMarker[];
71
+ diagnostics?: TemporalDiagnostic[];
72
+ metadata?: JsonObject;
73
+ }
74
+ export interface TemporalDialectDefinition {
75
+ id: string;
76
+ title: string;
77
+ version: string;
78
+ summary: string;
79
+ unit: TemporalUnit;
80
+ itemKinds: string[];
81
+ capabilities: TemporalCapability[];
82
+ projectionKinds?: string[];
83
+ }
84
+ export interface TemporalDialectCompatibilityInput {
85
+ dialect?: string;
86
+ unit?: TemporalUnit;
87
+ projectionKind?: string;
88
+ requiredCapabilities?: TemporalCapability[];
89
+ }
90
+ export interface TemporalDialectCatalog {
91
+ getDefinition(dialectId: string): TemporalDialectDefinition | undefined;
92
+ list(): TemporalDialectDefinition[];
93
+ listCompatible(input: TemporalDialectCompatibilityInput): TemporalDialectDefinition[];
94
+ }
95
+ export declare function validateTemporalProjection(projection: TemporalProjection, dialect?: TemporalDialectDefinition): TemporalDiagnostic[];
@@ -0,0 +1,45 @@
1
+ export function validateTemporalProjection(projection, dialect) {
2
+ const laneIds = new Set(projection.lanes.map((lane) => lane.id));
3
+ const diagnostics = [];
4
+ if (dialect && projection.dialect !== dialect.id) {
5
+ diagnostics.push({
6
+ id: 'temporal.dialect.mismatch',
7
+ severity: 'error',
8
+ message: `Projection dialect "${projection.dialect}" does not match dialect "${dialect.id}".`
9
+ });
10
+ }
11
+ if (projection.range.unit && projection.cursor && projection.cursor.unit !== projection.range.unit) {
12
+ diagnostics.push({
13
+ id: 'temporal.cursor.unit-mismatch',
14
+ severity: 'warning',
15
+ message: `Cursor unit "${projection.cursor.unit}" differs from range unit "${projection.range.unit}".`
16
+ });
17
+ }
18
+ for (const item of projection.items) {
19
+ if (!laneIds.has(item.laneId)) {
20
+ diagnostics.push({
21
+ id: `temporal.item.${item.id}.missing-lane`,
22
+ severity: 'error',
23
+ itemId: item.id,
24
+ message: `Temporal item "${item.id}" references missing lane "${item.laneId}".`
25
+ });
26
+ }
27
+ if (item.shape !== 'instant' && item.end === undefined) {
28
+ diagnostics.push({
29
+ id: `temporal.item.${item.id}.missing-end`,
30
+ severity: 'warning',
31
+ itemId: item.id,
32
+ message: `Temporal ${item.shape} item "${item.id}" should declare an end value.`
33
+ });
34
+ }
35
+ if (dialect && !dialect.itemKinds.includes(item.kind)) {
36
+ diagnostics.push({
37
+ id: `temporal.item.${item.id}.unknown-kind`,
38
+ severity: 'warning',
39
+ itemId: item.id,
40
+ message: `Temporal item "${item.id}" uses kind "${item.kind}" outside dialect "${dialect.id}".`
41
+ });
42
+ }
43
+ }
44
+ return diagnostics;
45
+ }
@@ -0,0 +1,11 @@
1
+ import type { JsonObject } from "../shared/json.js";
2
+ /**
3
+ * Canonical Tool-instance state key for a Tool-owned internal tab.
4
+ *
5
+ * Panel tabs remain owned by the Workbench layout. Tabs rendered inside a
6
+ * Tool are instead part of that Tool's serializable projection and must never
7
+ * be promoted to global shell state or persisted through a parallel store.
8
+ */
9
+ export declare const TOOL_INTERNAL_TAB_STATE_KEY = "activeInternalTab";
10
+ export declare function resolveToolInternalTab<TTab extends string>(state: JsonObject | null | undefined, supportedTabs: readonly TTab[], fallback: TTab): TTab;
11
+ export declare function withToolInternalTab(state: JsonObject | null | undefined, activeTab: string): JsonObject;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Canonical Tool-instance state key for a Tool-owned internal tab.
3
+ *
4
+ * Panel tabs remain owned by the Workbench layout. Tabs rendered inside a
5
+ * Tool are instead part of that Tool's serializable projection and must never
6
+ * be promoted to global shell state or persisted through a parallel store.
7
+ */
8
+ export const TOOL_INTERNAL_TAB_STATE_KEY = 'activeInternalTab';
9
+ export function resolveToolInternalTab(state, supportedTabs, fallback) {
10
+ const candidate = state?.[TOOL_INTERNAL_TAB_STATE_KEY];
11
+ return typeof candidate === 'string' && supportedTabs.includes(candidate)
12
+ ? candidate
13
+ : fallback;
14
+ }
15
+ export function withToolInternalTab(state, activeTab) {
16
+ return {
17
+ ...(state ?? {}),
18
+ [TOOL_INTERNAL_TAB_STATE_KEY]: activeTab
19
+ };
20
+ }