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

Function ha_tool_event_supported

src/cli/hook_augment.c:1018–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1016}
1017
1018static bool ha_tool_event_supported(ha_lifecycle_dialect_t dialect, const char *event,
1019 const char *tool, bool *coverage) {
1020 if (coverage) {
1021 *coverage = false;
1022 }
1023 if (!event || !tool) {
1024 return false;
1025 }
1026 if (dialect == HA_DIALECT_EVENT) {
1027 if (strcmp(event, "PreToolUse") == 0 &&
1028 (strcmp(tool, "Grep") == 0 || strcmp(tool, "Glob") == 0)) {
1029 return true;
1030 }
1031 if (strcmp(event, "PostToolUse") == 0 && strcmp(tool, "Read") == 0) {
1032 if (coverage) {
1033 *coverage = true;
1034 }
1035 return true;
1036 }
1037 return false;
1038 }
1039 bool matches = (dialect == HA_DIALECT_GEMINI && strcmp(event, "AfterTool") == 0 &&
1040 strcmp(tool, "read_file") == 0) ||
1041 (dialect == HA_DIALECT_QWEN && strcmp(event, "PostToolUse") == 0 &&
1042 strcmp(tool, "ReadFile") == 0) ||
1043 (dialect == HA_DIALECT_QODER && strcmp(event, "PostToolUse") == 0 &&
1044 strcmp(tool, "Read") == 0) ||
1045 (dialect == HA_DIALECT_FACTORY && strcmp(event, "PostToolUse") == 0 &&
1046 strcmp(tool, "Read") == 0) ||
1047 (dialect == HA_DIALECT_AUGMENT && strcmp(event, "PostToolUse") == 0 &&
1048 strcmp(tool, "view") == 0);
1049 if (matches && coverage) {
1050 *coverage = true;
1051 }
1052 return matches;
1053}
1054
1055static bool ha_normalized_tool_path(yyjson_val *root, yyjson_val *tool_input, char *path,
1056 size_t path_size) {

Callers 2

ha_processFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected