@dxos/plugin-debug 0.8.1-main.ae460ac → 0.8.1-staging.31c3ee1

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