#!/usr/bin/env bash
# claude-tabs - compatibility wrapper around the integrated moto CLI
#
# Usage:
#   claude-tabs up
#   claude-tabs new NAME
#   claude-tabs newx NAME
#   claude-tabs attach NAME
#   claude-tabs ls
#   claude-tabs kill NAME

set -euo pipefail

SELF_BIN="$(readlink -f "${BASH_SOURCE[0]}" 2>/dev/null || python3 -c "import os,sys;print(os.path.realpath(sys.argv[1]))" "${BASH_SOURCE[0]}")"
REPO_DIR="$(cd "$(dirname "$SELF_BIN")/../.." && pwd)"
MOTO_BIN="$REPO_DIR/mac/bin/moto"

if [[ ! -x "$MOTO_BIN" ]]; then
    echo "claude-tabs: could not find moto command target at $MOTO_BIN" >&2
    exit 1
fi

exec "$MOTO_BIN" "$@"
