Lines 1-21javascript
2import{a as se,b as ot,c as st,d as we,e as z,g as T,i as it,j as at,l as q,m as rt,n as lt}from"./chunk-H6TMU6MK.js";import{Command as ss}from"commander";import{spawn as ct}from"child_process";import _ from"picocolors";function J(){let e=process.version,t=/^v(\d+)\.(\d+)\.(\d+)/.exec(e);if(!t)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(t[1],10),n=parseInt(t[2],10),a=parseInt(t[3],10),i=`${o}.${n}.${a}`;return o<22||o===22&&n<15?{ok:!1,version:i,major:o,minor:n,mess ...
3`));let t=[];t.push(yn());let o=await ie();t.push(kn(o)),t.push(await wn(o.command)),t.push(await An()),t.push(await En());for(let a of t){let i=a.status==="ok"?_.green("\u2713"):_.red("\u2717");console.log(` ${i} ${a.name}${a.detail?_.dim(` \u2014 ${a.detail}`):""}`),a.nextAction&&console.log(` ${_.dim("\u2192")} ${_.cyan(a.nextAction)}`)}console.log();let n=t.filter(a=>a.status==="fail");if(n.length===0){Pn();return}console.log(_.red(_.bold(`${n.length} check${n.length===1?"":"s"} failed \u2014 fix the \u2192 items above, then re-run \`npx klaudius@latest preflight\`.`))),console.log() ...
HighChild Process
Package source references child process execution.
dist/bin.jsView on unpkg · L1 HighSame File Env Network Execution
4`)[0]||"ok"}:{name:"pip available",status:"fail",detail:`${t.join(" ")} -m pip not runnable`,nextAction:`Add pip to your Python: \`${t.join(" ")} -m ensurepip --upgrade\` (or reinstall Python from python.org, which bundles pip).`}}async function An(){let e=process.platform==="win32",t=await Fe("npm",["--version"],e);return t.code!==0?{name:"npm / npx available",status:"fail"
5Please share that file so we can trace what happened.`);return n}var Ge="claude-code";function pt(e){if(e==="claude-code"||e==="codex")return e}var Ve="vercel";function ft(e){if(e==="vercel"||e==="cloudflare"||e==="netlify")return e}function _n(e){if(e==="custom"||e!==void 0&&Object.hasOwn(z,e))return e}function Ee(e){let t=_n(e.EMAIL_PROVIDER);if(t)return t;let o=e.EMAIL_SMTP_HOST;if(o){for(let[n,a]of Object.entries(z))if(a.smtpHost===o)return n;return"custom"}}function Pe(e){let t=[],o=a=>{t.push(""),t.push("# "+"=".repeat(60)),t.push(`# ${a}`),t.push("# "+"=".repeat(60)),t.push("")},n=(a,i) ...
7`}function be(e){let t={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(t,null,2)+`
8`}function Te(e){let t=e.supabaseProjectRef,o=Sn(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=${t}"]`,`env = { SUPABASE_ACCESS_TOKEN = "${o}", NODE_OPTIONS = "--use-system-ca" }`,""].join(`
9`)}function Sn(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}var mt=[{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",comment:"Phrasing slotted next to ${PRICING} in outreach copy. See template/CLAUDE.md."},{key:"VERCEL_SCOPE",value:"",comment:"Vercel team slug. Leave blank unless `vercel link` errors about scope (post-2024 ...
11`,i=["","# "+"=".repeat(60),"# Backfilled by `klaudius update` (new template env keys)","# "+"=".repeat(60)];for(let l of n)i.push(""),l.comment&&i.push(`# ${l.comment}`),i.push(In(l.key,l.value));return e+a+i.join(`
13`}function Cn(e){return e.length>=2&&e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1).replace(/\\\\/g,"\\").replace(/\\"/g
14`)){let n=o.trim();if(!n||n.startsWith("#"))continue;let a=n.indexOf("=");if(a===-1)continue;let i=n.slice(0,a).trim(),l=Cn(n.slice(a+
15`,"utf-8")}function At(e,t){let o=new Date().toISOString();return{version:1,templateVersion:e,installedAt:o,updatedAt:o,files:t}}async function Ie(e,t=e){let o=await Dn(e,{withFileTypes:!0}),n=[];for(let a of o){let i=Et(e,a.name);a.isDirectory()?n.push(...await Ie(i,t)):a.isFile()&&n.push(Un(t,i))}return n}async function Pt(e){let t=await Ie(e),o={};for(let n of t)_e.has(n)||(o[n]=await ae(Et(e,n)));return o}import{copyFile as jn,mkdir as bt,mkdtemp as Hn,readdir as Tt,rm as _t}from"fs/promises";import{tmpdir as Kn}from"os";import{dirname as Fn,join as Ce}from"path";import{Readable as Gn}from ...
16`+X.bold(X.cyan(e))),detail:e=>console.log(X.dim(" "+e))};var Wn="https://registry.npmjs.org/klaudius/latest";async function Yn(e=1500){let t=new AbortController,o=setTimeout(()=>t.abort(),e);
17`)};try{let i=await fetch("https://places.googleapis.com/v1/places:searchText",{method:"POST",headers:{"Content-Type":"application/json","X-Goog-Api-Key":n,"X-Goog-FieldMask":"places.id"},body:JSON.stringify({textQuery:"x"})});if(i.ok)return{ok:!0};if(i.status===429)return{ok:!0};let l={};try{l=await i.json()}catch{}let c=l.error?.message??"",p=l.error?.status??"";return i.status===400&&(p==="PERMISSION_DENIED"||/Places API \(New\) has not been enabled|API_KEY_SERVICE_BLOCKED/i.test(c))?{ok:!1,message:"Key is valid, but Places API (New) is not enabled on its Cloud project. Open https://console ...
18 \u2022 The app password is wrong, expired, or for a different provider.
19 \u2022 The email address doesn't match the account that issued the password.
20 \u2022 2FA is required but no app-specific password was generated.`:n.includes("etimedout")||n.includes("timeout")?`${t} server didn't respond in time. Check the host/port, or your network.`:n.includes("enotfound")||n.includes("getaddrinfo")?`${t} host could not be resolved. Check the host setting.`:`${t} check failed: ${o}`}async function Dt(e
21`+t;return ro.some(n=>n.test(o))}function Kt(e){return new Promise(t=>setTimeout(t,e))}function lo(e,t,o){return new Promise(n=>{let a=o.shell?Ye([e,...t].join(" "),{cwd:o.cwd,stdio:["ignore","pipe","pipe"],shell:!0,env:o.env??process.env}):Ye(e,t,{cwd:o.cwd,stdio:["ignore","pipe","pipe"],shell:!1,env:o.env??process.env}),i="",l="";a.stdout?.on("data",c=>{let p=c.toString();i+=p,process.stdout.write(p)}),a.stderr?.on("data",c=>{let p=c.toString();l+=p,process.stderr.write(p)}),a.on("close",c=>n({code:c??1,stdout:i,stderr:l})),a.on("error",c=>n({code:1,stdout:i,stderr:l+c.message}))})}async fun ...
Long lines were clipped for display.