@dxos/plugin-graph 0.8.4-main.84f28bd → 0.8.4-main.937b3ca

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 (40) hide show
  1. package/dist/lib/browser/graph-PXKA3JXN.mjs +39 -0
  2. package/dist/lib/browser/graph-PXKA3JXN.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +47 -24
  4. package/dist/lib/browser/index.mjs.map +4 -4
  5. package/dist/lib/browser/meta.json +1 -1
  6. package/dist/lib/node-esm/graph-CR2XR64B.mjs +41 -0
  7. package/dist/lib/node-esm/graph-CR2XR64B.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +47 -24
  9. package/dist/lib/node-esm/index.mjs.map +4 -4
  10. package/dist/lib/node-esm/meta.json +1 -1
  11. package/dist/types/src/GraphPlugin.d.ts +2 -1
  12. package/dist/types/src/GraphPlugin.d.ts.map +1 -1
  13. package/dist/types/src/action.d.ts +12 -0
  14. package/dist/types/src/action.d.ts.map +1 -0
  15. package/dist/types/src/graph.d.ts +7 -6
  16. package/dist/types/src/graph.d.ts.map +1 -1
  17. package/dist/types/src/hooks/index.d.ts +1 -0
  18. package/dist/types/src/hooks/index.d.ts.map +1 -1
  19. package/dist/types/src/hooks/useActionRunner.d.ts +7 -0
  20. package/dist/types/src/hooks/useActionRunner.d.ts.map +1 -0
  21. package/dist/types/src/hooks/useNode.d.ts +4 -4
  22. package/dist/types/src/hooks/useNode.d.ts.map +1 -1
  23. package/dist/types/src/index.d.ts +1 -0
  24. package/dist/types/src/index.d.ts.map +1 -1
  25. package/dist/types/src/meta.d.ts +2 -3
  26. package/dist/types/src/meta.d.ts.map +1 -1
  27. package/dist/types/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +28 -21
  29. package/src/GraphPlugin.ts +12 -11
  30. package/src/action.ts +34 -0
  31. package/src/graph.ts +47 -37
  32. package/src/hooks/index.ts +1 -0
  33. package/src/hooks/useActionRunner.ts +25 -0
  34. package/src/hooks/useNode.ts +9 -9
  35. package/src/index.ts +1 -0
  36. package/src/meta.ts +8 -5
  37. package/dist/lib/browser/graph-IRZE7I2B.mjs +0 -37
  38. package/dist/lib/browser/graph-IRZE7I2B.mjs.map +0 -7
  39. package/dist/lib/node-esm/graph-7HKX6CAT.mjs +0 -39
  40. package/dist/lib/node-esm/graph-7HKX6CAT.mjs.map +0 -7
@@ -0,0 +1,39 @@
1
+ // src/graph.ts
2
+ import * as Effect from "effect/Effect";
3
+ import * as Record from "effect/Record";
4
+ import { Capability, Common } from "@dxos/app-framework";
5
+ import { Graph, GraphBuilder, Node } from "@dxos/app-graph";
6
+ var graph_default = Capability.makeModule(Effect.fnUntraced(function* () {
7
+ const registry = yield* Capability.get(Common.Capability.AtomRegistry);
8
+ const extensionsAtom = yield* Capability.atom(Common.Capability.AppGraphBuilder);
9
+ const builder = GraphBuilder.from(
10
+ /* localStorage.getItem(KEY) ?? */
11
+ void 0,
12
+ registry
13
+ );
14
+ const unsubscribe = registry.subscribe(extensionsAtom, (extensions) => {
15
+ const next = GraphBuilder.flattenExtensions(extensions);
16
+ const current = Record.values(registry.get(builder.extensions));
17
+ const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));
18
+ removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));
19
+ next.forEach((extension) => GraphBuilder.addExtension(builder, extension));
20
+ }, {
21
+ immediate: true
22
+ });
23
+ void Graph.expand(builder.graph, Node.RootId);
24
+ setupDevtools(builder.graph);
25
+ return Capability.contributes(Common.Capability.AppGraph, {
26
+ graph: builder.graph,
27
+ explore: GraphBuilder.explore
28
+ }, () => Effect.sync(() => {
29
+ unsubscribe();
30
+ }));
31
+ }));
32
+ var setupDevtools = (graph) => {
33
+ globalThis.composer ??= {};
34
+ globalThis.composer.graph = graph;
35
+ };
36
+ export {
37
+ graph_default as default
38
+ };
39
+ //# sourceMappingURL=graph-PXKA3JXN.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 { Capability, Common } from '@dxos/app-framework';\nimport { Graph, GraphBuilder, Node } from '@dxos/app-graph';\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(Common.Capability.AtomRegistry);\n const extensionsAtom = yield* Capability.atom(Common.Capability.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 extensionsAtom,\n (extensions) => {\n const next = GraphBuilder.flattenExtensions(extensions);\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);\n\n setupDevtools(builder.graph);\n\n return Capability.contributes(\n Common.Capability.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,YAAYC,cAAc;AACnC,SAASC,OAAOC,cAAcC,YAAY;AAO1C,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,iBAAiB,OAAOP,WAAWQ,KAAKH,OAAOL,WAAWS,eAAe;AAE/E,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWV;EAAAA;AAKhF,QAAMW,cAAcX,SAASY,UAC3BR,gBACA,CAACS,eAAAA;AACC,UAAMC,OAAON,aAAaO,kBAAkBF,UAAAA;AAC5C,UAAMG,UAAiBC,cAAOjB,SAASC,IAAIM,QAAQM,UAAU,CAAA;AAC7D,UAAMK,UAAUF,QAAQG,OAAO,CAAC,EAAEC,GAAE,MAAO,CAACN,KAAKO,KAAK,CAAC,EAAED,IAAIE,OAAM,MAAOA,WAAWF,EAAAA,CAAAA;AACrFF,YAAQK,QAAQ,CAACC,cAAchB,aAAaiB,gBAAgBlB,SAASiB,UAAUJ,EAAE,CAAA;AACjFN,SAAKS,QAAQ,CAACC,cAAchB,aAAakB,aAAanB,SAASiB,SAAAA,CAAAA;EACjE,GACA;IAAEG,WAAW;EAAK,CAAA;AAIpB,OAAKC,MAAMC,OAAOtB,QAAQuB,OAAOC,KAAKC,MAAM;AAE5CC,gBAAc1B,QAAQuB,KAAK;AAE3B,SAAOjC,WAAWqC,YAChBhC,OAAOL,WAAWsC,UAClB;IAAEL,OAAOvB,QAAQuB;IAAOM,SAAS5B,aAAa4B;EAAQ,GACtD,MACSC,YAAK,MAAA;AAEV1B,gBAAAA;EACF,CAAA,CAAA;AAEN,CAAA,CAAA;AAIF,IAAMsB,gBAAgB,CAACH,UAAAA;AACpBQ,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAAST,QAAQA;AACvC;",
6
+ "names": ["Effect", "Record", "Capability", "Common", "Graph", "GraphBuilder", "Node", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "extensionsAtom", "atom", "AppGraphBuilder", "builder", "GraphBuilder", "from", "undefined", "unsubscribe", "subscribe", "extensions", "next", "flattenExtensions", "current", "values", "removed", "filter", "id", "some", "nextId", "forEach", "extension", "removeExtension", "addExtension", "immediate", "Graph", "expand", "graph", "Node", "RootId", "setupDevtools", "contributes", "AppGraph", "explore", "sync", "globalThis", "composer"]
7
+ }
@@ -1,48 +1,71 @@
1
1
  // src/index.ts
2
2
  export * from "@dxos/app-graph";
3
3
 
4
+ // src/action.ts
5
+ import * as Effect from "effect/Effect";
6
+ import * as Function from "effect/Function";
7
+ import { Capability } from "@dxos/app-framework";
8
+ import { runAndForwardErrors } from "@dxos/effect";
9
+ import { Operation } from "@dxos/operation";
10
+ 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));
11
+
4
12
  // src/GraphPlugin.ts
5
- import { defineModule, lazy, Events, definePlugin } from "@dxos/app-framework";
13
+ import { Capability as Capability2, Common, Plugin } from "@dxos/app-framework";
6
14
 
7
15
  // src/meta.ts
8
- var GRAPH_PLUGIN = "dxos.org/plugin/graph";
16
+ import { trim } from "@dxos/util";
9
17
  var meta = {
10
- id: GRAPH_PLUGIN,
11
- name: "Graph"
18
+ id: "dxos.org/plugin/graph",
19
+ name: "Graph",
20
+ description: trim`
21
+ Graph database layer providing relationship modeling and queries for workspace objects.
22
+ Build knowledge graphs and explore complex data relationships.
23
+ `
12
24
  };
13
25
 
14
26
  // src/GraphPlugin.ts
15
- var GraphPlugin = () => definePlugin(meta, [
16
- defineModule({
17
- id: `${meta.id}/module/graph`,
18
- activatesOn: Events.Startup,
19
- activatesBefore: [
20
- Events.SetupAppGraph,
21
- Events.SetupMetadata
22
- ],
23
- activatesAfter: [
24
- Events.AppGraphReady
25
- ],
26
- activate: lazy(() => import("./graph-IRZE7I2B.mjs"))
27
- })
28
- ]);
27
+ var Graph = Capability2.lazy("Graph", () => import("./graph-PXKA3JXN.mjs"));
28
+ var GraphPlugin = Plugin.define(meta).pipe(Plugin.addModule({
29
+ activatesOn: Common.ActivationEvent.Startup,
30
+ activatesBefore: [
31
+ Common.ActivationEvent.SetupAppGraph,
32
+ Common.ActivationEvent.SetupMetadata
33
+ ],
34
+ activatesAfter: [
35
+ Common.ActivationEvent.AppGraphReady
36
+ ],
37
+ activate: Graph
38
+ }), Plugin.make);
39
+
40
+ // src/hooks/useActionRunner.ts
41
+ import { useCallback } from "react";
42
+ import { useOperationInvoker, usePluginManager } from "@dxos/app-framework/react";
43
+ var useActionRunner = () => {
44
+ const invoker = useOperationInvoker();
45
+ const pluginManager = usePluginManager();
46
+ return useCallback((action, params = {}) => runAction(invoker, pluginManager.capabilities, action, params), [
47
+ invoker,
48
+ pluginManager.capabilities
49
+ ]);
50
+ };
29
51
 
30
52
  // src/hooks/useNode.ts
31
- import { useRxValue } from "@effect-rx/rx-react";
32
- import { Option } from "effect";
53
+ import { useAtomValue } from "@effect-atom/atom-react";
54
+ import * as Option from "effect/Option";
33
55
  var useNode = (graph, id) => {
34
- return Option.getOrElse(useRxValue(graph.node(id ?? "")), () => void 0);
56
+ return Option.getOrElse(useAtomValue(graph.node(id ?? "")), () => void 0);
35
57
  };
36
58
  var useConnections = (graph, id, relation) => {
37
- return useRxValue(graph.connections(id ?? "", relation));
59
+ return useAtomValue(graph.connections(id ?? "", relation));
38
60
  };
39
61
  var useActions = (graph, id) => {
40
- return useRxValue(graph.actions(id ?? ""));
62
+ return useAtomValue(graph.actions(id ?? ""));
41
63
  };
42
64
  export {
43
- GRAPH_PLUGIN,
44
65
  GraphPlugin,
45
66
  meta,
67
+ runAction,
68
+ useActionRunner,
46
69
  useActions,
47
70
  useConnections,
48
71
  useNode
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/GraphPlugin.ts", "../../../src/meta.ts", "../../../src/hooks/useNode.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/app-graph';\n\nexport * from './GraphPlugin';\nexport * from './hooks';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineModule, lazy, Events, definePlugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\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 = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/graph`,\n activatesOn: Events.Startup,\n activatesBefore: [Events.SetupAppGraph, Events.SetupMetadata],\n activatesAfter: [Events.AppGraphReady],\n activate: lazy(() => import('./graph')),\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const GRAPH_PLUGIN = 'dxos.org/plugin/graph';\n\nexport const meta: PluginMeta = {\n id: GRAPH_PLUGIN,\n name: 'Graph',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useRxValue } from '@effect-rx/rx-react';\nimport { Option } from 'effect';\n\nimport { type ReadableGraph, type Node, type Relation } 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: ReadableGraph, id?: string): Node<T> | undefined => {\n return Option.getOrElse(useRxValue(graph.node(id ?? '')), () => undefined);\n};\n\nexport const useConnections = (graph: ReadableGraph, id?: string, relation?: Relation): Node[] => {\n return useRxValue(graph.connections(id ?? '', relation));\n};\n\nexport const useActions = (graph: ReadableGraph, id?: string): Node[] => {\n return useRxValue(graph.actions(id ?? ''));\n};\n"],
5
- "mappings": ";AAIA,cAAc;;;ACAd,SAASA,cAAcC,MAAMC,QAAQC,oBAAoB;;;ACElD,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;;;ADEO,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,iBAAiB;MAACF,OAAOG;MAAeH,OAAOI;;IAC/CC,gBAAgB;MAACL,OAAOM;;IACxBC,UAAUC,KAAK,MAAM,OAAO,sBAAA,CAAA;EAC9B,CAAA;CACD;;;AElBH,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AAahB,IAAMC,UAAU,CAAUC,OAAsBC,OAAAA;AACrD,SAAOC,OAAOC,UAAUC,WAAWJ,MAAMK,KAAKJ,MAAM,EAAA,CAAA,GAAM,MAAMK,MAAAA;AAClE;AAEO,IAAMC,iBAAiB,CAACP,OAAsBC,IAAaO,aAAAA;AAChE,SAAOJ,WAAWJ,MAAMS,YAAYR,MAAM,IAAIO,QAAAA,CAAAA;AAChD;AAEO,IAAME,aAAa,CAACV,OAAsBC,OAAAA;AAC/C,SAAOG,WAAWJ,MAAMW,QAAQV,MAAM,EAAA,CAAA;AACxC;",
6
- "names": ["defineModule", "lazy", "Events", "definePlugin", "GRAPH_PLUGIN", "meta", "id", "name", "GraphPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "lazy", "useRxValue", "Option", "useNode", "graph", "id", "Option", "getOrElse", "useRxValue", "node", "undefined", "useConnections", "relation", "connections", "useActions", "actions"]
3
+ "sources": ["../../../src/index.ts", "../../../src/action.ts", "../../../src/GraphPlugin.ts", "../../../src/meta.ts", "../../../src/hooks/useActionRunner.ts", "../../../src/hooks/useNode.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/app-graph';\n\nexport * from './action';\nexport * from './GraphPlugin';\nexport * from './hooks';\nexport * from './meta';\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 { runAndForwardErrors } from '@dxos/effect';\nimport { Operation, type OperationInvoker } from '@dxos/operation';\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: OperationInvoker.OperationInvoker,\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 2025 DXOS.org\n//\n\nimport { Capability, Common, Plugin } from '@dxos/app-framework';\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: Common.ActivationEvent.Startup,\n activatesBefore: [Common.ActivationEvent.SetupAppGraph, Common.ActivationEvent.SetupMetadata],\n activatesAfter: [Common.ActivationEvent.AppGraphReady],\n activate: Graph,\n }),\n Plugin.make,\n);\n", "//\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: 'dxos.org/plugin/graph',\n name: 'Graph',\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};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { useOperationInvoker, usePluginManager } from '@dxos/app-framework/react';\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 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\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 return Option.getOrElse(useAtomValue(graph.node(id ?? '')), () => undefined);\n};\n\nexport const useConnections = (graph: Graph.ReadableGraph, id?: string, relation?: Node.Relation): Node.Node[] => {\n return useAtomValue(graph.connections(id ?? '', relation));\n};\n\nexport const useActions = (graph: Graph.ReadableGraph, id?: string): Node.Node[] => {\n return useAtomValue(graph.actions(id ?? ''));\n};\n"],
5
+ "mappings": ";AAIA,cAAc;;;ACAd,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,kBAA0C;AAEnD,SAASC,2BAA2B;AACpC,SAASC,iBAAwC;AAS1C,IAAMC,YAAY,OACvBC,SACAC,mBACAC,QACAC,SAA2B,CAAC,MAE5BC,oBACEF,OACGG,KAAKF,MAAAA,EACLG,KACQC,sBAAeC,UAAUC,SAAST,OAAAA,GAClCO,sBAAeG,WAAWD,SAASR,iBAAAA,GAC1CC,OAAOS,iBAAwBC,eAAQV,OAAOS,cAAc,IAAaE,iBAAQ,CAAA;;;AC3BzF,SAASC,cAAAA,aAAYC,QAAQC,cAAc;;;ACC3C,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;ADNA,IAAMC,QAAQC,YAAWC,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;AAO7C,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CH,OAAOI,UAAU;EACfC,aAAaC,OAAOC,gBAAgBC;EACpCC,iBAAiB;IAACH,OAAOC,gBAAgBG;IAAeJ,OAAOC,gBAAgBI;;EAC/EC,gBAAgB;IAACN,OAAOC,gBAAgBM;;EACxCC,UAAUlB;AACZ,CAAA,GACAI,OAAOe,IAAI;;;AElBb,SAASC,mBAAmB;AAE5B,SAASC,qBAAqBC,wBAAwB;AAS/C,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;;;ACpBA,SAASC,oBAAoB;AAC7B,YAAYC,YAAY;AAajB,IAAMC,UAAU,CAAUC,OAA4BC,OAAAA;AAC3D,SAAcC,iBAAUC,aAAaH,MAAMI,KAAKH,MAAM,EAAA,CAAA,GAAM,MAAMI,MAAAA;AACpE;AAEO,IAAMC,iBAAiB,CAACN,OAA4BC,IAAaM,aAAAA;AACtE,SAAOJ,aAAaH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAClD;AAEO,IAAME,aAAa,CAACT,OAA4BC,OAAAA;AACrD,SAAOE,aAAaH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AAC1C;",
6
+ "names": ["Effect", "Function", "Capability", "runAndForwardErrors", "Operation", "runAction", "invoker", "capabilityManager", "action", "params", "runAndForwardErrors", "data", "pipe", "provideService", "Operation", "Service", "Capability", "_actionContext", "provide", "identity", "Capability", "Common", "Plugin", "trim", "meta", "id", "name", "description", "trim", "Graph", "Capability", "lazy", "GraphPlugin", "Plugin", "define", "meta", "pipe", "addModule", "activatesOn", "Common", "ActivationEvent", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "make", "useCallback", "useOperationInvoker", "usePluginManager", "useActionRunner", "invoker", "useOperationInvoker", "pluginManager", "usePluginManager", "useCallback", "action", "params", "runAction", "capabilities", "useAtomValue", "Option", "useNode", "graph", "id", "getOrElse", "useAtomValue", "node", "undefined", "useConnections", "relation", "connections", "useActions", "actions"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":901,"imports":[],"format":"esm"},"src/graph.ts":{"bytes":6304,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"format":"esm"},"src/GraphPlugin.ts":{"bytes":2737,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/graph.ts","kind":"dynamic-import","original":"./graph"}],"format":"esm"},"src/hooks/useNode.ts":{"bytes":3124,"imports":[{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":461,"imports":[{"path":"src/hooks/useNode.ts","kind":"import-statement","original":"./useNode"}],"format":"esm"},"src/index.ts":{"bytes":733,"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"src/GraphPlugin.ts","kind":"import-statement","original":"./GraphPlugin"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3458},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/graph-IRZE7I2B.mjs","kind":"dynamic-import"},{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["GRAPH_PLUGIN","GraphPlugin","meta","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/GraphPlugin.ts":{"bytesInOutput":417},"src/meta.ts":{"bytesInOutput":96},"src/hooks/useNode.ts":{"bytesInOutput":386},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":1163},"dist/lib/browser/graph-IRZE7I2B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3328},"dist/lib/browser/graph-IRZE7I2B.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/graph.ts","inputs":{"src/graph.ts":{"bytesInOutput":1200}},"bytes":1299}}}
1
+ {"inputs":{"src/action.ts":{"bytes":3719,"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/effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1365,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/graph.ts":{"bytes":7168,"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}],"format":"esm"},"src/GraphPlugin.ts":{"bytes":2920,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/graph.ts","kind":"dynamic-import","original":"./graph"}],"format":"esm"},"src/hooks/useActionRunner.ts":{"bytes":2537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"../action"}],"format":"esm"},"src/hooks/useNode.ts":{"bytes":3188,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":568,"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":815,"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"./action"},{"path":"src/GraphPlugin.ts","kind":"import-statement","original":"./GraphPlugin"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6964},"dist/lib/browser/index.mjs":{"imports":[{"path":"@dxos/app-graph","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/effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/browser/graph-PXKA3JXN.mjs","kind":"dynamic-import"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"exports":["GraphPlugin","meta","runAction","useActionRunner","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/action.ts":{"bytesInOutput":551},"src/GraphPlugin.ts":{"bytesInOutput":478},"src/meta.ts":{"bytesInOutput":283},"src/hooks/useActionRunner.ts":{"bytesInOutput":400},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNode.ts":{"bytesInOutput":406}},"bytes":2449},"dist/lib/browser/graph-PXKA3JXN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3743},"dist/lib/browser/graph-PXKA3JXN.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}],"exports":["default"],"entryPoint":"src/graph.ts","inputs":{"src/graph.ts":{"bytesInOutput":1410}},"bytes":1509}}}
@@ -0,0 +1,41 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/graph.ts
4
+ import * as Effect from "effect/Effect";
5
+ import * as Record from "effect/Record";
6
+ import { Capability, Common } from "@dxos/app-framework";
7
+ import { Graph, GraphBuilder, Node } from "@dxos/app-graph";
8
+ var graph_default = Capability.makeModule(Effect.fnUntraced(function* () {
9
+ const registry = yield* Capability.get(Common.Capability.AtomRegistry);
10
+ const extensionsAtom = yield* Capability.atom(Common.Capability.AppGraphBuilder);
11
+ const builder = GraphBuilder.from(
12
+ /* localStorage.getItem(KEY) ?? */
13
+ void 0,
14
+ registry
15
+ );
16
+ const unsubscribe = registry.subscribe(extensionsAtom, (extensions) => {
17
+ const next = GraphBuilder.flattenExtensions(extensions);
18
+ const current = Record.values(registry.get(builder.extensions));
19
+ const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));
20
+ removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));
21
+ next.forEach((extension) => GraphBuilder.addExtension(builder, extension));
22
+ }, {
23
+ immediate: true
24
+ });
25
+ void Graph.expand(builder.graph, Node.RootId);
26
+ setupDevtools(builder.graph);
27
+ return Capability.contributes(Common.Capability.AppGraph, {
28
+ graph: builder.graph,
29
+ explore: GraphBuilder.explore
30
+ }, () => Effect.sync(() => {
31
+ unsubscribe();
32
+ }));
33
+ }));
34
+ var setupDevtools = (graph) => {
35
+ globalThis.composer ??= {};
36
+ globalThis.composer.graph = graph;
37
+ };
38
+ export {
39
+ graph_default as default
40
+ };
41
+ //# sourceMappingURL=graph-CR2XR64B.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 { Capability, Common } from '@dxos/app-framework';\nimport { Graph, GraphBuilder, Node } from '@dxos/app-graph';\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(Common.Capability.AtomRegistry);\n const extensionsAtom = yield* Capability.atom(Common.Capability.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 extensionsAtom,\n (extensions) => {\n const next = GraphBuilder.flattenExtensions(extensions);\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);\n\n setupDevtools(builder.graph);\n\n return Capability.contributes(\n Common.Capability.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,YAAYC,cAAc;AACnC,SAASC,OAAOC,cAAcC,YAAY;AAO1C,IAAA,gBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,OAAOL,WAAWM,YAAY;AACrE,QAAMC,iBAAiB,OAAOP,WAAWQ,KAAKH,OAAOL,WAAWS,eAAe;AAE/E,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWV;EAAAA;AAKhF,QAAMW,cAAcX,SAASY,UAC3BR,gBACA,CAACS,eAAAA;AACC,UAAMC,OAAON,aAAaO,kBAAkBF,UAAAA;AAC5C,UAAMG,UAAiBC,cAAOjB,SAASC,IAAIM,QAAQM,UAAU,CAAA;AAC7D,UAAMK,UAAUF,QAAQG,OAAO,CAAC,EAAEC,GAAE,MAAO,CAACN,KAAKO,KAAK,CAAC,EAAED,IAAIE,OAAM,MAAOA,WAAWF,EAAAA,CAAAA;AACrFF,YAAQK,QAAQ,CAACC,cAAchB,aAAaiB,gBAAgBlB,SAASiB,UAAUJ,EAAE,CAAA;AACjFN,SAAKS,QAAQ,CAACC,cAAchB,aAAakB,aAAanB,SAASiB,SAAAA,CAAAA;EACjE,GACA;IAAEG,WAAW;EAAK,CAAA;AAIpB,OAAKC,MAAMC,OAAOtB,QAAQuB,OAAOC,KAAKC,MAAM;AAE5CC,gBAAc1B,QAAQuB,KAAK;AAE3B,SAAOjC,WAAWqC,YAChBhC,OAAOL,WAAWsC,UAClB;IAAEL,OAAOvB,QAAQuB;IAAOM,SAAS5B,aAAa4B;EAAQ,GACtD,MACSC,YAAK,MAAA;AAEV1B,gBAAAA;EACF,CAAA,CAAA;AAEN,CAAA,CAAA;AAIF,IAAMsB,gBAAgB,CAACH,UAAAA;AACpBQ,aAAmBC,aAAa,CAAC;AACjCD,aAAmBC,SAAST,QAAQA;AACvC;",
6
+ "names": ["Effect", "Record", "Capability", "Common", "Graph", "GraphBuilder", "Node", "Capability", "makeModule", "fnUntraced", "registry", "get", "Common", "AtomRegistry", "extensionsAtom", "atom", "AppGraphBuilder", "builder", "GraphBuilder", "from", "undefined", "unsubscribe", "subscribe", "extensions", "next", "flattenExtensions", "current", "values", "removed", "filter", "id", "some", "nextId", "forEach", "extension", "removeExtension", "addExtension", "immediate", "Graph", "expand", "graph", "Node", "RootId", "setupDevtools", "contributes", "AppGraph", "explore", "sync", "globalThis", "composer"]
7
+ }
@@ -3,48 +3,71 @@ import { createRequire } from 'node:module';const require = createRequire(import
3
3
  // src/index.ts
4
4
  export * from "@dxos/app-graph";
5
5
 
6
+ // src/action.ts
7
+ import * as Effect from "effect/Effect";
8
+ import * as Function from "effect/Function";
9
+ import { Capability } from "@dxos/app-framework";
10
+ import { runAndForwardErrors } from "@dxos/effect";
11
+ import { Operation } from "@dxos/operation";
12
+ 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));
13
+
6
14
  // src/GraphPlugin.ts
7
- import { defineModule, lazy, Events, definePlugin } from "@dxos/app-framework";
15
+ import { Capability as Capability2, Common, Plugin } from "@dxos/app-framework";
8
16
 
9
17
  // src/meta.ts
10
- var GRAPH_PLUGIN = "dxos.org/plugin/graph";
18
+ import { trim } from "@dxos/util";
11
19
  var meta = {
12
- id: GRAPH_PLUGIN,
13
- name: "Graph"
20
+ id: "dxos.org/plugin/graph",
21
+ name: "Graph",
22
+ description: trim`
23
+ Graph database layer providing relationship modeling and queries for workspace objects.
24
+ Build knowledge graphs and explore complex data relationships.
25
+ `
14
26
  };
15
27
 
16
28
  // src/GraphPlugin.ts
17
- var GraphPlugin = () => definePlugin(meta, [
18
- defineModule({
19
- id: `${meta.id}/module/graph`,
20
- activatesOn: Events.Startup,
21
- activatesBefore: [
22
- Events.SetupAppGraph,
23
- Events.SetupMetadata
24
- ],
25
- activatesAfter: [
26
- Events.AppGraphReady
27
- ],
28
- activate: lazy(() => import("./graph-7HKX6CAT.mjs"))
29
- })
30
- ]);
29
+ var Graph = Capability2.lazy("Graph", () => import("./graph-CR2XR64B.mjs"));
30
+ var GraphPlugin = Plugin.define(meta).pipe(Plugin.addModule({
31
+ activatesOn: Common.ActivationEvent.Startup,
32
+ activatesBefore: [
33
+ Common.ActivationEvent.SetupAppGraph,
34
+ Common.ActivationEvent.SetupMetadata
35
+ ],
36
+ activatesAfter: [
37
+ Common.ActivationEvent.AppGraphReady
38
+ ],
39
+ activate: Graph
40
+ }), Plugin.make);
41
+
42
+ // src/hooks/useActionRunner.ts
43
+ import { useCallback } from "react";
44
+ import { useOperationInvoker, usePluginManager } from "@dxos/app-framework/react";
45
+ var useActionRunner = () => {
46
+ const invoker = useOperationInvoker();
47
+ const pluginManager = usePluginManager();
48
+ return useCallback((action, params = {}) => runAction(invoker, pluginManager.capabilities, action, params), [
49
+ invoker,
50
+ pluginManager.capabilities
51
+ ]);
52
+ };
31
53
 
32
54
  // src/hooks/useNode.ts
33
- import { useRxValue } from "@effect-rx/rx-react";
34
- import { Option } from "effect";
55
+ import { useAtomValue } from "@effect-atom/atom-react";
56
+ import * as Option from "effect/Option";
35
57
  var useNode = (graph, id) => {
36
- return Option.getOrElse(useRxValue(graph.node(id ?? "")), () => void 0);
58
+ return Option.getOrElse(useAtomValue(graph.node(id ?? "")), () => void 0);
37
59
  };
38
60
  var useConnections = (graph, id, relation) => {
39
- return useRxValue(graph.connections(id ?? "", relation));
61
+ return useAtomValue(graph.connections(id ?? "", relation));
40
62
  };
41
63
  var useActions = (graph, id) => {
42
- return useRxValue(graph.actions(id ?? ""));
64
+ return useAtomValue(graph.actions(id ?? ""));
43
65
  };
44
66
  export {
45
- GRAPH_PLUGIN,
46
67
  GraphPlugin,
47
68
  meta,
69
+ runAction,
70
+ useActionRunner,
48
71
  useActions,
49
72
  useConnections,
50
73
  useNode
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/index.ts", "../../../src/GraphPlugin.ts", "../../../src/meta.ts", "../../../src/hooks/useNode.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/app-graph';\n\nexport * from './GraphPlugin';\nexport * from './hooks';\nexport * from './meta';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineModule, lazy, Events, definePlugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\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 = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/graph`,\n activatesOn: Events.Startup,\n activatesBefore: [Events.SetupAppGraph, Events.SetupMetadata],\n activatesAfter: [Events.AppGraphReady],\n activate: lazy(() => import('./graph')),\n }),\n ]);\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const GRAPH_PLUGIN = 'dxos.org/plugin/graph';\n\nexport const meta: PluginMeta = {\n id: GRAPH_PLUGIN,\n name: 'Graph',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useRxValue } from '@effect-rx/rx-react';\nimport { Option } from 'effect';\n\nimport { type ReadableGraph, type Node, type Relation } 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: ReadableGraph, id?: string): Node<T> | undefined => {\n return Option.getOrElse(useRxValue(graph.node(id ?? '')), () => undefined);\n};\n\nexport const useConnections = (graph: ReadableGraph, id?: string, relation?: Relation): Node[] => {\n return useRxValue(graph.connections(id ?? '', relation));\n};\n\nexport const useActions = (graph: ReadableGraph, id?: string): Node[] => {\n return useRxValue(graph.actions(id ?? ''));\n};\n"],
5
- "mappings": ";;;AAIA,cAAc;;;ACAd,SAASA,cAAcC,MAAMC,QAAQC,oBAAoB;;;ACElD,IAAMC,eAAe;AAErB,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;AACR;;;ADEO,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,iBAAiB;MAACF,OAAOG;MAAeH,OAAOI;;IAC/CC,gBAAgB;MAACL,OAAOM;;IACxBC,UAAUC,KAAK,MAAM,OAAO,sBAAA,CAAA;EAC9B,CAAA;CACD;;;AElBH,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AAahB,IAAMC,UAAU,CAAUC,OAAsBC,OAAAA;AACrD,SAAOC,OAAOC,UAAUC,WAAWJ,MAAMK,KAAKJ,MAAM,EAAA,CAAA,GAAM,MAAMK,MAAAA;AAClE;AAEO,IAAMC,iBAAiB,CAACP,OAAsBC,IAAaO,aAAAA;AAChE,SAAOJ,WAAWJ,MAAMS,YAAYR,MAAM,IAAIO,QAAAA,CAAAA;AAChD;AAEO,IAAME,aAAa,CAACV,OAAsBC,OAAAA;AAC/C,SAAOG,WAAWJ,MAAMW,QAAQV,MAAM,EAAA,CAAA;AACxC;",
6
- "names": ["defineModule", "lazy", "Events", "definePlugin", "GRAPH_PLUGIN", "meta", "id", "name", "GraphPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "lazy", "useRxValue", "Option", "useNode", "graph", "id", "Option", "getOrElse", "useRxValue", "node", "undefined", "useConnections", "relation", "connections", "useActions", "actions"]
3
+ "sources": ["../../../src/index.ts", "../../../src/action.ts", "../../../src/GraphPlugin.ts", "../../../src/meta.ts", "../../../src/hooks/useActionRunner.ts", "../../../src/hooks/useNode.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nexport * from '@dxos/app-graph';\n\nexport * from './action';\nexport * from './GraphPlugin';\nexport * from './hooks';\nexport * from './meta';\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 { runAndForwardErrors } from '@dxos/effect';\nimport { Operation, type OperationInvoker } from '@dxos/operation';\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: OperationInvoker.OperationInvoker,\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 2025 DXOS.org\n//\n\nimport { Capability, Common, Plugin } from '@dxos/app-framework';\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: Common.ActivationEvent.Startup,\n activatesBefore: [Common.ActivationEvent.SetupAppGraph, Common.ActivationEvent.SetupMetadata],\n activatesAfter: [Common.ActivationEvent.AppGraphReady],\n activate: Graph,\n }),\n Plugin.make,\n);\n", "//\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: 'dxos.org/plugin/graph',\n name: 'Graph',\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};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { useCallback } from 'react';\n\nimport { useOperationInvoker, usePluginManager } from '@dxos/app-framework/react';\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 2024 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport * as Option from 'effect/Option';\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 return Option.getOrElse(useAtomValue(graph.node(id ?? '')), () => undefined);\n};\n\nexport const useConnections = (graph: Graph.ReadableGraph, id?: string, relation?: Node.Relation): Node.Node[] => {\n return useAtomValue(graph.connections(id ?? '', relation));\n};\n\nexport const useActions = (graph: Graph.ReadableGraph, id?: string): Node.Node[] => {\n return useAtomValue(graph.actions(id ?? ''));\n};\n"],
5
+ "mappings": ";;;AAIA,cAAc;;;ACAd,YAAYA,YAAY;AACxB,YAAYC,cAAc;AAE1B,SAASC,kBAA0C;AAEnD,SAASC,2BAA2B;AACpC,SAASC,iBAAwC;AAS1C,IAAMC,YAAY,OACvBC,SACAC,mBACAC,QACAC,SAA2B,CAAC,MAE5BC,oBACEF,OACGG,KAAKF,MAAAA,EACLG,KACQC,sBAAeC,UAAUC,SAAST,OAAAA,GAClCO,sBAAeG,WAAWD,SAASR,iBAAAA,GAC1CC,OAAOS,iBAAwBC,eAAQV,OAAOS,cAAc,IAAaE,iBAAQ,CAAA;;;AC3BzF,SAASC,cAAAA,aAAYC,QAAQC,cAAc;;;ACC3C,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;ADNA,IAAMC,QAAQC,YAAWC,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;AAO7C,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CH,OAAOI,UAAU;EACfC,aAAaC,OAAOC,gBAAgBC;EACpCC,iBAAiB;IAACH,OAAOC,gBAAgBG;IAAeJ,OAAOC,gBAAgBI;;EAC/EC,gBAAgB;IAACN,OAAOC,gBAAgBM;;EACxCC,UAAUlB;AACZ,CAAA,GACAI,OAAOe,IAAI;;;AElBb,SAASC,mBAAmB;AAE5B,SAASC,qBAAqBC,wBAAwB;AAS/C,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;;;ACpBA,SAASC,oBAAoB;AAC7B,YAAYC,YAAY;AAajB,IAAMC,UAAU,CAAUC,OAA4BC,OAAAA;AAC3D,SAAcC,iBAAUC,aAAaH,MAAMI,KAAKH,MAAM,EAAA,CAAA,GAAM,MAAMI,MAAAA;AACpE;AAEO,IAAMC,iBAAiB,CAACN,OAA4BC,IAAaM,aAAAA;AACtE,SAAOJ,aAAaH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAClD;AAEO,IAAME,aAAa,CAACT,OAA4BC,OAAAA;AACrD,SAAOE,aAAaH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AAC1C;",
6
+ "names": ["Effect", "Function", "Capability", "runAndForwardErrors", "Operation", "runAction", "invoker", "capabilityManager", "action", "params", "runAndForwardErrors", "data", "pipe", "provideService", "Operation", "Service", "Capability", "_actionContext", "provide", "identity", "Capability", "Common", "Plugin", "trim", "meta", "id", "name", "description", "trim", "Graph", "Capability", "lazy", "GraphPlugin", "Plugin", "define", "meta", "pipe", "addModule", "activatesOn", "Common", "ActivationEvent", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "make", "useCallback", "useOperationInvoker", "usePluginManager", "useActionRunner", "invoker", "useOperationInvoker", "pluginManager", "usePluginManager", "useCallback", "action", "params", "runAction", "capabilities", "useAtomValue", "Option", "useNode", "graph", "id", "getOrElse", "useAtomValue", "node", "undefined", "useConnections", "relation", "connections", "useActions", "actions"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":901,"imports":[],"format":"esm"},"src/graph.ts":{"bytes":6304,"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"format":"esm"},"src/GraphPlugin.ts":{"bytes":2737,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/graph.ts","kind":"dynamic-import","original":"./graph"}],"format":"esm"},"src/hooks/useNode.ts":{"bytes":3124,"imports":[{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":461,"imports":[{"path":"src/hooks/useNode.ts","kind":"import-statement","original":"./useNode"}],"format":"esm"},"src/index.ts":{"bytes":733,"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"src/GraphPlugin.ts","kind":"import-statement","original":"./GraphPlugin"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3460},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/graph-7HKX6CAT.mjs","kind":"dynamic-import"},{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["GRAPH_PLUGIN","GraphPlugin","meta","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/GraphPlugin.ts":{"bytesInOutput":417},"src/meta.ts":{"bytesInOutput":96},"src/hooks/useNode.ts":{"bytesInOutput":386},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":1256},"dist/lib/node-esm/graph-7HKX6CAT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3330},"dist/lib/node-esm/graph-7HKX6CAT.mjs":{"imports":[{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-graph","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/graph.ts","inputs":{"src/graph.ts":{"bytesInOutput":1200}},"bytes":1392}}}
1
+ {"inputs":{"src/action.ts":{"bytes":3719,"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/effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1365,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/graph.ts":{"bytes":7168,"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}],"format":"esm"},"src/GraphPlugin.ts":{"bytes":2920,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/graph.ts","kind":"dynamic-import","original":"./graph"}],"format":"esm"},"src/hooks/useActionRunner.ts":{"bytes":2537,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"../action"}],"format":"esm"},"src/hooks/useNode.ts":{"bytes":3188,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"format":"esm"},"src/hooks/index.ts":{"bytes":568,"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":815,"imports":[{"path":"@dxos/app-graph","kind":"import-statement","external":true},{"path":"src/action.ts","kind":"import-statement","original":"./action"},{"path":"src/GraphPlugin.ts","kind":"import-statement","original":"./GraphPlugin"},{"path":"src/hooks/index.ts","kind":"import-statement","original":"./hooks"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6966},"dist/lib/node-esm/index.mjs":{"imports":[{"path":"@dxos/app-graph","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/effect","kind":"import-statement","external":true},{"path":"@dxos/operation","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/graph-CR2XR64B.mjs","kind":"dynamic-import"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/react","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"exports":["GraphPlugin","meta","runAction","useActionRunner","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/action.ts":{"bytesInOutput":551},"src/GraphPlugin.ts":{"bytesInOutput":478},"src/meta.ts":{"bytesInOutput":283},"src/hooks/useActionRunner.ts":{"bytesInOutput":400},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNode.ts":{"bytesInOutput":406}},"bytes":2542},"dist/lib/node-esm/graph-CR2XR64B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3745},"dist/lib/node-esm/graph-CR2XR64B.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}],"exports":["default"],"entryPoint":"src/graph.ts","inputs":{"src/graph.ts":{"bytesInOutput":1410}},"bytes":1602}}}
@@ -1,7 +1,8 @@
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").Plugin;
7
+ export declare const GraphPlugin: Plugin.PluginFactory<void>;
7
8
  //# 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,4CASpB,CAAC"}
1
+ {"version":3,"file":"GraphPlugin.d.ts","sourceRoot":"","sources":["../../../src/GraphPlugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAMjE;;;;GAIG;AACH,eAAO,MAAM,WAAW,4BAQvB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { type CapabilityManager } from '@dxos/app-framework';
2
+ import { type Node } from '@dxos/app-graph';
3
+ import { type OperationInvoker } from '@dxos/operation';
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: OperationInvoker.OperationInvoker, 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;AAE5C,OAAO,EAAa,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnE;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GACpB,SAAS,gBAAgB,CAAC,gBAAgB,EAC1C,mBAAmB,iBAAiB,CAAC,iBAAiB,EACtD,QAAQ,IAAI,CAAC,MAAM,EACnB,SAAQ,IAAI,CAAC,WAAgB,KAC5B,OAAO,CAAC,IAAI,CASZ,CAAC"}
@@ -1,8 +1,9 @@
1
- import { type PluginContext } from '@dxos/app-framework';
2
- import { type ExpandableGraph } from '@dxos/app-graph';
3
- declare const _default: (context: PluginContext) => Promise<import("@dxos/app-framework").Capability<{
4
- graph: ExpandableGraph;
5
- explore: ({ registry, source, relation, visitor }: import("@dxos/app-graph").GraphBuilderTraverseOptions, path?: string[]) => Promise<void>;
6
- }>>;
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ import { GraphBuilder } from '@dxos/app-graph';
4
+ declare const _default: (props?: void | undefined) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Readonly<{
5
+ graph: GraphBuilder.GraphBuilder["graph"];
6
+ explore: typeof GraphBuilder.explore;
7
+ }>>>, Error, Capability.Service>;
7
8
  export default _default;
8
9
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAMA,OAAO,EAA6B,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAmC,KAAK,eAAe,EAAW,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,EAAE,UAAU,EAAU,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAS,YAAY,EAAQ,MAAM,iBAAiB,CAAC;;;;;AAO5D,wBAqCE"}
@@ -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 ReadableGraph, type Node, 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,7 @@ import { type ReadableGraph, type Node, 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, relation?: Node.Relation) => Node.Node[];
12
+ export declare const useActions: (graph: Graph.ReadableGraph, id?: string) => Node.Node[];
13
13
  //# 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,aAAa,EAAE,KAAK,IAAI,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":"AAOA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,EAAE,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,SAEzF,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,MAAM,EAAE,WAAW,IAAI,CAAC,QAAQ,KAAG,IAAI,CAAC,IAAI,EAE3G,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,CAAC,IAAI,EAE7E,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from '@dxos/app-graph';
2
+ export * from './action';
2
3
  export * from './GraphPlugin';
3
4
  export * from './hooks';
4
5
  export * from './meta';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAEhC,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,iBAAiB,CAAC;AAEhC,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
@@ -1,4 +1,3 @@
1
- import { type PluginMeta } from '@dxos/app-framework';
2
- export declare const GRAPH_PLUGIN = "dxos.org/plugin/graph";
3
- export declare const meta: PluginMeta;
1
+ import { type Plugin } from '@dxos/app-framework';
2
+ export declare const meta: Plugin.Meta;
4
3
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAEpD,eAAO,MAAM,IAAI,EAAE,UAGlB,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAGlD,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,IAOzB,CAAC"}