-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgmail_humanizer.py
More file actions
55 lines (44 loc) · 1.65 KB
/
gmail_humanizer.py
File metadata and controls
55 lines (44 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
"""PostToolUse hook: remind to run content-humanizer after creating content."""
import json
import sys
DOCX_TRIGGERS = (".docx",)
TOOL_TRIGGERS = {
"mcp__claude_ai_Gmail__gmail_create_draft": "Gmail draft",
"mcp__plugin_telegram_telegram__reply": "Telegram reply",
"mcp__plugin_telegram_telegram__edit_message": "Telegram message",
}
def main():
try:
input_data = json.load(sys.stdin)
except (json.JSONDecodeError, EOFError):
print("{}")
return
tool_name = input_data.get("tool_name", "")
tool_input = input_data.get("tool_input", {})
# Check MCP tool triggers
if tool_name in TOOL_TRIGGERS:
label = TOOL_TRIGGERS[tool_name]
print(json.dumps({
"additionalContext": (
f"📝 {label} created. Auto-humanize before sending: "
"remove AI patterns (delve, crucial, leverage, robust, insofar as, furthermore). "
"Short punchy sentences. Real voice. No em-dash overuse."
)
}))
return
# Check Write tool for .docx files
if tool_name == "Write":
file_path = tool_input.get("file_path", "") or tool_input.get("path", "")
if any(file_path.endswith(ext) for ext in DOCX_TRIGGERS):
print(json.dumps({
"additionalContext": (
"📝 Docx written. Auto-humanize content: "
"remove AI patterns, vary sentence rhythm, keep technical precision. "
"Run /content-humanizer if not already done."
)
}))
return
print("{}")
if __name__ == "__main__":
main()