RunLocaltypeno test imports ittype RunLocal = (argv: readonly string[], opts?: RunOptions) => Promise<Output>;Runs a local program: the system's proc.output, or a stand-in in a test.
The ssh executor (commons headless 0005-reach-and-targets FR-005; 0007-ssh-coverage FR-003, FR-004): an Executor that runs the program on a target through the system's OpenSSH client, with the one set of options of argv.ts, and no SSH protocol of its own. The argument vector given to exec is quoted into the one remote command (and exec gives its output when the program has ended: it does not stream); put and get copy files with scp; spawn starts the client with piped streams for a protocol talked over its standard input and output (an MCP server over ssh -T); a script is run as sh -s with the script on the standard input, which is how a host with nothing of ours on it is first set up.
import { sshExecutor } from "./executor.ts";
// const ex = sshExecutor(alpha, [alpha], config); await ex.exec(["ops", "run", "--json", "status"]); const s = ex.spawn?.(["ops", "mcp"]);RunLocaltypeno test imports ittype RunLocal = (argv: readonly string[], opts?: RunOptions) => Promise<Output>;Runs a local program: the system's proc.output, or a stand-in in a test.
SpawnLocaltypeno test imports ittype SpawnLocal = (argv: readonly string[], opts?: SpawnOptions) => Session;Starts a local program with piped streams: the system's proc.spawn, or a stand-in in a test.
SshDepstypeno test imports ittype SshDeps = { readonly run?: RunLocal; readonly spawn?: SpawnLocal };What the executor runs the client with: both default to the system's.
sshExecutorfunctionfunction sshExecutor(t: Target, all: readonly Target[], config: SshConfig, deps?: RunLocal | SshDeps): ExecutorThe executor for one target; deps are the system's by default (a function is taken as run, as before). A call that cannot be made (a word with a NUL, a credential that does not resolve, a path a shell could expand) is an exit of 255 with the reason, as a connection that did not happen; spawn throws it, there being no output to give it in.
runScriptfunctionfunction runScript(t: Target, all: readonly Target[], config: SshConfig, script: string, args?: readonly string[], run?: RunLocal, opts?: RunOptions): Promise<Output>Runs a script on a target as sh -s -- <args> with the script on its standard input: the bootstrap of a host that has no program of ours on it.