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

Function group_has_subcommand

src/agents/codex.rs:1102–1110  ·  view source on GitHub ↗

True when any handler command in `group` contains `subcommand`.

(group: &serde_json::Value, subcommand: &str)

Source from the content-addressed store, hash-verified

1100
1101/// True when any handler command in `group` contains `subcommand`.
1102fn group_has_subcommand(group: &serde_json::Value, subcommand: &str) -> bool {
1103 group["hooks"].as_array().is_some_and(|handlers| {
1104 handlers.iter().any(|h| {
1105 h.get("command")
1106 .and_then(|c| c.as_str())
1107 .is_some_and(|command| command.contains(subcommand))
1108 })
1109 })
1110}
1111
1112/// Codex requires non-managed command hooks to be trusted via `/hooks` before
1113/// they run; newly installed/changed hooks are skipped until trusted.

Callers 2

install_codex_hook_eventFunction · 0.85
uninstall_hooksFunction · 0.85

Calls 2

as_strMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected