Module shell_node

Module shell_node 

Source
Expand description

ShellNodeRunner — spawns a shell command and streams output to the frontend as shell_chunk WPS events scoped to the agent’s block.

Launched by handle_shell_create (server/mod.rs) via tokio::spawn. The runner is fire-and-forget; the HTTP handler returns the shell_id to the MCP caller immediately while output streams asynchronously.

Phase 2 of SPEC_PERSISTENT_SHELL_NODE_2026_06_11.md. Uses tokio::process::Command with captured pipes (no PTY in this phase; PTY support is a Phase 3 follow-up that requires portable-pty wiring similar to the existing ShellController).

Structs§

ShellNodeRunner
ShellSessionRegistry
Per-shell stop handles. ShellStop (MCP tool / UI button) looks up a shell_id and fires the oneshot, which makes the owning ShellNodeRunner tree-kill its child. Mirrors InstallSessionRegistry; lives in AppState.shell_sessions. Phase 3 of SPEC_PERSISTENT_SHELL_NODE.

Functions§

kill_tree 🔒
Kill the entire process tree rooted at pid. Child::kill / kill_on_drop only reap the wrapper shell (cmd /C / sh -c); a task dev spawns task.execargo/node grandchildren that survive otherwise.
now_ms 🔒
publish_chunk 🔒
publish_exit 🔒
shell_scopes 🔒