@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
22 lines • 1.78 kB
TypeScript
/**
* `node:child_process` behind the execution barrier, for code running in a tool-child worker (senpi#3566, plan
* todo 4; the per-API table in DESIGN PART 1). Synchronous and `exec*` launches stay in the child's own (ledgered)
* group and run only after the ack. `spawn` without `detached` and with `detached: true` leads its own group through
* the POSIX shim, so the handle is on record before the program runs; `detached: true` is ledgered as detached and
* never swept. `fork` keeps its IPC channel, so it stays in the child's group (ack-gated). The worker blocks until the
* ack in every case, so a caller can never write to a shim's stdin before its go-line.
*/
import type * as ChildProcessModule from "node:child_process";
import type { SpawnOptions } from "node:child_process";
import type { WorkerLaunchClient } from "./worker-launch.ts";
type ChildProcessApi = typeof ChildProcessModule;
/**
* The command line the shim starts, by Node's own rules for `shell` on Windows: a shell named `cmd` or `cmd.exe` gets
* `/d /s /c "<command>"` with the command passed through verbatim (cmd.exe does not understand the C runtime's `\"`
* escaping); any other shell gets `-c <command>` with normal quoting. `shell: true` means `%ComSpec%`, else cmd.exe.
*/
export declare function breakawayCommandLine(command: string, args: readonly string[], shell: SpawnOptions["shell"], env?: NodeJS.ProcessEnv): string;
/** A `node:child_process` module object whose launch APIs pass the execution barrier. Non-launch exports pass through. */
export declare function createGatedChildProcess(module: ChildProcessApi, client: WorkerLaunchClient, platform?: NodeJS.Platform, reentry?: string | undefined): ChildProcessApi;
export {};
//# sourceMappingURL=gated-child-process.d.ts.map