magi-code 0.102.0

Repository-aware CLI coding agent for terminal work
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::cell::Cell;

thread_local! {
    static PROJECT_ENTRY_COUNT: Cell<usize> = const { Cell::new(0) };
}

pub(super) fn record_projected_entry() {
    PROJECT_ENTRY_COUNT.with(|count| count.set(count.get().saturating_add(1)));
}

pub(crate) fn reset_project_entry_count_for_profiling() {
    PROJECT_ENTRY_COUNT.with(|count| count.set(0));
}

pub(crate) fn project_entry_count_for_profiling() -> usize {
    PROJECT_ENTRY_COUNT.with(Cell::get)
}