feat: add managed SSH execution spaces

Add managed SSH Hosts and projects with signed side-by-side GoodBuddy Agent and OpenCode Runtime installation, Ask and Execute workspace access, a Main-owned model bridge, detached Agent lifecycle, durable ACP output recovery, and project activation UI.

Use protocol v2 with bounded FIFO frames over SSH instead of custom credit, priority, batching, or model-message chunking. Mismatched Host Agents now upgrade automatically, an exactly verified Node runtime is reused on-host, and local Portable builds can embed strictly verified Agent artifacts.

Release note: 新增托管 SSH 远程项目,可自动安装或升级签名 Agent/OpenCode Runtime,并在 SSH 断线后继续 Agent 工作和同步未确认输出。
This commit is contained in:
mesalogo
2026-08-24 23:02:18 +08:00
parent 3829a871f5
commit 607bb33249
258 changed files with 99449 additions and 2427 deletions
@@ -0,0 +1,38 @@
import type { WorkMode } from '../../shared/assistant-contracts'
import {
agentRuntimeSelectionKey,
type AgentRuntimeSelection
} from '../../shared/runtime-selection-contracts'
import type { SshExecutionSpaceDescriptor } from './execution-space-resolver'
/**
* Prevents a request from reusing persisted remote Runtime evidence under a
* different Runtime selection, work mode, or Agent install.
*/
export function assertRemoteRuntimeRequestValidated(
executionSpace: SshExecutionSpaceDescriptor,
selection: AgentRuntimeSelection,
workMode: WorkMode
): void {
const executionValidation = executionSpace.validation
const runtimeValidation = executionSpace.runtimeValidation
if (
!executionValidation ||
!runtimeValidation ||
executionValidation.agentInstallationIdAtValidation !==
runtimeValidation.agentInstallationIdAtValidation
) {
throw new Error('远程 Project 缺少完整的当前验证,请重新验证')
}
if (
runtimeValidation.runtimeSelectionKey !==
agentRuntimeSelectionKey(selection)
) {
throw new Error('远程 Project 的 Runtime 选择已变化,请重新验证')
}
if (runtimeValidation.workMode !== workMode) {
throw new Error(
`远程 Project 仅验证了 ${runtimeValidation.workMode === 'ask' ? 'Ask' : 'Execute'} 模式,请先重新验证工作模式`
)
}
}