@dxos/plugin-debug 0.8.4-main.67995b8 → 0.8.4-main.6fa680abb7

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 (197) hide show
  1. package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs +16 -0
  2. package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +7 -0
  3. package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs +33 -0
  4. package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs.map +7 -0
  5. package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs +174 -0
  6. package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs.map +7 -0
  7. package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs +45 -0
  8. package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs.map +7 -0
  9. package/dist/lib/browser/DebugStatus-COQGH37G.mjs +125 -0
  10. package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +7 -0
  11. package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs +20 -0
  12. package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +7 -0
  13. package/dist/lib/browser/{SpaceGenerator-6ZOCEREN.mjs → SpaceGenerator-Q2GH6S6D.mjs} +577 -380
  14. package/dist/lib/browser/SpaceGenerator-Q2GH6S6D.mjs.map +7 -0
  15. package/dist/lib/browser/Wireframe-KAGOKEFW.mjs +53 -0
  16. package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +7 -0
  17. package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs +593 -0
  18. package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-AJA6RYN3.mjs → chunk-Q37TZWW5.mjs} +13 -3
  20. package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-ZOM2FBHQ.mjs +20 -0
  22. package/dist/lib/browser/chunk-ZOM2FBHQ.mjs.map +7 -0
  23. package/dist/lib/browser/index.mjs +43 -41
  24. package/dist/lib/browser/index.mjs.map +4 -4
  25. package/dist/lib/browser/meta.json +1 -1
  26. package/dist/lib/browser/react-context-5ENRJEB2.mjs +17 -0
  27. package/dist/lib/browser/react-context-5ENRJEB2.mjs.map +7 -0
  28. package/dist/lib/browser/react-surface-5QQRQ2DT.mjs +427 -0
  29. package/dist/lib/browser/react-surface-5QQRQ2DT.mjs.map +7 -0
  30. package/dist/lib/browser/settings-XXFUM3QJ.mjs +32 -0
  31. package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
  32. package/dist/types/src/DebugPlugin.d.ts +7 -1
  33. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  34. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  35. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  36. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  37. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/index.d.ts +4 -8
  39. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  40. package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
  41. package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
  42. package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
  43. package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
  45. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
  47. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/settings/index.d.ts +3 -0
  49. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  50. package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
  51. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  52. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
  53. package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
  54. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
  55. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +5 -5
  56. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  57. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  58. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  59. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  60. package/dist/types/src/components/SpaceGenerator/presets.d.ts +4 -4
  61. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  62. package/dist/types/src/components/index.d.ts +2 -9
  63. package/dist/types/src/components/index.d.ts.map +1 -1
  64. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  65. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  66. package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
  67. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  68. package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +2 -2
  69. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  70. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
  71. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  72. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +10 -0
  73. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
  74. package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
  75. package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -0
  76. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
  77. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  78. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -0
  79. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  80. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  81. package/dist/types/src/containers/DebugStatus/index.d.ts +3 -0
  82. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  83. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  84. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  85. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +3 -0
  86. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  87. package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts +2 -2
  88. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  89. package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -0
  90. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  91. package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
  92. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  93. package/dist/types/src/containers/Wireframe/index.d.ts +3 -0
  94. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  95. package/dist/types/src/containers/index.d.ts +10 -0
  96. package/dist/types/src/containers/index.d.ts.map +1 -0
  97. package/dist/types/src/meta.d.ts +2 -3
  98. package/dist/types/src/meta.d.ts.map +1 -1
  99. package/dist/types/src/translations.d.ts +5 -1
  100. package/dist/types/src/translations.d.ts.map +1 -1
  101. package/dist/types/src/types.d.ts +40 -35
  102. package/dist/types/src/types.d.ts.map +1 -1
  103. package/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +77 -69
  105. package/src/DebugPlugin.tsx +27 -32
  106. package/src/capabilities/app-graph-builder/app-graph-builder.ts +419 -0
  107. package/src/capabilities/app-graph-builder/index.ts +7 -0
  108. package/src/capabilities/index.ts +4 -6
  109. package/src/capabilities/react-context/index.ts +7 -0
  110. package/src/capabilities/react-context/react-context.tsx +20 -0
  111. package/src/capabilities/react-surface/index.ts +7 -0
  112. package/src/capabilities/react-surface/react-surface.tsx +413 -0
  113. package/src/capabilities/settings/index.ts +7 -0
  114. package/src/capabilities/settings/settings.ts +31 -0
  115. package/src/components/SchemaTable/index.ts +5 -0
  116. package/src/components/SpaceGenerator/ObjectGenerator.tsx +28 -36
  117. package/src/components/SpaceGenerator/draw-util.ts +5 -5
  118. package/src/components/SpaceGenerator/index.ts +2 -3
  119. package/src/components/SpaceGenerator/presets.ts +339 -53
  120. package/src/components/index.ts +2 -10
  121. package/src/containers/DebugGraph/DebugGraph.tsx +13 -0
  122. package/src/containers/DebugGraph/index.ts +7 -0
  123. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +45 -0
  124. package/src/containers/DebugObjectPanel/index.ts +7 -0
  125. package/src/containers/DebugSettings/DebugSettings.tsx +201 -0
  126. package/src/containers/DebugSettings/index.ts +7 -0
  127. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
  128. package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
  129. package/src/{components → containers/DebugStatus}/DebugStatus.tsx +2 -2
  130. package/src/containers/DebugStatus/index.ts +7 -0
  131. package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +2 -4
  132. package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
  133. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +127 -0
  134. package/src/containers/SpaceGenerator/index.ts +7 -0
  135. package/src/{components → containers/Wireframe}/Wireframe.tsx +7 -7
  136. package/src/containers/Wireframe/index.ts +7 -0
  137. package/src/containers/index.ts +14 -0
  138. package/src/meta.ts +8 -7
  139. package/src/translations.ts +5 -1
  140. package/src/types.ts +10 -3
  141. package/dist/lib/browser/DebugApp-ZDL4CPY5.mjs +0 -228
  142. package/dist/lib/browser/DebugApp-ZDL4CPY5.mjs.map +0 -7
  143. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs +0 -25
  144. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs.map +0 -7
  145. package/dist/lib/browser/SpaceGenerator-6ZOCEREN.mjs.map +0 -7
  146. package/dist/lib/browser/app-graph-builder-SQXFD2BL.mjs +0 -597
  147. package/dist/lib/browser/app-graph-builder-SQXFD2BL.mjs.map +0 -7
  148. package/dist/lib/browser/chunk-5XPIRNQS.mjs +0 -18
  149. package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
  151. package/dist/lib/browser/react-context-NVAGLAJD.mjs +0 -16
  152. package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
  153. package/dist/lib/browser/react-surface-CHHHE5CF.mjs +0 -768
  154. package/dist/lib/browser/react-surface-CHHHE5CF.mjs.map +0 -7
  155. package/dist/lib/browser/settings-LSSWLM5I.mjs +0 -22
  156. package/dist/lib/browser/settings-LSSWLM5I.mjs.map +0 -7
  157. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  158. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  159. package/dist/types/src/capabilities/react-context.d.ts +0 -8
  160. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  161. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  162. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  163. package/dist/types/src/capabilities/settings.d.ts +0 -4
  164. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  165. package/dist/types/src/components/Container.d.ts +0 -5
  166. package/dist/types/src/components/Container.d.ts.map +0 -1
  167. package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
  168. package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
  169. package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
  170. package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
  171. package/dist/types/src/components/DebugApp/index.d.ts +0 -3
  172. package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
  173. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  174. package/dist/types/src/components/DebugSettings.d.ts +0 -6
  175. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  176. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  177. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  178. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  179. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
  180. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -6
  181. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  182. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  183. package/src/capabilities/app-graph-builder.ts +0 -457
  184. package/src/capabilities/react-context.tsx +0 -16
  185. package/src/capabilities/react-surface.tsx +0 -397
  186. package/src/capabilities/settings.ts +0 -19
  187. package/src/components/Container.tsx +0 -15
  188. package/src/components/DebugApp/DebugApp.tsx +0 -84
  189. package/src/components/DebugApp/Tree.tsx +0 -103
  190. package/src/components/DebugApp/index.ts +0 -7
  191. package/src/components/DebugObjectPanel.tsx +0 -35
  192. package/src/components/DebugSettings.tsx +0 -151
  193. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
  194. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
  195. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  196. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  197. /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
@@ -2,9 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
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'));
5
+ export * from './app-graph-builder';
6
+ export * from './react-context';
7
+ export * from './react-surface';
8
+ export * from './settings';
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactContext = Capability.lazy('ReactContext', () => import('./react-context'));
@@ -0,0 +1,20 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { DevtoolsContextProvider } from '@dxos/devtools';
10
+
11
+ import { meta } from '../../meta';
12
+
13
+ export default Capability.makeModule(() =>
14
+ Effect.succeed(
15
+ Capability.contributes(Capabilities.ReactContext, {
16
+ id: meta.id,
17
+ context: ({ children }) => <DevtoolsContextProvider>{children}</DevtoolsContextProvider>,
18
+ }),
19
+ ),
20
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -0,0 +1,413 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React, { useCallback } from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface, useCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
10
+ import { AppCapabilities, LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
11
+
12
+ import {
13
+ AutomergePanel,
14
+ ConfigPanel,
15
+ CredentialsPanel,
16
+ DeviceListPanel,
17
+ DiagnosticsPanel,
18
+ EdgeDashboardPanel,
19
+ FeedsPanel,
20
+ IdentityPanel,
21
+ InvocationTraceContainer,
22
+ KeyringPanel,
23
+ LoggingPanel,
24
+ MembersPanel,
25
+ MetadataPanel,
26
+ NetworkPanel,
27
+ ObjectsPanel,
28
+ QueuesPanel,
29
+ SchemaPanel,
30
+ SignalPanel,
31
+ SpaceInfoPanel,
32
+ SpaceListPanel,
33
+ StoragePanel,
34
+ SwarmPanel,
35
+ TestingPanel,
36
+ TracingPanel,
37
+ WorkflowPanel,
38
+ } from '@dxos/devtools';
39
+ import { Obj } from '@dxos/echo';
40
+ import { Collection } from '@dxos/echo';
41
+ import { type LogBuffer } from '@dxos/log';
42
+ import { log } from '@dxos/log';
43
+
44
+ import { type Graph } from '@dxos/plugin-graph';
45
+ import { ScriptOperation } from '@dxos/plugin-script/types';
46
+ import { SpaceOperation } from '@dxos/plugin-space/types';
47
+ import { useActiveSpace } from '@dxos/plugin-space';
48
+ import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
49
+ import { Panel } from '@dxos/react-ui';
50
+
51
+ import {
52
+ DebugGraph,
53
+ DebugObjectPanel,
54
+ DebugSettings,
55
+ DebugSpaceObjectsPanel,
56
+ DebugStatus,
57
+ DevtoolsOverviewContainer,
58
+ SpaceGenerator,
59
+ Wireframe,
60
+ } from '../../containers';
61
+ import { meta } from '../../meta';
62
+ import { DebugCapabilities, type DebugSettingsProps, Devtools } from '../../types';
63
+
64
+ type SpaceDebug = {
65
+ type: string;
66
+ space: Space;
67
+ };
68
+
69
+ type GraphDebug = {
70
+ graph: Graph.Graph;
71
+ root: string;
72
+ };
73
+
74
+ const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}.space` && isSpace(data.space);
75
+ const isGraphDebug = (data: any): data is GraphDebug => {
76
+ const graph = data?.graph;
77
+ return (
78
+ graph != null && typeof graph === 'object' && typeof graph.json === 'function' && typeof data?.root === 'string'
79
+ );
80
+ };
81
+
82
+ const useCurrentSpace = useActiveSpace;
83
+
84
+ type ReactSurfaceOptions = {
85
+ logBuffer: LogBuffer;
86
+ };
87
+
88
+ export default Capability.makeModule(
89
+ Effect.fnUntraced(function* ({ logBuffer }: ReactSurfaceOptions) {
90
+ const capabilities = yield* Capability.Service;
91
+ const registry = capabilities.get(Capabilities.AtomRegistry);
92
+ const settingsAtom = capabilities.get(DebugCapabilities.Settings);
93
+
94
+ return Capability.contributes(Capabilities.ReactSurface, [
95
+ Surface.create({
96
+ id: `${meta.id}.plugin-settings`,
97
+ role: 'article',
98
+ filter: (data): data is { subject: AppCapabilities.Settings } =>
99
+ AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
100
+ component: ({ data: { subject } }) => {
101
+ const { settings, updateSettings } = useSettingsState<DebugSettingsProps>(subject.atom);
102
+ return <DebugSettings settings={settings} onSettingsChange={updateSettings} logBuffer={logBuffer} />;
103
+ },
104
+ }),
105
+ Surface.create({
106
+ id: `${meta.id}.space`,
107
+ role: 'article',
108
+ filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
109
+ component: ({ role, data }) => {
110
+ const { invokePromise } = useOperationInvoker();
111
+
112
+ const handleCreateObject = useCallback(
113
+ (objects: Obj.Unknown[]) => {
114
+ if (!isSpace(data.subject.space)) {
115
+ return;
116
+ }
117
+
118
+ const collection =
119
+ data.subject.space.state.get() === SpaceState.SPACE_READY &&
120
+ data.subject.space.properties[Collection.Collection.typename]?.target;
121
+ if (!Obj.instanceOf(Collection.Collection, collection)) {
122
+ return;
123
+ }
124
+
125
+ objects.forEach((object) => {
126
+ void invokePromise(SpaceOperation.AddObject, {
127
+ target: collection,
128
+ object,
129
+ });
130
+ });
131
+ },
132
+ [data.subject.space, invokePromise],
133
+ );
134
+
135
+ return (
136
+ <Panel.Root role={role} className='dx-article'>
137
+ <Panel.Content asChild>
138
+ <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
139
+ </Panel.Content>
140
+ </Panel.Root>
141
+ );
142
+ },
143
+ }),
144
+ Surface.create({
145
+ id: `${meta.id}.app-graph`,
146
+ role: 'article',
147
+ filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
148
+ component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
149
+ }),
150
+ Surface.create({
151
+ id: `${meta.id}.wireframe`,
152
+ role: ['article', 'section'],
153
+ position: 'hoist',
154
+ filter: (data): data is { subject: Obj.Unknown } => {
155
+ const settings = registry.get(settingsAtom);
156
+ return Obj.isObject(data.subject) && !!settings.wireframe;
157
+ },
158
+ component: ({ data, role, name }) => (
159
+ <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
160
+ ),
161
+ }),
162
+ Surface.create({
163
+ id: `${meta.id}.object-debug`,
164
+ role: 'article',
165
+ filter: (data): data is { companionTo: Obj.Unknown } =>
166
+ data.subject === 'debug' && Obj.isObject(data.companionTo),
167
+ component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
168
+ }),
169
+ Surface.create({
170
+ id: `${meta.id}.devtools-overview`,
171
+ role: 'deck-companion--devtools',
172
+ filter: (data): data is { subject: 'devtools' } => data.subject === 'devtools',
173
+ component: () => <DevtoolsOverviewContainer />,
174
+ }),
175
+ Surface.create({
176
+ id: `${meta.id}.space-objects`,
177
+ role: 'deck-companion--space-objects',
178
+ filter: (data): data is { subject: 'space-objects' } => data.subject === 'space-objects',
179
+ component: () => <DebugSpaceObjectsPanel />,
180
+ }),
181
+
182
+ Surface.create({
183
+ id: `${meta.id}.status`,
184
+ role: 'status',
185
+ component: () => <DebugStatus />,
186
+ }),
187
+ //
188
+ // Devtools
189
+ //
190
+
191
+ Surface.create({
192
+ id: `${meta.id}.client.config`,
193
+ role: 'article',
194
+ filter: (data): data is any => data.subject === Devtools.Client.Config,
195
+ component: () => <ConfigPanel vaultSelector={false} />,
196
+ }),
197
+ Surface.create({
198
+ id: `${meta.id}.client.storage`,
199
+ role: 'article',
200
+ filter: (data): data is any => data.subject === Devtools.Client.Storage,
201
+ component: () => <StoragePanel />,
202
+ }),
203
+ Surface.create({
204
+ id: `${meta.id}.client.logs`,
205
+ role: 'article',
206
+ filter: (data): data is any => data.subject === Devtools.Client.Logs,
207
+ component: () => <LoggingPanel />,
208
+ }),
209
+ Surface.create({
210
+ id: `${meta.id}.client.diagnostics`,
211
+ role: 'article',
212
+ filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
213
+ component: () => <DiagnosticsPanel />,
214
+ }),
215
+ Surface.create({
216
+ id: `${meta.id}.client.tracing`,
217
+ role: 'article',
218
+ filter: (data): data is any => data.subject === Devtools.Client.Tracing,
219
+ component: () => <TracingPanel />,
220
+ }),
221
+ Surface.create({
222
+ id: `${meta.id}.halo.identity`,
223
+ role: 'article',
224
+ filter: (data): data is any => data.subject === Devtools.Halo.Identity,
225
+ component: () => <IdentityPanel />,
226
+ }),
227
+ Surface.create({
228
+ id: `${meta.id}.halo.devices`,
229
+ role: 'article',
230
+ filter: (data): data is any => data.subject === Devtools.Halo.Devices,
231
+ component: () => <DeviceListPanel />,
232
+ }),
233
+ Surface.create({
234
+ id: `${meta.id}.halo.keyring`,
235
+ role: 'article',
236
+ filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
237
+ component: () => <KeyringPanel />,
238
+ }),
239
+ Surface.create({
240
+ id: `${meta.id}.halo.credentials`,
241
+ role: 'article',
242
+ filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
243
+ component: () => {
244
+ const space = useCurrentSpace();
245
+ return <CredentialsPanel space={space} />;
246
+ },
247
+ }),
248
+ Surface.create({
249
+ id: `${meta.id}.echo.spaces`,
250
+ role: 'article',
251
+ filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
252
+ component: () => {
253
+ const { invokePromise } = useOperationInvoker();
254
+ const handleSelect = useCallback(
255
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
256
+ [invokePromise],
257
+ );
258
+ return <SpaceListPanel onSelect={handleSelect} />;
259
+ },
260
+ }),
261
+ Surface.create({
262
+ id: `${meta.id}.echo.space`,
263
+ role: 'article',
264
+ filter: (data): data is any => data.subject === Devtools.Echo.Space,
265
+ component: () => {
266
+ const space = useCurrentSpace();
267
+ const { invokePromise } = useOperationInvoker();
268
+ const handleSelect = useCallback(
269
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
270
+ [invokePromise],
271
+ );
272
+ return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
273
+ },
274
+ }),
275
+ Surface.create({
276
+ id: `${meta.id}.echo.feeds`,
277
+ role: 'article',
278
+ filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
279
+ component: () => {
280
+ const space = useCurrentSpace();
281
+ return <FeedsPanel space={space} />;
282
+ },
283
+ }),
284
+ Surface.create({
285
+ id: `${meta.id}.echo.objects`,
286
+ role: 'article',
287
+ filter: (data): data is any => data.subject === Devtools.Echo.Objects,
288
+ component: () => {
289
+ const space = useCurrentSpace();
290
+ return <ObjectsPanel space={space} />;
291
+ },
292
+ }),
293
+ Surface.create({
294
+ id: `${meta.id}.echo.schema`,
295
+ role: 'article',
296
+ filter: (data): data is any => data.subject === Devtools.Echo.Schema,
297
+ component: () => {
298
+ const space = useCurrentSpace();
299
+ return <SchemaPanel space={space} />;
300
+ },
301
+ }),
302
+ Surface.create({
303
+ id: `${meta.id}.echo.automerge`,
304
+ role: 'article',
305
+ filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
306
+ component: () => {
307
+ const space = useCurrentSpace();
308
+ return <AutomergePanel space={space} />;
309
+ },
310
+ }),
311
+ Surface.create({
312
+ id: `${meta.id}.echo.queues`,
313
+ role: 'article',
314
+ filter: (data): data is any => data.subject === Devtools.Echo.Queues,
315
+ component: () => <QueuesPanel />,
316
+ }),
317
+ Surface.create({
318
+ id: `${meta.id}.echo.members`,
319
+ role: 'article',
320
+ filter: (data): data is any => data.subject === Devtools.Echo.Members,
321
+ component: () => {
322
+ const space = useCurrentSpace();
323
+ return <MembersPanel space={space} />;
324
+ },
325
+ }),
326
+ Surface.create({
327
+ id: `${meta.id}.echo.metadata`,
328
+ role: 'article',
329
+ filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
330
+ component: () => <MetadataPanel />,
331
+ }),
332
+ Surface.create({
333
+ id: `${meta.id}.mesh.signal`,
334
+ role: 'article',
335
+ filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
336
+ component: () => <SignalPanel />,
337
+ }),
338
+ Surface.create({
339
+ id: `${meta.id}.mesh.swarm`,
340
+ role: 'article',
341
+ filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
342
+ component: () => <SwarmPanel />,
343
+ }),
344
+ Surface.create({
345
+ id: `${meta.id}.mesh.network`,
346
+ role: 'article',
347
+ filter: (data): data is any => data.subject === Devtools.Mesh.Network,
348
+ component: () => {
349
+ const space = useCurrentSpace();
350
+ return <NetworkPanel space={space} />;
351
+ },
352
+ }),
353
+ Surface.create({
354
+ id: `${meta.id}.edge.dashboard`,
355
+ role: 'article',
356
+ filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
357
+ component: () => <EdgeDashboardPanel />,
358
+ }),
359
+ Surface.create({
360
+ id: `${meta.id}.edge.workflows`,
361
+ role: 'article',
362
+ filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
363
+ component: () => {
364
+ const space = useCurrentSpace();
365
+ return <WorkflowPanel space={space} />;
366
+ },
367
+ }),
368
+ Surface.create({
369
+ id: `${meta.id}.edge.traces`,
370
+ role: 'article',
371
+ filter: (data): data is any => data.subject === Devtools.Edge.Traces,
372
+ component: () => {
373
+ const space = useCurrentSpace();
374
+ const queueDxn = space?.properties.invocationTraceQueue?.dxn;
375
+ return <InvocationTraceContainer db={space?.db} queueDxn={queueDxn} detailAxis='block' />;
376
+ },
377
+ }),
378
+ Surface.create({
379
+ id: `${meta.id}.edge.testing`,
380
+ role: 'article',
381
+ filter: (data): data is any => data.subject === Devtools.Edge.Testing,
382
+ component: () => {
383
+ const { invokePromise } = useOperationInvoker();
384
+ const onSpaceCreate = useCallback(
385
+ async (space: Space) => {
386
+ await space.waitUntilReady();
387
+ await invokePromise(SpaceOperation.Migrate, { space });
388
+ await space.db.flush();
389
+ },
390
+ [invokePromise],
391
+ );
392
+ const onScriptPluginOpen = useCallback(
393
+ async (space: Space) => {
394
+ await space.waitUntilReady();
395
+ const createResult = await invokePromise(ScriptOperation.CreateScript, { db: space.db });
396
+ if (createResult.data?.object) {
397
+ await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
398
+ }
399
+ log.info('script created', { result: createResult });
400
+ if (createResult.data?.object) {
401
+ await invokePromise(LayoutOperation.Open, {
402
+ subject: [getObjectPathFromObject(createResult.data.object)],
403
+ });
404
+ }
405
+ },
406
+ [invokePromise],
407
+ );
408
+ return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
409
+ },
410
+ }),
411
+ ]);
412
+ }),
413
+ );
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+
7
+ export const DebugSettings = Capability.lazy('DebugSettings', () => import('./settings'));
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import { createKvsStore } from '@dxos/effect';
10
+
11
+ import { meta } from '../../meta';
12
+ import { DebugCapabilities, DebugSettingsSchema } from '../../types';
13
+
14
+ export default Capability.makeModule(() =>
15
+ Effect.sync(() => {
16
+ const settingsAtom = createKvsStore({
17
+ key: meta.id,
18
+ schema: DebugSettingsSchema,
19
+ defaultValue: () => ({}),
20
+ });
21
+
22
+ return [
23
+ Capability.contributes(DebugCapabilities.Settings, settingsAtom),
24
+ Capability.contributes(AppCapabilities.Settings, {
25
+ prefix: meta.id,
26
+ schema: DebugSettingsSchema,
27
+ atom: settingsAtom,
28
+ }),
29
+ ];
30
+ }),
31
+ );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ export * from './SchemaTable';
@@ -2,47 +2,46 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { createIntent, type PromiseIntentDispatcher } from '@dxos/app-framework';
5
+ import type * as Schema from 'effect/Schema';
6
+
6
7
  import { addressToA1Notation } from '@dxos/compute';
7
8
  import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
8
- import { DXN, Filter, Key, Obj, Ref, Type } from '@dxos/echo';
9
- import { type TypedObject } from '@dxos/echo-schema';
9
+ import { DXN, Filter, Key, type Type } from '@dxos/echo';
10
+ import { View } from '@dxos/echo';
11
+ import { type OperationInvoker } from '@dxos/operation';
10
12
  import { Markdown } from '@dxos/plugin-markdown/types';
11
- import { createSheet } from '@dxos/plugin-sheet/types';
12
- import { SheetType, type CellValue } from '@dxos/plugin-sheet/types';
13
- import { CanvasType, DiagramType } from '@dxos/plugin-sketch/types';
14
- import { SpaceAction } from '@dxos/plugin-space/types';
13
+ import { Sheet } from '@dxos/plugin-sheet/types';
14
+ import { Sketch } from '@dxos/plugin-sketch/types';
15
+ import { SpaceOperation } from '@dxos/plugin-space/types';
15
16
  import { faker } from '@dxos/random';
16
17
  import { type Client } from '@dxos/react-client';
17
18
  import { type Space } from '@dxos/react-client/echo';
18
- import { DataType } from '@dxos/schema';
19
- import { createAsyncGenerator, type ValueGenerator } from '@dxos/schema/testing';
19
+ import { getTypenameFromQuery } from '@dxos/schema';
20
+ import { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';
20
21
  import { range } from '@dxos/util';
21
22
 
22
23
  const generator: ValueGenerator = faker as any;
23
24
 
24
- export type ObjectGenerator<T extends Obj.Any> = (space: Space, n: number, cb?: (objects: T[]) => void) => Promise<T[]>;
25
-
26
- const findViewByTypename = async (views: DataType.View[], typename: string) => {
27
- return views.find((view) => view.query.typename === typename);
25
+ const findViewByTypename = async (views: View.View[], typename: string) => {
26
+ return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
28
27
  };
29
28
 
30
- export const createGenerator = <T extends Obj.Any>(
29
+ export type ObjectGenerator<T> = (space: Space, n: number, cb?: (objects: T[]) => void) => Promise<T[]>;
30
+
31
+ export const createGenerator = <S extends Type.AnyObj>(
31
32
  client: Client,
32
- dispatch: PromiseIntentDispatcher,
33
- schema: TypedObject<T>,
34
- ): ObjectGenerator<T> => {
35
- return async (space: Space, n: number, cb?: (objects: T[]) => void): Promise<T[]> => {
33
+ invokePromise: OperationInvoker.OperationInvoker['invokePromise'],
34
+ schema: S,
35
+ ): ObjectGenerator<Schema.Schema.Type<S>> => {
36
+ return async (space: Space, n: number): Promise<Schema.Schema.Type<S>[]> => {
36
37
  const typename = schema.typename;
37
38
 
38
39
  // Find or create table and view.
39
- const { objects: views } = await space.db.query(Filter.type(DataType.View)).run();
40
+ const views = await space.db.query(Filter.type(View.View)).run();
40
41
  const view = await findViewByTypename(views, typename);
41
- const staticSchema = client?.graph.schemaRegistry.schemas.find((schema) => Type.getTypename(schema) === typename);
42
+ const staticSchema = client?.graph.schemaRegistry.query({ typename }).runSync()[0];
42
43
  if (!view && !staticSchema) {
43
- await dispatch(createIntent(SpaceAction.AddSchema, { space, schema }));
44
- } else if (!view && staticSchema) {
45
- await dispatch(createIntent(SpaceAction.UseStaticSchema, { space, typename }));
44
+ await invokePromise(SpaceOperation.AddSchema, { db: space.db, schema, show: false });
46
45
  }
47
46
 
48
47
  // Create objects.
@@ -57,7 +56,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
57
56
  async (space, n, cb) => {
58
57
  const objects = range(n).map(() => {
59
58
  return space.db.add(
60
- Markdown.makeDocument({
59
+ Markdown.make({
61
60
  name: faker.commerce.productName(),
62
61
  content: faker.lorem.sentences(5),
63
62
  }),
@@ -69,17 +68,10 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
69
68
  },
70
69
  ],
71
70
  [
72
- DiagramType.typename,
71
+ Sketch.Sketch.typename,
73
72
  async (space, n, cb) => {
74
73
  const objects = range(n).map(() => {
75
- // TODO(burdon): Generate diagram.
76
- const obj = space.db.add(
77
- Obj.make(DiagramType, {
78
- name: faker.commerce.productName(),
79
- canvas: Ref.make(Obj.make(CanvasType, { content: {} })),
80
- }),
81
- );
82
-
74
+ const obj = space.db.add(Sketch.make({ name: faker.commerce.productName() }));
83
75
  return obj;
84
76
  });
85
77
 
@@ -89,10 +81,10 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
89
81
  ],
90
82
  // TODO(burdon): Create unit tests.
91
83
  [
92
- SheetType.typename,
84
+ Sheet.Sheet.typename,
93
85
  async (space, n, cb) => {
94
86
  const objects = range(n).map(() => {
95
- const cells: Record<string, CellValue> = {};
87
+ const cells: Record<string, Sheet.CellValue> = {};
96
88
  const year = new Date().getFullYear();
97
89
  const cols = 4;
98
90
  const rows = 16;
@@ -114,7 +106,7 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
114
106
  // TODO(burdon): Set width.
115
107
  // TODO(burdon): Set formatting for columns.
116
108
  return space.db.add(
117
- createSheet({
109
+ Sheet.make({
118
110
  name: faker.commerce.productName(),
119
111
  cells,
120
112
  }),
@@ -3,20 +3,20 @@
3
3
  //
4
4
 
5
5
  // TODO(burdon): workerize-loader dep.
6
- import { Graph, type Edge, type PlainObject } from '@antv/graphlib';
6
+ import { type Edge, Graph, type PlainObject } from '@antv/graphlib';
7
7
  import {
8
- type Layout,
9
8
  D3ForceLayout,
10
9
  type D3ForceLayoutOptions,
11
10
  GridLayout,
12
11
  type GridLayoutOptions,
12
+ type Layout,
13
13
  RadialLayout,
14
14
  type RadialLayoutOptions,
15
15
  } from '@antv/layout';
16
- import { createBindingId, createShapeId, type Editor, type SerializedStore, type TLRecord } from '@tldraw/tldraw';
16
+ import { type Editor, type SerializedStore, type TLRecord, createBindingId, createShapeId } from '@tldraw/tldraw';
17
17
 
18
18
  import { faker } from '@dxos/random';
19
- import { isNotFalsy, range } from '@dxos/util';
19
+ import { isTruthy, range } from '@dxos/util';
20
20
 
21
21
  // TODO(burdon): Graph layout:
22
22
  // - https://www.npmjs.com/package/@antv/layout (uses d3)
@@ -67,7 +67,7 @@ export const generateGraph = (): Graph<PlainObject, PlainObject> => {
67
67
  }
68
68
  return target;
69
69
  })
70
- .filter(isNotFalsy);
70
+ .filter(isTruthy);
71
71
 
72
72
  for (const target of targets) {
73
73
  traverse(target);