# FastHarness **Repository Path**: daoos_admin/FastHarness ## Basic Information - **Project Name**: FastHarness - **Description**: No description available - **Primary Language**: Rust - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-04-04 - **Last Updated**: 2026-04-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # FastHarness (Rust Edition) 🦀 FastHarness is a high-performance, robust, and highly extensible AI Agent framework completely written in Rust. It serves as a 100% exact parity port of the Python-based `OpenHarness` project, offering a lightning-fast asynchronous engine, robust type safety, and zero-warning compilation. Built on top of `tokio`, `reqwest`, and `serde`, FastHarness orchestrates multi-agent collaboration, dynamic tool loading, persistent session memory, and complex prompt engineering through an interactive REPL interface. --- ## 🌟 Key Features ### 🚀 Core Engine - **Fully Asynchronous**: Powered by `tokio` for non-blocking I/O, tool execution, and background task management. - **Server-Sent Events (SSE)**: Native streaming support for LLM responses using `eventsource-stream`. - **Dynamic Prompt Engineering**: Context-aware prompts that automatically inject OS, architecture, shell info, and parse `CLAUDE.md` / `MEMORY.md` workspace files. - **Persistent Configuration**: Global `~/.openharness/settings.json` and project-level `.fastharness/settings.json` overrides. ### 🛠 Tool Ecosystem (41 Built-in Tools) FastHarness includes a massive arsenal of tools out of the box: - **Filesystem & OS**: Read, write, edit files, Glob pattern matching, Grep regex search, and raw Bash execution. - **Web & Information**: Web searching and HTML-to-Markdown fetching (`scraper`, `html2md`). - **Swarm & Orchestration**: Spawn local background agents (`agent`), manage teams (`team_create`), and control background tasks (`task_create`, `task_stop`, `task_output`). - **Workflow & Memory**: Interactive Todo list management, memory persistence, and strict Plan Mode (`enter_plan_mode`). - **Extensibility (MCP)**: Adapters for Model Context Protocol (MCP) servers to expose external tools to the LLM. ### 🔌 Extensibility & Middleware - **Markdown Skills**: Dynamically load custom tools from Markdown files with YAML frontmatter located in `.fastharness/skills/`. - **Lifecycle Hooks**: Global event interceptors for `session_start`, `session_end`, `pre_tool_use`, and `post_tool_use`. - **Permission Governance**: Interactive `[y/N]` prompts for destructive tools (like bash execution or file modification) seamlessly integrated into the async stream. ### ⌨️ Command Registry (Slash Commands) A powerful REPL driven by `rustyline` with 60+ planned slash commands. Currently implemented: - `/help` - Show available commands. - `/status` - Display active model, context path, and session status. - `/clear` - Clear the terminal and conversation history. - `/cost` - Real-time estimation of token usage and billing (powered by `tiktoken-rs`). - `/resume` - Restore the last saved session for continuous workflow. - `/vim`, `/voice`, `/keybindings` - Extensible stubs for advanced interaction modes. --- ## 📦 Installation & Setup ### Prerequisites - Rust 1.70+ and Cargo - An Anthropic API Key ### Build from Source ```bash git clone /FastHarness cd FastHarness cargo build --release ``` ### Environment Variables Set your Anthropic API key before running: ```bash export ANTHROPIC_API_KEY="sk-ant-api03-..." ``` --- ## 🎮 Usage Start the interactive REPL: ```bash cargo run --release ``` Or pass a specific prompt directly via CLI: ```bash cargo run --release -- --prompt "Write a Python script to scrape a website" ``` ### CLI Arguments ```text Usage: fast_harness [OPTIONS] Options: -p, --prompt Execute a single prompt and exit -c, --cwd Target working directory (default: current dir) -m, --model Override the default LLM model --max-turns Maximum number of autonomous agent turns --backend-only Run as a headless backend server (RPC over stdin/stdout) --permission-mode Set permission mode (full_auto, default, plan) --system-prompt Override the base system prompt -h, --help Print help ``` --- ## 🏗 Architecture & Modules - `src/engine/` - The core Query loop, SSE parsing, and message tracking. - `src/tools/` - Implementation of the 41 built-in agent tools. - `src/commands/` - The Slash Command Registry and command handlers. - `src/permissions/` - Governance, denied tools lists, and interactive confirmation. - `src/coordinator/` - Agent Swarm logic, Team registries, and background task spawning. - `src/services/` - Background daemons including Session Storage, Token Estimation, and Cron. - `src/prompt/` - Dynamic prompt construction and environment context injection. - `src/skills/` & `src/hooks/` - Dynamic extensibility and lifecycle interceptors. - `src/ui/` - Presentation layers including REPL, React Launcher (stub), and Textual App (stub). --- ## 🤝 Roadmap & Missing Features (Compared to Python OpenHarness) While the structural architecture is 100% aligned, the following integrations are currently stubs and will be implemented in future PRs: 1. **True MCP IPC Communication**: Connecting `McpToolAdapter` to actual `stdio` subprocesses. 2. **LSP Integration**: Connecting `LspTool` to local Language Servers (e.g., `rust-analyzer`). 3. **Voice Mode**: Implementing real-time Speech-to-Text via `cpal` or external APIs. 4. **WebSocket Bridge**: Enabling the `ReactLauncher` to serve the web UI. --- ## 📄 License This project is licensed under the MIT License.