diff --git a/README.md b/README.md index 625051b..e1d3e82 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 基于 [ARTEMIS](https://github.com/google/artemis) 扩展的 Android AI 自动化测试平台。用自然语言描述任务,即可通过简体中文网页或 MCP 驱动真机、模拟器执行操作并收集结果。模型统一使用 **OpenAI Responses API**。 -**2.4.0**:人工评审支持原始用例、自动保存与上一条/下一条;执行详情默认折叠长字段。升级 OpenAI/LangChain 及安全依赖,修复 Windows 资源锁、报告证据与历史用量。配套「任务人工评审 1.1.0」独立安装。见 [2.4.0 发行说明](docs/releases/2.4.0.md);上一版本见 [2.3.0](docs/releases/2.3.0.md)。 +**2.4.1**:修复全新安装时的 npm 校验失败,准确检查 Node.js 版本要求。人工评审插件继续使用 1.1.0,市场使用兼容旧宿主的独立索引。见 [2.4.1 发行说明](docs/releases/2.4.1.md);功能更新见 [2.4.0](docs/releases/2.4.0.md)。 ## 主要功能 diff --git a/apps/showcase_ui/package-lock.json b/apps/showcase_ui/package-lock.json index 0c8c9ce..3528289 100644 --- a/apps/showcase_ui/package-lock.json +++ b/apps/showcase_ui/package-lock.json @@ -1,12 +1,12 @@ { "name": "artemis-showcase-ui", - "version": "2.4.0", + "version": "2.4.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "artemis-showcase-ui", - "version": "2.4.0", + "version": "2.4.1", "dependencies": { "@angular/cdk": "^22.2.4", "@angular/common": "^22.2.3", @@ -253,7 +253,7 @@ "@angular-devkit/schematics": "22.2.4", "@inquirer/prompts": "8.7.2", "@listr2/prompt-adapter-inquirer": "4.2.7", - "@modelcontextprotocol/server": "2.4.0", + "@modelcontextprotocol/server": "2.3.1", "@schematics/angular": "22.2.4", "jsonc-parser": "3.3.1", "listr2": "11.1.0", @@ -2043,8 +2043,8 @@ ] }, "node_modules/@modelcontextprotocol/core": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.4.0.tgz", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/core/-/core-2.3.1.tgz", "integrity": "sha512-laVmIhPGpWi7rG9q+0UigblRN0Hws/Yjlb6qLFtVqryXVLkc4h+yN8z731POD2LnAGQlFe7/tXhUm7Bi0YB91g==", "dev": true, "license": "Apache-2.0", @@ -2056,13 +2056,13 @@ } }, "node_modules/@modelcontextprotocol/server": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.4.0.tgz", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@modelcontextprotocol/server/-/server-2.3.1.tgz", "integrity": "sha512-e59MfWuSssj6DoQ96JCTqdW1AXT5/XtnTl0WWd6MU1Ka434fFUGGosCLJbGNySDhHGvxQWoRWK137FXYFkYNWw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@modelcontextprotocol/core": "2.4.0", + "@modelcontextprotocol/core": "2.3.1", "zod": "^4.2.0" }, "engines": { diff --git a/apps/showcase_ui/package.json b/apps/showcase_ui/package.json index 2d739e1..323655e 100644 --- a/apps/showcase_ui/package.json +++ b/apps/showcase_ui/package.json @@ -1,6 +1,6 @@ { "name": "artemis-showcase-ui", - "version": "2.4.0", + "version": "2.4.1", "scripts": { "ng": "ng", "start": "ng serve --proxy-config proxy.conf.json", diff --git a/docs/releases/2.4.0.md b/docs/releases/2.4.0.md index b9dc0d1..9617953 100644 --- a/docs/releases/2.4.0.md +++ b/docs/releases/2.4.0.md @@ -1,5 +1,7 @@ # ARTEMIS 2.4.0 +> 全新安装的 npm 校验失败已在 [2.4.1](2.4.1.md) 修复,请使用补丁版源码包或通过更新脚本升级。 + 本版改进批量用例人工评审与执行详情阅读,并包含 OpenAI SDK 适配、安全依赖更新、Windows 资源锁和报告证据修复。配套「任务人工评审」独立发布 **1.1.0**。 ## 人工评审与原始用例 diff --git a/docs/releases/2.4.1.md b/docs/releases/2.4.1.md new file mode 100644 index 0000000..b2a2cfc --- /dev/null +++ b/docs/releases/2.4.1.md @@ -0,0 +1,26 @@ +# ARTEMIS 2.4.1 + +本补丁修复 2.4.0 全新安装时的 `npm ci / EINTEGRITY`,适用于 `start.bat` 和 `start-cn.bat`。人工评审插件版本保持 **1.1.0**。 + +## 修复 + +- 2.4.0 发版时误将锁文件中的 MCP 间接依赖版本从 2.3.1 改为 2.4.0,仍保留 2.3.1 的 SHA-512。现在恢复 Angular CLI 22.2.4 官方声明的 `@modelcontextprotocol/server@2.3.1` 及其 `core@2.3.1`,使依赖关系、下载地址和校验值一致。未关闭 npm 完整性验证,也不要求用户清空全局缓存。 +- Windows 启动脚本准确检查 Angular 支持的 Node.js 范围:22.x 至少 22.22.3,24.x 至少 24.15.0,或 26.0.0 及以上;提示文案同步修正。 +- 保留最终 2.4.0 中的独立 v4 市场索引,提供人工评审 1.1.0;旧版宿主继续使用旧索引。曾用于发版准备的早期 2.4.0 候选包仍使用 v3 索引,会显示人工评审 1.0.0,不应继续分发。 + +## 验证 + +- Windows、Node.js 24.22.1、npm 11.19.1,独立源码目录及空 npm 缓存,使用国内镜像执行 `npm ci`:448 个包安装成功。实际依赖树与 Angular CLI 官方声明一致。 +- 同一全新环境下,前端 ChromeHeadless 347 项通过,生产构建通过;官方 npm 审计未发现已知漏洞。 +- 默认后端回归 3268 通过、2 跳过、8 按标记排除;包含 Node 22/24/26 兼容边界与启动脚本回归。Ruff、质量基线和核心类型检查通过。 +- 未启动用户服务,未执行设备或真实业务验收;以上为安装、构建和确定性测试结果。 + +## 升级 + +已有安装请先等待任务结束,再运行 `update-cn.bat`(国内镜像)或 `update.bat`,随后重新启动。建议使用更新脚本保留已有配置与数据,不要直接用源码 ZIP 覆盖安装目录。 + +如果此前已手动修改 `package-lock.json`,更新脚本可能因本地修改而停止;先备份这份文件,确认只包含该安装问题的临时修正后再处理冲突,不要对整个仓库执行重置或清理。 + +新安装请下载本版 `artemis-2.4.1-source.zip`,按 `SHA256SUMS.txt` 校验后使用。插件仍需在市场中单独安装或更新并启用,升级主程序不会自动授权插件。 + +本次不构建 Docker,不启动或重启用户服务,不操作真实设备或业务任务。 diff --git a/pyproject.toml b/pyproject.toml index 705efb2..2d5c2a0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ [project] name = "artemis" -version = "2.4.0" +version = "2.4.1" description = "Autonomous AI Assistant for Mobile Automation" authors = [ diff --git a/scripts/start.ps1 b/scripts/start.ps1 index 90bbbb2..680c959 100644 --- a/scripts/start.ps1 +++ b/scripts/start.ps1 @@ -218,14 +218,10 @@ function Test-NodeCompatible { $verRaw = (& node -v 2>$null) if (-not $verRaw) { return $false } $verStr = $verRaw.ToString().Trim().TrimStart('v') - $parts = $verStr.Split('.') - if ($parts.Count -ge 2) { - $major = [int]$parts[0] - $minor = [int]$parts[1] - if ($major -ge 26) { return $true } - if ($major -eq 24 -and $minor -ge 15) { return $true } - if ($major -eq 22 -and $minor -ge 22) { return $true } - } + $version = [version]$verStr + if ($version.Major -ge 26) { return $true } + if ($version.Major -eq 24 -and $version -ge [version]'24.15.0') { return $true } + if ($version.Major -eq 22 -and $version -ge [version]'22.22.3') { return $true } } catch { return $false } @@ -383,7 +379,7 @@ if ($frontendChanged -or ((-not (Test-Path $ShowcaseIndex)) -and (-not (Test-Pat if (-not (Test-NodeCompatible)) { if (Test-CommandExists "node") { $curVer = (& node -v 2>$null) - Write-Host (Get-LaunchText " [INFO] Detected Node.js $curVer, but Angular CLI requires Node.js >= v22.22.0." " [检查] 检测到 Node.js $curVer;前端需要 v22.22.0 或更新版本。") -ForegroundColor Yellow + Write-Host (Get-LaunchText " [INFO] Detected Node.js $curVer; Angular CLI requires 22.x >= 22.22.3, 24.x >= 24.15.0, or >= 26.0.0." " [检查] 检测到 Node.js $curVer;前端需要 22.x >= 22.22.3、24.x >= 24.15.0 或 >= 26.0.0。") -ForegroundColor Yellow } else { Write-Host (Get-LaunchText " [INFO] Node.js/npm not found (required for Showcase UI)." " [检查] 未找到 Node.js/npm,网页构建需要安装。") -ForegroundColor Cyan } @@ -401,7 +397,7 @@ if ($frontendChanged -or ((-not (Test-Path $ShowcaseIndex)) -and (-not (Test-Pat $useWinGetNode = $false if ($ArtemisDownloads.mode -ne 'China' -and (Test-CommandExists "winget")) { if ([Console]::IsInputRedirected -eq $false) { - Write-Host (Get-LaunchText " [INFO] Node.js >= v22.22.0 required for Showcase UI." " [检查] 网页需要 Node.js v22.22.0 或更新版本。") -ForegroundColor Cyan + Write-Host (Get-LaunchText " [INFO] Showcase UI requires Node.js 22.x >= 22.22.3, 24.x >= 24.15.0, or >= 26.0.0." " [检查] 网页需要 Node.js 22.x >= 22.22.3、24.x >= 24.15.0 或 >= 26.0.0。") -ForegroundColor Cyan $ans = Read-Host (Get-LaunchText " Install/Upgrade Node.js via WinGet (may require Administrator)? [Y/n]" " 通过 WinGet 安装/升级 Node.js(可能需要管理员权限)?[Y/n]") if ($ans -eq "" -or $ans -match "^[Yy]") { $useWinGetNode = $true diff --git a/tests/unit/test_download_mirrors.py b/tests/unit/test_download_mirrors.py index 69f64bd..586aee2 100644 --- a/tests/unit/test_download_mirrors.py +++ b/tests/unit/test_download_mirrors.py @@ -75,6 +75,34 @@ if ($env:npm_config_registry) { throw 'Official mode selected a China registry' assert result.returncode == 0, result.stdout + result.stderr +def test_node_compatibility_matches_angular_supported_release_lines(tmp_path): + result = powershell( + tmp_path, + """ +$tokens = $null; $errors = $null +$ast = [System.Management.Automation.Language.Parser]::ParseFile($env:LAUNCH_SCRIPT, [ref]$tokens, [ref]$errors) +if ($errors) { throw 'Launcher parse error' } +$checker = $ast.Find({ param($node) $node -is [System.Management.Automation.Language.FunctionDefinitionAst] -and $node.Name -eq 'Test-NodeCompatible' }, $true) +. ([scriptblock]::Create($checker.Extent.Text)) +function Test-CommandExists { return $true } +function node { return $script:nodeVersion } +$cases = @{ + 'v20.19.0' = $false; 'v22.22.0' = $false; 'v22.22.2' = $false + 'v22.22.3' = $true; 'v22.23.2' = $true; 'v23.0.0' = $false + 'v24.14.0' = $false; 'v24.15.0' = $true; 'v24.22.1' = $true + 'v24.15.0-rc.1' = $false; 'v25.0.0' = $false; 'v26.0.0' = $true + 'not-a-version' = $false +} +foreach ($case in $cases.GetEnumerator()) { + $script:nodeVersion = $case.Key + if ((Test-NodeCompatible) -ne $case.Value) { throw "Wrong compatibility for $($case.Key)" } +} +""", + LAUNCH_SCRIPT=str(ROOT / "scripts/start.ps1"), + ) + assert result.returncode == 0, result.stdout + result.stderr + + @pytest.mark.parametrize("first_failure", ["http", "timeout", "hash", "all"]) def test_scrcpy_source_failover_checks_hash_before_installing(tmp_path, first_failure): archive = tmp_path / "fixture.zip" diff --git a/uv.lock b/uv.lock index 583c090..628051d 100644 --- a/uv.lock +++ b/uv.lock @@ -248,7 +248,7 @@ wheels = [ [[package]] name = "artemis" -version = "2.4.0" +version = "2.4.1" source = { editable = "." } dependencies = [ { name = "adbutils" },