@dxos/plugin-debug 0.8.4-main.937b3ca → 0.8.4-main.abd8ff62ef
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/index.mjs +19 -118
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +81 -0
- package/dist/lib/browser/translations.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 +97 -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 +3 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +78 -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 +89 -70
- package/src/DebugPlugin.node.ts +18 -0
- package/src/DebugPlugin.test.ts +29 -0
- package/src/DebugPlugin.tsx +20 -11
- package/src/capabilities/app-graph-builder.ts +405 -0
- package/src/capabilities/index.ts +6 -4
- package/src/capabilities/react-context.tsx +25 -0
- package/src/capabilities/react-surface.tsx +439 -0
- package/src/capabilities/{settings/settings.ts → settings.ts} +7 -6
- 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 +14 -15
- package/src/components/SpaceGenerator/draw-util.ts +8 -8
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +55 -73
- 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/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +25 -0
- 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 +7 -1
- package/src/meta.ts +1 -1
- 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 +0 -15
- package/dist/lib/browser/DebugGraph-6VMEOKEV.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs +0 -19
- package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-ZHVZWGM7.mjs +0 -1150
- package/dist/lib/browser/SpaceGenerator-ZHVZWGM7.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-FBDRMMYF.mjs +0 -597
- package/dist/lib/browser/app-graph-builder-FBDRMMYF.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs +0 -78
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/chunk-A5H5GRV6.mjs +0 -20
- package/dist/lib/browser/chunk-A5H5GRV6.mjs.map +0 -7
- package/dist/lib/browser/react-context-FSWBT3MH.mjs +0 -17
- package/dist/lib/browser/react-context-FSWBT3MH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-W62RJ32U.mjs +0 -757
- package/dist/lib/browser/react-surface-W62RJ32U.mjs.map +0 -7
- package/dist/lib/browser/settings-KA4GN73K.mjs +0 -31
- package/dist/lib/browser/settings-KA4GN73K.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 -5
- 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 -419
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/react-context/index.ts +0 -7
- package/src/capabilities/react-context/react-context.tsx +0 -20
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -409
- package/src/capabilities/settings/index.ts +0 -7
- package/src/components/Container.tsx +0 -15
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/DebugSettings.tsx +0 -185
- package/src/components/DevtoolsOverviewContainer.tsx +0 -20
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +0 -127
- /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,13 +4,12 @@
|
|
|
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, 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 {
|
|
12
|
+
import { InboxOperation } from '@dxos/plugin-inbox/operations';
|
|
14
13
|
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
15
14
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
16
15
|
import { type Space } from '@dxos/react-client/echo';
|
|
@@ -20,24 +19,18 @@ 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,
|
|
29
28
|
createText,
|
|
30
29
|
createTrigger,
|
|
31
30
|
} from '@dxos/react-ui-canvas-compute';
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
pointMultiply,
|
|
36
|
-
pointsToRect,
|
|
37
|
-
rectToPoints,
|
|
38
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
39
|
-
import { View } from '@dxos/schema';
|
|
40
|
-
import { Message, Organization, Person, Project } from '@dxos/types';
|
|
31
|
+
import { CanvasBoard, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
32
|
+
import { ViewModel } from '@dxos/schema';
|
|
33
|
+
import { Message, Organization, Person, Pipeline } from '@dxos/types';
|
|
41
34
|
import { range, trim } from '@dxos/util';
|
|
42
35
|
|
|
43
36
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
@@ -57,7 +50,7 @@ export enum PresetName {
|
|
|
57
50
|
}
|
|
58
51
|
|
|
59
52
|
export const generator = () => ({
|
|
60
|
-
schemas: [
|
|
53
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
61
54
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
62
55
|
items: [
|
|
63
56
|
[
|
|
@@ -79,8 +72,8 @@ export const generator = () => ({
|
|
|
79
72
|
|
|
80
73
|
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
81
74
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
82
|
-
Obj.
|
|
83
|
-
Obj.getMeta(
|
|
75
|
+
Obj.update(doc, (doc) => {
|
|
76
|
+
Obj.getMeta(doc).tags = [tagDxn];
|
|
84
77
|
});
|
|
85
78
|
|
|
86
79
|
// space.db.add(
|
|
@@ -91,7 +84,9 @@ export const generator = () => ({
|
|
|
91
84
|
// }),
|
|
92
85
|
// );
|
|
93
86
|
|
|
94
|
-
space.db.add(
|
|
87
|
+
space.db.add(
|
|
88
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
89
|
+
);
|
|
95
90
|
space.db.add(
|
|
96
91
|
Obj.make(Person.Person, {
|
|
97
92
|
fullName: 'Josiah',
|
|
@@ -120,7 +115,13 @@ export const generator = () => ({
|
|
|
120
115
|
[
|
|
121
116
|
PresetName.ORG_RESEARCH_PROJECT,
|
|
122
117
|
async (space, n, cb) => {
|
|
123
|
-
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');
|
|
124
125
|
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
125
126
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
126
127
|
|
|
@@ -132,34 +133,16 @@ export const generator = () => ({
|
|
|
132
133
|
space.db.add(
|
|
133
134
|
Trigger.make({
|
|
134
135
|
enabled: true,
|
|
135
|
-
spec:
|
|
136
|
-
|
|
137
|
-
cron: '* * * * *', // Every minute.
|
|
138
|
-
},
|
|
139
|
-
function: Ref.make(serializeFunction(gmail.sync)),
|
|
136
|
+
spec: Trigger.specTimer('* * * * *'), // Every minute.
|
|
137
|
+
function: Ref.make(Operation.serialize(InboxOperation.GoogleMailSync)),
|
|
140
138
|
input: {
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
}),
|
|
144
|
-
);
|
|
145
|
-
|
|
146
|
-
space.db.add(
|
|
147
|
-
Trigger.make({
|
|
148
|
-
enabled: true,
|
|
149
|
-
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
150
|
-
spec: {
|
|
151
|
-
kind: 'queue',
|
|
152
|
-
queue: mailbox.queue.dxn.toString(),
|
|
153
|
-
},
|
|
154
|
-
function: Ref.make(serializeFunction(EntityExtraction.extract)),
|
|
155
|
-
input: {
|
|
156
|
-
source: '{{event.item}}',
|
|
139
|
+
mailbox: Ref.make(mailbox),
|
|
157
140
|
},
|
|
158
141
|
}),
|
|
159
142
|
);
|
|
160
143
|
|
|
161
144
|
const researchPrompt = space.db.add(
|
|
162
|
-
|
|
145
|
+
Routine.make({
|
|
163
146
|
name: 'Research',
|
|
164
147
|
description: 'Research organization',
|
|
165
148
|
input: Schema.Struct({
|
|
@@ -174,20 +157,15 @@ export const generator = () => ({
|
|
|
174
157
|
Create a research note for it at the end.
|
|
175
158
|
NOTE: Do mocked reseach (set mockSearch to true).
|
|
176
159
|
`,
|
|
177
|
-
blueprints: [Ref.make(
|
|
160
|
+
blueprints: [Ref.make(WebSearchBlueprint.make())],
|
|
178
161
|
}),
|
|
179
162
|
);
|
|
180
163
|
|
|
181
164
|
space.db.add(
|
|
182
165
|
Trigger.make({
|
|
183
166
|
enabled: true,
|
|
184
|
-
spec:
|
|
185
|
-
|
|
186
|
-
query: {
|
|
187
|
-
ast: organizationsQuery.ast,
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
function: Ref.make(serializeFunction(Agent.prompt)),
|
|
167
|
+
spec: Trigger.specSubscription(organizationsQuery),
|
|
168
|
+
function: Ref.make(Operation.serialize(AgentPrompt)),
|
|
191
169
|
input: {
|
|
192
170
|
prompt: Ref.make(researchPrompt),
|
|
193
171
|
input: '{{event.subject}}',
|
|
@@ -195,31 +173,31 @@ export const generator = () => ({
|
|
|
195
173
|
}),
|
|
196
174
|
);
|
|
197
175
|
|
|
198
|
-
const mailboxView =
|
|
176
|
+
const mailboxView = ViewModel.make({
|
|
199
177
|
query: Query.select(
|
|
200
178
|
Filter.type(Message.Message, {
|
|
201
179
|
properties: { labels: Filter.contains('investor') },
|
|
202
180
|
}),
|
|
203
|
-
).
|
|
204
|
-
queues: [
|
|
181
|
+
).from({
|
|
182
|
+
queues: [queueDxn],
|
|
205
183
|
}),
|
|
206
|
-
jsonSchema:
|
|
184
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
207
185
|
});
|
|
208
|
-
const contactsView =
|
|
186
|
+
const contactsView = ViewModel.make({
|
|
209
187
|
query: contactsQuery,
|
|
210
|
-
jsonSchema:
|
|
188
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
211
189
|
});
|
|
212
|
-
const organizationsView =
|
|
190
|
+
const organizationsView = ViewModel.make({
|
|
213
191
|
query: organizationsQuery,
|
|
214
|
-
jsonSchema:
|
|
192
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
215
193
|
});
|
|
216
|
-
const notesView =
|
|
194
|
+
const notesView = ViewModel.make({
|
|
217
195
|
query: notesQuery,
|
|
218
|
-
jsonSchema:
|
|
196
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
219
197
|
});
|
|
220
198
|
|
|
221
199
|
return space.db.add(
|
|
222
|
-
|
|
200
|
+
Pipeline.make({
|
|
223
201
|
name: 'Investor Research',
|
|
224
202
|
columns: [
|
|
225
203
|
{
|
|
@@ -313,7 +291,7 @@ export const generator = () => ({
|
|
|
313
291
|
'subscription',
|
|
314
292
|
(triggerSpec) =>
|
|
315
293
|
(triggerSpec.query = {
|
|
316
|
-
ast: Query.select(Filter.typename('dxos.
|
|
294
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
317
295
|
}),
|
|
318
296
|
'type',
|
|
319
297
|
);
|
|
@@ -398,7 +376,7 @@ export const generator = () => ({
|
|
|
398
376
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
399
377
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
400
378
|
// templateComputeNode.value = templateContent.join('\n');
|
|
401
|
-
// templateComputeNode.inputSchema =
|
|
379
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
402
380
|
|
|
403
381
|
// attachTrigger(functionTrigger, computeModel);
|
|
404
382
|
|
|
@@ -532,7 +510,7 @@ export const generator = () => ({
|
|
|
532
510
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
533
511
|
// templateComputeNode.value = templateContent.join('\n');
|
|
534
512
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
535
|
-
// templateComputeNode.inputSchema =
|
|
513
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
536
514
|
|
|
537
515
|
// attachTrigger(functionTrigger, computeModel);
|
|
538
516
|
|
|
@@ -615,7 +593,7 @@ export const generator = () => ({
|
|
|
615
593
|
);
|
|
616
594
|
const converter = canvasModel.createNode(createFunction(position({ x: 0, y: 0 })));
|
|
617
595
|
const view = canvasModel.createNode(createText(position({ x: 12, y: 0 })));
|
|
618
|
-
const queue = canvasModel.createNode(
|
|
596
|
+
const queue = canvasModel.createNode(createFeed(position({ x: 0, y: 12 })));
|
|
619
597
|
|
|
620
598
|
builder
|
|
621
599
|
.createEdge({
|
|
@@ -712,7 +690,7 @@ export const generator = () => ({
|
|
|
712
690
|
const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
713
691
|
space: Space,
|
|
714
692
|
triggerKind: SpecType,
|
|
715
|
-
initSpec: (spec: Extract<Trigger.Spec, { kind: SpecType }
|
|
693
|
+
initSpec: (spec: Obj.Mutable<Extract<Trigger.Spec, { kind: SpecType }>>) => void,
|
|
716
694
|
triggerOutputName: string,
|
|
717
695
|
) => {
|
|
718
696
|
const canvasModel = CanvasGraphModel.create<ComputeShape>();
|
|
@@ -760,7 +738,9 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
760
738
|
functionTrigger = triggerShape.functionTrigger!.target!;
|
|
761
739
|
const triggerSpec = functionTrigger.spec;
|
|
762
740
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, 'No trigger spec.');
|
|
763
|
-
|
|
741
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
742
|
+
initSpec(functionTrigger.spec as any);
|
|
743
|
+
});
|
|
764
744
|
});
|
|
765
745
|
|
|
766
746
|
const computeModel = createComputeGraph(canvasModel);
|
|
@@ -769,7 +749,9 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
769
749
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
770
750
|
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
771
751
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
772
|
-
templateComputeNode.inputSchema =
|
|
752
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
753
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
754
|
+
);
|
|
773
755
|
attachTrigger(functionTrigger, computeModel);
|
|
774
756
|
|
|
775
757
|
return { canvasModel, computeModel };
|
|
@@ -777,7 +759,7 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
777
759
|
|
|
778
760
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
779
761
|
return space.db.add(
|
|
780
|
-
Obj.make(
|
|
762
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
781
763
|
name,
|
|
782
764
|
computeGraph: Ref.make(compute.root),
|
|
783
765
|
layout: canvas.graph,
|
|
@@ -797,7 +779,7 @@ const setupQueue = (
|
|
|
797
779
|
}),
|
|
798
780
|
);
|
|
799
781
|
const queue = canvasModel.createNode(
|
|
800
|
-
|
|
782
|
+
createFeed(
|
|
801
783
|
args?.queuePosition ? rawPosition(args.queuePosition) : position({ x: -3, y: 3, width: 14, height: 10 }),
|
|
802
784
|
),
|
|
803
785
|
);
|
|
@@ -808,9 +790,9 @@ const setupQueue = (
|
|
|
808
790
|
const attachTrigger = (functionTrigger: Trigger.Trigger | undefined, computeModel: ComputeGraphModel) => {
|
|
809
791
|
invariant(functionTrigger);
|
|
810
792
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;
|
|
811
|
-
Obj.
|
|
812
|
-
|
|
813
|
-
|
|
793
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
794
|
+
functionTrigger.function = Ref.make(computeModel.root);
|
|
795
|
+
functionTrigger.inputNodeId = inputNode.id;
|
|
814
796
|
});
|
|
815
797
|
};
|
|
816
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 role='none' 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
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
|
+
import { StatsPanel, useStats } from '@dxos/devtools';
|
|
9
|
+
|
|
10
|
+
export const DevtoolsOverviewContainer = () => {
|
|
11
|
+
const [stats, refreshStats] = useStats();
|
|
12
|
+
const surfaceProfilerStats = Surface.useProfilerStats();
|
|
13
|
+
const clearSurfaceProfiler = Surface.useProfilerClear();
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<StatsPanel
|
|
17
|
+
stats={stats}
|
|
18
|
+
surfaceProfilerStats={surfaceProfilerStats}
|
|
19
|
+
onRefresh={refreshStats}
|
|
20
|
+
onClearSurfaceProfiler={clearSurfaceProfiler}
|
|
21
|
+
>
|
|
22
|
+
<Surface.Surface role='devtools-overview' />
|
|
23
|
+
</StatsPanel>
|
|
24
|
+
);
|
|
25
|
+
};
|