@dxos/plugin-debug 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{browser/DebugGraph-6VMEOKEV.mjs → neutral/DebugGraph-G4FWS57E.mjs} +5 -5
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +7 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs +59 -0
- package/dist/lib/neutral/DebugObjectPanel-UJ63CV25.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.mjs +47 -0
- package/dist/lib/neutral/DebugPlugin.mjs.map +7 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs +18 -0
- package/dist/lib/neutral/DebugPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs +224 -0
- package/dist/lib/neutral/DebugSettings-Z3XADRNK.mjs.map +7 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs +34 -0
- package/dist/lib/neutral/DebugSpaceObjectsPanel-NISULU6U.mjs.map +7 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs +121 -0
- package/dist/lib/neutral/DebugStatus-YB3KFP7G.mjs.map +7 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs +23 -0
- package/dist/lib/neutral/DevtoolsOverviewContainer-YX7Z3D2H.mjs.map +7 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs +143 -0
- package/dist/lib/neutral/SpaceGenerator-UBYB4NPD.mjs.map +7 -0
- package/dist/lib/neutral/Wireframe-7SNRUKET.mjs +52 -0
- package/dist/lib/neutral/Wireframe-7SNRUKET.mjs.map +7 -0
- package/dist/lib/{browser/app-graph-builder-DEBTVBQG.mjs → neutral/app-graph-builder-YPYHL2K5.mjs} +217 -239
- package/dist/lib/neutral/app-graph-builder-YPYHL2K5.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-A5H5GRV6.mjs → neutral/chunk-3OGPOE7H.mjs} +2 -2
- package/dist/lib/{browser/chunk-A5H5GRV6.mjs.map → neutral/chunk-3OGPOE7H.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/{browser/chunk-4UFQXPP7.mjs → neutral/chunk-NFIOTQRZ.mjs} +23 -12
- package/dist/lib/neutral/chunk-NFIOTQRZ.mjs.map +7 -0
- package/dist/lib/{browser/SpaceGenerator-W3LJORYT.mjs → neutral/components/index.mjs} +283 -454
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +21 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +18 -0
- package/dist/lib/neutral/index.mjs.map +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +12 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-context-I3USIAF6.mjs → neutral/react-context-MUZ3KVLU.mjs} +6 -6
- package/dist/lib/neutral/react-context-MUZ3KVLU.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-NH2H63KW.mjs +420 -0
- package/dist/lib/neutral/react-surface-NH2H63KW.mjs.map +7 -0
- package/dist/lib/{browser/settings-SLTQJJNF.mjs → neutral/settings-MPM6YUP4.mjs} +7 -11
- package/dist/lib/neutral/settings-MPM6YUP4.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +83 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +14 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +3 -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/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +11 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/{react-context/react-context.d.ts → react-context.d.ts} +1 -1
- package/dist/types/src/capabilities/react-context.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +9 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/settings.d.ts +7 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts +11 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts +99 -0
- package/dist/types/src/components/DebugSettings/DebugSettings.stories.d.ts.map +1 -0
- package/dist/types/src/components/DebugSettings/index.d.ts +2 -0
- package/dist/types/src/components/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -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 +2 -2
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/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.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/SpaceGenerator/SpaceGenerator.d.ts +11 -0
- package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- 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/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 +9 -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/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +80 -59
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Settings.d.ts +8 -0
- package/dist/types/src/types/Settings.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +69 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +116 -66
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +14 -6
- package/src/capabilities/app-graph-builder.ts +405 -0
- package/src/capabilities/index.ts +6 -4
- package/src/capabilities/{react-context/react-context.tsx → react-context.tsx} +7 -2
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +175 -147
- package/src/capabilities/{settings/settings.ts → settings.ts} +4 -4
- package/src/components/DebugSettings/DebugSettings.stories.tsx +36 -0
- package/src/components/DebugSettings/DebugSettings.tsx +262 -0
- package/src/components/DebugSettings/index.ts +5 -0
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +16 -17
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +49 -63
- package/src/components/index.ts +4 -11
- package/src/{components → containers/DebugGraph}/DebugGraph.tsx +3 -4
- package/src/containers/DebugGraph/index.ts +5 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +76 -0
- package/src/containers/DebugObjectPanel/index.ts +5 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +47 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +5 -0
- package/src/{components → containers/DebugStatus}/DebugStatus.tsx +41 -19
- package/src/containers/DebugStatus/index.ts +5 -0
- package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +8 -3
- package/src/containers/DevtoolsOverviewContainer/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +126 -0
- package/src/containers/SpaceGenerator/index.ts +5 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +3 -7
- package/src/containers/Wireframe/index.ts +5 -0
- package/src/containers/index.ts +13 -0
- package/src/index.ts +1 -1
- package/src/meta.ts +1 -1
- package/src/plugin.ts +10 -0
- package/src/translations.ts +75 -58
- package/src/types/Settings.ts +16 -0
- package/src/{types.ts → types/index.ts} +15 -14
- package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs +0 -19
- package/dist/lib/browser/DevtoolsOverviewContainer-2C6XMJ3L.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-W3LJORYT.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DEBTVBQG.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -126
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-context-I3USIAF6.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FMVC5GPV.mjs +0 -758
- package/dist/lib/browser/react-surface-FMVC5GPV.mjs.map +0 -7
- package/dist/lib/browser/settings-SLTQJJNF.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/index.d.ts +0 -7
- package/dist/types/src/capabilities/react-context/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/index.d.ts +0 -3
- package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +0 -6
- package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugGraph.d.ts +0 -9
- 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 -8
- 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.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 -68
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -421
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/react-context/index.ts +0 -7
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugObjectPanel.tsx +0 -32
- package/src/components/DebugSettings.tsx +0 -185
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -126
- /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/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +0 -0
|
@@ -4,15 +4,14 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { AgentPrompt, WebSearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
|
+
import { Routine, Trigger, Operation } from '@dxos/compute';
|
|
9
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
10
|
-
import { DXN, Filter, Key, Obj, Query, type QueryAST, Ref, Tag
|
|
11
|
-
import { Trigger, serializeFunction } from '@dxos/functions';
|
|
10
|
+
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';
|
|
12
11
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import {
|
|
14
|
-
import { Mailbox } from '@dxos/plugin-inbox
|
|
15
|
-
import { Markdown } from '@dxos/plugin-markdown
|
|
12
|
+
import { InboxOperation } from '@dxos/plugin-inbox';
|
|
13
|
+
import { Mailbox } from '@dxos/plugin-inbox';
|
|
14
|
+
import { Markdown } from '@dxos/plugin-markdown';
|
|
16
15
|
import { type Space } from '@dxos/react-client/echo';
|
|
17
16
|
import {
|
|
18
17
|
type ComputeShape,
|
|
@@ -20,9 +19,9 @@ import {
|
|
|
20
19
|
createChat,
|
|
21
20
|
createComputeGraph,
|
|
22
21
|
createConstant,
|
|
22
|
+
createFeed,
|
|
23
23
|
createFunction,
|
|
24
24
|
createGpt,
|
|
25
|
-
createQueue,
|
|
26
25
|
createRandom,
|
|
27
26
|
createSurface,
|
|
28
27
|
createTemplate,
|
|
@@ -30,7 +29,7 @@ import {
|
|
|
30
29
|
createTrigger,
|
|
31
30
|
} from '@dxos/react-ui-canvas-compute';
|
|
32
31
|
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
33
|
-
import {
|
|
32
|
+
import { ViewModel } from '@dxos/schema';
|
|
34
33
|
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
35
34
|
import { range, trim } from '@dxos/util';
|
|
36
35
|
|
|
@@ -73,8 +72,8 @@ export const generator = () => ({
|
|
|
73
72
|
|
|
74
73
|
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
75
74
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
76
|
-
Obj.
|
|
77
|
-
Obj.getMeta(
|
|
75
|
+
Obj.update(doc, (doc) => {
|
|
76
|
+
Obj.getMeta(doc).tags = [tagDxn];
|
|
78
77
|
});
|
|
79
78
|
|
|
80
79
|
// space.db.add(
|
|
@@ -85,7 +84,9 @@ export const generator = () => ({
|
|
|
85
84
|
// }),
|
|
86
85
|
// );
|
|
87
86
|
|
|
88
|
-
space.db.add(
|
|
87
|
+
space.db.add(
|
|
88
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
89
|
+
);
|
|
89
90
|
space.db.add(
|
|
90
91
|
Obj.make(Person.Person, {
|
|
91
92
|
fullName: 'Josiah',
|
|
@@ -114,7 +115,13 @@ export const generator = () => ({
|
|
|
114
115
|
[
|
|
115
116
|
PresetName.ORG_RESEARCH_PROJECT,
|
|
116
117
|
async (space, n, cb) => {
|
|
117
|
-
const
|
|
118
|
+
const mailboxes = await space.db.query(Filter.type(Mailbox.Mailbox)).run();
|
|
119
|
+
const mailbox = mailboxes[0];
|
|
120
|
+
invariant(mailbox, 'Mailbox not found');
|
|
121
|
+
const mailboxFeed = await mailbox.feed?.tryLoad();
|
|
122
|
+
invariant(mailboxFeed, 'Mailbox missing feed reference');
|
|
123
|
+
const queueDxn = Feed.getQueueDxn(mailboxFeed)?.toString();
|
|
124
|
+
invariant(queueDxn, 'Mailbox feed missing queue DXN key');
|
|
118
125
|
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
119
126
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
120
127
|
|
|
@@ -126,34 +133,16 @@ export const generator = () => ({
|
|
|
126
133
|
space.db.add(
|
|
127
134
|
Trigger.make({
|
|
128
135
|
enabled: true,
|
|
129
|
-
spec:
|
|
130
|
-
|
|
131
|
-
cron: '* * * * *', // Every minute.
|
|
132
|
-
},
|
|
133
|
-
function: Ref.make(serializeFunction(gmail.sync)),
|
|
136
|
+
spec: Trigger.specTimer('* * * * *'), // Every minute.
|
|
137
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
134
138
|
input: {
|
|
135
139
|
mailbox: Ref.make(mailbox),
|
|
136
140
|
},
|
|
137
141
|
}),
|
|
138
142
|
);
|
|
139
143
|
|
|
140
|
-
space.db.add(
|
|
141
|
-
Trigger.make({
|
|
142
|
-
enabled: true,
|
|
143
|
-
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
144
|
-
spec: {
|
|
145
|
-
kind: 'queue',
|
|
146
|
-
queue: mailbox.queue.dxn.toString(),
|
|
147
|
-
},
|
|
148
|
-
function: Ref.make(serializeFunction(EntityExtraction.extract)),
|
|
149
|
-
input: {
|
|
150
|
-
source: '{{event.item}}',
|
|
151
|
-
},
|
|
152
|
-
}),
|
|
153
|
-
);
|
|
154
|
-
|
|
155
144
|
const researchPrompt = space.db.add(
|
|
156
|
-
|
|
145
|
+
Routine.make({
|
|
157
146
|
name: 'Research',
|
|
158
147
|
description: 'Research organization',
|
|
159
148
|
input: Schema.Struct({
|
|
@@ -168,20 +157,15 @@ export const generator = () => ({
|
|
|
168
157
|
Create a research note for it at the end.
|
|
169
158
|
NOTE: Do mocked reseach (set mockSearch to true).
|
|
170
159
|
`,
|
|
171
|
-
blueprints: [Ref.make(
|
|
160
|
+
blueprints: [Ref.make(WebSearchBlueprint.make())],
|
|
172
161
|
}),
|
|
173
162
|
);
|
|
174
163
|
|
|
175
164
|
space.db.add(
|
|
176
165
|
Trigger.make({
|
|
177
166
|
enabled: true,
|
|
178
|
-
spec:
|
|
179
|
-
|
|
180
|
-
query: {
|
|
181
|
-
ast: organizationsQuery.ast,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
function: Ref.make(serializeFunction(Agent.prompt)),
|
|
167
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
168
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
185
169
|
input: {
|
|
186
170
|
prompt: Ref.make(researchPrompt),
|
|
187
171
|
input: '{{event.subject}}',
|
|
@@ -189,27 +173,27 @@ export const generator = () => ({
|
|
|
189
173
|
}),
|
|
190
174
|
);
|
|
191
175
|
|
|
192
|
-
const mailboxView =
|
|
176
|
+
const mailboxView = ViewModel.make({
|
|
193
177
|
query: Query.select(
|
|
194
178
|
Filter.type(Message.Message, {
|
|
195
179
|
properties: { labels: Filter.contains('investor') },
|
|
196
180
|
}),
|
|
197
|
-
).
|
|
198
|
-
queues: [
|
|
181
|
+
).from({
|
|
182
|
+
queues: [queueDxn],
|
|
199
183
|
}),
|
|
200
|
-
jsonSchema:
|
|
184
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
201
185
|
});
|
|
202
|
-
const contactsView =
|
|
186
|
+
const contactsView = ViewModel.make({
|
|
203
187
|
query: contactsQuery,
|
|
204
|
-
jsonSchema:
|
|
188
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
205
189
|
});
|
|
206
|
-
const organizationsView =
|
|
190
|
+
const organizationsView = ViewModel.make({
|
|
207
191
|
query: organizationsQuery,
|
|
208
|
-
jsonSchema:
|
|
192
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
209
193
|
});
|
|
210
|
-
const notesView =
|
|
194
|
+
const notesView = ViewModel.make({
|
|
211
195
|
query: notesQuery,
|
|
212
|
-
jsonSchema:
|
|
196
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
213
197
|
});
|
|
214
198
|
|
|
215
199
|
return space.db.add(
|
|
@@ -307,7 +291,7 @@ export const generator = () => ({
|
|
|
307
291
|
'subscription',
|
|
308
292
|
(triggerSpec) =>
|
|
309
293
|
(triggerSpec.query = {
|
|
310
|
-
ast: Query.select(Filter.typename('dxos.
|
|
294
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
311
295
|
}),
|
|
312
296
|
'type',
|
|
313
297
|
);
|
|
@@ -392,7 +376,7 @@ export const generator = () => ({
|
|
|
392
376
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
393
377
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
394
378
|
// templateComputeNode.value = templateContent.join('\n');
|
|
395
|
-
// templateComputeNode.inputSchema =
|
|
379
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
396
380
|
|
|
397
381
|
// attachTrigger(functionTrigger, computeModel);
|
|
398
382
|
|
|
@@ -526,7 +510,7 @@ export const generator = () => ({
|
|
|
526
510
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
527
511
|
// templateComputeNode.value = templateContent.join('\n');
|
|
528
512
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
529
|
-
// templateComputeNode.inputSchema =
|
|
513
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
530
514
|
|
|
531
515
|
// attachTrigger(functionTrigger, computeModel);
|
|
532
516
|
|
|
@@ -609,7 +593,7 @@ export const generator = () => ({
|
|
|
609
593
|
);
|
|
610
594
|
const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));
|
|
611
595
|
const view = canvasModel.createNode(createText(position({ x: 12, y: 0 })));
|
|
612
|
-
const queue = canvasModel.createNode(
|
|
596
|
+
const queue = canvasModel.createNode(createFeed(position({ x: 0, y: 12 })));
|
|
613
597
|
|
|
614
598
|
builder
|
|
615
599
|
.createEdge({
|
|
@@ -754,8 +738,8 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
754
738
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
755
739
|
const triggerSpec = functionTrigger.spec;
|
|
756
740
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
757
|
-
Obj.
|
|
758
|
-
initSpec(
|
|
741
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
742
|
+
initSpec(functionTrigger.spec as any);
|
|
759
743
|
});
|
|
760
744
|
});
|
|
761
745
|
|
|
@@ -765,7 +749,9 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
765
749
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
766
750
|
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
767
751
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
768
|
-
templateComputeNode.inputSchema =
|
|
752
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
753
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
754
|
+
);
|
|
769
755
|
attachTrigger(functionTrigger, computeModel);
|
|
770
756
|
|
|
771
757
|
return { canvasModel, computeModel };
|
|
@@ -793,7 +779,7 @@ const setupQueue = (
|
|
|
793
779
|
}),
|
|
794
780
|
);
|
|
795
781
|
const queue = canvasModel.createNode(
|
|
796
|
-
|
|
782
|
+
createFeed(
|
|
797
783
|
args?.queuePosition ? rawPosition(args.queuePosition) : position({ x: -3, y: 3, width: 14, height: 10 }),
|
|
798
784
|
),
|
|
799
785
|
);
|
|
@@ -804,9 +790,9 @@ const setupQueue = (
|
|
|
804
790
|
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
805
791
|
invariant(functionTrigger);
|
|
806
792
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
807
|
-
Obj.
|
|
808
|
-
|
|
809
|
-
|
|
793
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
794
|
+
functionTrigger.function = Ref.make(computeModel.root);
|
|
795
|
+
functionTrigger.inputNodeId = inputNode.id;
|
|
810
796
|
});
|
|
811
797
|
};
|
|
812
798
|
|
package/src/components/index.ts
CHANGED
|
@@ -2,16 +2,9 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { lazy } from 'react';
|
|
6
|
-
import { type FC } from 'react';
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
export const DebugSettings: ComponentType<any> = lazy(() => import('./DebugSettings'));
|
|
9
8
|
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
13
|
-
|
|
14
|
-
export * from './DebugObjectPanel';
|
|
15
|
-
export * from './DebugSettings';
|
|
16
|
-
export * from './DebugStatus';
|
|
17
|
-
export * from './Wireframe';
|
|
9
|
+
export * from './SchemaTable';
|
|
10
|
+
export * from './SpaceGenerator';
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import React
|
|
5
|
+
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Tree } from '@dxos/devtools';
|
|
8
8
|
import { Graph } from '@dxos/plugin-graph';
|
|
9
9
|
|
|
10
10
|
export type DebugGraphProps = { graph: Graph.Graph; root: string };
|
|
11
|
-
|
|
11
|
+
|
|
12
|
+
export const DebugGraph = ({ graph, root }: DebugGraphProps) => {
|
|
12
13
|
return <Tree data={Graph.toJSON(graph, root)} />;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
export default DebugGraph;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { ObjectsTree } from '@dxos/devtools';
|
|
9
|
+
import { Filter, Json, Obj, Query } from '@dxos/echo';
|
|
10
|
+
import type { ObjectId } from '@dxos/keys';
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { Clipboard, Input, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { Syntax } from '@dxos/react-ui-syntax-highlighter';
|
|
14
|
+
import { mx } from '@dxos/ui-theme';
|
|
15
|
+
|
|
16
|
+
export type DebugObjectPanelProps = Pick<
|
|
17
|
+
AppSurface.ObjectArticleProps<Obj.Unknown, {}, Obj.Unknown>,
|
|
18
|
+
'role' | 'companionTo'
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export const DebugObjectPanel = ({ role, companionTo }: DebugObjectPanelProps) => {
|
|
22
|
+
const db = Obj.getDatabase(companionTo);
|
|
23
|
+
const [selectedId, setSelectedId] = useState<ObjectId | null>(null);
|
|
24
|
+
const [depth, setDepth] = useState(0);
|
|
25
|
+
const [selectedObject] = useQuery(
|
|
26
|
+
db,
|
|
27
|
+
Query.select(Filter.id(selectedId ?? companionTo.id)).options({ deleted: 'include' }),
|
|
28
|
+
);
|
|
29
|
+
const refReplacer = useMemo(() => (db ? Json.createRefReplacer({ db, depth }) : undefined), [db, depth]);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<Clipboard.Provider>
|
|
33
|
+
<Panel.Root role={role}>
|
|
34
|
+
<Panel.Toolbar asChild>
|
|
35
|
+
<Toolbar.Root />
|
|
36
|
+
</Panel.Toolbar>
|
|
37
|
+
<Panel.Content asChild>
|
|
38
|
+
<div className={mx('grid divide-y divide-separator', db && 'grid-rows-[1fr_2fr]')}>
|
|
39
|
+
{db && (
|
|
40
|
+
<ScrollArea.Root>
|
|
41
|
+
<ScrollArea.Viewport>
|
|
42
|
+
<ObjectsTree db={db} root={companionTo} onSelect={(entity) => setSelectedId(entity.id)} />
|
|
43
|
+
</ScrollArea.Viewport>
|
|
44
|
+
</ScrollArea.Root>
|
|
45
|
+
)}
|
|
46
|
+
<Syntax.Root data={selectedObject} replacer={refReplacer}>
|
|
47
|
+
<Panel.Root>
|
|
48
|
+
<Panel.Toolbar asChild>
|
|
49
|
+
<Toolbar.Root classNames='grid grid-cols-[1fr_3rem]'>
|
|
50
|
+
<Syntax.Filter />
|
|
51
|
+
<Input.Root>
|
|
52
|
+
<Input.TextInput
|
|
53
|
+
variant='subdued'
|
|
54
|
+
type='number'
|
|
55
|
+
min={0}
|
|
56
|
+
step={1}
|
|
57
|
+
aria-label='Ref depth'
|
|
58
|
+
value={depth}
|
|
59
|
+
onChange={(event) => setDepth(Math.max(0, Number(event.target.value) || 0))}
|
|
60
|
+
/>
|
|
61
|
+
</Input.Root>
|
|
62
|
+
</Toolbar.Root>
|
|
63
|
+
</Panel.Toolbar>
|
|
64
|
+
<Panel.Content asChild>
|
|
65
|
+
<Syntax.Viewport>
|
|
66
|
+
<Syntax.Code />
|
|
67
|
+
</Syntax.Viewport>
|
|
68
|
+
</Panel.Content>
|
|
69
|
+
</Panel.Root>
|
|
70
|
+
</Syntax.Root>
|
|
71
|
+
</div>
|
|
72
|
+
</Panel.Content>
|
|
73
|
+
</Panel.Root>
|
|
74
|
+
</Clipboard.Provider>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { ObjectsTree } from '@dxos/devtools';
|
|
9
|
+
import { Filter, Query } from '@dxos/echo';
|
|
10
|
+
import { type ObjectId } from '@dxos/keys';
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { Clipboard, Grid, Input, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
14
|
+
|
|
15
|
+
export type DebugSpaceObjectsPanelProps = AppSurface.SpaceArticleProps;
|
|
16
|
+
|
|
17
|
+
export const DebugSpaceObjectsPanel = ({ space }: DebugSpaceObjectsPanelProps) => {
|
|
18
|
+
const [selectedId, setSelectedId] = useState<ObjectId | null>(null);
|
|
19
|
+
const [selectedObject] = useQuery(
|
|
20
|
+
space.db,
|
|
21
|
+
selectedId ? Query.select(Filter.id(selectedId)) : Query.select(Filter.nothing()),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Clipboard.Provider>
|
|
26
|
+
<Panel.Root>
|
|
27
|
+
<Panel.Toolbar asChild>
|
|
28
|
+
<Toolbar.Root>
|
|
29
|
+
<Input.Root>
|
|
30
|
+
<Input.TextInput disabled placeholder='Search...' />
|
|
31
|
+
</Input.Root>
|
|
32
|
+
</Toolbar.Root>
|
|
33
|
+
</Panel.Toolbar>
|
|
34
|
+
<Panel.Content asChild>
|
|
35
|
+
<Grid rows={2} classNames='divide-y divide-separator'>
|
|
36
|
+
<ScrollArea.Root>
|
|
37
|
+
<ScrollArea.Viewport>
|
|
38
|
+
<ObjectsTree db={space.db} onSelect={(entity) => setSelectedId(entity.id)} />
|
|
39
|
+
</ScrollArea.Viewport>
|
|
40
|
+
</ScrollArea.Root>
|
|
41
|
+
{selectedObject && <JsonHighlighter classNames='p-1' data={selectedObject} />}
|
|
42
|
+
</Grid>
|
|
43
|
+
</Panel.Content>
|
|
44
|
+
</Panel.Root>
|
|
45
|
+
</Clipboard.Provider>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
import React, { useEffect, useRef, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { TimeoutError } from '@dxos/async';
|
|
8
|
-
import {
|
|
9
|
-
import { StatusBar } from '@dxos/plugin-status-bar';
|
|
8
|
+
import { StatusBar } from '@dxos/plugin-status-bar/components';
|
|
10
9
|
import { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';
|
|
11
10
|
import { useNetworkStatus } from '@dxos/react-client/mesh';
|
|
12
|
-
import {
|
|
11
|
+
import { IconButton } from '@dxos/react-ui';
|
|
13
12
|
|
|
14
13
|
const styles = {
|
|
15
14
|
success: 'text-sky-300 dark:text-green-700',
|
|
@@ -89,14 +88,20 @@ const ErrorIndicator = () => {
|
|
|
89
88
|
|
|
90
89
|
if (errorRef.current) {
|
|
91
90
|
return (
|
|
92
|
-
<StatusBar.
|
|
93
|
-
<
|
|
94
|
-
|
|
91
|
+
<StatusBar.Item>
|
|
92
|
+
<IconButton
|
|
93
|
+
icon='ph--warning-circle--duotone'
|
|
94
|
+
iconOnly
|
|
95
|
+
label={errorRef.current.message}
|
|
96
|
+
classNames={styles.error}
|
|
97
|
+
onClick={handleReset}
|
|
98
|
+
/>
|
|
99
|
+
</StatusBar.Item>
|
|
95
100
|
);
|
|
96
101
|
} else {
|
|
97
102
|
return (
|
|
98
|
-
<StatusBar.Item
|
|
99
|
-
<
|
|
103
|
+
<StatusBar.Item>
|
|
104
|
+
<IconButton variant='ghost' icon='ph--check--regular' iconOnly label='No errors.' />
|
|
100
105
|
</StatusBar.Item>
|
|
101
106
|
);
|
|
102
107
|
}
|
|
@@ -114,14 +119,20 @@ const SwarmIndicator = () => {
|
|
|
114
119
|
|
|
115
120
|
if (state === 0) {
|
|
116
121
|
return (
|
|
117
|
-
<StatusBar.Item
|
|
118
|
-
<
|
|
122
|
+
<StatusBar.Item>
|
|
123
|
+
<IconButton variant='ghost' icon='ph--lightning--regular' iconOnly label='Connected to swarm.' />
|
|
119
124
|
</StatusBar.Item>
|
|
120
125
|
);
|
|
121
126
|
} else {
|
|
122
127
|
return (
|
|
123
|
-
<StatusBar.Item
|
|
124
|
-
<
|
|
128
|
+
<StatusBar.Item>
|
|
129
|
+
<IconButton
|
|
130
|
+
variant='ghost'
|
|
131
|
+
icon='ph--lightning-slash--regular'
|
|
132
|
+
iconOnly
|
|
133
|
+
label='Disconnected from swarm.'
|
|
134
|
+
classNames={styles.warning}
|
|
135
|
+
/>
|
|
125
136
|
</StatusBar.Item>
|
|
126
137
|
);
|
|
127
138
|
}
|
|
@@ -133,7 +144,6 @@ const SwarmIndicator = () => {
|
|
|
133
144
|
// TODO(burdon): Merge with SaveStatus.
|
|
134
145
|
const SavingIndicator = () => {
|
|
135
146
|
const [state, _setState] = useState(0);
|
|
136
|
-
const _space = useActiveSpace();
|
|
137
147
|
// TODO(dmaretskyi): Fix this when we have save status for automerge.
|
|
138
148
|
// useEffect(() => {
|
|
139
149
|
// if (!space) {
|
|
@@ -156,21 +166,33 @@ const SavingIndicator = () => {
|
|
|
156
166
|
switch (state) {
|
|
157
167
|
case 2:
|
|
158
168
|
return (
|
|
159
|
-
<StatusBar.Item
|
|
160
|
-
<
|
|
169
|
+
<StatusBar.Item>
|
|
170
|
+
<IconButton
|
|
171
|
+
variant='ghost'
|
|
172
|
+
icon='ph--circle--duotone'
|
|
173
|
+
iconOnly
|
|
174
|
+
label='Edit not saved.'
|
|
175
|
+
classNames={styles.warning}
|
|
176
|
+
/>
|
|
161
177
|
</StatusBar.Item>
|
|
162
178
|
);
|
|
163
179
|
case 1:
|
|
164
180
|
return (
|
|
165
|
-
<StatusBar.Item
|
|
166
|
-
<
|
|
181
|
+
<StatusBar.Item>
|
|
182
|
+
<IconButton
|
|
183
|
+
variant='ghost'
|
|
184
|
+
icon='ph--circle--duotone'
|
|
185
|
+
iconOnly
|
|
186
|
+
label='Saving...'
|
|
187
|
+
classNames={styles.success}
|
|
188
|
+
/>
|
|
167
189
|
</StatusBar.Item>
|
|
168
190
|
);
|
|
169
191
|
case 0:
|
|
170
192
|
default:
|
|
171
193
|
return (
|
|
172
|
-
<StatusBar.Item
|
|
173
|
-
<
|
|
194
|
+
<StatusBar.Item>
|
|
195
|
+
<IconButton variant='ghost' icon='ph--circle--duotone' iconOnly label='Modified indicator.' />
|
|
174
196
|
</StatusBar.Item>
|
|
175
197
|
);
|
|
176
198
|
}
|
package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx
RENAMED
|
@@ -9,12 +9,17 @@ import { StatsPanel, useStats } from '@dxos/devtools';
|
|
|
9
9
|
|
|
10
10
|
export const DevtoolsOverviewContainer = () => {
|
|
11
11
|
const [stats, refreshStats] = useStats();
|
|
12
|
+
const surfaceProfilerStats = Surface.useProfilerStats();
|
|
13
|
+
const clearSurfaceProfiler = Surface.useProfilerClear();
|
|
12
14
|
|
|
13
15
|
return (
|
|
14
|
-
<StatsPanel
|
|
16
|
+
<StatsPanel
|
|
17
|
+
stats={stats}
|
|
18
|
+
surfaceProfilerStats={surfaceProfilerStats}
|
|
19
|
+
onRefresh={refreshStats}
|
|
20
|
+
onClearSurfaceProfiler={clearSurfaceProfiler}
|
|
21
|
+
>
|
|
15
22
|
<Surface.Surface role='devtools-overview' />
|
|
16
23
|
</StatsPanel>
|
|
17
24
|
);
|
|
18
25
|
};
|
|
19
|
-
|
|
20
|
-
export default DevtoolsOverviewContainer;
|