@dxos/plugin-graph 0.8.4-main.a4bbb77 → 0.8.4-main.abd8ff62ef

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 (47) hide show
  1. package/dist/lib/browser/GraphPlugin-M2U6IMU2.mjs +22 -0
  2. package/dist/lib/browser/GraphPlugin-M2U6IMU2.mjs.map +7 -0
  3. package/dist/lib/browser/graph-RCKCHDM6.mjs +48 -0
  4. package/dist/lib/browser/graph-RCKCHDM6.mjs.map +7 -0
  5. package/dist/lib/browser/index.mjs +57 -26
  6. package/dist/lib/browser/index.mjs.map +4 -4
  7. package/dist/lib/browser/meta.json +1 -1
  8. package/dist/lib/node-esm/GraphPlugin-4Y4JMNE2.mjs +24 -0
  9. package/dist/lib/node-esm/GraphPlugin-4Y4JMNE2.mjs.map +7 -0
  10. package/dist/lib/node-esm/graph-P7F6HXZB.mjs +50 -0
  11. package/dist/lib/node-esm/graph-P7F6HXZB.mjs.map +7 -0
  12. package/dist/lib/node-esm/index.mjs +57 -26
  13. package/dist/lib/node-esm/index.mjs.map +4 -4
  14. package/dist/lib/node-esm/meta.json +1 -1
  15. package/dist/types/src/GraphPlugin.d.ts +3 -1
  16. package/dist/types/src/GraphPlugin.d.ts.map +1 -1
  17. package/dist/types/src/GraphPlugin.test.d.ts +2 -0
  18. package/dist/types/src/GraphPlugin.test.d.ts.map +1 -0
  19. package/dist/types/src/action.d.ts +12 -0
  20. package/dist/types/src/action.d.ts.map +1 -0
  21. package/dist/types/src/graph.d.ts +7 -3
  22. package/dist/types/src/graph.d.ts.map +1 -1
  23. package/dist/types/src/hooks/index.d.ts +1 -0
  24. package/dist/types/src/hooks/index.d.ts.map +1 -1
  25. package/dist/types/src/hooks/useActionRunner.d.ts +7 -0
  26. package/dist/types/src/hooks/useActionRunner.d.ts.map +1 -0
  27. package/dist/types/src/hooks/useNode.d.ts +19 -4
  28. package/dist/types/src/hooks/useNode.d.ts.map +1 -1
  29. package/dist/types/src/index.d.ts +4 -2
  30. package/dist/types/src/index.d.ts.map +1 -1
  31. package/dist/types/src/meta.d.ts +2 -2
  32. package/dist/types/src/meta.d.ts.map +1 -1
  33. package/dist/types/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +34 -24
  35. package/src/GraphPlugin.test.ts +26 -0
  36. package/src/GraphPlugin.ts +15 -10
  37. package/src/action.ts +35 -0
  38. package/src/graph.ts +51 -35
  39. package/src/hooks/index.ts +1 -0
  40. package/src/hooks/useActionRunner.ts +25 -0
  41. package/src/hooks/useNode.ts +35 -9
  42. package/src/index.ts +11 -2
  43. package/src/meta.ts +8 -3
  44. package/dist/lib/browser/graph-GVCNCTBU.mjs +0 -38
  45. package/dist/lib/browser/graph-GVCNCTBU.mjs.map +0 -7
  46. package/dist/lib/node-esm/graph-C6ZIKIUK.mjs +0 -40
  47. package/dist/lib/node-esm/graph-C6ZIKIUK.mjs.map +0 -7
@@ -0,0 +1,12 @@
1
+ import { type CapabilityManager } from '@dxos/app-framework';
2
+ import { type Node } from '@dxos/app-graph';
3
+ import { 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;AAG5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,YACX,gBAAgB,CAAC,gBAAgB,qBACvB,iBAAiB,CAAC,iBAAiB,UAC9C,IAAI,CAAC,MAAM,WACX,IAAI,CAAC,WAAW,KACvB,OAAO,CAAC,IAAI,CASZ,CAAC"}
@@ -1,5 +1,9 @@
1
- import { type PluginContext } from '@dxos/app-framework';
2
- import { GraphBuilder } from '@dxos/app-graph';
3
- declare const _default: (context: PluginContext) => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").InterfaceDef<Readonly<Pick<GraphBuilder, "graph" | "explore">>>>>;
1
+ import * as Effect from 'effect/Effect';
2
+ import { Capability } from '@dxos/app-framework';
3
+ import { Graph, GraphBuilder } from '@dxos/app-graph';
4
+ declare const _default: (props: void) => Effect.Effect<Capability.Capability<Capability.InterfaceDef<Readonly<{
5
+ graph: Graph.ExpandableGraph;
6
+ explore: typeof GraphBuilder.explore;
7
+ }>>>, Error, Capability.Service>;
4
8
  export default _default;
5
9
  //# sourceMappingURL=graph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAMA,OAAO,EAAgB,KAAK,aAAa,EAAe,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAwB,YAAY,EAA8B,MAAM,iBAAiB,CAAC;yBAO3E,SAAS,aAAa;AAA5C,wBA4BE"}
1
+ {"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../../src/graph.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAGxC,OAAO,EAAgB,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,KAAK,EAAE,YAAY,EAAQ,MAAM,iBAAiB,CAAC"}
@@ -1,2 +1,3 @@
1
+ export * from './useActionRunner';
1
2
  export * from './useNode';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type Node } from '@dxos/app-graph';
2
+ /**
3
+ * Hook that returns a function to run action Effects.
4
+ * Provides Operation.Service, PluginContextService, and captured plugin context.
5
+ */
6
+ export declare const useActionRunner: () => (action: Node.Action, params?: Node.InvokeProps) => Promise<void>;
7
+ //# sourceMappingURL=useActionRunner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useActionRunner.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useActionRunner.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,eAAe,iBAKf,IAAI,CAAC,MAAM,WAAU,IAAI,CAAC,WAAW,kBAIjD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type Node, type ReadableGraph, type Relation } from '@dxos/app-graph';
1
+ import { type Graph, type Node } from '@dxos/app-graph';
2
2
  /**
3
3
  * React hook to get a node from the graph.
4
4
  *
@@ -7,7 +7,22 @@ import { type Node, type ReadableGraph, type Relation } from '@dxos/app-graph';
7
7
  * @param timeout Optional timeout in milliseconds to wait for the node to be found.
8
8
  * @returns Node if found, undefined otherwise.
9
9
  */
10
- export declare const useNode: <T = any>(graph: ReadableGraph, id?: string) => Node<T> | undefined;
11
- export declare const useConnections: (graph: ReadableGraph, id?: string, relation?: Relation) => Node[];
12
- export declare const useActions: (graph: ReadableGraph, id?: string) => Node[];
10
+ export declare const useNode: <T = any>(graph: Graph.ReadableGraph, id?: string) => Node.Node<T> | undefined;
11
+ export declare const useConnections: (graph: Graph.ReadableGraph, id: string | undefined, relation: Node.RelationInput) => Node.Node[];
12
+ /**
13
+ * React hook to get actions available for a node.
14
+ *
15
+ * @param graph Graph containing the node.
16
+ * @param id Id of the node.
17
+ * @returns Actions available for the node.
18
+ */
19
+ export declare const useActions: (graph: Graph.ReadableGraph, id?: string) => Node.Node[];
20
+ /**
21
+ * Subscribe to just the edge topology (inbound/outbound IDs) of a node without subscribing to node content.
22
+ *
23
+ * @param graph Graph containing the node.
24
+ * @param id Id of the node.
25
+ * @returns Edge topology for the node.
26
+ */
27
+ export declare const useEdges: (graph: Graph.ReadableGraph, id?: string) => Graph.Edges;
13
28
  //# sourceMappingURL=useNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNode.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,aAAa,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE/E;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,EAAE,OAAO,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,CAAC,CAAC,CAAC,GAAG,SAE9E,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,OAAO,aAAa,EAAE,KAAK,MAAM,EAAE,WAAW,QAAQ,KAAG,IAAI,EAE3F,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,OAAO,aAAa,EAAE,KAAK,MAAM,KAAG,IAAI,EAElE,CAAC"}
1
+ {"version":3,"file":"useNode.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useNode.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAExD;;;;;;;GAOG;AAEH,eAAO,MAAM,OAAO,GAAI,CAAC,GAAG,GAAG,SAAS,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,SAGzF,CAAC;AAEF,eAAO,MAAM,cAAc,UAClB,KAAK,CAAC,aAAa,MACtB,MAAM,GAAG,SAAS,YACZ,IAAI,CAAC,aAAa,KAC3B,IAAI,CAAC,IAAI,EAEX,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,UAAW,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,IAAI,CAAC,IAAI,EAG7E,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,UAAW,KAAK,CAAC,aAAa,OAAO,MAAM,KAAG,KAAK,CAAC,KAGxE,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { Plugin } from '@dxos/app-framework';
2
+ export declare const GraphPlugin: Plugin.PluginFactory<void>;
3
+ export * from './meta';
1
4
  export * from '@dxos/app-graph';
2
- export * from './GraphPlugin';
5
+ export * from './action';
3
6
  export * from './hooks';
4
- export * from './meta';
5
7
  //# sourceMappingURL=index.d.ts.map
@@ -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,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,eAAO,MAAM,WAAW,4BAAmD,CAAC;AAE5E,cAAc,QAAQ,CAAC;AAEvB,cAAc,iBAAiB,CAAC;AAEhC,cAAc,UAAU,CAAC;AAGzB,cAAc,SAAS,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"}