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.4 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import { resolveRuntimeNavigationTarget } from './runtime-navigation'

describe('runtime navigation authority', () => {
  it('denies paired-client fanout for legacy payloads', () => {
    expect(resolveRuntimeNavigationTarget({ clientKind: 'runtime', notifyClients: true })).toBe(
      'caller'
    )
    expect(resolveRuntimeNavigationTarget({ clientKind: 'mobile', notifyClients: true })).toBe(
      'caller'
    )
  })

  it('preserves legacy in-process routing and explicit intent', () => {
    expect(resolveRuntimeNavigationTarget({ notifyClients: true })).toBe('all')
    expect(resolveRuntimeNavigationTarget({ notifyClients: false })).toBe('caller')
    expect(
      resolveRuntimeNavigationTarget({
        clientKind: 'runtime',
        notifyClients: false,
        navigation: 'host'
      })
    ).toBe('host')
  })

  it('lets worktree operations default to the host without overriding paired or explicit intent', () => {
    expect(resolveRuntimeNavigationTarget({ defaultTarget: 'host' })).toBe('host')
    expect(resolveRuntimeNavigationTarget({ defaultTarget: 'host', notifyClients: false })).toBe(
      'caller'
    )
    expect(resolveRuntimeNavigationTarget({ defaultTarget: 'host', clientKind: 'runtime' })).toBe(
      'caller'
    )
    expect(resolveRuntimeNavigationTarget({ defaultTarget: 'host', navigation: 'clients' })).toBe(
      'clients'
    )
  })
})