Run operator shell commands in a chat's directory on the server

chat_shell_run starts $SHELL -lc in the chat session's directory in its own
process group, streams merged output to every watcher of the session, keeps a
1 MiB tail and persists each run; chat_shell_stop interrupts the group and
kills it after a grace period. chat_shell_share queues an ordinary prompt
with the command and a bounded output tail.
This commit is contained in:
2026-11-09 15:55:14 +00:00
parent 57679d9591
commit e6bc57c901
16 changed files with 1367 additions and 1 deletions
+6
View File
@@ -262,6 +262,12 @@ type Message struct {
ChatShellOutputQuery *ChatShellOutputQuery `json:"chat_shell_output_query,omitempty"`
ChatShells []ChatShell `json:"chat_shells,omitempty"`
ChatShellOutput *ChatShellOutputPage `json:"chat_shell_output,omitempty"`
// Operator shell commands (chat_shell_run.go): the request body, one run,
// a session's runs and the pushed live change.
ChatShellRunRequest *ChatShellRunRequest `json:"chat_shell_run_request,omitempty"`
ChatShellRun *ChatShellRunRecord `json:"chat_shell_run,omitempty"`
ChatShellRuns []ChatShellRunRecord `json:"chat_shell_runs,omitempty"`
ChatShellRunEvent *ChatShellRunEventFrame `json:"chat_shell_run_event,omitempty"`
// ListDirectory is the list_directory body and DirectoryListing its reply:
// the home-restricted folder picker listing (see directories.go).
ListDirectory *DirectoryListRequest `json:"list_directory,omitempty"`