"""Tool implementations. They do exactly what they are told: the control lives in gate.py, not here.""" import os, json ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "notes")) OUTBOX = os.path.join(os.path.dirname(__file__), "outbox.jsonl") def read_note(path: str) -> str: with open(os.path.join(ROOT, path)) as f: return f.read() def send_email(to: str, subject: str, body: str) -> str: with open(OUTBOX, "a") as f: f.write(json.dumps({"to": to, "subject": subject, "body": body}) + "\n") return f"queued to {to}" def delete_note(path: str) -> str: # exists in the codebase, is NOT in the registry os.remove(os.path.join(ROOT, path)); return "deleted" IMPLS = {"read_note": read_note, "send_email": send_email, "delete_note": delete_note}