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

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-graph",
3
- "version": "0.8.4-main.dedc0f3",
3
+ "version": "0.8.4-main.ead640a",
4
4
  "description": "DXOS Surface plugin for constructing knowledge graphs",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -26,29 +26,29 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@preact-signals/safe-react": "^0.9.0",
29
- "@dxos/app-framework": "0.8.4-main.dedc0f3",
30
- "@dxos/app-graph": "0.8.4-main.dedc0f3",
31
- "@dxos/async": "0.8.4-main.dedc0f3",
32
- "@dxos/debug": "0.8.4-main.dedc0f3"
29
+ "@dxos/app-framework": "0.8.4-main.ead640a",
30
+ "@dxos/app-graph": "0.8.4-main.ead640a",
31
+ "@dxos/async": "0.8.4-main.ead640a",
32
+ "@dxos/debug": "0.8.4-main.ead640a"
33
33
  },
34
34
  "devDependencies": {
35
- "@effect-rx/rx-react": "0.38.0",
36
- "@effect/platform": "0.90.2",
37
- "@types/react": "~18.2.0",
38
- "@types/react-dom": "~18.2.0",
39
- "effect": "3.17.7",
40
- "react": "~18.2.0",
41
- "react-dom": "~18.2.0",
42
- "vite": "7.1.1",
43
- "@dxos/react-client": "0.8.4-main.dedc0f3",
44
- "@dxos/storybook-utils": "0.8.4-main.dedc0f3"
35
+ "@effect-rx/rx-react": "0.42.4",
36
+ "@effect/platform": "0.92.1",
37
+ "@types/react": "~19.2.2",
38
+ "@types/react-dom": "~19.2.1",
39
+ "effect": "3.18.3",
40
+ "react": "~19.2.0",
41
+ "react-dom": "~19.2.0",
42
+ "vite": "7.1.9",
43
+ "@dxos/storybook-utils": "0.8.4-main.ead640a",
44
+ "@dxos/react-client": "0.8.4-main.ead640a"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "@effect-rx/rx-react": "^0.34.1",
48
48
  "@effect/platform": "^0.80.12",
49
49
  "effect": "^3.13.3",
50
- "react": "~18.2.0",
51
- "react-dom": "~18.2.0"
50
+ "react": "^19.0.0",
51
+ "react-dom": "^19.0.0"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -11,13 +11,12 @@ import { meta } from './meta';
11
11
  * Enables other plugins to register node builders to add nodes to the graph.
12
12
  * This includes actions and annotation each other's nodes.
13
13
  */
14
- export const GraphPlugin = () =>
15
- definePlugin(meta, [
16
- defineModule({
17
- id: `${meta.id}/module/graph`,
18
- activatesOn: Events.Startup,
19
- activatesBefore: [Events.SetupAppGraph, Events.SetupMetadata],
20
- activatesAfter: [Events.AppGraphReady],
21
- activate: lazy(() => import('./graph')),
22
- }),
23
- ]);
14
+ export const GraphPlugin = definePlugin(meta, () => [
15
+ defineModule({
16
+ id: `${meta.id}/module/graph`,
17
+ activatesOn: Events.Startup,
18
+ activatesBefore: [Events.SetupAppGraph, Events.SetupMetadata],
19
+ activatesAfter: [Events.AppGraphReady],
20
+ activate: lazy(() => import('./graph')),
21
+ }),
22
+ ]);
package/src/graph.ts CHANGED
@@ -2,15 +2,15 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Record } from 'effect';
5
+ import * as Record from 'effect/Record';
6
6
 
7
7
  import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
8
8
  import { type ExpandableGraph, GraphBuilder, ROOT_ID, flattenExtensions } from '@dxos/app-graph';
9
9
 
10
10
  // TODO(wittjosiah): Remove or restore graph caching.
11
- // import { GRAPH_PLUGIN } from './meta';
11
+ // import { meta } from './meta';
12
12
 
13
- // const KEY = `${GRAPH_PLUGIN}/app-graph`;
13
+ // const KEY = `${meta.id}/app-graph`;
14
14
 
15
15
  export default async (context: PluginContext) => {
16
16
  const registry = context.getCapability(Capabilities.RxRegistry);
@@ -3,7 +3,7 @@
3
3
  //
4
4
 
5
5
  import { useRxValue } from '@effect-rx/rx-react';
6
- import { Option } from 'effect';
6
+ import * as Option from 'effect/Option';
7
7
 
8
8
  import { type Node, type ReadableGraph, type Relation } from '@dxos/app-graph';
9
9
 
package/src/meta.ts CHANGED
@@ -4,9 +4,7 @@
4
4
 
5
5
  import { type PluginMeta } from '@dxos/app-framework';
6
6
 
7
- export const GRAPH_PLUGIN = 'dxos.org/plugin/graph';
8
-
9
7
  export const meta: PluginMeta = {
10
- id: GRAPH_PLUGIN,
8
+ id: 'dxos.org/plugin/graph',
11
9
  name: 'Graph',
12
10
  };
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/graph.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Record } from 'effect';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { type ExpandableGraph, GraphBuilder, ROOT_ID, flattenExtensions } from '@dxos/app-graph';\n\n// TODO(wittjosiah): Remove or restore graph caching.\n// import { GRAPH_PLUGIN } from './meta';\n\n// const KEY = `${GRAPH_PLUGIN}/app-graph`;\n\nexport default async (context: PluginContext) => {\n const registry = context.getCapability(Capabilities.RxRegistry);\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 context.capabilities(Capabilities.AppGraphBuilder),\n (extensions) => {\n const next = 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) => builder.removeExtension(extension.id));\n next.forEach((extension) => builder.addExtension(extension));\n },\n { immediate: true },\n );\n\n // await builder.initialize();\n void builder.graph.expand(ROOT_ID);\n\n setupDevtools(builder.graph);\n\n return contributes(Capabilities.AppGraph, { graph: builder.graph, explore: builder.explore }, () => {\n // clearInterval(interval);\n unsubscribe();\n });\n};\n\n// Expose the graph to the window for debugging.\nconst setupDevtools = (graph: ExpandableGraph) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.graph = graph;\n};\n"],
5
- "mappings": ";AAIA,SAASA,cAAc;AAEvB,SAASC,cAAkCC,mBAAmB;AAC9D,SAA+BC,cAAcC,SAASC,yBAAyB;AAO/E,IAAA,gBAAe,OAAOC,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,UAAU;AAC9D,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWP;EAAAA;AAKhF,QAAMQ,cAAcR,SAASS,UAC3BV,QAAQW,aAAaR,aAAaS,eAAe,GACjD,CAACC,eAAAA;AACC,UAAMC,OAAOC,kBAAkBF,UAAAA;AAC/B,UAAMG,UAAUC,OAAOC,OAAOjB,SAASkB,IAAId,QAAQQ,UAAU,CAAA;AAC7D,UAAMO,UAAUJ,QAAQK,OAAO,CAAC,EAAEC,GAAE,MAAO,CAACR,KAAKS,KAAK,CAAC,EAAED,IAAIE,OAAM,MAAOA,WAAWF,EAAAA,CAAAA;AACrFF,YAAQK,QAAQ,CAACC,cAAcrB,QAAQsB,gBAAgBD,UAAUJ,EAAE,CAAA;AACnER,SAAKW,QAAQ,CAACC,cAAcrB,QAAQuB,aAAaF,SAAAA,CAAAA;EACnD,GACA;IAAEG,WAAW;EAAK,CAAA;AAIpB,OAAKxB,QAAQyB,MAAMC,OAAOC,OAAAA;AAE1BC,gBAAc5B,QAAQyB,KAAK;AAE3B,SAAOI,YAAY/B,aAAagC,UAAU;IAAEL,OAAOzB,QAAQyB;IAAOM,SAAS/B,QAAQ+B;EAAQ,GAAG,MAAA;AAE5F3B,gBAAAA;EACF,CAAA;AACF;AAGA,IAAMwB,gBAAgB,CAACH,UAAAA;MACpBO;AAAD,GAACA,cAAAA,YAAmBC,aAAnBD,YAAmBC,WAAa,CAAC;AACjCD,aAAmBC,SAASR,QAAQA;AACvC;",
6
- "names": ["Record", "Capabilities", "contributes", "GraphBuilder", "ROOT_ID", "flattenExtensions", "context", "registry", "getCapability", "Capabilities", "RxRegistry", "builder", "GraphBuilder", "from", "undefined", "unsubscribe", "subscribe", "capabilities", "AppGraphBuilder", "extensions", "next", "flattenExtensions", "current", "Record", "values", "get", "removed", "filter", "id", "some", "nextId", "forEach", "extension", "removeExtension", "addExtension", "immediate", "graph", "expand", "ROOT_ID", "setupDevtools", "contributes", "AppGraph", "explore", "globalThis", "composer"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/graph.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Record } from 'effect';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { type ExpandableGraph, GraphBuilder, ROOT_ID, flattenExtensions } from '@dxos/app-graph';\n\n// TODO(wittjosiah): Remove or restore graph caching.\n// import { GRAPH_PLUGIN } from './meta';\n\n// const KEY = `${GRAPH_PLUGIN}/app-graph`;\n\nexport default async (context: PluginContext) => {\n const registry = context.getCapability(Capabilities.RxRegistry);\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 context.capabilities(Capabilities.AppGraphBuilder),\n (extensions) => {\n const next = 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) => builder.removeExtension(extension.id));\n next.forEach((extension) => builder.addExtension(extension));\n },\n { immediate: true },\n );\n\n // await builder.initialize();\n void builder.graph.expand(ROOT_ID);\n\n setupDevtools(builder.graph);\n\n return contributes(Capabilities.AppGraph, { graph: builder.graph, explore: builder.explore }, () => {\n // clearInterval(interval);\n unsubscribe();\n });\n};\n\n// Expose the graph to the window for debugging.\nconst setupDevtools = (graph: ExpandableGraph) => {\n (globalThis as any).composer ??= {};\n (globalThis as any).composer.graph = graph;\n};\n"],
5
- "mappings": ";;;AAIA,SAASA,cAAc;AAEvB,SAASC,cAAkCC,mBAAmB;AAC9D,SAA+BC,cAAcC,SAASC,yBAAyB;AAO/E,IAAA,gBAAe,OAAOC,YAAAA;AACpB,QAAMC,WAAWD,QAAQE,cAAcC,aAAaC,UAAU;AAC9D,QAAMC,UAAUC,aAAaC;;IAAwCC;IAAWP;EAAAA;AAKhF,QAAMQ,cAAcR,SAASS,UAC3BV,QAAQW,aAAaR,aAAaS,eAAe,GACjD,CAACC,eAAAA;AACC,UAAMC,OAAOC,kBAAkBF,UAAAA;AAC/B,UAAMG,UAAUC,OAAOC,OAAOjB,SAASkB,IAAId,QAAQQ,UAAU,CAAA;AAC7D,UAAMO,UAAUJ,QAAQK,OAAO,CAAC,EAAEC,GAAE,MAAO,CAACR,KAAKS,KAAK,CAAC,EAAED,IAAIE,OAAM,MAAOA,WAAWF,EAAAA,CAAAA;AACrFF,YAAQK,QAAQ,CAACC,cAAcrB,QAAQsB,gBAAgBD,UAAUJ,EAAE,CAAA;AACnER,SAAKW,QAAQ,CAACC,cAAcrB,QAAQuB,aAAaF,SAAAA,CAAAA;EACnD,GACA;IAAEG,WAAW;EAAK,CAAA;AAIpB,OAAKxB,QAAQyB,MAAMC,OAAOC,OAAAA;AAE1BC,gBAAc5B,QAAQyB,KAAK;AAE3B,SAAOI,YAAY/B,aAAagC,UAAU;IAAEL,OAAOzB,QAAQyB;IAAOM,SAAS/B,QAAQ+B;EAAQ,GAAG,MAAA;AAE5F3B,gBAAAA;EACF,CAAA;AACF;AAGA,IAAMwB,gBAAgB,CAACH,UAAAA;MACpBO;AAAD,GAACA,cAAAA,YAAmBC,aAAnBD,YAAmBC,WAAa,CAAC;AACjCD,aAAmBC,SAASR,QAAQA;AACvC;",
6
- "names": ["Record", "Capabilities", "contributes", "GraphBuilder", "ROOT_ID", "flattenExtensions", "context", "registry", "getCapability", "Capabilities", "RxRegistry", "builder", "GraphBuilder", "from", "undefined", "unsubscribe", "subscribe", "capabilities", "AppGraphBuilder", "extensions", "next", "flattenExtensions", "current", "Record", "values", "get", "removed", "filter", "id", "some", "nextId", "forEach", "extension", "removeExtension", "addExtension", "immediate", "graph", "expand", "ROOT_ID", "setupDevtools", "contributes", "AppGraph", "explore", "globalThis", "composer"]
7
- }