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

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