MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / globally_disabled

Function globally_disabled

atomic-agent/src/hooks/live.rs:138–147  ·  view source on GitHub ↗

Whether this settings object disables all hooks at its scope.

(agent: &str, root: &serde_json::Map<String, Value>)

Source from the content-addressed store, hash-verified

136
137/// Whether this settings object disables all hooks at its scope.
138pub fn globally_disabled(agent: &str, root: &serde_json::Map<String, Value>) -> bool {
139 match agent {
140 "claude-code" => root.get("disableAllHooks") == Some(&Value::Bool(true)),
141 "gemini-cli" => {
142 root.get("hooksConfig").and_then(|v| v.get("enabled")) == Some(&Value::Bool(false))
143 || root.get("tools").and_then(|v| v.get("enableHooks")) == Some(&Value::Bool(false))
144 }
145 _ => false,
146 }
147}
148
149fn disabled(entry: &serde_json::Map<String, Value>) -> Result<bool, &'static str> {
150 for flag in [entry.get("disabled"), entry.get("enabled")]

Callers 2

settings_hooksFunction · 0.85
json_hooks_activeFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected