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.

823 B
Raw Blame
import {
  compareAppVersions,
  isPrereleaseAppVersion,
  isValidAppVersion
} from '../../../src/shared/app-version'

export type AppUpdateCheckResult =
  | { kind: 'available'; version: string; url: string }
  | { kind: 'current' }

/** One install channel. Rejects when the channel could not be asked; never retries itself. */
export type AppUpdateSource = {
  check(installedVersion: string, signal: AbortSignal): Promise<AppUpdateCheckResult>
}

/** True for a plain release version newer than the installed one; prerelease suffixes never qualify. */
export function isNewerReleaseVersion(candidate: string, installed: string): boolean {
  return (
    isValidAppVersion(candidate) &&
    isValidAppVersion(installed) &&
    !isPrereleaseAppVersion(candidate) &&
    compareAppVersions(candidate, installed) > 0
  )
}