codex-mobile-re 0.1.129 → 0.1.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AutomationsPanel-DNsTBfFe.js → AutomationsPanel-BNvu7EM1.js} +1 -1
- package/dist/assets/{DirectoryHub-DjzGaPq6.js → DirectoryHub-DttPWXKw.js} +1 -1
- package/dist/assets/{QueuedMessages-DNVDZvsM.js → QueuedMessages-CxPRR-jw.js} +1 -1
- package/dist/assets/ReviewPane-CjYAzq9l.js +1 -0
- package/dist/assets/{RightFilePreview-DIz4AIh6.js → RightFilePreview-CGeKHIfD.js} +1 -1
- package/dist/assets/{RightFilesPanel-C7leH782.js → RightFilesPanel-DHKw1OdD.js} +1 -1
- package/dist/assets/{RightGitPanel-BaFysyCQ.js → RightGitPanel-C3iEraeJ.js} +2 -2
- package/dist/assets/{SettingsDialog-BRMjc7tX.js → SettingsDialog-CEgc9uDb.js} +3 -3
- package/dist/assets/ThreadConversation-BhhCq0PN.js +39 -0
- package/dist/assets/{ThreadConversation-BEc1XQXz.css → ThreadConversation-D1JHRys4.css} +1 -1
- package/dist/assets/ThreadPendingRequestPanel-GN61XTlE.js +1 -0
- package/dist/assets/{ThreadTerminalPanel-BPYLKihX.js → ThreadTerminalPanel-DcGHG7Mb.js} +1 -1
- package/dist/assets/index-Bcgrj03j.js +83 -0
- package/dist/assets/{index-DI_rCYF6.css → index-DthBwStG.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/ReviewPane-DLogJNGk.js +0 -1
- package/dist/assets/ThreadConversation-BB19p4J3.js +0 -39
- package/dist/assets/ThreadPendingRequestPanel-rVtQUq_G.js +0 -1
- package/dist/assets/index-rc4ZsEIH.js +0 -83
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as Je,J as Ze,r as y,x as G,L as Qe,R as et,o as tt,f as o,h as at,p as J,s as ke,j as a,n as se,u as c,w as ne,t as s,i as r,k as w,I as st,Y as nt,F as C,l as R,y as U,m as N,q as ge,T as it,v as lt,c as b,Z as ot,$ as rt,a0 as ut,_ as dt}from"./index-rc4ZsEIH.js";const ct={class:"review-pane-header"},vt={class:"review-pane-heading"},pt={class:"review-pane-eyebrow"},ht={class:"review-pane-title"},ft={class:"review-pane-header-actions"},wt=["aria-label"],mt={class:"review-pane-toolbar"},_t={class:"review-pane-toolbar-controls"},yt={key:0,class:"review-pane-control-cluster"},bt={class:"review-pane-control-label"},kt={class:"review-pane-segmented"},gt=["data-active"],Ct=["data-active","disabled"],Bt={key:1,class:"review-pane-control-cluster"},Ft={class:"review-pane-control-label"},St={key:2,class:"review-pane-control-cluster"},It={class:"review-pane-control-label"},Lt={class:"review-pane-segmented"},xt=["data-active"],$t=["data-active"],At={class:"review-pane-toolbar-actions"},Pt=["disabled"],Rt={key:1,class:"review-pane-meta"},Et={class:"review-pane-summary-pill review-pane-summary-pill-add"},Tt={class:"review-pane-summary-pill review-pane-summary-pill-remove"},Nt={key:0},Mt={key:1},Dt={key:2},Wt={class:"review-pane-content"},zt={key:0,class:"review-pane-empty"},Vt={class:"review-pane-empty-title"},Gt={key:1,class:"review-pane-empty"},Ut={class:"review-pane-empty-title"},Ht={class:"review-pane-empty-text"},Ot=["disabled"],Kt={key:2,class:"review-pane-empty"},Xt={class:"review-pane-empty-title"},jt={class:"review-pane-empty-text"},Yt={key:0,class:"review-pane-bulk-actions"},qt=["disabled","onClick"],Jt={key:1,class:"review-pane-empty"},Zt={class:"review-pane-empty-title"},Qt={class:"review-pane-empty-text"},ea={key:0,class:"review-pane-file-list"},ta=["data-expanded","onClick"],aa=["data-expanded"],sa={class:"review-pane-tree-folder-name"},na={class:"review-pane-tree-folder-count"},ia=["data-active","title","onClick"],la={class:"review-pane-file-meta-row"},oa={class:"review-pane-file-path"},ra={class:"review-pane-file-delta"},ua={class:"review-pane-delta-add"},da={class:"review-pane-delta-remove"},ca=["data-operation"],va={class:"review-pane-diff"},pa={class:"review-pane-file-header"},ha={class:"review-pane-file-header-main"},fa={class:"review-pane-file-title"},wa={class:"review-pane-file-subtitle"},ma={key:0,class:"review-pane-row-actions"},_a=["disabled","onClick"],ya={key:0,class:"review-pane-raw-diff"},ba={key:1,class:"review-pane-hunks"},ka=["data-active","onClick"],ga={class:"review-pane-hunk-header"},Ca={class:"review-pane-hunk-title"},Ba={class:"review-pane-hunk-meta"},Fa={key:0,class:"review-pane-row-actions"},Sa=["disabled","onClick"],Ia={class:"review-pane-lines"},La=["data-kind"],xa={class:"review-pane-line-number"},$a={class:"review-pane-line-number"},Aa={class:"review-pane-line-marker"},Pa={class:"review-pane-line-code"},Ra={class:"review-pane-sheet-header"},Ea={class:"review-pane-sheet-title"},Ta={class:"review-pane-sheet-count"},Na={class:"review-pane-sheet-list"},Ma=["data-expanded","onClick"],Da=["data-expanded"],Wa={class:"review-pane-tree-folder-name"},za={class:"review-pane-tree-folder-count"},Va=["data-active","title","onClick"],Ga={class:"review-pane-file-meta-row"},Ua={class:"review-pane-file-path"},Ha={class:"review-pane-file-delta"},Oa={class:"review-pane-delta-add"},Ka={class:"review-pane-delta-remove"},Xa=["data-operation"],Ce="codex-web-local.review-pane-file-list-width.v1",ja=220,Ya=420,Be=288,qa=Je({__name:"ReviewPane",props:{threadId:{},cwd:{},isThreadInProgress:{type:Boolean},initialFilePath:{},commitSha:{}},emits:["close"],setup(Fe,{emit:Se}){const g=Fe,Ie=Se,{isMobile:B}=Ze(),{t:l}=lt(),m=y("workspace"),F=y("unstaged"),d=y(null),L=y(""),H=y(!1),x=y(""),I=y(""),O=y(!1),Z=y(!1),E=y(!1),K=y(!1),M=y(""),$=y(""),X=y("");let j=null,A=null;const k=b(()=>{var e,t;return((e=d.value)==null?void 0:e.files.find(u=>u.id===x.value))??((t=d.value)==null?void 0:t.files[0])??null}),T=y({}),S=b(()=>{var e;return!!((e=g.commitSha)!=null&&e.trim())}),Le=b(()=>{var e;return(((e=d.value)==null?void 0:e.baseBranchOptions)??[]).map(t=>({value:t,label:t}))}),xe=b(()=>{var e;return((e=d.value)==null?void 0:e.scope)==="commit"||S.value?l("No file changes in this commit."):m.value==="workspace"?l("Your current workspace is clean."):l("No merge diff found against the base branch.")});function ie(e){return e.trim().replace(/\\/g,"/")}function $e(e){const t=ie(e);return!t||!d.value?null:d.value.files.find(u=>[u.path,u.absolutePath,u.previousPath,u.previousAbsolutePath].some(v=>typeof v=="string"&&ie(v)===t))??null}function le(){const e=$e(g.initialFilePath??"");return e?(te(e.id),!0):!1}const Ae=b(()=>{var e,t;return(e=d.value)!=null&&e.isGitRepo?S.value?d.value.commitSha?`${l("Commit")} ${ye(d.value.commitSha)}`:l("Commit"):m.value==="workspace"?F.value==="staged"?l("Staged changes"):l("Workspace changes"):(t=d.value)!=null&&t.baseBranch?`${l("Against")} ${d.value.baseBranch}`:l("Base branch"):l("Repository review")}),oe=b(()=>{var e;return!S.value&&m.value==="workspace"&&((e=d.value)==null?void 0:e.isGitRepo)===!0&&d.value.files.length>0}),re=b(()=>oe.value&&!E.value),Pe=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage all")}]:[{value:"stage",label:l("Stage all")},{value:"revert",label:l("Revert all")}]),Re=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage file")}]:[{value:"stage",label:l("Stage file")},{value:"revert",label:l("Revert file")}]),Ee=b(()=>F.value==="staged"?[{value:"unstage",label:l("Unstage hunk")}]:[{value:"stage",label:l("Stage hunk")},{value:"revert",label:l("Revert hunk")}]),ue=b(()=>$.value||M.value||X.value),Te=b(()=>!!($.value||M.value)),Y=y(De()),Ne=b(()=>{const e={};return B.value||(e["--review-file-list-width"]=`${Y.value}px`),e}),de=b(()=>{var e;return Ge(((e=d.value)==null?void 0:e.files)??[],T.value)}),ce=b(()=>de.value.nodes),Me=b(()=>de.value.folderIdsByFileId);function Q(e){return Number.isFinite(e)?Math.min(Ya,Math.max(ja,Math.round(e))):Be}function De(){if(typeof window>"u")return Be;const e=window.localStorage.getItem(Ce),t=e?Number(e):Number.NaN;return Q(t)}function We(e){typeof window>"u"||window.localStorage.setItem(Ce,String(Q(e)))}function ze(e){if(B.value)return;e.preventDefault(),A==null||A();const t=e.clientX,u=Y.value,v=i=>{Y.value=Q(u+(i.clientX-t))},p=()=>{window.removeEventListener("pointermove",v),window.removeEventListener("pointerup",n),A=null},n=()=>{p(),We(Y.value)};window.addEventListener("pointermove",v),window.addEventListener("pointerup",n),A=p}function Ve(e){return e==="add"?"+":e==="remove"?"-":e==="hunk"?"@@":" "}function ve(e){const t=e.split("/").filter(Boolean);return t[t.length-1]??e}function pe(e,t){return e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"})}function Ge(e,t){const u={folders:new Map,files:[]},v={};for(const f of e){const _=f.path.split("/").filter(Boolean),W=_.pop()??f.path;let h=u,P="";const be=[];for(const[qe,z]of _.entries()){P=P?`${P}/${z}`:z;let V=h.folders.get(z);V||(V={id:P,name:z,depth:qe,folders:new Map,files:[]},h.folders.set(z,V)),h=V,be.push(V.id)}h.files.push({file:f,name:W,depth:_.length}),v[f.id]=be}const p=[],n=f=>f.files.length+Array.from(f.folders.values()).reduce((_,W)=>_+n(W),0),i=f=>{const _=Array.from(f.folders.values()).sort((h,P)=>pe(h.name,P.name)),W=[...f.files].sort((h,P)=>pe(h.name,P.name));for(const h of _)p.push({kind:"folder",treeKey:`folder:${h.id}`,id:h.id,name:h.name,depth:h.depth,fileCount:n(h)}),t[h.id]!==!1&&i(h);for(const h of W)p.push({kind:"file",treeKey:`file:${h.file.id}`,id:h.file.id,name:h.name,depth:h.depth,file:h.file})};return i(u),{nodes:p,folderIdsByFileId:v}}function D(e){return T.value[e]!==!1}function he(e){T.value={...T.value,[e]:!D(e)}}function fe(e){const t=Me.value[e]??[];if(t.length===0)return;const u={...T.value};let v=!1;for(const p of t)u[p]===!1&&(u[p]=!0,v=!0);v&&(T.value=u)}function we(e){const t=B.value?8:10,u=B.value?12:14;return{paddingLeft:`${t+e*u}px`}}function me(){return{paddingLeft:B.value?"8px":"10px"}}function ee(e){return l(e==="add"?"Added":e==="delete"?"Deleted":e==="rename"?"Renamed":"Modified")}function Ue(e){const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null;return typeof(t==null?void 0:t.threadId)=="string"?t.threadId:""}async function q(){var e,t,u,v;if(g.cwd.trim()){Z.value=!0,M.value="";try{const p=m.value==="baseBranch"?L.value.trim():"",n=((e=g.commitSha)==null?void 0:e.trim())??"",i=await ot(g.cwd,S.value?"commit":m.value,F.value,p||null,n||null);if(i.baseBranchOptions.length>0){const _=i.baseBranch??i.baseBranchOptions[0]??"";L.value!==_&&(H.value=!0,L.value=_)}else L.value!==""&&(H.value=!0,L.value="");d.value=i;const f=i.files.some(_=>_.id===x.value);!le()&&!f&&(x.value=((t=i.files[0])==null?void 0:t.id)??"",I.value=((v=(u=i.files[0])==null?void 0:u.hunks[0])==null?void 0:v.id)??"")}catch(p){M.value=p instanceof Error?p.message:"Failed to load review snapshot"}finally{Z.value=!1}}}async function _e(){await q()}function He(){Ie("close")}function te(e){var u,v;fe(e),x.value=e;const t=((u=d.value)==null?void 0:u.files.find(p=>p.id===e))??null;I.value=((v=t==null?void 0:t.hunks[0])==null?void 0:v.id)??"",B.value&&(O.value=!1)}function ye(e){return e.trim().slice(0,7)}async function ae(e,t,u=""){var v,p,n;if(d.value){E.value=!0,$.value="";try{const i=await ut({cwd:g.cwd,scope:m.value,workspaceView:F.value,action:e,level:t,patch:u});d.value=i,i.files.some(_=>_.id===x.value)||(x.value=((v=i.files[0])==null?void 0:v.id)??"",I.value=((n=(p=i.files[0])==null?void 0:p.hunks[0])==null?void 0:n.id)??"")}catch(i){$.value=i instanceof Error?i.message:"Failed to apply review action"}finally{E.value=!1}}}async function Oe(e){await ae(e,"all")}async function Ke(e,t){await ae(e,"file",t.diff)}async function Xe(e,t){I.value=t.id,await ae(e,"hunk",t.patch)}async function je(){if(g.cwd.trim()){K.value=!0,$.value="";try{await rt(g.cwd),await q()}catch(e){$.value=e instanceof Error?e.message:"Failed to initialize Git"}finally{K.value=!1}}}function Ye(e){if(Ue(e)!==g.threadId)return;const t=e.params!==null&&typeof e.params=="object"&&!Array.isArray(e.params)?e.params:null,u=(t==null?void 0:t.item)!==null&&typeof(t==null?void 0:t.item)=="object"&&!Array.isArray(t.item)?t.item:null,v=typeof(u==null?void 0:u.type)=="string"?u.type:"";if(e.method==="item/started"&&v==="enteredReviewMode"){X.value=typeof(u==null?void 0:u.review)=="string"?u.review:"Review in progress";return}e.method==="item/completed"&&v==="exitedReviewMode"&&(X.value="")}return G(()=>[g.threadId,g.cwd,g.commitSha],()=>{S.value&&(m.value="workspace"),x.value="",I.value="",$.value="",X.value="",_e()},{immediate:!0}),G(()=>[g.initialFilePath,g.commitSha],()=>{le()}),G(()=>[m.value,F.value],()=>{x.value="",I.value="",$.value="",M.value="",q()}),G(L,(e,t)=>{if(H.value){H.value=!1;return}m.value==="baseBranch"&&(!e||e===t||q())}),G(k,e=>{var t;e&&(fe(e.id),e.hunks.some(u=>u.id===I.value)||(I.value=((t=e.hunks[0])==null?void 0:t.id)??""))}),Qe(()=>{j=et(Ye)}),tt(()=>{j&&(j(),j=null),A==null||A()}),(e,t)=>(o(),at(it,{to:"body"},[J(ge,{name:"review-pane-modal"},{default:ke(()=>{var u,v,p;return[a("div",{class:se(["review-pane-backdrop",{"is-mobile":c(B)}]),onClick:He},[a("section",{class:se(["review-pane",{"is-mobile":c(B)}]),onPointerdown:t[9]||(t[9]=ne(()=>{},["stop"])),onClick:t[10]||(t[10]=ne(()=>{},["stop"]))},[a("header",ct,[a("div",vt,[a("p",pt,s(c(l)("Review")),1),a("p",ht,s(Ae.value),1)]),a("div",ft,[c(B)&&((u=d.value)!=null&&u.files.length)?(o(),r("button",{key:0,type:"button",class:"review-pane-mobile-files-button",onClick:t[0]||(t[0]=n=>O.value=!0)},s(c(l)("Files")),1)):w("",!0),a("button",{type:"button",class:"review-pane-close","aria-label":c(l)("Close review pane"),onClick:t[1]||(t[1]=n=>e.$emit("close"))},[J(st,{class:"icon-svg"})],8,wt)])]),a("div",mt,[a("div",_t,[S.value?w("",!0):(o(),r("div",yt,[a("span",bt,s(c(l)("Compare")),1),a("div",kt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="workspace",onClick:t[2]||(t[2]=n=>m.value="workspace")},s(c(l)("Workspace")),9,gt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-scope","data-active":m.value==="baseBranch",disabled:!((v=d.value)!=null&&v.baseBranch),onClick:t[3]||(t[3]=n=>m.value="baseBranch")},s(c(l)("Base branch")),9,Ct)])])),!S.value&&m.value==="baseBranch"&&((p=d.value)!=null&&p.baseBranchOptions.length)?(o(),r("div",Bt,[a("span",Ft,s(c(l)("Branch")),1),J(nt,{modelValue:L.value,"onUpdate:modelValue":t[4]||(t[4]=n=>L.value=n),class:"review-pane-branch-dropdown",options:Le.value,placeholder:c(l)("Branch"),"enable-search":"","search-placeholder":c(l)("Search branches...")},null,8,["modelValue","options","placeholder","search-placeholder"])])):w("",!0),!S.value&&m.value==="workspace"?(o(),r("div",St,[a("span",It,s(c(l)("Changes")),1),a("div",Lt,[a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="unstaged",onClick:t[5]||(t[5]=n=>F.value="unstaged")},s(c(l)("Unstaged")),9,xt),a("button",{type:"button",class:"review-pane-segmented-button review-pane-view","data-active":F.value==="staged",onClick:t[6]||(t[6]=n=>F.value="staged")},s(c(l)("Staged")),9,$t)])])):w("",!0)]),a("div",At,[a("button",{type:"button",class:"review-pane-refresh",disabled:Z.value,onClick:_e},s(c(l)("Refresh")),9,Pt)])]),ue.value?(o(),r("div",{key:0,class:se(["review-pane-banner",{"is-error":Te.value}])},s(ue.value),3)):w("",!0),d.value?(o(),r("div",Rt,[a("span",null,s(d.value.summary.fileCount)+" "+s(c(l)("files")),1),a("span",Et,"+"+s(d.value.summary.addedLineCount),1),a("span",Tt,"-"+s(d.value.summary.removedLineCount),1),d.value.headBranch?(o(),r("span",Nt,s(d.value.headBranch),1)):w("",!0),S.value&&d.value.commitSha?(o(),r("span",Mt,s(ye(d.value.commitSha)),1)):w("",!0),!S.value&&m.value==="baseBranch"&&d.value.baseBranch?(o(),r("span",Dt,"vs "+s(d.value.baseBranch),1)):w("",!0)])):w("",!0),a("div",Wt,[d.value?d.value.isGitRepo?!S.value&&m.value==="baseBranch"&&!d.value.baseBranch?(o(),r("div",Kt,[a("p",Xt,s(c(l)("Base branch unavailable")),1),a("p",jt,s(c(l)("Could not resolve `origin/HEAD`, `main`, or `master` for this repository.")),1)])):(o(),r(C,{key:3},[oe.value?(o(),r("div",Yt,[(o(!0),r(C,null,R(Pe.value,n=>(o(),r("button",{key:n.value,type:"button",class:"review-pane-bulk-button",disabled:E.value,onClick:i=>Oe(n.value)},s(n.label),9,qt))),128))])):w("",!0),d.value.files.length?(o(),r("div",{key:2,class:"review-pane-main",style:U(Ne.value)},[c(B)?w("",!0):(o(),r("aside",ea,[(o(!0),r(C,null,R(ce.value,n=>{var i;return o(),r(C,{key:n.treeKey},[n.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder",style:U(we(n.depth)),"data-expanded":D(n.id),onClick:f=>he(n.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(n.id)},null,8,aa),a("span",sa,s(n.name),1),a("span",na,s(n.fileCount),1)],12,ta)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((i=k.value)==null?void 0:i.id)===n.file.id,title:n.file.path,onClick:f=>te(n.file.id)},[a("span",la,[a("span",oa,[N(s(n.name)+" ",1),n.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(n.file.previousPath)),1)],64)):w("",!0)]),a("span",ra,[a("span",ua,"+"+s(n.file.addedLineCount),1),t[11]||(t[11]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",da,"-"+s(n.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":n.file.operation},s(ee(n.file.operation)),9,ca)],12,ia))],64)}),128))])),c(B)?w("",!0):(o(),r("div",{key:1,class:"review-pane-resizer",role:"separator","aria-orientation":"vertical","aria-label":"Resize file list",onPointerdown:ze},null,32)),a("section",va,[k.value?(o(),r(C,{key:0},[a("div",pa,[a("div",ha,[a("p",fa,[N(s(k.value.path)+" ",1),k.value.previousPath?(o(),r(C,{key:0},[N(" ← "+s(k.value.previousPath),1)],64)):w("",!0)]),a("p",wa,s(ee(k.value.operation))+" · +"+s(k.value.addedLineCount)+" / -"+s(k.value.removedLineCount),1)]),re.value?(o(),r("div",ma,[(o(!0),r(C,null,R(Re.value,n=>(o(),r("button",{key:`${k.value.id}:${n.value}`,type:"button",class:"review-pane-row-button",disabled:E.value,onClick:i=>Ke(n.value,k.value)},s(n.label),9,_a))),128))])):w("",!0)]),k.value.hunks.length===0?(o(),r("div",ya,[a("pre",null,s(k.value.diff||"No unified diff available."),1)])):(o(),r("div",ba,[(o(!0),r(C,null,R(k.value.hunks,n=>(o(),r("article",{key:n.id,class:"review-pane-hunk","data-active":I.value===n.id,onClick:i=>I.value=n.id},[a("div",ga,[a("div",null,[a("p",Ca,s(n.header),1),a("p",Ba,"+"+s(n.addedLineCount)+" / -"+s(n.removedLineCount),1)]),re.value?(o(),r("div",Fa,[(o(!0),r(C,null,R(Ee.value,i=>(o(),r("button",{key:`${n.id}:${i.value}`,type:"button",class:"review-pane-row-button",disabled:E.value,onClick:f=>Xe(i.value,n)},s(i.label),9,Sa))),128))])):w("",!0)]),a("div",Ia,[(o(!0),r(C,null,R(n.lines,i=>(o(),r("div",{key:i.key,class:"review-pane-line","data-kind":i.kind},[a("span",xa,s(i.oldLine??""),1),a("span",$a,s(i.newLine??""),1),a("span",Aa,s(Ve(i.kind)),1),a("code",Pa,s(i.text||" "),1)],8,La))),128))])],8,ka))),128))]))],64)):w("",!0)])],4)):(o(),r("div",Jt,[a("p",Zt,s(c(l)("No changes in this scope")),1),a("p",Qt,s(xe.value),1)]))],64)):(o(),r("div",Gt,[a("p",Ut,s(c(l)("This folder is not a Git repository")),1),a("p",Ht,s(c(l)("Initialize Git to review local changes and run Codex review.")),1),a("button",{type:"button",class:"review-pane-primary-cta",disabled:K.value,onClick:je},s(K.value?c(l)("Initializing…"):c(l)("Initialize Git")),9,Ot)])):(o(),r("div",zt,[a("p",Vt,s(c(l)("Loading review state")),1)]))]),J(ge,{name:"review-pane-sheet"},{default:ke(()=>{var n;return[c(B)&&O.value&&((n=d.value)!=null&&n.files.length)?(o(),r("div",{key:0,class:"review-pane-sheet-backdrop",onClick:t[8]||(t[8]=i=>O.value=!1)},[a("div",{class:"review-pane-sheet",onClick:t[7]||(t[7]=ne(()=>{},["stop"]))},[t[13]||(t[13]=a("div",{class:"review-pane-sheet-handle","aria-hidden":"true"},null,-1)),a("div",Ra,[a("p",Ea,s(c(l)("Changed files")),1),a("p",Ta,s(d.value.files.length),1)]),a("div",Na,[(o(!0),r(C,null,R(ce.value,i=>{var f;return o(),r(C,{key:`sheet:${i.treeKey}`},[i.kind==="folder"?(o(),r("button",{key:0,type:"button",class:"review-pane-tree-folder review-pane-tree-folder-sheet",style:U(we(i.depth)),"data-expanded":D(i.id),onClick:_=>he(i.id)},[a("span",{class:"review-pane-tree-caret","data-expanded":D(i.id)},null,8,Da),a("span",Wa,s(i.name),1),a("span",za,s(i.fileCount),1)],12,Ma)):(o(),r("button",{key:1,type:"button",class:"review-pane-file review-pane-tree-file",style:U(me()),"data-active":((f=k.value)==null?void 0:f.id)===i.file.id,title:i.file.path,onClick:_=>te(i.file.id)},[a("span",Ga,[a("span",Ua,[N(s(i.name)+" ",1),i.file.previousPath?(o(),r(C,{key:0},[N(" ← "+s(ve(i.file.previousPath)),1)],64)):w("",!0)]),a("span",Ha,[a("span",Oa,"+"+s(i.file.addedLineCount),1),t[12]||(t[12]=a("span",{class:"review-pane-delta-separator"},"/",-1)),a("span",Ka,"-"+s(i.file.removedLineCount),1)])]),a("span",{class:"review-pane-file-op","data-operation":i.file.operation},s(ee(i.file.operation)),9,Xa)],12,Va))],64)}),128))])])])):w("",!0)]}),_:1})],34)],2)]}),_:1})]))}}),Za=dt(qa,[["__scopeId","data-v-f6ce2c16"]]);export{Za as default};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{c as P,r as U,g as To,o as $t,a as kt,b as En,d as tt,e as oe,f as l,h as se,i as d,w as ze,j as m,t as y,n as te,k as S,T as Xn,_ as ne,u as f,F as j,l as K,m as xe,p as ee,I as Qn,q as _o,s as je,v as me,x as Te,y as nt,z as es,A as Io,B as Ee,C as Lo,D as ts,E as Ut,G as Mo,H as So,J as Ao,K as gt,L as Fo,M as Po,N as Eo,O as Bo,P as Ro,Q as Oo}from"./index-rc4ZsEIH.js";import{s as Wt}from"./sanitizeHtml-Bd3No2dT.js";function Do(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 t=e.startsWith("/"),n=/^[A-Za-z]:[\\/]/u.test(e),o=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return t||n||o||/^[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 yt(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function Ve(e){return e.replace(/\\/gu,"/")}function ns(e){if(!e.startsWith("file://"))return e;let t=e.replace(/^file:\/\//u,"");try{t=decodeURIComponent(t)}catch{}return/^\/[A-Za-z]:\//u.test(t)&&(t=t.slice(1)),t}function Ho(e){const t=Ve(e),n=t.match(/^\/Users\/([^/]+)/u);if(n)return`/Users/${n[1]}`;const o=t.match(/^\/home\/([^/]+)/u);return o?`/home/${o[1]}`:""}function qe(e){const t=Ve(e);if(!t)return t;let n="",o=t;const s=o.match(/^([A-Za-z]:)(\/.*)?$/u);s?(n=`${s[1]}/`,o=(s[2]??"").replace(/^\/+/u,"")):o.startsWith("/")&&(n="/",o=o.slice(1));const a=o.split("/").filter(Boolean),i=[];for(const u of a)if(u!=="."){if(u===".."){i.length>0&&i.pop();continue}i.push(u)}const r=i.join("/");return n?`${n}${r}`.replace(/\/+$/u,"")||n:r||t}function ss(e,t){const n=Ve(ns(e.trim()));if(!n)return"";if(n.startsWith("/")||/^[A-Za-z]:\//u.test(n))return qe(n);if(n.startsWith("~/")){const a=Ho(t);if(a)return qe(`${a}/${n.slice(2)}`)}const s=Ve(t.trim());return qe(s?`${s.replace(/\/+$/u,"")}/${n}`:n)}function wt(e){let t=e,n="",o="";const s={"(":")","[":"]","{":"}","<":">",'"':'"',"'":"'","`":"`","“":"”","‘":"’"};for(;t.length>0;){const a=t[0],i=Object.prototype.hasOwnProperty.call(s,a)?s[a]:"";if(!i||!t.endsWith(i))break;n+=a,o+=i,t=t.slice(1,-1)}return{core:t,leading:n,trailing:o}}function st(e){if(!e)return null;let t=e.trim();t=wt(t).core.trim();let o=null;const s=t.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(s)t=s[1],o=Number(s[2]);else{const a=t.match(/^(.*):(\d+)(?::\d+)?$/u);a&&(t=a[1],o=Number(a[2]))}return t=ns(t),Do(t)?{path:t,line:o}:null}function Bn(e,t,n){let o=0,s=t-1;for(;s>=n&&e[s]==="*";)o+=1,s-=1;return o}function Wo(e,t){let n=0,o=t;for(;o<e.length&&e[o]==="*";)n+=1,o+=1;return n}function os(e,t,n,o,s){const a=Bn(e,t,o);return a<2?null:Wo(e,n)>=a?{segmentStart:t-a,segmentEnd:n+a,tokenEndTrim:0}:Bn(s,s.length,0)>=a?{segmentStart:t-a,segmentEnd:n,tokenEndTrim:a}:null}function zt(e){const t=e.trim();if(!t.startsWith("[")||!t.endsWith(")"))return null;const n=t.indexOf("]");if(n<=1||t[n+1]!=="(")return null;const o=t.slice(1,n).trim(),s=t.slice(n+2,-1).trim();if(o.includes(`
|
|
2
|
-
`)||s.includes(`
|
|
3
|
-
`))return null;const a=wt(o).core.trim()||o,i=wt(s).core.trim();return i?{label:a,target:i}:null}function bt(e){const t=e.trim().match(/^codex:\/\/threads\/([A-Za-z0-9-]+)$/u);if(!t)return null;if(typeof window>"u")return`/#/thread/${t[1]}`;const n=window.location.pathname.replace(/\/?$/u,"/");return`${window.location.origin}${n}#/thread/${t[1]}`}function as(e){const t=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(t)}`}function is(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"}}const rs={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 ce(e){return`${e.path}\0${e.movedToPath??""}`}function No(e,t){return e?!t||e===t?e:`${e}
|
|
4
|
-
${t}`.trim():t}function jo(e,t){const n=e.operation==="add"||t.operation==="add"?"add":e.operation==="delete"||t.operation==="delete"?"delete":"update";return{path:t.path||e.path,operation:n,movedToPath:t.movedToPath??e.movedToPath??null,diff:No(e.diff,t.diff),addedLineCount:e.addedLineCount+t.addedLineCount,removedLineCount:e.removedLineCount+t.removedLineCount}}function qo(e,t){const n=e.operation==="add"?0:e.operation==="update"?1:2,o=t.operation==="add"?0:t.operation==="update"?1:2;if(n!==o)return n-o;const s=`${e.path}\0${e.movedToPath??""}`,a=`${t.path}\0${t.movedToPath??""}`;return s.localeCompare(a)}function Nt(e){const t=new Map;for(const n of e){const o=`${n.path}\0${n.movedToPath??""}`,s=t.get(o);t.set(o,s?jo(s,n):{...n})}return Array.from(t.values()).sort(qo)}function en(e,t){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?t("Moved + edited"):t("Moved"):e.operation==="add"?t("Added"):e.operation==="delete"?t("Deleted"):t("Edited")}function Uo(e){return e.operation==="update"&&e.movedToPath?"→":e.operation==="add"?"+":e.operation==="delete"?"−":"M"}function Vt(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function Re(e){const t=[];return e.addedLineCount>0&&t.push(`+${e.addedLineCount}`),e.removedLineCount>0&&t.push(`-${e.removedLineCount}`),t.join(" ")}function ls(e,t,n=""){const o=[];return e>0&&o.push({tone:"add",label:`+${e}`}),t>0&&o.push({tone:"remove",label:`-${t}`}),o.length>0?o:n?[{tone:"neutral",label:n}]:[]}function zo(e){return ls(e.addedLineCount,e.removedLineCount)}function cs(e,t){return e===1?`1 ${t("file changed")}`:`${e} ${t("files changed")}`}function Vo(e,t){if(!e||e.changes.length===0)return"";let n=0,o=0,s=0,a=0;for(const r of e.changes){if(r.operation==="add"){n+=1;continue}if(r.operation==="delete"){o+=1;continue}if(r.movedToPath){a+=1;continue}s+=1}const i=[];return s>0&&i.push(`${s} ${t("edited")}`),n>0&&i.push(`${n} ${t("added")}`),o>0&&i.push(`${o} ${t("deleted")}`),a>0&&i.push(`${a} ${t("moved")}`),i.join(", ")}function Ko(e,t){if(!e||e.changes.length===0)return t("Modified files");const n=cs(e.changes.length,t),o=Vo(e,t);return o?`${n} · ${o}`:n}function Go(e){if(!e||e.changes.length===0)return[];const t=e.changes.reduce((s,a)=>s+a.addedLineCount,0),n=e.changes.reduce((s,a)=>s+a.removedLineCount,0),o=e.changes.some(s=>s.movedToPath)?"Moved":"Ready";return ls(t,n,o)}function Ke(e,t){const n=ss(e,t),o=qe(Ve(t.trim())),s=qe(Ve(n));return o&&s.startsWith(`${o}/`)?s.slice(o.length+1):e}function Zo(e,t,n){if(!e||e.changes.length===0)return"";const o=e.changes.map(s=>{const a=Ke(s.path,t),i=s.movedToPath?` -> ${Ke(s.movedToPath,t)}`:"",r=Re(s);return`- ${en(s,n)}: ${a}${i}${r?` (${r})`:""}`});return`${n("Modified files")}:
|
|
5
|
-
${o.join(`
|
|
6
|
-
`)}`.trim()}function Jo(e){var o;const n=((o=(e.movedToPath||e.path).split(".").pop())==null?void 0:o.toLowerCase())??"";return rs[n]??n??""}function Yo(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function Xo(e){const t=e.diff.replace(/\r\n/g,`
|
|
7
|
-
`),n=t.length>0?t.split(`
|
|
8
|
-
`):[];return n.length>0&&n[n.length-1]===""&&n.pop(),n.map((o,s)=>({key:`${ce(e)}:synthetic:${s}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?s+1:null,newLine:e.operation==="delete"?null:s+1,text:o}))}function Qo(e){const t=e.diff.replace(/\r\n/g,`
|
|
9
|
-
`),n=t.length>0?t.split(`
|
|
10
|
-
`):[];n.length>0&&n[n.length-1]===""&&n.pop();const o=[];let s=0,a=0;for(const[i,r]of n.entries()){const u=r.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(u){s=Number(u[1]),a=Number(u[2]),o.push({key:`${ce(e)}:hunk:${i}`,kind:"hunk",oldLine:null,newLine:null,text:r});continue}if(r.startsWith("+")&&!r.startsWith("+++")){o.push({key:`${ce(e)}:add:${i}`,kind:"add",oldLine:null,newLine:a,text:r.slice(1)}),a+=1;continue}if(r.startsWith("-")&&!r.startsWith("---")){o.push({key:`${ce(e)}:remove:${i}`,kind:"remove",oldLine:s,newLine:null,text:r.slice(1)}),s+=1;continue}if(r.startsWith(" ")){o.push({key:`${ce(e)}:context:${i}`,kind:"context",oldLine:s,newLine:a,text:r.slice(1)}),s+=1,a+=1;continue}o.push({key:`${ce(e)}:meta:${i}`,kind:"meta",oldLine:null,newLine:null,text:r})}return o}function ea(e){return!e||!e.diff.trim()?[]:Yo(e)?Qo(e):Xo(e)}function ta(e){return!!(e!=null&&e.diff.trim())}function na(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}function sa(e,t){if(e.size===0)return e;const n=new Set;for(const o of e)t.has(o)&&n.add(o);return n.size===e.size?e:n}function oa(e){const{getMessages:t,getLiveTurnId:n,isFileChangeMessage:o,isCopyableAssistantMessage:s,isReasoningMessage:a,isPlanMessage:i,isFoldMember:r,getHiddenGroupedCommandIds:u,isMobile:h}=e,k=U(new Set),p=U(null),M=U(""),C=U(!1),F=P(()=>{var re,pe;const H=new Map,V=new Map,ue=new Map,ge=z=>!o(z)&&!a(z)&&!i(z)&&!u().has(z.id)&&!r(z);for(const z of t()){const ve=typeof z.turnIndex=="number"?`turn:${z.turnIndex}`:`message:${z.id}`;if(ge(z)&&H.set(ve,z.id),s(z)&&typeof z.turnIndex=="number"&&Array.isArray(z.fileChanges)&&z.fileChanges.length>0&&V.set(z.id,{changes:Nt(z.fileChanges),sourceMessageIds:[],source:"assistant",turnId:z.turnId??""}),!o(z))continue;const Le=ue.get(ve);Le?Le.push(z):ue.set(ve,[z])}const ie={};for(const[z,ve]of ue.entries()){const Le=H.get(z);if(!Le)continue;const it=((re=V.get(Le))==null?void 0:re.turnId)??"";ie[Le]={changes:Nt(ve.flatMap(Me=>Me.fileChanges??[])),sourceMessageIds:ve.map(Me=>Me.id),source:"metadata",turnId:((pe=ve.find(Me=>typeof Me.turnId=="string"&&Me.turnId.length>0))==null?void 0:pe.turnId)??it}}for(const[z,ve]of V.entries())ie[z]||(ie[z]=ve);return ie}),_=P(()=>{var ge;const H=new Map,V=new Set;for(const ie of Object.values(F.value))for(const re of ie.sourceMessageIds)V.add(re);for(const ie of t()){if(!o(ie))continue;const re=typeof ie.turnIndex=="number"?`turn:${ie.turnIndex}`:`message:${ie.id}`,pe=H.get(re);pe?pe.push(ie):H.set(re,[ie])}const ue={};for(const[ie,re]of H.entries()){if(re.some(z=>V.has(z.id)))continue;const pe=re[re.length-1];pe&&(ue[pe.id]={changes:Nt(re.flatMap(z=>z.fileChanges??[])),sourceMessageIds:re.map(z=>z.id),source:"metadata",turnId:pe.turnId??((ge=re.find(z=>typeof z.turnId=="string"&&z.turnId.length>0))==null?void 0:ge.turnId)??""})}return ue}),O=P(()=>{const H=new Set;for(const V of Object.values(F.value))for(const ue of V.sourceMessageIds)H.add(ue);for(const[V,ue]of Object.entries(_.value))for(const ge of ue.sourceMessageIds)ge!==V&&H.add(ge);return H}),L=P(()=>{var H;return((H=p.value)==null?void 0:H.changes)??[]}),b=P(()=>{const H=L.value;return H.length===0?null:H.find(V=>ce(V)===M.value)??H[0]}),A=P(()=>ea(b.value));function T(H){const V=new Set(k.value);V.has(H.id)?V.delete(H.id):V.add(H.id),k.value=V}function R(H){return k.value.has(H.id)}function D(H,V){H&&(p.value=H,M.value=ce(V),C.value=!1)}function w(){p.value=null,M.value="",C.value=!1}function G(){C.value=!C.value}function q(){C.value=!1}function le(H){M.value=ce(H),h()&&(C.value=!1)}function Oe(H){return F.value[H]??null}function Ge(H){return k.value.has(H)}function I(H){const V=t().find(ue=>ue.id===H);V&&T(V)}function E(H){return Oe(H.id)}function W(H){return _.value[H.id]??null}function Q(H){if(!H)return!1;const V=n();return V?(H.turnId??"")!==V:!0}function ae(){const H=new Set([...Object.keys(F.value),...Object.keys(_.value)]);k.value=sa(k.value,H)}return{anchoredFileChangeSummaryByAnchorId:F,standaloneFileChangeSummaryByMessageId:_,hiddenFileChangeMessageIds:O,isDiffViewerFileListOpen:C,diffViewerChanges:L,activeDiffViewerChange:b,activeDiffViewerLines:A,toggleFileChangeSummary:T,isFileChangeSummaryExpanded:R,openDiffViewer:D,closeDiffViewer:w,toggleDiffViewerFileList:G,closeDiffViewerFileList:q,selectDiffViewerChange:le,readAnchoredFileChangeSummaryById:Oe,isFileChangeSummaryExpandedById:Ge,toggleFileChangeSummaryById:I,readAnchoredFileChangeSummary:E,readStandaloneFileChangeSummary:W,isFileChangeSummaryVisible:Q,pruneFileChangeSummaryIds:ae}}function aa(e){const{getMessages:t,isCopyableAssistantMessage:n,isPlanMessage:o,planStepCopyMarker:s,buildFileChangeCopyText:a,getAnchoredFileChangeSummaries:i}=e,r=U("");let u=null;function h(A){var D;const T=tt(A);if(!T)return"";const R=[];return(D=T.explanation)!=null&&D.trim()&&R.push(T.explanation.trim()),T.steps.length>0&&R.push(T.steps.map(w=>`- ${s(w.status)} ${w.step}`.trim()).join(`
|
|
11
|
-
`)),R.join(`
|
|
12
|
-
|
|
13
|
-
`).trim()}function k(A){const T=[],R=A.text.trim()||h(A),D=o(A)&&R?`Plan
|
|
14
|
-
${R}`:R;D&&T.push(D);const w=(A.fileAttachments??[]).map(q=>q.path.trim()).filter(q=>q.length>0);w.length>0&&T.push(`Files:
|
|
15
|
-
${w.join(`
|
|
16
|
-
`)}`);const G=(A.images??[]).map(q=>q.trim()).filter(q=>q.length>0);return G.length>0&&T.push(`Images:
|
|
17
|
-
${G.join(`
|
|
18
|
-
`)}`),T.join(`
|
|
19
|
-
|
|
20
|
-
`).trim()}const p=P(()=>{var R;const A=new Map;for(const D of t()){if(!n(D))continue;const w=k(D);if(!w)continue;const G=typeof D.turnIndex=="number"?`turn:${D.turnIndex}`:`message:${D.id}`,q=A.get(G);if(q){q.anchorMessageId=D.id,q.parts.push(w);continue}A.set(G,{anchorMessageId:D.id,parts:[w]})}const T={};for(const D of A.values()){const w=D.parts.join(`
|
|
21
|
-
|
|
22
|
-
`).trim();w&&(T[D.anchorMessageId]=w)}for(const[D,w]of Object.entries(i())){if(w.source!=="metadata")continue;const G=a(w);if(!G)continue;const q=(R=T[D])==null?void 0:R.trim();T[D]=q?`${q}
|
|
23
|
-
|
|
24
|
-
${G}`:G}return T}),M=P(()=>{const A=new Map;for(const R of t()){if(!n(R)||typeof R.turnIndex!="number")continue;const D=`turn:${R.turnIndex}`,w=A.get(D);if(w){w.anchorMessageId=R.id,w.turnIndex=R.turnIndex;continue}A.set(D,{anchorMessageId:R.id,turnIndex:R.turnIndex})}const T={};for(const R of A.values())T[R.anchorMessageId]=R.turnIndex;return T});function C(A){return typeof p.value[A.id]=="string"}function F(A){return A.role==="user"&&k(A).length>0}function _(A){r.value=A,u&&clearTimeout(u),u=setTimeout(()=>{r.value===A&&(r.value=""),u=null},1800)}To()&&$t(()=>{u&&(clearTimeout(u),u=null)});async function O(A){const T=t().find(w=>w.id===A);if(!T)return;const R=k(T);if(!R)return;let D=!1;try{await kt(R),D=!0}catch{D=!1}D||(D=En(R)),D&&_(A)}function L(A){return typeof M.value[A.id]=="number"}async function b(A){const T=p.value[A]??"";if(!T)return;let R=!1;try{await kt(T),R=!0}catch{R=!1}R||(R=En(T)),R&&_(A)}return{copiedResponseAnchorId:r,copyableResponseContentByAnchorId:p,forkableTurnIndexByAnchorId:M,showCopyResponseButton:C,isCopyableUserMessage:F,copyUserMessage:O,showForkResponseButton:L,copyResponse:b}}function ia(e){const{getMessages:t,getLiveOverlay:n,isCommandMessage:o}=e,s=U(new Set),a=P(()=>{var A;const b=t();for(let T=b.length-1;T>=0;T-=1){const R=b[T];if(R.messageType==="commandExecution"&&((A=R.commandExecution)==null?void 0:A.status)==="inProgress")return R.id}return""}),i=P(()=>t().some(b=>b.role==="assistant"&&b.messageType==="agentMessage.live"&&b.text.trim().length>0)),r=P(()=>!!n()||a.value.length>0||i.value),u=P(()=>{const b=t(),A={};for(let T=0;T<b.length;){const R=b[T];if(!o(R)){T+=1;continue}const D=[];for(;T<b.length&&o(b[T]);)D.push(b[T]),T+=1;if(D.length<=1)continue;const w=D[D.length-1];A[w.id]=D.slice(0,-1)}return A}),h=P(()=>{const b=new Set;for(const A of Object.values(u.value))for(const T of A)b.add(T.id);return b});function k(b){return o(b)&&s.value.has(b.id)}function p(b){return o(b)&&r.value}function M(b){var A;return o(b)&&(r.value||((A=b.commandExecution)==null?void 0:A.status)==="inProgress")}function C(b){if(!o(b))return;const A=new Set(s.value);A.has(b.id)?A.delete(b.id):A.add(b.id),s.value=A}function F(b){return u.value[b.id]??[]}function _(b){return o(b)?[...F(b),b]:[]}function O(b,A){if(b.size===0)return b;const T=new Set;for(const R of b)A.has(R)&&T.add(R);return T.size===b.size?b:T}function L(b){s.value=O(s.value,b)}return{expandedCommandIds:s,activeCommandMessageId:a,hasLiveAssistantText:i,isLiveTurnRuntime:r,groupedCommandsByLatestId:u,hiddenGroupedCommandIds:h,isCommandExpanded:k,isCommandCompact:p,isCommandOutputCondensed:M,toggleCommandExpand:C,getGroupedCommandsForLatest:F,getWorkBlockCommands:_,pruneCommandIdSets:L}}function ra(e){const{getActiveThreadId:t,getCwd:n,onFileChangesChanged:o,updateThreadFileChanges:s,t:a}=e,i=U({}),r=U({}),u=U({});function h(L){const b=t();return L!=null&&L.turnId&&b?`thread:${b}:turn:${L.turnId}`:""}function k(L){return h(L).length>0}function p(L){const b=h(L);return b?i.value[b]??"idle":"idle"}function M(L){const b=h(L);return b?r.value[b]??"":""}function C(L){const b=p(L);return b==="undone"||b==="redoing"?"redo":"undo"}function F(L){const b=p(L);return b==="undoing"?a("Undoing"):b==="redoing"?a("Redoing"):C(L)==="redo"?a("Redo"):a("Undo")}async function _(L,b,A){const T=h(L),R=t(),D=n();if(!L||!T||!R||!D)return;const w=p(L),G=b==="undo"?"undoing":"redoing";i.value={...i.value,[T]:G},r.value={...r.value,[T]:""};let q;try{const le=u.value[T]??[];q=await s(R,L.turnId,D,b,le.length>0?le:void 0,"single_turn",A)}catch(le){i.value={...i.value,[T]:w},r.value={...r.value,[T]:le instanceof Error?le.message:a("Failed to update file changes.")};return}if(q.errors.length>0){b==="undo"?(u.value={...u.value,[T]:q.revertedPatchIds??[]},i.value={...i.value,[T]:"undone"}):((q.appliedPatchIds??[]).length>0&&(u.value={...u.value,[T]:q.appliedPatchIds??[]}),i.value={...i.value,[T]:"undone"}),r.value={...r.value,[T]:q.errors.join("; ")};return}if((q.changed??0)<=0){i.value={...i.value,[T]:w},r.value={...r.value,[T]:q.message||a(b==="undo"?"No file changes to undo.":"No file changes to redo.")};return}b==="undo"?(u.value={...u.value,[T]:q.revertedPatchIds??[]},i.value={...i.value,[T]:"undone"}):(u.value={...u.value,[T]:q.appliedPatchIds??[]},i.value={...i.value,[T]:"redone"}),o()}function O(){i.value={},r.value={},u.value={}}return{fileChangeActionState:i,fileChangeActionError:r,fileChangeRedoPatchIds:u,fileChangeActionKey:h,isFileChangeActionable:k,fileChangeActionStatus:p,fileChangeActionErrorText:M,fileChangeNextAction:C,fileChangeActionLabel:F,runFileChangeAction:_,resetFileChangeActions:O}}function la(e){const{toEditUrlFromBrowseHref:t}=e,n=U(!1),o=U(0),s=U(0),a=U(""),i=U("");function r(h){var C,F;const k=h.target,p=(C=k==null?void 0:k.closest)==null?void 0:C.call(k,"a.message-file-link");if(!p)return;const M=(((F=p.getAttribute)==null?void 0:F.call(p,"href"))??"").trim();!M||M==="#"||(h.preventDefault(),h.stopPropagation(),a.value=M,i.value=t(M),o.value=h.clientX,s.value=h.clientY,n.value=!0)}function u(){n.value&&(n.value=!1)}return{isFileLinkContextMenuVisible:n,fileLinkContextMenuX:o,fileLinkContextMenuY:s,fileLinkContextBrowseUrl:a,fileLinkContextEditUrl:i,handleConversationContextMenu:r,closeFileLinkContextMenu:u}}function ca(e){const{isVideo:t}=e,n=U(""),o=U(!1),s=U(0),a=U(new Set);function i(p,M){return`${p}:${M}`}function r(p,M){return a.value.has(i(p,M))}function u(p,M){const C=new Set(a.value);C.add(i(p,M)),a.value=C,s.value+=1}function h(p){n.value=p,o.value=t(p)}function k(){n.value="",o.value=!1}return{modalImageUrl:n,modalIsVideo:o,markdownImageFailureVersion:s,isMarkdownImageFailed:r,onMarkdownImageError:u,openImageModal:h,closeImageModal:k}}const ua=["aria-label"],da={class:"confirm-dialog-title"},fa={class:"confirm-dialog-message"},ha={class:"confirm-dialog-actions"},ma=oe({__name:"ConfirmDialog",props:{visible:{type:Boolean},title:{},message:{},confirmLabel:{default:""},cancelLabel:{default:""},danger:{type:Boolean,default:!1}},emits:["confirm","cancel"],setup(e){return(t,n)=>(l(),se(Xn,{to:"body"},[e.visible?(l(),d("div",{key:0,class:"confirm-dialog-overlay",onClick:n[2]||(n[2]=ze(o=>t.$emit("cancel"),["self"]))},[m("div",{class:"confirm-dialog-panel",role:"alertdialog","aria-modal":"true","aria-label":e.title},[m("h3",da,y(e.title),1),m("p",fa,y(e.message),1),m("div",ha,[m("button",{class:"confirm-dialog-btn confirm-dialog-btn-cancel",type:"button",onClick:n[0]||(n[0]=o=>t.$emit("cancel"))},y(e.cancelLabel||"Cancel"),1),m("button",{class:te(["confirm-dialog-btn confirm-dialog-btn-confirm",{"is-danger":e.danger}]),type:"button",onClick:n[1]||(n[1]=o=>t.$emit("confirm"))},y(e.confirmLabel||"Confirm"),3)])],8,ua)])):S("",!0)]))}}),ga=ne(ma,[["__scopeId","data-v-860b1449"]]),pa={key:0,class:"diff-viewer-sidebar"},va={class:"diff-viewer-sidebar-header"},ka={class:"diff-viewer-sidebar-title"},ya={class:"diff-viewer-sidebar-count"},wa={class:"diff-viewer-sidebar-list"},ba=["data-active","onClick"],Ca=["data-operation"],$a={class:"diff-viewer-file-label"},xa={key:0,class:"diff-viewer-file-delta"},Ta={class:"diff-viewer-main"},_a={class:"diff-viewer-toolbar"},Ia={class:"diff-viewer-title-wrap"},La={class:"diff-viewer-title"},Ma={class:"diff-viewer-subtitle"},Sa={key:0},Aa={class:"diff-viewer-toolbar-actions"},Fa=["aria-label"],Pa={key:0,class:"diff-viewer-empty"},Ea={class:"diff-viewer-empty-title"},Ba={class:"diff-viewer-empty-text"},Ra={key:1,class:"diff-viewer-panel"},Oa={class:"diff-viewer-meta"},Da={class:"diff-viewer-language"},Ha={class:"diff-viewer-lines"},Wa=["data-kind"],Na={class:"diff-viewer-line-number"},ja={class:"diff-viewer-line-number"},qa={class:"diff-viewer-line-marker"},Ua=["innerHTML"],za={class:"diff-viewer-mobile-sheet-header"},Va={class:"diff-viewer-sidebar-title"},Ka={class:"diff-viewer-sidebar-count"},Ga={class:"diff-viewer-mobile-sheet-list"},Za=["data-active","onClick"],Ja=["data-operation"],Ya={class:"diff-viewer-file-label"},Xa={key:0,class:"diff-viewer-file-delta"},Qa=oe({__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 t=e,{t:n}=me();function o(r){return r.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}const s=P(()=>r=>en(r,n)),a=P(()=>r=>cs(r,n)),i=P(()=>r=>Ke(r,t.cwd));return(r,u)=>(l(),se(Xn,{to:"body"},[e.change?(l(),d("div",{key:0,class:"diff-viewer-backdrop",onClick:u[5]||(u[5]=h=>r.$emit("close"))},[m("div",{class:"diff-viewer-shell",onClick:u[4]||(u[4]=ze(()=>{},["stop"]))},[e.isMobile?S("",!0):(l(),d("aside",pa,[m("div",va,[m("p",ka,y(f(n)("Changed files")),1),m("p",ya,y(a.value(e.changes.length)),1)]),m("div",wa,[(l(!0),d(j,null,K(e.changes,h=>(l(),d("button",{key:`diff-viewer:${f(ce)(h)}`,type:"button",class:"diff-viewer-file-button","data-active":f(ce)(h)===f(ce)(e.change),onClick:k=>r.$emit("select-change",h)},[m("span",{class:"file-change-badge","data-operation":f(Vt)(h)},y(s.value(h)),9,Ca),m("span",$a,[xe(y(i.value(h.path))+" ",1),h.movedToPath?(l(),d(j,{key:0},[xe(" → "+y(i.value(h.movedToPath)),1)],64)):S("",!0)]),f(Re)(h)?(l(),d("span",xa,y(f(Re)(h)),1)):S("",!0)],8,ba))),128))])])),m("section",Ta,[m("div",_a,[m("div",Ia,[m("p",La,[xe(y(i.value(e.change.path))+" ",1),e.change.movedToPath?(l(),d(j,{key:0},[xe(" → "+y(i.value(e.change.movedToPath)),1)],64)):S("",!0)]),m("p",Ma,[xe(y(s.value(e.change))+" ",1),f(Re)(e.change)?(l(),d("span",Sa," · "+y(f(Re)(e.change)),1)):S("",!0)])]),m("div",Aa,[e.isMobile?(l(),d("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:u[0]||(u[0]=h=>r.$emit("toggle-file-list"))},y(a.value(e.changes.length)),1)):S("",!0),m("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":f(n)("Close diff viewer"),onClick:u[1]||(u[1]=h=>r.$emit("close"))},[ee(Qn,{class:"icon-svg"})],8,Fa)])]),f(ta)(e.change)?(l(),d("div",Ra,[m("div",Oa,[m("span",Da,y(f(Jo)(e.change)||"diff"),1)]),m("div",Ha,[(l(!0),d(j,null,K(e.lines,h=>(l(),d("div",{key:h.key,class:"diff-viewer-line","data-kind":h.kind},[m("span",Na,y(h.oldLine??""),1),m("span",ja,y(h.newLine??""),1),m("span",qa,y(f(na)(h)),1),m("code",{class:"diff-viewer-line-code",innerHTML:o(h.text)||" "},null,8,Ua)],8,Wa))),128))])])):(l(),d("div",Pa,[m("p",Ea,y(f(n)("No diff available")),1),m("p",Ba,y(f(n)("This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.")),1)]))]),ee(_o,{name:"diff-viewer-sheet"},{default:je(()=>[e.isMobile&&e.isFileListOpen?(l(),d("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:u[3]||(u[3]=h=>r.$emit("close-file-list"))},[m("div",{class:"diff-viewer-mobile-sheet",onClick:u[2]||(u[2]=ze(()=>{},["stop"]))},[u[6]||(u[6]=m("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),m("div",za,[m("p",Va,y(f(n)("Changed files")),1),m("p",Ka,y(a.value(e.changes.length)),1)]),m("div",Ga,[(l(!0),d(j,null,K(e.changes,h=>(l(),d("button",{key:`diff-viewer-sheet:${f(ce)(h)}`,type:"button",class:"diff-viewer-file-button","data-active":f(ce)(h)===f(ce)(e.change),onClick:k=>r.$emit("select-change",h)},[m("span",{class:"file-change-badge","data-operation":f(Vt)(h)},y(s.value(h)),9,Ja),m("span",Ya,[xe(y(i.value(h.path))+" ",1),h.movedToPath?(l(),d(j,{key:0},[xe(" → "+y(i.value(h.movedToPath)),1)],64)):S("",!0)]),f(Re)(h)?(l(),d("span",Xa,y(f(Re)(h)),1)):S("",!0)],8,Za))),128))])])])):S("",!0)]),_:1})])])):S("",!0)]))}}),ei=ne(Qa,[["__scopeId","data-v-a9ed279d"]]),ti={},ni={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function si(e,t){return l(),d("svg",ni,[...t[0]||(t[0]=[m("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 Kt=ne(ti,[["render",si]]),oi={class:"file-change-summary-label"},ai={class:"file-change-summary-status"},ii=["data-tone"],ri={class:"file-change-panel-inner"},li={class:"file-change-list"},ci=["data-operation","title"],ui={class:"file-change-path-group"},di=["title","onClick"],fi={key:0,class:"file-change-arrow"},hi=["title","onClick"],mi={key:0,class:"file-change-delta"},gi=["data-tone"],pi=["title","aria-label","onClick"],vi={key:0,class:"file-change-actions"},ki={key:0,class:"file-change-action-error"},yi=["disabled","title","aria-label"],wi=oe({__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 t=e,{t:n}=me(),o=P(()=>r=>en(r,n)),s=P(()=>r=>Ko(r,n)),a=P(()=>r=>Ke(r,t.cwd)),i=P(()=>r=>`${n("Undo")} ${Ke(r.path,t.cwd)}`);return(r,u)=>e.summary?(l(),d("section",{key:0,class:te(["file-change-summary-block",{"file-change-summary-block-inline":e.inline}])},[m("button",{type:"button",class:te(["file-change-summary-row",{"file-change-summary-row-expanded":e.expanded}]),onClick:u[0]||(u[0]=h=>r.$emit("toggle"))},[m("span",{class:te(["file-change-chevron",{"file-change-chevron-open":e.expanded}])},"▶",2),m("span",oi,y(s.value(e.summary)),1),m("span",ai,[(l(!0),d(j,null,K(f(Go)(e.summary),h=>(l(),d("span",{key:`summary-status:${e.summary.turnId}:${h.tone}:${h.label}`,class:"file-change-signed-count","data-tone":h.tone},y(h.label),9,ii))),128))])],2),m("div",{class:te(["file-change-panel",{"file-change-panel-visible":e.expanded}])},[m("div",ri,[m("ul",li,[(l(!0),d(j,null,K(e.summary.changes,h=>(l(),d("li",{key:`file-change:${e.summary.turnId}:${h.path}:${h.movedToPath||""}`,class:"file-change-item"},[m("span",{class:"file-change-badge","data-operation":f(Vt)(h),title:o.value(h)},y(f(Uo)(h)),9,ci),m("span",ui,[m("button",{type:"button",class:"file-change-path-button",title:h.path,onClick:k=>r.$emit("open-diff",h)},y(a.value(h.path)),9,di),h.movedToPath?(l(),d("span",fi,"→")):S("",!0),h.movedToPath?(l(),d("button",{key:1,type:"button",class:"file-change-path-button",title:h.movedToPath,onClick:k=>r.$emit("open-diff",h)},y(a.value(h.movedToPath)),9,hi)):S("",!0)]),h.addedLineCount>0||h.removedLineCount>0?(l(),d("span",mi,[(l(!0),d(j,null,K(f(zo)(h),k=>(l(),d("span",{key:`change-delta:${e.summary.turnId}:${h.path}:${k.tone}:${k.label}`,class:"file-change-signed-count","data-tone":k.tone},y(k.label),9,gi))),128))])):S("",!0),e.actionable?(l(),d("button",{key:1,type:"button",class:"file-change-file-undo-button",title:i.value(h),"aria-label":i.value(h),onClick:k=>r.$emit("request-file-action",h)},[ee(Kt,{class:"icon-svg file-change-action-icon"})],8,pi)):S("",!0)]))),128))]),e.actionable?(l(),d("div",vi,[e.actionErrorText?(l(),d("p",ki,y(e.actionErrorText),1)):S("",!0),m("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:u[1]||(u[1]=h=>r.$emit("request-action",e.nextAction))},[ee(Kt,{class:te(["icon-svg file-change-action-icon",{"file-change-action-icon-redo":e.nextAction==="redo"}])},null,8,["class"]),xe(" "+y(e.actionLabel),1)],8,yi)])):S("",!0)])],2)],2)):S("",!0)}}),Rn=ne(wi,[["__scopeId","data-v-32872c73"]]),bi=oe({__name:"FileLinkContextMenu",props:{visible:{type:Boolean},x:{},y:{},browseUrl:{},editUrl:{}},emits:["close"],setup(e,{emit:t}){const n=e,o=t,s=U(null),a=P(()=>({left:`${String(n.x)}px`,top:`${String(n.y)}px`}));function i(){o("close")}function r(){const C=n.browseUrl;i(),!(!C||C==="#")&&window.open(C,"_blank","noopener,noreferrer")}function u(){const C=n.editUrl;i(),!(!C||C==="#")&&window.open(C,"_blank","noopener,noreferrer")}async function h(){const C=n.browseUrl;if(i(),!(!C||C==="#"))try{await kt(C)}catch{}}function k(C){if(!n.visible)return;const F=s.value;if(!F){i();return}const _=C.target;_ instanceof Node&&F.contains(_)||i()}function p(){i()}function M(C){C.key==="Escape"&&i()}return Te(()=>n.visible,C=>{C?(window.addEventListener("pointerdown",k,!0),window.addEventListener("blur",p),window.addEventListener("keydown",M,!0)):(window.removeEventListener("pointerdown",k,!0),window.removeEventListener("blur",p),window.removeEventListener("keydown",M,!0))}),$t(()=>{window.removeEventListener("pointerdown",k,!0),window.removeEventListener("blur",p),window.removeEventListener("keydown",M,!0)}),(C,F)=>e.visible?(l(),d("div",{key:0,ref_key:"menuRef",ref:s,class:"file-link-context-menu",style:nt(a.value),onClick:F[0]||(F[0]=ze(()=>{},["stop"]))},[m("button",{type:"button",class:"file-link-context-menu-item",onClick:r}," Open link "),m("button",{type:"button",class:"file-link-context-menu-item",onClick:h}," Copy link "),e.editUrl?(l(),d("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:u}," Edit file ")):S("",!0)],4)):S("",!0)}}),Ci=ne(bi,[["__scopeId","data-v-fa2f389c"]]),$i=12e3,xi=240;function Ti(e,{streaming:t,truncateStreaming:n=!0,maxChars:o=$i,maxLines:s=xi}){if(!n)return e;let a=e,i=!1;if(o>0&&a.length>o&&(a=a.slice(-o),i=!0),s>0){const r=a.split(/\r?\n/);r.length>s&&(a=r.slice(-s).join(`
|
|
25
|
-
`),i=!0)}return i?`...
|
|
26
|
-
${a}`:a}const _i={class:"conversation-item conversation-item-overlay"},Ii={class:"message-row"},Li={class:"message-stack"},Mi={class:"live-overlay-inline","aria-live":"polite"},Si={class:"live-overlay-title-row"},Ai={key:0,class:"live-overlay-spinner","aria-hidden":"true"},Fi=["aria-expanded"],Pi={class:"live-overlay-label"},Ei={class:"live-overlay-toggle","aria-hidden":"true"},Bi={key:2,class:"live-overlay-label"},Ri={key:0,class:"live-overlay-reasoning"},Oi={key:1,class:"live-overlay-error"},Di=["href"],Hi=oe({__name:"LiveOverlayItem",props:{overlay:{},feedbackMailto:{}},setup(e){const t=e,{buildFeedbackMailto:n,recordVisibleFailure:o}=es(),{t:s}=me(),a=U(!0);function i(){a.value=!a.value}const r=P(()=>{var h;return Ti(((h=t.overlay)==null?void 0:h.reasoningText)??"",{streaming:!0})});function u(h,k){o(k);const p=h.currentTarget;p instanceof HTMLAnchorElement&&(p.href=n())}return(h,k)=>{var p,M,C,F,_,O;return l(),d("li",_i,[m("div",Ii,[m("div",Li,[m("article",Mi,[m("div",Si,[(p=e.overlay)!=null&&p.errorText?S("",!0):(l(),d("span",Ai)),(M=e.overlay)!=null&&M.reasoningText?(l(),d("button",{key:1,type:"button",class:"live-overlay-heading","aria-expanded":a.value,onClick:i},[m("span",Pi,y((C=e.overlay)==null?void 0:C.activityLabel),1),m("span",Ei,y(a.value?"▾":"▸"),1)],8,Fi)):(l(),d("p",Bi,y((F=e.overlay)==null?void 0:F.activityLabel),1))]),(_=e.overlay)!=null&&_.reasoningText&&a.value?(l(),d("p",Ri,y(r.value),1)):S("",!0),(O=e.overlay)!=null&&O.errorText?(l(),d("div",Oi,[m("span",null,y(e.overlay.errorText),1),m("a",{class:"live-overlay-feedback",href:e.feedbackMailto,onClick:k[0]||(k[0]=L=>u(L,e.overlay.errorText))},y(f(s)("Send feedback")),9,Di)])):S("",!0)])])])])}}}),Wi=ne(Hi,[["__scopeId","data-v-edcf19dd"]]),Ni=["title"],ji={class:"model-switch-label"},qi=oe({__name:"ModelSwitchDivider",props:{from:{},to:{}},setup(e){return(t,n)=>(l(),d("div",{class:"model-switch-divider",title:e.to?`切换模型:${e.from??""} → ${e.to}`:void 0},[n[0]||(n[0]=m("span",{class:"model-switch-track","aria-hidden":"true"},null,-1)),m("span",ji,y(e.from?`${e.from} → `:"")+y(e.to),1),n[1]||(n[1]=m("span",{class:"model-switch-track","aria-hidden":"true"},null,-1))],8,Ni))}}),On=ne(qi,[["__scopeId","data-v-1fba0d09"]]),Ui={key:0},zi={key:1,class:"message-bold-text"},Vi={key:2,class:"message-italic-text"},Ki={key:3,class:"message-strikethrough-text"},Gi=["href","title"],Zi=["href","title"],Ji={key:6,class:"message-inline-code"},Yi=oe({__name:"MessageInlineContent",props:{segments:{},toBrowseUrl:{type:Function}},setup(e){return(t,n)=>(l(!0),d(j,null,K(e.segments,(o,s)=>(l(),d(j,{key:s},[o.kind==="text"?(l(),d("span",Ui,y(o.value),1)):o.kind==="bold"?(l(),d("strong",zi,y(o.value),1)):o.kind==="italic"?(l(),d("em",Vi,y(o.value),1)):o.kind==="strikethrough"?(l(),d("s",Ki,y(o.value),1)):o.kind==="file"?(l(),d("a",{key:4,class:"message-file-link",href:e.toBrowseUrl(o.path),target:"_blank",rel:"noopener noreferrer",title:o.path},y(o.displayPath),9,Gi)):o.kind==="url"?(l(),d("a",{key:5,class:"message-file-link",href:o.href,target:"_blank",rel:"noopener noreferrer",title:o.href},y(o.value),9,Zi)):(l(),d("code",Ji,y(o.value),1))],64))),128))}}),Ne=ne(Yi,[["__scopeId","data-v-1cf69093"]]),Xi={},Qi={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function er(e,t){return l(),d("svg",Qi,[...t[0]||(t[0]=[m("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 tr=ne(Xi,[["render",er]]),nr=["data-role"],sr={key:0,class:"message-timestamp"},or=["aria-label","title"],ar={key:0,class:"message-rollback-label"},ir=["aria-label","title"],rr={class:"message-fork-label"},lr=["data-copied","aria-label","title"],cr={key:0,class:"message-copy-label"},ur=oe({__name:"MessageToolbar",props:{role:{},showEdit:{type:Boolean,default:!1},showFork:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},copied:{type:Boolean,default:!1},timestamp:{default:""}},emits:["edit","fork","copy"],setup(e){const{t}=me();return(n,o)=>e.showEdit||e.showFork||e.showCopy||e.timestamp?(l(),d("div",{key:0,class:"message-toolbar","data-role":e.role},[e.timestamp?(l(),d("span",sr,y(e.timestamp),1)):S("",!0),e.showEdit?(l(),d("button",{key:1,type:"button",class:"message-rollback-button","aria-label":f(t)("Rollback this message"),title:f(t)("Rollback this message"),onClick:o[0]||(o[0]=s=>n.$emit("edit"))},[ee(Kt,{class:"icon-svg message-rollback-icon"}),e.role!=="user"?(l(),d("span",ar,y(f(t)("Rollback")),1)):S("",!0)],8,or)):S("",!0),e.showFork?(l(),d("button",{key:2,type:"button",class:"message-fork-button","aria-label":f(t)("Fork thread from this response"),title:f(t)("Fork thread from this response"),onClick:o[1]||(o[1]=s=>n.$emit("fork"))},[ee(Io,{class:"icon-svg message-fork-icon"}),m("span",rr,y(f(t)("Fork")),1)],8,ir)):S("",!0),e.showCopy?(l(),d("button",{key:3,type:"button",class:"message-copy-button","data-copied":e.copied,"aria-label":e.copied?f(t)("Response copied"):f(t)("Copy response"),title:e.copied?f(t)("Response copied"):f(t)("Copy response"),onClick:o[2]||(o[2]=s=>n.$emit("copy"))},[ee(tr,{class:"icon-svg message-copy-icon"}),e.role!=="user"?(l(),d("span",cr,y(e.copied?"Copied":"Copy"),1)):S("",!0)],8,lr)):S("",!0)],8,nr)):S("",!0)}}),dr=ne(ur,[["__scopeId","data-v-ae54aab9"]]),fr="codex-web-local.process-fold.v1",Dn="codex:web-local:process-fold";function jt(){return typeof localStorage>"u"?"auto":localStorage.getItem(fr)==="expanded"?"expanded":"auto"}function hr(e){const t=n=>e(n.detail);return window.addEventListener(Dn,t),()=>window.removeEventListener(Dn,t)}const mr=["aria-expanded"],gr={class:"process-fold-label"},pr={class:"process-fold-toggle","aria-hidden":"true"},vr={key:0,class:"process-fold-body"},kr=oe({__name:"ProcessFold",props:{label:{},running:{type:Boolean},hasOutsideContent:{type:Boolean}},setup(e){const t=e,n=U(jt()==="expanded"||!t.hasOutsideContent),o=U(!1);let s=!1;const a=hr(()=>{o.value=!1,jt()==="expanded"?n.value=!0:!t.running&&t.hasOutsideContent&&(n.value=!1)});Te(()=>t.running,r=>{const u=s;s=r,r?(u||(o.value=!1),o.value||(n.value=!0)):u&&!o.value&&t.hasOutsideContent&&jt()!=="expanded"&&(n.value=!1)},{immediate:!0}),$t(()=>a());function i(){o.value=!0,n.value=!n.value}return(r,u)=>(l(),d("div",{class:te(["process-fold",{"process-fold--open":n.value,"process-fold--running":e.running}])},[m("button",{type:"button",class:"process-fold-header","aria-expanded":n.value,onClick:i},[m("span",gr,y(e.label),1),m("span",pr,y(n.value?"▾":"▸"),1)],8,mr),n.value?(l(),d("div",vr,[Ee(r.$slots,"default",{},void 0)])):S("",!0)],2))}}),yr=ne(kr,[["__scopeId","data-v-d29a5266"]]),wr=["aria-label"],br=["data-turn","aria-label","onClick"],Cr={class:"question-jump-preview-text"},$r=2,xr=oe({__name:"QuestionJumpBar",props:{anchors:{},activeTurn:{}},emits:["jump"],setup(e,{emit:t}){const n=()=>getComputedStyle(document.documentElement).getPropertyValue("--live").trim()||"#b26a12",o=e,s=t,{t:a}=me(),i=U(null),r=U(-1),u=U("0px"),h=P(()=>{const O=r.value;return O<0?null:o.anchors[O]??null});function k(O){var R;const L=o.activeTurn===((R=o.anchors[O])==null?void 0:R.turn),b=n(),A={};if(r.value<0)return A.width=L?"18px":"12px",A.background=L?b:void 0,A;const T=Math.abs(O-r.value);return A.width=T===0?"32px":T===1?"20px":T===2?"14px":L?"18px":"12px",A.background=T===0?b:T===1?b+"99":T===2?b+"59":L?b:void 0,A.transitionDelay=`${T*20}ms`,A}function p(O){const L=i.value;if(!L)return-1;const b=Array.from(L.querySelectorAll(".question-jump-item"));let A=-1,T=Number.POSITIVE_INFINITY;for(let R=0;R<b.length;R+=1){const D=b[R].getBoundingClientRect(),w=D.top+D.height/2,G=Math.abs(O-w);G<T&&(T=G,A=R)}return A}function M(O){var w;const L=p(O.clientY);if(L<0)return;r.value=L;const b=i.value;if(!b)return;const T=(w=Array.from(b.querySelectorAll(".question-jump-item"))[L])==null?void 0:w.getBoundingClientRect(),R=b.getBoundingClientRect();if(!T)return;const D=T.top+T.height/2;u.value=`${D-R.top}px`}function C(){r.value=-1}function F(O){const L=p(O.clientY),b=L>=0?o.anchors[L]:null;b&&s("jump",b.turn)}function _(O){s("jump",O.turn)}return(O,L)=>e.anchors.length>=$r?(l(),d("nav",{key:0,class:"question-jump-bar","aria-label":f(a)("Question navigation")},[m("div",{ref_key:"trackRef",ref:i,class:"question-jump-track",onMousemove:M,onMouseleave:C,onMousedown:F},[(l(!0),d(j,null,K(e.anchors,(b,A)=>(l(),d("button",{key:b.turn,type:"button",class:"question-jump-item","data-turn":b.turn,"aria-label":f(a)("Jump to question {n}",{n:b.turn+1}),onMousedown:L[0]||(L[0]=ze(()=>{},["prevent"])),onClick:T=>_(b)},[m("span",{class:"question-jump-dot",style:nt(k(A))},null,4)],40,br))),128))],544),h.value?(l(),d("div",{key:0,class:"question-jump-preview",role:"tooltip",style:nt({top:u.value})},[m("span",Cr,y(h.value.text),1)],4)):S("",!0)],8,wr)):S("",!0)}}),Tr=ne(xr,[["__scopeId","data-v-f2cd9065"]]),_r=["data-state"],Ir=["aria-expanded"],Lr={class:"reasoning-block-title"},Mr={class:"reasoning-block-toggle","aria-hidden":"true"},Sr={key:0,class:"reasoning-block-body"},Ar={key:0,class:"reasoning-block-summary"},Fr=["innerHTML"],Pr=oe({__name:"ReasoningBlock",props:{message:{},expanded:{type:Boolean},contentHtml:{}},emits:["toggle"],setup(e){const t=e,{t:n}=me(),o=P(()=>{var a;return(((a=t.message.reasoning)==null?void 0:a.summary)??[]).map(i=>i.trim()).filter(Boolean).join(`
|
|
27
|
-
`).trim()});return(s,a)=>(l(),d("div",{class:"reasoning-block","data-state":e.expanded?"expanded":"collapsed"},[m("button",{type:"button",class:"reasoning-block-header","aria-expanded":e.expanded,onClick:a[0]||(a[0]=i=>s.$emit("toggle"))},[m("span",Lr,y(f(n)("Thinking process")),1),m("span",Mr,y(e.expanded?"▾":"▸"),1)],8,Ir),e.expanded?(l(),d("div",Sr,[o.value?(l(),d("p",Ar,y(o.value),1)):S("",!0),m("div",{class:"reasoning-block-content message-card",innerHTML:e.contentHtml},null,8,Fr)])):S("",!0)],8,_r))}}),Hn=ne(Pr,[["__scopeId","data-v-e64f7962"]]),Er=new Set(["read_file","ls","grep","glob","web_fetch","read_skill","code_index","connect_tool_source"]),Br=new Set(["write_file","edit_file","multi_edit","move_file","delete_range","delete_symbol","notebook_edit"]),Rr=new Set(["task","run_skill","explore","research","review","security_review"]);function Or(e){var n;const t=((n=e.toolCall)==null?void 0:n.tool)??"";return Er.has(t)?"readonly":Br.has(t)?"modify":Rr.has(t)?"delegate":null}const Dr=2;function Hr(e){var a;const t=[];let n=[],o=null;const s=()=>{if(o!==null&&n.length>=Dr)t.push({type:"batch",kind:o,messages:n});else for(const i of n)t.push({type:"tool",message:i});n=[],o=null};for(const i of e){if(i.messageType!=="toolCall"||((a=i.toolCall)==null?void 0:a.status)==="inProgress"){s(),t.push({type:"tool",message:i});continue}const r=Or(i);if(r===null){s(),t.push({type:"tool",message:i});continue}o!==null&&o!==r&&s(),o=r,n.push(i)}return s(),t}function Wr(e,t,n){const{t:o}=n;if(e==="readonly"){const s=t.filter(u=>{var h,k;return((h=u.toolCall)==null?void 0:h.tool)==="read_file"||((k=u.toolCall)==null?void 0:k.tool)==="ls"}).length,a=t.filter(u=>{var k;const h=((k=u.toolCall)==null?void 0:k.tool)??"";return h==="grep"||h==="glob"||h==="web_fetch"||h==="code_index"}).length,i=t.length-s-a,r=[];return s>0&&r.push(o("Read {n} files",{n:s})),a>0&&r.push(o("Search {n} files",{n:a})),i>0&&r.push(o("{n} read calls",{n:i})),r.join(" · ")}return e==="modify"?o("Modified {n} files",{n:t.length}):e==="delegate"?o("Delegated {n} tasks",{n:t.length}):o("Explored {n} items",{n:t.length})}const Nr={class:"message-row","data-role":"system"},jr={class:"message-stack","data-role":"system"},qr=["title"],Ur={class:"tool-call-name"},zr={key:0,class:"tool-call-metric"},Vr=oe({__name:"ToolCallRow",props:{message:{}},setup(e){const t=e,{t:n}=me(),o=P(()=>{const p=t.message.toolCall;return p?p.server?`${p.server} · ${p.tool}`:p.tool:t.message.text||"(tool)"}),s=P(()=>{var M;const p=(M=t.message.toolCall)==null?void 0:M.durationMs;return typeof p!="number"||p<0?"":p<1e3?`${p}ms`:`${(p/1e3).toFixed(1)}s`}),a=P(()=>{var p;switch((p=t.message.toolCall)==null?void 0:p.status){case"inProgress":return{text:"RUN",cls:"is-live"};case"failed":return{text:"FAIL",cls:"is-alert"};case"completed":return{text:"OK",cls:"is-ok"};default:return{text:"",cls:""}}}),i=P(()=>a.value.text),r=P(()=>a.value.cls),u=P(()=>{const p=t.message.toolCall;if(!p)return"";switch(p.status){case"inProgress":return n("Running");case"failed":return n("Failed");default:return n("Done")}}),h=P(()=>{var p;switch((p=t.message.toolCall)==null?void 0:p.status){case"inProgress":return"tool-call-running";case"failed":return"tool-call-error";default:return"tool-call-ok"}}),k=P(()=>{const p=t.message.toolCall;if(!p)return"";const M=[o.value,u.value];return p.error&&M.push(p.error),typeof p.durationMs=="number"&&p.durationMs>=0&&M.push(`${p.durationMs}ms`),M.join(" · ")});return(p,M)=>(l(),d("div",Nr,[m("div",jr,[m("div",{class:te(["tool-call-block",h.value]),title:k.value},[m("span",{class:te(["tool-call-pip",r.value]),"aria-hidden":"true"},null,2),m("code",Ur,y(o.value),1),s.value?(l(),d("span",zr,y(s.value),1)):S("",!0),i.value?(l(),d("span",{key:1,class:te(["tool-call-status",r.value])},y(i.value),3)):S("",!0)],10,qr)])]))}}),Gt=ne(Vr,[["__scopeId","data-v-f0b29923"]]),Kr=["aria-expanded","title"],Gr={class:"tool-batch-toggle","aria-hidden":"true"},Zr={class:"tool-batch-label"},Jr={class:"tool-batch-count"},Yr={key:0,class:"tool-batch-body"},Xr=oe({__name:"ToolBatchBlock",props:{kind:{},messages:{}},setup(e){const t=e,{t:n}=me(),o=U(!1),s=P(()=>Wr(t.kind,t.messages,{t:n})),a=P(()=>t.messages.map(i=>{var r;return((r=i.toolCall)==null?void 0:r.tool)??""}).join(" · "));return(i,r)=>(l(),d("div",{class:te(["tool-batch-block",{"tool-batch-block--open":o.value}])},[m("button",{type:"button",class:"tool-batch-head","aria-expanded":o.value,title:a.value,onClick:r[0]||(r[0]=u=>o.value=!o.value)},[m("span",Gr,y(o.value?"▾":"▸"),1),r[1]||(r[1]=m("span",{class:"tool-batch-icon","aria-hidden":"true"},"🛠",-1)),m("span",Zr,y(s.value),1),m("span",Jr,y(e.messages.length),1)],8,Kr),o.value?(l(),d("div",Yr,[(l(!0),d(j,null,K(e.messages,u=>(l(),se(Gt,{key:u.id,message:u},null,8,["message"]))),128))])):S("",!0)],2))}}),Qr=ne(Xr,[["__scopeId","data-v-7b951bea"]]),el=["data-turn-key"],tl={key:0,class:"conversation-turn-request","aria-label":"User request"},nl={class:"conversation-turn-items"},sl={key:1,class:"conversation-turn-process","aria-label":"Turn process"},ol=["aria-expanded","aria-label"],al={key:2,class:"conversation-turn-time"},il={class:"conversation-turn-process-count"},rl={key:1,class:"conversation-turn-process-heading"},ll={key:0,class:"conversation-turn-time"},cl={key:2,class:"conversation-turn-items conversation-turn-process-items"},ul={key:2,class:"conversation-turn-final","aria-label":"Assistant final response"},dl={class:"conversation-turn-items"},fl=oe({__name:"ThreadTurn",props:{turnKey:{},request:{},processItems:{default:()=>[]},finalItem:{},fileChangeAnchorIds:{default:()=>[]},durationMs:{},warm:{},warmItems:{default:()=>[]}},setup(e){const t=e,{t:n}=me(),o=U(!0),s=P(()=>t.processItems.length+t.fileChangeAnchorIds.length),a=P(()=>!!t.finalItem);return Te(s,(i,r)=>{i>r&&(o.value=!0)}),(i,r)=>e.warm?(l(),d(j,{key:0},[Ee(i.$slots,"warm-card",{warm:e.warm},void 0),(l(!0),d(j,null,K(e.warmItems,u=>Ee(i.$slots,"default",{key:u.message.id,item:u,section:"warm"},void 0)),128))],64)):(l(),d("li",{key:1,class:"conversation-turn","data-turn-key":e.turnKey},[e.request?(l(),d("section",tl,[m("ol",nl,[Ee(i.$slots,"default",{item:e.request,section:"request"},void 0)])])):S("",!0),s.value>0?(l(),d("section",sl,[a.value?(l(),d("button",{key:0,class:"conversation-turn-process-heading conversation-turn-process-toggle",type:"button","aria-expanded":o.value,"aria-label":o.value?f(n)("Collapse turn process"):f(n)("Expand turn process"),onClick:r[0]||(r[0]=u=>o.value=!o.value)},[o.value?(l(),se(Lo,{key:0,class:"conversation-turn-process-toggle-icon"})):(l(),se(ts,{key:1,class:"conversation-turn-process-toggle-icon"})),m("span",null,y(f(n)("Turn process")),1),e.durationMs!=null&&e.durationMs>0?(l(),d("span",al,y(f(Ut)(e.durationMs)),1)):S("",!0),m("span",il,y(f(n)("{n} process items",{n:s.value})),1)],8,ol)):(l(),d("div",rl,[xe(y(f(n)("Turn process"))+" ",1),e.durationMs!=null&&e.durationMs>0?(l(),d("span",ll,y(f(Ut)(e.durationMs)),1)):S("",!0)])),o.value?(l(),d("ol",cl,[(l(!0),d(j,null,K(e.processItems,u=>Ee(i.$slots,"default",{key:u.message.id,item:u,section:"process"},void 0)),128)),(l(!0),d(j,null,K(e.fileChangeAnchorIds,u=>(l(),d("li",{key:`file-change-${u}`,class:"conversation-turn-row conversation-turn-file-change"},[Ee(i.$slots,"file-change",{anchorMessageId:u},void 0)]))),128))])):S("",!0)])):S("",!0),e.finalItem?(l(),d("section",ul,[m("ol",dl,[Ee(i.$slots,"default",{item:e.finalItem,section:"final"},void 0)])])):S("",!0)],8,el))}}),hl=ne(fl,[["__scopeId","data-v-0a7e84f0"]]),ml=["aria-expanded"],gl={class:"warm-turn__preview"},pl={key:0,class:"warm-turn__meta"},vl={class:"warm-turn__content"},kl={key:1,class:"warm-turn__assistant"},yl=oe({__name:"WarmTurnCard",props:{userText:{},assistantPreview:{},toolCount:{},expanded:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const n=t,{t:o}=me();function s(){n("toggle")}return(a,i)=>(l(),d("div",{class:te(["warm-turn",{"warm-turn--expanded":e.expanded}])},[m("button",{type:"button",class:"warm-turn__head","aria-expanded":e.expanded,onClick:s},[ee(ts,{class:te(["warm-turn__chevron",{"warm-turn__chevron--open":e.expanded}])},null,8,["class"]),m("span",gl,y(e.userText),1),e.toolCount>0?(l(),d("span",pl,y(f(o)("{n} tools",{n:e.toolCount})),1)):S("",!0)],8,ml),m("div",vl,[e.expanded?Ee(a.$slots,"default",{},void 0,!0,0):e.assistantPreview?(l(),d("div",kl,y(e.assistantPreview),1)):S("",!0)])],2))}}),wl=ne(yl,[["__scopeId","data-v-cda74ec1"]]),bl=["aria-expanded","aria-label","title"],Cl={class:"work-block-command"},$l={key:0,class:"work-block-metric"},xl={class:"work-block-output-inner"},Tl=["textContent"],_l=["textContent"],Il={key:0,class:"work-block-output-spill",role:"note"},Ll=["disabled"],Ml={key:1},Sl={key:0,class:"work-block-permission-hint",role:"note"},Al=oe({__name:"WorkBlockItem",props:{command:{},stepIndex:{},expanded:{type:Boolean},compact:{type:Boolean},outputCondensed:{type:Boolean}},emits:["toggle"],setup(e){const t=e,{t:n}=me(),o=P(()=>{var w;return(w=t.command.commandExecution)==null?void 0:w.outputSpill}),s=P(()=>{var w;return((w=o.value)==null?void 0:w.ref)??""}),a=U("idle"),i=U(null),r=P(()=>{const w=o.value;return!!(w&&i.value&&i.value.ref===w.ref)}),u=P(()=>{const w=t.command.commandExecution,G=w==null?void 0:w.outputSpill,q=i.value;return G&&q&&q.ref===G.ref?q.text:(w==null?void 0:w.aggregatedOutput)||"(no output)"});function h(w){return w<1024?`${w} B`:w<1024*1024?`${(w/1024).toFixed(1)} KB`:`${(w/(1024*1024)).toFixed(1)} MB`}const k=P(()=>{const w=o.value;return!w||w.omittedBytes<=0?"":n("Output trimmed: {omitted} omitted of {total}.",{omitted:h(w.omittedBytes),total:h(w.totalBytes)})});async function p(){const w=o.value;if(!(!(w!=null&&w.ref)||a.value==="loading")){a.value="loading";try{i.value={ref:w.ref,text:await Mo(w.ref)},a.value="idle"}catch{a.value="error"}}}const M=P(()=>{var G,q;const w=(G=t.command.commandExecution)==null?void 0:G.status;return w==="inProgress"?"cmd-status-running":w==="completed"&&((q=t.command.commandExecution)==null?void 0:q.exitCode)===0?"cmd-status-ok":"cmd-status-error"}),C=P(()=>{const w=t.command.commandExecution;if(!w)return"";switch(w.status){case"inProgress":return n("Running");case"completed":return w.exitCode===0?n("Done"):`${n("Exit")} ${w.exitCode??"?"}`;case"failed":return n("Failed");case"declined":return n("Declined");case"interrupted":return n("Stopped");default:return""}}),F=P(()=>{var w;return((w=t.command.commandExecution)==null?void 0:w.command)||"(command)"}),_=P(()=>{const w=t.command.commandExecution;return w?w.outputSpill&&w.outputSpill.totalBytes>0?w.outputSpill.totalBytes:w.aggregatedOutput?new TextEncoder().encode(w.aggregatedOutput).length:0:0}),O=P(()=>_.value>0?h(_.value):""),L=P(()=>{const w=t.command.commandExecution;if(!w)return{text:"",cls:""};switch(w.status){case"inProgress":return{text:"RUN",cls:"is-live"};case"completed":return w.exitCode===0?{text:"OK",cls:"is-ok"}:{text:`EXIT ${w.exitCode??"?"}`,cls:"is-alert"};case"failed":return{text:"FAIL",cls:"is-alert"};case"declined":return{text:"SKIP",cls:"is-alert"};case"interrupted":return{text:"STOP",cls:"is-alert"};default:return{text:"",cls:""}}}),b=P(()=>L.value.text),A=P(()=>L.value.cls),T=P(()=>[F.value,C.value,O.value].filter(Boolean).join(" · ")),R=[/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],D=P(()=>{const w=t.command.commandExecution;if(!w||!(w.status==="failed"||w.status==="declined"||typeof w.exitCode=="number"&&w.exitCode!==0))return"";const q=w.aggregatedOutput??"";return!q||!R.some(le=>le.test(q))?"":n("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(w,G)=>{var q;return l(),d("div",{class:te(["work-block",[M.value,{"work-block-expanded":e.expanded,"work-block-compact":e.compact}]])},[m("button",{type:"button",class:"work-block-header","aria-expanded":e.expanded,"aria-label":T.value,title:T.value,onClick:G[0]||(G[0]=le=>w.$emit("toggle"))},[m("span",{class:te(["work-block-pip",A.value]),"aria-hidden":"true"},null,2),m("code",Cl,y(F.value),1),O.value?(l(),d("span",$l,y(O.value),1)):S("",!0),b.value?(l(),d("span",{key:1,class:te(["work-block-status",A.value])},y(b.value),3)):S("",!0)],8,bl),m("div",{class:te(["work-block-output-wrap",{"work-block-output-visible":e.expanded}])},[m("div",xl,[m("pre",{class:"work-block-output-command",textContent:y(((q=e.command.commandExecution)==null?void 0:q.command)||"(command)")},null,8,Tl),m("pre",{class:te(["work-block-output",{"cmd-output-condensed":e.outputCondensed}]),textContent:y(u.value)},null,10,_l),k.value?(l(),d("p",Il,[m("span",null,y(k.value),1),s.value&&!r.value?(l(),d("button",{key:0,type:"button",class:"work-block-output-spill-action",disabled:a.value==="loading",onClick:p},y(a.value==="loading"?f(n)("Loading full output…"):f(n)("Show full output")),9,Ll)):a.value==="error"?(l(),d("span",Ml,y(f(n)("Could not load the full output.")),1)):S("",!0)])):S("",!0)])],2),D.value?(l(),d("p",Sl,y(D.value),1)):S("",!0)],2)}}}),Wn=ne(Al,[["__scopeId","data-v-daded7af"]]),Fl=2;function Nn(e){const t=e.messageType;return t==="commandExecution"||t==="toolCall"}function Pl(e){var n,o;return(((n=e.commandExecution)==null?void 0:n.status)??"")==="inProgress"||(((o=e.toolCall)==null?void 0:o.status)??"")==="inProgress"?!0:(e.messageType??"").endsWith(".live")}function El(e,t){return e.messages.every(n=>t(n))}function Bl(e){const t=[];let n=[],o="";const s=()=>{n.length>0&&(t.push(n),n=[])};for(const r of e){const u=r.turnId??"",h=Nn(r)&&u!=="";(!h||u!==o)&&(n.length>0&&s(),o=h?u:""),h&&n.push(r)}s();const a=new Map;for(const r of e)r.messageType==="worked"&&r.turnId&&typeof r.durationMs=="number"&&a.set(r.turnId,r.durationMs);const i=[];for(const r of t){if(r.length<Fl)continue;const u=r[0].turnId??"";let h=0,k=0,p=0,M=!1;for(const F of r)F.messageType==="toolCall"?h+=1:F.messageType==="reasoning"?k+=1:F.messageType==="commandExecution"&&(p+=1),Pl(F)&&(M=!0);const C=e.some(F=>F.turnId===u&&!Nn(F));i.push({turnId:u,messages:r,running:M,toolCount:h,thoughtCount:k,commandCount:p,durationMs:a.get(u)??0,hasOutsideContent:C})}return i}function Rl(e,t){const{t:n,formatDuration:o}=t,s=[];return e.running?s.push(n("Working…")):e.durationMs>0?s.push(o(e.durationMs)):s.push(n("Processed")),e.toolCount>0&&s.push(n("{n} tools",{n:e.toolCount})),e.thoughtCount>0&&s.push(n("{n} thoughts",{n:e.thoughtCount})),e.commandCount>0&&s.push(n("{n} commands",{n:e.commandCount})),s.join(" · ")}function Ol(e){return e.text.length>0||Array.isArray(e.images)&&e.images.length>0||Array.isArray(e.fileAttachments)&&e.fileAttachments.length>0||Array.isArray(e.skills)&&e.skills.length>0||Array.isArray(e.imageAttachmentIds)&&e.imageAttachmentIds.length>0||Array.isArray(e.audioSources)&&e.audioSources.length>0||Array.isArray(e.mentions)&&e.mentions.length>0}function Dl(e){return!Ol(e)}function Hl(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 Wl(e,t=!1){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"&&(t||!((n=e.messageType)!=null&&n.endsWith(".live")))&&e.text.trim().length>0}function Nl(e,t){var a,i;const n=[];let o=null;for(const r of e)(r.role==="user"||!o)&&(o={key:`turn-${r.id}`,items:[]},n.push(o)),o.items.push({message:r,kind:Hl(r)});const s=n.length-1;for(let r=0;r<n.length;r+=1){const u=n[r],h=(i=(a=u.items.find(C=>{var F;return(F=C.message.turnId)==null?void 0:F.trim()}))==null?void 0:a.message.turnId)==null?void 0:i.trim(),k=t!==void 0&&"liveTurnId"in t;if((t==null?void 0:t.liveOverlayActive)===!0&&(k?h===(t==null?void 0:t.liveTurnId):r===s))continue;const M=[...u.items].reverse().find(C=>Wl(C.message,(t==null?void 0:t.liveOverlayActive)===!1));M&&((t==null?void 0:t.liveOverlayActive)!==!1&&u.items.some(F=>typeof F.message.messageType=="string"&&F.message.messageType.endsWith(".live"))||(M.kind="final-assistant"))}return n}function us(e){return e.replace(/\s+/g," ").trim()}function jl(e){const t=us(e);return t.length<=80?t:t.slice(0,80)}function ds(e){const t=us(e);return t.length<=80?t:t.slice(0,77)+"..."}function Zt(e){return{sessionKey:e,expandedWarmTurns:new Set,coldPage:0}}function xt(e,t){return e.sessionKey===t?e:Zt(t)}function ql(e,t){const n=xt(e,t);return{...n,coldPage:n.coldPage+1}}function Ul(e,t,n){const o=xt(e,t),s=Math.max(0,Math.floor(n));return o.coldPage>=s?o:{...o,coldPage:s}}function jn(e,t,n,o){const s=xt(e,t),a=new Set(s.expandedWarmTurns);return o?a.add(n):a.delete(n),{...s,expandedWarmTurns:a}}function zl(e){return e.role==="user"}function Vl(e){var t;return((t=e.messageType)==null?void 0:t.endsWith(".live"))===!0}function Kl(e){var a;const t=[];let n=-1,o=0;const s=(i,r)=>{t.push({userItem:i,assistantPreview:"",toolCount:0,startIdx:r,endIdx:e.length})};for(let i=0;i<e.length;i+=1){const r=e[i];if(zl(r)){if(n>=0)t[t.length-1].endIdx=i;else{t.push({userItem:r,assistantPreview:"",toolCount:0,startIdx:o,endIdx:e.length}),n=i,o=i;continue}n=i,s(r,i)}else if(n>=0&&t.length>0){const u=t[t.length-1],h=((a=r.text)==null?void 0:a.trim())||"";r.role==="assistant"&&!Vl(r)&&h&&(u.assistantPreview=ds(h)),r.messageType==="toolCall"&&(u.toolCount+=1)}}return t}function Gl({turnCount:e,hotTurns:t,pageSize:n,coldPage:o}){const s=Math.max(0,e),a=Math.max(0,t),i=Math.max(0,s-Math.min(s,a));if(i===0)return{warmStartTurn:0,warmEndTurn:0,coldTurnCount:0};const r=Math.max(0,n),u=Math.max(0,Math.floor(o)),h=Math.min(i,r*(u+1));return{warmStartTurn:i-h,warmEndTurn:i,coldTurnCount:i-h}}function Zl({turn:e,turnCount:t,hotTurns:n,pageSize:o}){const s=Math.max(0,t),a=Math.max(0,n),i=Math.max(0,s-Math.min(s,a));if(i===0||e>=i)return 0;const r=Math.max(1,o),u=Math.max(0,Math.floor(e)),h=i-u;return Math.max(0,Math.ceil(h/r)-1)}function qn(e,t,n){if(t.length===0)return e.slice(0);if(n>=t.length)return[];const o=t[n].startIdx;return e.slice(o)}function Jl(e){const t={};for(const n of e)n.messageType==="worked"&&n.turnId&&typeof n.durationMs=="number"&&(t[n.turnId]=(t[n.turnId]??0)+n.durationMs);return t}function Yl(e){const t=e.trim();if(!t)return"";if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/codex-local-image?"))return t;if(t.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(t)}`;const n=t.startsWith("/"),o=/^[A-Za-z]:[\\/]/u.test(t);return n||o?`/codex-local-image?path=${encodeURIComponent(t)}`:t}function Ue(e,t={}){const n=[],o=/codex:\/\/threads\/[A-Za-z0-9-]+|https?:\/\/[^\s<>"'`,。;:!?、()[\]{}「」『』《》]+|file:\/\/[^\n<>"'`,。;:!?、[\]{}「」『』《》]+|["'](?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^\n"']+["']|`(?:[A-Za-z]:[\\/]|~\/|\.{1,2}\/|\/)[^`\n]+`/gu;let s=0;for(const a of e.matchAll(o)){if(typeof a.index!="number")continue;const i=a.index,r=i+a[0].length;let u=a[0],h="";for(;/[.,;:!?,。;:!?、]$/u.test(u);)h=u.slice(-1)+h,u=u.slice(0,-1);const k=os(e,i,r,s,u),p=(k==null?void 0:k.segmentStart)??i,M=(k==null?void 0:k.segmentEnd)??r;p>s&&n.push({kind:"text",value:e.slice(s,p)}),k!=null&&k.tokenEndTrim&&(u=u.slice(0,-k.tokenEndTrim));const C=wt(u);u=C.core;const F=C.leading,_=C.trailing+h;F&&n.push({kind:"text",value:F});const O=bt(u);if(O)n.push({kind:"url",value:O,href:O}),_&&n.push({kind:"text",value:_});else if(u.startsWith("**")&&u.endsWith("**")&&u.length>4)n.push({kind:"bold",value:u.slice(2,-2)}),_&&n.push({kind:"text",value:_});else if(/^https?:\/\//u.test(u))n.push({kind:"url",value:u,href:u}),_&&n.push({kind:"text",value:_});else{const L=st(u);L?(n.push({kind:"file",value:u,path:L.path,displayPath:u,downloadName:yt(L.path)}),_&&n.push({kind:"text",value:_})):n.push({kind:"text",value:a[0]})}s=M}return s<e.length&&n.push({kind:"text",value:e.slice(s)}),t.applyMarkdownMarkers===!1?n:fs(n)}function qt(e,t){const n=[];let o=!1,s="";const a=i=>{i&&n.push({kind:"text",value:i})};for(const i of e){if(i.kind!=="text"){o&&(a(`${t.marker}${s}`),o=!1,s=""),n.push(i);continue}let r=i.value;for(;r.length>0;){const u=r.indexOf(t.marker);if(u<0){o?s+=r:a(r);break}const h=r.slice(0,u);if(o?s+=h:a(h),r=r.slice(u+t.marker.length),o){const k=s;k.length>0&&(!t.isValidContent||t.isValidContent(k))?n.push({kind:t.kind,value:k}):a(`${t.marker}${k}${t.marker}`),s="",o=!1}else o=!0}}return o&&a(`${t.marker}${s}`),n}function fs(e){const t=o=>o.trim().length>0&&!/^\s/u.test(o)&&!/\s$/u.test(o);let n=qt(e,{marker:"**",kind:"bold",isValidContent:t});return n=qt(n,{marker:"~~",kind:"strikethrough",isValidContent:t}),n=qt(n,{marker:"*",kind:"italic",isValidContent:t}),n}function Xl(e,t={}){const n=[];let o=0,s=0;const a=(i,r)=>{let u=i.indexOf("[",r);for(;u>=0;){const h=i.indexOf("]",u+1);if(h<0)return null;if(i[h+1]!=="("){u=i.indexOf("[",u+1);continue}let k=1,p=h+2,M=!1;for(;p<i.length;){const C=i[p];if(C===`
|
|
28
|
-
`){M=!0;break}if(C==="("&&(k+=1),C===")"&&(k-=1,k===0)){const F=i.slice(u,p+1);if(zt(F))return{start:u,end:p+1,token:F};break}p+=1}if(M){u=i.indexOf("[",u+1);continue}u=i.indexOf("[",u+1)}return null};for(;s<e.length;){const i=a(e,s);if(!i)break;const{start:r,end:u,token:h}=i,k=os(e,r,u,o,h),p=(k==null?void 0:k.segmentStart)??r,M=(k==null?void 0:k.segmentEnd)??u;p>o&&n.push(...Ue(e.slice(o,p),t));const C=zt(h);if(!C){n.push(...Ue(e.slice(p,M),t)),o=M,s=M;continue}const F=C.label,_=C.target,O=bt(_);if(O)n.push({kind:"url",value:F||O,href:O});else if(/^https?:\/\//u.test(_))n.push({kind:"url",value:F||_,href:_});else{const L=st(_);L?n.push({kind:"file",value:_,path:L.path,displayPath:F||_,downloadName:yt(L.path)}):n.push({kind:"text",value:h})}o=M,s=M}return o<e.length&&n.push(...Ue(e.slice(o),t)),n}function Ql(e){const t=e.includes("`"),n=Xl(e,{applyMarkdownMarkers:!t});if(!t)return n;if(!n.some(s=>s.kind==="text"&&s.value.includes("`")))return fs(n);const o=s=>{if(!s.includes("`"))return Ue(s);const a=[];let i=0,r=0;for(;i<s.length;){if(s[i]!=="`"){i+=1;continue}let u=1;for(;i+u<s.length&&s[i+u]==="`";)u+=1;const h="`".repeat(u);let k=i+u,p=-1;for(;k<s.length;){const C=s.indexOf(h,k);if(C<0)break;const F=C>0&&s[C-1]==="`",_=C+u<s.length&&s[C+u]==="`",O=s.slice(i+u,C).includes(`
|
|
29
|
-
`);if(!F&&!_&&!O){p=C;break}k=C+1}if(p<0){i+=u;continue}i>r&&a.push(...Ue(s.slice(r,i)));const M=s.slice(i+u,p);if(M.length>0){const C=zt(M);if(C){const F=bt(C.target);if(F)a.push({kind:"url",value:C.label||F,href:F});else if(/^https?:\/\//u.test(C.target))a.push({kind:"url",value:C.label||C.target,href:C.target});else{const _=st(C.target);_?a.push({kind:"file",value:C.target,path:_.path,displayPath:C.label||C.target,downloadName:yt(_.path)}):a.push({kind:"code",value:M})}}else{const F=bt(M);if(F)a.push({kind:"url",value:F,href:F});else if(/^https?:\/\/[^\s]+$/u.test(M))a.push({kind:"url",value:M,href:M});else{const _=st(M);if(_){const O=_.line?`${_.path}:${String(_.line)}`:_.path;a.push({kind:"file",value:M,path:_.path,displayPath:O,downloadName:yt(_.path)})}else a.push({kind:"code",value:M})}}}else a.push({kind:"text",value:`${h}${h}`});i=p+u,r=i}return r<s.length&&a.push(...Ue(s.slice(r))),a};return n.flatMap(s=>s.kind==="text"?o(s.value):[s])}function hs(e){return e.replace(/\r\n/gu,`
|
|
30
|
-
`)}function _e(e){var n;return(((n=e.match(/^\s*/u))==null?void 0:n[0])??"").replace(/\t/gu," ").length}function ms(e,t){if(t<=0)return e.trimStart();let n=0,o=0;for(;n<e.length&&o<t;){const s=e[n];o+=s===" "?4:1,n+=1}return e.slice(n)}function Ie(e){return e.trim().length===0}function Jt(e){const t=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return t?{level:t[1].length,value:t[2].trim()}:null}function pt(e){const t=e.match(/^\s{0,3}>\s?(.*)$/u);return t?t[1]??"":null}function ot(e){var n;const t=e.match(/^\s*[-*+]\s+(.+)$/u);return((n=t==null?void 0:t[1])==null?void 0:n.trim())??null}function ec(e){var n;const t=e.match(/^(\s*)[-*+]\s+(.+)$/u);return t?{indent:_e(t[1]??""),text:((n=t[2])==null?void 0:n.trim())??""}:null}function at(e){var n;const t=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return t?{checked:(t[1]??" ").toLowerCase()==="x",text:((n=t[2])==null?void 0:n.trim())??""}:null}function Un(e){var n;const t=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return t?{indent:_e(t[1]??""),item:{checked:(t[2]??" ").toLowerCase()==="x",text:((n=t[3])==null?void 0:n.trim())??""}}:null}function gs(e){var n;const t=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return t?{indent:_e(t[1]??""),start:Number.parseInt(t[2]??"1",10)||1,text:((n=t[3])==null?void 0:n.trim())??""}:null}function Yt(e){var t;return((t=gs(e))==null?void 0:t.text)??null}function zn(e){return gs(e)}function Xt(e){const t=e.trim();if(!t.includes("|"))return null;let n=t;n.startsWith("|")&&(n=n.slice(1)),n.endsWith("|")&&(n=n.slice(0,-1));const o=[];let s="",a=0;for(let i=0;i<n.length;i+=1){const r=n[i];if(r==="\\"&&n[i+1]==="|"){s+="|",i+=1;continue}if(r==="`"){let u=1;for(;n[i+u]==="`";)u+=1;s+=n.slice(i,i+u),a===0?a=u:a===u&&(a=0),i+=u-1;continue}if(r==="|"&&a===0){o.push(s.trim()),s="";continue}s+=r}return o.push(s.trim()),o.some(i=>i.length>0)?o:null}function tc(e){const t=Xt(e);if(!t||t.length===0)return null;const n=t.map(o=>{const s=o.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(s))return null;const a=s.startsWith(":"),i=s.endsWith(":");return a&&i?"center":i?"right":a?"left":null});return n.every((o,s)=>o!==null||/^-+$/u.test(t[s].replace(/\s+/gu,"")))?n:null}function Vn(e,t){return e.length===t?e:e.length>t?e.slice(0,t):[...e,...Array.from({length:t-e.length},()=>"")]}function Kn(e,t){var k;if(t+1>=e.length)return null;const n=e[t],o=e[t+1],s=Xt(n),a=tc(o);if(!s||!a||s.length!==a.length)return null;const i=n.trim();if(!i.startsWith("|")&&(((k=i.match(/\|/gu))==null?void 0:k.length)??0)<2)return null;const r=s.length,u=[];let h=t+2;for(;h<e.length&&!Ie(e[h]);){const p=Xt(e[h]);if(!p)break;u.push(Vn(p,r)),h+=1}return{kind:"table",headers:Vn(s,r),rows:u,alignments:a}}function nc(e){return Ie(e)||Ct(e)!==null||Qt(e)||Jt(e)!==null||pt(e)!==null||at(e)!==null||ot(e)!==null||Yt(e)!==null}function sc(e,t,n=-1){const o=[];let s=t;for(;s<e.length&&!(nc(e[s])||n>=0&&_e(e[s])<=n);)o.push(n>=0?ms(e[s],n+1):e[s]),s+=1;const a=o.join(`
|
|
31
|
-
`).trim();return a?{value:a,nextIndex:s}:null}function ps(e,t){for(let n=t;n<e.length;n+=1)if(!Ie(e[n]))return n;return-1}function oc(e,t,n,o=null,s=!1){const a=[];let i=t;for(;i<e.length;){const r=e[i];if(Ie(r)){const p=ps(e,i+1);if(p===-1){a.push(""),i=e.length;break}const M=o==null?void 0:o(e[p]);if(M&&M.indent===n||_e(e[p])<=n)break;a.push(""),i+=1;continue}const u=o==null?void 0:o(r);if(u&&u.indent===n)break;const h=_e(r),k=s&&(at(r)!==null||ot(r)!==null);if(h<=n&&!k)break;a.push(h>n?ms(r,n+1):r.trimStart()),i+=1}for(;a.length>0&&Ie(a[0]);)a.shift();for(;a.length>0&&Ie(a[a.length-1]);)a.pop();return a.length===0?null:{blocks:vt(a.join(`
|
|
32
|
-
`)),nextIndex:i}}function Gn(e,t,n,o=!1){const s=[];let a=t;const i=n(e[t]);if(!i)return null;const r=i.indent;for(;a<e.length;){const u=n(e[a]);if(u===null||u.indent!==r)break;const h=[u.text],k=[];for(a+=1;a<e.length;){if(Ie(e[a])){const _=ps(e,a+1);if(_===-1){a=e.length;break}const O=n(e[_]);if(O&&O.indent===r){a=_;break}if(_e(e[_])<=r){a=_;break}a+=1;continue}const p=n(e[a]);if(p&&p.indent===r)break;const M=_e(e[a])>r,C=o&&(at(e[a])!==null||ot(e[a])!==null);if(M||C){const _=oc(e,a,r,n,o);if(_){k.push(..._.blocks),a=_.nextIndex;continue}}if(_e(e[a])<=r)break;const F=sc(e,a,r);if(!F)break;h.push(F.value),a=F.nextIndex}s.push(k.length>0?{paragraphs:h,children:k}:{paragraphs:h})}return s.length>0?{items:s,nextIndex:a}:null}function Qt(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function Ct(e){const t=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return t?{marker:t[1],language:(t[2]??"").trim()}:null}function vt(e){var a;const n=hs(e).split(`
|
|
33
|
-
`),o=[];let s=0;for(;s<n.length;){if(Ie(n[s])){s+=1;continue}const i=Ct(n[s]);if(i){s+=1;const _=[];for(;s<n.length;){if(n[s].trim()===i.marker){s+=1;break}_.push(n[s]),s+=1}o.push({kind:"codeBlock",language:i.language,value:_.join(`
|
|
34
|
-
`)});continue}if(Qt(n[s])){o.push({kind:"thematicBreak"}),s+=1;continue}const r=Jt(n[s]);if(r){o.push({kind:"heading",level:r.level,value:r.value}),s+=1;continue}if(pt(n[s])!==null){const _=[];for(;s<n.length;){const O=pt(n[s]);if(O===null)break;_.push(O),s+=1}o.push({kind:"blockquote",value:_.join(`
|
|
35
|
-
`).trim()});continue}const h=Kn(n,s);if(h){o.push(h),s+=2+h.rows.length;continue}if(at(n[s])!==null){const _=[],O=((a=Un(n[s]))==null?void 0:a.indent)??0;for(;s<n.length;){const L=Un(n[s]);if(L===null||L.indent!==O)break;_.push(L.item),s+=1}if(_.length>0){o.push({kind:"taskList",items:_});continue}}const p=ot(n[s]);if(p!==null){const _=Gn(n,s,ec);if(_){o.push({kind:"unorderedList",items:_.items}),s=_.nextIndex;continue}if(p.length>0){o.push({kind:"unorderedList",items:[{paragraphs:[p]}]}),s+=1;continue}}const M=Yt(n[s]);if(M!==null){const _=zn(n[s]),O=Gn(n,s,zn,!0);if(O){o.push({kind:"orderedList",items:O.items,start:(_==null?void 0:_.start)??1}),s=O.nextIndex;continue}if(M.length>0){o.push({kind:"orderedList",items:[{paragraphs:[M]}],start:(_==null?void 0:_.start)??1}),s+=1;continue}}const C=[];for(;s<n.length&&!(Ie(n[s])||Ct(n[s])||Qt(n[s])||Jt(n[s])||Kn(n,s)||pt(n[s])!==null||at(n[s])!==null||ot(n[s])!==null||Yt(n[s])!==null);)C.push(n[s]),s+=1;const F=C.join(`
|
|
36
|
-
`).trim();F&&o.push({kind:"paragraph",value:F})}return o}function ac(e){if(!e.includes(")return vt(e);const t=[],n=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let o=0;for(const s of e.matchAll(n)){const[a,i,r]=s;if(typeof s.index!="number")continue;const u=s.index,h=u+a.length,k=Yl(r.trim());k&&(u>o&&t.push(...vt(e.slice(o,u))),t.push({kind:"image",url:k,alt:i.trim(),markdown:a}),o=h)}return o<e.length&&t.push(...vt(e.slice(o))),t}function Zn(e){const n=hs(e).split(`
|
|
37
|
-
`),o=[];let s=0,a=0;const i=r=>{if(r<=a)return;const u=n.slice(a,r).join(`
|
|
38
|
-
`);o.push(...ac(u))};for(;s<n.length;){const r=Ct(n[s]);if(!r){s+=1;continue}i(s),s+=1;const u=[];for(;s<n.length;){if(n[s].trim()===r.marker){s+=1;break}u.push(n[s]),s+=1}o.push({kind:"codeBlock",language:r.language,value:u.join(`
|
|
39
|
-
`)}),a=s}return i(n.length),o.length>0?o:[{kind:"paragraph",value:e}]}const ic=300,rc=1200,lc=300,cc=250;function uc(e){const{getCwd:t,isVideoMediaUrl:n}=e,o=U(null),s=U(0);let a=null;const i=new Map,r=new Map,u=new Map,h=new Map;function k(I,E,W,Q){for(I.has(E)&&I.delete(E),I.set(E,W);I.size>Q;){const ae=I.keys().next().value;if(ae===void 0)break;I.delete(ae)}return W}function p(){return o.value?Promise.resolve():(a||(a=So(()=>import("./common-DEPjExR-.js"),[]).then(I=>{o.value=I.default,h.clear(),u.clear(),s.value+=1}).finally(()=>{a=null})),a)}function M(){return!!o.value}function C(I){const E=r.get(I);return E?(r.delete(I),r.set(I,E),E):k(r,I,Ql(I),rc)}function F(I){const E=I.trim();if(!E)return"#";const W=V=>V.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(V),Q=st(E),ae=(Q==null?void 0:Q.path)??E,H=ss(ae,t());if(W(H)){const V=H.startsWith("/")?H:`/${H}`;return`/codex-local-browse${encodeURI(V)}`}return"#"}function _(I){const E=I.trim();if(!E)return"";try{const W=new URL(E,window.location.href);return W.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${W.pathname.slice(19)}`}${W.search}${W.hash}`:""}catch{return""}}function O(I){const E=i.get(I.id);if(E&&E.text===I.text&&E.cwd===t())return i.delete(I.id),i.set(I.id,E),E.blocks;const W=Zn(I.text);return k(i,I.id,{text:I.text,cwd:t(),blocks:W},ic).blocks}function L(I){return I.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function b(I){var W;const E=((W=I.trim().split(/\s+/u)[0])==null?void 0:W.toLowerCase())??"";return E?rs[E]??E:""}function A(I,E){const W=b(I);if(!W)return L(E);const Q=o.value;if(!Q)return L(E);try{if(Q.getLanguage(W))return Q.highlight(E,{language:W,ignoreIllegals:!0}).value}catch{}return L(E)}function T(I,E){return Wt(R(I,E))}function R(I,E){const W=`${s.value}\0${b(I)}\0${I}\0${E}`,Q=h.get(W);return Q!==void 0?(h.delete(W),h.set(W,Q),Q):k(h,W,A(I,E),cc)}function D(I){return C(I).map(E=>E.kind==="text"?L(E.value):E.kind==="bold"?`<strong class="message-bold-text">${L(E.value)}</strong>`:E.kind==="italic"?`<em class="message-italic-text">${L(E.value)}</em>`:E.kind==="strikethrough"?`<s class="message-strikethrough-text">${L(E.value)}</s>`:E.kind==="file"?`<a class="message-file-link" href="${L(F(E.path))}" target="_blank" rel="noopener noreferrer" title="${L(E.path)}">${L(E.displayPath)}</a>`:E.kind==="url"?`<a class="message-file-link" href="${L(E.href)}" target="_blank" rel="noopener noreferrer" title="${L(E.href)}">${L(E.value)}</a>`:`<code class="message-inline-code">${L(E.value)}</code>`).join("")}function w(I){return I.paragraphs.map(E=>`<div class="message-list-item-text message-list-item-paragraph">${D(E)}</div>`).join("")}function G(I){var Q;const E=w(I),W=((Q=I.children)==null?void 0:Q.map(ae=>le(ae)).join(""))??"";return Wt(E+W)}function q(I){return I?` style="text-align:${I}"`:""}function le(I){if(I.kind==="paragraph")return`<p class="message-text">${D(I.value)}</p>`;if(I.kind==="heading"){const E=Math.min(6,Math.max(1,Math.trunc(I.level))),W=as(E),Q=`message-heading ${is(E)}`;return`<${W} class="${Q}">${D(I.value)}</${W}>`}if(I.kind==="blockquote")return`<blockquote class="message-blockquote">${D(I.value)}</blockquote>`;if(I.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${I.items.map(W=>`<li class="message-list-item"><div class="message-list-item-content">${G(W)}</div></li>`).join("")}</ul>`;if(I.kind==="taskList")return`<ul class="message-list message-task-list">${I.items.map(W=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${W.checked?"true":"false"}">${W.checked?"☑":"☐"}</span><div class="message-list-item-text">${D(W.text)}</div></li>`).join("")}</ul>`;if(I.kind==="orderedList"){const E=I.items.map(W=>`<li class="message-list-item"><div class="message-list-item-content">${G(W)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${I.start}">${E}</ol>`}if(I.kind==="table"){const E=I.headers.map((ae,H)=>`<th class="message-table-head-cell"${q(I.alignments[H]??null)}>${D(ae)}</th>`).join(""),W=I.rows.map(ae=>'<tr class="message-table-body-row">'+ae.map((H,V)=>`<td class="message-table-cell"${q(I.alignments[V]??null)}>${D(H)}</td>`).join("")+"</tr>").join(""),Q=W?`<tbody>${W}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${E}</tr></thead>${Q}</table></div>`}return I.kind==="codeBlock"?`<div class="message-code-block"><div class="message-code-bar">${I.language?`<span class="message-code-language">${L(I.language)}</span>`:""}<span class="message-code-copy" role="button" tabindex="0" data-code-copy>Copy</span></div><pre class="message-code-pre"><code class="hljs">${T(I.language,I.value)}</code></pre></div>`:I.kind==="thematicBreak"?'<hr class="message-divider">':n(I.url)?`<video class="message-image-preview message-video-preview message-markdown-image" src="${L(I.url)}" controls preload="metadata"></video>`:`<img class="message-image-preview message-markdown-image" src="${L(I.url)}" alt="${L(I.alt||"Embedded message image")}" loading="lazy">`}function Oe(I){const E=`${t()}\0${s.value}\0${I}`,W=u.get(E);if(W&&W.text===I&&W.cwd===t()&&W.highlightVersion===s.value)return u.delete(E),u.set(E,W),W.html;const Q=Zn(I).map(H=>le(H)).join(""),ae=Wt(Q);return k(u,E,{text:I,cwd:t(),highlightVersion:s.value,html:ae},lc).html}function Ge(){i.clear(),r.clear(),u.clear(),h.clear()}return{highlightCacheVersion:s,hasHighlightLoaded:M,ensureHighlightJsLoaded:p,getInlineSegments:C,toBrowseUrl:F,toEditUrlFromBrowseHref:_,getMessageBlocks:O,renderListItemContentAsHtml:G,renderCachedHighlightedCodeAsHtml:T,renderMarkdownBlocksAsHtml:Oe,clearRenderCaches:Ge}}const dc=["data-thread-id"],fc={key:0,class:"conversation-switching-bar",role:"status"},hc={key:1,class:"conversation-loading"},mc={key:2,class:"conversation-loading conversation-loading-slow",role:"status"},gc={key:3,class:"conversation-empty"},pc={key:0,class:"conversation-load-more"},vc=["disabled"],kc={key:1,class:"conversation-load-more conversation-warm-collapse"},yc=["disabled"],wc=["id"],bc={class:"message-row","data-role":"system"},Cc={class:"message-stack","data-role":"system"},$c={class:"message-row","data-role":"system","data-message-type":"fileChange"},xc={class:"message-stack","data-role":"system"},Tc={key:0,class:"conversation-item conversation-item-fold","data-role":"system","data-message-type":"processFold"},_c={class:"message-row","data-role":"system"},Ic={class:"message-stack","data-role":"system"},Lc={key:0,class:"work-block-list"},Mc=["id","data-role","data-message-type"],Sc={key:0,class:"message-row thread-compaction-row","data-role":"system"},Ac={class:"thread-compaction-inline thread-compaction-inline--pending",role:"status"},Fc={key:1,class:"message-row thread-compaction-row","data-role":"system"},Pc={class:"thread-compaction-inline thread-compaction-inline--done",role:"status"},Ec={key:2,class:"message-row","data-role":"system"},Bc={class:"message-stack","data-role":"system"},Rc={class:"work-block-list"},Oc=["data-role","data-message-type"],Dc=["data-role"],Hc=["data-role"],Wc={key:5,class:"message-row","data-role":"system","data-message-type":"plan"},Nc={class:"message-stack","data-role":"system"},jc={class:"thread-plan-record"},qc={class:"thread-plan-record-header"},Uc={key:0,class:"thread-plan-record-explanation"},zc={key:1,class:"thread-plan-record-steps"},Vc=["data-status"],Kc={class:"thread-plan-record-marker","aria-hidden":"true"},Gc=["data-role","data-message-type"],Zc=["data-role"],Jc=["data-role"],Yc=["data-role"],Xc=["onClick"],Qc=["src"],eu=["src","alt"],tu={key:1,class:"message-file-attachments"},nu=["href","title"],su={key:2,class:"message-file-attachments"},ou=["title"],au={class:"message-file-chip-name"},iu={key:3,class:"message-skill-attachments"},ru=["href","title"],lu={class:"message-skill-chip-prefix"},cu={class:"message-skill-chip-name"},uu={key:4,class:"message-audio-attachments"},du=["src"],fu={key:5,class:"message-file-attachments"},hu=["title"],mu={class:"message-file-chip-name"},gu=["data-role"],pu={key:0,class:"automation-message-label"},vu={key:0},ku={key:1,class:"work-summary-wrap","aria-live":"polite"},yu={class:"work-summary-text"},wu={key:0,class:"message-text"},bu={key:2,class:"message-blockquote"},Cu={key:3,class:"message-list message-list-unordered"},$u=["innerHTML"],xu={key:4,class:"message-list message-task-list"},Tu=["data-checked"],_u={class:"message-list-item-text"},Iu=["start"],Lu=["innerHTML"],Mu={key:6,class:"message-table-wrap"},Su={class:"message-table"},Au={key:0},Fu={key:7,class:"message-code-block"},Pu={class:"message-code-bar"},Eu={key:0,class:"message-code-language"},Bu={class:"message-code-copy",role:"button",tabindex:"0","data-code-copy":""},Ru={class:"message-code-pre"},Ou=["innerHTML"],Du={key:8,class:"message-divider"},Hu={key:9,class:"message-text"},Wu=["onClick"],Nu=["src"],ju=["src","alt","onError"],qu=["href","onClick"],Uu=["title","aria-label"],zu=["aria-label"],Vu=["src"],Ku=["src","alt"],Gu=16,Jn=30,Yn=20,Zu=200,Ju=oe({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},liveTurnId:{},isLoading:{type:Boolean},isSlowOpen:{type:Boolean},activeThreadId:{},cwd:{},hasMorePersistedAbove:{type:Boolean},isLoadingPersistedAbove:{type:Boolean},loadEarlierMessages:{type:Function}},emits:["forkThread","rollback","respondServerRequest","fileChangesChanged"],setup(e,{expose:t,emit:n}){function o(c){return Zo(c,a.cwd,X)}function s(c){return Ke(c,a.cwd)}const a=e,i=uc({getCwd:()=>a.cwd,isVideoMediaUrl:ht}),{highlightCacheVersion:r,hasHighlightLoaded:u,ensureHighlightJsLoaded:h,getInlineSegments:k,toBrowseUrl:p,toEditUrlFromBrowseHref:M,getMessageBlocks:C,renderListItemContentAsHtml:F,renderCachedHighlightedCodeAsHtml:_,renderMarkdownBlocksAsHtml:O,clearRenderCaches:L}=i,b=ia({getMessages:()=>a.messages,getLiveOverlay:()=>a.liveOverlay,isCommandMessage:Ze}),{hiddenGroupedCommandIds:A,isCommandExpanded:T,isCommandCompact:R,isCommandOutputCondensed:D,toggleCommandExpand:w,getWorkBlockCommands:G,pruneCommandIdSets:q}=b,le=la({toEditUrlFromBrowseHref:M}),{isFileLinkContextMenuVisible:Oe,fileLinkContextMenuX:Ge,fileLinkContextMenuY:I,fileLinkContextBrowseUrl:E,fileLinkContextEditUrl:W,handleConversationContextMenu:Q,closeFileLinkContextMenu:ae}=le,{isMobile:H}=Ao(),V=oa({getMessages:()=>a.messages,getLiveTurnId:()=>a.liveTurnId??"",isFileChangeMessage:St,isCopyableAssistantMessage:un,isReasoningMessage:It,isPlanMessage:_t,isFoldMember:Tn,getHiddenGroupedCommandIds:()=>A.value,isMobile:()=>H.value}),{anchoredFileChangeSummaryByAnchorId:ue,hiddenFileChangeMessageIds:ge,isDiffViewerFileListOpen:ie,diffViewerChanges:re,activeDiffViewerChange:pe,activeDiffViewerLines:z,toggleFileChangeSummary:ve,isFileChangeSummaryExpanded:Le,openDiffViewer:it,closeDiffViewer:Me,toggleDiffViewerFileList:vs,closeDiffViewerFileList:ks,selectDiffViewerChange:ys,readAnchoredFileChangeSummaryById:ke,isFileChangeSummaryExpandedById:ws,toggleFileChangeSummaryById:bs,readStandaloneFileChangeSummary:ye,isFileChangeSummaryVisible:tn,pruneFileChangeSummaryIds:Cs}=V,$s=aa({getMessages:()=>a.messages,isCopyableAssistantMessage:un,isPlanMessage:_t,planStepCopyMarker:_n,buildFileChangeCopyText:o,getAnchoredFileChangeSummaries:()=>ue.value}),{copiedResponseAnchorId:xs,forkableTurnIndexByAnchorId:Ts,showCopyResponseButton:_s,isCopyableUserMessage:Is,copyUserMessage:Ls,showForkResponseButton:Ms,copyResponse:Ss}=$s,{buildFeedbackMailto:As,feedbackMailtoBase:Fs,recordVisibleFailure:Ps}=es(),{t:X}=me(),nn=Fs();function Es(c){if(!c)return"";const g=new Date(c);if(Number.isNaN(g.getTime()))return"";const x=new Date,B=g.getFullYear()===x.getFullYear()&&g.getMonth()===x.getMonth()&&g.getDate()===x.getDate(),J=g.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1});return B?J:`${g.toLocaleDateString([],{month:"2-digit",day:"2-digit"})} ${J}`}const Tt=new WeakMap;async function sn(c){var v;const g=c.target,x=g==null?void 0:g.closest("[data-code-copy]");if(!x)return;const B=(v=x.closest(".message-code-block"))==null?void 0:v.querySelector("code");if(!B)return;try{await kt(B.textContent??"")}catch{return}x.textContent=X("Copied"),x.dataset.copied="true";const J=Tt.get(x);J!==void 0&&window.clearTimeout(J),Tt.set(x,window.setTimeout(()=>{x.textContent=X("Copy"),delete x.dataset.copied,Tt.delete(x)},1600))}function Bs(c,g){Ps(g);const x=c.currentTarget;x instanceof HTMLAnchorElement&&(x.href=As())}function Ze(c){return c.messageType==="commandExecution"&&!!c.commandExecution}function on(c){return c.messageType==="compaction.pending"}function an(c){return c.messageType==="compaction.done"}function _t(c){return c.messageType==="plan"||c.messageType==="plan.live"}function rn(c){return c.messageType==="modelSwitch"}function It(c){return c.messageType==="reasoning"&&!!c.reasoning}const Lt=U(new Set);function ln(c){return Lt.value.has(c.id)}function cn(c){const g=new Set(Lt.value);g.has(c.id)?g.delete(c.id):g.add(c.id),Lt.value=g}function Mt(c){return c.messageType==="toolCall"&&!!c.toolCall}function Rs(c){return c.messageType==="turnError"}function St(c){return c.messageType==="fileChange"&&c.fileChangeStatus==="completed"&&Array.isArray(c.fileChanges)&&c.fileChanges.length>0}function Os(c){return Ze(c)||Mt(c)||St(c)||on(c)||an(c)||c.messageType==="plan"?!1:Dl(c)}function un(c){return c.role==="assistant"&&!Ze(c)&&c.messageType!=="worked"&&!(c.messageType??"").endsWith(".live")}const At=n,Se=U(null),dn=U(null),Ds=ca({isVideo:ht}),{modalImageUrl:rt,modalIsVideo:Hs,markdownImageFailureVersion:Ws,isMarkdownImageFailed:Ns,onMarkdownImageError:js,openImageModal:fn,closeImageModal:lt}=Ds,qs=ra({getActiveThreadId:()=>a.activeThreadId,getCwd:()=>a.cwd,onFileChangesChanged:()=>At("fileChangesChanged",a.activeThreadId),updateThreadFileChanges:Oo,t:X}),{fileChangeActionKey:hn,isFileChangeActionable:mn,fileChangeActionStatus:gn,fileChangeActionErrorText:pn,fileChangeNextAction:vn,fileChangeActionLabel:kn,runFileChangeAction:Us,resetFileChangeActions:zs}=qs,Ce=U(null),Vs=P(()=>{const c=Ce.value;return c?c.kind==="edit-message"?X("Rollback this turn?"):c.action==="undo"?X("Undo file changes?"):X("Redo file changes?"):""}),Ks=P(()=>{const c=Ce.value;return c?c.kind==="edit-message"?X("This rolls the thread back to this turn so you can edit the message. Later replies will be removed."):c.filePathLabel?c.action==="undo"?X("Undo the changes to {file}? This modifies the working tree and Codex cannot revert it automatically.",{file:c.filePathLabel}):X("Redo the changes to {file}? This reapplies the edits to the working tree.",{file:c.filePathLabel}):c.action==="undo"?X("Undo the file changes from this turn? This modifies the working tree and Codex cannot revert it automatically."):X("Redo the file changes from this turn? This reapplies the edits to the working tree."):""}),Ae=U(!0);let Be=0,we=0,ct=0,Je=null;const yn=new WeakSet,Fe=U(Zt(a.activeThreadId)),wn=P(()=>xt(Fe.value,a.activeThreadId)),Pe=U(!1),Ft=P(()=>a.messages.filter(c=>!_t(c)&&!rn(c))),De=P(()=>Kl(Ft.value)),Pt=P(()=>Gl({turnCount:De.value.length,hotTurns:Jn,pageSize:Yn,coldPage:wn.value.coldPage})),Et=P(()=>Pt.value.warmStartTurn),He=P(()=>Pt.value.warmEndTurn),bn=P(()=>Pt.value.coldTurnCount),Cn=P(()=>bn.value>0),Bt=P(()=>wn.value.expandedWarmTurns),Gs=P(()=>{const c=Ft.value,g=De.value,x=[],B=Bt.value,J=new Map,v=[];for(const N of a.messages){if(!rn(N))continue;const Y={from:N.modelSwitchFrom,to:N.modelSwitchTo};if(N.modelSwitchInsertAfterId){const de=J.get(N.modelSwitchInsertAfterId)??[];de.push(Y),J.set(N.modelSwitchInsertAfterId,de)}else v.push(Y)}function he(N){const Y=[];for(const de of N){const be=J.get(de.message.id);be&&be.length>0&&(Y.push(...be),J.delete(de.message.id))}return Y}for(let N=Et.value;N<He.value;N+=1){const Y=g[N];if(!Y)continue;const de={turn:N,userText:ds(Y.userItem.text),assistantPreview:Y.assistantPreview,toolCount:Y.toolCount,expanded:B.has(N)},be=B.has(N)?c.slice(Y.startIdx,Y.endIdx).map(We=>({message:We})):[],mt=he(c.slice(Y.startIdx,Math.min(Y.endIdx,c.length)).map(We=>({message:We})));x.push({key:`warm-${N}`,warm:de,warmItems:be,processItems:[],fileChangeAnchorIds:[],...mt.length>0?{dividers:mt}:{}})}const $e=qn(c,g,He.value),Qe=$e[0];if(!Qe)return x;const et=c.findIndex(N=>N.id===Qe.id),$=et>=0?c.slice(et):$e;for(const N of Nl($,{liveOverlayActive:a.liveOverlay!==null,liveTurnId:a.liveTurnId})){const Y=N.items.find(fe=>fe.kind==="user"),de=N.items.find(fe=>fe.kind==="final-assistant"),be=N.items.filter(fe=>fe!==Y&&fe!==de&&fe.message.messageType!=="worked").map(fe=>({message:fe.message,presentation:fe.kind==="plan"?"plan":"process"})),mt=N.items.map(fe=>fe.message.id).filter(fe=>!!ke(fe)),We=he(N.items);x.push({key:N.key,warmItems:[],request:Y?{message:Y.message}:void 0,processItems:be,fileChangeAnchorIds:mt,finalItem:de?{message:de.message,presentation:"final-assistant"}:void 0,...We.length>0?{dividers:We}:{}})}const Z=[...v,...J.values()].flat();return Z.length>0&&(x.length>0?x[0]={...x[0],leadingDividers:[...x[0].leadingDividers??[],...Z]}:x.push({key:"leading-divider",warmItems:[],processItems:[],fileChangeAnchorIds:[],leadingDividers:Z})),x}),Zs=P(()=>Jl(a.messages));function Js(c){var x,B;const g=((x=c.request)==null?void 0:x.message.turnId)??((B=c.finalItem)==null?void 0:B.message.turnId);return g?Zs.value[g]:void 0}function $n(){Fe.value=ql(Fe.value,a.activeThreadId)}function Ys(c){Fe.value=jn(Fe.value,a.activeThreadId,c,!Bt.value.has(c))}const xn=P(()=>De.value.map((c,g)=>({turn:g,text:jl(c.userItem.text)}))),Xs=P(()=>Math.max(0,xn.value.length-1)),Qs=P(()=>{const c=new Map;return De.value.forEach((g,x)=>{c.set(g.userItem.id,x)}),c});function Rt(c){return`question-anchor-${c}`}function eo(c){const g=Qs.value.get(c.id);if(g!==void 0&&!(g<He.value))return Rt(g)}function to(c){if(c<He.value){let g=Fe.value;if(c<Et.value){const x=Zl({turn:c,turnCount:De.value.length,hotTurns:Jn,pageSize:Yn});g=Ul(g,a.activeThreadId,x)}g=jn(g,a.activeThreadId,c,!0),Fe.value=g}Ae.value=!1,gt().then(()=>{const g=Se.value,x=document.getElementById(Rt(c));if(!g||!x)return;const B=x.getBoundingClientRect(),J=g.getBoundingClientRect(),v=g.scrollTop+B.top-J.top-12;g.scrollTo({top:Math.max(0,v),behavior:"smooth"})})}const no=P(()=>{const c=Ft.value,g=De.value,x=[];for(let he=Et.value;he<He.value;he+=1){if(!Bt.value.has(he))continue;const $e=g[he];$e&&x.push(...c.slice($e.startIdx,$e.endIdx))}const B=qn(c,g,He.value),J=B[0];if(!J)return x;const v=c.findIndex(he=>he.id===J.id);return x.push(...v>=0?c.slice(v):B),x}),ut=P(()=>Bl(no.value)),Ye=P(()=>{var g;const c=new Map;for(const x of ut.value){const B=((g=x.messages[0])==null?void 0:g.id)??"";B&&c.set(B,x)}return c}),so=P(()=>{const c=new Set;for(const g of ut.value)for(const x of g.messages)c.add(x.id);return c}),oo=P(()=>{var x;const c=new Set,g=B=>A.value.has(B.id)||ge.value.has(B.id);for(const B of ut.value)El(B,g)&&c.add(((x=B.messages[0])==null?void 0:x.id)??"");return c}),ao=P(()=>{const c=new Set;for(const g of ut.value)c.add(g.turnId);return c});function io(c){return Ye.value.has(c.id)}function Tn(c){return so.value.has(c.id)}function ro(c){var g;return((g=Ye.value.get(c.id))==null?void 0:g.messages)??[]}function lo(c){return Hr(ro(c))}function co(c){var g;return c.type==="batch"?`tool-batch-${c.kind}-${((g=c.messages[0])==null?void 0:g.id)??""}`:c.message.id}function uo(c){const g=Ye.value.get(c.id);return g?Rl(g,{t:X,formatDuration:Ut}):""}function fo(c){var g;return((g=Ye.value.get(c.id))==null?void 0:g.running)??!1}function ho(c){var g;return((g=Ye.value.get(c.id))==null?void 0:g.hasOutsideContent)??!0}function mo(c){return c.messageType==="worked"}const go=P(()=>a.hasMorePersistedAbove===!0),po=P(()=>!Ae.value&&(a.messages.length>0||a.pendingRequests.length>0||!!a.liveOverlay));function _n(c){switch(c){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function vo(c){const g=Ts.value[c];typeof g=="number"&&a.activeThreadId&&At("forkThread",{threadId:a.activeThreadId,turnIndex:g})}const Ot=P(()=>{const c={};for(const g of a.messages){if(g.role!=="user"||typeof g.turnIndex!="number")continue;const x=typeof g.turnId=="string"&&g.turnId.length>0?g.turnId:"";!x||g.text.trim().length===0||(c[g.id]=x)}return c});function ko(c){return typeof Ot.value[c.id]=="string"}function yo(c){Ot.value[c]&&(Ce.value={kind:"edit-message",messageId:c})}function In(c,g){hn(c)&&(Ce.value={kind:"file-change",summary:c,action:g})}function Ln(c,g){!c||!hn(c)||!g.path||(Ce.value={kind:"file-change",summary:c,action:"undo",filePaths:[g.path],filePathLabel:s(g.path)})}function wo(){const c=Ce.value;if(Ce.value=null,!!c){if(c.kind==="edit-message"){const g=Ot.value[c.messageId];g&&At("rollback",{turnId:g});return}Us(c.summary,c.action,c.filePaths)}}function bo(){const c=Se.value,g=dn.value;!c||!g||Mn(c)||(c.scrollTop=c.scrollHeight,g.scrollIntoView({block:"end"}))}function Mn(c){return c.scrollHeight-(c.scrollTop+c.clientHeight)<=Gu}function Co(){if(Se.value&&Ae.value){dt();return}}function dt(){Se.value&&bo()}function Dt(){return Ae.value}function Sn(){if(!Dt()){ct=0,we=0;return}if(dt(),ct-=1,ct<=0){we=0;return}we=requestAnimationFrame(Sn)}function ft(c=6){Dt()&&(we&&(cancelAnimationFrame(we),we=0),ct=Math.max(c,1),we=requestAnimationFrame(Sn))}function An(){ft(3)}function Fn(){Ae.value=!0,dt(),ft(4)}async function Pn(){var J;const c=Se.value;if(!c||!a.hasMorePersistedAbove||Pe.value||a.isLoadingPersistedAbove===!0)return;Pe.value=!0;const g=a.activeThreadId,x=c.scrollHeight,B=c.scrollTop;try{await((J=a.loadEarlierMessages)==null?void 0:J.call(a,g)),await gt(),a.activeThreadId===g&&(c.scrollTop=B+(c.scrollHeight-x))}finally{Pe.value=!1}}t({jumpToLatest:Fn});function $o(){if(!Dt())return;const c=Se.value;if(!c)return;const g=c.querySelectorAll("img.message-image-preview");for(const x of g)x.complete||yn.has(x)||(yn.add(x),x.addEventListener("load",An,{once:!0}),x.addEventListener("error",An,{once:!0}))}async function Xe(){return Je||(Je=gt().then(()=>new Promise(c=>{Be&&cancelAnimationFrame(Be),Be=requestAnimationFrame(()=>{Be=0,Je=null,Co(),$o(),ft(),c()})})),Je)}Te(()=>a.messages,async c=>{if(a.isLoading)return;const g=new Set(c.filter(x=>x.messageType==="commandExecution"&&x.commandExecution).map(x=>x.id));q(g),Cs(),await Xe()}),Te(()=>a.messages.some(c=>c.text.includes("```")),c=>{!c||u()||h()},{immediate:!0}),Te(()=>a.pendingRequests,async()=>{a.isLoading||await Xe()},{deep:!0}),Te(()=>a.liveOverlay,async c=>{c&&Ae.value&&(await gt(),dt(),ft(8))},{deep:!0}),Te(()=>a.isLoading,async()=>{await Xe()}),Te(()=>a.activeThreadId,async()=>{Ae.value=!0,rt.value="",Pe.value=!1,zs(),Fe.value=Zt(a.activeThreadId),await Xe()},{flush:"post"}),Fo(()=>{Xe()});function xo(){const c=Se.value;!c||a.isLoading||(Ae.value=Mn(c),c.scrollTop<Zu&&!Pe.value&&(Cn.value?$n():a.hasMorePersistedAbove===!0&&Pn()))}const Ht=/\.(mp4|m4v|webm|mov|mkv|ogv|ogg|mpeg|avi)$/iu;function ht(c){const g=c.trim();if(!g)return!1;if(g.startsWith("data:video/"))return!0;try{const x=new URL(g,window.location.href);return Ht.test(x.pathname)?!0:x.pathname==="/codex-local-image"?Ht.test(x.searchParams.get("path")??""):!1}catch{return Ht.test(g)}}return $t(()=>{L(),Be&&(cancelAnimationFrame(Be),Be=0),we&&(cancelAnimationFrame(we),we=0)}),(c,g)=>(l(),d(j,null,[m("section",{class:"conversation-root","data-thread-id":a.activeThreadId,onContextmenuCapture:g[4]||(g[4]=(...x)=>f(Q)&&f(Q)(...x)),onClick:sn,onKeydown:Ro(sn,["enter"])},[e.isLoading&&e.messages.length>0?(l(),d("div",fc,y(f(X)("Loading messages...")),1)):S("",!0),e.isLoading&&e.messages.length===0?(l(),d("p",hc,y(f(X)("Loading messages...")),1)):S("",!0),e.isSlowOpen?(l(),d("p",mc,y(f(X)("Still loading — the first open of a large history can take a while.")),1)):S("",!0),e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay&&!e.isSlowOpen?(l(),d("p",gc,y(f(X)("No messages in this thread yet. Type a message below to get started.")),1)):S("",!0),m("ul",{ref_key:"conversationListRef",ref:Se,class:"conversation-list",onScroll:xo},[go.value?(l(),d("li",pc,[m("button",{type:"button",class:"load-more-button",disabled:Pe.value||e.isLoadingPersistedAbove,onClick:Pn},y(Pe.value||e.isLoadingPersistedAbove?f(X)("Loading…"):f(X)("Load earlier messages")),9,vc)])):S("",!0),Cn.value?(l(),d("li",kc,[m("button",{type:"button",class:"load-more-button",disabled:Pe.value,onClick:$n},y(f(X)("Load earlier ({n} turns)",{n:bn.value})),9,yc)])):S("",!0),(l(!0),d(j,null,K(Gs.value,x=>(l(),d(j,{key:x.key},[(l(!0),d(j,null,K(x.leadingDividers??[],B=>(l(),d("li",{key:`${x.key}-leading-${B.to??""}-${B.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch"},[ee(On,{from:B.from,to:B.to},null,8,["from","to"])]))),128)),ee(hl,{"turn-key":x.key,warm:x.warm,"warm-items":x.warmItems,request:x.request,"process-items":x.processItems,"final-item":x.finalItem,"file-change-anchor-ids":x.fileChangeAnchorIds,"duration-ms":Js(x)},{"warm-card":je(({warm:B})=>[m("li",{id:Rt(B.turn),class:"conversation-item conversation-item-warm-card","data-role":"system","data-message-type":"warmTurn"},[m("div",bc,[m("div",Cc,[ee(wl,{"user-text":B.userText,"assistant-preview":B.assistantPreview,"tool-count":B.toolCount,expanded:B.expanded,onToggle:J=>Ys(B.turn)},null,8,["user-text","assistant-preview","tool-count","expanded","onToggle"])])])],8,wc)]),"file-change":je(({anchorMessageId:B})=>[m("div",$c,[m("div",xc,[f(tn)(f(ke)(B))?(l(),se(Rn,{key:0,summary:f(ke)(B),expanded:f(ws)(B),cwd:a.cwd,actionable:f(mn)(f(ke)(B)),"action-status":f(gn)(f(ke)(B)),"action-error-text":f(pn)(f(ke)(B)),"next-action":f(vn)(f(ke)(B)),"action-label":f(kn)(f(ke)(B)),onToggle:J=>f(bs)(B),onOpenDiff:J=>f(it)(f(ke)(B),J),onRequestAction:J=>In(f(ke)(B),J),onRequestFileAction:J=>Ln(f(ke)(B),J)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):S("",!0)])])]),default:je(({item:B,section:J})=>[(l(!0),d(j,null,K([B.message],v=>{var he,$e,Qe,et;return l(),d(j,{key:v.id},[io(v)&&!oo.value.has(v.id)?(l(),d("li",Tc,[m("div",_c,[m("div",Ic,[ee(yr,{label:uo(v),running:fo(v),"has-outside-content":ho(v)},{default:je(()=>[(l(!0),d(j,null,K(lo(v),$=>(l(),d(j,{key:co($)},[$.type==="batch"?(l(),se(Qr,{key:0,kind:$.kind,messages:$.messages},null,8,["kind","messages"])):(l(!0),d(j,{key:1},K([$.message],Z=>(l(),d(j,{key:Z.id},[!f(A).has(Z.id)&&!f(ge).has(Z.id)?(l(),d(j,{key:0},[Ze(Z)?(l(),d("div",Lc,[(l(!0),d(j,null,K(f(G)(Z),(N,Y)=>(l(),se(Wn,{key:`work-cmd-${N.id}`,command:N,"step-index":Y,expanded:f(T)(N),compact:f(R)(N),"output-condensed":f(D)(N),onToggle:de=>f(w)(N)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])):Mt(Z)?(l(),se(Gt,{key:1,message:Z},null,8,["message"])):It(Z)?(l(),se(Hn,{key:2,message:Z,expanded:ln(Z),"content-html":f(O)(Z.text),onToggle:N=>cn(Z)},null,8,["message","expanded","content-html","onToggle"])):S("",!0)],64)):S("",!0)],64))),128))],64))),128))]),_:2},1032,["label","running","has-outside-content"])])])])):!Tn(v)&&!f(A).has(v.id)&&!f(ge).has(v.id)&&!(mo(v)&&ao.value.has(v.turnId??""))&&!Os(v)?(l(),d("li",{key:1,id:eo(v),class:te(["conversation-item",{"conversation-item-request":J==="request","conversation-item-process":J==="process"||B.presentation==="process","conversation-item-final":J==="final"||B.presentation==="final-assistant","conversation-item-plan":B.presentation==="plan"}]),"data-role":v.role,"data-message-type":v.messageType||""},[on(v)?(l(),d("div",Sc,[m("div",Ac,[g[6]||(g[6]=m("span",{class:"thread-compaction-spinner","aria-hidden":"true"},null,-1)),m("span",null,y(f(X)("Compacting thread context…")),1)])])):an(v)?(l(),d("div",Fc,[m("div",Pc,y(f(X)("Context compacted")),1)])):Ze(v)?(l(),d("div",Ec,[m("div",Bc,[m("div",Rc,[(l(!0),d(j,null,K(f(G)(v),($,Z)=>(l(),se(Wn,{key:`work-cmd-${$.id}`,command:$,"step-index":Z,expanded:f(T)($),compact:f(R)($),"output-condensed":f(D)($),onToggle:N=>f(w)($)},null,8,["command","step-index","expanded","compact","output-condensed","onToggle"]))),128))])])])):Mt(v)?(l(),se(Gt,{key:3,message:v},null,8,["message"])):St(v)?(l(),d("div",{key:4,class:"message-row","data-role":v.role,"data-message-type":v.messageType||""},[m("div",{class:"message-stack","data-role":v.role},[m("article",{class:"message-body","data-role":v.role},[f(tn)(f(ye)(v))?(l(),se(Rn,{key:0,summary:f(ye)(v),expanded:f(Le)(v),cwd:a.cwd,actionable:f(mn)(f(ye)(v)),"action-status":f(gn)(f(ye)(v)),"action-error-text":f(pn)(f(ye)(v)),"next-action":f(vn)(f(ye)(v)),"action-label":f(kn)(f(ye)(v)),onToggle:$=>f(ve)(v),onOpenDiff:$=>f(it)(f(ye)(v),$),onRequestAction:$=>In(f(ye)(v),$),onRequestFileAction:$=>Ln(f(ye)(v),$)},null,8,["summary","expanded","cwd","actionable","action-status","action-error-text","next-action","action-label","onToggle","onOpenDiff","onRequestAction","onRequestFileAction"])):S("",!0)],8,Hc)],8,Dc)],8,Oc)):B.presentation==="plan"?(l(),d("div",Wc,[m("div",Nc,[m("article",jc,[m("div",qc,y(f(X)("Plan")),1),(he=f(tt)(v))!=null&&he.explanation?(l(),d("p",Uc,y(($e=f(tt)(v))==null?void 0:$e.explanation),1)):S("",!0),(Qe=f(tt)(v))!=null&&Qe.steps.length?(l(),d("ol",zc,[(l(!0),d(j,null,K((et=f(tt)(v))==null?void 0:et.steps,($,Z)=>(l(),d("li",{key:`${v.id}-plan-${Z}`,"data-status":$.status},[m("span",Kc,y(_n($.status)),1),m("span",null,y($.step),1)],8,Vc))),128))])):S("",!0)])])])):(l(),d("div",{key:6,class:te(["message-row",{"message-row-final":B.presentation==="final-assistant"}]),"data-role":v.role,"data-message-type":v.messageType||""},[m("div",{class:"message-stack","data-role":v.role},[m("article",{class:"message-body","data-role":v.role},[v.images&&v.images.length>0?(l(),d("ul",{key:0,class:te(["message-image-list",{"message-generated-image-list":v.messageType==="imageView"}]),"data-role":v.role},[(l(!0),d(j,null,K(v.images,$=>(l(),d("li",{key:$,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Z=>f(fn)($)},[ht($)?(l(),d("video",{key:0,class:te(["message-image-preview message-video-preview",{"message-generated-image-preview":v.messageType==="imageView"}]),src:$,controls:"",preload:"metadata"},null,10,Qc)):(l(),d("img",{key:1,class:te(["message-image-preview",{"message-generated-image-preview":v.messageType==="imageView"}]),src:$,alt:v.messageType==="imageView"?"Generated image":"Message image preview",loading:"lazy"},null,10,eu))],8,Xc)]))),128))],10,Yc)):S("",!0),v.fileAttachments&&v.fileAttachments.length>0?(l(),d("div",tu,[(l(!0),d(j,null,K(v.fileAttachments,$=>(l(),d("span",{key:`${v.id}:${$.path}`,class:"message-file-chip"},[g[7]||(g[7]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:f(p)($.path),target:"_blank",rel:"noopener noreferrer",title:$.path},y($.label),9,nu)]))),128))])):S("",!0),v.imageAttachmentIds&&v.imageAttachmentIds.length>0?(l(),d("div",su,[(l(!0),d(j,null,K(v.imageAttachmentIds,$=>(l(),d("span",{key:`${v.id}:${$}`,class:"message-file-chip message-image-attachment-chip",title:$},[g[8]||(g[8]=m("span",{class:"message-file-chip-icon"},"🖼",-1)),m("span",au,y(f(X)("Image attachment (preview unavailable)")),1)],8,ou))),128))])):S("",!0),v.skills&&v.skills.length>0?(l(),d("div",iu,[(l(!0),d(j,null,K(v.skills,$=>(l(),d("a",{key:`${v.id}:${$.path}`,class:"message-skill-chip",href:f(p)($.path),title:$.path},[m("span",lu,y(f(X)("Skill")),1),m("span",cu,y($.name),1)],8,ru))),128))])):S("",!0),v.audioSources&&v.audioSources.length>0?(l(),d("div",uu,[(l(!0),d(j,null,K(v.audioSources,($,Z)=>(l(),d("audio",{key:`${v.id}:audio:${Z}`,class:"message-audio-player",controls:"",preload:"metadata",src:$},null,8,du))),128))])):S("",!0),v.mentions&&v.mentions.length>0?(l(),d("div",fu,[(l(!0),d(j,null,K(v.mentions,$=>(l(),d("span",{key:`${v.id}:mention:${$.name}:${$.path}`,class:"message-file-chip message-mention-chip",title:$.path||$.name},[g[9]||(g[9]=m("span",{class:"message-file-chip-icon"},"@",-1)),m("span",mu,y($.name),1)],8,hu))),128))])):S("",!0),v.text.length>0?(l(),d("article",{key:6,class:"message-card","data-role":v.role},[v.isAutomationRun?(l(),d("div",pu,[g[10]||(g[10]=m("span",null,"Sent via automation",-1)),v.automationDisplayName?(l(),d("code",vu,y(v.automationDisplayName),1)):S("",!0)])):S("",!0),v.messageType==="worked"?(l(),d("div",ku,[m("p",yu,y(v.text),1)])):It(v)?(l(),se(Hn,{key:2,message:v,expanded:ln(v),"content-html":f(O)(v.text),onToggle:$=>cn(v)},null,8,["message","expanded","content-html","onToggle"])):Po([v.id,v.text,a.cwd,f(r),f(Ws)],()=>(l(),d("div",{key:3,class:"message-text-flow"},[(l(!0),d(j,null,K(f(C)(v),($,Z)=>(l(),d(j,{key:`block-${Z}`},[$.kind==="paragraph"?(l(),d("p",wu,[ee(Ne,{segments:f(k)($.value),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])])):$.kind==="heading"?(l(),se(Eo(f(as)($.level)),{key:1,class:te(["message-heading",f(is)($.level)])},{default:je(()=>[ee(Ne,{segments:f(k)($.value),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])]),_:2},1032,["class"])):$.kind==="blockquote"?(l(),d("blockquote",bu,[ee(Ne,{segments:f(k)($.value),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])])):$.kind==="unorderedList"?(l(),d("ul",Cu,[(l(!0),d(j,null,K($.items,(N,Y)=>(l(),d("li",{key:`ul-${Z}-${Y}`,class:"message-list-item"},[m("div",{class:"message-list-item-content",innerHTML:f(F)(N)},null,8,$u)]))),128))])):$.kind==="taskList"?(l(),d("ul",xu,[(l(!0),d(j,null,K($.items,(N,Y)=>(l(),d("li",{key:`task-${Z}-${Y}`,class:"message-task-item"},[m("span",{class:"message-task-checkbox","data-checked":N.checked},y(N.checked?"☑":"☐"),9,Tu),m("div",_u,[ee(Ne,{segments:f(k)(N.text),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])])]))),128))])):$.kind==="orderedList"?(l(),d("ol",{key:5,class:"message-list message-list-ordered",start:$.start},[(l(!0),d(j,null,K($.items,(N,Y)=>(l(),d("li",{key:`ol-${Z}-${Y}`,class:"message-list-item"},[m("div",{class:"message-list-item-content",innerHTML:f(F)(N)},null,8,Lu)]))),128))],8,Iu)):$.kind==="table"?(l(),d("div",Mu,[m("table",Su,[m("thead",null,[m("tr",null,[(l(!0),d(j,null,K($.headers,(N,Y)=>(l(),d("th",{key:`th-${Z}-${Y}`,class:"message-table-head-cell",style:nt({textAlign:$.alignments[Y]??"left"})},[ee(Ne,{segments:f(k)(N),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])],4))),128))])]),$.rows.length>0?(l(),d("tbody",Au,[(l(!0),d(j,null,K($.rows,(N,Y)=>(l(),d("tr",{key:`tr-${Z}-${Y}`,class:"message-table-body-row"},[(l(!0),d(j,null,K(N,(de,be)=>(l(),d("td",{key:`td-${Z}-${Y}-${be}`,class:"message-table-cell",style:nt({textAlign:$.alignments[be]??"left"})},[ee(Ne,{segments:f(k)(de),"to-browse-url":f(p)},null,8,["segments","to-browse-url"])],4))),128))]))),128))])):S("",!0)])])):$.kind==="codeBlock"?(l(),d("div",Fu,[m("div",Pu,[$.language?(l(),d("span",Eu,y($.language),1)):S("",!0),m("span",Bu,y(f(X)("Copy")),1)]),m("pre",Ru,[m("code",{class:"hljs",innerHTML:f(_)($.language,$.value)},null,8,Ou)])])):$.kind==="thematicBreak"?(l(),d("hr",Du)):f(Ns)(v.id,Z)?(l(),d("p",Hu,y($.markdown),1)):(l(),d("button",{key:10,class:"message-image-button",type:"button",onClick:N=>f(fn)($.url)},[ht($.url)?(l(),d("video",{key:0,class:"message-image-preview message-video-preview message-markdown-image",src:$.url,controls:"",preload:"metadata"},null,8,Nu)):(l(),d("img",{key:1,class:"message-image-preview message-markdown-image",src:$.url,alt:$.alt||"Embedded message image",loading:"lazy",onError:N=>f(js)(v.id,Z)},null,40,ju))],8,Wu))],64))),128))])),g,0),Rs(v)?(l(),d("a",{key:4,class:"turn-error-feedback",href:f(nn),onClick:$=>Bs($,v.text)},y(f(X)("Send feedback")),9,qu)):S("",!0)],8,gu)):S("",!0),J!=="process"?(l(),se(dr,{key:7,role:v.role,"show-edit":ko(v),"show-fork":f(Ms)(v),"show-copy":f(_s)(v)||f(Is)(v),copied:f(xs)===v.id,timestamp:Es(v.turnStartedAtIso),onEdit:$=>yo(v.id),onFork:$=>vo(v.id),onCopy:$=>v.role==="user"?f(Ls)(v.id):f(Ss)(v.id)},null,8,["role","show-edit","show-fork","show-copy","copied","timestamp","onEdit","onFork","onCopy"])):S("",!0)],8,Jc)],8,Zc)],10,Gc))],10,Mc)):S("",!0)],64)}),128))]),_:2},1032,["turn-key","warm","warm-items","request","process-items","final-item","file-change-anchor-ids","duration-ms"]),(l(!0),d(j,null,K(x.dividers??[],B=>(l(),d("li",{key:`${x.key}-divider-${B.to??""}-${B.from??""}`,class:"conversation-item conversation-item-model-switch","data-role":"system","data-message-type":"modelSwitch"},[ee(On,{from:B.from,to:B.to},null,8,["from","to"])]))),128))],64))),128)),e.liveOverlay?(l(),se(Wi,{key:2,overlay:e.liveOverlay,"feedback-mailto":f(nn)},null,8,["overlay","feedback-mailto"])):S("",!0),m("li",{ref_key:"bottomAnchorRef",ref:dn,class:"conversation-bottom-anchor"},null,512)],544),ee(Tr,{anchors:xn.value,"active-turn":Xs.value,onJump:to},null,8,["anchors","active-turn"]),po.value?(l(),d("button",{key:4,type:"button",class:"jump-to-latest-button",title:f(X)("Jump to latest"),"aria-label":f(X)("Jump to latest output"),onClick:Fn},[ee(Bo,{class:"icon-svg jump-to-latest-icon"})],8,Uu)):S("",!0),f(rt).length>0?(l(),d("div",{key:5,class:"image-modal-backdrop",onClick:g[3]||(g[3]=(...x)=>f(lt)&&f(lt)(...x))},[m("div",{class:"image-modal-content",onClick:g[2]||(g[2]=ze(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":f(X)("Close image preview"),onClick:g[1]||(g[1]=(...x)=>f(lt)&&f(lt)(...x))},[ee(Qn,{class:"icon-svg"})],8,zu),f(Hs)?(l(),d("video",{key:0,class:"image-modal-image",src:f(rt),controls:"",autoplay:""},null,8,Vu)):(l(),d("img",{key:1,class:"image-modal-image",src:f(rt),alt:f(X)("Expanded message image")},null,8,Ku))])])):S("",!0),ee(Ci,{visible:f(Oe),x:f(Ge),y:f(I),"browse-url":f(E),"edit-url":f(W),onClose:f(ae)},null,8,["visible","x","y","browse-url","edit-url","onClose"]),ee(ei,{change:f(pe),changes:f(re),lines:f(z),"is-mobile":f(H),"is-file-list-open":f(ie),cwd:a.cwd,onClose:f(Me),onSelectChange:f(ys),onToggleFileList:f(vs),onCloseFileList:f(ks)},null,8,["change","changes","lines","is-mobile","is-file-list-open","cwd","onClose","onSelectChange","onToggleFileList","onCloseFileList"])],40,dc),ee(ga,{visible:Ce.value!==null,title:Vs.value,message:Ks.value,"confirm-label":"Confirm",danger:"",onConfirm:wo,onCancel:g[5]||(g[5]=x=>Ce.value=null)},null,8,["visible","title","message"])],64))}}),Qu=ne(Ju,[["__scopeId","data-v-5b93699a"]]);export{Qu as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as Pe,x as re,f as c,h as De,i as p,j as u,F as E,t as d,k as y,u as f,l as I,n as L,P as Ne,w as je,m as Qe,p as B,Y as W,y as He,T as Le,c as ie,r as x,v as Be,_ as We}from"./index-rc4ZsEIH.js";const ze={class:"thread-pending-request-title"},Ke=["title"],Ye={class:"thread-pending-request-approval"},Je=["aria-label"],Ze=["aria-pressed","onClick"],Ge={class:"thread-pending-request-option-index"},Xe={class:"thread-pending-request-option-label"},_e={class:"thread-pending-request-footer thread-pending-request-footer--approval"},et=["value","placeholder"],tt={key:0,class:"thread-pending-request-validation-error",role:"alert"},nt={class:"thread-pending-request-header"},rt={class:"thread-pending-request-heading"},it={class:"thread-pending-request-eyebrow"},st={class:"thread-pending-request-title"},ot={key:0,class:"thread-pending-request-counter"},at={key:0,class:"thread-pending-request-preview"},lt={class:"thread-pending-request-preview-code"},ut={key:1,class:"thread-pending-request-validation-error",role:"alert"},dt={key:2,class:"thread-pending-request-user-input"},ct={key:0,class:"thread-pending-request-question-description"},pt=["href"],ft={class:"thread-pending-request-question-title"},ht={key:0},mt={key:0,class:"thread-pending-request-question-text"},gt={key:1,class:"thread-pending-request-input-wrap"},yt={class:"thread-pending-request-select-label"},vt=["type","value","onInput"],qt={key:2,class:"thread-pending-request-select-wrap"},bt={class:"thread-pending-request-select-label"},kt={key:3,class:"thread-pending-request-select-wrap"},At={class:"thread-pending-request-select-label"},wt={key:4,class:"thread-pending-request-question-options"},Ct=["checked","onChange"],Et={class:"thread-pending-request-checkbox-label"},xt={key:2,class:"thread-pending-request-validation-error"},Rt={class:"thread-pending-request-footer"},St={key:3,class:"thread-pending-request-user-input"},$t={class:"thread-pending-request-question-title"},Tt={key:0,class:"thread-pending-request-question-text"},Vt={key:1,class:"thread-pending-request-question-options"},Mt={class:"thread-pending-request-select-wrap"},Ot={class:"thread-pending-request-select-label"},It={key:0,class:"thread-pending-request-question-description"},Ut={key:2,class:"thread-pending-request-input-wrap"},Ft={class:"thread-pending-request-select-label"},Pt=["value","placeholder","onInput"],Dt={class:"thread-pending-request-footer"},Nt={key:4,class:"thread-pending-request-actions"},jt={key:5,class:"thread-pending-request-actions"},Qt=Pe({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean},panelWidth:{},visualViewportHeight:{},panelError:{}},emits:["respondServerRequest"],setup(s,{emit:se}){const k=s,b=se,oe=ie(()=>{const e=typeof k.panelWidth=="number"&&k.panelWidth>0?k.panelWidth:0,t=typeof k.visualViewportHeight=="number"&&k.visualViewportHeight>0?`${k.visualViewportHeight}px`:"100dvh";return{...e>0?{width:`${e}px`}:{},"--visual-viewport-height":t}}),q=x("accept"),R=x(""),T=x({}),V=x({}),A=x({}),w=x(""),{t:o}=Be();function m(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function h(e){return typeof e=="string"?e.trim():""}function ae(e){return typeof e=="string"?e:null}function le(e){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(e)?e:JSON.stringify(e)}function ue(e){const n=(Array.isArray(e.commandActions)?e.commandActions:[]).map(r=>m(r)).map(r=>h(r==null?void 0:r.command)).find(r=>r.length>0);if(n)return n.replace(/\s+/g," ").trim();if(Array.isArray(e.command)){const r=e.command.filter(i=>typeof i=="string").map(i=>i.trim()).filter(i=>i.length>0);if(r.length>0)return r.map(i=>le(i)).join(" ")}return pe(h(e.command))}function U(e){return e.method==="item/commandExecution/requestApproval"||e.method==="execCommandApproval"}function F(e){return e.method==="item/fileChange/requestApproval"||e.method==="applyPatchApproval"}function S(e){return e.method==="item/permissions/requestApproval"}function P(e){return U(e)||F(e)||S(e)}function D(e){return e.method==="mcpServer/elicitation/request"}function de(e){const t=m(e.params);return h(t==null?void 0:t.reason)||h(t==null?void 0:t.prompt)||h(t==null?void 0:t.message)}function ce(e){return P(e)?o("Awaiting approval"):D(e)?o("MCP server input required"):e.method==="item/tool/requestUserInput"?o("Awaiting response"):e.method==="item/tool/call"?o("Tool call waiting for response"):e.method}function z(e){const t=de(e);return t||(U(e)?o("Do you want to run this command?"):F(e)?o("Do you want to make these changes?"):S(e)?o("Do you want to grant these permissions?"):D(e)?o("An MCP server needs your input before Codex can continue."):e.method==="item/tool/requestUserInput"?o("Codex needs your answer before it can continue."):o("Codex is waiting for a response before it can continue."))}function pe(e){var a;const t=e.trim();if(!t)return"";const n=t.match(/-Command\s+(.+)$/i),r=((a=n==null?void 0:n[1])==null?void 0:a.trim())??t;return(r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):r).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function $(e){const t=m(e.params);if(!t)return"";if(U(e))return ue(t);if(F(e)){const n=h(t.grantRoot)||h(t.grant_root);if(n)return n.replace(/\s+/g," ").trim();const r=m(t.fileChanges)??m(t.changes);if(!r)return"";const i=Object.keys(r).map(a=>a.trim()).filter(a=>a.length>0);return i.length===0?"":i.slice(0,3).join(", ")}return S(e)?fe(t.permissions):D(e)?h(t.serverName)||h(t.url):""}function fe(e){const t=m(e);if(!t)return"";const n=[],r=m(t.fileSystem),i=m(t.network),a=Array.isArray(r==null?void 0:r.read)?r.read.filter(v=>typeof v=="string"):[],l=Array.isArray(r==null?void 0:r.write)?r.write.filter(v=>typeof v=="string"):[];return a.length>0&&n.push(`${o("Read")}: ${a.join(", ")}`),l.length>0&&n.push(`${o("Write")}: ${l.join(", ")}`),(i==null?void 0:i.enabled)===!0&&n.push(o("Network access")),n.join(" • ")}function he(e){return!e||!P(e)?[]:[{id:"accept",label:o("Yes")},{id:"acceptForSession",label:o("Yes for Session")}]}const N=ie(()=>he(k.request));re(()=>{var e;return((e=k.request)==null?void 0:e.id)??0},()=>{var e;R.value="",T.value={},V.value={},A.value={},w.value="",q.value=((e=N.value[0])==null?void 0:e.id)??"accept"},{immediate:!0}),re(N,e=>{var t;q.value!=="decline"&&(e.some(n=>n.id===q.value)||(q.value=((t=e[0])==null?void 0:t.id)??"accept"))},{immediate:!0});function M(e,t){return`${String(e)}:${t}`}function K(e){const t=m(e.params),n=Array.isArray(t==null?void 0:t.questions)?t.questions:[],r=[];for(const i of n){const a=m(i);if(!a)continue;const l=h(a.id);if(!l)continue;const v=Array.isArray(a.options)?a.options.map(g=>m(g)).map(g=>({label:h(g==null?void 0:g.label),description:h(g==null?void 0:g.description)})).filter(g=>g.label.length>0):[];r.push({id:l,header:h(a.header),question:h(a.question),isOther:a.isOther===!0,options:v})}return r}function j(e,t,n){const r=M(e,t),i=T.value[r];return typeof i=="string"&&i.length>0?i:n}function Y(e,t){return V.value[M(e,t)]??""}function me(e,t,n){const r=M(e,t);T.value={...T.value,[r]:n}}function ge(e){return e.options.map(t=>({value:t.label,label:t.label}))}function ye(e,t,n){const r=n.target;if(!(r instanceof HTMLInputElement))return;const i=M(e,t);V.value={...V.value,[i]:r.value}}function J(e,t,n){var i,a;const r=j(e,t,((i=n[0])==null?void 0:i.label)||"");return((a=n.find(l=>l.label===r))==null?void 0:a.description)??""}function O(e,t){return`${String(e)}:${t}`}function Z(e){var t;return h((t=m(e.params))==null?void 0:t.serverName)}function G(e){var n;const t=h((n=m(e.params))==null?void 0:n.url);if(!t)return"";try{const r=new URL(t),i=r.protocol.toLowerCase();return i==="https:"||i==="http:"?r.toString():""}catch{return""}}function Q(e){const t=m(e.params),n=m(t==null?void 0:t.requestedSchema),r=m(n==null?void 0:n.properties);if(!r)return[];const i=new Set(Array.isArray(n==null?void 0:n.required)?n.required.filter(a=>typeof a=="string"):[]);return Object.entries(r).map(([a,l])=>ve(a,m(l),i.has(a))).filter(a=>a!==null)}function ve(e,t,n){if(!t)return null;const r=h(t.title)||e,i=h(t.description),a=h(t.type);if(a==="boolean")return{key:e,label:r,description:i,required:n,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof t.default=="boolean"?t.default:null,hasExplicitDefault:typeof t.default=="boolean"};if(a==="number"||a==="integer")return{key:e,label:r,description:i,required:n,kind:"number",inputType:"number",options:[],defaultValue:typeof t.default=="number"?t.default:null,hasExplicitDefault:typeof t.default=="number"};const l=X(t);if(a==="array")return{key:e,label:r,description:i,required:n,kind:"multiEnum",inputType:"checkbox",options:l,defaultValue:Array.isArray(t.default)?t.default.filter(g=>typeof g=="string"):[],hasExplicitDefault:Array.isArray(t.default)};const v=ae(t.default);return l.length>0?{key:e,label:r,description:i,required:n,kind:"singleEnum",inputType:"select",options:l,defaultValue:v,hasExplicitDefault:v!==null}:{key:e,label:r,description:i,required:n,kind:"string",inputType:qe(t),options:[],defaultValue:v,hasExplicitDefault:v!==null}}function X(e){const n=(Array.isArray(e.oneOf)?e.oneOf:Array.isArray(e.anyOf)?e.anyOf:[]).map(l=>m(l)).map(l=>({value:h(l==null?void 0:l.const),label:h(l==null?void 0:l.title)||h(l==null?void 0:l.const)})).filter(l=>l.value.length>0);if(n.length>0)return n;const r=m(e.items);if(r){const l=X(r);if(l.length>0)return l}const i=Array.isArray(e.enum)?e.enum.filter(l=>typeof l=="string"):[],a=Array.isArray(e.enumNames)?e.enumNames.filter(l=>typeof l=="string"):[];return i.map((l,v)=>({value:l,label:a[v]||l}))}function qe(e){const t=h(e.format);return t==="email"?"email":t==="uri"?"url":t==="date"?"date":t==="date-time"?"datetime-local":"text"}function C(e,t){const n=A.value[O(e,t.key)];return n!==void 0?n:t.defaultValue}function _(e,t){const n=C(e,t);return Array.isArray(n)?n.filter(r=>typeof r=="string"):[]}function be(e,t,n){const r=n.target;r instanceof HTMLInputElement&&ee(e,t,r.value)}function ee(e,t,n){const r=(t.kind==="number",n);A.value={...A.value,[O(e,t.key)]:n.length>0?r:null},w.value=""}function ke(e,t,n){let r=null;n==="true"?r=!0:n==="false"&&(r=!1),A.value={...A.value,[O(e,t.key)]:r},w.value=""}function Ae(e,t,n,r){const i=r.target;if(!(i instanceof HTMLInputElement))return;const a=new Set(_(e,t));i.checked?a.add(n):a.delete(n),A.value={...A.value,[O(e,t.key)]:Array.from(a)},w.value=""}function we(e){return e===!0?"true":e===!1?"false":""}function Ce(e){const t=[{value:"true",label:o("True")},{value:"false",label:o("False")}];return e.hasExplicitDefault||t.unshift({value:"",label:o("Select true or false")}),t}function Ee(e){const t=e.options.map(n=>({value:n.value,label:n.label}));return e.hasExplicitDefault||t.unshift({value:"",label:o("Select an option")}),t}function xe(e,t){const n=C(e,t);return t.kind==="multiEnum"?Array.isArray(n)&&n.length>0:t.kind==="boolean"?typeof n=="boolean":t.kind==="number"&&typeof n=="number"?!0:typeof n=="string"&&n.trim().length>0}function Re(e){const t=Q(e).filter(n=>n.required&&!xe(e.id,n)).map(n=>n.label);return t.length===0?"":t.length===1?`${o("Answer the required field")}: ${t[0]}.`:`${o("Answer the required field")}: ${t.join(", ")}.`}function Se(e){const t={};for(const n of Q(e)){const r=C(e.id,n);if(n.kind==="multiEnum"){const a=Array.isArray(r)?r:[];(a.length>0||n.required)&&(t[n.key]=a);continue}if(n.kind==="boolean"){typeof r=="boolean"&&(t[n.key]=r);continue}if(n.kind==="number"){const a=typeof r=="number"?r:Number(String(r).trim());Number.isNaN(a)||(t[n.key]=a);continue}const i=String(r??"").trim();(i.length>0||n.required)&&(t[n.key]=i)}return t}function $e(e){q.value=e}function Te(){q.value="decline"}function Ve(e){const t=e.target;t instanceof HTMLInputElement&&(R.value=t.value,q.value="decline")}function te(e,t){var n;if(S(e)){if(t==="decline"||t==="cancel"){b("respondServerRequest",{id:e.id,error:{code:-32e3,message:t==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const r=m((n=m(e.params))==null?void 0:n.permissions)??{};b("respondServerRequest",{id:e.id,result:{permissions:r,scope:t==="acceptForSession"?"session":"turn"}});return}b("respondServerRequest",{id:e.id,result:{decision:t}})}function ne(e){const t=R.value.trim(),n=t.length>0?"decline":q.value;if(S(e)){te(e,n);return}b("respondServerRequest",{id:e.id,result:{decision:n},followUpMessageText:t||void 0})}function H(e,t){const n=m(e.params),r={action:t};if(t==="accept"&&h(n==null?void 0:n.mode)==="form"){const i=Re(e);if(i){w.value=i;return}r.content=Se(e)}b("respondServerRequest",{id:e.id,result:r})}function Me(e){var r;const t=K(e),n={};for(const i of t){const a=j(e.id,i.id,((r=i.options[0])==null?void 0:r.label)||""),l=Y(e.id,i.id).trim(),v=[a,l].map(g=>g.trim()).filter(g=>g.length>0);n[i.id]={answers:v}}b("respondServerRequest",{id:e.id,result:{answers:n}})}function Oe(e){b("respondServerRequest",{id:e.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function Ie(e){b("respondServerRequest",{id:e.id,result:{success:!0,contentItems:[]}})}function Ue(e){b("respondServerRequest",{id:e.id,result:{}})}function Fe(e){b("respondServerRequest",{id:e.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(e,t)=>(c(),De(Le,{to:"body"},[s.request?(c(),p("section",{key:0,class:"thread-pending-request",style:He(oe.value)},[u("article",{class:L(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":s.hasQueueAbove}])},[P(s.request)?(c(),p(E,{key:0},[u("p",ze,d(z(s.request)),1),$(s.request)?(c(),p("p",{key:0,class:"thread-pending-request-command-line",title:$(s.request)},d($(s.request)),9,Ke)):y("",!0),u("section",Ye,[u("div",{class:"thread-pending-request-options",role:"radiogroup","aria-label":f(o)("Approval choices")},[(c(!0),p(E,null,I(N.value,(n,r)=>(c(),p("button",{key:n.id,type:"button",class:L(["thread-pending-request-option",{"is-selected":q.value===n.id}]),"aria-pressed":q.value===n.id,onClick:i=>$e(n.id)},[u("span",Ge,d(r+1)+".",1),u("span",Xe,d(n.label),1)],10,Ze))),128))],8,Je),u("footer",_e,[u("label",{class:L(["thread-pending-request-inline-input",{"is-active":q.value==="decline"||R.value.length>0}])},[t[11]||(t[11]=u("span",{class:"thread-pending-request-option-index"},"3.",-1)),u("input",{class:"thread-pending-request-inline-control",type:"text",value:R.value,placeholder:f(o)("No, and tell Codex what to do differently"),onFocus:Te,onInput:Ve,onKeydown:t[0]||(t[0]=Ne(je(n=>ne(s.request),["prevent"]),["enter"]))},null,40,et)],2),u("button",{type:"button",class:"thread-pending-request-secondary",onClick:t[1]||(t[1]=n=>te(s.request,"cancel"))},d(f(o)("Skip")),1),u("button",{type:"button",class:"thread-pending-request-primary",onClick:t[2]||(t[2]=n=>ne(s.request))},d(f(o)("Send")),1)]),s.panelError?(c(),p("p",tt,d(s.panelError),1)):y("",!0)])],64)):(c(),p(E,{key:1},[u("header",nt,[u("div",rt,[u("p",it,d(ce(s.request)),1),u("p",st,d(z(s.request)),1)]),(s.requestCount??0)>1?(c(),p("span",ot,d(s.requestCount??0)+" "+d(f(o)("pending")),1)):y("",!0)]),$(s.request)?(c(),p("div",at,[u("code",lt,d($(s.request)),1)])):y("",!0),s.panelError?(c(),p("p",ut,d(s.panelError),1)):y("",!0),s.request.method==="mcpServer/elicitation/request"?(c(),p("section",dt,[Z(s.request)?(c(),p("p",ct,d(f(o)("Server"))+": "+d(Z(s.request)),1)):y("",!0),G(s.request)?(c(),p("a",{key:1,class:"thread-pending-request-link",href:G(s.request),target:"_blank",rel:"noopener noreferrer"},d(f(o)("Open authorization link")),9,pt)):y("",!0),(c(!0),p(E,null,I(Q(s.request),n=>(c(),p("div",{key:`${s.request.id}:${n.key}`,class:"thread-pending-request-question"},[u("p",ft,[Qe(d(n.label),1),n.required?(c(),p("span",ht," *")):y("",!0)]),n.description?(c(),p("p",mt,d(n.description),1)):y("",!0),n.kind==="string"||n.kind==="number"?(c(),p("label",gt,[u("span",yt,d(f(o)("Value")),1),u("input",{class:"thread-pending-request-input",type:n.inputType,value:String(C(s.request.id,n)??""),onInput:r=>be(s.request.id,n,r)},null,40,vt)])):n.kind==="boolean"?(c(),p("div",qt,[u("span",bt,d(f(o)("Choice")),1),B(W,{class:"thread-pending-request-dropdown","model-value":we(C(s.request.id,n)),options:Ce(n),placeholder:f(o)("Select true or false"),"onUpdate:modelValue":r=>ke(s.request.id,n,r)},null,8,["model-value","options","placeholder","onUpdate:modelValue"])])):n.kind==="singleEnum"?(c(),p("div",kt,[u("span",At,d(f(o)("Choice")),1),B(W,{class:"thread-pending-request-dropdown","model-value":String(C(s.request.id,n)??""),options:Ee(n),placeholder:f(o)("Select an option"),"enable-search":"","search-placeholder":f(o)("Search options..."),"onUpdate:modelValue":r=>ee(s.request.id,n,r)},null,8,["model-value","options","placeholder","search-placeholder","onUpdate:modelValue"])])):(c(),p("div",wt,[(c(!0),p(E,null,I(n.options,r=>(c(),p("label",{key:`${s.request.id}:${n.key}:${r.value}`,class:"thread-pending-request-checkbox-row"},[u("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:_(s.request.id,n).includes(r.value),onChange:i=>Ae(s.request.id,n,r.value,i)},null,40,Ct),u("span",Et,d(r.label),1)]))),128))]))]))),128)),w.value?(c(),p("p",xt,d(w.value),1)):y("",!0),u("footer",Rt,[u("button",{type:"button",class:"thread-pending-request-secondary",onClick:t[3]||(t[3]=n=>H(s.request,"cancel"))},d(f(o)("Cancel")),1),u("button",{type:"button",class:"thread-pending-request-secondary",onClick:t[4]||(t[4]=n=>H(s.request,"decline"))},d(f(o)("Decline")),1),u("button",{type:"button",class:"thread-pending-request-primary",onClick:t[5]||(t[5]=n=>H(s.request,"accept"))},d(f(o)("Continue")),1)])])):s.request.method==="item/tool/requestUserInput"?(c(),p("section",St,[(c(!0),p(E,null,I(K(s.request),n=>{var r;return c(),p("div",{key:`${s.request.id}:${n.id}`,class:"thread-pending-request-question"},[u("p",$t,d(n.header||n.question),1),n.question?(c(),p("p",Tt,d(n.question),1)):y("",!0),n.options.length>0?(c(),p("div",Vt,[u("div",Mt,[u("span",Ot,d(f(o)("Choice")),1),B(W,{class:"thread-pending-request-dropdown","model-value":j(s.request.id,n.id,((r=n.options[0])==null?void 0:r.label)||""),options:ge(n),placeholder:f(o)("Choice"),"onUpdate:modelValue":i=>me(s.request.id,n.id,i)},null,8,["model-value","options","placeholder","onUpdate:modelValue"])]),J(s.request.id,n.id,n.options)?(c(),p("p",It,d(J(s.request.id,n.id,n.options)),1)):y("",!0)])):y("",!0),n.isOther?(c(),p("label",Ut,[u("span",Ft,d(f(o)("Other answer")),1),u("input",{class:"thread-pending-request-input",type:"text",value:Y(s.request.id,n.id),placeholder:f(o)("Other answer"),onInput:i=>ye(s.request.id,n.id,i)},null,40,Pt)])):y("",!0)])}),128)),u("footer",Dt,[u("button",{type:"button",class:"thread-pending-request-primary",onClick:t[6]||(t[6]=n=>Me(s.request))},d(f(o)("Send")),1)])])):s.request.method==="item/tool/call"?(c(),p("section",Nt,[u("button",{type:"button",class:"thread-pending-request-primary",onClick:t[7]||(t[7]=n=>Oe(s.request))},d(f(o)("Fail Tool Call")),1),u("button",{type:"button",class:"thread-pending-request-secondary",onClick:t[8]||(t[8]=n=>Ie(s.request))},d(f(o)("Success (Empty)")),1)])):(c(),p("section",jt,[u("button",{type:"button",class:"thread-pending-request-primary",onClick:t[9]||(t[9]=n=>Ue(s.request))},d(f(o)("Return Empty Result")),1),u("button",{type:"button",class:"thread-pending-request-secondary",onClick:t[10]||(t[10]=n=>Fe(s.request))},d(f(o)("Reject Request")),1)]))],64))],2)],4)):y("",!0)]))}}),Lt=We(Qt,[["__scopeId","data-v-97f13505"]]);export{Lt as default};
|