Skip to content

Package Graph

The core dependency chain flows upward. Lower packages cannot import from higher ones:

graph BT
  crypto["@xnetjs/crypto"]
  identity["@xnetjs/identity"]
  storage["@xnetjs/storage"]
  sync["@xnetjs/sync"]
  data["@xnetjs/data"]
  react["@xnetjs/react"]
  network["@xnetjs/network"]
  plugins["@xnetjs/plugins"]
  editor["@xnetjs/editor"]
  canvas["@xnetjs/canvas"]
  devtools["@xnetjs/devtools"]

  identity --> crypto
  storage --> identity
  sync --> crypto
  sync --> identity
  data --> sync
  data --> crypto
  network --> sync
  network --> crypto
  react --> data
  react --> sync
  react --> storage
  plugins --> data
  editor --> |Yjs| sync
  canvas --> data
  devtools --> react

  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 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

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, react

React bindings: useQuery, useMutate, useNode, useIdentity, XNetProvider. Also contains the SyncManager, NodePool, Registry, OfflineQueue, ConnectionManager, MetaBridge, and plugin hooks.

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

7 debug panels: Sync, Store, Schema, Identity, Network, Plugins, Performance.

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/electron — Full-featured desktop app (all packages)
apps/web — PWA (pages only, subset of features)

The Electron app uses all packages including @xnetjs/plugins/node for ProcessManager, LocalAPI, and MCP server. The web app uses the browser-safe subset.