@dxos/plugin-debug 0.8.1-staging.391c573 → 0.8.1-staging.9eaf14f

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 (71) 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-LHJC7LSH.mjs → chunk-TCEHALD4.mjs} +2 -3
  10. package/dist/lib/browser/chunk-TCEHALD4.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +9 -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-PQFKDW3V.mjs → react-surface-MXXLOQYV.mjs} +110 -44
  16. package/dist/lib/browser/react-surface-MXXLOQYV.mjs.map +7 -0
  17. package/dist/lib/browser/{settings-DLIPIUG7.mjs → settings-AP74NCXH.mjs} +6 -8
  18. package/dist/lib/browser/{settings-DLIPIUG7.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/DebugSettings.d.ts.map +1 -1
  24. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  25. package/dist/types/src/components/index.d.ts +0 -4
  26. package/dist/types/src/components/index.d.ts.map +1 -1
  27. package/dist/types/src/meta.d.ts +2 -9
  28. package/dist/types/src/meta.d.ts.map +1 -1
  29. package/dist/types/src/translations.d.ts +1 -0
  30. package/dist/types/src/translations.d.ts.map +1 -1
  31. package/dist/types/src/types.d.ts +1 -1
  32. package/dist/types/src/types.d.ts.map +1 -1
  33. package/package.json +49 -48
  34. package/src/DebugPlugin.tsx +1 -14
  35. package/src/capabilities/app-graph-builder.ts +329 -357
  36. package/src/capabilities/react-surface.tsx +75 -41
  37. package/src/capabilities/settings.ts +1 -3
  38. package/src/components/DebugSettings.tsx +0 -3
  39. package/src/components/SpaceGenerator/ObjectGenerator.tsx +1 -1
  40. package/src/components/SpaceGenerator/SchemaTable.tsx +1 -1
  41. package/src/components/SpaceGenerator/SpaceGenerator.tsx +3 -9
  42. package/src/components/index.ts +0 -1
  43. package/src/meta.ts +2 -2
  44. package/src/translations.ts +3 -2
  45. package/src/types.ts +1 -1
  46. package/dist/lib/browser/DebugSpace-5A2QOKAZ.mjs +0 -277
  47. package/dist/lib/browser/DebugSpace-5A2QOKAZ.mjs.map +0 -7
  48. package/dist/lib/browser/SpaceGenerator-SPEJBGP7.mjs.map +0 -7
  49. package/dist/lib/browser/app-graph-builder-NYB6QZQK.mjs +0 -619
  50. package/dist/lib/browser/app-graph-builder-NYB6QZQK.mjs.map +0 -7
  51. package/dist/lib/browser/chunk-EF3UVAVI.mjs.map +0 -7
  52. package/dist/lib/browser/chunk-GSJS3HEM.mjs +0 -15
  53. package/dist/lib/browser/chunk-GSJS3HEM.mjs.map +0 -7
  54. package/dist/lib/browser/chunk-LHJC7LSH.mjs.map +0 -7
  55. package/dist/lib/browser/react-surface-PQFKDW3V.mjs.map +0 -7
  56. package/dist/types/src/components/DebugSpace/DebugSpace.d.ts +0 -8
  57. package/dist/types/src/components/DebugSpace/DebugSpace.d.ts.map +0 -1
  58. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts +0 -6
  59. package/dist/types/src/components/DebugSpace/DebugSpace.stories.d.ts.map +0 -1
  60. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts +0 -15
  61. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +0 -1
  62. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts +0 -6
  63. package/dist/types/src/components/DebugSpace/ObjectCreator.stories.d.ts.map +0 -1
  64. package/dist/types/src/components/DebugSpace/index.d.ts +0 -3
  65. package/dist/types/src/components/DebugSpace/index.d.ts.map +0 -1
  66. package/src/components/DebugSpace/DebugSpace.stories.tsx +0 -46
  67. package/src/components/DebugSpace/DebugSpace.tsx +0 -183
  68. package/src/components/DebugSpace/ObjectCreator.stories.tsx +0 -51
  69. package/src/components/DebugSpace/ObjectCreator.tsx +0 -100
  70. package/src/components/DebugSpace/index.ts +0 -7
  71. /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,312 +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
- id: Devtools.Edge.Traces,
315
- data: Devtools.Edge.Traces,
316
- type: DEVTOOLS_TYPE,
317
- properties: {
318
- label: ['traces label', { ns: DEBUG_PLUGIN }],
319
- icon: 'ph--line-segments--regular',
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
+ },
320
354
  },
321
- },
322
- ],
323
- },
324
- ],
325
- },
326
- ],
355
+ ],
356
+ },
357
+ ],
358
+ },
359
+ ];
360
+ },
327
361
  }),
328
362
 
329
363
  // Debug node.
@@ -358,84 +392,22 @@ export default (context: PluginsContext) =>
358
392
  },
359
393
  }),
360
394
 
361
- // Space debug nodes.
395
+ // Debug object companion.
362
396
  createExtension({
363
- id: 'dxos.org/plugin/debug/spaces',
364
- filter: (node): node is Node<Space> => {
365
- const settings = context
366
- .requestCapabilities(Capabilities.SettingsStore)[0]
367
- ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
368
- return !!settings?.debug && isSpace(node.data);
369
- },
370
- connector: ({ node }) => {
371
- const space = node.data;
372
- const state = toSignal(
373
- (onChange) => space.state.subscribe(() => onChange()).unsubscribe,
374
- () => space.state.get(),
375
- space.id,
376
- );
377
- if (state !== SpaceState.SPACE_READY) {
378
- return;
379
- }
380
-
381
- // Not adding the debug node until the root collection is available aligns the behaviour of this
382
- // extension with that of the space plugin adding objects. This ensures that the debug node is added at
383
- // the same time as objects and prevents order from changing as the nodes are added.
384
- const collection = space.properties[CollectionType.typename]?.target as CollectionType | undefined;
385
- if (!collection) {
386
- return;
387
- }
388
-
389
- return [
390
- {
391
- id: `${space.id}-${Devtools.id}`,
392
- data: null,
393
- type: DEVTOOLS_TYPE,
394
- properties: {
395
- label: ['devtools label', { ns: DEBUG_PLUGIN }],
396
- icon: 'ph--hammer--regular',
397
- },
398
- nodes: [
399
- {
400
- // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.
401
- id: `${space.id}-debug`,
402
- type: 'dxos.org/plugin/debug/space',
403
- data: { space, type: 'dxos.org/plugin/debug/space' },
404
- properties: {
405
- label: ['debug label', { ns: DEBUG_PLUGIN }],
406
- icon: 'ph--bug--regular',
407
- },
408
- },
409
- {
410
- id: `${space.id}-${Devtools.Echo.Space}`,
411
- data: Devtools.Echo.Space,
412
- type: DEVTOOLS_TYPE,
413
- properties: {
414
- label: ['space label', { ns: DEBUG_PLUGIN }],
415
- icon: 'ph--planet--regular',
416
- },
417
- },
418
- {
419
- id: `${space.id}-${Devtools.Echo.Objects}`,
420
- data: Devtools.Echo.Objects,
421
- type: DEVTOOLS_TYPE,
422
- properties: {
423
- label: ['objects label', { ns: DEBUG_PLUGIN }],
424
- icon: 'ph--database--regular',
425
- },
426
- },
427
- {
428
- id: `${space.id}-${Devtools.Edge.Traces}`,
429
- data: Devtools.Edge.Traces,
430
- type: DEVTOOLS_TYPE,
431
- properties: {
432
- label: ['traces label', { ns: DEBUG_PLUGIN }],
433
- icon: 'ph--line-segments--regular',
434
- },
435
- },
436
- ],
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',
437
409
  },
438
- ];
439
- },
410
+ },
411
+ ],
440
412
  }),
441
413
  ]);