import{boa as w}from"./chunks/cli-0.5.12-xzeb7mtb.mjs";if(typeof globalThis.File>"u")try{let{File:j}=w("node:buffer");globalThis.File=j}catch{globalThis.File=class extends Blob{name;lastModified;constructor(H,J,N){super(H,N);this.name=J,this.lastModified=N?.lastModified??Date.now()}}}if(typeof Promise.withResolvers!=="function")Promise.withResolvers=function(){let H=()=>{},J=()=>{};return{promise:new Promise((O,A)=>{H=O,J=A}),resolve:H,reject:J}};{let j=w("node:util");if(typeof j.markAsUncloneable!=="function")j.markAsUncloneable=()=>{}}process.env.CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS??="true";process.env.CLAUDE_CODE_ENABLE_FINE_GRAINED_TOOL_STREAMING??="1";process.env.COREPACK_ENABLE_AUTO_PIN="0";if(process.env.CLAUDE_CODE_REMOTE==="true"){let j=process.env.NODE_OPTIONS||"";process.env.NODE_OPTIONS=j?`${j} --max-old-space-size=8192`:"--max-old-space-size=8192"}var V=/^[a-z][a-z0-9-]*$/;async function X(){let j=process.argv.slice(2);if(j.length===1&&(j[0]==="--version"||j[0]==="-v"||j[0]==="-V")){console.log("0.5.12 (Claudin)");return}if(!process.env.CLAUDIN_HELP_CAPTURE&&(j.length===1&&(j[0]==="--help"||j[0]==="-h")||j.length===2&&(j[1]==="--help"||j[1]==="-h")&&V.test(j[0])))try{let{readFileSync:q}=await import("node:fs"),{fileURLToPath:z}=await import("node:url"),{join:B,dirname:D}=await import("node:path"),K=D(z(import.meta.url)),Q=j.length===1?"help.txt":`help-${j[0]}.txt`,R=q(B(K,Q),"utf-8");process.stdout.write(R);return}catch{}if(j.includes("--provider"))console.error('The --provider CLI flag was removed. Run "claudin" and use /provider to choose a profile.'),process.exit(1);let H=import("./chunks/main-0.5.12-a5ye3nrk.mjs");H.catch(()=>{});{let{enableConfigs:q}=await import("./chunks/config-0.5.12-vc9je2fj.mjs");q()}{let{applySafeConfigEnvironmentVariables:q}=await import("./chunks/managedEnv-0.5.12-9m0enspy.mjs");q()}(async()=>{let{runStartupUpdateCheck:q}=await import("./chunks/startupUpdateCheck-0.5.12-j9pvbhww.mjs");await q(j)})();{let{hydrateGithubModelsTokenFromSecureStorage:q,refreshGithubModelsTokenIfNeeded:z}=await import("./chunks/githubModelsCredentials-0.5.12-gc6bcfrs.mjs");await z(),q()}let{validateProviderEnvForStartupOrExit:J}=await import("./chunks/providerValidation-0.5.12-637xxs9q.mjs");await J();let{tryGetActiveProvider:N}=await import("./chunks/activeProvider-0.5.12-gs3tp52z.mjs"),O=N();if(O&&O.transport==="anthropic")(async()=>{let q=await import("./chunks/grove-0.5.12-g5c6bca9.mjs");q.getGroveSettings(),q.getGroveNoticeConfig()})();if(O&&process.stdout.isTTY&&process.env.CLAUDIN_CLEAR_ON_START==="1"){let{clearTerminal:q}=await import("./chunks/clearTerminal-0.5.12-g53rj1ba.mjs");process.stdout.write(q)}let{profileCheckpoint:A}=await import("./chunks/startupProfiler-0.5.12-4mesbnz6.mjs");if(A("cli_entry"),j[0]==="--dump-system-prompt"){A("cli_dump_system_prompt_path");let{enableConfigs:q}=await import("./chunks/config-0.5.12-vc9je2fj.mjs");q();let{getMainLoopModel:z}=await import("./chunks/model-0.5.12-ncsht9ca.mjs"),B=j.indexOf("--model"),D=B!==-1&&j[B+1]||z(),{getSystemPrompt:K}=await import("./chunks/prompts-0.5.12-r29ww1bz.mjs"),Q=await K([],D);console.log(Q.join(`
`));return}if(!1)switch(j[0]){case"ps":case"logs":case"attach":case"kill":default:}if((j.includes("--tmux")||j.includes("--tmux=classic"))&&(j.includes("-w")||j.includes("--worktree")||j.some((q)=>q.startsWith("--worktree=")))){A("cli_tmux_worktree_fast_path");let{enableConfigs:q}=await import("./chunks/config-0.5.12-vc9je2fj.mjs");q();let{isWorktreeModeEnabled:z}=await import("./chunks/worktreeModeEnabled-0.5.12-qxdddvwv.mjs");if(z()){let{execIntoTmuxWorktree:B}=await import("./chunks/worktree-0.5.12-0svdfkzh.mjs"),D=await B(j);if(D.handled)return;if(D.error){let{exitWithError:K}=await import("./chunks/process-0.5.12-esywnb4j.mjs");K(D.error)}}}if(j.length===1&&(j[0]==="--update"||j[0]==="--upgrade"))process.argv=[process.argv[0],process.argv[1],"update"];if(j.includes("--bare"))process.env.CLAUDE_CODE_SIMPLE="1";if(process.env.CLAUDIN_DISABLE_EARLY_INPUT!=="1"){let{startCapturingEarlyInput:q}=await import("./chunks/earlyInput-0.5.12-9c0k1b2s.mjs");q()}A("cli_before_main_import");let{main:U}=await H;A("cli_after_main_import"),await U(),A("cli_after_main_complete")}X();
