@dxos/plugin-debug 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +102 -5
- package/PLUGIN.mdl +373 -0
- package/README.md +1 -1
- package/dist/lib/{browser/DebugGraph-7HXJ2PS2.mjs → neutral/DebugGraph-G4FWS57E.mjs} +4 -5
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
- package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +59 -0
- package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.workerd.mjs +12 -0
- package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs +223 -0
- package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs.map +7 -0
- package/dist/lib/{browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs → neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs} +10 -26
- package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs.map +7 -0
- package/dist/lib/{browser/DebugStatus-COQGH37G.mjs → neutral/DebugStatus-H2BAHN26.mjs} +36 -39
- package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs.map +7 -0
- package/dist/lib/{browser/DevtoolsOverviewContainer-C75NFVER.mjs → neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs} +9 -6
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
- package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs +177 -0
- package/dist/lib/neutral/GithubPanel-QJKDJRVQ.mjs.map +7 -0
- package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs +161 -0
- package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +146 -0
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs.map +7 -0
- package/dist/lib/{browser/Wireframe-KAGOKEFW.mjs → neutral/Wireframe-WD7S2AUU.mjs} +9 -10
- package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-builder-LGUQNXHD.mjs → neutral/app-graph-builder-XYLTBYKN.mjs} +246 -259
- package/dist/lib/neutral/app-graph-builder-XYLTBYKN.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-HOV6MV5B.mjs +43 -0
- package/dist/lib/neutral/chunk-HOV6MV5B.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-4UFQXPP7.mjs → neutral/chunk-UAAGABXZ.mjs} +24 -12
- package/dist/lib/neutral/chunk-UAAGABXZ.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-SWSGJEEL.mjs → neutral/components/index.mjs} +90 -292
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +25 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-context-I3USIAF6.mjs → neutral/react-context-MUZ3KVLU.mjs} +6 -6
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-BTVNKKVQ.mjs → neutral/react-surface-3MDMZGCA.mjs} +162 -180
- package/dist/lib/neutral/react-surface-3MDMZGCA.mjs.map +7 -0
- package/dist/lib/{browser/settings-SLTQJJNF.mjs → neutral/settings-MPM6YUP4.mjs} +7 -11
- package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +91 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +2 -5
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/DebugPlugin.node.d.ts +5 -0
- package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.test.d.ts +2 -0
- package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.workerd.d.ts +5 -0
- package/dist/types/src/DebugPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.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.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
- 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 +106 -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 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +3 -4
- 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/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +2 -2
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/index.d.ts +1 -2
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +3 -4
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +1 -2
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +1 -2
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/index.d.ts +1 -2
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +1 -2
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +15 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +106 -0
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +3 -0
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +1 -0
- package/dist/types/src/containers/GithubPanel/index.d.ts +2 -0
- package/dist/types/src/containers/GithubPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +3 -0
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryPanel/index.d.ts +2 -0
- package/dist/types/src/containers/RegistryPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +3 -1
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +1 -2
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/index.d.ts +1 -2
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +87 -61
- 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 +70 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +112 -71
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +14 -10
- package/src/DebugPlugin.workerd.ts +12 -0
- package/src/capabilities/app-graph-builder.ts +433 -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} +179 -161
- 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 +259 -0
- package/src/components/DebugSettings/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +28 -28
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/presets.ts +39 -62
- package/src/components/index.ts +4 -0
- package/src/containers/DebugGraph/DebugGraph.tsx +3 -2
- package/src/containers/DebugGraph/index.ts +1 -3
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +49 -18
- package/src/containers/DebugObjectPanel/index.ts +1 -3
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +11 -24
- package/src/containers/DebugSpaceObjectsPanel/index.ts +1 -3
- package/src/containers/DebugStatus/DebugStatus.tsx +42 -19
- package/src/containers/DebugStatus/index.ts +1 -3
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +8 -1
- package/src/containers/DevtoolsOverviewContainer/index.ts +1 -3
- package/src/containers/GithubPanel/GithubComponent.stories.tsx +38 -0
- package/src/containers/GithubPanel/GithubComponent.tsx +192 -0
- package/src/containers/GithubPanel/GithubPanel.tsx +17 -0
- package/src/containers/GithubPanel/index.ts +5 -0
- package/src/containers/RegistryPanel/RegistryPanel.tsx +150 -0
- package/src/containers/RegistryPanel/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +104 -104
- package/src/containers/SpaceGenerator/index.ts +1 -3
- package/src/containers/Wireframe/Wireframe.tsx +3 -7
- package/src/containers/Wireframe/index.ts +1 -3
- package/src/containers/index.ts +2 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +26 -6
- package/src/plugin.ts +10 -0
- package/src/translations.ts +83 -60
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +16 -14
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +0 -7
- package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs +0 -33
- package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs.map +0 -7
- package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs +0 -174
- package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs.map +0 -7
- package/dist/lib/browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs.map +0 -7
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-SWSGJEEL.mjs.map +0 -7
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LGUQNXHD.mjs.map +0 -7
- 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/index.mjs +0 -132
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-I3USIAF6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-BTVNKKVQ.mjs.map +0 -7
- package/dist/lib/browser/settings-SLTQJJNF.mjs.map +0 -7
- 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 -5
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- 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.map +0 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +0 -10
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/containers/DebugSettings/index.d.ts +0 -3
- package/dist/types/src/containers/DebugSettings/index.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 -441
- 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/containers/DebugSettings/DebugSettings.tsx +0 -201
- package/src/containers/DebugSettings/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { JsonView, PanelContainer, Placeholder, Searchbar } from '@dxos/devtools';
|
|
9
|
+
import { Entity, Format, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { useClient } from '@dxos/react-client';
|
|
11
|
+
import { Toolbar } from '@dxos/react-ui';
|
|
12
|
+
import { DynamicTable, type TableFeatures } from '@dxos/react-ui-table';
|
|
13
|
+
import { mx } from '@dxos/ui-theme';
|
|
14
|
+
|
|
15
|
+
type RegistryRow = {
|
|
16
|
+
id: string;
|
|
17
|
+
kind: string;
|
|
18
|
+
label: string;
|
|
19
|
+
_entity: Entity.Unknown;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const textFilter = (text?: string) => {
|
|
23
|
+
if (!text) {
|
|
24
|
+
return () => true;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const matcher = new RegExp(text, 'i');
|
|
28
|
+
return (entity: Entity.Unknown) => {
|
|
29
|
+
const typename = Entity.getTypename(entity) ?? '';
|
|
30
|
+
const metaKey = Obj.isObject(entity) ? (Obj.getMeta(entity).key ?? '') : '';
|
|
31
|
+
const uri = Type.isType(entity) ? (Type.getURI(entity)?.toString() ?? '') : '';
|
|
32
|
+
const operationKey =
|
|
33
|
+
Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)
|
|
34
|
+
? (Operation.getKey(entity) ?? '')
|
|
35
|
+
: '';
|
|
36
|
+
const name = Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity) ? entity.name : '';
|
|
37
|
+
return [typename, metaKey, uri, operationKey, name, getEntityId(entity)].some((value) => value.match(matcher));
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const getEntityId = (entity: Entity.Unknown): string => {
|
|
42
|
+
if (entity.id) {
|
|
43
|
+
return entity.id;
|
|
44
|
+
}
|
|
45
|
+
if (Type.isType(entity)) {
|
|
46
|
+
return Type.getURI(entity)?.toString() ?? Type.getTypename(entity) ?? 'unknown-type';
|
|
47
|
+
}
|
|
48
|
+
return Entity.getTypename(entity) ?? 'unknown';
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const getKind = (entity: Entity.Unknown): string => {
|
|
52
|
+
if (Type.isType(entity)) {
|
|
53
|
+
return 'type';
|
|
54
|
+
}
|
|
55
|
+
if (Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)) {
|
|
56
|
+
return 'operation';
|
|
57
|
+
}
|
|
58
|
+
return 'other';
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const getLabel = (entity: Entity.Unknown): string => {
|
|
62
|
+
if (Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)) {
|
|
63
|
+
return entity.name || Operation.getKey(entity) || getEntityId(entity);
|
|
64
|
+
}
|
|
65
|
+
if (Type.isType(entity)) {
|
|
66
|
+
return Type.getTypename(entity) ?? getEntityId(entity);
|
|
67
|
+
}
|
|
68
|
+
return getEntityId(entity);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const toDetailJson = (entity: Entity.Unknown): object => {
|
|
72
|
+
if (Type.isType(entity)) {
|
|
73
|
+
return {
|
|
74
|
+
id: getEntityId(entity),
|
|
75
|
+
typename: Type.getTypename(entity),
|
|
76
|
+
uri: Type.getURI(entity)?.toString(),
|
|
77
|
+
version: Type.getVersion(entity),
|
|
78
|
+
jsonSchema: entity.jsonSchema,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (Obj.isObject(entity)) {
|
|
82
|
+
return Obj.toJSON(entity);
|
|
83
|
+
}
|
|
84
|
+
return { id: getEntityId(entity), typename: Entity.getTypename(entity) };
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const RegistryPanel = () => {
|
|
88
|
+
const client = useClient();
|
|
89
|
+
const [entities, setEntities] = useState<Entity.Unknown[]>([]);
|
|
90
|
+
const [filter, setFilter] = useState('');
|
|
91
|
+
const [selected, setSelected] = useState<Entity.Unknown>();
|
|
92
|
+
|
|
93
|
+
useEffect(() => {
|
|
94
|
+
const registry = client.graph.registry;
|
|
95
|
+
const refresh = () => setEntities([...registry.list()]);
|
|
96
|
+
refresh();
|
|
97
|
+
return registry.changed.on(refresh);
|
|
98
|
+
}, [client]);
|
|
99
|
+
|
|
100
|
+
const properties = useMemo(
|
|
101
|
+
() => [
|
|
102
|
+
{ name: 'kind', format: Format.TypeFormat.String, size: 100 },
|
|
103
|
+
{ name: 'label', format: Format.TypeFormat.String },
|
|
104
|
+
{ name: 'id', format: Format.TypeFormat.String, size: 280 },
|
|
105
|
+
],
|
|
106
|
+
[],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
const rows = useMemo((): RegistryRow[] => {
|
|
110
|
+
return entities
|
|
111
|
+
.filter(textFilter(filter))
|
|
112
|
+
.map((entity) => ({
|
|
113
|
+
id: getEntityId(entity),
|
|
114
|
+
kind: getKind(entity),
|
|
115
|
+
label: getLabel(entity),
|
|
116
|
+
_entity: entity,
|
|
117
|
+
}))
|
|
118
|
+
.toSorted((left, right) => left.label.localeCompare(right.label));
|
|
119
|
+
}, [entities, filter]);
|
|
120
|
+
|
|
121
|
+
const handleRowClicked = useCallback((row: RegistryRow | undefined) => {
|
|
122
|
+
if (!row?._entity) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
setSelected(row._entity);
|
|
126
|
+
}, []);
|
|
127
|
+
|
|
128
|
+
const detailJson = useMemo(() => (selected ? toDetailJson(selected) : undefined), [selected]);
|
|
129
|
+
|
|
130
|
+
const features: Partial<TableFeatures> = useMemo(() => ({ selection: { enabled: true, mode: 'single' } }), []);
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<PanelContainer
|
|
134
|
+
toolbar={
|
|
135
|
+
<Toolbar.Root>
|
|
136
|
+
<Searchbar placeholder='Filter...' onChange={setFilter} />
|
|
137
|
+
</Toolbar.Root>
|
|
138
|
+
}
|
|
139
|
+
>
|
|
140
|
+
<div className={mx('h-full grid grid-cols-[2fr_1fr] overflow-hidden')}>
|
|
141
|
+
<div className={mx('flex flex-col min-h-0 overflow-hidden')}>
|
|
142
|
+
<DynamicTable properties={properties} rows={rows} features={features} onRowClick={handleRowClicked} />
|
|
143
|
+
</div>
|
|
144
|
+
<div className={mx('min-h-0 h-full overflow-auto border-s border-separator text-sm')}>
|
|
145
|
+
{detailJson ? <JsonView data={detailJson} /> : <Placeholder label='Details' />}
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</PanelContainer>
|
|
149
|
+
);
|
|
150
|
+
};
|
|
@@ -6,122 +6,122 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { ComputeGraph } from '@dxos/conductor';
|
|
9
|
-
import { Filter, Obj,
|
|
10
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
11
|
-
import { Sheet } from '@dxos/plugin-sheet
|
|
12
|
-
import {
|
|
9
|
+
import { Filter, Obj, Type } from '@dxos/echo';
|
|
10
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
11
|
+
import { Sheet } from '@dxos/plugin-sheet';
|
|
12
|
+
import { Sketch } from '@dxos/plugin-sketch';
|
|
13
13
|
import { useClient } from '@dxos/react-client';
|
|
14
14
|
import { type Space } from '@dxos/react-client/echo';
|
|
15
15
|
import { IconButton, Input, Panel, ScrollArea, Toolbar, useAsyncEffect } from '@dxos/react-ui';
|
|
16
|
-
import {
|
|
16
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
17
17
|
import { Organization, Person, Task } from '@dxos/types';
|
|
18
|
-
import {
|
|
18
|
+
import { sortKeys } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { type ObjectGenerator, SchemaTable, createGenerator, generator, staticGenerators } from '
|
|
20
|
+
import { type ObjectGenerator, SchemaTable, createGenerator, generator, staticGenerators } from '#components';
|
|
21
|
+
|
|
22
|
+
// TODO(burdon): Make extensible.
|
|
23
|
+
const staticTypes = [Markdown.Document, Sketch.Sketch, Sheet.Sheet, ComputeGraph];
|
|
24
|
+
const recordTypes: Type.AnyObj[] = [Organization.Organization, Person.Person, Task.Task];
|
|
21
25
|
|
|
22
26
|
export type SpaceGeneratorProps = {
|
|
23
27
|
space: Space;
|
|
24
28
|
onCreateObjects?: (objects: Obj.Unknown[]) => void;
|
|
25
29
|
};
|
|
26
30
|
|
|
27
|
-
export const SpaceGenerator =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const presets = useMemo(() => generator(), []);
|
|
35
|
-
|
|
36
|
-
// Register types.
|
|
37
|
-
useAsyncEffect(async () => {
|
|
38
|
-
await client.addTypes([...staticTypes, ...recordTypes, ...presets.schemas]);
|
|
39
|
-
}, [client]);
|
|
40
|
-
|
|
41
|
-
// Create type generators.
|
|
42
|
-
const typeMap = useMemo(() => {
|
|
43
|
-
const recordGenerators = new Map<string, ObjectGenerator<any>>(
|
|
44
|
-
recordTypes.map((type) => [type.typename, createGenerator(client, invokePromise, type)]),
|
|
45
|
-
);
|
|
31
|
+
export const SpaceGenerator = composable<HTMLDivElement, SpaceGeneratorProps>(
|
|
32
|
+
({ space, onCreateObjects, children, ...props }, forwardedRef) => {
|
|
33
|
+
const { invokePromise } = useOperationInvoker();
|
|
34
|
+
const client = useClient();
|
|
35
|
+
const [count, setCount] = useState(1);
|
|
36
|
+
const [info, setInfo] = useState<any>({});
|
|
37
|
+
const presets = useMemo(() => generator(), []);
|
|
46
38
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const updateInfo = async () => {
|
|
52
|
-
// Create schema map.
|
|
53
|
-
const echoSchema = await space.db.schemaRegistry.query().run();
|
|
54
|
-
const staticSchema = await space.db.graph.schemaRegistry.query().run();
|
|
55
|
-
|
|
56
|
-
// Create object map.
|
|
57
|
-
const objects = await space.db.query(Filter.everything()).run();
|
|
58
|
-
const objectMap = sortKeys(
|
|
59
|
-
objects.reduce<Record<string, number>>((map, obj) => {
|
|
60
|
-
const type = Obj.getTypename(obj);
|
|
61
|
-
if (type) {
|
|
62
|
-
const count = map[type] ?? 0;
|
|
63
|
-
map[type] = count + 1;
|
|
64
|
-
}
|
|
39
|
+
// Register types.
|
|
40
|
+
useAsyncEffect(async () => {
|
|
41
|
+
await client.addTypes([...staticTypes, ...recordTypes, ...presets.schemas]);
|
|
42
|
+
}, [client, presets]);
|
|
65
43
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
// Create type generators.
|
|
45
|
+
const typeMap = useMemo(() => {
|
|
46
|
+
const recordGenerators = new Map<string, ObjectGenerator<any>>(
|
|
47
|
+
recordTypes.map((type) => [Type.getTypename(type), createGenerator(client, invokePromise, type)]),
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return new Map([...staticGenerators, ...presets.items, ...recordGenerators]);
|
|
51
|
+
}, [client, invokePromise, presets]);
|
|
52
|
+
|
|
53
|
+
// Query space to get info.
|
|
54
|
+
const updateInfo = useCallback(async () => {
|
|
55
|
+
const allSchema = [...space.db.graph.registry.list().filter(Type.isType)];
|
|
56
|
+
const echoSchema = allSchema.filter((t) => Type.isTypeKind(t));
|
|
57
|
+
const staticSchema = allSchema.filter((t) => !Type.isTypeKind(t));
|
|
58
|
+
|
|
59
|
+
const objects = await space.db.query(Filter.everything()).run();
|
|
60
|
+
const objectMap = sortKeys(
|
|
61
|
+
objects.reduce<Record<string, number>>((map, obj) => {
|
|
62
|
+
const type = Obj.getTypename(obj);
|
|
63
|
+
if (type) {
|
|
64
|
+
const count = map[type] ?? 0;
|
|
65
|
+
map[type] = count + 1;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return map;
|
|
69
|
+
}, {}),
|
|
70
|
+
);
|
|
69
71
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
setInfo({
|
|
73
|
+
schema: {
|
|
74
|
+
static: staticSchema.length,
|
|
75
|
+
mutable: echoSchema.length,
|
|
76
|
+
},
|
|
77
|
+
objects: objectMap,
|
|
78
|
+
});
|
|
79
|
+
}, [space]);
|
|
80
|
+
|
|
81
|
+
useAsyncEffect(updateInfo, [updateInfo]);
|
|
82
|
+
|
|
83
|
+
const handleCreateData = useCallback(
|
|
84
|
+
async (typename: string) => {
|
|
85
|
+
const constructor = typeMap.get(typename);
|
|
86
|
+
if (constructor) {
|
|
87
|
+
// TODO(burdon): Input to specify number of objects.
|
|
88
|
+
await constructor(space, count, onCreateObjects);
|
|
89
|
+
await updateInfo();
|
|
90
|
+
}
|
|
74
91
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
</Toolbar.Root>
|
|
112
|
-
</Panel.Toolbar>
|
|
113
|
-
<Panel.Content asChild>
|
|
114
|
-
<ScrollArea.Root thin orientation='vertical'>
|
|
115
|
-
<ScrollArea.Viewport classNames='gap-4 divide-y divide-subdued-separator'>
|
|
116
|
-
<SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />
|
|
117
|
-
<SchemaTable types={recordTypes} objects={info.objects} label='Record Types' onClick={handleCreateData} />
|
|
118
|
-
<SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />
|
|
119
|
-
<SyntaxHighlighter language='json' classNames='text-xs'>
|
|
120
|
-
{JSON.stringify({ space, ...info }, jsonKeyReplacer({ truncate: true }), 2)}
|
|
121
|
-
</SyntaxHighlighter>
|
|
122
|
-
</ScrollArea.Viewport>
|
|
123
|
-
</ScrollArea.Root>
|
|
124
|
-
</Panel.Content>
|
|
125
|
-
</Panel.Root>
|
|
126
|
-
);
|
|
127
|
-
};
|
|
92
|
+
[typeMap, count, space, onCreateObjects, updateInfo],
|
|
93
|
+
);
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
<Panel.Root {...composableProps(props)} ref={forwardedRef}>
|
|
97
|
+
<Panel.Toolbar asChild>
|
|
98
|
+
<Toolbar.Root>
|
|
99
|
+
<IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />
|
|
100
|
+
<Toolbar.Separator />
|
|
101
|
+
<Input.Root>
|
|
102
|
+
<Input.TextInput
|
|
103
|
+
type='number'
|
|
104
|
+
placeholder='Count'
|
|
105
|
+
classNames='w-[4rem] text-right'
|
|
106
|
+
min={1}
|
|
107
|
+
max={100}
|
|
108
|
+
size={8}
|
|
109
|
+
value={count}
|
|
110
|
+
onChange={(event) => setCount(parseInt(event.target.value))}
|
|
111
|
+
/>
|
|
112
|
+
</Input.Root>
|
|
113
|
+
</Toolbar.Root>
|
|
114
|
+
</Panel.Toolbar>
|
|
115
|
+
<Panel.Content asChild>
|
|
116
|
+
<ScrollArea.Root thin orientation='vertical'>
|
|
117
|
+
<ScrollArea.Viewport classNames='dx-document gap-4 divide-y divide-subdued-separator'>
|
|
118
|
+
<SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />
|
|
119
|
+
<SchemaTable types={recordTypes} objects={info.objects} label='Record Types' onClick={handleCreateData} />
|
|
120
|
+
<SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />
|
|
121
|
+
</ScrollArea.Viewport>
|
|
122
|
+
</ScrollArea.Root>
|
|
123
|
+
</Panel.Content>
|
|
124
|
+
</Panel.Root>
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
);
|
|
@@ -8,7 +8,7 @@ import { useResizeDetector } from 'react-resize-detector';
|
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import { type ThemedClassName } from '@dxos/react-ui';
|
|
10
10
|
import { useAttentionAttributes } from '@dxos/react-ui-attention';
|
|
11
|
-
import {
|
|
11
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
12
12
|
import { mx } from '@dxos/ui-theme';
|
|
13
13
|
|
|
14
14
|
// TODO(burdon): Create generic container with wireframe mode.
|
|
@@ -19,7 +19,7 @@ export type WireframeProps = ThemedClassName<{
|
|
|
19
19
|
|
|
20
20
|
// TODO(burdon): Make focusable and attendable with input.
|
|
21
21
|
export const Wireframe = ({ classNames, label, object }: WireframeProps) => {
|
|
22
|
-
const attentionAttrs = useAttentionAttributes(Obj.
|
|
22
|
+
const attentionAttrs = useAttentionAttributes(Obj.getURI(object));
|
|
23
23
|
const { width, height, ref } = useResizeDetector();
|
|
24
24
|
|
|
25
25
|
return (
|
|
@@ -29,11 +29,7 @@ export const Wireframe = ({ classNames, label, object }: WireframeProps) => {
|
|
|
29
29
|
<div>{label}</div>
|
|
30
30
|
<div>{`[${width}x${height}]`}</div>
|
|
31
31
|
</div>
|
|
32
|
-
{object &&
|
|
33
|
-
<SyntaxHighlighter language='json' classNames='text-xs opacity-75 rounded-sm'>
|
|
34
|
-
{JSON.stringify(object, undefined, 2)}
|
|
35
|
-
</SyntaxHighlighter>
|
|
36
|
-
)}
|
|
32
|
+
{object && <JsonHighlighter data={object} classNames='text-xs opacity-75 rounded-sm' />}
|
|
37
33
|
</div>
|
|
38
34
|
<svg width={width} height={height} className='bg-transparent *:text-subdued'>
|
|
39
35
|
<rect x={0} y={0} width={width} height={height} strokeWidth={1} fill='none' />
|
package/src/containers/index.ts
CHANGED
|
@@ -6,9 +6,10 @@ import { type ComponentType, lazy } from 'react';
|
|
|
6
6
|
|
|
7
7
|
export const DebugGraph: ComponentType<any> = lazy(() => import('./DebugGraph'));
|
|
8
8
|
export const DebugObjectPanel: ComponentType<any> = lazy(() => import('./DebugObjectPanel'));
|
|
9
|
-
export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));
|
|
10
9
|
export const DebugStatus: ComponentType<any> = lazy(() => import('./DebugStatus'));
|
|
11
10
|
export const DevtoolsOverviewContainer: ComponentType<any> = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
12
11
|
export const SpaceGenerator: ComponentType<any> = lazy(() => import('./SpaceGenerator'));
|
|
13
12
|
export const Wireframe: ComponentType<any> = lazy(() => import('./Wireframe'));
|
|
14
13
|
export const DebugSpaceObjectsPanel: ComponentType<any> = lazy(() => import('./DebugSpaceObjectsPanel'));
|
|
14
|
+
export const GithubPanel: ComponentType<any> = lazy(() => import('./GithubPanel'));
|
|
15
|
+
export const RegistryPanel: ComponentType<any> = lazy(() => import('./RegistryPanel'));
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,17 +2,37 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.debug'),
|
|
10
11
|
name: 'Debug',
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
spec: 'PLUGIN.mdl',
|
|
11
14
|
description: trim`
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
DebugPlugin is the developer toolkit for DXOS Composer. It adds a structured Devtools node
|
|
16
|
+
to the navigation graph — grouped into Client, HALO, ECHO, Mesh, and EDGE sub-sections —
|
|
17
|
+
exposing panel views for config, storage, logs, diagnostics, identity, devices, feeds,
|
|
18
|
+
objects, schemas, automerge internals, network topology, EDGE workflows, and invocation
|
|
19
|
+
traces, all driven by the @dxos/devtools component library.
|
|
20
|
+
|
|
21
|
+
The plugin contributes a Debug companion tab to every ECHO object in the deck so developers
|
|
22
|
+
can inspect raw field values and DXNs inline, and a Space Objects companion panel that lists
|
|
23
|
+
all objects in the active space with live reactive updates.
|
|
24
|
+
|
|
25
|
+
Test-data generation is available via a SpaceGenerator article surface: developers can
|
|
26
|
+
create configurable batches of synthetic ECHO objects into any space collection, with a
|
|
27
|
+
status indicator showing when generation is running.
|
|
28
|
+
|
|
29
|
+
Additional utilities include a wireframe overlay mode that draws labelled borders around
|
|
30
|
+
every article and section surface, a log-capture and download facility backed by an
|
|
31
|
+
IdbLogStore, a ToolsExplorer connected to the DXOS MCP introspect service, and a
|
|
32
|
+
globalThis helper for manual storage-version testing.
|
|
14
33
|
`,
|
|
15
34
|
icon: 'ph--bug--regular',
|
|
16
35
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-debug',
|
|
17
36
|
screenshots: ['https://dxos.network/plugin-details-debug-dark.png'],
|
|
18
|
-
|
|
37
|
+
tags: ['labs'],
|
|
38
|
+
});
|
package/src/plugin.ts
ADDED