codex-mobile-re 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/README.md +214 -214
- package/dist/assets/AutomationsPanel-BujKO0oC.js +1 -0
- package/dist/assets/{AutomationsPanel-VRBbmMYW.css → AutomationsPanel-ulx5N8pM.css} +1 -1
- package/dist/assets/DirectoryHub-BOBZNd77.css +1 -0
- package/dist/assets/DirectoryHub-C4D0oVqF.js +2 -0
- package/dist/assets/{ReviewPane-BJDgzRm5.js → ReviewPane-DJs-RkeF.js} +1 -1
- package/dist/assets/ThreadConversation-CO1w6DqK.js +39 -0
- package/dist/assets/ThreadConversation-Db8A09JM.css +1 -0
- package/dist/assets/{ThreadTerminalPanel-BvTM32Ld.js → ThreadTerminalPanel-BrRExfgh.js} +1 -1
- package/dist/assets/index-CA0M4Wjh.js +86 -0
- package/dist/assets/index-DpBCV6zI.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +16 -3
- package/dist-cli/index.js.map +1 -1
- package/package.json +94 -94
- package/dist/assets/AutomationsPanel-DZWPqxB8.js +0 -1
- package/dist/assets/DirectoryHub-Cfo8Fvin.css +0 -1
- package/dist/assets/DirectoryHub-Ck4f6pd_.js +0 -2
- package/dist/assets/ThreadConversation-AWze4DXm.js +0 -39
- package/dist/assets/ThreadConversation-bN6NnVYj.css +0 -1
- package/dist/assets/index-Ba0WA2wF.css +0 -1
- package/dist/assets/index-CZP3HKY9.js +0 -86
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index.esm-Cxn_LBGD.js","assets/index.esm-Bx2Y2PLG.js","assets/index.esm-DYMAm9mq.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{d as rt,o as a,a as l,n as K,b as s,t as i,F as O,u as n,e as u,w as Be,g as je,Z as ua,r as z,j as ct,k as w,_ as ut,l as Te,c as He,I as da,T as it,q as d,J as os,m as ds,N as ps,f as nt,$ as Je,a0 as Ye,A as is,y as pa,v as va,a1 as ya,a2 as ha,a3 as ma,p as ga,a4 as fa,i as ka,a5 as ba,a6 as _a,a7 as wa,a8 as Ca,a9 as Sa,aa as $a,ab as Pa,ac as Aa,ad as Ia,ae as La,af as Ea,ag as Ta,ah as Ua,ai as Na,aj as Fa,ak as Ma,al as Da,am as Oa,an as Ra,ao as xa,ap as Ga,aq as Ba,ar as ns,as as ja}from"./index-CZP3HKY9.js";import{s as Ha}from"./sanitizeHtml-Bd3No2dT.js";const za=[[/(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 vs(v){return v.trim().toLowerCase()}function Ka(v,R){return R.reduce((g,[P,S])=>g+(P.test(v)?S:0),0)}function rs(v){return v.activeCount*1e3+(v.isNoAuth?300:0)+v.toolsCount*3+v.triggersCount*4+Ka(`${v.name} ${v.slug} ${v.description}`,za)}function Va(v,R){const g=vs(R);if(!g)return 0;const P=v.name.toLowerCase(),S=v.slug.toLowerCase();return P===g||S===g?1e6:P.replace(/\s+/gu,"")===g.replace(/\s+/gu,"")?9e5:P.startsWith(g)||S.startsWith(g)?8e5:P.includes(g)||S.includes(g)?7e5:0}function Ge(v){return v.activeCount>0?0:v.totalConnections>0?1:v.isNoAuth?2:3}function qa(v,R,g=""){const P=vs(g),S=L=>Va(L,P);return R==="name"?[...v].sort((L,E)=>S(E)-S(L)||Ge(L)-Ge(E)||L.name.localeCompare(E.name)):R==="date"?[...v].sort((L,E)=>S(E)-S(L)||Ge(L)-Ge(E)||L.name.localeCompare(E.name)):[...v].sort((L,E)=>S(E)-S(L)||Ge(L)-Ge(E)||rs(E)-rs(L)||L.name.localeCompare(E.name))}const Wa={class:"skill-card-top"},Qa=["src","alt"],Ja={key:1,class:"skill-card-avatar-fallback"},Ya={class:"skill-card-info"},Za={class:"skill-card-header"},Xa={class:"skill-card-name"},el={key:0,class:"skill-card-badge-disabled"},tl={key:1,class:"skill-card-badge"},sl={key:0,class:"skill-card-owner"},al=["title"],ll={key:0,class:"skill-card-desc"},ol={key:1,class:"skill-card-meta-row"},il=rt({__name:"SkillCard",props:{skill:{},showStatusBadge:{type:Boolean,default:!0},showBrowseAction:{type:Boolean,default:!0},showOwner:{type:Boolean,default:!0}},emits:["select"],setup(v){const R=v,{t:g}=ct(),P=w(()=>R.showStatusBadge!==!1),S=w(()=>R.showBrowseAction!==!1),L=w(()=>R.showOwner!==!1),E=w(()=>{const r=R.skill.path;return r?r.endsWith("/SKILL.md")?r.slice(0,-9):r:""});function M(){const r=E.value;r&&window.open(`/codex-local-browse${encodeURI(r)}`,"_blank","noopener,noreferrer")}const U=w(()=>{const r=R.skill.publishedAt;if(!r)return"";const B=new Date(r),W=Date.now()-r;return W<36e5?`${Math.floor(W/6e4)}${g("ago")}`:W<864e5?`${Math.floor(W/36e5)}${g("ago")}`:W<2592e6?`${Math.floor(W/864e5)}${g("ago")}`:B.toLocaleDateString("en-US",{month:"short",day:"numeric"})}),x=w(()=>{const r=[];return R.skill.installCountLabel&&r.push(R.skill.installCountLabel),U.value&&r.push(U.value),r});function V(r){const B=r.target;B.style.display="none"}return(r,B)=>(a(),l("button",{class:K(["skill-card",{"is-disabled":v.skill.installed&&v.skill.enabled===!1}]),type:"button",onClick:B[0]||(B[0]=q=>r.$emit("select",v.skill))},[s("div",Wa,[v.skill.avatarUrl?(a(),l("img",{key:0,class:"skill-card-avatar",src:v.skill.avatarUrl,alt:v.skill.owner,loading:"lazy",onError:V},null,40,Qa)):(a(),l("div",Ja,i(v.skill.owner.charAt(0)),1)),s("div",Ya,[s("div",Za,[s("span",Xa,i(v.skill.displayName||v.skill.name),1),P.value?(a(),l(O,{key:0},[v.skill.installed&&v.skill.enabled===!1?(a(),l("span",el,i(n(g)("Disabled")),1)):v.skill.installed?(a(),l("span",tl,i(n(g)("Installed")),1)):u("",!0)],64)):u("",!0)]),L.value?(a(),l("span",sl,i(v.skill.owner),1)):u("",!0)]),S.value&&v.skill.installed&&E.value?(a(),l("button",{key:2,class:"skill-card-browse",type:"button",title:n(g)("Browse files"),onClick:Be(M,["stop"])},[je(ua,{class:"skill-card-browse-icon"})],8,al)):u("",!0)]),v.skill.description?(a(),l("p",ll,i(v.skill.description),1)):u("",!0),x.value.length>0?(a(),l("div",ol,[(a(!0),l(O,null,z(x.value,q=>(a(),l("span",{key:q,class:"skill-card-meta"},i(q),1))),128))])):u("",!0)],2))}}),cs=ut(il,[["__scopeId","data-v-2dc2f3b0"]]),nl={class:"sdm-panel"},rl={class:"sdm-header"},cl={class:"sdm-title-area"},ul=["src","alt"],dl={class:"sdm-title-col"},pl={class:"sdm-title-row"},vl={class:"sdm-title"},yl={key:0,class:"sdm-badge-disabled"},hl={class:"sdm-owner"},ml=["aria-label"],gl={class:"sdm-body"},fl={key:0,class:"sdm-desc"},kl={key:1,class:"sdm-readme-loading"},bl=["innerHTML"],_l=["href"],wl={class:"sdm-footer"},Cl={class:"sdm-footer-actions"},Sl=["disabled"],$l=["disabled"],Pl=["disabled"],Al=["disabled"],Il=rt({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean},isTrying:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled","try"],setup(v,{emit:R}){const g=v,P=R,S=d(null),L=d(""),E=d(""),M=d(!1),{t:U}=ct(),x=w(()=>S.value??g.skill.enabled??!0),V=w(()=>g.isInstalling===!0||g.isUninstalling===!0),r=w(()=>L.value||g.skill.description),B=w(()=>{const _=g.skill.path;return _?_.endsWith("/SKILL.md")?_.slice(0,-9):_:""}),q=w(()=>{const _=E.value;if(!_)return"";const N=_.replace(/^---[\s\S]*?---\s*/,"");return Ha(W(N))});function W(_){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 le(){if(!(!g.skill.owner||!g.skill.name)){M.value=!0,L.value="",E.value="";try{const _=new URLSearchParams({owner:g.skill.owner,name:g.skill.name});g.skill.installed&&_.set("installed","true"),g.skill.path&&_.set("path",g.skill.path);const N=await fetch(`/codex-api/skills-hub/readme?${_}`);if(!N.ok)return;const j=await N.json();E.value=j.content??"",L.value=j.description??""}catch{}finally{M.value=!1}}}Te(()=>g.visible,_=>{_&&(S.value=null,L.value="",E.value="",le())});function I(){P("install",g.skill)}function f(){P("uninstall",g.skill)}function b(){const _=!x.value;S.value=_,P("toggle-enabled",g.skill,_)}function m(){g.isTrying||P("try",g.skill)}function Q(){const _=B.value;_&&window.open(`/codex-local-browse${encodeURI(_)}`,"_blank","noopener,noreferrer")}return(_,N)=>(a(),He(it,{to:"body"},[v.visible?(a(),l("div",{key:0,class:"sdm-overlay",onClick:N[1]||(N[1]=Be(j=>_.$emit("close"),["self"]))},[s("div",nl,[s("div",rl,[s("div",cl,[v.skill.avatarUrl?(a(),l("img",{key:0,class:"sdm-avatar",src:v.skill.avatarUrl,alt:v.skill.owner,loading:"lazy"},null,8,ul)):u("",!0),s("div",dl,[s("div",pl,[s("h3",vl,i(v.skill.displayName||v.skill.name),1),v.skill.installed&&!x.value?(a(),l("span",yl,i(n(U)("Disabled")),1)):u("",!0)]),s("span",hl,i(v.skill.owner),1)])]),s("button",{class:"sdm-close",type:"button","aria-label":n(U)("Close"),onClick:N[0]||(N[0]=j=>_.$emit("close"))},[je(da,{class:"sdm-close-icon"})],8,ml)]),s("div",gl,[r.value?(a(),l("p",fl,i(r.value),1)):u("",!0),M.value?(a(),l("div",kl,i(n(U)("Loading skill contents...")),1)):E.value?(a(),l("div",{key:2,class:"sdm-readme",innerHTML:q.value},null,8,bl)):u("",!0),v.skill.url?(a(),l("a",{key:3,class:"sdm-link",href:v.skill.url,target:"_blank",rel:"noopener noreferrer"},i(n(U)("View on GitHub")),9,_l)):u("",!0)]),s("div",wl,[s("div",Cl,[v.skill.installed?(a(),l("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:V.value,onClick:f},i(g.isUninstalling?n(U)("Uninstalling..."):n(U)("Uninstall")),9,Sl)):(a(),l("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:V.value,onClick:I},i(g.isInstalling?n(U)("Installing..."):n(U)("Install")),9,$l)),v.skill.installed?(a(),l("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:V.value,onClick:b},i(x.value?n(U)("Disable"):n(U)("Enable")),9,Pl)):u("",!0),v.skill.installed&&x.value?(a(),l("button",{key:3,class:"sdm-btn sdm-btn-primary",type:"button",disabled:V.value||g.isTrying,onClick:m},i(g.isTrying?"Starting...":"Try it!"),9,Al)):u("",!0),v.skill.installed&&B.value?(a(),l("button",{key:4,class:"sdm-btn sdm-btn-secondary",type:"button",onClick:Q},i(n(U)("Browse files")),1)):u("",!0)])])])])):u("",!0)]))}}),Ll=ut(Il,[["__scopeId","data-v-318b9c96"]]),El={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 ft=null;function Tl(){return ft||(ft=Promise.all([os(()=>import("./index.esm-Cxn_LBGD.js"),__vite__mapDeps([0,1])),os(()=>import("./index.esm-DYMAm9mq.js"),__vite__mapDeps([2,1]))])),ft}function Ul(v){const R=d(null),g=d(""),P=d(""),S=d(""),L=d({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),E=w(()=>S.value==="pull"),M=w(()=>S.value==="push"),U=w(()=>S.value==="startup-sync"),x=w(()=>S.value!=="");async function V(){try{const f=await fetch("/codex-api/skills-sync/status");if(!f.ok)return;const b=await f.json();b.data&&(L.value=b.data)}catch{}}async function r(){try{const f=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),b=await f.json();if(!f.ok||!b.data)throw new Error("Failed to start GitHub login");R.value=b.data;const m=30,Q=Math.max((b.data.interval??5)*1e3,3e3);let _=!1;for(let N=0;N<m;N++){await new Promise(te=>setTimeout(te,Q));const j=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:b.data.device_code})}),J=await j.json();if(!j.ok)throw new Error(J.error||"Failed to complete GitHub login");if(J.ok){_=!0;break}if(!J.pending)throw new Error(J.error||"Failed to complete GitHub login")}if(!_)throw new Error("GitHub login timed out. Please retry.");R.value=null,await V(),v.showToast("GitHub login successful")}catch(f){v.showToast(f instanceof Error?f.message:"Failed GitHub login","error")}}async function B(){try{const[f,b]=await Tl(),{getApp:m,getApps:Q,initializeApp:_}=f,{getAuth:N,GithubAuthProvider:j,signInWithPopup:J}=b,te=Q().length>0?m():_(El),se=N(te),X=new j;X.addScope("repo");const oe=await J(se,X),ne=j.credentialFromResult(oe),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})}),Y=await ee.json();if(!ee.ok||!Y.ok)throw new Error(Y.error||"Failed to login with GitHub token");await V(),v.showToast("GitHub login successful")}catch(f){const b=f instanceof Error?f.message:"Failed Firebase GitHub login";v.showToast(b,"error")}}async function q(){P.value="",g.value="pull-started",S.value="pull";try{const f=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),b=await f.json();if(!f.ok||!b.ok)throw new Error(b.error||"Failed to pull synced skills");await v.onPulled(),g.value="pull-success",v.showToast(L.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(f){const b=f instanceof Error?f.message:"Failed to pull sync";P.value=b,g.value="pull-failed",v.showToast(b,"error")}finally{S.value=""}}async function W(){P.value="",g.value="push-started",S.value="push";try{const f=await fetch("/codex-api/skills-sync/push",{method:"POST"}),b=await f.json();if(!f.ok||!b.ok)throw new Error(b.error||"Failed to push synced skills");g.value="push-success",v.showToast("Pushed skills to private sync repo")}catch(f){const b=f instanceof Error?f.message:"Failed to push sync";P.value=b,g.value="push-failed",v.showToast(b,"error")}finally{S.value=""}}async function le(){P.value="",g.value="startup-sync-started",S.value="startup-sync";try{const f=await fetch("/codex-api/skills-sync/startup-sync",{method:"POST"}),b=await f.json();if(!f.ok||!b.ok)throw new Error(b.error||"Failed to run startup sync");await v.onPulled(),await V(),g.value="startup-sync-success",v.showToast("Startup sync completed")}catch(f){const b=f instanceof Error?f.message:"Failed startup sync";P.value=b,g.value="startup-sync-failed",v.showToast(b,"error")}finally{S.value=""}}async function I(){try{const f=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),b=await f.json();if(!f.ok||!b.ok)throw new Error(b.error||"Failed to logout GitHub");await V(),v.showToast("Logged out from GitHub")}catch(f){v.showToast(f instanceof Error?f.message:"Failed to logout GitHub","error")}}return{deviceLogin:R,isPullInFlight:E,isPushInFlight:M,isStartupSyncInFlight:U,isSyncActionInFlight:x,loadSyncStatus:V,logoutGithub:I,pullSkillsSync:q,pushSkillsSync:W,startupSkillsSync:le,startGithubFirebaseLogin:B,startGithubLogin:r,syncActionError:P,syncActionStatus:g,syncStatus:L}}const Nl={class:"skills-hub"},Fl={class:"skills-hub-header"},Ml={class:"skills-hub-title"},Dl={class:"skills-hub-subtitle"},Ol={class:"skills-sync-panel"},Rl={class:"skills-sync-header"},xl=["href"],Gl={key:1,class:"skills-sync-badge"},Bl={key:2,class:"skills-sync-badge"},jl={class:"skills-sync-meta"},Hl={key:0,class:"skills-sync-error"},zl=["href"],Kl={key:1,class:"skills-sync-meta"},Vl={key:2,class:"skills-sync-error"},ql=["href"],Wl={key:3,class:"skills-sync-device"},Ql=["href"],Jl={class:"skills-sync-actions"},Yl=["disabled"],Zl=["disabled"],Xl=["disabled"],eo=["disabled"],to={class:"skills-search-panel"},so={class:"skills-search-header"},ao={class:"skills-search-copy"},lo={class:"skills-directory-link",href:"https://skills.anyclaw.store/",target:"_blank",rel:"noopener noreferrer"},oo=["placeholder","aria-label"],io=["disabled"],no={key:0,class:"skills-hub-error"},ro=["href"],co={key:1,class:"skills-hub-section"},uo={class:"skills-hub-section-title"},po={key:0,class:"skills-hub-grid"},vo={key:2,class:"skills-hub-section"},yo={class:"skills-hub-section-title"},ho={key:0,class:"skills-hub-grid"},mo={class:"skills-hub-section"},go={key:0,class:"skills-hub-loading"},fo={key:1,class:"skills-hub-error"},ko=["href"],bo={key:2,class:"skills-hub-empty"},_o=rt({__name:"SkillsHub",props:{tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(v,{emit:R}){const g={name:"",owner:"",description:"",url:"",installed:!1},P=d([]),S=d([]),L=d(!1),E=d(!1),M=d(""),U=d(""),x=d(""),V=d(!0),r=d(!0),B=d(!1),q=d(g),W=d(null),le=d(""),I=d(!1),f=d(!1);let b=null;ds(()=>{b&&clearTimeout(b)});const{t:m}=ct(),{buildFeedbackMailto:Q,feedbackMailtoBase:_,recordVisibleFailure:N}=va(),j=_(),J=v,te=R,se=w(()=>{var y;return((y=W.value)==null?void 0:y.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),X=w(()=>`${q.value.owner}/${q.value.name}`),oe=w(()=>I.value&&le.value===X.value),ne=w(()=>f.value&&le.value===X.value),re=w(()=>{if(!D.value.configured)return"";const y=D.value.repoOwner.trim(),p=D.value.repoName.trim();return!y||!p?"":`https://github.com/${encodeURIComponent(y)}/${encodeURIComponent(p)}`}),ee=w(()=>P.value);function Y(y,p="success"){W.value={text:y,type:p},b&&clearTimeout(b),b=setTimeout(()=>{W.value=null},3e3)}function fe(y,p){N(p);const h=y.currentTarget;h instanceof HTMLAnchorElement&&(h.href=Q())}function de(y){if(P.value=y.installed??[],S.value.length>0){const p=new Map(P.value.map(h=>[h.name,h]));S.value=S.value.map(h=>{const G=p.get(h.name);return G?Ue(h,G):h})}}function Ue(y,p){return{...y,installed:!0,path:p.path,enabled:p.enabled}}function ze(y,p){return{...y,installed:!0,source:p.source,publishedAt:p.publishedAt}}async function pe(){L.value=!0,M.value="";try{const y=await fetch("/codex-api/skills-hub");if(!y.ok)throw new Error(`HTTP ${y.status}`);const p=await y.json();de(p)}catch(y){M.value=y instanceof Error?y.message:m("Failed to load skills")}finally{L.value=!1}}function be(y){const p=y.installed?P.value.find(h=>h.name===y.name):void 0;q.value=p?ze(p,y):y,B.value=!0}async function Ne(){const y=U.value.trim();if(!(y.length<2)){E.value=!0,x.value="";try{const p=new URLSearchParams({q:y}),h=await fetch(`/codex-api/skills-hub/search?${p}`),G=await h.json();if(!h.ok)throw new Error(G.error||`HTTP ${h.status}`);const ce=new Map(P.value.map(ue=>[ue.name,ue]));S.value=(G.results??[]).map(ue=>{const ae=ce.get(ue.name);return ae?Ue(ue,ae):ue}),r.value=!0,S.value.length===0&&Y(m("No matching skills found."),"error")}catch(p){x.value=p instanceof Error?p.message:m("Failed to search skills")}finally{E.value=!1}}}async function Fe(y){le.value=`${y.owner}/${y.name}`,I.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||m("Install failed"));if(!h.path)throw new Error(m("Install completed but no local skill path was returned"));await pe();const G=P.value.find(ce=>ce.name===y.name);if(!(G!=null&&G.path))throw new Error(m("Install completed but the local skill was not found after refresh"));q.value=ze(G,y),Y(`${y.displayName||y.name} ${m("skill installed")}`),B.value=!1,te("skills-changed")}catch(p){Y(p instanceof Error?p.message:m("Failed to install skill"),"error")}finally{I.value=!1}}async function Me(y){le.value=`${y.owner}/${y.name}`,f.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||m("Uninstall failed"));P.value=P.value.filter(G=>G.name!==y.name),Y(`${y.displayName||y.name} ${m("skill uninstalled")}`),B.value=!1,te("skills-changed")}catch(p){Y(p instanceof Error?p.message:m("Failed to uninstall skill"),"error")}finally{f.value=!1}}async function De(y,p){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:p}})})).ok)throw new Error(m("Failed to update skill"));await fetch("/codex-api/skills-sync/push",{method:"POST"}),Y(`${y.displayName||y.name} ${m("skill")} ${m(p?"enabled":"disabled")}`),await pe()}catch(h){Y(h instanceof Error?h.message:m("Failed to update skill"),"error")}}function C(y){!y.installed||y.enabled===!1||J.tryInFlightKey||(te("try-item",{kind:"skill",name:y.name,displayName:y.displayName||y.name,skillPath:y.path}),B.value=!1)}function F(y){return`skill:${y.name}:${y.path??""}`}const{deviceLogin:_e,isPullInFlight:Ke,isPushInFlight:Oe,isStartupSyncInFlight:$,isSyncActionInFlight:ve,loadSyncStatus:Ve,logoutGithub:we,pullSkillsSync:Ce,pushSkillsSync:Se,startupSkillsSync:Z,startGithubFirebaseLogin:Re,startGithubLogin:ye,syncActionError:he,syncActionStatus:$e,syncStatus:D}=Ul({showToast:Y,onPulled:async()=>{await pe(),te("skills-changed")}}),Pe=[w(()=>D.value.startup.lastError),he,x,M];return ps(()=>{pe(),Ve()}),Te(Pe,(y,p)=>{y.forEach((h,G)=>{if(h===p[G])return;const ce=h.trim();ce&&N(ce)})}),(y,p)=>(a(),l("div",Nl,[s("div",Fl,[s("h2",Ml,i(n(m)("Skills Hub")),1),s("p",Dl,i(n(m)("Manage installed skills on this machine")),1)]),s("div",Ol,[s("div",Rl,[s("strong",null,i(n(m)("Skills Sync (GitHub)")),1),n(D).configured&&re.value?(a(),l("a",{key:0,class:"skills-sync-badge skills-sync-badge-link",href:re.value,target:"_blank",rel:"noopener noreferrer"},i(n(m)("Connected"))+": "+i(n(D).repoOwner)+"/"+i(n(D).repoName),9,xl)):n(D).loggedIn?(a(),l("span",Gl,i(n(m)("Logged in as"))+" "+i(n(D).githubUsername),1)):(a(),l("span",Bl,i(n(m)("Not connected")),1))]),s("div",jl,[s("span",null,i(n(m)("Startup"))+": "+i(n(D).startup.mode),1),s("span",null,i(n(m)("Branch"))+": "+i(n(D).startup.branch),1),s("span",null,i(n(m)("Action"))+": "+i(n(D).startup.lastAction),1)]),n(D).startup.lastError?(a(),l("div",Hl,[s("span",null,i(n(D).startup.lastError),1),s("a",{class:"skills-error-feedback",href:n(j),onClick:p[0]||(p[0]=h=>fe(h,n(D).startup.lastError))},i(n(m)("Send feedback")),9,zl)])):u("",!0),n($e)?(a(),l("div",Kl,[s("span",null,i(n(m)("Manual sync"))+": "+i(n($e)),1)])):u("",!0),n(he)?(a(),l("div",Vl,[s("span",null,i(n(he)),1),s("a",{class:"skills-error-feedback",href:n(j),onClick:p[1]||(p[1]=h=>fe(h,n(he)))},i(n(m)("Send feedback")),9,ql)])):u("",!0),n(_e)?(a(),l("div",Wl,[s("span",null,[nt(i(n(m)("Open"))+" ",1),s("a",{href:n(_e).verification_uri,target:"_blank",rel:"noreferrer"},i(n(m)("GitHub device login")),9,Ql),nt(" "+i(n(m)("and enter code:")),1)]),s("code",null,i(n(_e).user_code),1)])):u("",!0),s("div",Jl,[n(D).loggedIn?u("",!0):(a(),l("button",{key:0,class:"skills-hub-sort",type:"button",onClick:p[2]||(p[2]=(...h)=>n(Re)&&n(Re)(...h))},i(n(m)("Login with GitHub")),1)),n(D).loggedIn?u("",!0):(a(),l("button",{key:1,class:"skills-hub-sort",type:"button",onClick:p[3]||(p[3]=(...h)=>n(ye)&&n(ye)(...h))},i(n(m)("Device Login")),1)),n(D).loggedIn?(a(),l("button",{key:2,class:"skills-hub-sort",type:"button",onClick:p[4]||(p[4]=(...h)=>n(we)&&n(we)(...h)),disabled:n(ve)},i(n(m)("Logout GitHub")),9,Yl)):u("",!0),s("button",{class:"skills-hub-sort",type:"button",onClick:p[5]||(p[5]=(...h)=>n(Z)&&n(Z)(...h)),disabled:n(ve)},i(n($)?n(m)("Syncing..."):n(m)("Startup Sync")),9,Zl),s("button",{class:"skills-hub-sort",type:"button",onClick:p[6]||(p[6]=(...h)=>n(Ce)&&n(Ce)(...h)),disabled:n(ve)},i(n(Ke)?n(m)("Pulling..."):n(m)("Pull")),9,Xl),n(D).loggedIn?(a(),l("button",{key:3,class:"skills-hub-sort",type:"button",onClick:p[7]||(p[7]=(...h)=>n(Se)&&n(Se)(...h)),disabled:!n(D).configured||n(ve)},i(n(Oe)?n(m)("Pushing..."):n(m)("Push")),9,eo)):u("",!0)])]),W.value?(a(),l("div",{key:0,class:K(["skills-hub-toast",se.value])},i(W.value.text),3)):u("",!0),s("div",to,[s("div",so,[s("div",ao,[s("strong",null,i(n(m)("Find skills")),1),s("span",null,i(n(m)("Search the Skills registry with npx skills find.")),1)]),s("a",lo,i(n(m)("Skills directory")),1)]),s("form",{class:"skills-search-form",onSubmit:Be(Ne,["prevent"])},[Je(s("input",{"onUpdate:modelValue":p[8]||(p[8]=h=>U.value=h),class:"skills-search-input",type:"search",placeholder:n(m)("Search skills..."),"aria-label":n(m)("Search skills")},null,8,oo),[[Ye,U.value]]),s("button",{class:"skills-hub-sort",type:"submit",disabled:E.value||U.value.trim().length<2},i(E.value?n(m)("Searching..."):n(m)("Search")),9,io)],32),x.value?(a(),l("div",no,[s("span",null,i(x.value),1),s("a",{class:"skills-error-feedback",href:n(j),onClick:p[9]||(p[9]=h=>fe(h,x.value))},i(n(m)("Send feedback")),9,ro)])):u("",!0)]),S.value.length>0?(a(),l("div",co,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:p[10]||(p[10]=h=>r.value=!r.value)},[s("span",uo,i(n(m)("Search results ({count})",{count:S.value.length})),1),je(is,{class:K(["skills-hub-section-chevron",{"is-open":r.value}])},null,8,["class"])]),r.value?(a(),l("div",po,[(a(!0),l(O,null,z(S.value,h=>(a(),He(cs,{key:h.source||`${h.owner}/${h.name}`,skill:h,"show-browse-action":!1,onSelect:G=>be(G)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),pa(y.$slots,"before-installed",{},void 0),ee.value.length>0?(a(),l("div",vo,[s("button",{class:"skills-hub-section-toggle",type:"button",onClick:p[11]||(p[11]=h=>V.value=!V.value)},[s("span",yo,i(n(m)("Installed skills ({count})",{count:ee.value.length})),1),je(is,{class:K(["skills-hub-section-chevron",{"is-open":V.value}])},null,8,["class"])]),V.value?(a(),l("div",ho,[(a(!0),l(O,null,z(ee.value,h=>(a(),He(cs,{key:h.name,skill:h,"show-status-badge":!1,"show-owner":!1,onSelect:G=>be(G)},null,8,["skill","onSelect"]))),128))])):u("",!0)])):u("",!0),s("div",mo,[L.value?(a(),l("div",go,i(n(m)("Loading skills...")),1)):M.value?(a(),l("div",fo,[s("span",null,i(M.value),1),s("a",{class:"skills-error-feedback",href:n(j),onClick:p[12]||(p[12]=h=>fe(h,M.value))},i(n(m)("Send feedback")),9,ko)])):P.value.length===0?(a(),l("div",bo,i(n(m)("No installed skills found.")),1)):u("",!0)]),je(Ll,{skill:q.value,visible:B.value,"is-installing":oe.value,"is-uninstalling":ne.value,"is-trying":J.tryInFlightKey===F(q.value),onClose:p[13]||(p[13]=h=>B.value=!1),onInstall:Fe,onUninstall:Me,onToggleEnabled:De,onTry:C},null,8,["skill","visible","is-installing","is-uninstalling","is-trying"])]))}}),wo=ut(_o,[["__scopeId","data-v-25bfcbd5"]]),Co={class:"directory-hub"},So={class:"directory-header"},$o={class:"directory-title"},Po={class:"directory-subtitle"},Ao={class:"directory-header-actions"},Io=["disabled"],Lo={class:"directory-tabs",role:"tablist","aria-label":"Directory sections"},Eo=["aria-selected","onClick"],To={key:1,class:"directory-section"},Uo={class:"directory-toolbar"},No={class:"directory-sort-group",role:"group","aria-label":"Sort plugins"},Fo={key:0,class:"directory-marketplace"},Mo={class:"directory-marketplace-header"},Do=["disabled"],Oo={key:0,class:"directory-marketplace-empty"},Ro={key:1,class:"directory-marketplace-list"},xo={class:"directory-marketplace-name"},Go={key:0,class:"directory-marketplace-path"},Bo=["disabled","onClick"],jo={class:"directory-marketplace-add"},Ho=["disabled"],zo={key:1,class:"directory-empty"},Ko={key:2,class:"directory-error"},Vo={key:3,class:"directory-loading"},qo={key:4,class:"directory-empty"},Wo={key:5,class:"directory-grid"},Qo=["onClick"],Jo={class:"directory-card-top"},Yo=["src","alt"],Zo={class:"directory-card-main"},Xo={class:"directory-card-title-row"},ei={class:"directory-card-title"},ti={key:0,class:"directory-badge is-muted"},si={key:1,class:"directory-badge"},ai={class:"directory-card-meta"},li={key:0,class:"directory-card-description"},oi={class:"directory-chip-row"},ii={key:0,class:"directory-chip"},ni={key:2,class:"directory-section"},ri={class:"directory-toolbar"},ci={class:"directory-sort-group",role:"group","aria-label":"Sort apps"},ui={key:0,class:"directory-empty"},di={key:1,class:"directory-error"},pi={key:2,class:"directory-loading"},vi={key:3,class:"directory-empty"},yi={key:4,class:"directory-grid"},hi={class:"directory-card-top"},mi=["src","alt"],gi={key:1,class:"directory-card-fallback"},fi={class:"directory-card-main"},ki={class:"directory-card-title-row"},bi={class:"directory-card-title"},_i={key:0,class:"directory-badge is-muted"},wi={key:1,class:"directory-badge"},Ci={class:"directory-card-meta"},Si={key:0,class:"directory-card-description"},$i={class:"directory-chip-row"},Pi={key:0,class:"directory-chip"},Ai={class:"directory-card-actions"},Ii=["disabled","onClick"],Li=["onClick"],Ei=["disabled","onClick"],Ti={key:3,class:"directory-section"},Ui={class:"directory-toolbar"},Ni={class:"directory-sort-group",role:"group","aria-label":"Sort Composio connectors"},Fi={key:0,class:"directory-error"},Mi={key:1,class:"directory-loading"},Di={key:2,class:"directory-empty"},Oi={class:"directory-empty-copy"},Ri={class:"directory-card-actions"},xi=["disabled"],Gi={key:3,class:"composio-preview"},Bi={class:"composio-preview-hero"},ji={class:"composio-preview-actions"},Hi=["disabled"],zi={class:"composio-preview-grid"},Ki={class:"directory-card-top"},Vi={class:"directory-card-fallback composio-fallback"},qi={class:"directory-card-main"},Wi={class:"directory-card-title-row"},Qi={class:"directory-card-title"},Ji={class:"directory-card-meta"},Yi={class:"directory-card-description"},Zi={class:"directory-chip-row"},Xi={key:4,class:"directory-section composio-section"},en={class:"directory-card directory-card-wide composio-status-card"},tn={class:"directory-card-top"},sn={class:"directory-card-main"},an={class:"directory-card-title-row"},ln={class:"directory-card-title"},on={class:"directory-badge"},nn={class:"directory-card-meta"},rn={class:"directory-card-description"},cn={class:"directory-chip-row"},un={key:0,class:"directory-chip"},dn={key:1,class:"directory-chip"},pn={key:2,class:"directory-chip"},vn={class:"directory-card-actions"},yn={key:0,class:"directory-empty"},hn={key:1,class:"directory-grid"},mn={class:"directory-card-top"},gn=["src","alt"],fn={key:1,class:"directory-card-fallback composio-fallback"},kn={class:"directory-card-main"},bn={class:"directory-card-title-row"},_n={class:"directory-card-title"},wn={key:0,class:"directory-badge"},Cn={key:1,class:"directory-badge"},Sn={class:"directory-card-meta"},$n={key:0,class:"directory-card-description"},Pn={class:"directory-chip-row"},An={class:"directory-chip"},In={key:0,class:"directory-chip"},Ln={key:1,class:"directory-chip"},En={class:"directory-card-actions"},Tn=["onClick"],Un=["disabled","onClick"],Nn=["disabled","onClick"],Fn={key:2,class:"directory-section-actions"},Mn=["disabled"],Dn={key:4,class:"directory-section"},On={class:"skills-embedded-section"},Rn={class:"skills-embedded-title"},xn={key:0,class:"skills-embedded-body"},Gn={key:0,class:"directory-empty"},Bn={key:1,class:"directory-error"},jn={key:2,class:"directory-loading"},Hn={key:3,class:"directory-empty"},zn={key:4,class:"mcp-skill-grid"},Kn=["onClick"],Vn={class:"mcp-skill-card-top"},qn={class:"mcp-skill-avatar-fallback"},Wn={class:"mcp-skill-info"},Qn={class:"mcp-skill-header"},Jn={class:"mcp-skill-name"},Yn={class:"mcp-skill-meta"},Zn={key:0,class:"directory-mcp-detail"},Xn={key:0},er={class:"directory-mini-list"},tr={key:1},sr={class:"directory-mini-list"},ar={class:"directory-modal"},lr={class:"directory-modal-header"},or={class:"directory-card-top"},ir=["src","alt"],nr={key:1,class:"directory-card-fallback"},rr={class:"directory-card-main"},cr={class:"directory-modal-title"},ur={class:"directory-card-meta"},dr=["aria-label"],pr={class:"directory-modal-body"},vr={key:0,class:"directory-error"},yr={key:1,class:"directory-loading"},hr={key:0,class:"directory-detail-description"},mr={key:1,class:"directory-detail-block"},gr={class:"directory-chip-row"},fr={class:"directory-detail-grid"},kr={key:0,class:"directory-detail-block"},br={class:"directory-detail-heading"},_r={key:0,class:"directory-auth-status is-warning"},wr=["onClick"],Cr={key:1,class:"directory-detail-block"},Sr={class:"directory-detail-heading"},$r={class:"directory-mini-list"},Pr={key:2,class:"directory-detail-block"},Ar=["disabled","onClick"],Ir={key:2,class:"directory-screenshots"},Lr=["src"],Er={key:3,class:"directory-auth-panel"},Tr=["onClick"],Ur={class:"directory-modal-footer"},Nr=["disabled"],Fr=["disabled"],Mr={key:2,class:"directory-action",type:"button",disabled:""},Dr=["disabled"],Or=["disabled"],Rr={class:"directory-modal directory-modal--share"},xr={class:"directory-modal-header"},Gr={class:"directory-card-main"},Br={class:"directory-modal-title"},jr={class:"directory-card-meta"},Hr=["aria-label"],zr={class:"directory-modal-body"},Kr={key:0,class:"directory-error"},Vr={key:1,class:"directory-loading"},qr={key:0,class:"directory-empty"},Wr={key:1,class:"directory-share-list"},Qr={class:"directory-share-info"},Jr={class:"directory-share-name"},Yr=["href"],Zr=["disabled","onClick"],Xr=["disabled","onClick"],ec=["disabled"],tc={class:"directory-modal"},sc={class:"directory-modal-header"},ac={class:"directory-card-top"},lc=["src","alt"],oc={key:1,class:"directory-card-fallback composio-fallback"},ic={class:"directory-card-main"},nc={class:"directory-modal-title"},rc={class:"directory-card-meta"},cc=["aria-label"],uc={class:"directory-modal-body"},dc={key:0,class:"directory-error"},pc={key:1,class:"directory-loading"},vc={key:0,class:"directory-detail-description"},yc={class:"directory-detail-grid"},hc={class:"directory-detail-block"},mc={class:"directory-chip-row"},gc={class:"directory-chip"},fc={key:0,class:"directory-chip"},kc={key:1,class:"directory-chip"},bc={key:2,class:"directory-chip"},_c={class:"directory-detail-block"},wc={key:0,class:"directory-mini-list"},Cc={key:1},Sc={class:"directory-card-meta"},$c={key:1,class:"directory-detail-block"},Pc={class:"directory-card-meta"},Ac={class:"directory-modal-footer"},Ic=["disabled"],Lc=["disabled"],Ec="/Users/igor/.codex/skills/shared_skills/composio-cli/SKILL.md",Tc=50,us=100,Uc=rt({__name:"DirectoryHub",props:{cwd:{},threadId:{},tryInFlightKey:{}},emits:["skills-changed","try-item"],setup(v,{expose:R,emit:g}){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]],S=[[/(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]],L=[[/(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]],E=[[/(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]],M=v,U=g,x=ya(),V=ha(),{t:r}=ct(),B=w(()=>[{id:"plugins",label:r("Plugins"),subtitle:r("Plugins make Codex work your way.")},{id:"apps",label:r("Apps"),subtitle:r("Connect Codex to external apps and services.")},{id:"composio",label:"Composio",subtitle:r("Browse Composio connectors, auth state, and ready-to-try integrations.")},{id:"skills",label:r("Skills"),subtitle:r("MCPs first, then installed skills and GitHub sync state.")}]),q=[{name:"Gmail",slug:"gmail",initial:"G",meta:"Inbox, drafts, attachments",description:"Find emails, summarize threads, draft replies, and pull attachment context into a chat.",chips:["Email","Search","Drafts"]},{name:"Google Calendar",slug:"google-calendar",initial:"C",meta:"Events and availability",description:"Check what is next, find open time, and turn follow-ups into calendar blocks.",chips:["Events","Availability","Reminders"]},{name:"Reddit",slug:"reddit",initial:"R",meta:"Posts, comments, communities",description:"Search communities, inspect posts, and prepare natural replies before posting.",chips:["Search","Comments","Posts"]},{name:"YouTube",slug:"youtube",initial:"Y",meta:"Videos, channels, comments",description:"Look up channel details, inspect video metadata, and help manage comment workflows.",chips:["Videos","Channels","Comments"]},{name:"Google Drive",slug:"google-drive",initial:"D",meta:"Files, docs, folders",description:"Find files, read shared docs, and bring Drive context into a Codex thread.",chips:["Files","Docs","Search"]},{name:"X",slug:"x",initial:"X",meta:"Posts, replies, profiles",description:"Research public posts, draft replies, and keep social workflows reviewable.",chips:["Posts","Replies","Profiles"]}];function W(e){return e==="plugins"||e==="apps"||e==="composio"||e==="skills"}function le(){return W(x.query.tab)?x.query.tab:"skills"}const I=d(le()),f=d(new Set),b=d(!1),m=d([]),Q=d([]),_=d(null),N=d([]),j=d(null),J=d(0),te=d([]),se=d("popular"),X=d("popular"),oe=d("popular"),ne=d(""),re=d(""),ee=d(""),Y=d(!1),fe=d(!1),de=d(!1),Ue=d(!1),ze=d(!1),pe=d(!1),be=d(!0),Ne=d(""),Fe=d(""),Me=d(""),De=d(""),C=d(null),F=d(null),_e=d(!1),Ke=d(!1),Oe=d(""),$=d(null),ve=d(!1),Ve=d(!1),we=d(""),Ce=d(!1),Se=d(!1),Z=d(!1),Re=d(""),ye=d(""),he=d([]),$e=d(""),D=d(new Set),Pe=d(null),y=d(""),p=d(""),h=d(!1),G=d([]),ce=d(!1),ue=d(!1),ae=d(!1),me=d(""),Ae=d("");let qe=null,We=null;ds(()=>{qe&&clearTimeout(qe),We&&clearTimeout(We)});let dt=!1;const ys=w(()=>B.value.find(e=>e.id===I.value)??B.value[0]),kt=w(()=>!b.value||["plugin/list","plugin/read","plugin/install","plugin/uninstall"].every(e=>f.value.has(e))),Ze=w(()=>!b.value||f.value.has("app/list")),pt=w(()=>!b.value||f.value.has("mcpServerStatus/list")),bt=w(()=>f.value.has("config/mcpServer/reload")),_t=w(()=>f.value.has("mcpServer/oauth/login")),hs=w(()=>!b.value||["marketplace/add","marketplace/remove","marketplace/upgrade"].every(e=>f.value.has(e))),ms=w(()=>!b.value||["plugin/share/save","plugin/share/list","plugin/share/delete"].every(e=>f.value.has(e))),Ie=w(()=>(M.tryInFlightKey??"").length>0),wt=w(()=>{var e,t,c;return((e=F.value)==null?void 0:e.description)||((t=F.value)==null?void 0:t.summary.longDescription)||((c=F.value)==null?void 0:c.summary.description)||""}),Ct=w(()=>{var t;const e=(t=F.value)==null?void 0:t.summary;return e?[...e.screenshotUrls,...e.screenshots.map(tt)].filter(Boolean):[]}),vt=w(()=>{var c;const e=((c=F.value)==null?void 0:c.apps)??[];if(e.length===0)return!1;const t=new Set;for(const k of Q.value)t.add(k.id.trim().toLowerCase()),t.add(Tt(k.name));return e.some(k=>{const H=k.id.trim().toLowerCase(),ke=Tt(k.name),Ee=H.length>0&&t.has(H),ot=ke.length>0&&t.has(ke);return!Ee&&!ot})}),gs=w(()=>{var e,t;return((e=C.value)==null?void 0:e.installPolicy)==="NOT_AVAILABLE"||(((t=F.value)==null?void 0:t.apps.some(c=>Et(c)))??!1)}),St=w(()=>Is(Ns(Es(m.value,ne.value),se.value),se.value,ne.value)),$t=w(()=>{const e=new Map;for(const t of m.value){if(!t.marketplaceName)continue;const c=t.marketplaceName;e.has(c)||e.set(c,{name:t.marketplaceName,displayName:t.marketplaceDisplayName||t.marketplaceName,path:t.marketplacePath})}return[...e.values()].sort((t,c)=>t.displayName.localeCompare(c.displayName))}),Pt=w(()=>Ls(Fs(Ts(Q.value,re.value),X.value),X.value,re.value)),At=w(()=>qa(Us(N.value,ee.value),oe.value,ee.value)),fs=w(()=>{const e=Qe(ee.value);return e?q.filter(t=>Xe([t.name,t.slug,t.meta,t.description,...t.chips],e)):q}),yt=w(()=>Ms(te.value)),It=w(()=>j.value!==null),ks=w(()=>new Map(te.value.map(e=>[e.name,e]))),bs=w(()=>{const e=_.value;return e&&[e.email||e.defaultOrgName,e.defaultOrgId?`org ${e.defaultOrgId}`:"",e.baseUrl||""].filter(Boolean).join(" · ")||r("Composio CLI shares the login and connections from this machine.")});function Qe(e){return e.trim().toLowerCase()}function _s(e){return Qe(e).replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").replace(/[-_]+/gu," ").replace(/\s+plugin$/iu,"").replace(/\s+/gu," ").trim()}function Lt(...e){const t=new Set;for(const c of e){const k=_s(c);k&&(t.add(k),t.add(k.replace(/\s+/gu,"")))}return Array.from(t)}function ws(e){return!e.isAccessible&&e.installUrl.trim().length===0}function Cs(e){const t=e.id.trim();if(t){const k=Q.value.find(H=>H.id===t);if(k)return k}const c=Lt(e.name);return Q.value.find(k=>Lt(k.name).some(H=>c.includes(H)))??null}function Et(e){const t=Cs(e);return t?ws(t):e.needsAuth&&e.installUrl.trim().length===0}function Xe(e,t){const c=Qe(t);return c?e.some(k=>k==null?void 0:k.toLowerCase().includes(c)):!0}function et(e,t){return t.reduce((c,[k,H])=>c+(k.test(e)?H:0),0)}function ht(e){return e.replace(/\s+\((synced|legacy)\)\s*$/iu,"").replace(/\s+\(.*?\)\s*$/u,"").trim()}function Tt(e){return ht(e).toLowerCase()}function Ss(e){return e==="DEFAULT_OAI_CATALOG"?r("OpenAI catalog"):e==="ECOSYSTEM_DIRECTORY"?r("Ecosystem directory"):e?e.replace(/_/gu," ").toLowerCase().replace(/\b\w/gu,t=>t.toUpperCase()):""}function $s(e){return e.developer||Ss(e.distributionChannel)||r("App")}function mt(e){var t;return((t=ks.value.get(e))==null?void 0:t.authStatus)??"unknown"}function Ut(e){const t=mt(e);return r(t==="oAuth"?"Logged in":t==="bearerToken"?"Bearer token":t==="notLoggedIn"?"Login required":t==="unsupported"?"Auth unsupported":"Status unknown")}function Ps(e){const t=mt(e);return t==="oAuth"||t==="bearerToken"?"is-ok":t==="notLoggedIn"?"is-warning":"is-muted"}function As(e){return e==="oAuth"||e==="bearerToken"?"mcp-skill-badge-ok":e==="notLoggedIn"?"mcp-skill-badge-warning":"mcp-skill-badge-muted"}function Nt(e){return _t.value&&mt(e)==="notLoggedIn"}function Is(e,t,c){return t==="popular"&&Qe(c).length===0?e.slice(0,us):e}function Ls(e,t,c){if(t!=="popular"||Qe(c).length>0)return e;const k=new Set,H=[];for(const ke of e){const Ee=ht(ke.name).toLowerCase();if(!k.has(Ee)&&(k.add(Ee),H.push(ke),H.length>=us))break}return H}function Es(e,t){return e.filter(c=>Xe([c.displayName,c.name,c.description,c.developerName,c.category,c.marketplaceDisplayName,...c.capabilities],t))}function Ts(e,t){return e.filter(c=>Xe([c.name,c.description,c.developer,c.category,c.distributionChannel,...c.pluginDisplayNames],t))}function Us(e,t){return e.filter(c=>Xe([c.name,c.slug,c.description,...c.authModes,...c.connectionStatuses],t))}function Ft(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+et(`${e.displayName} ${e.name} ${e.description} ${e.category}`,L)}function Mt(e){const t=ht(e.name);return(e.isAccessible?1e4:0)+et(t,P)+(e.pluginDisplayNames.length>0?260:0)+(e.distributionChannel==="DEFAULT_OAI_CATALOG"?120:0)+(e.isEnabled?40:0)+(e.installUrl?20:0)+et(`${e.name} ${e.description} ${e.category} ${e.pluginDisplayNames.join(" ")}`,S)-e.catalogRank*.001}function Dt(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+et(e.name,E)}function Ns(e,t){return t==="name"?[...e].sort((c,k)=>c.displayName.localeCompare(k.displayName)):t==="date"?[...e]:[...e].sort((c,k)=>Ft(k)-Ft(c)||c.displayName.localeCompare(k.displayName))}function Fs(e,t){return t==="name"?[...e].sort((c,k)=>c.name.localeCompare(k.name)):t==="date"?[...e].sort((c,k)=>c.catalogRank-k.catalogRank):[...e].sort((c,k)=>Mt(k)-Mt(c)||c.name.localeCompare(k.name))}function Ms(e,t){return[...e].sort((c,k)=>Dt(k)-Dt(c)||c.name.localeCompare(k.name))}function T(e,t="success"){Pe.value={text:e,type:t},qe&&clearTimeout(qe),qe=setTimeout(()=>{Pe.value=null},3e3)}function tt(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 st(e){return e?e.logoUrl||tt(e.logoPath)||e.composerIconUrl||tt(e.composerIconPath):""}function Ot(e){return tt(e.logoUrlDark||e.logoUrl)}function Rt(e){return e.activeCount>0?`${e.activeCount} ${r("connected")} ${e.activeCount===1?r("account"):r("accounts")}`:e.isNoAuth?r("No auth required"):e.connectionStatuses.length>0?e.connectionStatuses.join(", "):e.authModes.join(", ")||r("Connection required")}function Ds(e){return e.isNoAuth||e.activeCount>0}function at(e){return e.isNoAuth?"":e.activeCount>0?r("Manage"):e.totalConnections>0?r("Reconnect"):r("Connect")}function Os(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?r("Active"):t==="EXPIRED"?r("Expired"):t==="FAILED"?r("Failed"):t==="INITIATED"?r("Pending"):t||r("Unknown")}function Rs(e){const t=e.trim().toUpperCase();return t==="ACTIVE"?"is-ok":t==="INITIATED"?"is-warning":t==="EXPIRED"||t==="FAILED"?"is-error":"is-muted"}function xs(e){return`app:${e.id}:`}function Gs(e){Ie.value||U("try-item",{kind:"app",name:e.id,displayName:e.name})}function Bs(e){return`plugin:${e.name}:`}function xt(e){return`composio:${e}:`}function js(e){Ie.value||U("try-item",{kind:"plugin",name:e.name,displayName:e.displayName})}function Gt(e){return Ds(e)}function Hs(e,t=[]){const c=t.find(H=>H.status==="ACTIVE"&&!H.isDisabled),k=c!=null&&c.wordId?` If there are multiple accounts, prefer \`${c.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.${k}`}function Bt(e,t=[]){Ie.value||U("try-item",{kind:"composio",name:e.slug,displayName:e.name,prompt:Hs(e,t),attachedSkills:[{name:"composio-cli",path:Ec}]})}function ie(e){const t=e.trim();/^https?:\/\//i.test(t)&&window.location.assign(t)}function zs(e){const t=e.find(c=>c.needsAuth&&c.installUrl.trim().length>0);return t?(ie(t.installUrl),!0):!1}function Ks(e){return e.brandColor?{backgroundColor:e.brandColor,color:"#fff"}:{}}async function Vs(){try{f.value=new Set(await ba())}catch{f.value=new Set}finally{b.value=!0}}async function ge(){var e;if(kt.value){Y.value=!0,Ne.value="";try{const t=(e=M.cwd)==null?void 0:e.trim(),[c]=await Promise.all([_a(t?[t]:void 0),Ze.value?xe():Promise.resolve()]);m.value=c}catch(t){Ne.value=t instanceof Error?t.message:"Failed to load plugins"}finally{Y.value=!1}}}async function jt(){const e=y.value.trim();if(e){h.value=!0,p.value="add";try{await wa(e),y.value="",T("Marketplace added"),await ge()}catch(t){T(t instanceof Error?t.message:"Failed to add marketplace","error")}finally{h.value=!1,p.value=""}}}async function qs(e){h.value=!0,p.value=`remove:${e}`;try{await Ca(e),T("Marketplace removed"),await ge()}catch(t){T(t instanceof Error?t.message:"Failed to remove marketplace","error")}finally{h.value=!1,p.value=""}}async function Ws(){h.value=!0,p.value="upgrade";try{const e=await Sa();e.errors.length>0?T(e.errors.join("; "),"error"):T(`Upgraded ${e.upgradedRoots.length||e.selectedMarketplaces.length||"all"} marketplace${e.upgradedRoots.length+e.selectedMarketplaces.length===1?"":"s"}`),await ge()}catch(e){T(e instanceof Error?e.message:"Failed to upgrade marketplaces","error")}finally{h.value=!1,p.value=""}}async function xe(){var e;if(Ze.value){fe.value=!0,Fe.value="";try{Q.value=await $a(((e=M.threadId)==null?void 0:e.trim())||void 0)}catch(t){Fe.value=t instanceof Error?t.message:"Failed to load apps"}finally{fe.value=!1}}}async function Le(e=!1){if(de.value){dt=!0;return}de.value=!0,Me.value="";try{const t=await Pa();if(_.value=t,!t.available||!t.authenticated){N.value=[],j.value=null,J.value=0;return}const c=e?j.value:null,k=await Aa(ee.value,c,Tc);N.value=e?[...N.value,...k.data]:k.data,j.value=k.nextCursor,J.value=k.total}catch(t){Me.value=t instanceof Error?t.message:"Failed to load Composio connectors",N.value=[],j.value=null,J.value=0}finally{de.value=!1,dt&&(dt=!1,Le())}}async function Qs(){!It.value||de.value||await Le(!0)}async function lt(){if(pt.value){Ue.value=!0,De.value="";try{te.value=await ns()}catch(e){De.value=e instanceof Error?e.message:"Failed to load MCP servers"}finally{Ue.value=!1}}}async function Ht(){var e;if(!(!pt.value||!((e=F.value)!=null&&e.mcpServers.length)))try{te.value=await ns()}catch{}}function zt(e=!1){I.value==="plugins"&&ge(),I.value==="apps"&&xe(),I.value==="composio"&&Le(),I.value==="skills"&&(e&&bt.value?Xt():lt())}function Js(e){if(e==="app/list/updated"){xe();return}(e==="mcpServer/startupStatus/updated"||e==="mcpServer/oauthLogin/completed")&<()}R({refreshFromNotification:Js});async function Ys(){pe.value=!0;try{I.value==="plugins"?await ge():I.value==="apps"?await xe():I.value==="composio"?await Le():I.value==="skills"&&bt.value?await Xt():I.value==="skills"&&await lt()}finally{pe.value=!1}}async function Kt(e){C.value=e,F.value=null,Oe.value="",he.value=[],_e.value=!0,Ke.value=!0;try{F.value=await Ia(e),C.value=F.value.summary,Ze.value&&Q.value.length===0&&await xe(),await Ht()}catch(t){Oe.value=t instanceof Error?t.message:"Failed to load plugin"}finally{Ke.value=!1}}async function Vt(e){if(!_t.value)return!1;$e.value=e;try{const t=await La(e);return t.authorizationUrl?(ie(t.authorizationUrl),!0):(T(r("No login URL returned for {name}",{name:e}),"error"),!1)}catch(t){return T(t instanceof Error?t.message:r("Failed to start login for {name}",{name:e}),"error"),!1}finally{$e.value=""}}async function Zs(e){await Ht();const t=e.mcpServers.find(c=>Nt(c));t&&await Vt(t)}function gt(){_e.value=!1}function qt(){const e=C.value;return e?e.marketplacePath?`${e.marketplacePath.replace(/[\\/]+$/,"")}/${e.name}`:e.sourceUrl||"":""}async function Wt(){Ae.value="",ce.value=!0,ue.value=!0;try{G.value=await Ea()}catch(e){Ae.value=e instanceof Error?e.message:"Failed to load plugin shares"}finally{ue.value=!1}}async function Xs(){const e=qt();if(e){ae.value=!0,me.value="save";try{const t=await Ta(e);T(t.shareUrl?"Plugin shared":"Plugin shared (no URL returned)"),await Wt()}catch(t){Ae.value=t instanceof Error?t.message:"Failed to share plugin"}finally{ae.value=!1,me.value=""}}}async function ea(e){ae.value=!0,me.value=`delete:${e}`;try{await Ua(e),G.value=G.value.filter(t=>t.remotePluginId!==e),T("Share removed")}catch(t){Ae.value=t instanceof Error?t.message:"Failed to remove share"}finally{ae.value=!1,me.value=""}}async function ta(e){ae.value=!0,me.value=`checkout:${e}`;try{await Na(e),T("Plugin checked out")}catch(t){Ae.value=t instanceof Error?t.message:"Failed to checkout plugin"}finally{ae.value=!1,me.value=""}}function Qt(){ce.value=!1}async function Jt(e){ve.value=!0,Ve.value=!0,we.value="",$.value=null;try{$.value=await Fa(e)}catch(t){we.value=t instanceof Error?t.message:"Failed to load Composio connector"}finally{Ve.value=!1}}function Yt(){ve.value=!1}async function sa(e){var t;ye.value=e.slug;try{const c=await ja(e.slug);if(!c.redirectUrl){T(r("No login URL returned for {name}",{name:e.name}),"error");return}ie(c.redirectUrl),T(r("Opened {name} authorization",{name:e.name})),await Le(),ve.value&&((t=$.value)==null?void 0:t.connector.slug)===e.slug&&await Jt(e.slug)}catch(c){T(c instanceof Error?c.message:r("Failed to connect {name}",{name:e.name}),"error")}finally{ye.value=""}}async function Zt(e){var t;if(e.activeCount>0&&((t=_.value)!=null&&t.webUrl)){ie(_.value.webUrl);return}await sa(e)}async function aa(){Se.value=!0;const e=window.open("about:blank","_blank");e&&(e.opener=null);try{const t=await Ma();t.loginUrl&&e?e.location.href=t.loginUrl:t.loginUrl?ie(t.loginUrl):e==null||e.close(),T("Composio CLI login started")}catch(t){e==null||e.close(),T(t instanceof Error?t.message:"Failed to start Composio login","error")}finally{Se.value=!1}}async function la(){Ce.value=!0;try{await Da(),T("Composio CLI installed"),await Le()}catch(e){T(e instanceof Error?e.message:"Failed to install Composio CLI","error")}finally{Ce.value=!1}}async function oa(){if(C.value&&!vt.value){Z.value=!0;try{const e=await Oa(C.value);he.value=e.appsNeedingAuth,T(`${C.value.displayName} ${r("plugin installed")}`);const t=zs(e.appsNeedingAuth);await ge();const c=m.value.find(k=>{var H;return k.id===((H=C.value)==null?void 0:H.id)});c&&(await Kt(c),!t&&F.value&&await Zs(F.value))}catch(e){T(e instanceof Error?e.message:"Failed to install plugin","error")}finally{Z.value=!1}}}async function ia(){if(C.value){Z.value=!0;try{const e=C.value.displayName;await Ra(C.value.id),T(`${e} ${r("plugin uninstalled")}`),gt(),await ge()}catch(e){T(e instanceof Error?e.message:"Failed to uninstall plugin","error")}finally{Z.value=!1}}}async function na(){if(C.value){Z.value=!0;try{const e=!C.value.enabled;await xa(C.value.id,e),C.value={...C.value,enabled:e},F.value&&(F.value={...F.value,summary:{...F.value.summary,enabled:e}}),T(`${C.value.displayName} ${r("plugin")} ${r(e?"enabled":"disabled")}`),await ge()}catch(e){T(e instanceof Error?e.message:"Failed to update plugin","error")}finally{Z.value=!1}}}async function ra(e){Re.value=e.id;try{const t=!e.isEnabled;await Ga(e.id,t),Q.value=Q.value.map(c=>c.id===e.id?{...c,isEnabled:t}:c),T(`${e.name} ${r("app")} ${r(t?"enabled":"disabled")}`)}catch(t){T(t instanceof Error?t.message:"Failed to update app","error")}finally{Re.value=""}}async function Xt(){ze.value=!0;try{await Ba(),await lt(),T("MCP servers reloaded")}catch(e){T(e instanceof Error?e.message:"Failed to reload MCP servers","error")}finally{ze.value=!1}}function ca(e){const t=new Set(D.value);t.has(e)?t.delete(e):t.add(e),D.value=t}return Te(I,e=>{x.name==="skills"&&x.query.tab!==e&&V.replace({name:"skills",query:{...x.query,tab:e}}),zt()}),Te(()=>x.query.tab,()=>{if(x.name!=="skills")return;const e=le();I.value!==e&&(I.value=e)}),Te(ee,()=>{I.value==="composio"&&(N.value=[],j.value=null,J.value=0,We&&clearTimeout(We),We=setTimeout(()=>{Le()},250))}),Te(()=>M.cwd,()=>{I.value==="plugins"&&ge()}),Te(()=>M.threadId,()=>{(I.value==="apps"||I.value==="plugins")&&xe()}),ps(async()=>{await Vs(),zt()}),(e,t)=>{var c,k,H,ke,Ee,ot,es,ts,ss,as,ls;return a(),l("div",Co,[s("div",So,[s("div",null,[s("h2",$o,i(n(r)("Skills"))+" & "+i(n(r)("Apps")),1),s("p",Po,i(ys.value.subtitle),1)]),s("div",Ao,[s("button",{class:"directory-refresh",type:"button",disabled:pe.value,onClick:Ys},i(pe.value?"Refreshing...":"Refresh"),9,Io)])]),s("div",Lo,[(a(!0),l(O,null,z(B.value,o=>(a(),l("button",{key:o.id,class:K(["directory-tab",{"is-active":I.value===o.id}]),type:"button",role:"tab","aria-selected":I.value===o.id,onClick:A=>I.value=o.id},i(o.label),11,Eo))),128))]),Pe.value?(a(),l("div",{key:0,class:K(["directory-toast",{"is-error":Pe.value.type==="error"}])},i(Pe.value.text),3)):u("",!0),I.value==="plugins"?(a(),l("section",To,[s("div",Uo,[Je(s("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>ne.value=o),class:"directory-search",type:"search",placeholder:"Search plugins...","aria-label":"Search plugins"},null,512),[[Ye,ne.value]]),s("div",No,[s("button",{class:K(["directory-sort-button",{"is-active":se.value==="popular"}]),type:"button",onClick:t[1]||(t[1]=o=>se.value="popular")}," Popular ",2),s("button",{class:K(["directory-sort-button",{"is-active":se.value==="name"}]),type:"button",onClick:t[2]||(t[2]=o=>se.value="name")},i(n(r)("A-Z")),3),s("button",{class:K(["directory-sort-button",{"is-active":se.value==="date"}]),type:"button",onClick:t[3]||(t[3]=o=>se.value="date")}," Date ",2)])]),hs.value?(a(),l("div",Fo,[s("div",Mo,[t[22]||(t[22]=s("span",{class:"directory-marketplace-title"},"Marketplaces",-1)),s("button",{class:"directory-marketplace-upgrade",type:"button",disabled:h.value,onClick:Ws},i(p.value==="upgrade"?"Upgrading...":"Upgrade all"),9,Do)]),$t.value.length===0?(a(),l("div",Oo,"No marketplaces configured.")):(a(),l("div",Ro,[(a(!0),l(O,null,z($t.value,o=>(a(),l("div",{key:o.name,class:"directory-marketplace-row"},[s("span",xo,i(o.displayName),1),o.path?(a(),l("code",Go,i(o.path),1)):u("",!0),s("button",{class:"directory-marketplace-remove",type:"button",disabled:h.value,onClick:A=>qs(o.name)},i(p.value===`remove:${o.name}`?n(r)("Removing..."):n(r)("Remove")),9,Bo)]))),128))])),s("div",jo,[Je(s("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>y.value=o),class:"directory-marketplace-source",type:"url",placeholder:"Git URL to add a marketplace","aria-label":"Marketplace Git URL",onKeydown:ma(jt,["enter"])},null,544),[[Ye,y.value]]),s("button",{class:"directory-marketplace-add-button",type:"button",disabled:h.value||!y.value.trim(),onClick:jt},i(p.value==="add"?"Adding...":"Add"),9,Ho)])])):u("",!0),kt.value?Ne.value?(a(),l("div",Ko,i(Ne.value),1)):Y.value?(a(),l("div",Vo,"Loading plugins...")):St.value.length===0?(a(),l("div",qo,"No plugins found.")):(a(),l("div",Wo,[(a(!0),l(O,null,z(St.value,o=>(a(),l("button",{key:o.id,class:K(["directory-card",{"is-disabled":o.installed&&!o.enabled}]),type:"button",onClick:A=>Kt(o)},[s("div",Jo,[st(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:st(o),alt:o.displayName,loading:"lazy"},null,8,Yo)):(a(),l("div",{key:1,class:"directory-card-fallback",style:ga(Ks(o))},i(o.displayName.charAt(0)),5)),s("div",Zo,[s("div",Xo,[s("span",ei,i(o.displayName),1),o.installed&&!o.enabled?(a(),l("span",ti,i(n(r)("Disabled")),1)):o.installed?(a(),l("span",si,i(n(r)("Installed")),1)):u("",!0)]),s("span",ai,i(o.developerName||o.marketplaceDisplayName||o.marketplaceName||n(r)("Plugin")),1)])]),o.description?(a(),l("p",li,i(o.description),1)):u("",!0),s("div",oi,[o.category?(a(),l("span",ii,i(o.category),1)):u("",!0),(a(!0),l(O,null,z(o.capabilities.slice(0,2),A=>(a(),l("span",{key:A,class:"directory-chip"},i(A),1))),128))])],10,Qo))),128))])):(a(),l("div",zo," Plugin APIs unavailable in this Codex CLI. Update Codex CLI to use plugin catalog features. "))])):I.value==="apps"?(a(),l("section",ni,[s("div",ri,[Je(s("input",{"onUpdate:modelValue":t[5]||(t[5]=o=>re.value=o),class:"directory-search",type:"search",placeholder:"Search apps...","aria-label":"Search apps"},null,512),[[Ye,re.value]]),s("div",ci,[s("button",{class:K(["directory-sort-button",{"is-active":X.value==="popular"}]),type:"button",onClick:t[6]||(t[6]=o=>X.value="popular")}," Popular ",2),s("button",{class:K(["directory-sort-button",{"is-active":X.value==="name"}]),type:"button",onClick:t[7]||(t[7]=o=>X.value="name")},i(n(r)("A-Z")),3),s("button",{class:K(["directory-sort-button",{"is-active":X.value==="date"}]),type:"button",onClick:t[8]||(t[8]=o=>X.value="date")}," Date ",2)])]),Ze.value?Fe.value?(a(),l("div",di,i(Fe.value),1)):fe.value?(a(),l("div",pi,"Loading apps...")):Pt.value.length===0?(a(),l("div",vi,"No apps found.")):(a(),l("div",yi,[(a(!0),l(O,null,z(Pt.value,o=>(a(),l("article",{key:o.id,class:"directory-card"},[s("div",hi,[Ot(o)?(a(),l("img",{key:0,class:"directory-card-icon",src:Ot(o),alt:o.name,loading:"lazy"},null,8,mi)):(a(),l("div",gi,i(o.name.charAt(0)),1)),s("div",fi,[s("div",ki,[s("span",bi,i(o.name),1),o.isEnabled?o.isAccessible?(a(),l("span",wi,i(n(r)("Connected")),1)):u("",!0):(a(),l("span",_i,i(n(r)("Disabled")),1))]),s("span",Ci,i($s(o)),1)])]),o.description?(a(),l("p",Si,i(o.description),1)):u("",!0),s("div",$i,[o.category?(a(),l("span",Pi,i(o.category),1)):u("",!0),(a(!0),l(O,null,z(o.pluginDisplayNames.slice(0,2),A=>(a(),l("span",{key:A,class:"directory-chip"},i(A),1))),128))]),s("div",Ai,[s("button",{class:"directory-action",type:"button",disabled:Re.value===o.id,onClick:A=>ra(o)},i(o.isEnabled?"Disable":"Enable"),9,Ii),o.installUrl?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:A=>ie(o.installUrl)},i(o.isAccessible?"Manage":"Login"),9,Li)):u("",!0),o.isAccessible&&o.isEnabled?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:Ie.value,onClick:A=>Gs(o)},i(M.tryInFlightKey===xs(o)?"Starting...":"Try it!"),9,Ei)):u("",!0)])]))),128))])):(a(),l("div",ui," Apps APIs unavailable in this Codex CLI. Update Codex CLI to manage apps. "))])):I.value==="composio"?(a(),l("section",Ti,[s("div",Ui,[Je(s("input",{"onUpdate:modelValue":t[9]||(t[9]=o=>ee.value=o),class:"directory-search",type:"search",placeholder:"Search Composio connectors...","aria-label":"Search Composio connectors"},null,512),[[Ye,ee.value]]),s("div",Ni,[s("button",{class:K(["directory-sort-button",{"is-active":oe.value==="popular"}]),type:"button",onClick:t[10]||(t[10]=o=>oe.value="popular")}," Popular ",2),s("button",{class:K(["directory-sort-button",{"is-active":oe.value==="name"}]),type:"button",onClick:t[11]||(t[11]=o=>oe.value="name")},i(n(r)("A-Z")),3),s("button",{class:K(["directory-sort-button",{"is-active":oe.value==="date"}]),type:"button",onClick:t[12]||(t[12]=o=>oe.value="date")}," Date ",2)])]),Me.value?(a(),l("div",Fi,i(Me.value),1)):de.value?(a(),l("div",Mi,"Loading Composio connectors...")):(c=_.value)!=null&&c.available?_.value.authenticated?(a(),l("div",Xi,[s("article",en,[s("div",tn,[t[26]||(t[26]=s("div",{class:"directory-card-fallback composio-fallback"},"C",-1)),s("div",sn,[s("div",an,[s("span",ln,i(n(r)("Composio workspace")),1),s("span",on,i(n(r)("Connected")),1)]),s("span",nn,i(_.value.email||_.value.defaultOrgName||n(r)("Authenticated")),1)])]),s("p",rn,i(bs.value),1),s("div",cn,[_.value.defaultOrgName?(a(),l("span",un,i(_.value.defaultOrgName),1)):u("",!0),_.value.cliVersion?(a(),l("span",dn,"CLI "+i(_.value.cliVersion),1)):u("",!0),N.value.length?(a(),l("span",pn," Showing "+i(N.value.length)+i(J.value?` / ${J.value}`:"")+" connectors ",1)):u("",!0)]),s("div",vn,[s("button",{class:"directory-action-link",type:"button",onClick:t[14]||(t[14]=o=>ie(_.value.webUrl))}," Open dashboard ")])]),At.value.length===0?(a(),l("div",yn,"No Composio connectors found.")):(a(),l("div",hn,[(a(!0),l(O,null,z(At.value,o=>(a(),l("article",{key:o.slug,class:"directory-card"},[s("div",mn,[o.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:o.logoUrl,alt:o.name,loading:"lazy"},null,8,gn)):(a(),l("div",fn,i(o.name.charAt(0)),1)),s("div",kn,[s("div",bn,[s("span",_n,i(o.name),1),o.activeCount>0?(a(),l("span",wn,i(n(r)("Connected")),1)):o.isNoAuth?(a(),l("span",Cn,i(n(r)("No auth")),1)):u("",!0)]),s("span",Sn,i(Rt(o)),1)])]),o.description?(a(),l("p",$n,i(o.description),1)):u("",!0),s("div",Pn,[s("span",An,i(o.toolsCount)+" tools",1),o.triggersCount>0?(a(),l("span",In,i(o.triggersCount)+" triggers",1)):u("",!0),o.authModes.length>0?(a(),l("span",Ln,i(o.authModes.join(", ")),1)):u("",!0)]),s("div",En,[s("button",{class:"directory-action",type:"button",onClick:A=>Jt(o.slug)}," Details ",8,Tn),at(o)?(a(),l("button",{key:0,class:"directory-action-link",type:"button",disabled:ye.value===o.slug,onClick:A=>Zt(o)},i(ye.value===o.slug?"Opening...":at(o)),9,Un)):u("",!0),Gt(o)?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:Ie.value,onClick:A=>Bt(o)},i(M.tryInFlightKey===xt(o.slug)?"Starting...":"Try it!"),9,Nn)):u("",!0)])]))),128))])),It.value?(a(),l("div",Fn,[s("button",{class:"directory-action",type:"button",disabled:de.value,onClick:Qs},i(de.value?"Loading...":"Load more"),9,Mn)])):u("",!0)])):(a(),l("div",Gi,[s("article",Bi,[t[24]||(t[24]=fa('<div class="composio-preview-copy" data-v-e6af0e33><div class="directory-card-fallback composio-fallback" data-v-e6af0e33>C</div><div data-v-e6af0e33><p class="composio-preview-kicker" data-v-e6af0e33>Connector catalog preview</p><h3 class="composio-preview-title" data-v-e6af0e33>Connect everyday apps like Gmail, Calendar, Reddit, YouTube, and Drive.</h3><p class="composio-preview-text" data-v-e6af0e33> Composio is installed locally. Login to browse the live catalog, connect your accounts, and try simple actions from this machine. </p></div></div>',1)),s("div",ji,[s("button",{class:"directory-action primary",type:"button",disabled:Se.value,onClick:aa},i(Se.value?"Opening...":"Login to Composio"),9,Hi),s("button",{class:"directory-action-link",type:"button",onClick:t[13]||(t[13]=o=>ie(_.value.webUrl||"https://dashboard.composio.dev/"))}," Open dashboard ")])]),s("div",zi,[(a(!0),l(O,null,z(fs.value,o=>(a(),l("article",{key:o.slug,class:"directory-card composio-preview-card"},[s("div",Ki,[s("div",Vi,i(o.initial),1),s("div",qi,[s("div",Wi,[s("span",Qi,i(o.name),1),t[25]||(t[25]=s("span",{class:"directory-badge is-muted"},"Preview",-1))]),s("span",Ji,i(o.meta),1)])]),s("p",Yi,i(o.description),1),s("div",Zi,[(a(!0),l(O,null,z(o.chips,A=>(a(),l("span",{key:A,class:"directory-chip"},i(A),1))),128))])]))),128))])])):(a(),l("div",Di,[s("div",Oi,[t[23]||(t[23]=s("p",{class:"directory-empty-text"},"Composio CLI is not installed in this environment.",-1)),s("div",Ri,[s("button",{class:"directory-action primary",type:"button",disabled:Ce.value,onClick:la},i(Ce.value?"Installing...":"Install Composio"),9,xi)])])]))])):I.value==="skills"?(a(),l("section",Dn,[je(wo,{"try-in-flight-key":M.tryInFlightKey,onSkillsChanged:t[16]||(t[16]=o=>U("skills-changed")),onTryItem:t[17]||(t[17]=o=>U("try-item",o))},{"before-installed":ka(()=>[s("div",On,[s("button",{class:"skills-embedded-toggle",type:"button",onClick:t[15]||(t[15]=o=>be.value=!be.value)},[s("span",Rn,"MCPs("+i(yt.value.length)+")",1),s("span",{class:K(["skills-embedded-chevron",{"is-open":be.value}])},"›",2)]),be.value?(a(),l("div",xn,[pt.value?De.value?(a(),l("div",Bn,i(De.value),1)):Ue.value?(a(),l("div",jn,"Loading MCP servers...")):yt.value.length===0?(a(),l("div",Hn,"No MCP servers configured.")):(a(),l("div",zn,[(a(!0),l(O,null,z(yt.value,o=>(a(),l("article",{key:o.name},[s("button",{class:"mcp-skill-card skill-card",type:"button",onClick:A=>ca(o.name)},[s("div",Vn,[s("div",qn,i(o.name.charAt(0)),1),s("div",Wn,[s("div",Qn,[s("span",Jn,i(o.name),1),s("span",{class:K(["mcp-skill-badge",As(o.authStatus)])},i(Ut(o.name)),3)]),t[27]||(t[27]=s("span",{class:"mcp-skill-owner"},"mcp",-1))]),s("span",{class:K(["mcp-skill-chevron",{"is-open":D.value.has(o.name)}])},"›",2)]),s("p",Yn,i(o.tools.length)+" tools · "+i(o.resources.length+o.resourceTemplates.length)+" resources",1),D.value.has(o.name)?(a(),l("div",Zn,[o.tools.length>0?(a(),l("div",Xn,[t[28]||(t[28]=s("h3",{class:"directory-mini-heading"},"Tools",-1)),s("p",er,i(o.tools.map(A=>A.title||A.name).join(", ")),1)])):u("",!0),o.resources.length>0||o.resourceTemplates.length>0?(a(),l("div",tr,[t[29]||(t[29]=s("h3",{class:"directory-mini-heading"},"Resources",-1)),s("p",sr,i([...o.resources.map(A=>A.title||A.name||A.uri),...o.resourceTemplates.map(A=>A.title||A.name||A.uriTemplate)].join(", ")),1)])):u("",!0)])):u("",!0)],8,Kn)]))),128))])):(a(),l("div",Gn," MCP status APIs unavailable in this Codex CLI. Update Codex CLI to inspect MCP servers. "))])):u("",!0)])]),_:1},8,["try-in-flight-key"])])):u("",!0),(a(),He(it,{to:"body"},[_e.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Be(gt,["self"])},[s("article",ar,[s("div",lr,[s("div",or,[C.value&&st(C.value)?(a(),l("img",{key:0,class:"directory-card-icon",src:st(C.value),alt:C.value.displayName,loading:"lazy"},null,8,ir)):(a(),l("div",nr,i((k=C.value)==null?void 0:k.displayName.charAt(0)),1)),s("div",rr,[s("h3",cr,i(((H=C.value)==null?void 0:H.displayName)||n(r)("Plugin")),1),s("span",ur,i(((ke=C.value)==null?void 0:ke.developerName)||((Ee=C.value)==null?void 0:Ee.marketplaceDisplayName)||((ot=C.value)==null?void 0:ot.marketplaceName)),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin detail"),onClick:gt},i(n(r)("Close")),9,dr)]),s("div",pr,[Oe.value?(a(),l("div",vr,i(Oe.value),1)):Ke.value?(a(),l("div",yr,"Loading plugin...")):F.value?(a(),l(O,{key:2},[wt.value?(a(),l("p",hr,i(wt.value),1)):u("",!0),F.value.summary.capabilities.length>0?(a(),l("div",mr,[t[30]||(t[30]=s("h4",{class:"directory-detail-heading"},"Capabilities",-1)),s("div",gr,[(a(!0),l(O,null,z(F.value.summary.capabilities,o=>(a(),l("span",{key:o,class:"directory-chip"},i(o),1))),128))])])):u("",!0),s("div",fr,[F.value.apps.length>0?(a(),l("div",kr,[s("h4",br,i(n(r)("Apps")),1),(a(!0),l(O,null,z(F.value.apps,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,i(o.name),1),Et(o)?(a(),l("span",_r,"GPT Plus account required")):o.installUrl?(a(),l("button",{key:1,type:"button",onClick:A=>ie(o.installUrl)},i(o.needsAuth?"Login":"Manage"),9,wr)):u("",!0)]))),128))])):u("",!0),F.value.skills.length>0?(a(),l("div",Cr,[s("h4",Sr,i(n(r)("Skills")),1),s("p",$r,i(F.value.skills.map(o=>o.displayName||o.name).join(", ")),1)])):u("",!0),F.value.mcpServers.length>0?(a(),l("div",Pr,[t[31]||(t[31]=s("h4",{class:"directory-detail-heading"},"MCP servers",-1)),(a(!0),l(O,null,z(F.value.mcpServers,o=>(a(),l("div",{key:o,class:"directory-include-row"},[s("span",null,[nt(i(o)+" ",1),s("span",{class:K(["directory-auth-status",Ps(o)])},i(Ut(o)),3)]),Nt(o)?(a(),l("button",{key:0,type:"button",disabled:$e.value===o,onClick:A=>Vt(o)},i($e.value===o?"Opening...":"Authenticate"),9,Ar)):u("",!0)]))),128))])):u("",!0)]),Ct.value.length>0?(a(),l("div",Ir,[(a(!0),l(O,null,z(Ct.value,o=>(a(),l("img",{key:o,src:o,alt:"",loading:"lazy"},null,8,Lr))),128))])):u("",!0),he.value.length>0?(a(),l("div",Er,[s("strong",null,i(n(r)("Apps needing auth")),1),(a(!0),l(O,null,z(he.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=>ie(o.installUrl)},i(n(r)("Login")),9,Tr)):u("",!0)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",Ur,[C.value&&C.value.installed?(a(),l("button",{key:0,class:"directory-action danger",type:"button",disabled:Z.value,onClick:ia},i(Z.value?"Uninstalling...":"Uninstall"),9,Nr)):C.value&&!gs.value?(a(),l("button",{key:1,class:"directory-action primary",type:"button",disabled:Z.value||C.value.installPolicy==="NOT_AVAILABLE"||vt.value,onClick:oa},i(vt.value?"ChatGPT Plus":Z.value?"Installing...":"Install"),9,Fr)):C.value?(a(),l("button",Mr," GPT Plus account required ")):u("",!0),C.value&&C.value.installed?(a(),l("button",{key:3,class:"directory-action",type:"button",disabled:Z.value,onClick:na},i(C.value.enabled?"Disable":"Enable"),9,Dr)):u("",!0),C.value&&C.value.installed&&C.value.enabled?(a(),l("button",{key:4,class:"directory-action primary",type:"button",disabled:Z.value||Ie.value,onClick:t[18]||(t[18]=o=>js(C.value))},i(M.tryInFlightKey===Bs(C.value)?"Starting...":"Try it!"),9,Or)):u("",!0),ms.value&&C.value&&C.value.installed?(a(),l("button",{key:5,class:"directory-action",type:"button",onClick:Wt},i(n(r)("Share")),1)):u("",!0)])])])):u("",!0)])),(a(),He(it,{to:"body"},[ce.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Be(Qt,["self"])},[s("article",Rr,[s("div",xr,[s("div",Gr,[s("h3",Br,i(n(r)("Plugin shares")),1),s("span",jr,i(((es=C.value)==null?void 0:es.displayName)||n(r)("Plugin")),1)]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close plugin shares"),onClick:Qt},i(n(r)("Close")),9,Hr)]),s("div",zr,[Ae.value?(a(),l("div",Kr,i(Ae.value),1)):ue.value?(a(),l("div",Vr,"Loading shares...")):(a(),l(O,{key:2},[G.value.length===0?(a(),l("p",qr,"No shares yet. Share this plugin to make it available on other devices.")):(a(),l("div",Wr,[(a(!0),l(O,null,z(G.value,o=>(a(),l("div",{key:o.remotePluginId,class:"directory-share-row"},[s("div",Qr,[s("span",Jr,i(o.pluginName),1),o.shareUrl?(a(),l("a",{key:0,class:"directory-share-link",href:o.shareUrl,target:"_blank",rel:"noreferrer"},i(o.shareUrl),9,Yr)):u("",!0)]),s("button",{class:"directory-share-checkout",type:"button",disabled:ae.value,onClick:A=>ta(o.remotePluginId)},i(me.value===`checkout:${o.remotePluginId}`?n(r)("Checking out..."):n(r)("Checkout")),9,Zr),s("button",{class:"directory-share-delete",type:"button",disabled:ae.value,onClick:A=>ea(o.remotePluginId)},i(me.value===`delete:${o.remotePluginId}`?n(r)("Removing..."):n(r)("Remove")),9,Xr)]))),128))])),s("button",{class:"directory-action primary",type:"button",disabled:ae.value||!qt(),onClick:Xs},i(me.value==="save"?n(r)("Sharing..."):n(r)("Share this plugin")),9,ec)],64))])])])):u("",!0)])),(a(),He(it,{to:"body"},[ve.value?(a(),l("div",{key:0,class:"directory-modal-overlay",onClick:Be(Yt,["self"])},[s("article",tc,[s("div",sc,[s("div",ac,[(ts=$.value)!=null&&ts.connector.logoUrl?(a(),l("img",{key:0,class:"directory-card-icon",src:$.value.connector.logoUrl,alt:$.value.connector.name,loading:"lazy"},null,8,lc)):(a(),l("div",oc,i((ss=$.value)==null?void 0:ss.connector.name.charAt(0)),1)),s("div",ic,[s("h3",nc,i(((as=$.value)==null?void 0:as.connector.name)||"Composio"),1),s("span",rc,i($.value?Rt($.value.connector):n(r)("Connector")),1)])]),s("button",{class:"directory-modal-close",type:"button","aria-label":n(r)("Close Composio detail"),onClick:Yt},i(n(r)("Close")),9,cc)]),s("div",uc,[we.value?(a(),l("div",dc,i(we.value),1)):Ve.value?(a(),l("div",pc,"Loading connector...")):$.value?(a(),l(O,{key:2},[$.value.connector.description?(a(),l("p",vc,i($.value.connector.description),1)):u("",!0),s("div",yc,[s("div",hc,[t[32]||(t[32]=s("h4",{class:"directory-detail-heading"},"Overview",-1)),s("div",mc,[s("span",gc,i($.value.connector.toolsCount)+" tools",1),$.value.connector.triggersCount>0?(a(),l("span",fc,i($.value.connector.triggersCount)+" triggers",1)):u("",!0),$.value.connector.latestVersion?(a(),l("span",kc,"v"+i($.value.connector.latestVersion),1)):u("",!0),$.value.connector.authModes.length>0?(a(),l("span",bc,i($.value.connector.authModes.join(", ")),1)):u("",!0)])]),s("div",_c,[t[33]||(t[33]=s("h4",{class:"directory-detail-heading"},"Connections",-1)),$.value.connections.length===0?(a(),l("div",wc," No linked accounts yet. ")):(a(),l("div",Cc,[(a(!0),l(O,null,z($.value.connections,o=>(a(),l("div",{key:o.id,class:"directory-include-row"},[s("span",null,[nt(i(o.alias||o.wordId||o.id)+" ",1),s("span",{class:K(["directory-auth-status",Rs(o.status)])},i(Os(o.status)),3)]),s("span",Sc,i(o.authScheme||"Auth"),1)]))),128))]))])]),$.value.tools.length>0?(a(),l("div",$c,[t[34]||(t[34]=s("h4",{class:"directory-detail-heading"},"Useful tools",-1)),(a(!0),l(O,null,z($.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",Pc,i(o.slug),1)]))),128))])):u("",!0)],64)):u("",!0)]),s("div",Ac,[$.value?(a(),l("button",{key:0,class:"directory-action-link",type:"button",onClick:t[19]||(t[19]=o=>ie($.value.dashboardUrl))}," Open dashboard ")):u("",!0),$.value&&at($.value.connector)?(a(),l("button",{key:1,class:"directory-action",type:"button",disabled:ye.value===$.value.connector.slug,onClick:t[20]||(t[20]=o=>Zt($.value.connector))},i(ye.value===((ls=$.value)==null?void 0:ls.connector.slug)?"Opening...":at($.value.connector)),9,Ic)):u("",!0),$.value&&Gt($.value.connector)?(a(),l("button",{key:2,class:"directory-action primary",type:"button",disabled:Ie.value,onClick:t[21]||(t[21]=o=>Bt($.value.connector,$.value.connections))},i(M.tryInFlightKey===xt($.value.connector.slug)?"Starting...":"Try it!"),9,Lc)):u("",!0)])])])):u("",!0)]))])}}}),Mc=ut(Uc,[["__scopeId","data-v-e6af0e33"]]);export{Mc as default};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{d as ee,o as r,c as G,a as l,w as De,b as g,t as k,n as U,e as L,T as gs,_ as J,u as C,F as E,r as q,f as ue,g as Z,I as ps,h as Wo,i as Re,j as se,k as M,l as de,m as en,p as Ze,q as W,s as zt,v as vs,x as jo,y as be,z as qo,A as ks,B as No,C as ct,D as Ge,E as zo,G as Uo,H as Vo,J as Ko,K as Jn,L as Go,M as Zo}from"./index-CZP3HKY9.js";import{s as Dt}from"./sanitizeHtml-Bd3No2dT.js";function Jo(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("/"),s=/^[A-Za-z]:[\\/]/u.test(e),i=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return n||s||i||/^[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 ft(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function We(e){return e.replace(/\\/gu,"/")}function ys(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 Xo(e){const n=We(e),s=n.match(/^\/Users\/([^/]+)/u);if(s)return`/Users/${s[1]}`;const i=n.match(/^\/home\/([^/]+)/u);return i?`/home/${i[1]}`:""}function Oe(e){const n=We(e);if(!n)return n;let s="",i=n;const a=i.match(/^([A-Za-z]:)(\/.*)?$/u);a?(s=`${a[1]}/`,i=(a[2]??"").replace(/^\/+/u,"")):i.startsWith("/")&&(s="/",i=i.slice(1));const d=i.split("/").filter(Boolean),c=[];for(const h of d)if(h!=="."){if(h===".."){c.length>0&&c.pop();continue}c.push(h)}const u=c.join("/");return s?`${s}${u}`.replace(/\/+$/u,"")||s:u||n}function bs(e,n){const s=We(ys(e.trim()));if(!s)return"";if(s.startsWith("/")||/^[A-Za-z]:\//u.test(s))return Oe(s);if(s.startsWith("~/")){const d=Xo(n);if(d)return Oe(`${d}/${s.slice(2)}`)}const a=We(n.trim());return Oe(a?`${a.replace(/\/+$/u,"")}/${s}`:s)}function ht(e){let n=e,s="",i="";const a={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;n.length>0;){const d=n[0],c=Object.prototype.hasOwnProperty.call(a,d)?a[d]:"";if(!c||!n.endsWith(c))break;s+=d,i+=c,n=n.slice(1,-1)}return{core:n,leading:s,trailing:i}}function Je(e){if(!e)return null;let n=e.trim();n=ht(n).core.trim();let i=null;const a=n.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(a)n=a[1],i=Number(a[2]);else{const d=n.match(/^(.*):(\d+)(?::\d+)?$/u);d&&(n=d[1],i=Number(d[2]))}return n=ys(n),Jo(n)?{path:n,line:i}:null}function Xn(e,n,s){let i=0,a=n-1;for(;a>=s&&e[a]==="*";)i+=1,a-=1;return i}function Yo(e,n){let s=0,i=n;for(;i<e.length&&e[i]==="*";)s+=1,i+=1;return s}function ws(e,n,s,i,a){const d=Xn(e,n,i);return d<2?null:Yo(e,s)>=d?{segmentStart:n-d,segmentEnd:s+d,tokenEndTrim:0}:Xn(a,a.length,0)>=d?{segmentStart:n-d,segmentEnd:s,tokenEndTrim:d}:null}function Ut(e){const n=e.trim();if(!n.startsWith("[")||!n.endsWith(")"))return null;const s=n.indexOf("]");if(s<=1||n[s+1]!=="(")return null;const i=n.slice(1,s).trim(),a=n.slice(s+2,-1).trim();if(i.includes(`
|
|
2
|
-
`)||a.includes(`
|
|
3
|
-
`))return null;const d=ht(i).core.trim()||i,c=ht(a).core.trim();return c?{label:d,target:c}:null}function mt(e){const n=e.trim().match(/^codex:\/\/threads\/([A-Za-z0-9-]+)$/u);if(!n)return null;if(typeof window>"u")return`/#/thread/${n[1]}`;const s=window.location.pathname.replace(/\/?$/u,"/");return`${window.location.origin}${s}#/thread/${n[1]}`}function Yn(e){const n=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(n)}`}function Qn(e){switch(Math.min(6,Math.max(1,Math.trunc(e)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}function Qo(e){const n=e.trim();if(!n)return"";if(n.startsWith("data:")||n.startsWith("blob:")||n.startsWith("http://")||n.startsWith("https://")||n.startsWith("/codex-local-image?"))return n;if(n.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(n)}`;const s=n.startsWith("/"),i=/^[A-Za-z]:[\\/]/u.test(n);return s||i?`/codex-local-image?path=${encodeURIComponent(n)}`:n}function He(e,n={}){const s=[],i=/codex:\/\/threads\/[A-Za-z0-9-]+|https?:\/\/[^\s<>"'`,。;:!?、()[\]{}「」『』《》]+|file:\/\/[^\n<>"'`,。;:!?、[\]{}「」『』《》]+|["'](?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^\n"']+["']|`(?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^`\n]+`/gu;let a=0;for(const d of e.matchAll(i)){if(typeof d.index!="number")continue;const c=d.index,u=c+d[0].length;let h=d[0],m="";for(;/[.,;:!?,。;:!?、]$/u.test(h);)m=h.slice(-1)+m,h=h.slice(0,-1);const y=ws(e,c,u,a,h),I=(y==null?void 0:y.segmentStart)??c,F=(y==null?void 0:y.segmentEnd)??u;I>a&&s.push({kind:"text",value:e.slice(a,I)}),y!=null&&y.tokenEndTrim&&(h=h.slice(0,-y.tokenEndTrim));const T=ht(h);h=T.core;const P=T.leading,w=T.trailing+m;P&&s.push({kind:"text",value:P});const B=mt(h);if(B)s.push({kind:"url",value:B,href:B}),w&&s.push({kind:"text",value:w});else if(h.startsWith("**")&&h.endsWith("**")&&h.length>4)s.push({kind:"bold",value:h.slice(2,-2)}),w&&s.push({kind:"text",value:w});else if(/^https?:\/\//u.test(h))s.push({kind:"url",value:h,href:h}),w&&s.push({kind:"text",value:w});else{const O=Je(h);O?(s.push({kind:"file",value:h,path:O.path,displayPath:h,downloadName:ft(O.path)}),w&&s.push({kind:"text",value:w})):s.push({kind:"text",value:d[0]})}a=F}return a<e.length&&s.push({kind:"text",value:e.slice(a)}),n.applyMarkdownMarkers===!1?s:$s(s)}function Wt(e,n){const s=[];let i=!1,a="";const d=c=>{c&&s.push({kind:"text",value:c})};for(const c of e){if(c.kind!=="text"){i&&(d(`${n.marker}${a}`),i=!1,a=""),s.push(c);continue}let u=c.value;for(;u.length>0;){const h=u.indexOf(n.marker);if(h<0){i?a+=u:d(u);break}const m=u.slice(0,h);if(i?a+=m:d(m),u=u.slice(h+n.marker.length),i){const y=a;y.length>0&&(!n.isValidContent||n.isValidContent(y))?s.push({kind:n.kind,value:y}):d(`${n.marker}${y}${n.marker}`),a="",i=!1}else i=!0}}return i&&d(`${n.marker}${a}`),s}function $s(e){const n=i=>i.trim().length>0&&!/^\s/u.test(i)&&!/\s$/u.test(i);let s=Wt(e,{marker:"**",kind:"bold",isValidContent:n});return s=Wt(s,{marker:"~~",kind:"strikethrough",isValidContent:n}),s=Wt(s,{marker:"*",kind:"italic",isValidContent:n}),s}function ea(e,n={}){const s=[];let i=0,a=0;const d=(c,u)=>{let h=c.indexOf("[",u);for(;h>=0;){const m=c.indexOf("]",h+1);if(m<0)return null;if(c[m+1]!=="("){h=c.indexOf("[",h+1);continue}let y=1,I=m+2,F=!1;for(;I<c.length;){const T=c[I];if(T===`
|
|
4
|
-
`){F=!0;break}if(T==="("&&(y+=1),T===")"&&(y-=1,y===0)){const P=c.slice(h,I+1);if(Ut(P))return{start:h,end:I+1,token:P};break}I+=1}if(F){h=c.indexOf("[",h+1);continue}h=c.indexOf("[",h+1)}return null};for(;a<e.length;){const c=d(e,a);if(!c)break;const{start:u,end:h,token:m}=c,y=ws(e,u,h,i,m),I=(y==null?void 0:y.segmentStart)??u,F=(y==null?void 0:y.segmentEnd)??h;I>i&&s.push(...He(e.slice(i,I),n));const T=Ut(m);if(!T){s.push(...He(e.slice(I,F),n)),i=F,a=F;continue}const P=T.label,w=T.target,B=mt(w);if(B)s.push({kind:"url",value:P||B,href:B});else if(/^https?:\/\//u.test(w))s.push({kind:"url",value:P||w,href:w});else{const O=Je(w);O?s.push({kind:"file",value:w,path:O.path,displayPath:P||w,downloadName:ft(O.path)}):s.push({kind:"text",value:m})}i=F,a=F}return i<e.length&&s.push(...He(e.slice(i),n)),s}function ta(e){const n=e.includes("`"),s=ea(e,{applyMarkdownMarkers:!n});if(!n)return s;if(!s.some(a=>a.kind==="text"&&a.value.includes("`")))return $s(s);const i=a=>{if(!a.includes("`"))return He(a);const d=[];let c=0,u=0;for(;c<a.length;){if(a[c]!=="`"){c+=1;continue}let h=1;for(;c+h<a.length&&a[c+h]==="`";)h+=1;const m="`".repeat(h);let y=c+h,I=-1;for(;y<a.length;){const T=a.indexOf(m,y);if(T<0)break;const P=T>0&&a[T-1]==="`",w=T+h<a.length&&a[T+h]==="`",B=a.slice(c+h,T).includes(`
|
|
5
|
-
`);if(!P&&!w&&!B){I=T;break}y=T+1}if(I<0){c+=h;continue}c>u&&d.push(...He(a.slice(u,c)));const F=a.slice(c+h,I);if(F.length>0){const T=Ut(F);if(T){const P=mt(T.target);if(P)d.push({kind:"url",value:T.label||P,href:P});else if(/^https?:\/\//u.test(T.target))d.push({kind:"url",value:T.label||T.target,href:T.target});else{const w=Je(T.target);w?d.push({kind:"file",value:T.target,path:w.path,displayPath:T.label||T.target,downloadName:ft(w.path)}):d.push({kind:"code",value:F})}}else{const P=mt(F);if(P)d.push({kind:"url",value:P,href:P});else if(/^https?:\/\/[^\s]+$/u.test(F))d.push({kind:"url",value:F,href:F});else{const w=Je(F);if(w){const B=w.line?`${w.path}:${String(w.line)}`:w.path;d.push({kind:"file",value:F,path:w.path,displayPath:B,downloadName:ft(w.path)})}else d.push({kind:"code",value:F})}}}else d.push({kind:"text",value:`${m}${m}`});c=I+h,u=c}return u<a.length&&d.push(...He(a.slice(u))),d};return s.flatMap(a=>a.kind==="text"?i(a.value):[a])}function xs(e){return e.replace(/\r\n/gu,`
|
|
6
|
-
`)}function me(e){var s;return(((s=e.match(/^\s*/u))==null?void 0:s[0])??"").replace(/\t/gu," ").length}function _s(e,n){if(n<=0)return e.trimStart();let s=0,i=0;for(;s<e.length&&i<n;){const a=e[s];i+=a===" "?4:1,s+=1}return e.slice(s)}function ge(e){return e.trim().length===0}function Vt(e){const n=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return n?{level:n[1].length,value:n[2].trim()}:null}function ut(e){const n=e.match(/^\s{0,3}>\s?(.*)$/u);return n?n[1]??"":null}function Xe(e){var s;const n=e.match(/^\s*[-*+]\s+(.+)$/u);return((s=n==null?void 0:n[1])==null?void 0:s.trim())??null}function na(e){var s;const n=e.match(/^(\s*)[-*+]\s+(.+)$/u);return n?{indent:me(n[1]??""),text:((s=n[2])==null?void 0:s.trim())??""}:null}function Ye(e){var s;const n=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{checked:(n[1]??" ").toLowerCase()==="x",text:((s=n[2])==null?void 0:s.trim())??""}:null}function es(e){var s;const n=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{indent:me(n[1]??""),item:{checked:(n[2]??" ").toLowerCase()==="x",text:((s=n[3])==null?void 0:s.trim())??""}}:null}function Cs(e){var s;const n=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return n?{indent:me(n[1]??""),start:Number.parseInt(n[2]??"1",10)||1,text:((s=n[3])==null?void 0:s.trim())??""}:null}function Kt(e){var n;return((n=Cs(e))==null?void 0:n.text)??null}function ts(e){return Cs(e)}function Gt(e){const n=e.trim();if(!n.includes("|"))return null;let s=n;s.startsWith("|")&&(s=s.slice(1)),s.endsWith("|")&&(s=s.slice(0,-1));const i=[];let a="",d=0;for(let c=0;c<s.length;c+=1){const u=s[c];if(u==="\\"&&s[c+1]==="|"){a+="|",c+=1;continue}if(u==="`"){let h=1;for(;s[c+h]==="`";)h+=1;a+=s.slice(c,c+h),d===0?d=h:d===h&&(d=0),c+=h-1;continue}if(u==="|"&&d===0){i.push(a.trim()),a="";continue}a+=u}return i.push(a.trim()),i.some(c=>c.length>0)?i:null}function sa(e){const n=Gt(e);if(!n||n.length===0)return null;const s=n.map(i=>{const a=i.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(a))return null;const d=a.startsWith(":"),c=a.endsWith(":");return d&&c?"center":c?"right":d?"left":null});return s.every((i,a)=>i!==null||/^-+$/u.test(n[a].replace(/\s+/gu,"")))?s:null}function ns(e,n){return e.length===n?e:e.length>n?e.slice(0,n):[...e,...Array.from({length:n-e.length},()=>"")]}function ss(e,n){var y;if(n+1>=e.length)return null;const s=e[n],i=e[n+1],a=Gt(s),d=sa(i);if(!a||!d||a.length!==d.length)return null;const c=s.trim();if(!c.startsWith("|")&&(((y=c.match(/\|/gu))==null?void 0:y.length)??0)<2)return null;const u=a.length,h=[];let m=n+2;for(;m<e.length&&!ge(e[m]);){const I=Gt(e[m]);if(!I)break;h.push(ns(I,u)),m+=1}return{kind:"table",headers:ns(a,u),rows:h,alignments:d}}function oa(e){return ge(e)||gt(e)!==null||Zt(e)||Vt(e)!==null||ut(e)!==null||Ye(e)!==null||Xe(e)!==null||Kt(e)!==null}function aa(e,n,s=-1){const i=[];let a=n;for(;a<e.length&&!(oa(e[a])||s>=0&&me(e[a])<=s);)i.push(s>=0?_s(e[a],s+1):e[a]),a+=1;const d=i.join(`
|
|
7
|
-
`).trim();return d?{value:d,nextIndex:a}:null}function Ts(e,n){for(let s=n;s<e.length;s+=1)if(!ge(e[s]))return s;return-1}function ia(e,n,s,i=null,a=!1){const d=[];let c=n;for(;c<e.length;){const u=e[c];if(ge(u)){const I=Ts(e,c+1);if(I===-1){d.push(""),c=e.length;break}const F=i==null?void 0:i(e[I]);if(F&&F.indent===s||me(e[I])<=s)break;d.push(""),c+=1;continue}const h=i==null?void 0:i(u);if(h&&h.indent===s)break;const m=me(u),y=a&&(Ye(u)!==null||Xe(u)!==null);if(m<=s&&!y)break;d.push(m>s?_s(u,s+1):u.trimStart()),c+=1}for(;d.length>0&&ge(d[0]);)d.shift();for(;d.length>0&&ge(d[d.length-1]);)d.pop();return d.length===0?null:{blocks:dt(d.join(`
|
|
8
|
-
`)),nextIndex:c}}function os(e,n,s,i=!1){const a=[];let d=n;const c=s(e[n]);if(!c)return null;const u=c.indent;for(;d<e.length;){const h=s(e[d]);if(h===null||h.indent!==u)break;const m=[h.text],y=[];for(d+=1;d<e.length;){if(ge(e[d])){const w=Ts(e,d+1);if(w===-1){d=e.length;break}const B=s(e[w]);if(B&&B.indent===u){d=w;break}if(me(e[w])<=u){d=w;break}d+=1;continue}const I=s(e[d]);if(I&&I.indent===u)break;const F=me(e[d])>u,T=i&&(Ye(e[d])!==null||Xe(e[d])!==null);if(F||T){const w=ia(e,d,u,s,i);if(w){y.push(...w.blocks),d=w.nextIndex;continue}}if(me(e[d])<=u)break;const P=aa(e,d,u);if(!P)break;m.push(P.value),d=P.nextIndex}a.push(y.length>0?{paragraphs:m,children:y}:{paragraphs:m})}return a.length>0?{items:a,nextIndex:d}:null}function Zt(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function gt(e){const n=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return n?{marker:n[1],language:(n[2]??"").trim()}:null}function dt(e){var d;const s=xs(e).split(`
|
|
9
|
-
`),i=[];let a=0;for(;a<s.length;){if(ge(s[a])){a+=1;continue}const c=gt(s[a]);if(c){a+=1;const w=[];for(;a<s.length;){if(s[a].trim()===c.marker){a+=1;break}w.push(s[a]),a+=1}i.push({kind:"codeBlock",language:c.language,value:w.join(`
|
|
10
|
-
`)});continue}if(Zt(s[a])){i.push({kind:"thematicBreak"}),a+=1;continue}const u=Vt(s[a]);if(u){i.push({kind:"heading",level:u.level,value:u.value}),a+=1;continue}if(ut(s[a])!==null){const w=[];for(;a<s.length;){const B=ut(s[a]);if(B===null)break;w.push(B),a+=1}i.push({kind:"blockquote",value:w.join(`
|
|
11
|
-
`).trim()});continue}const m=ss(s,a);if(m){i.push(m),a+=2+m.rows.length;continue}if(Ye(s[a])!==null){const w=[],B=((d=es(s[a]))==null?void 0:d.indent)??0;for(;a<s.length;){const O=es(s[a]);if(O===null||O.indent!==B)break;w.push(O.item),a+=1}if(w.length>0){i.push({kind:"taskList",items:w});continue}}const I=Xe(s[a]);if(I!==null){const w=os(s,a,na);if(w){i.push({kind:"unorderedList",items:w.items}),a=w.nextIndex;continue}if(I.length>0){i.push({kind:"unorderedList",items:[{paragraphs:[I]}]}),a+=1;continue}}const F=Kt(s[a]);if(F!==null){const w=ts(s[a]),B=os(s,a,ts,!0);if(B){i.push({kind:"orderedList",items:B.items,start:(w==null?void 0:w.start)??1}),a=B.nextIndex;continue}if(F.length>0){i.push({kind:"orderedList",items:[{paragraphs:[F]}],start:(w==null?void 0:w.start)??1}),a+=1;continue}}const T=[];for(;a<s.length&&!(ge(s[a])||gt(s[a])||Zt(s[a])||Vt(s[a])||ss(s,a)||ut(s[a])!==null||Ye(s[a])!==null||Xe(s[a])!==null||Kt(s[a])!==null);)T.push(s[a]),a+=1;const P=T.join(`
|
|
12
|
-
`).trim();P&&i.push({kind:"paragraph",value:P})}return i}function ra(e){if(!e.includes(")return dt(e);const n=[],s=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let i=0;for(const a of e.matchAll(s)){const[d,c,u]=a;if(typeof a.index!="number")continue;const h=a.index,m=h+d.length,y=Qo(u.trim());y&&(h>i&&n.push(...dt(e.slice(i,h))),n.push({kind:"image",url:y,alt:c.trim(),markdown:d}),i=m)}return i<e.length&&n.push(...dt(e.slice(i))),n}function as(e){const s=xs(e).split(`
|
|
13
|
-
`),i=[];let a=0,d=0;const c=u=>{if(u<=d)return;const h=s.slice(d,u).join(`
|
|
14
|
-
`);i.push(...ra(h))};for(;a<s.length;){const u=gt(s[a]);if(!u){a+=1;continue}c(a),a+=1;const h=[];for(;a<s.length;){if(s[a].trim()===u.marker){a+=1;break}h.push(s[a]),a+=1}i.push({kind:"codeBlock",language:u.language,value:h.join(`
|
|
15
|
-
`)}),d=a}return c(s.length),i.length>0?i:[{kind:"paragraph",value:e}]}const Ls={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"};function Q(e){return`${e.path}\0${e.movedToPath??""}`}function la(e,n){return e?!n||e===n?e:`${e}
|
|
16
|
-
${n}`.trim():n}function ca(e,n){const s=e.operation==="add"||n.operation==="add"?"add":e.operation==="delete"||n.operation==="delete"?"delete":"update";return{path:n.path||e.path,operation:s,movedToPath:n.movedToPath??e.movedToPath??null,diff:la(e.diff,n.diff),addedLineCount:e.addedLineCount+n.addedLineCount,removedLineCount:e.removedLineCount+n.removedLineCount}}function ua(e,n){const s=e.operation==="add"?0:e.operation==="update"?1:2,i=n.operation==="add"?0:n.operation==="update"?1:2;if(s!==i)return s-i;const a=`${e.path}\0${e.movedToPath??""}`,d=`${n.path}\0${n.movedToPath??""}`;return a.localeCompare(d)}function jt(e){const n=new Map;for(const s of e){const i=`${s.path}\0${s.movedToPath??""}`,a=n.get(i);n.set(i,a?ca(a,s):{...s})}return Array.from(n.values()).sort(ua)}function tn(e,n){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?n("Moved + edited"):n("Moved"):e.operation==="add"?n("Added"):e.operation==="delete"?n("Deleted"):n("Edited")}function da(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Jt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function Le(e){const n=[];return e.addedLineCount>0&&n.push(`+${e.addedLineCount}`),e.removedLineCount>0&&n.push(`-${e.removedLineCount}`),n.join(" ")}function Is(e,n,s=""){const i=[];return e>0&&i.push({tone:"add",label:`+${e}`}),n>0&&i.push({tone:"remove",label:`-${n}`}),i.length>0?i:s?[{tone:"neutral",label:s}]:[]}function fa(e){return Is(e.addedLineCount,e.removedLineCount)}function Ms(e,n){return e===1?`1 ${n("file changed")}`:`${e} ${n("files changed")}`}function ha(e,n){if(!e||e.changes.length===0)return"";let s=0,i=0,a=0,d=0;for(const u of e.changes){if(u.operation==="add"){s+=1;continue}if(u.operation==="delete"){i+=1;continue}if(u.movedToPath){d+=1;continue}a+=1}const c=[];return a>0&&c.push(`${a} ${n("edited")}`),s>0&&c.push(`${s} ${n("added")}`),i>0&&c.push(`${i} ${n("deleted")}`),d>0&&c.push(`${d} ${n("moved")}`),c.join(", ")}function ma(e,n){if(!e||e.changes.length===0)return n("Modified files");const s=Ms(e.changes.length,n),i=ha(e,n);return i?`${s} · ${i}`:s}function ga(e){if(!e||e.changes.length===0)return[];const n=e.changes.reduce((a,d)=>a+d.addedLineCount,0),s=e.changes.reduce((a,d)=>a+d.removedLineCount,0),i=e.changes.some(a=>a.movedToPath)?"Moved":"Ready";return Is(n,s,i)}function je(e,n){const s=bs(e,n),i=Oe(We(n.trim())),a=Oe(We(s));return i&&a.startsWith(`${i}/`)?a.slice(i.length+1):e}function pa(e,n,s){if(!e||e.changes.length===0)return"";const i=e.changes.map(a=>{const d=je(a.path,n),c=a.movedToPath?` -> ${je(a.movedToPath,n)}`:"",u=Le(a);return`- ${tn(a,s)}: ${d}${c}${u?` (${u})`:""}`});return`${s("Modified files")}:
|
|
17
|
-
${i.join(`
|
|
18
|
-
`)}`.trim()}function va(e){var i;const s=((i=(e.movedToPath||e.path).split(".").pop())==null?void 0:i.toLowerCase())??"";return Ls[s]??s??""}function ka(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function ya(e){const n=e.diff.replace(/\r\n/g,`
|
|
19
|
-
`),s=n.length>0?n.split(`
|
|
20
|
-
`):[];return s.length>0&&s[s.length-1]===""&&s.pop(),s.map((i,a)=>({key:`${Q(e)}:synthetic:${a}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?a+1:null,newLine:e.operation==="delete"?null:a+1,text:i}))}function ba(e){const n=e.diff.replace(/\r\n/g,`
|
|
21
|
-
`),s=n.length>0?n.split(`
|
|
22
|
-
`):[];s.length>0&&s[s.length-1]===""&&s.pop();const i=[];let a=0,d=0;for(const[c,u]of s.entries()){const h=u.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(h){a=Number(h[1]),d=Number(h[2]),i.push({key:`${Q(e)}:hunk:${c}`,kind:"hunk",oldLine:null,newLine:null,text:u});continue}if(u.startsWith("+")&&!u.startsWith("+++")){i.push({key:`${Q(e)}:add:${c}`,kind:"add",oldLine:null,newLine:d,text:u.slice(1)}),d+=1;continue}if(u.startsWith("-")&&!u.startsWith("---")){i.push({key:`${Q(e)}:remove:${c}`,kind:"remove",oldLine:a,newLine:null,text:u.slice(1)}),a+=1;continue}if(u.startsWith(" ")){i.push({key:`${Q(e)}:context:${c}`,kind:"context",oldLine:a,newLine:d,text:u.slice(1)}),a+=1,d+=1;continue}i.push({key:`${Q(e)}:meta:${c}`,kind:"meta",oldLine:null,newLine:null,text:u})}return i}function wa(e){return!e||!e.diff.trim()?[]:ka(e)?ba(e):ya(e)}function $a(e){return!!(e!=null&&e.diff.trim())}function xa(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}const _a=["aria-label"],Ca={class:"confirm-dialog-title"},Ta={class:"confirm-dialog-message"},La={class:"confirm-dialog-actions"},Ia=ee({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(n,s)=>(r(),G(gs,{to:"body"},[e.visible?(r(),l("div",{key:0,class:"confirm-dialog-overlay",onClick:s[2]||(s[2]=De(i=>n.$emit("cancel"),["self"]))},[g("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[g("h3",Ca,k(e.title),1),g("p",Ta,k(e.message),1),g("div",La,[g("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:s[0]||(s[0]=i=>n.$emit("cancel"))},k(e.cancelLabel||"Cancel"),1),g("button",{class:U(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:s[1]||(s[1]=i=>n.$emit("confirm"))},k(e.confirmLabel||"Confirm"),3)])],8,_a)])):L("",!0)]))}}),Ma=J(Ia,[["__scopeId","data-v-de94025d"]]),Sa={key:0,class:"diff-viewer-sidebar"},Pa={class:"diff-viewer-sidebar-header"},Aa={class:"diff-viewer-sidebar-title"},Ea={class:"diff-viewer-sidebar-count"},Fa={class:"diff-viewer-sidebar-list"},Ba=["data-active","onClick"],Ra=["data-operation"],Oa={class:"diff-viewer-file-label"},Ha={key:0,class:"diff-viewer-file-delta"},Da={class:"diff-viewer-main"},Wa={class:"diff-viewer-toolbar"},ja={class:"diff-viewer-title-wrap"},qa={class:"diff-viewer-title"},Na={class:"diff-viewer-subtitle"},za={key:0},Ua={class:"diff-viewer-toolbar-actions"},Va=["aria-label"],Ka={key:0,class:"diff-viewer-empty"},Ga={class:"diff-viewer-empty-title"},Za={class:"diff-viewer-empty-text"},Ja={key:1,class:"diff-viewer-panel"},Xa={class:"diff-viewer-meta"},Ya={class:"diff-viewer-language"},Qa={class:"diff-viewer-lines"},ei=["data-kind"],ti={class:"diff-viewer-line-number"},ni={class:"diff-viewer-line-number"},si={class:"diff-viewer-line-marker"},oi=["innerHTML"],ai={class:"diff-viewer-mobile-sheet-header"},ii={class:"diff-viewer-sidebar-title"},ri={class:"diff-viewer-sidebar-count"},li={class:"diff-viewer-mobile-sheet-list"},ci=["data-active","onClick"],ui=["data-operation"],di={class:"diff-viewer-file-label"},fi={key:0,class:"diff-viewer-file-delta"},hi=ee({__name:"DiffViewer",props:{change:{},changes:{},lines:{},isMobile:{type:Boolean},isFileListOpen:{type:Boolean},cwd:{}},emits:["close","select-change","toggle-file-list","close-file-list"],setup(e){const n=e,{t:s}=se();function i(u){return u.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}const a=M(()=>u=>tn(u,s)),d=M(()=>u=>Ms(u,s)),c=M(()=>u=>je(u,n.cwd));return(u,h)=>(r(),G(gs,{to:"body"},[e.change?(r(),l("div",{key:0,class:"diff-viewer-backdrop",onClick:h[5]||(h[5]=m=>u.$emit("close"))},[g("div",{class:"diff-viewer-shell",onClick:h[4]||(h[4]=De(()=>{},["stop"]))},[e.isMobile?L("",!0):(r(),l("aside",Sa,[g("div",Pa,[g("p",Aa,k(C(s)("Changed files")),1),g("p",Ea,k(d.value(e.changes.length)),1)]),g("div",Fa,[(r(!0),l(E,null,q(e.changes,m=>(r(),l("button",{key:`diff-viewer:${C(Q)(m)}`,type:"button",class:"diff-viewer-file-button","data-active":C(Q)(m)===C(Q)(e.change),onClick:y=>u.$emit("select-change",m)},[g("span",{class:"file-change-badge","data-operation":C(Jt)(m)},k(a.value(m)),9,Ra),g("span",Oa,[ue(k(c.value(m.path))+" ",1),m.movedToPath?(r(),l(E,{key:0},[ue(" → "+k(c.value(m.movedToPath)),1)],64)):L("",!0)]),C(Le)(m)?(r(),l("span",Ha,k(C(Le)(m)),1)):L("",!0)],8,Ba))),128))])])),g("section",Da,[g("div",Wa,[g("div",ja,[g("p",qa,[ue(k(c.value(e.change.path))+" ",1),e.change.movedToPath?(r(),l(E,{key:0},[ue(" → "+k(c.value(e.change.movedToPath)),1)],64)):L("",!0)]),g("p",Na,[ue(k(a.value(e.change))+" ",1),C(Le)(e.change)?(r(),l("span",za," · "+k(C(Le)(e.change)),1)):L("",!0)])]),g("div",Ua,[e.isMobile?(r(),l("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:h[0]||(h[0]=m=>u.$emit("toggle-file-list"))},k(d.value(e.changes.length)),1)):L("",!0),g("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":C(s)("Close diff viewer"),onClick:h[1]||(h[1]=m=>u.$emit("close"))},[Z(ps,{class:"icon-svg"})],8,Va)])]),C($a)(e.change)?(r(),l("div",Ja,[g("div",Xa,[g("span",Ya,k(C(va)(e.change)||"diff"),1)]),g("div",Qa,[(r(!0),l(E,null,q(e.lines,m=>(r(),l("div",{key:m.key,class:"diff-viewer-line","data-kind":m.kind},[g("span",ti,k(m.oldLine??""),1),g("span",ni,k(m.newLine??""),1),g("span",si,k(C(xa)(m)),1),g("code",{class:"diff-viewer-line-code",innerHTML:i(m.text)||" "},null,8,oi)],8,ei))),128))])])):(r(),l("div",Ka,[g("p",Ga,k(C(s)("No diff available")),1),g("p",Za,k(C(s)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),Z(Wo,{name:"diff-viewer-sheet"},{default:Re(()=>[e.isMobile&&e.isFileListOpen?(r(),l("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:h[3]||(h[3]=m=>u.$emit("close-file-list"))},[g("div",{class:"diff-viewer-mobile-sheet",onClick:h[2]||(h[2]=De(()=>{},["stop"]))},[h[6]||(h[6]=g("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),g("div",ai,[g("p",ii,k(C(s)("Changed files")),1),g("p",ri,k(d.value(e.changes.length)),1)]),g("div",li,[(r(!0),l(E,null,q(e.changes,m=>(r(),l("button",{key:`diff-viewer-sheet:${C(Q)(m)}`,type:"button",class:"diff-viewer-file-button","data-active":C(Q)(m)===C(Q)(e.change),onClick:y=>u.$emit("select-change",m)},[g("span",{class:"file-change-badge","data-operation":C(Jt)(m)},k(a.value(m)),9,ui),g("span",di,[ue(k(c.value(m.path))+" ",1),m.movedToPath?(r(),l(E,{key:0},[ue(" → "+k(c.value(m.movedToPath)),1)],64)):L("",!0)]),C(Le)(m)?(r(),l("span",fi,k(C(Le)(m)),1)):L("",!0)],8,ci))),128))])])])):L("",!0)]),_:1})])])):L("",!0)]))}}),mi=J(hi,[["__scopeId","data-v-7ec6502b"]]),gi={},pi={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vi(e,n){return r(),l("svg",pi,[...n[0]||(n[0]=[g("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Xt=J(gi,[["render",vi]]),ki={class:"file-change-summary-label"},yi={class:"file-change-summary-status"},bi=["data-tone"],wi={class:"file-change-panel-inner"},$i={class:"file-change-list"},xi=["data-operation","title"],_i={class:"file-change-path-group"},Ci=["title","onClick"],Ti={key:0,class:"file-change-arrow"},Li=["title","onClick"],Ii={key:0,class:"file-change-delta"},Mi=["data-tone"],Si=["title","aria-label","onClick"],Pi={key:0,class:"file-change-actions"},Ai={key:0,class:"file-change-action-error"},Ei=["disabled","title","aria-label"],Fi=ee({__name:"FileChangeSummaryBlock",props:{summary:{},expanded:{type:Boolean},inline:{type:Boolean},cwd:{},actionable:{type:Boolean},actionStatus:{},actionErrorText:{},nextAction:{},actionLabel:{}},emits:["toggle","open-diff","request-action","request-file-action"],setup(e){const n=e,{t:s}=se(),i=M(()=>u=>tn(u,s)),a=M(()=>u=>ma(u,s)),d=M(()=>u=>je(u,n.cwd)),c=M(()=>u=>`${s("Undo")} ${je(u.path,n.cwd)}`);return(u,h)=>e.summary?(r(),l("section",{key:0,class:U(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[g("button",{type:"button",class:U(["file-change-summary-row",{"file-change-summary-row-expanded":e.expanded}]),onClick:h[0]||(h[0]=m=>u.$emit("toggle"))},[g("span",{class:U(["file-change-chevron",{"file-change-chevron-open":e.expanded}])},"▶",2),g("span",ki,k(a.value(e.summary)),1),g("span",yi,[(r(!0),l(E,null,q(C(ga)(e.summary),m=>(r(),l("span",{key:`summary-status:${e.summary.turnId}:${m.tone}:${m.label}`,class:"file-change-signed-count","data-tone":m.tone},k(m.label),9,bi))),128))])],2),g("div",{class:U(["file-change-panel",{"file-change-panel-visible":e.expanded}])},[g("div",wi,[g("ul",$i,[(r(!0),l(E,null,q(e.summary.changes,m=>(r(),l("li",{key:`file-change:${e.summary.turnId}:${m.path}:${m.movedToPath||""}`,class:"file-change-item"},[g("span",{class:"file-change-badge","data-operation":C(Jt)(m),title:i.value(m)},k(C(da)(m)),9,xi),g("span",_i,[g("button",{type:"button",class:"file-change-path-button",title:m.path,onClick:y=>u.$emit("open-diff",m)},k(d.value(m.path)),9,Ci),m.movedToPath?(r(),l("span",Ti,"→")):L("",!0),m.movedToPath?(r(),l("button",{key:1,type:"button",class:"file-change-path-button",title:m.movedToPath,onClick:y=>u.$emit("open-diff",m)},k(d.value(m.movedToPath)),9,Li)):L("",!0)]),m.addedLineCount>0||m.removedLineCount>0?(r(),l("span",Ii,[(r(!0),l(E,null,q(C(fa)(m),y=>(r(),l("span",{key:`change-delta:${e.summary.turnId}:${m.path}:${y.tone}:${y.label}`,class:"file-change-signed-count","data-tone":y.tone},k(y.label),9,Mi))),128))])):L("",!0),e.actionable?(r(),l("button",{key:1,type:"button",class:"file-change-file-undo-button",title:c.value(m),"aria-label":c.value(m),onClick:y=>u.$emit("request-file-action",m)},[Z(Xt,{class:"icon-svg file-change-action-icon"})],8,Si)):L("",!0)]))),128))]),e.actionable?(r(),l("div",Pi,[e.actionErrorText?(r(),l("p",Ai,k(e.actionErrorText),1)):L("",!0),g("button",{type:"button",class:"file-change-action-button",disabled:e.actionStatus==="undoing"||e.actionStatus==="redoing",title:e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn","aria-label":e.nextAction==="redo"?"Redo file changes from this turn":"Undo file changes from this turn",onClick:h[1]||(h[1]=m=>u.$emit("request-action",e.nextAction))},[Z(Xt,{class:U(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),ue(" "+k(e.actionLabel),1)],8,Ei)])):L("",!0)])],2)],2)):L("",!0)}}),is=J(Fi,[["__scopeId","data-v-851281a0"]]),Bi=ee({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:n}){const s=e,i=n,a=W(null),d=M(()=>({left:`${String(s.x)}px`,top:`${String(s.y)}px`}));function c(){i("close")}function u(){const T=s.browseUrl;c(),!(!T||T==="#")&&window.open(T,"_blank","noopener,noreferrer")}function h(){const T=s.editUrl;c(),!(!T||T==="#")&&window.open(T,"_blank","noopener,noreferrer")}async function m(){const T=s.browseUrl;if(c(),!(!T||T==="#"))try{await zt(T)}catch{}}function y(T){if(!s.visible)return;const P=a.value;if(!P){c();return}const w=T.target;w instanceof Node&&P.contains(w)||c()}function I(){c()}function F(T){T.key==="Escape"&&c()}return de(()=>s.visible,T=>{T?(window.addEventListener("pointerdown",y,!0),window.addEventListener("blur",I),window.addEventListener("keydown",F,!0)):(window.removeEventListener("pointerdown",y,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",F,!0))}),en(()=>{window.removeEventListener("pointerdown",y,!0),window.removeEventListener("blur",I),window.removeEventListener("keydown",F,!0)}),(T,P)=>e.visible?(r(),l("div",{key:0,ref_key:"menuRef",ref:a,class:"file-link-context-menu",style:Ze(d.value),onClick:P[0]||(P[0]=De(()=>{},["stop"]))},[g("button",{type:"button",class:"file-link-context-menu-item",onClick:u}," Open link "),g("button",{type:"button",class:"file-link-context-menu-item",onClick:m}," Copy link "),e.editUrl?(r(),l("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:h}," Edit file ")):L("",!0)],4)):L("",!0)}}),Ri=J(Bi,[["__scopeId","data-v-9cda1d9d"]]),Oi=12e3,Hi=240;function Di(e,{streaming:n,truncateStreaming:s=!0,maxChars:i=Oi,maxLines:a=Hi}){if(!s)return e;let d=e,c=!1;if(i>0&&d.length>i&&(d=d.slice(-i),c=!0),a>0){const u=d.split(/\r?\n/);u.length>a&&(d=u.slice(-a).join(`
|
|
23
|
-
`),c=!0)}return c?`...
|
|
24
|
-
${d}`:d}const Wi={class:"conversation-item conversation-item-overlay"},ji={class:"message-row"},qi={class:"message-stack"},Ni={class:"live-overlay-inline","aria-live":"polite"},zi={class:"live-overlay-title-row"},Ui={key:0,class:"live-overlay-spinner","aria-hidden":"true"},Vi=["aria-expanded"],Ki={class:"live-overlay-label"},Gi={class:"live-overlay-toggle","aria-hidden":"true"},Zi={key:2,class:"live-overlay-label"},Ji={key:0,class:"live-overlay-reasoning"},Xi={key:1,class:"live-overlay-error"},Yi=["href"],Qi=ee({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const n=e,{buildFeedbackMailto:s,recordVisibleFailure:i}=vs(),{t:a}=se(),d=W(!0);function c(){d.value=!d.value}const u=M(()=>{var m;return Di(((m=n.overlay)==null?void 0:m.reasoningText)??"",{streaming:!0})});function h(m,y){i(y);const I=m.currentTarget;I instanceof HTMLAnchorElement&&(I.href=s())}return(m,y)=>{var I,F,T,P,w,B;return r(),l("li",Wi,[g("div",ji,[g("div",qi,[g("article",Ni,[g("div",zi,[(I=e.overlay)!=null&&I.errorText?L("",!0):(r(),l("span",Ui)),(F=e.overlay)!=null&&F.reasoningText?(r(),l("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":d.value,onClick:c},[g("span",Ki,k((T=e.overlay)==null?void 0:T.activityLabel),1),g("span",Gi,k(d.value?"▾":"▸"),1)],8,Vi)):(r(),l("p",Zi,k((P=e.overlay)==null?void 0:P.activityLabel),1))]),(w=e.overlay)!=null&&w.reasoningText&&d.value?(r(),l("p",Ji,k(u.value),1)):L("",!0),(B=e.overlay)!=null&&B.errorText?(r(),l("div",Xi,[g("span",null,k(e.overlay.errorText),1),g("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:y[0]||(y[0]=O=>h(O,e.overlay.errorText))},k(C(a)("Send feedback")),9,Yi)])):L("",!0)])])])])}}}),er=J(Qi,[["__scopeId","data-v-b69a0020"]]),tr={},nr={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sr(e,n){return r(),l("svg",nr,[...n[0]||(n[0]=[g("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 or=J(tr,[["render",sr]]),ar=["data-role"],ir=["aria-label","title"],rr={key:0,class:"message-rollback-label"},lr=["aria-label","title"],cr={class:"message-fork-label"},ur=["data-copied","aria-label","title"],dr={key:0,class:"message-copy-label"},fr=ee({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1}},emits:["edit","fork","copy"],setup(e){const{t:n}=se();return(s,i)=>e.showEdit||e.showFork||e.showCopy?(r(),l("div",{key:0,class:"message-toolbar","data-role":e.role},[e.showEdit?(r(),l("button",{key:0,type:"button",class:"message-rollback-button","aria-label":C(n)("Rollback this message"),title:C(n)("Rollback this message"),onClick:i[0]||(i[0]=a=>s.$emit("edit"))},[Z(Xt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(r(),l("span",rr,k(C(n)("Rollback")),1)):L("",!0)],8,ir)):L("",!0),e.showFork?(r(),l("button",{key:1,type:"button",class:"message-fork-button","aria-label":C(n)("Fork thread from this response"),title:C(n)("Fork thread from this response"),onClick:i[1]||(i[1]=a=>s.$emit("fork"))},[Z(jo,{class:"icon-svg message-fork-icon"}),g("span",cr,k(C(n)("Fork")),1)],8,lr)):L("",!0),e.showCopy?(r(),l("button",{key:2,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?C(n)("Response copied"):C(n)("Copy response"),title:e.copied?C(n)("Response copied"):C(n)("Copy response"),onClick:i[2]||(i[2]=a=>s.$emit("copy"))},[Z(or,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(r(),l("span",dr,k(e.copied?"Copied":"Copy"),1)):L("",!0)],8,ur)):L("",!0)],8,ar)):L("",!0)}}),hr=J(fr,[["__scopeId","data-v-59a7a725"]]),mr="codex-web-local.process-fold.v1",rs="codex:web-local:process-fold";function qt(){return typeof localStorage>"u"?"auto":localStorage.getItem(mr)==="expanded"?"expanded":"auto"}function gr(e){const n=s=>e(s.detail);return window.addEventListener(rs,n),()=>window.removeEventListener(rs,n)}const pr=["aria-expanded"],vr={class:"process-fold-label"},kr={class:"process-fold-toggle","aria-hidden":"true"},yr={key:0,class:"process-fold-body"},br=ee({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const n=e,s=W(qt()==="expanded"||!n.hasOutsideContent),i=W(!1);let a=!1;const d=gr(()=>{i.value=!1,qt()==="expanded"?s.value=!0:!n.running&&n.hasOutsideContent&&(s.value=!1)});de(()=>n.running,u=>{const h=a;a=u,u?(h||(i.value=!1),i.value||(s.value=!0)):h&&!i.value&&n.hasOutsideContent&&qt()!=="expanded"&&(s.value=!1)},{immediate:!0}),en(()=>d());function c(){i.value=!0,s.value=!s.value}return(u,h)=>(r(),l("div",{class:U(["process-fold",{"process-fold--open":s.value,"process-fold--running":e.running}])},[g("button",{type:"button",class:"process-fold-header","aria-expanded":s.value,onClick:c},[g("span",vr,k(e.label),1),g("span",kr,k(s.value?"▾":"▸"),1)],8,pr),s.value?(r(),l("div",yr,[be(u.$slots,"default",{},void 0)])):L("",!0)],2))}}),wr=J(br,[["__scopeId","data-v-de9b3329"]]),$r=["aria-label"],xr=["data-turn","aria-label","onClick"],_r={class:"question-jump-preview-text"},Cr=2,Nt="#3b82f6",Tr=ee({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:n}){const s=e,i=n,{t:a}=se(),d=W(null),c=W(-1),u=W("0px"),h=M(()=>{const w=c.value;return w<0?null:s.anchors[w]??null});function m(w){var ne;const B=s.activeTurn===((ne=s.anchors[w])==null?void 0:ne.turn),O={};if(c.value<0)return O.width=B?"18px":"12px",O.background=B?Nt:void 0,O;const Y=Math.abs(w-c.value);return O.width=Y===0?"32px":Y===1?"20px":Y===2?"14px":B?"18px":"12px",O.background=Y===0?Nt:Y===1?"rgba(59,130,246,0.6)":Y===2?"rgba(59,130,246,0.35)":B?Nt:void 0,O.transitionDelay=`${Y*20}ms`,O}function y(w){const B=d.value;if(!B)return-1;const O=Array.from(B.querySelectorAll(".question-jump-item"));let Y=-1,ne=Number.POSITIVE_INFINITY;for(let H=0;H<O.length;H+=1){const we=O[H].getBoundingClientRect(),Ie=we.top+we.height/2,te=Math.abs(w-Ie);te<ne&&(ne=te,Y=H)}return Y}function I(w){var Ie;const B=y(w.clientY);if(B<0)return;c.value=B;const O=d.value;if(!O)return;const ne=(Ie=Array.from(O.querySelectorAll(".question-jump-item"))[B])==null?void 0:Ie.getBoundingClientRect(),H=O.getBoundingClientRect();if(!ne)return;const we=ne.top+ne.height/2;u.value=`${we-H.top}px`}function F(){c.value=-1}function T(w){const B=y(w.clientY),O=B>=0?s.anchors[B]:null;O&&i("jump",O.turn)}function P(w){i("jump",w.turn)}return(w,B)=>e.anchors.length>=Cr?(r(),l("nav",{key:0,class:"question-jump-bar","aria-label":C(a)("Question navigation")},[g("div",{ref_key:"trackRef",ref:d,class:"question-jump-track",onMousemove:I,onMouseleave:F,onMousedown:T},[(r(!0),l(E,null,q(e.anchors,(O,Y)=>(r(),l("button",{key:O.turn,type:"button",class:"question-jump-item","data-turn":O.turn,"aria-label":C(a)("Jump to question {n}",{n:O.turn+1}),onMousedown:B[0]||(B[0]=De(()=>{},["prevent"])),onClick:ne=>P(O)},[g("span",{class:"question-jump-dot",style:Ze(m(Y))},null,4)],40,xr))),128))],544),h.value?(r(),l("div",{key:0,class:"question-jump-preview",role:"tooltip",style:Ze({top:u.value})},[g("span",_r,k(h.value.text),1)],4)):L("",!0)],8,$r)):L("",!0)}}),Lr=J(Tr,[["__scopeId","data-v-96d087d4"]]),Ir=["data-state"],Mr=["aria-expanded"],Sr={class:"reasoning-block-title"},Pr={class:"reasoning-block-toggle","aria-hidden":"true"},Ar={key:0,class:"reasoning-block-body"},Er={key:0,class:"reasoning-block-summary"},Fr=["innerHTML"],Br=ee({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const n=e,{t:s}=se(),i=M(()=>{var d;return(((d=n.message.reasoning)==null?void 0:d.summary)??[]).map(c=>c.trim()).filter(Boolean).join(`
|
|
25
|
-
`).trim()});return(a,d)=>(r(),l("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[g("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:d[0]||(d[0]=c=>a.$emit("toggle"))},[g("span",Sr,k(C(s)("Thinking process")),1),g("span",Pr,k(e.expanded?"▾":"▸"),1)],8,Mr),e.expanded?(r(),l("div",Ar,[i.value?(r(),l("p",Er,k(i.value),1)):L("",!0),g("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,Fr)])):L("",!0)],8,Ir))}}),ls=J(Br,[["__scopeId","data-v-5fa90230"]]),Rr=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),Or=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Hr=new Set(["task","run_skill","explore","research","review","security_review"]);function Dr(e){var s;const n=((s=e.toolCall)==null?void 0:s.tool)??"";return Rr.has(n)?"readonly":Or.has(n)?"modify":Hr.has(n)?"delegate":null}const Wr=2;function jr(e){var d;const n=[];let s=[],i=null;const a=()=>{if(i!==null&&s.length>=Wr)n.push({type:"batch",kind:i,messages:s});else for(const c of s)n.push({type:"tool",message:c});s=[],i=null};for(const c of e){if(c.messageType!=="toolCall"||((d=c.toolCall)==null?void 0:d.status)==="inProgress"){a(),n.push({type:"tool",message:c});continue}const u=Dr(c);if(u===null){a(),n.push({type:"tool",message:c});continue}i!==null&&i!==u&&a(),i=u,s.push(c)}return a(),n}function qr(e,n,s){const{t:i}=s;if(e==="readonly"){const a=n.filter(h=>{var m,y;return((m=h.toolCall)==null?void 0:m.tool)==="read_file"||((y=h.toolCall)==null?void 0:y.tool)==="ls"}).length,d=n.filter(h=>{var y;const m=((y=h.toolCall)==null?void 0:y.tool)??"";return m==="grep"||m==="glob"||m==="web_fetch"||m==="code_index"}).length,c=n.length-a-d,u=[];return a>0&&u.push(i("Read {n} files",{n:a})),d>0&&u.push(i("Search {n} files",{n:d})),c>0&&u.push(i("{n} read calls",{n:c})),u.join(" · ")}return e==="modify"?i("Modified {n} files",{n:n.length}):e==="delegate"?i("Delegated {n} tasks",{n:n.length}):i("Explored {n} items",{n:n.length})}const Nr={class:"message-row","data-role":"system"},zr={class:"message-stack","data-role":"system"},Ur=["title"],Vr={key:0,class:"tool-call-server"},Kr={class:"tool-call-name"},Gr={class:"tool-call-status"},Zr={key:0,class:"work-block-spinner","aria-hidden":"true"},Jr={key:1,class:"tool-call-status-icon","aria-hidden":"true"},Xr={key:2,class:"tool-call-status-icon","aria-hidden":"true"},Yr=ee({__name:"ToolCallRow",props:{message:{}},setup(e){const n=e,{t:s}=se(),i=M(()=>{const c=n.message.toolCall;if(!c)return"";switch(c.status){case"inProgress":return s("Running");case"failed":return s("Failed");default:return s("Done")}}),a=M(()=>{var c;switch((c=n.message.toolCall)==null?void 0:c.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),d=M(()=>{const c=n.message.toolCall;if(!c)return"";const u=[];return c.server&&u.push(c.server),u.push(c.tool),c.error&&u.push(c.error),typeof c.durationMs=="number"&&c.durationMs>=0&&u.push(`${c.durationMs}ms`),u.join(" · ")});return(c,u)=>{var h,m,y,I;return r(),l("div",Nr,[g("div",zr,[g("div",{class:U(["tool-call-block",a.value]),title:d.value},[u[0]||(u[0]=g("span",{class:"tool-call-icon","aria-hidden":"true"},"🛠",-1)),(h=e.message.toolCall)!=null&&h.server?(r(),l("span",Vr,k(e.message.toolCall.server),1)):L("",!0),g("code",Kr,k(((m=e.message.toolCall)==null?void 0:m.tool)||e.message.text||"(tool)"),1),g("span",Gr,[((y=e.message.toolCall)==null?void 0:y.status)==="inProgress"?(r(),l("span",Zr)):((I=e.message.toolCall)==null?void 0:I.status)==="completed"?(r(),l("span",Jr,"✓")):(r(),l("span",Xr,"✗")),ue(" "+k(i.value),1)])],10,Ur)])])}}}),Yt=J(Yr,[["__scopeId","data-v-e25278a7"]]),Qr=["aria-expanded","title"],el={class:"tool-batch-toggle","aria-hidden":"true"},tl={class:"tool-batch-label"},nl={class:"tool-batch-count"},sl={key:0,class:"tool-batch-body"},ol=ee({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const n=e,{t:s}=se(),i=W(!1),a=M(()=>qr(n.kind,n.messages,{t:s})),d=M(()=>n.messages.map(c=>{var u;return((u=c.toolCall)==null?void 0:u.tool)??""}).join(" · "));return(c,u)=>(r(),l("div",{class:U(["tool-batch-block",{"tool-batch-block--open":i.value}])},[g("button",{type:"button",class:"tool-batch-head","aria-expanded":i.value,title:d.value,onClick:u[0]||(u[0]=h=>i.value=!i.value)},[g("span",el,k(i.value?"▾":"▸"),1),u[1]||(u[1]=g("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),g("span",tl,k(a.value),1),g("span",nl,k(e.messages.length),1)],8,Qr),i.value?(r(),l("div",sl,[(r(!0),l(E,null,q(e.messages,h=>(r(),G(Yt,{key:h.id,message:h},null,8,["message"]))),128))])):L("",!0)],2))}}),al=J(ol,[["__scopeId","data-v-908995a9"]]),il=["data-turn-key"],rl={key:0,class:"conversation-turn-request","aria-label":"User request"},ll={class:"conversation-turn-items"},cl={key:1,class:"conversation-turn-process","aria-label":"Turn process"},ul=["aria-expanded","aria-label"],dl={class:"conversation-turn-process-count"},fl={key:1,class:"conversation-turn-process-heading"},hl={key:2,class:"conversation-turn-items conversation-turn-process-items"},ml={key:2,class:"conversation-turn-final","aria-label":"Assistant final response"},gl={class:"conversation-turn-items"},pl=ee({__name:"ThreadTurn",props:{turnKey:{},request:{},processItems:{default:()=>[]},finalItem:{},fileChangeAnchorIds:{default:()=>[]},warm:{},warmItems:{default:()=>[]}},setup(e){const n=e,{t:s}=se(),i=W(!0),a=M(()=>n.processItems.length+n.fileChangeAnchorIds.length),d=M(()=>!!n.finalItem);return de(a,(c,u)=>{c>u&&(i.value=!0)}),(c,u)=>e.warm?(r(),l(E,{key:0},[be(c.$slots,"warm-card",{warm:e.warm},void 0),(r(!0),l(E,null,q(e.warmItems,h=>be(c.$slots,"default",{key:h.message.id,item:h,section:"warm"},void 0)),128))],64)):(r(),l("li",{key:1,class:"conversation-turn","data-turn-key":e.turnKey},[e.request?(r(),l("section",rl,[g("ol",ll,[be(c.$slots,"default",{item:e.request,section:"request"},void 0)])])):L("",!0),a.value>0?(r(),l("section",cl,[d.value?(r(),l("button",{key:0,class:"conversation-turn-process-heading conversation-turn-process-toggle",type:"button","aria-expanded":i.value,"aria-label":i.value?C(s)("Collapse turn process"):C(s)("Expand turn process"),onClick:u[0]||(u[0]=h=>i.value=!i.value)},[i.value?(r(),G(qo,{key:0,class:"conversation-turn-process-toggle-icon"})):(r(),G(ks,{key:1,class:"conversation-turn-process-toggle-icon"})),g("span",null,k(C(s)("Turn process")),1),g("span",dl,k(C(s)("{n} process items",{n:a.value})),1)],8,ul)):(r(),l("div",fl,k(C(s)("Turn process")),1)),i.value?(r(),l("ol",hl,[(r(!0),l(E,null,q(e.processItems,h=>be(c.$slots,"default",{key:h.message.id,item:h,section:"process"},void 0)),128)),(r(!0),l(E,null,q(e.fileChangeAnchorIds,h=>(r(),l("li",{key:`file-change-${h}`,class:"conversation-turn-row conversation-turn-file-change"},[be(c.$slots,"file-change",{anchorMessageId:h},void 0)]))),128))])):L("",!0)])):L("",!0),e.finalItem?(r(),l("section",ml,[g("ol",gl,[be(c.$slots,"default",{item:e.finalItem,section:"final"},void 0)])])):L("",!0)],8,il))}}),vl=J(pl,[["__scopeId","data-v-098ed81a"]]),kl=["aria-expanded"],yl={class:"warm-turn__preview"},bl={key:0,class:"warm-turn__meta"},wl={class:"warm-turn__content"},$l={key:1,class:"warm-turn__assistant"},xl=ee({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const s=n,{t:i}=se();function a(){s("toggle")}return(d,c)=>(r(),l("div",{class:U(["warm-turn",{"warm-turn--expanded":e.expanded}])},[g("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:a},[Z(ks,{class:U(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),g("span",yl,k(e.userText),1),e.toolCount>0?(r(),l("span",bl,k(C(i)("{n} tools",{n:e.toolCount})),1)):L("",!0)],8,kl),g("div",wl,[e.expanded?be(d.$slots,"default",{},void 0,!0,0):e.assistantPreview?(r(),l("div",$l,k(e.assistantPreview),1)):L("",!0)])],2))}}),_l=J(xl,[["__scopeId","data-v-7e3ebbc7"]]),Cl=["aria-expanded"],Tl=["title"],Ll={class:"work-block-command"},Il={class:"work-block-status"},Ml={key:0,class:"work-block-spinner","aria-hidden":"true"},Sl={key:1,class:"work-block-status-icon","aria-hidden":"true"},Pl={key:2,class:"work-block-status-icon","aria-hidden":"true"},Al={class:"work-block-output-inner"},El=["textContent"],Fl=["textContent"],Bl={key:0,class:"work-block-permission-hint",role:"note"},Rl=ee({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const n=e,{t:s}=se(),i=M(()=>{var h,m;const u=(h=n.command.commandExecution)==null?void 0:h.status;return u==="inProgress"?"cmd-status-running":u==="completed"&&((m=n.command.commandExecution)==null?void 0:m.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),a=M(()=>{const u=n.command.commandExecution;if(!u)return"";switch(u.status){case"inProgress":return s("Running");case"completed":return u.exitCode===0?s("Done"):`${s("Exit")} ${u.exitCode??"?"}`;case"failed":return s("Failed");case"declined":return s("Declined");case"interrupted":return s("Stopped");default:return""}}),d=[/access to the path .* is denied/iu,/access is denied/iu,/permission denied/iu,/not permitted/iu,/EACCES|EPERM/iu,/denied access|deny access/iu,/拒绝访问/iu,/没有权限/iu,/权限不足/iu,/要求提权|需要提权|require_escalated/iu],c=M(()=>{const u=n.command.commandExecution;if(!u||!(u.status==="failed"||u.status==="declined"||typeof u.exitCode=="number"&&u.exitCode!==0))return"";const m=u.aggregatedOutput??"";return!m||!d.some(y=>y.test(m))?"":s("Command blocked by a permission or sandbox restriction; no approval prompt was shown. Check the approval policy or trusted directories if you expected one.")});return(u,h)=>{var m,y,I,F,T,P;return r(),l("div",{class:U(["work-block",[i.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[g("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,onClick:h[0]||(h[0]=w=>u.$emit("toggle"))},[g("span",{class:"work-step-dot",title:`${C(s)("Step")} ${String(e.stepIndex+1)}`},k(e.stepIndex+1),9,Tl),g("code",Ll,k(C(s)("Command")),1),g("span",Il,[((m=e.command.commandExecution)==null?void 0:m.status)==="inProgress"?(r(),l("span",Ml)):((y=e.command.commandExecution)==null?void 0:y.status)==="completed"&&((I=e.command.commandExecution)==null?void 0:I.exitCode)===0?(r(),l("span",Sl,"✓")):((F=e.command.commandExecution)==null?void 0:F.status)==="failed"?(r(),l("span",Pl,"✗")):L("",!0),ue(" "+k(a.value),1)])],8,Cl),g("div",{class:U(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[g("div",Al,[g("pre",{class:"work-block-output-command",textContent:k(((T=e.command.commandExecution)==null?void 0:T.command)||"(command)")},null,8,El),g("pre",{class:U(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:k(((P=e.command.commandExecution)==null?void 0:P.aggregatedOutput)||"(no output)")},null,10,Fl)])],2),c.value?(r(),l("p",Bl,k(c.value),1)):L("",!0)],2)}}}),cs=J(Rl,[["__scopeId","data-v-e9fdf684"]]),Ol=2;function us(e){const n=e.messageType;return n==="commandExecution"||n==="toolCall"}function Hl(e){var s,i;return(((s=e.commandExecution)==null?void 0:s.status)??"")==="inProgress"||(((i=e.toolCall)==null?void 0:i.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function Dl(e){const n=[];let s=[],i="";const a=()=>{s.length>0&&(n.push(s),s=[])};for(const u of e){const h=u.turnId??"",m=us(u)&&h!=="";(!m||h!==i)&&(s.length>0&&a(),i=m?h:""),m&&s.push(u)}a();const d=new Map;for(const u of e)u.messageType==="worked"&&u.turnId&&typeof u.durationMs=="number"&&d.set(u.turnId,u.durationMs);const c=[];for(const u of n){if(u.length<Ol)continue;const h=u[0].turnId??"";let m=0,y=0,I=0,F=!1;for(const P of u)P.messageType==="toolCall"?m+=1:P.messageType==="reasoning"?y+=1:P.messageType==="commandExecution"&&(I+=1),Hl(P)&&(F=!0);const T=e.some(P=>P.turnId===h&&!us(P));c.push({turnId:h,messages:u,running:F,toolCount:m,thoughtCount:y,commandCount:I,durationMs:d.get(h)??0,hasOutsideContent:T})}return c}function Wl(e,n){const{t:s,formatDuration:i}=n,a=[];return e.running?a.push(s("Working…")):e.durationMs>0?a.push(i(e.durationMs)):a.push(s("Processed")),e.toolCount>0&&a.push(s("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&a.push(s("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&a.push(s("{n} commands",{n:e.commandCount})),a.join(" · ")}function jl(e){return e.role==="user"?"user":e.messageType==="reasoning"?"reasoning":e.messageType==="plan"||e.messageType==="plan.live"?"plan":e.messageType==="fileChange"?"file-change":e.messageType==="commandExecution"||e.messageType==="toolCall"||e.messageType==="worked"?"process":"assistant"}function ql(e){var n;return e.role==="assistant"&&e.messageType!=="reasoning"&&e.messageType!=="commandExecution"&&e.messageType!=="toolCall"&&e.messageType!=="worked"&&e.messageType!=="plan"&&e.messageType!=="plan.live"&&e.messageType!=="fileChange"&&!((n=e.messageType)!=null&&n.endsWith(".live"))&&e.text.trim().length>0}function Nl(e){const n=[];let s=null;for(const i of e)(i.role==="user"||!s)&&(s={key:`turn-${i.id}`,items:[]},n.push(s)),s.items.push({message:i,kind:jl(i)});for(const i of n){const a=[...i.items].reverse().find(d=>d.kind!=="file-change");a&&ql(a.message)&&(a.kind="final-assistant")}return n}function Ss(e){return e.replace(/\s+/g," ").trim()}function zl(e){const n=Ss(e);return n.length<=80?n:n.slice(0,80)}function Ps(e){const n=Ss(e);return n.length<=80?n:n.slice(0,77)+"..."}function Qt(e){return{sessionKey:e,expandedWarmTurns:new Set,coldPage:0}}function pt(e,n){return e.sessionKey===n?e:Qt(n)}function Ul(e,n){const s=pt(e,n);return{...s,coldPage:s.coldPage+1}}function Vl(e,n,s){const i=pt(e,n),a=Math.max(0,Math.floor(s));return i.coldPage>=a?i:{...i,coldPage:a}}function ds(e,n,s,i){const a=pt(e,n),d=new Set(a.expandedWarmTurns);return i?d.add(s):d.delete(s),{...a,expandedWarmTurns:d}}function Kl(e){return e.role==="user"}function Gl(e){var n;return((n=e.messageType)==null?void 0:n.endsWith(".live"))===!0}function Zl(e){var d;const n=[];let s=-1,i=0;const a=(c,u)=>{n.push({userItem:c,assistantPreview:"",toolCount:0,startIdx:u,endIdx:e.length})};for(let c=0;c<e.length;c+=1){const u=e[c];if(Kl(u)){if(s>=0)n[n.length-1].endIdx=c;else{n.push({userItem:u,assistantPreview:"",toolCount:0,startIdx:i,endIdx:e.length}),s=c,i=c;continue}s=c,a(u,c)}else if(s>=0&&n.length>0){const h=n[n.length-1],m=((d=u.text)==null?void 0:d.trim())||"";u.role==="assistant"&&!Gl(u)&&m&&(h.assistantPreview=Ps(m)),u.messageType==="toolCall"&&(h.toolCount+=1)}}return n}function Jl({turnCount:e,hotTurns:n,pageSize:s,coldPage:i}){const a=Math.max(0,e),d=Math.max(0,n),c=Math.max(0,a-Math.min(a,d));if(c===0)return{warmStartTurn:0,warmEndTurn:0,coldTurnCount:0};const u=Math.max(0,s),h=Math.max(0,Math.floor(i)),m=Math.min(c,u*(h+1));return{warmStartTurn:c-m,warmEndTurn:c,coldTurnCount:c-m}}function Xl({turn:e,turnCount:n,hotTurns:s,pageSize:i}){const a=Math.max(0,n),d=Math.max(0,s),c=Math.max(0,a-Math.min(a,d));if(c===0||e>=c)return 0;const u=Math.max(1,i),h=Math.max(0,Math.floor(e)),m=c-h;return Math.max(0,Math.ceil(m/u)-1)}function fs(e,n,s){if(n.length===0)return e.slice(0);if(s>=n.length)return[];const i=n[s].startIdx;return e.slice(i)}const Yl={key:0,class:"conversation-loading"},Ql={key:1,class:"conversation-empty"},ec={key:0,class:"conversation-load-more"},tc=["disabled"],nc={key:1,class:"conversation-load-more conversation-warm-collapse"},sc=["disabled"],oc=["id"],ac={class:"message-row","data-role":"system"},ic={class:"message-stack","data-role":"system"},rc={class:"message-row","data-role":"system","data-message-type":"fileChange"},lc={class:"message-stack","data-role":"system"},cc={key:0,class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},uc={class:"message-row","data-role":"system"},dc={class:"message-stack","data-role":"system"},fc={key:0,class:"work-block-list"},hc=["id","data-role","data-message-type"],mc={key:0,class:"message-row thread-compaction-row","data-role":"system"},gc={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},pc={key:1,class:"message-row thread-compaction-row","data-role":"system"},vc={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},kc={key:2,class:"message-row","data-role":"system"},yc={class:"message-stack","data-role":"system"},bc={class:"work-block-list"},wc=["data-role","data-message-type"],$c=["data-role"],xc=["data-role"],_c={key:5,class:"message-row","data-role":"system","data-message-type":"plan"},Cc={class:"message-stack","data-role":"system"},Tc={class:"thread-plan-record"},Lc={class:"thread-plan-record-header"},Ic={key:0,class:"thread-plan-record-explanation"},Mc={key:1,class:"thread-plan-record-steps"},Sc=["data-status"],Pc={class:"thread-plan-record-marker","aria-hidden":"true"},Ac=["data-role","data-message-type"],Ec=["data-role"],Fc=["data-role"],Bc=["data-role"],Rc=["onClick"],Oc=["src"],Hc=["src","alt"],Dc={key:1,class:"message-file-attachments"},Wc=["href","title"],jc={key:2,class:"message-skill-attachments"},qc=["href","title"],Nc={class:"message-skill-chip-prefix"},zc={class:"message-skill-chip-name"},Uc=["data-role"],Vc={key:0,class:"automation-message-label"},Kc={key:0},Gc={key:1,class:"work-summary-wrap","aria-live":"polite"},Zc={class:"work-summary-text"},Jc={key:0,class:"message-text"},Xc={key:0},Yc={key:1,class:"message-bold-text"},Qc={key:2,class:"message-italic-text"},eu={key:3,class:"message-strikethrough-text"},tu=["href","title"],nu=["href","title"],su={key:6,class:"message-inline-code"},ou={key:0},au={key:1,class:"message-bold-text"},iu={key:2,class:"message-italic-text"},ru={key:3,class:"message-strikethrough-text"},lu=["href","title"],cu=["href","title"],uu={key:6,class:"message-inline-code"},du={key:2,class:"message-blockquote"},fu={key:0},hu={key:1,class:"message-bold-text"},mu={key:2,class:"message-italic-text"},gu={key:3,class:"message-strikethrough-text"},pu=["href","title"],vu=["href","title"],ku={key:6,class:"message-inline-code"},yu={key:3,class:"message-list message-list-unordered"},bu=["innerHTML"],wu={key:4,class:"message-list message-task-list"},$u=["data-checked"],xu={class:"message-list-item-text"},_u={key:0},Cu={key:1,class:"message-bold-text"},Tu={key:2,class:"message-italic-text"},Lu={key:3,class:"message-strikethrough-text"},Iu=["href","title"],Mu=["href","title"],Su={key:6,class:"message-inline-code"},Pu=["start"],Au=["innerHTML"],Eu={key:6,class:"message-table-wrap"},Fu={class:"message-table"},Bu={key:0},Ru={key:1,class:"message-bold-text"},Ou={key:2,class:"message-italic-text"},Hu={key:3,class:"message-strikethrough-text"},Du=["href","title"],Wu=["href","title"],ju={key:6,class:"message-inline-code"},qu={key:0},Nu={key:0},zu={key:1,class:"message-bold-text"},Uu={key:2,class:"message-italic-text"},Vu={key:3,class:"message-strikethrough-text"},Ku=["href","title"],Gu=["href","title"],Zu={key:6,class:"message-inline-code"},Ju={key:7,class:"message-code-block"},Xu={key:0,class:"message-code-language"},Yu={class:"message-code-pre"},Qu=["innerHTML"],ed={key:8,class:"message-divider"},td={key:9,class:"message-text"},nd=["onClick"],sd=["src"],od=["src","alt","onError"],ad=["href","onClick"],id=["title","aria-label"],rd=["aria-label"],ld=["src"],cd=["src","alt"],ud=16,dd=300,fd=1200,hd=300,md=250,hs=30,ms=20,gd=200,pd=ee({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","respondServerRequest","fileChangesChanged"],setup(e,{expose:n,emit:s}){function i(t){return pa(t,_.cwd,H)}function a(t){return je(t,_.cwd)}const d=W(new Set),c=W(new Set),u=W(new Set),h=W(null),m=W(""),y=W(!1),I=W(!1),F=W(0),T=W(0),P=W(""),w=W(""),{isMobile:B}=No(),{buildFeedbackMailto:O,feedbackMailtoBase:Y,recordVisibleFailure:ne}=vs(),{t:H}=se(),we=Y();function Ie(t,o){ne(o);const f=t.currentTarget;f instanceof HTMLAnchorElement&&(f.href=O())}function te(t){return t.messageType==="commandExecution"&&!!t.commandExecution}function As(t){return t.messageType==="compaction.pending"}function Es(t){return t.messageType==="compaction.done"}function vt(t){return t.messageType==="plan"||t.messageType==="plan.live"}function kt(t){return t.messageType==="reasoning"&&!!t.reasoning}const yt=W(new Set);function nn(t){return yt.value.has(t.id)}function sn(t){const o=new Set(yt.value);o.has(t.id)?o.delete(t.id):o.add(t.id),yt.value=o}function on(t){return t.messageType==="toolCall"&&!!t.toolCall}function Fs(t){return t.messageType==="turnError"}function Qe(t){return t.messageType==="fileChange"&&t.fileChangeStatus==="completed"&&Array.isArray(t.fileChanges)&&t.fileChanges.length>0}function bt(t){return t.role==="assistant"&&!te(t)&&t.messageType!=="worked"&&!(t.messageType??"").endsWith(".live")}const wt=M(()=>{var t;for(let o=_.messages.length-1;o>=0;o-=1){const f=_.messages[o];if(f.messageType==="commandExecution"&&((t=f.commandExecution)==null?void 0:t.status)==="inProgress")return f.id}return""}),an=M(()=>_.messages.some(t=>t.role==="assistant"&&t.messageType==="agentMessage.live"&&t.text.trim().length>0)),rn=M(()=>!!_.liveOverlay||wt.value.length>0||an.value),ln=M(()=>{const t={};for(let o=0;o<_.messages.length;){const f=_.messages[o];if(!te(f)){o+=1;continue}const v=[];for(;o<_.messages.length&&te(_.messages[o]);)v.push(_.messages[o]),o+=1;if(v.length<=1)continue;const x=v[v.length-1];t[x.id]=v.slice(0,-1)}return t}),$t=M(()=>{const t=new Set;for(const o of Object.values(ln.value))for(const f of o)t.add(f.id);return t});function cn(t){return!an.value&&t.id===wt.value}function un(t){return te(t)?d.value.has(t.id)||!c.value.has(t.id)&&cn(t):!1}function dn(t){return te(t)&&rn.value}function fn(t){var o;return te(t)&&(rn.value||((o=t.commandExecution)==null?void 0:o.status)==="inProgress")}function hn(t){if(!te(t))return;const o=new Set(d.value),f=new Set(c.value),v=cn(t);o.has(t.id)?(o.delete(t.id),v&&f.add(t.id)):v&&!f.has(t.id)?f.add(t.id):(o.add(t.id),f.delete(t.id)),d.value=o,c.value=f}function Bs(t){return ln.value[t.id]??[]}function mn(t){return te(t)?[...Bs(t),t]:[]}function gn(t){const o=new Set(u.value);o.has(t.id)?o.delete(t.id):o.add(t.id),u.value=o}function Rs(t){return u.value.has(t.id)}function pn(t,o){t&&(h.value=t,m.value=Q(o),y.value=!1)}function Os(){h.value=null,m.value="",y.value=!1}function Hs(){y.value=!y.value}function Ds(){y.value=!1}function Ws(t){m.value=Q(t),B.value&&(y.value=!1)}function xt(t,o){if(t.size===0)return t;const f=new Set;for(const v of t)o.has(v)&&f.add(v);return f.size===t.size?t:f}const _=e,_t=s,pe=W(null),vn=W(null),Me=W(""),Ct=W(!1),$e=W(""),X=W({}),ie=W({}),re=W({}),fe=W(null),js=M(()=>{const t=fe.value;return t?t.kind==="edit-message"?H("Rollback this turn?"):t.action==="undo"?H("Undo file changes?"):H("Redo file changes?"):""}),qs=M(()=>{const t=fe.value;return t?t.kind==="edit-message"?H("This rolls the thread back to this turn so you can edit the message. Later replies will be removed."):t.filePathLabel?t.action==="undo"?H("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:t.filePathLabel}):H("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:t.filePathLabel}):t.action==="undo"?H("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):H("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),ve=W(!0);let xe=0,le=0,et=0,oe=null,qe=null;const kn=new WeakSet,tt=W(null),Se=W(0),yn=W(0);let nt=null;const Ne=new Map,ze=new Map,Pe=new Map,Ae=new Map;function st(t,o,f,v){for(t.has(o)&&t.delete(o),t.set(o,f);t.size>v;){const x=t.keys().next().value;if(x===void 0)break;t.delete(x)}return f}const ke=W(Qt(_.activeThreadId)),bn=M(()=>pt(ke.value,_.activeThreadId)),ye=W(!1),Tt=M(()=>_.messages.filter(t=>!vt(t))),Ee=M(()=>Zl(Tt.value)),Lt=M(()=>Jl({turnCount:Ee.value.length,hotTurns:hs,pageSize:ms,coldPage:bn.value.coldPage})),It=M(()=>Lt.value.warmStartTurn),Fe=M(()=>Lt.value.warmEndTurn),wn=M(()=>Lt.value.coldTurnCount),$n=M(()=>wn.value>0),Mt=M(()=>bn.value.expandedWarmTurns),Ns=M(()=>{const t=Tt.value,o=Ee.value,f=[],v=Mt.value;for(let N=It.value;N<Fe.value;N+=1){const z=o[N];if(!z)continue;const b={turn:N,userText:Ps(z.userItem.text),assistantPreview:z.assistantPreview,toolCount:z.toolCount,expanded:v.has(N)},R=v.has(N)?t.slice(z.startIdx,z.endIdx).map($=>({message:$})):[];f.push({key:`warm-${N}`,warm:b,warmItems:R,processItems:[],fileChangeAnchorIds:[]})}const x=fs(t,o,Fe.value),p=x[0];if(!p)return f;const S=_.messages.findIndex(N=>N.id===p.id),A=S>=0?_.messages.slice(S):x;for(const N of Nl(A)){const z=N.items.find(j=>j.kind==="user"),b=N.items.find(j=>j.kind==="final-assistant"),R=N.items.filter(j=>j!==z&&j!==b).map(j=>({message:j.message,presentation:j.kind==="plan"?"plan":"process"})),$=N.items.map(j=>j.message.id).filter(j=>!!ae(j));f.push({key:N.key,warmItems:[],request:z?{message:z.message}:void 0,processItems:R,fileChangeAnchorIds:$,finalItem:b?{message:b.message,presentation:"final-assistant"}:void 0})}return f});function xn(){ke.value=Ul(ke.value,_.activeThreadId)}function zs(t){ke.value=ds(ke.value,_.activeThreadId,t,!Mt.value.has(t))}const _n=M(()=>Ee.value.map((t,o)=>({turn:o,text:zl(t.userItem.text)}))),Us=M(()=>Math.max(0,_n.value.length-1)),Vs=M(()=>{const t=new Map;return Ee.value.forEach((o,f)=>{t.set(o.userItem.id,f)}),t});function St(t){return`question-anchor-${t}`}function Ks(t){const o=Vs.value.get(t.id);if(o!==void 0&&!(o<Fe.value))return St(o)}function Gs(t){if(t<Fe.value){let o=ke.value;if(t<It.value){const f=Xl({turn:t,turnCount:Ee.value.length,hotTurns:hs,pageSize:ms});o=Vl(o,_.activeThreadId,f)}o=ds(o,_.activeThreadId,t,!0),ke.value=o}ve.value=!1,ct().then(()=>{const o=pe.value,f=document.getElementById(St(t));if(!o||!f)return;const v=f.getBoundingClientRect(),x=o.getBoundingClientRect(),p=o.scrollTop+v.top-x.top-12;o.scrollTo({top:Math.max(0,p),behavior:"smooth"})})}const Zs=M(()=>{const t=Tt.value,o=Ee.value,f=[];for(let S=It.value;S<Fe.value;S+=1){if(!Mt.value.has(S))continue;const A=o[S];A&&f.push(...t.slice(A.startIdx,A.endIdx))}const v=fs(t,o,Fe.value),x=v[0];if(!x)return f;const p=_.messages.findIndex(S=>S.id===x.id);return f.push(...p>=0?_.messages.slice(p):v),f}),Pt=M(()=>Dl(Zs.value)),Ue=M(()=>{var o;const t=new Map;for(const f of Pt.value){const v=((o=f.messages[0])==null?void 0:o.id)??"";v&&t.set(v,f)}return t}),Js=M(()=>{const t=new Set;for(const o of Pt.value)for(const f of o.messages)t.add(f.id);return t}),Xs=M(()=>{const t=new Set;for(const o of Pt.value)t.add(o.turnId);return t});function Ys(t){return Ue.value.has(t.id)}function Cn(t){return Js.value.has(t.id)}function Qs(t){var o;return((o=Ue.value.get(t.id))==null?void 0:o.messages)??[]}function eo(t){return jr(Qs(t))}function to(t){var o;return t.type==="batch"?`tool-batch-${t.kind}-${((o=t.messages[0])==null?void 0:o.id)??""}`:t.message.id}function no(t){const o=Ue.value.get(t.id);return o?Wl(o,{t:H,formatDuration:Zo}):""}function so(t){var o;return((o=Ue.value.get(t.id))==null?void 0:o.running)??!1}function oo(t){var o;return((o=Ue.value.get(t.id))==null?void 0:o.hasOutsideContent)??!0}function ao(t){return t.messageType==="worked"}const io=M(()=>_.hasMorePersistedAbove===!0),ro=M(()=>!ve.value&&(_.messages.length>0||_.pendingRequests.length>0||!!_.liveOverlay));function lo(){return tt.value?Promise.resolve():(nt||(nt=Ko(()=>import("./common-BeuopZEI.js"),[]).then(t=>{tt.value=t.default,Ae.clear(),Pe.clear(),Se.value+=1}).finally(()=>{nt=null})),nt)}function Tn(t){switch(t){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function co(t){var v;const o=Ge(t);if(!o)return"";const f=[];return(v=o.explanation)!=null&&v.trim()&&f.push(o.explanation.trim()),o.steps.length>0&&f.push(o.steps.map(x=>`- ${Tn(x.status)} ${x.step}`.trim()).join(`
|
|
26
|
-
`)),f.join(`
|
|
27
|
-
|
|
28
|
-
`).trim()}function At(t){const o=[],f=t.text.trim()||co(t),v=vt(t)&&f?`Plan
|
|
29
|
-
${f}`:f;v&&o.push(v);const x=(t.fileAttachments??[]).map(S=>S.path.trim()).filter(S=>S.length>0);x.length>0&&o.push(`Files:
|
|
30
|
-
${x.join(`
|
|
31
|
-
`)}`);const p=(t.images??[]).map(S=>S.trim()).filter(S=>S.length>0);return p.length>0&&o.push(`Images:
|
|
32
|
-
${p.join(`
|
|
33
|
-
`)}`),o.join(`
|
|
34
|
-
|
|
35
|
-
`).trim()}const Ln=M(()=>{var f;const t=new Map;for(const v of _.messages){if(!bt(v))continue;const x=At(v);if(!x)continue;const p=typeof v.turnIndex=="number"?`turn:${v.turnIndex}`:`message:${v.id}`,S=t.get(p);if(S){S.anchorMessageId=v.id,S.parts.push(x);continue}t.set(p,{anchorMessageId:v.id,parts:[x]})}const o={};for(const v of t.values()){const x=v.parts.join(`
|
|
36
|
-
|
|
37
|
-
`).trim();x&&(o[v.anchorMessageId]=x)}for(const[v,x]of Object.entries(Ve.value)){if(x.source!=="metadata")continue;const p=i(x);if(!p)continue;const S=(f=o[v])==null?void 0:f.trim();o[v]=S?`${S}
|
|
38
|
-
|
|
39
|
-
${p}`:p}return o}),In=M(()=>{const t=new Map;for(const f of _.messages){if(!bt(f)||typeof f.turnIndex!="number")continue;const v=`turn:${f.turnIndex}`,x=t.get(v);if(x){x.anchorMessageId=f.id,x.turnIndex=f.turnIndex;continue}t.set(v,{anchorMessageId:f.id,turnIndex:f.turnIndex})}const o={};for(const f of t.values())o[f.anchorMessageId]=f.turnIndex;return o});function uo(t){return typeof Ln.value[t.id]=="string"}function fo(t){return t.role==="user"&&At(t).length>0}async function ho(t){const o=_.messages.find(x=>x.id===t);if(!o)return;const f=At(o);if(!f)return;let v=!1;try{await zt(f),v=!0}catch{v=!1}v||(v=Jn(f)),v&&($e.value=t,oe&&clearTimeout(oe),oe=setTimeout(()=>{$e.value===t&&($e.value=""),oe=null},1800))}function mo(t){return typeof In.value[t.id]=="number"}const Ve=M(()=>{var p,S;const t=new Map,o=new Map,f=new Map,v=A=>!Qe(A)&&!kt(A)&&!vt(A)&&!$t.value.has(A.id)&&!Cn(A);for(const A of _.messages){const N=typeof A.turnIndex=="number"?`turn:${A.turnIndex}`:`message:${A.id}`;if(v(A)&&t.set(N,A.id),bt(A)&&typeof A.turnIndex=="number"&&Array.isArray(A.fileChanges)&&A.fileChanges.length>0&&o.set(A.id,{changes:jt(A.fileChanges),sourceMessageIds:[],source:"assistant",turnId:A.turnId??""}),!Qe(A))continue;const z=f.get(N);z?z.push(A):f.set(N,[A])}const x={};for(const[A,N]of f.entries()){const z=t.get(A);if(!z)continue;const b=((p=o.get(z))==null?void 0:p.turnId)??"";x[z]={changes:jt(N.flatMap(R=>R.fileChanges??[])),sourceMessageIds:N.map(R=>R.id),source:"metadata",turnId:((S=N.find(R=>typeof R.turnId=="string"&&R.turnId.length>0))==null?void 0:S.turnId)??b}}for(const[A,N]of o.entries())x[A]||(x[A]=N);return x}),Et=M(()=>{var v;const t=new Map,o=new Set;for(const x of Object.values(Ve.value))for(const p of x.sourceMessageIds)o.add(p);for(const x of _.messages){if(!Qe(x))continue;const p=typeof x.turnIndex=="number"?`turn:${x.turnIndex}`:`message:${x.id}`,S=t.get(p);S?S.push(x):t.set(p,[x])}const f={};for(const[x,p]of t.entries()){if(p.some(A=>o.has(A.id)))continue;const S=p[p.length-1];S&&(f[S.id]={changes:jt(p.flatMap(A=>A.fileChanges??[])),sourceMessageIds:p.map(A=>A.id),source:"metadata",turnId:S.turnId??((v=p.find(A=>typeof A.turnId=="string"&&A.turnId.length>0))==null?void 0:v.turnId)??""})}return f}),Mn=M(()=>{const t=new Set;for(const o of Object.values(Ve.value))for(const f of o.sourceMessageIds)t.add(f);for(const[o,f]of Object.entries(Et.value))for(const v of f.sourceMessageIds)v!==o&&t.add(v);return t});function ae(t){return Ve.value[t]??null}function go(t){return u.value.has(t)}function po(t){const o=_.messages.find(f=>f.id===t);o&&gn(o)}function ce(t){return Et.value[t.id]??null}function Sn(t){if(!t)return!1;const o=_.liveTurnId??"";return o?(t.turnId??"")!==o:!0}function Be(t){return t!=null&&t.turnId&&_.activeThreadId?`thread:${_.activeThreadId}:turn:${t.turnId}`:""}function Pn(t){return Be(t).length>0}function Ke(t){const o=Be(t);return o?X.value[o]??"idle":"idle"}function An(t){const o=Be(t);return o?ie.value[o]??"":""}function Ft(t){const o=Ke(t);return o==="undone"||o==="redoing"?"redo":"undo"}function En(t){const o=Ke(t);return o==="undoing"?H("Undoing"):o==="redoing"?H("Redoing"):Ft(t)==="redo"?H("Redo"):H("Undo")}async function vo(t,o,f){const v=Be(t);if(!t||!v||!_.activeThreadId||!_.cwd)return;const x=Ke(t),p=o==="undo"?"undoing":"redoing";X.value={...X.value,[v]:p},ie.value={...ie.value,[v]:""};let S;try{const A=re.value[v]??[];S=await Go(_.activeThreadId,t.turnId,_.cwd,o,A.length>0?A:void 0,"single_turn",f)}catch(A){X.value={...X.value,[v]:x},ie.value={...ie.value,[v]:A instanceof Error?A.message:H("Failed to update file changes.")};return}if(S.errors.length>0){o==="undo"?(re.value={...re.value,[v]:S.revertedPatchIds??[]},X.value={...X.value,[v]:"undone"}):((S.appliedPatchIds??[]).length>0&&(re.value={...re.value,[v]:S.appliedPatchIds??[]}),X.value={...X.value,[v]:"undone"}),ie.value={...ie.value,[v]:S.errors.join("; ")};return}if((S.changed??0)<=0){X.value={...X.value,[v]:x},ie.value={...ie.value,[v]:S.message||H(o==="undo"?"No file changes to undo.":"No file changes to redo.")};return}o==="undo"?(re.value={...re.value,[v]:S.revertedPatchIds??[]},X.value={...X.value,[v]:"undone"}):(re.value={...re.value,[v]:S.appliedPatchIds??[]},X.value={...X.value,[v]:"redone"}),_t("fileChangesChanged",_.activeThreadId)}const Fn=M(()=>{var t;return((t=h.value)==null?void 0:t.changes)??[]}),Bn=M(()=>{const t=Fn.value;return t.length===0?null:t.find(o=>Q(o)===m.value)??t[0]}),ko=M(()=>wa(Bn.value));async function yo(t){const o=Ln.value[t]??"";if(!o)return;let f=!1;try{await zt(o),f=!0}catch{f=!1}f||(f=Jn(o)),f&&($e.value=t,oe&&clearTimeout(oe),oe=setTimeout(()=>{$e.value===t&&($e.value=""),oe=null},1800))}function bo(t){const o=In.value[t];typeof o=="number"&&_.activeThreadId&&_t("forkThread",{threadId:_.activeThreadId,turnIndex:o})}const Bt=M(()=>{const t={};for(const o of _.messages){if(o.role!=="user"||typeof o.turnIndex!="number")continue;const f=typeof o.turnId=="string"&&o.turnId.length>0?o.turnId:"";!f||o.text.trim().length===0||(t[o.id]=f)}return t});function wo(t){return typeof Bt.value[t.id]=="string"}function $o(t){Bt.value[t]&&(fe.value={kind:"edit-message",messageId:t})}function Rn(t,o){Be(t)&&(fe.value={kind:"file-change",summary:t,action:o})}function On(t,o){!t||!Be(t)||!o.path||(fe.value={kind:"file-change",summary:t,action:"undo",filePaths:[o.path],filePathLabel:a(o.path)})}function xo(){const t=fe.value;if(fe.value=null,!!t){if(t.kind==="edit-message"){const o=Bt.value[t.messageId];o&&_t("rollback",{turnId:o});return}vo(t.summary,t.action,t.filePaths)}}function _e(t){const o=ze.get(t);return o?(ze.delete(t),ze.set(t,o),o):st(ze,t,ta(t),fd)}function he(t){const o=t.trim();if(!o)return"#";const f=S=>S.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(S),v=Je(o),x=(v==null?void 0:v.path)??o,p=bs(x,_.cwd);if(f(p)){const S=p.startsWith("/")?p:`/${p}`;return`/codex-local-browse${encodeURI(S)}`}return"#"}function _o(t){const o=t.trim();if(!o)return"";try{const f=new URL(o,window.location.href);return f.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${f.pathname.slice(19)}`}${f.search}${f.hash}`:""}catch{return""}}function Co(t){const o=t.target;if(!(o instanceof Element))return;const f=o.closest("a.message-file-link");if(!(f instanceof HTMLAnchorElement))return;const v=(f.getAttribute("href")??"").trim();!v||v==="#"||(t.preventDefault(),t.stopPropagation(),P.value=v,w.value=_o(v),F.value=t.clientX,T.value=t.clientY,I.value=!0)}function To(){I.value&&(I.value=!1)}function Lo(t){const o=Ne.get(t.id);if(o&&o.text===t.text&&o.cwd===_.cwd)return Ne.delete(t.id),Ne.set(t.id,o),o.blocks;const f=as(t.text);return st(Ne,t.id,{text:t.text,cwd:_.cwd,blocks:f},dd).blocks}function V(t){return t.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function Hn(t){var f;const o=((f=t.trim().split(/\s+/u)[0])==null?void 0:f.toLowerCase())??"";return o?Ls[o]??o:""}function Io(t,o){const f=Hn(t);if(!f)return V(o);const v=tt.value;if(!v)return V(o);try{if(v.getLanguage(f))return v.highlight(o,{language:f,ignoreIllegals:!0}).value}catch{}return V(o)}function Dn(t,o){return Dt(Mo(t,o))}function Mo(t,o){const f=`${Se.value}\0${Hn(t)}\0${t}\0${o}`,v=Ae.get(f);return v!==void 0?(Ae.delete(f),Ae.set(f,v),v):st(Ae,f,Io(t,o),md)}function Ce(t){return _e(t).map(o=>o.kind==="text"?V(o.value):o.kind==="bold"?`<strong class="message-bold-text">${V(o.value)}</strong>`:o.kind==="italic"?`<em class="message-italic-text">${V(o.value)}</em>`:o.kind==="strikethrough"?`<s class="message-strikethrough-text">${V(o.value)}</s>`:o.kind==="file"?`<a class="message-file-link" href="${V(he(o.path))}" target="_blank" rel="noopener noreferrer" title="${V(o.path)}">${V(o.displayPath)}</a>`:o.kind==="url"?`<a class="message-file-link" href="${V(o.href)}" target="_blank" rel="noopener noreferrer" title="${V(o.href)}">${V(o.value)}</a>`:`<code class="message-inline-code">${V(o.value)}</code>`).join("")}function So(t){return t.paragraphs.map(o=>`<div class="message-list-item-text message-list-item-paragraph">${Ce(o)}</div>`).join("")}function ot(t){var v;const o=So(t),f=((v=t.children)==null?void 0:v.map(x=>jn(x)).join(""))??"";return Dt(o+f)}function Wn(t){return t?` style="text-align:${t}"`:""}function jn(t){if(t.kind==="paragraph")return`<p class="message-text">${Ce(t.value)}</p>`;if(t.kind==="heading"){const o=Math.min(6,Math.max(1,Math.trunc(t.level))),f=Yn(o),v=`message-heading ${Qn(o)}`;return`<${f} class="${v}">${Ce(t.value)}</${f}>`}if(t.kind==="blockquote")return`<blockquote class="message-blockquote">${Ce(t.value)}</blockquote>`;if(t.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${t.items.map(f=>`<li class="message-list-item"><div class="message-list-item-content">${ot(f)}</div></li>`).join("")}</ul>`;if(t.kind==="taskList")return`<ul class="message-list message-task-list">${t.items.map(f=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${f.checked?"true":"false"}">${f.checked?"☑":"☐"}</span><div class="message-list-item-text">${Ce(f.text)}</div></li>`).join("")}</ul>`;if(t.kind==="orderedList"){const o=t.items.map(f=>`<li class="message-list-item"><div class="message-list-item-content">${ot(f)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${t.start}">${o}</ol>`}if(t.kind==="table"){const o=t.headers.map((x,p)=>`<th class="message-table-head-cell"${Wn(t.alignments[p]??null)}>${Ce(x)}</th>`).join(""),f=t.rows.map(x=>'<tr class="message-table-body-row">'+x.map((p,S)=>`<td class="message-table-cell"${Wn(t.alignments[S]??null)}>${Ce(p)}</td>`).join("")+"</tr>").join(""),v=f?`<tbody>${f}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${o}</tr></thead>${v}</table></div>`}return t.kind==="codeBlock"?`<div class="message-code-block">${t.language?`<div class="message-code-language">${V(t.language)}</div>`:""}<pre class="message-code-pre"><code class="hljs">${Dn(t.language,t.value)}</code></pre></div>`:t.kind==="thematicBreak"?'<hr class="message-divider">':lt(t.url)?`<video class="message-image-preview message-video-preview message-markdown-image" src="${V(t.url)}" controls preload="metadata"></video>`:`<img class="message-image-preview message-markdown-image" src="${V(t.url)}" alt="${V(t.alt||"Embedded message image")}" loading="lazy">`}function qn(t){const o=`${_.cwd}\0${Se.value}\0${t}`,f=Pe.get(o);if(f&&f.text===t&&f.cwd===_.cwd&&f.highlightVersion===Se.value)return Pe.delete(o),Pe.set(o,f),f.html;const v=as(t).map(p=>jn(p)).join(""),x=Dt(v);return st(Pe,o,{text:t,cwd:_.cwd,highlightVersion:Se.value,html:x},hd).html}function Po(){const t=pe.value,o=vn.value;!t||!o||(t.scrollTop=t.scrollHeight,o.scrollIntoView({block:"end"}))}function Ao(t){return t.scrollHeight-(t.scrollTop+t.clientHeight)<=ud}function Eo(){if(pe.value&&ve.value){at();return}}function at(){pe.value&&Po()}function Rt(){return ve.value}function Nn(){if(!Rt()){et=0,le=0;return}if(at(),et-=1,et<=0){le=0;return}le=requestAnimationFrame(Nn)}function it(t=6){Rt()&&(le&&(cancelAnimationFrame(le),le=0),et=Math.max(t,1),le=requestAnimationFrame(Nn))}function zn(){it(3)}function Un(){ve.value=!0,at(),it(4)}async function Vn(){var x;const t=pe.value;if(!t||!_.hasMorePersistedAbove||ye.value||_.isLoadingPersistedAbove===!0)return;ye.value=!0;const o=_.activeThreadId,f=t.scrollHeight,v=t.scrollTop;try{await((x=_.loadEarlierMessages)==null?void 0:x.call(_,o)),await ct(),_.activeThreadId===o&&(t.scrollTop=v+(t.scrollHeight-f))}finally{ye.value=!1}}n({jumpToLatest:Un});function Fo(){if(!Rt())return;const t=pe.value;if(!t)return;const o=t.querySelectorAll("img.message-image-preview");for(const f of o)f.complete||kn.has(f)||(kn.add(f),f.addEventListener("load",zn,{once:!0}),f.addEventListener("error",zn,{once:!0}))}async function rt(){return qe||(qe=ct().then(()=>new Promise(t=>{xe&&cancelAnimationFrame(xe),xe=requestAnimationFrame(()=>{xe=0,qe=null,Eo(),Fo(),it(),t()})})),qe)}function Bo(){Ne.clear(),ze.clear(),Pe.clear(),Ae.clear()}de(()=>_.messages,async t=>{if(_.isLoading)return;const o=new Set(t.filter(f=>f.messageType==="commandExecution"&&f.commandExecution).map(f=>f.id));d.value=xt(d.value,o),c.value=xt(c.value,o),u.value=xt(u.value,new Set([...Object.keys(Ve.value),...Object.keys(Et.value)])),await rt()}),de(()=>_.messages.some(t=>t.text.includes("```")),t=>{!t||tt.value||lo()},{immediate:!0}),de(wt,(t,o)=>{if(!o||o===t||!c.value.has(o))return;const f=new Set(c.value);f.delete(o),c.value=f}),de(()=>_.pendingRequests,async()=>{_.isLoading||await rt()},{deep:!0}),de(()=>_.liveOverlay,async t=>{t&&ve.value&&(await ct(),at(),it(8))},{deep:!0}),de(()=>_.isLoading,async t=>{t||await rt()}),de(()=>_.activeThreadId,async()=>{ve.value=!0,Me.value="",ye.value=!1,X.value={},ie.value={},re.value={},ke.value=Qt(_.activeThreadId),await rt()},{flush:"post"});function Ro(){const t=pe.value;!t||_.isLoading||(ve.value=Ao(t),t.scrollTop<gd&&!ye.value&&($n.value?xn():_.hasMorePersistedAbove===!0&&Vn()))}const Ot=W(new Set);function Kn(t,o){return`${t}:${o}`}function Oo(t,o){return Ot.value.has(Kn(t,o))}function Ho(t,o){const f=new Set(Ot.value);f.add(Kn(t,o)),Ot.value=f,yn.value+=1}function Gn(t){Me.value=t,Ct.value=lt(t)}function Zn(){Me.value="",Ct.value=!1}const Ht=/\.(mp4|m4v|webm|mov|mkv|ogv|ogg|mpeg|avi)$/iu;function lt(t){const o=t.trim();if(!o)return!1;if(o.startsWith("data:video/"))return!0;try{const f=new URL(o,window.location.href);return Ht.test(f.pathname)?!0:f.pathname==="/codex-local-image"?Ht.test(f.searchParams.get("path")??""):!1}catch{return Ht.test(o)}}return en(()=>{Bo(),xe&&(cancelAnimationFrame(xe),xe=0),le&&(cancelAnimationFrame(le),le=0),oe&&(clearTimeout(oe),oe=null)}),(t,o)=>(r(),l(E,null,[g("section",{class:"conversation-root",onContextmenuCapture:Co},[e.isLoading?(r(),l("p",Yl,k(C(H)("Loading messages...")),1)):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(r(),l("p",Ql,k(C(H)("No messages in this thread yet.")),1)):(r(),l("ul",{key:2,ref_key:"conversationListRef",ref:pe,class:"conversation-list",onScroll:Ro},[io.value?(r(),l("li",ec,[g("button",{type:"button",class:"load-more-button",disabled:ye.value||e.isLoadingPersistedAbove,onClick:Vn},k(ye.value||e.isLoadingPersistedAbove?C(H)("Loading…"):C(H)("Load earlier messages")),9,tc)])):L("",!0),$n.value?(r(),l("li",nc,[g("button",{type:"button",class:"load-more-button",disabled:ye.value,onClick:xn},k(C(H)("Load earlier ({n} turns)",{n:wn.value})),9,sc)])):L("",!0),(r(!0),l(E,null,q(Ns.value,f=>(r(),G(vl,{key:f.key,"turn-key":f.key,warm:f.warm,"warm-items":f.warmItems,request:f.request,"process-items":f.processItems,"final-item":f.finalItem,"file-change-anchor-ids":f.fileChangeAnchorIds},{"warm-card":Re(({warm:v})=>[g("li",{id:St(v.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn"},[g("div",ac,[g("div",ic,[Z(_l,{"user-text":v.userText,"assistant-preview":v.assistantPreview,"tool-count":v.toolCount,expanded:v.expanded,onToggle:x=>zs(v.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],8,oc)]),"file-change":Re(({anchorMessageId:v})=>[g("div",rc,[g("div",lc,[Sn(ae(v))?(r(),G(is,{key:0,summary:ae(v),expanded:go(v),cwd:_.cwd,actionable:Pn(ae(v)),"action-status":Ke(ae(v)),"action-error-text":An(ae(v)),"next-action":Ft(ae(v)),"action-label":En(ae(v)),onToggle:x=>po(v),onOpenDiff:x=>pn(ae(v),x),onRequestAction:x=>Rn(ae(v),x),onRequestFileAction:x=>On(ae(v),x)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):L("",!0)])])]),default:Re(({item:v,section:x})=>[(r(!0),l(E,null,q([v.message],p=>{var S,A,N,z;return r(),l(E,{key:p.id},[Ys(p)?(r(),l("li",cc,[g("div",uc,[g("div",dc,[Z(wr,{label:no(p),running:so(p),"has-outside-content":oo(p)},{default:Re(()=>[(r(!0),l(E,null,q(eo(p),b=>(r(),l(E,{key:to(b)},[b.type==="batch"?(r(),G(al,{key:0,kind:b.kind,messages:b.messages},null,8,["kind","messages"])):(r(!0),l(E,{key:1},q([b.message],R=>(r(),l(E,{key:R.id},[!$t.value.has(R.id)&&!Mn.value.has(R.id)?(r(),l(E,{key:0},[te(R)?(r(),l("div",fc,[(r(!0),l(E,null,q(mn(R),($,j)=>(r(),G(cs,{key:`work-cmd-${$.id}`,command:$,"step-index":j,expanded:un($),compact:dn($),"output-condensed":fn($),onToggle:D=>hn($)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):on(R)?(r(),G(Yt,{key:1,message:R},null,8,["message"])):kt(R)?(r(),G(ls,{key:2,message:R,expanded:nn(R),"content-html":qn(R.text),onToggle:$=>sn(R)},null,8,["message","expanded","content-html","onToggle"])):L("",!0)],64)):L("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])])):!Cn(p)&&!$t.value.has(p.id)&&!Mn.value.has(p.id)&&!(ao(p)&&Xs.value.has(p.turnId??""))?(r(),l("li",{key:1,id:Ks(p),class:U(["conversation-item",{"conversation-item-request":x==="request","conversation-item-process":x==="process"||v.presentation==="process","conversation-item-final":x==="final"||v.presentation==="final-assistant","conversation-item-plan":v.presentation==="plan"}]),"data-role":p.role,"data-message-type":p.messageType||""},[As(p)?(r(),l("div",mc,[g("div",gc,[o[3]||(o[3]=g("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),g("span",null,k(C(H)("Compacting thread context…")),1)])])):Es(p)?(r(),l("div",pc,[g("div",vc,k(C(H)("Context compacted")),1)])):te(p)?(r(),l("div",kc,[g("div",yc,[g("div",bc,[(r(!0),l(E,null,q(mn(p),(b,R)=>(r(),G(cs,{key:`work-cmd-${b.id}`,command:b,"step-index":R,expanded:un(b),compact:dn(b),"output-condensed":fn(b),onToggle:$=>hn(b)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):on(p)?(r(),G(Yt,{key:3,message:p},null,8,["message"])):Qe(p)?(r(),l("div",{key:4,class:"message-row","data-role":p.role,"data-message-type":p.messageType||""},[g("div",{class:"message-stack","data-role":p.role},[g("article",{class:"message-body","data-role":p.role},[Sn(ce(p))?(r(),G(is,{key:0,summary:ce(p),expanded:Rs(p),cwd:_.cwd,actionable:Pn(ce(p)),"action-status":Ke(ce(p)),"action-error-text":An(ce(p)),"next-action":Ft(ce(p)),"action-label":En(ce(p)),onToggle:b=>gn(p),onOpenDiff:b=>pn(ce(p),b),onRequestAction:b=>Rn(ce(p),b),onRequestFileAction:b=>On(ce(p),b)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):L("",!0)],8,xc)],8,$c)],8,wc)):v.presentation==="plan"?(r(),l("div",_c,[g("div",Cc,[g("article",Tc,[g("div",Lc,k(C(H)("Plan")),1),(S=C(Ge)(p))!=null&&S.explanation?(r(),l("p",Ic,k((A=C(Ge)(p))==null?void 0:A.explanation),1)):L("",!0),(N=C(Ge)(p))!=null&&N.steps.length?(r(),l("ol",Mc,[(r(!0),l(E,null,q((z=C(Ge)(p))==null?void 0:z.steps,(b,R)=>(r(),l("li",{key:`${p.id}-plan-${R}`,"data-status":b.status},[g("span",Pc,k(Tn(b.status)),1),g("span",null,k(b.step),1)],8,Sc))),128))])):L("",!0)])])])):(r(),l("div",{key:6,class:U(["message-row",{"message-row-final":v.presentation==="final-assistant"}]),"data-role":p.role,"data-message-type":p.messageType||""},[g("div",{class:"message-stack","data-role":p.role},[g("article",{class:"message-body","data-role":p.role},[p.images&&p.images.length>0?(r(),l("ul",{key:0,class:U(["message-image-list",{"message-generated-image-list":p.messageType==="imageView"}]),"data-role":p.role},[(r(!0),l(E,null,q(p.images,b=>(r(),l("li",{key:b,class:"message-image-item"},[g("button",{class:"message-image-button",type:"button",onClick:R=>Gn(b)},[lt(b)?(r(),l("video",{key:0,class:U(["message-image-preview message-video-preview",{"message-generated-image-preview":p.messageType==="imageView"}]),src:b,controls:"",preload:"metadata"},null,10,Oc)):(r(),l("img",{key:1,class:U(["message-image-preview",{"message-generated-image-preview":p.messageType==="imageView"}]),src:b,alt:p.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,Hc))],8,Rc)]))),128))],10,Bc)):L("",!0),p.fileAttachments&&p.fileAttachments.length>0?(r(),l("div",Dc,[(r(!0),l(E,null,q(p.fileAttachments,b=>(r(),l("span",{key:`${p.id}:${b.path}`,class:"message-file-chip"},[o[4]||(o[4]=g("span",{class:"message-file-chip-icon"},"📄",-1)),g("a",{class:"message-file-link message-file-chip-name",href:he(b.path),target:"_blank",rel:"noopener noreferrer",title:b.path},k(b.label),9,Wc)]))),128))])):L("",!0),p.skills&&p.skills.length>0?(r(),l("div",jc,[(r(!0),l(E,null,q(p.skills,b=>(r(),l("a",{key:`${p.id}:${b.path}`,class:"message-skill-chip",href:he(b.path),title:b.path},[g("span",Nc,k(C(H)("Skill")),1),g("span",zc,k(b.name),1)],8,qc))),128))])):L("",!0),p.text.length>0?(r(),l("article",{key:3,class:"message-card","data-role":p.role},[p.isAutomationRun?(r(),l("div",Vc,[o[5]||(o[5]=g("span",null,"Sent via automation",-1)),p.automationDisplayName?(r(),l("code",Kc,k(p.automationDisplayName),1)):L("",!0)])):L("",!0),p.messageType==="worked"?(r(),l("div",Gc,[g("p",Zc,k(p.text),1)])):kt(p)?(r(),G(ls,{key:2,message:p,expanded:nn(p),"content-html":qn(p.text),onToggle:b=>sn(p)},null,8,["message","expanded","content-html","onToggle"])):zo([p.id,p.text,_.cwd,Se.value,yn.value],()=>(r(),l("div",{key:3,class:"message-text-flow"},[(r(!0),l(E,null,q(Lo(p),(b,R)=>(r(),l(E,{key:`block-${R}`},[b.kind==="paragraph"?(r(),l("p",Jc,[(r(!0),l(E,null,q(_e(b.value),($,j)=>(r(),l(E,{key:`seg-${R}-${j}`},[$.kind==="text"?(r(),l("span",Xc,k($.value),1)):$.kind==="bold"?(r(),l("strong",Yc,k($.value),1)):$.kind==="italic"?(r(),l("em",Qc,k($.value),1)):$.kind==="strikethrough"?(r(),l("s",eu,k($.value),1)):$.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he($.path),target:"_blank",rel:"noopener noreferrer",title:$.path},k($.displayPath),9,tu)):$.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:$.href,target:"_blank",rel:"noopener noreferrer",title:$.href},k($.value),9,nu)):(r(),l("code",su,k($.value),1))],64))),128))])):b.kind==="heading"?(r(),G(Uo(C(Yn)(b.level)),{key:1,class:U(["message-heading",C(Qn)(b.level)])},{default:Re(()=>[(r(!0),l(E,null,q(_e(b.value),($,j)=>(r(),l(E,{key:`heading-seg-${R}-${j}`},[$.kind==="text"?(r(),l("span",ou,k($.value),1)):$.kind==="bold"?(r(),l("strong",au,k($.value),1)):$.kind==="italic"?(r(),l("em",iu,k($.value),1)):$.kind==="strikethrough"?(r(),l("s",ru,k($.value),1)):$.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he($.path),target:"_blank",rel:"noopener noreferrer",title:$.path},k($.displayPath),9,lu)):$.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:$.href,target:"_blank",rel:"noopener noreferrer",title:$.href},k($.value),9,cu)):(r(),l("code",uu,k($.value),1))],64))),128))]),_:2},1032,["class"])):b.kind==="blockquote"?(r(),l("blockquote",du,[(r(!0),l(E,null,q(_e(b.value),($,j)=>(r(),l(E,{key:`quote-seg-${R}-${j}`},[$.kind==="text"?(r(),l("span",fu,k($.value),1)):$.kind==="bold"?(r(),l("strong",hu,k($.value),1)):$.kind==="italic"?(r(),l("em",mu,k($.value),1)):$.kind==="strikethrough"?(r(),l("s",gu,k($.value),1)):$.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he($.path),target:"_blank",rel:"noopener noreferrer",title:$.path},k($.displayPath),9,pu)):$.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:$.href,target:"_blank",rel:"noopener noreferrer",title:$.href},k($.value),9,vu)):(r(),l("code",ku,k($.value),1))],64))),128))])):b.kind==="unorderedList"?(r(),l("ul",yu,[(r(!0),l(E,null,q(b.items,($,j)=>(r(),l("li",{key:`ul-${R}-${j}`,class:"message-list-item"},[g("div",{class:"message-list-item-content",innerHTML:ot($)},null,8,bu)]))),128))])):b.kind==="taskList"?(r(),l("ul",wu,[(r(!0),l(E,null,q(b.items,($,j)=>(r(),l("li",{key:`task-${R}-${j}`,class:"message-task-item"},[g("span",{class:"message-task-checkbox","data-checked":$.checked},k($.checked?"☑":"☐"),9,$u),g("div",xu,[(r(!0),l(E,null,q(_e($.text),(D,Te)=>(r(),l(E,{key:`task-seg-${R}-${j}-${Te}`},[D.kind==="text"?(r(),l("span",_u,k(D.value),1)):D.kind==="bold"?(r(),l("strong",Cu,k(D.value),1)):D.kind==="italic"?(r(),l("em",Tu,k(D.value),1)):D.kind==="strikethrough"?(r(),l("s",Lu,k(D.value),1)):D.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he(D.path),target:"_blank",rel:"noopener noreferrer",title:D.path},k(D.displayPath),9,Iu)):D.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:D.href,target:"_blank",rel:"noopener noreferrer",title:D.href},k(D.value),9,Mu)):(r(),l("code",Su,k(D.value),1))],64))),128))])]))),128))])):b.kind==="orderedList"?(r(),l("ol",{key:5,class:"message-list message-list-ordered",start:b.start},[(r(!0),l(E,null,q(b.items,($,j)=>(r(),l("li",{key:`ol-${R}-${j}`,class:"message-list-item"},[g("div",{class:"message-list-item-content",innerHTML:ot($)},null,8,Au)]))),128))],8,Pu)):b.kind==="table"?(r(),l("div",Eu,[g("table",Fu,[g("thead",null,[g("tr",null,[(r(!0),l(E,null,q(b.headers,($,j)=>(r(),l("th",{key:`th-${R}-${j}`,class:"message-table-head-cell",style:Ze({textAlign:b.alignments[j]??"left"})},[(r(!0),l(E,null,q(_e($),(D,Te)=>(r(),l(E,{key:`th-seg-${R}-${j}-${Te}`},[D.kind==="text"?(r(),l("span",Bu,k(D.value),1)):D.kind==="bold"?(r(),l("strong",Ru,k(D.value),1)):D.kind==="italic"?(r(),l("em",Ou,k(D.value),1)):D.kind==="strikethrough"?(r(),l("s",Hu,k(D.value),1)):D.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he(D.path),target:"_blank",rel:"noopener noreferrer",title:D.path},k(D.displayPath),9,Du)):D.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:D.href,target:"_blank",rel:"noopener noreferrer",title:D.href},k(D.value),9,Wu)):(r(),l("code",ju,k(D.value),1))],64))),128))],4))),128))])]),b.rows.length>0?(r(),l("tbody",qu,[(r(!0),l(E,null,q(b.rows,($,j)=>(r(),l("tr",{key:`tr-${R}-${j}`,class:"message-table-body-row"},[(r(!0),l(E,null,q($,(D,Te)=>(r(),l("td",{key:`td-${R}-${j}-${Te}`,class:"message-table-cell",style:Ze({textAlign:b.alignments[Te]??"left"})},[(r(!0),l(E,null,q(_e(D),(K,Do)=>(r(),l(E,{key:`td-seg-${R}-${j}-${Te}-${Do}`},[K.kind==="text"?(r(),l("span",Nu,k(K.value),1)):K.kind==="bold"?(r(),l("strong",zu,k(K.value),1)):K.kind==="italic"?(r(),l("em",Uu,k(K.value),1)):K.kind==="strikethrough"?(r(),l("s",Vu,k(K.value),1)):K.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:he(K.path),target:"_blank",rel:"noopener noreferrer",title:K.path},k(K.displayPath),9,Ku)):K.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:K.href,target:"_blank",rel:"noopener noreferrer",title:K.href},k(K.value),9,Gu)):(r(),l("code",Zu,k(K.value),1))],64))),128))],4))),128))]))),128))])):L("",!0)])])):b.kind==="codeBlock"?(r(),l("div",Ju,[b.language?(r(),l("div",Xu,k(b.language),1)):L("",!0),g("pre",Yu,[g("code",{class:"hljs",innerHTML:Dn(b.language,b.value)},null,8,Qu)])])):b.kind==="thematicBreak"?(r(),l("hr",ed)):Oo(p.id,R)?(r(),l("p",td,k(b.markdown),1)):(r(),l("button",{key:10,class:"message-image-button",type:"button",onClick:$=>Gn(b.url)},[lt(b.url)?(r(),l("video",{key:0,class:"message-image-preview message-video-preview message-markdown-image",src:b.url,controls:"",preload:"metadata"},null,8,sd)):(r(),l("img",{key:1,class:"message-image-preview message-markdown-image",src:b.url,alt:b.alt||"Embedded message image",loading:"lazy",onError:$=>Ho(p.id,R)},null,40,od))],8,nd))],64))),128))])),o,0),Fs(p)?(r(),l("a",{key:4,class:"turn-error-feedback",href:C(we),onClick:b=>Ie(b,p.text)},k(C(H)("Send feedback")),9,ad)):L("",!0)],8,Uc)):L("",!0),Z(hr,{role:p.role,"show-edit":wo(p),"show-fork":mo(p),"show-copy":uo(p)||fo(p),copied:$e.value===p.id,onEdit:b=>$o(p.id),onFork:b=>bo(p.id),onCopy:b=>p.role==="user"?ho(p.id):yo(p.id)},null,8,["role","show-edit","show-fork","show-copy","copied","onEdit","onFork","onCopy"])],8,Fc)],8,Ec)],10,Ac))],10,hc)):L("",!0)],64)}),128))]),_:2},1032,["turn-key","warm","warm-items","request","process-items","final-item","file-change-anchor-ids"]))),128)),e.liveOverlay?(r(),G(er,{key:2,overlay:e.liveOverlay,"feedback-mailto":C(we)},null,8,["overlay","feedback-mailto"])):L("",!0),g("li",{ref_key:"bottomAnchorRef",ref:vn,class:"conversation-bottom-anchor"},null,512)],544)),Z(Lr,{anchors:_n.value,"active-turn":Us.value,onJump:Gs},null,8,["anchors","active-turn"]),ro.value?(r(),l("button",{key:3,type:"button",class:"jump-to-latest-button",title:C(H)("Jump to latest"),"aria-label":C(H)("Jump to latest output"),onClick:Un},[Z(Vo,{class:"icon-svg jump-to-latest-icon"})],8,id)):L("",!0),Me.value.length>0?(r(),l("div",{key:4,class:"image-modal-backdrop",onClick:Zn},[g("div",{class:"image-modal-content",onClick:o[1]||(o[1]=De(()=>{},["stop"]))},[g("button",{class:"image-modal-close",type:"button","aria-label":C(H)("Close image preview"),onClick:Zn},[Z(ps,{class:"icon-svg"})],8,rd),Ct.value?(r(),l("video",{key:0,class:"image-modal-image",src:Me.value,controls:"",autoplay:""},null,8,ld)):(r(),l("img",{key:1,class:"image-modal-image",src:Me.value,alt:C(H)("Expanded message image")},null,8,cd))])])):L("",!0),Z(Ri,{visible:I.value,x:F.value,y:T.value,"browse-url":P.value,"edit-url":w.value,onClose:To},null,8,["visible","x","y","browse-url","edit-url"]),Z(mi,{change:Bn.value,changes:Fn.value,lines:ko.value,"is-mobile":C(B),"is-file-list-open":y.value,cwd:_.cwd,onClose:Os,onSelectChange:Ws,onToggleFileList:Hs,onCloseFileList:Ds},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd"])],32),Z(Ma,{visible:fe.value!==null,title:js.value,message:qs.value,"confirm-label":"Confirm",danger:"",onConfirm:xo,onCancel:o[2]||(o[2]=f=>fe.value=null)},null,8,["visible","title","message"])],64))}}),yd=J(pd,[["__scopeId","data-v-f0480d83"]]);export{yd as default};
|