Package Graph
Dependency graph
Section titled “Dependency 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
Package details
Section titled “Package details”@xnet/crypto
Section titled “@xnet/crypto”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.
@xnet/identity
Section titled “@xnet/identity”Dependencies: @xnet/crypto
DID:key creation and parsing, Ed25519/X25519 key bundle management, UCAN token creation and verification, passkey storage.
@xnet/storage
Section titled “@xnet/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.
@xnet/sync
Section titled “@xnet/sync”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).
@xnet/data
Section titled “@xnet/data”Dependencies: @xnet/sync, @xnet/crypto
Schema system (defineSchema, 16 property types), NodeStore (CRUD + change tracking), type inference (FlatNode, InferCreateProps), validation and coercion.
@xnet/react
Section titled “@xnet/react”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.
@xnet/network
Section titled “@xnet/network”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.
@xnet/plugins
Section titled “@xnet/plugins”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.
@xnet/editor
Section titled “@xnet/editor”Dependencies: @tiptap/core, Yjs
TipTap editor wrapper with Yjs collaboration, custom extensions (Mermaid, etc.), slash command support.
@xnet/canvas
Section titled “@xnet/canvas”Dependencies: @xnet/data
Infinite canvas with spatial indexing (R-tree), viewport management, zoom/pan, node positioning.
@xnet/devtools
Section titled “@xnet/devtools”Dependencies: @xnet/react
7 debug panels: Sync, Store, Schema, Identity, Network, Plugins, Performance.
The rule
Section titled “The rule”Lower packages cannot import from higher ones. This ensures:
@xnet/cryptocan be used standalone for any cryptographic operation@xnet/synccan be used without React for server-side or CLI tools@xnet/datacan be used without a UI framework- Each package is independently testable
Applications
Section titled “Applications”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.