@sma1lboy/kobe 0.8.165 → 0.8.166
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 +328 -328
- package/dist/cli/kobe-run.js +328 -328
- package/dist/cli/rove-run.js +328 -328
- package/dist/web-ui/assets/AppShell-A79AgA-r.js +5 -0
- package/dist/web-ui/assets/{Board-B0oB8DMk.js → Board-By7g_Fl3.js} +1 -1
- package/dist/web-ui/assets/BoardPeek-CdAMtCEs.js +2 -0
- package/dist/web-ui/assets/{ConfirmDialog-D-NILtP0.js → ConfirmDialog-DChCLBRW.js} +1 -1
- package/dist/web-ui/assets/{IssuesPage-BjLRf_cj.js → IssuesPage-H7bWnbU-.js} +1 -1
- package/dist/web-ui/assets/SettingsPage-DX3tv5Yc.js +2 -0
- package/dist/web-ui/assets/WorkspaceTabs-CUfXWk-O.js +3 -0
- package/dist/web-ui/assets/board-CvA1XFBt.js +1 -0
- package/dist/web-ui/assets/{desktop-CFge7SbS.js → desktop-C2FN7ili.js} +2 -2
- package/dist/web-ui/assets/{index-BgcK6obF.js → index-siRV5zR0.js} +3 -3
- package/dist/web-ui/assets/issues-7mJB6TUn.js +1 -0
- package/dist/web-ui/assets/routes-Dq_5HCeD.js +1 -0
- package/dist/web-ui/assets/{task._taskId-EQWWNO2k.js → task._taskId-CTj9HrUF.js} +2 -2
- package/dist/web-ui/assets/{task._taskId-BuwKbKaG.js → task._taskId-IF3pimu3.js} +1 -1
- package/dist/web-ui/assets/{worktrees-3wHfn7Vh.js → worktrees-H75CQbMU.js} +1 -1
- package/dist/web-ui/index.html +3 -3
- package/package.json +1 -1
- package/dist/web-ui/assets/AppShell-ByiYfvCg.js +0 -5
- package/dist/web-ui/assets/BoardPeek-VXShygbB.js +0 -2
- package/dist/web-ui/assets/SettingsPage-CLRhr-sg.js +0 -2
- package/dist/web-ui/assets/WorkspaceTabs-kqzy_Dsf.js +0 -3
- package/dist/web-ui/assets/board-GAhbgwzQ.js +0 -1
- package/dist/web-ui/assets/issues-DmgD6qU_.js +0 -1
- package/dist/web-ui/assets/routes-DMeRqoPI.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
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-CUfXWk-O.js";import{t as A}from"./SettingsPage-DX3tv5Yc.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{a as F,i as ae,r as oe}from"./vendor-CdtpTJrf.js";import{r as I}from"./web-transport-D0bugxxv.js";import{n as L,t as se}from"./time-kviT26Tm.js";import{n as ce,t as R}from"./ConfirmDialog-DChCLBRW.js";import{t as z}from"./text-match-DW3sD-Rt.js";import{t as B}from"./SlideOver-Dxtk6Gn2.js";import{n as le,r as ue,t as de}from"./chips-Da37C4KZ.js";var fe=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`}]]),pe=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`}]]),V=c(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),me=c(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),H=e(o(),1),U=s();function he({onClose:e}){let{tasks:t}=m(),n=l(),i=(0,H.useRef)(null);P(i);let a=(0,H.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,H.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,H.useState)(a[0]??``),[f,p]=(0,H.useState)(null),[_,v]=(0,H.useState)(!1),[y,b]=(0,H.useState)(null),[x,S]=(0,H.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,U.jsx)(w,{onClose:e}):a.length===0?(0,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,U.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,U.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,U.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,U.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,U.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,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into Rove`})]}),(0,U.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,U.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,U.jsxs)(`div`,{className:`flex gap-2`,children:[(0,U.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,U.jsx)(`option`,{value:e,children:e},e))}),(0,U.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,U.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,U.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,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,U.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,U.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,U.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,U.jsx)(`span`,{className:`ml-auto shrink-0`,children:L(e.lastActivityMs)})]})]}),t?(0,U.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,U.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,U.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,U.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 W=v({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),G=null;function K(e){W.update(t=>({...t,...e}))}function q(e){K({query:e})}function J(e){K({statusFilter:e})}function ge(e){K({sortMode:e})}function _e(e){K({showArchived:e})}function ve(e){!e||e===G||(G=e,K({sortMode:e}))}function ye(){return W.useSnapshot()}function be(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function xe(e,t){let n=be(t)-be(e);return n===0?t.id.localeCompare(e.id):n}function Se(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(xe),i.sort(xe)),[...n,...r,...i]}function Ce(e,t){return z([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}function we({task:e,onClose:t}){return(0,U.jsx)(B,{open:e!==null,onClose:t,title:e?(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.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,U.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,U.jsx)(j,{worktreePath:e.worktreePath??null,vendor:F(e.vendor),title:e.title||e.branch})})}function Te({children:e,suffix:t}){return(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function Ee({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=se(e.updatedAt||e.createdAt);return(0,U.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,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,U.jsx)(V,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,U.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${N(t?.state)}`}),(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,U.jsx)(ue,{pr:e.prStatus}),e.pinned&&(0,U.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,U.jsx)(de,{counts:r})]}),(0,U.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,U.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,U.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,U.jsx)(le,{label:i}),c&&(0,U.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,U.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function De({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,U.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,U.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,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,U.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 Oe({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,H.useMemo)(()=>oe(a),[a]),b=e=>ae(v,e,y),{query:S,statusFilter:C,sortMode:w,showArchived:E}=ye(),D=(0,H.useRef)(null),O=(0,H.useRef)(null);(0,H.useEffect)(()=>{_&&D.current?.querySelector(`[data-task-id="${CSS.escape(_)}"]`)?.scrollIntoView({block:`nearest`})},[_]);let k=u?.sortMode;(0,H.useEffect)(()=>{ve(k)},[k]);let A=(0,H.useMemo)(()=>a.filter(e=>!e.archived),[a]),j=(0,H.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),M=(0,H.useMemo)(()=>Se(A.filter(e=>Ce(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,I=l(),L=e=>{r(e),g(e),I({to:`/task/$taskId`,params:{taskId:e}})};(0,H.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);L(M[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,_]);let se=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>d(`restore "${e.title||e.branch}"`,t))},[ce,R]=(0,H.useState)(!1),[z,B]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let e=!0;return ie().then(t=>{e&&R(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,U.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,U.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>ge(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,U.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[M.length,`/`,A.length]}),(0,U.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,U.jsx)(pe,{size:14,strokeWidth:1.9})}),(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,U.jsx)(ee,{size:14,strokeWidth:2.2})})]})]}),(0,U.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,U.jsx)(te,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,U.jsx)(`input`,{ref:O,value:S,onChange:e=>q(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M.length>0?(e.preventDefault(),L(M[0].id),e.currentTarget.blur()):e.key===`Escape`&&S&&(e.preventDefault(),q(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),S&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>q(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,U.jsx)(ne,{size:13,strokeWidth:2})})]}),(0,U.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,U.jsx)(`button`,{type:`button`,onClick:()=>J(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,U.jsxs)(`div`,{ref:D,className:`flex-1 overflow-y-auto`,children:[F?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,U.jsx)(V,{size:13,strokeWidth:2,className:`animate-spin`}),(0,U.jsx)(`span`,{children:`connecting…`})]}):A.length===0?(0,U.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,U.jsx)(`p`,{children:`No tasks yet.`}),(0,U.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,U.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,U.jsx)(`div`,{children:S?`No matches for “${S}”.`:`No tasks in this status.`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{q(``),J(`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,U.jsxs)(U.Fragment,{children:[N.length>0&&(0,U.jsx)(Te,{children:`Projects`}),N.map(e=>(0,U.jsx)(Ee,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>L(e.id)},e.id)),P.length>0&&(0,U.jsx)(Te,{suffix:w==="default"?void 0:w,children:`Worktrees`}),P.map(e=>(0,U.jsx)(Ee,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:b(e),active:e.id===_,onClick:()=>L(e.id)},e.id))]}),!F&&j.length>0&&(0,U.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>_e(!E),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,U.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:j.length}),(0,U.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:E?`−`:`+`})]}),E&&j.map(e=>(0,U.jsx)(De,{task:e,onRestore:()=>se(e),onPreview:ce?()=>B(e):void 0},e.id))]})]}),(0,U.jsx)(we,{task:z,onClose:()=>B(null)}),(0,U.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,U.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,U.jsx)(x,{size:15,strokeWidth:1.8}),(0,U.jsx)(`span`,{children:`Settings`})]})})]})}async function ke(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 Y(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Ae=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function je(e){let t=e.trim();return Ae.test(t)?t:null}function Me(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 Ne(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=je(n.replace(/&/g,`&`));return r?`<img src="${Y(r)}" alt="${Y(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Me(n.replace(/&/g,`&`));return r?`<a href="${Y(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 X(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:Ne(e)).join(``)}function Pe(e){let t=e.replace(/\r\n/g,`
|
|
2
|
+
`).split(`
|
|
3
|
+
`),n=[],r=0,i=null,a=()=>{i&&=(n.push(`</${i}>`),null)};for(;r<t.length;){let e=t[r];if(/^```/.test(e)){a();let e=[];for(r++;r<t.length&&!/^```/.test(t[r]);)e.push(Y(t[r])),r++;r++,n.push(`<pre class="kobe-md-pre"><code>${e.join(`
|
|
4
|
+
`)}</code></pre>`);continue}if(/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){a(),n.push(`<hr class="kobe-md-hr" />`),r++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){a();let e=o[1].length;n.push(`<h${e} class="kobe-md-h">${X(Y(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${X(Y(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>${X(Y(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>${X(Y(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">${X(Y(l.join(` `)))}</p>`)}return a(),n.join(`
|
|
5
|
+
`)}async function Fe(e){return(await t.get(`/api/notes`,{query:{taskId:e},label:`load notes`})).markdown??``}async function Ie(e,n){await t.put(`/api/notes`,{taskId:e,markdown:n},{label:`save notes`})}function Le(e){switch(e){case`saving`:return`saving…`;case`saved`:return`saved`;case`error`:return`save failed`;default:return``}}var Re=600;function ze({children:e,right:t}){return(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,U.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t]})}function Be({taskId:e,full:t=!1}){let[n,r]=(0,H.useState)(``),[i,a]=(0,H.useState)(!1),[o,s]=(0,H.useState)(!1),[c,l]=(0,H.useState)(`idle`),u=(0,H.useMemo)(()=>Pe(n),[n]),d=(0,H.useRef)(null),f=(0,H.useRef)(null),p=(0,H.useRef)(null),m=(0,H.useCallback)(()=>{d.current&&=(clearTimeout(d.current),null);let e=p.current;if(!e)return;p.current=null;let{taskId:t,value:n}=e;Ie(t,n).then(()=>{f.current===t&&l(`saved`)}).catch(()=>{f.current===t&&l(`error`)})},[]);(0,H.useEffect)(()=>{if(f.current=e,m(),l(`idle`),r(``),a(!1),!e)return;let t=!1;return s(!0),Fe(e).then(n=>{!t&&f.current===e&&r(n)}).catch(()=>{!t&&f.current===e&&r(``)}).finally(()=>{t||s(!1)}),()=>{t=!0}},[e,m]),(0,H.useEffect)(()=>()=>{m()},[m]);let h=(0,H.useCallback)(t=>{if(r(t),!e)return;let n=e;l(`saving`),p.current={taskId:n,value:t},d.current&&clearTimeout(d.current),d.current=setTimeout(m,Re)},[e,m]);return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-bg`,children:[(0,U.jsx)(ze,{right:e?(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==`idle`&&(0,U.jsx)(`span`,{className:`text-[10px] ${c===`error`?`text-kobe-red`:`text-subtle`}`,children:Le(c)}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`border px-1.5 py-0.5 text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,title:`Toggle markdown preview`,children:i?`Edit`:`Preview`})]}):null,children:`Notes`}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1 ${t?`px-0 pb-0`:`px-3 pb-3`}`,children:e?i?(0,U.jsx)(`div`,{className:`h-full w-full overflow-auto bg-surface px-4 py-3 ${t?`border-t border-line`:`rounded border border-line`}`,children:n.trim()?(0,U.jsx)(`div`,{className:`kobe-md text-[12px] leading-relaxed text-fg`,dangerouslySetInnerHTML:{__html:u}}):(0,U.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Nothing to preview yet.`})}):(0,U.jsx)(`textarea`,{value:n,onChange:e=>h(e.target.value),spellCheck:!1,placeholder:o?`loading notes…`:`Notes for this task — markdown, autosaved.`,disabled:o,className:`h-full w-full resize-none border-line bg-surface px-4 py-3 font-mono text-[12px] leading-relaxed text-fg placeholder:text-subtle focus:border-line-active focus:outline-none disabled:opacity-60 ${t?`border-x-0 border-b-0 border-t`:`rounded border`}`}):(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,U.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to open its web-only scratchpad.`})]})})})]})}var Ve=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],He=`DIRTY_WORKTREE`;function Ue(e){return e.replace(/_/g,` `)}function Z({name:e,value:t,mono:n=!1}){return(0,U.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2 last:border-b-0`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,U.jsx)(`div`,{className:`mt-1 min-w-0 truncate text-[12px] text-fg ${n?`font-mono`:``}`,title:t,children:t||`—`})]})}function Q({children:e,onClick:t,disabled:n,danger:r=!1}){return(0,U.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${r?`border-kobe-red/40 text-kobe-red hover:bg-kobe-red/10`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:e})}function We({task:e}){let[t,n]=(0,H.useState)(e?.title??``),[r,i]=(0,H.useState)(e?.branch??``),[o,s]=(0,H.useState)(null),[c,f]=(0,H.useState)(!1),p=(0,H.useRef)(null);(0,H.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let[m,v]=(0,H.useState)(null),y=re(),b=l();if((0,H.useEffect)(()=>{n(e?.title??``)},[e?.title]),(0,H.useEffect)(()=>{i(e?.branch??``)},[e?.branch]),!e)return(0,U.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,U.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to edit its metadata and worktree state.`})]})});let x=async(e,t)=>{s(e);try{await t()}catch(t){d(e.split(`:`)[0],t)}finally{s(null)}},S=()=>{let n=t.trim();!n||n===e.title||x(`rename`,()=>h(`task.rename`,{taskId:e.id,title:n}))},C=()=>{let t=r.trim();!t||t===e.branch||x(`branch`,()=>h(`task.setBranch`,{taskId:e.id,branch:t}))},w=()=>{ke(e.worktreePath).then(e=>{e&&(f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1200))})},T=()=>{v(null),x(`archive`,async()=>{await h(`task.archive`,{taskId:e.id,archived:!0}),a(),b({to:`/`}),await _(null)})},E=()=>{x(`restore`,()=>h(`task.archive`,{taskId:e.id,archived:!1}))},D=t=>{v(null),s(`delete`),(async()=>{try{await h(`task.delete`,{taskId:e.id,force:t}),a(),b({to:`/`}),g(null),u(`success`,`Deleted "${e.title||e.branch}"`)}catch(e){let n=e instanceof Error?e.message:String(e);!t&&n.includes(He)?v({kind:`delete`,force:!0}):d(`delete`,e)}finally{s(null)}})()};return(0,U.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,U.jsxs)(`div`,{className:`border-b border-line px-3 py-3`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Task`}),(0,U.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,U.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onBlur:S,onKeyDown:e=>{e.key===`Enter`&&S()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`}),(0,U.jsx)(Q,{onClick:S,disabled:o===`rename`,children:`Save`})]}),e.archived&&(0,U.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 border border-kobe-yellow/40 bg-kobe-yellow/10 px-2 py-1.5`,children:[(0,U.jsx)(`span`,{className:`text-[11px] text-kobe-yellow`,children:`archived`}),(0,U.jsx)(Q,{onClick:E,disabled:o!==null,children:`Restore`})]})]}),(0,U.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:[e.kind===`main`?(0,U.jsx)(Z,{name:`Branch`,value:e.branch,mono:!0}):(0,U.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2`,children:[(0,U.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Branch`}),(0,U.jsx)(`div`,{className:`mt-1 flex gap-2`,children:(0,U.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),onBlur:C,onKeyDown:e=>{e.key===`Enter`&&C()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1 font-mono text-[12px] text-fg focus:border-line-active focus:outline-none`})})]}),(0,U.jsx)(Z,{name:`Vendor`,value:F(e.vendor)}),(0,U.jsx)(Z,{name:`Worktree`,value:e.worktreePath,mono:!0}),(0,U.jsx)(Z,{name:`Repo`,value:e.repo,mono:!0}),(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Status`}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:Ve.map(t=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>void x(`status:${t}`,()=>h(`task.status`,{taskId:e.id,status:t})),disabled:o!==null,className:`border px-2 py-1.5 text-left text-[11px] capitalize transition-colors disabled:opacity-40 ${e.status===t?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:Ue(t)},t))})]}),(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Vendor`}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:y.map(t=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>void x(`vendor:${t.id}`,()=>h(`task.setVendor`,{taskId:e.id,vendor:t.id})),disabled:o!==null,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${F(e.vendor)===t.id?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:t.label},t.id))})]}),(0,U.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,U.jsx)(Q,{onClick:()=>void x(`pin`,()=>h(`task.pin`,{taskId:e.id,pinned:!e.pinned})),disabled:o!==null,children:e.pinned?`Unpin`:`Pin`}),(0,U.jsx)(Q,{onClick:()=>void x(`worktree`,()=>h(`task.ensureWorktree`,{taskId:e.id})),disabled:o!==null,children:`Ensure worktree`}),(0,U.jsx)(Q,{onClick:w,children:c?`Copied`:`Copy path`}),!e.archived&&(0,U.jsx)(Q,{onClick:()=>v({kind:`archive`}),disabled:o!==null,danger:!0,children:`Archive`})]}),e.kind!==`main`&&(0,U.jsxs)(`div`,{className:`mt-4 border-t border-line-subtle pt-3`,children:[(0,U.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Danger zone`}),(0,U.jsx)(Q,{onClick:()=>v({kind:`delete`,force:!1}),disabled:o!==null,danger:!0,children:`Delete task + worktree`})]})]}),m?.kind===`archive`&&(0,U.jsx)(R,{title:`Archive task`,body:`Archive "${e.title||e.branch}"? Its Hosted PTY sessions will be stopped; the worktree stays on disk and the task can be restored from the Archived section.`,confirmLabel:`Archive`,danger:!0,busy:o===`archive`,onConfirm:T,onCancel:()=>v(null)}),m?.kind===`delete`&&(0,U.jsx)(R,{title:m.force?`Worktree has uncommitted changes`:`Delete task`,body:m.force?`"${e.title||e.branch}" has uncommitted or untracked changes in its worktree. Force-delete discards them permanently.`:`Delete "${e.title||e.branch}"? This removes the task, kills its engine session, and removes its worktree (branch history stays in git).`,confirmLabel:m.force?`Force delete`:`Delete`,danger:!0,busy:o===`delete`,onConfirm:()=>D(m.force),onCancel:()=>v(null)})]})}function $({drawer:e=!1,onClose:t}={}){let[r,a]=(0,H.useState)(`overview`),{selectedTaskId:o}=n(),{tasks:s}=m(),c=o?s.find(e=>e.id===o)??null:null;return(0,U.jsxs)(`aside`,{className:e?`flex h-full w-full flex-col bg-bg`:`flex w-80 shrink-0 flex-col border-l border-line bg-bg`,children:[(0,U.jsxs)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:[[`overview`,`notes`,`changes`].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`px-3 text-[10px] font-bold uppercase tracking-[0.12em] ${r===e?`border-b-2 border-primary text-fg`:`text-subtle hover:text-muted`}`,children:e===`overview`?`Task`:e===`notes`?`Notes`:`Changes`},e)),e&&t&&(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto px-3 text-subtle hover:text-fg`,"aria-label":`Close tools`,children:(0,U.jsx)(ne,{size:14,strokeWidth:2})})]}),(0,U.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`overview`?(0,U.jsx)(We,{task:c}):r===`notes`?(0,U.jsx)(Be,{taskId:o,full:!0}):(0,U.jsx)(O,{worktreePath:c?.worktreePath??null,onOpenFile:e=>{o&&i(o,e)}})})]})}function Ge({onToggleTools:e,onShowHelp:t}){let{daemonConnected:r,streamConnected:i,tasks:a}=m(),{selectedTaskId:o}=n(),s=o?a.find(e=>e.id===o):null,c=I({daemonConnected:r,streamConnected:i});return(0,U.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,U.jsx)(ce,{}),(0,U.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove]`}),(0,U.jsx)(p,{}),s?(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`max-w-56 truncate rounded bg-inset px-2 py-0.5 text-[11px] text-fg`,children:s.title||s.branch}),(0,U.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-[11px] text-subtle md:inline`,children:s.branch})]}):(0,U.jsx)(`span`,{className:`rounded bg-inset px-2 py-0.5 text-[11px] text-muted`,children:`Workspace`}),(0,U.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[11px] text-subtle`,children:[(0,U.jsxs)(`span`,{className:`hidden items-center gap-1.5 sm:flex`,title:c.title,children:[(0,U.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${c.ok?`bg-kobe-green`:`bg-kobe-yellow`}`}),(0,U.jsx)(`span`,{children:c.label})]}),(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`hidden items-center text-muted transition-colors hover:text-fg sm:flex`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts (?)`,children:(0,U.jsx)(fe,{size:15,strokeWidth:1.8})}),(0,U.jsx)(`button`,{type:`button`,onClick:e,className:`flex items-center text-muted transition-colors hover:text-fg lg:hidden`,"aria-label":`Toggle task tools`,title:`Task tools`,children:(0,U.jsx)(me,{size:15,strokeWidth:1.8})})]})]})}function Ke(){let{tasks:e,update:t}=m(),{selectedTaskId:r}=n(),i=r?e.find(e=>e.id===r):null,a=e.filter(e=>!e.archived).length;return(0,U.jsxs)(`footer`,{className:`flex h-7 shrink-0 items-center gap-4 border-t border-line bg-surface px-3 text-[11px] text-subtle`,children:[(0,U.jsxs)(`span`,{children:[a,` task`,a===1?``:`s`]}),i&&(0,U.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[i.kind===`main`?`project`:`worktree`,` ·`,` `,D(i.worktreePath,54)]}),(0,U.jsx)(`span`,{className:`ml-auto`,children:t?.latest?`update ${t.latest} available`:`Rove web`})]})}function qe(){let{settingsOpen:e}=C(),[t,n]=(0,H.useState)(!1),[r,i]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,U.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,U.jsx)(Ge,{onToggleTools:()=>i(e=>!e),onShowHelp:S}),(0,U.jsx)(f,{}),(0,U.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,U.jsx)(Oe,{onOpenSettings:b,onNewTask:E,onAdopt:()=>n(!0)}),e?(0,U.jsx)(A,{onClose:y}):(0,U.jsx)(k,{}),(0,U.jsx)(`div`,{className:`hidden lg:flex`,children:(0,U.jsx)($,{})}),r&&(0,U.jsx)(`div`,{className:`fixed inset-0 z-30 flex justify-end bg-black/50 lg:hidden`,onClick:()=>i(!1),onKeyDown:e=>{e.key===`Escape`&&i(!1)},role:`presentation`,children:(0,U.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Task tools`,className:`h-full w-80 max-w-[85vw] border-l border-line bg-bg shadow-2xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:(0,U.jsx)($,{drawer:!0,onClose:()=>i(!1)})})})]}),(0,U.jsx)(Ke,{}),t&&(0,U.jsx)(he,{onClose:()=>n(!1)})]})}export{qe as AppShell};
|
|
@@ -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-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
|
+
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-DChCLBRW.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
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";import{a as f}from"./vendor-CdtpTJrf.js";var p=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`}]]),m=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`}]]),h=e(n(),1),g=r(),_=(0,h.lazy)(()=>a(()=>import(`./ChatTerminal-DNTeFtk5.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function v({task:e,engine:n,onClose:r,onOpenWorkspace:i,onReview:a,onCreatePr:v}){let[y,b]=(0,h.useState)(`engine`),[x]=(0,h.useState)(()=>t(e.id)),S=(0,h.useRef)(null);d(S,!0),(0,h.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 C=l(n?.state),w=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,g.jsxs)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:[(0,g.jsx)(`button`,{type:`button`,"aria-label":`Close peek`,onClick:r,className:`absolute inset-0 cursor-default bg-black/40`}),(0,g.jsxs)(`div`,{ref:S,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,g.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface px-3`,children:[(0,g.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${u(n?.state)}`}),(0,g.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-fg`,children:e.title||e.branch||e.id}),(0,g.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-[11px] text-subtle sm:inline`,children:e.branch}),C&&(0,g.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:C}),(0,g.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[a&&(0,g.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,g.jsx)(p,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Review`})]}),v&&(0,g.jsxs)(`button`,{type:`button`,onClick:v,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open a PR for this branch`,children:[(0,g.jsx)(m,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`PR`})]}),(0,g.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,g.jsx)(s,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Workspace`})]}),(0,g.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,g.jsx)(c,{size:15,strokeWidth:1.8})})]})]}),(0,g.jsxs)(`nav`,{className:`flex shrink-0 items-center gap-1 border-b border-line bg-surface px-2`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`engine`),className:w(y===`engine`),children:`Engine`}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`transcript`),className:w(y===`transcript`),children:`Transcript`})]}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,children:y===`engine`?(0,g.jsx)(h.Suspense,{fallback:(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`}),children:(0,g.jsx)(_,{tabId:x,taskId:e.id,mode:`engine`},x)}):(0,g.jsx)(o,{worktreePath:e.worktreePath,vendor:f(e.vendor),title:e.title||e.branch})})]})]})}export{v as BoardPeek};
|
|
@@ -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-C2FN7ili.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{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-
|
|
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-DChCLBRW.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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c as e,l as t,o as n}from"./terminal-qBEkzc-m.js";import{d as r,y as i}from"./tabs-Dx-TnbvG.js";import{a,c as o,d as s,i as c,r as l,t as u,u as d}from"./createLucideIcon-CM5xLVj1.js";import{a as f,n as p,r as m}from"./toast-BXjAT0ix.js";import{n as h,r as g}from"./settings-tPcmEHCP.js";import{a as _,t as v}from"./vendor-CdtpTJrf.js";var y=u(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),b=t(i(),1);async function x(){let e=await n.getOr(`/api/quick-prompts`,{},{label:`load quick prompts`});return{review:typeof e.review==`string`?e.review:null,pr:typeof e.pr==`string`?e.pr:null}}async function S(e){await n.put(`/api/quick-prompts`,e,{label:`save quick prompts`})}function C(e){return _(e)===`claude`?`/review`:`Review the current changes in this worktree critically.`}var w=[`Open a pull request for this task's branch:`,`1. Make sure the work is committed, then push the branch to origin.`,"2. Create the PR with `gh pr create` — write a clear title and a body that summarizes what changed and why, following this repo's conventions."].join(`
|
|
2
|
+
`),T=s();function E({title:e,children:t}){return(0,T.jsxs)(`section`,{children:[(0,T.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,T.jsx)(`div`,{className:`mt-3 space-y-3 text-[12px]`,children:t})]})}function D({label:e,detail:t,enabled:n,onToggle:r,disabled:i}){return(0,T.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border border-line bg-bg p-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsx)(`div`,{className:`text-[12px] font-bold text-fg`,children:e}),t?(0,T.jsx)(`div`,{className:`mt-1 text-[11px] leading-relaxed text-subtle`,children:t}):null]}),(0,T.jsx)(`button`,{type:`button`,onClick:r,disabled:i,className:`shrink-0 border px-2 py-0.5 text-[10px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${n?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:n?`On`:`Off`})]})}function O(){let[e,t]=(0,b.useState)(null),[n,r]=(0,b.useState)(!0),[i,a]=(0,b.useState)(!1),o=(0,b.useRef)(0),s=(0,b.useCallback)(async()=>{let e=++o.current;r(!0),a(!1);try{let n=await h();e===o.current&&t(n)}catch(t){e===o.current&&a(!0),m(`load settings`,t)}finally{e===o.current&&r(!1)}},[]);return(0,b.useEffect)(()=>{s()},[s]),{settings:e,loading:n,error:i,reload:s,patch:async e=>{let n=await g(e);return t(n),n}}}function k({palette:e}){return(0,T.jsx)(`span`,{className:`flex shrink-0 overflow-hidden rounded border border-line`,children:[e.bg,e.primary,e[`kobe-blue`],e[`kobe-green`]].filter(Boolean).map((e,t)=>(0,T.jsx)(`span`,{className:`h-5 w-3`,style:{backgroundColor:e}},t))})}function A(){let{names:e,palettes:t,active:n,overridden:r}=a();return(0,T.jsxs)(`div`,{className:`border border-line bg-surface p-4`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Appearance`}),r?(0,T.jsx)(`button`,{type:`button`,onClick:l,className:`border border-line bg-bg px-2 py-0.5 text-[10px] text-muted transition-colors hover:border-primary hover:text-fg`,title:`Clear the web-local theme and follow the TUI again`,children:`Follow TUI`}):(0,T.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`following TUI`})]}),e.length===0?(0,T.jsx)(`p`,{className:`mt-4 text-[12px] text-subtle`,children:`Loading themes…`}):(0,T.jsx)(`div`,{className:`mt-4 grid grid-cols-1 gap-1.5 sm:grid-cols-2`,children:e.map(e=>{let r=e===n;return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>c(e),className:`flex items-center gap-2 border px-2 py-1.5 text-left transition-colors ${r?`border-primary bg-inset`:`border-line bg-bg hover:border-primary`}`,children:[(0,T.jsx)(k,{palette:t[e]??{}}),(0,T.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] ${r?`text-fg`:`text-muted`}`,children:e}),r&&(0,T.jsx)(y,{size:13,strokeWidth:2.5,className:`shrink-0 text-primary`})]},e)})})]})}function j(){return(0,T.jsx)(`div`,{className:`space-y-6`,children:(0,T.jsxs)(E,{title:`Dashboard theme`,children:[(0,T.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`Pick a theme for this browser, or follow the TUI's theme. This is a browser-local override — it never changes the TUI.`}),(0,T.jsx)(A,{})]})})}function M({engine:e,onSave:t,onDefault:n,onRemove:r}){let[i,a]=(0,b.useState)(e.command),[o,s]=(0,b.useState)(e.label),c=/\s--[A-Za-z0-9][\w-]*/.test(o)&&!/\s--[A-Za-z0-9][\w-]*/.test(i);return(0,b.useEffect)(()=>{a(e.command),s(e.label)},[e.command,e.label]),(0,T.jsxs)(`div`,{className:`border border-line bg-bg p-3`,children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,T.jsxs)(`div`,{className:`min-w-0`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-bold text-fg`,children:e.label}),e.isDefault?(0,T.jsx)(`span`,{className:`font-mono text-[10px] text-primary`,children:`default`}):null,e.isCustom?(0,T.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`custom`}):null]}),(0,T.jsx)(`div`,{className:`font-mono text-[10px] text-subtle`,children:e.id})]}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),className:`shrink-0 border border-line bg-surface px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Make default`})]}),(0,T.jsxs)(`label`,{className:`mt-3 block`,children:[(0,T.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Display name (label only)`}),(0,T.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),className:`mt-1 w-full border border-line bg-surface px-2 py-1 text-fg focus:border-line-active focus:outline-none`})]}),(0,T.jsxs)(`label`,{className:`mt-2 block`,children:[(0,T.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Launch command (argv that Rove runs)`}),(0,T.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),className:`mt-1 w-full border border-line bg-surface px-2 py-1 font-mono text-fg focus:border-line-active focus:outline-none`})]}),c?(0,T.jsx)(`div`,{className:`mt-2 border border-kobe-yellow/40 bg-kobe-yellow/10 px-2 py-1 text-[11px] leading-relaxed text-kobe-yellow`,children:`This looks like a flag in the display name. Put permission/model flags in Launch command; the label is never executed.`}):null,(0,T.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,T.jsx)(`button`,{type:`button`,onClick:()=>t(e.id,i,o),className:`border border-primary bg-inset px-2 py-1 text-[11px] text-fg`,children:`Save`}),e.isCustom?(0,T.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),className:`border border-kobe-red/40 bg-kobe-red/10 px-2 py-1 text-[11px] text-kobe-red`,children:`Remove`}):null]})]})}function N({settings:e,patch:t}){let[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(``),[o,s]=(0,b.useState)(``),c=(e,n,r)=>void t({engineUpdates:[{id:e,command:n,label:r}]}).then(()=>p(`success`,`engine saved`));return(0,T.jsxs)(`div`,{className:`space-y-6`,children:[(0,T.jsxs)(E,{title:`Launch commands`,children:[(0,T.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`Same shared engine settings as the TUI. Built-ins can be renamed or pointed at a different command. Permission/model flags must live in Launch command, not Display name. Custom engines are available in new task and tab pickers.`}),(0,T.jsx)(`div`,{className:`space-y-2`,children:e.engines.map(e=>(0,T.jsx)(M,{engine:e,onSave:c,onDefault:e=>void t({defaultEngine:e}).then(()=>p(`success`,`default engine saved`)),onRemove:e=>void t({removeEngine:e}).then(()=>p(`success`,`engine removed`))},e.id))})]}),(0,T.jsxs)(E,{title:`Add engine`,children:[(0,T.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[(0,T.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`id, e.g. aider`,className:`border border-line bg-bg px-2 py-1 text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`}),(0,T.jsx)(`input`,{value:i,onChange:e=>a(e.target.value),placeholder:`command`,className:`border border-line bg-bg px-2 py-1 font-mono text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`}),(0,T.jsx)(`input`,{value:o,onChange:e=>s(e.target.value),placeholder:`display name`,className:`border border-line bg-bg px-2 py-1 text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>void t({addEngine:{id:n,command:i,label:o}}).then(()=>{r(``),a(``),s(``),p(`success`,`engine added`)}).catch(e=>m(`add engine`,e)),className:`border border-primary bg-inset px-2 py-1 text-[11px] text-fg`,children:`Add engine`})]})]})}function P(){let[e,t]=(0,b.useState)(``),[n,r]=(0,b.useState)(``),[i,a]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let e=!1;return x().then(n=>{e||(t(n.review??``),r(n.pr??``),a(!0))}).catch(t=>{e||m(`load quick-action templates`,t)}),()=>{e=!0}},[]),(0,T.jsxs)(E,{title:`Board quick actions`,children:[(0,T.jsxs)(`label`,{className:`block`,children:[(0,T.jsx)(`span`,{className:`text-muted`,children:`Review template`}),(0,T.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:`default: ${C(v)}`,rows:3,disabled:!i,className:`mt-1 w-full resize-y border border-line bg-bg p-2 font-mono text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,T.jsxs)(`label`,{className:`block`,children:[(0,T.jsx)(`span`,{className:`text-muted`,children:`Open-PR template`}),(0,T.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`default:\n${w}`,rows:5,disabled:!i,className:`mt-1 w-full resize-y border border-line bg-bg p-2 font-mono text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,T.jsx)(`span`,{className:`text-[11px] text-subtle`,children:`Empty = built-in default. Rove appends its status/URL guardrails at send time.`}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>void S({review:e,pr:n}).then(()=>p(`success`,`quick-action templates saved`)).catch(e=>m(`save templates`,e)),disabled:!i,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Save`})]})]})}function F({settings:e,patch:t}){let[n,i]=(0,b.useState)(!1),a=f();return(0,T.jsxs)(`div`,{className:`space-y-6`,children:[(0,T.jsxs)(E,{title:`Experimental gates`,children:[(0,T.jsx)(D,{label:`Remote projects`,detail:`Enables SSH-backed remote project setup in the CLI.`,enabled:e.remoteProjects,onToggle:()=>void t({remoteProjects:!e.remoteProjects})}),(0,T.jsx)(D,{label:`Archived history preview`,detail:`Beta: click an archived task to preview its read-only engine history, even after its worktree is gone.`,enabled:e.archivedHistoryPreview,onToggle:()=>void t({archivedHistoryPreview:!e.archivedHistoryPreview})}),(0,T.jsx)(D,{label:`Auto status flow`,detail:`Moves backlog tasks to in progress on turn start and injects the self-report protocol.`,enabled:e.autoStatus,onToggle:()=>void t({autoStatus:!e.autoStatus})}),(0,T.jsx)(D,{label:`Dispatcher`,detail:`Enables the field-notes dispatcher protocol for repo main sessions.`,enabled:e.dispatcher,onToggle:()=>void t({dispatcher:!e.dispatcher})})]}),(0,T.jsxs)(E,{title:`Browser workspace`,children:[(0,T.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`Reset the per-task tab layout (open tabs, splits, selection). Pure browser state: tasks, worktrees, notes, and engines are untouched.`}),(0,T.jsx)(`button`,{type:`button`,onClick:()=>{if(!n){i(!0);return}r(),a({to:`/`}),i(!1)},onBlur:()=>i(!1),className:`border px-3 py-1.5 text-[11px] transition-colors ${n?`border-kobe-red/50 bg-kobe-red/10 text-kobe-red`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,children:n?`Click again to reset layout`:`Reset layout`})]})]})}function I(){let{supported:e,permission:t,enabled:n}=d();return(0,T.jsx)(`div`,{className:`space-y-6`,children:(0,T.jsxs)(E,{title:`Notifications`,children:[e?(0,T.jsx)(D,{label:`Desktop notifications`,detail:`Get pinged when a task needs input or errors while this browser tab is in the background.`,enabled:n,onToggle:()=>void o(!n),disabled:t===`denied`&&!n}):(0,T.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`This browser does not support desktop notifications.`}),t===`denied`&&!n?(0,T.jsx)(`p`,{className:`text-[11px] leading-relaxed text-kobe-yellow`,children:`Notifications are blocked for this site. Allow them in your browser's site settings to turn this on.`}):null]})})}var L=e({SettingsPage:()=>z}),R=[[`general`,`General`],[`engines`,`Engines`],[`board`,`Board`],[`dev`,`Dev`],[`notifications`,`Notifications`]];function z({onClose:e}){let[t,n]=(0,b.useState)(`general`),{settings:r,loading:i,error:a,reload:o,patch:s}=O(),c=(0,b.useMemo)(()=>R.find(([e])=>e===t)?.[1]??`Settings`,[t]);return(0,T.jsxs)(`section`,{"data-settings-open":!0,className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,T.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,T.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Settings`}),(0,T.jsx)(`button`,{type:`button`,onClick:e,className:`border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Close`})]}),(0,T.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[180px_minmax(0,1fr)] overflow-hidden`,children:[(0,T.jsx)(`nav`,{className:`min-h-0 overflow-auto border-r border-line bg-surface/60 p-2`,children:R.map(([e,r])=>(0,T.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:`mb-1 block w-full border px-2 py-2 text-left text-[12px] transition-colors ${t===e?`border-primary bg-inset text-fg`:`border-transparent text-muted hover:border-line hover:bg-bg hover:text-fg`}`,children:r},e))}),(0,T.jsx)(`main`,{className:`min-h-0 overflow-auto p-4`,children:(0,T.jsxs)(`div`,{className:`mx-auto max-w-4xl`,children:[(0,T.jsx)(`h1`,{className:`mb-3 text-[13px] font-bold uppercase tracking-[0.12em] text-fg`,children:c}),a?(0,T.jsxs)(`div`,{className:`border border-line bg-surface p-4 text-[12px]`,children:[(0,T.jsx)(`p`,{className:`text-subtle`,children:`Couldn't load settings (daemon web transport offline?)`}),(0,T.jsx)(`button`,{type:`button`,onClick:o,className:`mt-3 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Retry`})]}):i||!r?(0,T.jsx)(`div`,{className:`border border-line bg-surface p-4 text-[12px] text-subtle`,children:`Loading settings...`}):t===`general`?(0,T.jsx)(j,{}):t===`engines`?(0,T.jsx)(N,{settings:r,patch:s}):t===`board`?(0,T.jsx)(P,{}):t===`dev`?(0,T.jsx)(F,{settings:r,patch:s}):(0,T.jsx)(I,{})]})})]})]})}export{L as n,z as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
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{a as y}from"./vendor-CdtpTJrf.js";import{t as b}from"./web-transport-D0bugxxv.js";var x=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`}]]),S=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`}]]),C=m(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),w=t(f(),1);function T(e,t=36){return e.length<=t?e:`…${e.slice(e.length-t+1)}`}async function E(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 D(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 O(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 k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function A(e){let t=e.replace(/\*+/g,`*`).split(`*`).map(k).join(`.*`);return RegExp(`^${t}$`)}function j(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(`*`)?A(i).test(a):a.includes(i);return r?!o:o}function M(e,t){let n=t.trim();return n?e.filter(e=>j(e.path,n)):e}var N=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,P=[`diff --git`,`index `,`--- `,`+++ `,`new file`,`deleted file`,`rename `,`similarity `,`copy `,`\\ No newline`,`Binary files`];function F(e){return P.some(t=>e.startsWith(t))}function I(e){let t=0,n=0;for(let r of L(e))r.kind===`add`?t++:r.kind===`del`&&n++;return{added:t,deleted:n}}function L(e){let t=e.replace(/\n$/,``).split(`
|
|
3
|
+
`),n=[],r=0,i=0,a=!1;for(let e of t){let t=N.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&&F(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++):F(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 R=p();function z({added:e,deleted:t}){return e===0&&t===0?null:(0,R.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,R.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e]}),` `,(0,R.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,t]})]})}function B(e){let{worktreeChanges:t}=g(),n=e?t[e]:void 0;return n?`${n.added}:${n.deleted}`:`none`}function V({onRetry:e}){let{daemonConnected:t,streamConnected:n}=g();return b({daemonConnected:t,streamConnected:n})?(0,R.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,R.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 py-4`,children:[(0,R.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load changes.`}),(0,R.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,R.jsx)(v,{size:11,strokeWidth:2}),`Retry`]})]})}function H({patch:e,wrap:t}){let n=(0,w.useMemo)(()=>L(e),[e]);return e.trim()?(0,R.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,R.jsxs)(`div`,{className:`kobe-diff-row ${O(e.kind)}`,children:[(0,R.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.oldLn??``}),(0,R.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.newLn??``}),(0,R.jsx)(`span`,{className:`kobe-diff-text`,children:e.text===``?` `:e.text})]},t))}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`No textual diff for this file.`})}function U({worktreePath:e,onOpenFile:t}){let[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(null),c=B(e),{worktreeChanges:l}=g(),u=e?l[e]:void 0,d=(0,w.useRef)(0),f=(0,w.useCallback)(async()=>{if(!e){r(null),s(null);return}let t=++d.current;a(!0),s(null);try{let n=await E(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,w.useEffect)(()=>{f()},[f,c]);let[p,m]=(0,w.useState)(``);(0,w.useEffect)(()=>{m(``)},[e]);let h=n?.files??[],_=(0,w.useMemo)(()=>M(h,p),[h,p]);return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,R.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:[`Changes`,h.length>0?` · ${h.length}`:``]}),u&&(0,R.jsx)(z,{added:u.added,deleted:u.deleted}),(0,R.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,R.jsx)(V,{onRetry:()=>void f()}):h.length===0?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,R.jsx)(`div`,{className:`text-[12px] text-subtle`,children:i?`Loading changes…`:`Worktree clean.`})}):(0,R.jsxs)(R.Fragment,{children:[h.length>1&&(0,R.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,R.jsx)(`div`,{className:`px-3 py-3 text-center text-[11px] text-subtle`,children:`No files match.`}):(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:_.map(e=>{let n=D(e.status);return(0,R.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,R.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono text-[11px] font-bold ${n.cls}`,children:n.label}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-fg/90`,children:T(e.path,34)}),e.staged&&(0,R.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase text-subtle`,children:`staged`})]},e.path)})})]}):(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,R.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Select a task to watch its worktree changes.`})]})})]})}function W({worktreePath:e,path:t}){let[n,r]=(0,w.useState)(null),[i,a]=(0,w.useState)(!1),[o,s]=(0,w.useState)(!1),[c,l]=(0,w.useState)(null),u=B(e),d=(0,w.useRef)(0),f=(0,w.useCallback)(async()=>{if(!e){r(null),l(null);return}let n=++d.current;s(!0),l(null);try{let i=await E(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,w.useEffect)(()=>{f()},[f,u]);let p=n?I(n.patch):null;return(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,R.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-3`,children:[(0,R.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,title:t,children:t}),p&&(0,R.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,R.jsx)(z,{added:p.added,deleted:p.deleted})}),n&&(0,R.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-subtle ${p&&(p.added||p.deleted)?``:`ml-auto`}`,children:n.status}),n&&(0,R.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,R.jsx)(V,{onRetry:()=>void f()}):n?(0,R.jsx)(H,{patch:n.patch,wrap:i}):o?(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`Loading preview…`}):(0,R.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`No diff for this file.`})]})}var G=e({WorkspaceTabs:()=>Q}),K=(0,w.lazy)(()=>h(()=>import(`./ChatTerminal-DNTeFtk5.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function q(){return(0,R.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`})}function J(e){return y(e)}function Y({taskId:e,tabId:t,vendor:n}){return(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-6`,children:(0,R.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:x,action:()=>c(e,t,`vendor`)},{title:`Chat`,detail:`transcript`,body:`Read the session as structured messages and tool calls.`,icon:S,action:()=>c(e,t,`transcript`)},{title:`Terminal`,detail:`shell / worktree`,body:`Open a command shell in this task worktree.`,icon:C,action:()=>c(e,t,`terminal`)}].map(e=>{let t=e.icon;return(0,R.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,R.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,R.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,R.jsx)(t,{size:17,strokeWidth:1.8})}),(0,R.jsx)(`span`,{className:`truncate text-[10px] uppercase text-subtle`,children:e.detail})]}),(0,R.jsx)(`div`,{className:`mt-5 text-[12px] font-bold uppercase tracking-[0.12em] text-fg`,children:e.title}),(0,R.jsx)(`div`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:e.body})]},e.title)})})})}function X({tab:e,taskId:t,taskWorktreePath:n,taskTitle:r,vendor:i}){return e?.kind===`empty`?(0,R.jsx)(Y,{taskId:t,tabId:e.id,vendor:i}):e?.kind===`vendor`?(0,R.jsx)(w.Suspense,{fallback:(0,R.jsx)(q,{}),children:(0,R.jsx)(K,{tabId:e.id,taskId:e.taskId??t,mode:`engine`},e.id)}):e?.kind===`terminal`?(0,R.jsx)(w.Suspense,{fallback:(0,R.jsx)(q,{}),children:(0,R.jsx)(K,{tabId:e.id,taskId:t,mode:`shell`},e.id)}):e?.kind===`transcript`?(0,R.jsx)(_,{worktreePath:n,vendor:i,title:r},e.id):e?.kind===`file`?(0,R.jsx)(W,{worktreePath:n,path:e.path},e.id):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Opening a tab…`})}function Z({tab:e,side:t,children:n,onCloseSplit:r}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[t===`right`&&(0,R.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,R.jsx)(`span`,{className:`truncate text-[11px] text-muted`,children:e?.title??`Split`}),(0,R.jsx)(`button`,{type:`button`,onClick:r,className:`text-[11px] text-subtle hover:text-fg`,"aria-label":`close split`,title:`Close split`,children:`×`})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 p-2`,children:n})]})}function Q(){let[e,t]=(0,w.useState)(null),[n,c]=(0,w.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,C=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=J(y?.vendor),O=y?.title||y?.branch||`Session`,k=!!y&&((f?v[f]?.phase===`running`:!1)||y.worktreePath===null);return(0,R.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,R.jsx)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:f?(0,R.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,R.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,R.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,R.jsx)(`span`,{className:`text-[9px] font-bold uppercase text-kobe-blue`,children:`Split`}),(0,R.jsx)(`button`,{type:`button`,onClick:()=>C(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,R.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,R.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-[11px] text-subtle`,children:[(0,R.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-subtle`}),`No task selected`]})}),(0,R.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,R.jsxs)(`div`,{className:`flex h-full min-w-0`,children:[(0,R.jsx)(Z,{tab:T,side:`left`,children:(0,R.jsx)(X,{tab:T,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})}),E&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`w-px shrink-0 bg-line`}),(0,R.jsx)(Z,{tab:E,side:`right`,onCloseSplit:()=>{f&&s(f)},children:(0,R.jsx)(X,{tab:E,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})})]})]}):(0,R.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center`,children:(0,R.jsxs)(`div`,{className:`max-w-md`,children:[(0,R.jsx)(`div`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[rove web]`}),(0,R.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,R.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,R.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,R.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{T as i,G as n,U as r,Q as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Board as e}from"./Board-By7g_Fl3.js";var t=e;export{t as component};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AppShell-
|
|
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-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AppShell-A79AgA-r.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-CUfXWk-O.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-DX3tv5Yc.js","assets/plus-BbX5qXba.js","assets/activity-BjTd1D8q.js","assets/ConfirmDialog-DChCLBRW.js","assets/text-match-DW3sD-Rt.js","assets/SlideOver-Dxtk6Gn2.js","assets/chips-Da37C4KZ.js","assets/AppShell-HiyATJse.css","assets/Board-By7g_Fl3.js","assets/external-link-BwT2u1hD.js","assets/lazy-issue-panels-BcU72R8r.js","assets/issues-BMqItbVN.js","assets/IssuesPage-H7bWnbU-.js","assets/arrow-left-DNM2CHhS.js","assets/ChatTerminal-DNTeFtk5.js","assets/ChatTerminal-BrP-ENHg.css","assets/BoardPeek-CdAMtCEs.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-A79AgA-r.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-By7g_Fl3.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-H7bWnbU-.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-CUfXWk-O.js`).then(e=>e.n),__vite__mapDeps([18,1,2,3,9,19,20,21,10,11,22,17,23])),e(()=>import(`./ChatTerminal-DNTeFtk5.js`),__vite__mapDeps([38,1,2,3,9,20,11,39])),e(()=>import(`./BoardPeek-CdAMtCEs.js`),__vite__mapDeps([40,1,2,3,9,19,20,21,10,11,22,33,26,14,17])),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-DX3tv5Yc.js`).then(e=>e.n),__vite__mapDeps([24,1,2,3,4,5,16,17]))])}export{a as i,n,r,i as t};
|