CeoFred/bob-ai

Personal computer agent with remote modification capabilities.

โ˜… 0Forks 0GoGitHub โ†—Compare

README

๐Ÿค– Bob โ€” Local AI Computer Agent

Bob is a secure, personal AI computer agent that runs locally on an Apple Silicon Mac. It connects to a local LLM (such as Ollama with Qwen 2.5 Coder), exposes a clean remote web interface accessible over Tailscale, and executes controlled terminal commands, filesystem operations, and display captures with human-in-the-loop security policies.


Key Features

  • 100% Local Inference: Zero dependency on cloud LLMs; powered by local Ollama (qwen2.5-coder:7b / qwen2.5-coder:14b / llama3.1:8b).
  • Secure Remote Access: Connect from iPhone or remote laptop via Tailscale mesh VPN without public ports.
  • Controlled Tool Execution:
    • terminal_exec โ€” Safe zsh shell command runner with duration and exit code capture.
    • read_file, write_file, list_directory, search_files โ€” Sandboxed workspace file operations.
    • take_screenshot โ€” macOS display capture.
  • Security & Safety Policy Layer:
    • Command classification (SAFE, APPROVAL_REQUIRED, BLOCKED).
    • Path canonicalization preventing directory traversal (..) and symlink escapes.
    • Interactive web UI approval prompts for sensitive commands.
    • Automatic secret & token redaction in audit logs.
  • Real-Time Streaming: Live WebSocket and Server-Sent Events (SSE) streaming of agent reasoning, tool starts, tool outputs, and completions.
  • macOS Daemon & launchd Service: Runs in the background without needing an open terminal window.
  • Future-Ready Extensibility:
    • Computer GUI control interface ready for mouse/keyboard automation.
    • CodingAgent interface ready for AntiGravity delegation.

Quick Start

1. Hardware Detection & Recommendation

make sysinfo

2. Pull Recommended Local Model

ollama serve
ollama pull qwen2.5-coder:7b

3. Build & Run

make build
make run

Access Bob at http://localhost:8787 (or your Tailscale IP http://100.x.y.z:8787).


CLI Management

./scripts/bob start      # Start background daemon
./scripts/bob status     # Check health & status
./scripts/bob logs       # Stream daemon logs
./scripts/bob stop       # Stop background daemon
./scripts/bob sysinfo    # Inspect hardware & recommended models

Project Structure

bob/
โ”œโ”€โ”€ cmd/
โ”‚   โ””โ”€โ”€ bob/
โ”‚       โ””โ”€โ”€ main.go              # Main server & agent entrypoint
โ”‚
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ agent/                   # Planner loop, max steps, event streaming
โ”‚   โ”œโ”€โ”€ llm/                     # LLM interface, Ollama client, Mock LLM
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ registry/            # Tool registry & schema builder
โ”‚   โ”‚   โ”œโ”€โ”€ terminal/            # Terminal execution tool
โ”‚   โ”‚   โ”œโ”€โ”€ filesystem/          # Sandboxed file read/write/list/search
โ”‚   โ”‚   โ””โ”€โ”€ screenshot/          # macOS screen capture tool
โ”‚   โ”œโ”€โ”€ computer/                # Computer control interface abstraction
โ”‚   โ”œโ”€โ”€ coding/                  # AntiGravity coding subagent interface
โ”‚   โ”œโ”€โ”€ security/                # Policy rules, path sandbox, secret redactor
โ”‚   โ”œโ”€โ”€ sessions/                # Session manager & history persistence
โ”‚   โ”œโ”€โ”€ audit/                   # Structured JSON audit logging
โ”‚   โ”œโ”€โ”€ server/                  # HTTP REST API, SSE, WebSockets, Auth
โ”‚   โ””โ”€โ”€ config/                  # Configuration & hardware auto-detection
โ”‚
โ”œโ”€โ”€ web/                         # React + TypeScript + Vite remote web UI
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/          # Chat, ToolActivity, Approval, Audit, Modals
โ”‚   โ”‚   โ”œโ”€โ”€ services/            # API client, WebSocket stream client
โ”‚   โ”‚   โ””โ”€โ”€ App.tsx
โ”‚   โ””โ”€โ”€ dist/                    # Compiled production UI bundle
โ”‚
โ”œโ”€โ”€ scripts/
โ”‚   โ”œโ”€โ”€ bob                      # CLI daemon manager
โ”‚   โ””โ”€โ”€ install-service.sh       # Native macOS launchd service installer
โ”‚
โ”œโ”€โ”€ service/
โ”‚   โ””โ”€โ”€ com.bob.agent.plist      # launchd service definition
โ”‚
โ”œโ”€โ”€ docs/
โ”‚   โ”œโ”€โ”€ architecture.md          # System architecture & component design
โ”‚   โ”œโ”€โ”€ setup.md                 # Setup & quickstart guide
โ”‚   โ”œโ”€โ”€ security.md              # Security policies & defense in depth
โ”‚   โ”œโ”€โ”€ tailscale.md             # Tailscale remote networking guide
โ”‚   โ””โ”€โ”€ antigravity.md           # AntiGravity integration & findings
โ”‚
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ config.example.yaml
โ”œโ”€โ”€ Makefile
โ””โ”€โ”€ README.md

Testing

Run all unit and integration tests:

make test

All tests use hermetic mocks for the LLM and pass without requiring external services.

Contributors

CeoFred

Issues