MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / codex_hook_present

Function codex_hook_present

src/agents/codex.rs:1487–1499  ·  view source on GitHub ↗
(hooks: &serde_json::Value, event: &str, command: &str)

Source from the content-addressed store, hash-verified

1485}
1486
1487fn codex_hook_present(hooks: &serde_json::Value, event: &str, command: &str) -> bool {
1488 hooks["hooks"][event].as_array().is_some_and(|groups| {
1489 groups.iter().any(|group| {
1490 group["hooks"].as_array().is_some_and(|handlers| {
1491 handlers.iter().any(|h| {
1492 h["command"]
1493 .as_str()
1494 .is_some_and(|value| value.contains(command))
1495 })
1496 })
1497 })
1498 })
1499}
1500#[cfg(test)]
1501#[allow(clippy::unwrap_used, clippy::expect_used)]
1502mod tests;

Callers 1

doctor_check_hooksFunction · 0.85

Calls 2

as_strMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected