- Add AppStateRest as the central state struct for managing TUI state. - Implement InputState for handling user input, autocomplete, and history. - Create MiscState to manage overlays, notifications, and editor state. - Introduce ScrollState for viewport scrolling functionality. - Develop TranscriptCache for efficient message rendering in the chat pane. - Implement SimpleAgent and SimpleWorkflowEngine for agent lifecycle management. - Add helper functions for managing effort levels and token counting. - Organize state-related modules for better maintainability and clarity.
27 lines
759 B
Rust
27 lines
759 B
Rust
//! Graduated check rules: project-defined patterns that flag matching
|
|
//! file paths or content for review during write/edit operations.
|
|
|
|
/// A project-defined rule that flags a matching file path or content pattern
|
|
/// for review.
|
|
#[derive(Debug, Clone)]
|
|
pub struct GraduatedCheck {
|
|
pub name: String,
|
|
pub pattern: String,
|
|
pub rule: String,
|
|
}
|
|
|
|
/// Check which graduated checks apply to a given file path/content pair.
|
|
pub fn check_graduated_checks(
|
|
path: &str,
|
|
content: &str,
|
|
checks: &[GraduatedCheck],
|
|
) -> Vec<String> {
|
|
let mut matches = Vec::new();
|
|
for check in checks {
|
|
if path.contains(&check.pattern) || content.contains(&check.rule) {
|
|
matches.push(check.name.clone());
|
|
}
|
|
}
|
|
matches
|
|
}
|