@dxos/plugin-graph 0.8.4-main.ead640a → 0.8.4-main.effb148878

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 (68) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/GraphPlugin.mjs +9 -0
  4. package/dist/lib/neutral/GraphPlugin.mjs.map +7 -0
  5. package/dist/lib/neutral/chunk-QECLJ7AR.mjs +60 -0
  6. package/dist/lib/neutral/chunk-QECLJ7AR.mjs.map +7 -0
  7. package/dist/lib/neutral/chunk-S2DLYPRU.mjs +22 -0
  8. package/dist/lib/neutral/chunk-S2DLYPRU.mjs.map +7 -0
  9. package/dist/lib/neutral/chunk-Y5TMPZGE.mjs +19 -0
  10. package/dist/lib/neutral/chunk-Y5TMPZGE.mjs.map +7 -0
  11. package/dist/lib/neutral/graph-RCKCHDM6.mjs +48 -0
  12. package/dist/lib/neutral/graph-RCKCHDM6.mjs.map +7 -0
  13. package/dist/lib/neutral/hooks/index.mjs +15 -0
  14. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  15. package/dist/lib/neutral/index.mjs +24 -0
  16. package/dist/lib/neutral/index.mjs.map +7 -0
  17. package/dist/lib/neutral/meta.json +1 -0
  18. package/dist/lib/neutral/meta.mjs +7 -0
  19. package/dist/lib/neutral/meta.mjs.map +7 -0
  20. package/dist/lib/neutral/plugin.mjs +11 -0
  21. package/dist/lib/neutral/plugin.mjs.map +7 -0
  22. package/dist/lib/neutral/testing.mjs +7 -0
  23. package/dist/lib/neutral/testing.mjs.map +7 -0
  24. package/dist/types/src/GraphPlugin.d.ts +3 -1
  25. package/dist/types/src/GraphPlugin.d.ts.map +1 -1
  26. package/dist/types/src/GraphPlugin.test.d.ts +2 -0
  27. package/dist/types/src/GraphPlugin.test.d.ts.map +1 -0
  28. package/dist/types/src/action.d.ts +12 -0
  29. package/dist/types/src/action.d.ts.map +1 -0
  30. package/dist/types/src/graph.d.ts +7 -3
  31. package/dist/types/src/graph.d.ts.map +1 -1
  32. package/dist/types/src/hooks/index.d.ts +1 -0
  33. package/dist/types/src/hooks/index.d.ts.map +1 -1
  34. package/dist/types/src/hooks/useActionRunner.d.ts +7 -0
  35. package/dist/types/src/hooks/useActionRunner.d.ts.map +1 -0
  36. package/dist/types/src/hooks/useNode.d.ts +19 -4
  37. package/dist/types/src/hooks/useNode.d.ts.map +1 -1
  38. package/dist/types/src/index.d.ts +2 -2
  39. package/dist/types/src/index.d.ts.map +1 -1
  40. package/dist/types/src/meta.d.ts +2 -2
  41. package/dist/types/src/meta.d.ts.map +1 -1
  42. package/dist/types/src/plugin.d.ts +3 -0
  43. package/dist/types/src/plugin.d.ts.map +1 -0
  44. package/dist/types/src/testing.d.ts +2 -0
  45. package/dist/types/src/testing.d.ts.map +1 -0
  46. package/dist/types/tsconfig.tsbuildinfo +1 -1
  47. package/package.json +58 -27
  48. package/src/GraphPlugin.test.ts +26 -0
  49. package/src/GraphPlugin.ts +15 -10
  50. package/src/action.ts +34 -0
  51. package/src/graph.ts +50 -34
  52. package/src/hooks/index.ts +1 -0
  53. package/src/hooks/useActionRunner.ts +25 -0
  54. package/src/hooks/useNode.ts +34 -8
  55. package/src/index.ts +5 -2
  56. package/src/meta.ts +10 -3
  57. package/src/plugin.ts +9 -0
  58. package/src/testing.ts +7 -0
  59. package/dist/lib/browser/graph-2RPEFHFK.mjs +0 -38
  60. package/dist/lib/browser/graph-2RPEFHFK.mjs.map +0 -7
  61. package/dist/lib/browser/index.mjs +0 -48
  62. package/dist/lib/browser/index.mjs.map +0 -7
  63. package/dist/lib/browser/meta.json +0 -1
  64. package/dist/lib/node-esm/graph-MKDJSVDV.mjs +0 -40
  65. package/dist/lib/node-esm/graph-MKDJSVDV.mjs.map +0 -7
  66. package/dist/lib/node-esm/index.mjs +0 -50
  67. package/dist/lib/node-esm/index.mjs.map +0 -7
  68. package/dist/lib/node-esm/meta.json +0 -1
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
package/README.md CHANGED
@@ -10,4 +10,4 @@
10
10
 
11
11
  Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
12
12
 
13
- License: [MIT](./LICENSE) Copyright 2023 © DXOS
13
+ License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2023 © DXOS
@@ -0,0 +1,9 @@
1
+ import {
2
+ GraphPlugin,
3
+ GraphPlugin_default
4
+ } from "./chunk-S2DLYPRU.mjs";
5
+ export {
6
+ GraphPlugin,
7
+ GraphPlugin_default as default
8
+ };
9
+ //# sourceMappingURL=GraphPlugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,60 @@
1
+ // src/hooks/useActionRunner.ts
2
+ import { useCallback } from "react";
3
+ import { useOperationInvoker, usePluginManager } from "@dxos/app-framework/ui";
4
+
5
+ // src/action.ts
6
+ import * as Effect from "effect/Effect";
7
+ import * as Function from "effect/Function";
8
+ import { Capability } from "@dxos/app-framework";
9
+ import { Operation } from "@dxos/compute";
10
+ import { runAndForwardErrors } from "@dxos/effect";
11
+ var runAction = async (invoker, capabilityManager, action, params = {}) => runAndForwardErrors(action.data(params).pipe(Effect.provideService(Operation.Service, invoker), Effect.provideService(Capability.Service, capabilityManager), action._actionContext ? Effect.provide(action._actionContext) : Function.identity));
12
+
13
+ // src/hooks/useActionRunner.ts
14
+ var useActionRunner = () => {
15
+ const invoker = useOperationInvoker();
16
+ const pluginManager = usePluginManager();
17
+ return useCallback((action, params = {}) => runAction(invoker, pluginManager.capabilities, action, params), [
18
+ invoker,
19
+ pluginManager.capabilities
20
+ ]);
21
+ };
22
+
23
+ // src/hooks/useNode.ts
24
+ import { useAtomValue } from "@effect-atom/atom-react";
25
+ import * as Option from "effect/Option";
26
+ import { useMemo } from "react";
27
+ var useNode = (graph, id) => {
28
+ const atom = useMemo(() => graph.node(id ?? ""), [
29
+ graph,
30
+ id
31
+ ]);
32
+ return Option.getOrElse(useAtomValue(atom), () => void 0);
33
+ };
34
+ var useConnections = (graph, id, relation) => {
35
+ return useAtomValue(graph.connections(id ?? "", relation));
36
+ };
37
+ var useActions = (graph, id) => {
38
+ const atom = useMemo(() => graph.actions(id ?? ""), [
39
+ graph,
40
+ id
41
+ ]);
42
+ return useAtomValue(atom);
43
+ };
44
+ var useEdges = (graph, id) => {
45
+ const atom = useMemo(() => graph.edges(id ?? ""), [
46
+ graph,
47
+ id
48
+ ]);
49
+ return useAtomValue(atom);
50
+ };
51
+
52
+ export {
53
+ runAction,
54
+ useActionRunner,
55
+ useNode,
56
+ useConnections,
57
+ useActions,
58
+ useEdges
59
+ };
60
+ //# sourceMappingURL=chunk-QECLJ7AR.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useActionRunner.ts", "../../../src/action.ts", "../../../src/hooks/useNode.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { useOperationInvoker, usePluginManager } from '@dxos/app-framework/ui';\nimport { type Node } from '@dxos/app-graph';\n\nimport { runAction } from '../action';\n\n/**\n * Hook that returns a function to run action Effects.\n * Provides Operation.Service, PluginContextService, and captured plugin context.\n */\nexport const useActionRunner = () => {\n const invoker = useOperationInvoker();\n const pluginManager = usePluginManager();\n\n return useCallback(\n (action: Node.Action, params: Node.InvokeProps = {}) =>\n runAction(invoker, pluginManager.capabilities, action, params),\n [invoker, pluginManager.capabilities],\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\n\nimport { Capability, type CapabilityManager } from '@dxos/app-framework';\nimport { type Node } from '@dxos/app-graph';\nimport { Operation } from '@dxos/compute';\nimport { runAndForwardErrors } from '@dxos/effect';\n\n/**\n * Run an action with required layers: Operation.Service, Capability.Service, and captured context.\n * @param invoker The operation invoker to use for Operation.Service.\n * @param capabilityManager The capability manager for Capability.Service.\n * @param action The action to execute.\n * @param params Parameters to pass to the action.\n */\nexport const runAction = async (\n invoker: Operation.OperationService,\n capabilityManager: CapabilityManager.CapabilityManager,\n action: Node.Action,\n params: Node.InvokeProps = {},\n): Promise<void> =>\n runAndForwardErrors(\n action\n .data(params)\n .pipe(\n Effect.provideService(Operation.Service, invoker),\n Effect.provideService(Capability.Service, capabilityManager),\n action._actionContext ? Effect.provide(action._actionContext) : Function.identity,\n ),\n );\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\nimport { useMemo } from 'react';\n\nimport { type Graph, type Node } from '@dxos/app-graph';\n\n/**\n * React hook to get a node from the graph.\n *\n * @param graph Graph to find the node in.\n * @param id Id of the node to find.\n * @param timeout Optional timeout in milliseconds to wait for the node to be found.\n * @returns Node if found, undefined otherwise.\n */\n// TODO(wittjosiah): Factor out to @dxos/app-graph/react.\nexport const useNode = <T = any>(graph: Graph.ReadableGraph, id?: string): Node.Node<T> | undefined => {\n const atom = useMemo(() => graph.node(id ?? ''), [graph, id]);\n return Option.getOrElse(useAtomValue(atom), () => undefined);\n};\n\nexport const useConnections = (\n graph: Graph.ReadableGraph,\n id: string | undefined,\n relation: Node.RelationInput,\n): Node.Node[] => {\n return useAtomValue(graph.connections(id ?? '', relation));\n};\n\n/**\n * React hook to get actions available for a node.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Actions available for the node.\n */\nexport const useActions = (graph: Graph.ReadableGraph, id?: string): Node.Node[] => {\n const atom = useMemo(() => graph.actions(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n\n/**\n * Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content.\n *\n * @param graph Graph containing the node.\n * @param id Id of the node.\n * @returns Edge topology for the node.\n */\nexport const useEdges = (graph: Graph.ReadableGraph, id?: string): Graph.Edges => {\n const atom = useMemo(() => graph.edges(id ?? ''), [graph, id]);\n return useAtomValue(atom);\n};\n"],
5
+ "mappings": ";AAIA,SAASA,mBAAmB;AAE5B,SAASC,qBAAqBC,wBAAwB;;;ACFtD,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,kBAA0C;AAEnD,SAASC,iBAAiB;AAC1B,SAASC,2BAA2B;AAS7B,IAAMC,YAAY,OACvBC,SACAC,mBACAC,QACAC,SAA2B,CAAC,MAE5BL,oBACEI,OACGE,KAAKD,MAAAA,EACLE,KACQC,sBAAeT,UAAUU,SAASP,OAAAA,GAClCM,sBAAeV,WAAWW,SAASN,iBAAAA,GAC1CC,OAAOM,iBAAwBC,eAAQP,OAAOM,cAAc,IAAaE,iBAAQ,CAAA;;;ADhBlF,IAAMC,kBAAkB,MAAA;AAC7B,QAAMC,UAAUC,oBAAAA;AAChB,QAAMC,gBAAgBC,iBAAAA;AAEtB,SAAOC,YACL,CAACC,QAAqBC,SAA2B,CAAC,MAChDC,UAAUP,SAASE,cAAcM,cAAcH,QAAQC,MAAAA,GACzD;IAACN;IAASE,cAAcM;GAAa;AAEzC;;;AEpBA,SAASC,oBAAoB;AAC7B,YAAYC,YAAY;AACxB,SAASC,eAAe;AAajB,IAAMC,UAAU,CAAUC,OAA4BC,OAAAA;AAC3D,QAAMC,OAAOJ,QAAQ,MAAME,MAAMG,KAAKF,MAAM,EAAA,GAAK;IAACD;IAAOC;GAAG;AAC5D,SAAcG,iBAAUR,aAAaM,IAAAA,GAAO,MAAMG,MAAAA;AACpD;AAEO,IAAMC,iBAAiB,CAC5BN,OACAC,IACAM,aAAAA;AAEA,SAAOX,aAAaI,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAClD;AASO,IAAME,aAAa,CAACT,OAA4BC,OAAAA;AACrD,QAAMC,OAAOJ,QAAQ,MAAME,MAAMU,QAAQT,MAAM,EAAA,GAAK;IAACD;IAAOC;GAAG;AAC/D,SAAOL,aAAaM,IAAAA;AACtB;AASO,IAAMS,WAAW,CAACX,OAA4BC,OAAAA;AACnD,QAAMC,OAAOJ,QAAQ,MAAME,MAAMY,MAAMX,MAAM,EAAA,GAAK;IAACD;IAAOC;GAAG;AAC7D,SAAOL,aAAaM,IAAAA;AACtB;",
6
+ "names": ["useCallback", "useOperationInvoker", "usePluginManager", "Effect", "Function", "Capability", "Operation", "runAndForwardErrors", "runAction", "invoker", "capabilityManager", "action", "params", "data", "pipe", "provideService", "Service", "_actionContext", "provide", "identity", "useActionRunner", "invoker", "useOperationInvoker", "pluginManager", "usePluginManager", "useCallback", "action", "params", "runAction", "capabilities", "useAtomValue", "Option", "useMemo", "useNode", "graph", "id", "atom", "node", "getOrElse", "undefined", "useConnections", "relation", "connections", "useActions", "actions", "useEdges", "edges"]
7
+ }
@@ -0,0 +1,22 @@
1
+ // src/GraphPlugin.ts
2
+ import { ActivationEvents, Capability, Plugin } from "@dxos/app-framework";
3
+ import { AppActivationEvents } from "@dxos/app-toolkit";
4
+ import { meta } from "#meta";
5
+ var Graph = Capability.lazy("Graph", () => import("./graph-RCKCHDM6.mjs"));
6
+ var GraphPlugin = Plugin.define(meta).pipe(Plugin.addModule({
7
+ activatesOn: ActivationEvents.Startup,
8
+ firesBeforeActivation: [
9
+ AppActivationEvents.SetupAppGraph
10
+ ],
11
+ firesAfterActivation: [
12
+ AppActivationEvents.AppGraphReady
13
+ ],
14
+ activate: Graph
15
+ }), Plugin.make);
16
+ var GraphPlugin_default = GraphPlugin;
17
+
18
+ export {
19
+ GraphPlugin,
20
+ GraphPlugin_default
21
+ };
22
+ //# sourceMappingURL=chunk-S2DLYPRU.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/GraphPlugin.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvents, Capability, Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\n\nconst Graph = Capability.lazy('Graph', () => import('./graph'));\n\n/**\n * Manages the state of the graph for the application.\n * Enables other plugins to register node builders to add nodes to the graph.\n * This includes actions and annotation each other's nodes.\n */\nexport const GraphPlugin = Plugin.define(meta).pipe(\n Plugin.addModule({\n activatesOn: ActivationEvents.Startup,\n firesBeforeActivation: [AppActivationEvents.SetupAppGraph],\n firesAfterActivation: [AppActivationEvents.AppGraphReady],\n activate: Graph,\n }),\n Plugin.make,\n);\n\nexport default GraphPlugin;\n"],
5
+ "mappings": ";AAIA,SAASA,kBAAkBC,YAAYC,cAAc;AACrD,SAASC,2BAA2B;AAEpC,SAASC,YAAY;AAErB,IAAMC,QAAQJ,WAAWK,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;AAO7C,IAAMC,cAAcL,OAAOM,OAAOJ,IAAAA,EAAMK,KAC7CP,OAAOQ,UAAU;EACfC,aAAaX,iBAAiBY;EAC9BC,uBAAuB;IAACV,oBAAoBW;;EAC5CC,sBAAsB;IAACZ,oBAAoBa;;EAC3CC,UAAUZ;AACZ,CAAA,GACAH,OAAOgB,IAAI;AAGb,IAAA,sBAAeX;",
6
+ "names": ["ActivationEvents", "Capability", "Plugin", "AppActivationEvents", "meta", "Graph", "lazy", "GraphPlugin", "define", "pipe", "addModule", "activatesOn", "Startup", "firesBeforeActivation", "SetupAppGraph", "firesAfterActivation", "AppGraphReady", "activate", "make"]
7
+ }
@@ -0,0 +1,19 @@
1
+ // src/meta.ts
2
+ import { trim } from "@dxos/util";
3
+ var meta = {
4
+ id: "org.dxos.plugin.graph",
5
+ name: "Graph",
6
+ author: "DXOS",
7
+ description: trim`
8
+ Graph database layer providing relationship modeling and queries for workspace objects.
9
+ Build knowledge graphs and explore complex data relationships.
10
+ `,
11
+ tags: [
12
+ "system"
13
+ ]
14
+ };
15
+
16
+ export {
17
+ meta
18
+ };
19
+ //# sourceMappingURL=chunk-Y5TMPZGE.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.graph',\n name: 'Graph',\n author: 'DXOS',\n description: trim`\n Graph database layer providing relationship modeling and queries for workspace objects.\n Build knowledge graphs and explore complex data relationships.\n `,\n tags: ['system'],\n};\n"],
5
+ "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,QAAQ;EACRC,aAAaL;;;;EAIbM,MAAM;IAAC;;AACT;",
6
+ "names": ["trim", "meta", "id", "name", "author", "description", "tags"]
7
+ }
@@ -0,0 +1,48 @@
1
+ // src/graph.ts
2
+ import * as Effect from "effect/Effect";
3
+ import * as Record from "effect/Record";
4
+ import { Capabilities, Capability } from "@dxos/app-framework";
5
+ import { Graph, GraphBuilder, Node } from "@dxos/app-graph";
6
+ import { AppCapabilities } from "@dxos/app-toolkit";
7
+ var graph_default = Capability.makeModule(Effect.fnUntraced(function* () {
8
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
9
+ const extensionsByModuleAtom = yield* Capability.atomByModule(AppCapabilities.AppGraphBuilder);
10
+ const builder = GraphBuilder.from(
11
+ /* localStorage.getItem(KEY) ?? */
12
+ void 0,
13
+ registry
14
+ );
15
+ const unsubscribe = registry.subscribe(extensionsByModuleAtom, (extensionsByModule) => {
16
+ const next = [];
17
+ for (const [moduleId, extensions] of Object.entries(extensionsByModule)) {
18
+ for (const ext of GraphBuilder.flattenExtensions(extensions)) {
19
+ next.push({
20
+ ...ext,
21
+ id: `${moduleId}.${ext.id}`
22
+ });
23
+ }
24
+ }
25
+ const current = Record.values(registry.get(builder.extensions));
26
+ const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));
27
+ removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));
28
+ next.forEach((extension) => GraphBuilder.addExtension(builder, extension));
29
+ }, {
30
+ immediate: true
31
+ });
32
+ void Graph.expand(builder.graph, Node.RootId, "child");
33
+ setupDevtools(builder.graph);
34
+ return Capability.contributes(AppCapabilities.AppGraph, {
35
+ graph: builder.graph,
36
+ explore: GraphBuilder.explore
37
+ }, () => Effect.sync(() => {
38
+ unsubscribe();
39
+ }));
40
+ }));
41
+ var setupDevtools = (graph) => {
42
+ globalThis.composer ??= {};
43
+ globalThis.composer.graph = graph;
44
+ };
45
+ export {
46
+ graph_default as default
47
+ };
48
+ //# sourceMappingURL=graph-RCKCHDM6.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/graph.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Record from 'effect/Record';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Graph, GraphBuilder, Node } from '@dxos/app-graph';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\n// TODO(wittjosiah): Remove or restore graph caching.\n// import { meta } from './meta';\n\n// const KEY = `${meta.id}.app-graph`;\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const extensionsByModuleAtom = yield* Capability.atomByModule(AppCapabilities.AppGraphBuilder);\n\n const builder = GraphBuilder.from(/* localStorage.getItem(KEY) ?? */ undefined, registry);\n // const interval = setInterval(() => {\n // localStorage.setItem(KEY, builder.graph.pickle());\n // }, 5_000);\n\n const unsubscribe = registry.subscribe(\n extensionsByModuleAtom,\n (extensionsByModule) => {\n const next: GraphBuilder.BuilderExtension[] = [];\n for (const [moduleId, extensions] of Object.entries(extensionsByModule)) {\n for (const ext of GraphBuilder.flattenExtensions(extensions)) {\n next.push({ ...ext, id: `${moduleId}.${ext.id}` });\n }\n }\n const current = Record.values(registry.get(builder.extensions));\n const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));\n removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));\n next.forEach((extension) => GraphBuilder.addExtension(builder, extension));\n },\n { immediate: true },\n );\n\n // await builder.initialize();\n void Graph.expand(builder.graph, Node.RootId, 'child');\n\n setupDevtools(builder.graph);\n\n return Capability.contributes(\n AppCapabilities.AppGraph,\n { graph: builder.graph, explore: GraphBuilder.explore },\n () =>\n Effect.sync(() => {\n // clearInterval(interval);\n unsubscribe();\n }),\n );\n }),\n);\n\n// Expose the graph to the window for debugging.\nconst setupDevtools = (graph: Graph.ExpandableGraph) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.graph = graph;\n};\n"],
5
+ "mappings": ";AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,OAAOC,cAAcC,YAAY;AAC1C,SAASC,uBAAuB;AAOhC,IAAA,gBAAeJ,WAAWK,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOP,WAAWQ,IAAIT,aAAaU,YAAY;AAChE,QAAMC,yBAAyB,OAAOV,WAAWW,aAAaP,gBAAgBQ,eAAe;AAE7F,QAAMC,UAAUX,aAAaY;;IAAwCC;IAAWR;EAAAA;AAKhF,QAAMS,cAAcT,SAASU,UAC3BP,wBACA,CAACQ,uBAAAA;AACC,UAAMC,OAAwC,CAAA;AAC9C,eAAW,CAACC,UAAUC,UAAAA,KAAeC,OAAOC,QAAQL,kBAAAA,GAAqB;AACvE,iBAAWM,OAAOtB,aAAauB,kBAAkBJ,UAAAA,GAAa;AAC5DF,aAAKO,KAAK;UAAE,GAAGF;UAAKG,IAAI,GAAGP,QAAAA,IAAYI,IAAIG,EAAE;QAAG,CAAA;MAClD;IACF;AACA,UAAMC,UAAiBC,cAAOtB,SAASC,IAAIK,QAAQQ,UAAU,CAAA;AAC7D,UAAMS,UAAUF,QAAQG,OAAO,CAAC,EAAEJ,GAAE,MAAO,CAACR,KAAKa,KAAK,CAAC,EAAEL,IAAIM,OAAM,MAAOA,WAAWN,EAAAA,CAAAA;AACrFG,YAAQI,QAAQ,CAACC,cAAcjC,aAAakC,gBAAgBvB,SAASsB,UAAUR,EAAE,CAAA;AACjFR,SAAKe,QAAQ,CAACC,cAAcjC,aAAamC,aAAaxB,SAASsB,SAAAA,CAAAA;EACjE,GACA;IAAEG,WAAW;EAAK,CAAA;AAIpB,OAAKrC,MAAMsC,OAAO1B,QAAQ2B,OAAOrC,KAAKsC,QAAQ,OAAA;AAE9CC,gBAAc7B,QAAQ2B,KAAK;AAE3B,SAAOxC,WAAW2C,YAChBvC,gBAAgBwC,UAChB;IAAEJ,OAAO3B,QAAQ2B;IAAOK,SAAS3C,aAAa2C;EAAQ,GACtD,MACSC,YAAK,MAAA;AAEV9B,gBAAAA;EACF,CAAA,CAAA;AAEN,CAAA,CAAA;AAIF,IAAM0B,gBAAgB,CAACF,UAAAA;AACpBO,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAASR,QAAQA;AACvC;",
6
+ "names": ["Effect", "Record", "Capabilities", "Capability", "Graph", "GraphBuilder", "Node", "AppCapabilities", "makeModule", "fnUntraced", "registry", "get", "AtomRegistry", "extensionsByModuleAtom", "atomByModule", "AppGraphBuilder", "builder", "from", "undefined", "unsubscribe", "subscribe", "extensionsByModule", "next", "moduleId", "extensions", "Object", "entries", "ext", "flattenExtensions", "push", "id", "current", "values", "removed", "filter", "some", "nextId", "forEach", "extension", "removeExtension", "addExtension", "immediate", "expand", "graph", "RootId", "setupDevtools", "contributes", "AppGraph", "explore", "sync", "globalThis", "composer"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import {
2
+ useActionRunner,
3
+ useActions,
4
+ useConnections,
5
+ useEdges,
6
+ useNode
7
+ } from "../chunk-QECLJ7AR.mjs";
8
+ export {
9
+ useActionRunner,
10
+ useActions,
11
+ useConnections,
12
+ useEdges,
13
+ useNode
14
+ };
15
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,24 @@
1
+ import {
2
+ runAction,
3
+ useActionRunner,
4
+ useActions,
5
+ useConnections,
6
+ useEdges,
7
+ useNode
8
+ } from "./chunk-QECLJ7AR.mjs";
9
+ import {
10
+ meta
11
+ } from "./chunk-Y5TMPZGE.mjs";
12
+
13
+ // src/index.ts
14
+ export * from "@dxos/app-graph";
15
+ export {
16
+ meta,
17
+ runAction,
18
+ useActionRunner,
19
+ useActions,
20
+ useConnections,
21
+ useEdges,
22
+ useNode
23
+ };
24
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from './meta';\n\nexport * from '@dxos/app-graph';\n\nexport * from './action';\n// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.\n// Either refactor callers to not need them or factor them out to a shared package.\nexport * from './hooks';\n"],
5
+ "mappings": ";;;;;;;;;;;;;AAMA,cAAc;",
6
+ "names": []
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"src/meta.ts":{"bytes":1462,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/action.ts":{"bytes":3592,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/useActionRunner.ts":{"bytes":2430,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"../action"}],"format":"esm"},"src/hooks/useNode.ts":{"bytes":5318,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":482,"imports":[{"path":"src/hooks/useActionRunner.ts","kind":"import-statement","original":"./useActionRunner"},{"path":"src/hooks/useNode.ts","kind":"import-statement","original":"./useNode"}],"format":"esm"},"src/index.ts":{"bytes":1068,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"./action"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"}],"format":"esm"},"src/graph.ts":{"bytes":8304,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"format":"esm"},"src/GraphPlugin.ts":{"bytes":2966,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"src/graph.ts","kind":"dynamic-import","original":"./graph"}],"format":"esm"},"src/plugin.ts":{"bytes":850,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/testing.ts":{"bytes":653,"imports":[{"path":"src/GraphPlugin.ts","kind":"import-statement","original":"./GraphPlugin"}],"format":"esm"}},"outputs":{"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":465},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QECLJ7AR.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-Y5TMPZGE.mjs","kind":"import-statement"},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"exports":["meta","runAction","useActionRunner","useActions","useConnections","useEdges","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33}},"bytes":364},"dist/lib/neutral/GraphPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/GraphPlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-S2DLYPRU.mjs","kind":"import-statement"}],"exports":["GraphPlugin","default"],"entryPoint":"src/GraphPlugin.ts","inputs":{},"bytes":178},"dist/lib/neutral/hooks/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/hooks/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-QECLJ7AR.mjs","kind":"import-statement"}],"exports":["useActionRunner","useActions","useConnections","useEdges","useNode"],"entryPoint":"src/hooks/index.ts","inputs":{},"bytes":234},"dist/lib/neutral/chunk-QECLJ7AR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5757},"dist/lib/neutral/chunk-QECLJ7AR.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Function","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/effect","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["runAction","useActionRunner","useActions","useConnections","useEdges","useNode"],"inputs":{"src/hooks/useActionRunner.ts":{"bytesInOutput":397},"src/action.ts":{"bytesInOutput":549},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNode.ts":{"bytesInOutput":703}},"bytes":1900},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-Y5TMPZGE.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":100},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":437},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-Y5TMPZGE.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["GraphPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":108}},"bytes":235},"dist/lib/neutral/chunk-Y5TMPZGE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":730},"dist/lib/neutral/chunk-Y5TMPZGE.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":329}},"bytes":408},"dist/lib/neutral/testing.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/testing.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-S2DLYPRU.mjs","kind":"import-statement"}],"exports":["GraphPlugin"],"entryPoint":"src/testing.ts","inputs":{"src/testing.ts":{"bytesInOutput":0}},"bytes":117},"dist/lib/neutral/chunk-S2DLYPRU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1518},"dist/lib/neutral/chunk-S2DLYPRU.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"dist/lib/neutral/graph-RCKCHDM6.mjs","kind":"dynamic-import"}],"exports":["GraphPlugin","GraphPlugin_default"],"inputs":{"src/GraphPlugin.ts":{"bytesInOutput":556}},"bytes":672},"dist/lib/neutral/graph-RCKCHDM6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4327},"dist/lib/neutral/graph-RCKCHDM6.mjs":{"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Record","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/graph.ts","inputs":{"src/graph.ts":{"bytesInOutput":1712}},"bytes":1811}}}
@@ -0,0 +1,7 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-Y5TMPZGE.mjs";
4
+ export {
5
+ meta
6
+ };
7
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-Y5TMPZGE.mjs";
4
+
5
+ // src/plugin.ts
6
+ import { Plugin } from "@dxos/app-framework";
7
+ var GraphPlugin = Plugin.lazy(meta, () => import("#plugin"));
8
+ export {
9
+ GraphPlugin
10
+ };
11
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/plugin.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const GraphPlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
5
+ "mappings": ";;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,cAAcC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
6
+ "names": ["Plugin", "GraphPlugin", "Plugin", "lazy", "meta"]
7
+ }
@@ -0,0 +1,7 @@
1
+ import {
2
+ GraphPlugin
3
+ } from "./chunk-S2DLYPRU.mjs";
4
+ export {
5
+ GraphPlugin
6
+ };
7
+ //# sourceMappingURL=testing.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,7 +1,9 @@
1
+ import { Plugin } from '@dxos/app-framework';
1
2
  /**
2
3
  * Manages the state of the graph for the application.
3
4
  * Enables other plugins to register node builders to add nodes to the graph.
4
5
  * This includes actions and annotation each other's nodes.
5
6
  */
6
- export declare const GraphPlugin: import("@dxos/app-framework").PluginFactory<void>;
7
+ export declare const GraphPlugin: Plugin.PluginFactory<void>;
8
+ export default GraphPlugin;
7
9
  //# sourceMappingURL=GraphPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GraphPlugin.d.ts","sourceRoot":"","sources":["../../../src/GraphPlugin.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,eAAO,MAAM,WAAW,mDAQtB,CAAC"}
1
+ {"version":3,"file":"GraphPlugin.d.ts","sourceRoot":"","sources":["../../../src/GraphPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAgC,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAO3E;;;;GAIG;AACH,eAAO,MAAM,WAAW,4BAQvB,CAAC;eAEa,WAAW"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=GraphPlugin.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GraphPlugin.test.d.ts","sourceRoot":"","sources":["../../../src/GraphPlugin.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { type CapabilityManager } from '@dxos/app-framework';
2
+ import { type Node } from '@dxos/app-graph';
3
+ import { Operation } from '@dxos/compute';
4
+ /**
5
+ * Run an action with required layers: Operation.Service, Capability.Service, and captured context.
6
+ * @param invoker The operation invoker to use for Operation.Service.
7
+ * @param capabilityManager The capability manager for Capability.Service.
8
+ * @param action The action to execute.
9
+ * @param params Parameters to pass to the action.
10
+ */
11
+ export declare const runAction: (invoker: Operation.OperationService, capabilityManager: CapabilityManager.CapabilityManager, action: Node.Action, params?: Node.InvokeProps) => Promise<void>;
12
+ //# sourceMappingURL=action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/action.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG1C;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,YACX,SAAS,CAAC,gBAAgB,qBAChB,iBAAiB,CAAC,iBAAiB,UAC9C,IAAI,CAAC,MAAM,WACX,IAAI,CAAC,WAAW,KACvB,OAAO,CAAC,IAAI,CASZ,CAAC"}
@@ -1,5 +1,9 @@
1
- import { type PluginContext } from '@dxos/app-framework';
2
- import { GraphBuilder } from '@dxos/app-graph';
3
- declare const _default: (context: PluginContext) => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Readonly<Pick<GraphBuilder, "graph" | "explore">>>>>;
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ import { Graph, GraphBuilder } from '@dxos/app-graph';
4
+ declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Readonly<{
5
+ graph: Graph.ExpandableGraph;
6
+ explore: typeof GraphBuilder.explore;
7
+ }>>>, Error, Capability.Service>;
4
8
  export default _default;
5
9
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAwB,YAAY,EAA8B,MAAM,iBAAiB,CAAC;yBAO3E,SAAS,aAAa;AAA5C,wBA4BE"}
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAQ,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './useActionRunner';
1
2
  export * from './useNode';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type Node } from '@dxos/app-graph';
2
+ /**
3
+ * Hook that returns a function to run action Effects.
4
+ * Provides Operation.Service, PluginContextService, and captured plugin context.
5
+ */
6
+ export declare const useActionRunner: () => (action: Node.Action, params?: Node.InvokeProps) => Promise<void>;
7
+ //# sourceMappingURL=useActionRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActionRunner.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useActionRunner.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,eAAe,iBAKf,IAAI,CAAC,MAAM,WAAU,IAAI,CAAC,WAAW,kBAIjD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type Node, type ReadableGraph, type Relation } from '@dxos/app-graph';
1
+ import { type Graph, type Node } from '@dxos/app-graph';
2
2
  /**
3
3
  * React hook to get a node from the graph.
4
4
  *
@@ -7,7 +7,22 @@ import { type Node, type ReadableGraph, type Relation } from '@dxos/app-graph';
7
7
  * @param timeout Optional timeout in milliseconds to wait for the node to be found.
8
8
  * @returns Node if found, undefined otherwise.
9
9
  */
10
- export declare const useNode: <T = any>(graph: ReadableGraph, id?: string) => Node<T> | undefined;
11
- export declare const useConnections: (graph: ReadableGraph, id?: string, relation?: Relation) => Node[];
12
- export declare const useActions: (graph: ReadableGraph, id?: string) => Node[];
10
+ export declare const useNode: <T = any>(graph: Graph.ReadableGraph, id?: string) => Node.Node<T> | undefined;
11
+ export declare const useConnections: (graph: Graph.ReadableGraph, id: string | undefined, relation: Node.RelationInput) => Node.Node[];
12
+ /**
13
+ * React hook to get actions available for a node.
14
+ *
15
+ * @param graph Graph containing the node.
16
+ * @param id Id of the node.
17
+ * @returns Actions available for the node.
18
+ */
19
+ export declare const useActions: (graph: Graph.ReadableGraph, id?: string) => Node.Node[];
20
+ /**
21
+ * Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content.
22
+ *
23
+ * @param graph Graph containing the node.
24
+ * @param id Id of the node.
25
+ * @returns Edge topology for the node.
26
+ */
27
+ export declare const useEdges: (graph: Graph.ReadableGraph, id?: string) => Graph.Edges;
13
28
  //# sourceMappingURL=useNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNode.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE/E;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,EAAE,OAAO,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAE9E,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,aAAa,EAAE,KAAK,MAAM,EAAE,WAAW,QAAQ,KAAG,IAAI,EAE3F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,EAElE,CAAC"}
1
+ {"version":3,"file":"useNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNode.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,SAAS,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,SAGzF,CAAC;AAEF,eAAO,MAAM,cAAc,UAClB,KAAK,CAAC,aAAa,MACtB,MAAM,GAAG,SAAS,YACZ,IAAI,CAAC,aAAa,KAC3B,IAAI,CAAC,IAAI,EAEX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UAAW,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,IAAI,CAAC,IAAI,EAG7E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,KAAK,CAAC,KAGxE,CAAC"}