codexui-android 0.1.85 → 0.1.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ReviewPane-BYXF27M-.js → ReviewPane-CwRK6K44.js} +2 -2
- package/dist/assets/{ReviewPane-BYXF27M-.js.map → ReviewPane-CwRK6K44.js.map} +1 -1
- package/dist/assets/{SkillsHub-GpJ2Lrm3.js → SkillsHub-BIRLBCzr.js} +2 -2
- package/dist/assets/{SkillsHub-GpJ2Lrm3.js.map → SkillsHub-BIRLBCzr.js.map} +1 -1
- package/dist/assets/{ThreadConversation-BsN7bN3q.css → ThreadConversation-BKfO22g2.css} +1 -1
- package/dist/assets/ThreadConversation-DymdJ3Hs.js +40 -0
- package/dist/assets/ThreadConversation-DymdJ3Hs.js.map +1 -0
- package/dist/assets/index-Bn_MPBwp.js +92 -0
- package/dist/assets/index-Bn_MPBwp.js.map +1 -0
- package/dist/assets/{index-iN-aqOuT.css → index-C_knKlTI.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-cli/{chunk-JQMCS7KJ.js → chunk-PUR7OUAG.js} +41 -36
- package/dist-cli/chunk-PUR7OUAG.js.map +1 -0
- package/dist-cli/index.js +724 -139
- package/dist-cli/index.js.map +1 -1
- package/dist-cli/instrument.js +1 -1
- package/package.json +10 -4
- package/dist/assets/ThreadConversation-BNp42k0F.js +0 -40
- package/dist/assets/ThreadConversation-BNp42k0F.js.map +0 -1
- package/dist/assets/index-CWwHJTfC.js +0 -92
- package/dist/assets/index-CWwHJTfC.js.map +0 -1
- package/dist-cli/chunk-JQMCS7KJ.js.map +0 -1
package/dist-cli/instrument.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codexui-android",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.89",
|
|
4
4
|
"description": "A lightweight web interface for Codex that runs on top of the Codex app-server, allowing remote access from any browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,9 +35,11 @@
|
|
|
35
35
|
"dist-cli/"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@sentry/
|
|
40
|
-
"@sentry/
|
|
38
|
+
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
39
|
+
"@sentry/node": "10.48.0",
|
|
40
|
+
"@sentry/opentelemetry": "10.48.0",
|
|
41
|
+
"@sentry/profiling-node": "10.48.0",
|
|
42
|
+
"@sentry/vue": "10.48.0",
|
|
41
43
|
"commander": "^13.1.0",
|
|
42
44
|
"express": "^5.1.0",
|
|
43
45
|
"firebase": "^12.2.1",
|
|
@@ -63,6 +65,10 @@
|
|
|
63
65
|
"vue-router": "^4.6.4",
|
|
64
66
|
"vue-tsc": "^2.2.0"
|
|
65
67
|
},
|
|
68
|
+
"overrides": {
|
|
69
|
+
"@opentelemetry/semantic-conventions": "1.40.0",
|
|
70
|
+
"@sentry/opentelemetry": "10.48.0"
|
|
71
|
+
},
|
|
66
72
|
"scripts": {
|
|
67
73
|
"dev": "pnpm install && CODEXUI_SANDBOX_MODE=danger-full-access CODEXUI_APPROVAL_POLICY=never vite",
|
|
68
74
|
"dev:open": "pnpm run build:cli && sh -c 'pnpm run dev & VPID=$!; node dist-cli/index.js --open-project \"${1:-.}\"; wait $VPID' --",
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{_ as yt,o as r,c as l,a as u,d as As,u as Bs,r as x,w as J,n as mt,b as Fs,e as Es,t as h,f as k,F as g,g as w,h as C,i as Rs,j as xn,k as Ws,l as vt,m as Y,I as Os,p as zs,q as Cn,s as He,v as kt,x as Q,T as js,y as L,z as Hs}from"./index-CWwHJTfC.js";const Ds={},Ns={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Vs(T,D){return r(),l("svg",Ns,[...D[0]||(D[0]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const Us=yt(Ds,[["render",Vs]]),qs={},Ks={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Zs(T,D){return r(),l("svg",Ks,[...D[0]||(D[0]=[u("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Gs=yt(qs,[["render",Zs]]),Xs={key:0,class:"conversation-loading"},Js={key:1,class:"conversation-empty"},Ys={key:0,class:"conversation-load-more"},Qs=["disabled"],ei=["data-role","data-message-type"],ti={key:0,class:"message-row","data-role":"system"},ni={class:"message-stack","data-role":"system"},si=["onClick"],ii={class:"cmd-group-label"},oi={class:"cmd-status"},ai={class:"cmd-group-inner"},ri=["onClick"],li={class:"cmd-label"},ci={class:"cmd-status"},ui={class:"cmd-output-inner"},di=["textContent"],fi=["onClick"],hi={class:"cmd-label"},pi={class:"cmd-status"},mi={class:"cmd-output-inner"},vi=["textContent"],ki=["data-role","data-message-type"],gi=["data-role"],yi=["data-role"],_i={key:0,class:"file-change-summary-block"},wi=["onClick"],bi={class:"file-change-summary-label"},xi={class:"file-change-summary-status"},Ci=["data-tone"],$i={class:"file-change-panel-inner"},Li={class:"file-change-list"},Ti=["data-operation"],Mi=["title","onClick"],Si={key:0,class:"file-change-arrow"},Ii=["title","onClick"],Pi={key:2,class:"file-change-delta"},Ai=["data-tone"],Bi=["data-role","data-message-type"],Fi=["data-role"],Ei=["data-role"],Ri=["data-role"],Wi=["onClick"],Oi=["src"],zi={key:1,class:"message-file-attachments"},ji=["href","title"],Hi=["data-role"],Di={key:0,class:"worked-separator-wrap","aria-live":"polite"},Ni=["onClick"],Vi={class:"worked-separator-text"},Ui={key:0,class:"worked-details"},qi=["onClick"],Ki={class:"cmd-label"},Zi={class:"cmd-status"},Gi={class:"cmd-output-inner"},Xi=["textContent"],Ji=["data-streaming"],Yi={class:"plan-card-header"},Qi={key:0,class:"plan-card-badge"},eo=["innerHTML"],to={key:1,class:"plan-step-list"},no=["data-status"],so=["data-status"],io=["innerHTML"],oo=["innerHTML"],ao={key:2,class:"message-text-flow"},ro={key:0,class:"message-text"},lo={key:0},co={key:1,class:"message-bold-text"},uo={key:2,class:"message-italic-text"},fo={key:3,class:"message-strikethrough-text"},ho=["href","title"],po=["href","title"],mo={key:6,class:"message-inline-code"},vo={key:0},ko={key:1,class:"message-bold-text"},go={key:2,class:"message-italic-text"},yo={key:3,class:"message-strikethrough-text"},_o=["href","title"],wo=["href","title"],bo={key:6,class:"message-inline-code"},xo={key:2,class:"message-blockquote"},Co={key:0},$o={key:1,class:"message-bold-text"},Lo={key:2,class:"message-italic-text"},To={key:3,class:"message-strikethrough-text"},Mo=["href","title"],So=["href","title"],Io={key:6,class:"message-inline-code"},Po={key:3,class:"message-list message-list-unordered"},Ao=["innerHTML"],Bo={key:4,class:"message-list message-task-list"},Fo=["data-checked"],Eo={class:"message-list-item-text"},Ro={key:0},Wo={key:1,class:"message-bold-text"},Oo={key:2,class:"message-italic-text"},zo={key:3,class:"message-strikethrough-text"},jo=["href","title"],Ho=["href","title"],Do={key:6,class:"message-inline-code"},No=["start"],Vo=["innerHTML"],Uo={key:6,class:"message-table-wrap"},qo={class:"message-table"},Ko={key:0},Zo={key:1,class:"message-bold-text"},Go={key:2,class:"message-italic-text"},Xo={key:3,class:"message-strikethrough-text"},Jo=["href","title"],Yo=["href","title"],Qo={key:6,class:"message-inline-code"},ea={key:0},ta={key:0},na={key:1,class:"message-bold-text"},sa={key:2,class:"message-italic-text"},ia={key:3,class:"message-strikethrough-text"},oa=["href","title"],aa=["href","title"],ra={key:6,class:"message-inline-code"},la={key:7,class:"message-code-block"},ca={key:0,class:"message-code-language"},ua={class:"message-code-pre"},da=["innerHTML"],fa={key:8,class:"message-divider"},ha={key:9,class:"message-text"},pa=["onClick"],ma=["src","alt","onError"],va={key:3,class:"file-change-summary-block file-change-summary-block-inline"},ka=["onClick"],ga={class:"file-change-summary-label"},ya={class:"file-change-summary-status"},_a=["data-tone"],wa={class:"file-change-panel-inner"},ba={class:"file-change-list"},xa=["data-operation"],Ca=["title","onClick"],$a={key:0,class:"file-change-arrow"},La=["title","onClick"],Ta={key:2,class:"file-change-delta"},Ma=["data-tone"],Sa=["data-role"],Ia=["onClick"],Pa=["onClick"],Aa=["data-copied","aria-label","title","onClick"],Ba={class:"message-copy-label"},Fa={key:1,class:"conversation-item conversation-item-overlay"},Ea={class:"message-row"},Ra={class:"message-stack"},Wa={class:"live-overlay-inline","aria-live":"polite"},Oa={class:"live-overlay-label"},za={key:0,class:"live-overlay-reasoning"},ja={key:1,class:"live-overlay-error"},Ha=["src"],Da={key:0,class:"diff-viewer-sidebar"},Na={class:"diff-viewer-sidebar-header"},Va={class:"diff-viewer-sidebar-count"},Ua={class:"diff-viewer-sidebar-list"},qa=["data-active","onClick"],Ka=["data-operation"],Za={class:"diff-viewer-file-label"},Ga={key:0,class:"diff-viewer-file-delta"},Xa={class:"diff-viewer-main"},Ja={class:"diff-viewer-toolbar"},Ya={class:"diff-viewer-title-wrap"},Qa={class:"diff-viewer-title"},er={class:"diff-viewer-subtitle"},tr={key:0},nr={class:"diff-viewer-toolbar-actions"},sr={key:0,class:"diff-viewer-empty"},ir={key:1,class:"diff-viewer-panel"},or={class:"diff-viewer-meta"},ar={class:"diff-viewer-language"},rr={class:"diff-viewer-lines"},lr=["data-kind"],cr={class:"diff-viewer-line-number"},ur={class:"diff-viewer-line-number"},dr={class:"diff-viewer-line-marker"},fr=["innerHTML"],hr={class:"diff-viewer-mobile-sheet-header"},pr={class:"diff-viewer-sidebar-count"},mr={class:"diff-viewer-mobile-sheet-list"},vr=["data-active","onClick"],kr=["data-operation"],gr={class:"diff-viewer-file-label"},yr={key:0,class:"diff-viewer-file-delta"},_r=16,gt=50,wr=30,br=200,xr=As({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{}},emits:["updateScrollState","forkThread","rollback","respondServerRequest"],setup(T,{expose:D,emit:$n}){var bn;const ce=x(new Set),O=x(new Set),ue=x(new Set),De=x(new Set),de=x(new Set),Ne=x(null),ge=x(""),N=x(!1),_t=x(null),fe=x(!1),wt=x(0),bt=x(0),Ve=x(""),Ue=x(""),{isMobile:ye}=Bs();function Ln(e){var i;const n=e.replace(/\r\n/g,`
|
|
2
|
-
`).trim();if(!n)return null;const t=[],s=[];for(const a of n.split(`
|
|
3
|
-
`)){const d=a.trim();if(!d){t.length===0&&s.push("");continue}const o=d.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(o){const f=(o[1]??" ").toLowerCase();let c="pending";f==="x"&&(c="completed"),(f==="~"||f===">"||f==="-")&&(c="inProgress"),t.push({step:((i=o[2])==null?void 0:i.trim())??"",status:c});continue}s.push(d)}return t.length===0?null:{explanation:s.join(`
|
|
4
|
-
`).trim(),steps:t.filter(a=>a.step.length>0)}}function qe(e){var n;return e.plan&&e.plan.steps.length>0?{explanation:((n=e.plan.explanation)==null?void 0:n.trim())??"",steps:e.plan.steps}:Ln(e.text)}function A(e){return e.messageType==="commandExecution"&&!!e.commandExecution}function xt(e){return e.messageType==="plan"||e.messageType==="plan.live"}function Ke(e){return e.messageType==="fileChange"&&e.fileChangeStatus==="completed"&&Array.isArray(e.fileChanges)&&e.fileChanges.length>0}function he(e){return e.role==="assistant"&&!A(e)&&e.messageType!=="worked"&&!(e.messageType??"").endsWith(".live")}const Ze=L(()=>{var e;for(let n=v.messages.length-1;n>=0;n-=1){const t=v.messages[n];if(t.messageType==="commandExecution"&&((e=t.commandExecution)==null?void 0:e.status)==="inProgress")return t.id}return""}),Ct=L(()=>v.messages.some(e=>e.role==="assistant"&&e.messageType==="agentMessage.live"&&e.text.trim().length>0)),$t=L(()=>!!v.liveOverlay||Ze.value.length>0||Ct.value),Ge=L(()=>{const e={};for(let n=0;n<v.messages.length;){const t=v.messages[n];if(!A(t)){n+=1;continue}const s=[];for(;n<v.messages.length&&A(v.messages[n]);)s.push(v.messages[n]),n+=1;if(s.length<=1)continue;const i=s[s.length-1];e[i.id]=s.slice(0,-1)}return e}),Tn=L(()=>{const e=new Set;for(const n of Object.values(Ge.value))for(const t of n)e.add(t.id);return e});function Lt(e){var n;return((n=qe(e))==null?void 0:n.explanation)??""}function Tt(e){var n;return((n=qe(e))==null?void 0:n.steps)??[]}function Mn(e){switch(e){case"completed":return"✓";case"inProgress":return"•";default:return"○"}}function Mt(e){return!Ct.value&&e.id===Ze.value}function B(e){return A(e)?ce.value.has(e.id)||!O.value.has(e.id)&&Mt(e):!1}function Xe(e){return A(e)&&$t.value}function Je(e){var n;return A(e)&&($t.value||((n=e.commandExecution)==null?void 0:n.status)==="inProgress")}function Ye(e){if(!A(e))return;const n=new Set(ce.value),t=new Set(O.value),s=Mt(e);n.has(e.id)?(n.delete(e.id),s&&t.add(e.id)):s&&!t.has(e.id)?t.add(e.id):(n.add(e.id),t.delete(e.id)),ce.value=n,O.value=t}function _e(e){return Ge.value[e.id]??[]}function St(e){return A(e)?[..._e(e),e]:[]}function Sn(e){if(_e(e).length===0)return;const t=new Set(ue.value);t.has(e.id)?t.delete(e.id):t.add(e.id),ue.value=t}function Qe(e){return ue.value.has(e.id)}function In(e){var a,d;const t=St(e).length,s=((d=(a=e.commandExecution)==null?void 0:a.command)==null?void 0:d.trim())||"(command)";return`${t===1?"1 command":`${t} commands`} · latest: ${s}`}function Pn(e){return be(e)}function An(e){const n=new Set(De.value);n.has(e.id)?n.delete(e.id):n.add(e.id),De.value=n}function It(e){return De.value.has(e.id)}function Pt(e){const n=new Set(de.value);n.has(e.id)?n.delete(e.id):n.add(e.id),de.value=n}function ee(e){return de.value.has(e.id)}function M(e){return`${e.path}\0${e.movedToPath??""}`}function we(e,n){e&&(Ne.value=e,ge.value=M(n),N.value=!1)}function At(){Ne.value=null,ge.value="",N.value=!1}function Bn(){N.value=!N.value}function Fn(){N.value=!1}function Bt(e){ge.value=M(e),ye.value&&(N.value=!1)}function be(e){const n=e.commandExecution;if(!n)return"";const t=Xe(e);switch(n.status){case"inProgress":return t?"Running":"⟳ Running";case"completed":return n.exitCode===0?t?"Done":"✓ Completed":`Exit ${n.exitCode??"?"}`;case"failed":return t?"Failed":"✗ Failed";case"declined":return t?"Declined":"⊘ Declined";case"interrupted":return t?"Stopped":"⊘ Interrupted";default:return""}}function xe(e){var t,s;const n=(t=e.commandExecution)==null?void 0:t.status;return n==="inProgress"?"cmd-status-running":n==="completed"&&((s=e.commandExecution)==null?void 0:s.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function Ce(e,n){if(e.size===0)return e;const t=new Set;for(const s of e)n.has(s)&&t.add(s);return t.size===e.size?e:t}function En(e,n){const t=[];for(let s=n-1;s>=0;s--){const i=e[s];if(i.messageType==="commandExecution")t.unshift(i);else if(i.role==="user"||i.messageType==="worked")break}return t}const v=T,et=$n,V=x(null),Ft=x(null),pe=x(""),U=x(""),Rn=x(null),z=x(((bn=v.scrollState)==null?void 0:bn.isAtBottom)!==!1),Et={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",yml:"yaml",md:"markdown","c++":"cpp","c#":"csharp",ps1:"powershell"};let te=0,F=0,$e=0,ne=null;const Rt=new WeakSet,Le=x(null);let Te=null;const E=x(0),q=x(!1),Wn=L(()=>v.messages.slice(E.value)),tt=L(()=>E.value>0),On=L(()=>!z.value&&(v.messages.length>0||v.pendingRequests.length>0||!!v.liveOverlay));function zn(){return Le.value?Promise.resolve():(Te||(Te=Hs(()=>import("./common-BeuopZEI.js"),[]).then(e=>{Le.value=e.default}).finally(()=>{Te=null})),Te)}function jn(e){if(!e||/[\r\n]/u.test(e)||e.endsWith("/")||e.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(e))return!1;const n=e.startsWith("/"),t=/^[A-Za-z]:[\\/]/u.test(e),s=e.startsWith("./")||e.startsWith("../")||e.startsWith("~/");return n||t||s?!0:/^[A-Za-z0-9._@() -]+(?:[\\/][A-Za-z0-9._@() -]+)+$/u.test(e)}function Me(e){return e.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||e}function se(e){return e.replace(/\\/gu,"/")}function Wt(e){if(!e.startsWith("file://"))return e;let n=e.replace(/^file:\/\//u,"");try{n=decodeURIComponent(n)}catch{}return/^\/[A-Za-z]:\//u.test(n)&&(n=n.slice(1)),n}function Hn(e){const n=se(e),t=n.match(/^\/Users\/([^/]+)/u);if(t)return`/Users/${t[1]}`;const s=n.match(/^\/home\/([^/]+)/u);return s?`/home/${s[1]}`:""}function ie(e){const n=se(e);if(!n)return n;let t="",s=n;const i=s.match(/^([A-Za-z]:)(\/.*)?$/u);i?(t=`${i[1]}/`,s=(i[2]??"").replace(/^\/+/u,"")):s.startsWith("/")&&(t="/",s=s.slice(1));const a=s.split("/").filter(Boolean),d=[];for(const f of a)if(f!=="."){if(f===".."){d.length>0&&d.pop();continue}d.push(f)}const o=d.join("/");return t?`${t}${o}`.replace(/\/+$/u,"")||t:o||n}function Ot(e,n){const t=se(Wt(e.trim()));if(!t)return"";if(t.startsWith("/")||/^[A-Za-z]:\//u.test(t))return ie(t);if(t.startsWith("~/")){const a=Hn(n);if(a)return ie(`${a}/${t.slice(2)}`)}const i=se(n.trim());return ie(i?`${i.replace(/\/+$/u,"")}/${t}`:t)}function me(e){if(!e)return null;let n=e.trim();n=Se(n).core.trim();let s=null;const i=n.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(i)n=i[1],s=Number(i[2]);else{const a=n.match(/^(.*):(\d+)(?::\d+)?$/u);a&&(n=a[1],s=Number(a[2]))}return n=Wt(n),jn(n)?{path:n,line:s}:null}function Se(e){let n=e,t="",s="";for(;/^[('"`[{<“‘]/u.test(n);)t+=n[0],n=n.slice(1);for(;/[)"'`\]}>”’]$/u.test(n);)s=n.slice(-1)+s,n=n.slice(0,-1);return{core:n,leading:t,trailing:s}}function nt(e){const n=e.trim();if(!n.startsWith("[")||!n.endsWith(")"))return null;const t=n.indexOf("]");if(t<=1||n[t+1]!=="(")return null;const s=n.slice(1,t).trim(),i=n.slice(t+2,-1).trim();if(s.includes(`
|
|
5
|
-
`)||i.includes(`
|
|
6
|
-
`))return null;const a=Se(s).core.trim()||s,d=Se(i).core.trim();return d?{label:a,target:d}:null}function zt(e){const n=Math.min(6,Math.max(1,Math.trunc(e)));return`h${String(n)}`}function jt(e){switch(Math.min(6,Math.max(1,Math.trunc(e)))){case 1:return"message-heading-h1";case 2:return"message-heading-h2";case 3:return"message-heading-h3";case 4:return"message-heading-h4";case 5:return"message-heading-h5";default:return"message-heading-h6"}}function Dn(e){switch(e){case"completed":return"[x]";case"inProgress":return"[~]";default:return"[ ]"}}function Nn(e){var s;const n=qe(e);if(!n)return"";const t=[];return(s=n.explanation)!=null&&s.trim()&&t.push(n.explanation.trim()),n.steps.length>0&&t.push(n.steps.map(i=>`- ${Dn(i.status)} ${i.step}`.trim()).join(`
|
|
7
|
-
`)),t.join(`
|
|
8
|
-
|
|
9
|
-
`).trim()}function Vn(e){const n=[],t=e.text.trim()||Nn(e),s=xt(e)&&t?`Plan
|
|
10
|
-
${t}`:t;s&&n.push(s);const i=(e.fileAttachments??[]).map(d=>d.path.trim()).filter(d=>d.length>0);i.length>0&&n.push(`Files:
|
|
11
|
-
${i.join(`
|
|
12
|
-
`)}`);const a=(e.images??[]).map(d=>d.trim()).filter(d=>d.length>0);return a.length>0&&n.push(`Images:
|
|
13
|
-
${a.join(`
|
|
14
|
-
`)}`),n.join(`
|
|
15
|
-
|
|
16
|
-
`).trim()}const Ht=L(()=>{var t;const e=new Map;for(const s of v.messages){if(!he(s))continue;const i=Vn(s);if(!i)continue;const a=typeof s.turnIndex=="number"?`turn:${s.turnIndex}`:`message:${s.id}`,d=e.get(a);if(d){d.anchorMessageId=s.id,d.parts.push(i);continue}e.set(a,{anchorMessageId:s.id,parts:[i]})}const n={};for(const s of e.values()){const i=s.parts.join(`
|
|
17
|
-
|
|
18
|
-
`).trim();i&&(n[s.anchorMessageId]=i)}for(const[s,i]of Object.entries(Ie.value)){if(i.source!=="metadata")continue;const a=Jn(i);if(!a)continue;const d=(t=n[s])==null?void 0:t.trim();n[s]=d?`${d}
|
|
19
|
-
|
|
20
|
-
${a}`:a}return n}),Dt=L(()=>{const e=new Map;for(const t of v.messages){if(!he(t)||typeof t.turnIndex!="number")continue;const s=`turn:${t.turnIndex}`,i=e.get(s);if(i){i.anchorMessageId=t.id,i.turnIndex=t.turnIndex;continue}e.set(s,{anchorMessageId:t.id,turnIndex:t.turnIndex})}const n={};for(const t of e.values())n[t.anchorMessageId]=t.turnIndex;return n});function Nt(e){return typeof Ht.value[e.id]=="string"}function Un(e){return typeof Dt.value[e.id]=="number"}function qn(e,n){return e?!n||e===n?e:`${e}
|
|
21
|
-
${n}`.trim():n}function Kn(e,n){const t=e.operation==="add"||n.operation==="add"?"add":e.operation==="delete"||n.operation==="delete"?"delete":"update";return{path:n.path||e.path,operation:t,movedToPath:n.movedToPath??e.movedToPath??null,diff:qn(e.diff,n.diff),addedLineCount:e.addedLineCount+n.addedLineCount,removedLineCount:e.removedLineCount+n.removedLineCount}}function Zn(e,n){const t=e.operation==="add"?0:e.operation==="update"?1:2,s=n.operation==="add"?0:n.operation==="update"?1:2;if(t!==s)return t-s;const i=`${e.path}\0${e.movedToPath??""}`,a=`${n.path}\0${n.movedToPath??""}`;return i.localeCompare(a)}function st(e){const n=new Map;for(const t of e){const s=`${t.path}\0${t.movedToPath??""}`,i=n.get(s);n.set(s,i?Kn(i,t):{...t})}return Array.from(n.values()).sort(Zn)}const Ie=L(()=>{const e=new Map,n=new Map,t=new Map;for(const i of v.messages){if(he(i)&&typeof i.turnIndex=="number"&&(e.set(`turn:${i.turnIndex}`,i.id),Array.isArray(i.fileChanges)&&i.fileChanges.length>0&&n.set(i.id,{changes:st(i.fileChanges),sourceMessageIds:[],source:"assistant"})),!Ke(i))continue;const a=typeof i.turnIndex=="number"?`turn:${i.turnIndex}`:`message:${i.id}`,d=t.get(a);d?d.push(i):t.set(a,[i])}const s={};for(const[i,a]of t.entries()){const d=e.get(i);d&&(s[d]={changes:st(a.flatMap(o=>o.fileChanges??[])),sourceMessageIds:a.map(o=>o.id),source:"metadata"})}for(const[i,a]of n.entries())s[i]||(s[i]=a);return s}),it=L(()=>{const e=new Map,n=new Map;for(const s of v.messages){if(he(s)&&typeof s.turnIndex=="number"&&e.set(`turn:${s.turnIndex}`,s.id),!Ke(s))continue;const i=typeof s.turnIndex=="number"?`turn:${s.turnIndex}`:`message:${s.id}`,a=n.get(i);a?a.push(s):n.set(i,[s])}const t={};for(const[s,i]of n.entries()){if(e.has(s))continue;const a=i[i.length-1];a&&(t[a.id]={changes:st(i.flatMap(d=>d.fileChanges??[])),sourceMessageIds:i.map(d=>d.id),source:"metadata"})}return t}),Gn=L(()=>{const e=new Set;for(const n of Object.values(Ie.value))for(const t of n.sourceMessageIds)e.add(t);for(const[n,t]of Object.entries(it.value))for(const s of t.sourceMessageIds)s!==n&&e.add(s);return e});function oe(e){return Ie.value[e.id]??null}function ae(e){return it.value[e.id]??null}function re(e){return e.operation==="update"&&e.movedToPath?e.addedLineCount>0||e.removedLineCount>0?"Moved + edited":"Moved":e.operation==="add"?"Added":e.operation==="delete"?"Deleted":"Edited"}function Pe(e){return e.operation==="update"&&e.movedToPath?"move":e.operation}function K(e){const n=[];return e.addedLineCount>0&&n.push(`+${e.addedLineCount}`),e.removedLineCount>0&&n.push(`-${e.removedLineCount}`),n.join(" ")}function Vt(e,n,t=""){const s=[];return e>0&&s.push({tone:"add",label:`+${e}`}),n>0&&s.push({tone:"remove",label:`-${n}`}),s.length>0?s:t?[{tone:"neutral",label:t}]:[]}function Ut(e){return Vt(e.addedLineCount,e.removedLineCount)}function Ae(e){return e===1?"1 file changed":`${e} files changed`}function Xn(e){if(!e||e.changes.length===0)return"";let n=0,t=0,s=0,i=0;for(const d of e.changes){if(d.operation==="add"){n+=1;continue}if(d.operation==="delete"){t+=1;continue}if(d.movedToPath){i+=1;continue}s+=1}const a=[];return s>0&&a.push(`${s} edited`),n>0&&a.push(`${n} added`),t>0&&a.push(`${t} deleted`),i>0&&a.push(`${i} moved`),a.join(", ")}function qt(e){if(!e||e.changes.length===0)return"Modified files";const n=Ae(e.changes.length),t=Xn(e);return t?`${n} · ${t}`:n}function Kt(e){if(!e||e.changes.length===0)return[];const n=e.changes.reduce((i,a)=>i+a.addedLineCount,0),t=e.changes.reduce((i,a)=>i+a.removedLineCount,0),s=e.changes.some(i=>i.movedToPath)?"Moved":"Ready";return Vt(n,t,s)}function S(e){const n=Ot(e,v.cwd),t=ie(se(v.cwd.trim())),s=ie(se(n));return t&&s.startsWith(`${t}/`)?s.slice(t.length+1):e}function Jn(e){return!e||e.changes.length===0?"":`Modified files:
|
|
22
|
-
${e.changes.map(t=>{const s=S(t.path),i=t.movedToPath?` -> ${S(t.movedToPath)}`:"",a=K(t);return`- ${re(t)}: ${s}${i}${a?` (${a})`:""}`}).join(`
|
|
23
|
-
`)}`.trim()}const le=L(()=>{var e;return((e=Ne.value)==null?void 0:e.changes)??[]}),I=L(()=>{const e=le.value;return e.length===0?null:e.find(n=>M(n)===ge.value)??e[0]});function Yn(e){var s;const t=((s=(e.movedToPath||e.path).split(".").pop())==null?void 0:s.toLowerCase())??"";return Et[t]??t??""}function Qn(e){return e.operation==="update"&&/^diff --git |^@@ |^--- |^\+\+\+ |^[ +-]|^\*\*\* (Move to:|End of File)/mu.test(e.diff)}function es(e){const n=e.diff.replace(/\r\n/g,`
|
|
24
|
-
`),t=n.length>0?n.split(`
|
|
25
|
-
`):[];return t.length>0&&t[t.length-1]===""&&t.pop(),t.map((s,i)=>({key:`${M(e)}:synthetic:${i}`,kind:e.operation==="delete"?"remove":"add",oldLine:e.operation==="delete"?i+1:null,newLine:e.operation==="delete"?null:i+1,text:s}))}function ts(e){const n=e.diff.replace(/\r\n/g,`
|
|
26
|
-
`),t=n.length>0?n.split(`
|
|
27
|
-
`):[];t.length>0&&t[t.length-1]===""&&t.pop();const s=[];let i=0,a=0;for(const[d,o]of t.entries()){const f=o.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/u);if(f){i=Number(f[1]),a=Number(f[2]),s.push({key:`${M(e)}:hunk:${d}`,kind:"hunk",oldLine:null,newLine:null,text:o});continue}if(o.startsWith("+")&&!o.startsWith("+++")){s.push({key:`${M(e)}:add:${d}`,kind:"add",oldLine:null,newLine:a,text:o.slice(1)}),a+=1;continue}if(o.startsWith("-")&&!o.startsWith("---")){s.push({key:`${M(e)}:remove:${d}`,kind:"remove",oldLine:i,newLine:null,text:o.slice(1)}),i+=1;continue}if(o.startsWith(" ")){s.push({key:`${M(e)}:context:${d}`,kind:"context",oldLine:i,newLine:a,text:o.slice(1)}),i+=1,a+=1;continue}s.push({key:`${M(e)}:meta:${d}`,kind:"meta",oldLine:null,newLine:null,text:o})}return s}function ns(e){return!e||!e.diff.trim()?[]:Qn(e)?ts(e):es(e)}const ss=L(()=>ns(I.value));function is(e){return!!(e!=null&&e.diff.trim())}function os(e){return e.kind==="add"?"+":e.kind==="remove"?"-":e.kind==="hunk"?"@@":""}function as(e){if(typeof document>"u")return!1;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.left="-9999px",n.style.opacity="0",n.style.pointerEvents="none",document.body.appendChild(n),n.focus(),n.select(),n.setSelectionRange(0,e.length);try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(n)}}async function rs(e){var s;const n=Ht.value[e]??"";if(!n)return;let t=!1;if(typeof navigator<"u"&&((s=navigator.clipboard)!=null&&s.writeText))try{await navigator.clipboard.writeText(n),t=!0}catch{t=!1}t||(t=as(n)),t&&(U.value=e,ne&&clearTimeout(ne),ne=setTimeout(()=>{U.value===e&&(U.value=""),ne=null},1800))}function ls(e){const n=Dt.value[e];typeof n=="number"&&v.activeThreadId&&et("forkThread",{threadId:v.activeThreadId,turnIndex:n})}const Zt=L(()=>{const e=new Map;for(const t of v.messages){if(!he(t)||typeof t.turnIndex!="number")continue;const s=typeof t.turnId=="string"&&t.turnId.length>0?t.turnId:"";if(!s)continue;const i=`turn:${t.turnIndex}`,a=e.get(i);if(a){a.anchorMessageId=t.id,a.turnId=s;continue}e.set(i,{anchorMessageId:t.id,turnId:s})}const n={};for(const t of e.values())n[t.anchorMessageId]=t.turnId;return n});function Gt(e){return typeof Zt.value[e.id]=="string"}function cs(e){const n=Zt.value[e];n&&et("rollback",{turnId:n})}function ot(e){const n=[],t=new RegExp("https?:\\/\\/[^\\s<>\"'`,。;:!?、()[\\]{}「」『』《》]+|file:\\/\\/[^\\n<>\"'`,。;:!?、[\\]{}「」『』《》]+|(?:[A-Za-z]:[\\\\/]|~\\/|\\.{1,2}\\/)[^\\n<>\"'`,。;:!?、[\\]{}「」『』《》]+|(?<![\\p{L}\\p{N}_-])\\/[^\\n<>\"'`,。;:!?、[\\]{}「」『』《》]+|[A-Za-z0-9._@() -]+(?:[\\\\/][A-Za-z0-9._@() -]+)+(?:#L\\d+(?:C\\d+)?|:\\d+(?::\\d+)?)?","gu");let s=0;for(const i of e.matchAll(t)){if(typeof i.index!="number")continue;const a=i.index,d=a+i[0].length;a>s&&n.push({kind:"text",value:e.slice(s,a)});let o=i[0],f="";for(;/[.,;:!?,。;:!?、]$/u.test(o);)f=o.slice(-1)+f,o=o.slice(0,-1);const c=Se(o);o=c.core;const m=c.leading,p=c.trailing+f;if(m&&n.push({kind:"text",value:m}),o.startsWith("**")&&o.endsWith("**")&&o.length>4)n.push({kind:"bold",value:o.slice(2,-2)}),p&&n.push({kind:"text",value:p});else if(/^https?:\/\//u.test(o))n.push({kind:"url",value:o,href:o}),p&&n.push({kind:"text",value:p});else{const y=me(o);y?(n.push({kind:"file",value:o,path:y.path,displayPath:o,downloadName:Me(y.path)}),p&&n.push({kind:"text",value:p})):n.push({kind:"text",value:i[0]})}s=d}return s<e.length&&n.push({kind:"text",value:e.slice(s)}),us(n)}function at(e,n){const t=[];let s=!1,i="";const a=d=>{d&&t.push({kind:"text",value:d})};for(const d of e){if(d.kind!=="text"){s&&(a(`${n.marker}${i}`),s=!1,i=""),t.push(d);continue}let o=d.value;for(;o.length>0;){const f=o.indexOf(n.marker);if(f<0){s?i+=o:a(o);break}const c=o.slice(0,f);if(s?i+=c:a(c),o=o.slice(f+n.marker.length),s){const m=i;m.length>0&&(!n.isValidContent||n.isValidContent(m))?t.push({kind:n.kind,value:m}):a(`${n.marker}${m}${n.marker}`),i="",s=!1}else s=!0}}return s&&a(`${n.marker}${i}`),t}function us(e){const n=s=>s.trim().length>0&&!/^\s/u.test(s)&&!/\s$/u.test(s);let t=at(e,{marker:"**",kind:"bold",isValidContent:n});return t=at(t,{marker:"~~",kind:"strikethrough",isValidContent:n}),t=at(t,{marker:"*",kind:"italic",isValidContent:n}),t}function Be(e){const n=[];let t=0,s=0;const i=(a,d)=>{let o=a.indexOf("[",d);for(;o>=0;){const f=a.indexOf("]",o+1);if(f<0)return null;if(a[f+1]!=="("){o=a.indexOf("[",o+1);continue}let c=1,m=f+2,p=!1;for(;m<a.length;){const y=a[m];if(y===`
|
|
28
|
-
`){p=!0;break}if(y==="("&&(c+=1),y===")"&&(c-=1,c===0)){const b=a.slice(o,m+1);if(nt(b))return{start:o,end:m+1,token:b};break}m+=1}if(p){o=a.indexOf("[",o+1);continue}o=a.indexOf("[",o+1)}return null};for(;s<e.length;){const a=i(e,s);if(!a)break;const{start:d,end:o,token:f}=a;d>t&&n.push(...ot(e.slice(t,d)));const c=nt(f);if(!c){n.push(...ot(e.slice(d,o))),t=o,s=o;continue}const m=c.label,p=c.target;if(/^https?:\/\//u.test(p))n.push({kind:"url",value:m||p,href:p});else{const y=me(p);y?n.push({kind:"file",value:p,path:y.path,displayPath:m||p,downloadName:Me(y.path)}):n.push({kind:"text",value:f})}t=o,s=o}return t<e.length&&n.push(...ot(e.slice(t))),n}function Z(e){if(e.includes("](")){const i=Be(e);if(i.some(a=>a.kind==="file"||a.kind==="url"))return i}if(!e.includes("`"))return Be(e);const n=[];let t=0,s=0;for(;t<e.length;){if(e[t]!=="`"){t+=1;continue}let i=1;for(;t+i<e.length&&e[t+i]==="`";)i+=1;const a="`".repeat(i);let d=t+i,o=-1;for(;d<e.length;){const c=e.indexOf(a,d);if(c<0)break;const m=c>0&&e[c-1]==="`",p=c+i<e.length&&e[c+i]==="`",y=e.slice(t+i,c).includes(`
|
|
29
|
-
`);if(!m&&!p&&!y){o=c;break}d=c+1}if(o<0){t+=i;continue}t>s&&n.push(...Be(e.slice(s,t)));const f=e.slice(t+i,o);if(f.length>0){const c=nt(f);if(c)if(/^https?:\/\//u.test(c.target))n.push({kind:"url",value:c.label||c.target,href:c.target});else{const m=me(c.target);m?n.push({kind:"file",value:c.target,path:m.path,displayPath:c.label||c.target,downloadName:Me(m.path)}):n.push({kind:"code",value:f})}else if(/^https?:\/\/[^\s]+$/u.test(f))n.push({kind:"url",value:f,href:f});else{const m=me(f);if(m){const p=m.line?`${m.path}:${String(m.line)}`:m.path;n.push({kind:"file",value:f,path:m.path,displayPath:p,downloadName:Me(m.path)})}else n.push({kind:"code",value:f})}}else n.push({kind:"text",value:`${a}${a}`});t=o+i,s=t}return s<e.length&&n.push(...Be(e.slice(s))),n}function ds(e){const n=e.trim();if(!n)return"";if(n.startsWith("data:")||n.startsWith("blob:")||n.startsWith("http://")||n.startsWith("https://")||n.startsWith("/codex-local-image?"))return n;if(n.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(n)}`;const t=n.startsWith("/"),s=/^[A-Za-z]:[\\/]/u.test(n);return t||s?`/codex-local-image?path=${encodeURIComponent(n)}`:n}function j(e){const n=e.trim();if(!n)return"#";const t=d=>d.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(d),s=me(n),i=(s==null?void 0:s.path)??n,a=Ot(i,v.cwd);if(t(a)){const d=a.startsWith("/")?a:`/${a}`;return`/codex-local-browse${encodeURI(d)}`}return"#"}const fs=L(()=>({left:`${String(wt.value)}px`,top:`${String(bt.value)}px`}));function hs(e){const n=e.trim();if(!n)return"";try{const t=new URL(n,window.location.href);return t.pathname.startsWith("/codex-local-browse")?`${`/codex-local-edit${t.pathname.slice(19)}`}${t.search}${t.hash}`:""}catch{return""}}function ps(e){const n=e.target;if(!(n instanceof Element))return;const t=n.closest("a.message-file-link");if(!(t instanceof HTMLAnchorElement))return;const s=(t.getAttribute("href")??"").trim();!s||s==="#"||(e.preventDefault(),e.stopPropagation(),Ve.value=s,Ue.value=hs(s),wt.value=e.clientX,bt.value=e.clientY,fe.value=!0)}function G(){fe.value&&(fe.value=!1)}function ms(){const e=Ve.value;G(),!(!e||e==="#")&&window.open(e,"_blank","noopener,noreferrer")}function vs(){const e=Ue.value;G(),!(!e||e==="#")&&window.open(e,"_blank","noopener,noreferrer")}async function ks(){const e=Ve.value;if(G(),!(!e||e==="#"))try{await navigator.clipboard.writeText(e)}catch{const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.opacity="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}}function Xt(e){if(!fe.value)return;const n=_t.value;if(!n){G();return}const t=e.target;t instanceof Node&&n.contains(t)||G()}function Jt(){G()}function Yt(e){e.key==="Escape"&&G()}function Qt(e){return e.replace(/\r\n/gu,`
|
|
30
|
-
`)}function R(e){var t;return(((t=e.match(/^\s*/u))==null?void 0:t[0])??"").replace(/\t/gu," ").length}function en(e,n){if(n<=0)return e.trimStart();let t=0,s=0;for(;t<e.length&&s<n;){const i=e[t];s+=i===" "?4:1,t+=1}return e.slice(t)}function W(e){return e.trim().length===0}function rt(e){const n=e.match(/^\s{0,3}(#{1,6})\s+(.+)$/u);return n?{level:n[1].length,value:n[2].trim()}:null}function Fe(e){const n=e.match(/^\s{0,3}>\s?(.*)$/u);return n?n[1]??"":null}function ve(e){var t;const n=e.match(/^\s*[-*+]\s+(.+)$/u);return((t=n==null?void 0:n[1])==null?void 0:t.trim())??null}function gs(e){var t;const n=e.match(/^(\s*)[-*+]\s+(.+)$/u);return n?{indent:R(n[1]??""),text:((t=n[2])==null?void 0:t.trim())??""}:null}function ke(e){var t;const n=e.match(/^\s*[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{checked:(n[1]??" ").toLowerCase()==="x",text:((t=n[2])==null?void 0:t.trim())??""}:null}function tn(e){var t;const n=e.match(/^(\s*)[-*+]\s+\[([ xX])\]\s+(.+)$/u);return n?{indent:R(n[1]??""),item:{checked:(n[2]??" ").toLowerCase()==="x",text:((t=n[3])==null?void 0:t.trim())??""}}:null}function nn(e){var t;const n=e.match(/^(\s*)(\d+)[.)]\s+(.+)$/u);return n?{indent:R(n[1]??""),start:Number.parseInt(n[2]??"1",10)||1,text:((t=n[3])==null?void 0:t.trim())??""}:null}function lt(e){var n;return((n=nn(e))==null?void 0:n.text)??null}function sn(e){return nn(e)}function ct(e){const n=e.trim();if(!n.includes("|"))return null;let t=n;t.startsWith("|")&&(t=t.slice(1)),t.endsWith("|")&&(t=t.slice(0,-1));const s=[];let i="",a=0;for(let d=0;d<t.length;d+=1){const o=t[d];if(o==="\\"&&t[d+1]==="|"){i+="|",d+=1;continue}if(o==="`"){let f=1;for(;t[d+f]==="`";)f+=1;i+=t.slice(d,d+f),a===0?a=f:a===f&&(a=0),d+=f-1;continue}if(o==="|"&&a===0){s.push(i.trim()),i="";continue}i+=o}return s.push(i.trim()),s.some(d=>d.length>0)?s:null}function ys(e){const n=ct(e);if(!n||n.length===0)return null;const t=n.map(s=>{const i=s.replace(/\s+/gu,"");if(!/^:?-{3,}:?$/u.test(i))return null;const a=i.startsWith(":"),d=i.endsWith(":");return a&&d?"center":d?"right":a?"left":null});return t.every((s,i)=>s!==null||/^-+$/u.test(n[i].replace(/\s+/gu,"")))?t:null}function on(e,n){return e.length===n?e:e.length>n?e.slice(0,n):[...e,...Array.from({length:n-e.length},()=>"")]}function an(e,n){var m;if(n+1>=e.length)return null;const t=e[n],s=e[n+1],i=ct(t),a=ys(s);if(!i||!a||i.length!==a.length)return null;const d=t.trim();if(!d.startsWith("|")&&(((m=d.match(/\|/gu))==null?void 0:m.length)??0)<2)return null;const o=i.length,f=[];let c=n+2;for(;c<e.length&&!W(e[c]);){const p=ct(e[c]);if(!p)break;f.push(on(p,o)),c+=1}return{kind:"table",headers:on(i,o),rows:f,alignments:a}}function _s(e){return W(e)||Ee(e)!==null||ut(e)||rt(e)!==null||Fe(e)!==null||ke(e)!==null||ve(e)!==null||lt(e)!==null}function ws(e,n,t=-1){const s=[];let i=n;for(;i<e.length&&!(_s(e[i])||t>=0&&R(e[i])<=t);)s.push(t>=0?en(e[i],t+1):e[i]),i+=1;const a=s.join(`
|
|
31
|
-
`).trim();return a?{value:a,nextIndex:i}:null}function rn(e,n){for(let t=n;t<e.length;t+=1)if(!W(e[t]))return t;return-1}function bs(e,n,t,s=null,i=!1){const a=[];let d=n;for(;d<e.length;){const o=e[d];if(W(o)){const p=rn(e,d+1);if(p===-1){a.push(""),d=e.length;break}const y=s==null?void 0:s(e[p]);if(y&&y.indent===t||R(e[p])<=t)break;a.push(""),d+=1;continue}const f=s==null?void 0:s(o);if(f&&f.indent===t)break;const c=R(o),m=i&&(ke(o)!==null||ve(o)!==null);if(c<=t&&!m)break;a.push(c>t?en(o,t+1):o.trimStart()),d+=1}for(;a.length>0&&W(a[0]);)a.shift();for(;a.length>0&&W(a[a.length-1]);)a.pop();return a.length===0?null:{blocks:Re(a.join(`
|
|
32
|
-
`)),nextIndex:d}}function ln(e,n,t,s=!1){const i=[];let a=n;const d=t(e[n]);if(!d)return null;const o=d.indent;for(;a<e.length;){const f=t(e[a]);if(f===null||f.indent!==o)break;const c=[f.text],m=[];for(a+=1;a<e.length;){if(W(e[a])){const _=rn(e,a+1);if(_===-1){a=e.length;break}const P=t(e[_]);if(P&&P.indent===o){a=_;break}if(R(e[_])<=o){a=_;break}a+=1;continue}const p=t(e[a]);if(p&&p.indent===o)break;const y=R(e[a])>o,b=s&&(ke(e[a])!==null||ve(e[a])!==null);if(y||b){const _=bs(e,a,o,t,s);if(_){m.push(..._.blocks),a=_.nextIndex;continue}}if(R(e[a])<=o)break;const H=ws(e,a,o);if(!H)break;c.push(H.value),a=H.nextIndex}i.push(m.length>0?{paragraphs:c,children:m}:{paragraphs:c})}return i.length>0?{items:i,nextIndex:a}:null}function ut(e){return/^\s{0,3}(?:-{3,}|\*{3,}|_{3,})\s*$/u.test(e.trim())}function Ee(e){const n=e.match(/^\s{0,3}(```+|~~~+)\s*([^\s`~][^`]*)?\s*$/u);return n?{marker:n[1],language:(n[2]??"").trim()}:null}function Re(e){var a;const t=Qt(e).split(`
|
|
33
|
-
`),s=[];let i=0;for(;i<t.length;){if(W(t[i])){i+=1;continue}const d=Ee(t[i]);if(d){i+=1;const _=[];for(;i<t.length;){if(t[i].trim()===d.marker){i+=1;break}_.push(t[i]),i+=1}s.push({kind:"codeBlock",language:d.language,value:_.join(`
|
|
34
|
-
`)});continue}if(ut(t[i])){s.push({kind:"thematicBreak"}),i+=1;continue}const o=rt(t[i]);if(o){s.push({kind:"heading",level:o.level,value:o.value}),i+=1;continue}if(Fe(t[i])!==null){const _=[];for(;i<t.length;){const P=Fe(t[i]);if(P===null)break;_.push(P),i+=1}s.push({kind:"blockquote",value:_.join(`
|
|
35
|
-
`).trim()});continue}const c=an(t,i);if(c){s.push(c),i+=2+c.rows.length;continue}if(ke(t[i])!==null){const _=[],P=((a=tn(t[i]))==null?void 0:a.indent)??0;for(;i<t.length;){const pt=tn(t[i]);if(pt===null||pt.indent!==P)break;_.push(pt.item),i+=1}if(_.length>0){s.push({kind:"taskList",items:_});continue}}const p=ve(t[i]);if(p!==null){const _=ln(t,i,gs);if(_){s.push({kind:"unorderedList",items:_.items}),i=_.nextIndex;continue}if(p.length>0){s.push({kind:"unorderedList",items:[{paragraphs:[p]}]}),i+=1;continue}}const y=lt(t[i]);if(y!==null){const _=sn(t[i]),P=ln(t,i,sn,!0);if(P){s.push({kind:"orderedList",items:P.items,start:(_==null?void 0:_.start)??1}),i=P.nextIndex;continue}if(y.length>0){s.push({kind:"orderedList",items:[{paragraphs:[y]}],start:(_==null?void 0:_.start)??1}),i+=1;continue}}const b=[];for(;i<t.length&&!(W(t[i])||Ee(t[i])||ut(t[i])||rt(t[i])||an(t,i)||Fe(t[i])!==null||ke(t[i])!==null||ve(t[i])!==null||lt(t[i])!==null);)b.push(t[i]),i+=1;const H=b.join(`
|
|
36
|
-
`).trim();H&&s.push({kind:"paragraph",value:H})}return s}function xs(e){if(!e.includes(")return Re(e);const n=[],t=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let s=0;for(const i of e.matchAll(t)){const[a,d,o]=i;if(typeof i.index!="number")continue;const f=i.index,c=f+a.length,m=ds(o.trim());m&&(f>s&&n.push(...Re(e.slice(s,f))),n.push({kind:"image",url:m,alt:d.trim(),markdown:a}),s=c)}return s<e.length&&n.push(...Re(e.slice(s))),n}function cn(e){const t=Qt(e).split(`
|
|
37
|
-
`),s=[];let i=0,a=0;const d=o=>{if(o<=a)return;const f=t.slice(a,o).join(`
|
|
38
|
-
`);s.push(...xs(f))};for(;i<t.length;){const o=Ee(t[i]);if(!o){i+=1;continue}d(i),i+=1;const f=[];for(;i<t.length;){if(t[i].trim()===o.marker){i+=1;break}f.push(t[i]),i+=1}s.push({kind:"codeBlock",language:o.language,value:f.join(`
|
|
39
|
-
`)}),a=i}return d(t.length),s.length>0?s:[{kind:"paragraph",value:e}]}function $(e){return e.replace(/&/gu,"&").replace(/</gu,"<").replace(/>/gu,">").replace(/"/gu,""").replace(/'/gu,"'")}function Cs(e){var t;const n=((t=e.trim().split(/\s+/u)[0])==null?void 0:t.toLowerCase())??"";return n?Et[n]??n:""}function un(e,n){const t=Cs(e);if(!t)return $(n);const s=Le.value;if(!s)return $(n);try{if(s.getLanguage(t))return s.highlight(n,{language:t,ignoreIllegals:!0}).value}catch{}return $(n)}function X(e){return Z(e).map(n=>n.kind==="text"?$(n.value):n.kind==="bold"?`<strong class="message-bold-text">${$(n.value)}</strong>`:n.kind==="italic"?`<em class="message-italic-text">${$(n.value)}</em>`:n.kind==="strikethrough"?`<s class="message-strikethrough-text">${$(n.value)}</s>`:n.kind==="file"?`<a class="message-file-link" href="${$(j(n.path))}" target="_blank" rel="noopener noreferrer" title="${$(n.path)}">${$(n.displayPath)}</a>`:n.kind==="url"?`<a class="message-file-link" href="${$(n.href)}" target="_blank" rel="noopener noreferrer" title="${$(n.href)}">${$(n.value)}</a>`:`<code class="message-inline-code">${$(n.value)}</code>`).join("")}function $s(e){return e.paragraphs.map(n=>`<div class="message-list-item-text message-list-item-paragraph">${X(n)}</div>`).join("")}function We(e){var s;const n=$s(e),t=((s=e.children)==null?void 0:s.map(i=>fn(i)).join(""))??"";return n+t}function dn(e){return e?` style="text-align:${e}"`:""}function fn(e){if(e.kind==="paragraph")return`<p class="message-text">${X(e.value)}</p>`;if(e.kind==="heading"){const n=Math.min(6,Math.max(1,Math.trunc(e.level))),t=zt(n),s=`message-heading ${jt(n)}`;return`<${t} class="${s}">${X(e.value)}</${t}>`}if(e.kind==="blockquote")return`<blockquote class="message-blockquote">${X(e.value)}</blockquote>`;if(e.kind==="unorderedList")return`<ul class="message-list message-list-unordered">${e.items.map(t=>`<li class="message-list-item"><div class="message-list-item-content">${We(t)}</div></li>`).join("")}</ul>`;if(e.kind==="taskList")return`<ul class="message-list message-task-list">${e.items.map(t=>`<li class="message-task-item"><span class="message-task-checkbox" data-checked="${t.checked?"true":"false"}">${t.checked?"☑":"☐"}</span><div class="message-list-item-text">${X(t.text)}</div></li>`).join("")}</ul>`;if(e.kind==="orderedList"){const n=e.items.map(t=>`<li class="message-list-item"><div class="message-list-item-content">${We(t)}</div></li>`).join("");return`<ol class="message-list message-list-ordered" start="${e.start}">${n}</ol>`}if(e.kind==="table"){const n=e.headers.map((i,a)=>`<th class="message-table-head-cell"${dn(e.alignments[a]??null)}>${X(i)}</th>`).join(""),t=e.rows.map(i=>'<tr class="message-table-body-row">'+i.map((a,d)=>`<td class="message-table-cell"${dn(e.alignments[d]??null)}>${X(a)}</td>`).join("")+"</tr>").join(""),s=t?`<tbody>${t}</tbody>`:"";return`<div class="message-table-wrap"><table class="message-table"><thead><tr>${n}</tr></thead>${s}</table></div>`}return e.kind==="codeBlock"?`<div class="message-code-block">${e.language?`<div class="message-code-language">${$(e.language)}</div>`:""}<pre class="message-code-pre"><code class="hljs">${un(e.language,e.value)}</code></pre></div>`:e.kind==="thematicBreak"?'<hr class="message-divider">':`<img class="message-image-preview message-markdown-image" src="${$(e.url)}" alt="${$(e.alt||"Embedded message image")}" loading="lazy">`}function dt(e){return cn(e).map(n=>fn(n)).join("")}function Ls(){const e=V.value,n=Ft.value;!e||!n||(e.scrollTop=e.scrollHeight,n.scrollIntoView({block:"end"}))}function hn(e){return e.scrollHeight-(e.scrollTop+e.clientHeight)<=_r}function Oe(e){if(!v.activeThreadId)return;const n=Math.max(e.scrollHeight-e.clientHeight,0),t=n>0?Math.min(Math.max(e.scrollTop/n,0),1):1;et("updateScrollState",{threadId:v.activeThreadId,state:{scrollTop:e.scrollTop,isAtBottom:hn(e),scrollRatio:t}})}function Ts(){const e=V.value;if(!e)return;if(z.value){ze();return}const n=v.scrollState;if(!n||n.isAtBottom){Oe(e);return}const t=Math.max(e.scrollHeight-e.clientHeight,0),s=n.scrollTop;e.scrollTop=Math.min(Math.max(s,0),t),Oe(e)}function ze(){const e=V.value;e&&(Ls(),Oe(e))}function ft(){return z.value}function pn(){if(!ft()){$e=0,F=0;return}if(ze(),$e-=1,$e<=0){F=0;return}F=requestAnimationFrame(pn)}function je(e=6){ft()&&(F&&(cancelAnimationFrame(F),F=0),$e=Math.max(e,1),F=requestAnimationFrame(pn))}function mn(){je(3)}function vn(){z.value=!0,ze(),je(4)}async function kn(){const e=V.value;if(!e||!tt.value||q.value)return;q.value=!0;const n=v.activeThreadId,t=e.scrollHeight,s=e.scrollTop;E.value=Math.max(0,E.value-wr),await mt(),v.activeThreadId===n&&(e.scrollTop=s+(e.scrollHeight-t),q.value=!1)}D({jumpToLatest:vn});function Ms(){if(!ft())return;const e=V.value;if(!e)return;const n=e.querySelectorAll("img.message-image-preview");for(const t of n)t.complete||Rt.has(t)||(Rt.add(t),t.addEventListener("load",mn,{once:!0}),t.addEventListener("error",mn,{once:!0}))}async function ht(){await mt(),te&&cancelAnimationFrame(te),te=requestAnimationFrame(()=>{te=0,Ts(),Ms(),je()})}J(()=>v.messages,async e=>{if(v.isLoading)return;const n=new Set(e.filter(t=>t.messageType==="commandExecution"&&t.commandExecution).map(t=>t.id));ce.value=Ce(ce.value,n),O.value=Ce(O.value,n),ue.value=Ce(ue.value,new Set(Object.keys(Ge.value))),de.value=Ce(de.value,new Set([...Object.keys(Ie.value),...Object.keys(it.value)])),z.value?E.value=Math.max(0,e.length-gt):E.value=Math.min(E.value,Math.max(0,e.length-1)),await ht()}),J(()=>v.messages.some(e=>e.text.includes("```")),e=>{!e||Le.value||zn()},{immediate:!0}),J(Ze,(e,n)=>{if(!n||n===e||!O.value.has(n))return;const t=new Set(O.value);t.delete(n),O.value=t}),J(()=>v.pendingRequests,async()=>{v.isLoading||await ht()},{deep:!0}),J(()=>v.liveOverlay,async e=>{e&&z.value&&(await mt(),ze(),je(8))},{deep:!0}),J(()=>v.isLoading,async e=>{e||(E.value=Math.max(0,v.messages.length-gt),await ht())}),J(()=>v.activeThreadId,()=>{Rn.value=null,z.value=!0,pe.value="",q.value=!1,E.value=Math.max(0,v.messages.length-gt)},{flush:"post"});function Ss(){const e=V.value;!e||v.isLoading||(z.value=hn(e),Oe(e),tt.value&&!q.value&&e.scrollTop<br&&kn())}const gn=x(new Set);function yn(e,n){return`${e}:${n}`}function Is(e,n){return gn.value.has(yn(e,n))}function Ps(e,n){gn.value.add(yn(e,n))}function _n(e){pe.value=e}function wn(){pe.value=""}return Fs(()=>{window.addEventListener("pointerdown",Xt),window.addEventListener("blur",Jt),window.addEventListener("keydown",Yt)}),Es(()=>{te&&cancelAnimationFrame(te),F&&cancelAnimationFrame(F),ne&&clearTimeout(ne),window.removeEventListener("pointerdown",Xt),window.removeEventListener("blur",Jt),window.removeEventListener("keydown",Yt)}),(e,n)=>(r(),l("section",{class:"conversation-root",onContextmenuCapture:ps},[T.isLoading?(r(),l("p",Xs,"Loading messages...")):T.messages.length===0&&T.pendingRequests.length===0&&!T.liveOverlay?(r(),l("p",Js," No messages in this thread yet. ")):(r(),l("ul",{key:2,ref_key:"conversationListRef",ref:V,class:"conversation-list",onScroll:Ss},[tt.value?(r(),l("li",Ys,[u("button",{type:"button",class:"load-more-button",disabled:q.value,onClick:kn},h(q.value?"Loading…":"Load earlier messages"),9,Qs)])):k("",!0),(r(!0),l(g,null,w(Wn.value,t=>{var s,i,a,d;return r(),l(g,{key:t.id},[!Tn.value.has(t.id)&&!Gn.value.has(t.id)?(r(),l("li",{key:0,class:"conversation-item","data-role":t.role,"data-message-type":t.messageType||""},[A(t)?(r(),l("div",ti,[u("div",ni,[_e(t).length>0?(r(),l("button",{key:0,type:"button",class:C(["cmd-row cmd-row-group cmd-compact",[xe(t),{"cmd-expanded":Qe(t)}]]),onClick:o=>Sn(t)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":Qe(t)}])},"▶",2),u("span",ii,h(In(t)),1),u("span",oi,h(Pn(t)),1)],10,si)):k("",!0),_e(t).length>0?(r(),l("div",{key:1,class:C(["cmd-group-wrap",{"cmd-group-visible":Qe(t)}])},[u("div",ai,[(r(!0),l(g,null,w(St(t),o=>{var f,c;return r(),l("div",{key:`grouped-cmd-${o.id}`,class:"worked-cmd-item"},[u("button",{type:"button",class:C(["cmd-row",[xe(o),{"cmd-expanded":B(o),"cmd-compact":!0}]]),onClick:m=>Ye(o)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":B(o)}])},"▶",2),u("code",li,h(((f=o.commandExecution)==null?void 0:f.command)||"(command)"),1),u("span",ci,h(be(o)),1)],10,ri),u("div",{class:C(["cmd-output-wrap",{"cmd-output-visible":B(o)}])},[u("div",ui,[u("pre",{class:C(["cmd-output",{"cmd-output-condensed":Je(o)}]),textContent:h(((c=o.commandExecution)==null?void 0:c.aggregatedOutput)||"(no output)")},null,10,di)])],2)])}),128))])],2)):(r(),l(g,{key:2},[u("button",{type:"button",class:C(["cmd-row",[xe(t),{"cmd-expanded":B(t),"cmd-compact":Xe(t)}]]),onClick:o=>Ye(t)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":B(t)}])},"▶",2),u("code",hi,h(((s=t.commandExecution)==null?void 0:s.command)||"(command)"),1),u("span",pi,h(be(t)),1)],10,fi),u("div",{class:C(["cmd-output-wrap",{"cmd-output-visible":B(t)}])},[u("div",mi,[u("pre",{class:C(["cmd-output",{"cmd-output-condensed":Je(t)}]),textContent:h(((i=t.commandExecution)==null?void 0:i.aggregatedOutput)||"(no output)")},null,10,vi)])],2)],64))])])):Ke(t)?(r(),l("div",{key:1,class:"message-row","data-role":t.role,"data-message-type":t.messageType||""},[u("div",{class:"message-stack","data-role":t.role},[u("article",{class:"message-body","data-role":t.role},[ae(t)?(r(),l("section",_i,[u("button",{type:"button",class:C(["cmd-row cmd-row-group cmd-compact file-change-summary-row",{"cmd-expanded":ee(t)}]),onClick:o=>Pt(t)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":ee(t)}])},"▶",2),u("span",bi,h(qt(ae(t))),1),u("span",xi,[(r(!0),l(g,null,w(Kt(ae(t)),o=>(r(),l("span",{key:`summary-status:${t.id}:${o.tone}:${o.label}`,class:"file-change-signed-count","data-tone":o.tone},h(o.label),9,Ci))),128))])],10,wi),u("div",{class:C(["cmd-group-wrap",{"cmd-group-visible":ee(t)}])},[u("div",$i,[u("ul",Li,[(r(!0),l(g,null,w(((a=ae(t))==null?void 0:a.changes)??[],o=>(r(),l("li",{key:`file-change:${t.id}:${o.path}:${o.movedToPath||""}`,class:"file-change-item"},[u("span",{class:"file-change-badge","data-operation":Pe(o)},h(re(o)),9,Ti),u("button",{type:"button",class:"file-change-path-button",title:o.path,onClick:f=>we(ae(t),o)},h(S(o.path)),9,Mi),o.movedToPath?(r(),l("span",Si,"→")):k("",!0),o.movedToPath?(r(),l("button",{key:1,type:"button",class:"file-change-path-button",title:o.movedToPath,onClick:f=>we(ae(t),o)},h(S(o.movedToPath)),9,Ii)):k("",!0),o.addedLineCount>0||o.removedLineCount>0?(r(),l("span",Pi,[(r(!0),l(g,null,w(Ut(o),f=>(r(),l("span",{key:`change-delta:${t.id}:${o.path}:${f.tone}:${f.label}`,class:"file-change-signed-count","data-tone":f.tone},h(f.label),9,Ai))),128))])):k("",!0)]))),128))])])],2)])):k("",!0)],8,yi)],8,gi)],8,ki)):(r(),l("div",{key:2,class:"message-row","data-role":t.role,"data-message-type":t.messageType||""},[u("div",{class:"message-stack","data-role":t.role},[u("article",{class:"message-body","data-role":t.role},[t.images&&t.images.length>0?(r(),l("ul",{key:0,class:"message-image-list","data-role":t.role},[(r(!0),l(g,null,w(t.images,o=>(r(),l("li",{key:o,class:"message-image-item"},[u("button",{class:"message-image-button",type:"button",onClick:f=>_n(o)},[u("img",{class:"message-image-preview",src:o,alt:"Message image preview",loading:"lazy"},null,8,Oi)],8,Wi)]))),128))],8,Ri)):k("",!0),t.fileAttachments&&t.fileAttachments.length>0?(r(),l("div",zi,[(r(!0),l(g,null,w(t.fileAttachments,o=>(r(),l("span",{key:`${t.id}:${o.path}`,class:"message-file-chip"},[n[4]||(n[4]=u("span",{class:"message-file-chip-icon"},"📄",-1)),u("a",{class:"message-file-link message-file-chip-name",href:j(o.path),target:"_blank",rel:"noopener noreferrer",title:o.path},h(o.label),9,ji)]))),128))])):k("",!0),t.text.length>0?(r(),l("article",{key:2,class:"message-card","data-role":t.role},[t.messageType==="worked"?(r(),l("div",Di,[u("button",{type:"button",class:"worked-separator",onClick:o=>An(t)},[n[5]||(n[5]=u("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),u("span",{class:C(["worked-chevron",{"worked-chevron-open":It(t)}])},"▶",2),u("p",Vi,h(t.text),1),n[6]||(n[6]=u("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Ni),It(t)?(r(),l("div",Ui,[(r(!0),l(g,null,w(En(T.messages,T.messages.indexOf(t)),o=>{var f,c;return r(),l("div",{key:`worked-cmd-${o.id}`,class:"worked-cmd-item"},[u("button",{type:"button",class:C(["cmd-row",[xe(o),{"cmd-expanded":B(o),"cmd-compact":Xe(o)}]]),onClick:m=>Ye(o)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":B(o)}])},"▶",2),u("code",Ki,h(((f=o.commandExecution)==null?void 0:f.command)||"(command)"),1),u("span",Zi,h(be(o)),1)],10,qi),u("div",{class:C(["cmd-output-wrap",{"cmd-output-visible":B(o)}])},[u("div",Gi,[u("pre",{class:C(["cmd-output",{"cmd-output-condensed":Je(o)}]),textContent:h(((c=o.commandExecution)==null?void 0:c.aggregatedOutput)||"(no output)")},null,10,Xi)])],2)])}),128))])):k("",!0)])):xt(t)?(r(),l("div",{key:1,class:"plan-card","data-streaming":t.messageType==="plan.live"},[u("div",Yi,[n[7]||(n[7]=u("p",{class:"plan-card-title"},"Plan",-1)),t.messageType==="plan.live"?(r(),l("span",Qi,"Updating")):k("",!0)]),Lt(t)?(r(),l("div",{key:0,class:"plan-card-explanation plan-card-markdown",innerHTML:dt(Lt(t))},null,8,eo)):k("",!0),Tt(t).length>0?(r(),l("ol",to,[(r(!0),l(g,null,w(Tt(t),(o,f)=>(r(),l("li",{key:`${t.id}:plan-step:${f}`,class:"plan-step-item","data-status":o.status},[u("span",{class:"plan-step-status","data-status":o.status},h(Mn(o.status)),9,so),u("div",{class:"plan-step-text plan-card-markdown",innerHTML:dt(o.step)},null,8,io)],8,no))),128))])):(r(),l("div",{key:2,class:"plan-card-markdown",innerHTML:dt(t.text)},null,8,oo))],8,Ji)):(r(),l("div",ao,[(r(!0),l(g,null,w(cn(t.text),(o,f)=>(r(),l(g,{key:`block-${f}`},[o.kind==="paragraph"?(r(),l("p",ro,[(r(!0),l(g,null,w(Z(o.value),(c,m)=>(r(),l(g,{key:`seg-${f}-${m}`},[c.kind==="text"?(r(),l("span",lo,h(c.value),1)):c.kind==="bold"?(r(),l("strong",co,h(c.value),1)):c.kind==="italic"?(r(),l("em",uo,h(c.value),1)):c.kind==="strikethrough"?(r(),l("s",fo,h(c.value),1)):c.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(c.path),target:"_blank",rel:"noopener noreferrer",title:c.path},h(c.displayPath),9,ho)):c.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:c.href,target:"_blank",rel:"noopener noreferrer",title:c.href},h(c.value),9,po)):(r(),l("code",mo,h(c.value),1))],64))),128))])):o.kind==="heading"?(r(),Rs(Ws(zt(o.level)),{key:1,class:C(["message-heading",jt(o.level)])},{default:xn(()=>[(r(!0),l(g,null,w(Z(o.value),(c,m)=>(r(),l(g,{key:`heading-seg-${f}-${m}`},[c.kind==="text"?(r(),l("span",vo,h(c.value),1)):c.kind==="bold"?(r(),l("strong",ko,h(c.value),1)):c.kind==="italic"?(r(),l("em",go,h(c.value),1)):c.kind==="strikethrough"?(r(),l("s",yo,h(c.value),1)):c.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(c.path),target:"_blank",rel:"noopener noreferrer",title:c.path},h(c.displayPath),9,_o)):c.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:c.href,target:"_blank",rel:"noopener noreferrer",title:c.href},h(c.value),9,wo)):(r(),l("code",bo,h(c.value),1))],64))),128))]),_:2},1032,["class"])):o.kind==="blockquote"?(r(),l("blockquote",xo,[(r(!0),l(g,null,w(Z(o.value),(c,m)=>(r(),l(g,{key:`quote-seg-${f}-${m}`},[c.kind==="text"?(r(),l("span",Co,h(c.value),1)):c.kind==="bold"?(r(),l("strong",$o,h(c.value),1)):c.kind==="italic"?(r(),l("em",Lo,h(c.value),1)):c.kind==="strikethrough"?(r(),l("s",To,h(c.value),1)):c.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(c.path),target:"_blank",rel:"noopener noreferrer",title:c.path},h(c.displayPath),9,Mo)):c.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:c.href,target:"_blank",rel:"noopener noreferrer",title:c.href},h(c.value),9,So)):(r(),l("code",Io,h(c.value),1))],64))),128))])):o.kind==="unorderedList"?(r(),l("ul",Po,[(r(!0),l(g,null,w(o.items,(c,m)=>(r(),l("li",{key:`ul-${f}-${m}`,class:"message-list-item"},[u("div",{class:"message-list-item-content",innerHTML:We(c)},null,8,Ao)]))),128))])):o.kind==="taskList"?(r(),l("ul",Bo,[(r(!0),l(g,null,w(o.items,(c,m)=>(r(),l("li",{key:`task-${f}-${m}`,class:"message-task-item"},[u("span",{class:"message-task-checkbox","data-checked":c.checked},h(c.checked?"☑":"☐"),9,Fo),u("div",Eo,[(r(!0),l(g,null,w(Z(c.text),(p,y)=>(r(),l(g,{key:`task-seg-${f}-${m}-${y}`},[p.kind==="text"?(r(),l("span",Ro,h(p.value),1)):p.kind==="bold"?(r(),l("strong",Wo,h(p.value),1)):p.kind==="italic"?(r(),l("em",Oo,h(p.value),1)):p.kind==="strikethrough"?(r(),l("s",zo,h(p.value),1)):p.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(p.path),target:"_blank",rel:"noopener noreferrer",title:p.path},h(p.displayPath),9,jo)):p.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:p.href,target:"_blank",rel:"noopener noreferrer",title:p.href},h(p.value),9,Ho)):(r(),l("code",Do,h(p.value),1))],64))),128))])]))),128))])):o.kind==="orderedList"?(r(),l("ol",{key:5,class:"message-list message-list-ordered",start:o.start},[(r(!0),l(g,null,w(o.items,(c,m)=>(r(),l("li",{key:`ol-${f}-${m}`,class:"message-list-item"},[u("div",{class:"message-list-item-content",innerHTML:We(c)},null,8,Vo)]))),128))],8,No)):o.kind==="table"?(r(),l("div",Uo,[u("table",qo,[u("thead",null,[u("tr",null,[(r(!0),l(g,null,w(o.headers,(c,m)=>(r(),l("th",{key:`th-${f}-${m}`,class:"message-table-head-cell",style:vt({textAlign:o.alignments[m]??"left"})},[(r(!0),l(g,null,w(Z(c),(p,y)=>(r(),l(g,{key:`th-seg-${f}-${m}-${y}`},[p.kind==="text"?(r(),l("span",Ko,h(p.value),1)):p.kind==="bold"?(r(),l("strong",Zo,h(p.value),1)):p.kind==="italic"?(r(),l("em",Go,h(p.value),1)):p.kind==="strikethrough"?(r(),l("s",Xo,h(p.value),1)):p.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(p.path),target:"_blank",rel:"noopener noreferrer",title:p.path},h(p.displayPath),9,Jo)):p.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:p.href,target:"_blank",rel:"noopener noreferrer",title:p.href},h(p.value),9,Yo)):(r(),l("code",Qo,h(p.value),1))],64))),128))],4))),128))])]),o.rows.length>0?(r(),l("tbody",ea,[(r(!0),l(g,null,w(o.rows,(c,m)=>(r(),l("tr",{key:`tr-${f}-${m}`,class:"message-table-body-row"},[(r(!0),l(g,null,w(c,(p,y)=>(r(),l("td",{key:`td-${f}-${m}-${y}`,class:"message-table-cell",style:vt({textAlign:o.alignments[y]??"left"})},[(r(!0),l(g,null,w(Z(p),(b,H)=>(r(),l(g,{key:`td-seg-${f}-${m}-${y}-${H}`},[b.kind==="text"?(r(),l("span",ta,h(b.value),1)):b.kind==="bold"?(r(),l("strong",na,h(b.value),1)):b.kind==="italic"?(r(),l("em",sa,h(b.value),1)):b.kind==="strikethrough"?(r(),l("s",ia,h(b.value),1)):b.kind==="file"?(r(),l("a",{key:4,class:"message-file-link",href:j(b.path),target:"_blank",rel:"noopener noreferrer",title:b.path},h(b.displayPath),9,oa)):b.kind==="url"?(r(),l("a",{key:5,class:"message-file-link",href:b.href,target:"_blank",rel:"noopener noreferrer",title:b.href},h(b.value),9,aa)):(r(),l("code",ra,h(b.value),1))],64))),128))],4))),128))]))),128))])):k("",!0)])])):o.kind==="codeBlock"?(r(),l("div",la,[o.language?(r(),l("div",ca,h(o.language),1)):k("",!0),u("pre",ua,[u("code",{class:"hljs",innerHTML:un(o.language,o.value)},null,8,da)])])):o.kind==="thematicBreak"?(r(),l("hr",fa)):Is(t.id,f)?(r(),l("p",ha,h(o.markdown),1)):(r(),l("button",{key:10,class:"message-image-button",type:"button",onClick:c=>_n(o.url)},[u("img",{class:"message-image-preview message-markdown-image",src:o.url,alt:o.alt||"Embedded message image",loading:"lazy",onError:c=>Ps(t.id,f)},null,40,ma)],8,pa))],64))),128))]))],8,Hi)):k("",!0),oe(t)?(r(),l("section",va,[u("button",{type:"button",class:C(["cmd-row cmd-row-group cmd-compact file-change-summary-row",{"cmd-expanded":ee(t)}]),onClick:o=>Pt(t)},[u("span",{class:C(["cmd-chevron",{"cmd-chevron-open":ee(t)}])},"▶",2),u("span",ga,h(qt(oe(t))),1),u("span",ya,[(r(!0),l(g,null,w(Kt(oe(t)),o=>(r(),l("span",{key:`summary-status:${t.id}:${o.tone}:${o.label}`,class:"file-change-signed-count","data-tone":o.tone},h(o.label),9,_a))),128))])],10,ka),u("div",{class:C(["cmd-group-wrap",{"cmd-group-visible":ee(t)}])},[u("div",wa,[u("ul",ba,[(r(!0),l(g,null,w(((d=oe(t))==null?void 0:d.changes)??[],o=>(r(),l("li",{key:`file-change:inline:${t.id}:${o.path}:${o.movedToPath||""}`,class:"file-change-item"},[u("span",{class:"file-change-badge","data-operation":Pe(o)},h(re(o)),9,xa),u("button",{type:"button",class:"file-change-path-button",title:o.path,onClick:f=>we(oe(t),o)},h(S(o.path)),9,Ca),o.movedToPath?(r(),l("span",$a,"→")):k("",!0),o.movedToPath?(r(),l("button",{key:1,type:"button",class:"file-change-path-button",title:o.movedToPath,onClick:f=>we(oe(t),o)},h(S(o.movedToPath)),9,La)):k("",!0),o.addedLineCount>0||o.removedLineCount>0?(r(),l("span",Ta,[(r(!0),l(g,null,w(Ut(o),f=>(r(),l("span",{key:`change-delta:inline:${t.id}:${o.path}:${f.tone}:${f.label}`,class:"file-change-signed-count","data-tone":f.tone},h(f.label),9,Ma))),128))])):k("",!0)]))),128))])])],2)])):k("",!0),Nt(t)||Gt(t)?(r(),l("div",{key:4,class:"message-toolbar","data-role":t.role},[Gt(t)?(r(),l("button",{key:0,type:"button",class:"message-rollback-button","aria-label":"Rollback to this response",title:"Rollback to this response",onClick:o=>cs(t.id)},[Y(Us,{class:"icon-svg message-rollback-icon"}),n[8]||(n[8]=u("span",{class:"message-rollback-label"},"Rollback",-1))],8,Ia)):k("",!0),Un(t)?(r(),l("button",{key:1,type:"button",class:"message-fork-button","aria-label":"Fork thread from this response",title:"Fork thread from this response",onClick:o=>ls(t.id)},[Y(Os,{class:"icon-svg message-fork-icon"}),n[9]||(n[9]=u("span",{class:"message-fork-label"},"Fork",-1))],8,Pa)):k("",!0),Nt(t)?(r(),l("button",{key:2,type:"button",class:"message-copy-button","data-copied":U.value===t.id,"aria-label":U.value===t.id?"Response copied":"Copy response",title:U.value===t.id?"Response copied":"Copy response",onClick:o=>rs(t.id)},[Y(Gs,{class:"icon-svg message-copy-icon"}),u("span",Ba,h(U.value===t.id?"Copied":"Copy"),1)],8,Aa)):k("",!0)],8,Sa)):k("",!0)],8,Ei)],8,Fi)],8,Bi))],8,ei)):k("",!0)],64)}),128)),T.liveOverlay?(r(),l("li",Fa,[u("div",Ea,[u("div",Ra,[u("article",Wa,[u("p",Oa,h(T.liveOverlay.activityLabel),1),T.liveOverlay.reasoningText?(r(),l("p",za,h(T.liveOverlay.reasoningText),1)):k("",!0),T.liveOverlay.errorText?(r(),l("p",ja,h(T.liveOverlay.errorText),1)):k("",!0)])])])])):k("",!0),u("li",{ref_key:"bottomAnchorRef",ref:Ft,class:"conversation-bottom-anchor"},null,512)],544)),On.value?(r(),l("button",{key:3,type:"button",class:"jump-to-latest-button",title:"Jump to latest","aria-label":"Jump to latest output",onClick:vn},[Y(zs,{class:"icon-svg jump-to-latest-icon"})])):k("",!0),pe.value.length>0?(r(),l("div",{key:4,class:"image-modal-backdrop",onClick:wn},[u("div",{class:"image-modal-content",onClick:n[0]||(n[0]=He(()=>{},["stop"]))},[u("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:wn},[Y(Cn,{class:"icon-svg"})]),u("img",{class:"image-modal-image",src:pe.value,alt:"Expanded message image"},null,8,Ha)])])):k("",!0),fe.value?(r(),l("div",{key:5,ref_key:"fileLinkContextMenuRef",ref:_t,class:"file-link-context-menu",style:vt(fs.value),onClick:n[1]||(n[1]=He(()=>{},["stop"]))},[u("button",{type:"button",class:"file-link-context-menu-item",onClick:ms}," Open link "),u("button",{type:"button",class:"file-link-context-menu-item",onClick:ks}," Copy link "),Ue.value?(r(),l("button",{key:0,type:"button",class:"file-link-context-menu-item",onClick:vs}," Edit file ")):k("",!0)],4)):k("",!0),I.value?(r(),l("div",{key:6,class:"diff-viewer-backdrop",onClick:At},[u("div",{class:"diff-viewer-shell",onClick:n[3]||(n[3]=He(()=>{},["stop"]))},[kt(ye)?k("",!0):(r(),l("aside",Da,[u("div",Na,[n[10]||(n[10]=u("p",{class:"diff-viewer-sidebar-title"},"Changed files",-1)),u("p",Va,h(Ae(le.value.length)),1)]),u("div",Ua,[(r(!0),l(g,null,w(le.value,t=>(r(),l("button",{key:`diff-viewer:${M(t)}`,type:"button",class:"diff-viewer-file-button","data-active":M(t)===M(I.value),onClick:s=>Bt(t)},[u("span",{class:"file-change-badge","data-operation":Pe(t)},h(re(t)),9,Ka),u("span",Za,[Q(h(S(t.path))+" ",1),t.movedToPath?(r(),l(g,{key:0},[Q(" → "+h(S(t.movedToPath)),1)],64)):k("",!0)]),K(t)?(r(),l("span",Ga,h(K(t)),1)):k("",!0)],8,qa))),128))])])),u("section",Xa,[u("div",Ja,[u("div",Ya,[u("p",Qa,[Q(h(S(I.value.path))+" ",1),I.value.movedToPath?(r(),l(g,{key:0},[Q(" → "+h(S(I.value.movedToPath)),1)],64)):k("",!0)]),u("p",er,[Q(h(re(I.value))+" ",1),K(I.value)?(r(),l("span",tr," · "+h(K(I.value)),1)):k("",!0)])]),u("div",nr,[kt(ye)?(r(),l("button",{key:0,type:"button",class:"diff-viewer-mobile-files-button",onClick:Bn},h(Ae(le.value.length)),1)):k("",!0),u("button",{class:"image-modal-close diff-viewer-close",type:"button","aria-label":"Close diff viewer",onClick:At},[Y(Cn,{class:"icon-svg"})])])]),is(I.value)?(r(),l("div",ir,[u("div",or,[u("span",ar,h(Yn(I.value)||"diff"),1)]),u("div",rr,[(r(!0),l(g,null,w(ss.value,t=>(r(),l("div",{key:t.key,class:"diff-viewer-line","data-kind":t.kind},[u("span",cr,h(t.oldLine??""),1),u("span",ur,h(t.newLine??""),1),u("span",dr,h(os(t)),1),u("code",{class:"diff-viewer-line-code",innerHTML:$(t.text)||" "},null,8,fr)],8,lr))),128))])])):(r(),l("div",sr,[...n[11]||(n[11]=[u("p",{class:"diff-viewer-empty-title"},"No diff available",-1),u("p",{class:"diff-viewer-empty-text"},"This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.",-1)])]))]),Y(js,{name:"diff-viewer-sheet"},{default:xn(()=>[kt(ye)&&N.value?(r(),l("div",{key:0,class:"diff-viewer-mobile-sheet-backdrop",onClick:Fn},[u("div",{class:"diff-viewer-mobile-sheet",onClick:n[2]||(n[2]=He(()=>{},["stop"]))},[n[13]||(n[13]=u("div",{class:"diff-viewer-mobile-sheet-handle","aria-hidden":"true"},null,-1)),u("div",hr,[n[12]||(n[12]=u("p",{class:"diff-viewer-sidebar-title"},"Changed files",-1)),u("p",pr,h(Ae(le.value.length)),1)]),u("div",mr,[(r(!0),l(g,null,w(le.value,t=>(r(),l("button",{key:`diff-viewer-sheet:${M(t)}`,type:"button",class:"diff-viewer-file-button","data-active":M(t)===M(I.value),onClick:s=>Bt(t)},[u("span",{class:"file-change-badge","data-operation":Pe(t)},h(re(t)),9,kr),u("span",gr,[Q(h(S(t.path))+" ",1),t.movedToPath?(r(),l(g,{key:0},[Q(" → "+h(S(t.movedToPath)),1)],64)):k("",!0)]),K(t)?(r(),l("span",yr,h(K(t)),1)):k("",!0)],8,vr))),128))])])])):k("",!0)]),_:1})])])):k("",!0)],32))}}),$r=yt(xr,[["__scopeId","data-v-281b84bc"]]);export{$r as default};
|
|
40
|
-
//# sourceMappingURL=ThreadConversation-BNp42k0F.js.map
|