@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,100 @@
1
+ export class WorkbenchAudioManager {
2
+ audioContext;
3
+ channels = new Map();
4
+ masterGainNode;
5
+ masterVolume;
6
+ masterMuted;
7
+ constructor(audioContext, options = {}) {
8
+ this.audioContext = audioContext;
9
+ this.masterGainNode = audioContext.createGain();
10
+ this.masterGainNode.connect(audioContext.destination);
11
+ this.masterVolume = this.normalizeGainValue(options.masterVolume, 1);
12
+ this.masterMuted = options.masterMuted ?? false;
13
+ this.applyGainValue(this.masterGainNode, this.masterMuted ? 0 : this.masterVolume);
14
+ }
15
+ get masterGain() {
16
+ return this.masterGainNode;
17
+ }
18
+ get masterVolumeValue() {
19
+ return this.masterVolume;
20
+ }
21
+ get isMasterMuted() {
22
+ return this.masterMuted;
23
+ }
24
+ getChannelIds() {
25
+ return [...this.channels.keys()];
26
+ }
27
+ ensureChannel(id, options = {}) {
28
+ const existingChannel = this.channels.get(id);
29
+ if (existingChannel) {
30
+ const nextVolume = this.normalizeGainValue(options.volume, existingChannel.volume);
31
+ const nextMuted = options.muted ?? existingChannel.muted;
32
+ if (nextVolume !== existingChannel.volume || nextMuted !== existingChannel.muted) {
33
+ existingChannel.volume = nextVolume;
34
+ existingChannel.muted = nextMuted;
35
+ this.applyGainValue(existingChannel.gainNode, nextMuted ? 0 : nextVolume);
36
+ }
37
+ return existingChannel;
38
+ }
39
+ const gainNode = this.audioContext.createGain();
40
+ gainNode.connect(this.masterGainNode);
41
+ const channel = {
42
+ id,
43
+ gainNode,
44
+ volume: this.normalizeGainValue(options.volume, 1),
45
+ muted: options.muted ?? false
46
+ };
47
+ this.applyGainValue(channel.gainNode, channel.muted ? 0 : channel.volume);
48
+ this.channels.set(id, channel);
49
+ return channel;
50
+ }
51
+ getChannel(id) {
52
+ return this.channels.get(id) ?? null;
53
+ }
54
+ connect(node, channelId) {
55
+ const channel = this.ensureChannel(channelId);
56
+ node.connect(channel.gainNode);
57
+ return node;
58
+ }
59
+ setChannelVolume(channelId, volume) {
60
+ const channel = this.ensureChannel(channelId);
61
+ channel.volume = this.normalizeGainValue(volume, channel.volume);
62
+ this.applyGainValue(channel.gainNode, channel.muted ? 0 : channel.volume);
63
+ return channel;
64
+ }
65
+ setChannelMuted(channelId, muted) {
66
+ const channel = this.ensureChannel(channelId);
67
+ channel.muted = muted;
68
+ this.applyGainValue(channel.gainNode, muted ? 0 : channel.volume);
69
+ return channel;
70
+ }
71
+ setMasterVolume(volume) {
72
+ this.masterVolume = this.normalizeGainValue(volume, this.masterVolume);
73
+ this.applyGainValue(this.masterGainNode, this.masterMuted ? 0 : this.masterVolume);
74
+ }
75
+ setMasterMuted(muted) {
76
+ this.masterMuted = muted;
77
+ this.applyGainValue(this.masterGainNode, muted ? 0 : this.masterVolume);
78
+ }
79
+ dispose() {
80
+ for (const channel of this.channels.values()) {
81
+ channel.gainNode.disconnect();
82
+ }
83
+ this.channels.clear();
84
+ this.masterGainNode.disconnect();
85
+ }
86
+ applyGainValue(gainNode, value) {
87
+ const nextValue = this.normalizeGainValue(value, 1);
88
+ if (typeof gainNode.gain.setValueAtTime === 'function') {
89
+ gainNode.gain.setValueAtTime(nextValue, this.audioContext.currentTime);
90
+ return;
91
+ }
92
+ gainNode.gain.value = nextValue;
93
+ }
94
+ normalizeGainValue(value, fallback) {
95
+ if (typeof value !== 'number' || !Number.isFinite(value)) {
96
+ return fallback;
97
+ }
98
+ return Math.max(0, value);
99
+ }
100
+ }
@@ -0,0 +1,30 @@
1
+ import type { WorkbenchRuntimeBackendHealth, WorkbenchRuntimeAppPreviewDescriptor, WorkbenchRuntimeBackendPort, WorkbenchRuntimeObservationEvent, WorkbenchRuntimeProjectionInvalidationResult, WorkbenchRuntimeSharedStateEntry, WorkbenchRuntimeSharedStatePatch, WorkbenchRuntimeSubscription, WorkbenchRuntimeWorkspaceDescriptor } from "../../domain/runtime/model.js";
2
+ export interface HttpWorkbenchBackendClientOptions {
3
+ baseUrl?: string;
4
+ resolveBaseUrl?: () => string;
5
+ fetcher?: typeof fetch;
6
+ eventSourceFactory?: (url: string) => EventSource;
7
+ lifecycleEventTarget?: Pick<EventTarget, 'addEventListener' | 'removeEventListener'>;
8
+ now?: () => string;
9
+ }
10
+ export declare class HttpWorkbenchBackendClient implements WorkbenchRuntimeBackendPort {
11
+ private readonly configuredBaseUrl;
12
+ private readonly baseUrlResolver?;
13
+ private readonly fetcher;
14
+ private readonly eventSourceFactory?;
15
+ private readonly lifecycleEventTarget?;
16
+ private readonly now;
17
+ constructor(options?: HttpWorkbenchBackendClientOptions);
18
+ get baseUrl(): string;
19
+ getHealth(): Promise<WorkbenchRuntimeBackendHealth>;
20
+ getWorkspace(): Promise<WorkbenchRuntimeWorkspaceDescriptor>;
21
+ getProjection<TProjection = unknown>(kind: string, params?: Record<string, string>): Promise<TProjection>;
22
+ invalidateProjection(kind: string, params?: Record<string, string>): Promise<WorkbenchRuntimeProjectionInvalidationResult>;
23
+ loadProject(root: string): Promise<WorkbenchRuntimeWorkspaceDescriptor>;
24
+ startAppPreview(root?: string): Promise<WorkbenchRuntimeAppPreviewDescriptor>;
25
+ listSharedState(): Promise<WorkbenchRuntimeSharedStateEntry[]>;
26
+ patchSharedState(key: string, patch: WorkbenchRuntimeSharedStatePatch): Promise<WorkbenchRuntimeSharedStateEntry>;
27
+ subscribeToEvents(onEvent: (event: WorkbenchRuntimeObservationEvent) => void, onError: (error: Error) => void): WorkbenchRuntimeSubscription;
28
+ private getJson;
29
+ private postJson;
30
+ }
@@ -0,0 +1,314 @@
1
+ import { WORKBENCH_RUNTIME_EVENT_TYPES } from "../../domain/runtime/model.js";
2
+ export class HttpWorkbenchBackendClient {
3
+ configuredBaseUrl;
4
+ baseUrlResolver;
5
+ fetcher;
6
+ eventSourceFactory;
7
+ lifecycleEventTarget;
8
+ now;
9
+ constructor(options = {}) {
10
+ this.configuredBaseUrl = normalizeBaseUrl(options.baseUrl ?? 'http://127.0.0.1:5179');
11
+ this.baseUrlResolver = options.resolveBaseUrl;
12
+ this.fetcher = options.fetcher ?? globalThis.fetch.bind(globalThis);
13
+ this.eventSourceFactory = options.eventSourceFactory;
14
+ this.lifecycleEventTarget = options.lifecycleEventTarget;
15
+ this.now = options.now ?? (() => new Date().toISOString());
16
+ }
17
+ get baseUrl() {
18
+ return normalizeBaseUrl(this.baseUrlResolver?.() ?? this.configuredBaseUrl);
19
+ }
20
+ async getHealth() {
21
+ const payload = await this.getJson('/health');
22
+ return {
23
+ status: payload.status,
24
+ service: payload.service,
25
+ mode: payload.mode
26
+ };
27
+ }
28
+ async getWorkspace() {
29
+ const payload = await this.getJson('/api/workspace');
30
+ return normalizeWorkspaceDescriptor(payload);
31
+ }
32
+ async getProjection(kind, params = {}) {
33
+ const searchParams = new URLSearchParams(params);
34
+ const query = searchParams.size > 0 ? `?${searchParams.toString()}` : '';
35
+ return this.getJson(`/api/projections/${encodeURIComponent(kind)}${query}`);
36
+ }
37
+ async invalidateProjection(kind, params = {}) {
38
+ const searchParams = new URLSearchParams(params);
39
+ const query = searchParams.size > 0 ? `?${searchParams.toString()}` : '';
40
+ return this.postJson(`/api/projections/${encodeURIComponent(kind)}/invalidate${query}`);
41
+ }
42
+ async loadProject(root) {
43
+ const payload = await this.postJson('/api/workspace/project', { root });
44
+ return normalizeWorkspaceDescriptor(payload);
45
+ }
46
+ async startAppPreview(root) {
47
+ const searchParams = new URLSearchParams();
48
+ if (root) {
49
+ searchParams.set('root', root);
50
+ }
51
+ const query = searchParams.size > 0 ? `?${searchParams.toString()}` : '';
52
+ return this.getJson(`/api/app-preview${query}`);
53
+ }
54
+ async listSharedState() {
55
+ return this.getJson('/api/shared-state');
56
+ }
57
+ async patchSharedState(key, patch) {
58
+ return this.postJson(`/api/shared-state/${encodeURIComponent(key)}`, patch);
59
+ }
60
+ subscribeToEvents(onEvent, onError) {
61
+ const factory = this.eventSourceFactory ?? resolveEventSourceFactory();
62
+ if (!factory) {
63
+ onError(new Error('EventSource is not available in this runtime.'));
64
+ return { dispose: () => { } };
65
+ }
66
+ const eventSource = factory(`${this.baseUrl}/events`);
67
+ const lifecycleEventTarget = this.lifecycleEventTarget ?? resolveLifecycleEventTarget();
68
+ let closedByClient = false;
69
+ let cleanupCompleted = false;
70
+ const listeners = WORKBENCH_RUNTIME_EVENT_TYPES.map((eventType) => {
71
+ const listener = (event) => {
72
+ if (closedByClient) {
73
+ return;
74
+ }
75
+ onEvent({
76
+ type: eventType,
77
+ payload: parseEventPayload(event.data),
78
+ receivedAt: this.now()
79
+ });
80
+ };
81
+ eventSource.addEventListener(eventType, listener);
82
+ return { eventType, listener };
83
+ });
84
+ const closeEventSource = () => {
85
+ if (cleanupCompleted) {
86
+ return;
87
+ }
88
+ closedByClient = true;
89
+ for (const { eventType, listener } of listeners) {
90
+ eventSource.removeEventListener(eventType, listener);
91
+ }
92
+ lifecycleEventTarget?.removeEventListener('pagehide', closeEventSource);
93
+ lifecycleEventTarget?.removeEventListener('beforeunload', closeEventSource);
94
+ eventSource.close();
95
+ // Suppress events from the first attempt, but only acknowledge cleanup
96
+ // after it succeeds. A throwing close remains explicitly retryable.
97
+ cleanupCompleted = true;
98
+ };
99
+ lifecycleEventTarget?.addEventListener('pagehide', closeEventSource);
100
+ lifecycleEventTarget?.addEventListener('beforeunload', closeEventSource);
101
+ eventSource.onerror = () => {
102
+ if (closedByClient || eventSource.readyState === 2) {
103
+ return;
104
+ }
105
+ onError(new Error(`Lost connection to ${this.baseUrl}/events`));
106
+ };
107
+ return {
108
+ dispose: () => {
109
+ closeEventSource();
110
+ }
111
+ };
112
+ }
113
+ async getJson(path) {
114
+ const response = await this.fetcher(`${this.baseUrl}${path}`, {
115
+ headers: {
116
+ accept: 'application/json'
117
+ }
118
+ });
119
+ if (!response.ok) {
120
+ throw new Error(await createBackendRequestErrorMessage(response));
121
+ }
122
+ return (await response.json());
123
+ }
124
+ async postJson(path, body) {
125
+ const response = await this.fetcher(`${this.baseUrl}${path}`, {
126
+ method: 'POST',
127
+ headers: {
128
+ accept: 'application/json',
129
+ ...(body === undefined ? {} : { 'content-type': 'application/json' })
130
+ },
131
+ ...(body === undefined ? {} : { body: JSON.stringify(body) })
132
+ });
133
+ if (!response.ok) {
134
+ throw new Error(await createBackendRequestErrorMessage(response));
135
+ }
136
+ return (await response.json());
137
+ }
138
+ }
139
+ function normalizeWorkspaceDescriptor(payload) {
140
+ return {
141
+ name: payload.name ?? 'workbench-backend',
142
+ mode: payload.mode ?? 'development',
143
+ workspaceRoot: payload.workspaceRoot ?? '',
144
+ project: normalizeWorkspaceProject(payload.project),
145
+ repositoryInspection: normalizeRepositoryInspectionInput(payload.repositoryInspection),
146
+ repositoryCoverage: normalizeRepositoryCoverageSnapshot(payload.repositoryCoverage),
147
+ capabilities: Array.isArray(payload.capabilities) ? payload.capabilities : [],
148
+ projections: normalizeWorkspaceProjections(payload.projections)
149
+ };
150
+ }
151
+ async function createBackendRequestErrorMessage(response) {
152
+ let message = `${response.status} ${response.statusText}`;
153
+ try {
154
+ const payload = await response.clone().json();
155
+ const payloadMessage = typeof payload.message === 'string' ? payload.message : null;
156
+ const payloadError = typeof payload.error === 'string' ? payload.error : null;
157
+ message = payloadMessage ?? payloadError ?? message;
158
+ }
159
+ catch {
160
+ // Fall back to the status line when the backend does not return JSON.
161
+ }
162
+ return `Backend request failed: ${message}`;
163
+ }
164
+ function normalizeWorkspaceProjections(value) {
165
+ if (!value || typeof value !== 'object') {
166
+ return {};
167
+ }
168
+ const projections = {};
169
+ for (const [projectionKind, sources] of Object.entries(value)) {
170
+ projections[projectionKind] = Array.isArray(sources)
171
+ ? sources.filter((source) => typeof source === 'string')
172
+ : [];
173
+ }
174
+ return projections;
175
+ }
176
+ function normalizeWorkspaceProject(value) {
177
+ if (!value || typeof value !== 'object') {
178
+ return null;
179
+ }
180
+ const payload = value;
181
+ const id = typeof payload.id === 'string' ? payload.id : null;
182
+ const label = typeof payload.label === 'string' ? payload.label : null;
183
+ const root = typeof payload.root === 'string' ? payload.root : null;
184
+ const workspaceRoot = typeof payload.workspaceRoot === 'string' ? payload.workspaceRoot : '';
185
+ const faviconDataUrl = typeof payload.faviconDataUrl === 'string' ? payload.faviconDataUrl : null;
186
+ const i18n = payload.i18n && typeof payload.i18n === 'object' && !Array.isArray(payload.i18n)
187
+ ? payload.i18n
188
+ : null;
189
+ const primaryLocale = typeof payload.primaryLocale === 'string'
190
+ ? payload.primaryLocale
191
+ : typeof i18n?.primaryLocale === 'string'
192
+ ? i18n.primaryLocale
193
+ : null;
194
+ const payloadLocales = normalizeLocaleList(payload.locales);
195
+ const i18nLocales = normalizeLocaleList(i18n?.locales);
196
+ const locales = payloadLocales.length > 0 ? payloadLocales : i18nLocales;
197
+ const componentSources = Array.isArray(payload.componentSources)
198
+ ? payload.componentSources.filter((source) => typeof source === 'string')
199
+ : [];
200
+ const componentSourceCount = typeof payload.componentSourceCount === 'number' && Number.isFinite(payload.componentSourceCount)
201
+ ? payload.componentSourceCount
202
+ : componentSources.length;
203
+ return id && label && root
204
+ ? {
205
+ id,
206
+ label,
207
+ root,
208
+ workspaceRoot,
209
+ isWorkspaceProject: payload.isWorkspaceProject === true,
210
+ faviconDataUrl,
211
+ primaryLocale,
212
+ locales,
213
+ i18n: primaryLocale || locales.length > 0 ? { primaryLocale, locales } : null,
214
+ componentSources,
215
+ componentSourceCount
216
+ }
217
+ : null;
218
+ }
219
+ function normalizeLocaleList(value) {
220
+ if (!Array.isArray(value)) {
221
+ return [];
222
+ }
223
+ return [
224
+ ...new Set(value
225
+ .filter((locale) => typeof locale === 'string' && locale.trim().length > 0)
226
+ .map((locale) => locale.trim()))
227
+ ];
228
+ }
229
+ function normalizeRepositoryInspectionInput(value) {
230
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
231
+ return null;
232
+ }
233
+ const payload = value;
234
+ const root = typeof payload.root === 'string' ? payload.root : '';
235
+ if (!root) {
236
+ return null;
237
+ }
238
+ return {
239
+ label: typeof payload.label === 'string' ? payload.label : null,
240
+ root,
241
+ files: Array.isArray(payload.files)
242
+ ? payload.files.filter((file) => typeof file === 'string')
243
+ : [],
244
+ packageJson: normalizeRepositoryPackageJson(payload.packageJson),
245
+ git: null,
246
+ inspectOnly: payload.inspectOnly === true
247
+ };
248
+ }
249
+ function normalizeRepositoryCoverageSnapshot(value) {
250
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
251
+ return null;
252
+ }
253
+ const payload = value;
254
+ return typeof payload.projectRoot === 'string' && typeof payload.projectLabel === 'string'
255
+ ? payload
256
+ : null;
257
+ }
258
+ function normalizeRepositoryPackageJson(value) {
259
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
260
+ return null;
261
+ }
262
+ const payload = value;
263
+ return {
264
+ name: typeof payload.name === 'string' ? payload.name : undefined,
265
+ version: typeof payload.version === 'string' ? payload.version : undefined,
266
+ scripts: normalizeStringRecord(payload.scripts),
267
+ workspaces: normalizePackageWorkspaces(payload.workspaces),
268
+ dependencies: normalizeStringRecord(payload.dependencies),
269
+ devDependencies: normalizeStringRecord(payload.devDependencies)
270
+ };
271
+ }
272
+ function normalizeStringRecord(value) {
273
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
274
+ return undefined;
275
+ }
276
+ const entries = Object.entries(value)
277
+ .filter((entry) => typeof entry[1] === 'string');
278
+ return entries.length > 0 ? Object.fromEntries(entries) : undefined;
279
+ }
280
+ function normalizePackageWorkspaces(value) {
281
+ if (Array.isArray(value)) {
282
+ return value.filter((entry) => typeof entry === 'string');
283
+ }
284
+ if (!value || typeof value !== 'object') {
285
+ return undefined;
286
+ }
287
+ const packages = value.packages;
288
+ return Array.isArray(packages)
289
+ ? { packages: packages.filter((entry) => typeof entry === 'string') }
290
+ : undefined;
291
+ }
292
+ function normalizeBaseUrl(baseUrl) {
293
+ return baseUrl.replace(/\/+$/, '');
294
+ }
295
+ function parseEventPayload(data) {
296
+ if (!data) {
297
+ return null;
298
+ }
299
+ try {
300
+ return JSON.parse(data);
301
+ }
302
+ catch {
303
+ return data;
304
+ }
305
+ }
306
+ function resolveEventSourceFactory() {
307
+ if (typeof EventSource === 'undefined') {
308
+ return undefined;
309
+ }
310
+ return (url) => new EventSource(url);
311
+ }
312
+ function resolveLifecycleEventTarget() {
313
+ return typeof window === 'undefined' ? undefined : window;
314
+ }
@@ -0,0 +1,8 @@
1
+ import type { Workspace } from "../../domain/workspace/model.js";
2
+ import type { WorkspacePersistencePort } from "../../domain/workspace/persistence.js";
3
+ export declare class LocalWorkspacePersistence implements WorkspacePersistencePort {
4
+ private readonly storageKey;
5
+ constructor(storageKey: string);
6
+ load(): Workspace | null;
7
+ save(workspace: Workspace): void;
8
+ }
@@ -0,0 +1,29 @@
1
+ import { parseWorkspaceSnapshot } from "../../domain/workspace/validation.js";
2
+ export class LocalWorkspacePersistence {
3
+ storageKey;
4
+ constructor(storageKey) {
5
+ this.storageKey = storageKey;
6
+ }
7
+ load() {
8
+ if (typeof localStorage === 'undefined') {
9
+ return null;
10
+ }
11
+ const rawWorkspace = localStorage.getItem(this.storageKey);
12
+ if (!rawWorkspace) {
13
+ return null;
14
+ }
15
+ try {
16
+ const parsedWorkspace = JSON.parse(rawWorkspace);
17
+ return parseWorkspaceSnapshot(parsedWorkspace);
18
+ }
19
+ catch {
20
+ return null;
21
+ }
22
+ }
23
+ save(workspace) {
24
+ if (typeof localStorage === 'undefined') {
25
+ return;
26
+ }
27
+ localStorage.setItem(this.storageKey, JSON.stringify(workspace));
28
+ }
29
+ }
@@ -0,0 +1,58 @@
1
+ import type { WorkbenchRuntimeProjectionSessionPatch } from "../../domain/runtime/model.js";
2
+ import type { JsonObject } from "../../domain/shared/json.js";
3
+ import type { ToolSurfaceViewerCatalogPort, ToolSurfaceViewerCompatibilityInput, ToolSurfaceViewerDefinition } from "../../domain/surface/model.js";
4
+ import type { ToolInstance } from "../../domain/tool/model.js";
5
+ export type RegisteredSurfaceViewerComponent = unknown;
6
+ export type RegisteredSurfaceViewerComponentModule = {
7
+ default: RegisteredSurfaceViewerComponent;
8
+ };
9
+ export type RegisteredSurfaceViewerComponentLoader = () => Promise<RegisteredSurfaceViewerComponent | RegisteredSurfaceViewerComponentModule>;
10
+ export interface RegisteredSurfaceViewerSessionAdapterInput {
11
+ toolInstanceId: string;
12
+ toolInstance: ToolInstance;
13
+ viewer: ToolSurfaceViewerDefinition;
14
+ patch: WorkbenchRuntimeProjectionSessionPatch & {
15
+ toolInstanceId?: string | null;
16
+ };
17
+ }
18
+ export type RegisteredSurfaceViewerSessionAdapter = (input: RegisteredSurfaceViewerSessionAdapterInput) => JsonObject | null;
19
+ export interface RegisteredSurfaceViewer {
20
+ definition: ToolSurfaceViewerDefinition;
21
+ component?: RegisteredSurfaceViewerComponent;
22
+ loadComponent?: RegisteredSurfaceViewerComponentLoader;
23
+ applyRuntimeProjectionSession?: RegisteredSurfaceViewerSessionAdapter;
24
+ }
25
+ export type SurfaceViewerRegistryDuplicateResolutionPolicy = 'first-registration-wins';
26
+ export interface SurfaceViewerRegistryEntryMetadata {
27
+ id: string;
28
+ title: string;
29
+ version: string;
30
+ summary: string;
31
+ surfaceKinds: string[];
32
+ projectionKinds: string[];
33
+ componentMode: 'component' | 'loader' | 'component-and-loader';
34
+ }
35
+ export interface SurfaceViewerRegistryDuplicateDiagnostic {
36
+ kind: 'duplicate-id';
37
+ registryKind: 'surface-viewer';
38
+ duplicateId: string;
39
+ existing: SurfaceViewerRegistryEntryMetadata;
40
+ incoming: SurfaceViewerRegistryEntryMetadata;
41
+ existingRegistrationOrder: number;
42
+ incomingRegistrationOrder: number;
43
+ resolutionPolicy: SurfaceViewerRegistryDuplicateResolutionPolicy;
44
+ }
45
+ export declare class InMemorySurfaceViewerRegistry implements ToolSurfaceViewerCatalogPort {
46
+ private readonly entries;
47
+ private readonly registrationOrders;
48
+ private readonly duplicateDiagnostics;
49
+ private nextRegistrationOrder;
50
+ register(entry: RegisteredSurfaceViewer): void;
51
+ get(viewerId: string): RegisteredSurfaceViewer | undefined;
52
+ getDefinition(viewerId: string): ToolSurfaceViewerDefinition | undefined;
53
+ list(): ToolSurfaceViewerDefinition[];
54
+ listRegistered(): RegisteredSurfaceViewer[];
55
+ listCompatible(input: ToolSurfaceViewerCompatibilityInput): ToolSurfaceViewerDefinition[];
56
+ listRegisteredCompatible(input: ToolSurfaceViewerCompatibilityInput): RegisteredSurfaceViewer[];
57
+ listDiagnostics(): SurfaceViewerRegistryDuplicateDiagnostic[];
58
+ }
@@ -0,0 +1,121 @@
1
+ export class InMemorySurfaceViewerRegistry {
2
+ entries = new Map();
3
+ registrationOrders = new Map();
4
+ duplicateDiagnostics = [];
5
+ nextRegistrationOrder = 0;
6
+ register(entry) {
7
+ if (!entry.component && !entry.loadComponent) {
8
+ throw new Error(`Surface viewer "${entry.definition.id}" must register a component or component loader.`);
9
+ }
10
+ const incomingRegistrationOrder = ++this.nextRegistrationOrder;
11
+ const existingEntry = this.entries.get(entry.definition.id);
12
+ if (existingEntry) {
13
+ this.duplicateDiagnostics.push({
14
+ kind: 'duplicate-id',
15
+ registryKind: 'surface-viewer',
16
+ duplicateId: entry.definition.id,
17
+ existing: createSurfaceViewerRegistryEntryMetadata(existingEntry),
18
+ incoming: createSurfaceViewerRegistryEntryMetadata(entry),
19
+ existingRegistrationOrder: this.registrationOrders.get(entry.definition.id) ?? 0,
20
+ incomingRegistrationOrder,
21
+ resolutionPolicy: 'first-registration-wins'
22
+ });
23
+ return;
24
+ }
25
+ this.entries.set(entry.definition.id, cloneRegisteredSurfaceViewer(entry));
26
+ this.registrationOrders.set(entry.definition.id, incomingRegistrationOrder);
27
+ }
28
+ get(viewerId) {
29
+ const entry = this.entries.get(viewerId);
30
+ return entry ? cloneRegisteredSurfaceViewer(entry) : undefined;
31
+ }
32
+ getDefinition(viewerId) {
33
+ const entry = this.entries.get(viewerId);
34
+ return entry ? cloneSurfaceViewerDefinition(entry.definition) : undefined;
35
+ }
36
+ list() {
37
+ return [...this.entries.values()]
38
+ .map((entry) => cloneSurfaceViewerDefinition(entry.definition))
39
+ .sort(compareSurfaceViewers);
40
+ }
41
+ listRegistered() {
42
+ return [...this.entries.values()]
43
+ .map((entry) => cloneRegisteredSurfaceViewer(entry))
44
+ .sort((left, right) => compareSurfaceViewers(left.definition, right.definition));
45
+ }
46
+ listCompatible(input) {
47
+ return this.listRegisteredCompatible(input).map((entry) => cloneSurfaceViewerDefinition(entry.definition));
48
+ }
49
+ listRegisteredCompatible(input) {
50
+ return [...this.entries.values()]
51
+ .filter((entry) => isCompatibleSurfaceViewer(entry.definition, input))
52
+ .map((entry) => cloneRegisteredSurfaceViewer(entry))
53
+ .sort((left, right) => compareSurfaceViewers(left.definition, right.definition));
54
+ }
55
+ listDiagnostics() {
56
+ return this.duplicateDiagnostics.map(cloneSurfaceViewerRegistryDuplicateDiagnostic);
57
+ }
58
+ }
59
+ function createSurfaceViewerRegistryEntryMetadata(entry) {
60
+ return {
61
+ id: entry.definition.id,
62
+ title: entry.definition.title,
63
+ version: entry.definition.version,
64
+ summary: entry.definition.summary,
65
+ surfaceKinds: [...entry.definition.surfaceKinds],
66
+ projectionKinds: [...entry.definition.projectionKinds],
67
+ componentMode: resolveSurfaceViewerComponentMode(entry)
68
+ };
69
+ }
70
+ function resolveSurfaceViewerComponentMode(entry) {
71
+ if (entry.component && entry.loadComponent) {
72
+ return 'component-and-loader';
73
+ }
74
+ return entry.component ? 'component' : 'loader';
75
+ }
76
+ function cloneSurfaceViewerRegistryDuplicateDiagnostic(diagnostic) {
77
+ return {
78
+ ...diagnostic,
79
+ existing: {
80
+ ...diagnostic.existing,
81
+ surfaceKinds: [...diagnostic.existing.surfaceKinds],
82
+ projectionKinds: [...diagnostic.existing.projectionKinds]
83
+ },
84
+ incoming: {
85
+ ...diagnostic.incoming,
86
+ surfaceKinds: [...diagnostic.incoming.surfaceKinds],
87
+ projectionKinds: [...diagnostic.incoming.projectionKinds]
88
+ }
89
+ };
90
+ }
91
+ function isCompatibleSurfaceViewer(definition, input) {
92
+ const requiredCapabilities = input.requiredCapabilities ?? [];
93
+ return (definition.surfaceKinds.includes(input.surfaceKind) &&
94
+ definition.projectionKinds.includes(input.projectionKind) &&
95
+ requiredCapabilities.every((capability) => definition.capabilities.includes(capability)));
96
+ }
97
+ function compareSurfaceViewers(left, right) {
98
+ const priorityDelta = (right.priority ?? 0) - (left.priority ?? 0);
99
+ if (priorityDelta !== 0) {
100
+ return priorityDelta;
101
+ }
102
+ const titleDelta = left.title.localeCompare(right.title);
103
+ if (titleDelta !== 0) {
104
+ return titleDelta;
105
+ }
106
+ return left.id.localeCompare(right.id);
107
+ }
108
+ function cloneRegisteredSurfaceViewer(entry) {
109
+ return {
110
+ ...entry,
111
+ definition: cloneSurfaceViewerDefinition(entry.definition)
112
+ };
113
+ }
114
+ function cloneSurfaceViewerDefinition(definition) {
115
+ return {
116
+ ...definition,
117
+ surfaceKinds: [...definition.surfaceKinds],
118
+ projectionKinds: [...definition.projectionKinds],
119
+ capabilities: [...definition.capabilities]
120
+ };
121
+ }
@@ -0,0 +1,8 @@
1
+ import type { TemporalDialectCatalog, TemporalDialectCompatibilityInput, TemporalDialectDefinition } from "../../domain/temporal/model.js";
2
+ export declare class InMemoryTemporalDialectRegistry implements TemporalDialectCatalog {
3
+ private readonly entries;
4
+ register(definition: TemporalDialectDefinition): void;
5
+ getDefinition(dialectId: string): TemporalDialectDefinition | undefined;
6
+ list(): TemporalDialectDefinition[];
7
+ listCompatible(input: TemporalDialectCompatibilityInput): TemporalDialectDefinition[];
8
+ }