Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/hookify/core/rule_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ def _extract_field(self, field: str, tool_name: str,
if field == 'command':
return tool_input.get('command', '')

elif tool_name in ['Write', 'Edit']:
elif tool_name in ['Write', 'Edit', 'Update']:
if field == 'content':
# Write uses 'content', Edit has 'new_string'
return tool_input.get('content') or tool_input.get('new_string', '')
elif field == 'new_text' or field == 'new_string':
return tool_input.get('new_string', '')
return tool_input.get('new_string') or tool_input.get('content', '')
elif field == 'old_text' or field == 'old_string':
return tool_input.get('old_string', '')
elif field == 'file_path':
Expand Down
2 changes: 1 addition & 1 deletion plugins/hookify/hooks/posttooluse.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def main():
event = None
if tool_name == 'Bash':
event = 'bash'
elif tool_name in ['Edit', 'Write', 'MultiEdit']:
elif tool_name in ['Edit', 'Write', 'MultiEdit', 'Update']:
event = 'file'

# Load rules
Expand Down
2 changes: 1 addition & 1 deletion plugins/hookify/hooks/pretooluse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def main():
event = None
if tool_name == 'Bash':
event = 'bash'
elif tool_name in ['Edit', 'Write', 'MultiEdit']:
elif tool_name in ['Edit', 'Write', 'MultiEdit', 'Update']:
event = 'file'

# Load rules
Expand Down