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

Function disabled

atomic-agent/src/hooks/live.rs:149–160  ·  view source on GitHub ↗
(entry: &serde_json::Map<String, Value>)

Source from the content-addressed store, hash-verified

147}
148
149fn disabled(entry: &serde_json::Map<String, Value>) -> Result<bool, &'static str> {
150 for flag in [entry.get("disabled"), entry.get("enabled")]
151 .into_iter()
152 .flatten()
153 {
154 if !flag.is_boolean() {
155 return Err("hook enablement flag is not a boolean");
156 }
157 }
158 Ok(entry.get("disabled") == Some(&Value::Bool(true))
159 || entry.get("enabled") == Some(&Value::Bool(false)))
160}
161
162fn is_invocation(command: &str, prefix: &str, agent: &str, event: &str) -> bool {
163 if prefix.is_empty() {

Callers 1

json_hooks_activeFunction · 0.85

Calls 2

getMethod · 0.65
into_iterMethod · 0.45

Tested by

no test coverage detected