@dxos/plugin-debug 0.8.4-main.fd6878d → 0.9.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 (250) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +373 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs +15 -0
  5. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
  6. package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs +59 -0
  7. package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs.map +7 -0
  8. package/dist/lib/neutral/DebugPlugin.mjs +59 -0
  9. package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
  10. package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
  11. package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
  12. package/dist/lib/neutral/DebugPlugin.workerd.mjs +12 -0
  13. package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +7 -0
  14. package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs +223 -0
  15. package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs.map +7 -0
  16. package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs +34 -0
  17. package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs.map +7 -0
  18. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs +122 -0
  19. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs.map +7 -0
  20. package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs +23 -0
  21. package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
  22. package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs +177 -0
  23. package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs.map +7 -0
  24. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs +161 -0
  25. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +7 -0
  26. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +146 -0
  27. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs.map +7 -0
  28. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs +52 -0
  29. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +7 -0
  30. package/dist/lib/neutral/app-graph-builder-4OJQQLSH.mjs +626 -0
  31. package/dist/lib/neutral/app-graph-builder-4OJQQLSH.mjs.map +7 -0
  32. package/dist/lib/neutral/capabilities/index.mjs +15 -0
  33. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-HOV6MV5B.mjs +43 -0
  35. package/dist/lib/neutral/chunk-HOV6MV5B.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  37. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
  38. package/dist/lib/{browser/chunk-AJA6RYN3.mjs → neutral/chunk-TAST3Y2C.mjs} +32 -9
  39. package/dist/lib/neutral/chunk-TAST3Y2C.mjs.map +7 -0
  40. package/dist/lib/{browser/SpaceGenerator-XJJAOTIT.mjs → neutral/components/index.mjs} +415 -423
  41. package/dist/lib/neutral/components/index.mjs.map +7 -0
  42. package/dist/lib/neutral/containers/index.mjs +25 -0
  43. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  44. package/dist/lib/neutral/index.mjs +18 -0
  45. package/dist/lib/neutral/index.mjs.map +7 -0
  46. package/dist/lib/neutral/meta.json +1 -0
  47. package/dist/lib/neutral/meta.mjs +8 -0
  48. package/dist/lib/neutral/meta.mjs.map +7 -0
  49. package/dist/lib/neutral/plugin.mjs +12 -0
  50. package/dist/lib/neutral/plugin.mjs.map +7 -0
  51. package/dist/lib/neutral/react-context-MUZ3KVLU.mjs +17 -0
  52. package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
  53. package/dist/lib/neutral/react-surface-YBC4HK7I.mjs +430 -0
  54. package/dist/lib/neutral/react-surface-YBC4HK7I.mjs.map +7 -0
  55. package/dist/lib/neutral/settings-MPM6YUP4.mjs +28 -0
  56. package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
  57. package/dist/lib/neutral/translations.mjs +92 -0
  58. package/dist/lib/neutral/translations.mjs.map +7 -0
  59. package/dist/lib/neutral/types/index.mjs +14 -0
  60. package/dist/lib/neutral/types/index.mjs.map +7 -0
  61. package/dist/types/src/DebugPlugin.d.ts +4 -1
  62. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  63. package/dist/types/src/DebugPlugin.node.d.ts +5 -0
  64. package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
  65. package/dist/types/src/DebugPlugin.test.d.ts +2 -0
  66. package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
  67. package/dist/types/src/DebugPlugin.workerd.d.ts +5 -0
  68. package/dist/types/src/DebugPlugin.workerd.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  70. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  71. package/dist/types/src/capabilities/index.d.ts +8 -5
  72. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/react-context.d.ts +4 -2
  74. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/react-surface.d.ts +7 -2
  76. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/settings.d.ts +5 -2
  78. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  79. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
  80. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
  81. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +107 -0
  82. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
  83. package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
  84. package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
  85. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
  86. package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
  87. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
  88. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +4 -5
  89. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  90. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  91. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  92. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  93. package/dist/types/src/components/SpaceGenerator/presets.d.ts +4 -4
  94. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  95. package/dist/types/src/components/index.d.ts +4 -9
  96. package/dist/types/src/components/index.d.ts.map +1 -1
  97. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  98. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  99. package/dist/types/src/containers/DebugGraph/index.d.ts +2 -0
  100. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  101. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -0
  102. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  103. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +2 -0
  104. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  105. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +5 -0
  106. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  107. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +2 -0
  108. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  109. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  110. package/dist/types/src/containers/DebugStatus/index.d.ts +2 -0
  111. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  112. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  113. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  114. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +2 -0
  115. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  116. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +15 -0
  117. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +1 -0
  118. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +107 -0
  119. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +1 -0
  120. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +3 -0
  121. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +1 -0
  122. package/dist/types/src/containers/GithubPanel/index.d.ts +2 -0
  123. package/dist/types/src/containers/GithubPanel/index.d.ts.map +1 -0
  124. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +3 -0
  125. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +1 -0
  126. package/dist/types/src/containers/RegistryPanel/index.d.ts +2 -0
  127. package/dist/types/src/containers/RegistryPanel/index.d.ts.map +1 -0
  128. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +11 -0
  129. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  130. package/dist/types/src/containers/SpaceGenerator/index.d.ts +2 -0
  131. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  132. package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
  133. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  134. package/dist/types/src/containers/Wireframe/index.d.ts +2 -0
  135. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  136. package/dist/types/src/containers/index.d.ts +11 -0
  137. package/dist/types/src/containers/index.d.ts.map +1 -0
  138. package/dist/types/src/index.d.ts +1 -1
  139. package/dist/types/src/index.d.ts.map +1 -1
  140. package/dist/types/src/meta.d.ts +2 -3
  141. package/dist/types/src/meta.d.ts.map +1 -1
  142. package/dist/types/src/plugin.d.ts +4 -0
  143. package/dist/types/src/plugin.d.ts.map +1 -0
  144. package/dist/types/src/translations.d.ts +88 -57
  145. package/dist/types/src/translations.d.ts.map +1 -1
  146. package/dist/types/src/types/Settings.d.ts +8 -0
  147. package/dist/types/src/types/Settings.d.ts.map +1 -0
  148. package/dist/types/src/types/index.d.ts +71 -0
  149. package/dist/types/src/types/index.d.ts.map +1 -0
  150. package/dist/types/tsconfig.tsbuildinfo +1 -1
  151. package/package.json +125 -76
  152. package/src/DebugPlugin.node.ts +18 -0
  153. package/src/DebugPlugin.test.ts +29 -0
  154. package/src/DebugPlugin.tsx +37 -38
  155. package/src/DebugPlugin.workerd.ts +12 -0
  156. package/src/capabilities/app-graph-builder.ts +397 -412
  157. package/src/capabilities/index.ts +5 -5
  158. package/src/capabilities/react-context.tsx +16 -7
  159. package/src/capabilities/react-surface.tsx +394 -339
  160. package/src/capabilities/settings.ts +24 -12
  161. package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
  162. package/src/components/DebugSettings/DebugSettings.tsx +259 -0
  163. package/src/components/DebugSettings/index.ts +5 -0
  164. package/src/components/SchemaTable/index.ts +5 -0
  165. package/src/components/SpaceGenerator/ObjectGenerator.tsx +41 -47
  166. package/src/components/SpaceGenerator/draw-util.ts +10 -10
  167. package/src/components/SpaceGenerator/index.ts +2 -3
  168. package/src/components/SpaceGenerator/presets.ts +318 -57
  169. package/src/components/index.ts +4 -8
  170. package/src/containers/DebugGraph/DebugGraph.tsx +14 -0
  171. package/src/containers/DebugGraph/index.ts +5 -0
  172. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
  173. package/src/containers/DebugObjectPanel/index.ts +5 -0
  174. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
  175. package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
  176. package/src/{components → containers/DebugStatus}/DebugStatus.tsx +44 -21
  177. package/src/containers/DebugStatus/index.ts +5 -0
  178. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
  179. package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
  180. package/src/containers/GithubPanel/GithubComponent.stories.tsx +38 -0
  181. package/src/containers/GithubPanel/GithubComponent.tsx +192 -0
  182. package/src/containers/GithubPanel/GithubPanel.tsx +17 -0
  183. package/src/containers/GithubPanel/index.ts +5 -0
  184. package/src/containers/RegistryPanel/RegistryPanel.tsx +150 -0
  185. package/src/containers/RegistryPanel/index.ts +5 -0
  186. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +127 -0
  187. package/src/containers/SpaceGenerator/index.ts +5 -0
  188. package/src/{components → containers/Wireframe}/Wireframe.tsx +8 -12
  189. package/src/containers/Wireframe/index.ts +5 -0
  190. package/src/containers/index.ts +15 -0
  191. package/src/index.ts +1 -1
  192. package/src/meta.ts +29 -8
  193. package/src/plugin.ts +10 -0
  194. package/src/translations.ts +84 -56
  195. package/src/types/Settings.ts +16 -0
  196. package/src/{types.ts → types/index.ts} +22 -11
  197. package/src/vite-env.d.ts +10 -0
  198. package/dist/lib/browser/DebugApp-F4UFVW4Y.mjs +0 -228
  199. package/dist/lib/browser/DebugApp-F4UFVW4Y.mjs.map +0 -7
  200. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs +0 -25
  201. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs.map +0 -7
  202. package/dist/lib/browser/SpaceGenerator-XJJAOTIT.mjs.map +0 -7
  203. package/dist/lib/browser/app-graph-builder-PXPZIIGY.mjs +0 -597
  204. package/dist/lib/browser/app-graph-builder-PXPZIIGY.mjs.map +0 -7
  205. package/dist/lib/browser/chunk-5XPIRNQS.mjs +0 -18
  206. package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
  207. package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
  208. package/dist/lib/browser/index.mjs +0 -130
  209. package/dist/lib/browser/index.mjs.map +0 -7
  210. package/dist/lib/browser/meta.json +0 -1
  211. package/dist/lib/browser/react-context-NVAGLAJD.mjs +0 -16
  212. package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
  213. package/dist/lib/browser/react-surface-UNFNQFWK.mjs +0 -768
  214. package/dist/lib/browser/react-surface-UNFNQFWK.mjs.map +0 -7
  215. package/dist/lib/browser/settings-LSSWLM5I.mjs +0 -22
  216. package/dist/lib/browser/settings-LSSWLM5I.mjs.map +0 -7
  217. package/dist/types/src/components/Container.d.ts +0 -5
  218. package/dist/types/src/components/Container.d.ts.map +0 -1
  219. package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
  220. package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
  221. package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
  222. package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
  223. package/dist/types/src/components/DebugApp/index.d.ts +0 -3
  224. package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
  225. package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
  226. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  227. package/dist/types/src/components/DebugSettings.d.ts +0 -6
  228. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  229. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  230. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  231. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  232. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
  233. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
  234. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -6
  235. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  236. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  237. package/dist/types/src/types.d.ts +0 -63
  238. package/dist/types/src/types.d.ts.map +0 -1
  239. package/src/components/Container.tsx +0 -15
  240. package/src/components/DebugApp/DebugApp.tsx +0 -85
  241. package/src/components/DebugApp/Tree.tsx +0 -103
  242. package/src/components/DebugApp/index.ts +0 -7
  243. package/src/components/DebugObjectPanel.tsx +0 -35
  244. package/src/components/DebugSettings.tsx +0 -151
  245. package/src/components/DevtoolsOverviewContainer.tsx +0 -20
  246. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
  247. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
  248. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  249. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  250. /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
@@ -2,20 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { pipe } from 'effect';
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Option from 'effect/Option';
6
7
  import React, { useCallback } from 'react';
7
8
 
8
- import {
9
- Capabilities,
10
- LayoutAction,
11
- type PluginContext,
12
- chain,
13
- contributes,
14
- createIntent,
15
- createSurface,
16
- useCapability,
17
- useIntentDispatcher,
18
- } from '@dxos/app-framework';
9
+ import { Capabilities, Capability } from '@dxos/app-framework';
10
+ import { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
11
+ import { AppCapabilities, LayoutOperation, RootCollectionAnnotation, getObjectPathFromObject } from '@dxos/app-toolkit';
12
+ import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
19
13
  import {
20
14
  AutomergePanel,
21
15
  ConfigPanel,
@@ -37,34 +31,37 @@ import {
37
31
  SignalPanel,
38
32
  SpaceInfoPanel,
39
33
  SpaceListPanel,
34
+ SqlitePanel,
40
35
  StoragePanel,
41
36
  SwarmPanel,
42
37
  TestingPanel,
43
- TracingPanel,
44
38
  WorkflowPanel,
45
39
  } from '@dxos/devtools';
46
- import { Obj } from '@dxos/echo';
47
- import { SettingsStore } from '@dxos/local-storage';
40
+ import { Annotation, Collection, Feed, Obj } from '@dxos/echo';
48
41
  import { log } from '@dxos/log';
49
- import { ClientCapabilities } from '@dxos/plugin-client';
50
- import { Graph } from '@dxos/plugin-graph';
51
- import { ScriptAction } from '@dxos/plugin-script/types';
52
- import { SpaceAction } from '@dxos/plugin-space/types';
53
- import { type Space, SpaceState, isSpace, parseId } from '@dxos/react-client/echo';
54
- import { StackItem } from '@dxos/react-ui-stack';
55
- import { DataType } from '@dxos/schema';
42
+ import { type IdbLogStore } from '@dxos/log-store-idb';
43
+ import { type Graph } from '@dxos/plugin-graph';
44
+ import { ScriptOperation } from '@dxos/plugin-script';
45
+ import { SpaceOperation } from '@dxos/plugin-space';
46
+ import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
47
+ import { ToolsExplorer } from '@dxos/react-ui-introspect';
56
48
 
49
+ import { DebugSettings } from '#components';
57
50
  import {
58
- DebugApp,
51
+ DebugGraph,
59
52
  DebugObjectPanel,
60
- DebugSettings,
53
+ DebugSpaceObjectsPanel,
61
54
  DebugStatus,
62
55
  DevtoolsOverviewContainer,
56
+ RegistryPanel,
63
57
  SpaceGenerator,
64
58
  Wireframe,
65
- } from '../components';
66
- import { DEBUG_PLUGIN } from '../meta';
67
- import { type DebugSettingsProps, Devtools } from '../types';
59
+ } from '#containers';
60
+ import { meta } from '#meta';
61
+ import { DebugCapabilities, type Settings, Devtools } from '#types';
62
+
63
+ // TODO(burdon): Move to config.
64
+ const MCP_SERVER_URL = 'https://introspect-service-labs.dxos.workers.dev/mcp';
68
65
 
69
66
  type SpaceDebug = {
70
67
  type: string;
@@ -72,326 +69,384 @@ type SpaceDebug = {
72
69
  };
73
70
 
74
71
  type GraphDebug = {
75
- graph: Graph;
72
+ graph: Graph.Graph;
73
+ root: string;
76
74
  };
77
75
 
78
- const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
79
- const isGraphDebug = (data: any): data is GraphDebug => data?.graph instanceof Graph;
76
+ const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}.space` && isSpace(data.space);
77
+ const isGraphDebug = (data: any): data is GraphDebug => {
78
+ const graph = data?.graph;
79
+ return (
80
+ graph != null && typeof graph === 'object' && typeof graph.json === 'function' && typeof data?.root === 'string'
81
+ );
82
+ };
80
83
 
81
- // TODO(wittjosiah): Factor out?
82
- const useCurrentSpace = () => {
83
- const layout = useCapability(Capabilities.Layout);
84
- const client = useCapability(ClientCapabilities.Client);
85
- const { spaceId } = parseId(layout.workspace);
86
- const space = spaceId ? client.spaces.get(spaceId) : undefined;
87
- return space;
84
+ type ReactSurfaceOptions = {
85
+ logStore?: IdbLogStore;
88
86
  };
89
87
 
90
- export default (context: PluginContext) =>
91
- contributes(Capabilities.ReactSurface, [
92
- createSurface({
93
- id: `${DEBUG_PLUGIN}/plugin-settings`,
94
- role: 'article',
95
- filter: (data): data is { subject: SettingsStore<DebugSettingsProps> } =>
96
- data.subject instanceof SettingsStore && data.subject.prefix === DEBUG_PLUGIN,
97
- component: ({ data: { subject } }) => <DebugSettings settings={subject.value} />,
98
- }),
99
- createSurface({
100
- id: `${DEBUG_PLUGIN}/space`,
101
- role: 'article',
102
- filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
103
- component: ({ data }) => {
104
- const { dispatchPromise: dispatch } = useIntentDispatcher();
88
+ export default Capability.makeModule(
89
+ Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {
90
+ const capabilities = yield* Capability.Service;
91
+ const registry = capabilities.get(Capabilities.AtomRegistry);
92
+ const settingsAtom = capabilities.get(DebugCapabilities.Settings);
93
+ const fileUploader = capabilities.getAll(AppCapabilities.FileUploader)[0];
94
+
95
+ return Capability.contributes(Capabilities.ReactSurface, [
96
+ Surface.create({
97
+ id: 'pluginSettings',
98
+ filter: AppSurface.settings(AppSurface.Article, meta.id),
99
+ component: ({ data: { subject } }) => {
100
+ const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
101
+ return (
102
+ <DebugSettings
103
+ settings={settings}
104
+ onSettingsChange={updateSettings}
105
+ logStore={logStore}
106
+ onUpload={fileUploader}
107
+ />
108
+ );
109
+ },
110
+ }),
111
+ Surface.create({
112
+ id: 'space',
113
+ role: 'article',
114
+ filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
115
+ component: ({ role, data }) => {
116
+ const { invokePromise } = useOperationInvoker();
117
+
118
+ const handleCreateObject = useCallback(
119
+ (objects: Obj.Unknown[]) => {
120
+ if (!isSpace(data.subject.space)) {
121
+ return;
122
+ }
123
+
124
+ const collection =
125
+ data.subject.space.state.get() === SpaceState.SPACE_READY &&
126
+ Annotation.get(data.subject.space.properties, RootCollectionAnnotation).pipe(Option.getOrUndefined)
127
+ ?.target;
128
+ if (!Obj.instanceOf(Collection.Collection, collection)) {
129
+ return;
130
+ }
131
+
132
+ objects.forEach((object) => {
133
+ void invokePromise(SpaceOperation.AddObject, {
134
+ target: collection,
135
+ object,
136
+ });
137
+ });
138
+ },
139
+ [data.subject.space, invokePromise],
140
+ );
141
+
142
+ return <SpaceGenerator role={role} space={data.subject.space} onCreateObjects={handleCreateObject} />;
143
+ },
144
+ }),
145
+ Surface.create({
146
+ id: 'appGraph',
147
+ role: 'article',
148
+ filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
149
+ component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
150
+ }),
151
+ Surface.create({
152
+ id: 'toolsExplorer',
153
+ filter: AppSurface.literal(AppSurface.Article, Devtools.ToolsExplorer),
154
+ component: () => <ToolsExplorer serverUrl={MCP_SERVER_URL} />,
155
+ }),
156
+ Surface.create({
157
+ id: 'registry',
158
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Registry),
159
+ component: () => <RegistryPanel />,
160
+ }),
161
+ Surface.create({
162
+ id: 'wireframe',
163
+ // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
164
+ role: ['article', 'section'],
165
+ position: 'first',
166
+ filter: (data): data is { subject: Obj.Unknown } => {
167
+ const settings = registry.get(settingsAtom);
168
+ return Obj.isObject(data.subject) && !!settings.wireframe;
169
+ },
170
+ component: ({ data, role, name }) => (
171
+ <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
172
+ ),
173
+ }),
174
+ Surface.create({
175
+ id: 'objectDebug',
176
+ filter: AppSurface.allOf(
177
+ AppSurface.literal(AppSurface.Article, 'debug'),
178
+ AppSurface.companion(AppSurface.Article),
179
+ ),
180
+ component: ({ role, data }) => <DebugObjectPanel role={role} companionTo={data.companionTo} />,
181
+ }),
182
+ Surface.create({
183
+ id: 'devtoolsOverview',
184
+ filter: AppSurface.literal(Surface.makeType<{ subject: string }>('deck-companion--devtools'), 'devtools'),
185
+ component: () => <DevtoolsOverviewContainer />,
186
+ }),
187
+ Surface.create({
188
+ id: 'spaceObjects',
189
+ filter: AppSurface.literal(
190
+ Surface.makeType<{ subject: string }>('deck-companion--space-objects'),
191
+ 'space-objects',
192
+ ),
193
+ component: () => {
194
+ const space = useActiveSpace();
195
+ if (!space) {
196
+ return null;
197
+ }
198
+
199
+ return <DebugSpaceObjectsPanel space={space} />;
200
+ },
201
+ }),
202
+
203
+ Surface.create({
204
+ id: 'debugStatus',
205
+ role: 'status-indicator',
206
+ position: 'first',
207
+ component: () => <DebugStatus />,
208
+ }),
209
+
210
+ //
211
+ // Devtools
212
+ //
213
+
214
+ Surface.create({
215
+ id: 'client.config',
216
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Config),
217
+ component: () => <ConfigPanel vaultSelector={false} />,
218
+ }),
219
+ Surface.create({
220
+ id: 'client.storage',
221
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Storage),
222
+ component: () => <StoragePanel />,
223
+ }),
224
+ Surface.create({
225
+ id: 'client.sqlite',
226
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Sqlite),
227
+ component: () => <SqlitePanel />,
228
+ }),
229
+ Surface.create({
230
+ id: 'client.logs',
231
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Logs),
232
+ component: () => <LoggingPanel />,
233
+ }),
234
+ Surface.create({
235
+ id: 'client.diagnostics',
236
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Diagnostics),
237
+ component: () => <DiagnosticsPanel />,
238
+ }),
239
+ Surface.create({
240
+ id: 'halo.identity',
241
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Identity),
242
+ component: () => <IdentityPanel />,
243
+ }),
244
+ Surface.create({
245
+ id: 'halo.devices',
246
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Devices),
247
+ component: () => <DeviceListPanel />,
248
+ }),
249
+ Surface.create({
250
+ id: 'halo.keyring',
251
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Keyring),
252
+ component: () => <KeyringPanel />,
253
+ }),
254
+ Surface.create({
255
+ id: 'halo.credentials',
256
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Credentials),
257
+ component: () => {
258
+ const space = useActiveSpace();
259
+ if (!space) {
260
+ return null;
261
+ }
262
+
263
+ return <CredentialsPanel space={space} />;
264
+ },
265
+ }),
266
+ Surface.create({
267
+ id: 'echo.spaces',
268
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Spaces),
269
+ component: () => {
270
+ const { invokePromise } = useOperationInvoker();
271
+ const handleSelect = useCallback(
272
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
273
+ [invokePromise],
274
+ );
275
+ return <SpaceListPanel onSelect={handleSelect} />;
276
+ },
277
+ }),
278
+ Surface.create({
279
+ id: 'echo.space',
280
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Space),
281
+ component: () => {
282
+ const space = useActiveSpace();
283
+ const { invokePromise } = useOperationInvoker();
284
+ const handleSelect = useCallback(
285
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
286
+ [invokePromise],
287
+ );
288
+ if (!space) {
289
+ return null;
290
+ }
291
+
292
+ return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
293
+ },
294
+ }),
295
+ Surface.create({
296
+ id: 'echo.feeds',
297
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Feeds),
298
+ component: () => {
299
+ const space = useActiveSpace();
300
+ if (!space) {
301
+ return null;
302
+ }
303
+
304
+ return <FeedsPanel space={space} />;
305
+ },
306
+ }),
307
+ Surface.create({
308
+ id: 'echo.objects',
309
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Objects),
310
+ component: () => {
311
+ const space = useActiveSpace();
312
+ if (!space) {
313
+ return null;
314
+ }
315
+
316
+ return <ObjectsPanel space={space} />;
317
+ },
318
+ }),
319
+ Surface.create({
320
+ id: 'echo.schema',
321
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Schema),
322
+ component: () => {
323
+ const space = useActiveSpace();
324
+ if (!space) {
325
+ return null;
326
+ }
105
327
 
106
- const handleCreateObject = useCallback(
107
- (objects: Obj.Any[]) => {
108
- if (!isSpace(data.subject.space)) {
109
- return;
110
- }
328
+ return <SchemaPanel space={space} />;
329
+ },
330
+ }),
331
+ Surface.create({
332
+ id: 'echo.automerge',
333
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Automerge),
334
+ component: () => {
335
+ const space = useActiveSpace();
336
+ if (!space) {
337
+ return null;
338
+ }
111
339
 
112
- const collection =
113
- data.subject.space.state.get() === SpaceState.SPACE_READY &&
114
- data.subject.space.properties[DataType.Collection.typename]?.target;
115
- if (!Obj.instanceOf(DataType.Collection, collection)) {
116
- return;
117
- }
340
+ return <AutomergePanel space={space} />;
341
+ },
342
+ }),
343
+ Surface.create({
344
+ id: 'echo.queues',
345
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Queues),
346
+ component: () => <QueuesPanel />,
347
+ }),
348
+ Surface.create({
349
+ id: 'echo.members',
350
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Members),
351
+ component: () => {
352
+ const space = useActiveSpace();
353
+ if (!space) {
354
+ return null;
355
+ }
118
356
 
119
- objects.forEach((object) => {
120
- void dispatch(createIntent(SpaceAction.AddObject, { target: collection, object }));
121
- });
122
- },
123
- [data.subject.space],
124
- );
357
+ return <MembersPanel space={space} />;
358
+ },
359
+ }),
360
+ Surface.create({
361
+ id: 'echo.metadata',
362
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Metadata),
363
+ component: () => <MetadataPanel />,
364
+ }),
365
+ Surface.create({
366
+ id: 'mesh.signal',
367
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Signal),
368
+ component: () => <SignalPanel />,
369
+ }),
370
+ Surface.create({
371
+ id: 'mesh.swarm',
372
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Swarm),
373
+ component: () => <SwarmPanel />,
374
+ }),
375
+ Surface.create({
376
+ id: 'mesh.network',
377
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Network),
378
+ component: () => {
379
+ const space = useActiveSpace();
380
+ if (!space) {
381
+ return null;
382
+ }
125
383
 
126
- return (
127
- <StackItem.Content>
128
- <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
129
- </StackItem.Content>
130
- );
131
- },
132
- }),
133
- createSurface({
134
- id: `${DEBUG_PLUGIN}/graph`,
135
- role: 'article',
136
- filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
137
- component: ({ data }) => <DebugApp graph={data.subject.graph} />,
138
- }),
139
- createSurface({
140
- id: `${DEBUG_PLUGIN}/wireframe`,
141
- role: ['article', 'section'],
142
- position: 'hoist',
143
- filter: (data): data is { subject: Obj.Any } => {
144
- const settings = context
145
- .getCapability(Capabilities.SettingsStore)
146
- .getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;
147
- return Obj.isObject(data.subject) && !!settings.wireframe;
148
- },
149
- component: ({ data, role }) => (
150
- <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
151
- ),
152
- }),
153
- createSurface({
154
- id: `${DEBUG_PLUGIN}/object-debug`,
155
- role: 'article',
156
- filter: (data): data is { companionTo: Obj.Any } => data.subject === 'debug' && Obj.isObject(data.companionTo),
157
- component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
158
- }),
159
- createSurface({
160
- id: `${DEBUG_PLUGIN}/devtools-overview`,
161
- role: 'deck-companion--devtools',
162
- component: () => <DevtoolsOverviewContainer />,
163
- }),
164
- createSurface({
165
- id: `${DEBUG_PLUGIN}/status`,
166
- role: 'status',
167
- component: () => <DebugStatus />,
168
- }),
384
+ return <NetworkPanel space={space} />;
385
+ },
386
+ }),
387
+ Surface.create({
388
+ id: 'edge.dashboard',
389
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Dashboard),
390
+ component: () => <EdgeDashboardPanel />,
391
+ }),
392
+ Surface.create({
393
+ id: 'edge.workflows',
394
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Workflows),
395
+ component: () => {
396
+ const space = useActiveSpace();
397
+ if (!space) {
398
+ return null;
399
+ }
169
400
 
170
- //
171
- // Devtools
172
- //
401
+ return <WorkflowPanel space={space} />;
402
+ },
403
+ }),
404
+ Surface.create({
405
+ id: 'edge.traces',
406
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Traces),
407
+ component: () => {
408
+ const space = useActiveSpace();
409
+ if (!space) {
410
+ return null;
411
+ }
173
412
 
174
- createSurface({
175
- id: `${DEBUG_PLUGIN}/client/config`,
176
- role: 'article',
177
- filter: (data): data is any => data.subject === Devtools.Client.Config,
178
- component: () => <ConfigPanel vaultSelector={false} />,
179
- }),
180
- createSurface({
181
- id: `${DEBUG_PLUGIN}/client/storage`,
182
- role: 'article',
183
- filter: (data): data is any => data.subject === Devtools.Client.Storage,
184
- component: () => <StoragePanel />,
185
- }),
186
- createSurface({
187
- id: `${DEBUG_PLUGIN}/client/logs`,
188
- role: 'article',
189
- filter: (data): data is any => data.subject === Devtools.Client.Logs,
190
- component: () => <LoggingPanel />,
191
- }),
192
- createSurface({
193
- id: `${DEBUG_PLUGIN}/client/diagnostics`,
194
- role: 'article',
195
- filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
196
- component: () => <DiagnosticsPanel />,
197
- }),
198
- createSurface({
199
- id: `${DEBUG_PLUGIN}/client/tracing`,
200
- role: 'article',
201
- filter: (data): data is any => data.subject === Devtools.Client.Tracing,
202
- component: () => <TracingPanel />,
203
- }),
204
- createSurface({
205
- id: `${DEBUG_PLUGIN}/halo/identity`,
206
- role: 'article',
207
- filter: (data): data is any => data.subject === Devtools.Halo.Identity,
208
- component: () => <IdentityPanel />,
209
- }),
210
- createSurface({
211
- id: `${DEBUG_PLUGIN}/halo/devices`,
212
- role: 'article',
213
- filter: (data): data is any => data.subject === Devtools.Halo.Devices,
214
- component: () => <DeviceListPanel />,
215
- }),
216
- createSurface({
217
- id: `${DEBUG_PLUGIN}/halo/keyring`,
218
- role: 'article',
219
- filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
220
- component: () => <KeyringPanel />,
221
- }),
222
- createSurface({
223
- id: `${DEBUG_PLUGIN}/halo/credentials`,
224
- role: 'article',
225
- filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
226
- component: () => {
227
- const space = useCurrentSpace();
228
- return <CredentialsPanel space={space} />;
229
- },
230
- }),
231
- createSurface({
232
- id: `${DEBUG_PLUGIN}/echo/spaces`,
233
- role: 'article',
234
- filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
235
- component: () => {
236
- const { dispatchPromise: dispatch } = useIntentDispatcher();
237
- const handleSelect = useCallback(
238
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Space] })),
239
- [dispatch],
240
- );
241
- return <SpaceListPanel onSelect={handleSelect} />;
242
- },
243
- }),
244
- createSurface({
245
- id: `${DEBUG_PLUGIN}/echo/space`,
246
- role: 'article',
247
- filter: (data): data is any => data.subject === Devtools.Echo.Space,
248
- component: () => {
249
- const space = useCurrentSpace();
250
- const { dispatchPromise: dispatch } = useIntentDispatcher();
251
- const handleSelect = useCallback(
252
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Feeds] })),
253
- [dispatch],
254
- );
255
- return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
256
- },
257
- }),
258
- createSurface({
259
- id: `${DEBUG_PLUGIN}/echo/feeds`,
260
- role: 'article',
261
- filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
262
- component: () => {
263
- const space = useCurrentSpace();
264
- return <FeedsPanel space={space} />;
265
- },
266
- }),
267
- createSurface({
268
- id: `${DEBUG_PLUGIN}/echo/objects`,
269
- role: 'article',
270
- filter: (data): data is any => data.subject === Devtools.Echo.Objects,
271
- component: () => {
272
- const space = useCurrentSpace();
273
- return <ObjectsPanel space={space} />;
274
- },
275
- }),
276
- createSurface({
277
- id: `${DEBUG_PLUGIN}/echo/schema`,
278
- role: 'article',
279
- filter: (data): data is any => data.subject === Devtools.Echo.Schema,
280
- component: () => {
281
- const space = useCurrentSpace();
282
- return <SchemaPanel space={space} />;
283
- },
284
- }),
285
- createSurface({
286
- id: `${DEBUG_PLUGIN}/echo/automerge`,
287
- role: 'article',
288
- filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
289
- component: () => {
290
- const space = useCurrentSpace();
291
- return <AutomergePanel space={space} />;
292
- },
293
- }),
294
- createSurface({
295
- id: `${DEBUG_PLUGIN}/echo/queues`,
296
- role: 'article',
297
- filter: (data): data is any => data.subject === Devtools.Echo.Queues,
298
- component: () => <QueuesPanel />,
299
- }),
300
- createSurface({
301
- id: `${DEBUG_PLUGIN}/echo/members`,
302
- role: 'article',
303
- filter: (data): data is any => data.subject === Devtools.Echo.Members,
304
- component: () => {
305
- const space = useCurrentSpace();
306
- return <MembersPanel space={space} />;
307
- },
308
- }),
309
- createSurface({
310
- id: `${DEBUG_PLUGIN}/echo/metadata`,
311
- role: 'article',
312
- filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
313
- component: () => <MetadataPanel />,
314
- }),
315
- createSurface({
316
- id: `${DEBUG_PLUGIN}/mesh/signal`,
317
- role: 'article',
318
- filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
319
- component: () => <SignalPanel />,
320
- }),
321
- createSurface({
322
- id: `${DEBUG_PLUGIN}/mesh/swarm`,
323
- role: 'article',
324
- filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
325
- component: () => <SwarmPanel />,
326
- }),
327
- createSurface({
328
- id: `${DEBUG_PLUGIN}/mesh/network`,
329
- role: 'article',
330
- filter: (data): data is any => data.subject === Devtools.Mesh.Network,
331
- component: () => {
332
- const space = useCurrentSpace();
333
- return <NetworkPanel space={space} />;
334
- },
335
- }),
336
- // TODO(wittjosiah): Remove?
337
- // createSurface({
338
- // id: `${DEBUG_PLUGIN}/agent/dashboard`,
339
- // role: 'article',
340
- // filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
341
- // component: () => <DashboardPanel />,
342
- // }),
343
- createSurface({
344
- id: `${DEBUG_PLUGIN}/edge/dashboard`,
345
- role: 'article',
346
- filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
347
- component: () => <EdgeDashboardPanel />,
348
- }),
349
- createSurface({
350
- id: `${DEBUG_PLUGIN}/edge/workflows`,
351
- role: 'article',
352
- filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
353
- component: () => {
354
- const space = useCurrentSpace();
355
- return <WorkflowPanel space={space} />;
356
- },
357
- }),
358
- createSurface({
359
- id: `${DEBUG_PLUGIN}/edge/traces`,
360
- role: 'article',
361
- filter: (data): data is any => data.subject === Devtools.Edge.Traces,
362
- component: () => {
363
- const space = useCurrentSpace();
364
- return <InvocationTraceContainer space={space} detailAxis='block' />;
365
- },
366
- }),
367
- createSurface({
368
- id: `${DEBUG_PLUGIN}/edge/testing`,
369
- role: 'article',
370
- filter: (data): data is any => data.subject === Devtools.Edge.Testing,
371
- component: () => {
372
- const { dispatchPromise: dispatch } = useIntentDispatcher();
373
- const onSpaceCreate = useCallback(
374
- async (space: Space) => {
375
- await space.waitUntilReady();
376
- await dispatch(createIntent(SpaceAction.Migrate, { space }));
377
- await space.db.flush();
378
- },
379
- [dispatch],
380
- );
381
- const onScriptPluginOpen = useCallback(
382
- async (space: Space) => {
383
- await space.waitUntilReady();
384
- const result = await dispatch(
385
- pipe(createIntent(ScriptAction.Create, { space }), chain(SpaceAction.AddObject, { target: space })),
386
- );
387
- log.info('script created', { result });
388
- await dispatch(
389
- createIntent(LayoutAction.Open, { part: 'main', subject: [`${space.id}:${result.data?.object.id}`] }),
390
- );
391
- },
392
- [dispatch],
393
- );
394
- return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
395
- },
396
- }),
397
- ]);
413
+ const feed = space.properties.invocationTraceFeed?.target;
414
+ const feedDXN = feed ? Feed.getQueueUri(feed) : undefined;
415
+ return <InvocationTraceContainer db={space.db} feedDXN={feedDXN} detailAxis='block' />;
416
+ },
417
+ }),
418
+ Surface.create({
419
+ id: 'edge.testing',
420
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Testing),
421
+ component: () => {
422
+ const { invokePromise } = useOperationInvoker();
423
+ const onSpaceCreate = useCallback(
424
+ async (space: Space) => {
425
+ await space.waitUntilReady();
426
+ await invokePromise(SpaceOperation.Migrate, { space });
427
+ await space.db.flush();
428
+ },
429
+ [invokePromise],
430
+ );
431
+ const onScriptPluginOpen = useCallback(
432
+ async (space: Space) => {
433
+ await space.waitUntilReady();
434
+ const createResult = await invokePromise(ScriptOperation.CreateScript, { db: space.db });
435
+ if (createResult.data?.object) {
436
+ await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
437
+ }
438
+ log.info('script created', { result: createResult });
439
+ if (createResult.data?.object) {
440
+ await invokePromise(LayoutOperation.Open, {
441
+ subject: [getObjectPathFromObject(createResult.data.object)],
442
+ });
443
+ }
444
+ },
445
+ [invokePromise],
446
+ );
447
+ return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
448
+ },
449
+ }),
450
+ ]);
451
+ }),
452
+ );