Whether a hook from `agent_name` running in `cwd` participates in this run: the cwd must be inside the run's workdir, and the agent must be the owner or the declared executor (any agent when no executor is declared).
(&self, cwd: &Path, agent_name: &str)
| 158 | /// must be the owner or the declared executor (any agent when no |
| 159 | /// executor is declared). |
| 160 | fn governs(&self, cwd: &Path, agent_name: &str) -> bool { |
| 161 | if !cwd.starts_with(&self.workdir) { |
| 162 | return false; |
| 163 | } |
| 164 | if self.owner_agent == agent_name { |
| 165 | return true; |
| 166 | } |
| 167 | match self.executor_agent.as_deref() { |
| 168 | Some(executor) => executor == agent_name, |
| 169 | None => true, |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | /// Convert to the orchestrator context injected by the hook handler. |
| 174 | pub(super) fn to_managed_run_context(&self) -> ManagedRunContext { |
no outgoing calls