| 6385 | }; |
| 6386 | |
| 6387 | int cbm_upsert_gemini_session_hooks(const char *settings_path) { |
| 6388 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
| 6389 | int rc = CLI_OK; |
| 6390 | for (size_t i = 0U; i < sizeof(matchers) / sizeof(matchers[0]); i++) { |
| 6391 | const char *const *old_matchers = i == 0U ? cmm_gemini_session_old_matchers : NULL; |
| 6392 | if (upsert_hooks_json((hooks_upsert_args_t){ |
| 6393 | .settings_path = settings_path, |
| 6394 | .hook_event = "SessionStart", |
| 6395 | .matcher_str = matchers[i], |
| 6396 | .command_str = GEMINI_SESSION_COMMAND, |
| 6397 | .old_matchers = old_matchers, |
| 6398 | .old_commands = cmm_gemini_released_session_commands, |
| 6399 | .timeout_value = GEMINI_HOOK_TIMEOUT_MS, |
| 6400 | .match_command_exact = GEMINI_SESSION_COMMAND, |
| 6401 | }) != CLI_OK) { |
| 6402 | rc = CLI_ERR; |
| 6403 | } |
| 6404 | } |
| 6405 | return rc; |
| 6406 | } |
| 6407 | |
| 6408 | int cbm_remove_gemini_session_hooks(const char *settings_path) { |
| 6409 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
no test coverage detected