Add thread/shellCommand to app server API surface (#14988)

This PR adds a new `thread/shellCommand` app server API so clients can
implement `!` shell commands. These commands are executed within the
sandbox, and the command text and output are visible to the model.

The internal implementation mirrors the current TUI `!` behavior.
- persist shell command execution as `CommandExecution` thread items,
including source and formatted output metadata
- bridge live and replayed app-server command execution events back into
the existing `tui_app_server` exec rendering path

This PR also wires `tui_app_server` to submit `!` commands through the
new API.
This commit is contained in:
Eric Traut authored and GitHub committed 2026-03-18 23:42:40 -06:00
1 parent 10eb3ec7fc
commit 01df50cf42
43 files changed
+2580 -86

No files matched your search

@@ -35,6 +35,9 @@ pub(crate) enum AppCommandView<'a> {
RealtimeConversationAudio(&'a ConversationAudioParams),
RealtimeConversationText(&'a ConversationTextParams),
RealtimeConversationClose,
RunUserShellCommand {
command: &'a str,
},
UserTurn {
items: &'a [UserInput],
cwd: &'a PathBuf,
@@ -134,6 +137,10 @@ impl AppCommand {
Self(Op::RealtimeConversationClose)
}
pub(crate) fn run_user_shell_command(command: String) -> Self {
Self(Op::RunUserShellCommand { command })
}
#[allow(clippy::too_many_arguments)]
pub(crate) fn user_turn(
items: Vec<UserInput>,
@@ -291,6 +298,7 @@ impl AppCommand {
AppCommandView::RealtimeConversationText(params)
}
Op::RealtimeConversationClose => AppCommandView::RealtimeConversationClose,
Op::RunUserShellCommand { command } => AppCommandView::RunUserShellCommand { command },
Op::UserTurn {
items,
cwd,