(self, from_agent: str, to_agent: str, content: str,
msg_type: str = "message")
| 605 | Teaching version: no file locking; real CC uses proper-lockfile.""" |
| 606 | |
| 607 | def send(self, from_agent: str, to_agent: str, content: str, |
| 608 | msg_type: str = "message"): |
| 609 | msg = {"from": from_agent, "to": to_agent, |
| 610 | "content": content, "type": msg_type, |
| 611 | "ts": time.time()} |
| 612 | inbox = MAILBOX_DIR / f"{to_agent}.jsonl" |
| 613 | with open(inbox, "a") as f: |
| 614 | f.write(json.dumps(msg) + "\n") |
| 615 | print(f" \033[33m[bus] {from_agent} → {to_agent}: " |
| 616 | f"{content[:50]}\033[0m") |
| 617 | |
| 618 | def read_inbox(self, agent: str) -> list[dict]: |
| 619 | inbox = MAILBOX_DIR / f"{agent}.jsonl" |
no outgoing calls
no test coverage detected