mirror of
https://github.com/stablyai/orca.git
synced 2026-11-19 04:23:57 +00:00
Fix WSL orchestration CLI preambles (#8561)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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'
|
||||
}
|
||||
Reference in New Issue
Block a user