import{t as e}from"./jsx-runtime-CiQ1k8xo.js";import{lt as t}from"./vscode-api-DjORcpSo.js";import{n}from"./lib-MoKmYgcO.js";import{t as r}from"./settings.cog-_MjPuK5w.js";import{t as i}from"./bug-B9mPGL-U.js";import{t as a}from"./flask-HjCGqYEj.js";import{t as o}from"./play-outline-SajGrAt4.js";var s=t(),c=e(),l={tool:r,run:o,debug:i,test:a};function u(e){let t=(0,s.c)(3),{icon:n,className:r}=e,i=l[n],a=r?`icon-sm ${r}`:`icon-sm`,o;return t[0]!==i||t[1]!==a?(o=(0,c.jsx)(i,{className:a}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}var d=[{value:`tool`,message:n({id:`settings.localEnvironments.actions.icon.tool`,defaultMessage:`Tool`,description:`Tool icon label for local environment actions`})},{value:`run`,message:n({id:`settings.localEnvironments.actions.icon.run`,defaultMessage:`Run`,description:`Run icon label for local environment actions`})},{value:`debug`,message:n({id:`settings.localEnvironments.actions.icon.debug`,defaultMessage:`Debug`,description:`Debug icon label for local environment actions`})},{value:`test`,message:n({id:`settings.localEnvironments.actions.icon.test`,defaultMessage:`Test`,description:`Test icon label for local environment actions`})}],f=[`darwin`,`linux`,`win32`],p=`cd "$CODEX_WORKTREE_PATH"
pip install -r requirements.txt
npm install
./run/setup.sh`,m=`npm run dev`,h=`docker compose down --remove-orphans
rm -rf .cache/tmp`;function g(e){return{id:x(),name:e,icon:`tool`,command:``,platform:null}}function _(e){return e.length>0?e.map(e=>({...e,id:x(),platform:e.platform??null})):[]}function v(e){return{darwin:e?.darwin?.script??``,linux:e?.linux?.script??``,win32:e?.win32?.script??``}}function y({version:e,name:t,setupScript:n,setupPlatformScripts:r,cleanupScript:i,cleanupPlatformScripts:a,actions:o}){let s=b(o),c=[],l=i.trim();c.push(`# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY`),c.push(`version = ${e}`),c.push(`name = ${w(t)}`),S(c,`setup`,n,r),S(c,`cleanup`,l,a),s.length>0&&c.push(``);for(let e of s)c.push(`[[actions]]`),c.push(`name = ${w(e.name)}`),e.icon&&c.push(`icon = ${w(e.icon)}`),c.push(`command = ${w(e.command)}`),e.platform&&c.push(`platform = ${w(e.platform)}`),c.push(``);return`${c.join(`
`).trimEnd()}\n`}function b(e){let t=[];for(let n of e){let e=n.name.trim(),r=n.command.trim();e.length===0||r.length===0||t.push({...n,name:e,command:r})}return t}function x(){return crypto.randomUUID()}function S(e,t,n,r){let i=C(r);if((t===`setup`||n.length>0||i.length>0)&&(e.push(``),e.push(`[${t}]`),e.push(`script = ${w(n)}`)),i.length!==0){e.push(``);for(let[n,r]of i.entries())e.push(`[${t}.${r.platform}]`),e.push(`script = ${w(r.script)}`),n<i.length-1&&e.push(``)}}function C(e){let t=[];for(let n of f){let r=e[n];!r||r.length===0||t.push({platform:n,script:r})}return t}function w(e){let t=e.replace(/\r\n/g,`
`);return t.includes(`
`)?t.includes(`'''`)?`"""\n${t.replace(/\\/g,`\\\\`).replace(/"""/g,`\\"""`)}\n"""`:`'''\n${t}\n'''`:JSON.stringify(t)}export{y as a,v as c,p as i,d as l,h as n,g as o,f as r,_ as s,m as t,u};
//# sourceMappingURL=local-environments-utils-3EcnYbFD.js.map