@dxos/plugin-debug 0.8.4-main.bc674ce → 0.8.4-main.c351d160a8
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 → DebugGraph-7HXJ2PS2.mjs} +4 -3
- package/dist/lib/browser/{DebugGraph-6VMEOKEV.mjs.map → DebugGraph-7HXJ2PS2.mjs.map} +4 -4
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs +35 -0
- package/dist/lib/browser/DebugObjectPanel-KXVFOGU6.mjs.map +7 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs +174 -0
- package/dist/lib/browser/DebugSettings-XNAKCV2F.mjs.map +7 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs +45 -0
- package/dist/lib/browser/DebugSpaceObjectsPanel-SIK72DXV.mjs.map +7 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs +125 -0
- package/dist/lib/browser/DebugStatus-COQGH37G.mjs.map +7 -0
- package/dist/lib/browser/{DevtoolsOverviewContainer-77PKFLYV.mjs → DevtoolsOverviewContainer-C75NFVER.mjs} +6 -5
- package/dist/lib/browser/DevtoolsOverviewContainer-C75NFVER.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-H33AEFGC.mjs → SpaceGenerator-Q2GH6S6D.mjs} +313 -287
- package/dist/lib/browser/SpaceGenerator-Q2GH6S6D.mjs.map +7 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs +53 -0
- package/dist/lib/browser/Wireframe-KAGOKEFW.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-LV73R7HR.mjs → app-graph-builder-FU4BCDDC.mjs} +80 -85
- package/dist/lib/browser/app-graph-builder-FU4BCDDC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-4UFQXPP7.mjs → chunk-Q37TZWW5.mjs} +4 -4
- package/dist/lib/browser/chunk-Q37TZWW5.mjs.map +7 -0
- package/dist/lib/browser/{chunk-A5H5GRV6.mjs → chunk-ZOM2FBHQ.mjs} +2 -2
- package/dist/lib/browser/{chunk-A5H5GRV6.mjs.map → chunk-ZOM2FBHQ.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +25 -18
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-FSWBT3MH.mjs → react-context-5ENRJEB2.mjs} +4 -4
- package/dist/lib/browser/react-context-5ENRJEB2.mjs.map +7 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs +427 -0
- package/dist/lib/browser/react-surface-VD6RD6PL.mjs.map +7 -0
- package/dist/lib/browser/{settings-KA4GN73K.mjs → settings-XXFUM3QJ.mjs} +6 -5
- package/dist/lib/browser/settings-XXFUM3QJ.mjs.map +7 -0
- package/dist/types/src/DebugPlugin.d.ts +6 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts +1 -1
- package/dist/types/src/capabilities/react-context/react-context.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +6 -2
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts +1 -1
- package/dist/types/src/capabilities/settings/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings/settings.d.ts +3 -2
- package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.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 +2 -10
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/{components → containers/DebugGraph}/DebugGraph.d.ts +0 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts +3 -0
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DebugObjectPanel}/DebugObjectPanel.d.ts +1 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts +3 -0
- package/dist/types/src/containers/DebugObjectPanel/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/DebugSettings}/DebugSettings.d.ts +4 -2
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts +3 -0
- package/dist/types/src/containers/DebugSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +3 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/DebugSpaceObjectsPanel/index.d.ts +3 -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 +3 -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 +3 -0
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers}/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/SpaceGenerator/index.d.ts +3 -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 +3 -0
- package/dist/types/src/containers/Wireframe/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +10 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types.d.ts +34 -34
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -66
- package/src/DebugPlugin.tsx +19 -8
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +74 -75
- package/src/capabilities/react-context/react-context.tsx +2 -2
- package/src/capabilities/react-surface/react-surface.tsx +106 -102
- package/src/capabilities/settings/settings.ts +3 -2
- package/src/components/{SpaceGenerator → SchemaTable}/SchemaTable.tsx +2 -2
- package/src/components/SchemaTable/index.ts +5 -0
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +6 -7
- package/src/components/SpaceGenerator/index.ts +2 -3
- package/src/components/SpaceGenerator/presets.ts +41 -37
- package/src/components/index.ts +2 -13
- package/src/{components → containers/DebugGraph}/DebugGraph.tsx +0 -2
- package/src/containers/DebugGraph/index.ts +7 -0
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +47 -0
- package/src/containers/DebugObjectPanel/index.ts +7 -0
- package/src/{components → containers/DebugSettings}/DebugSettings.tsx +38 -22
- package/src/containers/DebugSettings/index.ts +7 -0
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +55 -0
- package/src/containers/DebugSpaceObjectsPanel/index.ts +7 -0
- package/src/containers/DebugStatus/index.ts +7 -0
- package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx +2 -4
- package/src/containers/DevtoolsOverviewContainer/index.ts +7 -0
- package/src/{components → containers}/SpaceGenerator/SpaceGenerator.tsx +38 -38
- package/src/containers/SpaceGenerator/index.ts +7 -0
- package/src/{components → containers/Wireframe}/Wireframe.tsx +2 -2
- package/src/containers/Wireframe/index.ts +7 -0
- package/src/containers/index.ts +14 -0
- package/src/meta.ts +1 -1
- package/src/translations.ts +2 -0
- package/src/types.ts +2 -3
- package/dist/lib/browser/DevtoolsOverviewContainer-77PKFLYV.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-H33AEFGC.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-LV73R7HR.mjs.map +0 -7
- package/dist/lib/browser/chunk-4UFQXPP7.mjs.map +0 -7
- package/dist/lib/browser/react-context-FSWBT3MH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-2N6CPSHR.mjs +0 -757
- package/dist/lib/browser/react-surface-2N6CPSHR.mjs.map +0 -7
- package/dist/lib/browser/settings-KA4GN73K.mjs.map +0 -7
- package/dist/types/src/components/Container.d.ts +0 -5
- package/dist/types/src/components/Container.d.ts.map +0 -1
- package/dist/types/src/components/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +0 -1
- 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.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/src/components/Container.tsx +0 -15
- package/src/components/DebugObjectPanel.tsx +0 -33
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +0 -54
- /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}/SpaceGenerator/SpaceGenerator.d.ts +0 -0
- /package/dist/types/src/{components → containers/Wireframe}/Wireframe.d.ts +0 -0
- /package/src/{components → containers/DebugStatus}/DebugStatus.tsx +0 -0
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AgentFunctions, EntityExtractionFunctions, ResearchBlueprint } from '@dxos/assistant-toolkit';
|
|
8
8
|
import { Prompt } from '@dxos/blueprints';
|
|
9
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
10
|
-
import { DXN, Filter, Key, Obj, Query, type QueryAST, Ref, Tag
|
|
10
|
+
import { DXN, Feed, Filter, JsonSchema, Key, Obj, Query, type QueryAST, Ref, Tag } from '@dxos/echo';
|
|
11
11
|
import { Trigger, serializeFunction } from '@dxos/functions';
|
|
12
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import {
|
|
13
|
+
import { GmailFunctions } from '@dxos/plugin-inbox';
|
|
14
14
|
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
15
15
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
16
16
|
import { type Space } from '@dxos/react-client/echo';
|
|
@@ -29,15 +29,9 @@ import {
|
|
|
29
29
|
createText,
|
|
30
30
|
createTrigger,
|
|
31
31
|
} 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';
|
|
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';
|
|
41
35
|
import { range, trim } from '@dxos/util';
|
|
42
36
|
|
|
43
37
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
@@ -57,7 +51,7 @@ export enum PresetName {
|
|
|
57
51
|
}
|
|
58
52
|
|
|
59
53
|
export const generator = () => ({
|
|
60
|
-
schemas: [
|
|
54
|
+
schemas: [CanvasBoard.CanvasBoard, Trigger.Trigger] as any[],
|
|
61
55
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
62
56
|
items: [
|
|
63
57
|
[
|
|
@@ -91,7 +85,9 @@ export const generator = () => ({
|
|
|
91
85
|
// }),
|
|
92
86
|
// );
|
|
93
87
|
|
|
94
|
-
space.db.add(
|
|
88
|
+
space.db.add(
|
|
89
|
+
Obj.make(Person.Person, { [Obj.Meta]: { tags: [tagDxn] }, fullName: 'Rich', organization: Ref.make(org) }),
|
|
90
|
+
);
|
|
95
91
|
space.db.add(
|
|
96
92
|
Obj.make(Person.Person, {
|
|
97
93
|
fullName: 'Josiah',
|
|
@@ -120,7 +116,13 @@ export const generator = () => ({
|
|
|
120
116
|
[
|
|
121
117
|
PresetName.ORG_RESEARCH_PROJECT,
|
|
122
118
|
async (space, n, cb) => {
|
|
123
|
-
const
|
|
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.getQueueDxn(mailboxFeed)?.toString();
|
|
125
|
+
invariant(queueDxn, 'Mailbox feed missing queue DXN key');
|
|
124
126
|
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
125
127
|
const tagDxn = Obj.getDXN(tag).toString();
|
|
126
128
|
|
|
@@ -136,9 +138,9 @@ export const generator = () => ({
|
|
|
136
138
|
kind: 'timer',
|
|
137
139
|
cron: '* * * * *', // Every minute.
|
|
138
140
|
},
|
|
139
|
-
function: Ref.make(serializeFunction(
|
|
141
|
+
function: Ref.make(serializeFunction(GmailFunctions.Sync)),
|
|
140
142
|
input: {
|
|
141
|
-
|
|
143
|
+
mailbox: Ref.make(mailbox),
|
|
142
144
|
},
|
|
143
145
|
}),
|
|
144
146
|
);
|
|
@@ -149,9 +151,9 @@ export const generator = () => ({
|
|
|
149
151
|
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
150
152
|
spec: {
|
|
151
153
|
kind: 'queue',
|
|
152
|
-
queue:
|
|
154
|
+
queue: queueDxn,
|
|
153
155
|
},
|
|
154
|
-
function: Ref.make(serializeFunction(
|
|
156
|
+
function: Ref.make(serializeFunction(EntityExtractionFunctions.Extract)),
|
|
155
157
|
input: {
|
|
156
158
|
source: '{{event.item}}',
|
|
157
159
|
},
|
|
@@ -174,7 +176,7 @@ export const generator = () => ({
|
|
|
174
176
|
Create a research note for it at the end.
|
|
175
177
|
NOTE: Do mocked reseach (set mockSearch to true).
|
|
176
178
|
`,
|
|
177
|
-
blueprints: [Ref.make(ResearchBlueprint)],
|
|
179
|
+
blueprints: [Ref.make(ResearchBlueprint.make())],
|
|
178
180
|
}),
|
|
179
181
|
);
|
|
180
182
|
|
|
@@ -187,7 +189,7 @@ export const generator = () => ({
|
|
|
187
189
|
ast: organizationsQuery.ast,
|
|
188
190
|
},
|
|
189
191
|
},
|
|
190
|
-
function: Ref.make(serializeFunction(
|
|
192
|
+
function: Ref.make(serializeFunction(AgentFunctions.Prompt)),
|
|
191
193
|
input: {
|
|
192
194
|
prompt: Ref.make(researchPrompt),
|
|
193
195
|
input: '{{event.subject}}',
|
|
@@ -195,31 +197,31 @@ export const generator = () => ({
|
|
|
195
197
|
}),
|
|
196
198
|
);
|
|
197
199
|
|
|
198
|
-
const mailboxView =
|
|
200
|
+
const mailboxView = ViewModel.make({
|
|
199
201
|
query: Query.select(
|
|
200
202
|
Filter.type(Message.Message, {
|
|
201
203
|
properties: { labels: Filter.contains('investor') },
|
|
202
204
|
}),
|
|
203
|
-
).
|
|
204
|
-
queues: [
|
|
205
|
+
).from({
|
|
206
|
+
queues: [queueDxn],
|
|
205
207
|
}),
|
|
206
|
-
jsonSchema:
|
|
208
|
+
jsonSchema: JsonSchema.toJsonSchema(Message.Message),
|
|
207
209
|
});
|
|
208
|
-
const contactsView =
|
|
210
|
+
const contactsView = ViewModel.make({
|
|
209
211
|
query: contactsQuery,
|
|
210
|
-
jsonSchema:
|
|
212
|
+
jsonSchema: JsonSchema.toJsonSchema(Person.Person),
|
|
211
213
|
});
|
|
212
|
-
const organizationsView =
|
|
214
|
+
const organizationsView = ViewModel.make({
|
|
213
215
|
query: organizationsQuery,
|
|
214
|
-
jsonSchema:
|
|
216
|
+
jsonSchema: JsonSchema.toJsonSchema(Organization.Organization),
|
|
215
217
|
});
|
|
216
|
-
const notesView =
|
|
218
|
+
const notesView = ViewModel.make({
|
|
217
219
|
query: notesQuery,
|
|
218
|
-
jsonSchema:
|
|
220
|
+
jsonSchema: JsonSchema.toJsonSchema(Markdown.Document),
|
|
219
221
|
});
|
|
220
222
|
|
|
221
223
|
return space.db.add(
|
|
222
|
-
|
|
224
|
+
Pipeline.make({
|
|
223
225
|
name: 'Investor Research',
|
|
224
226
|
columns: [
|
|
225
227
|
{
|
|
@@ -313,7 +315,7 @@ export const generator = () => ({
|
|
|
313
315
|
'subscription',
|
|
314
316
|
(triggerSpec) =>
|
|
315
317
|
(triggerSpec.query = {
|
|
316
|
-
ast: Query.select(Filter.typename('dxos.
|
|
318
|
+
ast: Query.select(Filter.typename('org.dxos.type.chess')).ast as Obj.Mutable<QueryAST.Query>,
|
|
317
319
|
}),
|
|
318
320
|
'type',
|
|
319
321
|
);
|
|
@@ -398,7 +400,7 @@ export const generator = () => ({
|
|
|
398
400
|
// const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
399
401
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
400
402
|
// templateComputeNode.value = templateContent.join('\n');
|
|
401
|
-
// templateComputeNode.inputSchema =
|
|
403
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(EmailTriggerOutput);
|
|
402
404
|
|
|
403
405
|
// attachTrigger(functionTrigger, computeModel);
|
|
404
406
|
|
|
@@ -532,7 +534,7 @@ export const generator = () => ({
|
|
|
532
534
|
// invariant(templateComputeNode, 'Template compute node was not created.');
|
|
533
535
|
// templateComputeNode.value = templateContent.join('\n');
|
|
534
536
|
// const extendedSchema = Schema.extend(EmailTriggerOutput, Schema.Struct({ text: Schema.String }));
|
|
535
|
-
// templateComputeNode.inputSchema =
|
|
537
|
+
// templateComputeNode.inputSchema = JsonSchema.toJsonSchema(extendedSchema);
|
|
536
538
|
|
|
537
539
|
// attachTrigger(functionTrigger, computeModel);
|
|
538
540
|
|
|
@@ -771,7 +773,9 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
771
773
|
invariant(templateComputeNode, 'Template compute node was not created.');
|
|
772
774
|
// NOTE: These are plain object mutations during model construction, not ECHO object mutations.
|
|
773
775
|
templateComputeNode.value = ['{', ' "@type": "{{type}}",', ' "id": "@{{changeId}}"', '}'].join('\n');
|
|
774
|
-
templateComputeNode.inputSchema =
|
|
776
|
+
templateComputeNode.inputSchema = JsonSchema.toJsonSchema(
|
|
777
|
+
Schema.Struct({ type: Schema.String, changeId: Schema.String }),
|
|
778
|
+
);
|
|
775
779
|
attachTrigger(functionTrigger, computeModel);
|
|
776
780
|
|
|
777
781
|
return { canvasModel, computeModel };
|
|
@@ -779,7 +783,7 @@ const createQueueSinkPreset = <SpecType extends Trigger.Kind>(
|
|
|
779
783
|
|
|
780
784
|
const addToSpace = (name: string, space: Space, canvas: CanvasGraphModel, compute: ComputeGraphModel) => {
|
|
781
785
|
return space.db.add(
|
|
782
|
-
Obj.make(
|
|
786
|
+
Obj.make(CanvasBoard.CanvasBoard, {
|
|
783
787
|
name,
|
|
784
788
|
computeGraph: Ref.make(compute.root),
|
|
785
789
|
layout: canvas.graph,
|
package/src/components/index.ts
CHANGED
|
@@ -2,16 +2,5 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import { type DebugGraphProps } from './DebugGraph';
|
|
9
|
-
|
|
10
|
-
export const DebugGraph: ReturnType<typeof lazy<FC<DebugGraphProps>>> = lazy(() => import('./DebugGraph'));
|
|
11
|
-
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
12
|
-
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
13
|
-
|
|
14
|
-
export * from './DebugObjectPanel';
|
|
15
|
-
export * from './DebugSettings';
|
|
16
|
-
export * from './DebugStatus';
|
|
17
|
-
export * from './Wireframe';
|
|
5
|
+
export * from './SchemaTable';
|
|
6
|
+
export * from './SpaceGenerator';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { ObjectsTree } from '@dxos/devtools';
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import type { ObjectId } from '@dxos/keys';
|
|
10
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { Clipboard, Grid, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
12
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
13
|
+
|
|
14
|
+
export type DebugObjectPanelProps = {
|
|
15
|
+
object: Obj.Unknown;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {
|
|
19
|
+
const db = Obj.getDatabase(object);
|
|
20
|
+
const [selectedId, setSelectedId] = useState<ObjectId | null>(null);
|
|
21
|
+
const [selectedObject] = useQuery(
|
|
22
|
+
db,
|
|
23
|
+
Query.select(Filter.id(selectedId ?? object.id)).options({ deleted: 'include' }),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<Clipboard.Provider>
|
|
28
|
+
<Panel.Root>
|
|
29
|
+
<Panel.Toolbar asChild>
|
|
30
|
+
<Toolbar.Root />
|
|
31
|
+
</Panel.Toolbar>
|
|
32
|
+
<Panel.Content asChild>
|
|
33
|
+
<Grid rows={db ? 2 : 1} classNames='divide-y divide-separator'>
|
|
34
|
+
{db && (
|
|
35
|
+
<ScrollArea.Root>
|
|
36
|
+
<ScrollArea.Viewport>
|
|
37
|
+
<ObjectsTree db={db} root={object} onSelect={(entity) => setSelectedId(entity.id)} />
|
|
38
|
+
</ScrollArea.Viewport>
|
|
39
|
+
</ScrollArea.Root>
|
|
40
|
+
)}
|
|
41
|
+
<Json data={selectedObject} />
|
|
42
|
+
</Grid>
|
|
43
|
+
</Panel.Content>
|
|
44
|
+
</Panel.Root>
|
|
45
|
+
</Clipboard.Provider>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
@@ -4,17 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
9
9
|
import { type ConfigProto, SaveConfig, Storage, defs } from '@dxos/config';
|
|
10
|
-
import { log } from '@dxos/log';
|
|
10
|
+
import { type LogBuffer, log } from '@dxos/log';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { Icon, IconButton, Input, Select, Toast, useFileDownload, useTranslation } from '@dxos/react-ui';
|
|
13
|
-
import {
|
|
13
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
14
14
|
import { setDeep } from '@dxos/util';
|
|
15
15
|
|
|
16
|
-
import { meta } from '
|
|
17
|
-
import { type DebugSettingsProps } from '
|
|
16
|
+
import { meta } from '../../meta';
|
|
17
|
+
import { type DebugSettingsProps } from '../../types';
|
|
18
18
|
|
|
19
19
|
type Toast = {
|
|
20
20
|
title: string;
|
|
@@ -29,16 +29,17 @@ const StorageAdapters = {
|
|
|
29
29
|
export type DebugSettingsComponentProps = {
|
|
30
30
|
settings: DebugSettingsProps;
|
|
31
31
|
onSettingsChange: (fn: (current: DebugSettingsProps) => DebugSettingsProps) => void;
|
|
32
|
+
logBuffer: LogBuffer;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
export const DebugSettings = ({ settings, onSettingsChange }: DebugSettingsComponentProps) => {
|
|
35
|
+
export const DebugSettings = ({ settings, onSettingsChange, logBuffer }: DebugSettingsComponentProps) => {
|
|
35
36
|
const { t } = useTranslation(meta.id);
|
|
36
37
|
const [toast, setToast] = useState<Toast>();
|
|
37
38
|
const client = useClient();
|
|
38
39
|
const download = useFileDownload();
|
|
39
40
|
// TODO(mykola): Get updates from other places that change Config.
|
|
40
41
|
const [storageConfig, setStorageConfig] = useState<ConfigProto>({});
|
|
41
|
-
const [upload] = useCapabilities(
|
|
42
|
+
const [upload] = useCapabilities(AppCapabilities.FileUploader);
|
|
42
43
|
|
|
43
44
|
useEffect(() => {
|
|
44
45
|
void Storage().then((config) => setStorageConfig(config));
|
|
@@ -80,6 +81,13 @@ export const DebugSettings = ({ settings, onSettingsChange }: DebugSettingsCompo
|
|
|
80
81
|
}
|
|
81
82
|
};
|
|
82
83
|
|
|
84
|
+
const handleDownloadLogs = () => {
|
|
85
|
+
const ndjson = logBuffer.serialize();
|
|
86
|
+
const file = new Blob([ndjson], { type: 'application/x-ndjson' });
|
|
87
|
+
const fileName = `composer-logs-${new Date().toISOString().slice(0, 19).replace(/:/g, '-')}.ndjson`;
|
|
88
|
+
download(file, fileName);
|
|
89
|
+
};
|
|
90
|
+
|
|
83
91
|
const handleRepair = async () => {
|
|
84
92
|
try {
|
|
85
93
|
const info = await client.repair();
|
|
@@ -97,31 +105,39 @@ export const DebugSettings = ({ settings, onSettingsChange }: DebugSettingsCompo
|
|
|
97
105
|
};
|
|
98
106
|
|
|
99
107
|
return (
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
<
|
|
108
|
+
<Settings.Root>
|
|
109
|
+
<Settings.Section title={t('settings title', { ns: meta.id })}>
|
|
110
|
+
<Settings.Group>
|
|
111
|
+
<Settings.ItemInput title={t('settings wireframe')}>
|
|
104
112
|
<Input.Switch
|
|
105
113
|
checked={settings.wireframe}
|
|
106
114
|
onCheckedChange={(checked) => onSettingsChange((s) => ({ ...s, wireframe: !!checked }))}
|
|
107
115
|
/>
|
|
108
|
-
</
|
|
109
|
-
<
|
|
116
|
+
</Settings.ItemInput>
|
|
117
|
+
<Settings.ItemInput title={t('settings download diagnostics')}>
|
|
110
118
|
<IconButton
|
|
111
119
|
icon='ph--download-simple--regular'
|
|
112
120
|
iconOnly
|
|
113
121
|
label={t('settings download diagnostics')}
|
|
114
122
|
onClick={handleDownload}
|
|
115
123
|
/>
|
|
116
|
-
</
|
|
117
|
-
<
|
|
124
|
+
</Settings.ItemInput>
|
|
125
|
+
<Settings.ItemInput title={t('settings download logs')}>
|
|
126
|
+
<IconButton
|
|
127
|
+
icon='ph--download-simple--regular'
|
|
128
|
+
iconOnly
|
|
129
|
+
label={t('settings download logs')}
|
|
130
|
+
onClick={handleDownloadLogs}
|
|
131
|
+
/>
|
|
132
|
+
</Settings.ItemInput>
|
|
133
|
+
<Settings.ItemInput title={t('settings repair')}>
|
|
118
134
|
<IconButton
|
|
119
135
|
icon='ph--first-aid-kit--regular'
|
|
120
136
|
iconOnly
|
|
121
137
|
label={t('settings repair')}
|
|
122
138
|
onClick={handleRepair}
|
|
123
139
|
/>
|
|
124
|
-
</
|
|
140
|
+
</Settings.ItemInput>
|
|
125
141
|
|
|
126
142
|
{/* TODO(burdon): Move to layout? */}
|
|
127
143
|
{toast && (
|
|
@@ -136,7 +152,7 @@ export const DebugSettings = ({ settings, onSettingsChange }: DebugSettingsCompo
|
|
|
136
152
|
</Toast.Root>
|
|
137
153
|
)}
|
|
138
154
|
|
|
139
|
-
<
|
|
155
|
+
<Settings.ItemInput title={t('settings choose storage adaptor')}>
|
|
140
156
|
<Select.Root
|
|
141
157
|
value={
|
|
142
158
|
Object.entries(StorageAdapters).find(
|
|
@@ -168,10 +184,10 @@ export const DebugSettings = ({ settings, onSettingsChange }: DebugSettingsCompo
|
|
|
168
184
|
</Select.Content>
|
|
169
185
|
</Select.Portal>
|
|
170
186
|
</Select.Root>
|
|
171
|
-
</
|
|
172
|
-
</
|
|
173
|
-
</
|
|
174
|
-
</
|
|
187
|
+
</Settings.ItemInput>
|
|
188
|
+
</Settings.Group>
|
|
189
|
+
</Settings.Section>
|
|
190
|
+
</Settings.Root>
|
|
175
191
|
);
|
|
176
192
|
};
|
|
177
193
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { ObjectsTree } from '@dxos/devtools';
|
|
8
|
+
import { type Database, Filter, Query } from '@dxos/echo';
|
|
9
|
+
import type { ObjectId } from '@dxos/keys';
|
|
10
|
+
import { useActiveSpace } from '@dxos/plugin-space';
|
|
11
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
12
|
+
import { Clipboard, Grid, Input, Panel, ScrollArea, Toolbar } from '@dxos/react-ui';
|
|
13
|
+
import { Json } from '@dxos/react-ui-syntax-highlighter';
|
|
14
|
+
|
|
15
|
+
export const DebugSpaceObjectsPanel = () => {
|
|
16
|
+
const space = useActiveSpace();
|
|
17
|
+
if (!space) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return <DebugSpaceObjectsPanelMain database={space.db} />;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const DebugSpaceObjectsPanelMain = ({ database }: { database: Database.Database }) => {
|
|
25
|
+
const [selectedId, setSelectedId] = useState<ObjectId | null>(null);
|
|
26
|
+
|
|
27
|
+
const [selectedObject] = useQuery(
|
|
28
|
+
database,
|
|
29
|
+
selectedId ? Query.select(Filter.id(selectedId)) : Query.select(Filter.nothing()),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Clipboard.Provider>
|
|
34
|
+
<Panel.Root>
|
|
35
|
+
<Panel.Toolbar asChild>
|
|
36
|
+
<Toolbar.Root>
|
|
37
|
+
<Input.Root>
|
|
38
|
+
<Input.TextInput disabled placeholder='Search...' />
|
|
39
|
+
</Input.Root>
|
|
40
|
+
</Toolbar.Root>
|
|
41
|
+
</Panel.Toolbar>
|
|
42
|
+
<Panel.Content asChild>
|
|
43
|
+
<Grid rows={2} classNames='divide-y divide-separator'>
|
|
44
|
+
<ScrollArea.Root>
|
|
45
|
+
<ScrollArea.Viewport>
|
|
46
|
+
<ObjectsTree db={database} onSelect={(entity) => setSelectedId(entity.id)} />
|
|
47
|
+
</ScrollArea.Viewport>
|
|
48
|
+
</ScrollArea.Root>
|
|
49
|
+
{selectedObject && <Json classNames='p-1' data={selectedObject} />}
|
|
50
|
+
</Grid>
|
|
51
|
+
</Panel.Content>
|
|
52
|
+
</Panel.Root>
|
|
53
|
+
</Clipboard.Provider>
|
|
54
|
+
);
|
|
55
|
+
};
|
package/src/{components → containers/DevtoolsOverviewContainer}/DevtoolsOverviewContainer.tsx
RENAMED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Surface } from '@dxos/app-framework/
|
|
7
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
8
8
|
import { StatsPanel, useStats } from '@dxos/devtools';
|
|
9
9
|
|
|
10
10
|
export const DevtoolsOverviewContainer = () => {
|
|
@@ -12,9 +12,7 @@ export const DevtoolsOverviewContainer = () => {
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<StatsPanel stats={stats} onRefresh={refreshStats}>
|
|
15
|
-
<Surface role='devtools-overview' />
|
|
15
|
+
<Surface.Surface role='devtools-overview' />
|
|
16
16
|
</StatsPanel>
|
|
17
17
|
);
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
export default DevtoolsOverviewContainer;
|
|
@@ -4,22 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useOperationInvoker } from '@dxos/app-framework/
|
|
7
|
+
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
8
8
|
import { ComputeGraph } from '@dxos/conductor';
|
|
9
9
|
import { Filter, Obj, type Type } from '@dxos/echo';
|
|
10
10
|
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
11
|
import { Sheet } from '@dxos/plugin-sheet/types';
|
|
12
|
-
import {
|
|
12
|
+
import { Sketch } from '@dxos/plugin-sketch/types';
|
|
13
13
|
import { useClient } from '@dxos/react-client';
|
|
14
14
|
import { type Space } from '@dxos/react-client/echo';
|
|
15
|
-
import { IconButton, Input, Toolbar, useAsyncEffect } from '@dxos/react-ui';
|
|
15
|
+
import { IconButton, Input, Panel, ScrollArea, Toolbar, useAsyncEffect } from '@dxos/react-ui';
|
|
16
16
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
17
17
|
import { Organization, Person, Task } from '@dxos/types';
|
|
18
18
|
import { jsonKeyReplacer, sortKeys } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { type ObjectGenerator, createGenerator, staticGenerators } from '
|
|
21
|
-
import { generator } from './presets';
|
|
22
|
-
import { SchemaTable } from './SchemaTable';
|
|
20
|
+
import { type ObjectGenerator, SchemaTable, createGenerator, generator, staticGenerators } from '../../components';
|
|
23
21
|
|
|
24
22
|
export type SpaceGeneratorProps = {
|
|
25
23
|
space: Space;
|
|
@@ -29,8 +27,8 @@ export type SpaceGeneratorProps = {
|
|
|
29
27
|
export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {
|
|
30
28
|
const { invokePromise } = useOperationInvoker();
|
|
31
29
|
const client = useClient();
|
|
32
|
-
const staticTypes = [Markdown.Document,
|
|
33
|
-
const recordTypes: Type.
|
|
30
|
+
const staticTypes = [Markdown.Document, Sketch.Sketch, Sheet.Sheet, ComputeGraph]; // TODO(burdon): Make extensible.
|
|
31
|
+
const recordTypes: Type.AnyObj[] = [Organization.Organization, Person.Person, Task.Task];
|
|
34
32
|
const [count, setCount] = useState(1);
|
|
35
33
|
const [info, setInfo] = useState<any>({});
|
|
36
34
|
const presets = useMemo(() => generator(), []);
|
|
@@ -93,35 +91,37 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
|
|
|
93
91
|
);
|
|
94
92
|
|
|
95
93
|
return (
|
|
96
|
-
<
|
|
97
|
-
<Toolbar
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
<Input.
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
94
|
+
<Panel.Root>
|
|
95
|
+
<Panel.Toolbar asChild>
|
|
96
|
+
<Toolbar.Root>
|
|
97
|
+
<IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />
|
|
98
|
+
<Toolbar.Separator />
|
|
99
|
+
<Input.Root>
|
|
100
|
+
<Input.TextInput
|
|
101
|
+
type='number'
|
|
102
|
+
placeholder='Count'
|
|
103
|
+
classNames='w-[4rem] text-right'
|
|
104
|
+
min={1}
|
|
105
|
+
max={100}
|
|
106
|
+
size={8}
|
|
107
|
+
value={count}
|
|
108
|
+
onChange={(event) => setCount(parseInt(event.target.value))}
|
|
109
|
+
/>
|
|
110
|
+
</Input.Root>
|
|
111
|
+
</Toolbar.Root>
|
|
112
|
+
</Panel.Toolbar>
|
|
113
|
+
<Panel.Content asChild>
|
|
114
|
+
<ScrollArea.Root thin orientation='vertical'>
|
|
115
|
+
<ScrollArea.Viewport classNames='gap-4 divide-y divide-subdued-separator'>
|
|
116
|
+
<SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />
|
|
117
|
+
<SchemaTable types={recordTypes} objects={info.objects} label='Record Types' onClick={handleCreateData} />
|
|
118
|
+
<SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />
|
|
119
|
+
<SyntaxHighlighter language='json' classNames='text-xs'>
|
|
120
|
+
{JSON.stringify({ space, ...info }, jsonKeyReplacer({ truncate: true }), 2)}
|
|
121
|
+
</SyntaxHighlighter>
|
|
122
|
+
</ScrollArea.Viewport>
|
|
123
|
+
</ScrollArea.Root>
|
|
124
|
+
</Panel.Content>
|
|
125
|
+
</Panel.Root>
|
|
126
126
|
);
|
|
127
127
|
};
|