mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
26 lines
962 B
TypeScript
26 lines
962 B
TypeScript
import type { ProjectExecutionRuntimeResolution } from '../../../shared/project-execution-runtime'
|
|
import { isWslUncPath } from '../../../shared/wsl-paths'
|
|
import { splitWorktreeIdForFilesystem } from '../../../shared/worktree-id'
|
|
|
|
export type OrchestrationCliCommand = 'orca' | 'orca-ide'
|
|
|
|
export function resolveTerminalOrchestrationCliCommand(args: {
|
|
connectionId: string | null
|
|
isWsl: boolean | null | undefined
|
|
worktreeId: string
|
|
projectRuntime?: ProjectExecutionRuntimeResolution
|
|
}): OrchestrationCliCommand {
|
|
if (args.connectionId) {
|
|
return 'orca'
|
|
}
|
|
if (args.isWsl !== null && args.isWsl !== undefined) {
|
|
return args.isWsl ? 'orca-ide' : 'orca'
|
|
}
|
|
if (args.projectRuntime?.status === 'resolved' && args.projectRuntime.runtime.kind === 'wsl') {
|
|
return 'orca-ide'
|
|
}
|
|
|
|
const worktreePath = splitWorktreeIdForFilesystem(args.worktreeId)?.worktreePath
|
|
return worktreePath && isWslUncPath(worktreePath) ? 'orca-ide' : 'orca'
|
|
}
|