@dxos/plugin-debug 0.8.4-main.70d3990 → 0.8.4-main.7996785055
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs +16 -0
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +7 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs +35 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs.map +7 -0
- package/dist/lib/browser/DebugSettings-DQXOXF6A.mjs +183 -0
- package/dist/lib/browser/DebugSettings-DQXOXF6A.mjs.map +7 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs +45 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs.map +7 -0
- package/dist/lib/browser/DebugStatus-FWF3YFBA.mjs +124 -0
- package/dist/lib/browser/DebugStatus-FWF3YFBA.mjs.map +7 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-TBTTPXVF.mjs +24 -0
- package/dist/lib/browser/DevtoolsOverviewContainer-TBTTPXVF.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-BED4UXGS.mjs → SpaceGenerator-UUQS6TYY.mjs} +432 -401
- package/dist/lib/browser/SpaceGenerator-UUQS6TYY.mjs.map +7 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs +53 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-FBLOEOH5.mjs +594 -0
- package/dist/lib/browser/app-graph-builder-FBLOEOH5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-SRV2AIGJ.mjs → chunk-Q37TZWW5.mjs} +12 -2
- package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-WZFZ4ESO.mjs → chunk-ZOM2FBHQ.mjs} +2 -2
- package/dist/lib/browser/chunk-ZOM2FBHQ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +40 -38
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-context-KBHXEMRS.mjs +18 -0
- package/dist/lib/browser/react-context-KBHXEMRS.mjs.map +7 -0
- package/dist/lib/browser/react-surface-HYT4HKZX.mjs +428 -0
- package/dist/lib/browser/react-surface-HYT4HKZX.mjs.map +7 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs +32 -0
- package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +7 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -8
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +7 -0
- package/dist/types/src/capabilities/react-context/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts +10 -0
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/index.d.ts +3 -0
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings/settings.d.ts +6 -0
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/index.d.ts +2 -0
- package/dist/types/src/components/SchemaTable/index.d.ts.map +1 -0
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +5 -5
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/index.d.ts +2 -2
- package/dist/types/src/components/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +1 -48
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +8 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +2 -2
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +10 -0
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts +3 -0
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.d.ts +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +3 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +15 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -0
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +1 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/index.d.ts +3 -0
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +39 -34
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +75 -70
- package/src/DebugPlugin.tsx +27 -31
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +419 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/index.ts +4 -6
- package/src/capabilities/react-context/index.ts +7 -0
- package/src/capabilities/react-context/react-context.tsx +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +414 -0
- package/src/capabilities/settings/index.ts +7 -0
- package/src/capabilities/settings/settings.ts +31 -0
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +19 -21
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +174 -66
- package/src/components/index.ts +2 -10
- package/src/containers/DebugGraph/DebugGraph.tsx +13 -0
- package/src/containers/DebugGraph/index.ts +7 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -0
- package/src/containers/DebugObjectPanel/index.ts +7 -0
- package/src/{components → containers/DebugSettings}/DebugSettings.tsx +51 -25
- package/src/containers/DebugSettings/index.ts +7 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
- package/src/{components → containers/DebugStatus}/DebugStatus.tsx +40 -16
- package/src/containers/DebugStatus/index.ts +7 -0
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
- package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +130 -0
- package/src/containers/SpaceGenerator/index.ts +7 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +4 -4
- package/src/containers/Wireframe/index.ts +7 -0
- package/src/containers/index.ts +14 -0
- package/src/meta.ts +3 -3
- package/src/translations.ts +2 -0
- package/src/types.ts +9 -2
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs +0 -20
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-JXVZVPHN.mjs +0 -25
- package/dist/lib/browser/DevtoolsOverviewContainer-JXVZVPHN.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-BED4UXGS.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-CRH2HJKT.mjs +0 -588
- package/dist/lib/browser/app-graph-builder-CRH2HJKT.mjs.map +0 -7
- package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +0 -7
- package/dist/lib/browser/react-context-P2YDWEWI.mjs +0 -16
- package/dist/lib/browser/react-context-P2YDWEWI.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JM2H3RZI.mjs +0 -774
- package/dist/lib/browser/react-surface-JM2H3RZI.mjs.map +0 -7
- package/dist/lib/browser/settings-SQXR3OAH.mjs +0 -22
- package/dist/lib/browser/settings-SQXR3OAH.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -8
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugGraph.d.ts +0 -8
- package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- package/dist/types/src/components/DebugSettings.d.ts +0 -6
- package/dist/types/src/components/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/components/DebugStatus.d.ts.map +0 -1
- package/dist/types/src/components/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +0 -9
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -15
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +0 -1
- package/dist/types/src/components/Wireframe.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -431
- package/src/capabilities/react-context.tsx +0 -16
- package/src/capabilities/react-surface.tsx +0 -418
- package/src/capabilities/settings.ts +0 -19
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugGraph.tsx +0 -14
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/DevtoolsOverviewContainer.tsx +0 -20
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -52
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -122
- /package/dist/types/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.d.ts +0 -0
- /package/dist/types/src/{components → containers/DebugStatus}/DebugStatus.d.ts +0 -0
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AgentPrompt, EntityExtraction, ResearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
8
|
import { Prompt } from '@dxos/blueprints';
|
|
9
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
10
|
-
import { DXN, Filter, Key, Obj, Query, Ref, Tag
|
|
11
|
-
import { Trigger
|
|
10
|
+
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';
|
|
11
|
+
import { Trigger } from '@dxos/functions';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import {
|
|
13
|
+
import { Operation } from '@dxos/operation';
|
|
14
|
+
import { InboxOperation } from '@dxos/plugin-inbox';
|
|
14
15
|
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
15
16
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
16
17
|
import { type Space } from '@dxos/react-client/echo';
|
|
@@ -29,15 +30,9 @@ import {
|
|
|
29
30
|
createText,
|
|
30
31
|
createTrigger,
|
|
31
32
|
} from '@dxos/react-ui-canvas-compute';
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pointMultiply,
|
|
36
|
-
pointsToRect,
|
|
37
|
-
rectToPoints,
|
|
38
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
39
|
-
import { View } from '@dxos/schema';
|
|
40
|
-
import { Message, Organization, Person, Project } from '@dxos/types';
|
|
33
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
34
|
+
import { ViewModel } from '@dxos/schema';
|
|
35
|
+
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
41
36
|
import { range, trim } from '@dxos/util';
|
|
42
37
|
|
|
43
38
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
@@ -57,14 +52,19 @@ export enum PresetName {
|
|
|
57
52
|
}
|
|
58
53
|
|
|
59
54
|
export const generator = () => ({
|
|
60
|
-
schemas: [
|
|
55
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
61
56
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
62
57
|
items: [
|
|
63
58
|
[
|
|
64
59
|
PresetName.DXOS_TEAM,
|
|
65
60
|
async (space, n, cb) => {
|
|
66
61
|
const objects = range(n, () => {
|
|
67
|
-
const org = space.db.add(
|
|
62
|
+
const org = space.db.add(
|
|
63
|
+
Obj.make(Organization.Organization, {
|
|
64
|
+
name: 'DXOS',
|
|
65
|
+
website: 'https://dxos.org',
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
68
|
const doc = space.db.add(
|
|
69
69
|
Markdown.make({
|
|
70
70
|
name: 'DXOS Research',
|
|
@@ -74,7 +74,9 @@ export const generator = () => ({
|
|
|
74
74
|
|
|
75
75
|
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
76
76
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
77
|
-
Obj.
|
|
77
|
+
Obj.change(doc, (obj) => {
|
|
78
|
+
Obj.getMeta(obj).tags = [tagDxn];
|
|
79
|
+
});
|
|
78
80
|
|
|
79
81
|
// space.db.add(
|
|
80
82
|
// Relation.make(HasSubject, {
|
|
@@ -84,10 +86,27 @@ export const generator = () => ({
|
|
|
84
86
|
// }),
|
|
85
87
|
// );
|
|
86
88
|
|
|
87
|
-
space.db.add(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
space.db.add(
|
|
89
|
+
space.db.add(
|
|
90
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
91
|
+
);
|
|
92
|
+
space.db.add(
|
|
93
|
+
Obj.make(Person.Person, {
|
|
94
|
+
fullName: 'Josiah',
|
|
95
|
+
organization: Ref.make(org),
|
|
96
|
+
}),
|
|
97
|
+
);
|
|
98
|
+
space.db.add(
|
|
99
|
+
Obj.make(Person.Person, {
|
|
100
|
+
fullName: 'Dima',
|
|
101
|
+
organization: Ref.make(org),
|
|
102
|
+
}),
|
|
103
|
+
);
|
|
104
|
+
space.db.add(
|
|
105
|
+
Obj.make(Person.Person, {
|
|
106
|
+
fullName: 'Mykola',
|
|
107
|
+
organization: Ref.make(org),
|
|
108
|
+
}),
|
|
109
|
+
);
|
|
91
110
|
|
|
92
111
|
return doc;
|
|
93
112
|
});
|
|
@@ -98,7 +117,13 @@ export const generator = () => ({
|
|
|
98
117
|
[
|
|
99
118
|
PresetName.ORG_RESEARCH_PROJECT,
|
|
100
119
|
async (space, n, cb) => {
|
|
101
|
-
const
|
|
120
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
121
|
+
const mailbox = mailboxes[0];
|
|
122
|
+
invariant(mailbox, 'Mailbox not found');
|
|
123
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
124
|
+
invariant(mailboxFeed, 'Mailbox missing feed reference');
|
|
125
|
+
const queueDxn = Feed.getQueueDxn(mailboxFeed)?.toString();
|
|
126
|
+
invariant(queueDxn, 'Mailbox feed missing queue DXN key');
|
|
102
127
|
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
103
128
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
104
129
|
|
|
@@ -114,9 +139,9 @@ export const generator = () => ({
|
|
|
114
139
|
kind: 'timer',
|
|
115
140
|
cron: '* * * * *', // Every minute.
|
|
116
141
|
},
|
|
117
|
-
function: Ref.make(
|
|
142
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
118
143
|
input: {
|
|
119
|
-
|
|
144
|
+
mailbox: Ref.make(mailbox),
|
|
120
145
|
},
|
|
121
146
|
}),
|
|
122
147
|
);
|
|
@@ -127,9 +152,9 @@ export const generator = () => ({
|
|
|
127
152
|
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
128
153
|
spec: {
|
|
129
154
|
kind: 'queue',
|
|
130
|
-
queue:
|
|
155
|
+
queue: queueDxn,
|
|
131
156
|
},
|
|
132
|
-
function: Ref.make(
|
|
157
|
+
function: Ref.make(Operation.serialize(EntityExtraction)),
|
|
133
158
|
input: {
|
|
134
159
|
source: '{{event.item}}',
|
|
135
160
|
},
|
|
@@ -152,7 +177,7 @@ export const generator = () => ({
|
|
|
152
177
|
Create a research note for it at the end.
|
|
153
178
|
NOTE: Do mocked reseach (set mockSearch to true).
|
|
154
179
|
`,
|
|
155
|
-
blueprints: [Ref.make(ResearchBlueprint)],
|
|
180
|
+
blueprints: [Ref.make(ResearchBlueprint.make())],
|
|
156
181
|
}),
|
|
157
182
|
);
|
|
158
183
|
|
|
@@ -165,7 +190,7 @@ export const generator = () => ({
|
|
|
165
190
|
ast: organizationsQuery.ast,
|
|
166
191
|
},
|
|
167
192
|
},
|
|
168
|
-
function: Ref.make(
|
|
193
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
169
194
|
input: {
|
|
170
195
|
prompt: Ref.make(researchPrompt),
|
|
171
196
|
input: '{{event.subject}}',
|
|
@@ -173,29 +198,31 @@ export const generator = () => ({
|
|
|
173
198
|
}),
|
|
174
199
|
);
|
|
175
200
|
|
|
176
|
-
const mailboxView =
|
|
201
|
+
const mailboxView = ViewModel.make({
|
|
177
202
|
query: Query.select(
|
|
178
|
-
Filter.type(Message.Message, {
|
|
179
|
-
|
|
180
|
-
|
|
203
|
+
Filter.type(Message.Message, {
|
|
204
|
+
properties: { labels: Filter.contains('investor') },
|
|
205
|
+
}),
|
|
206
|
+
).from({
|
|
207
|
+
queues: [queueDxn],
|
|
181
208
|
}),
|
|
182
|
-
jsonSchema:
|
|
209
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
183
210
|
});
|
|
184
|
-
const contactsView =
|
|
211
|
+
const contactsView = ViewModel.make({
|
|
185
212
|
query: contactsQuery,
|
|
186
|
-
jsonSchema:
|
|
213
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
187
214
|
});
|
|
188
|
-
const organizationsView =
|
|
215
|
+
const organizationsView = ViewModel.make({
|
|
189
216
|
query: organizationsQuery,
|
|
190
|
-
jsonSchema:
|
|
217
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
191
218
|
});
|
|
192
|
-
const notesView =
|
|
219
|
+
const notesView = ViewModel.make({
|
|
193
220
|
query: notesQuery,
|
|
194
|
-
jsonSchema:
|
|
221
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
195
222
|
});
|
|
196
223
|
|
|
197
224
|
return space.db.add(
|
|
198
|
-
|
|
225
|
+
Pipeline.make({
|
|
199
226
|
name: 'Investor Research',
|
|
200
227
|
columns: [
|
|
201
228
|
{
|
|
@@ -247,10 +274,24 @@ export const generator = () => ({
|
|
|
247
274
|
const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
248
275
|
|
|
249
276
|
builder
|
|
250
|
-
.createEdge({
|
|
277
|
+
.createEdge({
|
|
278
|
+
source: trigger.id,
|
|
279
|
+
target: gpt.id,
|
|
280
|
+
input: 'prompt',
|
|
281
|
+
output: 'bodyText',
|
|
282
|
+
})
|
|
251
283
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
252
|
-
.createEdge({
|
|
253
|
-
|
|
284
|
+
.createEdge({
|
|
285
|
+
source: queueId.id,
|
|
286
|
+
target: append.id,
|
|
287
|
+
input: 'id',
|
|
288
|
+
})
|
|
289
|
+
.createEdge({
|
|
290
|
+
source: gpt.id,
|
|
291
|
+
target: append.id,
|
|
292
|
+
output: 'messages',
|
|
293
|
+
input: 'items',
|
|
294
|
+
});
|
|
254
295
|
|
|
255
296
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
256
297
|
});
|
|
@@ -275,7 +316,7 @@ export const generator = () => ({
|
|
|
275
316
|
'subscription',
|
|
276
317
|
(triggerSpec) =>
|
|
277
318
|
(triggerSpec.query = {
|
|
278
|
-
ast: Query.select(Filter.typename('dxos.
|
|
319
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
279
320
|
}),
|
|
280
321
|
'type',
|
|
281
322
|
);
|
|
@@ -360,7 +401,7 @@ export const generator = () => ({
|
|
|
360
401
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
361
402
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
362
403
|
// templateComputeNode.value = templateContent.join('\n');
|
|
363
|
-
// templateComputeNode.inputSchema =
|
|
404
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
364
405
|
|
|
365
406
|
// attachTrigger(functionTrigger, computeModel);
|
|
366
407
|
|
|
@@ -388,8 +429,17 @@ export const generator = () => ({
|
|
|
388
429
|
builder
|
|
389
430
|
.createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })
|
|
390
431
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
391
|
-
.createEdge({
|
|
392
|
-
|
|
432
|
+
.createEdge({
|
|
433
|
+
source: queueId.id,
|
|
434
|
+
target: append.id,
|
|
435
|
+
input: 'id',
|
|
436
|
+
})
|
|
437
|
+
.createEdge({
|
|
438
|
+
source: gpt.id,
|
|
439
|
+
target: append.id,
|
|
440
|
+
output: 'messages',
|
|
441
|
+
input: 'items',
|
|
442
|
+
});
|
|
393
443
|
});
|
|
394
444
|
|
|
395
445
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -485,7 +535,7 @@ export const generator = () => ({
|
|
|
485
535
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
486
536
|
// templateComputeNode.value = templateContent.join('\n');
|
|
487
537
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
488
|
-
// templateComputeNode.inputSchema =
|
|
538
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
489
539
|
|
|
490
540
|
// attachTrigger(functionTrigger, computeModel);
|
|
491
541
|
|
|
@@ -513,9 +563,21 @@ export const generator = () => ({
|
|
|
513
563
|
const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));
|
|
514
564
|
|
|
515
565
|
builder
|
|
516
|
-
.createEdge({
|
|
517
|
-
|
|
518
|
-
|
|
566
|
+
.createEdge({
|
|
567
|
+
source: sourceCurrency.id,
|
|
568
|
+
target: converter.id,
|
|
569
|
+
input: 'from',
|
|
570
|
+
})
|
|
571
|
+
.createEdge({
|
|
572
|
+
source: targetCurrency.id,
|
|
573
|
+
target: converter.id,
|
|
574
|
+
input: 'to',
|
|
575
|
+
})
|
|
576
|
+
.createEdge({
|
|
577
|
+
source: converter.id,
|
|
578
|
+
target: view.id,
|
|
579
|
+
output: 'rate',
|
|
580
|
+
});
|
|
519
581
|
});
|
|
520
582
|
|
|
521
583
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -543,7 +605,10 @@ export const generator = () => ({
|
|
|
543
605
|
const trigger = canvasModel.createNode(triggerShape);
|
|
544
606
|
// DXOS dev-null channel.
|
|
545
607
|
const channelId = canvasModel.createNode(
|
|
546
|
-
createConstant({
|
|
608
|
+
createConstant({
|
|
609
|
+
value: '1088569858767212554',
|
|
610
|
+
...position({ x: -10, y: 0 }),
|
|
611
|
+
}),
|
|
547
612
|
);
|
|
548
613
|
const queueId = canvasModel.createNode(
|
|
549
614
|
createConstant({
|
|
@@ -556,11 +621,31 @@ export const generator = () => ({
|
|
|
556
621
|
const queue = canvasModel.createNode(createQueue(position({ x: 0, y: 12 })));
|
|
557
622
|
|
|
558
623
|
builder
|
|
559
|
-
.createEdge({
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
624
|
+
.createEdge({
|
|
625
|
+
source: trigger.id,
|
|
626
|
+
target: converter.id,
|
|
627
|
+
input: 'tick',
|
|
628
|
+
})
|
|
629
|
+
.createEdge({
|
|
630
|
+
source: channelId.id,
|
|
631
|
+
target: converter.id,
|
|
632
|
+
input: 'channelId',
|
|
633
|
+
})
|
|
634
|
+
.createEdge({
|
|
635
|
+
source: queueId.id,
|
|
636
|
+
target: converter.id,
|
|
637
|
+
input: 'queueId',
|
|
638
|
+
})
|
|
639
|
+
.createEdge({
|
|
640
|
+
source: converter.id,
|
|
641
|
+
target: view.id,
|
|
642
|
+
output: 'newMessages',
|
|
643
|
+
})
|
|
644
|
+
.createEdge({
|
|
645
|
+
source: queueId.id,
|
|
646
|
+
target: queue.id,
|
|
647
|
+
input: 'input',
|
|
648
|
+
});
|
|
564
649
|
|
|
565
650
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
566
651
|
});
|
|
@@ -630,7 +715,7 @@ export const generator = () => ({
|
|
|
630
715
|
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
631
716
|
space: Space,
|
|
632
717
|
triggerKind: SpecType,
|
|
633
|
-
initSpec: (spec: Extract<Trigger.Spec, { kind: SpecType }
|
|
718
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
634
719
|
triggerOutputName: string,
|
|
635
720
|
) => {
|
|
636
721
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -663,7 +748,12 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
663
748
|
builder
|
|
664
749
|
.createEdge({ source: queueId.id, target: append.id, input: 'id' })
|
|
665
750
|
.createEdge({ source: template.id, target: append.id, input: 'items' })
|
|
666
|
-
.createEdge({
|
|
751
|
+
.createEdge({
|
|
752
|
+
source: trigger.id,
|
|
753
|
+
target: template.id,
|
|
754
|
+
output: triggerOutputName,
|
|
755
|
+
input: 'type',
|
|
756
|
+
})
|
|
667
757
|
.createEdge({
|
|
668
758
|
source: random.id,
|
|
669
759
|
target: template.id,
|
|
@@ -673,15 +763,20 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
673
763
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
674
764
|
const triggerSpec = functionTrigger.spec;
|
|
675
765
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
676
|
-
|
|
766
|
+
Obj.change(functionTrigger, (ft) => {
|
|
767
|
+
initSpec(ft.spec as any);
|
|
768
|
+
});
|
|
677
769
|
});
|
|
678
770
|
|
|
679
771
|
const computeModel = createComputeGraph(canvasModel);
|
|
680
772
|
|
|
681
773
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
682
774
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
775
|
+
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
683
776
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
684
|
-
templateComputeNode.inputSchema =
|
|
777
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
778
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
779
|
+
);
|
|
685
780
|
attachTrigger(functionTrigger, computeModel);
|
|
686
781
|
|
|
687
782
|
return { canvasModel, computeModel };
|
|
@@ -689,7 +784,7 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
689
784
|
|
|
690
785
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
691
786
|
return space.db.add(
|
|
692
|
-
Obj.make(
|
|
787
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
693
788
|
name,
|
|
694
789
|
computeGraph: Ref.make(compute.root),
|
|
695
790
|
layout: canvas.graph,
|
|
@@ -719,15 +814,25 @@ const setupQueue = (
|
|
|
719
814
|
|
|
720
815
|
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
721
816
|
invariant(functionTrigger);
|
|
722
|
-
functionTrigger.function = Ref.make(computeModel.root);
|
|
723
817
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
724
|
-
functionTrigger
|
|
818
|
+
Obj.change(functionTrigger, (obj) => {
|
|
819
|
+
obj.function = Ref.make(computeModel.root);
|
|
820
|
+
obj.inputNodeId = inputNode.id;
|
|
821
|
+
});
|
|
725
822
|
};
|
|
726
823
|
|
|
727
|
-
type RawPositionInput = {
|
|
824
|
+
type RawPositionInput = {
|
|
825
|
+
centerX: number;
|
|
826
|
+
centerY: number;
|
|
827
|
+
width: number;
|
|
828
|
+
height: number;
|
|
829
|
+
};
|
|
728
830
|
|
|
729
831
|
const rawPosition = (args: RawPositionInput) => {
|
|
730
|
-
return {
|
|
832
|
+
return {
|
|
833
|
+
center: { x: args.centerX, y: args.centerY },
|
|
834
|
+
size: { width: args.width, height: args.height },
|
|
835
|
+
};
|
|
731
836
|
};
|
|
732
837
|
|
|
733
838
|
const position = (rect: { x: number; y: number; width?: number; height?: number }) => {
|
|
@@ -735,7 +840,10 @@ const position = (rect: { x: number; y: number; width?: number; height?: number
|
|
|
735
840
|
const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });
|
|
736
841
|
const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);
|
|
737
842
|
if (width && height) {
|
|
738
|
-
return {
|
|
843
|
+
return {
|
|
844
|
+
center: { x, y },
|
|
845
|
+
size: width && height ? { width, height } : undefined,
|
|
846
|
+
};
|
|
739
847
|
} else {
|
|
740
848
|
return { center: { x, y } };
|
|
741
849
|
}
|
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 DebugGraph = lazy(() => import('./DebugGraph'));
|
|
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
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { ObjectsTree } from '@dxos/devtools';
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import type { ObjectId } from '@dxos/keys';
|
|
10
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { Clipboard, Grid, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
12
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
13
|
+
|
|
14
|
+
export type DebugObjectPanelProps = {
|
|
15
|
+
object: Obj.Unknown;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {
|
|
19
|
+
const db = Obj.getDatabase(object);
|
|
20
|
+
const [selectedId, setSelectedId] = useState<ObjectId | null>(null);
|
|
21
|
+
const [selectedObject] = useQuery(
|
|
22
|
+
db,
|
|
23
|
+
Query.select(Filter.id(selectedId ?? object.id)).options({ deleted: 'include' }),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Clipboard.Provider>
|
|
28
|
+
<Panel.Root>
|
|
29
|
+
<Panel.Toolbar asChild>
|
|
30
|
+
<Toolbar.Root />
|
|
31
|
+
</Panel.Toolbar>
|
|
32
|
+
<Panel.Content asChild>
|
|
33
|
+
<Grid rows={db ? 2 : 1} classNames='divide-y divide-separator'>
|
|
34
|
+
{db && (
|
|
35
|
+
<ScrollArea.Root>
|
|
36
|
+
<ScrollArea.Viewport>
|
|
37
|
+
<ObjectsTree db={db} root={object} onSelect={(entity) => setSelectedId(entity.id)} />
|
|
38
|
+
</ScrollArea.Viewport>
|
|
39
|
+
</ScrollArea.Root>
|
|
40
|
+
)}
|
|
41
|
+
<Json data={selectedObject} />
|
|
42
|
+
</Grid>
|
|
43
|
+
</Panel.Content>
|
|
44
|
+
</Panel.Root>
|
|
45
|
+
</Clipboard.Provider>
|
|
46
|
+
);
|
|
47
|
+
};
|