#!/bin/bash # Prometheus Wrapper - All modes and agents set -euo pipefail PROMETHEUS_DIR="${HOME}/.claude/prometheus" VENV_DIR="${PROMETHEUS_DIR}/venv" LOG_DIR="${PROMETHEUS_DIR}/logs" mkdir -p "$LOG_DIR" log_prometheus() { echo "[$(date -u +"%Y-%m-%d %H:%M:%S UTC")] [prometheus] $*" | tee -a "${LOG_DIR}/wrapper.log" } check_installed() { if [[ ! -d "$VENV_DIR" ]]; then echo "Prometheus not installed. Run: bash ${PROMETHEUS_DIR}/install.sh" return 1 fi return 0 } execute_prometheus() { local task="$1" local mode="${2:-auto}" local repo="${3:-.}" log_prometheus "Mode: $mode, Repo: $repo" log_prometheus "Task: $task" if ! check_installed; then echo "ERROR: Prometheus not installed. Run install script first." >&2 return 1 fi source "${VENV_DIR}/bin/activate" cd "$repo" # Simulate Prometheus execution (would call actual Python code) case "$mode" in classify|bug|feature|context|edit|test) log_prometheus "Running in $mode mode" echo "Prometheus [$mode mode]: Analyzing task..." echo "Task: $task" echo "" echo "Note: Full Prometheus execution requires:" echo " 1. Run: bash ~/.claude/prometheus/install.sh" echo " 2. Configure: API keys and Neo4j (optional)" echo " 3. Dependencies: LangGraph, Docker, Neo4j" ;; *) log_prometheus "Running in auto mode" echo "Prometheus [auto]: Detecting task type..." echo "Task: $task" ;; esac } main() { local task="" local mode="auto" local repo="." while [[ $# -gt 0 ]]; do case "$1" in --classify|--bug|--feature|--context|--edit|--test) mode="${1#--}" shift ;; --repo|-r) repo="$2" shift 2 ;; *) task="$1" shift ;; esac done [[ -z "$task" ]] && task=$(cat) [[ -z "$task" ]] && echo "Usage: $0 [--classify|--bug|--feature|--context|--edit|--test] [--repo ] " && exit 1 execute_prometheus "$task" "$mode" "$repo" } main "$@"