Files
orca/src/shared/qoder-headless-command.ts
T
8b410b4893 feat: add first-class Qoder CLI support (#23581)
feat: add first-class Qoder CLI support

Integrate Qoder launch, identity, canonical hook status, trust and resume.
Verify with captured Qoder 1.1.64 transcripts and hidden Electron sidebar checks.

Builds on and cross-reviews #7502, #8611, #9655, #12910, #13311 and #15291.

Co-authored-by: dalveytech-vincent <vincent@dalveytech.com>
Co-authored-by: Eridanus117 <45489268+Eridanus117@users.noreply.github.com>
Co-authored-by: xingqingzzp-gif <xingqingzzp-gif@users.noreply.github.com>
Co-authored-by: jyang2004 <jyang2004@users.noreply.github.com>
Co-authored-by: yunqian <yunqian@alibaba-inc.com>
Co-authored-by: huzhening.hzn <huzhening.hzn@alibaba-inc.com>
2026-09-28 02:59:50 -07:00

32 lines
926 B
TypeScript

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
}