| 4155 | } |
| 4156 | |
| 4157 | static bool cbm_copilot_add_hook_event(yyjson_mut_doc *doc, yyjson_mut_val *hooks, |
| 4158 | const char *event_key, const char *bash_command, |
| 4159 | const char *powershell_command) { |
| 4160 | yyjson_mut_val *entries = yyjson_mut_arr(doc); |
| 4161 | yyjson_mut_val *entry = yyjson_mut_obj(doc); |
| 4162 | if (!entries || !entry || !yyjson_mut_obj_add_str(doc, entry, "type", "command") || |
| 4163 | !yyjson_mut_obj_add_str(doc, entry, "bash", bash_command) || |
| 4164 | !yyjson_mut_obj_add_str(doc, entry, "powershell", powershell_command) || |
| 4165 | !yyjson_mut_obj_add_int(doc, entry, "timeoutSec", COPILOT_HOOK_TIMEOUT_SEC) || |
| 4166 | !yyjson_mut_arr_append(entries, entry) || |
| 4167 | !yyjson_mut_obj_add_val(doc, hooks, event_key, entries)) { |
| 4168 | return false; |
| 4169 | } |
| 4170 | return true; |
| 4171 | } |
| 4172 | |
| 4173 | static char *cbm_build_copilot_hook_manifest(const char *binary_path) { |
| 4174 | char session_bash[CLI_BUF_8K]; |
no outgoing calls
no test coverage detected