@dxos/plugin-debug 0.8.4-main.fd6878d → 0.9.0
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-4OJQQLSH.mjs +626 -0
- package/dist/lib/neutral/app-graph-builder-4OJQQLSH.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-AJA6RYN3.mjs → neutral/chunk-TAST3Y2C.mjs} +32 -9
- package/dist/lib/neutral/chunk-TAST3Y2C.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-XJJAOTIT.mjs → neutral/components/index.mjs} +415 -423
- 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-YBC4HK7I.mjs +430 -0
- package/dist/lib/neutral/react-surface-YBC4HK7I.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 +92 -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 +107 -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 +4 -4
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +4 -9
- 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 +107 -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 -3
- 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 +88 -57
- 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 +71 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -76
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +37 -38
- package/src/DebugPlugin.workerd.ts +12 -0
- package/src/capabilities/app-graph-builder.ts +397 -412
- package/src/capabilities/index.ts +5 -5
- package/src/capabilities/react-context.tsx +16 -7
- package/src/capabilities/react-surface.tsx +394 -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 +41 -47
- package/src/components/SpaceGenerator/draw-util.ts +10 -10
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +318 -57
- 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 +44 -21
- 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 +8 -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 -8
- package/src/plugin.ts +10 -0
- package/src/translations.ts +84 -56
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +22 -11
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/DebugApp-F4UFVW4Y.mjs +0 -228
- package/dist/lib/browser/DebugApp-F4UFVW4Y.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-XJJAOTIT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-PXPZIIGY.mjs +0 -597
- package/dist/lib/browser/app-graph-builder-PXPZIIGY.mjs.map +0 -7
- package/dist/lib/browser/chunk-5XPIRNQS.mjs +0 -18
- package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
- package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -130
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-NVAGLAJD.mjs +0 -16
- package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-UNFNQFWK.mjs +0 -768
- package/dist/lib/browser/react-surface-UNFNQFWK.mjs.map +0 -7
- package/dist/lib/browser/settings-LSSWLM5I.mjs +0 -22
- package/dist/lib/browser/settings-LSSWLM5I.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/DebugApp/DebugApp.d.ts +0 -6
- package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
- package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/index.d.ts +0 -3
- package/dist/types/src/components/DebugApp/index.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 -6
- 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/DebugApp/DebugApp.tsx +0 -85
- package/src/components/DebugApp/Tree.tsx +0 -103
- package/src/components/DebugApp/index.ts +0 -7
- package/src/components/DebugObjectPanel.tsx +0 -35
- package/src/components/DebugSettings.tsx +0 -151
- 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
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { AgentPrompt, WebSearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Routine, Trigger, Operation } from '@dxos/compute';
|
|
7
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
8
|
-
import {
|
|
9
|
-
import { FunctionTrigger, TriggerKind, type TriggerType } from '@dxos/functions';
|
|
10
|
+
import { Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Scope, Tag } from '@dxos/echo';
|
|
10
11
|
import { invariant } from '@dxos/invariant';
|
|
12
|
+
import { DXN, EID } from '@dxos/keys';
|
|
13
|
+
import { InboxOperation } from '@dxos/plugin-inbox';
|
|
14
|
+
import { Mailbox } from '@dxos/plugin-inbox';
|
|
15
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
11
16
|
import { type Space } from '@dxos/react-client/echo';
|
|
12
17
|
import {
|
|
13
18
|
type ComputeShape,
|
|
@@ -15,54 +20,226 @@ import {
|
|
|
15
20
|
createChat,
|
|
16
21
|
createComputeGraph,
|
|
17
22
|
createConstant,
|
|
23
|
+
createFeed,
|
|
18
24
|
createFunction,
|
|
19
25
|
createGpt,
|
|
20
|
-
createQueue,
|
|
21
26
|
createRandom,
|
|
22
27
|
createSurface,
|
|
23
28
|
createTemplate,
|
|
24
29
|
createText,
|
|
25
30
|
createTrigger,
|
|
26
31
|
} from '@dxos/react-ui-canvas-compute';
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
pointsToRect,
|
|
32
|
-
rectToPoints,
|
|
33
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
34
|
-
import { range } from '@dxos/util';
|
|
32
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
33
|
+
import { ViewModel } from '@dxos/schema';
|
|
34
|
+
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
35
|
+
import { range, trim } from '@dxos/util';
|
|
35
36
|
|
|
36
37
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
37
38
|
|
|
38
39
|
export enum PresetName {
|
|
40
|
+
DXOS_TEAM = 'dxos-team',
|
|
41
|
+
ORG_RESEARCH_PROJECT = 'org-research-project',
|
|
39
42
|
// EMAIL_TABLE = 'email-table',
|
|
40
43
|
GPT_QUEUE = 'webhook-gpt-queue',
|
|
41
44
|
CHAT_GPT = 'chat-gpt-text',
|
|
42
45
|
// EMAIL_WITH_SUMMARY = 'email-gptSummary-table',
|
|
43
46
|
OBJECT_CHANGE_QUEUE = 'objectChange-queue',
|
|
44
|
-
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
45
47
|
TIMER_TICK_QUEUE = 'timerTick-queue',
|
|
48
|
+
FOREX_FUNCTION_CALL = 'forex-function-call',
|
|
46
49
|
DISCORD_MESSAGES = 'discord-messages',
|
|
47
50
|
// KANBAN_QUEUE = 'kanban-queue',
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
export const generator = () => ({
|
|
51
|
-
schemas: [
|
|
54
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
52
55
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
53
56
|
items: [
|
|
57
|
+
[
|
|
58
|
+
PresetName.DXOS_TEAM,
|
|
59
|
+
async (space, n, cb) => {
|
|
60
|
+
const objects = range(n, () => {
|
|
61
|
+
const org = space.db.add(
|
|
62
|
+
Obj.make(Organization.Organization, {
|
|
63
|
+
name: 'DXOS',
|
|
64
|
+
website: 'https://dxos.org',
|
|
65
|
+
}),
|
|
66
|
+
);
|
|
67
|
+
const doc = space.db.add(
|
|
68
|
+
Markdown.make({
|
|
69
|
+
name: 'DXOS Research',
|
|
70
|
+
content: 'DXOS builds Composer, an open-source AI-powered malleable application.',
|
|
71
|
+
}),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
75
|
+
const tagRef = Ref.make(tag);
|
|
76
|
+
Obj.update(doc, (doc) => {
|
|
77
|
+
Obj.getMeta(doc).tags = [tagRef];
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// space.db.add(
|
|
81
|
+
// Relation.make(HasSubject, {
|
|
82
|
+
// [Relation.Source]: doc,
|
|
83
|
+
// [Relation.Target]: org,
|
|
84
|
+
// completedAt: new Date().toISOString(),
|
|
85
|
+
// }),
|
|
86
|
+
// );
|
|
87
|
+
|
|
88
|
+
space.db.add(
|
|
89
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagRef] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
90
|
+
);
|
|
91
|
+
space.db.add(
|
|
92
|
+
Obj.make(Person.Person, {
|
|
93
|
+
fullName: 'Josiah',
|
|
94
|
+
organization: Ref.make(org),
|
|
95
|
+
}),
|
|
96
|
+
);
|
|
97
|
+
space.db.add(
|
|
98
|
+
Obj.make(Person.Person, {
|
|
99
|
+
fullName: 'Dima',
|
|
100
|
+
organization: Ref.make(org),
|
|
101
|
+
}),
|
|
102
|
+
);
|
|
103
|
+
space.db.add(
|
|
104
|
+
Obj.make(Person.Person, {
|
|
105
|
+
fullName: 'Mykola',
|
|
106
|
+
organization: Ref.make(org),
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
return doc;
|
|
111
|
+
});
|
|
112
|
+
cb?.(objects);
|
|
113
|
+
return objects;
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
PresetName.ORG_RESEARCH_PROJECT,
|
|
118
|
+
async (space, n, cb) => {
|
|
119
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
120
|
+
const mailbox = mailboxes[0];
|
|
121
|
+
invariant(mailbox, 'Mailbox not found');
|
|
122
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
123
|
+
invariant(mailboxFeed, 'Mailbox missing feed reference');
|
|
124
|
+
const queueDxn = Feed.getQueueUri(mailboxFeed);
|
|
125
|
+
invariant(queueDxn, 'Mailbox feed missing queue DXN key');
|
|
126
|
+
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
127
|
+
const tagUri = Obj.getURI(tag);
|
|
128
|
+
|
|
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
|
+
|
|
134
|
+
space.db.add(
|
|
135
|
+
Trigger.make({
|
|
136
|
+
enabled: true,
|
|
137
|
+
spec: Trigger.specTimer('* * * * *'), // Every minute.
|
|
138
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
139
|
+
input: {
|
|
140
|
+
mailbox: Ref.make(mailbox),
|
|
141
|
+
},
|
|
142
|
+
}),
|
|
143
|
+
);
|
|
144
|
+
|
|
145
|
+
const researchPrompt = space.db.add(
|
|
146
|
+
Routine.make({
|
|
147
|
+
name: 'Research',
|
|
148
|
+
description: 'Research organization',
|
|
149
|
+
input: Schema.Struct({
|
|
150
|
+
org: Schema.Any,
|
|
151
|
+
}),
|
|
152
|
+
output: Schema.Any,
|
|
153
|
+
|
|
154
|
+
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
155
|
+
// Remove the mock prompt to do the actual research.
|
|
156
|
+
instructions: trim`
|
|
157
|
+
Research the organization provided as input.
|
|
158
|
+
Create a research note for it at the end.
|
|
159
|
+
NOTE: Do mocked reseach (set mockSearch to true).
|
|
160
|
+
`,
|
|
161
|
+
blueprints: [Ref.make(WebSearchBlueprint.make())],
|
|
162
|
+
}),
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
space.db.add(
|
|
166
|
+
Trigger.make({
|
|
167
|
+
enabled: true,
|
|
168
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
169
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
170
|
+
input: {
|
|
171
|
+
prompt: Ref.make(researchPrompt),
|
|
172
|
+
input: '{{event.subject}}',
|
|
173
|
+
},
|
|
174
|
+
}),
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
const mailboxView = ViewModel.make({
|
|
178
|
+
query: Query.select(
|
|
179
|
+
Filter.type(Message.Message, {
|
|
180
|
+
properties: { labels: Filter.contains('investor') },
|
|
181
|
+
}),
|
|
182
|
+
).from(Scope.feed(Obj.getURI(mailboxFeed))),
|
|
183
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
184
|
+
});
|
|
185
|
+
const contactsView = ViewModel.make({
|
|
186
|
+
query: contactsQuery,
|
|
187
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
188
|
+
});
|
|
189
|
+
const organizationsView = ViewModel.make({
|
|
190
|
+
query: organizationsQuery,
|
|
191
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
192
|
+
});
|
|
193
|
+
const notesView = ViewModel.make({
|
|
194
|
+
query: notesQuery,
|
|
195
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
return space.db.add(
|
|
199
|
+
Pipeline.make({
|
|
200
|
+
name: 'Investor Research',
|
|
201
|
+
columns: [
|
|
202
|
+
{
|
|
203
|
+
name: 'Mailbox',
|
|
204
|
+
view: Ref.make(mailboxView),
|
|
205
|
+
order: [],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'Contacts',
|
|
209
|
+
view: Ref.make(contactsView),
|
|
210
|
+
order: [],
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: 'Organizations',
|
|
214
|
+
view: Ref.make(organizationsView),
|
|
215
|
+
order: [],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: 'Notes',
|
|
219
|
+
view: Ref.make(notesView),
|
|
220
|
+
order: [],
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
}),
|
|
224
|
+
);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
cb?.(objects.flat());
|
|
228
|
+
return objects.flat();
|
|
229
|
+
},
|
|
230
|
+
],
|
|
54
231
|
[
|
|
55
232
|
PresetName.GPT_QUEUE,
|
|
56
233
|
async (space, n, cb) => {
|
|
57
234
|
const objects = range(n, () => {
|
|
58
235
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
59
236
|
|
|
60
|
-
let functionTrigger:
|
|
237
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
61
238
|
canvasModel.builder.call((builder) => {
|
|
62
239
|
const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));
|
|
63
240
|
const triggerShape = createTrigger({
|
|
64
241
|
spaceId: space.id,
|
|
65
|
-
triggerKind:
|
|
242
|
+
triggerKind: 'webhook',
|
|
66
243
|
...position({ x: -18, y: -2 }),
|
|
67
244
|
});
|
|
68
245
|
const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -71,10 +248,24 @@ export const generator = () => ({
|
|
|
71
248
|
const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
72
249
|
|
|
73
250
|
builder
|
|
74
|
-
.createEdge({
|
|
251
|
+
.createEdge({
|
|
252
|
+
source: trigger.id,
|
|
253
|
+
target: gpt.id,
|
|
254
|
+
input: 'prompt',
|
|
255
|
+
output: 'bodyText',
|
|
256
|
+
})
|
|
75
257
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
76
|
-
.createEdge({
|
|
77
|
-
|
|
258
|
+
.createEdge({
|
|
259
|
+
source: queueId.id,
|
|
260
|
+
target: append.id,
|
|
261
|
+
input: 'id',
|
|
262
|
+
})
|
|
263
|
+
.createEdge({
|
|
264
|
+
source: gpt.id,
|
|
265
|
+
target: append.id,
|
|
266
|
+
output: 'messages',
|
|
267
|
+
input: 'items',
|
|
268
|
+
});
|
|
78
269
|
|
|
79
270
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
80
271
|
});
|
|
@@ -96,8 +287,11 @@ export const generator = () => ({
|
|
|
96
287
|
const objects = range(n, () => {
|
|
97
288
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
98
289
|
space,
|
|
99
|
-
|
|
100
|
-
(triggerSpec) =>
|
|
290
|
+
'subscription',
|
|
291
|
+
(triggerSpec) =>
|
|
292
|
+
(triggerSpec.query = {
|
|
293
|
+
ast: Query.select(Filter.type(DXN.make('org.dxos.type.chess'))).ast as Obj.Mutable<QueryAST.Query>,
|
|
294
|
+
}),
|
|
101
295
|
'type',
|
|
102
296
|
);
|
|
103
297
|
return addToSpace(PresetName.OBJECT_CHANGE_QUEUE, space, canvasModel, computeModel);
|
|
@@ -113,7 +307,7 @@ export const generator = () => ({
|
|
|
113
307
|
const objects = range(n, () => {
|
|
114
308
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
115
309
|
space,
|
|
116
|
-
|
|
310
|
+
'timer',
|
|
117
311
|
(triggerSpec) => (triggerSpec.cron = '*/5 * * * * *'),
|
|
118
312
|
'result',
|
|
119
313
|
);
|
|
@@ -147,7 +341,7 @@ export const generator = () => ({
|
|
|
147
341
|
// canvasModel.builder.call((builder) => {
|
|
148
342
|
// const triggerShape = createTrigger({
|
|
149
343
|
// spaceId: space.id,
|
|
150
|
-
// triggerKind:
|
|
344
|
+
// triggerKind: 'email',
|
|
151
345
|
// ...position({ x: -18, y: -2 }),
|
|
152
346
|
// });
|
|
153
347
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -181,7 +375,7 @@ export const generator = () => ({
|
|
|
181
375
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
182
376
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
183
377
|
// templateComputeNode.value = templateContent.join('\n');
|
|
184
|
-
// templateComputeNode.inputSchema =
|
|
378
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
185
379
|
|
|
186
380
|
// attachTrigger(functionTrigger, computeModel);
|
|
187
381
|
|
|
@@ -209,8 +403,17 @@ export const generator = () => ({
|
|
|
209
403
|
builder
|
|
210
404
|
.createEdge({ source: chat.id, target: gpt.id, input: 'prompt' })
|
|
211
405
|
.createEdge({ source: gpt.id, target: text.id, output: 'text' })
|
|
212
|
-
.createEdge({
|
|
213
|
-
|
|
406
|
+
.createEdge({
|
|
407
|
+
source: queueId.id,
|
|
408
|
+
target: append.id,
|
|
409
|
+
input: 'id',
|
|
410
|
+
})
|
|
411
|
+
.createEdge({
|
|
412
|
+
source: gpt.id,
|
|
413
|
+
target: append.id,
|
|
414
|
+
output: 'messages',
|
|
415
|
+
input: 'items',
|
|
416
|
+
});
|
|
214
417
|
});
|
|
215
418
|
|
|
216
419
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -254,7 +457,7 @@ export const generator = () => ({
|
|
|
254
457
|
// );
|
|
255
458
|
// const triggerShape = createTrigger({
|
|
256
459
|
// spaceId: space.id,
|
|
257
|
-
// triggerKind:
|
|
460
|
+
// triggerKind: 'email',
|
|
258
461
|
// ...rawPosition({ centerX: -736, centerY: -384, width: 182, height: 192 }),
|
|
259
462
|
// });
|
|
260
463
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -306,7 +509,7 @@ export const generator = () => ({
|
|
|
306
509
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
307
510
|
// templateComputeNode.value = templateContent.join('\n');
|
|
308
511
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
309
|
-
// templateComputeNode.inputSchema =
|
|
512
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
310
513
|
|
|
311
514
|
// attachTrigger(functionTrigger, computeModel);
|
|
312
515
|
|
|
@@ -334,9 +537,21 @@ export const generator = () => ({
|
|
|
334
537
|
const view = canvasModel.createNode(createSurface(position({ x: 12, y: 0 })));
|
|
335
538
|
|
|
336
539
|
builder
|
|
337
|
-
.createEdge({
|
|
338
|
-
|
|
339
|
-
|
|
540
|
+
.createEdge({
|
|
541
|
+
source: sourceCurrency.id,
|
|
542
|
+
target: converter.id,
|
|
543
|
+
input: 'from',
|
|
544
|
+
})
|
|
545
|
+
.createEdge({
|
|
546
|
+
source: targetCurrency.id,
|
|
547
|
+
target: converter.id,
|
|
548
|
+
input: 'to',
|
|
549
|
+
})
|
|
550
|
+
.createEdge({
|
|
551
|
+
source: converter.id,
|
|
552
|
+
target: view.id,
|
|
553
|
+
output: 'rate',
|
|
554
|
+
});
|
|
340
555
|
});
|
|
341
556
|
|
|
342
557
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -354,34 +569,57 @@ export const generator = () => ({
|
|
|
354
569
|
const objects = range(n, () => {
|
|
355
570
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
356
571
|
|
|
357
|
-
let functionTrigger:
|
|
572
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
358
573
|
canvasModel.builder.call((builder) => {
|
|
359
574
|
const triggerShape = createTrigger({
|
|
360
575
|
spaceId: space.id,
|
|
361
|
-
triggerKind:
|
|
576
|
+
triggerKind: 'timer',
|
|
362
577
|
...position({ x: -10, y: -5 }),
|
|
363
578
|
});
|
|
364
579
|
const trigger = canvasModel.createNode(triggerShape);
|
|
365
580
|
// DXOS dev-null channel.
|
|
366
581
|
const channelId = canvasModel.createNode(
|
|
367
|
-
createConstant({
|
|
582
|
+
createConstant({
|
|
583
|
+
value: '1088569858767212554',
|
|
584
|
+
...position({ x: -10, y: 0 }),
|
|
585
|
+
}),
|
|
368
586
|
);
|
|
369
587
|
const queueId = canvasModel.createNode(
|
|
370
588
|
createConstant({
|
|
371
|
-
value:
|
|
589
|
+
value: EID.make({ spaceId: space.id, entityId: Key.EntityId.random() }),
|
|
372
590
|
...position({ x: -10, y: 5 }),
|
|
373
591
|
}),
|
|
374
592
|
);
|
|
375
593
|
const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));
|
|
376
594
|
const view = canvasModel.createNode(createText(position({ x: 12, y: 0 })));
|
|
377
|
-
const queue = canvasModel.createNode(
|
|
595
|
+
const queue = canvasModel.createNode(createFeed(position({ x: 0, y: 12 })));
|
|
378
596
|
|
|
379
597
|
builder
|
|
380
|
-
.createEdge({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
598
|
+
.createEdge({
|
|
599
|
+
source: trigger.id,
|
|
600
|
+
target: converter.id,
|
|
601
|
+
input: 'tick',
|
|
602
|
+
})
|
|
603
|
+
.createEdge({
|
|
604
|
+
source: channelId.id,
|
|
605
|
+
target: converter.id,
|
|
606
|
+
input: 'channelId',
|
|
607
|
+
})
|
|
608
|
+
.createEdge({
|
|
609
|
+
source: queueId.id,
|
|
610
|
+
target: converter.id,
|
|
611
|
+
input: 'queueId',
|
|
612
|
+
})
|
|
613
|
+
.createEdge({
|
|
614
|
+
source: converter.id,
|
|
615
|
+
target: view.id,
|
|
616
|
+
output: 'newMessages',
|
|
617
|
+
})
|
|
618
|
+
.createEdge({
|
|
619
|
+
source: queueId.id,
|
|
620
|
+
target: queue.id,
|
|
621
|
+
input: 'input',
|
|
622
|
+
});
|
|
385
623
|
|
|
386
624
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
387
625
|
});
|
|
@@ -416,7 +654,7 @@ export const generator = () => ({
|
|
|
416
654
|
// canvasModel.builder.call((builder) => {
|
|
417
655
|
// const triggerShape = createTrigger({
|
|
418
656
|
// spaceId: space.id,
|
|
419
|
-
// triggerKind:
|
|
657
|
+
// triggerKind: 'queue',
|
|
420
658
|
// ...position({ x: -10, y: -5 }),
|
|
421
659
|
// });
|
|
422
660
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -448,10 +686,10 @@ export const generator = () => ({
|
|
|
448
686
|
] as [PresetName, ObjectGenerator<any>][],
|
|
449
687
|
});
|
|
450
688
|
|
|
451
|
-
const createQueueSinkPreset = <SpecType extends
|
|
689
|
+
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
452
690
|
space: Space,
|
|
453
691
|
triggerKind: SpecType,
|
|
454
|
-
initSpec: (spec: Extract<
|
|
692
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
455
693
|
triggerOutputName: string,
|
|
456
694
|
) => {
|
|
457
695
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -463,7 +701,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
463
701
|
}),
|
|
464
702
|
);
|
|
465
703
|
|
|
466
|
-
let functionTrigger:
|
|
704
|
+
let functionTrigger: Trigger.Trigger | undefined;
|
|
467
705
|
canvasModel.builder.call((builder) => {
|
|
468
706
|
const triggerShape = createTrigger({
|
|
469
707
|
spaceId: space.id,
|
|
@@ -484,7 +722,12 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
484
722
|
builder
|
|
485
723
|
.createEdge({ source: queueId.id, target: append.id, input: 'id' })
|
|
486
724
|
.createEdge({ source: template.id, target: append.id, input: 'items' })
|
|
487
|
-
.createEdge({
|
|
725
|
+
.createEdge({
|
|
726
|
+
source: trigger.id,
|
|
727
|
+
target: template.id,
|
|
728
|
+
output: triggerOutputName,
|
|
729
|
+
input: 'type',
|
|
730
|
+
})
|
|
488
731
|
.createEdge({
|
|
489
732
|
source: random.id,
|
|
490
733
|
target: template.id,
|
|
@@ -494,15 +737,20 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
494
737
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
495
738
|
const triggerSpec = functionTrigger.spec;
|
|
496
739
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
497
|
-
|
|
740
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
741
|
+
initSpec(functionTrigger.spec as any);
|
|
742
|
+
});
|
|
498
743
|
});
|
|
499
744
|
|
|
500
745
|
const computeModel = createComputeGraph(canvasModel);
|
|
501
746
|
|
|
502
747
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
503
748
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
749
|
+
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
504
750
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
505
|
-
templateComputeNode.inputSchema =
|
|
751
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
752
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
753
|
+
);
|
|
506
754
|
attachTrigger(functionTrigger, computeModel);
|
|
507
755
|
|
|
508
756
|
return { canvasModel, computeModel };
|
|
@@ -510,7 +758,7 @@ const createQueueSinkPreset = <SpecType extends TriggerKind>(
|
|
|
510
758
|
|
|
511
759
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
512
760
|
return space.db.add(
|
|
513
|
-
Obj.make(
|
|
761
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
514
762
|
name,
|
|
515
763
|
computeGraph: Ref.make(compute.root),
|
|
516
764
|
layout: canvas.graph,
|
|
@@ -525,12 +773,12 @@ const setupQueue = (
|
|
|
525
773
|
) => {
|
|
526
774
|
const queueId = canvasModel.createNode(
|
|
527
775
|
createConstant({
|
|
528
|
-
value:
|
|
776
|
+
value: EID.make({ spaceId: space.id, entityId: Key.EntityId.random() }),
|
|
529
777
|
...(args?.idPosition ? rawPosition(args.idPosition) : position({ x: -18, y: 5, width: 8, height: 6 })),
|
|
530
778
|
}),
|
|
531
779
|
);
|
|
532
780
|
const queue = canvasModel.createNode(
|
|
533
|
-
|
|
781
|
+
createFeed(
|
|
534
782
|
args?.queuePosition ? rawPosition(args.queuePosition) : position({ x: -3, y: 3, width: 14, height: 10 }),
|
|
535
783
|
),
|
|
536
784
|
);
|
|
@@ -538,17 +786,27 @@ const setupQueue = (
|
|
|
538
786
|
return { queue, queueId };
|
|
539
787
|
};
|
|
540
788
|
|
|
541
|
-
const attachTrigger = (functionTrigger:
|
|
789
|
+
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
542
790
|
invariant(functionTrigger);
|
|
543
|
-
functionTrigger.function = Ref.make(computeModel.root);
|
|
544
791
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
545
|
-
functionTrigger
|
|
792
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
793
|
+
functionTrigger.function = Ref.make(computeModel.root);
|
|
794
|
+
functionTrigger.inputNodeId = inputNode.id;
|
|
795
|
+
});
|
|
546
796
|
};
|
|
547
797
|
|
|
548
|
-
type RawPositionInput = {
|
|
798
|
+
type RawPositionInput = {
|
|
799
|
+
centerX: number;
|
|
800
|
+
centerY: number;
|
|
801
|
+
width: number;
|
|
802
|
+
height: number;
|
|
803
|
+
};
|
|
549
804
|
|
|
550
805
|
const rawPosition = (args: RawPositionInput) => {
|
|
551
|
-
return {
|
|
806
|
+
return {
|
|
807
|
+
center: { x: args.centerX, y: args.centerY },
|
|
808
|
+
size: { width: args.width, height: args.height },
|
|
809
|
+
};
|
|
552
810
|
};
|
|
553
811
|
|
|
554
812
|
const position = (rect: { x: number; y: number; width?: number; height?: number }) => {
|
|
@@ -556,7 +814,10 @@ const position = (rect: { x: number; y: number; width?: number; height?: number
|
|
|
556
814
|
const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });
|
|
557
815
|
const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);
|
|
558
816
|
if (width && height) {
|
|
559
|
-
return {
|
|
817
|
+
return {
|
|
818
|
+
center: { x, y },
|
|
819
|
+
size: width && height ? { width, height } : undefined,
|
|
820
|
+
};
|
|
560
821
|
} else {
|
|
561
822
|
return { center: { x, y } };
|
|
562
823
|
}
|
package/src/components/index.ts
CHANGED
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
9
|
-
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
7
|
+
export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));
|
|
10
8
|
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './DebugStatus';
|
|
14
|
-
export * from './Wireframe';
|
|
9
|
+
export * from './SchemaTable';
|
|
10
|
+
export * from './SpaceGenerator';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Tree } from '@dxos/devtools';
|
|
8
|
+
import { Graph } from '@dxos/plugin-graph';
|
|
9
|
+
|
|
10
|
+
export type DebugGraphProps = { graph: Graph.Graph; root: string };
|
|
11
|
+
|
|
12
|
+
export const DebugGraph = ({ graph, root }: DebugGraphProps) => {
|
|
13
|
+
return <Tree data={Graph.toJSON(graph, root)} />;
|
|
14
|
+
};
|