ReaperProbes
Defined in: src/process-reaper.ts:37
Low-level probes, injectable so the reaper is unit-testable without real /proc.
Methods
Section titled “Methods”inodeToPortMap()?
Section titled “inodeToPortMap()?”
optionalinodeToPortMap():Map<number,number>
Defined in: src/process-reaper.ts:55
Build the full listening inode→port map from /proc/net/tcp[6].
Optional: used by scanListeningPortsByWorktree to build the map ONCE per sweep
rather than re-building it per-PID. Falls back to portsForPid when absent.
Returns
Section titled “Returns”Map<number, number>
killPid()
Section titled “killPid()”killPid(
pid,signal?):void
Defined in: src/process-reaper.ts:47
Terminate a pid (defaults to SIGTERM).
Parameters
Section titled “Parameters”number
signal?
Section titled “signal?”Signals
Returns
Section titled “Returns”void
listeningPorts()
Section titled “listeningPorts()”listeningPorts():
Set<number>
Defined in: src/process-reaper.ts:43
All locally-listening TCP ports (for the class-3 counter-check).
Returns
Section titled “Returns”Set<number>
portsForPid()
Section titled “portsForPid()”portsForPid(
pid):number[]
Defined in: src/process-reaper.ts:41
Listening TCP ports owned by a single pid (reads its fd table).
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number[]
readTranscript()
Section titled “readTranscript()”readTranscript(
path):string
Defined in: src/process-reaper.ts:45
Transcript text for a path; "" when missing/unreadable.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
run(
bin,args):void
Defined in: src/process-reaper.ts:49
Run a counter-command.
Parameters
Section titled “Parameters”string
string[]
Returns
Section titled “Returns”void
scanProcs()
Section titled “scanProcs()”scanProcs():
object[]
Defined in: src/process-reaper.ts:39
Every process with its cwd + comm (name). Cheap — no per-pid fd reads.
Returns
Section titled “Returns”object[]
socketInodesForPid()?
Section titled “socketInodesForPid()?”
optionalsocketInodesForPid(pid):number[]
Defined in: src/process-reaper.ts:61
Return the socket inodes owned by a single pid (reads its fd table).
Optional: used alongside inodeToPortMap for the single-map batched scan.
Falls back to portsForPid when absent.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”number[]