@dxos/plugin-debug 0.8.4-main.c1de068 → 0.8.4-main.c351d160a8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs +16 -0
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +7 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs +35 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs.map +7 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs +174 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs.map +7 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs +45 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs.map +7 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs +125 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +7 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs +20 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-AG3XGNMV.mjs → SpaceGenerator-Q2GH6S6D.mjs} +577 -382
- package/dist/lib/browser/SpaceGenerator-Q2GH6S6D.mjs.map +7 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs +53 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs +593 -0
- package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AJA6RYN3.mjs → chunk-Q37TZWW5.mjs} +13 -3
- package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZOM2FBHQ.mjs +20 -0
- package/dist/lib/browser/chunk-ZOM2FBHQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +43 -41
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-5ENRJEB2.mjs +17 -0
- package/dist/lib/browser/react-context-5ENRJEB2.mjs.map +7 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs +427 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs.map +7 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs +32 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +7 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -8
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
- package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +5 -5
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/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 +4 -4
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -9
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +2 -2
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +10 -0
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts +3 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts +2 -2
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +2 -2
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/index.d.ts +3 -0
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +5 -1
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +40 -35
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +76 -67
- package/src/DebugPlugin.tsx +27 -32
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +419 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +4 -6
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +20 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +413 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +31 -39
- package/src/components/SpaceGenerator/draw-util.ts +5 -5
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +339 -53
- package/src/components/index.ts +2 -10
- package/src/containers/DebugGraph/DebugGraph.tsx +13 -0
- package/src/containers/DebugGraph/index.ts +7 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -0
- package/src/containers/DebugObjectPanel/index.ts +7 -0
- package/src/containers/DebugSettings/DebugSettings.tsx +201 -0
- package/src/containers/DebugSettings/index.ts +7 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
- package/src/{components → containers/DebugStatus}/DebugStatus.tsx +2 -2
- package/src/containers/DebugStatus/index.ts +7 -0
- package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +2 -4
- package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +127 -0
- package/src/containers/SpaceGenerator/index.ts +7 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +7 -7
- package/src/containers/Wireframe/index.ts +7 -0
- package/src/containers/index.ts +14 -0
- package/src/meta.ts +8 -7
- package/src/translations.ts +5 -1
- package/src/types.ts +10 -3
- package/dist/lib/browser/DebugApp-ZDL4CPY5.mjs +0 -228
- package/dist/lib/browser/DebugApp-ZDL4CPY5.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-AG3XGNMV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-SQXFD2BL.mjs +0 -597
- package/dist/lib/browser/app-graph-builder-SQXFD2BL.mjs.map +0 -7
- package/dist/lib/browser/chunk-5XPIRNQS.mjs +0 -18
- package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
- package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
- package/dist/lib/browser/react-context-NVAGLAJD.mjs +0 -16
- package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GD2OWCA.mjs +0 -768
- package/dist/lib/browser/react-surface-3GD2OWCA.mjs.map +0 -7
- package/dist/lib/browser/settings-LSSWLM5I.mjs +0 -22
- package/dist/lib/browser/settings-LSSWLM5I.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
- package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
- package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/index.d.ts +0 -3
- package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- package/dist/types/src/components/DebugSettings.d.ts +0 -6
- package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -6
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
- package/dist/types/src/components/Wireframe.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -457
- package/src/capabilities/react-context.tsx +0 -16
- package/src/capabilities/react-surface.tsx +0 -397
- package/src/capabilities/settings.ts +0 -19
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugApp/DebugApp.tsx +0 -84
- package/src/components/DebugApp/Tree.tsx +0 -103
- package/src/components/DebugApp/index.ts +0 -7
- package/src/components/DebugObjectPanel.tsx +0 -35
- package/src/components/DebugSettings.tsx +0 -151
- 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
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// TODO(burdon): workerize-loader dep.
|
|
6
|
-
import {
|
|
6
|
+
import { type Edge, Graph, type PlainObject } from '@antv/graphlib';
|
|
7
7
|
import {
|
|
8
|
-
type Layout,
|
|
9
8
|
D3ForceLayout,
|
|
10
9
|
type D3ForceLayoutOptions,
|
|
11
10
|
GridLayout,
|
|
12
11
|
type GridLayoutOptions,
|
|
12
|
+
type Layout,
|
|
13
13
|
RadialLayout,
|
|
14
14
|
type RadialLayoutOptions,
|
|
15
15
|
} from '@antv/layout';
|
|
16
|
-
import {
|
|
16
|
+
import { type Editor, type SerializedStore, type TLRecord, createBindingId, createShapeId } from '@tldraw/tldraw';
|
|
17
17
|
|
|
18
18
|
import { faker } from '@dxos/random';
|
|
19
|
-
import {
|
|
19
|
+
import { isTruthy, range } from '@dxos/util';
|
|
20
20
|
|
|
21
21
|
// TODO(burdon): Graph layout:
|
|
22
22
|
// - https://www.npmjs.com/package/@antv/layout (uses d3)
|
|
@@ -67,7 +67,7 @@ export const generateGraph = (): Graph<PlainObject, PlainObject> => {
|
|
|
67
67
|
}
|
|
68
68
|
return target;
|
|
69
69
|
})
|
|
70
|
-
.filter(
|
|
70
|
+
.filter(isTruthy);
|
|
71
71
|
|
|
72
72
|
for (const target of targets) {
|
|
73
73
|
traverse(target);
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { AgentFunctions, EntityExtractionFunctions, ResearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Prompt } from '@dxos/blueprints';
|
|
7
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
8
|
-
import { DXN, Key, Obj, Ref,
|
|
9
|
-
import {
|
|
10
|
+
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';
|
|
11
|
+
import { Trigger, serializeFunction } from '@dxos/functions';
|
|
10
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { GmailFunctions } from '@dxos/plugin-inbox';
|
|
14
|
+
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
15
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
16
|
import { type Space } from '@dxos/react-client/echo';
|
|
12
17
|
import {
|
|
13
18
|
type ComputeShape,
|
|
@@ -18,51 +23,248 @@ import {
|
|
|
18
23
|
createFunction,
|
|
19
24
|
createGpt,
|
|
20
25
|
createQueue,
|
|
21
|
-
createSurface,
|
|
22
26
|
createRandom,
|
|
27
|
+
createSurface,
|
|
23
28
|
createTemplate,
|
|
24
29
|
createText,
|
|
25
30
|
createTrigger,
|
|
26
31
|
} from '@dxos/react-ui-canvas-compute';
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
pointsToRect,
|
|
32
|
-
rectToPoints,
|
|
33
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
34
|
-
import { range } from '@dxos/util';
|
|
32
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
33
|
+
import { ViewModel } from '@dxos/schema';
|
|
34
|
+
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
35
|
+
import { range, trim } from '@dxos/util';
|
|
35
36
|
|
|
36
37
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
37
38
|
|
|
38
39
|
export enum PresetName {
|
|
40
|
+
DXOS_TEAM = 'dxos-team',
|
|
41
|
+
ORG_RESEARCH_PROJECT = 'org-research-project',
|
|
39
42
|
// EMAIL_TABLE = 'email-table',
|
|
40
43
|
GPT_QUEUE = 'webhook-gpt-queue',
|
|
41
44
|
CHAT_GPT = 'chat-gpt-text',
|
|
42
45
|
// EMAIL_WITH_SUMMARY = 'email-gptSummary-table',
|
|
43
46
|
OBJECT_CHANGE_QUEUE = 'objectChange-queue',
|
|
44
|
-
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
45
47
|
TIMER_TICK_QUEUE = 'timerTick-queue',
|
|
48
|
+
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
46
49
|
DISCORD_MESSAGES = 'discord-messages',
|
|
47
50
|
// KANBAN_QUEUE = 'kanban-queue',
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export const generator = () => ({
|
|
51
|
-
schemas: [
|
|
54
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
52
55
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
53
56
|
items: [
|
|
57
|
+
[
|
|
58
|
+
PresetName.DXOS_TEAM,
|
|
59
|
+
async (space, n, cb) => {
|
|
60
|
+
const objects = range(n, () => {
|
|
61
|
+
const org = space.db.add(
|
|
62
|
+
Obj.make(Organization.Organization, {
|
|
63
|
+
name: 'DXOS',
|
|
64
|
+
website: 'https://dxos.org',
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
const doc = space.db.add(
|
|
68
|
+
Markdown.make({
|
|
69
|
+
name: 'DXOS Research',
|
|
70
|
+
content: 'DXOS builds Composer, an open-source AI-powered malleable application.',
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
75
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
76
|
+
Obj.change(doc, (d) => {
|
|
77
|
+
Obj.getMeta(d).tags = [tagDxn];
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// space.db.add(
|
|
81
|
+
// Relation.make(HasSubject, {
|
|
82
|
+
// [Relation.Source]: doc,
|
|
83
|
+
// [Relation.Target]: org,
|
|
84
|
+
// completedAt: new Date().toISOString(),
|
|
85
|
+
// }),
|
|
86
|
+
// );
|
|
87
|
+
|
|
88
|
+
space.db.add(
|
|
89
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
90
|
+
);
|
|
91
|
+
space.db.add(
|
|
92
|
+
Obj.make(Person.Person, {
|
|
93
|
+
fullName: 'Josiah',
|
|
94
|
+
organization: Ref.make(org),
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
space.db.add(
|
|
98
|
+
Obj.make(Person.Person, {
|
|
99
|
+
fullName: 'Dima',
|
|
100
|
+
organization: Ref.make(org),
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
103
|
+
space.db.add(
|
|
104
|
+
Obj.make(Person.Person, {
|
|
105
|
+
fullName: 'Mykola',
|
|
106
|
+
organization: Ref.make(org),
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return doc;
|
|
111
|
+
});
|
|
112
|
+
cb?.(objects);
|
|
113
|
+
return objects;
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
PresetName.ORG_RESEARCH_PROJECT,
|
|
118
|
+
async (space, n, cb) => {
|
|
119
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
120
|
+
const mailbox = mailboxes[0];
|
|
121
|
+
invariant(mailbox, 'Mailbox not found');
|
|
122
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
123
|
+
invariant(mailboxFeed, 'Mailbox missing feed reference');
|
|
124
|
+
const queueDxn = Feed.getQueueDxn(mailboxFeed)?.toString();
|
|
125
|
+
invariant(queueDxn, 'Mailbox feed missing queue DXN key');
|
|
126
|
+
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
127
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
128
|
+
|
|
129
|
+
const objects = range(n, () => {
|
|
130
|
+
const contactsQuery = Query.select(Filter.type(Person.Person)).select(Filter.tag(tagDxn));
|
|
131
|
+
const organizationsQuery = Query.select(Filter.type(Organization.Organization)).select(Filter.tag(tagDxn));
|
|
132
|
+
const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(tagDxn));
|
|
133
|
+
|
|
134
|
+
space.db.add(
|
|
135
|
+
Trigger.make({
|
|
136
|
+
enabled: true,
|
|
137
|
+
spec: {
|
|
138
|
+
kind: 'timer',
|
|
139
|
+
cron: '* * * * *', // Every minute.
|
|
140
|
+
},
|
|
141
|
+
function: Ref.make(serializeFunction(GmailFunctions.Sync)),
|
|
142
|
+
input: {
|
|
143
|
+
mailbox: Ref.make(mailbox),
|
|
144
|
+
},
|
|
145
|
+
}),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
space.db.add(
|
|
149
|
+
Trigger.make({
|
|
150
|
+
enabled: true,
|
|
151
|
+
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
152
|
+
spec: {
|
|
153
|
+
kind: 'queue',
|
|
154
|
+
queue: queueDxn,
|
|
155
|
+
},
|
|
156
|
+
function: Ref.make(serializeFunction(EntityExtractionFunctions.Extract)),
|
|
157
|
+
input: {
|
|
158
|
+
source: '{{event.item}}',
|
|
159
|
+
},
|
|
160
|
+
}),
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const researchPrompt = space.db.add(
|
|
164
|
+
Prompt.make({
|
|
165
|
+
name: 'Research',
|
|
166
|
+
description: 'Research organization',
|
|
167
|
+
input: Schema.Struct({
|
|
168
|
+
org: Schema.Any,
|
|
169
|
+
}),
|
|
170
|
+
output: Schema.Any,
|
|
171
|
+
|
|
172
|
+
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
173
|
+
// Remove the mock prompt to do the actual research.
|
|
174
|
+
instructions: trim`
|
|
175
|
+
Research the organization provided as input.
|
|
176
|
+
Create a research note for it at the end.
|
|
177
|
+
NOTE: Do mocked reseach (set mockSearch to true).
|
|
178
|
+
`,
|
|
179
|
+
blueprints: [Ref.make(ResearchBlueprint.make())],
|
|
180
|
+
}),
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
space.db.add(
|
|
184
|
+
Trigger.make({
|
|
185
|
+
enabled: true,
|
|
186
|
+
spec: {
|
|
187
|
+
kind: 'subscription',
|
|
188
|
+
query: {
|
|
189
|
+
ast: organizationsQuery.ast,
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
function: Ref.make(serializeFunction(AgentFunctions.Prompt)),
|
|
193
|
+
input: {
|
|
194
|
+
prompt: Ref.make(researchPrompt),
|
|
195
|
+
input: '{{event.subject}}',
|
|
196
|
+
},
|
|
197
|
+
}),
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
const mailboxView = ViewModel.make({
|
|
201
|
+
query: Query.select(
|
|
202
|
+
Filter.type(Message.Message, {
|
|
203
|
+
properties: { labels: Filter.contains('investor') },
|
|
204
|
+
}),
|
|
205
|
+
).from({
|
|
206
|
+
queues: [queueDxn],
|
|
207
|
+
}),
|
|
208
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
209
|
+
});
|
|
210
|
+
const contactsView = ViewModel.make({
|
|
211
|
+
query: contactsQuery,
|
|
212
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
213
|
+
});
|
|
214
|
+
const organizationsView = ViewModel.make({
|
|
215
|
+
query: organizationsQuery,
|
|
216
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
217
|
+
});
|
|
218
|
+
const notesView = ViewModel.make({
|
|
219
|
+
query: notesQuery,
|
|
220
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
return space.db.add(
|
|
224
|
+
Pipeline.make({
|
|
225
|
+
name: 'Investor Research',
|
|
226
|
+
columns: [
|
|
227
|
+
{
|
|
228
|
+
name: 'Mailbox',
|
|
229
|
+
view: Ref.make(mailboxView),
|
|
230
|
+
order: [],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
name: 'Contacts',
|
|
234
|
+
view: Ref.make(contactsView),
|
|
235
|
+
order: [],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'Organizations',
|
|
239
|
+
view: Ref.make(organizationsView),
|
|
240
|
+
order: [],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
name: 'Notes',
|
|
244
|
+
view: Ref.make(notesView),
|
|
245
|
+
order: [],
|
|
246
|
+
},
|
|
247
|
+
],
|
|
248
|
+
}),
|
|
249
|
+
);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
cb?.(objects.flat());
|
|
253
|
+
return objects.flat();
|
|
254
|
+
},
|
|
255
|
+
],
|
|
54
256
|
[
|
|
55
257
|
PresetName.GPT_QUEUE,
|
|
56
258
|
async (space, n, cb) => {
|
|
57
259
|
const objects = range(n, () => {
|
|
58
260
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
59
261
|
|
|
60
|
-
let functionTrigger:
|
|
262
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
61
263
|
canvasModel.builder.call((builder) => {
|
|
62
264
|
const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));
|
|
63
265
|
const triggerShape = createTrigger({
|
|
64
266
|
spaceId: space.id,
|
|
65
|
-
triggerKind:
|
|
267
|
+
triggerKind: 'webhook',
|
|
66
268
|
...position({ x: -18, y: -2 }),
|
|
67
269
|
});
|
|
68
270
|
const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -71,10 +273,24 @@ export const generator = () => ({
|
|
|
71
273
|
const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
72
274
|
|
|
73
275
|
builder
|
|
74
|
-
.createEdge({
|
|
276
|
+
.createEdge({
|
|
277
|
+
source: trigger.id,
|
|
278
|
+
target: gpt.id,
|
|
279
|
+
input: 'prompt',
|
|
280
|
+
output: 'bodyText',
|
|
281
|
+
})
|
|
75
282
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
76
|
-
.createEdge({
|
|
77
|
-
|
|
283
|
+
.createEdge({
|
|
284
|
+
source: queueId.id,
|
|
285
|
+
target: append.id,
|
|
286
|
+
input: 'id',
|
|
287
|
+
})
|
|
288
|
+
.createEdge({
|
|
289
|
+
source: gpt.id,
|
|
290
|
+
target: append.id,
|
|
291
|
+
output: 'messages',
|
|
292
|
+
input: 'items',
|
|
293
|
+
});
|
|
78
294
|
|
|
79
295
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
80
296
|
});
|
|
@@ -96,8 +312,11 @@ export const generator = () => ({
|
|
|
96
312
|
const objects = range(n, () => {
|
|
97
313
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
98
314
|
space,
|
|
99
|
-
|
|
100
|
-
(triggerSpec) =>
|
|
315
|
+
'subscription',
|
|
316
|
+
(triggerSpec) =>
|
|
317
|
+
(triggerSpec.query = {
|
|
318
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
319
|
+
}),
|
|
101
320
|
'type',
|
|
102
321
|
);
|
|
103
322
|
return addToSpace(PresetName.OBJECT_CHANGE_QUEUE, space, canvasModel, computeModel);
|
|
@@ -113,7 +332,7 @@ export const generator = () => ({
|
|
|
113
332
|
const objects = range(n, () => {
|
|
114
333
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
115
334
|
space,
|
|
116
|
-
|
|
335
|
+
'timer',
|
|
117
336
|
(triggerSpec) => (triggerSpec.cron = '*/5 * * * * *'),
|
|
118
337
|
'result',
|
|
119
338
|
);
|
|
@@ -147,7 +366,7 @@ export const generator = () => ({
|
|
|
147
366
|
// canvasModel.builder.call((builder) => {
|
|
148
367
|
// const triggerShape = createTrigger({
|
|
149
368
|
// spaceId: space.id,
|
|
150
|
-
// triggerKind:
|
|
369
|
+
// triggerKind: 'email',
|
|
151
370
|
// ...position({ x: -18, y: -2 }),
|
|
152
371
|
// });
|
|
153
372
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -181,7 +400,7 @@ export const generator = () => ({
|
|
|
181
400
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
182
401
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
183
402
|
// templateComputeNode.value = templateContent.join('\n');
|
|
184
|
-
// templateComputeNode.inputSchema =
|
|
403
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
185
404
|
|
|
186
405
|
// attachTrigger(functionTrigger, computeModel);
|
|
187
406
|
|
|
@@ -209,8 +428,17 @@ export const generator = () => ({
|
|
|
209
428
|
builder
|
|
210
429
|
.createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })
|
|
211
430
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
212
|
-
.createEdge({
|
|
213
|
-
|
|
431
|
+
.createEdge({
|
|
432
|
+
source: queueId.id,
|
|
433
|
+
target: append.id,
|
|
434
|
+
input: 'id',
|
|
435
|
+
})
|
|
436
|
+
.createEdge({
|
|
437
|
+
source: gpt.id,
|
|
438
|
+
target: append.id,
|
|
439
|
+
output: 'messages',
|
|
440
|
+
input: 'items',
|
|
441
|
+
});
|
|
214
442
|
});
|
|
215
443
|
|
|
216
444
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -254,7 +482,7 @@ export const generator = () => ({
|
|
|
254
482
|
// );
|
|
255
483
|
// const triggerShape = createTrigger({
|
|
256
484
|
// spaceId: space.id,
|
|
257
|
-
// triggerKind:
|
|
485
|
+
// triggerKind: 'email',
|
|
258
486
|
// ...rawPosition({ centerX: -736, centerY: -384, width: 182, height: 192 }),
|
|
259
487
|
// });
|
|
260
488
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -306,7 +534,7 @@ export const generator = () => ({
|
|
|
306
534
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
307
535
|
// templateComputeNode.value = templateContent.join('\n');
|
|
308
536
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
309
|
-
// templateComputeNode.inputSchema =
|
|
537
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
310
538
|
|
|
311
539
|
// attachTrigger(functionTrigger, computeModel);
|
|
312
540
|
|
|
@@ -334,9 +562,21 @@ export const generator = () => ({
|
|
|
334
562
|
const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));
|
|
335
563
|
|
|
336
564
|
builder
|
|
337
|
-
.createEdge({
|
|
338
|
-
|
|
339
|
-
|
|
565
|
+
.createEdge({
|
|
566
|
+
source: sourceCurrency.id,
|
|
567
|
+
target: converter.id,
|
|
568
|
+
input: 'from',
|
|
569
|
+
})
|
|
570
|
+
.createEdge({
|
|
571
|
+
source: targetCurrency.id,
|
|
572
|
+
target: converter.id,
|
|
573
|
+
input: 'to',
|
|
574
|
+
})
|
|
575
|
+
.createEdge({
|
|
576
|
+
source: converter.id,
|
|
577
|
+
target: view.id,
|
|
578
|
+
output: 'rate',
|
|
579
|
+
});
|
|
340
580
|
});
|
|
341
581
|
|
|
342
582
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -354,17 +594,20 @@ export const generator = () => ({
|
|
|
354
594
|
const objects = range(n, () => {
|
|
355
595
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
356
596
|
|
|
357
|
-
let functionTrigger:
|
|
597
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
358
598
|
canvasModel.builder.call((builder) => {
|
|
359
599
|
const triggerShape = createTrigger({
|
|
360
600
|
spaceId: space.id,
|
|
361
|
-
triggerKind:
|
|
601
|
+
triggerKind: 'timer',
|
|
362
602
|
...position({ x: -10, y: -5 }),
|
|
363
603
|
});
|
|
364
604
|
const trigger = canvasModel.createNode(triggerShape);
|
|
365
605
|
// DXOS dev-null channel.
|
|
366
606
|
const channelId = canvasModel.createNode(
|
|
367
|
-
createConstant({
|
|
607
|
+
createConstant({
|
|
608
|
+
value: '1088569858767212554',
|
|
609
|
+
...position({ x: -10, y: 0 }),
|
|
610
|
+
}),
|
|
368
611
|
);
|
|
369
612
|
const queueId = canvasModel.createNode(
|
|
370
613
|
createConstant({
|
|
@@ -377,11 +620,31 @@ export const generator = () => ({
|
|
|
377
620
|
const queue = canvasModel.createNode(createQueue(position({ x: 0, y: 12 })));
|
|
378
621
|
|
|
379
622
|
builder
|
|
380
|
-
.createEdge({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
623
|
+
.createEdge({
|
|
624
|
+
source: trigger.id,
|
|
625
|
+
target: converter.id,
|
|
626
|
+
input: 'tick',
|
|
627
|
+
})
|
|
628
|
+
.createEdge({
|
|
629
|
+
source: channelId.id,
|
|
630
|
+
target: converter.id,
|
|
631
|
+
input: 'channelId',
|
|
632
|
+
})
|
|
633
|
+
.createEdge({
|
|
634
|
+
source: queueId.id,
|
|
635
|
+
target: converter.id,
|
|
636
|
+
input: 'queueId',
|
|
637
|
+
})
|
|
638
|
+
.createEdge({
|
|
639
|
+
source: converter.id,
|
|
640
|
+
target: view.id,
|
|
641
|
+
output: 'newMessages',
|
|
642
|
+
})
|
|
643
|
+
.createEdge({
|
|
644
|
+
source: queueId.id,
|
|
645
|
+
target: queue.id,
|
|
646
|
+
input: 'input',
|
|
647
|
+
});
|
|
385
648
|
|
|
386
649
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
387
650
|
});
|
|
@@ -416,7 +679,7 @@ export const generator = () => ({
|
|
|
416
679
|
// canvasModel.builder.call((builder) => {
|
|
417
680
|
// const triggerShape = createTrigger({
|
|
418
681
|
// spaceId: space.id,
|
|
419
|
-
// triggerKind:
|
|
682
|
+
// triggerKind: 'queue',
|
|
420
683
|
// ...position({ x: -10, y: -5 }),
|
|
421
684
|
// });
|
|
422
685
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -448,10 +711,10 @@ export const generator = () => ({
|
|
|
448
711
|
] as [PresetName, ObjectGenerator<any>][],
|
|
449
712
|
});
|
|
450
713
|
|
|
451
|
-
const createQueueSinkPreset = <SpecType extends
|
|
714
|
+
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
452
715
|
space: Space,
|
|
453
716
|
triggerKind: SpecType,
|
|
454
|
-
initSpec: (spec: Extract<
|
|
717
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
455
718
|
triggerOutputName: string,
|
|
456
719
|
) => {
|
|
457
720
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -463,7 +726,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
463
726
|
}),
|
|
464
727
|
);
|
|
465
728
|
|
|
466
|
-
let functionTrigger:
|
|
729
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
467
730
|
canvasModel.builder.call((builder) => {
|
|
468
731
|
const triggerShape = createTrigger({
|
|
469
732
|
spaceId: space.id,
|
|
@@ -484,7 +747,12 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
484
747
|
builder
|
|
485
748
|
.createEdge({ source: queueId.id, target: append.id, input: 'id' })
|
|
486
749
|
.createEdge({ source: template.id, target: append.id, input: 'items' })
|
|
487
|
-
.createEdge({
|
|
750
|
+
.createEdge({
|
|
751
|
+
source: trigger.id,
|
|
752
|
+
target: template.id,
|
|
753
|
+
output: triggerOutputName,
|
|
754
|
+
input: 'type',
|
|
755
|
+
})
|
|
488
756
|
.createEdge({
|
|
489
757
|
source: random.id,
|
|
490
758
|
target: template.id,
|
|
@@ -494,15 +762,20 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
494
762
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
495
763
|
const triggerSpec = functionTrigger.spec;
|
|
496
764
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
497
|
-
|
|
765
|
+
Obj.change(functionTrigger, (ft) => {
|
|
766
|
+
initSpec(ft.spec as any);
|
|
767
|
+
});
|
|
498
768
|
});
|
|
499
769
|
|
|
500
770
|
const computeModel = createComputeGraph(canvasModel);
|
|
501
771
|
|
|
502
772
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
503
773
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
774
|
+
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
504
775
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
505
|
-
templateComputeNode.inputSchema =
|
|
776
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
777
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
778
|
+
);
|
|
506
779
|
attachTrigger(functionTrigger, computeModel);
|
|
507
780
|
|
|
508
781
|
return { canvasModel, computeModel };
|
|
@@ -510,7 +783,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
510
783
|
|
|
511
784
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
512
785
|
return space.db.add(
|
|
513
|
-
Obj.make(
|
|
786
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
514
787
|
name,
|
|
515
788
|
computeGraph: Ref.make(compute.root),
|
|
516
789
|
layout: canvas.graph,
|
|
@@ -538,17 +811,27 @@ const setupQueue = (
|
|
|
538
811
|
return { queue, queueId };
|
|
539
812
|
};
|
|
540
813
|
|
|
541
|
-
const attachTrigger = (functionTrigger:
|
|
814
|
+
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
542
815
|
invariant(functionTrigger);
|
|
543
|
-
functionTrigger.function = Ref.make(computeModel.root);
|
|
544
816
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
545
|
-
functionTrigger
|
|
817
|
+
Obj.change(functionTrigger, (t) => {
|
|
818
|
+
t.function = Ref.make(computeModel.root);
|
|
819
|
+
t.inputNodeId = inputNode.id;
|
|
820
|
+
});
|
|
546
821
|
};
|
|
547
822
|
|
|
548
|
-
type RawPositionInput = {
|
|
823
|
+
type RawPositionInput = {
|
|
824
|
+
centerX: number;
|
|
825
|
+
centerY: number;
|
|
826
|
+
width: number;
|
|
827
|
+
height: number;
|
|
828
|
+
};
|
|
549
829
|
|
|
550
830
|
const rawPosition = (args: RawPositionInput) => {
|
|
551
|
-
return {
|
|
831
|
+
return {
|
|
832
|
+
center: { x: args.centerX, y: args.centerY },
|
|
833
|
+
size: { width: args.width, height: args.height },
|
|
834
|
+
};
|
|
552
835
|
};
|
|
553
836
|
|
|
554
837
|
const position = (rect: { x: number; y: number; width?: number; height?: number }) => {
|
|
@@ -556,7 +839,10 @@ const position = (rect: { x: number; y: number; width?: number; height?: number
|
|
|
556
839
|
const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });
|
|
557
840
|
const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);
|
|
558
841
|
if (width && height) {
|
|
559
|
-
return {
|
|
842
|
+
return {
|
|
843
|
+
center: { x, y },
|
|
844
|
+
size: width && height ? { width, height } : undefined,
|
|
845
|
+
};
|
|
560
846
|
} else {
|
|
561
847
|
return { center: { x, y } };
|
|
562
848
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,13 +2,5 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export const DebugApp = lazy(() => import('./DebugApp'));
|
|
8
|
-
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
9
|
-
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
10
|
-
|
|
11
|
-
export * from './DebugObjectPanel';
|
|
12
|
-
export * from './DebugSettings';
|
|
13
|
-
export * from './DebugStatus';
|
|
14
|
-
export * from './Wireframe';
|
|
5
|
+
export * from './SchemaTable';
|
|
6
|
+
export * from './SpaceGenerator';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { type FC } 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
|
+
export const DebugGraph: FC<DebugGraphProps> = ({ graph, root }) => {
|
|
12
|
+
return <Tree data={Graph.toJSON(graph, root)} />;
|
|
13
|
+
};
|