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:656–676  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656bool cbm_agent_client_detect(cbm_agent_client_id_t id,
657 const cbm_agent_client_resolve_options_t *options) {
658 const cbm_agent_client_profile_t *profile = cbm_agent_client_by_id(id);
659 if (!profile || !options) {
660 return false;
661 }
662 char path[1024];
663 int resolved = cbm_agent_client_resolve_path(id, options, path, sizeof(path));
664 if (id == CBM_AGENT_CLIENT_CONTINUE || id == CBM_AGENT_CLIENT_TRAE ||
665 id == CBM_AGENT_CLIENT_ROO_CODE || id == CBM_AGENT_CLIENT_SOURCEGRAPH_CODY) {
666 return resolved == 0 && agent_path_exists(options, path);
667 }
668 if (id == CBM_AGENT_CLIENT_VISUAL_STUDIO) {
669 return options->is_windows && agent_command_exists(options, profile->detection_command);
670 }
671 char marker_path[1024];
672 int marker_resolved = agent_client_marker_path(id, options, marker_path, sizeof(marker_path));
673 return (marker_resolved == 0 && agent_path_exists(options, marker_path)) ||
674 (resolved == 0 && agent_path_exists(options, path)) ||
675 agent_command_exists(options, profile->detection_command);
676}
677
678bool cbm_agent_client_cleanup_candidate(cbm_agent_client_id_t id,
679 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