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.

1.3 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import { resolveMobileAgentLaunchAvailability } from './mobile-agent-launch-availability'

const LAUNCH = ['agent.launch.v2', 'agent.launch.replay.v1', 'agent.launch.replay-required.v1']

describe('resolveMobileAgentLaunchAvailability', () => {
  it('is available when the host advertises the replay-required launch', () => {
    expect(
      resolveMobileAgentLaunchAvailability({
        hostCapabilities: LAUNCH,
        statusPending: false,
        statusReadable: true
      })
    ).toBe('available')
  })

  it('asks for an update only when the host answered without the capability', () => {
    expect(
      resolveMobileAgentLaunchAvailability({
        hostCapabilities: ['agent.launch.v2'],
        statusPending: false,
        statusReadable: true
      })
    ).toBe('update-required')
  })

  it('does not blame the host version when its status could not be read', () => {
    expect(
      resolveMobileAgentLaunchAvailability({
        hostCapabilities: [],
        statusPending: false,
        statusReadable: false
      })
    ).toBe('unverified')
  })

  it('waits while the status is being read', () => {
    expect(
      resolveMobileAgentLaunchAvailability({
        hostCapabilities: [],
        statusPending: true,
        statusReadable: false
      })
    ).toBe('checking')
  })
})