MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_agent_client_detect

Function cbm_agent_client_detect

src/cli/agent_clients.c:671–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669}
670
671bool cbm_agent_client_detect(cbm_agent_client_id_t id,
672 const cbm_agent_client_resolve_options_t *options) {
673 const cbm_agent_client_profile_t *profile = cbm_agent_client_by_id(id);
674 if (!profile || !options) {
675 return false;
676 }
677 char path[1024];
678 int resolved = cbm_agent_client_resolve_path(id, options, path, sizeof(path));
679 if (id == CBM_AGENT_CLIENT_CONTINUE || id == CBM_AGENT_CLIENT_TRAE ||
680 id == CBM_AGENT_CLIENT_ROO_CODE || id == CBM_AGENT_CLIENT_SOURCEGRAPH_CODY) {
681 return resolved == 0 && agent_path_exists(options, path);
682 }
683 if (id == CBM_AGENT_CLIENT_VISUAL_STUDIO) {
684 return options->is_windows && agent_command_exists(options, profile->detection_command);
685 }
686 char marker_path[1024];
687 int marker_resolved = agent_client_marker_path(id, options, marker_path, sizeof(marker_path));
688 return (marker_resolved == 0 && agent_path_exists(options, marker_path)) ||
689 (resolved == 0 && agent_path_exists(options, path)) ||
690 agent_command_exists(options, profile->detection_command);
691}
692
693bool cbm_agent_client_cleanup_candidate(cbm_agent_client_id_t id,
694 const cbm_agent_client_resolve_options_t *options) {

Calls 5

cbm_agent_client_by_idFunction · 0.85
agent_client_marker_pathFunction · 0.85
agent_path_existsFunction · 0.70
agent_command_existsFunction · 0.70

Tested by

no test coverage detected