#!/usr/bin/env bash set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" SKILL_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")" source "$SKILL_ROOT/scripts/_common.sh" main() { confirm_gate if [[ ! -f "$SKILL_ROOT/outputs/last_run_dir.txt" ]]; then log_warn "No last run; nothing to undo." exit 0 fi run_dir="$(cat "$SKILL_ROOT/outputs/last_run_dir.txt")" log_warn "Removing last run artifacts (cannot undo broadcast tx): $run_dir" rm -rf "$run_dir" || true rm -f "$SKILL_ROOT/outputs/last_run_dir.txt" || true log_info "Local rollback complete (chain tx remains)." } main "$@"