codexui-android 0.1.106 → 0.1.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{DirectoryHub-DSkzrx9M.js → DirectoryHub-CDkPMYL8.js} +1 -1
- package/dist/assets/{ReviewPane-CpFUdAhb.js → ReviewPane-CiJXnK-p.js} +1 -1
- package/dist/assets/{ThreadConversation-TbvxTGZL.js → ThreadConversation-BJcbG7R6.js} +1 -1
- package/dist/assets/{ThreadTerminalPanel-DVFhduDv.js → ThreadTerminalPanel-zjPFLNlu.js} +1 -1
- package/dist/assets/{index-Dgv-diAL.js → index-7uudGTMH.js} +25 -25
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-D7eMWmxV.js","assets/index.esm-aDL62PRZ.js","assets/index.esm-Bh22Jgzp.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as Qe,o as a,c as l,g as G,a as s,t as i,F as H,q as n,f as c,m as Me,i as Te,R as Ms,r as W,J as nt,y as A,_ as Je,w as Ee,A as Oe,l as Os,S as it,x as d,z as jt,b as Wt,s as We,U as Ve,V as qe,W as Ht,X as xs,Y as Rs,Z as Bs,p as Gs,v as js,$ as Hs,a0 as zs,a1 as Ks,a2 as Vs,a3 as qs,a4 as Ws,a5 as Qs,a6 as Js,a7 as Zs,a8 as Ys,a9 as Xs,aa as ea,ab as ta,ac as sa,ad as aa,ae as zt,af as la}from"./index-Dgv-diAL.js";const oa=[[/(gmail|google calendar|google docs|google sheets|google drive|github|slack|notion|linear|outlook|supabase)/i,140],[/(email|calendar|document|sheet|drive|repo|issue|message|project|database|crm|deploy)/i,50]];function Qt(u){return u.trim().toLowerCase()}function ia(u,N){return N.reduce((p,[I,w])=>p+(I.test(u)?w:0),0)}function Kt(u){return u.activeCount*1e3+(u.isNoAuth?300:0)+u.toolsCount*3+u.triggersCount*4+ia(`${u.name} ${u.slug} ${u.description}`,oa)}function na(u,N){const p=Qt(N);if(!p)return 0;const I=u.name.toLowerCase(),w=u.slug.toLowerCase();return I===p||w===p?1e6:I.replace(/\s+/gu,"")===p.replace(/\s+/gu,"")?9e5:I.startsWith(p)||w.startsWith(p)?8e5:I.includes(p)||w.includes(p)?7e5:0}function Le(u){return u.activeCount>0?0:u.totalConnections>0?1:u.isNoAuth?2:3}function ra(u,N,p=""){const I=Qt(p),w=L=>na(L,I);return N==="name"?[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||L.name.localeCompare(S.name)):N==="date"?[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||L.name.localeCompare(S.name)):[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||Kt(S)-Kt(L)||L.name.localeCompare(S.name))}const ca={class:"skill-card-top"},ua=["src","alt"],da={key:1,class:"skill-card-avatar-fallback"},ya={class:"skill-card-info"},va={class:"skill-card-header"},pa={class:"skill-card-name"},ha={key:0,class:"skill-card-badge-disabled"},ma={key:1,class:"skill-card-badge"},ga={key:0,class:"skill-card-owner"},fa=["title"],ka={key:0,class:"skill-card-desc"},ba={key:1,class:"skill-card-meta-row"},_a=Qe({__name:"SkillCard",props:{skill:{},showStatusBadge:{type:Boolean,default:!0},showBrowseAction:{type:Boolean,default:!0},showOwner:{type:Boolean,default:!0}},emits:["select"],setup(u){const N=u,{t:p}=nt(),I=A(()=>N.showStatusBadge!==!1),w=A(()=>N.showBrowseAction!==!1),L=A(()=>N.showOwner!==!1),S=A(()=>{const P=N.skill.path;return P?P.endsWith("/SKILL.md")?P.slice(0,-9):P:""});function K(){const P=S.value;P&&window.open(`/codex-local-browse${encodeURI(P)}`,"_blank","noopener,noreferrer")}const E=A(()=>{const P=N.skill.publishedAt;if(!P)return"";const R=new Date(P),D=Date.now()-P;return D<36e5?`${Math.floor(D/6e4)}m ago`:D<864e5?`${Math.floor(D/36e5)}h ago`:D<2592e6?`${Math.floor(D/864e5)}d ago`:R.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),Q=A(()=>{const P=[];return N.skill.installCountLabel&&P.push(N.skill.installCountLabel),E.value&&P.push(E.value),P});function x(P){const R=P.target;R.style.display="none"}return(P,R)=>(a(),l("button",{class:G(["skill-card",{"is-disabled":u.skill.installed&&u.skill.enabled===!1}]),type:"button",onClick:R[0]||(R[0]=C=>P.$emit("select",u.skill))},[s("div",ca,[u.skill.avatarUrl?(a(),l("img",{key:0,class:"skill-card-avatar",src:u.skill.avatarUrl,alt:u.skill.owner,loading:"lazy",onError:x},null,40,ua)):(a(),l("div",da,i(u.skill.owner.charAt(0)),1)),s("div",ya,[s("div",va,[s("span",pa,i(u.skill.displayName||u.skill.name),1),I.value?(a(),l(H,{key:0},[u.skill.installed&&u.skill.enabled===!1?(a(),l("span",ha,i(n(p)("Disabled")),1)):u.skill.installed?(a(),l("span",ma,i(n(p)("Installed")),1)):c("",!0)],64)):c("",!0)]),L.value?(a(),l("span",ga,i(u.skill.owner),1)):c("",!0)]),w.value&&u.skill.installed&&S.value?(a(),l("button",{key:2,class:"skill-card-browse",type:"button",title:n(p)("Browse files"),onClick:Me(K,["stop"])},[Te(Ms,{class:"skill-card-browse-icon"})],8,fa)):c("",!0)]),u.skill.description?(a(),l("p",ka,i(u.skill.description),1)):c("",!0),Q.value.length>0?(a(),l("div",ba,[(a(!0),l(H,null,W(Q.value,C=>(a(),l("span",{key:C,class:"skill-card-meta"},i(C),1))),128))])):c("",!0)],2))}}),Vt=Je(_a,[["__scopeId","data-v-76c12421"]]),wa={class:"sdm-panel"},Ca={class:"sdm-header"},Sa={class:"sdm-title-area"},$a=["src","alt"],Aa={class:"sdm-title-col"},Ia={class:"sdm-title-row"},Pa={class:"sdm-title"},La={key:0,class:"sdm-badge-disabled"},Ea={class:"sdm-owner"},Ta=["aria-label"],Ua={class:"sdm-body"},Na={key:0,class:"sdm-desc"},Da={key:1,class:"sdm-readme-loading"},Fa=["innerHTML"],Ma=["href"],Oa={class:"sdm-footer"},xa={class:"sdm-footer-actions"},Ra=["disabled"],Ba=["disabled"],Ga=["disabled"],ja=["disabled"],Ha=Qe({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(u,{emit:N}){const p=u,I=N,w=d(null),L=d(""),S=d(""),K=d(!1),{t:E}=nt(),Q=A(()=>w.value??p.skill.enabled??!0),x=A(()=>p.isInstalling===!0||p.isUninstalling===!0),P=A(()=>L.value||p.skill.description),R=A(()=>{const _=p.skill.path;return _?_.endsWith("/SKILL.md")?_.slice(0,-9):_:""}),C=A(()=>{const _=S.value;if(!_)return"";const M=_.replace(/^---[\s\S]*?---\s*/,"");return D(M)});function D(_){return _.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function Y(){if(!(!p.skill.owner||!p.skill.name)){K.value=!0,L.value="",S.value="";try{const _=new URLSearchParams({owner:p.skill.owner,name:p.skill.name});p.skill.installed&&_.set("installed","true"),p.skill.path&&_.set("path",p.skill.path);const M=await fetch(`/codex-api/skills-hub/readme?${_}`);if(!M.ok)return;const O=await M.json();S.value=O.content??"",L.value=O.description??""}catch{}finally{K.value=!1}}}Ee(()=>p.visible,_=>{_&&(w.value=null,L.value="",S.value="",Y())});function te(){I("install",p.skill)}function m(){I("uninstall",p.skill)}function g(){const _=!Q.value;w.value=_,I("toggle-enabled",p.skill,_)}function k(){p.isTrying||I("try",p.skill)}function J(){const _=R.value;_&&window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}return(_,M)=>(a(),Oe(it,{to:"body"},[u.visible?(a(),l("div",{key:0,class:"sdm-overlay",onClick:M[1]||(M[1]=Me(O=>_.$emit("close"),["self"]))},[s("div",wa,[s("div",Ca,[s("div",Sa,[u.skill.avatarUrl?(a(),l("img",{key:0,class:"sdm-avatar",src:u.skill.avatarUrl,alt:u.skill.owner,loading:"lazy"},null,8,$a)):c("",!0),s("div",Aa,[s("div",Ia,[s("h3",Pa,i(u.skill.displayName||u.skill.name),1),u.skill.installed&&!Q.value?(a(),l("span",La,i(n(E)("Disabled")),1)):c("",!0)]),s("span",Ea,i(u.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":n(E)("Close"),onClick:M[0]||(M[0]=O=>_.$emit("close"))},[Te(Os,{class:"sdm-close-icon"})],8,Ta)]),s("div",Ua,[P.value?(a(),l("p",Na,i(P.value),1)):c("",!0),K.value?(a(),l("div",Da,i(n(E)("Loading skill contents...")),1)):S.value?(a(),l("div",{key:2,class:"sdm-readme",innerHTML:C.value},null,8,Fa)):c("",!0),u.skill.url?(a(),l("a",{key:3,class:"sdm-link",href:u.skill.url,target:"_blank",rel:"noopener noreferrer"},i(n(E)("View on GitHub")),9,Ma)):c("",!0)]),s("div",Oa,[s("div",xa,[u.skill.installed?(a(),l("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:x.value,onClick:m},i(p.isUninstalling?n(E)("Uninstalling..."):n(E)("Uninstall")),9,Ra)):(a(),l("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:x.value,onClick:te},i(p.isInstalling?n(E)("Installing..."):n(E)("Install")),9,Ba)),u.skill.installed?(a(),l("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:x.value,onClick:g},i(Q.value?n(E)("Disable"):n(E)("Enable")),9,Ga)):c("",!0),u.skill.installed&&Q.value?(a(),l("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:x.value||p.isTrying,onClick:k},i(p.isTrying?"Starting...":"Try it!"),9,ja)):c("",!0),u.skill.installed&&R.value?(a(),l("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:J},i(n(E)("Browse files")),1)):c("",!0)])])])])):c("",!0)]))}}),za=Je(Ha,[["__scopeId","data-v-8ab621f9"]]),Ka={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};let ot=null;function Va(){return ot||(ot=Promise.all([jt(()=>import("./index.esm-D7eMWmxV.js"),__vite__mapDeps([0,1])),jt(()=>import("./index.esm-Bh22Jgzp.js"),__vite__mapDeps([2,1]))])),ot}function qa(u){const N=d(null),p=d(""),I=d(""),w=d(""),L=d({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),S=A(()=>w.value==="pull"),K=A(()=>w.value==="push"),E=A(()=>w.value==="startup-sync"),Q=A(()=>w.value!=="");async function x(){try{const m=await fetch("/codex-api/skills-sync/status");if(!m.ok)return;const g=await m.json();g.data&&(L.value=g.data)}catch{}}async function P(){try{const m=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),g=await m.json();if(!m.ok||!g.data)throw new Error("Failed to start GitHub login");N.value=g.data;const k=30,J=Math.max((g.data.interval??5)*1e3,3e3);let _=!1;for(let M=0;M<k;M++){await new Promise(X=>setTimeout(X,J));const O=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:g.data.device_code})}),V=await O.json();if(!O.ok)throw new Error(V.error||"Failed to complete GitHub login");if(V.ok){_=!0;break}if(!V.pending)throw new Error(V.error||"Failed to complete GitHub login")}if(!_)throw new Error("GitHub login timed out. Please retry.");N.value=null,await x(),u.showToast("GitHub login successful")}catch(m){u.showToast(m instanceof Error?m.message:"Failed GitHub login","error")}}async function R(){try{const[m,g]=await Va(),{getApp:k,getApps:J,initializeApp:_}=m,{getAuth:M,GithubAuthProvider:O,signInWithPopup:V}=g,X=J().length>0?k():_(Ka),ie=M(X),se=new O;se.addScope("repo");const q=await V(ie,se),ne=O.credentialFromResult(q),re=(ne==null?void 0:ne.accessToken)??"";if(!re)throw new Error("GitHub access token missing from Firebase login");const ee=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:re})}),ae=await ee.json();if(!ee.ok||!ae.ok)throw new Error(ae.error||"Failed to login with GitHub token");await x(),u.showToast("GitHub login successful")}catch(m){const g=m instanceof Error?m.message:"Failed Firebase GitHub login";u.showToast(g,"error")}}async function C(){I.value="",p.value="pull-started",w.value="pull";try{const m=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to pull synced skills");await u.onPulled(),p.value="pull-success",u.showToast(L.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(m){const g=m instanceof Error?m.message:"Failed to pull sync";I.value=g,p.value="pull-failed",u.showToast(g,"error")}finally{w.value=""}}async function D(){I.value="",p.value="push-started",w.value="push";try{const m=await fetch("/codex-api/skills-sync/push",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to push synced skills");p.value="push-success",u.showToast("Pushed skills to private sync repo")}catch(m){const g=m instanceof Error?m.message:"Failed to push sync";I.value=g,p.value="push-failed",u.showToast(g,"error")}finally{w.value=""}}async function Y(){I.value="",p.value="startup-sync-started",w.value="startup-sync";try{const m=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to run startup sync");await u.onPulled(),await x(),p.value="startup-sync-success",u.showToast("Startup sync completed")}catch(m){const g=m instanceof Error?m.message:"Failed startup sync";I.value=g,p.value="startup-sync-failed",u.showToast(g,"error")}finally{w.value=""}}async function te(){try{const m=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to logout GitHub");await x(),u.showToast("Logged out from GitHub")}catch(m){u.showToast(m instanceof Error?m.message:"Failed to logout GitHub","error")}}return{deviceLogin:N,isPullInFlight:S,isPushInFlight:K,isStartupSyncInFlight:E,isSyncActionInFlight:Q,loadSyncStatus:x,logoutGithub:te,pullSkillsSync:C,pushSkillsSync:D,startupSkillsSync:Y,startGithubFirebaseLogin:R,startGithubLogin:P,syncActionError:I,syncActionStatus:p,syncStatus:L}}const Wa={class:"skills-hub"},Qa={class:"skills-hub-header"},Ja={class:"skills-hub-title"},Za={class:"skills-hub-subtitle"},Ya={class:"skills-sync-panel"},Xa={class:"skills-sync-header"},el=["href"],tl={key:1,class:"skills-sync-badge"},sl={key:2,class:"skills-sync-badge"},al={class:"skills-sync-meta"},ll={key:0,class:"skills-sync-error"},ol={key:1,class:"skills-sync-meta"},il={key:2,class:"skills-sync-error"},nl={key:3,class:"skills-sync-device"},rl=["href"],cl={class:"skills-sync-actions"},ul=["disabled"],dl=["disabled"],yl=["disabled"],vl=["disabled"],pl={class:"skills-search-panel"},hl={class:"skills-search-header"},ml={class:"skills-search-copy"},gl={class:"skills-directory-link",href:"https://skills.anyclaw.store/",target:"_blank",rel:"noopener noreferrer"},fl=["placeholder"],kl=["disabled"],bl={key:0,class:"skills-hub-error"},_l={key:1,class:"skills-hub-section"},wl={class:"skills-hub-section-title"},Cl={key:0,class:"skills-hub-grid"},Sl={key:2,class:"skills-hub-section"},$l={class:"skills-hub-section-title"},Al={key:0,class:"skills-hub-grid"},Il={class:"skills-hub-section"},Pl={key:0,class:"skills-hub-loading"},Ll={key:1,class:"skills-hub-error"},El={key:2,class:"skills-hub-empty"},Tl=Qe({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(u,{emit:N}){const p={name:"",owner:"",description:"",url:"",installed:!1},I=d([]),w=d([]),L=d(!1),S=d(!1),K=d(""),E=d(""),Q=d(""),x=d(!0),P=d(!0),R=d(!1),C=d(p),D=d(null),Y=d(""),te=d(!1),m=d(!1);let g=null;const{t:k}=nt(),J=u,_=N,M=A(()=>{var y;return((y=D.value)==null?void 0:y.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),O=A(()=>`${C.value.owner}/${C.value.name}`),V=A(()=>te.value&&Y.value===O.value),X=A(()=>m.value&&Y.value===O.value),ie=A(()=>{if(!F.value.configured)return"";const y=F.value.repoOwner.trim(),v=F.value.repoName.trim();return!y||!v?"":`https://github.com/${encodeURIComponent(y)}/${encodeURIComponent(v)}`}),se=A(()=>I.value);function q(y,v="success"){D.value={text:y,type:v},g&&clearTimeout(g),g=setTimeout(()=>{D.value=null},3e3)}function ne(y){if(I.value=y.installed??[],w.value.length>0){const v=new Map(I.value.map(h=>[h.name,h]));w.value=w.value.map(h=>{const j=v.get(h.name);return j?re(h,j):h})}}function re(y,v){return{...y,installed:!0,path:v.path,enabled:v.enabled}}function ee(y,v){return{...y,installed:!0,source:v.source,publishedAt:v.publishedAt}}async function ae(){L.value=!0,K.value="";try{const y=await fetch("/codex-api/skills-hub");if(!y.ok)throw new Error(`HTTP ${y.status}`);const v=await y.json();ne(v)}catch(y){K.value=y instanceof Error?y.message:"Failed to load skills"}finally{L.value=!1}}function Ue(y){const v=y.installed?I.value.find(h=>h.name===y.name):void 0;C.value=v?ee(v,y):y,R.value=!0}async function be(){const y=E.value.trim();if(!(y.length<2)){S.value=!0,Q.value="";try{const v=new URLSearchParams({q:y}),h=await fetch(`/codex-api/skills-hub/search?${v}`),j=await h.json();if(!h.ok)throw new Error(j.error||`HTTP ${h.status}`);const me=new Map(I.value.map(le=>[le.name,le]));w.value=(j.results??[]).map(le=>{const xe=me.get(le.name);return xe?re(le,xe):le}),P.value=!0,w.value.length===0&&q(k("No matching skills found."),"error")}catch(v){Q.value=v instanceof Error?v.message:"Failed to search skills"}finally{S.value=!1}}}async function _e(y){Y.value=`${y.owner}/${y.name}`,te.value=!0;try{const h=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:y.owner,name:y.name,source:y.source})})).json();if(!h.ok)throw new Error(h.error||"Install failed");if(!h.path)throw new Error("Install completed but no local skill path was returned");await ae();const j=I.value.find(me=>me.name===y.name);if(!(j!=null&&j.path))throw new Error("Install completed but the local skill was not found after refresh");C.value=ee(j,y),q(`${y.displayName||y.name} skill installed`),R.value=!1,_("skills-changed")}catch(v){q(v instanceof Error?v.message:"Failed to install skill","error")}finally{te.value=!1}}async function we(y){Y.value=`${y.owner}/${y.name}`,m.value=!0;try{const h=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y.name,path:y.path})})).json();if(!h.ok)throw new Error(h.error||"Uninstall failed");I.value=I.value.filter(j=>j.name!==y.name),q(`${y.displayName||y.name} skill uninstalled`),R.value=!1,_("skills-changed")}catch(v){q(v instanceof Error?v.message:"Failed to uninstall skill","error")}finally{m.value=!1}}async function Ce(y,v){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:y.path,enabled:v}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),q(`${y.displayName||y.name} skill ${v?"enabled":"disabled"}`),await ae()}catch(h){q(h instanceof Error?h.message:"Failed to update skill","error")}}function Se(y){!y.installed||y.enabled===!1||J.tryInFlightKey||(_("try-item",{kind:"skill",name:y.name,displayName:y.displayName||y.name,skillPath:y.path}),R.value=!1)}function $e(y){return`skill:${y.name}:${y.path??""}`}const{deviceLogin:b,isPullInFlight:U,isPushInFlight:Ne,isStartupSyncInFlight:De,isSyncActionInFlight:ce,loadSyncStatus:$,logoutGithub:ye,pullSkillsSync:Ae,pushSkillsSync:ve,startupSkillsSync:pe,startGithubFirebaseLogin:he,startGithubLogin:Z,syncActionError:Ie,syncActionStatus:ue,syncStatus:F}=qa({showToast:q,onPulled:async()=>{await ae(),_("skills-changed")}});return Wt(()=>{ae(),$()}),(y,v)=>(a(),l("div",Wa,[s("div",Qa,[s("h2",Ja,i(n(k)("Skills Hub")),1),s("p",Za,i(n(k)("Manage installed skills on this machine")),1)]),s("div",Ya,[s("div",Xa,[s("strong",null,i(n(k)("Skills Sync (GitHub)")),1),n(F).configured&&ie.value?(a(),l("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:ie.value,target:"_blank",rel:"noopener noreferrer"},i(n(k)("Connected"))+": "+i(n(F).repoOwner)+"/"+i(n(F).repoName),9,el)):n(F).loggedIn?(a(),l("span",tl,i(n(k)("Logged in as"))+" "+i(n(F).githubUsername),1)):(a(),l("span",sl,i(n(k)("Not connected")),1))]),s("div",al,[s("span",null,i(n(k)("Startup"))+": "+i(n(F).startup.mode),1),s("span",null,i(n(k)("Branch"))+": "+i(n(F).startup.branch),1),s("span",null,i(n(k)("Action"))+": "+i(n(F).startup.lastAction),1)]),n(F).startup.lastError?(a(),l("div",ll,i(n(F).startup.lastError),1)):c("",!0),n(ue)?(a(),l("div",ol,[s("span",null,i(n(k)("Manual sync"))+": "+i(n(ue)),1)])):c("",!0),n(Ie)?(a(),l("div",il,i(n(Ie)),1)):c("",!0),n(b)?(a(),l("div",nl,[s("span",null,[We(i(n(k)("Open"))+" ",1),s("a",{href:n(b).verification_uri,target:"_blank",rel:"noreferrer"},i(n(k)("GitHub device login")),9,rl),We(" "+i(n(k)("and enter code:")),1)]),s("code",null,i(n(b).user_code),1)])):c("",!0),s("div",cl,[n(F).loggedIn?c("",!0):(a(),l("button",{key:0,class:"skills-hub-sort",type:"button",onClick:v[0]||(v[0]=(...h)=>n(he)&&n(he)(...h))},i(n(k)("Login with GitHub")),1)),n(F).loggedIn?c("",!0):(a(),l("button",{key:1,class:"skills-hub-sort",type:"button",onClick:v[1]||(v[1]=(...h)=>n(Z)&&n(Z)(...h))},i(n(k)("Device Login")),1)),n(F).loggedIn?(a(),l("button",{key:2,class:"skills-hub-sort",type:"button",onClick:v[2]||(v[2]=(...h)=>n(ye)&&n(ye)(...h)),disabled:n(ce)},i(n(k)("Logout GitHub")),9,ul)):c("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:v[3]||(v[3]=(...h)=>n(pe)&&n(pe)(...h)),disabled:n(ce)},i(n(De)?n(k)("Syncing..."):n(k)("Startup Sync")),9,dl),s("button",{class:"skills-hub-sort",type:"button",onClick:v[4]||(v[4]=(...h)=>n(Ae)&&n(Ae)(...h)),disabled:n(ce)},i(n(U)?n(k)("Pulling..."):n(k)("Pull")),9,yl),n(F).loggedIn?(a(),l("button",{key:3,class:"skills-hub-sort",type:"button",onClick:v[5]||(v[5]=(...h)=>n(ve)&&n(ve)(...h)),disabled:!n(F).configured||n(ce)},i(n(Ne)?n(k)("Pushing..."):n(k)("Push")),9,vl)):c("",!0)])]),D.value?(a(),l("div",{key:0,class:G(["skills-hub-toast",M.value])},i(D.value.text),3)):c("",!0),s("div",pl,[s("div",hl,[s("div",ml,[s("strong",null,i(n(k)("Find skills")),1),s("span",null,i(n(k)("Search the Skills registry with npx skills find.")),1)]),s("a",gl,i(n(k)("Skills directory")),1)]),s("form",{class:"skills-search-form",onSubmit:Me(be,["prevent"])},[Ve(s("input",{"onUpdate:modelValue":v[6]||(v[6]=h=>E.value=h),class:"skills-search-input",type:"search",placeholder:n(k)("Search skills..."),"aria-label":"Search skills"},null,8,fl),[[qe,E.value]]),s("button",{class:"skills-hub-sort",type:"submit",disabled:S.value||E.value.trim().length<2},i(S.value?n(k)("Searching..."):n(k)("Search")),9,kl)],32),Q.value?(a(),l("div",bl,i(Q.value),1)):c("",!0)]),w.value.length>0?(a(),l("div",_l,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:v[7]||(v[7]=h=>P.value=!P.value)},[s("span",wl,i(n(k)("Search results ({count})",{count:w.value.length})),1),Te(Ht,{class:G(["skills-hub-section-chevron",{"is-open":P.value}])},null,8,["class"])]),P.value?(a(),l("div",Cl,[(a(!0),l(H,null,W(w.value,h=>(a(),Oe(Vt,{key:h.source||`${h.owner}/${h.name}`,skill:h,"show-browse-action":!1,onSelect:j=>Ue(j)},null,8,["skill","onSelect"]))),128))])):c("",!0)])):c("",!0),xs(y.$slots,"before-installed",{},void 0),se.value.length>0?(a(),l("div",Sl,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:v[8]||(v[8]=h=>x.value=!x.value)},[s("span",$l,i(n(k)("Installed skills ({count})",{count:se.value.length})),1),Te(Ht,{class:G(["skills-hub-section-chevron",{"is-open":x.value}])},null,8,["class"])]),x.value?(a(),l("div",Al,[(a(!0),l(H,null,W(se.value,h=>(a(),Oe(Vt,{key:h.name,skill:h,"show-status-badge":!1,"show-owner":!1,onSelect:j=>Ue(j)},null,8,["skill","onSelect"]))),128))])):c("",!0)])):c("",!0),s("div",Il,[L.value?(a(),l("div",Pl,i(n(k)("Loading skills...")),1)):K.value?(a(),l("div",Ll,i(K.value),1)):I.value.length===0?(a(),l("div",El,i(n(k)("No installed skills found.")),1)):c("",!0)]),Te(za,{skill:C.value,visible:R.value,"is-installing":V.value,"is-uninstalling":X.value,"is-trying":J.tryInFlightKey===$e(C.value),onClose:v[9]||(v[9]=h=>R.value=!1),onInstall:_e,onUninstall:we,onToggleEnabled:Ce,onTry:Se},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),Ul=Je(Tl,[["__scopeId","data-v-4447e558"]]),Nl={class:"directory-hub"},Dl={class:"directory-header"},Fl={class:"directory-subtitle"},Ml={class:"directory-header-actions"},Ol=["disabled"],xl={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},Rl=["aria-selected","onClick"],Bl={key:1,class:"directory-section"},Gl={class:"directory-toolbar"},jl={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},Hl={key:0,class:"directory-empty"},zl={key:1,class:"directory-error"},Kl={key:2,class:"directory-loading"},Vl={key:3,class:"directory-empty"},ql={key:4,class:"directory-grid"},Wl=["onClick"],Ql={class:"directory-card-top"},Jl=["src","alt"],Zl={class:"directory-card-main"},Yl={class:"directory-card-title-row"},Xl={class:"directory-card-title"},eo={key:0,class:"directory-badge is-muted"},to={key:1,class:"directory-badge"},so={class:"directory-card-meta"},ao={key:0,class:"directory-card-description"},lo={class:"directory-chip-row"},oo={key:0,class:"directory-chip"},io={key:2,class:"directory-section"},no={class:"directory-toolbar"},ro={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},co={key:0,class:"directory-empty"},uo={key:1,class:"directory-error"},yo={key:2,class:"directory-loading"},vo={key:3,class:"directory-empty"},po={key:4,class:"directory-grid"},ho={class:"directory-card-top"},mo=["src","alt"],go={key:1,class:"directory-card-fallback"},fo={class:"directory-card-main"},ko={class:"directory-card-title-row"},bo={class:"directory-card-title"},_o={key:0,class:"directory-badge is-muted"},wo={key:1,class:"directory-badge"},Co={class:"directory-card-meta"},So={key:0,class:"directory-card-description"},$o={class:"directory-chip-row"},Ao={key:0,class:"directory-chip"},Io={class:"directory-card-actions"},Po=["disabled","onClick"],Lo=["onClick"],Eo=["disabled","onClick"],To={key:3,class:"directory-section"},Uo={class:"directory-toolbar"},No={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},Do={key:0,class:"directory-error"},Fo={key:1,class:"directory-loading"},Mo={key:2,class:"directory-empty"},Oo={class:"directory-empty-copy"},xo={class:"directory-card-actions"},Ro=["disabled"],Bo={key:3,class:"directory-empty"},Go={class:"directory-empty-copy"},jo={class:"directory-card-actions"},Ho=["disabled"],zo={key:4,class:"directory-section composio-section"},Ko={class:"directory-card directory-card-wide composio-status-card"},Vo={class:"directory-card-top"},qo={class:"directory-card-main"},Wo={class:"directory-card-meta"},Qo={class:"directory-card-description"},Jo={class:"directory-chip-row"},Zo={key:0,class:"directory-chip"},Yo={key:1,class:"directory-chip"},Xo={key:2,class:"directory-chip"},ei={class:"directory-card-actions"},ti={key:0,class:"directory-empty"},si={key:1,class:"directory-grid"},ai={class:"directory-card-top"},li=["src","alt"],oi={key:1,class:"directory-card-fallback composio-fallback"},ii={class:"directory-card-main"},ni={class:"directory-card-title-row"},ri={class:"directory-card-title"},ci={key:0,class:"directory-badge"},ui={key:1,class:"directory-badge"},di={class:"directory-card-meta"},yi={key:0,class:"directory-card-description"},vi={class:"directory-chip-row"},pi={class:"directory-chip"},hi={key:0,class:"directory-chip"},mi={key:1,class:"directory-chip"},gi={class:"directory-card-actions"},fi=["onClick"],ki=["disabled","onClick"],bi=["disabled","onClick"],_i={key:2,class:"directory-section-actions"},wi=["disabled"],Ci={key:4,class:"directory-section"},Si={class:"skills-embedded-section"},$i={class:"skills-embedded-title"},Ai={key:0,class:"skills-embedded-body"},Ii={key:0,class:"directory-empty"},Pi={key:1,class:"directory-error"},Li={key:2,class:"directory-loading"},Ei={key:3,class:"directory-empty"},Ti={key:4,class:"mcp-skill-grid"},Ui=["onClick"],Ni={class:"mcp-skill-card-top"},Di={class:"mcp-skill-avatar-fallback"},Fi={class:"mcp-skill-info"},Mi={class:"mcp-skill-header"},Oi={class:"mcp-skill-name"},xi={class:"mcp-skill-meta"},Ri={key:0,class:"directory-mcp-detail"},Bi={key:0},Gi={class:"directory-mini-list"},ji={key:1},Hi={class:"directory-mini-list"},zi={class:"directory-modal"},Ki={class:"directory-modal-header"},Vi={class:"directory-card-top"},qi=["src","alt"],Wi={key:1,class:"directory-card-fallback"},Qi={class:"directory-card-main"},Ji={class:"directory-modal-title"},Zi={class:"directory-card-meta"},Yi={class:"directory-modal-body"},Xi={key:0,class:"directory-error"},en={key:1,class:"directory-loading"},tn={key:0,class:"directory-detail-description"},sn={key:1,class:"directory-detail-block"},an={class:"directory-chip-row"},ln={class:"directory-detail-grid"},on={key:0,class:"directory-detail-block"},nn={key:0,class:"directory-auth-status is-warning"},rn=["onClick"],cn={key:1,class:"directory-detail-block"},un={class:"directory-mini-list"},dn={key:2,class:"directory-detail-block"},yn=["disabled","onClick"],vn={key:2,class:"directory-screenshots"},pn=["src"],hn={key:3,class:"directory-auth-panel"},mn=["onClick"],gn={class:"directory-modal-footer"},fn=["disabled"],kn=["disabled"],bn={key:2,class:"directory-action",type:"button",disabled:""},_n=["disabled"],wn=["disabled"],Cn={class:"directory-modal"},Sn={class:"directory-modal-header"},$n={class:"directory-card-top"},An=["src","alt"],In={key:1,class:"directory-card-fallback composio-fallback"},Pn={class:"directory-card-main"},Ln={class:"directory-modal-title"},En={class:"directory-card-meta"},Tn={class:"directory-modal-body"},Un={key:0,class:"directory-error"},Nn={key:1,class:"directory-loading"},Dn={key:0,class:"directory-detail-description"},Fn={class:"directory-detail-grid"},Mn={class:"directory-detail-block"},On={class:"directory-chip-row"},xn={class:"directory-chip"},Rn={key:0,class:"directory-chip"},Bn={key:1,class:"directory-chip"},Gn={key:2,class:"directory-chip"},jn={class:"directory-detail-block"},Hn={key:0,class:"directory-mini-list"},zn={key:1},Kn={class:"directory-card-meta"},Vn={key:1,class:"directory-detail-block"},qn={class:"directory-card-meta"},Wn={class:"directory-modal-footer"},Qn=["disabled"],Jn=["disabled"],Zn="/Users/igor/.codex/skills/shared_skills/composio-cli/SKILL.md",Yn=50,qt=100,Xn=Qe({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(u,{emit:N}){const p=[[/^gmail$/i,3e4],[/^google calendar$/i,29500],[/^outlook( email| calendar)?$/i,29e3],[/^google drive$/i,28500],[/^google docs$/i,28e3],[/^google sheets$/i,27500],[/^dropbox$/i,27e3],[/^box$/i,26500],[/^slack$/i,26e3],[/^notion$/i,25500],[/^canva$/i,25e3],[/^figma$/i,24500],[/^github$/i,24e3],[/^trello$/i,23500],[/^asana$/i,23e3],[/^basecamp$/i,22500],[/^clickup$/i,22e3],[/^linear$/i,21500],[/^gitlab( issues)?$/i,21e3],[/^jira$/i,20500],[/^zapier$/i,2e4],[/^hubspot$/i,19500],[/^salesforce$/i,19e3],[/^netlify$/i,18500],[/^vercel$/i,18e3],[/^(spotify|youtube|netflix|hulu|disney|booking|expedia|uber|airbnb)$/i,17500]],I=[[/(email|mail|inbox|calendar|event|availability|contact|message|chat)/i,450],[/(drive|document|docs|sheet|slide|file|storage|pdf|note|page)/i,380],[/(image|design|presentation|diagram|video|audio|photo|media|music)/i,320],[/(travel|flight|hotel|restaurant|recipe|food|shopping|delivery|map|weather)/i,260],[/(learn|education|study|language|health|fitness|finance|budget)/i,220],[/(task|project|issue|repository|deploy|database|crm|sales|support)/i,120]],w=[[/(computer use|github|gitlab|linear|slack|notion|browser|web|filesystem|terminal)/i,120],[/(calendar|email|drive|docs|design|deploy|project|issue|search|database)/i,55]],L=[[/(github|gitlab|linear|slack|notion|filesystem|browser|computer|web|postgres|sqlite|database)/i,120],[/(search|drive|docs|calendar|terminal|shell|deploy|cloud|memory)/i,55]],S=u,K=N,E=Rs(),Q=Bs(),x=[{id:"plugins",label:"Plugins",subtitle:"Plugins make Codex work your way."},{id:"apps",label:"Apps",subtitle:"Connect Codex to external apps and services."},{id:"composio",label:"Composio",subtitle:"Browse Composio connectors, auth state, and ready-to-try integrations."},{id:"skills",label:"Skills",subtitle:"MCPs first, then installed skills and GitHub sync state."}];function P(e){return e==="plugins"||e==="apps"||e==="composio"||e==="skills"}function R(){return P(E.query.tab)?E.query.tab:"skills"}const C=d(R()),D=d(new Set),Y=d(!1),te=d([]),m=d([]),g=d(null),k=d([]),J=d(null),_=d(0),M=d([]),O=d("popular"),V=d("popular"),X=d("popular"),ie=d(""),se=d(""),q=d(""),ne=d(!1),re=d(!1),ee=d(!1),ae=d(!1),Ue=d(!1),be=d(!1),_e=d(!0),we=d(""),Ce=d(""),Se=d(""),$e=d(""),b=d(null),U=d(null),Ne=d(!1),De=d(!1),ce=d(""),$=d(null),ye=d(!1),Ae=d(!1),ve=d(""),pe=d(!1),he=d(!1),Z=d(!1),Ie=d(""),ue=d(""),F=d([]),y=d(""),v=d(new Set),h=d(null);let j=null,me=null,le=!1;const xe=A(()=>x.find(e=>e.id===C.value)??x[0]),rt=A(()=>!Y.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>D.value.has(e))),Re=A(()=>!Y.value||D.value.has("app/list")),Ze=A(()=>!Y.value||D.value.has("mcpServerStatus/list")),ct=A(()=>D.value.has("config/mcpServer/reload")),ut=A(()=>D.value.has("mcpServer/oauth/login")),ge=A(()=>(S.tryInFlightKey??"").length>0),dt=A(()=>{var e,t,r;return((e=U.value)==null?void 0:e.description)||((t=U.value)==null?void 0:t.summary.longDescription)||((r=U.value)==null?void 0:r.summary.description)||""}),yt=A(()=>{var t;const e=(t=U.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(je)].filter(Boolean):[]}),Ye=A(()=>{var r;const e=((r=U.value)==null?void 0:r.apps)??[];if(e.length===0)return!1;const t=new Set;for(const f of m.value)t.add(f.id.trim().toLowerCase()),t.add(kt(f.name));return e.some(f=>{const B=f.id.trim().toLowerCase(),de=kt(f.name),ke=B.length>0&&t.has(B),Ke=de.length>0&&t.has(de);return!ke&&!Ke})}),Jt=A(()=>{var e,t;return((e=b.value)==null?void 0:e.installPolicy)==="NOT_AVAILABLE"||(((t=U.value)==null?void 0:t.apps.some(r=>ft(r)))??!1)}),vt=A(()=>is(ds(rs(te.value,ie.value),O.value),O.value,ie.value)),pt=A(()=>ns(ys(cs(m.value,se.value),V.value),V.value,se.value)),ht=A(()=>ra(us(k.value,q.value),X.value,q.value)),Xe=A(()=>vs(M.value)),mt=A(()=>J.value!==null),Zt=A(()=>new Map(M.value.map(e=>[e.name,e]))),Yt=A(()=>{const e=g.value;return e&&[e.email||e.defaultOrgName,e.defaultOrgId?`org ${e.defaultOrgId}`:"",e.baseUrl||""].filter(Boolean).join(" · ")||"Composio CLI shares the login and connections from this machine."});function Be(e){return e.trim().toLowerCase()}function Xt(e){return Be(e).replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").replace(/[-_]+/gu," ").replace(/\s+plugin$/iu,"").replace(/\s+/gu," ").trim()}function gt(...e){const t=new Set;for(const r of e){const f=Xt(r);f&&(t.add(f),t.add(f.replace(/\s+/gu,"")))}return Array.from(t)}function es(e){return!e.isAccessible&&e.installUrl.trim().length===0}function ts(e){const t=e.id.trim();if(t){const f=m.value.find(B=>B.id===t);if(f)return f}const r=gt(e.name);return m.value.find(f=>gt(f.name).some(B=>r.includes(B)))??null}function ft(e){const t=ts(e);return t?es(t):e.needsAuth&&e.installUrl.trim().length===0}function et(e,t){const r=Be(t);return r?e.some(f=>f==null?void 0:f.toLowerCase().includes(r)):!0}function Ge(e,t){return t.reduce((r,[f,B])=>r+(f.test(e)?B:0),0)}function tt(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function kt(e){return tt(e).toLowerCase()}function ss(e){return e==="DEFAULT_OAI_CATALOG"?"OpenAI catalog":e==="ECOSYSTEM_DIRECTORY"?"Ecosystem directory":e?e.replace(/_/gu," ").toLowerCase().replace(/\b\w/gu,t=>t.toUpperCase()):""}function as(e){return e.developer||ss(e.distributionChannel)||"App"}function st(e){var t;return((t=Zt.value.get(e))==null?void 0:t.authStatus)??"unknown"}function bt(e){const t=st(e);return t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown"}function ls(e){const t=st(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function os(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function _t(e){return ut.value&&st(e)==="notLoggedIn"}function is(e,t,r){return t==="popular"&&Be(r).length===0?e.slice(0,qt):e}function ns(e,t,r){if(t!=="popular"||Be(r).length>0)return e;const f=new Set,B=[];for(const de of e){const ke=tt(de.name).toLowerCase();if(!f.has(ke)&&(f.add(ke),B.push(de),B.length>=qt))break}return B}function rs(e,t){return e.filter(r=>et([r.displayName,r.name,r.description,r.developerName,r.category,r.marketplaceDisplayName,...r.capabilities],t))}function cs(e,t){return e.filter(r=>et([r.name,r.description,r.developer,r.category,r.distributionChannel,...r.pluginDisplayNames],t))}function us(e,t){return e.filter(r=>et([r.name,r.slug,r.description,...r.authModes,...r.connectionStatuses],t))}function wt(e){return(e.installed?500:0)+(e.enabled?40:0)+(e.developerName.toLowerCase().includes("openai")?140:0)+(e.sourceType==="local"?80:0)+e.capabilities.length*12+Ge(`${e.displayName} ${e.name} ${e.description} ${e.category}`,w)}function Ct(e){const t=tt(e.name);return(e.isAccessible?1e4:0)+Ge(t,p)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+Ge(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,I)-e.catalogRank*.001}function St(e){return(e.authStatus==="oAuth"?180:0)+(e.authStatus==="bearerToken"?140:0)+Math.min(e.tools.length,50)*6+Math.min(e.resources.length+e.resourceTemplates.length,30)*3+Ge(e.name,L)}function ds(e,t){return t==="name"?[...e].sort((r,f)=>r.displayName.localeCompare(f.displayName)):t==="date"?[...e]:[...e].sort((r,f)=>wt(f)-wt(r)||r.displayName.localeCompare(f.displayName))}function ys(e,t){return t==="name"?[...e].sort((r,f)=>r.name.localeCompare(f.name)):t==="date"?[...e].sort((r,f)=>r.catalogRank-f.catalogRank):[...e].sort((r,f)=>Ct(f)-Ct(r)||r.name.localeCompare(f.name))}function vs(e,t){return[...e].sort((r,f)=>St(f)-St(r)||r.name.localeCompare(f.name))}function z(e,t="success"){h.value={text:e,type:t},j&&clearTimeout(j),j=setTimeout(()=>{h.value=null},3e3)}function je(e){return e?e.startsWith("connectors://")?`/codex-api/connector-logo?src=${encodeURIComponent(e)}`:/^https?:\/\//i.test(e)||e.startsWith("data:")?e:e.startsWith("/")?`/codex-local-image?path=${encodeURIComponent(e)}`:"":""}function He(e){return e?e.logoUrl||je(e.logoPath)||e.composerIconUrl||je(e.composerIconPath):""}function $t(e){return je(e.logoUrlDark||e.logoUrl)}function At(e){return e.activeCount>0?`${e.activeCount} connected ${e.activeCount===1?"account":"accounts"}`:e.isNoAuth?"No auth required":e.connectionStatuses.length>0?e.connectionStatuses.join(", "):e.authModes.join(", ")||"Connection required"}function ps(e){return e.isNoAuth||e.activeCount>0}function ze(e){return e.isNoAuth?"":e.activeCount>0?"Manage":e.totalConnections>0?"Reconnect":"Connect"}function hs(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"Active":t==="EXPIRED"?"Expired":t==="FAILED"?"Failed":t==="INITIATED"?"Pending":t||"Unknown"}function ms(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function gs(e){return`app:${e.id}:`}function fs(e){ge.value||K("try-item",{kind:"app",name:e.id,displayName:e.name})}function ks(e){return`plugin:${e.name}:`}function It(e){return`composio:${e}:`}function bs(e){ge.value||K("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function Pt(e){return ps(e)}function _s(e,t=[]){const r=t.find(B=>B.status==="ACTIVE"&&!B.isDisabled),f=r!=null&&r.wordId?` If there are multiple accounts, prefer \`${r.wordId}\`.`:"";return`Use the Composio CLI skill with the ${e.name} connector (${e.slug}). Start by listing what it can do here, mention the current connection status, and suggest one safe command I can run now.${f}`}function Lt(e,t=[]){ge.value||K("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:_s(e,t),attachedSkills:[{name:"composio-cli",path:Zn}]})}function oe(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function ws(e){const t=e.find(r=>r.needsAuth&&r.installUrl.trim().length>0);return t?(oe(t.installUrl),!0):!1}function Cs(e){return e.brandColor?{backgroundColor:e.brandColor,color:"#fff"}:{}}async function Ss(){try{D.value=new Set(await Hs())}catch{D.value=new Set}finally{Y.value=!0}}async function Pe(){var e;if(rt.value){ne.value=!0,we.value="";try{const t=(e=S.cwd)==null?void 0:e.trim(),[r]=await Promise.all([zs(t?[t]:void 0),Re.value?Fe():Promise.resolve()]);te.value=r}catch(t){we.value=t instanceof Error?t.message:"Failed to load plugins"}finally{ne.value=!1}}}async function Fe(){var e;if(Re.value){re.value=!0,Ce.value="";try{m.value=await Ks(((e=S.threadId)==null?void 0:e.trim())||void 0)}catch(t){Ce.value=t instanceof Error?t.message:"Failed to load apps"}finally{re.value=!1}}}async function fe(e=!1){if(ee.value){le=!0;return}ee.value=!0,Se.value="";try{const t=await Vs();if(g.value=t,!t.available||!t.authenticated){k.value=[],J.value=null,_.value=0;return}const r=e?J.value:null,f=await qs(q.value,r,Yn);k.value=e?[...k.value,...f.data]:f.data,J.value=f.nextCursor,_.value=f.total}catch(t){Se.value=t instanceof Error?t.message:"Failed to load Composio connectors",k.value=[],J.value=null,_.value=0}finally{ee.value=!1,le&&(le=!1,fe())}}async function $s(){!mt.value||ee.value||await fe(!0)}async function at(){if(Ze.value){ae.value=!0,$e.value="";try{M.value=await zt()}catch(e){$e.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{ae.value=!1}}}async function Et(){var e;if(!(!Ze.value||!((e=U.value)!=null&&e.mcpServers.length)))try{M.value=await zt()}catch{}}function Tt(e=!1){C.value==="plugins"&&Pe(),C.value==="apps"&&Fe(),C.value==="composio"&&fe(),C.value==="skills"&&(e&&ct.value?Ot():at())}async function As(){be.value=!0;try{C.value==="plugins"?await Pe():C.value==="apps"?await Fe():C.value==="composio"?await fe():C.value==="skills"&&ct.value?await Ot():C.value==="skills"&&await at()}finally{be.value=!1}}async function Ut(e){b.value=e,U.value=null,ce.value="",F.value=[],Ne.value=!0,De.value=!0;try{U.value=await Ws(e),b.value=U.value.summary,Re.value&&m.value.length===0&&await Fe(),await Et()}catch(t){ce.value=t instanceof Error?t.message:"Failed to load plugin"}finally{De.value=!1}}async function Nt(e){if(!ut.value)return!1;y.value=e;try{const t=await Qs(e);return t.authorizationUrl?(oe(t.authorizationUrl),!0):(z(`No login URL returned for ${e}`,"error"),!1)}catch(t){return z(t instanceof Error?t.message:`Failed to start login for ${e}`,"error"),!1}finally{y.value=""}}async function Is(e){await Et();const t=e.mcpServers.find(r=>_t(r));t&&await Nt(t)}function lt(){Ne.value=!1}async function Dt(e){ye.value=!0,Ae.value=!0,ve.value="",$.value=null;try{$.value=await Js(e)}catch(t){ve.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{Ae.value=!1}}function Ft(){ye.value=!1}async function Ps(e){var t;ue.value=e.slug;try{const r=await la(e.slug);if(!r.redirectUrl){z(`No login URL returned for ${e.name}`,"error");return}oe(r.redirectUrl),z(`Opened ${e.name} authorization`),await fe(),ye.value&&((t=$.value)==null?void 0:t.connector.slug)===e.slug&&await Dt(e.slug)}catch(r){z(r instanceof Error?r.message:`Failed to connect ${e.name}`,"error")}finally{ue.value=""}}async function Mt(e){var t;if(e.activeCount>0&&((t=g.value)!=null&&t.webUrl)){oe(g.value.webUrl);return}await Ps(e)}async function Ls(){he.value=!0;const e=window.open("about:blank","_blank");e&&(e.opener=null);try{const t=await Zs();t.loginUrl&&e?e.location.href=t.loginUrl:t.loginUrl?oe(t.loginUrl):e==null||e.close(),z("Composio CLI login started")}catch(t){e==null||e.close(),z(t instanceof Error?t.message:"Failed to start Composio login","error")}finally{he.value=!1}}async function Es(){pe.value=!0;try{await Ys(),z("Composio CLI installed"),await fe()}catch(e){z(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{pe.value=!1}}async function Ts(){if(b.value&&!Ye.value){Z.value=!0;try{const e=await Xs(b.value);F.value=e.appsNeedingAuth,z(`${b.value.displayName} plugin installed`);const t=ws(e.appsNeedingAuth);await Pe();const r=te.value.find(f=>{var B;return f.id===((B=b.value)==null?void 0:B.id)});r&&(await Ut(r),!t&&U.value&&await Is(U.value))}catch(e){z(e instanceof Error?e.message:"Failed to install plugin","error")}finally{Z.value=!1}}}async function Us(){if(b.value){Z.value=!0;try{const e=b.value.displayName;await ea(b.value.id),z(`${e} plugin uninstalled`),lt(),await Pe()}catch(e){z(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{Z.value=!1}}}async function Ns(){if(b.value){Z.value=!0;try{const e=!b.value.enabled;await ta(b.value.id,e),b.value={...b.value,enabled:e},U.value&&(U.value={...U.value,summary:{...U.value.summary,enabled:e}}),z(`${b.value.displayName} plugin ${e?"enabled":"disabled"}`),await Pe()}catch(e){z(e instanceof Error?e.message:"Failed to update plugin","error")}finally{Z.value=!1}}}async function Ds(e){Ie.value=e.id;try{const t=!e.isEnabled;await sa(e.id,t),m.value=m.value.map(r=>r.id===e.id?{...r,isEnabled:t}:r),z(`${e.name} app ${t?"enabled":"disabled"}`)}catch(t){z(t instanceof Error?t.message:"Failed to update app","error")}finally{Ie.value=""}}async function Ot(){Ue.value=!0;try{await aa(),await at(),z("MCP servers reloaded")}catch(e){z(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{Ue.value=!1}}function Fs(e){const t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}return Ee(C,e=>{E.name==="skills"&&E.query.tab!==e&&Q.replace({name:"skills",query:{...E.query,tab:e}}),Tt()}),Ee(()=>E.query.tab,()=>{if(E.name!=="skills")return;const e=R();C.value!==e&&(C.value=e)}),Ee(q,()=>{C.value==="composio"&&(k.value=[],J.value=null,_.value=0,me&&clearTimeout(me),me=setTimeout(()=>{fe()},250))}),Ee(()=>S.cwd,()=>{C.value==="plugins"&&Pe()}),Ee(()=>S.threadId,()=>{(C.value==="apps"||C.value==="plugins")&&Fe()}),Wt(async()=>{await Ss(),Tt()}),(e,t)=>{var r,f,B,de,ke,Ke,xt,Rt,Bt,Gt;return a(),l("div",Nl,[s("div",Dl,[s("div",null,[t[20]||(t[20]=s("h2",{class:"directory-title"},"Skills & Apps",-1)),s("p",Fl,i(xe.value.subtitle),1)]),s("div",Ml,[s("button",{class:"directory-refresh",type:"button",disabled:be.value,onClick:As},i(be.value?"Refreshing...":"Refresh"),9,Ol)])]),s("div",xl,[(a(),l(H,null,W(x,o=>s("button",{key:o.id,class:G(["directory-tab",{"is-active":C.value===o.id}]),type:"button",role:"tab","aria-selected":C.value===o.id,onClick:T=>C.value=o.id},i(o.label),11,Rl)),64))]),h.value?(a(),l("div",{key:0,class:G(["directory-toast",{"is-error":h.value.type==="error"}])},i(h.value.text),3)):c("",!0),C.value==="plugins"?(a(),l("section",Bl,[s("div",Gl,[Ve(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>ie.value=o),class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins"},null,512),[[qe,ie.value]]),s("div",jl,[s("button",{class:G(["directory-sort-button",{"is-active":O.value==="popular"}]),type:"button",onClick:t[1]||(t[1]=o=>O.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":O.value==="name"}]),type:"button",onClick:t[2]||(t[2]=o=>O.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":O.value==="date"}]),type:"button",onClick:t[3]||(t[3]=o=>O.value="date")}," Date ",2)])]),rt.value?we.value?(a(),l("div",zl,i(we.value),1)):ne.value?(a(),l("div",Kl,"Loading plugins...")):vt.value.length===0?(a(),l("div",Vl,"No plugins found.")):(a(),l("div",ql,[(a(!0),l(H,null,W(vt.value,o=>(a(),l("button",{key:o.id,class:G(["directory-card",{"is-disabled":o.installed&&!o.enabled}]),type:"button",onClick:T=>Ut(o)},[s("div",Ql,[He(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:He(o),alt:o.displayName,loading:"lazy"},null,8,Jl)):(a(),l("div",{key:1,class:"directory-card-fallback",style:Gs(Cs(o))},i(o.displayName.charAt(0)),5)),s("div",Zl,[s("div",Yl,[s("span",Xl,i(o.displayName),1),o.installed&&!o.enabled?(a(),l("span",eo,"Disabled")):o.installed?(a(),l("span",to,"Installed")):c("",!0)]),s("span",so,i(o.developerName||o.marketplaceDisplayName||o.marketplaceName||"Plugin"),1)])]),o.description?(a(),l("p",ao,i(o.description),1)):c("",!0),s("div",lo,[o.category?(a(),l("span",oo,i(o.category),1)):c("",!0),(a(!0),l(H,null,W(o.capabilities.slice(0,2),T=>(a(),l("span",{key:T,class:"directory-chip"},i(T),1))),128))])],10,Wl))),128))])):(a(),l("div",Hl," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))])):C.value==="apps"?(a(),l("section",io,[s("div",no,[Ve(s("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>se.value=o),class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps"},null,512),[[qe,se.value]]),s("div",ro,[s("button",{class:G(["directory-sort-button",{"is-active":V.value==="popular"}]),type:"button",onClick:t[5]||(t[5]=o=>V.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":V.value==="name"}]),type:"button",onClick:t[6]||(t[6]=o=>V.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":V.value==="date"}]),type:"button",onClick:t[7]||(t[7]=o=>V.value="date")}," Date ",2)])]),Re.value?Ce.value?(a(),l("div",uo,i(Ce.value),1)):re.value?(a(),l("div",yo,"Loading apps...")):pt.value.length===0?(a(),l("div",vo,"No apps found.")):(a(),l("div",po,[(a(!0),l(H,null,W(pt.value,o=>(a(),l("article",{key:o.id,class:"directory-card"},[s("div",ho,[$t(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:$t(o),alt:o.name,loading:"lazy"},null,8,mo)):(a(),l("div",go,i(o.name.charAt(0)),1)),s("div",fo,[s("div",ko,[s("span",bo,i(o.name),1),o.isEnabled?o.isAccessible?(a(),l("span",wo,"Connected")):c("",!0):(a(),l("span",_o,"Disabled"))]),s("span",Co,i(as(o)),1)])]),o.description?(a(),l("p",So,i(o.description),1)):c("",!0),s("div",$o,[o.category?(a(),l("span",Ao,i(o.category),1)):c("",!0),(a(!0),l(H,null,W(o.pluginDisplayNames.slice(0,2),T=>(a(),l("span",{key:T,class:"directory-chip"},i(T),1))),128))]),s("div",Io,[s("button",{class:"directory-action",type:"button",disabled:Ie.value===o.id,onClick:T=>Ds(o)},i(o.isEnabled?"Disable":"Enable"),9,Po),o.installUrl?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:T=>oe(o.installUrl)},i(o.isAccessible?"Manage":"Login"),9,Lo)):c("",!0),o.isAccessible&&o.isEnabled?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ge.value,onClick:T=>fs(o)},i(S.tryInFlightKey===gs(o)?"Starting...":"Try it!"),9,Eo)):c("",!0)])]))),128))])):(a(),l("div",co," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))])):C.value==="composio"?(a(),l("section",To,[s("div",Uo,[Ve(s("input",{"onUpdate:modelValue":t[8]||(t[8]=o=>q.value=o),class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors"},null,512),[[qe,q.value]]),s("div",No,[s("button",{class:G(["directory-sort-button",{"is-active":X.value==="popular"}]),type:"button",onClick:t[9]||(t[9]=o=>X.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":X.value==="name"}]),type:"button",onClick:t[10]||(t[10]=o=>X.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":X.value==="date"}]),type:"button",onClick:t[11]||(t[11]=o=>X.value="date")}," Date ",2)])]),Se.value?(a(),l("div",Do,i(Se.value),1)):ee.value?(a(),l("div",Fo,"Loading Composio connectors...")):(r=g.value)!=null&&r.available?g.value.authenticated?(a(),l("div",zo,[s("article",Ko,[s("div",Vo,[t[24]||(t[24]=s("div",{class:"directory-card-fallback composio-fallback"},"C",-1)),s("div",qo,[t[23]||(t[23]=s("div",{class:"directory-card-title-row"},[s("span",{class:"directory-card-title"},"Composio workspace"),s("span",{class:"directory-badge"},"Connected")],-1)),s("span",Wo,i(g.value.email||g.value.defaultOrgName||"Authenticated"),1)])]),s("p",Qo,i(Yt.value),1),s("div",Jo,[g.value.defaultOrgName?(a(),l("span",Zo,i(g.value.defaultOrgName),1)):c("",!0),g.value.cliVersion?(a(),l("span",Yo,"CLI "+i(g.value.cliVersion),1)):c("",!0),k.value.length?(a(),l("span",Xo," Showing "+i(k.value.length)+i(_.value?` / ${_.value}`:"")+" connectors ",1)):c("",!0)]),s("div",ei,[s("button",{class:"directory-action-link",type:"button",onClick:t[12]||(t[12]=o=>oe(g.value.webUrl))}," Open dashboard ")])]),ht.value.length===0?(a(),l("div",ti,"No Composio connectors found.")):(a(),l("div",si,[(a(!0),l(H,null,W(ht.value,o=>(a(),l("article",{key:o.slug,class:"directory-card"},[s("div",ai,[o.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:o.logoUrl,alt:o.name,loading:"lazy"},null,8,li)):(a(),l("div",oi,i(o.name.charAt(0)),1)),s("div",ii,[s("div",ni,[s("span",ri,i(o.name),1),o.activeCount>0?(a(),l("span",ci,"Connected")):o.isNoAuth?(a(),l("span",ui,"No auth")):c("",!0)]),s("span",di,i(At(o)),1)])]),o.description?(a(),l("p",yi,i(o.description),1)):c("",!0),s("div",vi,[s("span",pi,i(o.toolsCount)+" tools",1),o.triggersCount>0?(a(),l("span",hi,i(o.triggersCount)+" triggers",1)):c("",!0),o.authModes.length>0?(a(),l("span",mi,i(o.authModes.join(", ")),1)):c("",!0)]),s("div",gi,[s("button",{class:"directory-action",type:"button",onClick:T=>Dt(o.slug)}," Details ",8,fi),ze(o)?(a(),l("button",{key:0,class:"directory-action-link",type:"button",disabled:ue.value===o.slug,onClick:T=>Mt(o)},i(ue.value===o.slug?"Opening...":ze(o)),9,ki)):c("",!0),Pt(o)?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:ge.value,onClick:T=>Lt(o)},i(S.tryInFlightKey===It(o.slug)?"Starting...":"Try it!"),9,bi)):c("",!0)])]))),128))])),mt.value?(a(),l("div",_i,[s("button",{class:"directory-action",type:"button",disabled:ee.value,onClick:$s},i(ee.value?"Loading...":"Load more"),9,wi)])):c("",!0)])):(a(),l("div",Bo,[s("div",Go,[t[22]||(t[22]=s("p",{class:"directory-empty-text"},"Composio is available but not logged in.",-1)),s("div",jo,[s("button",{class:"directory-action primary",type:"button",disabled:he.value,onClick:Ls},i(he.value?"Opening...":"Login"),9,Ho)])])])):(a(),l("div",Mo,[s("div",Oo,[t[21]||(t[21]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",xo,[s("button",{class:"directory-action primary",type:"button",disabled:pe.value,onClick:Es},i(pe.value?"Installing...":"Install Composio"),9,Ro)])])]))])):C.value==="skills"?(a(),l("section",Ci,[Te(Ul,{"try-in-flight-key":S.tryInFlightKey,onSkillsChanged:t[14]||(t[14]=o=>K("skills-changed")),onTryItem:t[15]||(t[15]=o=>K("try-item",o))},{"before-installed":js(()=>[s("div",Si,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:t[13]||(t[13]=o=>_e.value=!_e.value)},[s("span",$i,"MCPs("+i(Xe.value.length)+")",1),s("span",{class:G(["skills-embedded-chevron",{"is-open":_e.value}])},"›",2)]),_e.value?(a(),l("div",Ai,[Ze.value?$e.value?(a(),l("div",Pi,i($e.value),1)):ae.value?(a(),l("div",Li,"Loading MCP servers...")):Xe.value.length===0?(a(),l("div",Ei,"No MCP servers configured.")):(a(),l("div",Ti,[(a(!0),l(H,null,W(Xe.value,o=>(a(),l("article",{key:o.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:T=>Fs(o.name)},[s("div",Ni,[s("div",Di,i(o.name.charAt(0)),1),s("div",Fi,[s("div",Mi,[s("span",Oi,i(o.name),1),s("span",{class:G(["mcp-skill-badge",os(o.authStatus)])},i(bt(o.name)),3)]),t[25]||(t[25]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:G(["mcp-skill-chevron",{"is-open":v.value.has(o.name)}])},"›",2)]),s("p",xi,i(o.tools.length)+" tools · "+i(o.resources.length+o.resourceTemplates.length)+" resources",1),v.value.has(o.name)?(a(),l("div",Ri,[o.tools.length>0?(a(),l("div",Bi,[t[26]||(t[26]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",Gi,i(o.tools.map(T=>T.title||T.name).join(", ")),1)])):c("",!0),o.resources.length>0||o.resourceTemplates.length>0?(a(),l("div",ji,[t[27]||(t[27]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",Hi,i([...o.resources.map(T=>T.title||T.name||T.uri),...o.resourceTemplates.map(T=>T.title||T.name||T.uriTemplate)].join(", ")),1)])):c("",!0)])):c("",!0)],8,Ui)]))),128))])):(a(),l("div",Ii," MCP status APIs unavailable in this Codex CLI. Update Codex CLI to inspect MCP servers. "))])):c("",!0)])]),_:1},8,["try-in-flight-key"])])):c("",!0),(a(),Oe(it,{to:"body"},[Ne.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Me(lt,["self"])},[s("article",zi,[s("div",Ki,[s("div",Vi,[b.value&&He(b.value)?(a(),l("img",{key:0,class:"directory-card-icon",src:He(b.value),alt:b.value.displayName,loading:"lazy"},null,8,qi)):(a(),l("div",Wi,i((f=b.value)==null?void 0:f.displayName.charAt(0)),1)),s("div",Qi,[s("h3",Ji,i(((B=b.value)==null?void 0:B.displayName)||"Plugin"),1),s("span",Zi,i(((de=b.value)==null?void 0:de.developerName)||((ke=b.value)==null?void 0:ke.marketplaceDisplayName)||((Ke=b.value)==null?void 0:Ke.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close plugin detail",onClick:lt},"Close")]),s("div",Yi,[ce.value?(a(),l("div",Xi,i(ce.value),1)):De.value?(a(),l("div",en,"Loading plugin...")):U.value?(a(),l(H,{key:2},[dt.value?(a(),l("p",tn,i(dt.value),1)):c("",!0),U.value.summary.capabilities.length>0?(a(),l("div",sn,[t[28]||(t[28]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",an,[(a(!0),l(H,null,W(U.value.summary.capabilities,o=>(a(),l("span",{key:o,class:"directory-chip"},i(o),1))),128))])])):c("",!0),s("div",ln,[U.value.apps.length>0?(a(),l("div",on,[t[29]||(t[29]=s("h4",{class:"directory-detail-heading"},"Apps",-1)),(a(!0),l(H,null,W(U.value.apps,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,i(o.name),1),ft(o)?(a(),l("span",nn,"GPT Plus account required")):o.installUrl?(a(),l("button",{key:1,type:"button",onClick:T=>oe(o.installUrl)},i(o.needsAuth?"Login":"Manage"),9,rn)):c("",!0)]))),128))])):c("",!0),U.value.skills.length>0?(a(),l("div",cn,[t[30]||(t[30]=s("h4",{class:"directory-detail-heading"},"Skills",-1)),s("p",un,i(U.value.skills.map(o=>o.displayName||o.name).join(", ")),1)])):c("",!0),U.value.mcpServers.length>0?(a(),l("div",dn,[t[31]||(t[31]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(a(!0),l(H,null,W(U.value.mcpServers,o=>(a(),l("div",{key:o,class:"directory-include-row"},[s("span",null,[We(i(o)+" ",1),s("span",{class:G(["directory-auth-status",ls(o)])},i(bt(o)),3)]),_t(o)?(a(),l("button",{key:0,type:"button",disabled:y.value===o,onClick:T=>Nt(o)},i(y.value===o?"Opening...":"Authenticate"),9,yn)):c("",!0)]))),128))])):c("",!0)]),yt.value.length>0?(a(),l("div",vn,[(a(!0),l(H,null,W(yt.value,o=>(a(),l("img",{key:o,src:o,alt:"",loading:"lazy"},null,8,pn))),128))])):c("",!0),F.value.length>0?(a(),l("div",hn,[t[32]||(t[32]=s("strong",null,"Apps needing auth",-1)),(a(!0),l(H,null,W(F.value,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,i(o.name),1),o.installUrl?(a(),l("button",{key:0,type:"button",onClick:T=>oe(o.installUrl)},"Login",8,mn)):c("",!0)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",gn,[b.value&&b.value.installed?(a(),l("button",{key:0,class:"directory-action danger",type:"button",disabled:Z.value,onClick:Us},i(Z.value?"Uninstalling...":"Uninstall"),9,fn)):b.value&&!Jt.value?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:Z.value||b.value.installPolicy==="NOT_AVAILABLE"||Ye.value,onClick:Ts},i(Ye.value?"ChatGPT Plus":Z.value?"Installing...":"Install"),9,kn)):b.value?(a(),l("button",bn," GPT Plus account required ")):c("",!0),b.value&&b.value.installed?(a(),l("button",{key:3,class:"directory-action",type:"button",disabled:Z.value,onClick:Ns},i(b.value.enabled?"Disable":"Enable"),9,_n)):c("",!0),b.value&&b.value.installed&&b.value.enabled?(a(),l("button",{key:4,class:"directory-action primary",type:"button",disabled:Z.value||ge.value,onClick:t[16]||(t[16]=o=>bs(b.value))},i(S.tryInFlightKey===ks(b.value)?"Starting...":"Try it!"),9,wn)):c("",!0)])])])):c("",!0)])),(a(),Oe(it,{to:"body"},[ye.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Me(Ft,["self"])},[s("article",Cn,[s("div",Sn,[s("div",$n,[(xt=$.value)!=null&&xt.connector.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:$.value.connector.logoUrl,alt:$.value.connector.name,loading:"lazy"},null,8,An)):(a(),l("div",In,i((Rt=$.value)==null?void 0:Rt.connector.name.charAt(0)),1)),s("div",Pn,[s("h3",Ln,i(((Bt=$.value)==null?void 0:Bt.connector.name)||"Composio"),1),s("span",En,i($.value?At($.value.connector):"Connector"),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close Composio detail",onClick:Ft},"Close")]),s("div",Tn,[ve.value?(a(),l("div",Un,i(ve.value),1)):Ae.value?(a(),l("div",Nn,"Loading connector...")):$.value?(a(),l(H,{key:2},[$.value.connector.description?(a(),l("p",Dn,i($.value.connector.description),1)):c("",!0),s("div",Fn,[s("div",Mn,[t[33]||(t[33]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",On,[s("span",xn,i($.value.connector.toolsCount)+" tools",1),$.value.connector.triggersCount>0?(a(),l("span",Rn,i($.value.connector.triggersCount)+" triggers",1)):c("",!0),$.value.connector.latestVersion?(a(),l("span",Bn,"v"+i($.value.connector.latestVersion),1)):c("",!0),$.value.connector.authModes.length>0?(a(),l("span",Gn,i($.value.connector.authModes.join(", ")),1)):c("",!0)])]),s("div",jn,[t[34]||(t[34]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),$.value.connections.length===0?(a(),l("div",Hn," No linked accounts yet. ")):(a(),l("div",zn,[(a(!0),l(H,null,W($.value.connections,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,[We(i(o.alias||o.wordId||o.id)+" ",1),s("span",{class:G(["directory-auth-status",ms(o.status)])},i(hs(o.status)),3)]),s("span",Kn,i(o.authScheme||"Auth"),1)]))),128))]))])]),$.value.tools.length>0?(a(),l("div",Vn,[t[35]||(t[35]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(a(!0),l(H,null,W($.value.tools.slice(0,8),o=>(a(),l("div",{key:o.slug,class:"directory-include-row"},[s("span",null,i(o.name||o.slug),1),s("span",qn,i(o.slug),1)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",Wn,[$.value?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:t[17]||(t[17]=o=>oe($.value.dashboardUrl))}," Open dashboard ")):c("",!0),$.value&&ze($.value.connector)?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ue.value===$.value.connector.slug,onClick:t[18]||(t[18]=o=>Mt($.value.connector))},i(ue.value===((Gt=$.value)==null?void 0:Gt.connector.slug)?"Opening...":ze($.value.connector)),9,Qn)):c("",!0),$.value&&Pt($.value.connector)?(a(),l("button",{key:2,class:"directory-action primary",type:"button",disabled:ge.value,onClick:t[19]||(t[19]=o=>Lt($.value.connector,$.value.connections))},i(S.tryInFlightKey===It($.value.connector.slug)?"Starting...":"Try it!"),9,Jn)):c("",!0)])])])):c("",!0)]))])}}}),tr=Je(Xn,[["__scopeId","data-v-1c687405"]]);export{tr as default};
|
|
2
|
+
import{d as Qe,o as a,c as l,g as G,a as s,t as i,F as H,q as n,f as c,m as Me,i as Te,R as Ms,r as W,J as nt,y as A,_ as Je,w as Ee,A as Oe,l as Os,S as it,x as d,z as jt,b as Wt,s as We,U as Ve,V as qe,W as Ht,X as xs,Y as Rs,Z as Bs,p as Gs,v as js,$ as Hs,a0 as zs,a1 as Ks,a2 as Vs,a3 as qs,a4 as Ws,a5 as Qs,a6 as Js,a7 as Zs,a8 as Ys,a9 as Xs,aa as ea,ab as ta,ac as sa,ad as aa,ae as zt,af as la}from"./index-7uudGTMH.js";const oa=[[/(gmail|google calendar|google docs|google sheets|google drive|github|slack|notion|linear|outlook|supabase)/i,140],[/(email|calendar|document|sheet|drive|repo|issue|message|project|database|crm|deploy)/i,50]];function Qt(u){return u.trim().toLowerCase()}function ia(u,N){return N.reduce((p,[I,w])=>p+(I.test(u)?w:0),0)}function Kt(u){return u.activeCount*1e3+(u.isNoAuth?300:0)+u.toolsCount*3+u.triggersCount*4+ia(`${u.name} ${u.slug} ${u.description}`,oa)}function na(u,N){const p=Qt(N);if(!p)return 0;const I=u.name.toLowerCase(),w=u.slug.toLowerCase();return I===p||w===p?1e6:I.replace(/\s+/gu,"")===p.replace(/\s+/gu,"")?9e5:I.startsWith(p)||w.startsWith(p)?8e5:I.includes(p)||w.includes(p)?7e5:0}function Le(u){return u.activeCount>0?0:u.totalConnections>0?1:u.isNoAuth?2:3}function ra(u,N,p=""){const I=Qt(p),w=L=>na(L,I);return N==="name"?[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||L.name.localeCompare(S.name)):N==="date"?[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||L.name.localeCompare(S.name)):[...u].sort((L,S)=>w(S)-w(L)||Le(L)-Le(S)||Kt(S)-Kt(L)||L.name.localeCompare(S.name))}const ca={class:"skill-card-top"},ua=["src","alt"],da={key:1,class:"skill-card-avatar-fallback"},ya={class:"skill-card-info"},va={class:"skill-card-header"},pa={class:"skill-card-name"},ha={key:0,class:"skill-card-badge-disabled"},ma={key:1,class:"skill-card-badge"},ga={key:0,class:"skill-card-owner"},fa=["title"],ka={key:0,class:"skill-card-desc"},ba={key:1,class:"skill-card-meta-row"},_a=Qe({__name:"SkillCard",props:{skill:{},showStatusBadge:{type:Boolean,default:!0},showBrowseAction:{type:Boolean,default:!0},showOwner:{type:Boolean,default:!0}},emits:["select"],setup(u){const N=u,{t:p}=nt(),I=A(()=>N.showStatusBadge!==!1),w=A(()=>N.showBrowseAction!==!1),L=A(()=>N.showOwner!==!1),S=A(()=>{const P=N.skill.path;return P?P.endsWith("/SKILL.md")?P.slice(0,-9):P:""});function K(){const P=S.value;P&&window.open(`/codex-local-browse${encodeURI(P)}`,"_blank","noopener,noreferrer")}const E=A(()=>{const P=N.skill.publishedAt;if(!P)return"";const R=new Date(P),D=Date.now()-P;return D<36e5?`${Math.floor(D/6e4)}m ago`:D<864e5?`${Math.floor(D/36e5)}h ago`:D<2592e6?`${Math.floor(D/864e5)}d ago`:R.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),Q=A(()=>{const P=[];return N.skill.installCountLabel&&P.push(N.skill.installCountLabel),E.value&&P.push(E.value),P});function x(P){const R=P.target;R.style.display="none"}return(P,R)=>(a(),l("button",{class:G(["skill-card",{"is-disabled":u.skill.installed&&u.skill.enabled===!1}]),type:"button",onClick:R[0]||(R[0]=C=>P.$emit("select",u.skill))},[s("div",ca,[u.skill.avatarUrl?(a(),l("img",{key:0,class:"skill-card-avatar",src:u.skill.avatarUrl,alt:u.skill.owner,loading:"lazy",onError:x},null,40,ua)):(a(),l("div",da,i(u.skill.owner.charAt(0)),1)),s("div",ya,[s("div",va,[s("span",pa,i(u.skill.displayName||u.skill.name),1),I.value?(a(),l(H,{key:0},[u.skill.installed&&u.skill.enabled===!1?(a(),l("span",ha,i(n(p)("Disabled")),1)):u.skill.installed?(a(),l("span",ma,i(n(p)("Installed")),1)):c("",!0)],64)):c("",!0)]),L.value?(a(),l("span",ga,i(u.skill.owner),1)):c("",!0)]),w.value&&u.skill.installed&&S.value?(a(),l("button",{key:2,class:"skill-card-browse",type:"button",title:n(p)("Browse files"),onClick:Me(K,["stop"])},[Te(Ms,{class:"skill-card-browse-icon"})],8,fa)):c("",!0)]),u.skill.description?(a(),l("p",ka,i(u.skill.description),1)):c("",!0),Q.value.length>0?(a(),l("div",ba,[(a(!0),l(H,null,W(Q.value,C=>(a(),l("span",{key:C,class:"skill-card-meta"},i(C),1))),128))])):c("",!0)],2))}}),Vt=Je(_a,[["__scopeId","data-v-76c12421"]]),wa={class:"sdm-panel"},Ca={class:"sdm-header"},Sa={class:"sdm-title-area"},$a=["src","alt"],Aa={class:"sdm-title-col"},Ia={class:"sdm-title-row"},Pa={class:"sdm-title"},La={key:0,class:"sdm-badge-disabled"},Ea={class:"sdm-owner"},Ta=["aria-label"],Ua={class:"sdm-body"},Na={key:0,class:"sdm-desc"},Da={key:1,class:"sdm-readme-loading"},Fa=["innerHTML"],Ma=["href"],Oa={class:"sdm-footer"},xa={class:"sdm-footer-actions"},Ra=["disabled"],Ba=["disabled"],Ga=["disabled"],ja=["disabled"],Ha=Qe({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(u,{emit:N}){const p=u,I=N,w=d(null),L=d(""),S=d(""),K=d(!1),{t:E}=nt(),Q=A(()=>w.value??p.skill.enabled??!0),x=A(()=>p.isInstalling===!0||p.isUninstalling===!0),P=A(()=>L.value||p.skill.description),R=A(()=>{const _=p.skill.path;return _?_.endsWith("/SKILL.md")?_.slice(0,-9):_:""}),C=A(()=>{const _=S.value;if(!_)return"";const M=_.replace(/^---[\s\S]*?---\s*/,"");return D(M)});function D(_){return _.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function Y(){if(!(!p.skill.owner||!p.skill.name)){K.value=!0,L.value="",S.value="";try{const _=new URLSearchParams({owner:p.skill.owner,name:p.skill.name});p.skill.installed&&_.set("installed","true"),p.skill.path&&_.set("path",p.skill.path);const M=await fetch(`/codex-api/skills-hub/readme?${_}`);if(!M.ok)return;const O=await M.json();S.value=O.content??"",L.value=O.description??""}catch{}finally{K.value=!1}}}Ee(()=>p.visible,_=>{_&&(w.value=null,L.value="",S.value="",Y())});function te(){I("install",p.skill)}function m(){I("uninstall",p.skill)}function g(){const _=!Q.value;w.value=_,I("toggle-enabled",p.skill,_)}function k(){p.isTrying||I("try",p.skill)}function J(){const _=R.value;_&&window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}return(_,M)=>(a(),Oe(it,{to:"body"},[u.visible?(a(),l("div",{key:0,class:"sdm-overlay",onClick:M[1]||(M[1]=Me(O=>_.$emit("close"),["self"]))},[s("div",wa,[s("div",Ca,[s("div",Sa,[u.skill.avatarUrl?(a(),l("img",{key:0,class:"sdm-avatar",src:u.skill.avatarUrl,alt:u.skill.owner,loading:"lazy"},null,8,$a)):c("",!0),s("div",Aa,[s("div",Ia,[s("h3",Pa,i(u.skill.displayName||u.skill.name),1),u.skill.installed&&!Q.value?(a(),l("span",La,i(n(E)("Disabled")),1)):c("",!0)]),s("span",Ea,i(u.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":n(E)("Close"),onClick:M[0]||(M[0]=O=>_.$emit("close"))},[Te(Os,{class:"sdm-close-icon"})],8,Ta)]),s("div",Ua,[P.value?(a(),l("p",Na,i(P.value),1)):c("",!0),K.value?(a(),l("div",Da,i(n(E)("Loading skill contents...")),1)):S.value?(a(),l("div",{key:2,class:"sdm-readme",innerHTML:C.value},null,8,Fa)):c("",!0),u.skill.url?(a(),l("a",{key:3,class:"sdm-link",href:u.skill.url,target:"_blank",rel:"noopener noreferrer"},i(n(E)("View on GitHub")),9,Ma)):c("",!0)]),s("div",Oa,[s("div",xa,[u.skill.installed?(a(),l("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:x.value,onClick:m},i(p.isUninstalling?n(E)("Uninstalling..."):n(E)("Uninstall")),9,Ra)):(a(),l("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:x.value,onClick:te},i(p.isInstalling?n(E)("Installing..."):n(E)("Install")),9,Ba)),u.skill.installed?(a(),l("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:x.value,onClick:g},i(Q.value?n(E)("Disable"):n(E)("Enable")),9,Ga)):c("",!0),u.skill.installed&&Q.value?(a(),l("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:x.value||p.isTrying,onClick:k},i(p.isTrying?"Starting...":"Try it!"),9,ja)):c("",!0),u.skill.installed&&R.value?(a(),l("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:J},i(n(E)("Browse files")),1)):c("",!0)])])])])):c("",!0)]))}}),za=Je(Ha,[["__scopeId","data-v-8ab621f9"]]),Ka={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};let ot=null;function Va(){return ot||(ot=Promise.all([jt(()=>import("./index.esm-D7eMWmxV.js"),__vite__mapDeps([0,1])),jt(()=>import("./index.esm-Bh22Jgzp.js"),__vite__mapDeps([2,1]))])),ot}function qa(u){const N=d(null),p=d(""),I=d(""),w=d(""),L=d({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),S=A(()=>w.value==="pull"),K=A(()=>w.value==="push"),E=A(()=>w.value==="startup-sync"),Q=A(()=>w.value!=="");async function x(){try{const m=await fetch("/codex-api/skills-sync/status");if(!m.ok)return;const g=await m.json();g.data&&(L.value=g.data)}catch{}}async function P(){try{const m=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),g=await m.json();if(!m.ok||!g.data)throw new Error("Failed to start GitHub login");N.value=g.data;const k=30,J=Math.max((g.data.interval??5)*1e3,3e3);let _=!1;for(let M=0;M<k;M++){await new Promise(X=>setTimeout(X,J));const O=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:g.data.device_code})}),V=await O.json();if(!O.ok)throw new Error(V.error||"Failed to complete GitHub login");if(V.ok){_=!0;break}if(!V.pending)throw new Error(V.error||"Failed to complete GitHub login")}if(!_)throw new Error("GitHub login timed out. Please retry.");N.value=null,await x(),u.showToast("GitHub login successful")}catch(m){u.showToast(m instanceof Error?m.message:"Failed GitHub login","error")}}async function R(){try{const[m,g]=await Va(),{getApp:k,getApps:J,initializeApp:_}=m,{getAuth:M,GithubAuthProvider:O,signInWithPopup:V}=g,X=J().length>0?k():_(Ka),ie=M(X),se=new O;se.addScope("repo");const q=await V(ie,se),ne=O.credentialFromResult(q),re=(ne==null?void 0:ne.accessToken)??"";if(!re)throw new Error("GitHub access token missing from Firebase login");const ee=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:re})}),ae=await ee.json();if(!ee.ok||!ae.ok)throw new Error(ae.error||"Failed to login with GitHub token");await x(),u.showToast("GitHub login successful")}catch(m){const g=m instanceof Error?m.message:"Failed Firebase GitHub login";u.showToast(g,"error")}}async function C(){I.value="",p.value="pull-started",w.value="pull";try{const m=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to pull synced skills");await u.onPulled(),p.value="pull-success",u.showToast(L.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(m){const g=m instanceof Error?m.message:"Failed to pull sync";I.value=g,p.value="pull-failed",u.showToast(g,"error")}finally{w.value=""}}async function D(){I.value="",p.value="push-started",w.value="push";try{const m=await fetch("/codex-api/skills-sync/push",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to push synced skills");p.value="push-success",u.showToast("Pushed skills to private sync repo")}catch(m){const g=m instanceof Error?m.message:"Failed to push sync";I.value=g,p.value="push-failed",u.showToast(g,"error")}finally{w.value=""}}async function Y(){I.value="",p.value="startup-sync-started",w.value="startup-sync";try{const m=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to run startup sync");await u.onPulled(),await x(),p.value="startup-sync-success",u.showToast("Startup sync completed")}catch(m){const g=m instanceof Error?m.message:"Failed startup sync";I.value=g,p.value="startup-sync-failed",u.showToast(g,"error")}finally{w.value=""}}async function te(){try{const m=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),g=await m.json();if(!m.ok||!g.ok)throw new Error(g.error||"Failed to logout GitHub");await x(),u.showToast("Logged out from GitHub")}catch(m){u.showToast(m instanceof Error?m.message:"Failed to logout GitHub","error")}}return{deviceLogin:N,isPullInFlight:S,isPushInFlight:K,isStartupSyncInFlight:E,isSyncActionInFlight:Q,loadSyncStatus:x,logoutGithub:te,pullSkillsSync:C,pushSkillsSync:D,startupSkillsSync:Y,startGithubFirebaseLogin:R,startGithubLogin:P,syncActionError:I,syncActionStatus:p,syncStatus:L}}const Wa={class:"skills-hub"},Qa={class:"skills-hub-header"},Ja={class:"skills-hub-title"},Za={class:"skills-hub-subtitle"},Ya={class:"skills-sync-panel"},Xa={class:"skills-sync-header"},el=["href"],tl={key:1,class:"skills-sync-badge"},sl={key:2,class:"skills-sync-badge"},al={class:"skills-sync-meta"},ll={key:0,class:"skills-sync-error"},ol={key:1,class:"skills-sync-meta"},il={key:2,class:"skills-sync-error"},nl={key:3,class:"skills-sync-device"},rl=["href"],cl={class:"skills-sync-actions"},ul=["disabled"],dl=["disabled"],yl=["disabled"],vl=["disabled"],pl={class:"skills-search-panel"},hl={class:"skills-search-header"},ml={class:"skills-search-copy"},gl={class:"skills-directory-link",href:"https://skills.anyclaw.store/",target:"_blank",rel:"noopener noreferrer"},fl=["placeholder"],kl=["disabled"],bl={key:0,class:"skills-hub-error"},_l={key:1,class:"skills-hub-section"},wl={class:"skills-hub-section-title"},Cl={key:0,class:"skills-hub-grid"},Sl={key:2,class:"skills-hub-section"},$l={class:"skills-hub-section-title"},Al={key:0,class:"skills-hub-grid"},Il={class:"skills-hub-section"},Pl={key:0,class:"skills-hub-loading"},Ll={key:1,class:"skills-hub-error"},El={key:2,class:"skills-hub-empty"},Tl=Qe({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(u,{emit:N}){const p={name:"",owner:"",description:"",url:"",installed:!1},I=d([]),w=d([]),L=d(!1),S=d(!1),K=d(""),E=d(""),Q=d(""),x=d(!0),P=d(!0),R=d(!1),C=d(p),D=d(null),Y=d(""),te=d(!1),m=d(!1);let g=null;const{t:k}=nt(),J=u,_=N,M=A(()=>{var y;return((y=D.value)==null?void 0:y.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),O=A(()=>`${C.value.owner}/${C.value.name}`),V=A(()=>te.value&&Y.value===O.value),X=A(()=>m.value&&Y.value===O.value),ie=A(()=>{if(!F.value.configured)return"";const y=F.value.repoOwner.trim(),v=F.value.repoName.trim();return!y||!v?"":`https://github.com/${encodeURIComponent(y)}/${encodeURIComponent(v)}`}),se=A(()=>I.value);function q(y,v="success"){D.value={text:y,type:v},g&&clearTimeout(g),g=setTimeout(()=>{D.value=null},3e3)}function ne(y){if(I.value=y.installed??[],w.value.length>0){const v=new Map(I.value.map(h=>[h.name,h]));w.value=w.value.map(h=>{const j=v.get(h.name);return j?re(h,j):h})}}function re(y,v){return{...y,installed:!0,path:v.path,enabled:v.enabled}}function ee(y,v){return{...y,installed:!0,source:v.source,publishedAt:v.publishedAt}}async function ae(){L.value=!0,K.value="";try{const y=await fetch("/codex-api/skills-hub");if(!y.ok)throw new Error(`HTTP ${y.status}`);const v=await y.json();ne(v)}catch(y){K.value=y instanceof Error?y.message:"Failed to load skills"}finally{L.value=!1}}function Ue(y){const v=y.installed?I.value.find(h=>h.name===y.name):void 0;C.value=v?ee(v,y):y,R.value=!0}async function be(){const y=E.value.trim();if(!(y.length<2)){S.value=!0,Q.value="";try{const v=new URLSearchParams({q:y}),h=await fetch(`/codex-api/skills-hub/search?${v}`),j=await h.json();if(!h.ok)throw new Error(j.error||`HTTP ${h.status}`);const me=new Map(I.value.map(le=>[le.name,le]));w.value=(j.results??[]).map(le=>{const xe=me.get(le.name);return xe?re(le,xe):le}),P.value=!0,w.value.length===0&&q(k("No matching skills found."),"error")}catch(v){Q.value=v instanceof Error?v.message:"Failed to search skills"}finally{S.value=!1}}}async function _e(y){Y.value=`${y.owner}/${y.name}`,te.value=!0;try{const h=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:y.owner,name:y.name,source:y.source})})).json();if(!h.ok)throw new Error(h.error||"Install failed");if(!h.path)throw new Error("Install completed but no local skill path was returned");await ae();const j=I.value.find(me=>me.name===y.name);if(!(j!=null&&j.path))throw new Error("Install completed but the local skill was not found after refresh");C.value=ee(j,y),q(`${y.displayName||y.name} skill installed`),R.value=!1,_("skills-changed")}catch(v){q(v instanceof Error?v.message:"Failed to install skill","error")}finally{te.value=!1}}async function we(y){Y.value=`${y.owner}/${y.name}`,m.value=!0;try{const h=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:y.name,path:y.path})})).json();if(!h.ok)throw new Error(h.error||"Uninstall failed");I.value=I.value.filter(j=>j.name!==y.name),q(`${y.displayName||y.name} skill uninstalled`),R.value=!1,_("skills-changed")}catch(v){q(v instanceof Error?v.message:"Failed to uninstall skill","error")}finally{m.value=!1}}async function Ce(y,v){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:y.path,enabled:v}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),q(`${y.displayName||y.name} skill ${v?"enabled":"disabled"}`),await ae()}catch(h){q(h instanceof Error?h.message:"Failed to update skill","error")}}function Se(y){!y.installed||y.enabled===!1||J.tryInFlightKey||(_("try-item",{kind:"skill",name:y.name,displayName:y.displayName||y.name,skillPath:y.path}),R.value=!1)}function $e(y){return`skill:${y.name}:${y.path??""}`}const{deviceLogin:b,isPullInFlight:U,isPushInFlight:Ne,isStartupSyncInFlight:De,isSyncActionInFlight:ce,loadSyncStatus:$,logoutGithub:ye,pullSkillsSync:Ae,pushSkillsSync:ve,startupSkillsSync:pe,startGithubFirebaseLogin:he,startGithubLogin:Z,syncActionError:Ie,syncActionStatus:ue,syncStatus:F}=qa({showToast:q,onPulled:async()=>{await ae(),_("skills-changed")}});return Wt(()=>{ae(),$()}),(y,v)=>(a(),l("div",Wa,[s("div",Qa,[s("h2",Ja,i(n(k)("Skills Hub")),1),s("p",Za,i(n(k)("Manage installed skills on this machine")),1)]),s("div",Ya,[s("div",Xa,[s("strong",null,i(n(k)("Skills Sync (GitHub)")),1),n(F).configured&&ie.value?(a(),l("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:ie.value,target:"_blank",rel:"noopener noreferrer"},i(n(k)("Connected"))+": "+i(n(F).repoOwner)+"/"+i(n(F).repoName),9,el)):n(F).loggedIn?(a(),l("span",tl,i(n(k)("Logged in as"))+" "+i(n(F).githubUsername),1)):(a(),l("span",sl,i(n(k)("Not connected")),1))]),s("div",al,[s("span",null,i(n(k)("Startup"))+": "+i(n(F).startup.mode),1),s("span",null,i(n(k)("Branch"))+": "+i(n(F).startup.branch),1),s("span",null,i(n(k)("Action"))+": "+i(n(F).startup.lastAction),1)]),n(F).startup.lastError?(a(),l("div",ll,i(n(F).startup.lastError),1)):c("",!0),n(ue)?(a(),l("div",ol,[s("span",null,i(n(k)("Manual sync"))+": "+i(n(ue)),1)])):c("",!0),n(Ie)?(a(),l("div",il,i(n(Ie)),1)):c("",!0),n(b)?(a(),l("div",nl,[s("span",null,[We(i(n(k)("Open"))+" ",1),s("a",{href:n(b).verification_uri,target:"_blank",rel:"noreferrer"},i(n(k)("GitHub device login")),9,rl),We(" "+i(n(k)("and enter code:")),1)]),s("code",null,i(n(b).user_code),1)])):c("",!0),s("div",cl,[n(F).loggedIn?c("",!0):(a(),l("button",{key:0,class:"skills-hub-sort",type:"button",onClick:v[0]||(v[0]=(...h)=>n(he)&&n(he)(...h))},i(n(k)("Login with GitHub")),1)),n(F).loggedIn?c("",!0):(a(),l("button",{key:1,class:"skills-hub-sort",type:"button",onClick:v[1]||(v[1]=(...h)=>n(Z)&&n(Z)(...h))},i(n(k)("Device Login")),1)),n(F).loggedIn?(a(),l("button",{key:2,class:"skills-hub-sort",type:"button",onClick:v[2]||(v[2]=(...h)=>n(ye)&&n(ye)(...h)),disabled:n(ce)},i(n(k)("Logout GitHub")),9,ul)):c("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:v[3]||(v[3]=(...h)=>n(pe)&&n(pe)(...h)),disabled:n(ce)},i(n(De)?n(k)("Syncing..."):n(k)("Startup Sync")),9,dl),s("button",{class:"skills-hub-sort",type:"button",onClick:v[4]||(v[4]=(...h)=>n(Ae)&&n(Ae)(...h)),disabled:n(ce)},i(n(U)?n(k)("Pulling..."):n(k)("Pull")),9,yl),n(F).loggedIn?(a(),l("button",{key:3,class:"skills-hub-sort",type:"button",onClick:v[5]||(v[5]=(...h)=>n(ve)&&n(ve)(...h)),disabled:!n(F).configured||n(ce)},i(n(Ne)?n(k)("Pushing..."):n(k)("Push")),9,vl)):c("",!0)])]),D.value?(a(),l("div",{key:0,class:G(["skills-hub-toast",M.value])},i(D.value.text),3)):c("",!0),s("div",pl,[s("div",hl,[s("div",ml,[s("strong",null,i(n(k)("Find skills")),1),s("span",null,i(n(k)("Search the Skills registry with npx skills find.")),1)]),s("a",gl,i(n(k)("Skills directory")),1)]),s("form",{class:"skills-search-form",onSubmit:Me(be,["prevent"])},[Ve(s("input",{"onUpdate:modelValue":v[6]||(v[6]=h=>E.value=h),class:"skills-search-input",type:"search",placeholder:n(k)("Search skills..."),"aria-label":"Search skills"},null,8,fl),[[qe,E.value]]),s("button",{class:"skills-hub-sort",type:"submit",disabled:S.value||E.value.trim().length<2},i(S.value?n(k)("Searching..."):n(k)("Search")),9,kl)],32),Q.value?(a(),l("div",bl,i(Q.value),1)):c("",!0)]),w.value.length>0?(a(),l("div",_l,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:v[7]||(v[7]=h=>P.value=!P.value)},[s("span",wl,i(n(k)("Search results ({count})",{count:w.value.length})),1),Te(Ht,{class:G(["skills-hub-section-chevron",{"is-open":P.value}])},null,8,["class"])]),P.value?(a(),l("div",Cl,[(a(!0),l(H,null,W(w.value,h=>(a(),Oe(Vt,{key:h.source||`${h.owner}/${h.name}`,skill:h,"show-browse-action":!1,onSelect:j=>Ue(j)},null,8,["skill","onSelect"]))),128))])):c("",!0)])):c("",!0),xs(y.$slots,"before-installed",{},void 0),se.value.length>0?(a(),l("div",Sl,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:v[8]||(v[8]=h=>x.value=!x.value)},[s("span",$l,i(n(k)("Installed skills ({count})",{count:se.value.length})),1),Te(Ht,{class:G(["skills-hub-section-chevron",{"is-open":x.value}])},null,8,["class"])]),x.value?(a(),l("div",Al,[(a(!0),l(H,null,W(se.value,h=>(a(),Oe(Vt,{key:h.name,skill:h,"show-status-badge":!1,"show-owner":!1,onSelect:j=>Ue(j)},null,8,["skill","onSelect"]))),128))])):c("",!0)])):c("",!0),s("div",Il,[L.value?(a(),l("div",Pl,i(n(k)("Loading skills...")),1)):K.value?(a(),l("div",Ll,i(K.value),1)):I.value.length===0?(a(),l("div",El,i(n(k)("No installed skills found.")),1)):c("",!0)]),Te(za,{skill:C.value,visible:R.value,"is-installing":V.value,"is-uninstalling":X.value,"is-trying":J.tryInFlightKey===$e(C.value),onClose:v[9]||(v[9]=h=>R.value=!1),onInstall:_e,onUninstall:we,onToggleEnabled:Ce,onTry:Se},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),Ul=Je(Tl,[["__scopeId","data-v-4447e558"]]),Nl={class:"directory-hub"},Dl={class:"directory-header"},Fl={class:"directory-subtitle"},Ml={class:"directory-header-actions"},Ol=["disabled"],xl={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},Rl=["aria-selected","onClick"],Bl={key:1,class:"directory-section"},Gl={class:"directory-toolbar"},jl={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},Hl={key:0,class:"directory-empty"},zl={key:1,class:"directory-error"},Kl={key:2,class:"directory-loading"},Vl={key:3,class:"directory-empty"},ql={key:4,class:"directory-grid"},Wl=["onClick"],Ql={class:"directory-card-top"},Jl=["src","alt"],Zl={class:"directory-card-main"},Yl={class:"directory-card-title-row"},Xl={class:"directory-card-title"},eo={key:0,class:"directory-badge is-muted"},to={key:1,class:"directory-badge"},so={class:"directory-card-meta"},ao={key:0,class:"directory-card-description"},lo={class:"directory-chip-row"},oo={key:0,class:"directory-chip"},io={key:2,class:"directory-section"},no={class:"directory-toolbar"},ro={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},co={key:0,class:"directory-empty"},uo={key:1,class:"directory-error"},yo={key:2,class:"directory-loading"},vo={key:3,class:"directory-empty"},po={key:4,class:"directory-grid"},ho={class:"directory-card-top"},mo=["src","alt"],go={key:1,class:"directory-card-fallback"},fo={class:"directory-card-main"},ko={class:"directory-card-title-row"},bo={class:"directory-card-title"},_o={key:0,class:"directory-badge is-muted"},wo={key:1,class:"directory-badge"},Co={class:"directory-card-meta"},So={key:0,class:"directory-card-description"},$o={class:"directory-chip-row"},Ao={key:0,class:"directory-chip"},Io={class:"directory-card-actions"},Po=["disabled","onClick"],Lo=["onClick"],Eo=["disabled","onClick"],To={key:3,class:"directory-section"},Uo={class:"directory-toolbar"},No={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},Do={key:0,class:"directory-error"},Fo={key:1,class:"directory-loading"},Mo={key:2,class:"directory-empty"},Oo={class:"directory-empty-copy"},xo={class:"directory-card-actions"},Ro=["disabled"],Bo={key:3,class:"directory-empty"},Go={class:"directory-empty-copy"},jo={class:"directory-card-actions"},Ho=["disabled"],zo={key:4,class:"directory-section composio-section"},Ko={class:"directory-card directory-card-wide composio-status-card"},Vo={class:"directory-card-top"},qo={class:"directory-card-main"},Wo={class:"directory-card-meta"},Qo={class:"directory-card-description"},Jo={class:"directory-chip-row"},Zo={key:0,class:"directory-chip"},Yo={key:1,class:"directory-chip"},Xo={key:2,class:"directory-chip"},ei={class:"directory-card-actions"},ti={key:0,class:"directory-empty"},si={key:1,class:"directory-grid"},ai={class:"directory-card-top"},li=["src","alt"],oi={key:1,class:"directory-card-fallback composio-fallback"},ii={class:"directory-card-main"},ni={class:"directory-card-title-row"},ri={class:"directory-card-title"},ci={key:0,class:"directory-badge"},ui={key:1,class:"directory-badge"},di={class:"directory-card-meta"},yi={key:0,class:"directory-card-description"},vi={class:"directory-chip-row"},pi={class:"directory-chip"},hi={key:0,class:"directory-chip"},mi={key:1,class:"directory-chip"},gi={class:"directory-card-actions"},fi=["onClick"],ki=["disabled","onClick"],bi=["disabled","onClick"],_i={key:2,class:"directory-section-actions"},wi=["disabled"],Ci={key:4,class:"directory-section"},Si={class:"skills-embedded-section"},$i={class:"skills-embedded-title"},Ai={key:0,class:"skills-embedded-body"},Ii={key:0,class:"directory-empty"},Pi={key:1,class:"directory-error"},Li={key:2,class:"directory-loading"},Ei={key:3,class:"directory-empty"},Ti={key:4,class:"mcp-skill-grid"},Ui=["onClick"],Ni={class:"mcp-skill-card-top"},Di={class:"mcp-skill-avatar-fallback"},Fi={class:"mcp-skill-info"},Mi={class:"mcp-skill-header"},Oi={class:"mcp-skill-name"},xi={class:"mcp-skill-meta"},Ri={key:0,class:"directory-mcp-detail"},Bi={key:0},Gi={class:"directory-mini-list"},ji={key:1},Hi={class:"directory-mini-list"},zi={class:"directory-modal"},Ki={class:"directory-modal-header"},Vi={class:"directory-card-top"},qi=["src","alt"],Wi={key:1,class:"directory-card-fallback"},Qi={class:"directory-card-main"},Ji={class:"directory-modal-title"},Zi={class:"directory-card-meta"},Yi={class:"directory-modal-body"},Xi={key:0,class:"directory-error"},en={key:1,class:"directory-loading"},tn={key:0,class:"directory-detail-description"},sn={key:1,class:"directory-detail-block"},an={class:"directory-chip-row"},ln={class:"directory-detail-grid"},on={key:0,class:"directory-detail-block"},nn={key:0,class:"directory-auth-status is-warning"},rn=["onClick"],cn={key:1,class:"directory-detail-block"},un={class:"directory-mini-list"},dn={key:2,class:"directory-detail-block"},yn=["disabled","onClick"],vn={key:2,class:"directory-screenshots"},pn=["src"],hn={key:3,class:"directory-auth-panel"},mn=["onClick"],gn={class:"directory-modal-footer"},fn=["disabled"],kn=["disabled"],bn={key:2,class:"directory-action",type:"button",disabled:""},_n=["disabled"],wn=["disabled"],Cn={class:"directory-modal"},Sn={class:"directory-modal-header"},$n={class:"directory-card-top"},An=["src","alt"],In={key:1,class:"directory-card-fallback composio-fallback"},Pn={class:"directory-card-main"},Ln={class:"directory-modal-title"},En={class:"directory-card-meta"},Tn={class:"directory-modal-body"},Un={key:0,class:"directory-error"},Nn={key:1,class:"directory-loading"},Dn={key:0,class:"directory-detail-description"},Fn={class:"directory-detail-grid"},Mn={class:"directory-detail-block"},On={class:"directory-chip-row"},xn={class:"directory-chip"},Rn={key:0,class:"directory-chip"},Bn={key:1,class:"directory-chip"},Gn={key:2,class:"directory-chip"},jn={class:"directory-detail-block"},Hn={key:0,class:"directory-mini-list"},zn={key:1},Kn={class:"directory-card-meta"},Vn={key:1,class:"directory-detail-block"},qn={class:"directory-card-meta"},Wn={class:"directory-modal-footer"},Qn=["disabled"],Jn=["disabled"],Zn="/Users/igor/.codex/skills/shared_skills/composio-cli/SKILL.md",Yn=50,qt=100,Xn=Qe({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(u,{emit:N}){const p=[[/^gmail$/i,3e4],[/^google calendar$/i,29500],[/^outlook( email| calendar)?$/i,29e3],[/^google drive$/i,28500],[/^google docs$/i,28e3],[/^google sheets$/i,27500],[/^dropbox$/i,27e3],[/^box$/i,26500],[/^slack$/i,26e3],[/^notion$/i,25500],[/^canva$/i,25e3],[/^figma$/i,24500],[/^github$/i,24e3],[/^trello$/i,23500],[/^asana$/i,23e3],[/^basecamp$/i,22500],[/^clickup$/i,22e3],[/^linear$/i,21500],[/^gitlab( issues)?$/i,21e3],[/^jira$/i,20500],[/^zapier$/i,2e4],[/^hubspot$/i,19500],[/^salesforce$/i,19e3],[/^netlify$/i,18500],[/^vercel$/i,18e3],[/^(spotify|youtube|netflix|hulu|disney|booking|expedia|uber|airbnb)$/i,17500]],I=[[/(email|mail|inbox|calendar|event|availability|contact|message|chat)/i,450],[/(drive|document|docs|sheet|slide|file|storage|pdf|note|page)/i,380],[/(image|design|presentation|diagram|video|audio|photo|media|music)/i,320],[/(travel|flight|hotel|restaurant|recipe|food|shopping|delivery|map|weather)/i,260],[/(learn|education|study|language|health|fitness|finance|budget)/i,220],[/(task|project|issue|repository|deploy|database|crm|sales|support)/i,120]],w=[[/(computer use|github|gitlab|linear|slack|notion|browser|web|filesystem|terminal)/i,120],[/(calendar|email|drive|docs|design|deploy|project|issue|search|database)/i,55]],L=[[/(github|gitlab|linear|slack|notion|filesystem|browser|computer|web|postgres|sqlite|database)/i,120],[/(search|drive|docs|calendar|terminal|shell|deploy|cloud|memory)/i,55]],S=u,K=N,E=Rs(),Q=Bs(),x=[{id:"plugins",label:"Plugins",subtitle:"Plugins make Codex work your way."},{id:"apps",label:"Apps",subtitle:"Connect Codex to external apps and services."},{id:"composio",label:"Composio",subtitle:"Browse Composio connectors, auth state, and ready-to-try integrations."},{id:"skills",label:"Skills",subtitle:"MCPs first, then installed skills and GitHub sync state."}];function P(e){return e==="plugins"||e==="apps"||e==="composio"||e==="skills"}function R(){return P(E.query.tab)?E.query.tab:"skills"}const C=d(R()),D=d(new Set),Y=d(!1),te=d([]),m=d([]),g=d(null),k=d([]),J=d(null),_=d(0),M=d([]),O=d("popular"),V=d("popular"),X=d("popular"),ie=d(""),se=d(""),q=d(""),ne=d(!1),re=d(!1),ee=d(!1),ae=d(!1),Ue=d(!1),be=d(!1),_e=d(!0),we=d(""),Ce=d(""),Se=d(""),$e=d(""),b=d(null),U=d(null),Ne=d(!1),De=d(!1),ce=d(""),$=d(null),ye=d(!1),Ae=d(!1),ve=d(""),pe=d(!1),he=d(!1),Z=d(!1),Ie=d(""),ue=d(""),F=d([]),y=d(""),v=d(new Set),h=d(null);let j=null,me=null,le=!1;const xe=A(()=>x.find(e=>e.id===C.value)??x[0]),rt=A(()=>!Y.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>D.value.has(e))),Re=A(()=>!Y.value||D.value.has("app/list")),Ze=A(()=>!Y.value||D.value.has("mcpServerStatus/list")),ct=A(()=>D.value.has("config/mcpServer/reload")),ut=A(()=>D.value.has("mcpServer/oauth/login")),ge=A(()=>(S.tryInFlightKey??"").length>0),dt=A(()=>{var e,t,r;return((e=U.value)==null?void 0:e.description)||((t=U.value)==null?void 0:t.summary.longDescription)||((r=U.value)==null?void 0:r.summary.description)||""}),yt=A(()=>{var t;const e=(t=U.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(je)].filter(Boolean):[]}),Ye=A(()=>{var r;const e=((r=U.value)==null?void 0:r.apps)??[];if(e.length===0)return!1;const t=new Set;for(const f of m.value)t.add(f.id.trim().toLowerCase()),t.add(kt(f.name));return e.some(f=>{const B=f.id.trim().toLowerCase(),de=kt(f.name),ke=B.length>0&&t.has(B),Ke=de.length>0&&t.has(de);return!ke&&!Ke})}),Jt=A(()=>{var e,t;return((e=b.value)==null?void 0:e.installPolicy)==="NOT_AVAILABLE"||(((t=U.value)==null?void 0:t.apps.some(r=>ft(r)))??!1)}),vt=A(()=>is(ds(rs(te.value,ie.value),O.value),O.value,ie.value)),pt=A(()=>ns(ys(cs(m.value,se.value),V.value),V.value,se.value)),ht=A(()=>ra(us(k.value,q.value),X.value,q.value)),Xe=A(()=>vs(M.value)),mt=A(()=>J.value!==null),Zt=A(()=>new Map(M.value.map(e=>[e.name,e]))),Yt=A(()=>{const e=g.value;return e&&[e.email||e.defaultOrgName,e.defaultOrgId?`org ${e.defaultOrgId}`:"",e.baseUrl||""].filter(Boolean).join(" · ")||"Composio CLI shares the login and connections from this machine."});function Be(e){return e.trim().toLowerCase()}function Xt(e){return Be(e).replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").replace(/[-_]+/gu," ").replace(/\s+plugin$/iu,"").replace(/\s+/gu," ").trim()}function gt(...e){const t=new Set;for(const r of e){const f=Xt(r);f&&(t.add(f),t.add(f.replace(/\s+/gu,"")))}return Array.from(t)}function es(e){return!e.isAccessible&&e.installUrl.trim().length===0}function ts(e){const t=e.id.trim();if(t){const f=m.value.find(B=>B.id===t);if(f)return f}const r=gt(e.name);return m.value.find(f=>gt(f.name).some(B=>r.includes(B)))??null}function ft(e){const t=ts(e);return t?es(t):e.needsAuth&&e.installUrl.trim().length===0}function et(e,t){const r=Be(t);return r?e.some(f=>f==null?void 0:f.toLowerCase().includes(r)):!0}function Ge(e,t){return t.reduce((r,[f,B])=>r+(f.test(e)?B:0),0)}function tt(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function kt(e){return tt(e).toLowerCase()}function ss(e){return e==="DEFAULT_OAI_CATALOG"?"OpenAI catalog":e==="ECOSYSTEM_DIRECTORY"?"Ecosystem directory":e?e.replace(/_/gu," ").toLowerCase().replace(/\b\w/gu,t=>t.toUpperCase()):""}function as(e){return e.developer||ss(e.distributionChannel)||"App"}function st(e){var t;return((t=Zt.value.get(e))==null?void 0:t.authStatus)??"unknown"}function bt(e){const t=st(e);return t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown"}function ls(e){const t=st(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function os(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function _t(e){return ut.value&&st(e)==="notLoggedIn"}function is(e,t,r){return t==="popular"&&Be(r).length===0?e.slice(0,qt):e}function ns(e,t,r){if(t!=="popular"||Be(r).length>0)return e;const f=new Set,B=[];for(const de of e){const ke=tt(de.name).toLowerCase();if(!f.has(ke)&&(f.add(ke),B.push(de),B.length>=qt))break}return B}function rs(e,t){return e.filter(r=>et([r.displayName,r.name,r.description,r.developerName,r.category,r.marketplaceDisplayName,...r.capabilities],t))}function cs(e,t){return e.filter(r=>et([r.name,r.description,r.developer,r.category,r.distributionChannel,...r.pluginDisplayNames],t))}function us(e,t){return e.filter(r=>et([r.name,r.slug,r.description,...r.authModes,...r.connectionStatuses],t))}function wt(e){return(e.installed?500:0)+(e.enabled?40:0)+(e.developerName.toLowerCase().includes("openai")?140:0)+(e.sourceType==="local"?80:0)+e.capabilities.length*12+Ge(`${e.displayName} ${e.name} ${e.description} ${e.category}`,w)}function Ct(e){const t=tt(e.name);return(e.isAccessible?1e4:0)+Ge(t,p)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+Ge(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,I)-e.catalogRank*.001}function St(e){return(e.authStatus==="oAuth"?180:0)+(e.authStatus==="bearerToken"?140:0)+Math.min(e.tools.length,50)*6+Math.min(e.resources.length+e.resourceTemplates.length,30)*3+Ge(e.name,L)}function ds(e,t){return t==="name"?[...e].sort((r,f)=>r.displayName.localeCompare(f.displayName)):t==="date"?[...e]:[...e].sort((r,f)=>wt(f)-wt(r)||r.displayName.localeCompare(f.displayName))}function ys(e,t){return t==="name"?[...e].sort((r,f)=>r.name.localeCompare(f.name)):t==="date"?[...e].sort((r,f)=>r.catalogRank-f.catalogRank):[...e].sort((r,f)=>Ct(f)-Ct(r)||r.name.localeCompare(f.name))}function vs(e,t){return[...e].sort((r,f)=>St(f)-St(r)||r.name.localeCompare(f.name))}function z(e,t="success"){h.value={text:e,type:t},j&&clearTimeout(j),j=setTimeout(()=>{h.value=null},3e3)}function je(e){return e?e.startsWith("connectors://")?`/codex-api/connector-logo?src=${encodeURIComponent(e)}`:/^https?:\/\//i.test(e)||e.startsWith("data:")?e:e.startsWith("/")?`/codex-local-image?path=${encodeURIComponent(e)}`:"":""}function He(e){return e?e.logoUrl||je(e.logoPath)||e.composerIconUrl||je(e.composerIconPath):""}function $t(e){return je(e.logoUrlDark||e.logoUrl)}function At(e){return e.activeCount>0?`${e.activeCount} connected ${e.activeCount===1?"account":"accounts"}`:e.isNoAuth?"No auth required":e.connectionStatuses.length>0?e.connectionStatuses.join(", "):e.authModes.join(", ")||"Connection required"}function ps(e){return e.isNoAuth||e.activeCount>0}function ze(e){return e.isNoAuth?"":e.activeCount>0?"Manage":e.totalConnections>0?"Reconnect":"Connect"}function hs(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"Active":t==="EXPIRED"?"Expired":t==="FAILED"?"Failed":t==="INITIATED"?"Pending":t||"Unknown"}function ms(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function gs(e){return`app:${e.id}:`}function fs(e){ge.value||K("try-item",{kind:"app",name:e.id,displayName:e.name})}function ks(e){return`plugin:${e.name}:`}function It(e){return`composio:${e}:`}function bs(e){ge.value||K("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function Pt(e){return ps(e)}function _s(e,t=[]){const r=t.find(B=>B.status==="ACTIVE"&&!B.isDisabled),f=r!=null&&r.wordId?` If there are multiple accounts, prefer \`${r.wordId}\`.`:"";return`Use the Composio CLI skill with the ${e.name} connector (${e.slug}). Start by listing what it can do here, mention the current connection status, and suggest one safe command I can run now.${f}`}function Lt(e,t=[]){ge.value||K("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:_s(e,t),attachedSkills:[{name:"composio-cli",path:Zn}]})}function oe(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function ws(e){const t=e.find(r=>r.needsAuth&&r.installUrl.trim().length>0);return t?(oe(t.installUrl),!0):!1}function Cs(e){return e.brandColor?{backgroundColor:e.brandColor,color:"#fff"}:{}}async function Ss(){try{D.value=new Set(await Hs())}catch{D.value=new Set}finally{Y.value=!0}}async function Pe(){var e;if(rt.value){ne.value=!0,we.value="";try{const t=(e=S.cwd)==null?void 0:e.trim(),[r]=await Promise.all([zs(t?[t]:void 0),Re.value?Fe():Promise.resolve()]);te.value=r}catch(t){we.value=t instanceof Error?t.message:"Failed to load plugins"}finally{ne.value=!1}}}async function Fe(){var e;if(Re.value){re.value=!0,Ce.value="";try{m.value=await Ks(((e=S.threadId)==null?void 0:e.trim())||void 0)}catch(t){Ce.value=t instanceof Error?t.message:"Failed to load apps"}finally{re.value=!1}}}async function fe(e=!1){if(ee.value){le=!0;return}ee.value=!0,Se.value="";try{const t=await Vs();if(g.value=t,!t.available||!t.authenticated){k.value=[],J.value=null,_.value=0;return}const r=e?J.value:null,f=await qs(q.value,r,Yn);k.value=e?[...k.value,...f.data]:f.data,J.value=f.nextCursor,_.value=f.total}catch(t){Se.value=t instanceof Error?t.message:"Failed to load Composio connectors",k.value=[],J.value=null,_.value=0}finally{ee.value=!1,le&&(le=!1,fe())}}async function $s(){!mt.value||ee.value||await fe(!0)}async function at(){if(Ze.value){ae.value=!0,$e.value="";try{M.value=await zt()}catch(e){$e.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{ae.value=!1}}}async function Et(){var e;if(!(!Ze.value||!((e=U.value)!=null&&e.mcpServers.length)))try{M.value=await zt()}catch{}}function Tt(e=!1){C.value==="plugins"&&Pe(),C.value==="apps"&&Fe(),C.value==="composio"&&fe(),C.value==="skills"&&(e&&ct.value?Ot():at())}async function As(){be.value=!0;try{C.value==="plugins"?await Pe():C.value==="apps"?await Fe():C.value==="composio"?await fe():C.value==="skills"&&ct.value?await Ot():C.value==="skills"&&await at()}finally{be.value=!1}}async function Ut(e){b.value=e,U.value=null,ce.value="",F.value=[],Ne.value=!0,De.value=!0;try{U.value=await Ws(e),b.value=U.value.summary,Re.value&&m.value.length===0&&await Fe(),await Et()}catch(t){ce.value=t instanceof Error?t.message:"Failed to load plugin"}finally{De.value=!1}}async function Nt(e){if(!ut.value)return!1;y.value=e;try{const t=await Qs(e);return t.authorizationUrl?(oe(t.authorizationUrl),!0):(z(`No login URL returned for ${e}`,"error"),!1)}catch(t){return z(t instanceof Error?t.message:`Failed to start login for ${e}`,"error"),!1}finally{y.value=""}}async function Is(e){await Et();const t=e.mcpServers.find(r=>_t(r));t&&await Nt(t)}function lt(){Ne.value=!1}async function Dt(e){ye.value=!0,Ae.value=!0,ve.value="",$.value=null;try{$.value=await Js(e)}catch(t){ve.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{Ae.value=!1}}function Ft(){ye.value=!1}async function Ps(e){var t;ue.value=e.slug;try{const r=await la(e.slug);if(!r.redirectUrl){z(`No login URL returned for ${e.name}`,"error");return}oe(r.redirectUrl),z(`Opened ${e.name} authorization`),await fe(),ye.value&&((t=$.value)==null?void 0:t.connector.slug)===e.slug&&await Dt(e.slug)}catch(r){z(r instanceof Error?r.message:`Failed to connect ${e.name}`,"error")}finally{ue.value=""}}async function Mt(e){var t;if(e.activeCount>0&&((t=g.value)!=null&&t.webUrl)){oe(g.value.webUrl);return}await Ps(e)}async function Ls(){he.value=!0;const e=window.open("about:blank","_blank");e&&(e.opener=null);try{const t=await Zs();t.loginUrl&&e?e.location.href=t.loginUrl:t.loginUrl?oe(t.loginUrl):e==null||e.close(),z("Composio CLI login started")}catch(t){e==null||e.close(),z(t instanceof Error?t.message:"Failed to start Composio login","error")}finally{he.value=!1}}async function Es(){pe.value=!0;try{await Ys(),z("Composio CLI installed"),await fe()}catch(e){z(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{pe.value=!1}}async function Ts(){if(b.value&&!Ye.value){Z.value=!0;try{const e=await Xs(b.value);F.value=e.appsNeedingAuth,z(`${b.value.displayName} plugin installed`);const t=ws(e.appsNeedingAuth);await Pe();const r=te.value.find(f=>{var B;return f.id===((B=b.value)==null?void 0:B.id)});r&&(await Ut(r),!t&&U.value&&await Is(U.value))}catch(e){z(e instanceof Error?e.message:"Failed to install plugin","error")}finally{Z.value=!1}}}async function Us(){if(b.value){Z.value=!0;try{const e=b.value.displayName;await ea(b.value.id),z(`${e} plugin uninstalled`),lt(),await Pe()}catch(e){z(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{Z.value=!1}}}async function Ns(){if(b.value){Z.value=!0;try{const e=!b.value.enabled;await ta(b.value.id,e),b.value={...b.value,enabled:e},U.value&&(U.value={...U.value,summary:{...U.value.summary,enabled:e}}),z(`${b.value.displayName} plugin ${e?"enabled":"disabled"}`),await Pe()}catch(e){z(e instanceof Error?e.message:"Failed to update plugin","error")}finally{Z.value=!1}}}async function Ds(e){Ie.value=e.id;try{const t=!e.isEnabled;await sa(e.id,t),m.value=m.value.map(r=>r.id===e.id?{...r,isEnabled:t}:r),z(`${e.name} app ${t?"enabled":"disabled"}`)}catch(t){z(t instanceof Error?t.message:"Failed to update app","error")}finally{Ie.value=""}}async function Ot(){Ue.value=!0;try{await aa(),await at(),z("MCP servers reloaded")}catch(e){z(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{Ue.value=!1}}function Fs(e){const t=new Set(v.value);t.has(e)?t.delete(e):t.add(e),v.value=t}return Ee(C,e=>{E.name==="skills"&&E.query.tab!==e&&Q.replace({name:"skills",query:{...E.query,tab:e}}),Tt()}),Ee(()=>E.query.tab,()=>{if(E.name!=="skills")return;const e=R();C.value!==e&&(C.value=e)}),Ee(q,()=>{C.value==="composio"&&(k.value=[],J.value=null,_.value=0,me&&clearTimeout(me),me=setTimeout(()=>{fe()},250))}),Ee(()=>S.cwd,()=>{C.value==="plugins"&&Pe()}),Ee(()=>S.threadId,()=>{(C.value==="apps"||C.value==="plugins")&&Fe()}),Wt(async()=>{await Ss(),Tt()}),(e,t)=>{var r,f,B,de,ke,Ke,xt,Rt,Bt,Gt;return a(),l("div",Nl,[s("div",Dl,[s("div",null,[t[20]||(t[20]=s("h2",{class:"directory-title"},"Skills & Apps",-1)),s("p",Fl,i(xe.value.subtitle),1)]),s("div",Ml,[s("button",{class:"directory-refresh",type:"button",disabled:be.value,onClick:As},i(be.value?"Refreshing...":"Refresh"),9,Ol)])]),s("div",xl,[(a(),l(H,null,W(x,o=>s("button",{key:o.id,class:G(["directory-tab",{"is-active":C.value===o.id}]),type:"button",role:"tab","aria-selected":C.value===o.id,onClick:T=>C.value=o.id},i(o.label),11,Rl)),64))]),h.value?(a(),l("div",{key:0,class:G(["directory-toast",{"is-error":h.value.type==="error"}])},i(h.value.text),3)):c("",!0),C.value==="plugins"?(a(),l("section",Bl,[s("div",Gl,[Ve(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>ie.value=o),class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins"},null,512),[[qe,ie.value]]),s("div",jl,[s("button",{class:G(["directory-sort-button",{"is-active":O.value==="popular"}]),type:"button",onClick:t[1]||(t[1]=o=>O.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":O.value==="name"}]),type:"button",onClick:t[2]||(t[2]=o=>O.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":O.value==="date"}]),type:"button",onClick:t[3]||(t[3]=o=>O.value="date")}," Date ",2)])]),rt.value?we.value?(a(),l("div",zl,i(we.value),1)):ne.value?(a(),l("div",Kl,"Loading plugins...")):vt.value.length===0?(a(),l("div",Vl,"No plugins found.")):(a(),l("div",ql,[(a(!0),l(H,null,W(vt.value,o=>(a(),l("button",{key:o.id,class:G(["directory-card",{"is-disabled":o.installed&&!o.enabled}]),type:"button",onClick:T=>Ut(o)},[s("div",Ql,[He(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:He(o),alt:o.displayName,loading:"lazy"},null,8,Jl)):(a(),l("div",{key:1,class:"directory-card-fallback",style:Gs(Cs(o))},i(o.displayName.charAt(0)),5)),s("div",Zl,[s("div",Yl,[s("span",Xl,i(o.displayName),1),o.installed&&!o.enabled?(a(),l("span",eo,"Disabled")):o.installed?(a(),l("span",to,"Installed")):c("",!0)]),s("span",so,i(o.developerName||o.marketplaceDisplayName||o.marketplaceName||"Plugin"),1)])]),o.description?(a(),l("p",ao,i(o.description),1)):c("",!0),s("div",lo,[o.category?(a(),l("span",oo,i(o.category),1)):c("",!0),(a(!0),l(H,null,W(o.capabilities.slice(0,2),T=>(a(),l("span",{key:T,class:"directory-chip"},i(T),1))),128))])],10,Wl))),128))])):(a(),l("div",Hl," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))])):C.value==="apps"?(a(),l("section",io,[s("div",no,[Ve(s("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>se.value=o),class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps"},null,512),[[qe,se.value]]),s("div",ro,[s("button",{class:G(["directory-sort-button",{"is-active":V.value==="popular"}]),type:"button",onClick:t[5]||(t[5]=o=>V.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":V.value==="name"}]),type:"button",onClick:t[6]||(t[6]=o=>V.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":V.value==="date"}]),type:"button",onClick:t[7]||(t[7]=o=>V.value="date")}," Date ",2)])]),Re.value?Ce.value?(a(),l("div",uo,i(Ce.value),1)):re.value?(a(),l("div",yo,"Loading apps...")):pt.value.length===0?(a(),l("div",vo,"No apps found.")):(a(),l("div",po,[(a(!0),l(H,null,W(pt.value,o=>(a(),l("article",{key:o.id,class:"directory-card"},[s("div",ho,[$t(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:$t(o),alt:o.name,loading:"lazy"},null,8,mo)):(a(),l("div",go,i(o.name.charAt(0)),1)),s("div",fo,[s("div",ko,[s("span",bo,i(o.name),1),o.isEnabled?o.isAccessible?(a(),l("span",wo,"Connected")):c("",!0):(a(),l("span",_o,"Disabled"))]),s("span",Co,i(as(o)),1)])]),o.description?(a(),l("p",So,i(o.description),1)):c("",!0),s("div",$o,[o.category?(a(),l("span",Ao,i(o.category),1)):c("",!0),(a(!0),l(H,null,W(o.pluginDisplayNames.slice(0,2),T=>(a(),l("span",{key:T,class:"directory-chip"},i(T),1))),128))]),s("div",Io,[s("button",{class:"directory-action",type:"button",disabled:Ie.value===o.id,onClick:T=>Ds(o)},i(o.isEnabled?"Disable":"Enable"),9,Po),o.installUrl?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:T=>oe(o.installUrl)},i(o.isAccessible?"Manage":"Login"),9,Lo)):c("",!0),o.isAccessible&&o.isEnabled?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ge.value,onClick:T=>fs(o)},i(S.tryInFlightKey===gs(o)?"Starting...":"Try it!"),9,Eo)):c("",!0)])]))),128))])):(a(),l("div",co," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))])):C.value==="composio"?(a(),l("section",To,[s("div",Uo,[Ve(s("input",{"onUpdate:modelValue":t[8]||(t[8]=o=>q.value=o),class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors"},null,512),[[qe,q.value]]),s("div",No,[s("button",{class:G(["directory-sort-button",{"is-active":X.value==="popular"}]),type:"button",onClick:t[9]||(t[9]=o=>X.value="popular")}," Popular ",2),s("button",{class:G(["directory-sort-button",{"is-active":X.value==="name"}]),type:"button",onClick:t[10]||(t[10]=o=>X.value="name")}," A-Z ",2),s("button",{class:G(["directory-sort-button",{"is-active":X.value==="date"}]),type:"button",onClick:t[11]||(t[11]=o=>X.value="date")}," Date ",2)])]),Se.value?(a(),l("div",Do,i(Se.value),1)):ee.value?(a(),l("div",Fo,"Loading Composio connectors...")):(r=g.value)!=null&&r.available?g.value.authenticated?(a(),l("div",zo,[s("article",Ko,[s("div",Vo,[t[24]||(t[24]=s("div",{class:"directory-card-fallback composio-fallback"},"C",-1)),s("div",qo,[t[23]||(t[23]=s("div",{class:"directory-card-title-row"},[s("span",{class:"directory-card-title"},"Composio workspace"),s("span",{class:"directory-badge"},"Connected")],-1)),s("span",Wo,i(g.value.email||g.value.defaultOrgName||"Authenticated"),1)])]),s("p",Qo,i(Yt.value),1),s("div",Jo,[g.value.defaultOrgName?(a(),l("span",Zo,i(g.value.defaultOrgName),1)):c("",!0),g.value.cliVersion?(a(),l("span",Yo,"CLI "+i(g.value.cliVersion),1)):c("",!0),k.value.length?(a(),l("span",Xo," Showing "+i(k.value.length)+i(_.value?` / ${_.value}`:"")+" connectors ",1)):c("",!0)]),s("div",ei,[s("button",{class:"directory-action-link",type:"button",onClick:t[12]||(t[12]=o=>oe(g.value.webUrl))}," Open dashboard ")])]),ht.value.length===0?(a(),l("div",ti,"No Composio connectors found.")):(a(),l("div",si,[(a(!0),l(H,null,W(ht.value,o=>(a(),l("article",{key:o.slug,class:"directory-card"},[s("div",ai,[o.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:o.logoUrl,alt:o.name,loading:"lazy"},null,8,li)):(a(),l("div",oi,i(o.name.charAt(0)),1)),s("div",ii,[s("div",ni,[s("span",ri,i(o.name),1),o.activeCount>0?(a(),l("span",ci,"Connected")):o.isNoAuth?(a(),l("span",ui,"No auth")):c("",!0)]),s("span",di,i(At(o)),1)])]),o.description?(a(),l("p",yi,i(o.description),1)):c("",!0),s("div",vi,[s("span",pi,i(o.toolsCount)+" tools",1),o.triggersCount>0?(a(),l("span",hi,i(o.triggersCount)+" triggers",1)):c("",!0),o.authModes.length>0?(a(),l("span",mi,i(o.authModes.join(", ")),1)):c("",!0)]),s("div",gi,[s("button",{class:"directory-action",type:"button",onClick:T=>Dt(o.slug)}," Details ",8,fi),ze(o)?(a(),l("button",{key:0,class:"directory-action-link",type:"button",disabled:ue.value===o.slug,onClick:T=>Mt(o)},i(ue.value===o.slug?"Opening...":ze(o)),9,ki)):c("",!0),Pt(o)?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:ge.value,onClick:T=>Lt(o)},i(S.tryInFlightKey===It(o.slug)?"Starting...":"Try it!"),9,bi)):c("",!0)])]))),128))])),mt.value?(a(),l("div",_i,[s("button",{class:"directory-action",type:"button",disabled:ee.value,onClick:$s},i(ee.value?"Loading...":"Load more"),9,wi)])):c("",!0)])):(a(),l("div",Bo,[s("div",Go,[t[22]||(t[22]=s("p",{class:"directory-empty-text"},"Composio is available but not logged in.",-1)),s("div",jo,[s("button",{class:"directory-action primary",type:"button",disabled:he.value,onClick:Ls},i(he.value?"Opening...":"Login"),9,Ho)])])])):(a(),l("div",Mo,[s("div",Oo,[t[21]||(t[21]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",xo,[s("button",{class:"directory-action primary",type:"button",disabled:pe.value,onClick:Es},i(pe.value?"Installing...":"Install Composio"),9,Ro)])])]))])):C.value==="skills"?(a(),l("section",Ci,[Te(Ul,{"try-in-flight-key":S.tryInFlightKey,onSkillsChanged:t[14]||(t[14]=o=>K("skills-changed")),onTryItem:t[15]||(t[15]=o=>K("try-item",o))},{"before-installed":js(()=>[s("div",Si,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:t[13]||(t[13]=o=>_e.value=!_e.value)},[s("span",$i,"MCPs("+i(Xe.value.length)+")",1),s("span",{class:G(["skills-embedded-chevron",{"is-open":_e.value}])},"›",2)]),_e.value?(a(),l("div",Ai,[Ze.value?$e.value?(a(),l("div",Pi,i($e.value),1)):ae.value?(a(),l("div",Li,"Loading MCP servers...")):Xe.value.length===0?(a(),l("div",Ei,"No MCP servers configured.")):(a(),l("div",Ti,[(a(!0),l(H,null,W(Xe.value,o=>(a(),l("article",{key:o.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:T=>Fs(o.name)},[s("div",Ni,[s("div",Di,i(o.name.charAt(0)),1),s("div",Fi,[s("div",Mi,[s("span",Oi,i(o.name),1),s("span",{class:G(["mcp-skill-badge",os(o.authStatus)])},i(bt(o.name)),3)]),t[25]||(t[25]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:G(["mcp-skill-chevron",{"is-open":v.value.has(o.name)}])},"›",2)]),s("p",xi,i(o.tools.length)+" tools · "+i(o.resources.length+o.resourceTemplates.length)+" resources",1),v.value.has(o.name)?(a(),l("div",Ri,[o.tools.length>0?(a(),l("div",Bi,[t[26]||(t[26]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",Gi,i(o.tools.map(T=>T.title||T.name).join(", ")),1)])):c("",!0),o.resources.length>0||o.resourceTemplates.length>0?(a(),l("div",ji,[t[27]||(t[27]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",Hi,i([...o.resources.map(T=>T.title||T.name||T.uri),...o.resourceTemplates.map(T=>T.title||T.name||T.uriTemplate)].join(", ")),1)])):c("",!0)])):c("",!0)],8,Ui)]))),128))])):(a(),l("div",Ii," MCP status APIs unavailable in this Codex CLI. Update Codex CLI to inspect MCP servers. "))])):c("",!0)])]),_:1},8,["try-in-flight-key"])])):c("",!0),(a(),Oe(it,{to:"body"},[Ne.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Me(lt,["self"])},[s("article",zi,[s("div",Ki,[s("div",Vi,[b.value&&He(b.value)?(a(),l("img",{key:0,class:"directory-card-icon",src:He(b.value),alt:b.value.displayName,loading:"lazy"},null,8,qi)):(a(),l("div",Wi,i((f=b.value)==null?void 0:f.displayName.charAt(0)),1)),s("div",Qi,[s("h3",Ji,i(((B=b.value)==null?void 0:B.displayName)||"Plugin"),1),s("span",Zi,i(((de=b.value)==null?void 0:de.developerName)||((ke=b.value)==null?void 0:ke.marketplaceDisplayName)||((Ke=b.value)==null?void 0:Ke.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close plugin detail",onClick:lt},"Close")]),s("div",Yi,[ce.value?(a(),l("div",Xi,i(ce.value),1)):De.value?(a(),l("div",en,"Loading plugin...")):U.value?(a(),l(H,{key:2},[dt.value?(a(),l("p",tn,i(dt.value),1)):c("",!0),U.value.summary.capabilities.length>0?(a(),l("div",sn,[t[28]||(t[28]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",an,[(a(!0),l(H,null,W(U.value.summary.capabilities,o=>(a(),l("span",{key:o,class:"directory-chip"},i(o),1))),128))])])):c("",!0),s("div",ln,[U.value.apps.length>0?(a(),l("div",on,[t[29]||(t[29]=s("h4",{class:"directory-detail-heading"},"Apps",-1)),(a(!0),l(H,null,W(U.value.apps,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,i(o.name),1),ft(o)?(a(),l("span",nn,"GPT Plus account required")):o.installUrl?(a(),l("button",{key:1,type:"button",onClick:T=>oe(o.installUrl)},i(o.needsAuth?"Login":"Manage"),9,rn)):c("",!0)]))),128))])):c("",!0),U.value.skills.length>0?(a(),l("div",cn,[t[30]||(t[30]=s("h4",{class:"directory-detail-heading"},"Skills",-1)),s("p",un,i(U.value.skills.map(o=>o.displayName||o.name).join(", ")),1)])):c("",!0),U.value.mcpServers.length>0?(a(),l("div",dn,[t[31]||(t[31]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(a(!0),l(H,null,W(U.value.mcpServers,o=>(a(),l("div",{key:o,class:"directory-include-row"},[s("span",null,[We(i(o)+" ",1),s("span",{class:G(["directory-auth-status",ls(o)])},i(bt(o)),3)]),_t(o)?(a(),l("button",{key:0,type:"button",disabled:y.value===o,onClick:T=>Nt(o)},i(y.value===o?"Opening...":"Authenticate"),9,yn)):c("",!0)]))),128))])):c("",!0)]),yt.value.length>0?(a(),l("div",vn,[(a(!0),l(H,null,W(yt.value,o=>(a(),l("img",{key:o,src:o,alt:"",loading:"lazy"},null,8,pn))),128))])):c("",!0),F.value.length>0?(a(),l("div",hn,[t[32]||(t[32]=s("strong",null,"Apps needing auth",-1)),(a(!0),l(H,null,W(F.value,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,i(o.name),1),o.installUrl?(a(),l("button",{key:0,type:"button",onClick:T=>oe(o.installUrl)},"Login",8,mn)):c("",!0)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",gn,[b.value&&b.value.installed?(a(),l("button",{key:0,class:"directory-action danger",type:"button",disabled:Z.value,onClick:Us},i(Z.value?"Uninstalling...":"Uninstall"),9,fn)):b.value&&!Jt.value?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:Z.value||b.value.installPolicy==="NOT_AVAILABLE"||Ye.value,onClick:Ts},i(Ye.value?"ChatGPT Plus":Z.value?"Installing...":"Install"),9,kn)):b.value?(a(),l("button",bn," GPT Plus account required ")):c("",!0),b.value&&b.value.installed?(a(),l("button",{key:3,class:"directory-action",type:"button",disabled:Z.value,onClick:Ns},i(b.value.enabled?"Disable":"Enable"),9,_n)):c("",!0),b.value&&b.value.installed&&b.value.enabled?(a(),l("button",{key:4,class:"directory-action primary",type:"button",disabled:Z.value||ge.value,onClick:t[16]||(t[16]=o=>bs(b.value))},i(S.tryInFlightKey===ks(b.value)?"Starting...":"Try it!"),9,wn)):c("",!0)])])])):c("",!0)])),(a(),Oe(it,{to:"body"},[ye.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Me(Ft,["self"])},[s("article",Cn,[s("div",Sn,[s("div",$n,[(xt=$.value)!=null&&xt.connector.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:$.value.connector.logoUrl,alt:$.value.connector.name,loading:"lazy"},null,8,An)):(a(),l("div",In,i((Rt=$.value)==null?void 0:Rt.connector.name.charAt(0)),1)),s("div",Pn,[s("h3",Ln,i(((Bt=$.value)==null?void 0:Bt.connector.name)||"Composio"),1),s("span",En,i($.value?At($.value.connector):"Connector"),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close Composio detail",onClick:Ft},"Close")]),s("div",Tn,[ve.value?(a(),l("div",Un,i(ve.value),1)):Ae.value?(a(),l("div",Nn,"Loading connector...")):$.value?(a(),l(H,{key:2},[$.value.connector.description?(a(),l("p",Dn,i($.value.connector.description),1)):c("",!0),s("div",Fn,[s("div",Mn,[t[33]||(t[33]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",On,[s("span",xn,i($.value.connector.toolsCount)+" tools",1),$.value.connector.triggersCount>0?(a(),l("span",Rn,i($.value.connector.triggersCount)+" triggers",1)):c("",!0),$.value.connector.latestVersion?(a(),l("span",Bn,"v"+i($.value.connector.latestVersion),1)):c("",!0),$.value.connector.authModes.length>0?(a(),l("span",Gn,i($.value.connector.authModes.join(", ")),1)):c("",!0)])]),s("div",jn,[t[34]||(t[34]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),$.value.connections.length===0?(a(),l("div",Hn," No linked accounts yet. ")):(a(),l("div",zn,[(a(!0),l(H,null,W($.value.connections,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,[We(i(o.alias||o.wordId||o.id)+" ",1),s("span",{class:G(["directory-auth-status",ms(o.status)])},i(hs(o.status)),3)]),s("span",Kn,i(o.authScheme||"Auth"),1)]))),128))]))])]),$.value.tools.length>0?(a(),l("div",Vn,[t[35]||(t[35]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(a(!0),l(H,null,W($.value.tools.slice(0,8),o=>(a(),l("div",{key:o.slug,class:"directory-include-row"},[s("span",null,i(o.name||o.slug),1),s("span",qn,i(o.slug),1)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",Wn,[$.value?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:t[17]||(t[17]=o=>oe($.value.dashboardUrl))}," Open dashboard ")):c("",!0),$.value&&ze($.value.connector)?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ue.value===$.value.connector.slug,onClick:t[18]||(t[18]=o=>Mt($.value.connector))},i(ue.value===((Gt=$.value)==null?void 0:Gt.connector.slug)?"Opening...":ze($.value.connector)),9,Qn)):c("",!0),$.value&&Pt($.value.connector)?(a(),l("button",{key:2,class:"directory-action primary",type:"button",disabled:ge.value,onClick:t[19]||(t[19]=o=>Lt($.value.connector,$.value.connections))},i(S.tryInFlightKey===It($.value.connector.slug)?"Starting...":"Try it!"),9,Jn)):c("",!0)])])])):c("",!0)]))])}}}),tr=Je(Xn,[["__scopeId","data-v-1c687405"]]);export{tr as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as tt,u as at,x as _,w as O,b as st,C as nt,e as it,o as l,c as o,a,t as n,q as p,f as y,i as ue,l as lt,F as b,r as T,L as ot,g as Ce,p as X,s as G,v as rt,m as Be,T as ut,J as vt,y as k,M as dt,N as ct,O as pt,n as ht,P as Le,Q as ft,_ as wt}from"./index-Dgv-diAL.js";const _t={class:"review-pane-header"},yt={class:"review-pane-heading"},mt={class:"review-pane-eyebrow"},bt={class:"review-pane-title"},kt={class:"review-pane-header-actions"},gt=["aria-label"],Ct={class:"review-pane-toolbar"},Bt={class:"review-pane-toolbar-tabs"},Lt={class:"review-pane-segmented review-pane-segmented-primary"},Ft=["data-active","onClick"],It={class:"review-pane-toolbar-controls"},xt={class:"review-pane-control-cluster"},Rt={class:"review-pane-control-label"},St={class:"review-pane-segmented"},$t=["data-active"],Tt=["data-active","disabled"],At={key:0,class:"review-pane-control-cluster"},Et={class:"review-pane-control-label"},Mt={key:1,class:"review-pane-control-cluster"},Nt={class:"review-pane-control-label"},Pt={class:"review-pane-segmented"},Dt=["data-active"],Wt=["data-active"],Gt={class:"review-pane-toolbar-actions"},zt=["disabled"],Vt=["disabled"],Kt={key:1,class:"review-pane-meta"},Ut={class:"review-pane-summary-pill review-pane-summary-pill-add"},Ht={class:"review-pane-summary-pill review-pane-summary-pill-remove"},Ot={key:0},Xt={key:1},jt={key:2,class:"review-pane-content"},Yt={key:0,class:"review-pane-empty"},qt={class:"review-pane-empty-title"},Jt={key:1,class:"review-pane-empty"},Qt={class:"review-pane-empty-title"},Zt={class:"review-pane-empty-text"},ea=["disabled"],ta={key:2,class:"review-pane-empty"},aa={class:"review-pane-empty-title"},sa={class:"review-pane-empty-text"},na={key:0,class:"review-pane-bulk-actions"},ia=["disabled","onClick"],la={key:1,class:"review-pane-empty"},oa={class:"review-pane-empty-title"},ra={class:"review-pane-empty-text"},ua={key:0,class:"review-pane-file-list"},va=["data-expanded","onClick"],da=["data-expanded"],ca={class:"review-pane-tree-folder-name"},pa={class:"review-pane-tree-folder-count"},ha=["data-active","title","onClick"],fa={class:"review-pane-file-meta-row"},wa={class:"review-pane-file-main"},_a=["data-operation"],ya={class:"review-pane-file-path"},ma={class:"review-pane-file-delta"},ba={class:"review-pane-delta-add"},ka={class:"review-pane-delta-remove"},ga={class:"review-pane-diff"},Ca={class:"review-pane-file-header"},Ba={class:"review-pane-file-header-main"},La={class:"review-pane-file-title"},Fa={class:"review-pane-file-subtitle"},Ia={key:0,class:"review-pane-row-actions"},xa=["disabled","onClick"],Ra={key:0,class:"review-pane-raw-diff"},Sa={key:1,class:"review-pane-hunks"},$a=["data-active","onClick"],Ta={class:"review-pane-hunk-header"},Aa={class:"review-pane-hunk-title"},Ea={class:"review-pane-hunk-meta"},Ma={key:0,class:"review-pane-row-actions"},Na=["disabled","onClick"],Pa={class:"review-pane-lines"},Da=["data-kind"],Wa={class:"review-pane-line-number"},Ga={class:"review-pane-line-number"},za={class:"review-pane-line-marker"},Va={class:"review-pane-line-code"},Ka={key:3,class:"review-pane-findings"},Ua={key:0,class:"review-pane-summary-card"},Ha={class:"review-pane-summary-text"},Oa={key:1,class:"review-pane-findings-list"},Xa=["onClick"],ja={class:"review-pane-finding-title"},Ya={key:0,class:"review-pane-finding-location"},qa={key:1,class:"review-pane-finding-body"},Ja={key:2,class:"review-pane-empty"},Qa={class:"review-pane-empty-text"},Za={class:"review-pane-sheet-header"},es={class:"review-pane-sheet-count"},ts={class:"review-pane-sheet-list"},as=["data-expanded","onClick"],ss=["data-expanded"],ns={class:"review-pane-tree-folder-name"},is={class:"review-pane-tree-folder-count"},ls=["data-active","title","onClick"],os={class:"review-pane-file-meta-row"},rs={class:"review-pane-file-main"},us=["data-operation"],vs={class:"review-pane-file-path"},ds={class:"review-pane-file-delta"},cs={class:"review-pane-delta-add"},ps={class:"review-pane-delta-remove"},Fe="codex-web-local.review-pane-file-list-width.v1",hs=220,fs=420,Ie=288,ws=tt({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean}},emits:["close"],setup(xe){const g=xe,{isMobile:x}=at(),{t:u}=vt(),M=_("changes"),f=_("workspace"),L=_("unstaged"),v=_(null),S=_(""),j=_(!1),$=_(""),F=_(""),Y=_(!1),se=_(!1),N=_(!1),E=_(!1),q=_(!1),z=_(""),I=_(""),P=_(""),D=_({}),J=_(""),ne=new Map;let Q=null,A=null;const Re=[{value:"changes",label:u("Changes")},{value:"findings",label:u("Findings")}],Z=k(()=>`${f.value}:${L.value}`),V=k(()=>D.value[Z.value]??null),C=k(()=>{var e,t;return((e=v.value)==null?void 0:e.files.find(i=>i.id===$.value))??((t=v.value)==null?void 0:t.files[0])??null}),W=_({}),Se=k(()=>{var e,t;return(e=v.value)!=null&&e.isGitRepo?f.value==="workspace"?L.value==="staged"?u("Staged changes"):u("Workspace changes"):(t=v.value)!=null&&t.baseBranch?`${u("Against")} ${v.value.baseBranch}`:u("Base branch"):u("Repository review")}),ve=k(()=>{var e,t;return g.threadId.trim().length>0&&g.cwd.trim().length>0&&((e=v.value)==null?void 0:e.isGitRepo)===!0&&!g.isThreadInProgress&&!(f.value==="baseBranch"&&!((t=v.value)!=null&&t.baseBranch))}),de=k(()=>{var e;return f.value==="workspace"&&((e=v.value)==null?void 0:e.isGitRepo)===!0&&v.value.files.length>0}),ce=k(()=>de.value&&!N.value),$e=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage all")}]:[{value:"stage",label:u("Stage all")},{value:"revert",label:u("Revert all")}]),Te=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage file")}]:[{value:"stage",label:u("Stage file")},{value:"revert",label:u("Revert file")}]),Ae=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage hunk")}]:[{value:"stage",label:u("Stage hunk")},{value:"revert",label:u("Revert hunk")}]),pe=k(()=>I.value||z.value||P.value),Ee=k(()=>!!(I.value||z.value)),ee=_(Pe()),Me=k(()=>{const e={};return x.value||(e["--review-file-list-width"]=`${ee.value}px`),e}),he=k(()=>{var e;return ze(((e=v.value)==null?void 0:e.files)??[],W.value)}),fe=k(()=>he.value.nodes),Ne=k(()=>he.value.folderIdsByFileId);function ie(e){return Number.isFinite(e)?Math.min(fs,Math.max(hs,Math.round(e))):Ie}function Pe(){if(typeof window>"u")return Ie;const e=window.localStorage.getItem(Fe),t=e?Number(e):Number.NaN;return ie(t)}function De(e){typeof window>"u"||window.localStorage.setItem(Fe,String(ie(e)))}function We(e){if(x.value)return;e.preventDefault(),A==null||A();const t=e.clientX,i=ee.value,d=w=>{ee.value=ie(i+(w.clientX-t))},c=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",m),A=null},m=()=>{c(),De(ee.value)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",m),A=c}function Ge(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function we(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function _e(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function ze(e,t){const i={folders:new Map,files:[]},d={};for(const B of e){const s=B.path.split("/").filter(Boolean),r=s.pop()??B.path;let h=i,R="";const ge=[];for(const[et,U]of s.entries()){R=R?`${R}/${U}`:U;let H=h.folders.get(U);H||(H={id:R,name:U,depth:et,folders:new Map,files:[]},h.folders.set(U,H)),h=H,ge.push(H.id)}h.files.push({file:B,name:r,depth:s.length}),d[B.id]=ge}const c=[],m=B=>B.files.length+Array.from(B.folders.values()).reduce((s,r)=>s+m(r),0),w=B=>{const s=Array.from(B.folders.values()).sort((h,R)=>_e(h.name,R.name)),r=[...B.files].sort((h,R)=>_e(h.name,R.name));for(const h of s)c.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:m(h)}),t[h.id]!==!1&&w(h);for(const h of r)c.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return w(i),{nodes:c,folderIdsByFileId:d}}function K(e){return W.value[e]!==!1}function ye(e){W.value={...W.value,[e]:!K(e)}}function le(e){const t=Ne.value[e]??[];if(t.length===0)return;const i={...W.value};let d=!1;for(const c of t)i[c]===!1&&(i[c]=!0,d=!0);d&&(W.value=i)}function te(e){const t=x.value?8:10,i=x.value?12:14;return{paddingLeft:`${t+e*i}px`}}function oe(e){return e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified"}function Ve(e,t){if(!(t instanceof HTMLElement)){ne.delete(e);return}ne.set(e,t)}function Ke(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function ae(){var e,t,i;if(g.cwd.trim()){se.value=!0,z.value="";try{const d=f.value==="baseBranch"?S.value.trim():"",c=await dt(g.cwd,f.value,L.value,d||null);if(c.baseBranchOptions.length>0){const w=c.baseBranch??c.baseBranchOptions[0]??"";S.value!==w&&(j.value=!0,S.value=w)}else S.value!==""&&(j.value=!0,S.value="");v.value=c,c.files.some(w=>w.id===$.value)||($.value=((e=c.files[0])==null?void 0:e.id)??"",F.value=((i=(t=c.files[0])==null?void 0:t.hunks[0])==null?void 0:i.id)??"")}catch(d){z.value=d instanceof Error?d.message:"Failed to load review snapshot"}finally{se.value=!1}}}async function Ue(){if(g.threadId.trim())try{const e=await Le(g.threadId);e.result&&(D.value={...D.value,[Z.value]:e.result})}catch{}}async function me(){await Promise.all([ae(),Ue()])}function be(e){var i,d;le(e),$.value=e;const t=((i=v.value)==null?void 0:i.files.find(c=>c.id===e))??null;F.value=((d=t==null?void 0:t.hunks[0])==null?void 0:d.id)??"",x.value&&(Y.value=!1)}async function re(e,t,i=""){var d,c,m;if(v.value){N.value=!0,I.value="";try{const w=await ft({cwd:g.cwd,scope:f.value,workspaceView:L.value,action:e,level:t,patch:i});v.value=w,w.files.some(s=>s.id===$.value)||($.value=((d=w.files[0])==null?void 0:d.id)??"",F.value=((m=(c=w.files[0])==null?void 0:c.hunks[0])==null?void 0:m.id)??"")}catch(w){I.value=w instanceof Error?w.message:"Failed to apply review action"}finally{N.value=!1}}}async function He(e){await re(e,"all")}async function Oe(e,t){await re(e,"file",t.diff)}async function Xe(e,t){F.value=t.id,await re(e,"hunk",t.patch)}async function je(){if(g.cwd.trim()){q.value=!0,I.value="";try{await ct(g.cwd),await ae()}catch(e){I.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{q.value=!1}}}async function Ye(){var e,t;if(!(!ve.value||E.value)){I.value="",P.value=f.value==="workspace"?"Reviewing current changes":`Reviewing against ${((e=v.value)==null?void 0:e.baseBranch)??"base branch"}`,E.value=!0,J.value=Z.value;try{await pt(g.threadId,f.value,L.value,S.value||(((t=v.value)==null?void 0:t.baseBranch)??null))}catch(i){E.value=!1,P.value="",I.value=i instanceof Error?i.message:"Failed to start review"}}}function qe(e){if(!e.absolutePath)return"";const t=e.startLine?`:${e.startLine}${e.endLine&&e.endLine!==e.startLine?`-${e.endLine}`:""}`:"";return`${e.absolutePath}${t}`}function Je(e,t){if(!t.startLine)return e.hunks[0]??null;for(const i of e.hunks){if(i.newStart!==null){const d=i.newStart+Math.max(i.newLineCount,1)-1;if(t.startLine>=i.newStart&&t.startLine<=d)return i}if(i.oldStart!==null){const d=i.oldStart+Math.max(i.oldLineCount,1)-1;if(t.startLine>=i.oldStart&&t.startLine<=d)return i}}return e.hunks[0]??null}async function ke(e){await ht();const t=ne.get(e);t==null||t.scrollIntoView({block:"center",behavior:"smooth"})}async function Qe(e){var d;M.value="changes";const t=((d=v.value)==null?void 0:d.files.find(c=>c.absolutePath===e.absolutePath||c.previousAbsolutePath===e.absolutePath))??null;if(!t)return;le(t.id),$.value=t.id;const i=Je(t,e);F.value=(i==null?void 0:i.id)??"",i!=null&&i.id&&await ke(i.id)}function Ze(e){if(Ke(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,i=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,d=typeof(i==null?void 0:i.type)=="string"?i.type:"";if(e.method==="item/started"&&d==="enteredReviewMode"){E.value=!0,P.value=typeof(i==null?void 0:i.review)=="string"?i.review:"Review in progress";return}if(e.method==="item/completed"&&d==="exitedReviewMode"){const c=J.value||Z.value;E.value=!1,P.value="",Le(g.threadId).then(m=>{m.result&&(D.value={...D.value,[c]:m.result},M.value="findings")}).catch(m=>{I.value=m instanceof Error?m.message:"Failed to load review result"}).finally(()=>{J.value=""})}}return O(()=>[g.threadId,g.cwd],()=>{$.value="",F.value="",D.value={},J.value="",I.value="",P.value="",me()},{immediate:!0}),O(()=>[f.value,L.value],()=>{$.value="",F.value="",I.value="",z.value="",ae()}),O(S,(e,t)=>{if(j.value){j.value=!1;return}f.value==="baseBranch"&&(!e||e===t||ae())}),O(C,e=>{var t;e&&(le(e.id),e.hunks.some(i=>i.id===F.value)||(F.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),O(F,e=>{e&&ke(e)}),st(()=>{Q=nt(Ze)}),it(()=>{Q&&(Q(),Q=null),A==null||A()}),(e,t)=>{var i,d,c,m,w,B;return l(),o("section",{class:Ce(["review-pane",{"is-mobile":p(x)}]),onClick:t[9]||(t[9]=Be(()=>{},["stop"]))},[a("header",_t,[a("div",yt,[a("p",mt,n(p(u)("Review")),1),a("p",bt,n(Se.value),1)]),a("div",kt,[p(x)&&M.value==="changes"&&((i=v.value)!=null&&i.files.length)?(l(),o("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=s=>Y.value=!0)},n(p(u)("Files")),1)):y("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":p(u)("Close review pane"),onClick:t[1]||(t[1]=s=>e.$emit("close"))},[ue(lt,{class:"icon-svg"})],8,gt)])]),a("div",Ct,[a("div",Bt,[a("div",Lt,[(l(),o(b,null,T(Re,s=>a("button",{key:s.value,type:"button",class:"review-pane-segmented-button review-pane-tab","data-active":M.value===s.value,onClick:r=>M.value=s.value},n(s.label),9,Ft)),64))])]),a("div",It,[a("div",xt,[a("span",Rt,n(p(u)("Compare")),1),a("div",St,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":f.value==="workspace",onClick:t[2]||(t[2]=s=>f.value="workspace")},n(p(u)("Workspace")),9,$t),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":f.value==="baseBranch",disabled:!((d=v.value)!=null&&d.baseBranch),onClick:t[3]||(t[3]=s=>f.value="baseBranch")},n(p(u)("Base branch")),9,Tt)])]),f.value==="baseBranch"&&((c=v.value)!=null&&c.baseBranchOptions.length)?(l(),o("div",At,[a("span",Et,n(p(u)("Branch")),1),ue(ot,{class:"review-pane-branch-select","model-value":S.value,options:v.value.baseBranchOptions.map(s=>({value:s,label:s})),"onUpdate:modelValue":t[4]||(t[4]=s=>S.value=s)},null,8,["model-value","options"])])):y("",!0),f.value==="workspace"?(l(),o("div",Mt,[a("span",Nt,n(p(u)("Changes")),1),a("div",Pt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":L.value==="unstaged",onClick:t[5]||(t[5]=s=>L.value="unstaged")},n(p(u)("Unstaged")),9,Dt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":L.value==="staged",onClick:t[6]||(t[6]=s=>L.value="staged")},n(p(u)("Staged")),9,Wt)])])):y("",!0)]),a("div",Gt,[a("button",{type:"button",class:"review-pane-run",disabled:!ve.value||E.value,onClick:Ye},n(E.value?p(u)("Reviewing…"):p(u)("Run review")),9,zt),a("button",{type:"button",class:"review-pane-refresh",disabled:se.value,onClick:me},n(p(u)("Refresh")),9,Vt)])]),pe.value?(l(),o("div",{key:0,class:Ce(["review-pane-banner",{"is-error":Ee.value}])},n(pe.value),3)):y("",!0),v.value?(l(),o("div",Kt,[a("span",null,n(v.value.summary.fileCount)+" "+n(p(u)("files")),1),a("span",Ut,"+"+n(v.value.summary.addedLineCount),1),a("span",Ht,"-"+n(v.value.summary.removedLineCount),1),v.value.headBranch?(l(),o("span",Ot,n(v.value.headBranch),1)):y("",!0),f.value==="baseBranch"&&v.value.baseBranch?(l(),o("span",Xt,"vs "+n(v.value.baseBranch),1)):y("",!0)])):y("",!0),M.value==="changes"?(l(),o("div",jt,[v.value?v.value.isGitRepo?f.value==="baseBranch"&&!v.value.baseBranch?(l(),o("div",ta,[a("p",aa,n(p(u)("Base branch unavailable")),1),a("p",sa,n(p(u)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(l(),o(b,{key:3},[de.value?(l(),o("div",na,[(l(!0),o(b,null,T($e.value,s=>(l(),o("button",{key:s.value,type:"button",class:"review-pane-bulk-button",disabled:N.value,onClick:r=>He(s.value)},n(s.label),9,ia))),128))])):y("",!0),v.value.files.length?(l(),o("div",{key:2,class:"review-pane-main",style:X(Me.value)},[p(x)?y("",!0):(l(),o("aside",ua,[(l(!0),o(b,null,T(fe.value,s=>{var r;return l(),o(b,{key:s.treeKey},[s.kind==="folder"?(l(),o("button",{key:0,type:"button",class:"review-pane-tree-folder",style:X(te(s.depth)),"data-expanded":K(s.id),onClick:h=>ye(s.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":K(s.id)},null,8,da),a("span",ca,n(s.name),1),a("span",pa,n(s.fileCount),1)],12,va)):(l(),o("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:X(te(s.depth)),"data-active":((r=C.value)==null?void 0:r.id)===s.file.id,title:s.file.path,onClick:h=>be(s.file.id)},[a("span",fa,[a("span",wa,[a("span",{class:"review-pane-file-op","data-operation":s.file.operation},n(oe(s.file.operation)),9,_a),a("span",ya,[G(n(s.name)+" ",1),s.file.previousPath?(l(),o(b,{key:0},[G(" ← "+n(we(s.file.previousPath)),1)],64)):y("",!0)])]),a("span",ma,[a("span",ba,"+"+n(s.file.addedLineCount),1),t[10]||(t[10]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ka,"-"+n(s.file.removedLineCount),1)])])],12,ha))],64)}),128))])),p(x)?y("",!0):(l(),o("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:We},null,32)),a("section",ga,[C.value?(l(),o(b,{key:0},[a("div",Ca,[a("div",Ba,[a("p",La,[G(n(C.value.path)+" ",1),C.value.previousPath?(l(),o(b,{key:0},[G(" ← "+n(C.value.previousPath),1)],64)):y("",!0)]),a("p",Fa,n(oe(C.value.operation))+" · +"+n(C.value.addedLineCount)+" / -"+n(C.value.removedLineCount),1)]),ce.value?(l(),o("div",Ia,[(l(!0),o(b,null,T(Te.value,s=>(l(),o("button",{key:`${C.value.id}:${s.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:r=>Oe(s.value,C.value)},n(s.label),9,xa))),128))])):y("",!0)]),C.value.hunks.length===0?(l(),o("div",Ra,[a("pre",null,n(C.value.diff||"No unified diff available."),1)])):(l(),o("div",Sa,[(l(!0),o(b,null,T(C.value.hunks,s=>(l(),o("article",{key:s.id,ref_for:!0,ref:r=>Ve(s.id,r),class:"review-pane-hunk","data-active":F.value===s.id,onClick:r=>F.value=s.id},[a("div",Ta,[a("div",null,[a("p",Aa,n(s.header),1),a("p",Ea,"+"+n(s.addedLineCount)+" / -"+n(s.removedLineCount),1)]),ce.value?(l(),o("div",Ma,[(l(!0),o(b,null,T(Ae.value,r=>(l(),o("button",{key:`${s.id}:${r.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:h=>Xe(r.value,s)},n(r.label),9,Na))),128))])):y("",!0)]),a("div",Pa,[(l(!0),o(b,null,T(s.lines,r=>(l(),o("div",{key:r.key,class:"review-pane-line","data-kind":r.kind},[a("span",Wa,n(r.oldLine??""),1),a("span",Ga,n(r.newLine??""),1),a("span",za,n(Ge(r.kind)),1),a("code",Va,n(r.text||" "),1)],8,Da))),128))])],8,$a))),128))]))],64)):y("",!0)])],4)):(l(),o("div",la,[a("p",oa,n(p(u)("No changes in this scope")),1),a("p",ra,n(f.value==="workspace"?p(u)("Your current workspace is clean."):p(u)("No merge diff found against the base branch.")),1)]))],64)):(l(),o("div",Jt,[a("p",Qt,n(p(u)("This folder is not a Git repository")),1),a("p",Zt,n(p(u)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:q.value,onClick:je},n(q.value?p(u)("Initializing…"):p(u)("Initialize Git")),9,ea)])):(l(),o("div",Yt,[a("p",qt,n(p(u)("Loading review state")),1)]))])):(l(),o("div",Ka,[(m=V.value)!=null&&m.summary?(l(),o("div",Ua,[t[11]||(t[11]=a("p",{class:"review-pane-summary-title"},"Summary",-1)),a("pre",Ha,n(V.value.summary),1)])):y("",!0),(w=V.value)!=null&&w.findings.length?(l(),o("div",Oa,[(l(!0),o(b,null,T(V.value.findings,s=>(l(),o("button",{key:s.id,type:"button",class:"review-pane-finding",onClick:r=>Qe(s)},[a("span",ja,n(s.title),1),s.absolutePath?(l(),o("span",Ya,n(qe(s)),1)):y("",!0),s.body?(l(),o("span",qa,n(s.body),1)):y("",!0)],8,Xa))),128))])):(l(),o("div",Ja,[t[12]||(t[12]=a("p",{class:"review-pane-empty-title"},"No structured findings yet",-1)),a("p",Qa,n((B=V.value)!=null&&B.summary?"The latest review only returned summary text.":"Run review to populate this pane."),1)]))])),ue(ut,{name:"review-pane-sheet"},{default:rt(()=>{var s;return[p(x)&&Y.value&&((s=v.value)!=null&&s.files.length)?(l(),o("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=r=>Y.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=Be(()=>{},["stop"]))},[t[15]||(t[15]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",Za,[t[13]||(t[13]=a("p",{class:"review-pane-sheet-title"},"Changed files",-1)),a("p",es,n(v.value.files.length),1)]),a("div",ts,[(l(!0),o(b,null,T(fe.value,r=>{var h;return l(),o(b,{key:`sheet:${r.treeKey}`},[r.kind==="folder"?(l(),o("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:X(te(r.depth)),"data-expanded":K(r.id),onClick:R=>ye(r.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":K(r.id)},null,8,ss),a("span",ns,n(r.name),1),a("span",is,n(r.fileCount),1)],12,as)):(l(),o("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:X(te(r.depth)),"data-active":((h=C.value)==null?void 0:h.id)===r.file.id,title:r.file.path,onClick:R=>be(r.file.id)},[a("span",os,[a("span",rs,[a("span",{class:"review-pane-file-op","data-operation":r.file.operation},n(oe(r.file.operation)),9,us),a("span",vs,[G(n(r.name)+" ",1),r.file.previousPath?(l(),o(b,{key:0},[G(" ← "+n(we(r.file.previousPath)),1)],64)):y("",!0)])]),a("span",ds,[a("span",cs,"+"+n(r.file.addedLineCount),1),t[14]||(t[14]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ps,"-"+n(r.file.removedLineCount),1)])])],12,ls))],64)}),128))])])])):y("",!0)]}),_:1})],2)}}}),ys=wt(ws,[["__scopeId","data-v-db0162f9"]]);export{ys as default};
|
|
1
|
+
import{d as tt,u as at,x as _,w as O,b as st,C as nt,e as it,o as l,c as o,a,t as n,q as p,f as y,i as ue,l as lt,F as b,r as T,L as ot,g as Ce,p as X,s as G,v as rt,m as Be,T as ut,J as vt,y as k,M as dt,N as ct,O as pt,n as ht,P as Le,Q as ft,_ as wt}from"./index-7uudGTMH.js";const _t={class:"review-pane-header"},yt={class:"review-pane-heading"},mt={class:"review-pane-eyebrow"},bt={class:"review-pane-title"},kt={class:"review-pane-header-actions"},gt=["aria-label"],Ct={class:"review-pane-toolbar"},Bt={class:"review-pane-toolbar-tabs"},Lt={class:"review-pane-segmented review-pane-segmented-primary"},Ft=["data-active","onClick"],It={class:"review-pane-toolbar-controls"},xt={class:"review-pane-control-cluster"},Rt={class:"review-pane-control-label"},St={class:"review-pane-segmented"},$t=["data-active"],Tt=["data-active","disabled"],At={key:0,class:"review-pane-control-cluster"},Et={class:"review-pane-control-label"},Mt={key:1,class:"review-pane-control-cluster"},Nt={class:"review-pane-control-label"},Pt={class:"review-pane-segmented"},Dt=["data-active"],Wt=["data-active"],Gt={class:"review-pane-toolbar-actions"},zt=["disabled"],Vt=["disabled"],Kt={key:1,class:"review-pane-meta"},Ut={class:"review-pane-summary-pill review-pane-summary-pill-add"},Ht={class:"review-pane-summary-pill review-pane-summary-pill-remove"},Ot={key:0},Xt={key:1},jt={key:2,class:"review-pane-content"},Yt={key:0,class:"review-pane-empty"},qt={class:"review-pane-empty-title"},Jt={key:1,class:"review-pane-empty"},Qt={class:"review-pane-empty-title"},Zt={class:"review-pane-empty-text"},ea=["disabled"],ta={key:2,class:"review-pane-empty"},aa={class:"review-pane-empty-title"},sa={class:"review-pane-empty-text"},na={key:0,class:"review-pane-bulk-actions"},ia=["disabled","onClick"],la={key:1,class:"review-pane-empty"},oa={class:"review-pane-empty-title"},ra={class:"review-pane-empty-text"},ua={key:0,class:"review-pane-file-list"},va=["data-expanded","onClick"],da=["data-expanded"],ca={class:"review-pane-tree-folder-name"},pa={class:"review-pane-tree-folder-count"},ha=["data-active","title","onClick"],fa={class:"review-pane-file-meta-row"},wa={class:"review-pane-file-main"},_a=["data-operation"],ya={class:"review-pane-file-path"},ma={class:"review-pane-file-delta"},ba={class:"review-pane-delta-add"},ka={class:"review-pane-delta-remove"},ga={class:"review-pane-diff"},Ca={class:"review-pane-file-header"},Ba={class:"review-pane-file-header-main"},La={class:"review-pane-file-title"},Fa={class:"review-pane-file-subtitle"},Ia={key:0,class:"review-pane-row-actions"},xa=["disabled","onClick"],Ra={key:0,class:"review-pane-raw-diff"},Sa={key:1,class:"review-pane-hunks"},$a=["data-active","onClick"],Ta={class:"review-pane-hunk-header"},Aa={class:"review-pane-hunk-title"},Ea={class:"review-pane-hunk-meta"},Ma={key:0,class:"review-pane-row-actions"},Na=["disabled","onClick"],Pa={class:"review-pane-lines"},Da=["data-kind"],Wa={class:"review-pane-line-number"},Ga={class:"review-pane-line-number"},za={class:"review-pane-line-marker"},Va={class:"review-pane-line-code"},Ka={key:3,class:"review-pane-findings"},Ua={key:0,class:"review-pane-summary-card"},Ha={class:"review-pane-summary-text"},Oa={key:1,class:"review-pane-findings-list"},Xa=["onClick"],ja={class:"review-pane-finding-title"},Ya={key:0,class:"review-pane-finding-location"},qa={key:1,class:"review-pane-finding-body"},Ja={key:2,class:"review-pane-empty"},Qa={class:"review-pane-empty-text"},Za={class:"review-pane-sheet-header"},es={class:"review-pane-sheet-count"},ts={class:"review-pane-sheet-list"},as=["data-expanded","onClick"],ss=["data-expanded"],ns={class:"review-pane-tree-folder-name"},is={class:"review-pane-tree-folder-count"},ls=["data-active","title","onClick"],os={class:"review-pane-file-meta-row"},rs={class:"review-pane-file-main"},us=["data-operation"],vs={class:"review-pane-file-path"},ds={class:"review-pane-file-delta"},cs={class:"review-pane-delta-add"},ps={class:"review-pane-delta-remove"},Fe="codex-web-local.review-pane-file-list-width.v1",hs=220,fs=420,Ie=288,ws=tt({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean}},emits:["close"],setup(xe){const g=xe,{isMobile:x}=at(),{t:u}=vt(),M=_("changes"),f=_("workspace"),L=_("unstaged"),v=_(null),S=_(""),j=_(!1),$=_(""),F=_(""),Y=_(!1),se=_(!1),N=_(!1),E=_(!1),q=_(!1),z=_(""),I=_(""),P=_(""),D=_({}),J=_(""),ne=new Map;let Q=null,A=null;const Re=[{value:"changes",label:u("Changes")},{value:"findings",label:u("Findings")}],Z=k(()=>`${f.value}:${L.value}`),V=k(()=>D.value[Z.value]??null),C=k(()=>{var e,t;return((e=v.value)==null?void 0:e.files.find(i=>i.id===$.value))??((t=v.value)==null?void 0:t.files[0])??null}),W=_({}),Se=k(()=>{var e,t;return(e=v.value)!=null&&e.isGitRepo?f.value==="workspace"?L.value==="staged"?u("Staged changes"):u("Workspace changes"):(t=v.value)!=null&&t.baseBranch?`${u("Against")} ${v.value.baseBranch}`:u("Base branch"):u("Repository review")}),ve=k(()=>{var e,t;return g.threadId.trim().length>0&&g.cwd.trim().length>0&&((e=v.value)==null?void 0:e.isGitRepo)===!0&&!g.isThreadInProgress&&!(f.value==="baseBranch"&&!((t=v.value)!=null&&t.baseBranch))}),de=k(()=>{var e;return f.value==="workspace"&&((e=v.value)==null?void 0:e.isGitRepo)===!0&&v.value.files.length>0}),ce=k(()=>de.value&&!N.value),$e=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage all")}]:[{value:"stage",label:u("Stage all")},{value:"revert",label:u("Revert all")}]),Te=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage file")}]:[{value:"stage",label:u("Stage file")},{value:"revert",label:u("Revert file")}]),Ae=k(()=>L.value==="staged"?[{value:"unstage",label:u("Unstage hunk")}]:[{value:"stage",label:u("Stage hunk")},{value:"revert",label:u("Revert hunk")}]),pe=k(()=>I.value||z.value||P.value),Ee=k(()=>!!(I.value||z.value)),ee=_(Pe()),Me=k(()=>{const e={};return x.value||(e["--review-file-list-width"]=`${ee.value}px`),e}),he=k(()=>{var e;return ze(((e=v.value)==null?void 0:e.files)??[],W.value)}),fe=k(()=>he.value.nodes),Ne=k(()=>he.value.folderIdsByFileId);function ie(e){return Number.isFinite(e)?Math.min(fs,Math.max(hs,Math.round(e))):Ie}function Pe(){if(typeof window>"u")return Ie;const e=window.localStorage.getItem(Fe),t=e?Number(e):Number.NaN;return ie(t)}function De(e){typeof window>"u"||window.localStorage.setItem(Fe,String(ie(e)))}function We(e){if(x.value)return;e.preventDefault(),A==null||A();const t=e.clientX,i=ee.value,d=w=>{ee.value=ie(i+(w.clientX-t))},c=()=>{window.removeEventListener("pointermove",d),window.removeEventListener("pointerup",m),A=null},m=()=>{c(),De(ee.value)};window.addEventListener("pointermove",d),window.addEventListener("pointerup",m),A=c}function Ge(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function we(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function _e(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function ze(e,t){const i={folders:new Map,files:[]},d={};for(const B of e){const s=B.path.split("/").filter(Boolean),r=s.pop()??B.path;let h=i,R="";const ge=[];for(const[et,U]of s.entries()){R=R?`${R}/${U}`:U;let H=h.folders.get(U);H||(H={id:R,name:U,depth:et,folders:new Map,files:[]},h.folders.set(U,H)),h=H,ge.push(H.id)}h.files.push({file:B,name:r,depth:s.length}),d[B.id]=ge}const c=[],m=B=>B.files.length+Array.from(B.folders.values()).reduce((s,r)=>s+m(r),0),w=B=>{const s=Array.from(B.folders.values()).sort((h,R)=>_e(h.name,R.name)),r=[...B.files].sort((h,R)=>_e(h.name,R.name));for(const h of s)c.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:m(h)}),t[h.id]!==!1&&w(h);for(const h of r)c.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return w(i),{nodes:c,folderIdsByFileId:d}}function K(e){return W.value[e]!==!1}function ye(e){W.value={...W.value,[e]:!K(e)}}function le(e){const t=Ne.value[e]??[];if(t.length===0)return;const i={...W.value};let d=!1;for(const c of t)i[c]===!1&&(i[c]=!0,d=!0);d&&(W.value=i)}function te(e){const t=x.value?8:10,i=x.value?12:14;return{paddingLeft:`${t+e*i}px`}}function oe(e){return e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified"}function Ve(e,t){if(!(t instanceof HTMLElement)){ne.delete(e);return}ne.set(e,t)}function Ke(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function ae(){var e,t,i;if(g.cwd.trim()){se.value=!0,z.value="";try{const d=f.value==="baseBranch"?S.value.trim():"",c=await dt(g.cwd,f.value,L.value,d||null);if(c.baseBranchOptions.length>0){const w=c.baseBranch??c.baseBranchOptions[0]??"";S.value!==w&&(j.value=!0,S.value=w)}else S.value!==""&&(j.value=!0,S.value="");v.value=c,c.files.some(w=>w.id===$.value)||($.value=((e=c.files[0])==null?void 0:e.id)??"",F.value=((i=(t=c.files[0])==null?void 0:t.hunks[0])==null?void 0:i.id)??"")}catch(d){z.value=d instanceof Error?d.message:"Failed to load review snapshot"}finally{se.value=!1}}}async function Ue(){if(g.threadId.trim())try{const e=await Le(g.threadId);e.result&&(D.value={...D.value,[Z.value]:e.result})}catch{}}async function me(){await Promise.all([ae(),Ue()])}function be(e){var i,d;le(e),$.value=e;const t=((i=v.value)==null?void 0:i.files.find(c=>c.id===e))??null;F.value=((d=t==null?void 0:t.hunks[0])==null?void 0:d.id)??"",x.value&&(Y.value=!1)}async function re(e,t,i=""){var d,c,m;if(v.value){N.value=!0,I.value="";try{const w=await ft({cwd:g.cwd,scope:f.value,workspaceView:L.value,action:e,level:t,patch:i});v.value=w,w.files.some(s=>s.id===$.value)||($.value=((d=w.files[0])==null?void 0:d.id)??"",F.value=((m=(c=w.files[0])==null?void 0:c.hunks[0])==null?void 0:m.id)??"")}catch(w){I.value=w instanceof Error?w.message:"Failed to apply review action"}finally{N.value=!1}}}async function He(e){await re(e,"all")}async function Oe(e,t){await re(e,"file",t.diff)}async function Xe(e,t){F.value=t.id,await re(e,"hunk",t.patch)}async function je(){if(g.cwd.trim()){q.value=!0,I.value="";try{await ct(g.cwd),await ae()}catch(e){I.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{q.value=!1}}}async function Ye(){var e,t;if(!(!ve.value||E.value)){I.value="",P.value=f.value==="workspace"?"Reviewing current changes":`Reviewing against ${((e=v.value)==null?void 0:e.baseBranch)??"base branch"}`,E.value=!0,J.value=Z.value;try{await pt(g.threadId,f.value,L.value,S.value||(((t=v.value)==null?void 0:t.baseBranch)??null))}catch(i){E.value=!1,P.value="",I.value=i instanceof Error?i.message:"Failed to start review"}}}function qe(e){if(!e.absolutePath)return"";const t=e.startLine?`:${e.startLine}${e.endLine&&e.endLine!==e.startLine?`-${e.endLine}`:""}`:"";return`${e.absolutePath}${t}`}function Je(e,t){if(!t.startLine)return e.hunks[0]??null;for(const i of e.hunks){if(i.newStart!==null){const d=i.newStart+Math.max(i.newLineCount,1)-1;if(t.startLine>=i.newStart&&t.startLine<=d)return i}if(i.oldStart!==null){const d=i.oldStart+Math.max(i.oldLineCount,1)-1;if(t.startLine>=i.oldStart&&t.startLine<=d)return i}}return e.hunks[0]??null}async function ke(e){await ht();const t=ne.get(e);t==null||t.scrollIntoView({block:"center",behavior:"smooth"})}async function Qe(e){var d;M.value="changes";const t=((d=v.value)==null?void 0:d.files.find(c=>c.absolutePath===e.absolutePath||c.previousAbsolutePath===e.absolutePath))??null;if(!t)return;le(t.id),$.value=t.id;const i=Je(t,e);F.value=(i==null?void 0:i.id)??"",i!=null&&i.id&&await ke(i.id)}function Ze(e){if(Ke(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,i=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,d=typeof(i==null?void 0:i.type)=="string"?i.type:"";if(e.method==="item/started"&&d==="enteredReviewMode"){E.value=!0,P.value=typeof(i==null?void 0:i.review)=="string"?i.review:"Review in progress";return}if(e.method==="item/completed"&&d==="exitedReviewMode"){const c=J.value||Z.value;E.value=!1,P.value="",Le(g.threadId).then(m=>{m.result&&(D.value={...D.value,[c]:m.result},M.value="findings")}).catch(m=>{I.value=m instanceof Error?m.message:"Failed to load review result"}).finally(()=>{J.value=""})}}return O(()=>[g.threadId,g.cwd],()=>{$.value="",F.value="",D.value={},J.value="",I.value="",P.value="",me()},{immediate:!0}),O(()=>[f.value,L.value],()=>{$.value="",F.value="",I.value="",z.value="",ae()}),O(S,(e,t)=>{if(j.value){j.value=!1;return}f.value==="baseBranch"&&(!e||e===t||ae())}),O(C,e=>{var t;e&&(le(e.id),e.hunks.some(i=>i.id===F.value)||(F.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),O(F,e=>{e&&ke(e)}),st(()=>{Q=nt(Ze)}),it(()=>{Q&&(Q(),Q=null),A==null||A()}),(e,t)=>{var i,d,c,m,w,B;return l(),o("section",{class:Ce(["review-pane",{"is-mobile":p(x)}]),onClick:t[9]||(t[9]=Be(()=>{},["stop"]))},[a("header",_t,[a("div",yt,[a("p",mt,n(p(u)("Review")),1),a("p",bt,n(Se.value),1)]),a("div",kt,[p(x)&&M.value==="changes"&&((i=v.value)!=null&&i.files.length)?(l(),o("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=s=>Y.value=!0)},n(p(u)("Files")),1)):y("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":p(u)("Close review pane"),onClick:t[1]||(t[1]=s=>e.$emit("close"))},[ue(lt,{class:"icon-svg"})],8,gt)])]),a("div",Ct,[a("div",Bt,[a("div",Lt,[(l(),o(b,null,T(Re,s=>a("button",{key:s.value,type:"button",class:"review-pane-segmented-button review-pane-tab","data-active":M.value===s.value,onClick:r=>M.value=s.value},n(s.label),9,Ft)),64))])]),a("div",It,[a("div",xt,[a("span",Rt,n(p(u)("Compare")),1),a("div",St,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":f.value==="workspace",onClick:t[2]||(t[2]=s=>f.value="workspace")},n(p(u)("Workspace")),9,$t),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":f.value==="baseBranch",disabled:!((d=v.value)!=null&&d.baseBranch),onClick:t[3]||(t[3]=s=>f.value="baseBranch")},n(p(u)("Base branch")),9,Tt)])]),f.value==="baseBranch"&&((c=v.value)!=null&&c.baseBranchOptions.length)?(l(),o("div",At,[a("span",Et,n(p(u)("Branch")),1),ue(ot,{class:"review-pane-branch-select","model-value":S.value,options:v.value.baseBranchOptions.map(s=>({value:s,label:s})),"onUpdate:modelValue":t[4]||(t[4]=s=>S.value=s)},null,8,["model-value","options"])])):y("",!0),f.value==="workspace"?(l(),o("div",Mt,[a("span",Nt,n(p(u)("Changes")),1),a("div",Pt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":L.value==="unstaged",onClick:t[5]||(t[5]=s=>L.value="unstaged")},n(p(u)("Unstaged")),9,Dt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":L.value==="staged",onClick:t[6]||(t[6]=s=>L.value="staged")},n(p(u)("Staged")),9,Wt)])])):y("",!0)]),a("div",Gt,[a("button",{type:"button",class:"review-pane-run",disabled:!ve.value||E.value,onClick:Ye},n(E.value?p(u)("Reviewing…"):p(u)("Run review")),9,zt),a("button",{type:"button",class:"review-pane-refresh",disabled:se.value,onClick:me},n(p(u)("Refresh")),9,Vt)])]),pe.value?(l(),o("div",{key:0,class:Ce(["review-pane-banner",{"is-error":Ee.value}])},n(pe.value),3)):y("",!0),v.value?(l(),o("div",Kt,[a("span",null,n(v.value.summary.fileCount)+" "+n(p(u)("files")),1),a("span",Ut,"+"+n(v.value.summary.addedLineCount),1),a("span",Ht,"-"+n(v.value.summary.removedLineCount),1),v.value.headBranch?(l(),o("span",Ot,n(v.value.headBranch),1)):y("",!0),f.value==="baseBranch"&&v.value.baseBranch?(l(),o("span",Xt,"vs "+n(v.value.baseBranch),1)):y("",!0)])):y("",!0),M.value==="changes"?(l(),o("div",jt,[v.value?v.value.isGitRepo?f.value==="baseBranch"&&!v.value.baseBranch?(l(),o("div",ta,[a("p",aa,n(p(u)("Base branch unavailable")),1),a("p",sa,n(p(u)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(l(),o(b,{key:3},[de.value?(l(),o("div",na,[(l(!0),o(b,null,T($e.value,s=>(l(),o("button",{key:s.value,type:"button",class:"review-pane-bulk-button",disabled:N.value,onClick:r=>He(s.value)},n(s.label),9,ia))),128))])):y("",!0),v.value.files.length?(l(),o("div",{key:2,class:"review-pane-main",style:X(Me.value)},[p(x)?y("",!0):(l(),o("aside",ua,[(l(!0),o(b,null,T(fe.value,s=>{var r;return l(),o(b,{key:s.treeKey},[s.kind==="folder"?(l(),o("button",{key:0,type:"button",class:"review-pane-tree-folder",style:X(te(s.depth)),"data-expanded":K(s.id),onClick:h=>ye(s.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":K(s.id)},null,8,da),a("span",ca,n(s.name),1),a("span",pa,n(s.fileCount),1)],12,va)):(l(),o("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:X(te(s.depth)),"data-active":((r=C.value)==null?void 0:r.id)===s.file.id,title:s.file.path,onClick:h=>be(s.file.id)},[a("span",fa,[a("span",wa,[a("span",{class:"review-pane-file-op","data-operation":s.file.operation},n(oe(s.file.operation)),9,_a),a("span",ya,[G(n(s.name)+" ",1),s.file.previousPath?(l(),o(b,{key:0},[G(" ← "+n(we(s.file.previousPath)),1)],64)):y("",!0)])]),a("span",ma,[a("span",ba,"+"+n(s.file.addedLineCount),1),t[10]||(t[10]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ka,"-"+n(s.file.removedLineCount),1)])])],12,ha))],64)}),128))])),p(x)?y("",!0):(l(),o("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:We},null,32)),a("section",ga,[C.value?(l(),o(b,{key:0},[a("div",Ca,[a("div",Ba,[a("p",La,[G(n(C.value.path)+" ",1),C.value.previousPath?(l(),o(b,{key:0},[G(" ← "+n(C.value.previousPath),1)],64)):y("",!0)]),a("p",Fa,n(oe(C.value.operation))+" · +"+n(C.value.addedLineCount)+" / -"+n(C.value.removedLineCount),1)]),ce.value?(l(),o("div",Ia,[(l(!0),o(b,null,T(Te.value,s=>(l(),o("button",{key:`${C.value.id}:${s.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:r=>Oe(s.value,C.value)},n(s.label),9,xa))),128))])):y("",!0)]),C.value.hunks.length===0?(l(),o("div",Ra,[a("pre",null,n(C.value.diff||"No unified diff available."),1)])):(l(),o("div",Sa,[(l(!0),o(b,null,T(C.value.hunks,s=>(l(),o("article",{key:s.id,ref_for:!0,ref:r=>Ve(s.id,r),class:"review-pane-hunk","data-active":F.value===s.id,onClick:r=>F.value=s.id},[a("div",Ta,[a("div",null,[a("p",Aa,n(s.header),1),a("p",Ea,"+"+n(s.addedLineCount)+" / -"+n(s.removedLineCount),1)]),ce.value?(l(),o("div",Ma,[(l(!0),o(b,null,T(Ae.value,r=>(l(),o("button",{key:`${s.id}:${r.value}`,type:"button",class:"review-pane-row-button",disabled:N.value,onClick:h=>Xe(r.value,s)},n(r.label),9,Na))),128))])):y("",!0)]),a("div",Pa,[(l(!0),o(b,null,T(s.lines,r=>(l(),o("div",{key:r.key,class:"review-pane-line","data-kind":r.kind},[a("span",Wa,n(r.oldLine??""),1),a("span",Ga,n(r.newLine??""),1),a("span",za,n(Ge(r.kind)),1),a("code",Va,n(r.text||" "),1)],8,Da))),128))])],8,$a))),128))]))],64)):y("",!0)])],4)):(l(),o("div",la,[a("p",oa,n(p(u)("No changes in this scope")),1),a("p",ra,n(f.value==="workspace"?p(u)("Your current workspace is clean."):p(u)("No merge diff found against the base branch.")),1)]))],64)):(l(),o("div",Jt,[a("p",Qt,n(p(u)("This folder is not a Git repository")),1),a("p",Zt,n(p(u)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:q.value,onClick:je},n(q.value?p(u)("Initializing…"):p(u)("Initialize Git")),9,ea)])):(l(),o("div",Yt,[a("p",qt,n(p(u)("Loading review state")),1)]))])):(l(),o("div",Ka,[(m=V.value)!=null&&m.summary?(l(),o("div",Ua,[t[11]||(t[11]=a("p",{class:"review-pane-summary-title"},"Summary",-1)),a("pre",Ha,n(V.value.summary),1)])):y("",!0),(w=V.value)!=null&&w.findings.length?(l(),o("div",Oa,[(l(!0),o(b,null,T(V.value.findings,s=>(l(),o("button",{key:s.id,type:"button",class:"review-pane-finding",onClick:r=>Qe(s)},[a("span",ja,n(s.title),1),s.absolutePath?(l(),o("span",Ya,n(qe(s)),1)):y("",!0),s.body?(l(),o("span",qa,n(s.body),1)):y("",!0)],8,Xa))),128))])):(l(),o("div",Ja,[t[12]||(t[12]=a("p",{class:"review-pane-empty-title"},"No structured findings yet",-1)),a("p",Qa,n((B=V.value)!=null&&B.summary?"The latest review only returned summary text.":"Run review to populate this pane."),1)]))])),ue(ut,{name:"review-pane-sheet"},{default:rt(()=>{var s;return[p(x)&&Y.value&&((s=v.value)!=null&&s.files.length)?(l(),o("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=r=>Y.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=Be(()=>{},["stop"]))},[t[15]||(t[15]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",Za,[t[13]||(t[13]=a("p",{class:"review-pane-sheet-title"},"Changed files",-1)),a("p",es,n(v.value.files.length),1)]),a("div",ts,[(l(!0),o(b,null,T(fe.value,r=>{var h;return l(),o(b,{key:`sheet:${r.treeKey}`},[r.kind==="folder"?(l(),o("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:X(te(r.depth)),"data-expanded":K(r.id),onClick:R=>ye(r.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":K(r.id)},null,8,ss),a("span",ns,n(r.name),1),a("span",is,n(r.fileCount),1)],12,as)):(l(),o("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:X(te(r.depth)),"data-active":((h=C.value)==null?void 0:h.id)===r.file.id,title:r.file.path,onClick:R=>be(r.file.id)},[a("span",os,[a("span",rs,[a("span",{class:"review-pane-file-op","data-operation":r.file.operation},n(oe(r.file.operation)),9,us),a("span",vs,[G(n(r.name)+" ",1),r.file.previousPath?(l(),o(b,{key:0},[G(" ← "+n(we(r.file.previousPath)),1)],64)):y("",!0)])]),a("span",ds,[a("span",cs,"+"+n(r.file.addedLineCount),1),t[14]||(t[14]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",ps,"-"+n(r.file.removedLineCount),1)])])],12,ls))],64)}),128))])])])):y("",!0)]}),_:1})],2)}}}),ys=wt(ws,[["__scopeId","data-v-db0162f9"]]);export{ys as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as In,o as r,c as l,a as u,d as Ns,u as Vs,w as Y,n as bt,b as Us,e as qs,t as h,f as v,F as y,r as b,g as x,h as Ks,i as Q,I as Gs,j as Zs,k as Xs,l as Tn,m as Ge,p as xt,q as Ct,s as ee,v as Mn,T as Js,x as C,y as L,z as Ys,A as Qs,B as ei}from"./index-
|
|
1
|
+
import{_ as In,o as r,c as l,a as u,d as Ns,u as Vs,w as Y,n as bt,b as Us,e as qs,t as h,f as v,F as y,r as b,g as x,h as Ks,i as Q,I as Gs,j as Zs,k as Xs,l as Tn,m as Ge,p as xt,q as Ct,s as ee,v as Mn,T as Js,x as C,y as L,z as Ys,A as Qs,B as ei}from"./index-7uudGTMH.js";const ti={},ni={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function si(M,xe){return r(),l("svg",ni,[...xe[0]||(xe[0]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const ii=In(ti,[["render",si]]),oi={key:0,class:"conversation-loading"},ai={key:1,class:"conversation-empty"},ri={key:0,class:"conversation-load-more"},li=["disabled"],ci=["data-role","data-message-type"],ui={key:0,class:"message-row","data-role":"system"},di={class:"message-stack","data-role":"system"},fi=["onClick"],hi={class:"cmd-group-label"},pi={class:"cmd-status"},mi={class:"cmd-group-inner"},ki=["onClick"],vi={class:"cmd-label"},gi={class:"cmd-status"},yi={class:"cmd-output-inner"},_i=["textContent"],wi=["onClick"],bi={class:"cmd-label"},xi={class:"cmd-status"},Ci={class:"cmd-output-inner"},$i=["textContent"],Li=["data-role","data-message-type"],Ti=["data-role"],Mi=["data-role"],Ii={key:0,class:"file-change-summary-block"},Si=["onClick"],Pi={class:"file-change-summary-label"},Ai={class:"file-change-summary-status"},Ei=["data-tone"],Bi={class:"file-change-panel-inner"},Fi={class:"file-change-list"},Wi=["data-operation"],Ri=["title","onClick"],Hi={key:0,class:"file-change-arrow"},Oi=["title","onClick"],zi={key:2,class:"file-change-delta"},ji=["data-tone"],Di=["data-role","data-message-type"],Ni=["data-role"],Vi=["data-role"],Ui=["data-role"],qi=["onClick"],Ki=["src","alt"],Gi={key:1,class:"message-file-attachments"},Zi=["href","title"],Xi={key:2,class:"message-skill-attachments"},Ji=["href","title"],Yi={class:"message-skill-chip-name"},Qi=["data-role"],eo={key:0,class:"automation-message-label"},to={key:0},no={key:1,class:"worked-separator-wrap","aria-live":"polite"},so=["onClick"],io={class:"worked-separator-text"},oo={key:0,class:"worked-details"},ao=["onClick"],ro={class:"cmd-label"},lo={class:"cmd-status"},co={class:"cmd-output-inner"},uo=["textContent"],fo=["data-streaming"],ho={class:"plan-card-header"},po={key:0,class:"plan-card-badge"},mo=["innerHTML"],ko={key:1,class:"plan-step-list"},vo=["data-status"],go=["data-status"],yo=["innerHTML"],_o=["innerHTML"],wo={key:3,class:"plan-card-actions"},bo=["onClick"],xo={key:0,class:"message-text"},Co={key:0},$o={key:1,class:"message-bold-text"},Lo={key:2,class:"message-italic-text"},To={key:3,class:"message-strikethrough-text"},Mo=["href","title"],Io=["href","title"],So={key:6,class:"message-inline-code"},Po={key:0},Ao={key:1,class:"message-bold-text"},Eo={key:2,class:"message-italic-text"},Bo={key:3,class:"message-strikethrough-text"},Fo=["href","title"],Wo=["href","title"],Ro={key:6,class:"message-inline-code"},Ho={key:2,class:"message-blockquote"},Oo={key:0},zo={key:1,class:"message-bold-text"},jo={key:2,class:"message-italic-text"},Do={key:3,class:"message-strikethrough-text"},No=["href","title"],Vo=["href","title"],Uo={key:6,class:"message-inline-code"},qo={key:3,class:"message-list message-list-unordered"},Ko=["innerHTML"],Go={key:4,class:"message-list message-task-list"},Zo=["data-checked"],Xo={class:"message-list-item-text"},Jo={key:0},Yo={key:1,class:"message-bold-text"},Qo={key:2,class:"message-italic-text"},ea={key:3,class:"message-strikethrough-text"},ta=["href","title"],na=["href","title"],sa={key:6,class:"message-inline-code"},ia=["start"],oa=["innerHTML"],aa={key:6,class:"message-table-wrap"},ra={class:"message-table"},la={key:0},ca={key:1,class:"message-bold-text"},ua={key:2,class:"message-italic-text"},da={key:3,class:"message-strikethrough-text"},fa=["href","title"],ha=["href","title"],pa={key:6,class:"message-inline-code"},ma={key:0},ka={key:0},va={key:1,class:"message-bold-text"},ga={key:2,class:"message-italic-text"},ya={key:3,class:"message-strikethrough-text"},_a=["href","title"],wa=["href","title"],ba={key:6,class:"message-inline-code"},xa={key:7,class:"message-code-block"},Ca={key:0,class:"message-code-language"},$a={class:"message-code-pre"},La=["innerHTML"],Ta={key:8,class:"message-divider"},Ma={key:9,class:"message-text"},Ia=["onClick"],Sa=["src","alt","onError"],Pa={key:4,class:"file-change-summary-block file-change-summary-block-inline"},Aa=["onClick"],Ea={class:"file-change-summary-label"},Ba={class:"file-change-summary-status"},Fa=["data-tone"],Wa={class:"file-change-panel-inner"},Ra={class:"file-change-list"},Ha=["data-operation"],Oa=["title","onClick"],za={key:0,class:"file-change-arrow"},ja=["title","onClick"],Da={key:2,class:"file-change-delta"},Na=["data-tone"],Va=["data-role"],Ua=["onClick"],qa=["onClick"],Ka=["data-copied","aria-label","title","onClick"],Ga={class:"message-copy-label"},Za={key:1,class:"conversation-item conversation-item-overlay"},Xa={class:"message-row"},Ja={class:"message-stack"},Ya={class:"live-overlay-inline","aria-live":"polite"},Qa={class:"live-overlay-label"},er={key:0,class:"live-overlay-reasoning"},tr={key:1,class:"live-overlay-error"},nr=["src"],sr={key:0,class:"diff-viewer-sidebar"},ir={class:"diff-viewer-sidebar-header"},or={class:"diff-viewer-sidebar-count"},ar={class:"diff-viewer-sidebar-list"},rr=["data-active","onClick"],lr=["data-operation"],cr={class:"diff-viewer-file-label"},ur={key:0,class:"diff-viewer-file-delta"},dr={class:"diff-viewer-main"},fr={class:"diff-viewer-toolbar"},hr={class:"diff-viewer-title-wrap"},pr={class:"diff-viewer-title"},mr={class:"diff-viewer-subtitle"},kr={key:0},vr={class:"diff-viewer-toolbar-actions"},gr={key:0,class:"diff-viewer-empty"},yr={key:1,class:"diff-viewer-panel"},_r={class:"diff-viewer-meta"},wr={class:"diff-viewer-language"},br={class:"diff-viewer-lines"},xr=["data-kind"],Cr={class:"diff-viewer-line-number"},$r={class:"diff-viewer-line-number"},Lr={class:"diff-viewer-line-marker"},Tr=["innerHTML"],Mr={class:"diff-viewer-mobile-sheet-header"},Ir={class:"diff-viewer-sidebar-count"},Sr={class:"diff-viewer-mobile-sheet-list"},Pr=["data-active","onClick"],Ar=["data-operation"],Er={class:"diff-viewer-file-label"},Br={key:0,class:"diff-viewer-file-delta"},Fr=16,Wr=300,Rr=1200,Hr=300,Or=250,$t=50,zr=30,jr=200,Dr=Ns({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{}},emits:["forkThread","rollback","implementPlan","respondServerRequest"],setup(M,{expose:xe,emit:Sn}){const fe=C(new Set),z=C(new Set),he=C(new Set),Ze=C(new Set),pe=C(new Set),Xe=C(null),Ce=C(""),D=C(!1),Lt=C(null),me=C(!1),Tt=C(0),Mt=C(0),Je=C(""),Ye=C(""),{isMobile:$e}=Vs();function Pn(e){var i;const n=e.replace(/\r\n/g,`
|
|
2
2
|
`).trim();if(!n)return null;const t=[],s=[];for(const a of n.split(`
|
|
3
3
|
`)){const c=a.trim();if(!c){t.length===0&&s.push("");continue}const o=c.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(o){const f=(o[1]??" ").toLowerCase();let d="pending";f==="x"&&(d="completed"),(f==="~"||f===">"||f==="-")&&(d="inProgress"),t.push({step:((i=o[2])==null?void 0:i.trim())??"",status:d});continue}s.push(c)}return t.length===0?null:{explanation:s.join(`
|
|
4
4
|
`).trim(),steps:t.filter(a=>a.step.length>0)}}function Qe(e){var n;return e.plan&&e.plan.steps.length>0?{explanation:((n=e.plan.explanation)==null?void 0:n.trim())??"",steps:e.plan.steps}:Pn(e.text)}function B(e){return e.messageType==="commandExecution"&&!!e.commandExecution}function et(e){return e.messageType==="plan"||e.messageType==="plan.live"}function An(e){return et(e)&&e.messageType!=="plan.live"&&e.role==="assistant"&&!!e.turnId}function En(e){var t;const n=((t=e.turnId)==null?void 0:t.trim())??"";n&<("implementPlan",{turnId:n})}function tt(e){return e.messageType==="fileChange"&&e.fileChangeStatus==="completed"&&Array.isArray(e.fileChanges)&&e.fileChanges.length>0}function Le(e){return e.role==="assistant"&&!B(e)&&e.messageType!=="worked"&&!(e.messageType??"").endsWith(".live")}const nt=L(()=>{var e;for(let n=g.messages.length-1;n>=0;n-=1){const t=g.messages[n];if(t.messageType==="commandExecution"&&((e=t.commandExecution)==null?void 0:e.status)==="inProgress")return t.id}return""}),It=L(()=>g.messages.some(e=>e.role==="assistant"&&e.messageType==="agentMessage.live"&&e.text.trim().length>0)),St=L(()=>!!g.liveOverlay||nt.value.length>0||It.value),st=L(()=>{const e={};for(let n=0;n<g.messages.length;){const t=g.messages[n];if(!B(t)){n+=1;continue}const s=[];for(;n<g.messages.length&&B(g.messages[n]);)s.push(g.messages[n]),n+=1;if(s.length<=1)continue;const i=s[s.length-1];e[i.id]=s.slice(0,-1)}return e}),Bn=L(()=>{const e=new Set;for(const n of Object.values(st.value))for(const t of n)e.add(t.id);return e});function Pt(e){var n;return((n=Qe(e))==null?void 0:n.explanation)??""}function At(e){var n;return((n=Qe(e))==null?void 0:n.steps)??[]}function Fn(e){switch(e){case"completed":return"✓";case"inProgress":return"•";default:return"○"}}function Et(e){return!It.value&&e.id===nt.value}function F(e){return B(e)?fe.value.has(e.id)||!z.value.has(e.id)&&Et(e):!1}function it(e){return B(e)&&St.value}function ot(e){var n;return B(e)&&(St.value||((n=e.commandExecution)==null?void 0:n.status)==="inProgress")}function at(e){if(!B(e))return;const n=new Set(fe.value),t=new Set(z.value),s=Et(e);n.has(e.id)?(n.delete(e.id),s&&t.add(e.id)):s&&!t.has(e.id)?t.add(e.id):(n.add(e.id),t.delete(e.id)),fe.value=n,z.value=t}function Te(e){return st.value[e.id]??[]}function Bt(e){return B(e)?[...Te(e),e]:[]}function Wn(e){if(Te(e).length===0)return;const t=new Set(he.value);t.has(e.id)?t.delete(e.id):t.add(e.id),he.value=t}function rt(e){return he.value.has(e.id)}function Rn(e){var a,c;const t=Bt(e).length,s=((c=(a=e.commandExecution)==null?void 0:a.command)==null?void 0:c.trim())||"(command)";return`${t===1?"1 command":`${t} commands`} · latest: ${s}`}function Hn(e){return Ie(e)}function On(e){const n=new Set(Ze.value);n.has(e.id)?n.delete(e.id):n.add(e.id),Ze.value=n}function Ft(e){return Ze.value.has(e.id)}function Wt(e){const n=new Set(pe.value);n.has(e.id)?n.delete(e.id):n.add(e.id),pe.value=n}function te(e){return pe.value.has(e.id)}function T(e){return`${e.path}\0${e.movedToPath??""}`}function Me(e,n){e&&(Xe.value=e,Ce.value=T(n),D.value=!1)}function Rt(){Xe.value=null,Ce.value="",D.value=!1}function zn(){D.value=!D.value}function jn(){D.value=!1}function Ht(e){Ce.value=T(e),$e.value&&(D.value=!1)}function Ie(e){const n=e.commandExecution;if(!n)return"";const t=it(e);switch(n.status){case"inProgress":return t?"Running":"⟳ Running";case"completed":return n.exitCode===0?t?"Done":"✓ Completed":`Exit ${n.exitCode??"?"}`;case"failed":return t?"Failed":"✗ Failed";case"declined":return t?"Declined":"⊘ Declined";case"interrupted":return t?"Stopped":"⊘ Interrupted";default:return""}}function Se(e){var t,s;const n=(t=e.commandExecution)==null?void 0:t.status;return n==="inProgress"?"cmd-status-running":n==="completed"&&((s=e.commandExecution)==null?void 0:s.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function Pe(e,n){if(e.size===0)return e;const t=new Set;for(const s of e)n.has(s)&&t.add(s);return t.size===e.size?e:t}function Dn(e,n){const t=[];for(let s=n-1;s>=0;s--){const i=e[s];if(i.messageType==="commandExecution")t.unshift(i);else if(i.role==="user"||i.messageType==="worked")break}return t}const g=M,lt=Sn,N=C(null),Ot=C(null),ke=C(""),V=C(""),j=C(!0),zt={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown","c++":"cpp","c#":"csharp",ps1:"powershell"};let U=0,E=0,Ae=0,q=null,ve=null;const jt=new WeakSet,Ee=C(null),ne=C(0),Dt=C(0);let Be=null;const ge=new Map,ye=new Map,se=new Map,ie=new Map;function Fe(e,n,t,s){for(e.has(n)&&e.delete(n),e.set(n,t);e.size>s;){const i=e.keys().next().value;if(i===void 0)break;e.delete(i)}return t}const W=C(0),K=C(!1),Nn=L(()=>g.messages.slice(W.value)),ct=L(()=>W.value>0),Vn=L(()=>!j.value&&(g.messages.length>0||g.pendingRequests.length>0||!!g.liveOverlay));function Un(){return Ee.value?Promise.resolve():(Be||(Be=Ys(()=>import("./common-BeuopZEI.js"),[]).then(e=>{Ee.value=e.default,ie.clear(),se.clear(),ne.value+=1}).finally(()=>{Be=null})),Be)}function qn(e){if(!e||/[\r\n]/u.test(e)||e.endsWith("/")||e.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;const n=e.startsWith("/"),t=/^[A-Za-z]:[\\/]/u.test(e),s=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return n||t||s||/^[A-Za-z0-9._@() -]+\.[A-Za-z0-9]{1,12}$/u.test(e)?!0:/^[A-Za-z0-9._@() -]+(?:[\\/][A-Za-z0-9._@() -]+)+$/u.test(e)}function We(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function oe(e){return e.replace(/\\/gu,"/")}function Nt(e){if(!e.startsWith("file://"))return e;let n=e.replace(/^file:\/\//u,"");try{n=decodeURIComponent(n)}catch{}return/^\/[A-Za-z]:\//u.test(n)&&(n=n.slice(1)),n}function Kn(e){const n=oe(e),t=n.match(/^\/Users\/([^/]+)/u);if(t)return`/Users/${t[1]}`;const s=n.match(/^\/home\/([^/]+)/u);return s?`/home/${s[1]}`:""}function ae(e){const n=oe(e);if(!n)return n;let t="",s=n;const i=s.match(/^([A-Za-z]:)(\/.*)?$/u);i?(t=`${i[1]}/`,s=(i[2]??"").replace(/^\/+/u,"")):s.startsWith("/")&&(t="/",s=s.slice(1));const a=s.split("/").filter(Boolean),c=[];for(const f of a)if(f!=="."){if(f===".."){c.length>0&&c.pop();continue}c.push(f)}const o=c.join("/");return t?`${t}${o}`.replace(/\/+$/u,"")||t:o||n}function Vt(e,n){const t=oe(Nt(e.trim()));if(!t)return"";if(t.startsWith("/")||/^[A-Za-z]:\//u.test(t))return ae(t);if(t.startsWith("~/")){const a=Kn(n);if(a)return ae(`${a}/${t.slice(2)}`)}const i=oe(n.trim());return ae(i?`${i.replace(/\/+$/u,"")}/${t}`:t)}function _e(e){if(!e)return null;let n=e.trim();n=Re(n).core.trim();let s=null;const i=n.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(i)n=i[1],s=Number(i[2]);else{const a=n.match(/^(.*):(\d+)(?::\d+)?$/u);a&&(n=a[1],s=Number(a[2]))}return n=Nt(n),qn(n)?{path:n,line:s}:null}function Re(e){let n=e,t="",s="";const i={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;n.length>0;){const a=n[0],c=Object.prototype.hasOwnProperty.call(i,a)?i[a]:"";if(!c||!n.endsWith(c))break;t+=a,s+=c,n=n.slice(1,-1)}return{core:n,leading:t,trailing:s}}function ut(e){const n=e.trim();if(!n.startsWith("[")||!n.endsWith(")"))return null;const t=n.indexOf("]");if(t<=1||n[t+1]!=="(")return null;const s=n.slice(1,t).trim(),i=n.slice(t+2,-1).trim();if(s.includes(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as dn,x as ct,b as un,C as _n,e as fn,w as pn,D as vs,n as gn,E as vn,G as mn,H as Sn,o as Ht,c as Wt,a as Ke,F as wn,r as bn,g as ms,t as zt,q as Ft,f as yn,J as Cn,K as kn,_ as xn}from"./index-
|
|
1
|
+
import{d as dn,x as ct,b as un,C as _n,e as fn,w as pn,D as vs,n as gn,E as vn,G as mn,H as Sn,o as Ht,c as Wt,a as Ke,F as wn,r as bn,g as ms,t as zt,q as Ft,f as yn,J as Cn,K as kn,_ as xn}from"./index-7uudGTMH.js";/**
|
|
2
2
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
3
3
|
* @license MIT
|
|
4
4
|
*
|