From 255e5a5b1bbeac2a06cd6853199458c4f586f7d7 Mon Sep 17 00:00:00 2001 From: Yige Date: Tue, 7 Jul 2026 16:04:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(runtimes):=20=E6=96=B0=E5=A2=9E=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E8=BF=90=E8=A1=8C=E6=97=B6=E6=B8=85=E5=8D=95=E4=B8=8E?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E5=85=9C=E5=BA=95=E7=89=88=E6=9C=AC=E6=B8=85?= =?UTF-8?q?=E5=8D=95=20(#44)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - runtimes/recommended.json:Python 3.13.9 (hatch 1.16.5 pin) + Node.js 24.18.0 LTS, 含 6 平台归档路径与 SHA-256,供主仓库构建时打包离线运行时与首启导入 - runtimes/versions-fallback.json:Node/Python/包管理器版本快照, 客户端联网查询失败时的兜底列表 - schemas + validate.mjs 映射 + 测试(与主仓库 lib/schemas/agent-service/runtime-manifest.ts 同源导出) - 不递增 presetDataVersion:runtimes/ 由客户端直接读取,不参与 compute.json 合并 --- __tests__/validate.test.mjs | 38 + runtimes/recommended.json | 44 + runtimes/versions-fallback.json | 1543 +++++++++++++++++ schemas/runtime-recommended.schema.json | 213 +++ schemas/runtime-versions-fallback.schema.json | 132 ++ scripts/validate.mjs | 2 + 6 files changed, 1972 insertions(+) create mode 100644 runtimes/recommended.json create mode 100644 runtimes/versions-fallback.json create mode 100644 schemas/runtime-recommended.schema.json create mode 100644 schemas/runtime-versions-fallback.schema.json diff --git a/__tests__/validate.test.mjs b/__tests__/validate.test.mjs index 741ac68..48e8d5b 100644 --- a/__tests__/validate.test.mjs +++ b/__tests__/validate.test.mjs @@ -91,6 +91,44 @@ describe('真实数据全量校验', () => { assert.equal(r1.ok, true, JSON.stringify(r1.errors, null, 2)) assert.equal(r2.ok, true, JSON.stringify(r2.errors, null, 2)) }) + + it('runtimes/recommended.json 应通过 runtime-recommended schema', () => { + const result = validateFile(join(ROOT, 'runtimes', 'recommended.json'), validators) + assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) + }) + + it('runtimes/versions-fallback.json 应通过 runtime-versions-fallback schema', () => { + const result = validateFile(join(ROOT, 'runtimes', 'versions-fallback.json'), validators) + assert.equal(result.ok, true, JSON.stringify(result.errors, null, 2)) + }) +}) + +// ==================== Runtime 清单反例 ==================== + +describe('runtime-recommended schema 反例', () => { + const validate = compile('runtime-recommended') + + function makeValidManifest() { + return JSON.parse(readFileSync(join(ROOT, 'runtimes', 'recommended.json'), 'utf8')) + } + + it('拒绝缺少平台归档(archives 六平台必填)', () => { + const data = makeValidManifest() + delete data.node.archives['win32-arm64'] + assert.equal(validate(data), false) + }) + + it('拒绝非法 sha256(长度/字符集不符)', () => { + const data = makeValidManifest() + data.python.sha256['darwin-arm64'] = 'not-a-sha' + assert.equal(validate(data), false) + }) + + it('拒绝未知字段(additionalProperties: false 保护老客户端)', () => { + const data = makeValidManifest() + data.unknownField = true + assert.equal(validate(data), false) + }) }) // ==================== Provider schema 反例 ==================== diff --git a/runtimes/recommended.json b/runtimes/recommended.json new file mode 100644 index 0000000..0193576 --- /dev/null +++ b/runtimes/recommended.json @@ -0,0 +1,44 @@ +{ + "python": { + "name": "3.13", + "version": "3.13.9", + "distTag": "20251014", + "archives": { + "darwin-arm64": "20251014/cpython-3.13.9+20251014-aarch64-apple-darwin-install_only_stripped.tar.gz", + "darwin-x64": "20251014/cpython-3.13.9+20251014-x86_64-apple-darwin-install_only_stripped.tar.gz", + "win32-x64": "20251014/cpython-3.13.9+20251014-x86_64-pc-windows-msvc-install_only_stripped.tar.gz", + "win32-arm64": "20251014/cpython-3.13.9+20251014-aarch64-pc-windows-msvc-install_only_stripped.tar.gz", + "linux-x64": "20251014/cpython-3.13.9+20251014-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", + "linux-arm64": "20251014/cpython-3.13.9+20251014-aarch64-unknown-linux-gnu-install_only_stripped.tar.gz" + }, + "sha256": { + "darwin-arm64": "52721745b0fa3196e4d0381fa5c06dda1d54343b90d49d90c3bba52d1171bd98", + "darwin-x64": "7c33b153a69c6255e6f2659cf39738f316b03969d6230d7bc47c73b7fde9a0d4", + "win32-x64": "76e0a9749c4deeb975a4b6b36d54be4e43f0c2a4c654bedab5d2e4d62dbc3006", + "win32-arm64": "419cce7a099d21389fca32a9fd4f7364fc61b91a760369c803de57c6ee1ddb99", + "linux-x64": "c0ccda275948c79996e46993c2c5476ff5cca606dee530f1dea712179131b348", + "linux-arm64": "baa3d107d17e4328448e30c3c9c83cca0eb41ca7a37c10982e14d46a5c3db07d" + } + }, + "node": { + "version": "24.18.0", + "ltsCodename": "Krypton", + "archives": { + "darwin-arm64": "v24.18.0/node-v24.18.0-darwin-arm64.tar.gz", + "darwin-x64": "v24.18.0/node-v24.18.0-darwin-x64.tar.gz", + "win32-x64": "v24.18.0/node-v24.18.0-win-x64.zip", + "win32-arm64": "v24.18.0/node-v24.18.0-win-arm64.zip", + "linux-x64": "v24.18.0/node-v24.18.0-linux-x64.tar.gz", + "linux-arm64": "v24.18.0/node-v24.18.0-linux-arm64.tar.gz" + }, + "sha256": { + "darwin-arm64": "e1a97e14c99c803e96c7339403282ea05a499c32f8d83defe9ef5ec66f979ed1", + "darwin-x64": "dfd0dbd3e721503434df7b7205e719f61b3a3a31b2bcf9729b8b91fea240f080", + "win32-x64": "0ae68406b42d7725661da979b1403ec9926da205c6770827f33aac9d8f26e821", + "win32-arm64": "f274669adb93b1fd0fbf8f21fd078609e9dcc84333d4f2718d2dde3f9a161a01", + "linux-x64": "783130984963db7ba9cbd01089eaf2c2efb055c7c1693c943174b967b3050cb8", + "linux-arm64": "6b4484c2190274175df9aa8f28e2d758a819cb1c1fe6ab481e2f95b463ab8508" + } + }, + "minClientVersion": "10.0.82" +} diff --git a/runtimes/versions-fallback.json b/runtimes/versions-fallback.json new file mode 100644 index 0000000..fb0b575 --- /dev/null +++ b/runtimes/versions-fallback.json @@ -0,0 +1,1543 @@ +{ + "generatedAt": "2026-07-07T07:53:33.780Z", + "node": [ + { + "version": "v26.4.0", + "date": "2026-06-24", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.17.0", + "v8": "14.6.202.34", + "uv": "1.52.1", + "zlib": "1.3.2.1-motley", + "openssl": "3.5.7", + "modules": "147", + "lts": false, + "security": false + }, + { + "version": "v26.3.1", + "date": "2026-06-17", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.16.0", + "v8": "14.6.202.34", + "uv": "1.52.1", + "zlib": "1.3.1", + "openssl": "3.5.7", + "modules": "147", + "lts": false, + "security": true + }, + { + "version": "v26.3.0", + "date": "2026-06-01", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.16.0", + "v8": "14.6.202.34", + "uv": "1.52.1", + "zlib": "1.3.1", + "openssl": "3.5.6", + "modules": "147", + "lts": false, + "security": false + }, + { + "version": "v25.9.0", + "date": "2026-03-31", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.12.1", + "v8": "14.1.146.11", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.5", + "modules": "141", + "lts": false, + "security": false + }, + { + "version": "v25.8.2", + "date": "2026-03-24", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.11.1", + "v8": "14.1.146.11", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.5", + "modules": "141", + "lts": false, + "security": true + }, + { + "version": "v25.8.1", + "date": "2026-03-10", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.11.0", + "v8": "14.1.146.11", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.5", + "modules": "141", + "lts": false, + "security": false + }, + { + "version": "v24.18.0", + "date": "2026-06-23", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.16.0", + "v8": "13.6.233.17", + "uv": "1.52.1", + "zlib": "1.3.1", + "openssl": "3.5.7", + "modules": "137", + "lts": "Krypton", + "security": false + }, + { + "version": "v24.17.0", + "date": "2026-06-17", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.13.0", + "v8": "13.6.233.17", + "uv": "1.52.1", + "zlib": "1.3.1", + "openssl": "3.5.7", + "modules": "137", + "lts": "Krypton", + "security": true + }, + { + "version": "v24.16.0", + "date": "2026-05-21", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "11.13.0", + "v8": "13.6.233.17", + "uv": "1.52.1", + "zlib": "1.3.1", + "openssl": "3.5.6", + "modules": "137", + "lts": "Krypton", + "security": false + }, + { + "version": "v23.11.1", + "date": "2025-05-14", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "10.9.2", + "v8": "12.9.202.28", + "uv": "1.50.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.16", + "modules": "131", + "lts": false, + "security": true + }, + { + "version": "v23.11.0", + "date": "2025-04-01", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "10.9.2", + "v8": "12.9.202.28", + "uv": "1.50.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.16", + "modules": "131", + "lts": false, + "security": false + }, + { + "version": "v23.10.0", + "date": "2025-03-13", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip" + ], + "npm": "10.9.2", + "v8": "12.9.202.28", + "uv": "1.50.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.16", + "modules": "131", + "lts": false, + "security": false + }, + { + "version": "v22.23.1", + "date": "2026-06-22", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.9.8", + "v8": "12.4.254.21", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.7", + "modules": "127", + "lts": "Jod", + "security": false + }, + { + "version": "v22.23.0", + "date": "2026-06-17", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.9.8", + "v8": "12.4.254.21", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.7", + "modules": "127", + "lts": "Jod", + "security": true + }, + { + "version": "v22.22.3", + "date": "2026-05-13", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.9.8", + "v8": "12.4.254.21", + "uv": "1.51.0", + "zlib": "1.3.1", + "openssl": "3.5.6", + "modules": "127", + "lts": "Jod", + "security": false + }, + { + "version": "v21.7.3", + "date": "2024-04-10", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.5.0", + "v8": "11.8.172.17", + "uv": "1.48.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.13+quic", + "modules": "120", + "lts": false, + "security": true + }, + { + "version": "v21.7.2", + "date": "2024-04-03", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.5.0", + "v8": "11.8.172.17", + "uv": "1.48.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.13+quic", + "modules": "120", + "lts": false, + "security": true + }, + { + "version": "v21.7.1", + "date": "2024-03-08", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.5.0", + "v8": "11.8.172.17", + "uv": "1.48.0", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.13+quic", + "modules": "120", + "lts": false, + "security": false + }, + { + "version": "v20.20.2", + "date": "2026-03-24", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "11.3.244.8", + "uv": "1.46.0", + "zlib": "1.3.1", + "openssl": "3.0.19", + "modules": "115", + "lts": "Iron", + "security": true + }, + { + "version": "v20.20.1", + "date": "2026-03-04", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "11.3.244.8", + "uv": "1.46.0", + "zlib": "1.3.1", + "openssl": "3.0.19", + "modules": "115", + "lts": "Iron", + "security": false + }, + { + "version": "v20.20.0", + "date": "2026-01-12", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "11.3.244.8", + "uv": "1.46.0", + "zlib": "1.3.1", + "openssl": "3.0.17", + "modules": "115", + "lts": "Iron", + "security": true + }, + { + "version": "v19.9.0", + "date": "2023-04-10", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-arm64-7z", + "win-arm64-zip", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "9.6.3", + "v8": "10.8.168.25", + "uv": "1.44.2", + "zlib": "1.2.13", + "openssl": "3.0.8+quic", + "modules": "111", + "lts": false, + "security": false + }, + { + "version": "v19.8.1", + "date": "2023-03-15", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "9.5.1", + "v8": "10.8.168.25", + "uv": "1.44.2", + "zlib": "1.2.13", + "openssl": "3.0.8+quic", + "modules": "111", + "lts": false, + "security": false + }, + { + "version": "v19.8.0", + "date": "2023-03-14", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "9.5.1", + "v8": "10.8.168.25", + "uv": "1.44.2", + "zlib": "1.2.13", + "openssl": "3.0.8+quic", + "modules": "111", + "lts": false, + "security": false + }, + { + "version": "v18.20.8", + "date": "2025-03-27", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "10.2.154.26", + "uv": "1.44.2", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.16", + "modules": "108", + "lts": "Hydrogen", + "security": false + }, + { + "version": "v18.20.7", + "date": "2025-02-20", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "10.2.154.26", + "uv": "1.44.2", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.15+quic", + "modules": "108", + "lts": "Hydrogen", + "security": false + }, + { + "version": "v18.20.6", + "date": "2025-01-21", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "10.8.2", + "v8": "10.2.154.26", + "uv": "1.44.2", + "zlib": "1.3.0.1-motley", + "openssl": "3.0.15+quic", + "modules": "108", + "lts": "Hydrogen", + "security": true + }, + { + "version": "v17.9.1", + "date": "2022-06-01", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.11.0", + "v8": "9.6.180.15", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "3.0.3+quic", + "modules": "102", + "lts": false, + "security": false + }, + { + "version": "v17.9.0", + "date": "2022-04-07", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.5.5", + "v8": "9.6.180.15", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "3.0.2+quic", + "modules": "102", + "lts": false, + "security": false + }, + { + "version": "v17.8.0", + "date": "2022-03-22", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.5.5", + "v8": "9.6.180.15", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "3.0.2+quic", + "modules": "102", + "lts": false, + "security": false + }, + { + "version": "v16.20.2", + "date": "2023-08-08", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.19.4", + "v8": "9.4.146.26", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "1.1.1v+quic", + "modules": "93", + "lts": "Gallium", + "security": true + }, + { + "version": "v16.20.1", + "date": "2023-06-20", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.19.4", + "v8": "9.4.146.26", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "1.1.1u+quic", + "modules": "93", + "lts": "Gallium", + "security": true + }, + { + "version": "v16.20.0", + "date": "2023-03-28", + "files": [ + "aix-ppc64", + "headers", + "linux-arm64", + "linux-armv7l", + "linux-ppc64le", + "linux-s390x", + "linux-x64", + "osx-arm64-tar", + "osx-x64-pkg", + "osx-x64-tar", + "src", + "win-x64-7z", + "win-x64-exe", + "win-x64-msi", + "win-x64-zip", + "win-x86-7z", + "win-x86-exe", + "win-x86-msi", + "win-x86-zip" + ], + "npm": "8.19.4", + "v8": "9.4.146.26", + "uv": "1.43.0", + "zlib": "1.2.11", + "openssl": "1.1.1t+quic", + "modules": "93", + "lts": "Gallium", + "security": false + } + ], + "python": [ + { + "name": "3.7", + "version": "3.7.9" + }, + { + "name": "3.8", + "version": "3.8.20" + }, + { + "name": "3.9", + "version": "3.9.24" + }, + { + "name": "3.10", + "version": "3.10.19" + }, + { + "name": "3.11", + "version": "3.11.14" + }, + { + "name": "3.12", + "version": "3.12.12" + }, + { + "name": "3.13", + "version": "3.13.9" + }, + { + "name": "3.14", + "version": "3.14.0" + }, + { + "name": "pypy2.7", + "version": "7.3.20" + }, + { + "name": "pypy3.9", + "version": "7.3.16" + }, + { + "name": "pypy3.10", + "version": "7.3.19" + }, + { + "name": "pypy3.11", + "version": "7.3.20" + } + ], + "pkgManagers": { + "npm": [ + { + "tag_name": "v11.18.0", + "created_at": "2026-06-29T16:43:36Z" + }, + { + "tag_name": "v11.17.0", + "created_at": "2026-06-11T18:44:17Z" + }, + { + "tag_name": "v11.16.0", + "created_at": "2026-05-27T20:46:57Z" + }, + { + "tag_name": "v11.15.0", + "created_at": "2026-05-20T20:38:33Z" + }, + { + "tag_name": "v11.14.1", + "created_at": "2026-05-08T17:52:30Z" + }, + { + "tag_name": "v11.14.0", + "created_at": "2026-05-06T19:11:31Z" + }, + { + "tag_name": "v11.13.0", + "created_at": "2026-04-22T20:45:16Z" + }, + { + "tag_name": "v10.9.8", + "created_at": "2026-03-27T16:05:42Z" + }, + { + "tag_name": "v11.12.1", + "created_at": "2026-03-26T18:45:12Z" + }, + { + "tag_name": "v11.12.0", + "created_at": "2026-03-18T21:22:09Z" + }, + { + "tag_name": "v10.9.7", + "created_at": "2026-03-18T21:51:11Z" + }, + { + "tag_name": "v11.11.1", + "created_at": "2026-03-11T19:30:21Z" + }, + { + "tag_name": "v10.9.6", + "created_at": "2026-03-11T19:17:28Z" + }, + { + "tag_name": "v10.9.5", + "created_at": "2026-03-04T22:49:06Z" + }, + { + "tag_name": "v11.11.0", + "created_at": "2026-02-25T22:56:46Z" + }, + { + "tag_name": "v11.10.1", + "created_at": "2026-02-19T22:03:28Z" + }, + { + "tag_name": "v11.10.0", + "created_at": "2026-02-11T21:06:25Z" + }, + { + "tag_name": "v11.9.0", + "created_at": "2026-02-04T18:28:00Z" + }, + { + "tag_name": "v11.8.0", + "created_at": "2026-01-21T23:16:19Z" + }, + { + "tag_name": "v11.7.0", + "created_at": "2025-12-09T19:48:29Z" + }, + { + "tag_name": "v11.6.4", + "created_at": "2025-11-25T20:33:39Z" + }, + { + "tag_name": "v11.6.3", + "created_at": "2025-11-19T20:54:12Z" + }, + { + "tag_name": "v11.6.2", + "created_at": "2025-10-08T20:10:36Z" + }, + { + "tag_name": "v10.9.4", + "created_at": "2025-09-30T18:55:47Z" + }, + { + "tag_name": "v11.6.1", + "created_at": "2025-09-24T19:01:54Z" + }, + { + "tag_name": "v11.6.0", + "created_at": "2025-09-03T19:48:47Z" + }, + { + "tag_name": "v11.5.2", + "created_at": "2025-07-30T20:13:32Z" + }, + { + "tag_name": "v11.5.1", + "created_at": "2025-07-24T18:33:05Z" + }, + { + "tag_name": "v11.5.0", + "created_at": "2025-07-24T16:54:25Z" + }, + { + "tag_name": "v10.9.3", + "created_at": "2025-06-25T20:25:03Z" + }, + { + "tag_name": "v11.4.2", + "created_at": "2025-06-12T15:08:06Z" + }, + { + "tag_name": "v11.4.1", + "created_at": "2025-05-21T22:26:47Z" + }, + { + "tag_name": "v11.4.0", + "created_at": "2025-05-15T17:05:31Z" + }, + { + "tag_name": "v11.3.0", + "created_at": "2025-04-08T18:20:16Z" + }, + { + "tag_name": "v11.2.0", + "created_at": "2025-03-05T20:39:31Z" + }, + { + "tag_name": "v11.1.0", + "created_at": "2025-01-29T21:19:57Z" + }, + { + "tag_name": "v11.0.0", + "created_at": "2024-12-16T17:31:46Z" + }, + { + "tag_name": "v10.9.2", + "created_at": "2024-12-04T23:34:22Z" + }, + { + "tag_name": "v10.9.1", + "created_at": "2024-11-21T21:52:40Z" + }, + { + "tag_name": "v9.9.4", + "created_at": "2024-11-21T21:59:57Z" + }, + { + "tag_name": "v10.9.0", + "created_at": "2024-10-03T17:56:36Z" + } + ], + "pnpm": [ + { + "tag_name": "v11.10.0", + "created_at": "2026-07-04T19:42:48Z" + }, + { + "tag_name": "v11.9.0", + "created_at": "2026-06-23T15:29:10Z" + }, + { + "tag_name": "v11.8.0", + "created_at": "2026-06-18T10:18:21Z" + }, + { + "tag_name": "v10.34.4", + "created_at": "2026-06-18T22:16:23Z" + }, + { + "tag_name": "v11.7.0", + "created_at": "2026-06-15T06:37:39Z" + }, + { + "tag_name": "v11.6.0", + "created_at": "2026-06-11T22:54:17Z" + }, + { + "tag_name": "v10.34.3", + "created_at": "2026-06-11T16:45:46Z" + }, + { + "tag_name": "v11.5.3", + "created_at": "2026-06-10T10:45:18Z" + }, + { + "tag_name": "v10.34.2", + "created_at": "2026-06-10T13:41:05Z" + }, + { + "tag_name": "v11.5.2", + "created_at": "2026-06-05T06:28:03Z" + }, + { + "tag_name": "v11.5.1", + "created_at": "2026-06-02T08:33:05Z" + }, + { + "tag_name": "v11.5.0", + "created_at": "2026-05-29T15:26:35Z" + }, + { + "tag_name": "v11.4.0", + "created_at": "2026-05-27T13:15:22Z" + }, + { + "tag_name": "v10.34.1", + "created_at": "2026-05-27T22:51:41Z" + }, + { + "tag_name": "v10.34.0", + "created_at": "2026-05-27T14:54:06Z" + }, + { + "tag_name": "v11.3.0", + "created_at": "2026-05-24T08:36:25Z" + }, + { + "tag_name": "v11.2.2", + "created_at": "2026-05-21T13:45:37Z" + }, + { + "tag_name": "v11.2.1", + "created_at": "2026-05-20T14:51:29Z" + }, + { + "tag_name": "v11.2.0", + "created_at": "2026-05-20T10:41:33Z" + }, + { + "tag_name": "v11.1.3", + "created_at": "2026-05-18T13:42:54Z" + }, + { + "tag_name": "v11.1.2", + "created_at": "2026-05-14T11:32:06Z" + }, + { + "tag_name": "v11.1.1", + "created_at": "2026-05-12T10:56:43Z" + }, + { + "tag_name": "v11.1.0", + "created_at": "2026-05-11T17:56:23Z" + }, + { + "tag_name": "v11.0.9", + "created_at": "2026-05-08T23:53:49Z" + }, + { + "tag_name": "v11.0.8", + "created_at": "2026-05-07T06:23:33Z" + }, + { + "tag_name": "v11.0.7", + "created_at": "2026-05-06T22:17:50Z" + }, + { + "tag_name": "v10.33.4", + "created_at": "2026-05-06T13:00:28Z" + }, + { + "tag_name": "v11.0.6", + "created_at": "2026-05-05T17:50:43Z" + }, + { + "tag_name": "v11.0.5", + "created_at": "2026-05-04T20:14:36Z" + }, + { + "tag_name": "v10.33.3", + "created_at": "2026-05-04T21:08:08Z" + } + ], + "yarn": [ + { + "tag_name": "v4.17.0", + "created_at": "2026-06-15T08:28:44Z" + }, + { + "tag_name": "v4.16.0", + "created_at": "2026-06-02T07:11:27Z" + }, + { + "tag_name": "v4.15.0", + "created_at": "2026-05-19T22:20:40Z" + }, + { + "tag_name": "v4.14.1", + "created_at": "2026-04-17T06:00:06Z" + }, + { + "tag_name": "v4.14.0", + "created_at": "2026-04-16T15:45:36Z" + }, + { + "tag_name": "v4.13.0", + "created_at": "2026-03-03T02:12:52Z" + }, + { + "tag_name": "v4.12.0", + "created_at": "2025-11-23T11:08:59Z" + }, + { + "tag_name": "v4.11.0", + "created_at": "2025-11-07T13:52:39Z" + }, + { + "tag_name": "v4.10.3", + "created_at": "2025-09-23T09:41:56Z" + }, + { + "tag_name": "v4.10.2", + "created_at": "2025-09-18T17:57:01Z" + }, + { + "tag_name": "v4.10.1", + "created_at": "2025-09-18T12:53:02Z" + }, + { + "tag_name": "v4.10.0", + "created_at": "2025-09-18T09:18:19Z" + }, + { + "tag_name": "v4.9.4", + "created_at": "2025-08-26T07:12:24Z" + }, + { + "tag_name": "v4.9.3", + "created_at": "2025-08-20T12:15:48Z" + }, + { + "tag_name": "v4.9.2", + "created_at": "2025-06-03T20:25:22Z" + }, + { + "tag_name": "v4.9.1", + "created_at": "2025-04-11T09:04:18Z" + }, + { + "tag_name": "v4.9.0", + "created_at": "2025-04-09T14:12:08Z" + }, + { + "tag_name": "v4.8.1", + "created_at": "2025-03-30T08:45:23Z" + }, + { + "tag_name": "v4.8.0", + "created_at": "2025-03-28T10:35:47Z" + }, + { + "tag_name": "v4.7.0", + "created_at": "2025-03-01T15:19:26Z" + }, + { + "tag_name": "v4.6.0", + "created_at": "2024-12-29T12:34:26Z" + }, + { + "tag_name": "v3.8.7", + "created_at": "2024-12-04T00:54:19Z" + }, + { + "tag_name": "v4.5.3", + "created_at": "2024-11-25T13:51:16Z" + }, + { + "tag_name": "v4.5.2", + "created_at": "2024-11-22T00:33:06Z" + }, + { + "tag_name": "v4.5.1", + "created_at": "2024-10-18T16:19:14Z" + }, + { + "tag_name": "v3.8.6", + "created_at": "2024-10-18T17:10:31Z" + }, + { + "tag_name": "v4.5.0", + "created_at": "2024-09-14T12:52:46Z" + }, + { + "tag_name": "v4.4.1", + "created_at": "2024-08-24T12:57:51Z" + }, + { + "tag_name": "v3.8.5", + "created_at": "2024-08-24T14:50:22Z" + }, + { + "tag_name": "v3.8.4", + "created_at": "2024-08-05T15:27:54Z" + } + ] + } +} diff --git a/schemas/runtime-recommended.schema.json b/schemas/runtime-recommended.schema.json new file mode 100644 index 0000000..e4beb36 --- /dev/null +++ b/schemas/runtime-recommended.schema.json @@ -0,0 +1,213 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "推荐运行时版本清单:决定构建时打进安装包、首启离线导入的 Python / Node.js 版本。由 config-center 仓库远端维护(30 分钟 git fetch 热更新),主仓库 defaults 内置保底种子", + "required": [ + "python", + "node", + "minClientVersion" + ], + "properties": { + "python": { + "type": "object", + "description": "Python 推荐版本(python-build-standalone 发行版,经内置 Hatch 安装)。归档必须与内置 Hatch 版本 pin 的发布完全一致(tag + 文件名 + 变体),否则首启离线导入后 hatch 的更新判断会出现偏差", + "required": [ + "name", + "version", + "distTag", + "archives" + ], + "properties": { + "name": { + "type": "string", + "description": "Hatch distribution 名(如 \"3.13\"):`hatch python install ` 的实参,也是安装目录 hatch/local// 的目录名,幂等判断依据" + }, + "version": { + "type": "string", + "description": "精确 Python 版本(如 \"3.13.9\"),仅用于展示与清单更新判断" + }, + "distTag": { + "type": "string", + "description": "python-build-standalone 的 release tag(如 \"20251014\")" + }, + "archives": { + "type": "object", + "description": "各平台归档的相对路径(相对下载源根目录)。键为 `-`(Node.js process.platform/arch 语义),值为源站 URL 尾部路径,同时也是 static/runtimes/-/ 下的落盘相对路径", + "required": [ + "darwin-arm64", + "darwin-x64", + "win32-x64", + "win32-arm64", + "linux-x64", + "linux-arm64" + ], + "properties": { + "darwin-arm64": { + "type": "string", + "description": "macOS Apple Silicon 的归档相对路径" + }, + "darwin-x64": { + "type": "string", + "description": "macOS Intel 的归档相对路径" + }, + "win32-x64": { + "type": "string", + "description": "Windows x64 的归档相对路径" + }, + "win32-arm64": { + "type": "string", + "description": "Windows ARM64 的归档相对路径" + }, + "linux-x64": { + "type": "string", + "description": "Linux x64 的归档相对路径" + }, + "linux-arm64": { + "type": "string", + "description": "Linux ARM64 的归档相对路径" + } + }, + "additionalProperties": false + }, + "sha256": { + "type": "object", + "description": "各平台归档的 SHA-256 校验值(十六进制小写)。构建脚本下载后校验,防止归档被镜像/代理篡改或截断", + "properties": { + "darwin-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "macOS Apple Silicon 归档的 SHA-256" + }, + "darwin-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "macOS Intel 归档的 SHA-256" + }, + "win32-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Windows x64 归档的 SHA-256" + }, + "win32-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Windows ARM64 归档的 SHA-256" + }, + "linux-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Linux x64 归档的 SHA-256" + }, + "linux-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Linux ARM64 归档的 SHA-256" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "node": { + "type": "object", + "description": "Node.js 推荐版本(官方 dist 归档,经内置 Volta 安装)", + "required": [ + "version", + "archives" + ], + "properties": { + "version": { + "type": "string", + "description": "精确 Node.js 版本(如 \"24.18.0\",不带 v 前缀):`volta fetch node@` 的实参。必须是精确三段版本——Volta 对 Exact 版本的解析完全离线,不访问 index.json" + }, + "ltsCodename": { + "type": "string", + "description": "LTS 代号(如 \"Krypton\"),仅用于展示" + }, + "archives": { + "type": "object", + "description": "各平台归档的相对路径(相对下载源根目录)。键为 `-`(Node.js process.platform/arch 语义),值为源站 URL 尾部路径,同时也是 static/runtimes/-/ 下的落盘相对路径", + "required": [ + "darwin-arm64", + "darwin-x64", + "win32-x64", + "win32-arm64", + "linux-x64", + "linux-arm64" + ], + "properties": { + "darwin-arm64": { + "type": "string", + "description": "macOS Apple Silicon 的归档相对路径" + }, + "darwin-x64": { + "type": "string", + "description": "macOS Intel 的归档相对路径" + }, + "win32-x64": { + "type": "string", + "description": "Windows x64 的归档相对路径" + }, + "win32-arm64": { + "type": "string", + "description": "Windows ARM64 的归档相对路径" + }, + "linux-x64": { + "type": "string", + "description": "Linux x64 的归档相对路径" + }, + "linux-arm64": { + "type": "string", + "description": "Linux ARM64 的归档相对路径" + } + }, + "additionalProperties": false + }, + "sha256": { + "type": "object", + "description": "各平台归档的 SHA-256 校验值(十六进制小写)。构建脚本下载后校验,防止归档被镜像/代理篡改或截断", + "properties": { + "darwin-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "macOS Apple Silicon 归档的 SHA-256" + }, + "darwin-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "macOS Intel 归档的 SHA-256" + }, + "win32-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Windows x64 归档的 SHA-256" + }, + "win32-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Windows ARM64 归档的 SHA-256" + }, + "linux-x64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Linux x64 归档的 SHA-256" + }, + "linux-arm64": { + "type": "string", + "pattern": "^[0-9a-f]{64}$", + "description": "Linux ARM64 归档的 SHA-256" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "minClientVersion": { + "type": "string", + "description": "使用此清单所需的最低客户端版本(package.json#version 语义)。远端热更新的清单若要求高于当前客户端版本,则忽略远端、继续使用内置种子——防止老客户端的内置 Hatch/Volta 不认识新版本格式" + } + }, + "additionalProperties": false +} diff --git a/schemas/runtime-versions-fallback.schema.json b/schemas/runtime-versions-fallback.schema.json new file mode 100644 index 0000000..bb71dd3 --- /dev/null +++ b/schemas/runtime-versions-fallback.schema.json @@ -0,0 +1,132 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "description": "离线兜底版本清单:联网查询可安装版本列表失败时的替代数据,消除「空列表 + 无限重试」。各字段条目形状与对应实时接口的最终返回值完全同构,前端无需区分解析", + "required": [ + "generatedAt", + "node", + "python", + "pkgManagers" + ], + "properties": { + "generatedAt": { + "type": "string", + "description": "快照生成时间(ISO 8601),用于展示「离线列表可能不是最新」的提示" + }, + "node": { + "type": "array", + "description": "Node.js 版本条目快照(nodejs.org/dist/index.json 元素子集,含 version/date/lts/npm 等字段)", + "items": { + "type": "object", + "required": [ + "version" + ], + "properties": { + "version": { + "type": "string", + "description": "版本号(带 v 前缀,如 \"v24.18.0\")" + } + }, + "additionalProperties": true + } + }, + "python": { + "type": "array", + "description": "Python 发行版条目快照(与 `hatch python show` 解析结果同构)", + "items": { + "type": "object", + "required": [ + "name", + "version" + ], + "properties": { + "name": { + "type": "string", + "description": "Hatch distribution 名(如 \"3.13\"、\"pypy3.11\")" + }, + "version": { + "type": "string", + "description": "精确版本号(如 \"3.13.9\")" + } + }, + "additionalProperties": false + } + }, + "pkgManagers": { + "type": "object", + "description": "包管理器 release 条目快照(与 listAvailablePkgManagers 最终返回形状一致:已过滤预发布、yarn 已归一化 tag_name)", + "required": [ + "npm", + "pnpm", + "yarn" + ], + "properties": { + "npm": { + "type": "array", + "description": "npm 的正式版本条目", + "items": { + "type": "object", + "required": [ + "tag_name" + ], + "properties": { + "tag_name": { + "type": "string", + "description": "版本 tag(如 \"v11.18.0\")" + }, + "created_at": { + "type": "string", + "description": "发布时间(ISO 8601)" + } + }, + "additionalProperties": true + } + }, + "pnpm": { + "type": "array", + "description": "pnpm 的正式版本条目", + "items": { + "type": "object", + "required": [ + "tag_name" + ], + "properties": { + "tag_name": { + "type": "string", + "description": "版本 tag(如 \"v10.12.1\")" + }, + "created_at": { + "type": "string", + "description": "发布时间(ISO 8601)" + } + }, + "additionalProperties": true + } + }, + "yarn": { + "type": "array", + "description": "yarn (berry) 的正式版本条目", + "items": { + "type": "object", + "required": [ + "tag_name" + ], + "properties": { + "tag_name": { + "type": "string", + "description": "版本 tag(如 \"v4.17.0\",已从 name 字段归一化)" + }, + "created_at": { + "type": "string", + "description": "发布时间(ISO 8601)" + } + }, + "additionalProperties": true + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} diff --git a/scripts/validate.mjs b/scripts/validate.mjs index 75549f8..d872fa3 100644 --- a/scripts/validate.mjs +++ b/scripts/validate.mjs @@ -47,6 +47,8 @@ function pickSchemaKey(absPath) { if (rel === 'compute/pricing.json') return 'pricing' if (rel === 'compute/service-map.json') return 'service-map' if (rel === 'compute/providers/_index.json') return 'providers-index' + if (rel === 'runtimes/recommended.json') return 'runtime-recommended' + if (rel === 'runtimes/versions-fallback.json') return 'runtime-versions-fallback' if (rel === 'compute/coding-plans/_index.json') return 'providers-index' if (rel === 'compute/model-specs/_index.json') return 'providers-index' if (rel.startsWith('compute/providers/') && rel.endsWith('.json')) return 'provider'