mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 16:03:45 +00:00
extend(ai-vault): support Cursor sessions with host-aware context isolat
Extends AI Vault session history to surface Cursor agent sessions with proper isolation across native, WSL, and SSH execution contexts. Implements cursor sidecar discovery and parsing (local and remote), host-matched command resolution, and metadata-only conversation tracking for sessions without readable transcripts. Adds mobile support for Cursor history resume and strengthens execution-context validation to prevent resuming sessions in incompatible target environments.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { resolveEffectiveCursorCommand } from '../../shared/cursor-command'
|
||||
import type { TuiAgent } from '../../shared/types'
|
||||
import { parseWslUncPath } from '../../shared/wsl-paths'
|
||||
import {
|
||||
detectInstalledAgentCommandsWithShellPathHydration,
|
||||
detectRemoteAgentCommands
|
||||
} from '../ipc/tui-agent-inventory-detection'
|
||||
|
||||
export async function resolveRuntimeAgentCommandOverrides(args: {
|
||||
agent: TuiAgent
|
||||
cmdOverrides: Partial<Record<TuiAgent, string>>
|
||||
connectionId?: string | null
|
||||
wslDistro?: string | null
|
||||
workspacePath: string
|
||||
}): Promise<Partial<Record<TuiAgent, string>>> {
|
||||
if (args.agent !== 'cursor' || args.cmdOverrides.cursor?.trim()) {
|
||||
return args.cmdOverrides
|
||||
}
|
||||
try {
|
||||
const wslDistro = args.wslDistro?.trim() || parseWslUncPath(args.workspacePath)?.distro
|
||||
const inventory = args.connectionId
|
||||
? await detectRemoteAgentCommands({ connectionId: args.connectionId })
|
||||
: await detectInstalledAgentCommandsWithShellPathHydration(wslDistro ? { wslDistro } : {})
|
||||
const command = resolveEffectiveCursorCommand(null, inventory)
|
||||
return command ? { ...args.cmdOverrides, cursor: command } : args.cmdOverrides
|
||||
} catch {
|
||||
return args.cmdOverrides
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user