Files
automaker/libs/platform/src/index.ts
Kacper 1a37603e89 feat: Add WSL support for Cursor CLI on Windows
- Add reusable WSL utilities in @automaker/platform (wsl.ts):
  - isWslAvailable() - Check if WSL is available on Windows
  - findCliInWsl() - Find CLI tools in WSL, tries multiple distributions
  - execInWsl() - Execute commands in WSL
  - createWslCommand() - Create spawn-compatible command/args for WSL
  - windowsToWslPath/wslToWindowsPath - Path conversion utilities
  - getWslDistributions() - List available WSL distributions

- Update CursorProvider to use WSL on Windows:
  - Detect cursor-agent in WSL distributions (prioritizes Ubuntu)
  - Use full path to wsl.exe for spawn() compatibility
  - Pass --cd flag for working directory inside WSL
  - Store and use WSL distribution for all commands
  - Show "(WSL:Ubuntu) /path" in installation status

- Add 'wsl' to InstallationStatus.method type

- Fix bugs:
  - Fix ternary in settings-view.tsx that always returned 'claude'
  - Fix findIndex -1 handling in WSL command construction
  - Remove 'gpt-5.2' from unknown models test (now valid Cursor model)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-28 13:47:24 +01:00

73 lines
1.4 KiB
TypeScript

/**
* @automaker/platform
* Platform-specific utilities for AutoMaker
*/
// Path utilities
export {
getAutomakerDir,
getFeaturesDir,
getFeatureDir,
getFeatureImagesDir,
getBoardDir,
getImagesDir,
getContextDir,
getWorktreesDir,
getValidationsDir,
getValidationDir,
getValidationPath,
getAppSpecPath,
getBranchTrackingPath,
ensureAutomakerDir,
getGlobalSettingsPath,
getCredentialsPath,
getProjectSettingsPath,
ensureDataDir,
} from './paths.js';
// Subprocess management
export {
spawnJSONLProcess,
spawnProcess,
type SubprocessOptions,
type SubprocessResult,
} from './subprocess.js';
// Security
export {
PathNotAllowedError,
initAllowedPaths,
isPathAllowed,
validatePath,
isPathWithinDirectory,
getAllowedRootDirectory,
getDataDirectory,
getAllowedPaths,
} from './security.js';
// Secure file system (validates paths before I/O operations)
export * as secureFs from './secure-fs.js';
// Node.js executable finder (cross-platform)
export {
findNodeExecutable,
buildEnhancedPath,
type NodeFinderResult,
type NodeFinderOptions,
} from './node-finder.js';
// WSL (Windows Subsystem for Linux) utilities
export {
isWslAvailable,
clearWslCache,
getDefaultWslDistribution,
getWslDistributions,
findCliInWsl,
execInWsl,
createWslCommand,
windowsToWslPath,
wslToWindowsPath,
type WslCliResult,
type WslOptions,
} from './wsl.js';