@sma1lboy/kobe 0.7.63 → 0.7.64

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.
Files changed (68) hide show
  1. package/dist/cli/index.js +556 -226
  2. package/dist/web-ui/assets/AppShell-D1NVcP6B.js +5 -0
  3. package/dist/web-ui/assets/Board-B3c_C7H3.js +1 -0
  4. package/dist/web-ui/assets/BoardPeek-C26MBDcA.js +2 -0
  5. package/dist/web-ui/assets/{ChatTerminal-CYhDduOa.js → ChatTerminal-yge5k7Tv.js} +3 -3
  6. package/dist/web-ui/assets/ChatTranscript-33WbiW13.js +1 -0
  7. package/dist/web-ui/assets/ConfirmDialog-DCc0Zkwj.js +1 -0
  8. package/dist/web-ui/assets/IssueIntakePanel-DjrzyEkd.js +1 -0
  9. package/dist/web-ui/assets/IssuePeek-DYnkLVGs.js +1 -0
  10. package/dist/web-ui/assets/IssuesPage-CdK0OK8H.js +1 -0
  11. package/dist/web-ui/assets/RichEditor-Ct8Bv8fj.js +180 -0
  12. package/dist/web-ui/assets/{SettingsPage-BtnEKNBk.js → SettingsPage-BaAaaLxY.js} +2 -2
  13. package/dist/web-ui/assets/SlideOver-DSR5NT1U.js +1 -0
  14. package/dist/web-ui/assets/ViewToggle-C0OVZQlS.js +1 -0
  15. package/dist/web-ui/assets/{WorkspaceTabs-CCVLs4VG.js → WorkspaceTabs-DU5QKBx-.js} +3 -3
  16. package/dist/web-ui/assets/arrow-left-BXrVItPe.js +1 -0
  17. package/dist/web-ui/assets/board-BI0KpNrh.js +1 -0
  18. package/dist/web-ui/assets/chips-L2qle6td.js +1 -0
  19. package/dist/web-ui/assets/createLucideIcon-Dn8f0BBU.js +1 -0
  20. package/dist/web-ui/assets/{external-link-DcgSntwH.js → external-link-CGQEaSmM.js} +1 -1
  21. package/dist/web-ui/assets/external-store-DUMhHvtl.js +1 -0
  22. package/dist/web-ui/assets/harness-BRyFen92.js +1 -0
  23. package/dist/web-ui/assets/index-BzhHFAu3.js +10 -0
  24. package/dist/web-ui/assets/index-CeXtZlZi.css +1 -0
  25. package/dist/web-ui/assets/issues-B3DaQO0x.js +3 -0
  26. package/dist/web-ui/assets/issues-CQ70I3R5.js +1 -0
  27. package/dist/web-ui/assets/lazy-issue-panels-66N4DTZp.js +6 -0
  28. package/dist/web-ui/assets/{rotate-cw-C_GlCKHM.js → rotate-cw-zLlRat-M.js} +1 -1
  29. package/dist/web-ui/assets/routes-CVNhlHmu.js +1 -0
  30. package/dist/web-ui/assets/store-CbgoTSs1.js +2 -0
  31. package/dist/web-ui/assets/{tabs-CRxsaB4E.js → tabs-B_hac99E.js} +1 -1
  32. package/dist/web-ui/assets/task._taskId-kroxCSF6.js +1 -0
  33. package/dist/web-ui/assets/terminal-B6OlmT6e.js +1 -0
  34. package/dist/web-ui/assets/time-kviT26Tm.js +1 -0
  35. package/dist/web-ui/assets/toast-D798wIYZ.js +1 -0
  36. package/dist/web-ui/assets/worktrees-DWhD3oRu.js +1 -0
  37. package/dist/web-ui/index.html +8 -8
  38. package/dist/web-ui/origin-policy.mjs +0 -6
  39. package/dist/web-ui/pty-scrollback.mjs +0 -24
  40. package/dist/web-ui/pty-server.mjs +2 -41
  41. package/dist/web-ui/pty-session-lifecycle.mjs +2 -38
  42. package/package.json +21 -8
  43. package/dist/web-ui/assets/AppShell-BJWnIZ2n.js +0 -5
  44. package/dist/web-ui/assets/Board-DY28iE1n.js +0 -1
  45. package/dist/web-ui/assets/BoardPeek-q7WDjTVj.js +0 -2
  46. package/dist/web-ui/assets/ChatTranscript-BmOoR16r.js +0 -1
  47. package/dist/web-ui/assets/ConfirmDialog-DWjDo0WB.js +0 -1
  48. package/dist/web-ui/assets/IssueIntakePanel-CGafCVz5.js +0 -1
  49. package/dist/web-ui/assets/IssuePeek-CPvOVskA.js +0 -1
  50. package/dist/web-ui/assets/IssuesPage-DUlHFjk-.js +0 -1
  51. package/dist/web-ui/assets/RichEditor-CnNTlQpa.js +0 -179
  52. package/dist/web-ui/assets/SlideOver-Bh8_sIQM.js +0 -1
  53. package/dist/web-ui/assets/ViewToggle-intE-c2J.js +0 -1
  54. package/dist/web-ui/assets/board-BZawoWdd.js +0 -1
  55. package/dist/web-ui/assets/createLucideIcon-Bil0PUgZ.js +0 -1
  56. package/dist/web-ui/assets/harness-RXzjyKw1.js +0 -1
  57. package/dist/web-ui/assets/index-BXZOglLY.js +0 -10
  58. package/dist/web-ui/assets/index-C7JcdWbk.css +0 -1
  59. package/dist/web-ui/assets/issues-C3aXpYKt.js +0 -3
  60. package/dist/web-ui/assets/issues-DoKRndd6.js +0 -1
  61. package/dist/web-ui/assets/lazy-issue-panels-huIP1uIl.js +0 -6
  62. package/dist/web-ui/assets/routes-CBHSZQIw.js +0 -1
  63. package/dist/web-ui/assets/settings-DnpDLygw.js +0 -1
  64. package/dist/web-ui/assets/store-BQARX7BI.js +0 -2
  65. package/dist/web-ui/assets/task._taskId-DiMC08by.js +0 -1
  66. package/dist/web-ui/assets/terminal-Cqsy8MII.js +0 -1
  67. package/dist/web-ui/assets/terminal-DLTENDa9.js +0 -1
  68. package/dist/web-ui/assets/toast-CHhAlb5K.js +0 -1
@@ -0,0 +1,5 @@
1
+ import{l as e,o as t}from"./terminal-B6OlmT6e.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-B_hac99E.js";import{a as s,n as c,r as l}from"./toast-D798wIYZ.js";import{d as u,t as d}from"./createLucideIcon-Dn8f0BBU.js";import{n as f,t as p}from"./ViewToggle-C0OVZQlS.js";import{n as m,t as h}from"./store-CbgoTSs1.js";import{t as g}from"./external-store-DUMhHvtl.js";import{i as _,r as v,t as y}from"./WorkspaceTabs-DU5QKBx-.js";import{t as b}from"./SettingsPage-BaAaaLxY.js";import{t as x}from"./ChatTranscript-33WbiW13.js";import{C as S,D as C,E as w,S as T,T as E,_ as D,f as O,g as ee,h as k,m as A,n as te,o as ne,p as j,r as M,s as re,u as ie,v as ae,w as N,x as P,y as oe}from"./index-BzhHFAu3.js";import{t as F}from"./text-match-C3BRtNXy.js";import{n as I,t as L}from"./time-kviT26Tm.js";import{r as R}from"./web-transport-BS7imUMS.js";import{t as z}from"./SlideOver-DSR5NT1U.js";import{n as B,r as V,t as H}from"./chips-L2qle6td.js";import{n as se,t as U}from"./ConfirmDialog-DCc0Zkwj.js";var ce=d(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),le=d(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),W=d(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ue=d(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),G=e(o(),1),K=g({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),de=null;function q(e){K.update(t=>({...t,...e}))}function J(e){q({query:e})}function fe(e){q({statusFilter:e})}function pe(e){q({sortMode:e})}function me(e){q({showArchived:e})}function he(e){!e||e===de||(de=e,q({sortMode:e}))}function ge(){return K.useSnapshot()}function _e(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ve(e,t){let n=_e(t)-_e(e);return n===0?t.id.localeCompare(e.id):n}function ye(e,t){let n=e.filter(e=>e.kind===`main`),r=e.filter(e=>e.kind!==`main`&&e.pinned),i=e.filter(e=>e.kind!==`main`&&!e.pinned);return t===`recent`&&(r.sort(ve),i.sort(ve)),[...n,...r,...i]}function be(e,t){return F([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}var Y=u();function xe({onClose:e}){let{tasks:t}=m(),n=s(),i=(0,G.useRef)(null);j(i);let a=(0,G.useMemo)(()=>{let e=new Set,n=[];for(let r of t)r.repo&&!e.has(r.repo)&&(e.add(r.repo),n.push(r.repo));return n.sort()},[t]),o=(0,G.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[u,d]=(0,G.useState)(a[0]??``),[f,p]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),[b,x]=(0,G.useState)(!1),S=async e=>{if(e){_(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){l(`scan worktrees`,e),p([])}finally{_(!1)}}},w=async t=>{y(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:u,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),C(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),c(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){l(`adopt worktree`,e)}finally{y(null)}};return b?(0,Y.jsx)(M,{onClose:e}):a.length===0?(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:e,onKeyDown:t=>{t.key===`Escape`&&e()},role:`presentation`,children:(0,Y.jsxs)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Adopt worktree`,className:`flex w-[32rem] max-w-[calc(100vw-2rem)] flex-col border border-line bg-surface shadow-xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,Y.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,Y.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to kobe yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>x(!0),className:`mt-4 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10`,children:`Create a task`})]}),(0,Y.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,Y.jsx)(`button`,{type:`button`,onClick:e,className:`border border-line bg-bg px-3 py-1.5 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Close`})})]})}):(0,Y.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:e,onKeyDown:t=>{t.key===`Escape`&&e()},role:`presentation`,children:(0,Y.jsxs)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Adopt worktree`,className:`flex max-h-[80vh] w-[32rem] max-w-[calc(100vw-2rem)] flex-col border border-line bg-surface shadow-xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,Y.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,Y.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(`select`,{value:u,onChange:e=>d(e.target.value),className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`,children:a.map(e=>(0,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void S(u),disabled:!u||g,className:`shrink-0 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:opacity-40`,children:g?`Scanning…`:`Scan`})]})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,Y.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Pick a repo and Scan to find adoptable worktrees.`}):f.length===0?(0,Y.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No adoptable worktrees found for this repo.`}):f.map(e=>{let t=o.has(e.path);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`})]}),(0,Y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0`,children:I(e.lastActivityMs)})]})]}),t?(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void w(e),disabled:v!==null,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:opacity-40`,children:v===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,Y.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,Y.jsx)(`button`,{type:`button`,onClick:e,className:`border border-line bg-bg px-3 py-1.5 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Close`})})]})})}function Se({task:e,onClose:t}){return(0,Y.jsx)(z,{open:e!==null,onClose:t,title:e?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 border border-line px-1 py-0.5 font-mono text-[9px] uppercase tracking-wide text-subtle`,children:`Archived`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,Y.jsx)(x,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}async function Ce(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var we=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function Te(e){let t=e.trim();return we.test(t)?t:null}function Ee(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}function De(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Te(n.replace(/&amp;/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:`![${t}](${n})`})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ee(n.replace(/&amp;/g,`&`));return r?`<a href="${X(r)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${t}</a>`:`${t}(${n})`})),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Z(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:De(e)).join(``)}function Oe(e){let t=e.replace(/\r\n/g,`
2
+ `).split(`
3
+ `),n=[],r=0,i=null,a=()=>{i&&=(n.push(`</${i}>`),null)};for(;r<t.length;){let e=t[r];if(/^```/.test(e)){a();let e=[];for(r++;r<t.length&&!/^```/.test(t[r]);)e.push(X(t[r])),r++;r++,n.push(`<pre class="kobe-md-pre"><code>${e.join(`
4
+ `)}</code></pre>`);continue}if(/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){a(),n.push(`<hr class="kobe-md-hr" />`),r++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){a();let e=o[1].length;n.push(`<h${e} class="kobe-md-h">${Z(X(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${Z(X(e.replace(/^>\s?/,``)))}</blockquote>`),r++;continue}let s=/^\s*[-*]\s+(.*)$/.exec(e);if(s){i!==`ul`&&(a(),n.push(`<ul class="kobe-md-ul">`),i=`ul`),n.push(`<li>${Z(X(s[1]))}</li>`),r++;continue}let c=/^\s*\d+\.\s+(.*)$/.exec(e);if(c){i!==`ol`&&(a(),n.push(`<ol class="kobe-md-ol">`),i=`ol`),n.push(`<li>${Z(X(c[1]))}</li>`),r++;continue}if(e.trim()===``){a(),r++;continue}a();let l=[e];for(r++;r<t.length&&t[r].trim()!==``&&!/^(#{1,6}\s|>\s?|```|\s*[-*]\s|\s*\d+\.\s|\s*(-{3,}|\*{3,}|_{3,})\s*$)/.test(t[r]);)l.push(t[r]),r++;n.push(`<p class="kobe-md-p">${Z(X(l.join(` `)))}</p>`)}return a(),n.join(`
5
+ `)}async function ke(e){return(await t.get(`/api/notes`,{query:{taskId:e},label:`load notes`})).markdown??``}async function Ae(e,n){await t.put(`/api/notes`,{taskId:e,markdown:n},{label:`save notes`})}function je(e){switch(e){case`saving`:return`saving…`;case`saved`:return`saved`;case`error`:return`save failed`;default:return``}}var Me=600;function Ne({children:e,right:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t]})}function Pe({taskId:e,full:t=!1}){let[n,r]=(0,G.useState)(``),[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(`idle`),u=(0,G.useMemo)(()=>Oe(n),[n]),d=(0,G.useRef)(null),f=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(d.current&&clearTimeout(d.current),f.current=e,l(`idle`),r(``),a(!1),!e)return;let t=!1;return s(!0),ke(e).then(n=>{!t&&f.current===e&&r(n)}).catch(()=>{!t&&f.current===e&&r(``)}).finally(()=>{t||s(!1)}),()=>{t=!0}},[e]),(0,G.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let p=(0,G.useCallback)(t=>{if(r(t),!e)return;let n=e;l(`saving`),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{Ae(n,t).then(()=>{f.current===n&&l(`saved`)}).catch(()=>{f.current===n&&l(`error`)})},Me)},[e]);return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-bg`,children:[(0,Y.jsx)(Ne,{right:e?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==`idle`&&(0,Y.jsx)(`span`,{className:`text-[10px] ${c===`error`?`text-kobe-red`:`text-subtle`}`,children:je(c)}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`border px-1.5 py-0.5 text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,title:`Toggle markdown preview`,children:i?`Edit`:`Preview`})]}):null,children:`Notes`}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1 ${t?`px-0 pb-0`:`px-3 pb-3`}`,children:e?i?(0,Y.jsx)(`div`,{className:`h-full w-full overflow-auto bg-surface px-4 py-3 ${t?`border-t border-line`:`rounded border border-line`}`,children:n.trim()?(0,Y.jsx)(`div`,{className:`kobe-md text-[12px] leading-relaxed text-fg`,dangerouslySetInnerHTML:{__html:u}}):(0,Y.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Nothing to preview yet.`})}):(0,Y.jsx)(`textarea`,{value:n,onChange:e=>p(e.target.value),spellCheck:!1,placeholder:o?`loading notes…`:`Notes for this task — markdown, autosaved.`,disabled:o,className:`h-full w-full resize-none border-line bg-surface px-4 py-3 font-mono text-[12px] leading-relaxed text-fg placeholder:text-subtle focus:border-line-active focus:outline-none disabled:opacity-60 ${t?`border-x-0 border-b-0 border-t`:`rounded border`}`}):(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,Y.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to open its web-only scratchpad.`})]})})})]})}var Fe=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],Ie=`DIRTY_WORKTREE`;function Le(e){return e.replace(/_/g,` `)}function Q({name:e,value:t,mono:n=!1}){return(0,Y.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2 last:border-b-0`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,Y.jsx)(`div`,{className:`mt-1 min-w-0 truncate text-[12px] text-fg ${n?`font-mono`:``}`,title:t,children:t||`—`})]})}function $({children:e,onClick:t,disabled:n,danger:r=!1}){return(0,Y.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${r?`border-kobe-red/40 text-kobe-red hover:bg-kobe-red/10`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:e})}function Re({task:e}){let[t,n]=(0,G.useState)(e?.title??``),[r,i]=(0,G.useState)(e?.branch??``),[o,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(!1),p=(0,G.useRef)(null);(0,G.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let[m,g]=(0,G.useState)(null),_=O(),v=s();if((0,G.useEffect)(()=>{n(e?.title??``)},[e?.title]),(0,G.useEffect)(()=>{i(e?.branch??``)},[e?.branch]),!e)return(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,Y.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to edit its metadata and worktree state.`})]})});let y=async(e,t)=>{u(e);try{await t()}catch(t){l(e.split(`:`)[0],t)}finally{u(null)}},b=()=>{let n=t.trim();!n||n===e.title||y(`rename`,()=>h(`task.rename`,{taskId:e.id,title:n}))},x=()=>{let t=r.trim();!t||t===e.branch||y(`branch`,()=>h(`task.setBranch`,{taskId:e.id,branch:t}))},S=()=>{Ce(e.worktreePath).then(e=>{e&&(f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1200))})},T=()=>{g(null),y(`archive`,async()=>{await h(`task.archive`,{taskId:e.id,archived:!0}),a(),v({to:`/`}),await w(null)})},E=()=>{y(`restore`,()=>h(`task.archive`,{taskId:e.id,archived:!1}))},D=t=>{g(null),u(`delete`),(async()=>{try{await h(`task.delete`,{taskId:e.id,force:t}),a(),v({to:`/`}),C(null),c(`success`,`Deleted "${e.title||e.branch}"`)}catch(e){let n=e instanceof Error?e.message:String(e);!t&&n.includes(Ie)?g({kind:`delete`,force:!0}):l(`delete`,e)}finally{u(null)}})()};return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`border-b border-line px-3 py-3`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Task`}),(0,Y.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Y.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onBlur:b,onKeyDown:e=>{e.key===`Enter`&&b()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`}),(0,Y.jsx)($,{onClick:b,disabled:o===`rename`,children:`Save`})]}),e.archived&&(0,Y.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 border border-kobe-yellow/40 bg-kobe-yellow/10 px-2 py-1.5`,children:[(0,Y.jsx)(`span`,{className:`text-[11px] text-kobe-yellow`,children:`archived`}),(0,Y.jsx)($,{onClick:E,disabled:o!==null,children:`Restore`})]})]}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:[e.kind===`main`?(0,Y.jsx)(Q,{name:`Branch`,value:e.branch,mono:!0}):(0,Y.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Branch`}),(0,Y.jsx)(`div`,{className:`mt-1 flex gap-2`,children:(0,Y.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),onBlur:x,onKeyDown:e=>{e.key===`Enter`&&x()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1 font-mono text-[12px] text-fg focus:border-line-active focus:outline-none`})})]}),(0,Y.jsx)(Q,{name:`Vendor`,value:e.vendor??`claude`}),(0,Y.jsx)(Q,{name:`Worktree`,value:e.worktreePath,mono:!0}),(0,Y.jsx)(Q,{name:`Repo`,value:e.repo,mono:!0}),(0,Y.jsxs)(`div`,{className:`mt-4`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Status`}),(0,Y.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:Fe.map(t=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void y(`status:${t}`,()=>h(`task.status`,{taskId:e.id,status:t})),disabled:o!==null,className:`border px-2 py-1.5 text-left text-[11px] capitalize transition-colors disabled:opacity-40 ${e.status===t?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:Le(t)},t))})]}),(0,Y.jsxs)(`div`,{className:`mt-4`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Vendor`}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(t=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void y(`vendor:${t.id}`,()=>h(`task.setVendor`,{taskId:e.id,vendor:t.id})),disabled:o!==null,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${(e.vendor??`claude`)===t.id?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:t.label},t.id))})]}),(0,Y.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,Y.jsx)($,{onClick:()=>void y(`pin`,()=>h(`task.pin`,{taskId:e.id,pinned:!e.pinned})),disabled:o!==null,children:e.pinned?`Unpin`:`Pin`}),(0,Y.jsx)($,{onClick:()=>void y(`worktree`,()=>h(`task.ensureWorktree`,{taskId:e.id})),disabled:o!==null,children:`Ensure worktree`}),(0,Y.jsx)($,{onClick:S,children:d?`Copied`:`Copy path`}),!e.archived&&(0,Y.jsx)($,{onClick:()=>g({kind:`archive`}),disabled:o!==null,danger:!0,children:`Archive`})]}),e.kind!==`main`&&(0,Y.jsxs)(`div`,{className:`mt-4 border-t border-line-subtle pt-3`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Danger zone`}),(0,Y.jsx)($,{onClick:()=>g({kind:`delete`,force:!1}),disabled:o!==null,danger:!0,children:`Delete task + worktree`})]})]}),m?.kind===`archive`&&(0,Y.jsx)(U,{title:`Archive task`,body:`Archive "${e.title||e.branch}"? Its tmux session and engine will be stopped; the worktree stays on disk and the task can be restored from the Archived section.`,confirmLabel:`Archive`,danger:!0,busy:o===`archive`,onConfirm:T,onCancel:()=>g(null)}),m?.kind===`delete`&&(0,Y.jsx)(U,{title:m.force?`Worktree has uncommitted changes`:`Delete task`,body:m.force?`"${e.title||e.branch}" has uncommitted or untracked changes in its worktree. Force-delete discards them permanently.`:`Delete "${e.title||e.branch}"? This removes the task, kills its engine session, and removes its worktree (branch history stays in git).`,confirmLabel:m.force?`Force delete`:`Delete`,danger:!0,busy:o===`delete`,onConfirm:()=>D(m.force),onCancel:()=>g(null)})]})}function ze({drawer:e=!1,onClose:t}={}){let[r,a]=(0,G.useState)(`overview`),{selectedTaskId:o}=n(),{tasks:s}=m(),c=o?s.find(e=>e.id===o)??null:null;return(0,Y.jsxs)(`aside`,{className:e?`flex h-full w-full flex-col bg-bg`:`flex w-80 shrink-0 flex-col border-l border-line bg-bg`,children:[(0,Y.jsxs)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:[[`overview`,`notes`,`changes`].map(e=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`px-3 text-[10px] font-bold uppercase tracking-[0.12em] ${r===e?`border-b-2 border-primary text-fg`:`text-subtle hover:text-muted`}`,children:e===`overview`?`Task`:e===`notes`?`Notes`:`Changes`},e)),e&&t&&(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto px-3 text-subtle hover:text-fg`,"aria-label":`Close tools`,children:(0,Y.jsx)(ee,{size:14,strokeWidth:2})})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`overview`?(0,Y.jsx)(Re,{task:c}):r===`notes`?(0,Y.jsx)(Pe,{taskId:o,full:!0}):(0,Y.jsx)(v,{worktreePath:c?.worktreePath??null,onOpenFile:e=>{o&&i(o,e)}})})]})}function Be({children:e,suffix:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function Ve({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:k(t?.state),l=L(e.updatedAt||e.createdAt);return(0,Y.jsxs)(`button`,{type:`button`,"data-task-id":e.id,onClick:o,className:`group w-full border-l-2 px-3 py-2 text-left transition-colors ${a?`border-primary bg-inset`:`border-transparent hover:bg-surface`}`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,Y.jsx)(W,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${A(t?.state)}`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,Y.jsx)(V,{pr:e.prStatus}),e.pinned&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,Y.jsx)(H,{counts:r})]}),(0,Y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,Y.jsx)(B,{label:i}),c&&(0,Y.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,Y.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function He({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,Y.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,Y.jsx)(`button`,{type:`button`,onClick:n,title:`Preview history`,className:`min-w-0 flex-1 truncate text-left text-[12px] text-subtle transition-colors hover:text-fg`,children:r}):(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-muted opacity-0 transition-opacity hover:border-primary hover:text-fg group-hover:opacity-100`,children:`Restore`})]})}function Ue({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:c,worktreeChanges:u,uiPrefs:d,hydrated:f,streamConnected:p}=m(),{selectedTaskId:g}=n(),_=O(),v=(0,G.useMemo)(()=>ne(a),[a]),y=e=>re(_,e,v),{query:b,statusFilter:x,sortMode:S,showArchived:w}=ge(),T=(0,G.useRef)(null),E=(0,G.useRef)(null);(0,G.useEffect)(()=>{g&&T.current?.querySelector(`[data-task-id="${CSS.escape(g)}"]`)?.scrollIntoView({block:`nearest`})},[g]);let k=d?.sortMode;(0,G.useEffect)(()=>{he(k)},[k]);let A=(0,G.useMemo)(()=>a.filter(e=>!e.archived),[a]),j=(0,G.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),M=(0,G.useMemo)(()=>ye(A.filter(e=>be(e,b)&&te(o[e.id],u[e.worktreePath],x)),S),[A,b,x,S,o,u]),N=M.filter(e=>e.kind===`main`),P=M.filter(e=>e.kind!==`main`),F=!f||!p&&a.length===0,I=s(),L=e=>{r(e),C(e),I({to:`/task/$taskId`,params:{taskId:e}})};(0,G.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.key,n=t===`ArrowDown`||t===`ArrowUp`,r=t===`j`||t===`ArrowDown`,i=t===`k`||t===`ArrowUp`,a=t===`/`;if(!r&&!i&&!a)return;let o=e.target;if(o&&(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.tagName===`SELECT`||o.isContentEditable)||document.querySelector(`[role=dialog],[role=alertdialog]`)||document.querySelector(`[data-settings-open]`))return;if(a){e.preventDefault(),E.current?.focus();return}if(n&&o&&o!==document.body&&!T.current?.contains(o)||M.length===0)return;e.preventDefault();let s=M.findIndex(e=>e.id===g),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),M.length-1);L(M[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,g]);let R=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>l(`restore "${e.title||e.branch}"`,t))},[z,B]=(0,G.useState)(!1),[V,H]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let e=!0;return ie().then(t=>{e&&B(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,Y.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,Y.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`button`,{type:`button`,onClick:()=>pe(S==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${S===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,Y.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[M.length,`/`,A.length]}),(0,Y.jsx)(`button`,{type:`button`,onClick:i,className:`text-muted transition-colors hover:text-primary`,title:`Adopt an existing worktree`,"aria-label":`Adopt worktree`,children:(0,Y.jsx)(le,{size:14,strokeWidth:1.9})}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,Y.jsx)(oe,{size:14,strokeWidth:2.2})})]})]}),(0,Y.jsxs)(`label`,{className:`mt-2 flex h-8 items-center gap-2 border border-line bg-bg px-2 text-[12px] text-muted focus-within:border-line-active`,children:[(0,Y.jsx)(ae,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,Y.jsx)(`input`,{ref:E,value:b,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M.length>0?(e.preventDefault(),L(M[0].id),e.currentTarget.blur()):e.key===`Escape`&&b&&(e.preventDefault(),J(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),b&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>J(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,Y.jsx)(ee,{size:13,strokeWidth:2})})]}),(0,Y.jsx)(`div`,{className:`mt-2 flex items-center gap-1`,children:[{key:`all`,label:`All`,title:`All tasks`},{key:`attention`,label:`Needs`,title:`Needs input / errored / rate-limited`}].map(e=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>fe(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${x===e.key?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:e.label},e.key))})]}),(0,Y.jsxs)(`div`,{ref:T,className:`flex-1 overflow-y-auto`,children:[F?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,Y.jsx)(W,{size:13,strokeWidth:2,className:`animate-spin`}),(0,Y.jsx)(`span`,{children:`connecting…`})]}):A.length===0?(0,Y.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,Y.jsx)(`p`,{children:`No tasks yet.`}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`+ New task`})]}):M.length===0?(0,Y.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,Y.jsx)(`div`,{children:b?`No matches for “${b}”.`:`No tasks in this status.`}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>{J(``),fe(`all`)},className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Clear filter`})]}):(0,Y.jsxs)(Y.Fragment,{children:[N.length>0&&(0,Y.jsx)(Be,{children:`Projects`}),N.map(e=>(0,Y.jsx)(Ve,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id)),P.length>0&&(0,Y.jsx)(Be,{suffix:S==="default"?void 0:S,children:`Worktrees`}),P.map(e=>(0,Y.jsx)(Ve,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id))]}),!F&&j.length>0&&(0,Y.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>me(!w),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:j.length}),(0,Y.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:w?`−`:`+`})]}),w&&j.map(e=>(0,Y.jsx)(He,{task:e,onRestore:()=>R(e),onPreview:z?()=>H(e):void 0},e.id))]})]}),(0,Y.jsx)(Se,{task:V,onClose:()=>H(null)}),(0,Y.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,Y.jsxs)(`button`,{type:`button`,onClick:e,className:`flex w-full items-center gap-2 border border-line bg-surface px-2 py-2 text-left text-[12px] text-muted transition-colors hover:border-primary hover:bg-inset hover:text-fg`,children:[(0,Y.jsx)(D,{size:15,strokeWidth:1.8}),(0,Y.jsx)(`span`,{children:`Settings`})]})})]})}function We({onToggleTools:e,onShowHelp:t}){let{daemonConnected:r,streamConnected:i,tasks:a}=m(),{selectedTaskId:o}=n(),s=o?a.find(e=>e.id===o):null,c=R({daemonConnected:r,streamConnected:i});return(0,Y.jsxs)(`header`,{"data-kobe-topbar":!0,className:`flex h-10 shrink-0 items-center gap-3 border-b border-line bg-surface px-3`,children:[(0,Y.jsx)(se,{}),(0,Y.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,Y.jsx)(p,{}),s?(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`max-w-56 truncate rounded bg-inset px-2 py-0.5 text-[11px] text-fg`,children:s.title||s.branch}),(0,Y.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-[11px] text-subtle md:inline`,children:s.branch})]}):(0,Y.jsx)(`span`,{className:`rounded bg-inset px-2 py-0.5 text-[11px] text-muted`,children:`Workspace`}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[11px] text-subtle`,children:[(0,Y.jsxs)(`span`,{className:`hidden items-center gap-1.5 sm:flex`,title:c.title,children:[(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${c.ok?`bg-kobe-green`:`bg-kobe-yellow`}`}),(0,Y.jsx)(`span`,{children:c.label})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`hidden items-center text-muted transition-colors hover:text-fg sm:flex`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts (?)`,children:(0,Y.jsx)(ce,{size:15,strokeWidth:1.8})}),(0,Y.jsx)(`button`,{type:`button`,onClick:e,className:`flex items-center text-muted transition-colors hover:text-fg lg:hidden`,"aria-label":`Toggle task tools`,title:`Task tools`,children:(0,Y.jsx)(ue,{size:15,strokeWidth:1.8})})]})]})}function Ge(){let{tasks:e,update:t}=m(),{selectedTaskId:r}=n(),i=r?e.find(e=>e.id===r):null,a=e.filter(e=>!e.archived).length;return(0,Y.jsxs)(`footer`,{className:`flex h-7 shrink-0 items-center gap-4 border-t border-line bg-surface px-3 text-[11px] text-subtle`,children:[(0,Y.jsxs)(`span`,{children:[a,` task`,a===1?``:`s`]}),i&&(0,Y.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[i.kind===`main`?`project`:`worktree`,` ·`,` `,_(i.worktreePath,54)]}),(0,Y.jsx)(`span`,{className:`ml-auto`,children:t?.latest?`update ${t.latest} available`:`kobe web`})]})}function Ke(){let{settingsOpen:e}=E(),[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,Y.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,Y.jsx)(We,{onToggleTools:()=>i(e=>!e),onShowHelp:T}),(0,Y.jsx)(f,{}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Y.jsx)(Ue,{onOpenSettings:N,onNewTask:S,onAdopt:()=>n(!0)}),e?(0,Y.jsx)(b,{onClose:P}):(0,Y.jsx)(y,{}),(0,Y.jsx)(`div`,{className:`hidden lg:flex`,children:(0,Y.jsx)(ze,{})}),r&&(0,Y.jsx)(`div`,{className:`fixed inset-0 z-30 flex justify-end bg-black/50 lg:hidden`,onClick:()=>i(!1),onKeyDown:e=>{e.key===`Escape`&&i(!1)},role:`presentation`,children:(0,Y.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Task tools`,className:`h-full w-80 max-w-[85vw] border-l border-line bg-bg shadow-2xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:(0,Y.jsx)(ze,{drawer:!0,onClose:()=>i(!1)})})})]}),(0,Y.jsx)(Ge,{}),t&&(0,Y.jsx)(xe,{onClose:()=>n(!1)})]})}export{Ke as AppShell};
@@ -0,0 +1 @@
1
+ import{l as e}from"./terminal-B6OlmT6e.js";import{f as t,y as n}from"./tabs-B_hac99E.js";import{a as r,n as i,r as a}from"./toast-D798wIYZ.js";import{d as o}from"./createLucideIcon-Dn8f0BBU.js";import{n as ee,t as s}from"./ViewToggle-C0OVZQlS.js";import{n as te}from"./store-CbgoTSs1.js";import{t as c}from"./external-store-DUMhHvtl.js";import{t as l}from"./external-link-CGQEaSmM.js";import{a as u,i as d,n as f,r as p,t as m}from"./lazy-issue-panels-66N4DTZp.js";import{D as ne,g as re,v as ie,y as h}from"./index-BzhHFAu3.js";import{n as ae,t as oe}from"./ConfirmDialog-DCc0Zkwj.js";import{a as g,d as _,f as v,g as y,h as b,m as x,p as S,s as C,u as w}from"./issues-B3DaQO0x.js";var T=e(n(),1),E={query:``,repo:null};function D(e){O.update(t=>({...t,...e}))}var O=c(E);function se(){return O.useSnapshot()}function k(e){e!==O.getSnapshot().query&&D({query:e})}function A(e){e!==O.getSnapshot().repo&&D({repo:e})}var j=o();function M({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,j.jsxs)(`section`,{"data-column":`${e}:${t.key}`,className:`flex h-full shrink-0 flex-col border border-transparent ${t.key===`backlog`?`w-96`:`w-72`}`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,j.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:`ml-auto flex items-center gap-0.5 text-[10px] text-subtle transition-colors hover:text-fg`,title:`New story in this project`,children:[(0,j.jsx)(h,{size:11,strokeWidth:2}),(0,j.jsx)(`span`,{children:`New story`})]})]}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,j.jsx)(`div`,{className:`border border-dashed border-line-subtle p-3 text-center text-[11px] text-subtle`,children:`none`}):t.cards.map(e=>{let{issue:t}=e,n=y(t)?t.taskId:void 0;return(0,j.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,j.jsx)(d,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,j.jsxs)(`button`,{type:`button`,onClick:()=>i(n),"aria-label":`Open task for issue #${t.id}`,title:`Started — open task`,className:`absolute bottom-2 right-2 flex items-center gap-1 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-subtle opacity-0 transition-opacity hover:border-primary hover:text-fg focus-visible:opacity-100 group-hover/wrap:opacity-100`,children:[(0,j.jsx)(l,{size:10,strokeWidth:1.8}),(0,j.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,j.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function ce({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,j.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,j.jsx)(M,{repo:e.repo,column:a,onNewIssue:a.key===`backlog`?()=>t(e.repo):void 0,onPeekIssue:n,onOpenTask:r,onDeleteIssue:t=>i(e.repo,t)},a.key))})}function N(){let{tasks:e,hydrated:n,daemonConnected:o}=te(),{query:c,repo:l}=se(),d=r(),y=(0,T.useRef)(null),[E,D]=(0,T.useState)(null),[O,M]=(0,T.useState)(null),[N,P]=(0,T.useState)(!1),[F,I]=(0,T.useState)(null),[L,R]=(0,T.useState)(new Map),[z,B]=(0,T.useState)(null),[V,H]=(0,T.useState)([]);(0,T.useEffect)(()=>{let e=!1;return C().then(t=>{e||H(t)}).catch(e=>a(`load projects`,e)),()=>{e=!0}},[]);let U=(0,T.useMemo)(()=>w(e,V),[e,V]),W=(0,T.useMemo)(()=>U.map(e=>e.repo),[U]),G=(0,T.useMemo)(()=>S(U,l),[U,l]),{data:K,pending:q,refresh:J}=u(W),{allIssues:Y,repoChips:le,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,T.useMemo)(()=>b({issueData:K,issueRepos:W,pendingLinks:L,query:c,repoFilter:G}),[K,W,L,c,G]);(0,T.useEffect)(()=>{R(e=>{if(e.size===0)return e;let t=new Map(e),n=!1;for(let e of W){let r=K[e];if(!(!r||!r.exists))for(let i of r.issues)i.taskId&&t.delete(`${e}:${i.id}`)&&(n=!0)}return n?t:e})},[W,K]),(0,T.useEffect)(()=>{E&&(Y.some(e=>e.repo===E.repo&&e.issue.id===E.id)||D(null))},[Y,E]),(0,T.useEffect)(()=>{let e=e=>{if(E||O||z||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target,n=!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable);e.key===`/`&&!n?(e.preventDefault(),y.current?.focus()):e.key===`Escape`&&t===y.current&&c&&(e.preventDefault(),k(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,E,O,z]),(0,T.useEffect)(()=>{l!==G&&A(G)},[G,l]);let ue=!!c,$=e=>{t(e),ne(e),d({to:`/task/$taskId`,params:{taskId:e}})},de=async(e,t,n)=>{P(!0);try{return await x(e,t,n),J([e]),!0}catch(e){return a(`update issue`,e),!1}finally{P(!1)}},fe=async(e,t)=>{P(!0);try{await g(e,t.id),J([e]),B(null),E?.repo===e&&E.id===t.id&&D(null)}catch(e){a(`delete issue`,e)}finally{P(!1)}},pe=async(e,t,n,r)=>{if(F===null){I(t.id);try{let{taskId:i}=await v(e,t,n,r);return R(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:i}),r}),i}catch(e){a(`quick start issue`,e);return}finally{I(null)}}};return(0,j.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,j.jsxs)(`header`,{"data-kobe-topbar":!0,className:`flex h-10 shrink-0 items-center gap-3 border-b border-line bg-surface px-3`,children:[(0,j.jsx)(ae,{}),(0,j.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,j.jsx)(s,{}),(0,j.jsxs)(`label`,{className:`flex h-7 items-center gap-1.5 border border-line bg-bg px-2 text-muted focus-within:border-line-active`,children:[(0,j.jsx)(ie,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,j.jsx)(`input`,{ref:y,value:c,onChange:e=>k(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),c&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>k(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,j.jsx)(re,{size:13,strokeWidth:2})})]}),U.length>0&&(0,j.jsxs)(`label`,{className:`flex h-7 min-w-0 max-w-[24rem] items-center gap-1.5 border border-line bg-bg px-2 text-muted focus-within:border-line-active`,children:[(0,j.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,j.jsx)(`select`,{value:G??``,onChange:e=>A(e.target.value),title:G??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:U.map(e=>{let t=le.find(t=>t.repo===e.repo)?.count??0;return(0,j.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,j.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,j.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,j.jsx)(ee,{}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||q&&!Q?(0,j.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&ue&&Q?(0,j.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,j.jsx)(`p`,{children:`No stories match.`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>{k(``)},className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Clear filters`})]}):Z===0&&!o?(0,j.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,j.jsx)(ce,{board:X[0],onNewIssue:M,onPeekIssue:e=>D({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>B({repo:e,issue:t})}):(0,j.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,j.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,j.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,j.jsx)(`button`,{type:`button`,onClick:()=>d({to:`/`}),className:`border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Back to workspace`})})]})}),(()=>{let e=G??X[0]?.repo??W[0];return e?(0,j.jsx)(`button`,{type:`button`,onClick:()=>M(e),title:`New story`,"aria-label":`New story`,className:`fixed bottom-6 right-6 z-20 flex h-12 w-12 items-center justify-center rounded-full border border-primary bg-primary text-bg shadow-lg transition-transform hover:scale-105`,children:(0,j.jsx)(h,{size:22,strokeWidth:2.2})}):null})(),O&&(0,j.jsx)(m,{children:(0,j.jsx)(f,{repoRoot:O,open:!0,onClose:()=>M(null),onCreated:(e,t)=>{O&&J([O]),i(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!E)return null;let e=Y.find(e=>e.repo===E.repo&&e.issue.id===E.id);return e?(0,j.jsx)(m,{children:(0,j.jsx)(p,{issue:e.issue,repoRoot:e.repo,busy:N,starting:F===e.issue.id,onClose:()=>D(null),onSave:t=>de(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,watch:r})=>{let i=await pe(e.repo,e.issue,t,n);r&&i?(D(null),$(i)):D(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;D(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&_(t,e.issue).then(()=>i(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>a(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),z&&(0,j.jsx)(oe,{title:`Delete issue`,body:`Delete issue #${z.issue.id}: "${z.issue.title}"? This removes it from the daemon issue tracker only; it does not delete any task, branch, worktree, or engine session.`,confirmLabel:`Delete`,danger:!0,busy:N,onConfirm:()=>void fe(z.repo,z.issue),onCancel:()=>B(null)})]})}export{N as Board};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-yge5k7Tv.js","assets/terminal-B6OlmT6e.js","assets/tabs-B_hac99E.js","assets/createLucideIcon-Dn8f0BBU.js","assets/store-CbgoTSs1.js","assets/rotate-cw-zLlRat-M.js","assets/web-transport-BS7imUMS.js","assets/ChatTerminal-kHJ-D0s7.css"])))=>i.map(i=>d[i]);
2
+ import{l as e}from"./terminal-B6OlmT6e.js";import{c as t,y as n}from"./tabs-B_hac99E.js";import{d as r,t as i}from"./createLucideIcon-Dn8f0BBU.js";import{i as a}from"./store-CbgoTSs1.js";import{t as o}from"./ChatTranscript-33WbiW13.js";import{t as s}from"./external-link-CGQEaSmM.js";import{g as c,h as l,m as u,p as d}from"./index-BzhHFAu3.js";var f=i(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),p=i(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),m=e(n(),1),h=r(),g=(0,m.lazy)(()=>a(()=>import(`./ChatTerminal-yge5k7Tv.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function _({task:e,engine:n,onClose:r,onOpenWorkspace:i,onReview:a,onCreatePr:_}){let[v,y]=(0,m.useState)(`engine`),[b]=(0,m.useState)(()=>t(e.id)),x=(0,m.useRef)(null);d(x,!0),(0,m.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=e.target;t?.closest(`.xterm`)||t&&(t.tagName===`TEXTAREA`||t.tagName===`INPUT`)||(e.preventDefault(),r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let S=l(n?.state),C=e=>`border-b-2 px-2 py-1.5 text-[11px] transition-colors ${e?`border-primary text-fg`:`border-transparent text-muted hover:text-fg`}`;return(0,h.jsxs)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:[(0,h.jsx)(`button`,{type:`button`,"aria-label":`Close peek`,onClick:r,className:`absolute inset-0 cursor-default bg-black/40`}),(0,h.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":`true`,"aria-label":`Session peek: ${e.title||e.branch||e.id}`,className:`relative flex h-full w-[640px] max-w-[92vw] flex-col border-l border-line bg-bg shadow-2xl`,children:[(0,h.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface px-3`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${u(n?.state)}`}),(0,h.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-fg`,children:e.title||e.branch||e.id}),(0,h.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-[11px] text-subtle sm:inline`,children:e.branch}),S&&(0,h.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:S}),(0,h.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[a&&(0,h.jsxs)(`button`,{type:`button`,onClick:a,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Review → done if it passes`,children:[(0,h.jsx)(f,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`Review`})]}),_&&(0,h.jsxs)(`button`,{type:`button`,onClick:_,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open a PR for this branch`,children:[(0,h.jsx)(p,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`PR`})]}),(0,h.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open in workspace`,children:[(0,h.jsx)(s,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`Workspace`})]}),(0,h.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center text-muted transition-colors hover:text-fg`,"aria-label":`Close peek`,title:`Close (Esc)`,children:(0,h.jsx)(c,{size:15,strokeWidth:1.8})})]})]}),(0,h.jsxs)(`nav`,{className:`flex shrink-0 items-center gap-1 border-b border-line bg-surface px-2`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:()=>y(`engine`),className:C(v===`engine`),children:`Engine`}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>y(`transcript`),className:C(v===`transcript`),children:`Transcript`})]}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1`,children:v===`engine`?(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`}),children:(0,h.jsx)(g,{tabId:b,taskId:e.id,mode:`engine`},b)}):(0,h.jsx)(o,{worktreePath:e.worktreePath,vendor:e.vendor??`claude`,title:e.title||e.branch})})]})]})}export{_ as BoardPeek};