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.

926 B
Raw Blame
import { isPrintModeHeadlessOneShotCommand, optionName } from './print-mode-headless-command'

export function isQoderHeadlessCommand(tokens: readonly string[]): boolean {
  if (isPrintModeHeadlessOneShotCommand(tokens)) {
    return true
  }
  for (let index = 1; index < tokens.length; index += 1) {
    const token = tokens[index]
    if (token === '--') {
      return false
    }
    const name = optionName(token)
    const value = token.includes('=') ? token.slice(token.indexOf('=') + 1) : tokens[index + 1]
    if (name === '-o' && (value === 'json' || value === 'stream-json')) {
      return true
    }
    if (name === '--input-format' && value === 'stream-json') {
      return true
    }
    if (
      name === '--remote-control' ||
      name === '--remote' ||
      name === '--list-sessions' ||
      name === '--delete-session' ||
      name === '--acp'
    ) {
      return true
    }
  }
  return false
}