pub struct SubdirInstructionTracker { /* private fields */ }Expand description
Tracks which subdirectory instruction files have been injected into the conversation, and discovers new ones when files are read.
Implementations§
Source§impl SubdirInstructionTracker
impl SubdirInstructionTracker
Sourcepub fn new(project_root: PathBuf, startup_files: &[PathBuf]) -> Self
pub fn new(project_root: PathBuf, startup_files: &[PathBuf]) -> Self
Create a new tracker, pre-populating with instruction files already injected at startup (from the system prompt).
Sourcepub fn check_file_read(&mut self, file_path: &Path) -> Vec<SubdirInstruction>
pub fn check_file_read(&mut self, file_path: &Path) -> Vec<SubdirInstruction>
Check if a file path triggers any new subdirectory instruction injection.
Walks from the directory containing file_path up toward the project root,
looking for AGENTS.md / CLAUDE.md files that haven’t been injected yet.
Returns any new instruction files found (and marks them as injected).
Sourcepub fn reset_after_compaction(
&mut self,
startup_files: &[PathBuf],
remaining_messages: &[Value],
)
pub fn reset_after_compaction( &mut self, startup_files: &[PathBuf], remaining_messages: &[Value], )
After compaction removes middle messages, allow subdirectory instructions to be re-discovered on the next file read.
Preserves startup files (root-level instructions in system prompt) and any instructions whose content is still present in the remaining messages.
Sourcepub fn injected_count(&self) -> usize
pub fn injected_count(&self) -> usize
Return the number of instruction files currently tracked.
Trait Implementations§
Source§impl Clone for SubdirInstructionTracker
impl Clone for SubdirInstructionTracker
Source§fn clone(&self) -> SubdirInstructionTracker
fn clone(&self) -> SubdirInstructionTracker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more