@sma1lboy/kobe 0.7.32 → 0.7.34
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/README.md +11 -8
- package/dist/cli/index.js +232 -29341
- package/dist/web-ui/assets/AppShell-HiyATJse.css +1 -0
- package/dist/web-ui/assets/AppShell-bXCEh8xj.js +5 -0
- package/dist/web-ui/assets/Board-BFKPAdwD.js +1 -0
- package/dist/web-ui/assets/BoardPeek-oIuozKHB.js +2 -0
- package/dist/web-ui/assets/{ChatTerminal-WIjnp057.js → ChatTerminal-BVTnkMgh.js} +3 -3
- package/dist/web-ui/assets/ChatTranscript-DCIZ-_n3.js +1 -0
- package/dist/web-ui/assets/ConfirmDialog-BXm-RBo_.js +1 -0
- package/dist/web-ui/assets/IssueIntakePanel-DGdEQbqO.js +1 -0
- package/dist/web-ui/assets/IssuePeek-CsEbIvuC.js +1 -0
- package/dist/web-ui/assets/IssuesPage-2GreBreD.js +1 -0
- package/dist/web-ui/assets/SettingsPage-xk_elIU4.js +2 -0
- package/dist/web-ui/assets/SlideOver-CtnKrIUW.js +179 -0
- package/dist/web-ui/assets/ViewToggle-DFv5F2ik.js +1 -0
- package/dist/web-ui/assets/WorkspaceTabs-CDvsI8Rr.js +3 -0
- package/dist/web-ui/assets/WorkspaceTabs-DLzL-Tad.css +1 -0
- package/dist/web-ui/assets/board-Cm72w4Rb.js +1 -0
- package/dist/web-ui/assets/createLucideIcon-BoVlWivB.js +1 -0
- package/dist/web-ui/assets/external-link-C51-09OW.js +1 -0
- package/dist/web-ui/assets/index-kpGUWsyu.js +10 -0
- package/dist/web-ui/assets/index-oHeKzXZP.css +1 -0
- package/dist/web-ui/assets/issues-D5iUv4jG.js +1 -0
- package/dist/web-ui/assets/issues-qDOB1RY_.js +3 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-700-normal-BYuf6tUa.woff2 +0 -0
- package/dist/web-ui/assets/jetbrains-mono-latin-700-normal-D3wTyLJW.woff +0 -0
- package/dist/web-ui/assets/lazy-issue-panels-DDhzNFSU.js +6 -0
- package/dist/web-ui/assets/rotate-cw-pZvvI6Ao.js +1 -0
- package/dist/web-ui/assets/routes-rLcaWakr.js +1 -0
- package/dist/web-ui/assets/settings-B_VT_pPR.js +1 -0
- package/dist/web-ui/assets/store-C4ms6xvg.js +2 -0
- package/dist/web-ui/assets/{tabs-CmaDBSUQ.js → tabs-Db1r1FTh.js} +1 -1
- package/dist/web-ui/assets/task._taskId-Bp5WJKpu.js +1 -0
- package/dist/web-ui/assets/terminal-Ckm9XXat.js +1 -0
- package/dist/web-ui/assets/terminal-DV9S9xMa.js +1 -0
- package/dist/web-ui/assets/text-match-C3BRtNXy.js +1 -0
- package/dist/web-ui/assets/toast-CfAxitbT.js +1 -0
- package/dist/web-ui/assets/web-transport-BS7imUMS.js +1 -0
- package/dist/web-ui/index.html +8 -5
- package/dist/web-ui/origin-policy.mjs +41 -0
- package/dist/web-ui/pty-server.mjs +38 -181
- package/dist/web-ui/pty-session-lifecycle.mjs +177 -0
- package/package.json +5 -3
- package/dist/web-ui/assets/AppShell-CT-Wueej.js +0 -8
- package/dist/web-ui/assets/AppShell-NZ5KYJKh.css +0 -1
- package/dist/web-ui/assets/IssuePeek-DS8gwn8L.js +0 -185
- package/dist/web-ui/assets/ViewToggle-BM9Leqct.js +0 -1
- package/dist/web-ui/assets/board-BicE8Mfe.js +0 -1
- package/dist/web-ui/assets/index-B9eBRSoV.css +0 -2
- package/dist/web-ui/assets/index-BsVnxIKo.js +0 -10
- package/dist/web-ui/assets/issues-Djlu09em.js +0 -1
- package/dist/web-ui/assets/routes-BmyEyMrf.js +0 -1
- package/dist/web-ui/assets/task._taskId-CmRCr8jG.js +0 -1
- package/dist/web-ui/assets/terminal-BUdn99hL.js +0 -1
- package/dist/web-ui/assets/terminal-CapzGZr6.js +0 -1
- package/dist/web-ui/assets/useNavigate-CXvSccc8.js +0 -1
- package/dist/web-ui/assets/vendor-Bfrh7rZ5.js +0 -1
- package/dist/web-ui/fonts/JetBrainsMonoNerdFontMono-Regular.ttf +0 -0
- /package/dist/web-ui/assets/{IssuePeek-B4sEOPyN.css → SlideOver-B4sEOPyN.css} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,c as t,y as n}from"./tabs-CmaDBSUQ.js";import{t as r}from"./useNavigate-CXvSccc8.js";import{g as i,r as a}from"./index-BsVnxIKo.js";import{C as ee,S as o,d as s,h as c,w as l,x as u}from"./vendor-Bfrh7rZ5.js";import{a as d,c as f,d as p,f as m,h,i as g,l as _,n as v,o as y,p as te,r as ne,s as re,t as b,u as x}from"./IssuePeek-DS8gwn8L.js";var S=l(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),C=e(n(),1),w=i();function T(){let{tasks:e,hydrated:n}=a(),i=r(),[l,T]=(0,C.useState)([]);(0,C.useEffect)(()=>{let e=!1;return f().then(t=>{e||T(t)}).catch(e=>c(`load projects`,e)),()=>{e=!0}},[]);let E=(0,C.useMemo)(()=>p(e,l),[e,l]),[D,O]=(0,C.useState)(null);(0,C.useEffect)(()=>{if(E.length===0){D!==null&&O(null);return}(!D||!E.some(e=>e.repo===D))&&O(E[0]?.repo??null)},[E,D]);let{data:k,failed:A,pending:j}=g((0,C.useMemo)(()=>D?[D]:[],[D])),M=D?k[D]:void 0,[N,P]=(0,C.useState)(``),[F,I]=(0,C.useState)(!1),[L,R]=(0,C.useState)(null),[z,B]=(0,C.useState)(null),[V,H]=(0,C.useState)(!1),[U,W]=(0,C.useState)(!1),[G,K]=(0,C.useState)(!1),q=M?.issues??[],J=(0,C.useMemo)(()=>_(q,{query:N}),[q,N]),Y=(0,C.useMemo)(()=>x(J),[J]),X=J.length,Z=L==null?null:q.find(e=>e.id===L),Q=z==null?null:q.find(e=>e.id===z);(0,C.useEffect)(()=>{L!=null&&!q.some(e=>e.id===L)&&R(null),z!=null&&!q.some(e=>e.id===z)&&B(null)},[q,L,z]);let $=e=>{i({to:`/task/$taskId`,params:{taskId:e}})};return(0,w.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,w.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-3 border-b border-line bg-surface px-3`,children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>i({to:`/`}),className:`flex items-center gap-1.5 text-muted transition-colors hover:text-fg`,title:`Back to workspace`,children:[(0,w.jsx)(S,{size:15,strokeWidth:1.8}),(0,w.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,w.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Issues`}),(0,w.jsxs)(`label`,{className:`flex h-7 items-center gap-1.5 border border-line bg-bg px-2 text-muted focus-within:border-line-active`,children:[(0,w.jsx)(o,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,w.jsx)(`input`,{value:N,onChange:e=>P(e.target.value),placeholder:`Filter issues ( #id, title, body )`,className:`w-52 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),N&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>P(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,w.jsx)(u,{size:13,strokeWidth:2})})]}),E.length>0&&(0,w.jsxs)(`label`,{className:`flex h-7 min-w-0 max-w-[24rem] items-center gap-1.5 border border-line bg-bg px-2 text-muted focus-within:border-line-active`,children:[(0,w.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,w.jsx)(`select`,{value:D??``,onChange:e=>O(e.target.value),title:D??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:E.map(e=>(0,w.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,e.count,` · `,e.repo]},e.repo))})]}),(0,w.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:[(0,w.jsxs)(`span`,{children:[X,` issue`,X===1?``:`s`]}),(0,w.jsxs)(`button`,{type:`button`,disabled:!D,onClick:()=>I(!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 issue`,children:[(0,w.jsx)(ee,{size:13,strokeWidth:1.8}),`New issue`]})]})]}),(0,w.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:D?!n||j&&!M?(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):D&&A[D]?(0,w.jsx)(`p`,{className:`text-[12px] text-kobe-red`,children:A[D]}):X===0?(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:N?`No issues match your filter.`:`No issues yet. Capture one with New issue.`}):(0,w.jsx)(`div`,{className:`flex h-full min-h-0 gap-4`,children:d.map(e=>{let t=y[e],n=Y[e];return(0,w.jsxs)(`section`,{className:`flex h-full min-h-0 w-72 shrink-0 flex-col`,children:[(0,w.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center gap-2`,children:[(0,w.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n.length})]}),(0,w.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-0.5`,children:n.map(e=>(0,w.jsx)(ne,{issue:e,onOpen:()=>R(e.id),onDelete:()=>B(e.id)},e.id))})]},e)})}):(0,w.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`No projects yet. Create a task from the workspace to track issues against its repo.`})}),D&&(0,w.jsx)(v,{repoRoot:D,open:F,onClose:()=>I(!1),onCreated:(e,t)=>{t&&e.taskId&&$(e.taskId)}}),D&&Z&&(0,w.jsx)(b,{issue:Z,repoRoot:D,busy:V,starting:U,onClose:()=>R(null),onSave:async e=>{if(!D||L==null)return!1;H(!0);try{return await h(D,L,{title:e.title.trim(),body:e.body}),!0}catch(e){return c(`save issue`,e),!1}finally{H(!1)}},onStart:e=>{!D||!Z||(W(!0),te(D,Z,e.vendor,e.effort).then(({taskId:t})=>{R(null),e.watch&&$(t)}).catch(e=>c(`start issue`,e)).finally(()=>W(!1)))},onOpenSession:Z.taskId?()=>{let e=Z.taskId;e&&(t(e),$(e))}:void 0,onPromptMerge:Z.taskId?()=>{let e=Z.taskId;e&&m(e,Z).catch(e=>c(`prompt issue merge`,e))}:void 0}),Q&&(0,w.jsx)(s,{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:G,onConfirm:()=>{!D||z==null||(K(!0),re(D,z).then(()=>B(null)).catch(e=>c(`delete issue`,e)).finally(()=>K(!1)))},onCancel:()=>B(null)})]})}var E=T;export{E as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./AppShell-CT-Wueej.js";var t=e;export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,_ as t,f as n,y as r}from"./tabs-CmaDBSUQ.js";import{g as i,n as a,t as o}from"./index-BsVnxIKo.js";import{t as s}from"./AppShell-CT-Wueej.js";var c=e(r()),l=i();function u(){let{taskId:e}=o.useParams(),{selectedTaskId:r}=t();return(0,c.useEffect)(()=>{!e||e===r||(n(e),a(`task.setActive`,{taskId:e}).catch(()=>{}))},[e,r]),(0,l.jsx)(s,{})}export{u as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e,r as t,t as n}from"./terminal-CapzGZr6.js";export{n as closePtyTab,e as ptyUrl,t as sendPtyText};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function e(){let e=location.protocol===`https:`?`wss`:`ws`,t=location.hostname||`localhost`,n=Number.parseInt(location.port||`5173`,10);return`${e}://${t}:${Number.isFinite(n)?n+2:5175}`}function t(){let e=location.protocol===`https:`?`https`:`http`,t=location.hostname||`localhost`,n=Number.parseInt(location.port||`5173`,10);return`${e}://${t}:${Number.isFinite(n)?n+2:5175}`}function n(t,n,r,i,a){let o=new URLSearchParams({tab:t,taskId:n,mode:r,cols:String(i),rows:String(a)});return`${e()}/pty?${o.toString()}`}async function r(e){try{await fetch(`${t()}/pty/close`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({tab:e})})}catch{}}async function i(e,n,r){let i=await fetch(`${t()}/pty/send`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({tab:e,taskId:n,text:r})}),a={};try{a=await i.json()}catch{if(i.status===404)throw Error("the PTY server doesn't know /pty/send — restart `kobe web` (the sidecar doesn't hot-reload)")}if(!i.ok||!a.sent)throw Error(a.error??`send failed (${i.status})`);return{spawned:a.spawned===!0}}export{n,i as r,r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,b as t,y as n}from"./tabs-CmaDBSUQ.js";var r=e(n(),1),i=r.use,a=typeof window<`u`?r.useLayoutEffect:r.useEffect;function o(e){let t=r.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function s(e,t,n={},i={}){r.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!=`function`)return;let r=new IntersectionObserver(([e])=>{t(e)},n);return r.observe(e.current),()=>{r.disconnect()}},[t,n,i.disabled,e])}function c(e){let t=r.useRef(null);return r.useImperativeHandle(e,()=>t.current,[]),t}var l=r.createContext(null);function u(e){return r.useContext(l)}var d=t((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),f=t(((e,t)=>{t.exports=d()})),p=t((e=>{var t=n(),r=f();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),m=t(((e,t)=>{t.exports=p()}));function h(e){let t=u();return r.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}export{l as a,s as c,u as i,a as l,m as n,i as o,f as r,c as s,h as t,o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,y as t}from"./tabs-CmaDBSUQ.js";import{g as n}from"./index-BsVnxIKo.js";var r=e(t()),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`}]]);function h(e,t){let n=t.trim().toLowerCase();return n?e.toLowerCase().includes(n):!0}async function g(e){let t=await e.json();if(!e.ok)throw Error(t.error??`request failed (${e.status})`);return t}async function _(){return g(await fetch(`/api/settings`))}async function v(){try{let e=await _();return typeof e.defaultEngine==`string`&&e.defaultEngine.trim()?e.defaultEngine.trim():null}catch{return null}}async function y(e){return g(await fetch(`/api/settings`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify(e)}))}var b=5e3,x=[],S=0,C=new Set;function w(){for(let e of C)e()}function T(e,t){S+=1;let n={id:S,kind:e,message:t};x=[...x.slice(-3),n],w(),window.setTimeout(()=>E(n.id),b)}function E(e){x.some(t=>t.id===e)&&(x=x.filter(t=>t.id!==e),w())}function D(e,t){return`${e}: ${t instanceof Error?t.message:String(t)}`}function O(e,t){T(`error`,D(e,t))}function k(){return(0,r.useSyncExternalStore)(e=>(C.add(e),()=>C.delete(e)),()=>x,()=>x)}var A=[`a[href]`,`button:not([disabled])`,`textarea:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`,`);function j(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(A)).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 M=n();function N({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 j(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,M.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:s,onKeyDown:()=>{},role:`presentation`,children:(0,M.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,M.jsx)(`div`,{className:`border-b border-line px-3 py-2 text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:e}),(0,M.jsx)(`p`,{className:`px-3 py-3 text-[12px] leading-relaxed text-muted`,children:t}),(0,M.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-line px-3 py-2`,children:[(0,M.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,M.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 P(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 F=`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 I({counts:e}){return!e||e.added===0&&e.deleted===0?null:(0,M.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,M.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e.added]}),` `,(0,M.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,e.deleted]})]})}function L({pr:e}){let t=P(e);return t?(0,M.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] ${t.cls}`,title:t.title,children:t.label}):null}function R({label:e}){return e?(0,M.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 z=[{id:`claude`,label:`Claude`},{id:`codex`,label:`Codex`}],B=!1,V=new Set;function H(){B||(B=!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)){z=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 V)e()}}).catch(()=>{}))}function U(){return H(),(0,r.useSyncExternalStore)(e=>(V.add(e),()=>V.delete(e)),()=>z,()=>z)}var W=`claude`;function G(e){return e||`claude`}function K(e,t){let n=G(t);return e.find(e=>e.id===n)?.label??n}function q(e){let t=new Set;for(let n of e)n.archived||n.kind===`main`||t.add(G(n.vendor));return[...t]}function J(e){return q(e).length>1}function Y(e,t,n){return n&&t.kind!==`main`?K(e,t.vendor):null}export{f as C,p as S,v as _,G as a,h as b,R as c,N as d,j as f,k as g,O as h,Y as i,L as l,T as m,K as n,U as o,E as p,J as r,I as s,W as t,F as u,_ as v,d as w,m as x,y};
|
|
Binary file
|
|
File without changes
|