@dxos/plugin-debug 0.8.4-main.72ec0f3 → 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-46TAISVE.mjs → SpaceGenerator-UUQS6TYY.mjs} +455 -425
- 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 -4
- 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 +196 -75
- 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-46TAISVE.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-2SNVZDEA.mjs +0 -774
- package/dist/lib/browser/react-surface-2SNVZDEA.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 { Collection, 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,39 +198,54 @@ export const generator = () => ({
|
|
|
173
198
|
}),
|
|
174
199
|
);
|
|
175
200
|
|
|
176
|
-
const mailboxView =
|
|
177
|
-
name: 'Mailbox',
|
|
201
|
+
const mailboxView = ViewModel.make({
|
|
178
202
|
query: Query.select(
|
|
179
|
-
Filter.type(Message.Message, {
|
|
180
|
-
|
|
181
|
-
|
|
203
|
+
Filter.type(Message.Message, {
|
|
204
|
+
properties: { labels: Filter.contains('investor') },
|
|
205
|
+
}),
|
|
206
|
+
).from({
|
|
207
|
+
queues: [queueDxn],
|
|
182
208
|
}),
|
|
183
|
-
jsonSchema:
|
|
184
|
-
presentation: Obj.make(Collection.Collection, { objects: [] }),
|
|
209
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
185
210
|
});
|
|
186
|
-
const contactsView =
|
|
187
|
-
name: 'Contacts',
|
|
211
|
+
const contactsView = ViewModel.make({
|
|
188
212
|
query: contactsQuery,
|
|
189
|
-
jsonSchema:
|
|
190
|
-
presentation: Obj.make(Collection.Collection, { objects: [] }),
|
|
213
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
191
214
|
});
|
|
192
|
-
const organizationsView =
|
|
193
|
-
name: 'Organizations',
|
|
215
|
+
const organizationsView = ViewModel.make({
|
|
194
216
|
query: organizationsQuery,
|
|
195
|
-
jsonSchema:
|
|
196
|
-
presentation: Obj.make(Collection.Collection, { objects: [] }),
|
|
217
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
197
218
|
});
|
|
198
|
-
const notesView =
|
|
199
|
-
name: 'Notes',
|
|
219
|
+
const notesView = ViewModel.make({
|
|
200
220
|
query: notesQuery,
|
|
201
|
-
jsonSchema:
|
|
202
|
-
presentation: Obj.make(Collection.Collection, { objects: [] }),
|
|
221
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
203
222
|
});
|
|
204
223
|
|
|
205
224
|
return space.db.add(
|
|
206
|
-
|
|
225
|
+
Pipeline.make({
|
|
207
226
|
name: 'Investor Research',
|
|
208
|
-
|
|
227
|
+
columns: [
|
|
228
|
+
{
|
|
229
|
+
name: 'Mailbox',
|
|
230
|
+
view: Ref.make(mailboxView),
|
|
231
|
+
order: [],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: 'Contacts',
|
|
235
|
+
view: Ref.make(contactsView),
|
|
236
|
+
order: [],
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: 'Organizations',
|
|
240
|
+
view: Ref.make(organizationsView),
|
|
241
|
+
order: [],
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: 'Notes',
|
|
245
|
+
view: Ref.make(notesView),
|
|
246
|
+
order: [],
|
|
247
|
+
},
|
|
248
|
+
],
|
|
209
249
|
}),
|
|
210
250
|
);
|
|
211
251
|
});
|
|
@@ -234,10 +274,24 @@ export const generator = () => ({
|
|
|
234
274
|
const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
235
275
|
|
|
236
276
|
builder
|
|
237
|
-
.createEdge({
|
|
277
|
+
.createEdge({
|
|
278
|
+
source: trigger.id,
|
|
279
|
+
target: gpt.id,
|
|
280
|
+
input: 'prompt',
|
|
281
|
+
output: 'bodyText',
|
|
282
|
+
})
|
|
238
283
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
239
|
-
.createEdge({
|
|
240
|
-
|
|
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
|
+
});
|
|
241
295
|
|
|
242
296
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
243
297
|
});
|
|
@@ -262,7 +316,7 @@ export const generator = () => ({
|
|
|
262
316
|
'subscription',
|
|
263
317
|
(triggerSpec) =>
|
|
264
318
|
(triggerSpec.query = {
|
|
265
|
-
ast: Query.select(Filter.typename('dxos.
|
|
319
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
266
320
|
}),
|
|
267
321
|
'type',
|
|
268
322
|
);
|
|
@@ -347,7 +401,7 @@ export const generator = () => ({
|
|
|
347
401
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
348
402
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
349
403
|
// templateComputeNode.value = templateContent.join('\n');
|
|
350
|
-
// templateComputeNode.inputSchema =
|
|
404
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
351
405
|
|
|
352
406
|
// attachTrigger(functionTrigger, computeModel);
|
|
353
407
|
|
|
@@ -375,8 +429,17 @@ export const generator = () => ({
|
|
|
375
429
|
builder
|
|
376
430
|
.createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })
|
|
377
431
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
378
|
-
.createEdge({
|
|
379
|
-
|
|
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
|
+
});
|
|
380
443
|
});
|
|
381
444
|
|
|
382
445
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -472,7 +535,7 @@ export const generator = () => ({
|
|
|
472
535
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
473
536
|
// templateComputeNode.value = templateContent.join('\n');
|
|
474
537
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
475
|
-
// templateComputeNode.inputSchema =
|
|
538
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
476
539
|
|
|
477
540
|
// attachTrigger(functionTrigger, computeModel);
|
|
478
541
|
|
|
@@ -500,9 +563,21 @@ export const generator = () => ({
|
|
|
500
563
|
const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));
|
|
501
564
|
|
|
502
565
|
builder
|
|
503
|
-
.createEdge({
|
|
504
|
-
|
|
505
|
-
|
|
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
|
+
});
|
|
506
581
|
});
|
|
507
582
|
|
|
508
583
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -530,7 +605,10 @@ export const generator = () => ({
|
|
|
530
605
|
const trigger = canvasModel.createNode(triggerShape);
|
|
531
606
|
// DXOS dev-null channel.
|
|
532
607
|
const channelId = canvasModel.createNode(
|
|
533
|
-
createConstant({
|
|
608
|
+
createConstant({
|
|
609
|
+
value: '1088569858767212554',
|
|
610
|
+
...position({ x: -10, y: 0 }),
|
|
611
|
+
}),
|
|
534
612
|
);
|
|
535
613
|
const queueId = canvasModel.createNode(
|
|
536
614
|
createConstant({
|
|
@@ -543,11 +621,31 @@ export const generator = () => ({
|
|
|
543
621
|
const queue = canvasModel.createNode(createQueue(position({ x: 0, y: 12 })));
|
|
544
622
|
|
|
545
623
|
builder
|
|
546
|
-
.createEdge({
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
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
|
+
});
|
|
551
649
|
|
|
552
650
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
553
651
|
});
|
|
@@ -617,7 +715,7 @@ export const generator = () => ({
|
|
|
617
715
|
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
618
716
|
space: Space,
|
|
619
717
|
triggerKind: SpecType,
|
|
620
|
-
initSpec: (spec: Extract<Trigger.Spec, { kind: SpecType }
|
|
718
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
621
719
|
triggerOutputName: string,
|
|
622
720
|
) => {
|
|
623
721
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -650,7 +748,12 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
650
748
|
builder
|
|
651
749
|
.createEdge({ source: queueId.id, target: append.id, input: 'id' })
|
|
652
750
|
.createEdge({ source: template.id, target: append.id, input: 'items' })
|
|
653
|
-
.createEdge({
|
|
751
|
+
.createEdge({
|
|
752
|
+
source: trigger.id,
|
|
753
|
+
target: template.id,
|
|
754
|
+
output: triggerOutputName,
|
|
755
|
+
input: 'type',
|
|
756
|
+
})
|
|
654
757
|
.createEdge({
|
|
655
758
|
source: random.id,
|
|
656
759
|
target: template.id,
|
|
@@ -660,15 +763,20 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
660
763
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
661
764
|
const triggerSpec = functionTrigger.spec;
|
|
662
765
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
663
|
-
|
|
766
|
+
Obj.change(functionTrigger, (ft) => {
|
|
767
|
+
initSpec(ft.spec as any);
|
|
768
|
+
});
|
|
664
769
|
});
|
|
665
770
|
|
|
666
771
|
const computeModel = createComputeGraph(canvasModel);
|
|
667
772
|
|
|
668
773
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
669
774
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
775
|
+
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
670
776
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
671
|
-
templateComputeNode.inputSchema =
|
|
777
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
778
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
779
|
+
);
|
|
672
780
|
attachTrigger(functionTrigger, computeModel);
|
|
673
781
|
|
|
674
782
|
return { canvasModel, computeModel };
|
|
@@ -676,7 +784,7 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
676
784
|
|
|
677
785
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
678
786
|
return space.db.add(
|
|
679
|
-
Obj.make(
|
|
787
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
680
788
|
name,
|
|
681
789
|
computeGraph: Ref.make(compute.root),
|
|
682
790
|
layout: canvas.graph,
|
|
@@ -706,15 +814,25 @@ const setupQueue = (
|
|
|
706
814
|
|
|
707
815
|
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
708
816
|
invariant(functionTrigger);
|
|
709
|
-
functionTrigger.function = Ref.make(computeModel.root);
|
|
710
817
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
711
|
-
functionTrigger
|
|
818
|
+
Obj.change(functionTrigger, (obj) => {
|
|
819
|
+
obj.function = Ref.make(computeModel.root);
|
|
820
|
+
obj.inputNodeId = inputNode.id;
|
|
821
|
+
});
|
|
712
822
|
};
|
|
713
823
|
|
|
714
|
-
type RawPositionInput = {
|
|
824
|
+
type RawPositionInput = {
|
|
825
|
+
centerX: number;
|
|
826
|
+
centerY: number;
|
|
827
|
+
width: number;
|
|
828
|
+
height: number;
|
|
829
|
+
};
|
|
715
830
|
|
|
716
831
|
const rawPosition = (args: RawPositionInput) => {
|
|
717
|
-
return {
|
|
832
|
+
return {
|
|
833
|
+
center: { x: args.centerX, y: args.centerY },
|
|
834
|
+
size: { width: args.width, height: args.height },
|
|
835
|
+
};
|
|
718
836
|
};
|
|
719
837
|
|
|
720
838
|
const position = (rect: { x: number; y: number; width?: number; height?: number }) => {
|
|
@@ -722,7 +840,10 @@ const position = (rect: { x: number; y: number; width?: number; height?: number
|
|
|
722
840
|
const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });
|
|
723
841
|
const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);
|
|
724
842
|
if (width && height) {
|
|
725
|
-
return {
|
|
843
|
+
return {
|
|
844
|
+
center: { x, y },
|
|
845
|
+
size: width && height ? { width, height } : undefined,
|
|
846
|
+
};
|
|
726
847
|
} else {
|
|
727
848
|
return { center: { x, y } };
|
|
728
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
|
+
};
|