Skip to main content

Module aggregator

Module aggregator 

Source
Expand description

Aggregates per-model token usage across the file-backed provider session trees.

Each provider directory is walked with the provider fixed by its source path (never re-detected from file contents), parsed in ParseMode::UsageOnly to skip the heavy file-operation payloads, and the small per-model usage maps are merged into a UsageData. The provider is tracked twice on purpose — once merged across providers (the per-model table) and once kept per source directory (the per-provider footer) — see UsageData for why.

Re-exports§

pub use crate::scan::ScanDiagnostics;
pub use crate::scan::ScanFailure;

Structs§

StoredCosts
Provider-authoritative per-model costs, kept separate per provider.
UsageCollection
Usage data paired with source-collection diagnostics.
UsageData
Aggregated token usage plus the per-provider active-day counts.
UsageScanOptions
Optional knobs for a usage scan.

Functions§

aggregate_usage_from_home
Aggregates token usage from all AI provider session directories.
aggregate_usage_from_home_with_diagnostics
Diagnostics-aware usage scan rooted at the current user’s provider paths.
aggregate_usage_from_home_with_diagnostics_opts
aggregate_usage_from_home_with_diagnostics with scan options.
aggregate_usage_from_home_with_providers
aggregate_usage_from_home with explicit per-provider toggles (from ~/.vct/config.toml). A disabled provider is skipped entirely.
aggregate_usage_from_paths
Aggregates token usage from provider session directories rooted at an explicit HelperPaths.
aggregate_usage_from_paths_with_cache
Incremental usage scan backed by a process-local compact summary cache.
aggregate_usage_from_paths_with_cache_opts
aggregate_usage_from_paths_with_cache with scan options.
aggregate_usage_from_paths_with_diagnostics
Diagnostics-aware usage scan rooted at explicit provider paths.
aggregate_usage_from_paths_with_providers
aggregate_usage_from_paths with explicit provider toggles (the injectable core used by the CLI once config.toml is loaded).