repoburg 1.3.234 → 1.3.235

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.
@@ -416,7 +416,7 @@ ${U}`);const ze=j.map(({id:qe,previewUrl:tt,size:st,...De})=>De);r(""),ie([]),lt
416
416
  ${j}
417
417
  \`\`\`
418
418
 
419
- `;g(G=>G+te),E(!1),H(""),(ne=window.getSelection())==null||ne.removeAllRanges(),setTimeout(()=>{if(x.current){oe(),x.current.focus();const G=x.current.value.length;x.current.setSelectionRange(G,G)}},0)},[j]);return u.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[u.jsxs("div",{className:"thread-card-header",onClick:()=>k(te=>!te),children:[u.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Oe=(_e=n.turns)==null?void 0:_e[0])==null?void 0:Oe.user_prompt)==null?void 0:Q.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),u.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&u.jsx("button",{className:"thread-locate-btn",onClick:te=>{te.stopPropagation(),h()},title:"Scroll to text",children:u.jsx(x0,{size:12})}),u.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),y&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"thread-card-conversation",ref:C,onMouseDown:ae,children:[r.map(te=>u.jsx(Mk,{turn:te},te.id)),r.length===0&&u.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),D&&u.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:u.jsxs("button",{className:"discuss-button",onClick:Pe,title:"Quote this text in your follow-up",children:[u.jsx(fm,{size:14}),u.jsx("span",{children:"Quote"})]})}),n.status==="open"&&u.jsxs("div",{className:"thread-card-followup",children:[u.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:P?"Agent is running…":"Type a follow-up…",value:m,onChange:te=>{Gt.markInputChange(),g(te.target.value),oe()},disabled:P,rows:1,style:{minHeight:V,maxHeight:ee},onKeyDown:te=>{Gt.markKeystroke(),te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&!P&&m.trim()&&(te.preventDefault(),f(m.trim()),g(""),B(V))}}),u.jsx("button",{className:"thread-card-followup-send",disabled:P||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:u.jsx(Ql,{size:13})}),P&&u.jsx("button",{className:"thread-card-followup-stop",onClick:o,title:"Stop this thread's turn (Esc)",children:u.jsx(ii,{size:13})})]}),u.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?u.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Resolve thread",children:[u.jsx(zu,{size:13})," Resolve"]}):u.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[u.jsx(Yl,{size:13})," Reopen"]}),u.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:c,title:"Delete thread",children:[u.jsx(vs,{size:13})," Delete"]})]})]})]})}function Lk(){Gt.trackRender("ThreadsPanel");const n=F(j=>j.activeSessionId),r=F(j=>{var H;return j.activeSessionId?((H=j.sessionDetails[j.activeSessionId])==null?void 0:H.threads)??$h:$h}),o=F(j=>j.followupThread),l=F(j=>j.cancelThreadTurn),a=F(j=>j.reopenThread),c=F(j=>j.deleteThread),f=F(j=>j.activeRightTab),h=F(j=>j.switchRightTab),m=F(j=>j.deepLinkThreadId),g=F(j=>j.setDeepLinkThreadId),[y,k]=w.useState("open"),[x,C]=w.useState(null);w.useEffect(()=>{if(!m)return;const j=m;g(null),k(P=>r.some(V=>V.id===j&&V.status==="open")?P:"all");const H=setTimeout(()=>{const P=document.getElementById(`thread-${j}`);P&&(P.scrollIntoView({behavior:"smooth",block:"center"}),P.classList.add("thread-card-highlighted"),setTimeout(()=>P.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(H)},[m,g,r]);const D=r.filter(j=>y==="open"?j.status==="open":y==="resolved"?j.status==="resolved":!0),E=r.filter(j=>j.status==="open").length,N=r.filter(j=>j.status==="resolved").length;function M(j){f==="changes"&&h("turns"),setTimeout(()=>{const H=document.querySelector(`mark[data-thread-id="${j}"]`);H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("thread-mark-flash"),setTimeout(()=>H.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?u.jsxs("div",{className:"empty-state",children:[u.jsx(v0,{size:24,style:{opacity:.3,marginBottom:8}}),u.jsx("div",{children:"No threads yet."}),u.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):u.jsxs("div",{children:[u.jsxs("div",{className:"thread-filter-tabs",children:[u.jsxs("button",{className:`thread-filter-tab ${y==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",E,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",N,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",r.length,")"]})]}),D.length===0?u.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",y," threads."]}):D.map(j=>u.jsx(Ak,{thread:j,threadTurns:j.turns??[],onStop:()=>l(n,j.id),onResolve:()=>C(j),onReopen:()=>a(n,j.id),onDelete:()=>c(n,j.id),onFollowup:H=>o(n,j.id,H),onLocate:()=>M(j.id)},j.id)),x&&u.jsx(Rk,{thread:x,onClose:()=>C(null)})]}):u.jsx("div",{className:"empty-state",children:"No session selected"})}function Pk(){var f,h;Gt.trackRender("RightPanel");const n=F(m=>m.activeRightTab),r=F(m=>m.switchRightTab),o=F(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),l=((f=o==null?void 0:o.backgroundTasks)==null?void 0:f.length)??0,a=((h=o==null?void 0:o.threads)==null?void 0:h.filter(m=>m.status==="open").length)??0,c=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:l||void 0},{id:"threads",label:"Threads",badge:a||void 0}];return u.jsxs("div",{className:"ide-right",children:[u.jsx("div",{className:"right-tabs",children:c.map(m=>u.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?u.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),u.jsxs("div",{className:"right-content",children:[n==="turns"&&u.jsx(Sk,{}),n==="changes"&&u.jsx(Tk,{}),n==="tasks"&&u.jsx(_k,{}),n==="threads"&&u.jsx(Lk,{})]})]})}const Ne={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Su=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]}]}];function Ok(n){return Su.find(r=>r.id===n)}function nd(n){const r=Ok(n);return(r==null?void 0:r.models)??[]}function ig(n,r){return nd(n).find(o=>o.slug===r)}function Tu(n,r){var o;return((o=ig(n,r))==null?void 0:o.reasoningLevels)??[]}function Nu(n,r){var o;return(o=ig(n,r))==null?void 0:o.defaultReasoning}function zk(){const{activeSessionId:n,sessions:r,updateModelConfig:o}=F(),l=F(Q=>Q.showModelSelector),a=F(Q=>Q.setShowModelSelector),c=r.find(Q=>Q.id===n),f=F(Q=>Q.models),h=F(Q=>Q.modelsLoading),m=F(Q=>Q.loadModels),[g,y]=w.useState(!1),k=w.useRef(null);if(Xl(k,()=>y(!1),g),Au(()=>y(!1),g),w.useEffect(()=>{l&&(y(!0),a(!1))},[l,a]),w.useEffect(()=>{c!=null&&c.runtime_type&&m(c.runtime_type,c.cwd??void 0)},[c==null?void 0:c.runtime_type,c==null?void 0:c.cwd,m]),!c)return null;const x=c.runtime_type,C=c.model??"",D=c.model_reasoning_effort??"",E=f.length>0?f:[],N=nd(x),j=[...E.length>0?E:N];if(C&&!j.some(Q=>Q.slug===C)){const Q=N[0];j.unshift({slug:C,displayName:C,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function H(Q){return j.find(te=>te.slug===Q)}function P(Q){var te;return E.length>0?((te=H(Q))==null?void 0:te.reasoningLevels)??[]:Tu(x,Q)}function V(Q){var te;return E.length>0?(te=H(Q))==null?void 0:te.defaultReasoning:Nu(x,Q)}const ee=Su.find(Q=>Q.id===x),q=H(C),B=C?P(C):[],oe=(ee==null?void 0:ee.label)??x,ae=(q==null?void 0:q.displayName)??(C||"Default"),ce=B.find(Q=>Q.effort===D),Pe=(ce==null?void 0:ce.label)??(D||"Default");function _e(Q){var Z;const te=P(Q),G=te.some(W=>W.effort===D)?D:V(Q)??((Z=te[0])==null?void 0:Z.effort)??"";o(Q,G),y(!1)}function Oe(Q){o(C,Q),y(!1)}return u.jsxs("div",{className:"model-selector",ref:k,children:[u.jsxs("button",{className:"model-selector-btn",onClick:()=>y(!g),title:"Change model and thinking level",children:[u.jsx("span",{className:"model-selector-provider",children:oe}),u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-model",children:ae}),Pe!=="Default"&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-reasoning",children:Pe})]}),u.jsx(ri,{size:12,className:"model-selector-chevron"})]}),g&&u.jsxs("div",{className:"model-selector-popover",children:[u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Su.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.id===x?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===x){y(!1);return}o("","",Q.id)}},children:[u.jsx("span",{children:Q.label}),!Q.available&&u.jsxs("span",{className:"model-selector-coming-soon",children:[u.jsx(m0,{size:10})," Soon"]}),Q.id===x&&u.jsx(Yr,{size:12})]},Q.id))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&u.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&j.length===0&&u.jsx("div",{className:"model-selector-empty",children:"No models available"}),j.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.slug===C?"selected":""}`,onClick:()=>_e(Q.slug),children:[u.jsxs("div",{className:"model-selector-item-main",children:[u.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),u.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===C&&u.jsx(Yr,{size:12})]},Q.slug))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),B.length===0&&u.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),B.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.effort===D?"selected":""}`,onClick:()=>Oe(Q.effort),children:[u.jsx("span",{children:Q.label}),Q.effort===D&&u.jsx(Yr,{size:12})]},Q.effort))]})]})]})}function $k(n,r){if(!n||n.turns.length===0)return"—";const o=n.turns[0],l=n.turns[n.turns.length-1],a=r?null:l.updated_at;return Xy(o.created_at,a)}function El(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Fh(){const n=F(o=>o.setShowRemoteModal),r=Eu(window.location.hostname);return u.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[u.jsx(j0,{size:14})," AgentPane",r?` · ${r}`:""]})}function Uh(){const n=F(o=>o.vscodeViewOpen),r=F(o=>o.toggleVscodeView);return u.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[u.jsx(i0,{size:14})," VS Code"]})}function Fk(){var x,C;Gt.trackRender("StatusBar");const n=F(D=>D.activeSessionId),r=F(D=>n?D.sessions.find(E=>E.id===n)??null:null),o=F(D=>n?D.sessionDetails[n]??null:null),l=F(D=>D.wsConnected),a=F(D=>D.switchRightTab),c=(o==null?void 0:o.contextUsage)??null;if(!r)return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]});const f=Mu(r),h=$k(o,f.isRunning),m=(o==null?void 0:o.backgroundTasks)??[],g=new Set,y=new Map;for(const D of m)g.add(D.task_id),y.set(D.task_id,D.task_type);for(const D of(o==null?void 0:o.turns)??[])for(const E of D.items)if(E.type==="background_task"&&E.status==="in_progress"){const N=((x=E.data)==null?void 0:x.task_id)??E.external_item_id,M=((C=E.data)==null?void 0:C.task_type)??"unknown";g.add(N),y.set(N,M)}const k=[...y.values()].filter(D=>D==="local_bash").length;return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(zk,{}),k>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[u.jsx(hm,{size:14})," ",k]})]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:r.status==="failed"?{color:"var(--red)"}:void 0,children:[u.jsx(Lu,{status:f.dot})," ",f.label]}),c&&u.jsx(Uk,{usage:c}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-item",children:h}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]})}function Uk({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",o=`${El(n.totalTokens)} / ${El(n.contextWindow)} tokens`;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-context",title:o,children:u.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",El(n.totalTokens)," / ",El(n.contextWindow)]})})]})}function Bh(n){return Cr(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function Bk(n){return Ht("/vscode-web/start",{folder:n})}function Wk(n){return Ht("/vscode-web/heartbeat",{id:n})}const Hk=1e3,Vk=5*6e4;function Gk(){const n=F(k=>k.vscodeState),r=F(k=>k.vscodeId),o=F(k=>k.vscodeToken),l=F(k=>k.setVscodeView),a=F(k=>{var C;const x=k.activeSessionId?k.sessions.find(D=>D.id===k.activeSessionId):null;return x!=null&&x.cwd?x.cwd:((C=k.workspaces.find(D=>D.deleted===0))==null?void 0:C.path)??null}),[c,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{let k=!1;function x(){g.current&&(clearInterval(g.current),g.current=null)}async function C(){try{let E=await Bh(a);if((E.state==="stopped"||E.state==="error")&&(E=await Bk(a)),k||(l(E.state,E.id,E.token),E.state==="running"||E.state==="error"))return;g.current=setInterval(async()=>{const N=await Bh(a);k||(l(N.state,N.id,N.token),(N.state==="running"||N.state==="error"||N.state==="stopped")&&x())},Hk)}catch{k||l("error",null,null)}}C();const D=setInterval(()=>{const E=F.getState().vscodeId;E&&Wk(E).catch(()=>{})},Vk);return()=>{k=!0,x(),clearInterval(D)}},[h,a,l]);function y(){f(!1),l("starting",null,null),m(k=>k+1)}return n!=="running"||!o||!r?u.jsx("div",{className:"vscode-view vscode-view--loading",children:n==="error"?u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"VS Code could not start."}),u.jsxs("button",{className:"dialog-btn-cancel",onClick:y,children:[u.jsx(Yl,{size:14})," Retry"]})]}):u.jsxs("span",{className:"vscode-view-hint",children:[u.jsx(Kn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):u.jsxs("div",{className:"vscode-view",children:[!c&&u.jsxs("div",{className:"vscode-view-overlay",children:[u.jsx(Kn,{size:16,className:"spin"})," Loading VS Code…"]}),u.jsx("iframe",{src:`${sr()}/vscode/${r}/?tkn=${o}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]})}function qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const[c,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(x=>{const C=x.clientX-h.current,D=n==="left"?m.current+C:m.current-C,E=Math.min(o,Math.max(r,D));a(E)},[n,r,o,a]),y=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(x=>{x.preventDefault(),x.stopPropagation(),h.current=x.clientX,m.current=l(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",y)},[l,g,y]),dragging:c}}function Wh({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const{onPointerDown:c,dragging:f}=qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a});return u.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:c,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function Kk(){Gt.trackRender("IdeWorkspace");const n=F(f=>f.sidebarWidth),r=F(f=>f.rightPanelWidth),o=F(f=>f.setSidebarWidth),l=F(f=>f.setRightPanelWidth),a=F(f=>f.vscodeViewOpen);w.useEffect(()=>{const f=()=>{const h=Il(),{rightPanelWidth:m,setRightPanelWidth:g}=F.getState();m>h&&g(h)};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const c=`${n}px 6px 1fr 6px ${r}px`;return u.jsxs("div",{className:"ide-root",children:[u.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:c},children:[u.jsx(bw,{}),u.jsx(Wh,{side:"left",minWidth:iu,maxWidth:lu,getWidth:()=>F.getState().sidebarWidth,setWidth:o}),u.jsxs("div",{className:"ide-center",children:[u.jsx(Ew,{}),u.jsx("div",{className:"ide-render",children:u.jsx(ck,{})}),u.jsx(kk,{})]}),u.jsx(Wh,{side:"right",minWidth:Dl,maxWidth:Il(),getWidth:()=>F.getState().rightPanelWidth,setWidth:l}),u.jsx(Pk,{})]}),a&&u.jsx(Gk,{}),u.jsx(Fk,{})]})}function Xk(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:o,lastModelConfig:l}=F(),a=(l==null?void 0:l.provider)??"codex",c=(l==null?void 0:l.model)??"",f=(l==null?void 0:l.reasoning)??"",[h,m]=w.useState(""),[g,y]=w.useState(c),[k,x]=w.useState(f),[C,D]=w.useState("");if(!n)return null;const E=nd(a),N=g?Tu(a,g):[];function M(){o({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:C.trim()||void 0,runtime_type:a}),m(""),D("")}function j(P){P.key==="Escape"&&r(!1)}function H(P){var q;y(P);const V=Tu(a,P);V.some(B=>B.effort===k)||x(Nu(a,P)??((q=V[0])==null?void 0:q.effort)??"")}return u.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:j,children:[u.jsxs("div",{className:"dialog-header",children:[u.jsx("span",{className:"dialog-title",children:"New Session"}),u.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:u.jsx(ir,{size:16})})]}),u.jsxs("div",{className:"dialog-body",children:[u.jsxs("label",{className:"dialog-label",children:["Title (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:P=>m(P.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),u.jsxs("label",{className:"dialog-label",children:["Model",u.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:P=>H(P.target.value),children:[u.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(P=>u.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),N.length>0&&u.jsxs("label",{className:"dialog-label",children:["Thinking Level",u.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[u.jsxs("option",{value:"",children:["Default (",Nu(a,g),")"]}),N.map(P=>u.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),u.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:C,onChange:P=>D(P.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),u.jsxs("div",{className:"dialog-footer",children:[u.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),u.jsx("button",{className:"dialog-btn-create",onClick:M,children:"Create"})]})]})})}function Yk(){const n=F(k=>k.showCommandPalette),r=F(k=>k.setShowCommandPalette),o=F(),[l,a]=w.useState(""),[c,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=o.activeSessionId?o.sessionDetails[o.activeSessionId]:null,x=Kl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Xo,action:()=>o.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:vs,action:()=>{o.activeSessionId&&o.deleteSession(o.activeSessionId)},available:!!o.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Ql,action:()=>{const C=document.querySelector(".cmd-input");C==null||C.focus()},available:!!o.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:ii,action:()=>o.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:h0,action:()=>o.switchRightTab("turns"),available:!!o.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:a0,action:()=>o.switchRightTab("changes"),available:!!o.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:ir,action:()=>{o.activeSessionId&&o.closeTab(o.activeSessionId)},available:!!o.activeSessionId}]},[o]),g=w.useMemo(()=>{const k=l.toLowerCase().trim(),x=m.filter(C=>C.available);return k?x.filter(C=>C.label.toLowerCase().includes(k)||C.hint.toLowerCase().includes(k)):x},[m,l]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function y(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=g[c];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?u.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[u.jsxs("div",{className:"palette-search",children:[u.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:l,onChange:k=>{a(k.target.value),f(0)},onKeyDown:y}),u.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?u.jsx("div",{className:"palette-empty",children:"No matching commands"}):u.jsx("div",{className:"palette-list",children:g.map((k,x)=>{const C=k.icon;return u.jsxs("div",{className:`palette-item ${x===c?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[u.jsx("span",{className:"palette-item-icon",children:u.jsx(C,{size:16})}),u.jsx("span",{className:"palette-item-label",children:k.label}),u.jsx("span",{className:"palette-item-hint",children:k.hint}),x===c&&u.jsx(l0,{size:12,className:"palette-item-enter"})]},k.id)})}),u.jsxs("div",{className:"palette-footer",children:[u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↑"}),u.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↵"})," Select"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Hh=/^[a-z][a-z0-9-]{1,30}$/,Qk=2e3;function Zk(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:o}=F(),[l,a]=w.useState(null),[c,f]=w.useState(null),[h,m]=w.useState(!1),[g,y]=w.useState(!1),[k,x]=w.useState(!1),[C,D]=w.useState(!1),[E,N]=w.useState("main"),[M,j]=w.useState(""),[H,P]=w.useState(!1),[V,ee]=w.useState(null),q=w.useRef(null);Xl(q,()=>D(!1),C);const B=g||k,oe=w.useCallback(async()=>{m(!0),f(null);try{const G=await fetch(`${sr()}/remote/status`,{headers:{Accept:"application/json"}});if(!G.ok)throw new Error(`status ${G.status}`);a(await G.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(N("main"),ee(null),oe())},[n,oe]);const ae=V!==null&&V.state==="running";if(w.useEffect(()=>{if(!ae)return;const G=setInterval(async()=>{try{const Z=await fetch(`${sr()}/remote/enable`,{headers:{Accept:"application/json"}});Z.ok&&ee(await Z.json())}catch{}},Qk);return()=>clearInterval(G)},[ae]),!n)return null;const ce=!!(l!=null&&l.tunnel.provisioned)&&!!(l!=null&&l.service.running)&&!!(l!=null&&l.connection.ok);function Pe(G){G.key==="Escape"&&r(!1)}async function _e(G){if(Hh.test(G)){P(!0);try{const Z=await fetch(`${sr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:G})});if(!Z.ok)throw new Error(`enable ${Z.status}`);ee(await Z.json()),N("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Oe(){V!=null&&V.troubleshootingSessionId&&(o(V.troubleshootingSessionId),r(!1))}async function Q(){y(!0);try{await fetch(`${sr()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{y(!1)}}async function te(){if(D(!1),!!window.confirm(`Remove the tunnel completely?
419
+ `;g(G=>G+te),E(!1),H(""),(ne=window.getSelection())==null||ne.removeAllRanges(),setTimeout(()=>{if(x.current){oe(),x.current.focus();const G=x.current.value.length;x.current.setSelectionRange(G,G)}},0)},[j]);return u.jsxs("div",{className:`thread-card ${n.status==="resolved"?"thread-resolved":""}`,id:`thread-${n.id}`,children:[u.jsxs("div",{className:"thread-card-header",onClick:()=>k(te=>!te),children:[u.jsx("div",{className:"thread-card-quote",children:n.selected_text===null?((Q=(Oe=(_e=n.turns)==null?void 0:_e[0])==null?void 0:Oe.user_prompt)==null?void 0:Q.slice(0,100))||"Quick question":`“${n.selected_text.slice(0,100)}${n.selected_text.length>100?"…":""}”`}),u.jsxs("div",{className:"thread-card-header-right",children:[n.selected_text!==null&&u.jsx("button",{className:"thread-locate-btn",onClick:te=>{te.stopPropagation(),h()},title:"Scroll to text",children:u.jsx(x0,{size:12})}),u.jsx("span",{className:`thread-status-badge ${n.status==="open"?"thread-status-open":"thread-status-resolved"}`,children:n.status==="open"?"Open":"Resolved"})]})]}),y&&u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"thread-card-conversation",ref:C,onMouseDown:ae,children:[r.map(te=>u.jsx(Mk,{turn:te},te.id)),r.length===0&&u.jsx("div",{className:"thread-card-placeholder",children:"No messages yet."})]}),D&&u.jsx("div",{className:"selection-actions",style:{left:N.x,top:N.y},children:u.jsxs("button",{className:"discuss-button",onClick:Pe,title:"Quote this text in your follow-up",children:[u.jsx(fm,{size:14}),u.jsx("span",{children:"Quote"})]})}),n.status==="open"&&u.jsxs("div",{className:"thread-card-followup",children:[u.jsx("textarea",{ref:x,className:"thread-card-followup-input",placeholder:P?"Agent is running…":"Type a follow-up…",value:m,onChange:te=>{Gt.markInputChange(),g(te.target.value),oe()},disabled:P,rows:1,style:{minHeight:V,maxHeight:ee},onKeyDown:te=>{Gt.markKeystroke(),te.key==="Enter"&&(te.metaKey||te.ctrlKey)&&!P&&m.trim()&&(te.preventDefault(),f(m.trim()),g(""),B(V))}}),u.jsx("button",{className:"thread-card-followup-send",disabled:P||!m.trim(),onClick:()=>{f(m.trim()),g("")},children:u.jsx(Ql,{size:13})}),P&&u.jsx("button",{className:"thread-card-followup-stop",onClick:o,title:"Stop this thread's turn (Esc)",children:u.jsx(ii,{size:13})})]}),u.jsxs("div",{className:"thread-card-actions",children:[n.status==="open"?u.jsxs("button",{className:"thread-action-btn",onClick:l,title:"Resolve thread",children:[u.jsx(zu,{size:13})," Resolve"]}):u.jsxs("button",{className:"thread-action-btn",onClick:a,title:"Reopen thread",children:[u.jsx(Yl,{size:13})," Reopen"]}),u.jsxs("button",{className:"thread-action-btn thread-action-danger",onClick:c,title:"Delete thread",children:[u.jsx(vs,{size:13})," Delete"]})]})]})]})}function Lk(){Gt.trackRender("ThreadsPanel");const n=F(j=>j.activeSessionId),r=F(j=>{var H;return j.activeSessionId?((H=j.sessionDetails[j.activeSessionId])==null?void 0:H.threads)??$h:$h}),o=F(j=>j.followupThread),l=F(j=>j.cancelThreadTurn),a=F(j=>j.reopenThread),c=F(j=>j.deleteThread),f=F(j=>j.activeRightTab),h=F(j=>j.switchRightTab),m=F(j=>j.deepLinkThreadId),g=F(j=>j.setDeepLinkThreadId),[y,k]=w.useState("open"),[x,C]=w.useState(null);w.useEffect(()=>{if(!m)return;const j=m;g(null),k(P=>r.some(V=>V.id===j&&V.status==="open")?P:"all");const H=setTimeout(()=>{const P=document.getElementById(`thread-${j}`);P&&(P.scrollIntoView({behavior:"smooth",block:"center"}),P.classList.add("thread-card-highlighted"),setTimeout(()=>P.classList.remove("thread-card-highlighted"),1500))},100);return()=>clearTimeout(H)},[m,g,r]);const D=r.filter(j=>y==="open"?j.status==="open":y==="resolved"?j.status==="resolved":!0),E=r.filter(j=>j.status==="open").length,N=r.filter(j=>j.status==="resolved").length;function M(j){f==="changes"&&h("turns"),setTimeout(()=>{const H=document.querySelector(`mark[data-thread-id="${j}"]`);H&&(H.scrollIntoView({behavior:"smooth",block:"center"}),H.classList.add("thread-mark-flash"),setTimeout(()=>H.classList.remove("thread-mark-flash"),1500))},f==="changes"?150:50)}return n?r.length===0?u.jsxs("div",{className:"empty-state",children:[u.jsx(v0,{size:24,style:{opacity:.3,marginBottom:8}}),u.jsx("div",{children:"No threads yet."}),u.jsx("div",{style:{fontSize:"11px",marginTop:"4px"},children:"Select text in an agent response to start a discussion."})]}):u.jsxs("div",{children:[u.jsxs("div",{className:"thread-filter-tabs",children:[u.jsxs("button",{className:`thread-filter-tab ${y==="open"?"active":""}`,onClick:()=>k("open"),children:["Open (",E,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="resolved"?"active":""}`,onClick:()=>k("resolved"),children:["Resolved (",N,")"]}),u.jsxs("button",{className:`thread-filter-tab ${y==="all"?"active":""}`,onClick:()=>k("all"),children:["All (",r.length,")"]})]}),D.length===0?u.jsxs("div",{className:"empty-state",style:{padding:"20px 0"},children:["No ",y," threads."]}):D.map(j=>u.jsx(Ak,{thread:j,threadTurns:j.turns??[],onStop:()=>l(n,j.id),onResolve:()=>C(j),onReopen:()=>a(n,j.id),onDelete:()=>c(n,j.id),onFollowup:H=>o(n,j.id,H),onLocate:()=>M(j.id)},j.id)),x&&u.jsx(Rk,{thread:x,onClose:()=>C(null)})]}):u.jsx("div",{className:"empty-state",children:"No session selected"})}function Pk(){var f,h;Gt.trackRender("RightPanel");const n=F(m=>m.activeRightTab),r=F(m=>m.switchRightTab),o=F(m=>m.activeSessionId?m.sessionDetails[m.activeSessionId]:null),l=((f=o==null?void 0:o.backgroundTasks)==null?void 0:f.length)??0,a=((h=o==null?void 0:o.threads)==null?void 0:h.filter(m=>m.status==="open").length)??0,c=[{id:"turns",label:"Turns"},{id:"changes",label:"Changes"},{id:"tasks",label:"Tasks",badge:l||void 0},{id:"threads",label:"Threads",badge:a||void 0}];return u.jsxs("div",{className:"ide-right",children:[u.jsx("div",{className:"right-tabs",children:c.map(m=>u.jsxs("div",{className:`right-tab ${n===m.id?"active":""}`,onClick:()=>r(m.id),children:[m.label,m.badge?u.jsx("span",{className:"right-tab-badge",children:m.badge}):null]},m.id))}),u.jsxs("div",{className:"right-content",children:[n==="turns"&&u.jsx(Sk,{}),n==="changes"&&u.jsx(Tk,{}),n==="tasks"&&u.jsx(_k,{}),n==="threads"&&u.jsx(Lk,{})]})]})}const Ne={low:{effort:"low",label:"Low"},medium:{effort:"medium",label:"Medium"},high:{effort:"high",label:"High"},xhigh:{effort:"xhigh",label:"Extra High"},max:{effort:"max",label:"Max"},ultra:{effort:"ultra",label:"Ultra"}},Su=[{id:"codex",label:"Codex",available:!0,models:[{slug:"gpt-5.6-sol",displayName:"GPT-5.6-Sol",description:"Flagship — complex, open-ended work",defaultReasoning:"low",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-terra",displayName:"GPT-5.6-Terra",description:"Balanced all-rounder for everyday work",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max,Ne.ultra]},{slug:"gpt-5.6-luna",displayName:"GPT-5.6-Luna",description:"Fast, affordable — clear, repeatable tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"gpt-5.5",displayName:"GPT-5.5",description:"Previous-gen frontier model",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh]}]},{id:"claude",label:"Claude",available:!0,models:[{slug:"claude-sonnet-5-5",displayName:"Claude Sonnet 5.5",description:"Best combination of speed and intelligence",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-sonnet-5",displayName:"Claude Sonnet 5",description:"Previous-gen balanced all-rounder",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-opus-5",displayName:"Claude Opus 5",description:"Deep reasoning for complex tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]},{slug:"claude-fable-5",displayName:"Claude Fable 5",description:"Fast and efficient for simple tasks",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high,Ne.xhigh,Ne.max]}]},{id:"repoburg",label:"Repoburg",available:!0,models:[{slug:"ollama/glm-5.3:cloud",displayName:"GLM-5.3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/glm-5.3-flash:cloud",displayName:"GLM-5.3 Flash",description:"Ollama Cloud — fast",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/minimax-m3:cloud",displayName:"MiniMax M3",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]},{slug:"ollama/deepseek-v4-pro:cloud",displayName:"DeepSeek V4 Pro",description:"Ollama Cloud",defaultReasoning:"medium",reasoningLevels:[Ne.low,Ne.medium,Ne.high]}]}];function Ok(n){return Su.find(r=>r.id===n)}function nd(n){const r=Ok(n);return(r==null?void 0:r.models)??[]}function ig(n,r){return nd(n).find(o=>o.slug===r)}function Tu(n,r){var o;return((o=ig(n,r))==null?void 0:o.reasoningLevels)??[]}function Nu(n,r){var o;return(o=ig(n,r))==null?void 0:o.defaultReasoning}function zk(){const{activeSessionId:n,sessions:r,updateModelConfig:o}=F(),l=F(Q=>Q.showModelSelector),a=F(Q=>Q.setShowModelSelector),c=r.find(Q=>Q.id===n),f=F(Q=>Q.models),h=F(Q=>Q.modelsLoading),m=F(Q=>Q.loadModels),[g,y]=w.useState(!1),k=w.useRef(null);if(Xl(k,()=>y(!1),g),Au(()=>y(!1),g),w.useEffect(()=>{l&&(y(!0),a(!1))},[l,a]),w.useEffect(()=>{c!=null&&c.runtime_type&&m(c.runtime_type,c.cwd??void 0)},[c==null?void 0:c.runtime_type,c==null?void 0:c.cwd,m]),!c)return null;const x=c.runtime_type,C=c.model??"",D=c.model_reasoning_effort??"",E=f.length>0?f:[],N=nd(x),j=[...E.length>0?E:N];if(C&&!j.some(Q=>Q.slug===C)){const Q=N[0];j.unshift({slug:C,displayName:C,description:"Custom model",defaultReasoning:(Q==null?void 0:Q.defaultReasoning)??"medium",reasoningLevels:(Q==null?void 0:Q.reasoningLevels)??[]})}function H(Q){return j.find(te=>te.slug===Q)}function P(Q){var te;return E.length>0?((te=H(Q))==null?void 0:te.reasoningLevels)??[]:Tu(x,Q)}function V(Q){var te;return E.length>0?(te=H(Q))==null?void 0:te.defaultReasoning:Nu(x,Q)}const ee=Su.find(Q=>Q.id===x),q=H(C),B=C?P(C):[],oe=(ee==null?void 0:ee.label)??x,ae=(q==null?void 0:q.displayName)??(C||"Default"),ce=B.find(Q=>Q.effort===D),Pe=(ce==null?void 0:ce.label)??(D||"Default");function _e(Q){var Z;const te=P(Q),G=te.some(W=>W.effort===D)?D:V(Q)??((Z=te[0])==null?void 0:Z.effort)??"";o(Q,G),y(!1)}function Oe(Q){o(C,Q),y(!1)}return u.jsxs("div",{className:"model-selector",ref:k,children:[u.jsxs("button",{className:"model-selector-btn",onClick:()=>y(!g),title:"Change model and thinking level",children:[u.jsx("span",{className:"model-selector-provider",children:oe}),u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-model",children:ae}),Pe!=="Default"&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"model-selector-sep",children:"›"}),u.jsx("span",{className:"model-selector-reasoning",children:Pe})]}),u.jsx(ri,{size:12,className:"model-selector-chevron"})]}),g&&u.jsxs("div",{className:"model-selector-popover",children:[u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Provider"}),Su.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.id===x?"selected":""} ${Q.available?"":"disabled"}`,onClick:()=>{if(Q.available){if(Q.id===x){y(!1);return}o("","",Q.id)}},children:[u.jsx("span",{children:Q.label}),!Q.available&&u.jsxs("span",{className:"model-selector-coming-soon",children:[u.jsx(m0,{size:10})," Soon"]}),Q.id===x&&u.jsx(Yr,{size:12})]},Q.id))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Model"}),h&&u.jsx("div",{className:"model-selector-empty",children:"Loading models…"}),!h&&j.length===0&&u.jsx("div",{className:"model-selector-empty",children:"No models available"}),j.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.slug===C?"selected":""}`,onClick:()=>_e(Q.slug),children:[u.jsxs("div",{className:"model-selector-item-main",children:[u.jsx("span",{className:"model-selector-item-name",children:Q.displayName}),u.jsx("span",{className:"model-selector-item-desc",children:Q.description})]}),Q.slug===C&&u.jsx(Yr,{size:12})]},Q.slug))]}),u.jsxs("div",{className:"model-selector-column",children:[u.jsx("div",{className:"model-selector-col-header",children:"Thinking"}),B.length===0&&u.jsx("div",{className:"model-selector-empty",children:"Select a model first"}),B.map(Q=>u.jsxs("div",{className:`model-selector-item ${Q.effort===D?"selected":""}`,onClick:()=>Oe(Q.effort),children:[u.jsx("span",{children:Q.label}),Q.effort===D&&u.jsx(Yr,{size:12})]},Q.effort))]})]})]})}function $k(n,r){if(!n||n.turns.length===0)return"—";const o=n.turns[0],l=n.turns[n.turns.length-1],a=r?null:l.updated_at;return Xy(o.created_at,a)}function El(n){return n>=1e6?`${(n/1e6).toFixed(n%1e6===0?0:1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}function Fh(){const n=F(o=>o.setShowRemoteModal),r=Eu(window.location.hostname);return u.jsxs("div",{className:"sb-item",style:{cursor:"pointer"},title:"Remote access — make this machine remote",onClick:()=>n(!0),children:[u.jsx(j0,{size:14})," Repoburg",r?` · ${r}`:""]})}function Uh(){const n=F(o=>o.vscodeViewOpen),r=F(o=>o.toggleVscodeView);return u.jsxs("button",{className:`sb-item sb-btn${n?" sb-item-active":""}`,title:n?"Back to the agent view":"Open VS Code",onClick:r,children:[u.jsx(i0,{size:14})," VS Code"]})}function Fk(){var x,C;Gt.trackRender("StatusBar");const n=F(D=>D.activeSessionId),r=F(D=>n?D.sessions.find(E=>E.id===n)??null:null),o=F(D=>n?D.sessionDetails[n]??null:null),l=F(D=>D.wsConnected),a=F(D=>D.switchRightTab),c=(o==null?void 0:o.contextUsage)??null;if(!r)return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]});const f=Mu(r),h=$k(o,f.isRunning),m=(o==null?void 0:o.backgroundTasks)??[],g=new Set,y=new Map;for(const D of m)g.add(D.task_id),y.set(D.task_id,D.task_type);for(const D of(o==null?void 0:o.turns)??[])for(const E of D.items)if(E.type==="background_task"&&E.status==="in_progress"){const N=((x=E.data)==null?void 0:x.task_id)??E.external_item_id,M=((C=E.data)==null?void 0:C.task_type)??"unknown";g.add(N),y.set(N,M)}const k=[...y.values()].filter(D=>D==="local_bash").length;return u.jsxs("div",{className:"ide-statusbar",children:[u.jsx(Fh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(Uh,{}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx(zk,{}),k>0&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:{color:"var(--amber)",cursor:"pointer"},title:`${k} Monitor task${k>1?"s":""} running — click to view`,onClick:()=>a("tasks"),children:[u.jsx(hm,{size:14})," ",k]})]}),u.jsx("div",{className:"sb-spacer"}),u.jsxs("div",{className:"sb-item",title:l?"WebSocket connected":"WebSocket disconnected",children:[u.jsx("span",{className:`status-dot ${l?"done":"error"}`}),l?"Live":"Offline"]}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",style:r.status==="failed"?{color:"var(--red)"}:void 0,children:[u.jsx(Lu,{status:f.dot})," ",f.label]}),c&&u.jsx(Uk,{usage:c}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-item",children:h}),u.jsx("div",{className:"sb-divider",children:"|"}),u.jsxs("div",{className:"sb-item",children:[u.jsx(Up,{size:14})," K"]})]})}function Uk({usage:n}){const r=n.percentage>=85?"var(--red)":n.percentage>=60?"var(--amber)":"var(--green)",o=`${El(n.totalTokens)} / ${El(n.contextWindow)} tokens`;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"sb-divider",children:"|"}),u.jsx("div",{className:"sb-context",title:o,children:u.jsxs("span",{className:"sb-context-text",style:{color:r},children:[Math.round(n.percentage),"% / ",El(n.totalTokens)," / ",El(n.contextWindow)]})})]})}function Bh(n){return Cr(`/vscode-web/status?folder=${encodeURIComponent(n??"")}`)}function Bk(n){return Ht("/vscode-web/start",{folder:n})}function Wk(n){return Ht("/vscode-web/heartbeat",{id:n})}const Hk=1e3,Vk=5*6e4;function Gk(){const n=F(k=>k.vscodeState),r=F(k=>k.vscodeId),o=F(k=>k.vscodeToken),l=F(k=>k.setVscodeView),a=F(k=>{var C;const x=k.activeSessionId?k.sessions.find(D=>D.id===k.activeSessionId):null;return x!=null&&x.cwd?x.cwd:((C=k.workspaces.find(D=>D.deleted===0))==null?void 0:C.path)??null}),[c,f]=w.useState(!1),[h,m]=w.useState(0),g=w.useRef(null);w.useEffect(()=>{let k=!1;function x(){g.current&&(clearInterval(g.current),g.current=null)}async function C(){try{let E=await Bh(a);if((E.state==="stopped"||E.state==="error")&&(E=await Bk(a)),k||(l(E.state,E.id,E.token),E.state==="running"||E.state==="error"))return;g.current=setInterval(async()=>{const N=await Bh(a);k||(l(N.state,N.id,N.token),(N.state==="running"||N.state==="error"||N.state==="stopped")&&x())},Hk)}catch{k||l("error",null,null)}}C();const D=setInterval(()=>{const E=F.getState().vscodeId;E&&Wk(E).catch(()=>{})},Vk);return()=>{k=!0,x(),clearInterval(D)}},[h,a,l]);function y(){f(!1),l("starting",null,null),m(k=>k+1)}return n!=="running"||!o||!r?u.jsx("div",{className:"vscode-view vscode-view--loading",children:n==="error"?u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"VS Code could not start."}),u.jsxs("button",{className:"dialog-btn-cancel",onClick:y,children:[u.jsx(Yl,{size:14})," Retry"]})]}):u.jsxs("span",{className:"vscode-view-hint",children:[u.jsx(Kn,{size:16,className:"spin"})," Starting VS Code — first start downloads the server component (~20 s)."]})}):u.jsxs("div",{className:"vscode-view",children:[!c&&u.jsxs("div",{className:"vscode-view-overlay",children:[u.jsx(Kn,{size:16,className:"spin"})," Loading VS Code…"]}),u.jsx("iframe",{src:`${sr()}/vscode/${r}/?tkn=${o}${a?`&folder=${encodeURIComponent(a)}`:""}`,title:"VS Code",className:"vscode-view-frame",onLoad:()=>f(!0)},r)]})}function qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const[c,f]=w.useState(!1),h=w.useRef(0),m=w.useRef(0),g=w.useCallback(x=>{const C=x.clientX-h.current,D=n==="left"?m.current+C:m.current-C,E=Math.min(o,Math.max(r,D));a(E)},[n,r,o,a]),y=w.useCallback(()=>{window.removeEventListener("pointermove",g),window.removeEventListener("pointerup",y),document.body.classList.remove("is-resizing"),f(!1)},[g]);return{onPointerDown:w.useCallback(x=>{x.preventDefault(),x.stopPropagation(),h.current=x.clientX,m.current=l(),f(!0),document.body.classList.add("is-resizing"),window.addEventListener("pointermove",g),window.addEventListener("pointerup",y)},[l,g,y]),dragging:c}}function Wh({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a}){const{onPointerDown:c,dragging:f}=qk({side:n,minWidth:r,maxWidth:o,getWidth:l,setWidth:a});return u.jsx("div",{className:`resize-handle ${n}${f?" dragging":""}`,onPointerDown:c,role:"separator","aria-orientation":"vertical","aria-label":`Resize ${n} panel`,"data-resizing":f?"":void 0})}function Kk(){Gt.trackRender("IdeWorkspace");const n=F(f=>f.sidebarWidth),r=F(f=>f.rightPanelWidth),o=F(f=>f.setSidebarWidth),l=F(f=>f.setRightPanelWidth),a=F(f=>f.vscodeViewOpen);w.useEffect(()=>{const f=()=>{const h=Il(),{rightPanelWidth:m,setRightPanelWidth:g}=F.getState();m>h&&g(h)};return window.addEventListener("resize",f),()=>window.removeEventListener("resize",f)},[]);const c=`${n}px 6px 1fr 6px ${r}px`;return u.jsxs("div",{className:"ide-root",children:[u.jsxs("div",{className:`ide-layout ${a?"ide-hidden":""}`,style:{gridTemplateColumns:c},children:[u.jsx(bw,{}),u.jsx(Wh,{side:"left",minWidth:iu,maxWidth:lu,getWidth:()=>F.getState().sidebarWidth,setWidth:o}),u.jsxs("div",{className:"ide-center",children:[u.jsx(Ew,{}),u.jsx("div",{className:"ide-render",children:u.jsx(ck,{})}),u.jsx(kk,{})]}),u.jsx(Wh,{side:"right",minWidth:Dl,maxWidth:Il(),getWidth:()=>F.getState().rightPanelWidth,setWidth:l}),u.jsx(Pk,{})]}),a&&u.jsx(Gk,{}),u.jsx(Fk,{})]})}function Xk(){const{showNewSessionDialog:n,setShowNewSessionDialog:r,createSession:o,lastModelConfig:l}=F(),a=(l==null?void 0:l.provider)??"codex",c=(l==null?void 0:l.model)??"",f=(l==null?void 0:l.reasoning)??"",[h,m]=w.useState(""),[g,y]=w.useState(c),[k,x]=w.useState(f),[C,D]=w.useState("");if(!n)return null;const E=nd(a),N=g?Tu(a,g):[];function M(){o({title:h.trim()||void 0,model:g||void 0,model_reasoning_effort:k||void 0,cwd:C.trim()||void 0,runtime_type:a}),m(""),D("")}function j(P){P.key==="Escape"&&r(!1)}function H(P){var q;y(P);const V=Tu(a,P);V.some(B=>B.effort===k)||x(Nu(a,P)??((q=V[0])==null?void 0:q.effort)??"")}return u.jsx("div",{className:"dialog-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"dialog",onClick:P=>P.stopPropagation(),onKeyDown:j,children:[u.jsxs("div",{className:"dialog-header",children:[u.jsx("span",{className:"dialog-title",children:"New Session"}),u.jsx("button",{className:"dialog-close",onClick:()=>r(!1),children:u.jsx(ir,{size:16})})]}),u.jsxs("div",{className:"dialog-body",children:[u.jsxs("label",{className:"dialog-label",children:["Title (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:h,onChange:P=>m(P.target.value),placeholder:"e.g. refactor auth module",autoFocus:!0})]}),u.jsxs("label",{className:"dialog-label",children:["Model",u.jsxs("select",{className:"dialog-input dialog-select",value:g,onChange:P=>H(P.target.value),children:[u.jsx("option",{value:"",children:"Default (Codex picks)"}),E.map(P=>u.jsxs("option",{value:P.slug,children:[P.displayName," — ",P.description]},P.slug))]})]}),N.length>0&&u.jsxs("label",{className:"dialog-label",children:["Thinking Level",u.jsxs("select",{className:"dialog-input dialog-select",value:k,onChange:P=>x(P.target.value),children:[u.jsxs("option",{value:"",children:["Default (",Nu(a,g),")"]}),N.map(P=>u.jsx("option",{value:P.effort,children:P.label},P.effort))]})]}),u.jsxs("label",{className:"dialog-label",children:["Working Directory (optional)",u.jsx("input",{className:"dialog-input",type:"text",value:C,onChange:P=>D(P.target.value),placeholder:"e.g. /Users/me/projects/my-app"})]})]}),u.jsxs("div",{className:"dialog-footer",children:[u.jsx("button",{className:"dialog-btn-cancel",onClick:()=>r(!1),children:"Cancel"}),u.jsx("button",{className:"dialog-btn-create",onClick:M,children:"Create"})]})]})})}function Yk(){const n=F(k=>k.showCommandPalette),r=F(k=>k.setShowCommandPalette),o=F(),[l,a]=w.useState(""),[c,f]=w.useState(0),h=w.useRef(null),m=w.useMemo(()=>{const k=o.activeSessionId?o.sessionDetails[o.activeSessionId]:null,x=Kl(k);return[{id:"new-session",label:"New Session",hint:"Create a new Codex session",icon:Xo,action:()=>o.setShowNewSessionDialog(!0),available:!0},{id:"delete-session",label:"Delete Session",hint:"Delete the active session",icon:vs,action:()=>{o.activeSessionId&&o.deleteSession(o.activeSessionId)},available:!!o.activeSessionId},{id:"send-message",label:"Send Message",hint:"Focus the message input",icon:Ql,action:()=>{const C=document.querySelector(".cmd-input");C==null||C.focus()},available:!!o.activeSessionId&&!x},{id:"cancel-turn",label:"Cancel Turn",hint:"Cancel the running turn",icon:ii,action:()=>o.cancelTurn(),available:x},{id:"tab-turns",label:"Switch to Turns Tab",hint:"View conversation timeline",icon:h0,action:()=>o.switchRightTab("turns"),available:!!o.activeSessionId},{id:"tab-changes",label:"Switch to Changes Tab",hint:"View file changes",icon:a0,action:()=>o.switchRightTab("changes"),available:!!o.activeSessionId},{id:"close-tab",label:"Close Tab",hint:"Close the active session tab",icon:ir,action:()=>{o.activeSessionId&&o.closeTab(o.activeSessionId)},available:!!o.activeSessionId}]},[o]),g=w.useMemo(()=>{const k=l.toLowerCase().trim(),x=m.filter(C=>C.available);return k?x.filter(C=>C.label.toLowerCase().includes(k)||C.hint.toLowerCase().includes(k)):x},[m,l]);w.useEffect(()=>{n&&(a(""),f(0),setTimeout(()=>{var k;return(k=h.current)==null?void 0:k.focus()},50))},[n]);function y(k){if(k.key==="ArrowDown")k.preventDefault(),f(x=>Math.min(x+1,g.length-1));else if(k.key==="ArrowUp")k.preventDefault(),f(x=>Math.max(x-1,0));else if(k.key==="Enter"){k.preventDefault();const x=g[c];x&&(x.action(),r(!1))}else k.key==="Escape"&&r(!1)}return n?u.jsx("div",{className:"palette-overlay",onClick:()=>r(!1),children:u.jsxs("div",{className:"palette",onClick:k=>k.stopPropagation(),children:[u.jsxs("div",{className:"palette-search",children:[u.jsx("input",{ref:h,type:"text",placeholder:"Type a command…",value:l,onChange:k=>{a(k.target.value),f(0)},onKeyDown:y}),u.jsx("span",{className:"palette-esc",children:"ESC"})]}),g.length===0?u.jsx("div",{className:"palette-empty",children:"No matching commands"}):u.jsx("div",{className:"palette-list",children:g.map((k,x)=>{const C=k.icon;return u.jsxs("div",{className:`palette-item ${x===c?"selected":""}`,onClick:()=>{k.action(),r(!1)},onMouseEnter:()=>f(x),children:[u.jsx("span",{className:"palette-item-icon",children:u.jsx(C,{size:16})}),u.jsx("span",{className:"palette-item-label",children:k.label}),u.jsx("span",{className:"palette-item-hint",children:k.hint}),x===c&&u.jsx(l0,{size:12,className:"palette-item-enter"})]},k.id)})}),u.jsxs("div",{className:"palette-footer",children:[u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↑"}),u.jsx("span",{className:"kbd",children:"↓"})," Navigate"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"↵"})," Select"]}),u.jsxs("span",{className:"palette-footer-hint",children:[u.jsx("span",{className:"kbd",children:"Esc"})," Close"]})]})]})}):null}const Hh=/^[a-z][a-z0-9-]{1,30}$/,Qk=2e3;function Zk(){const{showRemoteModal:n,setShowRemoteModal:r,selectSession:o}=F(),[l,a]=w.useState(null),[c,f]=w.useState(null),[h,m]=w.useState(!1),[g,y]=w.useState(!1),[k,x]=w.useState(!1),[C,D]=w.useState(!1),[E,N]=w.useState("main"),[M,j]=w.useState(""),[H,P]=w.useState(!1),[V,ee]=w.useState(null),q=w.useRef(null);Xl(q,()=>D(!1),C);const B=g||k,oe=w.useCallback(async()=>{m(!0),f(null);try{const G=await fetch(`${sr()}/remote/status`,{headers:{Accept:"application/json"}});if(!G.ok)throw new Error(`status ${G.status}`);a(await G.json())}catch{a(null),f("Machine management is only available from this machine's local pane.")}finally{m(!1)}},[]);w.useEffect(()=>{n&&(N("main"),ee(null),oe())},[n,oe]);const ae=V!==null&&V.state==="running";if(w.useEffect(()=>{if(!ae)return;const G=setInterval(async()=>{try{const Z=await fetch(`${sr()}/remote/enable`,{headers:{Accept:"application/json"}});Z.ok&&ee(await Z.json())}catch{}},Qk);return()=>clearInterval(G)},[ae]),!n)return null;const ce=!!(l!=null&&l.tunnel.provisioned)&&!!(l!=null&&l.service.running)&&!!(l!=null&&l.connection.ok);function Pe(G){G.key==="Escape"&&r(!1)}async function _e(G){if(Hh.test(G)){P(!0);try{const Z=await fetch(`${sr()}/remote/enable`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({mahlas:G})});if(!Z.ok)throw new Error(`enable ${Z.status}`);ee(await Z.json()),N("setup")}catch{f("Could not start the setup — check the daemon logs.")}finally{P(!1)}}}function Oe(){V!=null&&V.troubleshootingSessionId&&(o(V.troubleshootingSessionId),r(!1))}async function Q(){y(!0);try{await fetch(`${sr()}/remote/disable`,{method:"POST"}),await oe()}catch{f("Could not stop the tunnel service — check the service logs.")}finally{y(!1)}}async function te(){if(D(!1),!!window.confirm(`Remove the tunnel completely?
420
420
 
421
421
  This deletes the Cloudflare tunnel, its DNS record and Access app, and this machine's remote state. The mahlas is released.
422
422
 
@@ -3,14 +3,14 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>AgentPane</title>
6
+ <title>Repoburg</title>
7
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
9
  <link
10
10
  href="https://fonts.googleapis.com/css2?family=Inter:wght@400;450;510;590;600&family=JetBrains+Mono:wght@400;500&display=swap"
11
11
  rel="stylesheet"
12
12
  />
13
- <script type="module" crossorigin src="/assets/index-BGAclp9s.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-CpjdL6KA.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-B8tLcszC.css">
15
15
  </head>
16
16
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repoburg",
3
- "version": "1.3.234",
3
+ "version": "1.3.235",
4
4
  "description": "A local AI-powered software developer assistant that runs on your own machine.",
5
5
  "author": "Celal Ertug",
6
6
  "license": "SEE LICENSE IN LICENSE",