claude_cli guard: extensions-only, bridge test against real hx (closes #17)
This commit is contained in:
1 parent
a76c0ac16f
commit
28ad9934e5
5 files changed
+96
-25
No files matched your search
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Extension that starts fine (handshake, subscribes to tool_call) and then dies on the first event: a guard that
|
||||
crashes mid-run. hx treats this as "continue"; permissions = "extensions-only" must turn it into a deny."""
|
||||
import json, sys
|
||||
|
||||
for line in sys.stdin:
|
||||
m = json.loads(line)
|
||||
if m["method"] == "initialize":
|
||||
print(json.dumps({"jsonrpc": "2.0", "id": m["id"], "result": {"subscribe": ["tool_call"], "tools": []}}), flush=True)
|
||||
else:
|
||||
sys.exit(1)
|
||||
Reference in new issue
Block a user