@dxos/plugin-debug 0.8.4-main.c4373fc → 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 (188) 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-54FUIZIH.mjs → SpaceGenerator-SWSGJEEL.mjs} +476 -461
  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-SRV2AIGJ.mjs → chunk-4UFQXPP7.mjs} +11 -1
  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 +42 -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/index.d.ts +2 -2
  58. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  59. package/dist/types/src/components/SpaceGenerator/presets.d.ts +2 -5
  60. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  61. package/dist/types/src/components/index.d.ts +2 -10
  62. package/dist/types/src/components/index.d.ts.map +1 -1
  63. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  64. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  65. package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
  66. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  67. package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +2 -2
  68. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  69. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
  70. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  71. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +10 -0
  72. package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
  73. package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
  74. package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -0
  75. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
  76. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  77. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -0
  78. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  79. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  80. package/dist/types/src/containers/DebugStatus/index.d.ts +3 -0
  81. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  82. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  83. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  84. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +3 -0
  85. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  86. package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts +2 -2
  87. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
  88. package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -0
  89. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  90. package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
  91. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  92. package/dist/types/src/containers/Wireframe/index.d.ts +3 -0
  93. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  94. package/dist/types/src/containers/index.d.ts +10 -0
  95. package/dist/types/src/containers/index.d.ts.map +1 -0
  96. package/dist/types/src/meta.d.ts +2 -2
  97. package/dist/types/src/meta.d.ts.map +1 -1
  98. package/dist/types/src/translations.d.ts +3 -1
  99. package/dist/types/src/translations.d.ts.map +1 -1
  100. package/dist/types/src/types.d.ts +5 -0
  101. package/dist/types/src/types.d.ts.map +1 -1
  102. package/dist/types/tsconfig.tsbuildinfo +1 -1
  103. package/package.json +75 -69
  104. package/src/DebugPlugin.tsx +27 -31
  105. package/src/capabilities/app-graph-builder/app-graph-builder.ts +441 -0
  106. package/src/capabilities/app-graph-builder/index.ts +7 -0
  107. package/src/capabilities/index.ts +4 -6
  108. package/src/capabilities/react-context/index.ts +7 -0
  109. package/src/capabilities/react-context/react-context.tsx +20 -0
  110. package/src/capabilities/react-surface/index.ts +7 -0
  111. package/src/capabilities/react-surface/react-surface.tsx +428 -0
  112. package/src/capabilities/settings/index.ts +7 -0
  113. package/src/capabilities/settings/settings.ts +31 -0
  114. package/src/components/SchemaTable/index.ts +5 -0
  115. package/src/components/SpaceGenerator/ObjectGenerator.tsx +26 -32
  116. package/src/components/SpaceGenerator/index.ts +2 -3
  117. package/src/components/SpaceGenerator/presets.ts +258 -141
  118. package/src/components/index.ts +2 -10
  119. package/src/containers/DebugGraph/DebugGraph.tsx +13 -0
  120. package/src/containers/DebugGraph/index.ts +7 -0
  121. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +45 -0
  122. package/src/containers/DebugObjectPanel/index.ts +7 -0
  123. package/src/{components → containers/DebugSettings}/DebugSettings.tsx +78 -36
  124. package/src/containers/DebugSettings/index.ts +7 -0
  125. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +60 -0
  126. package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
  127. package/src/containers/DebugStatus/index.ts +7 -0
  128. package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +2 -4
  129. package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
  130. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +127 -0
  131. package/src/containers/SpaceGenerator/index.ts +7 -0
  132. package/src/{components → containers/Wireframe}/Wireframe.tsx +6 -7
  133. package/src/containers/Wireframe/index.ts +7 -0
  134. package/src/containers/index.ts +14 -0
  135. package/src/meta.ts +7 -4
  136. package/src/translations.ts +3 -1
  137. package/src/types.ts +8 -0
  138. package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs +0 -20
  139. package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +0 -7
  140. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs +0 -25
  141. package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs.map +0 -7
  142. package/dist/lib/browser/SpaceGenerator-54FUIZIH.mjs.map +0 -7
  143. package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs +0 -588
  144. package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs.map +0 -7
  145. package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +0 -7
  146. package/dist/lib/browser/chunk-SVCKCXCL.mjs +0 -16
  147. package/dist/lib/browser/chunk-SVCKCXCL.mjs.map +0 -7
  148. package/dist/lib/browser/react-context-QLZE7VSQ.mjs +0 -16
  149. package/dist/lib/browser/react-context-QLZE7VSQ.mjs.map +0 -7
  150. package/dist/lib/browser/react-surface-BTWJ2I3F.mjs +0 -772
  151. package/dist/lib/browser/react-surface-BTWJ2I3F.mjs.map +0 -7
  152. package/dist/lib/browser/settings-EBVICEEW.mjs +0 -22
  153. package/dist/lib/browser/settings-EBVICEEW.mjs.map +0 -7
  154. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  155. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  156. package/dist/types/src/capabilities/react-context.d.ts +0 -8
  157. package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
  158. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  159. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  160. package/dist/types/src/capabilities/settings.d.ts +0 -4
  161. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  162. package/dist/types/src/components/Container.d.ts +0 -5
  163. package/dist/types/src/components/Container.d.ts.map +0 -1
  164. package/dist/types/src/components/DebugGraph.d.ts +0 -8
  165. package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
  166. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  167. package/dist/types/src/components/DebugSettings.d.ts +0 -6
  168. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  169. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  170. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  171. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  172. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
  173. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
  174. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  175. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  176. package/src/capabilities/app-graph-builder.ts +0 -431
  177. package/src/capabilities/react-context.tsx +0 -16
  178. package/src/capabilities/react-surface.tsx +0 -399
  179. package/src/capabilities/settings.ts +0 -19
  180. package/src/components/Container.tsx +0 -15
  181. package/src/components/DebugGraph.tsx +0 -14
  182. package/src/components/DebugObjectPanel.tsx +0 -33
  183. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
  184. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
  185. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  186. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  187. /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
  188. /package/src/{components → containers/DebugStatus}/DebugStatus.tsx +0 -0
@@ -1,399 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Function from 'effect/Function';
6
- import React, { useCallback } from 'react';
7
-
8
- import {
9
- Capabilities,
10
- LayoutAction,
11
- type PluginContext,
12
- chain,
13
- contributes,
14
- createIntent,
15
- createSurface,
16
- useCapability,
17
- useIntentDispatcher,
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 { type Space, SpaceState, isSpace, parseId } from '@dxos/react-client/echo';
54
- import { StackItem } from '@dxos/react-ui-stack';
55
- import { DataType } from '@dxos/schema';
56
-
57
- import {
58
- DebugGraph,
59
- DebugObjectPanel,
60
- DebugSettings,
61
- DebugStatus,
62
- DevtoolsOverviewContainer,
63
- SpaceGenerator,
64
- Wireframe,
65
- } from '../components';
66
- import { meta } 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
- root: string;
77
- };
78
-
79
- const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}/space` && isSpace(data.space);
80
- const isGraphDebug = (data: any): data is GraphDebug => data?.graph instanceof Graph && typeof data?.root === 'string';
81
-
82
- // TODO(wittjosiah): Factor out?
83
- const useCurrentSpace = () => {
84
- const layout = useCapability(Capabilities.Layout);
85
- const client = useCapability(ClientCapabilities.Client);
86
- const { spaceId } = parseId(layout.workspace);
87
- const space = spaceId ? client.spaces.get(spaceId) : undefined;
88
- return space;
89
- };
90
-
91
- export default (context: PluginContext) =>
92
- contributes(Capabilities.ReactSurface, [
93
- createSurface({
94
- id: `${meta.id}/plugin-settings`,
95
- role: 'article',
96
- filter: (data): data is { subject: SettingsStore<DebugSettingsProps> } =>
97
- data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
98
- component: ({ data: { subject } }) => <DebugSettings settings={subject.value} />,
99
- }),
100
- createSurface({
101
- id: `${meta.id}/space`,
102
- role: 'article',
103
- filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
104
- component: ({ data }) => {
105
- const { dispatchPromise: dispatch } = useIntentDispatcher();
106
-
107
- const handleCreateObject = useCallback(
108
- (objects: Obj.Any[]) => {
109
- if (!isSpace(data.subject.space)) {
110
- return;
111
- }
112
-
113
- const collection =
114
- data.subject.space.state.get() === SpaceState.SPACE_READY &&
115
- data.subject.space.properties[DataType.Collection.typename]?.target;
116
- if (!Obj.instanceOf(DataType.Collection, collection)) {
117
- return;
118
- }
119
-
120
- objects.forEach((object) => {
121
- void dispatch(createIntent(SpaceAction.AddObject, { target: collection, object }));
122
- });
123
- },
124
- [data.subject.space],
125
- );
126
-
127
- return (
128
- <StackItem.Content>
129
- <SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
130
- </StackItem.Content>
131
- );
132
- },
133
- }),
134
- createSurface({
135
- id: `${meta.id}/graph`,
136
- role: 'article',
137
- filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
138
- component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
139
- }),
140
- createSurface({
141
- id: `${meta.id}/wireframe`,
142
- role: ['article', 'section'],
143
- position: 'hoist',
144
- filter: (data): data is { subject: Obj.Any } => {
145
- const settings = context.getCapability(Capabilities.SettingsStore).getStore<DebugSettingsProps>(meta.id)!.value;
146
- return Obj.isObject(data.subject) && !!settings.wireframe;
147
- },
148
- component: ({ data, role }) => (
149
- <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
150
- ),
151
- }),
152
- createSurface({
153
- id: `${meta.id}/object-debug`,
154
- role: 'article',
155
- filter: (data): data is { companionTo: Obj.Any } => data.subject === 'debug' && Obj.isObject(data.companionTo),
156
- component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
157
- }),
158
- createSurface({
159
- id: `${meta.id}/devtools-overview`,
160
- role: 'deck-companion--devtools',
161
- component: () => <DevtoolsOverviewContainer />,
162
- }),
163
- createSurface({
164
- id: `${meta.id}/status`,
165
- role: 'status',
166
- component: () => <DebugStatus />,
167
- }),
168
-
169
- //
170
- // Devtools
171
- //
172
-
173
- createSurface({
174
- id: `${meta.id}/client/config`,
175
- role: 'article',
176
- filter: (data): data is any => data.subject === Devtools.Client.Config,
177
- component: () => <ConfigPanel vaultSelector={false} />,
178
- }),
179
- createSurface({
180
- id: `${meta.id}/client/storage`,
181
- role: 'article',
182
- filter: (data): data is any => data.subject === Devtools.Client.Storage,
183
- component: () => <StoragePanel />,
184
- }),
185
- createSurface({
186
- id: `${meta.id}/client/logs`,
187
- role: 'article',
188
- filter: (data): data is any => data.subject === Devtools.Client.Logs,
189
- component: () => <LoggingPanel />,
190
- }),
191
- createSurface({
192
- id: `${meta.id}/client/diagnostics`,
193
- role: 'article',
194
- filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
195
- component: () => <DiagnosticsPanel />,
196
- }),
197
- createSurface({
198
- id: `${meta.id}/client/tracing`,
199
- role: 'article',
200
- filter: (data): data is any => data.subject === Devtools.Client.Tracing,
201
- component: () => <TracingPanel />,
202
- }),
203
- createSurface({
204
- id: `${meta.id}/halo/identity`,
205
- role: 'article',
206
- filter: (data): data is any => data.subject === Devtools.Halo.Identity,
207
- component: () => <IdentityPanel />,
208
- }),
209
- createSurface({
210
- id: `${meta.id}/halo/devices`,
211
- role: 'article',
212
- filter: (data): data is any => data.subject === Devtools.Halo.Devices,
213
- component: () => <DeviceListPanel />,
214
- }),
215
- createSurface({
216
- id: `${meta.id}/halo/keyring`,
217
- role: 'article',
218
- filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
219
- component: () => <KeyringPanel />,
220
- }),
221
- createSurface({
222
- id: `${meta.id}/halo/credentials`,
223
- role: 'article',
224
- filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
225
- component: () => {
226
- const space = useCurrentSpace();
227
- return <CredentialsPanel space={space} />;
228
- },
229
- }),
230
- createSurface({
231
- id: `${meta.id}/echo/spaces`,
232
- role: 'article',
233
- filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
234
- component: () => {
235
- const { dispatchPromise: dispatch } = useIntentDispatcher();
236
- const handleSelect = useCallback(
237
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Space] })),
238
- [dispatch],
239
- );
240
- return <SpaceListPanel onSelect={handleSelect} />;
241
- },
242
- }),
243
- createSurface({
244
- id: `${meta.id}/echo/space`,
245
- role: 'article',
246
- filter: (data): data is any => data.subject === Devtools.Echo.Space,
247
- component: () => {
248
- const space = useCurrentSpace();
249
- const { dispatchPromise: dispatch } = useIntentDispatcher();
250
- const handleSelect = useCallback(
251
- () => dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [Devtools.Echo.Feeds] })),
252
- [dispatch],
253
- );
254
- return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
255
- },
256
- }),
257
- createSurface({
258
- id: `${meta.id}/echo/feeds`,
259
- role: 'article',
260
- filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
261
- component: () => {
262
- const space = useCurrentSpace();
263
- return <FeedsPanel space={space} />;
264
- },
265
- }),
266
- createSurface({
267
- id: `${meta.id}/echo/objects`,
268
- role: 'article',
269
- filter: (data): data is any => data.subject === Devtools.Echo.Objects,
270
- component: () => {
271
- const space = useCurrentSpace();
272
- return <ObjectsPanel space={space} />;
273
- },
274
- }),
275
- createSurface({
276
- id: `${meta.id}/echo/schema`,
277
- role: 'article',
278
- filter: (data): data is any => data.subject === Devtools.Echo.Schema,
279
- component: () => {
280
- const space = useCurrentSpace();
281
- return <SchemaPanel space={space} />;
282
- },
283
- }),
284
- createSurface({
285
- id: `${meta.id}/echo/automerge`,
286
- role: 'article',
287
- filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
288
- component: () => {
289
- const space = useCurrentSpace();
290
- return <AutomergePanel space={space} />;
291
- },
292
- }),
293
- createSurface({
294
- id: `${meta.id}/echo/queues`,
295
- role: 'article',
296
- filter: (data): data is any => data.subject === Devtools.Echo.Queues,
297
- component: () => <QueuesPanel />,
298
- }),
299
- createSurface({
300
- id: `${meta.id}/echo/members`,
301
- role: 'article',
302
- filter: (data): data is any => data.subject === Devtools.Echo.Members,
303
- component: () => {
304
- const space = useCurrentSpace();
305
- return <MembersPanel space={space} />;
306
- },
307
- }),
308
- createSurface({
309
- id: `${meta.id}/echo/metadata`,
310
- role: 'article',
311
- filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
312
- component: () => <MetadataPanel />,
313
- }),
314
- createSurface({
315
- id: `${meta.id}/mesh/signal`,
316
- role: 'article',
317
- filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
318
- component: () => <SignalPanel />,
319
- }),
320
- createSurface({
321
- id: `${meta.id}/mesh/swarm`,
322
- role: 'article',
323
- filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
324
- component: () => <SwarmPanel />,
325
- }),
326
- createSurface({
327
- id: `${meta.id}/mesh/network`,
328
- role: 'article',
329
- filter: (data): data is any => data.subject === Devtools.Mesh.Network,
330
- component: () => {
331
- const space = useCurrentSpace();
332
- return <NetworkPanel space={space} />;
333
- },
334
- }),
335
- // TODO(wittjosiah): Remove?
336
- // createSurface({
337
- // id: `${meta.id}/agent/dashboard`,
338
- // role: 'article',
339
- // filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
340
- // component: () => <DashboardPanel />,
341
- // }),
342
- createSurface({
343
- id: `${meta.id}/edge/dashboard`,
344
- role: 'article',
345
- filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
346
- component: () => <EdgeDashboardPanel />,
347
- }),
348
- createSurface({
349
- id: `${meta.id}/edge/workflows`,
350
- role: 'article',
351
- filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
352
- component: () => {
353
- const space = useCurrentSpace();
354
- return <WorkflowPanel space={space} />;
355
- },
356
- }),
357
- createSurface({
358
- id: `${meta.id}/edge/traces`,
359
- role: 'article',
360
- filter: (data): data is any => data.subject === Devtools.Edge.Traces,
361
- component: () => {
362
- const space = useCurrentSpace();
363
- return <InvocationTraceContainer space={space} detailAxis='block' />;
364
- },
365
- }),
366
- createSurface({
367
- id: `${meta.id}/edge/testing`,
368
- role: 'article',
369
- filter: (data): data is any => data.subject === Devtools.Edge.Testing,
370
- component: () => {
371
- const { dispatchPromise: dispatch } = useIntentDispatcher();
372
- const onSpaceCreate = useCallback(
373
- async (space: Space) => {
374
- await space.waitUntilReady();
375
- await dispatch(createIntent(SpaceAction.Migrate, { space }));
376
- await space.db.flush();
377
- },
378
- [dispatch],
379
- );
380
- const onScriptPluginOpen = useCallback(
381
- async (space: Space) => {
382
- await space.waitUntilReady();
383
- const result = await dispatch(
384
- Function.pipe(
385
- createIntent(ScriptAction.CreateScript, { space }),
386
- chain(SpaceAction.AddObject, { target: space }),
387
- ),
388
- );
389
- log.info('script created', { result });
390
- await dispatch(
391
- createIntent(LayoutAction.Open, { part: 'main', subject: [`${space.id}:${result.data?.object.id}`] }),
392
- );
393
- },
394
- [dispatch],
395
- );
396
- return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
397
- },
398
- }),
399
- ]);
@@ -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,14 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React, { type FC } from 'react';
6
-
7
- import { Tree } from '@dxos/devtools';
8
- import { type Graph } from '@dxos/plugin-graph';
9
-
10
- export const DebugGraph: FC<{ graph: Graph; root: string }> = ({ graph, root }) => {
11
- return <Tree data={graph.toJSON(root)} />;
12
- };
13
-
14
- export default DebugGraph;
@@ -1,33 +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 { Json } 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
- <Json data={object} />
30
- </StackItem.Content>
31
- </Clipboard.Provider>
32
- );
33
- };
@@ -1,52 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React from 'react';
7
-
8
- import { IntentPlugin } from '@dxos/app-framework';
9
- import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { ClientPlugin } from '@dxos/plugin-client';
11
- import { useSpaces } from '@dxos/react-client/echo';
12
- import { withTheme } from '@dxos/react-ui/testing';
13
- import { render } from '@dxos/storybook-utils';
14
-
15
- import { SpaceGenerator } from './SpaceGenerator';
16
-
17
- const DefaultStory = () => {
18
- const [space] = useSpaces();
19
- if (!space) {
20
- return null;
21
- }
22
-
23
- return <SpaceGenerator space={space} />;
24
- };
25
-
26
- const meta = {
27
- title: 'plugins/plugin-debug/SpaceGenerator',
28
- component: SpaceGenerator as any,
29
- render: render(DefaultStory),
30
- decorators: [
31
- withTheme,
32
- withPluginManager({
33
- plugins: [
34
- ClientPlugin({
35
- onClientInitialized: async ({ client }) => {
36
- await client.halo.createIdentity();
37
- },
38
- }),
39
- IntentPlugin(),
40
- ],
41
- }),
42
- ],
43
- parameters: {
44
- layout: 'fullscreen',
45
- },
46
- } satisfies Meta<typeof DefaultStory>;
47
-
48
- export default meta;
49
-
50
- type Story = StoryObj<typeof meta>;
51
-
52
- export const Default: Story = {};
@@ -1,122 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { useCallback, useMemo, useState } from 'react';
6
-
7
- import { useIntentDispatcher } from '@dxos/app-framework';
8
- import { ComputeGraph } from '@dxos/conductor';
9
- import { Filter, type Obj } from '@dxos/echo';
10
- import { Markdown } from '@dxos/plugin-markdown/types';
11
- import { SheetType } from '@dxos/plugin-sheet/types';
12
- import { DiagramType } from '@dxos/plugin-sketch/types';
13
- import { useClient } from '@dxos/react-client';
14
- import { type Space, getTypename } from '@dxos/react-client/echo';
15
- import { IconButton, Input, Toolbar, useAsyncEffect } from '@dxos/react-ui';
16
- import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
17
- import { DataType } from '@dxos/schema';
18
- import { jsonKeyReplacer, sortKeys } from '@dxos/util';
19
-
20
- import { type ObjectGenerator, createGenerator, staticGenerators } from './ObjectGenerator';
21
- import { generator } from './presets';
22
- import { SchemaTable } from './SchemaTable';
23
-
24
- export type SpaceGeneratorProps = {
25
- space: Space;
26
- onCreateObjects?: (objects: Obj.Any[]) => void;
27
- };
28
-
29
- export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {
30
- const { dispatchPromise: dispatch } = useIntentDispatcher();
31
- const client = useClient();
32
- const staticTypes = [Markdown.Document, DiagramType, SheetType, ComputeGraph]; // TODO(burdon): Make extensible.
33
- const recordTypes = [DataType.Organization, DataType.Person, DataType.Task];
34
- const [count, setCount] = useState(1);
35
- const [info, setInfo] = useState<any>({});
36
- const presets = useMemo(() => generator(), []);
37
-
38
- // Create type generators.
39
- const typeMap = useMemo(() => {
40
- client.addTypes([...staticTypes, ...recordTypes, ...presets.schemas]);
41
- const recordGenerators = new Map<string, ObjectGenerator<any>>(
42
- recordTypes.map((type) => [type.typename, createGenerator(client, dispatch, type as any)]),
43
- );
44
-
45
- return new Map([...staticGenerators, ...presets.items, ...recordGenerators]);
46
- }, [client, recordTypes]);
47
-
48
- // Query space to get info.
49
- const updateInfo = async () => {
50
- // Create schema map.
51
- const echoSchema = await space.db.schemaRegistry.query().run();
52
- const staticSchema = space.db.graph.schemaRegistry.schemas;
53
-
54
- // Create object map.
55
- const { objects } = await space.db.query(Filter.everything()).run();
56
- const objectMap = sortKeys(
57
- objects.reduce<Record<string, number>>((map, obj) => {
58
- const type = getTypename(obj);
59
- if (type) {
60
- const count = map[type] ?? 0;
61
- map[type] = count + 1;
62
- }
63
- return map;
64
- }, {}),
65
- );
66
-
67
- setInfo({
68
- schema: {
69
- static: staticSchema.length,
70
- mutable: echoSchema.length,
71
- },
72
- objects: objectMap,
73
- });
74
- };
75
-
76
- useAsyncEffect(updateInfo, [space]);
77
-
78
- const handleCreateData = useCallback(
79
- async (typename: string) => {
80
- const constructor = typeMap.get(typename);
81
- if (constructor) {
82
- // TODO(burdon): Input to specify number of objects.
83
- await constructor(space, count, onCreateObjects);
84
- await updateInfo();
85
- }
86
- },
87
- [typeMap, count],
88
- );
89
-
90
- return (
91
- <div role='none' className='flex flex-col grow overflow-hidden'>
92
- <Toolbar.Root classNames='border-be border-subduedSeparator'>
93
- <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />
94
- <Toolbar.Separator variant='gap' />
95
- <Input.Root>
96
- <Input.TextInput
97
- type='number'
98
- min={1}
99
- max={100}
100
- placeholder={'Count'}
101
- classNames='!w-[4rem] !text-right'
102
- size={8}
103
- value={count}
104
- onChange={(ev) => setCount(parseInt(ev.target.value))}
105
- />
106
- </Input.Root>
107
- </Toolbar.Root>
108
-
109
- <div className='flex flex-col overflow-y-auto divide-y divide-separator'>
110
- <SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />
111
- <SchemaTable types={recordTypes} objects={info.objects} label='Record Types' onClick={handleCreateData} />
112
- <SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />
113
-
114
- <div>
115
- <SyntaxHighlighter language='json' classNames='text-xs'>
116
- {JSON.stringify({ space, ...info }, jsonKeyReplacer({ truncate: true }), 2)}
117
- </SyntaxHighlighter>
118
- </div>
119
- </div>
120
- </div>
121
- );
122
- };