@dxos/plugin-debug 0.9.1-staging.ee54ba693a → 0.11.0

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 (236) hide show
  1. package/PLUGIN.mdl +12 -325
  2. package/README.md +4 -14
  3. package/dist/lib/DebugPlugin.mjs +29 -0
  4. package/dist/lib/DebugPlugin.mjs.map +1 -0
  5. package/dist/lib/DebugPlugin.node.mjs +10 -0
  6. package/dist/lib/DebugPlugin.node.mjs.map +1 -0
  7. package/dist/lib/DebugPlugin.workerd.mjs +8 -0
  8. package/dist/lib/DebugPlugin.workerd.mjs.map +1 -0
  9. package/dist/lib/capabilities.mjs +11 -0
  10. package/dist/lib/capabilities.mjs.map +1 -0
  11. package/dist/lib/chunk-DebugObjectPanel.mjs +58 -0
  12. package/dist/lib/chunk-DebugObjectPanel.mjs.map +1 -0
  13. package/dist/lib/chunk-DebugSettings.mjs +237 -0
  14. package/dist/lib/chunk-DebugSettings.mjs.map +1 -0
  15. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs +39 -0
  16. package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs.map +1 -0
  17. package/dist/lib/chunk-DebugStatus.mjs +117 -0
  18. package/dist/lib/chunk-DebugStatus.mjs.map +1 -0
  19. package/dist/lib/chunk-LogStatus.mjs +44 -0
  20. package/dist/lib/chunk-LogStatus.mjs.map +1 -0
  21. package/dist/lib/chunk-SpaceGenerator.mjs +208 -0
  22. package/dist/lib/chunk-SpaceGenerator.mjs.map +1 -0
  23. package/dist/lib/chunk-StatsPanel.mjs +58 -0
  24. package/dist/lib/chunk-StatsPanel.mjs.map +1 -0
  25. package/dist/lib/chunk-Wireframe.mjs +60 -0
  26. package/dist/lib/chunk-Wireframe.mjs.map +1 -0
  27. package/dist/lib/chunk-app-graph-builder.mjs +76 -0
  28. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
  29. package/dist/lib/chunk-log-recording.mjs +17 -0
  30. package/dist/lib/chunk-log-recording.mjs.map +1 -0
  31. package/dist/lib/chunk-meta.mjs +36 -0
  32. package/dist/lib/chunk-meta.mjs.map +1 -0
  33. package/dist/lib/chunk-react-surface.mjs +193 -0
  34. package/dist/lib/chunk-react-surface.mjs.map +1 -0
  35. package/dist/lib/chunk-settings.mjs +23 -0
  36. package/dist/lib/chunk-settings.mjs.map +1 -0
  37. package/dist/lib/chunk-stats-panel.mjs +56 -0
  38. package/dist/lib/chunk-stats-panel.mjs.map +1 -0
  39. package/dist/lib/chunk-types.mjs +60 -0
  40. package/dist/lib/chunk-types.mjs.map +1 -0
  41. package/dist/lib/components.mjs +763 -0
  42. package/dist/lib/components.mjs.map +1 -0
  43. package/dist/lib/containers.mjs +14 -0
  44. package/dist/lib/containers.mjs.map +1 -0
  45. package/dist/lib/index.mjs +3 -0
  46. package/dist/lib/meta.mjs +2 -0
  47. package/dist/lib/plugin.mjs +8 -0
  48. package/dist/lib/plugin.mjs.map +1 -0
  49. package/dist/lib/translations.mjs +38 -0
  50. package/dist/lib/translations.mjs.map +1 -0
  51. package/dist/lib/types.mjs +2 -0
  52. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/DebugSurfaces.d.ts +25 -0
  54. package/dist/types/src/capabilities/DebugSurfaces.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  56. package/dist/types/src/capabilities/index.d.ts +4 -1
  57. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  58. package/dist/types/src/capabilities/log-recording.d.ts +10 -0
  59. package/dist/types/src/capabilities/log-recording.d.ts.map +1 -0
  60. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  61. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  62. package/dist/types/src/capabilities/settings.d.ts +1 -1
  63. package/dist/types/src/capabilities/stats-panel.d.ts +16 -0
  64. package/dist/types/src/capabilities/stats-panel.d.ts.map +1 -0
  65. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts +4 -3
  66. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
  67. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  68. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +4 -1
  69. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
  70. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +4 -1
  71. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -1
  72. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts +30 -58
  73. package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
  74. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +4 -1
  75. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
  76. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts +4 -1
  77. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
  78. package/dist/types/src/containers/LogStatus/LogStatus.d.ts +6 -0
  79. package/dist/types/src/containers/LogStatus/LogStatus.d.ts.map +1 -0
  80. package/dist/types/src/containers/LogStatus/index.d.ts +2 -0
  81. package/dist/types/src/containers/LogStatus/index.d.ts.map +1 -0
  82. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +1 -1
  83. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  84. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts +6 -0
  85. package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts.map +1 -0
  86. package/dist/types/src/containers/StatsPanel/index.d.ts +2 -0
  87. package/dist/types/src/containers/StatsPanel/index.d.ts.map +1 -0
  88. package/dist/types/src/containers/Wireframe/Wireframe.d.ts +4 -1
  89. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
  90. package/dist/types/src/containers/index.d.ts +4 -6
  91. package/dist/types/src/containers/index.d.ts.map +1 -1
  92. package/dist/types/src/translations.d.ts +26 -57
  93. package/dist/types/src/translations.d.ts.map +1 -1
  94. package/dist/types/src/types/DebugNodes.d.ts +7 -0
  95. package/dist/types/src/types/DebugNodes.d.ts.map +1 -0
  96. package/dist/types/src/types/DebugSurface.d.ts +8 -0
  97. package/dist/types/src/types/DebugSurface.d.ts.map +1 -0
  98. package/dist/types/src/types/debug.d.ts +3 -1
  99. package/dist/types/src/types/debug.d.ts.map +1 -1
  100. package/dist/types/src/types/index.d.ts +2 -2
  101. package/dist/types/src/types/index.d.ts.map +1 -1
  102. package/dist/types/tsconfig.tsbuildinfo +1 -1
  103. package/dx.config.ts +8 -13
  104. package/package.json +61 -63
  105. package/src/DebugPlugin.node.ts +1 -1
  106. package/src/DebugPlugin.tsx +10 -27
  107. package/src/DebugPlugin.workerd.ts +1 -1
  108. package/src/capabilities/DebugSurfaces.tsx +146 -0
  109. package/src/capabilities/app-graph-builder.ts +39 -373
  110. package/src/capabilities/index.ts +3 -2
  111. package/src/capabilities/log-recording.ts +20 -0
  112. package/src/capabilities/react-surface.ts +123 -0
  113. package/src/capabilities/stats-panel.ts +74 -0
  114. package/src/components/SchemaTable/SchemaTable.tsx +6 -5
  115. package/src/components/SpaceGenerator/ObjectGenerator.tsx +9 -3
  116. package/src/components/SpaceGenerator/presets.ts +2 -2
  117. package/src/components/index.ts +1 -1
  118. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +20 -20
  119. package/src/containers/DebugSettings/DebugSettings.tsx +4 -3
  120. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +4 -2
  121. package/src/containers/DebugStatus/DebugStatus.tsx +2 -0
  122. package/src/containers/LogStatus/LogStatus.tsx +51 -0
  123. package/src/containers/LogStatus/index.ts +5 -0
  124. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +108 -10
  125. package/src/containers/StatsPanel/StatsPanel.tsx +74 -0
  126. package/src/containers/StatsPanel/index.ts +5 -0
  127. package/src/containers/Wireframe/Wireframe.tsx +2 -0
  128. package/src/containers/index.ts +9 -7
  129. package/src/index.ts +1 -1
  130. package/src/meta.ts +1 -1
  131. package/src/plugin.ts +1 -1
  132. package/src/translations.ts +8 -52
  133. package/src/types/DebugNodes.ts +18 -0
  134. package/src/types/DebugSurface.ts +16 -0
  135. package/src/types/debug.ts +3 -1
  136. package/src/types/index.ts +3 -3
  137. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs +0 -15
  138. package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +0 -7
  139. package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs +0 -61
  140. package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs.map +0 -7
  141. package/dist/lib/neutral/DebugPlugin.mjs +0 -59
  142. package/dist/lib/neutral/DebugPlugin.mjs.map +0 -7
  143. package/dist/lib/neutral/DebugPlugin.node.mjs +0 -18
  144. package/dist/lib/neutral/DebugPlugin.node.mjs.map +0 -7
  145. package/dist/lib/neutral/DebugPlugin.workerd.mjs +0 -12
  146. package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +0 -7
  147. package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs +0 -229
  148. package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs.map +0 -7
  149. package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs +0 -36
  150. package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs.map +0 -7
  151. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs +0 -122
  152. package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs.map +0 -7
  153. package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs +0 -24
  154. package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs.map +0 -7
  155. package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs +0 -177
  156. package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs.map +0 -7
  157. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs +0 -161
  158. package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +0 -7
  159. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +0 -146
  160. package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs.map +0 -7
  161. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs +0 -52
  162. package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +0 -7
  163. package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs +0 -619
  164. package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs.map +0 -7
  165. package/dist/lib/neutral/capabilities/index.mjs +0 -15
  166. package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
  167. package/dist/lib/neutral/chunk-72QXLYMI.mjs +0 -118
  168. package/dist/lib/neutral/chunk-72QXLYMI.mjs.map +0 -7
  169. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
  170. package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
  171. package/dist/lib/neutral/chunk-R5C4CKOF.mjs +0 -54
  172. package/dist/lib/neutral/chunk-R5C4CKOF.mjs.map +0 -7
  173. package/dist/lib/neutral/components/index.mjs +0 -961
  174. package/dist/lib/neutral/components/index.mjs.map +0 -7
  175. package/dist/lib/neutral/containers/index.mjs +0 -27
  176. package/dist/lib/neutral/containers/index.mjs.map +0 -7
  177. package/dist/lib/neutral/index.mjs +0 -20
  178. package/dist/lib/neutral/index.mjs.map +0 -7
  179. package/dist/lib/neutral/meta.json +0 -1
  180. package/dist/lib/neutral/meta.mjs +0 -8
  181. package/dist/lib/neutral/meta.mjs.map +0 -7
  182. package/dist/lib/neutral/plugin.mjs +0 -12
  183. package/dist/lib/neutral/plugin.mjs.map +0 -7
  184. package/dist/lib/neutral/react-context-UJURDOO6.mjs +0 -17
  185. package/dist/lib/neutral/react-context-UJURDOO6.mjs.map +0 -7
  186. package/dist/lib/neutral/react-surface-URESE7J4.mjs +0 -484
  187. package/dist/lib/neutral/react-surface-URESE7J4.mjs.map +0 -7
  188. package/dist/lib/neutral/settings-5I2674B6.mjs +0 -28
  189. package/dist/lib/neutral/settings-5I2674B6.mjs.map +0 -7
  190. package/dist/lib/neutral/translations.mjs +0 -91
  191. package/dist/lib/neutral/translations.mjs.map +0 -7
  192. package/dist/lib/neutral/types/index.mjs +0 -16
  193. package/dist/lib/neutral/types/index.mjs.map +0 -7
  194. package/dist/types/src/DebugPlugin.test.d.ts +0 -2
  195. package/dist/types/src/DebugPlugin.test.d.ts.map +0 -1
  196. package/dist/types/src/capabilities/react-context.d.ts +0 -5
  197. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  198. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +0 -8
  199. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +0 -1
  200. package/dist/types/src/containers/DebugGraph/index.d.ts +0 -2
  201. package/dist/types/src/containers/DebugGraph/index.d.ts.map +0 -1
  202. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts +0 -3
  203. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +0 -1
  204. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +0 -2
  205. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +0 -1
  206. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +0 -15
  207. package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +0 -1
  208. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +0 -106
  209. package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +0 -1
  210. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +0 -3
  211. package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +0 -1
  212. package/dist/types/src/containers/GithubPanel/index.d.ts +0 -2
  213. package/dist/types/src/containers/GithubPanel/index.d.ts.map +0 -1
  214. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +0 -3
  215. package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +0 -1
  216. package/dist/types/src/containers/RegistryPanel/index.d.ts +0 -2
  217. package/dist/types/src/containers/RegistryPanel/index.d.ts.map +0 -1
  218. package/dist/types/src/types/Devtools.d.ts +0 -57
  219. package/dist/types/src/types/Devtools.d.ts.map +0 -1
  220. package/dist/types/src/types/surface.d.ts +0 -4
  221. package/dist/types/src/types/surface.d.ts.map +0 -1
  222. package/src/DebugPlugin.test.ts +0 -29
  223. package/src/capabilities/react-context.tsx +0 -25
  224. package/src/capabilities/react-surface.tsx +0 -504
  225. package/src/containers/DebugGraph/DebugGraph.tsx +0 -14
  226. package/src/containers/DebugGraph/index.ts +0 -5
  227. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +0 -27
  228. package/src/containers/DevtoolsOverviewContainer/index.ts +0 -5
  229. package/src/containers/GithubPanel/GithubComponent.stories.tsx +0 -38
  230. package/src/containers/GithubPanel/GithubComponent.tsx +0 -192
  231. package/src/containers/GithubPanel/GithubPanel.tsx +0 -17
  232. package/src/containers/GithubPanel/index.ts +0 -5
  233. package/src/containers/RegistryPanel/RegistryPanel.tsx +0 -150
  234. package/src/containers/RegistryPanel/index.ts +0 -5
  235. package/src/types/Devtools.ts +0 -73
  236. package/src/types/surface.ts +0 -10
@@ -1,504 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useAtomValue } from '@effect-atom/atom-react';
6
- import * as Effect from 'effect/Effect';
7
- import * as Option from 'effect/Option';
8
- import React, { useCallback, useMemo } from 'react';
9
-
10
- import { Capabilities, Capability } from '@dxos/app-framework';
11
- import { Surface, useAtomCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
12
- import { AppAnnotation, AppCapabilities, LayoutOperation, Paths } from '@dxos/app-toolkit';
13
- import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
14
- import { EDGE_SERVICE_DEFAULTS, EdgeServiceName } from '@dxos/config';
15
- import {
16
- AutomergePanel,
17
- ConfigPanel,
18
- CredentialsPanel,
19
- DeviceListPanel,
20
- DiagnosticsPanel,
21
- EdgeDashboardPanel,
22
- FeedsPanel,
23
- IdentityPanel,
24
- InvocationTraceContainer,
25
- KeyringPanel,
26
- LoggingPanel,
27
- MembersPanel,
28
- MetadataPanel,
29
- NetworkPanel,
30
- ObjectsPanel,
31
- QueuesPanel,
32
- SchemaPanel,
33
- SignalPanel,
34
- SpaceInfoPanel,
35
- SpaceListPanel,
36
- SqlitePanel,
37
- StoragePanel,
38
- SwarmPanel,
39
- TestingPanel,
40
- WorkflowPanel,
41
- } from '@dxos/devtools';
42
- import { Annotation, Collection, Entity, Feed, Filter, Obj, Type } from '@dxos/echo';
43
- import { HiddenAnnotation } from '@dxos/echo/Annotation';
44
- import { log } from '@dxos/log';
45
- import { type IdbLogStore } from '@dxos/log-store-idb';
46
- import { type Graph } from '@dxos/plugin-graph';
47
- import { ScriptOperation } from '@dxos/plugin-script';
48
- import { SpaceCapabilities, SpaceOperation } from '@dxos/plugin-space';
49
- import { useClient } from '@dxos/react-client';
50
- import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
51
- import { ToolsExplorer } from '@dxos/react-ui-introspect';
52
- import { Position } from '@dxos/util';
53
-
54
- import {
55
- DebugGraph,
56
- DebugObjectPanel,
57
- DebugSettings,
58
- DebugSpaceObjectsPanel,
59
- DebugStatus,
60
- DevtoolsOverviewContainer,
61
- RegistryPanel,
62
- SpaceGenerator,
63
- Wireframe,
64
- } from '#containers';
65
- import { meta } from '#meta';
66
- import { DebugCapabilities, Devtools, type Settings } from '#types';
67
-
68
- const MCP_SERVER_URL = EDGE_SERVICE_DEFAULTS[EdgeServiceName.Introspect];
69
-
70
- type SpaceDebug = {
71
- type: string;
72
- space: Space;
73
- };
74
-
75
- type GraphDebug = {
76
- graph: Graph.Graph;
77
- root: string;
78
- };
79
-
80
- const isSpaceDebug = (data: any): data is SpaceDebug =>
81
- data?.type === `${meta.profile.key}.space` && isSpace(data.space);
82
- const isGraphDebug = (data: any): data is GraphDebug => {
83
- const graph = data?.graph;
84
- return (
85
- graph != null && typeof graph === 'object' && typeof graph.json === 'function' && typeof data?.root === 'string'
86
- );
87
- };
88
-
89
- /** Returns `onOpen` and `canOpen` for the ObjectsTree "Open" action. */
90
- const useObjectOpenAction = (invokePromise: ReturnType<typeof useOperationInvoker>['invokePromise']) => {
91
- const client = useClient();
92
- const spaceSettings = useAtomCapability(SpaceCapabilities.Settings);
93
- const showHidden = spaceSettings?.showHidden ?? false;
94
-
95
- const allTypes = useAtomValue(useMemo(() => client.graph.registry.query(Filter.type(Type.Type)).atom, [client]));
96
-
97
- const hiddenTypenames = useMemo(() => {
98
- const result = new Set<string>();
99
- for (const typeEntity of allTypes) {
100
- const schema = Type.getSchema(typeEntity);
101
- if (HiddenAnnotation.get(schema).pipe(Option.getOrElse(() => false))) {
102
- result.add(Type.getTypename(typeEntity));
103
- }
104
- }
105
- return result;
106
- }, [allTypes]);
107
-
108
- const onOpen = useCallback(
109
- (object: Obj.Unknown) => {
110
- void invokePromise(LayoutOperation.Open, { subject: [Paths.getObjectPathFromObject(object)] });
111
- },
112
- [invokePromise],
113
- );
114
-
115
- const canOpen = useCallback(
116
- (entity: Entity.Snapshot) => {
117
- if (showHidden) {
118
- return true;
119
- }
120
- const typename = Entity.getTypename(entity);
121
- return !hiddenTypenames.has(typename ?? '');
122
- },
123
- [showHidden, hiddenTypenames],
124
- );
125
-
126
- return { onOpen, canOpen };
127
- };
128
-
129
- type ReactSurfaceOptions = {
130
- logStore?: IdbLogStore;
131
- };
132
-
133
- export default Capability.makeModule(
134
- Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {
135
- const capabilities = yield* Capability.Service;
136
- const registry = capabilities.get(Capabilities.AtomRegistry);
137
- const settingsAtom = capabilities.get(DebugCapabilities.Settings);
138
- const fileUploader = capabilities.getAll(AppCapabilities.FileUploader)[0];
139
-
140
- return Capability.contributes(Capabilities.ReactSurface, [
141
- Surface.create({
142
- id: 'pluginSettings',
143
- filter: AppSurface.settings(AppSurface.Article, meta.profile.key),
144
- component: ({ data: { subject } }) => {
145
- const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
146
- return (
147
- <DebugSettings
148
- settings={settings}
149
- onSettingsChange={updateSettings}
150
- logStore={logStore}
151
- onUpload={fileUploader}
152
- />
153
- );
154
- },
155
- }),
156
- Surface.create({
157
- id: 'space',
158
- filter: AppSurface.subject(AppSurface.Article, isSpaceDebug),
159
- component: ({ role, data }) => {
160
- const { invokePromise } = useOperationInvoker();
161
-
162
- const handleCreateObject = useCallback(
163
- (objects: Obj.Unknown[]) => {
164
- if (!isSpace(data.subject.space)) {
165
- return;
166
- }
167
-
168
- const collection =
169
- data.subject.space.state.get() === SpaceState.SPACE_READY &&
170
- Annotation.get(data.subject.space.properties, AppAnnotation.RootCollectionAnnotation).pipe(
171
- Option.getOrUndefined,
172
- )?.target;
173
- if (!Obj.instanceOf(Collection.Collection, collection)) {
174
- return;
175
- }
176
-
177
- objects.forEach((object) => {
178
- void invokePromise(SpaceOperation.AddObject, {
179
- target: collection,
180
- object,
181
- });
182
- });
183
- },
184
- [data.subject.space, invokePromise],
185
- );
186
-
187
- return <SpaceGenerator role={role} space={data.subject.space} onCreateObjects={handleCreateObject} />;
188
- },
189
- }),
190
- Surface.create({
191
- id: 'appGraph',
192
- filter: AppSurface.subject(AppSurface.Article, isGraphDebug),
193
- component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
194
- }),
195
- Surface.create({
196
- id: 'toolsExplorer',
197
- filter: AppSurface.literal(AppSurface.Article, Devtools.ToolsExplorer),
198
- component: () => <ToolsExplorer serverUrl={MCP_SERVER_URL} />,
199
- }),
200
- Surface.create({
201
- id: 'registry',
202
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Registry),
203
- component: () => <RegistryPanel />,
204
- }),
205
- Surface.create({
206
- id: 'wireframe',
207
- // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
208
- filter: AppSurface.oneOf(
209
- AppSurface.subject(AppSurface.Article, (value): value is Obj.Unknown => {
210
- const settings = registry.get(settingsAtom);
211
- return Obj.isObject(value) && !!settings.wireframe;
212
- }),
213
- AppSurface.subject(AppSurface.Section, (value): value is Obj.Unknown => {
214
- const settings = registry.get(settingsAtom);
215
- return Obj.isObject(value) && !!settings.wireframe;
216
- }),
217
- ),
218
- position: Position.first,
219
- component: ({ data, role, name }) => (
220
- <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
221
- ),
222
- }),
223
- Surface.create({
224
- id: 'objectDebug',
225
- filter: AppSurface.allOf(
226
- AppSurface.literal(AppSurface.Article, 'debug'),
227
- AppSurface.companion(AppSurface.Article),
228
- ),
229
- component: ({ role, data }) => {
230
- const { invokePromise } = useOperationInvoker();
231
- const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
232
- return <DebugObjectPanel role={role} companionTo={data.companionTo} onOpen={onOpen} canOpen={canOpen} />;
233
- },
234
- }),
235
- Surface.create({
236
- id: 'devtoolsOverview',
237
- filter: Surface.makeFilter(AppSurface.deckCompanion('devtools')),
238
- component: () => <DevtoolsOverviewContainer />,
239
- }),
240
- Surface.create({
241
- id: 'spaceObjects',
242
- filter: Surface.makeFilter(AppSurface.deckCompanion('spaceObjects')),
243
- component: () => {
244
- const space = useActiveSpace();
245
- const { invokePromise } = useOperationInvoker();
246
- const { onOpen, canOpen } = useObjectOpenAction(invokePromise);
247
- if (!space) {
248
- return null;
249
- }
250
-
251
- return <DebugSpaceObjectsPanel space={space} onOpen={onOpen} canOpen={canOpen} />;
252
- },
253
- }),
254
-
255
- Surface.create({
256
- id: 'debugStatus',
257
- filter: Surface.makeFilter(AppSurface.StatusIndicator),
258
- position: Position.first,
259
- component: () => <DebugStatus />,
260
- }),
261
-
262
- //
263
- // Devtools
264
- //
265
-
266
- Surface.create({
267
- id: 'client.config',
268
- filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Config),
269
- component: () => <ConfigPanel vaultSelector={false} />,
270
- }),
271
- Surface.create({
272
- id: 'client.storage',
273
- filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Storage),
274
- component: () => <StoragePanel />,
275
- }),
276
- Surface.create({
277
- id: 'client.sqlite',
278
- filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Sqlite),
279
- component: () => <SqlitePanel />,
280
- }),
281
- Surface.create({
282
- id: 'client.logs',
283
- filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Logs),
284
- component: () => <LoggingPanel />,
285
- }),
286
- Surface.create({
287
- id: 'client.diagnostics',
288
- filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Diagnostics),
289
- component: () => <DiagnosticsPanel />,
290
- }),
291
- Surface.create({
292
- id: 'halo.identity',
293
- filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Identity),
294
- component: () => <IdentityPanel />,
295
- }),
296
- Surface.create({
297
- id: 'halo.devices',
298
- filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Devices),
299
- component: () => <DeviceListPanel />,
300
- }),
301
- Surface.create({
302
- id: 'halo.keyring',
303
- filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Keyring),
304
- component: () => <KeyringPanel />,
305
- }),
306
- Surface.create({
307
- id: 'halo.credentials',
308
- filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Credentials),
309
- component: () => {
310
- const space = useActiveSpace();
311
- if (!space) {
312
- return null;
313
- }
314
-
315
- return <CredentialsPanel space={space} />;
316
- },
317
- }),
318
- Surface.create({
319
- id: 'echo.spaces',
320
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Spaces),
321
- component: () => {
322
- const { invokePromise } = useOperationInvoker();
323
- const handleSelect = useCallback(
324
- () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
325
- [invokePromise],
326
- );
327
- return <SpaceListPanel onSelect={handleSelect} />;
328
- },
329
- }),
330
- Surface.create({
331
- id: 'echo.space',
332
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Space),
333
- component: () => {
334
- const space = useActiveSpace();
335
- const { invokePromise } = useOperationInvoker();
336
- const handleSelect = useCallback(
337
- () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
338
- [invokePromise],
339
- );
340
- if (!space) {
341
- return null;
342
- }
343
-
344
- return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
345
- },
346
- }),
347
- Surface.create({
348
- id: 'echo.feeds',
349
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Feeds),
350
- component: () => {
351
- const space = useActiveSpace();
352
- if (!space) {
353
- return null;
354
- }
355
-
356
- return <FeedsPanel space={space} />;
357
- },
358
- }),
359
- Surface.create({
360
- id: 'echo.objects',
361
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Objects),
362
- component: () => {
363
- const space = useActiveSpace();
364
- if (!space) {
365
- return null;
366
- }
367
-
368
- return <ObjectsPanel space={space} />;
369
- },
370
- }),
371
- Surface.create({
372
- id: 'echo.schema',
373
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Schema),
374
- component: () => {
375
- const space = useActiveSpace();
376
- if (!space) {
377
- return null;
378
- }
379
-
380
- return <SchemaPanel space={space} />;
381
- },
382
- }),
383
- Surface.create({
384
- id: 'echo.automerge',
385
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Automerge),
386
- component: () => {
387
- const space = useActiveSpace();
388
- if (!space) {
389
- return null;
390
- }
391
-
392
- return <AutomergePanel space={space} />;
393
- },
394
- }),
395
- Surface.create({
396
- id: 'echo.queues',
397
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Queues),
398
- component: () => <QueuesPanel />,
399
- }),
400
- Surface.create({
401
- id: 'echo.members',
402
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Members),
403
- component: () => {
404
- const space = useActiveSpace();
405
- if (!space) {
406
- return null;
407
- }
408
-
409
- return <MembersPanel space={space} />;
410
- },
411
- }),
412
- Surface.create({
413
- id: 'echo.metadata',
414
- filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Metadata),
415
- component: () => <MetadataPanel />,
416
- }),
417
- Surface.create({
418
- id: 'mesh.signal',
419
- filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Signal),
420
- component: () => <SignalPanel />,
421
- }),
422
- Surface.create({
423
- id: 'mesh.swarm',
424
- filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Swarm),
425
- component: () => <SwarmPanel />,
426
- }),
427
- Surface.create({
428
- id: 'mesh.network',
429
- filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Network),
430
- component: () => {
431
- const space = useActiveSpace();
432
- if (!space) {
433
- return null;
434
- }
435
-
436
- return <NetworkPanel space={space} />;
437
- },
438
- }),
439
- Surface.create({
440
- id: 'edge.dashboard',
441
- filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Dashboard),
442
- component: () => <EdgeDashboardPanel />,
443
- }),
444
- Surface.create({
445
- id: 'edge.workflows',
446
- filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Workflows),
447
- component: () => {
448
- const space = useActiveSpace();
449
- if (!space) {
450
- return null;
451
- }
452
-
453
- return <WorkflowPanel space={space} />;
454
- },
455
- }),
456
- Surface.create({
457
- id: 'edge.traces',
458
- filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Traces),
459
- component: () => {
460
- const space = useActiveSpace();
461
- if (!space) {
462
- return null;
463
- }
464
-
465
- const feed = space.properties.invocationTraceFeed?.target;
466
- const feedDXN = feed ? Feed.getQueueUri(feed) : undefined;
467
- return <InvocationTraceContainer db={space.db} feedDXN={feedDXN} detailAxis='block' />;
468
- },
469
- }),
470
- Surface.create({
471
- id: 'edge.testing',
472
- filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Testing),
473
- component: () => {
474
- const { invokePromise } = useOperationInvoker();
475
- const onSpaceCreate = useCallback(
476
- async (space: Space) => {
477
- await space.waitUntilReady();
478
- await invokePromise(SpaceOperation.Migrate, { space });
479
- await space.db.flush();
480
- },
481
- [invokePromise],
482
- );
483
- const onScriptPluginOpen = useCallback(
484
- async (space: Space) => {
485
- await space.waitUntilReady();
486
- const createResult = await invokePromise(ScriptOperation.CreateScript, { db: space.db });
487
- if (createResult.data?.object) {
488
- await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
489
- }
490
- log.info('script created', { result: createResult });
491
- if (createResult.data?.object) {
492
- await invokePromise(LayoutOperation.Open, {
493
- subject: [Paths.getObjectPathFromObject(createResult.data.object)],
494
- });
495
- }
496
- },
497
- [invokePromise],
498
- );
499
- return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
500
- },
501
- }),
502
- ]);
503
- }),
504
- );
@@ -1,14 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { Tree } from '@dxos/devtools';
8
- import { Graph } from '@dxos/plugin-graph';
9
-
10
- export type DebugGraphProps = { graph: Graph.Graph; root: string };
11
-
12
- export const DebugGraph = ({ graph, root }: DebugGraphProps) => {
13
- return <Tree data={Graph.toJSON(graph, root)} />;
14
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export { DebugGraph as default } from './DebugGraph';
@@ -1,27 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { Surface } from '@dxos/app-framework/ui';
8
- import { StatsPanel, useStats } from '@dxos/devtools';
9
-
10
- import { DevtoolsOverview } from '#types';
11
-
12
- export const DevtoolsOverviewContainer = () => {
13
- const [stats, refreshStats] = useStats();
14
- const surfaceProfilerStats = Surface.useProfilerStats();
15
- const clearSurfaceProfiler = Surface.useProfilerClear();
16
-
17
- return (
18
- <StatsPanel
19
- stats={stats}
20
- surfaceProfilerStats={surfaceProfilerStats}
21
- onRefresh={refreshStats}
22
- onClearSurfaceProfiler={clearSurfaceProfiler}
23
- >
24
- <Surface.Surface type={DevtoolsOverview} />
25
- </StatsPanel>
26
- );
27
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export { DevtoolsOverviewContainer as default } from './DevtoolsOverviewContainer';
@@ -1,38 +0,0 @@
1
- //
2
- // Copyright 2026 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React from 'react';
7
-
8
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
9
-
10
- import { translations } from '#translations';
11
-
12
- import { GithubComponent } from './GithubComponent';
13
-
14
- const DefaultStory = () => (
15
- <GithubComponent.Root>
16
- <div className='grid grid-rows-[auto_minmax(0,1fr)_auto] overflow-hidden h-full is-full'>
17
- <GithubComponent.Header />
18
- <GithubComponent.Content />
19
- <GithubComponent.StatusBar />
20
- </div>
21
- </GithubComponent.Root>
22
- );
23
-
24
- const meta = {
25
- title: 'plugins/plugin-debug/containers/GithubComponent',
26
- component: DefaultStory,
27
- decorators: [withTheme(), withLayout({ layout: 'column', classNames: 'w-(--dx-r1-size)' })],
28
- parameters: {
29
- layout: 'fullscreen',
30
- translations,
31
- },
32
- } satisfies Meta<typeof DefaultStory>;
33
-
34
- export default meta;
35
-
36
- type Story = StoryObj<typeof meta>;
37
-
38
- export const Default: Story = {};