import{s as e}from"./DrKWWDpL.js";import{t}from"./DYP3EJMY.js";var n=e(t(),1);function r(){return{}.CLEO_DATA_DIR?(0,n.join)({}.CLEO_DATA_DIR,`llm-catalog`):(0,n.join)({}.XDG_DATA_HOME??(0,n.join)((0,n.homedir)(),`.local`,`share`),`cleo`,`llm-catalog`)}function i(e){if(!(0,n.existsSync)(e))return null;let t=(0,n.readdirSync)(e).filter(e=>e.endsWith(`-models.json`)).map(t=>({name:t,mtime:(0,n.statSync)((0,n.join)(e,t)).mtimeMs})).sort((e,t)=>t.mtime-e.mtime);return t.length>0?(0,n.join)(e,t[0].name):null}function a(e){try{let t=(0,n.readFileSync)(e,`utf-8`);return JSON.parse(t)}catch{return null}}export{r as n,a as r,i as t};