1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! Pattern matching infrastructure for identifying tools in Bash commands
//!
//! This module provides efficient pattern matching using Aho-Corasick automaton
//! to identify which tools (npm, cargo, git, wrangler, etc.) are being used in
//! Bash command invocations from Claude session logs.
//!
//! ## Architecture
//!
//! - `matcher`: Core pattern matching trait and Aho-Corasick implementation
//! - `loader`: TOML-based pattern configuration loading
//! - `knowledge_graph`: Advanced pattern learning with voting and confidence scoring (includes caching)
//!
//! ## Example
//!
//! ```rust
//! use terraphim_session_analyzer::patterns::{create_matcher, load_patterns};
//!
//! # fn main() -> anyhow::Result<()> {
//! // Load patterns from built-in TOML
//! let patterns = load_patterns()?;
//!
//! // Create matcher
//! let mut matcher = create_matcher();
//! matcher.initialize(&patterns)?;
//!
//! // Find matches
//! let matches = matcher.find_matches("npx wrangler deploy --env production");
//! for m in matches {
//! println!("Found tool: {} at position {}", m.tool_name, m.start);
//! }
//! # Ok(())
//! # }
//! ```
// Re-export main types
pub use load_all_patterns;
// Used in doc examples
pub use ;
// Available for user configuration
pub use ;
pub use ;
// Used in doc examples
pub use ;
// Re-export knowledge graph types for Phase 3 - pattern learning and caching
// Public API for pattern learning (Phase 3)
pub use ;
// Re-export terraphim feature types
// Public API for terraphim integration (future use)
pub use ;