@dxos/plugin-debug 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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/{DebugGraph-6VMEOKEV.mjs → DebugGraph-7HXJ2PS2.mjs} +4 -3
- package/dist/lib/browser/{DebugGraph-6VMEOKEV.mjs.map → DebugGraph-7HXJ2PS2.mjs.map} +4 -4
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs +35 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs.map +7 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs +174 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs.map +7 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs +45 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs.map +7 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs +125 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +7 -0
- package/dist/lib/browser/{DevtoolsOverviewContainer-77PKFLYV.mjs → DevtoolsOverviewContainer-C75NFVER.mjs} +6 -5
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-H33AEFGC.mjs → SpaceGenerator-Q2GH6S6D.mjs} +313 -287
- package/dist/lib/browser/SpaceGenerator-Q2GH6S6D.mjs.map +7 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs +53 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-LV73R7HR.mjs → app-graph-builder-FU4BCDDC.mjs} +80 -85
- package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4UFQXPP7.mjs → chunk-Q37TZWW5.mjs} +4 -4
- package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-A5H5GRV6.mjs → chunk-ZOM2FBHQ.mjs} +2 -2
- package/dist/lib/browser/{chunk-A5H5GRV6.mjs.map → chunk-ZOM2FBHQ.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +25 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-FSWBT3MH.mjs → react-context-5ENRJEB2.mjs} +4 -4
- package/dist/lib/browser/react-context-5ENRJEB2.mjs.map +7 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs +427 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs.map +7 -0
- package/dist/lib/browser/{settings-KA4GN73K.mjs → settings-XXFUM3QJ.mjs} +6 -5
- package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +6 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +6 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +3 -2
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- 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 +1 -1
- 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.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers/DebugGraph}/DebugGraph.d.ts +0 -1
- 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 +1 -1
- 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/{components → containers/DebugSettings}/DebugSettings.d.ts +4 -2
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSettings/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/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- 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/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 +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +34 -34
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -66
- package/src/DebugPlugin.tsx +19 -8
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +74 -75
- package/src/capabilities/react-context/react-context.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +106 -102
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +6 -7
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +41 -37
- package/src/components/index.ts +2 -13
- package/src/{components → containers/DebugGraph}/DebugGraph.tsx +0 -2
- 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/{components → containers/DebugSettings}/DebugSettings.tsx +38 -22
- package/src/containers/DebugSettings/index.ts +7 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
- package/src/containers/DebugStatus/index.ts +7 -0
- package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +2 -4
- package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
- package/src/{components → containers}/SpaceGenerator/SpaceGenerator.tsx +38 -38
- package/src/containers/SpaceGenerator/index.ts +7 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +2 -2
- package/src/containers/Wireframe/index.ts +7 -0
- package/src/containers/index.ts +14 -0
- package/src/meta.ts +1 -1
- package/src/translations.ts +2 -0
- package/src/types.ts +2 -3
- package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-H33AEFGC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LV73R7HR.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/react-context-FSWBT3MH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2N6CPSHR.mjs +0 -757
- package/dist/lib/browser/react-surface-2N6CPSHR.mjs.map +0 -7
- package/dist/lib/browser/settings-KA4GN73K.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.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- 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.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/src/components/Container.tsx +0 -15
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
- /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/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts +0 -0
- /package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +0 -0
- /package/src/{components → containers/DebugStatus}/DebugStatus.tsx +0 -0
|
@@ -5,8 +5,10 @@
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface, useCapability, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities, LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
|
|
11
|
+
|
|
10
12
|
import {
|
|
11
13
|
AutomergePanel,
|
|
12
14
|
ConfigPanel,
|
|
@@ -35,24 +37,27 @@ import {
|
|
|
35
37
|
WorkflowPanel,
|
|
36
38
|
} from '@dxos/devtools';
|
|
37
39
|
import { Obj } from '@dxos/echo';
|
|
40
|
+
import { Collection } from '@dxos/echo';
|
|
41
|
+
import { type LogBuffer } from '@dxos/log';
|
|
38
42
|
import { log } from '@dxos/log';
|
|
39
|
-
|
|
43
|
+
|
|
40
44
|
import { type Graph } from '@dxos/plugin-graph';
|
|
41
45
|
import { ScriptOperation } from '@dxos/plugin-script/types';
|
|
42
46
|
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
47
|
+
import { useActiveSpace } from '@dxos/plugin-space';
|
|
48
|
+
import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
|
|
49
|
+
import { Panel } from '@dxos/react-ui';
|
|
46
50
|
|
|
47
51
|
import {
|
|
48
52
|
DebugGraph,
|
|
49
53
|
DebugObjectPanel,
|
|
50
54
|
DebugSettings,
|
|
55
|
+
DebugSpaceObjectsPanel,
|
|
51
56
|
DebugStatus,
|
|
52
57
|
DevtoolsOverviewContainer,
|
|
53
58
|
SpaceGenerator,
|
|
54
59
|
Wireframe,
|
|
55
|
-
} from '../../
|
|
60
|
+
} from '../../containers';
|
|
56
61
|
import { meta } from '../../meta';
|
|
57
62
|
import { DebugCapabilities, type DebugSettingsProps, Devtools } from '../../types';
|
|
58
63
|
|
|
@@ -66,7 +71,7 @@ type GraphDebug = {
|
|
|
66
71
|
root: string;
|
|
67
72
|
};
|
|
68
73
|
|
|
69
|
-
const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}
|
|
74
|
+
const isSpaceDebug = (data: any): data is SpaceDebug => data?.type === `${meta.id}.space` && isSpace(data.space);
|
|
70
75
|
const isGraphDebug = (data: any): data is GraphDebug => {
|
|
71
76
|
const graph = data?.graph;
|
|
72
77
|
return (
|
|
@@ -74,34 +79,31 @@ const isGraphDebug = (data: any): data is GraphDebug => {
|
|
|
74
79
|
);
|
|
75
80
|
};
|
|
76
81
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const { spaceId } = parseId(layout.workspace);
|
|
82
|
-
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
83
|
-
return space;
|
|
82
|
+
const useCurrentSpace = useActiveSpace;
|
|
83
|
+
|
|
84
|
+
type ReactSurfaceOptions = {
|
|
85
|
+
logBuffer: LogBuffer;
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
export default Capability.makeModule(
|
|
87
|
-
Effect.fnUntraced(function* () {
|
|
89
|
+
Effect.fnUntraced(function* ({ logBuffer }: ReactSurfaceOptions) {
|
|
88
90
|
const capabilities = yield* Capability.Service;
|
|
89
|
-
const registry = capabilities.get(
|
|
91
|
+
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
90
92
|
const settingsAtom = capabilities.get(DebugCapabilities.Settings);
|
|
91
93
|
|
|
92
|
-
return Capability.contributes(
|
|
93
|
-
|
|
94
|
-
id: `${meta.id}
|
|
94
|
+
return Capability.contributes(Capabilities.ReactSurface, [
|
|
95
|
+
Surface.create({
|
|
96
|
+
id: `${meta.id}.plugin-settings`,
|
|
95
97
|
role: 'article',
|
|
96
|
-
filter: (data): data is { subject:
|
|
97
|
-
|
|
98
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
99
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
98
100
|
component: ({ data: { subject } }) => {
|
|
99
101
|
const { settings, updateSettings } = useSettingsState<DebugSettingsProps>(subject.atom);
|
|
100
|
-
return <DebugSettings settings={settings} onSettingsChange={updateSettings} />;
|
|
102
|
+
return <DebugSettings settings={settings} onSettingsChange={updateSettings} logBuffer={logBuffer} />;
|
|
101
103
|
},
|
|
102
104
|
}),
|
|
103
|
-
|
|
104
|
-
id: `${meta.id}
|
|
105
|
+
Surface.create({
|
|
106
|
+
id: `${meta.id}.space`,
|
|
105
107
|
role: 'article',
|
|
106
108
|
filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
|
|
107
109
|
component: ({ role, data }) => {
|
|
@@ -131,102 +133,111 @@ export default Capability.makeModule(
|
|
|
131
133
|
);
|
|
132
134
|
|
|
133
135
|
return (
|
|
134
|
-
<
|
|
135
|
-
<
|
|
136
|
-
|
|
136
|
+
<Panel.Root role={role} className='dx-document'>
|
|
137
|
+
<Panel.Content asChild>
|
|
138
|
+
<SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
|
|
139
|
+
</Panel.Content>
|
|
140
|
+
</Panel.Root>
|
|
137
141
|
);
|
|
138
142
|
},
|
|
139
143
|
}),
|
|
140
|
-
|
|
141
|
-
id: `${meta.id}
|
|
144
|
+
Surface.create({
|
|
145
|
+
id: `${meta.id}.app-graph`,
|
|
142
146
|
role: 'article',
|
|
143
147
|
filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
|
|
144
148
|
component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
|
|
145
149
|
}),
|
|
146
|
-
|
|
147
|
-
id: `${meta.id}
|
|
150
|
+
Surface.create({
|
|
151
|
+
id: `${meta.id}.wireframe`,
|
|
148
152
|
role: ['article', 'section'],
|
|
149
153
|
position: 'hoist',
|
|
150
154
|
filter: (data): data is { subject: Obj.Unknown } => {
|
|
151
155
|
const settings = registry.get(settingsAtom);
|
|
152
156
|
return Obj.isObject(data.subject) && !!settings.wireframe;
|
|
153
157
|
},
|
|
154
|
-
component: ({ data, role }) => (
|
|
158
|
+
component: ({ data, role, name }) => (
|
|
155
159
|
<Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
|
|
156
160
|
),
|
|
157
161
|
}),
|
|
158
|
-
|
|
159
|
-
id: `${meta.id}
|
|
162
|
+
Surface.create({
|
|
163
|
+
id: `${meta.id}.object-debug`,
|
|
160
164
|
role: 'article',
|
|
161
165
|
filter: (data): data is { companionTo: Obj.Unknown } =>
|
|
162
166
|
data.subject === 'debug' && Obj.isObject(data.companionTo),
|
|
163
167
|
component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
|
|
164
168
|
}),
|
|
165
|
-
|
|
166
|
-
id: `${meta.id}
|
|
169
|
+
Surface.create({
|
|
170
|
+
id: `${meta.id}.devtools-overview`,
|
|
167
171
|
role: 'deck-companion--devtools',
|
|
172
|
+
filter: (data): data is { subject: 'devtools' } => data.subject === 'devtools',
|
|
168
173
|
component: () => <DevtoolsOverviewContainer />,
|
|
169
174
|
}),
|
|
170
|
-
|
|
171
|
-
id: `${meta.id}
|
|
175
|
+
Surface.create({
|
|
176
|
+
id: `${meta.id}.space-objects`,
|
|
177
|
+
role: 'deck-companion--space-objects',
|
|
178
|
+
filter: (data): data is { subject: 'space-objects' } => data.subject === 'space-objects',
|
|
179
|
+
component: () => <DebugSpaceObjectsPanel />,
|
|
180
|
+
}),
|
|
181
|
+
|
|
182
|
+
Surface.create({
|
|
183
|
+
id: `${meta.id}.status`,
|
|
172
184
|
role: 'status',
|
|
173
185
|
component: () => <DebugStatus />,
|
|
174
186
|
}),
|
|
175
|
-
|
|
176
187
|
//
|
|
177
188
|
// Devtools
|
|
178
189
|
//
|
|
179
190
|
|
|
180
|
-
|
|
181
|
-
id: `${meta.id}
|
|
191
|
+
Surface.create({
|
|
192
|
+
id: `${meta.id}.client.config`,
|
|
182
193
|
role: 'article',
|
|
183
194
|
filter: (data): data is any => data.subject === Devtools.Client.Config,
|
|
184
195
|
component: () => <ConfigPanel vaultSelector={false} />,
|
|
185
196
|
}),
|
|
186
|
-
|
|
187
|
-
id: `${meta.id}
|
|
197
|
+
Surface.create({
|
|
198
|
+
id: `${meta.id}.client.storage`,
|
|
188
199
|
role: 'article',
|
|
189
200
|
filter: (data): data is any => data.subject === Devtools.Client.Storage,
|
|
190
201
|
component: () => <StoragePanel />,
|
|
191
202
|
}),
|
|
192
|
-
|
|
193
|
-
id: `${meta.id}
|
|
203
|
+
Surface.create({
|
|
204
|
+
id: `${meta.id}.client.logs`,
|
|
194
205
|
role: 'article',
|
|
195
206
|
filter: (data): data is any => data.subject === Devtools.Client.Logs,
|
|
196
207
|
component: () => <LoggingPanel />,
|
|
197
208
|
}),
|
|
198
|
-
|
|
199
|
-
id: `${meta.id}
|
|
209
|
+
Surface.create({
|
|
210
|
+
id: `${meta.id}.client.diagnostics`,
|
|
200
211
|
role: 'article',
|
|
201
212
|
filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
|
|
202
213
|
component: () => <DiagnosticsPanel />,
|
|
203
214
|
}),
|
|
204
|
-
|
|
205
|
-
id: `${meta.id}
|
|
215
|
+
Surface.create({
|
|
216
|
+
id: `${meta.id}.client.tracing`,
|
|
206
217
|
role: 'article',
|
|
207
218
|
filter: (data): data is any => data.subject === Devtools.Client.Tracing,
|
|
208
219
|
component: () => <TracingPanel />,
|
|
209
220
|
}),
|
|
210
|
-
|
|
211
|
-
id: `${meta.id}
|
|
221
|
+
Surface.create({
|
|
222
|
+
id: `${meta.id}.halo.identity`,
|
|
212
223
|
role: 'article',
|
|
213
224
|
filter: (data): data is any => data.subject === Devtools.Halo.Identity,
|
|
214
225
|
component: () => <IdentityPanel />,
|
|
215
226
|
}),
|
|
216
|
-
|
|
217
|
-
id: `${meta.id}
|
|
227
|
+
Surface.create({
|
|
228
|
+
id: `${meta.id}.halo.devices`,
|
|
218
229
|
role: 'article',
|
|
219
230
|
filter: (data): data is any => data.subject === Devtools.Halo.Devices,
|
|
220
231
|
component: () => <DeviceListPanel />,
|
|
221
232
|
}),
|
|
222
|
-
|
|
223
|
-
id: `${meta.id}
|
|
233
|
+
Surface.create({
|
|
234
|
+
id: `${meta.id}.halo.keyring`,
|
|
224
235
|
role: 'article',
|
|
225
236
|
filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
|
|
226
237
|
component: () => <KeyringPanel />,
|
|
227
238
|
}),
|
|
228
|
-
|
|
229
|
-
id: `${meta.id}
|
|
239
|
+
Surface.create({
|
|
240
|
+
id: `${meta.id}.halo.credentials`,
|
|
230
241
|
role: 'article',
|
|
231
242
|
filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
|
|
232
243
|
component: () => {
|
|
@@ -234,35 +245,35 @@ export default Capability.makeModule(
|
|
|
234
245
|
return <CredentialsPanel space={space} />;
|
|
235
246
|
},
|
|
236
247
|
}),
|
|
237
|
-
|
|
238
|
-
id: `${meta.id}
|
|
248
|
+
Surface.create({
|
|
249
|
+
id: `${meta.id}.echo.spaces`,
|
|
239
250
|
role: 'article',
|
|
240
251
|
filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
|
|
241
252
|
component: () => {
|
|
242
253
|
const { invokePromise } = useOperationInvoker();
|
|
243
254
|
const handleSelect = useCallback(
|
|
244
|
-
() => invokePromise(
|
|
255
|
+
() => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
|
|
245
256
|
[invokePromise],
|
|
246
257
|
);
|
|
247
258
|
return <SpaceListPanel onSelect={handleSelect} />;
|
|
248
259
|
},
|
|
249
260
|
}),
|
|
250
|
-
|
|
251
|
-
id: `${meta.id}
|
|
261
|
+
Surface.create({
|
|
262
|
+
id: `${meta.id}.echo.space`,
|
|
252
263
|
role: 'article',
|
|
253
264
|
filter: (data): data is any => data.subject === Devtools.Echo.Space,
|
|
254
265
|
component: () => {
|
|
255
266
|
const space = useCurrentSpace();
|
|
256
267
|
const { invokePromise } = useOperationInvoker();
|
|
257
268
|
const handleSelect = useCallback(
|
|
258
|
-
() => invokePromise(
|
|
269
|
+
() => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
|
|
259
270
|
[invokePromise],
|
|
260
271
|
);
|
|
261
272
|
return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
|
|
262
273
|
},
|
|
263
274
|
}),
|
|
264
|
-
|
|
265
|
-
id: `${meta.id}
|
|
275
|
+
Surface.create({
|
|
276
|
+
id: `${meta.id}.echo.feeds`,
|
|
266
277
|
role: 'article',
|
|
267
278
|
filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
|
|
268
279
|
component: () => {
|
|
@@ -270,8 +281,8 @@ export default Capability.makeModule(
|
|
|
270
281
|
return <FeedsPanel space={space} />;
|
|
271
282
|
},
|
|
272
283
|
}),
|
|
273
|
-
|
|
274
|
-
id: `${meta.id}
|
|
284
|
+
Surface.create({
|
|
285
|
+
id: `${meta.id}.echo.objects`,
|
|
275
286
|
role: 'article',
|
|
276
287
|
filter: (data): data is any => data.subject === Devtools.Echo.Objects,
|
|
277
288
|
component: () => {
|
|
@@ -279,8 +290,8 @@ export default Capability.makeModule(
|
|
|
279
290
|
return <ObjectsPanel space={space} />;
|
|
280
291
|
},
|
|
281
292
|
}),
|
|
282
|
-
|
|
283
|
-
id: `${meta.id}
|
|
293
|
+
Surface.create({
|
|
294
|
+
id: `${meta.id}.echo.schema`,
|
|
284
295
|
role: 'article',
|
|
285
296
|
filter: (data): data is any => data.subject === Devtools.Echo.Schema,
|
|
286
297
|
component: () => {
|
|
@@ -288,8 +299,8 @@ export default Capability.makeModule(
|
|
|
288
299
|
return <SchemaPanel space={space} />;
|
|
289
300
|
},
|
|
290
301
|
}),
|
|
291
|
-
|
|
292
|
-
id: `${meta.id}
|
|
302
|
+
Surface.create({
|
|
303
|
+
id: `${meta.id}.echo.automerge`,
|
|
293
304
|
role: 'article',
|
|
294
305
|
filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
|
|
295
306
|
component: () => {
|
|
@@ -297,14 +308,14 @@ export default Capability.makeModule(
|
|
|
297
308
|
return <AutomergePanel space={space} />;
|
|
298
309
|
},
|
|
299
310
|
}),
|
|
300
|
-
|
|
301
|
-
id: `${meta.id}
|
|
311
|
+
Surface.create({
|
|
312
|
+
id: `${meta.id}.echo.queues`,
|
|
302
313
|
role: 'article',
|
|
303
314
|
filter: (data): data is any => data.subject === Devtools.Echo.Queues,
|
|
304
315
|
component: () => <QueuesPanel />,
|
|
305
316
|
}),
|
|
306
|
-
|
|
307
|
-
id: `${meta.id}
|
|
317
|
+
Surface.create({
|
|
318
|
+
id: `${meta.id}.echo.members`,
|
|
308
319
|
role: 'article',
|
|
309
320
|
filter: (data): data is any => data.subject === Devtools.Echo.Members,
|
|
310
321
|
component: () => {
|
|
@@ -312,26 +323,26 @@ export default Capability.makeModule(
|
|
|
312
323
|
return <MembersPanel space={space} />;
|
|
313
324
|
},
|
|
314
325
|
}),
|
|
315
|
-
|
|
316
|
-
id: `${meta.id}
|
|
326
|
+
Surface.create({
|
|
327
|
+
id: `${meta.id}.echo.metadata`,
|
|
317
328
|
role: 'article',
|
|
318
329
|
filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
|
|
319
330
|
component: () => <MetadataPanel />,
|
|
320
331
|
}),
|
|
321
|
-
|
|
322
|
-
id: `${meta.id}
|
|
332
|
+
Surface.create({
|
|
333
|
+
id: `${meta.id}.mesh.signal`,
|
|
323
334
|
role: 'article',
|
|
324
335
|
filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
|
|
325
336
|
component: () => <SignalPanel />,
|
|
326
337
|
}),
|
|
327
|
-
|
|
328
|
-
id: `${meta.id}
|
|
338
|
+
Surface.create({
|
|
339
|
+
id: `${meta.id}.mesh.swarm`,
|
|
329
340
|
role: 'article',
|
|
330
341
|
filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
|
|
331
342
|
component: () => <SwarmPanel />,
|
|
332
343
|
}),
|
|
333
|
-
|
|
334
|
-
id: `${meta.id}
|
|
344
|
+
Surface.create({
|
|
345
|
+
id: `${meta.id}.mesh.network`,
|
|
335
346
|
role: 'article',
|
|
336
347
|
filter: (data): data is any => data.subject === Devtools.Mesh.Network,
|
|
337
348
|
component: () => {
|
|
@@ -339,21 +350,14 @@ export default Capability.makeModule(
|
|
|
339
350
|
return <NetworkPanel space={space} />;
|
|
340
351
|
},
|
|
341
352
|
}),
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
// id: `${meta.id}/agent/dashboard`,
|
|
345
|
-
// role: 'article',
|
|
346
|
-
// filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
|
|
347
|
-
// component: () => <DashboardPanel />,
|
|
348
|
-
// }),
|
|
349
|
-
Common.createSurface({
|
|
350
|
-
id: `${meta.id}/edge/dashboard`,
|
|
353
|
+
Surface.create({
|
|
354
|
+
id: `${meta.id}.edge.dashboard`,
|
|
351
355
|
role: 'article',
|
|
352
356
|
filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
|
|
353
357
|
component: () => <EdgeDashboardPanel />,
|
|
354
358
|
}),
|
|
355
|
-
|
|
356
|
-
id: `${meta.id}
|
|
359
|
+
Surface.create({
|
|
360
|
+
id: `${meta.id}.edge.workflows`,
|
|
357
361
|
role: 'article',
|
|
358
362
|
filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
|
|
359
363
|
component: () => {
|
|
@@ -361,8 +365,8 @@ export default Capability.makeModule(
|
|
|
361
365
|
return <WorkflowPanel space={space} />;
|
|
362
366
|
},
|
|
363
367
|
}),
|
|
364
|
-
|
|
365
|
-
id: `${meta.id}
|
|
368
|
+
Surface.create({
|
|
369
|
+
id: `${meta.id}.edge.traces`,
|
|
366
370
|
role: 'article',
|
|
367
371
|
filter: (data): data is any => data.subject === Devtools.Edge.Traces,
|
|
368
372
|
component: () => {
|
|
@@ -371,8 +375,8 @@ export default Capability.makeModule(
|
|
|
371
375
|
return <InvocationTraceContainer db={space?.db} queueDxn={queueDxn} detailAxis='block' />;
|
|
372
376
|
},
|
|
373
377
|
}),
|
|
374
|
-
|
|
375
|
-
id: `${meta.id}
|
|
378
|
+
Surface.create({
|
|
379
|
+
id: `${meta.id}.edge.testing`,
|
|
376
380
|
role: 'article',
|
|
377
381
|
filter: (data): data is any => data.subject === Devtools.Edge.Testing,
|
|
378
382
|
component: () => {
|
|
@@ -393,9 +397,9 @@ export default Capability.makeModule(
|
|
|
393
397
|
await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
|
|
394
398
|
}
|
|
395
399
|
log.info('script created', { result: createResult });
|
|
396
|
-
if (createResult.data?.object
|
|
397
|
-
await invokePromise(
|
|
398
|
-
subject: [
|
|
400
|
+
if (createResult.data?.object) {
|
|
401
|
+
await invokePromise(LayoutOperation.Open, {
|
|
402
|
+
subject: [getObjectPathFromObject(createResult.data.object)],
|
|
399
403
|
});
|
|
400
404
|
}
|
|
401
405
|
},
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Effect from 'effect/Effect';
|
|
6
6
|
|
|
7
|
-
import { Capability
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
8
9
|
import { createKvsStore } from '@dxos/effect';
|
|
9
10
|
|
|
10
11
|
import { meta } from '../../meta';
|
|
@@ -20,7 +21,7 @@ export default Capability.makeModule(() =>
|
|
|
20
21
|
|
|
21
22
|
return [
|
|
22
23
|
Capability.contributes(DebugCapabilities.Settings, settingsAtom),
|
|
23
|
-
Capability.contributes(
|
|
24
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
24
25
|
prefix: meta.id,
|
|
25
26
|
schema: DebugSettingsSchema,
|
|
26
27
|
atom: settingsAtom,
|
|
@@ -19,8 +19,8 @@ export const SchemaTable = ({ types, objects = {}, label, onClick }: SchemaTable
|
|
|
19
19
|
<h2 className='p-2'>{label}</h2>
|
|
20
20
|
{types.map((type) => (
|
|
21
21
|
<div key={type.typename} className='grid grid-cols-subgrid col-span-3 items-center'>
|
|
22
|
-
<div className='
|
|
23
|
-
<div className='
|
|
22
|
+
<div className='px-2 text-sm font-mono text-subdued'>{type.typename}</div>
|
|
23
|
+
<div className='px-2 text-right font-mono'>{objects[type.typename] ?? 0}</div>
|
|
24
24
|
<IconButton
|
|
25
25
|
variant='ghost'
|
|
26
26
|
icon='ph--plus--regular'
|
|
@@ -7,15 +7,16 @@ import type * as Schema from 'effect/Schema';
|
|
|
7
7
|
import { addressToA1Notation } from '@dxos/compute';
|
|
8
8
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
|
|
9
9
|
import { DXN, Filter, Key, type Type } from '@dxos/echo';
|
|
10
|
+
import { View } from '@dxos/echo';
|
|
10
11
|
import { type OperationInvoker } from '@dxos/operation';
|
|
11
12
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
12
13
|
import { Sheet } from '@dxos/plugin-sheet/types';
|
|
13
|
-
import {
|
|
14
|
+
import { Sketch } from '@dxos/plugin-sketch/types';
|
|
14
15
|
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
15
16
|
import { faker } from '@dxos/random';
|
|
16
17
|
import { type Client } from '@dxos/react-client';
|
|
17
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
18
|
-
import {
|
|
19
|
+
import { getTypenameFromQuery } from '@dxos/schema';
|
|
19
20
|
import { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';
|
|
20
21
|
import { range } from '@dxos/util';
|
|
21
22
|
|
|
@@ -27,7 +28,7 @@ const findViewByTypename = async (views: View.View[], typename: string) => {
|
|
|
27
28
|
|
|
28
29
|
export type ObjectGenerator<T> = (space: Space, n: number, cb?: (objects: T[]) => void) => Promise<T[]>;
|
|
29
30
|
|
|
30
|
-
export const createGenerator = <S extends Type.
|
|
31
|
+
export const createGenerator = <S extends Type.AnyObj>(
|
|
31
32
|
client: Client,
|
|
32
33
|
invokePromise: OperationInvoker.OperationInvoker['invokePromise'],
|
|
33
34
|
schema: S,
|
|
@@ -41,8 +42,6 @@ export const createGenerator = <S extends Type.Obj.Any>(
|
|
|
41
42
|
const staticSchema = client?.graph.schemaRegistry.query({ typename }).runSync()[0];
|
|
42
43
|
if (!view && !staticSchema) {
|
|
43
44
|
await invokePromise(SpaceOperation.AddSchema, { db: space.db, schema, show: false });
|
|
44
|
-
} else if (!view && staticSchema) {
|
|
45
|
-
await invokePromise(SpaceOperation.UseStaticSchema, { db: space.db, typename, show: false });
|
|
46
45
|
}
|
|
47
46
|
|
|
48
47
|
// Create objects.
|
|
@@ -69,10 +68,10 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
69
68
|
},
|
|
70
69
|
],
|
|
71
70
|
[
|
|
72
|
-
|
|
71
|
+
Sketch.Sketch.typename,
|
|
73
72
|
async (space, n, cb) => {
|
|
74
73
|
const objects = range(n).map(() => {
|
|
75
|
-
const obj = space.db.add(
|
|
74
|
+
const obj = space.db.add(Sketch.make({ name: faker.commerce.productName() }));
|
|
76
75
|
return obj;
|
|
77
76
|
});
|
|
78
77
|
|