mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 00:02:10 +00:00
* fix(orchestration): preserve active workers across updates * test(ssh): model absent legacy adoption * test(orchestration): align compatibility contracts * fix(windows): escape updater PowerShell booleans * fix(windows): restore stock uninstall process check * fix(orchestration): keep recovery off renderer startup barrier * fix(orchestration): harden legacy recovery migration * fix(orchestration): close recovery review gaps * fix(orchestration): complete legacy worker cutover recovery * fix(orchestration): preserve legacy workers across updates --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
41 lines
1.5 KiB
TypeScript
41 lines
1.5 KiB
TypeScript
import type { RpcResponse } from '../runtime/rpc/core'
|
|
import type { ParsedRemoteCli } from './ssh-remote-cli-argument-error'
|
|
import type { RemoteOrcaCliResult } from './ssh-remote-cli-host-passthrough'
|
|
import { formatRemoteCli } from './ssh-remote-cli-format'
|
|
import {
|
|
formatRemoteOrchestrationAsk,
|
|
getRemoteCliExitCode
|
|
} from './ssh-remote-orchestration-ask-output'
|
|
import { formatRemoteOrchestrationCheck } from './ssh-remote-orchestration-check-output'
|
|
import { getRemoteCliPostOutput } from './ssh-remote-orchestration-post-output'
|
|
import { resolveRemoteCliHandle } from './ssh-remote-cli-args'
|
|
|
|
export function formatInProcessRemoteCliResult(
|
|
parsed: ParsedRemoteCli,
|
|
env: Record<string, string>,
|
|
response: RpcResponse,
|
|
json: boolean
|
|
): RemoteOrcaCliResult {
|
|
const command = parsed.commandPath.join(' ')
|
|
const formatted =
|
|
command === 'orchestration check'
|
|
? formatRemoteOrchestrationCheck(
|
|
response,
|
|
json,
|
|
resolveRemoteCliHandle(parsed.flags, env, 'terminal'),
|
|
parsed.flags.has('format')
|
|
)
|
|
: command === 'orchestration ask'
|
|
? formatRemoteOrchestrationAsk(response, json)
|
|
: json
|
|
? { stdout: `${JSON.stringify(response, null, 2)}\n`, stderr: '' }
|
|
: formatRemoteCli(response)
|
|
const postOutput = getRemoteCliPostOutput(parsed, env, response)
|
|
return {
|
|
stdout: formatted.stdout,
|
|
stderr: formatted.stderr,
|
|
exitCode: getRemoteCliExitCode(command, response),
|
|
...(postOutput ? { postOutput } : {})
|
|
}
|
|
}
|