codexui-android 0.1.99 → 0.1.101

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexui-android",
3
- "version": "0.1.99",
3
+ "version": "0.1.101",
4
4
  "description": "A lightweight web interface for Codex that runs on top of the Codex app-server, allowing remote access from any browser",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-D_uN0D-X.js","assets/index.esm-DvadSfWE.js","assets/index.esm--s_sgTDk.js"])))=>i.map(i=>d[i]);
2
- import{d as Fe,o as a,c as l,h as F,a as s,t as i,s as r,f as c,p as Ue,j as Ie,S as Cs,J as Ze,y as S,_ as Me,w as Se,A as Ne,m as ws,U as qe,r as u,z as Nt,b as Mt,v as De,V as $s,W as Ss,F as G,g as K,L as Ve,X as We,q as Is,x as As,Y as Ps,Z as Ls,$ as Ts,a0 as Es,a1 as Us,a2 as Ns,a3 as Ds,a4 as Fs,a5 as Ms,a6 as Os,a7 as xs,a8 as Rs,a9 as Gs,aa as js,ab as Hs,ac as Dt,ad as Bs}from"./index-Ce2BNria.js";const Ks={class:"skill-card-top"},zs=["src","alt"],Vs={key:1,class:"skill-card-avatar-fallback"},Ws={class:"skill-card-info"},Js={class:"skill-card-header"},qs={class:"skill-card-name"},Zs={key:0,class:"skill-card-badge-disabled"},Qs={key:1,class:"skill-card-badge"},Ys={class:"skill-card-owner"},Xs=["title"],ea={key:0,class:"skill-card-desc"},ta={key:1,class:"skill-card-date"},sa=Fe({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(y){const q=y,{t:g}=Ze(),L=S(()=>{const _=q.skill.path;return _?_.endsWith("/SKILL.md")?_.slice(0,-9):_:""});function N(){const _=L.value;_&&window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}const O=S(()=>{const _=q.skill.publishedAt;if(!_)return"";const I=new Date(_),m=Date.now()-_;return m<36e5?`${Math.floor(m/6e4)}m ago`:m<864e5?`${Math.floor(m/36e5)}h ago`:m<2592e6?`${Math.floor(m/864e5)}d ago`:I.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function j(_){const I=_.target;I.style.display="none"}return(_,I)=>(a(),l("button",{class:F(["skill-card",{"is-disabled":y.skill.installed&&y.skill.enabled===!1}]),type:"button",onClick:I[0]||(I[0]=x=>_.$emit("select",y.skill))},[s("div",Ks,[y.skill.avatarUrl?(a(),l("img",{key:0,class:"skill-card-avatar",src:y.skill.avatarUrl,alt:y.skill.owner,loading:"lazy",onError:j},null,40,zs)):(a(),l("div",Vs,i(y.skill.owner.charAt(0)),1)),s("div",Ws,[s("div",Js,[s("span",qs,i(y.skill.displayName||y.skill.name),1),y.skill.installed&&y.skill.enabled===!1?(a(),l("span",Zs,i(r(g)("Disabled")),1)):y.skill.installed?(a(),l("span",Qs,i(r(g)("Installed")),1)):c("",!0)]),s("span",Ys,i(y.skill.owner),1)]),y.skill.installed&&L.value?(a(),l("button",{key:2,class:"skill-card-browse",type:"button",title:r(g)("Browse files"),onClick:Ue(N,["stop"])},[Ie(Cs,{class:"skill-card-browse-icon"})],8,Xs)):c("",!0)]),y.skill.description?(a(),l("p",ea,i(y.skill.description),1)):c("",!0),O.value?(a(),l("span",ta,i(O.value),1)):c("",!0)],2))}}),aa=Me(sa,[["__scopeId","data-v-b276a846"]]),oa={class:"sdm-panel"},la={class:"sdm-header"},ia={class:"sdm-title-area"},na=["src","alt"],ra={class:"sdm-title-col"},ca={class:"sdm-title-row"},da={class:"sdm-title"},ua={key:0,class:"sdm-badge-disabled"},ya={class:"sdm-owner"},va=["aria-label"],pa={class:"sdm-body"},ha={key:0,class:"sdm-desc"},ma={key:1,class:"sdm-readme-loading"},ga=["innerHTML"],ka=["href"],fa={class:"sdm-footer"},ba={class:"sdm-footer-actions"},_a=["disabled"],Ca=["disabled"],wa=["disabled"],$a=["disabled"],Sa=Fe({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(y,{emit:q}){const g=y,L=q,N=u(null),O=u(""),j=u(""),_=u(!1),{t:I}=Ze(),x=S(()=>N.value??g.skill.enabled??!0),m=S(()=>g.isInstalling===!0||g.isUninstalling===!0),H=S(()=>O.value||g.skill.description),V=S(()=>{const k=g.skill.path;return k?k.endsWith("/SKILL.md")?k.slice(0,-9):k:""}),Y=S(()=>{const k=j.value;if(!k)return"";const P=k.replace(/^---[\s\S]*?---\s*/,"");return w(P)});function w(k){return k.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").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 D(){if(!(!g.skill.owner||!g.skill.name)){_.value=!0,O.value="",j.value="";try{const k=new URLSearchParams({owner:g.skill.owner,name:g.skill.name});g.skill.installed&&k.set("installed","true"),g.skill.path&&k.set("path",g.skill.path);const P=await fetch(`/codex-api/skills-hub/readme?${k}`);if(!P.ok)return;const E=await P.json();j.value=E.content??"",O.value=E.description??""}catch{}finally{_.value=!1}}}Se(()=>g.visible,k=>{k&&(N.value=null,O.value="",j.value="",D())});function R(){L("install",g.skill)}function v(){L("uninstall",g.skill)}function p(){const k=!x.value;N.value=k,L("toggle-enabled",g.skill,k)}function Z(){g.isTrying||L("try",g.skill)}function B(){const k=V.value;k&&window.open(`/codex-local-browse${encodeURI(k)}`,"_blank","noopener,noreferrer")}return(k,P)=>(a(),Ne(qe,{to:"body"},[y.visible?(a(),l("div",{key:0,class:"sdm-overlay",onClick:P[1]||(P[1]=Ue(E=>k.$emit("close"),["self"]))},[s("div",oa,[s("div",la,[s("div",ia,[y.skill.avatarUrl?(a(),l("img",{key:0,class:"sdm-avatar",src:y.skill.avatarUrl,alt:y.skill.owner,loading:"lazy"},null,8,na)):c("",!0),s("div",ra,[s("div",ca,[s("h3",da,i(y.skill.displayName||y.skill.name),1),y.skill.installed&&!x.value?(a(),l("span",ua,i(r(I)("Disabled")),1)):c("",!0)]),s("span",ya,i(y.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":r(I)("Close"),onClick:P[0]||(P[0]=E=>k.$emit("close"))},[Ie(ws,{class:"sdm-close-icon"})],8,va)]),s("div",pa,[H.value?(a(),l("p",ha,i(H.value),1)):c("",!0),_.value?(a(),l("div",ma,i(r(I)("Loading skill contents...")),1)):j.value?(a(),l("div",{key:2,class:"sdm-readme",innerHTML:Y.value},null,8,ga)):c("",!0),s("a",{class:"sdm-link",href:y.skill.url,target:"_blank",rel:"noopener noreferrer"},i(r(I)("View on GitHub")),9,ka)]),s("div",fa,[s("div",ba,[y.skill.installed?(a(),l("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:m.value,onClick:v},i(g.isUninstalling?r(I)("Uninstalling..."):r(I)("Uninstall")),9,_a)):(a(),l("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:m.value,onClick:R},i(g.isInstalling?r(I)("Installing..."):r(I)("Install")),9,Ca)),y.skill.installed?(a(),l("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:m.value,onClick:p},i(x.value?r(I)("Disable"):r(I)("Enable")),9,wa)):c("",!0),y.skill.installed&&x.value?(a(),l("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:m.value||g.isTrying,onClick:Z},i(g.isTrying?"Starting...":"Try it!"),9,$a)):c("",!0),y.skill.installed&&V.value?(a(),l("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:B},i(r(I)("Browse files")),1)):c("",!0)])])])])):c("",!0)]))}}),Ia=Me(Sa,[["__scopeId","data-v-8fb16c1e"]]),Aa={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 Je=null;function Pa(){return Je||(Je=Promise.all([Nt(()=>import("./index.esm-D_uN0D-X.js"),__vite__mapDeps([0,1])),Nt(()=>import("./index.esm--s_sgTDk.js"),__vite__mapDeps([2,1]))])),Je}function La(y){const q=u(null),g=u(""),L=u(""),N=u(""),O=u({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),j=S(()=>N.value==="pull"),_=S(()=>N.value==="push"),I=S(()=>N.value==="startup-sync"),x=S(()=>N.value!=="");async function m(){try{const v=await fetch("/codex-api/skills-sync/status");if(!v.ok)return;const p=await v.json();p.data&&(O.value=p.data)}catch{}}async function H(){try{const v=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),p=await v.json();if(!v.ok||!p.data)throw new Error("Failed to start GitHub login");q.value=p.data;const Z=30,B=Math.max((p.data.interval??5)*1e3,3e3);let k=!1;for(let P=0;P<Z;P++){await new Promise(J=>setTimeout(J,B));const E=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:p.data.device_code})}),W=await E.json();if(!E.ok)throw new Error(W.error||"Failed to complete GitHub login");if(W.ok){k=!0;break}if(!W.pending)throw new Error(W.error||"Failed to complete GitHub login")}if(!k)throw new Error("GitHub login timed out. Please retry.");q.value=null,await m(),y.showToast("GitHub login successful")}catch(v){y.showToast(v instanceof Error?v.message:"Failed GitHub login","error")}}async function V(){try{const[v,p]=await Pa(),{getApp:Z,getApps:B,initializeApp:k}=v,{getAuth:P,GithubAuthProvider:E,signInWithPopup:W}=p,J=B().length>0?Z():k(Aa),le=P(J),se=new E;se.addScope("repo");const Q=await W(le,se),te=E.credentialFromResult(Q),ie=(te==null?void 0:te.accessToken)??"";if(!ie)throw new Error("GitHub access token missing from Firebase login");const ae=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:ie})}),X=await ae.json();if(!ae.ok||!X.ok)throw new Error(X.error||"Failed to login with GitHub token");await m(),y.showToast("GitHub login successful")}catch(v){const p=v instanceof Error?v.message:"Failed Firebase GitHub login";y.showToast(p,"error")}}async function Y(){L.value="",g.value="pull-started",N.value="pull";try{const v=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),p=await v.json();if(!v.ok||!p.ok)throw new Error(p.error||"Failed to pull synced skills");await y.onPulled(),g.value="pull-success",y.showToast(O.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(v){const p=v instanceof Error?v.message:"Failed to pull sync";L.value=p,g.value="pull-failed",y.showToast(p,"error")}finally{N.value=""}}async function w(){L.value="",g.value="push-started",N.value="push";try{const v=await fetch("/codex-api/skills-sync/push",{method:"POST"}),p=await v.json();if(!v.ok||!p.ok)throw new Error(p.error||"Failed to push synced skills");g.value="push-success",y.showToast("Pushed skills to private sync repo")}catch(v){const p=v instanceof Error?v.message:"Failed to push sync";L.value=p,g.value="push-failed",y.showToast(p,"error")}finally{N.value=""}}async function D(){L.value="",g.value="startup-sync-started",N.value="startup-sync";try{const v=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),p=await v.json();if(!v.ok||!p.ok)throw new Error(p.error||"Failed to run startup sync");await y.onPulled(),await m(),g.value="startup-sync-success",y.showToast("Startup sync completed")}catch(v){const p=v instanceof Error?v.message:"Failed startup sync";L.value=p,g.value="startup-sync-failed",y.showToast(p,"error")}finally{N.value=""}}async function R(){try{const v=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),p=await v.json();if(!v.ok||!p.ok)throw new Error(p.error||"Failed to logout GitHub");await m(),y.showToast("Logged out from GitHub")}catch(v){y.showToast(v instanceof Error?v.message:"Failed to logout GitHub","error")}}return{deviceLogin:q,isPullInFlight:j,isPushInFlight:_,isStartupSyncInFlight:I,isSyncActionInFlight:x,loadSyncStatus:m,logoutGithub:R,pullSkillsSync:Y,pushSkillsSync:w,startupSkillsSync:D,startGithubFirebaseLogin:V,startGithubLogin:H,syncActionError:L,syncActionStatus:g,syncStatus:O}}const Ta={class:"skills-hub"},Ea={class:"skills-hub-header"},Ua={class:"skills-hub-title"},Na={class:"skills-hub-subtitle"},Da={class:"skills-sync-panel"},Fa={class:"skills-sync-header"},Ma=["href"],Oa={key:1,class:"skills-sync-badge"},xa={key:2,class:"skills-sync-badge"},Ra={class:"skills-sync-meta"},Ga={key:0,class:"skills-sync-error"},ja={key:1,class:"skills-sync-meta"},Ha={key:2,class:"skills-sync-error"},Ba={key:3,class:"skills-sync-device"},Ka=["href"],za={class:"skills-sync-actions"},Va=["disabled"],Wa=["disabled"],Ja=["disabled"],qa=["disabled"],Za={key:1,class:"skills-hub-section"},Qa={class:"skills-hub-section-title"},Ya={key:0,class:"skills-hub-grid"},Xa={class:"skills-hub-section"},eo={key:0,class:"skills-hub-loading"},to={key:1,class:"skills-hub-error"},so={key:2,class:"skills-hub-empty"},ao=Fe({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(y,{emit:q}){const g={name:"",owner:"",description:"",url:"",installed:!1},L=u([]),N=u(!1),O=u(""),j=u(!0),_=u(!1),I=u(g),x=u(null),m=u(""),H=u(!1),V=u(!1);let Y=null;const{t:w}=Ze(),D=y,R=q,v=S(()=>{var d;return((d=x.value)==null?void 0:d.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),p=S(()=>`${I.value.owner}/${I.value.name}`),Z=S(()=>H.value&&m.value===p.value),B=S(()=>V.value&&m.value===p.value),k=S(()=>{if(!U.value.configured)return"";const d=U.value.repoOwner.trim(),C=U.value.repoName.trim();return!d||!C?"":`https://github.com/${encodeURIComponent(d)}/${encodeURIComponent(C)}`}),P=S(()=>L.value);function E(d,C="success"){x.value={text:d,type:C},Y&&clearTimeout(Y),Y=setTimeout(()=>{x.value=null},3e3)}function W(d){L.value=d.installed??[]}async function J(){N.value=!0,O.value="";try{const d=await fetch("/codex-api/skills-hub");if(!d.ok)throw new Error(`HTTP ${d.status}`);const C=await d.json();W(C)}catch(d){O.value=d instanceof Error?d.message:"Failed to load skills"}finally{N.value=!1}}function le(d){I.value=d,_.value=!0}async function se(d){m.value=`${d.owner}/${d.name}`,H.value=!0;try{const $=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:d.owner,name:d.name})})).json();if(!$.ok)throw new Error($.error||"Install failed");const ee={...d,installed:!0,path:$.path,enabled:!0};L.value=[...L.value,ee],I.value=ee,E(`${d.displayName||d.name} skill installed`),_.value=!1,R("skills-changed")}catch(C){E(C instanceof Error?C.message:"Failed to install skill","error")}finally{H.value=!1}}async function Q(d){m.value=`${d.owner}/${d.name}`,V.value=!0;try{const $=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:d.name,path:d.path})})).json();if(!$.ok)throw new Error($.error||"Uninstall failed");L.value=L.value.filter(ee=>ee.name!==d.name),E(`${d.displayName||d.name} skill uninstalled`),_.value=!1,R("skills-changed")}catch(C){E(C instanceof Error?C.message:"Failed to uninstall skill","error")}finally{V.value=!1}}async function te(d,C){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:d.path,enabled:C}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),E(`${d.displayName||d.name} skill ${C?"enabled":"disabled"}`),await J()}catch($){E($ instanceof Error?$.message:"Failed to update skill","error")}}function ie(d){!d.installed||d.enabled===!1||D.tryInFlightKey||(R("try-item",{kind:"skill",name:d.name,displayName:d.displayName||d.name,skillPath:d.path}),_.value=!1)}function ae(d){return`skill:${d.name}:${d.path??""}`}const{deviceLogin:X,isPullInFlight:ye,isPushInFlight:ve,isStartupSyncInFlight:pe,isSyncActionInFlight:f,loadSyncStatus:T,logoutGithub:he,pullSkillsSync:me,pushSkillsSync:ne,startupSkillsSync:b,startGithubFirebaseLogin:re,startGithubLogin:ge,syncActionError:ce,syncActionStatus:de,syncStatus:U}=La({showToast:E,onPulled:async()=>{await J(),R("skills-changed")}});return Mt(()=>{J(),T()}),(d,C)=>(a(),l("div",Ta,[s("div",Ea,[s("h2",Ua,i(r(w)("Skills Hub")),1),s("p",Na,i(r(w)("Manage installed skills on this machine")),1)]),s("div",Da,[s("div",Fa,[s("strong",null,i(r(w)("Skills Sync (GitHub)")),1),r(U).configured&&k.value?(a(),l("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:k.value,target:"_blank",rel:"noopener noreferrer"},i(r(w)("Connected"))+": "+i(r(U).repoOwner)+"/"+i(r(U).repoName),9,Ma)):r(U).loggedIn?(a(),l("span",Oa,i(r(w)("Logged in as"))+" "+i(r(U).githubUsername),1)):(a(),l("span",xa,i(r(w)("Not connected")),1))]),s("div",Ra,[s("span",null,i(r(w)("Startup"))+": "+i(r(U).startup.mode),1),s("span",null,i(r(w)("Branch"))+": "+i(r(U).startup.branch),1),s("span",null,i(r(w)("Action"))+": "+i(r(U).startup.lastAction),1)]),r(U).startup.lastError?(a(),l("div",Ga,i(r(U).startup.lastError),1)):c("",!0),r(de)?(a(),l("div",ja,[s("span",null,i(r(w)("Manual sync"))+": "+i(r(de)),1)])):c("",!0),r(ce)?(a(),l("div",Ha,i(r(ce)),1)):c("",!0),r(X)?(a(),l("div",Ba,[s("span",null,[De(i(r(w)("Open"))+" ",1),s("a",{href:r(X).verification_uri,target:"_blank",rel:"noreferrer"},i(r(w)("GitHub device login")),9,Ka),De(" "+i(r(w)("and enter code:")),1)]),s("code",null,i(r(X).user_code),1)])):c("",!0),s("div",za,[r(U).loggedIn?c("",!0):(a(),l("button",{key:0,class:"skills-hub-sort",type:"button",onClick:C[0]||(C[0]=(...$)=>r(re)&&r(re)(...$))},i(r(w)("Login with GitHub")),1)),r(U).loggedIn?c("",!0):(a(),l("button",{key:1,class:"skills-hub-sort",type:"button",onClick:C[1]||(C[1]=(...$)=>r(ge)&&r(ge)(...$))},i(r(w)("Device Login")),1)),r(U).loggedIn?(a(),l("button",{key:2,class:"skills-hub-sort",type:"button",onClick:C[2]||(C[2]=(...$)=>r(he)&&r(he)(...$)),disabled:r(f)},i(r(w)("Logout GitHub")),9,Va)):c("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:C[3]||(C[3]=(...$)=>r(b)&&r(b)(...$)),disabled:r(f)},i(r(pe)?r(w)("Syncing..."):r(w)("Startup Sync")),9,Wa),s("button",{class:"skills-hub-sort",type:"button",onClick:C[4]||(C[4]=(...$)=>r(me)&&r(me)(...$)),disabled:r(f)},i(r(ye)?r(w)("Pulling..."):r(w)("Pull")),9,Ja),r(U).loggedIn?(a(),l("button",{key:3,class:"skills-hub-sort",type:"button",onClick:C[5]||(C[5]=(...$)=>r(ne)&&r(ne)(...$)),disabled:!r(U).configured||r(f)},i(r(ve)?r(w)("Pushing..."):r(w)("Push")),9,qa)):c("",!0)])]),x.value?(a(),l("div",{key:0,class:F(["skills-hub-toast",v.value])},i(x.value.text),3)):c("",!0),$s(d.$slots,"before-installed",{},void 0),P.value.length>0?(a(),l("div",Za,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:C[6]||(C[6]=$=>j.value=!j.value)},[s("span",Qa,i(r(w)("Installed skills ({count})",{count:P.value.length})),1),Ie(Ss,{class:F(["skills-hub-section-chevron",{"is-open":j.value}])},null,8,["class"])]),j.value?(a(),l("div",Ya,[(a(!0),l(G,null,K(P.value,$=>(a(),Ne(aa,{key:$.name,skill:$,onSelect:ee=>le(ee)},null,8,["skill","onSelect"]))),128))])):c("",!0)])):c("",!0),s("div",Xa,[N.value?(a(),l("div",eo,i(r(w)("Loading skills...")),1)):O.value?(a(),l("div",to,i(O.value),1)):L.value.length===0?(a(),l("div",so,i(r(w)("No installed skills found.")),1)):c("",!0)]),Ie(Ia,{skill:I.value,visible:_.value,"is-installing":Z.value,"is-uninstalling":B.value,"is-trying":D.tryInFlightKey===ae(I.value),onClose:C[7]||(C[7]=$=>_.value=!1),onInstall:se,onUninstall:Q,onToggleEnabled:te,onTry:ie},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),oo=Me(ao,[["__scopeId","data-v-c1d170d0"]]),lo={class:"directory-hub"},io={class:"directory-header"},no={class:"directory-subtitle"},ro={class:"directory-header-actions"},co=["disabled"],uo={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},yo=["aria-selected","onClick"],vo={key:1,class:"directory-section"},po={class:"directory-toolbar"},ho={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},mo={key:0,class:"directory-empty"},go={key:1,class:"directory-error"},ko={key:2,class:"directory-loading"},fo={key:3,class:"directory-empty"},bo={key:4,class:"directory-grid"},_o=["onClick"],Co={class:"directory-card-top"},wo=["src","alt"],$o={class:"directory-card-main"},So={class:"directory-card-title-row"},Io={class:"directory-card-title"},Ao={key:0,class:"directory-badge is-muted"},Po={key:1,class:"directory-badge"},Lo={class:"directory-card-meta"},To={key:0,class:"directory-card-description"},Eo={class:"directory-chip-row"},Uo={key:0,class:"directory-chip"},No={key:2,class:"directory-section"},Do={class:"directory-toolbar"},Fo={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},Mo={key:0,class:"directory-empty"},Oo={key:1,class:"directory-error"},xo={key:2,class:"directory-loading"},Ro={key:3,class:"directory-empty"},Go={key:4,class:"directory-grid"},jo={class:"directory-card-top"},Ho=["src","alt"],Bo={key:1,class:"directory-card-fallback"},Ko={class:"directory-card-main"},zo={class:"directory-card-title-row"},Vo={class:"directory-card-title"},Wo={key:0,class:"directory-badge is-muted"},Jo={key:1,class:"directory-badge"},qo={class:"directory-card-meta"},Zo={key:0,class:"directory-card-description"},Qo={class:"directory-chip-row"},Yo={key:0,class:"directory-chip"},Xo={class:"directory-card-actions"},el=["disabled","onClick"],tl=["onClick"],sl=["disabled","onClick"],al={key:3,class:"directory-section"},ol={class:"directory-toolbar"},ll={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},il={key:0,class:"directory-error"},nl={key:1,class:"directory-loading"},rl={key:2,class:"directory-empty"},cl={class:"directory-empty-copy"},dl={class:"directory-card-actions"},ul=["disabled"],yl={key:3,class:"directory-empty"},vl={class:"directory-empty-copy"},pl={class:"directory-card-actions"},hl=["disabled"],ml={key:4,class:"directory-section composio-section"},gl={class:"directory-card directory-card-wide composio-status-card"},kl={class:"directory-card-top"},fl={class:"directory-card-main"},bl={class:"directory-card-meta"},_l={class:"directory-card-description"},Cl={class:"directory-chip-row"},wl={key:0,class:"directory-chip"},$l={key:1,class:"directory-chip"},Sl={key:2,class:"directory-chip"},Il={class:"directory-card-actions"},Al={key:0,class:"directory-empty"},Pl={key:1,class:"directory-grid"},Ll={class:"directory-card-top"},Tl=["src","alt"],El={key:1,class:"directory-card-fallback composio-fallback"},Ul={class:"directory-card-main"},Nl={class:"directory-card-title-row"},Dl={class:"directory-card-title"},Fl={key:0,class:"directory-badge"},Ml={key:1,class:"directory-badge"},Ol={class:"directory-card-meta"},xl={key:0,class:"directory-card-description"},Rl={class:"directory-chip-row"},Gl={class:"directory-chip"},jl={key:0,class:"directory-chip"},Hl={key:1,class:"directory-chip"},Bl={class:"directory-card-actions"},Kl=["onClick"],zl=["disabled","onClick"],Vl=["disabled","onClick"],Wl={key:2,class:"directory-section-actions"},Jl=["disabled"],ql={key:4,class:"directory-section"},Zl={class:"skills-embedded-section"},Ql={class:"skills-embedded-title"},Yl={key:0,class:"skills-embedded-body"},Xl={key:0,class:"directory-empty"},ei={key:1,class:"directory-error"},ti={key:2,class:"directory-loading"},si={key:3,class:"directory-empty"},ai={key:4,class:"mcp-skill-grid"},oi=["onClick"],li={class:"mcp-skill-card-top"},ii={class:"mcp-skill-avatar-fallback"},ni={class:"mcp-skill-info"},ri={class:"mcp-skill-header"},ci={class:"mcp-skill-name"},di={class:"mcp-skill-meta"},ui={key:0,class:"directory-mcp-detail"},yi={key:0},vi={class:"directory-mini-list"},pi={key:1},hi={class:"directory-mini-list"},mi={class:"directory-modal"},gi={class:"directory-modal-header"},ki={class:"directory-card-top"},fi=["src","alt"],bi={key:1,class:"directory-card-fallback"},_i={class:"directory-card-main"},Ci={class:"directory-modal-title"},wi={class:"directory-card-meta"},$i={class:"directory-modal-body"},Si={key:0,class:"directory-error"},Ii={key:1,class:"directory-loading"},Ai={key:0,class:"directory-detail-description"},Pi={key:1,class:"directory-detail-block"},Li={class:"directory-chip-row"},Ti={class:"directory-detail-grid"},Ei={key:0,class:"directory-detail-block"},Ui=["onClick"],Ni={key:1,class:"directory-detail-block"},Di={class:"directory-mini-list"},Fi={key:2,class:"directory-detail-block"},Mi=["disabled","onClick"],Oi={key:2,class:"directory-screenshots"},xi=["src"],Ri={key:3,class:"directory-auth-panel"},Gi=["onClick"],ji={class:"directory-modal-footer"},Hi=["disabled"],Bi=["disabled"],Ki=["disabled"],zi=["disabled"],Vi={class:"directory-modal"},Wi={class:"directory-modal-header"},Ji={class:"directory-card-top"},qi=["src","alt"],Zi={key:1,class:"directory-card-fallback composio-fallback"},Qi={class:"directory-card-main"},Yi={class:"directory-modal-title"},Xi={class:"directory-card-meta"},en={class:"directory-modal-body"},tn={key:0,class:"directory-error"},sn={key:1,class:"directory-loading"},an={key:0,class:"directory-detail-description"},on={class:"directory-detail-grid"},ln={class:"directory-detail-block"},nn={class:"directory-chip-row"},rn={class:"directory-chip"},cn={key:0,class:"directory-chip"},dn={key:1,class:"directory-chip"},un={key:2,class:"directory-chip"},yn={class:"directory-detail-block"},vn={key:0,class:"directory-mini-list"},pn={key:1},hn={class:"directory-card-meta"},mn={key:1,class:"directory-detail-block"},gn={class:"directory-card-meta"},kn={class:"directory-modal-footer"},fn=["disabled"],bn=["disabled"],_n="/Users/igor/.codex/skills/shared_skills/composio-cli/SKILL.md",Cn=50,Ft=100,wn=Fe({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(y,{emit:q}){const g=[[/^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]],L=[[/(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]],N=[[/(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]],O=[[/(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]],j=[[/(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]],_=y,I=q,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."}],m=u("plugins"),H=u(new Set),V=u(!1),Y=u([]),w=u([]),D=u(null),R=u([]),v=u(null),p=u(0),Z=u([]),B=u("popular"),k=u("popular"),P=u("popular"),E=u(""),W=u(""),J=u(""),le=u(!1),se=u(!1),Q=u(!1),te=u(!1),ie=u(!1),ae=u(!0),X=u(""),ye=u(""),ve=u(""),pe=u(""),f=u(null),T=u(null),he=u(!1),me=u(!1),ne=u(""),b=u(null),re=u(!1),ge=u(!1),ce=u(""),de=u(!1),U=u(!1),d=u(!1),C=u(""),$=u(""),ee=u([]),Ae=u(""),Pe=u(new Set),_e=u(null);let Oe=null,xe=null,Re=!1;const Ot=S(()=>x.find(e=>e.id===m.value)??x[0]),Qe=S(()=>!V.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>H.value.has(e))),Ye=S(()=>!V.value||H.value.has("app/list")),Ge=S(()=>!V.value||H.value.has("mcpServerStatus/list")),xt=S(()=>H.value.has("config/mcpServer/reload")),Xe=S(()=>H.value.has("mcpServer/oauth/login")),ue=S(()=>(_.tryInFlightKey??"").length>0),et=S(()=>m.value==="plugins"?le.value:m.value==="apps"?se.value:m.value==="composio"?Q.value:m.value==="skills"?te.value:!1),tt=S(()=>{var e,t,n;return((e=T.value)==null?void 0:e.description)||((t=T.value)==null?void 0:t.summary.longDescription)||((n=T.value)==null?void 0:n.summary.description)||""}),st=S(()=>{var t;const e=(t=T.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(Le)].filter(Boolean):[]}),at=S(()=>zt(Zt(Wt(Y.value,E.value),B.value),B.value,E.value)),ot=S(()=>Vt(Qt(Jt(w.value,W.value),k.value),k.value,W.value)),lt=S(()=>Yt(qt(R.value,J.value),P.value)),je=S(()=>Xt(Z.value)),it=S(()=>v.value!==null),Rt=S(()=>new Map(Z.value.map(e=>[e.name,e]))),Gt=S(()=>{const e=D.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 He(e){return e.trim().toLowerCase()}function Be(e,t){const n=He(t);return n?e.some(h=>h==null?void 0:h.toLowerCase().includes(n)):!0}function Ce(e,t){return t.reduce((n,[h,z])=>n+(h.test(e)?z:0),0)}function nt(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function jt(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 Ht(e){return e.developer||jt(e.distributionChannel)||"App"}function Ke(e){var t;return((t=Rt.value.get(e))==null?void 0:t.authStatus)??"unknown"}function rt(e){const t=Ke(e);return t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown"}function Bt(e){const t=Ke(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function Kt(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function ct(e){return Xe.value&&Ke(e)==="notLoggedIn"}function zt(e,t,n){return t==="popular"&&He(n).length===0?e.slice(0,Ft):e}function Vt(e,t,n){if(t!=="popular"||He(n).length>0)return e;const h=new Set,z=[];for(const we of e){const $e=nt(we.name).toLowerCase();if(!h.has($e)&&(h.add($e),z.push(we),z.length>=Ft))break}return z}function Wt(e,t){return e.filter(n=>Be([n.displayName,n.name,n.description,n.developerName,n.category,n.marketplaceDisplayName,...n.capabilities],t))}function Jt(e,t){return e.filter(n=>Be([n.name,n.description,n.developer,n.category,n.distributionChannel,...n.pluginDisplayNames],t))}function qt(e,t){return e.filter(n=>Be([n.name,n.slug,n.description,...n.authModes,...n.connectionStatuses],t))}function dt(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+Ce(`${e.displayName} ${e.name} ${e.description} ${e.category}`,N)}function ut(e){const t=nt(e.name);return(e.isAccessible?1e4:0)+Ce(t,g)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+Ce(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,L)-e.catalogRank*.001}function yt(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+Ce(e.name,O)}function vt(e){return e.activeCount*1e3+(e.isNoAuth?300:0)+e.toolsCount*3+e.triggersCount*4+Ce(`${e.name} ${e.slug} ${e.description}`,j)}function ke(e){return e.activeCount>0?0:e.totalConnections>0?1:e.isNoAuth?2:3}function Zt(e,t){return t==="name"?[...e].sort((n,h)=>n.displayName.localeCompare(h.displayName)):t==="date"?[...e]:[...e].sort((n,h)=>dt(h)-dt(n)||n.displayName.localeCompare(h.displayName))}function Qt(e,t){return t==="name"?[...e].sort((n,h)=>n.name.localeCompare(h.name)):t==="date"?[...e].sort((n,h)=>n.catalogRank-h.catalogRank):[...e].sort((n,h)=>ut(h)-ut(n)||n.name.localeCompare(h.name))}function Yt(e,t){return t==="name"?[...e].sort((n,h)=>ke(n)-ke(h)||n.name.localeCompare(h.name)):t==="date"?[...e].sort((n,h)=>ke(n)-ke(h)):[...e].sort((n,h)=>ke(n)-ke(h)||vt(h)-vt(n)||n.name.localeCompare(h.name))}function Xt(e,t){return[...e].sort((n,h)=>yt(h)-yt(n)||n.name.localeCompare(h.name))}function M(e,t="success"){_e.value={text:e,type:t},Oe&&clearTimeout(Oe),Oe=setTimeout(()=>{_e.value=null},3e3)}function Le(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 Te(e){return e?e.logoUrl||Le(e.logoPath)||e.composerIconUrl||Le(e.composerIconPath):""}function pt(e){return Le(e.logoUrlDark||e.logoUrl)}function ht(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 es(e){return e.isNoAuth||e.activeCount>0}function Ee(e){return e.isNoAuth?"":e.activeCount>0?"Manage":e.totalConnections>0?"Reconnect":"Connect"}function ts(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"Active":t==="EXPIRED"?"Expired":t==="FAILED"?"Failed":t==="INITIATED"?"Pending":t||"Unknown"}function ss(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function as(e){return`app:${e.id}:`}function os(e){ue.value||I("try-item",{kind:"app",name:e.id,displayName:e.name})}function ls(e){return`plugin:${e.name}:`}function mt(e){return`composio:${e}:`}function is(e){ue.value||I("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function gt(e){return es(e)}function ns(e,t=[]){const n=t.find(z=>z.status==="ACTIVE"&&!z.isDisabled),h=n!=null&&n.wordId?` If there are multiple accounts, prefer \`${n.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.${h}`}function kt(e,t=[]){ue.value||I("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:ns(e,t),attachedSkills:[{name:"composio-cli",path:_n}]})}function oe(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function rs(e){const t=e.find(n=>n.needsAuth&&n.installUrl.trim().length>0);return t?(oe(t.installUrl),!0):!1}function cs(e){return e.brandColor?{backgroundColor:e.brandColor,color:"#fff"}:{}}async function ds(){try{H.value=new Set(await Ps())}catch{H.value=new Set}finally{V.value=!0}}async function fe(){var e;if(Qe.value){le.value=!0,X.value="";try{const t=(e=_.cwd)==null?void 0:e.trim();Y.value=await Ls(t?[t]:void 0)}catch(t){X.value=t instanceof Error?t.message:"Failed to load plugins"}finally{le.value=!1}}}async function ft(){var e;if(Ye.value){se.value=!0,ye.value="";try{w.value=await Ts(((e=_.threadId)==null?void 0:e.trim())||void 0)}catch(t){ye.value=t instanceof Error?t.message:"Failed to load apps"}finally{se.value=!1}}}async function be(e=!1){if(Q.value){Re=!0;return}Q.value=!0,ve.value="";try{const t=await Es();if(D.value=t,!t.available||!t.authenticated){R.value=[],v.value=null,p.value=0;return}const n=e?v.value:null,h=await Us(J.value,n,Cn);R.value=e?[...R.value,...h.data]:h.data,v.value=h.nextCursor,p.value=h.total}catch(t){ve.value=t instanceof Error?t.message:"Failed to load Composio connectors",R.value=[],v.value=null,p.value=0}finally{Q.value=!1,Re&&(Re=!1,be())}}async function us(){!it.value||Q.value||await be(!0)}async function bt(){if(Ge.value){te.value=!0,pe.value="";try{Z.value=await Dt()}catch(e){pe.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{te.value=!1}}}async function _t(){var e;if(!(!Ge.value||!((e=T.value)!=null&&e.mcpServers.length)))try{Z.value=await Dt()}catch{}}function Ct(){m.value==="plugins"&&fe(),m.value==="apps"&&ft(),m.value==="composio"&&be(),m.value==="skills"&&(xt.value?bs():bt())}async function wt(e){f.value=e,T.value=null,ne.value="",ee.value=[],he.value=!0,me.value=!0;try{T.value=await Ns(e),f.value=T.value.summary,await _t()}catch(t){ne.value=t instanceof Error?t.message:"Failed to load plugin"}finally{me.value=!1}}async function $t(e){if(!Xe.value)return!1;Ae.value=e;try{const t=await Ds(e);return t.authorizationUrl?(oe(t.authorizationUrl),!0):(M(`No login URL returned for ${e}`,"error"),!1)}catch(t){return M(t instanceof Error?t.message:`Failed to start login for ${e}`,"error"),!1}finally{Ae.value=""}}async function ys(e){await _t();const t=e.mcpServers.find(n=>ct(n));t&&await $t(t)}function ze(){he.value=!1}async function St(e){re.value=!0,ge.value=!0,ce.value="",b.value=null;try{b.value=await Fs(e)}catch(t){ce.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{ge.value=!1}}function It(){re.value=!1}async function vs(e){var t;$.value=e.slug;try{const n=await Bs(e.slug);if(!n.redirectUrl){M(`No login URL returned for ${e.name}`,"error");return}oe(n.redirectUrl),M(`Opened ${e.name} authorization`),await be(),re.value&&((t=b.value)==null?void 0:t.connector.slug)===e.slug&&await St(e.slug)}catch(n){M(n instanceof Error?n.message:`Failed to connect ${e.name}`,"error")}finally{$.value=""}}async function At(e){var t;if(e.activeCount>0&&((t=D.value)!=null&&t.webUrl)){oe(D.value.webUrl);return}await vs(e)}async function ps(){U.value=!0;try{await Ms(),M("Composio CLI login started")}catch(e){M(e instanceof Error?e.message:"Failed to start Composio login","error")}finally{U.value=!1}}async function hs(){de.value=!0;try{await Os(),M("Composio CLI installed"),await be()}catch(e){M(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{de.value=!1}}async function ms(){if(f.value){d.value=!0;try{const e=await xs(f.value);ee.value=e.appsNeedingAuth,M(`${f.value.displayName} plugin installed`);const t=rs(e.appsNeedingAuth);await fe();const n=Y.value.find(h=>{var z;return h.id===((z=f.value)==null?void 0:z.id)});n&&(await wt(n),!t&&T.value&&await ys(T.value))}catch(e){M(e instanceof Error?e.message:"Failed to install plugin","error")}finally{d.value=!1}}}async function gs(){if(f.value){d.value=!0;try{const e=f.value.displayName;await Rs(f.value.id),M(`${e} plugin uninstalled`),ze(),await fe()}catch(e){M(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{d.value=!1}}}async function ks(){if(f.value){d.value=!0;try{const e=!f.value.enabled;await Gs(f.value.id,e),f.value={...f.value,enabled:e},T.value&&(T.value={...T.value,summary:{...T.value.summary,enabled:e}}),M(`${f.value.displayName} plugin ${e?"enabled":"disabled"}`),await fe()}catch(e){M(e instanceof Error?e.message:"Failed to update plugin","error")}finally{d.value=!1}}}async function fs(e){C.value=e.id;try{const t=!e.isEnabled;await js(e.id,t),w.value=w.value.map(n=>n.id===e.id?{...n,isEnabled:t}:n),M(`${e.name} app ${t?"enabled":"disabled"}`)}catch(t){M(t instanceof Error?t.message:"Failed to update app","error")}finally{C.value=""}}async function bs(){ie.value=!0;try{await Hs(),await bt(),M("MCP servers reloaded")}catch(e){M(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{ie.value=!1}}function _s(e){const t=new Set(Pe.value);t.has(e)?t.delete(e):t.add(e),Pe.value=t}return Se(m,()=>Ct()),Se(J,()=>{m.value==="composio"&&(R.value=[],v.value=null,p.value=0,xe&&clearTimeout(xe),xe=setTimeout(()=>{be()},250))}),Se(()=>_.cwd,()=>{m.value==="plugins"&&fe()}),Se(()=>_.threadId,()=>{m.value==="apps"&&ft()}),Mt(async()=>{await ds(),await fe()}),(e,t)=>{var n,h,z,we,$e,Pt,Lt,Tt,Et,Ut;return a(),l("div",lo,[s("div",io,[s("div",null,[t[20]||(t[20]=s("h2",{class:"directory-title"},"Skills & Apps",-1)),s("p",no,i(Ot.value.subtitle),1)]),s("div",ro,[s("button",{class:"directory-refresh",type:"button",disabled:et.value,onClick:Ct},i(et.value?"Refreshing...":"Refresh"),9,co)])]),s("div",uo,[(a(),l(G,null,K(x,o=>s("button",{key:o.id,class:F(["directory-tab",{"is-active":m.value===o.id}]),type:"button",role:"tab","aria-selected":m.value===o.id,onClick:A=>m.value=o.id},i(o.label),11,yo)),64))]),_e.value?(a(),l("div",{key:0,class:F(["directory-toast",{"is-error":_e.value.type==="error"}])},i(_e.value.text),3)):c("",!0),m.value==="plugins"?(a(),l("section",vo,[s("div",po,[Ve(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>E.value=o),class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins"},null,512),[[We,E.value]]),s("div",ho,[s("button",{class:F(["directory-sort-button",{"is-active":B.value==="popular"}]),type:"button",onClick:t[1]||(t[1]=o=>B.value="popular")}," Popular ",2),s("button",{class:F(["directory-sort-button",{"is-active":B.value==="name"}]),type:"button",onClick:t[2]||(t[2]=o=>B.value="name")}," A-Z ",2),s("button",{class:F(["directory-sort-button",{"is-active":B.value==="date"}]),type:"button",onClick:t[3]||(t[3]=o=>B.value="date")}," Date ",2)])]),Qe.value?X.value?(a(),l("div",go,i(X.value),1)):le.value?(a(),l("div",ko,"Loading plugins...")):at.value.length===0?(a(),l("div",fo,"No plugins found.")):(a(),l("div",bo,[(a(!0),l(G,null,K(at.value,o=>(a(),l("button",{key:o.id,class:F(["directory-card",{"is-disabled":o.installed&&!o.enabled}]),type:"button",onClick:A=>wt(o)},[s("div",Co,[Te(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:Te(o),alt:o.displayName,loading:"lazy"},null,8,wo)):(a(),l("div",{key:1,class:"directory-card-fallback",style:Is(cs(o))},i(o.displayName.charAt(0)),5)),s("div",$o,[s("div",So,[s("span",Io,i(o.displayName),1),o.installed&&!o.enabled?(a(),l("span",Ao,"Disabled")):o.installed?(a(),l("span",Po,"Installed")):c("",!0)]),s("span",Lo,i(o.developerName||o.marketplaceDisplayName||o.marketplaceName||"Plugin"),1)])]),o.description?(a(),l("p",To,i(o.description),1)):c("",!0),s("div",Eo,[o.category?(a(),l("span",Uo,i(o.category),1)):c("",!0),(a(!0),l(G,null,K(o.capabilities.slice(0,2),A=>(a(),l("span",{key:A,class:"directory-chip"},i(A),1))),128))])],10,_o))),128))])):(a(),l("div",mo," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))])):m.value==="apps"?(a(),l("section",No,[s("div",Do,[Ve(s("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>W.value=o),class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps"},null,512),[[We,W.value]]),s("div",Fo,[s("button",{class:F(["directory-sort-button",{"is-active":k.value==="popular"}]),type:"button",onClick:t[5]||(t[5]=o=>k.value="popular")}," Popular ",2),s("button",{class:F(["directory-sort-button",{"is-active":k.value==="name"}]),type:"button",onClick:t[6]||(t[6]=o=>k.value="name")}," A-Z ",2),s("button",{class:F(["directory-sort-button",{"is-active":k.value==="date"}]),type:"button",onClick:t[7]||(t[7]=o=>k.value="date")}," Date ",2)])]),Ye.value?ye.value?(a(),l("div",Oo,i(ye.value),1)):se.value?(a(),l("div",xo,"Loading apps...")):ot.value.length===0?(a(),l("div",Ro,"No apps found.")):(a(),l("div",Go,[(a(!0),l(G,null,K(ot.value,o=>(a(),l("article",{key:o.id,class:"directory-card"},[s("div",jo,[pt(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:pt(o),alt:o.name,loading:"lazy"},null,8,Ho)):(a(),l("div",Bo,i(o.name.charAt(0)),1)),s("div",Ko,[s("div",zo,[s("span",Vo,i(o.name),1),o.isEnabled?o.isAccessible?(a(),l("span",Jo,"Connected")):c("",!0):(a(),l("span",Wo,"Disabled"))]),s("span",qo,i(Ht(o)),1)])]),o.description?(a(),l("p",Zo,i(o.description),1)):c("",!0),s("div",Qo,[o.category?(a(),l("span",Yo,i(o.category),1)):c("",!0),(a(!0),l(G,null,K(o.pluginDisplayNames.slice(0,2),A=>(a(),l("span",{key:A,class:"directory-chip"},i(A),1))),128))]),s("div",Xo,[s("button",{class:"directory-action",type:"button",disabled:C.value===o.id,onClick:A=>fs(o)},i(o.isEnabled?"Disable":"Enable"),9,el),o.installUrl?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:A=>oe(o.installUrl)},i(o.isAccessible?"Manage":"Login"),9,tl)):c("",!0),o.isAccessible&&o.isEnabled?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ue.value,onClick:A=>os(o)},i(_.tryInFlightKey===as(o)?"Starting...":"Try it!"),9,sl)):c("",!0)])]))),128))])):(a(),l("div",Mo," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))])):m.value==="composio"?(a(),l("section",al,[s("div",ol,[Ve(s("input",{"onUpdate:modelValue":t[8]||(t[8]=o=>J.value=o),class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors"},null,512),[[We,J.value]]),s("div",ll,[s("button",{class:F(["directory-sort-button",{"is-active":P.value==="popular"}]),type:"button",onClick:t[9]||(t[9]=o=>P.value="popular")}," Popular ",2),s("button",{class:F(["directory-sort-button",{"is-active":P.value==="name"}]),type:"button",onClick:t[10]||(t[10]=o=>P.value="name")}," A-Z ",2),s("button",{class:F(["directory-sort-button",{"is-active":P.value==="date"}]),type:"button",onClick:t[11]||(t[11]=o=>P.value="date")}," Date ",2)])]),ve.value?(a(),l("div",il,i(ve.value),1)):Q.value?(a(),l("div",nl,"Loading Composio connectors...")):(n=D.value)!=null&&n.available?D.value.authenticated?(a(),l("div",ml,[s("article",gl,[s("div",kl,[t[24]||(t[24]=s("div",{class:"directory-card-fallback composio-fallback"},"C",-1)),s("div",fl,[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",bl,i(D.value.email||D.value.defaultOrgName||"Authenticated"),1)])]),s("p",_l,i(Gt.value),1),s("div",Cl,[D.value.defaultOrgName?(a(),l("span",wl,i(D.value.defaultOrgName),1)):c("",!0),D.value.cliVersion?(a(),l("span",$l,"CLI "+i(D.value.cliVersion),1)):c("",!0),R.value.length?(a(),l("span",Sl," Showing "+i(R.value.length)+i(p.value?` / ${p.value}`:"")+" connectors ",1)):c("",!0)]),s("div",Il,[s("button",{class:"directory-action-link",type:"button",onClick:t[12]||(t[12]=o=>oe(D.value.webUrl))}," Open dashboard ")])]),lt.value.length===0?(a(),l("div",Al,"No Composio connectors found.")):(a(),l("div",Pl,[(a(!0),l(G,null,K(lt.value,o=>(a(),l("article",{key:o.slug,class:"directory-card"},[s("div",Ll,[o.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:o.logoUrl,alt:o.name,loading:"lazy"},null,8,Tl)):(a(),l("div",El,i(o.name.charAt(0)),1)),s("div",Ul,[s("div",Nl,[s("span",Dl,i(o.name),1),o.activeCount>0?(a(),l("span",Fl,"Connected")):o.isNoAuth?(a(),l("span",Ml,"No auth")):c("",!0)]),s("span",Ol,i(ht(o)),1)])]),o.description?(a(),l("p",xl,i(o.description),1)):c("",!0),s("div",Rl,[s("span",Gl,i(o.toolsCount)+" tools",1),o.triggersCount>0?(a(),l("span",jl,i(o.triggersCount)+" triggers",1)):c("",!0),o.authModes.length>0?(a(),l("span",Hl,i(o.authModes.join(", ")),1)):c("",!0)]),s("div",Bl,[s("button",{class:"directory-action",type:"button",onClick:A=>St(o.slug)}," Details ",8,Kl),Ee(o)?(a(),l("button",{key:0,class:"directory-action-link",type:"button",disabled:$.value===o.slug,onClick:A=>At(o)},i($.value===o.slug?"Opening...":Ee(o)),9,zl)):c("",!0),gt(o)?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:ue.value,onClick:A=>kt(o)},i(_.tryInFlightKey===mt(o.slug)?"Starting...":"Try it!"),9,Vl)):c("",!0)])]))),128))])),it.value?(a(),l("div",Wl,[s("button",{class:"directory-action",type:"button",disabled:Q.value,onClick:us},i(Q.value?"Loading...":"Load more"),9,Jl)])):c("",!0)])):(a(),l("div",yl,[s("div",vl,[t[22]||(t[22]=s("p",{class:"directory-empty-text"},"Composio CLI is installed but not logged in.",-1)),s("div",pl,[s("button",{class:"directory-action primary",type:"button",disabled:U.value,onClick:ps},i(U.value?"Opening...":"Login"),9,hl)])])])):(a(),l("div",rl,[s("div",cl,[t[21]||(t[21]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",dl,[s("button",{class:"directory-action primary",type:"button",disabled:de.value,onClick:hs},i(de.value?"Installing...":"Install"),9,ul)])])]))])):m.value==="skills"?(a(),l("section",ql,[Ie(oo,{"try-in-flight-key":_.tryInFlightKey,onSkillsChanged:t[14]||(t[14]=o=>I("skills-changed")),onTryItem:t[15]||(t[15]=o=>I("try-item",o))},{"before-installed":As(()=>[s("div",Zl,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:t[13]||(t[13]=o=>ae.value=!ae.value)},[s("span",Ql,"MCPs("+i(je.value.length)+")",1),s("span",{class:F(["skills-embedded-chevron",{"is-open":ae.value}])},"›",2)]),ae.value?(a(),l("div",Yl,[Ge.value?pe.value?(a(),l("div",ei,i(pe.value),1)):te.value?(a(),l("div",ti,"Loading MCP servers...")):je.value.length===0?(a(),l("div",si,"No MCP servers configured.")):(a(),l("div",ai,[(a(!0),l(G,null,K(je.value,o=>(a(),l("article",{key:o.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:A=>_s(o.name)},[s("div",li,[s("div",ii,i(o.name.charAt(0)),1),s("div",ni,[s("div",ri,[s("span",ci,i(o.name),1),s("span",{class:F(["mcp-skill-badge",Kt(o.authStatus)])},i(rt(o.name)),3)]),t[25]||(t[25]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:F(["mcp-skill-chevron",{"is-open":Pe.value.has(o.name)}])},"›",2)]),s("p",di,i(o.tools.length)+" tools · "+i(o.resources.length+o.resourceTemplates.length)+" resources",1),Pe.value.has(o.name)?(a(),l("div",ui,[o.tools.length>0?(a(),l("div",yi,[t[26]||(t[26]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",vi,i(o.tools.map(A=>A.title||A.name).join(", ")),1)])):c("",!0),o.resources.length>0||o.resourceTemplates.length>0?(a(),l("div",pi,[t[27]||(t[27]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",hi,i([...o.resources.map(A=>A.title||A.name||A.uri),...o.resourceTemplates.map(A=>A.title||A.name||A.uriTemplate)].join(", ")),1)])):c("",!0)])):c("",!0)],8,oi)]))),128))])):(a(),l("div",Xl," 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(),Ne(qe,{to:"body"},[he.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Ue(ze,["self"])},[s("article",mi,[s("div",gi,[s("div",ki,[f.value&&Te(f.value)?(a(),l("img",{key:0,class:"directory-card-icon",src:Te(f.value),alt:f.value.displayName,loading:"lazy"},null,8,fi)):(a(),l("div",bi,i((h=f.value)==null?void 0:h.displayName.charAt(0)),1)),s("div",_i,[s("h3",Ci,i(((z=f.value)==null?void 0:z.displayName)||"Plugin"),1),s("span",wi,i(((we=f.value)==null?void 0:we.developerName)||(($e=f.value)==null?void 0:$e.marketplaceDisplayName)||((Pt=f.value)==null?void 0:Pt.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close plugin detail",onClick:ze},"Close")]),s("div",$i,[ne.value?(a(),l("div",Si,i(ne.value),1)):me.value?(a(),l("div",Ii,"Loading plugin...")):T.value?(a(),l(G,{key:2},[tt.value?(a(),l("p",Ai,i(tt.value),1)):c("",!0),T.value.summary.capabilities.length>0?(a(),l("div",Pi,[t[28]||(t[28]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",Li,[(a(!0),l(G,null,K(T.value.summary.capabilities,o=>(a(),l("span",{key:o,class:"directory-chip"},i(o),1))),128))])])):c("",!0),s("div",Ti,[T.value.apps.length>0?(a(),l("div",Ei,[t[29]||(t[29]=s("h4",{class:"directory-detail-heading"},"Apps",-1)),(a(!0),l(G,null,K(T.value.apps,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:A=>oe(o.installUrl)},i(o.needsAuth?"Login":"Manage"),9,Ui)):c("",!0)]))),128))])):c("",!0),T.value.skills.length>0?(a(),l("div",Ni,[t[30]||(t[30]=s("h4",{class:"directory-detail-heading"},"Skills",-1)),s("p",Di,i(T.value.skills.map(o=>o.displayName||o.name).join(", ")),1)])):c("",!0),T.value.mcpServers.length>0?(a(),l("div",Fi,[t[31]||(t[31]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(a(!0),l(G,null,K(T.value.mcpServers,o=>(a(),l("div",{key:o,class:"directory-include-row"},[s("span",null,[De(i(o)+" ",1),s("span",{class:F(["directory-auth-status",Bt(o)])},i(rt(o)),3)]),ct(o)?(a(),l("button",{key:0,type:"button",disabled:Ae.value===o,onClick:A=>$t(o)},i(Ae.value===o?"Opening...":"Authenticate"),9,Mi)):c("",!0)]))),128))])):c("",!0)]),st.value.length>0?(a(),l("div",Oi,[(a(!0),l(G,null,K(st.value,o=>(a(),l("img",{key:o,src:o,alt:"",loading:"lazy"},null,8,xi))),128))])):c("",!0),ee.value.length>0?(a(),l("div",Ri,[t[32]||(t[32]=s("strong",null,"Apps needing auth",-1)),(a(!0),l(G,null,K(ee.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:A=>oe(o.installUrl)},"Login",8,Gi)):c("",!0)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",ji,[f.value&&f.value.installed?(a(),l("button",{key:0,class:"directory-action danger",type:"button",disabled:d.value,onClick:gs},i(d.value?"Uninstalling...":"Uninstall"),9,Hi)):f.value?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:d.value||f.value.installPolicy==="NOT_AVAILABLE",onClick:ms},i(d.value?"Installing...":"Install"),9,Bi)):c("",!0),f.value&&f.value.installed?(a(),l("button",{key:2,class:"directory-action",type:"button",disabled:d.value,onClick:ks},i(f.value.enabled?"Disable":"Enable"),9,Ki)):c("",!0),f.value&&f.value.installed&&f.value.enabled?(a(),l("button",{key:3,class:"directory-action primary",type:"button",disabled:d.value||ue.value,onClick:t[16]||(t[16]=o=>is(f.value))},i(_.tryInFlightKey===ls(f.value)?"Starting...":"Try it!"),9,zi)):c("",!0)])])])):c("",!0)])),(a(),Ne(qe,{to:"body"},[re.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Ue(It,["self"])},[s("article",Vi,[s("div",Wi,[s("div",Ji,[(Lt=b.value)!=null&&Lt.connector.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:b.value.connector.logoUrl,alt:b.value.connector.name,loading:"lazy"},null,8,qi)):(a(),l("div",Zi,i((Tt=b.value)==null?void 0:Tt.connector.name.charAt(0)),1)),s("div",Qi,[s("h3",Yi,i(((Et=b.value)==null?void 0:Et.connector.name)||"Composio"),1),s("span",Xi,i(b.value?ht(b.value.connector):"Connector"),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":"Close Composio detail",onClick:It},"Close")]),s("div",en,[ce.value?(a(),l("div",tn,i(ce.value),1)):ge.value?(a(),l("div",sn,"Loading connector...")):b.value?(a(),l(G,{key:2},[b.value.connector.description?(a(),l("p",an,i(b.value.connector.description),1)):c("",!0),s("div",on,[s("div",ln,[t[33]||(t[33]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",nn,[s("span",rn,i(b.value.connector.toolsCount)+" tools",1),b.value.connector.triggersCount>0?(a(),l("span",cn,i(b.value.connector.triggersCount)+" triggers",1)):c("",!0),b.value.connector.latestVersion?(a(),l("span",dn,"v"+i(b.value.connector.latestVersion),1)):c("",!0),b.value.connector.authModes.length>0?(a(),l("span",un,i(b.value.connector.authModes.join(", ")),1)):c("",!0)])]),s("div",yn,[t[34]||(t[34]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),b.value.connections.length===0?(a(),l("div",vn," No linked accounts yet. ")):(a(),l("div",pn,[(a(!0),l(G,null,K(b.value.connections,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,[De(i(o.alias||o.wordId||o.id)+" ",1),s("span",{class:F(["directory-auth-status",ss(o.status)])},i(ts(o.status)),3)]),s("span",hn,i(o.authScheme||"Auth"),1)]))),128))]))])]),b.value.tools.length>0?(a(),l("div",mn,[t[35]||(t[35]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(a(!0),l(G,null,K(b.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",gn,i(o.slug),1)]))),128))])):c("",!0)],64)):c("",!0)]),s("div",kn,[b.value?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:t[17]||(t[17]=o=>oe(b.value.dashboardUrl))}," Open dashboard ")):c("",!0),b.value&&Ee(b.value.connector)?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:$.value===b.value.connector.slug,onClick:t[18]||(t[18]=o=>At(b.value.connector))},i($.value===((Ut=b.value)==null?void 0:Ut.connector.slug)?"Opening...":Ee(b.value.connector)),9,fn)):c("",!0),b.value&&gt(b.value.connector)?(a(),l("button",{key:2,class:"directory-action primary",type:"button",disabled:ue.value,onClick:t[19]||(t[19]=o=>kt(b.value.connector,b.value.connections))},i(_.tryInFlightKey===mt(b.value.connector.slug)?"Starting...":"Try it!"),9,bn)):c("",!0)])])])):c("",!0)]))])}}}),Sn=Me(wn,[["__scopeId","data-v-c560f8b3"]]);export{Sn as default};