@dxos/plugin-debug 0.8.2-main.fbd8ed0 → 0.8.2-staging.7ac8446

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