selfware 0.6.3

Your personal AI workshop — software you own, software that lasts
Documentation
[package]
name = "selfware"
default-run = "selfware"
version = "0.6.3"
edition = "2021"
license = "MIT"
description = "Your personal AI workshop — software you own, software that lasts"
authors = ["Trebuchet Network"]
homepage = "https://selfware.design"
repository = "https://github.com/architehc/selfware"
keywords = ["ai", "agent", "local-first", "cli", "automation"]
categories = ["command-line-utilities", "development-tools"]
readme = "README.md"
rust-version = "1.91"
documentation = "https://docs.rs/selfware"
exclude = [
    "system_tests/",
    "experiments/",
    "k8s/",
    "docs/",
    "selfware.toml",
    "*.zip",
    "Dockerfile",
    ".dockerignore",
    ".tarpaulin.toml",
    "deny.toml",
    ".pre-commit-config.yaml",
    ".github/",
    # Non-source residue that shouldn't ship in the crate (verified none is
    # include_str!'d or used by build.rs): editor/IDE sources.
    # NB: do NOT exclude scripts/ wholesale — scripts/playwright-bridge.js is a
    # runtime dependency of the page_control tool (src/tools/page_controller.rs).
    "editors/",
    "vscode-selfware/",
    "selfware-27b-concurrency16.toml",
]

[dependencies]
tokio = { version = "1.51", features = ["rt-multi-thread", "macros", "sync", "time", "fs", "io-util", "process", "signal"] }
anyhow = "1.0"
thiserror = "2.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
reqwest = { version = "0.13", features = ["json", "stream", "blocking"] }
clap = { version = "4.4", features = ["derive"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
git2 = "0.21"  # Updated for security fixes (RUSTSEC-2026-0183, RUSTSEC-2026-0184)
walkdir = "2.4"
wait-timeout = "0.2"
regex = "1.11"
colored = "3.1"
chrono = { version = "0.4", features = ["serde"] }
futures = "0.3"
async-trait = "0.1"
tempfile = "3.9"
base64 = "0.22"
glob = "0.3"
sha2 = "0.10"
shlex = "1"
pbkdf2 = "0.12"
hmac = "0.12"
hex = "0.4"
toml = "1.1"
uuid = { version = "1.23", features = ["v4"] }
once_cell = "1.19"
tiktoken-rs = "0.9"
whoami = "2.1"

# Modern CLI/TUI
reedline = "0.46"
crossterm = "0.29"
ratatui = "0.30"
fuzzy-matcher = "0.3"
syntect = "5.2"
nu-ansi-term = "0.50"
dirs = "6.0"
pulldown-cmark = "0.13"  # Markdown parsing (0.12+ has breaking API changes)
similar = "2.4"  # Diff algorithm
unicode-width = "0.2"  # Unicode character display width
rand = "0.10"  # Random number generation
url = "2"  # URL parsing for SSRF protection
ctrlc = "3"

# Vector Memory & RAG
hnsw_rs = "0.3"  # Hierarchical Navigable Small World graphs (embedded vector search)
bincode = { version = "2.0", features = ["serde"] }  # Fast binary serialization
aes-gcm = "0.10"
keyring = "3.6"

# Workflows
serde_yaml = "0.9"  # YAML workflow definitions
zeroize = "1.8.2"
parking_lot = "0.12.5"
lru = "0.16.3"
libloading = "0.9.0"
sysinfo = "0.38.3"
# crates.io llmfit-core (ported from pinned git rev f216779 in 217aa2d7 — the
# crates.io API differs slightly: mut provider binding, gpu_available_gb field).
# selfware IS published to crates.io; this dependency must stay versioned.
llmfit-core = { version = "1.1" }
xcap = "0.3"
nvml-wrapper = "0.12.1"
zstd = "0.13.3"
openssl = { version = "0.10", features = ["vendored"], optional = true }  # For cross-compilation in release builds
redis = { version = "0.27", optional = true, features = ["aio", "tokio-comp"] }  # Redis backend for workflow state
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif"] }  # For visual stuck-loop detection
tokenizers = { version = "0.22.2", features = ["hf-hub", "http"] }
tracing-appender = "0.2.4"
opentelemetry = "0.21.0"
opentelemetry_sdk = { version = "0.21.0", features = ["rt-tokio"] }
opentelemetry-otlp = "0.14.0"
tracing-opentelemetry = "0.22.0"
metrics = "0.21.0"
metrics-exporter-prometheus = "0.12.1"
syn = { version = "2.0", features = ["full", "parsing"] }

# Self-evolve feature (code graph + evolution UI server)
axum = "0.7"
tower-http = { version = "0.5", features = ["fs"] }
tree-sitter = "0.22"
tree-sitter-rust = "0.21"

[target.'cfg(unix)'.dependencies]
nix = { version = "0.29", features = ["signal"] }

[features]
default = ["tui", "resilience", "execution-modes", "log-analysis", "tokens", "self-improvement", "consolidation"]
integration = []  # Enable with: cargo test --features integration

# Semantic feature flags (replacing monolithic "extras")
# TUI dashboard mode with animations and demos
tui = []
# Self-healing and graceful degradation
resilience = []
# Execution control modes (dry-run, confirm, yolo)
execution-modes = []
# Log analysis and diagnostics
log-analysis = []
# Token counting and management
tokens = []
# Recursive self-improvement loop
self-improvement = []
# Dynamic library hot-reload (security-sensitive, off by default)
hot-reload = []
# Vendored OpenSSL for cross-compilation (release builds)
vendored-openssl = ["dep:openssl"]

# VLM benchmark suite for visual understanding evaluation
vlm-bench = []

# Concurrent benchmark harness for throughput testing
bench-harness = []

# Memory consolidation ("sleep") system
consolidation = []

# Context-selection benchmark experiment (experiments/context_select)
context-select = []

# Tool-verification harness (experiments/tool_verify)
tool-verify = []

# System-level E2E tests (require live LLM endpoint, run manually)
system-tests = []

# Redis backend for workflow state (optional, requires redis server)
redis = ["dep:redis"]

# Convenience feature that enables all optional modules
extras = ["tui", "resilience", "execution-modes", "log-analysis", "tokens", "self-improvement", "hot-reload", "vlm-bench", "bench-harness", "consolidation"]

[dev-dependencies]
tokio-test = "0.4"
tower = { version = "0.4", features = ["util"] }  # ServiceExt::oneshot for evolve server tests
criterion = { version = "0.8", features = ["html_reports"] }
proptest = "1.5"
assert_cmd = "2.1.2"
predicates = "3.1.4"

[lib]
name = "selfware"
path = "src/lib.rs"

[[bin]]
name = "selfware"
path = "src/main.rs"

[[test]]
name = "tool_contracts"
path = "tests/tool_contracts.rs"

[[test]]
name = "unit"
path = "tests/unit/mod.rs"

[[test]]
name = "evolve"
path = "tests/evolve/mod.rs"

[[test]]
name = "integration"
path = "tests/integration/mod.rs"
required-features = ["integration"]

# Examples
[[example]]
name = "basic_chat"
path = "examples/basic_chat.rs"

[[example]]
name = "run_task"
path = "examples/run_task.rs"

[[example]]
name = "multi_agent"
path = "examples/multi_agent.rs"

[[example]]
name = "custom_config"
path = "examples/custom_config.rs"

[[example]]
name = "endpoint_smoke"
path = "examples/endpoint_smoke.rs"

[[example]]
name = "bench_32_streams"
path = "examples/bench_32_streams.rs"
required-features = ["bench-harness"]

[[example]]
name = "browser_bench"
path = "examples/browser_bench.rs"
required-features = ["bench-harness"]

[[example]]
name = "full_flow_test"
path = "examples/full_flow_test.rs"
required-features = ["bench-harness", "resilience"]

[[example]]
name = "multilang_bench"
path = "examples/multilang_bench.rs"
required-features = ["bench-harness"]

[[example]]
name = "swebench_eval"
path = "examples/swebench_eval.rs"
required-features = ["bench-harness"]

[[example]]
name = "quant_benchmark"
path = "examples/quant_benchmark.rs"

[[example]]
name = "quant_recommend"
path = "examples/quant_recommend.rs"

# VLM Benchmark binaries
[[bin]]
name = "codegraph"
path = "src/bin/codegraph.rs"

[[bin]]
name = "visual_polish_test"
path = "system_tests/visual_polish_loop.rs"
required-features = ["system-tests"]

[[bin]]
name = "frame_analyzer"
path = "system_tests/frame_analyzer.rs"
required-features = ["system-tests"]

[[bin]]
name = "vlm_gen_fixtures"
path = "src/bin/vlm_gen_fixtures.rs"
required-features = ["vlm-bench"]

[[bin]]
name = "vlm_bench_run"
path = "src/bin/vlm_bench_run.rs"
required-features = ["vlm-bench"]

[[bin]]
name = "computer_control_test"
path = "system_tests/computer_control_test.rs"
required-features = ["system-tests"]

# Context-selection benchmark experiment (standalone; reuses BM25 + skeleton + token counting)
[[bin]]
name = "context_select_bench"
path = "experiments/context_select/main.rs"
required-features = ["context-select"]

# Tool-verification harness: forces the configured model (GLM-5.2) to call every
# registered tool and validates the arguments against each tool's JSON schema.
[[bin]]
name = "tool_verify"
path = "experiments/tool_verify/main.rs"
required-features = ["tool-verify"]

# Benchmarks
[[bench]]
name = "vlm_benchmark"
harness = false
required-features = ["vlm-bench"]

[[test]]
name = "visual_e2e"
path = "tests/visual_e2e.rs"
required-features = ["integration"]

[profile.release]
lto = "thin"
codegen-units = 1
strip = true
opt-level = 3

[profile.release-fast]
inherits = "release"
lto = false
codegen-units = 16