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