MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / ha_build_cline_json

Function ha_build_cline_json

src/cli/hook_augment.c:736–749  ·  view source on GitHub ↗

Cline executable hooks require a non-blocking control envelope even when * they only add context. Keep cancel=false explicit and never emit an error. */

Source from the content-addressed store, hash-verified

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. */
736static 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).

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected