@dxos/plugin-debug 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0

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