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

Method emit

agents/s12_worktree_task_isolation.py:90–106  ·  view source on GitHub ↗
(
        self,
        event: str,
        task: dict | None = None,
        worktree: dict | None = None,
        error: str | None = None,
    )

Source from the content-addressed store, hash-verified

88 self.path.write_text("")
89
90 def emit(
91 self,
92 event: str,
93 task: dict | None = None,
94 worktree: dict | None = None,
95 error: str | None = None,
96 ):
97 payload = {
98 "event": event,
99 "ts": time.time(),
100 "task": task or {},
101 "worktree": worktree or {},
102 }
103 if error:
104 payload["error"] = error
105 with self.path.open("a", encoding="utf-8") as f:
106 f.write(json.dumps(payload) + "\n")
107
108 def list_recent(self, limit: int = 20) -> str:
109 n = max(1, min(int(limit or 20), 200))

Callers 3

createMethod · 0.80
removeMethod · 0.80
keepMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected