@hachej/boring-workspace 0.1.71 → 0.1.72

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 (325) hide show
  1. package/dist/{FileTree-B_fRS4Om.js → FileTree-C8JPlZtS.js} +1 -1
  2. package/dist/{MarkdownEditor-C55gVDyW.js → MarkdownEditor-B9wN6tGH.js} +14 -14
  3. package/dist/{WorkspaceLoadingState-D3i4X-eH.js → WorkspaceLoadingState-TgOWTNJC.js} +350 -203
  4. package/dist/{WorkspaceProvider-Ddx7GByq.js → WorkspaceProvider-DcOiZU24.js} +9 -9
  5. package/dist/app-front.d.ts +2 -883
  6. package/dist/app-front.js +1049 -1033
  7. package/dist/app-server.d.ts +4 -4
  8. package/dist/bridge-client.d.ts +2 -2
  9. package/dist/charts.d.ts +2 -119
  10. package/dist/plugin.d.ts +3 -3
  11. package/dist/{runtimeEnv-CU-c4kaV.d.ts → runtimeEnv-DKtVLBXo.d.ts} +2 -2
  12. package/dist/server.d.ts +6 -6
  13. package/dist/shared.d.ts +3 -3
  14. package/dist/src/__tests__/WorkspaceProvider.test.d.ts +1 -0
  15. package/dist/src/__tests__/exploration.property.test.d.ts +1 -0
  16. package/dist/src/__tests__/plugin-integration.test.d.ts +1 -0
  17. package/dist/src/__tests__/public-api.test.d.ts +1 -0
  18. package/dist/src/__tests__/publicFileStateApi.test.d.ts +1 -0
  19. package/dist/src/__tests__/theme-system.test.d.ts +1 -0
  20. package/dist/src/app/front/CloseLeftPaneOnAttention.d.ts +10 -0
  21. package/dist/src/app/front/PluginAppLeftHost.d.ts +18 -0
  22. package/dist/src/app/front/WorkspaceAgentFront.d.ts +174 -0
  23. package/dist/src/app/front/WorkspaceAgentStatusStates.d.ts +5 -0
  24. package/dist/src/app/front/WorkspaceBackgroundBoot.d.ts +10 -0
  25. package/dist/src/app/front/WorkspaceBootGate.d.ts +12 -0
  26. package/dist/src/app/front/WorkspaceFullPagePanel.d.ts +5 -0
  27. package/dist/src/app/front/WorkspaceShellCapabilitiesHost.d.ts +20 -0
  28. package/dist/src/app/front/WorkspaceUiStateSync.d.ts +9 -0
  29. package/dist/src/app/front/__tests__/WorkspaceAgentFront.test.d.ts +1 -0
  30. package/dist/src/app/front/__tests__/WorkspaceBackgroundBoot.test.d.ts +1 -0
  31. package/dist/src/app/front/__tests__/WorkspaceBootGate.test.d.ts +1 -0
  32. package/dist/src/app/front/__tests__/WorkspaceFullPagePanel.test.d.ts +1 -0
  33. package/dist/src/app/front/__tests__/chatPaneState.property.test.d.ts +1 -0
  34. package/dist/src/app/front/__tests__/useWorkspaceShellCapabilitiesController.test.d.ts +1 -0
  35. package/dist/src/app/front/__tests__/workspacePreload.test.d.ts +1 -0
  36. package/dist/src/app/front/chatPaneState.d.ts +8 -0
  37. package/dist/src/app/front/fullPageRoute.d.ts +10 -0
  38. package/dist/src/app/front/fullPageRouteErrors.d.ts +7 -0
  39. package/dist/src/app/front/index.d.ts +8 -0
  40. package/dist/src/app/front/localStorageSessions.d.ts +18 -0
  41. package/dist/src/app/front/useWorkspaceShellCapabilitiesController.d.ts +8 -0
  42. package/dist/src/app/front/workspaceBuiltinPlugins.d.ts +6 -0
  43. package/dist/src/app/front/workspacePreload.d.ts +64 -0
  44. package/dist/src/bridge-client/__tests__/client.test.d.ts +1 -0
  45. package/dist/src/bridge-client/index.d.ts +65 -0
  46. package/dist/src/front/agentPlugins/__tests__/registerAgentPlugin.test.d.ts +1 -0
  47. package/dist/src/front/agentPlugins/registerAgentPlugin.d.ts +26 -0
  48. package/dist/src/front/agentPlugins/reloadEvent.d.ts +7 -0
  49. package/dist/src/front/attention/WorkspaceAttentionProvider.d.ts +71 -0
  50. package/dist/src/front/attention/__tests__/WorkspaceAttentionProvider.test.d.ts +1 -0
  51. package/dist/src/front/attention/index.d.ts +2 -0
  52. package/dist/src/front/bridge/WorkspaceLink.d.ts +35 -0
  53. package/dist/src/front/bridge/__tests__/WorkspaceLink.test.d.ts +1 -0
  54. package/dist/src/front/bridge/__tests__/bridge.property.test.d.ts +1 -0
  55. package/dist/src/front/bridge/__tests__/bridge.test.d.ts +1 -0
  56. package/dist/src/front/bridge/__tests__/client.test.d.ts +1 -0
  57. package/dist/src/front/bridge/__tests__/uiCommandDispatcher.test.d.ts +1 -0
  58. package/dist/src/front/bridge/__tests__/uiCommandStream.test.d.ts +1 -0
  59. package/dist/src/front/bridge/client.d.ts +33 -0
  60. package/dist/src/front/bridge/createBridge.d.ts +8 -0
  61. package/dist/src/front/bridge/index.d.ts +12 -0
  62. package/dist/src/front/bridge/types.d.ts +92 -0
  63. package/dist/src/front/bridge/uiCommandBus.d.ts +3 -0
  64. package/dist/src/front/bridge/uiCommandDispatcher.d.ts +44 -0
  65. package/dist/src/front/bridge/uiCommandStream.d.ts +41 -0
  66. package/dist/src/front/bridge/validation.d.ts +66 -0
  67. package/dist/src/front/charts/__tests__/charts.test.d.ts +1 -0
  68. package/dist/src/front/charts/index.d.ts +92 -0
  69. package/dist/src/front/chrome/artifact-surface/ArtifactSurfacePane.d.ts +18 -0
  70. package/dist/src/front/chrome/artifact-surface/SurfaceShell.d.ts +84 -0
  71. package/dist/src/front/chrome/artifact-surface/__tests__/ArtifactSurfacePane.persistence.test.d.ts +1 -0
  72. package/dist/src/front/chrome/artifact-surface/__tests__/ArtifactSurfacePane.test.d.ts +1 -0
  73. package/dist/src/front/chrome/artifact-surface/__tests__/SurfaceShell.test.d.ts +1 -0
  74. package/dist/src/front/chrome/artifact-surface/__tests__/resolvePanelForPath.test.d.ts +1 -0
  75. package/dist/src/front/chrome/artifact-surface/definition.d.ts +12 -0
  76. package/dist/src/front/chrome/artifact-surface/surfaceShellHelpers.d.ts +10 -0
  77. package/dist/src/front/chrome/chat/ChatPanelHost.d.ts +16 -0
  78. package/dist/src/front/chrome/chat/DetachedChatPopover.d.ts +11 -0
  79. package/dist/src/front/chrome/chat/__tests__/ChatPanelHost.test.d.ts +1 -0
  80. package/dist/src/front/chrome/chat/composerStop.d.ts +19 -0
  81. package/dist/src/front/chrome/chat/definition.d.ts +16 -0
  82. package/dist/src/front/chrome/chat/types.d.ts +30 -0
  83. package/dist/src/front/chrome/empty-pane/EmptyPane.d.ts +5 -0
  84. package/dist/src/front/chrome/empty-pane/__tests__/EmptyPane.test.d.ts +1 -0
  85. package/dist/src/front/chrome/management/ManagementOverlaySurface.d.ts +16 -0
  86. package/dist/src/front/chrome/plugins/PluginsOverlay.d.ts +16 -0
  87. package/dist/src/front/chrome/session-list/SessionBrowser.d.ts +20 -0
  88. package/dist/src/front/chrome/session-list/__tests__/SessionBrowser.test.d.ts +1 -0
  89. package/dist/src/front/chrome/session-list/definition.d.ts +28 -0
  90. package/dist/src/front/chrome/skills/SkillsPage.d.ts +11 -0
  91. package/dist/src/front/chrome/skills/definition.d.ts +3 -0
  92. package/dist/src/front/chrome/workbench-left/WorkbenchLeftPane.d.ts +28 -0
  93. package/dist/src/front/chrome/workbench-left/__tests__/WorkbenchLeftPane.test.d.ts +1 -0
  94. package/dist/src/front/chrome/workbench-left/definition.d.ts +12 -0
  95. package/dist/src/front/chrome/workbench-left/useWorkspaceLeftPaneActions.d.ts +48 -0
  96. package/dist/src/front/components/CommandPalette.d.ts +21 -0
  97. package/dist/src/front/components/ControlTooltip.d.ts +12 -0
  98. package/dist/src/front/components/ErrorChip.d.ts +6 -0
  99. package/dist/src/front/components/PanelErrorBoundary.d.ts +22 -0
  100. package/dist/src/front/components/SessionList.d.ts +15 -0
  101. package/dist/src/front/components/WorkspaceLoadingState.d.ts +8 -0
  102. package/dist/src/front/components/__tests__/CommandPalette.test.d.ts +1 -0
  103. package/dist/src/front/components/__tests__/PanelErrorBoundary.test.d.ts +1 -0
  104. package/dist/src/front/components/__tests__/SessionList.test.d.ts +1 -0
  105. package/dist/src/front/components/__tests__/WorkspaceLoadingState.test.d.ts +1 -0
  106. package/dist/src/front/components/commandPaletteHelpers.d.ts +16 -0
  107. package/dist/src/front/components/recent/__tests__/migrate.test.d.ts +1 -0
  108. package/dist/src/front/components/recent/__tests__/recentStore.test.d.ts +1 -0
  109. package/dist/src/front/components/recent/index.d.ts +2 -0
  110. package/dist/src/front/components/recent/recentStore.d.ts +9 -0
  111. package/dist/src/front/components/recent/types.d.ts +23 -0
  112. package/dist/src/front/components/useCommandPaletteCatalogSearch.d.ts +7 -0
  113. package/dist/src/front/components/useCommandPaletteChrome.d.ts +14 -0
  114. package/dist/src/front/components/useCommandPaletteSelection.d.ts +15 -0
  115. package/dist/src/front/detached/DetachedPanelPopover.d.ts +2 -0
  116. package/dist/src/front/detached/detachedPanelTypes.d.ts +21 -0
  117. package/dist/src/front/detached/useDetachedPanelPosition.d.ts +10 -0
  118. package/dist/src/front/dock/DockviewShell.d.ts +6 -0
  119. package/dist/src/front/dock/PanelChrome.d.ts +16 -0
  120. package/dist/src/front/dock/ShadcnTab.d.ts +2 -0
  121. package/dist/src/front/dock/__tests__/dock.test.d.ts +1 -0
  122. package/dist/src/front/dock/index.d.ts +3 -0
  123. package/dist/src/front/dock/types.d.ts +69 -0
  124. package/dist/src/front/events/__tests__/agentBridge.test.d.ts +1 -0
  125. package/dist/src/front/events/__tests__/bus.test.d.ts +1 -0
  126. package/dist/src/front/events/__tests__/types.test.d.ts +1 -0
  127. package/dist/src/front/events/__tests__/useEvent.test.d.ts +1 -0
  128. package/dist/src/front/events/agentBridge.d.ts +1 -0
  129. package/dist/src/front/events/bus.d.ts +21 -0
  130. package/dist/src/front/events/index.d.ts +7 -0
  131. package/dist/src/front/events/types.d.ts +137 -0
  132. package/dist/src/front/events/useEvent.d.ts +7 -0
  133. package/dist/src/front/fullPage.d.ts +24 -0
  134. package/dist/src/front/hooks/__tests__/useArtifactPanels.test.d.ts +1 -0
  135. package/dist/src/front/hooks/__tests__/useArtifactRouting.test.d.ts +1 -0
  136. package/dist/src/front/hooks/__tests__/useEditorLifecycle.test.d.ts +1 -0
  137. package/dist/src/front/hooks/__tests__/useKeyboardShortcuts.test.d.ts +1 -0
  138. package/dist/src/front/hooks/__tests__/useViewportBreakpoint.test.d.ts +1 -0
  139. package/dist/src/front/hooks/index.d.ts +6 -0
  140. package/dist/src/front/hooks/useArtifactPanels.d.ts +14 -0
  141. package/dist/src/front/hooks/useArtifactRouting.d.ts +12 -0
  142. package/dist/src/front/hooks/useEditorLifecycle.d.ts +27 -0
  143. package/dist/src/front/hooks/useKeyboardShortcuts.d.ts +13 -0
  144. package/dist/src/front/hooks/useResponsiveSidebarCollapse.d.ts +6 -0
  145. package/dist/src/front/hooks/useViewportBreakpoint.d.ts +1 -0
  146. package/dist/src/front/layout/ChatLayout.d.ts +4 -0
  147. package/dist/src/front/layout/ChatPaneStage.d.ts +59 -0
  148. package/dist/src/front/layout/ChatPaneStageDock.d.ts +5 -0
  149. package/dist/src/front/layout/IdeLayout.d.ts +4 -0
  150. package/dist/src/front/layout/ResponsiveDockviewShell.d.ts +6 -0
  151. package/dist/src/front/layout/ThemeToggle.d.ts +10 -0
  152. package/dist/src/front/layout/TopBar.d.ts +17 -0
  153. package/dist/src/front/layout/__tests__/ChatPaneStageDock.test.d.ts +1 -0
  154. package/dist/src/front/layout/__tests__/TopBar.test.d.ts +1 -0
  155. package/dist/src/front/layout/__tests__/presets.test.d.ts +1 -0
  156. package/dist/src/front/layout/cornerChrome.d.ts +10 -0
  157. package/dist/src/front/layout/index.d.ts +9 -0
  158. package/dist/src/front/layout/mobileShell.d.ts +18 -0
  159. package/dist/src/front/layout/paneCollapseButton.d.ts +15 -0
  160. package/dist/src/front/layout/plugin-tabs/AppLeftOverlayChromeContext.d.ts +1 -0
  161. package/dist/src/front/layout/plugin-tabs/AppLeftPane.d.ts +75 -0
  162. package/dist/src/front/layout/plugin-tabs/AppLeftPaneActions.d.ts +13 -0
  163. package/dist/src/front/layout/plugin-tabs/AppLeftPaneHeader.d.ts +7 -0
  164. package/dist/src/front/layout/plugin-tabs/AppLeftPaneProjects.d.ts +18 -0
  165. package/dist/src/front/layout/plugin-tabs/AppLeftPaneSections.d.ts +6 -0
  166. package/dist/src/front/layout/plugin-tabs/AppLeftPaneSessionRow.d.ts +18 -0
  167. package/dist/src/front/layout/plugin-tabs/PluginTabsWorkspaceShell.d.ts +15 -0
  168. package/dist/src/front/layout/plugin-tabs/__tests__/AppLeftPane.test.d.ts +1 -0
  169. package/dist/src/front/layout/types.d.ts +40 -0
  170. package/dist/src/front/layout/useViewportWidth.d.ts +1 -0
  171. package/dist/src/front/lib/utils.d.ts +2 -0
  172. package/dist/src/front/lib/utils.test.d.ts +1 -0
  173. package/dist/src/front/lib/validation.d.ts +189 -0
  174. package/dist/src/front/plugin/PluginErrorBoundary.d.ts +21 -0
  175. package/dist/src/front/plugin/PluginErrorContext.d.ts +19 -0
  176. package/dist/src/front/plugin/PluginInspector.d.ts +8 -0
  177. package/dist/src/front/plugin/__tests__/CatalogRegistry.test.d.ts +1 -0
  178. package/dist/src/front/plugin/__tests__/PluginErrorBoundary.test.d.ts +1 -0
  179. package/dist/src/front/plugin/__tests__/PluginInspector.test.d.ts +1 -0
  180. package/dist/src/front/plugin/__tests__/useWorkspacePluginClient.test.d.ts +1 -0
  181. package/dist/src/front/plugin/index.d.ts +10 -0
  182. package/dist/src/front/plugin/useActivePanels.d.ts +2 -0
  183. package/dist/src/front/plugin/useCatalogs.d.ts +2 -0
  184. package/dist/src/front/plugin/useCommands.d.ts +2 -0
  185. package/dist/src/front/plugin/useWorkspacePluginClient.d.ts +29 -0
  186. package/dist/src/front/provider/WorkspaceProvider.d.ts +84 -0
  187. package/dist/src/front/provider/index.d.ts +9 -0
  188. package/dist/src/front/provider/workspaceTitle.d.ts +5 -0
  189. package/dist/src/front/registry/PanelRegistry.d.ts +39 -0
  190. package/dist/src/front/registry/PanelRenderStatusBoundary.d.ts +38 -0
  191. package/dist/src/front/registry/RegistryProvider.d.ts +21 -0
  192. package/dist/src/front/registry/WorkspaceSourceRegistry.d.ts +25 -0
  193. package/dist/src/front/registry/__tests__/registry.test.d.ts +1 -0
  194. package/dist/src/front/registry/__tests__/replaceByPluginId.test.d.ts +1 -0
  195. package/dist/src/front/registry/__tests__/subscribe.test.d.ts +1 -0
  196. package/dist/src/front/registry/coreRegistrations.d.ts +2 -0
  197. package/dist/src/front/registry/getFileIcon.d.ts +2 -0
  198. package/dist/src/front/registry/index.d.ts +7 -0
  199. package/dist/src/front/registry/types.d.ts +2 -0
  200. package/dist/src/front/shell/WorkspaceShellCapabilitiesContext.d.ts +1 -0
  201. package/dist/src/front/store/__tests__/store.property.test.d.ts +1 -0
  202. package/dist/src/front/store/__tests__/store.test.d.ts +1 -0
  203. package/dist/src/front/store/index.d.ts +35 -0
  204. package/dist/src/front/store/localStorageValues.d.ts +4 -0
  205. package/dist/src/front/store/selectors.d.ts +21 -0
  206. package/dist/src/front/store/types.d.ts +53 -0
  207. package/dist/src/front/testing/TestWorkspaceProvider.d.ts +13 -0
  208. package/dist/src/front/testing/__tests__/testing.test.d.ts +1 -0
  209. package/dist/src/front/testing/createLocalStorageSessions.d.ts +16 -0
  210. package/dist/src/front/testing/createMockBridge.d.ts +20 -0
  211. package/dist/src/front/testing/createMockPaneProps.d.ts +11 -0
  212. package/dist/src/front/testing/createMockRegistry.d.ts +7 -0
  213. package/dist/src/front/testing/createMockSessions.d.ts +24 -0
  214. package/dist/src/front/testing/e2e.d.ts +61 -0
  215. package/dist/src/front/testing/index.d.ts +17 -0
  216. package/dist/src/front/testing/mockApi.d.ts +9 -0
  217. package/dist/src/front/testing/renderPane.d.ts +20 -0
  218. package/dist/src/front/theme/codemirror-theme.d.ts +4 -0
  219. package/dist/src/front/theme/index.d.ts +1 -0
  220. package/dist/src/front/toast/__tests__/toast.test.d.ts +1 -0
  221. package/dist/src/front/toast/index.d.ts +1 -0
  222. package/dist/src/index.d.ts +90 -0
  223. package/dist/src/plugin.d.ts +19 -0
  224. package/dist/src/plugins/filesystemPlugin/front/ConflictBanner.d.ts +14 -0
  225. package/dist/src/plugins/filesystemPlugin/front/FilePaneShell.d.ts +73 -0
  226. package/dist/src/plugins/filesystemPlugin/front/__tests__/agentFileBridge.test.d.ts +1 -0
  227. package/dist/src/plugins/filesystemPlugin/front/__tests__/filePanelBinding.test.d.ts +1 -0
  228. package/dist/src/plugins/filesystemPlugin/front/__tests__/filesystemPlugin.test.d.ts +1 -0
  229. package/dist/src/plugins/filesystemPlugin/front/__tests__/search.test.d.ts +1 -0
  230. package/dist/src/plugins/filesystemPlugin/front/__tests__/useFilePane.test.d.ts +1 -0
  231. package/dist/src/plugins/filesystemPlugin/front/agentFileBridge.d.ts +12 -0
  232. package/dist/src/plugins/filesystemPlugin/front/catalogs.d.ts +9 -0
  233. package/dist/src/plugins/filesystemPlugin/front/code-editor/CodeEditor.d.ts +10 -0
  234. package/dist/src/plugins/filesystemPlugin/front/code-editor/CodeEditorPane.d.ts +8 -0
  235. package/dist/src/plugins/filesystemPlugin/front/code-editor/__tests__/CodeEditor.test.d.ts +1 -0
  236. package/dist/src/plugins/filesystemPlugin/front/code-editor/__tests__/CodeEditorPane.test.d.ts +1 -0
  237. package/dist/src/plugins/filesystemPlugin/front/data/DataProvider.d.ts +16 -0
  238. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/fetchClient.integration.test.d.ts +1 -0
  239. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/fetchClient.test.d.ts +1 -0
  240. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/fileRecords.test.d.ts +1 -0
  241. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/hooks.test.d.ts +1 -0
  242. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/useFileEventInvalidation.test.d.ts +1 -0
  243. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/useFileEventStream.test.d.ts +1 -0
  244. package/dist/src/plugins/filesystemPlugin/front/data/__tests__/useFileUpload.test.d.ts +1 -0
  245. package/dist/src/plugins/filesystemPlugin/front/data/fetchClient.d.ts +63 -0
  246. package/dist/src/plugins/filesystemPlugin/front/data/fileRecords.d.ts +34 -0
  247. package/dist/src/plugins/filesystemPlugin/front/data/filesystemErrorRedaction.d.ts +2 -0
  248. package/dist/src/plugins/filesystemPlugin/front/data/hooks.d.ts +48 -0
  249. package/dist/src/plugins/filesystemPlugin/front/data/index.d.ts +9 -0
  250. package/dist/src/plugins/filesystemPlugin/front/data/treePreloadCache.d.ts +3 -0
  251. package/dist/src/plugins/filesystemPlugin/front/data/types.d.ts +37 -0
  252. package/dist/src/plugins/filesystemPlugin/front/data/useFileEventInvalidation.d.ts +28 -0
  253. package/dist/src/plugins/filesystemPlugin/front/data/useFileEventStream.d.ts +27 -0
  254. package/dist/src/plugins/filesystemPlugin/front/data/useFileUpload.d.ts +12 -0
  255. package/dist/src/plugins/filesystemPlugin/front/empty-file-panel/EmptyFilePanel.d.ts +6 -0
  256. package/dist/src/plugins/filesystemPlugin/front/empty-file-panel/definition.d.ts +8 -0
  257. package/dist/src/plugins/filesystemPlugin/front/events.d.ts +6 -0
  258. package/dist/src/plugins/filesystemPlugin/front/file-tree/FileTree.d.ts +59 -0
  259. package/dist/src/plugins/filesystemPlugin/front/file-tree/FileTreeView.d.ts +83 -0
  260. package/dist/src/plugins/filesystemPlugin/front/file-tree/__tests__/FileTree.test.d.ts +1 -0
  261. package/dist/src/plugins/filesystemPlugin/front/file-tree/__tests__/FileTreePane.test.d.ts +1 -0
  262. package/dist/src/plugins/filesystemPlugin/front/file-tree/__tests__/copyToClipboard.test.d.ts +1 -0
  263. package/dist/src/plugins/filesystemPlugin/front/file-tree/clipboard.d.ts +6 -0
  264. package/dist/src/plugins/filesystemPlugin/front/file-tree/dndManager.d.ts +8 -0
  265. package/dist/src/plugins/filesystemPlugin/front/file-tree/treeModel.d.ts +20 -0
  266. package/dist/src/plugins/filesystemPlugin/front/filePanelBinding.d.ts +1 -0
  267. package/dist/src/plugins/filesystemPlugin/front/html-viewer/HtmlViewer.d.ts +18 -0
  268. package/dist/src/plugins/filesystemPlugin/front/html-viewer/HtmlViewer.test.d.ts +1 -0
  269. package/dist/src/plugins/filesystemPlugin/front/html-viewer/HtmlViewerPane.d.ts +7 -0
  270. package/dist/src/plugins/filesystemPlugin/front/index.d.ts +11 -0
  271. package/dist/src/plugins/filesystemPlugin/front/markdown-editor/MarkdownEditor.d.ts +44 -0
  272. package/dist/src/plugins/filesystemPlugin/front/markdown-editor/MarkdownEditorPane.d.ts +8 -0
  273. package/dist/src/plugins/filesystemPlugin/front/markdown-editor/ResizableImage.d.ts +10 -0
  274. package/dist/src/plugins/filesystemPlugin/front/markdown-editor/__tests__/MarkdownEditor.test.d.ts +1 -0
  275. package/dist/src/plugins/filesystemPlugin/front/markdown-editor/__tests__/MarkdownEditorPane.test.d.ts +1 -0
  276. package/dist/src/plugins/filesystemPlugin/front/media-viewer/MediaViewer.d.ts +9 -0
  277. package/dist/src/plugins/filesystemPlugin/front/media-viewer/MediaViewer.test.d.ts +1 -0
  278. package/dist/src/plugins/filesystemPlugin/front/media-viewer/MediaViewerPane.d.ts +8 -0
  279. package/dist/src/plugins/filesystemPlugin/front/media-viewer/useMediaViewerReload.d.ts +8 -0
  280. package/dist/src/plugins/filesystemPlugin/front/media-viewer/useMediaViewerReload.test.d.ts +1 -0
  281. package/dist/src/plugins/filesystemPlugin/front/search.d.ts +5 -0
  282. package/dist/src/plugins/filesystemPlugin/front/search.test.d.ts +1 -0
  283. package/dist/src/plugins/filesystemPlugin/front/surfaceResolver.d.ts +10 -0
  284. package/dist/src/plugins/filesystemPlugin/front/useFilePane.d.ts +61 -0
  285. package/dist/src/plugins/filesystemPlugin/shared/constants.d.ts +12 -0
  286. package/dist/src/plugins/filesystemPlugin/shared/events.d.ts +39 -0
  287. package/dist/src/shared/__tests__/filesystem.test.d.ts +1 -0
  288. package/dist/src/shared/__tests__/telemetry.test.d.ts +1 -0
  289. package/dist/src/shared/__tests__/workspaceBridgeRpc.test.d.ts +1 -0
  290. package/dist/src/shared/index.d.ts +25 -0
  291. package/dist/src/shared/plugins/CatalogRegistry.d.ts +28 -0
  292. package/dist/src/shared/plugins/CommandRegistry.d.ts +23 -0
  293. package/dist/src/shared/plugins/SurfaceResolverRegistry.d.ts +24 -0
  294. package/dist/src/shared/plugins/__tests__/bootstrap.test.d.ts +1 -0
  295. package/dist/src/shared/plugins/__tests__/frontFactory.test.d.ts +1 -0
  296. package/dist/src/shared/plugins/__tests__/manifest.test.d.ts +1 -0
  297. package/dist/src/shared/plugins/__tests__/uiBridgeRegistry.test.d.ts +1 -0
  298. package/dist/src/shared/plugins/appLeftOverlayChrome.d.ts +10 -0
  299. package/dist/src/shared/plugins/bootstrap.d.ts +41 -0
  300. package/dist/src/shared/plugins/errors.d.ts +5 -0
  301. package/dist/src/shared/plugins/frontFactory.d.ts +166 -0
  302. package/dist/src/shared/plugins/index.d.ts +5 -0
  303. package/dist/src/shared/plugins/manifest.d.ts +58 -0
  304. package/dist/src/shared/plugins/runtimePluginTypes.d.ts +51 -0
  305. package/dist/src/shared/plugins/types.d.ts +84 -0
  306. package/dist/src/shared/plugins/uiBridgeRegistry.d.ts +44 -0
  307. package/dist/src/shared/plugins/workspaceShellCapabilities.d.ts +44 -0
  308. package/dist/src/shared/telemetry.d.ts +11 -0
  309. package/dist/src/shared/types/agent-tool.d.ts +30 -0
  310. package/dist/src/shared/types/boring-core-front.d.ts +2 -0
  311. package/dist/src/shared/types/filesystem.d.ts +15 -0
  312. package/dist/src/shared/types/panel.d.ts +123 -0
  313. package/dist/src/shared/types/surface.d.ts +42 -0
  314. package/dist/src/shared/ui-bridge.d.ts +77 -0
  315. package/dist/src/shared/workspace-bridge-rpc.d.ts +122 -0
  316. package/dist/{surface-aLQ_Hryw.d.ts → surface-h6IgrsK5.d.ts} +1 -1
  317. package/dist/testing-e2e.d.ts +2 -73
  318. package/dist/testing.d.ts +2 -433
  319. package/dist/testing.js +11 -11
  320. package/dist/{ui-bridge-D2eO3epD.d.ts → ui-bridge-C4CyIrQA.d.ts} +1 -1
  321. package/dist/{workspace-bridge-rpc-A98RA5o6.d.ts → workspace-bridge-rpc-BHsOJMlW.d.ts} +1 -1
  322. package/dist/workspace.css +21 -0
  323. package/dist/workspace.d.ts +2 -2649
  324. package/dist/workspace.js +40 -40
  325. package/package.json +4 -4
@@ -0,0 +1,64 @@
1
+ export declare const DEFAULT_BOOT_PRELOAD_PATHS: string[];
2
+ export type WorkspaceRuntimeDependenciesWarmupStatus = {
3
+ state: "preparing" | "ready" | "failed";
4
+ message?: string;
5
+ requirement?: string;
6
+ };
7
+ export type WorkspaceWarmupStatus = {
8
+ status: "preparing";
9
+ requirement?: "workspace-fs" | "sandbox-exec" | "ui-bridge";
10
+ message?: string;
11
+ runtimeDependencies?: WorkspaceRuntimeDependenciesWarmupStatus;
12
+ } | {
13
+ status: "ready";
14
+ runtimeDependencies?: WorkspaceRuntimeDependenciesWarmupStatus;
15
+ } | {
16
+ status: "failed";
17
+ message: string;
18
+ requirement?: "workspace-fs" | "sandbox-exec" | "ui-bridge";
19
+ runtimeDependencies?: WorkspaceRuntimeDependenciesWarmupStatus;
20
+ };
21
+ /**
22
+ * Convert an absolute filesystem path into a workspace-relative one when it
23
+ * lives inside `workspaceRoot`. The workspace HTTP file API (`/api/v1/files`,
24
+ * tree, etc.) is relative-only and rejects absolute paths with a 403 — but the
25
+ * agent's tool inputs (read/write/edit) surface absolute paths. Clicking such
26
+ * a path to open it in the workbench therefore needs this translation.
27
+ *
28
+ * Already-relative paths and absolute paths that fall outside the root are
29
+ * returned unchanged (the latter will legitimately 403). The workspace root
30
+ * itself maps to ".".
31
+ */
32
+ export declare function relativizeWorkspacePath(path: string, workspaceRoot: string | null | undefined): string;
33
+ export declare function preloadUrl(apiBaseUrl: string | null | undefined, path: string): string;
34
+ export declare function workspaceRequestHeaders(workspaceId: string, headers?: Record<string, string>): Record<string, string>;
35
+ export declare function treePreloadDir(path: string): string | null;
36
+ export declare function seedTreePreloadFromBody(apiBaseUrl: string | null | undefined, workspaceId: string, path: string, body: {
37
+ entries?: unknown;
38
+ } | null): void;
39
+ export interface WorkspaceReadyError {
40
+ code?: unknown;
41
+ retryable?: unknown;
42
+ requirement?: unknown;
43
+ }
44
+ export interface WarmupPreparingResult {
45
+ requirement?: "workspace-fs" | "sandbox-exec" | "ui-bridge";
46
+ }
47
+ export declare function parseWorkspaceReadyError(payload: unknown): WorkspaceReadyError | null;
48
+ export declare function parseRetryableWarmupPreparing(payload: unknown): WarmupPreparingResult | null;
49
+ export declare function isAgentRuntimeWarmupPath(path: string): boolean;
50
+ export declare function isReadyStatusPath(path: string): boolean;
51
+ export declare function resolveBootPreloadPaths(preloadPaths: string[], provisionWorkspace: boolean): string[];
52
+ export declare function errorMessageFromPayload(payload: unknown): string | null;
53
+ export interface ReadyStatusWarmupSnapshot {
54
+ state?: string;
55
+ message?: string;
56
+ chatState?: string;
57
+ workspaceState?: string;
58
+ runtimeDependenciesState?: string;
59
+ runtimeDependenciesMessage?: string;
60
+ runtimeDependenciesRequirement?: string;
61
+ }
62
+ export declare function parseReadyStatusSse(payload: unknown): ReadyStatusWarmupSnapshot | null;
63
+ export declare function readyStatusSupportsWorkspaceUse(status: ReadyStatusWarmupSnapshot | null): boolean;
64
+ export declare function readResponsePayload(response: Response): Promise<unknown>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,65 @@
1
+ import { WORKSPACE_BRIDGE_DISABLED_ENV, WORKSPACE_BRIDGE_REFRESH_TOKEN_ENV, WORKSPACE_BRIDGE_TOKEN_ENV, WORKSPACE_BRIDGE_TOKEN_URL_ENV, WORKSPACE_BRIDGE_URL_ENV, WorkspaceBridgeErrorCode, WorkspaceBridgeCallFailure, WorkspaceBridgeCallRequest, WorkspaceBridgeCallResponse, WorkspaceBridgeCallSuccess, WorkspaceBridgeError } from '../shared/workspace-bridge-rpc';
2
+ export { WORKSPACE_BRIDGE_DISABLED_ENV, WORKSPACE_BRIDGE_REFRESH_TOKEN_ENV, WORKSPACE_BRIDGE_TOKEN_ENV, WORKSPACE_BRIDGE_TOKEN_URL_ENV, WORKSPACE_BRIDGE_URL_ENV, WorkspaceBridgeErrorCode, type WorkspaceBridgeCallFailure, type WorkspaceBridgeCallRequest, type WorkspaceBridgeCallResponse, type WorkspaceBridgeCallSuccess, type WorkspaceBridgeError, };
3
+ export declare enum WorkspaceBridgeClientErrorCode {
4
+ Config = "WORKSPACE_BRIDGE_CLIENT_CONFIG_ERROR",
5
+ InvalidResponse = "WORKSPACE_BRIDGE_INVALID_RESPONSE",
6
+ Transport = "WORKSPACE_BRIDGE_TRANSPORT_ERROR",
7
+ Timeout = "WORKSPACE_BRIDGE_TIMEOUT",
8
+ Aborted = "WORKSPACE_BRIDGE_ABORTED",
9
+ HttpError = "WORKSPACE_BRIDGE_HTTP_ERROR"
10
+ }
11
+ export interface WorkspaceBridgeTokenProviderContext {
12
+ /** True when the previous attempt failed with a 401 and the client is retrying once. */
13
+ refresh: boolean;
14
+ /** Aborts when the per-attempt timeout or caller AbortSignal fires. */
15
+ signal?: AbortSignal;
16
+ }
17
+ export type WorkspaceBridgeTokenProvider = (context: WorkspaceBridgeTokenProviderContext) => string | Promise<string>;
18
+ export type WorkspaceBridgeClientToken = string | WorkspaceBridgeTokenProvider;
19
+ export interface WorkspaceBridgeClientOptions {
20
+ url: string;
21
+ token: WorkspaceBridgeClientToken;
22
+ fetch?: typeof fetch;
23
+ /** Default per-attempt timeout. Defaults to 30s. */
24
+ defaultTimeoutMs?: number;
25
+ }
26
+ export interface WorkspaceBridgeClientCallOptions {
27
+ requestId?: string;
28
+ idempotencyKey?: string;
29
+ timeoutMs?: number;
30
+ signal?: AbortSignal;
31
+ }
32
+ export declare class WorkspaceBridgeClientConfigError extends Error {
33
+ readonly code = WorkspaceBridgeClientErrorCode.Config;
34
+ readonly missingVar?: string;
35
+ constructor(message: string, options?: {
36
+ missingVar?: string;
37
+ });
38
+ }
39
+ export declare class WorkspaceBridgeClientError extends Error {
40
+ readonly code: WorkspaceBridgeErrorCode | WorkspaceBridgeClientErrorCode;
41
+ readonly status?: number;
42
+ readonly requestId?: string;
43
+ constructor(message: string, options: {
44
+ code: WorkspaceBridgeErrorCode | WorkspaceBridgeClientErrorCode;
45
+ status?: number;
46
+ requestId?: string;
47
+ cause?: unknown;
48
+ });
49
+ }
50
+ export declare class WorkspaceBridgeClient {
51
+ readonly url: string;
52
+ private readonly token;
53
+ private readonly fetchImpl;
54
+ private readonly defaultTimeoutMs;
55
+ constructor(options: WorkspaceBridgeClientOptions);
56
+ static fromEnv(env?: Record<string, string | undefined>, options?: {
57
+ fetch?: typeof fetch;
58
+ token?: WorkspaceBridgeClientToken;
59
+ defaultTimeoutMs?: number;
60
+ }): WorkspaceBridgeClient;
61
+ call<TOutput = unknown, TInput = unknown>(op: string, input: TInput, options?: WorkspaceBridgeClientCallOptions): Promise<TOutput>;
62
+ private callOnce;
63
+ private resolveToken;
64
+ private shouldRetryWithFreshToken;
65
+ }
@@ -0,0 +1,26 @@
1
+ import { BoringFrontFactoryWithId } from '../../shared/plugins/frontFactory';
2
+ declare global {
3
+ var __BORING_RUNTIME_SINGLETONS__: Record<string, unknown> | undefined;
4
+ }
5
+ export interface RegisterAgentPluginOptions {
6
+ apiBaseUrl?: string;
7
+ workspaceId?: string;
8
+ enabled?: boolean;
9
+ authHeaders?: Record<string, string>;
10
+ importFront?: (frontUrl: string, revision: number) => Promise<{
11
+ default?: BoringFrontFactoryWithId;
12
+ }>;
13
+ frontImportRetry?: {
14
+ attempts?: number;
15
+ delayMs?: number;
16
+ };
17
+ reportFrontError?: (report: FrontErrorReport) => void;
18
+ }
19
+ export interface FrontErrorReport {
20
+ pluginId: string;
21
+ revision: number;
22
+ message: string;
23
+ url?: string;
24
+ }
25
+ export declare function appendFrontImportRevision(frontUrl: string, revision: number, cacheBust?: string | number): string;
26
+ export declare function useAgentPluginHotReload(options: RegisterAgentPluginOptions): void;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Browser event emitted after the runtime plugin registry applies a load/unload
3
+ * event. Keep literal in sync with @hachej/boring-agent's composer listener;
4
+ * do not import from agent here because workspace base front code must stay
5
+ * agent-free.
6
+ */
7
+ export declare const WORKSPACE_AGENT_PLUGINS_RELOADED_EVENT = "boring-ui:agent-plugins-reloaded";
@@ -0,0 +1,71 @@
1
+ import { ReactNode } from 'react';
2
+ export declare const WORKSPACE_ATTENTION_ACTION_EVENT: "boring-workspace:attention-action";
3
+ export type WorkspaceAttentionBlockerAction = {
4
+ id: string;
5
+ label: string;
6
+ };
7
+ export type WorkspaceAttentionSessionBadge = {
8
+ /** Stable badge kind for data attributes and plugin-specific styling hooks. */
9
+ kind: string;
10
+ /** Short text rendered on the session row, e.g. "question", "review", "approval". */
11
+ label: string;
12
+ /** Visual tone only; semantics are owned by the plugin-specific kind/reason. */
13
+ tone?: "attention" | "danger" | "neutral" | "warning";
14
+ /** Higher priority wins when several plugins mark the same session. */
15
+ priority?: number;
16
+ };
17
+ export type WorkspaceAttentionInboxMetadata = {
18
+ kind: "question" | "review" | "approval" | "notice";
19
+ sourceLabel: string;
20
+ createdAt?: string | number | Date;
21
+ updatedAt?: string | number | Date;
22
+ priority?: number;
23
+ };
24
+ export type WorkspaceAttentionFocusMetadata = {
25
+ /** Close the workbench left pane when this blocker becomes active for the current session. */
26
+ closeWorkbenchLeftPane?: boolean;
27
+ };
28
+ export type WorkspaceAttentionBlocker = {
29
+ id: string;
30
+ /** Plugin/domain-specific reason, e.g. "ask-user.question" or "pr-review.review". */
31
+ reason: string;
32
+ surfaceKind?: string;
33
+ target?: string;
34
+ label?: string;
35
+ sessionId?: string;
36
+ /** Optional generic session-row badge contributed by the plugin that owns this attention. */
37
+ sessionBadge?: WorkspaceAttentionSessionBadge;
38
+ /**
39
+ * Remove this blocker once its workspace chat session disappears from the
40
+ * authoritative session list. Leave unset for external inbox items whose
41
+ * `sessionId` is a source/thread identifier rather than a local chat id.
42
+ */
43
+ pruneWhenSessionMissing?: boolean;
44
+ /** Explicit inbox projection metadata. New inbox-aware plugins should provide this instead of relying on reason parsing. */
45
+ inbox?: WorkspaceAttentionInboxMetadata;
46
+ /** Optional shell focus behavior requested by the plugin that owns this blocker. */
47
+ focus?: WorkspaceAttentionFocusMetadata;
48
+ actions?: WorkspaceAttentionBlockerAction[];
49
+ };
50
+ export type WorkspaceAttentionActionDetail = {
51
+ blockerId: string;
52
+ actionId: string;
53
+ blocker: WorkspaceAttentionBlocker;
54
+ sessionId?: string;
55
+ };
56
+ export declare function emitWorkspaceAttentionAction(detail: WorkspaceAttentionActionDetail): void;
57
+ export declare function workspaceAttentionSessionBadgeForBlocker(blocker: Pick<WorkspaceAttentionBlocker, "reason" | "sessionBadge">): WorkspaceAttentionSessionBadge | null;
58
+ export interface WorkspaceAttentionContextValue {
59
+ blockers: WorkspaceAttentionBlocker[];
60
+ addBlocker: (blocker: WorkspaceAttentionBlocker) => void;
61
+ removeBlocker: (id: string) => void;
62
+ }
63
+ export type WorkspaceAttentionProviderProps = {
64
+ children: ReactNode;
65
+ /** Authoritative set of existing chat sessions. Blockers that opt into pruning outside this set are stale and removed. */
66
+ knownSessionIds?: readonly string[];
67
+ /** Keep false while sessions are still loading/paginated so valid blockers are not pruned early. */
68
+ knownSessionsAuthoritative?: boolean;
69
+ };
70
+ export declare function useWorkspaceAttention(): WorkspaceAttentionContextValue;
71
+ export declare function WorkspaceAttentionProvider({ children, knownSessionIds, knownSessionsAuthoritative }: WorkspaceAttentionProviderProps): import("react").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { WORKSPACE_ATTENTION_ACTION_EVENT, WorkspaceAttentionProvider, emitWorkspaceAttentionAction, useWorkspaceAttention, workspaceAttentionSessionBadgeForBlocker, } from './WorkspaceAttentionProvider';
2
+ export type { WorkspaceAttentionActionDetail, WorkspaceAttentionBlocker, WorkspaceAttentionBlockerAction, WorkspaceAttentionContextValue, WorkspaceAttentionProviderProps, WorkspaceAttentionSessionBadge, WorkspaceAttentionFocusMetadata, } from './WorkspaceAttentionProvider';
@@ -0,0 +1,35 @@
1
+ import { MouseEvent, ReactElement, ReactNode } from 'react';
2
+ import { FilesystemId } from '../../shared/types/filesystem';
3
+ import { UiCommand } from './types';
4
+ export type WorkspaceLinkTarget = {
5
+ kind: "openFile";
6
+ path: string;
7
+ mode?: "view" | "edit" | "diff";
8
+ filesystem?: FilesystemId;
9
+ } | {
10
+ kind: "openSurface";
11
+ surfaceKind: string;
12
+ target: string;
13
+ filesystem?: FilesystemId;
14
+ meta?: Record<string, unknown>;
15
+ } | {
16
+ kind: "openPanel";
17
+ id: string;
18
+ component: string;
19
+ title?: string;
20
+ params?: Record<string, unknown>;
21
+ } | {
22
+ kind: "expandToFile";
23
+ path: string;
24
+ };
25
+ export interface WorkspaceLinkProps {
26
+ to: WorkspaceLinkTarget;
27
+ children: ReactNode;
28
+ className?: string;
29
+ title?: string;
30
+ href?: string;
31
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
32
+ }
33
+ export declare function workspaceLinkCommand(to: WorkspaceLinkTarget): UiCommand;
34
+ export declare function workspaceLinkHref(to: WorkspaceLinkTarget): string;
35
+ export declare function WorkspaceLink({ to, children, className, title, href, onClick }: WorkspaceLinkProps): ReactElement;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,33 @@
1
+ import { WorkspaceBridge, CausedBy } from './types';
2
+ import { WorkspaceStore, PanelState } from '../store/types';
3
+ export interface UIStatePut {
4
+ v: 1;
5
+ causedBy: CausedBy;
6
+ openPanels: PanelState[];
7
+ activePanel: string | null;
8
+ activeFile: string | null;
9
+ visibleFiles: string[];
10
+ dirtyFiles: string[];
11
+ }
12
+ export interface BridgeClientOptions {
13
+ endpoint: string;
14
+ bridge: WorkspaceBridge;
15
+ store: StoreApi;
16
+ authToken?: string;
17
+ pollMode?: boolean;
18
+ pollInterval?: number;
19
+ onAuthError?: (statusCode: number) => void;
20
+ onVersionMismatch?: (version: number) => void;
21
+ onConnectionChange?: (connected: boolean) => void;
22
+ }
23
+ type StoreApi = {
24
+ getState: () => WorkspaceStore;
25
+ subscribe: (listener: (state: WorkspaceStore, prev: WorkspaceStore) => void) => () => void;
26
+ };
27
+ export interface BridgeClient {
28
+ connect(): void;
29
+ disconnect(): void;
30
+ pushState(causedBy: CausedBy): void;
31
+ }
32
+ export declare function createBridgeClient(options: BridgeClientOptions): BridgeClient;
33
+ export {};
@@ -0,0 +1,8 @@
1
+ import { WorkspaceStore } from '../store/types';
2
+ import { WorkspaceBridge } from './types';
3
+ type StoreApi = {
4
+ getState: () => WorkspaceStore;
5
+ subscribe: (listener: (state: WorkspaceStore, prev: WorkspaceStore) => void) => () => void;
6
+ };
7
+ export declare function createBridge(store: StoreApi): WorkspaceBridge;
8
+ export {};
@@ -0,0 +1,12 @@
1
+ export { createBridge } from './createBridge';
2
+ export { createBridgeClient } from './client';
3
+ export { dispatchUiCommand, WORKSPACE_COMMAND_NOTIFY_EVENT, WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT } from './uiCommandDispatcher';
4
+ export { UI_COMMAND_EVENT, postUiCommand } from './uiCommandBus';
5
+ export { WorkspaceLink, workspaceLinkCommand, workspaceLinkHref } from './WorkspaceLink';
6
+ export type { WorkspaceLinkProps, WorkspaceLinkTarget } from './WorkspaceLink';
7
+ export { startUiCommandStream } from './uiCommandStream';
8
+ export type { BridgeClient, BridgeClientOptions, UIStatePut } from './client';
9
+ export type { DispatchContext } from './uiCommandDispatcher';
10
+ export type { UiCommand } from './types';
11
+ export type { WorkspaceBridge, FileTreeBridge, BridgeEventMap, CommandResult, DynamicPaneConfig, Unsubscribe, CausedBy, } from './types';
12
+ export { openFileSchema, openPanelSchema, closePanelSchema, notificationSchema, navigateToLineSchema, expandToFileSchema, MAX_PANELS, } from './validation';
@@ -0,0 +1,92 @@
1
+ import { WorkspaceState, PanelState } from '../store/types';
2
+ import { FilesystemId } from '../../shared/types/filesystem';
3
+ export interface CommandResult {
4
+ seq: number;
5
+ status: "ok" | "error";
6
+ error?: {
7
+ code: string;
8
+ message: string;
9
+ };
10
+ }
11
+ export interface UiCommand {
12
+ v?: number;
13
+ seq?: number;
14
+ kind: string;
15
+ params: Record<string, unknown>;
16
+ }
17
+ export interface BridgeEventMap {
18
+ "panel:opened": {
19
+ panelId: string;
20
+ params: Record<string, unknown>;
21
+ };
22
+ "panel:closed": {
23
+ panelId: string;
24
+ };
25
+ "panel:activated": {
26
+ panelId: string;
27
+ previousPanelId: string | null;
28
+ };
29
+ "file:opened": {
30
+ path: string;
31
+ mode: "view" | "edit" | "diff";
32
+ filesystem?: FilesystemId;
33
+ };
34
+ "file:saved": {
35
+ path: string;
36
+ };
37
+ "file:dirty": {
38
+ path: string;
39
+ dirty: boolean;
40
+ };
41
+ "sidebar:toggled": {
42
+ collapsed: boolean;
43
+ };
44
+ "tree:expand": {
45
+ path: string;
46
+ };
47
+ "notification:shown": {
48
+ message: string;
49
+ level: "info" | "warn" | "error";
50
+ };
51
+ "pane:error": {
52
+ panelId: string;
53
+ error: string;
54
+ stack?: string;
55
+ };
56
+ }
57
+ export type Unsubscribe = () => void;
58
+ export interface DynamicPaneConfig {
59
+ id: string;
60
+ component: string;
61
+ params?: Record<string, unknown>;
62
+ title?: string;
63
+ }
64
+ export interface WorkspaceBridge {
65
+ getOpenPanels(): PanelState[];
66
+ getActiveFile(): string | null;
67
+ getDirtyFiles(): string[];
68
+ getVisibleFiles(): string[];
69
+ openFile(path: string, opts?: {
70
+ mode?: "view" | "edit" | "diff";
71
+ filesystem?: FilesystemId;
72
+ }): Promise<CommandResult>;
73
+ openPanel(config: DynamicPaneConfig): Promise<CommandResult>;
74
+ closePanel(id: string): Promise<CommandResult>;
75
+ closeWorkbenchLeftPane(): Promise<CommandResult>;
76
+ showNotification(msg: string, level?: "info" | "warn" | "error"): Promise<CommandResult>;
77
+ navigateToLine(file: string, line: number): Promise<CommandResult>;
78
+ expandToFile(path: string): Promise<CommandResult>;
79
+ markDirty(path: string): void;
80
+ markClean(path: string): void;
81
+ subscribe<K extends keyof BridgeEventMap>(event: K, handler: (data: BridgeEventMap[K]) => void): Unsubscribe;
82
+ select<T>(selector: (state: WorkspaceState) => T, handler: (value: T) => void): Unsubscribe;
83
+ }
84
+ /**
85
+ * The minimal slice of {@link WorkspaceBridge} a file tree needs: click-to-open
86
+ * (`openFile`), initial selection (`getActiveFile`), reactive reveal (`select`,
87
+ * plus optional `subscribe`). Lives here (core bridge layer) — not in the
88
+ * filesystem plugin — so core chrome (WorkbenchLeftPane) can forward a
89
+ * surface-backed adapter without importing a plugin module.
90
+ */
91
+ export type FileTreeBridge = Pick<WorkspaceBridge, "openFile" | "getActiveFile" | "select"> & Partial<Pick<WorkspaceBridge, "subscribe">>;
92
+ export type CausedBy = "user" | "agent" | "restore";
@@ -0,0 +1,3 @@
1
+ import { UiCommand } from './types';
2
+ export declare const UI_COMMAND_EVENT = "boring-workspace:ui-command";
3
+ export declare function postUiCommand(command: UiCommand): void;
@@ -0,0 +1,44 @@
1
+ import { SurfaceShellApi } from '../chrome/artifact-surface/SurfaceShell';
2
+ import { UiCommand } from './types';
3
+ import { SurfaceOpenRequest } from '../../shared/types/surface';
4
+ /**
5
+ * Browser CustomEvent name dispatched on `window` when a `showNotification`
6
+ * UI command is dispatched from the server. Keep in sync with
7
+ * `WORKSPACE_COMMAND_NOTIFY_EVENT` in `@hachej/boring-agent/shared`.
8
+ */
9
+ export declare const WORKSPACE_COMMAND_NOTIFY_EVENT = "boring-ui:command-notify";
10
+ export declare const WORKSPACE_SURFACE_OPEN_SKIPPED_EVENT = "boring-workspace:surface-open-skipped";
11
+ export interface DispatchContext {
12
+ /**
13
+ * Imperative handle to the workbench surface. Function (getter) so a
14
+ * late SurfaceShell mount, or any later swap, is picked up without
15
+ * restarting the transport. Returns null when the surface isn't ready.
16
+ */
17
+ surface: () => SurfaceShellApi | null;
18
+ /** Read the current open/closed state of the workbench pane. */
19
+ isWorkbenchOpen: () => boolean;
20
+ /** Toggle the workbench pane open. Must be a no-op when already open. */
21
+ openWorkbench: () => void;
22
+ /** Open the workbench sources/file-tree pane. Must be a no-op when already open. */
23
+ openWorkbenchSources?: () => void;
24
+ /** Close the workbench pane when a command opened it only for an ephemeral task. */
25
+ closeWorkbench?: () => void;
26
+ /**
27
+ * Park an op that couldn't run because the surface never mounted within the
28
+ * retry budget (collapsed surface / warmup overlay). The host flushes parked
29
+ * ops when the SurfaceShell next becomes ready. Without this the op is
30
+ * silently dropped.
31
+ */
32
+ enqueue?: (run: (surface: SurfaceShellApi) => void) => void;
33
+ /** Optional host policy hook for surface requests that are only relevant in a visible/open context. */
34
+ shouldOpenSurface?: (request: SurfaceOpenRequest) => boolean;
35
+ }
36
+ /**
37
+ * Apply a single agent-issued UI command. Pure function: takes a command
38
+ * + a context with the surface handle and returns nothing. Unknown kinds
39
+ * are silently ignored — the agent and frontend can drift on supported
40
+ * commands without breaking the chat. Known-but-unhandled kinds
41
+ * (navigateToLine, showNotification, closePanel) are accepted-but-no-op
42
+ * so the contract surface stays additive.
43
+ */
44
+ export declare function dispatchUiCommand(cmd: UiCommand, ctx: DispatchContext): void;
@@ -0,0 +1,41 @@
1
+ import { DispatchContext } from './uiCommandDispatcher';
2
+ export type { DispatchContext } from './uiCommandDispatcher';
3
+ export type { UiCommand } from './types';
4
+ export { dispatchUiCommand } from './uiCommandDispatcher';
5
+ export interface StreamOptions {
6
+ /** Endpoint base — usually "" for same-origin (vite proxy forwards). */
7
+ endpoint?: string;
8
+ /** Dispatch context — surface getter, workbench-open getter, opener. */
9
+ ctx: DispatchContext;
10
+ /** Query params appended to SSE/poll URLs, e.g. workspace scoping. */
11
+ query?: Record<string, string | number | boolean | null | undefined>;
12
+ /**
13
+ * Inject EventSource for tests. Defaults to `globalThis.EventSource`.
14
+ * Pass `null` to force the polling fallback unconditionally (useful when
15
+ * a test runner defines a broken stub).
16
+ */
17
+ eventSourceCtor?: typeof EventSource | null;
18
+ /** Inject fetch for the polling fallback. Defaults to global fetch. */
19
+ fetcher?: typeof fetch;
20
+ /** Polling cadence when on the fallback path. */
21
+ pollIntervalMs?: number;
22
+ /** Backoff between SSE reconnect attempts (linear). */
23
+ reconnectDelayMs?: number;
24
+ /** Max reconnect attempts before giving up and falling back to polling. */
25
+ maxReconnects?: number;
26
+ }
27
+ /**
28
+ * Open the bridge command channel. Returns a cleanup function that closes
29
+ * any active EventSource AND stops any pending poll. Safe to call from
30
+ * useEffect.
31
+ *
32
+ * Strategy:
33
+ * 1. If EventSource is available, open it and listen for `command` events.
34
+ * 2. On error, reconnect up to `maxReconnects` times with linear backoff.
35
+ * 3. If EventSource is unavailable OR reconnects exhausted, fall back to
36
+ * polling. The fallback is sticky for the lifetime of this call —
37
+ * we don't try to upgrade back to SSE because the most likely cause
38
+ * of repeated SSE failure (proxy stripping event-stream) won't fix
39
+ * itself in-session.
40
+ */
41
+ export declare function startUiCommandStream(opts: StreamOptions): () => void;
@@ -0,0 +1,66 @@
1
+ import { z } from 'zod';
2
+ declare const MAX_PANELS = 50;
3
+ export declare const openFileSchema: z.ZodObject<{
4
+ path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
5
+ mode: z.ZodOptional<z.ZodEnum<["view", "edit", "diff"]>>;
6
+ filesystem: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ path: string;
9
+ filesystem?: string | undefined;
10
+ mode?: "view" | "edit" | "diff" | undefined;
11
+ }, {
12
+ path: string;
13
+ filesystem?: string | undefined;
14
+ mode?: "view" | "edit" | "diff" | undefined;
15
+ }>;
16
+ export declare const openPanelSchema: z.ZodObject<{
17
+ id: z.ZodString;
18
+ component: z.ZodString;
19
+ params: z.ZodEffects<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>, Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
20
+ title: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ id: string;
23
+ component: string;
24
+ title?: string | undefined;
25
+ params?: Record<string, unknown> | undefined;
26
+ }, {
27
+ id: string;
28
+ component: string;
29
+ title?: string | undefined;
30
+ params?: Record<string, unknown> | undefined;
31
+ }>;
32
+ export declare const closePanelSchema: z.ZodObject<{
33
+ id: z.ZodString;
34
+ }, "strip", z.ZodTypeAny, {
35
+ id: string;
36
+ }, {
37
+ id: string;
38
+ }>;
39
+ export declare const notificationSchema: z.ZodObject<{
40
+ msg: z.ZodString;
41
+ level: z.ZodOptional<z.ZodEnum<["info", "warn", "error"]>>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ msg: string;
44
+ level?: "error" | "info" | "warn" | undefined;
45
+ }, {
46
+ msg: string;
47
+ level?: "error" | "info" | "warn" | undefined;
48
+ }>;
49
+ export declare const navigateToLineSchema: z.ZodObject<{
50
+ file: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
51
+ line: z.ZodNumber;
52
+ }, "strip", z.ZodTypeAny, {
53
+ line: number;
54
+ file: string;
55
+ }, {
56
+ line: number;
57
+ file: string;
58
+ }>;
59
+ export declare const expandToFileSchema: z.ZodObject<{
60
+ path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ path: string;
63
+ }, {
64
+ path: string;
65
+ }>;
66
+ export { MAX_PANELS };
@@ -0,0 +1 @@
1
+ export {};