@dxos/plugin-graph 0.8.4-main.c4373fc → 0.8.4-main.d05673bc65

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-MX5UQYEY.mjs +40 -0
  2. package/dist/lib/browser/graph-MX5UQYEY.mjs.map +7 -0
  3. package/dist/lib/browser/index.mjs +51 -21
  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-2RMPUX7I.mjs +42 -0
  7. package/dist/lib/node-esm/graph-2RMPUX7I.mjs.map +7 -0
  8. package/dist/lib/node-esm/index.mjs +51 -21
  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 -3
  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 +6 -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 -2
  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 -9
  30. package/src/action.ts +34 -0
  31. package/src/graph.ts +45 -34
  32. package/src/hooks/index.ts +1 -0
  33. package/src/hooks/useActionRunner.ts +25 -0
  34. package/src/hooks/useNode.ts +17 -8
  35. package/src/index.ts +1 -0
  36. package/src/meta.ts +8 -3
  37. package/dist/lib/browser/graph-2RPEFHFK.mjs +0 -38
  38. package/dist/lib/browser/graph-2RPEFHFK.mjs.map +0 -7
  39. package/dist/lib/node-esm/graph-MKDJSVDV.mjs +0 -40
  40. package/dist/lib/node-esm/graph-MKDJSVDV.mjs.map +0 -7
@@ -0,0 +1,40 @@
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 extensionsAtom = yield* Capability.atom(AppCapabilities.AppGraphBuilder);
10
+ const builder = GraphBuilder.from(
11
+ /* localStorage.getItem(KEY) ?? */
12
+ void 0,
13
+ registry
14
+ );
15
+ const unsubscribe = registry.subscribe(extensionsAtom, (extensions) => {
16
+ const next = GraphBuilder.flattenExtensions(extensions);
17
+ const current = Record.values(registry.get(builder.extensions));
18
+ const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));
19
+ removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));
20
+ next.forEach((extension) => GraphBuilder.addExtension(builder, extension));
21
+ }, {
22
+ immediate: true
23
+ });
24
+ void Graph.expand(builder.graph, Node.RootId, "child");
25
+ setupDevtools(builder.graph);
26
+ return Capability.contributes(AppCapabilities.AppGraph, {
27
+ graph: builder.graph,
28
+ explore: GraphBuilder.explore
29
+ }, () => Effect.sync(() => {
30
+ unsubscribe();
31
+ }));
32
+ }));
33
+ var setupDevtools = (graph) => {
34
+ globalThis.composer ??= {};
35
+ globalThis.composer.graph = graph;
36
+ };
37
+ export {
38
+ graph_default as default
39
+ };
40
+ //# sourceMappingURL=graph-MX5UQYEY.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 extensionsAtom = yield* Capability.atom(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 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, '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,gBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,aAAaC,YAAY;AAChE,QAAMC,iBAAiB,OAAOP,WAAWQ,KAAKC,gBAAgBC,eAAe;AAE7E,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWX;EAAAA;AAKhF,QAAMY,cAAcZ,SAASa,UAC3BT,gBACA,CAACU,eAAAA;AACC,UAAMC,OAAON,aAAaO,kBAAkBF,UAAAA;AAC5C,UAAMG,UAAiBC,cAAOlB,SAASC,IAAIO,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,QAAQ,OAAA;AAE9CC,gBAAc1B,QAAQuB,KAAK;AAE3B,SAAOlC,WAAWsC,YAChB7B,gBAAgB8B,UAChB;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", "Capabilities", "Capability", "Graph", "GraphBuilder", "Node", "AppCapabilities", "Capability", "makeModule", "fnUntraced", "registry", "get", "Capabilities", "AtomRegistry", "extensionsAtom", "atom", "AppCapabilities", "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,78 @@
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 { Events, defineModule, definePlugin, lazy } from "@dxos/app-framework";
13
+ import { ActivationEvents, Capability as Capability2, Plugin } from "@dxos/app-framework";
14
+ import { AppActivationEvents } from "@dxos/app-toolkit";
6
15
 
7
16
  // src/meta.ts
17
+ import { trim } from "@dxos/util";
8
18
  var meta = {
9
- id: "dxos.org/plugin/graph",
10
- name: "Graph"
19
+ id: "org.dxos.plugin.graph",
20
+ name: "Graph",
21
+ description: trim`
22
+ Graph database layer providing relationship modeling and queries for workspace objects.
23
+ Build knowledge graphs and explore complex data relationships.
24
+ `
11
25
  };
12
26
 
13
27
  // src/GraphPlugin.ts
14
- var GraphPlugin = definePlugin(meta, () => [
15
- defineModule({
16
- id: `${meta.id}/module/graph`,
17
- activatesOn: Events.Startup,
18
- activatesBefore: [
19
- Events.SetupAppGraph,
20
- Events.SetupMetadata
21
- ],
22
- activatesAfter: [
23
- Events.AppGraphReady
24
- ],
25
- activate: lazy(() => import("./graph-2RPEFHFK.mjs"))
26
- })
27
- ]);
28
+ var Graph = Capability2.lazy("Graph", () => import("./graph-MX5UQYEY.mjs"));
29
+ var GraphPlugin = Plugin.define(meta).pipe(Plugin.addModule({
30
+ activatesOn: ActivationEvents.Startup,
31
+ activatesBefore: [
32
+ AppActivationEvents.SetupAppGraph,
33
+ AppActivationEvents.SetupMetadata
34
+ ],
35
+ activatesAfter: [
36
+ AppActivationEvents.AppGraphReady
37
+ ],
38
+ activate: Graph
39
+ }), Plugin.make);
40
+
41
+ // src/hooks/useActionRunner.ts
42
+ import { useCallback } from "react";
43
+ import { useOperationInvoker, usePluginManager } from "@dxos/app-framework/ui";
44
+ var useActionRunner = () => {
45
+ const invoker = useOperationInvoker();
46
+ const pluginManager = usePluginManager();
47
+ return useCallback((action, params = {}) => runAction(invoker, pluginManager.capabilities, action, params), [
48
+ invoker,
49
+ pluginManager.capabilities
50
+ ]);
51
+ };
28
52
 
29
53
  // src/hooks/useNode.ts
30
- import { useRxValue } from "@effect-rx/rx-react";
54
+ import { useAtomValue } from "@effect-atom/atom-react";
31
55
  import * as Option from "effect/Option";
32
56
  var useNode = (graph, id) => {
33
- return Option.getOrElse(useRxValue(graph.node(id ?? "")), () => void 0);
57
+ return Option.getOrElse(useAtomValue(graph.node(id ?? "")), () => void 0);
34
58
  };
35
59
  var useConnections = (graph, id, relation) => {
36
- return useRxValue(graph.connections(id ?? "", relation));
60
+ return useAtomValue(graph.connections(id ?? "", relation));
37
61
  };
38
62
  var useActions = (graph, id) => {
39
- return useRxValue(graph.actions(id ?? ""));
63
+ return useAtomValue(graph.actions(id ?? ""));
64
+ };
65
+ var useEdges = (graph, id) => {
66
+ return useAtomValue(graph.edges(id ?? ""));
40
67
  };
41
68
  export {
42
69
  GraphPlugin,
43
70
  meta,
71
+ runAction,
72
+ useActionRunner,
44
73
  useActions,
45
74
  useConnections,
75
+ useEdges,
46
76
  useNode
47
77
  };
48
78
  //# sourceMappingURL=index.mjs.map
@@ -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 { Events, defineModule, definePlugin, lazy } 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 = 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 meta: PluginMeta = {\n id: 'dxos.org/plugin/graph',\n name: 'Graph',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useRxValue } from '@effect-rx/rx-react';\nimport * as Option from 'effect/Option';\n\nimport { type Node, type ReadableGraph, 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,QAAQC,cAAcC,cAAcC,YAAY;;;ACElD,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;AACR;;;ADIO,IAAMC,cAAcC,aAAaC,MAAM,MAAM;EAClDC,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;;;AEjBD,SAASC,kBAAkB;AAC3B,YAAYC,YAAY;AAajB,IAAMC,UAAU,CAAUC,OAAsBC,OAAAA;AACrD,SAAcC,iBAAUC,WAAWH,MAAMI,KAAKH,MAAM,EAAA,CAAA,GAAM,MAAMI,MAAAA;AAClE;AAEO,IAAMC,iBAAiB,CAACN,OAAsBC,IAAaM,aAAAA;AAChE,SAAOJ,WAAWH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAChD;AAEO,IAAME,aAAa,CAACT,OAAsBC,OAAAA;AAC/C,SAAOE,WAAWH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AACxC;",
6
- "names": ["Events", "defineModule", "definePlugin", "lazy", "meta", "id", "name", "GraphPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "lazy", "useRxValue", "Option", "useNode", "graph", "id", "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 { 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 activatesBefore: [AppActivationEvents.SetupAppGraph, AppActivationEvents.SetupMetadata],\n activatesAfter: [AppActivationEvents.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: 'org.dxos.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/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 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 = (\n graph: Graph.ReadableGraph,\n id: string | undefined,\n relation: Node.RelationInput,\n): 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\n/** Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content. */\nexport const useEdges = (graph: Graph.ReadableGraph, id?: string): Graph.Edges => {\n return useAtomValue(graph.edges(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,kBAAkBC,cAAAA,aAAYC,cAAc;AACrD,SAASC,2BAA2B;;;ACApC,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;ADLA,IAAMC,QAAQC,YAAWC,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;AAO7C,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CH,OAAOI,UAAU;EACfC,aAAaC,iBAAiBC;EAC9BC,iBAAiB;IAACC,oBAAoBC;IAAeD,oBAAoBE;;EACzEC,gBAAgB;IAACH,oBAAoBI;;EACrCC,UAAUlB;AACZ,CAAA,GACAI,OAAOe,IAAI;;;AEnBb,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,CAC5BN,OACAC,IACAM,aAAAA;AAEA,SAAOJ,aAAaH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAClD;AAEO,IAAME,aAAa,CAACT,OAA4BC,OAAAA;AACrD,SAAOE,aAAaH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AAC1C;AAGO,IAAMU,WAAW,CAACX,OAA4BC,OAAAA;AACnD,SAAOE,aAAaH,MAAMY,MAAMX,MAAM,EAAA,CAAA;AACxC;",
6
+ "names": ["Effect", "Function", "Capability", "runAndForwardErrors", "Operation", "runAction", "invoker", "capabilityManager", "action", "params", "runAndForwardErrors", "data", "pipe", "provideService", "Operation", "Service", "Capability", "_actionContext", "provide", "identity", "ActivationEvents", "Capability", "Plugin", "AppActivationEvents", "trim", "meta", "id", "name", "description", "trim", "Graph", "Capability", "lazy", "GraphPlugin", "Plugin", "define", "meta", "pipe", "addModule", "activatesOn", "ActivationEvents", "Startup", "activatesBefore", "AppActivationEvents", "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", "useEdges", "edges"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":739,"imports":[],"format":"esm"},"src/graph.ts":{"bytes":6384,"imports":[{"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":2709,"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":3140,"imports":[{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect/Option","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":3350},"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-2RPEFHFK.mjs","kind":"dynamic-import"},{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"exports":["GraphPlugin","meta","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/GraphPlugin.ts":{"bytesInOutput":417},"src/meta.ts":{"bytesInOutput":63},"src/hooks/useNode.ts":{"bytesInOutput":394},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":1122},"dist/lib/browser/graph-2RPEFHFK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3340},"dist/lib/browser/graph-2RPEFHFK.mjs":{"imports":[{"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":1269}},"bytes":1368}}}
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":7347,"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":3056,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","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":2530,"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":3919,"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":7444},"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/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/browser/graph-MX5UQYEY.mjs","kind":"dynamic-import"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","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","useEdges","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/action.ts":{"bytesInOutput":551},"src/GraphPlugin.ts":{"bytesInOutput":530},"src/meta.ts":{"bytesInOutput":283},"src/hooks/useActionRunner.ts":{"bytesInOutput":397},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNode.ts":{"bytesInOutput":487}},"bytes":2591},"dist/lib/browser/graph-MX5UQYEY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3865},"dist/lib/browser/graph-MX5UQYEY.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":1469}},"bytes":1568}}}
@@ -0,0 +1,42 @@
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 { Capabilities, Capability } from "@dxos/app-framework";
7
+ import { Graph, GraphBuilder, Node } from "@dxos/app-graph";
8
+ import { AppCapabilities } from "@dxos/app-toolkit";
9
+ var graph_default = Capability.makeModule(Effect.fnUntraced(function* () {
10
+ const registry = yield* Capability.get(Capabilities.AtomRegistry);
11
+ const extensionsAtom = yield* Capability.atom(AppCapabilities.AppGraphBuilder);
12
+ const builder = GraphBuilder.from(
13
+ /* localStorage.getItem(KEY) ?? */
14
+ void 0,
15
+ registry
16
+ );
17
+ const unsubscribe = registry.subscribe(extensionsAtom, (extensions) => {
18
+ const next = GraphBuilder.flattenExtensions(extensions);
19
+ const current = Record.values(registry.get(builder.extensions));
20
+ const removed = current.filter(({ id }) => !next.some(({ id: nextId }) => nextId === id));
21
+ removed.forEach((extension) => GraphBuilder.removeExtension(builder, extension.id));
22
+ next.forEach((extension) => GraphBuilder.addExtension(builder, extension));
23
+ }, {
24
+ immediate: true
25
+ });
26
+ void Graph.expand(builder.graph, Node.RootId, "child");
27
+ setupDevtools(builder.graph);
28
+ return Capability.contributes(AppCapabilities.AppGraph, {
29
+ graph: builder.graph,
30
+ explore: GraphBuilder.explore
31
+ }, () => Effect.sync(() => {
32
+ unsubscribe();
33
+ }));
34
+ }));
35
+ var setupDevtools = (graph) => {
36
+ globalThis.composer ??= {};
37
+ globalThis.composer.graph = graph;
38
+ };
39
+ export {
40
+ graph_default as default
41
+ };
42
+ //# sourceMappingURL=graph-2RMPUX7I.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 extensionsAtom = yield* Capability.atom(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 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, '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,gBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,WAAW,OAAOH,WAAWI,IAAIC,aAAaC,YAAY;AAChE,QAAMC,iBAAiB,OAAOP,WAAWQ,KAAKC,gBAAgBC,eAAe;AAE7E,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWX;EAAAA;AAKhF,QAAMY,cAAcZ,SAASa,UAC3BT,gBACA,CAACU,eAAAA;AACC,UAAMC,OAAON,aAAaO,kBAAkBF,UAAAA;AAC5C,UAAMG,UAAiBC,cAAOlB,SAASC,IAAIO,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,QAAQ,OAAA;AAE9CC,gBAAc1B,QAAQuB,KAAK;AAE3B,SAAOlC,WAAWsC,YAChB7B,gBAAgB8B,UAChB;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", "Capabilities", "Capability", "Graph", "GraphBuilder", "Node", "AppCapabilities", "Capability", "makeModule", "fnUntraced", "registry", "get", "Capabilities", "AtomRegistry", "extensionsAtom", "atom", "AppCapabilities", "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,78 @@ 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 { Events, defineModule, definePlugin, lazy } from "@dxos/app-framework";
15
+ import { ActivationEvents, Capability as Capability2, Plugin } from "@dxos/app-framework";
16
+ import { AppActivationEvents } from "@dxos/app-toolkit";
8
17
 
9
18
  // src/meta.ts
19
+ import { trim } from "@dxos/util";
10
20
  var meta = {
11
- id: "dxos.org/plugin/graph",
12
- name: "Graph"
21
+ id: "org.dxos.plugin.graph",
22
+ name: "Graph",
23
+ description: trim`
24
+ Graph database layer providing relationship modeling and queries for workspace objects.
25
+ Build knowledge graphs and explore complex data relationships.
26
+ `
13
27
  };
14
28
 
15
29
  // src/GraphPlugin.ts
16
- var GraphPlugin = definePlugin(meta, () => [
17
- defineModule({
18
- id: `${meta.id}/module/graph`,
19
- activatesOn: Events.Startup,
20
- activatesBefore: [
21
- Events.SetupAppGraph,
22
- Events.SetupMetadata
23
- ],
24
- activatesAfter: [
25
- Events.AppGraphReady
26
- ],
27
- activate: lazy(() => import("./graph-MKDJSVDV.mjs"))
28
- })
29
- ]);
30
+ var Graph = Capability2.lazy("Graph", () => import("./graph-2RMPUX7I.mjs"));
31
+ var GraphPlugin = Plugin.define(meta).pipe(Plugin.addModule({
32
+ activatesOn: ActivationEvents.Startup,
33
+ activatesBefore: [
34
+ AppActivationEvents.SetupAppGraph,
35
+ AppActivationEvents.SetupMetadata
36
+ ],
37
+ activatesAfter: [
38
+ AppActivationEvents.AppGraphReady
39
+ ],
40
+ activate: Graph
41
+ }), Plugin.make);
42
+
43
+ // src/hooks/useActionRunner.ts
44
+ import { useCallback } from "react";
45
+ import { useOperationInvoker, usePluginManager } from "@dxos/app-framework/ui";
46
+ var useActionRunner = () => {
47
+ const invoker = useOperationInvoker();
48
+ const pluginManager = usePluginManager();
49
+ return useCallback((action, params = {}) => runAction(invoker, pluginManager.capabilities, action, params), [
50
+ invoker,
51
+ pluginManager.capabilities
52
+ ]);
53
+ };
30
54
 
31
55
  // src/hooks/useNode.ts
32
- import { useRxValue } from "@effect-rx/rx-react";
56
+ import { useAtomValue } from "@effect-atom/atom-react";
33
57
  import * as Option from "effect/Option";
34
58
  var useNode = (graph, id) => {
35
- return Option.getOrElse(useRxValue(graph.node(id ?? "")), () => void 0);
59
+ return Option.getOrElse(useAtomValue(graph.node(id ?? "")), () => void 0);
36
60
  };
37
61
  var useConnections = (graph, id, relation) => {
38
- return useRxValue(graph.connections(id ?? "", relation));
62
+ return useAtomValue(graph.connections(id ?? "", relation));
39
63
  };
40
64
  var useActions = (graph, id) => {
41
- return useRxValue(graph.actions(id ?? ""));
65
+ return useAtomValue(graph.actions(id ?? ""));
66
+ };
67
+ var useEdges = (graph, id) => {
68
+ return useAtomValue(graph.edges(id ?? ""));
42
69
  };
43
70
  export {
44
71
  GraphPlugin,
45
72
  meta,
73
+ runAction,
74
+ useActionRunner,
46
75
  useActions,
47
76
  useConnections,
77
+ useEdges,
48
78
  useNode
49
79
  };
50
80
  //# sourceMappingURL=index.mjs.map
@@ -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 { Events, defineModule, definePlugin, lazy } 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 = 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 meta: PluginMeta = {\n id: 'dxos.org/plugin/graph',\n name: 'Graph',\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { useRxValue } from '@effect-rx/rx-react';\nimport * as Option from 'effect/Option';\n\nimport { type Node, type ReadableGraph, 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,QAAQC,cAAcC,cAAcC,YAAY;;;ACElD,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;AACR;;;ADIO,IAAMC,cAAcC,aAAaC,MAAM,MAAM;EAClDC,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;;;AEjBD,SAASC,kBAAkB;AAC3B,YAAYC,YAAY;AAajB,IAAMC,UAAU,CAAUC,OAAsBC,OAAAA;AACrD,SAAcC,iBAAUC,WAAWH,MAAMI,KAAKH,MAAM,EAAA,CAAA,GAAM,MAAMI,MAAAA;AAClE;AAEO,IAAMC,iBAAiB,CAACN,OAAsBC,IAAaM,aAAAA;AAChE,SAAOJ,WAAWH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAChD;AAEO,IAAME,aAAa,CAACT,OAAsBC,OAAAA;AAC/C,SAAOE,WAAWH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AACxC;",
6
- "names": ["Events", "defineModule", "definePlugin", "lazy", "meta", "id", "name", "GraphPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "Startup", "activatesBefore", "SetupAppGraph", "SetupMetadata", "activatesAfter", "AppGraphReady", "activate", "lazy", "useRxValue", "Option", "useNode", "graph", "id", "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 { 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 activatesBefore: [AppActivationEvents.SetupAppGraph, AppActivationEvents.SetupMetadata],\n activatesAfter: [AppActivationEvents.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: 'org.dxos.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/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 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 = (\n graph: Graph.ReadableGraph,\n id: string | undefined,\n relation: Node.RelationInput,\n): 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\n/** Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content. */\nexport const useEdges = (graph: Graph.ReadableGraph, id?: string): Graph.Edges => {\n return useAtomValue(graph.edges(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,kBAAkBC,cAAAA,aAAYC,cAAc;AACrD,SAASC,2BAA2B;;;ACApC,SAASC,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;AAIf;;;ADLA,IAAMC,QAAQC,YAAWC,KAAK,SAAS,MAAM,OAAO,sBAAA,CAAA;AAO7C,IAAMC,cAAcC,OAAOC,OAAOC,IAAAA,EAAMC,KAC7CH,OAAOI,UAAU;EACfC,aAAaC,iBAAiBC;EAC9BC,iBAAiB;IAACC,oBAAoBC;IAAeD,oBAAoBE;;EACzEC,gBAAgB;IAACH,oBAAoBI;;EACrCC,UAAUlB;AACZ,CAAA,GACAI,OAAOe,IAAI;;;AEnBb,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,CAC5BN,OACAC,IACAM,aAAAA;AAEA,SAAOJ,aAAaH,MAAMQ,YAAYP,MAAM,IAAIM,QAAAA,CAAAA;AAClD;AAEO,IAAME,aAAa,CAACT,OAA4BC,OAAAA;AACrD,SAAOE,aAAaH,MAAMU,QAAQT,MAAM,EAAA,CAAA;AAC1C;AAGO,IAAMU,WAAW,CAACX,OAA4BC,OAAAA;AACnD,SAAOE,aAAaH,MAAMY,MAAMX,MAAM,EAAA,CAAA;AACxC;",
6
+ "names": ["Effect", "Function", "Capability", "runAndForwardErrors", "Operation", "runAction", "invoker", "capabilityManager", "action", "params", "runAndForwardErrors", "data", "pipe", "provideService", "Operation", "Service", "Capability", "_actionContext", "provide", "identity", "ActivationEvents", "Capability", "Plugin", "AppActivationEvents", "trim", "meta", "id", "name", "description", "trim", "Graph", "Capability", "lazy", "GraphPlugin", "Plugin", "define", "meta", "pipe", "addModule", "activatesOn", "ActivationEvents", "Startup", "activatesBefore", "AppActivationEvents", "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", "useEdges", "edges"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/meta.ts":{"bytes":739,"imports":[],"format":"esm"},"src/graph.ts":{"bytes":6384,"imports":[{"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":2709,"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":3140,"imports":[{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect/Option","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":3352},"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-MKDJSVDV.mjs","kind":"dynamic-import"},{"path":"@effect-rx/rx-react","kind":"import-statement","external":true},{"path":"effect/Option","kind":"import-statement","external":true}],"exports":["GraphPlugin","meta","useActions","useConnections","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/GraphPlugin.ts":{"bytesInOutput":417},"src/meta.ts":{"bytesInOutput":63},"src/hooks/useNode.ts":{"bytesInOutput":394},"src/hooks/index.ts":{"bytesInOutput":0}},"bytes":1215},"dist/lib/node-esm/graph-MKDJSVDV.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3342},"dist/lib/node-esm/graph-MKDJSVDV.mjs":{"imports":[{"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":1269}},"bytes":1461}}}
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":7347,"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":3056,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","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":2530,"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":3919,"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":7446},"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/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"dist/lib/node-esm/graph-2RMPUX7I.mjs","kind":"dynamic-import"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","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","useEdges","useNode"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":33},"src/action.ts":{"bytesInOutput":551},"src/GraphPlugin.ts":{"bytesInOutput":530},"src/meta.ts":{"bytesInOutput":283},"src/hooks/useActionRunner.ts":{"bytesInOutput":397},"src/hooks/index.ts":{"bytesInOutput":0},"src/hooks/useNode.ts":{"bytesInOutput":487}},"bytes":2684},"dist/lib/node-esm/graph-2RMPUX7I.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3867},"dist/lib/node-esm/graph-2RMPUX7I.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":1469}},"bytes":1661}}}
@@ -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").PluginFactory<void>;
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,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"}
@@ -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,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;;;;;AAQ5D,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 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,9 @@ 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
+ export declare const useActions: (graph: Graph.ReadableGraph, id?: string) => Node.Node[];
13
+ /** Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content. */
14
+ export declare const useEdges: (graph: Graph.ReadableGraph, id?: string) => Graph.Edges;
13
15
  //# 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":"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,GACzB,OAAO,KAAK,CAAC,aAAa,EAC1B,IAAI,MAAM,GAAG,SAAS,EACtB,UAAU,IAAI,CAAC,aAAa,KAC3B,IAAI,CAAC,IAAI,EAEX,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,CAAC,IAAI,EAE7E,CAAC;AAEF,gHAAgH;AAChH,eAAO,MAAM,QAAQ,GAAI,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,MAAM,KAAG,KAAK,CAAC,KAExE,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,3 +1,3 @@
1
- import { type PluginMeta } from '@dxos/app-framework';
2
- export declare const meta: PluginMeta;
1
+ import { type Plugin } from '@dxos/app-framework';
2
+ export declare const meta: Plugin.Meta;
3
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,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"}