import{yt as e}from"./src-BOCweS1p.js";import{n as t}from"./vscode-api-DjORcpSo.js";function n(e){return e.length===0||e.length===1&&e[0]===`~`}async function r(e,{directoryName:r,prompt:i}={}){if(!n(e))return{cwd:e[0]??null,projectlessOutputDirectory:null,workspaceRoots:e};let{cwd:a,outputDirectory:o,workspaceRoot:s}=await t(`projectless-thread-cwd`,{params:{...r==null?{}:{directoryName:r},prompt:i??null}});return{cwd:a,projectlessOutputDirectory:o,workspaceRoots:[s]}}async function i({projectId:n,projectWritableRoots:r,legacyRoot:i=n,prompt:a}){let o=e({projectId:n,projectWritableRoots:r,legacyRoot:i});if(o.length===1)return{cwd:o[0],workspaceRoots:o};let s=await t(`projectless-thread-cwd`,{params:{prompt:a??null}});return{cwd:s.cwd,workspaceRoots:[s.workspaceRoot,...o],generatedWorkspace:s}}export{r as n,n as r,i as t};
//# sourceMappingURL=projectless-thread-JZqZP2Qh.js.map