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.

815 B
Raw Blame
import type { ConnectionState } from '../transport/types'

type MobileTerminalInputGateOptions = {
  readonly connState: ConnectionState
  readonly activeHandle: string | null
  readonly activeSessionTabType: string | null | undefined
}

type MobileTerminalInputGate = {
  // Composing is local; preserve typed text through connection outages.
  readonly canCompose: boolean
  readonly canSend: boolean
}

export function resolveMobileTerminalInputGate({
  connState,
  activeHandle,
  activeSessionTabType
}: MobileTerminalInputGateOptions): MobileTerminalInputGate {
  const canCompose =
    activeHandle != null &&
    activeSessionTabType !== 'markdown' &&
    activeSessionTabType !== 'file' &&
    activeSessionTabType !== 'browser'
  return { canCompose, canSend: canCompose && connState === 'connected' }
}