#!/usr/bin/env bash
# 组合包安装脚本（Trove 自动生成，勿手改；组合包文档为准）
# combo: combo-auto-test ｜ 自动化测试闭环（静态分析 → 沙箱执行 → 浏览器 E2E） ｜ 状态: partial
# 生成: 2026-09-24 ｜ 详情: https://trove.xin/combos/combo-auto-test.html ｜ 依赖警告见文档
# 按官方下载源 + 国内镜像适配；每条命令后可验证（预期输出见组合包文档）。
set -euo pipefail

# ==== [1/3] deepcode：静态分析 ====
# 版本要求: 2.1.0；Python >= 3.12
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple deepcode-hku
deepcode --version   # 预期输出: DeepCode 2.1.0

# ==== [2/3] swe-rex：沙箱执行 ====
# 版本要求: 1.4.0；Python >= 3.10；沙箱执行需 Docker（本环境未实测沙箱运行）
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple swe-rex==1.4.0
swerex-remote --help   # 预期输出: usage: swerex-remote [-h] [--host HOST] [--port PORT] --auth-token AUTH_TOKEN

# ==== [3/3] playwright-mcp：浏览器 E2E ====
# 版本要求: 0.0.79；Node >= 18；首次运行需下载浏览器引擎（chromium 113.9MiB）
npm_config_registry=https://registry.npmmirror.com npm install -g @playwright/mcp
npx --no-install @playwright/mcp --version
npx --no-install playwright install chromium

