#!/bin/bash
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir' | rev | cut -d/ -f1 | rev)
PERCENT=$(echo "$input" | jq -r '.context_window.used_percentage // 0' | cut -d. -f1)

# Dev mode from project root
MODE_FILE=".catalyst-dev-mode"
if [ -f "$MODE_FILE" ]; then
  MODE=$(tr -d '[:space:]' < "$MODE_FILE")
else
  MODE="Solution"
fi

echo "[$MODEL] 📁 $DIR | 🧠 ${PERCENT}% | ⚙️ $MODE"
