feat: add independent managed SSH agent packages

Managed SSH previously tied remote Agent and Runtime artifacts to desktop
packaging and Host activation. Settings now manages verified Linux x64 and
arm64 .gbagent packages explicitly, with source-aligned download and update
plus offline import and export. Each package contains the signed Agent, pinned
Node, and compatible OpenCode Runtime, and project activation never downloads
one automatically.

Dedicated native CI and a protected release workflow publish deterministic,
signed cumulative catalogs to GitHub and Beijing OSS without replacing the
desktop Latest release. Desktop packaging is metadata-only, remains independent
of Agent artifacts and signing credentials, and Linux desktop releases add RPM
installers.

The managed SSH path also keeps model credentials in Main, enforces Ask as
read-only, verifies signed Agent and Runtime inputs, preserves ACP recovery, and
reports Host update cancellation and failures accurately.

Release note: 远程项目现可在“设置”中手动下载、更新或离线导入签名 Agent 包,桌面安装包与远程组件发布相互独立;Linux 桌面版同时新增 RPM 安装包。
This commit is contained in:
mesalogo
2026-08-25 18:28:29 +08:00
parent 88658aceaa
commit e5aebaa67d
101 changed files with 11543 additions and 2168 deletions
+10 -28
View File
@@ -32,6 +32,9 @@ const tar = require('tar')
const {
detectElfArchitecture
} = require('./binary-architecture.cjs')
const {
preflightRegisteredProductionKey
} = require('./signing-key-preflight.cjs')
const root = join(__dirname, '..')
const domainSeparator = Buffer.from(
@@ -379,36 +382,15 @@ function preflightProductionSigningKey(options = {}) {
const projectRoot = options.projectRoot ?? root
const environment = options.environment ?? process.env
const keyId = options.keyId ?? environment[signingKeyIdEnvironment]
if (!keyId) {
throw new Error(
`${signingKeyIdEnvironment} is not configured; provision the production Agent signing key ID before building a release`
)
}
const registry =
options.registry ?? readTrustedKeyRegistry(projectRoot)
const signingRecord = registry.keys.find(
(key) => key.keyId === keyId
)
if (!signingRecord) {
throw new Error(
`Production Agent public signing key ID "${keyId}" is absent from resources/agent-release-keys.json; provision the matching public key before building a release`
)
}
if (signingRecord.environment !== 'production') {
throw new Error(
`Production Agent signing key ID "${keyId}" is not registered for production`
)
}
if (
registry.revocations.some(
(revocation) => revocation.keyId === keyId
)
) {
throw new Error(
`Production Agent signing key ID "${keyId}" is revoked`
)
}
return signingRecord
return preflightRegisteredProductionKey({
component: 'Agent',
keyId,
registry,
missingKeyIdMessage:
`${signingKeyIdEnvironment} is not configured; provision the production Agent signing key ID before building a release`
})
}
function publicKeySpkiBase64(key) {