@sma1lboy/kobe 0.8.0 → 0.8.2
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 +393 -359
- package/dist/web-ui/assets/{AppShell-BTOznqKS.js → AppShell-BuFVTjzQ.js} +1 -1
- package/dist/web-ui/assets/Board-D9IlaHCd.js +1 -0
- package/dist/web-ui/assets/{BoardPeek-CPY4k_RN.js → BoardPeek-C2xEBWVE.js} +2 -2
- package/dist/web-ui/assets/ChatTerminal-BrP-ENHg.css +1 -0
- package/dist/web-ui/assets/ChatTerminal-X69JLI3Q.js +144 -0
- package/dist/web-ui/assets/{ChatTranscript-B_xGXApc.js → ChatTranscript-C8YP8v0k.js} +1 -1
- package/dist/web-ui/assets/{ConfirmDialog-5OpgDkmx.js → ConfirmDialog-Bw_DhSYa.js} +1 -1
- package/dist/web-ui/assets/{IssueIntakePanel-CF7HL2s9.js → IssueIntakePanel-D48joYeF.js} +1 -1
- package/dist/web-ui/assets/IssuePeek-CnuN0m7v.js +1 -0
- package/dist/web-ui/assets/IssuesPage-D2n-CM8o.js +1 -0
- package/dist/web-ui/assets/{RichEditor-DmGT9P7h.js → RichEditor-DYofF0Co.js} +1 -1
- package/dist/web-ui/assets/{SettingsPage-BtJX2Wbd.js → SettingsPage-CEWJd0gX.js} +1 -1
- package/dist/web-ui/assets/{SlideOver-BN-NhV9P.js → SlideOver-CWvQg6gX.js} +1 -1
- package/dist/web-ui/assets/{ViewToggle-CIZAN_0S.js → ViewToggle-DUvz-P9N.js} +1 -1
- package/dist/web-ui/assets/{WorkspaceTabs-BjQlK6xw.js → WorkspaceTabs-AmpKkNKh.js} +3 -3
- package/dist/web-ui/assets/arrow-left-CTu620DY.js +1 -0
- package/dist/web-ui/assets/board-gsUJ3unG.js +1 -0
- package/dist/web-ui/assets/{chips-L2qle6td.js → chips-ER3SiHRg.js} +1 -1
- package/dist/web-ui/assets/{createLucideIcon-Dn8f0BBU.js → createLucideIcon-B3ImGkvG.js} +1 -1
- package/dist/web-ui/assets/{external-link-CGQEaSmM.js → external-link-D0CjtZaF.js} +1 -1
- package/dist/web-ui/assets/{external-store-DUMhHvtl.js → external-store-BMGmoHuF.js} +1 -1
- package/dist/web-ui/assets/harness-B3lC6M9X.js +1 -0
- package/dist/web-ui/assets/{index-DmtC0Wbe.css → index-DVMmUb6_.css} +1 -1
- package/dist/web-ui/assets/{index-CX2Ouner.js → index-L7l828Hv.js} +3 -3
- package/dist/web-ui/assets/issues-BBYWc1q0.js +4 -0
- package/dist/web-ui/assets/issues-BmvAw4q3.js +1 -0
- package/dist/web-ui/assets/lazy-issue-panels-Dg86YAgC.js +6 -0
- package/dist/web-ui/assets/{rotate-cw-zLlRat-M.js → rotate-cw-BxAflhQC.js} +1 -1
- package/dist/web-ui/assets/routes-Ch_aVEQc.js +1 -0
- package/dist/web-ui/assets/{store-CbgoTSs1.js → store-BvkKuplZ.js} +2 -2
- package/dist/web-ui/assets/{tabs-B_hac99E.js → tabs-C6drmk5t.js} +1 -1
- package/dist/web-ui/assets/task._taskId-BWkc9jhF.js +1 -0
- package/dist/web-ui/assets/{toast-D798wIYZ.js → toast-CvhQ8RqX.js} +1 -1
- package/dist/web-ui/assets/{worktrees-CZYooVsg.js → worktrees-DhzuyoNd.js} +1 -1
- package/dist/web-ui/index.html +7 -7
- package/package.json +3 -1
- package/dist/web-ui/assets/Board-Bvkyjgq6.js +0 -1
- package/dist/web-ui/assets/ChatTerminal-kHJ-D0s7.css +0 -1
- package/dist/web-ui/assets/ChatTerminal-yge5k7Tv.js +0 -8
- package/dist/web-ui/assets/IssuePeek-BHWJhJku.js +0 -1
- package/dist/web-ui/assets/IssuesPage-kkOaSh0x.js +0 -1
- package/dist/web-ui/assets/arrow-left-BXrVItPe.js +0 -1
- package/dist/web-ui/assets/board-D5jDr-4b.js +0 -1
- package/dist/web-ui/assets/harness-BRyFen92.js +0 -1
- package/dist/web-ui/assets/issues-BBbxPwjI.js +0 -3
- package/dist/web-ui/assets/issues-GeSdN8vm.js +0 -1
- package/dist/web-ui/assets/lazy-issue-panels-CE0UA8nx.js +0 -6
- package/dist/web-ui/assets/routes-DUr6PI5d.js +0 -1
- package/dist/web-ui/assets/task._taskId-D0S-W4kD.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{l as e,o as t}from"./terminal-B6OlmT6e.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-B_hac99E.js";import{a as s,n as c,r as l}from"./toast-D798wIYZ.js";import{d as u,t as d}from"./createLucideIcon-Dn8f0BBU.js";import{n as f,t as p}from"./ViewToggle-CIZAN_0S.js";import{n as m,t as h}from"./store-CbgoTSs1.js";import{t as g}from"./external-store-DUMhHvtl.js";import{i as _,r as v,t as y}from"./WorkspaceTabs-BjQlK6xw.js";import{t as b}from"./SettingsPage-BtJX2Wbd.js";import{t as x}from"./ChatTranscript-B_xGXApc.js";import{C as S,D as C,E as w,S as T,T as E,_ as D,f as O,g as k,h as A,m as j,n as ee,o as te,p as M,r as N,s as ne,u as re,v as ie,w as P,x as F,y as ae}from"./index-CX2Ouner.js";import{r as I}from"./web-transport-BS7imUMS.js";import{n as L,t as R}from"./time-kviT26Tm.js";import{n as z,t as B}from"./ConfirmDialog-5OpgDkmx.js";import{t as V}from"./text-match-C3BRtNXy.js";import{t as H}from"./SlideOver-BN-NhV9P.js";import{n as U,r as oe,t as se}from"./chips-L2qle6td.js";var ce=d(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),le=d(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),W=d(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ue=d(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),G=e(o(),1),K=u();function de({onClose:e}){let{tasks:t}=m(),n=s(),i=(0,G.useRef)(null);M(i);let a=(0,G.useMemo)(()=>{let e=new Set,n=[];for(let r of t)r.repo&&!e.has(r.repo)&&(e.add(r.repo),n.push(r.repo));return n.sort()},[t]),o=(0,G.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[u,d]=(0,G.useState)(a[0]??``),[f,p]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),[b,x]=(0,G.useState)(!1),S=async e=>{if(e){_(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){l(`scan worktrees`,e),p([])}finally{_(!1)}}},w=async t=>{y(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:u,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),C(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),c(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){l(`adopt worktree`,e)}finally{y(null)}};return b?(0,K.jsx)(N,{onClose:e}):a.length===0?(0,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,K.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to kobe yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>x(!0),className:`mt-4 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10`,children:`Create a task`})]}),(0,K.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,K.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,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,K.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`select`,{value:u,onChange:e=>d(e.target.value),className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`,children:a.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void S(u),disabled:!u||g,className:`shrink-0 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:opacity-40`,children:g?`Scanning…`:`Scan`})]})]}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`})]}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,K.jsx)(`span`,{className:`ml-auto shrink-0`,children:L(e.lastActivityMs)})]})]}),t?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>void w(e),disabled:v!==null,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:opacity-40`,children:v===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,K.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,K.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 q=g({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),fe=null;function J(e){q.update(t=>({...t,...e}))}function Y(e){J({query:e})}function pe(e){J({statusFilter:e})}function me(e){J({sortMode:e})}function he(e){J({showArchived:e})}function ge(e){!e||e===fe||(fe=e,J({sortMode:e}))}function _e(){return q.useSnapshot()}function ve(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ye(e,t){let n=ve(t)-ve(e);return n===0?t.id.localeCompare(e.id):n}function be(e,t){let n=e.filter(e=>e.kind===`main`),r=e.filter(e=>e.kind!==`main`&&e.pinned),i=e.filter(e=>e.kind!==`main`&&!e.pinned);return t===`recent`&&(r.sort(ye),i.sort(ye)),[...n,...r,...i]}function xe(e,t){return V([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}function Se({task:e,onClose:t}){return(0,K.jsx)(H,{open:e!==null,onClose:t,title:e?(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.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,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,K.jsx)(x,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}function Ce({children:e,suffix:t}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function we({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:A(t?.state),l=R(e.updatedAt||e.createdAt);return(0,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,K.jsx)(W,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,K.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${j(t?.state)}`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,K.jsx)(oe,{pr:e.prStatus}),e.pinned&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,K.jsx)(se,{counts:r})]}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(U,{label:i}),c&&(0,K.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,K.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Te({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,K.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,K.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,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-muted opacity-0 transition-opacity hover:border-primary hover:text-fg group-hover:opacity-100`,children:`Restore`})]})}function Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:c,worktreeChanges:u,uiPrefs:d,hydrated:f,streamConnected:p}=m(),{selectedTaskId:g}=n(),_=O(),v=(0,G.useMemo)(()=>te(a),[a]),y=e=>ne(_,e,v),{query:b,statusFilter:x,sortMode:S,showArchived:w}=_e(),T=(0,G.useRef)(null),E=(0,G.useRef)(null);(0,G.useEffect)(()=>{g&&T.current?.querySelector(`[data-task-id="${CSS.escape(g)}"]`)?.scrollIntoView({block:`nearest`})},[g]);let A=d?.sortMode;(0,G.useEffect)(()=>{ge(A)},[A]);let j=(0,G.useMemo)(()=>a.filter(e=>!e.archived),[a]),M=(0,G.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),N=(0,G.useMemo)(()=>be(j.filter(e=>xe(e,b)&&ee(o[e.id],u[e.worktreePath],x)),S),[j,b,x,S,o,u]),P=N.filter(e=>e.kind===`main`),F=N.filter(e=>e.kind!==`main`),I=!f||!p&&a.length===0,L=s(),R=e=>{r(e),C(e),L({to:`/task/$taskId`,params:{taskId:e}})};(0,G.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.key,n=t===`ArrowDown`||t===`ArrowUp`,r=t===`j`||t===`ArrowDown`,i=t===`k`||t===`ArrowUp`,a=t===`/`;if(!r&&!i&&!a)return;let o=e.target;if(o&&(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.tagName===`SELECT`||o.isContentEditable)||document.querySelector(`[role=dialog],[role=alertdialog]`)||document.querySelector(`[data-settings-open]`))return;if(a){e.preventDefault(),E.current?.focus();return}if(n&&o&&o!==document.body&&!T.current?.contains(o)||N.length===0)return;e.preventDefault();let s=N.findIndex(e=>e.id===g),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),N.length-1);R(N[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N,g]);let z=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>l(`restore "${e.title||e.branch}"`,t))},[B,V]=(0,G.useState)(!1),[H,U]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let e=!0;return re().then(t=>{e&&V(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,K.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>me(S==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${S===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[N.length,`/`,j.length]}),(0,K.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,K.jsx)(le,{size:14,strokeWidth:1.9})}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,K.jsx)(ae,{size:14,strokeWidth:2.2})})]})]}),(0,K.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,K.jsx)(ie,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,K.jsx)(`input`,{ref:E,value:b,onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N.length>0?(e.preventDefault(),R(N[0].id),e.currentTarget.blur()):e.key===`Escape`&&b&&(e.preventDefault(),Y(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),b&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>Y(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,K.jsx)(k,{size:13,strokeWidth:2})})]}),(0,K.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,K.jsx)(`button`,{type:`button`,onClick:()=>pe(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${x===e.key?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:e.label},e.key))})]}),(0,K.jsxs)(`div`,{ref:T,className:`flex-1 overflow-y-auto`,children:[I?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,K.jsx)(W,{size:13,strokeWidth:2,className:`animate-spin`}),(0,K.jsx)(`span`,{children:`connecting…`})]}):j.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,K.jsx)(`p`,{children:`No tasks yet.`}),(0,K.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`})]}):N.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,K.jsx)(`div`,{children:b?`No matches for “${b}”.`:`No tasks in this status.`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{Y(``),pe(`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,K.jsxs)(K.Fragment,{children:[P.length>0&&(0,K.jsx)(Ce,{children:`Projects`}),P.map(e=>(0,K.jsx)(we,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>R(e.id)},e.id)),F.length>0&&(0,K.jsx)(Ce,{suffix:S==="default"?void 0:S,children:`Worktrees`}),F.map(e=>(0,K.jsx)(we,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>R(e.id)},e.id))]}),!I&&M.length>0&&(0,K.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>he(!w),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:M.length}),(0,K.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:w?`−`:`+`})]}),w&&M.map(e=>(0,K.jsx)(Te,{task:e,onRestore:()=>z(e),onPreview:B?()=>U(e):void 0},e.id))]})]}),(0,K.jsx)(Se,{task:H,onClose:()=>U(null)}),(0,K.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,K.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,K.jsx)(D,{size:15,strokeWidth:1.8}),(0,K.jsx)(`span`,{children:`Settings`})]})})]})}async function De(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function X(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}function je(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=ke(n.replace(/&/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ae(n.replace(/&/g,`&`));return r?`<a href="${X(r)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${t}</a>`:`${t}(${n})`})),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Z(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:je(e)).join(``)}function Me(e){let t=e.replace(/\r\n/g,`
|
|
1
|
+
import{l as e,o as t}from"./terminal-B6OlmT6e.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-C6drmk5t.js";import{a as s,n as c,r as l}from"./toast-CvhQ8RqX.js";import{d as u,t as d}from"./createLucideIcon-B3ImGkvG.js";import{n as f,t as p}from"./ViewToggle-DUvz-P9N.js";import{n as m,t as h}from"./store-BvkKuplZ.js";import{t as g}from"./external-store-BMGmoHuF.js";import{i as _,r as v,t as y}from"./WorkspaceTabs-AmpKkNKh.js";import{t as b}from"./SettingsPage-CEWJd0gX.js";import{t as x}from"./ChatTranscript-C8YP8v0k.js";import{C as S,D as C,E as w,S as T,T as E,_ as D,f as O,g as k,h as A,m as j,n as ee,o as te,p as M,r as N,s as ne,u as re,v as ie,w as P,x as F,y as ae}from"./index-L7l828Hv.js";import{r as I}from"./web-transport-BS7imUMS.js";import{n as L,t as R}from"./time-kviT26Tm.js";import{n as z,t as B}from"./ConfirmDialog-Bw_DhSYa.js";import{t as V}from"./text-match-C3BRtNXy.js";import{t as H}from"./SlideOver-CWvQg6gX.js";import{n as U,r as oe,t as se}from"./chips-ER3SiHRg.js";var ce=d(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),le=d(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),W=d(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ue=d(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),G=e(o(),1),K=u();function de({onClose:e}){let{tasks:t}=m(),n=s(),i=(0,G.useRef)(null);M(i);let a=(0,G.useMemo)(()=>{let e=new Set,n=[];for(let r of t)r.repo&&!e.has(r.repo)&&(e.add(r.repo),n.push(r.repo));return n.sort()},[t]),o=(0,G.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[u,d]=(0,G.useState)(a[0]??``),[f,p]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),[b,x]=(0,G.useState)(!1),S=async e=>{if(e){_(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){l(`scan worktrees`,e),p([])}finally{_(!1)}}},w=async t=>{y(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:u,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),C(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),c(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){l(`adopt worktree`,e)}finally{y(null)}};return b?(0,K.jsx)(N,{onClose:e}):a.length===0?(0,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,K.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,K.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to kobe yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>x(!0),className:`mt-4 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10`,children:`Create a task`})]}),(0,K.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,K.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,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,K.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,K.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(`select`,{value:u,onChange:e=>d(e.target.value),className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`,children:a.map(e=>(0,K.jsx)(`option`,{value:e,children:e},e))}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>void S(u),disabled:!u||g,className:`shrink-0 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:opacity-40`,children:g?`Scanning…`:`Scan`})]})]}),(0,K.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,K.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,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,K.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`})]}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,K.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,K.jsx)(`span`,{className:`ml-auto shrink-0`,children:L(e.lastActivityMs)})]})]}),t?(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,K.jsx)(`button`,{type:`button`,onClick:()=>void w(e),disabled:v!==null,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:opacity-40`,children:v===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,K.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,K.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 q=g({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),fe=null;function J(e){q.update(t=>({...t,...e}))}function Y(e){J({query:e})}function pe(e){J({statusFilter:e})}function me(e){J({sortMode:e})}function he(e){J({showArchived:e})}function ge(e){!e||e===fe||(fe=e,J({sortMode:e}))}function _e(){return q.useSnapshot()}function ve(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ye(e,t){let n=ve(t)-ve(e);return n===0?t.id.localeCompare(e.id):n}function be(e,t){let n=e.filter(e=>e.kind===`main`),r=e.filter(e=>e.kind!==`main`&&e.pinned),i=e.filter(e=>e.kind!==`main`&&!e.pinned);return t===`recent`&&(r.sort(ye),i.sort(ye)),[...n,...r,...i]}function xe(e,t){return V([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}function Se({task:e,onClose:t}){return(0,K.jsx)(H,{open:e!==null,onClose:t,title:e?(0,K.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,K.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,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,K.jsx)(x,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}function Ce({children:e,suffix:t}){return(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function we({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:A(t?.state),l=R(e.updatedAt||e.createdAt);return(0,K.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,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,K.jsx)(W,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,K.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${j(t?.state)}`}),(0,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,K.jsx)(oe,{pr:e.prStatus}),e.pinned&&(0,K.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,K.jsx)(se,{counts:r})]}),(0,K.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,K.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,K.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,K.jsx)(U,{label:i}),c&&(0,K.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,K.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Te({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,K.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,K.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,K.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-muted opacity-0 transition-opacity hover:border-primary hover:text-fg group-hover:opacity-100`,children:`Restore`})]})}function Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:c,worktreeChanges:u,uiPrefs:d,hydrated:f,streamConnected:p}=m(),{selectedTaskId:g}=n(),_=O(),v=(0,G.useMemo)(()=>te(a),[a]),y=e=>ne(_,e,v),{query:b,statusFilter:x,sortMode:S,showArchived:w}=_e(),T=(0,G.useRef)(null),E=(0,G.useRef)(null);(0,G.useEffect)(()=>{g&&T.current?.querySelector(`[data-task-id="${CSS.escape(g)}"]`)?.scrollIntoView({block:`nearest`})},[g]);let A=d?.sortMode;(0,G.useEffect)(()=>{ge(A)},[A]);let j=(0,G.useMemo)(()=>a.filter(e=>!e.archived),[a]),M=(0,G.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),N=(0,G.useMemo)(()=>be(j.filter(e=>xe(e,b)&&ee(o[e.id],u[e.worktreePath],x)),S),[j,b,x,S,o,u]),P=N.filter(e=>e.kind===`main`),F=N.filter(e=>e.kind!==`main`),I=!f||!p&&a.length===0,L=s(),R=e=>{r(e),C(e),L({to:`/task/$taskId`,params:{taskId:e}})};(0,G.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.key,n=t===`ArrowDown`||t===`ArrowUp`,r=t===`j`||t===`ArrowDown`,i=t===`k`||t===`ArrowUp`,a=t===`/`;if(!r&&!i&&!a)return;let o=e.target;if(o&&(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.tagName===`SELECT`||o.isContentEditable)||document.querySelector(`[role=dialog],[role=alertdialog]`)||document.querySelector(`[data-settings-open]`))return;if(a){e.preventDefault(),E.current?.focus();return}if(n&&o&&o!==document.body&&!T.current?.contains(o)||N.length===0)return;e.preventDefault();let s=N.findIndex(e=>e.id===g),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),N.length-1);R(N[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[N,g]);let z=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>l(`restore "${e.title||e.branch}"`,t))},[B,V]=(0,G.useState)(!1),[H,U]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let e=!0;return re().then(t=>{e&&V(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,K.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,K.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>me(S==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${S===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[N.length,`/`,j.length]}),(0,K.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,K.jsx)(le,{size:14,strokeWidth:1.9})}),(0,K.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,K.jsx)(ae,{size:14,strokeWidth:2.2})})]})]}),(0,K.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,K.jsx)(ie,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,K.jsx)(`input`,{ref:E,value:b,onChange:e=>Y(e.target.value),onKeyDown:e=>{e.key===`Enter`&&N.length>0?(e.preventDefault(),R(N[0].id),e.currentTarget.blur()):e.key===`Escape`&&b&&(e.preventDefault(),Y(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),b&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>Y(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,K.jsx)(k,{size:13,strokeWidth:2})})]}),(0,K.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,K.jsx)(`button`,{type:`button`,onClick:()=>pe(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${x===e.key?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:e.label},e.key))})]}),(0,K.jsxs)(`div`,{ref:T,className:`flex-1 overflow-y-auto`,children:[I?(0,K.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,K.jsx)(W,{size:13,strokeWidth:2,className:`animate-spin`}),(0,K.jsx)(`span`,{children:`connecting…`})]}):j.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,K.jsx)(`p`,{children:`No tasks yet.`}),(0,K.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`})]}):N.length===0?(0,K.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,K.jsx)(`div`,{children:b?`No matches for “${b}”.`:`No tasks in this status.`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>{Y(``),pe(`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,K.jsxs)(K.Fragment,{children:[P.length>0&&(0,K.jsx)(Ce,{children:`Projects`}),P.map(e=>(0,K.jsx)(we,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>R(e.id)},e.id)),F.length>0&&(0,K.jsx)(Ce,{suffix:S==="default"?void 0:S,children:`Worktrees`}),F.map(e=>(0,K.jsx)(we,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>R(e.id)},e.id))]}),!I&&M.length>0&&(0,K.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,K.jsxs)(`button`,{type:`button`,onClick:()=>he(!w),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,K.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:M.length}),(0,K.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:w?`−`:`+`})]}),w&&M.map(e=>(0,K.jsx)(Te,{task:e,onRestore:()=>z(e),onPreview:B?()=>U(e):void 0},e.id))]})]}),(0,K.jsx)(Se,{task:H,onClose:()=>U(null)}),(0,K.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,K.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,K.jsx)(D,{size:15,strokeWidth:1.8}),(0,K.jsx)(`span`,{children:`Settings`})]})})]})}async function De(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function X(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}function je(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=ke(n.replace(/&/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ae(n.replace(/&/g,`&`));return r?`<a href="${X(r)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${t}</a>`:`${t}(${n})`})),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Z(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:je(e)).join(``)}function Me(e){let t=e.replace(/\r\n/g,`
|
|
2
2
|
`).split(`
|
|
3
3
|
`),n=[],r=0,i=null,a=()=>{i&&=(n.push(`</${i}>`),null)};for(;r<t.length;){let e=t[r];if(/^```/.test(e)){a();let e=[];for(r++;r<t.length&&!/^```/.test(t[r]);)e.push(X(t[r])),r++;r++,n.push(`<pre class="kobe-md-pre"><code>${e.join(`
|
|
4
4
|
`)}</code></pre>`);continue}if(/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){a(),n.push(`<hr class="kobe-md-hr" />`),r++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){a();let e=o[1].length;n.push(`<h${e} class="kobe-md-h">${Z(X(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${Z(X(e.replace(/^>\s?/,``)))}</blockquote>`),r++;continue}let s=/^\s*[-*]\s+(.*)$/.exec(e);if(s){i!==`ul`&&(a(),n.push(`<ul class="kobe-md-ul">`),i=`ul`),n.push(`<li>${Z(X(s[1]))}</li>`),r++;continue}let c=/^\s*\d+\.\s+(.*)$/.exec(e);if(c){i!==`ol`&&(a(),n.push(`<ol class="kobe-md-ol">`),i=`ol`),n.push(`<li>${Z(X(c[1]))}</li>`),r++;continue}if(e.trim()===``){a(),r++;continue}a();let l=[e];for(r++;r<t.length&&t[r].trim()!==``&&!/^(#{1,6}\s|>\s?|```|\s*[-*]\s|\s*\d+\.\s|\s*(-{3,}|\*{3,}|_{3,})\s*$)/.test(t[r]);)l.push(t[r]),r++;n.push(`<p class="kobe-md-p">${Z(X(l.join(` `)))}</p>`)}return a(),n.join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as e}from"./terminal-B6OlmT6e.js";import{f as t,y as n}from"./tabs-C6drmk5t.js";import{a as r,n as i,r as a}from"./toast-CvhQ8RqX.js";import{d as o}from"./createLucideIcon-B3ImGkvG.js";import{n as s,t as c}from"./ViewToggle-DUvz-P9N.js";import{n as l}from"./store-BvkKuplZ.js";import{t as u}from"./external-store-BMGmoHuF.js";import{t as d}from"./external-link-D0CjtZaF.js";import{a as f,i as p,n as m,r as h,t as g}from"./lazy-issue-panels-Dg86YAgC.js";import{D as _,g as v,v as ee,y}from"./index-L7l828Hv.js";import{n as b,t as x}from"./ConfirmDialog-Bw_DhSYa.js";import{_ as S,a as C,d as w,g as T,h as E,m as D,p as te,s as ne,u as re}from"./issues-BBYWc1q0.js";var O=e(n(),1),k={query:``,repo:null};function A(e){j.update(t=>({...t,...e}))}var j=u(k);function M(){return j.useSnapshot()}function N(e){e!==j.getSnapshot().query&&A({query:e})}function P(e){e!==j.getSnapshot().repo&&A({repo:e})}function F(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,o]=(0,O.useState)(!1),[s,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(new Map);return(0,O.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)=>{o(!0);try{return await E(e,t,n),r([e]),!0}catch(e){return a(`update issue`,e),!1}finally{o(!1)}},deleteIssueConfirmed:async(e,t)=>{o(!0);try{return await C(e,t.id),r([e]),!0}catch(e){return a(`delete issue`,e),!1}finally{o(!1)}},quickStart:async(e,t,n,r,i)=>{if(s===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await D(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){a(`quick start issue`,e);return}finally{c(null)}}}}}var I=o();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)(y,{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)(p,{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)(d,{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 R({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 z(){let{tasks:e,hydrated:n,daemonConnected:o}=l(),{query:u,repo:d}=M(),p=r(),S=(0,O.useRef)(null),[C,E]=(0,O.useState)(null),[D,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(null),[L,z]=(0,O.useState)([]);(0,O.useEffect)(()=>{let e=!1;return ne().then(t=>{e||z(t)}).catch(e=>a(`load projects`,e)),()=>{e=!0}},[]);let B=(0,O.useMemo)(()=>re(e,L),[e,L]),V=(0,O.useMemo)(()=>B.map(e=>e.repo),[B]),H=(0,O.useMemo)(()=>te(B,d),[B,d]),{data:U,pending:W,refresh:G}=f(V),{issueBusy:K,quickStartingId:q,pendingLinks:J,saveIssue:ie,deleteIssueConfirmed:ae,quickStart:oe}=F({issueRepos:V,issueData:U,refreshIssues:G}),{allIssues:Y,repoChips:se,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,O.useMemo)(()=>T({issueData:U,issueRepos:V,pendingLinks:J,query:u,repoFilter:H}),[U,V,J,u,H]);(0,O.useEffect)(()=>{C&&(Y.some(e=>e.repo===C.repo&&e.issue.id===C.id)||E(null))},[Y,C]),(0,O.useEffect)(()=>{let e=e=>{if(C||D||A||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&&u&&(e.preventDefault(),N(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[u,C,D,A]),(0,O.useEffect)(()=>{d!==H&&P(H)},[H,d]);let ce=!!u,$=e=>{t(e),_(e),p({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)(b,{}),(0,I.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(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)(ee,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:S,value:u,onChange:e=>N(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),u&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,I.jsx)(v,{size:13,strokeWidth:2})})]}),B.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:H??``,onChange:e=>P(e.target.value),title:H??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:B.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||W&&!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:()=>{N(``)},className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Clear filters`})]}):Z===0&&!o?(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,I.jsx)(R,{board:X[0],onNewIssue:k,onPeekIssue:e=>E({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>j({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:()=>p({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=H??X[0]?.repo??V[0];return e?(0,I.jsx)(`button`,{type:`button`,onClick:()=>k(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)(y,{size:22,strokeWidth:2.2})}):null})(),D&&(0,I.jsx)(g,{children:(0,I.jsx)(m,{repoRoot:D,open:!0,onClose:()=>k(null),onCreated:(e,t)=>{D&&G([D]),i(`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)(g,{children:(0,I.jsx)(h,{issue:e.issue,repoRoot:e.repo,busy:K,starting:q===e.issue.id,onClose:()=>E(null),onSave:t=>ie(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?(E(null),$(a)):E(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;E(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&w(t,e.issue).then(()=>i(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>a(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),A&&(0,I.jsx)(x,{title:`Delete issue`,body:`Delete issue #${A.issue.id}: "${A.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:K,onConfirm:()=>void ae(A.repo,A.issue).then(e=>{e&&(j(null),C?.repo===A.repo&&C.id===A.issue.id&&E(null))}),onCancel:()=>j(null)})]})}export{z as Board};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-
|
|
2
|
-
import{l as e}from"./terminal-B6OlmT6e.js";import{c as t,y as n}from"./tabs-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-X69JLI3Q.js","assets/terminal-B6OlmT6e.js","assets/tabs-C6drmk5t.js","assets/createLucideIcon-B3ImGkvG.js","assets/store-BvkKuplZ.js","assets/rotate-cw-BxAflhQC.js","assets/web-transport-BS7imUMS.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{l as e}from"./terminal-B6OlmT6e.js";import{c as t,y as n}from"./tabs-C6drmk5t.js";import{d as r,t as i}from"./createLucideIcon-B3ImGkvG.js";import{i as a}from"./store-BvkKuplZ.js";import{t as o}from"./ChatTranscript-C8YP8v0k.js";import{t as s}from"./external-link-D0CjtZaF.js";import{g as c,h as l,m as u,p as d}from"./index-L7l828Hv.js";var f=i(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),p=i(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),m=e(n(),1),h=r(),g=(0,m.lazy)(()=>a(()=>import(`./ChatTerminal-X69JLI3Q.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function _({task:e,engine:n,onClose:r,onOpenWorkspace:i,onReview:a,onCreatePr:_}){let[v,y]=(0,m.useState)(`engine`),[b]=(0,m.useState)(()=>t(e.id)),x=(0,m.useRef)(null);d(x,!0),(0,m.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=e.target;t?.closest(`.xterm`)||t&&(t.tagName===`TEXTAREA`||t.tagName===`INPUT`)||(e.preventDefault(),r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let S=l(n?.state),C=e=>`border-b-2 px-2 py-1.5 text-[11px] transition-colors ${e?`border-primary text-fg`:`border-transparent text-muted hover:text-fg`}`;return(0,h.jsxs)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:[(0,h.jsx)(`button`,{type:`button`,"aria-label":`Close peek`,onClick:r,className:`absolute inset-0 cursor-default bg-black/40`}),(0,h.jsxs)(`div`,{ref:x,role:`dialog`,"aria-modal":`true`,"aria-label":`Session peek: ${e.title||e.branch||e.id}`,className:`relative flex h-full w-[640px] max-w-[92vw] flex-col border-l border-line bg-bg shadow-2xl`,children:[(0,h.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface px-3`,children:[(0,h.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${u(n?.state)}`}),(0,h.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-fg`,children:e.title||e.branch||e.id}),(0,h.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-[11px] text-subtle sm:inline`,children:e.branch}),S&&(0,h.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:S}),(0,h.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[a&&(0,h.jsxs)(`button`,{type:`button`,onClick:a,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Review → done if it passes`,children:[(0,h.jsx)(f,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`Review`})]}),_&&(0,h.jsxs)(`button`,{type:`button`,onClick:_,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open a PR for this branch`,children:[(0,h.jsx)(p,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`PR`})]}),(0,h.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open in workspace`,children:[(0,h.jsx)(s,{size:13,strokeWidth:1.8}),(0,h.jsx)(`span`,{className:`text-[11px]`,children:`Workspace`})]}),(0,h.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center text-muted transition-colors hover:text-fg`,"aria-label":`Close peek`,title:`Close (Esc)`,children:(0,h.jsx)(c,{size:15,strokeWidth:1.8})})]})]}),(0,h.jsxs)(`nav`,{className:`flex shrink-0 items-center gap-1 border-b border-line bg-surface px-2`,children:[(0,h.jsx)(`button`,{type:`button`,onClick:()=>y(`engine`),className:C(v===`engine`),children:`Engine`}),(0,h.jsx)(`button`,{type:`button`,onClick:()=>y(`transcript`),className:C(v===`transcript`),children:`Transcript`})]}),(0,h.jsx)(`div`,{className:`min-h-0 flex-1`,children:v===`engine`?(0,h.jsx)(m.Suspense,{fallback:(0,h.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`}),children:(0,h.jsx)(g,{tabId:b,taskId:e.id,mode:`engine`},b)}):(0,h.jsx)(o,{worktreePath:e.worktreePath,vendor:e.vendor??`claude`,title:e.title||e.branch})})]})]})}export{_ as BoardPeek};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}
|