@sma1lboy/kobe 0.9.34 → 0.9.36
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 +317 -317
- package/dist/cli/kobe-run.js +317 -317
- package/dist/cli/pty-host-node.mjs +7 -1
- package/dist/cli/rove-run.js +317 -317
- package/dist/web-ui/assets/AppShell-B7CivyDd.js +5 -0
- package/dist/web-ui/assets/{Board-C2ZC0E_s.js → Board-q_9MtcHd.js} +1 -1
- package/dist/web-ui/assets/{BoardPeek-C2y3xudZ.js → BoardPeek-S_PO5O5U.js} +1 -1
- package/dist/web-ui/assets/{ChatTranscript-BaXVLIwa.js → ChatTranscript-Ccrk8G8U.js} +1 -1
- package/dist/web-ui/assets/{ConfirmDialog-BJlYZhgy.js → ConfirmDialog-SJlZUycl.js} +1 -1
- package/dist/web-ui/assets/IssueIntakePanel-sziV01K6.js +1 -0
- package/dist/web-ui/assets/IssuePeek-BqxYnKJo.js +1 -0
- package/dist/web-ui/assets/{IssuesPage-CcK7xKWZ.js → IssuesPage-C3Cp8Wsa.js} +1 -1
- package/dist/web-ui/assets/{SettingsPage-BARY9KCh.js → SettingsPage-tLF6TOZT.js} +2 -2
- package/dist/web-ui/assets/{RichEditor-D2OJbR2A.js → SlideOver-BPuRlYRc.js} +52 -52
- package/dist/web-ui/assets/{ViewToggle-CROAjX49.js → ViewToggle-DFsgA1oB.js} +1 -1
- package/dist/web-ui/assets/{WorkspaceTabs-D2mBvhlt.js → WorkspaceTabs-DnCwqBDD.js} +1 -1
- package/dist/web-ui/assets/{active-task-DOIy-xHd.js → active-task-Dcgkjlku.js} +1 -1
- package/dist/web-ui/assets/board-D_4CPQWU.js +1 -0
- package/dist/web-ui/assets/{index-wTeVn7Ca.js → index-DVzmgaP7.js} +3 -3
- package/dist/web-ui/assets/{issues-Bq1lyZOv.js → issues-B31tVo5T.js} +2 -2
- package/dist/web-ui/assets/issues-Cr3q1Jk7.js +1 -0
- package/dist/web-ui/assets/{lazy-issue-panels-egQaaSL6.js → lazy-issue-panels-DlXOkazw.js} +3 -3
- package/dist/web-ui/assets/routes-D4B5iM7M.js +1 -0
- package/dist/web-ui/assets/{task._taskId-pDb6g2Xt.js → task._taskId-JA2GmlLZ.js} +1 -1
- package/dist/web-ui/assets/{worktrees-DMXokhJi.js → worktrees-CYSL7oNO.js} +1 -1
- package/dist/web-ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/web-ui/assets/AppShell-BfIm07jW.js +0 -5
- package/dist/web-ui/assets/IssueIntakePanel-CP8LZ6ts.js +0 -1
- package/dist/web-ui/assets/IssuePeek-DG0cbGID.js +0 -1
- package/dist/web-ui/assets/SlideOver-CFuCH6OP.js +0 -1
- package/dist/web-ui/assets/board-SxP8ovsE.js +0 -1
- package/dist/web-ui/assets/issues-DPd_ri4P.js +0 -1
- package/dist/web-ui/assets/routes-1WHKiK_P.js +0 -1
- /package/dist/web-ui/assets/{RichEditor-B4sEOPyN.css → SlideOver-B4sEOPyN.css} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{o as e,u as t}from"./terminal-Nt-mXbb9.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-C1KFppnz.js";import{d as s,m as c,p as l,t as u}from"./createLucideIcon-C8T7_EGK.js";import{a as d,n as f,r as p}from"./toast-CTxQEYJU.js";import{n as m,t as h}from"./ViewToggle-DFsgA1oB.js";import{n as g,t as _}from"./store-C3IHXPqa.js";import{t as v}from"./active-task-Dcgkjlku.js";import{t as y}from"./external-store-Djn-EBMQ.js";import{i as b,r as x,t as S}from"./WorkspaceTabs-DnCwqBDD.js";import{t as C}from"./SettingsPage-tLF6TOZT.js";import{C as w,S as T,T as E,_ as ee,c as D,f as O,g as k,h as A,m as j,n as te,o as ne,p as M,r as re,s as ie,v as ae,w as oe,x as se,y as ce}from"./index-DVzmgaP7.js";import{r as le}from"./web-transport-BFmRPA6p.js";import{n as ue,t as de}from"./time-kviT26Tm.js";import{n as fe,t as pe}from"./ConfirmDialog-SJlZUycl.js";import{t as me}from"./text-match-DW3sD-Rt.js";import{n as he,r as ge,t as _e}from"./chips-B2ODRu8l.js";var ve=u(`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`}]]),ye=u(`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`}]]),N=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),P=u(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),F=t(o(),1),I=c();function be({onClose:e}){let{tasks:t}=g(),n=d(),i=(0,F.useRef)(null);M(i);let a=(0,F.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,F.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,F.useState)(a[0]??``),[u,m]=(0,F.useState)(null),[h,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),w=async e=>{if(e){y(!0),m(null);try{let{worktrees:t}=await _(`worktree.discoverAdoptable`,{repo:e});m(t)}catch(e){p(`scan worktrees`,e),m([])}finally{y(!1)}}},T=async t=>{x(t.path);try{let{task:i}=await _(`worktree.adopt`,{repo:s,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),v(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),f(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){p(`adopt worktree`,e)}finally{x(null)}};return S?(0,I.jsx)(re,{onClose:e}):a.length===0?(0,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,I.jsxs)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:[`No repos known to `,l(),` yet. Create a task in a repo first, then come back to adopt its worktrees.`]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>C(!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,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.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,I.jsx)(`option`,{value:e,children:e},e))}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void w(s),disabled:!s||h,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:h?`Scanning…`:`Scan`})]})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:u===null?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Pick a repo and Scan to find adoptable worktrees.`}):u.length===0?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No adoptable worktrees found for this repo.`}):u.map(e=>{let t=o.has(e.path);return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,I.jsx)(`span`,{className:`ml-auto shrink-0`,children:ue(e.lastActivityMs)})]})]}),t?(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>void T(e),disabled:b!==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:b===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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 L=y({query:``,statusFilter:`all`,sortMode:`default`}),R=null;function z(e){L.update(t=>({...t,...e}))}function B(e){z({query:e})}function V(e){z({statusFilter:e})}function xe(e){z({sortMode:e})}function Se(e){!e||e===R||(R=e,z({sortMode:e}))}function Ce(){return L.useSnapshot()}function H(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function U(e,t){let n=H(t)-H(e);return n===0?t.id.localeCompare(e.id):n}function we(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(U),i.sort(U)),[...n,...r,...i]}function Te(e,t){let n=[e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `);return me(n,t)}function W({children:e,suffix:t}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function G({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=de(e.updatedAt||e.createdAt);return(0,I.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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,I.jsx)(N,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${j(t?.state)}`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,I.jsx)(ge,{pr:e.prStatus}),e.pinned&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,I.jsx)(_e,{counts:r})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(he,{label:i}),c&&(0,I.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,I.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:s,worktreeChanges:c,uiPrefs:l,hydrated:u,streamConnected:f}=g(),{selectedTaskId:p}=n(),m=O(),h=(0,F.useMemo)(()=>ne(a),[a]),_=e=>ie(m,e,h),{query:y,statusFilter:b,sortMode:x}=Ce(),S=(0,F.useRef)(null),C=(0,F.useRef)(null);(0,F.useEffect)(()=>{p&&S.current?.querySelector(`[data-task-id="${CSS.escape(p)}"]`)?.scrollIntoView({block:`nearest`})},[p]);let w=l?.sortMode;(0,F.useEffect)(()=>{Se(w)},[w]);let T=(0,F.useMemo)(()=>we(a.filter(e=>Te(e,y)&&te(o[e.id],c[e.worktreePath],b)),x),[a,y,b,x,o,c]),E=T.filter(e=>e.kind===`main`),D=T.filter(e=>e.kind!==`main`),A=!u||!f&&a.length===0,j=d(),M=e=>{r(e),v(e),j({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.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(),C.current?.focus();return}if(n&&o&&o!==document.body&&!S.current?.contains(o)||T.length===0)return;e.preventDefault();let s=T.findIndex(e=>e.id===p),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),T.length-1);M(T[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,p]),(0,I.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,I.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>xe(x==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${x===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[T.length,`/`,a.length]}),(0,I.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,I.jsx)(ye,{size:14,strokeWidth:1.9})}),(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,I.jsx)(ce,{size:14,strokeWidth:2.2})})]})]}),(0,I.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,I.jsx)(ae,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:C,value:y,onChange:e=>B(e.target.value),onKeyDown:e=>{e.key===`Enter`&&T.length>0?(e.preventDefault(),M(T[0].id),e.currentTarget.blur()):e.key===`Escape`&&y&&(e.preventDefault(),B(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),y&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>B(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,I.jsx)(k,{size:13,strokeWidth:2})})]}),(0,I.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,I.jsx)(`button`,{type:`button`,onClick:()=>V(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${b===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,I.jsx)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:A?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,I.jsx)(N,{size:13,strokeWidth:2,className:`animate-spin`}),(0,I.jsx)(`span`,{children:`connecting…`})]}):a.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No tasks yet.`}),(0,I.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`})]}):T.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`div`,{children:y?`No matches for “${y}”.`:`No tasks in this status.`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{B(``),V(`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,I.jsxs)(I.Fragment,{children:[E.length>0&&(0,I.jsx)(W,{children:`Projects`}),E.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id)),D.length>0&&(0,I.jsx)(W,{suffix:x==="default"?void 0:x,children:`Worktrees`}),D.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id))]})}),(0,I.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,I.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,I.jsx)(ee,{size:15,strokeWidth:1.8}),(0,I.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 K(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}var q=`(?:[^()]|\\([^()]*\\))+`,je=RegExp(`!\\[([^\\]]*)\\]\\((${q})\\)`,`g`),Me=RegExp(`\\[([^\\]]+)\\]\\((${q})\\)`,`g`);function J(e,t){let n=Ae(t.replace(/&/g,`&`));return n?`<a href="${K(n)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${e}</a>`:`${e}(${t})`}function Ne(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(je,(e,t,n)=>{let r=ke(n.replace(/&/g,`&`));return r?`<img src="${K(r)}" alt="${t}" loading="lazy" class="kobe-md-img">`:t?J(t,n):``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(Me,(e,t,n)=>J(t,n))),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Y(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(K(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">${Y(K(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${Y(K(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>${Y(K(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>${Y(K(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">${Y(K(l.join(` `)))}</p>`)}return a(),n.join(`
|
|
5
|
+
`)}async function Fe(t){return(await e.get(`/api/notes`,{query:{taskId:t},label:`load notes`})).markdown??``}async function Ie(t,n){await e.put(`/api/notes`,{taskId:t,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 X=600;function Re({children:e,right:t}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t]})}function ze({taskId:e,full:t=!1}){let[n,r]=(0,F.useState)(``),[i,a]=(0,F.useState)(!1),[o,s]=(0,F.useState)(!1),[c,l]=(0,F.useState)(`idle`),u=(0,F.useMemo)(()=>Pe(n),[n]),d=(0,F.useRef)(null),f=(0,F.useRef)(null),p=(0,F.useRef)(null),m=(0,F.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,F.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,F.useEffect)(()=>()=>{m()},[m]);let h=(0,F.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,X)},[e,m]);return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-bg`,children:[(0,I.jsx)(Re,{right:e?(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==`idle`&&(0,I.jsx)(`span`,{className:`text-[10px] ${c===`error`?`text-kobe-red`:`text-subtle`}`,children:Le(c)}),(0,I.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,I.jsx)(`div`,{className:`min-h-0 flex-1 ${t?`px-0 pb-0`:`px-3 pb-3`}`,children:e?i?(0,I.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,I.jsx)(`div`,{className:`kobe-md text-[12px] leading-relaxed text-fg`,dangerouslySetInnerHTML:{__html:u}}):(0,I.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Nothing to preview yet.`})}):(0,I.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,I.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,I.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 Be=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],Ve=`DIRTY_WORKTREE`;function He(e){return e.replace(/_/g,` `)}function Z({name:e,value:t,mono:n=!1}){return(0,I.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2 last:border-b-0`,children:[(0,I.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,I.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,I.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 Ue({task:e}){let[t,n]=(0,F.useState)(e?.title??``),[r,i]=(0,F.useState)(e?.branch??``),[o,s]=(0,F.useState)(null),[c,l]=(0,F.useState)(!1),u=(0,F.useRef)(null);(0,F.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let[m,h]=(0,F.useState)(null),g=O(),y=d();if((0,F.useEffect)(()=>{n(e?.title??``)},[e?.title]),(0,F.useEffect)(()=>{i(e?.branch??``)},[e?.branch]),!e)return(0,I.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,I.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 b=async(e,t)=>{s(e);try{await t()}catch(t){p(e.split(`:`)[0],t)}finally{s(null)}},x=()=>{let n=t.trim();!n||n===e.title||b(`rename`,()=>_(`task.rename`,{taskId:e.id,title:n}))},S=()=>{let t=r.trim();!t||t===e.branch||b(`branch`,()=>_(`task.setBranch`,{taskId:e.id,branch:t}))},C=()=>{De(e.worktreePath).then(e=>{e&&(l(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>l(!1),1200))})},w=t=>{h(null),s(`delete`),(async()=>{try{await _(`task.delete`,{taskId:e.id,force:t}),a(),y({to:`/`}),v(null),f(`success`,`Deleted "${e.title||e.branch}"`)}catch(e){let n=e instanceof Error?e.message:String(e);!t&&n.includes(Ve)?h({kind:`delete`,force:!0}):p(`delete`,e)}finally{s(null)}})()};return(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsxs)(`div`,{className:`border-b border-line px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Task`}),(0,I.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,I.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onBlur:x,onKeyDown:e=>{e.key===`Enter`&&x()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`}),(0,I.jsx)(Q,{onClick:x,disabled:o===`rename`,children:`Save`})]})]}),(0,I.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:[e.kind===`main`?(0,I.jsx)(Z,{name:`Branch`,value:e.branch,mono:!0}):(0,I.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2`,children:[(0,I.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Branch`}),(0,I.jsx)(`div`,{className:`mt-1 flex gap-2`,children:(0,I.jsx)(`input`,{value:r,onChange:e=>i(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 font-mono text-[12px] text-fg focus:border-line-active focus:outline-none`})})]}),(0,I.jsx)(Z,{name:`Vendor`,value:D(e.vendor)}),(0,I.jsx)(Z,{name:`Worktree`,value:e.worktreePath,mono:!0}),(0,I.jsx)(Z,{name:`Repo`,value:e.repo,mono:!0}),(0,I.jsxs)(`div`,{className:`mt-4`,children:[(0,I.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Status`}),(0,I.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:Be.map(t=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>void b(`status:${t}`,()=>_(`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:He(t)},t))})]}),(0,I.jsxs)(`div`,{className:`mt-4`,children:[(0,I.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Vendor`}),(0,I.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:g.map(t=>(0,I.jsx)(`button`,{type:`button`,onClick:()=>void b(`vendor:${t.id}`,()=>_(`task.setVendor`,{taskId:e.id,vendor:t.id})),disabled:o!==null,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${D(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,I.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,I.jsx)(Q,{onClick:()=>void b(`pin`,()=>_(`task.pin`,{taskId:e.id,pinned:!e.pinned})),disabled:o!==null,children:e.pinned?`Unpin`:`Pin`}),(0,I.jsx)(Q,{onClick:()=>void b(`worktree`,()=>_(`task.ensureWorktree`,{taskId:e.id})),disabled:o!==null,children:`Ensure worktree`}),(0,I.jsx)(Q,{onClick:C,children:c?`Copied`:`Copy path`})]}),e.kind!==`main`&&(0,I.jsxs)(`div`,{className:`mt-4 border-t border-line-subtle pt-3`,children:[(0,I.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Danger zone`}),(0,I.jsx)(Q,{onClick:()=>h({kind:`delete`,force:!1}),disabled:o!==null,danger:!0,children:`Delete task + worktree`})]})]}),m?.kind===`delete`&&(0,I.jsx)(pe,{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:()=>w(m.force),onCancel:()=>h(null)})]})}function $({drawer:e=!1,onClose:t}={}){let[r,a]=(0,F.useState)(`overview`),{selectedTaskId:o}=n(),{tasks:s}=g(),c=o?s.find(e=>e.id===o)??null:null;return(0,I.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,I.jsxs)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:[[`overview`,`notes`,`changes`].map(e=>(0,I.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,I.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto px-3 text-subtle hover:text-fg`,"aria-label":`Close tools`,children:(0,I.jsx)(k,{size:14,strokeWidth:2})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`overview`?(0,I.jsx)(Ue,{task:c}):r===`notes`?(0,I.jsx)(ze,{taskId:o,full:!0}):(0,I.jsx)(x,{worktreePath:c?.worktreePath??null,onOpenFile:e=>{o&&i(o,e)}})})]})}function We({onToggleTools:e,onShowHelp:t}){let{daemonConnected:r,streamConnected:i,tasks:a}=g(),{selectedTaskId:o}=n(),c=o?a.find(e=>e.id===o):null,l=le({daemonConnected:r,streamConnected:i});return(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)(fe,{}),(0,I.jsxs)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:[`[`,s,`]`]}),(0,I.jsx)(h,{}),c?(0,I.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`max-w-56 truncate rounded bg-inset px-2 py-0.5 text-[11px] text-fg`,children:c.title||c.branch}),(0,I.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-[11px] text-subtle md:inline`,children:c.branch})]}):(0,I.jsx)(`span`,{className:`rounded bg-inset px-2 py-0.5 text-[11px] text-muted`,children:`Workspace`}),(0,I.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[11px] text-subtle`,children:[(0,I.jsxs)(`span`,{className:`hidden items-center gap-1.5 sm:flex`,title:l.title,children:[(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${l.ok?`bg-kobe-green`:`bg-kobe-yellow`}`}),(0,I.jsx)(`span`,{children:l.label})]}),(0,I.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,I.jsx)(ve,{size:15,strokeWidth:1.8})}),(0,I.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,I.jsx)(P,{size:15,strokeWidth:1.8})})]})]})}function Ge(){let{tasks:e,update:t}=g(),{selectedTaskId:r}=n(),i=r?e.find(e=>e.id===r):null,a=e.length;return(0,I.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,I.jsxs)(`span`,{children:[a,` task`,a===1?``:`s`]}),i&&(0,I.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[i.kind===`main`?`project`:`worktree`,` ·`,` `,b(i.worktreePath,54)]}),(0,I.jsx)(`span`,{className:`ml-auto`,children:t?.latest?`update ${t.latest} available`:`${l()} web`})]})}function Ke(){let{settingsOpen:e}=E(),[t,n]=(0,F.useState)(!1),[r,i]=(0,F.useState)(!1);return(0,F.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,I.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,I.jsx)(We,{onToggleTools:()=>i(e=>!e),onShowHelp:T}),(0,I.jsx)(m,{}),(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(Ee,{onOpenSettings:oe,onNewTask:w,onAdopt:()=>n(!0)}),e?(0,I.jsx)(C,{onClose:se}):(0,I.jsx)(S,{}),(0,I.jsx)(`div`,{className:`hidden lg:flex`,children:(0,I.jsx)($,{})}),r&&(0,I.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,I.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,I.jsx)($,{drawer:!0,onClose:()=>i(!1)})})})]}),(0,I.jsx)(Ge,{}),t&&(0,I.jsx)(be,{onClose:()=>n(!1)})]})}export{Ke as AppShell};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./terminal-Nt-mXbb9.js";import{f as t,y as n}from"./tabs-C1KFppnz.js";import{d as r,m as i}from"./createLucideIcon-C8T7_EGK.js";import{a,n as o,r as s}from"./toast-CTxQEYJU.js";import{n as c,t as l}from"./ViewToggle-CROAjX49.js";import{n as u}from"./store-C3IHXPqa.js";import{n as ee}from"./active-task-DOIy-xHd.js";import{t as d}from"./external-store-Djn-EBMQ.js";import{t as f}from"./external-link-D4N6NrPI.js";import{a as te,i as p,n as m,r as h,t as g}from"./lazy-issue-panels-egQaaSL6.js";import{g as ne,v as _,y as v}from"./index-wTeVn7Ca.js";import{n as y,t as re}from"./ConfirmDialog-BJlYZhgy.js";import{_ as b,a as x,d as ie,g as S,h as C,m as w,p as T,s as E,u as D}from"./issues-Bq1lyZOv.js";var O=e(n(),1),k={query:``,repo:null};function A(e){j.update(t=>({...t,...e}))}var j=d(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 ae(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,O.useState)(!1),[o,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:o,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await C(e,t,n),r([e]),!0}catch(e){return s(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await x(e,t.id),r([e]),!0}catch(e){return s(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(o===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await w(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){s(`quick start issue`,e);return}finally{c(null)}}}}}var F=i();function I({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,F.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,F.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,F.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,F.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,F.jsx)(v,{size:11,strokeWidth:2}),(0,F.jsx)(`span`,{children:`New story`})]})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,F.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=b(t)?t.taskId:void 0;return(0,F.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,F.jsx)(p,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,F.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,F.jsx)(f,{size:10,strokeWidth:1.8}),(0,F.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,F.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function L({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,F.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,F.jsx)(I,{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:i}=u(),{query:d,repo:f}=M(),p=a(),b=(0,O.useRef)(null),[x,C]=(0,O.useState)(null),[w,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(null),[I,R]=(0,O.useState)([]);(0,O.useEffect)(()=>{let e=!1;return E().then(t=>{e||R(t)}).catch(e=>s(`load projects`,e)),()=>{e=!0}},[]);let z=(0,O.useMemo)(()=>D(e,I),[e,I]),B=(0,O.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,O.useMemo)(()=>T(z,f),[z,f]),{data:H,pending:U,refresh:W}=te(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:oe,quickStart:se}=ae({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:ce,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,O.useMemo)(()=>S({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,O.useEffect)(()=>{x&&(Y.some(e=>e.repo===x.repo&&e.issue.id===x.id)||C(null))},[Y,x]),(0,O.useEffect)(()=>{let e=e=>{if(x||w||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(),b.current?.focus()):e.key===`Escape`&&t===b.current&&d&&(e.preventDefault(),N(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,x,w,A]),(0,O.useEffect)(()=>{f!==V&&P(V)},[V,f]);let le=!!d,$=e=>{t(e),ee(e),p({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,F.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,F.jsx)(y,{}),(0,F.jsxs)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:[`[`,r,`]`]}),(0,F.jsx)(l,{}),(0,F.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,F.jsx)(_,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,F.jsx)(`input`,{ref:b,value:d,onChange:e=>N(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,F.jsx)(ne,{size:13,strokeWidth:2})})]}),z.length>0&&(0,F.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,F.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,F.jsx)(`select`,{value:V??``,onChange:e=>P(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=ce.find(t=>t.repo===e.repo)?.count??0;return(0,F.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,F.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,F.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,F.jsx)(c,{}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&le&&Q?(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No stories match.`}),(0,F.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&&!i?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,F.jsx)(L,{board:X[0],onNewIssue:k,onPeekIssue:e=>C({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>j({repo:e,issue:t})}):(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,F.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=V??X[0]?.repo??B[0];return e?(0,F.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,F.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),w&&(0,F.jsx)(g,{children:(0,F.jsx)(m,{repoRoot:w,open:!0,onClose:()=>k(null),onCreated:(e,t)=>{w&&W([w]),o(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!x)return null;let e=Y.find(e=>e.repo===x.repo&&e.issue.id===x.id);return e?(0,F.jsx)(g,{children:(0,F.jsx)(h,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>C(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await se(e.repo,e.issue,t,n,r);i&&a?(C(null),$(a)):C(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;C(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&ie(t,e.issue).then(()=>o(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>s(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),A&&(0,F.jsx)(re,{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:G,onConfirm:()=>void oe(A.repo,A.issue).then(e=>{e&&(j(null),x?.repo===A.repo&&x.id===A.issue.id&&C(null))}),onCancel:()=>j(null)})]})}export{R as Board};
|
|
1
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{f as t,y as n}from"./tabs-C1KFppnz.js";import{d as r,m as i}from"./createLucideIcon-C8T7_EGK.js";import{a,n as o,r as s}from"./toast-CTxQEYJU.js";import{n as c,t as l}from"./ViewToggle-DFsgA1oB.js";import{n as u}from"./store-C3IHXPqa.js";import{t as ee}from"./active-task-Dcgkjlku.js";import{t as d}from"./external-store-Djn-EBMQ.js";import{t as f}from"./external-link-D4N6NrPI.js";import{a as te,i as p,n as m,r as h,t as g}from"./lazy-issue-panels-DlXOkazw.js";import{g as ne,v as _,y as v}from"./index-DVzmgaP7.js";import{n as y,t as re}from"./ConfirmDialog-SJlZUycl.js";import{_ as b,a as x,d as ie,g as S,h as C,m as w,p as T,s as E,u as D}from"./issues-B31tVo5T.js";var O=e(n(),1),k={query:``,repo:null};function A(e){j.update(t=>({...t,...e}))}var j=d(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 ae(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,O.useState)(!1),[o,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:o,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await C(e,t,n),r([e]),!0}catch(e){return s(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await x(e,t.id),r([e]),!0}catch(e){return s(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(o===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await w(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){s(`quick start issue`,e);return}finally{c(null)}}}}}var F=i();function I({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,F.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,F.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,F.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,F.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,F.jsx)(v,{size:11,strokeWidth:2}),(0,F.jsx)(`span`,{children:`New story`})]})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,F.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=b(t)?t.taskId:void 0;return(0,F.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,F.jsx)(p,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,F.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,F.jsx)(f,{size:10,strokeWidth:1.8}),(0,F.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,F.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function L({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,F.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,F.jsx)(I,{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:i}=u(),{query:d,repo:f}=M(),p=a(),b=(0,O.useRef)(null),[x,C]=(0,O.useState)(null),[w,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(null),[I,R]=(0,O.useState)([]);(0,O.useEffect)(()=>{let e=!1;return E().then(t=>{e||R(t)}).catch(e=>s(`load projects`,e)),()=>{e=!0}},[]);let z=(0,O.useMemo)(()=>D(e,I),[e,I]),B=(0,O.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,O.useMemo)(()=>T(z,f),[z,f]),{data:H,pending:U,refresh:W}=te(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:oe,quickStart:se}=ae({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:ce,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,O.useMemo)(()=>S({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,O.useEffect)(()=>{x&&(Y.some(e=>e.repo===x.repo&&e.issue.id===x.id)||C(null))},[Y,x]),(0,O.useEffect)(()=>{let e=e=>{if(x||w||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(),b.current?.focus()):e.key===`Escape`&&t===b.current&&d&&(e.preventDefault(),N(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,x,w,A]),(0,O.useEffect)(()=>{f!==V&&P(V)},[V,f]);let le=!!d,$=e=>{t(e),ee(e),p({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,F.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,F.jsx)(y,{}),(0,F.jsxs)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:[`[`,r,`]`]}),(0,F.jsx)(l,{}),(0,F.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,F.jsx)(_,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,F.jsx)(`input`,{ref:b,value:d,onChange:e=>N(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,F.jsx)(ne,{size:13,strokeWidth:2})})]}),z.length>0&&(0,F.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,F.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,F.jsx)(`select`,{value:V??``,onChange:e=>P(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=ce.find(t=>t.repo===e.repo)?.count??0;return(0,F.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,F.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,F.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,F.jsx)(c,{}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&le&&Q?(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No stories match.`}),(0,F.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&&!i?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,F.jsx)(L,{board:X[0],onNewIssue:k,onPeekIssue:e=>C({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>j({repo:e,issue:t})}):(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,F.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=V??X[0]?.repo??B[0];return e?(0,F.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,F.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),w&&(0,F.jsx)(g,{children:(0,F.jsx)(m,{repoRoot:w,open:!0,onClose:()=>k(null),onCreated:(e,t)=>{w&&W([w]),o(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!x)return null;let e=Y.find(e=>e.repo===x.repo&&e.issue.id===x.id);return e?(0,F.jsx)(g,{children:(0,F.jsx)(h,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>C(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await se(e.repo,e.issue,t,n,r);i&&a?(C(null),$(a)):C(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;C(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&ie(t,e.issue).then(()=>o(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>s(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),A&&(0,F.jsx)(re,{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:G,onConfirm:()=>void oe(A.repo,A.issue).then(e=>{e&&(j(null),x?.repo===A.repo&&x.id===A.issue.id&&C(null))}),onCancel:()=>j(null)})]})}export{R as Board};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-dD7BxK7D.js","assets/terminal-Nt-mXbb9.js","assets/tabs-C1KFppnz.js","assets/createLucideIcon-C8T7_EGK.js","assets/store-C3IHXPqa.js","assets/rotate-cw-CSI5S-rL.js","assets/web-transport-BFmRPA6p.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{u as e}from"./terminal-Nt-mXbb9.js";import{c as t,y as n}from"./tabs-C1KFppnz.js";import{m as r,t as i}from"./createLucideIcon-C8T7_EGK.js";import{i as a}from"./store-C3IHXPqa.js";import{t as o}from"./ChatTranscript-
|
|
2
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{c as t,y as n}from"./tabs-C1KFppnz.js";import{m as r,t as i}from"./createLucideIcon-C8T7_EGK.js";import{i as a}from"./store-C3IHXPqa.js";import{t as o}from"./ChatTranscript-Ccrk8G8U.js";import{t as s}from"./external-link-D4N6NrPI.js";import{c,g as l,h as u,m as d,p as f}from"./index-DVzmgaP7.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-dD7BxK7D.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);f(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=u(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 ${d(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)(l,{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:c(e.vendor),title:e.title||e.branch})})]})]})}export{v as BoardPeek};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e,u as t}from"./terminal-Nt-mXbb9.js";import{y as n}from"./tabs-C1KFppnz.js";import{m as r,p as i,t as a}from"./createLucideIcon-C8T7_EGK.js";import{n as o}from"./store-C3IHXPqa.js";import{t as s}from"./rotate-cw-CSI5S-rL.js";import{g as c,v as l}from"./index-wTeVn7Ca.js";import{t as u}from"./web-transport-BFmRPA6p.js";import{t as d}from"./time-kviT26Tm.js";var f=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),p=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),m=t(n(),1);function h(t,n){return e.get(`/api/history/sessions`,{query:{worktreePath:t,vendor:n},label:`/api/history/sessions`})}async function g(t,n){let{messages:r}=await e.get(`/api/history/messages`,{query:{vendor:t,sessionId:n},label:`/api/history/messages`});return r}function ee(e){let t=0,n=0,r=0;for(let i of e){let e=i.usage;e&&(t+=e.input_tokens,n+=e.output_tokens,r=e.input_tokens+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0))}return{inputTokens:t,outputTokens:n,contextTokens:r}}function _(e){return e>=999950?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function v(e,t,n,r=80){return t-e-n<r}var y=90;function b(e){let t=e.input;if(t&&typeof t==`object`){let e=e=>typeof t[e]==`string`?t[e]:null,n=e(`command`)??e(`file_path`)??e(`pattern`)??e(`url`)??e(`description`)??e(`prompt`)??e(`query`);if(n)return n.length>y?`${n.slice(0,89)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>y?`${t.slice(0,89)}…`:t}catch{return``}}function x(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function S(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${b(e)}`;case`tool_result`:return x(e.output)}}function C(e){return e.blocks.map(S).join(` `)}function w(e,t){return!(t&&e.type===`tool_call`)}function T(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`&&!t)}var E=r(),D=600;function O({call:e,result:t}){let[n,r]=(0,m.useState)(!1),i=b(e),a=t?x(t.output):``,o=!n&&a.length>D,s=o?`${a.slice(0,D)}…`:a,c=a.length>0;return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>c&&r(e=>!e),className:`flex w-full items-baseline gap-2 text-left ${c?`cursor-pointer`:`cursor-default`}`,children:[(0,E.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,E.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,E.jsx)(f,{size:12}):(0,E.jsx)(p,{size:12})})]}),(n||!n&&a&&a.length<=D)&&a&&(0,E.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto whitespace-pre-wrap break-words border-l-2 pl-3 font-mono text-[11px] leading-relaxed ${t?.isError?`border-kobe-red/40 text-kobe-red/90`:`border-line text-muted`}`,children:s}),o&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`ml-5 mt-0.5 text-[10px] text-subtle hover:text-fg`,children:`show full output`})]})}function k({text:e}){let[t,n]=(0,m.useState)(!1);return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,E.jsx)(`span`,{children:`✱`}),(0,E.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,E.jsx)(f,{size:11}):(0,E.jsx)(p,{size:11})]}),t&&(0,E.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words border-l-2 border-line-subtle pl-3 text-[11px] italic leading-relaxed text-subtle`,children:e})]})}function A({message:e,results:t,hideTools:n}){let r=[],i=d(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!w(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,E.jsxs)(`div`,{className:`my-2 flex items-baseline gap-2 border-l-2 border-primary/60 bg-inset/40 px-3 py-2`,children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,E.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-[12px] leading-relaxed text-fg`,children:o.text}),i&&!a&&(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,E.jsx)(`p`,{className:`my-2 whitespace-pre-wrap break-words text-[12px] leading-relaxed ${e.role===`system`?`text-subtle`:`text-fg/90`}`,children:o.text},c));return}if(o.type===`tool_call`){r.push((0,E.jsx)(O,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,E.jsx)(k,{text:o.text},c));return}}),r.length===0?null:(0,E.jsx)(E.Fragment,{children:r})}var j=2500;function M({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=o(),a=u({daemonConnected:n,streamConnected:r}),[d,f]=(0,m.useState)([]),[p,y]=(0,m.useState)(null),[b,x]=(0,m.useState)(!0),[S,w]=(0,m.useState)([]),[D,O]=(0,m.useState)(``),[k,M]=(0,m.useState)(!1),[N,P]=(0,m.useState)(null),[F,I]=(0,m.useState)(!1),[L,R]=(0,m.useState)(!0),z=(0,m.useRef)(-1),B=(0,m.useRef)(null),V=(0,m.useRef)(!0),H=(0,m.useRef)(0),U=(0,m.useRef)(!0),W=(0,m.useRef)(null);(0,m.useEffect)(()=>{U.current=b,W.current=p},[b,p]);let G=(0,m.useCallback)(async(n=!1)=>{if(!e)return;let r=H.current;try{let i=await h(e,t);if(i.latestMtime===z.current&&!n)return;z.current=i.latestMtime;let a=i.sessions.at(-1)??null,o=U.current?a:W.current??a;r=++H.current;let s=o?await g(t,o):[];if(r!==H.current)return;f(i.sessions),w(s),y(o),P(null)}catch(e){r===H.current&&P(e instanceof Error?e.message:String(e))}finally{r===H.current&&I(!0)}},[e,t]),K=(0,m.useRef)(G);(0,m.useEffect)(()=>{K.current=G},[G]),(0,m.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),y(null),O(``),M(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},j);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===d.at(-1);U.current=n,W.current=e,x(n),y(e);let r=++H.current;g(t,e).then(e=>{r===H.current&&w(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,m.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=v(e.scrollTop,e.scrollHeight,e.clientHeight);V.current=t,R(t)},Y=()=>{let e=B.current;e&&(e.scrollTop=e.scrollHeight,V.current=!0,R(!0))},X=(0,m.useMemo)(()=>{let e=new Map;for(let t of S)for(let n of t.blocks)n.type===`tool_result`&&e.set(n.callId,n);return e},[S]),Z=(0,m.useMemo)(()=>ee(S),[S]),Q=(0,m.useMemo)(()=>S.map(e=>C(e).toLowerCase()),[S]),$=(0,m.useMemo)(()=>{let e=D.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&T(t,k))},[S,Q,D,k]);return e?(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),d.length>0&&(0,E.jsx)(`select`,{value:p??``,onChange:e=>q(e.target.value),className:`max-w-44 border border-line bg-bg px-1 py-0.5 font-mono text-[10px] text-muted focus:outline-none`,title:`Engine session`,children:d.map((e,t)=>(0,E.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===d.length-1?` (latest)`:``]},e))}),(0,E.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,E.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,_(Z.contextTokens)]}),Z.outputTokens>0&&(0,E.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,_(Z.inputTokens),` ⇣`,_(Z.outputTokens)]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void G(!0),className:`text-subtle transition-colors hover:text-fg`,title:`Refresh transcript`,"aria-label":`Refresh transcript`,children:(0,E.jsx)(s,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,E.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,E.jsx)(l,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,E.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Escape`&&D&&(e.preventDefault(),O(``))},placeholder:`Search transcript…`,spellCheck:!1,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg placeholder:text-subtle focus:outline-none`}),D.trim()&&(0,E.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),D.trim()&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>O(``),className:`shrink-0 text-subtle transition-colors hover:text-fg`,"aria-label":`clear transcript search`,title:`Clear search`,children:(0,E.jsx)(c,{size:12,strokeWidth:2})}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${k?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,title:k?`Show tool calls`:`Hide tool calls — read just the conversation`,children:k?`tools off`:`tools`})]}),(0,E.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,E.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?a?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`The `,i(),` daemon is offline — the transcript will reappear once it reconnects.`]}):(0,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,E.jsxs)(`button`,{type:`button`,onClick:()=>void G(!0),className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,E.jsx)(s,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`No engine session recorded for this worktree yet. Open a Vendor tab and start a conversation — the transcript appears here.`}):$.length===0?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,D.trim(),`”.`]}):$.map((e,t)=>(0,E.jsx)(A,{message:e,results:X,hideTools:k},`${e.sessionId}-${t}`)):(0,E.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,E.jsx)(`button`,{type:`button`,onClick:Y,className:`absolute bottom-3 right-4 flex items-center gap-1 border border-line bg-surface px-2 py-1 font-mono text-[10px] text-muted shadow-md transition-colors hover:border-primary hover:text-fg`,children:`↓ latest`})]})]}):(0,E.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{M as t};
|
|
1
|
+
import{o as e,u as t}from"./terminal-Nt-mXbb9.js";import{y as n}from"./tabs-C1KFppnz.js";import{m as r,p as i,t as a}from"./createLucideIcon-C8T7_EGK.js";import{n as o}from"./store-C3IHXPqa.js";import{t as s}from"./rotate-cw-CSI5S-rL.js";import{g as c,v as l}from"./index-DVzmgaP7.js";import{t as u}from"./web-transport-BFmRPA6p.js";import{t as d}from"./time-kviT26Tm.js";var f=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),p=a(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),m=t(n(),1);function h(t,n){return e.get(`/api/history/sessions`,{query:{worktreePath:t,vendor:n},label:`/api/history/sessions`})}async function g(t,n){let{messages:r}=await e.get(`/api/history/messages`,{query:{vendor:t,sessionId:n},label:`/api/history/messages`});return r}function ee(e){let t=0,n=0,r=0;for(let i of e){let e=i.usage;e&&(t+=e.input_tokens,n+=e.output_tokens,r=e.input_tokens+(e.cache_read_input_tokens??0)+(e.cache_creation_input_tokens??0))}return{inputTokens:t,outputTokens:n,contextTokens:r}}function _(e){return e>=999950?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function v(e,t,n,r=80){return t-e-n<r}var y=90;function b(e){let t=e.input;if(t&&typeof t==`object`){let e=e=>typeof t[e]==`string`?t[e]:null,n=e(`command`)??e(`file_path`)??e(`pattern`)??e(`url`)??e(`description`)??e(`prompt`)??e(`query`);if(n)return n.length>y?`${n.slice(0,89)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>y?`${t.slice(0,89)}…`:t}catch{return``}}function x(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function S(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${b(e)}`;case`tool_result`:return x(e.output)}}function C(e){return e.blocks.map(S).join(` `)}function w(e,t){return!(t&&e.type===`tool_call`)}function T(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`&&!t)}var E=r(),D=600;function O({call:e,result:t}){let[n,r]=(0,m.useState)(!1),i=b(e),a=t?x(t.output):``,o=!n&&a.length>D,s=o?`${a.slice(0,D)}…`:a,c=a.length>0;return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>c&&r(e=>!e),className:`flex w-full items-baseline gap-2 text-left ${c?`cursor-pointer`:`cursor-default`}`,children:[(0,E.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,E.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,E.jsx)(f,{size:12}):(0,E.jsx)(p,{size:12})})]}),(n||!n&&a&&a.length<=D)&&a&&(0,E.jsx)(`pre`,{className:`mt-1 max-h-96 overflow-auto whitespace-pre-wrap break-words border-l-2 pl-3 font-mono text-[11px] leading-relaxed ${t?.isError?`border-kobe-red/40 text-kobe-red/90`:`border-line text-muted`}`,children:s}),o&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`ml-5 mt-0.5 text-[10px] text-subtle hover:text-fg`,children:`show full output`})]})}function k({text:e}){let[t,n]=(0,m.useState)(!1);return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,E.jsx)(`span`,{children:`✱`}),(0,E.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,E.jsx)(f,{size:11}):(0,E.jsx)(p,{size:11})]}),t&&(0,E.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap break-words border-l-2 border-line-subtle pl-3 text-[11px] italic leading-relaxed text-subtle`,children:e})]})}function A({message:e,results:t,hideTools:n}){let r=[],i=d(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!w(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,E.jsxs)(`div`,{className:`my-2 flex items-baseline gap-2 border-l-2 border-primary/60 bg-inset/40 px-3 py-2`,children:[(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,E.jsx)(`p`,{className:`min-w-0 flex-1 whitespace-pre-wrap break-words text-[12px] leading-relaxed text-fg`,children:o.text}),i&&!a&&(0,E.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,E.jsx)(`p`,{className:`my-2 whitespace-pre-wrap break-words text-[12px] leading-relaxed ${e.role===`system`?`text-subtle`:`text-fg/90`}`,children:o.text},c));return}if(o.type===`tool_call`){r.push((0,E.jsx)(O,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,E.jsx)(k,{text:o.text},c));return}}),r.length===0?null:(0,E.jsx)(E.Fragment,{children:r})}var j=2500;function M({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=o(),a=u({daemonConnected:n,streamConnected:r}),[d,f]=(0,m.useState)([]),[p,y]=(0,m.useState)(null),[b,x]=(0,m.useState)(!0),[S,w]=(0,m.useState)([]),[D,O]=(0,m.useState)(``),[k,M]=(0,m.useState)(!1),[N,P]=(0,m.useState)(null),[F,I]=(0,m.useState)(!1),[L,R]=(0,m.useState)(!0),z=(0,m.useRef)(-1),B=(0,m.useRef)(null),V=(0,m.useRef)(!0),H=(0,m.useRef)(0),U=(0,m.useRef)(!0),W=(0,m.useRef)(null);(0,m.useEffect)(()=>{U.current=b,W.current=p},[b,p]);let G=(0,m.useCallback)(async(n=!1)=>{if(!e)return;let r=H.current;try{let i=await h(e,t);if(i.latestMtime===z.current&&!n)return;z.current=i.latestMtime;let a=i.sessions.at(-1)??null,o=U.current?a:W.current??a;r=++H.current;let s=o?await g(t,o):[];if(r!==H.current)return;f(i.sessions),w(s),y(o),P(null)}catch(e){r===H.current&&P(e instanceof Error?e.message:String(e))}finally{r===H.current&&I(!0)}},[e,t]),K=(0,m.useRef)(G);(0,m.useEffect)(()=>{K.current=G},[G]),(0,m.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),y(null),O(``),M(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},j);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===d.at(-1);U.current=n,W.current=e,x(n),y(e);let r=++H.current;g(t,e).then(e=>{r===H.current&&w(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,m.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=v(e.scrollTop,e.scrollHeight,e.clientHeight);V.current=t,R(t)},Y=()=>{let e=B.current;e&&(e.scrollTop=e.scrollHeight,V.current=!0,R(!0))},X=(0,m.useMemo)(()=>{let e=new Map;for(let t of S)for(let n of t.blocks)n.type===`tool_result`&&e.set(n.callId,n);return e},[S]),Z=(0,m.useMemo)(()=>ee(S),[S]),Q=(0,m.useMemo)(()=>S.map(e=>C(e).toLowerCase()),[S]),$=(0,m.useMemo)(()=>{let e=D.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&T(t,k))},[S,Q,D,k]);return e?(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),d.length>0&&(0,E.jsx)(`select`,{value:p??``,onChange:e=>q(e.target.value),className:`max-w-44 border border-line bg-bg px-1 py-0.5 font-mono text-[10px] text-muted focus:outline-none`,title:`Engine session`,children:d.map((e,t)=>(0,E.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===d.length-1?` (latest)`:``]},e))}),(0,E.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,E.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,_(Z.contextTokens)]}),Z.outputTokens>0&&(0,E.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,_(Z.inputTokens),` ⇣`,_(Z.outputTokens)]}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void G(!0),className:`text-subtle transition-colors hover:text-fg`,title:`Refresh transcript`,"aria-label":`Refresh transcript`,children:(0,E.jsx)(s,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,E.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,E.jsx)(l,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,E.jsx)(`input`,{value:D,onChange:e=>O(e.target.value),onKeyDown:e=>{e.key===`Escape`&&D&&(e.preventDefault(),O(``))},placeholder:`Search transcript…`,spellCheck:!1,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg placeholder:text-subtle focus:outline-none`}),D.trim()&&(0,E.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),D.trim()&&(0,E.jsx)(`button`,{type:`button`,onClick:()=>O(``),className:`shrink-0 text-subtle transition-colors hover:text-fg`,"aria-label":`clear transcript search`,title:`Clear search`,children:(0,E.jsx)(c,{size:12,strokeWidth:2})}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>M(e=>!e),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${k?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,title:k?`Show tool calls`:`Hide tool calls — read just the conversation`,children:k?`tools off`:`tools`})]}),(0,E.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,E.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?a?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`The `,i(),` daemon is offline — the transcript will reappear once it reconnects.`]}):(0,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,E.jsxs)(`button`,{type:`button`,onClick:()=>void G(!0),className:`flex items-center gap-1.5 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:[(0,E.jsx)(s,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,E.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`No engine session recorded for this worktree yet. Open a Vendor tab and start a conversation — the transcript appears here.`}):$.length===0?(0,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,D.trim(),`”.`]}):$.map((e,t)=>(0,E.jsx)(A,{message:e,results:X,hideTools:k},`${e.sessionId}-${t}`)):(0,E.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,E.jsx)(`button`,{type:`button`,onClick:Y,className:`absolute bottom-3 right-4 flex items-center gap-1 border border-line bg-surface px-2 py-1 font-mono text-[10px] text-muted shadow-md transition-colors hover:border-primary hover:text-fg`,children:`↓ latest`})]})]}):(0,E.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{M as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./terminal-Nt-mXbb9.js";import{y as t}from"./tabs-C1KFppnz.js";import{m as n}from"./createLucideIcon-C8T7_EGK.js";import{D as r,E as i,p as a}from"./index-
|
|
1
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{y as t}from"./tabs-C1KFppnz.js";import{m as n}from"./createLucideIcon-C8T7_EGK.js";import{D as r,E as i,p as a}from"./index-DVzmgaP7.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{y as t}from"./tabs-C1KFppnz.js";import{m as n}from"./createLucideIcon-C8T7_EGK.js";import{f as r,i}from"./issues-B31tVo5T.js";import{n as a,r as o,t as s}from"./SlideOver-BPuRlYRc.js";var c=e(t(),1),l=n();function u({repoRoot:e,open:t,onClose:n,onCreated:u}){let[d,f]=(0,c.useState)(``),[p,m]=(0,c.useState)(``),[h,g]=(0,c.useState)(void 0),[_,v]=(0,c.useState)(void 0),[y,b]=(0,c.useState)(!1),[x,S]=(0,c.useState)(null),C=d.trim().length>0&&!y,w=t=>{if(!C)return;let a=d.trim();b(!0),S(null),i(e,p.trim()?{title:a,body:p}:{title:a}).then(async i=>{let o=i.issues.find(e=>e.title===a)??i.issues[0];t&&o&&await r(e,o,h,_),o&&u(o,t),f(``),m(``),n()}).catch(e=>{S(e instanceof Error?e.message:`failed to create issue`)}).finally(()=>b(!1))};return(0,l.jsx)(s,{open:t,onClose:n,title:`New story`,footer:(0,l.jsxs)(`div`,{className:`flex items-center justify-end gap-2 px-3 py-2.5`,children:[(0,l.jsx)(`button`,{type:`button`,disabled:!C,onClick:()=>w(!1),className:`border border-line bg-bg px-3 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:y?`Saving…`:`Save`}),(0,l.jsx)(`button`,{type:`button`,disabled:!C,onClick:()=>w(!0),className:`border border-primary bg-inset px-3 py-1 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:y?`Starting…`:`Start session`})]}),children:(0,l.jsxs)(`div`,{className:`flex flex-col gap-3 p-3`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Title`}),(0,l.jsx)(`input`,{value:d,onChange:e=>f(e.target.value),placeholder:`What should the session deliver?`,autoFocus:!0,className:`w-full border border-line bg-bg px-2 py-1.5 text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,l.jsxs)(`div`,{children:[(0,l.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,l.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Acceptance`}),(0,l.jsx)(`span`,{className:`text-[10px] text-subtle`,children:`paste or drop images`})]}),(0,l.jsx)(a,{value:p,onChange:m,repoRoot:e,placeholder:`context, constraints, acceptance criteria — paste a screenshot to attach it`})]}),(0,l.jsx)(o,{vendor:h,effort:_,disabled:y,onChange:e=>{g(e.vendor),v(e.effort)}}),x&&(0,l.jsx)(`p`,{className:`text-[11px] text-kobe-red`,role:`alert`,children:x})]})})}export{u as IssueIntakePanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{y as t}from"./tabs-C1KFppnz.js";import{m as n,t as r}from"./createLucideIcon-C8T7_EGK.js";import{t as i}from"./external-link-D4N6NrPI.js";import{n as a,r as o}from"./issues-B31tVo5T.js";import{n as s,r as c,t as l}from"./SlideOver-BPuRlYRc.js";var u=r(`git-merge`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]),d=r(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),f=e(t(),1),p=n(),m=[{id:`task`,label:`New worktree`,hint:`isolated branch, tab in its own task workspace`},{id:`projectWorktree`,label:`Worktree · tab in project`,hint:`isolated branch, chat tab lives in the project workspace`},{id:`project`,label:`Project checkout`,hint:`no worktree — the engine works directly on the checkout`}];function h({issue:e,repoRoot:t,busy:n,starting:r,onClose:h,onSave:g,onStart:_,onOpenSession:v,onPromptMerge:y}){let[b,x]=(0,f.useState)(e.title),[S,C]=(0,f.useState)(e.body),[w,T]=(0,f.useState)(void 0),[E,D]=(0,f.useState)(void 0),[O,k]=(0,f.useState)(`task`),[A,j]=(0,f.useState)(null),M=!!e.taskId,N=o(e.status)&&!M,P=b!==e.title||S!==e.body,F=P&&b.trim().length>0&&!n,I=a[e.status],L=()=>{F&&(j(null),g({title:b,body:S}).catch(e=>{j(e instanceof Error?e.message:`failed to save issue`)}))},R=(0,p.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,p.jsxs)(`span`,{className:`shrink-0 font-mono text-[11px] text-subtle`,children:[`#`,e.id]}),(0,p.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title})]});return(0,p.jsx)(l,{open:!0,wide:!0,onClose:h,title:R,children:(0,p.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,p.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-3 border-r border-line p-3`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Title`}),(0,p.jsx)(`input`,{value:b,onChange:e=>x(e.target.value),placeholder:`Issue title`,className:`w-full border border-line bg-bg px-2 py-1.5 text-[12px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,p.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Acceptance`}),(0,p.jsx)(`span`,{className:`text-[10px] text-subtle`,children:`paste or drop images`})]}),(0,p.jsx)(s,{value:S,onChange:C,repoRoot:t,placeholder:`context, constraints, acceptance criteria — paste a screenshot to attach it`},e.id)]}),A&&(0,p.jsx)(`p`,{className:`text-[11px] text-kobe-red`,role:`alert`,children:A}),(0,p.jsx)(`div`,{className:`flex justify-end`,children:(0,p.jsx)(`button`,{type:`button`,disabled:!F,onClick:L,title:P?`Save title and body`:`No unsaved changes`,className:`border border-primary bg-inset px-3 py-1 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:n?`Saving…`:`Save`})})]}),(0,p.jsxs)(`div`,{className:`flex w-72 shrink-0 flex-col gap-4 p-3`,children:[(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Detail`}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${I.accent}`,children:I.title}),(0,p.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`created `,e.created]})]}),M&&e.taskId&&(0,p.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[10px] text-kobe-orange`,title:`Linked to task ${e.taskId}`,children:[(0,p.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full bg-kobe-orange`}),`running`]})]}),(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5 border-t border-line pt-3`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Engine`}),(0,p.jsx)(c,{vendor:w,effort:E,disabled:!N,onChange:e=>{T(e.vendor),D(e.effort)}})]}),(0,p.jsxs)(`section`,{className:`flex flex-col gap-1.5 border-t border-line pt-3`,children:[(0,p.jsx)(`h3`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Workspace`}),(0,p.jsx)(`div`,{className:`flex flex-col gap-1`,children:m.map(e=>(0,p.jsxs)(`button`,{type:`button`,disabled:!N,onClick:()=>k(e.id),title:e.hint,className:`border px-2 py-1 text-left text-[11px] transition-colors disabled:cursor-not-allowed disabled:opacity-40 ${O===e.id?`border-primary bg-inset text-fg`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,children:[(0,p.jsx)(`span`,{className:`block`,children:e.label}),(0,p.jsx)(`span`,{className:`block text-[10px] text-subtle`,children:e.hint})]},e.id))})]}),(0,p.jsx)(`div`,{className:`mt-auto flex flex-col gap-2 border-t border-line pt-3`,children:M?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>v?.(),disabled:!v,title:`Open this story's running session in the workspace`,className:`flex h-8 items-center justify-center gap-1.5 border border-primary bg-inset px-3 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(i,{size:12,strokeWidth:1.8}),`Open session`]}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>y?.(),disabled:!y||r,title:`Insert the finish and merge prompt into this story's task`,className:`flex h-8 items-center justify-center gap-1.5 border border-line bg-bg px-3 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(u,{size:12,strokeWidth:1.8}),`Prompt merge`]}),(0,p.jsx)(`span`,{className:`text-center text-[10px] text-subtle`,children:`Started`})]}):N?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>_({vendor:w,effort:E,placement:O,watch:!1}),title:`Spawn the session for this story and stay on the board`,className:`flex h-8 items-center justify-center gap-1.5 border border-line bg-bg px-3 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(d,{size:12,strokeWidth:1.8}),r?`Starting…`:`Start in background`]}),(0,p.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>_({vendor:w,effort:E,placement:O,watch:!0}),title:`Spawn the session and open its workspace`,className:`flex h-8 items-center justify-center gap-1.5 border border-primary bg-inset px-3 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:cursor-not-allowed disabled:opacity-40`,children:[(0,p.jsx)(d,{size:12,strokeWidth:1.8}),r?`Starting…`:`Start & watch`]})]}):(0,p.jsx)(`p`,{className:`text-center text-[10px] text-subtle`,children:`Done stories have nothing left to start.`})})]})]})})}export{h as IssuePeek};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./terminal-Nt-mXbb9.js";import{c as t,y as n}from"./tabs-C1KFppnz.js";import{m as r}from"./createLucideIcon-C8T7_EGK.js";import{a as i,r as a}from"./toast-CTxQEYJU.js";import{n as o}from"./store-C3IHXPqa.js";import{t as s}from"./arrow-left-CkmFCPVu.js";import{a as c,i as l,n as ee,r as u,t as d}from"./lazy-issue-panels-
|
|
1
|
+
import{u as e}from"./terminal-Nt-mXbb9.js";import{c as t,y as n}from"./tabs-C1KFppnz.js";import{m as r}from"./createLucideIcon-C8T7_EGK.js";import{a as i,r as a}from"./toast-CTxQEYJU.js";import{n as o}from"./store-C3IHXPqa.js";import{t as s}from"./arrow-left-CkmFCPVu.js";import{a as c,i as l,n as ee,r as u,t as d}from"./lazy-issue-panels-DlXOkazw.js";import{g as f,v as p,y as m}from"./index-DVzmgaP7.js";import{n as h,t as g}from"./ConfirmDialog-SJlZUycl.js";import{a as _,c as te,d as ne,h as re,l as ie,m as v,n as ae,s as y,t as b,u as oe}from"./issues-B31tVo5T.js";var x=e(n(),1);function S(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 C=r();function w(){let{tasks:e,hydrated:n}=o(),r=i(),[w,T]=(0,x.useState)([]);(0,x.useEffect)(()=>{let e=!1;return y().then(t=>{e||T(t)}).catch(e=>a(`load projects`,e)),()=>{e=!0}},[]);let E=(0,x.useMemo)(()=>oe(e,w),[e,w]),[D,O]=(0,x.useState)(null);(0,x.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 se=(0,x.useMemo)(()=>D?[D]:[],[D]),{data:ce,failed:k,pending:A}=c(se),j=D?ce[D]:void 0,[M,N]=(0,x.useState)(``),[P,F]=(0,x.useState)(!1),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(null),[B,V]=(0,x.useState)(null),[H,U]=(0,x.useState)(!1),[W,G]=(0,x.useState)(!1),[le,K]=(0,x.useState)(!1),q=j?.issues??[],J=(0,x.useMemo)(()=>te(q,{query:M}),[q,M]),Y=(0,x.useMemo)(()=>ie(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,x.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,x.useEffect)(()=>L(null),[D]),(0,x.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=S(b.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,x.useEffect)(()=>{I!=null&&document.querySelector(`[data-issue-card="${I}"]`)?.scrollIntoView({block:`nearest`})},[I]);let $=e=>{r({to:`/task/$taskId`,params:{taskId:e}})};return(0,C.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,C.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,C.jsx)(h,{}),(0,C.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,C.jsx)(s,{size:15,strokeWidth:1.8}),(0,C.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,C.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Issues`}),(0,C.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,C.jsx)(p,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,C.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,C.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,C.jsx)(f,{size:13,strokeWidth:2})})]}),E.length>0&&(0,C.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,C.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,C.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,C.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,e.count,` · `,e.repo]},e.repo))})]}),(0,C.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:[(0,C.jsxs)(`span`,{children:[X,` stor`,X===1?`y`:`ies`]}),(0,C.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,C.jsx)(m,{size:13,strokeWidth:1.8}),`New story`]})]})]}),(0,C.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:D?!n||A&&!j?(0,C.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):D&&k[D]?(0,C.jsx)(`p`,{className:`text-[12px] text-kobe-red`,children:k[D]}):X===0?(0,C.jsx)(`p`,{className:`text-[12px] text-subtle`,children:M?`No stories match your filter.`:`No stories yet. Capture one with New story.`}):(0,C.jsx)(`div`,{className:`flex h-full min-h-0 gap-4`,children:b.map(e=>{let t=ae[e],n=Y[e];return(0,C.jsxs)(`section`,{className:`flex h-full min-h-0 w-72 shrink-0 flex-col`,children:[(0,C.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center gap-2`,children:[(0,C.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,C.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n.length})]}),(0,C.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-0.5`,children:n.map(e=>(0,C.jsx)(l,{issue:e,selected:e.id===I,onOpen:()=>{L(e.id),z(e.id)},onDelete:()=>V(e.id)},e.id))})]},e)})}):(0,C.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,C.jsx)(d,{children:(0,C.jsx)(ee,{repoRoot:D,open:P,onClose:()=>F(!1),onCreated:(e,t)=>{t&&e.taskId&&$(e.taskId)}})}),D&&Z&&(0,C.jsx)(d,{children:(0,C.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 re(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),v(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&&ne(e,Z).catch(e=>a(`prompt issue merge`,e))}:void 0})}),Q&&(0,C.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:le,onConfirm:()=>{!D||B==null||(K(!0),_(D,B).then(()=>V(null)).catch(e=>a(`delete issue`,e)).finally(()=>K(!1)))},onCancel:()=>V(null)})]})}export{w as IssuesPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{l as e,o as t,s as n,u as r}from"./terminal-Nt-mXbb9.js";import{d as i,y as a}from"./tabs-C1KFppnz.js";import{a as o,c as s,i as c,m as l,r as u,t as d,u as f}from"./createLucideIcon-C8T7_EGK.js";import{a as p,n as m,r as h}from"./toast-CTxQEYJU.js";import{c as g,d as _,i as v,u as y}from"./index-
|
|
2
|
-
`),E=l();function D({title:e,children:t}){return(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,E.jsx)(`div`,{className:`mt-3 space-y-3 text-[12px]`,children:t})]})}function O({label:e,detail:t,enabled:n,onToggle:r,disabled:i}){return(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border border-line bg-bg p-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`div`,{className:`text-[12px] font-bold text-fg`,children:e}),t?(0,E.jsx)(`div`,{className:`mt-1 text-[11px] leading-relaxed text-subtle`,children:t}):null]}),(0,E.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 k(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(!0),[i,a]=(0,x.useState)(!1),o=(0,x.useRef)(0),s=(0,x.useCallback)(async()=>{let e=++o.current;r(!0),a(!1);try{let n=await y();e===o.current&&t(n)}catch(t){e===o.current&&a(!0),h(`load settings`,t)}finally{e===o.current&&r(!1)}},[]);return(0,x.useEffect)(()=>{s()},[s]),{settings:e,loading:n,error:i,reload:s,patch:async e=>{let n=await _(e);return t(n),n}}}function A({palette:e}){let t=[e.bg,e.primary,e[`kobe-blue`],e[`kobe-green`]].filter(Boolean);return(0,E.jsx)(`span`,{className:`flex shrink-0 overflow-hidden rounded border border-line`,children:t.map((e,t)=>(0,E.jsx)(`span`,{className:`h-5 w-3`,style:{backgroundColor:e}},t))})}function j(){let{names:e,palettes:t,active:n,overridden:r}=o();return(0,E.jsxs)(`div`,{className:`border border-line bg-surface p-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Appearance`}),r?(0,E.jsx)(`button`,{type:`button`,onClick:u,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,E.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`following TUI`})]}),e.length===0?(0,E.jsx)(`p`,{className:`mt-4 text-[12px] text-subtle`,children:`Loading themes…`}):(0,E.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,E.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,E.jsx)(A,{palette:t[e]??{}}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] ${r?`text-fg`:`text-muted`}`,children:e}),r&&(0,E.jsx)(b,{size:13,strokeWidth:2.5,className:`shrink-0 text-primary`})]},e)})})]})}function M(){return(0,E.jsx)(`div`,{className:`space-y-6`,children:(0,E.jsxs)(D,{title:`Dashboard theme`,children:[(0,E.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,E.jsx)(j,{})]})})}function N({engine:e,onSave:t,onDefault:n,onRemove:r}){let[i,a]=(0,x.useState)(e.command),[o,s]=(0,x.useState)(e.label),c=/\s--[A-Za-z0-9][\w-]*/.test(o)&&!/\s--[A-Za-z0-9][\w-]*/.test(i);return(0,x.useEffect)(()=>{a(e.command),s(e.label)},[e.command,e.label]),(0,E.jsxs)(`div`,{className:`border border-line bg-bg p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`font-bold text-fg`,children:e.label}),e.isDefault?(0,E.jsx)(`span`,{className:`font-mono text-[10px] text-primary`,children:`default`}):null,e.isCustom?(0,E.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`custom`}):null]}),(0,E.jsx)(`div`,{className:`font-mono text-[10px] text-subtle`,children:e.id})]}),(0,E.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,E.jsxs)(`label`,{className:`mt-3 block`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Display name (label only)`}),(0,E.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,E.jsxs)(`label`,{className:`mt-2 block`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Launch command (argv that Rove runs)`}),(0,E.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,E.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,E.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,E.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,E.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 P({settings:e,patch:t}){let[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(``),[o,s]=(0,x.useState)(``),c=(e,n,r)=>void t({engineUpdates:[{id:e,command:n,label:r}]}).then(()=>m(`success`,`engine saved`));return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsxs)(D,{title:`Launch commands`,children:[(0,E.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,E.jsx)(`div`,{className:`space-y-2`,children:e.engines.map(e=>(0,E.jsx)(N,{engine:e,onSave:c,onDefault:e=>void t({defaultEngine:e}).then(()=>m(`success`,`default engine saved`)),onRemove:e=>void t({removeEngine:e}).then(()=>m(`success`,`engine removed`))},e.id))})]}),(0,E.jsxs)(D,{title:`Add engine`,children:[(0,E.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[(0,E.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,E.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,E.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,E.jsx)(`button`,{type:`button`,onClick:()=>void t({addEngine:{id:n,command:i,label:o}}).then(()=>{r(``),a(``),s(``),m(`success`,`engine added`)}).catch(e=>h(`add engine`,e)),className:`border border-primary bg-inset px-2 py-1 text-[11px] text-fg`,children:`Add engine`})]})]})}function F(){let[e,t]=(0,x.useState)(``),[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{let e=!1;return S().then(n=>{e||(t(n.review??``),r(n.pr??``),a(!0))}).catch(t=>{e||h(`load quick-action templates`,t)}),()=>{e=!0}},[]),(0,E.jsxs)(D,{title:`Board quick actions`,children:[(0,E.jsxs)(`label`,{className:`block`,children:[(0,E.jsx)(`span`,{className:`text-muted`,children:`Review template`}),(0,E.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:`default: ${w(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,E.jsxs)(`label`,{className:`block`,children:[(0,E.jsx)(`span`,{className:`text-muted`,children:`Open-PR template`}),(0,E.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`default:\n${T}`,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,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-subtle`,children:`Empty = built-in default. Rove appends its status/URL guardrails at send time.`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void C({review:e,pr:n}).then(()=>m(`success`,`quick-action templates saved`)).catch(e=>h(`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 I({settings:e,patch:t}){let[n,r]=(0,x.useState)(!1),a=p();return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsxs)(D,{title:`Experimental gates`,children:[(0,E.jsx)(O,{label:`Remote projects`,detail:`Enables SSH-backed remote project setup in the CLI.`,enabled:e.remoteProjects,onToggle:()=>void t({remoteProjects:!e.remoteProjects})}),(0,E.jsx)(O,{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,E.jsx)(O,{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,E.jsx)(O,{label:`Dispatcher`,detail:`Enables the field-notes dispatcher protocol for repo main sessions.`,enabled:e.dispatcher,onToggle:()=>void t({dispatcher:!e.dispatcher})})]}),(0,E.jsxs)(D,{title:`Browser workspace`,children:[(0,E.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,E.jsx)(`button`,{type:`button`,onClick:()=>{if(!n){r(!0);return}i(),a({to:`/`}),r(!1)},onBlur:()=>r(!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 L(){let{supported:e,permission:t,enabled:n}=f();return(0,E.jsx)(`div`,{className:`space-y-6`,children:(0,E.jsxs)(D,{title:`Notifications`,children:[e?(0,E.jsx)(O,{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 s(!n),disabled:t===`denied`&&!n}):(0,E.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`This browser does not support desktop notifications.`}),t===`denied`&&!n?(0,E.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 R=e({SettingsPage:()=>B}),z=[[`general`,`General`],[`engines`,`Engines`],[`board`,`Board`],[`dev`,`Dev`],[`notifications`,`Notifications`]];function B({onClose:e}){let[t,n]=(0,x.useState)(`general`),{settings:r,loading:i,error:a,reload:o,patch:s}=k(),c=(0,x.useMemo)(()=>z.find(([e])=>e===t)?.[1]??`Settings`,[t]);return(0,E.jsxs)(`section`,{"data-settings-open":!0,className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Settings`}),(0,E.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,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[180px_minmax(0,1fr)] overflow-hidden`,children:[(0,E.jsx)(`nav`,{className:`min-h-0 overflow-auto border-r border-line bg-surface/60 p-2`,children:z.map(([e,r])=>(0,E.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,E.jsx)(`main`,{className:`min-h-0 overflow-auto p-4`,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-4xl`,children:[(0,E.jsx)(`h1`,{className:`mb-3 text-[13px] font-bold uppercase tracking-[0.12em] text-fg`,children:c}),a?(0,E.jsxs)(`div`,{className:`border border-line bg-surface p-4 text-[12px]`,children:[(0,E.jsx)(`p`,{className:`text-subtle`,children:`Couldn't load settings (daemon web transport offline?)`}),(0,E.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,E.jsx)(`div`,{className:`border border-line bg-surface p-4 text-[12px] text-subtle`,children:`Loading settings...`}):t===`general`?(0,E.jsx)(M,{}):t===`engines`?(0,E.jsx)(P,{settings:r,patch:s}):t===`board`?(0,E.jsx)(F,{}):t===`dev`?(0,E.jsx)(I,{settings:r,patch:s}):(0,E.jsx)(L,{})]})})]})]})}export{R as n,B as t};
|
|
1
|
+
import{l as e,o as t,s as n,u as r}from"./terminal-Nt-mXbb9.js";import{d as i,y as a}from"./tabs-C1KFppnz.js";import{a as o,c as s,i as c,m as l,r as u,t as d,u as f}from"./createLucideIcon-C8T7_EGK.js";import{a as p,n as m,r as h}from"./toast-CTxQEYJU.js";import{c as g,d as _,i as v,u as y}from"./index-DVzmgaP7.js";var b=d(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),x=r(a(),1);async function S(){let e=await t.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 C(e){await t.put(`/api/quick-prompts`,e,{label:`save quick prompts`})}`${n}`;function w(e){return g(e)===`claude`?`/review`:`Review the current changes in this worktree critically.`}var T=[`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
|
+
`),E=l();function D({title:e,children:t}){return(0,E.jsxs)(`section`,{children:[(0,E.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,E.jsx)(`div`,{className:`mt-3 space-y-3 text-[12px]`,children:t})]})}function O({label:e,detail:t,enabled:n,onToggle:r,disabled:i}){return(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border border-line bg-bg p-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsx)(`div`,{className:`text-[12px] font-bold text-fg`,children:e}),t?(0,E.jsx)(`div`,{className:`mt-1 text-[11px] leading-relaxed text-subtle`,children:t}):null]}),(0,E.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 k(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(!0),[i,a]=(0,x.useState)(!1),o=(0,x.useRef)(0),s=(0,x.useCallback)(async()=>{let e=++o.current;r(!0),a(!1);try{let n=await y();e===o.current&&t(n)}catch(t){e===o.current&&a(!0),h(`load settings`,t)}finally{e===o.current&&r(!1)}},[]);return(0,x.useEffect)(()=>{s()},[s]),{settings:e,loading:n,error:i,reload:s,patch:async e=>{let n=await _(e);return t(n),n}}}function A({palette:e}){let t=[e.bg,e.primary,e[`kobe-blue`],e[`kobe-green`]].filter(Boolean);return(0,E.jsx)(`span`,{className:`flex shrink-0 overflow-hidden rounded border border-line`,children:t.map((e,t)=>(0,E.jsx)(`span`,{className:`h-5 w-3`,style:{backgroundColor:e}},t))})}function j(){let{names:e,palettes:t,active:n,overridden:r}=o();return(0,E.jsxs)(`div`,{className:`border border-line bg-surface p-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,E.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Appearance`}),r?(0,E.jsx)(`button`,{type:`button`,onClick:u,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,E.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`following TUI`})]}),e.length===0?(0,E.jsx)(`p`,{className:`mt-4 text-[12px] text-subtle`,children:`Loading themes…`}):(0,E.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,E.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,E.jsx)(A,{palette:t[e]??{}}),(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] ${r?`text-fg`:`text-muted`}`,children:e}),r&&(0,E.jsx)(b,{size:13,strokeWidth:2.5,className:`shrink-0 text-primary`})]},e)})})]})}function M(){return(0,E.jsx)(`div`,{className:`space-y-6`,children:(0,E.jsxs)(D,{title:`Dashboard theme`,children:[(0,E.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,E.jsx)(j,{})]})})}function N({engine:e,onSave:t,onDefault:n,onRemove:r}){let[i,a]=(0,x.useState)(e.command),[o,s]=(0,x.useState)(e.label),c=/\s--[A-Za-z0-9][\w-]*/.test(o)&&!/\s--[A-Za-z0-9][\w-]*/.test(i);return(0,x.useEffect)(()=>{a(e.command),s(e.label)},[e.command,e.label]),(0,E.jsxs)(`div`,{className:`border border-line bg-bg p-3`,children:[(0,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0`,children:[(0,E.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,E.jsx)(`span`,{className:`font-bold text-fg`,children:e.label}),e.isDefault?(0,E.jsx)(`span`,{className:`font-mono text-[10px] text-primary`,children:`default`}):null,e.isCustom?(0,E.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`custom`}):null]}),(0,E.jsx)(`div`,{className:`font-mono text-[10px] text-subtle`,children:e.id})]}),(0,E.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,E.jsxs)(`label`,{className:`mt-3 block`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Display name (label only)`}),(0,E.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,E.jsxs)(`label`,{className:`mt-2 block`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Launch command (argv that Rove runs)`}),(0,E.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,E.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,E.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,E.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,E.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 P({settings:e,patch:t}){let[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(``),[o,s]=(0,x.useState)(``),c=(e,n,r)=>void t({engineUpdates:[{id:e,command:n,label:r}]}).then(()=>m(`success`,`engine saved`));return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsxs)(D,{title:`Launch commands`,children:[(0,E.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,E.jsx)(`div`,{className:`space-y-2`,children:e.engines.map(e=>(0,E.jsx)(N,{engine:e,onSave:c,onDefault:e=>void t({defaultEngine:e}).then(()=>m(`success`,`default engine saved`)),onRemove:e=>void t({removeEngine:e}).then(()=>m(`success`,`engine removed`))},e.id))})]}),(0,E.jsxs)(D,{title:`Add engine`,children:[(0,E.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[(0,E.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,E.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,E.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,E.jsx)(`button`,{type:`button`,onClick:()=>void t({addEngine:{id:n,command:i,label:o}}).then(()=>{r(``),a(``),s(``),m(`success`,`engine added`)}).catch(e=>h(`add engine`,e)),className:`border border-primary bg-inset px-2 py-1 text-[11px] text-fg`,children:`Add engine`})]})]})}function F(){let[e,t]=(0,x.useState)(``),[n,r]=(0,x.useState)(``),[i,a]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{let e=!1;return S().then(n=>{e||(t(n.review??``),r(n.pr??``),a(!0))}).catch(t=>{e||h(`load quick-action templates`,t)}),()=>{e=!0}},[]),(0,E.jsxs)(D,{title:`Board quick actions`,children:[(0,E.jsxs)(`label`,{className:`block`,children:[(0,E.jsx)(`span`,{className:`text-muted`,children:`Review template`}),(0,E.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:`default: ${w(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,E.jsxs)(`label`,{className:`block`,children:[(0,E.jsx)(`span`,{className:`text-muted`,children:`Open-PR template`}),(0,E.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`default:\n${T}`,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,E.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,E.jsx)(`span`,{className:`text-[11px] text-subtle`,children:`Empty = built-in default. Rove appends its status/URL guardrails at send time.`}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>void C({review:e,pr:n}).then(()=>m(`success`,`quick-action templates saved`)).catch(e=>h(`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 I({settings:e,patch:t}){let[n,r]=(0,x.useState)(!1),a=p();return(0,E.jsxs)(`div`,{className:`space-y-6`,children:[(0,E.jsxs)(D,{title:`Experimental gates`,children:[(0,E.jsx)(O,{label:`Remote projects`,detail:`Enables SSH-backed remote project setup in the CLI.`,enabled:e.remoteProjects,onToggle:()=>void t({remoteProjects:!e.remoteProjects})}),(0,E.jsx)(O,{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,E.jsx)(O,{label:`Dispatcher`,detail:`Enables the field-notes dispatcher protocol for repo main sessions.`,enabled:e.dispatcher,onToggle:()=>void t({dispatcher:!e.dispatcher})})]}),(0,E.jsxs)(D,{title:`Browser workspace`,children:[(0,E.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,E.jsx)(`button`,{type:`button`,onClick:()=>{if(!n){r(!0);return}i(),a({to:`/`}),r(!1)},onBlur:()=>r(!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 L(){let{supported:e,permission:t,enabled:n}=f();return(0,E.jsx)(`div`,{className:`space-y-6`,children:(0,E.jsxs)(D,{title:`Notifications`,children:[e?(0,E.jsx)(O,{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 s(!n),disabled:t===`denied`&&!n}):(0,E.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`This browser does not support desktop notifications.`}),t===`denied`&&!n?(0,E.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 R=e({SettingsPage:()=>B}),z=[[`general`,`General`],[`engines`,`Engines`],[`board`,`Board`],[`dev`,`Dev`],[`notifications`,`Notifications`]];function B({onClose:e}){let[t,n]=(0,x.useState)(`general`),{settings:r,loading:i,error:a,reload:o,patch:s}=k(),c=(0,x.useMemo)(()=>z.find(([e])=>e===t)?.[1]??`Settings`,[t]);return(0,E.jsxs)(`section`,{"data-settings-open":!0,className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Settings`}),(0,E.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,E.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[180px_minmax(0,1fr)] overflow-hidden`,children:[(0,E.jsx)(`nav`,{className:`min-h-0 overflow-auto border-r border-line bg-surface/60 p-2`,children:z.map(([e,r])=>(0,E.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,E.jsx)(`main`,{className:`min-h-0 overflow-auto p-4`,children:(0,E.jsxs)(`div`,{className:`mx-auto max-w-4xl`,children:[(0,E.jsx)(`h1`,{className:`mb-3 text-[13px] font-bold uppercase tracking-[0.12em] text-fg`,children:c}),a?(0,E.jsxs)(`div`,{className:`border border-line bg-surface p-4 text-[12px]`,children:[(0,E.jsx)(`p`,{className:`text-subtle`,children:`Couldn't load settings (daemon web transport offline?)`}),(0,E.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,E.jsx)(`div`,{className:`border border-line bg-surface p-4 text-[12px] text-subtle`,children:`Loading settings...`}):t===`general`?(0,E.jsx)(M,{}):t===`engines`?(0,E.jsx)(P,{settings:r,patch:s}):t===`board`?(0,E.jsx)(F,{}):t===`dev`?(0,E.jsx)(I,{settings:r,patch:s}):(0,E.jsx)(L,{})]})})]})]})}export{R as n,B as t};
|