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

Method send

s16_team_protocols/code.py:345–354  ·  view source on GitHub ↗
(self, from_agent: str, to_agent: str, content: str,
             msg_type: str = "message", metadata: dict = None)

Source from the content-addressed store, hash-verified

343 Teaching version: no file locking; real CC uses proper-lockfile."""
344
345 def send(self, from_agent: str, to_agent: str, content: str,
346 msg_type: str = "message", metadata: dict = None):
347 msg = {"from": from_agent, "to": to_agent,
348 "content": content, "type": msg_type,
349 "ts": time.time(), "metadata": metadata or {}}
350 inbox = MAILBOX_DIR / f"{to_agent}.jsonl"
351 with open(inbox, "a") as f:
352 f.write(json.dumps(msg) + "\n")
353 print(f" \033[33m[bus] {from_agent} → {to_agent}: "
354 f"({msg_type}) {content[:50]}\033[0m")
355
356 def read_inbox(self, agent: str) -> list[dict]:
357 inbox = MAILBOX_DIR / f"{agent}.jsonl"

Callers 7

handle_inbox_messageFunction · 0.45
runFunction · 0.45
_teammate_submit_planFunction · 0.45
run_request_shutdownFunction · 0.45
run_request_planFunction · 0.45
run_review_planFunction · 0.45
run_send_messageFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected