(pid: number = process.pid)
| 59 | * Unregister the current process's session. No-op if not found. |
| 60 | */ |
| 61 | export function unregisterSession(pid: number = process.pid): void { |
| 62 | const filePath = sessionPath(pid); |
| 63 | try { |
| 64 | if (existsSync(filePath)) unlinkSync(filePath); |
| 65 | } catch { |
| 66 | // Ignore delete failures |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | /** |
| 71 | * List all active sessions. Automatically removes stale entries. |