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

Function cbm_remove_factory_hooks

src/cli/cli.c:5674–5698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5672}
5673
5674static int cbm_remove_factory_hooks(const char *settings_path, const char *binary_path) {
5675 char command[CLI_BUF_8K];
5676 char released_command[CLI_BUF_8K];
5677 if (cbm_build_augment_dialect_command(binary_path, "factory", command, sizeof(command)) !=
5678 CLI_OK ||
5679 cbm_build_augment_command(binary_path, released_command, sizeof(released_command)) !=
5680 CLI_OK) {
5681 return CLI_ERR;
5682 }
5683 const char *const old_commands[] = {released_command, NULL};
5684 int session_result = remove_hooks_json((hooks_remove_args_t){
5685 .settings_path = settings_path,
5686 .hook_event = "SessionStart",
5687 .matcher_str = NULL,
5688 .old_commands = old_commands,
5689 .match_command_exact = command,
5690 });
5691 int read_result = remove_hooks_json((hooks_remove_args_t){
5692 .settings_path = settings_path,
5693 .hook_event = "PostToolUse",
5694 .matcher_str = "Read",
5695 .match_command_exact = command,
5696 });
5697 return session_result == CLI_OK && read_result == CLI_OK ? CLI_OK : CLI_ERR;
5698}
5699
5700enum { AUGMENT_HOOK_TIMEOUT_MS = 5000 };
5701

Callers 1

Calls 3

remove_hooks_jsonFunction · 0.85

Tested by

no test coverage detected