import{n as e,s as t}from"./rolldown-runtime-Czos8NxU.js";import{El as n,Tl as r,vl as i}from"./app-initial~app-main~worktree-init-v2-page~appgen-settings-page~page~appgen-publication-ter~fzo5ij6p-BKVLyD1q.js";import{_x as a,yx as o}from"./app-initial~app-main~new-thread-panel-page-BZHGOlMi.js";import{Ht as s,Ut as c}from"./app-initial~app-main~worktree-init-v2-page~remote-conversation-page~pull-requests-page~new-~mam8fk3d-QYu6Tutl.js";import{n as l,t as u}from"./app-initial~app-main~worktree-init-v2-page~appgen-publication-terms-route~appgen-page~remot~l0r2eqtb-D4Xwmd6B.js";import{n as d,t as f}from"./play-outline-CbkYxH4X.js";var p,m,h=e((()=>{t(n()),p=i(),m=e=>(0,p.jsx)(`svg`,{width:20,height:20,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,...e,children:(0,p.jsx)(`path`,{d:`M16.0013 14.4404C16.0012 13.9504 15.8514 13.4739 15.5736 13.0742L15.4467 12.9082L15.0121 12.3877C13.8615 12.8911 12.9154 13.1121 12.0619 13.1562C11.1476 13.2035 10.3805 13.0475 9.66541 12.8857C8.9421 12.7221 8.28162 12.5562 7.47302 12.5146C6.70041 12.475 5.77589 12.5504 4.56873 12.8887L4.5531 12.9082C4.19469 13.3383 3.99852 13.8806 3.99841 14.4404C3.99841 15.7627 5.07071 16.835 6.39294 16.835H13.6078C14.9299 16.8349 16.0013 15.7626 16.0013 14.4404ZM11.8353 3.16504H8.16541V7.72949C8.16541 8.20671 8.01889 8.6713 7.74841 9.06055L7.62439 9.22266L5.93396 11.25C6.52127 11.1756 7.05057 11.1614 7.54041 11.1865C8.48678 11.2351 9.2693 11.432 9.95837 11.5879C10.6557 11.7456 11.272 11.8653 11.9926 11.8281C12.5792 11.7978 13.2617 11.6591 14.1215 11.3184L12.3754 9.22266C12.0262 8.80363 11.8353 8.27494 11.8353 7.72949V3.16504ZM13.1654 7.72949C13.1654 7.96372 13.247 8.19111 13.3969 8.37109L16.4681 12.0566L16.6654 12.3154C17.0976 12.9371 17.3313 13.6782 17.3314 14.4404C17.3314 16.4971 15.6645 18.1649 13.6078 18.165H6.39294C4.33617 18.165 2.66833 16.4972 2.66833 14.4404C2.66844 13.5694 2.97398 12.7258 3.53162 12.0566L6.60291 8.37109L6.65564 8.30176C6.77198 8.13447 6.83533 7.93464 6.83533 7.72949V3.16504H6.66638C6.29926 3.16486 6.00134 2.86716 6.00134 2.5C6.00134 2.13284 6.29926 1.83514 6.66638 1.83496H13.3334L13.4672 1.84863C13.7703 1.91057 13.9984 2.17857 13.9984 2.5C13.9984 2.82143 13.7703 3.08943 13.4672 3.15137L13.3334 3.16504H13.1654V7.72949Z`,fill:`currentColor`})})}));function g(e){let t=(0,_.c)(3),{icon:n,className:r}=e,i=y[n],a=r?`icon-sm ${r}`:`icon-sm`,o;return t[0]!==i||t[1]!==a?(o=(0,v.jsx)(i,{className:a}),t[0]=i,t[1]=a,t[2]=o):o=t[2],o}var _,v,y,b=e((()=>{_=r(),c(),h(),d(),l(),v=i(),y={tool:u,run:f,debug:s,test:m}})),x,S=e((()=>{o(),x=[{value:`tool`,message:a({id:`settings.localEnvironments.actions.icon.tool`,defaultMessage:`Tool`,description:`Tool icon label for local environment actions`})},{value:`run`,message:a({id:`settings.localEnvironments.actions.icon.run`,defaultMessage:`Run`,description:`Run icon label for local environment actions`})},{value:`debug`,message:a({id:`settings.localEnvironments.actions.icon.debug`,defaultMessage:`Debug`,description:`Debug icon label for local environment actions`})},{value:`test`,message:a({id:`settings.localEnvironments.actions.icon.test`,defaultMessage:`Test`,description:`Test icon label for local environment actions`})}]}));function C(e){return{id:k(),name:e,icon:`tool`,command:``,platform:null}}function w(e){return e.length>0?e.map(e=>({...e,id:k(),platform:e.platform??null})):[]}function T(e){return{darwin:e?.darwin?.script??``,linux:e?.linux?.script??``,win32:e?.win32?.script??``}}function E({version:e,name:t,setupScript:n,setupPlatformScripts:r,cleanupScript:i,cleanupPlatformScripts:a,actions:o}){let s=O(o),c=[],l=i.trim();c.push(`# THIS IS AUTOGENERATED. DO NOT EDIT MANUALLY`),c.push(`version = ${e}`),c.push(`name = ${M(t)}`),A(c,`setup`,n,r),A(c,`cleanup`,l,a),s.length>0&&c.push(``);for(let e of s)c.push(`[[actions]]`),c.push(`name = ${M(e.name)}`),e.icon&&c.push(`icon = ${M(e.icon)}`),c.push(`command = ${M(e.command)}`),e.platform&&c.push(`platform = ${M(e.platform)}`),c.push(``);return`${c.join(`
`).trimEnd()}\n`}async function D({codexWorktree:e,configPath:t,gitRoot:n,refreshEnvironments:r,selectForWorkspace:i,selectForWorktree:a}){return await r(),e?n==null?!1:a(n,t):(i(t),!0)}function O(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 k(){return crypto.randomUUID()}function A(e,t,n,r){let i=j(r);if((t===`setup`||n.length>0||i.length>0)&&(e.push(``),e.push(`[${t}]`),e.push(`script = ${M(n)}`)),i.length!==0){e.push(``);for(let[n,r]of i.entries())e.push(`[${t}.${r.platform}]`),e.push(`script = ${M(r.script)}`),n<i.length-1&&e.push(``)}}function j(e){let t=[];for(let n of N){let r=e[n];!r||r.length===0||t.push({platform:n,script:r})}return t}function M(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)}var N,P,F,I,L=e((()=>{N=[`darwin`,`linux`,`win32`],P=`cd "$CODEX_WORKTREE_PATH"
pip install -r requirements.txt
npm install
./run/setup.sh`,F=`npm run dev`,I=`docker compose down --remove-orphans
rm -rf .cache/tmp`}));export{E as a,T as c,x as d,S as f,P as i,L as l,b as m,I as n,C as o,g as p,N as r,w as s,F as t,D as u};
//# sourceMappingURL=local-environments-utils-BJNgG_jp.js.map