@dxos/plugin-debug 0.8.4-main.e098934 → 0.8.4-main.e8ec1fe
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/{DevtoolsOverviewContainer-EPD6EWT5.mjs → DevtoolsOverviewContainer-JXVZVPHN.mjs} +2 -2
- package/dist/lib/browser/{DevtoolsOverviewContainer-EPD6EWT5.mjs.map → DevtoolsOverviewContainer-JXVZVPHN.mjs.map} +1 -1
- package/dist/lib/browser/{SpaceGenerator-SRCIEELZ.mjs → SpaceGenerator-46TAISVE.mjs} +142 -90
- package/dist/lib/browser/SpaceGenerator-46TAISVE.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-JTIEFOWZ.mjs → app-graph-builder-CRH2HJKT.mjs} +60 -59
- package/dist/lib/browser/app-graph-builder-CRH2HJKT.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-WZFZ4ESO.mjs +20 -0
- package/dist/lib/browser/chunk-WZFZ4ESO.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +11 -14
- 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-P2YDWEWI.mjs} +6 -6
- package/dist/lib/browser/react-context-P2YDWEWI.mjs.map +7 -0
- package/dist/lib/browser/{react-surface-HQPOGG33.mjs → react-surface-2SNVZDEA.mjs} +85 -84
- package/dist/lib/browser/react-surface-2SNVZDEA.mjs.map +7 -0
- package/dist/lib/browser/{settings-LSSWLM5I.mjs → settings-SQXR3OAH.mjs} +5 -5
- package/dist/lib/browser/{settings-LSSWLM5I.mjs.map → settings-SQXR3OAH.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.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- 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 +2 -2
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts +0 -1
- package/dist/types/src/components/SpaceGenerator/SpaceGenerator.stories.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/presets.d.ts +4 -4
- package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -1
- package/dist/types/src/components/Wireframe.d.ts +1 -1
- package/dist/types/src/components/Wireframe.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 +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 +67 -66
- package/src/DebugPlugin.tsx +5 -6
- package/src/capabilities/app-graph-builder.ts +59 -58
- package/src/capabilities/react-context.tsx +2 -2
- package/src/capabilities/react-surface.tsx +70 -50
- package/src/components/DebugObjectPanel.tsx +2 -4
- package/src/components/DebugSettings.tsx +39 -18
- package/src/components/DebugStatus.tsx +2 -2
- package/src/components/DevtoolsOverviewContainer.tsx +1 -1
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +16 -22
- package/src/components/SpaceGenerator/SchemaTable.tsx +2 -2
- package/src/components/SpaceGenerator/SpaceGenerator.stories.tsx +3 -5
- package/src/components/SpaceGenerator/SpaceGenerator.tsx +6 -6
- package/src/components/SpaceGenerator/draw-util.ts +2 -2
- package/src/components/SpaceGenerator/presets.ts +124 -59
- package/src/components/Wireframe.tsx +2 -3
- package/src/meta.ts +6 -5
- package/src/translations.ts +1 -1
- package/src/types.ts +1 -1
- package/dist/lib/browser/SpaceGenerator-SRCIEELZ.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-JTIEFOWZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-5XPIRNQS.mjs +0 -18
- package/dist/lib/browser/chunk-5XPIRNQS.mjs.map +0 -7
- package/dist/lib/browser/chunk-AJA6RYN3.mjs.map +0 -7
- package/dist/lib/browser/react-context-NVAGLAJD.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HQPOGG33.mjs.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/components/DevtoolsOverviewContainer.tsx
|
|
2
2
|
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
3
3
|
import React from "react";
|
|
4
|
-
import { Surface } from "@dxos/app-framework";
|
|
4
|
+
import { Surface } from "@dxos/app-framework/react";
|
|
5
5
|
import { StatsPanel, useStats } from "@dxos/devtools";
|
|
6
6
|
var DevtoolsOverviewContainer = () => {
|
|
7
7
|
var _effect = _useSignals();
|
|
@@ -22,4 +22,4 @@ export {
|
|
|
22
22
|
DevtoolsOverviewContainer,
|
|
23
23
|
DevtoolsOverviewContainer_default as default
|
|
24
24
|
};
|
|
25
|
-
//# sourceMappingURL=DevtoolsOverviewContainer-
|
|
25
|
+
//# sourceMappingURL=DevtoolsOverviewContainer-JXVZVPHN.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DevtoolsOverviewContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework';\nimport { StatsPanel, useStats } from '@dxos/devtools';\n\nexport const DevtoolsOverviewContainer = () => {\n const [stats, refreshStats] = useStats();\n\n return (\n <StatsPanel stats={stats} onRefresh={refreshStats}>\n <Surface role='devtools-overview' />\n </StatsPanel>\n );\n};\n\nexport default DevtoolsOverviewContainer;\n"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Surface } from '@dxos/app-framework/react';\nimport { StatsPanel, useStats } from '@dxos/devtools';\n\nexport const DevtoolsOverviewContainer = () => {\n const [stats, refreshStats] = useStats();\n\n return (\n <StatsPanel stats={stats} onRefresh={refreshStats}>\n <Surface role='devtools-overview' />\n </StatsPanel>\n );\n};\n\nexport default DevtoolsOverviewContainer;\n"],
|
|
5
5
|
"mappings": ";;AAIA,OAAOA,WAAW;AAElB,SAASC,eAAe;AACxB,SAASC,YAAYC,gBAAgB;AAE9B,IAAMC,4BAA4B,MAAA;;;AACvC,UAAM,CAACC,OAAOC,YAAAA,IAAgBC,SAAAA;AAE9B,WACE,sBAAA,cAACC,YAAAA;MAAWH;MAAcI,WAAWH;OACnC,sBAAA,cAACI,SAAAA;MAAQC,MAAK;;;;;AAGpB;AAEA,IAAA,oCAAeP;",
|
|
6
6
|
"names": ["React", "Surface", "StatsPanel", "useStats", "DevtoolsOverviewContainer", "stats", "refreshStats", "useStats", "StatsPanel", "onRefresh", "Surface", "role"]
|
|
7
7
|
}
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
// src/components/SpaceGenerator/SpaceGenerator.tsx
|
|
2
2
|
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
3
3
|
import React2, { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { useIntentDispatcher } from "@dxos/app-framework";
|
|
4
|
+
import { useIntentDispatcher } from "@dxos/app-framework/react";
|
|
5
5
|
import { ComputeGraph as ComputeGraph2 } from "@dxos/conductor";
|
|
6
6
|
import { Filter as Filter3 } from "@dxos/echo";
|
|
7
7
|
import { Markdown as Markdown3 } from "@dxos/plugin-markdown/types";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Sheet as Sheet2 } from "@dxos/plugin-sheet/types";
|
|
9
|
+
import { Diagram as Diagram2 } from "@dxos/plugin-sketch/types";
|
|
10
10
|
import { useClient } from "@dxos/react-client";
|
|
11
11
|
import { getTypename } from "@dxos/react-client/echo";
|
|
12
12
|
import { IconButton as IconButton2, Input, Toolbar, useAsyncEffect } from "@dxos/react-ui";
|
|
13
13
|
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
14
|
-
import {
|
|
14
|
+
import { Organization as Organization2, Person as Person2, Task } from "@dxos/types";
|
|
15
15
|
import { jsonKeyReplacer, sortKeys } from "@dxos/util";
|
|
16
16
|
|
|
17
17
|
// src/components/SpaceGenerator/ObjectGenerator.tsx
|
|
18
18
|
import { createIntent } from "@dxos/app-framework";
|
|
19
19
|
import { addressToA1Notation } from "@dxos/compute";
|
|
20
20
|
import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from "@dxos/conductor";
|
|
21
|
-
import { DXN, Filter, Key,
|
|
21
|
+
import { DXN, Filter, Key, Type } from "@dxos/echo";
|
|
22
22
|
import { Markdown } from "@dxos/plugin-markdown/types";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { CanvasType, DiagramType } from "@dxos/plugin-sketch/types";
|
|
23
|
+
import { Sheet } from "@dxos/plugin-sheet/types";
|
|
24
|
+
import { Diagram } from "@dxos/plugin-sketch/types";
|
|
26
25
|
import { SpaceAction } from "@dxos/plugin-space/types";
|
|
27
26
|
import { faker } from "@dxos/random";
|
|
28
|
-
import {
|
|
27
|
+
import { View, getTypenameFromQuery } from "@dxos/schema";
|
|
29
28
|
import { createAsyncGenerator } from "@dxos/schema/testing";
|
|
30
29
|
import { range } from "@dxos/util";
|
|
31
30
|
var generator = faker;
|
|
32
31
|
var findViewByTypename = async (views, typename) => {
|
|
33
|
-
return views.find((view) =>
|
|
32
|
+
return views.find((view) => getTypenameFromQuery(view.query.ast) === typename);
|
|
34
33
|
};
|
|
35
34
|
var createGenerator = (client, dispatch, schema) => {
|
|
36
35
|
return async (space, n) => {
|
|
37
36
|
const typename = schema.typename;
|
|
38
|
-
const { objects: views } = await space.db.query(Filter.type(
|
|
37
|
+
const { objects: views } = await space.db.query(Filter.type(View.View)).run();
|
|
39
38
|
const view = await findViewByTypename(views, typename);
|
|
40
39
|
const staticSchema = client?.graph.schemaRegistry.schemas.find((schema2) => Type.getTypename(schema2) === typename);
|
|
41
40
|
if (!view && !staticSchema) {
|
|
42
41
|
await dispatch(createIntent(SpaceAction.AddSchema, {
|
|
43
42
|
space,
|
|
44
|
-
schema
|
|
43
|
+
schema,
|
|
44
|
+
show: false
|
|
45
45
|
}));
|
|
46
46
|
} else if (!view && staticSchema) {
|
|
47
47
|
await dispatch(createIntent(SpaceAction.UseStaticSchema, {
|
|
48
48
|
space,
|
|
49
|
-
typename
|
|
49
|
+
typename,
|
|
50
|
+
show: false
|
|
50
51
|
}));
|
|
51
52
|
}
|
|
52
53
|
const generate = createAsyncGenerator(generator, schema, {
|
|
@@ -60,7 +61,7 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
60
61
|
Markdown.Document.typename,
|
|
61
62
|
async (space, n, cb) => {
|
|
62
63
|
const objects = range(n).map(() => {
|
|
63
|
-
return space.db.add(Markdown.
|
|
64
|
+
return space.db.add(Markdown.make({
|
|
64
65
|
name: faker.commerce.productName(),
|
|
65
66
|
content: faker.lorem.sentences(5)
|
|
66
67
|
}));
|
|
@@ -70,14 +71,11 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
70
71
|
}
|
|
71
72
|
],
|
|
72
73
|
[
|
|
73
|
-
|
|
74
|
+
Diagram.Diagram.typename,
|
|
74
75
|
async (space, n, cb) => {
|
|
75
76
|
const objects = range(n).map(() => {
|
|
76
|
-
const obj = space.db.add(
|
|
77
|
-
name: faker.commerce.productName()
|
|
78
|
-
canvas: Ref.make(Obj.make(CanvasType, {
|
|
79
|
-
content: {}
|
|
80
|
-
}))
|
|
77
|
+
const obj = space.db.add(Diagram.make({
|
|
78
|
+
name: faker.commerce.productName()
|
|
81
79
|
}));
|
|
82
80
|
return obj;
|
|
83
81
|
});
|
|
@@ -87,7 +85,7 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
87
85
|
],
|
|
88
86
|
// TODO(burdon): Create unit tests.
|
|
89
87
|
[
|
|
90
|
-
|
|
88
|
+
Sheet.Sheet.typename,
|
|
91
89
|
async (space, n, cb) => {
|
|
92
90
|
const objects = range(n).map(() => {
|
|
93
91
|
const cells = {};
|
|
@@ -123,7 +121,7 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
}
|
|
126
|
-
return space.db.add(
|
|
124
|
+
return space.db.add(Sheet.make({
|
|
127
125
|
name: faker.commerce.productName(),
|
|
128
126
|
cells
|
|
129
127
|
}));
|
|
@@ -197,34 +195,37 @@ var staticGenerators = /* @__PURE__ */ new Map([
|
|
|
197
195
|
]);
|
|
198
196
|
|
|
199
197
|
// src/components/SpaceGenerator/presets.ts
|
|
200
|
-
import
|
|
201
|
-
import {
|
|
198
|
+
import * as Schema from "effect/Schema";
|
|
199
|
+
import { Agent, EntityExtraction, ResearchBlueprint } from "@dxos/assistant-toolkit";
|
|
200
|
+
import { Prompt } from "@dxos/blueprints";
|
|
202
201
|
import { NODE_INPUT as NODE_INPUT2 } from "@dxos/conductor";
|
|
203
|
-
import { DXN as DXN2, Filter as Filter2, Key as Key2, Obj
|
|
204
|
-
import {
|
|
202
|
+
import { DXN as DXN2, Filter as Filter2, Key as Key2, Obj, Query, Ref, Tag, Type as Type2 } from "@dxos/echo";
|
|
203
|
+
import { Trigger, serializeFunction } from "@dxos/functions";
|
|
205
204
|
import { invariant } from "@dxos/invariant";
|
|
205
|
+
import { gmail } from "@dxos/plugin-inbox";
|
|
206
206
|
import { Mailbox } from "@dxos/plugin-inbox/types";
|
|
207
207
|
import { Markdown as Markdown2 } from "@dxos/plugin-markdown/types";
|
|
208
208
|
import { createAppend, createChat, createComputeGraph, createConstant, createFunction, createGpt, createQueue, createRandom, createSurface, createTemplate, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
|
|
209
209
|
import { CanvasBoardType, CanvasGraphModel, pointMultiply, pointsToRect, rectToPoints } from "@dxos/react-ui-canvas-editor";
|
|
210
|
-
import {
|
|
211
|
-
import {
|
|
210
|
+
import { Collection, View as View2 } from "@dxos/schema";
|
|
211
|
+
import { Message, Organization, Person, Project } from "@dxos/types";
|
|
212
|
+
import { range as range2, trim } from "@dxos/util";
|
|
212
213
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-debug/src/components/SpaceGenerator/presets.ts";
|
|
213
|
-
var PresetName = /* @__PURE__ */ function(PresetName2) {
|
|
214
|
+
var PresetName = /* @__PURE__ */ (function(PresetName2) {
|
|
214
215
|
PresetName2["DXOS_TEAM"] = "dxos-team";
|
|
215
216
|
PresetName2["ORG_RESEARCH_PROJECT"] = "org-research-project";
|
|
216
217
|
PresetName2["GPT_QUEUE"] = "webhook-gpt-queue";
|
|
217
218
|
PresetName2["CHAT_GPT"] = "chat-gpt-text";
|
|
218
219
|
PresetName2["OBJECT_CHANGE_QUEUE"] = "objectChange-queue";
|
|
219
|
-
PresetName2["FOREX_FUNCTION_CALL"] = "forex-function-call";
|
|
220
220
|
PresetName2["TIMER_TICK_QUEUE"] = "timerTick-queue";
|
|
221
|
+
PresetName2["FOREX_FUNCTION_CALL"] = "forex-function-call";
|
|
221
222
|
PresetName2["DISCORD_MESSAGES"] = "discord-messages";
|
|
222
223
|
return PresetName2;
|
|
223
|
-
}({});
|
|
224
|
+
})({});
|
|
224
225
|
var generator2 = () => ({
|
|
225
226
|
schemas: [
|
|
226
227
|
CanvasBoardType,
|
|
227
|
-
|
|
228
|
+
Trigger.Trigger
|
|
228
229
|
],
|
|
229
230
|
types: Object.values(PresetName).map((name) => ({
|
|
230
231
|
typename: name
|
|
@@ -234,39 +235,40 @@ var generator2 = () => ({
|
|
|
234
235
|
"dxos-team",
|
|
235
236
|
async (space, n, cb) => {
|
|
236
237
|
const objects = range2(n, () => {
|
|
237
|
-
const org = space.db.add(
|
|
238
|
+
const org = space.db.add(Obj.make(Organization.Organization, {
|
|
238
239
|
name: "DXOS",
|
|
239
240
|
website: "https://dxos.org"
|
|
240
241
|
}));
|
|
241
|
-
const doc = space.db.add(Markdown2.
|
|
242
|
+
const doc = space.db.add(Markdown2.make({
|
|
242
243
|
name: "DXOS Research",
|
|
243
244
|
content: "DXOS builds Composer, an open-source AI-powered malleable application."
|
|
244
245
|
}));
|
|
245
|
-
space.db.add(
|
|
246
|
-
|
|
247
|
-
[Relation.Target]: org,
|
|
248
|
-
completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
246
|
+
const tag = space.db.add(Tag.make({
|
|
247
|
+
label: "Investor"
|
|
249
248
|
}));
|
|
250
|
-
|
|
249
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
250
|
+
Obj.getMeta(doc).tags = [
|
|
251
|
+
tagDxn
|
|
252
|
+
];
|
|
253
|
+
space.db.add(Obj.make(Person.Person, {
|
|
251
254
|
fullName: "Rich",
|
|
252
|
-
|
|
253
|
-
|
|
255
|
+
organization: Ref.make(org)
|
|
256
|
+
}, {
|
|
257
|
+
tags: [
|
|
258
|
+
tagDxn
|
|
259
|
+
]
|
|
254
260
|
}));
|
|
255
|
-
space.db.add(
|
|
261
|
+
space.db.add(Obj.make(Person.Person, {
|
|
256
262
|
fullName: "Josiah",
|
|
257
|
-
organization:
|
|
263
|
+
organization: Ref.make(org)
|
|
258
264
|
}));
|
|
259
|
-
space.db.add(
|
|
265
|
+
space.db.add(Obj.make(Person.Person, {
|
|
260
266
|
fullName: "Dima",
|
|
261
|
-
organization:
|
|
267
|
+
organization: Ref.make(org)
|
|
262
268
|
}));
|
|
263
|
-
space.db.add(
|
|
269
|
+
space.db.add(Obj.make(Person.Person, {
|
|
264
270
|
fullName: "Mykola",
|
|
265
|
-
organization:
|
|
266
|
-
}));
|
|
267
|
-
space.db.add(Obj2.make(DataType2.Person, {
|
|
268
|
-
fullName: "Will",
|
|
269
|
-
organization: Ref2.make(org)
|
|
271
|
+
organization: Ref.make(org)
|
|
270
272
|
}));
|
|
271
273
|
return doc;
|
|
272
274
|
});
|
|
@@ -278,24 +280,72 @@ var generator2 = () => ({
|
|
|
278
280
|
"org-research-project",
|
|
279
281
|
async (space, n, cb) => {
|
|
280
282
|
const mailbox = await space.db.query(Filter2.type(Mailbox.Mailbox)).first();
|
|
283
|
+
const tag = await space.db.query(Filter2.type(Tag.Tag, {
|
|
284
|
+
label: "Investor"
|
|
285
|
+
})).first();
|
|
286
|
+
const tagDxn = Obj.getDXN(tag).toString();
|
|
281
287
|
const objects = range2(n, () => {
|
|
282
|
-
const contactsQuery = Query.select(Filter2.type(
|
|
283
|
-
|
|
288
|
+
const contactsQuery = Query.select(Filter2.type(Person.Person)).select(Filter2.tag(tagDxn));
|
|
289
|
+
const organizationsQuery = Query.select(Filter2.type(Organization.Organization)).select(Filter2.tag(tagDxn));
|
|
290
|
+
const notesQuery = Query.select(Filter2.type(Markdown2.Document)).select(Filter2.tag(tagDxn));
|
|
291
|
+
space.db.add(Trigger.make({
|
|
292
|
+
enabled: true,
|
|
293
|
+
spec: {
|
|
294
|
+
kind: "timer",
|
|
295
|
+
cron: "* * * * *"
|
|
296
|
+
},
|
|
297
|
+
function: Ref.make(serializeFunction(gmail.sync)),
|
|
298
|
+
input: {
|
|
299
|
+
mailboxId: Obj.getDXN(mailbox).toString()
|
|
300
|
+
}
|
|
284
301
|
}));
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
302
|
+
space.db.add(Trigger.make({
|
|
303
|
+
enabled: true,
|
|
304
|
+
// TODO(wittjosiah): Queue trigger doesn't support matching query of the column.
|
|
305
|
+
spec: {
|
|
306
|
+
kind: "queue",
|
|
307
|
+
queue: mailbox.queue.dxn.toString()
|
|
308
|
+
},
|
|
309
|
+
function: Ref.make(serializeFunction(EntityExtraction.extract)),
|
|
310
|
+
input: {
|
|
311
|
+
source: "{{event.item}}"
|
|
312
|
+
}
|
|
313
|
+
}));
|
|
314
|
+
const researchPrompt = space.db.add(Prompt.make({
|
|
315
|
+
name: "Research",
|
|
316
|
+
description: "Research organization",
|
|
317
|
+
input: Schema.Struct({
|
|
318
|
+
org: Schema.Any
|
|
319
|
+
}),
|
|
320
|
+
output: Schema.Any,
|
|
321
|
+
// TODO(dmaretskyi): This mocks research (returns pre-baked result), the actual research might take compute minutes.
|
|
322
|
+
// Remove the mock prompt to do the actual research.
|
|
323
|
+
instructions: trim`
|
|
324
|
+
Research the organization provided as input.
|
|
325
|
+
Create a research note for it at the end.
|
|
326
|
+
NOTE: Do mocked reseach (set mockSearch to true).
|
|
327
|
+
`,
|
|
328
|
+
blueprints: [
|
|
329
|
+
Ref.make(ResearchBlueprint)
|
|
330
|
+
]
|
|
331
|
+
}));
|
|
332
|
+
space.db.add(Trigger.make({
|
|
333
|
+
enabled: true,
|
|
289
334
|
spec: {
|
|
290
335
|
kind: "subscription",
|
|
291
|
-
query:
|
|
336
|
+
query: {
|
|
337
|
+
ast: organizationsQuery.ast
|
|
338
|
+
}
|
|
292
339
|
},
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
340
|
+
function: Ref.make(serializeFunction(Agent.prompt)),
|
|
341
|
+
input: {
|
|
342
|
+
prompt: Ref.make(researchPrompt),
|
|
343
|
+
input: "{{event.subject}}"
|
|
344
|
+
}
|
|
345
|
+
}));
|
|
346
|
+
const mailboxView = View2.make({
|
|
297
347
|
name: "Mailbox",
|
|
298
|
-
query: Query.select(Filter2.type(
|
|
348
|
+
query: Query.select(Filter2.type(Message.Message, {
|
|
299
349
|
properties: {
|
|
300
350
|
labels: Filter2.contains("investor")
|
|
301
351
|
}
|
|
@@ -304,43 +354,43 @@ var generator2 = () => ({
|
|
|
304
354
|
mailbox.queue.dxn.toString()
|
|
305
355
|
]
|
|
306
356
|
}),
|
|
307
|
-
jsonSchema: Type2.toJsonSchema(
|
|
308
|
-
presentation:
|
|
357
|
+
jsonSchema: Type2.toJsonSchema(Message.Message),
|
|
358
|
+
presentation: Obj.make(Collection.Collection, {
|
|
309
359
|
objects: []
|
|
310
360
|
})
|
|
311
361
|
});
|
|
312
|
-
const contactsView =
|
|
362
|
+
const contactsView = View2.make({
|
|
313
363
|
name: "Contacts",
|
|
314
364
|
query: contactsQuery,
|
|
315
|
-
jsonSchema: Type2.toJsonSchema(
|
|
316
|
-
presentation:
|
|
365
|
+
jsonSchema: Type2.toJsonSchema(Person.Person),
|
|
366
|
+
presentation: Obj.make(Collection.Collection, {
|
|
317
367
|
objects: []
|
|
318
368
|
})
|
|
319
369
|
});
|
|
320
|
-
const organizationsView =
|
|
370
|
+
const organizationsView = View2.make({
|
|
321
371
|
name: "Organizations",
|
|
322
372
|
query: organizationsQuery,
|
|
323
|
-
jsonSchema: Type2.toJsonSchema(
|
|
324
|
-
presentation:
|
|
373
|
+
jsonSchema: Type2.toJsonSchema(Organization.Organization),
|
|
374
|
+
presentation: Obj.make(Collection.Collection, {
|
|
325
375
|
objects: []
|
|
326
376
|
})
|
|
327
377
|
});
|
|
328
|
-
const notesView =
|
|
378
|
+
const notesView = View2.make({
|
|
329
379
|
name: "Notes",
|
|
330
380
|
query: notesQuery,
|
|
331
381
|
jsonSchema: Type2.toJsonSchema(Markdown2.Document),
|
|
332
|
-
presentation:
|
|
382
|
+
presentation: Obj.make(Collection.Collection, {
|
|
333
383
|
objects: []
|
|
334
384
|
})
|
|
335
385
|
});
|
|
336
|
-
return space.db.add(
|
|
386
|
+
return space.db.add(Project.make({
|
|
337
387
|
name: "Investor Research",
|
|
338
388
|
collections: [
|
|
339
389
|
mailboxView,
|
|
340
390
|
contactsView,
|
|
341
391
|
organizationsView,
|
|
342
392
|
notesView
|
|
343
|
-
].map((view) =>
|
|
393
|
+
].map((view) => Ref.make(view))
|
|
344
394
|
}));
|
|
345
395
|
});
|
|
346
396
|
cb?.(objects.flat());
|
|
@@ -411,7 +461,9 @@ var generator2 = () => ({
|
|
|
411
461
|
"objectChange-queue",
|
|
412
462
|
async (space, n, cb) => {
|
|
413
463
|
const objects = range2(n, () => {
|
|
414
|
-
const { canvasModel, computeModel } = createQueueSinkPreset(space, "subscription", (triggerSpec) => triggerSpec.query =
|
|
464
|
+
const { canvasModel, computeModel } = createQueueSinkPreset(space, "subscription", (triggerSpec) => triggerSpec.query = {
|
|
465
|
+
ast: Query.select(Filter2.typename("dxos.org/type/Chess")).ast
|
|
466
|
+
}, "type");
|
|
415
467
|
return addToSpace("objectChange-queue", space, canvasModel, computeModel);
|
|
416
468
|
});
|
|
417
469
|
cb?.(objects);
|
|
@@ -809,7 +861,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
809
861
|
const triggerSpec = functionTrigger.spec;
|
|
810
862
|
invariant(triggerSpec && triggerSpec.kind === triggerKind, "No trigger spec.", {
|
|
811
863
|
F: __dxlog_file,
|
|
812
|
-
L:
|
|
864
|
+
L: 662,
|
|
813
865
|
S: void 0,
|
|
814
866
|
A: [
|
|
815
867
|
"triggerSpec && triggerSpec.kind === triggerKind",
|
|
@@ -822,7 +874,7 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
822
874
|
const templateComputeNode = computeModel.nodes.find((n) => n.id === template.node);
|
|
823
875
|
invariant(templateComputeNode, "Template compute node was not created.", {
|
|
824
876
|
F: __dxlog_file,
|
|
825
|
-
L:
|
|
877
|
+
L: 669,
|
|
826
878
|
S: void 0,
|
|
827
879
|
A: [
|
|
828
880
|
"templateComputeNode",
|
|
@@ -846,9 +898,9 @@ var createQueueSinkPreset = (space, triggerKind, initSpec, triggerOutputName) =>
|
|
|
846
898
|
};
|
|
847
899
|
};
|
|
848
900
|
var addToSpace = (name, space, canvas, compute) => {
|
|
849
|
-
return space.db.add(
|
|
901
|
+
return space.db.add(Obj.make(CanvasBoardType, {
|
|
850
902
|
name,
|
|
851
|
-
computeGraph:
|
|
903
|
+
computeGraph: Ref.make(compute.root),
|
|
852
904
|
layout: canvas.graph
|
|
853
905
|
}));
|
|
854
906
|
};
|
|
@@ -884,14 +936,14 @@ var setupQueue = (space, canvasModel, args) => {
|
|
|
884
936
|
var attachTrigger = (functionTrigger, computeModel) => {
|
|
885
937
|
invariant(functionTrigger, void 0, {
|
|
886
938
|
F: __dxlog_file,
|
|
887
|
-
L:
|
|
939
|
+
L: 708,
|
|
888
940
|
S: void 0,
|
|
889
941
|
A: [
|
|
890
942
|
"functionTrigger",
|
|
891
943
|
""
|
|
892
944
|
]
|
|
893
945
|
});
|
|
894
|
-
functionTrigger.function =
|
|
946
|
+
functionTrigger.function = Ref.make(computeModel.root);
|
|
895
947
|
const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT2);
|
|
896
948
|
functionTrigger.inputNodeId = inputNode.id;
|
|
897
949
|
};
|
|
@@ -954,9 +1006,9 @@ var SchemaTable = ({ types, objects = {}, label, onClick }) => {
|
|
|
954
1006
|
key: type.typename,
|
|
955
1007
|
className: "grid grid-cols-subgrid col-span-3 items-center"
|
|
956
1008
|
}, /* @__PURE__ */ React.createElement("div", {
|
|
957
|
-
className: "
|
|
1009
|
+
className: "pli-2 text-sm font-mono text-subdued"
|
|
958
1010
|
}, type.typename), /* @__PURE__ */ React.createElement("div", {
|
|
959
|
-
className: "
|
|
1011
|
+
className: "pli-2 text-right font-mono"
|
|
960
1012
|
}, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
|
|
961
1013
|
variant: "ghost",
|
|
962
1014
|
icon: "ph--plus--regular",
|
|
@@ -977,14 +1029,14 @@ var SpaceGenerator = ({ space, onCreateObjects }) => {
|
|
|
977
1029
|
const client = useClient();
|
|
978
1030
|
const staticTypes = [
|
|
979
1031
|
Markdown3.Document,
|
|
980
|
-
|
|
981
|
-
|
|
1032
|
+
Diagram2.Diagram,
|
|
1033
|
+
Sheet2.Sheet,
|
|
982
1034
|
ComputeGraph2
|
|
983
1035
|
];
|
|
984
1036
|
const recordTypes = [
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1037
|
+
Organization2.Organization,
|
|
1038
|
+
Person2.Person,
|
|
1039
|
+
Task.Task
|
|
988
1040
|
];
|
|
989
1041
|
const [count, setCount] = useState(1);
|
|
990
1042
|
const [info, setInfo] = useState({});
|
|
@@ -1098,4 +1150,4 @@ var SpaceGenerator_default = SpaceGenerator;
|
|
|
1098
1150
|
export {
|
|
1099
1151
|
SpaceGenerator_default as default
|
|
1100
1152
|
};
|
|
1101
|
-
//# sourceMappingURL=SpaceGenerator-
|
|
1153
|
+
//# sourceMappingURL=SpaceGenerator-46TAISVE.mjs.map
|