| 5222 | } |
| 5223 | |
| 5224 | static int cbm_upsert_hermes_context_hook(const char *config_path, const char *binary_path) { |
| 5225 | static const char *const sequence_path[] = {"hooks", "pre_llm_call"}; |
| 5226 | static const char identity[] = "\"" CMM_HERMES_HOOK_ID "\""; |
| 5227 | char item[CLI_BUF_8K]; |
| 5228 | if (cbm_build_hermes_context_hook_item(binary_path, item, sizeof(item)) != CLI_OK) { |
| 5229 | return CBM_YAML_IDENTITY_EDIT_ERROR; |
| 5230 | } |
| 5231 | return cbm_yaml_upsert_mapping_sequence_item(config_path, sequence_path, |
| 5232 | sizeof(sequence_path) / sizeof(sequence_path[0]), |
| 5233 | "id", identity, item); |
| 5234 | } |
| 5235 | |
| 5236 | static bool cbm_yaml_line_is_empty_key(const char *line, size_t line_len, size_t indent, |
| 5237 | const char *key) { |
no test coverage detected