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