@dxos/plugin-debug 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.0

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 (501) hide show
  1. package/PLUGIN.mdl +241 -3
  2. package/README.md +27 -3
  3. package/dist/lib/Debug.mjs.map +1 -1
  4. package/dist/lib/DebugNodes.mjs +21 -2
  5. package/dist/lib/DebugNodes.mjs.map +1 -1
  6. package/dist/lib/DebugOperation.mjs +166 -2
  7. package/dist/lib/DebugOperation.mjs.map +1 -1
  8. package/dist/lib/DebugPlugin.mjs.map +1 -1
  9. package/dist/lib/DebugSurface.mjs +7 -2
  10. package/dist/lib/DebugSurface.mjs.map +1 -1
  11. package/dist/lib/IncidentSpace.mjs +2 -0
  12. package/dist/lib/PipelineSpace.mjs +2 -0
  13. package/dist/lib/ReviewSpace.mjs +2 -0
  14. package/dist/lib/StockfishSpace.mjs +2 -0
  15. package/dist/lib/TidepoolSpace.mjs +2 -0
  16. package/dist/lib/WeatherSpace.mjs +2 -0
  17. package/dist/lib/WorkerSpace.mjs +2 -0
  18. package/dist/lib/capabilities.browser.mjs +71 -0
  19. package/dist/lib/capabilities.browser.mjs.map +1 -0
  20. package/dist/lib/capabilities.mjs +17 -7
  21. package/dist/lib/capabilities.mjs.map +1 -1
  22. package/dist/lib/capabilities.node.mjs +13 -3
  23. package/dist/lib/capabilities.node.mjs.map +1 -1
  24. package/dist/lib/capabilities.tauri.mjs +71 -0
  25. package/dist/lib/capabilities.tauri.mjs.map +1 -0
  26. package/dist/lib/capabilities.workerd.mjs +3 -1
  27. package/dist/lib/capabilities.workerd.mjs.map +1 -1
  28. package/dist/lib/chunk-DebugConsole.mjs +241 -0
  29. package/dist/lib/chunk-DebugConsole.mjs.map +1 -0
  30. package/dist/lib/chunk-DebugObjectPanel.mjs +12 -16
  31. package/dist/lib/chunk-DebugObjectPanel.mjs.map +1 -1
  32. package/dist/lib/chunk-DebugPanelDrawer.mjs +48 -0
  33. package/dist/lib/chunk-DebugPanelDrawer.mjs.map +1 -0
  34. package/dist/lib/chunk-DebugPanelHeader.mjs +280 -0
  35. package/dist/lib/chunk-DebugPanelHeader.mjs.map +1 -0
  36. package/dist/lib/chunk-DebugPanelStatus.mjs +127 -0
  37. package/dist/lib/chunk-DebugPanelStatus.mjs.map +1 -0
  38. package/dist/lib/chunk-DebugSettings.mjs +81 -70
  39. package/dist/lib/chunk-DebugSettings.mjs.map +1 -1
  40. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs +21 -12
  41. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs.map +1 -1
  42. package/dist/lib/chunk-DebugStatus.mjs +12 -12
  43. package/dist/lib/chunk-DebugStatus.mjs.map +1 -1
  44. package/dist/lib/chunk-IncidentSpace.mjs +269 -0
  45. package/dist/lib/chunk-IncidentSpace.mjs.map +1 -0
  46. package/dist/lib/chunk-LoggerPanel.mjs +18 -0
  47. package/dist/lib/chunk-LoggerPanel.mjs.map +1 -0
  48. package/dist/lib/chunk-PLUGIN.mjs +6 -0
  49. package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
  50. package/dist/lib/chunk-PipelineSpace.mjs +378 -0
  51. package/dist/lib/chunk-PipelineSpace.mjs.map +1 -0
  52. package/dist/lib/chunk-ReviewSpace.mjs +356 -0
  53. package/dist/lib/chunk-ReviewSpace.mjs.map +1 -0
  54. package/dist/lib/chunk-SpaceGenerator.mjs +107 -73
  55. package/dist/lib/chunk-SpaceGenerator.mjs.map +1 -1
  56. package/dist/lib/chunk-StatsPanel.mjs +28 -35
  57. package/dist/lib/chunk-StatsPanel.mjs.map +1 -1
  58. package/dist/lib/chunk-StockfishSpace.mjs +563 -0
  59. package/dist/lib/chunk-StockfishSpace.mjs.map +1 -0
  60. package/dist/lib/chunk-TidepoolSpace.mjs +544 -0
  61. package/dist/lib/chunk-TidepoolSpace.mjs.map +1 -0
  62. package/dist/lib/chunk-WeatherSpace.mjs +206 -0
  63. package/dist/lib/chunk-WeatherSpace.mjs.map +1 -0
  64. package/dist/lib/chunk-Wireframe.mjs +6 -6
  65. package/dist/lib/chunk-Wireframe.mjs.map +1 -1
  66. package/dist/lib/chunk-WorkerSpace.mjs +177 -0
  67. package/dist/lib/chunk-WorkerSpace.mjs.map +1 -0
  68. package/dist/lib/chunk-app-graph-builder.mjs +72 -40
  69. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
  70. package/dist/lib/chunk-create-space-from-template.mjs +55 -0
  71. package/dist/lib/chunk-create-space-from-template.mjs.map +1 -0
  72. package/dist/lib/chunk-errors.mjs +13 -0
  73. package/dist/lib/chunk-errors.mjs.map +1 -0
  74. package/dist/lib/chunk-graph-retention.mjs +14 -0
  75. package/dist/lib/chunk-graph-retention.mjs.map +1 -0
  76. package/dist/lib/chunk-insert-lorem-ipsum.mjs +2 -2
  77. package/dist/lib/chunk-log-recording.mjs +29 -1
  78. package/dist/lib/chunk-log-recording.mjs.map +1 -1
  79. package/dist/lib/chunk-open-page.mjs +29 -0
  80. package/dist/lib/chunk-open-page.mjs.map +1 -0
  81. package/dist/lib/chunk-operation-handler.mjs +5 -0
  82. package/dist/lib/chunk-operation-handler.mjs.map +1 -1
  83. package/dist/lib/chunk-react-surface.mjs +73 -71
  84. package/dist/lib/chunk-react-surface.mjs.map +1 -1
  85. package/dist/lib/chunk-settings.mjs +2 -2
  86. package/dist/lib/chunk-settings.mjs.map +1 -1
  87. package/dist/lib/chunk-snapshot.mjs +170 -0
  88. package/dist/lib/chunk-snapshot.mjs.map +1 -0
  89. package/dist/lib/chunk-space-templates.mjs +21 -0
  90. package/dist/lib/chunk-space-templates.mjs.map +1 -0
  91. package/dist/lib/chunk-stats-panel.mjs +1 -1
  92. package/dist/lib/chunk-stats-panel.mjs.map +1 -1
  93. package/dist/lib/chunk-undo.mjs +17 -0
  94. package/dist/lib/chunk-undo.mjs.map +1 -0
  95. package/dist/lib/chunk-view-state.mjs +37 -0
  96. package/dist/lib/chunk-view-state.mjs.map +1 -0
  97. package/dist/lib/components.mjs +68 -28
  98. package/dist/lib/components.mjs.map +1 -1
  99. package/dist/lib/containers.mjs +5 -2
  100. package/dist/lib/containers.mjs.map +1 -1
  101. package/dist/lib/index.mjs +8 -2
  102. package/dist/lib/meta.mjs +3 -2
  103. package/dist/lib/meta.mjs.map +1 -1
  104. package/dist/lib/operations.mjs +7 -1
  105. package/dist/lib/operations.mjs.map +1 -1
  106. package/dist/lib/plugin.mjs +2 -2
  107. package/dist/lib/plugin.mjs.map +1 -1
  108. package/dist/lib/translations.mjs +13 -4
  109. package/dist/lib/translations.mjs.map +1 -1
  110. package/dist/types/scripts/build-template-archive.d.ts +2 -0
  111. package/dist/types/scripts/build-template-archive.d.ts.map +1 -0
  112. package/dist/types/src/DebugPlugin.d.ts +2 -2
  113. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  114. package/dist/types/src/capabilities/DebugSurfaces.d.ts +4 -5
  115. package/dist/types/src/capabilities/DebugSurfaces.d.ts.map +1 -1
  116. package/dist/types/src/capabilities/app-graph-builder.d.ts +31 -0
  117. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  118. package/dist/types/src/capabilities/app-graph-builder.test.d.ts +2 -0
  119. package/dist/types/src/capabilities/app-graph-builder.test.d.ts.map +1 -0
  120. package/dist/types/src/capabilities/gen/browser.d.ts +14 -0
  121. package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
  122. package/dist/types/src/capabilities/gen/node.d.ts +2 -0
  123. package/dist/types/src/capabilities/gen/node.d.ts.map +1 -1
  124. package/dist/types/src/capabilities/gen/tauri.d.ts +14 -0
  125. package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
  126. package/dist/types/src/capabilities/gen/workerd.d.ts +2 -0
  127. package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -1
  128. package/dist/types/src/capabilities/graph-retention.d.ts +5 -0
  129. package/dist/types/src/capabilities/graph-retention.d.ts.map +1 -0
  130. package/dist/types/src/capabilities/index.d.ts +2 -0
  131. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  132. package/dist/types/src/capabilities/log-recording.d.ts +4 -0
  133. package/dist/types/src/capabilities/log-recording.d.ts.map +1 -1
  134. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  135. package/dist/types/src/capabilities/space-templates.d.ts +14 -0
  136. package/dist/types/src/capabilities/space-templates.d.ts.map +1 -0
  137. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts +4 -3
  138. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
  139. package/dist/types/src/components/SchemaTable/index.d.ts +1 -1
  140. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -1
  141. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -1
  142. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  143. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  144. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  145. package/dist/types/src/components/SpaceGenerator/presets.d.ts +1 -1
  146. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  147. package/dist/types/src/components/index.d.ts +2 -2
  148. package/dist/types/src/components/index.d.ts.map +1 -1
  149. package/dist/types/src/containers/DebugConsole/DebugConsole.d.ts +12 -0
  150. package/dist/types/src/containers/DebugConsole/DebugConsole.d.ts.map +1 -0
  151. package/dist/types/src/containers/DebugConsole/DebugConsole.stories.d.ts +103 -0
  152. package/dist/types/src/containers/DebugConsole/DebugConsole.stories.d.ts.map +1 -0
  153. package/dist/types/src/containers/DebugConsole/cli.d.ts +24 -0
  154. package/dist/types/src/containers/DebugConsole/cli.d.ts.map +1 -0
  155. package/dist/types/src/containers/DebugConsole/index.d.ts +2 -0
  156. package/dist/types/src/containers/DebugConsole/index.d.ts.map +1 -0
  157. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +1 -1
  158. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
  159. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +1 -1
  160. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -1
  161. package/dist/types/src/containers/DebugPanel/DebugPanel.d.ts +30 -0
  162. package/dist/types/src/containers/DebugPanel/DebugPanel.d.ts.map +1 -0
  163. package/dist/types/src/containers/DebugPanel/DebugPanel.stories.d.ts +126 -0
  164. package/dist/types/src/containers/DebugPanel/DebugPanel.stories.d.ts.map +1 -0
  165. package/dist/types/src/containers/DebugPanel/DebugPanelContext.d.ts +16 -0
  166. package/dist/types/src/containers/DebugPanel/DebugPanelContext.d.ts.map +1 -0
  167. package/dist/types/src/containers/DebugPanel/DebugPanelHeader.d.ts +14 -0
  168. package/dist/types/src/containers/DebugPanel/DebugPanelHeader.d.ts.map +1 -0
  169. package/dist/types/src/containers/DebugPanel/DebugPanelMain.d.ts +6 -0
  170. package/dist/types/src/containers/DebugPanel/DebugPanelMain.d.ts.map +1 -0
  171. package/dist/types/src/containers/DebugPanel/DebugPanelSidebar.d.ts +6 -0
  172. package/dist/types/src/containers/DebugPanel/DebugPanelSidebar.d.ts.map +1 -0
  173. package/dist/types/src/containers/DebugPanel/index.d.ts +7 -0
  174. package/dist/types/src/containers/DebugPanel/index.d.ts.map +1 -0
  175. package/dist/types/src/containers/DebugPanel/view-state.d.ts +46 -0
  176. package/dist/types/src/containers/DebugPanel/view-state.d.ts.map +1 -0
  177. package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.d.ts +10 -0
  178. package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.d.ts.map +1 -0
  179. package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.d.ts +114 -0
  180. package/dist/types/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.d.ts.map +1 -0
  181. package/dist/types/src/containers/DebugPanelDrawer/index.d.ts +2 -0
  182. package/dist/types/src/containers/DebugPanelDrawer/index.d.ts.map +1 -0
  183. package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.d.ts +11 -0
  184. package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.d.ts.map +1 -0
  185. package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.stories.d.ts +107 -0
  186. package/dist/types/src/containers/DebugPanelStatus/DebugPanelStatus.stories.d.ts.map +1 -0
  187. package/dist/types/src/containers/DebugPanelStatus/index.d.ts +2 -0
  188. package/dist/types/src/containers/DebugPanelStatus/index.d.ts.map +1 -0
  189. package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.d.ts.map +1 -1
  190. package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.stories.d.ts +13 -4
  191. package/dist/types/src/containers/DebugPortSettings/DebugPortSettings.stories.d.ts.map +1 -1
  192. package/dist/types/src/containers/DebugPortSettings/index.d.ts +1 -1
  193. package/dist/types/src/containers/DebugPortSettings/index.d.ts.map +1 -1
  194. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +2 -2
  195. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -1
  196. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts +14 -5
  197. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
  198. package/dist/types/src/containers/DebugSettings/index.d.ts +1 -1
  199. package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -1
  200. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +1 -1
  201. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
  202. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +1 -1
  203. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -1
  204. package/dist/types/src/containers/DebugStatus/index.d.ts +1 -1
  205. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -1
  206. package/dist/types/src/containers/LoggerPanel/LoggerPanel.d.ts +6 -0
  207. package/dist/types/src/containers/LoggerPanel/LoggerPanel.d.ts.map +1 -0
  208. package/dist/types/src/containers/LoggerPanel/LoggerPanel.stories.d.ts +107 -0
  209. package/dist/types/src/containers/LoggerPanel/LoggerPanel.stories.d.ts.map +1 -0
  210. package/dist/types/src/containers/LoggerPanel/index.d.ts +2 -0
  211. package/dist/types/src/containers/LoggerPanel/index.d.ts.map +1 -0
  212. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  213. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.stories.d.ts +13 -4
  214. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
  215. package/dist/types/src/containers/SpaceGenerator/index.d.ts +1 -1
  216. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -1
  217. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts +5 -1
  218. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts.map +1 -1
  219. package/dist/types/src/containers/StatsPanel/index.d.ts +1 -1
  220. package/dist/types/src/containers/StatsPanel/index.d.ts.map +1 -1
  221. package/dist/types/src/containers/Wireframe/Wireframe.d.ts +2 -2
  222. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
  223. package/dist/types/src/containers/Wireframe/index.d.ts +1 -1
  224. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -1
  225. package/dist/types/src/containers/index.d.ts +7 -1
  226. package/dist/types/src/containers/index.d.ts.map +1 -1
  227. package/dist/types/src/errors.d.ts +123 -0
  228. package/dist/types/src/errors.d.ts.map +1 -0
  229. package/dist/types/src/index.d.ts +2 -2
  230. package/dist/types/src/index.d.ts.map +1 -1
  231. package/dist/types/src/operations/DebugOperationHandlerSet.d.ts.map +1 -1
  232. package/dist/types/src/operations/create-space-from-template.d.ts +5 -0
  233. package/dist/types/src/operations/create-space-from-template.d.ts.map +1 -0
  234. package/dist/types/src/operations/errors.d.ts +33 -0
  235. package/dist/types/src/operations/errors.d.ts.map +1 -0
  236. package/dist/types/src/operations/index.d.ts +1 -1
  237. package/dist/types/src/operations/index.d.ts.map +1 -1
  238. package/dist/types/src/operations/open-page.d.ts +5 -0
  239. package/dist/types/src/operations/open-page.d.ts.map +1 -0
  240. package/dist/types/src/operations/snapshot.d.ts +5 -0
  241. package/dist/types/src/operations/snapshot.d.ts.map +1 -0
  242. package/dist/types/src/operations/snapshot.test.d.ts +2 -0
  243. package/dist/types/src/operations/snapshot.test.d.ts.map +1 -0
  244. package/dist/types/src/operations/undo.d.ts +5 -0
  245. package/dist/types/src/operations/undo.d.ts.map +1 -0
  246. package/dist/types/src/operations/undo.test.d.ts +2 -0
  247. package/dist/types/src/operations/undo.test.d.ts.map +1 -0
  248. package/dist/types/src/plugin.d.ts.map +1 -1
  249. package/dist/types/src/samples/crm/PipelineSpace.d.ts +21 -0
  250. package/dist/types/src/samples/crm/PipelineSpace.d.ts.map +1 -0
  251. package/dist/types/src/samples/crm/PipelineSpace.test.d.ts +2 -0
  252. package/dist/types/src/samples/crm/PipelineSpace.test.d.ts.map +1 -0
  253. package/dist/types/src/samples/crm/accounts.d.ts +55 -0
  254. package/dist/types/src/samples/crm/accounts.d.ts.map +1 -0
  255. package/dist/types/src/samples/crm/inbox.d.ts +14 -0
  256. package/dist/types/src/samples/crm/inbox.d.ts.map +1 -0
  257. package/dist/types/src/samples/crm/pipeline.d.ts +9 -0
  258. package/dist/types/src/samples/crm/pipeline.d.ts.map +1 -0
  259. package/dist/types/src/samples/crm/util.d.ts +14 -0
  260. package/dist/types/src/samples/crm/util.d.ts.map +1 -0
  261. package/dist/types/src/samples/incident/IncidentSpace.d.ts +21 -0
  262. package/dist/types/src/samples/incident/IncidentSpace.d.ts.map +1 -0
  263. package/dist/types/src/samples/incident/IncidentSpace.test.d.ts +2 -0
  264. package/dist/types/src/samples/incident/IncidentSpace.test.d.ts.map +1 -0
  265. package/dist/types/src/samples/incident/docs.d.ts +14 -0
  266. package/dist/types/src/samples/incident/docs.d.ts.map +1 -0
  267. package/dist/types/src/samples/incident/project.d.ts +16 -0
  268. package/dist/types/src/samples/incident/project.d.ts.map +1 -0
  269. package/dist/types/src/samples/incident/tasks.d.ts +9 -0
  270. package/dist/types/src/samples/incident/tasks.d.ts.map +1 -0
  271. package/dist/types/src/samples/incident/util.d.ts +32 -0
  272. package/dist/types/src/samples/incident/util.d.ts.map +1 -0
  273. package/dist/types/src/samples/index.d.ts +8 -0
  274. package/dist/types/src/samples/index.d.ts.map +1 -0
  275. package/dist/types/src/samples/review/ReviewSpace.d.ts +19 -0
  276. package/dist/types/src/samples/review/ReviewSpace.d.ts.map +1 -0
  277. package/dist/types/src/samples/review/ReviewSpace.test.d.ts +2 -0
  278. package/dist/types/src/samples/review/ReviewSpace.test.d.ts.map +1 -0
  279. package/dist/types/src/samples/review/assets.d.ts +19 -0
  280. package/dist/types/src/samples/review/assets.d.ts.map +1 -0
  281. package/dist/types/src/samples/review/util.d.ts +4 -0
  282. package/dist/types/src/samples/review/util.d.ts.map +1 -0
  283. package/dist/types/src/samples/review/work.d.ts +15 -0
  284. package/dist/types/src/samples/review/work.d.ts.map +1 -0
  285. package/dist/types/src/samples/stockfish/StockfishSpace.d.ts +27 -0
  286. package/dist/types/src/samples/stockfish/StockfishSpace.d.ts.map +1 -0
  287. package/dist/types/src/samples/stockfish/StockfishSpace.test.d.ts +2 -0
  288. package/dist/types/src/samples/stockfish/StockfishSpace.test.d.ts.map +1 -0
  289. package/dist/types/src/samples/stockfish/docs.d.ts +8 -0
  290. package/dist/types/src/samples/stockfish/docs.d.ts.map +1 -0
  291. package/dist/types/src/samples/stockfish/game.d.ts +10 -0
  292. package/dist/types/src/samples/stockfish/game.d.ts.map +1 -0
  293. package/dist/types/src/samples/stockfish/project.d.ts +31 -0
  294. package/dist/types/src/samples/stockfish/project.d.ts.map +1 -0
  295. package/dist/types/src/samples/stockfish/run.test.d.ts +2 -0
  296. package/dist/types/src/samples/stockfish/run.test.d.ts.map +1 -0
  297. package/dist/types/src/samples/stockfish/skill.d.ts +8 -0
  298. package/dist/types/src/samples/stockfish/skill.d.ts.map +1 -0
  299. package/dist/types/src/samples/stockfish/tasks.d.ts +12 -0
  300. package/dist/types/src/samples/stockfish/tasks.d.ts.map +1 -0
  301. package/dist/types/src/samples/stockfish/util.d.ts +14 -0
  302. package/dist/types/src/samples/stockfish/util.d.ts.map +1 -0
  303. package/dist/types/src/samples/tidepool/TidepoolSpace.d.ts +22 -0
  304. package/dist/types/src/samples/tidepool/TidepoolSpace.d.ts.map +1 -0
  305. package/dist/types/src/samples/tidepool/TidepoolSpace.test.d.ts +2 -0
  306. package/dist/types/src/samples/tidepool/TidepoolSpace.test.d.ts.map +1 -0
  307. package/dist/types/src/samples/tidepool/docs.d.ts +12 -0
  308. package/dist/types/src/samples/tidepool/docs.d.ts.map +1 -0
  309. package/dist/types/src/samples/tidepool/project.d.ts +20 -0
  310. package/dist/types/src/samples/tidepool/project.d.ts.map +1 -0
  311. package/dist/types/src/samples/tidepool/tasks.d.ts +14 -0
  312. package/dist/types/src/samples/tidepool/tasks.d.ts.map +1 -0
  313. package/dist/types/src/samples/tidepool/team.d.ts +9 -0
  314. package/dist/types/src/samples/tidepool/team.d.ts.map +1 -0
  315. package/dist/types/src/samples/tidepool/util.d.ts +14 -0
  316. package/dist/types/src/samples/tidepool/util.d.ts.map +1 -0
  317. package/dist/types/src/samples/weather/WeatherSpace.d.ts +21 -0
  318. package/dist/types/src/samples/weather/WeatherSpace.d.ts.map +1 -0
  319. package/dist/types/src/samples/weather/WeatherSpace.test.d.ts +2 -0
  320. package/dist/types/src/samples/weather/WeatherSpace.test.d.ts.map +1 -0
  321. package/dist/types/src/samples/weather/project.d.ts +20 -0
  322. package/dist/types/src/samples/weather/project.d.ts.map +1 -0
  323. package/dist/types/src/samples/weather/skill.d.ts +12 -0
  324. package/dist/types/src/samples/weather/skill.d.ts.map +1 -0
  325. package/dist/types/src/samples/weather/tasks.d.ts +9 -0
  326. package/dist/types/src/samples/weather/tasks.d.ts.map +1 -0
  327. package/dist/types/src/samples/weather/util.d.ts +16 -0
  328. package/dist/types/src/samples/weather/util.d.ts.map +1 -0
  329. package/dist/types/src/samples/worker/WorkerSpace.d.ts +22 -0
  330. package/dist/types/src/samples/worker/WorkerSpace.d.ts.map +1 -0
  331. package/dist/types/src/samples/worker/WorkerSpace.test.d.ts +2 -0
  332. package/dist/types/src/samples/worker/WorkerSpace.test.d.ts.map +1 -0
  333. package/dist/types/src/samples/worker/project.d.ts +18 -0
  334. package/dist/types/src/samples/worker/project.d.ts.map +1 -0
  335. package/dist/types/src/samples/worker/tasks.d.ts +9 -0
  336. package/dist/types/src/samples/worker/tasks.d.ts.map +1 -0
  337. package/dist/types/src/samples/worker/util.d.ts +14 -0
  338. package/dist/types/src/samples/worker/util.d.ts.map +1 -0
  339. package/dist/types/src/stories/SpaceTemplates.stories.d.ts +114 -0
  340. package/dist/types/src/stories/SpaceTemplates.stories.d.ts.map +1 -0
  341. package/dist/types/src/testing/index.d.ts +3 -0
  342. package/dist/types/src/testing/index.d.ts.map +1 -0
  343. package/dist/types/src/testing/stub-drawer-plugin.d.ts +8 -0
  344. package/dist/types/src/testing/stub-drawer-plugin.d.ts.map +1 -0
  345. package/dist/types/src/testing/stub-tools-plugin.d.ts +19 -0
  346. package/dist/types/src/testing/stub-tools-plugin.d.ts.map +1 -0
  347. package/dist/types/src/translations.d.ts +13 -4
  348. package/dist/types/src/translations.d.ts.map +1 -1
  349. package/dist/types/src/types/Debug.d.ts +2 -2
  350. package/dist/types/src/types/Debug.d.ts.map +1 -1
  351. package/dist/types/src/types/DebugNodes.d.ts +13 -1
  352. package/dist/types/src/types/DebugNodes.d.ts.map +1 -1
  353. package/dist/types/src/types/DebugOperation.d.ts +119 -0
  354. package/dist/types/src/types/DebugOperation.d.ts.map +1 -1
  355. package/dist/types/src/types/DebugSurface.d.ts +7 -0
  356. package/dist/types/src/types/DebugSurface.d.ts.map +1 -1
  357. package/dist/types/src/types/index.d.ts +6 -6
  358. package/dist/types/src/types/index.d.ts.map +1 -1
  359. package/dist/types/tsconfig.tsbuildinfo +1 -1
  360. package/dx.config.ts +3 -2
  361. package/package.json +129 -73
  362. package/scripts/build-template-archive.ts +65 -0
  363. package/src/DebugPlugin.ts +1 -1
  364. package/src/capabilities/DebugSurfaces.tsx +85 -71
  365. package/src/capabilities/app-graph-builder.test.ts +45 -0
  366. package/src/capabilities/app-graph-builder.ts +83 -46
  367. package/src/capabilities/gen/browser.ts +85 -0
  368. package/src/capabilities/gen/node.ts +15 -8
  369. package/src/capabilities/gen/tauri.ts +85 -0
  370. package/src/capabilities/gen/workerd.ts +11 -4
  371. package/src/capabilities/graph-retention.ts +23 -0
  372. package/src/capabilities/index.ts +18 -10
  373. package/src/capabilities/log-recording.ts +20 -1
  374. package/src/capabilities/operation-handler.ts +9 -0
  375. package/src/capabilities/react-surface.ts +33 -29
  376. package/src/capabilities/settings.ts +2 -2
  377. package/src/capabilities/space-templates.ts +25 -0
  378. package/src/capabilities/stats-panel.ts +1 -1
  379. package/src/components/SchemaTable/SchemaTable.tsx +44 -10
  380. package/src/components/SchemaTable/index.ts +1 -1
  381. package/src/components/SpaceGenerator/ObjectGenerator.tsx +22 -2
  382. package/src/components/SpaceGenerator/index.ts +2 -2
  383. package/src/components/SpaceGenerator/presets.ts +4 -4
  384. package/src/components/index.ts +2 -2
  385. package/src/containers/DebugConsole/DebugConsole.stories.tsx +29 -0
  386. package/src/containers/DebugConsole/DebugConsole.tsx +94 -0
  387. package/src/containers/DebugConsole/cli.ts +296 -0
  388. package/src/containers/DebugConsole/index.ts +5 -0
  389. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +44 -44
  390. package/src/containers/DebugObjectPanel/index.ts +1 -1
  391. package/src/containers/DebugPanel/DebugPanel.stories.tsx +118 -0
  392. package/src/containers/DebugPanel/DebugPanel.tsx +72 -0
  393. package/src/containers/DebugPanel/DebugPanelContext.ts +33 -0
  394. package/src/containers/DebugPanel/DebugPanelHeader.tsx +54 -0
  395. package/src/containers/DebugPanel/DebugPanelMain.tsx +116 -0
  396. package/src/containers/DebugPanel/DebugPanelSidebar.tsx +123 -0
  397. package/src/containers/DebugPanel/index.ts +10 -0
  398. package/src/containers/DebugPanel/view-state.ts +60 -0
  399. package/src/containers/DebugPanelDrawer/DebugPanelDrawer.stories.tsx +92 -0
  400. package/src/containers/DebugPanelDrawer/DebugPanelDrawer.tsx +72 -0
  401. package/src/containers/DebugPanelDrawer/index.ts +5 -0
  402. package/src/containers/DebugPanelStatus/DebugPanelStatus.stories.tsx +119 -0
  403. package/src/containers/DebugPanelStatus/DebugPanelStatus.tsx +167 -0
  404. package/src/containers/DebugPanelStatus/index.ts +5 -0
  405. package/src/containers/DebugPortSettings/DebugPortSettings.stories.tsx +2 -2
  406. package/src/containers/DebugPortSettings/DebugPortSettings.tsx +33 -40
  407. package/src/containers/DebugPortSettings/index.ts +1 -1
  408. package/src/containers/DebugSettings/DebugSettings.stories.tsx +1 -1
  409. package/src/containers/DebugSettings/DebugSettings.tsx +71 -64
  410. package/src/containers/DebugSettings/index.ts +1 -1
  411. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +39 -28
  412. package/src/containers/DebugSpaceObjectsPanel/index.ts +1 -1
  413. package/src/containers/DebugStatus/DebugStatus.tsx +10 -10
  414. package/src/containers/DebugStatus/index.ts +1 -1
  415. package/src/containers/LoggerPanel/LoggerPanel.stories.tsx +62 -0
  416. package/src/containers/LoggerPanel/LoggerPanel.tsx +28 -0
  417. package/src/containers/LoggerPanel/index.ts +5 -0
  418. package/src/containers/SpaceGenerator/SpaceGenerator.stories.tsx +8 -8
  419. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +102 -73
  420. package/src/containers/SpaceGenerator/index.ts +1 -1
  421. package/src/containers/StatsPanel/StatsPanel.tsx +32 -31
  422. package/src/containers/StatsPanel/index.ts +1 -1
  423. package/src/containers/Wireframe/Wireframe.tsx +8 -7
  424. package/src/containers/Wireframe/index.ts +1 -1
  425. package/src/containers/index.ts +22 -9
  426. package/src/errors.ts +23 -0
  427. package/src/index.ts +2 -2
  428. package/src/meta.ts +1 -1
  429. package/src/operations/DebugOperationHandlerSet.ts +5 -1
  430. package/src/operations/create-space-from-template.ts +57 -0
  431. package/src/operations/errors.ts +8 -0
  432. package/src/operations/index.ts +1 -1
  433. package/src/operations/open-page.ts +51 -0
  434. package/src/operations/snapshot.test.ts +57 -0
  435. package/src/operations/snapshot.ts +243 -0
  436. package/src/operations/undo.test.ts +19 -0
  437. package/src/operations/undo.ts +28 -0
  438. package/src/plugin.tsx +4 -0
  439. package/src/samples/crm/PipelineSpace.test.ts +55 -0
  440. package/src/samples/crm/PipelineSpace.ts +52 -0
  441. package/src/samples/crm/accounts.ts +153 -0
  442. package/src/samples/crm/inbox.ts +158 -0
  443. package/src/samples/crm/pipeline.ts +70 -0
  444. package/src/samples/crm/util.ts +18 -0
  445. package/src/samples/incident/IncidentSpace.test.ts +68 -0
  446. package/src/samples/incident/IncidentSpace.ts +61 -0
  447. package/src/samples/incident/docs.ts +111 -0
  448. package/src/samples/incident/project.ts +61 -0
  449. package/src/samples/incident/tasks.ts +101 -0
  450. package/src/samples/incident/util.ts +24 -0
  451. package/src/samples/index.ts +11 -0
  452. package/src/samples/review/ReviewSpace.test.ts +89 -0
  453. package/src/samples/review/ReviewSpace.ts +47 -0
  454. package/src/samples/review/assets.ts +123 -0
  455. package/src/samples/review/util.ts +10 -0
  456. package/src/samples/review/work.ts +249 -0
  457. package/src/samples/stockfish/StockfishSpace.test.ts +129 -0
  458. package/src/samples/stockfish/StockfishSpace.ts +70 -0
  459. package/src/samples/stockfish/docs.ts +65 -0
  460. package/src/samples/stockfish/game.ts +47 -0
  461. package/src/samples/stockfish/project.ts +87 -0
  462. package/src/samples/stockfish/run.test.ts +193 -0
  463. package/src/samples/stockfish/skill.ts +154 -0
  464. package/src/samples/stockfish/tasks.ts +306 -0
  465. package/src/samples/stockfish/util.ts +17 -0
  466. package/src/samples/tidepool/TidepoolSpace.test.ts +61 -0
  467. package/src/samples/tidepool/TidepoolSpace.ts +65 -0
  468. package/src/samples/tidepool/docs.ts +140 -0
  469. package/src/samples/tidepool/project.ts +57 -0
  470. package/src/samples/tidepool/tasks.ts +252 -0
  471. package/src/samples/tidepool/team.ts +87 -0
  472. package/src/samples/tidepool/util.ts +18 -0
  473. package/src/samples/weather/WeatherSpace.test.ts +93 -0
  474. package/src/samples/weather/WeatherSpace.ts +59 -0
  475. package/src/samples/weather/project.ts +76 -0
  476. package/src/samples/weather/skill.ts +45 -0
  477. package/src/samples/weather/tasks.ts +98 -0
  478. package/src/samples/weather/util.ts +21 -0
  479. package/src/samples/worker/WorkerSpace.test.ts +102 -0
  480. package/src/samples/worker/WorkerSpace.ts +56 -0
  481. package/src/samples/worker/project.ts +72 -0
  482. package/src/samples/worker/tasks.ts +119 -0
  483. package/src/samples/worker/util.ts +17 -0
  484. package/src/stories/SpaceTemplates.stories.tsx +105 -0
  485. package/src/testing/index.ts +6 -0
  486. package/src/testing/stub-drawer-plugin.ts +65 -0
  487. package/src/testing/stub-tools-plugin.tsx +95 -0
  488. package/src/translations.ts +15 -6
  489. package/src/types/Debug.ts +2 -2
  490. package/src/types/DebugNodes.ts +21 -1
  491. package/src/types/DebugOperation.ts +206 -0
  492. package/src/types/DebugSurface.ts +7 -0
  493. package/src/types/index.ts +6 -6
  494. package/dist/lib/chunk-LogStatus.mjs +0 -44
  495. package/dist/lib/chunk-LogStatus.mjs.map +0 -1
  496. package/dist/types/src/containers/LogStatus/LogStatus.d.ts +0 -6
  497. package/dist/types/src/containers/LogStatus/LogStatus.d.ts.map +0 -1
  498. package/dist/types/src/containers/LogStatus/index.d.ts +0 -2
  499. package/dist/types/src/containers/LogStatus/index.d.ts.map +0 -1
  500. package/src/containers/LogStatus/LogStatus.tsx +0 -51
  501. package/src/containers/LogStatus/index.ts +0 -5
@@ -4,65 +4,46 @@ import * as Capability from "@dxos/app-framework/Capability";
4
4
  import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
5
5
  import { DebugNodes, DebugSurface } from "#types";
6
6
  import { meta } from "#meta";
7
- import { useCallback, useMemo } from "react";
7
+ import * as Effect from "effect/Effect";
8
8
  import { Annotation, Collection, Entity, Filter, Obj, Type } from "@dxos/echo";
9
- import { Panel } from "@dxos/react-ui";
10
- import { jsx, jsxs } from "react/jsx-runtime";
11
- import { Position } from "@dxos/util";
9
+ import { useCallback, useMemo } from "react";
10
+ import { jsx } from "react/jsx-runtime";
11
+ import * as SpaceCapabilities from "@dxos/plugin-space/SpaceCapabilities";
12
12
  import * as SpaceOperation from "@dxos/plugin-space/SpaceOperation";
13
- import * as Effect from "effect/Effect";
14
13
  import * as GraphPath from "@dxos/app-toolkit/GraphPath";
15
- import { Surface, useAtomCapability, useOperationInvoker, useSettingsState } from "@dxos/app-framework/ui";
16
- import { AppSurface, useActiveSpace } from "@dxos/app-toolkit/ui";
17
- import { SpaceState, isSpace } from "@dxos/react-client/echo";
18
- import { DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, DebugStatus, LogStatus, SpaceGenerator, StatsPanel, Wireframe } from "#containers";
14
+ import * as Position from "@dxos/util/Position";
15
+ import * as Surface from "@dxos/app-framework/Surface";
16
+ import * as AppSurface from "@dxos/app-toolkit/AppSurface";
17
+ import { DebugConsole, DebugObjectPanel, DebugPanelDrawer, DebugPanelStatus, DebugSettings, DebugSpaceObjectsPanel, DebugStatus, LoggerPanel, SpaceGenerator, StatsPanel, Wireframe } from "#containers";
19
18
  import { useAtomValue } from "@effect/atom-react/Hooks";
20
19
  import * as Option from "effect/Option";
20
+ import * as Hooks from "@dxos/app-framework/Hooks";
21
21
  import * as AppAnnotation from "@dxos/app-toolkit/AppAnnotation";
22
+ import * as ToolkitHooks from "@dxos/app-toolkit/Hooks";
22
23
  import * as LayoutOperation from "@dxos/app-toolkit/LayoutOperation";
23
- import { HiddenAnnotation } from "@dxos/echo/Annotation";
24
- import * as SpaceCapabilities from "@dxos/plugin-space/SpaceCapabilities";
24
+ import * as SettingsScope from "@dxos/app-toolkit/SettingsScope";
25
+ import * as TypeOptions from "@dxos/app-toolkit/TypeOptions";
25
26
  import { useClient } from "@dxos/react-client";
26
- import { Logger } from "@dxos/react-ui-debug";
27
+ import { SpaceState } from "@dxos/react-client/echo";
27
28
  //#region src/capabilities/DebugSurfaces.tsx
28
- /** Returns `onOpen` and `canOpen` for the ObjectsTree "Open" action. */
29
- var useObjectOpenAction = (invokePromise) => {
30
- const client = useClient();
31
- const showHidden = useAtomCapability(SpaceCapabilities.SettingsAtom)?.showHidden ?? false;
32
- const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
33
- const hiddenTypenames = useMemo(() => {
34
- const result = /* @__PURE__ */ new Set();
35
- for (const typeEntity of allTypes) {
36
- const schema = Type.getSchema(typeEntity);
37
- if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) result.add(Type.getTypename(typeEntity));
38
- }
39
- return result;
40
- }, [allTypes]);
41
- return {
42
- onOpen: useCallback((object) => {
43
- invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });
44
- }, [invokePromise]),
45
- canOpen: useCallback((entity) => {
46
- if (showHidden) return true;
47
- const typename = Entity.getTypename(entity);
48
- return !hiddenTypenames.has(typename ?? "");
49
- }, [showHidden, hiddenTypenames])
50
- };
51
- };
29
+ /** `react-surface.ts` is a plain `.ts` file, so the JSX for the console page's article surface lives here. */
30
+ var DebugConsoleArticle = () => /* @__PURE__ */ jsx(DebugConsole, { fit: true });
52
31
  var DebugSettingsSurface = ({ subject, logStore, onUpload }) => {
53
- const { settings, updateSettings } = useSettingsState(subject.atom);
32
+ const { settings, updateSettings } = Hooks.useSettingsState(subject.atom);
54
33
  return /* @__PURE__ */ jsx(DebugSettings, {
55
34
  settings,
56
35
  onSettingsChange: updateSettings,
57
36
  logStore,
58
- onUpload
37
+ onUpload,
38
+ scope: /* @__PURE__ */ jsx(SettingsScope.Root, { prefix: subject.prefix })
59
39
  });
60
40
  };
61
- /** Generated objects are added to the space's root collection, resolved at invocation time. */
62
- var SpaceGeneratorSurface = ({ role, space }) => {
63
- const { invokePromise } = useOperationInvoker();
41
+ /** Generated objects are added to the active space's root collection, resolved at invocation time. */
42
+ var SpaceGeneratorSurface = ({ role }) => {
43
+ const space = ToolkitHooks.useActiveSpace();
44
+ const { invokePromise } = Hooks.useOperationInvoker();
64
45
  const handleCreateObjects = useCallback((objects) => {
65
- const collection = space.state.get() === SpaceState.SPACE_READY && Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;
46
+ const collection = space?.state.get() === SpaceState.SPACE_READY && Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;
66
47
  if (!Obj.instanceOf(Collection.Collection, collection)) return;
67
48
  objects.forEach((object) => {
68
49
  invokePromise(SpaceOperation.AddObject, {
@@ -71,6 +52,7 @@ var SpaceGeneratorSurface = ({ role, space }) => {
71
52
  });
72
53
  });
73
54
  }, [space, invokePromise]);
55
+ if (!space) return null;
74
56
  return /* @__PURE__ */ jsx(SpaceGenerator, {
75
57
  role,
76
58
  space,
@@ -78,7 +60,7 @@ var SpaceGeneratorSurface = ({ role, space }) => {
78
60
  });
79
61
  };
80
62
  var ObjectDebugSurface = ({ role, companionTo }) => {
81
- const { invokePromise } = useOperationInvoker();
63
+ const { invokePromise } = Hooks.useOperationInvoker();
82
64
  const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
83
65
  return /* @__PURE__ */ jsx(DebugObjectPanel, {
84
66
  role,
@@ -88,8 +70,8 @@ var ObjectDebugSurface = ({ role, companionTo }) => {
88
70
  });
89
71
  };
90
72
  var SpaceObjectsSurface = () => {
91
- const space = useActiveSpace();
92
- const { invokePromise } = useOperationInvoker();
73
+ const space = ToolkitHooks.useActiveSpace();
74
+ const { invokePromise } = Hooks.useOperationInvoker();
93
75
  const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
94
76
  if (!space) return null;
95
77
  return /* @__PURE__ */ jsx(DebugSpaceObjectsPanel, {
@@ -98,23 +80,29 @@ var SpaceObjectsSurface = () => {
98
80
  canOpen
99
81
  });
100
82
  };
101
- var LoggerSurface = () => /* @__PURE__ */ jsx(Logger.Root, { children: /* @__PURE__ */ jsxs(Panel.Root, { children: [
102
- /* @__PURE__ */ jsx(Panel.Toolbar, {
103
- asChild: true,
104
- children: /* @__PURE__ */ jsx(Logger.Toolbar, {})
105
- }),
106
- /* @__PURE__ */ jsx(Panel.Content, {
107
- asChild: true,
108
- children: /* @__PURE__ */ jsx(Logger.Content, { children: /* @__PURE__ */ jsx(Logger.List, {}) })
109
- }),
110
- /* @__PURE__ */ jsx(Panel.Statusbar, {
111
- asChild: true,
112
- children: /* @__PURE__ */ jsx(Logger.Filter, {})
113
- })
114
- ] }) });
83
+ /** Returns `onOpen` and `canOpen` for the ObjectsTree "Open" action. */
84
+ var useObjectOpenAction = (invokePromise) => {
85
+ const client = useClient();
86
+ const showHidden = Hooks.useAtomCapability(SpaceCapabilities.SettingsAtom)?.showHidden ?? false;
87
+ const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
88
+ const hiddenTypenames = useMemo(() => {
89
+ const result = /* @__PURE__ */ new Set();
90
+ for (const typeEntity of allTypes) if (!TypeOptions.isUserType(typeEntity)) result.add(Type.getTypename(typeEntity));
91
+ return result;
92
+ }, [allTypes]);
93
+ return {
94
+ onOpen: useCallback((object) => {
95
+ invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });
96
+ }, [invokePromise]),
97
+ canOpen: useCallback((entity) => {
98
+ if (showHidden) return true;
99
+ const typename = Entity.getTypename(entity);
100
+ return !hiddenTypenames.has(typename ?? "");
101
+ }, [showHidden, hiddenTypenames])
102
+ };
103
+ };
115
104
  //#endregion
116
105
  //#region src/capabilities/react-surface.ts
117
- var isSpaceDebug = (data) => typeof data === "object" && data !== null && "type" in data && data.type === DebugNodes.SpaceType && "space" in data && isSpace(data.space);
118
106
  var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({ logStore }) {
119
107
  const registry = yield* Capabilities.AtomRegistry;
120
108
  const settingsAtom = yield* DebugCapabilities.Settings;
@@ -132,12 +120,9 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
132
120
  }),
133
121
  Surface.create({
134
122
  id: "space",
135
- filter: AppSurface.subject(AppSurface.Article, isSpaceDebug),
123
+ filter: AppSurface.literal(DebugSurface.Page, DebugNodes.SpaceType),
136
124
  component: SpaceGeneratorSurface,
137
- props: ({ role, data: { subject } }) => ({
138
- role,
139
- space: subject.space
140
- })
125
+ props: ({ role }) => ({ role })
141
126
  }),
142
127
  Surface.create({
143
128
  id: "wireframe",
@@ -156,6 +141,16 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
156
141
  classNames: "row-span-2 overflow-hidden"
157
142
  })
158
143
  }),
144
+ Surface.create({
145
+ id: "console",
146
+ filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Console),
147
+ component: DebugConsoleArticle
148
+ }),
149
+ Surface.create({
150
+ id: "logsArticle",
151
+ filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Logs),
152
+ component: LoggerPanel
153
+ }),
159
154
  Surface.create({
160
155
  id: "objectDebug",
161
156
  filter: AppSurface.allOf(AppSurface.literal(AppSurface.Article, "debug"), AppSurface.companion(AppSurface.Article)),
@@ -177,19 +172,26 @@ var react_surface_default = Capability.makeModule(Effect.fnUntraced(function* ({
177
172
  component: DebugStatus
178
173
  }),
179
174
  Surface.create({
180
- id: "logs",
181
- filter: Surface.makeFilter(AppSurface.deckCompanion("logs")),
182
- component: LoggerSurface
175
+ id: "debugPanelStatus",
176
+ filter: Surface.makeFilter(AppSurface.StatusIndicator),
177
+ component: DebugPanelStatus
183
178
  }),
184
179
  Surface.create({
185
- id: "logStatus",
186
- filter: Surface.makeFilter(AppSurface.StatusIndicator),
187
- component: LogStatus
180
+ id: "debugDrawer",
181
+ filter: Surface.makeFilter(AppSurface.Drawer),
182
+ component: DebugPanelDrawer
188
183
  }),
189
184
  Surface.create({
190
185
  id: "statsPanel",
191
186
  filter: Surface.makeFilter(DebugSurface.Stats),
192
187
  component: StatsPanel
188
+ }),
189
+ Surface.create({
190
+ id: "statsCards",
191
+ filter: Surface.makeFilter(AppSurface.DevtoolsOverview),
192
+ position: 20,
193
+ component: StatsPanel,
194
+ props: () => ({ showEmpty: false })
193
195
  })
194
196
  ]);
195
197
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/DebugSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// Surface components that cannot be expressed as a `props` mapper, because they call hooks or compose.\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useAtomCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';\nimport * as AppAnnotation from '@dxos/app-toolkit/AppAnnotation';\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport { useActiveSpace } from '@dxos/app-toolkit/ui';\nimport { Annotation, Collection, Entity, Filter, Obj, Type } from '@dxos/echo';\nimport { HiddenAnnotation } from '@dxos/echo/Annotation';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as SpaceCapabilities from '@dxos/plugin-space/SpaceCapabilities';\nimport * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';\nimport { useClient } from '@dxos/react-client';\nimport { type Space, SpaceState } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { Logger } from '@dxos/react-ui-debug';\n\nimport { DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, SpaceGenerator } from '#containers';\nimport { Settings } from '#types';\n\n/** Returns `onOpen` and `canOpen` for the ObjectsTree \"Open\" action. */\nconst useObjectOpenAction = (invokePromise: ReturnType<typeof useOperationInvoker>['invokePromise']) => {\n const client = useClient();\n const spaceSettings = useAtomCapability(SpaceCapabilities.SettingsAtom);\n const showHidden = spaceSettings?.showHidden ?? false;\n\n const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));\n\n const hiddenTypenames = useMemo(() => {\n const result = new Set<string>();\n for (const typeEntity of allTypes) {\n const schema = Type.getSchema(typeEntity);\n if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) {\n result.add(Type.getTypename(typeEntity));\n }\n }\n return result;\n }, [allTypes]);\n\n const onOpen = useCallback(\n (object: Obj.Unknown) => {\n void invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });\n },\n [invokePromise],\n );\n\n const canOpen = useCallback(\n (entity: Entity.Snapshot) => {\n if (showHidden) {\n return true;\n }\n const typename = Entity.getTypename(entity);\n return !hiddenTypenames.has(typename ?? '');\n },\n [showHidden, hiddenTypenames],\n );\n\n return { onOpen, canOpen };\n};\n\nexport type DebugSettingsSurfaceProps = {\n subject: AppCapabilities.Settings;\n logStore?: IdbLogStore;\n onUpload?: AppCapabilities.FileUploader;\n};\n\nexport const DebugSettingsSurface = ({ subject, logStore, onUpload }: DebugSettingsSurfaceProps) => {\n const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);\n\n return (\n <DebugSettings settings={settings} onSettingsChange={updateSettings} logStore={logStore} onUpload={onUpload} />\n );\n};\n\nexport type SpaceGeneratorSurfaceProps = {\n role: string;\n space: Space;\n};\n\n/** Generated objects are added to the space's root collection, resolved at invocation time. */\nexport const SpaceGeneratorSurface = ({ role, space }: SpaceGeneratorSurfaceProps) => {\n const { invokePromise } = useOperationInvoker();\n const handleCreateObjects = useCallback(\n (objects: Obj.Unknown[]) => {\n const collection =\n space.state.get() === SpaceState.SPACE_READY &&\n Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;\n if (!Obj.instanceOf(Collection.Collection, collection)) {\n return;\n }\n\n objects.forEach((object) => {\n void invokePromise(SpaceOperation.AddObject, { target: collection, object });\n });\n },\n [space, invokePromise],\n );\n\n return <SpaceGenerator role={role} space={space} onCreateObjects={handleCreateObjects} />;\n};\n\nexport type ObjectDebugSurfaceProps = {\n role: string;\n companionTo: Obj.Unknown;\n};\n\nexport const ObjectDebugSurface = ({ role, companionTo }: ObjectDebugSurfaceProps) => {\n const { invokePromise } = useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n\n return <DebugObjectPanel role={role} companionTo={companionTo} onOpen={onOpen} canOpen={canOpen} />;\n};\n\nexport const SpaceObjectsSurface = () => {\n const space = useActiveSpace();\n const { invokePromise } = useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n if (!space) {\n return null;\n }\n\n return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;\n};\n\nexport const LoggerSurface = () => (\n <Logger.Root>\n <Panel.Root>\n <Panel.Toolbar asChild>\n <Logger.Toolbar />\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Logger.Content>\n <Logger.List />\n </Logger.Content>\n </Panel.Content>\n <Panel.Statusbar asChild>\n <Logger.Filter />\n </Panel.Statusbar>\n </Panel.Root>\n </Logger.Root>\n);\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport { type Space, isSpace } from '@dxos/react-client/echo';\nimport { Position } from '@dxos/util';\n\nimport { DebugStatus, LogStatus, StatsPanel, Wireframe } from '#containers';\nimport { meta } from '#meta';\nimport { DebugNodes, DebugSurface } from '#types';\n\nimport { DebugCapabilities } from '../types/Debug';\nimport {\n DebugSettingsSurface,\n LoggerSurface,\n ObjectDebugSurface,\n SpaceGeneratorSurface,\n SpaceObjectsSurface,\n} from './DebugSurfaces';\n\ntype SpaceDebug = {\n type: string;\n space: Space;\n};\n\nconst isSpaceDebug = (data: unknown): data is SpaceDebug =>\n typeof data === 'object' &&\n data !== null &&\n 'type' in data &&\n data.type === DebugNodes.SpaceType &&\n 'space' in data &&\n isSpace(data.space);\n\ntype ReactSurfaceOptions = {\n logStore?: IdbLogStore;\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {\n const registry = yield* Capabilities.AtomRegistry;\n const settingsAtom = yield* DebugCapabilities.Settings;\n const fileUploader = (yield* Capability.getAll(AppCapabilities.FileUploader))[0];\n\n return Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: DebugSettingsSurface,\n props: ({ data: { subject } }) => ({ subject, logStore, onUpload: fileUploader }),\n }),\n Surface.create({\n id: 'space',\n filter: AppSurface.subject(AppSurface.Article, isSpaceDebug),\n component: SpaceGeneratorSurface,\n props: ({ role, data: { subject } }) => ({ role, space: subject.space }),\n }),\n Surface.create({\n id: 'wireframe',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n ),\n position: Position.first,\n component: Wireframe,\n props: ({ role, name, data: { subject } }) => ({\n label: `${role}:${name}`,\n object: subject,\n classNames: 'row-span-2 overflow-hidden',\n }),\n }),\n Surface.create({\n id: 'objectDebug',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'debug'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: ObjectDebugSurface,\n props: ({ role, data: { companionTo } }) => ({ role, companionTo }),\n }),\n Surface.create({\n id: 'spaceObjects',\n filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),\n component: SpaceObjectsSurface,\n }),\n Surface.create({\n id: 'debugStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n position: Position.first,\n component: DebugStatus,\n }),\n Surface.create({\n id: 'logs',\n filter: Surface.makeFilter(AppSurface.deckCompanion('logs')),\n component: LoggerSurface,\n }),\n Surface.create({\n id: 'logStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n component: LogStatus,\n }),\n Surface.create({\n id: 'statsPanel',\n filter: Surface.makeFilter(DebugSurface.Stats),\n component: StatsPanel,\n }),\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,uBAAuB,kBAA2E;CACtG,MAAM,SAAS,UAAU;CAEzB,MAAM,aADgB,kBAAkB,kBAAkB,YACvC,CAAA,EAAe,cAAc;CAEhD,MAAM,WAAW,aAAa,cAAc,OAAO,MAAM,SAAS,MAAM,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;CAE/G,MAAM,kBAAkB,cAAc;EACpC,MAAM,yBAAS,IAAI,IAAY;EAC/B,KAAK,MAAM,cAAc,UAAU;GACjC,MAAM,SAAS,KAAK,UAAU,UAAU;GACxC,IAAI,iBAAiB,IAAI,MAAM,CAAC,CAAC,KAAK,OAAO,gBAAgB,KAAK,CAAC,GACjE,OAAO,IAAI,KAAK,YAAY,UAAU,CAAC;EAE3C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W;EACb,CAAC;EACD,QAAQ,OAAO;GACb,IAAI;GACJ,QAAQ,QAAQ,WAAW,aAAa,KAAK;GAC7C,WAAW;EACb,CAAC;CACH,CAAC;AACH,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/DebugSurfaces.tsx","../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// Surface components that cannot be expressed as a `props` mapper, because they call hooks or compose.\n\nimport { useAtomValue } from '@effect/atom-react/Hooks';\nimport * as Option from 'effect/Option';\nimport React, { useCallback, useMemo } from 'react';\n\nimport * as Hooks from '@dxos/app-framework/Hooks';\nimport * as AppAnnotation from '@dxos/app-toolkit/AppAnnotation';\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as GraphPath from '@dxos/app-toolkit/GraphPath';\nimport * as ToolkitHooks from '@dxos/app-toolkit/Hooks';\nimport * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';\nimport * as SettingsScope from '@dxos/app-toolkit/SettingsScope';\nimport * as TypeOptions from '@dxos/app-toolkit/TypeOptions';\nimport { Annotation, Collection, Entity, Filter, Obj, Type } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as SpaceCapabilities from '@dxos/plugin-space/SpaceCapabilities';\nimport * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';\nimport { useClient } from '@dxos/react-client';\nimport { SpaceState } from '@dxos/react-client/echo';\n\nimport { DebugConsole, DebugObjectPanel, DebugSettings, DebugSpaceObjectsPanel, SpaceGenerator } from '#containers';\nimport { Settings } from '#types';\n\n//\n// DebugConsoleArticle\n//\n\n/** `react-surface.ts` is a plain `.ts` file, so the JSX for the console page's article surface lives here. */\nexport const DebugConsoleArticle = () => <DebugConsole fit />;\n\n//\n// DebugSettings\n//\n\nexport type DebugSettingsSurfaceProps = {\n subject: AppCapabilities.Settings;\n logStore?: IdbLogStore;\n onUpload?: AppCapabilities.FileUploader;\n};\n\nexport const DebugSettingsSurface = ({ subject, logStore, onUpload }: DebugSettingsSurfaceProps) => {\n const { settings, updateSettings } = Hooks.useSettingsState<Settings.Settings>(subject.atom);\n\n return (\n <DebugSettings\n settings={settings}\n onSettingsChange={updateSettings}\n logStore={logStore}\n onUpload={onUpload}\n scope={<SettingsScope.Root prefix={subject.prefix} />}\n />\n );\n};\n\n//\n// SpaceGeneratorSurface\n//\n\nexport type SpaceGeneratorSurfaceProps = {\n role: string;\n};\n\n/** Generated objects are added to the active space's root collection, resolved at invocation time. */\nexport const SpaceGeneratorSurface = ({ role }: SpaceGeneratorSurfaceProps) => {\n const space = ToolkitHooks.useActiveSpace();\n const { invokePromise } = Hooks.useOperationInvoker();\n\n const handleCreateObjects = useCallback(\n (objects: Obj.Unknown[]) => {\n const collection =\n space?.state.get() === SpaceState.SPACE_READY &&\n Annotation.get(space.properties, AppAnnotation.RootCollectionAnnotation).pipe(Option.getOrUndefined)?.target;\n if (!Obj.instanceOf(Collection.Collection, collection)) {\n return;\n }\n\n objects.forEach((object) => {\n void invokePromise(SpaceOperation.AddObject, { target: collection, object });\n });\n },\n [space, invokePromise],\n );\n\n if (!space) {\n return null;\n }\n\n return <SpaceGenerator role={role} space={space} onCreateObjects={handleCreateObjects} />;\n};\n\n//\n// ObjectDebugSurface\n//\n\nexport type ObjectDebugSurfaceProps = {\n role: string;\n companionTo: Obj.Unknown;\n};\n\nexport const ObjectDebugSurface = ({ role, companionTo }: ObjectDebugSurfaceProps) => {\n const { invokePromise } = Hooks.useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n\n return <DebugObjectPanel role={role} companionTo={companionTo} onOpen={onOpen} canOpen={canOpen} />;\n};\n\n//\n// SpaceObjectsSurface\n//\n\nexport const SpaceObjectsSurface = () => {\n const space = ToolkitHooks.useActiveSpace();\n const { invokePromise } = Hooks.useOperationInvoker();\n const { onOpen, canOpen } = useObjectOpenAction(invokePromise);\n if (!space) {\n return null;\n }\n\n return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;\n};\n\n/** Returns `onOpen` and `canOpen` for the ObjectsTree \"Open\" action. */\nconst useObjectOpenAction = (invokePromise: ReturnType<typeof Hooks.useOperationInvoker>['invokePromise']) => {\n const client = useClient();\n const spaceSettings = Hooks.useAtomCapability(SpaceCapabilities.SettingsAtom);\n const showHidden = spaceSettings?.showHidden ?? false;\n\n const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));\n\n const hiddenTypenames = useMemo(() => {\n const result = new Set<string>();\n for (const typeEntity of allTypes) {\n if (!TypeOptions.isUserType(typeEntity)) {\n result.add(Type.getTypename(typeEntity));\n }\n }\n return result;\n }, [allTypes]);\n\n const onOpen = useCallback(\n (object: Obj.Unknown) => {\n void invokePromise(LayoutOperation.Open, { subject: [GraphPath.getObjectPathFromObject(object)] });\n },\n [invokePromise],\n );\n\n const canOpen = useCallback(\n (entity: Entity.Snapshot) => {\n if (showHidden) {\n return true;\n }\n const typename = Entity.getTypename(entity);\n return !hiddenTypenames.has(typename ?? '');\n },\n [showHidden, hiddenTypenames],\n );\n\n return { onOpen, canOpen };\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Surface from '@dxos/app-framework/Surface';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppSurface from '@dxos/app-toolkit/AppSurface';\nimport { Obj } from '@dxos/echo';\nimport { type IdbLogStore } from '@dxos/log-store-idb';\nimport * as Position from '@dxos/util/Position';\n\nimport { DebugPanelDrawer, DebugPanelStatus, DebugStatus, LoggerPanel, StatsPanel, Wireframe } from '#containers';\nimport { meta } from '#meta';\nimport { DebugNodes, DebugSurface } from '#types';\n\nimport { DebugCapabilities } from '../types/Debug.ts';\nimport {\n DebugConsoleArticle,\n DebugSettingsSurface,\n ObjectDebugSurface,\n SpaceGeneratorSurface,\n SpaceObjectsSurface,\n} from './DebugSurfaces.tsx';\n\ntype ReactSurfaceOptions = {\n logStore?: IdbLogStore;\n};\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {\n const registry = yield* Capabilities.AtomRegistry;\n const settingsAtom = yield* DebugCapabilities.Settings;\n const fileUploader = (yield* Capability.getAll(AppCapabilities.FileUploader))[0];\n\n return Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'pluginSettings',\n filter: AppSurface.settings(AppSurface.Article, meta.profile.key),\n component: DebugSettingsSurface,\n props: ({ data: { subject } }) => ({ subject, logStore, onUpload: fileUploader }),\n }),\n Surface.create({\n id: 'space',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.SpaceType),\n component: SpaceGeneratorSurface,\n props: ({ role }) => ({ role }),\n }),\n Surface.create({\n id: 'wireframe',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {\n const settings = registry.get(settingsAtom);\n return Obj.isObject(value) && !!settings.wireframe;\n }),\n ),\n position: Position.first,\n component: Wireframe,\n props: ({ role, name, data: { subject } }) => ({\n label: `${role}:${name}`,\n object: subject,\n classNames: 'row-span-2 overflow-hidden',\n }),\n }),\n Surface.create({\n id: 'console',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Console),\n component: DebugConsoleArticle,\n }),\n Surface.create({\n id: 'logsArticle',\n filter: AppSurface.literal(DebugSurface.Page, DebugNodes.Logs),\n component: LoggerPanel,\n }),\n Surface.create({\n id: 'objectDebug',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'debug'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: ObjectDebugSurface,\n props: ({ role, data: { companionTo } }) => ({ role, companionTo }),\n }),\n Surface.create({\n id: 'spaceObjects',\n filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),\n component: SpaceObjectsSurface,\n }),\n Surface.create({\n id: 'debugStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n position: Position.first,\n component: DebugStatus,\n }),\n Surface.create({\n id: 'debugPanelStatus',\n filter: Surface.makeFilter(AppSurface.StatusIndicator),\n component: DebugPanelStatus,\n }),\n Surface.create({\n id: 'debugDrawer',\n filter: Surface.makeFilter(AppSurface.Drawer),\n component: DebugPanelDrawer,\n }),\n Surface.create({\n id: 'statsPanel',\n filter: Surface.makeFilter(DebugSurface.Stats),\n component: StatsPanel,\n }),\n Surface.create({\n id: 'statsCards',\n filter: Surface.makeFilter(AppSurface.DevtoolsOverview),\n // After the devtools cards (0–12) and before contributors that sit last.\n position: 20,\n component: StatsPanel,\n props: () => ({ showEmpty: false }),\n }),\n ]);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,IAAa,4BAA4B,oBAAC,cAAD,EAAc,KAAA,KAAK,CAAA;AAY5D,IAAa,wBAAwB,EAAE,SAAS,UAAU,eAA0C;CAClG,MAAM,EAAE,UAAU,mBAAmB,MAAM,iBAAoC,QAAQ,IAAI;CAE3F,OACE,oBAAC,eAAD;EACY;EACV,kBAAkB;EACR;EACA;EACV,OAAO,oBAAC,cAAc,MAAf,EAAoB,QAAQ,QAAQ,OAAS,CAAA;CACrD,CAAA;AAEL;;AAWA,IAAa,yBAAyB,EAAE,WAAuC;CAC7E,MAAM,QAAQ,aAAa,eAAe;CAC1C,MAAM,EAAE,kBAAkB,MAAM,oBAAoB;CAEpD,MAAM,sBAAsB,aACzB,YAA2B;EAC1B,MAAM,aACJ,OAAO,MAAM,IAAI,MAAM,WAAW,eAClC,WAAW,IAAI,MAAM,YAAY,cAAc,wBAAwB,CAA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app-toolkit/AppCapabilities";
3
3
  import { Debug, Settings } from "#types";
4
4
  import { meta } from "#meta";
5
5
  import * as Effect from "effect/Effect";
6
- import { createKvsStore } from "@dxos/effect";
6
+ import * as KvsStore from "@dxos/effect/KvsStore";
7
7
  //#region src/capabilities/settings.ts
8
8
  var settings_default = Capability.makeModule(() => Effect.sync(() => {
9
- const settingsAtom = createKvsStore({
9
+ const settingsAtom = KvsStore.make({
10
10
  key: meta.profile.key,
11
11
  schema: Settings.Settings,
12
12
  defaultValue: () => ({})
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-settings.mjs","names":[],"sources":["../../src/capabilities/settings.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport { createKvsStore } from '@dxos/effect';\n\nimport { meta } from '#meta';\nimport { Debug, Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.sync(() => {\n const settingsAtom = createKvsStore({\n key: meta.profile.key,\n schema: Settings.Settings,\n defaultValue: () => ({}),\n });\n\n return [\n Capability.contribute(Debug.DebugCapabilities.Settings, settingsAtom),\n Capability.contribute(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,mBAAe,WAAW,iBACxB,OAAO,WAAW;CAChB,MAAM,eAAe,eAAe;EAClC,KAAK,KAAK,QAAQ;EAClB,QAAQ,SAAS;EACjB,qBAAqB,CAAC;CACxB,CAAC;CAED,OAAO,CACL,WAAW,WAAW,MAAM,kBAAkB,UAAU,YAAY,GACpE,WAAW,WAAW,gBAAgB,UAAU;EAC9C,QAAQ,KAAK,QAAQ;EACrB,QAAQ,SAAS;EACjB,MAAM;CACR,CAAC,CACH;AACF,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-settings.mjs","names":[],"sources":["../../src/capabilities/settings.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as KvsStore from '@dxos/effect/KvsStore';\n\nimport { meta } from '#meta';\nimport { Debug, Settings } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.sync(() => {\n const settingsAtom = KvsStore.make({\n key: meta.profile.key,\n schema: Settings.Settings,\n defaultValue: () => ({}),\n });\n\n return [\n Capability.contribute(Debug.DebugCapabilities.Settings, settingsAtom),\n Capability.contribute(AppCapabilities.Settings, {\n prefix: meta.profile.key,\n schema: Settings.Settings,\n atom: settingsAtom,\n }),\n ];\n }),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,mBAAe,WAAW,iBACxB,OAAO,WAAW;CAChB,MAAM,eAAe,SAAS,KAAK;EACjC,KAAK,KAAK,QAAQ;EAClB,QAAQ,SAAS;EACjB,qBAAqB,CAAC;CACxB,CAAC;CAED,OAAO,CACL,WAAW,WAAW,MAAM,kBAAkB,UAAU,YAAY,GACpE,WAAW,WAAW,gBAAgB,UAAU;EAC9C,QAAQ,KAAK,QAAQ;EACrB,QAAQ,SAAS;EACjB,MAAM;CACR,CAAC,CACH;AACF,CAAC,CACH"}
@@ -0,0 +1,170 @@
1
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
2
+ import * as Capability from "@dxos/app-framework/Capability";
3
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
4
+ import { DebugOperation } from "#types";
5
+ import * as Plugin from "@dxos/app-framework/Plugin";
6
+ import * as Effect from "effect/Effect";
7
+ import { Filter, Obj, Query, Relation } from "@dxos/echo";
8
+ import * as Markdown from "@dxos/plugin-markdown/Markdown";
9
+ import { AnchoredTo } from "@dxos/types";
10
+ import { LogLevel } from "@dxos/log";
11
+ import * as Operation from "@dxos/compute/Operation";
12
+ import * as AppGraphNode from "@dxos/app-graph/AppGraphNode";
13
+ import { logBuffer } from "@dxos/react-ui-debug/log-buffer";
14
+ import * as Option from "effect/Option";
15
+ import * as AppGraph from "@dxos/app-graph/AppGraph";
16
+ import * as AppSpace from "@dxos/app-toolkit/AppSpace";
17
+ import * as ClientCapabilities from "@dxos/plugin-client/ClientCapabilities";
18
+ import * as AttentionCapabilities from "@dxos/plugin-attention/AttentionCapabilities";
19
+ import { SpaceState } from "@dxos/protocols/buf/dxos/client/invitation_pb";
20
+ //#region src/operations/snapshot.ts
21
+ /** Best-effort localization: an i18n tuple degrades to its key when no translator is active. */
22
+ var makeTranslate = (translator) => (label) => {
23
+ if (typeof label === "string") return label;
24
+ if (Array.isArray(label) && typeof label[0] === "string") return translator ? translator.t(label[0], label[1]) : label[0];
25
+ };
26
+ /** ECHO objects summarize to identity — a snapshot must be O(planks), never O(space). */
27
+ var summarizeSubject = (data) => {
28
+ if (data == null || typeof data !== "object") return;
29
+ if (Obj.isObject(data)) return {
30
+ dxn: String(Obj.getURI(data)),
31
+ typename: Obj.getTypename(data),
32
+ name: Obj.getLabel(data),
33
+ text: Obj.instanceOf(Markdown.Document, data) ? data.content.target?.content : void 0
34
+ };
35
+ if ("id" in data && typeof data.id === "string") return { id: data.id };
36
+ };
37
+ /** The comment threads on an object, with their messages loaded — the review companion's view of it. */
38
+ var collectComments = async (subject) => {
39
+ if (!Obj.isObject(subject)) return;
40
+ const db = Obj.getDatabase(subject);
41
+ if (!db) return;
42
+ const anchors = await db.query(Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo)).run();
43
+ return Promise.all(anchors.map(async (anchor) => {
44
+ const thread = Relation.getSource(anchor);
45
+ const messages = await Promise.all(thread.messages.map((ref) => ref.load()));
46
+ return {
47
+ id: thread.id,
48
+ anchorId: anchor.id,
49
+ anchor: anchor.anchor,
50
+ status: thread.status,
51
+ messages: messages.map((message) => ({
52
+ id: message.id,
53
+ sender: message.sender.name ?? message.sender.identityDid,
54
+ text: message.blocks.map((block) => block._tag === "text" ? block.text : void 0).filter((text) => text !== void 0).join("\n")
55
+ }))
56
+ };
57
+ }));
58
+ };
59
+ var OPERATION_DXN = /dxn:[^/]+/;
60
+ /** Flattens the node's actions with one level of group expansion — what a menu would show. */
61
+ var collectActions = (graph, translate, nodeId) => {
62
+ const out = [];
63
+ const walk = (items, depth) => {
64
+ for (const item of items) {
65
+ const group = AppGraphNode.isActionGroup(item);
66
+ const properties = item.properties ?? {};
67
+ out.push({
68
+ id: item.id,
69
+ label: translate(properties.label),
70
+ icon: typeof properties.icon === "string" ? properties.icon : void 0,
71
+ disabled: typeof properties.disabled === "boolean" ? properties.disabled : void 0,
72
+ operation: item.id.match(OPERATION_DXN)?.[0],
73
+ group: group ? true : void 0
74
+ });
75
+ if (group && depth < 1) walk(AppGraph.getActions(graph, item.id), depth + 1);
76
+ }
77
+ };
78
+ walk(AppGraph.getActions(graph, nodeId), 0);
79
+ return out;
80
+ };
81
+ /** Interim surface source until the surface registry (INTROSPECTION.md §3.2): dev builds wrap every mounted surface in `<dx-surface>`. */
82
+ var collectSurfaces = () => {
83
+ if (typeof document === "undefined") return [];
84
+ return Array.from(document.querySelectorAll("dx-surface")).map((el) => ({
85
+ id: el.getAttribute("data-id") ?? void 0,
86
+ role: el.getAttribute("data-role") ?? void 0,
87
+ component: el.getAttribute("data-component") ?? void 0
88
+ }));
89
+ };
90
+ /** The app's own report of what an operation just did — read the way a user reads it, off the DOM. */
91
+ var collectToasts = () => {
92
+ if (typeof document === "undefined") return [];
93
+ return Array.from(document.querySelectorAll("[data-scope=\"toast\"][data-part=\"root\"]")).map((el) => ({
94
+ title: el.querySelector("[data-part=\"title\"]")?.textContent ?? void 0,
95
+ description: el.querySelector("[data-part=\"description\"]")?.textContent ?? void 0,
96
+ actions: Array.from(el.querySelectorAll("button")).map((button) => button.getAttribute("aria-label") ?? button.textContent ?? "")
97
+ }));
98
+ };
99
+ /** Recent error-level entries from the process-wide log buffer, which the plugin starts recording at startup. */
100
+ var collectErrors = (since) => logBuffer.getRows().filter(({ entry }) => entry.level >= LogLevel.ERROR && entry.timestamp >= since).map(({ entry }) => ({
101
+ timestamp: entry.timestamp,
102
+ message: entry.message,
103
+ error: entry.computedError,
104
+ file: entry.meta?.F
105
+ }));
106
+ var DEFAULT_ERROR_WINDOW_MS = 6e4;
107
+ var handler = DebugOperation.Snapshot.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ since }) {
108
+ const manager = yield* Plugin.Service;
109
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
110
+ const layoutAtom = yield* Capability.getOption(AppCapabilities.Layout);
111
+ const graphBuilder = yield* Capability.getOption(AppCapabilities.AppGraph);
112
+ const translator = yield* Capability.getOption(AppCapabilities.Translator);
113
+ const attention = yield* Capability.getOption(AttentionCapabilities.Attention);
114
+ const client = yield* Capability.getOption(ClientCapabilities.Client);
115
+ const translate = makeTranslate(Option.getOrUndefined(translator));
116
+ const layout = Option.getOrUndefined(Option.map(layoutAtom, (atom) => registry.get(atom)));
117
+ const graph = Option.getOrUndefined(Option.map(graphBuilder, (builder) => builder.graph));
118
+ const planks = yield* Effect.promise(() => Promise.all((layout?.active ?? []).map(async (id) => {
119
+ const node = graph ? Option.getOrUndefined(AppGraph.getNode(graph, id)) : void 0;
120
+ return {
121
+ id,
122
+ label: node ? translate(node.properties?.label) : void 0,
123
+ type: node?.type,
124
+ subject: node ? summarizeSubject(node.data) : void 0,
125
+ actions: graph ? collectActions(graph, translate, id) : [],
126
+ comments: node ? await collectComments(node.data) : void 0
127
+ };
128
+ })));
129
+ const spaces = Option.match(client, {
130
+ onNone: () => [],
131
+ onSome: (client) => {
132
+ const defaultSpace = AppSpace.getDefaultSpace(client);
133
+ return client.spaces.get().map((space) => ({
134
+ id: space.id,
135
+ name: space.state.get() === SpaceState.SPACE_READY ? space.properties.name : void 0,
136
+ state: SpaceState[space.state.get()],
137
+ default: space === defaultSpace ? true : void 0
138
+ }));
139
+ }
140
+ });
141
+ const activeModules = new Set(manager.getActive());
142
+ const plugins = manager.getPlugins();
143
+ return {
144
+ layout: layout && {
145
+ mode: layout.mode,
146
+ sidebarOpen: layout.sidebarOpen,
147
+ complementarySidebarOpen: layout.complementarySidebarOpen,
148
+ dialogOpen: layout.dialogOpen,
149
+ workspace: layout.workspace,
150
+ active: layout.active,
151
+ inactive: layout.inactive,
152
+ scrollIntoView: layout.scrollIntoView
153
+ },
154
+ attention: Option.getOrUndefined(attention)?.getCurrent().slice() ?? [],
155
+ planks,
156
+ surfaces: collectSurfaces(),
157
+ spaces,
158
+ toasts: collectToasts(),
159
+ errors: collectErrors(since ?? Date.now() - DEFAULT_ERROR_WINDOW_MS),
160
+ plugins: {
161
+ installed: plugins.length,
162
+ enabled: manager.getEnabled().length,
163
+ active: plugins.filter((plugin) => plugin.modules.some((module) => activeModules.has(module.id))).length
164
+ }
165
+ };
166
+ })));
167
+ //#endregion
168
+ export { handler as default };
169
+
170
+ //# sourceMappingURL=chunk-snapshot.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-snapshot.mjs","names":[],"sources":["../../src/operations/snapshot.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport * as AppGraph from '@dxos/app-graph/AppGraph';\nimport * as AppGraphNode from '@dxos/app-graph/AppGraphNode';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppSpace from '@dxos/app-toolkit/AppSpace';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Filter, Obj, Query, Relation } from '@dxos/echo';\nimport { LogLevel } from '@dxos/log';\nimport * as AttentionCapabilities from '@dxos/plugin-attention/AttentionCapabilities';\nimport * as ClientCapabilities from '@dxos/plugin-client/ClientCapabilities';\nimport * as Markdown from '@dxos/plugin-markdown/Markdown';\nimport { SpaceState } from '@dxos/protocols/buf/dxos/client/invitation_pb';\n// UI-free subpath: the root barrel reaches the panel components.\nimport { logBuffer } from '@dxos/react-ui-debug/log-buffer';\nimport { AnchoredTo, type Message, type Thread } from '@dxos/types';\n\nimport { DebugOperation } from '#types';\n\ntype Translate = (label: unknown) => string | undefined;\n\n/** Best-effort localization: an i18n tuple degrades to its key when no translator is active. */\nconst makeTranslate =\n (translator: { t: (key: string, options?: unknown) => string } | undefined): Translate =>\n (label) => {\n if (typeof label === 'string') {\n return label;\n }\n if (Array.isArray(label) && typeof label[0] === 'string') {\n return translator ? translator.t(label[0], label[1]) : label[0];\n }\n return undefined;\n };\n\n/** ECHO objects summarize to identity — a snapshot must be O(planks), never O(space). */\nconst summarizeSubject = (data: unknown) => {\n if (data == null || typeof data !== 'object') {\n return undefined;\n }\n if (Obj.isObject(data)) {\n return {\n dxn: String(Obj.getURI(data)),\n typename: Obj.getTypename(data),\n name: Obj.getLabel(data),\n // Bounded by the one open document, so the snapshot stays O(planks).\n text: Obj.instanceOf(Markdown.Document, data) ? data.content.target?.content : undefined,\n };\n }\n if ('id' in data && typeof data.id === 'string') {\n return { id: data.id };\n }\n return undefined;\n};\n\n/** The comment threads on an object, with their messages loaded — the review companion's view of it. */\nconst collectComments = async (subject: unknown) => {\n if (!Obj.isObject(subject)) {\n return undefined;\n }\n const db = Obj.getDatabase(subject);\n if (!db) {\n return undefined;\n }\n const anchors: AnchoredTo.AnchoredTo[] = await db\n .query(Query.select(Filter.id(subject.id)).targetOf(AnchoredTo.AnchoredTo))\n .run();\n return Promise.all(\n anchors.map(async (anchor) => {\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const messages: Message.Message[] = await Promise.all(thread.messages.map((ref) => ref.load()));\n return {\n id: thread.id,\n anchorId: anchor.id,\n anchor: anchor.anchor,\n status: thread.status,\n messages: messages.map((message) => ({\n id: message.id,\n sender: message.sender.name ?? message.sender.identityDid,\n text: message.blocks\n .map((block) => (block._tag === 'text' ? block.text : undefined))\n .filter((text): text is string => text !== undefined)\n .join('\\n'),\n })),\n };\n }),\n );\n};\n\nconst OPERATION_DXN = /dxn:[^/]+/;\n\n/** Flattens the node's actions with one level of group expansion — what a menu would show. */\nconst collectActions = (\n graph: Parameters<typeof AppGraph.getActions>[0],\n translate: Translate,\n nodeId: string,\n): { id: string; label?: string; icon?: string; disabled?: boolean; operation?: string; group?: boolean }[] => {\n const out: ReturnType<typeof collectActions> = [];\n const walk = (items: readonly AppGraphNode.Node[], depth: number) => {\n for (const item of items) {\n const group = AppGraphNode.isActionGroup(item);\n const properties = item.properties ?? {};\n out.push({\n id: item.id,\n label: translate(properties.label),\n icon: typeof properties.icon === 'string' ? properties.icon : undefined,\n disabled: typeof properties.disabled === 'boolean' ? properties.disabled : undefined,\n operation: item.id.match(OPERATION_DXN)?.[0],\n group: group ? true : undefined,\n });\n if (group && depth < 1) {\n walk(AppGraph.getActions(graph, item.id), depth + 1);\n }\n }\n };\n walk(AppGraph.getActions(graph, nodeId), 0);\n return out;\n};\n\n/** Interim surface source until the surface registry (INTROSPECTION.md §3.2): dev builds wrap every mounted surface in `<dx-surface>`. */\nconst collectSurfaces = () => {\n if (typeof document === 'undefined') {\n return [];\n }\n return Array.from(document.querySelectorAll('dx-surface')).map((el) => ({\n id: el.getAttribute('data-id') ?? undefined,\n role: el.getAttribute('data-role') ?? undefined,\n component: el.getAttribute('data-component') ?? undefined,\n }));\n};\n\n/** The app's own report of what an operation just did — read the way a user reads it, off the DOM. */\nconst collectToasts = () => {\n if (typeof document === 'undefined') {\n return [];\n }\n return Array.from(document.querySelectorAll('[data-scope=\"toast\"][data-part=\"root\"]')).map((el) => ({\n title: el.querySelector('[data-part=\"title\"]')?.textContent ?? undefined,\n description: el.querySelector('[data-part=\"description\"]')?.textContent ?? undefined,\n actions: Array.from(el.querySelectorAll('button')).map(\n (button) => button.getAttribute('aria-label') ?? button.textContent ?? '',\n ),\n }));\n};\n\n/** Recent error-level entries from the process-wide log buffer, which the plugin starts recording at startup. */\nconst collectErrors = (since: number) =>\n logBuffer\n .getRows()\n .filter(({ entry }) => entry.level >= LogLevel.ERROR && entry.timestamp >= since)\n .map(({ entry }) => ({\n timestamp: entry.timestamp,\n message: entry.message,\n error: entry.computedError,\n file: entry.meta?.F,\n }));\n\nconst DEFAULT_ERROR_WINDOW_MS = 60_000;\n\nconst handler: Operation.WithHandler<typeof DebugOperation.Snapshot> = DebugOperation.Snapshot.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ since }) {\n const manager = yield* Plugin.Service;\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n // Each source is optional: the snapshot degrades per-section rather than failing when a\n // contributing plugin (deck, graph, attention) is not active on this host.\n const layoutAtom = yield* Capability.getOption(AppCapabilities.Layout);\n const graphBuilder = yield* Capability.getOption(AppCapabilities.AppGraph);\n const translator = yield* Capability.getOption(AppCapabilities.Translator);\n const attention = yield* Capability.getOption(AttentionCapabilities.Attention);\n const client = yield* Capability.getOption(ClientCapabilities.Client);\n\n const translate = makeTranslate(Option.getOrUndefined(translator));\n const layout = Option.getOrUndefined(Option.map(layoutAtom, (atom) => registry.get(atom)));\n const graph = Option.getOrUndefined(Option.map(graphBuilder, (builder) => builder.graph));\n\n const planks = yield* Effect.promise(() =>\n Promise.all(\n (layout?.active ?? []).map(async (id) => {\n const node = graph ? Option.getOrUndefined(AppGraph.getNode(graph, id)) : undefined;\n return {\n id,\n label: node ? translate(node.properties?.label) : undefined,\n type: node?.type,\n subject: node ? summarizeSubject(node.data) : undefined,\n actions: graph ? collectActions(graph, translate, id) : [],\n comments: node ? await collectComments(node.data) : undefined,\n };\n }),\n ),\n );\n\n const spaces = Option.match(client, {\n onNone: () => [],\n onSome: (client) => {\n const defaultSpace = AppSpace.getDefaultSpace(client);\n return client.spaces.get().map((space) => ({\n id: space.id,\n name: space.state.get() === SpaceState.SPACE_READY ? space.properties.name : undefined,\n state: SpaceState[space.state.get()],\n default: space === defaultSpace ? true : undefined,\n }));\n },\n });\n\n const activeModules = new Set(manager.getActive());\n const plugins = manager.getPlugins();\n\n return {\n layout: layout && {\n mode: layout.mode,\n sidebarOpen: layout.sidebarOpen,\n complementarySidebarOpen: layout.complementarySidebarOpen,\n dialogOpen: layout.dialogOpen,\n workspace: layout.workspace,\n active: layout.active,\n inactive: layout.inactive,\n scrollIntoView: layout.scrollIntoView,\n },\n attention: Option.getOrUndefined(attention)?.getCurrent().slice() ?? [],\n planks,\n surfaces: collectSurfaces(),\n spaces,\n toasts: collectToasts(),\n errors: collectErrors(since ?? Date.now() - DEFAULT_ERROR_WINDOW_MS),\n plugins: {\n installed: plugins.length,\n enabled: manager.getEnabled().length,\n active: plugins.filter((plugin) => plugin.modules.some((module) => activeModules.has(module.id))).length,\n },\n };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA8BA,IAAM,iBACH,gBACA,UAAU;CACT,IAAI,OAAO,UAAU,UACnB,OAAO;CAET,IAAI,MAAM,QAAQ,KAAK,KAAK,OAAO,MAAM,OAAO,UAC9C,OAAO,aAAa,WAAW,EAAE,MAAM,IAAI,MAAM,EAAE,IAAI,MAAM;AAGjE;;AAGF,IAAM,oBAAoB,SAAkB;CAC1C,IAAI,QAAQ,QAAQ,OAAO,SAAS,UAClC;CAEF,IAAI,IAAI,SAAS,IAAI,GACnB,OAAO;EACL,KAAK,OAAO,IAAI,OAAO,IAAI,CAAC;EAC5B,UAAU,IAAI,YAAY,IAAI;EAC9B,MAAM,IAAI,SAAS,IAAI;EAEvB,MAAM,IAAI,WAAW,SAAS,UAAU,IAAI,IAAI,KAAK,QAAQ,QAAQ,UAAU,KAAA;CACjF;CAEF,IAAI,QAAQ,QAAQ,OAAO,KAAK,OAAO,UACrC,OAAO,EAAE,IAAI,KAAK,GAAG;AAGzB;;AAGA,IAAM,kBAAkB,OAAO,YAAqB;CAClD,IAAI,CAAC,IAAI,SAAS,OAAO,GACvB;CAEF,MAAM,KAAK,IAAI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OAAO,KAAA;GAC3C,EAAE;EACJ;CACF,CAAC;CAED,MAAM,gBAAgB,IAAI,IAAI,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,QAAQ,WAAW;CAEnC,OAAO;EACL,QAAQ,UAAU;GAChB,MAAM,OAAO;GACb,aAAa,OAAO;GACpB,0BAA0B,OAAO;GACjC,YAAY,OAAO;GACnB,WAAW,OAAO;GAClB,QAAQ,OAAO;GACf,UAAU,OAAO;GACjB,gBAAgB,OAAO;EACzB;EACA,WAAW,OAAO,eAAe,SAAS,CAAC,EAAE,WAAW,CAAC,CAAC,MAAM,KAAK,CAAC;EACtE;EACA,UAAU,gBAAgB;EAC1B;EACA,QAAQ,cAAc;EACtB,QAAQ,cAAc,SAAS,KAAK,IAAI,IAAI,uBAAuB;EACnE,SAAS;GACP,WAAW,QAAQ;GACnB,SAAS,QAAQ,WAAW,CAAC,CAAC;GAC9B,QAAQ,QAAQ,QAAQ,WAAW,OAAO,QAAQ,MAAM,WAAW,cAAc,IAAI,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;EACpG;CACF;AACF,CAAC,CACH,CACF"}
@@ -0,0 +1,21 @@
1
+ import { r as makeTemplate } from "./chunk-IncidentSpace.mjs";
2
+ import { r as makeTemplate$1 } from "./chunk-PipelineSpace.mjs";
3
+ import { i as makeTemplate$2 } from "./chunk-ReviewSpace.mjs";
4
+ import { r as makeTemplate$3 } from "./chunk-StockfishSpace.mjs";
5
+ import { r as makeTemplate$4 } from "./chunk-TidepoolSpace.mjs";
6
+ import { r as makeTemplate$5 } from "./chunk-WeatherSpace.mjs";
7
+ import { r as makeTemplate$6 } from "./chunk-WorkerSpace.mjs";
8
+ //#region src/capabilities/space-templates.ts
9
+ var space_templates_default = [
10
+ makeTemplate$1(),
11
+ makeTemplate$4(),
12
+ makeTemplate$3(),
13
+ makeTemplate$6(),
14
+ makeTemplate$5(),
15
+ makeTemplate(),
16
+ makeTemplate$2()
17
+ ];
18
+ //#endregion
19
+ export { space_templates_default as default };
20
+
21
+ //# sourceMappingURL=chunk-space-templates.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-space-templates.mjs","names":[],"sources":["../../src/capabilities/space-templates.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport type * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport {\n IncidentSpace,\n PipelineSpace,\n ReviewSpace,\n StockfishSpace,\n TidepoolSpace,\n WeatherSpace,\n WorkerSpace,\n} from '../samples/index.ts';\n\nexport default [\n PipelineSpace.makeTemplate(),\n TidepoolSpace.makeTemplate(),\n StockfishSpace.makeTemplate(),\n WorkerSpace.makeTemplate(),\n WeatherSpace.makeTemplate(),\n IncidentSpace.makeTemplate(),\n ReviewSpace.makeTemplate(),\n] satisfies ReadonlyArray<AppCapabilities.SpaceTemplate>;\n"],"mappings":";;;;;;;;AAgBA,IAAA,0BAAe;CACb,eAA2B;CAC3B,eAA2B;CAC3B,eAA4B;CAC5B,eAAyB;CACzB,eAA0B;CAC1B,aAA2B;CAC3B,eAAyB;AAC3B"}
@@ -3,7 +3,7 @@ import * as Capability from "@dxos/app-framework/Capability";
3
3
  import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
4
4
  import { meta } from "#meta";
5
5
  import * as Effect from "effect/Effect";
6
- import * as Atom from "effect/unstable/reactivity/Atom";
6
+ import * as Atom from "effect/reactivity/Atom";
7
7
  //#region src/capabilities/stats-panel.ts
8
8
  var STORAGE_KEY = `${meta.profile.key}.statsPanel`;
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-stats-panel.mjs","names":[],"sources":["../../src/capabilities/stats-panel.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/unstable/reactivity/Atom';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport { meta } from '#meta';\n\ntype StatsPanelOptions = {\n /** Persist the store to localStorage (hydrate on load, save on write). */\n persist?: boolean;\n};\n\nconst STORAGE_KEY = `${meta.profile.key}.statsPanel`;\n\n/**\n * Contributes the {@link AppCapabilities.StatsPanel} store: a single reactive atom holding one\n * compartment per plugin, keyed by plugin key. Read access spans the whole store; writes are scoped\n * to a compartment via `compartment(pluginKey)`. Kept alive with `Atom.keepAlive` so a background\n * writer (e.g. a sync operation) can populate it before any surface subscribes. When `persist` is set\n * the store hydrates from and saves to localStorage so stats survive a reload.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ persist = true }: StatsPanelOptions = {}) {\n const registry = yield* Capabilities.AtomRegistry;\n const canPersist = persist && typeof localStorage !== 'undefined';\n\n const hydrate = (): Record<string, unknown> => {\n if (!canPersist) {\n return {};\n }\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? JSON.parse(raw) : {};\n } catch {\n // Best-effort: a malformed/unavailable value just starts empty.\n return {};\n }\n };\n\n const statsAtom = Atom.make<Record<string, unknown>>(hydrate()).pipe(Atom.keepAlive);\n\n const save = () => {\n if (!canPersist) {\n return;\n }\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(registry.get(statsAtom)));\n } catch {\n // Best-effort: localStorage may be disabled or over quota; the in-memory atom is authoritative.\n }\n };\n\n return Capability.contribute(AppCapabilities.StatsPanel, {\n statsAtom,\n get: (pluginKey) => registry.get(statsAtom)[pluginKey],\n compartment: (pluginKey) => ({\n set: (stats) => {\n registry.set(statsAtom, { ...registry.get(statsAtom), [pluginKey]: stats });\n save();\n },\n clear: () => {\n const { [pluginKey]: _removed, ...rest } = registry.get(statsAtom);\n registry.set(statsAtom, rest);\n save();\n },\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;AAkBA,IAAM,cAAc,GAAG,KAAK,QAAQ,IAAI;;;;;;;;AASxC,IAAA,sBAAe,WAAW,WACxB,OAAO,WAAW,WAAW,EAAE,UAAU,SAA4B,CAAC,GAAG;CACvE,MAAM,WAAW,OAAO,aAAa;CACrC,MAAM,aAAa,WAAW,OAAO,iBAAiB;CAEtD,MAAM,gBAAyC;EAC7C,IAAI,CAAC,YACH,OAAO,CAAC;EAEV,IAAI;GACF,MAAM,MAAM,aAAa,QAAQ,WAAW;GAC5C,OAAO,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;EAClC,QAAQ;GAEN,OAAO,CAAC;EACV;CACF;CAEA,MAAM,YAAY,KAAK,KAA8B,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS;CAEnF,MAAM,aAAa;EACjB,IAAI,CAAC,YACH;EAEF,IAAI;GACF,aAAa,QAAQ,aAAa,KAAK,UAAU,SAAS,IAAI,SAAS,CAAC,CAAC;EAC3E,QAAQ,CAER;CACF;CAEA,OAAO,WAAW,WAAW,gBAAgB,YAAY;EACvD;EACA,MAAM,cAAc,SAAS,IAAI,SAAS,CAAC,CAAC;EAC5C,cAAc,eAAe;GAC3B,MAAM,UAAU;IACd,SAAS,IAAI,WAAW;KAAE,GAAG,SAAS,IAAI,SAAS;MAAI,YAAY;IAAM,CAAC;IAC1E,KAAK;GACP;GACA,aAAa;IACX,MAAM,GAAG,YAAY,UAAU,GAAG,SAAS,SAAS,IAAI,SAAS;IACjE,SAAS,IAAI,WAAW,IAAI;IAC5B,KAAK;GACP;EACF;CACF,CAAC;AACH,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-stats-panel.mjs","names":[],"sources":["../../src/capabilities/stats-panel.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Atom from 'effect/reactivity/Atom';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\n\nimport { meta } from '#meta';\n\ntype StatsPanelOptions = {\n /** Persist the store to localStorage (hydrate on load, save on write). */\n persist?: boolean;\n};\n\nconst STORAGE_KEY = `${meta.profile.key}.statsPanel`;\n\n/**\n * Contributes the {@link AppCapabilities.StatsPanel} store: a single reactive atom holding one\n * compartment per plugin, keyed by plugin key. Read access spans the whole store; writes are scoped\n * to a compartment via `compartment(pluginKey)`. Kept alive with `Atom.keepAlive` so a background\n * writer (e.g. a sync operation) can populate it before any surface subscribes. When `persist` is set\n * the store hydrates from and saves to localStorage so stats survive a reload.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* ({ persist = true }: StatsPanelOptions = {}) {\n const registry = yield* Capabilities.AtomRegistry;\n const canPersist = persist && typeof localStorage !== 'undefined';\n\n const hydrate = (): Record<string, unknown> => {\n if (!canPersist) {\n return {};\n }\n try {\n const raw = localStorage.getItem(STORAGE_KEY);\n return raw ? JSON.parse(raw) : {};\n } catch {\n // Best-effort: a malformed/unavailable value just starts empty.\n return {};\n }\n };\n\n const statsAtom = Atom.make<Record<string, unknown>>(hydrate()).pipe(Atom.keepAlive);\n\n const save = () => {\n if (!canPersist) {\n return;\n }\n try {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(registry.get(statsAtom)));\n } catch {\n // Best-effort: localStorage may be disabled or over quota; the in-memory atom is authoritative.\n }\n };\n\n return Capability.contribute(AppCapabilities.StatsPanel, {\n statsAtom,\n get: (pluginKey) => registry.get(statsAtom)[pluginKey],\n compartment: (pluginKey) => ({\n set: (stats) => {\n registry.set(statsAtom, { ...registry.get(statsAtom), [pluginKey]: stats });\n save();\n },\n clear: () => {\n const { [pluginKey]: _removed, ...rest } = registry.get(statsAtom);\n registry.set(statsAtom, rest);\n save();\n },\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;AAkBA,IAAM,cAAc,GAAG,KAAK,QAAQ,IAAI;;;;;;;;AASxC,IAAA,sBAAe,WAAW,WACxB,OAAO,WAAW,WAAW,EAAE,UAAU,SAA4B,CAAC,GAAG;CACvE,MAAM,WAAW,OAAO,aAAa;CACrC,MAAM,aAAa,WAAW,OAAO,iBAAiB;CAEtD,MAAM,gBAAyC;EAC7C,IAAI,CAAC,YACH,OAAO,CAAC;EAEV,IAAI;GACF,MAAM,MAAM,aAAa,QAAQ,WAAW;GAC5C,OAAO,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;EAClC,QAAQ;GAEN,OAAO,CAAC;EACV;CACF;CAEA,MAAM,YAAY,KAAK,KAA8B,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,SAAS;CAEnF,MAAM,aAAa;EACjB,IAAI,CAAC,YACH;EAEF,IAAI;GACF,aAAa,QAAQ,aAAa,KAAK,UAAU,SAAS,IAAI,SAAS,CAAC,CAAC;EAC3E,QAAQ,CAER;CACF;CAEA,OAAO,WAAW,WAAW,gBAAgB,YAAY;EACvD;EACA,MAAM,cAAc,SAAS,IAAI,SAAS,CAAC,CAAC;EAC5C,cAAc,eAAe;GAC3B,MAAM,UAAU;IACd,SAAS,IAAI,WAAW;KAAE,GAAG,SAAS,IAAI,SAAS;MAAI,YAAY;IAAM,CAAC;IAC1E,KAAK;GACP;GACA,aAAa;IACX,MAAM,GAAG,YAAY,UAAU,GAAG,SAAS,SAAS,IAAI,SAAS;IACjE,SAAS,IAAI,WAAW,IAAI;IAC5B,KAAK;GACP;EACF;CACF,CAAC;AACH,CAAC,CACH"}
@@ -0,0 +1,17 @@
1
+ import { t as NothingToUndoError } from "./chunk-errors.mjs";
2
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
3
+ import * as Capability from "@dxos/app-framework/Capability";
4
+ import { DebugOperation } from "#types";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Operation from "@dxos/compute/Operation";
7
+ //#region src/operations/undo.ts
8
+ var handler = DebugOperation.Undo.pipe(Operation.withHandler(Effect.fnUntraced(function* () {
9
+ const tracker = yield* Capability.get(Capabilities.HistoryTracker);
10
+ if (!tracker.canUndo()) return yield* Effect.fail(new NothingToUndoError());
11
+ yield* tracker.undo();
12
+ return { undone: true };
13
+ })));
14
+ //#endregion
15
+ export { handler as default };
16
+
17
+ //# sourceMappingURL=chunk-undo.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-undo.mjs","names":[],"sources":["../../src/operations/undo.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Operation from '@dxos/compute/Operation';\n\nimport { DebugOperation } from '#types';\n\nimport { NothingToUndoError } from '../errors.ts';\n\nconst handler: Operation.WithHandler<typeof DebugOperation.Undo> = DebugOperation.Undo.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* () {\n const tracker = yield* Capability.get(Capabilities.HistoryTracker);\n if (!tracker.canUndo()) {\n return yield* Effect.fail(new NothingToUndoError());\n }\n yield* tracker.undo();\n return { undone: true };\n }),\n ),\n);\n\nexport default handler;\n"],"mappings":";;;;;;;AAcA,IAAM,UAA6D,eAAe,KAAK,KACrF,UAAU,YACR,OAAO,WAAW,aAAa;CAC7B,MAAM,UAAU,OAAO,WAAW,IAAI,aAAa,cAAc;CACjE,IAAI,CAAC,QAAQ,QAAQ,GACnB,OAAO,OAAO,OAAO,KAAK,IAAI,mBAAmB,CAAC;CAEpD,OAAO,QAAQ,KAAK;CACpB,OAAO,EAAE,QAAQ,KAAK;AACxB,CAAC,CACH,CACF"}