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

Function cbm_remove_qoder_context_hook

src/cli/cli.c:4279–4313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4277}
4278
4279static int cbm_remove_qoder_context_hook(const char *settings_path, const char *binary_path) {
4280 char command[CLI_BUF_8K];
4281 char shell[CLI_BUF_32];
4282 if (cbm_build_qoder_hook_command(binary_path, cbm_current_platform_is_windows(), command,
4283 sizeof(command), shell, sizeof(shell)) != CLI_OK) {
4284 return CLI_ERR;
4285 }
4286 int legacy_result = remove_hooks_json((hooks_remove_args_t){
4287 .settings_path = settings_path,
4288 .hook_event = "UserPromptSubmit",
4289 .match_command_exact = command,
4290 });
4291 int session_result = remove_hooks_json((hooks_remove_args_t){
4292 .settings_path = settings_path,
4293 .hook_event = "SessionStart",
4294 .matcher_str = "startup|resume|clear|compact|new",
4295 .match_command_exact = command,
4296 });
4297 int subagent_result = remove_hooks_json((hooks_remove_args_t){
4298 .settings_path = settings_path,
4299 .hook_event = "SubagentStart",
4300 .matcher_str = "*",
4301 .match_command_exact = command,
4302 });
4303 int read_result = remove_hooks_json((hooks_remove_args_t){
4304 .settings_path = settings_path,
4305 .hook_event = "PostToolUse",
4306 .matcher_str = "Read",
4307 .match_command_exact = command,
4308 });
4309 return legacy_result == CLI_OK && session_result == CLI_OK && subagent_result == CLI_OK &&
4310 read_result == CLI_OK
4311 ? CLI_OK
4312 : CLI_ERR;
4313}
4314
4315#ifdef CBM_CLI_ENABLE_TEST_API
4316int cbm_upsert_qoder_context_hooks_for_testing(const char *settings_path, const char *binary_path) {

Calls 3

remove_hooks_jsonFunction · 0.85

Tested by

no test coverage detected