@dxos/plugin-debug 0.7.5-main.9d2a38b → 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 (80) 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-EF3UVAVI.mjs +21 -0
  7. package/dist/lib/browser/chunk-EF3UVAVI.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-UASI2CRI.mjs +72 -0
  9. package/dist/lib/browser/chunk-UASI2CRI.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +40 -10
  11. package/dist/lib/browser/index.mjs.map +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/react-context-TCD3MNIT.mjs +16 -0
  14. package/dist/lib/browser/react-context-TCD3MNIT.mjs.map +7 -0
  15. package/dist/lib/browser/{react-surface-5GNO6NWP.mjs → react-surface-W6QLG4YJ.mjs} +258 -85
  16. package/dist/lib/browser/react-surface-W6QLG4YJ.mjs.map +7 -0
  17. package/dist/lib/browser/{settings-JCZUA643.mjs → settings-INPXR64L.mjs} +6 -7
  18. package/dist/lib/browser/{settings-JCZUA643.mjs.map → settings-INPXR64L.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 +110 -110
  21. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/index.d.ts +116 -116
  23. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  27. package/dist/types/src/components/Container.d.ts +2 -2
  28. package/dist/types/src/components/Container.d.ts.map +1 -1
  29. package/dist/types/src/components/DebugObjectPanel.d.ts +1 -2
  30. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  31. package/dist/types/src/components/DebugSettings.d.ts +1 -2
  32. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  33. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts +1 -2
  34. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +1 -1
  35. package/dist/types/src/components/DebugStatus.d.ts +1 -2
  36. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  37. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  38. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts +1 -2
  39. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +1 -1
  40. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -2
  41. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  42. package/dist/types/src/components/SpaceGenerator/presets.d.ts +22 -0
  43. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -0
  44. package/dist/types/src/components/Wireframe.d.ts +1 -2
  45. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  46. package/dist/types/src/components/index.d.ts +4 -4
  47. package/dist/types/src/components/index.d.ts.map +1 -1
  48. package/dist/types/src/meta.d.ts +1 -0
  49. package/dist/types/src/meta.d.ts.map +1 -1
  50. package/dist/types/src/translations.d.ts +28 -0
  51. package/dist/types/src/translations.d.ts.map +1 -1
  52. package/dist/types/src/types.d.ts +44 -1
  53. package/dist/types/src/types.d.ts.map +1 -1
  54. package/package.json +50 -43
  55. package/src/DebugPlugin.tsx +6 -3
  56. package/src/capabilities/app-graph-builder.ts +297 -89
  57. package/src/capabilities/react-context.tsx +3 -25
  58. package/src/capabilities/react-surface.tsx +202 -33
  59. package/src/capabilities/settings.ts +0 -1
  60. package/src/components/DebugObjectPanel.tsx +17 -5
  61. package/src/components/DebugSettings.tsx +7 -12
  62. package/src/components/DebugStatus.tsx +17 -21
  63. package/src/components/SpaceGenerator/ObjectGenerator.tsx +31 -4
  64. package/src/components/SpaceGenerator/SpaceGenerator.tsx +75 -6
  65. package/src/components/SpaceGenerator/presets.ts +563 -0
  66. package/src/meta.ts +3 -1
  67. package/src/translations.ts +28 -0
  68. package/src/types.ts +52 -1
  69. package/dist/lib/browser/SpaceGenerator-NJCG57CU.mjs +0 -279
  70. package/dist/lib/browser/SpaceGenerator-NJCG57CU.mjs.map +0 -7
  71. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs +0 -177
  72. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs.map +0 -7
  73. package/dist/lib/browser/chunk-I3ON45JK.mjs +0 -18
  74. package/dist/lib/browser/chunk-I3ON45JK.mjs.map +0 -7
  75. package/dist/lib/browser/chunk-P7GHHMDB.mjs +0 -21
  76. package/dist/lib/browser/chunk-P7GHHMDB.mjs.map +0 -7
  77. package/dist/lib/browser/react-context-OZU6J7G3.mjs +0 -37
  78. package/dist/lib/browser/react-context-OZU6J7G3.mjs.map +0 -7
  79. package/dist/lib/browser/react-surface-5GNO6NWP.mjs.map +0 -7
  80. /package/dist/lib/browser/{DebugSpace-4JHYA7FG.mjs.map → DebugSpace-BTMTVZ6C.mjs.map} +0 -0
@@ -2,37 +2,15 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import React, { useEffect, useState } from 'react';
5
+ import React from 'react';
6
6
 
7
7
  import { Capabilities, contributes } from '@dxos/app-framework';
8
- import { Timer } from '@dxos/async';
8
+ import { DevtoolsContextProvider } from '@dxos/devtools';
9
9
 
10
10
  import { DEBUG_PLUGIN } from '../meta';
11
- import { DebugContext } from '../types';
12
11
 
13
12
  export default () =>
14
13
  contributes(Capabilities.ReactContext, {
15
14
  id: DEBUG_PLUGIN,
16
- context: ({ children }) => {
17
- const [timer, setTimer] = useState<Timer>();
18
- useEffect(() => timer?.state.on((value) => !value && setTimer(undefined)), [timer]);
19
- useEffect(() => {
20
- timer?.stop();
21
- }, []);
22
-
23
- return (
24
- <DebugContext.Provider
25
- value={{
26
- running: !!timer,
27
- start: (cb, options) => {
28
- timer?.stop();
29
- setTimer(new Timer(cb).start(options));
30
- },
31
- stop: () => timer?.stop(),
32
- }}
33
- >
34
- {children}
35
- </DebugContext.Provider>
36
- );
37
- },
15
+ context: ({ children }) => <DevtoolsContextProvider>{children}</DevtoolsContextProvider>,
38
16
  });
@@ -9,10 +9,35 @@ import {
9
9
  contributes,
10
10
  createIntent,
11
11
  createSurface,
12
- useCapability,
12
+ LayoutAction,
13
13
  type PluginsContext,
14
14
  } from '@dxos/app-framework';
15
- import { Devtools } from '@dxos/devtools';
15
+ import {
16
+ ConfigPanel,
17
+ CredentialsPanel,
18
+ DeviceListPanel,
19
+ DiagnosticsPanel,
20
+ FeedsPanel,
21
+ IdentityPanel,
22
+ KeyringPanel,
23
+ LoggingPanel,
24
+ MembersPanel,
25
+ MetadataPanel,
26
+ NetworkPanel,
27
+ ObjectsPanel,
28
+ SignalPanel,
29
+ SpaceInfoPanel,
30
+ SpaceListPanel,
31
+ StoragePanel,
32
+ SwarmPanel,
33
+ TracingPanel,
34
+ DashboardPanel,
35
+ EdgeDashboardPanel,
36
+ SearchPanel,
37
+ AutomergePanel,
38
+ WorkflowPanel,
39
+ } from '@dxos/devtools';
40
+ import { SettingsStore } from '@dxos/local-storage';
16
41
  import { Graph } from '@dxos/plugin-graph';
17
42
  import { SpaceAction, CollectionType } from '@dxos/plugin-space/types';
18
43
  import {
@@ -34,7 +59,7 @@ import {
34
59
  Wireframe,
35
60
  } from '../components';
36
61
  import { DEBUG_PLUGIN } from '../meta';
37
- import { type DebugSettingsProps } from '../types';
62
+ import { type DebugSettingsProps, Devtools } from '../types';
38
63
 
39
64
  type SpaceDebug = {
40
65
  type: string;
@@ -45,41 +70,17 @@ type GraphDebug = {
45
70
  graph: Graph;
46
71
  };
47
72
 
48
- const isSpaceDebug = (data: any): data is SpaceDebug => data.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
49
- const isGraphDebug = (data: any): data is GraphDebug => data.graph instanceof Graph;
73
+ const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
74
+ const isGraphDebug = (data: any): data is GraphDebug => data?.graph instanceof Graph;
50
75
 
51
76
  export default (context: PluginsContext) =>
52
77
  contributes(Capabilities.ReactSurface, [
53
78
  createSurface({
54
79
  id: `${DEBUG_PLUGIN}/settings`,
55
- role: 'settings',
56
- filter: (data): data is any => data.subject === DEBUG_PLUGIN,
57
- component: () => {
58
- const settings = useCapability(Capabilities.SettingsStore).getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;
59
- return <DebugSettings settings={settings} />;
60
- },
61
- }),
62
- createSurface({
63
- id: `${DEBUG_PLUGIN}/status`,
64
- role: 'status',
65
- component: () => <DebugStatus />,
66
- }),
67
- createSurface({
68
- id: `${DEBUG_PLUGIN}/complementary`,
69
- role: 'complementary--debug',
70
- filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
71
- component: ({ data }) => <DebugObjectPanel object={data.subject} />,
72
- }),
73
- createSurface({
74
- id: `${DEBUG_PLUGIN}/devtools`,
75
80
  role: 'article',
76
- filter: (data): data is any => {
77
- const settings = context
78
- .requestCapability(Capabilities.SettingsStore)
79
- .getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;
80
- return data.subject === 'devtools' && !!settings.devtools;
81
- },
82
- component: () => <Devtools />,
81
+ filter: (data): data is { subject: SettingsStore<DebugSettingsProps> } =>
82
+ data.subject instanceof SettingsStore && data.subject.prefix === DEBUG_PLUGIN,
83
+ component: ({ data: { subject } }) => <DebugSettings settings={subject.value} />,
83
84
  }),
84
85
  createSurface({
85
86
  id: `${DEBUG_PLUGIN}/space`,
@@ -124,7 +125,7 @@ export default (context: PluginsContext) =>
124
125
  createSurface({
125
126
  id: `${DEBUG_PLUGIN}/wireframe`,
126
127
  role: ['article', 'section'],
127
- disposition: 'hoist',
128
+ position: 'hoist',
128
129
  filter: (data): data is { subject: ReactiveEchoObject<any> } => {
129
130
  const settings = context
130
131
  .requestCapability(Capabilities.SettingsStore)
@@ -135,4 +136,172 @@ export default (context: PluginsContext) =>
135
136
  <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
136
137
  ),
137
138
  }),
139
+ createSurface({
140
+ id: `${DEBUG_PLUGIN}/complementary`,
141
+ role: 'complementary--debug',
142
+ filter: (data): data is { subject: ReactiveEchoObject<any> } => isEchoObject(data.subject),
143
+ component: ({ data }) => <DebugObjectPanel object={data.subject} />,
144
+ }),
145
+ createSurface({
146
+ id: `${DEBUG_PLUGIN}/status`,
147
+ role: 'status',
148
+ component: () => <DebugStatus />,
149
+ }),
150
+
151
+ //
152
+ // Devtools
153
+ //
154
+
155
+ createSurface({
156
+ id: `${DEBUG_PLUGIN}/client/config`,
157
+ role: 'article',
158
+ filter: (data): data is any => data.subject === Devtools.Client.Config,
159
+ component: () => <ConfigPanel />,
160
+ }),
161
+ createSurface({
162
+ id: `${DEBUG_PLUGIN}/client/storage`,
163
+ role: 'article',
164
+ filter: (data): data is any => data.subject === Devtools.Client.Storage,
165
+ component: () => <StoragePanel />,
166
+ }),
167
+ createSurface({
168
+ id: `${DEBUG_PLUGIN}/client/logs`,
169
+ role: 'article',
170
+ filter: (data): data is any => data.subject === Devtools.Client.Logs,
171
+ component: () => <LoggingPanel />,
172
+ }),
173
+ createSurface({
174
+ id: `${DEBUG_PLUGIN}/client/diagnostics`,
175
+ role: 'article',
176
+ filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
177
+ component: () => <DiagnosticsPanel />,
178
+ }),
179
+ createSurface({
180
+ id: `${DEBUG_PLUGIN}/client/tracing`,
181
+ role: 'article',
182
+ filter: (data): data is any => data.subject === Devtools.Client.Tracing,
183
+ component: () => <TracingPanel />,
184
+ }),
185
+ createSurface({
186
+ id: `${DEBUG_PLUGIN}/halo/identity`,
187
+ role: 'article',
188
+ filter: (data): data is any => data.subject === Devtools.Halo.Identity,
189
+ component: () => <IdentityPanel />,
190
+ }),
191
+ createSurface({
192
+ id: `${DEBUG_PLUGIN}/halo/devices`,
193
+ role: 'article',
194
+ filter: (data): data is any => data.subject === Devtools.Halo.Devices,
195
+ component: () => <DeviceListPanel />,
196
+ }),
197
+ createSurface({
198
+ id: `${DEBUG_PLUGIN}/halo/keyring`,
199
+ role: 'article',
200
+ filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
201
+ component: () => <KeyringPanel />,
202
+ }),
203
+ createSurface({
204
+ id: `${DEBUG_PLUGIN}/halo/credentials`,
205
+ role: 'article',
206
+ filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
207
+ component: () => <CredentialsPanel />,
208
+ }),
209
+ createSurface({
210
+ id: `${DEBUG_PLUGIN}/echo/spaces`,
211
+ role: 'article',
212
+ filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
213
+ component: () => {
214
+ const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
215
+ const handleSelect = useCallback(
216
+ () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Space] })),
217
+ [dispatch],
218
+ );
219
+ return <SpaceListPanel onSelect={handleSelect} />;
220
+ },
221
+ }),
222
+ createSurface({
223
+ id: `${DEBUG_PLUGIN}/echo/space`,
224
+ role: 'article',
225
+ filter: (data): data is any => data.subject === Devtools.Echo.Space,
226
+ component: () => {
227
+ const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
228
+ const handleSelect = useCallback(
229
+ () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Feeds] })),
230
+ [dispatch],
231
+ );
232
+ return <SpaceInfoPanel onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
233
+ },
234
+ }),
235
+ createSurface({
236
+ id: `${DEBUG_PLUGIN}/echo/feeds`,
237
+ role: 'article',
238
+ filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
239
+ component: () => <FeedsPanel />,
240
+ }),
241
+ createSurface({
242
+ id: `${DEBUG_PLUGIN}/echo/objects`,
243
+ role: 'article',
244
+ filter: (data): data is any => data.subject === Devtools.Echo.Objects,
245
+ component: () => <ObjectsPanel />,
246
+ }),
247
+ createSurface({
248
+ id: `${DEBUG_PLUGIN}/echo/automerge`,
249
+ role: 'article',
250
+ filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
251
+ component: () => <AutomergePanel />,
252
+ }),
253
+ createSurface({
254
+ id: `${DEBUG_PLUGIN}/echo/members`,
255
+ role: 'article',
256
+ filter: (data): data is any => data.subject === Devtools.Echo.Members,
257
+ component: () => <MembersPanel />,
258
+ }),
259
+ createSurface({
260
+ id: `${DEBUG_PLUGIN}/echo/metadata`,
261
+ role: 'article',
262
+ filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
263
+ component: () => <MetadataPanel />,
264
+ }),
265
+ createSurface({
266
+ id: `${DEBUG_PLUGIN}/mesh/signal`,
267
+ role: 'article',
268
+ filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
269
+ component: () => <SignalPanel />,
270
+ }),
271
+ createSurface({
272
+ id: `${DEBUG_PLUGIN}/mesh/swarm`,
273
+ role: 'article',
274
+ filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
275
+ component: () => <SwarmPanel />,
276
+ }),
277
+ createSurface({
278
+ id: `${DEBUG_PLUGIN}/mesh/network`,
279
+ role: 'article',
280
+ filter: (data): data is any => data.subject === Devtools.Mesh.Network,
281
+ component: () => <NetworkPanel />,
282
+ }),
283
+ createSurface({
284
+ id: `${DEBUG_PLUGIN}/agent/dashboard`,
285
+ role: 'article',
286
+ filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
287
+ component: () => <DashboardPanel />,
288
+ }),
289
+ createSurface({
290
+ id: `${DEBUG_PLUGIN}/agent/search`,
291
+ role: 'article',
292
+ filter: (data): data is any => data.subject === Devtools.Agent.Search,
293
+ component: () => <SearchPanel />,
294
+ }),
295
+ createSurface({
296
+ id: `${DEBUG_PLUGIN}/edge/dashboard`,
297
+ role: 'article',
298
+ filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
299
+ component: () => <EdgeDashboardPanel />,
300
+ }),
301
+ createSurface({
302
+ id: `${DEBUG_PLUGIN}/edge/workflows`,
303
+ role: 'article',
304
+ filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
305
+ component: () => <WorkflowPanel />,
306
+ }),
138
307
  ]);
@@ -11,7 +11,6 @@ import { type DebugSettingsProps, DebugSettingsSchema } from '../types';
11
11
  export default () => {
12
12
  const settings = create<DebugSettingsProps>({
13
13
  debug: true,
14
- devtools: true,
15
14
  });
16
15
 
17
16
  return contributes(Capabilities.Settings, { schema: DebugSettingsSchema, prefix: DEBUG_PLUGIN, value: settings });
@@ -5,6 +5,7 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { type ReactiveEchoObject } from '@dxos/client/echo';
8
+ import { Clipboard, Input } from '@dxos/react-ui';
8
9
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
9
10
 
10
11
  export type DebugObjectPanelProps = {
@@ -13,11 +14,22 @@ export type DebugObjectPanelProps = {
13
14
 
14
15
  // TODO(burdon): Get schema and traverse references.
15
16
  export const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {
17
+ const dxn = `dxn:echo:@:${object.id}`;
16
18
  return (
17
- <div className='flex flex-col'>
18
- <SyntaxHighlighter classNames='flex text-xs' language='json'>
19
- {JSON.stringify(object, null, 2)}
20
- </SyntaxHighlighter>
21
- </div>
19
+ <Clipboard.Provider>
20
+ <div className='flex flex-col'>
21
+ <Input.Root>
22
+ <div role='none' className='flex flex-col gap-1'>
23
+ <div role='none' className='flex gap-1'>
24
+ <Input.TextInput disabled value={dxn} />
25
+ <Clipboard.IconButton value={dxn} />
26
+ </div>
27
+ </div>
28
+ </Input.Root>
29
+ <SyntaxHighlighter classNames='flex text-xs' language='json'>
30
+ {JSON.stringify(object, null, 2)}
31
+ </SyntaxHighlighter>
32
+ </div>
33
+ </Clipboard.Provider>
22
34
  );
23
35
  };
@@ -2,16 +2,14 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Gift, DownloadSimple, FirstAidKit } from '@phosphor-icons/react';
6
5
  import React, { useEffect, useState } from 'react';
7
6
 
8
7
  import { Capabilities, useCapabilities } from '@dxos/app-framework';
9
8
  import { type ConfigProto, defs, SaveConfig, Storage } from '@dxos/config';
10
9
  import { log } from '@dxos/log';
11
10
  import { useClient } from '@dxos/react-client';
12
- import { useTranslation, Button, Toast, Input, useFileDownload, Select } from '@dxos/react-ui';
13
- import { DeprecatedFormInput } from '@dxos/react-ui-form';
14
- import { getSize, mx } from '@dxos/react-ui-theme';
11
+ import { useTranslation, Button, Toast, Input, useFileDownload, Select, Icon } from '@dxos/react-ui';
12
+ import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
15
13
  import { setDeep } from '@dxos/util';
16
14
 
17
15
  import { DEBUG_PLUGIN } from '../meta';
@@ -79,24 +77,21 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
79
77
  };
80
78
 
81
79
  return (
82
- <>
80
+ <DeprecatedFormContainer>
83
81
  <DeprecatedFormInput label={t('settings show debug panel')}>
84
82
  <Input.Switch checked={settings.debug} onCheckedChange={(checked) => (settings.debug = !!checked)} />
85
83
  </DeprecatedFormInput>
86
- <DeprecatedFormInput label={t('settings show devtools panel')}>
87
- <Input.Switch checked={settings.devtools} onCheckedChange={(checked) => (settings.devtools = !!checked)} />
88
- </DeprecatedFormInput>
89
84
  <DeprecatedFormInput label={t('settings wireframe')}>
90
85
  <Input.Switch checked={settings.wireframe} onCheckedChange={(checked) => (settings.wireframe = !!checked)} />
91
86
  </DeprecatedFormInput>
92
87
  <DeprecatedFormInput label={t('settings download diagnostics')}>
93
88
  <Button onClick={handleDownload}>
94
- <DownloadSimple className={getSize(5)} />
89
+ <Icon icon='ph--download-simple--regular' size={5} />
95
90
  </Button>
96
91
  </DeprecatedFormInput>
97
92
  <DeprecatedFormInput label={t('settings repair')}>
98
93
  <Button onClick={handleRepair}>
99
- <FirstAidKit className={getSize(5)} />
94
+ <Icon icon='ph--first-aid-kit--regular' size={5} />
100
95
  </Button>
101
96
  </DeprecatedFormInput>
102
97
 
@@ -105,7 +100,7 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
105
100
  <Toast.Root>
106
101
  <Toast.Body>
107
102
  <Toast.Title>
108
- <Gift className={mx(getSize(5), 'inline mr-1')} weight='duotone' />
103
+ <Icon icon='ph--gift--duotone' size={5} classNames='inline mr-1' />
109
104
  <span>{toast.title}</span>
110
105
  </Toast.Title>
111
106
  {toast.description && <Toast.Description>{toast.description}</Toast.Description>}
@@ -145,7 +140,7 @@ export const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) =>
145
140
  </Select.Portal>
146
141
  </Select.Root>
147
142
  </DeprecatedFormInput>
148
- </>
143
+ </DeprecatedFormContainer>
149
144
  );
150
145
  };
151
146
 
@@ -4,15 +4,14 @@
4
4
 
5
5
  import React, { useEffect, useRef, useState } from 'react';
6
6
 
7
- import { Capabilities, firstIdInPart, useCapability } from '@dxos/app-framework';
7
+ import { useAppGraph, useLayout } from '@dxos/app-framework';
8
8
  import { TimeoutError } from '@dxos/async';
9
9
  import { StatsPanel, useStats } from '@dxos/devtools';
10
10
  import { getActiveSpace } from '@dxos/plugin-space';
11
11
  import { StatusBar } from '@dxos/plugin-status-bar';
12
12
  import { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';
13
13
  import { useNetworkStatus } from '@dxos/react-client/mesh';
14
- import { Icon } from '@dxos/react-ui';
15
- import { mx } from '@dxos/react-ui-theme';
14
+ import { Icon, Popover } from '@dxos/react-ui';
16
15
 
17
16
  const styles = {
18
17
  success: 'text-sky-300 dark:text-green-700',
@@ -136,9 +135,9 @@ const SwarmIndicator = () => {
136
135
  // TODO(burdon): Merge with SaveStatus.
137
136
  const SavingIndicator = () => {
138
137
  const [state, _setState] = useState(0);
139
- const location = useCapability(Capabilities.Location);
140
- const { graph } = useCapability(Capabilities.AppGraph);
141
- const _space = location && graph ? getActiveSpace(graph, firstIdInPart(location.active, 'main')) : undefined;
138
+ const layout = useLayout();
139
+ const { graph } = useAppGraph();
140
+ const _space = graph ? getActiveSpace(graph, layout.active[0]) : undefined;
142
141
  // TODO(dmaretskyi): Fix this when we have save status for automerge.
143
142
  // useEffect(() => {
144
143
  // if (!space) {
@@ -186,22 +185,19 @@ const PerformanceIndicator = () => {
186
185
  const [stats, refreshStats] = useStats();
187
186
 
188
187
  return (
189
- <>
190
- <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>
191
- <Icon icon='ph--chart-bar--regular' size={4} />
192
- </StatusBar.Button>
193
- {visible && (
194
- <div
195
- className={mx(
196
- 'z-20 absolute bottom-[--statusbar-size] right-4 w-[450px]',
197
- 'overflow-x-hidden overflow-y-auto scrollbar-thin',
198
- 'border-x border-y border-separator',
199
- )}
200
- >
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]'>
201
196
  <StatsPanel stats={stats} onRefresh={refreshStats} />
202
- </div>
203
- )}
204
- </>
197
+ <Popover.Arrow />
198
+ </Popover.Content>
199
+ </Popover.Portal>
200
+ </Popover.Root>
205
201
  );
206
202
  };
207
203
 
@@ -3,7 +3,9 @@
3
3
  //
4
4
 
5
5
  import { addressToA1Notation } from '@dxos/compute';
6
- import { type BaseObject, type TypedObject } from '@dxos/echo-schema';
6
+ import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
7
+ import { ObjectId, type BaseObject, type TypedObject } from '@dxos/echo-schema';
8
+ import { DXN } from '@dxos/keys';
7
9
  import { create, makeRef, type ReactiveObject } from '@dxos/live-object';
8
10
  import { DocumentType } from '@dxos/plugin-markdown/types';
9
11
  import { createSheet } from '@dxos/plugin-sheet/types';
@@ -37,15 +39,13 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
37
39
  DocumentType.typename,
38
40
  async (space, n, cb) => {
39
41
  const objects = range(n).map(() => {
40
- const obj = space.db.add(
42
+ return space.db.add(
41
43
  create(DocumentType, {
42
44
  name: faker.commerce.productName(),
43
45
  content: makeRef(create(TextType, { content: faker.lorem.sentences(5) })),
44
46
  threads: [],
45
47
  }),
46
48
  );
47
-
48
- return obj;
49
49
  });
50
50
 
51
51
  cb?.(objects);
@@ -109,6 +109,33 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
109
109
  return objects;
110
110
  },
111
111
  ],
112
+ [
113
+ ComputeGraph.typename,
114
+ async (space, n, cb) => {
115
+ const objects = range(n, () => {
116
+ const model = ComputeGraphModel.create();
117
+ model.builder
118
+ .createNode({ id: 'gpt-INPUT', type: NODE_INPUT })
119
+ .createNode({ id: 'gpt-GPT', type: 'gpt' })
120
+ .createNode({
121
+ id: 'gpt-QUEUE_ID',
122
+ type: 'constant',
123
+ value: new DXN(DXN.kind.QUEUE, ['data', space.id, ObjectId.random()]).toString(),
124
+ })
125
+ .createNode({ id: 'gpt-APPEND', type: 'append' })
126
+ .createNode({ id: 'gpt-OUTPUT', type: NODE_OUTPUT })
127
+ .createEdge({ node: 'gpt-INPUT', property: 'prompt' }, { node: 'gpt-GPT', property: 'prompt' })
128
+ .createEdge({ node: 'gpt-GPT', property: 'text' }, { node: 'gpt-OUTPUT', property: 'text' })
129
+ .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-APPEND', property: 'id' })
130
+ .createEdge({ node: 'gpt-GPT', property: 'messages' }, { node: 'gpt-APPEND', property: 'items' })
131
+ .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-OUTPUT', property: 'queue' });
132
+
133
+ return space.db.add(model.root);
134
+ });
135
+ cb?.(objects);
136
+ return objects;
137
+ },
138
+ ],
112
139
  ]);
113
140
 
114
141
  export const createGenerator = <T extends BaseObject>(type: TypedObject<T>): ObjectGenerator<T> => {