Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

883 B
Raw Blame
import type { ProcessRunResult } from './ephemeral-vm-recipe-process'
import {
  EPHEMERAL_VM_FAILURE_COPY,
  ephemeralVmExitFailure,
  ephemeralVmFailure,
  type EphemeralVmFailure
} from './ephemeral-vm-failure-copy'

export const EPHEMERAL_VM_CLEANUP_STOPPED_ERROR = EPHEMERAL_VM_FAILURE_COPY.cleanupStopped

type FailedEphemeralVmRecipeDestroy = {
  ok: false
  skipped: false
} & EphemeralVmFailure &
  ProcessRunResult

export function getEphemeralVmRecipeDestroyFailure(
  result: ProcessRunResult
): FailedEphemeralVmRecipeDestroy | null {
  if (result.aborted) {
    return {
      ok: false,
      skipped: false,
      ...ephemeralVmFailure('cleanupStopped'),
      ...result
    }
  }
  if (result.exitCode !== 0) {
    return {
      ok: false,
      skipped: false,
      ...ephemeralVmExitFailure('destroy', result.exitCode),
      ...result
    }
  }
  return null
}