Skip to main content

Crate weftos

Crate weftos 

Source
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/O
  • exochain – Append-only hash chain with Ed25519 + ML-DSA-65 signing
  • cluster – Multi-node clustering via ruvector
  • mesh – Encrypted peer-to-peer mesh networking
  • ecc – Ephemeral Causal Cognition (causal DAG, HNSW, cognitive tick)
  • wasm-sandbox – Wasmtime-based tool execution
  • containers – Docker/Podman sidecar orchestration
  • os-patterns – Self-healing, metrics, reliable IPC, timers
  • full – Everything

§Crate Ecosystem

WeftOS is built from these crates:

CrateRole
weftosProduct facade – re-exports kernel, core, types
clawft-kernelKernel: processes, services, governance, mesh, ExoChain
clawft-coreAgent framework: pipeline, context, tools, skills
clawft-typesShared type definitions
clawft-platformPlatform abstraction (native/WASM/browser)
clawft-pluginPlugin SDK for tools, channels, and extensions
clawft-llmLLM provider abstraction (11 providers + local)
exo-resource-treeHierarchical resource namespace with Merkle integrity

Source: https://github.com/weave-logic-ai/weftos

Re-exports§

pub use clawft_kernel as kernel;

Modules§

init
Project initialization for WeftOS.

Structs§

AgentCapabilities
Capabilities assigned to an agent process.
AgentSupervisor
Manages the lifecycle of kernel-managed agent processes.
AppManager
Application lifecycle manager.
AppManifest
Application manifest, parsed from weftapp.toml or weftapp.json.
BootEvent
A single boot event recorded during kernel startup.
BootLog
Boot log: a recorded sequence of boot events.
BootstrapDiscovery
Bootstrap discovery from static seed peers.
CapabilityChecker
Capability checker that enforces per-agent access control.
CapabilityGate
Gate backend wrapping the existing CapabilityChecker.
CausalGraph
A concurrent directed acyclic graph for causal reasoning.
ChainEvent
A chain event – one entry in the append-only log.
ChainManager
Thread-safe chain manager.
ClusterConfig
Cluster configuration.
ClusterMembership
ClusterServiceRegistry
Cluster-wide service registry built from advertisements.
CognitiveTick
The cognitive tick service.
CognitiveTickConfig
Configuration for the cognitive tick loop.
ContainerConfig
Configuration for the container manager.
ContainerManager
Container lifecycle manager.
CronService
Cron scheduling service.
CrossRef
A directed, typed cross-reference between two universal nodes.
CrossRefStore
Concurrent forward/reverse index of CrossRef edges.
DeadLetterQueue
Queue for messages that could not be delivered.
DedupFilter
Time-bounded deduplication filter.
DiscoveryCoordinator
Discovery coordinator that manages multiple discovery backends.
DistributedProcessTable
Distributed process table tracking processes across all nodes.
EccCalibration
Results of a boot-time calibration run.
EffectVector
5-dimensional effect vector for scoring agent actions.
GlobalPid
Globally unique process identifier: (node_id, local_pid).
GovernanceEngine
Governance engine.
GovernanceGate
Gate backend wrapping the GovernanceEngine.
GovernanceRequest
Governance evaluation request.
GovernanceRule
A governance rule that restricts agent behavior.
HealthSystem
Health monitoring system.
HeartbeatConfig
Heartbeat configuration.
HeartbeatTracker
Heartbeat tracker managing all peers.
HnswSearchResult
A single search result returned by HnswService::search.
HnswService
Kernel service wrapping the HNSW vector store.
HnswServiceConfig
Configuration for the HnswService.
ImpulseQueue
Thread-safe queue of Impulse events awaiting consumption.
InstalledApp
An installed application with its runtime state.
Kernel
The WeftOS kernel.
KernelConfigExt
Extended kernel configuration with capability defaults.
KernelIpc
Kernel IPC subsystem wrapping the core MessageBus.
KernelMessage
A typed message envelope for kernel IPC.
LogService
Structured logging service with ring buffer and query support.
MeshConnectionPool
Connection pool managing active mesh peers.
MeshIpcEnvelope
A mesh IPC envelope wrapping a KernelMessage with routing metadata.
MeshPeer
Information about a connected mesh peer.
MetricsRegistry
Registry of all kernel metrics. Lock-free on the hot path.
NamedPipeRegistry
Registry of named pipes for persistent IPC channels.
PeerNode
Information about a peer node in the cluster.
ProcessEntry
A single entry in the process table.
ProcessTable
Concurrent process table with PID allocation.
ReconciliationController
Reconciliation controller: desired state vs actual state.
ReliableQueue
Reliable message delivery with acknowledgment tracking.
ResourceLimits
Resource limits for an agent process.
ServiceEntry
First-class service identity in the registry (D1).
ServiceRegistry
Registry of system services with lifecycle management.
SpawnRequest
Request to spawn a new supervised agent process.
SpawnResult
Result of a successful agent spawn.
Subscription
A topic subscription entry.
TcpTransport
TCP mesh transport.
TimerService
Timer service: one-shot and repeating timers with message delivery.
TopicRouter
Pub/sub topic router for kernel IPC.
TreeManager
Unified facade over ResourceTree + MutationLog + ChainManager.
TreeStats
Statistics snapshot from the tree manager.
UniversalNodeId
A 32-byte BLAKE3 hash that uniquely identifies any node across all forest structures.
WeftHandshake
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.
BootPhase
Phase of the boot sequence.
CausalEdgeType
The kind of causal relationship an edge represents.
ContainerState
Container lifecycle state.
CrossRefType
The semantic relationship carried by a CrossRef.
GateDecision
Result of a gate decision.
GovernanceDecision
Governance decision for an action.
HealthStatus
Health status for a single service.
HeartbeatState
Node health state from heartbeat monitoring.
ImpulseType
Discriminant for the kind of causal event being signalled.
IpcScope
IPC scope defining which message targets an agent may communicate with.
KernelError
Kernel-level errors.
KernelSignal
Kernel control signals.
KernelState
Kernel lifecycle state.
MeshError
Mesh networking errors.
MessagePayload
Payload types for kernel messages.
MessageTarget
Target for a kernel message.
NodeState
Node health state.
OverallHealth
Aggregated health status for the entire kernel.
ProcessState
State of a kernel-managed process.
SpawnBackend
Execution backend for spawning an agent process.

Constants§

VERSION
Version information.

Traits§

GateBackend
Trait for gate backends that make access-control decisions.
MeshStream
A bidirectional byte stream over any transport.
MeshTransport
Transport-agnostic mesh transport interface.
SystemService
A system service managed by the kernel.
TransportListener
Listens for incoming mesh connections.

Functions§

is_initialized
Check if WeftOS is initialized in the given directory.

Type Aliases§

KernelResult
Convenience alias for kernel results.
Pid
Process identifier. Monotonically increasing, never reused.