Package Graph
Dependency graph
Section titled “Dependency 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
Package details
Section titled “Package details”@xnetjs/crypto
Section titled “@xnetjs/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.
@xnetjs/identity
Section titled “@xnetjs/identity”Dependencies: @xnetjs/crypto
DID:key creation and parsing, Ed25519/X25519 key bundle management, UCAN token creation and verification, passkey storage.
@xnetjs/storage
Section titled “@xnetjs/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.
@xnetjs/sync
Section titled “@xnetjs/sync”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).
@xnetjs/data
Section titled “@xnetjs/data”Dependencies: @xnetjs/sync, @xnetjs/crypto
Schema system (defineSchema, 15 property types), NodeStore (CRUD + change tracking), type inference (FlatNode, InferCreateProps), validation and coercion.
@xnetjs/react
Section titled “@xnetjs/react”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.
@xnetjs/network
Section titled “@xnetjs/network”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.
@xnetjs/plugins
Section titled “@xnetjs/plugins”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.
@xnetjs/editor
Section titled “@xnetjs/editor”Dependencies: @tiptap/core, Yjs
TipTap editor wrapper with Yjs collaboration, custom extensions (Mermaid, etc.), slash command support.
@xnetjs/canvas
Section titled “@xnetjs/canvas”Dependencies: @xnetjs/data
Infinite canvas with spatial indexing (R-tree), viewport management, zoom/pan, node positioning.
@xnetjs/devtools
Section titled “@xnetjs/devtools”Dependencies: @xnetjs/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:
@xnetjs/cryptocan be used standalone for any cryptographic operation@xnetjs/synccan be used without React for server-side or CLI tools@xnetjs/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 @xnetjs/plugins/node for ProcessManager, LocalAPI, and MCP server. The web app uses the browser-safe subset.