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.

802 B
Raw Blame
import { z } from 'zod'

const PendingRuntimeRepoRemovalSchema = z.object({
  environmentId: z.string().min(1),
  repoId: z.string().min(1),
  requestedAt: z.number().finite()
})

/** A project this desktop removed while its paired server was unreachable; `repo.rm` replays on reconnect. */
export type PendingRuntimeRepoRemoval = z.infer<typeof PendingRuntimeRepoRemovalSchema>

/** Persisted UI state is hand-editable and older builds never wrote it; keep only well-formed records. */
export function normalizePendingRuntimeRepoRemovals(value: unknown): PendingRuntimeRepoRemoval[] {
  if (!Array.isArray(value)) {
    return []
  }
  return value.flatMap((entry: unknown) => {
    const parsed = PendingRuntimeRepoRemovalSchema.safeParse(entry)
    return parsed.success ? [parsed.data] : []
  })
}