Files

23 lines
956 B
Bash
Executable File

#!/usr/bin/env bash
# Remove the retired single-agent usage record. The bar's usage widget grew
# from one hardcoded Claude collector into per-agent collectors writing under
# $XDG_STATE_HOME/panama/agents/usage/, and the old record file it replaced
# would otherwise sit as dead state forever.
#
# Rules, because the runner cannot enforce them:
#
# * Safe to run twice. The marker records success, not intent.
# * Tolerant of the repair already being correct -- the user may have fixed
# it by hand, or a later ./install may have put it back.
# * Root work goes through `panama-sudo --reason "..."`, never bare sudo,
# so the password prompt names the repair.
# * Exit non-zero to be retried at the next login. Exit zero only when the
# machine is genuinely in the state this describes.
set -euo pipefail
PANAMA_PATH="${PANAMA_PATH:-$HOME/.local/share/Panama}"
rm -f "${XDG_STATE_HOME:-$HOME/.local/state}/panama/agent-usage.json"