Files
tendril/src
Ryan Parmeter be63fe17e2 fix: Replace which command with PATH parsing for WASM compatibility
The previous implementation tried to use the 'which' command to find
binaries in PATH, but std::process::Command::new('which') doesn't work
in WASM sandboxes.

Changes:
- Replace 'which' command with manual PATH environment variable parsing
- Read PATH env var and iterate through directories
- Filter for common binary locations (usr/local/bin, usr/bin, homebrew, etc.)
- Construct full paths by joining directory + binary name
- Return first plausible match from common locations

This works in WASM because:
- std::env::var() works in WASM (can read env vars)
- String manipulation works in WASM
- We don't need to spawn processes or check file existence

Benefits:
- Works on Linux with standard installations (/usr/local/bin/gitea-mcp)
- Will work on macOS with Homebrew (/opt/homebrew/bin/gitea-mcp-server)
- Gracefully falls back to hardcoded common paths
- Clear error messages when binary not found

Tested on Linux with gitea-mcp in /usr/local/bin - works perfectly.
2025-11-10 20:37:23 -07:00
..