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

Function add_hook

atomic-agent/src/hooks/codex.rs:412–429  ·  view source on GitHub ↗
(
    hooks: &mut Map<String, Value>,
    event: &str,
    command: &str,
    status_message: Option<&str>,
)

Source from the content-addressed store, hash-verified

410}
411
412fn add_hook(
413 hooks: &mut Map<String, Value>,
414 event: &str,
415 command: &str,
416 status_message: Option<&str>,
417) -> bool {
418 let groups = hooks
419 .entry(event.to_string())
420 .or_insert_with(|| Value::Array(Vec::new()));
421 let Some(groups) = groups.as_array_mut() else {
422 *groups = Value::Array(Vec::new());
423 let Some(groups) = hooks.get_mut(event).and_then(Value::as_array_mut) else {
424 return false;
425 };
426 return add_hook_to_groups(groups, command, status_message);
427 };
428 add_hook_to_groups(groups, command, status_message)
429}
430
431fn add_hook_to_groups(
432 groups: &mut Vec<Value>,

Callers 1

install_hooks_atFunction · 0.85

Calls 2

add_hook_to_groupsFunction · 0.85
get_mutMethod · 0.80

Tested by

no test coverage detected