@muyichengshayu/promptx 0.2.2 → 0.2.3
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/CHANGELOG.md +8 -0
- package/apps/server/src/gitDiff.js +238 -35
- package/apps/server/src/gitDiffClient.js +311 -149
- package/apps/server/src/taskRoutes.js +1 -0
- package/apps/web/dist/assets/{CodexSessionManagerDialog-CELTkz9T.js → CodexSessionManagerDialog-ALNJ5DHK.js} +1 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-70bO8EPm.js +4 -0
- package/apps/web/dist/assets/TaskDiffReviewDialog-hxUGDcmF.css +1 -0
- package/apps/web/dist/assets/{WorkbenchSettingsDialog-CThWkZHd.js → WorkbenchSettingsDialog-DjMkkdSp.js} +1 -1
- package/apps/web/dist/assets/{WorkbenchView-D6auwJnA.js → WorkbenchView-CdD65SV0.js} +18 -18
- package/apps/web/dist/assets/index-Ca-xxeXy.js +2 -0
- package/apps/web/dist/index.html +1 -1
- package/package.json +1 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-CeGj0idf.css +0 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-VwZmo00b.js +0 -3
- package/apps/web/dist/assets/index-8vfFmsVl.js +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{W as dt,f as ht,m as Mt,s as jt,n as It,o as ut,d as Et,p as tt,c as Pt,q as ct,t as ft,v as At,w as qe,x as Dt,y as et}from"./WorkbenchView-D6auwJnA.js";import{u as Ve,f as Rt,e as Tt}from"./index-8vfFmsVl.js";import{w as oe,n as me,ak as at,aD as c,aI as re,aJ as De,aF as n,aQ as d,u as i,aG as I,aW as Lt,aU as Bt,aX as Ft,aE as g,aR as he,aS as Se,aL as O,aN as M,aV as Nt,aK as nt,b as $,c as C,o as Ot,aZ as yt,r as Ut}from"./vendor-misc-u-M8sNMf.js";import{c as Ht,L as Ge,F as Xe,e as zt,b as st,X as pt,C as Kt,M as qt,j as Vt,x as Wt,P as Qt,i as gt,E as Gt,N as Xt,q as Jt,r as Yt,O as Zt}from"./vendor-ui-BwEQCho1.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";import"./vendor-router-Dn8q3tJM.js";const en={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},tn={class:"theme-muted-text mt-1 text-xs leading-5"},nn={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},sn={class:"flex items-start gap-2 text-xs leading-5"},an={class:"theme-muted-text shrink-0"},ln={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},on={class:"theme-muted-text mt-4 block text-xs"},rn={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},dn=["placeholder"],un={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},cn={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},fn={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},pn={key:2,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},gn={key:3,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},vn={key:4,class:"theme-empty-state px-3 py-8 text-sm"},mn={key:5,class:"theme-empty-state px-3 py-8 text-sm"},hn={key:6,class:"theme-empty-state px-3 py-8 text-sm"},yn={key:7,class:"space-y-1"},xn=["onClick"],bn={class:"min-w-0 flex-1"},wn=["innerHTML"],Sn=["innerHTML"],kn={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},Cn={key:8,class:"space-y-1"},_n={class:"flex items-start gap-1.5"},$n=["onClick"],Mn=["onClick"],jn={class:"min-w-0 flex-1"},In={key:0,class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all"},En={class:"theme-divider flex flex-col-reverse gap-2 border-t border-dashed px-4 py-4 sm:flex-row sm:items-center sm:justify-end sm:px-5"},Pn={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},An=["disabled"],Dn=["disabled"],Rn={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve(),B=$(""),D=$(null),p=$(!1),S=$(""),E=$(!1),o=$(""),b=$([]),P=$(!1),u=$(""),_=$(""),de=$(null);let V=null,U=0,F=null;const H=new Map,z=C(()=>$e(D.value?[D.value]:[])),G=C(()=>String(u.value||"").trim()),X=C(()=>G.value.length>=dt),R=C(()=>!!G.value),Q=C(()=>R.value?b.value:z.value),Z=C(()=>Q.value.map(e=>{const l=m((e==null?void 0:e.path)||""),s=e!=null&&e.expanded?1:0,f=e!=null&&e.loading?1:0;return`${l}:${s}:${f}`}).join("|")),ge=C(()=>R.value&&!X.value&&!E.value&&!o.value),ae=C(()=>R.value&&X.value&&!E.value&&!o.value&&!b.value.length),J=C(()=>!R.value&&!p.value&&!S.value&&!z.value.length);function h(e=""){const l=String(e||"").trim();return/^[a-z]:[\\/]/i.test(l)||l.includes("\\")}function m(e=""){const l=String(e||"").trim();if(!l)return"";const s=h(l);let f=l.replace(/\\/g,"/");return f.length>1&&!/^[a-z]:\/?$/i.test(f)&&f!=="/"&&(f=f.replace(/\/+$/,"")),s?f.toLowerCase():f}function v(e="",l=""){const s=m(e),f=m(l);return!s||!f?!1:s===f||s.startsWith(`${f}/`)}function K(e="",l=""){const s=String(e||"").trim(),f=String(l||"").trim();return s?f?h(s)?/^[a-z]:\\?$/i.test(s)?`${s.replace(/[\\/]+$/,"")}\\${f}`:`${s.replace(/[\\/]+$/,"")}\\${f}`:s==="/"?`/${f}`:`${s.replace(/\/+$/,"")}/${f}`:s:f}function ee(e="",l=""){const s=m(e),f=m(l);if(!s||!f||!v(f,s))return[];const W=f===s?"":f.slice(s.length).replace(/^\//,"");return W?W.split("/").filter(Boolean):[]}function w(e=""){const l=String(e||"").trim();if(!l||m(l)===m(B.value))return"";const s=h(l),f=l.replace(/\\/g,"/");if(s){const ie=f.replace(/\/+$/,""),le=ie.lastIndexOf("/");if(le<=2)return"";const ze=ie.slice(0,le).replace(/\//g,"\\");return v(ze,B.value)?ze:""}const W=f.replace(/\/+$/,""),se=W.lastIndexOf("/");if(se<=0)return"";const we=W.slice(0,se)||"/";return v(we,B.value)?we:""}function ke(e){return(e==null?void 0:e.name)||(e==null?void 0:e.path)||y("directoryPicker.unnamedDirectory")}function Je(e=""){const l=String(e||"").trim();return l?l.split(/[\\/]/).filter(Boolean).at(-1)||l:"Home"}function ue(e=""){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ce(e="",l=""){const s=String(e||""),f=String(l||"").trim().toLowerCase();if(!s||!f)return null;const W=s.toLowerCase(),se=W.indexOf(f);if(se>=0)return{start:se,end:se+f.length};const we=f.split(/[\\/\s_.-]+/).filter(Boolean).sort((ie,le)=>le.length-ie.length);for(const ie of we){if(ie.length<2)continue;const le=W.indexOf(ie);if(le>=0)return{start:le,end:le+ie.length}}return null}function _e(e="",l=""){const s=String(e||""),f=Ce(s,l);return f?`${ue(s.slice(0,f.start))}<mark class="theme-search-highlight">${ue(s.slice(f.start,f.end))}</mark>${ue(s.slice(f.end))}`:ue(s)}function ce(e){return _e(ke(e),u.value)}function T(e){return _e((e==null?void 0:e.path)||"",u.value)}function Re(e,l=0){return{...e,depth:l,expanded:!1,loaded:!1,loading:!1,children:[]}}function $e(e=[],l=[]){return e.forEach(s=>{l.push(s),s.expanded&&s.children.length&&$e(s.children,l)}),l}function fe(){D.value&&(D.value={...D.value})}function ye(){V&&(window.clearTimeout(V),V=null),F&&(F.abort(),F=null)}function xe(e,l=D.value?[D.value]:[]){const s=m(e);if(!s)return null;for(const f of l){if(m(f.path)===s)return f;if(f.children.length){const W=xe(e,f.children);if(W)return W}}return null}function Y(e){_.value=String((e==null?void 0:e.path)||"").trim()}function pe(e=""){return m(e)}function Te(e,l){const s=pe(e);if(s){if(l){H.set(s,l);return}H.delete(s)}}function be(){var l;const e=H.get(pe(_.value));(l=e==null?void 0:e.scrollIntoView)==null||l.call(e,{block:"nearest"})}function We(){me(()=>{var e,l;(l=(e=de.value)==null?void 0:e.focus)==null||l.call(e)})}function Ye(){const e=Q.value;if(!e.length){_.value="";return}const l=pe(_.value);l&&e.some(s=>pe((s==null?void 0:s.path)||"")===l)||Y(e[0])}function Me(){const e=Q.value;if(!e.length)return-1;const l=pe(_.value),s=e.findIndex(f=>pe((f==null?void 0:f.path)||"")===l);return s>=0?s:0}function te(){const e=Q.value,l=Me();return l<0||!e.length?null:e[l]||null}function ve(e=1){const l=Q.value;if(!l.length)return!1;const s=Me(),f=s<0?0:(s+e+l.length)%l.length;return Y(l[f]),me(be),!0}async function Qe(){if(R.value)return!1;const e=te();if(!e||!e.hasChildren)return!1;if(!e.expanded)return await ne(e),!0;const l=Q.value,s=Me(),f=l[s+1];return f&&w(f.path)===e.path?(Y(f),me(be),!0):!1}function Le(){if(R.value)return!1;const e=te();if(!e)return!1;if(e.expanded&&e.hasChildren)return e.expanded=!1,fe(),Y(e),!0;const l=w(e.path);if(!l)return!1;const s=xe(l);return s?(Y(s),me(be),!0):!1}function je(e){var l,s,f;if((l=e==null?void 0:e.preventDefault)==null||l.call(e),G.value){(s=e==null?void 0:e.stopPropagation)==null||s.call(e),u.value="";return}(f=e==null?void 0:e.stopPropagation)==null||f.call(e),A("close")}function Be(e){const l=String((e==null?void 0:e.key)||"");if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Escape"].includes(l)&&!(R.value&&(l==="ArrowLeft"||l==="ArrowRight"))){if(l==="ArrowDown"){e.preventDefault(),ve(1);return}if(l==="ArrowUp"){e.preventDefault(),ve(-1);return}if(l==="Escape"){je(e);return}if(R.value){if(l==="Enter"){e.preventDefault();const s=te();s&&Ue(s)}return}if(l==="ArrowRight"){e.preventDefault(),Qe();return}if(l==="ArrowLeft"){e.preventDefault(),Le();return}l==="Enter"&&(e.preventDefault(),He())}}async function Ie(e,l={}){if(!(!e||e.loading)&&!(e.loaded&&!l.force)){e.loading=!0,S.value="",fe();try{const s=await ut({path:e.path,limit:240});e.children=(s.items||[]).map(f=>Re(f,e.depth+1)),e.loaded=!0}catch(s){S.value=s.message||y("directoryPicker.loadFailed")}finally{e.loading=!1,fe()}}}async function Ee(){p.value=!0,S.value="";try{const e=await ut({limit:240});B.value=String(e.path||""),D.value=Re({name:Je(e.path||""),path:String(e.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),D.value.children=(e.items||[]).map(l=>Re(l,1)),D.value.loaded=!0,D.value.expanded=!0,Y(D.value)}catch(e){S.value=e.message||y("directoryPicker.treeLoadFailed"),D.value=null,B.value=""}finally{p.value=!1}}async function Fe(e=""){const l=String(e||"").trim();if(!l||!B.value||!v(l,B.value))return;let s=D.value;if(!s)return;Y(s);const f=ee(B.value,l);for(const W of f){await Ie(s),s.expanded=!0,fe();const se=xe(K(s.path,W),s.children);if(!se)break;s=se,Y(s)}}async function Pe(){u.value="",b.value=[],o.value="",P.value=!1,_.value="",await Ee();const e=String(j.initialPath||"").trim();e&&v(e,B.value)&&await Fe(e)}async function ne(e){if(e!=null&&e.path&&(Y(e),!!e.hasChildren)){if(!e.loaded){e.expanded=!0,fe(),await Ie(e);return}e.expanded=!e.expanded,fe()}}function Ae(e){e!=null&&e.path&&Y(e)}async function Ne(){const e=String(u.value||"").trim();U+=1;const l=U;if(ye(),!j.open||!e||!B.value||!X.value){E.value=!1,o.value="",b.value=[],P.value=!1;return}E.value=!0,o.value="",F=new AbortController;try{const s=await jt(e,{path:B.value,limit:80,signal:F.signal});if(l!==U)return;b.value=Array.isArray(s.items)?s.items:[],P.value=!!s.truncated}catch(s){if(It(s)||l!==U)return;o.value=s.message||y("directoryPicker.searchFailed"),b.value=[],P.value=!1}finally{l===U&&(F=null),l===U&&(E.value=!1)}}function Oe(){if(ye(),!String(u.value||"").trim()||!X.value){E.value=!1,o.value="",b.value=[],P.value=!1;return}E.value=!0,o.value="",V=window.setTimeout(()=>{V=null,Ne()},Mt)}async function Ue(e){e!=null&&e.path&&(await Fe(e.path),u.value="")}function He(){_.value&&(A("select",_.value),A("close"))}return oe(u,()=>{Oe()}),oe(Z,()=>{Ye(),me(be)},{immediate:!0}),oe(()=>j.open,e=>{if(e){Pe().catch(()=>{}),We();return}ye()}),at(()=>{ye()}),(e,l)=>(c(),re(ht,{open:r.open,"stack-level":1,"panel-class":"settings-dialog-panel h-full max-w-4xl sm:h-auto sm:max-h-[86vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:px-5","close-disabled":p.value||E.value,"close-on-backdrop":!(p.value||E.value),"close-on-escape":!(p.value||E.value),onClose:l[2]||(l[2]=s=>A("close"))},{title:De(()=>[n("div",null,[n("div",en,[I(i(Xe),{class:"h-4 w-4"}),n("span",null,d(i(y)("directoryPicker.title")),1)]),n("p",tn,d(i(y)("directoryPicker.intro")),1)])]),default:De(()=>[n("div",{class:"flex min-h-0 flex-1 flex-col overflow-hidden",onKeydown:Be},[n("div",nn,[n("div",sn,[n("span",an,d(i(y)("directoryPicker.currentSelection")),1),n("span",ln,d(_.value||i(y)("directoryPicker.selectionPlaceholder")),1)])]),n("label",on,[n("span",null,d(i(y)("directoryPicker.searchLabel")),1),n("div",rn,[I(i(Ht),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),Lt(n("input",{ref_key:"searchInputRef",ref:de,"onUpdate:modelValue":l[0]||(l[0]=s=>u.value=s),type:"text",placeholder:i(y)("directoryPicker.searchPlaceholder"),class:"min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",onKeydown:Bt(je,["esc"])},null,40,dn),[[Ft,u.value]])])]),n("div",un,[R.value&&o.value?(c(),g("div",cn,d(o.value),1)):!R.value&&S.value?(c(),g("div",fn,d(S.value),1)):R.value&&E.value?(c(),g("div",pn,[I(i(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(i(y)("directoryPicker.searching")),1)])):!R.value&&p.value?(c(),g("div",gn,[I(i(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(i(y)("directoryPicker.treeLoading")),1)])):ge.value?(c(),g("div",vn,d(i(y)("directoryPicker.searchMinKeywordHint",{count:i(dt)})),1)):ae.value?(c(),g("div",mn,d(i(y)("directoryPicker.noSearchResults")),1)):J.value?(c(),g("div",hn,d(i(y)("directoryPicker.emptyTree")),1)):R.value?(c(),g("div",yn,[(c(!0),g(he,null,Se(b.value,s=>(c(),g("button",{key:s.path,ref_for:!0,ref:f=>Te(s.path,f),type:"button",class:O(["theme-list-row focus:outline-none",m(_.value)===m(s.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:f=>Ue(s)},[I(i(Xe),{class:"theme-list-item-icon"}),n("div",bn,[n("div",null,[n("span",{class:"theme-list-item-title block break-all",innerHTML:ce(s)},null,8,wn)]),n("div",{class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all",innerHTML:T(s)},null,8,Sn)])],10,xn))),128)),P.value?(c(),g("p",kn,d(i(y)("directoryPicker.truncatedHint")),1)):M("",!0)])):(c(),g("div",Cn,[(c(!0),g(he,null,Se(z.value,s=>(c(),g("div",{key:s.path,ref_for:!0,ref:f=>Te(s.path,f),class:O(["theme-list-tree-item outline-none focus:outline-none focus-visible:outline-none",m(_.value)===m(s.path)?"theme-list-item-active":s.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:Nt({paddingLeft:`${s.depth*16+6}px`})},[n("div",_n,[n("button",{type:"button",class:O(["theme-icon-button h-5 w-5 shrink-0",s.hasChildren?"":"invisible pointer-events-none"]),onClick:nt(f=>ne(s),["stop"])},[s.loading?(c(),re(i(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(c(),re(i(zt),{key:1,class:O(["h-3.5 w-3.5 transition",s.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,$n),n("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:f=>Ae(s)},[I(i(Xe),{class:O(["h-4 w-4 shrink-0",m(_.value)===m(s.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),n("div",jn,[n("div",{class:O(["theme-list-item-title truncate",s.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},d(ke(s)),3),s.isHomeRoot?(c(),g("div",In,d(s.path),1)):M("",!0)])],8,Mn)])],6))),128))]))])],32),n("div",En,[n("div",Pn,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:p.value||E.value,onClick:l[1]||(l[1]=s=>A("close"))},d(i(y)("directoryPicker.cancel")),9,An),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex w-full items-center justify-center gap-2 px-3 py-2 text-xs sm:w-auto",disabled:p.value||E.value||!_.value,onClick:He},[I(i(st),{class:"h-4 w-4"}),n("span",null,d(i(y)("directoryPicker.useCurrentDirectory")),1)],8,Dn)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},Tn={class:"grid gap-4"},Ln={class:"theme-muted-text block text-xs"},Bn=["value","disabled"],Fn={class:"theme-muted-text block text-xs"},Nn={class:"mt-1 flex gap-2"},On={class:"relative min-w-0 flex-1"},Un=["value","disabled"],Hn=["disabled"],zn=["disabled"],Kn={id:"codex-manager-workspace-suggestions"},qn=["value"],Vn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},Wn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},Qn={class:"theme-muted-text block text-xs"},Gn={class:"mt-1"},Xn={class:"flex items-center gap-2 text-sm"},Jn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Yn=["disabled","onClick"],Zn={class:"flex items-center justify-between gap-3"},es={class:"min-w-0 flex-1 truncate"},ts={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},ns={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},ss={class:"theme-muted-text block text-xs"},as={class:"mt-2 grid gap-2"},is=["disabled","onClick"],ls={class:"min-w-0"},os={class:"text-sm text-[var(--theme-textPrimary)]"},rs={class:"theme-muted-text mt-0.5 text-[11px] leading-5"},ds={class:"theme-muted-text mt-2 text-[11px] leading-5"},us={class:"theme-muted-text block text-xs"},cs={class:"mt-1 flex gap-2"},fs=["value","disabled"],ps=["disabled"],gs={key:1,class:"theme-popover theme-divider absolute left-0 right-0 top-[calc(100%+0.375rem)] z-20 overflow-hidden rounded-sm border border-solid shadow-sm"},vs={class:"flex items-center justify-between gap-2 border-b border-solid px-3 py-2 text-[11px] leading-5"},ms={class:"font-medium text-[var(--theme-textPrimary)]"},hs={key:0,class:"theme-muted-text"},ys={key:0,class:"max-h-72 overflow-y-auto p-2"},xs=["disabled","onClick"],bs={class:"flex min-w-0 items-center justify-between gap-3"},ws={class:"min-w-0 flex-1 truncate text-xs font-medium text-[var(--theme-textPrimary)]"},Ss={class:"shrink-0 text-[11px] leading-4 text-[var(--theme-textMuted)]"},ks={key:1,class:"theme-empty-state px-3 py-4 text-xs"},Cs=["disabled"],_s={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},$s={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},vt={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},agentEngines:{type:Array,default:()=>[]},canEditEngine:{type:Boolean,default:!0},canEditCwd:{type:Boolean,default:!0},canEditSessionId:{type:Boolean,default:!0},cwd:{type:String,default:""},cwdReadonlyMessage:{type:String,default:""},duplicateCwdMessage:{type:String,default:""},engine:{type:String,default:"codex"},engineOptions:{type:Array,default:()=>[]},engineReadonlyMessage:{type:String,default:""},mobile:{type:Boolean,default:!1},sessionId:{type:String,default:""},sessionIdCopied:{type:Boolean,default:!1},sessionIdReadonlyMessage:{type:String,default:""},sessionCandidates:{type:Array,default:()=>[]},sessionCandidatesLoading:{type:Boolean,default:!1},title:{type:String,default:""},workspaceSuggestions:{type:Array,default:()=>[]}},emits:["copy-session-id","open-directory-picker","select-session-candidate","update:agentEngines","update:cwd","update:engine","update:sessionId","update:title"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve(),B=$(null),D=$(null),p=$(!1),S=$(-1),E=C(()=>{const h=String(j.engine||"").trim();return j.engineOptions.find(m=>String((m==null?void 0:m.value)||"").trim()===h)||null}),o=C(()=>{const h=Array.isArray(j.agentEngines)?j.agentEngines:[];return[...new Set(h.map(m=>String(m||"").trim()).filter(Boolean))]}),b=C(()=>j.engineOptions.filter(h=>String((h==null?void 0:h.value)||"").trim()!==String(j.engine||"").trim())),P=C(()=>!!String(j.cwd||"").trim()),u=C(()=>String(j.sessionId||"").trim()),_=C(()=>u.value.toLowerCase()),de=C(()=>j.sessionCandidates.filter(h=>h==null?void 0:h.matchedCwd)),V=C(()=>{const h=_.value,m=de.value;return h?m.filter(v=>[v==null?void 0:v.label,v==null?void 0:v.id,v==null?void 0:v.cwd].map(ee=>String(ee||"").toLowerCase()).some(ee=>ee.includes(h))).slice(0,10):m.slice(0,10)});function U(){j.busy||!j.canEditSessionId||!P.value||(p.value=!0)}function F(){p.value=!1,S.value=-1}function H(){const h=V.value;if(!h.length){S.value=-1;return}const m=h.findIndex(v=>v.id===u.value);S.value=m>=0?m:0}function z(){me(()=>{var h,m;(m=(h=D.value)==null?void 0:h.focus)==null||m.call(h)})}function G(){if(p.value){F();return}U(),z()}function X(){A("update:cwd","")}function R(h){if(!j.canEditEngine||j.busy)return;const m=String(h||"").trim(),v=o.value.includes(m)?o.value.filter(K=>K!==m):[...o.value,m];A("update:agentEngines",v)}function Q(){A("update:sessionId",""),F(),z()}function Z(h){var m;A("update:sessionId",((m=h==null?void 0:h.target)==null?void 0:m.value)||""),P.value&&U()}function ge(h){A("select-session-candidate",h),F(),z()}function ae(h){if(j.busy||!j.canEditSessionId||!P.value)return;const m=V.value;if(h.key==="ArrowDown"){if(h.preventDefault(),!p.value){U(),H();return}if(!m.length)return;S.value=S.value<0?0:Math.min(m.length-1,S.value+1);return}if(h.key==="ArrowUp"){if(h.preventDefault(),!p.value){U(),H();return}if(!m.length)return;S.value=S.value<0?m.length-1:Math.max(0,S.value-1);return}if(h.key==="Enter"&&p.value&&m.length&&S.value>=0){h.preventDefault(),ge(m[S.value]);return}h.key==="Escape"&&p.value&&(h.preventDefault(),F())}function J(h){!p.value||!B.value||B.value.contains(h.target)||F()}return oe(V,()=>{H()}),oe(()=>j.canEditSessionId,h=>{(!h||!P.value)&&F()}),oe(P,h=>{h||F()}),Ot(()=>{document.addEventListener("pointerdown",J)}),at(()=>{document.removeEventListener("pointerdown",J)}),(h,m)=>(c(),g("div",Tn,[n("label",Ln,[n("span",null,d(i(y)("projectManager.projectTitleOptional")),1),n("input",{value:r.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:r.busy,onInput:m[0]||(m[0]=v=>A("update:title",v.target.value))},null,40,Bn)]),n("label",Fn,[n("span",null,d(i(y)("projectManager.workingDirectoryField")),1),n("div",Nn,[n("div",On,[n("input",{value:r.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:O(["tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",r.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:r.busy||!r.canEditCwd,onInput:m[1]||(m[1]=v=>A("update:cwd",v.target.value))},null,42,Un),r.cwd&&r.canEditCwd?(c(),g("button",{key:0,type:"button",class:"theme-muted-text absolute right-2 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-sm transition hover:bg-[var(--theme-appPanelHover)] hover:text-[var(--theme-textPrimary)]",disabled:r.busy,onClick:X},[I(i(pt),{class:"h-3.5 w-3.5"})],8,Hn)):M("",!0)]),n("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:r.busy||!r.canEditCwd,onClick:m[2]||(m[2]=v=>A("open-directory-picker"))},[I(i(Xe),{class:"h-4 w-4"}),n("span",null,d(r.mobile?i(y)("projectManager.choose"):i(y)("projectManager.chooseDirectory")),1)],8,zn)]),n("datalist",Kn,[(c(!0),g(he,null,Se(r.workspaceSuggestions,v=>(c(),g("option",{key:v,value:v},null,8,qn))),128))]),r.duplicateCwdMessage?(c(),g("p",Vn,d(r.duplicateCwdMessage),1)):r.cwdReadonlyMessage?(c(),g("p",Wn,d(r.cwdReadonlyMessage),1)):M("",!0)]),n("label",Qn,[n("span",null,d(i(y)("projectManager.engineField")),1),n("div",Gn,[I(Et,{"model-value":r.engine,options:r.engineOptions,disabled:r.busy||!r.canEditEngine,placeholder:i(y)("projectManager.selectEngine"),"empty-text":i(y)("projectManager.noEngines"),"get-option-value":v=>(v==null?void 0:v.value)||"","onUpdate:modelValue":m[3]||(m[3]=v=>A("update:engine",v))},{trigger:De(({disabled:v})=>{var K;return[n("div",Xn,[n("span",{class:O(["min-w-0 flex-1 truncate",v?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},d(((K=E.value)==null?void 0:K.label)||i(y)("projectManager.selectEngine")),3),E.value&&E.value.enabled===!1?(c(),g("span",Jn,d(i(y)("projectManager.comingSoon")),1)):M("",!0)])]}),option:De(({option:v,selected:K,select:ee})=>[n("button",{type:"button",class:O(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",K?"theme-filter-active":"theme-filter-idle"]),disabled:(v==null?void 0:v.enabled)===!1,onClick:ee},[n("div",Zn,[n("span",es,d(v.label),1),(v==null?void 0:v.enabled)===!1?(c(),g("span",ts,d(i(y)("projectManager.comingSoon")),1)):M("",!0)])],10,Yn)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),r.engineReadonlyMessage?(c(),g("p",ns,d(r.engineReadonlyMessage),1)):M("",!0)]),n("div",ss,[n("span",null,d(i(y)("projectManager.collaborationAgents")),1),n("div",as,[(c(!0),g(he,null,Se(b.value,v=>(c(),g("button",{key:v.value,type:"button",class:O(["theme-list-row flex items-center justify-between gap-3 rounded-sm border border-solid px-3 py-2 text-left transition",o.value.includes(v.value)?"theme-list-item-active":"theme-list-item-hover"]),disabled:r.busy||!r.canEditEngine,onClick:K=>R(v.value)},[n("div",ls,[n("div",os,d(v.label),1),n("div",rs,d(o.value.includes(v.value)?i(y)("projectManager.agentEnabled"):i(y)("projectManager.agentDisabled")),1)]),o.value.includes(v.value)?(c(),re(i(st),{key:0,class:"h-4 w-4 shrink-0 text-[var(--theme-textPrimary)]"})):M("",!0)],10,is))),128))]),n("p",ds,d(i(y)("projectManager.collaborationAgentsHint")),1)]),n("label",us,[n("span",null,d(i(y)("projectManager.sessionId")),1),n("div",cs,[n("div",{ref_key:"sessionComboboxRef",ref:B,class:"relative min-w-0 flex-1"},[n("input",{ref_key:"sessionInputRef",ref:D,value:r.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",disabled:r.busy||!r.canEditSessionId,onFocus:U,onInput:Z,onKeydown:ae},null,40,fs),r.canEditSessionId?(c(),g("button",{key:0,type:"button",class:"theme-muted-text absolute right-2 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-sm transition hover:bg-[var(--theme-appPanelHover)] hover:text-[var(--theme-textPrimary)]",disabled:r.busy||!P.value,onClick:G},[r.sessionCandidatesLoading?(c(),re(i(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):u.value?(c(),re(i(pt),{key:1,class:"h-3.5 w-3.5",onClick:nt(Q,["stop"])})):(c(),re(i(Kt),{key:2,class:O(["h-3.5 w-3.5 transition",p.value?"rotate-180":""])},null,8,["class"]))],8,ps)):M("",!0),r.canEditSessionId&&p.value?(c(),g("div",gs,[n("div",vs,[n("span",ms,d(i(y)("projectManager.sessionCandidates")),1),r.sessionCandidatesLoading?(c(),g("span",hs,d(i(y)("projectManager.sessionCandidatesLoading")),1)):M("",!0)]),V.value.length?(c(),g("div",ys,[(c(!0),g(he,null,Se(V.value,(v,K)=>(c(),g("button",{key:`${v.engine}:${v.id}`,type:"button",class:O(["theme-list-row mb-1 w-full px-2 py-1.5 text-left last:mb-0",K===S.value?"theme-list-item-active":"theme-list-item-hover"]),disabled:r.busy,onMousedown:m[4]||(m[4]=nt(()=>{},["prevent"])),onClick:ee=>ge(v)},[n("div",bs,[n("span",ws,d(v.label||v.id),1),n("span",Ss,d(v.updatedAtLabel||i(y)("projectManager.unknown")),1)])],42,xs))),128))])):(c(),g("div",ks,d(P.value?i(y)("projectManager.noSessionCandidates"):i(y)("projectManager.sessionCandidatesNeedDirectory")),1))])):M("",!0)],512),u.value?(c(),g("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:r.busy,onClick:m[5]||(m[5]=v=>A("copy-session-id"))},[r.sessionIdCopied?(c(),re(i(st),{key:0,class:"h-4 w-4"})):(c(),re(i(qt),{key:1,class:"h-4 w-4"})),n("span",null,d(r.sessionIdCopied?i(y)("projectManager.sessionIdCopied"):i(y)("projectManager.copySessionId")),1)],8,Cs)):M("",!0)]),r.sessionIdReadonlyMessage?(c(),g("p",_s,d(r.sessionIdReadonlyMessage),1)):(c(),g("p",$s,d(P.value?i(y)("projectManager.sessionIdHint"):i(y)("projectManager.sessionCandidatesNeedDirectory")),1))])]))}},Ms={class:"flex items-center justify-between gap-3"},js={class:"theme-heading text-sm font-medium"},Is={key:0,class:"theme-muted-text mt-1 text-xs"},Es=["disabled"],Ps=["onClick"],As={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Ds={class:"flex w-full flex-col gap-2 text-left"},Rs={class:"theme-heading min-w-0 text-sm font-medium"},Ts=["title"],Ls=["title"],Bs={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},Fs={key:0,"aria-hidden":"true"},Ns={key:1},Os={class:"flex flex-wrap items-center gap-2 pt-1"},Us={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},mt={__name:"CodexSessionManagerList",props:{busy:{type:Boolean,default:!1},editingSessionId:{type:String,default:""},formatUpdatedAt:{type:Function,default:r=>r},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},hasSessions:{type:Boolean,default:!1},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1},mode:{type:String,default:"edit"},mobile:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]}},emits:["create","select"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve();function B(S){return j.mode==="edit"&&j.editingSessionId===S.id?"theme-card-selected":j.isSessionRunning(S.id)?"theme-card-warning":"theme-card-idle-strong"}function D(S){return j.isCurrentSession(S.id)?y("projectManager.current"):y("projectManager.regular")}function p(S){return j.isCurrentSession(S.id)?"theme-status-info":"theme-status-neutral"}return(S,E)=>(c(),g("div",{class:O(r.mobile?"flex h-full min-h-0 flex-col":"")},[n("div",Ms,[n("div",null,[n("div",js,d(i(y)("projectManager.projectList")),1),r.hasSessions?M("",!0):(c(),g("p",Is,d(i(y)("projectManager.noProjects")),1))]),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:r.busy,onClick:E[0]||(E[0]=o=>A("create"))},[I(i(Vt),{class:"h-4 w-4"}),n("span",null,d(i(y)("projectManager.create")),1)],8,Es)]),n("div",{class:O(["mt-4 space-y-2",r.mobile?"min-h-0 flex-1 overflow-y-auto":"max-h-52 overflow-y-auto pr-1 sm:max-h-64 lg:max-h-[calc(88vh-11rem)]"])},[(c(!0),g(he,null,Se(r.sessions,o=>{var b;return c(),g("article",{key:o.id,class:O(["relative cursor-pointer rounded-sm border p-3 transition",B(o)]),onClick:P=>A("select",o.id)},[r.mode==="edit"&&r.editingSessionId===o.id?(c(),g("span",As)):M("",!0),n("div",Ds,[n("div",Rs,[n("span",{class:"block truncate",title:o.title||i(y)("projectManager.untitledProject")},d(o.title||i(y)("projectManager.untitledProject")),9,Ts)]),n("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:o.cwd},d(o.cwd),9,Ls),n("div",Bs,[n("span",null,d(((b=o==null?void 0:o.agentBindings)==null?void 0:b.length)>1?i(y)("projectManager.agentCount",{count:o.agentBindings.length}):i(tt)(o.engine)),1),r.mobile?M("",!0):(c(),g("span",Fs,"·")),r.mobile?M("",!0):(c(),g("span",Ns,d(r.formatUpdatedAt(o.updatedAt)),1))]),n("div",Os,[n("span",{class:O(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",p(o)])},d(D(o)),3),n("span",{class:O(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",r.getRuntimeStatusClass(o.id)])},[r.isSessionRunning(o.id)?(c(),g("span",Us)):M("",!0),yt(" "+d(r.getRuntimeStatusLabel(o.id)),1)],2),n("span",{class:O(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",r.getThreadStatusClass(o)])},d(r.getThreadStatusLabel(o)),3)])])],10,Ps)}),128))],2)],2))}},Hs={class:"space-y-3"},zs={class:"dashed-panel px-3 py-3"},Ks={class:"theme-muted-text text-[11px]"},qs={class:"mt-2 flex flex-wrap gap-2"},Vs={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Ws={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},Qs={class:"dashed-panel px-3 py-3"},Gs={class:"theme-muted-text text-[11px]"},Xs={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Js={key:0,class:"mt-2 flex flex-wrap gap-1.5"},Ys={class:"dashed-panel px-3 py-3"},Zs={class:"theme-muted-text text-[11px]"},ea={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},ta={class:"dashed-panel px-3 py-3"},na={class:"theme-muted-text text-[11px]"},sa={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},aa={class:"dashed-panel px-3 py-3"},ia={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},la={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},oa={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:r=>r},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1}},setup(r){const{t:q}=Ve();return(j,A)=>{var y,B,D,p,S,E,o,b,P;return c(),g("div",Hs,[n("div",zs,[n("div",Ks,d(i(q)("projectManager.runtimeStatus")),1),n("div",qs,[n("span",{class:O(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",r.getRuntimeStatusClass((y=r.activeSession)==null?void 0:y.id)])},[r.isSessionRunning((B=r.activeSession)==null?void 0:B.id)?(c(),g("span",Vs)):M("",!0),yt(" "+d(r.getRuntimeStatusLabel((D=r.activeSession)==null?void 0:D.id)),1)],2),n("span",{class:O(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",r.getThreadStatusClass(r.activeSession)])},d(r.getThreadStatusLabel(r.activeSession)),3),(p=r.activeSession)!=null&&p.id&&r.isCurrentSession(r.activeSession.id)?(c(),g("span",Ws,d(i(q)("projectManager.currentProject")),1)):M("",!0)])]),n("div",Qs,[n("div",Gs,d(i(q)("projectManager.engine")),1),n("div",Xs,d(i(tt)((S=r.activeSession)==null?void 0:S.engine)),1),((o=(E=r.activeSession)==null?void 0:E.agentBindings)==null?void 0:o.length)>1?(c(),g("div",Js,[(c(!0),g(he,null,Se(r.activeSession.agentBindings,u=>(c(),g("span",{key:u.engine,class:"theme-status-neutral inline-flex items-center rounded-sm border border-solid px-1.5 py-0.5 text-[10px]"},d(i(tt)(u.engine)),1))),128))])):M("",!0)]),n("div",Ys,[n("div",Zs,d(i(q)("projectManager.workingDirectory")),1),n("div",ea,d(((b=r.activeSession)==null?void 0:b.cwd)||i(q)("projectManager.notSet")),1)]),n("div",ta,[n("div",na,d(i(q)("projectManager.updatedAt")),1),n("div",sa,d(r.formatUpdatedAt((P=r.activeSession)==null?void 0:P.updatedAt)),1)]),n("div",aa,[n("div",ia,[I(i(Wt),{class:"h-3.5 w-3.5"}),n("span",null,d(i(q)("projectManager.note")),1)]),n("p",la,d(i(q)("projectManager.noteDescription")),1)])])}}},ra={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},da={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},ua={class:"theme-divider theme-muted-panel border-b px-3 py-3 sm:px-4 sm:py-4 lg:border-b-0 lg:border-r"},ca={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},fa={class:"flex flex-wrap items-start justify-between gap-3"},pa={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ga={class:"mt-5"},va={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},ma={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4 sm:flex-row sm:items-center sm:justify-between"},ha={class:"flex flex-wrap items-center gap-2"},ya=["disabled"],xa=["disabled"],ba=["disabled"],wa={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},Sa=["disabled"],ka=["disabled"],Ca=["disabled"],_a={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},$a={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ma={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},ja={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ia={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},Ea=["disabled"],Pa={class:"min-w-0 flex-1"},Aa={class:"theme-heading truncate text-sm font-medium"},Da={key:0,class:"theme-muted-text mt-1 truncate text-xs"},Ra={class:"theme-divider border-b px-4 py-3"},Ta={class:"grid grid-cols-2 gap-2"},La=["disabled"],Ba={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Fa={key:0},Na={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Oa={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Ua=["disabled"],Ha=["disabled"],za=["disabled"],Ka=["disabled"],qa=3e3,Za={__name:"CodexSessionManagerDialog",props:{open:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]},workspaces:{type:Array,default:()=>[]},selectedSessionId:{type:String,default:""},selectionLocked:{type:Boolean,default:!1},selectionLockReason:{type:String,default:""},loading:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},onRefresh:{type:Function,default:null},onCreate:{type:Function,default:null},onUpdate:{type:Function,default:null},onDelete:{type:Function,default:null},onReset:{type:Function,default:null}},emits:["close","project-created","select-session","open-source-browser"],setup(r,{expose:q,emit:j}){const A=new Map;function y(t="",a=""){const x=qe(t),k=et(a);return!x||!k?"":`${x}
|
|
1
|
+
import{W as dt,f as ht,m as Mt,s as jt,n as It,o as ut,d as Et,p as tt,c as Pt,q as ct,t as ft,v as At,w as qe,x as Dt,y as et}from"./WorkbenchView-CdD65SV0.js";import{u as Ve,f as Rt,e as Tt}from"./index-Ca-xxeXy.js";import{w as oe,n as me,ak as at,aD as c,aI as re,aJ as De,aF as n,aQ as d,u as i,aG as I,aW as Lt,aU as Bt,aX as Ft,aE as g,aR as he,aS as Se,aL as O,aN as M,aV as Nt,aK as nt,b as $,c as C,o as Ot,aZ as yt,r as Ut}from"./vendor-misc-u-M8sNMf.js";import{c as Ht,L as Ge,F as Xe,e as zt,b as st,X as pt,C as Kt,M as qt,j as Vt,x as Wt,P as Qt,i as gt,E as Gt,N as Xt,q as Jt,r as Yt,O as Zt}from"./vendor-ui-BwEQCho1.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";import"./vendor-router-Dn8q3tJM.js";const en={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},tn={class:"theme-muted-text mt-1 text-xs leading-5"},nn={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},sn={class:"flex items-start gap-2 text-xs leading-5"},an={class:"theme-muted-text shrink-0"},ln={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},on={class:"theme-muted-text mt-4 block text-xs"},rn={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},dn=["placeholder"],un={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},cn={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},fn={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},pn={key:2,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},gn={key:3,class:"theme-empty-state flex items-center justify-center gap-2 px-3 py-8 text-sm"},vn={key:4,class:"theme-empty-state px-3 py-8 text-sm"},mn={key:5,class:"theme-empty-state px-3 py-8 text-sm"},hn={key:6,class:"theme-empty-state px-3 py-8 text-sm"},yn={key:7,class:"space-y-1"},xn=["onClick"],bn={class:"min-w-0 flex-1"},wn=["innerHTML"],Sn=["innerHTML"],kn={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},Cn={key:8,class:"space-y-1"},_n={class:"flex items-start gap-1.5"},$n=["onClick"],Mn=["onClick"],jn={class:"min-w-0 flex-1"},In={key:0,class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all"},En={class:"theme-divider flex flex-col-reverse gap-2 border-t border-dashed px-4 py-4 sm:flex-row sm:items-center sm:justify-end sm:px-5"},Pn={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},An=["disabled"],Dn=["disabled"],Rn={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve(),B=$(""),D=$(null),p=$(!1),S=$(""),E=$(!1),o=$(""),b=$([]),P=$(!1),u=$(""),_=$(""),de=$(null);let V=null,U=0,F=null;const H=new Map,z=C(()=>$e(D.value?[D.value]:[])),G=C(()=>String(u.value||"").trim()),X=C(()=>G.value.length>=dt),R=C(()=>!!G.value),Q=C(()=>R.value?b.value:z.value),Z=C(()=>Q.value.map(e=>{const l=m((e==null?void 0:e.path)||""),s=e!=null&&e.expanded?1:0,f=e!=null&&e.loading?1:0;return`${l}:${s}:${f}`}).join("|")),ge=C(()=>R.value&&!X.value&&!E.value&&!o.value),ae=C(()=>R.value&&X.value&&!E.value&&!o.value&&!b.value.length),J=C(()=>!R.value&&!p.value&&!S.value&&!z.value.length);function h(e=""){const l=String(e||"").trim();return/^[a-z]:[\\/]/i.test(l)||l.includes("\\")}function m(e=""){const l=String(e||"").trim();if(!l)return"";const s=h(l);let f=l.replace(/\\/g,"/");return f.length>1&&!/^[a-z]:\/?$/i.test(f)&&f!=="/"&&(f=f.replace(/\/+$/,"")),s?f.toLowerCase():f}function v(e="",l=""){const s=m(e),f=m(l);return!s||!f?!1:s===f||s.startsWith(`${f}/`)}function K(e="",l=""){const s=String(e||"").trim(),f=String(l||"").trim();return s?f?h(s)?/^[a-z]:\\?$/i.test(s)?`${s.replace(/[\\/]+$/,"")}\\${f}`:`${s.replace(/[\\/]+$/,"")}\\${f}`:s==="/"?`/${f}`:`${s.replace(/\/+$/,"")}/${f}`:s:f}function ee(e="",l=""){const s=m(e),f=m(l);if(!s||!f||!v(f,s))return[];const W=f===s?"":f.slice(s.length).replace(/^\//,"");return W?W.split("/").filter(Boolean):[]}function w(e=""){const l=String(e||"").trim();if(!l||m(l)===m(B.value))return"";const s=h(l),f=l.replace(/\\/g,"/");if(s){const ie=f.replace(/\/+$/,""),le=ie.lastIndexOf("/");if(le<=2)return"";const ze=ie.slice(0,le).replace(/\//g,"\\");return v(ze,B.value)?ze:""}const W=f.replace(/\/+$/,""),se=W.lastIndexOf("/");if(se<=0)return"";const we=W.slice(0,se)||"/";return v(we,B.value)?we:""}function ke(e){return(e==null?void 0:e.name)||(e==null?void 0:e.path)||y("directoryPicker.unnamedDirectory")}function Je(e=""){const l=String(e||"").trim();return l?l.split(/[\\/]/).filter(Boolean).at(-1)||l:"Home"}function ue(e=""){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ce(e="",l=""){const s=String(e||""),f=String(l||"").trim().toLowerCase();if(!s||!f)return null;const W=s.toLowerCase(),se=W.indexOf(f);if(se>=0)return{start:se,end:se+f.length};const we=f.split(/[\\/\s_.-]+/).filter(Boolean).sort((ie,le)=>le.length-ie.length);for(const ie of we){if(ie.length<2)continue;const le=W.indexOf(ie);if(le>=0)return{start:le,end:le+ie.length}}return null}function _e(e="",l=""){const s=String(e||""),f=Ce(s,l);return f?`${ue(s.slice(0,f.start))}<mark class="theme-search-highlight">${ue(s.slice(f.start,f.end))}</mark>${ue(s.slice(f.end))}`:ue(s)}function ce(e){return _e(ke(e),u.value)}function T(e){return _e((e==null?void 0:e.path)||"",u.value)}function Re(e,l=0){return{...e,depth:l,expanded:!1,loaded:!1,loading:!1,children:[]}}function $e(e=[],l=[]){return e.forEach(s=>{l.push(s),s.expanded&&s.children.length&&$e(s.children,l)}),l}function fe(){D.value&&(D.value={...D.value})}function ye(){V&&(window.clearTimeout(V),V=null),F&&(F.abort(),F=null)}function xe(e,l=D.value?[D.value]:[]){const s=m(e);if(!s)return null;for(const f of l){if(m(f.path)===s)return f;if(f.children.length){const W=xe(e,f.children);if(W)return W}}return null}function Y(e){_.value=String((e==null?void 0:e.path)||"").trim()}function pe(e=""){return m(e)}function Te(e,l){const s=pe(e);if(s){if(l){H.set(s,l);return}H.delete(s)}}function be(){var l;const e=H.get(pe(_.value));(l=e==null?void 0:e.scrollIntoView)==null||l.call(e,{block:"nearest"})}function We(){me(()=>{var e,l;(l=(e=de.value)==null?void 0:e.focus)==null||l.call(e)})}function Ye(){const e=Q.value;if(!e.length){_.value="";return}const l=pe(_.value);l&&e.some(s=>pe((s==null?void 0:s.path)||"")===l)||Y(e[0])}function Me(){const e=Q.value;if(!e.length)return-1;const l=pe(_.value),s=e.findIndex(f=>pe((f==null?void 0:f.path)||"")===l);return s>=0?s:0}function te(){const e=Q.value,l=Me();return l<0||!e.length?null:e[l]||null}function ve(e=1){const l=Q.value;if(!l.length)return!1;const s=Me(),f=s<0?0:(s+e+l.length)%l.length;return Y(l[f]),me(be),!0}async function Qe(){if(R.value)return!1;const e=te();if(!e||!e.hasChildren)return!1;if(!e.expanded)return await ne(e),!0;const l=Q.value,s=Me(),f=l[s+1];return f&&w(f.path)===e.path?(Y(f),me(be),!0):!1}function Le(){if(R.value)return!1;const e=te();if(!e)return!1;if(e.expanded&&e.hasChildren)return e.expanded=!1,fe(),Y(e),!0;const l=w(e.path);if(!l)return!1;const s=xe(l);return s?(Y(s),me(be),!0):!1}function je(e){var l,s,f;if((l=e==null?void 0:e.preventDefault)==null||l.call(e),G.value){(s=e==null?void 0:e.stopPropagation)==null||s.call(e),u.value="";return}(f=e==null?void 0:e.stopPropagation)==null||f.call(e),A("close")}function Be(e){const l=String((e==null?void 0:e.key)||"");if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Escape"].includes(l)&&!(R.value&&(l==="ArrowLeft"||l==="ArrowRight"))){if(l==="ArrowDown"){e.preventDefault(),ve(1);return}if(l==="ArrowUp"){e.preventDefault(),ve(-1);return}if(l==="Escape"){je(e);return}if(R.value){if(l==="Enter"){e.preventDefault();const s=te();s&&Ue(s)}return}if(l==="ArrowRight"){e.preventDefault(),Qe();return}if(l==="ArrowLeft"){e.preventDefault(),Le();return}l==="Enter"&&(e.preventDefault(),He())}}async function Ie(e,l={}){if(!(!e||e.loading)&&!(e.loaded&&!l.force)){e.loading=!0,S.value="",fe();try{const s=await ut({path:e.path,limit:240});e.children=(s.items||[]).map(f=>Re(f,e.depth+1)),e.loaded=!0}catch(s){S.value=s.message||y("directoryPicker.loadFailed")}finally{e.loading=!1,fe()}}}async function Ee(){p.value=!0,S.value="";try{const e=await ut({limit:240});B.value=String(e.path||""),D.value=Re({name:Je(e.path||""),path:String(e.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),D.value.children=(e.items||[]).map(l=>Re(l,1)),D.value.loaded=!0,D.value.expanded=!0,Y(D.value)}catch(e){S.value=e.message||y("directoryPicker.treeLoadFailed"),D.value=null,B.value=""}finally{p.value=!1}}async function Fe(e=""){const l=String(e||"").trim();if(!l||!B.value||!v(l,B.value))return;let s=D.value;if(!s)return;Y(s);const f=ee(B.value,l);for(const W of f){await Ie(s),s.expanded=!0,fe();const se=xe(K(s.path,W),s.children);if(!se)break;s=se,Y(s)}}async function Pe(){u.value="",b.value=[],o.value="",P.value=!1,_.value="",await Ee();const e=String(j.initialPath||"").trim();e&&v(e,B.value)&&await Fe(e)}async function ne(e){if(e!=null&&e.path&&(Y(e),!!e.hasChildren)){if(!e.loaded){e.expanded=!0,fe(),await Ie(e);return}e.expanded=!e.expanded,fe()}}function Ae(e){e!=null&&e.path&&Y(e)}async function Ne(){const e=String(u.value||"").trim();U+=1;const l=U;if(ye(),!j.open||!e||!B.value||!X.value){E.value=!1,o.value="",b.value=[],P.value=!1;return}E.value=!0,o.value="",F=new AbortController;try{const s=await jt(e,{path:B.value,limit:80,signal:F.signal});if(l!==U)return;b.value=Array.isArray(s.items)?s.items:[],P.value=!!s.truncated}catch(s){if(It(s)||l!==U)return;o.value=s.message||y("directoryPicker.searchFailed"),b.value=[],P.value=!1}finally{l===U&&(F=null),l===U&&(E.value=!1)}}function Oe(){if(ye(),!String(u.value||"").trim()||!X.value){E.value=!1,o.value="",b.value=[],P.value=!1;return}E.value=!0,o.value="",V=window.setTimeout(()=>{V=null,Ne()},Mt)}async function Ue(e){e!=null&&e.path&&(await Fe(e.path),u.value="")}function He(){_.value&&(A("select",_.value),A("close"))}return oe(u,()=>{Oe()}),oe(Z,()=>{Ye(),me(be)},{immediate:!0}),oe(()=>j.open,e=>{if(e){Pe().catch(()=>{}),We();return}ye()}),at(()=>{ye()}),(e,l)=>(c(),re(ht,{open:r.open,"stack-level":1,"panel-class":"settings-dialog-panel h-full max-w-4xl sm:h-auto sm:max-h-[86vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 flex-col overflow-hidden px-4 py-4 sm:px-5","close-disabled":p.value||E.value,"close-on-backdrop":!(p.value||E.value),"close-on-escape":!(p.value||E.value),onClose:l[2]||(l[2]=s=>A("close"))},{title:De(()=>[n("div",null,[n("div",en,[I(i(Xe),{class:"h-4 w-4"}),n("span",null,d(i(y)("directoryPicker.title")),1)]),n("p",tn,d(i(y)("directoryPicker.intro")),1)])]),default:De(()=>[n("div",{class:"flex min-h-0 flex-1 flex-col overflow-hidden",onKeydown:Be},[n("div",nn,[n("div",sn,[n("span",an,d(i(y)("directoryPicker.currentSelection")),1),n("span",ln,d(_.value||i(y)("directoryPicker.selectionPlaceholder")),1)])]),n("label",on,[n("span",null,d(i(y)("directoryPicker.searchLabel")),1),n("div",rn,[I(i(Ht),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),Lt(n("input",{ref_key:"searchInputRef",ref:de,"onUpdate:modelValue":l[0]||(l[0]=s=>u.value=s),type:"text",placeholder:i(y)("directoryPicker.searchPlaceholder"),class:"min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]",onKeydown:Bt(je,["esc"])},null,40,dn),[[Ft,u.value]])])]),n("div",un,[R.value&&o.value?(c(),g("div",cn,d(o.value),1)):!R.value&&S.value?(c(),g("div",fn,d(S.value),1)):R.value&&E.value?(c(),g("div",pn,[I(i(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(i(y)("directoryPicker.searching")),1)])):!R.value&&p.value?(c(),g("div",gn,[I(i(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,d(i(y)("directoryPicker.treeLoading")),1)])):ge.value?(c(),g("div",vn,d(i(y)("directoryPicker.searchMinKeywordHint",{count:i(dt)})),1)):ae.value?(c(),g("div",mn,d(i(y)("directoryPicker.noSearchResults")),1)):J.value?(c(),g("div",hn,d(i(y)("directoryPicker.emptyTree")),1)):R.value?(c(),g("div",yn,[(c(!0),g(he,null,Se(b.value,s=>(c(),g("button",{key:s.path,ref_for:!0,ref:f=>Te(s.path,f),type:"button",class:O(["theme-list-row focus:outline-none",m(_.value)===m(s.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:f=>Ue(s)},[I(i(Xe),{class:"theme-list-item-icon"}),n("div",bn,[n("div",null,[n("span",{class:"theme-list-item-title block break-all",innerHTML:ce(s)},null,8,wn)]),n("div",{class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all",innerHTML:T(s)},null,8,Sn)])],10,xn))),128)),P.value?(c(),g("p",kn,d(i(y)("directoryPicker.truncatedHint")),1)):M("",!0)])):(c(),g("div",Cn,[(c(!0),g(he,null,Se(z.value,s=>(c(),g("div",{key:s.path,ref_for:!0,ref:f=>Te(s.path,f),class:O(["theme-list-tree-item outline-none focus:outline-none focus-visible:outline-none",m(_.value)===m(s.path)?"theme-list-item-active":s.expanded?"theme-list-item-expanded":"theme-list-item-hover"]),style:Nt({paddingLeft:`${s.depth*16+6}px`})},[n("div",_n,[n("button",{type:"button",class:O(["theme-icon-button h-5 w-5 shrink-0",s.hasChildren?"":"invisible pointer-events-none"]),onClick:nt(f=>ne(s),["stop"])},[s.loading?(c(),re(i(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(c(),re(i(zt),{key:1,class:O(["h-3.5 w-3.5 transition",s.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,$n),n("button",{type:"button",class:"flex min-w-0 flex-1 items-start gap-1.5 rounded-sm px-0.5 py-0.5 text-left",onClick:f=>Ae(s)},[I(i(Xe),{class:O(["h-4 w-4 shrink-0",m(_.value)===m(s.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),n("div",jn,[n("div",{class:O(["theme-list-item-title truncate",s.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},d(ke(s)),3),s.isHomeRoot?(c(),g("div",In,d(s.path),1)):M("",!0)])],8,Mn)])],6))),128))]))])],32),n("div",En,[n("div",Pn,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:p.value||E.value,onClick:l[1]||(l[1]=s=>A("close"))},d(i(y)("directoryPicker.cancel")),9,An),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex w-full items-center justify-center gap-2 px-3 py-2 text-xs sm:w-auto",disabled:p.value||E.value||!_.value,onClick:He},[I(i(st),{class:"h-4 w-4"}),n("span",null,d(i(y)("directoryPicker.useCurrentDirectory")),1)],8,Dn)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},Tn={class:"grid gap-4"},Ln={class:"theme-muted-text block text-xs"},Bn=["value","disabled"],Fn={class:"theme-muted-text block text-xs"},Nn={class:"mt-1 flex gap-2"},On={class:"relative min-w-0 flex-1"},Un=["value","disabled"],Hn=["disabled"],zn=["disabled"],Kn={id:"codex-manager-workspace-suggestions"},qn=["value"],Vn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},Wn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},Qn={class:"theme-muted-text block text-xs"},Gn={class:"mt-1"},Xn={class:"flex items-center gap-2 text-sm"},Jn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},Yn=["disabled","onClick"],Zn={class:"flex items-center justify-between gap-3"},es={class:"min-w-0 flex-1 truncate"},ts={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},ns={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},ss={class:"theme-muted-text block text-xs"},as={class:"mt-2 grid gap-2"},is=["disabled","onClick"],ls={class:"min-w-0"},os={class:"text-sm text-[var(--theme-textPrimary)]"},rs={class:"theme-muted-text mt-0.5 text-[11px] leading-5"},ds={class:"theme-muted-text mt-2 text-[11px] leading-5"},us={class:"theme-muted-text block text-xs"},cs={class:"mt-1 flex gap-2"},fs=["value","disabled"],ps=["disabled"],gs={key:1,class:"theme-popover theme-divider absolute left-0 right-0 top-[calc(100%+0.375rem)] z-20 overflow-hidden rounded-sm border border-solid shadow-sm"},vs={class:"flex items-center justify-between gap-2 border-b border-solid px-3 py-2 text-[11px] leading-5"},ms={class:"font-medium text-[var(--theme-textPrimary)]"},hs={key:0,class:"theme-muted-text"},ys={key:0,class:"max-h-72 overflow-y-auto p-2"},xs=["disabled","onClick"],bs={class:"flex min-w-0 items-center justify-between gap-3"},ws={class:"min-w-0 flex-1 truncate text-xs font-medium text-[var(--theme-textPrimary)]"},Ss={class:"shrink-0 text-[11px] leading-4 text-[var(--theme-textMuted)]"},ks={key:1,class:"theme-empty-state px-3 py-4 text-xs"},Cs=["disabled"],_s={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},$s={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},vt={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},agentEngines:{type:Array,default:()=>[]},canEditEngine:{type:Boolean,default:!0},canEditCwd:{type:Boolean,default:!0},canEditSessionId:{type:Boolean,default:!0},cwd:{type:String,default:""},cwdReadonlyMessage:{type:String,default:""},duplicateCwdMessage:{type:String,default:""},engine:{type:String,default:"codex"},engineOptions:{type:Array,default:()=>[]},engineReadonlyMessage:{type:String,default:""},mobile:{type:Boolean,default:!1},sessionId:{type:String,default:""},sessionIdCopied:{type:Boolean,default:!1},sessionIdReadonlyMessage:{type:String,default:""},sessionCandidates:{type:Array,default:()=>[]},sessionCandidatesLoading:{type:Boolean,default:!1},title:{type:String,default:""},workspaceSuggestions:{type:Array,default:()=>[]}},emits:["copy-session-id","open-directory-picker","select-session-candidate","update:agentEngines","update:cwd","update:engine","update:sessionId","update:title"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve(),B=$(null),D=$(null),p=$(!1),S=$(-1),E=C(()=>{const h=String(j.engine||"").trim();return j.engineOptions.find(m=>String((m==null?void 0:m.value)||"").trim()===h)||null}),o=C(()=>{const h=Array.isArray(j.agentEngines)?j.agentEngines:[];return[...new Set(h.map(m=>String(m||"").trim()).filter(Boolean))]}),b=C(()=>j.engineOptions.filter(h=>String((h==null?void 0:h.value)||"").trim()!==String(j.engine||"").trim())),P=C(()=>!!String(j.cwd||"").trim()),u=C(()=>String(j.sessionId||"").trim()),_=C(()=>u.value.toLowerCase()),de=C(()=>j.sessionCandidates.filter(h=>h==null?void 0:h.matchedCwd)),V=C(()=>{const h=_.value,m=de.value;return h?m.filter(v=>[v==null?void 0:v.label,v==null?void 0:v.id,v==null?void 0:v.cwd].map(ee=>String(ee||"").toLowerCase()).some(ee=>ee.includes(h))).slice(0,10):m.slice(0,10)});function U(){j.busy||!j.canEditSessionId||!P.value||(p.value=!0)}function F(){p.value=!1,S.value=-1}function H(){const h=V.value;if(!h.length){S.value=-1;return}const m=h.findIndex(v=>v.id===u.value);S.value=m>=0?m:0}function z(){me(()=>{var h,m;(m=(h=D.value)==null?void 0:h.focus)==null||m.call(h)})}function G(){if(p.value){F();return}U(),z()}function X(){A("update:cwd","")}function R(h){if(!j.canEditEngine||j.busy)return;const m=String(h||"").trim(),v=o.value.includes(m)?o.value.filter(K=>K!==m):[...o.value,m];A("update:agentEngines",v)}function Q(){A("update:sessionId",""),F(),z()}function Z(h){var m;A("update:sessionId",((m=h==null?void 0:h.target)==null?void 0:m.value)||""),P.value&&U()}function ge(h){A("select-session-candidate",h),F(),z()}function ae(h){if(j.busy||!j.canEditSessionId||!P.value)return;const m=V.value;if(h.key==="ArrowDown"){if(h.preventDefault(),!p.value){U(),H();return}if(!m.length)return;S.value=S.value<0?0:Math.min(m.length-1,S.value+1);return}if(h.key==="ArrowUp"){if(h.preventDefault(),!p.value){U(),H();return}if(!m.length)return;S.value=S.value<0?m.length-1:Math.max(0,S.value-1);return}if(h.key==="Enter"&&p.value&&m.length&&S.value>=0){h.preventDefault(),ge(m[S.value]);return}h.key==="Escape"&&p.value&&(h.preventDefault(),F())}function J(h){!p.value||!B.value||B.value.contains(h.target)||F()}return oe(V,()=>{H()}),oe(()=>j.canEditSessionId,h=>{(!h||!P.value)&&F()}),oe(P,h=>{h||F()}),Ot(()=>{document.addEventListener("pointerdown",J)}),at(()=>{document.removeEventListener("pointerdown",J)}),(h,m)=>(c(),g("div",Tn,[n("label",Ln,[n("span",null,d(i(y)("projectManager.projectTitleOptional")),1),n("input",{value:r.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:r.busy,onInput:m[0]||(m[0]=v=>A("update:title",v.target.value))},null,40,Bn)]),n("label",Fn,[n("span",null,d(i(y)("projectManager.workingDirectoryField")),1),n("div",Nn,[n("div",On,[n("input",{value:r.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:O(["tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",r.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:r.busy||!r.canEditCwd,onInput:m[1]||(m[1]=v=>A("update:cwd",v.target.value))},null,42,Un),r.cwd&&r.canEditCwd?(c(),g("button",{key:0,type:"button",class:"theme-muted-text absolute right-2 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-sm transition hover:bg-[var(--theme-appPanelHover)] hover:text-[var(--theme-textPrimary)]",disabled:r.busy,onClick:X},[I(i(pt),{class:"h-3.5 w-3.5"})],8,Hn)):M("",!0)]),n("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:r.busy||!r.canEditCwd,onClick:m[2]||(m[2]=v=>A("open-directory-picker"))},[I(i(Xe),{class:"h-4 w-4"}),n("span",null,d(r.mobile?i(y)("projectManager.choose"):i(y)("projectManager.chooseDirectory")),1)],8,zn)]),n("datalist",Kn,[(c(!0),g(he,null,Se(r.workspaceSuggestions,v=>(c(),g("option",{key:v,value:v},null,8,qn))),128))]),r.duplicateCwdMessage?(c(),g("p",Vn,d(r.duplicateCwdMessage),1)):r.cwdReadonlyMessage?(c(),g("p",Wn,d(r.cwdReadonlyMessage),1)):M("",!0)]),n("label",Qn,[n("span",null,d(i(y)("projectManager.engineField")),1),n("div",Gn,[I(Et,{"model-value":r.engine,options:r.engineOptions,disabled:r.busy||!r.canEditEngine,placeholder:i(y)("projectManager.selectEngine"),"empty-text":i(y)("projectManager.noEngines"),"get-option-value":v=>(v==null?void 0:v.value)||"","onUpdate:modelValue":m[3]||(m[3]=v=>A("update:engine",v))},{trigger:De(({disabled:v})=>{var K;return[n("div",Xn,[n("span",{class:O(["min-w-0 flex-1 truncate",v?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},d(((K=E.value)==null?void 0:K.label)||i(y)("projectManager.selectEngine")),3),E.value&&E.value.enabled===!1?(c(),g("span",Jn,d(i(y)("projectManager.comingSoon")),1)):M("",!0)])]}),option:De(({option:v,selected:K,select:ee})=>[n("button",{type:"button",class:O(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",K?"theme-filter-active":"theme-filter-idle"]),disabled:(v==null?void 0:v.enabled)===!1,onClick:ee},[n("div",Zn,[n("span",es,d(v.label),1),(v==null?void 0:v.enabled)===!1?(c(),g("span",ts,d(i(y)("projectManager.comingSoon")),1)):M("",!0)])],10,Yn)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),r.engineReadonlyMessage?(c(),g("p",ns,d(r.engineReadonlyMessage),1)):M("",!0)]),n("div",ss,[n("span",null,d(i(y)("projectManager.collaborationAgents")),1),n("div",as,[(c(!0),g(he,null,Se(b.value,v=>(c(),g("button",{key:v.value,type:"button",class:O(["theme-list-row flex items-center justify-between gap-3 rounded-sm border border-solid px-3 py-2 text-left transition",o.value.includes(v.value)?"theme-list-item-active":"theme-list-item-hover"]),disabled:r.busy||!r.canEditEngine,onClick:K=>R(v.value)},[n("div",ls,[n("div",os,d(v.label),1),n("div",rs,d(o.value.includes(v.value)?i(y)("projectManager.agentEnabled"):i(y)("projectManager.agentDisabled")),1)]),o.value.includes(v.value)?(c(),re(i(st),{key:0,class:"h-4 w-4 shrink-0 text-[var(--theme-textPrimary)]"})):M("",!0)],10,is))),128))]),n("p",ds,d(i(y)("projectManager.collaborationAgentsHint")),1)]),n("label",us,[n("span",null,d(i(y)("projectManager.sessionId")),1),n("div",cs,[n("div",{ref_key:"sessionComboboxRef",ref:B,class:"relative min-w-0 flex-1"},[n("input",{ref_key:"sessionInputRef",ref:D,value:r.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",disabled:r.busy||!r.canEditSessionId,onFocus:U,onInput:Z,onKeydown:ae},null,40,fs),r.canEditSessionId?(c(),g("button",{key:0,type:"button",class:"theme-muted-text absolute right-2 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 items-center justify-center rounded-sm transition hover:bg-[var(--theme-appPanelHover)] hover:text-[var(--theme-textPrimary)]",disabled:r.busy||!P.value,onClick:G},[r.sessionCandidatesLoading?(c(),re(i(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):u.value?(c(),re(i(pt),{key:1,class:"h-3.5 w-3.5",onClick:nt(Q,["stop"])})):(c(),re(i(Kt),{key:2,class:O(["h-3.5 w-3.5 transition",p.value?"rotate-180":""])},null,8,["class"]))],8,ps)):M("",!0),r.canEditSessionId&&p.value?(c(),g("div",gs,[n("div",vs,[n("span",ms,d(i(y)("projectManager.sessionCandidates")),1),r.sessionCandidatesLoading?(c(),g("span",hs,d(i(y)("projectManager.sessionCandidatesLoading")),1)):M("",!0)]),V.value.length?(c(),g("div",ys,[(c(!0),g(he,null,Se(V.value,(v,K)=>(c(),g("button",{key:`${v.engine}:${v.id}`,type:"button",class:O(["theme-list-row mb-1 w-full px-2 py-1.5 text-left last:mb-0",K===S.value?"theme-list-item-active":"theme-list-item-hover"]),disabled:r.busy,onMousedown:m[4]||(m[4]=nt(()=>{},["prevent"])),onClick:ee=>ge(v)},[n("div",bs,[n("span",ws,d(v.label||v.id),1),n("span",Ss,d(v.updatedAtLabel||i(y)("projectManager.unknown")),1)])],42,xs))),128))])):(c(),g("div",ks,d(P.value?i(y)("projectManager.noSessionCandidates"):i(y)("projectManager.sessionCandidatesNeedDirectory")),1))])):M("",!0)],512),u.value?(c(),g("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:r.busy,onClick:m[5]||(m[5]=v=>A("copy-session-id"))},[r.sessionIdCopied?(c(),re(i(st),{key:0,class:"h-4 w-4"})):(c(),re(i(qt),{key:1,class:"h-4 w-4"})),n("span",null,d(r.sessionIdCopied?i(y)("projectManager.sessionIdCopied"):i(y)("projectManager.copySessionId")),1)],8,Cs)):M("",!0)]),r.sessionIdReadonlyMessage?(c(),g("p",_s,d(r.sessionIdReadonlyMessage),1)):(c(),g("p",$s,d(P.value?i(y)("projectManager.sessionIdHint"):i(y)("projectManager.sessionCandidatesNeedDirectory")),1))])]))}},Ms={class:"flex items-center justify-between gap-3"},js={class:"theme-heading text-sm font-medium"},Is={key:0,class:"theme-muted-text mt-1 text-xs"},Es=["disabled"],Ps=["onClick"],As={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Ds={class:"flex w-full flex-col gap-2 text-left"},Rs={class:"theme-heading min-w-0 text-sm font-medium"},Ts=["title"],Ls=["title"],Bs={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},Fs={key:0,"aria-hidden":"true"},Ns={key:1},Os={class:"flex flex-wrap items-center gap-2 pt-1"},Us={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},mt={__name:"CodexSessionManagerList",props:{busy:{type:Boolean,default:!1},editingSessionId:{type:String,default:""},formatUpdatedAt:{type:Function,default:r=>r},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},hasSessions:{type:Boolean,default:!1},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1},mode:{type:String,default:"edit"},mobile:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]}},emits:["create","select"],setup(r,{emit:q}){const j=r,A=q,{t:y}=Ve();function B(S){return j.mode==="edit"&&j.editingSessionId===S.id?"theme-card-selected":j.isSessionRunning(S.id)?"theme-card-warning":"theme-card-idle-strong"}function D(S){return j.isCurrentSession(S.id)?y("projectManager.current"):y("projectManager.regular")}function p(S){return j.isCurrentSession(S.id)?"theme-status-info":"theme-status-neutral"}return(S,E)=>(c(),g("div",{class:O(r.mobile?"flex h-full min-h-0 flex-col":"")},[n("div",Ms,[n("div",null,[n("div",js,d(i(y)("projectManager.projectList")),1),r.hasSessions?M("",!0):(c(),g("p",Is,d(i(y)("projectManager.noProjects")),1))]),n("button",{type:"button",class:"tool-button tool-button-primary inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:r.busy,onClick:E[0]||(E[0]=o=>A("create"))},[I(i(Vt),{class:"h-4 w-4"}),n("span",null,d(i(y)("projectManager.create")),1)],8,Es)]),n("div",{class:O(["mt-4 space-y-2",r.mobile?"min-h-0 flex-1 overflow-y-auto":"max-h-52 overflow-y-auto pr-1 sm:max-h-64 lg:max-h-[calc(88vh-11rem)]"])},[(c(!0),g(he,null,Se(r.sessions,o=>{var b;return c(),g("article",{key:o.id,class:O(["relative cursor-pointer rounded-sm border p-3 transition",B(o)]),onClick:P=>A("select",o.id)},[r.mode==="edit"&&r.editingSessionId===o.id?(c(),g("span",As)):M("",!0),n("div",Ds,[n("div",Rs,[n("span",{class:"block truncate",title:o.title||i(y)("projectManager.untitledProject")},d(o.title||i(y)("projectManager.untitledProject")),9,Ts)]),n("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:o.cwd},d(o.cwd),9,Ls),n("div",Bs,[n("span",null,d(((b=o==null?void 0:o.agentBindings)==null?void 0:b.length)>1?i(y)("projectManager.agentCount",{count:o.agentBindings.length}):i(tt)(o.engine)),1),r.mobile?M("",!0):(c(),g("span",Fs,"·")),r.mobile?M("",!0):(c(),g("span",Ns,d(r.formatUpdatedAt(o.updatedAt)),1))]),n("div",Os,[n("span",{class:O(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",p(o)])},d(D(o)),3),n("span",{class:O(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",r.getRuntimeStatusClass(o.id)])},[r.isSessionRunning(o.id)?(c(),g("span",Us)):M("",!0),yt(" "+d(r.getRuntimeStatusLabel(o.id)),1)],2),n("span",{class:O(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",r.getThreadStatusClass(o)])},d(r.getThreadStatusLabel(o)),3)])])],10,Ps)}),128))],2)],2))}},Hs={class:"space-y-3"},zs={class:"dashed-panel px-3 py-3"},Ks={class:"theme-muted-text text-[11px]"},qs={class:"mt-2 flex flex-wrap gap-2"},Vs={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Ws={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},Qs={class:"dashed-panel px-3 py-3"},Gs={class:"theme-muted-text text-[11px]"},Xs={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Js={key:0,class:"mt-2 flex flex-wrap gap-1.5"},Ys={class:"dashed-panel px-3 py-3"},Zs={class:"theme-muted-text text-[11px]"},ea={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},ta={class:"dashed-panel px-3 py-3"},na={class:"theme-muted-text text-[11px]"},sa={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},aa={class:"dashed-panel px-3 py-3"},ia={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},la={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},oa={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:r=>r},getRuntimeStatusClass:{type:Function,default:()=>""},getRuntimeStatusLabel:{type:Function,default:()=>""},getThreadStatusClass:{type:Function,default:()=>""},getThreadStatusLabel:{type:Function,default:()=>""},isCurrentSession:{type:Function,default:()=>!1},isSessionRunning:{type:Function,default:()=>!1}},setup(r){const{t:q}=Ve();return(j,A)=>{var y,B,D,p,S,E,o,b,P;return c(),g("div",Hs,[n("div",zs,[n("div",Ks,d(i(q)("projectManager.runtimeStatus")),1),n("div",qs,[n("span",{class:O(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",r.getRuntimeStatusClass((y=r.activeSession)==null?void 0:y.id)])},[r.isSessionRunning((B=r.activeSession)==null?void 0:B.id)?(c(),g("span",Vs)):M("",!0),yt(" "+d(r.getRuntimeStatusLabel((D=r.activeSession)==null?void 0:D.id)),1)],2),n("span",{class:O(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",r.getThreadStatusClass(r.activeSession)])},d(r.getThreadStatusLabel(r.activeSession)),3),(p=r.activeSession)!=null&&p.id&&r.isCurrentSession(r.activeSession.id)?(c(),g("span",Ws,d(i(q)("projectManager.currentProject")),1)):M("",!0)])]),n("div",Qs,[n("div",Gs,d(i(q)("projectManager.engine")),1),n("div",Xs,d(i(tt)((S=r.activeSession)==null?void 0:S.engine)),1),((o=(E=r.activeSession)==null?void 0:E.agentBindings)==null?void 0:o.length)>1?(c(),g("div",Js,[(c(!0),g(he,null,Se(r.activeSession.agentBindings,u=>(c(),g("span",{key:u.engine,class:"theme-status-neutral inline-flex items-center rounded-sm border border-solid px-1.5 py-0.5 text-[10px]"},d(i(tt)(u.engine)),1))),128))])):M("",!0)]),n("div",Ys,[n("div",Zs,d(i(q)("projectManager.workingDirectory")),1),n("div",ea,d(((b=r.activeSession)==null?void 0:b.cwd)||i(q)("projectManager.notSet")),1)]),n("div",ta,[n("div",na,d(i(q)("projectManager.updatedAt")),1),n("div",sa,d(r.formatUpdatedAt((P=r.activeSession)==null?void 0:P.updatedAt)),1)]),n("div",aa,[n("div",ia,[I(i(Wt),{class:"h-3.5 w-3.5"}),n("span",null,d(i(q)("projectManager.note")),1)]),n("p",la,d(i(q)("projectManager.noteDescription")),1)])])}}},ra={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},da={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},ua={class:"theme-divider theme-muted-panel border-b px-3 py-3 sm:px-4 sm:py-4 lg:border-b-0 lg:border-r"},ca={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},fa={class:"flex flex-wrap items-start justify-between gap-3"},pa={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ga={class:"mt-5"},va={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},ma={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4 sm:flex-row sm:items-center sm:justify-between"},ha={class:"flex flex-wrap items-center gap-2"},ya=["disabled"],xa=["disabled"],ba=["disabled"],wa={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},Sa=["disabled"],ka=["disabled"],Ca=["disabled"],_a={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},$a={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ma={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},ja={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Ia={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},Ea=["disabled"],Pa={class:"min-w-0 flex-1"},Aa={class:"theme-heading truncate text-sm font-medium"},Da={key:0,class:"theme-muted-text mt-1 truncate text-xs"},Ra={class:"theme-divider border-b px-4 py-3"},Ta={class:"grid grid-cols-2 gap-2"},La=["disabled"],Ba={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Fa={key:0},Na={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Oa={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Ua=["disabled"],Ha=["disabled"],za=["disabled"],Ka=["disabled"],qa=3e3,Za={__name:"CodexSessionManagerDialog",props:{open:{type:Boolean,default:!1},sessions:{type:Array,default:()=>[]},workspaces:{type:Array,default:()=>[]},selectedSessionId:{type:String,default:""},selectionLocked:{type:Boolean,default:!1},selectionLockReason:{type:String,default:""},loading:{type:Boolean,default:!1},sending:{type:Boolean,default:!1},onRefresh:{type:Function,default:null},onCreate:{type:Function,default:null},onUpdate:{type:Function,default:null},onDelete:{type:Function,default:null},onReset:{type:Function,default:null}},emits:["close","project-created","select-session","open-source-browser"],setup(r,{expose:q,emit:j}){const A=new Map;function y(t="",a=""){const x=qe(t),k=et(a);return!x||!k?"":`${x}
|
|
2
2
|
${k}`}function B(t=""){if(!t)return null;const a=A.get(t);return a?a.expiresAt<=Date.now()?(A.delete(t),null):Array.isArray(a.items)?a.items:[]:null}function D(t="",a=[]){t&&A.set(t,{expiresAt:Date.now()+qa,items:Array.isArray(a)?a:[]})}const p=r,S=j,{locale:E,t:o}=Ve(),b=$("edit"),P=$(""),u=Ut({title:"",engine:"codex",agentEngines:[],cwd:"",sessionId:""}),_=$(""),de=$(!1),V=$(!1),U=$(!1),F=$(!1),H=$(!1),z=$(!1),G=$(!1),X=$(!1),{matches:R}=Pt("(max-width: 767px)"),Q=$("list"),Z=$("basic"),ge=$(ct()),ae=$([]),J=$(!1);let h=null,m=null,v=null,K=0;const ee=C(()=>Qe(p.sessions)),w=C(()=>p.sessions.find(t=>t.id===P.value)||null),ke=C(()=>p.sessions.length>0),Je=C(()=>p.sessions.find(t=>t.id===p.selectedSessionId)||null),ue=C(()=>!!(w.value&&te(w.value.id))),Ce=C(()=>{var t;return!((t=w.value)!=null&&t.started)}),_e=C(()=>{var t;return!((t=w.value)!=null&&t.started)}),ce=C(()=>{var t;return!((t=w.value)!=null&&t.started)}),T=C(()=>p.loading||de.value||V.value||U.value||F.value),Re=C(()=>String(u.sessionId||"").trim()),$e=C(()=>{var x,k;const t=new Set,a=[];return[u.cwd,(x=w.value)==null?void 0:x.cwd,(k=Je.value)==null?void 0:k.cwd,...p.workspaces,...p.sessions.map(N=>N.cwd)].forEach(N=>{const L=String(N||"").trim();!L||t.has(L)||(t.add(L),a.push(L))}),a.slice(0,12)}),fe=C(()=>ge.value),ye=C(()=>ae.value.map(t=>({...t,updatedAtLabel:t.updatedAt?Ee(t.updatedAt):""}))),xe=C(()=>{const t=et(u.cwd);return t?p.sessions.filter(a=>{var x;return a.id===((x=w.value)==null?void 0:x.id)?!1:et(a.cwd)===t}):[]}),Y=C(()=>{if(!xe.value.length)return"";const t=xe.value.slice(0,3).map(a=>{const x=a.title||o("projectManager.untitledProject");return E.value==="en-US"?`"${x}"`:`「${x}」`}).join(E.value==="en-US"?", ":"、");return o("projectManager.duplicateDirectory",{labels:t,count:xe.value.length})}),pe=C(()=>b.value!=="edit"||Ce.value?"":o("projectManager.cwdReadonly")),Te=C(()=>b.value!=="edit"||!w.value||_e.value?"":o("projectManager.engineReadonly")),be=C(()=>b.value!=="edit"||!w.value||ce.value?"":o("projectManager.sessionIdReadonly")),We=C(()=>b.value==="create"?de.value?o("projectManager.creatingProject"):o("projectManager.createProject"):V.value?o("projectManager.savingChanges"):o("projectManager.saveChanges")),Ye=C(()=>{var t;return b.value==="create"?o("projectManager.newProject"):((t=w.value)==null?void 0:t.title)||o("projectManager.untitledProject")});function Me(t=""){const a=Date.parse(String(t||""));return Number.isFinite(a)?a:0}function te(t){var a;return!!((a=p.sessions.find(x=>x.id===t))!=null&&a.running)}function ve(t){return!!t&&t===p.selectedSessionId}function Qe(t=[]){return[...t].sort((a,x)=>{const k=Number(te(x.id))-Number(te(a.id));if(k)return k;const N=Number(ve(x.id))-Number(ve(a.id));if(N)return N;const L=Me(x.updatedAt)-Me(a.updatedAt);return L||Tt(String(a.title||a.cwd||a.id),String(x.title||x.cwd||x.id))})}function Le(t){return te(t)?o("projectManager.running"):o("projectManager.idle")}function je(t){return te(t)?"theme-status-warning":"theme-status-success"}function Be(t){return t!=null&&t.started?o("projectManager.threadBound"):o("projectManager.notStarted")}function Ie(t){return t!=null&&t.started?"theme-status-success":"theme-status-neutral"}function Ee(t=""){if(!t)return o("projectManager.unknown");const a=new Date(t);return Number.isNaN(a.getTime())?t:Rt(a.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fe(t){u.title=String((t==null?void 0:t.title)||""),u.engine=qe(t==null?void 0:t.engine),u.agentEngines=(Array.isArray(t==null?void 0:t.agentBindings)?t.agentBindings:[]).map(a=>qe(a==null?void 0:a.engine)).filter(a=>a&&a!==u.engine),u.cwd=String((t==null?void 0:t.cwd)||""),u.sessionId=String((t==null?void 0:t.sessionId)||(t==null?void 0:t.engineSessionId)||(t==null?void 0:t.engineThreadId)||(t==null?void 0:t.codexThreadId)||"").trim()}function Pe(){b.value="create",P.value="",_.value="",u.title="",u.engine="codex",u.agentEngines=[],u.cwd="",u.sessionId=""}function ne(t){const a=p.sessions.find(x=>x.id===t);a&&(b.value="edit",P.value=a.id,_.value="",Fe(a))}function Ae(){var t;return p.selectedSessionId&&p.sessions.some(a=>a.id===p.selectedSessionId)?p.selectedSessionId:((t=ee.value[0])==null?void 0:t.id)||""}function Ne(t="basic"){Q.value="detail",Z.value=t}function Oe(){Q.value="list",Z.value="basic"}function Ue(){Pe(),R.value&&Ne("basic")}function He(t){T.value||(ne(t),R.value&&Ne("basic"))}function e(t){u.cwd=String(t||"").trim()}async function l(){var a,x;const t=((a=w.value)==null?void 0:a.id)||Ae();return!t||((!w.value||w.value.id!==t)&&(ne(t),await me()),!((x=w.value)!=null&&x.cwd))?!1:(R.value&&Ne("basic"),S("open-source-browser",w.value),S("close"),!0)}function s(){return H.value?(H.value=!1,!0):z.value?(z.value=!1,!0):G.value?(G.value=!1,!0):p.open?(S("close"),!0):!1}function f(t){u.title=String(t||"")}function W(t){u.engine=qe(t),u.agentEngines=u.agentEngines.filter(a=>a!==u.engine)}function se(t){u.agentEngines=[...new Set((Array.isArray(t)?t:[]).map(a=>qe(a)).filter(a=>a&&a!==u.engine))]}function we(t){u.cwd=String(t||"")}function ie(t){u.sessionId=String(t||"")}function le(t){u.sessionId=String((t==null?void 0:t.id)||"").trim()}function ze(){_.value="",H.value=!1,z.value=!1,X.value=!1,Z.value="basic",Q.value=R.value?"list":"detail";const t=Ae();if(t){ne(t);return}Pe()}async function xt(){if(!(T.value||typeof p.onRefresh!="function")){_.value="";try{await Promise.all([p.onRefresh(),it()])}catch(t){_.value=t.message}}}async function it(){try{ge.value=await At()}catch{ge.value=ct()}}function Ze(){m&&(clearTimeout(m),m=null)}function Ke(){v&&(v.abort(),v=null)}async function bt(){const t=String(u.cwd||"").trim();if(!p.open||!ce.value||!t){ae.value=[],J.value=!1,Ke();return}const a=++K;Ke();const x=y(u.engine,t),k=B(x);if(k){ae.value=k,J.value=!1;return}v=new AbortController,J.value=!0;try{const N=await Dt({engine:u.engine,cwd:t,limit:50,signal:v.signal});if(a!==K)return;const L=Array.isArray(N==null?void 0:N.items)?N.items:[];ae.value=L,D(x,L)}catch(N){if((N==null?void 0:N.name)==="AbortError")return;a===K&&(ae.value=[])}finally{a===K&&(J.value=!1,v=null)}}function lt(t=250){if(Ze(),!p.open||!ce.value||!String(u.cwd||"").trim()){ae.value=[],J.value=!1,Ke();return}m=setTimeout(()=>{m=null,bt().catch(()=>{})},t)}async function wt(t){var x;if((x=navigator.clipboard)!=null&&x.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const a=document.createElement("textarea");a.value=t,a.setAttribute("readonly","true"),a.style.position="fixed",a.style.opacity="0",a.style.pointerEvents="none",document.body.appendChild(a),a.select(),document.execCommand("copy"),document.body.removeChild(a)}async function ot(){const t=Re.value;if(t)try{await wt(t),X.value=!0,h&&clearTimeout(h),h=setTimeout(()=>{X.value=!1,h=null},1800)}catch(a){_.value=(a==null?void 0:a.message)||o("projectManager.copySessionIdFailed")}}async function rt(){if(!T.value){_.value="";try{const t=St();if(!t)return;await kt(t)}catch(t){_.value=t.message}}}function St(){if(b.value==="create"){const a=String(u.cwd||"").trim();return a?{type:"create",cwd:a,payload:{title:u.title,engine:u.engine,agentEngines:[u.engine,...u.agentEngines],cwd:a,sessionId:String(u.sessionId||"").trim()}}:(_.value=o("projectManager.directoryRequired"),null)}if(!w.value)return _.value=o("projectManager.projectMissing"),null;const t={title:u.title,engine:u.engine,agentEngines:[u.engine,...u.agentEngines]};return Ce.value&&(t.cwd=u.cwd),ce.value&&(t.sessionId=String(u.sessionId||"").trim()),{type:"update",sessionId:w.value.id,payload:t}}async function kt(t){var a,x;if(t.type==="create"){de.value=!0;try{const k=await((a=p.onCreate)==null?void 0:a.call(p,t.payload));k!=null&&k.id&&(ne(k.id),S("select-session",k.id),await me(),S("project-created",k),S("close"));return}finally{de.value=!1}}V.value=!0;try{const k=await((x=p.onUpdate)==null?void 0:x.call(p,t.sessionId,t.payload));k!=null&&k.id&&ne(k.id)}finally{V.value=!1}}async function Ct(){var a,x;if(!w.value||U.value)return;const t=w.value.id;_.value="",U.value=!0;try{const k=await((a=p.onDelete)==null?void 0:a.call(p,t));H.value=!1;const N=p.sessions.filter($t=>$t.id!==t),L=(k==null?void 0:k.selectedSessionId)||((x=Qe(N)[0])==null?void 0:x.id)||"";S("select-session",L),L?(ne(L),R.value&&Oe()):(Pe(),R.value&&Oe())}catch(k){_.value=k.message}finally{U.value=!1}}async function _t(){var a;if(!w.value||F.value)return;const t=w.value.id;_.value="",F.value=!0;try{const x=await((a=p.onReset)==null?void 0:a.call(p,t));z.value=!1;const k=(x==null?void 0:x.session)||p.sessions.find(N=>N.id===t)||null;k!=null&&k.id&&ne(k.id)}catch(x){_.value=x.message}finally{F.value=!1}}return oe(()=>p.open,t=>{if(t){ze(),typeof p.onRefresh=="function"?xt().catch(()=>{}):it().catch(()=>{});return}G.value=!1,H.value=!1,z.value=!1,X.value=!1,_.value="",Ze(),Ke(),ae.value=[],J.value=!1},{immediate:!0}),oe(R,t=>{t||(Q.value="detail")},{immediate:!0}),oe(()=>p.sessions,()=>{if(!p.open)return;if(b.value==="create"){if(!!(String(u.title||"").trim()||String(u.cwd||"").trim())||!!String(u.sessionId||"").trim())return;const x=Ae();x&&ne(x);return}if(w.value){Fe(w.value);return}const t=Ae();if(t){ne(t);return}Pe()}),oe(()=>[p.open,b.value,u.engine,u.cwd,ce.value].join(`
|
|
3
3
|
`),()=>{lt(250)},{immediate:!0}),oe(()=>{var t;return((t=w.value)==null?void 0:t.id)||""},()=>{lt(0)}),at(()=>{h&&(clearTimeout(h),h=null),Ze(),Ke()}),q({closeTopDialog:s}),(t,a)=>(c(),g(he,null,[I(ft,{open:z.value,title:i(o)("projectManager.confirmResetTitle"),description:w.value?i(o)("projectManager.confirmResetDescription",{title:w.value.title||i(o)("projectManager.untitledProject")}):"","confirm-text":i(o)("projectManager.confirmReset"),"cancel-text":i(o)("projectManager.keep"),loading:F.value,onCancel:a[0]||(a[0]=x=>z.value=!1),onConfirm:_t},null,8,["open","title","description","confirm-text","cancel-text","loading"]),I(ft,{open:H.value,title:i(o)("projectManager.confirmDeleteTitle"),description:w.value?i(o)("projectManager.confirmDeleteDescription",{title:w.value.title||i(o)("projectManager.untitledProject")}):"","confirm-text":i(o)("projectManager.confirmDelete"),"cancel-text":i(o)("projectManager.keep"),loading:U.value,danger:"",onCancel:a[1]||(a[1]=x=>H.value=!1),onConfirm:Ct},null,8,["open","title","description","confirm-text","cancel-text","loading"]),I(Rn,{open:G.value,"initial-path":u.cwd,suggestions:$e.value,onClose:a[2]||(a[2]=x=>G.value=!1),onSelect:e},null,8,["open","initial-path","suggestions"]),I(ht,{open:r.open,"panel-class":"settings-dialog-panel h-full max-w-5xl sm:h-auto sm:max-h-[88vh]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body flex min-h-0 flex-1 overflow-hidden","close-disabled":T.value,"close-on-backdrop":!T.value,"close-on-escape":!T.value,onClose:a[12]||(a[12]=x=>S("close"))},{title:De(()=>[n("div",ra,[I(i(Zt),{class:"h-4 w-4"}),n("span",null,d(i(o)("projectManager.managingTitle")),1)])]),default:De(()=>{var x,k,N;return[i(R)?(c(),g("div",_a,[Q.value==="list"?(c(),g("div",$a,[n("div",Ma,[I(mt,{mobile:"",busy:T.value,"editing-session-id":P.value,"format-updated-at":Ee,"get-runtime-status-class":je,"get-runtime-status-label":Le,"get-thread-status-class":Ie,"get-thread-status-label":Be,"has-sessions":ke.value,"is-current-session":ve,"is-session-running":te,mode:b.value,sessions:ee.value,onCreate:Ue,onSelect:He},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])])])):(c(),g("div",ja,[n("div",Ia,[n("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-3 py-2 text-xs",disabled:T.value,onClick:Oe},[I(i(Yt),{class:"h-4 w-4"}),n("span",null,d(i(o)("projectManager.projectList")),1)],8,Ea),n("div",Pa,[n("div",Aa,d(Ye.value),1),b.value==="edit"&&((k=w.value)!=null&&k.cwd)?(c(),g("p",Da,d(w.value.cwd),1)):M("",!0)])]),n("div",Ra,[n("div",Ta,[n("button",{type:"button",class:O(["tool-button px-3 py-2 text-sm",Z.value==="basic"?"tool-button-accent-subtle":""]),onClick:a[7]||(a[7]=L=>Z.value="basic")},d(i(o)("projectManager.basicInfo")),3),n("button",{type:"button",class:O(["tool-button px-3 py-2 text-sm",Z.value==="status"?"tool-button-accent-subtle":""]),disabled:b.value==="create",onClick:a[8]||(a[8]=L=>Z.value="status")},d(i(o)("projectManager.status")),11,La)])]),n("div",Ba,[Z.value==="basic"?(c(),g("div",Fa,[I(vt,{mobile:"",busy:T.value,"can-edit-engine":b.value!=="edit"||_e.value,"can-edit-cwd":b.value!=="edit"||Ce.value,"can-edit-session-id":b.value!=="edit"||ce.value,cwd:u.cwd,"cwd-readonly-message":pe.value,"duplicate-cwd-message":Y.value,engine:u.engine,"agent-engines":u.agentEngines,"engine-options":fe.value,"engine-readonly-message":Te.value,"session-candidates":ye.value,"session-candidates-loading":J.value,"session-id":u.sessionId,"session-id-copied":X.value,"session-id-readonly-message":be.value,title:u.title,"workspace-suggestions":$e.value,onCopySessionId:ot,onOpenDirectoryPicker:a[9]||(a[9]=L=>G.value=!0),onSelectSessionCandidate:le,"onUpdate:cwd":we,"onUpdate:engine":W,"onUpdate:agentEngines":se,"onUpdate:sessionId":ie,"onUpdate:title":f},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","agent-engines","engine-options","engine-readonly-message","session-candidates","session-candidates-loading","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"]),_.value?(c(),g("p",Na,[I(i(gt),{class:"h-4 w-4"}),n("span",null,d(_.value),1)])):M("",!0),n("div",Oa,[n("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-sm",disabled:T.value,onClick:rt},d(We.value),9,Ua),b.value==="edit"&&w.value?(c(),g("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:T.value||!((N=w.value)!=null&&N.cwd),onClick:l},d(i(o)("projectManager.viewSource")),9,Ha)):M("",!0),b.value==="edit"&&w.value?(c(),g("button",{key:1,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:T.value||ue.value,onClick:a[10]||(a[10]=L=>z.value=!0)},d(F.value?i(o)("projectManager.resettingSession"):i(o)("projectManager.newSession")),9,za)):M("",!0),b.value==="edit"&&w.value?(c(),g("button",{key:2,type:"button",class:"tool-button tool-button-danger-subtle w-full px-3 py-2 text-sm",disabled:T.value||ue.value,onClick:a[11]||(a[11]=L=>H.value=!0)},d(U.value?i(o)("projectManager.deletingProject"):i(o)("projectManager.deleteProject")),9,Ka)):M("",!0)])])):(c(),re(oa,{key:1,"active-session":w.value,"format-updated-at":Ee,"get-runtime-status-class":je,"get-runtime-status-label":Le,"get-thread-status-class":Ie,"get-thread-status-label":Be,"is-current-session":ve,"is-session-running":te},null,8,["active-session"]))])]))])):(c(),g("div",da,[n("aside",ua,[I(mt,{busy:T.value,"editing-session-id":P.value,"format-updated-at":Ee,"get-runtime-status-class":je,"get-runtime-status-label":Le,"get-thread-status-class":Ie,"get-thread-status-label":Be,"has-sessions":ke.value,"is-current-session":ve,"is-session-running":te,mode:b.value,sessions:ee.value,onCreate:Ue,onSelect:He},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])]),n("div",ca,[n("div",fa,[n("div",null,[n("div",pa,[I(i(Qt),{class:"h-4 w-4"}),n("span",null,d(b.value==="create"?i(o)("projectManager.createTitle"):i(o)("projectManager.editTitle")),1)])])]),n("div",ga,[I(vt,{busy:T.value,"can-edit-engine":b.value!=="edit"||_e.value,"can-edit-cwd":b.value!=="edit"||Ce.value,"can-edit-session-id":b.value!=="edit"||ce.value,cwd:u.cwd,"cwd-readonly-message":pe.value,"duplicate-cwd-message":Y.value,engine:u.engine,"agent-engines":u.agentEngines,"engine-options":fe.value,"engine-readonly-message":Te.value,"session-candidates":ye.value,"session-candidates-loading":J.value,"session-id":u.sessionId,"session-id-copied":X.value,"session-id-readonly-message":be.value,title:u.title,"workspace-suggestions":$e.value,onCopySessionId:ot,onOpenDirectoryPicker:a[3]||(a[3]=L=>G.value=!0),onSelectSessionCandidate:le,"onUpdate:cwd":we,"onUpdate:engine":W,"onUpdate:agentEngines":se,"onUpdate:sessionId":ie,"onUpdate:title":f},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","agent-engines","engine-options","engine-readonly-message","session-candidates","session-candidates-loading","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"])]),_.value?(c(),g("p",va,[I(i(gt),{class:"h-4 w-4"}),n("span",null,d(_.value),1)])):M("",!0),n("div",ma,[n("div",ha,[b.value==="edit"&&w.value?(c(),g("button",{key:0,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:T.value||!((x=w.value)!=null&&x.cwd),onClick:l},[I(i(Gt),{class:"h-4 w-4"}),n("span",null,d(i(o)("projectManager.viewSource")),1)],8,ya)):M("",!0),b.value==="edit"&&w.value?(c(),g("button",{key:1,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:T.value||ue.value,onClick:a[4]||(a[4]=L=>z.value=!0)},[I(i(Xt),{class:"h-4 w-4"}),n("span",null,d(F.value?i(o)("projectManager.resettingSession"):i(o)("projectManager.newSession")),1)],8,xa)):M("",!0),b.value==="edit"&&w.value?(c(),g("button",{key:2,type:"button",class:"tool-button tool-button-danger-subtle inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:T.value||ue.value,onClick:a[5]||(a[5]=L=>H.value=!0)},[I(i(Jt),{class:"h-4 w-4"}),n("span",null,d(U.value?i(o)("projectManager.deletingProject"):i(o)("projectManager.deleteProject")),1)],8,ba)):M("",!0)]),n("div",wa,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:T.value,onClick:a[6]||(a[6]=L=>S("close"))},d(i(o)("projectManager.close")),9,Sa),b.value==="create"&&ke.value?(c(),g("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:T.value,onClick:ze},d(i(o)("projectManager.backToList")),9,ka)):M("",!0),n("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-xs sm:w-auto",disabled:T.value,onClick:rt},d(We.value),9,Ca)])])])]))]}),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"])],64))}};export{Za as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{g as lt,t as A,f as Ze,u as Te,a as rt,b as ot}from"./index-Ca-xxeXy.js";import{u as ut,g as Ae,l as ct,a as dt,_ as ft,r as ht,e as mt,D as Me,b as vt,i as gt,c as pt,d as xt,f as kt}from"./WorkbenchView-CdD65SV0.js";import{w as K,c as E,b as B,n as et,aD as b,aE as R,aF as n,aR as he,aS as Le,aL as O,aQ as h,aG as j,u as s,aW as Be,aX as yt,aN as Y,ak as bt,aI as Pe,aJ as xe,f as wt,a$ as We}from"./vendor-misc-u-M8sNMf.js";import{c as St,k as Ge,C as Ee,R as Ke,b as Rt,i as Ft,h as tt,F as Je,z as Qe}from"./vendor-ui-BwEQCho1.js";import"./vendor-router-Dn8q3tJM.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";function re(e,l,r=""){const p=l==="run"?"run":l==="task"?"task":"workspace";return[String(e||"").trim(),p,String(r||"").trim()].join("::")}function je(e="",l=""){return`${String(e||"").trim()}::${String(l||"").trim()}`}function Ct(e=""){return`${String(e||"").trim()}::`}function st(e){if(!e||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function ge(e,l){const r=e.get(l);return r?(e.delete(l),e.set(l,r),st(r)):null}function pe(e,l,r,p=0){for(e.delete(l),e.set(l,st(r));p>0&&e.size>p;){const x=e.keys().next().value;if(typeof x>"u")break;e.delete(x)}}function fe(e=""){const l=String(e||"").trim().toUpperCase();return l==="A"||l==="D"?l:"M"}function Lt(e=""){const l=String(e||"");if(!l)return[];const r=l.split(`
|
|
2
|
+
`),p=[];let x=0,H=0;return r.forEach((f,u)=>{const T=f.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(T){x=Number(T[1]),H=Number(T[2]),p.push({id:`hunk-${u}`,kind:"hunk",oldNumber:"",newNumber:"",content:f});return}if(f.startsWith("+")&&!f.startsWith("+++")){p.push({id:`line-${u}`,kind:"add",oldNumber:"",newNumber:H,content:f}),H+=1;return}if(f.startsWith("-")&&!f.startsWith("---")){p.push({id:`line-${u}`,kind:"delete",oldNumber:x,newNumber:"",content:f}),x+=1;return}if(f.startsWith(" ")){p.push({id:`line-${u}`,kind:"context",oldNumber:x,newNumber:H,content:f}),x+=1,H+=1;return}p.push({id:`line-${u}`,kind:"meta",oldNumber:"",newNumber:"",content:f})}),p}function Pt(e=""){const l=String(e||"").trim();if(!l)return"";const r=l.match(/^当前分支已从 (.+) 切换到 (.+)$/);return r?A("diffReview.warningBranchChanged",{from:r[1],to:r[2]}):l==="当前 HEAD 已不在基线 commit 的后续历史中,仓库可能经历了 reset、rebase 或切分支"?A("diffReview.warningHeadDetachedFromBaseline"):l}function $e(e=""){const l=String(e||"").trim();if(!l)return"";const p=new Map([["二进制文件暂不支持在线 diff 预览。","diffReview.binaryPreviewUnavailable"],["文件内容较大,暂不展示具体 diff。","diffReview.fileTooLarge"],["diff 内容较长,暂不在页面内完整展示。","diffReview.diffTooLong"],["diff 内容较长,当前仅展示摘要预览。","diffReview.diffPreviewOnly"],["当前工作目录不是 Git 仓库,暂不支持代码变更审查。","diffReview.notGitRepo"],["任务不存在。","diffReview.taskNotFound"],["请选择一轮执行后再查看本轮代码变更。","diffReview.runRequired"],["没有找到对应的执行记录。","diffReview.runNotFound"],["这轮执行还没有建立代码变更基线,暂时无法查看本轮 diff。","diffReview.runBaselineMissing"],["当前任务还没有建立代码变更基线,请先让 Codex 执行一轮。","diffReview.taskBaselineMissing"],["这轮执行缺少结束快照,暂时无法准确还原本轮代码变更。","diffReview.runSnapshotMissing"],["原工作目录已不是有效的 Git 仓库,暂时无法读取代码变更。","diffReview.originalRepoInvalid"],["基线对应的 commit 已不存在,仓库可能被 reset、rebase 或切换到无关历史,暂时无法准确读取该范围的代码变更。","diffReview.baselineCommitMissing"]]).get(l);return p?A(p):/^git diff 计算超时(>\d+ms)[。.]?$/.test(l)||l==="该文件 diff 计算超时,暂不在线展示详细内容。"?A("diffReview.fileDiffTimedOut"):l}function Ne(e=null){return!e||typeof e!="object"?e:{...e,reason:$e(e.reason),warnings:Array.isArray(e.warnings)?e.warnings.map(l=>Pt(l)).filter(Boolean):[],files:Array.isArray(e.files)?e.files.map(l=>({...l,message:$e(l==null?void 0:l.message)})):[]}}function $t(e=[],l="",r=0){const p=Math.max(0,Number(r)||0);if(!p)return[];const x=String(l||"").trim(),H=Array.isArray(e)?e:[],f=[],u=new Set;return x&&H.find($=>String(($==null?void 0:$.path)||"").trim()===x)&&(f.push(x),u.add(x)),H.forEach(T=>{const $=String((T==null?void 0:T.path)||"").trim();!$||u.has($)||f.length>=p||(f.push($),u.add($))}),f}function Tt(e){const l=B("workspace"),r=B(""),p=B(""),x=B("all"),H=B(""),f=B([]),u=B(null),T=B(!1),$=B(!1),te=B(""),se=B(!1),J=B(null),U=B(0),W=new Map,ae=ut();let w=0,S=0,g="",F="",G="",X=-1;const ne=new Map,q=new Map,N=new Map,ie=new Map,le=12e3,oe=3,a=E(()=>f.value.filter(t=>t.completed)),o=E(()=>{var i;const t={all:0,A:0,M:0,D:0};return(((i=u.value)==null?void 0:i.files)||[]).forEach(d=>{const v=fe(d==null?void 0:d.status);t.all+=1,t[v]+=1}),t}),m=E(()=>{var d;const t=((d=u.value)==null?void 0:d.files)||[],i=String(H.value||"").trim().toLowerCase();return t.filter(v=>x.value!=="all"&&fe(v==null?void 0:v.status)!==x.value?!1:i?String((v==null?void 0:v.path)||"").toLowerCase().includes(i):!0)}),_=E(()=>{const t=m.value;return t.find(i=>i.path===p.value)||t[0]||null}),C=E(()=>{var t;return Lt(((t=_.value)==null?void 0:t.patch)||"")}),V=E(()=>C.value.map((t,i)=>({...t,index:i})).filter(t=>t.kind==="hunk")),c=E(()=>$t(m.value,p.value,oe)),D=E(()=>{var t,i;return $.value&&!((i=(t=u.value)==null?void 0:t.summary)!=null&&i.statsComplete)}),L=E(()=>{var d;const t=((d=u.value)==null?void 0:d.baseline)||null;if(!(t!=null&&t.createdAt)&&!(t!=null&&t.headShort))return"";const i=[];return t.createdAt&&i.push(A("diffReview.baselineTime",{value:Ze(t.createdAt)})),t.branch&&i.push(A("diffReview.baselineBranch",{value:t.branch})),t.headShort&&i.push(A("diffReview.baselineCommit",{value:t.headShort})),t.currentHeadShort&&i.push(A("diffReview.currentHead",{value:t.currentHeadShort})),i.join(" · ")});function ue(t){return(t==null?void 0:t.status)==="completed"?A("diffReview.completed"):(t==null?void 0:t.status)==="error"?A("diffReview.failed"):(t==null?void 0:t.status)==="interrupted"?A("diffReview.interrupted"):A("diffReview.stopped")}function ce(t,i){if(t){if(i){W.set(t,i);return}W.delete(t)}}function Z(t,i={}){const d=V.value;if(!d.length)return;const v=Math.min(Math.max(0,Number(t)||0),d.length-1),M=d[v],I=W.get(M.id);I&&(U.value=v,I.scrollIntoView({block:i.block||"center",behavior:i.behavior||"smooth"}))}function k(t=1){V.value.length&&Z(U.value+t)}function ke(t){return`${new Date((t==null?void 0:t.startedAt)||(t==null?void 0:t.createdAt)).toLocaleString(lt())} · ${ue(t)}`}function ye(){const t=a.value;if(!t.length){r.value="";return}t.some(i=>i.id===r.value)||(r.value=t[0].id)}function de(){const t=m.value;if(!t.length){p.value="";return}t.some(i=>i.path===p.value)||(p.value=t[0].path)}function be(t=""){return fe(t)==="A"?A("diffReview.added"):fe(t)==="D"?A("diffReview.deleted"):A("diffReview.modified")}function we(t=""){return fe(t)==="A"?"theme-status-success":fe(t)==="D"?"theme-status-danger":"theme-status-warning"}function y(t="all"){return t==="A"?A("diffReview.added"):t==="D"?A("diffReview.deleted"):t==="M"?A("diffReview.modified"):A("diffReview.all")}function Se(t="all"){return x.value===t?"theme-filter-active":"theme-filter-idle"}function _e(t="context"){return t==="add"?"theme-patch-add":t==="delete"?"theme-patch-delete":t==="hunk"?"theme-patch-hunk":t==="meta"?"theme-patch-meta":"theme-patch-context"}function De(t,i=""){const d=String(i||"").trim();d&&Array.from(t.keys()).forEach(v=>{String(v||"").startsWith(d)&&t.delete(v)})}function at(){const t=Ct(e.taskSlug);De(ne,t),De(q,t),De(N,t)}function Ve(){const t=l.value==="run"?"run":l.value==="task"?"task":"workspace",i=t==="run"?r.value:"",d=re(e.taskSlug,t,i);return{scope:t,runId:i,signature:d}}function Oe(t=""){var d;const i=String(t||"").trim();return i&&(((d=u.value)==null?void 0:d.files)||[]).find(v=>v.path===i)||null}function Ue(t=null){return!!t&&!t.patchLoaded&&!t.binary&&!t.tooLarge&&!t.message}function me(t="",i="",d=null,v=null){var I;const M=re(e.taskSlug,l.value,l.value==="run"?r.value:"");return t!==M||!d||!((I=u.value)!=null&&I.files)?!1:(u.value={...u.value,baseline:(v==null?void 0:v.baseline)||u.value.baseline||null,warnings:(v==null?void 0:v.warnings)||u.value.warnings||[],files:u.value.files.map(P=>P.path===i?d:P)},!0)}async function qe(t="",i={}){const d=String(t||"").trim(),v=String(i.signature||"").trim();if(!d||!v)return null;const M=je(v,d),I=ge(N,M);if(I)return{detailedFile:I,normalizedPayload:null};const P=ie.get(M);if(P)return P;const Q=(async()=>{try{const z=await Ae(e.taskSlug,{scope:i.scope,runId:i.runId,filePath:d,timeoutMs:le}),ee=Ne(z),ve=(ee.files||[]).find(Ce=>Ce.path===d);if(!ve)throw new Error(A("diffReview.noFileDiffContent"));return pe(N,M,ve,120),{detailedFile:ve,normalizedPayload:ee}}catch(z){return{error:z}}finally{ie.delete(M)}})();return ie.set(M,Q),Q}async function Ie(){var i,d;if(!e.taskSlug||!e.active||!((i=u.value)!=null&&i.supported))return;const t=Ve();for(const v of c.value){const M=Oe(v);if(!Ue(M))continue;const I=re(e.taskSlug,l.value,l.value==="run"?r.value:"");if(t.signature!==I)return;const P=await qe(v,t);if(P){if(P.error){const Q=$e(((d=P.error)==null?void 0:d.message)||"")||A("diffReview.fileDiffTimedOut"),z={...M,patch:"",patchLoaded:!0,tooLarge:!0,message:Q};pe(N,je(t.signature,v),z,120),me(t.signature,v,z,null);continue}me(t.signature,v,P.detailedFile,P.normalizedPayload)}}}async function nt(){if(!e.taskSlug){f.value=[],r.value="",G="",X=-1;return}const t=ae.getTaskRunSyncVersion(e.taskSlug);if(G===e.taskSlug&&X===t)return;const i=await ct(e.taskSlug,{limit:20,events:"none"});f.value=i.items||[],G=e.taskSlug,X=t,ye()}async function He(){if(!e.taskSlug||!e.active)return;const t=++w;T.value=!0,$.value=!1,te.value="";try{const i=l.value==="run"?"run":l.value==="task"?"task":"workspace";i==="run"&&await nt();const d=re(e.taskSlug,i,i==="run"?r.value:"");if(i==="run"&&!r.value){u.value={supported:!1,reason:A("diffReview.noReviewRuns"),repoRoot:"",summary:{fileCount:0,additions:0,deletions:0,statsComplete:!0},files:[]},de();return}const v=ge(ne,d);if(v){u.value=v,g=d;const P=ge(q,d);P?(u.value={...v,baseline:P.baseline||v.baseline||null,warnings:P.warnings||v.warnings||[],summary:P.summary||v.summary},F=d):F="",de(),Re().catch(()=>{}),Ie().catch(()=>{}),P||ze().catch(()=>{});return}const M=await Ae(e.taskSlug,{scope:i,runId:i==="run"?r.value:"",includeStats:!1});if(t!==w)return;const I=Ne(M);u.value=I,pe(ne,d,I,36),g=d,F="",de(),Re().catch(()=>{}),Ie().catch(()=>{}),ze().catch(()=>{})}catch(i){if(t!==w)return;te.value=i.message,u.value=null}finally{t===w&&(T.value=!1)}}async function ze(){var M,I,P;if(!e.taskSlug||!e.active||!((M=u.value)!=null&&M.supported))return;const t=l.value==="run"?"run":l.value==="task"?"task":"workspace",i=t==="run"?r.value:"",d=re(e.taskSlug,t,i);if(F===d&&((P=(I=u.value)==null?void 0:I.summary)!=null&&P.statsComplete))return;const v=ge(q,d);if(v){u.value={...u.value,baseline:v.baseline||u.value.baseline||null,warnings:v.warnings||u.value.warnings||[],summary:v.summary||u.value.summary},F=d,$.value=!1;return}$.value=!0;try{const Q=await Ae(e.taskSlug,{scope:t,runId:i,includeFiles:!1,includeStats:!0}),z=re(e.taskSlug,l.value,l.value==="run"?r.value:"");if(d!==z||!u.value)return;const ee=Ne(Q);u.value={...u.value,baseline:ee.baseline||u.value.baseline||null,warnings:ee.warnings||u.value.warnings||[],summary:ee.summary||u.value.summary},pe(q,d,{baseline:ee.baseline||null,warnings:ee.warnings||[],summary:ee.summary||null},36),F=d}catch{}finally{const Q=re(e.taskSlug,l.value,l.value==="run"?r.value:"");d===Q&&($.value=!1)}}async function Re(){var P,Q;const t=String(p.value||"").trim();if(!e.taskSlug||!e.active||!t)return;const i=Ve(),d=Oe(t);if(!Ue(d))return;const v=je(i.signature,t),M=ge(N,v);if(M&&((P=u.value)!=null&&P.files)){me(i.signature,t,M,null);return}const I=++S;se.value=!0;try{const z=await qe(t,i);if(I!==S||!z)return;const ee=re(e.taskSlug,l.value,l.value==="run"?r.value:"");if(i.signature!==ee)return;if(z.error){const ve=$e(((Q=z.error)==null?void 0:Q.message)||"")||A("diffReview.fileDiffTimedOut"),Ce={...d,patch:"",patchLoaded:!0,tooLarge:!0,message:ve};pe(N,v,Ce,120),me(i.signature,t,Ce,null);return}me(i.signature,t,z.detailedFile,z.normalizedPayload)}finally{I===S&&(se.value=!1,String(p.value||"").trim()!==t&&Re().catch(()=>{}))}}function Fe({force:t=!1}={}){if(!e.taskSlug||!e.active)return;const i=re(e.taskSlug,l.value,l.value==="run"?r.value:"");!t&&i===g||He().catch(()=>{})}async function it(){!e.taskSlug||!e.active||T.value||(at(),g="",F="",G="",X=-1,await He())}return K(()=>[e.taskSlug,e.active,l.value,r.value],([t,i],d=[])=>{const v=d[0]||"";t!==v&&(p.value="",g="",f.value=[],r.value="",G="",X=-1,F=""),!(!t||!i)&&Fe()},{immediate:!0}),K(()=>{var t,i;return[x.value,((i=(t=u.value)==null?void 0:t.files)==null?void 0:i.length)||0]},()=>{de()}),K(()=>[p.value,V.value.length],()=>{U.value=0,W.clear(),et(()=>{var t,i;V.value.length?Z(0,{behavior:"auto",block:"start"}):(i=(t=J.value)==null?void 0:t.scrollTo)==null||i.call(t,{top:0,behavior:"auto"})})}),K(()=>p.value,()=>{Re().catch(()=>{})},{immediate:!0}),K(()=>{var t;return[e.active,(t=u.value)==null?void 0:t.supported,c.value.join(`
|
|
3
|
+
`)]},([t,i])=>{!t||!i||Ie().catch(()=>{})}),K(()=>[e.preferredScope,e.preferredRunId,e.focusToken],([t,i,d],v=[])=>{const M=Number(v[2]||0),I=t==="run"?"run":t==="task"?"task":"workspace",P=I==="run"&&i?String(i||""):"",Q=l.value!==I,z=I==="run"&&P&&r.value!==P;l.value=I,P&&(r.value=P),I!=="run"&&(r.value=""),!Q&&!z&&e.active&&e.taskSlug&&d!==M&&(g="",Fe())},{immediate:!0}),K(()=>ae.readyVersion.value,()=>{!e.active||!e.taskSlug||(G="",X=-1,g="",F="",Fe({force:!0}))}),K(()=>ae.getTaskDiffSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||(G="",X=-1,F="",g="",Fe({force:!0}))}),{activeHunkIndex:U,baselineMetaText:L,diffPayload:u,diffScope:l,error:te,fileSearch:H,filteredFiles:m,getFilterButtonClass:Se,getFilterLabel:y,getPatchLineClass:_e,getRunStatusLabel:ue,getStatusClass:we,getStatusLabel:be,jumpToAdjacentHunk:k,loadDiff:He,loading:T,normalizeFileStatus:fe,patchLoading:se,patchViewportRef:J,runs:f,selectedFile:_,selectedFilePath:p,selectedPatchHunks:V,selectedPatchLines:C,selectedRunId:r,setPatchLineRef:ce,showSummarySkeleton:D,statsLoading:$,statusCounts:o,statusFilter:x,terminalRuns:a,formatRunOptionLabel:ke,refreshDiff:it}}const _t={class:"mb-3 grid grid-cols-2 gap-2"},Dt=["onClick"],It={class:"theme-input-shell mb-3 flex items-center gap-2 rounded-sm border px-3 py-2 text-xs text-[var(--theme-textMuted)]"},Ht=["placeholder"],At={key:0,class:"theme-empty-state theme-empty-state-strong mb-3 px-3 py-2 text-[11px]"},Mt={key:1,class:"theme-empty-state px-3 py-4 text-xs"},jt={key:2,class:"theme-empty-state px-3 py-4 text-xs"},Nt={key:3,class:"space-y-1"},Bt=["onClick","onKeydown"],Vt={class:"min-w-0 flex-1"},Ot={class:"theme-list-item-title break-all"},Ut={class:"theme-list-item-meta mt-1"},Xe={__name:"TaskDiffFileList",props:{diffPayload:{type:Object,default:null},fileSearch:{type:String,default:""},autoFocusSelected:{type:Boolean,default:!1},filteredFiles:{type:Array,default:()=>[]},focusToken:{type:Number,default:0},getFilterButtonClass:{type:Function,default:()=>""},getFilterLabel:{type:Function,default:e=>e},getStatusClass:{type:Function,default:()=>""},getStatusLabel:{type:Function,default:e=>e},selectedFilePath:{type:String,default:""},showSummarySkeleton:{type:Boolean,default:!1},statusCounts:{type:Object,default:()=>({})},statusFilter:{type:String,default:"all"}},emits:["select-file","update:fileSearch","update:statusFilter"],setup(e,{emit:l}){const r=e,p=l,{t:x}=Te(),H=new Map,f=B(0),u=B(0),T=E({get:()=>r.fileSearch,set:w=>p("update:fileSearch",w)}),$=E({get:()=>r.statusFilter,set:w=>p("update:statusFilter",w)}),te=E(()=>{var w;return Array.isArray((w=r.diffPayload)==null?void 0:w.files)&&r.diffPayload.files.length>0});function se(w,S){if(S){H.set(w,S);return}H.delete(w)}function J(w){et(()=>{var g,F;const S=H.get(w);(g=S==null?void 0:S.focus)==null||g.call(S),(F=S==null?void 0:S.scrollIntoView)==null||F.call(S,{block:"nearest",inline:"nearest"})})}function U(){!r.autoFocusSelected||!r.selectedFilePath||f.value===u.value||(u.value=f.value,J(r.selectedFilePath))}function W(w=1,S=""){const g=Array.isArray(r.filteredFiles)?r.filteredFiles:[];if(!g.length)return;const F=g.findIndex(N=>N.path===S),G=g.findIndex(N=>N.path===r.selectedFilePath),ne=(Math.max(0,F>=0?F:G)+w+g.length)%g.length,q=g[ne];q!=null&&q.path&&(p("select-file",q.path),J(q.path))}function ae(w,S){const g=String((w==null?void 0:w.key)||"");if(g==="ArrowDown"){w.preventDefault(),W(1,S);return}if(g==="ArrowUp"){w.preventDefault(),W(-1,S);return}(g==="Enter"||g===" ")&&S&&(w.preventDefault(),p("select-file",S))}return K(()=>r.focusToken,w=>{f.value=w,U()},{immediate:!0}),K(()=>r.selectedFilePath,()=>{U()}),(w,S)=>(b(),R(he,null,[n("div",_t,[(b(),R(he,null,Le(["all","A","M","D"],g=>n("button",{key:g,type:"button",class:O(["inline-flex w-full items-center justify-center gap-1 whitespace-nowrap rounded-sm border px-2 py-1 text-[11px] transition",e.getFilterButtonClass(g)]),onClick:F=>$.value=g},h(e.getFilterLabel(g))+" "+h(e.statusCounts[g]||0),11,Dt)),64))]),n("label",It,[j(s(St),{class:"h-3.5 w-3.5 shrink-0"}),Be(n("input",{"onUpdate:modelValue":S[0]||(S[0]=g=>T.value=g),type:"text",placeholder:s(x)("diffReview.searchFilePath"),class:"min-w-0 flex-1 bg-transparent text-xs text-[var(--theme-textPrimary)] outline-none placeholder:text-[var(--theme-textMuted)]"},null,8,Ht),[[yt,T.value]])]),e.showSummarySkeleton?(b(),R("div",At,h(s(x)("diffReview.statsPending")),1)):Y("",!0),te.value?e.filteredFiles.length?(b(),R("div",Nt,[(b(!0),R(he,null,Le(e.filteredFiles,g=>(b(),R("button",{key:g.path,ref_for:!0,ref:F=>se(g.path,F),type:"button",class:O(["theme-list-row focus:outline-none",g.path===e.selectedFilePath?"theme-list-item-active":"theme-list-item-hover"]),onClick:F=>p("select-file",g.path),onKeydown:F=>ae(F,g.path)},[n("span",{class:O(["theme-list-item-badge",e.getStatusClass(g.status)])},h(e.getStatusLabel(g.status)),3),n("div",Vt,[n("div",Ot,h(g.path),1),n("div",Ut,h(g.statsLoaded?`+${g.additions} / -${g.deletions}`:s(x)("diffReview.statsOnDemand")),1)])],42,Bt))),128))])):(b(),R("div",jt,h(s(x)("diffReview.noMatches")),1)):(b(),R("div",Mt,h(s(x)("diffReview.noChanges")),1))],64))}},qt={key:0,class:"flex h-full min-h-0 flex-col overflow-hidden"},zt={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-[12px]"},Wt={class:"space-y-3 sm:hidden"},Gt={class:"flex items-start gap-2"},Et={class:"min-w-0 break-all font-medium text-[var(--theme-textPrimary)]"},Kt={class:"flex items-center justify-between gap-3"},Jt={class:"min-w-0"},Qt={class:"opacity-75"},Xt={class:"theme-muted-text mt-1 text-[11px]"},Yt=["disabled"],Zt={class:"min-w-[64px] text-center text-[12px] text-[var(--theme-textSecondary)]"},es=["disabled"],ts={class:"hidden items-center gap-3 sm:flex"},ss={class:"flex min-w-0 flex-1 flex-wrap items-center gap-2"},as={class:"break-all font-medium text-[var(--theme-textPrimary)]"},ns={class:"opacity-75"},is={class:"theme-muted-text text-[11px]"},ls=["disabled"],rs={class:"min-w-[64px] text-center text-[12px] text-[var(--theme-textSecondary)]"},os=["disabled"],us={key:0,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},cs={class:"theme-empty-state px-4 py-4"},ds={key:1,class:"theme-muted-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},fs={class:"task-diff-view min-w-max px-4 py-4 font-mono"},hs={key:0,class:"theme-inline-panel theme-secondary-text mb-3 rounded-sm border border-dashed px-3 py-2 text-[12px]"},ms=["data-line-id","data-line-kind"],vs={class:"task-diff-row__number select-none"},gs={class:"task-diff-row__number select-none"},ps=["innerHTML"],xs={key:3,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},ks={class:"theme-empty-state px-4 py-4"},ys={key:1,class:"theme-muted-text flex h-full items-center justify-center px-5 text-[12px]"},bs={__name:"TaskDiffPatchView",props:{activeHunkIndex:{type:Number,default:0},getPatchLineClass:{type:Function,default:()=>""},getStatusClass:{type:Function,default:()=>""},getStatusLabel:{type:Function,default:e=>e},jumpToAdjacentHunk:{type:Function,default:()=>{}},patchLoading:{type:Boolean,default:!1},selectedFile:{type:Object,default:null},selectedPatchHunks:{type:Array,default:()=>[]},selectedPatchLines:{type:Array,default:()=>[]},setPatchLineRef:{type:Function,default:()=>{}},setPatchViewportRef:{type:Function,default:()=>{}}},emits:["insert-code-context"],setup(e,{emit:l}){const r=e,p=l,{t:x}=Te(),{isDark:H}=ot(),f=B([]),u=E(()=>{var a;return gt(((a=r.selectedFile)==null?void 0:a.path)||"")}),T=B(null),$=new Map;function te(a={}){return["add","delete","context"].includes(String((a==null?void 0:a.kind)||"").trim())}function se(a=""){const o=String(a||"").trim();return o&&f.value.find(m=>m.id===o)||null}const{selectedRows:J,selectionAction:U,clearSelectionState:W,handleSelectionMouseUp:ae,updateSelectionActionFromDom:w}=dt({getContainer:()=>T.value,isActive:()=>!!(r.selectedFile&&r.selectedPatchLines.length),rowSelector:".task-diff-row[data-line-id]",getOrderedRowElements:a=>[...a.querySelectorAll(".task-diff-row[data-line-id]")].filter(o=>te(se(o.getAttribute("data-line-id")))),mapRowElement:a=>{var o;return se(((o=a==null?void 0:a.getAttribute)==null?void 0:o.call(a,"data-line-id"))||"")},getCodeLeft:a=>{var V,c,D;const o=(V=a==null?void 0:a.querySelector)==null?void 0:V.call(a,".task-diff-line");if(!o)return 0;const m=(c=o.getBoundingClientRect)==null?void 0:c.call(o),_=(D=window.getComputedStyle)==null?void 0:D.call(window,o),C=Number.parseFloat((_==null?void 0:_.paddingLeft)||"0")||0;return((m==null?void 0:m.left)||0)+C},debounceMs:72});function S(a=[]){const o=a.flatMap(C=>[Number((C==null?void 0:C.oldNumber)||0),Number((C==null?void 0:C.newNumber)||0)]).filter(C=>C>0);if(!o.length)return{start:0,end:0,label:""};const m=Math.min(...o),_=Math.max(...o);return{start:m,end:_,label:m===_?`L${m}`:`L${m}-L${_}`}}function g(a=[]){return a.map(o=>String((o==null?void 0:o.content)||"")).join(`
|
|
4
|
+
`).replace(/\u200b/g,"").trim()}function F(){var o,m,_;if(!r.selectedFile||!U.value.visible||!J.value.length)return;const a=S(J.value);p("insert-code-context",{source:"diff",filePath:String(r.selectedFile.path||""),language:"diff",rangeLabel:a.label,lineStart:a.start,lineEnd:a.end,content:g(J.value)||String(U.value.content||"").trim()}),(_=(m=(o=window.getSelection)==null?void 0:o.call(window))==null?void 0:m.removeAllRanges)==null||_.call(m),W()}function G(a,o){if(r.setPatchLineRef(a,o),!!a){if(o){$.set(a,o);return}$.delete(a)}}function X(a){T.value=a||null,r.setPatchViewportRef(a)}function ne(a){var D,L,ue,ce;const o=(D=window.getSelection)==null?void 0:D.call(window),m=T.value;if(!o||o.rangeCount<1||o.isCollapsed||!m)return;w();const C=o.getRangeAt(0).commonAncestorContainer;if(!m.contains((C==null?void 0:C.nodeType)===1?C:C==null?void 0:C.parentNode))return;const V=J.value;if(!V.length)return;const c=g(V);c&&((ue=(L=a==null?void 0:a.clipboardData)==null?void 0:L.setData)==null||ue.call(L,"text/plain",c),(ce=a==null?void 0:a.preventDefault)==null||ce.call(a))}function q(a){return(a==null?void 0:a.kind)==="add"?"+":(a==null?void 0:a.kind)==="delete"?"-":(a==null?void 0:a.kind)==="context"?" ":""}function N(a){const o=String((a==null?void 0:a.content)||"");return(a==null?void 0:a.kind)==="add"||(a==null?void 0:a.kind)==="delete"||(a==null?void 0:a.kind)==="context"?o.slice(1):o}function ie(a=""){return String(a||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function le(a,o=""){if((a==null?void 0:a.kind)==="add"||(a==null?void 0:a.kind)==="delete"||(a==null?void 0:a.kind)==="context"){const m=q(a),_=`task-diff-line__prefix--${a.kind}`;return{...a,renderedHtml:`<span class="task-diff-line__prefix ${_}">${ie(m||" ")}</span><span class="task-diff-line__body">${o||"​"}</span>`}}return{...a,renderedHtml:ie(String((a==null?void 0:a.content)||""))}}async function oe(){const a=Array.isArray(r.selectedPatchLines)?r.selectedPatchLines:[],o=[];a.forEach((c,D)=>{((c==null?void 0:c.kind)==="add"||(c==null?void 0:c.kind)==="delete"||(c==null?void 0:c.kind)==="context")&&o.push({lineIndex:D,body:N(c)})});const m=ht(o.map(c=>c.body));let _=0;if(f.value=a.map(c=>{if((c==null?void 0:c.kind)==="add"||(c==null?void 0:c.kind)==="delete"||(c==null?void 0:c.kind)==="context"){const D=m[_]||"​";return _+=1,le(c,D)}return le(c)}),!o.length||mt(o.map(c=>c.body),Me))return;const C=await vt(o.map(c=>c.body),{isDark:H.value,language:u.value,maxHighlightLines:Me.maxLines,maxHighlightChars:Me.maxChars});let V=0;f.value=a.map(c=>{if((c==null?void 0:c.kind)==="add"||(c==null?void 0:c.kind)==="delete"||(c==null?void 0:c.kind)==="context"){const D=C[V]||"​";return V+=1,le(c,D)}return le(c)})}return K(()=>{var a;return[r.selectedPatchLines,(a=r.selectedFile)==null?void 0:a.path,H.value]},()=>{W(),oe()},{immediate:!0,deep:!0}),bt(()=>{var a,o,m;(m=(o=(a=window.getSelection)==null?void 0:a.call(window))==null?void 0:o.removeAllRanges)==null||m.call(o),W({clearBrowserSelection:!0}),$.clear()}),(a,o)=>e.selectedFile?(b(),R("div",qt,[n("div",zt,[n("div",Wt,[n("div",Gt,[n("span",{class:O(["inline-flex shrink-0 rounded-sm border px-1.5 py-0.5 text-[12px]",e.getStatusClass(e.selectedFile.status)])},h(e.getStatusLabel(e.selectedFile.status)),3),n("span",Et,h(e.selectedFile.path),1)]),n("div",Kt,[n("div",Jt,[n("div",Qt,h(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:s(x)("diffReview.statsOnDemand")),1),n("div",Xt,h(s(x)("diffReview.selectCodeLineHint")),1)]),n("div",{class:O(["inline-flex h-8 shrink-0 items-center gap-1 rounded-sm border px-1.5 py-1",e.selectedPatchHunks.length?"theme-inline-panel":"pointer-events-none invisible border-transparent"])},[n("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex<=0,onClick:o[0]||(o[0]=m=>e.jumpToAdjacentHunk(-1))},[j(s(Ge),{class:"h-4 w-4"})],8,Yt),n("span",Zt,h(s(x)("diffReview.changeIndex",{current:Math.min(e.activeHunkIndex+1,e.selectedPatchHunks.length),total:e.selectedPatchHunks.length})),1),n("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex>=e.selectedPatchHunks.length-1,onClick:o[1]||(o[1]=m=>e.jumpToAdjacentHunk(1))},[j(s(Ee),{class:"h-4 w-4"})],8,es)],2)])]),n("div",ts,[n("div",ss,[n("span",{class:O(["inline-flex rounded-sm border px-1.5 py-0.5 text-[12px]",e.getStatusClass(e.selectedFile.status)])},h(e.getStatusLabel(e.selectedFile.status)),3),n("span",as,h(e.selectedFile.path),1),n("span",ns,h(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:s(x)("diffReview.statsOnDemand")),1),n("span",is,h(s(x)("diffReview.selectCodeLineHint")),1)]),n("div",{class:O(["inline-flex h-8 w-[132px] shrink-0 items-center gap-1 rounded-sm border px-1.5 py-1",e.selectedPatchHunks.length?"theme-inline-panel":"pointer-events-none invisible border-transparent"])},[n("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex<=0,onClick:o[2]||(o[2]=m=>e.jumpToAdjacentHunk(-1))},[j(s(Ge),{class:"h-4 w-4"})],8,ls),n("span",rs,h(s(x)("diffReview.changeIndex",{current:Math.min(e.activeHunkIndex+1,e.selectedPatchHunks.length),total:e.selectedPatchHunks.length})),1),n("button",{type:"button",class:"theme-icon-button h-6 w-6 disabled:opacity-50",disabled:e.activeHunkIndex>=e.selectedPatchHunks.length-1,onClick:o[3]||(o[3]=m=>e.jumpToAdjacentHunk(1))},[j(s(Ee),{class:"h-4 w-4"})],8,os)],2)])]),e.selectedFile.message&&!e.selectedPatchLines.length?(b(),R("div",us,[n("div",cs,h(e.selectedFile.message),1)])):e.patchLoading&&!e.selectedFile.patchLoaded?(b(),R("div",ds,h(s(x)("diffReview.loadingFileDiff")),1)):e.selectedPatchLines.length?(b(),R("div",{key:2,ref:X,class:"relative flex-1 overflow-auto",onCopy:ne,onMouseup:o[4]||(o[4]=(...m)=>s(ae)&&s(ae)(...m))},[n("div",fs,[e.selectedFile.message?(b(),R("div",hs,h(e.selectedFile.message),1)):Y("",!0),(b(!0),R(he,null,Le(f.value,m=>{var _;return b(),R("div",{key:m.id,ref_for:!0,ref:C=>G(m.id,C),class:O(["task-diff-row grid",[e.getPatchLineClass(m.kind),m.kind==="hunk"&&((_=e.selectedPatchHunks[e.activeHunkIndex])==null?void 0:_.id)===m.id?"ring-1 ring-inset ring-[var(--theme-warning)]":""]]),"data-line-id":m.id,"data-line-kind":m.kind},[n("span",vs,h(m.oldNumber),1),n("span",gs,h(m.newNumber),1),n("pre",{class:O(["task-diff-line overflow-visible whitespace-pre px-3 py-0.5",m.kind==="meta"||m.kind==="hunk"?"task-diff-line--plain":""]),innerHTML:m.renderedHtml},null,10,ps)],10,ms)}),128))]),s(U).visible?(b(),Pe(ft,{key:0,top:s(U).top,left:s(U).left,label:s(x)("diffReview.insertSelection"),onClick:F},null,8,["top","left","label"])):Y("",!0)],32)):(b(),R("div",xs,[n("div",ks,h(s(x)("diffReview.noFileDiffContent")),1)]))])):(b(),R("div",ys,h(s(x)("diffReview.selectFile")),1))}},Ye=rt(bs,[["__scopeId","data-v-f94acc18"]]),ws={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},Ss={class:"theme-divider border-b px-4 py-3"},Rs={class:"flex flex-col gap-2"},Fs={class:"grid grid-cols-4 gap-2 sm:flex sm:flex-wrap sm:items-center"},Cs={class:"sm:hidden"},Ls={class:"hidden sm:inline"},Ps={class:"sm:hidden"},$s={class:"hidden sm:inline"},Ts=["disabled"],_s={class:"sm:hidden"},Ds={class:"hidden sm:inline"},Is={class:"truncate text-xs text-[var(--theme-textPrimary)]"},Hs={class:"theme-divider theme-muted-text border-b border-dashed px-3 py-2 text-[11px]"},As=["onClick"],Ms={class:"flex items-start gap-3"},js={class:"min-w-0 flex-1"},Ns={class:"truncate text-xs font-medium text-[var(--theme-textPrimary)]"},Bs={class:"theme-muted-text mt-1 text-[11px]"},Vs={key:0,class:"theme-divider theme-danger-text border-b px-4 py-3 text-sm"},Os={class:"inline-flex items-start gap-2"},Us={class:"break-all"},qs={key:1,class:"theme-muted-text flex flex-1 items-center justify-center px-5 text-sm"},zs={key:2,class:"flex flex-1 items-center justify-center px-5"},Ws={class:"theme-empty-state w-full max-w-xl px-4 py-5 text-sm text-[var(--theme-textSecondary)]"},Gs={class:"theme-heading inline-flex items-center gap-2 font-medium"},Es={class:"mt-2 break-all leading-7"},Ks={key:0,class:"mt-3 flex flex-wrap gap-2 text-xs"},Js={class:"theme-status-neutral inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Qs={class:"break-all"},Xs={key:0,class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Ys={key:3,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},Zs={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-xs"},ea={class:"flex flex-wrap items-center gap-2"},ta={key:0,class:"theme-status-info inline-flex min-w-0 items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},sa={class:"min-w-0 break-all"},aa={class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},na={class:"text-[var(--theme-textPrimary)]"},ia={class:"font-medium text-[var(--theme-success)]"},la={class:"font-medium text-[var(--theme-danger)]"},ra={key:2,class:"opacity-75"},oa={key:0,class:"mt-2 break-all text-[11px] opacity-75"},ua={key:1,class:"mt-2 flex flex-col gap-1"},ca={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},da={class:"theme-divider border-b px-3 py-3"},fa={class:"grid grid-cols-2 gap-2"},ha=["disabled"],ma={class:"theme-divider theme-muted-panel min-h-0 flex-1 overflow-y-auto p-3"},va={class:"min-h-0 flex-1 overflow-hidden bg-[var(--theme-appPanelStrong)]"},ga={key:1,class:"grid min-h-0 flex-1 grid-cols-[320px_minmax(0,1fr)] overflow-hidden"},pa={class:"theme-divider theme-muted-panel min-h-0 overflow-y-auto border-r p-3"},xa={class:"min-h-0 overflow-hidden bg-[var(--theme-appPanelStrong)]"},ka={__name:"TaskDiffReviewPanel",props:{taskSlug:{type:String,default:""},preferredScope:{type:String,default:"workspace"},preferredRunId:{type:String,default:""},focusToken:{type:Number,default:0},active:{type:Boolean,default:!1}},emits:["insert-code-context"],setup(e,{emit:l}){const r=e,p=l,{activeHunkIndex:x,baselineMetaText:H,diffPayload:f,diffScope:u,error:T,fileSearch:$,filteredFiles:te,formatRunOptionLabel:se,getFilterButtonClass:J,getFilterLabel:U,getPatchLineClass:W,getRunStatusLabel:ae,getStatusClass:w,getStatusLabel:S,jumpToAdjacentHunk:g,loading:F,patchLoading:G,patchViewportRef:X,refreshDiff:ne,selectedFile:q,selectedFilePath:N,selectedPatchHunks:ie,selectedPatchLines:le,selectedRunId:oe,setPatchLineRef:a,showSummarySkeleton:o,statsLoading:m,statusCounts:_,statusFilter:C,terminalRuns:V}=Tt(r),{matches:c}=pt("(max-width: 767px)"),D=B("files"),{t:L}=Te();function ue(Z){N.value=Z,c.value&&(D.value="patch")}function ce(Z){X.value=Z||null}return K(c,Z=>{Z||(D.value="files")},{immediate:!0}),K(N,Z=>{!Z&&c.value&&(D.value="files")}),K(u,()=>{c.value&&(D.value="files")}),(Z,k)=>{var ke,ye,de,be,we;return b(),R("section",ws,[n("div",Ss,[n("div",Rs,[n("div",Fs,[n("button",{type:"button",class:O(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",s(u)==="workspace"?"theme-filter-active":""]),onClick:k[0]||(k[0]=y=>u.value="workspace")},[n("span",Cs,h(s(L)("diffReview.scopeCurrentShort")),1),n("span",Ls,h(s(L)("diffReview.scopeCurrent")),1)],2),n("button",{type:"button",class:O(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",s(u)==="task"?"theme-filter-active":""]),onClick:k[1]||(k[1]=y=>u.value="task")},[n("span",Ps,h(s(L)("diffReview.scopeTaskShort")),1),n("span",$s,h(s(L)("diffReview.scopeTask")),1)],2),n("button",{type:"button",class:O(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",s(u)==="run"?"theme-filter-active":""]),onClick:k[2]||(k[2]=y=>u.value="run")},[n("span",null,h(s(L)("diffReview.scopeRun")),1)],2),n("button",{type:"button",class:"tool-button tool-button-info-subtle inline-flex shrink-0 items-center justify-center gap-2 px-3 py-2 text-xs",disabled:s(F),onClick:k[3]||(k[3]=(...y)=>s(ne)&&s(ne)(...y))},[j(s(Ke),{class:O(["h-3.5 w-3.5 sm:hidden",s(F)?"animate-spin":""])},null,8,["class"]),n("span",_s,h(s(L)("diffReview.refresh")),1),j(s(Ke),{class:O(["hidden h-3.5 w-3.5 sm:inline-block",s(F)?"animate-spin":""])},null,8,["class"]),n("span",Ds,h(s(F)?s(L)("diffReview.refreshing"):s(m)?s(L)("diffReview.computing"):s(L)("diffReview.refresh")),1)],8,Ts)]),s(u)==="run"?(b(),Pe(xt,{key:0,modelValue:s(oe),"onUpdate:modelValue":k[4]||(k[4]=y=>wt(oe)?oe.value=y:null),class:"min-w-0 sm:max-w-[360px]",options:s(V),loading:s(F),"get-option-value":y=>(y==null?void 0:y.id)||"",placeholder:s(L)("diffReview.selectRun"),"empty-text":s(L)("diffReview.noRuns")},{trigger:xe(({selectedOption:y})=>[n("div",Is,h(y?s(se)(y):s(L)("diffReview.selectRun")),1)]),header:xe(()=>[n("div",Hs,h(s(L)("diffReview.runCount",{count:s(V).length})),1)]),option:xe(({option:y,selected:Se,select:_e})=>[n("button",{type:"button",class:O(["w-full rounded-sm border border-dashed px-3 py-2 text-left transition",Se?"theme-filter-active":"theme-filter-idle"]),onClick:_e},[n("div",Ms,[n("div",js,[n("div",Ns,h(s(Ze)(y.startedAt||y.createdAt)),1),n("div",Bs,h(s(ae)(y)),1)]),Se?(b(),Pe(s(Rt),{key:0,class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):Y("",!0)])],10,As)]),_:1},8,["modelValue","options","loading","get-option-value","placeholder","empty-text"])):Y("",!0)])]),s(T)?(b(),R("div",Vs,[n("div",Os,[j(s(Ft),{class:"mt-0.5 h-4 w-4 shrink-0"}),n("span",Us,h(s(T)),1)])])):Y("",!0),s(F)&&!s(f)?(b(),R("div",qs,h(s(L)("diffReview.loading")),1)):s(f)&&!s(f).supported?(b(),R("div",zs,[n("div",Ws,[n("div",Gs,[j(s(tt),{class:"h-4 w-4"}),n("span",null,h(s(L)("diffReview.unavailableTitle")),1)]),n("p",Es,h(s(f).reason||s(L)("diffReview.unavailableReason")),1),s(f).repoRoot?(b(),R("div",Ks,[n("div",Js,[j(s(Je),{class:"h-3.5 w-3.5 shrink-0"}),n("span",Qs,h(s(f).repoRoot),1)]),s(f).branch?(b(),R("div",Xs,[j(s(Qe),{class:"h-3.5 w-3.5 shrink-0"}),n("span",null,h(s(f).branch),1)])):Y("",!0)])):Y("",!0)])])):s(f)?(b(),R("div",Ys,[n("div",Zs,[n("div",ea,[s(f).repoRoot?(b(),R("div",ta,[j(s(Je),{class:"h-3.5 w-3.5 shrink-0"}),n("span",sa,h(s(f).repoRoot),1)])):Y("",!0),n("div",aa,[j(s(Qe),{class:"h-3.5 w-3.5 shrink-0"}),n("span",null,h(s(f).branch||s(L)("diffReview.unknownBranch")),1),k[18]||(k[18]=n("span",{class:"opacity-50"},"•",-1)),n("span",na,h(s(L)("diffReview.fileCount",{count:((ke=s(f).summary)==null?void 0:ke.fileCount)||0})),1),(ye=s(f).summary)!=null&&ye.statsComplete?(b(),R(he,{key:0},[k[14]||(k[14]=n("span",{class:"opacity-50"},"•",-1)),n("span",ia,"+"+h(((de=s(f).summary)==null?void 0:de.additions)||0),1),n("span",la,"-"+h(((be=s(f).summary)==null?void 0:be.deletions)||0),1)],64)):s(o)?(b(),R(he,{key:1},[k[15]||(k[15]=n("span",{class:"opacity-50"},"•",-1)),k[16]||(k[16]=n("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-successSoft)]"},null,-1)),k[17]||(k[17]=n("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-dangerSoft)]"},null,-1))],64)):(b(),R("span",ra,h(s(L)("diffReview.waitingStats")),1))])]),s(H)?(b(),R("p",oa,h(s(H)),1)):Y("",!0),(we=s(f).warnings)!=null&&we.length?(b(),R("div",ua,[(b(!0),R(he,null,Le(s(f).warnings,y=>(b(),R("p",{key:y,class:"text-[11px] text-[var(--theme-warningText)]"},h(y),1))),128))])):Y("",!0)]),s(c)?(b(),R("div",ca,[n("div",da,[n("div",fa,[n("button",{type:"button",class:O(["tool-button px-3 py-2 text-sm",D.value==="files"?"tool-button-accent-subtle":""]),onClick:k[5]||(k[5]=y=>D.value="files")},h(s(L)("diffReview.filesTab")),3),n("button",{type:"button",class:O(["tool-button px-3 py-2 text-sm",D.value==="patch"?"tool-button-accent-subtle":""]),disabled:!s(q),onClick:k[6]||(k[6]=y=>D.value="patch")},h(s(L)("diffReview.diffTab")),11,ha)])]),Be(n("div",ma,[j(Xe,{"auto-focus-selected":e.active&&D.value==="files","diff-payload":s(f),"file-search":s($),"focus-token":e.focusToken,"filtered-files":s(te),"get-filter-button-class":s(J),"get-filter-label":s(U),"get-status-class":s(w),"get-status-label":s(S),"selected-file-path":s(N),"show-summary-skeleton":s(o),"status-counts":s(_),"status-filter":s(C),"onUpdate:fileSearch":k[7]||(k[7]=y=>$.value=y),"onUpdate:statusFilter":k[8]||(k[8]=y=>C.value=y),onSelectFile:ue},null,8,["auto-focus-selected","diff-payload","file-search","focus-token","filtered-files","get-filter-button-class","get-filter-label","get-status-class","get-status-label","selected-file-path","show-summary-skeleton","status-counts","status-filter"])],512),[[We,D.value==="files"]]),Be(n("div",va,[j(Ye,{"active-hunk-index":s(x),"get-patch-line-class":s(W),"get-status-class":s(w),"get-status-label":s(S),"jump-to-adjacent-hunk":s(g),"patch-loading":s(G),"selected-file":s(q),"selected-patch-hunks":s(ie),"selected-patch-lines":s(le),"set-patch-line-ref":s(a),"set-patch-viewport-ref":ce,onInsertCodeContext:k[9]||(k[9]=y=>p("insert-code-context",y))},null,8,["active-hunk-index","get-patch-line-class","get-status-class","get-status-label","jump-to-adjacent-hunk","patch-loading","selected-file","selected-patch-hunks","selected-patch-lines","set-patch-line-ref"])],512),[[We,D.value==="patch"]])])):(b(),R("div",ga,[n("div",pa,[j(Xe,{"auto-focus-selected":e.active,"diff-payload":s(f),"file-search":s($),"focus-token":e.focusToken,"filtered-files":s(te),"get-filter-button-class":s(J),"get-filter-label":s(U),"get-status-class":s(w),"get-status-label":s(S),"selected-file-path":s(N),"show-summary-skeleton":s(o),"status-counts":s(_),"status-filter":s(C),"onUpdate:fileSearch":k[10]||(k[10]=y=>$.value=y),"onUpdate:statusFilter":k[11]||(k[11]=y=>C.value=y),onSelectFile:k[12]||(k[12]=y=>N.value=y)},null,8,["auto-focus-selected","diff-payload","file-search","focus-token","filtered-files","get-filter-button-class","get-filter-label","get-status-class","get-status-label","selected-file-path","show-summary-skeleton","status-counts","status-filter"])]),n("div",xa,[j(Ye,{"active-hunk-index":s(x),"get-patch-line-class":s(W),"get-status-class":s(w),"get-status-label":s(S),"jump-to-adjacent-hunk":s(g),"patch-loading":s(G),"selected-file":s(q),"selected-patch-hunks":s(ie),"selected-patch-lines":s(le),"set-patch-line-ref":s(a),"set-patch-viewport-ref":ce,onInsertCodeContext:k[13]||(k[13]=y=>p("insert-code-context",y))},null,8,["active-hunk-index","get-patch-line-class","get-status-class","get-status-label","jump-to-adjacent-hunk","patch-loading","selected-file","selected-patch-hunks","selected-patch-lines","set-patch-line-ref"])])]))])):Y("",!0)])}}},ya={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},Pa={__name:"TaskDiffReviewDialog",props:{open:{type:Boolean,default:!1},taskSlug:{type:String,default:""},taskTitle:{type:String,default:""},preferredScope:{type:String,default:"task"},preferredRunId:{type:String,default:""},focusToken:{type:Number,default:0}},emits:["close","insert-code-context"],setup(e,{emit:l}){const r=e,p=l,{t:x}=Te(),H=E(()=>{const u=String(r.taskTitle||"").trim();return u?x("diffReview.dialogTitleWithTask",{title:u}):x("diffReview.dialogTitle")});function f(u){p("insert-code-context",u),p("close")}return(u,T)=>(b(),Pe(kt,{open:e.open,"stack-level":2,"panel-class":"settings-dialog-panel h-full sm:h-[90vh] sm:w-[90vw] sm:max-w-[90vw]","header-class":"settings-dialog-header px-5 py-4","body-class":"settings-dialog-body min-h-0 flex-1 overflow-hidden p-3 sm:p-4",onClose:T[0]||(T[0]=$=>p("close"))},{title:xe(()=>[n("div",ya,[j(s(tt),{class:"h-4 w-4"}),n("span",null,h(H.value),1)])]),default:xe(()=>[j(ka,{"task-slug":e.taskSlug,active:e.open,"preferred-scope":e.preferredScope,"preferred-run-id":e.preferredRunId,"focus-token":e.focusToken,onInsertCodeContext:f},null,8,["task-slug","active","preferred-scope","preferred-run-id","focus-token"])]),_:1},8,["open"]))}};export{Pa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.task-diff-row[data-v-f94acc18]{grid-template-columns:3.1rem 3.1rem minmax(0,1fr)}.task-diff-view[data-v-f94acc18]{font-size:var(--theme-codeViewFontSize);line-height:var(--theme-codeViewLineHeight)}.task-diff-row__number[data-v-f94acc18]{border-right:1px solid var(--theme-borderMuted);color:color-mix(in srgb,var(--theme-textPrimary) 52%,transparent);font-size:var(--theme-codeViewGutterFontSize);font-variant-numeric:tabular-nums;padding:.125rem .5rem;text-align:right}.task-diff-line[data-v-f94acc18]{color:inherit;-moz-user-select:text;user-select:text;-webkit-user-select:text}.task-diff-line[data-v-f94acc18] .task-diff-line__prefix{display:inline-block;font-weight:600;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:1ch}.task-diff-line[data-v-f94acc18] .task-diff-line__prefix--add{color:var(--theme-successText)}.task-diff-line[data-v-f94acc18] .task-diff-line__prefix--delete{color:var(--theme-dangerText)}.task-diff-line[data-v-f94acc18] .task-diff-line__prefix--context{color:color-mix(in srgb,var(--theme-textPrimary) 35%,transparent)}.task-diff-line[data-v-f94acc18] .task-diff-line__body{display:inline}.task-diff-line--plain[data-v-f94acc18]{color:inherit}
|