==========================================
  Audit Pipeline - Local Agent README
==========================================

This package contains the local agent that pulls jobs from the
Cloudflare-hosted Web UI and executes them on this PC.

The agent only runs WHEN YOU EXPLICITLY START IT (via the
Web UI button or by double-clicking start_agent.bat).
It does NOT auto-start on PC boot or login.

----------------------------------------
  Files in this folder
----------------------------------------
  agent.exe              - the agent binary (8 MB)
  phases.json            - schema (auto-loaded)
  install_launcher.bat   - one-time installer
  uninstall_launcher.bat - undo installer
  setup_agent.bat        - basic config-only setup (no protocol)
  start_agent.bat        - launcher (called by button or manually)
  README.txt             - this file

After install, an additional file appears:
  agent_config.json      - your Worker URL + AGENT_TOKEN

----------------------------------------
  Recommended: install_launcher.bat (1 minute)
----------------------------------------
  1. Double-click install_launcher.bat
  2. Press Enter for default Worker URL
  3. Paste AGENT_TOKEN
  4. Done. The agent is INSTALLED but NOT RUNNING.

----------------------------------------
  Starting the agent (after install)
----------------------------------------
  Option A (recommended): from the Web UI
    1. Open https://notebooklm-audit-ui.pages.dev
    2. Click "▶ Launch Agent" button
    3. Browser may ask "Allow audit-agent:// to open?" - click Allow
    4. A console window opens and the agent starts polling

  Option B: manually on this PC
    1. Double-click start_agent.bat

  Both routes share agent_config.json, so token / URL are reused.

----------------------------------------
  Stopping the agent
----------------------------------------
  - Close the agent console window (X button), OR
  - Press Ctrl+C inside the console

----------------------------------------
  Uninstalling
----------------------------------------
  Double-click uninstall_launcher.bat
  -> removes the audit-agent:// protocol registration.
  agent.exe / config / data files are NOT deleted.

----------------------------------------
  Troubleshooting
----------------------------------------
  - "Allow audit-agent://?" prompt does not appear
      -> install_launcher.bat may have failed; rerun it.
  - "Python not found" inside the agent console
      -> install Python 3.10+ and add to PATH.
  - Job stays "queued" forever
      -> the agent is not running; click Launch Agent.
  - Job becomes "rejected"
      -> AGENT_TOKEN mismatch; rerun install_launcher.bat
         with the correct token.
