"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_runtime = require('../../_virtual/_rolldown/runtime.js');
const require_paths_socket = require('../../paths/socket.js');
const require_external_tools_from_pip_venv = require('../from-pip-venv.js');
let node_path = require("node:path");
node_path = require_runtime.__toESM(node_path);

//#region src/external-tools/skillspector/from-dlx.ts
/**
* @file `skillspectorFromDlx()` — DLX-venv tier of SkillSpector resolution.
*   Creates a single-purpose venv under `~/.socket/_dlx/skillspector/<sha>/`
*   and pip-installs the pinned git SHA. Returns `undefined` when:
*
*   - No Python interpreter is on PATH (host lacks Python 3.12+).
*   - The venv-create or pip-install command fails. Idempotent: hits the cached
*     venv when its `skillspector` entry-point already exists.
*/
const UPSTREAM_REPO = "https://github.com/NVIDIA/skillspector.git";
async function skillspectorFromDlx(opts) {
	const { sha } = opts;
	if (!sha) return;
	const cacheDir = opts.cacheDir ?? node_path.default.join(require_paths_socket.getSocketDlxDir(), "skillspector", sha);
	const installSpec = `git+${UPSTREAM_REPO}@${sha}`;
	try {
		return {
			path: (await require_external_tools_from_pip_venv.createPipVenv({
				cacheDir,
				entryPoint: "skillspector",
				installSpec
			})).entryPointPath,
			source: "dlx"
		};
	} catch {
		return;
	}
}

//#endregion
exports.skillspectorFromDlx = skillspectorFromDlx;