(pid: number)
| 111 | |
| 112 | /** What the OS says process `pid` is running. Never throws. */ |
| 113 | export async function describeProcess(pid: number): Promise<ProcessDescription> { |
| 114 | if (!Number.isSafeInteger(pid) || pid <= 0) return { name: null, commandLine: null }; |
| 115 | if (process.platform === 'win32') return describeWindowsProcess(pid); |
| 116 | if (process.platform === 'linux') return describeLinuxProcess(pid); |
| 117 | return describePsProcess(pid); |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * Whether a command line is a CodeGraph MCP server's, the only kind of process |
no test coverage detected