Skip to main content

aprender_shell/
lib.rs

1//! aprender-shell library
2//!
3//! AI-powered shell completion trained on your history.
4//! This library exposes the core components for benchmarking and testing.
5//!
6//! # Hardening (v0.2.0)
7//!
8//! This version includes hardening per `aprender-shell-harden-plan.md`:
9//! - **Error handling**: `ShellError` type with graceful degradation
10//! - **Input validation**: `sanitize_prefix` for safe input handling
11//! - **Security filtering**: `is_sensitive_command` for credential protection
12
13pub mod config;
14pub mod corpus;
15pub mod error;
16pub mod history;
17pub mod model;
18pub mod paged_model;
19pub mod quality;
20pub mod security;
21pub mod synthetic;
22pub mod trie;
23pub mod validation;
24
25// Re-exports for convenience
26pub use config::{suggest_with_fallback, ShellConfig};
27pub use error::ShellError;
28pub use history::HistoryParser;
29pub use model::MarkovModel;
30pub use paged_model::PagedMarkovModel;
31pub use quality::{
32    apply_typo_corrections, filter_quality_suggestions, suggestion_quality_score,
33    validate_suggestion,
34};
35pub use security::{filter_sensitive_commands, filter_sensitive_suggestions, is_sensitive_command};
36pub use synthetic::SyntheticPipeline;
37pub use validation::{load_model_graceful, sanitize_prefix};
38
39// Corpus management
40pub use corpus::{Corpus, CorpusError, CorpusResult, CorpusStats};