| 1 | |
| 2 | set -euo pipefail |
| 3 | STATE="${HARNESS_STATE:-/tmp/claude-1000/yumush-harness}" |
| 4 | source "${ENV_FILE:-$STATE/env}" |
| 5 | to() { wlrctl pointer move -4000 -4000; wlrctl pointer move "$1" "$2"; sleep 0.1; } |
| 6 | case "$1" in |
| 7 | click) to "$2" "$3"; wlrctl pointer click "${4:-left}";; |
| 8 | move) to "$2" "$3";; |
| 9 | type) wtype "$2";; |
| 10 | key) wtype -k "$2";; |
| 11 | chord) wtype -M "$2" -k "$3" -m "$2";; |
| 12 | clear) args=(); for _ in $(seq "${2:-30}"); do args+=(-k BackSpace); done; wtype "${args[@]}";; |
| 13 | field) to "$2" "$3"; wlrctl pointer click left; sleep 0.2; wlrctl pointer click left; sleep 0.2 |
| 14 | args=(); for _ in $(seq 30); do args+=(-k BackSpace); done; wtype "${args[@]}"; sleep 0.2; wtype "$4";; |
| 15 | scroll) wlrctl pointer scroll "$2" "${3:-0}";; |
| 16 | esac |
| 17 | sleep "${UI_DELAY:-0.3}" |