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

Method send

s19_mcp_plugin/code.py:320–329  ·  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

318
319class MessageBus:
320 def send(self, from_agent: str, to_agent: str, content: str,
321 msg_type: str = "message", metadata: dict = None):
322 msg = {"from": from_agent, "to": to_agent,
323 "content": content, "type": msg_type,
324 "ts": time.time(), "metadata": metadata or {}}
325 inbox = MAILBOX_DIR / f"{to_agent}.jsonl"
326 with open(inbox, "a") as f:
327 f.write(json.dumps(msg) + "\n")
328 print(f" \033[33m[bus] {from_agent} → {to_agent}: "
329 f"({msg_type}) {content[:50]}\033[0m")
330
331 def read_inbox(self, agent: str) -> list[dict]:
332 inbox = MAILBOX_DIR / f"{agent}.jsonl"

Callers 8

idle_pollFunction · 0.45
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