From 129ad222d2ea2896a06ed29cbce5faa0b0d7399e Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Mon, 13 Apr 2026 20:41:30 +0100 Subject: feat: add pi hook installer (#3398) Support installing the pi extension via `atuin hook install pi`. Bundle the extension in the binary and update the docs. ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing --- crates/atuin-client/src/history.rs | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'crates/atuin-client/src') 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] @@ -603,6 +606,19 @@ mod tests { assert!(!with_psql.should_save(&settings)); } + #[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 { -- cgit v1.3.1