feat: config-driven architecture, install wizard, live runtime switching, usage tracking, auto-failover

Major changes:
- Config-driven adapters: all channels (Slack, Discord, Telegram, WebChat, Webhooks) controlled via config.json with enabled flags and token auto-detection, no CLI flags required
- Runtime engine field: runtime.engine selects opencode/claude from config
- Interactive install script: 8-phase setup wizard with AI runtime detection/installation, token setup, identity file personalization (personality presets), aetheel CLI command, background service (launchd/systemd)
- Live runtime switching: /engine, /model, /provider commands hot-swap the AI runtime from chat without restart, changes persisted to config.json
- Usage tracking: per-request cost extraction from Claude Code JSON output, cumulative stats via /usage command
- Auto-failover: rate limit detection on both runtimes, automatic switch to other engine on quota errors with user notification
- Chat commands work without / prefix (Slack intercepts / in channels), commands: engine, model, provider, config, usage, reload, cron, subagents, status, help
- /config set for editing config.json from chat with dotted key notation
- Security audit saved to docs/security-audit.md
- Full command reference in docs/commands.md
- Future changes doc with NanoClaw agent teams analysis
- Logo added to README and WebChat UI
- README fully rewritten with all features documented
This commit is contained in:
2026-02-18 01:07:12 -05:00
parent 41b2f9a593
commit 6d73f74e0b
41 changed files with 11363 additions and 437 deletions

View File

@@ -1,45 +1,23 @@
# =============================================================================
# Aetheel Configuration
# Aetheel Secrets (.env)
# =============================================================================
# This file holds SECRETS ONLY (tokens, passwords, API keys).
# All other configuration lives in ~/.aetheel/config.json.
#
# Copy this file to .env and fill in your values.
# See docs/slack-setup.md and docs/opencode-setup.md for instructions.
# --- Slack Tokens (required) ------------------------------------------------
# Get these from https://api.slack.com/apps → your app settings
# --- Slack Tokens ------------------------------------------------------------
SLACK_BOT_TOKEN=xoxb-your-bot-token-here
SLACK_APP_TOKEN=xapp-your-app-token-here
# --- OpenCode Runtime (required for AI) -------------------------------------
# Mode: "cli" (subprocess) or "sdk" (opencode serve API)
OPENCODE_MODE=cli
# --- Telegram Bot Token (optional) -------------------------------------------
# TELEGRAM_BOT_TOKEN=your-telegram-bot-token-here
# Model to use (optional — uses your OpenCode default if not set)
# Examples:
# anthropic/claude-sonnet-4-20250514
# openai/gpt-5.1
# google/gemini-3-pro
# OPENCODE_MODEL=
# --- Discord Bot Token (optional) --------------------------------------------
# DISCORD_BOT_TOKEN=your-discord-bot-token-here
# CLI timeout in seconds (for CLI mode)
OPENCODE_TIMEOUT=120
# --- OpenCode Server Password (optional, SDK mode only) ----------------------
# OPENCODE_SERVER_PASSWORD=your-server-password
# Server URL for SDK mode (only needed if OPENCODE_MODE=sdk)
# OPENCODE_SERVER_URL=http://localhost:4096
# OPENCODE_SERVER_PASSWORD=
# Working directory for OpenCode (optional — defaults to current directory)
# OPENCODE_WORKSPACE=/path/to/your/project
# --- Logging -----------------------------------------------------------------
LOG_LEVEL=INFO
# --- Claude Code Runtime (alternative to OpenCode) --------------------------
# Use --claude flag to switch: python main.py --claude
# CLAUDE_MODEL=claude-sonnet-4-20250514
# CLAUDE_TIMEOUT=120
# CLAUDE_MAX_TURNS=3
# CLAUDE_NO_TOOLS=true
# --- Memory System -----------------------------------------------------------
# AETHEEL_WORKSPACE=~/.aetheel/workspace
# AETHEEL_MEMORY_DB=~/.aetheel/memory.db
# --- Anthropic API Key (optional, for Claude Code runtime) -------------------
# ANTHROPIC_API_KEY=sk-ant-...