@dxos/plugin-debug 0.7.5-main.ff8607b → 0.7.5-staging.2ff1350

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/{DebugSpace-4JHYA7FG.mjs → DebugSpace-BTMTVZ6C.mjs} +2 -2
  2. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs +1238 -0
  3. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs.map +7 -0
  4. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs +533 -0
  5. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-UASI2CRI.mjs +72 -0
  7. package/dist/lib/browser/chunk-UASI2CRI.mjs.map +7 -0
  8. package/dist/lib/browser/index.mjs +44 -8
  9. package/dist/lib/browser/index.mjs.map +3 -3
  10. package/dist/lib/browser/meta.json +1 -1
  11. package/dist/lib/browser/react-context-TCD3MNIT.mjs +16 -0
  12. package/dist/lib/browser/react-context-TCD3MNIT.mjs.map +7 -0
  13. package/dist/lib/browser/{react-surface-VEEFOGIM.mjs → react-surface-W6QLG4YJ.mjs} +210 -40
  14. package/dist/lib/browser/react-surface-W6QLG4YJ.mjs.map +7 -0
  15. package/dist/lib/browser/{settings-OIMSBZUC.mjs → settings-INPXR64L.mjs} +5 -6
  16. package/dist/lib/browser/{settings-OIMSBZUC.mjs.map → settings-INPXR64L.mjs.map} +3 -3
  17. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  18. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  19. package/dist/types/src/capabilities/index.d.ts +5 -0
  20. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  21. package/dist/types/src/capabilities/react-context.d.ts +8 -0
  22. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  23. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  25. package/dist/types/src/components/Container.d.ts +2 -2
  26. package/dist/types/src/components/Container.d.ts.map +1 -1
  27. package/dist/types/src/components/DebugObjectPanel.d.ts +1 -2
  28. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  29. package/dist/types/src/components/DebugSettings.d.ts +1 -2
  30. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  31. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts +1 -2
  32. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +1 -1
  33. package/dist/types/src/components/DebugStatus.d.ts +1 -2
  34. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  35. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  36. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts +1 -2
  37. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +1 -1
  38. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -2
  39. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  40. package/dist/types/src/components/SpaceGenerator/presets.d.ts +22 -0
  41. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -0
  42. package/dist/types/src/components/Wireframe.d.ts +1 -2
  43. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  44. package/dist/types/src/components/index.d.ts +1 -1
  45. package/dist/types/src/components/index.d.ts.map +1 -1
  46. package/dist/types/src/translations.d.ts +28 -0
  47. package/dist/types/src/translations.d.ts.map +1 -1
  48. package/dist/types/src/types.d.ts +44 -1
  49. package/dist/types/src/types.d.ts.map +1 -1
  50. package/package.json +50 -44
  51. package/src/DebugPlugin.tsx +12 -4
  52. package/src/capabilities/app-graph-builder.ts +292 -89
  53. package/src/capabilities/index.ts +1 -0
  54. package/src/capabilities/react-context.tsx +16 -0
  55. package/src/capabilities/react-surface.tsx +204 -27
  56. package/src/capabilities/settings.ts +0 -1
  57. package/src/components/DebugObjectPanel.tsx +17 -5
  58. package/src/components/DebugSettings.tsx +0 -3
  59. package/src/components/SpaceGenerator/ObjectGenerator.tsx +31 -4
  60. package/src/components/SpaceGenerator/SpaceGenerator.tsx +75 -6
  61. package/src/components/SpaceGenerator/presets.ts +563 -0
  62. package/src/translations.ts +28 -0
  63. package/src/types.ts +52 -1
  64. package/dist/lib/browser/SpaceGenerator-NJCG57CU.mjs +0 -279
  65. package/dist/lib/browser/SpaceGenerator-NJCG57CU.mjs.map +0 -7
  66. package/dist/lib/browser/app-graph-builder-66ZVNTDI.mjs +0 -182
  67. package/dist/lib/browser/app-graph-builder-66ZVNTDI.mjs.map +0 -7
  68. package/dist/lib/browser/chunk-P7GHHMDB.mjs +0 -21
  69. package/dist/lib/browser/chunk-P7GHHMDB.mjs.map +0 -7
  70. package/dist/lib/browser/react-surface-VEEFOGIM.mjs.map +0 -7
  71. /package/dist/lib/browser/{DebugSpace-4JHYA7FG.mjs.map → DebugSpace-BTMTVZ6C.mjs.map} +0 -0
@@ -3,41 +3,307 @@
3
3
  //
4
4
 
5
5
  import { contributes, Capabilities, type PluginsContext } from '@dxos/app-framework';
6
- import { ClientCapabilities } from '@dxos/plugin-client';
7
6
  import { createExtension, toSignal, type Node } from '@dxos/plugin-graph';
8
- import { memoizeQuery } from '@dxos/plugin-space';
9
7
  import { CollectionType } from '@dxos/plugin-space/types';
10
- import { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';
8
+ import { SpaceState } from '@dxos/react-client/echo';
11
9
  import { isSpace, type Space } from '@dxos/react-client/echo';
12
10
 
13
11
  import { DEBUG_PLUGIN } from '../meta';
14
- import { type DebugSettingsProps } from '../types';
12
+ import { type DebugSettingsProps, Devtools } from '../types';
15
13
 
16
- export default (context: PluginsContext) => {
17
- const resolve = (typename: string) =>
18
- context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
14
+ const DEVTOOLS_TYPE = 'dxos.org/plugin/debug/devtools';
19
15
 
20
- return contributes(Capabilities.AppGraphBuilder, [
16
+ export default (context: PluginsContext) =>
17
+ contributes(Capabilities.AppGraphBuilder, [
21
18
  // Devtools node.
22
19
  createExtension({
23
20
  id: 'dxos.org/plugin/debug/devtools',
24
- filter: (node): node is Node<null> => {
25
- const settings = context
26
- .requestCapabilities(Capabilities.SettingsStore)[0]
27
- ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
28
- return !!settings?.devtools && node.id === 'root';
29
- },
21
+ filter: (node): node is Node<null> => node.id === 'root',
30
22
  connector: () => [
31
23
  {
32
- // TODO(zan): Removed `/` because it breaks deck layout reload. Fix?
33
- id: 'dxos.org.plugin.debug.devtools',
34
- data: 'devtools',
35
- type: 'dxos.org/plugin/debug/devtools',
24
+ id: Devtools.id,
25
+ data: null,
26
+ type: DEVTOOLS_TYPE,
36
27
  properties: {
37
28
  label: ['devtools label', { ns: DEBUG_PLUGIN }],
38
- disposition: 'navigation',
29
+ disposition: 'workspace',
39
30
  icon: 'ph--hammer--regular',
40
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
+ ],
41
307
  },
42
308
  ],
43
309
  }),
@@ -46,10 +312,12 @@ export default (context: PluginsContext) => {
46
312
  createExtension({
47
313
  id: 'dxos.org/plugin/debug/debug',
48
314
  filter: (node): node is Node<null> => {
49
- const settings = context
50
- .requestCapabilities(Capabilities.SettingsStore)[0]
51
- ?.getStore<DebugSettingsProps>(DEBUG_PLUGIN)?.value;
52
- return !!settings?.debug && node.id === 'root';
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;
53
321
  },
54
322
  connector: () => {
55
323
  const [graph] = context.requestCapabilities(Capabilities.AppGraph);
@@ -102,6 +370,7 @@ export default (context: PluginsContext) => {
102
370
 
103
371
  return [
104
372
  {
373
+ // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.
105
374
  id: `${space.id}-debug`, // TODO(burdon): Change to slashes consistently.
106
375
  type: 'dxos.org/plugin/debug/space',
107
376
  data: { space, type: 'dxos.org/plugin/debug/space' },
@@ -113,70 +382,4 @@ export default (context: PluginsContext) => {
113
382
  ];
114
383
  },
115
384
  }),
116
-
117
- // Create nodes for debug sidebar.
118
- createExtension({
119
- id: `${DEBUG_PLUGIN}/debug-for-subject`,
120
- resolver: ({ id }) => {
121
- // TODO(Zan): Find util (or make one).
122
- if (!id.endsWith('~debug')) {
123
- return;
124
- }
125
-
126
- const type = 'orphan-settings-for-subject';
127
- const icon = 'ph--bug--regular';
128
-
129
- const client = context.requestCapability(ClientCapabilities.Client);
130
- const [subjectId] = id.split('~');
131
- const { spaceId, objectId } = parseId(subjectId);
132
- const spaces = toSignal(
133
- (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
134
- () => client.spaces.get(),
135
- );
136
- const space = spaces?.find((space) => space.state.get() === SpaceState.SPACE_READY && space.id === spaceId);
137
- if (!objectId) {
138
- // TODO(burdon): Ref SPACE_PLUGIN ns.
139
- const label = space
140
- ? space.properties.name || ['unnamed space label', { ns: DEBUG_PLUGIN }]
141
- : ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
142
-
143
- // TODO(wittjosiah): Support comments for arbitrary subjects.
144
- // This is to ensure that the comments panel is not stuck on an old object.
145
- return {
146
- id,
147
- type,
148
- data: null,
149
- properties: {
150
- icon,
151
- label,
152
- showResolvedThreads: false,
153
- object: null,
154
- space,
155
- },
156
- };
157
- }
158
-
159
- const [object] = memoizeQuery(space, { id: objectId });
160
- if (!object || !subjectId) {
161
- return;
162
- }
163
-
164
- const meta = resolve(getTypename(object) ?? '');
165
- const label = meta.label?.(object) ||
166
- object.name ||
167
- meta.placeholder || ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
168
-
169
- return {
170
- id,
171
- type,
172
- data: null,
173
- properties: {
174
- icon,
175
- label,
176
- object,
177
- },
178
- };
179
- },
180
- }),
181
385
  ]);
182
- };
@@ -5,5 +5,6 @@
5
5
  import { lazy } from '@dxos/app-framework';
6
6
 
7
7
  export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
8
+ export const ReactContext = lazy(() => import('./react-context'));
8
9
  export const ReactSurface = lazy(() => import('./react-surface'));
9
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
+ });