@dxos/plugin-debug 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae

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-JZMIUDYB.mjs +174 -0
  6. package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs.map +7 -0
  7. package/dist/lib/browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs +50 -0
  8. package/dist/lib/browser/DebugSpaceObjectsPanel-7NRPLWZ4.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-AG3XGNMV.mjs → SpaceGenerator-SWSGJEEL.mjs} +573 -382
  14. package/dist/lib/browser/SpaceGenerator-SWSGJEEL.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-LGUQNXHD.mjs +625 -0
  18. package/dist/lib/browser/app-graph-builder-LGUQNXHD.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-AJA6RYN3.mjs → chunk-4UFQXPP7.mjs} +12 -2
  20. package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-A5H5GRV6.mjs +20 -0
  22. package/dist/lib/browser/chunk-A5H5GRV6.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-I3USIAF6.mjs +17 -0
  27. package/dist/lib/browser/react-context-I3USIAF6.mjs.map +7 -0
  28. package/dist/lib/browser/react-surface-BTVNKKVQ.mjs +443 -0
  29. package/dist/lib/browser/react-surface-BTVNKKVQ.mjs.map +7 -0
  30. package/dist/lib/browser/settings-SLTQJJNF.mjs +32 -0
  31. package/dist/lib/browser/settings-SLTQJJNF.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 +6 -1
  102. package/dist/types/src/types.d.ts.map +1 -1
  103. package/dist/types/tsconfig.tsbuildinfo +1 -1
  104. package/package.json +76 -67
  105. package/src/DebugPlugin.tsx +27 -32
  106. package/src/capabilities/app-graph-builder/app-graph-builder.ts +441 -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 +428 -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 +32 -38
  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 +337 -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 +60 -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 +9 -1
  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-AG3XGNMV.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-3GD2OWCA.mjs +0 -768
  154. package/dist/lib/browser/react-surface-3GD2OWCA.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
@@ -1,397 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { pipe } from 'effect';
6
- import React, { useCallback } from 'react';
7
-
8
- import {
9
- Capabilities,
10
- chain,
11
- contributes,
12
- createIntent,
13
- createSurface,
14
- LayoutAction,
15
- useCapability,
16
- useIntentDispatcher,
17
- type PluginContext,
18
- } from '@dxos/app-framework';
19
- import {
20
- AutomergePanel,
21
- ConfigPanel,
22
- CredentialsPanel,
23
- DeviceListPanel,
24
- DiagnosticsPanel,
25
- EdgeDashboardPanel,
26
- FeedsPanel,
27
- IdentityPanel,
28
- InvocationTraceContainer,
29
- KeyringPanel,
30
- LoggingPanel,
31
- MembersPanel,
32
- MetadataPanel,
33
- NetworkPanel,
34
- ObjectsPanel,
35
- QueuesPanel,
36
- SchemaPanel,
37
- SignalPanel,
38
- SpaceInfoPanel,
39
- SpaceListPanel,
40
- StoragePanel,
41
- SwarmPanel,
42
- TestingPanel,
43
- TracingPanel,
44
- WorkflowPanel,
45
- } from '@dxos/devtools';
46
- import { Obj } from '@dxos/echo';
47
- import { SettingsStore } from '@dxos/local-storage';
48
- import { log } from '@dxos/log';
49
- import { ClientCapabilities } from '@dxos/plugin-client';
50
- import { Graph } from '@dxos/plugin-graph';
51
- import { ScriptAction } from '@dxos/plugin-script/types';
52
- import { SpaceAction } from '@dxos/plugin-space/types';
53
- import { SpaceState, isSpace, type Space, parseId } from '@dxos/react-client/echo';
54
- import { StackItem } from '@dxos/react-ui-stack';
55
- import { DataType } from '@dxos/schema';
56
-
57
- import {
58
- DebugApp,
59
- DebugObjectPanel,
60
- DebugSettings,
61
- DebugStatus,
62
- DevtoolsOverviewContainer,
63
- SpaceGenerator,
64
- Wireframe,
65
- } from '../components';
66
- import { DEBUG_PLUGIN } from '../meta';
67
- import { type DebugSettingsProps, Devtools } from '../types';
68
-
69
- type SpaceDebug = {
70
- type: string;
71
- space: Space;
72
- };
73
-
74
- type GraphDebug = {
75
- graph: Graph;
76
- };
77
-
78
- const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${DEBUG_PLUGIN}/space` && isSpace(data.space);
79
- const isGraphDebug = (data: any): data is GraphDebug => data?.graph instanceof Graph;
80
-
81
- // TODO(wittjosiah): Factor out?
82
- const useCurrentSpace = () => {
83
- const layout = useCapability(Capabilities.Layout);
84
- const client = useCapability(ClientCapabilities.Client);
85
- const { spaceId } = parseId(layout.workspace);
86
- const space = spaceId ? client.spaces.get(spaceId) : undefined;
87
- return space;
88
- };
89
-
90
- export default (context: PluginContext) =>
91
- contributes(Capabilities.ReactSurface, [
92
- createSurface({
93
- id: `${DEBUG_PLUGIN}/plugin-settings`,
94
- role: 'article',
95
- filter: (data): data is { subject: SettingsStore<DebugSettingsProps> } =>
96
- data.subject instanceof SettingsStore && data.subject.prefix === DEBUG_PLUGIN,
97
- component: ({ data: { subject } }) => <DebugSettings settings={subject.value} />,
98
- }),
99
- createSurface({
100
- id: `${DEBUG_PLUGIN}/space`,
101
- role: 'article',
102
- filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
103
- component: ({ data }) => {
104
- const { dispatchPromise: dispatch } = useIntentDispatcher();
105
-
106
- const handleCreateObject = useCallback(
107
- (objects: Obj.Any[]) => {
108
- if (!isSpace(data.subject.space)) {
109
- return;
110
- }
111
-
112
- const collection =
113
- data.subject.space.state.get() === SpaceState.SPACE_READY &&
114
- data.subject.space.properties[DataType.Collection.typename]?.target;
115
- if (!Obj.instanceOf(DataType.Collection, collection)) {
116
- return;
117
- }
118
-
119
- objects.forEach((object) => {
120
- void dispatch(createIntent(SpaceAction.AddObject, { target: collection, object }));
121
- });
122
- },
123
- [data.subject.space],
124
- );
125
-
126
- return (
127
- <StackItem.Content>
128
- <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
129
- </StackItem.Content>
130
- );
131
- },
132
- }),
133
- createSurface({
134
- id: `${DEBUG_PLUGIN}/graph`,
135
- role: 'article',
136
- filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
137
- component: ({ data }) => <DebugApp graph={data.subject.graph} />,
138
- }),
139
- createSurface({
140
- id: `${DEBUG_PLUGIN}/wireframe`,
141
- role: ['article', 'section'],
142
- position: 'hoist',
143
- filter: (data): data is { subject: Obj.Any } => {
144
- const settings = context
145
- .getCapability(Capabilities.SettingsStore)
146
- .getStore<DebugSettingsProps>(DEBUG_PLUGIN)!.value;
147
- return Obj.isObject(data.subject) && !!settings.wireframe;
148
- },
149
- component: ({ data, role }) => (
150
- <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
151
- ),
152
- }),
153
- createSurface({
154
- id: `${DEBUG_PLUGIN}/object-debug`,
155
- role: 'article',
156
- filter: (data): data is { companionTo: Obj.Any } => data.subject === 'debug' && Obj.isObject(data.companionTo),
157
- component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
158
- }),
159
- createSurface({
160
- id: `${DEBUG_PLUGIN}/devtools-overview`,
161
- role: 'deck-companion--devtools',
162
- component: () => <DevtoolsOverviewContainer />,
163
- }),
164
- createSurface({
165
- id: `${DEBUG_PLUGIN}/status`,
166
- role: 'status',
167
- component: () => <DebugStatus />,
168
- }),
169
-
170
- //
171
- // Devtools
172
- //
173
-
174
- createSurface({
175
- id: `${DEBUG_PLUGIN}/client/config`,
176
- role: 'article',
177
- filter: (data): data is any => data.subject === Devtools.Client.Config,
178
- component: () => <ConfigPanel vaultSelector={false} />,
179
- }),
180
- createSurface({
181
- id: `${DEBUG_PLUGIN}/client/storage`,
182
- role: 'article',
183
- filter: (data): data is any => data.subject === Devtools.Client.Storage,
184
- component: () => <StoragePanel />,
185
- }),
186
- createSurface({
187
- id: `${DEBUG_PLUGIN}/client/logs`,
188
- role: 'article',
189
- filter: (data): data is any => data.subject === Devtools.Client.Logs,
190
- component: () => <LoggingPanel />,
191
- }),
192
- createSurface({
193
- id: `${DEBUG_PLUGIN}/client/diagnostics`,
194
- role: 'article',
195
- filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
196
- component: () => <DiagnosticsPanel />,
197
- }),
198
- createSurface({
199
- id: `${DEBUG_PLUGIN}/client/tracing`,
200
- role: 'article',
201
- filter: (data): data is any => data.subject === Devtools.Client.Tracing,
202
- component: () => <TracingPanel />,
203
- }),
204
- createSurface({
205
- id: `${DEBUG_PLUGIN}/halo/identity`,
206
- role: 'article',
207
- filter: (data): data is any => data.subject === Devtools.Halo.Identity,
208
- component: () => <IdentityPanel />,
209
- }),
210
- createSurface({
211
- id: `${DEBUG_PLUGIN}/halo/devices`,
212
- role: 'article',
213
- filter: (data): data is any => data.subject === Devtools.Halo.Devices,
214
- component: () => <DeviceListPanel />,
215
- }),
216
- createSurface({
217
- id: `${DEBUG_PLUGIN}/halo/keyring`,
218
- role: 'article',
219
- filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
220
- component: () => <KeyringPanel />,
221
- }),
222
- createSurface({
223
- id: `${DEBUG_PLUGIN}/halo/credentials`,
224
- role: 'article',
225
- filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
226
- component: () => {
227
- const space = useCurrentSpace();
228
- return <CredentialsPanel space={space} />;
229
- },
230
- }),
231
- createSurface({
232
- id: `${DEBUG_PLUGIN}/echo/spaces`,
233
- role: 'article',
234
- filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
235
- component: () => {
236
- const { dispatchPromise: dispatch } = useIntentDispatcher();
237
- const handleSelect = useCallback(
238
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Space] })),
239
- [dispatch],
240
- );
241
- return <SpaceListPanel onSelect={handleSelect} />;
242
- },
243
- }),
244
- createSurface({
245
- id: `${DEBUG_PLUGIN}/echo/space`,
246
- role: 'article',
247
- filter: (data): data is any => data.subject === Devtools.Echo.Space,
248
- component: () => {
249
- const space = useCurrentSpace();
250
- const { dispatchPromise: dispatch } = useIntentDispatcher();
251
- const handleSelect = useCallback(
252
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Feeds] })),
253
- [dispatch],
254
- );
255
- return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
256
- },
257
- }),
258
- createSurface({
259
- id: `${DEBUG_PLUGIN}/echo/feeds`,
260
- role: 'article',
261
- filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
262
- component: () => {
263
- const space = useCurrentSpace();
264
- return <FeedsPanel space={space} />;
265
- },
266
- }),
267
- createSurface({
268
- id: `${DEBUG_PLUGIN}/echo/objects`,
269
- role: 'article',
270
- filter: (data): data is any => data.subject === Devtools.Echo.Objects,
271
- component: () => {
272
- const space = useCurrentSpace();
273
- return <ObjectsPanel space={space} />;
274
- },
275
- }),
276
- createSurface({
277
- id: `${DEBUG_PLUGIN}/echo/schema`,
278
- role: 'article',
279
- filter: (data): data is any => data.subject === Devtools.Echo.Schema,
280
- component: () => {
281
- const space = useCurrentSpace();
282
- return <SchemaPanel space={space} />;
283
- },
284
- }),
285
- createSurface({
286
- id: `${DEBUG_PLUGIN}/echo/automerge`,
287
- role: 'article',
288
- filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
289
- component: () => {
290
- const space = useCurrentSpace();
291
- return <AutomergePanel space={space} />;
292
- },
293
- }),
294
- createSurface({
295
- id: `${DEBUG_PLUGIN}/echo/queues`,
296
- role: 'article',
297
- filter: (data): data is any => data.subject === Devtools.Echo.Queues,
298
- component: () => <QueuesPanel />,
299
- }),
300
- createSurface({
301
- id: `${DEBUG_PLUGIN}/echo/members`,
302
- role: 'article',
303
- filter: (data): data is any => data.subject === Devtools.Echo.Members,
304
- component: () => {
305
- const space = useCurrentSpace();
306
- return <MembersPanel space={space} />;
307
- },
308
- }),
309
- createSurface({
310
- id: `${DEBUG_PLUGIN}/echo/metadata`,
311
- role: 'article',
312
- filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
313
- component: () => <MetadataPanel />,
314
- }),
315
- createSurface({
316
- id: `${DEBUG_PLUGIN}/mesh/signal`,
317
- role: 'article',
318
- filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
319
- component: () => <SignalPanel />,
320
- }),
321
- createSurface({
322
- id: `${DEBUG_PLUGIN}/mesh/swarm`,
323
- role: 'article',
324
- filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
325
- component: () => <SwarmPanel />,
326
- }),
327
- createSurface({
328
- id: `${DEBUG_PLUGIN}/mesh/network`,
329
- role: 'article',
330
- filter: (data): data is any => data.subject === Devtools.Mesh.Network,
331
- component: () => {
332
- const space = useCurrentSpace();
333
- return <NetworkPanel space={space} />;
334
- },
335
- }),
336
- // TODO(wittjosiah): Remove?
337
- // createSurface({
338
- // id: `${DEBUG_PLUGIN}/agent/dashboard`,
339
- // role: 'article',
340
- // filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
341
- // component: () => <DashboardPanel />,
342
- // }),
343
- createSurface({
344
- id: `${DEBUG_PLUGIN}/edge/dashboard`,
345
- role: 'article',
346
- filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
347
- component: () => <EdgeDashboardPanel />,
348
- }),
349
- createSurface({
350
- id: `${DEBUG_PLUGIN}/edge/workflows`,
351
- role: 'article',
352
- filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
353
- component: () => {
354
- const space = useCurrentSpace();
355
- return <WorkflowPanel space={space} />;
356
- },
357
- }),
358
- createSurface({
359
- id: `${DEBUG_PLUGIN}/edge/traces`,
360
- role: 'article',
361
- filter: (data): data is any => data.subject === Devtools.Edge.Traces,
362
- component: () => {
363
- const space = useCurrentSpace();
364
- return <InvocationTraceContainer space={space} detailAxis='block' />;
365
- },
366
- }),
367
- createSurface({
368
- id: `${DEBUG_PLUGIN}/edge/testing`,
369
- role: 'article',
370
- filter: (data): data is any => data.subject === Devtools.Edge.Testing,
371
- component: () => {
372
- const { dispatchPromise: dispatch } = useIntentDispatcher();
373
- const onSpaceCreate = useCallback(
374
- async (space: Space) => {
375
- await space.waitUntilReady();
376
- await dispatch(createIntent(SpaceAction.Migrate, { space }));
377
- await space.db.flush();
378
- },
379
- [dispatch],
380
- );
381
- const onScriptPluginOpen = useCallback(
382
- async (space: Space) => {
383
- await space.waitUntilReady();
384
- const result = await dispatch(
385
- pipe(createIntent(ScriptAction.Create, { space }), chain(SpaceAction.AddObject, { target: space })),
386
- );
387
- log.info('script created', { result });
388
- await dispatch(
389
- createIntent(LayoutAction.Open, { part: 'main', subject: [`${space.id}:${result.data?.object.id}`] }),
390
- );
391
- },
392
- [dispatch],
393
- );
394
- return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
395
- },
396
- }),
397
- ]);
@@ -1,19 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capabilities, contributes } from '@dxos/app-framework';
6
- import { live } from '@dxos/live-object';
7
-
8
- import { meta } from '../meta';
9
- import { type DebugSettingsProps, DebugSettingsSchema } from '../types';
10
-
11
- export default () => {
12
- const settings = live<DebugSettingsProps>({});
13
-
14
- return contributes(Capabilities.Settings, {
15
- prefix: meta.id,
16
- schema: DebugSettingsSchema,
17
- value: settings,
18
- });
19
- };
@@ -1,15 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type PropsWithChildren, type ReactNode } from 'react';
6
-
7
- // TODO(burdon): Convert to grid.
8
- export const Container = ({ toolbar, children }: PropsWithChildren<{ toolbar: ReactNode }>) => {
9
- return (
10
- <div role='none' className='flex flex-col grow overflow-hidden divide-y divide-separator'>
11
- {toolbar}
12
- <div className='flex flex-col grow overflow-auto'>{children}</div>
13
- </div>
14
- );
15
- };
@@ -1,84 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC, useEffect, useState } from 'react';
6
-
7
- import { type Graph } from '@dxos/plugin-graph';
8
- import { useClient, useConfig } from '@dxos/react-client';
9
- import { ToggleGroup, ToggleGroupItem, Toolbar, Icon, IconButton } from '@dxos/react-ui';
10
-
11
- import { Json, Tree } from './Tree';
12
- import { Container } from '../Container';
13
-
14
- export const DebugApp: FC<{ graph: Graph }> = ({ graph }) => {
15
- const [view, setView] = useState<'config' | 'diagnostics' | 'graph'>('graph');
16
- const [data, setData] = useState<any>({});
17
- const client = useClient();
18
- const config = useConfig();
19
- const handleRefresh = async () => {
20
- const data = await client.diagnostics({ truncate: true });
21
- setData(data);
22
- };
23
- useEffect(() => {
24
- void handleRefresh();
25
- }, []);
26
-
27
- const handleResetClient = async (force = false) => {
28
- if (!force && !window.confirm('Reset storage?')) {
29
- return;
30
- }
31
-
32
- // TODO(burdon): Throws exception.
33
- await client.reset();
34
- window.location.href = window.location.origin;
35
- };
36
-
37
- const handleOpenDevtools = () => {
38
- const vaultUrl = config.values?.runtime?.client?.remoteSource;
39
- if (vaultUrl) {
40
- window.open(`https://devtools.dev.dxos.org/?target=${vaultUrl}`);
41
- }
42
- };
43
-
44
- return (
45
- <Container
46
- toolbar={
47
- <Toolbar.Root classNames='p-1'>
48
- <ToggleGroup type='single' value={view}>
49
- <ToggleGroupItem value={'graph'} onClick={() => setView('graph')} title={'Plugin graph'}>
50
- <Icon icon='ph--graph--regular' size={5} />
51
- </ToggleGroupItem>
52
- <ToggleGroupItem value={'diagnostics'} onClick={() => setView('diagnostics')} title={'Diagnostics'}>
53
- <Icon icon='ph--gauge--regular' size={5} />
54
- </ToggleGroupItem>
55
- <ToggleGroupItem value={'config'} onClick={() => setView('config')} title={'Config'}>
56
- <Icon icon='ph--gear--regular' size={5} />
57
- </ToggleGroupItem>
58
- </ToggleGroup>
59
-
60
- <Toolbar.Separator variant='gap' />
61
- <IconButton
62
- icon='ph--warning--regular'
63
- iconOnly
64
- size={5}
65
- classNames='text-red-700'
66
- onClick={(event) => handleResetClient(event.shiftKey)}
67
- label='Reset client'
68
- />
69
- <IconButton
70
- icon='ph--toolbox--duotone'
71
- iconOnly
72
- size={5}
73
- onClick={handleOpenDevtools}
74
- label='Open Devtools'
75
- />
76
- </Toolbar.Root>
77
- }
78
- >
79
- {view === 'graph' && <Tree data={graph.toJSON()} />}
80
- {view === 'config' && <Json data={data.diagnostics?.config} />}
81
- {view === 'diagnostics' && <Json data={data} />}
82
- </Container>
83
- );
84
- };
@@ -1,103 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC, type HTMLAttributes, useState } from 'react';
6
-
7
- import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
8
- import { mx } from '@dxos/react-ui-theme';
9
- import { arrayToBuffer } from '@dxos/util';
10
-
11
- // TODO(burdon): Copied form devtools.
12
-
13
- export const replacer = (key: any, value: any) => {
14
- if (typeof value === 'object') {
15
- if (value instanceof Uint8Array) {
16
- return arrayToBuffer(value).toString('hex');
17
- }
18
-
19
- if (value?.type === 'Buffer') {
20
- return Buffer.from(value.data).toString('hex');
21
- }
22
-
23
- if (key === 'downloaded') {
24
- return undefined;
25
- }
26
- }
27
-
28
- return value;
29
- };
30
-
31
- export const Json: FC<{ data?: object }> = ({ data }) => {
32
- return <SyntaxHighlighter language='json'>{JSON.stringify(data, replacer, 2)}</SyntaxHighlighter>;
33
- };
34
-
35
- export const Tree: FC<{ data?: object }> = ({ data }) => {
36
- return (
37
- <div className='p-2'>
38
- <Node data={data} root />
39
- </div>
40
- );
41
- };
42
-
43
- export const Node: FC<{ data?: any; root?: boolean }> = ({ data, root }) => {
44
- if (typeof data !== 'object' || data === undefined || data === null) {
45
- return <Scalar value={data} />;
46
- }
47
-
48
- if (Array.isArray(data)) {
49
- return (
50
- <div className='flex flex-col space-y-2'>
51
- {data.map((value, index) => (
52
- <KeyValue key={index} label={String(index)} data={value} className='bg-teal-50' />
53
- ))}
54
- </div>
55
- );
56
- }
57
-
58
- return (
59
- <div className='flex flex-col space-y-2'>
60
- {Object.entries(data).map(([key, value]) => (
61
- <KeyValue key={key} label={key} data={value} className='bg-blue-50' />
62
- ))}
63
- </div>
64
- );
65
- };
66
-
67
- export const KeyValue: FC<{ label: string; data?: any; className?: string }> = ({ label, data, className }) => {
68
- const [open, setOpen] = useState(true);
69
- if (data === undefined) {
70
- return null;
71
- }
72
-
73
- return (
74
- <div className='flex'>
75
- <Box
76
- className={mx('border-blue-200 text-sm select-none cursor-pointer', className)}
77
- onClick={() => setOpen((open) => !open)}
78
- >
79
- {label}
80
- </Box>
81
- {open && <Node data={data} />}
82
- </div>
83
- );
84
- };
85
-
86
- const Scalar: FC<{ value: any }> = ({ value }) => {
87
- return (
88
- <Box className='bg-green-50 border-green-200 rounded-r text-sm font-thin'>
89
- {(value === undefined && 'undefined') ||
90
- (value === null && 'null') ||
91
- (typeof value === 'string' && value) ||
92
- JSON.stringify(value)}
93
- </Box>
94
- );
95
- };
96
-
97
- const Box: FC<HTMLAttributes<HTMLDivElement>> = ({ children, className, ...props }) => {
98
- return (
99
- <div className={mx('flex px-2 border border-l-0 font-mono truncate', className)} {...props}>
100
- {children}
101
- </div>
102
- );
103
- };
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { DebugApp } from './DebugApp';
6
-
7
- export default DebugApp;
@@ -1,35 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type Obj } from '@dxos/echo';
8
- import { Clipboard, Input, Toolbar } from '@dxos/react-ui';
9
- import { StackItem } from '@dxos/react-ui-stack';
10
- import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
11
-
12
- export type DebugObjectPanelProps = {
13
- object: Obj.Any;
14
- };
15
-
16
- // TODO(burdon): Get schema and traverse references.
17
- export const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {
18
- const dxn = `dxn:echo:@:${object.id}`;
19
-
20
- return (
21
- <Clipboard.Provider>
22
- <StackItem.Content toolbar>
23
- <Toolbar.Root>
24
- <Input.Root>
25
- <Input.TextInput disabled value={dxn} />
26
- <Clipboard.IconButton value={dxn} />
27
- </Input.Root>
28
- </Toolbar.Root>
29
- <SyntaxHighlighter classNames='flex text-xs' language='json'>
30
- {JSON.stringify(object, null, 2)}
31
- </SyntaxHighlighter>
32
- </StackItem.Content>
33
- </Clipboard.Provider>
34
- );
35
- };