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

Function receipt_codex_hook_targets

atomic-cli/src/commands/agent/enable.rs:139–155  ·  view source on GitHub ↗

Return the hook files managed by a Codex integration receipt. Current receipts record the exact manifest target. The global default is retained for older receipts that predate the `settings` field.

(receipt: &Receipt)

Source from the content-addressed store, hash-verified

137/// Current receipts record the exact manifest target. The global default is
138/// retained for older receipts that predate the `settings` field.
139fn receipt_codex_hook_targets(receipt: &Receipt) -> Vec<PathBuf> {
140 let mut targets = Vec::new();
141 for settings in &receipt.settings {
142 if settings.command_prefix.contains("atomic agent hooks codex")
143 && !targets.contains(&settings.target)
144 {
145 targets.push(settings.target.clone());
146 }
147 }
148
149 if targets.is_empty() {
150 if let Some(path) = CodexHook::global_hooks_path() {
151 targets.push(path);
152 }
153 }
154 targets
155}
156
157/// Migrate stale Codex hooks in the settings files owned by an integration
158/// receipt. `None` means every receipt-managed target was already current.

Callers 1

Calls 4

containsMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected