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:
Jinjing
2026-08-05 12:44:29 -07:00
parent b1b291db08
commit d6a27423fc
146 changed files with 7695 additions and 895 deletions
@@ -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
}
}