use super::{Lens, LensContext, LensId, LensOutput};
use forge::budget::estimator::TokenEstimator;
use forge::signal::compactor;
pub struct ClarityLens;
impl Lens for ClarityLens {
fn id(&self) -> LensId {
LensId::Clarity
}
fn apply(&self, input: &str, _ctx: &LensContext) -> LensOutput {
let tokens_before = TokenEstimator::count_nonblocking(input);
let normalised = compactor::normalise(input);
let compacted = compactor::collapse_blanks(&normalised);
let tokens_after = TokenEstimator::count_nonblocking(&compacted);
LensOutput {
content: compacted,
tokens_before,
tokens_after,
applied: vec!["clarity".into()],
}
}
}