mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
Move the last Grok runtime off opencode onto xAI's official `grok` CLI, for full parity with the Claude path. The intake/secretary chat now runs per-turn headless `grok -p` invocations that resume one session id (proven live: context carries across runs), with streaming-json deltas mapped to the existing panel StreamChunk kinds — the IntakeDriver loop, message source, relay, and idle reaper are reused unchanged; only the SessionFactory differs (GrokCliSession replaces the opencode-serve session). - GrokCliSession + a pure, unit-tested streaming-json -> StreamChunk assembler (thought coalesced to one block, text streamed live, end captures the session id for -r, fenced-draft fallback, clear errors incl. rate-limit). - intake propose_draft and secretary read_company_state/read_task/submit_directive are now FastMCP servers (roboco-intake / roboco-secretary) wired into ~/.grok/config.toml, launched via `uv run --directory /app` to resolve the installed package. The secretary tools reuse the shared backend helpers. - Orchestrator: interactive spawn mounts the subscription auth + per-agent usage dir (no metered xAI key, no permission env — grok flags carry per-role perms); usage/cost now read a captured usage.json (drop the opencode.db reader, the _opencode_db_path/_grok_usage_from_opencode methods, and the cost-cap's opencode read). hosts["opencode"] -> hosts["grok_usage"]; OPENCODE_DATA_DIR -> GROK_USAGE_DATA_DIR. - Fix one-shot usage capture: `-s` does not pin the session id (grok generates its own), so the entrypoint now reads the real id back from the JSON run log and the reader uses it; usage is captured per-turn on the interactive path. - Delete the opencode layer: opencode_config/opencode_usage/opencode_session, the docker/grok/*.js plugins, the old one-shot entrypoint, and their tests. - Compose (all three files), .env.example, and stale comments updated to the grok-CLI runtime; add the SuperGrok auth mount + grok-usage dir. Gate green: ruff, mypy (296 files), xenon, tests. NAS build/verify pending.
150 lines
6.7 KiB
Bash
150 lines
6.7 KiB
Bash
# =============================================================================
|
|
# RoboCo Environment Configuration
|
|
# =============================================================================
|
|
# Copy this file to .env
|
|
#
|
|
# NOTE: No API keys needed for agents - they use your Claude Code authentication.
|
|
# Run `claude` on the host to authenticate before starting RoboCo.
|
|
|
|
# =============================================================================
|
|
# Docker Deployment (NAS/Server)
|
|
# =============================================================================
|
|
# These are REQUIRED when running via docker compose on a NAS/server.
|
|
# They tell the orchestrator container where to find files on the HOST.
|
|
|
|
# Path to the project on the host (absolute path)
|
|
# ROBOCO_HOST_PROJECT_DIR=/volume1/roboco
|
|
|
|
# Path to Claude Code auth directory on the host
|
|
# ROBOCO_HOST_CLAUDE_DIR=/root/.claude
|
|
|
|
# Claude auth directory to mount into orchestrator
|
|
# CLAUDE_AUTH_DIR=~/.claude
|
|
|
|
# =============================================================================
|
|
# Container Images (docker-compose.registry.yml — pre-built deployment)
|
|
# =============================================================================
|
|
# Only used by docker-compose.registry.yml, which runs the published images
|
|
# instead of building from source. Defaults shown.
|
|
# Registry namespace: ghcr.io/rennf93 (GHCR) or docker.io/renzof93 (Docker Hub)
|
|
# ROBOCO_REGISTRY=ghcr.io/rennf93
|
|
# Image tag: latest, or a pinned release such as 0.5.0
|
|
# ROBOCO_VERSION=latest
|
|
|
|
# =============================================================================
|
|
# Data Persistence
|
|
# =============================================================================
|
|
# Set to a path on your NAS RAID array for durability
|
|
# Path to data directory on the host (MUST be absolute for Docker-in-Docker)
|
|
# ROBOCO_DATA_DIR=/volume1/roboco/data
|
|
|
|
# =============================================================================
|
|
# Application
|
|
# =============================================================================
|
|
ROBOCO_ENVIRONMENT=development
|
|
ROBOCO_DEBUG=true
|
|
|
|
# =============================================================================
|
|
# API Server
|
|
# =============================================================================
|
|
ROBOCO_HOST=0.0.0.0
|
|
ROBOCO_PORT=8000
|
|
|
|
# =============================================================================
|
|
# Database (PostgreSQL)
|
|
# =============================================================================
|
|
# For docker compose deployment, use container name:
|
|
# ROBOCO_DATABASE_HOST=roboco-postgres
|
|
# For local development:
|
|
ROBOCO_DATABASE_HOST=localhost
|
|
ROBOCO_DATABASE_PORT=5432
|
|
ROBOCO_DATABASE_USER=roboco
|
|
ROBOCO_DATABASE_PASSWORD=roboco
|
|
ROBOCO_DATABASE_NAME=roboco
|
|
ROBOCO_DATABASE_ECHO=false
|
|
|
|
# =============================================================================
|
|
# Redis
|
|
# =============================================================================
|
|
# For docker compose deployment, use container name:
|
|
# ROBOCO_REDIS_HOST=roboco-redis
|
|
# For local development:
|
|
ROBOCO_REDIS_HOST=localhost
|
|
ROBOCO_REDIS_PORT=6379
|
|
ROBOCO_REDIS_DB=0
|
|
# ROBOCO_REDIS_PASSWORD=
|
|
|
|
# =============================================================================
|
|
# RAG / Local LLM (Ollama + in-house pgvector engine)
|
|
# =============================================================================
|
|
# For docker compose use the container name (roboco-ollama); locally, localhost.
|
|
ROBOCO_OLLAMA_BASE_URL=http://localhost:11434
|
|
ROBOCO_LOCAL_LLM_BASE_URL=http://localhost:11434/v1
|
|
ROBOCO_LOCAL_LLM_MODEL=glm-5:cloud
|
|
ROBOCO_DEFAULT_EMBEDDING_MODEL=qwen3-embedding:0.6b
|
|
|
|
# =============================================================================
|
|
# Grok (xAI) Provider — optional
|
|
# =============================================================================
|
|
# RoboCo can run agents on Grok Build (xAI) via xAI's official `grok` CLI on the
|
|
# SuperGrok subscription, instead of Claude Code. No metered xAI API key is used:
|
|
# the CLI authenticates from a mounted ~/.grok/auth.json — run `grok login` once
|
|
# on the host (auth.json auto-refreshes). Every var below is optional.
|
|
|
|
# Host dir holding the SuperGrok auth. The orchestrator mounts <dir>/auth.json
|
|
# read-only into each Grok agent's ~/.grok. GROK_AUTH_DIR is the host source the
|
|
# compose mounts into the orchestrator; keep both equal to the host's ~/.grok.
|
|
# ROBOCO_HOST_GROK_DIR=/home/youruser/.grok
|
|
# GROK_AUTH_DIR=/home/youruser/.grok
|
|
|
|
# Image the orchestrator spawns for Grok agents, and the CLI model id.
|
|
# ROBOCO_GROK_AGENT_IMAGE=roboco-agent-grok:latest
|
|
# ROBOCO_GROK_CLI_MODEL=grok-build
|
|
|
|
# Per-role tool permissions are computed as native grok flags (subagents off;
|
|
# edit/shell removed for non-coding roles; raw git mutation + rm -rf denied for
|
|
# coding roles) — there is nothing to set here.
|
|
|
|
# Force one reasoning effort for ALL Grok agents: low | medium | high | xhigh |
|
|
# max (or empty for the per-role default — coordination/docs/board roles request
|
|
# "low" to cut reasoning cost, code roles keep full reasoning).
|
|
# ROBOCO_GROK_REASONING_EFFORT=
|
|
|
|
# Hard ceiling on agentic turns per run (loop guard).
|
|
# ROBOCO_GROK_MAX_TURNS=200
|
|
|
|
# Kill a Grok agent container after this many seconds idle (no model call /
|
|
# stream) to reclaim a wedged one. Minimum 120.
|
|
# ROBOCO_GROK_IDLE_KILL_SECONDS=900
|
|
|
|
# Per-agent cost ceiling (USD) before the orchestrator kills the container;
|
|
# 0 disables. Backstops runaway-loop token burn.
|
|
# ROBOCO_GROK_MAX_COST_USD=0.0
|
|
|
|
# =============================================================================
|
|
# Security
|
|
# =============================================================================
|
|
# Encryption key for git tokens at rest (Fernet). REQUIRED — the orchestrator
|
|
# refuses to start without it. Generate with:
|
|
# python -c 'from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())'
|
|
ROBOCO_ENCRYPTION_KEY=
|
|
|
|
# Agent auth: HMAC secret that signs X-Agent-Token. REQUIRED for docker compose.
|
|
# Generate with: python -c 'import secrets; print(secrets.token_hex(32))'
|
|
ROBOCO_AGENT_AUTH_SECRET=
|
|
|
|
# Secure mode. On a trusted LAN you can leave this false (header-trust mode).
|
|
# Set true to require every request to carry a valid token so an agent cannot
|
|
# spoof another agent's role. When true you MUST also set ROBOCO_PANEL_AGENT_TOKEN.
|
|
ROBOCO_AGENT_AUTH_REQUIRED=false
|
|
|
|
# The control panel's CEO token, injected by nginx in secure mode so the human
|
|
# UI keeps working without the browser holding the signing secret. Generate it
|
|
# (after setting ROBOCO_AGENT_AUTH_SECRET above) with: make panel-token
|
|
ROBOCO_PANEL_AGENT_TOKEN=
|
|
|
|
# =============================================================================
|
|
# CORS (comma-separated origins)
|
|
# =============================================================================
|
|
ROBOCO_CORS_ORIGINS=["http://localhost:3000","http://localhost:5173"]
|