@dxos/plugin-debug 0.7.5-main.9d26e3a → 0.7.5-main.b19bfc8

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 (93) hide show
  1. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs → DebugApp-LQHFFK3Y.mjs} +4 -2
  2. package/dist/lib/browser/{DebugApp-HCHR6GKO.mjs.map → DebugApp-LQHFFK3Y.mjs.map} +3 -3
  3. package/dist/lib/browser/{DebugSpace-V3K3PQP6.mjs → DebugSpace-BTMTVZ6C.mjs} +7 -5
  4. package/dist/lib/browser/{DebugSpace-V3K3PQP6.mjs.map → DebugSpace-BTMTVZ6C.mjs.map} +3 -3
  5. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs +1238 -0
  6. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs +533 -0
  8. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-EF3UVAVI.mjs +21 -0
  10. package/dist/lib/browser/chunk-EF3UVAVI.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-UASI2CRI.mjs +72 -0
  12. package/dist/lib/browser/chunk-UASI2CRI.mjs.map +7 -0
  13. package/dist/lib/browser/index.mjs +97 -713
  14. package/dist/lib/browser/index.mjs.map +4 -4
  15. package/dist/lib/browser/meta.json +1 -1
  16. package/dist/lib/browser/react-context-TCD3MNIT.mjs +16 -0
  17. package/dist/lib/browser/react-context-TCD3MNIT.mjs.map +7 -0
  18. package/dist/lib/browser/react-surface-W6QLG4YJ.mjs +641 -0
  19. package/dist/lib/browser/react-surface-W6QLG4YJ.mjs.map +7 -0
  20. package/dist/lib/browser/settings-INPXR64L.mjs +24 -0
  21. package/dist/lib/browser/settings-INPXR64L.mjs.map +7 -0
  22. package/dist/types/src/DebugPlugin.d.ts +1 -2
  23. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/app-graph-builder.d.ts +181 -0
  25. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  26. package/dist/types/src/capabilities/index.d.ts +185 -0
  27. package/dist/types/src/capabilities/index.d.ts.map +1 -0
  28. package/dist/types/src/capabilities/react-context.d.ts +8 -0
  29. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  30. package/dist/types/src/capabilities/react-surface.d.ts +4 -0
  31. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  32. package/dist/types/src/capabilities/settings.d.ts +4 -0
  33. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  34. package/dist/types/src/components/Container.d.ts +2 -2
  35. package/dist/types/src/components/Container.d.ts.map +1 -1
  36. package/dist/types/src/components/DebugObjectPanel.d.ts +1 -2
  37. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  38. package/dist/types/src/components/DebugSettings.d.ts +1 -2
  39. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  40. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts +1 -2
  41. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +1 -1
  42. package/dist/types/src/components/DebugStatus.d.ts +1 -2
  43. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  44. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  45. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts +1 -2
  46. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +1 -1
  47. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -2
  48. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  49. package/dist/types/src/components/SpaceGenerator/presets.d.ts +22 -0
  50. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -0
  51. package/dist/types/src/components/Wireframe.d.ts +1 -2
  52. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  53. package/dist/types/src/components/index.d.ts +4 -4
  54. package/dist/types/src/components/index.d.ts.map +1 -1
  55. package/dist/types/src/index.d.ts +1 -2
  56. package/dist/types/src/index.d.ts.map +1 -1
  57. package/dist/types/src/meta.d.ts +2 -2
  58. package/dist/types/src/meta.d.ts.map +1 -1
  59. package/dist/types/src/translations.d.ts +28 -0
  60. package/dist/types/src/translations.d.ts.map +1 -1
  61. package/dist/types/src/types.d.ts +44 -4
  62. package/dist/types/src/types.d.ts.map +1 -1
  63. package/dist/types/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +51 -52
  65. package/src/DebugPlugin.tsx +61 -345
  66. package/src/capabilities/app-graph-builder.ts +385 -0
  67. package/src/capabilities/index.ts +10 -0
  68. package/src/capabilities/react-context.tsx +16 -0
  69. package/src/capabilities/react-surface.tsx +307 -0
  70. package/src/capabilities/settings.ts +17 -0
  71. package/src/components/DebugApp/DebugApp.tsx +1 -1
  72. package/src/components/DebugObjectPanel.tsx +17 -5
  73. package/src/components/DebugSettings.tsx +11 -16
  74. package/src/components/DebugSpace/DebugSpace.tsx +1 -1
  75. package/src/components/DebugStatus.tsx +17 -27
  76. package/src/components/SpaceGenerator/ObjectGenerator.tsx +34 -7
  77. package/src/components/SpaceGenerator/SpaceGenerator.tsx +76 -7
  78. package/src/components/SpaceGenerator/presets.ts +563 -0
  79. package/src/index.ts +1 -4
  80. package/src/meta.ts +4 -2
  81. package/src/translations.ts +28 -0
  82. package/src/types.ts +51 -13
  83. package/dist/lib/browser/SpaceGenerator-Y2NXBQVR.mjs +0 -277
  84. package/dist/lib/browser/SpaceGenerator-Y2NXBQVR.mjs.map +0 -7
  85. package/dist/lib/browser/chunk-6CGQHKET.mjs +0 -21
  86. package/dist/lib/browser/chunk-6CGQHKET.mjs.map +0 -7
  87. package/dist/lib/browser/chunk-CAENAAHY.mjs +0 -18
  88. package/dist/lib/browser/chunk-CAENAAHY.mjs.map +0 -7
  89. package/dist/lib/browser/meta.mjs +0 -9
  90. package/dist/lib/browser/meta.mjs.map +0 -7
  91. package/dist/types/src/components/DebugSurface.d.ts +0 -9
  92. package/dist/types/src/components/DebugSurface.d.ts.map +0 -1
  93. package/src/components/DebugSurface.tsx +0 -55
@@ -0,0 +1,385 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { contributes, Capabilities, type PluginsContext } from '@dxos/app-framework';
6
+ import { createExtension, toSignal, type Node } from '@dxos/plugin-graph';
7
+ 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';
10
+
11
+ import { DEBUG_PLUGIN } from '../meta';
12
+ import { type DebugSettingsProps, Devtools } from '../types';
13
+
14
+ const DEVTOOLS_TYPE = 'dxos.org/plugin/debug/devtools';
15
+
16
+ export default (context: PluginsContext) =>
17
+ contributes(Capabilities.AppGraphBuilder, [
18
+ // Devtools node.
19
+ createExtension({
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
+ },
50
+ },
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',
58
+ },
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',
67
+ },
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',
76
+ },
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',
85
+ },
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',
105
+ },
106
+ },
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',
114
+ },
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',
123
+ },
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',
132
+ },
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',
152
+ },
153
+ },
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',
161
+ },
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--queue--regular',
170
+ },
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',
179
+ },
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',
188
+ },
189
+ },
190
+ {
191
+ id: Devtools.Echo.Members,
192
+ data: Devtools.Echo.Members,
193
+ type: DEVTOOLS_TYPE,
194
+ properties: {
195
+ label: ['members label', { ns: DEBUG_PLUGIN }],
196
+ icon: 'ph--users--regular',
197
+ },
198
+ },
199
+ {
200
+ id: Devtools.Echo.Metadata,
201
+ data: Devtools.Echo.Metadata,
202
+ type: DEVTOOLS_TYPE,
203
+ properties: {
204
+ label: ['metadata label', { ns: DEBUG_PLUGIN }],
205
+ icon: 'ph--hard-drive--regular',
206
+ },
207
+ },
208
+ ],
209
+ },
210
+ {
211
+ id: Devtools.Mesh.id,
212
+ data: null,
213
+ type: DEVTOOLS_TYPE,
214
+ properties: {
215
+ label: ['mesh label', { ns: DEBUG_PLUGIN }],
216
+ icon: 'ph--graph--regular',
217
+ },
218
+ nodes: [
219
+ {
220
+ id: Devtools.Mesh.Signal,
221
+ data: Devtools.Mesh.Signal,
222
+ type: DEVTOOLS_TYPE,
223
+ properties: {
224
+ label: ['signal label', { ns: DEBUG_PLUGIN }],
225
+ icon: 'ph--wifi-high--regular',
226
+ },
227
+ },
228
+ {
229
+ id: Devtools.Mesh.Swarm,
230
+ data: Devtools.Mesh.Swarm,
231
+ type: DEVTOOLS_TYPE,
232
+ properties: {
233
+ label: ['swarm label', { ns: DEBUG_PLUGIN }],
234
+ icon: 'ph--users-three--regular',
235
+ },
236
+ },
237
+ {
238
+ id: Devtools.Mesh.Network,
239
+ data: Devtools.Mesh.Network,
240
+ type: DEVTOOLS_TYPE,
241
+ properties: {
242
+ label: ['network label', { ns: DEBUG_PLUGIN }],
243
+ icon: 'ph--polygon--regular',
244
+ },
245
+ },
246
+ ],
247
+ },
248
+ {
249
+ id: Devtools.Agent.id,
250
+ data: null,
251
+ type: DEVTOOLS_TYPE,
252
+ properties: {
253
+ label: ['agent label', { ns: DEBUG_PLUGIN }],
254
+ icon: 'ph--robot--regular',
255
+ },
256
+ nodes: [
257
+ {
258
+ id: Devtools.Agent.Dashboard,
259
+ data: Devtools.Agent.Dashboard,
260
+ type: DEVTOOLS_TYPE,
261
+ properties: {
262
+ label: ['dashboard label', { ns: DEBUG_PLUGIN }],
263
+ icon: 'ph--computer-tower--regular',
264
+ },
265
+ },
266
+ {
267
+ id: Devtools.Agent.Search,
268
+ data: Devtools.Agent.Search,
269
+ type: DEVTOOLS_TYPE,
270
+ properties: {
271
+ label: ['search label', { ns: DEBUG_PLUGIN }],
272
+ icon: 'ph--magnifying-glass--regular',
273
+ },
274
+ },
275
+ ],
276
+ },
277
+ {
278
+ id: Devtools.Edge.id,
279
+ data: null,
280
+ type: DEVTOOLS_TYPE,
281
+ properties: {
282
+ label: ['edge label', { ns: DEBUG_PLUGIN }],
283
+ icon: 'ph--cloud--regular',
284
+ },
285
+ nodes: [
286
+ {
287
+ id: Devtools.Edge.Dashboard,
288
+ data: Devtools.Edge.Dashboard,
289
+ type: DEVTOOLS_TYPE,
290
+ properties: {
291
+ label: ['dashboard label', { ns: DEBUG_PLUGIN }],
292
+ icon: 'ph--computer-tower--regular',
293
+ },
294
+ },
295
+ {
296
+ id: Devtools.Edge.Workflows,
297
+ data: Devtools.Edge.Workflows,
298
+ type: DEVTOOLS_TYPE,
299
+ properties: {
300
+ label: ['workflows label', { ns: DEBUG_PLUGIN }],
301
+ icon: 'ph--function--regular',
302
+ },
303
+ },
304
+ ],
305
+ },
306
+ ],
307
+ },
308
+ ],
309
+ }),
310
+
311
+ // Debug node.
312
+ createExtension({
313
+ id: 'dxos.org/plugin/debug/debug',
314
+ filter: (node): node is Node<null> => {
315
+ // TODO(wittjosiah): Plank is currently blank. Remove?
316
+ // const settings = context
317
+ // .requestCapabilities(Capabilities.SettingsStore)[0]
318
+ // ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
319
+ // return !!settings?.debug && node.id === 'root';
320
+ return false;
321
+ },
322
+ connector: () => {
323
+ const [graph] = context.requestCapabilities(Capabilities.AppGraph);
324
+ if (!graph) {
325
+ return;
326
+ }
327
+
328
+ return [
329
+ {
330
+ id: 'dxos.org/plugin/debug/debug',
331
+ type: 'dxos.org/plugin/debug/debug',
332
+ data: { graph },
333
+ properties: {
334
+ label: ['debug label', { ns: DEBUG_PLUGIN }],
335
+ disposition: 'navigation',
336
+ icon: 'ph--bug--regular',
337
+ },
338
+ },
339
+ ];
340
+ },
341
+ }),
342
+
343
+ // Space debug nodes.
344
+ createExtension({
345
+ id: 'dxos.org/plugin/debug/spaces',
346
+ filter: (node): node is Node<Space> => {
347
+ const settings = context
348
+ .requestCapabilities(Capabilities.SettingsStore)[0]
349
+ ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
350
+ return !!settings?.debug && isSpace(node.data);
351
+ },
352
+ connector: ({ node }) => {
353
+ const space = node.data;
354
+ const state = toSignal(
355
+ (onChange) => space.state.subscribe(() => onChange()).unsubscribe,
356
+ () => space.state.get(),
357
+ space.id,
358
+ );
359
+ if (state !== SpaceState.SPACE_READY) {
360
+ return;
361
+ }
362
+
363
+ // Not adding the debug node until the root collection is available aligns the behaviour of this
364
+ // extension with that of the space plugin adding objects. This ensures that the debug node is added at
365
+ // the same time as objects and prevents order from changing as the nodes are added.
366
+ const collection = space.properties[CollectionType.typename]?.target as CollectionType | undefined;
367
+ if (!collection) {
368
+ return;
369
+ }
370
+
371
+ return [
372
+ {
373
+ // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.
374
+ id: `${space.id}-debug`, // TODO(burdon): Change to slashes consistently.
375
+ type: 'dxos.org/plugin/debug/space',
376
+ data: { space, type: 'dxos.org/plugin/debug/space' },
377
+ properties: {
378
+ label: ['debug label', { ns: DEBUG_PLUGIN }],
379
+ icon: 'ph--bug--regular',
380
+ },
381
+ },
382
+ ];
383
+ },
384
+ }),
385
+ ]);
@@ -0,0 +1,10 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { lazy } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
+ export const ReactContext = lazy(() => import('./react-context'));
9
+ export const ReactSurface = lazy(() => import('./react-surface'));
10
+ export const DebugSettings = lazy(() => import('./settings'));
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Capabilities, contributes } from '@dxos/app-framework';
8
+ import { DevtoolsContextProvider } from '@dxos/devtools';
9
+
10
+ import { DEBUG_PLUGIN } from '../meta';
11
+
12
+ export default () =>
13
+ contributes(Capabilities.ReactContext, {
14
+ id: DEBUG_PLUGIN,
15
+ context: ({ children }) => <DevtoolsContextProvider>{children}</DevtoolsContextProvider>,
16
+ });