mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 03:15:01 +00:00
* refactor(main): organize runtime implementation owners * test: retire wall-clock CLI title recovery case * refactor: route new folder mutation to runtime store owner * test: import folder mutation store contract from its owner
24 lines
1.0 KiB
TypeScript
24 lines
1.0 KiB
TypeScript
import type { KnownRuntimeEnvironment } from '../../shared/remote-runtime/host-catalog/runtime-environments'
|
|
import { verifyRuntimeEnvironmentIdentity } from '../runtime/hosts/identity/runtime-environment-identity-verification'
|
|
import type { PairedRuntimeConnection } from '../../shared/remote-runtime/pairing/paired-runtime-connection'
|
|
import type { RuntimeStatus } from '../../shared/runtime-types'
|
|
|
|
export async function verifyRuntimeEnvironmentSshTunnel(
|
|
environment: KnownRuntimeEnvironment,
|
|
localPort: number,
|
|
signal?: AbortSignal
|
|
): Promise<{
|
|
verifiedConnection: PairedRuntimeConnection
|
|
verifiedRuntimeId: string
|
|
runtimeStatus: RuntimeStatus
|
|
}> {
|
|
if (!Number.isInteger(localPort) || localPort < 1 || localPort > 65_535) {
|
|
throw new Error('The SSH tunnel did not provide a valid local port.')
|
|
}
|
|
// The tunnel targets the native listener, not the public reverse proxy; E2EE still pins its key.
|
|
return verifyRuntimeEnvironmentIdentity(environment, {
|
|
endpoint: `ws://127.0.0.1:${localPort}`,
|
|
signal
|
|
})
|
|
}
|