@dxos/plugin-debug 0.8.4-main.1068cf700f → 0.8.4-main.1c7ec43d41
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 +19 -119
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +81 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +3 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/DebugPlugin.node.d.ts +5 -0
- package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.test.d.ts +2 -0
- package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- 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 +99 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
- package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
- package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +2 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +6 -0
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +2 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +5 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +2 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts +2 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +2 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +11 -0
- package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +2 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/index.d.ts +2 -0
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +9 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +80 -59
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +8 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +69 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +84 -66
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +14 -6
- package/src/capabilities/app-graph-builder.ts +405 -0
- package/src/capabilities/index.ts +6 -4
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +7 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +175 -147
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
- package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
- package/src/components/DebugSettings/DebugSettings.tsx +262 -0
- package/src/components/DebugSettings/index.ts +5 -0
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +14 -15
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +47 -61
- package/src/components/index.ts +4 -11
- package/src/{components → containers/DebugGraph}/DebugGraph.tsx +3 -4
- package/src/containers/DebugGraph/index.ts +5 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
- package/src/containers/DebugObjectPanel/index.ts +5 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
- package/src/{components → containers/DebugStatus}/DebugStatus.tsx +41 -19
- package/src/containers/DebugStatus/index.ts +5 -0
- package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +8 -3
- package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +126 -0
- package/src/containers/SpaceGenerator/index.ts +5 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +3 -7
- package/src/containers/Wireframe/index.ts +5 -0
- package/src/containers/index.ts +13 -0
- package/src/index.ts +7 -1
- package/src/meta.ts +1 -1
- package/src/translations.ts +75 -58
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +15 -14
- package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs +0 -15
- package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs +0 -19
- package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-W3LJORYT.mjs +0 -1152
- package/dist/lib/browser/SpaceGenerator-W3LJORYT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DEBTVBQG.mjs +0 -599
- package/dist/lib/browser/app-graph-builder-DEBTVBQG.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs +0 -78
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-A5H5GRV6.mjs +0 -20
- package/dist/lib/browser/chunk-A5H5GRV6.mjs.map +0 -7
- package/dist/lib/browser/react-context-I3USIAF6.mjs +0 -17
- package/dist/lib/browser/react-context-I3USIAF6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FMVC5GPV.mjs +0 -758
- package/dist/lib/browser/react-surface-FMVC5GPV.mjs.map +0 -7
- package/dist/lib/browser/settings-SLTQJJNF.mjs +0 -32
- package/dist/lib/browser/settings-SLTQJJNF.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
- package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -6
- package/dist/types/src/capabilities/settings/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 -9
- package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- package/dist/types/src/components/DebugSettings.d.ts +0 -8
- 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.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 -68
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -421
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/react-context/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugObjectPanel.tsx +0 -32
- package/src/components/DebugSettings.tsx +0 -185
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -126
- /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/Wireframe}/Wireframe.d.ts +0 -0
|
@@ -6,9 +6,9 @@ import * as Effect from 'effect/Effect';
|
|
|
6
6
|
import React, { useCallback } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
-
import { Surface,
|
|
10
|
-
import { AppCapabilities, LayoutOperation } from '@dxos/app-toolkit';
|
|
11
|
-
import {
|
|
9
|
+
import { Surface, useOperationInvoker, useSettingsState } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppCapabilities, LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
|
|
11
|
+
import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
|
|
12
12
|
import {
|
|
13
13
|
AutomergePanel,
|
|
14
14
|
ConfigPanel,
|
|
@@ -33,30 +33,33 @@ import {
|
|
|
33
33
|
StoragePanel,
|
|
34
34
|
SwarmPanel,
|
|
35
35
|
TestingPanel,
|
|
36
|
-
TracingPanel,
|
|
37
36
|
WorkflowPanel,
|
|
38
37
|
} from '@dxos/devtools';
|
|
39
|
-
import { Obj } from '@dxos/echo';
|
|
38
|
+
import { Feed, Obj } from '@dxos/echo';
|
|
39
|
+
import { Collection } from '@dxos/echo';
|
|
40
40
|
import { log } from '@dxos/log';
|
|
41
|
-
import {
|
|
41
|
+
import { type IdbLogStore } from '@dxos/log-store-idb';
|
|
42
42
|
import { type Graph } from '@dxos/plugin-graph';
|
|
43
|
-
import { ScriptOperation } from '@dxos/plugin-script/
|
|
44
|
-
import { SpaceOperation } from '@dxos/plugin-space/
|
|
45
|
-
import { type Space, SpaceState, isSpace
|
|
46
|
-
import {
|
|
47
|
-
import { Collection } from '@dxos/schema';
|
|
43
|
+
import { ScriptOperation } from '@dxos/plugin-script/operations';
|
|
44
|
+
import { SpaceOperation } from '@dxos/plugin-space/operations';
|
|
45
|
+
import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
|
|
46
|
+
import { ToolsExplorer } from '@dxos/react-ui-introspect';
|
|
48
47
|
|
|
48
|
+
import { DebugSettings } from '#components';
|
|
49
49
|
import {
|
|
50
50
|
DebugGraph,
|
|
51
51
|
DebugObjectPanel,
|
|
52
|
-
|
|
52
|
+
DebugSpaceObjectsPanel,
|
|
53
53
|
DebugStatus,
|
|
54
54
|
DevtoolsOverviewContainer,
|
|
55
55
|
SpaceGenerator,
|
|
56
56
|
Wireframe,
|
|
57
|
-
} from '
|
|
58
|
-
import { meta } from '
|
|
59
|
-
import { DebugCapabilities, type
|
|
57
|
+
} from '#containers';
|
|
58
|
+
import { meta } from '#meta';
|
|
59
|
+
import { DebugCapabilities, type Settings, Devtools } from '#types';
|
|
60
|
+
|
|
61
|
+
// TODO(burdon): Move to config.
|
|
62
|
+
const MCP_SERVER_URL = 'https://introspect-service-labs.dxos.workers.dev/mcp';
|
|
60
63
|
|
|
61
64
|
type SpaceDebug = {
|
|
62
65
|
type: string;
|
|
@@ -68,7 +71,7 @@ type GraphDebug = {
|
|
|
68
71
|
root: string;
|
|
69
72
|
};
|
|
70
73
|
|
|
71
|
-
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);
|
|
72
75
|
const isGraphDebug = (data: any): data is GraphDebug => {
|
|
73
76
|
const graph = data?.graph;
|
|
74
77
|
return (
|
|
@@ -76,34 +79,35 @@ const isGraphDebug = (data: any): data is GraphDebug => {
|
|
|
76
79
|
);
|
|
77
80
|
};
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const layout = useLayout();
|
|
82
|
-
const client = useCapability(ClientCapabilities.Client);
|
|
83
|
-
const { spaceId } = parseId(layout.workspace);
|
|
84
|
-
const space = spaceId ? client.spaces.get(spaceId) : undefined;
|
|
85
|
-
return space;
|
|
82
|
+
type ReactSurfaceOptions = {
|
|
83
|
+
logStore?: IdbLogStore;
|
|
86
84
|
};
|
|
87
85
|
|
|
88
86
|
export default Capability.makeModule(
|
|
89
|
-
Effect.fnUntraced(function* () {
|
|
87
|
+
Effect.fnUntraced(function* ({ logStore }: ReactSurfaceOptions) {
|
|
90
88
|
const capabilities = yield* Capability.Service;
|
|
91
89
|
const registry = capabilities.get(Capabilities.AtomRegistry);
|
|
92
90
|
const settingsAtom = capabilities.get(DebugCapabilities.Settings);
|
|
91
|
+
const fileUploader = capabilities.getAll(AppCapabilities.FileUploader)[0];
|
|
93
92
|
|
|
94
93
|
return Capability.contributes(Capabilities.ReactSurface, [
|
|
95
94
|
Surface.create({
|
|
96
|
-
id:
|
|
97
|
-
|
|
98
|
-
filter: (data): data is { subject: AppCapabilities.Settings } =>
|
|
99
|
-
AppCapabilities.isSettings(data.subject) && data.subject.prefix === meta.id,
|
|
95
|
+
id: 'plugin-settings',
|
|
96
|
+
filter: AppSurface.settings(AppSurface.Article, meta.id),
|
|
100
97
|
component: ({ data: { subject } }) => {
|
|
101
|
-
const { settings, updateSettings } = useSettingsState<
|
|
102
|
-
return
|
|
98
|
+
const { settings, updateSettings } = useSettingsState<Settings.Settings>(subject.atom);
|
|
99
|
+
return (
|
|
100
|
+
<DebugSettings
|
|
101
|
+
settings={settings}
|
|
102
|
+
onSettingsChange={updateSettings}
|
|
103
|
+
logStore={logStore}
|
|
104
|
+
onUpload={fileUploader}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
103
107
|
},
|
|
104
108
|
}),
|
|
105
109
|
Surface.create({
|
|
106
|
-
id:
|
|
110
|
+
id: 'space',
|
|
107
111
|
role: 'article',
|
|
108
112
|
filter: (data): data is { subject: SpaceDebug } => isSpaceDebug(data.subject),
|
|
109
113
|
component: ({ role, data }) => {
|
|
@@ -132,46 +136,66 @@ export default Capability.makeModule(
|
|
|
132
136
|
[data.subject.space, invokePromise],
|
|
133
137
|
);
|
|
134
138
|
|
|
135
|
-
return
|
|
136
|
-
<Layout.Main role={role}>
|
|
137
|
-
<SpaceGenerator space={data.subject.space} onCreateObjects={handleCreateObject} />
|
|
138
|
-
</Layout.Main>
|
|
139
|
-
);
|
|
139
|
+
return <SpaceGenerator role={role} space={data.subject.space} onCreateObjects={handleCreateObject} />;
|
|
140
140
|
},
|
|
141
141
|
}),
|
|
142
142
|
Surface.create({
|
|
143
|
-
id:
|
|
143
|
+
id: 'app-graph',
|
|
144
144
|
role: 'article',
|
|
145
145
|
filter: (data): data is { subject: GraphDebug } => isGraphDebug(data.subject),
|
|
146
146
|
component: ({ data }) => <DebugGraph graph={data.subject.graph} root={data.subject.root} />,
|
|
147
147
|
}),
|
|
148
148
|
Surface.create({
|
|
149
|
-
id:
|
|
149
|
+
id: 'tools-explorer',
|
|
150
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.ToolsExplorer),
|
|
151
|
+
component: () => <ToolsExplorer serverUrl={MCP_SERVER_URL} />,
|
|
152
|
+
}),
|
|
153
|
+
Surface.create({
|
|
154
|
+
id: 'wireframe',
|
|
155
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
150
156
|
role: ['article', 'section'],
|
|
151
157
|
position: 'hoist',
|
|
152
158
|
filter: (data): data is { subject: Obj.Unknown } => {
|
|
153
159
|
const settings = registry.get(settingsAtom);
|
|
154
160
|
return Obj.isObject(data.subject) && !!settings.wireframe;
|
|
155
161
|
},
|
|
156
|
-
component: ({ data, role }) => (
|
|
162
|
+
component: ({ data, role, name }) => (
|
|
157
163
|
<Wireframe label={`${role}:${name}`} object={data.subject} classNames='row-span-2 overflow-hidden' />
|
|
158
164
|
),
|
|
159
165
|
}),
|
|
160
166
|
Surface.create({
|
|
161
|
-
id:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
id: 'object-debug',
|
|
168
|
+
filter: AppSurface.allOf(
|
|
169
|
+
AppSurface.literal(AppSurface.Article, 'debug'),
|
|
170
|
+
AppSurface.companion(AppSurface.Article),
|
|
171
|
+
),
|
|
172
|
+
component: ({ role, data }) => <DebugObjectPanel role={role} companionTo={data.companionTo} />,
|
|
166
173
|
}),
|
|
167
174
|
Surface.create({
|
|
168
|
-
id:
|
|
169
|
-
|
|
175
|
+
id: 'devtools-overview',
|
|
176
|
+
filter: AppSurface.literal(Surface.makeType<{ subject: string }>('deck-companion--devtools'), 'devtools'),
|
|
170
177
|
component: () => <DevtoolsOverviewContainer />,
|
|
171
178
|
}),
|
|
172
179
|
Surface.create({
|
|
173
|
-
id:
|
|
174
|
-
|
|
180
|
+
id: 'space-objects',
|
|
181
|
+
filter: AppSurface.literal(
|
|
182
|
+
Surface.makeType<{ subject: string }>('deck-companion--space-objects'),
|
|
183
|
+
'space-objects',
|
|
184
|
+
),
|
|
185
|
+
component: () => {
|
|
186
|
+
const space = useActiveSpace();
|
|
187
|
+
if (!space) {
|
|
188
|
+
return null;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return <DebugSpaceObjectsPanel space={space} />;
|
|
192
|
+
},
|
|
193
|
+
}),
|
|
194
|
+
|
|
195
|
+
Surface.create({
|
|
196
|
+
id: 'status',
|
|
197
|
+
role: 'status-indicator',
|
|
198
|
+
position: 'hoist',
|
|
175
199
|
component: () => <DebugStatus />,
|
|
176
200
|
}),
|
|
177
201
|
|
|
@@ -180,66 +204,55 @@ export default Capability.makeModule(
|
|
|
180
204
|
//
|
|
181
205
|
|
|
182
206
|
Surface.create({
|
|
183
|
-
id:
|
|
184
|
-
|
|
185
|
-
filter: (data): data is any => data.subject === Devtools.Client.Config,
|
|
207
|
+
id: 'client.config',
|
|
208
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Config),
|
|
186
209
|
component: () => <ConfigPanel vaultSelector={false} />,
|
|
187
210
|
}),
|
|
188
211
|
Surface.create({
|
|
189
|
-
id:
|
|
190
|
-
|
|
191
|
-
filter: (data): data is any => data.subject === Devtools.Client.Storage,
|
|
212
|
+
id: 'client.storage',
|
|
213
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Storage),
|
|
192
214
|
component: () => <StoragePanel />,
|
|
193
215
|
}),
|
|
194
216
|
Surface.create({
|
|
195
|
-
id:
|
|
196
|
-
|
|
197
|
-
filter: (data): data is any => data.subject === Devtools.Client.Logs,
|
|
217
|
+
id: 'client.logs',
|
|
218
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Logs),
|
|
198
219
|
component: () => <LoggingPanel />,
|
|
199
220
|
}),
|
|
200
221
|
Surface.create({
|
|
201
|
-
id:
|
|
202
|
-
|
|
203
|
-
filter: (data): data is any => data.subject === Devtools.Client.Diagnostics,
|
|
222
|
+
id: 'client.diagnostics',
|
|
223
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Client.Diagnostics),
|
|
204
224
|
component: () => <DiagnosticsPanel />,
|
|
205
225
|
}),
|
|
206
226
|
Surface.create({
|
|
207
|
-
id:
|
|
208
|
-
|
|
209
|
-
filter: (data): data is any => data.subject === Devtools.Client.Tracing,
|
|
210
|
-
component: () => <TracingPanel />,
|
|
211
|
-
}),
|
|
212
|
-
Surface.create({
|
|
213
|
-
id: `${meta.id}/halo/identity`,
|
|
214
|
-
role: 'article',
|
|
215
|
-
filter: (data): data is any => data.subject === Devtools.Halo.Identity,
|
|
227
|
+
id: 'halo.identity',
|
|
228
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Identity),
|
|
216
229
|
component: () => <IdentityPanel />,
|
|
217
230
|
}),
|
|
218
231
|
Surface.create({
|
|
219
|
-
id:
|
|
220
|
-
|
|
221
|
-
filter: (data): data is any => data.subject === Devtools.Halo.Devices,
|
|
232
|
+
id: 'halo.devices',
|
|
233
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Devices),
|
|
222
234
|
component: () => <DeviceListPanel />,
|
|
223
235
|
}),
|
|
224
236
|
Surface.create({
|
|
225
|
-
id:
|
|
226
|
-
|
|
227
|
-
filter: (data): data is any => data.subject === Devtools.Halo.Keyring,
|
|
237
|
+
id: 'halo.keyring',
|
|
238
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Keyring),
|
|
228
239
|
component: () => <KeyringPanel />,
|
|
229
240
|
}),
|
|
230
241
|
Surface.create({
|
|
231
|
-
id:
|
|
232
|
-
|
|
233
|
-
filter: (data): data is any => data.subject === Devtools.Halo.Credentials,
|
|
242
|
+
id: 'halo.credentials',
|
|
243
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Halo.Credentials),
|
|
234
244
|
component: () => {
|
|
235
|
-
const space =
|
|
245
|
+
const space = useActiveSpace();
|
|
246
|
+
if (!space) {
|
|
247
|
+
return null;
|
|
248
|
+
}
|
|
249
|
+
|
|
236
250
|
return <CredentialsPanel space={space} />;
|
|
237
251
|
},
|
|
238
252
|
}),
|
|
239
253
|
Surface.create({
|
|
240
|
-
id:
|
|
241
|
-
|
|
242
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Spaces,
|
|
254
|
+
id: 'echo.spaces',
|
|
255
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Spaces),
|
|
243
256
|
component: () => {
|
|
244
257
|
const { invokePromise } = useOperationInvoker();
|
|
245
258
|
const handleSelect = useCallback(
|
|
@@ -250,133 +263,148 @@ export default Capability.makeModule(
|
|
|
250
263
|
},
|
|
251
264
|
}),
|
|
252
265
|
Surface.create({
|
|
253
|
-
id:
|
|
254
|
-
|
|
255
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Space,
|
|
266
|
+
id: 'echo.space',
|
|
267
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Space),
|
|
256
268
|
component: () => {
|
|
257
|
-
const space =
|
|
269
|
+
const space = useActiveSpace();
|
|
258
270
|
const { invokePromise } = useOperationInvoker();
|
|
259
271
|
const handleSelect = useCallback(
|
|
260
272
|
() => invokePromise(LayoutOperation.Open, { subject: [Devtools.Echo.Feeds] }),
|
|
261
273
|
[invokePromise],
|
|
262
274
|
);
|
|
275
|
+
if (!space) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
|
|
263
279
|
return <SpaceInfoPanel space={space} onSelectFeed={handleSelect} onSelectPipeline={handleSelect} />;
|
|
264
280
|
},
|
|
265
281
|
}),
|
|
266
282
|
Surface.create({
|
|
267
|
-
id:
|
|
268
|
-
|
|
269
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Feeds,
|
|
283
|
+
id: 'echo.feeds',
|
|
284
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Feeds),
|
|
270
285
|
component: () => {
|
|
271
|
-
const space =
|
|
286
|
+
const space = useActiveSpace();
|
|
287
|
+
if (!space) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
|
|
272
291
|
return <FeedsPanel space={space} />;
|
|
273
292
|
},
|
|
274
293
|
}),
|
|
275
294
|
Surface.create({
|
|
276
|
-
id:
|
|
277
|
-
|
|
278
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Objects,
|
|
295
|
+
id: 'echo.objects',
|
|
296
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Objects),
|
|
279
297
|
component: () => {
|
|
280
|
-
const space =
|
|
298
|
+
const space = useActiveSpace();
|
|
299
|
+
if (!space) {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
|
|
281
303
|
return <ObjectsPanel space={space} />;
|
|
282
304
|
},
|
|
283
305
|
}),
|
|
284
306
|
Surface.create({
|
|
285
|
-
id:
|
|
286
|
-
|
|
287
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Schema,
|
|
307
|
+
id: 'echo.schema',
|
|
308
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Schema),
|
|
288
309
|
component: () => {
|
|
289
|
-
const space =
|
|
310
|
+
const space = useActiveSpace();
|
|
311
|
+
if (!space) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
|
|
290
315
|
return <SchemaPanel space={space} />;
|
|
291
316
|
},
|
|
292
317
|
}),
|
|
293
318
|
Surface.create({
|
|
294
|
-
id:
|
|
295
|
-
|
|
296
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Automerge,
|
|
319
|
+
id: 'echo.automerge',
|
|
320
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Automerge),
|
|
297
321
|
component: () => {
|
|
298
|
-
const space =
|
|
322
|
+
const space = useActiveSpace();
|
|
323
|
+
if (!space) {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
|
|
299
327
|
return <AutomergePanel space={space} />;
|
|
300
328
|
},
|
|
301
329
|
}),
|
|
302
330
|
Surface.create({
|
|
303
|
-
id:
|
|
304
|
-
|
|
305
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Queues,
|
|
331
|
+
id: 'echo.queues',
|
|
332
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Queues),
|
|
306
333
|
component: () => <QueuesPanel />,
|
|
307
334
|
}),
|
|
308
335
|
Surface.create({
|
|
309
|
-
id:
|
|
310
|
-
|
|
311
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Members,
|
|
336
|
+
id: 'echo.members',
|
|
337
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Members),
|
|
312
338
|
component: () => {
|
|
313
|
-
const space =
|
|
339
|
+
const space = useActiveSpace();
|
|
340
|
+
if (!space) {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
|
|
314
344
|
return <MembersPanel space={space} />;
|
|
315
345
|
},
|
|
316
346
|
}),
|
|
317
347
|
Surface.create({
|
|
318
|
-
id:
|
|
319
|
-
|
|
320
|
-
filter: (data): data is any => data.subject === Devtools.Echo.Metadata,
|
|
348
|
+
id: 'echo.metadata',
|
|
349
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Echo.Metadata),
|
|
321
350
|
component: () => <MetadataPanel />,
|
|
322
351
|
}),
|
|
323
352
|
Surface.create({
|
|
324
|
-
id:
|
|
325
|
-
|
|
326
|
-
filter: (data): data is any => data.subject === Devtools.Mesh.Signal,
|
|
353
|
+
id: 'mesh.signal',
|
|
354
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Signal),
|
|
327
355
|
component: () => <SignalPanel />,
|
|
328
356
|
}),
|
|
329
357
|
Surface.create({
|
|
330
|
-
id:
|
|
331
|
-
|
|
332
|
-
filter: (data): data is any => data.subject === Devtools.Mesh.Swarm,
|
|
358
|
+
id: 'mesh.swarm',
|
|
359
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Swarm),
|
|
333
360
|
component: () => <SwarmPanel />,
|
|
334
361
|
}),
|
|
335
362
|
Surface.create({
|
|
336
|
-
id:
|
|
337
|
-
|
|
338
|
-
filter: (data): data is any => data.subject === Devtools.Mesh.Network,
|
|
363
|
+
id: 'mesh.network',
|
|
364
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Mesh.Network),
|
|
339
365
|
component: () => {
|
|
340
|
-
const space =
|
|
366
|
+
const space = useActiveSpace();
|
|
367
|
+
if (!space) {
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
|
|
341
371
|
return <NetworkPanel space={space} />;
|
|
342
372
|
},
|
|
343
373
|
}),
|
|
344
|
-
// TODO(wittjosiah): Remove?
|
|
345
|
-
// createSurface({
|
|
346
|
-
// id: `${meta.id}/agent/dashboard`,
|
|
347
|
-
// role: 'article',
|
|
348
|
-
// filter: (data): data is any => data.subject === Devtools.Agent.Dashboard,
|
|
349
|
-
// component: () => <DashboardPanel />,
|
|
350
|
-
// }),
|
|
351
374
|
Surface.create({
|
|
352
|
-
id:
|
|
353
|
-
|
|
354
|
-
filter: (data): data is any => data.subject === Devtools.Edge.Dashboard,
|
|
375
|
+
id: 'edge.dashboard',
|
|
376
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Dashboard),
|
|
355
377
|
component: () => <EdgeDashboardPanel />,
|
|
356
378
|
}),
|
|
357
379
|
Surface.create({
|
|
358
|
-
id:
|
|
359
|
-
|
|
360
|
-
filter: (data): data is any => data.subject === Devtools.Edge.Workflows,
|
|
380
|
+
id: 'edge.workflows',
|
|
381
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Workflows),
|
|
361
382
|
component: () => {
|
|
362
|
-
const space =
|
|
383
|
+
const space = useActiveSpace();
|
|
384
|
+
if (!space) {
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
|
|
363
388
|
return <WorkflowPanel space={space} />;
|
|
364
389
|
},
|
|
365
390
|
}),
|
|
366
391
|
Surface.create({
|
|
367
|
-
id:
|
|
368
|
-
|
|
369
|
-
filter: (data): data is any => data.subject === Devtools.Edge.Traces,
|
|
392
|
+
id: 'edge.traces',
|
|
393
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Traces),
|
|
370
394
|
component: () => {
|
|
371
|
-
const space =
|
|
372
|
-
|
|
373
|
-
|
|
395
|
+
const space = useActiveSpace();
|
|
396
|
+
if (!space) {
|
|
397
|
+
return null;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const feed = space.properties.invocationTraceFeed?.target;
|
|
401
|
+
const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
402
|
+
return <InvocationTraceContainer db={space.db} queueDxn={queueDxn} detailAxis='block' />;
|
|
374
403
|
},
|
|
375
404
|
}),
|
|
376
405
|
Surface.create({
|
|
377
|
-
id:
|
|
378
|
-
|
|
379
|
-
filter: (data): data is any => data.subject === Devtools.Edge.Testing,
|
|
406
|
+
id: 'edge.testing',
|
|
407
|
+
filter: AppSurface.literal(AppSurface.Article, Devtools.Edge.Testing),
|
|
380
408
|
component: () => {
|
|
381
409
|
const { invokePromise } = useOperationInvoker();
|
|
382
410
|
const onSpaceCreate = useCallback(
|
|
@@ -395,9 +423,9 @@ export default Capability.makeModule(
|
|
|
395
423
|
await invokePromise(SpaceOperation.AddObject, { target: space.db, object: createResult.data.object });
|
|
396
424
|
}
|
|
397
425
|
log.info('script created', { result: createResult });
|
|
398
|
-
if (createResult.data?.object
|
|
426
|
+
if (createResult.data?.object) {
|
|
399
427
|
await invokePromise(LayoutOperation.Open, {
|
|
400
|
-
subject: [
|
|
428
|
+
subject: [getObjectPathFromObject(createResult.data.object)],
|
|
401
429
|
});
|
|
402
430
|
}
|
|
403
431
|
},
|
|
@@ -8,14 +8,14 @@ import { Capability } from '@dxos/app-framework';
|
|
|
8
8
|
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { createKvsStore } from '@dxos/effect';
|
|
10
10
|
|
|
11
|
-
import { meta } from '
|
|
12
|
-
import { DebugCapabilities,
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { DebugCapabilities, Settings } from '#types';
|
|
13
13
|
|
|
14
14
|
export default Capability.makeModule(() =>
|
|
15
15
|
Effect.sync(() => {
|
|
16
16
|
const settingsAtom = createKvsStore({
|
|
17
17
|
key: meta.id,
|
|
18
|
-
schema:
|
|
18
|
+
schema: Settings.Settings,
|
|
19
19
|
defaultValue: () => ({}),
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ export default Capability.makeModule(() =>
|
|
|
23
23
|
Capability.contributes(DebugCapabilities.Settings, settingsAtom),
|
|
24
24
|
Capability.contributes(AppCapabilities.Settings, {
|
|
25
25
|
prefix: meta.id,
|
|
26
|
-
schema:
|
|
26
|
+
schema: Settings.Settings,
|
|
27
27
|
atom: settingsAtom,
|
|
28
28
|
}),
|
|
29
29
|
];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
|
|
7
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
8
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
9
|
+
|
|
10
|
+
import { translations } from '#translations';
|
|
11
|
+
|
|
12
|
+
import { DebugSettings } from './DebugSettings';
|
|
13
|
+
|
|
14
|
+
const meta = {
|
|
15
|
+
title: 'plugins/plugin-debug/components/DebugSettings',
|
|
16
|
+
component: DebugSettings,
|
|
17
|
+
decorators: [withTheme(), withLayout({ layout: 'fullscreen' }), withClientProvider({ createIdentity: true })],
|
|
18
|
+
tags: ['settings'],
|
|
19
|
+
parameters: {
|
|
20
|
+
layout: 'fullscreen',
|
|
21
|
+
translations,
|
|
22
|
+
},
|
|
23
|
+
} satisfies Meta<typeof DebugSettings>;
|
|
24
|
+
|
|
25
|
+
export default meta;
|
|
26
|
+
|
|
27
|
+
type Story = StoryObj<typeof meta>;
|
|
28
|
+
|
|
29
|
+
export const Default: Story = {
|
|
30
|
+
args: {
|
|
31
|
+
settings: {
|
|
32
|
+
wireframe: false,
|
|
33
|
+
},
|
|
34
|
+
logStore: { export: async () => '' } as any,
|
|
35
|
+
},
|
|
36
|
+
};
|