| 3710 | } |
| 3711 | |
| 3712 | static bool cbm_copilot_add_hook_event(yyjson_mut_doc *doc, yyjson_mut_val *hooks, |
| 3713 | const char *event_key, const char *bash_command, |
| 3714 | const char *powershell_command) { |
| 3715 | yyjson_mut_val *entries = yyjson_mut_arr(doc); |
| 3716 | yyjson_mut_val *entry = yyjson_mut_obj(doc); |
| 3717 | if (!entries || !entry || !yyjson_mut_obj_add_str(doc, entry, "type", "command") || |
| 3718 | !yyjson_mut_obj_add_str(doc, entry, "bash", bash_command) || |
| 3719 | !yyjson_mut_obj_add_str(doc, entry, "powershell", powershell_command) || |
| 3720 | !yyjson_mut_obj_add_int(doc, entry, "timeoutSec", COPILOT_HOOK_TIMEOUT_SEC) || |
| 3721 | !yyjson_mut_arr_append(entries, entry) || |
| 3722 | !yyjson_mut_obj_add_val(doc, hooks, event_key, entries)) { |
| 3723 | return false; |
| 3724 | } |
| 3725 | return true; |
| 3726 | } |
| 3727 | |
| 3728 | static char *cbm_build_copilot_hook_manifest(const char *binary_path) { |
| 3729 | char session_bash[CLI_BUF_8K]; |
no outgoing calls
no test coverage detected