diff options
Diffstat (limited to 'crates/atuin-client/src/history.rs')
| -rw-r--r-- | crates/atuin-client/src/history.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/crates/atuin-client/src/history.rs b/crates/atuin-client/src/history.rs index 996208d9..16f7d85a 100644 --- a/crates/atuin-client/src/history.rs +++ b/crates/atuin-client/src/history.rs @@ -19,7 +19,7 @@ mod builder; pub mod store; /// Known AI agent author values. Used to expand `$all-agent` and `$all-user` filters. -pub const KNOWN_AGENTS: &[&str] = &["claude-code", "codex", "copilot"]; +pub const KNOWN_AGENTS: &[&str] = &["claude-code", "codex", "copilot", "pi"]; pub const AUTHOR_FILTER_ALL_USER: &str = "$all-user"; pub const AUTHOR_FILTER_ALL_AGENT: &str = "$all-agent"; @@ -540,9 +540,12 @@ mod tests { use regex::RegexSet; use time::macros::datetime; - use crate::{history::HISTORY_VERSION, settings::Settings}; + use crate::{ + history::{AUTHOR_FILTER_ALL_AGENT, AUTHOR_FILTER_ALL_USER, HISTORY_VERSION}, + settings::Settings, + }; - use super::History; + use super::{History, author_matches_filters, is_known_agent}; // Test that we don't save history where necessary #[test] @@ -604,6 +607,19 @@ mod tests { } #[test] + fn known_agents_include_pi() { + assert!(is_known_agent("pi")); + assert!(author_matches_filters( + "pi", + &[AUTHOR_FILTER_ALL_AGENT.to_string()] + )); + assert!(!author_matches_filters( + "pi", + &[AUTHOR_FILTER_ALL_USER.to_string()] + )); + } + + #[test] fn disable_secrets() { let settings = Settings { secrets_filter: false, |
