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

Function cbm_remove_factory_hooks

src/cli/cli.c:6435–6459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6433}
6434
6435static int cbm_remove_factory_hooks(const char *settings_path, const char *binary_path) {
6436 char command[CLI_BUF_8K];
6437 char released_command[CLI_BUF_8K];
6438 if (cbm_build_augment_dialect_command(binary_path, "factory", command, sizeof(command)) !=
6439 CLI_OK ||
6440 cbm_build_augment_command(binary_path, released_command, sizeof(released_command)) !=
6441 CLI_OK) {
6442 return CLI_ERR;
6443 }
6444 const char *const old_commands[] = {released_command, NULL};
6445 int session_result = remove_hooks_json((hooks_remove_args_t){
6446 .settings_path = settings_path,
6447 .hook_event = "SessionStart",
6448 .matcher_str = NULL,
6449 .old_commands = old_commands,
6450 .match_command_exact = command,
6451 });
6452 int read_result = remove_hooks_json((hooks_remove_args_t){
6453 .settings_path = settings_path,
6454 .hook_event = "PostToolUse",
6455 .matcher_str = "Read",
6456 .match_command_exact = command,
6457 });
6458 return session_result == CLI_OK && read_result == CLI_OK ? CLI_OK : CLI_ERR;
6459}
6460
6461enum { AUGMENT_HOOK_TIMEOUT_MS = 5000 };
6462

Callers 1

Calls 3

remove_hooks_jsonFunction · 0.85

Tested by

no test coverage detected