Skip to content

Package Graph

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

graph BT
  crypto["@xnet/crypto"]
  identity["@xnet/identity"]
  storage["@xnet/storage"]
  sync["@xnet/sync"]
  data["@xnet/data"]
  react["@xnet/react"]
  network["@xnet/network"]
  plugins["@xnet/plugins"]
  editor["@xnet/editor"]
  canvas["@xnet/canvas"]
  devtools["@xnet/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: @xnet/crypto

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

Dependencies: @xnet/identity

IndexedDB adapter for persisting Y.Doc state, node properties, offline queue entries, and registry data. Platform-abstracted so it can be swapped for different storage backends.

Dependencies: @xnet/crypto, @xnet/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: @xnet/sync, @xnet/crypto

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

Dependencies: @xnet/data, @xnet/sync, @xnet/storage, react

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

Dependencies: @xnet/sync, @xnet/crypto

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

Dependencies: @xnet/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: @xnet/data

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

Dependencies: @xnet/react

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

Lower packages cannot import from higher ones. This ensures:

  • @xnet/crypto can be used standalone for any cryptographic operation
  • @xnet/sync can be used without React for server-side or CLI tools
  • @xnet/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 @xnet/plugins/node for ProcessManager, LocalAPI, and MCP server. The web app uses the browser-safe subset.