12 lines
503 B
Python
12 lines
503 B
Python
#!/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)
|