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

Function cbm_remove_factory_hooks

src/cli/cli.c:5680–5704  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

remove_hooks_jsonFunction · 0.85

Tested by

no test coverage detected