|
1 | 1 | use anyhow::Result; |
2 | 2 | use crate::tracking::Tracker; |
3 | 3 |
|
4 | | -pub fn run(graph: bool, history: bool, verbose: u8) -> Result<()> { |
| 4 | +pub fn run(graph: bool, history: bool, quota: bool, tier: &str, _verbose: u8) -> Result<()> { |
5 | 5 | let tracker = Tracker::new()?; |
6 | 6 | let summary = tracker.get_summary()?; |
7 | 7 |
|
@@ -68,6 +68,29 @@ pub fn run(graph: bool, history: bool, verbose: u8) -> Result<()> { |
68 | 68 | } |
69 | 69 | } |
70 | 70 |
|
| 71 | + if quota { |
| 72 | + const ESTIMATED_PRO_MONTHLY: usize = 6_000_000; // ~6M tokens/month (heuristic: ~44K/5h × 6 periods/day × 30 days) |
| 73 | + |
| 74 | + let (quota_tokens, tier_name) = match tier { |
| 75 | + "pro" => (ESTIMATED_PRO_MONTHLY, "Pro ($20/mo)"), |
| 76 | + "5x" => (ESTIMATED_PRO_MONTHLY * 5, "Max 5x ($100/mo)"), |
| 77 | + "20x" => (ESTIMATED_PRO_MONTHLY * 20, "Max 20x ($200/mo)"), |
| 78 | + _ => (ESTIMATED_PRO_MONTHLY, "Pro ($20/mo)"), // default fallback |
| 79 | + }; |
| 80 | + |
| 81 | + let quota_pct = (summary.total_saved as f64 / quota_tokens as f64) * 100.0; |
| 82 | + |
| 83 | + println!("Monthly Quota Analysis:"); |
| 84 | + println!("────────────────────────────────────────"); |
| 85 | + println!("Subscription tier: {}", tier_name); |
| 86 | + println!("Estimated monthly quota: {}", format_tokens(quota_tokens)); |
| 87 | + println!("Tokens saved (lifetime): {}", format_tokens(summary.total_saved)); |
| 88 | + println!("Quota preserved: {:.1}%", quota_pct); |
| 89 | + println!(); |
| 90 | + println!("Note: Heuristic estimate based on ~44K tokens/5h (Pro baseline)"); |
| 91 | + println!(" Actual limits use rolling 5-hour windows, not monthly caps."); |
| 92 | + } |
| 93 | + |
71 | 94 | Ok(()) |
72 | 95 | } |
73 | 96 |
|
|
0 commit comments