Publish harness and TUI open-source
initial sync from the monorepo
This commit is contained in:
commit
c68e39f604
2734 changed files with 1437016 additions and 0 deletions
33
crates/codegen/xai-grok-pager/src/slash/commands/context.rs
Normal file
33
crates/codegen/xai-grok-pager/src/slash/commands/context.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
//! `/context` -- show detailed context usage (instant, not queued).
|
||||
|
||||
use crate::app::actions::Action;
|
||||
use crate::slash::command::{CommandExecCtx, CommandResult, SlashCommand};
|
||||
|
||||
/// Show context usage breakdown (progress bar, token categories, stats).
|
||||
pub struct ContextCommand;
|
||||
|
||||
impl SlashCommand for ContextCommand {
|
||||
fn name(&self) -> &str {
|
||||
"context"
|
||||
}
|
||||
|
||||
fn description(&self) -> &str {
|
||||
"View context usage"
|
||||
}
|
||||
|
||||
fn session_scoped(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
fn usage(&self) -> &str {
|
||||
"/context"
|
||||
}
|
||||
|
||||
fn run(&self, ctx: &mut CommandExecCtx, _args: &str) -> CommandResult {
|
||||
if ctx.session_id.is_none() {
|
||||
return CommandResult::Error("No active session".to_string());
|
||||
}
|
||||
|
||||
CommandResult::Action(Action::ShowContextInfo)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue