@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,456 +2,441 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
5
+ import * as Effect from 'effect/Effect';
7
6
 
8
- import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
9
- import { Obj } from '@dxos/echo';
10
- import { ATTENDABLE_PATH_SEPARATOR, DECK_COMPANION_TYPE, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
11
- import { ROOT_ID, createExtension, rxFromSignal } from '@dxos/plugin-graph';
12
- import { SPACE_PLUGIN, getActiveSpace } from '@dxos/plugin-space';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities, AppNode, getSpaceIdFromPath } from '@dxos/app-toolkit';
9
+ import { ClientCapabilities } from '@dxos/plugin-client';
10
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
11
+ import { SPACE_TYPE } from '@dxos/plugin-space';
12
+ import { getParentId } from '@dxos/react-ui-attention';
13
13
 
14
- import { DEBUG_PLUGIN } from '../meta';
15
- import { Devtools } from '../types';
14
+ import { meta } from '#meta';
15
+ import { Devtools } from '#types';
16
16
 
17
- const DEVTOOLS_TYPE = 'dxos.org/plugin/debug/devtools';
17
+ const DEVTOOLS_TYPE = `${meta.id}.devtools`;
18
18
 
19
- export default (context: PluginContext) =>
20
- contributes(Capabilities.AppGraphBuilder, [
21
- // Devtools node.
22
- createExtension({
23
- id: 'dxos.org/plugin/debug/devtools',
24
- connector: (node) =>
25
- Rx.make((get) =>
26
- pipe(
27
- get(node),
28
- Option.flatMap((node) =>
29
- node.id === ROOT_ID || node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none(),
30
- ),
31
- Option.map((node) => {
32
- const space = get(rxFromSignal(() => getActiveSpace(context)));
19
+ export default Capability.makeModule(
20
+ Effect.fnUntraced(function* () {
21
+ const extensions = yield* Effect.all([
22
+ GraphBuilder.createExtension({
23
+ id: 'root',
24
+ match: NodeMatcher.whenRoot,
25
+ actions: () =>
26
+ Effect.succeed([
27
+ Node.makeAction({
28
+ id: 'resetData',
29
+ data: () =>
30
+ Effect.sync(() => {
31
+ window.location.href = '/reset.html#continue';
32
+ }),
33
+ properties: {
34
+ label: ['reset-data.label', { ns: meta.id }],
35
+ icon: 'ph--warning--regular',
36
+ },
37
+ }),
38
+ ]),
39
+ }),
33
40
 
34
- return [
35
- {
36
- id: `${Devtools.id}-${node.id}`,
37
- data: null,
38
- type: DEVTOOLS_TYPE,
39
- properties: {
40
- label: ['devtools label', { ns: DEBUG_PLUGIN }],
41
- icon: 'ph--hammer--regular',
42
- disposition: 'pin-end',
43
- position: 'fallback',
44
- },
45
- nodes: [
46
- ...(space && node.type === `${SPACE_PLUGIN}/settings`
47
- ? [
48
- {
49
- id: `debug-${node.id}`,
50
- type: 'dxos.org/plugin/debug/space',
51
- data: { space, type: 'dxos.org/plugin/debug/space' },
52
- properties: {
53
- label: ['debug label', { ns: DEBUG_PLUGIN }],
54
- icon: 'ph--bug--regular',
55
- },
56
- },
57
- ]
58
- : []),
59
- {
60
- id: `${Devtools.Client.id}-${node.id}`,
61
- data: null,
62
- type: DEVTOOLS_TYPE,
63
- properties: {
64
- label: ['client label', { ns: DEBUG_PLUGIN }],
65
- icon: 'ph--users--regular',
66
- },
67
- nodes: [
68
- {
69
- id: `${Devtools.Client.Config}-${node.id}`,
70
- data: Devtools.Client.Config,
71
- type: DEVTOOLS_TYPE,
41
+ GraphBuilder.createExtension({
42
+ id: 'devtools',
43
+ match: NodeMatcher.whenAny(NodeMatcher.whenRoot, NodeMatcher.whenNodeType(SPACE_TYPE)),
44
+ connector: (node, get) =>
45
+ Effect.gen(function* () {
46
+ const client = yield* Capability.get(ClientCapabilities.Client);
47
+ const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];
48
+ const layout = layoutAtom ? get(layoutAtom) : undefined;
49
+ const spaceId = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : undefined;
50
+ const space = spaceId ? client.spaces.get(spaceId) : undefined;
51
+ const [graph] = get(yield* Capability.atom(AppCapabilities.AppGraph));
52
+
53
+ return [
54
+ Node.make({
55
+ id: Devtools.id,
56
+ data: null,
57
+ type: DEVTOOLS_TYPE,
58
+ properties: {
59
+ label: ['devtools.label', { ns: meta.id }],
60
+ icon: 'ph--hammer--regular',
61
+ disposition: 'pin-end',
62
+ position: 'last',
63
+ },
64
+ nodes: [
65
+ Node.make({
66
+ id: 'appGraph',
67
+ type: `${meta.id}.app-graph`,
68
+ data: { graph: graph?.graph, root: node.id === Node.RootId ? node.id : getParentId(node.id) },
69
+ properties: {
70
+ label: ['debug-app-graph.label', { ns: meta.id }],
71
+ icon: 'ph--graph--regular',
72
+ },
73
+ }),
74
+ Node.make({
75
+ id: 'toolsExplorer',
76
+ data: Devtools.ToolsExplorer,
77
+ type: DEVTOOLS_TYPE,
78
+ properties: {
79
+ label: ['debug-tools-explorer.label', { ns: meta.id }],
80
+ icon: 'ph--toolbox--regular',
81
+ },
82
+ }),
83
+ ...(space && node.type === SPACE_TYPE
84
+ ? [
85
+ Node.make({
86
+ id: 'debug',
87
+ type: `${meta.id}.space`,
88
+ data: { space, type: `${meta.id}.space` },
72
89
  properties: {
73
- label: ['config label', { ns: DEBUG_PLUGIN }],
74
- icon: 'ph--gear--regular',
90
+ label: ['generate-objects.label', { ns: meta.id }],
91
+ icon: 'ph--dice-five--regular',
75
92
  },
93
+ }),
94
+ ]
95
+ : []),
96
+ Node.make({
97
+ id: Devtools.Client.id,
98
+ data: null,
99
+ type: DEVTOOLS_TYPE,
100
+ properties: {
101
+ label: ['client.label', { ns: meta.id }],
102
+ icon: 'ph--users--regular',
103
+ },
104
+ nodes: [
105
+ Node.make({
106
+ id: Devtools.Client.Config,
107
+ data: Devtools.Client.Config,
108
+ type: DEVTOOLS_TYPE,
109
+ properties: {
110
+ label: ['config.label', { ns: meta.id }],
111
+ icon: 'ph--gear--regular',
76
112
  },
77
- {
78
- id: `${Devtools.Client.Storage}-${node.id}`,
79
- data: Devtools.Client.Storage,
80
- type: DEVTOOLS_TYPE,
81
- properties: {
82
- label: ['storage label', { ns: DEBUG_PLUGIN }],
83
- icon: 'ph--hard-drives--regular',
84
- },
113
+ }),
114
+ Node.make({
115
+ id: Devtools.Client.Storage,
116
+ data: Devtools.Client.Storage,
117
+ type: DEVTOOLS_TYPE,
118
+ properties: {
119
+ label: ['storage.label', { ns: meta.id }],
120
+ icon: 'ph--hard-drives--regular',
85
121
  },
86
- {
87
- id: `${Devtools.Client.Logs}-${node.id}`,
88
- data: Devtools.Client.Logs,
89
- type: DEVTOOLS_TYPE,
90
- properties: {
91
- label: ['logs label', { ns: DEBUG_PLUGIN }],
92
- icon: 'ph--file-text--regular',
93
- },
122
+ }),
123
+ Node.make({
124
+ id: Devtools.Client.Sqlite,
125
+ data: Devtools.Client.Sqlite,
126
+ type: DEVTOOLS_TYPE,
127
+ properties: {
128
+ label: ['sqlite.label', { ns: meta.id }],
129
+ icon: 'ph--database--regular',
94
130
  },
95
- {
96
- id: `${Devtools.Client.Diagnostics}-${node.id}`,
97
- data: Devtools.Client.Diagnostics,
98
- type: DEVTOOLS_TYPE,
99
- properties: {
100
- label: ['diagnostics label', { ns: DEBUG_PLUGIN }],
101
- icon: 'ph--chart-line--regular',
102
- },
131
+ }),
132
+ Node.make({
133
+ id: Devtools.Client.Logs,
134
+ data: Devtools.Client.Logs,
135
+ type: DEVTOOLS_TYPE,
136
+ properties: {
137
+ label: ['logs.label', { ns: meta.id }],
138
+ icon: 'ph--file-text--regular',
103
139
  },
104
- {
105
- id: `${Devtools.Client.Tracing}-${node.id}`,
106
- data: Devtools.Client.Tracing,
107
- type: DEVTOOLS_TYPE,
108
- properties: {
109
- label: ['tracing label', { ns: DEBUG_PLUGIN }],
110
- icon: 'ph--fire--regular',
111
- },
140
+ }),
141
+ Node.make({
142
+ id: Devtools.Client.Diagnostics,
143
+ data: Devtools.Client.Diagnostics,
144
+ type: DEVTOOLS_TYPE,
145
+ properties: {
146
+ label: ['diagnostics.label', { ns: meta.id }],
147
+ icon: 'ph--chart-line--regular',
112
148
  },
113
- ],
149
+ }),
150
+ ],
151
+ }),
152
+ Node.make({
153
+ id: Devtools.Halo.id,
154
+ data: null,
155
+ type: DEVTOOLS_TYPE,
156
+ properties: {
157
+ label: ['halo.label', { ns: meta.id }],
158
+ icon: 'ph--identification-badge--regular',
114
159
  },
115
- {
116
- id: `${Devtools.Halo.id}-${node.id}`,
117
- data: null,
118
- type: DEVTOOLS_TYPE,
119
- properties: {
120
- label: ['halo label', { ns: DEBUG_PLUGIN }],
121
- icon: 'ph--identification-badge--regular',
122
- },
123
- nodes: [
124
- {
125
- id: `${Devtools.Halo.Identity}-${node.id}`,
126
- data: Devtools.Halo.Identity,
127
- type: DEVTOOLS_TYPE,
128
- properties: {
129
- label: ['identity label', { ns: DEBUG_PLUGIN }],
130
- icon: 'ph--identification-badge--regular',
131
- },
160
+ nodes: [
161
+ Node.make({
162
+ id: Devtools.Halo.Identity,
163
+ data: Devtools.Halo.Identity,
164
+ type: DEVTOOLS_TYPE,
165
+ properties: {
166
+ label: ['identity.label', { ns: meta.id }],
167
+ icon: 'ph--identification-badge--regular',
132
168
  },
133
- {
134
- id: `${Devtools.Halo.Devices}-${node.id}`,
135
- data: Devtools.Halo.Devices,
136
- type: DEVTOOLS_TYPE,
137
- properties: {
138
- label: ['devices label', { ns: DEBUG_PLUGIN }],
139
- icon: 'ph--devices--regular',
140
- },
169
+ }),
170
+ Node.make({
171
+ id: Devtools.Halo.Devices,
172
+ data: Devtools.Halo.Devices,
173
+ type: DEVTOOLS_TYPE,
174
+ properties: {
175
+ label: ['devices.label', { ns: meta.id }],
176
+ icon: 'ph--devices--regular',
141
177
  },
142
- {
143
- id: `${Devtools.Halo.Keyring}-${node.id}`,
144
- data: Devtools.Halo.Keyring,
145
- type: DEVTOOLS_TYPE,
146
- properties: {
147
- label: ['keyring label', { ns: DEBUG_PLUGIN }],
148
- icon: 'ph--key--regular',
149
- },
178
+ }),
179
+ Node.make({
180
+ id: Devtools.Halo.Keyring,
181
+ data: Devtools.Halo.Keyring,
182
+ type: DEVTOOLS_TYPE,
183
+ properties: {
184
+ label: ['keyring.label', { ns: meta.id }],
185
+ icon: 'ph--key--regular',
150
186
  },
151
- {
152
- id: `${Devtools.Halo.Credentials}-${node.id}`,
153
- data: Devtools.Halo.Credentials,
154
- type: DEVTOOLS_TYPE,
155
- properties: {
156
- label: ['credentials label', { ns: DEBUG_PLUGIN }],
157
- icon: 'ph--credit-card--regular',
158
- },
187
+ }),
188
+ Node.make({
189
+ id: Devtools.Halo.Credentials,
190
+ data: Devtools.Halo.Credentials,
191
+ type: DEVTOOLS_TYPE,
192
+ properties: {
193
+ label: ['credentials.label', { ns: meta.id }],
194
+ icon: 'ph--credit-card--regular',
159
195
  },
160
- ],
196
+ }),
197
+ ],
198
+ }),
199
+ Node.make({
200
+ id: Devtools.Echo.id,
201
+ data: null,
202
+ type: DEVTOOLS_TYPE,
203
+ properties: {
204
+ label: ['echo.label', { ns: meta.id }],
205
+ icon: 'ph--database--regular',
161
206
  },
162
- {
163
- id: `${Devtools.Echo.id}-${node.id}`,
164
- data: null,
165
- type: DEVTOOLS_TYPE,
166
- properties: {
167
- label: ['echo label', { ns: DEBUG_PLUGIN }],
168
- icon: 'ph--database--regular',
169
- },
170
- nodes: [
171
- {
172
- id: `${Devtools.Echo.Spaces}-${node.id}`,
173
- data: Devtools.Echo.Spaces,
174
- type: DEVTOOLS_TYPE,
175
- properties: {
176
- label: ['spaces label', { ns: DEBUG_PLUGIN }],
177
- icon: 'ph--graph--regular',
178
- },
207
+ nodes: [
208
+ Node.make({
209
+ id: Devtools.Echo.Spaces,
210
+ data: Devtools.Echo.Spaces,
211
+ type: DEVTOOLS_TYPE,
212
+ properties: {
213
+ label: ['spaces.label', { ns: meta.id }],
214
+ icon: 'ph--graph--regular',
179
215
  },
180
- {
181
- id: `${Devtools.Echo.Space}-${node.id}`,
182
- data: Devtools.Echo.Space,
183
- type: DEVTOOLS_TYPE,
184
- properties: {
185
- label: ['space label', { ns: DEBUG_PLUGIN }],
186
- icon: 'ph--planet--regular',
187
- },
216
+ }),
217
+ Node.make({
218
+ id: Devtools.Echo.Space,
219
+ data: Devtools.Echo.Space,
220
+ type: DEVTOOLS_TYPE,
221
+ properties: {
222
+ label: ['space.label', { ns: meta.id }],
223
+ icon: 'ph--planet--regular',
188
224
  },
189
- {
190
- id: `${Devtools.Echo.Feeds}-${node.id}`,
191
- data: Devtools.Echo.Feeds,
192
- type: DEVTOOLS_TYPE,
193
- properties: {
194
- label: ['feeds label', { ns: DEBUG_PLUGIN }],
195
- icon: 'ph--list-bullets--regular',
196
- },
225
+ }),
226
+ Node.make({
227
+ id: Devtools.Echo.Feeds,
228
+ data: Devtools.Echo.Feeds,
229
+ type: DEVTOOLS_TYPE,
230
+ properties: {
231
+ label: ['feeds.label', { ns: meta.id }],
232
+ icon: 'ph--list-bullets--regular',
197
233
  },
198
- {
199
- id: `${Devtools.Echo.Objects}-${node.id}`,
200
- data: Devtools.Echo.Objects,
201
- type: DEVTOOLS_TYPE,
202
- properties: {
203
- label: ['objects label', { ns: DEBUG_PLUGIN }],
204
- icon: 'ph--cube--regular',
205
- },
234
+ }),
235
+ Node.make({
236
+ id: Devtools.Echo.Objects,
237
+ data: Devtools.Echo.Objects,
238
+ type: DEVTOOLS_TYPE,
239
+ properties: {
240
+ label: ['objects.label', { ns: meta.id }],
241
+ icon: 'ph--cube--regular',
206
242
  },
207
- {
208
- id: `${Devtools.Echo.Schema}-${node.id}`,
209
- data: Devtools.Echo.Schema,
210
- type: DEVTOOLS_TYPE,
211
- properties: {
212
- label: ['schema label', { ns: DEBUG_PLUGIN }],
213
- icon: 'ph--database--regular',
214
- },
243
+ }),
244
+ Node.make({
245
+ id: Devtools.Echo.Schema,
246
+ data: Devtools.Echo.Schema,
247
+ type: DEVTOOLS_TYPE,
248
+ properties: {
249
+ label: ['schema.label', { ns: meta.id }],
250
+ icon: 'ph--database--regular',
215
251
  },
216
- {
217
- id: `${Devtools.Echo.Automerge}-${node.id}`,
218
- data: Devtools.Echo.Automerge,
219
- type: DEVTOOLS_TYPE,
220
- properties: {
221
- label: ['automerge label', { ns: DEBUG_PLUGIN }],
222
- icon: 'ph--gear-six--regular',
223
- },
252
+ }),
253
+ Node.make({
254
+ id: Devtools.Echo.Registry,
255
+ data: Devtools.Echo.Registry,
256
+ type: DEVTOOLS_TYPE,
257
+ properties: {
258
+ label: ['registry.label', { ns: meta.id }],
259
+ icon: 'ph--books--regular',
224
260
  },
225
- {
226
- id: `${Devtools.Echo.Queues}-${node.id}`,
227
- data: Devtools.Echo.Queues,
228
- type: DEVTOOLS_TYPE,
229
- properties: {
230
- label: ['queues label', { ns: DEBUG_PLUGIN }],
231
- icon: 'ph--queue--regular',
232
- },
261
+ }),
262
+ Node.make({
263
+ id: Devtools.Echo.Automerge,
264
+ data: Devtools.Echo.Automerge,
265
+ type: DEVTOOLS_TYPE,
266
+ properties: {
267
+ label: ['automerge.label', { ns: meta.id }],
268
+ icon: 'ph--gear-six--regular',
233
269
  },
234
- {
235
- id: `${Devtools.Echo.Members}-${node.id}`,
236
- data: Devtools.Echo.Members,
237
- type: DEVTOOLS_TYPE,
238
- properties: {
239
- label: ['members label', { ns: DEBUG_PLUGIN }],
240
- icon: 'ph--users--regular',
241
- },
270
+ }),
271
+ Node.make({
272
+ id: Devtools.Echo.Queues,
273
+ data: Devtools.Echo.Queues,
274
+ type: DEVTOOLS_TYPE,
275
+ properties: {
276
+ label: ['queues.label', { ns: meta.id }],
277
+ icon: 'ph--queue--regular',
242
278
  },
243
- {
244
- id: `${Devtools.Echo.Metadata}-${node.id}`,
245
- data: Devtools.Echo.Metadata,
246
- type: DEVTOOLS_TYPE,
247
- properties: {
248
- label: ['metadata label', { ns: DEBUG_PLUGIN }],
249
- icon: 'ph--hard-drive--regular',
250
- },
279
+ }),
280
+ Node.make({
281
+ id: Devtools.Echo.Members,
282
+ data: Devtools.Echo.Members,
283
+ type: DEVTOOLS_TYPE,
284
+ properties: {
285
+ label: ['members.label', { ns: meta.id }],
286
+ icon: 'ph--users--regular',
287
+ },
288
+ }),
289
+ Node.make({
290
+ id: Devtools.Echo.Metadata,
291
+ data: Devtools.Echo.Metadata,
292
+ type: DEVTOOLS_TYPE,
293
+ properties: {
294
+ label: ['metadata.label', { ns: meta.id }],
295
+ icon: 'ph--hard-drive--regular',
251
296
  },
252
- ],
297
+ }),
298
+ ],
299
+ }),
300
+ Node.make({
301
+ id: Devtools.Mesh.id,
302
+ data: null,
303
+ type: DEVTOOLS_TYPE,
304
+ properties: {
305
+ label: ['mesh.label', { ns: meta.id }],
306
+ icon: 'ph--graph--regular',
253
307
  },
254
- {
255
- id: `${Devtools.Mesh.id}-${node.id}`,
256
- data: null,
257
- type: DEVTOOLS_TYPE,
258
- properties: {
259
- label: ['mesh label', { ns: DEBUG_PLUGIN }],
260
- icon: 'ph--graph--regular',
261
- },
262
- nodes: [
263
- {
264
- id: `${Devtools.Mesh.Signal}-${node.id}`,
265
- data: Devtools.Mesh.Signal,
266
- type: DEVTOOLS_TYPE,
267
- properties: {
268
- label: ['signal label', { ns: DEBUG_PLUGIN }],
269
- icon: 'ph--wifi-high--regular',
270
- },
308
+ nodes: [
309
+ Node.make({
310
+ id: Devtools.Mesh.Signal,
311
+ data: Devtools.Mesh.Signal,
312
+ type: DEVTOOLS_TYPE,
313
+ properties: {
314
+ label: ['signal.label', { ns: meta.id }],
315
+ icon: 'ph--wifi-high--regular',
271
316
  },
272
- {
273
- id: `${Devtools.Mesh.Swarm}-${node.id}`,
274
- data: Devtools.Mesh.Swarm,
275
- type: DEVTOOLS_TYPE,
276
- properties: {
277
- label: ['swarm label', { ns: DEBUG_PLUGIN }],
278
- icon: 'ph--users-three--regular',
279
- },
317
+ }),
318
+ Node.make({
319
+ id: Devtools.Mesh.Swarm,
320
+ data: Devtools.Mesh.Swarm,
321
+ type: DEVTOOLS_TYPE,
322
+ properties: {
323
+ label: ['swarm.label', { ns: meta.id }],
324
+ icon: 'ph--users-three--regular',
280
325
  },
281
- {
282
- id: `${Devtools.Mesh.Network}-${node.id}`,
283
- data: Devtools.Mesh.Network,
284
- type: DEVTOOLS_TYPE,
285
- properties: {
286
- label: ['network label', { ns: DEBUG_PLUGIN }],
287
- icon: 'ph--polygon--regular',
288
- },
326
+ }),
327
+ Node.make({
328
+ id: Devtools.Mesh.Network,
329
+ data: Devtools.Mesh.Network,
330
+ type: DEVTOOLS_TYPE,
331
+ properties: {
332
+ label: ['network.label', { ns: meta.id }],
333
+ icon: 'ph--polygon--regular',
289
334
  },
290
- ],
335
+ }),
336
+ ],
337
+ }),
338
+ Node.make({
339
+ id: Devtools.Edge.id,
340
+ data: null,
341
+ type: DEVTOOLS_TYPE,
342
+ properties: {
343
+ label: ['edge.label', { ns: meta.id }],
344
+ icon: 'ph--cloud--regular',
291
345
  },
292
- // TODO(wittjosiah): Remove?
293
- // {
294
- // id: `${prefix}-${Devtools.Agent.id}`,
295
- // data: null,
296
- // type: DEVTOOLS_TYPE,
297
- // properties: {
298
- // label: ['agent label', { ns: DEBUG_PLUGIN }],
299
- // icon: 'ph--robot--regular',
300
- // },
301
- // nodes: [
302
- // {
303
- // id: `${prefix}-${Devtools.Agent.Dashboard}`,
304
- // data: Devtools.Agent.Dashboard,
305
- // type: DEVTOOLS_TYPE,
306
- // properties: {
307
- // label: ['dashboard label', { ns: DEBUG_PLUGIN }],
308
- // icon: 'ph--computer-tower--regular',
309
- // },
310
- // },
311
- // ],
312
- // },
313
- {
314
- id: `${Devtools.Edge.id}-${node.id}`,
315
- data: null,
316
- type: DEVTOOLS_TYPE,
317
- properties: {
318
- label: ['edge label', { ns: DEBUG_PLUGIN }],
319
- icon: 'ph--cloud--regular',
320
- },
321
- nodes: [
322
- {
323
- id: `${Devtools.Edge.Dashboard}-${node.id}`,
324
- data: Devtools.Edge.Dashboard,
325
- type: DEVTOOLS_TYPE,
326
- properties: {
327
- label: ['dashboard label', { ns: DEBUG_PLUGIN }],
328
- icon: 'ph--computer-tower--regular',
329
- },
346
+ nodes: [
347
+ Node.make({
348
+ id: Devtools.Edge.Dashboard,
349
+ data: Devtools.Edge.Dashboard,
350
+ type: DEVTOOLS_TYPE,
351
+ properties: {
352
+ label: ['dashboard.label', { ns: meta.id }],
353
+ icon: 'ph--computer-tower--regular',
330
354
  },
331
- {
332
- id: `${Devtools.Edge.Workflows}-${node.id}`,
333
- data: Devtools.Edge.Workflows,
334
- type: DEVTOOLS_TYPE,
335
- properties: {
336
- label: ['workflows label', { ns: DEBUG_PLUGIN }],
337
- icon: 'ph--function--regular',
338
- },
355
+ }),
356
+ Node.make({
357
+ id: Devtools.Edge.Workflows,
358
+ data: Devtools.Edge.Workflows,
359
+ type: DEVTOOLS_TYPE,
360
+ properties: {
361
+ label: ['workflows.label', { ns: meta.id }],
362
+ icon: 'ph--function--regular',
339
363
  },
340
- {
341
- id: `${Devtools.Edge.Traces}-${node.id}`,
342
- data: Devtools.Edge.Traces,
343
- type: DEVTOOLS_TYPE,
344
- properties: {
345
- label: ['traces label', { ns: DEBUG_PLUGIN }],
346
- icon: 'ph--line-segments--regular',
347
- },
364
+ }),
365
+ Node.make({
366
+ id: Devtools.Edge.Traces,
367
+ data: Devtools.Edge.Traces,
368
+ type: DEVTOOLS_TYPE,
369
+ properties: {
370
+ label: ['traces.label', { ns: meta.id }],
371
+ icon: 'ph--line-segments--regular',
348
372
  },
349
- {
350
- id: `${Devtools.Edge.Testing}-${node.id}`,
351
- data: Devtools.Edge.Testing,
352
- type: DEVTOOLS_TYPE,
353
- properties: {
354
- label: ['testing label', { ns: DEBUG_PLUGIN }],
355
- icon: 'ph--flask--regular',
356
- },
373
+ }),
374
+ Node.make({
375
+ id: Devtools.Edge.Testing,
376
+ data: Devtools.Edge.Testing,
377
+ type: DEVTOOLS_TYPE,
378
+ properties: {
379
+ label: ['testing.label', { ns: meta.id }],
380
+ icon: 'ph--flask--regular',
357
381
  },
358
- ],
359
- },
360
- ],
361
- },
362
- ];
363
- }),
364
- Option.getOrElse(() => []),
365
- ),
366
- ),
367
- }),
382
+ }),
383
+ ],
384
+ }),
385
+ ],
386
+ }),
387
+ ];
388
+ }),
389
+ }),
368
390
 
369
- // Debug node.
370
- createExtension({
371
- id: 'dxos.org/plugin/debug/debug',
372
- connector: (node) =>
373
- Rx.make((get) =>
374
- pipe(
375
- get(node),
376
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
377
- Option.flatMap(() => {
378
- const [graph] = get(context.capabilities(Capabilities.AppGraph));
379
- return graph ? Option.some(graph) : Option.none();
391
+ // Debug object companion.
392
+ GraphBuilder.createExtension({
393
+ id: 'debugObject',
394
+ match: NodeMatcher.whenEchoObject,
395
+ connector: () =>
396
+ Effect.succeed([
397
+ AppNode.makeCompanion({
398
+ id: 'debug',
399
+ label: ['debug.label', { ns: meta.id }],
400
+ icon: 'ph--bug--regular',
401
+ data: 'debug',
402
+ position: 'last',
380
403
  }),
381
- Option.flatMap((graph) => {
382
- // TODO(wittjosiah): Plank is currently blank. Remove?
383
- // const settings = context
384
- // .requestCapabilities(Capabilities.SettingsStore)[0]
385
- // ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
386
- // return !!settings?.debug && node.id === 'root';
387
- return Option.none();
404
+ ]),
405
+ }),
406
+
407
+ // Devtools deck companion.
408
+ GraphBuilder.createExtension({
409
+ id: 'devtoolsOverview',
410
+ match: NodeMatcher.whenRoot,
411
+ connector: () =>
412
+ Effect.succeed([
413
+ AppNode.makeDeckCompanion({
414
+ id: 'devtools',
415
+ label: ['devtools-overview.label', { ns: meta.id }],
416
+ icon: 'ph--equalizer--regular',
417
+ data: 'devtools' as const,
418
+ position: 'last',
388
419
  }),
389
- Option.map((graph) => [
390
- {
391
- id: 'dxos.org/plugin/debug/debug',
392
- type: 'dxos.org/plugin/debug/debug',
393
- data: { graph },
394
- properties: {
395
- label: ['debug label', { ns: DEBUG_PLUGIN }],
396
- disposition: 'navigation',
397
- icon: 'ph--bug--regular',
398
- },
399
- },
400
- ]),
401
- Option.getOrElse(() => []),
402
- ),
403
- ),
404
- }),
420
+ ]),
421
+ }),
405
422
 
406
- // Debug object companion.
407
- createExtension({
408
- id: `${DEBUG_PLUGIN}/debug-object`,
409
- connector: (node) =>
410
- Rx.make((get) =>
411
- pipe(
412
- get(node),
413
- Option.flatMap((node) => (Obj.isObject(node.data) ? Option.some(node) : Option.none())),
414
- Option.map((node) => [
415
- {
416
- id: [node.id, 'debug'].join(ATTENDABLE_PATH_SEPARATOR),
417
- type: PLANK_COMPANION_TYPE,
418
- data: 'debug',
419
- properties: {
420
- label: ['debug label', { ns: DEBUG_PLUGIN }],
421
- icon: 'ph--bug--regular',
422
- disposition: 'hidden',
423
- position: 'fallback',
424
- },
425
- },
426
- ]),
427
- Option.getOrElse(() => []),
428
- ),
429
- ),
430
- }),
423
+ // Object explorer.
424
+ GraphBuilder.createExtension({
425
+ id: 'spaceObjects',
426
+ match: NodeMatcher.whenRoot,
427
+ connector: () =>
428
+ Effect.succeed([
429
+ AppNode.makeDeckCompanion({
430
+ id: 'spaceObjects',
431
+ label: ['space-objects.label', { ns: meta.id }],
432
+ icon: 'ph--cube--regular',
433
+ data: 'space-objects' as const,
434
+ position: 'last',
435
+ }),
436
+ ]),
437
+ }),
438
+ ]);
431
439
 
432
- // Devtools deck companion.
433
- createExtension({
434
- id: `${DEBUG_PLUGIN}/devtools-overview`,
435
- connector: (node) =>
436
- Rx.make((get) =>
437
- pipe(
438
- get(node),
439
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
440
- Option.map((node) => [
441
- {
442
- id: [node.id, 'devtools'].join(ATTENDABLE_PATH_SEPARATOR),
443
- type: DECK_COMPANION_TYPE,
444
- data: null,
445
- properties: {
446
- label: ['devtools overview label', { ns: DEBUG_PLUGIN }],
447
- icon: 'ph--equalizer--regular',
448
- disposition: 'hidden',
449
- position: 'fallback',
450
- },
451
- },
452
- ]),
453
- Option.getOrElse(() => []),
454
- ),
455
- ),
456
- }),
457
- ]);
440
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
441
+ }),
442
+ );