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)
| 242 | /// must be the owner or the declared executor (any agent when no |
| 243 | /// executor is declared). |
| 244 | fn governs(&self, cwd: &Path, agent_name: &str) -> bool { |
| 245 | if self.stop_state.is_some() || !cwd.starts_with(&self.workdir) { |
| 246 | return false; |
| 247 | } |
| 248 | if self.owner_agent == agent_name { |
| 249 | return true; |
| 250 | } |
| 251 | match self.executor_agent.as_deref() { |
| 252 | Some(executor) => executor == agent_name, |
| 253 | None => true, |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | /// Convert to the orchestrator context injected by the hook handler. |
| 258 | pub(super) fn to_managed_run_context(&self) -> ManagedRunContext { |
no outgoing calls