import { existsSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

//#region src/deploy/sniffer-hooks.ts
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const mjsPath = join(__dirname, "sniffer-envkit-patch.mjs");
const tsPath = join(__dirname, "sniffer-envkit-patch.ts");
const patchedEnvkitPath = existsSync(mjsPath) ? mjsPath : tsPath;
/**
* Resolve hook - intercepts module resolution for @geekmidas/envkit
*/
async function resolve(specifier, context, nextResolve) {
	if (specifier === "@geekmidas/envkit") return {
		url: `file://${patchedEnvkitPath}`,
		shortCircuit: true
	};
	return nextResolve(specifier, context);
}

//#endregion
export { resolve };
//# sourceMappingURL=sniffer-hooks.mjs.map