Skip to content

Package Graph

The workspace holds 30 packages. The diagram shows the core chain and the major feature packages; lower packages cannot import from higher ones:

graph BT
  crypto["@xnetjs/crypto"]
  identity["@xnetjs/identity"]
  storage["@xnetjs/storage"]
  sync["@xnetjs/sync"]
  data["@xnetjs/data"]
  runtime["@xnetjs/runtime"]
  react["@xnetjs/react"]
  network["@xnetjs/network"]
  plugins["@xnetjs/plugins"]
  editor["@xnetjs/editor"]
  canvas["@xnetjs/canvas"]
  devtools["@xnetjs/devtools"]
  ui["@xnetjs/ui"]
  query["@xnetjs/query"]
  views["@xnetjs/views"]
  comms["@xnetjs/comms"]
  charts["@xnetjs/charts"]
  dashboard["@xnetjs/dashboard"]
  cli["@xnetjs/cli"]
  hub["@xnetjs/hub"]

  identity --> crypto
  storage --> identity
  sync --> crypto
  sync --> identity
  data --> sync
  data --> crypto
  network --> sync
  network --> crypto
  runtime --> data
  runtime --> sync
  runtime --> storage
  react --> runtime
  plugins --> data
  editor --> |Yjs| sync
  canvas --> data
  devtools --> react
  query --> data
  query --> storage
  views --> react
  views --> ui
  comms --> data
  comms --> crypto
  dashboard --> react
  dashboard --> charts
  dashboard --> plugins
  cli --> plugins
  cli --> data
  hub --> sync
  hub --> data

  style crypto fill:#4f46e5,color:#fff,stroke:#6366f1
  style identity fill:#4f46e5,color:#fff,stroke:#6366f1
  style storage fill:#4f46e5,color:#fff,stroke:#6366f1
  style sync fill:#4f46e5,color:#fff,stroke:#6366f1
  style data fill:#4f46e5,color:#fff,stroke:#6366f1
  style runtime fill:#4f46e5,color:#fff,stroke:#6366f1
  style react fill:#4f46e5,color:#fff,stroke:#6366f1
  style network fill:#6366f1,color:#fff,stroke:#818cf8
  style plugins fill:#6366f1,color:#fff,stroke:#818cf8
  style editor fill:#6366f1,color:#fff,stroke:#818cf8
  style canvas fill:#6366f1,color:#fff,stroke:#818cf8
  style devtools fill:#6366f1,color:#fff,stroke:#818cf8
  style ui fill:#818cf8,color:#fff,stroke:#a5b4fc
  style query fill:#818cf8,color:#fff,stroke:#a5b4fc
  style views fill:#818cf8,color:#fff,stroke:#a5b4fc
  style comms fill:#818cf8,color:#fff,stroke:#a5b4fc
  style charts fill:#818cf8,color:#fff,stroke:#a5b4fc
  style dashboard fill:#818cf8,color:#fff,stroke:#a5b4fc
  style cli fill:#818cf8,color:#fff,stroke:#a5b4fc
  style hub fill:#818cf8,color:#fff,stroke:#a5b4fc

Dependencies: @noble/hashes, @noble/curves, @noble/ciphers

The foundation. Provides BLAKE3 hashing, Ed25519 signing, XChaCha20-Poly1305 encryption, X25519 key exchange, and encoding utilities. No xNet dependencies.

Dependencies: @xnetjs/crypto

DID:key creation and parsing, Ed25519/X25519 key bundle management, UCAN token creation and verification, passkey storage.

Dependencies: @xnetjs/identity

SQLite adapter for persisting Y.Doc state, node properties, offline queue entries, and registry data across web (OPFS), desktop, and mobile.

Dependencies: @xnetjs/crypto, @xnetjs/identity

Core sync primitives: Lamport clocks, Change<T> type, hash chains, Yjs security layer (signed envelopes, rate limiting, peer scoring, clientID attestation, update batching, integrity checking).

Dependencies: @xnetjs/sync, @xnetjs/crypto

Schema system (defineSchema, 15 property types), NodeStore (CRUD + change tracking), type inference (FlatNode, InferCreateProps), validation and coercion.

Dependencies: @xnetjs/data, @xnetjs/sync, @xnetjs/storage

The framework-agnostic client. createXNetClient() assembles the store, MetaBridge, SyncManager, NodePool, Registry, OfflineQueue, and the multi-hub ConnectionManager; liveQuery() exposes the universal { getSnapshot, subscribe } store contract. No React dependency — it powers React, other frameworks, CLIs, and servers alike. See ADR-14.

Dependencies: @xnetjs/runtime, react

The thin React binding: useQuery, useMutate, useNode, useIdentity, XNetProvider, and the plugin hooks. The sync engine itself lives in @xnetjs/runtime; this package re-exports it and adapts it to React via useSyncExternalStore.

Dependencies: @xnetjs/sync, @xnetjs/crypto

libp2p node setup, WebRTC and WebSocket transport, connection gating, peer scoring (GossipSub-inspired), auto-blocking, rate limiting at the connection level.

Dependencies: @xnetjs/data, acorn

Plugin system: extension manifest, registry, context, 9 contribution types, middleware chain, script sandbox (AST validation, frozen context, timeout), AI script generation, services (ProcessManager, ServiceClient), integrations (LocalAPI, MCPServer, WebhookEmitter), shortcut manager.

Dependencies: @tiptap/core, Yjs

TipTap editor wrapper with Yjs collaboration, custom extensions (Mermaid, etc.), slash command support.

Dependencies: @xnetjs/data

Infinite canvas with spatial indexing (R-tree), viewport management, zoom/pan, node positioning.

Dependencies: @xnetjs/react

10 debug panels: Nodes, Changes, Sync, Yjs, Queries, Telemetry, Schemas, Seed, History, and AuthZ. See the DevTools guide.

Shared design system: the monochrome token ramp (surface/ink/hairline), primitives, the shared task editor, and the unified drag payload. No xNet runtime dependencies.

Dependencies: @xnetjs/data, @xnetjs/storage

Query AST, saved-view descriptors, full-text search index, and the reactive saved-view runner that powers tables, boards, and widgets.

Dependencies: @xnetjs/react, @xnetjs/ui

Database view components: table, board, list, calendar, gallery, timeline — with compact modes for dashboards.

Dependencies: @xnetjs/data, @xnetjs/crypto

Chat, presence, and calls: room manager (typed awareness sessions), chat service (signed message nodes, deterministic DM ids), the local notification engine, and the full-mesh WebRTC call manager. See Chat, Presence & Calls.

Dependencies: @xnetjs/react, @xnetjs/plugins, @xnetjs/charts

Widget contract, registry, grid runtime, and sandbox tiers; charts wraps ECharts behind a library-agnostic spec. See Dashboards & Widgets.

Dependencies: @xnetjs/plugins, @xnetjs/data

The xnet command-line tool: scoped workspace checkouts, search/query, commit/daemon, sandboxed scripts, SKILL.md. See Agent Interfaces.

Dependencies: @xnetjs/sync, @xnetjs/data

The optional always-on node: relay, encrypted backup, full-text search, call signaling, UCAN-authorized actions. See the Hub guide.

core (shared primitives), sqlite & data-bridge (storage adapters), canvas-core, editor/canvas internals, formula, history (undo/redo), social (graph lenses & importers), telemetry, abuse (rate limiting & peer scoring), vectors, sdk.

Lower packages cannot import from higher ones. This ensures:

  • @xnetjs/crypto can be used standalone for any cryptographic operation
  • @xnetjs/sync can be used without React for server-side or CLI tools
  • @xnetjs/data can be used without a UI framework
  • Each package is independently testable
apps/web — The flagship workbench PWA (documents, databases, canvas,
tasks, dashboards, chat & calls)
apps/electron — Desktop wrapper adding background sync, ProcessManager,
LocalAPI, and the MCP server (@xnetjs/plugins/node)
apps/expo — Mobile (in development)

The web app is the primary surface and uses the browser-safe subset; Electron adds the Node-only service layer on top.