use std::cell::RefCell;
use super::model::CapabilitiesFile;
thread_local! {
static LLM_CAPABILITY_OVERRIDES_CONTEXT: RefCell<Option<CapabilitiesFile>> = const { RefCell::new(None) };
}
pub(super) fn current_user_overrides() -> Option<CapabilitiesFile> {
LLM_CAPABILITY_OVERRIDES_CONTEXT.with(|cell| cell.borrow().clone())
}
pub(super) fn set_user_overrides(file: Option<CapabilitiesFile>) {
LLM_CAPABILITY_OVERRIDES_CONTEXT.with(|cell| *cell.borrow_mut() = file);
}
pub(crate) fn swap_user_overrides(next: Option<CapabilitiesFile>) -> Option<CapabilitiesFile> {
LLM_CAPABILITY_OVERRIDES_CONTEXT.with(|cell| std::mem::replace(&mut *cell.borrow_mut(), next))
}