#!/usr/bin/env node
var o=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(r,n)=>(typeof require<"u"?require:r)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var{spawn:i,execSync:t}=o("child_process"),l=o("path"),f=o("fs");function u(){try{return t("python3 --version",{stdio:"ignore"}),!0}catch{return!1}}function p(){try{return t("python3 -m mcp_server_nucleus --help",{stdio:"ignore"}),!0}catch{return!1}}function a(){console.error("[Nucleus] Installing Python dependencies (nucleus-mcp)...");try{return t("python3 -m pip install nucleus-mcp",{stdio:"inherit"}),!0}catch(e){return console.error("[Nucleus] ERROR: Failed to install nucleus-mcp via pip."),console.error(e.message),!1}}async function h(){u()||(console.error("[Nucleus] ERROR: python3 is not installed or not in PATH."),process.exit(1)),p()||a()||process.exit(1);let e=l.basename(process.argv[1]),r=process.argv.slice(2),n=[];e==="nucleus-init"?n=["-m","mcp_server_nucleus.cli",...r]:n=["-m","mcp_server_nucleus",...r];let c=i("python3",n,{stdio:"inherit",shell:!1});c.on("exit",s=>{process.exit(s)}),c.on("error",s=>{console.error("[Nucleus] Error spawning python process:",s),process.exit(1)})}h();
//# sourceMappingURL=module.js.map
