@dxos/plugin-debug 0.8.4-main.ead640a → 0.8.4-main.effb148878

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