Comprehensive SAL and automation framework for Hero OS with Rhai scripting.
- Rust 99.2%
- HTML 0.5%
- Makefile 0.3%
| .claude | ||
| .codegraph | ||
| .forgejo/workflows | ||
| .hero | ||
| crates | ||
| docs/hero_lib | ||
| examples | ||
| patches | ||
| .gitignore | ||
| .test | ||
| Cargo.toml | ||
| ci-containers.conf | ||
| CLAUDE.md | ||
| LICENSE | ||
| README.md | ||
| rust-toolchain.toml | ||
Herocode Herolib Rust
A comprehensive System Abstraction Layer (SAL) and automation framework built in Rust, organized as a Cargo workspace of focused library crates.
Project Overview
Herolib provides a unified interface for system operations, services, cryptography, storage, and AI integration across platforms. It is a library-only workspace — the crates are meant to be consumed as dependencies; the workspace ships no installable binaries.
Workspace Crates
| Crate | Package | Description |
|---|---|---|
core |
herolib_core |
Core utilities: text processing, networking, logger, Redis client, and the HeroScript DSL. |
os |
herolib_os |
Unified system utilities: OS, process, git, kernel/rootfs, and SSH/network helpers. |
mos |
herolib_mos |
Mycelium Operating System layer: network namespaces, VETH setup, system facts, Cloud Hypervisor VM launcher. |
virt |
herolib_virt |
Virtualization and container management: Buildah, Nerdctl, Podman, Cloud Hypervisor, qcow2, Kubernetes. |
crypt |
herolib_crypt |
Asymmetric (Ed25519/X25519) and symmetric cryptography plus HTTP signatures. |
vault |
herolib_vault |
Secure key management with a Redis backend (Ed25519, Sr25519, symmetric). |
sid |
herolib_sid |
SmartID — short, human-readable, collision-free identifiers. |
clients |
herolib_clients |
Unified client library: PostgreSQL, MQTT, Hetzner, VastAI, OpenCode. |
clients_core |
herolib_clients_core |
Foundational, dependency-light clients: Mycelium, HeroDB, NTP, GeoIP. |
code |
herolib_code |
Code analysis and parsing utilities for Rust sources, plus a Rust build helper. |
oschema |
herolib_oschema |
OSIS — canonical types, OTOML serialization, OsisObject trait, OCollection filesystem storage. |
oschema_server |
herolib_oschema_server |
Axum runtime for OSchema/OpenRPC services: Hero context/claims headers, CRUD hooks, JSON-RPC dispatch. |
openrpc |
herolib_openrpc |
OpenRPC transport (HTTP-over-UDS, SSE) and spec types. |
acp |
herolib_acp |
Agent Client Protocol (ACP) client for ACP-compliant AI agents. |
ai |
herolib_ai |
Direct multi-provider AI client (chat, completions, embeddings, STT/TTS, reranking, image generation, agents). |
ai_test |
ai_direct_test |
Test harness / CLI exercising herolib_ai against live and mock providers. |
macros |
herolib_macros |
Derive and function-like proc macros (ToSchema, Otoml, ToHeroScript, FromHeroScript, OsisObject, OpenRPC generators). |
hero_lifecycle |
hero_lifecycle |
Service-authoring kit for the binary kinds (server/admin/web/cli): service.toml schema + ServiceManifest builder, --info, startup banner, socket prep, and the Hero server builders. |
tools |
herolib_tools |
Hero development tools: Forgejo management, environment init, secrets, installers, services. |
Building & Testing
The workspace builds with standard Cargo. Rust is pinned via rust-toolchain.toml (edition 2024).
# Check / build the whole workspace
cargo check --workspace
cargo build --workspace
# Build or test a single crate
cargo build -p herolib_ai
cargo test -p herolib_core --lib
# Run the full test suite (as CI does)
cargo test --workspace --lib --bins
CI
Continuous integration runs via Forgejo Actions in .forgejo/workflows/ (ci.yaml), which performs cargo check, cargo build, and cargo test across the workspace.
Prerequisites
- Rust toolchain matching
rust-toolchain.toml(1.96, edition 2024) - Git
License
Apache-2.0. See LICENSE for details.