@dxos/plugin-debug 0.8.4-main.406dc2a → 0.8.4-main.4f23b4e393
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/neutral/DebugGraph-G4FWS57E.mjs +15 -0
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +47 -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/DebugSettings-Z3XADRNK.mjs +224 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs.map +7 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs +34 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs.map +7 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs +121 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs.map +7 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs +23 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs +143 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs.map +7 -0
- package/dist/lib/neutral/Wireframe-7SNRUKET.mjs +52 -0
- package/dist/lib/neutral/Wireframe-7SNRUKET.mjs.map +7 -0
- package/dist/lib/neutral/app-graph-builder-YPYHL2K5.mjs +577 -0
- package/dist/lib/neutral/app-graph-builder-YPYHL2K5.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-3OGPOE7H.mjs +20 -0
- package/dist/lib/neutral/chunk-3OGPOE7H.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-SRV2AIGJ.mjs → neutral/chunk-NFIOTQRZ.mjs} +30 -9
- package/dist/lib/neutral/chunk-NFIOTQRZ.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-VMWHGAJZ.mjs → neutral/components/index.mjs} +342 -521
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +21 -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/neutral/react-context-MUZ3KVLU.mjs +17 -0
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-UR2SYHYW.mjs +419 -0
- package/dist/lib/neutral/react-surface-UR2SYHYW.mjs.map +7 -0
- package/dist/lib/neutral/settings-MPM6YUP4.mjs +28 -0
- package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +83 -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 +4 -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 +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +4 -2
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +7 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +5 -2
- package/dist/types/src/capabilities/settings.d.ts.map +1 -1
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +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 +5 -5
- 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 +2 -5
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +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/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
- 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/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/index.d.ts +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 +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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 +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 +131 -74
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +28 -34
- package/src/capabilities/app-graph-builder.ts +362 -388
- package/src/capabilities/index.ts +5 -5
- package/src/capabilities/react-context.tsx +16 -7
- package/src/capabilities/react-surface.tsx +378 -339
- package/src/capabilities/settings.ts +24 -12
- 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/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +31 -40
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +238 -137
- package/src/components/index.ts +4 -8
- package/src/containers/DebugGraph/DebugGraph.tsx +14 -0
- 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/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
- 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 +7 -12
- package/src/containers/Wireframe/index.ts +5 -0
- package/src/containers/index.ts +13 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +8 -5
- package/src/plugin.ts +10 -0
- package/src/translations.ts +75 -58
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +20 -11
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs +0 -20
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs +0 -25
- package/dist/lib/browser/DevtoolsOverviewContainer-EPD6EWT5.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-VMWHGAJZ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs +0 -588
- package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs.map +0 -7
- package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-SVCKCXCL.mjs +0 -16
- package/dist/lib/browser/chunk-SVCKCXCL.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -131
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-QLZE7VSQ.mjs +0 -16
- package/dist/lib/browser/react-context-QLZE7VSQ.mjs.map +0 -7
- package/dist/lib/browser/react-surface-GFORPA3A.mjs +0 -772
- package/dist/lib/browser/react-surface-GFORPA3A.mjs.map +0 -7
- package/dist/lib/browser/settings-EBVICEEW.mjs +0 -22
- package/dist/lib/browser/settings-EBVICEEW.mjs.map +0 -7
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugGraph.d.ts +0 -8
- package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts +0 -7
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- package/dist/types/src/components/DebugSettings.d.ts +0 -6
- package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
- package/dist/types/src/components/Wireframe.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -63
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugGraph.tsx +0 -14
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/DebugSettings.tsx +0 -159
- package/src/components/DevtoolsOverviewContainer.tsx +0 -20
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
- /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
- /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
- /package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +0 -0
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { AgentPrompt, WebSearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Routine, Trigger, Operation } from '@dxos/compute';
|
|
9
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
10
|
-
import { DXN, Filter, Key, Obj, Query, Ref, Tag
|
|
11
|
-
import { FunctionTrigger, type TriggerKind, type TriggerType, serializeFunction } from '@dxos/functions';
|
|
10
|
+
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';
|
|
12
11
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import {
|
|
14
|
-
import { Mailbox } from '@dxos/plugin-inbox
|
|
15
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
12
|
+
import { InboxOperation } from '@dxos/plugin-inbox';
|
|
13
|
+
import { Mailbox } from '@dxos/plugin-inbox';
|
|
14
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
16
15
|
import { type Space } from '@dxos/react-client/echo';
|
|
17
16
|
import {
|
|
18
17
|
type ComputeShape,
|
|
@@ -20,24 +19,19 @@ import {
|
|
|
20
19
|
createChat,
|
|
21
20
|
createComputeGraph,
|
|
22
21
|
createConstant,
|
|
22
|
+
createFeed,
|
|
23
23
|
createFunction,
|
|
24
24
|
createGpt,
|
|
25
|
-
createQueue,
|
|
26
25
|
createRandom,
|
|
27
26
|
createSurface,
|
|
28
27
|
createTemplate,
|
|
29
28
|
createText,
|
|
30
29
|
createTrigger,
|
|
31
30
|
} from '@dxos/react-ui-canvas-compute';
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
pointsToRect,
|
|
37
|
-
rectToPoints,
|
|
38
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
39
|
-
import { DataType, createView } from '@dxos/schema';
|
|
40
|
-
import { range } from '@dxos/util';
|
|
31
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
32
|
+
import { ViewModel } from '@dxos/schema';
|
|
33
|
+
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
34
|
+
import { range, trim } from '@dxos/util';
|
|
41
35
|
|
|
42
36
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
43
37
|
|
|
@@ -49,34 +43,41 @@ export enum PresetName {
|
|
|
49
43
|
CHAT_GPT = 'chat-gpt-text',
|
|
50
44
|
// EMAIL_WITH_SUMMARY = 'email-gptSummary-table',
|
|
51
45
|
OBJECT_CHANGE_QUEUE = 'objectChange-queue',
|
|
52
|
-
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
53
46
|
TIMER_TICK_QUEUE = 'timerTick-queue',
|
|
47
|
+
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
54
48
|
DISCORD_MESSAGES = 'discord-messages',
|
|
55
49
|
// KANBAN_QUEUE = 'kanban-queue',
|
|
56
50
|
}
|
|
57
51
|
|
|
58
52
|
export const generator = () => ({
|
|
59
|
-
schemas: [
|
|
53
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
60
54
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
61
55
|
items: [
|
|
62
56
|
[
|
|
63
57
|
PresetName.DXOS_TEAM,
|
|
64
58
|
async (space, n, cb) => {
|
|
65
59
|
const objects = range(n, () => {
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
60
|
+
const org = space.db.add(
|
|
61
|
+
Obj.make(Organization.Organization, {
|
|
62
|
+
name: 'DXOS',
|
|
63
|
+
website: 'https://dxos.org',
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
71
66
|
const doc = space.db.add(
|
|
72
|
-
Markdown.
|
|
67
|
+
Markdown.make({
|
|
73
68
|
name: 'DXOS Research',
|
|
74
69
|
content: 'DXOS builds Composer, an open-source AI-powered malleable application.',
|
|
75
70
|
}),
|
|
76
71
|
);
|
|
77
|
-
|
|
72
|
+
|
|
73
|
+
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
74
|
+
const tagDXN = Obj.getDXN(tag).toString();
|
|
75
|
+
Obj.update(doc, (doc) => {
|
|
76
|
+
Obj.getMeta(doc).tags = [tagDXN];
|
|
77
|
+
});
|
|
78
|
+
|
|
78
79
|
// space.db.add(
|
|
79
|
-
// Relation.make(
|
|
80
|
+
// Relation.make(HasSubject, {
|
|
80
81
|
// [Relation.Source]: doc,
|
|
81
82
|
// [Relation.Target]: org,
|
|
82
83
|
// completedAt: new Date().toISOString(),
|
|
@@ -84,12 +85,26 @@ export const generator = () => ({
|
|
|
84
85
|
// );
|
|
85
86
|
|
|
86
87
|
space.db.add(
|
|
87
|
-
Obj.make(
|
|
88
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDXN] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
89
|
+
);
|
|
90
|
+
space.db.add(
|
|
91
|
+
Obj.make(Person.Person, {
|
|
92
|
+
fullName: 'Josiah',
|
|
93
|
+
organization: Ref.make(org),
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
space.db.add(
|
|
97
|
+
Obj.make(Person.Person, {
|
|
98
|
+
fullName: 'Dima',
|
|
99
|
+
organization: Ref.make(org),
|
|
100
|
+
}),
|
|
101
|
+
);
|
|
102
|
+
space.db.add(
|
|
103
|
+
Obj.make(Person.Person, {
|
|
104
|
+
fullName: 'Mykola',
|
|
105
|
+
organization: Ref.make(org),
|
|
106
|
+
}),
|
|
88
107
|
);
|
|
89
|
-
space.db.add(Obj.make(DataType.Person, { fullName: 'Josiah', organization: Ref.make(org) }));
|
|
90
|
-
space.db.add(Obj.make(DataType.Person, { fullName: 'Dima', organization: Ref.make(org) }));
|
|
91
|
-
space.db.add(Obj.make(DataType.Person, { fullName: 'Mykola', organization: Ref.make(org) }));
|
|
92
|
-
space.db.add(Obj.make(DataType.Person, { fullName: 'Will', organization: Ref.make(org) }));
|
|
93
108
|
|
|
94
109
|
return doc;
|
|
95
110
|
});
|
|
@@ -100,44 +115,34 @@ export const generator = () => ({
|
|
|
100
115
|
[
|
|
101
116
|
PresetName.ORG_RESEARCH_PROJECT,
|
|
102
117
|
async (space, n, cb) => {
|
|
103
|
-
const
|
|
118
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
119
|
+
const mailbox = mailboxes[0];
|
|
120
|
+
invariant(mailbox, 'Mailbox not found');
|
|
121
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
122
|
+
invariant(mailboxFeed, 'Mailbox missing feed reference');
|
|
123
|
+
const feedDXN = Feed.getQueueDxn(mailboxFeed)?.toString();
|
|
124
|
+
invariant(feedDXN, 'Mailbox feed missing DXN');
|
|
104
125
|
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
105
|
-
const
|
|
126
|
+
const tagDXN = Obj.getDXN(tag).toString();
|
|
106
127
|
|
|
107
128
|
const objects = range(n, () => {
|
|
108
|
-
const contactsQuery = Query.select(Filter.type(
|
|
109
|
-
const organizationsQuery = Query.select(Filter.type(
|
|
110
|
-
const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
123
|
-
space.db.add(emailSyncTrigger);
|
|
124
|
-
|
|
125
|
-
const contactExtractionTrigger = Obj.make(FunctionTrigger, {
|
|
126
|
-
enabled: true,
|
|
127
|
-
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
128
|
-
spec: {
|
|
129
|
-
kind: 'queue',
|
|
130
|
-
queue: mailbox.queue.dxn.toString(),
|
|
131
|
-
},
|
|
132
|
-
function: Ref.make(serializeFunction(entityExtraction)),
|
|
133
|
-
input: {
|
|
134
|
-
source: '{{event.item}}',
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
space.db.add(contactExtractionTrigger);
|
|
129
|
+
const contactsQuery = Query.select(Filter.type(Person.Person)).select(Filter.tag(tagDXN));
|
|
130
|
+
const organizationsQuery = Query.select(Filter.type(Organization.Organization)).select(Filter.tag(tagDXN));
|
|
131
|
+
const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(tagDXN));
|
|
132
|
+
|
|
133
|
+
space.db.add(
|
|
134
|
+
Trigger.make({
|
|
135
|
+
enabled: true,
|
|
136
|
+
spec: Trigger.specTimer('* * * * *'), // Every minute.
|
|
137
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
138
|
+
input: {
|
|
139
|
+
mailbox: Ref.make(mailbox),
|
|
140
|
+
},
|
|
141
|
+
}),
|
|
142
|
+
);
|
|
138
143
|
|
|
139
144
|
const researchPrompt = space.db.add(
|
|
140
|
-
|
|
145
|
+
Routine.make({
|
|
141
146
|
name: 'Research',
|
|
142
147
|
description: 'Research organization',
|
|
143
148
|
input: Schema.Struct({
|
|
@@ -147,64 +152,79 @@ export const generator = () => ({
|
|
|
147
152
|
|
|
148
153
|
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
149
154
|
// Remove the mock prompt to do the actual research.
|
|
150
|
-
instructions:
|
|
151
|
-
|
|
152
|
-
|
|
155
|
+
instructions: trim`
|
|
156
|
+
Research the organization provided as input.
|
|
157
|
+
Create a research note for it at the end.
|
|
158
|
+
NOTE: Do mocked reseach (set mockSearch to true).
|
|
159
|
+
`,
|
|
160
|
+
blueprints: [Ref.make(WebSearchBlueprint.make())],
|
|
153
161
|
}),
|
|
154
162
|
);
|
|
155
163
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
space.db.add(
|
|
165
|
+
Trigger.make({
|
|
166
|
+
enabled: true,
|
|
167
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
168
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
169
|
+
input: {
|
|
170
|
+
prompt: Ref.make(researchPrompt),
|
|
171
|
+
input: '{{event.subject}}',
|
|
162
172
|
},
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
input: {
|
|
166
|
-
prompt: Ref.make(researchPrompt),
|
|
167
|
-
input: '{{event.subject}}',
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
space.db.add(researchTrigger);
|
|
173
|
+
}),
|
|
174
|
+
);
|
|
171
175
|
|
|
172
|
-
const mailboxView =
|
|
173
|
-
name: 'Mailbox',
|
|
176
|
+
const mailboxView = ViewModel.make({
|
|
174
177
|
query: Query.select(
|
|
175
|
-
Filter.type(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
+
Filter.type(Message.Message, {
|
|
179
|
+
properties: { labels: Filter.contains('investor') },
|
|
180
|
+
}),
|
|
181
|
+
).from({
|
|
182
|
+
feeds: [feedDXN],
|
|
178
183
|
}),
|
|
179
|
-
jsonSchema:
|
|
180
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
184
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
181
185
|
});
|
|
182
|
-
const contactsView =
|
|
183
|
-
name: 'Contacts',
|
|
186
|
+
const contactsView = ViewModel.make({
|
|
184
187
|
query: contactsQuery,
|
|
185
|
-
jsonSchema:
|
|
186
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
188
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
187
189
|
});
|
|
188
|
-
const organizationsView =
|
|
189
|
-
name: 'Organizations',
|
|
190
|
+
const organizationsView = ViewModel.make({
|
|
190
191
|
query: organizationsQuery,
|
|
191
|
-
jsonSchema:
|
|
192
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
192
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
193
193
|
});
|
|
194
|
-
const notesView =
|
|
195
|
-
name: 'Notes',
|
|
194
|
+
const notesView = ViewModel.make({
|
|
196
195
|
query: notesQuery,
|
|
197
|
-
jsonSchema:
|
|
198
|
-
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
196
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
199
197
|
});
|
|
200
198
|
|
|
201
199
|
return space.db.add(
|
|
202
|
-
|
|
200
|
+
Pipeline.make({
|
|
203
201
|
name: 'Investor Research',
|
|
204
|
-
|
|
202
|
+
columns: [
|
|
203
|
+
{
|
|
204
|
+
name: 'Mailbox',
|
|
205
|
+
view: Ref.make(mailboxView),
|
|
206
|
+
order: [],
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: 'Contacts',
|
|
210
|
+
view: Ref.make(contactsView),
|
|
211
|
+
order: [],
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'Organizations',
|
|
215
|
+
view: Ref.make(organizationsView),
|
|
216
|
+
order: [],
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
name: 'Notes',
|
|
220
|
+
view: Ref.make(notesView),
|
|
221
|
+
order: [],
|
|
222
|
+
},
|
|
223
|
+
],
|
|
205
224
|
}),
|
|
206
225
|
);
|
|
207
226
|
});
|
|
227
|
+
|
|
208
228
|
cb?.(objects.flat());
|
|
209
229
|
return objects.flat();
|
|
210
230
|
},
|
|
@@ -215,7 +235,7 @@ export const generator = () => ({
|
|
|
215
235
|
const objects = range(n, () => {
|
|
216
236
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
217
237
|
|
|
218
|
-
let functionTrigger:
|
|
238
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
219
239
|
canvasModel.builder.call((builder) => {
|
|
220
240
|
const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));
|
|
221
241
|
const triggerShape = createTrigger({
|
|
@@ -229,10 +249,24 @@ export const generator = () => ({
|
|
|
229
249
|
const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
230
250
|
|
|
231
251
|
builder
|
|
232
|
-
.createEdge({
|
|
252
|
+
.createEdge({
|
|
253
|
+
source: trigger.id,
|
|
254
|
+
target: gpt.id,
|
|
255
|
+
input: 'prompt',
|
|
256
|
+
output: 'bodyText',
|
|
257
|
+
})
|
|
233
258
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
234
|
-
.createEdge({
|
|
235
|
-
|
|
259
|
+
.createEdge({
|
|
260
|
+
source: queueId.id,
|
|
261
|
+
target: append.id,
|
|
262
|
+
input: 'id',
|
|
263
|
+
})
|
|
264
|
+
.createEdge({
|
|
265
|
+
source: gpt.id,
|
|
266
|
+
target: append.id,
|
|
267
|
+
output: 'messages',
|
|
268
|
+
input: 'items',
|
|
269
|
+
});
|
|
236
270
|
|
|
237
271
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
238
272
|
});
|
|
@@ -257,7 +291,7 @@ export const generator = () => ({
|
|
|
257
291
|
'subscription',
|
|
258
292
|
(triggerSpec) =>
|
|
259
293
|
(triggerSpec.query = {
|
|
260
|
-
ast: Query.select(Filter.typename('dxos.
|
|
294
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
261
295
|
}),
|
|
262
296
|
'type',
|
|
263
297
|
);
|
|
@@ -342,7 +376,7 @@ export const generator = () => ({
|
|
|
342
376
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
343
377
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
344
378
|
// templateComputeNode.value = templateContent.join('\n');
|
|
345
|
-
// templateComputeNode.inputSchema =
|
|
379
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
346
380
|
|
|
347
381
|
// attachTrigger(functionTrigger, computeModel);
|
|
348
382
|
|
|
@@ -370,8 +404,17 @@ export const generator = () => ({
|
|
|
370
404
|
builder
|
|
371
405
|
.createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })
|
|
372
406
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
373
|
-
.createEdge({
|
|
374
|
-
|
|
407
|
+
.createEdge({
|
|
408
|
+
source: queueId.id,
|
|
409
|
+
target: append.id,
|
|
410
|
+
input: 'id',
|
|
411
|
+
})
|
|
412
|
+
.createEdge({
|
|
413
|
+
source: gpt.id,
|
|
414
|
+
target: append.id,
|
|
415
|
+
output: 'messages',
|
|
416
|
+
input: 'items',
|
|
417
|
+
});
|
|
375
418
|
});
|
|
376
419
|
|
|
377
420
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -467,7 +510,7 @@ export const generator = () => ({
|
|
|
467
510
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
468
511
|
// templateComputeNode.value = templateContent.join('\n');
|
|
469
512
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
470
|
-
// templateComputeNode.inputSchema =
|
|
513
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
471
514
|
|
|
472
515
|
// attachTrigger(functionTrigger, computeModel);
|
|
473
516
|
|
|
@@ -495,9 +538,21 @@ export const generator = () => ({
|
|
|
495
538
|
const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));
|
|
496
539
|
|
|
497
540
|
builder
|
|
498
|
-
.createEdge({
|
|
499
|
-
|
|
500
|
-
|
|
541
|
+
.createEdge({
|
|
542
|
+
source: sourceCurrency.id,
|
|
543
|
+
target: converter.id,
|
|
544
|
+
input: 'from',
|
|
545
|
+
})
|
|
546
|
+
.createEdge({
|
|
547
|
+
source: targetCurrency.id,
|
|
548
|
+
target: converter.id,
|
|
549
|
+
input: 'to',
|
|
550
|
+
})
|
|
551
|
+
.createEdge({
|
|
552
|
+
source: converter.id,
|
|
553
|
+
target: view.id,
|
|
554
|
+
output: 'rate',
|
|
555
|
+
});
|
|
501
556
|
});
|
|
502
557
|
|
|
503
558
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -515,7 +570,7 @@ export const generator = () => ({
|
|
|
515
570
|
const objects = range(n, () => {
|
|
516
571
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
517
572
|
|
|
518
|
-
let functionTrigger:
|
|
573
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
519
574
|
canvasModel.builder.call((builder) => {
|
|
520
575
|
const triggerShape = createTrigger({
|
|
521
576
|
spaceId: space.id,
|
|
@@ -525,7 +580,10 @@ export const generator = () => ({
|
|
|
525
580
|
const trigger = canvasModel.createNode(triggerShape);
|
|
526
581
|
// DXOS dev-null channel.
|
|
527
582
|
const channelId = canvasModel.createNode(
|
|
528
|
-
createConstant({
|
|
583
|
+
createConstant({
|
|
584
|
+
value: '1088569858767212554',
|
|
585
|
+
...position({ x: -10, y: 0 }),
|
|
586
|
+
}),
|
|
529
587
|
);
|
|
530
588
|
const queueId = canvasModel.createNode(
|
|
531
589
|
createConstant({
|
|
@@ -535,14 +593,34 @@ export const generator = () => ({
|
|
|
535
593
|
);
|
|
536
594
|
const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));
|
|
537
595
|
const view = canvasModel.createNode(createText(position({ x: 12, y: 0 })));
|
|
538
|
-
const queue = canvasModel.createNode(
|
|
596
|
+
const queue = canvasModel.createNode(createFeed(position({ x: 0, y: 12 })));
|
|
539
597
|
|
|
540
598
|
builder
|
|
541
|
-
.createEdge({
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
599
|
+
.createEdge({
|
|
600
|
+
source: trigger.id,
|
|
601
|
+
target: converter.id,
|
|
602
|
+
input: 'tick',
|
|
603
|
+
})
|
|
604
|
+
.createEdge({
|
|
605
|
+
source: channelId.id,
|
|
606
|
+
target: converter.id,
|
|
607
|
+
input: 'channelId',
|
|
608
|
+
})
|
|
609
|
+
.createEdge({
|
|
610
|
+
source: queueId.id,
|
|
611
|
+
target: converter.id,
|
|
612
|
+
input: 'queueId',
|
|
613
|
+
})
|
|
614
|
+
.createEdge({
|
|
615
|
+
source: converter.id,
|
|
616
|
+
target: view.id,
|
|
617
|
+
output: 'newMessages',
|
|
618
|
+
})
|
|
619
|
+
.createEdge({
|
|
620
|
+
source: queueId.id,
|
|
621
|
+
target: queue.id,
|
|
622
|
+
input: 'input',
|
|
623
|
+
});
|
|
546
624
|
|
|
547
625
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
548
626
|
});
|
|
@@ -609,10 +687,10 @@ export const generator = () => ({
|
|
|
609
687
|
] as [PresetName, ObjectGenerator<any>][],
|
|
610
688
|
});
|
|
611
689
|
|
|
612
|
-
const createQueueSinkPreset = <SpecType extends
|
|
690
|
+
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
613
691
|
space: Space,
|
|
614
692
|
triggerKind: SpecType,
|
|
615
|
-
initSpec: (spec: Extract<
|
|
693
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
616
694
|
triggerOutputName: string,
|
|
617
695
|
) => {
|
|
618
696
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -624,7 +702,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
624
702
|
}),
|
|
625
703
|
);
|
|
626
704
|
|
|
627
|
-
let functionTrigger:
|
|
705
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
628
706
|
canvasModel.builder.call((builder) => {
|
|
629
707
|
const triggerShape = createTrigger({
|
|
630
708
|
spaceId: space.id,
|
|
@@ -645,7 +723,12 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
645
723
|
builder
|
|
646
724
|
.createEdge({ source: queueId.id, target: append.id, input: 'id' })
|
|
647
725
|
.createEdge({ source: template.id, target: append.id, input: 'items' })
|
|
648
|
-
.createEdge({
|
|
726
|
+
.createEdge({
|
|
727
|
+
source: trigger.id,
|
|
728
|
+
target: template.id,
|
|
729
|
+
output: triggerOutputName,
|
|
730
|
+
input: 'type',
|
|
731
|
+
})
|
|
649
732
|
.createEdge({
|
|
650
733
|
source: random.id,
|
|
651
734
|
target: template.id,
|
|
@@ -655,15 +738,20 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
655
738
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
656
739
|
const triggerSpec = functionTrigger.spec;
|
|
657
740
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
658
|
-
|
|
741
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
742
|
+
initSpec(functionTrigger.spec as any);
|
|
743
|
+
});
|
|
659
744
|
});
|
|
660
745
|
|
|
661
746
|
const computeModel = createComputeGraph(canvasModel);
|
|
662
747
|
|
|
663
748
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
664
749
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
750
|
+
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
665
751
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
666
|
-
templateComputeNode.inputSchema =
|
|
752
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
753
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
754
|
+
);
|
|
667
755
|
attachTrigger(functionTrigger, computeModel);
|
|
668
756
|
|
|
669
757
|
return { canvasModel, computeModel };
|
|
@@ -671,7 +759,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
671
759
|
|
|
672
760
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
673
761
|
return space.db.add(
|
|
674
|
-
Obj.make(
|
|
762
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
675
763
|
name,
|
|
676
764
|
computeGraph: Ref.make(compute.root),
|
|
677
765
|
layout: canvas.graph,
|
|
@@ -691,7 +779,7 @@ const setupQueue = (
|
|
|
691
779
|
}),
|
|
692
780
|
);
|
|
693
781
|
const queue = canvasModel.createNode(
|
|
694
|
-
|
|
782
|
+
createFeed(
|
|
695
783
|
args?.queuePosition ? rawPosition(args.queuePosition) : position({ x: -3, y: 3, width: 14, height: 10 }),
|
|
696
784
|
),
|
|
697
785
|
);
|
|
@@ -699,17 +787,27 @@ const setupQueue = (
|
|
|
699
787
|
return { queue, queueId };
|
|
700
788
|
};
|
|
701
789
|
|
|
702
|
-
const attachTrigger = (functionTrigger:
|
|
790
|
+
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
703
791
|
invariant(functionTrigger);
|
|
704
|
-
functionTrigger.function = Ref.make(computeModel.root);
|
|
705
792
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
706
|
-
functionTrigger
|
|
793
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
794
|
+
functionTrigger.function = Ref.make(computeModel.root);
|
|
795
|
+
functionTrigger.inputNodeId = inputNode.id;
|
|
796
|
+
});
|
|
707
797
|
};
|
|
708
798
|
|
|
709
|
-
type RawPositionInput = {
|
|
799
|
+
type RawPositionInput = {
|
|
800
|
+
centerX: number;
|
|
801
|
+
centerY: number;
|
|
802
|
+
width: number;
|
|
803
|
+
height: number;
|
|
804
|
+
};
|
|
710
805
|
|
|
711
806
|
const rawPosition = (args: RawPositionInput) => {
|
|
712
|
-
return {
|
|
807
|
+
return {
|
|
808
|
+
center: { x: args.centerX, y: args.centerY },
|
|
809
|
+
size: { width: args.width, height: args.height },
|
|
810
|
+
};
|
|
713
811
|
};
|
|
714
812
|
|
|
715
813
|
const position = (rect: { x: number; y: number; width?: number; height?: number }) => {
|
|
@@ -717,7 +815,10 @@ const position = (rect: { x: number; y: number; width?: number; height?: number
|
|
|
717
815
|
const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });
|
|
718
816
|
const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);
|
|
719
817
|
if (width && height) {
|
|
720
|
-
return {
|
|
818
|
+
return {
|
|
819
|
+
center: { x, y },
|
|
820
|
+
size: width && height ? { width, height } : undefined,
|
|
821
|
+
};
|
|
721
822
|
} else {
|
|
722
823
|
return { center: { x, y } };
|
|
723
824
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
9
|
-
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
7
|
+
export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));
|
|
10
8
|
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './DebugStatus';
|
|
14
|
-
export * from './Wireframe';
|
|
9
|
+
export * from './SchemaTable';
|
|
10
|
+
export * from './SpaceGenerator';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Tree } from '@dxos/devtools';
|
|
8
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
9
|
+
|
|
10
|
+
export type DebugGraphProps = { graph: Graph.Graph; root: string };
|
|
11
|
+
|
|
12
|
+
export const DebugGraph = ({ graph, root }: DebugGraphProps) => {
|
|
13
|
+
return <Tree data={Graph.toJSON(graph, root)} />;
|
|
14
|
+
};
|