Expand description
LocalExecutor — reference ToolExecutor backed by the local filesystem
(tokio::fs) and process table (tokio::process), openspec change
sdk-split-local-sandbox (design decision 1/6: local editing mode, the default).
Behavior mirrors the daemon’s tool implementations
(theway-daemon/src/tools/{read,write,bash,ls,grep,find,git}.rs):
read_filereads UTF-8 text;write_fileoverwrites and creates missing parent directories (like thewritetool).run_commandspawnsargv[0]withargv[1..]incwd, capturing stdout and stderr concurrently (wait_with_outputdrains both pipes, so a full stderr pipe cannot deadlock the wait, per thebashtool’s concurrency invariant). On timeout the child is killed (kill_on_dropbackstop, like thebashtool) and the call returnsCommandOutput { exit_code: -1 }— it never hangs and never leaves the child running.list_dirlists entry names sorted alphabetically, dotfiles included, no recursive walk (like thelstool).grep/findwalk with theignorecrate honoring.gitignore/ hidden-file filters and result caps (like thegrep/findtools).gitshells out to the systemgitbinary in the executor’s repository context (LocalExecutor::cwd), like thegittool.
Relative paths are resolved against LocalExecutor::cwd (the process working
directory by default), so an executor built with LocalExecutor::with_cwd stays
deterministic regardless of the caller’s process cwd.
Structs§
- Local
Executor - Reference
ToolExecutorfor local editing mode: local filesystem + process table. Cheap to construct, stateless apart from the repository context path, safe to share asArc<dyn ToolExecutor>.