| 1167 | } |
| 1168 | |
| 1169 | cbm_detected_agents_t cbm_detect_agents(const char *home_dir) { |
| 1170 | cbm_detected_agents_t agents; |
| 1171 | memset(&agents, 0, sizeof(agents)); |
| 1172 | if (!home_dir || !home_dir[0]) { |
| 1173 | return agents; |
| 1174 | } |
| 1175 | |
| 1176 | char path[CLI_BUF_1K]; |
| 1177 | |
| 1178 | cbm_claude_config_dir(home_dir, path, sizeof(path)); |
| 1179 | agents.claude_code = path[0] != '\0' && dir_exists(path); |
| 1180 | |
| 1181 | snprintf(path, sizeof(path), "%s/.codex", home_dir); |
| 1182 | agents.codex = dir_exists(path); |
| 1183 | |
| 1184 | snprintf(path, sizeof(path), "%s/.gemini", home_dir); |
| 1185 | agents.gemini = dir_exists(path); |
| 1186 | |
| 1187 | #ifdef __APPLE__ |
| 1188 | snprintf(path, sizeof(path), "%s/Library/Application Support/Zed", home_dir); |
| 1189 | #elif defined(_WIN32) |
| 1190 | snprintf(path, sizeof(path), "%s/AppData/Local/Zed", home_dir); |
| 1191 | #else |
| 1192 | snprintf(path, sizeof(path), "%s/.config/zed", home_dir); |
| 1193 | #endif |
| 1194 | agents.zed = dir_exists(path); |
| 1195 | |
| 1196 | agents.opencode = cbm_find_cli("opencode", home_dir)[0] != '\0'; |
| 1197 | |
| 1198 | /* Antigravity CLI (2026 unification) installs under ~/.gemini/antigravity-cli/ |
| 1199 | * (brain/, mcp/, settings.json), with MCP config in the shared |
| 1200 | * ~/.gemini/config/mcp_config.json. */ |
| 1201 | snprintf(path, sizeof(path), "%s/.gemini/antigravity-cli", home_dir); |
| 1202 | if (dir_exists(path)) { |
| 1203 | agents.antigravity = true; |
| 1204 | } |
| 1205 | |
| 1206 | agents.aider = cbm_find_cli("aider", home_dir)[0] != '\0'; |
| 1207 | |
| 1208 | #ifdef __APPLE__ |
| 1209 | snprintf(path, sizeof(path), |
| 1210 | "%s/Library/Application Support/Code/User/globalStorage/kilocode.kilo-code", home_dir); |
| 1211 | #elif defined(_WIN32) |
| 1212 | snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User/globalStorage/kilocode.kilo-code", |
| 1213 | home_dir); |
| 1214 | #else |
| 1215 | snprintf(path, sizeof(path), "%s/.config/Code/User/globalStorage/kilocode.kilo-code", home_dir); |
| 1216 | #endif |
| 1217 | agents.kilocode = dir_exists(path); |
| 1218 | |
| 1219 | #ifdef __APPLE__ |
| 1220 | snprintf(path, sizeof(path), "%s/Library/Application Support/Code/User", home_dir); |
| 1221 | #elif defined(_WIN32) |
| 1222 | snprintf(path, sizeof(path), "%s/AppData/Roaming/Code/User", home_dir); |
| 1223 | #else |
| 1224 | snprintf(path, sizeof(path), "%s/.config/Code/User", home_dir); |
| 1225 | #endif |
| 1226 | agents.vscode = dir_exists(path); |
no test coverage detected