TUI: permission prompt, /diff review, /stats dashboard, lens/context/MCP side panel
This commit is contained in:
1 parent
4a8e920ab8
commit
5fd7044a2f
15 files changed
+945
-2
No files matched your search
@@ -42,6 +42,31 @@ pub fn sub_report(session_path: &std::path::Path) -> String {
|
||||
)
|
||||
}
|
||||
|
||||
/// Numbers behind the `/stats` dashboard.
|
||||
#[derive(Debug, Default, PartialEq)]
|
||||
pub struct Summary {
|
||||
pub fresh: u64,
|
||||
pub cache_read: u64,
|
||||
pub cache_write: u64,
|
||||
pub output: u64,
|
||||
/// per request: (total input, output, cache hit %)
|
||||
pub reqs: Vec<(u64, u64, u64)>,
|
||||
}
|
||||
|
||||
pub fn summary(s: &Session) -> Summary {
|
||||
let mut o = Summary::default();
|
||||
for (_, u) in s.usages() {
|
||||
o.fresh += u.input_tokens;
|
||||
o.cache_read += u.cache_read_tokens;
|
||||
o.cache_write += u.cache_write_tokens;
|
||||
o.output += u.output_tokens;
|
||||
let tot = u.input_tokens + u.cache_read_tokens + u.cache_write_tokens;
|
||||
o.reqs
|
||||
.push((tot, u.output_tokens, 100 * u.cache_read_tokens / tot.max(1)));
|
||||
}
|
||||
o
|
||||
}
|
||||
|
||||
pub fn report(s: &Session) -> String {
|
||||
let msgs = s.messages();
|
||||
let mut o = String::new();
|
||||
|
||||
Reference in new issue
Block a user