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

Function add_hook

atomic-agent/src/hooks/codex.rs:408–425  ·  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

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