@dxos/plugin-debug 0.8.4-main.c4373fc → 0.8.4-main.d9fc60f731
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/PLUGIN.mdl +373 -0
- 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-OS65NC4M.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-OS65NC4M.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +59 -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-RKYNQIKH.mjs +223 -0
- package/dist/lib/neutral/DebugSettings-RKYNQIKH.mjs.map +7 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs +34 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-BHOCFWDJ.mjs.map +7 -0
- package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs +122 -0
- package/dist/lib/neutral/DebugStatus-H2BAHN26.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/RegistryPanel-64GIYJHN.mjs +161 -0
- package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +146 -0
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.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-XYLTBYKN.mjs +612 -0
- package/dist/lib/neutral/app-graph-builder-XYLTBYKN.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-HOV6MV5B.mjs +43 -0
- package/dist/lib/neutral/chunk-HOV6MV5B.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-UAAGABXZ.mjs} +31 -9
- package/dist/lib/neutral/chunk-UAAGABXZ.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-54FUIZIH.mjs → neutral/components/index.mjs} +343 -530
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +25 -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-3MDMZGCA.mjs +425 -0
- package/dist/lib/neutral/react-surface-3MDMZGCA.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 +91 -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 +106 -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 +106 -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/RegistryPanel/RegistryPanel.d.ts +3 -0
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryPanel/index.d.ts +2 -0
- package/dist/types/src/containers/RegistryPanel/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 +11 -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 +87 -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 +70 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -78
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +34 -34
- package/src/DebugPlugin.workerd.ts +12 -0
- package/src/capabilities/app-graph-builder.ts +390 -388
- package/src/capabilities/index.ts +5 -5
- package/src/capabilities/react-context.tsx +16 -7
- package/src/capabilities/react-surface.tsx +386 -339
- package/src/capabilities/settings.ts +24 -12
- package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
- package/src/components/DebugSettings/DebugSettings.tsx +259 -0
- package/src/components/DebugSettings/index.ts +5 -0
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +38 -44
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +245 -151
- 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 +42 -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/RegistryPanel/RegistryPanel.tsx +150 -0
- package/src/containers/RegistryPanel/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +127 -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 +15 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +29 -6
- package/src/plugin.ts +10 -0
- package/src/translations.ts +83 -58
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +21 -11
- package/src/vite-env.d.ts +10 -0
- 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-54FUIZIH.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-BTWJ2I3F.mjs +0 -772
- package/dist/lib/browser/react-surface-BTWJ2I3F.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
|
@@ -1,216 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
3
|
-
import React2, { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
5
|
-
import { ComputeGraph as ComputeGraph2 } from "@dxos/conductor";
|
|
6
|
-
import { Filter as Filter3 } from "@dxos/echo";
|
|
7
|
-
import { Markdown as Markdown3 } from "@dxos/plugin-markdown/types";
|
|
8
|
-
import { SheetType as SheetType2 } from "@dxos/plugin-sheet/types";
|
|
9
|
-
import { DiagramType as DiagramType2 } from "@dxos/plugin-sketch/types";
|
|
10
|
-
import { useClient } from "@dxos/react-client";
|
|
11
|
-
import { getTypename } from "@dxos/react-client/echo";
|
|
12
|
-
import { IconButton as IconButton2, Input, Toolbar, useAsyncEffect } from "@dxos/react-ui";
|
|
13
|
-
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
14
|
-
import { DataType as DataType3 } from "@dxos/schema";
|
|
15
|
-
import { jsonKeyReplacer, sortKeys } from "@dxos/util";
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
16
2
|
|
|
17
|
-
// src/components/
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
await dispatch(createIntent(SpaceAction.AddSchema, {
|
|
43
|
-
space,
|
|
44
|
-
schema
|
|
45
|
-
}));
|
|
46
|
-
} else if (!view && staticSchema) {
|
|
47
|
-
await dispatch(createIntent(SpaceAction.UseStaticSchema, {
|
|
48
|
-
space,
|
|
49
|
-
typename
|
|
50
|
-
}));
|
|
51
|
-
}
|
|
52
|
-
const generate = createAsyncGenerator(generator, schema, {
|
|
53
|
-
db: space.db
|
|
54
|
-
});
|
|
55
|
-
return generate.createObjects(n);
|
|
56
|
-
};
|
|
3
|
+
// src/components/index.ts
|
|
4
|
+
import { lazy } from "react";
|
|
5
|
+
|
|
6
|
+
// src/components/SchemaTable/SchemaTable.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { IconButton } from "@dxos/react-ui";
|
|
9
|
+
var SchemaTable = ({ types, objects = {}, label, onClick }) => {
|
|
10
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
11
|
+
className: "grid grid-cols-[1fr_80px_40px] gap-1 overflow-none"
|
|
12
|
+
}, /* @__PURE__ */ React.createElement("h2", {
|
|
13
|
+
className: "p-2"
|
|
14
|
+
}, label), types.map((type) => /* @__PURE__ */ React.createElement("div", {
|
|
15
|
+
key: type.typename,
|
|
16
|
+
className: "grid grid-cols-subgrid col-span-3 items-center"
|
|
17
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
18
|
+
className: "px-2 text-sm font-mono text-subdued"
|
|
19
|
+
}, type.typename), /* @__PURE__ */ React.createElement("div", {
|
|
20
|
+
className: "px-2 text-right font-mono"
|
|
21
|
+
}, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
|
|
22
|
+
variant: "ghost",
|
|
23
|
+
icon: "ph--plus--regular",
|
|
24
|
+
iconOnly: true,
|
|
25
|
+
label: "Create data",
|
|
26
|
+
onClick: () => onClick(type.typename)
|
|
27
|
+
}))));
|
|
57
28
|
};
|
|
58
|
-
var staticGenerators = /* @__PURE__ */ new Map([
|
|
59
|
-
[
|
|
60
|
-
Markdown.Document.typename,
|
|
61
|
-
async (space, n, cb) => {
|
|
62
|
-
const objects = range(n).map(() => {
|
|
63
|
-
return space.db.add(Markdown.makeDocument({
|
|
64
|
-
name: faker.commerce.productName(),
|
|
65
|
-
content: faker.lorem.sentences(5)
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
cb?.(objects);
|
|
69
|
-
return objects;
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
DiagramType.typename,
|
|
74
|
-
async (space, n, cb) => {
|
|
75
|
-
const objects = range(n).map(() => {
|
|
76
|
-
const obj = space.db.add(Obj.make(DiagramType, {
|
|
77
|
-
name: faker.commerce.productName(),
|
|
78
|
-
canvas: Ref.make(Obj.make(CanvasType, {
|
|
79
|
-
content: {}
|
|
80
|
-
}))
|
|
81
|
-
}));
|
|
82
|
-
return obj;
|
|
83
|
-
});
|
|
84
|
-
cb?.(objects);
|
|
85
|
-
return objects;
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
// TODO(burdon): Create unit tests.
|
|
89
|
-
[
|
|
90
|
-
SheetType.typename,
|
|
91
|
-
async (space, n, cb) => {
|
|
92
|
-
const objects = range(n).map(() => {
|
|
93
|
-
const cells = {};
|
|
94
|
-
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
95
|
-
const cols = 4;
|
|
96
|
-
const rows = 16;
|
|
97
|
-
for (let col = 1; col <= cols; col++) {
|
|
98
|
-
for (let row = 1; row <= rows; row++) {
|
|
99
|
-
const cell = addressToA1Notation({
|
|
100
|
-
col,
|
|
101
|
-
row
|
|
102
|
-
});
|
|
103
|
-
if (row === 1) {
|
|
104
|
-
cells[cell] = {
|
|
105
|
-
value: `${year} Q${col}`
|
|
106
|
-
};
|
|
107
|
-
} else if (row === rows) {
|
|
108
|
-
const from = addressToA1Notation({
|
|
109
|
-
col,
|
|
110
|
-
row: 2
|
|
111
|
-
});
|
|
112
|
-
const to = addressToA1Notation({
|
|
113
|
-
col,
|
|
114
|
-
row: rows - 1
|
|
115
|
-
});
|
|
116
|
-
cells[cell] = {
|
|
117
|
-
value: `=SUM(${from}:${to})`
|
|
118
|
-
};
|
|
119
|
-
} else if (row > 2 && row < rows - 1) {
|
|
120
|
-
cells[cell] = {
|
|
121
|
-
value: Math.floor(Math.random() * 1e4)
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return space.db.add(createSheet({
|
|
127
|
-
name: faker.commerce.productName(),
|
|
128
|
-
cells
|
|
129
|
-
}));
|
|
130
|
-
});
|
|
131
|
-
cb?.(objects);
|
|
132
|
-
return objects;
|
|
133
|
-
}
|
|
134
|
-
],
|
|
135
|
-
[
|
|
136
|
-
ComputeGraph.typename,
|
|
137
|
-
async (space, n, cb) => {
|
|
138
|
-
const objects = range(n, () => {
|
|
139
|
-
const model = ComputeGraphModel.create();
|
|
140
|
-
model.builder.createNode({
|
|
141
|
-
id: "gpt-INPUT",
|
|
142
|
-
type: NODE_INPUT
|
|
143
|
-
}).createNode({
|
|
144
|
-
id: "gpt-GPT",
|
|
145
|
-
type: "gpt"
|
|
146
|
-
}).createNode({
|
|
147
|
-
id: "gpt-QUEUE_ID",
|
|
148
|
-
type: "constant",
|
|
149
|
-
value: new DXN(DXN.kind.QUEUE, [
|
|
150
|
-
"data",
|
|
151
|
-
space.id,
|
|
152
|
-
Key.ObjectId.random()
|
|
153
|
-
]).toString()
|
|
154
|
-
}).createNode({
|
|
155
|
-
id: "gpt-APPEND",
|
|
156
|
-
type: "append"
|
|
157
|
-
}).createNode({
|
|
158
|
-
id: "gpt-OUTPUT",
|
|
159
|
-
type: NODE_OUTPUT
|
|
160
|
-
}).createEdge({
|
|
161
|
-
node: "gpt-INPUT",
|
|
162
|
-
property: "prompt"
|
|
163
|
-
}, {
|
|
164
|
-
node: "gpt-GPT",
|
|
165
|
-
property: "prompt"
|
|
166
|
-
}).createEdge({
|
|
167
|
-
node: "gpt-GPT",
|
|
168
|
-
property: "text"
|
|
169
|
-
}, {
|
|
170
|
-
node: "gpt-OUTPUT",
|
|
171
|
-
property: "text"
|
|
172
|
-
}).createEdge({
|
|
173
|
-
node: "gpt-QUEUE_ID",
|
|
174
|
-
property: DEFAULT_OUTPUT
|
|
175
|
-
}, {
|
|
176
|
-
node: "gpt-APPEND",
|
|
177
|
-
property: "id"
|
|
178
|
-
}).createEdge({
|
|
179
|
-
node: "gpt-GPT",
|
|
180
|
-
property: "messages"
|
|
181
|
-
}, {
|
|
182
|
-
node: "gpt-APPEND",
|
|
183
|
-
property: "items"
|
|
184
|
-
}).createEdge({
|
|
185
|
-
node: "gpt-QUEUE_ID",
|
|
186
|
-
property: DEFAULT_OUTPUT
|
|
187
|
-
}, {
|
|
188
|
-
node: "gpt-OUTPUT",
|
|
189
|
-
property: "queue"
|
|
190
|
-
});
|
|
191
|
-
return space.db.add(model.root);
|
|
192
|
-
});
|
|
193
|
-
cb?.(objects);
|
|
194
|
-
return objects;
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
]);
|
|
198
29
|
|
|
199
30
|
// src/components/SpaceGenerator/presets.ts
|
|
200
31
|
import * as Schema from "effect/Schema";
|
|
201
|
-
import {
|
|
202
|
-
import {
|
|
203
|
-
import { NODE_INPUT
|
|
204
|
-
import {
|
|
205
|
-
import { FunctionTrigger, serializeFunction } from "@dxos/functions";
|
|
32
|
+
import { AgentPrompt, WebSearchBlueprint } from "@dxos/assistant-toolkit";
|
|
33
|
+
import { Routine, Trigger, Operation } from "@dxos/compute";
|
|
34
|
+
import { NODE_INPUT } from "@dxos/conductor";
|
|
35
|
+
import { Feed, Filter, JsonSchema, Key, Obj, Query, Ref, Scope, Tag } from "@dxos/echo";
|
|
206
36
|
import { invariant } from "@dxos/invariant";
|
|
207
|
-
import {
|
|
208
|
-
import {
|
|
209
|
-
import {
|
|
210
|
-
import {
|
|
211
|
-
import {
|
|
212
|
-
import {
|
|
213
|
-
import {
|
|
37
|
+
import { EID } from "@dxos/keys";
|
|
38
|
+
import { InboxOperation } from "@dxos/plugin-inbox";
|
|
39
|
+
import { Mailbox } from "@dxos/plugin-inbox";
|
|
40
|
+
import { Markdown } from "@dxos/plugin-markdown";
|
|
41
|
+
import { createAppend, createChat, createComputeGraph, createConstant, createFeed, createFunction, createGpt, createRandom, createSurface, createTemplate, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
|
|
42
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from "@dxos/react-ui-canvas-editor";
|
|
43
|
+
import { ViewModel } from "@dxos/schema";
|
|
44
|
+
import { Message, Organization, Person, Pipeline } from "@dxos/types";
|
|
45
|
+
import { range, trim } from "@dxos/util";
|
|
214
46
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-debug/src/components/SpaceGenerator/presets.ts";
|
|
215
47
|
var PresetName = /* @__PURE__ */ (function(PresetName2) {
|
|
216
48
|
PresetName2["DXOS_TEAM"] = "dxos-team";
|
|
@@ -218,15 +50,15 @@ var PresetName = /* @__PURE__ */ (function(PresetName2) {
|
|
|
218
50
|
PresetName2["GPT_QUEUE"] = "webhook-gpt-queue";
|
|
219
51
|
PresetName2["CHAT_GPT"] = "chat-gpt-text";
|
|
220
52
|
PresetName2["OBJECT_CHANGE_QUEUE"] = "objectChange-queue";
|
|
221
|
-
PresetName2["FOREX_FUNCTION_CALL"] = "forex-function-call";
|
|
222
53
|
PresetName2["TIMER_TICK_QUEUE"] = "timerTick-queue";
|
|
54
|
+
PresetName2["FOREX_FUNCTION_CALL"] = "forex-function-call";
|
|
223
55
|
PresetName2["DISCORD_MESSAGES"] = "discord-messages";
|
|
224
56
|
return PresetName2;
|
|
225
57
|
})({});
|
|
226
|
-
var
|
|
58
|
+
var generator = () => ({
|
|
227
59
|
schemas: [
|
|
228
|
-
|
|
229
|
-
|
|
60
|
+
CanvasBoard.CanvasBoard,
|
|
61
|
+
Trigger.Trigger
|
|
230
62
|
],
|
|
231
63
|
types: Object.values(PresetName).map((name) => ({
|
|
232
64
|
typename: name
|
|
@@ -235,40 +67,44 @@ var generator2 = () => ({
|
|
|
235
67
|
[
|
|
236
68
|
"dxos-team",
|
|
237
69
|
async (space, n, cb) => {
|
|
238
|
-
const objects =
|
|
239
|
-
const org = space.db.add(
|
|
70
|
+
const objects = range(n, () => {
|
|
71
|
+
const org = space.db.add(Obj.make(Organization.Organization, {
|
|
240
72
|
name: "DXOS",
|
|
241
73
|
website: "https://dxos.org"
|
|
242
74
|
}));
|
|
243
|
-
const doc = space.db.add(
|
|
75
|
+
const doc = space.db.add(Markdown.make({
|
|
244
76
|
name: "DXOS Research",
|
|
245
77
|
content: "DXOS builds Composer, an open-source AI-powered malleable application."
|
|
246
78
|
}));
|
|
247
|
-
space.db.add(
|
|
248
|
-
|
|
249
|
-
[Relation.Target]: org,
|
|
250
|
-
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
79
|
+
const tag = space.db.add(Tag.make({
|
|
80
|
+
label: "Investor"
|
|
251
81
|
}));
|
|
252
|
-
|
|
82
|
+
const tagRef = Ref.make(tag);
|
|
83
|
+
Obj.update(doc, (doc2) => {
|
|
84
|
+
Obj.getMeta(doc2).tags = [
|
|
85
|
+
tagRef
|
|
86
|
+
];
|
|
87
|
+
});
|
|
88
|
+
space.db.add(Obj.make(Person.Person, {
|
|
89
|
+
[Obj.Meta]: {
|
|
90
|
+
tags: [
|
|
91
|
+
tagRef
|
|
92
|
+
]
|
|
93
|
+
},
|
|
253
94
|
fullName: "Rich",
|
|
254
|
-
|
|
255
|
-
organization: Ref2.make(org)
|
|
95
|
+
organization: Ref.make(org)
|
|
256
96
|
}));
|
|
257
|
-
space.db.add(
|
|
97
|
+
space.db.add(Obj.make(Person.Person, {
|
|
258
98
|
fullName: "Josiah",
|
|
259
|
-
organization:
|
|
99
|
+
organization: Ref.make(org)
|
|
260
100
|
}));
|
|
261
|
-
space.db.add(
|
|
101
|
+
space.db.add(Obj.make(Person.Person, {
|
|
262
102
|
fullName: "Dima",
|
|
263
|
-
organization:
|
|
103
|
+
organization: Ref.make(org)
|
|
264
104
|
}));
|
|
265
|
-
space.db.add(
|
|
105
|
+
space.db.add(Obj.make(Person.Person, {
|
|
266
106
|
fullName: "Mykola",
|
|
267
|
-
organization:
|
|
268
|
-
}));
|
|
269
|
-
space.db.add(Obj2.make(DataType2.Person, {
|
|
270
|
-
fullName: "Will",
|
|
271
|
-
organization: Ref2.make(org)
|
|
107
|
+
organization: Ref.make(org)
|
|
272
108
|
}));
|
|
273
109
|
return doc;
|
|
274
110
|
});
|
|
@@ -279,42 +115,30 @@ var generator2 = () => ({
|
|
|
279
115
|
[
|
|
280
116
|
"org-research-project",
|
|
281
117
|
async (space, n, cb) => {
|
|
282
|
-
const
|
|
283
|
-
const
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
118
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
119
|
+
const mailbox = mailboxes[0];
|
|
120
|
+
invariant(mailbox, "Mailbox not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 101, S: void 0, A: ["mailbox", "'Mailbox not found'"] });
|
|
121
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
122
|
+
invariant(mailboxFeed, "Mailbox missing feed reference", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 103, S: void 0, A: ["mailboxFeed", "'Mailbox missing feed reference'"] });
|
|
123
|
+
const queueDxn = Feed.getQueueUri(mailboxFeed);
|
|
124
|
+
invariant(queueDxn, "Mailbox feed missing queue DXN key", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 105, S: void 0, A: ["queueDxn", "'Mailbox feed missing queue DXN key'"] });
|
|
125
|
+
const tag = await space.db.query(Filter.type(Tag.Tag, {
|
|
126
|
+
label: "Investor"
|
|
127
|
+
})).first();
|
|
128
|
+
const tagUri = Obj.getURI(tag);
|
|
129
|
+
const objects = range(n, () => {
|
|
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
|
+
space.db.add(Trigger.make({
|
|
293
134
|
enabled: true,
|
|
294
|
-
spec:
|
|
295
|
-
|
|
296
|
-
cron: "* * * * *"
|
|
297
|
-
},
|
|
298
|
-
function: Ref2.make(serializeFunction(sync)),
|
|
135
|
+
spec: Trigger.specTimer("* * * * *"),
|
|
136
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
299
137
|
input: {
|
|
300
|
-
|
|
138
|
+
mailbox: Ref.make(mailbox)
|
|
301
139
|
}
|
|
302
|
-
});
|
|
303
|
-
space.db.add(
|
|
304
|
-
const contactExtractionTrigger = Obj2.make(FunctionTrigger, {
|
|
305
|
-
enabled: true,
|
|
306
|
-
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
307
|
-
spec: {
|
|
308
|
-
kind: "queue",
|
|
309
|
-
queue: mailbox.queue.dxn.toString()
|
|
310
|
-
},
|
|
311
|
-
function: Ref2.make(serializeFunction(entityExtraction)),
|
|
312
|
-
input: {
|
|
313
|
-
source: "{{event.item}}"
|
|
314
|
-
}
|
|
315
|
-
});
|
|
316
|
-
space.db.add(contactExtractionTrigger);
|
|
317
|
-
const researchPrompt = space.db.add(Prompt.make({
|
|
140
|
+
}));
|
|
141
|
+
const researchPrompt = space.db.add(Routine.make({
|
|
318
142
|
name: "Research",
|
|
319
143
|
description: "Research organization",
|
|
320
144
|
input: Schema.Struct({
|
|
@@ -323,79 +147,68 @@ var generator2 = () => ({
|
|
|
323
147
|
output: Schema.Any,
|
|
324
148
|
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
325
149
|
// Remove the mock prompt to do the actual research.
|
|
326
|
-
instructions:
|
|
150
|
+
instructions: trim`
|
|
151
|
+
Research the organization provided as input.
|
|
152
|
+
Create a research note for it at the end.
|
|
153
|
+
NOTE: Do mocked reseach (set mockSearch to true).
|
|
154
|
+
`,
|
|
327
155
|
blueprints: [
|
|
328
|
-
|
|
156
|
+
Ref.make(WebSearchBlueprint.make())
|
|
329
157
|
]
|
|
330
158
|
}));
|
|
331
|
-
|
|
159
|
+
space.db.add(Trigger.make({
|
|
332
160
|
enabled: true,
|
|
333
|
-
spec:
|
|
334
|
-
|
|
335
|
-
query: {
|
|
336
|
-
string: organizationsQueryString,
|
|
337
|
-
ast: organizationsQuery.ast
|
|
338
|
-
}
|
|
339
|
-
},
|
|
340
|
-
function: Ref2.make(serializeFunction(agent)),
|
|
161
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
162
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
341
163
|
input: {
|
|
342
|
-
prompt:
|
|
164
|
+
prompt: Ref.make(researchPrompt),
|
|
343
165
|
input: "{{event.subject}}"
|
|
344
166
|
}
|
|
345
|
-
});
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
name: "Mailbox",
|
|
349
|
-
query: Query.select(Filter2.type(DataType2.Message, {
|
|
167
|
+
}));
|
|
168
|
+
const mailboxView = ViewModel.make({
|
|
169
|
+
query: Query.select(Filter.type(Message.Message, {
|
|
350
170
|
properties: {
|
|
351
|
-
labels:
|
|
171
|
+
labels: Filter.contains("investor")
|
|
352
172
|
}
|
|
353
|
-
})).
|
|
354
|
-
|
|
355
|
-
mailbox.queue.dxn.toString()
|
|
356
|
-
]
|
|
357
|
-
}),
|
|
358
|
-
queryString: 'Query.select(Filter.type(DataType.Message, { properties: { labels: Filter.contains("investor") } }))',
|
|
359
|
-
jsonSchema: Type2.toJsonSchema(DataType2.Message),
|
|
360
|
-
presentation: Obj2.make(DataType2.Collection, {
|
|
361
|
-
objects: []
|
|
362
|
-
})
|
|
173
|
+
})).from(Scope.feed(Obj.getURI(mailboxFeed))),
|
|
174
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message)
|
|
363
175
|
});
|
|
364
|
-
const contactsView =
|
|
365
|
-
name: "Contacts",
|
|
176
|
+
const contactsView = ViewModel.make({
|
|
366
177
|
query: contactsQuery,
|
|
367
|
-
|
|
368
|
-
jsonSchema: Type2.toJsonSchema(DataType2.Person),
|
|
369
|
-
presentation: Obj2.make(DataType2.Collection, {
|
|
370
|
-
objects: []
|
|
371
|
-
})
|
|
178
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person)
|
|
372
179
|
});
|
|
373
|
-
const organizationsView =
|
|
374
|
-
name: "Organizations",
|
|
180
|
+
const organizationsView = ViewModel.make({
|
|
375
181
|
query: organizationsQuery,
|
|
376
|
-
|
|
377
|
-
jsonSchema: Type2.toJsonSchema(DataType2.Organization),
|
|
378
|
-
presentation: Obj2.make(DataType2.Collection, {
|
|
379
|
-
objects: []
|
|
380
|
-
})
|
|
182
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization)
|
|
381
183
|
});
|
|
382
|
-
const notesView =
|
|
383
|
-
name: "Notes",
|
|
184
|
+
const notesView = ViewModel.make({
|
|
384
185
|
query: notesQuery,
|
|
385
|
-
|
|
386
|
-
jsonSchema: Type2.toJsonSchema(Markdown2.Document),
|
|
387
|
-
presentation: Obj2.make(DataType2.Collection, {
|
|
388
|
-
objects: []
|
|
389
|
-
})
|
|
186
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document)
|
|
390
187
|
});
|
|
391
|
-
return space.db.add(
|
|
188
|
+
return space.db.add(Pipeline.make({
|
|
392
189
|
name: "Investor Research",
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
190
|
+
columns: [
|
|
191
|
+
{
|
|
192
|
+
name: "Mailbox",
|
|
193
|
+
view: Ref.make(mailboxView),
|
|
194
|
+
order: []
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
name: "Contacts",
|
|
198
|
+
view: Ref.make(contactsView),
|
|
199
|
+
order: []
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
name: "Organizations",
|
|
203
|
+
view: Ref.make(organizationsView),
|
|
204
|
+
order: []
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
name: "Notes",
|
|
208
|
+
view: Ref.make(notesView),
|
|
209
|
+
order: []
|
|
210
|
+
}
|
|
211
|
+
]
|
|
399
212
|
}));
|
|
400
213
|
});
|
|
401
214
|
cb?.(objects.flat());
|
|
@@ -405,7 +218,7 @@ var generator2 = () => ({
|
|
|
405
218
|
[
|
|
406
219
|
"webhook-gpt-queue",
|
|
407
220
|
async (space, n, cb) => {
|
|
408
|
-
const objects =
|
|
221
|
+
const objects = range(n, () => {
|
|
409
222
|
const canvasModel = CanvasGraphModel.create();
|
|
410
223
|
let functionTrigger;
|
|
411
224
|
canvasModel.builder.call((builder) => {
|
|
@@ -465,10 +278,9 @@ var generator2 = () => ({
|
|
|
465
278
|
[
|
|
466
279
|
"objectChange-queue",
|
|
467
280
|
async (space, n, cb) => {
|
|
468
|
-
const objects =
|
|
281
|
+
const objects = range(n, () => {
|
|
469
282
|
const { canvasModel, computeModel } = createQueueSinkPreset(space, "subscription", (triggerSpec) => triggerSpec.query = {
|
|
470
|
-
|
|
471
|
-
ast: Query.select(Filter2.typename("dxos.org/type/Chess")).ast
|
|
283
|
+
ast: Query.select(Filter.typename("org.dxos.type.chess")).ast
|
|
472
284
|
}, "type");
|
|
473
285
|
return addToSpace("objectChange-queue", space, canvasModel, computeModel);
|
|
474
286
|
});
|
|
@@ -479,7 +291,7 @@ var generator2 = () => ({
|
|
|
479
291
|
[
|
|
480
292
|
"timerTick-queue",
|
|
481
293
|
async (space, n, cb) => {
|
|
482
|
-
const objects =
|
|
294
|
+
const objects = range(n, () => {
|
|
483
295
|
const { canvasModel, computeModel } = createQueueSinkPreset(space, "timer", (triggerSpec) => triggerSpec.cron = "*/5 * * * * *", "result");
|
|
484
296
|
return addToSpace("timerTick-queue", space, canvasModel, computeModel);
|
|
485
297
|
});
|
|
@@ -534,7 +346,7 @@ var generator2 = () => ({
|
|
|
534
346
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
535
347
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
536
348
|
// templateComputeNode.value = templateContent.join('\n');
|
|
537
|
-
// templateComputeNode.inputSchema =
|
|
349
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
538
350
|
// attachTrigger(functionTrigger, computeModel);
|
|
539
351
|
// return addToSpace(PresetName.EMAIL_TABLE, space, canvasModel, computeModel);
|
|
540
352
|
// });
|
|
@@ -545,7 +357,7 @@ var generator2 = () => ({
|
|
|
545
357
|
[
|
|
546
358
|
"chat-gpt-text",
|
|
547
359
|
async (space, n, cb) => {
|
|
548
|
-
const objects =
|
|
360
|
+
const objects = range(n, () => {
|
|
549
361
|
const canvasModel = CanvasGraphModel.create();
|
|
550
362
|
canvasModel.builder.call((builder) => {
|
|
551
363
|
const gpt = canvasModel.createNode(createGpt(position({
|
|
@@ -665,7 +477,7 @@ var generator2 = () => ({
|
|
|
665
477
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
666
478
|
// templateComputeNode.value = templateContent.join('\n');
|
|
667
479
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
668
|
-
// templateComputeNode.inputSchema =
|
|
480
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
669
481
|
// attachTrigger(functionTrigger, computeModel);
|
|
670
482
|
// return addToSpace(PresetName.EMAIL_WITH_SUMMARY, space, canvasModel, computeModel);
|
|
671
483
|
// });
|
|
@@ -676,7 +488,7 @@ var generator2 = () => ({
|
|
|
676
488
|
[
|
|
677
489
|
"forex-function-call",
|
|
678
490
|
async (space, n, cb) => {
|
|
679
|
-
const objects =
|
|
491
|
+
const objects = range(n, () => {
|
|
680
492
|
const canvasModel = CanvasGraphModel.create();
|
|
681
493
|
canvasModel.builder.call((builder) => {
|
|
682
494
|
const sourceCurrency = canvasModel.createNode(createConstant({
|
|
@@ -725,7 +537,7 @@ var generator2 = () => ({
|
|
|
725
537
|
[
|
|
726
538
|
"discord-messages",
|
|
727
539
|
async (space, n, cb) => {
|
|
728
|
-
const objects =
|
|
540
|
+
const objects = range(n, () => {
|
|
729
541
|
const canvasModel = CanvasGraphModel.create();
|
|
730
542
|
let functionTrigger;
|
|
731
543
|
canvasModel.builder.call((builder) => {
|
|
@@ -746,11 +558,10 @@ var generator2 = () => ({
|
|
|
746
558
|
})
|
|
747
559
|
}));
|
|
748
560
|
const queueId = canvasModel.createNode(createConstant({
|
|
749
|
-
value:
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
]).toString(),
|
|
561
|
+
value: EID.make({
|
|
562
|
+
spaceId: space.id,
|
|
563
|
+
entityId: Key.EntityId.random()
|
|
564
|
+
}),
|
|
754
565
|
...position({
|
|
755
566
|
x: -10,
|
|
756
567
|
y: 5
|
|
@@ -764,7 +575,7 @@ var generator2 = () => ({
|
|
|
764
575
|
x: 12,
|
|
765
576
|
y: 0
|
|
766
577
|
})));
|
|
767
|
-
const queue = canvasModel.createNode(
|
|
578
|
+
const queue = canvasModel.createNode(createFeed(position({
|
|
768
579
|
x: 0,
|
|
769
580
|
y: 12
|
|
770
581
|
})));
|
|
@@ -839,7 +650,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
839
650
|
width: 128,
|
|
840
651
|
height: 122
|
|
841
652
|
})));
|
|
842
|
-
const
|
|
653
|
+
const random2 = canvasModel.createNode(createRandom(rawPosition({
|
|
843
654
|
centerX: -509,
|
|
844
655
|
centerY: -30,
|
|
845
656
|
width: 64,
|
|
@@ -859,41 +670,27 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
859
670
|
output: triggerOutputName,
|
|
860
671
|
input: "type"
|
|
861
672
|
}).createEdge({
|
|
862
|
-
source:
|
|
673
|
+
source: random2.id,
|
|
863
674
|
target: template.id,
|
|
864
675
|
input: "changeId"
|
|
865
676
|
});
|
|
866
677
|
functionTrigger = triggerShape.functionTrigger.target;
|
|
867
678
|
const triggerSpec = functionTrigger.spec;
|
|
868
|
-
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", {
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
S: void 0,
|
|
872
|
-
A: [
|
|
873
|
-
"triggerSpec && triggerSpec.kind === triggerKind",
|
|
874
|
-
"'No trigger spec.'"
|
|
875
|
-
]
|
|
679
|
+
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 661, S: void 0, A: ["triggerSpec && triggerSpec.kind === triggerKind", "'No trigger spec.'"] });
|
|
680
|
+
Obj.update(functionTrigger, (functionTrigger2) => {
|
|
681
|
+
initSpec(functionTrigger2.spec);
|
|
876
682
|
});
|
|
877
|
-
initSpec(triggerSpec);
|
|
878
683
|
});
|
|
879
684
|
const computeModel = createComputeGraph(canvasModel);
|
|
880
685
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
881
|
-
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
882
|
-
F: __dxlog_file,
|
|
883
|
-
L: 670,
|
|
884
|
-
S: void 0,
|
|
885
|
-
A: [
|
|
886
|
-
"templateComputeNode",
|
|
887
|
-
"'Template compute node was not created.'"
|
|
888
|
-
]
|
|
889
|
-
});
|
|
686
|
+
invariant(templateComputeNode, "Template compute node was not created.", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 668, S: void 0, A: ["templateComputeNode", "'Template compute node was not created.'"] });
|
|
890
687
|
templateComputeNode.value = [
|
|
891
688
|
"{",
|
|
892
689
|
' "@type": "{{type}}",',
|
|
893
690
|
' "id": "@{{changeId}}"',
|
|
894
691
|
"}"
|
|
895
692
|
].join("\n");
|
|
896
|
-
templateComputeNode.inputSchema =
|
|
693
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(Schema.Struct({
|
|
897
694
|
type: Schema.String,
|
|
898
695
|
changeId: Schema.String
|
|
899
696
|
}));
|
|
@@ -904,19 +701,18 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
904
701
|
};
|
|
905
702
|
};
|
|
906
703
|
var addToSpace = (name, space, canvas, compute) => {
|
|
907
|
-
return space.db.add(
|
|
704
|
+
return space.db.add(Obj.make(CanvasBoard.CanvasBoard, {
|
|
908
705
|
name,
|
|
909
|
-
computeGraph:
|
|
706
|
+
computeGraph: Ref.make(compute.root),
|
|
910
707
|
layout: canvas.graph
|
|
911
708
|
}));
|
|
912
709
|
};
|
|
913
710
|
var setupQueue = (space, canvasModel, args) => {
|
|
914
711
|
const queueId = canvasModel.createNode(createConstant({
|
|
915
|
-
value:
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
]).toString(),
|
|
712
|
+
value: EID.make({
|
|
713
|
+
spaceId: space.id,
|
|
714
|
+
entityId: Key.EntityId.random()
|
|
715
|
+
}),
|
|
920
716
|
...args?.idPosition ? rawPosition(args.idPosition) : position({
|
|
921
717
|
x: -18,
|
|
922
718
|
y: 5,
|
|
@@ -924,7 +720,7 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
924
720
|
height: 6
|
|
925
721
|
})
|
|
926
722
|
}));
|
|
927
|
-
const queue = canvasModel.createNode(
|
|
723
|
+
const queue = canvasModel.createNode(createFeed(args?.queuePosition ? rawPosition(args.queuePosition) : position({
|
|
928
724
|
x: -3,
|
|
929
725
|
y: 3,
|
|
930
726
|
width: 14,
|
|
@@ -940,18 +736,12 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
940
736
|
};
|
|
941
737
|
};
|
|
942
738
|
var attachTrigger = (functionTrigger, computeModel) => {
|
|
943
|
-
invariant(functionTrigger, void 0, {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
"functionTrigger",
|
|
949
|
-
""
|
|
950
|
-
]
|
|
739
|
+
invariant(functionTrigger, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 722, S: void 0, A: ["functionTrigger", ""] });
|
|
740
|
+
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT);
|
|
741
|
+
Obj.update(functionTrigger, (functionTrigger2) => {
|
|
742
|
+
functionTrigger2.function = Ref.make(computeModel.root);
|
|
743
|
+
functionTrigger2.inputNodeId = inputNode.id;
|
|
951
744
|
});
|
|
952
|
-
functionTrigger.function = Ref2.make(computeModel.root);
|
|
953
|
-
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT2);
|
|
954
|
-
functionTrigger.inputNodeId = inputNode.id;
|
|
955
745
|
};
|
|
956
746
|
var rawPosition = (args) => {
|
|
957
747
|
return {
|
|
@@ -997,163 +787,186 @@ var position = (rect) => {
|
|
|
997
787
|
}
|
|
998
788
|
};
|
|
999
789
|
|
|
1000
|
-
// src/components/SpaceGenerator/
|
|
1001
|
-
import {
|
|
1002
|
-
import
|
|
1003
|
-
import {
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
className: "px-2 text-sm font-mono text-subdued"
|
|
1016
|
-
}, type.typename), /* @__PURE__ */ React.createElement("div", {
|
|
1017
|
-
className: "px-2 text-right font-mono"
|
|
1018
|
-
}, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
|
|
1019
|
-
variant: "ghost",
|
|
1020
|
-
icon: "ph--plus--regular",
|
|
1021
|
-
iconOnly: true,
|
|
1022
|
-
label: "Create data",
|
|
1023
|
-
onClick: () => onClick(type.typename)
|
|
1024
|
-
}))));
|
|
1025
|
-
} finally {
|
|
1026
|
-
_effect.f();
|
|
1027
|
-
}
|
|
790
|
+
// src/components/SpaceGenerator/ObjectGenerator.tsx
|
|
791
|
+
import { addressToA1Notation } from "@dxos/compute-hyperformula";
|
|
792
|
+
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT as NODE_INPUT2, NODE_OUTPUT } from "@dxos/conductor";
|
|
793
|
+
import { EID as EID2, Filter as Filter2, Key as Key2, Type, View } from "@dxos/echo";
|
|
794
|
+
import { Markdown as Markdown2 } from "@dxos/plugin-markdown";
|
|
795
|
+
import { Sheet } from "@dxos/plugin-sheet";
|
|
796
|
+
import { Sketch } from "@dxos/plugin-sketch";
|
|
797
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
798
|
+
import { random } from "@dxos/random";
|
|
799
|
+
import { getTypenameFromQuery } from "@dxos/schema";
|
|
800
|
+
import { createAsyncGenerator } from "@dxos/schema/testing";
|
|
801
|
+
import { range as range2 } from "@dxos/util";
|
|
802
|
+
var generator2 = random;
|
|
803
|
+
var findViewByTypename = async (views, typename) => {
|
|
804
|
+
return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
|
|
1028
805
|
};
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
ComputeGraph2
|
|
1041
|
-
];
|
|
1042
|
-
const recordTypes = [
|
|
1043
|
-
DataType3.Organization,
|
|
1044
|
-
DataType3.Person,
|
|
1045
|
-
DataType3.Task
|
|
1046
|
-
];
|
|
1047
|
-
const [count, setCount] = useState(1);
|
|
1048
|
-
const [info, setInfo] = useState({});
|
|
1049
|
-
const presets = useMemo(() => generator2(), []);
|
|
1050
|
-
const typeMap = useMemo(() => {
|
|
1051
|
-
client.addTypes([
|
|
1052
|
-
...staticTypes,
|
|
1053
|
-
...recordTypes,
|
|
1054
|
-
...presets.schemas
|
|
1055
|
-
]);
|
|
1056
|
-
const recordGenerators = new Map(recordTypes.map((type) => [
|
|
1057
|
-
type.typename,
|
|
1058
|
-
createGenerator(client, dispatch, type)
|
|
1059
|
-
]));
|
|
1060
|
-
return new Map([
|
|
1061
|
-
...staticGenerators,
|
|
1062
|
-
...presets.items,
|
|
1063
|
-
...recordGenerators
|
|
1064
|
-
]);
|
|
1065
|
-
}, [
|
|
1066
|
-
client,
|
|
1067
|
-
recordTypes
|
|
1068
|
-
]);
|
|
1069
|
-
const updateInfo = async () => {
|
|
1070
|
-
const echoSchema = await space.db.schemaRegistry.query().run();
|
|
1071
|
-
const staticSchema = space.db.graph.schemaRegistry.schemas;
|
|
1072
|
-
const { objects } = await space.db.query(Filter3.everything()).run();
|
|
1073
|
-
const objectMap = sortKeys(objects.reduce((map, obj) => {
|
|
1074
|
-
const type = getTypename(obj);
|
|
1075
|
-
if (type) {
|
|
1076
|
-
const count2 = map[type] ?? 0;
|
|
1077
|
-
map[type] = count2 + 1;
|
|
1078
|
-
}
|
|
1079
|
-
return map;
|
|
1080
|
-
}, {}));
|
|
1081
|
-
setInfo({
|
|
1082
|
-
schema: {
|
|
1083
|
-
static: staticSchema.length,
|
|
1084
|
-
mutable: echoSchema.length
|
|
1085
|
-
},
|
|
1086
|
-
objects: objectMap
|
|
806
|
+
var createGenerator = (client, invokePromise, schema) => {
|
|
807
|
+
return async (space, n) => {
|
|
808
|
+
const typename = Type.getTypename(schema);
|
|
809
|
+
const views = await space.db.query(Filter2.type(View.View)).run();
|
|
810
|
+
const view = await findViewByTypename(views, typename);
|
|
811
|
+
const staticSchema = client ? client.graph.registry.list().filter(Type.isType).find((s) => Type.getTypename(s) === typename) : void 0;
|
|
812
|
+
if (!view && !staticSchema) {
|
|
813
|
+
await invokePromise(SpaceOperation.AddType, {
|
|
814
|
+
db: space.db,
|
|
815
|
+
type: schema,
|
|
816
|
+
show: false
|
|
1087
817
|
});
|
|
1088
|
-
}
|
|
1089
|
-
|
|
1090
|
-
space
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
if (constructor) {
|
|
1095
|
-
await constructor(space, count, onCreateObjects);
|
|
1096
|
-
await updateInfo();
|
|
1097
|
-
}
|
|
1098
|
-
}, [
|
|
1099
|
-
typeMap,
|
|
1100
|
-
count
|
|
1101
|
-
]);
|
|
1102
|
-
return /* @__PURE__ */ React2.createElement("div", {
|
|
1103
|
-
role: "none",
|
|
1104
|
-
className: "flex flex-col grow overflow-hidden"
|
|
1105
|
-
}, /* @__PURE__ */ React2.createElement(Toolbar.Root, {
|
|
1106
|
-
classNames: "border-be border-subduedSeparator"
|
|
1107
|
-
}, /* @__PURE__ */ React2.createElement(IconButton2, {
|
|
1108
|
-
icon: "ph--arrow-clockwise--regular",
|
|
1109
|
-
iconOnly: true,
|
|
1110
|
-
label: "Refresh",
|
|
1111
|
-
onClick: updateInfo
|
|
1112
|
-
}), /* @__PURE__ */ React2.createElement(Toolbar.Separator, {
|
|
1113
|
-
variant: "gap"
|
|
1114
|
-
}), /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
|
|
1115
|
-
type: "number",
|
|
1116
|
-
min: 1,
|
|
1117
|
-
max: 100,
|
|
1118
|
-
placeholder: "Count",
|
|
1119
|
-
classNames: "!w-[4rem] !text-right",
|
|
1120
|
-
size: 8,
|
|
1121
|
-
value: count,
|
|
1122
|
-
onChange: (ev) => setCount(parseInt(ev.target.value))
|
|
1123
|
-
}))), /* @__PURE__ */ React2.createElement("div", {
|
|
1124
|
-
className: "flex flex-col overflow-y-auto divide-y divide-separator"
|
|
1125
|
-
}, /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1126
|
-
types: staticTypes,
|
|
1127
|
-
objects: info.objects,
|
|
1128
|
-
label: "Static Types",
|
|
1129
|
-
onClick: handleCreateData
|
|
1130
|
-
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1131
|
-
types: recordTypes,
|
|
1132
|
-
objects: info.objects,
|
|
1133
|
-
label: "Record Types",
|
|
1134
|
-
onClick: handleCreateData
|
|
1135
|
-
}), /* @__PURE__ */ React2.createElement(SchemaTable, {
|
|
1136
|
-
types: presets.types,
|
|
1137
|
-
objects: info.objects,
|
|
1138
|
-
label: "Presets",
|
|
1139
|
-
onClick: handleCreateData
|
|
1140
|
-
}), /* @__PURE__ */ React2.createElement("div", null, /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
|
|
1141
|
-
language: "json",
|
|
1142
|
-
classNames: "text-xs"
|
|
1143
|
-
}, JSON.stringify({
|
|
1144
|
-
space,
|
|
1145
|
-
...info
|
|
1146
|
-
}, jsonKeyReplacer({
|
|
1147
|
-
truncate: true
|
|
1148
|
-
}), 2)))));
|
|
1149
|
-
} finally {
|
|
1150
|
-
_effect.f();
|
|
1151
|
-
}
|
|
818
|
+
}
|
|
819
|
+
const generate = createAsyncGenerator(generator2, schema, {
|
|
820
|
+
db: space.db
|
|
821
|
+
});
|
|
822
|
+
return generate.createObjects(n);
|
|
823
|
+
};
|
|
1152
824
|
};
|
|
825
|
+
var staticGenerators = /* @__PURE__ */ new Map([
|
|
826
|
+
[
|
|
827
|
+
Type.getTypename(Markdown2.Document),
|
|
828
|
+
async (space, n, cb) => {
|
|
829
|
+
const objects = range2(n).map(() => {
|
|
830
|
+
return space.db.add(Markdown2.make({
|
|
831
|
+
name: random.commerce.productName(),
|
|
832
|
+
content: random.lorem.sentences(5)
|
|
833
|
+
}));
|
|
834
|
+
});
|
|
835
|
+
cb?.(objects);
|
|
836
|
+
return objects;
|
|
837
|
+
}
|
|
838
|
+
],
|
|
839
|
+
[
|
|
840
|
+
Type.getTypename(Sketch.Sketch),
|
|
841
|
+
async (space, n, cb) => {
|
|
842
|
+
const objects = range2(n).map(() => {
|
|
843
|
+
const obj = space.db.add(Sketch.make({
|
|
844
|
+
name: random.commerce.productName()
|
|
845
|
+
}));
|
|
846
|
+
return obj;
|
|
847
|
+
});
|
|
848
|
+
cb?.(objects);
|
|
849
|
+
return objects;
|
|
850
|
+
}
|
|
851
|
+
],
|
|
852
|
+
// TODO(burdon): Create unit tests.
|
|
853
|
+
[
|
|
854
|
+
Type.getTypename(Sheet.Sheet),
|
|
855
|
+
async (space, n, cb) => {
|
|
856
|
+
const objects = range2(n).map(() => {
|
|
857
|
+
const cells = {};
|
|
858
|
+
const year = (/* @__PURE__ */ new Date()).getFullYear();
|
|
859
|
+
const cols = 4;
|
|
860
|
+
const rows = 16;
|
|
861
|
+
for (let col = 1; col <= cols; col++) {
|
|
862
|
+
for (let row = 1; row <= rows; row++) {
|
|
863
|
+
const cell = addressToA1Notation({
|
|
864
|
+
col,
|
|
865
|
+
row
|
|
866
|
+
});
|
|
867
|
+
if (row === 1) {
|
|
868
|
+
cells[cell] = {
|
|
869
|
+
value: `${year} Q${col}`
|
|
870
|
+
};
|
|
871
|
+
} else if (row === rows) {
|
|
872
|
+
const from = addressToA1Notation({
|
|
873
|
+
col,
|
|
874
|
+
row: 2
|
|
875
|
+
});
|
|
876
|
+
const to = addressToA1Notation({
|
|
877
|
+
col,
|
|
878
|
+
row: rows - 1
|
|
879
|
+
});
|
|
880
|
+
cells[cell] = {
|
|
881
|
+
value: `=SUM(${from}:${to})`
|
|
882
|
+
};
|
|
883
|
+
} else if (row > 2 && row < rows - 1) {
|
|
884
|
+
cells[cell] = {
|
|
885
|
+
value: Math.floor(Math.random() * 1e4)
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
return space.db.add(Sheet.make({
|
|
891
|
+
name: random.commerce.productName(),
|
|
892
|
+
cells
|
|
893
|
+
}));
|
|
894
|
+
});
|
|
895
|
+
cb?.(objects);
|
|
896
|
+
return objects;
|
|
897
|
+
}
|
|
898
|
+
],
|
|
899
|
+
[
|
|
900
|
+
Type.getTypename(ComputeGraph),
|
|
901
|
+
async (space, n, cb) => {
|
|
902
|
+
const objects = range2(n, () => {
|
|
903
|
+
const model = ComputeGraphModel.create();
|
|
904
|
+
model.builder.createNode({
|
|
905
|
+
id: "gpt-INPUT",
|
|
906
|
+
type: NODE_INPUT2
|
|
907
|
+
}).createNode({
|
|
908
|
+
id: "gpt-GPT",
|
|
909
|
+
type: "gpt"
|
|
910
|
+
}).createNode({
|
|
911
|
+
id: "gpt-QUEUE_ID",
|
|
912
|
+
type: "constant",
|
|
913
|
+
value: EID2.make({
|
|
914
|
+
spaceId: space.id,
|
|
915
|
+
entityId: Key2.EntityId.random()
|
|
916
|
+
})
|
|
917
|
+
}).createNode({
|
|
918
|
+
id: "gpt-APPEND",
|
|
919
|
+
type: "append"
|
|
920
|
+
}).createNode({
|
|
921
|
+
id: "gpt-OUTPUT",
|
|
922
|
+
type: NODE_OUTPUT
|
|
923
|
+
}).createEdge({
|
|
924
|
+
node: "gpt-INPUT",
|
|
925
|
+
property: "prompt"
|
|
926
|
+
}, {
|
|
927
|
+
node: "gpt-GPT",
|
|
928
|
+
property: "prompt"
|
|
929
|
+
}).createEdge({
|
|
930
|
+
node: "gpt-GPT",
|
|
931
|
+
property: "text"
|
|
932
|
+
}, {
|
|
933
|
+
node: "gpt-OUTPUT",
|
|
934
|
+
property: "text"
|
|
935
|
+
}).createEdge({
|
|
936
|
+
node: "gpt-QUEUE_ID",
|
|
937
|
+
property: DEFAULT_OUTPUT
|
|
938
|
+
}, {
|
|
939
|
+
node: "gpt-APPEND",
|
|
940
|
+
property: "id"
|
|
941
|
+
}).createEdge({
|
|
942
|
+
node: "gpt-GPT",
|
|
943
|
+
property: "messages"
|
|
944
|
+
}, {
|
|
945
|
+
node: "gpt-APPEND",
|
|
946
|
+
property: "items"
|
|
947
|
+
}).createEdge({
|
|
948
|
+
node: "gpt-QUEUE_ID",
|
|
949
|
+
property: DEFAULT_OUTPUT
|
|
950
|
+
}, {
|
|
951
|
+
node: "gpt-OUTPUT",
|
|
952
|
+
property: "queue"
|
|
953
|
+
});
|
|
954
|
+
return space.db.add(model.root);
|
|
955
|
+
});
|
|
956
|
+
cb?.(objects);
|
|
957
|
+
return objects;
|
|
958
|
+
}
|
|
959
|
+
]
|
|
960
|
+
]);
|
|
1153
961
|
|
|
1154
|
-
// src/components/
|
|
1155
|
-
var
|
|
962
|
+
// src/components/index.ts
|
|
963
|
+
var DebugSettings = lazy(() => import("../DebugSettings-RKYNQIKH.mjs"));
|
|
1156
964
|
export {
|
|
1157
|
-
|
|
965
|
+
DebugSettings,
|
|
966
|
+
PresetName,
|
|
967
|
+
SchemaTable,
|
|
968
|
+
createGenerator,
|
|
969
|
+
generator,
|
|
970
|
+
staticGenerators
|
|
1158
971
|
};
|
|
1159
|
-
//# sourceMappingURL=
|
|
972
|
+
//# sourceMappingURL=index.mjs.map
|