| 4025 | } |
| 4026 | |
| 4027 | static bool cbm_copilot_add_hook_event(yyjson_mut_doc *doc, yyjson_mut_val *hooks, |
| 4028 | const char *event_key, const char *bash_command, |
| 4029 | const char *powershell_command) { |
| 4030 | yyjson_mut_val *entries = yyjson_mut_arr(doc); |
| 4031 | yyjson_mut_val *entry = yyjson_mut_obj(doc); |
| 4032 | if (!entries || !entry || !yyjson_mut_obj_add_str(doc, entry, "type", "command") || |
| 4033 | !yyjson_mut_obj_add_str(doc, entry, "bash", bash_command) || |
| 4034 | !yyjson_mut_obj_add_str(doc, entry, "powershell", powershell_command) || |
| 4035 | !yyjson_mut_obj_add_int(doc, entry, "timeoutSec", COPILOT_HOOK_TIMEOUT_SEC) || |
| 4036 | !yyjson_mut_arr_append(entries, entry) || |
| 4037 | !yyjson_mut_obj_add_val(doc, hooks, event_key, entries)) { |
| 4038 | return false; |
| 4039 | } |
| 4040 | return true; |
| 4041 | } |
| 4042 | |
| 4043 | static char *cbm_build_copilot_hook_manifest(const char *binary_path) { |
| 4044 | char session_bash[CLI_BUF_8K]; |
no outgoing calls
no test coverage detected