function detect_lockfile() {
	let dir = process.cwd();

	/** @param {string} file */
	const exists = (file) => fs.existsSync(path.join(dir, file));

	do {
		if (exists('pnpm-lock.yaml')) return 'pnpm';
		if (exists('yarn.lock')) return 'yarn';
		if (exists('package-lock.json')) return 'npm';
		if (exists('bun.lockb') || exists('bun.lock')) return 'bun';
	} while (dir !== (dir = path.dirname(dir)));

	return 'npm';
}
@type {Record<string, (name: string, version: string) => string>}