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. */
| 609 | * Gemini, and Qwen document the same hookSpecificOutput dialect for these |
| 610 | * events; adapters with different dialects are kept separate in the installer. */ |
| 611 | static char *ha_build_event_json(const char *event_name, const char *text) { |
| 612 | yyjson_mut_doc *doc = yyjson_mut_doc_new(NULL); |
| 613 | if (!doc) { |
| 614 | return NULL; |
| 615 | } |
| 616 | yyjson_mut_val *root = yyjson_mut_obj(doc); |
| 617 | yyjson_mut_doc_set_root(doc, root); |
| 618 | yyjson_mut_val *hso = yyjson_mut_obj(doc); |
| 619 | yyjson_mut_obj_add_str(doc, hso, "hookEventName", event_name); |
| 620 | yyjson_mut_obj_add_str(doc, hso, "additionalContext", text); |
| 621 | yyjson_mut_obj_add_val(doc, root, "hookSpecificOutput", hso); |
| 622 | |
| 623 | char *json = yyjson_mut_write(doc, 0, NULL); |
| 624 | yyjson_mut_doc_free(doc); |
| 625 | return json; |
| 626 | } |
| 627 | |
| 628 | /* GitHub Copilot CLI lifecycle hooks use a deliberately smaller output |
| 629 | * dialect: additionalContext is a top-level field, with no event envelope. */ |
no outgoing calls
no test coverage detected