#!/bin/bash
# Demo script to show INFO event emissions

echo "INFO Event Emission Demo"
echo "========================"
echo ""
echo "This demo shows the new granular INFO events emitted during code discovery and analysis."
echo ""
echo "Event types include:"
echo "  - discovery.start: Starting discovery of a directory"
echo "  - discovery.directory: Found a directory"
echo "  - discovery.file: Found a file"
echo "  - discovery.complete: Finished discovering a directory"
echo "  - analysis.start: Starting file analysis"
echo "  - analysis.parse: Parsing file content"
echo "  - analysis.class/function/method: Found code elements"
echo "  - analysis.complete: Finished analysis"
echo "  - filter.gitignore/pattern: Items filtered out"
echo "  - cache.hit/miss: Cache status"
echo ""
echo "To test:"
echo "1. Start the dashboard: claude-mpm dashboard"
echo "2. Open browser to http://localhost:8765"
echo "3. Go to the Code tab"
echo "4. Open browser console (F12) to see INFO events"
echo "5. Click on directories to explore or files to analyze"
echo ""
echo "You'll see events like:"
echo "[INFO] discovery.start Starting discovery of src"
echo "[INFO] discovery.directory Found directory: tests"
echo "[INFO] discovery.file Found file: __init__.py (python)"
echo "[INFO] filter.gitignore Ignored by gitignore: __pycache__"
echo "[INFO] discovery.complete Discovery complete: 25 files, 10 directories, 5 ignored"
echo "[INFO] analysis.start Analyzing: example.py"
echo "[INFO] analysis.class Found class: MyClass"
echo "[INFO] analysis.function Found function: process_data"
echo "[INFO] analysis.complete Analysis complete: 2 classes, 5 functions, 3 methods"
echo ""
echo "The events provide granular tracking of all operations during code discovery."