@dxos/plugin-graph 0.8.4-main.e098934 → 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/dist/lib/browser/{graph-UW77N6TF.mjs → graph-2RPEFHFK.mjs} +4 -4
- package/dist/lib/browser/graph-2RPEFHFK.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +4 -6
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/{graph-UIVRXZE6.mjs → graph-MKDJSVDV.mjs} +4 -4
- package/dist/lib/node-esm/graph-MKDJSVDV.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +4 -6
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/GraphPlugin.d.ts +1 -1
- package/dist/types/src/GraphPlugin.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -17
- package/src/GraphPlugin.ts +9 -10
- package/src/graph.ts +3 -3
- package/src/hooks/useNode.ts +1 -1
- package/src/meta.ts +1 -3
- package/dist/lib/browser/graph-UW77N6TF.mjs.map +0 -7
- package/dist/lib/node-esm/graph-UIVRXZE6.mjs.map +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-graph",
|
|
3
|
-
"version": "0.8.4-main.
|
|
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.
|
|
30
|
-
"@dxos/
|
|
31
|
-
"@dxos/
|
|
32
|
-
"@dxos/debug": "0.8.4-main.
|
|
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.
|
|
36
|
-
"@effect/platform": "0.
|
|
37
|
-
"@types/react": "~
|
|
38
|
-
"@types/react-dom": "~
|
|
39
|
-
"effect": "3.
|
|
40
|
-
"react": "~
|
|
41
|
-
"react-dom": "~
|
|
42
|
-
"vite": "7.1.
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
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": "
|
|
51
|
-
"react-dom": "
|
|
50
|
+
"react": "^19.0.0",
|
|
51
|
+
"react-dom": "^19.0.0"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
package/src/GraphPlugin.ts
CHANGED
|
@@ -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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
|
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 {
|
|
11
|
+
// import { meta } from './meta';
|
|
12
12
|
|
|
13
|
-
// const KEY = `${
|
|
13
|
+
// const KEY = `${meta.id}/app-graph`;
|
|
14
14
|
|
|
15
15
|
export default async (context: PluginContext) => {
|
|
16
16
|
const registry = context.getCapability(Capabilities.RxRegistry);
|
package/src/hooks/useNode.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -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
|
-
}
|