Skip to main content

Crate selfware

Crate selfware 

Source
Expand description

§Selfware — Your Personal AI Workshop

An agentic coding harness for local LLMs. 70+ tools, multi-agent swarm, evolution engine, hooks, MCP, LSP, and a fox mascot — all local-first, no cloud required.

§Core Features

  • 70+ Tools: File, git, cargo, search, shell, PTY, browser automation, computer control, LSP, MCP, knowledge graph, vision, FIM editing
  • Multi-Agent Swarm: Up to 16 concurrent agents with consensus voting
  • Safety: Multi-layer validation, path protection, command filtering, JSONL audit logging, permission grants with expiry
  • Hooks: Event-driven automation (PreToolUse, PostToolUse, Stop)
  • MCP: Both client (connect to external tools) and server (expose selfware tools to other AI systems)
  • LSP: Semantic code intelligence via rust-analyzer, pyright, tsserver, gopls
  • Doctor: System dependency checker (30+ tools) and LLM backend diagnostics
  • Templates: Project scaffolding for Rust, Python, Node.js with QA profiles
  • Cognition: PDVR cycle (Plan-Do-Verify-Reflect), working memory
  • Persistence: Checkpoint system for long-running tasks with session resume
  • Self-Healing: Error classification, recovery strategies, exponential backoff
  • Evolution Engine: Recursive self-improvement with SAB-based fitness
  • Local-First: Runs entirely on your hardware, zero data egress

§Quick Start

use selfware::{Agent, Config};

let config = Config::load(None)?;
let mut agent = Agent::new(config).await?;
agent.run_task("Add unit tests for the auth module").await?;

§CLI

selfware chat                    # Interactive mode
selfware run "add unit tests"    # One-shot task
selfware doctor                  # Check system dependencies
selfware init                    # Project scaffold wizard
selfware multi-chat -n 4         # Multi-agent swarm
selfware mcp-server              # Run as MCP server

See selfware.design for full documentation.

Re-exports§

pub use safety::redact;
pub use safety::sandbox;
pub use safety::threat_modeling;
pub use analysis::analyzer;
pub use analysis::bm25;
pub use analysis::vector_store;
pub use ui::demo;
pub use ui::tui;

Modules§

agent
analysis
Code analysis module
api
checkpoint
Task Checkpointing & Persistence
cli
Selfware Workshop - Your Personal AI Companion
cognitive
Cognitive and AI capabilities module
computer
Computer control module for desktop automation.
concurrency
Concurrency governor for limiting concurrent streaming and tool execution.
config
Configuration Management
container
Container Management System
doctor
Selfware Doctor — system diagnostics and dependency checker.
errors
evolution
Selfware Evolution Engine
hooks
Hook system for extensible event-driven automation.
input
Modern Input System for Selfware
interview
Interview / Clarification Mode
kv_store
Key-Value Store Module
llm_doctor
LLM Doctor — diagnostic module for local LLM backend configuration.
lsp
Language Server Protocol (LSP) client for semantic code intelligence.
mcp
Model Context Protocol (MCP) client implementation.
memory
Agent Memory Management
multiagent
Multi-Agent Chat System
output
Output Control Module
planning
Hierarchical Planning System
process_manager
Process Manager - Background Process Lifecycle Management
resource
Resource management for CPU, GPU, memory, and disk
safety
Security and safety module
self_healing
Self-Healing System
supervision
Process supervision and recovery mechanisms
swarm
Multi-Agent Swarm System
telemetry
Telemetry & Observability
templates
Template engine for scaffolding new projects from embedded templates.
token_count
Shared token counting utilities.
tokens
Token Usage Tracking and Cost Optimization
tool_parser
Robust tool call parser with XML and JSON fallback
tools
ui
Selfware UI System
verification
Verification Gates - Automatic validation after every code change
workflows
Agent Workflows

Macros§

tool_span
Create a span for tracking tool execution with automatic duration and outcome logging

Functions§

is_shutdown_requested
Check whether a graceful shutdown has been requested.
request_shutdown
Signal that a graceful shutdown has been requested.
shutdown_tracing
Flush and shut down the tracing background writer. Call this during graceful shutdown to ensure all logs are flushed.