Cline executable hooks require a non-blocking control envelope even when * they only add context. Keep cancel=false explicit and never emit an error. */
| 734 | /* Cline executable hooks require a non-blocking control envelope even when |
| 735 | * they only add context. Keep cancel=false explicit and never emit an error. */ |
| 736 | static char *ha_build_cline_json(const char *text) { |
| 737 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 738 | if (!doc) { |
| 739 | return NULL; |
| 740 | } |
| 741 | yyjson_mut_val *root = yyjson_mut_obj(doc); |
| 742 | yyjson_mut_doc_set_root(doc, root); |
| 743 | yyjson_mut_obj_add_bool(doc, root, "cancel", false); |
| 744 | yyjson_mut_obj_add_str(doc, root, "contextModification", text); |
| 745 | yyjson_mut_obj_add_str(doc, root, "errorMessage", ""); |
| 746 | char *json = yyjson_mut_write(doc, 0, NULL); |
| 747 | yyjson_mut_doc_free(doc); |
| 748 | return json; |
| 749 | } |
| 750 | |
| 751 | /* True for an absolute path we can walk up: POSIX "/..." or a Windows drive |
| 752 | * root — "X:/..." or a bare "X:" (callers normalize '\\' to '/' first). |
no outgoing calls
no test coverage detected