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

Function cbm_remove_factory_hooks

src/cli/cli.c:5900–5924  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5898}
5899
5900static int cbm_remove_factory_hooks(const char *settings_path, const char *binary_path) {
5901 char command[CLI_BUF_8K];
5902 char released_command[CLI_BUF_8K];
5903 if (cbm_build_augment_dialect_command(binary_path, "factory", command, sizeof(command)) !=
5904 CLI_OK ||
5905 cbm_build_augment_command(binary_path, released_command, sizeof(released_command)) !=
5906 CLI_OK) {
5907 return CLI_ERR;
5908 }
5909 const char *const old_commands[] = {released_command, NULL};
5910 int session_result = remove_hooks_json((hooks_remove_args_t){
5911 .settings_path = settings_path,
5912 .hook_event = "SessionStart",
5913 .matcher_str = NULL,
5914 .old_commands = old_commands,
5915 .match_command_exact = command,
5916 });
5917 int read_result = remove_hooks_json((hooks_remove_args_t){
5918 .settings_path = settings_path,
5919 .hook_event = "PostToolUse",
5920 .matcher_str = "Read",
5921 .match_command_exact = command,
5922 });
5923 return session_result == CLI_OK && read_result == CLI_OK ? CLI_OK : CLI_ERR;
5924}
5925
5926enum { AUGMENT_HOOK_TIMEOUT_MS = 5000 };
5927

Callers 1

Calls 3

remove_hooks_jsonFunction · 0.85

Tested by

no test coverage detected