@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.
- package/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs +15 -0
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +47 -0
- package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.workerd.mjs +12 -0
- package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs +224 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs.map +7 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs +34 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs.map +7 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs +121 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs.map +7 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs +23 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
- package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs +177 -0
- package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-IQLBDY6R.mjs +143 -0
- package/dist/lib/neutral/SpaceGenerator-IQLBDY6R.mjs.map +7 -0
- package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs +52 -0
- package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-ZNMWIDDF.mjs +598 -0
- package/dist/lib/neutral/app-graph-builder-ZNMWIDDF.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-SRV2AIGJ.mjs → neutral/chunk-NFIOTQRZ.mjs} +30 -9
- package/dist/lib/neutral/chunk-NFIOTQRZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-SAJFZGX5.mjs +41 -0
- package/dist/lib/neutral/chunk-SAJFZGX5.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-46TAISVE.mjs → neutral/components/index.mjs} +322 -496
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +23 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs +17 -0
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-T4NYONZ7.mjs +419 -0
- package/dist/lib/neutral/react-surface-T4NYONZ7.mjs.map +7 -0
- package/dist/lib/neutral/settings-MPM6YUP4.mjs +28 -0
- package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +90 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +4 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/DebugPlugin.node.d.ts +5 -0
- package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.test.d.ts +2 -0
- package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.workerd.d.ts +5 -0
- package/dist/types/src/DebugPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +4 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +7 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +105 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
- package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
- package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +4 -5
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +1 -4
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +2 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -0
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +2 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +5 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +2 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts +2 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +2 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +15 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +105 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +3 -0
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/index.d.ts +2 -0
- package/dist/types/src/containers/GithubPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +11 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +2 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +1 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/index.d.ts +2 -0
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +86 -59
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +8 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +69 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +134 -76
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +28 -34
- package/src/DebugPlugin.workerd.ts +12 -0
- package/src/capabilities/app-graph-builder.ts +381 -388
- package/src/capabilities/index.ts +5 -5
- package/src/capabilities/react-context.tsx +16 -7
- package/src/capabilities/react-surface.tsx +376 -356
- package/src/capabilities/settings.ts +24 -12
- package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
- package/src/components/DebugSettings/DebugSettings.tsx +262 -0
- package/src/components/DebugSettings/index.ts +5 -0
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +30 -34
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +209 -112
- package/src/components/index.ts +4 -8
- package/src/containers/DebugGraph/DebugGraph.tsx +14 -0
- package/src/containers/DebugGraph/index.ts +5 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
- package/src/containers/DebugObjectPanel/index.ts +5 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
- package/src/{components → containers/DebugStatus}/DebugStatus.tsx +41 -19
- package/src/containers/DebugStatus/index.ts +5 -0
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
- package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
- package/src/containers/GithubPanel/GithubComponent.stories.tsx +38 -0
- package/src/containers/GithubPanel/GithubComponent.tsx +192 -0
- package/src/containers/GithubPanel/GithubPanel.tsx +17 -0
- package/src/containers/GithubPanel/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +126 -0
- package/src/containers/SpaceGenerator/index.ts +5 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +6 -10
- package/src/containers/Wireframe/index.ts +5 -0
- package/src/containers/index.ts +14 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +24 -5
- package/src/plugin.ts +10 -0
- package/src/translations.ts +82 -58
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +20 -11
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs +0 -20
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-JXVZVPHN.mjs +0 -25
- package/dist/lib/browser/DevtoolsOverviewContainer-JXVZVPHN.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-46TAISVE.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-CRH2HJKT.mjs +0 -588
- package/dist/lib/browser/app-graph-builder-CRH2HJKT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs +0 -20
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -130
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-P2YDWEWI.mjs +0 -16
- package/dist/lib/browser/react-context-P2YDWEWI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2SNVZDEA.mjs +0 -774
- package/dist/lib/browser/react-surface-2SNVZDEA.mjs.map +0 -7
- package/dist/lib/browser/settings-SQXR3OAH.mjs +0 -22
- package/dist/lib/browser/settings-SQXR3OAH.mjs.map +0 -7
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugGraph.d.ts +0 -8
- package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- package/dist/types/src/components/DebugSettings.d.ts +0 -6
- package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
- package/dist/types/src/components/Wireframe.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -63
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugGraph.tsx +0 -14
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/DebugSettings.tsx +0 -180
- package/src/components/DevtoolsOverviewContainer.tsx +0 -20
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
- /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
- /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
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 {
|
|
49
|
-
import { Graph } from '@dxos/plugin-graph';
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import { type Space, SpaceState, isSpace
|
|
53
|
-
import {
|
|
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
|
-
|
|
51
|
+
DebugSpaceObjectsPanel,
|
|
60
52
|
DebugStatus,
|
|
61
53
|
DevtoolsOverviewContainer,
|
|
62
54
|
SpaceGenerator,
|
|
63
55
|
Wireframe,
|
|
64
|
-
} from '
|
|
65
|
-
import { meta } from '
|
|
66
|
-
import { type
|
|
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}
|
|
79
|
-
const isGraphDebug = (data: any): data is GraphDebug =>
|
|
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
|
-
|
|
82
|
-
|
|
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 (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
115
|
+
const handleCreateObject = useCallback(
|
|
116
|
+
(objects: Obj.Unknown[]) => {
|
|
117
|
+
if (!isSpace(data.subject.space)) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
111
120
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
120
|
-
|
|
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
|
-
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
+
);
|