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

Function guarded_hook_command

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

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

Callers 5

install_toMethod · 0.85
install_hooks_atFunction · 0.85
install_hooks_intoFunction · 0.85

Calls

no outgoing calls