import { existsSync } from 'node:fs';
import { execSync } from 'node:child_process';
import { TOOLS } from './tools.js';
import { expandHome } from './paths.js';
function which(cmd) {
    try {
        execSync(`command -v ${cmd}`, { stdio: 'ignore' });
        return true;
    }
    catch {
        return false;
    }
}
export function detectAll() {
    return Object.keys(TOOLS).map((id) => {
        const meta = TOOLS[id];
        return {
            tool: id,
            cliInstalled: which(id === 'claude-code' ? 'claude' : id),
            configExists: existsSync(expandHome(meta.configDir)),
        };
    });
}
//# sourceMappingURL=detect.js.map