@dxos/plugin-debug 0.8.4-main.2e9d522 → 0.8.4-main.406dc2a
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-EDOH6R2G.mjs +20 -0
- package/dist/lib/browser/DebugGraph-EDOH6R2G.mjs.map +7 -0
- package/dist/lib/browser/{SpaceGenerator-AG3XGNMV.mjs → SpaceGenerator-VMWHGAJZ.mjs} +245 -69
- package/dist/lib/browser/SpaceGenerator-VMWHGAJZ.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-SQXFD2BL.mjs → app-graph-builder-I4IHBKKN.mjs} +75 -84
- package/dist/lib/browser/app-graph-builder-I4IHBKKN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AJA6RYN3.mjs → chunk-SRV2AIGJ.mjs} +2 -2
- package/dist/lib/browser/chunk-SRV2AIGJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5XPIRNQS.mjs → chunk-SVCKCXCL.mjs} +2 -4
- package/dist/lib/browser/chunk-SVCKCXCL.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +14 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-context-NVAGLAJD.mjs → react-context-QLZE7VSQ.mjs} +6 -6
- package/dist/lib/browser/react-context-QLZE7VSQ.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-3GD2OWCA.mjs → react-surface-GFORPA3A.mjs} +78 -74
- package/dist/lib/browser/react-surface-GFORPA3A.mjs.map +7 -0
- package/dist/lib/browser/{settings-LSSWLM5I.mjs → settings-EBVICEEW.mjs} +5 -5
- package/dist/lib/browser/{settings-LSSWLM5I.mjs.map → settings-EBVICEEW.mjs.map} +1 -1
- package/dist/types/src/DebugPlugin.d.ts +1 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-context.d.ts +2 -2
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/components/DebugGraph.d.ts +8 -0
- package/dist/types/src/components/DebugGraph.d.ts.map +1 -0
- package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
- package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
- 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/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +13 -4
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/draw-util.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +4 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/Wireframe.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -63
- package/src/DebugPlugin.tsx +6 -7
- package/src/capabilities/app-graph-builder.ts +63 -89
- package/src/capabilities/react-context.tsx +2 -2
- package/src/capabilities/react-surface.tsx +49 -47
- package/src/components/DebugGraph.tsx +14 -0
- package/src/components/DebugObjectPanel.tsx +2 -4
- package/src/components/DebugSettings.tsx +74 -66
- package/src/components/DebugStatus.tsx +2 -2
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +15 -15
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +11 -11
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +7 -7
- package/src/components/SpaceGenerator/draw-util.ts +5 -5
- package/src/components/SpaceGenerator/presets.ts +173 -12
- package/src/components/Wireframe.tsx +2 -1
- package/src/components/index.ts +1 -1
- package/src/meta.ts +1 -3
- package/src/translations.ts +2 -0
- package/src/types.ts +1 -1
- package/dist/lib/browser/DebugApp-ZDL4CPY5.mjs +0 -228
- package/dist/lib/browser/DebugApp-ZDL4CPY5.mjs.map +0 -7
- package/dist/lib/browser/SpaceGenerator-AG3XGNMV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-SQXFD2BL.mjs.map +0 -7
- package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
- package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
- package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-3GD2OWCA.mjs.map +0 -7
- package/dist/types/src/components/DebugApp/DebugApp.d.ts +0 -6
- package/dist/types/src/components/DebugApp/DebugApp.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/Tree.d.ts +0 -18
- package/dist/types/src/components/DebugApp/Tree.d.ts.map +0 -1
- package/dist/types/src/components/DebugApp/index.d.ts +0 -3
- package/dist/types/src/components/DebugApp/index.d.ts.map +0 -1
- package/src/components/DebugApp/DebugApp.tsx +0 -84
- package/src/components/DebugApp/Tree.tsx +0 -103
- package/src/components/DebugApp/index.ts +0 -7
|
@@ -2,16 +2,15 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { IntentPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
10
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
11
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
14
|
-
import {
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
13
|
+
import { render } from '@dxos/storybook-utils';
|
|
15
14
|
|
|
16
15
|
import { SpaceGenerator } from './SpaceGenerator';
|
|
17
16
|
|
|
@@ -24,29 +23,30 @@ const DefaultStory = () => {
|
|
|
24
23
|
return <SpaceGenerator space={space} />;
|
|
25
24
|
};
|
|
26
25
|
|
|
27
|
-
const meta
|
|
26
|
+
const meta = {
|
|
28
27
|
title: 'plugins/plugin-debug/SpaceGenerator',
|
|
29
|
-
component: SpaceGenerator,
|
|
28
|
+
component: SpaceGenerator as any,
|
|
30
29
|
render: render(DefaultStory),
|
|
31
30
|
decorators: [
|
|
31
|
+
withTheme,
|
|
32
32
|
withPluginManager({
|
|
33
33
|
plugins: [
|
|
34
34
|
ClientPlugin({
|
|
35
|
-
onClientInitialized: async (
|
|
35
|
+
onClientInitialized: async ({ client }) => {
|
|
36
36
|
await client.halo.createIdentity();
|
|
37
37
|
},
|
|
38
38
|
}),
|
|
39
39
|
IntentPlugin(),
|
|
40
40
|
],
|
|
41
41
|
}),
|
|
42
|
-
withLayout(),
|
|
43
|
-
withTheme,
|
|
44
42
|
],
|
|
45
43
|
parameters: {
|
|
46
44
|
layout: 'fullscreen',
|
|
47
45
|
},
|
|
48
|
-
}
|
|
46
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
49
47
|
|
|
50
48
|
export default meta;
|
|
51
49
|
|
|
52
|
-
|
|
50
|
+
type Story = StoryObj<typeof meta>;
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {};
|
|
@@ -7,19 +7,19 @@ import React, { useCallback, useMemo, useState } from 'react';
|
|
|
7
7
|
import { useIntentDispatcher } from '@dxos/app-framework';
|
|
8
8
|
import { ComputeGraph } from '@dxos/conductor';
|
|
9
9
|
import { Filter, type Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
10
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
11
|
import { SheetType } from '@dxos/plugin-sheet/types';
|
|
12
12
|
import { DiagramType } from '@dxos/plugin-sketch/types';
|
|
13
13
|
import { useClient } from '@dxos/react-client';
|
|
14
|
-
import {
|
|
14
|
+
import { type Space, getTypename } from '@dxos/react-client/echo';
|
|
15
15
|
import { IconButton, Input, Toolbar, useAsyncEffect } from '@dxos/react-ui';
|
|
16
16
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
17
17
|
import { DataType } from '@dxos/schema';
|
|
18
18
|
import { jsonKeyReplacer, sortKeys } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { createGenerator, staticGenerators
|
|
21
|
-
import { SchemaTable } from './SchemaTable';
|
|
20
|
+
import { type ObjectGenerator, createGenerator, staticGenerators } from './ObjectGenerator';
|
|
22
21
|
import { generator } from './presets';
|
|
22
|
+
import { SchemaTable } from './SchemaTable';
|
|
23
23
|
|
|
24
24
|
export type SpaceGeneratorProps = {
|
|
25
25
|
space: Space;
|
|
@@ -29,8 +29,8 @@ export type SpaceGeneratorProps = {
|
|
|
29
29
|
export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {
|
|
30
30
|
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
31
31
|
const client = useClient();
|
|
32
|
-
const staticTypes = [
|
|
33
|
-
const recordTypes = [DataType.Organization, DataType.
|
|
32
|
+
const staticTypes = [Markdown.Document, DiagramType, SheetType, ComputeGraph]; // TODO(burdon): Make extensible.
|
|
33
|
+
const recordTypes = [DataType.Organization, DataType.Person, DataType.Task];
|
|
34
34
|
const [count, setCount] = useState(1);
|
|
35
35
|
const [info, setInfo] = useState<any>({});
|
|
36
36
|
const presets = useMemo(() => generator(), []);
|
|
@@ -112,7 +112,7 @@ export const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps)
|
|
|
112
112
|
<SchemaTable types={presets.types} objects={info.objects} label='Presets' onClick={handleCreateData} />
|
|
113
113
|
|
|
114
114
|
<div>
|
|
115
|
-
<SyntaxHighlighter classNames='
|
|
115
|
+
<SyntaxHighlighter language='json' classNames='text-xs'>
|
|
116
116
|
{JSON.stringify({ space, ...info }, jsonKeyReplacer({ truncate: true }), 2)}
|
|
117
117
|
</SyntaxHighlighter>
|
|
118
118
|
</div>
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
// TODO(burdon): workerize-loader dep.
|
|
6
|
-
import {
|
|
6
|
+
import { type Edge, Graph, type PlainObject } from '@antv/graphlib';
|
|
7
7
|
import {
|
|
8
|
-
type Layout,
|
|
9
8
|
D3ForceLayout,
|
|
10
9
|
type D3ForceLayoutOptions,
|
|
11
10
|
GridLayout,
|
|
12
11
|
type GridLayoutOptions,
|
|
12
|
+
type Layout,
|
|
13
13
|
RadialLayout,
|
|
14
14
|
type RadialLayoutOptions,
|
|
15
15
|
} from '@antv/layout';
|
|
16
|
-
import {
|
|
16
|
+
import { type Editor, type SerializedStore, type TLRecord, createBindingId, createShapeId } from '@tldraw/tldraw';
|
|
17
17
|
|
|
18
18
|
import { faker } from '@dxos/random';
|
|
19
|
-
import {
|
|
19
|
+
import { isTruthy, range } from '@dxos/util';
|
|
20
20
|
|
|
21
21
|
// TODO(burdon): Graph layout:
|
|
22
22
|
// - https://www.npmjs.com/package/@antv/layout (uses d3)
|
|
@@ -67,7 +67,7 @@ export const generateGraph = (): Graph<PlainObject, PlainObject> => {
|
|
|
67
67
|
}
|
|
68
68
|
return target;
|
|
69
69
|
})
|
|
70
|
-
.filter(
|
|
70
|
+
.filter(isTruthy);
|
|
71
71
|
|
|
72
72
|
for (const target of targets) {
|
|
73
73
|
traverse(target);
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
+
import { RESEARCH_BLUEPRINT, agent, entityExtraction } from '@dxos/assistant-testing';
|
|
8
|
+
import { Prompt } from '@dxos/blueprints';
|
|
7
9
|
import { type ComputeGraphModel, NODE_INPUT } from '@dxos/conductor';
|
|
8
|
-
import { DXN, Key, Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
-
import { FunctionTrigger, TriggerKind, type TriggerType } from '@dxos/functions';
|
|
10
|
+
import { DXN, Filter, Key, Obj, Query, Ref, Tag, Type } from '@dxos/echo';
|
|
11
|
+
import { FunctionTrigger, type TriggerKind, type TriggerType, serializeFunction } from '@dxos/functions';
|
|
10
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { sync } from '@dxos/plugin-inbox';
|
|
14
|
+
import { Mailbox } from '@dxos/plugin-inbox/types';
|
|
15
|
+
import { Markdown } from '@dxos/plugin-markdown/types';
|
|
11
16
|
import { type Space } from '@dxos/react-client/echo';
|
|
12
17
|
import {
|
|
13
18
|
type ComputeShape,
|
|
@@ -18,8 +23,8 @@ import {
|
|
|
18
23
|
createFunction,
|
|
19
24
|
createGpt,
|
|
20
25
|
createQueue,
|
|
21
|
-
createSurface,
|
|
22
26
|
createRandom,
|
|
27
|
+
createSurface,
|
|
23
28
|
createTemplate,
|
|
24
29
|
createText,
|
|
25
30
|
createTrigger,
|
|
@@ -31,11 +36,14 @@ import {
|
|
|
31
36
|
pointsToRect,
|
|
32
37
|
rectToPoints,
|
|
33
38
|
} from '@dxos/react-ui-canvas-editor';
|
|
39
|
+
import { DataType, createView } from '@dxos/schema';
|
|
34
40
|
import { range } from '@dxos/util';
|
|
35
41
|
|
|
36
42
|
import { type ObjectGenerator } from './ObjectGenerator';
|
|
37
43
|
|
|
38
44
|
export enum PresetName {
|
|
45
|
+
DXOS_TEAM = 'dxos-team',
|
|
46
|
+
ORG_RESEARCH_PROJECT = 'org-research-project',
|
|
39
47
|
// EMAIL_TABLE = 'email-table',
|
|
40
48
|
GPT_QUEUE = 'webhook-gpt-queue',
|
|
41
49
|
CHAT_GPT = 'chat-gpt-text',
|
|
@@ -51,6 +59,156 @@ export const generator = () => ({
|
|
|
51
59
|
schemas: [CanvasBoardType, FunctionTrigger],
|
|
52
60
|
types: Object.values(PresetName).map((name) => ({ typename: name })),
|
|
53
61
|
items: [
|
|
62
|
+
[
|
|
63
|
+
PresetName.DXOS_TEAM,
|
|
64
|
+
async (space, n, cb) => {
|
|
65
|
+
const objects = range(n, () => {
|
|
66
|
+
const tag = space.db.add(Tag.make({ label: 'Investor' }));
|
|
67
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
68
|
+
|
|
69
|
+
const org = space.db.add(Obj.make(DataType.Organization, { name: 'DXOS', website: 'https://dxos.org' }));
|
|
70
|
+
|
|
71
|
+
const doc = space.db.add(
|
|
72
|
+
Markdown.makeDocument({
|
|
73
|
+
name: 'DXOS Research',
|
|
74
|
+
content: 'DXOS builds Composer, an open-source AI-powered malleable application.',
|
|
75
|
+
}),
|
|
76
|
+
);
|
|
77
|
+
Obj.getMeta(doc).tags = [tagDxn];
|
|
78
|
+
// space.db.add(
|
|
79
|
+
// Relation.make(ResearchOn, {
|
|
80
|
+
// [Relation.Source]: doc,
|
|
81
|
+
// [Relation.Target]: org,
|
|
82
|
+
// completedAt: new Date().toISOString(),
|
|
83
|
+
// }),
|
|
84
|
+
// );
|
|
85
|
+
|
|
86
|
+
space.db.add(
|
|
87
|
+
Obj.make(DataType.Person, { fullName: 'Rich', organization: Ref.make(org) }, { tags: [tagDxn] }),
|
|
88
|
+
);
|
|
89
|
+
space.db.add(Obj.make(DataType.Person, { fullName: 'Josiah', organization: Ref.make(org) }));
|
|
90
|
+
space.db.add(Obj.make(DataType.Person, { fullName: 'Dima', organization: Ref.make(org) }));
|
|
91
|
+
space.db.add(Obj.make(DataType.Person, { fullName: 'Mykola', organization: Ref.make(org) }));
|
|
92
|
+
space.db.add(Obj.make(DataType.Person, { fullName: 'Will', organization: Ref.make(org) }));
|
|
93
|
+
|
|
94
|
+
return doc;
|
|
95
|
+
});
|
|
96
|
+
cb?.(objects);
|
|
97
|
+
return objects;
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
PresetName.ORG_RESEARCH_PROJECT,
|
|
102
|
+
async (space, n, cb) => {
|
|
103
|
+
const mailbox = await space.db.query(Filter.type(Mailbox.Mailbox)).first();
|
|
104
|
+
const tag = await space.db.query(Filter.type(Tag.Tag, { label: 'Investor' })).first();
|
|
105
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
106
|
+
|
|
107
|
+
const objects = range(n, () => {
|
|
108
|
+
const contactsQuery = Query.select(Filter.type(DataType.Person)).select(Filter.tag(tagDxn));
|
|
109
|
+
const organizationsQuery = Query.select(Filter.type(DataType.Organization)).select(Filter.tag(tagDxn));
|
|
110
|
+
const notesQuery = Query.select(Filter.type(Markdown.Document)).select(Filter.tag(tagDxn));
|
|
111
|
+
|
|
112
|
+
const emailSyncTrigger = Obj.make(FunctionTrigger, {
|
|
113
|
+
enabled: true,
|
|
114
|
+
spec: {
|
|
115
|
+
kind: 'timer',
|
|
116
|
+
cron: '* * * * *', // Every minute.
|
|
117
|
+
},
|
|
118
|
+
function: Ref.make(serializeFunction(sync)),
|
|
119
|
+
input: {
|
|
120
|
+
mailboxId: Obj.getDXN(mailbox).toString(),
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
space.db.add(emailSyncTrigger);
|
|
124
|
+
|
|
125
|
+
const contactExtractionTrigger = Obj.make(FunctionTrigger, {
|
|
126
|
+
enabled: true,
|
|
127
|
+
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
128
|
+
spec: {
|
|
129
|
+
kind: 'queue',
|
|
130
|
+
queue: mailbox.queue.dxn.toString(),
|
|
131
|
+
},
|
|
132
|
+
function: Ref.make(serializeFunction(entityExtraction)),
|
|
133
|
+
input: {
|
|
134
|
+
source: '{{event.item}}',
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
space.db.add(contactExtractionTrigger);
|
|
138
|
+
|
|
139
|
+
const researchPrompt = space.db.add(
|
|
140
|
+
Prompt.make({
|
|
141
|
+
name: 'Research',
|
|
142
|
+
description: 'Research organization',
|
|
143
|
+
input: Schema.Struct({
|
|
144
|
+
org: Schema.Any,
|
|
145
|
+
}),
|
|
146
|
+
output: Schema.Any,
|
|
147
|
+
|
|
148
|
+
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
149
|
+
// Remove the mock prompt to do the actual research.
|
|
150
|
+
instructions:
|
|
151
|
+
'Research the organization provided as input. Create a research note for it at the end. NOTE: Do mocked reseach (set mockSearch to true).',
|
|
152
|
+
blueprints: [Ref.make(RESEARCH_BLUEPRINT)],
|
|
153
|
+
}),
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
const researchTrigger = Obj.make(FunctionTrigger, {
|
|
157
|
+
enabled: true,
|
|
158
|
+
spec: {
|
|
159
|
+
kind: 'subscription',
|
|
160
|
+
query: {
|
|
161
|
+
ast: organizationsQuery.ast,
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
function: Ref.make(serializeFunction(agent)),
|
|
165
|
+
input: {
|
|
166
|
+
prompt: Ref.make(researchPrompt),
|
|
167
|
+
input: '{{event.subject}}',
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
space.db.add(researchTrigger);
|
|
171
|
+
|
|
172
|
+
const mailboxView = createView({
|
|
173
|
+
name: 'Mailbox',
|
|
174
|
+
query: Query.select(
|
|
175
|
+
Filter.type(DataType.Message, { properties: { labels: Filter.contains('investor') } }),
|
|
176
|
+
).options({
|
|
177
|
+
queues: [mailbox.queue.dxn.toString()],
|
|
178
|
+
}),
|
|
179
|
+
jsonSchema: Type.toJsonSchema(DataType.Message),
|
|
180
|
+
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
181
|
+
});
|
|
182
|
+
const contactsView = createView({
|
|
183
|
+
name: 'Contacts',
|
|
184
|
+
query: contactsQuery,
|
|
185
|
+
jsonSchema: Type.toJsonSchema(DataType.Person),
|
|
186
|
+
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
187
|
+
});
|
|
188
|
+
const organizationsView = createView({
|
|
189
|
+
name: 'Organizations',
|
|
190
|
+
query: organizationsQuery,
|
|
191
|
+
jsonSchema: Type.toJsonSchema(DataType.Organization),
|
|
192
|
+
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
193
|
+
});
|
|
194
|
+
const notesView = createView({
|
|
195
|
+
name: 'Notes',
|
|
196
|
+
query: notesQuery,
|
|
197
|
+
jsonSchema: Type.toJsonSchema(Markdown.Document),
|
|
198
|
+
presentation: Obj.make(DataType.Collection, { objects: [] }),
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
return space.db.add(
|
|
202
|
+
DataType.makeProject({
|
|
203
|
+
name: 'Investor Research',
|
|
204
|
+
collections: [mailboxView, contactsView, organizationsView, notesView].map((view) => Ref.make(view)),
|
|
205
|
+
}),
|
|
206
|
+
);
|
|
207
|
+
});
|
|
208
|
+
cb?.(objects.flat());
|
|
209
|
+
return objects.flat();
|
|
210
|
+
},
|
|
211
|
+
],
|
|
54
212
|
[
|
|
55
213
|
PresetName.GPT_QUEUE,
|
|
56
214
|
async (space, n, cb) => {
|
|
@@ -62,7 +220,7 @@ export const generator = () => ({
|
|
|
62
220
|
const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));
|
|
63
221
|
const triggerShape = createTrigger({
|
|
64
222
|
spaceId: space.id,
|
|
65
|
-
triggerKind:
|
|
223
|
+
triggerKind: 'webhook',
|
|
66
224
|
...position({ x: -18, y: -2 }),
|
|
67
225
|
});
|
|
68
226
|
const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -96,8 +254,11 @@ export const generator = () => ({
|
|
|
96
254
|
const objects = range(n, () => {
|
|
97
255
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
98
256
|
space,
|
|
99
|
-
|
|
100
|
-
(triggerSpec) =>
|
|
257
|
+
'subscription',
|
|
258
|
+
(triggerSpec) =>
|
|
259
|
+
(triggerSpec.query = {
|
|
260
|
+
ast: Query.select(Filter.typename('dxos.org/type/Chess')).ast,
|
|
261
|
+
}),
|
|
101
262
|
'type',
|
|
102
263
|
);
|
|
103
264
|
return addToSpace(PresetName.OBJECT_CHANGE_QUEUE, space, canvasModel, computeModel);
|
|
@@ -113,7 +274,7 @@ export const generator = () => ({
|
|
|
113
274
|
const objects = range(n, () => {
|
|
114
275
|
const { canvasModel, computeModel } = createQueueSinkPreset(
|
|
115
276
|
space,
|
|
116
|
-
|
|
277
|
+
'timer',
|
|
117
278
|
(triggerSpec) => (triggerSpec.cron = '*/5 * * * * *'),
|
|
118
279
|
'result',
|
|
119
280
|
);
|
|
@@ -147,7 +308,7 @@ export const generator = () => ({
|
|
|
147
308
|
// canvasModel.builder.call((builder) => {
|
|
148
309
|
// const triggerShape = createTrigger({
|
|
149
310
|
// spaceId: space.id,
|
|
150
|
-
// triggerKind:
|
|
311
|
+
// triggerKind: 'email',
|
|
151
312
|
// ...position({ x: -18, y: -2 }),
|
|
152
313
|
// });
|
|
153
314
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -254,7 +415,7 @@ export const generator = () => ({
|
|
|
254
415
|
// );
|
|
255
416
|
// const triggerShape = createTrigger({
|
|
256
417
|
// spaceId: space.id,
|
|
257
|
-
// triggerKind:
|
|
418
|
+
// triggerKind: 'email',
|
|
258
419
|
// ...rawPosition({ centerX: -736, centerY: -384, width: 182, height: 192 }),
|
|
259
420
|
// });
|
|
260
421
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -358,7 +519,7 @@ export const generator = () => ({
|
|
|
358
519
|
canvasModel.builder.call((builder) => {
|
|
359
520
|
const triggerShape = createTrigger({
|
|
360
521
|
spaceId: space.id,
|
|
361
|
-
triggerKind:
|
|
522
|
+
triggerKind: 'timer',
|
|
362
523
|
...position({ x: -10, y: -5 }),
|
|
363
524
|
});
|
|
364
525
|
const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -416,7 +577,7 @@ export const generator = () => ({
|
|
|
416
577
|
// canvasModel.builder.call((builder) => {
|
|
417
578
|
// const triggerShape = createTrigger({
|
|
418
579
|
// spaceId: space.id,
|
|
419
|
-
// triggerKind:
|
|
580
|
+
// triggerKind: 'queue',
|
|
420
581
|
// ...position({ x: -10, y: -5 }),
|
|
421
582
|
// });
|
|
422
583
|
// const trigger = canvasModel.createNode(triggerShape);
|
|
@@ -22,6 +22,7 @@ export type WireframeProps = ThemedClassName<{
|
|
|
22
22
|
export const Wireframe = ({ classNames, label, object }: WireframeProps) => {
|
|
23
23
|
const attentionAttrs = useAttentionAttributes(fullyQualifiedId(object));
|
|
24
24
|
const { width, height, ref } = useResizeDetector();
|
|
25
|
+
|
|
25
26
|
return (
|
|
26
27
|
<div ref={ref} className={mx('relative grow min-bs-96', classNames)} {...attentionAttrs}>
|
|
27
28
|
<div className='absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono'>
|
|
@@ -30,7 +31,7 @@ export const Wireframe = ({ classNames, label, object }: WireframeProps) => {
|
|
|
30
31
|
<div>{`[${width}x${height}]`}</div>
|
|
31
32
|
</div>
|
|
32
33
|
{object && (
|
|
33
|
-
<SyntaxHighlighter language='json' classNames='
|
|
34
|
+
<SyntaxHighlighter language='json' classNames='text-xs opacity-75 rounded'>
|
|
34
35
|
{JSON.stringify(object, undefined, 2)}
|
|
35
36
|
</SyntaxHighlighter>
|
|
36
37
|
)}
|
package/src/components/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { lazy } from 'react';
|
|
6
6
|
|
|
7
|
-
export const
|
|
7
|
+
export const DebugGraph = lazy(() => import('./DebugGraph'));
|
|
8
8
|
export const DevtoolsOverviewContainer = lazy(() => import('./DevtoolsOverviewContainer'));
|
|
9
9
|
export const SpaceGenerator = lazy(() => import('./SpaceGenerator'));
|
|
10
10
|
|
package/src/meta.ts
CHANGED
|
@@ -4,10 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const DEBUG_PLUGIN = 'dxos.org/plugin/debug';
|
|
8
|
-
|
|
9
7
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
8
|
+
id: 'dxos.org/plugin/debug',
|
|
11
9
|
name: 'Debug',
|
|
12
10
|
description:
|
|
13
11
|
'The debug plugin is useful for troubleshooting inside of Composer. You can also use the Debug plugin to create test data inside of sheets or tables or explore pre-built automations. Non-technical users will likely not spend much time here, but this plugin is invaluable for developers and technical users.',
|
package/src/translations.ts
CHANGED
|
@@ -11,12 +11,14 @@ export const translations = [
|
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
13
|
'plugin name': 'Debug',
|
|
14
|
+
'settings title': 'Debug settings',
|
|
14
15
|
'mutation count': 'Number of mutations',
|
|
15
16
|
'mutation period': 'Mutation period',
|
|
16
17
|
'open devtools label': 'Open DevTools',
|
|
17
18
|
'devtools label': 'DevTools',
|
|
18
19
|
'devtools overview label': 'DevTools Stats',
|
|
19
20
|
'debug label': 'Debug',
|
|
21
|
+
'debug app graph label': 'App Graph',
|
|
20
22
|
'settings show debug panel': 'Show Debug panel.',
|
|
21
23
|
'settings show devtools panel': 'Show DevTools panel.',
|
|
22
24
|
'settings wireframe': 'Show wireframes.',
|