@dxos/plugin-explorer 0.11.1 → 0.12.0-next-2800d0376abcc62d5544afdd744b16b2b960434e

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 (136) hide show
  1. package/dist/lib/ExplorerAction.mjs +16 -0
  2. package/dist/lib/ExplorerAction.mjs.map +1 -0
  3. package/dist/lib/ExplorerEvents.mjs +15 -0
  4. package/dist/lib/ExplorerEvents.mjs.map +1 -0
  5. package/dist/lib/ExplorerPlugin.mjs +16 -2
  6. package/dist/lib/ExplorerPlugin.mjs.map +1 -0
  7. package/dist/lib/Graph.mjs +38 -0
  8. package/dist/lib/Graph.mjs.map +1 -0
  9. package/dist/lib/capabilities.mjs +19 -5
  10. package/dist/lib/capabilities.mjs.map +1 -1
  11. package/dist/lib/capabilities.node.mjs +14 -0
  12. package/dist/lib/capabilities.node.mjs.map +1 -0
  13. package/dist/lib/capabilities.workerd.mjs +14 -0
  14. package/dist/lib/capabilities.workerd.mjs.map +1 -0
  15. package/dist/lib/chunk-ExplorerArticle.mjs +3 -7
  16. package/dist/lib/chunk-ExplorerArticle.mjs.map +1 -1
  17. package/dist/lib/chunk-NeighborhoodCompanion.mjs +1 -1
  18. package/dist/lib/chunk-NeighborhoodCompanion.mjs.map +1 -1
  19. package/dist/lib/chunk-app-graph-builder.mjs +9 -7
  20. package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
  21. package/dist/lib/chunk-create-object.mjs +8 -8
  22. package/dist/lib/chunk-create-object.mjs.map +1 -1
  23. package/dist/lib/chunk-react-surface.mjs +3 -2
  24. package/dist/lib/chunk-react-surface.mjs.map +1 -1
  25. package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
  26. package/dist/lib/chunk-schema.mjs +11 -0
  27. package/dist/lib/chunk-schema.mjs.map +1 -0
  28. package/dist/lib/chunk-types.mjs +219 -53
  29. package/dist/lib/chunk-types.mjs.map +1 -1
  30. package/dist/lib/components.mjs +10 -7
  31. package/dist/lib/components.mjs.map +1 -1
  32. package/dist/lib/hooks.mjs +4 -4
  33. package/dist/lib/hooks.mjs.map +1 -1
  34. package/dist/lib/index.mjs +4 -3
  35. package/dist/lib/meta.mjs +44 -1
  36. package/dist/lib/meta.mjs.map +1 -0
  37. package/dist/lib/plugin.mjs +6 -5
  38. package/dist/lib/plugin.mjs.map +1 -1
  39. package/dist/lib/testing.mjs +22 -5
  40. package/dist/lib/testing.mjs.map +1 -1
  41. package/dist/lib/translations.mjs +1 -1
  42. package/dist/lib/types.mjs +4 -2
  43. package/dist/types/src/ExplorerPlugin.d.ts +36 -3
  44. package/dist/types/src/ExplorerPlugin.d.ts.map +1 -1
  45. package/dist/types/src/ExplorerPlugin.testing.d.ts +40 -0
  46. package/dist/types/src/ExplorerPlugin.testing.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -2
  48. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  49. package/dist/types/src/capabilities/create-object.d.ts +2 -2
  50. package/dist/types/src/capabilities/create-object.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/gen/node.d.ts +7 -0
  52. package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
  53. package/dist/types/src/capabilities/gen/workerd.d.ts +7 -0
  54. package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/index.d.ts +6 -4
  56. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  58. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/schema.d.ts +8 -0
  60. package/dist/types/src/capabilities/schema.d.ts.map +1 -0
  61. package/dist/types/src/components/Chart/Chart.stories.d.ts +4 -2
  62. package/dist/types/src/components/Chart/Chart.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/Globe/Globe.stories.d.ts +2 -2
  64. package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts +2 -1
  66. package/dist/types/src/components/Graph/CanvasForceGraph.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/Graph/ForceGraph.d.ts.map +1 -1
  68. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts +2 -1
  69. package/dist/types/src/components/Graph/ForceGraph.stories.d.ts.map +1 -1
  70. package/dist/types/src/components/Graph/graph-adapter.d.ts +8 -8
  71. package/dist/types/src/components/Graph/graph-adapter.d.ts.map +1 -1
  72. package/dist/types/src/components/Lattice/Lattice.stories.d.ts.map +1 -1
  73. package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts +5 -4
  74. package/dist/types/src/components/Tree/EdgeBundling.stories.d.ts.map +1 -1
  75. package/dist/types/src/components/Tree/types/tree.d.ts +7 -7
  76. package/dist/types/src/components/Tree/types/tree.d.ts.map +1 -1
  77. package/dist/types/src/components/Visualization/Visualization.d.ts +10 -8
  78. package/dist/types/src/components/Visualization/Visualization.d.ts.map +1 -1
  79. package/dist/types/src/components/Visualization/Visualization.stories.d.ts.map +1 -1
  80. package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.d.ts.map +1 -1
  81. package/dist/types/src/containers/ExplorerArticle/ExplorerArticle.stories.d.ts.map +1 -1
  82. package/dist/types/src/index.d.ts +3 -2
  83. package/dist/types/src/index.d.ts.map +1 -1
  84. package/dist/types/src/plugin.d.ts +2 -1
  85. package/dist/types/src/plugin.d.ts.map +1 -1
  86. package/dist/types/src/plugin.test.d.ts +2 -0
  87. package/dist/types/src/plugin.test.d.ts.map +1 -0
  88. package/dist/types/src/testing/index.d.ts +1 -1
  89. package/dist/types/src/testing/index.d.ts.map +1 -1
  90. package/dist/types/src/types/ExplorerAction.d.ts +2 -2
  91. package/dist/types/src/types/ExplorerEvents.d.ts +8 -0
  92. package/dist/types/src/types/ExplorerEvents.d.ts.map +1 -0
  93. package/dist/types/src/types/index.d.ts +1 -0
  94. package/dist/types/src/types/index.d.ts.map +1 -1
  95. package/dist/types/tsconfig.tsbuildinfo +1 -1
  96. package/dx.config.ts +1 -1
  97. package/package.json +75 -50
  98. package/src/ExplorerPlugin.testing.ts +16 -0
  99. package/src/ExplorerPlugin.ts +15 -0
  100. package/src/capabilities/app-graph-builder.ts +8 -6
  101. package/src/capabilities/create-object.ts +13 -10
  102. package/src/capabilities/gen/node.ts +21 -0
  103. package/src/capabilities/gen/workerd.ts +21 -0
  104. package/src/capabilities/index.ts +21 -4
  105. package/src/capabilities/react-surface.ts +3 -2
  106. package/src/capabilities/schema.ts +11 -0
  107. package/src/components/Graph/CanvasForceGraph.stories.tsx +7 -7
  108. package/src/components/Graph/ForceGraph.stories.tsx +11 -10
  109. package/src/components/Graph/ForceGraph.tsx +2 -1
  110. package/src/components/Graph/graph-adapter.ts +13 -11
  111. package/src/components/Lattice/Lattice.stories.tsx +13 -11
  112. package/src/components/Tree/EdgeBundling.stories.tsx +4 -4
  113. package/src/components/Tree/types/tree.ts +4 -3
  114. package/src/components/Visualization/Visualization.stories.tsx +41 -56
  115. package/src/containers/ExplorerArticle/ExplorerArticle.stories.tsx +13 -11
  116. package/src/containers/ExplorerArticle/ExplorerArticle.tsx +5 -9
  117. package/src/hooks/useGraphModel.ts +2 -2
  118. package/src/index.ts +3 -2
  119. package/src/meta.ts +1 -1
  120. package/src/plugin.test.ts +29 -0
  121. package/src/plugin.tsx +20 -0
  122. package/src/testing/index.ts +1 -2
  123. package/src/types/ExplorerAction.ts +3 -3
  124. package/src/types/ExplorerEvents.ts +16 -0
  125. package/src/types/index.ts +2 -1
  126. package/dist/lib/chunk-ExplorerPlugin.mjs +0 -18
  127. package/dist/lib/chunk-ExplorerPlugin.mjs.map +0 -1
  128. package/dist/lib/chunk-meta.mjs +0 -45
  129. package/dist/lib/chunk-meta.mjs.map +0 -1
  130. package/dist/lib/chunk-types2.mjs +0 -231
  131. package/dist/lib/chunk-types2.mjs.map +0 -1
  132. package/dist/types/src/ExplorerPlugin.test.d.ts +0 -2
  133. package/dist/types/src/ExplorerPlugin.test.d.ts.map +0 -1
  134. package/src/ExplorerPlugin.test.ts +0 -26
  135. package/src/ExplorerPlugin.tsx +0 -28
  136. package/src/plugin.ts +0 -9
@@ -0,0 +1,16 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import * as Schema from "effect/Schema";
3
+ import * as SpaceForm from "@dxos/plugin-space/SpaceForm";
4
+ //#region src/types/ExplorerAction.ts
5
+ var ExplorerAction_exports = /* @__PURE__ */ __exportAll({ GraphProps: () => GraphProps });
6
+ var GraphProps = Schema.Struct({
7
+ name: Schema.optional(Schema.String),
8
+ typename: Schema.String.pipe(Schema.annotate({ title: "Select type" }), SpaceForm.TypeInputOptionsAnnotation.set({
9
+ location: ["database", "runtime"],
10
+ kind: ["user"]
11
+ }), Schema.optional)
12
+ });
13
+ //#endregion
14
+ export { GraphProps, ExplorerAction_exports as t };
15
+
16
+ //# sourceMappingURL=ExplorerAction.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExplorerAction.mjs","names":[],"sources":["../../src/types/ExplorerAction.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport * as SpaceForm from '@dxos/plugin-space/SpaceForm';\n\nexport const GraphProps = Schema.Struct({\n name: Schema.optional(Schema.String),\n // TODO(wittjosiah): This should be a query input instead.\n typename: Schema.String.pipe(\n Schema.annotate({ title: 'Select type' }),\n SpaceForm.TypeInputOptionsAnnotation.set({\n location: ['database', 'runtime'],\n kind: ['user'],\n }),\n Schema.optional,\n ),\n});\n"],"mappings":";;;;;AAQA,IAAa,aAAa,OAAO,OAAO;CACtC,MAAM,OAAO,SAAS,OAAO,MAAM;CAEnC,UAAU,OAAO,OAAO,KACtB,OAAO,SAAS,EAAE,OAAO,cAAc,CAAC,GACxC,UAAU,2BAA2B,IAAI;EACvC,UAAU,CAAC,YAAY,SAAS;EAChC,MAAM,CAAC,MAAM;CACf,CAAC,GACD,OAAO,QACT;AACF,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { meta } from "#meta";
3
+ import * as ActivationEvent from "@dxos/app-framework/ActivationEvent";
4
+ //#region src/types/ExplorerEvents.ts
5
+ var ExplorerEvents_exports = /* @__PURE__ */ __exportAll({ Start: () => Start });
6
+ /**
7
+ * The feature's start event: the plugin's start-gated modules (and cross-plugin
8
+ * contributions consumed by this feature) activate here. Fired on demand and by the
9
+ * host's idle trickle.
10
+ */
11
+ var Start = ActivationEvent.pluginStart(meta.profile.key);
12
+ //#endregion
13
+ export { Start, ExplorerEvents_exports as t };
14
+
15
+ //# sourceMappingURL=ExplorerEvents.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExplorerEvents.mjs","names":[],"sources":["../../src/types/ExplorerEvents.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as ActivationEvent from '@dxos/app-framework/ActivationEvent';\n\nimport { meta } from '#meta';\n\n/**\n * The feature's start event: the plugin's start-gated modules (and cross-plugin\n * contributions consumed by this feature) activate here. Fired on demand and by the\n * host's idle trickle.\n */\nexport const Start = ActivationEvent.pluginStart(meta.profile.key);\n"],"mappings":";;;;;;;;;;AAeA,IAAa,QAAQ,gBAAgB,YAAY,KAAK,QAAQ,GAAG"}
@@ -1,2 +1,16 @@
1
- import { t as ExplorerPlugin } from "./chunk-ExplorerPlugin.mjs";
2
- export { ExplorerPlugin, ExplorerPlugin as default };
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { meta as meta$1 } from "#meta";
3
+ import * as Plugin from "@dxos/app-framework/Plugin";
4
+ //#region src/ExplorerPlugin.ts
5
+ var ExplorerPlugin_exports = /* @__PURE__ */ __exportAll({
6
+ make: () => make,
7
+ meta: () => meta
8
+ });
9
+ /** Plugin metadata, available without loading the plugin body. */
10
+ var meta = meta$1;
11
+ /** Constructs the plugin; the body loads on first enable. */
12
+ var make = Plugin.lazy(meta, () => import("#plugin"));
13
+ //#endregion
14
+ export { make, meta, ExplorerPlugin_exports as t };
15
+
16
+ //# sourceMappingURL=ExplorerPlugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExplorerPlugin.mjs","names":[],"sources":["../../src/ExplorerPlugin.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Plugin from '@dxos/app-framework/Plugin';\n\nimport { meta as pluginMeta } from '#meta';\n\n/** Plugin metadata, available without loading the plugin body. */\nexport const meta = pluginMeta;\n\n/** Constructs the plugin; the body loads on first enable. */\nexport const make = Plugin.lazy(meta, () => import('#plugin'));\n"],"mappings":";;;;;;;;;AAWA,IAAa,OAAO;;AAGpB,IAAa,OAAO,OAAO,KAAK,YAAY,OAAO,UAAU"}
@@ -0,0 +1,38 @@
1
+ import { t as __exportAll } from "./chunk-rolldown-runtime.mjs";
2
+ import { Annotation, DXN, Filter, Obj, Query, QueryAST, Ref, Type, View } from "@dxos/echo";
3
+ import * as Schema from "effect/Schema";
4
+ import { ViewAnnotation } from "@dxos/schema";
5
+ import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/Annotation";
6
+ //#region src/types/Graph.ts
7
+ var Graph_exports = /* @__PURE__ */ __exportAll({
8
+ Graph: () => Graph,
9
+ make: () => make
10
+ });
11
+ var Graph = class extends Type.makeObject(DXN.make("org.dxos.type.graph", "0.1.0"))(Schema.Struct({
12
+ name: Schema.optional(Schema.String),
13
+ view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false), Schema.optional),
14
+ query: Schema.Struct({
15
+ raw: Schema.optional(Schema.String),
16
+ ast: QueryAST.Query
17
+ }).pipe(FormInputAnnotation.set(false))
18
+ }).pipe(LabelAnnotation.set(["name"]), ViewAnnotation.set(["view"]), Annotation.IconAnnotation.set({
19
+ icon: "ph--graph--regular",
20
+ hue: "green"
21
+ }))) {};
22
+ /**
23
+ * Make a graph as a view of a data set.
24
+ */
25
+ var make = ({ name, query = {
26
+ raw: "",
27
+ ast: Query.select(Filter.nothing()).ast
28
+ }, view } = {}) => {
29
+ return Obj.make(Graph, {
30
+ name,
31
+ view: view && Ref.make(view),
32
+ query
33
+ });
34
+ };
35
+ //#endregion
36
+ export { Graph, make, Graph_exports as t };
37
+
38
+ //# sourceMappingURL=Graph.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Graph.mjs","names":[],"sources":["../../src/types/Graph.ts"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, DXN, Filter, Obj, Query, QueryAST, Ref, Type, View } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';\nimport { ViewAnnotation } from '@dxos/schema';\n\nexport class Graph extends Type.makeObject<Graph>(DXN.make('org.dxos.type.graph', '0.1.0'))(\n Schema.Struct({\n name: Schema.optional(Schema.String),\n view: Ref.Ref(View.View).pipe(FormInputAnnotation.set(false), Schema.optional),\n query: Schema.Struct({\n raw: Schema.optional(Schema.String),\n ast: QueryAST.Query,\n }).pipe(FormInputAnnotation.set(false)),\n }).pipe(\n LabelAnnotation.set(['name']),\n ViewAnnotation.set(['view']),\n Annotation.IconAnnotation.set({ icon: 'ph--graph--regular', hue: 'green' }),\n ),\n) {}\n\ntype MakeProps = Omit<Partial<Obj.MakeProps<typeof Graph>>, 'view'> & {\n view?: View.View;\n};\n\n/**\n * Make a graph as a view of a data set.\n */\nexport const make = ({\n name,\n query = { raw: '', ast: Query.select(Filter.nothing()).ast },\n view,\n}: MakeProps = {}): Graph => {\n return Obj.make(Graph, { name, view: view && Ref.make(view), query });\n};\n"],"mappings":";;;;;;;;;;AAUA,IAAa,QAAb,cAA2B,KAAK,WAAkB,IAAI,KAAK,uBAAuB,OAAO,CAAC,CAAC,CACzF,OAAO,OAAO;CACZ,MAAM,OAAO,SAAS,OAAO,MAAM;CACnC,MAAM,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,KAAK,oBAAoB,IAAI,KAAK,GAAG,OAAO,QAAQ;CAC7E,OAAO,OAAO,OAAO;EACnB,KAAK,OAAO,SAAS,OAAO,MAAM;EAClC,KAAK,SAAS;CAChB,CAAC,CAAC,CAAC,KAAK,oBAAoB,IAAI,KAAK,CAAC;AACxC,CAAC,CAAC,CAAC,KACD,gBAAgB,IAAI,CAAC,MAAM,CAAC,GAC5B,eAAe,IAAI,CAAC,MAAM,CAAC,GAC3B,WAAW,eAAe,IAAI;CAAE,MAAM;CAAsB,KAAK;AAAQ,CAAC,CAC5E,CACF,CAAC,CAAC,CAAC;;;;AASH,IAAa,QAAQ,EACnB,MACA,QAAQ;CAAE,KAAK;CAAI,KAAK,MAAM,OAAO,OAAO,QAAQ,CAAC,CAAC,CAAC;AAAI,GAC3D,SACa,CAAC,MAAa;CAC3B,OAAO,IAAI,KAAK,OAAO;EAAE;EAAM,MAAM,QAAQ,IAAI,KAAK,IAAI;EAAG;CAAM,CAAC;AACtE"}
@@ -1,9 +1,23 @@
1
- import { Capability } from "@dxos/app-framework";
1
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
2
+ import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
3
+ import { translations } from "#translations";
4
+ import { meta } from "#meta";
5
+ //#region PLUGIN.mdl?raw
6
+ var PLUGIN_default = "---\nid: org.dxos.plugin.explorer\nname: ExplorerPlugin\nversion: 0.1.0\n---\n\nAn interactive hypergraph visualization plugin for `DXOS` Composer that reveals relationships between objects in a workspace.\nThe plugin renders a live `Graph` object — backed by a `View` and a `QueryAST` query — through four switchable layout\nvariants: force-directed, radial cluster, edge bundling, and lattice.\nNode colours are derived from ECHO object types; hovering a node triggers an anchor-card preview.\n\n## Extensions\n\nThe following extension dialects are used in this document.\nEach extension is defined in the Appendix or resolved via its URI.\n\n| Term | URI |\n|-------------|--------------------------------|\n| `type` | `org.dxos.mdl.type@1.0` |\n| `feat` | `org.dxos.mdl.feat@1.0` |\n| `test` | `org.dxos.mdl.test@1.0` |\n| `component` | `org.dxos.mdl.component@1.0` |\n| `op` | `org.dxos.mdl.op@1.0` |\n\n## Types\n\n```mdl\ntype QueryInput\n fields:\n raw?: string # raw query string entered by the user\n ast: QueryAST.Query # compiled AST produced by QueryBuilder\n```\n\n```mdl\ntype GraphObject\n desc: ECHO-persistent object that describes a hypergraph visualisation session.\n fields:\n name?: string\n view: Ref<View> # schema view that defines visible fields\n query: QueryInput\n```\n\n```mdl\ntype ExplorerVariant\n literals: force | cluster | bundle | lattice\n```\n\n## Components\n\n```mdl\ncomponent ExplorerArticle\n desc: |\n Top-level article / section surface for a Graph object.\n Renders one of four SVG layout variants and a toolbar for switching between them.\n props:\n role: article | section\n subject: Ref<View>\n attendableId?: string\n state:\n variant: ExplorerVariant # active layout; default force\n filter?: Filter.Any # compiled from toolbar query input\n model?: SpaceGraphModel # live reactive graph built from db + filter\n slots:\n toolbar?: ReactNode # shown only when role === article\n actions:\n setVariant(v: ExplorerVariant)\n setFilter(raw: string)\n layout: |\n ┌────────────────────────────────┐\n │ [toolbar slot — article only] │\n │ [QueryEditor] [variant tabs] │\n ├────────────────────────────────┤\n │ │\n │ SVG canvas (force / cluster │\n │ / bundle / lattice) │\n │ │\n └────────────────────────────────┘\n```\n\n```mdl\ncomponent Visualization\n desc: |\n Internal component that owns a single persistent SVG.Graph mount.\n Swaps the active GraphProjector when the variant changes, seeding the\n new projector with the previous layout so node positions tween smoothly.\n props:\n variant: ExplorerVariant\n model: SpaceGraphModel\n state:\n projector?: GraphProjector<SpaceGraphNode>\n actions:\n createProjector(variant: ExplorerVariant, prev?: GraphLayout) → GraphProjector\n createRenderNode(variant: ExplorerVariant) → RenderNode\n```\n\n## Operations\n\n```mdl\nop createGraph\n desc: |\n Creates a new Graph object scoped to a target space or collection.\n Derives a ViewModel from the database for the selected typename, then\n writes the object via SpaceOperation.AddObject.\n input:\n name?: string\n typename?: string # ECHO typename used to seed the initial view\n target: Space | Collection\n targetNodeId?: string\n output: GraphObject\n effects: [echo:write]\n note: |\n The typename is resolved through ViewModel.makeFromDatabase; the resulting\n View is stored as a Ref inside the Graph object.\n```\n\n```mdl\nop buildFilter\n desc: |\n Compiles a raw query string into a Filter via QueryBuilder.\n Pure — no side effects; result is passed to SpaceGraphModel.setFilter.\n input:\n raw: string\n output: Filter.Any\n errors:\n ParseError: raw string is not valid query syntax\n```\n\n## Features\n\n```mdl\nfeat F-1: Graph Object\n\n req F-1.1: A Graph object stores a name, a View ref, and a compiled QueryAST.\n req F-1.2:\n when: user creates a new graph\n then: op:createGraph derives a ViewModel from the chosen typename and writes the Graph to ECHO\n\n req F-1.3:\n when: Graph is persisted\n then: it appears in the space object list and can be opened as an article\n```\n\n```mdl\nfeat F-2: Live Graph Model\n\n req F-2.1:\n when: ExplorerArticle mounts with a valid Graph subject\n then: SpaceGraphModel is opened against the subject's database\n\n req F-2.2:\n when: user types a query in the toolbar\n then: op:buildFilter compiles the raw string; model.setFilter applied; SVG re-renders\n\n req F-2.3:\n when: Graph is unmounted\n then: SpaceGraphModel is closed and all subscriptions released\n\n req F-2.4:\n when: an ECHO object in the database changes\n then: SpaceGraphModel emits an update and SVG.Graph re-renders without full remount\n tags: [reactive, collaborative]\n```\n\n```mdl\nfeat F-3: Visualization Variants\n\n req F-3.1:\n when: variant tab is selected\n then: Visualization swaps projector; previous node x/y seed the new projector so positions tween\n\n req F-3.2:\n when: variant is force\n then: SVG.Zoom wrapper is mounted enabling pan/zoom drag interaction\n\n req F-3.3:\n when: variant is cluster or bundle\n then: no SVG.Zoom wrapper; leaves grouped by typename; radial labels fade in after tween\n\n req F-3.4:\n when: variant is lattice\n then: nodes rendered as small rounded rectangles sorted by typename then label\n\n req F-3.5:\n when: variant is cluster and user clicks a root or group node\n then: subtree toggles collapsed/expanded via GraphClusterProjector.toggleCollapsed\n```\n\n```mdl\nfeat F-4: Node Interaction\n\n req F-4.1:\n when: pointer enters a node\n then: DxAnchorActivate event dispatched with the object's DXN and label, kind: card\n\n req F-4.2:\n when: pointer leaves a node\n then: DxAnchorActivate cleared (onNodeHover called with null)\n\n req F-4.3:\n when: node has no underlying ECHO object (synthetic root / group)\n then: no preview dispatched; node rendered in neutral colour\n```\n\n## Acceptance\n\n```mdl\ntest T-1: Graph creation\n given: user opens the object creation dialog and selects Graph\n when: a typename is selected and the form submitted\n then:\n - op:createGraph runs without error\n - new Graph object visible in space object list\n - Graph.view references a valid View object\n```\n\n```mdl\ntest T-2: Article mounts model\n given: a Graph with a populated query\n when: ExplorerArticle is rendered with role === article\n then:\n - SpaceGraphModel is opened\n - SVG canvas renders nodes derived from the database\n - toolbar shows QueryEditor and variant tabs\n```\n\n```mdl\ntest T-3: Variant switch preserves positions\n given: force variant is active with nodes positioned\n when: user switches to cluster variant\n then:\n - projector is recreated from previous layout\n - nodes tween from old positions to cluster target positions\n - SVG.Zoom wrapper is absent in the new mount\n```\n\n```mdl\ntest T-4: Query filter updates graph\n given: ExplorerArticle is open with all objects visible\n when: user types a typename filter in QueryEditor\n then:\n - op:buildFilter returns a Filter without error\n - SpaceGraphModel.setFilter applied\n - only matching nodes remain visible in the SVG\n```\n\n```mdl\ntest T-5: Node hover preview\n given: force-directed graph with at least one ECHO object node\n when: pointer enters that node\n then:\n - DxAnchorActivate event fired with correct DXN\n - kind === card\n```\n\n```mdl\ntest T-6: Lattice sort order\n given: database contains objects of two typenames A and B\n when: lattice variant is active\n then:\n - all typename-A nodes appear before typename-B nodes (or vice-versa, consistent order)\n - within each group nodes are ordered alphabetically by label\n```\n\n```mdl\ntest T-7: Model closed on unmount\n given: ExplorerArticle is mounted and SpaceGraphModel is open\n when: component unmounts\n then:\n - SpaceGraphModel.close() is called\n - no lingering ECHO subscriptions remain\n```\n\n---\n\n## Appendix: Extension Definitions\n\nExtension block types used in this document are defined below using\nthe core `ext` primitive — the only construct the base language provides.\n\n```mdl\next type\n uri: org.dxos.mdl.type@1.0\n desc: A named data structure with typed fields and optional literals.\n fields:\n desc?: Prose\n fields?: FieldMap # name[?]: TypeExpr (# inline comment)\n literals?: UnionList # a | b | c\n extends?: TypeRef[]\n```\n\n```mdl\next feat\n uri: org.dxos.mdl.feat@1.0\n desc: A named feature grouping one or more requirements.\n fields:\n desc?: Prose\n req: RequirementList\n nesting: self # feat blocks may contain feat blocks\n```\n\n```mdl\next test\n uri: org.dxos.mdl.test@1.0\n desc: An acceptance scenario expressed as given / when / then steps.\n fields:\n given?: Step | Step[]\n when?: Step | Step[]\n then: Step | Step[]\n tags?: TagList\n```\n\n```mdl\next component\n uri: org.dxos.mdl.component@1.0\n desc: A UI component with props, internal state, slots, actions, and events.\n fields:\n desc?: Prose\n props?: FieldMap # external inputs (immutable inside component)\n state?: FieldMap # internal reactive state\n slots?: FieldMap # named ReactNode injection points\n actions?: ActionMap # methods the component exposes or handles\n emits?: EventMap # events the component raises to its parent\n layout?: CodeBlock # ASCII sketch of visual structure (non-normative)\n```\n\n```mdl\next op\n uri: org.dxos.mdl.op@1.0\n desc: |\n A named operation with typed inputs, outputs, and declared errors.\n Pure ops have no effects or requires. Effectful ops declare both.\n fields:\n desc?: Prose\n input?: FieldMap # named input parameters\n output?: TypeExpr # return type\n errors?: ErrorMap # name: Prose (when this error occurs)\n effects?: EffectList # echo:read | echo:write | http | fs | ...\n requires?: ServiceList # injected service dependencies\n note?: Prose # implementation guidance (non-normative)\n```\n";
7
+ //#endregion
2
8
  //#region src/capabilities/index.ts
3
- var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("./chunk-app-graph-builder.mjs"));
4
- var CreateObject = Capability.lazy("CreateObject", () => import("./chunk-create-object.mjs"));
5
- var ReactSurface = Capability.lazy("ReactSurface", () => import("./chunk-react-surface.mjs"));
9
+ var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
10
+ var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"));
11
+ var PluginAsset = AppCapability.pluginAsset({
12
+ pluginId: meta.profile.key,
13
+ path: "PLUGIN.mdl",
14
+ content: PLUGIN_default,
15
+ mimeType: "application/x-mdl"
16
+ });
17
+ var ReactSurface = AppCapability.surface(() => import("./chunk-react-surface.mjs"), { roles: ["org.dxos.role.article", "org.dxos.role.section"] });
18
+ var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
19
+ var Translations = AppCapability.translations(translations);
6
20
  //#endregion
7
- export { AppGraphBuilder, CreateObject, ReactSurface };
21
+ export { AppGraphBuilder, CreateObject, PluginAsset, ReactSurface, Schema, Translations };
8
22
 
9
23
  //# sourceMappingURL=capabilities.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],"mappings":";;AAMA,IAAa,kBAAkB,WAAW,KAAK,yBAAyB,OAAO,gCAAsB;AACrG,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB;AAC3F,IAAa,eAAe,WAAW,KAAK,sBAAsB,OAAO,4BAAkB"}
1
+ {"version":3,"file":"capabilities.mjs","names":[],"sources":["../../src/capabilities/index.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\n// eslint-disable-next-line import/no-relative-packages\nimport pluginSpec from '../../PLUGIN.mdl?raw';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('./app-graph-builder'));\nexport const CreateObject = SpaceCapability.createObject(() => import('./create-object'));\nexport const PluginAsset = AppCapability.pluginAsset({\n pluginId: meta.profile.key,\n path: 'PLUGIN.mdl',\n content: pluginSpec,\n mimeType: 'application/x-mdl',\n});\nexport const ReactSurface = AppCapability.surface(() => import('./react-surface'), {\n roles: ['org.dxos.role.article', 'org.dxos.role.section'],\n});\nexport const Schema = AppCapability.schema(() => import('./schema'));\nexport const Translations = AppCapability.translations(translations);\n"],"mappings":";;;;;;;;AAaA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAsB;AAChG,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,4BAAkB;AACxF,IAAa,cAAc,cAAc,YAAY;CACnD,UAAU,KAAK,QAAQ;CACvB,MAAM;CACN,SAAS;CACT,UAAU;AACZ,CAAC;AACD,IAAa,eAAe,cAAc,cAAc,OAAO,8BAAoB,EACjF,OAAO,CAAC,yBAAyB,uBAAuB,EAC1D,CAAC;AACD,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAW;AACnE,IAAa,eAAe,cAAc,aAAa,YAAY"}
@@ -0,0 +1,14 @@
1
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
2
+ import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
3
+ import { translations } from "#translations";
4
+ //#region src/capabilities/gen/node.ts
5
+ var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
6
+ var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"));
7
+ var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
8
+ var Translations = AppCapability.translations(translations);
9
+ var PluginAsset = void 0;
10
+ var ReactSurface = void 0;
11
+ //#endregion
12
+ export { AppGraphBuilder, CreateObject, PluginAsset, ReactSurface, Schema, Translations };
13
+
14
+ //# sourceMappingURL=capabilities.node.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.node.mjs","names":[],"sources":["../../src/capabilities/gen/node.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'node' condition.\n\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'));\n\nexport const CreateObject = SpaceCapability.createObject(() => import('../create-object'));\n\nexport const Schema = AppCapability.schema(() => import('../schema'));\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAuB;AAEjG,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,4BAAmB;AAEzF,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAY;AAEpE,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
@@ -0,0 +1,14 @@
1
+ import * as AppCapability from "@dxos/app-toolkit/AppCapability";
2
+ import * as SpaceCapability from "@dxos/plugin-space/SpaceCapability";
3
+ import { translations } from "#translations";
4
+ //#region src/capabilities/gen/workerd.ts
5
+ var AppGraphBuilder = AppCapability.appGraphBuilder(() => import("./chunk-app-graph-builder.mjs"));
6
+ var CreateObject = SpaceCapability.createObject(() => import("./chunk-create-object.mjs"));
7
+ var Schema = AppCapability.schema(() => import("./chunk-schema.mjs"));
8
+ var Translations = AppCapability.translations(translations);
9
+ var PluginAsset = void 0;
10
+ var ReactSurface = void 0;
11
+ //#endregion
12
+ export { AppGraphBuilder, CreateObject, PluginAsset, ReactSurface, Schema, Translations };
13
+
14
+ //# sourceMappingURL=capabilities.workerd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capabilities.workerd.mjs","names":[],"sources":["../../src/capabilities/gen/workerd.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\n// GENERATED by dx-plugin — do not edit. Sliced from ../index.ts for the 'workerd' condition.\n\nimport * as AppCapability from '@dxos/app-toolkit/AppCapability';\nimport * as SpaceCapability from '@dxos/plugin-space/SpaceCapability';\n\nimport { translations } from '#translations';\n\nexport const AppGraphBuilder = AppCapability.appGraphBuilder(() => import('../app-graph-builder'));\n\nexport const CreateObject = SpaceCapability.createObject(() => import('../create-object'));\n\nexport const Schema = AppCapability.schema(() => import('../schema'));\n\nexport const Translations = AppCapability.translations(translations);\n\nexport const PluginAsset = undefined;\nexport const ReactSurface = undefined;\n"],"mappings":";;;;AAWA,IAAa,kBAAkB,cAAc,sBAAsB,OAAO,gCAAuB;AAEjG,IAAa,eAAe,gBAAgB,mBAAmB,OAAO,4BAAmB;AAEzF,IAAa,SAAS,cAAc,aAAa,OAAO,qBAAY;AAEpE,IAAa,eAAe,cAAc,aAAa,YAAY;AAEnE,IAAa,cAAc,KAAA;AAC3B,IAAa,eAAe,KAAA"}
@@ -1,10 +1,9 @@
1
+ import { useCallback, useEffect, useState } from "react";
1
2
  import { Obj } from "@dxos/echo";
2
- import { useCallback, useEffect, useMemo, useState } from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { DxAnchorActivate, Icon, Panel, Toolbar } from "@dxos/react-ui";
5
5
  import "@dxos/react-ui-graph/styles/graph.css";
6
6
  import { AppSurface } from "@dxos/app-toolkit/ui";
7
- import { QueryBuilder } from "@dxos/echo-query";
8
7
  import { useObject } from "@dxos/echo-react";
9
8
  import { QueryEditor } from "@dxos/react-ui-components";
10
9
  import { VARIANTS, Visualization, isVariant } from "#components";
@@ -15,10 +14,7 @@ var ExplorerArticle = ({ role, subject, variant }) => {
15
14
  const [filter, setFilter] = useState();
16
15
  const db = view && Obj.getDatabase(view);
17
16
  const model = useGraphModel(db, filter);
18
- const builder = useMemo(() => new QueryBuilder(), []);
19
- const handleChange = useCallback((value) => {
20
- setFilter(builder.build(value).filter);
21
- }, [builder]);
17
+ const handleFilterChange = useCallback(({ filter }) => setFilter(filter), []);
22
18
  const [selected, setSelected] = useState(isVariant(variant) ? variant : "force");
23
19
  useEffect(() => {
24
20
  if (isVariant(variant)) setSelected(variant);
@@ -56,7 +52,7 @@ var ExplorerArticle = ({ role, subject, variant }) => {
56
52
  asChild: true,
57
53
  children: /* @__PURE__ */ jsxs(Toolbar.Root, { children: [/* @__PURE__ */ jsx(QueryEditor, {
58
54
  db,
59
- onChange: handleChange
55
+ onFilterChange: handleFilterChange
60
56
  }), /* @__PURE__ */ jsx(Toolbar.ToggleGroup, {
61
57
  type: "single",
62
58
  value: selected,
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-ExplorerArticle.mjs","names":[],"sources":["../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Filter, Obj, type View } from '@dxos/echo';\nimport { QueryBuilder } from '@dxos/echo-query';\nimport { useObject } from '@dxos/echo-react';\nimport { DxAnchorActivate, Icon, Panel, Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport { type TreeNode } from '@dxos/react-ui-graph';\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nimport { type ExplorerArticleVariant, VARIANTS, Visualization, isVariant } from '#components';\nimport { useGraphModel } from '#hooks';\n\nexport type { ExplorerArticleVariant } from '#components';\n\nexport type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;\n\nexport const ExplorerArticle = ({ role, subject, variant }: ExplorerArticleProps) => {\n const [view] = useObject(subject);\n const [filter, setFilter] = useState<Filter.Any>();\n\n const db = view && Obj.getDatabase(view);\n const model = useGraphModel(db, filter);\n\n const builder = useMemo(() => new QueryBuilder(), []);\n const handleChange = useCallback<NonNullable<QueryEditorProps['onChange']>>(\n (value) => {\n setFilter(builder.build(value).filter);\n },\n [builder],\n );\n\n const [selected, setSelected] = useState<ExplorerArticleVariant>(isVariant(variant) ? variant : 'force');\n useEffect(() => {\n if (isVariant(variant)) {\n setSelected(variant);\n }\n }, [variant]);\n\n const handleVariantChange = useCallback((value: string) => {\n if (isVariant(value)) {\n setSelected(value);\n }\n }, []);\n\n // Dismiss the preview popover. The dxn/label/trigger fields are placeholders ignored on\n // `state: false`.\n const handleDismiss = useCallback(() => {\n document.defaultView?.dispatchEvent(\n new DxAnchorActivate({ dxn: '', label: '', trigger: document.body, state: false }),\n );\n }, []);\n\n const handleHover = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n // Pointer left the node/label: keep the popover open so it can be hovered/interacted with.\n // The popover is dismissed only on an explicit click on the component surface (handleDismiss).\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getURI(obj);\n if (!dxn) {\n return;\n }\n\n const target = event.target as HTMLElement;\n target.dispatchEvent(\n new DxAnchorActivate({\n dxn,\n kind: 'card',\n trigger: target,\n label: Obj.getLabel(obj) ?? dxn,\n }),\n );\n }, []);\n\n const showToolbar = role === AppSurface.Article.role;\n\n if (!db || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n {showToolbar && (\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <QueryEditor db={db} onChange={handleChange} />\n <Toolbar.ToggleGroup type='single' value={selected} onValueChange={handleVariantChange}>\n {VARIANTS.map(({ value, icon, label }) => (\n <Toolbar.ToggleGroupItem key={value} value={value} aria-label={label} title={label}>\n <Icon icon={icon} size={4} />\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n )}\n <Panel.Content asChild>\n <Visualization.Root\n classNames='dx-base-surface'\n variant={selected}\n model={model}\n onSurfaceClick={handleDismiss}\n >\n <Visualization.Graph onNodeHover={handleHover} />\n </Visualization.Root>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nExplorerArticle.displayName = 'ExplorerArticle';\n"],"mappings":";;;;;;;;;;;;AAsBA,IAAa,mBAAmB,EAAE,MAAM,SAAS,cAAoC;CACnF,MAAM,CAAC,QAAQ,UAAU,OAAO;CAChC,MAAM,CAAC,QAAQ,aAAa,SAAqB;CAEjD,MAAM,KAAK,QAAQ,IAAI,YAAY,IAAI;CACvC,MAAM,QAAQ,cAAc,IAAI,MAAM;CAEtC,MAAM,UAAU,cAAc,IAAI,aAAa,GAAG,CAAC,CAAC;CACpD,MAAM,eAAe,aAClB,UAAU;EACT,UAAU,QAAQ,MAAM,KAAK,CAAC,CAAC,MAAM;CACvC,GACA,CAAC,OAAO,CACV;CAEA,MAAM,CAAC,UAAU,eAAe,SAAiC,UAAU,OAAO,IAAI,UAAU,OAAO;CACvG,gBAAgB;EACd,IAAI,UAAU,OAAO,GACnB,YAAY,OAAO;CAEvB,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,sBAAsB,aAAa,UAAkB;EACzD,IAAI,UAAU,KAAK,GACjB,YAAY,KAAK;CAErB,GAAG,CAAC,CAAC;CAIL,MAAM,gBAAgB,kBAAkB;EACtC,SAAS,aAAa,cACpB,IAAI,iBAAiB;GAAE,KAAK;GAAI,OAAO;GAAI,SAAS,SAAS;GAAM,OAAO;EAAM,CAAC,CACnF;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,aAAa,MAAuB,UAAuB;EAG7E,IAAI,CAAC,QAAQ,CAAC,OACZ;EAEF,MAAM,MAAM,KAAK;EACjB,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,GAAG,GAC3B;EAEF,MAAM,MAAM,IAAI,OAAO,GAAG;EAC1B,IAAI,CAAC,KACH;EAGF,MAAM,SAAS,MAAM;EACrB,OAAO,cACL,IAAI,iBAAiB;GACnB;GACA,MAAM;GACN,SAAS;GACT,OAAO,IAAI,SAAS,GAAG,KAAK;EAC9B,CAAC,CACH;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,SAAS,WAAW,QAAQ;CAEhD,IAAI,CAAC,MAAM,CAAC,OACV,OAAO;CAGT,OACE,qBAAC,MAAM,MAAP;EAAkB;YAAlB,CACG,eACC,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,qBAAC,QAAQ,MAAT,EAAA,UAAA,CACE,oBAAC,aAAD;IAAiB;IAAI,UAAU;GAAe,CAAA,GAC9C,oBAAC,QAAQ,aAAT;IAAqB,MAAK;IAAS,OAAO;IAAU,eAAe;cAChE,SAAS,KAAK,EAAE,OAAO,MAAM,YAC5B,oBAAC,QAAQ,iBAAT;KAA4C;KAAO,cAAY;KAAO,OAAO;eAC3E,oBAAC,MAAD;MAAY;MAAM,MAAM;KAAI,CAAA;IACL,GAFK,KAEL,CAC1B;GACkB,CAAA,CACT,EAAA,CAAA;EACD,CAAA,GAEjB,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,oBAAC,cAAc,MAAf;IACE,YAAW;IACX,SAAS;IACF;IACP,gBAAgB;cAEhB,oBAAC,cAAc,OAAf,EAAqB,aAAa,YAAc,CAAA;GAC9B,CAAA;EACP,CAAA,CACL;;AAEhB;AAEA,gBAAgB,cAAc"}
1
+ {"version":3,"file":"chunk-ExplorerArticle.mjs","names":[],"sources":["../../src/containers/ExplorerArticle/ExplorerArticle.tsx"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useState } from 'react';\n\nimport { AppSurface } from '@dxos/app-toolkit/ui';\nimport { type Filter, Obj, type View } from '@dxos/echo';\nimport { useObject } from '@dxos/echo-react';\nimport { DxAnchorActivate, Icon, Panel, Toolbar } from '@dxos/react-ui';\nimport { QueryEditor, type QueryEditorProps } from '@dxos/react-ui-components';\nimport { type TreeNode } from '@dxos/react-ui-graph';\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nimport { type ExplorerArticleVariant, VARIANTS, Visualization, isVariant } from '#components';\nimport { useGraphModel } from '#hooks';\n\nexport type { ExplorerArticleVariant } from '#components';\n\nexport type ExplorerArticleProps = AppSurface.ObjectArticleProps<View.View>;\n\nexport const ExplorerArticle = ({ role, subject, variant }: ExplorerArticleProps) => {\n const [view] = useObject(subject);\n const [filter, setFilter] = useState<Filter.Any>();\n\n const db = view && Obj.getDatabase(view);\n const model = useGraphModel(db, filter);\n\n const handleFilterChange = useCallback<NonNullable<QueryEditorProps['onFilterChange']>>(\n ({ filter }) => setFilter(filter),\n [],\n );\n\n const [selected, setSelected] = useState<ExplorerArticleVariant>(isVariant(variant) ? variant : 'force');\n useEffect(() => {\n if (isVariant(variant)) {\n setSelected(variant);\n }\n }, [variant]);\n\n const handleVariantChange = useCallback((value: string) => {\n if (isVariant(value)) {\n setSelected(value);\n }\n }, []);\n\n // Dismiss the preview popover. The dxn/label/trigger fields are placeholders ignored on\n // `state: false`.\n const handleDismiss = useCallback(() => {\n document.defaultView?.dispatchEvent(\n new DxAnchorActivate({ dxn: '', label: '', trigger: document.body, state: false }),\n );\n }, []);\n\n const handleHover = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n // Pointer left the node/label: keep the popover open so it can be hovered/interacted with.\n // The popover is dismissed only on an explicit click on the component surface (handleDismiss).\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getURI(obj);\n if (!dxn) {\n return;\n }\n\n const target = event.target as HTMLElement;\n target.dispatchEvent(\n new DxAnchorActivate({\n dxn,\n kind: 'card',\n trigger: target,\n label: Obj.getLabel(obj) ?? dxn,\n }),\n );\n }, []);\n\n const showToolbar = role === AppSurface.Article.role;\n\n if (!db || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n {showToolbar && (\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <QueryEditor db={db} onFilterChange={handleFilterChange} />\n <Toolbar.ToggleGroup type='single' value={selected} onValueChange={handleVariantChange}>\n {VARIANTS.map(({ value, icon, label }) => (\n <Toolbar.ToggleGroupItem key={value} value={value} aria-label={label} title={label}>\n <Icon icon={icon} size={4} />\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n )}\n <Panel.Content asChild>\n <Visualization.Root\n classNames='dx-base-surface'\n variant={selected}\n model={model}\n onSurfaceClick={handleDismiss}\n >\n <Visualization.Graph onNodeHover={handleHover} />\n </Visualization.Root>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nExplorerArticle.displayName = 'ExplorerArticle';\n"],"mappings":";;;;;;;;;;;AAqBA,IAAa,mBAAmB,EAAE,MAAM,SAAS,cAAoC;CACnF,MAAM,CAAC,QAAQ,UAAU,OAAO;CAChC,MAAM,CAAC,QAAQ,aAAa,SAAqB;CAEjD,MAAM,KAAK,QAAQ,IAAI,YAAY,IAAI;CACvC,MAAM,QAAQ,cAAc,IAAI,MAAM;CAEtC,MAAM,qBAAqB,aACxB,EAAE,aAAa,UAAU,MAAM,GAChC,CAAC,CACH;CAEA,MAAM,CAAC,UAAU,eAAe,SAAiC,UAAU,OAAO,IAAI,UAAU,OAAO;CACvG,gBAAgB;EACd,IAAI,UAAU,OAAO,GACnB,YAAY,OAAO;CAEvB,GAAG,CAAC,OAAO,CAAC;CAEZ,MAAM,sBAAsB,aAAa,UAAkB;EACzD,IAAI,UAAU,KAAK,GACjB,YAAY,KAAK;CAErB,GAAG,CAAC,CAAC;CAIL,MAAM,gBAAgB,kBAAkB;EACtC,SAAS,aAAa,cACpB,IAAI,iBAAiB;GAAE,KAAK;GAAI,OAAO;GAAI,SAAS,SAAS;GAAM,OAAO;EAAM,CAAC,CACnF;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,aAAa,MAAuB,UAAuB;EAG7E,IAAI,CAAC,QAAQ,CAAC,OACZ;EAEF,MAAM,MAAM,KAAK;EACjB,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,GAAG,GAC3B;EAEF,MAAM,MAAM,IAAI,OAAO,GAAG;EAC1B,IAAI,CAAC,KACH;EAGF,MAAM,SAAS,MAAM;EACrB,OAAO,cACL,IAAI,iBAAiB;GACnB;GACA,MAAM;GACN,SAAS;GACT,OAAO,IAAI,SAAS,GAAG,KAAK;EAC9B,CAAC,CACH;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,SAAS,WAAW,QAAQ;CAEhD,IAAI,CAAC,MAAM,CAAC,OACV,OAAO;CAGT,OACE,qBAAC,MAAM,MAAP;EAAkB;EAAlB,UAAA,CACG,eACC,oBAAC,MAAM,SAAP;GAAe,SAAA;GACb,UAAA,qBAAC,QAAQ,MAAT,EAAA,UAAA,CACE,oBAAC,aAAD;IAAiB;IAAI,gBAAgB;GAAqB,CAAA,GAC1D,oBAAC,QAAQ,aAAT;IAAqB,MAAK;IAAS,OAAO;IAAU,eAAe;IAChE,UAAA,SAAS,KAAK,EAAE,OAAO,MAAM,YAC5B,oBAAC,QAAQ,iBAAT;KAA4C;KAAO,cAAY;KAAO,OAAO;KAC3E,UAAA,oBAAC,MAAD;MAAY;MAAM,MAAM;KAAI,CAAA;IACL,GAFK,KAEL,CAC1B;GACkB,CAAA,CACT,EAAA,CAAA;EACD,CAAA,GAEjB,oBAAC,MAAM,SAAP;GAAe,SAAA;GACb,UAAA,oBAAC,cAAc,MAAf;IACE,YAAW;IACX,SAAS;IACF;IACP,gBAAgB;IAEhB,UAAA,oBAAC,cAAc,OAAf,EAAqB,aAAa,YAAc,CAAA;GAC9B,CAAA;EACP,CAAA,CACL;;AAEhB;AAEA,gBAAgB,cAAc"}
@@ -1,6 +1,6 @@
1
- import { Obj } from "@dxos/echo";
2
1
  import { meta } from "#meta";
3
2
  import { useCallback, useState } from "react";
3
+ import { Obj } from "@dxos/echo";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { DxAnchorActivate, Panel, Toolbar, useTranslation } from "@dxos/react-ui";
6
6
  import "@dxos/react-ui-graph/styles/graph.css";
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-NeighborhoodCompanion.mjs","names":[],"sources":["../../src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { DxAnchorActivate, Panel, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type TreeNode } from '@dxos/react-ui-graph';\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nimport { Visualization } from '#components';\nimport { DEFAULT_NEIGHBORHOOD_DEPTH, useNeighborhoodModel } from '#hooks';\nimport { meta } from '#meta';\n\n/** Selectable traversal depths offered in the companion toolbar. */\nconst DEPTHS = [1, 2, 3] as const;\n\nexport type NeighborhoodCompanionProps = {\n role?: string;\n /** The active node whose neighbourhood is rendered (passed as the companion subject). */\n subject: Obj.Any;\n};\n\n/**\n * Companion that renders the n-hop neighbourhood of the active node as an ego-centric radial graph,\n * with the active node at the centre. Depth (number of hops traversed) is adjustable in the toolbar.\n */\nexport const NeighborhoodCompanion = ({ role = 'article', subject }: NeighborhoodCompanionProps) => {\n const { t } = useTranslation(meta.profile.key);\n const [depth, setDepth] = useState<number>(DEFAULT_NEIGHBORHOOD_DEPTH);\n const model = useNeighborhoodModel(subject, depth);\n\n const handleDepthChange = useCallback((value: string) => {\n const next = Number.parseInt(value, 10);\n if (Number.isFinite(next)) {\n setDepth(next);\n }\n }, []);\n\n // Dismiss the preview popover. The dxn/label/trigger fields are placeholders ignored on `state: false`.\n const handleDismiss = useCallback(() => {\n document.defaultView?.dispatchEvent(\n new DxAnchorActivate({ dxn: '', label: '', trigger: document.body, state: false }),\n );\n }, []);\n\n const handleHover = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n // Pointer left the node/label: keep the popover open so it can be hovered/interacted with.\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getURI(obj);\n if (!dxn) {\n return;\n }\n\n const target = event.target as HTMLElement;\n target.dispatchEvent(new DxAnchorActivate({ dxn, kind: 'card', trigger: target, label: Obj.getLabel(obj) ?? dxn }));\n }, []);\n\n if (!subject || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <div className='grow' />\n <Toolbar.ToggleGroup type='single' value={String(depth)} onValueChange={handleDepthChange}>\n {DEPTHS.map((value) => (\n <Toolbar.ToggleGroupItem\n key={value}\n value={String(value)}\n aria-label={t('depth.label', { count: value })}\n title={t('depth.label', { count: value })}\n >\n {value}\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Visualization.Root\n classNames='dx-base-surface'\n model={model}\n variant='neighborhood'\n focus={subject.id}\n onSurfaceClick={handleDismiss}\n >\n <Visualization.Graph onNodeHover={handleHover} />\n </Visualization.Root>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nNeighborhoodCompanion.displayName = 'NeighborhoodCompanion';\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,SAAS;CAAC;CAAG;CAAG;AAAC;;;;;AAYvB,IAAa,yBAAyB,EAAE,OAAO,WAAW,cAA0C;CAClG,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,CAAC,OAAO,YAAY,SAAiB,0BAA0B;CACrE,MAAM,QAAQ,qBAAqB,SAAS,KAAK;CAEjD,MAAM,oBAAoB,aAAa,UAAkB;EACvD,MAAM,OAAO,OAAO,SAAS,OAAO,EAAE;EACtC,IAAI,OAAO,SAAS,IAAI,GACtB,SAAS,IAAI;CAEjB,GAAG,CAAC,CAAC;CAGL,MAAM,gBAAgB,kBAAkB;EACtC,SAAS,aAAa,cACpB,IAAI,iBAAiB;GAAE,KAAK;GAAI,OAAO;GAAI,SAAS,SAAS;GAAM,OAAO;EAAM,CAAC,CACnF;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,aAAa,MAAuB,UAAuB;EAE7E,IAAI,CAAC,QAAQ,CAAC,OACZ;EAEF,MAAM,MAAM,KAAK;EACjB,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,GAAG,GAC3B;EAEF,MAAM,MAAM,IAAI,OAAO,GAAG;EAC1B,IAAI,CAAC,KACH;EAGF,MAAM,SAAS,MAAM;EACrB,OAAO,cAAc,IAAI,iBAAiB;GAAE;GAAK,MAAM;GAAQ,SAAS;GAAQ,OAAO,IAAI,SAAS,GAAG,KAAK;EAAI,CAAC,CAAC;CACpH,GAAG,CAAC,CAAC;CAEL,IAAI,CAAC,WAAW,CAAC,OACf,OAAO;CAGT,OACE,qBAAC,MAAM,MAAP;EAAkB;YAAlB,CACE,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,qBAAC,QAAQ,MAAT,EAAA,UAAA,CACE,oBAAC,OAAD,EAAK,WAAU,OAAQ,CAAA,GACvB,oBAAC,QAAQ,aAAT;IAAqB,MAAK;IAAS,OAAO,OAAO,KAAK;IAAG,eAAe;cACrE,OAAO,KAAK,UACX,oBAAC,QAAQ,iBAAT;KAEE,OAAO,OAAO,KAAK;KACnB,cAAY,EAAE,eAAe,EAAE,OAAO,MAAM,CAAC;KAC7C,OAAO,EAAE,eAAe,EAAE,OAAO,MAAM,CAAC;eAEvC;IACsB,GANlB,KAMkB,CAC1B;GACkB,CAAA,CACT,EAAA,CAAA;EACD,CAAA,GACf,oBAAC,MAAM,SAAP;GAAe,SAAA;aACb,oBAAC,cAAc,MAAf;IACE,YAAW;IACJ;IACP,SAAQ;IACR,OAAO,QAAQ;IACf,gBAAgB;cAEhB,oBAAC,cAAc,OAAf,EAAqB,aAAa,YAAc,CAAA;GAC9B,CAAA;EACP,CAAA,CACL;;AAEhB;AAEA,sBAAsB,cAAc"}
1
+ {"version":3,"file":"chunk-NeighborhoodCompanion.mjs","names":[],"sources":["../../src/containers/NeighborhoodCompanion/NeighborhoodCompanion.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useState } from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport { DxAnchorActivate, Panel, Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type TreeNode } from '@dxos/react-ui-graph';\nimport '@dxos/react-ui-graph/styles/graph.css';\n\nimport { Visualization } from '#components';\nimport { DEFAULT_NEIGHBORHOOD_DEPTH, useNeighborhoodModel } from '#hooks';\nimport { meta } from '#meta';\n\n/** Selectable traversal depths offered in the companion toolbar. */\nconst DEPTHS = [1, 2, 3] as const;\n\nexport type NeighborhoodCompanionProps = {\n role?: string;\n /** The active node whose neighbourhood is rendered (passed as the companion subject). */\n subject: Obj.Any;\n};\n\n/**\n * Companion that renders the n-hop neighbourhood of the active node as an ego-centric radial graph,\n * with the active node at the centre. Depth (number of hops traversed) is adjustable in the toolbar.\n */\nexport const NeighborhoodCompanion = ({ role = 'article', subject }: NeighborhoodCompanionProps) => {\n const { t } = useTranslation(meta.profile.key);\n const [depth, setDepth] = useState<number>(DEFAULT_NEIGHBORHOOD_DEPTH);\n const model = useNeighborhoodModel(subject, depth);\n\n const handleDepthChange = useCallback((value: string) => {\n const next = Number.parseInt(value, 10);\n if (Number.isFinite(next)) {\n setDepth(next);\n }\n }, []);\n\n // Dismiss the preview popover. The dxn/label/trigger fields are placeholders ignored on `state: false`.\n const handleDismiss = useCallback(() => {\n document.defaultView?.dispatchEvent(\n new DxAnchorActivate({ dxn: '', label: '', trigger: document.body, state: false }),\n );\n }, []);\n\n const handleHover = useCallback((node: TreeNode | null, event?: MouseEvent) => {\n // Pointer left the node/label: keep the popover open so it can be hovered/interacted with.\n if (!node || !event) {\n return;\n }\n const obj = node.data;\n if (!obj || !Obj.isObject(obj)) {\n return;\n }\n const dxn = Obj.getURI(obj);\n if (!dxn) {\n return;\n }\n\n const target = event.target as HTMLElement;\n target.dispatchEvent(new DxAnchorActivate({ dxn, kind: 'card', trigger: target, label: Obj.getLabel(obj) ?? dxn }));\n }, []);\n\n if (!subject || !model) {\n return null;\n }\n\n return (\n <Panel.Root role={role}>\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <div className='grow' />\n <Toolbar.ToggleGroup type='single' value={String(depth)} onValueChange={handleDepthChange}>\n {DEPTHS.map((value) => (\n <Toolbar.ToggleGroupItem\n key={value}\n value={String(value)}\n aria-label={t('depth.label', { count: value })}\n title={t('depth.label', { count: value })}\n >\n {value}\n </Toolbar.ToggleGroupItem>\n ))}\n </Toolbar.ToggleGroup>\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <Visualization.Root\n classNames='dx-base-surface'\n model={model}\n variant='neighborhood'\n focus={subject.id}\n onSurfaceClick={handleDismiss}\n >\n <Visualization.Graph onNodeHover={handleHover} />\n </Visualization.Root>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nNeighborhoodCompanion.displayName = 'NeighborhoodCompanion';\n"],"mappings":";;;;;;;;;;AAgBA,IAAM,SAAS;CAAC;CAAG;CAAG;AAAC;;;;;AAYvB,IAAa,yBAAyB,EAAE,OAAO,WAAW,cAA0C;CAClG,MAAM,EAAE,MAAM,eAAe,KAAK,QAAQ,GAAG;CAC7C,MAAM,CAAC,OAAO,YAAY,SAAiB,0BAA0B;CACrE,MAAM,QAAQ,qBAAqB,SAAS,KAAK;CAEjD,MAAM,oBAAoB,aAAa,UAAkB;EACvD,MAAM,OAAO,OAAO,SAAS,OAAO,EAAE;EACtC,IAAI,OAAO,SAAS,IAAI,GACtB,SAAS,IAAI;CAEjB,GAAG,CAAC,CAAC;CAGL,MAAM,gBAAgB,kBAAkB;EACtC,SAAS,aAAa,cACpB,IAAI,iBAAiB;GAAE,KAAK;GAAI,OAAO;GAAI,SAAS,SAAS;GAAM,OAAO;EAAM,CAAC,CACnF;CACF,GAAG,CAAC,CAAC;CAEL,MAAM,cAAc,aAAa,MAAuB,UAAuB;EAE7E,IAAI,CAAC,QAAQ,CAAC,OACZ;EAEF,MAAM,MAAM,KAAK;EACjB,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,GAAG,GAC3B;EAEF,MAAM,MAAM,IAAI,OAAO,GAAG;EAC1B,IAAI,CAAC,KACH;EAGF,MAAM,SAAS,MAAM;EACrB,OAAO,cAAc,IAAI,iBAAiB;GAAE;GAAK,MAAM;GAAQ,SAAS;GAAQ,OAAO,IAAI,SAAS,GAAG,KAAK;EAAI,CAAC,CAAC;CACpH,GAAG,CAAC,CAAC;CAEL,IAAI,CAAC,WAAW,CAAC,OACf,OAAO;CAGT,OACE,qBAAC,MAAM,MAAP;EAAkB;EAAlB,UAAA,CACE,oBAAC,MAAM,SAAP;GAAe,SAAA;GACb,UAAA,qBAAC,QAAQ,MAAT,EAAA,UAAA,CACE,oBAAC,OAAD,EAAK,WAAU,OAAQ,CAAA,GACvB,oBAAC,QAAQ,aAAT;IAAqB,MAAK;IAAS,OAAO,OAAO,KAAK;IAAG,eAAe;IACrE,UAAA,OAAO,KAAK,UACX,oBAAC,QAAQ,iBAAT;KAEE,OAAO,OAAO,KAAK;KACnB,cAAY,EAAE,eAAe,EAAE,OAAO,MAAM,CAAC;KAC7C,OAAO,EAAE,eAAe,EAAE,OAAO,MAAM,CAAC;KAEvC,UAAA;IACsB,GANlB,KAMkB,CAC1B;GACkB,CAAA,CACT,EAAA,CAAA;EACD,CAAA,GACf,oBAAC,MAAM,SAAP;GAAe,SAAA;GACb,UAAA,oBAAC,cAAc,MAAf;IACE,YAAW;IACJ;IACP,SAAQ;IACR,OAAO,QAAQ;IACf,gBAAgB;IAEhB,UAAA,oBAAC,cAAc,OAAf,EAAqB,aAAa,YAAc,CAAA;GAC9B,CAAA;EACP,CAAA,CACL;;AAEhB;AAEA,sBAAsB,cAAc"}
@@ -1,18 +1,20 @@
1
- import { Capability } from "@dxos/app-framework";
2
- import { Position } from "@dxos/util";
3
- import { AppCapabilities, AppNode } from "@dxos/app-toolkit";
4
1
  import { meta } from "#meta";
2
+ import { Position } from "@dxos/util";
5
3
  import * as Effect from "effect/Effect";
6
- import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
4
+ import * as Capability from "@dxos/app-framework/Capability";
5
+ import * as AppGraphBuilder from "@dxos/app-graph/AppGraphBuilder";
6
+ import * as AppCapabilities from "@dxos/app-toolkit/AppCapabilities";
7
+ import * as AppNode from "@dxos/app-toolkit/AppNode";
8
+ import * as AppNodeMatcher from "@dxos/app-toolkit/AppNodeMatcher";
7
9
  //#region src/capabilities/app-graph-builder.ts
8
10
  /**
9
11
  * Offers a "Neighborhood" companion on any ECHO object. The matched node is passed through as the
10
12
  * companion's `companionTo` (the active node), which the surface renders as an ego-centric graph.
11
13
  */
12
14
  var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
13
- const extensions = yield* Effect.all([GraphBuilder.createExtension({
15
+ const extensions = yield* Effect.all([AppGraphBuilder.createExtension({
14
16
  id: "neighborhoodCompanion",
15
- match: NodeMatcher.whenEchoObjectMatches,
17
+ match: AppNodeMatcher.whenEchoObjectMatches,
16
18
  connector: () => Effect.succeed([AppNode.makeCompanion({
17
19
  variant: "neighborhood",
18
20
  label: ["neighborhood-companion.label", { ns: meta.profile.key }],
@@ -21,7 +23,7 @@ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function
21
23
  position: Position.last
22
24
  })])
23
25
  })]);
24
- return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
26
+ return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);
25
27
  }));
26
28
  //#endregion
27
29
  export { app_graph_builder_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { Position } from '@dxos/util';\n\nimport { meta } from '#meta';\n\n/**\n * Offers a \"Neighborhood\" companion on any ECHO object. The matched node is passed through as the\n * companion's `companionTo` (the active node), which the surface renders as an ego-centric graph.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: 'neighborhoodCompanion',\n match: NodeMatcher.whenEchoObjectMatches,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n variant: 'neighborhood',\n label: ['neighborhood-companion.label', { ns: meta.profile.key }],\n icon: 'ph--share-network--regular',\n data: 'neighborhood',\n position: Position.last,\n }),\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;AAiBA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,OAAO,IAAI,CACnC,aAAa,gBAAgB;EAC3B,IAAI;EACJ,OAAO,YAAY;EACnB,iBACE,OAAO,QAAQ,CACb,QAAQ,cAAc;GACpB,SAAS;GACT,OAAO,CAAC,gCAAgC,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;GAChE,MAAM;GACN,MAAM;GACN,UAAU,SAAS;EACrB,CAAC,CACH,CAAC;CACL,CAAC,CACH,CAAC;CAED,OAAO,WAAW,YAAY,gBAAgB,iBAAiB,UAAU;AAC3E,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as AppGraphBuilder from '@dxos/app-graph/AppGraphBuilder';\nimport * as AppCapabilities from '@dxos/app-toolkit/AppCapabilities';\nimport * as AppNode from '@dxos/app-toolkit/AppNode';\nimport * as AppNodeMatcher from '@dxos/app-toolkit/AppNodeMatcher';\nimport { Position } from '@dxos/util';\n\nimport { meta } from '#meta';\n\n/**\n * Offers a \"Neighborhood\" companion on any ECHO object. The matched node is passed through as the\n * companion's `companionTo` (the active node), which the surface renders as an ego-centric graph.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n AppGraphBuilder.createExtension({\n id: 'neighborhoodCompanion',\n match: AppNodeMatcher.whenEchoObjectMatches,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n variant: 'neighborhood',\n label: ['neighborhood-companion.label', { ns: meta.profile.key }],\n icon: 'ph--share-network--regular',\n data: 'neighborhood',\n position: Position.last,\n }),\n ]),\n }),\n ]);\n\n return Capability.contribute(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;;;;;;AAmBA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,OAAO,IAAI,CACnC,gBAAgB,gBAAgB;EAC9B,IAAI;EACJ,OAAO,eAAe;EACtB,iBACE,OAAO,QAAQ,CACb,QAAQ,cAAc;GACpB,SAAS;GACT,OAAO,CAAC,gCAAgC,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;GAChE,MAAM;GACN,MAAM;GACN,UAAU,SAAS;EACrB,CAAC,CACH,CAAC;CACL,CAAC,CACH,CAAC;CAED,OAAO,WAAW,WAAW,gBAAgB,iBAAiB,UAAU;AAC1E,CAAC,CACH"}
@@ -1,13 +1,14 @@
1
- import { Capability } from "@dxos/app-framework";
2
- import { SpaceCapabilities, SpaceOperation } from "@dxos/plugin-space";
1
+ import { ExplorerAction, Graph } from "#types";
3
2
  import { Type } from "@dxos/echo";
4
3
  import { ViewModel } from "@dxos/schema";
5
- import { ExplorerAction, Graph } from "#types";
6
4
  import * as Effect from "effect/Effect";
7
- import { Operation } from "@dxos/compute";
5
+ import * as Capability from "@dxos/app-framework/Capability";
6
+ import * as Operation from "@dxos/compute/Operation";
7
+ import * as SpaceCapabilities from "@dxos/plugin-space/SpaceCapabilities";
8
+ import * as SpaceOperation from "@dxos/plugin-space/SpaceOperation";
8
9
  //#region src/capabilities/create-object.ts
9
10
  var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
10
- return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
11
+ return Capability.contribute(SpaceCapabilities.CreateObjectEntry, {
11
12
  id: Type.getTypename(Graph.Graph),
12
13
  inputSchema: ExplorerAction.GraphProps,
13
14
  createObject: (props, options) => Effect.gen(function* () {
@@ -23,9 +24,8 @@ var create_object_default = Capability.makeModule(Effect.fnUntraced(function* ()
23
24
  });
24
25
  return yield* Operation.invoke(SpaceOperation.AddObject, {
25
26
  object,
26
- target: options.target,
27
- targetNodeId: options.targetNodeId
28
- });
27
+ target: options.target
28
+ }, { spaceId: options.db.spaceId });
29
29
  })
30
30
  });
31
31
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-create-object.mjs","names":[],"sources":["../../src/capabilities/create-object.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Type } from '@dxos/echo';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\nimport { ViewModel } from '@dxos/schema';\n\nimport { ExplorerAction, Graph } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Graph.Graph),\n inputSchema: ExplorerAction.GraphProps,\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = yield* Effect.promise(async () => {\n const view = props.typename\n ? (await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename })).view\n : undefined;\n return Graph.make({ name: props.name, view });\n });\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object,\n target: options.target,\n targetNodeId: options.targetNodeId,\n });\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;;AAeA,IAAA,wBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,YAAY,kBAAkB,mBAAmB;EACjE,IAAI,KAAK,YAAY,MAAM,KAAK;EAChC,aAAa,eAAe;EAC5B,eAAe,OAAO,YACpB,OAAO,IAAI,aAAa;GACtB,MAAM,SAAS,OAAO,OAAO,QAAQ,YAAY;IAC/C,MAAM,OAAO,MAAM,YACd,MAAM,UAAU,iBAAiB;KAAE,IAAI,QAAQ;KAAI,UAAU,MAAM;IAAS,CAAC,EAAA,CAAG,OACjF,KAAA;IACJ,OAAO,MAAM,KAAK;KAAE,MAAM,MAAM;KAAM;IAAK,CAAC;GAC9C,CAAC;GACD,OAAO,OAAO,UAAU,OAAO,eAAe,WAAW;IACvD;IACA,QAAQ,QAAQ;IAChB,cAAc,QAAQ;GACxB,CAAC;EACH,CAAC;CACL,CAAC;AACH,CAAC,CACH"}
1
+ {"version":3,"file":"chunk-create-object.mjs","names":[],"sources":["../../src/capabilities/create-object.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Operation from '@dxos/compute/Operation';\nimport { Type } from '@dxos/echo';\nimport * as SpaceCapabilities from '@dxos/plugin-space/SpaceCapabilities';\nimport * as SpaceOperation from '@dxos/plugin-space/SpaceOperation';\nimport { ViewModel } from '@dxos/schema';\n\nimport { ExplorerAction, Graph } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contribute(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Graph.Graph),\n inputSchema: ExplorerAction.GraphProps,\n createObject: (props, options) =>\n Effect.gen(function* () {\n const object = yield* Effect.promise(async () => {\n const view = props.typename\n ? (await ViewModel.makeFromDatabase({ db: options.db, typename: props.typename })).view\n : undefined;\n return Graph.make({ name: props.name, view });\n });\n return yield* Operation.invoke(\n SpaceOperation.AddObject,\n {\n object,\n target: options.target,\n },\n { spaceId: options.db.spaceId },\n );\n }),\n });\n }),\n);\n"],"mappings":";;;;;;;;;AAeA,IAAA,wBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,OAAO,WAAW,WAAW,kBAAkB,mBAAmB;EAChE,IAAI,KAAK,YAAY,MAAM,KAAK;EAChC,aAAa,eAAe;EAC5B,eAAe,OAAO,YACpB,OAAO,IAAI,aAAa;GACtB,MAAM,SAAS,OAAO,OAAO,QAAQ,YAAY;IAC/C,MAAM,OAAO,MAAM,YACd,MAAM,UAAU,iBAAiB;KAAE,IAAI,QAAQ;KAAI,UAAU,MAAM;IAAS,CAAC,EAAA,CAAG,OACjF,KAAA;IACJ,OAAO,MAAM,KAAK;KAAE,MAAM,MAAM;KAAM;IAAK,CAAC;GAC9C,CAAC;GACD,OAAO,OAAO,UAAU,OACtB,eAAe,WACf;IACE;IACA,QAAQ,QAAQ;GAClB,GACA,EAAE,SAAS,QAAQ,GAAG,QAAQ,CAChC;EACF,CAAC;CACL,CAAC;AACH,CAAC,CACH"}
@@ -1,11 +1,12 @@
1
- import { Capabilities, Capability } from "@dxos/app-framework";
2
1
  import { Graph } from "#types";
2
+ import * as Capabilities from "@dxos/app-framework/Capabilities";
3
3
  import { Surface } from "@dxos/app-framework/ui";
4
4
  import * as Effect from "effect/Effect";
5
+ import * as Capability from "@dxos/app-framework/Capability";
5
6
  import { AppSurface } from "@dxos/app-toolkit/ui";
6
7
  import { ExplorerArticle, NeighborhoodCompanion } from "#containers";
7
8
  //#region src/capabilities/react-surface.ts
8
- var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [Surface.create({
9
+ var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contribute(Capabilities.ReactSurface, [Surface.create({
9
10
  id: "article",
10
11
  filter: AppSurface.oneOf(AppSurface.object(AppSurface.Article, Graph.Graph), AppSurface.object(AppSurface.Section, Graph.Graph)),
11
12
  component: ExplorerArticle,
@@ -1 +1 @@
1
- {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { ExplorerArticle, NeighborhoodCompanion } from '#containers';\nimport { Graph } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: 'article',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Graph.Graph),\n AppSurface.object(AppSurface.Section, Graph.Graph),\n ),\n component: ExplorerArticle,\n props: ({ role, data: { subject, attendableId } }) => ({ role, subject, attendableId }),\n }),\n // Neighborhood companion offered on any ECHO object; `companionTo` is the active node.\n Surface.create({\n id: 'neighborhood',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'neighborhood'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: NeighborhoodCompanion,\n props: ({ role, data: { companionTo } }) => ({ role, subject: companionTo }),\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;AAaA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,YAAY,aAAa,cAAc,CAChD,QAAQ,OAAO;CACb,IAAI;CAEJ,QAAQ,WAAW,MACjB,WAAW,OAAO,WAAW,SAAS,MAAM,KAAK,GACjD,WAAW,OAAO,WAAW,SAAS,MAAM,KAAK,CACnD;CACA,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,SAAS,sBAAsB;EAAE;EAAM;EAAS;CAAa;AACvF,CAAC,GAED,QAAQ,OAAO;CACb,IAAI;CACJ,QAAQ,WAAW,MACjB,WAAW,QAAQ,WAAW,SAAS,cAAc,GACrD,WAAW,UAAU,WAAW,OAAO,CACzC;CACA,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,qBAAqB;EAAE;EAAM,SAAS;CAAY;AAC5E,CAAC,CACH,CAAC,CACH,CACF"}
1
+ {"version":3,"file":"chunk-react-surface.mjs","names":[],"sources":["../../src/capabilities/react-surface.ts"],"sourcesContent":["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { AppSurface } from '@dxos/app-toolkit/ui';\n\nimport { ExplorerArticle, NeighborhoodCompanion } from '#containers';\nimport { Graph } from '#types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contribute(Capabilities.ReactSurface, [\n Surface.create({\n id: 'article',\n // TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.\n filter: AppSurface.oneOf(\n AppSurface.object(AppSurface.Article, Graph.Graph),\n AppSurface.object(AppSurface.Section, Graph.Graph),\n ),\n component: ExplorerArticle,\n props: ({ role, data: { subject, attendableId } }) => ({ role, subject, attendableId }),\n }),\n // Neighborhood companion offered on any ECHO object; `companionTo` is the active node.\n Surface.create({\n id: 'neighborhood',\n filter: AppSurface.allOf(\n AppSurface.literal(AppSurface.Article, 'neighborhood'),\n AppSurface.companion(AppSurface.Article),\n ),\n component: NeighborhoodCompanion,\n props: ({ role, data: { companionTo } }) => ({ role, subject: companionTo }),\n }),\n ]),\n ),\n);\n"],"mappings":";;;;;;;;AAcA,IAAA,wBAAe,WAAW,iBACxB,OAAO,QACL,WAAW,WAAW,aAAa,cAAc,CAC/C,QAAQ,OAAO;CACb,IAAI;CAEJ,QAAQ,WAAW,MACjB,WAAW,OAAO,WAAW,SAAS,MAAM,KAAK,GACjD,WAAW,OAAO,WAAW,SAAS,MAAM,KAAK,CACnD;CACA,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,SAAS,sBAAsB;EAAE;EAAM;EAAS;CAAa;AACvF,CAAC,GAED,QAAQ,OAAO;CACb,IAAI;CACJ,QAAQ,WAAW,MACjB,WAAW,QAAQ,WAAW,SAAS,cAAc,GACrD,WAAW,UAAU,WAAW,OAAO,CACzC;CACA,WAAW;CACX,QAAQ,EAAE,MAAM,MAAM,EAAE,qBAAqB;EAAE;EAAM,SAAS;CAAY;AAC5E,CAAC,CACH,CAAC,CACH,CACF"}
@@ -0,0 +1,13 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __defProp = Object.defineProperty;
3
+ var __exportAll = (all, no_symbols) => {
4
+ let target = {};
5
+ for (var name in all) __defProp(target, name, {
6
+ get: all[name],
7
+ enumerable: true
8
+ });
9
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
+ return target;
11
+ };
12
+ //#endregion
13
+ export { __exportAll as t };
@@ -0,0 +1,11 @@
1
+ import { Graph } from "#types";
2
+ //#region src/capabilities/schema.ts
3
+ /**
4
+ * Schemas this plugin registers, loaded on demand: the capability activates at idle,
5
+ * so naming them here keeps them out of the plugin body's module graph.
6
+ */
7
+ var schema_default = [Graph.Graph];
8
+ //#endregion
9
+ export { schema_default as default };
10
+
11
+ //# sourceMappingURL=chunk-schema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-schema.mjs","names":[],"sources":["../../src/capabilities/schema.ts"],"sourcesContent":["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Graph } from '#types';\n\n/**\n * Schemas this plugin registers, loaded on demand: the capability activates at idle,\n * so naming them here keeps them out of the plugin body's module graph.\n */\nexport default [Graph.Graph];\n"],"mappings":";;;;;;AAUA,IAAA,iBAAe,CAAC,MAAM,KAAK"}