@sma1lboy/kobe 0.7.28 → 0.7.29

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.
@@ -0,0 +1 @@
1
+ import{_ as e,v as t,x as n}from"./tabs-may5sub7.js";import{i as r,t as i}from"./useNavigate-1MDuT9d4.js";import{g as a,h as o,m as s,r as c}from"./index-DfvJr9CT.js";import{g as l,y as u}from"./engines-Dg-YdbV1.js";var d=n(t(),1);function f(e){let t=r({warn:e?.router===void 0}),n=e?.router||t,i=(0,d.useRef)(void 0);return s(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=a(i.current,e.select(t));return i.current=n,n}return e.select(t)}return t})}var p=u(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),m=u(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),h=u(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),g=u(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),_=o();function v(){let{daemonConnected:e,streamConnected:t,hydrated:n}=c(),[r,i]=(0,d.useState)(!1);return!(n&&t&&!e)||r?null:(0,_.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 border-b border-kobe-yellow/40 bg-kobe-yellow/10 px-3 py-1.5 text-[11px] text-kobe-yellow`,children:[(0,_.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-kobe-yellow`}),(0,_.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`The kobe daemon is offline — task data is frozen and mutations will fail until it reconnects (it auto-reconnects; the dashboard recovers on its own). If it doesn't recover, run `,(0,_.jsx)(`code`,{children:`kobe doctor`}),` or`,` `,(0,_.jsx)(`code`,{children:`kobe reset`}),` in a terminal.`]}),(0,_.jsx)(`button`,{type:`button`,onClick:()=>i(!0),className:`shrink-0 text-kobe-yellow/70 hover:text-kobe-yellow`,"aria-label":`dismiss`,children:(0,_.jsx)(l,{size:13,strokeWidth:2})})]})}function y(){let t=i(),n=f({select:e=>e.location.pathname}),{selectedTaskId:r}=e(),a=n.startsWith(`/board`);return(0,_.jsxs)(`div`,{className:`flex items-center overflow-hidden rounded-sm border border-line`,children:[(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{a!==!1&&t(r?{to:`/task/$taskId`,params:{taskId:r}}:{to:`/`})},"aria-pressed":!a,title:`Workspace`,className:`flex items-center gap-1.5 px-2 py-1 text-[11px] transition-colors ${a?`text-subtle hover:text-fg`:`border-line-active bg-inset text-fg`}`,children:[(0,_.jsx)(g,{size:13,strokeWidth:1.8}),`Workspace`]}),(0,_.jsxs)(`button`,{type:`button`,onClick:()=>{a||t({to:`/board`})},"aria-pressed":a,title:`Board`,className:`flex items-center gap-1.5 border-l border-line px-2 py-1 text-[11px] transition-colors ${a?`border-line-active bg-inset text-fg`:`text-subtle hover:text-fg`}`,children:[(0,_.jsx)(h,{size:13,strokeWidth:1.8}),`Board`]})]})}export{p as a,m as i,v as n,h as r,y as t};
@@ -0,0 +1 @@
1
+ import{f as e,v as t,x as n}from"./tabs-may5sub7.js";import{t as r}from"./useNavigate-1MDuT9d4.js";import{a as i,i as a,n as o,t as s}from"./ViewToggle-eyNy-OIE.js";import{h as c,n as ee,r as te}from"./index-DfvJr9CT.js";import{_ as l,d as u,g as ne,s as re,u as d,v as f}from"./engines-Dg-YdbV1.js";import{_ as p,d as m,f as h,g,h as _,i as ie,m as ae,n as oe,p as v,r as y,s as se,t as ce,u as b}from"./IssuePeek-C209KHal.js";var x=n(t(),1),S={query:``,repo:null},C=new Set;function w(e){S={...S,...e};for(let e of C)e()}function T(e){return C.add(e),()=>{C.delete(e)}}function E(){return S}function D(){return(0,x.useSyncExternalStore)(T,E,E)}function O(e){e!==S.query&&w({query:e})}function k(e){e!==S.repo&&w({repo:e})}var A=c();function j({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,A.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,A.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,A.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,A.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 issue in this project`,children:[(0,A.jsx)(f,{size:11,strokeWidth:2}),(0,A.jsx)(`span`,{children:`New issue`})]})]}),(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,A.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=_(t)?t.taskId:void 0;return(0,A.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,A.jsx)(y,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,A.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,A.jsx)(p,{size:10,strokeWidth:1.8}),(0,A.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,A.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish issues to thin this column`]})]})]})}function M({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,A.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,A.jsx)(j,{repo:e.repo,column:a,onNewIssue:a.key===`backlog`?()=>t(e.repo):void 0,onPeekIssue:n,onOpenTask:r,onDeleteIssue:t=>i(e.repo,t)},a.key))})}function N(){let{tasks:t,hydrated:n,daemonConnected:c}=te(),{query:p,repo:_}=D(),y=r(),S=(0,x.useRef)(null),[C,w]=(0,x.useState)(null),[T,E]=(0,x.useState)(new Set),[j,N]=(0,x.useState)(null),[P,F]=(0,x.useState)(!1),[I,L]=(0,x.useState)(null),[R,z]=(0,x.useState)(new Map),[B,V]=(0,x.useState)(null),H=(0,x.useMemo)(()=>b(t).map(e=>e.repo),[t]),{data:U,pending:W,refresh:G}=ie(H),K=(0,x.useMemo)(()=>{let e=[];for(let t of H){let n=U[t];if(!(!n||!n.exists))for(let r of n.issues){let n=R.get(`${t}:${r.id}`);e.push(n&&!r.taskId?{repo:t,issue:{...r,taskId:n.taskId}}:{repo:t,issue:r})}}return e},[H,U,R]);(0,x.useEffect)(()=>{z(e=>{if(e.size===0)return e;let t=new Map(e),n=!1;for(let e of H){let r=U[e];if(!(!r||!r.exists))for(let i of r.issues)i.taskId&&t.delete(`${e}:${i.id}`)&&(n=!0)}return n?t:e})},[H,U]),(0,x.useEffect)(()=>{C&&(K.some(e=>e.repo===C.repo&&e.issue.id===C.id)||w(null))},[K,C]),(0,x.useEffect)(()=>{let e=e=>{if(C||j||B||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target,n=!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable);e.key===`/`&&!n?(e.preventDefault(),S.current?.focus()):e.key===`Escape`&&t===S.current&&p&&(e.preventDefault(),O(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p,C,j,B]);let q=(0,x.useMemo)(()=>{let e=new Map;for(let{repo:t}of K)e.set(t,(e.get(t)??0)+1);let t=[...e.keys()];return t.map(n=>({repo:n,label:g(n,t),count:e.get(n)??0})).sort((e,t)=>e.label.localeCompare(t.label))},[K]);(0,x.useEffect)(()=>{_&&!q.some(e=>e.repo===_)&&k(null)},[q,_]);let J=(0,x.useMemo)(()=>{let e=p.trim().toLowerCase();return K.filter(({repo:t,issue:n})=>_&&t!==_?!1:e?`#${n.id} ${n.title} ${n.body}`.toLowerCase().includes(e):!0).map(({repo:e,issue:t})=>({repo:e,issue:t}))},[K,p,_]),Y=(0,x.useMemo)(()=>ae(J),[J]),X=Y.length===1,Z=(0,x.useMemo)(()=>Y.reduce((e,t)=>e+v(t.columns),0),[Y]),Q=K.length>0,le=!!p||!!_,$=t=>{e(t),ee(`task.setActive`,{taskId:t}).catch(()=>{}),y({to:`/task/$taskId`,params:{taskId:t}})},ue=e=>{E(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},de=async(e,t,n)=>{F(!0);try{return await h(e,t,n),G([e]),!0}catch(e){return u(`update issue`,e),!1}finally{F(!1)}},fe=async(e,t)=>{F(!0);try{await se(e,t.id),G([e]),V(null),C?.repo===e&&C.id===t.id&&w(null)}catch(e){u(`delete issue`,e)}finally{F(!1)}},pe=async(e,t,n,r)=>{if(I===null){L(t.id);try{let{taskId:i}=await m(e,t,n,r);return z(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:i}),r}),i}catch(e){u(`quick start issue`,e);return}finally{L(null)}}};return(0,A.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,A.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-3 border-b border-line bg-surface px-3`,children:[(0,A.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,A.jsx)(s,{}),(0,A.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,A.jsx)(l,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,A.jsx)(`input`,{ref:S,value:p,onChange:e=>O(e.target.value),placeholder:`Filter issues ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),p&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>O(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,A.jsx)(ne,{size:13,strokeWidth:2})})]}),q.length>=2&&(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5 overflow-x-auto`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>k(null),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${_===null?`border-line-active bg-inset text-fg`:`border-line text-subtle hover:text-fg`}`,children:`all`}),q.map(e=>(0,A.jsxs)(`button`,{type:`button`,title:e.repo,onClick:()=>k(_===e.repo?null:e.repo),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${_===e.repo?`border-line-active bg-inset text-fg`:`border-line text-subtle hover:text-fg`}`,children:[e.label,(0,A.jsxs)(`span`,{className:_===e.repo?`text-muted`:`text-subtle`,children:[` `,e.count]})]},e.repo))]}),(0,A.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,A.jsxs)(`span`,{children:[Z,` issue`,Z===1?``:`s`]})})]}),(0,A.jsx)(o,{}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||W&&!Q?(0,A.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&le&&Q?(0,A.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,A.jsx)(`p`,{children:`No issues match.`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>{k(null),O(``)},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&&!c?(0,A.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):Z===0?(0,A.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,A.jsx)(`p`,{children:`No issues yet. Create one to start tracking work.`}),(0,A.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,A.jsx)(`button`,{type:`button`,onClick:()=>y({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`})})]}):X?(0,A.jsx)(M,{board:Y[0],onNewIssue:N,onPeekIssue:e=>w({repo:Y[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>V({repo:e,issue:t})}):(0,A.jsx)(`div`,{className:`flex h-full flex-col gap-4`,children:Y.map(e=>{let t=T.has(e.repo),n=v(e.columns);return(0,A.jsxs)(`section`,{className:`flex flex-col ${t?`shrink-0`:`min-h-0 flex-1`}`,children:[(0,A.jsxs)(`button`,{type:`button`,onClick:()=>ue(e.repo),title:e.repo,className:`mb-2 flex shrink-0 items-center gap-1.5 text-left text-muted transition-colors hover:text-fg`,children:[t?(0,A.jsx)(a,{size:13,strokeWidth:2}):(0,A.jsx)(i,{size:13,strokeWidth:2}),(0,A.jsx)(`span`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-fg`,children:e.label}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n})]}),!t&&(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto`,children:(0,A.jsx)(M,{board:e,onNewIssue:N,onPeekIssue:t=>w({repo:e.repo,id:t.id}),onOpenTask:$,onDeleteIssue:(e,t)=>V({repo:e,issue:t})})})]},e.repo)})})}),(()=>{let e=_??Y[0]?.repo??H[0];return e?(0,A.jsx)(`button`,{type:`button`,onClick:()=>N(e),title:`New issue`,"aria-label":`New issue`,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,A.jsx)(f,{size:22,strokeWidth:2.2})}):null})(),j&&(0,A.jsx)(oe,{repoRoot:j,open:!0,onClose:()=>N(null),onCreated:(e,t)=>{j&&G([j]),d(`success`,t?`Issue #${e.id} created — starting its task`:`Issue #${e.id} created`)}}),(()=>{if(!C)return null;let e=K.find(e=>e.repo===C.repo&&e.issue.id===C.id);return e?(0,A.jsx)(ce,{issue:e.issue,repoRoot:e.repo,busy:P,starting:I===e.issue.id,onClose:()=>w(null),onSave:t=>de(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,watch:r})=>{let i=await pe(e.repo,e.issue,t,n);r&&i?(w(null),$(i)):w(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;w(null),t&&$(t)}:void 0},`${e.repo}:${e.issue.id}`):null})(),B&&(0,A.jsx)(re,{title:`Delete issue`,body:`Delete issue #${B.issue.id}: "${B.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:P,onConfirm:()=>void fe(B.repo,B.issue),onCancel:()=>V(null)})]})}var P=N;export{P as component};
@@ -0,0 +1 @@
1
+ import{v as e,x as t}from"./tabs-may5sub7.js";import{h as n}from"./index-DfvJr9CT.js";var r=t(e()),i=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),o=e=>{let t=a(e);return t.charAt(0).toUpperCase()+t.slice(1)},s=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),c=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},l={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},u=(0,r.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:a=``,children:o,iconNode:u,...d},f)=>(0,r.createElement)(`svg`,{ref:f,...l,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:s(`lucide`,a),...!o&&!c(d)&&{"aria-hidden":`true`},...d},[...u.map(([e,t])=>(0,r.createElement)(e,t)),...Array.isArray(o)?o:[o]])),d=(e,t)=>{let n=(0,r.forwardRef)(({className:n,...a},c)=>(0,r.createElement)(u,{ref:c,iconNode:t,className:s(`lucide-${i(o(e))}`,`lucide-${e}`,n),...a}));return n.displayName=o(e),n},f=d(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),p=d(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),m=d(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);async function h(e){let t=await e.json();if(!e.ok)throw Error(t.error??`request failed (${e.status})`);return t}async function g(){return h(await fetch(`/api/settings`))}async function _(){try{let e=await g();return typeof e.defaultEngine==`string`&&e.defaultEngine.trim()?e.defaultEngine.trim():null}catch{return null}}async function v(e){return h(await fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}))}var y=5e3,b=[],x=0,S=new Set;function C(){for(let e of S)e()}function w(e,t){x+=1;let n={id:x,kind:e,message:t};b=[...b.slice(-3),n],C(),window.setTimeout(()=>T(n.id),y)}function T(e){b.some(t=>t.id===e)&&(b=b.filter(t=>t.id!==e),C())}function E(e,t){return`${e}: ${t instanceof Error?t.message:String(t)}`}function D(e,t){w(`error`,E(e,t))}function O(){return(0,r.useSyncExternalStore)(e=>(S.add(e),()=>S.delete(e)),()=>b,()=>b)}var k=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function A(e,t=!0){(0,r.useEffect)(()=>{if(!t)return;let n=e.current;if(!n)return;let r=document.activeElement,i=e=>{if(e.key!==`Tab`)return;let t=Array.from(n.querySelectorAll(k)).filter(e=>e.offsetParent!==null||e===document.activeElement);if(t.length===0)return;let r=t[0],i=t[t.length-1],a=document.activeElement;e.shiftKey?(a===r||!n.contains(a))&&(e.preventDefault(),i.focus()):(a===i||!n.contains(a))&&(e.preventDefault(),r.focus())};return n.addEventListener(`keydown`,i),()=>{n.removeEventListener(`keydown`,i),r?.focus?.()}},[e,t])}var j=n();function M({title:e,body:t,confirmLabel:n,danger:i=!1,busy:a=!1,onConfirm:o,onCancel:s}){let c=(0,r.useRef)(null),l=(0,r.useRef)(null);return A(l),(0,r.useEffect)(()=>{c.current?.focus();let e=e=>{e.key===`Escape`&&s()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s]),(0,j.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:s,onKeyDown:()=>{},role:`presentation`,children:(0,j.jsxs)(`div`,{ref:l,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,j.jsx)(`div`,{className:`border-b border-line px-3 py-2 text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:e}),(0,j.jsx)(`p`,{className:`px-3 py-3 text-[12px] leading-relaxed text-muted`,children:t}),(0,j.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-line px-3 py-2`,children:[(0,j.jsx)(`button`,{type:`button`,onClick:s,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,j.jsx)(`button`,{ref:c,type:`button`,onClick:o,disabled:a,className:`border px-3 py-1 text-[11px] transition-colors disabled:opacity-40 ${i?`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:a?`Working…`:n})]})]})})}function N(e){let t=e?.lifecycle;if(!e||!t||t===`unknown`)return null;let n=e.checkState,r=t===`merged`?`text-kobe-violet`:t===`closed`||n===`failing`?`text-kobe-red`:n===`passing`?`text-kobe-green`:n===`pending`?`text-kobe-yellow`:`text-kobe-blue`;return{label:e.number?`PR #${e.number}`:`PR`,cls:r,title:`${t}${n&&n!==`none`?` · ${n}`:``}`}}var P=`after:pointer-events-none after:absolute after:right-0 after:bottom-full after:z-10 after:mb-1 after:hidden after:whitespace-nowrap after:border after:border-line after:bg-menu after:px-1.5 after:py-0.5 after:text-[10px] after:text-fg after:content-[attr(data-tip)] hover:after:block`;function F({counts:e}){return!e||e.added===0&&e.deleted===0?null:(0,j.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,j.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e.added]}),` `,(0,j.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,e.deleted]})]})}function I({pr:e}){let t=N(e);return t?(0,j.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] ${t.cls}`,title:t.title,children:t.label}):null}function L({label:e}){return e?(0,j.jsx)(`span`,{className:`shrink-0 rounded-sm border border-line px-1 font-mono text-[9px] uppercase tracking-wide text-subtle`,title:`engine: ${e}`,children:e}):null}var R=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}],z=!1,B=new Set;function V(){z||(z=!0,fetch(`/api/engines`).then(async e=>{if(!e.ok)return;let t=await e.json();if(!(!Array.isArray(t.engines)||t.engines.length===0)){R=t.engines.filter(e=>typeof e?.id==`string`&&typeof e?.label==`string`).map(e=>({id:e.id,label:e.label,...Array.isArray(e.effortLevels)&&e.effortLevels.every(e=>typeof e==`string`)?{effortLevels:e.effortLevels}:{}}));for(let e of B)e()}}).catch(()=>{}))}function H(){return V(),(0,r.useSyncExternalStore)(e=>(B.add(e),()=>B.delete(e)),()=>R,()=>R)}function U(e,t){let n=t||`claude`;return e.find(e=>e.id===n)?.label??n}export{p as _,I as a,A as c,D as d,O as f,m as g,v as h,L as i,T as l,g as m,H as n,P as o,_ as p,F as r,M as s,U as t,w as u,f as v,d as y};