/**
 * Shared process-level helpers.
 */
export function isProcessAlive(ownerPid) {
    try {
        process.kill(ownerPid, 0);
        return true;
    }
    catch (err) {
        const nodeErr = err;
        if (nodeErr.code === 'ESRCH') {
            return false;
        }
        if (nodeErr.code === 'EPERM') {
            return true;
        }
        throw err;
    }
}
export function isStaleRunningTask(ownerPid) {
    return ownerPid == null || !isProcessAlive(ownerPid);
}
//# sourceMappingURL=process.js.map