MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / send

Method send

s15_agent_teams/code.py:607–616  ·  view source on GitHub ↗
(self, from_agent: str, to_agent: str, content: str,
             msg_type: str = "message")

Source from the content-addressed store, hash-verified

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"

Callers 2

runFunction · 0.45
run_send_messageFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected