#!/usr/bin/env python3
"""Generate an HTML visualization for an agent run log.

Usage:
  python scripts/visualize_run.py
  python scripts/visualize_run.py --open
  python scripts/visualize_run.py logs/run_xxx.jsonl
  python scripts/visualize_run.py --latest --open

  # 从 Python 直接调用（与 CWD 无关，使用项目根下 logs/）
  from supply_agent.logging.cli import main
  main([])
"""

from __future__ import annotations

import sys
from pathlib import Path

_ROOT = Path(__file__).resolve().parents[1]
if str(_ROOT) not in sys.path:
    sys.path.insert(0, str(_ROOT))

from supply_agent.logging.cli import main

if __name__ == "__main__":
    # 只消费本脚本之后的参数，避免被其它启动方式污染 argv
    raise SystemExit(main(sys.argv[1:]))
