@dxos/plugin-debug 0.8.4-main.72ec0f3 → 0.8.4-main.7996785055
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-7HXJ2PS2.mjs +16 -0
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +7 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs +35 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs.map +7 -0
- package/dist/lib/browser/DebugSettings-DQXOXF6A.mjs +183 -0
- package/dist/lib/browser/DebugSettings-DQXOXF6A.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-FWF3YFBA.mjs +124 -0
- package/dist/lib/browser/DebugStatus-FWF3YFBA.mjs.map +7 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-TBTTPXVF.mjs +24 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-TBTTPXVF.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-46TAISVE.mjs → SpaceGenerator-UUQS6TYY.mjs} +455 -425
- package/dist/lib/browser/SpaceGenerator-UUQS6TYY.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-FBLOEOH5.mjs +594 -0
- package/dist/lib/browser/app-graph-builder-FBLOEOH5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SRV2AIGJ.mjs → chunk-Q37TZWW5.mjs} +12 -2
- package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WZFZ4ESO.mjs → chunk-ZOM2FBHQ.mjs} +2 -2
- package/dist/lib/browser/chunk-ZOM2FBHQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +40 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-KBHXEMRS.mjs +18 -0
- package/dist/lib/browser/react-context-KBHXEMRS.mjs.map +7 -0
- package/dist/lib/browser/react-surface-HYT4HKZX.mjs +428 -0
- package/dist/lib/browser/react-surface-HYT4HKZX.mjs.map +7 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs +32 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
- 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/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -8
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings/settings.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 +1 -4
- 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/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/DebugSettings/DebugSettings.d.ts +10 -0
- 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/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 +1 -1
- 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/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- 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 +39 -34
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -70
- package/src/DebugPlugin.tsx +27 -31
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +419 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +4 -6
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +414 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +19 -21
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +196 -75
- package/src/components/index.ts +2 -10
- 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/{components → containers/DebugSettings}/DebugSettings.tsx +51 -25
- 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/{components → containers/DebugStatus}/DebugStatus.tsx +40 -16
- 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 +4 -4
- package/src/containers/Wireframe/index.ts +7 -0
- package/src/containers/index.ts +14 -0
- package/src/meta.ts +3 -3
- package/src/translations.ts +2 -0
- package/src/types.ts +9 -2
- 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.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-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/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- 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/src/capabilities/app-graph-builder.ts +0 -431
- package/src/capabilities/react-context.tsx +0 -16
- package/src/capabilities/react-surface.tsx +0 -418
- package/src/capabilities/settings.ts +0 -19
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugGraph.tsx +0 -14
- package/src/components/DebugObjectPanel.tsx +0 -33
- 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,9 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
|
-
export const DebugSettings = lazy(() => import('./settings'));
|
|
5
|
+
export * from './app-graph-builder';
|
|
6
|
+
export * from './react-context';
|
|
7
|
+
export * from './react-surface';
|
|
8
|
+
export * from './settings';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { DevtoolsContextProvider } from '@dxos/devtools';
|
|
11
|
+
|
|
12
|
+
import { meta } from '../../meta';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.succeed(
|
|
16
|
+
Capability.contributes(Capabilities.ReactContext, {
|
|
17
|
+
id: meta.id,
|
|
18
|
+
context: ({ children }) => (
|
|
19
|
+
<Surface.ProfilerProvider>
|
|
20
|
+
<DevtoolsContextProvider>{children}</DevtoolsContextProvider>
|
|
21
|
+
</Surface.ProfilerProvider>
|
|
22
|
+
),
|
|
23
|
+
}),
|
|
24
|
+
),
|
|
25
|
+
);
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
7
|
+
|
|
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
|
+
|
|
12
|
+
import {
|
|
13
|
+
AutomergePanel,
|
|
14
|
+
ConfigPanel,
|
|
15
|
+
CredentialsPanel,
|
|
16
|
+
DeviceListPanel,
|
|
17
|
+
DiagnosticsPanel,
|
|
18
|
+
EdgeDashboardPanel,
|
|
19
|
+
FeedsPanel,
|
|
20
|
+
IdentityPanel,
|
|
21
|
+
InvocationTraceContainer,
|
|
22
|
+
KeyringPanel,
|
|
23
|
+
LoggingPanel,
|
|
24
|
+
MembersPanel,
|
|
25
|
+
MetadataPanel,
|
|
26
|
+
NetworkPanel,
|
|
27
|
+
ObjectsPanel,
|
|
28
|
+
QueuesPanel,
|
|
29
|
+
SchemaPanel,
|
|
30
|
+
SignalPanel,
|
|
31
|
+
SpaceInfoPanel,
|
|
32
|
+
SpaceListPanel,
|
|
33
|
+
StoragePanel,
|
|
34
|
+
SwarmPanel,
|
|
35
|
+
TestingPanel,
|
|
36
|
+
TracingPanel,
|
|
37
|
+
WorkflowPanel,
|
|
38
|
+
} from '@dxos/devtools';
|
|
39
|
+
import { Obj } from '@dxos/echo';
|
|
40
|
+
import { Collection } from '@dxos/echo';
|
|
41
|
+
import { type LogBuffer } from '@dxos/log';
|
|
42
|
+
import { log } from '@dxos/log';
|
|
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/plugin-space';
|
|
48
|
+
import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
|
|
49
|
+
import { Panel } from '@dxos/react-ui';
|
|
50
|
+
|
|
51
|
+
import {
|
|
52
|
+
DebugGraph,
|
|
53
|
+
DebugObjectPanel,
|
|
54
|
+
DebugSettings,
|
|
55
|
+
DebugSpaceObjectsPanel,
|
|
56
|
+
DebugStatus,
|
|
57
|
+
DevtoolsOverviewContainer,
|
|
58
|
+
SpaceGenerator,
|
|
59
|
+
Wireframe,
|
|
60
|
+
} from '../../containers';
|
|
61
|
+
import { meta } from '../../meta';
|
|
62
|
+
import { DebugCapabilities, type DebugSettingsProps, Devtools } from '../../types';
|
|
63
|
+
|
|
64
|
+
type SpaceDebug = {
|
|
65
|
+
type: string;
|
|
66
|
+
space: Space;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
type GraphDebug = {
|
|
70
|
+
graph: Graph.Graph;
|
|
71
|
+
root: string;
|
|
72
|
+
};
|
|
73
|
+
|
|
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;
|
|
83
|
+
|
|
84
|
+
type ReactSurfaceOptions = {
|
|
85
|
+
logBuffer: LogBuffer;
|
|
86
|
+
};
|
|
87
|
+
|
|
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
|
+
|
|
94
|
+
return Capability.contributes(Capabilities.ReactSurface, [
|
|
95
|
+
Surface.create({
|
|
96
|
+
id: `${meta.id}.plugin-settings`,
|
|
97
|
+
role: 'article',
|
|
98
|
+
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
99
|
+
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
100
|
+
component: ({ data: { subject } }) => {
|
|
101
|
+
const { settings, updateSettings } = useSettingsState<DebugSettingsProps>(subject.atom);
|
|
102
|
+
return <DebugSettings settings={settings} onSettingsChange={updateSettings} logBuffer={logBuffer} />;
|
|
103
|
+
},
|
|
104
|
+
}),
|
|
105
|
+
Surface.create({
|
|
106
|
+
id: `${meta.id}.space`,
|
|
107
|
+
role: 'article',
|
|
108
|
+
filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
|
|
109
|
+
component: ({ role, data }) => {
|
|
110
|
+
const { invokePromise } = useOperationInvoker();
|
|
111
|
+
|
|
112
|
+
const handleCreateObject = useCallback(
|
|
113
|
+
(objects: Obj.Unknown[]) => {
|
|
114
|
+
if (!isSpace(data.subject.space)) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const collection =
|
|
119
|
+
data.subject.space.state.get() === SpaceState.SPACE_READY &&
|
|
120
|
+
data.subject.space.properties[Collection.Collection.typename]?.target;
|
|
121
|
+
if (!Obj.instanceOf(Collection.Collection, collection)) {
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
objects.forEach((object) => {
|
|
126
|
+
void invokePromise(SpaceOperation.AddObject, {
|
|
127
|
+
target: collection,
|
|
128
|
+
object,
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
},
|
|
132
|
+
[data.subject.space, invokePromise],
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
return (
|
|
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>
|
|
141
|
+
);
|
|
142
|
+
},
|
|
143
|
+
}),
|
|
144
|
+
Surface.create({
|
|
145
|
+
id: `${meta.id}.app-graph`,
|
|
146
|
+
role: 'article',
|
|
147
|
+
filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
|
|
148
|
+
component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
|
|
149
|
+
}),
|
|
150
|
+
Surface.create({
|
|
151
|
+
id: `${meta.id}.wireframe`,
|
|
152
|
+
role: ['article', 'section'],
|
|
153
|
+
position: 'hoist',
|
|
154
|
+
filter: (data): data is { subject: Obj.Unknown } => {
|
|
155
|
+
const settings = registry.get(settingsAtom);
|
|
156
|
+
return Obj.isObject(data.subject) && !!settings.wireframe;
|
|
157
|
+
},
|
|
158
|
+
component: ({ data, role, name }) => (
|
|
159
|
+
<Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
|
|
160
|
+
),
|
|
161
|
+
}),
|
|
162
|
+
Surface.create({
|
|
163
|
+
id: `${meta.id}.object-debug`,
|
|
164
|
+
role: 'article',
|
|
165
|
+
filter: (data): data is { companionTo: Obj.Unknown } =>
|
|
166
|
+
data.subject === 'debug' && Obj.isObject(data.companionTo),
|
|
167
|
+
component: ({ data }) => <DebugObjectPanel object={data.companionTo} />,
|
|
168
|
+
}),
|
|
169
|
+
Surface.create({
|
|
170
|
+
id: `${meta.id}.devtools-overview`,
|
|
171
|
+
role: 'deck-companion--devtools',
|
|
172
|
+
filter: (data): data is { subject: 'devtools' } => data.subject === 'devtools',
|
|
173
|
+
component: () => <DevtoolsOverviewContainer />,
|
|
174
|
+
}),
|
|
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`,
|
|
184
|
+
role: 'status-indicator',
|
|
185
|
+
position: 'hoist',
|
|
186
|
+
component: () => <DebugStatus />,
|
|
187
|
+
}),
|
|
188
|
+
//
|
|
189
|
+
// Devtools
|
|
190
|
+
//
|
|
191
|
+
|
|
192
|
+
Surface.create({
|
|
193
|
+
id: `${meta.id}.client.config`,
|
|
194
|
+
role: 'article',
|
|
195
|
+
filter: (data): data is any => data.subject === Devtools.Client.Config,
|
|
196
|
+
component: () => <ConfigPanel vaultSelector={false} />,
|
|
197
|
+
}),
|
|
198
|
+
Surface.create({
|
|
199
|
+
id: `${meta.id}.client.storage`,
|
|
200
|
+
role: 'article',
|
|
201
|
+
filter: (data): data is any => data.subject === Devtools.Client.Storage,
|
|
202
|
+
component: () => <StoragePanel />,
|
|
203
|
+
}),
|
|
204
|
+
Surface.create({
|
|
205
|
+
id: `${meta.id}.client.logs`,
|
|
206
|
+
role: 'article',
|
|
207
|
+
filter: (data): data is any => data.subject === Devtools.Client.Logs,
|
|
208
|
+
component: () => <LoggingPanel />,
|
|
209
|
+
}),
|
|
210
|
+
Surface.create({
|
|
211
|
+
id: `${meta.id}.client.diagnostics`,
|
|
212
|
+
role: 'article',
|
|
213
|
+
filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
|
|
214
|
+
component: () => <DiagnosticsPanel />,
|
|
215
|
+
}),
|
|
216
|
+
Surface.create({
|
|
217
|
+
id: `${meta.id}.client.tracing`,
|
|
218
|
+
role: 'article',
|
|
219
|
+
filter: (data): data is any => data.subject === Devtools.Client.Tracing,
|
|
220
|
+
component: () => <TracingPanel />,
|
|
221
|
+
}),
|
|
222
|
+
Surface.create({
|
|
223
|
+
id: `${meta.id}.halo.identity`,
|
|
224
|
+
role: 'article',
|
|
225
|
+
filter: (data): data is any => data.subject === Devtools.Halo.Identity,
|
|
226
|
+
component: () => <IdentityPanel />,
|
|
227
|
+
}),
|
|
228
|
+
Surface.create({
|
|
229
|
+
id: `${meta.id}.halo.devices`,
|
|
230
|
+
role: 'article',
|
|
231
|
+
filter: (data): data is any => data.subject === Devtools.Halo.Devices,
|
|
232
|
+
component: () => <DeviceListPanel />,
|
|
233
|
+
}),
|
|
234
|
+
Surface.create({
|
|
235
|
+
id: `${meta.id}.halo.keyring`,
|
|
236
|
+
role: 'article',
|
|
237
|
+
filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
|
|
238
|
+
component: () => <KeyringPanel />,
|
|
239
|
+
}),
|
|
240
|
+
Surface.create({
|
|
241
|
+
id: `${meta.id}.halo.credentials`,
|
|
242
|
+
role: 'article',
|
|
243
|
+
filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
|
|
244
|
+
component: () => {
|
|
245
|
+
const space = useCurrentSpace();
|
|
246
|
+
return <CredentialsPanel space={space} />;
|
|
247
|
+
},
|
|
248
|
+
}),
|
|
249
|
+
Surface.create({
|
|
250
|
+
id: `${meta.id}.echo.spaces`,
|
|
251
|
+
role: 'article',
|
|
252
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
|
|
253
|
+
component: () => {
|
|
254
|
+
const { invokePromise } = useOperationInvoker();
|
|
255
|
+
const handleSelect = useCallback(
|
|
256
|
+
() => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Space] }),
|
|
257
|
+
[invokePromise],
|
|
258
|
+
);
|
|
259
|
+
return <SpaceListPanel onSelect={handleSelect} />;
|
|
260
|
+
},
|
|
261
|
+
}),
|
|
262
|
+
Surface.create({
|
|
263
|
+
id: `${meta.id}.echo.space`,
|
|
264
|
+
role: 'article',
|
|
265
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Space,
|
|
266
|
+
component: () => {
|
|
267
|
+
const space = useCurrentSpace();
|
|
268
|
+
const { invokePromise } = useOperationInvoker();
|
|
269
|
+
const handleSelect = useCallback(
|
|
270
|
+
() => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
|
|
271
|
+
[invokePromise],
|
|
272
|
+
);
|
|
273
|
+
return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
|
|
274
|
+
},
|
|
275
|
+
}),
|
|
276
|
+
Surface.create({
|
|
277
|
+
id: `${meta.id}.echo.feeds`,
|
|
278
|
+
role: 'article',
|
|
279
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
|
|
280
|
+
component: () => {
|
|
281
|
+
const space = useCurrentSpace();
|
|
282
|
+
return <FeedsPanel space={space} />;
|
|
283
|
+
},
|
|
284
|
+
}),
|
|
285
|
+
Surface.create({
|
|
286
|
+
id: `${meta.id}.echo.objects`,
|
|
287
|
+
role: 'article',
|
|
288
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Objects,
|
|
289
|
+
component: () => {
|
|
290
|
+
const space = useCurrentSpace();
|
|
291
|
+
return <ObjectsPanel space={space} />;
|
|
292
|
+
},
|
|
293
|
+
}),
|
|
294
|
+
Surface.create({
|
|
295
|
+
id: `${meta.id}.echo.schema`,
|
|
296
|
+
role: 'article',
|
|
297
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Schema,
|
|
298
|
+
component: () => {
|
|
299
|
+
const space = useCurrentSpace();
|
|
300
|
+
return <SchemaPanel space={space} />;
|
|
301
|
+
},
|
|
302
|
+
}),
|
|
303
|
+
Surface.create({
|
|
304
|
+
id: `${meta.id}.echo.automerge`,
|
|
305
|
+
role: 'article',
|
|
306
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
|
|
307
|
+
component: () => {
|
|
308
|
+
const space = useCurrentSpace();
|
|
309
|
+
return <AutomergePanel space={space} />;
|
|
310
|
+
},
|
|
311
|
+
}),
|
|
312
|
+
Surface.create({
|
|
313
|
+
id: `${meta.id}.echo.queues`,
|
|
314
|
+
role: 'article',
|
|
315
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Queues,
|
|
316
|
+
component: () => <QueuesPanel />,
|
|
317
|
+
}),
|
|
318
|
+
Surface.create({
|
|
319
|
+
id: `${meta.id}.echo.members`,
|
|
320
|
+
role: 'article',
|
|
321
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Members,
|
|
322
|
+
component: () => {
|
|
323
|
+
const space = useCurrentSpace();
|
|
324
|
+
return <MembersPanel space={space} />;
|
|
325
|
+
},
|
|
326
|
+
}),
|
|
327
|
+
Surface.create({
|
|
328
|
+
id: `${meta.id}.echo.metadata`,
|
|
329
|
+
role: 'article',
|
|
330
|
+
filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
|
|
331
|
+
component: () => <MetadataPanel />,
|
|
332
|
+
}),
|
|
333
|
+
Surface.create({
|
|
334
|
+
id: `${meta.id}.mesh.signal`,
|
|
335
|
+
role: 'article',
|
|
336
|
+
filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
|
|
337
|
+
component: () => <SignalPanel />,
|
|
338
|
+
}),
|
|
339
|
+
Surface.create({
|
|
340
|
+
id: `${meta.id}.mesh.swarm`,
|
|
341
|
+
role: 'article',
|
|
342
|
+
filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
|
|
343
|
+
component: () => <SwarmPanel />,
|
|
344
|
+
}),
|
|
345
|
+
Surface.create({
|
|
346
|
+
id: `${meta.id}.mesh.network`,
|
|
347
|
+
role: 'article',
|
|
348
|
+
filter: (data): data is any => data.subject === Devtools.Mesh.Network,
|
|
349
|
+
component: () => {
|
|
350
|
+
const space = useCurrentSpace();
|
|
351
|
+
return <NetworkPanel space={space} />;
|
|
352
|
+
},
|
|
353
|
+
}),
|
|
354
|
+
Surface.create({
|
|
355
|
+
id: `${meta.id}.edge.dashboard`,
|
|
356
|
+
role: 'article',
|
|
357
|
+
filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
|
|
358
|
+
component: () => <EdgeDashboardPanel />,
|
|
359
|
+
}),
|
|
360
|
+
Surface.create({
|
|
361
|
+
id: `${meta.id}.edge.workflows`,
|
|
362
|
+
role: 'article',
|
|
363
|
+
filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
|
|
364
|
+
component: () => {
|
|
365
|
+
const space = useCurrentSpace();
|
|
366
|
+
return <WorkflowPanel space={space} />;
|
|
367
|
+
},
|
|
368
|
+
}),
|
|
369
|
+
Surface.create({
|
|
370
|
+
id: `${meta.id}.edge.traces`,
|
|
371
|
+
role: 'article',
|
|
372
|
+
filter: (data): data is any => data.subject === Devtools.Edge.Traces,
|
|
373
|
+
component: () => {
|
|
374
|
+
const space = useCurrentSpace();
|
|
375
|
+
const queueDxn = space?.properties.invocationTraceQueue?.dxn;
|
|
376
|
+
return <InvocationTraceContainer db={space?.db} queueDxn={queueDxn} detailAxis='block' />;
|
|
377
|
+
},
|
|
378
|
+
}),
|
|
379
|
+
Surface.create({
|
|
380
|
+
id: `${meta.id}.edge.testing`,
|
|
381
|
+
role: 'article',
|
|
382
|
+
filter: (data): data is any => data.subject === Devtools.Edge.Testing,
|
|
383
|
+
component: () => {
|
|
384
|
+
const { invokePromise } = useOperationInvoker();
|
|
385
|
+
const onSpaceCreate = useCallback(
|
|
386
|
+
async (space: Space) => {
|
|
387
|
+
await space.waitUntilReady();
|
|
388
|
+
await invokePromise(SpaceOperation.Migrate, { space });
|
|
389
|
+
await space.db.flush();
|
|
390
|
+
},
|
|
391
|
+
[invokePromise],
|
|
392
|
+
);
|
|
393
|
+
const onScriptPluginOpen = useCallback(
|
|
394
|
+
async (space: Space) => {
|
|
395
|
+
await space.waitUntilReady();
|
|
396
|
+
const createResult = await invokePromise(ScriptOperation.CreateScript, { db: space.db });
|
|
397
|
+
if (createResult.data?.object) {
|
|
398
|
+
await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
|
|
399
|
+
}
|
|
400
|
+
log.info('script created', { result: createResult });
|
|
401
|
+
if (createResult.data?.object) {
|
|
402
|
+
await invokePromise(LayoutOperation.Open, {
|
|
403
|
+
subject: [getObjectPathFromObject(createResult.data.object)],
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
},
|
|
407
|
+
[invokePromise],
|
|
408
|
+
);
|
|
409
|
+
return <TestingPanel onSpaceCreate={onSpaceCreate} onScriptPluginOpen={onScriptPluginOpen} />;
|
|
410
|
+
},
|
|
411
|
+
}),
|
|
412
|
+
]);
|
|
413
|
+
}),
|
|
414
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
|
+
import { createKvsStore } from '@dxos/effect';
|
|
10
|
+
|
|
11
|
+
import { meta } from '../../meta';
|
|
12
|
+
import { DebugCapabilities, DebugSettingsSchema } from '../../types';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(() =>
|
|
15
|
+
Effect.sync(() => {
|
|
16
|
+
const settingsAtom = createKvsStore({
|
|
17
|
+
key: meta.id,
|
|
18
|
+
schema: DebugSettingsSchema,
|
|
19
|
+
defaultValue: () => ({}),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
return [
|
|
23
|
+
Capability.contributes(DebugCapabilities.Settings, settingsAtom),
|
|
24
|
+
Capability.contributes(AppCapabilities.Settings, {
|
|
25
|
+
prefix: meta.id,
|
|
26
|
+
schema: DebugSettingsSchema,
|
|
27
|
+
atom: settingsAtom,
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
@@ -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'
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import type * as Schema from 'effect/Schema';
|
|
6
|
+
|
|
6
7
|
import { addressToA1Notation } from '@dxos/compute';
|
|
7
8
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';
|
|
8
|
-
import { DXN, Filter, Key, type
|
|
9
|
-
import {
|
|
9
|
+
import { DXN, Filter, Key, type Type } from '@dxos/echo';
|
|
10
|
+
import { View } from '@dxos/echo';
|
|
11
|
+
import { type OperationInvoker } from '@dxos/operation';
|
|
10
12
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
13
|
import { Sheet } from '@dxos/plugin-sheet/types';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
+
import { Sketch } from '@dxos/plugin-sketch/types';
|
|
15
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
14
16
|
import { faker } from '@dxos/random';
|
|
15
17
|
import { type Client } from '@dxos/react-client';
|
|
16
18
|
import { type Space } from '@dxos/react-client/echo';
|
|
17
|
-
import {
|
|
19
|
+
import { getTypenameFromQuery } from '@dxos/schema';
|
|
18
20
|
import { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';
|
|
19
21
|
import { range } from '@dxos/util';
|
|
20
22
|
|
|
@@ -24,24 +26,22 @@ const findViewByTypename = async (views: View.View[], typename: string) => {
|
|
|
24
26
|
return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
|
|
25
27
|
};
|
|
26
28
|
|
|
27
|
-
export type ObjectGenerator<T
|
|
29
|
+
export type ObjectGenerator<T> = (space: Space, n: number, cb?: (objects: T[]) => void) => Promise<T[]>;
|
|
28
30
|
|
|
29
|
-
export const createGenerator = <
|
|
31
|
+
export const createGenerator = <S extends Type.AnyObj>(
|
|
30
32
|
client: Client,
|
|
31
|
-
|
|
32
|
-
schema:
|
|
33
|
-
): ObjectGenerator<
|
|
34
|
-
return async (space: Space, n: number): Promise<
|
|
33
|
+
invokePromise: OperationInvoker.OperationInvoker['invokePromise'],
|
|
34
|
+
schema: S,
|
|
35
|
+
): ObjectGenerator<Schema.Schema.Type<S>> => {
|
|
36
|
+
return async (space: Space, n: number): Promise<Schema.Schema.Type<S>[]> => {
|
|
35
37
|
const typename = schema.typename;
|
|
36
38
|
|
|
37
39
|
// Find or create table and view.
|
|
38
|
-
const
|
|
40
|
+
const views = await space.db.query(Filter.type(View.View)).run();
|
|
39
41
|
const view = await findViewByTypename(views, typename);
|
|
40
|
-
const staticSchema = client?.graph.schemaRegistry.
|
|
42
|
+
const staticSchema = client?.graph.schemaRegistry.query({ typename }).runSync()[0];
|
|
41
43
|
if (!view && !staticSchema) {
|
|
42
|
-
await
|
|
43
|
-
} else if (!view && staticSchema) {
|
|
44
|
-
await dispatch(createIntent(SpaceAction.UseStaticSchema, { space, typename, show: false }));
|
|
44
|
+
await invokePromise(SpaceOperation.AddSchema, { db: space.db, schema, show: false });
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Create objects.
|
|
@@ -68,12 +68,10 @@ export const staticGenerators = new Map<string, ObjectGenerator<any>>([
|
|
|
68
68
|
},
|
|
69
69
|
],
|
|
70
70
|
[
|
|
71
|
-
|
|
71
|
+
Sketch.Sketch.typename,
|
|
72
72
|
async (space, n, cb) => {
|
|
73
73
|
const objects = range(n).map(() => {
|
|
74
|
-
|
|
75
|
-
const obj = space.db.add(Diagram.make({ name: faker.commerce.productName() }));
|
|
76
|
-
|
|
74
|
+
const obj = space.db.add(Sketch.make({ name: faker.commerce.productName() }));
|
|
77
75
|
return obj;
|
|
78
76
|
});
|
|
79
77
|
|