Expand description
WeftOS: A portable AI kernel for any project.
Add WeftOS to your project to get process management, mesh networking, capability-based security, an append-only audit chain, and a cognitive substrate that learns your codebase.
§Quick Start
use weftos::WeftOs;
#[tokio::main]
async fn main() {
let os = WeftOs::boot_default().await.unwrap();
println!("WeftOS running: {} services", os.service_count());
os.shutdown().await.unwrap();
}§Feature Flags
native(default) – Tokio runtime, native file I/Oexochain– Append-only hash chain with Ed25519 + ML-DSA-65 signingcluster– Multi-node clustering via ruvectormesh– Encrypted peer-to-peer mesh networkingecc– Ephemeral Causal Cognition (causal DAG, HNSW, cognitive tick)wasm-sandbox– Wasmtime-based tool executioncontainers– Docker/Podman sidecar orchestrationos-patterns– Self-healing, metrics, reliable IPC, timersfull– Everything
§Crate Ecosystem
WeftOS is built from these crates:
| Crate | Role |
|---|---|
weftos | Product facade – re-exports kernel, core, types |
clawft-kernel | Kernel: processes, services, governance, mesh, ExoChain |
clawft-core | Agent framework: pipeline, context, tools, skills |
clawft-types | Shared type definitions |
clawft-platform | Platform abstraction (native/WASM/browser) |
clawft-plugin | Plugin SDK for tools, channels, and extensions |
clawft-llm | LLM provider abstraction (11 providers + local) |
exo-resource-tree | Hierarchical resource namespace with Merkle integrity |
Re-exports§
pub use clawft_kernel as kernel;
Modules§
- init
- Project initialization for WeftOS.
Structs§
- Agent
Capabilities - Capabilities assigned to an agent process.
- Agent
Supervisor - Manages the lifecycle of kernel-managed agent processes.
- AppManager
- Application lifecycle manager.
- AppManifest
- Application manifest, parsed from
weftapp.tomlorweftapp.json. - Boot
Event - A single boot event recorded during kernel startup.
- BootLog
- Boot log: a recorded sequence of boot events.
- Bootstrap
Discovery - Bootstrap discovery from static seed peers.
- Capability
Checker - Capability checker that enforces per-agent access control.
- Capability
Gate - Gate backend wrapping the existing
CapabilityChecker. - Causal
Graph - A concurrent directed acyclic graph for causal reasoning.
- Chain
Event - A chain event – one entry in the append-only log.
- Chain
Manager - Thread-safe chain manager.
- Cluster
Config - Cluster configuration.
- Cluster
Membership - Cluster
Service Registry - Cluster-wide service registry built from advertisements.
- Cognitive
Tick - The cognitive tick service.
- Cognitive
Tick Config - Configuration for the cognitive tick loop.
- Container
Config - Configuration for the container manager.
- Container
Manager - Container lifecycle manager.
- Cron
Service - Cron scheduling service.
- Cross
Ref - A directed, typed cross-reference between two universal nodes.
- Cross
RefStore - Concurrent forward/reverse index of
CrossRefedges. - Dead
Letter Queue - Queue for messages that could not be delivered.
- Dedup
Filter - Time-bounded deduplication filter.
- Discovery
Coordinator - Discovery coordinator that manages multiple discovery backends.
- Distributed
Process Table - Distributed process table tracking processes across all nodes.
- EccCalibration
- Results of a boot-time calibration run.
- Effect
Vector - 5-dimensional effect vector for scoring agent actions.
- Global
Pid - Globally unique process identifier: (node_id, local_pid).
- Governance
Engine - Governance engine.
- Governance
Gate - Gate backend wrapping the
GovernanceEngine. - Governance
Request - Governance evaluation request.
- Governance
Rule - A governance rule that restricts agent behavior.
- Health
System - Health monitoring system.
- Heartbeat
Config - Heartbeat configuration.
- Heartbeat
Tracker - Heartbeat tracker managing all peers.
- Hnsw
Search Result - A single search result returned by
HnswService::search. - Hnsw
Service - Kernel service wrapping the HNSW vector store.
- Hnsw
Service Config - Configuration for the
HnswService. - Impulse
Queue - Thread-safe queue of
Impulseevents awaiting consumption. - Installed
App - An installed application with its runtime state.
- Kernel
- The WeftOS kernel.
- Kernel
Config Ext - Extended kernel configuration with capability defaults.
- Kernel
Ipc - Kernel IPC subsystem wrapping the core MessageBus.
- Kernel
Message - A typed message envelope for kernel IPC.
- LogService
- Structured logging service with ring buffer and query support.
- Mesh
Connection Pool - Connection pool managing active mesh peers.
- Mesh
IpcEnvelope - A mesh IPC envelope wrapping a KernelMessage with routing metadata.
- Mesh
Peer - Information about a connected mesh peer.
- Metrics
Registry - Registry of all kernel metrics. Lock-free on the hot path.
- Named
Pipe Registry - Registry of named pipes for persistent IPC channels.
- Peer
Node - Information about a peer node in the cluster.
- Process
Entry - A single entry in the process table.
- Process
Table - Concurrent process table with PID allocation.
- Reconciliation
Controller - Reconciliation controller: desired state vs actual state.
- Reliable
Queue - Reliable message delivery with acknowledgment tracking.
- Resource
Limits - Resource limits for an agent process.
- Service
Entry - First-class service identity in the registry (D1).
- Service
Registry - Registry of system services with lifecycle management.
- Spawn
Request - Request to spawn a new supervised agent process.
- Spawn
Result - Result of a successful agent spawn.
- Subscription
- A topic subscription entry.
- TcpTransport
- TCP mesh transport.
- Timer
Service - Timer service: one-shot and repeating timers with message delivery.
- Topic
Router - Pub/sub topic router for kernel IPC.
- Tree
Manager - Unified facade over ResourceTree + MutationLog + ChainManager.
- Tree
Stats - Statistics snapshot from the tree manager.
- Universal
Node Id - A 32-byte BLAKE3 hash that uniquely identifies any node across all forest structures.
- Weft
Handshake - WeftOS mesh handshake payload (sent inside Noise XX step 3).
- WeftOs
- The main WeftOS instance – boots and manages the kernel.
Enums§
- AppState
- Application lifecycle state.
- Boot
Phase - Phase of the boot sequence.
- Causal
Edge Type - The kind of causal relationship an edge represents.
- Container
State - Container lifecycle state.
- Cross
RefType - The semantic relationship carried by a
CrossRef. - Gate
Decision - Result of a gate decision.
- Governance
Decision - Governance decision for an action.
- Health
Status - Health status for a single service.
- Heartbeat
State - Node health state from heartbeat monitoring.
- Impulse
Type - Discriminant for the kind of causal event being signalled.
- IpcScope
- IPC scope defining which message targets an agent may communicate with.
- Kernel
Error - Kernel-level errors.
- Kernel
Signal - Kernel control signals.
- Kernel
State - Kernel lifecycle state.
- Mesh
Error - Mesh networking errors.
- Message
Payload - Payload types for kernel messages.
- Message
Target - Target for a kernel message.
- Node
State - Node health state.
- Overall
Health - Aggregated health status for the entire kernel.
- Process
State - State of a kernel-managed process.
- Spawn
Backend - Execution backend for spawning an agent process.
Constants§
- VERSION
- Version information.
Traits§
- Gate
Backend - Trait for gate backends that make access-control decisions.
- Mesh
Stream - A bidirectional byte stream over any transport.
- Mesh
Transport - Transport-agnostic mesh transport interface.
- System
Service - A system service managed by the kernel.
- Transport
Listener - Listens for incoming mesh connections.
Functions§
- is_
initialized - Check if WeftOS is initialized in the given directory.
Type Aliases§
- Kernel
Result - Convenience alias for kernel results.
- Pid
- Process identifier. Monotonically increasing, never reused.