feat: add Volta Node version manager support

Added support for Volta (https://docs.volta.sh/), a Node version manager
for Windows/macOS/Linux. This resolves issue #295 where OpenCode installed
via Volta was not being detected.

Changes:
- Added ~/.volta/bin to Windows path expansion in getExpandedEnv()
- Added Volta paths to Windows OpenCode detection in probeWindowsPaths()
- Volta's shim directory (~/.volta/bin) is now searched when detecting tools

Users with OpenCode installed via Volta will now see it automatically
detected in the Wizard and available for group chat moderator selection.
This commit is contained in:
chr1syy
2026-02-05 20:00:30 +01:00
parent 3a0affb149
commit d2206c2548

View File

@@ -87,6 +87,8 @@ export function getExpandedEnv(): NodeJS.ProcessEnv {
// Node Version Manager for Windows (nvm4w) - OpenCode commonly installed here // Node Version Manager for Windows (nvm4w) - OpenCode commonly installed here
'C:\\nvm4w\\nodejs', 'C:\\nvm4w\\nodejs',
path.join(home, 'nvm4w', 'nodejs'), path.join(home, 'nvm4w', 'nodejs'),
// Volta - Node version manager for Windows/macOS/Linux (installs shims to .volta/bin)
path.join(home, '.volta', 'bin'),
// Scoop package manager (OpenCode, other tools) // Scoop package manager (OpenCode, other tools)
path.join(home, 'scoop', 'shims'), path.join(home, 'scoop', 'shims'),
path.join(home, 'scoop', 'apps', 'opencode', 'current'), path.join(home, 'scoop', 'apps', 'opencode', 'current'),
@@ -255,6 +257,9 @@ function getWindowsKnownPaths(binaryName: string): string[] {
// Scoop installation (recommended for OpenCode) // Scoop installation (recommended for OpenCode)
path.join(home, 'scoop', 'shims', 'opencode.exe'), path.join(home, 'scoop', 'shims', 'opencode.exe'),
path.join(home, 'scoop', 'apps', 'opencode', 'current', 'opencode.exe'), path.join(home, 'scoop', 'apps', 'opencode', 'current', 'opencode.exe'),
// Volta - Node version manager (OpenCode commonly installed via Volta)
path.join(home, '.volta', 'bin', 'opencode'),
path.join(home, '.volta', 'bin', 'opencode.cmd'),
// Chocolatey installation // Chocolatey installation
path.join( path.join(
process.env.ChocolateyInstall || 'C:\\ProgramData\\chocolatey', process.env.ChocolateyInstall || 'C:\\ProgramData\\chocolatey',