ProcRef
Defined in: packages/core/src/kernel/types.ts:974
Narrow public view of a process, consumed by helpers that operate on behalf
of another process (tool discovery, bin probing). ProcContext is
structurally assignable to ProcRef — a ProcRef is the subset of fields
these helpers actually touch, nothing more.
The four members below are the usage-grounded union audited against the three consumers — one line per field explaining which helper reads it:
env: enumerateBins reads$PATHto discover bin directories.fs: enumerateBins callsreaddirandstaton each$PATHentry to enumerate executable bins.spawn: probeBin forwards tocaptureSpawn.spawnto runbin --help-mcpand capture stdout.signal: probeBin forwards tocaptureSpawn.signalfor the SIGTERM/SIGKILL timeout-kill path.
A fifth field is a design signal — do NOT widen this interface; split the
helper instead, or raise a follow-up ticket. The compile-time assignability
guard at packages/core/test/types/proc-ref.type-test.ts fails the build
if ProcRef ever widens beyond what ProcContext satisfies.
Properties
Section titled “Properties”
readonlyenv:Record<string,string>
Defined in: packages/core/src/kernel/types.ts:976
Environment variables — consumed for $PATH lookups.
readonlyfs:ProcFS
Defined in: packages/core/src/kernel/types.ts:978
Per-process fs view — consumed for readdir/stat on $PATH entries.
Methods
Section titled “Methods”signal()
Section titled “signal()”signal(
pid,sig):void
Defined in: packages/core/src/kernel/types.ts:982
Send a signal to another process — forwarded to by captureSpawn for timeout kills.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
spawn()
Section titled “spawn()”spawn(
bin,argv,opts?):Promise<ChildHandle>
Defined in: packages/core/src/kernel/types.ts:980
Spawn a child process — forwarded to by captureSpawn when probing bins.
Parameters
Section titled “Parameters”string | BinFunction
string[]
Returns
Section titled “Returns”Promise<ChildHandle>