@dxos/plugin-debug 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
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 → neutral/DebugGraph-G4FWS57E.mjs} +4 -5
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +47 -0
- package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs +224 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs.map +7 -0
- package/dist/lib/{browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs → neutral/DebugSpaceObjectsPanel-NISULU6U.mjs} +10 -26
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs.map +7 -0
- package/dist/lib/{browser/DebugStatus-COQGH37G.mjs → neutral/DebugStatus-YB3KFP7G.mjs} +35 -39
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs.map +7 -0
- package/dist/lib/{browser/DevtoolsOverviewContainer-C75NFVER.mjs → neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs} +9 -6
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs +143 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs.map +7 -0
- package/dist/lib/{browser/Wireframe-KAGOKEFW.mjs → neutral/Wireframe-7SNRUKET.mjs} +8 -9
- package/dist/lib/neutral/Wireframe-7SNRUKET.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-builder-LGUQNXHD.mjs → neutral/app-graph-builder-YPYHL2K5.mjs} +210 -258
- package/dist/lib/neutral/app-graph-builder-YPYHL2K5.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-A5H5GRV6.mjs → neutral/chunk-3OGPOE7H.mjs} +2 -2
- package/dist/lib/{browser/chunk-A5H5GRV6.mjs.map → neutral/chunk-3OGPOE7H.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-4UFQXPP7.mjs → neutral/chunk-NFIOTQRZ.mjs} +23 -12
- package/dist/lib/neutral/chunk-NFIOTQRZ.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-SWSGJEEL.mjs → neutral/components/index.mjs} +60 -253
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +21 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-context-I3USIAF6.mjs → neutral/react-context-MUZ3KVLU.mjs} +6 -6
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-BTVNKKVQ.mjs → neutral/react-surface-NH2H63KW.mjs} +153 -176
- package/dist/lib/neutral/react-surface-NH2H63KW.mjs.map +7 -0
- package/dist/lib/{browser/settings-SLTQJJNF.mjs → neutral/settings-MPM6YUP4.mjs} +7 -11
- package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +83 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +2 -5
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/DebugPlugin.node.d.ts +5 -0
- package/dist/types/src/DebugPlugin.node.d.ts.map +1 -0
- package/dist/types/src/DebugPlugin.test.d.ts +2 -0
- package/dist/types/src/DebugPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +99 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
- package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts +2 -2
- 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/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +2 -2
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/index.d.ts +1 -2
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +3 -4
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +1 -2
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +1 -2
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/index.d.ts +1 -2
- package/dist/types/src/containers/DebugStatus/index.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +1 -2
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +3 -1
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +1 -2
- package/dist/types/src/containers/SpaceGenerator/index.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
- package/dist/types/src/containers/Wireframe/index.d.ts +1 -2
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +0 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +80 -61
- 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 +115 -64
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +9 -11
- package/src/capabilities/app-graph-builder.ts +405 -0
- package/src/capabilities/index.ts +6 -4
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +7 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +169 -158
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
- 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/SpaceGenerator/ObjectGenerator.tsx +13 -15
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/presets.ts +28 -50
- package/src/components/index.ts +4 -0
- package/src/containers/DebugGraph/DebugGraph.tsx +3 -2
- package/src/containers/DebugGraph/index.ts +1 -3
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -16
- package/src/containers/DebugObjectPanel/index.ts +1 -3
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +10 -23
- package/src/containers/DebugSpaceObjectsPanel/index.ts +1 -3
- package/src/containers/DebugStatus/DebugStatus.tsx +41 -19
- package/src/containers/DebugStatus/index.ts +1 -3
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +8 -1
- package/src/containers/DevtoolsOverviewContainer/index.ts +1 -3
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +102 -103
- package/src/containers/SpaceGenerator/index.ts +1 -3
- package/src/containers/Wireframe/Wireframe.tsx +2 -6
- package/src/containers/Wireframe/index.ts +1 -3
- package/src/containers/index.ts +0 -1
- package/src/index.ts +1 -1
- package/src/meta.ts +1 -1
- package/src/plugin.ts +10 -0
- package/src/translations.ts +75 -60
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +15 -14
- package/dist/lib/browser/DebugGraph-7HXJ2PS2.mjs.map +0 -7
- package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs +0 -33
- package/dist/lib/browser/DebugObjectPanel-3TCDNUNW.mjs.map +0 -7
- package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs +0 -174
- package/dist/lib/browser/DebugSettings-JZMIUDYB.mjs.map +0 -7
- package/dist/lib/browser/DebugSpaceObjectsPanel-7NRPLWZ4.mjs.map +0 -7
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-SWSGJEEL.mjs.map +0 -7
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LGUQNXHD.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -132
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-I3USIAF6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-BTVNKKVQ.mjs.map +0 -7
- package/dist/lib/browser/settings-SLTQJJNF.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
- package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +0 -10
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +0 -1
- package/dist/types/src/containers/DebugSettings/index.d.ts +0 -3
- package/dist/types/src/containers/DebugSettings/index.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -68
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -441
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/react-context/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/settings/index.ts +0 -7
- package/src/containers/DebugSettings/DebugSettings.tsx +0 -201
- package/src/containers/DebugSettings/index.ts +0 -7
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +0 -0
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import { Filter as Filter3, Obj as Obj2 } from "@dxos/echo";
|
|
6
|
-
import { Markdown as Markdown3 } from "@dxos/plugin-markdown/types";
|
|
7
|
-
import { Sheet as Sheet2 } from "@dxos/plugin-sheet/types";
|
|
8
|
-
import { Diagram as Diagram2 } from "@dxos/plugin-sketch/types";
|
|
9
|
-
import { useClient } from "@dxos/react-client";
|
|
10
|
-
import { IconButton as IconButton2, Input, Panel, ScrollArea, Toolbar, useAsyncEffect } from "@dxos/react-ui";
|
|
11
|
-
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
12
|
-
import { Organization as Organization2, Person as Person2, Task } from "@dxos/types";
|
|
13
|
-
import { jsonKeyReplacer, sortKeys } from "@dxos/util";
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/components/index.ts
|
|
4
|
+
import { lazy } from "react";
|
|
14
5
|
|
|
15
6
|
// src/components/SchemaTable/SchemaTable.tsx
|
|
16
7
|
import React from "react";
|
|
@@ -38,16 +29,15 @@ var SchemaTable = ({ types, objects = {}, label, onClick }) => {
|
|
|
38
29
|
|
|
39
30
|
// src/components/SpaceGenerator/presets.ts
|
|
40
31
|
import * as Schema from "effect/Schema";
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
32
|
+
import { AgentPrompt, WebSearchBlueprint } from "@dxos/assistant-toolkit";
|
|
33
|
+
import { Routine, Trigger, Operation } from "@dxos/compute";
|
|
43
34
|
import { NODE_INPUT } from "@dxos/conductor";
|
|
44
35
|
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, Ref, Tag } from "@dxos/echo";
|
|
45
|
-
import { Trigger, serializeFunction } from "@dxos/functions";
|
|
46
36
|
import { invariant } from "@dxos/invariant";
|
|
47
|
-
import {
|
|
48
|
-
import { Mailbox } from "@dxos/plugin-inbox
|
|
49
|
-
import { Markdown } from "@dxos/plugin-markdown
|
|
50
|
-
import { createAppend, createChat, createComputeGraph, createConstant, createFunction, createGpt,
|
|
37
|
+
import { InboxOperation } from "@dxos/plugin-inbox";
|
|
38
|
+
import { Mailbox } from "@dxos/plugin-inbox";
|
|
39
|
+
import { Markdown } from "@dxos/plugin-markdown";
|
|
40
|
+
import { createAppend, createChat, createComputeGraph, createConstant, createFeed, createFunction, createGpt, createRandom, createSurface, createTemplate, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
|
|
51
41
|
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from "@dxos/react-ui-canvas-editor";
|
|
52
42
|
import { ViewModel } from "@dxos/schema";
|
|
53
43
|
import { Message, Organization, Person, Pipeline } from "@dxos/types";
|
|
@@ -89,8 +79,8 @@ var generator = () => ({
|
|
|
89
79
|
label: "Investor"
|
|
90
80
|
}));
|
|
91
81
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
92
|
-
Obj.
|
|
93
|
-
Obj.getMeta(
|
|
82
|
+
Obj.update(doc, (doc2) => {
|
|
83
|
+
Obj.getMeta(doc2).tags = [
|
|
94
84
|
tagDxn
|
|
95
85
|
];
|
|
96
86
|
});
|
|
@@ -124,27 +114,13 @@ var generator = () => ({
|
|
|
124
114
|
[
|
|
125
115
|
"org-research-project",
|
|
126
116
|
async (space, n, cb) => {
|
|
127
|
-
const
|
|
128
|
-
const mailbox =
|
|
129
|
-
invariant(mailbox, "Mailbox
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
"mailbox",
|
|
135
|
-
"'Mailbox feed not found'"
|
|
136
|
-
]
|
|
137
|
-
});
|
|
138
|
-
const queueDxn = Feed.getQueueDxn(mailbox)?.toString();
|
|
139
|
-
invariant(queueDxn, "Mailbox feed missing queue DXN key", {
|
|
140
|
-
F: __dxlog_file,
|
|
141
|
-
L: 123,
|
|
142
|
-
S: void 0,
|
|
143
|
-
A: [
|
|
144
|
-
"queueDxn",
|
|
145
|
-
"'Mailbox feed missing queue DXN key'"
|
|
146
|
-
]
|
|
147
|
-
});
|
|
117
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
118
|
+
const mailbox = mailboxes[0];
|
|
119
|
+
invariant(mailbox, "Mailbox not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 100, S: void 0, A: ["mailbox", "'Mailbox not found'"] });
|
|
120
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
121
|
+
invariant(mailboxFeed, "Mailbox missing feed reference", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 102, S: void 0, A: ["mailboxFeed", "'Mailbox missing feed reference'"] });
|
|
122
|
+
const queueDxn = Feed.getQueueDxn(mailboxFeed)?.toString();
|
|
123
|
+
invariant(queueDxn, "Mailbox feed missing queue DXN key", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 104, S: void 0, A: ["queueDxn", "'Mailbox feed missing queue DXN key'"] });
|
|
148
124
|
const tag = await space.db.query(Filter.type(Tag.Tag, {
|
|
149
125
|
label: "Investor"
|
|
150
126
|
})).first();
|
|
@@ -155,28 +131,13 @@ var generator = () => ({
|
|
|
155
131
|
const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(tagDxn));
|
|
156
132
|
space.db.add(Trigger.make({
|
|
157
133
|
enabled: true,
|
|
158
|
-
spec:
|
|
159
|
-
|
|
160
|
-
cron: "* * * * *"
|
|
161
|
-
},
|
|
162
|
-
function: Ref.make(serializeFunction(GmailFunctions.Sync)),
|
|
134
|
+
spec: Trigger.specTimer("* * * * *"),
|
|
135
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
163
136
|
input: {
|
|
164
137
|
mailbox: Ref.make(mailbox)
|
|
165
138
|
}
|
|
166
139
|
}));
|
|
167
|
-
space.db.add(
|
|
168
|
-
enabled: true,
|
|
169
|
-
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
170
|
-
spec: {
|
|
171
|
-
kind: "queue",
|
|
172
|
-
queue: queueDxn
|
|
173
|
-
},
|
|
174
|
-
function: Ref.make(serializeFunction(EntityExtractionFunctions.Extract)),
|
|
175
|
-
input: {
|
|
176
|
-
source: "{{event.item}}"
|
|
177
|
-
}
|
|
178
|
-
}));
|
|
179
|
-
const researchPrompt = space.db.add(Prompt.make({
|
|
140
|
+
const researchPrompt = space.db.add(Routine.make({
|
|
180
141
|
name: "Research",
|
|
181
142
|
description: "Research organization",
|
|
182
143
|
input: Schema.Struct({
|
|
@@ -191,18 +152,13 @@ var generator = () => ({
|
|
|
191
152
|
NOTE: Do mocked reseach (set mockSearch to true).
|
|
192
153
|
`,
|
|
193
154
|
blueprints: [
|
|
194
|
-
Ref.make(
|
|
155
|
+
Ref.make(WebSearchBlueprint.make())
|
|
195
156
|
]
|
|
196
157
|
}));
|
|
197
158
|
space.db.add(Trigger.make({
|
|
198
159
|
enabled: true,
|
|
199
|
-
spec:
|
|
200
|
-
|
|
201
|
-
query: {
|
|
202
|
-
ast: organizationsQuery.ast
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
function: Ref.make(serializeFunction(AgentFunctions.Prompt)),
|
|
160
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
161
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
206
162
|
input: {
|
|
207
163
|
prompt: Ref.make(researchPrompt),
|
|
208
164
|
input: "{{event.subject}}"
|
|
@@ -327,7 +283,7 @@ var generator = () => ({
|
|
|
327
283
|
async (space, n, cb) => {
|
|
328
284
|
const objects = range(n, () => {
|
|
329
285
|
const { canvasModel, computeModel } = createQueueSinkPreset(space, "subscription", (triggerSpec) => triggerSpec.query = {
|
|
330
|
-
ast: Query.select(Filter.typename("dxos.
|
|
286
|
+
ast: Query.select(Filter.typename("org.dxos.type.chess")).ast
|
|
331
287
|
}, "type");
|
|
332
288
|
return addToSpace("objectChange-queue", space, canvasModel, computeModel);
|
|
333
289
|
});
|
|
@@ -623,7 +579,7 @@ var generator = () => ({
|
|
|
623
579
|
x: 12,
|
|
624
580
|
y: 0
|
|
625
581
|
})));
|
|
626
|
-
const queue = canvasModel.createNode(
|
|
582
|
+
const queue = canvasModel.createNode(createFeed(position({
|
|
627
583
|
x: 0,
|
|
628
584
|
y: 12
|
|
629
585
|
})));
|
|
@@ -698,7 +654,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
698
654
|
width: 128,
|
|
699
655
|
height: 122
|
|
700
656
|
})));
|
|
701
|
-
const
|
|
657
|
+
const random2 = canvasModel.createNode(createRandom(rawPosition({
|
|
702
658
|
centerX: -509,
|
|
703
659
|
centerY: -30,
|
|
704
660
|
width: 64,
|
|
@@ -718,36 +674,20 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
718
674
|
output: triggerOutputName,
|
|
719
675
|
input: "type"
|
|
720
676
|
}).createEdge({
|
|
721
|
-
source:
|
|
677
|
+
source: random2.id,
|
|
722
678
|
target: template.id,
|
|
723
679
|
input: "changeId"
|
|
724
680
|
});
|
|
725
681
|
functionTrigger = triggerShape.functionTrigger.target;
|
|
726
682
|
const triggerSpec = functionTrigger.spec;
|
|
727
|
-
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", {
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
S: void 0,
|
|
731
|
-
A: [
|
|
732
|
-
"triggerSpec && triggerSpec.kind === triggerKind",
|
|
733
|
-
"'No trigger spec.'"
|
|
734
|
-
]
|
|
735
|
-
});
|
|
736
|
-
Obj.change(functionTrigger, (ft) => {
|
|
737
|
-
initSpec(ft.spec);
|
|
683
|
+
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 665, S: void 0, A: ["triggerSpec && triggerSpec.kind === triggerKind", "'No trigger spec.'"] });
|
|
684
|
+
Obj.update(functionTrigger, (functionTrigger2) => {
|
|
685
|
+
initSpec(functionTrigger2.spec);
|
|
738
686
|
});
|
|
739
687
|
});
|
|
740
688
|
const computeModel = createComputeGraph(canvasModel);
|
|
741
689
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
742
|
-
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
743
|
-
F: __dxlog_file,
|
|
744
|
-
L: 771,
|
|
745
|
-
S: void 0,
|
|
746
|
-
A: [
|
|
747
|
-
"templateComputeNode",
|
|
748
|
-
"'Template compute node was not created.'"
|
|
749
|
-
]
|
|
750
|
-
});
|
|
690
|
+
invariant(templateComputeNode, "Template compute node was not created.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 672, S: void 0, A: ["templateComputeNode", "'Template compute node was not created.'"] });
|
|
751
691
|
templateComputeNode.value = [
|
|
752
692
|
"{",
|
|
753
693
|
' "@type": "{{type}}",',
|
|
@@ -785,7 +725,7 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
785
725
|
height: 6
|
|
786
726
|
})
|
|
787
727
|
}));
|
|
788
|
-
const queue = canvasModel.createNode(
|
|
728
|
+
const queue = canvasModel.createNode(createFeed(args?.queuePosition ? rawPosition(args.queuePosition) : position({
|
|
789
729
|
x: -3,
|
|
790
730
|
y: 3,
|
|
791
731
|
width: 14,
|
|
@@ -801,19 +741,11 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
801
741
|
};
|
|
802
742
|
};
|
|
803
743
|
var attachTrigger = (functionTrigger, computeModel) => {
|
|
804
|
-
invariant(functionTrigger, void 0, {
|
|
805
|
-
F: __dxlog_file,
|
|
806
|
-
L: 813,
|
|
807
|
-
S: void 0,
|
|
808
|
-
A: [
|
|
809
|
-
"functionTrigger",
|
|
810
|
-
""
|
|
811
|
-
]
|
|
812
|
-
});
|
|
744
|
+
invariant(functionTrigger, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 727, S: void 0, A: ["functionTrigger", ""] });
|
|
813
745
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT);
|
|
814
|
-
Obj.
|
|
815
|
-
|
|
816
|
-
|
|
746
|
+
Obj.update(functionTrigger, (functionTrigger2) => {
|
|
747
|
+
functionTrigger2.function = Ref.make(computeModel.root);
|
|
748
|
+
functionTrigger2.inputNodeId = inputNode.id;
|
|
817
749
|
});
|
|
818
750
|
};
|
|
819
751
|
var rawPosition = (args) => {
|
|
@@ -861,19 +793,19 @@ var position = (rect) => {
|
|
|
861
793
|
};
|
|
862
794
|
|
|
863
795
|
// src/components/SpaceGenerator/ObjectGenerator.tsx
|
|
864
|
-
import { addressToA1Notation } from "@dxos/compute";
|
|
796
|
+
import { addressToA1Notation } from "@dxos/compute-hyperformula";
|
|
865
797
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT as NODE_INPUT2, NODE_OUTPUT } from "@dxos/conductor";
|
|
866
798
|
import { DXN as DXN2, Filter as Filter2, Key as Key2 } from "@dxos/echo";
|
|
867
799
|
import { View } from "@dxos/echo";
|
|
868
|
-
import { Markdown as Markdown2 } from "@dxos/plugin-markdown
|
|
869
|
-
import { Sheet } from "@dxos/plugin-sheet
|
|
870
|
-
import {
|
|
871
|
-
import { SpaceOperation } from "@dxos/plugin-space
|
|
872
|
-
import {
|
|
800
|
+
import { Markdown as Markdown2 } from "@dxos/plugin-markdown";
|
|
801
|
+
import { Sheet } from "@dxos/plugin-sheet";
|
|
802
|
+
import { Sketch } from "@dxos/plugin-sketch";
|
|
803
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
804
|
+
import { random } from "@dxos/random";
|
|
873
805
|
import { getTypenameFromQuery } from "@dxos/schema";
|
|
874
806
|
import { createAsyncGenerator } from "@dxos/schema/testing";
|
|
875
807
|
import { range as range2 } from "@dxos/util";
|
|
876
|
-
var generator2 =
|
|
808
|
+
var generator2 = random;
|
|
877
809
|
var findViewByTypename = async (views, typename) => {
|
|
878
810
|
return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
|
|
879
811
|
};
|
|
@@ -891,12 +823,6 @@ var createGenerator = (client, invokePromise, schema) => {
|
|
|
891
823
|
schema,
|
|
892
824
|
show: false
|
|
893
825
|
});
|
|
894
|
-
} else if (!view && staticSchema) {
|
|
895
|
-
await invokePromise(SpaceOperation.UseStaticSchema, {
|
|
896
|
-
db: space.db,
|
|
897
|
-
typename,
|
|
898
|
-
show: false
|
|
899
|
-
});
|
|
900
826
|
}
|
|
901
827
|
const generate = createAsyncGenerator(generator2, schema, {
|
|
902
828
|
db: space.db
|
|
@@ -910,8 +836,8 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
910
836
|
async (space, n, cb) => {
|
|
911
837
|
const objects = range2(n).map(() => {
|
|
912
838
|
return space.db.add(Markdown2.make({
|
|
913
|
-
name:
|
|
914
|
-
content:
|
|
839
|
+
name: random.commerce.productName(),
|
|
840
|
+
content: random.lorem.sentences(5)
|
|
915
841
|
}));
|
|
916
842
|
});
|
|
917
843
|
cb?.(objects);
|
|
@@ -919,11 +845,11 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
919
845
|
}
|
|
920
846
|
],
|
|
921
847
|
[
|
|
922
|
-
|
|
848
|
+
Sketch.Sketch.typename,
|
|
923
849
|
async (space, n, cb) => {
|
|
924
850
|
const objects = range2(n).map(() => {
|
|
925
|
-
const obj = space.db.add(
|
|
926
|
-
name:
|
|
851
|
+
const obj = space.db.add(Sketch.make({
|
|
852
|
+
name: random.commerce.productName()
|
|
927
853
|
}));
|
|
928
854
|
return obj;
|
|
929
855
|
});
|
|
@@ -970,7 +896,7 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
970
896
|
}
|
|
971
897
|
}
|
|
972
898
|
return space.db.add(Sheet.make({
|
|
973
|
-
name:
|
|
899
|
+
name: random.commerce.productName(),
|
|
974
900
|
cells
|
|
975
901
|
}));
|
|
976
902
|
});
|
|
@@ -1042,133 +968,14 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
1042
968
|
]
|
|
1043
969
|
]);
|
|
1044
970
|
|
|
1045
|
-
// src/
|
|
1046
|
-
var
|
|
1047
|
-
const { invokePromise } = useOperationInvoker();
|
|
1048
|
-
const client = useClient();
|
|
1049
|
-
const staticTypes = [
|
|
1050
|
-
Markdown3.Document,
|
|
1051
|
-
Diagram2.Diagram,
|
|
1052
|
-
Sheet2.Sheet,
|
|
1053
|
-
ComputeGraph2
|
|
1054
|
-
];
|
|
1055
|
-
const recordTypes = [
|
|
1056
|
-
Organization2.Organization,
|
|
1057
|
-
Person2.Person,
|
|
1058
|
-
Task.Task
|
|
1059
|
-
];
|
|
1060
|
-
const [count, setCount] = useState(1);
|
|
1061
|
-
const [info, setInfo] = useState({});
|
|
1062
|
-
const presets = useMemo(() => generator(), []);
|
|
1063
|
-
useAsyncEffect(async () => {
|
|
1064
|
-
await client.addTypes([
|
|
1065
|
-
...staticTypes,
|
|
1066
|
-
...recordTypes,
|
|
1067
|
-
...presets.schemas
|
|
1068
|
-
]);
|
|
1069
|
-
}, [
|
|
1070
|
-
client
|
|
1071
|
-
]);
|
|
1072
|
-
const typeMap = useMemo(() => {
|
|
1073
|
-
const recordGenerators = new Map(recordTypes.map((type) => [
|
|
1074
|
-
type.typename,
|
|
1075
|
-
createGenerator(client, invokePromise, type)
|
|
1076
|
-
]));
|
|
1077
|
-
return new Map([
|
|
1078
|
-
...staticGenerators,
|
|
1079
|
-
...presets.items,
|
|
1080
|
-
...recordGenerators
|
|
1081
|
-
]);
|
|
1082
|
-
}, [
|
|
1083
|
-
client,
|
|
1084
|
-
recordTypes,
|
|
1085
|
-
invokePromise
|
|
1086
|
-
]);
|
|
1087
|
-
const updateInfo = async () => {
|
|
1088
|
-
const echoSchema = await space.db.schemaRegistry.query().run();
|
|
1089
|
-
const staticSchema = await space.db.graph.schemaRegistry.query().run();
|
|
1090
|
-
const objects = await space.db.query(Filter3.everything()).run();
|
|
1091
|
-
const objectMap = sortKeys(objects.reduce((map, obj) => {
|
|
1092
|
-
const type = Obj2.getTypename(obj);
|
|
1093
|
-
if (type) {
|
|
1094
|
-
const count2 = map[type] ?? 0;
|
|
1095
|
-
map[type] = count2 + 1;
|
|
1096
|
-
}
|
|
1097
|
-
return map;
|
|
1098
|
-
}, {}));
|
|
1099
|
-
setInfo({
|
|
1100
|
-
schema: {
|
|
1101
|
-
static: staticSchema.length,
|
|
1102
|
-
mutable: echoSchema.length
|
|
1103
|
-
},
|
|
1104
|
-
objects: objectMap
|
|
1105
|
-
});
|
|
1106
|
-
};
|
|
1107
|
-
useAsyncEffect(updateInfo, [
|
|
1108
|
-
space
|
|
1109
|
-
]);
|
|
1110
|
-
const handleCreateData = useCallback(async (typename) => {
|
|
1111
|
-
const constructor = typeMap.get(typename);
|
|
1112
|
-
if (constructor) {
|
|
1113
|
-
await constructor(space, count, onCreateObjects);
|
|
1114
|
-
await updateInfo();
|
|
1115
|
-
}
|
|
1116
|
-
}, [
|
|
1117
|
-
typeMap,
|
|
1118
|
-
count
|
|
1119
|
-
]);
|
|
1120
|
-
return /* @__PURE__ */ React2.createElement(Panel.Root, null, /* @__PURE__ */ React2.createElement(Panel.Toolbar, {
|
|
1121
|
-
asChild: true
|
|
1122
|
-
}, /* @__PURE__ */ React2.createElement(Toolbar.Root, null, /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
1123
|
-
icon: "ph--arrow-clockwise--regular",
|
|
1124
|
-
iconOnly: true,
|
|
1125
|
-
label: "Refresh",
|
|
1126
|
-
onClick: updateInfo
|
|
1127
|
-
}), /* @__PURE__ */ React2.createElement(Toolbar.Separator, null), /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
1128
|
-
type: "number",
|
|
1129
|
-
placeholder: "Count",
|
|
1130
|
-
classNames: "w-[4rem] text-right",
|
|
1131
|
-
min: 1,
|
|
1132
|
-
max: 100,
|
|
1133
|
-
size: 8,
|
|
1134
|
-
value: count,
|
|
1135
|
-
onChange: (event) => setCount(parseInt(event.target.value))
|
|
1136
|
-
})))), /* @__PURE__ */ React2.createElement(Panel.Content, {
|
|
1137
|
-
asChild: true
|
|
1138
|
-
}, /* @__PURE__ */ React2.createElement(ScrollArea.Root, {
|
|
1139
|
-
thin: true,
|
|
1140
|
-
orientation: "vertical"
|
|
1141
|
-
}, /* @__PURE__ */ React2.createElement(ScrollArea.Viewport, {
|
|
1142
|
-
classNames: "gap-4 divide-y divide-subdued-separator"
|
|
1143
|
-
}, /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1144
|
-
types: staticTypes,
|
|
1145
|
-
objects: info.objects,
|
|
1146
|
-
label: "Static Types",
|
|
1147
|
-
onClick: handleCreateData
|
|
1148
|
-
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1149
|
-
types: recordTypes,
|
|
1150
|
-
objects: info.objects,
|
|
1151
|
-
label: "Record Types",
|
|
1152
|
-
onClick: handleCreateData
|
|
1153
|
-
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1154
|
-
types: presets.types,
|
|
1155
|
-
objects: info.objects,
|
|
1156
|
-
label: "Presets",
|
|
1157
|
-
onClick: handleCreateData
|
|
1158
|
-
}), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
1159
|
-
language: "json",
|
|
1160
|
-
classNames: "text-xs"
|
|
1161
|
-
}, JSON.stringify({
|
|
1162
|
-
space,
|
|
1163
|
-
...info
|
|
1164
|
-
}, jsonKeyReplacer({
|
|
1165
|
-
truncate: true
|
|
1166
|
-
}), 2))))));
|
|
1167
|
-
};
|
|
1168
|
-
|
|
1169
|
-
// src/containers/SpaceGenerator/index.ts
|
|
1170
|
-
var SpaceGenerator_default = SpaceGenerator;
|
|
971
|
+
// src/components/index.ts
|
|
972
|
+
var DebugSettings = lazy(() => import("../DebugSettings-Z3XADRNK.mjs"));
|
|
1171
973
|
export {
|
|
1172
|
-
|
|
974
|
+
DebugSettings,
|
|
975
|
+
PresetName,
|
|
976
|
+
SchemaTable,
|
|
977
|
+
createGenerator,
|
|
978
|
+
generator,
|
|
979
|
+
staticGenerators
|
|
1173
980
|
};
|
|
1174
|
-
//# sourceMappingURL=
|
|
981
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/index.ts", "../../../../src/components/SchemaTable/SchemaTable.tsx", "../../../../src/components/SpaceGenerator/presets.ts", "../../../../src/components/SpaceGenerator/ObjectGenerator.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));\n\nexport * from './SchemaTable';\nexport * from './SpaceGenerator';\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { IconButton } from '@dxos/react-ui';\n\nexport type SchemaTableProps = {\n types: any[];\n objects?: Record<string, number | undefined>;\n label: string;\n onClick: (typename: string) => void;\n};\n\nexport const SchemaTable = ({ types, objects = {}, label, onClick }: SchemaTableProps) => {\n return (\n <div className='grid grid-cols-[1fr_80px_40px] gap-1 overflow-none'>\n <h2 className='p-2'>{label}</h2>\n {types.map((type) => (\n <div key={type.typename} className='grid grid-cols-subgrid col-span-3 items-center'>\n <div className='px-2 text-sm font-mono text-subdued'>{type.typename}</div>\n <div className='px-2 text-right font-mono'>{objects[type.typename] ?? 0}</div>\n <IconButton\n variant='ghost'\n icon='ph--plus--regular'\n iconOnly\n label='Create data'\n onClick={() => onClick(type.typename)}\n />\n </div>\n ))}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AgentPrompt, WebSearchBlueprint } from '@dxos/assistant-toolkit';\nimport { Routine, Trigger, Operation } from '@dxos/compute';\nimport { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';\nimport { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { InboxOperation } from '@dxos/plugin-inbox';\nimport { Mailbox } from '@dxos/plugin-inbox';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { type Space } from '@dxos/react-client/echo';\nimport {\n type ComputeShape,\n createAppend,\n createChat,\n createComputeGraph,\n createConstant,\n createFeed,\n createFunction,\n createGpt,\n createRandom,\n createSurface,\n createTemplate,\n createText,\n createTrigger,\n} from '@dxos/react-ui-canvas-compute';\nimport { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';\nimport { ViewModel } from '@dxos/schema';\nimport { Message, Organization, Person, Pipeline } from '@dxos/types';\nimport { range, trim } from '@dxos/util';\n\nimport { type ObjectGenerator } from './ObjectGenerator';\n\nexport enum PresetName {\n DXOS_TEAM = 'dxos-team',\n ORG_RESEARCH_PROJECT = 'org-research-project',\n // EMAIL_TABLE = 'email-table',\n GPT_QUEUE = 'webhook-gpt-queue',\n CHAT_GPT = 'chat-gpt-text',\n // EMAIL_WITH_SUMMARY = 'email-gptSummary-table',\n OBJECT_CHANGE_QUEUE = 'objectChange-queue',\n TIMER_TICK_QUEUE = 'timerTick-queue',\n FOREX_FUNCTION_CALL = 'forex-function-call',\n DISCORD_MESSAGES = 'discord-messages',\n // KANBAN_QUEUE = 'kanban-queue',\n}\n\nexport const generator = () => ({\n schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],\n types: Object.values(PresetName).map((name) => ({ typename: name })),\n items: [\n [\n PresetName.DXOS_TEAM,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const org = space.db.add(\n Obj.make(Organization.Organization, {\n name: 'DXOS',\n website: 'https://dxos.org',\n }),\n );\n const doc = space.db.add(\n Markdown.make({\n name: 'DXOS Research',\n content: 'DXOS builds Composer, an open-source AI-powered malleable application.',\n }),\n );\n\n const tag = space.db.add(Tag.make({ label: 'Investor' }));\n const tagDxn = Obj.getDXN(tag).toString();\n Obj.update(doc, (doc) => {\n Obj.getMeta(doc).tags = [tagDxn];\n });\n\n // space.db.add(\n // Relation.make(HasSubject, {\n // [Relation.Source]: doc,\n // [Relation.Target]: org,\n // completedAt: new Date().toISOString(),\n // }),\n // );\n\n space.db.add(\n Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),\n );\n space.db.add(\n Obj.make(Person.Person, {\n fullName: 'Josiah',\n organization: Ref.make(org),\n }),\n );\n space.db.add(\n Obj.make(Person.Person, {\n fullName: 'Dima',\n organization: Ref.make(org),\n }),\n );\n space.db.add(\n Obj.make(Person.Person, {\n fullName: 'Mykola',\n organization: Ref.make(org),\n }),\n );\n\n return doc;\n });\n cb?.(objects);\n return objects;\n },\n ],\n [\n PresetName.ORG_RESEARCH_PROJECT,\n async (space, n, cb) => {\n const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();\n const mailbox = mailboxes[0];\n invariant(mailbox, 'Mailbox not found');\n const mailboxFeed = await mailbox.feed?.tryLoad();\n invariant(mailboxFeed, 'Mailbox missing feed reference');\n const queueDxn = Feed.getQueueDxn(mailboxFeed)?.toString();\n invariant(queueDxn, 'Mailbox feed missing queue DXN key');\n const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();\n const tagDxn = Obj.getDXN(tag).toString();\n\n const objects = range(n, () => {\n const contactsQuery = Query.select(Filter.type(Person.Person)).select(Filter.tag(tagDxn));\n const organizationsQuery = Query.select(Filter.type(Organization.Organization)).select(Filter.tag(tagDxn));\n const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(tagDxn));\n\n space.db.add(\n Trigger.make({\n enabled: true,\n spec: Trigger.specTimer('* * * * *'), // Every minute.\n function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),\n input: {\n mailbox: Ref.make(mailbox),\n },\n }),\n );\n\n const researchPrompt = space.db.add(\n Routine.make({\n name: 'Research',\n description: 'Research organization',\n input: Schema.Struct({\n org: Schema.Any,\n }),\n output: Schema.Any,\n\n // TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.\n // Remove the mock prompt to do the actual research.\n instructions: trim`\n Research the organization provided as input.\n Create a research note for it at the end.\n NOTE: Do mocked reseach (set mockSearch to true).\n `,\n blueprints: [Ref.make(WebSearchBlueprint.make())],\n }),\n );\n\n space.db.add(\n Trigger.make({\n enabled: true,\n spec: Trigger.specSubscription(organizationsQuery),\n function: Ref.make(Operation.serialize(AgentPrompt)),\n input: {\n prompt: Ref.make(researchPrompt),\n input: '{{event.subject}}',\n },\n }),\n );\n\n const mailboxView = ViewModel.make({\n query: Query.select(\n Filter.type(Message.Message, {\n properties: { labels: Filter.contains('investor') },\n }),\n ).from({\n queues: [queueDxn],\n }),\n jsonSchema: JsonSchema.toJsonSchema(Message.Message),\n });\n const contactsView = ViewModel.make({\n query: contactsQuery,\n jsonSchema: JsonSchema.toJsonSchema(Person.Person),\n });\n const organizationsView = ViewModel.make({\n query: organizationsQuery,\n jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),\n });\n const notesView = ViewModel.make({\n query: notesQuery,\n jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),\n });\n\n return space.db.add(\n Pipeline.make({\n name: 'Investor Research',\n columns: [\n {\n name: 'Mailbox',\n view: Ref.make(mailboxView),\n order: [],\n },\n {\n name: 'Contacts',\n view: Ref.make(contactsView),\n order: [],\n },\n {\n name: 'Organizations',\n view: Ref.make(organizationsView),\n order: [],\n },\n {\n name: 'Notes',\n view: Ref.make(notesView),\n order: [],\n },\n ],\n }),\n );\n });\n\n cb?.(objects.flat());\n return objects.flat();\n },\n ],\n [\n PresetName.GPT_QUEUE,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n let functionTrigger: Trigger.Trigger | undefined;\n canvasModel.builder.call((builder) => {\n const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));\n const triggerShape = createTrigger({\n spaceId: space.id,\n triggerKind: 'webhook',\n ...position({ x: -18, y: -2 }),\n });\n const trigger = canvasModel.createNode(triggerShape);\n const text = canvasModel.createNode(createText(position({ x: 19, y: 3, width: 10, height: 10 })));\n const { queueId } = setupQueue(space, canvasModel);\n const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));\n\n builder\n .createEdge({\n source: trigger.id,\n target: gpt.id,\n input: 'prompt',\n output: 'bodyText',\n })\n .createEdge({ source: gpt.id, target: text.id, output: 'text' })\n .createEdge({\n source: queueId.id,\n target: append.id,\n input: 'id',\n })\n .createEdge({\n source: gpt.id,\n target: append.id,\n output: 'messages',\n input: 'items',\n });\n\n functionTrigger = triggerShape.functionTrigger!.target!;\n });\n\n const computeModel = createComputeGraph(canvasModel);\n\n attachTrigger(functionTrigger, computeModel);\n\n return addToSpace(PresetName.GPT_QUEUE, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n [\n PresetName.OBJECT_CHANGE_QUEUE,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const { canvasModel, computeModel } = createQueueSinkPreset(\n space,\n 'subscription',\n (triggerSpec) =>\n (triggerSpec.query = {\n ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,\n }),\n 'type',\n );\n return addToSpace(PresetName.OBJECT_CHANGE_QUEUE, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n [\n PresetName.TIMER_TICK_QUEUE,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const { canvasModel, computeModel } = createQueueSinkPreset(\n space,\n 'timer',\n (triggerSpec) => (triggerSpec.cron = '*/5 * * * * *'),\n 'result',\n );\n return addToSpace(PresetName.TIMER_TICK_QUEUE, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n // TODO(wittjosiah): Remove?\n // [\n // PresetName.EMAIL_TABLE,\n // async (space, n, cb) => {\n // const objects = range(n, () => {\n // const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n // const results = space.db.query(Filter.type(TableType)).runSync();\n // const emailTable = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith('Email'));\n // invariant(emailTable, 'Email table not found.');\n\n // const template = canvasModel.createNode(\n // createTemplate({\n // valueType: 'object',\n // ...rawPosition({ centerX: -80, centerY: -64, width: 320, height: 320 }),\n // }),\n // );\n // const templateContent = ['{'];\n\n // let functionTrigger: FunctionTrigger | undefined;\n // canvasModel.builder.call((builder) => {\n // const triggerShape = createTrigger({\n // spaceId: space.id,\n // triggerKind: 'email',\n // ...position({ x: -18, y: -2 }),\n // });\n // const trigger = canvasModel.createNode(triggerShape);\n\n // const tableId = canvasModel.createNode(\n // createConstant({\n // value: DXN.fromLocalObjectId(emailTable.id).toString(),\n // ...position({ x: -18, y: 5, width: 8, height: 6 }),\n // }),\n // );\n\n // const appendToTable = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));\n\n // const properties = SchemaAST.getPropertySignatures(EmailTriggerOutput.ast);\n // for (let i = 0; i < properties.length; i++) {\n // const propName = properties[i].name.toString();\n // builder.createEdge({ source: trigger.id, target: template.id, input: propName, output: propName });\n // templateContent.push(` \"${propName}\": \"{{${propName}}}\"` + (i === properties.length - 1 ? '' : ','));\n // }\n // templateContent.push('}');\n\n // builder\n // .createEdge({ source: tableId.id, target: appendToTable.id, input: 'id' })\n // .createEdge({ source: template.id, target: appendToTable.id, input: 'items' });\n\n // functionTrigger = triggerShape.functionTrigger!.target!;\n // });\n\n // const computeModel = createComputeGraph(canvasModel);\n\n // const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);\n // invariant(templateComputeNode, 'Template compute node was not created.');\n // templateComputeNode.value = templateContent.join('\\n');\n // templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);\n\n // attachTrigger(functionTrigger, computeModel);\n\n // return addToSpace(PresetName.EMAIL_TABLE, space, canvasModel, computeModel);\n // });\n // cb?.(objects);\n // return objects;\n // },\n // ],\n\n [\n PresetName.CHAT_GPT,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n canvasModel.builder.call((builder) => {\n const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));\n const chat = canvasModel.createNode(createChat(position({ x: -18, y: -2 })));\n const text = canvasModel.createNode(createText(position({ x: 19, y: 3, width: 10, height: 10 })));\n const { queueId } = setupQueue(space, canvasModel);\n\n const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));\n\n builder\n .createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })\n .createEdge({ source: gpt.id, target: text.id, output: 'text' })\n .createEdge({\n source: queueId.id,\n target: append.id,\n input: 'id',\n })\n .createEdge({\n source: gpt.id,\n target: append.id,\n output: 'messages',\n input: 'items',\n });\n });\n\n const computeModel = createComputeGraph(canvasModel);\n\n return addToSpace(PresetName.CHAT_GPT, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n // TODO(wittjosiah): Remove?\n // [\n // PresetName.EMAIL_WITH_SUMMARY,\n // async (space, n, cb) => {\n // const objects = range(n, () => {\n // const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n // const results = space.db.query(Filter.type(TableType)).runSync();\n // const emailTable = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith('Email'));\n // invariant(emailTable, 'Email table not found.');\n\n // const template = canvasModel.createNode(\n // createTemplate({\n // valueType: 'object',\n // ...rawPosition({ centerX: 192, centerY: -176, width: 320, height: 320 }),\n // }),\n // );\n // const templateContent = ['{'];\n\n // let functionTrigger: FunctionTrigger | undefined;\n // canvasModel.builder.call((builder) => {\n // const gpt = canvasModel.createNode(\n // createGpt(rawPosition({ centerX: -400, centerY: -112, width: 256, height: 202 })),\n // );\n // const systemPrompt = canvasModel.createNode(\n // createConstant({\n // value: \"use one word to describe content category. don't write anything else\",\n // ...rawPosition({ centerX: -800, centerY: -160, width: 192, height: 128 }),\n // }),\n // );\n // const triggerShape = createTrigger({\n // spaceId: space.id,\n // triggerKind: 'email',\n // ...rawPosition({ centerX: -736, centerY: -384, width: 182, height: 192 }),\n // });\n // const trigger = canvasModel.createNode(triggerShape);\n\n // const { queueId } = setupQueue(space, canvasModel, {\n // idPosition: { centerX: -720, centerY: 224, width: 192, height: 256 },\n // queuePosition: { centerX: -144, centerY: 416, width: 320, height: 448 },\n // });\n // const appendToQueue = canvasModel.createNode(\n // createAppend(rawPosition({ centerX: -80, centerY: 96, width: 122, height: 128 })),\n // );\n\n // const tableId = canvasModel.createNode(\n // createConstant({\n // value: DXN.fromLocalObjectId(emailTable.id).toString(),\n // ...rawPosition({ centerX: -112, centerY: -544, width: 192, height: 256 }),\n // }),\n // );\n\n // const appendToTable = canvasModel.createNode(\n // createAppend(rawPosition({ centerX: 560, centerY: -416, width: 128, height: 122 })),\n // );\n\n // templateContent.push(' \"category\": \"{{text}}\",');\n // builder.createEdge({ source: gpt.id, target: template.id, input: 'text', output: 'text' });\n\n // const properties = SchemaAST.getPropertySignatures(EmailTriggerOutput.ast);\n // for (let i = 0; i < properties.length; i++) {\n // const propName = properties[i].name.toString();\n // builder.createEdge({ source: trigger.id, target: template.id, input: propName, output: propName });\n // templateContent.push(` \"${propName}\": \"{{${propName}}}\"` + (i === properties.length - 1 ? '' : ','));\n // }\n // templateContent.push('}');\n\n // builder\n // .createEdge({ source: tableId.id, target: appendToTable.id, input: 'id' })\n // .createEdge({ source: queueId.id, target: appendToQueue.id, input: 'id' })\n // .createEdge({ source: gpt.id, target: appendToQueue.id, output: 'messages', input: 'items' })\n // .createEdge({ source: systemPrompt.id, target: gpt.id, input: 'systemPrompt' })\n // .createEdge({ source: trigger.id, target: gpt.id, input: 'prompt', output: 'body' })\n // .createEdge({ source: template.id, target: appendToTable.id, input: 'items' });\n\n // functionTrigger = triggerShape.functionTrigger!.target!;\n // });\n\n // const computeModel = createComputeGraph(canvasModel);\n\n // const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);\n // invariant(templateComputeNode, 'Template compute node was not created.');\n // templateComputeNode.value = templateContent.join('\\n');\n // const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));\n // templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);\n\n // attachTrigger(functionTrigger, computeModel);\n\n // return addToSpace(PresetName.EMAIL_WITH_SUMMARY, space, canvasModel, computeModel);\n // });\n // cb?.(objects);\n // return objects;\n // },\n // ],\n\n [\n PresetName.FOREX_FUNCTION_CALL,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n canvasModel.builder.call((builder) => {\n const sourceCurrency = canvasModel.createNode(\n createConstant({ value: 'USD', ...position({ x: -10, y: -5 }) }),\n );\n const targetCurrency = canvasModel.createNode(\n createConstant({ value: 'EUR', ...position({ x: -10, y: 5 }) }),\n );\n const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));\n const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));\n\n builder\n .createEdge({\n source: sourceCurrency.id,\n target: converter.id,\n input: 'from',\n })\n .createEdge({\n source: targetCurrency.id,\n target: converter.id,\n input: 'to',\n })\n .createEdge({\n source: converter.id,\n target: view.id,\n output: 'rate',\n });\n });\n\n const computeModel = createComputeGraph(canvasModel);\n\n return addToSpace(PresetName.FOREX_FUNCTION_CALL, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n [\n PresetName.DISCORD_MESSAGES,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n let functionTrigger: Trigger.Trigger | undefined;\n canvasModel.builder.call((builder) => {\n const triggerShape = createTrigger({\n spaceId: space.id,\n triggerKind: 'timer',\n ...position({ x: -10, y: -5 }),\n });\n const trigger = canvasModel.createNode(triggerShape);\n // DXOS dev-null channel.\n const channelId = canvasModel.createNode(\n createConstant({\n value: '1088569858767212554',\n ...position({ x: -10, y: 0 }),\n }),\n );\n const queueId = canvasModel.createNode(\n createConstant({\n value: new DXN(DXN.kind.QUEUE, ['data', space.id, Key.ObjectId.random()]).toString(),\n ...position({ x: -10, y: 5 }),\n }),\n );\n const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));\n const view = canvasModel.createNode(createText(position({ x: 12, y: 0 })));\n const queue = canvasModel.createNode(createFeed(position({ x: 0, y: 12 })));\n\n builder\n .createEdge({\n source: trigger.id,\n target: converter.id,\n input: 'tick',\n })\n .createEdge({\n source: channelId.id,\n target: converter.id,\n input: 'channelId',\n })\n .createEdge({\n source: queueId.id,\n target: converter.id,\n input: 'queueId',\n })\n .createEdge({\n source: converter.id,\n target: view.id,\n output: 'newMessages',\n })\n .createEdge({\n source: queueId.id,\n target: queue.id,\n input: 'input',\n });\n\n functionTrigger = triggerShape.functionTrigger!.target!;\n });\n\n const computeModel = createComputeGraph(canvasModel);\n attachTrigger(functionTrigger, computeModel);\n\n return addToSpace(PresetName.DISCORD_MESSAGES, space, canvasModel, computeModel);\n });\n cb?.(objects);\n return objects;\n },\n ],\n\n // TODO(wittjosiah): Remove?\n // [\n // PresetName.KANBAN_QUEUE,\n // async (space, n, cb) => {\n // const objects = range(n, () => {\n // const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n // // TODO(wittjosiah): Integrate directly w/ Kanban.\n // // const results = space.db.query(Filter.type(KanbanType)).runSync();\n // // const kanban = results.find((r) => r.object?.cardView?.target?.query?.type?.endsWith('Message'));\n // // invariant(kanban, 'Kanban not found.');\n\n // const results = space.db.query(Filter.type(TableType)).runSync();\n // const messages = results.find((r) => r.object?.view?.target?.query?.typename?.endsWith('Message'));\n // invariant(messages, 'Table not found.');\n\n // let functionTrigger: FunctionTrigger | undefined;\n // canvasModel.builder.call((builder) => {\n // const triggerShape = createTrigger({\n // spaceId: space.id,\n // triggerKind: 'queue',\n // ...position({ x: -10, y: -5 }),\n // });\n // const trigger = canvasModel.createNode(triggerShape);\n\n // const tableId = canvasModel.createNode(\n // createConstant({\n // value: DXN.fromLocalObjectId(messages.id).toString(),\n // ...position({ x: -10, y: 5 }),\n // }),\n // );\n // const appendToTable = canvasModel.createNode(createAppend(position({ x: 10, y: 0 })));\n\n // builder\n // .createEdge({ source: tableId.id, target: appendToTable.id, input: 'id' })\n // .createEdge({ source: trigger.id, target: appendToTable.id, input: 'items', output: 'item' });\n\n // functionTrigger = triggerShape.functionTrigger!.target!;\n // });\n\n // const computeModel = createComputeGraph(canvasModel);\n // attachTrigger(functionTrigger, computeModel);\n\n // return addToSpace(PresetName.KANBAN_QUEUE, space, canvasModel, computeModel);\n // });\n // cb?.(objects);\n // return objects;\n // },\n // ],\n ] as [PresetName, ObjectGenerator<any>][],\n});\n\nconst createQueueSinkPreset = <SpecType extends Trigger.Kind>(\n space: Space,\n triggerKind: SpecType,\n initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,\n triggerOutputName: string,\n) => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n const template = canvasModel.createNode(\n createTemplate({\n valueType: 'object',\n ...rawPosition({ centerX: -64, centerY: -79, width: 320, height: 320 }),\n }),\n );\n\n let functionTrigger: Trigger.Trigger | undefined;\n canvasModel.builder.call((builder) => {\n const triggerShape = createTrigger({\n spaceId: space.id,\n triggerKind,\n ...rawPosition({ centerX: -578, centerY: -187, height: 320, width: 320 }),\n });\n const trigger = canvasModel.createNode(triggerShape);\n const { queueId } = setupQueue(space, canvasModel, {\n queuePosition: { centerX: -80, centerY: 378, width: 320, height: 448 },\n });\n const append = canvasModel.createNode(\n createAppend(rawPosition({ centerX: 320, centerY: 192, width: 128, height: 122 })),\n );\n const random = canvasModel.createNode(\n createRandom(rawPosition({ centerX: -509, centerY: -30, width: 64, height: 64 })),\n );\n\n builder\n .createEdge({ source: queueId.id, target: append.id, input: 'id' })\n .createEdge({ source: template.id, target: append.id, input: 'items' })\n .createEdge({\n source: trigger.id,\n target: template.id,\n output: triggerOutputName,\n input: 'type',\n })\n .createEdge({\n source: random.id,\n target: template.id,\n input: 'changeId',\n });\n\n functionTrigger = triggerShape.functionTrigger!.target!;\n const triggerSpec = functionTrigger.spec;\n invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');\n Obj.update(functionTrigger, (functionTrigger) => {\n initSpec(functionTrigger.spec as any);\n });\n });\n\n const computeModel = createComputeGraph(canvasModel);\n\n const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);\n invariant(templateComputeNode, 'Template compute node was not created.');\n // NOTE: These are plain object mutations during model construction, not ECHO object mutations.\n templateComputeNode.value = ['{', ' \"@type\": \"{{type}}\",', ' \"id\": \"@{{changeId}}\"', '}'].join('\\n');\n templateComputeNode.inputSchema = JsonSchema.toJsonSchema(\n Schema.Struct({ type: Schema.String, changeId: Schema.String }),\n );\n attachTrigger(functionTrigger, computeModel);\n\n return { canvasModel, computeModel };\n};\n\nconst addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {\n return space.db.add(\n Obj.make(CanvasBoard.CanvasBoard, {\n name,\n computeGraph: Ref.make(compute.root),\n layout: canvas.graph,\n }),\n );\n};\n\nconst setupQueue = (\n space: Space,\n canvasModel: CanvasGraphModel,\n args?: { idPosition?: RawPositionInput; queuePosition?: RawPositionInput },\n) => {\n const queueId = canvasModel.createNode(\n createConstant({\n value: new DXN(DXN.kind.QUEUE, ['data', space.id, Key.ObjectId.random()]).toString(),\n ...(args?.idPosition ? rawPosition(args.idPosition) : position({ x: -18, y: 5, width: 8, height: 6 })),\n }),\n );\n const queue = canvasModel.createNode(\n createFeed(\n args?.queuePosition ? rawPosition(args.queuePosition) : position({ x: -3, y: 3, width: 14, height: 10 }),\n ),\n );\n canvasModel.createEdge({ source: queueId.id, target: queue.id });\n return { queue, queueId };\n};\n\nconst attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {\n invariant(functionTrigger);\n const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;\n Obj.update(functionTrigger, (functionTrigger) => {\n functionTrigger.function = Ref.make(computeModel.root);\n functionTrigger.inputNodeId = inputNode.id;\n });\n};\n\ntype RawPositionInput = {\n centerX: number;\n centerY: number;\n width: number;\n height: number;\n};\n\nconst rawPosition = (args: RawPositionInput) => {\n return {\n center: { x: args.centerX, y: args.centerY },\n size: { width: args.width, height: args.height },\n };\n};\n\nconst position = (rect: { x: number; y: number; width?: number; height?: number }) => {\n const snap = 32;\n const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });\n const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);\n if (width && height) {\n return {\n center: { x, y },\n size: width && height ? { width, height } : undefined,\n };\n } else {\n return { center: { x, y } };\n }\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport type * as Schema from 'effect/Schema';\n\nimport { addressToA1Notation } from '@dxos/compute-hyperformula';\nimport { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';\nimport { DXN, Filter, Key, type Type } from '@dxos/echo';\nimport { View } from '@dxos/echo';\nimport { OperationInvoker } from '@dxos/operation';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { Sheet } from '@dxos/plugin-sheet';\nimport { Sketch } from '@dxos/plugin-sketch';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { random } from '@dxos/random';\nimport { type Client } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\nimport { getTypenameFromQuery } from '@dxos/schema';\nimport { type ValueGenerator, createAsyncGenerator } from '@dxos/schema/testing';\nimport { range } from '@dxos/util';\n\nconst generator: ValueGenerator = random as any;\n\nconst findViewByTypename = async (views: View.View[], typename: string) => {\n return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);\n};\n\nexport type ObjectGenerator<T> = (space: Space, n: number, cb?: (objects: T[]) => void) => Promise<T[]>;\n\nexport const createGenerator = <S extends Type.AnyObj>(\n client: Client,\n invokePromise: OperationInvoker.OperationInvoker['invokePromise'],\n schema: S,\n): ObjectGenerator<Schema.Schema.Type<S>> => {\n return async (space: Space, n: number): Promise<Schema.Schema.Type<S>[]> => {\n const typename = schema.typename;\n\n // Find or create table and view.\n const views = await space.db.query(Filter.type(View.View)).run();\n const view = await findViewByTypename(views, typename);\n const staticSchema = client?.graph.schemaRegistry.query({ typename }).runSync()[0];\n if (!view && !staticSchema) {\n await invokePromise(SpaceOperation.AddSchema, { db: space.db, schema, show: false });\n }\n\n // Create objects.\n const generate = createAsyncGenerator(generator, schema, { db: space.db });\n return generate.createObjects(n);\n };\n};\n\nexport const staticGenerators = new Map<string, ObjectGenerator<any>>([\n [\n Markdown.Document.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n return space.db.add(\n Markdown.make({\n name: random.commerce.productName(),\n content: random.lorem.sentences(5),\n }),\n );\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n [\n Sketch.Sketch.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n const obj = space.db.add(Sketch.make({ name: random.commerce.productName() }));\n return obj;\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n // TODO(burdon): Create unit tests.\n [\n Sheet.Sheet.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n const cells: Record<string, Sheet.CellValue> = {};\n const year = new Date().getFullYear();\n const cols = 4;\n const rows = 16;\n for (let col = 1; col <= cols; col++) {\n for (let row = 1; row <= rows; row++) {\n const cell = addressToA1Notation({ col, row });\n if (row === 1) {\n cells[cell] = { value: `${year} Q${col}` };\n } else if (row === rows) {\n const from = addressToA1Notation({ col, row: 2 });\n const to = addressToA1Notation({ col, row: rows - 1 });\n cells[cell] = { value: `=SUM(${from}:${to})` };\n } else if (row > 2 && row < rows - 1) {\n cells[cell] = { value: Math.floor(Math.random() * 10_000) };\n }\n }\n }\n\n // TODO(burdon): Set width.\n // TODO(burdon): Set formatting for columns.\n return space.db.add(\n Sheet.make({\n name: random.commerce.productName(),\n cells,\n }),\n );\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n [\n ComputeGraph.typename,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const model = ComputeGraphModel.create();\n model.builder\n .createNode({ id: 'gpt-INPUT', type: NODE_INPUT })\n .createNode({ id: 'gpt-GPT', type: 'gpt' })\n .createNode({\n id: 'gpt-QUEUE_ID',\n type: 'constant',\n value: new DXN(DXN.kind.QUEUE, ['data', space.id, Key.ObjectId.random()]).toString(),\n })\n .createNode({ id: 'gpt-APPEND', type: 'append' })\n .createNode({ id: 'gpt-OUTPUT', type: NODE_OUTPUT })\n .createEdge({ node: 'gpt-INPUT', property: 'prompt' }, { node: 'gpt-GPT', property: 'prompt' })\n .createEdge({ node: 'gpt-GPT', property: 'text' }, { node: 'gpt-OUTPUT', property: 'text' })\n .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-APPEND', property: 'id' })\n .createEdge({ node: 'gpt-GPT', property: 'messages' }, { node: 'gpt-APPEND', property: 'items' })\n .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-OUTPUT', property: 'queue' });\n\n return space.db.add(model.root);\n });\n cb?.(objects);\n return objects;\n },\n ],\n]);\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAA6BA,YAAY;;;ACAzC,OAAOC,WAAW;AAElB,SAASC,kBAAkB;AASpB,IAAMC,cAAc,CAAC,EAAEC,OAAOC,UAAU,CAAC,GAAGC,OAAOC,QAAO,MAAoB;AACnF,SACE,sBAAA,cAACC,OAAAA;IAAIC,WAAU;KACb,sBAAA,cAACC,MAAAA;IAAGD,WAAU;KAAOH,KAAAA,GACpBF,MAAMO,IAAI,CAACC,SACV,sBAAA,cAACJ,OAAAA;IAAIK,KAAKD,KAAKE;IAAUL,WAAU;KACjC,sBAAA,cAACD,OAAAA;IAAIC,WAAU;KAAuCG,KAAKE,QAAQ,GACnE,sBAAA,cAACN,OAAAA;IAAIC,WAAU;KAA6BJ,QAAQO,KAAKE,QAAQ,KAAK,CAAA,GACtE,sBAAA,cAACZ,YAAAA;IACCa,SAAQ;IACRC,MAAK;IACLC,UAAAA;IACAX,OAAM;IACNC,SAAS,MAAMA,QAAQK,KAAKE,QAAQ;;AAMhD;;;AC9BA,Y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UhF;QAAe,GAAG;UAAE+E,MAAM;UAAcC,UAAU;QAAK,CAAA,EACpGF,WAAW;UAAEC,MAAM;UAAWC,UAAU;QAAW,GAAG;UAAED,MAAM;UAAcC,UAAU;QAAQ,CAAA,EAC9FF,WAAW;UAAEC,MAAM;UAAgBC,UAAUhF;QAAe,GAAG;UAAE+E,MAAM;UAAcC,UAAU;QAAQ,CAAA;AAE1G,eAAOrD,MAAME,GAAGiB,IAAIuB,MAAMY,IAAI;MAChC,CAAA;AACAtC,WAAKC,OAAAA;AACL,aAAOA;IACT;;CAEH;;;AH5IM,IAAMsC,gBAAoCC,KAAK,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "React", "IconButton", "SchemaTable", "types", "objects", "label", "onClick", "div", "className", "h2", "map", "type", "key", "typename", "variant", "icon", "iconOnly", "Schema", "AgentPrompt", "WebSearchBlueprint", "Routine", "Trigger", "Operation", "NODE_INPUT", "DXN", "Feed", "Filter", "JsonSchema", "Key", "Obj", "Query", "Ref", "Tag", "invariant", "InboxOperation", "Mailbox", "Markdown", "createAppend", "createChat", "createComputeGraph", "createConstant", "createFeed", "createFunction", "createGpt", "createRandom", "createSurface", "createTemplate", "createText", "createTrigger", "CanvasBoard", "CanvasGraphModel", "pointMultiply", "pointsToRect", "rectToPoints", "ViewModel", "Message", "Organization", "Person", "Pipeline", "range", "trim", "PresetName", "types", "Object", "org", "space", "website", "content", "tagDxn", "doc", "tags", "fullName", "organization", "make", "cb", "objects", "mailbox", "mailboxes", "mailboxFeed", "queueDxn", "getQueueDxn", "toString", "tag", "label", "first", "contactsQuery", "organizationsQuery", "notesQuery", "select", "type", "Document", "db", "enabled", "spec", "specTimer", "function", "input", "description", "output", "Any", "specSubscription", "prompt", "researchPrompt", "labels", "contains", "queues", "jsonSchema", "contactsView", "toJsonSchema", "organizationsView", "notesView", "add", "columns", "name", "order", "canvasModel", "functionTrigger", "call", "builder", "y", "triggerShape", "triggerKind", "position", "x", "width", "height", "queueId", "target", "createEdge", "source", "gpt", "text", "append", "attachTrigger", "addToSpace", "ast", "computeModel", "createNode", "chat", "sourceCurrency", "value", "view", "converter", "spaceId", "channelId", "id", "queue", "createQueueSinkPreset", "valueType", "rawPosition", "centerX", "queuePosition", "centerY", "random", "template", "triggerOutputName", "triggerSpec", "update", "initSpec", "templateComputeNode", "join", "computeGraph", "compute", "layout", "setupQueue", "kind", "args", "idPosition", "node", "root", "inputNodeId", "size", "center", "snap", "undefined", "addressToA1Notation", "ComputeGraph", "ComputeGraphModel", "DEFAULT_OUTPUT", "NODE_INPUT", "NODE_OUTPUT", "DXN", "Filter", "Key", "View", "Markdown", "Sheet", "Sketch", "SpaceOperation", "random", "getTypenameFromQuery", "createAsyncGenerator", "range", "generator", "findViewByTypename", "views", "typename", "find", "view", "query", "ast", "createGenerator", "client", "invokePromise", "schema", "space", "n", "db", "type", "run", "staticSchema", "graph", "schemaRegistry", "runSync", "AddSchema", "show", "generate", "createObjects", "staticGenerators", "Map", "Document", "cb", "objects", "map", "add", "make", "name", "commerce", "productName", "content", "lorem", "sentences", "obj", "cells", "year", "Date", "getFullYear", "cols", "rows", "col", "row", "cell", "value", "from", "to", "Math", "floor", "model", "create", "builder", "createNode", "id", "kind", "QUEUE", "ObjectId", "toString", "createEdge", "node", "property", "root", "DebugSettings", "lazy"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/index.ts
|
|
4
|
+
import { lazy } from "react";
|
|
5
|
+
var DebugGraph = lazy(() => import("../DebugGraph-G4FWS57E.mjs"));
|
|
6
|
+
var DebugObjectPanel = lazy(() => import("../DebugObjectPanel-UJ63CV25.mjs"));
|
|
7
|
+
var DebugStatus = lazy(() => import("../DebugStatus-YB3KFP7G.mjs"));
|
|
8
|
+
var DevtoolsOverviewContainer = lazy(() => import("../DevtoolsOverviewContainer-YX7Z3D2H.mjs"));
|
|
9
|
+
var SpaceGenerator = lazy(() => import("../SpaceGenerator-UBYB4NPD.mjs"));
|
|
10
|
+
var Wireframe = lazy(() => import("../Wireframe-7SNRUKET.mjs"));
|
|
11
|
+
var DebugSpaceObjectsPanel = lazy(() => import("../DebugSpaceObjectsPanel-NISULU6U.mjs"));
|
|
12
|
+
export {
|
|
13
|
+
DebugGraph,
|
|
14
|
+
DebugObjectPanel,
|
|
15
|
+
DebugSpaceObjectsPanel,
|
|
16
|
+
DebugStatus,
|
|
17
|
+
DevtoolsOverviewContainer,
|
|
18
|
+
SpaceGenerator,
|
|
19
|
+
Wireframe
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const DebugGraph: ComponentType<any> = lazy(() => import('./DebugGraph'));\nexport const DebugObjectPanel: ComponentType<any> = lazy(() => import('./DebugObjectPanel'));\nexport const DebugStatus: ComponentType<any> = lazy(() => import('./DebugStatus'));\nexport const DevtoolsOverviewContainer: ComponentType<any> = lazy(() => import('./DevtoolsOverviewContainer'));\nexport const SpaceGenerator: ComponentType<any> = lazy(() => import('./SpaceGenerator'));\nexport const Wireframe: ComponentType<any> = lazy(() => import('./Wireframe'));\nexport const DebugSpaceObjectsPanel: ComponentType<any> = lazy(() => import('./DebugSpaceObjectsPanel'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,aAAiCD,KAAK,MAAM,OAAO,4BAAA,CAAA;AACzD,IAAME,mBAAuCF,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC/D,IAAMG,cAAkCH,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC1D,IAAMI,4BAAgDJ,KAAK,MAAM,OAAO,2CAAA,CAAA;AACxE,IAAMK,iBAAqCL,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC7D,IAAMM,YAAgCN,KAAK,MAAM,OAAO,2BAAA,CAAA;AACxD,IAAMO,yBAA6CP,KAAK,MAAM,OAAO,wCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "DebugGraph", "DebugObjectPanel", "DebugStatus", "DevtoolsOverviewContainer", "SpaceGenerator", "Wireframe", "DebugSpaceObjectsPanel"]
|
|
7
|
+
}
|