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

Function guarded_hook_command

atomic-agent/src/hooks/mod.rs:102–107  ·  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

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

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