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

Function guarded_hook_command

atomic-agent/src/hooks/mod.rs:101–106  ·  view source on GitHub ↗

Wrap an `atomic agent hooks …` invocation in the shell guard that installed hooks run behind. The hook must only fire where Atomic's graph is reachable, but it must fire in **both** kinds of working tree: a canonical checkout, which has a `.atomic/` directory; and an agent sandbox, which has **no** `.atomic/` of its own — only a `.atomic-sandbox` pointer file to the canonical graph. Guarding on

(inner: &str)

Source from the content-addressed store, hash-verified

99/// recorder runs when either marker is present, and a recorder failure is
100/// swallowed so the agent turn is never blocked.
101pub(crate) fn guarded_hook_command(inner: &str) -> String {
102 format!(
103 "test -d .atomic || test -f {pointer} && {inner} || true",
104 pointer = atomic_repository::SANDBOX_POINTER,
105 )
106}
107
108// AgentHook Trait
109

Callers 3

install_toMethod · 0.85
install_hooks_atFunction · 0.85
install_hooks_intoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected