| 5718 | }; |
| 5719 | |
| 5720 | int cbm_upsert_gemini_session_hooks(const char *settings_path) { |
| 5721 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
| 5722 | int rc = CLI_OK; |
| 5723 | for (size_t i = 0U; i < sizeof(matchers) / sizeof(matchers[0]); i++) { |
| 5724 | const char *const *old_matchers = i == 0U ? cmm_gemini_session_old_matchers : NULL; |
| 5725 | if (upsert_hooks_json((hooks_upsert_args_t){ |
| 5726 | .settings_path = settings_path, |
| 5727 | .hook_event = "SessionStart", |
| 5728 | .matcher_str = matchers[i], |
| 5729 | .command_str = GEMINI_SESSION_COMMAND, |
| 5730 | .old_matchers = old_matchers, |
| 5731 | .old_commands = cmm_gemini_released_session_commands, |
| 5732 | .timeout_value = GEMINI_HOOK_TIMEOUT_MS, |
| 5733 | .match_command_exact = GEMINI_SESSION_COMMAND, |
| 5734 | }) != CLI_OK) { |
| 5735 | rc = CLI_ERR; |
| 5736 | } |
| 5737 | } |
| 5738 | return rc; |
| 5739 | } |
| 5740 | |
| 5741 | int cbm_remove_gemini_session_hooks(const char *settings_path) { |
| 5742 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
no test coverage detected