@dxos/plugin-debug 0.8.3 → 0.8.4-main.1c7ec43d41

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 (169) hide show
  1. package/dist/lib/browser/index.mjs +19 -123
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +81 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/types/src/DebugPlugin.d.ts +4 -1
  7. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  8. package/dist/types/src/DebugPlugin.node.d.ts +5 -0
  9. package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
  10. package/dist/types/src/DebugPlugin.test.d.ts +2 -0
  11. package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
  12. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  13. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  14. package/dist/types/src/capabilities/index.d.ts +8 -5
  15. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  16. package/dist/types/src/capabilities/react-context.d.ts +4 -2
  17. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/react-surface.d.ts +7 -2
  19. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/settings.d.ts +5 -2
  21. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  22. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
  23. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
  24. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +99 -0
  25. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
  26. package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
  27. package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
  28. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
  29. package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
  30. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
  31. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +6 -4
  32. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  33. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  34. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  35. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  36. package/dist/types/src/components/SpaceGenerator/presets.d.ts +5 -8
  37. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  38. package/dist/types/src/components/index.d.ts +4 -9
  39. package/dist/types/src/components/index.d.ts.map +1 -1
  40. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  41. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  42. package/dist/types/src/containers/DebugGraph/index.d.ts +2 -0
  43. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  44. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -0
  45. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  46. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +2 -0
  47. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  48. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +5 -0
  49. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  50. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +2 -0
  51. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  52. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  53. package/dist/types/src/containers/DebugStatus/index.d.ts +2 -0
  54. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  55. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  56. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  57. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +2 -0
  58. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  59. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +11 -0
  60. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  61. package/dist/types/src/containers/SpaceGenerator/index.d.ts +2 -0
  62. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  63. package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
  64. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  65. package/dist/types/src/containers/Wireframe/index.d.ts +2 -0
  66. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  67. package/dist/types/src/containers/index.d.ts +9 -0
  68. package/dist/types/src/containers/index.d.ts.map +1 -0
  69. package/dist/types/src/index.d.ts +3 -1
  70. package/dist/types/src/index.d.ts.map +1 -1
  71. package/dist/types/src/meta.d.ts +2 -3
  72. package/dist/types/src/meta.d.ts.map +1 -1
  73. package/dist/types/src/translations.d.ts +83 -60
  74. package/dist/types/src/translations.d.ts.map +1 -1
  75. package/dist/types/src/types/Settings.d.ts +8 -0
  76. package/dist/types/src/types/Settings.d.ts.map +1 -0
  77. package/dist/types/src/types/index.d.ts +69 -0
  78. package/dist/types/src/types/index.d.ts.map +1 -0
  79. package/dist/types/tsconfig.tsbuildinfo +1 -1
  80. package/package.json +99 -73
  81. package/src/DebugPlugin.node.ts +18 -0
  82. package/src/DebugPlugin.test.ts +29 -0
  83. package/src/DebugPlugin.tsx +30 -37
  84. package/src/capabilities/app-graph-builder.ts +361 -413
  85. package/src/capabilities/index.ts +5 -5
  86. package/src/capabilities/react-context.tsx +16 -7
  87. package/src/capabilities/react-surface.tsx +381 -339
  88. package/src/capabilities/settings.ts +24 -12
  89. package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
  90. package/src/components/DebugSettings/DebugSettings.tsx +262 -0
  91. package/src/components/DebugSettings/index.ts +5 -0
  92. package/src/components/SchemaTable/index.ts +5 -0
  93. package/src/components/SpaceGenerator/ObjectGenerator.tsx +44 -46
  94. package/src/components/SpaceGenerator/draw-util.ts +13 -13
  95. package/src/components/SpaceGenerator/index.ts +2 -3
  96. package/src/components/SpaceGenerator/presets.ts +527 -263
  97. package/src/components/index.ts +4 -8
  98. package/src/containers/DebugGraph/DebugGraph.tsx +14 -0
  99. package/src/containers/DebugGraph/index.ts +5 -0
  100. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
  101. package/src/containers/DebugObjectPanel/index.ts +5 -0
  102. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
  103. package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
  104. package/src/{components → containers/DebugStatus}/DebugStatus.tsx +43 -21
  105. package/src/containers/DebugStatus/index.ts +5 -0
  106. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
  107. package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
  108. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +126 -0
  109. package/src/containers/SpaceGenerator/index.ts +5 -0
  110. package/src/{components → containers/Wireframe}/Wireframe.tsx +8 -12
  111. package/src/containers/Wireframe/index.ts +5 -0
  112. package/src/containers/index.ts +13 -0
  113. package/src/index.ts +7 -1
  114. package/src/meta.ts +8 -7
  115. package/src/translations.ts +80 -59
  116. package/src/types/Settings.ts +16 -0
  117. package/src/{types.ts → types/index.ts} +20 -11
  118. package/dist/lib/browser/DebugApp-WSEJPCKY.mjs +0 -225
  119. package/dist/lib/browser/DebugApp-WSEJPCKY.mjs.map +0 -7
  120. package/dist/lib/browser/DevtoolsOverviewContainer-IIIWO77Q.mjs +0 -25
  121. package/dist/lib/browser/DevtoolsOverviewContainer-IIIWO77Q.mjs.map +0 -7
  122. package/dist/lib/browser/SpaceGenerator-VB6IB2LL.mjs +0 -1238
  123. package/dist/lib/browser/SpaceGenerator-VB6IB2LL.mjs.map +0 -7
  124. package/dist/lib/browser/app-graph-builder-6HHJMKVU.mjs +0 -597
  125. package/dist/lib/browser/app-graph-builder-6HHJMKVU.mjs.map +0 -7
  126. package/dist/lib/browser/chunk-47JOZTT2.mjs +0 -18
  127. package/dist/lib/browser/chunk-47JOZTT2.mjs.map +0 -7
  128. package/dist/lib/browser/chunk-KS3YBEL7.mjs +0 -68
  129. package/dist/lib/browser/chunk-KS3YBEL7.mjs.map +0 -7
  130. package/dist/lib/browser/react-context-ZQRD2WG2.mjs +0 -16
  131. package/dist/lib/browser/react-context-ZQRD2WG2.mjs.map +0 -7
  132. package/dist/lib/browser/react-surface-UI6OK73H.mjs +0 -768
  133. package/dist/lib/browser/react-surface-UI6OK73H.mjs.map +0 -7
  134. package/dist/lib/browser/settings-SXQWSIM4.mjs +0 -22
  135. package/dist/lib/browser/settings-SXQWSIM4.mjs.map +0 -7
  136. package/dist/types/src/components/Container.d.ts +0 -5
  137. package/dist/types/src/components/Container.d.ts.map +0 -1
  138. package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
  139. package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
  140. package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
  141. package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
  142. package/dist/types/src/components/DebugApp/index.d.ts +0 -3
  143. package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
  144. package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
  145. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  146. package/dist/types/src/components/DebugSettings.d.ts +0 -6
  147. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  148. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  149. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  150. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  151. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
  152. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
  153. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -6
  154. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  155. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  156. package/dist/types/src/types.d.ts +0 -63
  157. package/dist/types/src/types.d.ts.map +0 -1
  158. package/src/components/Container.tsx +0 -15
  159. package/src/components/DebugApp/DebugApp.tsx +0 -77
  160. package/src/components/DebugApp/Tree.tsx +0 -103
  161. package/src/components/DebugApp/index.ts +0 -7
  162. package/src/components/DebugObjectPanel.tsx +0 -35
  163. package/src/components/DebugSettings.tsx +0 -151
  164. package/src/components/DevtoolsOverviewContainer.tsx +0 -20
  165. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
  166. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -179
  167. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  168. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  169. /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
@@ -2,456 +2,404 @@
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 { contributes, Capabilities, type PluginContext } 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 { createExtension, ROOT_ID, rxFromSignal } from '@dxos/plugin-graph';
12
- import { getActiveSpace, SPACE_PLUGIN } 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/types';
10
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
11
+ import { SPACE_TYPE } from '@dxos/plugin-space/types';
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: 'devtools',
24
+ match: NodeMatcher.whenAny(NodeMatcher.whenRoot, NodeMatcher.whenNodeType(SPACE_TYPE)),
25
+ connector: (node, get) =>
26
+ Effect.gen(function* () {
27
+ const client = yield* Capability.get(ClientCapabilities.Client);
28
+ const layoutAtom = get(yield* Capability.atom(AppCapabilities.Layout))[0];
29
+ const layout = layoutAtom ? get(layoutAtom) : undefined;
30
+ const spaceId = layout?.workspace ? getSpaceIdFromPath(layout.workspace) : undefined;
31
+ const space = spaceId ? client.spaces.get(spaceId) : undefined;
32
+ const [graph] = get(yield* Capability.atom(AppCapabilities.AppGraph));
33
33
 
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,
72
- properties: {
73
- label: ['config label', { ns: DEBUG_PLUGIN }],
74
- icon: 'ph--gear--regular',
75
- },
76
- },
77
- {
78
- id: `${Devtools.Client.Storage}-${node.id}`,
79
- data: Devtools.Client.Storage,
80
- type: DEVTOOLS_TYPE,
34
+ return [
35
+ Node.make({
36
+ id: Devtools.id,
37
+ data: null,
38
+ type: DEVTOOLS_TYPE,
39
+ properties: {
40
+ label: ['devtools.label', { ns: meta.id }],
41
+ icon: 'ph--hammer--regular',
42
+ disposition: 'pin-end',
43
+ position: 'fallback',
44
+ },
45
+ nodes: [
46
+ Node.make({
47
+ id: 'app-graph',
48
+ type: `${meta.id}.app-graph`,
49
+ data: { graph: graph?.graph, root: node.id === Node.RootId ? node.id : getParentId(node.id) },
50
+ properties: {
51
+ label: ['debug-app-graph.label', { ns: meta.id }],
52
+ icon: 'ph--graph--regular',
53
+ },
54
+ }),
55
+ Node.make({
56
+ id: 'tools-explorer',
57
+ data: Devtools.ToolsExplorer,
58
+ type: DEVTOOLS_TYPE,
59
+ properties: {
60
+ label: ['debug-tools-explorer.label', { ns: meta.id }],
61
+ icon: 'ph--toolbox--regular',
62
+ },
63
+ }),
64
+ ...(space && node.type === SPACE_TYPE
65
+ ? [
66
+ Node.make({
67
+ id: 'debug',
68
+ type: `${meta.id}.space`,
69
+ data: { space, type: `${meta.id}.space` },
81
70
  properties: {
82
- label: ['storage label', { ns: DEBUG_PLUGIN }],
83
- icon: 'ph--hard-drives--regular',
71
+ label: ['generate-objects.label', { ns: meta.id }],
72
+ icon: 'ph--dice-five--regular',
84
73
  },
74
+ }),
75
+ ]
76
+ : []),
77
+ Node.make({
78
+ id: Devtools.Client.id,
79
+ data: null,
80
+ type: DEVTOOLS_TYPE,
81
+ properties: {
82
+ label: ['client.label', { ns: meta.id }],
83
+ icon: 'ph--users--regular',
84
+ },
85
+ nodes: [
86
+ Node.make({
87
+ id: Devtools.Client.Config,
88
+ data: Devtools.Client.Config,
89
+ type: DEVTOOLS_TYPE,
90
+ properties: {
91
+ label: ['config.label', { ns: meta.id }],
92
+ icon: 'ph--gear--regular',
85
93
  },
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
- },
94
+ }),
95
+ Node.make({
96
+ id: Devtools.Client.Storage,
97
+ data: Devtools.Client.Storage,
98
+ type: DEVTOOLS_TYPE,
99
+ properties: {
100
+ label: ['storage.label', { ns: meta.id }],
101
+ icon: 'ph--hard-drives--regular',
94
102
  },
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
- },
103
+ }),
104
+ Node.make({
105
+ id: Devtools.Client.Logs,
106
+ data: Devtools.Client.Logs,
107
+ type: DEVTOOLS_TYPE,
108
+ properties: {
109
+ label: ['logs.label', { ns: meta.id }],
110
+ icon: 'ph--file-text--regular',
103
111
  },
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
- },
112
+ }),
113
+ Node.make({
114
+ id: Devtools.Client.Diagnostics,
115
+ data: Devtools.Client.Diagnostics,
116
+ type: DEVTOOLS_TYPE,
117
+ properties: {
118
+ label: ['diagnostics.label', { ns: meta.id }],
119
+ icon: 'ph--chart-line--regular',
112
120
  },
113
- ],
121
+ }),
122
+ ],
123
+ }),
124
+ Node.make({
125
+ id: Devtools.Halo.id,
126
+ data: null,
127
+ type: DEVTOOLS_TYPE,
128
+ properties: {
129
+ label: ['halo.label', { ns: meta.id }],
130
+ icon: 'ph--identification-badge--regular',
114
131
  },
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
- },
132
+ nodes: [
133
+ Node.make({
134
+ id: Devtools.Halo.Identity,
135
+ data: Devtools.Halo.Identity,
136
+ type: DEVTOOLS_TYPE,
137
+ properties: {
138
+ label: ['identity.label', { ns: meta.id }],
139
+ icon: 'ph--identification-badge--regular',
132
140
  },
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
- },
141
+ }),
142
+ Node.make({
143
+ id: Devtools.Halo.Devices,
144
+ data: Devtools.Halo.Devices,
145
+ type: DEVTOOLS_TYPE,
146
+ properties: {
147
+ label: ['devices.label', { ns: meta.id }],
148
+ icon: 'ph--devices--regular',
141
149
  },
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
- },
150
+ }),
151
+ Node.make({
152
+ id: Devtools.Halo.Keyring,
153
+ data: Devtools.Halo.Keyring,
154
+ type: DEVTOOLS_TYPE,
155
+ properties: {
156
+ label: ['keyring.label', { ns: meta.id }],
157
+ icon: 'ph--key--regular',
150
158
  },
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
- },
159
+ }),
160
+ Node.make({
161
+ id: Devtools.Halo.Credentials,
162
+ data: Devtools.Halo.Credentials,
163
+ type: DEVTOOLS_TYPE,
164
+ properties: {
165
+ label: ['credentials.label', { ns: meta.id }],
166
+ icon: 'ph--credit-card--regular',
159
167
  },
160
- ],
168
+ }),
169
+ ],
170
+ }),
171
+ Node.make({
172
+ id: Devtools.Echo.id,
173
+ data: null,
174
+ type: DEVTOOLS_TYPE,
175
+ properties: {
176
+ label: ['echo.label', { ns: meta.id }],
177
+ icon: 'ph--database--regular',
161
178
  },
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
- },
179
+ nodes: [
180
+ Node.make({
181
+ id: Devtools.Echo.Spaces,
182
+ data: Devtools.Echo.Spaces,
183
+ type: DEVTOOLS_TYPE,
184
+ properties: {
185
+ label: ['spaces.label', { ns: meta.id }],
186
+ icon: 'ph--graph--regular',
179
187
  },
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
- },
188
+ }),
189
+ Node.make({
190
+ id: Devtools.Echo.Space,
191
+ data: Devtools.Echo.Space,
192
+ type: DEVTOOLS_TYPE,
193
+ properties: {
194
+ label: ['space.label', { ns: meta.id }],
195
+ icon: 'ph--planet--regular',
188
196
  },
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
- },
197
+ }),
198
+ Node.make({
199
+ id: Devtools.Echo.Feeds,
200
+ data: Devtools.Echo.Feeds,
201
+ type: DEVTOOLS_TYPE,
202
+ properties: {
203
+ label: ['feeds.label', { ns: meta.id }],
204
+ icon: 'ph--list-bullets--regular',
197
205
  },
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
- },
206
+ }),
207
+ Node.make({
208
+ id: Devtools.Echo.Objects,
209
+ data: Devtools.Echo.Objects,
210
+ type: DEVTOOLS_TYPE,
211
+ properties: {
212
+ label: ['objects.label', { ns: meta.id }],
213
+ icon: 'ph--cube--regular',
206
214
  },
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
- },
215
+ }),
216
+ Node.make({
217
+ id: Devtools.Echo.Schema,
218
+ data: Devtools.Echo.Schema,
219
+ type: DEVTOOLS_TYPE,
220
+ properties: {
221
+ label: ['schema.label', { ns: meta.id }],
222
+ icon: 'ph--database--regular',
215
223
  },
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
- },
224
+ }),
225
+ Node.make({
226
+ id: Devtools.Echo.Automerge,
227
+ data: Devtools.Echo.Automerge,
228
+ type: DEVTOOLS_TYPE,
229
+ properties: {
230
+ label: ['automerge.label', { ns: meta.id }],
231
+ icon: 'ph--gear-six--regular',
224
232
  },
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
- },
233
+ }),
234
+ Node.make({
235
+ id: Devtools.Echo.Queues,
236
+ data: Devtools.Echo.Queues,
237
+ type: DEVTOOLS_TYPE,
238
+ properties: {
239
+ label: ['queues.label', { ns: meta.id }],
240
+ icon: 'ph--queue--regular',
233
241
  },
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
- },
242
+ }),
243
+ Node.make({
244
+ id: Devtools.Echo.Members,
245
+ data: Devtools.Echo.Members,
246
+ type: DEVTOOLS_TYPE,
247
+ properties: {
248
+ label: ['members.label', { ns: meta.id }],
249
+ icon: 'ph--users--regular',
242
250
  },
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
- },
251
+ }),
252
+ Node.make({
253
+ id: Devtools.Echo.Metadata,
254
+ data: Devtools.Echo.Metadata,
255
+ type: DEVTOOLS_TYPE,
256
+ properties: {
257
+ label: ['metadata.label', { ns: meta.id }],
258
+ icon: 'ph--hard-drive--regular',
251
259
  },
252
- ],
260
+ }),
261
+ ],
262
+ }),
263
+ Node.make({
264
+ id: Devtools.Mesh.id,
265
+ data: null,
266
+ type: DEVTOOLS_TYPE,
267
+ properties: {
268
+ label: ['mesh.label', { ns: meta.id }],
269
+ icon: 'ph--graph--regular',
253
270
  },
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
- },
271
+ nodes: [
272
+ Node.make({
273
+ id: Devtools.Mesh.Signal,
274
+ data: Devtools.Mesh.Signal,
275
+ type: DEVTOOLS_TYPE,
276
+ properties: {
277
+ label: ['signal.label', { ns: meta.id }],
278
+ icon: 'ph--wifi-high--regular',
271
279
  },
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
- },
280
+ }),
281
+ Node.make({
282
+ id: Devtools.Mesh.Swarm,
283
+ data: Devtools.Mesh.Swarm,
284
+ type: DEVTOOLS_TYPE,
285
+ properties: {
286
+ label: ['swarm.label', { ns: meta.id }],
287
+ icon: 'ph--users-three--regular',
280
288
  },
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
- },
289
+ }),
290
+ Node.make({
291
+ id: Devtools.Mesh.Network,
292
+ data: Devtools.Mesh.Network,
293
+ type: DEVTOOLS_TYPE,
294
+ properties: {
295
+ label: ['network.label', { ns: meta.id }],
296
+ icon: 'ph--polygon--regular',
289
297
  },
290
- ],
298
+ }),
299
+ ],
300
+ }),
301
+ Node.make({
302
+ id: Devtools.Edge.id,
303
+ data: null,
304
+ type: DEVTOOLS_TYPE,
305
+ properties: {
306
+ label: ['edge.label', { ns: meta.id }],
307
+ icon: 'ph--cloud--regular',
291
308
  },
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
- },
309
+ nodes: [
310
+ Node.make({
311
+ id: Devtools.Edge.Dashboard,
312
+ data: Devtools.Edge.Dashboard,
313
+ type: DEVTOOLS_TYPE,
314
+ properties: {
315
+ label: ['dashboard.label', { ns: meta.id }],
316
+ icon: 'ph--computer-tower--regular',
330
317
  },
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
- },
318
+ }),
319
+ Node.make({
320
+ id: Devtools.Edge.Workflows,
321
+ data: Devtools.Edge.Workflows,
322
+ type: DEVTOOLS_TYPE,
323
+ properties: {
324
+ label: ['workflows.label', { ns: meta.id }],
325
+ icon: 'ph--function--regular',
339
326
  },
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
- },
327
+ }),
328
+ Node.make({
329
+ id: Devtools.Edge.Traces,
330
+ data: Devtools.Edge.Traces,
331
+ type: DEVTOOLS_TYPE,
332
+ properties: {
333
+ label: ['traces.label', { ns: meta.id }],
334
+ icon: 'ph--line-segments--regular',
348
335
  },
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
- },
336
+ }),
337
+ Node.make({
338
+ id: Devtools.Edge.Testing,
339
+ data: Devtools.Edge.Testing,
340
+ type: DEVTOOLS_TYPE,
341
+ properties: {
342
+ label: ['testing.label', { ns: meta.id }],
343
+ icon: 'ph--flask--regular',
357
344
  },
358
- ],
359
- },
360
- ],
361
- },
362
- ];
363
- }),
364
- Option.getOrElse(() => []),
365
- ),
366
- ),
367
- }),
345
+ }),
346
+ ],
347
+ }),
348
+ ],
349
+ }),
350
+ ];
351
+ }),
352
+ }),
368
353
 
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();
354
+ // Debug object companion.
355
+ GraphBuilder.createExtension({
356
+ id: 'debug-object',
357
+ match: NodeMatcher.whenEchoObject,
358
+ connector: () =>
359
+ Effect.succeed([
360
+ AppNode.makeCompanion({
361
+ id: 'debug',
362
+ label: ['debug.label', { ns: meta.id }],
363
+ icon: 'ph--bug--regular',
364
+ data: 'debug',
365
+ position: 'fallback',
380
366
  }),
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();
367
+ ]),
368
+ }),
369
+
370
+ // Devtools deck companion.
371
+ GraphBuilder.createExtension({
372
+ id: 'devtools-overview',
373
+ match: NodeMatcher.whenRoot,
374
+ connector: () =>
375
+ Effect.succeed([
376
+ AppNode.makeDeckCompanion({
377
+ id: 'devtools',
378
+ label: ['devtools-overview.label', { ns: meta.id }],
379
+ icon: 'ph--equalizer--regular',
380
+ data: 'devtools' as const,
381
+ position: 'fallback',
388
382
  }),
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
- }),
383
+ ]),
384
+ }),
405
385
 
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
- }),
386
+ // Object explorer.
387
+ GraphBuilder.createExtension({
388
+ id: 'space-objects',
389
+ match: NodeMatcher.whenRoot,
390
+ connector: () =>
391
+ Effect.succeed([
392
+ AppNode.makeDeckCompanion({
393
+ id: 'space-objects',
394
+ label: ['space-objects.label', { ns: meta.id }],
395
+ icon: 'ph--cube--regular',
396
+ data: 'space-objects' as const,
397
+ position: 'fallback',
398
+ }),
399
+ ]),
400
+ }),
401
+ ]);
431
402
 
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
- ]);
403
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
404
+ }),
405
+ );