Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src-rust/crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ path = "src/main.rs"
default = ["voice"]
voice = ["claurst-core/voice", "claurst-tui/voice"]

# Opt-in `/steer` command (see crates/tui). Build with `--features steer`.
steer = ["claurst-tui/steer"]

[dependencies]
claurst-core = { workspace = true }
claurst-api = { workspace = true }
Expand Down
33 changes: 33 additions & 0 deletions src-rust/crates/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2631,6 +2631,39 @@ async fn run_interactive(
let cmd_name = cmd_name.to_string();
let cmd_args = cmd_args.to_string();

// ── /steer <message> (opt-in feature) ─────────────────────
// Explicit steering: queue the message when a turn is in
// flight (it auto-runs after the current turn, mirroring
// Enter-while-busy), or submit it immediately when idle.
#[cfg(feature = "steer")]
if cmd_name == "steer" {
let msg = cmd_args.trim().to_string();
if msg.is_empty() {
app.notifications.push(
claurst_tui::NotificationKind::Info,
"Usage: /steer <message> — steer the running turn"
.to_string(),
Some(4),
);
continue;
}
if app.is_streaming || current_query.is_some() {
let preview: String = msg.chars().take(40).collect();
app.queued_messages.push_back(msg);
let total = app.queued_messages.len();
app.notifications.push(
claurst_tui::NotificationKind::Info,
format!("Steer queued ({total}): {preview}"),
Some(3),
);
} else {
// Idle: submit now via the auto-submit path.
app.set_prompt_text(msg);
app.pending_auto_submit = true;
}
continue;
}

// ── Step 1: TUI-layer intercept (overlays, toggles) ────────
// Run first so we know whether a UI overlay opened, which
// lets us suppress redundant CLI text output below.
Expand Down
5 changes: 4 additions & 1 deletion src-rust/crates/commands/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11314,7 +11314,10 @@ mod tests {
// - stats: intercepted directly by the TUI to open the live stats
// dialog; the named CLI `stats` command handles aggregate saved
// session reports outside the TUI.
const ALLOWED_ALIAS_NAMES: &[&str] = &["quit", "settings", "survey", "handoff"];
// - steer: opt-in feature, intercepted directly in the CLI main loop
// (queues/sends a steering message); only present when built with
// `--features steer`.
const ALLOWED_ALIAS_NAMES: &[&str] = &["quit", "settings", "survey", "handoff", "steer"];

let prompt_names: HashSet<&str> = claurst_tui::app::PROMPT_SLASH_COMMANDS
.iter()
Expand Down
4 changes: 4 additions & 0 deletions src-rust/crates/tui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ edition.workspace = true
# Enable real microphone capture for voice PTT mode.
voice = ["claurst-core/voice", "dep:cpal", "dep:hound"]

# Opt-in `/steer` command: explicitly queue a steering message for the running
# turn (auto-runs after it), or submit immediately when idle. Off by default.
steer = []

# UI & Interaction features (pass-through from cc-core)
token_budget = ["claurst-core/token_budget"]
ultraplan = ["claurst-core/ultraplan"]
Expand Down
5 changes: 5 additions & 0 deletions src-rust/crates/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ pub const PROMPT_SLASH_COMMANDS: &[(&str, &str)] = &[
"status",
"Show session status or run diagnostics (/status doctor)",
),
#[cfg(feature = "steer")]
(
"steer",
"Queue a steering message for the running turn (or send it now if idle)",
),
("survey", "Open session feedback survey"),
("tasks", "Manage tracked background tasks"),
(
Expand Down