2026-05-30 23:27:09 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
set -e
|
|
|
|
|
|
2026-06-12 12:40:15 -04:00
|
|
|
FRAMEWORK_DIR="$HOME/.automaton"
|
2026-05-30 23:27:09 -04:00
|
|
|
|
|
|
|
|
if [ -d "$FRAMEWORK_DIR" ]; then
|
2026-06-12 12:40:15 -04:00
|
|
|
echo "automaton already installed at $FRAMEWORK_DIR"
|
2026-06-10 23:48:43 -04:00
|
|
|
echo "Run './update.sh' to update."
|
2026-06-21 18:28:15 -04:00
|
|
|
else
|
|
|
|
|
echo "Cloning automaton to $FRAMEWORK_DIR..."
|
2026-06-14 11:24:36 -04:00
|
|
|
git clone http://10.37.0.86:3003/hermes/automaton "$FRAMEWORK_DIR"
|
2026-05-30 23:27:09 -04:00
|
|
|
|
2026-06-11 20:25:27 -04:00
|
|
|
echo ""
|
|
|
|
|
echo "=== VRAM / Context Detection ==="
|
|
|
|
|
echo "Detecting your system's VRAM to recommend task decomposition settings..."
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
# Run VRAM detection script if it exists
|
2026-06-14 11:24:36 -04:00
|
|
|
if [ -f "$FRAMEWORK_DIR/scripts/vram_detect.py" ]; then
|
2026-06-11 20:25:27 -04:00
|
|
|
# Run in project-dir context so it can read framework overhead
|
2026-06-14 11:24:36 -04:00
|
|
|
detection_output=$(cd "$FRAMEWORK_DIR" && python3 "$FRAMEWORK_DIR/scripts/vram_detect.py" 2>&1)
|
|
|
|
|
|
|
|
|
|
# Extract JSON output (the block after "=== JSON Output ===")
|
|
|
|
|
json_output=$(echo "$detection_output" | sed -n '/=== JSON Output ===/,$p' | tail -n +2)
|
|
|
|
|
|
2026-06-11 20:25:27 -04:00
|
|
|
if [ -n "$json_output" ]; then
|
|
|
|
|
echo "$detection_output"
|
2026-06-14 11:24:36 -04:00
|
|
|
|
|
|
|
|
# Extract key values from JSON using Python
|
|
|
|
|
recommended_k=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["recommended_k"])')
|
|
|
|
|
max_peak_kb=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["max_peak_context_kb"])')
|
|
|
|
|
headroom=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["headroom"])')
|
|
|
|
|
gpu_vram=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["gpu_vram_gb"])')
|
|
|
|
|
ram_gb=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["ram_gb"])')
|
|
|
|
|
model_context=$(echo "$json_output" | python3 -c 'import json,sys; print(json.load(sys.stdin)["model_context_kb"])')
|
2026-06-11 20:25:27 -04:00
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
|
echo "=== Recommended VRAM Configuration ==="
|
2026-06-12 12:40:15 -04:00
|
|
|
echo "For low-VRAM systems (8GB, 16GB VRAM), add this to ~/.automaton/config.md:"
|
2026-06-11 20:25:27 -04:00
|
|
|
echo ""
|
|
|
|
|
echo "## VRAM Configuration"
|
|
|
|
|
echo "- **Auto-detect**: Yes # Let the agent detect automatically"
|
|
|
|
|
echo "- **Target context**: ${recommended_k}k tokens # Override auto-detect if needed"
|
|
|
|
|
echo "- **Headroom**: ${headroom}%"
|
|
|
|
|
echo "- **Max peak context per sub-task**: $((max_peak_kb / 1000))k tokens"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "This ensures tasks are decomposed into sub-tasks that fit within your"
|
|
|
|
|
echo "available VRAM. For more information, see the README."
|
|
|
|
|
else
|
2026-06-12 12:40:15 -04:00
|
|
|
echo "Could not detect VRAM. You can manually set your VRAM configuration in ~/.automaton/config.md."
|
2026-06-11 20:25:27 -04:00
|
|
|
echo "See the README for details."
|
|
|
|
|
fi
|
|
|
|
|
else
|
2026-06-12 12:40:15 -04:00
|
|
|
echo "VRAM detection script not found. You can manually set your VRAM configuration in ~/.automaton/config.md."
|
2026-06-11 20:25:27 -04:00
|
|
|
echo "See the README for details."
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
echo ""
|
2026-05-30 23:27:09 -04:00
|
|
|
echo "Installation complete."
|
2026-06-15 14:20:52 -04:00
|
|
|
echo ""
|
|
|
|
|
echo "Next steps:"
|
|
|
|
|
echo " 1. cd into a project and run the onboarding prompt"
|
2026-06-16 07:28:45 -04:00
|
|
|
echo " 2. In each project that uses git, install the automaton hooks:"
|
|
|
|
|
echo " bash ~/.automaton/scripts/install-hooks.sh /path/to/project"
|
2026-06-15 14:20:52 -04:00
|
|
|
echo ""
|
2026-06-16 07:28:45 -04:00
|
|
|
echo "These hooks block commits and pushes when no task is in an edit-allowed phase."
|
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
|
|
# Register pre-edit guards for detected harnesses
|
2026-06-21 18:28:15 -04:00
|
|
|
bash "$FRAMEWORK_DIR/scripts/register-guards.sh"
|
|
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# --- Python deps (idempotent) ---
|
|
|
|
|
if [ ! -d ".venv" ]; then
|
|
|
|
|
python3 -m venv .venv
|
|
|
|
|
fi
|
|
|
|
|
.venv/bin/pip install --quiet --upgrade pip
|
|
|
|
|
.venv/bin/pip install --quiet -r requirements.txt
|