Build one Claude-compatible lifecycle/tool additionalContext payload. Codex, * Gemini, and Qwen document the same hookSpecificOutput dialect for these * events; adapters with different dialects are kept separate in the installer. */
| 686 | * Gemini, and Qwen document the same hookSpecificOutput dialect for these |
| 687 | * events; adapters with different dialects are kept separate in the installer. */ |
| 688 | static char *ha_build_event_json(const char *event_name, const char *text) { |
| 689 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 690 | if (!doc) { |
| 691 | return NULL; |
| 692 | } |
| 693 | yyjson_mut_val *root = yyjson_mut_obj(doc); |
| 694 | yyjson_mut_doc_set_root(doc, root); |
| 695 | yyjson_mut_val *hso = yyjson_mut_obj(doc); |
| 696 | yyjson_mut_obj_add_str(doc, hso, "hookEventName", event_name); |
| 697 | yyjson_mut_obj_add_str(doc, hso, "additionalContext", text); |
| 698 | yyjson_mut_obj_add_val(doc, root, "hookSpecificOutput", hso); |
| 699 | |
| 700 | char *json = yyjson_mut_write(doc, 0, NULL); |
| 701 | yyjson_mut_doc_free(doc); |
| 702 | return json; |
| 703 | } |
| 704 | |
| 705 | /* GitHub Copilot CLI lifecycle hooks use a deliberately smaller output |
| 706 | * dialect: additionalContext is a top-level field, with no event envelope. */ |
no outgoing calls
no test coverage detected