@sma1lboy/kobe 0.8.99 → 0.8.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +395 -390
- package/dist/cli/kobe.js +395 -390
- package/dist/cli/pty-host-node.mjs +327 -99
- package/dist/cli/rove.js +395 -390
- package/dist/web-ui/assets/{AppShell-BTjvuY-t.js → AppShell-ByiYfvCg.js} +1 -1
- package/dist/web-ui/assets/{Board-DPB4h6mJ.js → Board-B0oB8DMk.js} +1 -1
- package/dist/web-ui/assets/{BoardPeek-69VJptGV.js → BoardPeek-VXShygbB.js} +2 -2
- package/dist/web-ui/assets/{ChatTerminal-MCI1aBbT.js → ChatTerminal-DNTeFtk5.js} +1 -1
- package/dist/web-ui/assets/{ChatTranscript-DLthbnmB.js → ChatTranscript-Co0UhezW.js} +1 -1
- package/dist/web-ui/assets/{ConfirmDialog-CDPOtXww.js → ConfirmDialog-D-NILtP0.js} +1 -1
- package/dist/web-ui/assets/{IssueIntakePanel-XYsIcIhp.js → IssueIntakePanel-BN31TW37.js} +1 -1
- package/dist/web-ui/assets/{IssuePeek-CP_rAkqO.js → IssuePeek-BT8ZmKTT.js} +1 -1
- package/dist/web-ui/assets/{IssuesPage-BR5mpuo-.js → IssuesPage-BjLRf_cj.js} +1 -1
- package/dist/web-ui/assets/{ViewToggle-BdPCMBWa.js → ViewToggle-BHBzWlni.js} +1 -1
- package/dist/web-ui/assets/{WorkspaceTabs-CMKlvN_Y.js → WorkspaceTabs-kqzy_Dsf.js} +3 -3
- package/dist/web-ui/assets/active-task-CuoFMFoR.js +1 -0
- package/dist/web-ui/assets/board-GAhbgwzQ.js +1 -0
- package/dist/web-ui/assets/desktop-CFge7SbS.js +2 -0
- package/dist/web-ui/assets/{harness-q9gT7Jic.js → harness-B5VlW5ov.js} +1 -1
- package/dist/web-ui/assets/{index-D58CfI0X.js → index-BgcK6obF.js} +3 -3
- package/dist/web-ui/assets/{issues-1SCRkcB0.js → issues-BMqItbVN.js} +1 -1
- package/dist/web-ui/assets/issues-DmgD6qU_.js +1 -0
- package/dist/web-ui/assets/{lazy-issue-panels-0Rhl2uhh.js → lazy-issue-panels-BcU72R8r.js} +3 -3
- package/dist/web-ui/assets/routes-DMeRqoPI.js +1 -0
- package/dist/web-ui/assets/store-BXzqsTjs.js +2 -0
- package/dist/web-ui/assets/{task._taskId-BmObFoVZ.js → task._taskId-BuwKbKaG.js} +1 -1
- package/dist/web-ui/assets/{task._taskId-BlZ0vG_1.js → task._taskId-EQWWNO2k.js} +2 -2
- package/dist/web-ui/assets/{triage-7QLsCY8d.js → triage-DDohuPMh.js} +1 -1
- package/dist/web-ui/assets/{worktrees-C_XKA7jM.js → worktrees-3wHfn7Vh.js} +1 -1
- package/dist/web-ui/index.html +6 -6
- package/package.json +1 -1
- package/dist/web-ui/assets/active-task-GeQZqbJK.js +0 -1
- package/dist/web-ui/assets/board-CGiK0u0M.js +0 -1
- package/dist/web-ui/assets/desktop-BThq9eSR.js +0 -2
- package/dist/web-ui/assets/issues-BKkua1D9.js +0 -1
- package/dist/web-ui/assets/routes-SBb-uSy8.js +0 -1
- package/dist/web-ui/assets/store-uT65Mask.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as e,o as t}from"./terminal-qBEkzc-m.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-Dx-TnbvG.js";import{d as s,t as c}from"./createLucideIcon-CM5xLVj1.js";import{a as l,n as u,r as d}from"./toast-BXjAT0ix.js";import{n as f,t as p}from"./ViewToggle-BdPCMBWa.js";import{n as m,t as h}from"./store-uT65Mask.js";import{n as g,t as _}from"./active-task-GeQZqbJK.js";import{t as v}from"./external-store-DJlWpyYC.js";import{c as y,d as b,i as x,l as S,p as C,r as w,t as T,u as E}from"./triage-7QLsCY8d.js";import{i as D,r as O,t as k}from"./WorkspaceTabs-CMKlvN_Y.js";import{t as A}from"./SettingsPage-CLRhr-sg.js";import{t as j}from"./ChatTranscript-DLthbnmB.js";import{t as ee}from"./plus-BbX5qXba.js";import{t as te}from"./search-BxbFZoup.js";import{t as ne}from"./x-7cB9X7Hi.js";import{n as M,t as N}from"./activity-BjTd1D8q.js";import{t as P}from"./use-focus-trap-DNMrlNR0.js";import{t as re}from"./engines-Cnxy1hW9.js";import{n as ie}from"./settings-tPcmEHCP.js";import{i as ae,r as oe}from"./vendor-CdtpTJrf.js";import{r as F}from"./web-transport-D0bugxxv.js";import{n as se,t as I}from"./time-kviT26Tm.js";import{n as L,t as R}from"./ConfirmDialog-CDPOtXww.js";import{t as z}from"./text-match-DW3sD-Rt.js";import{t as B}from"./SlideOver-Dxtk6Gn2.js";import{n as V,r as ce,t as le}from"./chips-Da37C4KZ.js";var ue=c(`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`}]]),de=c(`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`}]]),H=c(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fe=c(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),U=e(o(),1),W=s();function pe({onClose:e}){let{tasks:t}=m(),n=l(),i=(0,U.useRef)(null);P(i);let a=(0,U.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,U.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,U.useState)(a[0]??``),[f,p]=(0,U.useState)(null),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null),[x,S]=(0,U.useState)(!1),C=async e=>{if(e){v(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){d(`scan worktrees`,e),p([])}finally{v(!1)}}},T=async t=>{b(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:s,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),g(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),u(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){d(`adopt worktree`,e)}finally{b(null)}};return x?(0,W.jsx)(w,{onClose:e}):a.length===0?(0,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,W.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,W.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to Rove yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>S(!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,W.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,W.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,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,W.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(`select`,{value:s,onChange:e=>c(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,W.jsx)(`option`,{value:e,children:e},e))}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>void C(s),disabled:!s||_,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:_?`Scanning…`:`Scan`})]})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,W.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,W.jsx)(`span`,{className:`ml-auto shrink-0`,children:se(e.lastActivityMs)})]})]}),t?(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>void T(e),disabled:y!==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:y===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,W.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,W.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`})})]})})}var G=v({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),K=null;function q(e){G.update(t=>({...t,...e}))}function J(e){q({query:e})}function Y(e){q({statusFilter:e})}function me(e){q({sortMode:e})}function he(e){q({showArchived:e})}function ge(e){!e||e===K||(K=e,q({sortMode:e}))}function _e(){return G.useSnapshot()}function ve(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ye(e,t){let n=ve(t)-ve(e);return n===0?t.id.localeCompare(e.id):n}function be(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(ye),i.sort(ye)),[...n,...r,...i]}function xe(e,t){return z([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}function Se({task:e,onClose:t}){return(0,W.jsx)(B,{open:e!==null,onClose:t,title:e?(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.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,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,W.jsx)(j,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}function Ce({children:e,suffix:t}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function we({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:M(t?.state),l=I(e.updatedAt||e.createdAt);return(0,W.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,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,W.jsx)(H,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,W.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${N(t?.state)}`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,W.jsx)(ce,{pr:e.prStatus}),e.pinned&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,W.jsx)(le,{counts:r})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,W.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,W.jsx)(V,{label:i}),c&&(0,W.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,W.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Te({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,W.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,W.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,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,W.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 Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:s,worktreeChanges:c,uiPrefs:u,hydrated:f,streamConnected:p}=m(),{selectedTaskId:_}=n(),v=re(),y=(0,U.useMemo)(()=>oe(a),[a]),b=e=>ae(v,e,y),{query:S,statusFilter:C,sortMode:w,showArchived:E}=_e(),D=(0,U.useRef)(null),O=(0,U.useRef)(null);(0,U.useEffect)(()=>{_&&D.current?.querySelector(`[data-task-id="${CSS.escape(_)}"]`)?.scrollIntoView({block:`nearest`})},[_]);let k=u?.sortMode;(0,U.useEffect)(()=>{ge(k)},[k]);let A=(0,U.useMemo)(()=>a.filter(e=>!e.archived),[a]),j=(0,U.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),M=(0,U.useMemo)(()=>be(A.filter(e=>xe(e,S)&&T(o[e.id],c[e.worktreePath],C)),w),[A,S,C,w,o,c]),N=M.filter(e=>e.kind===`main`),P=M.filter(e=>e.kind!==`main`),F=!f||!p&&a.length===0,se=l(),I=e=>{r(e),g(e),se({to:`/task/$taskId`,params:{taskId:e}})};(0,U.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(),O.current?.focus();return}if(n&&o&&o!==document.body&&!D.current?.contains(o)||M.length===0)return;e.preventDefault();let s=M.findIndex(e=>e.id===_),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),M.length-1);I(M[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,_]);let L=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>d(`restore "${e.title||e.branch}"`,t))},[R,z]=(0,U.useState)(!1),[B,V]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let e=!0;return ie().then(t=>{e&&z(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,W.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,W.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>me(w==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${w===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,W.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[M.length,`/`,A.length]}),(0,W.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,W.jsx)(de,{size:14,strokeWidth:1.9})}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,W.jsx)(ee,{size:14,strokeWidth:2.2})})]})]}),(0,W.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,W.jsx)(te,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,W.jsx)(`input`,{ref:O,value:S,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M.length>0?(e.preventDefault(),I(M[0].id),e.currentTarget.blur()):e.key===`Escape`&&S&&(e.preventDefault(),J(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),S&&(0,W.jsx)(`button`,{type:`button`,onClick:()=>J(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,W.jsx)(ne,{size:13,strokeWidth:2})})]}),(0,W.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,W.jsx)(`button`,{type:`button`,onClick:()=>Y(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${C===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,W.jsxs)(`div`,{ref:D,className:`flex-1 overflow-y-auto`,children:[F?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,W.jsx)(H,{size:13,strokeWidth:2,className:`animate-spin`}),(0,W.jsx)(`span`,{children:`connecting…`})]}):A.length===0?(0,W.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,W.jsx)(`p`,{children:`No tasks yet.`}),(0,W.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,W.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,W.jsx)(`div`,{children:S?`No matches for “${S}”.`:`No tasks in this status.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{J(``),Y(`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,W.jsxs)(W.Fragment,{children:[N.length>0&&(0,W.jsx)(Ce,{children:`Projects`}),N.map(e=>(0,W.jsx)(we,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>I(e.id)},e.id)),P.length>0&&(0,W.jsx)(Ce,{suffix:w==="default"?void 0:w,children:`Worktrees`}),P.map(e=>(0,W.jsx)(we,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>I(e.id)},e.id))]}),!F&&j.length>0&&(0,W.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>he(!E),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:j.length}),(0,W.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:E?`−`:`+`})]}),E&&j.map(e=>(0,W.jsx)(Te,{task:e,onRestore:()=>L(e),onPreview:R?()=>V(e):void 0},e.id))]})]}),(0,W.jsx)(Se,{task:B,onClose:()=>V(null)}),(0,W.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,W.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,W.jsx)(x,{size:15,strokeWidth:1.8}),(0,W.jsx)(`span`,{children:`Settings`})]})})]})}async function De(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,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(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 je(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=ke(n.replace(/&/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ae(n.replace(/&/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>`:je(e)).join(``)}function Me(e){let t=e.replace(/\r\n/g,`
|
|
1
|
+
import{l as e,o as t}from"./terminal-qBEkzc-m.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-Dx-TnbvG.js";import{d as s,t as c}from"./createLucideIcon-CM5xLVj1.js";import{a as l,n as u,r as d}from"./toast-BXjAT0ix.js";import{n as f,t as p}from"./ViewToggle-BHBzWlni.js";import{n as m,t as h}from"./store-BXzqsTjs.js";import{n as g,t as _}from"./active-task-CuoFMFoR.js";import{t as v}from"./external-store-DJlWpyYC.js";import{c as y,d as b,i as x,l as S,p as C,r as w,t as T,u as E}from"./triage-DDohuPMh.js";import{i as D,r as O,t as k}from"./WorkspaceTabs-kqzy_Dsf.js";import{t as A}from"./SettingsPage-CLRhr-sg.js";import{t as j}from"./ChatTranscript-Co0UhezW.js";import{t as ee}from"./plus-BbX5qXba.js";import{t as te}from"./search-BxbFZoup.js";import{t as ne}from"./x-7cB9X7Hi.js";import{n as M,t as N}from"./activity-BjTd1D8q.js";import{t as P}from"./use-focus-trap-DNMrlNR0.js";import{t as re}from"./engines-Cnxy1hW9.js";import{n as ie}from"./settings-tPcmEHCP.js";import{i as ae,r as oe}from"./vendor-CdtpTJrf.js";import{r as F}from"./web-transport-D0bugxxv.js";import{n as se,t as I}from"./time-kviT26Tm.js";import{n as L,t as R}from"./ConfirmDialog-D-NILtP0.js";import{t as z}from"./text-match-DW3sD-Rt.js";import{t as B}from"./SlideOver-Dxtk6Gn2.js";import{n as V,r as ce,t as le}from"./chips-Da37C4KZ.js";var ue=c(`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`}]]),de=c(`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`}]]),H=c(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fe=c(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),U=e(o(),1),W=s();function pe({onClose:e}){let{tasks:t}=m(),n=l(),i=(0,U.useRef)(null);P(i);let a=(0,U.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,U.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,U.useState)(a[0]??``),[f,p]=(0,U.useState)(null),[_,v]=(0,U.useState)(!1),[y,b]=(0,U.useState)(null),[x,S]=(0,U.useState)(!1),C=async e=>{if(e){v(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){d(`scan worktrees`,e),p([])}finally{v(!1)}}},T=async t=>{b(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:s,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),g(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),u(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){d(`adopt worktree`,e)}finally{b(null)}};return x?(0,W.jsx)(w,{onClose:e}):a.length===0?(0,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,W.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,W.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to Rove yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>S(!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,W.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,W.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,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,W.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsx)(`select`,{value:s,onChange:e=>c(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,W.jsx)(`option`,{value:e,children:e},e))}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>void C(s),disabled:!s||_,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:_?`Scanning…`:`Scan`})]})]}),(0,W.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,W.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,W.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,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,W.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,W.jsx)(`span`,{className:`ml-auto shrink-0`,children:se(e.lastActivityMs)})]})]}),t?(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>void T(e),disabled:y!==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:y===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,W.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,W.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`})})]})})}var G=v({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),K=null;function q(e){G.update(t=>({...t,...e}))}function J(e){q({query:e})}function Y(e){q({statusFilter:e})}function me(e){q({sortMode:e})}function he(e){q({showArchived:e})}function ge(e){!e||e===K||(K=e,q({sortMode:e}))}function _e(){return G.useSnapshot()}function ve(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ye(e,t){let n=ve(t)-ve(e);return n===0?t.id.localeCompare(e.id):n}function be(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(ye),i.sort(ye)),[...n,...r,...i]}function xe(e,t){return z([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}function Se({task:e,onClose:t}){return(0,W.jsx)(B,{open:e!==null,onClose:t,title:e?(0,W.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,W.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,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,W.jsx)(j,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}function Ce({children:e,suffix:t}){return(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function we({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:M(t?.state),l=I(e.updatedAt||e.createdAt);return(0,W.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,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,W.jsx)(H,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,W.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${N(t?.state)}`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,W.jsx)(ce,{pr:e.prStatus}),e.pinned&&(0,W.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,W.jsx)(le,{counts:r})]}),(0,W.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,W.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,W.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,W.jsx)(V,{label:i}),c&&(0,W.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,W.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Te({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,W.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,W.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,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,W.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 Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:s,worktreeChanges:c,uiPrefs:u,hydrated:f,streamConnected:p}=m(),{selectedTaskId:_}=n(),v=re(),y=(0,U.useMemo)(()=>oe(a),[a]),b=e=>ae(v,e,y),{query:S,statusFilter:C,sortMode:w,showArchived:E}=_e(),D=(0,U.useRef)(null),O=(0,U.useRef)(null);(0,U.useEffect)(()=>{_&&D.current?.querySelector(`[data-task-id="${CSS.escape(_)}"]`)?.scrollIntoView({block:`nearest`})},[_]);let k=u?.sortMode;(0,U.useEffect)(()=>{ge(k)},[k]);let A=(0,U.useMemo)(()=>a.filter(e=>!e.archived),[a]),j=(0,U.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),M=(0,U.useMemo)(()=>be(A.filter(e=>xe(e,S)&&T(o[e.id],c[e.worktreePath],C)),w),[A,S,C,w,o,c]),N=M.filter(e=>e.kind===`main`),P=M.filter(e=>e.kind!==`main`),F=!f||!p&&a.length===0,se=l(),I=e=>{r(e),g(e),se({to:`/task/$taskId`,params:{taskId:e}})};(0,U.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(),O.current?.focus();return}if(n&&o&&o!==document.body&&!D.current?.contains(o)||M.length===0)return;e.preventDefault();let s=M.findIndex(e=>e.id===_),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),M.length-1);I(M[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,_]);let L=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>d(`restore "${e.title||e.branch}"`,t))},[R,z]=(0,U.useState)(!1),[B,V]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let e=!0;return ie().then(t=>{e&&z(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,W.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,W.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>me(w==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${w===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,W.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[M.length,`/`,A.length]}),(0,W.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,W.jsx)(de,{size:14,strokeWidth:1.9})}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,W.jsx)(ee,{size:14,strokeWidth:2.2})})]})]}),(0,W.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,W.jsx)(te,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,W.jsx)(`input`,{ref:O,value:S,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M.length>0?(e.preventDefault(),I(M[0].id),e.currentTarget.blur()):e.key===`Escape`&&S&&(e.preventDefault(),J(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),S&&(0,W.jsx)(`button`,{type:`button`,onClick:()=>J(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,W.jsx)(ne,{size:13,strokeWidth:2})})]}),(0,W.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,W.jsx)(`button`,{type:`button`,onClick:()=>Y(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${C===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,W.jsxs)(`div`,{ref:D,className:`flex-1 overflow-y-auto`,children:[F?(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,W.jsx)(H,{size:13,strokeWidth:2,className:`animate-spin`}),(0,W.jsx)(`span`,{children:`connecting…`})]}):A.length===0?(0,W.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,W.jsx)(`p`,{children:`No tasks yet.`}),(0,W.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,W.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,W.jsx)(`div`,{children:S?`No matches for “${S}”.`:`No tasks in this status.`}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{J(``),Y(`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,W.jsxs)(W.Fragment,{children:[N.length>0&&(0,W.jsx)(Ce,{children:`Projects`}),N.map(e=>(0,W.jsx)(we,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>I(e.id)},e.id)),P.length>0&&(0,W.jsx)(Ce,{suffix:w==="default"?void 0:w,children:`Worktrees`}),P.map(e=>(0,W.jsx)(we,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>I(e.id)},e.id))]}),!F&&j.length>0&&(0,W.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>he(!E),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,W.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:j.length}),(0,W.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:E?`−`:`+`})]}),E&&j.map(e=>(0,W.jsx)(Te,{task:e,onRestore:()=>L(e),onPreview:R?()=>V(e):void 0},e.id))]})]}),(0,W.jsx)(Se,{task:B,onClose:()=>V(null)}),(0,W.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,W.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,W.jsx)(x,{size:15,strokeWidth:1.8}),(0,W.jsx)(`span`,{children:`Settings`})]})})]})}async function De(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,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(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 je(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=ke(n.replace(/&/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ae(n.replace(/&/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>`:je(e)).join(``)}function Me(e){let t=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
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
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(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{f as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r}from"./createLucideIcon-CM5xLVj1.js";import{a as i,n as a,r as o}from"./toast-BXjAT0ix.js";import{n as s,t as c}from"./ViewToggle-BdPCMBWa.js";import{n as l}from"./store-uT65Mask.js";import{n as u}from"./active-task-GeQZqbJK.js";import{t as d}from"./external-store-DJlWpyYC.js";import{t as f}from"./external-link-BwT2u1hD.js";import{a as p,i as m,n as h,r as g,t as _}from"./lazy-issue-panels-0Rhl2uhh.js";import{t as v}from"./plus-BbX5qXba.js";import{t as y}from"./search-BxbFZoup.js";import{t as b}from"./x-7cB9X7Hi.js";import{n as ee,t as x}from"./ConfirmDialog-CDPOtXww.js";import{_ as S,a as C,d as te,g as w,h as T,m as E,p as D,s as ne,u as O}from"./issues-1SCRkcB0.js";var k=e(n(),1),A={query:``,repo:null};function j(e){M.update(t=>({...t,...e}))}var M=d(A);function N(){return M.useSnapshot()}function P(e){e!==M.getSnapshot().query&&j({query:e})}function F(e){e!==M.getSnapshot().repo&&j({repo:e})}function re(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,k.useState)(!1),[s,c]=(0,k.useState)(null),[l,u]=(0,k.useState)(new Map);return(0,k.useEffect)(()=>{u(e=>{if(e.size===0)return e;let r=new Map(e),i=!1;for(let e of t){let t=n[e];if(!(!t||!t.exists))for(let n of t.issues)n.taskId&&r.delete(`${e}:${n.id}`)&&(i=!0)}return i?r:e})},[t,n]),{issueBusy:i,quickStartingId:s,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await T(e,t,n),r([e]),!0}catch(e){return o(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await C(e,t.id),r([e]),!0}catch(e){return o(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(s===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await E(e,t,{vendor:n,effort:r,placement:i});return i!==`project`&&u(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:a}),r}),o}catch(e){o(`quick start issue`,e);return}finally{c(null)}}}}}var I=r();function L({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,I.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,I.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,I.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,I.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,I.jsx)(v,{size:11,strokeWidth:2}),(0,I.jsx)(`span`,{children:`New story`})]})]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,I.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=S(t)?t.taskId:void 0;return(0,I.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,I.jsx)(m,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,I.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,I.jsx)(f,{size:10,strokeWidth:1.8}),(0,I.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,I.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function ie({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,I.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,I.jsx)(L,{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 R(){let{tasks:e,hydrated:n,daemonConnected:r}=l(),{query:d,repo:f}=N(),m=i(),S=(0,k.useRef)(null),[C,T]=(0,k.useState)(null),[E,A]=(0,k.useState)(null),[j,M]=(0,k.useState)(null),[L,R]=(0,k.useState)([]);(0,k.useEffect)(()=>{let e=!1;return ne().then(t=>{e||R(t)}).catch(e=>o(`load projects`,e)),()=>{e=!0}},[]);let z=(0,k.useMemo)(()=>O(e,L),[e,L]),B=(0,k.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,k.useMemo)(()=>D(z,f),[z,f]),{data:H,pending:U,refresh:W}=p(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:ae,quickStart:oe}=re({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:se,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,k.useMemo)(()=>w({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,k.useEffect)(()=>{C&&(Y.some(e=>e.repo===C.repo&&e.issue.id===C.id)||T(null))},[Y,C]),(0,k.useEffect)(()=>{let e=e=>{if(C||E||j||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(),S.current?.focus()):e.key===`Escape`&&t===S.current&&d&&(e.preventDefault(),P(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,C,E,j]),(0,k.useEffect)(()=>{f!==V&&F(V)},[V,f]);let ce=!!d,$=e=>{t(e),u(e),m({to:`/task/$taskId`,params:{taskId:e}})};return(0,I.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,I.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,I.jsx)(ee,{}),(0,I.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove]`}),(0,I.jsx)(c,{}),(0,I.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,I.jsx)(y,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:S,value:d,onChange:e=>P(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>P(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,I.jsx)(b,{size:13,strokeWidth:2})})]}),z.length>0&&(0,I.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,I.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,I.jsx)(`select`,{value:V??``,onChange:e=>F(e.target.value),title:V??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:z.map(e=>{let t=se.find(t=>t.repo===e.repo)?.count??0;return(0,I.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,I.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,I.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,I.jsx)(s,{}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&ce&&Q?(0,I.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No stories match.`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{P(``)},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&&!r?(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,I.jsx)(ie,{board:X[0],onNewIssue:A,onPeekIssue:e=>T({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>M({repo:e,issue:t})}):(0,I.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,I.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>m({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=V??X[0]?.repo??B[0];return e?(0,I.jsx)(`button`,{type:`button`,onClick:()=>A(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,I.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),E&&(0,I.jsx)(_,{children:(0,I.jsx)(h,{repoRoot:E,open:!0,onClose:()=>A(null),onCreated:(e,t)=>{E&&W([E]),a(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!C)return null;let e=Y.find(e=>e.repo===C.repo&&e.issue.id===C.id);return e?(0,I.jsx)(_,{children:(0,I.jsx)(g,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>T(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await oe(e.repo,e.issue,t,n,r);i&&a?(T(null),$(a)):T(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;T(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&te(t,e.issue).then(()=>a(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>o(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),j&&(0,I.jsx)(x,{title:`Delete issue`,body:`Delete issue #${j.issue.id}: "${j.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:G,onConfirm:()=>void ae(j.repo,j.issue).then(e=>{e&&(M(null),C?.repo===j.repo&&C.id===j.issue.id&&T(null))}),onCancel:()=>M(null)})]})}export{R as Board};
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{f as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r}from"./createLucideIcon-CM5xLVj1.js";import{a as i,n as a,r as o}from"./toast-BXjAT0ix.js";import{n as s,t as c}from"./ViewToggle-BHBzWlni.js";import{n as l}from"./store-BXzqsTjs.js";import{n as u}from"./active-task-CuoFMFoR.js";import{t as d}from"./external-store-DJlWpyYC.js";import{t as f}from"./external-link-BwT2u1hD.js";import{a as p,i as m,n as h,r as g,t as _}from"./lazy-issue-panels-BcU72R8r.js";import{t as v}from"./plus-BbX5qXba.js";import{t as y}from"./search-BxbFZoup.js";import{t as b}from"./x-7cB9X7Hi.js";import{n as ee,t as x}from"./ConfirmDialog-D-NILtP0.js";import{_ as S,a as C,d as te,g as w,h as T,m as E,p as D,s as ne,u as O}from"./issues-BMqItbVN.js";var k=e(n(),1),A={query:``,repo:null};function j(e){M.update(t=>({...t,...e}))}var M=d(A);function N(){return M.useSnapshot()}function P(e){e!==M.getSnapshot().query&&j({query:e})}function F(e){e!==M.getSnapshot().repo&&j({repo:e})}function re(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,k.useState)(!1),[s,c]=(0,k.useState)(null),[l,u]=(0,k.useState)(new Map);return(0,k.useEffect)(()=>{u(e=>{if(e.size===0)return e;let r=new Map(e),i=!1;for(let e of t){let t=n[e];if(!(!t||!t.exists))for(let n of t.issues)n.taskId&&r.delete(`${e}:${n.id}`)&&(i=!0)}return i?r:e})},[t,n]),{issueBusy:i,quickStartingId:s,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await T(e,t,n),r([e]),!0}catch(e){return o(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await C(e,t.id),r([e]),!0}catch(e){return o(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(s===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await E(e,t,{vendor:n,effort:r,placement:i});return i!==`project`&&u(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:a}),r}),o}catch(e){o(`quick start issue`,e);return}finally{c(null)}}}}}var I=r();function L({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,I.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,I.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,I.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,I.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,I.jsx)(v,{size:11,strokeWidth:2}),(0,I.jsx)(`span`,{children:`New story`})]})]}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,I.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=S(t)?t.taskId:void 0;return(0,I.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,I.jsx)(m,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,I.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,I.jsx)(f,{size:10,strokeWidth:1.8}),(0,I.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,I.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function ie({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,I.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,I.jsx)(L,{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 R(){let{tasks:e,hydrated:n,daemonConnected:r}=l(),{query:d,repo:f}=N(),m=i(),S=(0,k.useRef)(null),[C,T]=(0,k.useState)(null),[E,A]=(0,k.useState)(null),[j,M]=(0,k.useState)(null),[L,R]=(0,k.useState)([]);(0,k.useEffect)(()=>{let e=!1;return ne().then(t=>{e||R(t)}).catch(e=>o(`load projects`,e)),()=>{e=!0}},[]);let z=(0,k.useMemo)(()=>O(e,L),[e,L]),B=(0,k.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,k.useMemo)(()=>D(z,f),[z,f]),{data:H,pending:U,refresh:W}=p(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:ae,quickStart:oe}=re({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:se,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,k.useMemo)(()=>w({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,k.useEffect)(()=>{C&&(Y.some(e=>e.repo===C.repo&&e.issue.id===C.id)||T(null))},[Y,C]),(0,k.useEffect)(()=>{let e=e=>{if(C||E||j||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(),S.current?.focus()):e.key===`Escape`&&t===S.current&&d&&(e.preventDefault(),P(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,C,E,j]),(0,k.useEffect)(()=>{f!==V&&F(V)},[V,f]);let ce=!!d,$=e=>{t(e),u(e),m({to:`/task/$taskId`,params:{taskId:e}})};return(0,I.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,I.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,I.jsx)(ee,{}),(0,I.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove]`}),(0,I.jsx)(c,{}),(0,I.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,I.jsx)(y,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:S,value:d,onChange:e=>P(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>P(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,I.jsx)(b,{size:13,strokeWidth:2})})]}),z.length>0&&(0,I.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,I.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,I.jsx)(`select`,{value:V??``,onChange:e=>F(e.target.value),title:V??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:z.map(e=>{let t=se.find(t=>t.repo===e.repo)?.count??0;return(0,I.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,I.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,I.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,I.jsx)(s,{}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&ce&&Q?(0,I.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No stories match.`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{P(``)},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&&!r?(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,I.jsx)(ie,{board:X[0],onNewIssue:A,onPeekIssue:e=>T({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>M({repo:e,issue:t})}):(0,I.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,I.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,I.jsx)(`button`,{type:`button`,onClick:()=>m({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=V??X[0]?.repo??B[0];return e?(0,I.jsx)(`button`,{type:`button`,onClick:()=>A(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,I.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),E&&(0,I.jsx)(_,{children:(0,I.jsx)(h,{repoRoot:E,open:!0,onClose:()=>A(null),onCreated:(e,t)=>{E&&W([E]),a(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!C)return null;let e=Y.find(e=>e.repo===C.repo&&e.issue.id===C.id);return e?(0,I.jsx)(_,{children:(0,I.jsx)(g,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>T(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await oe(e.repo,e.issue,t,n,r);i&&a?(T(null),$(a)):T(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;T(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&te(t,e.issue).then(()=>a(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>o(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),j&&(0,I.jsx)(x,{title:`Delete issue`,body:`Delete issue #${j.issue.id}: "${j.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:G,onConfirm:()=>void ae(j.repo,j.issue).then(e=>{e&&(M(null),C?.repo===j.repo&&C.id===j.issue.id&&T(null))}),onCancel:()=>M(null)})]})}export{R as Board};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-
|
|
2
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{c as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r,t as i}from"./createLucideIcon-CM5xLVj1.js";import{i as a}from"./store-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-DNTeFtk5.js","assets/terminal-qBEkzc-m.js","assets/tabs-Dx-TnbvG.js","assets/createLucideIcon-CM5xLVj1.js","assets/store-BXzqsTjs.js","assets/rotate-cw-D-UUtiD0.js","assets/web-transport-D0bugxxv.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{c as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r,t as i}from"./createLucideIcon-CM5xLVj1.js";import{i as a}from"./store-BXzqsTjs.js";import{t as o}from"./ChatTranscript-Co0UhezW.js";import{t as s}from"./external-link-BwT2u1hD.js";import{t as c}from"./x-7cB9X7Hi.js";import{n as l,t as u}from"./activity-BjTd1D8q.js";import{t as d}from"./use-focus-trap-DNMrlNR0.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-DNTeFtk5.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as e,n as t}from"./terminal-qBEkzc-m.js";import{s as n,y as r}from"./tabs-Dx-TnbvG.js";import{d as i,o as a,t as o}from"./createLucideIcon-CM5xLVj1.js";import{n as s}from"./store-
|
|
1
|
+
import{l as e,n as t}from"./terminal-qBEkzc-m.js";import{s as n,y as r}from"./tabs-Dx-TnbvG.js";import{d as i,o as a,t as o}from"./createLucideIcon-CM5xLVj1.js";import{n as s}from"./store-BXzqsTjs.js";import{t as c}from"./rotate-cw-D-UUtiD0.js";import{t as l}from"./web-transport-D0bugxxv.js";var u=o(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),d=`3.7.8`,f=d,p=typeof Buffer==`function`,m=typeof TextDecoder==`function`?new TextDecoder:void 0,h=typeof TextEncoder==`function`?new TextEncoder:void 0,g=Array.prototype.slice.call(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`),_=(e=>{let t={};return e.forEach((e,n)=>t[e]=n),t})(g),v=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,y=String.fromCharCode.bind(String),ee=typeof Uint8Array.from==`function`?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),te=e=>e.replace(/=/g,``).replace(/[+\/]/g,e=>e==`+`?`-`:`_`),ne=e=>e.replace(/[^A-Za-z0-9\+\/]/g,``),re=e=>{let t,n,r,i,a=``,o=e.length%3;for(let o=0;o<e.length;){if((n=e.charCodeAt(o++))>255||(r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255)throw TypeError(`invalid character found`);t=n<<16|r<<8|i,a+=g[t>>18&63]+g[t>>12&63]+g[t>>6&63]+g[t&63]}return o?a.slice(0,o-3)+`===`.substring(o):a},b=typeof btoa==`function`?e=>btoa(e):p?e=>Buffer.from(e,`binary`).toString(`base64`):re,ie=p?e=>Buffer.from(e).toString(`base64`):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(y.apply(null,e.subarray(n,n+4096)));return b(t.join(``))},ae=(e,t=!1)=>t?te(ie(e)):ie(e),x=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?y(192|t>>>6)+y(128|t&63):y(224|t>>>12&15)+y(128|t>>>6&63)+y(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return y(240|t>>>18&7)+y(128|t>>>12&63)+y(128|t>>>6&63)+y(128|t&63)}},oe=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,S=e=>e.replace(oe,x),se=p?e=>Buffer.from(e,`utf8`).toString(`base64`):h?e=>ie(h.encode(e)):e=>b(S(e)),ce=(e,t=!1)=>t?te(se(e)):se(e),le=e=>ce(e,!0),C=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,w=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return y((t>>>10)+55296)+y((t&1023)+56320);case 3:return y((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return y((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},T=e=>e.replace(C,w),ue=e=>{if(e=e.replace(/\s+/g,``),!v.test(e))throw TypeError(`malformed base64.`);e+=`==`.slice(2-(e.length&3));let t,n,r,i=[];for(let a=0;a<e.length;)t=_[e.charAt(a++)]<<18|_[e.charAt(a++)]<<12|(n=_[e.charAt(a++)])<<6|(r=_[e.charAt(a++)]),n===64?i.push(y(t>>16&255)):r===64?i.push(y(t>>16&255,t>>8&255)):i.push(y(t>>16&255,t>>8&255,t&255));return i.join(``)},de=typeof atob==`function`?e=>atob(ne(e)):p?e=>Buffer.from(e,`base64`).toString(`binary`):ue,fe=p?e=>ee(Buffer.from(e,`base64`)):e=>ee(de(e).split(``).map(e=>e.charCodeAt(0))),pe=e=>fe(he(e)),me=p?e=>Buffer.from(e,`base64`).toString(`utf8`):m?e=>m.decode(fe(e)):e=>T(de(e)),he=e=>ne(e.replace(/[-_]/g,e=>e==`-`?`+`:`/`)),ge=e=>me(he(e)),_e=e=>{if(typeof e!=`string`)return!1;let t=e.replace(/\s+/g,``).replace(/={0,2}$/,``);return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},ve=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),ye=function(){let e=(e,t)=>Object.defineProperty(String.prototype,e,ve(t));e(`fromBase64`,function(){return ge(this)}),e(`toBase64`,function(e){return ce(this,e)}),e(`toBase64URI`,function(){return ce(this,!0)}),e(`toBase64URL`,function(){return ce(this,!0)}),e(`toUint8Array`,function(){return pe(this)})},be=function(){let e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,ve(t));e(`toBase64`,function(e){return ae(this,e)}),e(`toBase64URI`,function(){return ae(this,!0)}),e(`toBase64URL`,function(){return ae(this,!0)})},xe={version:d,VERSION:f,atob:de,atobPolyfill:ue,btoa:b,btoaPolyfill:re,fromBase64:ge,toBase64:ce,encode:ce,encodeURI:le,encodeURL:le,utob:S,btou:T,decode:ge,isValid:_e,fromUint8Array:ae,toUint8Array:pe,extendString:ye,extendUint8Array:be,extendBuiltins:()=>{ye(),be()}},Se=class{constructor(e=new we,t=new Ce){this._base64=e,this._provider=t}activate(e){this._terminal=e,this._disposable=e.parser.registerOscHandler(52,e=>this._setOrReportClipboard(e))}dispose(){return this._disposable?.dispose()}_readText(e,t){let n=this._base64.encodeText(t);this._terminal?.input(`\x1B]52;${e};${n}\x07`,!1)}_setOrReportClipboard(e){let t=e.split(`;`);if(t.length<2)return!0;let n=t[0],r=t[1];if(r===`?`){let e=this._provider.readText(n);return e instanceof Promise?e.then(e=>(this._readText(n,e),!0)):(this._readText(n,e),!0)}let i=``;try{i=this._base64.decodeText(r)}catch{}let a=this._provider.writeText(n,i);return a instanceof Promise?a.then(()=>!0):!0}},Ce=class{async readText(e){return e===`c`?navigator.clipboard.readText():Promise.resolve(``)}async writeText(e,t){return e===`c`?navigator.clipboard.writeText(t):Promise.resolve()}},we=class{encodeText(e){return xe.encode(e)}decodeText(e){let t=xe.decode(e);return!xe.isValid(e)||xe.encode(t)!==e?``:t}},Te=2,Ee=1,De=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Te,Math.floor(u/e.css.cell.width)),rows:Math.max(Ee,Math.floor(l/e.css.cell.height))}}},Oe=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],ke=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],E;function Ae(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var je=class{constructor(){if(this.version=`6`,!E){E=new Uint8Array(65536),E.fill(1),E[0]=0,E.fill(0,1,32),E.fill(0,127,160),E.fill(2,4352,4448),E[9001]=2,E[9002]=2,E.fill(2,11904,42192),E[12351]=1,E.fill(2,44032,55204),E.fill(2,63744,64256),E.fill(2,65040,65050),E.fill(2,65072,65136),E.fill(2,65280,65377),E.fill(2,65504,65511);for(let e=0;e<Oe.length;++e)E.fill(0,Oe[e][0],Oe[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?E[e]:Ae(e,ke)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Ct.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Ct.createPropertyValue(0,n,r)}},Me=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Le.isErrorNoTelemetry(e)?new Le(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,o as t}from"./terminal-qBEkzc-m.js";import{y as n}from"./tabs-Dx-TnbvG.js";import{d as r,t as i}from"./createLucideIcon-CM5xLVj1.js";import{n as a}from"./store-uT65Mask.js";import{t as o}from"./rotate-cw-D-UUtiD0.js";import{t as s}from"./search-BxbFZoup.js";import{t as c}from"./x-7cB9X7Hi.js";import{t as l}from"./web-transport-D0bugxxv.js";import{t as u}from"./time-kviT26Tm.js";var d=i(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=e(n(),1);function m(e,n){return t.get(`/api/history/sessions`,{query:{worktreePath:e,vendor:n},label:`/api/history/sessions`})}async function h(e,n){let{messages:r}=await t.get(`/api/history/messages`,{query:{vendor:e,sessionId:n},label:`/api/history/messages`});return r}function g(e){let t=0,n=0,r=0;for(let i of e){let e=i.usage;e&&(t+=e.input_tokens,n+=e.output_tokens,r=e.input_tokens+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0))}return{inputTokens:t,outputTokens:n,contextTokens:r}}function _(e){return e>=1e6?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function v(e,t,n,r=80){return t-e-n<r}var y=90;function b(e){let t=e.input;if(t&&typeof t==`object`){let e=e=>typeof t[e]==`string`?t[e]:null,n=e(`command`)??e(`file_path`)??e(`pattern`)??e(`url`)??e(`description`)??e(`prompt`)??e(`query`);if(n)return n.length>y?`${n.slice(0,y-1)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>y?`${t.slice(0,y-1)}…`:t}catch{return``}}function x(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function S(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${b(e)}`;case`tool_result`:return x(e.output)}}function C(e){return e.blocks.map(S).join(` `)}function w(e,t){return!(t&&e.type===`tool_call`)}function T(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`&&!t)}var E=r(),D=600;function O({call:e,result:t}){let[n,r]=(0,p.useState)(!1),i=b(e),a=t?x(t.output):``,o=!n&&a.length>D,s=o?`${a.slice(0,D)}…`:a,c=a.length>0;return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>c&&r(e=>!e),className:`flex w-full items-baseline gap-2 text-left ${c?`cursor-pointer`:`cursor-default`}`,children:[(0,E.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,E.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,E.jsx)(d,{size:12}):(0,E.jsx)(f,{size:12})})]}),(n||!n&&a&&a.length<=D)&&a&&(0,E.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto whitespace-pre-wrap break-words border-l-2 pl-3 font-mono text-[11px] leading-relaxed ${t?.isError?`border-kobe-red/40 text-kobe-red/90`:`border-line text-muted`}`,children:s}),o&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`ml-5 mt-0.5 text-[10px] text-subtle hover:text-fg`,children:`show full output`})]})}function k({text:e}){let[t,n]=(0,p.useState)(!1);return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,E.jsx)(`span`,{children:`✱`}),(0,E.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,E.jsx)(d,{size:11}):(0,E.jsx)(f,{size:11})]}),t&&(0,E.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words border-l-2 border-line-subtle pl-3 text-[11px] italic leading-relaxed text-subtle`,children:e})]})}function A({message:e,results:t,hideTools:n}){let r=[],i=u(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!w(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,E.jsxs)(`div`,{className:`my-2 flex items-baseline gap-2 border-l-2 border-primary/60 bg-inset/40 px-3 py-2`,children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,E.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-[12px] leading-relaxed text-fg`,children:o.text}),i&&!a&&(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,E.jsx)(`p`,{className:`my-2 whitespace-pre-wrap break-words text-[12px] leading-relaxed ${e.role===`system`?`text-subtle`:`text-fg/90`}`,children:o.text},c));return}if(o.type===`tool_call`){r.push((0,E.jsx)(O,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,E.jsx)(k,{text:o.text},c));return}}),r.length===0?null:(0,E.jsx)(E.Fragment,{children:r})}var j=2500;function M({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=a(),i=l({daemonConnected:n,streamConnected:r}),[u,d]=(0,p.useState)([]),[f,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(!0),[S,w]=(0,p.useState)([]),[D,O]=(0,p.useState)(``),[k,M]=(0,p.useState)(!1),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(!0),z=(0,p.useRef)(-1),B=(0,p.useRef)(null),V=(0,p.useRef)(!0),H=(0,p.useRef)(0),U=(0,p.useRef)(!0),W=(0,p.useRef)(null);(0,p.useEffect)(()=>{U.current=b,W.current=f},[b,f]);let G=(0,p.useCallback)(async(n=!1)=>{if(!e)return;let r=H.current;try{let i=await m(e,t);if(i.latestMtime===z.current&&!n)return;z.current=i.latestMtime;let a=i.sessions.at(-1)??null,o=U.current?a:W.current??a;r=++H.current;let s=o?await h(t,o):[];if(r!==H.current)return;d(i.sessions),w(s),y(o),P(null)}catch(e){r===H.current&&P(e instanceof Error?e.message:String(e))}finally{r===H.current&&I(!0)}},[e,t]),K=(0,p.useRef)(G);(0,p.useEffect)(()=>{K.current=G},[G]),(0,p.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),y(null),O(``),M(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},j);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===u.at(-1);U.current=n,W.current=e,x(n),y(e);let r=++H.current;h(t,e).then(e=>{r===H.current&&w(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,p.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=v(e.scrollTop,e.scrollHeight,e.clientHeight);V.current=t,R(t)},Y=()=>{let e=B.current;e&&(e.scrollTop=e.scrollHeight,V.current=!0,R(!0))},X=(0,p.useMemo)(()=>{let e=new Map;for(let t of S)for(let n of t.blocks)n.type===`tool_result`&&e.set(n.callId,n);return e},[S]),Z=(0,p.useMemo)(()=>g(S),[S]),Q=(0,p.useMemo)(()=>S.map(e=>C(e).toLowerCase()),[S]),$=(0,p.useMemo)(()=>{let e=D.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&T(t,k))},[S,Q,D,k]);return e?(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),u.length>0&&(0,E.jsx)(`select`,{value:f??``,onChange:e=>q(e.target.value),className:`max-w-44 border border-line bg-bg px-1 py-0.5 font-mono text-[10px] text-muted focus:outline-none`,title:`Engine session`,children:u.map((e,t)=>(0,E.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===u.length-1?` (latest)`:``]},e))}),(0,E.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,E.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,_(Z.contextTokens)]}),Z.outputTokens>0&&(0,E.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,_(Z.inputTokens),` ⇣`,_(Z.outputTokens)]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void G(!0),className:`text-subtle transition-colors hover:text-fg`,title:`Refresh transcript`,"aria-label":`Refresh transcript`,children:(0,E.jsx)(o,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,E.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,E.jsx)(s,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,E.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Escape`&&D&&(e.preventDefault(),O(``))},placeholder:`Search transcript…`,spellCheck:!1,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg placeholder:text-subtle focus:outline-none`}),D.trim()&&(0,E.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),D.trim()&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>O(``),className:`shrink-0 text-subtle transition-colors hover:text-fg`,"aria-label":`clear transcript search`,title:`Clear search`,children:(0,E.jsx)(c,{size:12,strokeWidth:2})}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${k?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,title:k?`Show tool calls`:`Hide tool calls — read just the conversation`,children:k?`tools off`:`tools`})]}),(0,E.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,E.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?i?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`The Rove daemon is offline — the transcript will reappear once it reconnects.`}):(0,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,E.jsxs)(`button`,{type:`button`,onClick:()=>void G(!0),className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,E.jsx)(o,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`No engine session recorded for this worktree yet. Open a Vendor tab and start a conversation — the transcript appears here.`}):$.length===0?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,D.trim(),`”.`]}):$.map((e,t)=>(0,E.jsx)(A,{message:e,results:X,hideTools:k},`${e.sessionId}-${t}`)):(0,E.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,E.jsx)(`button`,{type:`button`,onClick:Y,className:`absolute bottom-3 right-4 flex items-center gap-1 border border-line bg-surface px-2 py-1 font-mono text-[10px] text-muted shadow-md transition-colors hover:border-primary hover:text-fg`,children:`↓ latest`})]})]}):(0,E.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{M as t};
|
|
1
|
+
import{l as e,o as t}from"./terminal-qBEkzc-m.js";import{y as n}from"./tabs-Dx-TnbvG.js";import{d as r,t as i}from"./createLucideIcon-CM5xLVj1.js";import{n as a}from"./store-BXzqsTjs.js";import{t as o}from"./rotate-cw-D-UUtiD0.js";import{t as s}from"./search-BxbFZoup.js";import{t as c}from"./x-7cB9X7Hi.js";import{t as l}from"./web-transport-D0bugxxv.js";import{t as u}from"./time-kviT26Tm.js";var d=i(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=e(n(),1);function m(e,n){return t.get(`/api/history/sessions`,{query:{worktreePath:e,vendor:n},label:`/api/history/sessions`})}async function h(e,n){let{messages:r}=await t.get(`/api/history/messages`,{query:{vendor:e,sessionId:n},label:`/api/history/messages`});return r}function g(e){let t=0,n=0,r=0;for(let i of e){let e=i.usage;e&&(t+=e.input_tokens,n+=e.output_tokens,r=e.input_tokens+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0))}return{inputTokens:t,outputTokens:n,contextTokens:r}}function _(e){return e>=1e6?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function v(e,t,n,r=80){return t-e-n<r}var y=90;function b(e){let t=e.input;if(t&&typeof t==`object`){let e=e=>typeof t[e]==`string`?t[e]:null,n=e(`command`)??e(`file_path`)??e(`pattern`)??e(`url`)??e(`description`)??e(`prompt`)??e(`query`);if(n)return n.length>y?`${n.slice(0,y-1)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>y?`${t.slice(0,y-1)}…`:t}catch{return``}}function x(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function S(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${b(e)}`;case`tool_result`:return x(e.output)}}function C(e){return e.blocks.map(S).join(` `)}function w(e,t){return!(t&&e.type===`tool_call`)}function T(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`&&!t)}var E=r(),D=600;function O({call:e,result:t}){let[n,r]=(0,p.useState)(!1),i=b(e),a=t?x(t.output):``,o=!n&&a.length>D,s=o?`${a.slice(0,D)}…`:a,c=a.length>0;return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>c&&r(e=>!e),className:`flex w-full items-baseline gap-2 text-left ${c?`cursor-pointer`:`cursor-default`}`,children:[(0,E.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,E.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,E.jsx)(d,{size:12}):(0,E.jsx)(f,{size:12})})]}),(n||!n&&a&&a.length<=D)&&a&&(0,E.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto whitespace-pre-wrap break-words border-l-2 pl-3 font-mono text-[11px] leading-relaxed ${t?.isError?`border-kobe-red/40 text-kobe-red/90`:`border-line text-muted`}`,children:s}),o&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`ml-5 mt-0.5 text-[10px] text-subtle hover:text-fg`,children:`show full output`})]})}function k({text:e}){let[t,n]=(0,p.useState)(!1);return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,E.jsx)(`span`,{children:`✱`}),(0,E.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,E.jsx)(d,{size:11}):(0,E.jsx)(f,{size:11})]}),t&&(0,E.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words border-l-2 border-line-subtle pl-3 text-[11px] italic leading-relaxed text-subtle`,children:e})]})}function A({message:e,results:t,hideTools:n}){let r=[],i=u(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!w(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,E.jsxs)(`div`,{className:`my-2 flex items-baseline gap-2 border-l-2 border-primary/60 bg-inset/40 px-3 py-2`,children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,E.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-[12px] leading-relaxed text-fg`,children:o.text}),i&&!a&&(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,E.jsx)(`p`,{className:`my-2 whitespace-pre-wrap break-words text-[12px] leading-relaxed ${e.role===`system`?`text-subtle`:`text-fg/90`}`,children:o.text},c));return}if(o.type===`tool_call`){r.push((0,E.jsx)(O,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,E.jsx)(k,{text:o.text},c));return}}),r.length===0?null:(0,E.jsx)(E.Fragment,{children:r})}var j=2500;function M({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=a(),i=l({daemonConnected:n,streamConnected:r}),[u,d]=(0,p.useState)([]),[f,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(!0),[S,w]=(0,p.useState)([]),[D,O]=(0,p.useState)(``),[k,M]=(0,p.useState)(!1),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(!0),z=(0,p.useRef)(-1),B=(0,p.useRef)(null),V=(0,p.useRef)(!0),H=(0,p.useRef)(0),U=(0,p.useRef)(!0),W=(0,p.useRef)(null);(0,p.useEffect)(()=>{U.current=b,W.current=f},[b,f]);let G=(0,p.useCallback)(async(n=!1)=>{if(!e)return;let r=H.current;try{let i=await m(e,t);if(i.latestMtime===z.current&&!n)return;z.current=i.latestMtime;let a=i.sessions.at(-1)??null,o=U.current?a:W.current??a;r=++H.current;let s=o?await h(t,o):[];if(r!==H.current)return;d(i.sessions),w(s),y(o),P(null)}catch(e){r===H.current&&P(e instanceof Error?e.message:String(e))}finally{r===H.current&&I(!0)}},[e,t]),K=(0,p.useRef)(G);(0,p.useEffect)(()=>{K.current=G},[G]),(0,p.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),y(null),O(``),M(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},j);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===u.at(-1);U.current=n,W.current=e,x(n),y(e);let r=++H.current;h(t,e).then(e=>{r===H.current&&w(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,p.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=v(e.scrollTop,e.scrollHeight,e.clientHeight);V.current=t,R(t)},Y=()=>{let e=B.current;e&&(e.scrollTop=e.scrollHeight,V.current=!0,R(!0))},X=(0,p.useMemo)(()=>{let e=new Map;for(let t of S)for(let n of t.blocks)n.type===`tool_result`&&e.set(n.callId,n);return e},[S]),Z=(0,p.useMemo)(()=>g(S),[S]),Q=(0,p.useMemo)(()=>S.map(e=>C(e).toLowerCase()),[S]),$=(0,p.useMemo)(()=>{let e=D.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&T(t,k))},[S,Q,D,k]);return e?(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),u.length>0&&(0,E.jsx)(`select`,{value:f??``,onChange:e=>q(e.target.value),className:`max-w-44 border border-line bg-bg px-1 py-0.5 font-mono text-[10px] text-muted focus:outline-none`,title:`Engine session`,children:u.map((e,t)=>(0,E.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===u.length-1?` (latest)`:``]},e))}),(0,E.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,E.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,_(Z.contextTokens)]}),Z.outputTokens>0&&(0,E.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,_(Z.inputTokens),` ⇣`,_(Z.outputTokens)]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void G(!0),className:`text-subtle transition-colors hover:text-fg`,title:`Refresh transcript`,"aria-label":`Refresh transcript`,children:(0,E.jsx)(o,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,E.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,E.jsx)(s,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,E.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Escape`&&D&&(e.preventDefault(),O(``))},placeholder:`Search transcript…`,spellCheck:!1,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg placeholder:text-subtle focus:outline-none`}),D.trim()&&(0,E.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),D.trim()&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>O(``),className:`shrink-0 text-subtle transition-colors hover:text-fg`,"aria-label":`clear transcript search`,title:`Clear search`,children:(0,E.jsx)(c,{size:12,strokeWidth:2})}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${k?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,title:k?`Show tool calls`:`Hide tool calls — read just the conversation`,children:k?`tools off`:`tools`})]}),(0,E.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,E.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?i?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`The Rove daemon is offline — the transcript will reappear once it reconnects.`}):(0,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,E.jsxs)(`button`,{type:`button`,onClick:()=>void G(!0),className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,E.jsx)(o,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`No engine session recorded for this worktree yet. Open a Vendor tab and start a conversation — the transcript appears here.`}):$.length===0?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,D.trim(),`”.`]}):$.map((e,t)=>(0,E.jsx)(A,{message:e,results:X,hideTools:k},`${e.sessionId}-${t}`)):(0,E.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,E.jsx)(`button`,{type:`button`,onClick:Y,className:`absolute bottom-3 right-4 flex items-center gap-1 border border-line bg-surface px-2 py-1 font-mono text-[10px] text-muted shadow-md transition-colors hover:border-primary hover:text-fg`,children:`↓ latest`})]})]}):(0,E.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{r,t as i}from"./desktop-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{r,t as i}from"./desktop-CFge7SbS.js";import{t as a}from"./use-focus-trap-DNMrlNR0.js";var o=n();function s({label:e,tone:t,onClick:n}){return(0,o.jsx)(`button`,{type:`button`,"aria-label":e,title:e,onClick:n,className:`h-3 w-3 rounded-full border border-black/20 ${t===`close`?`bg-[#ff5f57]`:t===`minimize`?`bg-[#febc2e]`:`bg-[#28c840]`}`})}function c(){if(!r())return null;let e=i();return(0,o.jsxs)(`fieldset`,{"data-kobe-window-controls":!0,className:`m-0 flex min-w-0 shrink-0 items-center gap-2 border-0 p-0`,children:[(0,o.jsx)(`legend`,{className:`sr-only`,children:`Window controls`}),(0,o.jsx)(s,{label:`Close window`,tone:`close`,onClick:()=>e?.close()}),(0,o.jsx)(s,{label:`Minimize window`,tone:`minimize`,onClick:()=>e?.minimize()}),(0,o.jsx)(s,{label:`Zoom window`,tone:`zoom`,onClick:()=>e?.toggleMaximize()})]})}var l=e(t(),1);function u({title:e,body:t,confirmLabel:n,danger:r=!1,busy:i=!1,onConfirm:s,onCancel:c}){let u=(0,l.useRef)(null),d=(0,l.useRef)(null);return a(d),(0,l.useEffect)(()=>{u.current?.focus();let e=e=>{e.key===`Escape`&&c()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,o.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:c,onKeyDown:()=>{},role:`presentation`,children:(0,o.jsxs)(`div`,{ref:d,role:`alertdialog`,"aria-modal":`true`,"aria-label":e,className:`w-96 border border-line bg-surface shadow-xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:[(0,o.jsx)(`div`,{className:`border-b border-line px-3 py-2 text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:e}),(0,o.jsx)(`p`,{className:`px-3 py-3 text-[12px] leading-relaxed text-muted`,children:t}),(0,o.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-line px-3 py-2`,children:[(0,o.jsx)(`button`,{type:`button`,onClick:c,className:`border border-line bg-bg px-3 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Cancel`}),(0,o.jsx)(`button`,{ref:u,type:`button`,onClick:s,disabled:i,className:`border px-3 py-1 text-[11px] transition-colors disabled:opacity-40 ${r?`border-kobe-red/50 bg-kobe-red/10 text-kobe-red hover:bg-kobe-red/20`:`border-primary bg-inset text-fg hover:bg-primary/10`}`,children:i?`Working…`:n})]})]})})}export{c as n,u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{t as r}from"./SlideOver-Dxtk6Gn2.js";import{f as i,i as a}from"./issues-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{t as r}from"./SlideOver-Dxtk6Gn2.js";import{f as i,i as a}from"./issues-BMqItbVN.js";import{n as o,t as s}from"./RichEditor-DJFl5TvH.js";var c=e(t(),1),l=n();function u({repoRoot:e,open:t,onClose:n,onCreated:u}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(void 0),[_,v]=(0,c.useState)(void 0),[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(null),C=d.trim().length>0&&!y,w=t=>{if(!C)return;let r=d.trim();b(!0),S(null),a(e,p.trim()?{title:r,body:p}:{title:r}).then(async a=>{let o=a.issues.find(e=>e.title===r)??a.issues[0];t&&o&&await i(e,o,h,_),o&&u(o,t),f(``),m(``),n()}).catch(e=>{S(e instanceof Error?e.message:`failed to create issue`)}).finally(()=>b(!1))};return(0,l.jsx)(r,{open:t,onClose:n,title:`New story`,footer:(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-3 py-2.5`,children:[(0,l.jsx)(`button`,{type:`button`,disabled:!C,onClick:()=>w(!1),className:`border border-line bg-bg px-3 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:y?`Saving…`:`Save`}),(0,l.jsx)(`button`,{type:`button`,disabled:!C,onClick:()=>w(!0),className:`border border-primary bg-inset px-3 py-1 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:y?`Starting…`:`Start session`})]}),children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Title`}),(0,l.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`What should the session deliver?`,autoFocus:!0,className:`w-full border border-line bg-bg px-2 py-1.5 text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Acceptance`}),(0,l.jsx)(`span`,{className:`text-[10px] text-subtle`,children:`paste or drop images`})]}),(0,l.jsx)(s,{value:p,onChange:m,repoRoot:e,placeholder:`context, constraints, acceptance criteria — paste a screenshot to attach it`})]}),(0,l.jsx)(o,{vendor:h,effort:_,disabled:y,onChange:e=>{g(e.vendor),v(e.effort)}}),x&&(0,l.jsx)(`p`,{className:`text-[11px] text-kobe-red`,role:`alert`,children:x})]})})}export{u as IssueIntakePanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n,t as r}from"./createLucideIcon-CM5xLVj1.js";import{t as i}from"./external-link-BwT2u1hD.js";import{t as a}from"./SlideOver-Dxtk6Gn2.js";import{n as o,r as s}from"./issues-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n,t as r}from"./createLucideIcon-CM5xLVj1.js";import{t as i}from"./external-link-BwT2u1hD.js";import{t as a}from"./SlideOver-Dxtk6Gn2.js";import{n as o,r as s}from"./issues-BMqItbVN.js";import{n as c,t as l}from"./RichEditor-DJFl5TvH.js";var u=r(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),d=r(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),f=e(t(),1),p=n(),m=[{id:`task`,label:`New worktree`,hint:`isolated branch, tab in its own task workspace`},{id:`projectWorktree`,label:`Worktree · tab in project`,hint:`isolated branch, chat tab lives in the project workspace`},{id:`project`,label:`Project checkout`,hint:`no worktree — the engine works directly on the checkout`}];function h({issue:e,repoRoot:t,busy:n,starting:r,onClose:h,onSave:g,onStart:_,onOpenSession:v,onPromptMerge:y}){let[b,x]=(0,f.useState)(e.title),[S,C]=(0,f.useState)(e.body),[w,T]=(0,f.useState)(void 0),[E,D]=(0,f.useState)(void 0),[O,k]=(0,f.useState)(`task`),[A,j]=(0,f.useState)(null),M=!!e.taskId,N=s(e.status)&&!M,P=b!==e.title||S!==e.body,F=P&&b.trim().length>0&&!n,I=o[e.status];return(0,p.jsx)(a,{open:!0,wide:!0,onClose:h,title:(0,p.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,p.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-subtle`,children:[`#`,e.id]}),(0,p.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]}),children:(0,p.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 border-r border-line p-3`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Title`}),(0,p.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),placeholder:`Issue title`,className:`w-full border border-line bg-bg px-2 py-1.5 text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,p.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Acceptance`}),(0,p.jsx)(`span`,{className:`text-[10px] text-subtle`,children:`paste or drop images`})]}),(0,p.jsx)(l,{value:S,onChange:C,repoRoot:t,placeholder:`context, constraints, acceptance criteria — paste a screenshot to attach it`},e.id)]}),A&&(0,p.jsx)(`p`,{className:`text-[11px] text-kobe-red`,role:`alert`,children:A}),(0,p.jsx)(`div`,{className:`flex justify-end`,children:(0,p.jsx)(`button`,{type:`button`,disabled:!F,onClick:()=>{F&&(j(null),g({title:b,body:S}).catch(e=>{j(e instanceof Error?e.message:`failed to save issue`)}))},title:P?`Save title and body`:`No unsaved changes`,className:`border border-primary bg-inset px-3 py-1 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:n?`Saving…`:`Save`})})]}),(0,p.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-4 p-3`,children:[(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Detail`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${I.accent}`,children:I.title}),(0,p.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`created `,e.created]})]}),M&&e.taskId&&(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[10px] text-kobe-orange`,title:`Linked to task ${e.taskId}`,children:[(0,p.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-kobe-orange`}),`running`]})]}),(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5 border-t border-line pt-3`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Engine`}),(0,p.jsx)(c,{vendor:w,effort:E,disabled:!N,onChange:e=>{T(e.vendor),D(e.effort)}})]}),(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5 border-t border-line pt-3`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Workspace`}),(0,p.jsx)(`div`,{className:`flex flex-col gap-1`,children:m.map(e=>(0,p.jsxs)(`button`,{type:`button`,disabled:!N,onClick:()=>k(e.id),title:e.hint,className:`border px-2 py-1 text-left text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${O===e.id?`border-primary bg-inset text-fg`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,children:[(0,p.jsx)(`span`,{className:`block`,children:e.label}),(0,p.jsx)(`span`,{className:`block text-[10px] text-subtle`,children:e.hint})]},e.id))})]}),(0,p.jsx)(`div`,{className:`mt-auto flex flex-col gap-2 border-t border-line pt-3`,children:M?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>v?.(),disabled:!v,title:`Open this story's running session in the workspace`,className:`flex h-8 items-center justify-center gap-1.5 border border-primary bg-inset px-3 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(i,{size:12,strokeWidth:1.8}),`Open session`]}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>y?.(),disabled:!y||r,title:`Insert the finish and merge prompt into this story's task`,className:`flex h-8 items-center justify-center gap-1.5 border border-line bg-bg px-3 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(u,{size:12,strokeWidth:1.8}),`Prompt merge`]}),(0,p.jsx)(`span`,{className:`text-center text-[10px] text-subtle`,children:`Started`})]}):N?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>_({vendor:w,effort:E,placement:O,watch:!1}),title:`Spawn the session for this story and stay on the board`,className:`flex h-8 items-center justify-center gap-1.5 border border-line bg-bg px-3 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(d,{size:12,strokeWidth:1.8}),r?`Starting…`:`Start in background`]}),(0,p.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>_({vendor:w,effort:E,placement:O,watch:!0}),title:`Spawn the session and open its workspace`,className:`flex h-8 items-center justify-center gap-1.5 border border-primary bg-inset px-3 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(d,{size:12,strokeWidth:1.8}),r?`Starting…`:`Start & watch`]})]}):(0,p.jsx)(`p`,{className:`text-center text-[10px] text-subtle`,children:`Done stories have nothing left to start.`})})]})]})})}export{h as IssuePeek};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{c as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r}from"./createLucideIcon-CM5xLVj1.js";import{a as i,r as a}from"./toast-BXjAT0ix.js";import{n as o}from"./store-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{c as t,y as n}from"./tabs-Dx-TnbvG.js";import{d as r}from"./createLucideIcon-CM5xLVj1.js";import{a as i,r as a}from"./toast-BXjAT0ix.js";import{n as o}from"./store-BXzqsTjs.js";import{t as ee}from"./arrow-left-DNM2CHhS.js";import{a as s,i as c,n as l,r as u,t as d}from"./lazy-issue-panels-BcU72R8r.js";import{t as f}from"./plus-BbX5qXba.js";import{t as p}from"./search-BxbFZoup.js";import{t as m}from"./x-7cB9X7Hi.js";import{n as h,t as g}from"./ConfirmDialog-D-NILtP0.js";import{a as _,c as v,d as y,h as b,l as te,m as ne,n as re,s as ie,t as x,u as ae}from"./issues-BMqItbVN.js";var S=e(n(),1);function C(e,t,n){let r=e.find(e=>e.length>0)?.[0]??null;if(t==null)return r;let i=-1,a=-1;for(let[n,r]of e.entries()){let e=r.indexOf(t);if(e!==-1){i=n,a=e;break}}if(i===-1)return r;if(n===`up`||n===`down`){let r=e[i],o=n===`up`?a-1:a+1;return r[Math.max(0,Math.min(o,r.length-1))]??t}let o=n===`left`?-1:1;for(let n=i+o;n>=0&&n<e.length;n+=o){let r=e[n];if(r.length!==0)return r[Math.min(a,r.length-1)]??t}return t}var w=r();function T(){let{tasks:e,hydrated:n}=o(),r=i(),[T,oe]=(0,S.useState)([]);(0,S.useEffect)(()=>{let e=!1;return ie().then(t=>{e||oe(t)}).catch(e=>a(`load projects`,e)),()=>{e=!0}},[]);let E=(0,S.useMemo)(()=>ae(e,T),[e,T]),[D,O]=(0,S.useState)(null);(0,S.useEffect)(()=>{if(E.length===0){D!==null&&O(null);return}(!D||!E.some(e=>e.repo===D))&&O(E[0]?.repo??null)},[E,D]);let{data:k,failed:A,pending:se}=s((0,S.useMemo)(()=>D?[D]:[],[D])),j=D?k[D]:void 0,[M,N]=(0,S.useState)(``),[P,F]=(0,S.useState)(!1),[I,L]=(0,S.useState)(null),[R,z]=(0,S.useState)(null),[B,V]=(0,S.useState)(null),[H,U]=(0,S.useState)(!1),[W,G]=(0,S.useState)(!1),[ce,K]=(0,S.useState)(!1),q=j?.issues??[],J=(0,S.useMemo)(()=>v(q,{query:M}),[q,M]),Y=(0,S.useMemo)(()=>te(J),[J]),X=J.length,Z=R==null?null:q.find(e=>e.id===R),Q=B==null?null:q.find(e=>e.id===B);(0,S.useEffect)(()=>{R!=null&&!q.some(e=>e.id===R)&&z(null),B!=null&&!q.some(e=>e.id===B)&&V(null)},[q,R,B]),(0,S.useEffect)(()=>L(null),[D]),(0,S.useEffect)(()=>{if(P||R!=null||B!=null)return;let e=e=>{let t=e.target;if(t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable))return;let n=e.key===`ArrowUp`?`up`:e.key===`ArrowDown`?`down`:e.key===`ArrowLeft`?`left`:e.key===`ArrowRight`?`right`:null;if(n){e.preventDefault();let t=C(x.map(e=>Y[e].map(e=>e.id)),I,n);t!=null&&L(t);return}(e.key===`Enter`||e.key===` `)&&I!=null&&J.some(e=>e.id===I)&&(e.preventDefault(),z(I))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Y,J,I,P,R,B]),(0,S.useEffect)(()=>{I!=null&&document.querySelector(`[data-issue-card="${I}"]`)?.scrollIntoView({block:`nearest`})},[I]);let $=e=>{r({to:`/task/$taskId`,params:{taskId:e}})};return(0,w.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,w.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,w.jsx)(h,{}),(0,w.jsxs)(`button`,{type:`button`,onClick:()=>r({to:`/`}),className:`flex items-center gap-1.5 text-muted transition-colors hover:text-fg`,title:`Back to workspace`,children:[(0,w.jsx)(ee,{size:15,strokeWidth:1.8}),(0,w.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,w.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Issues`}),(0,w.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,w.jsx)(p,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,w.jsx)(`input`,{value:M,onChange:e=>N(e.target.value),placeholder:`Filter stories ( #id, title, body )`,className:`w-52 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),M&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,w.jsx)(m,{size:13,strokeWidth:2})})]}),E.length>0&&(0,w.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,w.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,w.jsx)(`select`,{value:D??``,onChange:e=>O(e.target.value),title:D??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:E.map(e=>(0,w.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,e.count,` · `,e.repo]},e.repo))})]}),(0,w.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:[(0,w.jsxs)(`span`,{children:[X,` stor`,X===1?`y`:`ies`]}),(0,w.jsxs)(`button`,{type:`button`,disabled:!D,onClick:()=>F(!0),className:`flex items-center gap-1.5 border border-primary bg-inset px-2 py-0.5 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,title:`Capture a new story`,children:[(0,w.jsx)(f,{size:13,strokeWidth:1.8}),`New story`]})]})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:D?!n||se&&!j?(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):D&&A[D]?(0,w.jsx)(`p`,{className:`text-[12px] text-kobe-red`,children:A[D]}):X===0?(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:M?`No stories match your filter.`:`No stories yet. Capture one with New story.`}):(0,w.jsx)(`div`,{className:`flex h-full min-h-0 gap-4`,children:x.map(e=>{let t=re[e],n=Y[e];return(0,w.jsxs)(`section`,{className:`flex h-full min-h-0 w-72 shrink-0 flex-col`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center gap-2`,children:[(0,w.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n.length})]}),(0,w.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-0.5`,children:n.map(e=>(0,w.jsx)(c,{issue:e,selected:e.id===I,onOpen:()=>{L(e.id),z(e.id)},onDelete:()=>V(e.id)},e.id))})]},e)})}):(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`No projects yet. Create a task from the workspace to track stories against its repo.`})}),D&&P&&(0,w.jsx)(d,{children:(0,w.jsx)(l,{repoRoot:D,open:P,onClose:()=>F(!1),onCreated:(e,t)=>{t&&e.taskId&&$(e.taskId)}})}),D&&Z&&(0,w.jsx)(d,{children:(0,w.jsx)(u,{issue:Z,repoRoot:D,busy:H,starting:W,onClose:()=>z(null),onSave:async e=>{if(!D||R==null)return!1;U(!0);try{return await b(D,R,{title:e.title.trim(),body:e.body}),!0}catch(e){return a(`save issue`,e),!1}finally{U(!1)}},onStart:e=>{!D||!Z||(G(!0),ne(D,Z,e).then(({workspaceTaskId:t})=>{z(null),e.watch&&$(t)}).catch(e=>a(`start issue`,e)).finally(()=>G(!1)))},onOpenSession:Z.taskId?()=>{let e=Z.taskId;e&&(t(e),$(e))}:void 0,onPromptMerge:Z.taskId?()=>{let e=Z.taskId;e&&y(e,Z).catch(e=>a(`prompt issue merge`,e))}:void 0})}),Q&&(0,w.jsx)(g,{title:`Delete issue`,body:`Delete issue #${Q.id} "${Q.title}"? This removes only the issue record — any linked task, branch, or worktree is left untouched.`,confirmLabel:`Delete`,danger:!0,busy:ce,onConfirm:()=>{!D||B==null||(K(!0),_(D,B).then(()=>V(null)).catch(e=>a(`delete issue`,e)).finally(()=>K(!1)))},onCancel:()=>V(null)})]})}export{T as IssuesPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{_ as t,y as n}from"./tabs-Dx-TnbvG.js";import{i as r,r as i,t as a}from"./columns-3-CQGAnX-4.js";import{d as o,t as s}from"./createLucideIcon-CM5xLVj1.js";import{a as c,o as l}from"./toast-BXjAT0ix.js";import{n as u}from"./store-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{_ as t,y as n}from"./tabs-Dx-TnbvG.js";import{i as r,r as i,t as a}from"./columns-3-CQGAnX-4.js";import{d as o,t as s}from"./createLucideIcon-CM5xLVj1.js";import{a as c,o as l}from"./toast-BXjAT0ix.js";import{n as u}from"./store-BXzqsTjs.js";import{t as d}from"./x-7cB9X7Hi.js";import{n as f}from"./web-transport-D0bugxxv.js";function p(e){let t=l({warn:e?.router===void 0}),n=e?.router||t;return r(n.stores.__store,i(e,n))}var m=s(`git-branch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),h=s(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),g=e(n(),1),_=o();function v(){let{daemonConnected:e,streamConnected:t,hydrated:n}=u(),[r,i]=(0,g.useState)(!1);return!f({daemonConnected:e,streamConnected:t,hydrated:n})||r?null:(0,_.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-kobe-yellow/40 bg-kobe-yellow/10 px-3 py-1.5 text-[11px] text-kobe-yellow`,children:[(0,_.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-kobe-yellow`}),(0,_.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`The Rove daemon is offline — task data is frozen and mutations will fail until it reconnects (it auto-reconnects; the dashboard recovers on its own). If it doesn't recover, run `,(0,_.jsx)(`code`,{children:`rove doctor`}),` or`,` `,(0,_.jsx)(`code`,{children:`rove reset`}),` in a terminal.`]}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>i(!0),className:`shrink-0 text-kobe-yellow/70 hover:text-kobe-yellow`,"aria-label":`dismiss`,children:(0,_.jsx)(d,{size:13,strokeWidth:2})})]})}function y(){let e=c(),n=p({select:e=>e.location.pathname}),{selectedTaskId:r}=t(),i=n.startsWith(`/board`)?`board`:n.startsWith(`/worktrees`)?`worktrees`:`workspace`,o=t=>{if(i!==t){if(t===`workspace`){e(r?{to:`/task/$taskId`,params:{taskId:r}}:{to:`/`});return}e({to:t===`board`?`/board`:`/worktrees`})}},s=e=>`flex items-center gap-1.5 border-l border-line px-2 py-1 text-[11px] transition-colors first:border-l-0 ${e?`border-line-active bg-inset text-fg`:`text-subtle hover:text-fg`}`;return(0,_.jsxs)(`div`,{className:`flex items-center overflow-hidden rounded-sm border border-line`,children:[(0,_.jsxs)(`button`,{type:`button`,onClick:()=>o(`workspace`),"aria-pressed":i===`workspace`,title:`Workspace`,className:s(i===`workspace`),children:[(0,_.jsx)(h,{size:13,strokeWidth:1.8}),`Workspace`]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>o(`board`),"aria-pressed":i===`board`,title:`Board`,className:s(i===`board`),children:[(0,_.jsx)(a,{size:13,strokeWidth:1.8}),`Board`]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>o(`worktrees`),"aria-pressed":i===`worktrees`,title:`Worktrees`,className:s(i===`worktrees`),children:[(0,_.jsx)(m,{size:13,strokeWidth:1.8}),`Worktrees`]})]})}export{v as n,y as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-
|
|
2
|
-
import{c as e,l as t,o as n,t as r}from"./terminal-qBEkzc-m.js";import{_ as i,a,h as o,i as s,o as c,p as l,t as u,v as d,y as f}from"./tabs-Dx-TnbvG.js";import{d as p,t as m}from"./createLucideIcon-CM5xLVj1.js";import{i as h,n as g}from"./store-
|
|
3
|
-
`),n=[],r=0,i=0,a=!1;for(let e of t){let t=M.exec(e);if(t){r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),a=!0,n.push({kind:`hunk`,oldLn:null,newLn:null,text:e});continue}if(e.startsWith(`diff --git`)&&(a=!1),e===``||!a&&P(e)){n.push({kind:`meta`,oldLn:null,newLn:null,text:e});continue}let o=e[0];o===`+`?(n.push({kind:`add`,oldLn:null,newLn:i,text:e}),i++):o===`-`?(n.push({kind:`del`,oldLn:r,newLn:null,text:e}),r++):P(e)?n.push({kind:`meta`,oldLn:null,newLn:null,text:e}):(n.push({kind:`ctx`,oldLn:r,newLn:i,text:e}),r++,i++)}return n}var L=p();function R({added:e,deleted:t}){return e===0&&t===0?null:(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,L.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e]}),` `,(0,L.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,t]})]})}function z(e){let{worktreeChanges:t}=g(),n=e?t[e]:void 0;return n?`${n.added}:${n.deleted}`:`none`}function B({onRetry:e}){let{daemonConnected:t,streamConnected:n}=g();return y({daemonConnected:t,streamConnected:n})?(0,L.jsx)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:`The Rove daemon is offline — changes will reappear once it reconnects.`}):(0,L.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 py-4`,children:[(0,L.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load changes.`}),(0,L.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,L.jsx)(v,{size:11,strokeWidth:2}),`Retry`]})]})}function V({patch:e,wrap:t}){let n=(0,C.useMemo)(()=>I(e),[e]);return e.trim()?(0,L.jsx)(`div`,{className:`kobe-diff min-h-0 flex-1 overflow-auto py-2 font-mono text-[12px] leading-[1.15rem] ${t?`kobe-diff-wrap`:``}`,children:n.map((e,t)=>(0,L.jsxs)(`div`,{className:`kobe-diff-row ${D(e.kind)}`,children:[(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.oldLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.newLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-text`,children:e.text===``?` `:e.text})]},t))}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`No textual diff for this file.`})}function H({worktreePath:e,onOpenFile:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(null),c=z(e),{worktreeChanges:l}=g(),u=e?l[e]:void 0,d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),s(null);return}let t=++d.current;a(!0),s(null);try{let n=await T(e,{namesOnly:!0});t===d.current&&r(n)}catch(e){t===d.current&&(s(e instanceof Error?e.message:String(e)),r(null))}finally{t===d.current&&a(!1)}},[e]);(0,C.useEffect)(()=>{f()},[f,c]);let[p,m]=(0,C.useState)(``);(0,C.useEffect)(()=>{m(``)},[e]);let h=n?.files??[],_=(0,C.useMemo)(()=>j(h,p),[h,p]);return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:[`Changes`,h.length>0?` · ${h.length}`:``]}),u&&(0,L.jsx)(R,{added:u.added,deleted:u.deleted}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void f(),disabled:!e||i,className:`ml-auto rounded border border-line px-1.5 py-0.5 text-[10px] text-muted transition-colors hover:bg-surface disabled:opacity-40`,children:i?`…`:`↻`})]}),e?o?(0,L.jsx)(B,{onRetry:()=>void f()}):h.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsx)(`div`,{className:`text-[12px] text-subtle`,children:i?`Loading changes…`:`Worktree clean.`})}):(0,L.jsxs)(L.Fragment,{children:[h.length>1&&(0,L.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Escape`&&p&&(e.preventDefault(),m(``))},placeholder:`Filter ${h.length} files… (*.ts, !*.json)`,title:`Match a substring, a *.glob, or !exclude`,spellCheck:!1,className:`mx-3 mb-1 shrink-0 border border-line bg-bg px-2 py-1 font-mono text-[11px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`}),_.length===0?(0,L.jsx)(`div`,{className:`px-3 py-3 text-center text-[11px] text-subtle`,children:`No files match.`}):(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:_.map(e=>{let n=E(e.status);return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),title:e.path,className:`flex w-full items-center gap-2 border-l-2 border-transparent px-3 py-2 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono text-[11px] font-bold ${n.cls}`,children:n.label}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-fg/90`,children:w(e.path,34)}),e.staged&&(0,L.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase text-subtle`,children:`staged`})]},e.path)})})]}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,L.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Select a task to watch its worktree changes.`})]})})]})}function U({worktreePath:e,path:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(null),u=z(e),d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),l(null);return}let n=++d.current;s(!0),l(null);try{let i=await T(e,{path:t});if(n!==d.current)return;r(i.files.find(e=>e.path===t)??null)}catch(e){n===d.current&&l(e instanceof Error?e.message:String(e))}finally{n===d.current&&s(!1)}},[e,t]);(0,C.useEffect)(()=>{f()},[f,u]);let p=n?F(n.patch):null;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,L.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-3`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,title:t,children:t}),p&&(0,L.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,L.jsx)(R,{added:p.added,deleted:p.deleted})}),n&&(0,L.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-subtle ${p&&(p.added||p.deleted)?``:`ml-auto`}`,children:n.status}),n&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),title:i?`Disable line wrap`:`Wrap long lines`,className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:`wrap`})]}),c?(0,L.jsx)(B,{onRetry:()=>void f()}):n?(0,L.jsx)(V,{patch:n.patch,wrap:i}):o?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`Loading preview…`}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`No diff for this file.`})]})}var W=e({WorkspaceTabs:()=>Z}),G=(0,C.lazy)(()=>h(()=>import(`./ChatTerminal-MCI1aBbT.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function K(){return(0,L.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`})}function q(e){return e??`claude`}function J({taskId:e,tabId:t,vendor:n}){return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6`,children:(0,L.jsx)(`div`,{className:`grid w-full max-w-2xl grid-cols-1 gap-3 md:grid-cols-3`,children:[{title:`Vendor`,detail:n,body:`Start an engine session for this task.`,icon:b,action:()=>c(e,t,`vendor`)},{title:`Chat`,detail:`transcript`,body:`Read the session as structured messages and tool calls.`,icon:x,action:()=>c(e,t,`transcript`)},{title:`Terminal`,detail:`shell / worktree`,body:`Open a command shell in this task worktree.`,icon:S,action:()=>c(e,t,`terminal`)}].map(e=>{let t=e.icon;return(0,L.jsxs)(`button`,{type:`button`,onClick:e.action,className:`group flex min-h-36 flex-col border border-line bg-surface p-4 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center border border-line bg-bg text-muted group-hover:border-primary group-hover:text-primary`,children:(0,L.jsx)(t,{size:17,strokeWidth:1.8})}),(0,L.jsx)(`span`,{className:`truncate text-[10px] uppercase text-subtle`,children:e.detail})]}),(0,L.jsx)(`div`,{className:`mt-5 text-[12px] font-bold uppercase tracking-[0.12em] text-fg`,children:e.title}),(0,L.jsx)(`div`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:e.body})]},e.title)})})})}function Y({tab:e,taskId:t,taskWorktreePath:n,taskTitle:r,vendor:i}){return e?.kind===`empty`?(0,L.jsx)(J,{taskId:t,tabId:e.id,vendor:i}):e?.kind===`vendor`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:e.taskId??t,mode:`engine`},e.id)}):e?.kind===`terminal`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:t,mode:`shell`},e.id)}):e?.kind===`transcript`?(0,L.jsx)(_,{worktreePath:n,vendor:i,title:r},e.id):e?.kind===`file`?(0,L.jsx)(U,{worktreePath:n,path:e.path},e.id):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Opening a tab…`})}function X({tab:e,side:t,children:n,onCloseSplit:r}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[t===`right`&&(0,L.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,L.jsx)(`span`,{className:`truncate text-[11px] text-muted`,children:e?.title??`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:r,className:`text-[11px] text-subtle hover:text-fg`,"aria-label":`close split`,title:`Close split`,children:`×`})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 p-2`,children:n})]})}function Z(){let[e,t]=(0,C.useState)(null),[n,c]=(0,C.useState)(!1),{selectedTaskId:f,tabsByTask:p,activeByTask:m,splitByTask:h}=i(),{tasks:_,jobs:v}=g(),y=f?_.find(e=>e.id===f):null,b=f?p[f]??[]:[],x=f?m[f]:void 0,S=f?h[f]:void 0,w=e=>{if(!f)return;let t=b.find(t=>t.id===e);a(f,e),t&&d(t.kind)&&r(e)},T=b.find(e=>e.id===x)??b[0],E=S&&S!==T?.id?b.find(e=>e.id===S):void 0,D=q(y?.vendor),O=y?.title||y?.branch||`Session`,k=!!y&&((f?v[f]?.phase===`running`:!1)||y.worktreePath===null);return(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,L.jsx)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:f?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-stretch overflow-x-auto`,role:`tablist`,children:[b.map(e=>{let n=e.id===T?.id,r=e.id===E?.id;return(0,L.jsxs)(`div`,{role:`tab`,"aria-selected":n,tabIndex:0,draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e.id),t(e.id)},onDragEnd:()=>{t(null),c(!1)},className:`group flex h-9 select-none items-center gap-2 border-r border-b-2 border-r-line px-3 text-[12px] transition-colors ${n?`border-b-primary bg-bg text-fg`:r?`border-b-kobe-blue bg-inset text-fg`:`border-b-transparent text-muted hover:bg-inset/50`}`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(f,e.id),className:`max-w-40 cursor-grab truncate active:cursor-grabbing`,title:r?`${e.title} (split)`:e.title,children:e.title}),r&&(0,L.jsx)(`span`,{className:`text-[9px] font-bold uppercase text-kobe-blue`,children:`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>w(e.id),className:`text-subtle opacity-0 transition-opacity hover:text-fg group-hover:opacity-100`,"aria-label":`close tab`,title:`Close tab`,children:`×`})]},e.id)}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(f),className:`px-3 text-[13px] text-subtle hover:text-fg`,"aria-label":`new tab`,title:`New tab`,children:`+`})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-[11px] text-subtle`,children:[(0,L.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-subtle`}),`No task selected`]})}),(0,L.jsxs)(`section`,{className:`relative min-h-0 flex-1`,"aria-label":`Workspace`,onDragOver:t=>{if(!f||!e)return;t.preventDefault();let n=t.currentTarget.getBoundingClientRect();c(t.clientX>n.left+n.width/2)},onDragLeave:()=>c(!1),onDrop:n=>{if(!f||!e)return;n.preventDefault();let r=n.currentTarget.getBoundingClientRect();n.clientX>r.left+r.width/2?o(f,e):l(f,e),t(null),c(!1)},children:[f&&T?(0,L.jsxs)(`div`,{className:`flex h-full min-w-0`,children:[(0,L.jsx)(X,{tab:T,side:`left`,children:(0,L.jsx)(Y,{tab:T,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})}),E&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`w-px shrink-0 bg-line`}),(0,L.jsx)(X,{tab:E,side:`right`,onCloseSplit:()=>{f&&s(f)},children:(0,L.jsx)(Y,{tab:E,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})})]})]}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center`,children:(0,L.jsxs)(`div`,{className:`max-w-md`,children:[(0,L.jsx)(`div`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove web]`}),(0,L.jsx)(`h1`,{className:`mt-4 text-[18px] font-semibold text-fg`,children:y?k?`Setting up this task's worktree…`:`Opening workspace…`:`Select a task to open its workspace.`}),(0,L.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:`Web workspaces keep their own browser tabs, split panes, notes, and file previews for each task.`})]})}),e&&(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-y-2 right-2 flex w-[calc(50%-0.5rem)] items-center justify-center border border-dashed ${n?`border-primary bg-primary/10`:`border-line bg-inset/40`}`,children:(0,L.jsx)(`span`,{className:`border border-line bg-bg px-2 py-1 text-[10px] font-bold uppercase tracking-[0.12em] text-muted`,children:`Drop to split right`})})]})]})}export{w as i,W as n,H as r,Z as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-DNTeFtk5.js","assets/terminal-qBEkzc-m.js","assets/tabs-Dx-TnbvG.js","assets/createLucideIcon-CM5xLVj1.js","assets/store-BXzqsTjs.js","assets/rotate-cw-D-UUtiD0.js","assets/web-transport-D0bugxxv.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{c as e,l as t,o as n,t as r}from"./terminal-qBEkzc-m.js";import{_ as i,a,h as o,i as s,o as c,p as l,t as u,v as d,y as f}from"./tabs-Dx-TnbvG.js";import{d as p,t as m}from"./createLucideIcon-CM5xLVj1.js";import{i as h,n as g}from"./store-BXzqsTjs.js";import{t as _}from"./ChatTranscript-Co0UhezW.js";import{t as v}from"./rotate-cw-D-UUtiD0.js";import{t as y}from"./web-transport-D0bugxxv.js";var b=m(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),x=m(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),S=m(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),C=t(f(),1);function w(e,t=36){return e.length<=t?e:`…${e.slice(e.length-t+1)}`}async function T(e,t={}){return{files:(await n.get(`/api/diff`,{query:{worktreePath:e,path:t.path,namesOnly:t.namesOnly?`1`:void 0},label:`diff fetch`})).files??[]}}function E(e){switch(e){case`added`:return{label:`A`,cls:`text-kobe-green`};case`untracked`:return{label:`U`,cls:`text-kobe-green`};case`modified`:return{label:`M`,cls:`text-kobe-yellow`};case`deleted`:return{label:`D`,cls:`text-kobe-red`};case`renamed`:return{label:`R`,cls:`text-kobe-blue`};case`copied`:return{label:`C`,cls:`text-kobe-blue`};default:return{label:e.slice(0,1).toUpperCase()||`?`,cls:`text-muted`}}}function D(e){switch(e){case`hunk`:return`kobe-diff-hunk`;case`meta`:return`kobe-diff-meta`;case`add`:return`kobe-diff-add`;case`del`:return`kobe-diff-del`;default:return`kobe-diff-ctx`}}function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k(e){let t=e.replace(/\*+/g,`*`).split(`*`).map(O).join(`.*`);return RegExp(`^${t}$`)}function A(e,t){let n=t.trim(),r=n.startsWith(`!`),i=(r?n.slice(1):n).trim().toLowerCase();if(!i)return!0;let a=e.toLowerCase(),o=i.includes(`*`)?k(i).test(a):a.includes(i);return r?!o:o}function j(e,t){let n=t.trim();return n?e.filter(e=>A(e.path,n)):e}var M=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,N=[`diff --git`,`index `,`--- `,`+++ `,`new file`,`deleted file`,`rename `,`similarity `,`copy `,`\\ No newline`,`Binary files`];function P(e){return N.some(t=>e.startsWith(t))}function F(e){let t=0,n=0;for(let r of I(e))r.kind===`add`?t++:r.kind===`del`&&n++;return{added:t,deleted:n}}function I(e){let t=e.replace(/\n$/,``).split(`
|
|
3
|
+
`),n=[],r=0,i=0,a=!1;for(let e of t){let t=M.exec(e);if(t){r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),a=!0,n.push({kind:`hunk`,oldLn:null,newLn:null,text:e});continue}if(e.startsWith(`diff --git`)&&(a=!1),e===``||!a&&P(e)){n.push({kind:`meta`,oldLn:null,newLn:null,text:e});continue}let o=e[0];o===`+`?(n.push({kind:`add`,oldLn:null,newLn:i,text:e}),i++):o===`-`?(n.push({kind:`del`,oldLn:r,newLn:null,text:e}),r++):P(e)?n.push({kind:`meta`,oldLn:null,newLn:null,text:e}):(n.push({kind:`ctx`,oldLn:r,newLn:i,text:e}),r++,i++)}return n}var L=p();function R({added:e,deleted:t}){return e===0&&t===0?null:(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,L.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e]}),` `,(0,L.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,t]})]})}function z(e){let{worktreeChanges:t}=g(),n=e?t[e]:void 0;return n?`${n.added}:${n.deleted}`:`none`}function B({onRetry:e}){let{daemonConnected:t,streamConnected:n}=g();return y({daemonConnected:t,streamConnected:n})?(0,L.jsx)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:`The Rove daemon is offline — changes will reappear once it reconnects.`}):(0,L.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 py-4`,children:[(0,L.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load changes.`}),(0,L.jsxs)(`button`,{type:`button`,onClick:e,className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,L.jsx)(v,{size:11,strokeWidth:2}),`Retry`]})]})}function V({patch:e,wrap:t}){let n=(0,C.useMemo)(()=>I(e),[e]);return e.trim()?(0,L.jsx)(`div`,{className:`kobe-diff min-h-0 flex-1 overflow-auto py-2 font-mono text-[12px] leading-[1.15rem] ${t?`kobe-diff-wrap`:``}`,children:n.map((e,t)=>(0,L.jsxs)(`div`,{className:`kobe-diff-row ${D(e.kind)}`,children:[(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.oldLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.newLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-text`,children:e.text===``?` `:e.text})]},t))}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`No textual diff for this file.`})}function H({worktreePath:e,onOpenFile:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(null),c=z(e),{worktreeChanges:l}=g(),u=e?l[e]:void 0,d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),s(null);return}let t=++d.current;a(!0),s(null);try{let n=await T(e,{namesOnly:!0});t===d.current&&r(n)}catch(e){t===d.current&&(s(e instanceof Error?e.message:String(e)),r(null))}finally{t===d.current&&a(!1)}},[e]);(0,C.useEffect)(()=>{f()},[f,c]);let[p,m]=(0,C.useState)(``);(0,C.useEffect)(()=>{m(``)},[e]);let h=n?.files??[],_=(0,C.useMemo)(()=>j(h,p),[h,p]);return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:[`Changes`,h.length>0?` · ${h.length}`:``]}),u&&(0,L.jsx)(R,{added:u.added,deleted:u.deleted}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void f(),disabled:!e||i,className:`ml-auto rounded border border-line px-1.5 py-0.5 text-[10px] text-muted transition-colors hover:bg-surface disabled:opacity-40`,children:i?`…`:`↻`})]}),e?o?(0,L.jsx)(B,{onRetry:()=>void f()}):h.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsx)(`div`,{className:`text-[12px] text-subtle`,children:i?`Loading changes…`:`Worktree clean.`})}):(0,L.jsxs)(L.Fragment,{children:[h.length>1&&(0,L.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Escape`&&p&&(e.preventDefault(),m(``))},placeholder:`Filter ${h.length} files… (*.ts, !*.json)`,title:`Match a substring, a *.glob, or !exclude`,spellCheck:!1,className:`mx-3 mb-1 shrink-0 border border-line bg-bg px-2 py-1 font-mono text-[11px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`}),_.length===0?(0,L.jsx)(`div`,{className:`px-3 py-3 text-center text-[11px] text-subtle`,children:`No files match.`}):(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:_.map(e=>{let n=E(e.status);return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),title:e.path,className:`flex w-full items-center gap-2 border-l-2 border-transparent px-3 py-2 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono text-[11px] font-bold ${n.cls}`,children:n.label}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-fg/90`,children:w(e.path,34)}),e.staged&&(0,L.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase text-subtle`,children:`staged`})]},e.path)})})]}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,L.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Select a task to watch its worktree changes.`})]})})]})}function U({worktreePath:e,path:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(null),u=z(e),d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),l(null);return}let n=++d.current;s(!0),l(null);try{let i=await T(e,{path:t});if(n!==d.current)return;r(i.files.find(e=>e.path===t)??null)}catch(e){n===d.current&&l(e instanceof Error?e.message:String(e))}finally{n===d.current&&s(!1)}},[e,t]);(0,C.useEffect)(()=>{f()},[f,u]);let p=n?F(n.patch):null;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,L.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-3`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,title:t,children:t}),p&&(0,L.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,L.jsx)(R,{added:p.added,deleted:p.deleted})}),n&&(0,L.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-subtle ${p&&(p.added||p.deleted)?``:`ml-auto`}`,children:n.status}),n&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),title:i?`Disable line wrap`:`Wrap long lines`,className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:`wrap`})]}),c?(0,L.jsx)(B,{onRetry:()=>void f()}):n?(0,L.jsx)(V,{patch:n.patch,wrap:i}):o?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`Loading preview…`}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`No diff for this file.`})]})}var W=e({WorkspaceTabs:()=>Z}),G=(0,C.lazy)(()=>h(()=>import(`./ChatTerminal-DNTeFtk5.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function K(){return(0,L.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`})}function q(e){return e??`claude`}function J({taskId:e,tabId:t,vendor:n}){return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6`,children:(0,L.jsx)(`div`,{className:`grid w-full max-w-2xl grid-cols-1 gap-3 md:grid-cols-3`,children:[{title:`Vendor`,detail:n,body:`Start an engine session for this task.`,icon:b,action:()=>c(e,t,`vendor`)},{title:`Chat`,detail:`transcript`,body:`Read the session as structured messages and tool calls.`,icon:x,action:()=>c(e,t,`transcript`)},{title:`Terminal`,detail:`shell / worktree`,body:`Open a command shell in this task worktree.`,icon:S,action:()=>c(e,t,`terminal`)}].map(e=>{let t=e.icon;return(0,L.jsxs)(`button`,{type:`button`,onClick:e.action,className:`group flex min-h-36 flex-col border border-line bg-surface p-4 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center border border-line bg-bg text-muted group-hover:border-primary group-hover:text-primary`,children:(0,L.jsx)(t,{size:17,strokeWidth:1.8})}),(0,L.jsx)(`span`,{className:`truncate text-[10px] uppercase text-subtle`,children:e.detail})]}),(0,L.jsx)(`div`,{className:`mt-5 text-[12px] font-bold uppercase tracking-[0.12em] text-fg`,children:e.title}),(0,L.jsx)(`div`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:e.body})]},e.title)})})})}function Y({tab:e,taskId:t,taskWorktreePath:n,taskTitle:r,vendor:i}){return e?.kind===`empty`?(0,L.jsx)(J,{taskId:t,tabId:e.id,vendor:i}):e?.kind===`vendor`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:e.taskId??t,mode:`engine`},e.id)}):e?.kind===`terminal`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:t,mode:`shell`},e.id)}):e?.kind===`transcript`?(0,L.jsx)(_,{worktreePath:n,vendor:i,title:r},e.id):e?.kind===`file`?(0,L.jsx)(U,{worktreePath:n,path:e.path},e.id):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Opening a tab…`})}function X({tab:e,side:t,children:n,onCloseSplit:r}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[t===`right`&&(0,L.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,L.jsx)(`span`,{className:`truncate text-[11px] text-muted`,children:e?.title??`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:r,className:`text-[11px] text-subtle hover:text-fg`,"aria-label":`close split`,title:`Close split`,children:`×`})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 p-2`,children:n})]})}function Z(){let[e,t]=(0,C.useState)(null),[n,c]=(0,C.useState)(!1),{selectedTaskId:f,tabsByTask:p,activeByTask:m,splitByTask:h}=i(),{tasks:_,jobs:v}=g(),y=f?_.find(e=>e.id===f):null,b=f?p[f]??[]:[],x=f?m[f]:void 0,S=f?h[f]:void 0,w=e=>{if(!f)return;let t=b.find(t=>t.id===e);a(f,e),t&&d(t.kind)&&r(e)},T=b.find(e=>e.id===x)??b[0],E=S&&S!==T?.id?b.find(e=>e.id===S):void 0,D=q(y?.vendor),O=y?.title||y?.branch||`Session`,k=!!y&&((f?v[f]?.phase===`running`:!1)||y.worktreePath===null);return(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,L.jsx)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:f?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-stretch overflow-x-auto`,role:`tablist`,children:[b.map(e=>{let n=e.id===T?.id,r=e.id===E?.id;return(0,L.jsxs)(`div`,{role:`tab`,"aria-selected":n,tabIndex:0,draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e.id),t(e.id)},onDragEnd:()=>{t(null),c(!1)},className:`group flex h-9 select-none items-center gap-2 border-r border-b-2 border-r-line px-3 text-[12px] transition-colors ${n?`border-b-primary bg-bg text-fg`:r?`border-b-kobe-blue bg-inset text-fg`:`border-b-transparent text-muted hover:bg-inset/50`}`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(f,e.id),className:`max-w-40 cursor-grab truncate active:cursor-grabbing`,title:r?`${e.title} (split)`:e.title,children:e.title}),r&&(0,L.jsx)(`span`,{className:`text-[9px] font-bold uppercase text-kobe-blue`,children:`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>w(e.id),className:`text-subtle opacity-0 transition-opacity hover:text-fg group-hover:opacity-100`,"aria-label":`close tab`,title:`Close tab`,children:`×`})]},e.id)}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(f),className:`px-3 text-[13px] text-subtle hover:text-fg`,"aria-label":`new tab`,title:`New tab`,children:`+`})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-[11px] text-subtle`,children:[(0,L.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-subtle`}),`No task selected`]})}),(0,L.jsxs)(`section`,{className:`relative min-h-0 flex-1`,"aria-label":`Workspace`,onDragOver:t=>{if(!f||!e)return;t.preventDefault();let n=t.currentTarget.getBoundingClientRect();c(t.clientX>n.left+n.width/2)},onDragLeave:()=>c(!1),onDrop:n=>{if(!f||!e)return;n.preventDefault();let r=n.currentTarget.getBoundingClientRect();n.clientX>r.left+r.width/2?o(f,e):l(f,e),t(null),c(!1)},children:[f&&T?(0,L.jsxs)(`div`,{className:`flex h-full min-w-0`,children:[(0,L.jsx)(X,{tab:T,side:`left`,children:(0,L.jsx)(Y,{tab:T,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})}),E&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`w-px shrink-0 bg-line`}),(0,L.jsx)(X,{tab:E,side:`right`,onCloseSplit:()=>{f&&s(f)},children:(0,L.jsx)(Y,{tab:E,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})})]})]}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center`,children:(0,L.jsxs)(`div`,{className:`max-w-md`,children:[(0,L.jsx)(`div`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove web]`}),(0,L.jsx)(`h1`,{className:`mt-4 text-[18px] font-semibold text-fg`,children:y?k?`Setting up this task's worktree…`:`Opening workspace…`:`Select a task to open its workspace.`}),(0,L.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:`Web workspaces keep their own browser tabs, split panes, notes, and file previews for each task.`})]})}),e&&(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-y-2 right-2 flex w-[calc(50%-0.5rem)] items-center justify-center border border-dashed ${n?`border-primary bg-primary/10`:`border-line bg-inset/40`}`,children:(0,L.jsx)(`span`,{className:`border border-line bg-bg px-2 py-1 text-[10px] font-bold uppercase tracking-[0.12em] text-muted`,children:`Drop to split right`})})]})]})}export{w as i,W as n,H as r,Z as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./store-BXzqsTjs.js";function t(t){return e(`task.setActive`,{taskId:t})}function n(e,n){t(e).catch(e=>{n?.(e)})}export{n,t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Board as e}from"./Board-B0oB8DMk.js";var t=e;export{t as component};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AppShell-ByiYfvCg.js","assets/terminal-qBEkzc-m.js","assets/tabs-Dx-TnbvG.js","assets/createLucideIcon-CM5xLVj1.js","assets/toast-BXjAT0ix.js","assets/external-store-DJlWpyYC.js","assets/ViewToggle-BHBzWlni.js","assets/columns-3-CQGAnX-4.js","assets/with-selector-B5R3h-Ow.js","assets/store-BXzqsTjs.js","assets/x-7cB9X7Hi.js","assets/web-transport-D0bugxxv.js","assets/active-task-CuoFMFoR.js","assets/triage-DDohuPMh.js","assets/use-focus-trap-DNMrlNR0.js","assets/engines-Cnxy1hW9.js","assets/settings-tPcmEHCP.js","assets/vendor-CdtpTJrf.js","assets/WorkspaceTabs-kqzy_Dsf.js","assets/ChatTranscript-Co0UhezW.js","assets/rotate-cw-D-UUtiD0.js","assets/search-BxbFZoup.js","assets/time-kviT26Tm.js","assets/WorkspaceTabs-DLzL-Tad.css","assets/SettingsPage-CLRhr-sg.js","assets/plus-BbX5qXba.js","assets/activity-BjTd1D8q.js","assets/ConfirmDialog-D-NILtP0.js","assets/text-match-DW3sD-Rt.js","assets/SlideOver-Dxtk6Gn2.js","assets/chips-Da37C4KZ.js","assets/AppShell-HiyATJse.css","assets/Board-B0oB8DMk.js","assets/external-link-BwT2u1hD.js","assets/lazy-issue-panels-BcU72R8r.js","assets/issues-BMqItbVN.js","assets/IssuesPage-BjLRf_cj.js","assets/arrow-left-DNM2CHhS.js","assets/ChatTerminal-DNTeFtk5.js","assets/ChatTerminal-BrP-ENHg.css","assets/BoardPeek-VXShygbB.js","assets/IssueIntakePanel-BN31TW37.js","assets/RichEditor-DJFl5TvH.js","assets/react-dom-DCnDkJvp.js","assets/RichEditor-B4sEOPyN.css","assets/IssuePeek-BT8ZmKTT.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./store-BXzqsTjs.js";function t(e){return new URLSearchParams(e).get(`kobeDesktop`)===`1`}function n(e=window.location.search){let n=t(e);return n&&(document.documentElement.dataset.kobeDesktop=`true`),n}function r(){return document.documentElement.dataset.kobeDesktop===`true`}function i(){return window.kobeDesktopWindow}async function a(){await Promise.allSettled([e(()=>import(`./AppShell-ByiYfvCg.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])),e(()=>import(`./Board-B0oB8DMk.js`),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,34,30,35,16,28,25,21,27,14])),e(()=>import(`./IssuesPage-BjLRf_cj.js`),__vite__mapDeps([36,1,2,3,4,5,9,37,34,30,35,12,16,28,25,21,10,27,14])),e(()=>import(`./WorkspaceTabs-kqzy_Dsf.js`).then(e=>e.n),__vite__mapDeps([18,1,2,3,9,19,20,21,10,11,22,23])),e(()=>import(`./ChatTerminal-DNTeFtk5.js`),__vite__mapDeps([38,1,2,3,9,20,11,39])),e(()=>import(`./BoardPeek-VXShygbB.js`),__vite__mapDeps([40,1,2,3,9,19,20,21,10,11,22,33,26,14])),e(()=>import(`./IssueIntakePanel-BN31TW37.js`),__vite__mapDeps([41,1,2,3,29,10,14,35,9,12,16,28,42,8,43,15,5,17,44])),e(()=>import(`./IssuePeek-BT8ZmKTT.js`),__vite__mapDeps([45,1,2,3,33,29,10,14,35,9,12,16,28,42,8,43,15,5,17,44])),e(()=>import(`./SettingsPage-CLRhr-sg.js`).then(e=>e.n),__vite__mapDeps([24,1,2,3,4,5,16,17]))])}export{a as i,n,r,i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{ChatTerminal as r}from"./ChatTerminal-
|
|
1
|
+
import{l as e}from"./terminal-qBEkzc-m.js";import{y as t}from"./tabs-Dx-TnbvG.js";import{d as n}from"./createLucideIcon-CM5xLVj1.js";import{ChatTerminal as r}from"./ChatTerminal-DNTeFtk5.js";var i=e(t()),a=n();function o(){let e=`visual-${(new URLSearchParams(window.location.search).get(`run`)??`manual`).replace(/[^a-zA-Z0-9_-]/g,``).slice(0,48)||`manual`}`,[t,n]=(0,i.useState)(`connecting`),[o,s]=(0,i.useState)(``);return(0,a.jsxs)(`div`,{"data-testid":`opentui-harness`,"data-pty-status":t,style:{position:`fixed`,inset:0,background:`#141413`},children:[(0,a.jsx)(r,{tabId:e,taskId:e,mode:`shell`,testId:`opentui-terminal`,disableWebgl:!0,onStatusChange:n,onBufferChange:s}),(0,a.jsx)(`pre`,{"data-testid":`opentui-buffer`,style:{display:`none`},children:o})]})}export{o as component};
|