@dxos/plugin-debug 0.8.4-main.937b3ca → 0.8.4-main.abd8ff62ef

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 (180) hide show
  1. package/dist/lib/browser/index.mjs +19 -118
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/browser/translations.mjs +81 -0
  5. package/dist/lib/browser/translations.mjs.map +7 -0
  6. package/dist/types/src/DebugPlugin.d.ts +3 -1
  7. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  8. package/dist/types/src/DebugPlugin.node.d.ts +5 -0
  9. package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
  10. package/dist/types/src/DebugPlugin.test.d.ts +2 -0
  11. package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
  12. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  13. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  14. package/dist/types/src/capabilities/index.d.ts +11 -4
  15. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  16. package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +1 -1
  17. package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
  18. package/dist/types/src/capabilities/react-surface.d.ts +9 -0
  19. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  20. package/dist/types/src/capabilities/settings.d.ts +7 -0
  21. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  22. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
  23. package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
  24. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +97 -0
  25. package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
  26. package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
  27. package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
  28. package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
  29. package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
  30. package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
  31. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
  32. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  33. package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
  34. package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
  35. package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
  36. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
  37. package/dist/types/src/components/index.d.ts +4 -10
  38. package/dist/types/src/components/index.d.ts.map +1 -1
  39. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
  40. package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
  41. package/dist/types/src/containers/DebugGraph/index.d.ts +2 -0
  42. package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
  43. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -0
  44. package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
  45. package/dist/types/src/containers/DebugObjectPanel/index.d.ts +2 -0
  46. package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
  47. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +5 -0
  48. package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
  49. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +2 -0
  50. package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
  51. package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
  52. package/dist/types/src/containers/DebugStatus/index.d.ts +2 -0
  53. package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
  54. package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
  55. package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
  56. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +2 -0
  57. package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
  58. package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +11 -0
  59. package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  60. package/dist/types/src/containers/SpaceGenerator/index.d.ts +2 -0
  61. package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
  62. package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
  63. package/dist/types/src/containers/Wireframe/index.d.ts +2 -0
  64. package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
  65. package/dist/types/src/containers/index.d.ts +9 -0
  66. package/dist/types/src/containers/index.d.ts.map +1 -0
  67. package/dist/types/src/index.d.ts +3 -1
  68. package/dist/types/src/index.d.ts.map +1 -1
  69. package/dist/types/src/translations.d.ts +78 -59
  70. package/dist/types/src/translations.d.ts.map +1 -1
  71. package/dist/types/src/types/Settings.d.ts +8 -0
  72. package/dist/types/src/types/Settings.d.ts.map +1 -0
  73. package/dist/types/src/types/index.d.ts +69 -0
  74. package/dist/types/src/types/index.d.ts.map +1 -0
  75. package/dist/types/tsconfig.tsbuildinfo +1 -1
  76. package/package.json +89 -70
  77. package/src/DebugPlugin.node.ts +18 -0
  78. package/src/DebugPlugin.test.ts +29 -0
  79. package/src/DebugPlugin.tsx +20 -11
  80. package/src/capabilities/app-graph-builder.ts +405 -0
  81. package/src/capabilities/index.ts +6 -4
  82. package/src/capabilities/react-context.tsx +25 -0
  83. package/src/capabilities/react-surface.tsx +439 -0
  84. package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
  85. package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
  86. package/src/components/DebugSettings/DebugSettings.tsx +262 -0
  87. package/src/components/DebugSettings/index.ts +5 -0
  88. package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
  89. package/src/components/SchemaTable/index.ts +5 -0
  90. package/src/components/SpaceGenerator/ObjectGenerator.tsx +14 -15
  91. package/src/components/SpaceGenerator/draw-util.ts +8 -8
  92. package/src/components/SpaceGenerator/index.ts +2 -3
  93. package/src/components/SpaceGenerator/presets.ts +55 -73
  94. package/src/components/index.ts +4 -11
  95. package/src/{components → containers/DebugGraph}/DebugGraph.tsx +3 -4
  96. package/src/containers/DebugGraph/index.ts +5 -0
  97. package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
  98. package/src/containers/DebugObjectPanel/index.ts +5 -0
  99. package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
  100. package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
  101. package/src/{components → containers/DebugStatus}/DebugStatus.tsx +41 -19
  102. package/src/containers/DebugStatus/index.ts +5 -0
  103. package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
  104. package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
  105. package/src/containers/SpaceGenerator/SpaceGenerator.tsx +126 -0
  106. package/src/containers/SpaceGenerator/index.ts +5 -0
  107. package/src/{components → containers/Wireframe}/Wireframe.tsx +3 -7
  108. package/src/containers/Wireframe/index.ts +5 -0
  109. package/src/containers/index.ts +13 -0
  110. package/src/index.ts +7 -1
  111. package/src/meta.ts +1 -1
  112. package/src/translations.ts +75 -58
  113. package/src/types/Settings.ts +16 -0
  114. package/src/{types.ts → types/index.ts} +15 -14
  115. package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs +0 -15
  116. package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs.map +0 -7
  117. package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs +0 -19
  118. package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs.map +0 -7
  119. package/dist/lib/browser/SpaceGenerator-ZHVZWGM7.mjs +0 -1150
  120. package/dist/lib/browser/SpaceGenerator-ZHVZWGM7.mjs.map +0 -7
  121. package/dist/lib/browser/app-graph-builder-FBDRMMYF.mjs +0 -597
  122. package/dist/lib/browser/app-graph-builder-FBDRMMYF.mjs.map +0 -7
  123. package/dist/lib/browser/chunk-4UFQXPP7.mjs +0 -78
  124. package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
  125. package/dist/lib/browser/chunk-A5H5GRV6.mjs +0 -20
  126. package/dist/lib/browser/chunk-A5H5GRV6.mjs.map +0 -7
  127. package/dist/lib/browser/react-context-FSWBT3MH.mjs +0 -17
  128. package/dist/lib/browser/react-context-FSWBT3MH.mjs.map +0 -7
  129. package/dist/lib/browser/react-surface-W62RJ32U.mjs +0 -757
  130. package/dist/lib/browser/react-surface-W62RJ32U.mjs.map +0 -7
  131. package/dist/lib/browser/settings-KA4GN73K.mjs +0 -31
  132. package/dist/lib/browser/settings-KA4GN73K.mjs.map +0 -7
  133. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  134. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  135. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  136. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  137. package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
  138. package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
  139. package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
  140. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  141. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  142. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  143. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  144. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  145. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  146. package/dist/types/src/capabilities/settings/settings.d.ts +0 -5
  147. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  148. package/dist/types/src/components/Container.d.ts +0 -5
  149. package/dist/types/src/components/Container.d.ts.map +0 -1
  150. package/dist/types/src/components/DebugGraph.d.ts +0 -9
  151. package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
  152. package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
  153. package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
  154. package/dist/types/src/components/DebugSettings.d.ts +0 -8
  155. package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
  156. package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
  157. package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
  158. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
  159. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
  160. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
  161. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
  162. package/dist/types/src/components/Wireframe.d.ts.map +0 -1
  163. package/dist/types/src/types.d.ts +0 -68
  164. package/dist/types/src/types.d.ts.map +0 -1
  165. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -419
  166. package/src/capabilities/app-graph-builder/index.ts +0 -7
  167. package/src/capabilities/react-context/index.ts +0 -7
  168. package/src/capabilities/react-context/react-context.tsx +0 -20
  169. package/src/capabilities/react-surface/index.ts +0 -7
  170. package/src/capabilities/react-surface/react-surface.tsx +0 -409
  171. package/src/capabilities/settings/index.ts +0 -7
  172. package/src/components/Container.tsx +0 -15
  173. package/src/components/DebugObjectPanel.tsx +0 -33
  174. package/src/components/DebugSettings.tsx +0 -185
  175. package/src/components/DevtoolsOverviewContainer.tsx +0 -20
  176. package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
  177. package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -127
  178. /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
  179. /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
  180. /package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +0 -0
@@ -0,0 +1,439 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import React, { useCallback } from 'react';
7
+
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
+ import { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
10
+ import { AppCapabilities, LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
11
+ import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
12
+ import {
13
+ AutomergePanel,
14
+ ConfigPanel,
15
+ CredentialsPanel,
16
+ DeviceListPanel,
17
+ DiagnosticsPanel,
18
+ EdgeDashboardPanel,
19
+ FeedsPanel,
20
+ IdentityPanel,
21
+ InvocationTraceContainer,
22
+ KeyringPanel,
23
+ LoggingPanel,
24
+ MembersPanel,
25
+ MetadataPanel,
26
+ NetworkPanel,
27
+ ObjectsPanel,
28
+ QueuesPanel,
29
+ SchemaPanel,
30
+ SignalPanel,
31
+ SpaceInfoPanel,
32
+ SpaceListPanel,
33
+ StoragePanel,
34
+ SwarmPanel,
35
+ TestingPanel,
36
+ WorkflowPanel,
37
+ } from '@dxos/devtools';
38
+ import { Feed, Obj } from '@dxos/echo';
39
+ import { Collection } from '@dxos/echo';
40
+ import { log } from '@dxos/log';
41
+ import { type IdbLogStore } from '@dxos/log-store-idb';
42
+ import { type Graph } from '@dxos/plugin-graph';
43
+ import { ScriptOperation } from '@dxos/plugin-script/operations';
44
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
45
+ import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
46
+ import { ToolsExplorer } from '@dxos/react-ui-introspect';
47
+
48
+ import { DebugSettings } from '#components';
49
+ import {
50
+ DebugGraph,
51
+ DebugObjectPanel,
52
+ DebugSpaceObjectsPanel,
53
+ DebugStatus,
54
+ DevtoolsOverviewContainer,
55
+ SpaceGenerator,
56
+ Wireframe,
57
+ } from '#containers';
58
+ import { meta } from '#meta';
59
+ import { DebugCapabilities, type Settings, Devtools } from '#types';
60
+
61
+ // TODO(burdon): Move to config.
62
+ const MCP_SERVER_URL = 'https://introspect-service-labs.dxos.workers.dev/mcp';
63
+
64
+ type SpaceDebug = {
65
+ type: string;
66
+ space: Space;
67
+ };
68
+
69
+ type GraphDebug = {
70
+ graph: Graph.Graph;
71
+ root: string;
72
+ };
73
+
74
+ const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}.space` && isSpace(data.space);
75
+ const isGraphDebug = (data: any): data is GraphDebug => {
76
+ const graph = data?.graph;
77
+ return (
78
+ graph != null && typeof graph === 'object' && typeof graph.json === 'function' && typeof data?.root === 'string'
79
+ );
80
+ };
81
+
82
+ type ReactSurfaceOptions = {
83
+ logStore?: IdbLogStore;
84
+ };
85
+
86
+ export default Capability.makeModule(
87
+ Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {
88
+ const capabilities = yield* Capability.Service;
89
+ const registry = capabilities.get(Capabilities.AtomRegistry);
90
+ const settingsAtom = capabilities.get(DebugCapabilities.Settings);
91
+ const fileUploader = capabilities.getAll(AppCapabilities.FileUploader)[0];
92
+
93
+ return Capability.contributes(Capabilities.ReactSurface, [
94
+ Surface.create({
95
+ id: 'plugin-settings',
96
+ filter: AppSurface.settings(AppSurface.Article, meta.id),
97
+ component: ({ data: { subject } }) => {
98
+ const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
99
+ return (
100
+ <DebugSettings
101
+ settings={settings}
102
+ onSettingsChange={updateSettings}
103
+ logStore={logStore}
104
+ onUpload={fileUploader}
105
+ />
106
+ );
107
+ },
108
+ }),
109
+ Surface.create({
110
+ id: 'space',
111
+ role: 'article',
112
+ filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
113
+ component: ({ role, data }) => {
114
+ const { invokePromise } = useOperationInvoker();
115
+
116
+ const handleCreateObject = useCallback(
117
+ (objects: Obj.Unknown[]) => {
118
+ if (!isSpace(data.subject.space)) {
119
+ return;
120
+ }
121
+
122
+ const collection =
123
+ data.subject.space.state.get() === SpaceState.SPACE_READY &&
124
+ data.subject.space.properties[Collection.Collection.typename]?.target;
125
+ if (!Obj.instanceOf(Collection.Collection, collection)) {
126
+ return;
127
+ }
128
+
129
+ objects.forEach((object) => {
130
+ void invokePromise(SpaceOperation.AddObject, {
131
+ target: collection,
132
+ object,
133
+ });
134
+ });
135
+ },
136
+ [data.subject.space, invokePromise],
137
+ );
138
+
139
+ return <SpaceGenerator role={role} space={data.subject.space} onCreateObjects={handleCreateObject} />;
140
+ },
141
+ }),
142
+ Surface.create({
143
+ id: 'app-graph',
144
+ role: 'article',
145
+ filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
146
+ component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
147
+ }),
148
+ Surface.create({
149
+ id: 'tools-explorer',
150
+ filter: AppSurface.literal(AppSurface.Article, Devtools.ToolsExplorer),
151
+ component: () => <ToolsExplorer serverUrl={MCP_SERVER_URL} />,
152
+ }),
153
+ Surface.create({
154
+ id: 'wireframe',
155
+ // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
156
+ role: ['article', 'section'],
157
+ position: 'hoist',
158
+ filter: (data): data is { subject: Obj.Unknown } => {
159
+ const settings = registry.get(settingsAtom);
160
+ return Obj.isObject(data.subject) && !!settings.wireframe;
161
+ },
162
+ component: ({ data, role, name }) => (
163
+ <Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
164
+ ),
165
+ }),
166
+ Surface.create({
167
+ id: 'object-debug',
168
+ filter: AppSurface.allOf(
169
+ AppSurface.literal(AppSurface.Article, 'debug'),
170
+ AppSurface.companion(AppSurface.Article),
171
+ ),
172
+ component: ({ role, data }) => <DebugObjectPanel role={role} companionTo={data.companionTo} />,
173
+ }),
174
+ Surface.create({
175
+ id: 'devtools-overview',
176
+ filter: AppSurface.literal(Surface.makeType<{ subject: string }>('deck-companion--devtools'), 'devtools'),
177
+ component: () => <DevtoolsOverviewContainer />,
178
+ }),
179
+ Surface.create({
180
+ id: 'space-objects',
181
+ filter: AppSurface.literal(
182
+ Surface.makeType<{ subject: string }>('deck-companion--space-objects'),
183
+ 'space-objects',
184
+ ),
185
+ component: () => {
186
+ const space = useActiveSpace();
187
+ if (!space) {
188
+ return null;
189
+ }
190
+
191
+ return <DebugSpaceObjectsPanel space={space} />;
192
+ },
193
+ }),
194
+
195
+ Surface.create({
196
+ id: 'status',
197
+ role: 'status-indicator',
198
+ position: 'hoist',
199
+ component: () => <DebugStatus />,
200
+ }),
201
+
202
+ //
203
+ // Devtools
204
+ //
205
+
206
+ Surface.create({
207
+ id: 'client.config',
208
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Config),
209
+ component: () => <ConfigPanel vaultSelector={false} />,
210
+ }),
211
+ Surface.create({
212
+ id: 'client.storage',
213
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Storage),
214
+ component: () => <StoragePanel />,
215
+ }),
216
+ Surface.create({
217
+ id: 'client.logs',
218
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Logs),
219
+ component: () => <LoggingPanel />,
220
+ }),
221
+ Surface.create({
222
+ id: 'client.diagnostics',
223
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Diagnostics),
224
+ component: () => <DiagnosticsPanel />,
225
+ }),
226
+ Surface.create({
227
+ id: 'halo.identity',
228
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Identity),
229
+ component: () => <IdentityPanel />,
230
+ }),
231
+ Surface.create({
232
+ id: 'halo.devices',
233
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Devices),
234
+ component: () => <DeviceListPanel />,
235
+ }),
236
+ Surface.create({
237
+ id: 'halo.keyring',
238
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Keyring),
239
+ component: () => <KeyringPanel />,
240
+ }),
241
+ Surface.create({
242
+ id: 'halo.credentials',
243
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Credentials),
244
+ component: () => {
245
+ const space = useActiveSpace();
246
+ if (!space) {
247
+ return null;
248
+ }
249
+
250
+ return <CredentialsPanel space={space} />;
251
+ },
252
+ }),
253
+ Surface.create({
254
+ id: 'echo.spaces',
255
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Spaces),
256
+ component: () => {
257
+ const { invokePromise } = useOperationInvoker();
258
+ const handleSelect = useCallback(
259
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
260
+ [invokePromise],
261
+ );
262
+ return <SpaceListPanel onSelect={handleSelect} />;
263
+ },
264
+ }),
265
+ Surface.create({
266
+ id: 'echo.space',
267
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Space),
268
+ component: () => {
269
+ const space = useActiveSpace();
270
+ const { invokePromise } = useOperationInvoker();
271
+ const handleSelect = useCallback(
272
+ () => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
273
+ [invokePromise],
274
+ );
275
+ if (!space) {
276
+ return null;
277
+ }
278
+
279
+ return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
280
+ },
281
+ }),
282
+ Surface.create({
283
+ id: 'echo.feeds',
284
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Feeds),
285
+ component: () => {
286
+ const space = useActiveSpace();
287
+ if (!space) {
288
+ return null;
289
+ }
290
+
291
+ return <FeedsPanel space={space} />;
292
+ },
293
+ }),
294
+ Surface.create({
295
+ id: 'echo.objects',
296
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Objects),
297
+ component: () => {
298
+ const space = useActiveSpace();
299
+ if (!space) {
300
+ return null;
301
+ }
302
+
303
+ return <ObjectsPanel space={space} />;
304
+ },
305
+ }),
306
+ Surface.create({
307
+ id: 'echo.schema',
308
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Schema),
309
+ component: () => {
310
+ const space = useActiveSpace();
311
+ if (!space) {
312
+ return null;
313
+ }
314
+
315
+ return <SchemaPanel space={space} />;
316
+ },
317
+ }),
318
+ Surface.create({
319
+ id: 'echo.automerge',
320
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Automerge),
321
+ component: () => {
322
+ const space = useActiveSpace();
323
+ if (!space) {
324
+ return null;
325
+ }
326
+
327
+ return <AutomergePanel space={space} />;
328
+ },
329
+ }),
330
+ Surface.create({
331
+ id: 'echo.queues',
332
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Queues),
333
+ component: () => <QueuesPanel />,
334
+ }),
335
+ Surface.create({
336
+ id: 'echo.members',
337
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Members),
338
+ component: () => {
339
+ const space = useActiveSpace();
340
+ if (!space) {
341
+ return null;
342
+ }
343
+
344
+ return <MembersPanel space={space} />;
345
+ },
346
+ }),
347
+ Surface.create({
348
+ id: 'echo.metadata',
349
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Metadata),
350
+ component: () => <MetadataPanel />,
351
+ }),
352
+ Surface.create({
353
+ id: 'mesh.signal',
354
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Signal),
355
+ component: () => <SignalPanel />,
356
+ }),
357
+ Surface.create({
358
+ id: 'mesh.swarm',
359
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Swarm),
360
+ component: () => <SwarmPanel />,
361
+ }),
362
+ Surface.create({
363
+ id: 'mesh.network',
364
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Network),
365
+ component: () => {
366
+ const space = useActiveSpace();
367
+ if (!space) {
368
+ return null;
369
+ }
370
+
371
+ return <NetworkPanel space={space} />;
372
+ },
373
+ }),
374
+ Surface.create({
375
+ id: 'edge.dashboard',
376
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Dashboard),
377
+ component: () => <EdgeDashboardPanel />,
378
+ }),
379
+ Surface.create({
380
+ id: 'edge.workflows',
381
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Workflows),
382
+ component: () => {
383
+ const space = useActiveSpace();
384
+ if (!space) {
385
+ return null;
386
+ }
387
+
388
+ return <WorkflowPanel space={space} />;
389
+ },
390
+ }),
391
+ Surface.create({
392
+ id: 'edge.traces',
393
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Traces),
394
+ component: () => {
395
+ const space = useActiveSpace();
396
+ if (!space) {
397
+ return null;
398
+ }
399
+
400
+ const feed = space.properties.invocationTraceFeed?.target;
401
+ const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
402
+ return <InvocationTraceContainer db={space.db} queueDxn={queueDxn} detailAxis='block' />;
403
+ },
404
+ }),
405
+ Surface.create({
406
+ id: 'edge.testing',
407
+ filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Testing),
408
+ component: () => {
409
+ const { invokePromise } = useOperationInvoker();
410
+ const onSpaceCreate = useCallback(
411
+ async (space: Space) => {
412
+ await space.waitUntilReady();
413
+ await invokePromise(SpaceOperation.Migrate, { space });
414
+ await space.db.flush();
415
+ },
416
+ [invokePromise],
417
+ );
418
+ const onScriptPluginOpen = useCallback(
419
+ async (space: Space) => {
420
+ await space.waitUntilReady();
421
+ const createResult = await invokePromise(ScriptOperation.CreateScript, { db: space.db });
422
+ if (createResult.data?.object) {
423
+ await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
424
+ }
425
+ log.info('script created', { result: createResult });
426
+ if (createResult.data?.object) {
427
+ await invokePromise(LayoutOperation.Open, {
428
+ subject: [getObjectPathFromObject(createResult.data.object)],
429
+ });
430
+ }
431
+ },
432
+ [invokePromise],
433
+ );
434
+ return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
435
+ },
436
+ }),
437
+ ]);
438
+ }),
439
+ );
@@ -4,25 +4,26 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Capability, Common } from '@dxos/app-framework';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
8
9
  import { createKvsStore } from '@dxos/effect';
9
10
 
10
- import { meta } from '../../meta';
11
- import { DebugCapabilities, DebugSettingsSchema } from '../../types';
11
+ import { meta } from '#meta';
12
+ import { DebugCapabilities, Settings } from '#types';
12
13
 
13
14
  export default Capability.makeModule(() =>
14
15
  Effect.sync(() => {
15
16
  const settingsAtom = createKvsStore({
16
17
  key: meta.id,
17
- schema: DebugSettingsSchema,
18
+ schema: Settings.Settings,
18
19
  defaultValue: () => ({}),
19
20
  });
20
21
 
21
22
  return [
22
23
  Capability.contributes(DebugCapabilities.Settings, settingsAtom),
23
- Capability.contributes(Common.Capability.Settings, {
24
+ Capability.contributes(AppCapabilities.Settings, {
24
25
  prefix: meta.id,
25
- schema: DebugSettingsSchema,
26
+ schema: Settings.Settings,
26
27
  atom: settingsAtom,
27
28
  }),
28
29
  ];
@@ -0,0 +1,36 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+
7
+ import { withClientProvider } from '@dxos/react-client/testing';
8
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
9
+
10
+ import { translations } from '#translations';
11
+
12
+ import { DebugSettings } from './DebugSettings';
13
+
14
+ const meta = {
15
+ title: 'plugins/plugin-debug/components/DebugSettings',
16
+ component: DebugSettings,
17
+ decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withClientProvider({ createIdentity: true })],
18
+ tags: ['settings'],
19
+ parameters: {
20
+ layout: 'fullscreen',
21
+ translations,
22
+ },
23
+ } satisfies Meta<typeof DebugSettings>;
24
+
25
+ export default meta;
26
+
27
+ type Story = StoryObj<typeof meta>;
28
+
29
+ export const Default: Story = {
30
+ args: {
31
+ settings: {
32
+ wireframe: false,
33
+ },
34
+ logStore: { export: async () => '' } as any,
35
+ },
36
+ };