@dxos/app-graph 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0

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 (33) hide show
  1. package/dist/lib/browser/index.mjs +541 -789
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +533 -780
  5. package/dist/lib/node/index.cjs.map +4 -4
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +541 -789
  8. package/dist/lib/node-esm/index.mjs.map +4 -4
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/experimental/graph-projections.test.d.ts +25 -0
  11. package/dist/types/src/experimental/graph-projections.test.d.ts.map +1 -0
  12. package/dist/types/src/graph-builder.d.ts +48 -91
  13. package/dist/types/src/graph-builder.d.ts.map +1 -1
  14. package/dist/types/src/graph.d.ts +191 -98
  15. package/dist/types/src/graph.d.ts.map +1 -1
  16. package/dist/types/src/node.d.ts +2 -2
  17. package/dist/types/src/node.d.ts.map +1 -1
  18. package/dist/types/src/signals-integration.test.d.ts +2 -0
  19. package/dist/types/src/signals-integration.test.d.ts.map +1 -0
  20. package/dist/types/src/stories/EchoGraph.stories.d.ts.map +1 -1
  21. package/dist/types/src/testing.d.ts +5 -0
  22. package/dist/types/src/testing.d.ts.map +1 -0
  23. package/dist/types/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +23 -16
  25. package/src/experimental/graph-projections.test.ts +56 -0
  26. package/src/graph-builder.test.ts +293 -310
  27. package/src/graph-builder.ts +209 -317
  28. package/src/graph.test.ts +314 -463
  29. package/src/graph.ts +452 -458
  30. package/src/node.ts +2 -2
  31. package/src/signals-integration.test.ts +218 -0
  32. package/src/stories/EchoGraph.stories.tsx +56 -77
  33. package/src/testing.ts +20 -0
@@ -1,16 +1,16 @@
1
+ import { Registry, Rx } from '@effect-rx/rx-react';
2
+ import { Option } from 'effect';
3
+ import { Event } from '@dxos/async';
1
4
  import { type MakeOptional } from '@dxos/util';
2
- import { type Node, type NodeFilter, type Relation } from './node';
5
+ import { type NodeArg, type Node, type Relation, type Action, type ActionGroup } from './node';
6
+ /**
7
+ * Get the Graph a Node is currently associated with.
8
+ */
3
9
  export declare const getGraph: (node: Node) => Graph;
4
10
  export declare const ROOT_ID = "root";
5
11
  export declare const ROOT_TYPE = "dxos.org/type/GraphRoot";
6
12
  export declare const ACTION_TYPE = "dxos.org/type/GraphAction";
7
13
  export declare const ACTION_GROUP_TYPE = "dxos.org/type/GraphActionGroup";
8
- export type NodesOptions<TData = any, TProperties extends Record<string, any> = Record<string, any>> = {
9
- relation?: Relation;
10
- filter?: NodeFilter<TData, TProperties>;
11
- expansion?: boolean;
12
- type?: string;
13
- };
14
14
  export type GraphTraversalOptions = {
15
15
  /**
16
16
  * A callback which is called for each node visited during traversal.
@@ -21,151 +21,244 @@ export type GraphTraversalOptions = {
21
21
  /**
22
22
  * The node to start traversing from.
23
23
  *
24
- * @default root
24
+ * @default ROOT_ID
25
25
  */
26
- node?: Node;
26
+ source?: string;
27
27
  /**
28
28
  * The relation to traverse graph edges.
29
29
  *
30
30
  * @default 'outbound'
31
31
  */
32
32
  relation?: Relation;
33
- /**
34
- * Allow traversal to trigger expansion of the graph via `onInitialNodes`.
35
- */
36
- expansion?: boolean;
37
33
  };
38
34
  export type GraphParams = {
35
+ registry?: Registry.Registry;
39
36
  nodes?: MakeOptional<Node, 'data' | 'cacheable'>[];
40
- edges?: Record<string, string[]>;
41
- onInitialNode?: Graph['_onInitialNode'];
42
- onInitialNodes?: Graph['_onInitialNodes'];
37
+ edges?: Record<string, Edges>;
38
+ onExpand?: Graph['_onExpand'];
43
39
  onRemoveNode?: Graph['_onRemoveNode'];
44
40
  };
45
- /**
46
- * The Graph represents the structure of the application constructed via plugins.
47
- */
48
- export declare class Graph {
49
- private readonly _onInitialNode?;
50
- private readonly _onInitialNodes?;
51
- private readonly _onRemoveNode?;
52
- private readonly _waitingForNodes;
53
- private readonly _initialized;
54
- constructor({ nodes, edges, onInitialNode, onInitialNodes, onRemoveNode }?: GraphParams);
55
- static from(pickle: string, options?: Omit<GraphParams, 'nodes' | 'edges'>): Graph;
41
+ export type Edge = {
42
+ source: string;
43
+ target: string;
44
+ };
45
+ export type Edges = {
46
+ inbound: string[];
47
+ outbound: string[];
48
+ };
49
+ export interface ReadableGraph {
56
50
  /**
57
- * Alias for `findNode('root')`.
51
+ * Event emitted when a node is changed.
58
52
  */
59
- get root(): Readonly<{
53
+ onNodeChanged: Event<{
60
54
  id: string;
61
- type: string;
62
- cacheable?: string[];
63
- properties: Readonly<Record<string, any>>;
64
- data: any;
55
+ node: Option.Option<Node>;
65
56
  }>;
66
57
  /**
67
58
  * Convert the graph to a JSON object.
68
59
  */
69
- toJSON({ id, maxLength }?: {
70
- id?: string;
71
- maxLength?: number;
72
- }): any;
73
- pickle(): string;
60
+ toJSON(id?: string): object;
61
+ json(id?: string): Rx.Rx<any>;
74
62
  /**
75
- * Find the node with the given id in the graph.
76
- *
77
- * If a node is not found within the graph and an `onInitialNode` callback is provided,
78
- * it is called with the id and type of the node, potentially initializing the node.
63
+ * Get the rx key for the node with the given id.
79
64
  */
80
- findNode(id: string, expansion?: boolean): Node | undefined;
65
+ node(id: string): Rx.Rx<Option.Option<Node>>;
81
66
  /**
82
- * Wait for a node to be added to the graph.
83
- *
84
- * If the node is already present in the graph, the promise resolves immediately.
85
- *
86
- * @param id The id of the node to wait for.
87
- * @param timeout The time in milliseconds to wait for the node to be added.
67
+ * Get the rx key for the node with the given id.
88
68
  */
89
- waitForNode(id: string, timeout?: number): Promise<Node>;
69
+ nodeOrThrow(id: string): Rx.Rx<Node>;
90
70
  /**
91
- * Nodes that this node is connected to in default order.
71
+ * Get the rx key for the connections of the node with the given id.
92
72
  */
93
- nodes<TData = any, TProperties extends Record<string, any> = Record<string, any>>(node: Node, options?: NodesOptions<TData, TProperties>): Readonly<{
94
- id: string;
95
- type: string;
96
- cacheable?: string[];
97
- properties: Readonly<Record<string, any>>;
98
- data: any;
99
- }>[];
73
+ connections(id: string, relation?: Relation): Rx.Rx<Node[]>;
100
74
  /**
101
- * Edges that this node is connected to in default order.
75
+ * Get the rx key for the actions of the node with the given id.
102
76
  */
103
- edges(node: Node, { relation }?: {
104
- relation?: Relation;
105
- }): string[];
77
+ actions(id: string): Rx.Rx<(Action | ActionGroup)[]>;
106
78
  /**
107
- * Actions or action groups that this node is connected to in default order.
79
+ * Get the rx key for the edges of the node with the given id.
108
80
  */
109
- actions(node: Node, { expansion }?: {
110
- expansion?: boolean;
111
- }): Readonly<{
112
- id: string;
113
- type: string;
114
- cacheable?: string[];
115
- properties: Readonly<Record<string, any>>;
116
- data: any;
117
- }>[];
118
- expand(node: Node, relation?: Relation, type?: string): Promise<void>;
119
- private _key;
81
+ edges(id: string): Rx.Rx<Edges>;
120
82
  /**
121
- * Recursive depth-first traversal of the graph.
83
+ * Alias for `getNodeOrThrow(ROOT_ID)`.
84
+ */
85
+ get root(): Node;
86
+ /**
87
+ * Get the node with the given id from the graph's registry.
88
+ */
89
+ getNode(id: string): Option.Option<Node>;
90
+ /**
91
+ * Get the node with the given id from the graph's registry.
122
92
  *
123
- * @param options.node The node to start traversing from.
124
- * @param options.relation The relation to traverse graph edges.
125
- * @param options.visitor A callback which is called for each node visited during traversal.
93
+ * @throws If the node is Option.none().
94
+ */
95
+ getNodeOrThrow(id: string): Node;
96
+ /**
97
+ * Get all nodes connected to the node with the given id by the given relation from the graph's registry.
98
+ */
99
+ getConnections(id: string, relation?: Relation): Node[];
100
+ /**
101
+ * Get all actions connected to the node with the given id from the graph's registry.
126
102
  */
127
- traverse({ visitor, node, relation, expansion }: GraphTraversalOptions, path?: string[]): void;
103
+ getActions(id: string): Node[];
128
104
  /**
129
- * Recursive depth-first traversal of the graph wrapping each visitor call in an effect.
105
+ * Get the edges from the node with the given id from the graph's registry.
106
+ */
107
+ getEdges(id: string): Edges;
108
+ /**
109
+ * Recursive depth-first traversal of the graph.
130
110
  *
131
111
  * @param options.node The node to start traversing from.
132
112
  * @param options.relation The relation to traverse graph edges.
133
113
  * @param options.visitor A callback which is called for each node visited during traversal.
134
114
  */
135
- subscribeTraverse({ visitor, node, relation, expansion }: GraphTraversalOptions, currentPath?: string[]): () => void;
115
+ traverse(options: GraphTraversalOptions, path?: string[]): void;
136
116
  /**
137
117
  * Get the path between two nodes in the graph.
138
118
  */
139
- getPath({ source, target }: {
119
+ getPath(params: {
140
120
  source?: string;
141
121
  target: string;
142
- }): string[] | undefined;
122
+ }): Option.Option<string[]>;
143
123
  /**
144
124
  * Wait for the path between two nodes in the graph to be established.
145
125
  */
146
126
  waitForPath(params: {
147
127
  source?: string;
148
128
  target: string;
149
- }, { timeout, interval }?: {
129
+ }, options?: {
150
130
  timeout?: number;
151
131
  interval?: number;
152
132
  }): Promise<string[]>;
153
- private _addNode;
154
- private _removeNode;
155
- private _addEdge;
156
- private _removeEdge;
133
+ }
134
+ export interface ExpandableGraph extends ReadableGraph {
157
135
  /**
158
- * Sort edges for a node.
136
+ * Initialize a node in the graph.
159
137
  *
160
- * Edges not included in the sorted list are appended to the end of the list.
138
+ * Fires the `onInitialize` callback to provide initial data for a node.
139
+ */
140
+ /**
141
+ * Expand a node in the graph.
161
142
  *
162
- * @param nodeId The id of the node to sort edges for.
163
- * @param relation The relation of the edges from the node to sort.
164
- * @param edges The ordered list of edges.
165
- * @ignore
166
- */
167
- _sortEdges(nodeId: string, relation: Relation, edges: string[]): void;
168
- private _constructNode;
169
- private _getNodes;
143
+ * Fires the `onExpand` callback to add connections to the node.
144
+ */
145
+ expand(id: string, relation?: Relation): void;
146
+ /**
147
+ * Sort the edges of the node with the given id.
148
+ */
149
+ sortEdges(id: string, relation: Relation, order: string[]): void;
150
+ }
151
+ export interface WritableGraph extends ExpandableGraph {
152
+ /**
153
+ * Add nodes to the graph.
154
+ */
155
+ addNodes(nodes: NodeArg<any, Record<string, any>>[]): void;
156
+ /**
157
+ * Add a node to the graph.
158
+ */
159
+ addNode(node: NodeArg<any, Record<string, any>>): void;
160
+ /**
161
+ * Remove nodes from the graph.
162
+ */
163
+ removeNodes(ids: string[], edges?: boolean): void;
164
+ /**
165
+ * Remove a node from the graph.
166
+ */
167
+ removeNode(id: string, edges?: boolean): void;
168
+ /**
169
+ * Add edges to the graph.
170
+ */
171
+ addEdges(edges: Edge[]): void;
172
+ /**
173
+ * Add an edge to the graph.
174
+ */
175
+ addEdge(edge: Edge): void;
176
+ /**
177
+ * Remove edges from the graph.
178
+ */
179
+ removeEdges(edges: Edge[], removeOrphans?: boolean): void;
180
+ /**
181
+ * Remove an edge from the graph.
182
+ */
183
+ removeEdge(edge: Edge, removeOrphans?: boolean): void;
184
+ }
185
+ /**
186
+ * The Graph represents the user interface information architecture of the application constructed via plugins.
187
+ */
188
+ export declare class Graph implements WritableGraph {
189
+ readonly onNodeChanged: Event<{
190
+ id: string;
191
+ node: Option.Option<Node>;
192
+ }>;
193
+ private readonly _onExpand?;
194
+ private readonly _onRemoveNode?;
195
+ private readonly _registry;
196
+ private readonly _expanded;
197
+ private readonly _initialized;
198
+ private readonly _initialEdges;
199
+ private readonly _initialNodes;
200
+ private readonly _nodeOrThrow;
201
+ private readonly _edges;
202
+ private readonly _connections;
203
+ private readonly _actions;
204
+ private readonly _json;
205
+ constructor({ registry, nodes, edges, onExpand, onRemoveNode }?: GraphParams);
206
+ toJSON(id?: string): any;
207
+ json(id?: string): Rx.Rx<any>;
208
+ node(id: string): Rx.Rx<Option.Option<Node>>;
209
+ nodeOrThrow(id: string): Rx.Rx<Node>;
210
+ connections(id: string, relation?: Relation): Rx.Rx<Node[]>;
211
+ actions(id: string): Rx.Rx<(Readonly<Omit<Readonly<{
212
+ id: string;
213
+ type: string;
214
+ cacheable?: string[];
215
+ properties: Readonly<Record<string, any>>;
216
+ data: import("./node").ActionData;
217
+ }>, "properties"> & {
218
+ properties: Readonly<Record<string, any>>;
219
+ }> | Readonly<Omit<Readonly<{
220
+ id: string;
221
+ type: string;
222
+ cacheable?: string[];
223
+ properties: Readonly<Record<string, any>>;
224
+ data: typeof import("./node").actionGroupSymbol;
225
+ }>, "properties"> & {
226
+ properties: Readonly<Record<string, any>>;
227
+ }>)[]>;
228
+ edges(id: string): Rx.Rx<Edges>;
229
+ get root(): Readonly<{
230
+ id: string;
231
+ type: string;
232
+ cacheable?: string[];
233
+ properties: Readonly<Record<string, any>>;
234
+ data: any;
235
+ }>;
236
+ getNode(id: string): Option.Option<Node>;
237
+ getNodeOrThrow(id: string): Node;
238
+ getConnections(id: string, relation?: Relation): Node[];
239
+ getActions(id: string): Node[];
240
+ getEdges(id: string): Edges;
241
+ expand(id: string, relation?: Relation): void;
242
+ addNodes(nodes: NodeArg<any, Record<string, any>>[]): void;
243
+ addNode({ nodes, edges, ...nodeArg }: NodeArg<any, Record<string, any>>): void;
244
+ removeNodes(ids: string[], edges?: boolean): void;
245
+ removeNode(id: string, edges?: boolean): void;
246
+ addEdges(edges: Edge[]): void;
247
+ addEdge(edgeArg: Edge): void;
248
+ removeEdges(edges: Edge[], removeOrphans?: boolean): void;
249
+ removeEdge(edgeArg: Edge, removeOrphans?: boolean): void;
250
+ sortEdges(id: string, relation: Relation, order: string[]): void;
251
+ traverse({ visitor, source, relation }: GraphTraversalOptions, path?: string[]): void;
252
+ getPath({ source, target }: {
253
+ source?: string;
254
+ target: string;
255
+ }): Option.Option<string[]>;
256
+ waitForPath(params: {
257
+ source?: string;
258
+ target: string;
259
+ }, { timeout, interval }?: {
260
+ timeout?: number;
261
+ interval?: number;
262
+ }): Promise<string[]>;
170
263
  }
171
264
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,KAAK,YAAY,EAAuB,MAAM,YAAY,CAAC;AAEpE,OAAO,EAAE,KAAK,IAAI,EAAgB,KAAK,UAAU,EAA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c,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAO;CAsBpF"}
@@ -37,10 +37,10 @@ export type NodeArg<TData, TProperties extends Record<string, any> = Record<stri
37
37
  };
38
38
  export type InvokeParams = {
39
39
  /** Node the invoked action is connected to. */
40
- node: Node;
40
+ parent?: Node;
41
41
  caller?: string;
42
42
  };
43
- export type ActionData = (params: InvokeParams) => MaybePromise<void>;
43
+ export type ActionData = (params?: InvokeParams) => MaybePromise<void>;
44
44
  export type Action<TProperties extends Record<string, any> = Record<string, any>> = Readonly<Omit<Node<ActionData, TProperties>, 'properties'> & {
45
45
  properties: Readonly<TProperties>;
46
46
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/node.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAElE;;GAEG;AAGH,MAAM,MAAM,IAAI,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,QAAQ,CAAC;IACtG;;OAEG;IAEH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IAErB;;OAEG;IACH,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAElC;;OAEG;IAGH,IAAI,EAAE,KAAK,CAAC;CACb,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,CAAC,KAAK,GAAG,GAAG,EAAE,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CACnG,IAAI,EAAE,IAAI,CAAC,OAA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,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,MACY,CAAC;AAE9D,eAAO,MAAM,iBAAiB,eAAwB,CAAC;AAEvD,MAAM,MAAM,WAAW,CAAC,WAAW,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,QAAQ,CAC/F,IAAI,CAAC,IAAI,CAAC,OAAO,iBAAiB,EAAE,WAAW,CAAC,EAAE,YAAY,CAAC,GAAG;IAChE,UAAU,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACnC,CACF,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,WACO,CAAC;AAE9D,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9C,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,KAAG,IAAI,IAAI,MAAM,GAAG,WAAoD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=signals-integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"signals-integration.test.d.ts","sourceRoot":"","sources":["../../../src/signals-integration.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"EchoGraph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EchoGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAGrB,OAAO,KAA8B,MAAM,OAAO,CAAC;;;;;;AAoPnD,wBAaE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"EchoGraph.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/EchoGraph.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAKrB,OAAO,KAAuC,MAAM,OAAO,CAAC;;;;;;AA6N5D,wBAaE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { Rx } from '@effect-rx/rx-react';
2
+ import { type QueryResult } from '@dxos/echo-db';
3
+ import { type BaseObject } from '@dxos/echo-schema';
4
+ export declare const rxFromQuery: <T extends BaseObject>(query: QueryResult<T>) => Rx.Rx<T[]>;
5
+ //# sourceMappingURL=testing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../src/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAC;AAEzC,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,UAAU,EAAE,OAAO,WAAW,CAAC,CAAC,CAAC,KAAG,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAUlF,CAAC"}
@@ -1 +1 @@
1
- {"version":"5.7.3"}
1
+ {"version":"5.8.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/app-graph",
3
- "version": "0.8.2-main.f11618f",
3
+ "version": "0.8.2-main.fbd8ed0",
4
4
  "description": "Constructs knowledge graphs for the purpose of building applications on top of",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -26,34 +26,41 @@
26
26
  "dependencies": {
27
27
  "@preact/signals-core": "^1.6.0",
28
28
  "main-thread-scheduling": "^14.1.1",
29
- "@dxos/async": "0.8.2-main.f11618f",
30
- "@dxos/debug": "0.8.2-main.f11618f",
31
- "@dxos/echo-schema": "0.8.2-main.f11618f",
32
- "@dxos/echo-signals": "0.8.2-main.f11618f",
33
- "@dxos/invariant": "0.8.2-main.f11618f",
34
- "@dxos/live-object": "0.8.2-main.f11618f",
35
- "@dxos/log": "0.8.2-main.f11618f",
36
- "@dxos/util": "0.8.2-main.f11618f"
29
+ "@dxos/async": "0.8.2-main.fbd8ed0",
30
+ "@dxos/debug": "0.8.2-main.fbd8ed0",
31
+ "@dxos/echo-schema": "0.8.2-main.fbd8ed0",
32
+ "@dxos/invariant": "0.8.2-main.fbd8ed0",
33
+ "@dxos/live-object": "0.8.2-main.fbd8ed0",
34
+ "@dxos/echo-signals": "0.8.2-main.fbd8ed0",
35
+ "@dxos/log": "0.8.2-main.fbd8ed0",
36
+ "@dxos/util": "0.8.2-main.fbd8ed0"
37
37
  },
38
38
  "devDependencies": {
39
+ "@effect-rx/rx-react": "^0.34.1",
40
+ "@effect/platform": "0.80.12",
39
41
  "@phosphor-icons/react": "^2.1.5",
40
42
  "@types/react": "~18.2.0",
41
43
  "@types/react-dom": "~18.2.0",
44
+ "effect": "3.14.21",
42
45
  "react": "~18.2.0",
43
46
  "react-dom": "~18.2.0",
44
47
  "vite": "5.4.7",
45
- "@dxos/random": "0.8.2-main.f11618f",
46
- "@dxos/react-ui": "0.8.2-main.f11618f",
47
- "@dxos/react-client": "0.8.2-main.f11618f",
48
- "@dxos/react-ui-theme": "0.8.2-main.f11618f",
49
- "@dxos/storybook-utils": "0.8.2-main.f11618f"
48
+ "@dxos/echo-db": "0.8.2-main.fbd8ed0",
49
+ "@dxos/random": "0.8.2-main.fbd8ed0",
50
+ "@dxos/react-ui": "0.8.2-main.fbd8ed0",
51
+ "@dxos/react-client": "0.8.2-main.fbd8ed0",
52
+ "@dxos/storybook-utils": "0.8.2-main.fbd8ed0",
53
+ "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
50
54
  },
51
55
  "peerDependencies": {
56
+ "@effect-rx/rx-react": "^0.34.1",
57
+ "@effect/platform": "0.80.12",
52
58
  "@phosphor-icons/react": "^2.1.5",
59
+ "effect": "3.14.21",
53
60
  "react": "~18.2.0",
54
61
  "react-dom": "~18.2.0",
55
- "@dxos/react-ui-theme": "0.8.2-main.f11618f",
56
- "@dxos/react-ui": "0.8.2-main.f11618f"
62
+ "@dxos/react-ui": "0.8.2-main.fbd8ed0",
63
+ "@dxos/react-ui-theme": "0.8.2-main.fbd8ed0"
57
64
  },
58
65
  "publishConfig": {
59
66
  "access": "public"
@@ -0,0 +1,56 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ type Cb = () => void;
6
+
7
+ interface Query {
8
+ id?: string[];
9
+ typename?: string[];
10
+ }
11
+
12
+ /**
13
+ * Lazy query result that can be executed.
14
+ * Does not run without the run function being called.
15
+ */
16
+ interface QueryResult<T> {
17
+ /**
18
+ * Execute the query and subscribe to the result.
19
+ * @param next Called at least once with the first value (maybe synchronously) and then for every subsequent update.
20
+ * @param error Called on error. `next` is never called after that.
21
+ * @returns Function to dispose the query and unsubscribe.
22
+ */
23
+ run(onData: (value?: T[]) => void, onError: (err: Error) => void): Cb;
24
+ }
25
+
26
+ const QueryResult = Object.freeze({
27
+ fromPromise: <T>(run: (onDispose: (cb: Cb) => void) => Promise<T[]>): QueryResult<T> => {
28
+ return {
29
+ run: (onData, onError) => {
30
+ const cbs: Cb[] = [];
31
+ let disposed = false;
32
+ const dispose = () => {
33
+ cbs.forEach((cb) => cb());
34
+ disposed = true;
35
+ };
36
+ run((cb) => (disposed ? cb() : cbs.push(cb))).then(
37
+ (data) => {
38
+ if (disposed) {
39
+ return;
40
+ }
41
+ onData(data);
42
+ },
43
+ (err) => {
44
+ dispose();
45
+ onError(err);
46
+ },
47
+ );
48
+ return dispose;
49
+ },
50
+ };
51
+ },
52
+ });
53
+
54
+ interface _Resolver<T> {
55
+ query(query: Query): QueryResult<T>;
56
+ }