@dxos/plugin-debug 0.7.5-labs.a279d8c → 0.7.5-labs.a8b535d

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.
Files changed (80) hide show
  1. package/dist/lib/browser/{DebugSpace-4JHYA7FG.mjs → DebugSpace-BTMTVZ6C.mjs} +2 -2
  2. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs +1238 -0
  3. package/dist/lib/browser/SpaceGenerator-BPZGOSH4.mjs.map +7 -0
  4. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs +533 -0
  5. package/dist/lib/browser/app-graph-builder-BZFZ6UG6.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-EF3UVAVI.mjs +21 -0
  7. package/dist/lib/browser/chunk-EF3UVAVI.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-UASI2CRI.mjs +72 -0
  9. package/dist/lib/browser/chunk-UASI2CRI.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +40 -10
  11. package/dist/lib/browser/index.mjs.map +3 -3
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/react-context-TCD3MNIT.mjs +16 -0
  14. package/dist/lib/browser/react-context-TCD3MNIT.mjs.map +7 -0
  15. package/dist/lib/browser/{react-surface-ACHNR2UU.mjs → react-surface-W6QLG4YJ.mjs} +240 -80
  16. package/dist/lib/browser/react-surface-W6QLG4YJ.mjs.map +7 -0
  17. package/dist/lib/browser/{settings-JCZUA643.mjs → settings-INPXR64L.mjs} +6 -7
  18. package/dist/lib/browser/{settings-JCZUA643.mjs.map → settings-INPXR64L.mjs.map} +3 -3
  19. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  20. package/dist/types/src/capabilities/app-graph-builder.d.ts +110 -110
  21. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  22. package/dist/types/src/capabilities/index.d.ts +116 -116
  23. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  24. package/dist/types/src/capabilities/react-context.d.ts.map +1 -1
  25. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  26. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  27. package/dist/types/src/components/Container.d.ts +2 -2
  28. package/dist/types/src/components/Container.d.ts.map +1 -1
  29. package/dist/types/src/components/DebugObjectPanel.d.ts +1 -2
  30. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -1
  31. package/dist/types/src/components/DebugSettings.d.ts +1 -2
  32. package/dist/types/src/components/DebugSettings.d.ts.map +1 -1
  33. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts +1 -2
  34. package/dist/types/src/components/DebugSpace/ObjectCreator.d.ts.map +1 -1
  35. package/dist/types/src/components/DebugStatus.d.ts +1 -2
  36. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  37. package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
  38. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts +1 -2
  39. package/dist/types/src/components/SpaceGenerator/SchemaTable.d.ts.map +1 -1
  40. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts +1 -2
  41. package/dist/types/src/components/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
  42. package/dist/types/src/components/SpaceGenerator/presets.d.ts +22 -0
  43. package/dist/types/src/components/SpaceGenerator/presets.d.ts.map +1 -0
  44. package/dist/types/src/components/Wireframe.d.ts +1 -2
  45. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  46. package/dist/types/src/components/index.d.ts +4 -4
  47. package/dist/types/src/components/index.d.ts.map +1 -1
  48. package/dist/types/src/meta.d.ts +1 -0
  49. package/dist/types/src/meta.d.ts.map +1 -1
  50. package/dist/types/src/translations.d.ts +28 -0
  51. package/dist/types/src/translations.d.ts.map +1 -1
  52. package/dist/types/src/types.d.ts +44 -1
  53. package/dist/types/src/types.d.ts.map +1 -1
  54. package/dist/types/tsconfig.tsbuildinfo +1 -1
  55. package/package.json +49 -46
  56. package/src/DebugPlugin.tsx +6 -3
  57. package/src/capabilities/app-graph-builder.ts +297 -89
  58. package/src/capabilities/react-context.tsx +3 -25
  59. package/src/capabilities/react-surface.tsx +202 -33
  60. package/src/capabilities/settings.ts +0 -1
  61. package/src/components/DebugSettings.tsx +7 -12
  62. package/src/components/DebugStatus.tsx +17 -21
  63. package/src/components/SpaceGenerator/ObjectGenerator.tsx +2 -83
  64. package/src/components/SpaceGenerator/SpaceGenerator.tsx +74 -7
  65. package/src/components/SpaceGenerator/presets.ts +563 -0
  66. package/src/meta.ts +3 -1
  67. package/src/translations.ts +28 -0
  68. package/src/types.ts +52 -1
  69. package/dist/lib/browser/SpaceGenerator-YNT3WDFI.mjs +0 -479
  70. package/dist/lib/browser/SpaceGenerator-YNT3WDFI.mjs.map +0 -7
  71. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs +0 -177
  72. package/dist/lib/browser/app-graph-builder-FXELWOFS.mjs.map +0 -7
  73. package/dist/lib/browser/chunk-I3ON45JK.mjs +0 -18
  74. package/dist/lib/browser/chunk-I3ON45JK.mjs.map +0 -7
  75. package/dist/lib/browser/chunk-P7GHHMDB.mjs +0 -21
  76. package/dist/lib/browser/chunk-P7GHHMDB.mjs.map +0 -7
  77. package/dist/lib/browser/react-context-OZU6J7G3.mjs +0 -37
  78. package/dist/lib/browser/react-context-OZU6J7G3.mjs.map +0 -7
  79. package/dist/lib/browser/react-surface-ACHNR2UU.mjs.map +0 -7
  80. /package/dist/lib/browser/{DebugSpace-4JHYA7FG.mjs.map → DebugSpace-BTMTVZ6C.mjs.map} +0 -0
package/src/meta.ts CHANGED
@@ -9,8 +9,10 @@ export const DEBUG_PLUGIN = 'dxos.org/plugin/debug';
9
9
  export const meta = {
10
10
  id: DEBUG_PLUGIN,
11
11
  name: 'Debug',
12
- description: 'DXOS debugging tools.',
12
+ description:
13
+ '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.',
13
14
  icon: 'ph--bug--regular',
14
15
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-debug',
15
16
  tags: ['experimental'],
17
+ screenshots: ['https://dxos.network/plugin-details-debug-dark.png'],
16
18
  } satisfies PluginMeta;
@@ -31,6 +31,34 @@ export default [
31
31
  'Warning: Swapping the storage adapter will make your data unavailable.',
32
32
  'settings space fragmentation': 'Enable AM space fragmentation',
33
33
  'open debug panel label': 'Show Debug',
34
+ 'client label': 'Client',
35
+ 'config label': 'Config',
36
+ 'storage label': 'Storage',
37
+ 'logs label': 'Logs',
38
+ 'diagnostics label': 'Diagnostics',
39
+ 'tracing label': 'Tracing',
40
+ 'halo label': 'HALO',
41
+ 'identity label': 'Identity',
42
+ 'devices label': 'Devices',
43
+ 'keyring label': 'Keyring',
44
+ 'credentials label': 'Credentials',
45
+ 'echo label': 'ECHO',
46
+ 'spaces label': 'Spaces',
47
+ 'space label': 'Space',
48
+ 'feeds label': 'Feeds',
49
+ 'objects label': 'Objects',
50
+ 'automerge label': 'Automerge',
51
+ 'members label': 'Members',
52
+ 'metadata label': 'Metadata',
53
+ 'mesh label': 'Mesh',
54
+ 'signal label': 'Signal',
55
+ 'swarm label': 'Swarm',
56
+ 'network label': 'Network',
57
+ 'agent label': 'Agent',
58
+ 'dashboard label': 'Dashboard',
59
+ 'search label': 'Search',
60
+ 'edge label': 'Edge',
61
+ 'workflows label': 'Workflows',
34
62
  },
35
63
  },
36
64
  },
package/src/types.ts CHANGED
@@ -21,10 +21,61 @@ export const DebugContext: Context<DebugContextType> = createContext<DebugContex
21
21
 
22
22
  export const DebugSettingsSchema = S.mutable(
23
23
  S.Struct({
24
- devtools: S.optional(S.Boolean),
25
24
  debug: S.optional(S.Boolean),
26
25
  wireframe: S.optional(S.Boolean),
27
26
  }),
28
27
  );
29
28
 
30
29
  export interface DebugSettingsProps extends S.Schema.Type<typeof DebugSettingsSchema> {}
30
+
31
+ export namespace Devtools {
32
+ // TODO(wittjosiah): Cannot use slashes in ids until we have a router which decouples ids from url paths.
33
+ export const id = 'dxos.org.plugin.debug.devtools';
34
+
35
+ export namespace Client {
36
+ export const id = `${Devtools.id}.client`;
37
+ export const Config = `${Devtools.Client.id}.config`;
38
+ export const Storage = `${Devtools.Client.id}.storage`;
39
+ export const Logs = `${Devtools.Client.id}.logs`;
40
+ export const Diagnostics = `${Devtools.Client.id}.diagnostics`;
41
+ export const Tracing = `${Devtools.Client.id}.tracing`;
42
+ }
43
+
44
+ export namespace Halo {
45
+ export const id = `${Devtools.id}.halo`;
46
+ export const Identity = `${Devtools.Halo.id}.identity`;
47
+ export const Devices = `${Devtools.Halo.id}.devices`;
48
+ export const Keyring = `${Devtools.Halo.id}.keyring`;
49
+ export const Credentials = `${Devtools.Halo.id}.credentials`;
50
+ }
51
+
52
+ export namespace Echo {
53
+ export const id = `${Devtools.id}.echo`;
54
+ export const Spaces = `${Devtools.Echo.id}.spaces`;
55
+ export const Space = `${Devtools.Echo.id}.space`;
56
+ export const Feeds = `${Devtools.Echo.id}.feeds`;
57
+ export const Objects = `${Devtools.Echo.id}.objects`;
58
+ export const Automerge = `${Devtools.Echo.id}.automerge`;
59
+ export const Members = `${Devtools.Echo.id}.members`;
60
+ export const Metadata = `${Devtools.Echo.id}.metadata`;
61
+ }
62
+
63
+ export namespace Mesh {
64
+ export const id = `${Devtools.id}.mesh`;
65
+ export const Signal = `${Devtools.Mesh.id}.signal`;
66
+ export const Swarm = `${Devtools.Mesh.id}.swarm`;
67
+ export const Network = `${Devtools.Mesh.id}.network`;
68
+ }
69
+
70
+ export namespace Agent {
71
+ export const id = `${Devtools.id}.agent`;
72
+ export const Dashboard = `${Devtools.Agent.id}.dashboard`;
73
+ export const Search = `${Devtools.Agent.id}.search`;
74
+ }
75
+
76
+ export namespace Edge {
77
+ export const id = `${Devtools.id}.edge`;
78
+ export const Dashboard = `${Devtools.Edge.id}.dashboard`;
79
+ export const Workflows = `${Devtools.Edge.id}.workflows`;
80
+ }
81
+ }
@@ -1,479 +0,0 @@
1
- // packages/plugins/plugin-debug/src/components/SpaceGenerator/SpaceGenerator.tsx
2
- import React2, { useCallback, useMemo, useState } from "react";
3
- import { ComputeGraph as ComputeGraph2 } from "@dxos/conductor";
4
- import { DocumentType as DocumentType2 } from "@dxos/plugin-markdown/types";
5
- import { SheetType as SheetType2 } from "@dxos/plugin-sheet/types";
6
- import { DiagramType as DiagramType2 } from "@dxos/plugin-sketch/types";
7
- import { useClient } from "@dxos/react-client";
8
- import { getTypename } from "@dxos/react-client/echo";
9
- import { IconButton as IconButton2, Input, Toolbar, useAsyncEffect } from "@dxos/react-ui";
10
- import { CanvasBoardType as CanvasBoardType2 } from "@dxos/react-ui-canvas-editor";
11
- import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
12
- import { Testing } from "@dxos/schema/testing";
13
- import { jsonKeyReplacer, sortKeys } from "@dxos/util";
14
-
15
- // packages/plugins/plugin-debug/src/components/SpaceGenerator/ObjectGenerator.tsx
16
- import { addressToA1Notation } from "@dxos/compute";
17
- import { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from "@dxos/conductor";
18
- import { ObjectId } from "@dxos/echo-schema";
19
- import { TriggerKind } from "@dxos/functions/types";
20
- import { invariant } from "@dxos/invariant";
21
- import { DXN, SpaceId } from "@dxos/keys";
22
- import { create, makeRef } from "@dxos/live-object";
23
- import { DocumentType } from "@dxos/plugin-markdown/types";
24
- import { createSheet } from "@dxos/plugin-sheet/types";
25
- import { SheetType } from "@dxos/plugin-sheet/types";
26
- import { CanvasType, DiagramType } from "@dxos/plugin-sketch/types";
27
- import { faker } from "@dxos/random";
28
- import { Filter } from "@dxos/react-client/echo";
29
- import { createAppend, createComputeGraph, createConstant, createGpt, createQueue, createText, createTrigger } from "@dxos/react-ui-canvas-compute";
30
- import { pointMultiply, pointsToRect, rectToPoints, CanvasBoardType, CanvasGraphModel } from "@dxos/react-ui-canvas-editor";
31
- import { TableType } from "@dxos/react-ui-table";
32
- import { createView, TextType } from "@dxos/schema";
33
- import { createAsyncGenerator } from "@dxos/schema/testing";
34
- import { range } from "@dxos/util";
35
- var __dxlog_file = "/home/runner/work/dxos/dxos/packages/plugins/plugin-debug/src/components/SpaceGenerator/ObjectGenerator.tsx";
36
- var generator = faker;
37
- var staticGenerators = /* @__PURE__ */ new Map([
38
- [
39
- DocumentType.typename,
40
- async (space, n, cb) => {
41
- const objects = range(n).map(() => {
42
- return space.db.add(create(DocumentType, {
43
- name: faker.commerce.productName(),
44
- content: makeRef(create(TextType, {
45
- content: faker.lorem.sentences(5)
46
- })),
47
- threads: []
48
- }));
49
- });
50
- cb?.(objects);
51
- return objects;
52
- }
53
- ],
54
- [
55
- DiagramType.typename,
56
- async (space, n, cb) => {
57
- const objects = range(n).map(() => {
58
- const obj = space.db.add(create(DiagramType, {
59
- name: faker.commerce.productName(),
60
- canvas: makeRef(create(CanvasType, {
61
- content: {}
62
- }))
63
- }));
64
- return obj;
65
- });
66
- cb?.(objects);
67
- return objects;
68
- }
69
- ],
70
- // TODO(burdon): Create unit tests.
71
- [
72
- SheetType.typename,
73
- async (space, n, cb) => {
74
- const objects = range(n).map(() => {
75
- const cells = {};
76
- const year = (/* @__PURE__ */ new Date()).getFullYear();
77
- const cols = 4;
78
- const rows = 16;
79
- for (let col = 1; col <= cols; col++) {
80
- for (let row = 1; row <= rows; row++) {
81
- const cell = addressToA1Notation({
82
- col,
83
- row
84
- });
85
- if (row === 1) {
86
- cells[cell] = {
87
- value: `${year} Q${col}`
88
- };
89
- } else if (row === rows) {
90
- const from = addressToA1Notation({
91
- col,
92
- row: 2
93
- });
94
- const to = addressToA1Notation({
95
- col,
96
- row: rows - 1
97
- });
98
- cells[cell] = {
99
- value: `=SUM(${from}:${to})`
100
- };
101
- } else if (row > 2 && row < rows - 1) {
102
- cells[cell] = {
103
- value: Math.floor(Math.random() * 1e4)
104
- };
105
- }
106
- }
107
- }
108
- return space.db.add(createSheet({
109
- name: faker.commerce.productName(),
110
- cells
111
- }));
112
- });
113
- cb?.(objects);
114
- return objects;
115
- }
116
- ],
117
- [
118
- ComputeGraph.typename,
119
- async (space, n, cb) => {
120
- const objects = range(n, () => {
121
- const model = ComputeGraphModel.create();
122
- model.builder.createNode({
123
- id: "gpt-INPUT",
124
- type: NODE_INPUT
125
- }).createNode({
126
- id: "gpt-GPT",
127
- type: "gpt"
128
- }).createNode({
129
- id: "gpt-QUEUE_ID",
130
- type: "constant",
131
- value: new DXN(DXN.kind.QUEUE, [
132
- "data",
133
- SpaceId.random(),
134
- ObjectId.random()
135
- ]).toString()
136
- }).createNode({
137
- id: "gpt-APPEND",
138
- type: "append"
139
- }).createNode({
140
- id: "gpt-OUTPUT",
141
- type: NODE_OUTPUT
142
- }).createEdge({
143
- node: "gpt-INPUT",
144
- property: "prompt"
145
- }, {
146
- node: "gpt-GPT",
147
- property: "prompt"
148
- }).createEdge({
149
- node: "gpt-GPT",
150
- property: "text"
151
- }, {
152
- node: "gpt-OUTPUT",
153
- property: "text"
154
- }).createEdge({
155
- node: "gpt-QUEUE_ID",
156
- property: DEFAULT_OUTPUT
157
- }, {
158
- node: "gpt-APPEND",
159
- property: "id"
160
- }).createEdge({
161
- node: "gpt-GPT",
162
- property: "messages"
163
- }, {
164
- node: "gpt-APPEND",
165
- property: "items"
166
- }).createEdge({
167
- node: "gpt-QUEUE_ID",
168
- property: DEFAULT_OUTPUT
169
- }, {
170
- node: "gpt-OUTPUT",
171
- property: "queue"
172
- });
173
- return space.db.add(model.root);
174
- });
175
- cb?.(objects);
176
- return objects;
177
- }
178
- ],
179
- [
180
- CanvasBoardType.typename,
181
- async (space, n, cb) => {
182
- const objects = range(n, () => {
183
- const canvasModel = CanvasGraphModel.create();
184
- let functionTrigger;
185
- canvasModel.builder.call((builder) => {
186
- const gpt = canvasModel.createNode(createGpt(position({
187
- x: 0,
188
- y: -14
189
- })));
190
- const triggerShape = createTrigger({
191
- triggerKind: TriggerKind.Webhook,
192
- ...position({
193
- x: -18,
194
- y: -2
195
- })
196
- });
197
- const trigger = canvasModel.createNode(triggerShape);
198
- const text = canvasModel.createNode(createText(position({
199
- x: 19,
200
- y: 3,
201
- width: 10,
202
- height: 10
203
- })));
204
- const queueId = canvasModel.createNode(createConstant({
205
- value: new DXN(DXN.kind.QUEUE, [
206
- "data",
207
- SpaceId.random(),
208
- ObjectId.random()
209
- ]).toString(),
210
- ...position({
211
- x: -18,
212
- y: 5,
213
- width: 8,
214
- height: 6
215
- })
216
- }));
217
- const queue = canvasModel.createNode(createQueue(position({
218
- x: -3,
219
- y: 3,
220
- width: 14,
221
- height: 10
222
- })));
223
- const append = canvasModel.createNode(createAppend(position({
224
- x: 10,
225
- y: 6
226
- })));
227
- builder.createEdge({
228
- source: trigger.id,
229
- target: gpt.id,
230
- input: "prompt",
231
- output: "bodyText"
232
- }).createEdge({
233
- source: gpt.id,
234
- target: text.id,
235
- output: "text"
236
- }).createEdge({
237
- source: queueId.id,
238
- target: queue.id
239
- }).createEdge({
240
- source: queueId.id,
241
- target: append.id,
242
- input: "id"
243
- }).createEdge({
244
- source: gpt.id,
245
- target: append.id,
246
- output: "messages",
247
- input: "items"
248
- });
249
- functionTrigger = triggerShape.functionTrigger.target;
250
- });
251
- const computeModel = createComputeGraph(canvasModel);
252
- const computeGraph = computeModel.root;
253
- invariant(functionTrigger, void 0, {
254
- F: __dxlog_file,
255
- L: 192,
256
- S: void 0,
257
- A: [
258
- "functionTrigger",
259
- ""
260
- ]
261
- });
262
- functionTrigger.function = DXN.fromLocalObjectId(computeGraph.id).toString();
263
- functionTrigger.meta ??= {};
264
- const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT);
265
- functionTrigger.meta.computeNodeId = inputNode.id;
266
- return space.db.add(create(CanvasBoardType, {
267
- computeGraph: makeRef(computeGraph),
268
- layout: canvasModel.graph
269
- }));
270
- });
271
- cb?.(objects);
272
- return objects;
273
- }
274
- ]
275
- ]);
276
- var position = (rect) => {
277
- const snap = 32;
278
- const [center, size] = rectToPoints({
279
- width: 0,
280
- height: 0,
281
- ...rect
282
- });
283
- const { x, y, width, height } = pointsToRect([
284
- pointMultiply(center, snap),
285
- pointMultiply(size, snap)
286
- ]);
287
- if (width && height) {
288
- return {
289
- center: {
290
- x,
291
- y
292
- },
293
- size: width && height ? {
294
- width,
295
- height
296
- } : void 0
297
- };
298
- } else {
299
- return {
300
- center: {
301
- x,
302
- y
303
- }
304
- };
305
- }
306
- };
307
- var createGenerator = (type) => {
308
- return async (space, n, cb) => {
309
- const schema = await space.db.schemaRegistry.query({
310
- typename: type.typename
311
- }).firstOrUndefined() ?? (await space.db.schemaRegistry.register([
312
- type
313
- ]))[0];
314
- const generate = createAsyncGenerator(generator, schema.getSchemaSnapshot(), {
315
- db: space.db
316
- });
317
- const objects = await generate.createObjects(n);
318
- const { objects: tables } = await space.db.query(Filter.schema(TableType)).run();
319
- const table = tables.find((table2) => table2.view?.target?.query?.type === type.typename);
320
- if (!table) {
321
- const name = type.typename.split("/").pop() ?? type.typename;
322
- const view = createView({
323
- name,
324
- typename: type.typename,
325
- jsonSchema: schema.jsonSchema
326
- });
327
- const table2 = space.db.add(create(TableType, {
328
- name,
329
- view: makeRef(view)
330
- }));
331
- cb?.([
332
- table2
333
- ]);
334
- }
335
- return objects;
336
- };
337
- };
338
-
339
- // packages/plugins/plugin-debug/src/components/SpaceGenerator/SchemaTable.tsx
340
- import React from "react";
341
- import { IconButton } from "@dxos/react-ui";
342
- var SchemaTable = ({ types, objects = {}, label, onClick }) => {
343
- return /* @__PURE__ */ React.createElement("div", {
344
- className: "grid grid-cols-[1fr_80px_40px] gap-1 overflow-hidden"
345
- }, /* @__PURE__ */ React.createElement("div", {
346
- className: "grid grid-cols-subgrid col-span-3"
347
- }, /* @__PURE__ */ React.createElement("div", {
348
- className: "px-2 text-sm text-primary-500"
349
- }, label), /* @__PURE__ */ React.createElement("div", {
350
- className: "px-2 text-xs text-subdued text-right"
351
- }, "count")), types.map((type) => /* @__PURE__ */ React.createElement("div", {
352
- key: type.typename,
353
- className: "grid grid-cols-subgrid col-span-3 items-center"
354
- }, /* @__PURE__ */ React.createElement("div", {
355
- className: "px-2 text-sm font-mono text-green-500"
356
- }, type.typename), /* @__PURE__ */ React.createElement("div", {
357
- className: "px-2 text-right font-mono"
358
- }, objects[type.typename] ?? 0), /* @__PURE__ */ React.createElement(IconButton, {
359
- variant: "ghost",
360
- icon: "ph--plus--regular",
361
- iconOnly: true,
362
- label: "Create data",
363
- onClick: () => onClick(type.typename)
364
- }))));
365
- };
366
-
367
- // packages/plugins/plugin-debug/src/components/SpaceGenerator/SpaceGenerator.tsx
368
- var SpaceGenerator = ({ space, onCreateObjects }) => {
369
- const client = useClient();
370
- const staticTypes = [
371
- DocumentType2,
372
- DiagramType2,
373
- SheetType2,
374
- ComputeGraph2,
375
- CanvasBoardType2
376
- ];
377
- const mutableTypes = [
378
- Testing.OrgType,
379
- Testing.ProjectType,
380
- Testing.ContactType
381
- ];
382
- const [count, setCount] = useState(1);
383
- const [info, setInfo] = useState({});
384
- const typeMap = useMemo(() => {
385
- client.addTypes(staticTypes);
386
- const mutableGenerators = new Map(mutableTypes.map((type) => [
387
- type.typename,
388
- createGenerator(type)
389
- ]));
390
- return new Map([
391
- ...staticGenerators,
392
- ...mutableGenerators
393
- ]);
394
- }, [
395
- client,
396
- mutableTypes
397
- ]);
398
- const updateInfo = async () => {
399
- const echoSchema = await space.db.schemaRegistry.query().run();
400
- const staticSchema = space.db.graph.schemaRegistry.schemas;
401
- const { objects } = await space.db.query().run();
402
- const objectMap = sortKeys(objects.reduce((map, obj) => {
403
- const type = getTypename(obj);
404
- if (type) {
405
- const count2 = map[type] ?? 0;
406
- map[type] = count2 + 1;
407
- }
408
- return map;
409
- }, {}));
410
- setInfo({
411
- schema: {
412
- static: staticSchema.length,
413
- mutable: echoSchema.length
414
- },
415
- objects: objectMap
416
- });
417
- };
418
- useAsyncEffect(updateInfo, [
419
- space
420
- ]);
421
- const handleCreateData = useCallback(async (typename) => {
422
- const constructor = typeMap.get(typename);
423
- if (constructor) {
424
- await constructor(space, count, onCreateObjects);
425
- await updateInfo();
426
- }
427
- }, [
428
- typeMap,
429
- count
430
- ]);
431
- return /* @__PURE__ */ React2.createElement("div", {
432
- role: "none",
433
- className: "flex flex-col divide-y divide-separator"
434
- }, /* @__PURE__ */ React2.createElement(Toolbar.Root, {
435
- classNames: "p-1"
436
- }, /* @__PURE__ */ React2.createElement(IconButton2, {
437
- icon: "ph--arrow-clockwise--regular",
438
- iconOnly: true,
439
- label: "Refresh",
440
- onClick: updateInfo
441
- }), /* @__PURE__ */ React2.createElement(Toolbar.Separator, {
442
- variant: "gap"
443
- }), /* @__PURE__ */ React2.createElement("div", {
444
- className: "flex"
445
- }, /* @__PURE__ */ React2.createElement(Input.Root, null, /* @__PURE__ */ React2.createElement(Input.TextInput, {
446
- type: "number",
447
- min: 1,
448
- max: 100,
449
- placeholder: "Count",
450
- classNames: "w-[80px]",
451
- value: count,
452
- onChange: (ev) => setCount(parseInt(ev.target.value))
453
- })))), /* @__PURE__ */ React2.createElement(SchemaTable, {
454
- types: staticTypes,
455
- objects: info.objects,
456
- label: "Static Types",
457
- onClick: handleCreateData
458
- }), /* @__PURE__ */ React2.createElement(SchemaTable, {
459
- types: mutableTypes,
460
- objects: info.objects,
461
- label: "Mutable Types",
462
- onClick: handleCreateData
463
- }), /* @__PURE__ */ React2.createElement(SyntaxHighlighter, {
464
- classNames: "flex text-xs",
465
- language: "json"
466
- }, JSON.stringify({
467
- space,
468
- ...info
469
- }, jsonKeyReplacer({
470
- truncate: true
471
- }), 2)));
472
- };
473
-
474
- // packages/plugins/plugin-debug/src/components/SpaceGenerator/index.ts
475
- var SpaceGenerator_default = SpaceGenerator;
476
- export {
477
- SpaceGenerator_default as default
478
- };
479
- //# sourceMappingURL=SpaceGenerator-YNT3WDFI.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/SpaceGenerator/SpaceGenerator.tsx", "../../../src/components/SpaceGenerator/ObjectGenerator.tsx", "../../../src/components/SpaceGenerator/SchemaTable.tsx", "../../../src/components/SpaceGenerator/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { type ReactiveObject } from '@dxos/live-object';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { SheetType } from '@dxos/plugin-sheet/types';\nimport { DiagramType } from '@dxos/plugin-sketch/types';\nimport { useClient } from '@dxos/react-client';\nimport { getTypename, type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, Toolbar, useAsyncEffect } from '@dxos/react-ui';\nimport { CanvasBoardType } from '@dxos/react-ui-canvas-editor';\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { Testing } from '@dxos/schema/testing';\nimport { jsonKeyReplacer, sortKeys } from '@dxos/util';\n\nimport { type ObjectGenerator, createGenerator, staticGenerators } from './ObjectGenerator';\nimport { SchemaTable } from './SchemaTable';\n\nexport type SpaceGeneratorProps = {\n space: Space;\n onCreateObjects?: (objects: ReactiveObject<any>[]) => void;\n};\n\nexport const SpaceGenerator = ({ space, onCreateObjects }: SpaceGeneratorProps) => {\n const client = useClient();\n const staticTypes = [DocumentType, DiagramType, SheetType, ComputeGraph, CanvasBoardType]; // TODO(burdon): Make extensible.\n const mutableTypes = [Testing.OrgType, Testing.ProjectType, Testing.ContactType];\n const [count, setCount] = useState(1);\n const [info, setInfo] = useState<any>({});\n\n // Create type generators.\n const typeMap = useMemo(() => {\n client.addTypes(staticTypes);\n const mutableGenerators = new Map<string, ObjectGenerator<any>>(\n mutableTypes.map((type) => [type.typename, createGenerator(type)]),\n );\n\n return new Map([...staticGenerators, ...mutableGenerators]);\n }, [client, mutableTypes]);\n\n // Query space to get info.\n const updateInfo = async () => {\n // Create schema map.\n const echoSchema = await space.db.schemaRegistry.query().run();\n const staticSchema = space.db.graph.schemaRegistry.schemas;\n\n // Create object map.\n const { objects } = await space.db.query().run();\n const objectMap = sortKeys(\n objects.reduce<Record<string, number>>((map, obj) => {\n const type = getTypename(obj);\n if (type) {\n const count = map[type] ?? 0;\n map[type] = count + 1;\n }\n return map;\n }, {}),\n );\n\n setInfo({\n schema: {\n static: staticSchema.length,\n mutable: echoSchema.length,\n },\n objects: objectMap,\n });\n };\n\n useAsyncEffect(updateInfo, [space]);\n\n const handleCreateData = useCallback(\n async (typename: string) => {\n const constructor = typeMap.get(typename);\n if (constructor) {\n // TODO(burdon): Input to specify number of objects.\n await constructor(space, count, onCreateObjects);\n await updateInfo();\n }\n },\n [typeMap, count],\n );\n\n return (\n <div role='none' className='flex flex-col divide-y divide-separator'>\n <Toolbar.Root classNames='p-1'>\n <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />\n <Toolbar.Separator variant='gap' />\n <div className='flex'>\n <Input.Root>\n <Input.TextInput\n type='number'\n min={1}\n max={100}\n placeholder={'Count'}\n classNames='w-[80px]'\n value={count}\n onChange={(ev) => setCount(parseInt(ev.target.value))}\n />\n </Input.Root>\n </div>\n </Toolbar.Root>\n\n <SchemaTable types={staticTypes} objects={info.objects} label='Static Types' onClick={handleCreateData} />\n <SchemaTable types={mutableTypes} objects={info.objects} label='Mutable Types' onClick={handleCreateData} />\n\n <SyntaxHighlighter classNames='flex text-xs' language='json'>\n {JSON.stringify({ space, ...info }, jsonKeyReplacer({ truncate: true }), 2)}\n </SyntaxHighlighter>\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { addressToA1Notation } from '@dxos/compute';\nimport { ComputeGraph, ComputeGraphModel, DEFAULT_OUTPUT, NODE_INPUT, NODE_OUTPUT } from '@dxos/conductor';\nimport { ObjectId, type BaseObject, type TypedObject } from '@dxos/echo-schema';\nimport { type FunctionTrigger, TriggerKind } from '@dxos/functions/types';\nimport { invariant } from '@dxos/invariant';\nimport { DXN, SpaceId } from '@dxos/keys';\nimport { create, makeRef, type ReactiveObject } from '@dxos/live-object';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { createSheet } from '@dxos/plugin-sheet/types';\nimport { SheetType, type CellValue } from '@dxos/plugin-sheet/types';\nimport { CanvasType, DiagramType } from '@dxos/plugin-sketch/types';\nimport { faker } from '@dxos/random';\nimport { Filter, type Space } from '@dxos/react-client/echo';\nimport {\n type ComputeShape,\n createAppend,\n createComputeGraph,\n createConstant,\n createGpt,\n createQueue,\n createText,\n createTrigger,\n} from '@dxos/react-ui-canvas-compute';\nimport {\n pointMultiply,\n pointsToRect,\n rectToPoints,\n CanvasBoardType,\n CanvasGraphModel,\n} from '@dxos/react-ui-canvas-editor';\nimport { TableType } from '@dxos/react-ui-table';\nimport { createView, TextType } from '@dxos/schema';\nimport { createAsyncGenerator, type ValueGenerator } from '@dxos/schema/testing';\nimport { range } from '@dxos/util';\n\nconst generator: ValueGenerator = faker as any;\n\n// TODO(burdon): Add objects to collections.\n// TODO(burdon): Create docs.\n// TODO(burdon): Create sketches.\n// TODO(burdon): Create sheets.\n// TODO(burdon): Create comments.\n// TODO(burdon): Reuse in testbench-app.\n// TODO(burdon): Mutator running in background (factor out): from echo-generator.\n\nexport type ObjectGenerator<T extends BaseObject> = (\n space: Space,\n n: number,\n cb?: (objects: ReactiveObject<any>[]) => void,\n) => Promise<ReactiveObject<T>[]>;\n\nexport const staticGenerators = new Map<string, ObjectGenerator<any>>([\n [\n DocumentType.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n return space.db.add(\n create(DocumentType, {\n name: faker.commerce.productName(),\n content: makeRef(create(TextType, { content: faker.lorem.sentences(5) })),\n threads: [],\n }),\n );\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n [\n DiagramType.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n // TODO(burdon): Generate diagram.\n const obj = space.db.add(\n create(DiagramType, {\n name: faker.commerce.productName(),\n canvas: makeRef(create(CanvasType, { content: {} })),\n }),\n );\n\n return obj;\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n // TODO(burdon): Create unit tests.\n [\n SheetType.typename,\n async (space, n, cb) => {\n const objects = range(n).map(() => {\n const cells: Record<string, CellValue> = {};\n const year = new Date().getFullYear();\n const cols = 4;\n const rows = 16;\n for (let col = 1; col <= cols; col++) {\n for (let row = 1; row <= rows; row++) {\n const cell = addressToA1Notation({ col, row });\n if (row === 1) {\n cells[cell] = { value: `${year} Q${col}` };\n } else if (row === rows) {\n const from = addressToA1Notation({ col, row: 2 });\n const to = addressToA1Notation({ col, row: rows - 1 });\n cells[cell] = { value: `=SUM(${from}:${to})` };\n } else if (row > 2 && row < rows - 1) {\n cells[cell] = { value: Math.floor(Math.random() * 10_000) };\n }\n }\n }\n\n // TODO(burdon): Set width.\n // TODO(burdon): Set formatting for columns.\n return space.db.add(\n createSheet({\n name: faker.commerce.productName(),\n cells,\n }),\n );\n });\n\n cb?.(objects);\n return objects;\n },\n ],\n [\n ComputeGraph.typename,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const model = ComputeGraphModel.create();\n model.builder\n .createNode({ id: 'gpt-INPUT', type: NODE_INPUT })\n .createNode({ id: 'gpt-GPT', type: 'gpt' })\n .createNode({\n id: 'gpt-QUEUE_ID',\n type: 'constant',\n value: new DXN(DXN.kind.QUEUE, ['data', SpaceId.random(), ObjectId.random()]).toString(),\n })\n .createNode({ id: 'gpt-APPEND', type: 'append' })\n .createNode({ id: 'gpt-OUTPUT', type: NODE_OUTPUT })\n .createEdge({ node: 'gpt-INPUT', property: 'prompt' }, { node: 'gpt-GPT', property: 'prompt' })\n .createEdge({ node: 'gpt-GPT', property: 'text' }, { node: 'gpt-OUTPUT', property: 'text' })\n .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-APPEND', property: 'id' })\n .createEdge({ node: 'gpt-GPT', property: 'messages' }, { node: 'gpt-APPEND', property: 'items' })\n .createEdge({ node: 'gpt-QUEUE_ID', property: DEFAULT_OUTPUT }, { node: 'gpt-OUTPUT', property: 'queue' });\n\n return space.db.add(model.root);\n });\n cb?.(objects);\n return objects;\n },\n ],\n [\n CanvasBoardType.typename,\n async (space, n, cb) => {\n const objects = range(n, () => {\n const canvasModel = CanvasGraphModel.create<ComputeShape>();\n\n let functionTrigger: FunctionTrigger | undefined;\n canvasModel.builder.call((builder) => {\n const gpt = canvasModel.createNode(createGpt(position({ x: 0, y: -14 })));\n const triggerShape = createTrigger({ triggerKind: TriggerKind.Webhook, ...position({ x: -18, y: -2 }) });\n const trigger = canvasModel.createNode(triggerShape);\n const text = canvasModel.createNode(createText(position({ x: 19, y: 3, width: 10, height: 10 })));\n const queueId = canvasModel.createNode(\n createConstant({\n value: new DXN(DXN.kind.QUEUE, ['data', SpaceId.random(), ObjectId.random()]).toString(),\n ...position({ x: -18, y: 5, width: 8, height: 6 }),\n }),\n );\n const queue = canvasModel.createNode(createQueue(position({ x: -3, y: 3, width: 14, height: 10 })));\n const append = canvasModel.createNode(createAppend(position({ x: 10, y: 6 })));\n\n builder\n .createEdge({ source: trigger.id, target: gpt.id, input: 'prompt', output: 'bodyText' })\n .createEdge({ source: gpt.id, target: text.id, output: 'text' })\n .createEdge({ source: queueId.id, target: queue.id })\n .createEdge({ source: queueId.id, target: append.id, input: 'id' })\n .createEdge({ source: gpt.id, target: append.id, output: 'messages', input: 'items' });\n\n functionTrigger = triggerShape.functionTrigger!.target!;\n });\n\n const computeModel = createComputeGraph(canvasModel);\n const computeGraph = computeModel.root;\n\n invariant(functionTrigger);\n functionTrigger.function = DXN.fromLocalObjectId(computeGraph.id).toString();\n functionTrigger.meta ??= {};\n const inputNode = computeModel.nodes.find((node) => node.type === NODE_INPUT)!;\n functionTrigger.meta.computeNodeId = inputNode.id;\n\n return space.db.add(\n create(CanvasBoardType, {\n computeGraph: makeRef(computeGraph),\n layout: canvasModel.graph,\n }),\n );\n });\n cb?.(objects);\n return objects;\n },\n ],\n]);\n\nconst position = (rect: { x: number; y: number; width?: number; height?: number }) => {\n const snap = 32;\n const [center, size] = rectToPoints({ width: 0, height: 0, ...rect });\n const { x, y, width, height } = pointsToRect([pointMultiply(center, snap), pointMultiply(size, snap)]);\n if (width && height) {\n return { center: { x, y }, size: width && height ? { width, height } : undefined };\n } else {\n return { center: { x, y } };\n }\n};\n\nexport const createGenerator = <T extends BaseObject>(type: TypedObject<T>): ObjectGenerator<T> => {\n return async (\n space: Space,\n n: number,\n cb?: (objects: ReactiveObject<any>[]) => void,\n ): Promise<ReactiveObject<T>[]> => {\n // Find or create mutable schema.\n const schema =\n (await space.db.schemaRegistry.query({ typename: type.typename }).firstOrUndefined()) ??\n (await space.db.schemaRegistry.register([type]))[0];\n\n // Create objects.\n const generate = createAsyncGenerator(generator, schema.getSchemaSnapshot(), { db: space.db });\n const objects = await generate.createObjects(n);\n\n // Find or create table and view.\n const { objects: tables } = await space.db.query(Filter.schema(TableType)).run();\n const table = tables.find((table) => table.view?.target?.query?.type === type.typename);\n if (!table) {\n const name = type.typename.split('/').pop() ?? type.typename;\n const view = createView({ name, typename: type.typename, jsonSchema: schema.jsonSchema });\n const table = space.db.add(create(TableType, { name, view: makeRef(view) }));\n cb?.([table]);\n }\n\n return objects;\n };\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { IconButton } from '@dxos/react-ui';\n\nexport type SchemaTableProps = {\n types: any[];\n objects?: Record<string, number | undefined>;\n label: string;\n onClick: (typename: string) => void;\n};\n\nexport const SchemaTable = ({ types, objects = {}, label, onClick }: SchemaTableProps) => {\n return (\n <div className='grid grid-cols-[1fr_80px_40px] gap-1 overflow-hidden'>\n <div className='grid grid-cols-subgrid col-span-3'>\n <div className='px-2 text-sm text-primary-500'>{label}</div>\n <div className='px-2 text-xs text-subdued text-right'>count</div>\n </div>\n {types.map((type) => (\n <div key={type.typename} className='grid grid-cols-subgrid col-span-3 items-center'>\n <div className='px-2 text-sm font-mono text-green-500'>{type.typename}</div>\n <div className='px-2 text-right font-mono'>{objects[type.typename] ?? 0}</div>\n <IconButton\n variant='ghost'\n icon='ph--plus--regular'\n iconOnly\n label='Create data'\n onClick={() => onClick(type.typename)}\n />\n </div>\n ))}\n </div>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { SpaceGenerator } from './SpaceGenerator';\n\nexport default SpaceGenerator;\n"],
5
- "mappings": ";AAIA,OAAOA,UAASC,aAAaC,SAASC,gBAAgB;AAEtD,SAASC,gBAAAA,qBAAoB;AAE7B,SAASC,gBAAAA,qBAAoB;AAC7B,SAASC,aAAAA,kBAAiB;AAC1B,SAASC,eAAAA,oBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,mBAA+B;AACxC,SAASC,cAAAA,aAAYC,OAAOC,SAASC,sBAAsB;AAC3D,SAASC,mBAAAA,wBAAuB;AAChC,SAASC,yBAAyB;AAClC,SAASC,eAAe;AACxB,SAASC,iBAAiBC,gBAAgB;;;ACb1C,SAASC,2BAA2B;AACpC,SAASC,cAAcC,mBAAmBC,gBAAgBC,YAAYC,mBAAmB;AACzF,SAASC,gBAAmD;AAC5D,SAA+BC,mBAAmB;AAClD,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,eAAe;AAC7B,SAASC,QAAQC,eAAoC;AACrD,SAASC,oBAAoB;AAC7B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiC;AAC1C,SAASC,YAAYC,mBAAmB;AACxC,SAASC,aAAa;AACtB,SAASC,cAA0B;AACnC,SAEEC,cACAC,oBACAC,gBACAC,WACAC,aACAC,YACAC,qBACK;AACP,SACEC,eACAC,cACAC,cACAC,iBACAC,wBACK;AACP,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,gBAAgB;AACrC,SAASC,4BAAiD;AAC1D,SAASC,aAAa;;AAEtB,IAAMC,YAA4BnB;AAgB3B,IAAMoB,mBAAmB,oBAAIC,IAAkC;EACpE;IACE1B,aAAa2B;IACb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cAACC,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACzB,gBAAAH,OAAA,cAACI,QAAQC,MAAI;IAACC,YAAW;KACvB,gBAAAN,OAAA,cAACO,aAAAA;IAAWC,MAAK;IAA+BC,UAAAA;IAASC,OAAM;IAAUC,SAASnC;MAClF,gBAAAwB,OAAA,cAACI,QAAQQ,WAAS;IAACC,SAAQ;MAC3B,gBAAAb,OAAA,cAACC,OAAAA;IAAIE,WAAU;KACb,gBAAAH,OAAA,cAACc,MAAMT,MAAI,MACT,gBAAAL,OAAA,cAACc,MAAMC,WAAS;IACd3C,MAAK;IACL4C,KAAK;IACLC,KAAK;IACLC,aAAa;IACbZ,YAAW;IACXa,OAAO1D;IACP2D,UAAU,CAACC,OAAO3D,SAAS4D,SAASD,GAAGE,OAAOJ,KAAK,CAAA;SAM3D,gBAAAnB,OAAA,cAACwB,aAAAA;IAAYC,OAAO3E;IAAamC,SAASrB,KAAKqB;IAASyB,OAAM;IAAeC,SAASf;MACtF,gBAAAI,OAAA,cAACwB,aAAAA;IAAYC,OAAOrE;IAAc6B,SAASrB,KAAKqB;IAASyB,OAAM;IAAgBC,SAASf;MAExF,gBAAAI,OAAA,cAAC0B,mBAAAA;IAAkBpB,YAAW;IAAeqB,UAAS;KACnDC,KAAKC,UAAU;IAAEnF;IAAO,GAAGkB;EAAK,GAAGkE,gBAAgB;IAAEC,UAAU;EAAK,CAAA,GAAI,CAAA,CAAA,CAAA;AAIjF;;;AG5GA,IAAA,yBAAeC;",
6
- "names": ["React", "useCallback", "useMemo", "useState", "ComputeGraph", "DocumentType", "SheetType", "DiagramType", "useClient", "getTypename", "IconButton", "Input", "Toolbar", "useAsyncEffect", "CanvasBoardType", "SyntaxHighlighter", "Testing", "jsonKeyReplacer", "sortKeys", "addressToA1Notation", "ComputeGraph", "ComputeGraphModel", "DEFAULT_OUTPUT", "NODE_INPUT", "NODE_OUTPUT", "ObjectId", "TriggerKind", "invariant", "DXN", "SpaceId", "create", "makeRef", "DocumentType", "createSheet", "SheetType", "CanvasType", "DiagramType", "faker", "Filter", "createAppend", "createComputeGraph", "createConstant", "createGpt", "createQueue", "createText", "createTrigger", "pointMultiply", "pointsToRect", "rectToPoints", "CanvasBoardType", "CanvasGraphModel", "TableType", "createView", "TextType", "createAsyncGenerator", "range", "generator", "staticGenerators", "Map", "typename", "space", "n", "cb", "objects", "map", "db", "add", "name", "commerce", "productName", "content", "lorem", "sentences", "threads", "obj", "canvas", "cells", "year", "Date", "getFullYear", "cols", "rows", "col", "row", "cell", "value", "from", "to", "Math", "floor", "random", "model", "builder", "createNode", "id", "type", "kind", "QUEUE", "toString", "createEdge", "node", "property", "root", "canvasModel", "functionTrigger", "call", "gpt", "position", "x", "y", "triggerShape", "triggerKind", "Webhook", "trigger", "text", "width", "height", "queueId", "queue", "append", "source", "target", "input", "output", "computeModel", "computeGraph", "function", "fromLocalObjectId", "meta", "inputNode", "nodes", "find", "computeNodeId", "layout", "graph", "rect", "snap", "center", "size", "undefined", "createGenerator", "schema", "schemaRegistry", "query", "firstOrUndefined", "register", "generate", "getSchemaSnapshot", "createObjects", "tables", "run", "table", "view", "split", "pop", "jsonSchema", "React", "IconButton", "SchemaTable", "types", "objects", "label", "onClick", "div", "className", "map", "type", "key", "typename", "IconButton", "variant", "icon", "iconOnly", "SpaceGenerator", "space", "onCreateObjects", "client", "useClient", "staticTypes", "DocumentType", "DiagramType", "SheetType", "ComputeGraph", "CanvasBoardType", "mutableTypes", "Testing", "OrgType", "ProjectType", "ContactType", "count", "setCount", "useState", "info", "setInfo", "typeMap", "useMemo", "addTypes", "mutableGenerators", "Map", "map", "type", "typename", "createGenerator", "staticGenerators", "updateInfo", "echoSchema", "db", "schemaRegistry", "query", "run", "staticSchema", "graph", "schemas", "objects", "objectMap", "sortKeys", "reduce", "obj", "getTypename", "schema", "static", "length", "mutable", "useAsyncEffect", "handleCreateData", "useCallback", "constructor", "get", "React", "div", "role", "className", "Toolbar", "Root", "classNames", "IconButton", "icon", "iconOnly", "label", "onClick", "Separator", "variant", "Input", "TextInput", "min", "max", "placeholder", "value", "onChange", "ev", "parseInt", "target", "SchemaTable", "types", "SyntaxHighlighter", "language", "JSON", "stringify", "jsonKeyReplacer", "truncate", "SpaceGenerator"]
7
- }