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