Expand description
The real transport: shells out to the opencode CLI.
Stdout goes to a temp file, never a pipe: the CLI writes the body with one un-awaited
process.stdout.write and then calls process.exit, so a pipe loses whatever the reader has
not drained (spec Transport). The file is deleted by a drop guard on every exit path.
StructsΒ§
- CliTransport
- Finished π
- Stdout
File π - Deletes the stdout temp file on every path, including a failed spawn.
EnumsΒ§
ConstantsΒ§
- AUTH_
HINT π - SIZE_
POLL π - STDERR_
CAP π - STDERR_
DRAIN π - STDOUT_
READ_ CEILING - Runaway-output ceiling for a childβs stdout file (not a budget: legitimate reads are far below).
FunctionsΒ§
- ceiling_
error π - deadline_
error π - err π
- exit_
text π - first_
line π - from_
tool π - io_
error π - map_
cli_ failure - The specβs mapping table, in order. Reached only after a successful spawn.
- npm_
shim_ exe - The executable an npm install of opencode keeps beside its
opencode.cmdshim indir(node_modules\@opencode\cli\bin\opencode.exe, the very file the shim runs), when both exist. The shim itself is never started:cmd.exewould expand%VAR%inside prompt text passed as arguments. - plain_
failure π - resolve_
binary - Explicit path; else the first
opencode/opencode.exeonpath(on Windows also the executable behind an npmopencode.cmdshim, seenpm_shim_exe); else<home>/.opencode/bin/opencode[.exe]; elseOPENCODE_NOT_FOUND. Pure: nothing is spawned. - spawn_
error π - The one mapping of a failed
Command::spawn. - unparseable π
- verb π