# PR Review Orchestration - Task Runner
# Minimal justfile with only the 3 recipes needed for orchestration
# Run tasks with: just -f {base_dir}/justfile <recipe> [args...]

# Default recipe - show help
default:
    @just --list

# Directory containing scripts
scripts_dir := justfile_directory() / "scripts"

# Reply to a specific comment (body can contain markdown/special chars)
# Uses heredoc with quoted delimiter to prevent shell interpretation of backticks, $, etc.
reply owner repo pr_number comment_id body:
    #!/usr/bin/env bash
    cat <<'BODY_EOF' | uv run "{{scripts_dir}}/reply_to_comment.py" "{{owner}}" "{{repo}}" "{{pr_number}}" "{{comment_id}}" --stdin
    {{body}}
    BODY_EOF

# Resolve a review thread
resolve thread_id:
    uv run {{scripts_dir}}/resolve_thread.py {{thread_id}}

# Request re-review with summary comment (body can contain markdown/special chars)
# Uses heredoc with quoted delimiter to prevent shell interpretation of backticks, $, etc.
request-review owner repo pr_number body:
    #!/usr/bin/env bash
    cat <<'BODY_EOF' | uv run "{{scripts_dir}}/request_review.py" "{{owner}}" "{{repo}}" "{{pr_number}}" --stdin
    {{body}}
    BODY_EOF
