import shutil
import time
from pathlib import Path

def create_sandbox(repo_path: str) -> str:
    source = Path(repo_path).resolve()
    root = Path("sandboxes").resolve()
    root.mkdir(exist_ok=True)

    sandbox = root / f"task_{int(time.time())}"

    ignore = shutil.ignore_patterns(
        ".git",
        "__pycache__",
        ".venv",
        "node_modules",
        "sandboxes",
        "reports",
        ".env",
    )

    shutil.copytree(source, sandbox, ignore=ignore)

    return str(sandbox)
