chore: 保存 Agent 安全优化前基线

This commit is contained in:
Logan.Li committed 2026-09-02 23:31:38 +08:00
1 parent 08696896f9
commit ff016347cd
116 files changed
+3858 -2485

No files matched your search

+6 -1
View File
@@ -3,7 +3,7 @@ import { existsSync, readdirSync } from 'node:fs'
import { join } from 'node:path'
import { assertWithinSize, readPeMachine } from './release-tools.mjs'
const platform = process.argv[2] ?? (process.platform === 'darwin' ? 'macos' : process.platform === 'win32' ? 'windows' : '')
const platform = process.argv[2] ?? (process.platform === 'darwin' ? 'macos' : process.platform === 'win32' ? 'windows' : process.platform === 'linux' ? 'linux' : '')
const root = process.argv[3] ?? (platform === 'macos'
? 'src-tauri/target/aarch64-apple-darwin/release/bundle'
: 'src-tauri/target/release/bundle')
@@ -57,6 +57,11 @@ if (platform === 'macos') {
}
for (const installer of installers) assertWithinSize(installer, maxInstallerBytes)
console.log(`[release] Windows x64 artifacts verified: ${root}`)
} else if (platform === 'linux') {
const installers = files.filter((path) => /\.(?:deb|rpm|appimage)$/i.test(path))
if (installers.length === 0) fail('Linux release must contain a .deb, .rpm, or .AppImage')
for (const installer of installers) assertWithinSize(installer, maxInstallerBytes)
console.log(`[release] Linux artifacts verified: ${root}`)
} else {
fail(`Unsupported platform: ${platform}`)
}