Lines 1-21javascript
2import{a as Q,b as je,c as Ke,d as P,f as He,g as Fe}from"./chunk-SZ4KCTSL.js";import{a as le,b as Ve,c as Ge,d as ce,e as Be,i as Ye}from"./chunk-ZTT5HVYU.js";import{Command as hs}from"commander";import{spawn as Vt}from"child_process";import _ from"picocolors";function G(){let e=process.version,n=/^v(\d+)\.(\d+)\.(\d+)/.exec(e);if(!n)return{ok:!1,message:`Could not parse the Node.js version string ("${e}"). Klaudius requires Node.js 22.15 or newer \u2014 install from https://nodejs.org/.`};let o=parseInt(n[1],10),t=parseInt(n[2],10),i=parseInt(n[3],10),a=`${o}.${t}.${i}`;return o<22||o===22&& ...
3`));let n=[];n.push(Gt());let o=await Z();n.push(Bt(o)),n.push(await Yt(o.command)),n.push(await Wt()),n.push(await zt());for(let i of n){let a=i.status==="ok"?_.green("\u2713"):_.red("\u2717");console.log(` ${a} ${i.name}${i.detail?_.dim(` \u2014 ${i.detail}`):""}`),i.nextAction&&console.log(` ${_.dim("\u2192")} ${_.cyan(i.nextAction)}`)}console.log();let t=n.filter(i=>i.status==="fail");if(t.length===0){qt();return}console.log(_.red(_.bold(`${t.length} check${t.length===1?"":"s"} failed \u2014 fix the \u2192 items above, then re-run \
4`)[0]||"ok"}:{name:"pip available",status:"fail",detail:`${n.join(" ")} -m pip not runnable`,nextAction:`Add pip to your Python: \`${n.join(" ")} -m ensurepip --upgrade\` (or reinstall Python from python.org, which bundles pip).`}}async function Wt(){let e=process.platform==="win32",n=await _e("npm",["--version"],e);return n.code!==0
5Please share that file so we can trace what happened.`);return t}var Ce="claude-code";function qe(e){if(e==="claude-code"||e==="codex")return e}var Ie="vercel";function Xe(e){if(e==="vercel"||e==="cloudflare"||e==="netlify")return e}function ue(e){let n=[],o=i=>{n.push(""),n.push("# "+"=".repeat(60)),n.push(`# ${i}`),n.push("# "+"=".repeat(60)),n.push("")},t=(i,a)=>{if(a==null||a===""){n.push(`# ${i}=`);return}let l=String(a);if(/[\s"'`$\\#&|<>;()*?\[\]{}!~]/.test
7`}function pe(e){let n={mcpServers:{supabase:{command:"npx",args:["-y","@supabase/mcp-server-supabase@latest",`--project-ref=${e.supabaseProjectRef}`],env:{SUPABASE_ACCESS_TOKEN:e.supabasePat,NODE_OPTIONS:"--use-system-ca"}}}};return JSON.stringify(n,null,2)+`
8`}function fe(e){let n=e.supabaseProjectRef,o=Qt(e.supabasePat);return["# Codex MCP config \u2014 generated by `npx klaudius init` / `configure`.","# Edit freely. NEVER commit this file \u2014 .gitignore already excludes it.","# See `.codex/config.toml.example` for the documented format.","","[mcp_servers.supabase]",'command = "npx"',`args = ["-y", "@supabase/mcp-server-supabase@latest", "--project-ref=${n}"]`,`env = { SUPABASE_ACCESS_TOKEN = "${
9`)}function Qt(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}var Je=[{key:"AI_AGENT",value:"claude-code",comment:"Which AI coding agent drives this install. Pre-codex installs were Claude Code by default \u2014 this records that explicitly so `update` re-fetches the matching template tarball and `doctor` checks the right CLI."},{key:"PRICING_TERMS",value:"one-off, no monthly fees"
11`,a=["","# "+"=".repeat(60),"# Backfilled by `klaudius update` (new template env keys)","# "+"=".repeat(60)];for(let l of t)a.push(""),l.comment&&a.push(`# ${l.comment}`),a.push(Zt(l.key,l.value));return e+i+a.join(`
13`}function en(e){return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1).replace(/\\\\/g,"\\").replace(/\\"/g,'"').replace(/\\\$/g,"$").replace(/\\`/g,"`"):e.length>=2&&e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e}function
14`)){let t=o.trim();if(!t||t.startsWith("#"))continue;let i=t.indexOf("=");if(i===-1)continue;let a=t.slice(0,i
15`+B.bold(B.cyan(e))),detail:e=>console.log(B.dim(" "+e))};var rn="https://registry.npmjs.org/klaudius/latest";async function ln(e=1500){let n=new AbortController,o=setTimeout(()=>n.abort(),e);try{let t=await fetch(rn,{signal:n.signal,headers:{accept:"application/json"}});if(!t.ok)return null;let i=await t.json();return typeof i.version=="string"?i.version:null}catch{return null}finally{clearTimeout(o)}}function cn(e,n){let o=a=>a.split("-")[0].split(".").map(l=>Number.parseInt(l,10)),t=o(e),i=o(n);if(t.length<3||i.length<3)return!1;for(let a=0;a<3;a++){if(Number.isNaN(t[a])||Number.isNaN(i[a ...
HighCommand Output Exfiltration
Source combines command execution, command-output handling, and outbound requests; review data flow before blocking.
dist/bin.jsView on unpkg · L1 16 \u2022 The app password is wrong, expired, or for a different provider.
17 \u2022 The email address doesn't match the account that issued the password.
18 \u2022 2FA is required but no app-specific password was generated.`:t.includes("etimedout")||t.includes("timeout")?`${n} server didn't respond in time. Check the host/port, or your network.`:t.includes("enotfound")||t.includes("getaddrinfo")?`${n} host could not be resolved. Check the host setting.`:`${n} check failed: ${o}`}async
19`+n;return Pn.some(t=>t.test(o))}function gt(e){return new Promise(n=>setTimeout(n,e))}function bn(e,n,o){return new Promise(t=>{let i=ft(e,n,{cwd:o.cwd,stdio:["ignore","pipe","pipe"],shell:!1,env:o.env??process.env}),a="",l="";i.stdout?.on("data",c=>{let f=c.toString();a+=f,process.stdout.write(f)}),i.stderr?.on("data",c=>{let f=c.toString();l+=f,process.stderr.write(f)}),i.on("close",c=>t({code:c??1,stdout:a,stderr:l})),i.on("error",c=>t({code:1,stdout:a,stderr:l+c.message}))})}async function Re(e,n,o){let t={code:0,stdout:"",stderr:""};for(let i=0;i<=te;i++){if(t=await bn(e,n,{cwd:o.cwd,env ...
20${e.stdout??""}`;return _n.find(t=>t.pattern.test(n))?.hint}async function In(e){let n=["supabase<2.26","python-dotenv","requests","httpx","Pillow","truststore"],o
21`,"utf-8")}var At="0.17.2",b=5;function Y(e,n){s.blank(),s.error(`${e} validation failed ${b} times in a row. Pausing setup so you don't get stuck in a loop.`),s.detail(`Last error: ${n}`),s.blank(),s.detail("Your credentials are saved in `.env`. Two ways forward:"),s.detail(" \u2022 Open `.env` in any text editor, fix the value, re-run `npx klaudius@latest init` and pick Resume."),s.detail(" \u2022 Or email hello@klaudius.dev with the error above and we'll dig in."),s.blank(),process.exit(1)}async function Pt(e){let n=e.target??".",o=Nn(n)?n:On(process.cwd(),n),t=Un(o);t&&(s.error("
Long lines were clipped for display.