@dxos/plugin-debug 0.8.4-main.bc674ce → 0.8.4-main.bcb3aa67d6

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