@dxos/plugin-debug 0.8.2-main.f11618f → 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.
- package/dist/lib/browser/{SpaceGenerator-HR7R3RTE.mjs → SpaceGenerator-NBOQZ4JF.mjs} +13 -13
- package/dist/lib/browser/SpaceGenerator-NBOQZ4JF.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-RTKWOHHT.mjs → app-graph-builder-ALFPRSAR.mjs} +52 -74
- package/dist/lib/browser/app-graph-builder-ALFPRSAR.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +3 -4
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-NEMNEAAI.mjs → react-surface-MXXLOQYV.mjs} +28 -11
- package/dist/lib/browser/react-surface-MXXLOQYV.mjs.map +7 -0
- package/dist/lib/browser/{settings-BIRIGKTH.mjs → settings-AP74NCXH.mjs} +3 -3
- package/dist/lib/browser/settings-AP74NCXH.mjs.map +7 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +49 -51
- package/src/capabilities/app-graph-builder.ts +58 -66
- package/src/capabilities/react-surface.tsx +8 -21
- package/src/capabilities/settings.ts +2 -2
- package/src/components/DebugStatus.tsx +24 -2
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +13 -9
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +5 -5
- package/src/components/SpaceGenerator/presets.ts +2 -2
- package/src/components/index.ts +0 -1
- package/src/translations.ts +0 -1
- package/dist/lib/browser/DevtoolsOverviewContainer-HYNZTH2Z.mjs +0 -19
- package/dist/lib/browser/DevtoolsOverviewContainer-HYNZTH2Z.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-HR7R3RTE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-RTKWOHHT.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NEMNEAAI.mjs.map +0 -7
- package/dist/lib/browser/settings-BIRIGKTH.mjs.map +0 -7
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts +0 -4
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/src/components/DevtoolsOverviewContainer.tsx +0 -20
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { contributes, Capabilities, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { isEchoObject, type ReactiveEchoObject, parseId } from '@dxos/react-client/echo';
|
|
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';
|
|
11
10
|
|
|
12
11
|
import { DEBUG_PLUGIN } from '../meta';
|
|
13
12
|
import { Devtools } from '../types';
|
|
@@ -19,31 +18,43 @@ export default (context: PluginsContext) =>
|
|
|
19
18
|
// Devtools node.
|
|
20
19
|
createExtension({
|
|
21
20
|
id: 'dxos.org/plugin/debug/devtools',
|
|
22
|
-
filter: (node): node is Node<null> => node.id === 'root' || node.
|
|
21
|
+
filter: (node): node is Node<null | Space> => node.id === 'root' || isSpace(node.data),
|
|
23
22
|
connector: ({ node }) => {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
}
|
|
28
40
|
|
|
29
41
|
return [
|
|
30
42
|
{
|
|
31
|
-
id: `${
|
|
43
|
+
id: `${node.id}-${Devtools.id}`,
|
|
32
44
|
data: null,
|
|
33
45
|
type: DEVTOOLS_TYPE,
|
|
34
46
|
properties: {
|
|
35
47
|
label: ['devtools label', { ns: DEBUG_PLUGIN }],
|
|
36
|
-
icon: 'ph--hammer--regular',
|
|
37
48
|
disposition: 'workspace',
|
|
38
|
-
|
|
49
|
+
icon: 'ph--hammer--regular',
|
|
39
50
|
},
|
|
40
51
|
nodes: [
|
|
41
|
-
...(
|
|
52
|
+
...(isSpace(node.data)
|
|
42
53
|
? [
|
|
43
54
|
{
|
|
44
|
-
id:
|
|
55
|
+
id: `${node.data.id}-debug`,
|
|
45
56
|
type: 'dxos.org/plugin/debug/space',
|
|
46
|
-
data: { space, type: 'dxos.org/plugin/debug/space' },
|
|
57
|
+
data: { space: node.data, type: 'dxos.org/plugin/debug/space' },
|
|
47
58
|
properties: {
|
|
48
59
|
label: ['debug label', { ns: DEBUG_PLUGIN }],
|
|
49
60
|
icon: 'ph--bug--regular',
|
|
@@ -52,7 +63,7 @@ export default (context: PluginsContext) =>
|
|
|
52
63
|
]
|
|
53
64
|
: []),
|
|
54
65
|
{
|
|
55
|
-
id: `${
|
|
66
|
+
id: `${node.id}-${Devtools.Client.id}`,
|
|
56
67
|
data: null,
|
|
57
68
|
type: DEVTOOLS_TYPE,
|
|
58
69
|
properties: {
|
|
@@ -61,7 +72,7 @@ export default (context: PluginsContext) =>
|
|
|
61
72
|
},
|
|
62
73
|
nodes: [
|
|
63
74
|
{
|
|
64
|
-
id: `${Devtools.Client.Config}
|
|
75
|
+
id: `${node.id}-${Devtools.Client.Config}`,
|
|
65
76
|
data: Devtools.Client.Config,
|
|
66
77
|
type: DEVTOOLS_TYPE,
|
|
67
78
|
properties: {
|
|
@@ -70,7 +81,7 @@ export default (context: PluginsContext) =>
|
|
|
70
81
|
},
|
|
71
82
|
},
|
|
72
83
|
{
|
|
73
|
-
id: `${Devtools.Client.Storage}
|
|
84
|
+
id: `${node.id}-${Devtools.Client.Storage}`,
|
|
74
85
|
data: Devtools.Client.Storage,
|
|
75
86
|
type: DEVTOOLS_TYPE,
|
|
76
87
|
properties: {
|
|
@@ -79,7 +90,7 @@ export default (context: PluginsContext) =>
|
|
|
79
90
|
},
|
|
80
91
|
},
|
|
81
92
|
{
|
|
82
|
-
id: `${Devtools.Client.Logs}
|
|
93
|
+
id: `${node.id}-${Devtools.Client.Logs}`,
|
|
83
94
|
data: Devtools.Client.Logs,
|
|
84
95
|
type: DEVTOOLS_TYPE,
|
|
85
96
|
properties: {
|
|
@@ -88,7 +99,7 @@ export default (context: PluginsContext) =>
|
|
|
88
99
|
},
|
|
89
100
|
},
|
|
90
101
|
{
|
|
91
|
-
id: `${Devtools.Client.Diagnostics}
|
|
102
|
+
id: `${node.id}-${Devtools.Client.Diagnostics}`,
|
|
92
103
|
data: Devtools.Client.Diagnostics,
|
|
93
104
|
type: DEVTOOLS_TYPE,
|
|
94
105
|
properties: {
|
|
@@ -97,7 +108,7 @@ export default (context: PluginsContext) =>
|
|
|
97
108
|
},
|
|
98
109
|
},
|
|
99
110
|
{
|
|
100
|
-
id: `${Devtools.Client.Tracing}
|
|
111
|
+
id: `${node.id}-${Devtools.Client.Tracing}`,
|
|
101
112
|
data: Devtools.Client.Tracing,
|
|
102
113
|
type: DEVTOOLS_TYPE,
|
|
103
114
|
properties: {
|
|
@@ -108,7 +119,7 @@ export default (context: PluginsContext) =>
|
|
|
108
119
|
],
|
|
109
120
|
},
|
|
110
121
|
{
|
|
111
|
-
id: `${
|
|
122
|
+
id: `${node.id}-${Devtools.Halo.id}`,
|
|
112
123
|
data: null,
|
|
113
124
|
type: DEVTOOLS_TYPE,
|
|
114
125
|
properties: {
|
|
@@ -117,7 +128,7 @@ export default (context: PluginsContext) =>
|
|
|
117
128
|
},
|
|
118
129
|
nodes: [
|
|
119
130
|
{
|
|
120
|
-
id: `${Devtools.Halo.Identity}
|
|
131
|
+
id: `${node.id}-${Devtools.Halo.Identity}`,
|
|
121
132
|
data: Devtools.Halo.Identity,
|
|
122
133
|
type: DEVTOOLS_TYPE,
|
|
123
134
|
properties: {
|
|
@@ -126,7 +137,7 @@ export default (context: PluginsContext) =>
|
|
|
126
137
|
},
|
|
127
138
|
},
|
|
128
139
|
{
|
|
129
|
-
id: `${Devtools.Halo.Devices}
|
|
140
|
+
id: `${node.id}-${Devtools.Halo.Devices}`,
|
|
130
141
|
data: Devtools.Halo.Devices,
|
|
131
142
|
type: DEVTOOLS_TYPE,
|
|
132
143
|
properties: {
|
|
@@ -135,7 +146,7 @@ export default (context: PluginsContext) =>
|
|
|
135
146
|
},
|
|
136
147
|
},
|
|
137
148
|
{
|
|
138
|
-
id: `${Devtools.Halo.Keyring}
|
|
149
|
+
id: `${node.id}-${Devtools.Halo.Keyring}`,
|
|
139
150
|
data: Devtools.Halo.Keyring,
|
|
140
151
|
type: DEVTOOLS_TYPE,
|
|
141
152
|
properties: {
|
|
@@ -144,7 +155,7 @@ export default (context: PluginsContext) =>
|
|
|
144
155
|
},
|
|
145
156
|
},
|
|
146
157
|
{
|
|
147
|
-
id: `${Devtools.Halo.Credentials}
|
|
158
|
+
id: `${node.id}-${Devtools.Halo.Credentials}`,
|
|
148
159
|
data: Devtools.Halo.Credentials,
|
|
149
160
|
type: DEVTOOLS_TYPE,
|
|
150
161
|
properties: {
|
|
@@ -155,7 +166,7 @@ export default (context: PluginsContext) =>
|
|
|
155
166
|
],
|
|
156
167
|
},
|
|
157
168
|
{
|
|
158
|
-
id: `${
|
|
169
|
+
id: `${node.id}-${Devtools.Echo.id}`,
|
|
159
170
|
data: null,
|
|
160
171
|
type: DEVTOOLS_TYPE,
|
|
161
172
|
properties: {
|
|
@@ -164,7 +175,7 @@ export default (context: PluginsContext) =>
|
|
|
164
175
|
},
|
|
165
176
|
nodes: [
|
|
166
177
|
{
|
|
167
|
-
id: `${Devtools.Echo.Spaces}
|
|
178
|
+
id: `${node.id}-${Devtools.Echo.Spaces}`,
|
|
168
179
|
data: Devtools.Echo.Spaces,
|
|
169
180
|
type: DEVTOOLS_TYPE,
|
|
170
181
|
properties: {
|
|
@@ -173,7 +184,7 @@ export default (context: PluginsContext) =>
|
|
|
173
184
|
},
|
|
174
185
|
},
|
|
175
186
|
{
|
|
176
|
-
id: `${Devtools.Echo.Space}
|
|
187
|
+
id: `${node.id}-${Devtools.Echo.Space}`,
|
|
177
188
|
data: Devtools.Echo.Space,
|
|
178
189
|
type: DEVTOOLS_TYPE,
|
|
179
190
|
properties: {
|
|
@@ -182,7 +193,7 @@ export default (context: PluginsContext) =>
|
|
|
182
193
|
},
|
|
183
194
|
},
|
|
184
195
|
{
|
|
185
|
-
id: `${Devtools.Echo.Feeds}
|
|
196
|
+
id: `${node.id}-${Devtools.Echo.Feeds}`,
|
|
186
197
|
data: Devtools.Echo.Feeds,
|
|
187
198
|
type: DEVTOOLS_TYPE,
|
|
188
199
|
properties: {
|
|
@@ -191,7 +202,7 @@ export default (context: PluginsContext) =>
|
|
|
191
202
|
},
|
|
192
203
|
},
|
|
193
204
|
{
|
|
194
|
-
id: `${Devtools.Echo.Objects}
|
|
205
|
+
id: `${node.id}-${Devtools.Echo.Objects}`,
|
|
195
206
|
data: Devtools.Echo.Objects,
|
|
196
207
|
type: DEVTOOLS_TYPE,
|
|
197
208
|
properties: {
|
|
@@ -200,7 +211,7 @@ export default (context: PluginsContext) =>
|
|
|
200
211
|
},
|
|
201
212
|
},
|
|
202
213
|
{
|
|
203
|
-
id: `${Devtools.Echo.Automerge}
|
|
214
|
+
id: `${node.id}-${Devtools.Echo.Automerge}`,
|
|
204
215
|
data: Devtools.Echo.Automerge,
|
|
205
216
|
type: DEVTOOLS_TYPE,
|
|
206
217
|
properties: {
|
|
@@ -209,7 +220,7 @@ export default (context: PluginsContext) =>
|
|
|
209
220
|
},
|
|
210
221
|
},
|
|
211
222
|
{
|
|
212
|
-
id: `${Devtools.Echo.Queues}
|
|
223
|
+
id: `${node.id}-${Devtools.Echo.Queues}`,
|
|
213
224
|
data: Devtools.Echo.Queues,
|
|
214
225
|
type: DEVTOOLS_TYPE,
|
|
215
226
|
properties: {
|
|
@@ -218,7 +229,7 @@ export default (context: PluginsContext) =>
|
|
|
218
229
|
},
|
|
219
230
|
},
|
|
220
231
|
{
|
|
221
|
-
id: `${Devtools.Echo.Members}
|
|
232
|
+
id: `${node.id}-${Devtools.Echo.Members}`,
|
|
222
233
|
data: Devtools.Echo.Members,
|
|
223
234
|
type: DEVTOOLS_TYPE,
|
|
224
235
|
properties: {
|
|
@@ -227,7 +238,7 @@ export default (context: PluginsContext) =>
|
|
|
227
238
|
},
|
|
228
239
|
},
|
|
229
240
|
{
|
|
230
|
-
id: `${Devtools.Echo.Metadata}
|
|
241
|
+
id: `${node.id}-${Devtools.Echo.Metadata}`,
|
|
231
242
|
data: Devtools.Echo.Metadata,
|
|
232
243
|
type: DEVTOOLS_TYPE,
|
|
233
244
|
properties: {
|
|
@@ -238,7 +249,7 @@ export default (context: PluginsContext) =>
|
|
|
238
249
|
],
|
|
239
250
|
},
|
|
240
251
|
{
|
|
241
|
-
id: `${
|
|
252
|
+
id: `${node.id}-${Devtools.Mesh.id}`,
|
|
242
253
|
data: null,
|
|
243
254
|
type: DEVTOOLS_TYPE,
|
|
244
255
|
properties: {
|
|
@@ -247,7 +258,7 @@ export default (context: PluginsContext) =>
|
|
|
247
258
|
},
|
|
248
259
|
nodes: [
|
|
249
260
|
{
|
|
250
|
-
id: `${Devtools.Mesh.Signal}
|
|
261
|
+
id: `${node.id}-${Devtools.Mesh.Signal}`,
|
|
251
262
|
data: Devtools.Mesh.Signal,
|
|
252
263
|
type: DEVTOOLS_TYPE,
|
|
253
264
|
properties: {
|
|
@@ -256,7 +267,7 @@ export default (context: PluginsContext) =>
|
|
|
256
267
|
},
|
|
257
268
|
},
|
|
258
269
|
{
|
|
259
|
-
id: `${Devtools.Mesh.Swarm}
|
|
270
|
+
id: `${node.id}-${Devtools.Mesh.Swarm}`,
|
|
260
271
|
data: Devtools.Mesh.Swarm,
|
|
261
272
|
type: DEVTOOLS_TYPE,
|
|
262
273
|
properties: {
|
|
@@ -265,7 +276,7 @@ export default (context: PluginsContext) =>
|
|
|
265
276
|
},
|
|
266
277
|
},
|
|
267
278
|
{
|
|
268
|
-
id: `${Devtools.Mesh.Network}
|
|
279
|
+
id: `${node.id}-${Devtools.Mesh.Network}`,
|
|
269
280
|
data: Devtools.Mesh.Network,
|
|
270
281
|
type: DEVTOOLS_TYPE,
|
|
271
282
|
properties: {
|
|
@@ -277,7 +288,7 @@ export default (context: PluginsContext) =>
|
|
|
277
288
|
},
|
|
278
289
|
// TODO(wittjosiah): Remove?
|
|
279
290
|
// {
|
|
280
|
-
// id: `${
|
|
291
|
+
// id: `${node.id}-${Devtools.Agent.id}`,
|
|
281
292
|
// data: null,
|
|
282
293
|
// type: DEVTOOLS_TYPE,
|
|
283
294
|
// properties: {
|
|
@@ -286,7 +297,7 @@ export default (context: PluginsContext) =>
|
|
|
286
297
|
// },
|
|
287
298
|
// nodes: [
|
|
288
299
|
// {
|
|
289
|
-
// id: `${
|
|
300
|
+
// id: `${node.id}-${Devtools.Agent.Dashboard}`,
|
|
290
301
|
// data: Devtools.Agent.Dashboard,
|
|
291
302
|
// type: DEVTOOLS_TYPE,
|
|
292
303
|
// properties: {
|
|
@@ -297,7 +308,7 @@ export default (context: PluginsContext) =>
|
|
|
297
308
|
// ],
|
|
298
309
|
// },
|
|
299
310
|
{
|
|
300
|
-
id: `${
|
|
311
|
+
id: `${node.id}-${Devtools.Edge.id}`,
|
|
301
312
|
data: null,
|
|
302
313
|
type: DEVTOOLS_TYPE,
|
|
303
314
|
properties: {
|
|
@@ -306,7 +317,7 @@ export default (context: PluginsContext) =>
|
|
|
306
317
|
},
|
|
307
318
|
nodes: [
|
|
308
319
|
{
|
|
309
|
-
id: `${Devtools.Edge.Dashboard}
|
|
320
|
+
id: `${node.id}-${Devtools.Edge.Dashboard}`,
|
|
310
321
|
data: Devtools.Edge.Dashboard,
|
|
311
322
|
type: DEVTOOLS_TYPE,
|
|
312
323
|
properties: {
|
|
@@ -315,7 +326,7 @@ export default (context: PluginsContext) =>
|
|
|
315
326
|
},
|
|
316
327
|
},
|
|
317
328
|
{
|
|
318
|
-
id: `${Devtools.Edge.Workflows}
|
|
329
|
+
id: `${node.id}-${Devtools.Edge.Workflows}`,
|
|
319
330
|
data: Devtools.Edge.Workflows,
|
|
320
331
|
type: DEVTOOLS_TYPE,
|
|
321
332
|
properties: {
|
|
@@ -324,7 +335,7 @@ export default (context: PluginsContext) =>
|
|
|
324
335
|
},
|
|
325
336
|
},
|
|
326
337
|
{
|
|
327
|
-
id: `${Devtools.Edge.Traces}
|
|
338
|
+
id: `${node.id}-${Devtools.Edge.Traces}`,
|
|
328
339
|
data: Devtools.Edge.Traces,
|
|
329
340
|
type: DEVTOOLS_TYPE,
|
|
330
341
|
properties: {
|
|
@@ -333,7 +344,7 @@ export default (context: PluginsContext) =>
|
|
|
333
344
|
},
|
|
334
345
|
},
|
|
335
346
|
{
|
|
336
|
-
id: `${Devtools.Edge.Testing}
|
|
347
|
+
id: `${node.id}-${Devtools.Edge.Testing}`,
|
|
337
348
|
data: Devtools.Edge.Testing,
|
|
338
349
|
type: DEVTOOLS_TYPE,
|
|
339
350
|
properties: {
|
|
@@ -399,23 +410,4 @@ export default (context: PluginsContext) =>
|
|
|
399
410
|
},
|
|
400
411
|
],
|
|
401
412
|
}),
|
|
402
|
-
|
|
403
|
-
// Devtools deck companion.
|
|
404
|
-
createExtension({
|
|
405
|
-
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
|
-
],
|
|
420
|
-
}),
|
|
421
413
|
]);
|
|
@@ -16,30 +16,30 @@ import {
|
|
|
16
16
|
type PluginsContext,
|
|
17
17
|
} from '@dxos/app-framework';
|
|
18
18
|
import {
|
|
19
|
-
AutomergePanel,
|
|
20
19
|
ConfigPanel,
|
|
21
20
|
CredentialsPanel,
|
|
22
21
|
DeviceListPanel,
|
|
23
22
|
DiagnosticsPanel,
|
|
24
|
-
EdgeDashboardPanel,
|
|
25
23
|
FeedsPanel,
|
|
26
24
|
IdentityPanel,
|
|
27
|
-
InvocationTracePanel,
|
|
28
25
|
KeyringPanel,
|
|
29
26
|
LoggingPanel,
|
|
30
27
|
MembersPanel,
|
|
31
28
|
MetadataPanel,
|
|
32
29
|
NetworkPanel,
|
|
33
30
|
ObjectsPanel,
|
|
34
|
-
QueuesPanel,
|
|
35
31
|
SignalPanel,
|
|
36
32
|
SpaceInfoPanel,
|
|
37
33
|
SpaceListPanel,
|
|
38
34
|
StoragePanel,
|
|
39
35
|
SwarmPanel,
|
|
40
|
-
TestingPanel,
|
|
41
36
|
TracingPanel,
|
|
37
|
+
EdgeDashboardPanel,
|
|
38
|
+
AutomergePanel,
|
|
42
39
|
WorkflowPanel,
|
|
40
|
+
QueuesPanel,
|
|
41
|
+
InvocationTracePanel,
|
|
42
|
+
TestingPanel,
|
|
43
43
|
} from '@dxos/devtools';
|
|
44
44
|
import { SettingsStore } from '@dxos/local-storage';
|
|
45
45
|
import { log } from '@dxos/log';
|
|
@@ -52,20 +52,12 @@ import {
|
|
|
52
52
|
isSpace,
|
|
53
53
|
isEchoObject,
|
|
54
54
|
type ReactiveEchoObject,
|
|
55
|
-
type
|
|
55
|
+
type ReactiveObject,
|
|
56
56
|
type Space,
|
|
57
57
|
parseId,
|
|
58
58
|
} from '@dxos/react-client/echo';
|
|
59
59
|
|
|
60
|
-
import {
|
|
61
|
-
DebugApp,
|
|
62
|
-
DebugObjectPanel,
|
|
63
|
-
DebugSettings,
|
|
64
|
-
DebugStatus,
|
|
65
|
-
DevtoolsOverviewContainer,
|
|
66
|
-
SpaceGenerator,
|
|
67
|
-
Wireframe,
|
|
68
|
-
} from '../components';
|
|
60
|
+
import { DebugApp, DebugObjectPanel, DebugSettings, DebugStatus, SpaceGenerator, Wireframe } from '../components';
|
|
69
61
|
import { DEBUG_PLUGIN } from '../meta';
|
|
70
62
|
import { type DebugSettingsProps, Devtools } from '../types';
|
|
71
63
|
|
|
@@ -105,7 +97,7 @@ export default (context: PluginsContext) =>
|
|
|
105
97
|
filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
|
|
106
98
|
component: ({ data }) => {
|
|
107
99
|
const handleCreateObject = useCallback(
|
|
108
|
-
(objects:
|
|
100
|
+
(objects: ReactiveObject<any>[]) => {
|
|
109
101
|
if (!isSpace(data.subject.space)) {
|
|
110
102
|
return;
|
|
111
103
|
}
|
|
@@ -155,11 +147,6 @@ export default (context: PluginsContext) =>
|
|
|
155
147
|
data.subject === 'debug' && isEchoObject(data.companionTo),
|
|
156
148
|
component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
|
|
157
149
|
}),
|
|
158
|
-
createSurface({
|
|
159
|
-
id: `${DEBUG_PLUGIN}/devtools-overview`,
|
|
160
|
-
role: 'deck-companion--devtools',
|
|
161
|
-
component: () => <DevtoolsOverviewContainer />,
|
|
162
|
-
}),
|
|
163
150
|
createSurface({
|
|
164
151
|
id: `${DEBUG_PLUGIN}/status`,
|
|
165
152
|
role: 'status',
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { create } from '@dxos/react-client/echo';
|
|
7
7
|
|
|
8
8
|
import { DEBUG_PLUGIN } from '../meta';
|
|
9
9
|
import { type DebugSettingsProps, DebugSettingsSchema } from '../types';
|
|
10
10
|
|
|
11
11
|
export default () => {
|
|
12
|
-
const settings =
|
|
12
|
+
const settings = create<DebugSettingsProps>({});
|
|
13
13
|
|
|
14
14
|
return contributes(Capabilities.Settings, { schema: DebugSettingsSchema, prefix: DEBUG_PLUGIN, value: settings });
|
|
15
15
|
};
|
|
@@ -6,11 +6,12 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useAppGraph, useLayout } from '@dxos/app-framework';
|
|
8
8
|
import { TimeoutError } from '@dxos/async';
|
|
9
|
+
import { StatsPanel, useStats } from '@dxos/devtools';
|
|
9
10
|
import { getActiveSpace } from '@dxos/plugin-space';
|
|
10
11
|
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
11
12
|
import { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';
|
|
12
13
|
import { useNetworkStatus } from '@dxos/react-client/mesh';
|
|
13
|
-
import { Icon } from '@dxos/react-ui';
|
|
14
|
+
import { Icon, Popover } from '@dxos/react-ui';
|
|
14
15
|
|
|
15
16
|
const styles = {
|
|
16
17
|
success: 'text-sky-300 dark:text-green-700',
|
|
@@ -179,7 +180,28 @@ const SavingIndicator = () => {
|
|
|
179
180
|
}
|
|
180
181
|
};
|
|
181
182
|
|
|
182
|
-
const
|
|
183
|
+
const PerformanceIndicator = () => {
|
|
184
|
+
const [visible, setVisible] = useState(false);
|
|
185
|
+
const [stats, refreshStats] = useStats();
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<Popover.Root open={visible} onOpenChange={setVisible}>
|
|
189
|
+
<Popover.Trigger asChild>
|
|
190
|
+
<StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>
|
|
191
|
+
<Icon icon='ph--chart-bar--regular' size={4} />
|
|
192
|
+
</StatusBar.Button>
|
|
193
|
+
</Popover.Trigger>
|
|
194
|
+
<Popover.Portal>
|
|
195
|
+
<Popover.Content classNames='max-is-[min(var(--radix-popover-content-available-width),300px)] max-bs-[--radix-popover-content-available-height]'>
|
|
196
|
+
<StatsPanel stats={stats} onRefresh={refreshStats} />
|
|
197
|
+
<Popover.Arrow />
|
|
198
|
+
</Popover.Content>
|
|
199
|
+
</Popover.Portal>
|
|
200
|
+
</Popover.Root>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const indicators = [SavingIndicator, SwarmIndicator, PerformanceIndicator, ErrorIndicator];
|
|
183
205
|
|
|
184
206
|
export const DebugStatus = () => {
|
|
185
207
|
return (
|
|
@@ -6,7 +6,7 @@ import { addressToA1Notation } from '@dxos/compute';
|
|
|
6
6
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
|
|
7
7
|
import { ObjectId, type BaseObject, type TypedObject } from '@dxos/echo-schema';
|
|
8
8
|
import { DXN } from '@dxos/keys';
|
|
9
|
-
import {
|
|
9
|
+
import { create, makeRef, type ReactiveObject } from '@dxos/live-object';
|
|
10
10
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
11
11
|
import { createSheet } from '@dxos/plugin-sheet/types';
|
|
12
12
|
import { SheetType, type CellValue } from '@dxos/plugin-sheet/types';
|
|
@@ -31,8 +31,8 @@ const generator: ValueGenerator = faker as any;
|
|
|
31
31
|
export type ObjectGenerator<T extends BaseObject> = (
|
|
32
32
|
space: Space,
|
|
33
33
|
n: number,
|
|
34
|
-
cb?: (objects:
|
|
35
|
-
) => Promise<
|
|
34
|
+
cb?: (objects: ReactiveObject<any>[]) => void,
|
|
35
|
+
) => Promise<ReactiveObject<T>[]>;
|
|
36
36
|
|
|
37
37
|
export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
38
38
|
[
|
|
@@ -40,9 +40,9 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
40
40
|
async (space, n, cb) => {
|
|
41
41
|
const objects = range(n).map(() => {
|
|
42
42
|
return space.db.add(
|
|
43
|
-
|
|
43
|
+
create(DocumentType, {
|
|
44
44
|
name: faker.commerce.productName(),
|
|
45
|
-
content: makeRef(
|
|
45
|
+
content: makeRef(create(TextType, { content: faker.lorem.sentences(5) })),
|
|
46
46
|
threads: [],
|
|
47
47
|
}),
|
|
48
48
|
);
|
|
@@ -58,9 +58,9 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
58
58
|
const objects = range(n).map(() => {
|
|
59
59
|
// TODO(burdon): Generate diagram.
|
|
60
60
|
const obj = space.db.add(
|
|
61
|
-
|
|
61
|
+
create(DiagramType, {
|
|
62
62
|
name: faker.commerce.productName(),
|
|
63
|
-
canvas: makeRef(
|
|
63
|
+
canvas: makeRef(create(CanvasType, { content: {} })),
|
|
64
64
|
}),
|
|
65
65
|
);
|
|
66
66
|
|
|
@@ -139,7 +139,11 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
139
139
|
]);
|
|
140
140
|
|
|
141
141
|
export const createGenerator = <T extends BaseObject>(type: TypedObject<T>): ObjectGenerator<T> => {
|
|
142
|
-
return async (
|
|
142
|
+
return async (
|
|
143
|
+
space: Space,
|
|
144
|
+
n: number,
|
|
145
|
+
cb?: (objects: ReactiveObject<any>[]) => void,
|
|
146
|
+
): Promise<ReactiveObject<T>[]> => {
|
|
143
147
|
// Find or create mutable schema.
|
|
144
148
|
const schema =
|
|
145
149
|
(await space.db.schemaRegistry.query({ typename: type.typename }).firstOrUndefined()) ??
|
|
@@ -155,7 +159,7 @@ export const createGenerator = <T extends BaseObject>(type: TypedObject<T>): Obj
|
|
|
155
159
|
if (!table) {
|
|
156
160
|
const name = type.typename.split('/').pop() ?? type.typename;
|
|
157
161
|
const view = createView({ name, typename: type.typename, jsonSchema: schema.jsonSchema });
|
|
158
|
-
const table = space.db.add(
|
|
162
|
+
const table = space.db.add(create(TableType, { name, view: makeRef(view) }));
|
|
159
163
|
cb?.([table]);
|
|
160
164
|
}
|
|
161
165
|
|
|
@@ -7,7 +7,7 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
7
7
|
import { createIntent, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { ComputeGraph } from '@dxos/conductor';
|
|
9
9
|
import { toEffectSchema } from '@dxos/echo-schema';
|
|
10
|
-
import {
|
|
10
|
+
import { create, type ReactiveObject } from '@dxos/live-object';
|
|
11
11
|
import { log } from '@dxos/log';
|
|
12
12
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
13
13
|
import { SheetType } from '@dxos/plugin-sheet/types';
|
|
@@ -27,14 +27,14 @@ import { presets } from './presets';
|
|
|
27
27
|
|
|
28
28
|
export type SpaceGeneratorProps = {
|
|
29
29
|
space: Space;
|
|
30
|
-
onCreateObjects?: (objects:
|
|
30
|
+
onCreateObjects?: (objects: ReactiveObject<any>[]) => void;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {
|
|
34
34
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
35
35
|
const client = useClient();
|
|
36
36
|
const staticTypes = [DocumentType, DiagramType, SheetType, ComputeGraph]; // TODO(burdon): Make extensible.
|
|
37
|
-
const mutableTypes = [Testing.
|
|
37
|
+
const mutableTypes = [Testing.Org, Testing.Project, Testing.Contact, Testing.Message];
|
|
38
38
|
const [count, setCount] = useState(1);
|
|
39
39
|
const [info, setInfo] = useState<any>({});
|
|
40
40
|
|
|
@@ -111,7 +111,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
|
|
|
111
111
|
schemas.map(async (schema) => {
|
|
112
112
|
const parts = schema.typename.split('/');
|
|
113
113
|
const name = parts[parts.length - 1];
|
|
114
|
-
const table =
|
|
114
|
+
const table = create(TableType, { name, threads: [] });
|
|
115
115
|
await initializeTable({ client, space, table, typename: schema.typename });
|
|
116
116
|
await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: table }));
|
|
117
117
|
return table;
|
|
@@ -125,7 +125,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
|
|
|
125
125
|
log.warn('Missing schema for object', { id, typename });
|
|
126
126
|
return;
|
|
127
127
|
}
|
|
128
|
-
const object =
|
|
128
|
+
const object = create(schema, fields);
|
|
129
129
|
space.db.add(object);
|
|
130
130
|
return object;
|
|
131
131
|
}),
|
|
@@ -7,7 +7,7 @@ import { AST, ObjectId, S, toJsonSchema } from '@dxos/echo-schema';
|
|
|
7
7
|
import { FunctionTrigger, TriggerKind, type TriggerType } from '@dxos/functions/types';
|
|
8
8
|
import { invariant } from '@dxos/invariant';
|
|
9
9
|
import { DXN } from '@dxos/keys';
|
|
10
|
-
import {
|
|
10
|
+
import { create, makeRef } from '@dxos/live-object';
|
|
11
11
|
import { Filter, type Space } from '@dxos/react-client/echo';
|
|
12
12
|
import {
|
|
13
13
|
type ComputeShape,
|
|
@@ -509,7 +509,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
509
509
|
|
|
510
510
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
511
511
|
return space.db.add(
|
|
512
|
-
|
|
512
|
+
create(CanvasBoardType, {
|
|
513
513
|
name,
|
|
514
514
|
computeGraph: makeRef(compute.root),
|
|
515
515
|
layout: canvas.graph,
|
package/src/components/index.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
7
|
export const DebugApp = lazy(() => import('./DebugApp'));
|
|
8
|
-
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
9
8
|
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
10
9
|
|
|
11
10
|
export * from './DebugObjectPanel';
|
package/src/translations.ts
CHANGED
|
@@ -13,7 +13,6 @@ export default [
|
|
|
13
13
|
'mutation period': 'Mutation period',
|
|
14
14
|
'open devtools label': 'Open DevTools',
|
|
15
15
|
'devtools label': 'DevTools',
|
|
16
|
-
'devtools overview label': 'DevTools Stats',
|
|
17
16
|
'debug label': 'Debug',
|
|
18
17
|
'settings show debug panel': 'Show Debug panel.',
|
|
19
18
|
'settings show devtools panel': 'Show DevTools panel.',
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// packages/plugins/plugin-debug/src/components/DevtoolsOverviewContainer.tsx
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Surface } from "@dxos/app-framework";
|
|
4
|
-
import { StatsPanel, useStats } from "@dxos/devtools";
|
|
5
|
-
var DevtoolsOverviewContainer = () => {
|
|
6
|
-
const [stats, refreshStats] = useStats();
|
|
7
|
-
return /* @__PURE__ */ React.createElement(StatsPanel, {
|
|
8
|
-
stats,
|
|
9
|
-
onRefresh: refreshStats
|
|
10
|
-
}, /* @__PURE__ */ React.createElement(Surface, {
|
|
11
|
-
role: "devtools-overview"
|
|
12
|
-
}));
|
|
13
|
-
};
|
|
14
|
-
var DevtoolsOverviewContainer_default = DevtoolsOverviewContainer;
|
|
15
|
-
export {
|
|
16
|
-
DevtoolsOverviewContainer,
|
|
17
|
-
DevtoolsOverviewContainer_default as default
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=DevtoolsOverviewContainer-HYNZTH2Z.mjs.map
|