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.

977 B
Raw Blame
export const RUNTIME_NAVIGATION_TARGETS = ['caller', 'host', 'clients', 'all'] as const

export type RuntimeNavigationTarget = (typeof RUNTIME_NAVIGATION_TARGETS)[number]

export function resolveRuntimeNavigationTarget(args: {
  navigation?: RuntimeNavigationTarget
  notifyClients?: boolean
  clientKind?: 'mobile' | 'runtime'
  defaultTarget?: RuntimeNavigationTarget
}): RuntimeNavigationTarget {
  if (args.navigation) {
    return args.navigation
  }
  if (args.clientKind) {
    // Why: legacy paired clients sent notifyClients:true; treating that as navigation lets one device steer every UI.
    return 'caller'
  }
  return args.notifyClients === false ? 'caller' : (args.defaultTarget ?? 'all')
}

export function navigationTargetsHost(target: RuntimeNavigationTarget): boolean {
  return target === 'host' || target === 'all'
}

export function navigationTargetsClients(target: RuntimeNavigationTarget): boolean {
  return target === 'clients' || target === 'all'
}