@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n,t as r}from"./createLucideIcon-BoVlWivB.js";import{n as i}from"./store-C4ms6xvg.js";import{i as a}from"./terminal-Ckm9XXat.js";import{t as o}from"./rotate-cw-pZvvI6Ao.js";import{h as s,p as c}from"./index-kpGUWsyu.js";import{t as l}from"./web-transport-BS7imUMS.js";var u=r(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),d=r(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),f=e(t(),1);function p(e,t=Date.now()){if(!e)return``;let n=Math.max(0,Math.round((t-e)/1e3));if(n<60)return`just now`;let r=Math.round(n/60);if(r<60)return`${r}m ago`;let i=Math.round(r/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function m(e,t=Date.now()){let n=Date.parse(e);if(!Number.isFinite(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<45)return`now`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);if(a<24)return`${a}h`;let o=Math.round(a/24);if(o<7)return`${o}d`;let s=Math.round(o/7);if(s<5)return`${s}w`;let c=Math.round(o/30);return c<12?`${c}mo`:`${Math.round(o/365)}y`}function h(e,t){return a.get(`/api/history/sessions`,{query:{worktreePath:e,vendor:t},label:`/api/history/sessions`})}async function g(e,t){let{messages:n}=await a.get(`/api/history/messages`,{query:{vendor:e,sessionId:t},label:`/api/history/messages`});return n}function _(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 v(e){return e>=1e6?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function y(e,t,n,r=80){return t-e-n<r}var b=90;function x(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>b?`${n.slice(0,b-1)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>b?`${t.slice(0,b-1)}…`:t}catch{return``}}function S(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function C(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${x(e)}`;case`tool_result`:return S(e.output)}}function w(e){return e.blocks.map(C).join(` `)}function T(e,t){return!(t&&e.type===`tool_call`)}function E(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`?!t:!1)}var D=n(),O=2500,k=600;function A({call:e,result:t}){let[n,r]=(0,f.useState)(!1),i=x(e),a=t?S(t.output):``,o=!n&&a.length>k,s=o?`${a.slice(0,k)}…`:a,c=a.length>0;return(0,D.jsxs)(`div`,{className:`my-1`,children:[(0,D.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,D.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,D.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,D.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,D.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,D.jsx)(u,{size:12}):(0,D.jsx)(d,{size:12})})]}),(n||!n&&a&&a.length<=k)&&a&&(0,D.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,D.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 j({text:e}){let[t,n]=(0,f.useState)(!1);return(0,D.jsxs)(`div`,{className:`my-1`,children:[(0,D.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,D.jsx)(`span`,{children:`✱`}),(0,D.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,D.jsx)(u,{size:11}):(0,D.jsx)(d,{size:11})]}),t&&(0,D.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 M({message:e,results:t,hideTools:n}){let r=[],i=m(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!T(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,D.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,D.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,D.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,D.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,D.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,D.jsx)(A,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,D.jsx)(j,{text:o.text},c));return}}),r.length===0?null:(0,D.jsx)(D.Fragment,{children:r})}function N({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=i(),a=l({daemonConnected:n,streamConnected:r}),[u,d]=(0,f.useState)([]),[p,m]=(0,f.useState)(null),[b,x]=(0,f.useState)(!0),[S,C]=(0,f.useState)([]),[T,k]=(0,f.useState)(``),[A,j]=(0,f.useState)(!1),[N,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(!1),[L,R]=(0,f.useState)(!0),z=(0,f.useRef)(-1),B=(0,f.useRef)(null),V=(0,f.useRef)(!0),H=(0,f.useRef)(0),U=(0,f.useRef)(!0),W=(0,f.useRef)(null);(0,f.useEffect)(()=>{U.current=b,W.current=p},[b,p]);let G=(0,f.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;d(i.sessions),C(s),m(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,f.useRef)(G);(0,f.useEffect)(()=>{K.current=G},[G]),(0,f.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),m(null),k(``),j(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},O);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===u.at(-1);U.current=n,W.current=e,x(n),m(e);let r=++H.current;g(t,e).then(e=>{r===H.current&&C(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,f.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=y(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,f.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,f.useMemo)(()=>_(S),[S]),Q=(0,f.useMemo)(()=>S.map(e=>w(e).toLowerCase()),[S]),$=(0,f.useMemo)(()=>{let e=T.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&E(t,A))},[S,Q,T,A]);return e?(0,D.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,D.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,D.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),u.length>0&&(0,D.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:u.map((e,t)=>(0,D.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===u.length-1?` (latest)`:``]},e))}),(0,D.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,D.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,v(Z.contextTokens)]}),Z.outputTokens>0&&(0,D.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,v(Z.inputTokens),` ⇣`,v(Z.outputTokens)]}),(0,D.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,D.jsx)(o,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,D.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,D.jsx)(s,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,D.jsx)(`input`,{value:T,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Escape`&&T&&(e.preventDefault(),k(``))},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`}),T.trim()&&(0,D.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),T.trim()&&(0,D.jsx)(`button`,{type:`button`,onClick:()=>k(``),className:`shrink-0 text-subtle transition-colors hover:text-fg`,"aria-label":`clear transcript search`,title:`Clear search`,children:(0,D.jsx)(c,{size:12,strokeWidth:2})}),(0,D.jsx)(`button`,{type:`button`,onClick:()=>j(e=>!e),className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${A?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,title:A?`Show tool calls`:`Hide tool calls — read just the conversation`,children:A?`tools off`:`tools`})]}),(0,D.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,D.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?a?(0,D.jsx)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:`The kobe daemon is offline — the transcript will reappear once it reconnects.`}):(0,D.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,D.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,D.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,D.jsx)(o,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,D.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,D.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,T.trim(),`”.`]}):$.map((e,t)=>(0,D.jsx)(M,{message:e,results:X,hideTools:A},`${e.sessionId}-${t}`)):(0,D.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,D.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,D.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{m as n,p as r,N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n}from"./createLucideIcon-BoVlWivB.js";import{E as r,T as i,u as a}from"./index-kpGUWsyu.js";function o(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 s=n(),c=`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 l({counts:e}){return!e||e.added===0&&e.deleted===0?null:(0,s.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,s.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e.added]}),` `,(0,s.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,e.deleted]})]})}function u({pr:e}){let t=o(e);return t?(0,s.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] ${t.cls}`,title:t.title,children:t.label}):null}function d({label:e}){return e?(0,s.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}function f({label:e,tone:t,onClick:n}){return(0,s.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 p(){if(!r())return null;let e=i();return(0,s.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,s.jsx)(`legend`,{className:`sr-only`,children:`Window controls`}),(0,s.jsx)(f,{label:`Close window`,tone:`close`,onClick:()=>e?.close()}),(0,s.jsx)(f,{label:`Minimize window`,tone:`minimize`,onClick:()=>e?.minimize()}),(0,s.jsx)(f,{label:`Zoom window`,tone:`zoom`,onClick:()=>e?.toggleMaximize()})]})}var m=e(t(),1);function h({title:e,body:t,confirmLabel:n,danger:r=!1,busy:i=!1,onConfirm:o,onCancel:c}){let l=(0,m.useRef)(null),u=(0,m.useRef)(null);return a(u),(0,m.useEffect)(()=>{l.current?.focus();let e=e=>{e.key===`Escape`&&c()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c]),(0,s.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:c,onKeyDown:()=>{},role:`presentation`,children:(0,s.jsxs)(`div`,{ref:u,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,s.jsx)(`div`,{className:`border-b border-line px-3 py-2 text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:e}),(0,s.jsx)(`p`,{className:`px-3 py-3 text-[12px] leading-relaxed text-muted`,children:t}),(0,s.jsxs)(`div`,{className:`flex justify-end gap-2 border-t border-line px-3 py-2`,children:[(0,s.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,s.jsx)(`button`,{ref:l,type:`button`,onClick:o,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{u as a,d as i,p as n,c as o,l as r,h as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n}from"./createLucideIcon-BoVlWivB.js";import{f as r,i}from"./issues-qDOB1RY_.js";import{n as a,r as o,t as s}from"./SlideOver-CtnKrIUW.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{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n,t as r}from"./createLucideIcon-BoVlWivB.js";import{t as i}from"./external-link-C51-09OW.js";import{n as a,r as o}from"./issues-qDOB1RY_.js";import{n as s,r as c,t as l}from"./SlideOver-CtnKrIUW.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();function m({issue:e,repoRoot:t,busy:n,starting:r,onClose:m,onSave:h,onStart:g,onOpenSession:_,onPromptMerge:v}){let[y,b]=(0,f.useState)(e.title),[x,S]=(0,f.useState)(e.body),[C,w]=(0,f.useState)(void 0),[T,E]=(0,f.useState)(void 0),[D,O]=(0,f.useState)(null),k=!!e.taskId,A=o(e.status)&&!k,j=y!==e.title||x!==e.body,M=j&&y.trim().length>0&&!n,N=a[e.status];return(0,p.jsx)(l,{open:!0,wide:!0,onClose:m,title:(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})]}),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:y,onChange:e=>b(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:x,onChange:S,repoRoot:t,placeholder:`context, constraints, acceptance criteria — paste a screenshot to attach it`},e.id)]}),D&&(0,p.jsx)(`p`,{className:`text-[11px] text-kobe-red`,role:`alert`,children:D}),(0,p.jsx)(`div`,{className:`flex justify-end`,children:(0,p.jsx)(`button`,{type:`button`,disabled:!M,onClick:()=>{M&&(O(null),h({title:y,body:x}).catch(e=>{O(e instanceof Error?e.message:`failed to save issue`)}))},title:j?`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] ${N.accent}`,children:N.title}),(0,p.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`created `,e.created]})]}),k&&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:C,effort:T,disabled:!A,onChange:e=>{w(e.vendor),E(e.effort)}})]}),(0,p.jsx)(`div`,{className:`mt-auto flex flex-col gap-2 border-t border-line pt-3`,children:k?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>_?.(),disabled:!_,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:()=>v?.(),disabled:!v||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`})]}):A?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`button`,{type:`button`,disabled:r,onClick:()=>g({vendor:C,effort:T,watch:!1}),title:`Spawn a kobe task 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:()=>g({vendor:C,effort:T,watch:!0}),title:`Spawn a kobe task session and open it`,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{m as IssuePeek};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{S as e,c as t,y as n}from"./tabs-Db1r1FTh.js";import{a as r,r as i}from"./toast-CfAxitbT.js";import{d as a,t as o}from"./createLucideIcon-BoVlWivB.js";import{n as ee}from"./store-C4ms6xvg.js";import{a as te,i as ne,n as re,r as s,t as c}from"./lazy-issue-panels-DDhzNFSU.js";import{g as l,h as u,p as d}from"./index-kpGUWsyu.js";import{n as f,t as p}from"./ConfirmDialog-BXm-RBo_.js";import{a as m,c as h,d as g,f as _,l as v,m as y,n as b,s as x,t as S,u as C}from"./issues-qDOB1RY_.js";var ie=o(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),w=e(n(),1),T=a();function E(){let{tasks:e,hydrated:n}=ee(),a=r(),[o,E]=(0,w.useState)([]);(0,w.useEffect)(()=>{let e=!1;return x().then(t=>{e||E(t)}).catch(e=>i(`load projects`,e)),()=>{e=!0}},[]);let D=(0,w.useMemo)(()=>C(e,o),[e,o]),[O,k]=(0,w.useState)(null);(0,w.useEffect)(()=>{if(D.length===0){O!==null&&k(null);return}(!O||!D.some(e=>e.repo===O))&&k(D[0]?.repo??null)},[D,O]);let{data:A,failed:j,pending:M}=te((0,w.useMemo)(()=>O?[O]:[],[O])),N=O?A[O]:void 0,[P,F]=(0,w.useState)(``),[I,L]=(0,w.useState)(!1),[R,z]=(0,w.useState)(null),[B,V]=(0,w.useState)(null),[H,U]=(0,w.useState)(!1),[W,G]=(0,w.useState)(!1),[K,q]=(0,w.useState)(!1),J=N?.issues??[],Y=(0,w.useMemo)(()=>h(J,{query:P}),[J,P]),ae=(0,w.useMemo)(()=>v(Y),[Y]),X=Y.length,Z=R==null?null:J.find(e=>e.id===R),Q=B==null?null:J.find(e=>e.id===B);(0,w.useEffect)(()=>{R!=null&&!J.some(e=>e.id===R)&&z(null),B!=null&&!J.some(e=>e.id===B)&&V(null)},[J,R,B]);let $=e=>{a({to:`/task/$taskId`,params:{taskId:e}})};return(0,T.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,T.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,T.jsx)(f,{}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>a({to:`/`}),className:`flex items-center gap-1.5 text-muted transition-colors hover:text-fg`,title:`Back to workspace`,children:[(0,T.jsx)(ie,{size:15,strokeWidth:1.8}),(0,T.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,T.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Issues`}),(0,T.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,T.jsx)(u,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,T.jsx)(`input`,{value:P,onChange:e=>F(e.target.value),placeholder:`Filter stories ( #id, title, body )`,className:`w-52 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),P&&(0,T.jsx)(`button`,{type:`button`,onClick:()=>F(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,T.jsx)(d,{size:13,strokeWidth:2})})]}),D.length>0&&(0,T.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,T.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,T.jsx)(`select`,{value:O??``,onChange:e=>k(e.target.value),title:O??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:D.map(e=>(0,T.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,e.count,` · `,e.repo]},e.repo))})]}),(0,T.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:[(0,T.jsxs)(`span`,{children:[X,` stor`,X===1?`y`:`ies`]}),(0,T.jsxs)(`button`,{type:`button`,disabled:!O,onClick:()=>L(!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,T.jsx)(l,{size:13,strokeWidth:1.8}),`New story`]})]})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:O?!n||M&&!N?(0,T.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):O&&j[O]?(0,T.jsx)(`p`,{className:`text-[12px] text-kobe-red`,children:j[O]}):X===0?(0,T.jsx)(`p`,{className:`text-[12px] text-subtle`,children:P?`No stories match your filter.`:`No stories yet. Capture one with New story.`}):(0,T.jsx)(`div`,{className:`flex h-full min-h-0 gap-4`,children:S.map(e=>{let t=b[e],n=ae[e];return(0,T.jsxs)(`section`,{className:`flex h-full min-h-0 w-72 shrink-0 flex-col`,children:[(0,T.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center gap-2`,children:[(0,T.jsx)(`h2`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,T.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:n.length})]}),(0,T.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pr-0.5`,children:n.map(e=>(0,T.jsx)(ne,{issue:e,onOpen:()=>z(e.id),onDelete:()=>V(e.id)},e.id))})]},e)})}):(0,T.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`No projects yet. Create a task from the workspace to track stories against its repo.`})}),O&&I&&(0,T.jsx)(c,{children:(0,T.jsx)(re,{repoRoot:O,open:I,onClose:()=>L(!1),onCreated:(e,t)=>{t&&e.taskId&&$(e.taskId)}})}),O&&Z&&(0,T.jsx)(c,{children:(0,T.jsx)(s,{issue:Z,repoRoot:O,busy:H,starting:W,onClose:()=>z(null),onSave:async e=>{if(!O||R==null)return!1;U(!0);try{return await y(O,R,{title:e.title.trim(),body:e.body}),!0}catch(e){return i(`save issue`,e),!1}finally{U(!1)}},onStart:e=>{!O||!Z||(G(!0),_(O,Z,e.vendor,e.effort).then(({taskId:t})=>{z(null),e.watch&&$(t)}).catch(e=>i(`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&&g(e,Z).catch(e=>i(`prompt issue merge`,e))}:void 0})}),Q&&(0,T.jsx)(p,{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:K,onConfirm:()=>{!O||B==null||(q(!0),m(O,B).then(()=>V(null)).catch(e=>i(`delete issue`,e)).finally(()=>q(!1)))},onCancel:()=>V(null)})]})}export{E as IssuesPage};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as e,d as t,x as n,y as r}from"./tabs-Db1r1FTh.js";import{a as i,n as a,r as o}from"./toast-CfAxitbT.js";import{a as s,c,d as l,i as u,r as d,t as f,u as p}from"./createLucideIcon-BoVlWivB.js";import{i as m}from"./terminal-Ckm9XXat.js";import{n as h,r as g}from"./settings-B_VT_pPR.js";import{c as _}from"./index-kpGUWsyu.js";var v=f(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=e(r(),1);async function b(){let e=await m.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 x(e){await m.put(`/api/quick-prompts`,e,{label:`save quick prompts`})}function S(e){return _(e)===`claude`?`/review`:`Review the current changes in this worktree critically.`}var C=[`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
|
+
`),w=l();function T({palette:e}){return(0,w.jsx)(`span`,{className:`flex shrink-0 overflow-hidden rounded border border-line`,children:[e.bg,e.primary,e[`kobe-blue`],e[`kobe-green`]].filter(Boolean).map((e,t)=>(0,w.jsx)(`span`,{className:`h-5 w-3`,style:{backgroundColor:e}},t))})}function E(){let{names:e,palettes:t,active:n,overridden:r}=s();return(0,w.jsxs)(`div`,{className:`border border-line bg-surface p-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsx)(`div`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Appearance`}),r?(0,w.jsx)(`button`,{type:`button`,onClick:d,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,w.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`following TUI`})]}),e.length===0?(0,w.jsx)(`p`,{className:`mt-4 text-[12px] text-subtle`,children:`Loading themes…`}):(0,w.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,w.jsxs)(`button`,{type:`button`,onClick:()=>u(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,w.jsx)(T,{palette:t[e]??{}}),(0,w.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] ${r?`text-fg`:`text-muted`}`,children:e}),r&&(0,w.jsx)(v,{size:13,strokeWidth:2.5,className:`shrink-0 text-primary`})]},e)})})]})}var D=n({SettingsPage:()=>R}),O=[[`general`,`General`],[`engines`,`Engines`],[`board`,`Board`],[`dev`,`Dev`],[`notifications`,`Notifications`]];function k({title:e,children:t}){return(0,w.jsxs)(`section`,{children:[(0,w.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,w.jsx)(`div`,{className:`mt-3 space-y-3 text-[12px]`,children:t})]})}function A({label:e,detail:t,enabled:n,onToggle:r,disabled:i}){return(0,w.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border border-line bg-bg p-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`div`,{className:`text-[12px] font-bold text-fg`,children:e}),t?(0,w.jsx)(`div`,{className:`mt-1 text-[11px] leading-relaxed text-subtle`,children:t}):null]}),(0,w.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 j(){let[e,t]=(0,y.useState)(null),[n,r]=(0,y.useState)(!0),[i,a]=(0,y.useState)(!1),s=(0,y.useRef)(0),c=(0,y.useCallback)(async()=>{let e=++s.current;r(!0),a(!1);try{let n=await h();e===s.current&&t(n)}catch(t){e===s.current&&a(!0),o(`load settings`,t)}finally{e===s.current&&r(!1)}},[]);return(0,y.useEffect)(()=>{c()},[c]),{settings:e,loading:n,error:i,reload:c,patch:async e=>{let n=await g(e);return t(n),n}}}function M(){return(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsxs)(k,{title:`Dashboard theme`,children:[(0,w.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,w.jsx)(E,{})]})})}function N({engine:e,onSave:t,onDefault:n,onRemove:r}){let[i,a]=(0,y.useState)(e.command),[o,s]=(0,y.useState)(e.label),c=/\s--[A-Za-z0-9][\w-]*/.test(o)&&!/\s--[A-Za-z0-9][\w-]*/.test(i);return(0,y.useEffect)(()=>{a(e.command),s(e.label)},[e.command,e.label]),(0,w.jsxs)(`div`,{className:`border border-line bg-bg p-3`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(`span`,{className:`font-bold text-fg`,children:e.label}),e.isDefault?(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-primary`,children:`default`}):null,e.isCustom?(0,w.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`custom`}):null]}),(0,w.jsx)(`div`,{className:`font-mono text-[10px] text-subtle`,children:e.id})]}),(0,w.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,w.jsxs)(`label`,{className:`mt-3 block`,children:[(0,w.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Display name (label only)`}),(0,w.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,w.jsxs)(`label`,{className:`mt-2 block`,children:[(0,w.jsx)(`span`,{className:`text-[11px] text-muted`,children:`Launch command (argv that kobe runs)`}),(0,w.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,w.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,w.jsxs)(`div`,{className:`mt-3 flex items-center gap-2`,children:[(0,w.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,w.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,y.useState)(``),[i,s]=(0,y.useState)(``),[c,l]=(0,y.useState)(``),u=(e,n,r)=>void t({engineUpdates:[{id:e,command:n,label:r}]}).then(()=>a(`success`,`engine saved`));return(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsxs)(k,{title:`Launch commands`,children:[(0,w.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,w.jsx)(`div`,{className:`space-y-2`,children:e.engines.map(e=>(0,w.jsx)(N,{engine:e,onSave:u,onDefault:e=>void t({defaultEngine:e}).then(()=>a(`success`,`default engine saved`)),onRemove:e=>void t({removeEngine:e}).then(()=>a(`success`,`engine removed`))},e.id))})]}),(0,w.jsxs)(k,{title:`Add engine`,children:[(0,w.jsxs)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[(0,w.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,w.jsx)(`input`,{value:i,onChange:e=>s(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,w.jsx)(`input`,{value:c,onChange:e=>l(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,w.jsx)(`button`,{type:`button`,onClick:()=>void t({addEngine:{id:n,command:i,label:c}}).then(()=>{r(``),s(``),l(``),a(`success`,`engine added`)}).catch(e=>o(`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,y.useState)(``),[n,r]=(0,y.useState)(``),[i,s]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{let e=!1;return b().then(n=>{e||(t(n.review??``),r(n.pr??``),s(!0))}).catch(t=>{e||o(`load quick-action templates`,t)}),()=>{e=!0}},[]),(0,w.jsxs)(k,{title:`Board quick actions`,children:[(0,w.jsxs)(`label`,{className:`block`,children:[(0,w.jsx)(`span`,{className:`text-muted`,children:`Review template`}),(0,w.jsx)(`textarea`,{value:e,onChange:e=>t(e.target.value),placeholder:`default: ${S(`claude`)}`,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,w.jsxs)(`label`,{className:`block`,children:[(0,w.jsx)(`span`,{className:`text-muted`,children:`Open-PR template`}),(0,w.jsx)(`textarea`,{value:n,onChange:e=>r(e.target.value),placeholder:`default:\n${C}`,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,w.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,w.jsx)(`span`,{className:`text-[11px] text-subtle`,children:`Empty = built-in default. kobe appends its status/URL guardrails at send time.`}),(0,w.jsx)(`button`,{type:`button`,onClick:()=>void x({review:e,pr:n}).then(()=>a(`success`,`quick-action templates saved`)).catch(e=>o(`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:n}){let[r,a]=(0,y.useState)(!1),o=i();return(0,w.jsxs)(`div`,{className:`space-y-6`,children:[(0,w.jsxs)(k,{title:`Experimental gates`,children:[(0,w.jsx)(A,{label:`Remote projects`,detail:`Enables SSH-backed remote project setup in the CLI.`,enabled:e.remoteProjects,onToggle:()=>void n({remoteProjects:!e.remoteProjects})}),(0,w.jsx)(A,{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 n({autoStatus:!e.autoStatus})}),(0,w.jsx)(A,{label:`Dispatcher`,detail:`Enables the field-notes dispatcher protocol for repo main sessions.`,enabled:e.dispatcher,onToggle:()=>void n({dispatcher:!e.dispatcher})})]}),(0,w.jsxs)(k,{title:`Browser workspace`,children:[(0,w.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,w.jsx)(`button`,{type:`button`,onClick:()=>{if(!r){a(!0);return}t(),o({to:`/`}),a(!1)},onBlur:()=>a(!1),className:`border px-3 py-1.5 text-[11px] transition-colors ${r?`border-kobe-red/50 bg-kobe-red/10 text-kobe-red`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,children:r?`Click again to reset layout`:`Reset layout`})]})]})}function L(){let{supported:e,permission:t,enabled:n}=p();return(0,w.jsx)(`div`,{className:`space-y-6`,children:(0,w.jsxs)(k,{title:`Notifications`,children:[e?(0,w.jsx)(A,{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 c(!n),disabled:t===`denied`&&!n}):(0,w.jsx)(`p`,{className:`text-[11px] leading-relaxed text-subtle`,children:`This browser does not support desktop notifications.`}),t===`denied`&&!n?(0,w.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]})})}function R({onClose:e}){let[t,n]=(0,y.useState)(`general`),{settings:r,loading:i,error:a,reload:o,patch:s}=j(),c=(0,y.useMemo)(()=>O.find(([e])=>e===t)?.[1]??`Settings`,[t]);return(0,w.jsxs)(`section`,{"data-settings-open":!0,className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,w.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,w.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Settings`}),(0,w.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,w.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[180px_minmax(0,1fr)] overflow-hidden`,children:[(0,w.jsx)(`nav`,{className:`min-h-0 overflow-auto border-r border-line bg-surface/60 p-2`,children:O.map(([e,r])=>(0,w.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,w.jsx)(`main`,{className:`min-h-0 overflow-auto p-4`,children:(0,w.jsxs)(`div`,{className:`mx-auto max-w-4xl`,children:[(0,w.jsx)(`h1`,{className:`mb-3 text-[13px] font-bold uppercase tracking-[0.12em] text-fg`,children:c}),a?(0,w.jsxs)(`div`,{className:`border border-line bg-surface p-4 text-[12px]`,children:[(0,w.jsx)(`p`,{className:`text-subtle`,children:`Couldn't load settings (daemon web transport offline?)`}),(0,w.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,w.jsx)(`div`,{className:`border border-line bg-surface p-4 text-[12px] text-subtle`,children:`Loading settings...`}):t===`general`?(0,w.jsx)(M,{}):t===`engines`?(0,w.jsx)(P,{settings:r,patch:s}):t===`board`?(0,w.jsx)(F,{}):t===`dev`?(0,w.jsx)(I,{settings:r,patch:s}):(0,w.jsx)(L,{})]})})]})]})}export{D as n,R as t};
|