@muyichengshayu/promptx 0.1.46 → 0.1.47
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 +6 -0
- package/apps/server/src/agentSessionDiscovery.js +17 -1
- package/apps/web/dist/assets/{CodexSessionManagerDialog-D32D8icG.js → CodexSessionManagerDialog-DZk_ClXW.js} +1 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-B28M4Rwo.js +3 -0
- package/apps/web/dist/assets/TaskDiffReviewDialog-CeGj0idf.css +1 -0
- package/apps/web/dist/assets/{WorkbenchSettingsDialog-DzhyGob8.js → WorkbenchSettingsDialog-DrXiTtO_.js} +1 -1
- package/apps/web/dist/assets/WorkbenchView-BdPC47JX.js +53 -0
- package/apps/web/dist/assets/WorkbenchView-BdpDI-HR.css +1 -0
- package/apps/web/dist/assets/index-Bx48HpZF.js +2 -0
- package/apps/web/dist/assets/index-DaELubyR.css +1 -0
- package/apps/web/dist/index.html +2 -2
- package/package.json +1 -1
- package/apps/web/dist/assets/TaskDiffReviewDialog-BXO-i1n_.js +0 -2
- package/apps/web/dist/assets/TaskDiffReviewDialog-Np_9C-g7.css +0 -1
- package/apps/web/dist/assets/WorkbenchView-CVt59HvL.css +0 -1
- package/apps/web/dist/assets/WorkbenchView-Cz6odhoQ.js +0 -47
- package/apps/web/dist/assets/index-BJ1LY28p.css +0 -1
- package/apps/web/dist/assets/index-BJ75IHuM.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.47
|
|
4
|
+
|
|
5
|
+
- 工作台新增“选中插入到编辑区”能力:在模型回复、项目源码查看与代码变更里都可直接拖选内容并一键插入右侧编辑区;其中模型回复按普通文本插入,更适合二次处理,源码与 diff 继续按代码上下文块插入。
|
|
6
|
+
- 统一选区插入按钮的交互与层级:三处场景改为共用同一套按钮组件,按钮从全局浮层收回到各自容器内,并在滚动、缩放与移动端视口变化时跟随选区重新定位,避免遮挡弹层头部或滚动后飘离内容区。
|
|
7
|
+
- 回复卡片代码块补齐复制入口,并继续收敛右侧导入文件阅读体验:代码块头部支持一键复制,导入文件正文从 `14px` 调整到 `12px`,同时把“已插入代码上下文到右侧编辑区”统一收口为更中性的插入成功提示。
|
|
8
|
+
|
|
3
9
|
## 0.1.46
|
|
4
10
|
|
|
5
11
|
- 项目管理新增本地会话发现与候选选择:`Codex / Claude Code / OpenCode` 都支持读取本机已有 session,创建或编辑项目时可直接按当前工作目录筛选并选择已有会话,不再只能手填 session ID。
|
|
@@ -141,11 +141,16 @@ function createSessionCandidate(input = {}) {
|
|
|
141
141
|
label: label.length > MAX_PREVIEW_LENGTH ? `${label.slice(0, MAX_PREVIEW_LENGTH - 1)}…` : label,
|
|
142
142
|
cwd,
|
|
143
143
|
updatedAt: toIsoDate(input.updatedAt),
|
|
144
|
+
updatedAtSource: normalizeText(input.updatedAtSource),
|
|
144
145
|
source: normalizeText(input.source),
|
|
145
146
|
summary: normalizeText(input.summary),
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
|
|
150
|
+
function getUpdatedAtPriority(value = '') {
|
|
151
|
+
return value === 'explicit' ? 1 : 0
|
|
152
|
+
}
|
|
153
|
+
|
|
149
154
|
function sortAndLimitCandidates(items = [], options = {}) {
|
|
150
155
|
const limit = normalizeLimit(options.limit)
|
|
151
156
|
const targetCwd = normalizeComparablePath(options.cwd)
|
|
@@ -166,7 +171,13 @@ function sortAndLimitCandidates(items = [], options = {}) {
|
|
|
166
171
|
|
|
167
172
|
const nextScore = Number(Boolean(candidate.cwd)) + Number(Boolean(candidate.label && candidate.label !== candidate.id))
|
|
168
173
|
const currentScore = Number(Boolean(current.cwd)) + Number(Boolean(current.label && current.label !== current.id))
|
|
169
|
-
|
|
174
|
+
const nextTimePriority = getUpdatedAtPriority(candidate.updatedAtSource)
|
|
175
|
+
const currentTimePriority = getUpdatedAtPriority(current.updatedAtSource)
|
|
176
|
+
if (
|
|
177
|
+
nextTimePriority > currentTimePriority
|
|
178
|
+
|| (nextTimePriority === currentTimePriority && getSortTime(candidate.updatedAt) > getSortTime(current.updatedAt))
|
|
179
|
+
|| nextScore > currentScore
|
|
180
|
+
) {
|
|
170
181
|
deduped.set(key, {
|
|
171
182
|
...current,
|
|
172
183
|
...candidate,
|
|
@@ -174,6 +185,7 @@ function sortAndLimitCandidates(items = [], options = {}) {
|
|
|
174
185
|
label: candidate.label || current.label,
|
|
175
186
|
summary: candidate.summary || current.summary,
|
|
176
187
|
updatedAt: candidate.updatedAt || current.updatedAt,
|
|
188
|
+
updatedAtSource: candidate.updatedAtSource || current.updatedAtSource,
|
|
177
189
|
})
|
|
178
190
|
}
|
|
179
191
|
})
|
|
@@ -185,6 +197,7 @@ function sortAndLimitCandidates(items = [], options = {}) {
|
|
|
185
197
|
}))
|
|
186
198
|
.sort((left, right) => (
|
|
187
199
|
Number(right.matchedCwd) - Number(left.matchedCwd)
|
|
200
|
+
|| getUpdatedAtPriority(right.updatedAtSource) - getUpdatedAtPriority(left.updatedAtSource)
|
|
188
201
|
|| getSortTime(right.updatedAt) - getSortTime(left.updatedAt)
|
|
189
202
|
|| String(left.label || left.id).localeCompare(String(right.label || right.id), 'zh-CN')
|
|
190
203
|
))
|
|
@@ -509,6 +522,7 @@ function addOpenCodeLayoutSessions(dat = {}, sourceFile = '', items = [], idToCw
|
|
|
509
522
|
label: path.basename(cwd) || id,
|
|
510
523
|
cwd,
|
|
511
524
|
updatedAt: item.at,
|
|
525
|
+
updatedAtSource: item.at ? 'explicit' : 'inferred',
|
|
512
526
|
source: 'opencode_desktop',
|
|
513
527
|
})
|
|
514
528
|
})
|
|
@@ -529,6 +543,7 @@ function addOpenCodeLayoutSessions(dat = {}, sourceFile = '', items = [], idToCw
|
|
|
529
543
|
label: path.basename(cwd) || id,
|
|
530
544
|
cwd,
|
|
531
545
|
updatedAt: safeStat(sourceFile)?.mtime,
|
|
546
|
+
updatedAtSource: 'inferred',
|
|
532
547
|
source: 'opencode_desktop',
|
|
533
548
|
})
|
|
534
549
|
})
|
|
@@ -578,6 +593,7 @@ export function listKnownOpenCodeSessions(options = {}) {
|
|
|
578
593
|
label: sanitizeOpenCodeSessionLabel(text, cwd, id),
|
|
579
594
|
cwd,
|
|
580
595
|
updatedAt: stat?.mtime,
|
|
596
|
+
updatedAtSource: 'inferred',
|
|
581
597
|
source: 'opencode_desktop',
|
|
582
598
|
})
|
|
583
599
|
})
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{A as _t,n as Qe,j as Je,d as Mt,W as ut,c as gt,k as It,s as jt,m as Pt,o as dt,_ as Dt,b as Rt,p as ct,q as At,t as tt}from"./WorkbenchView-Cz6odhoQ.js";import{u as Ke,f as Et,e as Tt}from"./index-BJ75IHuM.js";import{w as oe,n as ve,ak as at,aD as c,aI as fe,aJ as Pe,aF as n,aQ as u,u as a,aG as j,aW as Lt,aU as Ft,aX as Bt,aE as p,aR as De,aS as ze,aL as N,aN as P,aV as Nt,aK as nt,b as M,c as $,o as Ot,aZ as ht,r as Ut}from"./vendor-misc-u-M8sNMf.js";import{c as Ht,L as Ge,F as Xe,e as zt,b as yt,X as ft,C as Kt,M as qt,o as Vt,x as Wt,P as Qt,i as pt,E as Gt,N as Xt,n as Jt,r as Yt,O as Zt}from"./vendor-ui-C5E3MVzU.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";import"./vendor-router-Dn8q3tJM.js";function en(o=[]){return(Array.isArray(o)&&o.length?o:_t).filter(_=>_&&typeof _=="object").map(_=>{const D=Qe(_.value);return{..._,value:D,label:String(_.label||Je(D)).trim()||Je(D),enabled:_.enabled!==!1,available:_.available!==!1}})}function st(o=[]){return en(o).filter(O=>O.enabled&&O.available)}async function tn(){const o=await Mt("/api/meta",{cache:"no-store"});return st(o==null?void 0:o.agentEngineOptions)}const nn={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},sn={class:"theme-muted-text mt-1 text-xs leading-5"},an={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},ln={class:"flex items-start gap-2 text-xs leading-5"},on={class:"theme-muted-text shrink-0"},rn={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},un={class:"theme-muted-text mt-4 block text-xs"},dn={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},cn=["placeholder"],fn={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},pn={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},vn={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},mn={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"},hn={key:4,class:"theme-empty-state px-3 py-8 text-sm"},yn={key:5,class:"theme-empty-state px-3 py-8 text-sm"},xn={key:6,class:"theme-empty-state px-3 py-8 text-sm"},bn={key:7,class:"space-y-1"},wn=["onClick"],Sn={class:"min-w-0 flex-1"},kn=["innerHTML"],Cn=["innerHTML"],$n={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},_n={key:8,class:"space-y-1"},Mn={class:"flex items-start gap-1.5"},In=["onClick"],jn=["onClick"],Pn={class:"min-w-0 flex-1"},Dn={key:0,class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all"},Rn={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"},An={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},En=["disabled"],Tn=["disabled"],Ln={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(o,{emit:O}){const _=o,D=O,{t:h}=Ke(),F=M(""),E=M(null),f=M(!1),S=M(""),R=M(!1),r=M(""),b=M([]),Q=M(!1),v=M(""),k=M(""),X=M(null);let H=null,z=0,K=null;const V=new Map,W=$(()=>ke(E.value?[E.value]:[])),J=$(()=>String(v.value||"").trim()),Y=$(()=>J.value.length>=ut),A=$(()=>!!J.value),G=$(()=>A.value?b.value:W.value),Z=$(()=>G.value.map(e=>{const l=I((e==null?void 0:e.path)||""),s=e!=null&&e.expanded?1:0,d=e!=null&&e.loading?1:0;return`${l}:${s}:${d}`}).join("|")),x=$(()=>A.value&&!Y.value&&!R.value&&!r.value),y=$(()=>A.value&&Y.value&&!R.value&&!r.value&&!b.value.length),m=$(()=>!A.value&&!f.value&&!S.value&&!W.value.length);function U(e=""){const l=String(e||"").trim();return/^[a-z]:[\\/]/i.test(l)||l.includes("\\")}function I(e=""){const l=String(e||"").trim();if(!l)return"";const s=U(l);let d=l.replace(/\\/g,"/");return d.length>1&&!/^[a-z]:\/?$/i.test(d)&&d!=="/"&&(d=d.replace(/\/+$/,"")),s?d.toLowerCase():d}function te(e="",l=""){const s=I(e),d=I(l);return!s||!d?!1:s===d||s.startsWith(`${d}/`)}function xe(e="",l=""){const s=String(e||"").trim(),d=String(l||"").trim();return s?d?U(s)?/^[a-z]:\\?$/i.test(s)?`${s.replace(/[\\/]+$/,"")}\\${d}`:`${s.replace(/[\\/]+$/,"")}\\${d}`:s==="/"?`/${d}`:`${s.replace(/\/+$/,"")}/${d}`:s:d}function Re(e="",l=""){const s=I(e),d=I(l);if(!s||!d||!te(d,s))return[];const q=d===s?"":d.slice(s.length).replace(/^\//,"");return q?q.split("/").filter(Boolean):[]}function w(e=""){const l=String(e||"").trim();if(!l||I(l)===I(F.value))return"";const s=U(l),d=l.replace(/\\/g,"/");if(s){const ie=d.replace(/\/+$/,""),le=ie.lastIndexOf("/");if(le<=2)return"";const We=ie.slice(0,le).replace(/\//g,"\\");return te(We,F.value)?We:""}const q=d.replace(/\/+$/,""),ae=q.lastIndexOf("/");if(ae<=0)return"";const ye=q.slice(0,ae)||"/";return te(ye,F.value)?ye:""}function be(e){return(e==null?void 0:e.name)||(e==null?void 0:e.path)||h("directoryPicker.unnamedDirectory")}function Ye(e=""){const l=String(e||"").trim();return l?l.split(/[\\/]/).filter(Boolean).at(-1)||l:"Home"}function re(e=""){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function we(e="",l=""){const s=String(e||""),d=String(l||"").trim().toLowerCase();if(!s||!d)return null;const q=s.toLowerCase(),ae=q.indexOf(d);if(ae>=0)return{start:ae,end:ae+d.length};const ye=d.split(/[\\/\s_.-]+/).filter(Boolean).sort((ie,le)=>le.length-ie.length);for(const ie of ye){if(ie.length<2)continue;const le=q.indexOf(ie);if(le>=0)return{start:le,end:le+ie.length}}return null}function Se(e="",l=""){const s=String(e||""),d=we(s,l);return d?`${re(s.slice(0,d.start))}<mark class="theme-search-highlight">${re(s.slice(d.start,d.end))}</mark>${re(s.slice(d.end))}`:re(s)}function ue(e){return Se(be(e),v.value)}function T(e){return Se((e==null?void 0:e.path)||"",v.value)}function Ae(e,l=0){return{...e,depth:l,expanded:!1,loaded:!1,loading:!1,children:[]}}function ke(e=[],l=[]){return e.forEach(s=>{l.push(s),s.expanded&&s.children.length&&ke(s.children,l)}),l}function de(){E.value&&(E.value={...E.value})}function me(){H&&(window.clearTimeout(H),H=null),K&&(K.abort(),K=null)}function ge(e,l=E.value?[E.value]:[]){const s=I(e);if(!s)return null;for(const d of l){if(I(d.path)===s)return d;if(d.children.length){const q=ge(e,d.children);if(q)return q}}return null}function ee(e){k.value=String((e==null?void 0:e.path)||"").trim()}function ce(e=""){return I(e)}function Ee(e,l){const s=ce(e);if(s){if(l){V.set(s,l);return}V.delete(s)}}function he(){var l;const e=V.get(ce(k.value));(l=e==null?void 0:e.scrollIntoView)==null||l.call(e,{block:"nearest"})}function qe(){ve(()=>{var e,l;(l=(e=X.value)==null?void 0:e.focus)==null||l.call(e)})}function Ze(){const e=G.value;if(!e.length){k.value="";return}const l=ce(k.value);l&&e.some(s=>ce((s==null?void 0:s.path)||"")===l)||ee(e[0])}function Ce(){const e=G.value;if(!e.length)return-1;const l=ce(k.value),s=e.findIndex(d=>ce((d==null?void 0:d.path)||"")===l);return s>=0?s:0}function ne(){const e=G.value,l=Ce();return l<0||!e.length?null:e[l]||null}function pe(e=1){const l=G.value;if(!l.length)return!1;const s=Ce(),d=s<0?0:(s+e+l.length)%l.length;return ee(l[d]),ve(he),!0}async function Ve(){if(A.value)return!1;const e=ne();if(!e||!e.hasChildren)return!1;if(!e.expanded)return await se(e),!0;const l=G.value,s=Ce(),d=l[s+1];return d&&w(d.path)===e.path?(ee(d),ve(he),!0):!1}function Te(){if(A.value)return!1;const e=ne();if(!e)return!1;if(e.expanded&&e.hasChildren)return e.expanded=!1,de(),ee(e),!0;const l=w(e.path);if(!l)return!1;const s=ge(l);return s?(ee(s),ve(he),!0):!1}function $e(e){var l,s,d;if((l=e==null?void 0:e.preventDefault)==null||l.call(e),J.value){(s=e==null?void 0:e.stopPropagation)==null||s.call(e),v.value="";return}(d=e==null?void 0:e.stopPropagation)==null||d.call(e),D("close")}function Le(e){const l=String((e==null?void 0:e.key)||"");if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Escape"].includes(l)&&!(A.value&&(l==="ArrowLeft"||l==="ArrowRight"))){if(l==="ArrowDown"){e.preventDefault(),pe(1);return}if(l==="ArrowUp"){e.preventDefault(),pe(-1);return}if(l==="Escape"){$e(e);return}if(A.value){if(l==="Enter"){e.preventDefault();const s=ne();s&&Oe(s)}return}if(l==="ArrowRight"){e.preventDefault(),Ve();return}if(l==="ArrowLeft"){e.preventDefault(),Te();return}l==="Enter"&&(e.preventDefault(),Ue())}}async function _e(e,l={}){if(!(!e||e.loading)&&!(e.loaded&&!l.force)){e.loading=!0,S.value="",de();try{const s=await dt({path:e.path,limit:240});e.children=(s.items||[]).map(d=>Ae(d,e.depth+1)),e.loaded=!0}catch(s){S.value=s.message||h("directoryPicker.loadFailed")}finally{e.loading=!1,de()}}}async function Me(){f.value=!0,S.value="";try{const e=await dt({limit:240});F.value=String(e.path||""),E.value=Ae({name:Ye(e.path||""),path:String(e.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),E.value.children=(e.items||[]).map(l=>Ae(l,1)),E.value.loaded=!0,E.value.expanded=!0,ee(E.value)}catch(e){S.value=e.message||h("directoryPicker.treeLoadFailed"),E.value=null,F.value=""}finally{f.value=!1}}async function Fe(e=""){const l=String(e||"").trim();if(!l||!F.value||!te(l,F.value))return;let s=E.value;if(!s)return;ee(s);const d=Re(F.value,l);for(const q of d){await _e(s),s.expanded=!0,de();const ae=ge(xe(s.path,q),s.children);if(!ae)break;s=ae,ee(s)}}async function Ie(){v.value="",b.value=[],r.value="",Q.value=!1,k.value="",await Me();const e=String(_.initialPath||"").trim();e&&te(e,F.value)&&await Fe(e)}async function se(e){if(e!=null&&e.path&&(ee(e),!!e.hasChildren)){if(!e.loaded){e.expanded=!0,de(),await _e(e);return}e.expanded=!e.expanded,de()}}function je(e){e!=null&&e.path&&ee(e)}async function Be(){const e=String(v.value||"").trim();z+=1;const l=z;if(me(),!_.open||!e||!F.value||!Y.value){R.value=!1,r.value="",b.value=[],Q.value=!1;return}R.value=!0,r.value="",K=new AbortController;try{const s=await jt(e,{path:F.value,limit:80,signal:K.signal});if(l!==z)return;b.value=Array.isArray(s.items)?s.items:[],Q.value=!!s.truncated}catch(s){if(Pt(s)||l!==z)return;r.value=s.message||h("directoryPicker.searchFailed"),b.value=[],Q.value=!1}finally{l===z&&(K=null),l===z&&(R.value=!1)}}function Ne(){if(me(),!String(v.value||"").trim()||!Y.value){R.value=!1,r.value="",b.value=[],Q.value=!1;return}R.value=!0,r.value="",H=window.setTimeout(()=>{H=null,Be()},It)}async function Oe(e){e!=null&&e.path&&(await Fe(e.path),v.value="")}function Ue(){k.value&&(D("select",k.value),D("close"))}return oe(v,()=>{Ne()}),oe(Z,()=>{Ze(),ve(he)},{immediate:!0}),oe(()=>_.open,e=>{if(e){Ie().catch(()=>{}),qe();return}me()}),at(()=>{me()}),(e,l)=>(c(),fe(gt,{open:o.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":f.value||R.value,"close-on-backdrop":!(f.value||R.value),"close-on-escape":!(f.value||R.value),onClose:l[2]||(l[2]=s=>D("close"))},{title:Pe(()=>[n("div",null,[n("div",nn,[j(a(Xe),{class:"h-4 w-4"}),n("span",null,u(a(h)("directoryPicker.title")),1)]),n("p",sn,u(a(h)("directoryPicker.intro")),1)])]),default:Pe(()=>[n("div",{class:"flex min-h-0 flex-1 flex-col overflow-hidden",onKeydown:Le},[n("div",an,[n("div",ln,[n("span",on,u(a(h)("directoryPicker.currentSelection")),1),n("span",rn,u(k.value||a(h)("directoryPicker.selectionPlaceholder")),1)])]),n("label",un,[n("span",null,u(a(h)("directoryPicker.searchLabel")),1),n("div",dn,[j(a(Ht),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),Lt(n("input",{ref_key:"searchInputRef",ref:X,"onUpdate:modelValue":l[0]||(l[0]=s=>v.value=s),type:"text",placeholder:a(h)("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:Ft($e,["esc"])},null,40,cn),[[Bt,v.value]])])]),n("div",fn,[A.value&&r.value?(c(),p("div",pn,u(r.value),1)):!A.value&&S.value?(c(),p("div",vn,u(S.value),1)):A.value&&R.value?(c(),p("div",mn,[j(a(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,u(a(h)("directoryPicker.searching")),1)])):!A.value&&f.value?(c(),p("div",gn,[j(a(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,u(a(h)("directoryPicker.treeLoading")),1)])):x.value?(c(),p("div",hn,u(a(h)("directoryPicker.searchMinKeywordHint",{count:a(ut)})),1)):y.value?(c(),p("div",yn,u(a(h)("directoryPicker.noSearchResults")),1)):m.value?(c(),p("div",xn,u(a(h)("directoryPicker.emptyTree")),1)):A.value?(c(),p("div",bn,[(c(!0),p(De,null,ze(b.value,s=>(c(),p("button",{key:s.path,ref_for:!0,ref:d=>Ee(s.path,d),type:"button",class:N(["theme-list-row focus:outline-none",I(k.value)===I(s.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:d=>Oe(s)},[j(a(Xe),{class:"theme-list-item-icon"}),n("div",Sn,[n("div",null,[n("span",{class:"theme-list-item-title block break-all",innerHTML:ue(s)},null,8,kn)]),n("div",{class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all",innerHTML:T(s)},null,8,Cn)])],10,wn))),128)),Q.value?(c(),p("p",$n,u(a(h)("directoryPicker.truncatedHint")),1)):P("",!0)])):(c(),p("div",_n,[(c(!0),p(De,null,ze(W.value,s=>(c(),p("div",{key:s.path,ref_for:!0,ref:d=>Ee(s.path,d),class:N(["theme-list-tree-item outline-none focus:outline-none focus-visible:outline-none",I(k.value)===I(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",Mn,[n("button",{type:"button",class:N(["theme-icon-button h-5 w-5 shrink-0",s.hasChildren?"":"invisible pointer-events-none"]),onClick:nt(d=>se(s),["stop"])},[s.loading?(c(),fe(a(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(c(),fe(a(zt),{key:1,class:N(["h-3.5 w-3.5 transition",s.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,In),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:d=>je(s)},[j(a(Xe),{class:N(["h-4 w-4 shrink-0",I(k.value)===I(s.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),n("div",Pn,[n("div",{class:N(["theme-list-item-title truncate",s.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},u(be(s)),3),s.isHomeRoot?(c(),p("div",Dn,u(s.path),1)):P("",!0)])],8,jn)])],6))),128))]))])],32),n("div",Rn,[n("div",An,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:f.value||R.value,onClick:l[1]||(l[1]=s=>D("close"))},u(a(h)("directoryPicker.cancel")),9,En),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:f.value||R.value||!k.value,onClick:Ue},[j(a(yt),{class:"h-4 w-4"}),n("span",null,u(a(h)("directoryPicker.useCurrentDirectory")),1)],8,Tn)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},Fn={class:"grid gap-4"},Bn={class:"theme-muted-text block text-xs"},Nn=["value","disabled"],On={class:"theme-muted-text block text-xs"},Un={class:"mt-1 flex gap-2"},Hn={class:"relative min-w-0 flex-1"},zn=["value","disabled"],Kn=["disabled"],qn=["disabled"],Vn={id:"codex-manager-workspace-suggestions"},Wn=["value"],Qn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},Gn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},Xn={class:"theme-muted-text block text-xs"},Jn={class:"mt-1"},Yn={class:"flex items-center gap-2 text-sm"},Zn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},es=["disabled","onClick"],ts={class:"flex items-center justify-between gap-3"},ns={class:"min-w-0 flex-1 truncate"},ss={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},as={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},is={class:"theme-muted-text block text-xs"},ls={class:"mt-1 flex gap-2"},os=["value","disabled"],rs=["disabled"],us={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"},ds={class:"flex items-center justify-between gap-2 border-b border-solid px-3 py-2 text-[11px] leading-5"},cs={class:"font-medium text-[var(--theme-textPrimary)]"},fs={key:0,class:"theme-muted-text"},ps={key:0,class:"max-h-72 overflow-y-auto p-2"},vs=["disabled","onClick"],ms={class:"flex min-w-0 items-center justify-between gap-3"},gs={class:"min-w-0 flex-1 truncate text-xs font-medium text-[var(--theme-textPrimary)]"},hs={class:"shrink-0 text-[11px] leading-4 text-[var(--theme-textMuted)]"},ys={key:1,class:"theme-empty-state px-3 py-4 text-xs"},xs=["disabled"],bs={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},ws={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},vt={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},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:cwd","update:engine","update:sessionId","update:title"],setup(o,{emit:O}){const _=o,D=O,{t:h}=Ke(),F=M(null),E=M(null),f=M(!1),S=M(-1),R=$(()=>{const x=String(_.engine||"").trim();return _.engineOptions.find(y=>String((y==null?void 0:y.value)||"").trim()===x)||null}),r=$(()=>!!String(_.cwd||"").trim()),b=$(()=>String(_.sessionId||"").trim()),Q=$(()=>b.value.toLowerCase()),v=$(()=>_.sessionCandidates.filter(x=>x==null?void 0:x.matchedCwd)),k=$(()=>{const x=Q.value,y=v.value;return x?y.filter(m=>[m==null?void 0:m.label,m==null?void 0:m.id,m==null?void 0:m.cwd].map(I=>String(I||"").toLowerCase()).some(I=>I.includes(x))).slice(0,10):y.slice(0,10)});function X(){_.busy||!_.canEditSessionId||!r.value||(f.value=!0)}function H(){f.value=!1,S.value=-1}function z(){const x=k.value;if(!x.length){S.value=-1;return}const y=x.findIndex(m=>m.id===b.value);S.value=y>=0?y:0}function K(){ve(()=>{var x,y;(y=(x=E.value)==null?void 0:x.focus)==null||y.call(x)})}function V(){if(f.value){H();return}X(),K()}function W(){D("update:cwd","")}function J(){D("update:sessionId",""),H(),K()}function Y(x){var y;D("update:sessionId",((y=x==null?void 0:x.target)==null?void 0:y.value)||""),r.value&&X()}function A(x){D("select-session-candidate",x),H(),K()}function G(x){if(_.busy||!_.canEditSessionId||!r.value)return;const y=k.value;if(x.key==="ArrowDown"){if(x.preventDefault(),!f.value){X(),z();return}if(!y.length)return;S.value=S.value<0?0:Math.min(y.length-1,S.value+1);return}if(x.key==="ArrowUp"){if(x.preventDefault(),!f.value){X(),z();return}if(!y.length)return;S.value=S.value<0?y.length-1:Math.max(0,S.value-1);return}if(x.key==="Enter"&&f.value&&y.length&&S.value>=0){x.preventDefault(),A(y[S.value]);return}x.key==="Escape"&&f.value&&(x.preventDefault(),H())}function Z(x){!f.value||!F.value||F.value.contains(x.target)||H()}return oe(k,()=>{z()}),oe(()=>_.canEditSessionId,x=>{(!x||!r.value)&&H()}),oe(r,x=>{x||H()}),Ot(()=>{document.addEventListener("pointerdown",Z)}),at(()=>{document.removeEventListener("pointerdown",Z)}),(x,y)=>(c(),p("div",Fn,[n("label",Bn,[n("span",null,u(a(h)("projectManager.projectTitleOptional")),1),n("input",{value:o.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:o.busy,onInput:y[0]||(y[0]=m=>D("update:title",m.target.value))},null,40,Nn)]),n("label",On,[n("span",null,u(a(h)("projectManager.workingDirectoryField")),1),n("div",Un,[n("div",Hn,[n("input",{value:o.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:N(["tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",o.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:o.busy||!o.canEditCwd,onInput:y[1]||(y[1]=m=>D("update:cwd",m.target.value))},null,42,zn),o.cwd&&o.canEditCwd?(c(),p("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:o.busy,onClick:W},[j(a(ft),{class:"h-3.5 w-3.5"})],8,Kn)):P("",!0)]),n("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy||!o.canEditCwd,onClick:y[2]||(y[2]=m=>D("open-directory-picker"))},[j(a(Xe),{class:"h-4 w-4"}),n("span",null,u(o.mobile?a(h)("projectManager.choose"):a(h)("projectManager.chooseDirectory")),1)],8,qn)]),n("datalist",Vn,[(c(!0),p(De,null,ze(o.workspaceSuggestions,m=>(c(),p("option",{key:m,value:m},null,8,Wn))),128))]),o.duplicateCwdMessage?(c(),p("p",Qn,u(o.duplicateCwdMessage),1)):o.cwdReadonlyMessage?(c(),p("p",Gn,u(o.cwdReadonlyMessage),1)):P("",!0)]),n("label",Xn,[n("span",null,u(a(h)("projectManager.engineField")),1),n("div",Jn,[j(Dt,{"model-value":o.engine,options:o.engineOptions,disabled:o.busy||!o.canEditEngine,placeholder:a(h)("projectManager.selectEngine"),"empty-text":a(h)("projectManager.noEngines"),"get-option-value":m=>(m==null?void 0:m.value)||"","onUpdate:modelValue":y[3]||(y[3]=m=>D("update:engine",m))},{trigger:Pe(({disabled:m})=>{var U;return[n("div",Yn,[n("span",{class:N(["min-w-0 flex-1 truncate",m?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},u(((U=R.value)==null?void 0:U.label)||a(h)("projectManager.selectEngine")),3),R.value&&R.value.enabled===!1?(c(),p("span",Zn,u(a(h)("projectManager.comingSoon")),1)):P("",!0)])]}),option:Pe(({option:m,selected:U,select:I})=>[n("button",{type:"button",class:N(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",U?"theme-filter-active":"theme-filter-idle"]),disabled:(m==null?void 0:m.enabled)===!1,onClick:I},[n("div",ts,[n("span",ns,u(m.label),1),(m==null?void 0:m.enabled)===!1?(c(),p("span",ss,u(a(h)("projectManager.comingSoon")),1)):P("",!0)])],10,es)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),o.engineReadonlyMessage?(c(),p("p",as,u(o.engineReadonlyMessage),1)):P("",!0)]),n("label",is,[n("span",null,u(a(h)("projectManager.sessionId")),1),n("div",ls,[n("div",{ref_key:"sessionComboboxRef",ref:F,class:"relative min-w-0 flex-1"},[n("input",{ref_key:"sessionInputRef",ref:E,value:o.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",disabled:o.busy||!o.canEditSessionId,onFocus:X,onInput:Y,onKeydown:G},null,40,os),o.canEditSessionId?(c(),p("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:o.busy||!r.value,onClick:V},[o.sessionCandidatesLoading?(c(),fe(a(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):b.value?(c(),fe(a(ft),{key:1,class:"h-3.5 w-3.5",onClick:nt(J,["stop"])})):(c(),fe(a(Kt),{key:2,class:N(["h-3.5 w-3.5 transition",f.value?"rotate-180":""])},null,8,["class"]))],8,rs)):P("",!0),o.canEditSessionId&&f.value?(c(),p("div",us,[n("div",ds,[n("span",cs,u(a(h)("projectManager.sessionCandidates")),1),o.sessionCandidatesLoading?(c(),p("span",fs,u(a(h)("projectManager.sessionCandidatesLoading")),1)):P("",!0)]),k.value.length?(c(),p("div",ps,[(c(!0),p(De,null,ze(k.value,(m,U)=>(c(),p("button",{key:`${m.engine}:${m.id}`,type:"button",class:N(["theme-list-row mb-1 w-full px-2 py-1.5 text-left last:mb-0",U===S.value?"theme-list-item-active":"theme-list-item-hover"]),disabled:o.busy,onMousedown:y[4]||(y[4]=nt(()=>{},["prevent"])),onClick:I=>A(m)},[n("div",ms,[n("span",gs,u(m.label||m.id),1),n("span",hs,u(m.updatedAtLabel||a(h)("projectManager.unknown")),1)])],42,vs))),128))])):(c(),p("div",ys,u(r.value?a(h)("projectManager.noSessionCandidates"):a(h)("projectManager.sessionCandidatesNeedDirectory")),1))])):P("",!0)],512),b.value?(c(),p("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy,onClick:y[5]||(y[5]=m=>D("copy-session-id"))},[o.sessionIdCopied?(c(),fe(a(yt),{key:0,class:"h-4 w-4"})):(c(),fe(a(qt),{key:1,class:"h-4 w-4"})),n("span",null,u(o.sessionIdCopied?a(h)("projectManager.sessionIdCopied"):a(h)("projectManager.copySessionId")),1)],8,xs)):P("",!0)]),o.sessionIdReadonlyMessage?(c(),p("p",bs,u(o.sessionIdReadonlyMessage),1)):(c(),p("p",ws,u(r.value?a(h)("projectManager.sessionIdHint"):a(h)("projectManager.sessionCandidatesNeedDirectory")),1))])]))}},Ss={class:"flex items-center justify-between gap-3"},ks={class:"theme-heading text-sm font-medium"},Cs={key:0,class:"theme-muted-text mt-1 text-xs"},$s=["disabled"],_s=["onClick"],Ms={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Is={class:"flex w-full flex-col gap-2 text-left"},js={class:"theme-heading min-w-0 text-sm font-medium"},Ps=["title"],Ds=["title"],Rs={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},As={key:0,"aria-hidden":"true"},Es={key:1},Ts={class:"flex flex-wrap items-center gap-2 pt-1"},Ls={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:o=>o},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(o,{emit:O}){const _=o,D=O,{t:h}=Ke();function F(S){return _.mode==="edit"&&_.editingSessionId===S.id?"theme-card-selected":_.isSessionRunning(S.id)?"theme-card-warning":"theme-card-idle-strong"}function E(S){return _.isCurrentSession(S.id)?h("projectManager.current"):h("projectManager.regular")}function f(S){return _.isCurrentSession(S.id)?"theme-status-info":"theme-status-neutral"}return(S,R)=>(c(),p("div",{class:N(o.mobile?"flex h-full min-h-0 flex-col":"")},[n("div",Ss,[n("div",null,[n("div",ks,u(a(h)("projectManager.projectList")),1),o.hasSessions?P("",!0):(c(),p("p",Cs,u(a(h)("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:o.busy,onClick:R[0]||(R[0]=r=>D("create"))},[j(a(Vt),{class:"h-4 w-4"}),n("span",null,u(a(h)("projectManager.create")),1)],8,$s)]),n("div",{class:N(["mt-4 space-y-2",o.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),p(De,null,ze(o.sessions,r=>(c(),p("article",{key:r.id,class:N(["relative cursor-pointer rounded-sm border p-3 transition",F(r)]),onClick:b=>D("select",r.id)},[o.mode==="edit"&&o.editingSessionId===r.id?(c(),p("span",Ms)):P("",!0),n("div",Is,[n("div",js,[n("span",{class:"block truncate",title:r.title||a(h)("projectManager.untitledProject")},u(r.title||a(h)("projectManager.untitledProject")),9,Ps)]),n("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:r.cwd},u(r.cwd),9,Ds),n("div",Rs,[n("span",null,u(a(Je)(r.engine)),1),o.mobile?P("",!0):(c(),p("span",As,"·")),o.mobile?P("",!0):(c(),p("span",Es,u(o.formatUpdatedAt(r.updatedAt)),1))]),n("div",Ts,[n("span",{class:N(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",f(r)])},u(E(r)),3),n("span",{class:N(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getRuntimeStatusClass(r.id)])},[o.isSessionRunning(r.id)?(c(),p("span",Ls)):P("",!0),ht(" "+u(o.getRuntimeStatusLabel(r.id)),1)],2),n("span",{class:N(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getThreadStatusClass(r)])},u(o.getThreadStatusLabel(r)),3)])])],10,_s))),128))],2)],2))}},Fs={class:"space-y-3"},Bs={class:"dashed-panel px-3 py-3"},Ns={class:"theme-muted-text text-[11px]"},Os={class:"mt-2 flex flex-wrap gap-2"},Us={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Hs={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},zs={class:"dashed-panel px-3 py-3"},Ks={class:"theme-muted-text text-[11px]"},qs={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Vs={class:"dashed-panel px-3 py-3"},Ws={class:"theme-muted-text text-[11px]"},Qs={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},Gs={class:"dashed-panel px-3 py-3"},Xs={class:"theme-muted-text text-[11px]"},Js={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Ys={class:"dashed-panel px-3 py-3"},Zs={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},ea={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},ta={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:o=>o},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(o){const{t:O}=Ke();return(_,D)=>{var h,F,E,f,S,R,r;return c(),p("div",Fs,[n("div",Bs,[n("div",Ns,u(a(O)("projectManager.runtimeStatus")),1),n("div",Os,[n("span",{class:N(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getRuntimeStatusClass((h=o.activeSession)==null?void 0:h.id)])},[o.isSessionRunning((F=o.activeSession)==null?void 0:F.id)?(c(),p("span",Us)):P("",!0),ht(" "+u(o.getRuntimeStatusLabel((E=o.activeSession)==null?void 0:E.id)),1)],2),n("span",{class:N(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getThreadStatusClass(o.activeSession)])},u(o.getThreadStatusLabel(o.activeSession)),3),(f=o.activeSession)!=null&&f.id&&o.isCurrentSession(o.activeSession.id)?(c(),p("span",Hs,u(a(O)("projectManager.currentProject")),1)):P("",!0)])]),n("div",zs,[n("div",Ks,u(a(O)("projectManager.engine")),1),n("div",qs,u(a(Je)((S=o.activeSession)==null?void 0:S.engine)),1)]),n("div",Vs,[n("div",Ws,u(a(O)("projectManager.workingDirectory")),1),n("div",Qs,u(((R=o.activeSession)==null?void 0:R.cwd)||a(O)("projectManager.notSet")),1)]),n("div",Gs,[n("div",Xs,u(a(O)("projectManager.updatedAt")),1),n("div",Js,u(o.formatUpdatedAt((r=o.activeSession)==null?void 0:r.updatedAt)),1)]),n("div",Ys,[n("div",Zs,[j(a(Wt),{class:"h-3.5 w-3.5"}),n("span",null,u(a(O)("projectManager.note")),1)]),n("p",ea,u(a(O)("projectManager.noteDescription")),1)])])}}},na={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},sa={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},aa={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"},ia={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},la={class:"flex flex-wrap items-start justify-between gap-3"},oa={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ra={class:"mt-5"},ua={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},da={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"},ca={class:"flex flex-wrap items-center gap-2"},fa=["disabled"],pa=["disabled"],va=["disabled"],ma={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},ga=["disabled"],ha=["disabled"],ya=["disabled"],xa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},ba={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},wa={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},Sa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},ka={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},Ca=["disabled"],$a={class:"min-w-0 flex-1"},_a={class:"theme-heading truncate text-sm font-medium"},Ma={key:0,class:"theme-muted-text mt-1 truncate text-xs"},Ia={class:"theme-divider border-b px-4 py-3"},ja={class:"grid grid-cols-2 gap-2"},Pa=["disabled"],Da={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Ra={key:0},Aa={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ea={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Ta=["disabled"],La=["disabled"],Fa=["disabled"],Ba=["disabled"],Na=3e3,Wa={__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(o,{expose:O,emit:_}){const D=new Map;function h(t="",i=""){const g=Qe(t),C=tt(i);return!g||!C?"":`${g}
|
|
1
|
+
import{A as _t,n as Qe,m as Je,h as Mt,W as ut,f as gt,o as It,s as jt,p as Pt,q as dt,d as Dt,c as Rt,t as ct,v as At,w as tt}from"./WorkbenchView-BdPC47JX.js";import{u as Ke,f as Et,e as Tt}from"./index-Bx48HpZF.js";import{w as oe,n as ve,ak as at,aD as c,aI as fe,aJ as Pe,aF as n,aQ as u,u as a,aG as j,aW as Lt,aU as Ft,aX as Bt,aE as p,aR as De,aS as ze,aL as N,aN as P,aV as Nt,aK as nt,b as M,c as $,o as Ot,aZ as ht,r as Ut}from"./vendor-misc-u-M8sNMf.js";import{c as Ht,L as Ge,F as Xe,e as zt,b as yt,X as ft,C as Kt,M as qt,o as Vt,x as Wt,P as Qt,i as pt,E as Gt,N as Xt,n as Jt,r as Yt,O as Zt}from"./vendor-ui-C5E3MVzU.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";import"./vendor-router-Dn8q3tJM.js";function en(o=[]){return(Array.isArray(o)&&o.length?o:_t).filter(_=>_&&typeof _=="object").map(_=>{const D=Qe(_.value);return{..._,value:D,label:String(_.label||Je(D)).trim()||Je(D),enabled:_.enabled!==!1,available:_.available!==!1}})}function st(o=[]){return en(o).filter(O=>O.enabled&&O.available)}async function tn(){const o=await Mt("/api/meta",{cache:"no-store"});return st(o==null?void 0:o.agentEngineOptions)}const nn={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},sn={class:"theme-muted-text mt-1 text-xs leading-5"},an={class:"theme-divider mt-4 rounded-sm border border-dashed px-3 py-2"},ln={class:"flex items-start gap-2 text-xs leading-5"},on={class:"theme-muted-text shrink-0"},rn={class:"min-w-0 break-all font-mono text-[var(--theme-textPrimary)]"},un={class:"theme-muted-text mt-4 block text-xs"},dn={class:"theme-input-shell mt-1 flex h-10 items-center gap-2 rounded-sm border px-3 transition focus-within:ring-2"},cn=["placeholder"],fn={class:"theme-content-panel mt-3 min-h-0 flex-1 overflow-y-auto p-2"},pn={key:0,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},vn={key:1,class:"theme-status-danger rounded-sm border border-dashed px-3 py-3 text-xs"},mn={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"},hn={key:4,class:"theme-empty-state px-3 py-8 text-sm"},yn={key:5,class:"theme-empty-state px-3 py-8 text-sm"},xn={key:6,class:"theme-empty-state px-3 py-8 text-sm"},bn={key:7,class:"space-y-1"},wn=["onClick"],Sn={class:"min-w-0 flex-1"},kn=["innerHTML"],Cn=["innerHTML"],$n={key:0,class:"theme-muted-text px-1 pt-2 text-xs"},_n={key:8,class:"space-y-1"},Mn={class:"flex items-start gap-1.5"},In=["onClick"],jn=["onClick"],Pn={class:"min-w-0 flex-1"},Dn={key:0,class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all"},Rn={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"},An={class:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center"},En=["disabled"],Tn=["disabled"],Ln={__name:"CodexDirectoryPickerDialog",props:{open:{type:Boolean,default:!1},initialPath:{type:String,default:""},suggestions:{type:Array,default:()=>[]}},emits:["close","select"],setup(o,{emit:O}){const _=o,D=O,{t:h}=Ke(),F=M(""),E=M(null),f=M(!1),S=M(""),R=M(!1),r=M(""),b=M([]),Q=M(!1),v=M(""),k=M(""),X=M(null);let H=null,z=0,K=null;const V=new Map,W=$(()=>ke(E.value?[E.value]:[])),J=$(()=>String(v.value||"").trim()),Y=$(()=>J.value.length>=ut),A=$(()=>!!J.value),G=$(()=>A.value?b.value:W.value),Z=$(()=>G.value.map(e=>{const l=I((e==null?void 0:e.path)||""),s=e!=null&&e.expanded?1:0,d=e!=null&&e.loading?1:0;return`${l}:${s}:${d}`}).join("|")),x=$(()=>A.value&&!Y.value&&!R.value&&!r.value),y=$(()=>A.value&&Y.value&&!R.value&&!r.value&&!b.value.length),m=$(()=>!A.value&&!f.value&&!S.value&&!W.value.length);function U(e=""){const l=String(e||"").trim();return/^[a-z]:[\\/]/i.test(l)||l.includes("\\")}function I(e=""){const l=String(e||"").trim();if(!l)return"";const s=U(l);let d=l.replace(/\\/g,"/");return d.length>1&&!/^[a-z]:\/?$/i.test(d)&&d!=="/"&&(d=d.replace(/\/+$/,"")),s?d.toLowerCase():d}function te(e="",l=""){const s=I(e),d=I(l);return!s||!d?!1:s===d||s.startsWith(`${d}/`)}function xe(e="",l=""){const s=String(e||"").trim(),d=String(l||"").trim();return s?d?U(s)?/^[a-z]:\\?$/i.test(s)?`${s.replace(/[\\/]+$/,"")}\\${d}`:`${s.replace(/[\\/]+$/,"")}\\${d}`:s==="/"?`/${d}`:`${s.replace(/\/+$/,"")}/${d}`:s:d}function Re(e="",l=""){const s=I(e),d=I(l);if(!s||!d||!te(d,s))return[];const q=d===s?"":d.slice(s.length).replace(/^\//,"");return q?q.split("/").filter(Boolean):[]}function w(e=""){const l=String(e||"").trim();if(!l||I(l)===I(F.value))return"";const s=U(l),d=l.replace(/\\/g,"/");if(s){const ie=d.replace(/\/+$/,""),le=ie.lastIndexOf("/");if(le<=2)return"";const We=ie.slice(0,le).replace(/\//g,"\\");return te(We,F.value)?We:""}const q=d.replace(/\/+$/,""),ae=q.lastIndexOf("/");if(ae<=0)return"";const ye=q.slice(0,ae)||"/";return te(ye,F.value)?ye:""}function be(e){return(e==null?void 0:e.name)||(e==null?void 0:e.path)||h("directoryPicker.unnamedDirectory")}function Ye(e=""){const l=String(e||"").trim();return l?l.split(/[\\/]/).filter(Boolean).at(-1)||l:"Home"}function re(e=""){return String(e||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function we(e="",l=""){const s=String(e||""),d=String(l||"").trim().toLowerCase();if(!s||!d)return null;const q=s.toLowerCase(),ae=q.indexOf(d);if(ae>=0)return{start:ae,end:ae+d.length};const ye=d.split(/[\\/\s_.-]+/).filter(Boolean).sort((ie,le)=>le.length-ie.length);for(const ie of ye){if(ie.length<2)continue;const le=q.indexOf(ie);if(le>=0)return{start:le,end:le+ie.length}}return null}function Se(e="",l=""){const s=String(e||""),d=we(s,l);return d?`${re(s.slice(0,d.start))}<mark class="theme-search-highlight">${re(s.slice(d.start,d.end))}</mark>${re(s.slice(d.end))}`:re(s)}function ue(e){return Se(be(e),v.value)}function T(e){return Se((e==null?void 0:e.path)||"",v.value)}function Ae(e,l=0){return{...e,depth:l,expanded:!1,loaded:!1,loading:!1,children:[]}}function ke(e=[],l=[]){return e.forEach(s=>{l.push(s),s.expanded&&s.children.length&&ke(s.children,l)}),l}function de(){E.value&&(E.value={...E.value})}function me(){H&&(window.clearTimeout(H),H=null),K&&(K.abort(),K=null)}function ge(e,l=E.value?[E.value]:[]){const s=I(e);if(!s)return null;for(const d of l){if(I(d.path)===s)return d;if(d.children.length){const q=ge(e,d.children);if(q)return q}}return null}function ee(e){k.value=String((e==null?void 0:e.path)||"").trim()}function ce(e=""){return I(e)}function Ee(e,l){const s=ce(e);if(s){if(l){V.set(s,l);return}V.delete(s)}}function he(){var l;const e=V.get(ce(k.value));(l=e==null?void 0:e.scrollIntoView)==null||l.call(e,{block:"nearest"})}function qe(){ve(()=>{var e,l;(l=(e=X.value)==null?void 0:e.focus)==null||l.call(e)})}function Ze(){const e=G.value;if(!e.length){k.value="";return}const l=ce(k.value);l&&e.some(s=>ce((s==null?void 0:s.path)||"")===l)||ee(e[0])}function Ce(){const e=G.value;if(!e.length)return-1;const l=ce(k.value),s=e.findIndex(d=>ce((d==null?void 0:d.path)||"")===l);return s>=0?s:0}function ne(){const e=G.value,l=Ce();return l<0||!e.length?null:e[l]||null}function pe(e=1){const l=G.value;if(!l.length)return!1;const s=Ce(),d=s<0?0:(s+e+l.length)%l.length;return ee(l[d]),ve(he),!0}async function Ve(){if(A.value)return!1;const e=ne();if(!e||!e.hasChildren)return!1;if(!e.expanded)return await se(e),!0;const l=G.value,s=Ce(),d=l[s+1];return d&&w(d.path)===e.path?(ee(d),ve(he),!0):!1}function Te(){if(A.value)return!1;const e=ne();if(!e)return!1;if(e.expanded&&e.hasChildren)return e.expanded=!1,de(),ee(e),!0;const l=w(e.path);if(!l)return!1;const s=ge(l);return s?(ee(s),ve(he),!0):!1}function $e(e){var l,s,d;if((l=e==null?void 0:e.preventDefault)==null||l.call(e),J.value){(s=e==null?void 0:e.stopPropagation)==null||s.call(e),v.value="";return}(d=e==null?void 0:e.stopPropagation)==null||d.call(e),D("close")}function Le(e){const l=String((e==null?void 0:e.key)||"");if(["ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter","Escape"].includes(l)&&!(A.value&&(l==="ArrowLeft"||l==="ArrowRight"))){if(l==="ArrowDown"){e.preventDefault(),pe(1);return}if(l==="ArrowUp"){e.preventDefault(),pe(-1);return}if(l==="Escape"){$e(e);return}if(A.value){if(l==="Enter"){e.preventDefault();const s=ne();s&&Oe(s)}return}if(l==="ArrowRight"){e.preventDefault(),Ve();return}if(l==="ArrowLeft"){e.preventDefault(),Te();return}l==="Enter"&&(e.preventDefault(),Ue())}}async function _e(e,l={}){if(!(!e||e.loading)&&!(e.loaded&&!l.force)){e.loading=!0,S.value="",de();try{const s=await dt({path:e.path,limit:240});e.children=(s.items||[]).map(d=>Ae(d,e.depth+1)),e.loaded=!0}catch(s){S.value=s.message||h("directoryPicker.loadFailed")}finally{e.loading=!1,de()}}}async function Me(){f.value=!0,S.value="";try{const e=await dt({limit:240});F.value=String(e.path||""),E.value=Ae({name:Ye(e.path||""),path:String(e.path||""),type:"directory",hasChildren:!0,isHomeRoot:!0},0),E.value.children=(e.items||[]).map(l=>Ae(l,1)),E.value.loaded=!0,E.value.expanded=!0,ee(E.value)}catch(e){S.value=e.message||h("directoryPicker.treeLoadFailed"),E.value=null,F.value=""}finally{f.value=!1}}async function Fe(e=""){const l=String(e||"").trim();if(!l||!F.value||!te(l,F.value))return;let s=E.value;if(!s)return;ee(s);const d=Re(F.value,l);for(const q of d){await _e(s),s.expanded=!0,de();const ae=ge(xe(s.path,q),s.children);if(!ae)break;s=ae,ee(s)}}async function Ie(){v.value="",b.value=[],r.value="",Q.value=!1,k.value="",await Me();const e=String(_.initialPath||"").trim();e&&te(e,F.value)&&await Fe(e)}async function se(e){if(e!=null&&e.path&&(ee(e),!!e.hasChildren)){if(!e.loaded){e.expanded=!0,de(),await _e(e);return}e.expanded=!e.expanded,de()}}function je(e){e!=null&&e.path&&ee(e)}async function Be(){const e=String(v.value||"").trim();z+=1;const l=z;if(me(),!_.open||!e||!F.value||!Y.value){R.value=!1,r.value="",b.value=[],Q.value=!1;return}R.value=!0,r.value="",K=new AbortController;try{const s=await jt(e,{path:F.value,limit:80,signal:K.signal});if(l!==z)return;b.value=Array.isArray(s.items)?s.items:[],Q.value=!!s.truncated}catch(s){if(Pt(s)||l!==z)return;r.value=s.message||h("directoryPicker.searchFailed"),b.value=[],Q.value=!1}finally{l===z&&(K=null),l===z&&(R.value=!1)}}function Ne(){if(me(),!String(v.value||"").trim()||!Y.value){R.value=!1,r.value="",b.value=[],Q.value=!1;return}R.value=!0,r.value="",H=window.setTimeout(()=>{H=null,Be()},It)}async function Oe(e){e!=null&&e.path&&(await Fe(e.path),v.value="")}function Ue(){k.value&&(D("select",k.value),D("close"))}return oe(v,()=>{Ne()}),oe(Z,()=>{Ze(),ve(he)},{immediate:!0}),oe(()=>_.open,e=>{if(e){Ie().catch(()=>{}),qe();return}me()}),at(()=>{me()}),(e,l)=>(c(),fe(gt,{open:o.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":f.value||R.value,"close-on-backdrop":!(f.value||R.value),"close-on-escape":!(f.value||R.value),onClose:l[2]||(l[2]=s=>D("close"))},{title:Pe(()=>[n("div",null,[n("div",nn,[j(a(Xe),{class:"h-4 w-4"}),n("span",null,u(a(h)("directoryPicker.title")),1)]),n("p",sn,u(a(h)("directoryPicker.intro")),1)])]),default:Pe(()=>[n("div",{class:"flex min-h-0 flex-1 flex-col overflow-hidden",onKeydown:Le},[n("div",an,[n("div",ln,[n("span",on,u(a(h)("directoryPicker.currentSelection")),1),n("span",rn,u(k.value||a(h)("directoryPicker.selectionPlaceholder")),1)])]),n("label",un,[n("span",null,u(a(h)("directoryPicker.searchLabel")),1),n("div",dn,[j(a(Ht),{class:"h-4 w-4 shrink-0 text-[var(--theme-textMuted)]"}),Lt(n("input",{ref_key:"searchInputRef",ref:X,"onUpdate:modelValue":l[0]||(l[0]=s=>v.value=s),type:"text",placeholder:a(h)("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:Ft($e,["esc"])},null,40,cn),[[Bt,v.value]])])]),n("div",fn,[A.value&&r.value?(c(),p("div",pn,u(r.value),1)):!A.value&&S.value?(c(),p("div",vn,u(S.value),1)):A.value&&R.value?(c(),p("div",mn,[j(a(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,u(a(h)("directoryPicker.searching")),1)])):!A.value&&f.value?(c(),p("div",gn,[j(a(Ge),{class:"h-4 w-4 animate-spin"}),n("span",null,u(a(h)("directoryPicker.treeLoading")),1)])):x.value?(c(),p("div",hn,u(a(h)("directoryPicker.searchMinKeywordHint",{count:a(ut)})),1)):y.value?(c(),p("div",yn,u(a(h)("directoryPicker.noSearchResults")),1)):m.value?(c(),p("div",xn,u(a(h)("directoryPicker.emptyTree")),1)):A.value?(c(),p("div",bn,[(c(!0),p(De,null,ze(b.value,s=>(c(),p("button",{key:s.path,ref_for:!0,ref:d=>Ee(s.path,d),type:"button",class:N(["theme-list-row focus:outline-none",I(k.value)===I(s.path)?"theme-list-item-active":"theme-list-item-hover"]),onClick:d=>Oe(s)},[j(a(Xe),{class:"theme-list-item-icon"}),n("div",Sn,[n("div",null,[n("span",{class:"theme-list-item-title block break-all",innerHTML:ue(s)},null,8,kn)]),n("div",{class:"theme-list-item-subtitle theme-list-item-subtitle--mono break-all",innerHTML:T(s)},null,8,Cn)])],10,wn))),128)),Q.value?(c(),p("p",$n,u(a(h)("directoryPicker.truncatedHint")),1)):P("",!0)])):(c(),p("div",_n,[(c(!0),p(De,null,ze(W.value,s=>(c(),p("div",{key:s.path,ref_for:!0,ref:d=>Ee(s.path,d),class:N(["theme-list-tree-item outline-none focus:outline-none focus-visible:outline-none",I(k.value)===I(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",Mn,[n("button",{type:"button",class:N(["theme-icon-button h-5 w-5 shrink-0",s.hasChildren?"":"invisible pointer-events-none"]),onClick:nt(d=>se(s),["stop"])},[s.loading?(c(),fe(a(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):(c(),fe(a(zt),{key:1,class:N(["h-3.5 w-3.5 transition",s.expanded?"rotate-90 text-[var(--theme-textPrimary)]":""])},null,8,["class"]))],10,In),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:d=>je(s)},[j(a(Xe),{class:N(["h-4 w-4 shrink-0",I(k.value)===I(s.path)?"text-[var(--theme-textPrimary)]":"text-[var(--theme-textMuted)]"])},null,8,["class"]),n("div",Pn,[n("div",{class:N(["theme-list-item-title truncate",s.isHomeRoot?"font-medium text-[var(--theme-textSecondary)]":"font-medium text-[var(--theme-textPrimary)]"])},u(be(s)),3),s.isHomeRoot?(c(),p("div",Dn,u(s.path),1)):P("",!0)])],8,jn)])],6))),128))]))])],32),n("div",Rn,[n("div",An,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:f.value||R.value,onClick:l[1]||(l[1]=s=>D("close"))},u(a(h)("directoryPicker.cancel")),9,En),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:f.value||R.value||!k.value,onClick:Ue},[j(a(yt),{class:"h-4 w-4"}),n("span",null,u(a(h)("directoryPicker.useCurrentDirectory")),1)],8,Tn)])])]),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"]))}},Fn={class:"grid gap-4"},Bn={class:"theme-muted-text block text-xs"},Nn=["value","disabled"],On={class:"theme-muted-text block text-xs"},Un={class:"mt-1 flex gap-2"},Hn={class:"relative min-w-0 flex-1"},zn=["value","disabled"],Kn=["disabled"],qn=["disabled"],Vn={id:"codex-manager-workspace-suggestions"},Wn=["value"],Qn={key:0,class:"mt-2 text-[11px] leading-5 text-[var(--theme-warningText)]"},Gn={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},Xn={class:"theme-muted-text block text-xs"},Jn={class:"mt-1"},Yn={class:"flex items-center gap-2 text-sm"},Zn={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},es=["disabled","onClick"],ts={class:"flex items-center justify-between gap-3"},ns={class:"min-w-0 flex-1 truncate"},ss={key:0,class:"theme-muted-text rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]"},as={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},is={class:"theme-muted-text block text-xs"},ls={class:"mt-1 flex gap-2"},os=["value","disabled"],rs=["disabled"],us={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"},ds={class:"flex items-center justify-between gap-2 border-b border-solid px-3 py-2 text-[11px] leading-5"},cs={class:"font-medium text-[var(--theme-textPrimary)]"},fs={key:0,class:"theme-muted-text"},ps={key:0,class:"max-h-72 overflow-y-auto p-2"},vs=["disabled","onClick"],ms={class:"flex min-w-0 items-center justify-between gap-3"},gs={class:"min-w-0 flex-1 truncate text-xs font-medium text-[var(--theme-textPrimary)]"},hs={class:"shrink-0 text-[11px] leading-4 text-[var(--theme-textMuted)]"},ys={key:1,class:"theme-empty-state px-3 py-4 text-xs"},xs=["disabled"],bs={key:0,class:"theme-muted-text mt-2 text-[11px] leading-5"},ws={key:1,class:"theme-muted-text mt-2 text-[11px] leading-5"},vt={__name:"CodexSessionManagerForm",props:{busy:{type:Boolean,default:!1},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:cwd","update:engine","update:sessionId","update:title"],setup(o,{emit:O}){const _=o,D=O,{t:h}=Ke(),F=M(null),E=M(null),f=M(!1),S=M(-1),R=$(()=>{const x=String(_.engine||"").trim();return _.engineOptions.find(y=>String((y==null?void 0:y.value)||"").trim()===x)||null}),r=$(()=>!!String(_.cwd||"").trim()),b=$(()=>String(_.sessionId||"").trim()),Q=$(()=>b.value.toLowerCase()),v=$(()=>_.sessionCandidates.filter(x=>x==null?void 0:x.matchedCwd)),k=$(()=>{const x=Q.value,y=v.value;return x?y.filter(m=>[m==null?void 0:m.label,m==null?void 0:m.id,m==null?void 0:m.cwd].map(I=>String(I||"").toLowerCase()).some(I=>I.includes(x))).slice(0,10):y.slice(0,10)});function X(){_.busy||!_.canEditSessionId||!r.value||(f.value=!0)}function H(){f.value=!1,S.value=-1}function z(){const x=k.value;if(!x.length){S.value=-1;return}const y=x.findIndex(m=>m.id===b.value);S.value=y>=0?y:0}function K(){ve(()=>{var x,y;(y=(x=E.value)==null?void 0:x.focus)==null||y.call(x)})}function V(){if(f.value){H();return}X(),K()}function W(){D("update:cwd","")}function J(){D("update:sessionId",""),H(),K()}function Y(x){var y;D("update:sessionId",((y=x==null?void 0:x.target)==null?void 0:y.value)||""),r.value&&X()}function A(x){D("select-session-candidate",x),H(),K()}function G(x){if(_.busy||!_.canEditSessionId||!r.value)return;const y=k.value;if(x.key==="ArrowDown"){if(x.preventDefault(),!f.value){X(),z();return}if(!y.length)return;S.value=S.value<0?0:Math.min(y.length-1,S.value+1);return}if(x.key==="ArrowUp"){if(x.preventDefault(),!f.value){X(),z();return}if(!y.length)return;S.value=S.value<0?y.length-1:Math.max(0,S.value-1);return}if(x.key==="Enter"&&f.value&&y.length&&S.value>=0){x.preventDefault(),A(y[S.value]);return}x.key==="Escape"&&f.value&&(x.preventDefault(),H())}function Z(x){!f.value||!F.value||F.value.contains(x.target)||H()}return oe(k,()=>{z()}),oe(()=>_.canEditSessionId,x=>{(!x||!r.value)&&H()}),oe(r,x=>{x||H()}),Ot(()=>{document.addEventListener("pointerdown",Z)}),at(()=>{document.removeEventListener("pointerdown",Z)}),(x,y)=>(c(),p("div",Fn,[n("label",Bn,[n("span",null,u(a(h)("projectManager.projectTitleOptional")),1),n("input",{value:o.title,type:"text",maxlength:"140",placeholder:"",class:"tool-input mt-1",disabled:o.busy,onInput:y[0]||(y[0]=m=>D("update:title",m.target.value))},null,40,Nn)]),n("label",On,[n("span",null,u(a(h)("projectManager.workingDirectoryField")),1),n("div",Un,[n("div",Hn,[n("input",{value:o.cwd,type:"text",list:"codex-manager-workspace-suggestions",placeholder:"",class:N(["tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",o.duplicateCwdMessage?"border-[var(--theme-warning)]":""]),disabled:o.busy||!o.canEditCwd,onInput:y[1]||(y[1]=m=>D("update:cwd",m.target.value))},null,42,zn),o.cwd&&o.canEditCwd?(c(),p("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:o.busy,onClick:W},[j(a(ft),{class:"h-3.5 w-3.5"})],8,Kn)):P("",!0)]),n("button",{type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy||!o.canEditCwd,onClick:y[2]||(y[2]=m=>D("open-directory-picker"))},[j(a(Xe),{class:"h-4 w-4"}),n("span",null,u(o.mobile?a(h)("projectManager.choose"):a(h)("projectManager.chooseDirectory")),1)],8,qn)]),n("datalist",Vn,[(c(!0),p(De,null,ze(o.workspaceSuggestions,m=>(c(),p("option",{key:m,value:m},null,8,Wn))),128))]),o.duplicateCwdMessage?(c(),p("p",Qn,u(o.duplicateCwdMessage),1)):o.cwdReadonlyMessage?(c(),p("p",Gn,u(o.cwdReadonlyMessage),1)):P("",!0)]),n("label",Xn,[n("span",null,u(a(h)("projectManager.engineField")),1),n("div",Jn,[j(Dt,{"model-value":o.engine,options:o.engineOptions,disabled:o.busy||!o.canEditEngine,placeholder:a(h)("projectManager.selectEngine"),"empty-text":a(h)("projectManager.noEngines"),"get-option-value":m=>(m==null?void 0:m.value)||"","onUpdate:modelValue":y[3]||(y[3]=m=>D("update:engine",m))},{trigger:Pe(({disabled:m})=>{var U;return[n("div",Yn,[n("span",{class:N(["min-w-0 flex-1 truncate",m?"theme-muted-text":"text-[var(--theme-textPrimary)]"])},u(((U=R.value)==null?void 0:U.label)||a(h)("projectManager.selectEngine")),3),R.value&&R.value.enabled===!1?(c(),p("span",Zn,u(a(h)("projectManager.comingSoon")),1)):P("",!0)])]}),option:Pe(({option:m,selected:U,select:I})=>[n("button",{type:"button",class:N(["w-full rounded-sm border border-dashed px-3 py-2 text-left text-sm transition",U?"theme-filter-active":"theme-filter-idle"]),disabled:(m==null?void 0:m.enabled)===!1,onClick:I},[n("div",ts,[n("span",ns,u(m.label),1),(m==null?void 0:m.enabled)===!1?(c(),p("span",ss,u(a(h)("projectManager.comingSoon")),1)):P("",!0)])],10,es)]),_:1},8,["model-value","options","disabled","placeholder","empty-text","get-option-value"])]),o.engineReadonlyMessage?(c(),p("p",as,u(o.engineReadonlyMessage),1)):P("",!0)]),n("label",is,[n("span",null,u(a(h)("projectManager.sessionId")),1),n("div",ls,[n("div",{ref_key:"sessionComboboxRef",ref:F,class:"relative min-w-0 flex-1"},[n("input",{ref_key:"sessionInputRef",ref:E,value:o.sessionId,type:"text",placeholder:"",class:"tool-input min-w-0 w-full pr-9 disabled:cursor-not-allowed disabled:opacity-80",disabled:o.busy||!o.canEditSessionId,onFocus:X,onInput:Y,onKeydown:G},null,40,os),o.canEditSessionId?(c(),p("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:o.busy||!r.value,onClick:V},[o.sessionCandidatesLoading?(c(),fe(a(Ge),{key:0,class:"h-3.5 w-3.5 animate-spin"})):b.value?(c(),fe(a(ft),{key:1,class:"h-3.5 w-3.5",onClick:nt(J,["stop"])})):(c(),fe(a(Kt),{key:2,class:N(["h-3.5 w-3.5 transition",f.value?"rotate-180":""])},null,8,["class"]))],8,rs)):P("",!0),o.canEditSessionId&&f.value?(c(),p("div",us,[n("div",ds,[n("span",cs,u(a(h)("projectManager.sessionCandidates")),1),o.sessionCandidatesLoading?(c(),p("span",fs,u(a(h)("projectManager.sessionCandidatesLoading")),1)):P("",!0)]),k.value.length?(c(),p("div",ps,[(c(!0),p(De,null,ze(k.value,(m,U)=>(c(),p("button",{key:`${m.engine}:${m.id}`,type:"button",class:N(["theme-list-row mb-1 w-full px-2 py-1.5 text-left last:mb-0",U===S.value?"theme-list-item-active":"theme-list-item-hover"]),disabled:o.busy,onMousedown:y[4]||(y[4]=nt(()=>{},["prevent"])),onClick:I=>A(m)},[n("div",ms,[n("span",gs,u(m.label||m.id),1),n("span",hs,u(m.updatedAtLabel||a(h)("projectManager.unknown")),1)])],42,vs))),128))])):(c(),p("div",ys,u(r.value?a(h)("projectManager.noSessionCandidates"):a(h)("projectManager.sessionCandidatesNeedDirectory")),1))])):P("",!0)],512),b.value?(c(),p("button",{key:0,type:"button",class:"tool-button inline-flex shrink-0 items-center gap-2 px-3 py-2 text-xs",disabled:o.busy,onClick:y[5]||(y[5]=m=>D("copy-session-id"))},[o.sessionIdCopied?(c(),fe(a(yt),{key:0,class:"h-4 w-4"})):(c(),fe(a(qt),{key:1,class:"h-4 w-4"})),n("span",null,u(o.sessionIdCopied?a(h)("projectManager.sessionIdCopied"):a(h)("projectManager.copySessionId")),1)],8,xs)):P("",!0)]),o.sessionIdReadonlyMessage?(c(),p("p",bs,u(o.sessionIdReadonlyMessage),1)):(c(),p("p",ws,u(r.value?a(h)("projectManager.sessionIdHint"):a(h)("projectManager.sessionCandidatesNeedDirectory")),1))])]))}},Ss={class:"flex items-center justify-between gap-3"},ks={class:"theme-heading text-sm font-medium"},Cs={key:0,class:"theme-muted-text mt-1 text-xs"},$s=["disabled"],_s=["onClick"],Ms={key:0,class:"theme-selection-indicator absolute inset-y-3 left-0 w-1 rounded-full"},Is={class:"flex w-full flex-col gap-2 text-left"},js={class:"theme-heading min-w-0 text-sm font-medium"},Ps=["title"],Ds=["title"],Rs={class:"theme-muted-text flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] leading-5"},As={key:0,"aria-hidden":"true"},Es={key:1},Ts={class:"flex flex-wrap items-center gap-2 pt-1"},Ls={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:o=>o},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(o,{emit:O}){const _=o,D=O,{t:h}=Ke();function F(S){return _.mode==="edit"&&_.editingSessionId===S.id?"theme-card-selected":_.isSessionRunning(S.id)?"theme-card-warning":"theme-card-idle-strong"}function E(S){return _.isCurrentSession(S.id)?h("projectManager.current"):h("projectManager.regular")}function f(S){return _.isCurrentSession(S.id)?"theme-status-info":"theme-status-neutral"}return(S,R)=>(c(),p("div",{class:N(o.mobile?"flex h-full min-h-0 flex-col":"")},[n("div",Ss,[n("div",null,[n("div",ks,u(a(h)("projectManager.projectList")),1),o.hasSessions?P("",!0):(c(),p("p",Cs,u(a(h)("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:o.busy,onClick:R[0]||(R[0]=r=>D("create"))},[j(a(Vt),{class:"h-4 w-4"}),n("span",null,u(a(h)("projectManager.create")),1)],8,$s)]),n("div",{class:N(["mt-4 space-y-2",o.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),p(De,null,ze(o.sessions,r=>(c(),p("article",{key:r.id,class:N(["relative cursor-pointer rounded-sm border p-3 transition",F(r)]),onClick:b=>D("select",r.id)},[o.mode==="edit"&&o.editingSessionId===r.id?(c(),p("span",Ms)):P("",!0),n("div",Is,[n("div",js,[n("span",{class:"block truncate",title:r.title||a(h)("projectManager.untitledProject")},u(r.title||a(h)("projectManager.untitledProject")),9,Ps)]),n("div",{class:"theme-muted-text break-all font-mono text-[11px] leading-5",title:r.cwd},u(r.cwd),9,Ds),n("div",Rs,[n("span",null,u(a(Je)(r.engine)),1),o.mobile?P("",!0):(c(),p("span",As,"·")),o.mobile?P("",!0):(c(),p("span",Es,u(o.formatUpdatedAt(r.updatedAt)),1))]),n("div",Ts,[n("span",{class:N(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",f(r)])},u(E(r)),3),n("span",{class:N(["inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getRuntimeStatusClass(r.id)])},[o.isSessionRunning(r.id)?(c(),p("span",Ls)):P("",!0),ht(" "+u(o.getRuntimeStatusLabel(r.id)),1)],2),n("span",{class:N(["inline-flex shrink-0 whitespace-nowrap rounded-sm border border-dashed px-1.5 py-0.5 text-[10px]",o.getThreadStatusClass(r)])},u(o.getThreadStatusLabel(r)),3)])])],10,_s))),128))],2)],2))}},Fs={class:"space-y-3"},Bs={class:"dashed-panel px-3 py-3"},Ns={class:"theme-muted-text text-[11px]"},Os={class:"mt-2 flex flex-wrap gap-2"},Us={key:0,class:"h-1.5 w-1.5 rounded-full bg-current animate-pulse"},Hs={key:0,class:"theme-status-info inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs"},zs={class:"dashed-panel px-3 py-3"},Ks={class:"theme-muted-text text-[11px]"},qs={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Vs={class:"dashed-panel px-3 py-3"},Ws={class:"theme-muted-text text-[11px]"},Qs={class:"mt-2 break-all font-mono text-xs leading-6 text-[var(--theme-textPrimary)]"},Gs={class:"dashed-panel px-3 py-3"},Xs={class:"theme-muted-text text-[11px]"},Js={class:"mt-2 text-sm text-[var(--theme-textPrimary)]"},Ys={class:"dashed-panel px-3 py-3"},Zs={class:"theme-muted-text inline-flex items-center gap-2 text-[11px]"},ea={class:"mt-2 text-xs leading-6 text-[var(--theme-textSecondary)]"},ta={__name:"CodexSessionManagerStatus",props:{activeSession:{type:Object,default:null},formatUpdatedAt:{type:Function,default:o=>o},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(o){const{t:O}=Ke();return(_,D)=>{var h,F,E,f,S,R,r;return c(),p("div",Fs,[n("div",Bs,[n("div",Ns,u(a(O)("projectManager.runtimeStatus")),1),n("div",Os,[n("span",{class:N(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getRuntimeStatusClass((h=o.activeSession)==null?void 0:h.id)])},[o.isSessionRunning((F=o.activeSession)==null?void 0:F.id)?(c(),p("span",Us)):P("",!0),ht(" "+u(o.getRuntimeStatusLabel((E=o.activeSession)==null?void 0:E.id)),1)],2),n("span",{class:N(["inline-flex items-center gap-1 rounded-sm border border-dashed px-2 py-1 text-xs",o.getThreadStatusClass(o.activeSession)])},u(o.getThreadStatusLabel(o.activeSession)),3),(f=o.activeSession)!=null&&f.id&&o.isCurrentSession(o.activeSession.id)?(c(),p("span",Hs,u(a(O)("projectManager.currentProject")),1)):P("",!0)])]),n("div",zs,[n("div",Ks,u(a(O)("projectManager.engine")),1),n("div",qs,u(a(Je)((S=o.activeSession)==null?void 0:S.engine)),1)]),n("div",Vs,[n("div",Ws,u(a(O)("projectManager.workingDirectory")),1),n("div",Qs,u(((R=o.activeSession)==null?void 0:R.cwd)||a(O)("projectManager.notSet")),1)]),n("div",Gs,[n("div",Xs,u(a(O)("projectManager.updatedAt")),1),n("div",Js,u(o.formatUpdatedAt((r=o.activeSession)==null?void 0:r.updatedAt)),1)]),n("div",Ys,[n("div",Zs,[j(a(Wt),{class:"h-3.5 w-3.5"}),n("span",null,u(a(O)("projectManager.note")),1)]),n("p",ea,u(a(O)("projectManager.noteDescription")),1)])])}}},na={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},sa={key:0,class:"grid min-h-0 flex-1 gap-0 lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]"},aa={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"},ia={class:"min-h-0 overflow-y-auto px-4 py-4 sm:px-5"},la={class:"flex flex-wrap items-start justify-between gap-3"},oa={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ra={class:"mt-5"},ua={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},da={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"},ca={class:"flex flex-wrap items-center gap-2"},fa=["disabled"],pa=["disabled"],va=["disabled"],ma={class:"flex flex-col-reverse gap-2 sm:flex-row sm:flex-wrap sm:items-center"},ga=["disabled"],ha=["disabled"],ya=["disabled"],xa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},ba={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},wa={class:"min-h-0 flex-1 overflow-hidden px-3 py-3"},Sa={key:1,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},ka={class:"theme-divider flex items-center gap-3 border-b px-4 py-3"},Ca=["disabled"],$a={class:"min-w-0 flex-1"},_a={class:"theme-heading truncate text-sm font-medium"},Ma={key:0,class:"theme-muted-text mt-1 truncate text-xs"},Ia={class:"theme-divider border-b px-4 py-3"},ja={class:"grid grid-cols-2 gap-2"},Pa=["disabled"],Da={class:"min-h-0 flex-1 overflow-y-auto px-4 py-4"},Ra={key:0},Aa={key:0,class:"theme-danger-text mt-4 inline-flex items-center gap-2 text-sm"},Ea={class:"theme-divider mt-6 flex flex-col gap-3 border-t border-dashed pt-4"},Ta=["disabled"],La=["disabled"],Fa=["disabled"],Ba=["disabled"],Na=3e3,Wa={__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(o,{expose:O,emit:_}){const D=new Map;function h(t="",i=""){const g=Qe(t),C=tt(i);return!g||!C?"":`${g}
|
|
2
2
|
${C}`}function F(t=""){if(!t)return null;const i=D.get(t);return i?i.expiresAt<=Date.now()?(D.delete(t),null):Array.isArray(i.items)?i.items:[]:null}function E(t="",i=[]){t&&D.set(t,{expiresAt:Date.now()+Na,items:Array.isArray(i)?i:[]})}const f=o,S=_,{locale:R,t:r}=Ke(),b=M("edit"),Q=M(""),v=Ut({title:"",engine:"codex",cwd:"",sessionId:""}),k=M(""),X=M(!1),H=M(!1),z=M(!1),K=M(!1),V=M(!1),W=M(!1),J=M(!1),Y=M(!1),{matches:A}=Rt("(max-width: 767px)"),G=M("list"),Z=M("basic"),x=M(st()),y=M([]),m=M(!1);let U=null,I=null,te=null,xe=0;const Re=$(()=>Ve(f.sessions)),w=$(()=>f.sessions.find(t=>t.id===Q.value)||null),be=$(()=>f.sessions.length>0),Ye=$(()=>f.sessions.find(t=>t.id===f.selectedSessionId)||null),re=$(()=>!!(w.value&&ne(w.value.id))),we=$(()=>{var t;return!((t=w.value)!=null&&t.started)}),Se=$(()=>{var t;return!((t=w.value)!=null&&t.started)}),ue=$(()=>{var t;return!((t=w.value)!=null&&t.started)}),T=$(()=>f.loading||X.value||H.value||z.value||K.value),Ae=$(()=>String(v.sessionId||"").trim()),ke=$(()=>{var g,C;const t=new Set,i=[];return[v.cwd,(g=w.value)==null?void 0:g.cwd,(C=Ye.value)==null?void 0:C.cwd,...f.workspaces,...f.sessions.map(B=>B.cwd)].forEach(B=>{const L=String(B||"").trim();!L||t.has(L)||(t.add(L),i.push(L))}),i.slice(0,12)}),de=$(()=>x.value),me=$(()=>y.value.map(t=>({...t,updatedAtLabel:t.updatedAt?Me(t.updatedAt):""}))),ge=$(()=>{const t=tt(v.cwd);return t?f.sessions.filter(i=>{var g;return i.id===((g=w.value)==null?void 0:g.id)?!1:tt(i.cwd)===t}):[]}),ee=$(()=>{if(!ge.value.length)return"";const t=ge.value.slice(0,3).map(i=>{const g=i.title||r("projectManager.untitledProject");return R.value==="en-US"?`"${g}"`:`「${g}」`}).join(R.value==="en-US"?", ":"、");return r("projectManager.duplicateDirectory",{labels:t,count:ge.value.length})}),ce=$(()=>b.value!=="edit"||we.value?"":r("projectManager.cwdReadonly")),Ee=$(()=>b.value!=="edit"||!w.value||Se.value?"":r("projectManager.engineReadonly")),he=$(()=>b.value!=="edit"||!w.value||ue.value?"":r("projectManager.sessionIdReadonly")),qe=$(()=>b.value==="create"?X.value?r("projectManager.creatingProject"):r("projectManager.createProject"):H.value?r("projectManager.savingChanges"):r("projectManager.saveChanges")),Ze=$(()=>{var t;return b.value==="create"?r("projectManager.newProject"):((t=w.value)==null?void 0:t.title)||r("projectManager.untitledProject")});function Ce(t=""){const i=Date.parse(String(t||""));return Number.isFinite(i)?i:0}function ne(t){var i;return!!((i=f.sessions.find(g=>g.id===t))!=null&&i.running)}function pe(t){return!!t&&t===f.selectedSessionId}function Ve(t=[]){return[...t].sort((i,g)=>{const C=Number(ne(g.id))-Number(ne(i.id));if(C)return C;const B=Number(pe(g.id))-Number(pe(i.id));if(B)return B;const L=Ce(g.updatedAt)-Ce(i.updatedAt);return L||Tt(String(i.title||i.cwd||i.id),String(g.title||g.cwd||g.id))})}function Te(t){return ne(t)?r("projectManager.running"):r("projectManager.idle")}function $e(t){return ne(t)?"theme-status-warning":"theme-status-success"}function Le(t){return t!=null&&t.started?r("projectManager.threadBound"):r("projectManager.notStarted")}function _e(t){return t!=null&&t.started?"theme-status-success":"theme-status-neutral"}function Me(t=""){if(!t)return r("projectManager.unknown");const i=new Date(t);return Number.isNaN(i.getTime())?t:Et(i.toISOString(),{year:"numeric",month:"numeric",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Fe(t){v.title=String((t==null?void 0:t.title)||""),v.engine=Qe(t==null?void 0:t.engine),v.cwd=String((t==null?void 0:t.cwd)||""),v.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 Ie(){b.value="create",Q.value="",k.value="",v.title="",v.engine="codex",v.cwd="",v.sessionId=""}function se(t){const i=f.sessions.find(g=>g.id===t);i&&(b.value="edit",Q.value=i.id,k.value="",Fe(i))}function je(){var t;return f.selectedSessionId&&f.sessions.some(i=>i.id===f.selectedSessionId)?f.selectedSessionId:((t=Re.value[0])==null?void 0:t.id)||""}function Be(t="basic"){G.value="detail",Z.value=t}function Ne(){G.value="list",Z.value="basic"}function Oe(){Ie(),A.value&&Be("basic")}function Ue(t){T.value||(se(t),A.value&&Be("basic"))}function e(t){v.cwd=String(t||"").trim()}async function l(){var i,g;const t=((i=w.value)==null?void 0:i.id)||je();return!t||((!w.value||w.value.id!==t)&&(se(t),await ve()),!((g=w.value)!=null&&g.cwd))?!1:(A.value&&Be("basic"),S("open-source-browser",w.value),S("close"),!0)}function s(){return V.value?(V.value=!1,!0):W.value?(W.value=!1,!0):J.value?(J.value=!1,!0):f.open?(S("close"),!0):!1}function d(t){v.title=String(t||"")}function q(t){v.engine=Qe(t)}function ae(t){v.cwd=String(t||"")}function ye(t){v.sessionId=String(t||"")}function ie(t){v.sessionId=String((t==null?void 0:t.id)||"").trim()}function le(){k.value="",V.value=!1,W.value=!1,Y.value=!1,Z.value="basic",G.value=A.value?"list":"detail";const t=je();if(t){se(t);return}Ie()}async function We(){if(!(T.value||typeof f.onRefresh!="function")){k.value="";try{await Promise.all([f.onRefresh(),it()])}catch(t){k.value=t.message}}}async function it(){try{x.value=await tn()}catch{x.value=st()}}function et(){I&&(clearTimeout(I),I=null)}function He(){te&&(te.abort(),te=null)}async function xt(){const t=String(v.cwd||"").trim();if(!f.open||!ue.value||!t){y.value=[],m.value=!1,He();return}const i=++xe;He();const g=h(v.engine,t),C=F(g);if(C){y.value=C,m.value=!1;return}te=new AbortController,m.value=!0;try{const B=await At({engine:v.engine,cwd:t,limit:50,signal:te.signal});if(i!==xe)return;const L=Array.isArray(B==null?void 0:B.items)?B.items:[];y.value=L,E(g,L)}catch(B){if((B==null?void 0:B.name)==="AbortError")return;i===xe&&(y.value=[])}finally{i===xe&&(m.value=!1,te=null)}}function lt(t=250){if(et(),!f.open||!ue.value||!String(v.cwd||"").trim()){y.value=[],m.value=!1,He();return}I=setTimeout(()=>{I=null,xt().catch(()=>{})},t)}async function bt(t){var g;if((g=navigator.clipboard)!=null&&g.writeText&&window.isSecureContext){await navigator.clipboard.writeText(t);return}const i=document.createElement("textarea");i.value=t,i.setAttribute("readonly","true"),i.style.position="fixed",i.style.opacity="0",i.style.pointerEvents="none",document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}async function ot(){const t=Ae.value;if(t)try{await bt(t),Y.value=!0,U&&clearTimeout(U),U=setTimeout(()=>{Y.value=!1,U=null},1800)}catch(i){k.value=(i==null?void 0:i.message)||r("projectManager.copySessionIdFailed")}}async function rt(){if(!T.value){k.value="";try{const t=wt();if(!t)return;await St(t)}catch(t){k.value=t.message}}}function wt(){if(b.value==="create"){const i=String(v.cwd||"").trim();return i?{type:"create",cwd:i,payload:{title:v.title,engine:v.engine,cwd:i,sessionId:String(v.sessionId||"").trim()}}:(k.value=r("projectManager.directoryRequired"),null)}if(!w.value)return k.value=r("projectManager.projectMissing"),null;const t={title:v.title,engine:v.engine};return we.value&&(t.cwd=v.cwd),ue.value&&(t.sessionId=String(v.sessionId||"").trim()),{type:"update",sessionId:w.value.id,payload:t}}async function St(t){var i,g;if(t.type==="create"){X.value=!0;try{const C=await((i=f.onCreate)==null?void 0:i.call(f,t.payload));C!=null&&C.id&&(se(C.id),S("select-session",C.id),await ve(),S("project-created",C),S("close"));return}finally{X.value=!1}}H.value=!0;try{const C=await((g=f.onUpdate)==null?void 0:g.call(f,t.sessionId,t.payload));C!=null&&C.id&&se(C.id)}finally{H.value=!1}}async function kt(){var i,g;if(!w.value||z.value)return;const t=w.value.id;k.value="",z.value=!0;try{const C=await((i=f.onDelete)==null?void 0:i.call(f,t));V.value=!1;const B=f.sessions.filter($t=>$t.id!==t),L=(C==null?void 0:C.selectedSessionId)||((g=Ve(B)[0])==null?void 0:g.id)||"";S("select-session",L),L?(se(L),A.value&&Ne()):(Ie(),A.value&&Ne())}catch(C){k.value=C.message}finally{z.value=!1}}async function Ct(){var i;if(!w.value||K.value)return;const t=w.value.id;k.value="",K.value=!0;try{const g=await((i=f.onReset)==null?void 0:i.call(f,t));W.value=!1;const C=(g==null?void 0:g.session)||f.sessions.find(B=>B.id===t)||null;C!=null&&C.id&&se(C.id)}catch(g){k.value=g.message}finally{K.value=!1}}return oe(()=>f.open,t=>{if(t){le(),typeof f.onRefresh=="function"?We().catch(()=>{}):it().catch(()=>{});return}J.value=!1,V.value=!1,W.value=!1,Y.value=!1,k.value="",et(),He(),y.value=[],m.value=!1},{immediate:!0}),oe(A,t=>{t||(G.value="detail")},{immediate:!0}),oe(()=>f.sessions,()=>{if(!f.open)return;if(b.value==="create"){if(!!(String(v.title||"").trim()||String(v.cwd||"").trim())||!!String(v.sessionId||"").trim())return;const g=je();g&&se(g);return}if(w.value){Fe(w.value);return}const t=je();if(t){se(t);return}Ie()}),oe(()=>[f.open,b.value,v.engine,v.cwd,ue.value].join(`
|
|
3
3
|
`),()=>{lt(250)},{immediate:!0}),oe(()=>{var t;return((t=w.value)==null?void 0:t.id)||""},()=>{lt(0)}),at(()=>{U&&(clearTimeout(U),U=null),et(),He()}),O({closeTopDialog:s}),(t,i)=>(c(),p(De,null,[j(ct,{open:W.value,title:a(r)("projectManager.confirmResetTitle"),description:w.value?a(r)("projectManager.confirmResetDescription",{title:w.value.title||a(r)("projectManager.untitledProject")}):"","confirm-text":a(r)("projectManager.confirmReset"),"cancel-text":a(r)("projectManager.keep"),loading:K.value,onCancel:i[0]||(i[0]=g=>W.value=!1),onConfirm:Ct},null,8,["open","title","description","confirm-text","cancel-text","loading"]),j(ct,{open:V.value,title:a(r)("projectManager.confirmDeleteTitle"),description:w.value?a(r)("projectManager.confirmDeleteDescription",{title:w.value.title||a(r)("projectManager.untitledProject")}):"","confirm-text":a(r)("projectManager.confirmDelete"),"cancel-text":a(r)("projectManager.keep"),loading:z.value,danger:"",onCancel:i[1]||(i[1]=g=>V.value=!1),onConfirm:kt},null,8,["open","title","description","confirm-text","cancel-text","loading"]),j(Ln,{open:J.value,"initial-path":v.cwd,suggestions:ke.value,onClose:i[2]||(i[2]=g=>J.value=!1),onSelect:e},null,8,["open","initial-path","suggestions"]),j(gt,{open:o.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:i[12]||(i[12]=g=>S("close"))},{title:Pe(()=>[n("div",na,[j(a(Zt),{class:"h-4 w-4"}),n("span",null,u(a(r)("projectManager.managingTitle")),1)])]),default:Pe(()=>{var g,C,B;return[a(A)?(c(),p("div",xa,[G.value==="list"?(c(),p("div",ba,[n("div",wa,[j(mt,{mobile:"",busy:T.value,"editing-session-id":Q.value,"format-updated-at":Me,"get-runtime-status-class":$e,"get-runtime-status-label":Te,"get-thread-status-class":_e,"get-thread-status-label":Le,"has-sessions":be.value,"is-current-session":pe,"is-session-running":ne,mode:b.value,sessions:Re.value,onCreate:Oe,onSelect:Ue},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])])])):(c(),p("div",Sa,[n("div",ka,[n("button",{type:"button",class:"tool-button inline-flex items-center gap-1.5 px-3 py-2 text-xs",disabled:T.value,onClick:Ne},[j(a(Yt),{class:"h-4 w-4"}),n("span",null,u(a(r)("projectManager.projectList")),1)],8,Ca),n("div",$a,[n("div",_a,u(Ze.value),1),b.value==="edit"&&((C=w.value)!=null&&C.cwd)?(c(),p("p",Ma,u(w.value.cwd),1)):P("",!0)])]),n("div",Ia,[n("div",ja,[n("button",{type:"button",class:N(["tool-button px-3 py-2 text-sm",Z.value==="basic"?"tool-button-accent-subtle":""]),onClick:i[7]||(i[7]=L=>Z.value="basic")},u(a(r)("projectManager.basicInfo")),3),n("button",{type:"button",class:N(["tool-button px-3 py-2 text-sm",Z.value==="status"?"tool-button-accent-subtle":""]),disabled:b.value==="create",onClick:i[8]||(i[8]=L=>Z.value="status")},u(a(r)("projectManager.status")),11,Pa)])]),n("div",Da,[Z.value==="basic"?(c(),p("div",Ra,[j(vt,{mobile:"",busy:T.value,"can-edit-engine":b.value!=="edit"||Se.value,"can-edit-cwd":b.value!=="edit"||we.value,"can-edit-session-id":b.value!=="edit"||ue.value,cwd:v.cwd,"cwd-readonly-message":ce.value,"duplicate-cwd-message":ee.value,engine:v.engine,"engine-options":de.value,"engine-readonly-message":Ee.value,"session-candidates":me.value,"session-candidates-loading":m.value,"session-id":v.sessionId,"session-id-copied":Y.value,"session-id-readonly-message":he.value,title:v.title,"workspace-suggestions":ke.value,onCopySessionId:ot,onOpenDirectoryPicker:i[9]||(i[9]=L=>J.value=!0),onSelectSessionCandidate:ie,"onUpdate:cwd":ae,"onUpdate:engine":q,"onUpdate:sessionId":ye,"onUpdate:title":d},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-candidates","session-candidates-loading","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"]),k.value?(c(),p("p",Aa,[j(a(pt),{class:"h-4 w-4"}),n("span",null,u(k.value),1)])):P("",!0),n("div",Ea,[n("button",{type:"button",class:"tool-button tool-button-primary w-full px-3 py-2 text-sm",disabled:T.value,onClick:rt},u(qe.value),9,Ta),b.value==="edit"&&w.value?(c(),p("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:T.value||!((B=w.value)!=null&&B.cwd),onClick:l},u(a(r)("projectManager.viewSource")),9,La)):P("",!0),b.value==="edit"&&w.value?(c(),p("button",{key:1,type:"button",class:"tool-button w-full px-3 py-2 text-sm",disabled:T.value||re.value,onClick:i[10]||(i[10]=L=>W.value=!0)},u(K.value?a(r)("projectManager.resettingSession"):a(r)("projectManager.newSession")),9,Fa)):P("",!0),b.value==="edit"&&w.value?(c(),p("button",{key:2,type:"button",class:"tool-button tool-button-danger-subtle w-full px-3 py-2 text-sm",disabled:T.value||re.value,onClick:i[11]||(i[11]=L=>V.value=!0)},u(z.value?a(r)("projectManager.deletingProject"):a(r)("projectManager.deleteProject")),9,Ba)):P("",!0)])])):(c(),fe(ta,{key:1,"active-session":w.value,"format-updated-at":Me,"get-runtime-status-class":$e,"get-runtime-status-label":Te,"get-thread-status-class":_e,"get-thread-status-label":Le,"is-current-session":pe,"is-session-running":ne},null,8,["active-session"]))])]))])):(c(),p("div",sa,[n("aside",aa,[j(mt,{busy:T.value,"editing-session-id":Q.value,"format-updated-at":Me,"get-runtime-status-class":$e,"get-runtime-status-label":Te,"get-thread-status-class":_e,"get-thread-status-label":Le,"has-sessions":be.value,"is-current-session":pe,"is-session-running":ne,mode:b.value,sessions:Re.value,onCreate:Oe,onSelect:Ue},null,8,["busy","editing-session-id","has-sessions","mode","sessions"])]),n("div",ia,[n("div",la,[n("div",null,[n("div",oa,[j(a(Qt),{class:"h-4 w-4"}),n("span",null,u(b.value==="create"?a(r)("projectManager.createTitle"):a(r)("projectManager.editTitle")),1)])])]),n("div",ra,[j(vt,{busy:T.value,"can-edit-engine":b.value!=="edit"||Se.value,"can-edit-cwd":b.value!=="edit"||we.value,"can-edit-session-id":b.value!=="edit"||ue.value,cwd:v.cwd,"cwd-readonly-message":ce.value,"duplicate-cwd-message":ee.value,engine:v.engine,"engine-options":de.value,"engine-readonly-message":Ee.value,"session-candidates":me.value,"session-candidates-loading":m.value,"session-id":v.sessionId,"session-id-copied":Y.value,"session-id-readonly-message":he.value,title:v.title,"workspace-suggestions":ke.value,onCopySessionId:ot,onOpenDirectoryPicker:i[3]||(i[3]=L=>J.value=!0),onSelectSessionCandidate:ie,"onUpdate:cwd":ae,"onUpdate:engine":q,"onUpdate:sessionId":ye,"onUpdate:title":d},null,8,["busy","can-edit-engine","can-edit-cwd","can-edit-session-id","cwd","cwd-readonly-message","duplicate-cwd-message","engine","engine-options","engine-readonly-message","session-candidates","session-candidates-loading","session-id","session-id-copied","session-id-readonly-message","title","workspace-suggestions"])]),k.value?(c(),p("p",ua,[j(a(pt),{class:"h-4 w-4"}),n("span",null,u(k.value),1)])):P("",!0),n("div",da,[n("div",ca,[b.value==="edit"&&w.value?(c(),p("button",{key:0,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:T.value||!((g=w.value)!=null&&g.cwd),onClick:l},[j(a(Gt),{class:"h-4 w-4"}),n("span",null,u(a(r)("projectManager.viewSource")),1)],8,fa)):P("",!0),b.value==="edit"&&w.value?(c(),p("button",{key:1,type:"button",class:"tool-button inline-flex items-center gap-2 px-3 py-2 text-xs",disabled:T.value||re.value,onClick:i[4]||(i[4]=L=>W.value=!0)},[j(a(Xt),{class:"h-4 w-4"}),n("span",null,u(K.value?a(r)("projectManager.resettingSession"):a(r)("projectManager.newSession")),1)],8,pa)):P("",!0),b.value==="edit"&&w.value?(c(),p("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||re.value,onClick:i[5]||(i[5]=L=>V.value=!0)},[j(a(Jt),{class:"h-4 w-4"}),n("span",null,u(z.value?a(r)("projectManager.deletingProject"):a(r)("projectManager.deleteProject")),1)],8,va)):P("",!0)]),n("div",ma,[n("button",{type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:T.value,onClick:i[6]||(i[6]=L=>S("close"))},u(a(r)("projectManager.close")),9,ga),b.value==="create"&&be.value?(c(),p("button",{key:0,type:"button",class:"tool-button w-full px-3 py-2 text-xs sm:w-auto",disabled:T.value,onClick:le},u(a(r)("projectManager.backToList")),9,ha)):P("",!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},u(qe.value),9,ya)])])])]))]}),_:1},8,["open","close-disabled","close-on-backdrop","close-on-escape"])],64))}};export{Wa as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{g as Ze,t as D,f as Ke,u as $e,a as et,b as tt}from"./index-Bx48HpZF.js";import{u as st,g as Te,l as at,a as nt,_ as it,r as lt,e as ot,D as De,b as rt,i as dt,c as ut,d as ct,f as ft}from"./WorkbenchView-BdPC47JX.js";import{w as Q,c as J,b as A,n as Je,aD as y,aE as R,aF as n,aR as ce,aS as Fe,aL as j,aQ as f,aG as H,u as t,aW as Ae,aX as ht,aN as Z,ak as mt,aI as Le,aJ as ge,f as vt,a$ as Ne}from"./vendor-misc-u-M8sNMf.js";import{c as gt,j as Be,C as Ve,R as ze,b as pt,i as xt,h as Qe,F as Ue,z as Oe}from"./vendor-ui-C5E3MVzU.js";import"./vendor-router-Dn8q3tJM.js";import"./vendor-markdown-9aQhqbjm.js";import"./vendor-tiptap-rwYdQb1L.js";function de(e,r,l=""){const v=r==="run"?"run":r==="task"?"task":"workspace";return[String(e||"").trim(),v,String(l||"").trim()].join("::")}function kt(e="",r=""){return`${String(e||"").trim()}::${String(r||"").trim()}`}function yt(e=""){return`${String(e||"").trim()}::`}function Xe(e){if(!e||typeof e!="object")return e;try{return JSON.parse(JSON.stringify(e))}catch{return e}}function Ce(e,r){const l=e.get(r);return l?(e.delete(r),e.set(r,l),Xe(l)):null}function He(e,r,l,v=0){for(e.delete(r),e.set(r,Xe(l));v>0&&e.size>v;){const k=e.keys().next().value;if(typeof k>"u")break;e.delete(k)}}function ue(e=""){const r=String(e||"").trim().toUpperCase();return r==="A"||r==="D"?r:"M"}function bt(e=""){const r=String(e||"");if(!r)return[];const l=r.split(`
|
|
2
|
+
`),v=[];let k=0,T=0;return l.forEach((h,d)=>{const _=h.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(_){k=Number(_[1]),T=Number(_[2]),v.push({id:`hunk-${d}`,kind:"hunk",oldNumber:"",newNumber:"",content:h});return}if(h.startsWith("+")&&!h.startsWith("+++")){v.push({id:`line-${d}`,kind:"add",oldNumber:"",newNumber:T,content:h}),T+=1;return}if(h.startsWith("-")&&!h.startsWith("---")){v.push({id:`line-${d}`,kind:"delete",oldNumber:k,newNumber:"",content:h}),k+=1;return}if(h.startsWith(" ")){v.push({id:`line-${d}`,kind:"context",oldNumber:k,newNumber:T,content:h}),k+=1,T+=1;return}v.push({id:`line-${d}`,kind:"meta",oldNumber:"",newNumber:"",content:h})}),v}function wt(e=""){const r=String(e||"").trim();if(!r)return"";const l=r.match(/^当前分支已从 (.+) 切换到 (.+)$/);return l?D("diffReview.warningBranchChanged",{from:l[1],to:l[2]}):r==="当前 HEAD 已不在基线 commit 的后续历史中,仓库可能经历了 reset、rebase 或切分支"?D("diffReview.warningHeadDetachedFromBaseline"):r}function We(e=""){const r=String(e||"").trim();if(!r)return"";const v=new Map([["二进制文件暂不支持在线 diff 预览。","diffReview.binaryPreviewUnavailable"],["文件内容较大,暂不展示具体 diff。","diffReview.fileTooLarge"],["diff 内容较长,暂不在页面内完整展示。","diffReview.diffTooLong"],["当前工作目录不是 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(r);return v?D(v):r}function Ie(e=null){return!e||typeof e!="object"?e:{...e,reason:We(e.reason),warnings:Array.isArray(e.warnings)?e.warnings.map(r=>wt(r)).filter(Boolean):[],files:Array.isArray(e.files)?e.files.map(r=>({...r,message:We(r==null?void 0:r.message)})):[]}}function St(e){const r=A("workspace"),l=A(""),v=A(""),k=A("all"),T=A(""),h=A([]),d=A(null),_=A(!1),I=A(!1),E=A(""),Y=A(!1),G=A(null),N=A(0),U=new Map,ee=st();let b=0,w=0,m="",C="",O="",X=-1;const te=new Map,B=new Map,z=new Map,ie=J(()=>h.value.filter(s=>s.completed)),se=J(()=>{var o;const s={all:0,A:0,M:0,D:0};return(((o=d.value)==null?void 0:o.files)||[]).forEach(p=>{const S=ue(p==null?void 0:p.status);s.all+=1,s[S]+=1}),s}),ae=J(()=>{var p;const s=((p=d.value)==null?void 0:p.files)||[],o=String(T.value||"").trim().toLowerCase();return s.filter(S=>k.value!=="all"&&ue(S==null?void 0:S.status)!==k.value?!1:o?String((S==null?void 0:S.path)||"").toLowerCase().includes(o):!0)}),a=J(()=>{const s=ae.value;return s.find(o=>o.path===v.value)||s[0]||null}),i=J(()=>{var s;return bt(((s=a.value)==null?void 0:s.patch)||"")}),c=J(()=>i.value.map((s,o)=>({...s,index:o})).filter(s=>s.kind==="hunk")),P=J(()=>{var s,o;return I.value&&!((o=(s=d.value)==null?void 0:s.summary)!=null&&o.statsComplete)}),F=J(()=>{var p;const s=((p=d.value)==null?void 0:p.baseline)||null;if(!(s!=null&&s.createdAt)&&!(s!=null&&s.headShort))return"";const o=[];return s.createdAt&&o.push(D("diffReview.baselineTime",{value:Ke(s.createdAt)})),s.branch&&o.push(D("diffReview.baselineBranch",{value:s.branch})),s.headShort&&o.push(D("diffReview.baselineCommit",{value:s.headShort})),s.currentHeadShort&&o.push(D("diffReview.currentHead",{value:s.currentHeadShort})),o.join(" · ")});function W(s){return(s==null?void 0:s.status)==="completed"?D("diffReview.completed"):(s==null?void 0:s.status)==="error"?D("diffReview.failed"):(s==null?void 0:s.status)==="interrupted"?D("diffReview.interrupted"):D("diffReview.stopped")}function u(s,o){if(s){if(o){U.set(s,o);return}U.delete(s)}}function $(s,o={}){const p=c.value;if(!p.length)return;const S=Math.min(Math.max(0,Number(s)||0),p.length-1),q=p[S],M=U.get(q.id);M&&(N.value=S,M.scrollIntoView({block:o.block||"center",behavior:o.behavior||"smooth"}))}function L(s=1){c.value.length&&$(N.value+s)}function fe(s){return`${new Date((s==null?void 0:s.startedAt)||(s==null?void 0:s.createdAt)).toLocaleString(Ze())} · ${W(s)}`}function re(){const s=ie.value;if(!s.length){l.value="";return}s.some(o=>o.id===l.value)||(l.value=s[0].id)}function K(){const s=ae.value;if(!s.length){v.value="";return}s.some(o=>o.path===v.value)||(v.value=s[0].path)}function g(s=""){return ue(s)==="A"?D("diffReview.added"):ue(s)==="D"?D("diffReview.deleted"):D("diffReview.modified")}function pe(s=""){return ue(s)==="A"?"theme-status-success":ue(s)==="D"?"theme-status-danger":"theme-status-warning"}function xe(s="all"){return s==="A"?D("diffReview.added"):s==="D"?D("diffReview.deleted"):s==="M"?D("diffReview.modified"):D("diffReview.all")}function ke(s="all"){return k.value===s?"theme-filter-active":"theme-filter-idle"}function ye(s="context"){return s==="add"?"theme-patch-add":s==="delete"?"theme-patch-delete":s==="hunk"?"theme-patch-hunk":s==="meta"?"theme-patch-meta":"theme-patch-context"}function he(s,o=""){const p=String(o||"").trim();p&&Array.from(s.keys()).forEach(S=>{String(S||"").startsWith(p)&&s.delete(S)})}function x(){const s=yt(e.taskSlug);he(te,s),he(B,s),he(z,s)}async function be(){if(!e.taskSlug){h.value=[],l.value="",O="",X=-1;return}const s=ee.getTaskRunSyncVersion(e.taskSlug);if(O===e.taskSlug&&X===s)return;const o=await at(e.taskSlug,{limit:20,events:"none"});h.value=o.items||[],O=e.taskSlug,X=s,re()}async function ve(){if(!e.taskSlug||!e.active)return;const s=++b;_.value=!0,I.value=!1,E.value="";try{const o=r.value==="run"?"run":r.value==="task"?"task":"workspace";o==="run"&&await be();const p=de(e.taskSlug,o,o==="run"?l.value:"");if(o==="run"&&!l.value){d.value={supported:!1,reason:D("diffReview.noReviewRuns"),repoRoot:"",summary:{fileCount:0,additions:0,deletions:0,statsComplete:!0},files:[]},K();return}const S=Ce(te,p);if(S){d.value=S,m=p;const V=Ce(B,p);V?(d.value={...S,baseline:V.baseline||S.baseline||null,warnings:V.warnings||S.warnings||[],summary:V.summary||S.summary},C=p):C="",K(),we().catch(()=>{}),V||Me().catch(()=>{});return}const q=await Te(e.taskSlug,{scope:o,runId:o==="run"?l.value:"",includeStats:!1});if(s!==b)return;const M=Ie(q);d.value=M,He(te,p,M,36),m=p,C="",K(),we().catch(()=>{}),Me().catch(()=>{})}catch(o){if(s!==b)return;E.value=o.message,d.value=null}finally{s===b&&(_.value=!1)}}async function Me(){var q,M,V;if(!e.taskSlug||!e.active||!((q=d.value)!=null&&q.supported))return;const s=r.value==="run"?"run":r.value==="task"?"task":"workspace",o=s==="run"?l.value:"",p=de(e.taskSlug,s,o);if(C===p&&((V=(M=d.value)==null?void 0:M.summary)!=null&&V.statsComplete))return;const S=Ce(B,p);if(S){d.value={...d.value,baseline:S.baseline||d.value.baseline||null,warnings:S.warnings||d.value.warnings||[],summary:S.summary||d.value.summary},C=p,I.value=!1;return}I.value=!0;try{const le=await Te(e.taskSlug,{scope:s,runId:o,includeFiles:!1,includeStats:!0}),me=de(e.taskSlug,r.value,r.value==="run"?l.value:"");if(p!==me||!d.value)return;const ne=Ie(le);d.value={...d.value,baseline:ne.baseline||d.value.baseline||null,warnings:ne.warnings||d.value.warnings||[],summary:ne.summary||d.value.summary},He(B,p,{baseline:ne.baseline||null,warnings:ne.warnings||[],summary:ne.summary||null},36),C=p}catch{}finally{const le=de(e.taskSlug,r.value,r.value==="run"?l.value:"");p===le&&(I.value=!1)}}async function we(){var me,ne,je;const s=String(v.value||"").trim();if(!e.taskSlug||!e.active||!s||Y.value)return;const o=r.value==="run"?"run":r.value==="task"?"task":"workspace",p=o==="run"?l.value:"",S=de(e.taskSlug,o,p),q=(((me=d.value)==null?void 0:me.files)||[]).find(oe=>oe.path===s);if(!q||q.patchLoaded||q.binary||q.tooLarge||q.message)return;const M=kt(S,s),V=Ce(z,M);if(V&&((ne=d.value)!=null&&ne.files)){d.value={...d.value,files:d.value.files.map(oe=>oe.path===s?V:oe)};return}const le=++w;Y.value=!0;try{const oe=await Te(e.taskSlug,{scope:o,runId:p,filePath:s});if(le!==w)return;const Ye=de(e.taskSlug,r.value,r.value==="run"?l.value:"");if(S!==Ye)return;const Pe=Ie(oe),_e=(Pe.files||[]).find(Re=>Re.path===s);if(!_e||!((je=d.value)!=null&&je.files))return;He(z,M,_e,120),d.value={...d.value,baseline:Pe.baseline||d.value.baseline||null,warnings:Pe.warnings||d.value.warnings||[],files:d.value.files.map(Re=>Re.path===s?_e:Re)}}catch(oe){E.value=oe.message}finally{le===w&&(Y.value=!1,String(v.value||"").trim()!==s&&we().catch(()=>{}))}}function Se({force:s=!1}={}){if(!e.taskSlug||!e.active)return;const o=de(e.taskSlug,r.value,r.value==="run"?l.value:"");!s&&o===m||ve().catch(()=>{})}async function Ee(){!e.taskSlug||!e.active||_.value||(x(),m="",C="",O="",X=-1,await ve())}return Q(()=>[e.taskSlug,e.active,r.value,l.value],([s,o],p=[])=>{const S=p[0]||"";s!==S&&(v.value="",m="",h.value=[],l.value="",O="",X=-1,C=""),!(!s||!o)&&Se()},{immediate:!0}),Q(()=>{var s,o;return[k.value,((o=(s=d.value)==null?void 0:s.files)==null?void 0:o.length)||0]},()=>{K()}),Q(()=>[v.value,c.value.length],()=>{N.value=0,U.clear(),Je(()=>{var s,o;c.value.length?$(0,{behavior:"auto",block:"start"}):(o=(s=G.value)==null?void 0:s.scrollTo)==null||o.call(s,{top:0,behavior:"auto"})})}),Q(()=>v.value,()=>{we().catch(()=>{})},{immediate:!0}),Q(()=>[e.preferredScope,e.preferredRunId,e.focusToken],([s,o,p],S=[])=>{const q=Number(S[2]||0),M=s==="run"?"run":s==="task"?"task":"workspace",V=M==="run"&&o?String(o||""):"",le=r.value!==M,me=M==="run"&&V&&l.value!==V;r.value=M,V&&(l.value=V),M!=="run"&&(l.value=""),!le&&!me&&e.active&&e.taskSlug&&p!==q&&(m="",Se())},{immediate:!0}),Q(()=>ee.readyVersion.value,()=>{!e.active||!e.taskSlug||(O="",X=-1,m="",C="",Se({force:!0}))}),Q(()=>ee.getTaskDiffSyncVersion(e.taskSlug),()=>{!e.active||!e.taskSlug||(O="",X=-1,C="",m="",Se({force:!0}))}),{activeHunkIndex:N,baselineMetaText:F,diffPayload:d,diffScope:r,error:E,fileSearch:T,filteredFiles:ae,getFilterButtonClass:ke,getFilterLabel:xe,getPatchLineClass:ye,getRunStatusLabel:W,getStatusClass:pe,getStatusLabel:g,jumpToAdjacentHunk:L,loadDiff:ve,loading:_,normalizeFileStatus:ue,patchLoading:Y,patchViewportRef:G,runs:h,selectedFile:a,selectedFilePath:v,selectedPatchHunks:c,selectedPatchLines:i,selectedRunId:l,setPatchLineRef:u,showSummarySkeleton:P,statsLoading:I,statusCounts:se,statusFilter:k,terminalRuns:ie,formatRunOptionLabel:fe,refreshDiff:Ee}}const Rt={class:"mb-3 grid grid-cols-2 gap-2"},Ct=["onClick"],Ft={class:"theme-input-shell mb-3 flex items-center gap-2 rounded-sm border px-3 py-2 text-xs text-[var(--theme-textMuted)]"},Lt=["placeholder"],$t={key:0,class:"theme-empty-state theme-empty-state-strong mb-3 px-3 py-2 text-[11px]"},Pt={key:1,class:"theme-empty-state px-3 py-4 text-xs"},_t={key:2,class:"theme-empty-state px-3 py-4 text-xs"},Tt={key:3,class:"space-y-1"},Dt=["onClick","onKeydown"],Ht={class:"min-w-0 flex-1"},It={class:"theme-list-item-title break-all"},At={class:"theme-list-item-meta mt-1"},qe={__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:r}){const l=e,v=r,{t:k}=$e(),T=new Map,h=A(0),d=A(0),_=J({get:()=>l.fileSearch,set:b=>v("update:fileSearch",b)}),I=J({get:()=>l.statusFilter,set:b=>v("update:statusFilter",b)}),E=J(()=>{var b;return Array.isArray((b=l.diffPayload)==null?void 0:b.files)&&l.diffPayload.files.length>0});function Y(b,w){if(w){T.set(b,w);return}T.delete(b)}function G(b){Je(()=>{var m,C;const w=T.get(b);(m=w==null?void 0:w.focus)==null||m.call(w),(C=w==null?void 0:w.scrollIntoView)==null||C.call(w,{block:"nearest",inline:"nearest"})})}function N(){!l.autoFocusSelected||!l.selectedFilePath||h.value===d.value||(d.value=h.value,G(l.selectedFilePath))}function U(b=1,w=""){const m=Array.isArray(l.filteredFiles)?l.filteredFiles:[];if(!m.length)return;const C=m.findIndex(z=>z.path===w),O=m.findIndex(z=>z.path===l.selectedFilePath),te=(Math.max(0,C>=0?C:O)+b+m.length)%m.length,B=m[te];B!=null&&B.path&&(v("select-file",B.path),G(B.path))}function ee(b,w){const m=String((b==null?void 0:b.key)||"");if(m==="ArrowDown"){b.preventDefault(),U(1,w);return}if(m==="ArrowUp"){b.preventDefault(),U(-1,w);return}(m==="Enter"||m===" ")&&w&&(b.preventDefault(),v("select-file",w))}return Q(()=>l.focusToken,b=>{h.value=b,N()},{immediate:!0}),Q(()=>l.selectedFilePath,()=>{N()}),(b,w)=>(y(),R(ce,null,[n("div",Rt,[(y(),R(ce,null,Fe(["all","A","M","D"],m=>n("button",{key:m,type:"button",class:j(["inline-flex w-full items-center justify-center gap-1 whitespace-nowrap rounded-sm border px-2 py-1 text-[11px] transition",e.getFilterButtonClass(m)]),onClick:C=>I.value=m},f(e.getFilterLabel(m))+" "+f(e.statusCounts[m]||0),11,Ct)),64))]),n("label",Ft,[H(t(gt),{class:"h-3.5 w-3.5 shrink-0"}),Ae(n("input",{"onUpdate:modelValue":w[0]||(w[0]=m=>_.value=m),type:"text",placeholder:t(k)("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,Lt),[[ht,_.value]])]),e.showSummarySkeleton?(y(),R("div",$t,f(t(k)("diffReview.statsPending")),1)):Z("",!0),E.value?e.filteredFiles.length?(y(),R("div",Tt,[(y(!0),R(ce,null,Fe(e.filteredFiles,m=>(y(),R("button",{key:m.path,ref_for:!0,ref:C=>Y(m.path,C),type:"button",class:j(["theme-list-row focus:outline-none",m.path===e.selectedFilePath?"theme-list-item-active":"theme-list-item-hover"]),onClick:C=>v("select-file",m.path),onKeydown:C=>ee(C,m.path)},[n("span",{class:j(["theme-list-item-badge",e.getStatusClass(m.status)])},f(e.getStatusLabel(m.status)),3),n("div",Ht,[n("div",It,f(m.path),1),n("div",At,f(m.statsLoaded?`+${m.additions} / -${m.deletions}`:t(k)("diffReview.statsOnDemand")),1)])],42,Dt))),128))])):(y(),R("div",_t,f(t(k)("diffReview.noMatches")),1)):(y(),R("div",Pt,f(t(k)("diffReview.noChanges")),1))],64))}},Mt={key:0,class:"flex h-full min-h-0 flex-col overflow-hidden"},jt={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-[12px]"},Nt={class:"space-y-3 sm:hidden"},Bt={class:"flex items-start gap-2"},Vt={class:"min-w-0 break-all font-medium text-[var(--theme-textPrimary)]"},zt={class:"flex items-center justify-between gap-3"},Ut={class:"min-w-0"},Ot={class:"opacity-75"},Wt={class:"theme-muted-text mt-1 text-[11px]"},qt=["disabled"],Gt={class:"min-w-[64px] text-center text-[12px] text-[var(--theme-textSecondary)]"},Kt=["disabled"],Jt={class:"hidden items-center gap-3 sm:flex"},Qt={class:"flex min-w-0 flex-1 flex-wrap items-center gap-2"},Xt={class:"break-all font-medium text-[var(--theme-textPrimary)]"},Et={class:"opacity-75"},Yt={class:"theme-muted-text text-[11px]"},Zt=["disabled"],es={class:"min-w-[64px] text-center text-[12px] text-[var(--theme-textSecondary)]"},ts=["disabled"],ss={key:0,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},as={class:"theme-empty-state px-4 py-4"},ns={key:1,class:"theme-muted-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},is={class:"task-diff-view min-w-max px-4 py-4 font-mono"},ls=["data-line-id","data-line-kind"],os={class:"task-diff-row__number select-none"},rs={class:"task-diff-row__number select-none"},ds=["innerHTML"],us={key:3,class:"theme-secondary-text flex-1 overflow-y-auto px-4 py-4 text-[12px]"},cs={class:"theme-empty-state px-4 py-4"},fs={key:1,class:"theme-muted-text flex h-full items-center justify-center px-5 text-[12px]"},hs={__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:r}){const l=e,v=r,{t:k}=$e(),{isDark:T}=tt(),h=A([]),d=J(()=>{var a;return dt(((a=l.selectedFile)==null?void 0:a.path)||"")}),_=A(null),I=new Map;function E(a={}){return["add","delete","context"].includes(String((a==null?void 0:a.kind)||"").trim())}function Y(a=""){const i=String(a||"").trim();return i&&h.value.find(c=>c.id===i)||null}const{selectedRows:G,selectionAction:N,clearSelectionState:U,handleSelectionMouseUp:ee,updateSelectionActionFromDom:b}=nt({getContainer:()=>_.value,isActive:()=>!!(l.selectedFile&&l.selectedPatchLines.length),rowSelector:".task-diff-row[data-line-id]",getOrderedRowElements:a=>[...a.querySelectorAll(".task-diff-row[data-line-id]")].filter(i=>E(Y(i.getAttribute("data-line-id")))),mapRowElement:a=>{var i;return Y(((i=a==null?void 0:a.getAttribute)==null?void 0:i.call(a,"data-line-id"))||"")},getCodeLeft:a=>{var W,u,$;const i=(W=a==null?void 0:a.querySelector)==null?void 0:W.call(a,".task-diff-line");if(!i)return 0;const c=(u=i.getBoundingClientRect)==null?void 0:u.call(i),P=($=window.getComputedStyle)==null?void 0:$.call(window,i),F=Number.parseFloat((P==null?void 0:P.paddingLeft)||"0")||0;return((c==null?void 0:c.left)||0)+F},debounceMs:72});function w(a=[]){const i=a.flatMap(F=>[Number((F==null?void 0:F.oldNumber)||0),Number((F==null?void 0:F.newNumber)||0)]).filter(F=>F>0);if(!i.length)return{start:0,end:0,label:""};const c=Math.min(...i),P=Math.max(...i);return{start:c,end:P,label:c===P?`L${c}`:`L${c}-L${P}`}}function m(a=[]){return a.map(i=>String((i==null?void 0:i.content)||"")).join(`
|
|
3
|
+
`).replace(/\u200b/g,"").trim()}function C(){var i,c,P;if(!l.selectedFile||!N.value.visible||!G.value.length)return;const a=w(G.value);v("insert-code-context",{source:"diff",filePath:String(l.selectedFile.path||""),language:"diff",rangeLabel:a.label,lineStart:a.start,lineEnd:a.end,content:m(G.value)||String(N.value.content||"").trim()}),(P=(c=(i=window.getSelection)==null?void 0:i.call(window))==null?void 0:c.removeAllRanges)==null||P.call(c),U()}function O(a,i){if(l.setPatchLineRef(a,i),!!a){if(i){I.set(a,i);return}I.delete(a)}}function X(a){_.value=a||null,l.setPatchViewportRef(a)}function te(a){var $,L,fe,re;const i=($=window.getSelection)==null?void 0:$.call(window),c=_.value;if(!i||i.rangeCount<1||i.isCollapsed||!c)return;b();const F=i.getRangeAt(0).commonAncestorContainer;if(!c.contains((F==null?void 0:F.nodeType)===1?F:F==null?void 0:F.parentNode))return;const W=G.value;if(!W.length)return;const u=m(W);u&&((fe=(L=a==null?void 0:a.clipboardData)==null?void 0:L.setData)==null||fe.call(L,"text/plain",u),(re=a==null?void 0:a.preventDefault)==null||re.call(a))}function B(a){return(a==null?void 0:a.kind)==="add"?"+":(a==null?void 0:a.kind)==="delete"?"-":(a==null?void 0:a.kind)==="context"?" ":""}function z(a){const i=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"?i.slice(1):i}function ie(a=""){return String(a||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function se(a,i=""){if((a==null?void 0:a.kind)==="add"||(a==null?void 0:a.kind)==="delete"||(a==null?void 0:a.kind)==="context"){const c=B(a),P=`task-diff-line__prefix--${a.kind}`;return{...a,renderedHtml:`<span class="task-diff-line__prefix ${P}">${ie(c||" ")}</span><span class="task-diff-line__body">${i||"​"}</span>`}}return{...a,renderedHtml:ie(String((a==null?void 0:a.content)||""))}}async function ae(){const a=Array.isArray(l.selectedPatchLines)?l.selectedPatchLines:[],i=[];a.forEach((u,$)=>{((u==null?void 0:u.kind)==="add"||(u==null?void 0:u.kind)==="delete"||(u==null?void 0:u.kind)==="context")&&i.push({lineIndex:$,body:z(u)})});const c=lt(i.map(u=>u.body));let P=0;if(h.value=a.map(u=>{if((u==null?void 0:u.kind)==="add"||(u==null?void 0:u.kind)==="delete"||(u==null?void 0:u.kind)==="context"){const $=c[P]||"​";return P+=1,se(u,$)}return se(u)}),!i.length||ot(i.map(u=>u.body),De))return;const F=await rt(i.map(u=>u.body),{isDark:T.value,language:d.value,maxHighlightLines:De.maxLines,maxHighlightChars:De.maxChars});let W=0;h.value=a.map(u=>{if((u==null?void 0:u.kind)==="add"||(u==null?void 0:u.kind)==="delete"||(u==null?void 0:u.kind)==="context"){const $=F[W]||"​";return W+=1,se(u,$)}return se(u)})}return Q(()=>{var a;return[l.selectedPatchLines,(a=l.selectedFile)==null?void 0:a.path,T.value]},()=>{U(),ae()},{immediate:!0,deep:!0}),mt(()=>{var a,i,c;(c=(i=(a=window.getSelection)==null?void 0:a.call(window))==null?void 0:i.removeAllRanges)==null||c.call(i),U({clearBrowserSelection:!0}),I.clear()}),(a,i)=>e.selectedFile?(y(),R("div",Mt,[n("div",jt,[n("div",Nt,[n("div",Bt,[n("span",{class:j(["inline-flex shrink-0 rounded-sm border px-1.5 py-0.5 text-[12px]",e.getStatusClass(e.selectedFile.status)])},f(e.getStatusLabel(e.selectedFile.status)),3),n("span",Vt,f(e.selectedFile.path),1)]),n("div",zt,[n("div",Ut,[n("div",Ot,f(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:t(k)("diffReview.statsOnDemand")),1),n("div",Wt,f(t(k)("diffReview.selectCodeLineHint")),1)]),n("div",{class:j(["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:i[0]||(i[0]=c=>e.jumpToAdjacentHunk(-1))},[H(t(Be),{class:"h-4 w-4"})],8,qt),n("span",Gt,f(t(k)("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:i[1]||(i[1]=c=>e.jumpToAdjacentHunk(1))},[H(t(Ve),{class:"h-4 w-4"})],8,Kt)],2)])]),n("div",Jt,[n("div",Qt,[n("span",{class:j(["inline-flex rounded-sm border px-1.5 py-0.5 text-[12px]",e.getStatusClass(e.selectedFile.status)])},f(e.getStatusLabel(e.selectedFile.status)),3),n("span",Xt,f(e.selectedFile.path),1),n("span",Et,f(e.selectedFile.statsLoaded?`+${e.selectedFile.additions} / -${e.selectedFile.deletions}`:t(k)("diffReview.statsOnDemand")),1),n("span",Yt,f(t(k)("diffReview.selectCodeLineHint")),1)]),n("div",{class:j(["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:i[2]||(i[2]=c=>e.jumpToAdjacentHunk(-1))},[H(t(Be),{class:"h-4 w-4"})],8,Zt),n("span",es,f(t(k)("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:i[3]||(i[3]=c=>e.jumpToAdjacentHunk(1))},[H(t(Ve),{class:"h-4 w-4"})],8,ts)],2)])]),e.selectedFile.message?(y(),R("div",ss,[n("div",as,f(e.selectedFile.message),1)])):e.patchLoading&&!e.selectedFile.patchLoaded?(y(),R("div",ns,f(t(k)("diffReview.loadingFileDiff")),1)):e.selectedPatchLines.length?(y(),R("div",{key:2,ref:X,class:"relative flex-1 overflow-auto",onCopy:te,onMouseup:i[4]||(i[4]=(...c)=>t(ee)&&t(ee)(...c))},[n("div",is,[(y(!0),R(ce,null,Fe(h.value,c=>{var P;return y(),R("div",{key:c.id,ref_for:!0,ref:F=>O(c.id,F),class:j(["task-diff-row grid",[e.getPatchLineClass(c.kind),c.kind==="hunk"&&((P=e.selectedPatchHunks[e.activeHunkIndex])==null?void 0:P.id)===c.id?"ring-1 ring-inset ring-[var(--theme-warning)]":""]]),"data-line-id":c.id,"data-line-kind":c.kind},[n("span",os,f(c.oldNumber),1),n("span",rs,f(c.newNumber),1),n("pre",{class:j(["task-diff-line overflow-visible whitespace-pre px-3 py-0.5",c.kind==="meta"||c.kind==="hunk"?"task-diff-line--plain":""]),innerHTML:c.renderedHtml},null,10,ds)],10,ls)}),128))]),t(N).visible?(y(),Le(it,{key:0,top:t(N).top,left:t(N).left,label:t(k)("diffReview.insertSelection"),onClick:C},null,8,["top","left","label"])):Z("",!0)],32)):(y(),R("div",us,[n("div",cs,f(t(k)("diffReview.noFileDiffContent")),1)]))])):(y(),R("div",fs,f(t(k)("diffReview.selectFile")),1))}},Ge=et(hs,[["__scopeId","data-v-58017482"]]),ms={class:"panel flex h-full min-h-0 flex-col overflow-hidden"},vs={class:"theme-divider border-b px-4 py-3"},gs={class:"flex flex-col gap-2"},ps={class:"grid grid-cols-4 gap-2 sm:flex sm:flex-wrap sm:items-center"},xs={class:"sm:hidden"},ks={class:"hidden sm:inline"},ys={class:"sm:hidden"},bs={class:"hidden sm:inline"},ws=["disabled"],Ss={class:"sm:hidden"},Rs={class:"hidden sm:inline"},Cs={class:"truncate text-xs text-[var(--theme-textPrimary)]"},Fs={class:"theme-divider theme-muted-text border-b border-dashed px-3 py-2 text-[11px]"},Ls=["onClick"],$s={class:"flex items-start gap-3"},Ps={class:"min-w-0 flex-1"},_s={class:"truncate text-xs font-medium text-[var(--theme-textPrimary)]"},Ts={class:"theme-muted-text mt-1 text-[11px]"},Ds={key:0,class:"theme-divider theme-danger-text border-b px-4 py-3 text-sm"},Hs={class:"inline-flex items-start gap-2"},Is={class:"break-all"},As={key:1,class:"theme-muted-text flex flex-1 items-center justify-center px-5 text-sm"},Ms={key:2,class:"flex flex-1 items-center justify-center px-5"},js={class:"theme-empty-state w-full max-w-xl px-4 py-5 text-sm text-[var(--theme-textSecondary)]"},Ns={class:"theme-heading inline-flex items-center gap-2 font-medium"},Bs={class:"mt-2 break-all leading-7"},Vs={key:0,class:"mt-3 flex flex-wrap gap-2 text-xs"},zs={class:"theme-status-neutral inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Us={class:"break-all"},Os={key:0,class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Ws={key:3,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},qs={class:"theme-divider theme-secondary-text border-b px-4 py-3 text-xs"},Gs={class:"flex flex-wrap items-center gap-2"},Ks={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"},Js={class:"min-w-0 break-all"},Qs={class:"theme-status-success inline-flex items-center gap-2 rounded-sm border border-dashed px-2.5 py-1.5"},Xs={class:"text-[var(--theme-textPrimary)]"},Es={class:"font-medium text-[var(--theme-success)]"},Ys={class:"font-medium text-[var(--theme-danger)]"},Zs={key:2,class:"opacity-75"},ea={key:0,class:"mt-2 break-all text-[11px] opacity-75"},ta={key:1,class:"mt-2 flex flex-col gap-1"},sa={key:0,class:"flex min-h-0 flex-1 flex-col overflow-hidden"},aa={class:"theme-divider border-b px-3 py-3"},na={class:"grid grid-cols-2 gap-2"},ia=["disabled"],la={class:"theme-divider theme-muted-panel min-h-0 flex-1 overflow-y-auto p-3"},oa={class:"min-h-0 flex-1 overflow-hidden bg-[var(--theme-appPanelStrong)]"},ra={key:1,class:"grid min-h-0 flex-1 grid-cols-[320px_minmax(0,1fr)] overflow-hidden"},da={class:"theme-divider theme-muted-panel min-h-0 overflow-y-auto border-r p-3"},ua={class:"min-h-0 overflow-hidden bg-[var(--theme-appPanelStrong)]"},ca={__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:r}){const l=e,v=r,{activeHunkIndex:k,baselineMetaText:T,diffPayload:h,diffScope:d,error:_,fileSearch:I,filteredFiles:E,formatRunOptionLabel:Y,getFilterButtonClass:G,getFilterLabel:N,getPatchLineClass:U,getRunStatusLabel:ee,getStatusClass:b,getStatusLabel:w,jumpToAdjacentHunk:m,loading:C,patchLoading:O,patchViewportRef:X,refreshDiff:te,selectedFile:B,selectedFilePath:z,selectedPatchHunks:ie,selectedPatchLines:se,selectedRunId:ae,setPatchLineRef:a,showSummarySkeleton:i,statsLoading:c,statusCounts:P,statusFilter:F,terminalRuns:W}=St(l),{matches:u}=ut("(max-width: 767px)"),$=A("files"),{t:L}=$e();function fe(K){z.value=K,u.value&&($.value="patch")}function re(K){X.value=K||null}return Q(u,K=>{K||($.value="files")},{immediate:!0}),Q(z,K=>{!K&&u.value&&($.value="files")}),Q(d,()=>{u.value&&($.value="files")}),(K,g)=>{var pe,xe,ke,ye,he;return y(),R("section",ms,[n("div",vs,[n("div",gs,[n("div",ps,[n("button",{type:"button",class:j(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(d)==="workspace"?"theme-filter-active":""]),onClick:g[0]||(g[0]=x=>d.value="workspace")},[n("span",xs,f(t(L)("diffReview.scopeCurrentShort")),1),n("span",ks,f(t(L)("diffReview.scopeCurrent")),1)],2),n("button",{type:"button",class:j(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(d)==="task"?"theme-filter-active":""]),onClick:g[1]||(g[1]=x=>d.value="task")},[n("span",ys,f(t(L)("diffReview.scopeTaskShort")),1),n("span",bs,f(t(L)("diffReview.scopeTask")),1)],2),n("button",{type:"button",class:j(["tool-button inline-flex items-center justify-center gap-2 px-3 py-2 text-xs",t(d)==="run"?"theme-filter-active":""]),onClick:g[2]||(g[2]=x=>d.value="run")},[n("span",null,f(t(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:t(C),onClick:g[3]||(g[3]=(...x)=>t(te)&&t(te)(...x))},[H(t(ze),{class:j(["h-3.5 w-3.5 sm:hidden",t(C)?"animate-spin":""])},null,8,["class"]),n("span",Ss,f(t(L)("diffReview.refresh")),1),H(t(ze),{class:j(["hidden h-3.5 w-3.5 sm:inline-block",t(C)?"animate-spin":""])},null,8,["class"]),n("span",Rs,f(t(C)?t(L)("diffReview.refreshing"):t(c)?t(L)("diffReview.computing"):t(L)("diffReview.refresh")),1)],8,ws)]),t(d)==="run"?(y(),Le(ct,{key:0,modelValue:t(ae),"onUpdate:modelValue":g[4]||(g[4]=x=>vt(ae)?ae.value=x:null),class:"min-w-0 sm:max-w-[360px]",options:t(W),loading:t(C),"get-option-value":x=>(x==null?void 0:x.id)||"",placeholder:t(L)("diffReview.selectRun"),"empty-text":t(L)("diffReview.noRuns")},{trigger:ge(({selectedOption:x})=>[n("div",Cs,f(x?t(Y)(x):t(L)("diffReview.selectRun")),1)]),header:ge(()=>[n("div",Fs,f(t(L)("diffReview.runCount",{count:t(W).length})),1)]),option:ge(({option:x,selected:be,select:ve})=>[n("button",{type:"button",class:j(["w-full rounded-sm border border-dashed px-3 py-2 text-left transition",be?"theme-filter-active":"theme-filter-idle"]),onClick:ve},[n("div",$s,[n("div",Ps,[n("div",_s,f(t(Ke)(x.startedAt||x.createdAt)),1),n("div",Ts,f(t(ee)(x)),1)]),be?(y(),Le(t(pt),{key:0,class:"mt-0.5 h-4 w-4 shrink-0 text-[var(--theme-textSecondary)]"})):Z("",!0)])],10,Ls)]),_:1},8,["modelValue","options","loading","get-option-value","placeholder","empty-text"])):Z("",!0)])]),t(_)?(y(),R("div",Ds,[n("div",Hs,[H(t(xt),{class:"mt-0.5 h-4 w-4 shrink-0"}),n("span",Is,f(t(_)),1)])])):Z("",!0),t(C)&&!t(h)?(y(),R("div",As,f(t(L)("diffReview.loading")),1)):t(h)&&!t(h).supported?(y(),R("div",Ms,[n("div",js,[n("div",Ns,[H(t(Qe),{class:"h-4 w-4"}),n("span",null,f(t(L)("diffReview.unavailableTitle")),1)]),n("p",Bs,f(t(h).reason||t(L)("diffReview.unavailableReason")),1),t(h).repoRoot?(y(),R("div",Vs,[n("div",zs,[H(t(Ue),{class:"h-3.5 w-3.5 shrink-0"}),n("span",Us,f(t(h).repoRoot),1)]),t(h).branch?(y(),R("div",Os,[H(t(Oe),{class:"h-3.5 w-3.5 shrink-0"}),n("span",null,f(t(h).branch),1)])):Z("",!0)])):Z("",!0)])])):t(h)?(y(),R("div",Ws,[n("div",qs,[n("div",Gs,[t(h).repoRoot?(y(),R("div",Ks,[H(t(Ue),{class:"h-3.5 w-3.5 shrink-0"}),n("span",Js,f(t(h).repoRoot),1)])):Z("",!0),n("div",Qs,[H(t(Oe),{class:"h-3.5 w-3.5 shrink-0"}),n("span",null,f(t(h).branch||t(L)("diffReview.unknownBranch")),1),g[18]||(g[18]=n("span",{class:"opacity-50"},"•",-1)),n("span",Xs,f(t(L)("diffReview.fileCount",{count:((pe=t(h).summary)==null?void 0:pe.fileCount)||0})),1),(xe=t(h).summary)!=null&&xe.statsComplete?(y(),R(ce,{key:0},[g[14]||(g[14]=n("span",{class:"opacity-50"},"•",-1)),n("span",Es,"+"+f(((ke=t(h).summary)==null?void 0:ke.additions)||0),1),n("span",Ys,"-"+f(((ye=t(h).summary)==null?void 0:ye.deletions)||0),1)],64)):t(i)?(y(),R(ce,{key:1},[g[15]||(g[15]=n("span",{class:"opacity-50"},"•",-1)),g[16]||(g[16]=n("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-successSoft)]"},null,-1)),g[17]||(g[17]=n("span",{class:"h-3 w-10 animate-pulse rounded bg-[var(--theme-dangerSoft)]"},null,-1))],64)):(y(),R("span",Zs,f(t(L)("diffReview.waitingStats")),1))])]),t(T)?(y(),R("p",ea,f(t(T)),1)):Z("",!0),(he=t(h).warnings)!=null&&he.length?(y(),R("div",ta,[(y(!0),R(ce,null,Fe(t(h).warnings,x=>(y(),R("p",{key:x,class:"text-[11px] text-[var(--theme-warningText)]"},f(x),1))),128))])):Z("",!0)]),t(u)?(y(),R("div",sa,[n("div",aa,[n("div",na,[n("button",{type:"button",class:j(["tool-button px-3 py-2 text-sm",$.value==="files"?"tool-button-accent-subtle":""]),onClick:g[5]||(g[5]=x=>$.value="files")},f(t(L)("diffReview.filesTab")),3),n("button",{type:"button",class:j(["tool-button px-3 py-2 text-sm",$.value==="patch"?"tool-button-accent-subtle":""]),disabled:!t(B),onClick:g[6]||(g[6]=x=>$.value="patch")},f(t(L)("diffReview.diffTab")),11,ia)])]),Ae(n("div",la,[H(qe,{"auto-focus-selected":e.active&&$.value==="files","diff-payload":t(h),"file-search":t(I),"focus-token":e.focusToken,"filtered-files":t(E),"get-filter-button-class":t(G),"get-filter-label":t(N),"get-status-class":t(b),"get-status-label":t(w),"selected-file-path":t(z),"show-summary-skeleton":t(i),"status-counts":t(P),"status-filter":t(F),"onUpdate:fileSearch":g[7]||(g[7]=x=>I.value=x),"onUpdate:statusFilter":g[8]||(g[8]=x=>F.value=x),onSelectFile:fe},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),[[Ne,$.value==="files"]]),Ae(n("div",oa,[H(Ge,{"active-hunk-index":t(k),"get-patch-line-class":t(U),"get-status-class":t(b),"get-status-label":t(w),"jump-to-adjacent-hunk":t(m),"patch-loading":t(O),"selected-file":t(B),"selected-patch-hunks":t(ie),"selected-patch-lines":t(se),"set-patch-line-ref":t(a),"set-patch-viewport-ref":re,onInsertCodeContext:g[9]||(g[9]=x=>v("insert-code-context",x))},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),[[Ne,$.value==="patch"]])])):(y(),R("div",ra,[n("div",da,[H(qe,{"auto-focus-selected":e.active,"diff-payload":t(h),"file-search":t(I),"focus-token":e.focusToken,"filtered-files":t(E),"get-filter-button-class":t(G),"get-filter-label":t(N),"get-status-class":t(b),"get-status-label":t(w),"selected-file-path":t(z),"show-summary-skeleton":t(i),"status-counts":t(P),"status-filter":t(F),"onUpdate:fileSearch":g[10]||(g[10]=x=>I.value=x),"onUpdate:statusFilter":g[11]||(g[11]=x=>F.value=x),onSelectFile:g[12]||(g[12]=x=>z.value=x)},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",ua,[H(Ge,{"active-hunk-index":t(k),"get-patch-line-class":t(U),"get-status-class":t(b),"get-status-label":t(w),"jump-to-adjacent-hunk":t(m),"patch-loading":t(O),"selected-file":t(B),"selected-patch-hunks":t(ie),"selected-patch-lines":t(se),"set-patch-line-ref":t(a),"set-patch-viewport-ref":re,onInsertCodeContext:g[13]||(g[13]=x=>v("insert-code-context",x))},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"])])]))])):Z("",!0)])}}},fa={class:"theme-heading inline-flex items-center gap-2 text-sm font-medium"},ya={__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:r}){const l=e,v=r,{t:k}=$e(),T=J(()=>{const d=String(l.taskTitle||"").trim();return d?k("diffReview.dialogTitleWithTask",{title:d}):k("diffReview.dialogTitle")});function h(d){v("insert-code-context",d),v("close")}return(d,_)=>(y(),Le(ft,{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:_[0]||(_[0]=I=>v("close"))},{title:ge(()=>[n("div",fa,[H(t(Qe),{class:"h-4 w-4"}),n("span",null,f(T.value),1)])]),default:ge(()=>[H(ca,{"task-slug":e.taskSlug,active:e.open,"preferred-scope":e.preferredScope,"preferred-run-id":e.preferredRunId,"focus-token":e.focusToken,onInsertCodeContext:h},null,8,["task-slug","active","preferred-scope","preferred-run-id","focus-token"])]),_:1},8,["open"]))}};export{ya as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.task-diff-row[data-v-58017482]{grid-template-columns:3.1rem 3.1rem minmax(0,1fr)}.task-diff-view[data-v-58017482]{font-size:var(--theme-codeViewFontSize);line-height:var(--theme-codeViewLineHeight)}.task-diff-row__number[data-v-58017482]{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-58017482]{color:inherit;-moz-user-select:text;user-select:text;-webkit-user-select:text}.task-diff-line[data-v-58017482] .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-58017482] .task-diff-line__prefix--add{color:var(--theme-successText)}.task-diff-line[data-v-58017482] .task-diff-line__prefix--delete{color:var(--theme-dangerText)}.task-diff-line[data-v-58017482] .task-diff-line__prefix--context{color:color-mix(in srgb,var(--theme-textPrimary) 35%,transparent)}.task-diff-line[data-v-58017482] .task-diff-line__body{display:inline}.task-diff-line--plain[data-v-58017482]{color:inherit}
|