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

Function cbm_upsert_session_hooks

src/cli/cli.c:2143–2157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2141}
2142
2143static int cbm_upsert_session_hooks(const char *settings_path) {
2144 static const char *matchers[] = {"startup", "resume", "clear", "compact"};
2145 char command[CLI_BUF_1K];
2146 cbm_resolve_hook_command(CMM_SESSION_REMINDER_SCRIPT, command, sizeof(command));
2147 int rc = 0;
2148 for (int i = 0; i < NUM_DIRS; i++) {
2149 if (upsert_hooks_json((hooks_upsert_args_t){.settings_path = settings_path,
2150 .hook_event = "SessionStart",
2151 .matcher_str = matchers[i],
2152 .command_str = command}) != 0) {
2153 rc = CLI_ERR;
2154 }
2155 }
2156 return rc;
2157}
2158
2159static int cbm_remove_session_hooks(const char *settings_path) {
2160 static const char *matchers[] = {"startup", "resume", "clear", "compact"};

Callers 1

Calls 2

cbm_resolve_hook_commandFunction · 0.85
upsert_hooks_jsonFunction · 0.85

Tested by

no test coverage detected