| 5554 | }; |
| 5555 | |
| 5556 | int cbm_upsert_gemini_session_hooks(const char *settings_path) { |
| 5557 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
| 5558 | int rc = CLI_OK; |
| 5559 | for (size_t i = 0U; i < sizeof(matchers) / sizeof(matchers[0]); i++) { |
| 5560 | const char *const *old_matchers = i == 0U ? cmm_gemini_session_old_matchers : NULL; |
| 5561 | if (upsert_hooks_json((hooks_upsert_args_t){ |
| 5562 | .settings_path = settings_path, |
| 5563 | .hook_event = "SessionStart", |
| 5564 | .matcher_str = matchers[i], |
| 5565 | .command_str = GEMINI_SESSION_COMMAND, |
| 5566 | .old_matchers = old_matchers, |
| 5567 | .old_commands = cmm_gemini_released_session_commands, |
| 5568 | .timeout_value = GEMINI_HOOK_TIMEOUT_MS, |
| 5569 | .match_command_exact = GEMINI_SESSION_COMMAND, |
| 5570 | }) != CLI_OK) { |
| 5571 | rc = CLI_ERR; |
| 5572 | } |
| 5573 | } |
| 5574 | return rc; |
| 5575 | } |
| 5576 | |
| 5577 | int cbm_remove_gemini_session_hooks(const char *settings_path) { |
| 5578 | static const char *const matchers[] = {"startup", "resume", "clear"}; |
no test coverage detected