@sma1lboy/kobe 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/cli/index.js +393 -359
  2. package/dist/web-ui/assets/{AppShell-BTOznqKS.js → AppShell-BuFVTjzQ.js} +1 -1
  3. package/dist/web-ui/assets/Board-D9IlaHCd.js +1 -0
  4. package/dist/web-ui/assets/{BoardPeek-CPY4k_RN.js → BoardPeek-C2xEBWVE.js} +2 -2
  5. package/dist/web-ui/assets/ChatTerminal-BrP-ENHg.css +1 -0
  6. package/dist/web-ui/assets/ChatTerminal-X69JLI3Q.js +144 -0
  7. package/dist/web-ui/assets/{ChatTranscript-B_xGXApc.js → ChatTranscript-C8YP8v0k.js} +1 -1
  8. package/dist/web-ui/assets/{ConfirmDialog-5OpgDkmx.js → ConfirmDialog-Bw_DhSYa.js} +1 -1
  9. package/dist/web-ui/assets/{IssueIntakePanel-CF7HL2s9.js → IssueIntakePanel-D48joYeF.js} +1 -1
  10. package/dist/web-ui/assets/IssuePeek-CnuN0m7v.js +1 -0
  11. package/dist/web-ui/assets/IssuesPage-D2n-CM8o.js +1 -0
  12. package/dist/web-ui/assets/{RichEditor-DmGT9P7h.js → RichEditor-DYofF0Co.js} +1 -1
  13. package/dist/web-ui/assets/{SettingsPage-BtJX2Wbd.js → SettingsPage-CEWJd0gX.js} +1 -1
  14. package/dist/web-ui/assets/{SlideOver-BN-NhV9P.js → SlideOver-CWvQg6gX.js} +1 -1
  15. package/dist/web-ui/assets/{ViewToggle-CIZAN_0S.js → ViewToggle-DUvz-P9N.js} +1 -1
  16. package/dist/web-ui/assets/{WorkspaceTabs-BjQlK6xw.js → WorkspaceTabs-AmpKkNKh.js} +3 -3
  17. package/dist/web-ui/assets/arrow-left-CTu620DY.js +1 -0
  18. package/dist/web-ui/assets/board-gsUJ3unG.js +1 -0
  19. package/dist/web-ui/assets/{chips-L2qle6td.js → chips-ER3SiHRg.js} +1 -1
  20. package/dist/web-ui/assets/{createLucideIcon-Dn8f0BBU.js → createLucideIcon-B3ImGkvG.js} +1 -1
  21. package/dist/web-ui/assets/{external-link-CGQEaSmM.js → external-link-D0CjtZaF.js} +1 -1
  22. package/dist/web-ui/assets/{external-store-DUMhHvtl.js → external-store-BMGmoHuF.js} +1 -1
  23. package/dist/web-ui/assets/harness-B3lC6M9X.js +1 -0
  24. package/dist/web-ui/assets/{index-DmtC0Wbe.css → index-DVMmUb6_.css} +1 -1
  25. package/dist/web-ui/assets/{index-CX2Ouner.js → index-L7l828Hv.js} +3 -3
  26. package/dist/web-ui/assets/issues-BBYWc1q0.js +4 -0
  27. package/dist/web-ui/assets/issues-BmvAw4q3.js +1 -0
  28. package/dist/web-ui/assets/lazy-issue-panels-Dg86YAgC.js +6 -0
  29. package/dist/web-ui/assets/{rotate-cw-zLlRat-M.js → rotate-cw-BxAflhQC.js} +1 -1
  30. package/dist/web-ui/assets/routes-Ch_aVEQc.js +1 -0
  31. package/dist/web-ui/assets/{store-CbgoTSs1.js → store-BvkKuplZ.js} +2 -2
  32. package/dist/web-ui/assets/{tabs-B_hac99E.js → tabs-C6drmk5t.js} +1 -1
  33. package/dist/web-ui/assets/task._taskId-BWkc9jhF.js +1 -0
  34. package/dist/web-ui/assets/{toast-D798wIYZ.js → toast-CvhQ8RqX.js} +1 -1
  35. package/dist/web-ui/assets/{worktrees-CZYooVsg.js → worktrees-DhzuyoNd.js} +1 -1
  36. package/dist/web-ui/index.html +7 -7
  37. package/package.json +3 -1
  38. package/dist/web-ui/assets/Board-Bvkyjgq6.js +0 -1
  39. package/dist/web-ui/assets/ChatTerminal-kHJ-D0s7.css +0 -1
  40. package/dist/web-ui/assets/ChatTerminal-yge5k7Tv.js +0 -8
  41. package/dist/web-ui/assets/IssuePeek-BHWJhJku.js +0 -1
  42. package/dist/web-ui/assets/IssuesPage-kkOaSh0x.js +0 -1
  43. package/dist/web-ui/assets/arrow-left-BXrVItPe.js +0 -1
  44. package/dist/web-ui/assets/board-D5jDr-4b.js +0 -1
  45. package/dist/web-ui/assets/harness-BRyFen92.js +0 -1
  46. package/dist/web-ui/assets/issues-BBbxPwjI.js +0 -3
  47. package/dist/web-ui/assets/issues-GeSdN8vm.js +0 -1
  48. package/dist/web-ui/assets/lazy-issue-panels-CE0UA8nx.js +0 -6
  49. package/dist/web-ui/assets/routes-DUr6PI5d.js +0 -1
  50. package/dist/web-ui/assets/task._taskId-D0S-W4kD.js +0 -1
@@ -1 +0,0 @@
1
- import{l as e}from"./terminal-B6OlmT6e.js";import{y as t}from"./tabs-B_hac99E.js";import{d as n,t as r}from"./createLucideIcon-Dn8f0BBU.js";import{t as i}from"./external-link-CGQEaSmM.js";import{t as a}from"./SlideOver-BN-NhV9P.js";import{n as o,r as s}from"./issues-BBbxPwjI.js";import{n as c,t as l}from"./RichEditor-DmGT9P7h.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=s(e.status)&&!k,j=y!==e.title||x!==e.body,M=j&&y.trim().length>0&&!n,N=o[e.status];return(0,p.jsx)(a,{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)(l,{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};
@@ -1 +0,0 @@
1
- import{l as e}from"./terminal-B6OlmT6e.js";import{c as t,y as n}from"./tabs-B_hac99E.js";import{a as ee,r}from"./toast-D798wIYZ.js";import{d as i}from"./createLucideIcon-Dn8f0BBU.js";import{n as a}from"./store-CbgoTSs1.js";import{t as o}from"./arrow-left-BXrVItPe.js";import{a as s,i as te,n as c,r as l,t as u}from"./lazy-issue-panels-CE0UA8nx.js";import{g as d,v as f,y as p}from"./index-CX2Ouner.js";import{n as m,t as h}from"./ConfirmDialog-5OpgDkmx.js";import{a as ne,c as re,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-BBbxPwjI.js";var w=e(n(),1),T=i();function E(){let{tasks:e,hydrated:n}=a(),i=ee(),[E,ie]=(0,w.useState)([]);(0,w.useEffect)(()=>{let e=!1;return x().then(t=>{e||ie(t)}).catch(e=>r(`load projects`,e)),()=>{e=!0}},[]);let D=(0,w.useMemo)(()=>C(e,E),[e,E]),[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}=s((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)(()=>re(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=>{i({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)(m,{}),(0,T.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,T.jsx)(o,{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)(f,{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)(p,{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)(te,{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)(u,{children:(0,T.jsx)(c,{repoRoot:O,open:I,onClose:()=>L(!1),onCreated:(e,t)=>{t&&e.taskId&&$(e.taskId)}})}),O&&Z&&(0,T.jsx)(u,{children:(0,T.jsx)(l,{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 r(`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=>r(`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=>r(`prompt issue merge`,e))}:void 0})}),Q&&(0,T.jsx)(h,{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),ne(O,B).then(()=>V(null)).catch(e=>r(`delete issue`,e)).finally(()=>q(!1)))},onCancel:()=>V(null)})]})}export{E as IssuesPage};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-Dn8f0BBU.js";var t=e(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]);export{t};
@@ -1 +0,0 @@
1
- import{Board as e}from"./Board-Bvkyjgq6.js";var t=e;export{t as component};
@@ -1 +0,0 @@
1
- import{d as e}from"./createLucideIcon-Dn8f0BBU.js";import{ChatTerminal as t}from"./ChatTerminal-yge5k7Tv.js";var n=e();function r(){return(0,n.jsx)(`div`,{style:{position:`fixed`,inset:0,background:`#141413`},children:(0,n.jsx)(t,{tabId:`e2e`,taskId:`e2e`,mode:`shell`})})}export{r as component};
@@ -1,3 +0,0 @@
1
- import{o as e,r as t}from"./terminal-B6OlmT6e.js";import{c as n}from"./tabs-B_hac99E.js";import{t as r}from"./store-CbgoTSs1.js";import{D as i,l as a}from"./index-CX2Ouner.js";import{t as o}from"./text-match-C3BRtNXy.js";var s=[{key:`backlog`,title:`Backlog`,accent:`text-subtle`,alwaysVisible:!0},{key:`in_progress`,title:`In progress`,accent:`text-kobe-orange`,alwaysVisible:!0},{key:`done`,title:`Done`,accent:`text-kobe-green`,alwaysVisible:!0}],c=new Set([`done`]);function l(e){return e.status===`done`?`done`:e.taskId!==void 0&&e.taskId!==``?`in_progress`:`backlog`}function u(e){return e.taskId!==void 0&&e.taskId!==``}function d(e,t){return e.issue.created===t.issue.created?t.issue.id-e.issue.id:e.issue.created<t.issue.created?1:-1}function f(e){let t=new Map,n=(e,n)=>{let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t of e)n(l(t.issue),t);for(let e of t.values())e.sort(d);let r=(e,t)=>!c.has(e)||t.length<=30?{cards:t,hiddenCount:0}:{cards:t.slice(0,30),hiddenCount:t.length-30};return s.map(e=>({...e,...r(e.key,t.get(e.key)??[])})).filter(e=>e.alwaysVisible||e.cards.length+e.hiddenCount>0)}function p(e){return e.reduce((e,t)=>e+t.cards.length,0)}function m(e){let t=new Map;for(let n of e){let e=n.repo,r=t.get(e);r?r.push(n):t.set(e,[n])}let n=[...t.keys()];return n.map(e=>({repo:e,label:g(e,n),columns:f(t.get(e)??[])})).sort((e,t)=>e.label.localeCompare(t.label))}function h(e){let t=e.replace(/\/+$/,``);return t.split(`/`).pop()||t}function g(e,t){let n=h(e);return t.some(t=>t!==e&&h(t)===n)?e.replace(/\/+$/,``).split(`/`).slice(-2).join(`/`):n}function _(e,t,n){let r=[];for(let i of t){let t=e[i];if(!(!t||!t.exists))for(let e of t.issues){let t=n.get(`${i}:${e.id}`);r.push(t&&!e.taskId?{repo:i,issue:{...e,taskId:t.taskId}}:{repo:i,issue:e})}}return r}function v(e){let t=new Map;for(let{repo:n}of e)t.set(n,(t.get(n)??0)+1);let n=[...t.keys()];return n.map(e=>({repo:e,label:g(e,n),count:t.get(e)??0})).sort((e,t)=>e.label.localeCompare(t.label))}function y(e,t,n){return e.filter(({repo:e,issue:r})=>n&&e!==n?!1:o(`#${r.id} ${r.title} ${r.body}`,t))}function b(e){let t=_(e.issueData,e.issueRepos,e.pendingLinks),n=v(t),r=m(y(t,e.query,e.repoFilter));return e.repoFilter&&r.length===0&&e.issueRepos.includes(e.repoFilter)&&r.push({repo:e.repoFilter,label:g(e.repoFilter,e.issueRepos),columns:f([])}),{allIssues:t,repoChips:n,projectBoards:r,shownCount:r.reduce((e,t)=>e+p(t.columns),0),hasAnyCard:t.length>0}}async function x(){let t=await e.get(`/api/projects`,{label:`load projects`});return Array.isArray(t.projects)?t.projects.filter(e=>typeof e==`string`):[]}async function S(t){return e.get(`/api/issues`,{query:{repoRoot:t},label:`load issues`})}async function C(t,n){return e.post(`/api/issues`,{repoRoot:t,op:n},{label:`update issues`})}async function w(e,t){return C(e,{type:`create`,...t})}async function T(e,t,n){return C(e,{type:`update`,id:t,...n})}async function E(e,t,n){return C(e,{type:`link`,id:t,taskId:n})}async function D(e,t){return C(e,{type:`delete`,id:t})}async function O(){let t=await e.getOr(`/api/cli-invocation`,{},{label:`load CLI invocation`});return typeof t.api==`string`&&t.api.trim().length>0?t.api:`kobe api`}var k=[`open`,`doing`,`hold`,`done`],A={open:{title:`Backlog`,accent:`text-kobe-blue`},doing:{title:`In session`,accent:`text-kobe-orange`},hold:{title:`Blocked`,accent:`text-kobe-yellow`},done:{title:`Done`,accent:`text-kobe-green`}};function j(e){return e!==`done`}function M(e,t){let n=(t.query??``).trim().toLowerCase(),r=t.statuses&&t.statuses.length>0?t.statuses:null;return e.filter(e=>r&&!r.includes(e.status)?!1:n?`#${e.id} ${e.title} ${e.body}`.toLowerCase().includes(n):!0)}function N(e){let t={open:[],doing:[],hold:[],done:[]};for(let n of e)t[n.status]?.push(n);let n=(e,t)=>e.created===t.created?t.id-e.id:e.created<t.created?1:-1;return t.open.sort(n),t.doing.sort(n),t.hold.sort(n),t.done.sort((e,t)=>t.id-e.id),t}function P(e,t=[]){let n=new Map;for(let e of t)e.trim().length>0&&n.set(e,0);let r=new Set(e.filter(e=>!e.archived&&e.kind===`main`&&e.repo).map(e=>e.repo));for(let e of r)n.set(e,n.get(e)??0);let i=new Set(n.keys());for(let t of e)t.archived||!t.repo||i.size>0&&!i.has(t.repo)||n.set(t.repo,(n.get(t.repo)??0)+1);let a=[...n.keys()];return a.map(e=>({repo:e,label:g(e,a),count:n.get(e)??0})).sort((e,t)=>e.label.localeCompare(t.label))}function F(e,t){return e.length===0?null:t&&e.some(e=>e.repo===t)?t:e[0]?.repo??null}function I(e,t=`kobe api`){let n=[`Work on user story #${e.id}: ${e.title}`,``],r=e.body.trim();return r&&n.push(r,``),n.push(`Treat this as the story's dedicated kobe task session: work only in this task worktree, and preserve any repo init instructions already delivered to the session.`,`Before finishing, verify the acceptance criteria implied by the story and summarize what changed plus any verification still needed.`,`Then merge the task branch back into the current project's main branch after the worktree is clean and checks pass.`,`When the work lands, run: ${t} issue-set-status --repo . --id ${e.id} --status done`),n.join(`
2
- `)}function L(e,t=`kobe api`){return[`Finish user story #${e.id}: ${e.title}`,``,`Verify the acceptance criteria implied by the story, then summarize what changed and any verification still needed.`,`Then merge this task branch back into the current project's main branch after the worktree is clean and checks pass. Resolve conflicts if needed.`,`When the work lands, run: ${t} issue-set-status --repo . --id ${e.id} --status done`].join(`
3
- `)}async function R(e,o,s,c){let l=s?.trim()||await a(),{taskId:u}=await r(`task.create`,{repo:e,title:`#${o.id} ${o.title}`,...l?{vendor:l}:{},...c?.trim()?{effort:c.trim()}:{}});i(u),await E(e,o.id,u).catch(()=>{});let d=await O().catch(()=>`kobe api`);return await t(n(u),u,I(o,d)),{taskId:u}}async function z(e,r){let i=await O().catch(()=>`kobe api`);await t(n(e),e,L(r,i))}export{D as a,M as c,z as d,R as f,u as g,b as h,w as i,N as l,T as m,A as n,S as o,F as p,j as r,x as s,k as t,P as u};
@@ -1 +0,0 @@
1
- import{IssuesPage as e}from"./IssuesPage-kkOaSh0x.js";var t=e;export{t as component};
@@ -1,6 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/IssueIntakePanel-CF7HL2s9.js","assets/terminal-B6OlmT6e.js","assets/tabs-B_hac99E.js","assets/createLucideIcon-Dn8f0BBU.js","assets/SlideOver-BN-NhV9P.js","assets/index-CX2Ouner.js","assets/toast-D798wIYZ.js","assets/external-store-DUMhHvtl.js","assets/store-CbgoTSs1.js","assets/index-DmtC0Wbe.css","assets/issues-BBbxPwjI.js","assets/text-match-C3BRtNXy.js","assets/RichEditor-DmGT9P7h.js","assets/RichEditor-B4sEOPyN.css","assets/IssuePeek-BHWJhJku.js","assets/external-link-CGQEaSmM.js"])))=>i.map(i=>d[i]);
2
- import{l as e}from"./terminal-B6OlmT6e.js";import{y as t}from"./tabs-B_hac99E.js";import{d as n,t as r}from"./createLucideIcon-Dn8f0BBU.js";import{i,n as a,r as o}from"./store-CbgoTSs1.js";import{i as s}from"./chips-L2qle6td.js";import{o as c}from"./issues-BBbxPwjI.js";var l=r(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),u=r(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),d=e(t(),1);function f(e){let{issueSnapshots:t}=a(),[n,r]=(0,d.useState)({}),[i,s]=(0,d.useState)({}),[l,u]=(0,d.useState)(!1),f=(0,d.useRef)(new Map),p=(0,d.useRef)(new Map),m=(0,d.useRef)(new Map),h=(0,d.useRef)(new Map),g=(0,d.useCallback)(e=>{let t=(f.current.get(e)??0)+1;return f.current.set(e,t),t},[]),_=(0,d.useCallback)((e,t,n=e.repoRoot)=>{t<(p.current.get(n)??0)||(p.current.set(n,t),e.repoRoot&&e.repoRoot!==n&&h.current.set(n,e.repoRoot),r(t=>({...t,[n]:{...e,repoRoot:n}})),s(e=>{if(!(n in e))return e;let{[n]:t,...r}=e;return r}))},[]),v=(0,d.useCallback)(e=>{e.length!==0&&(u(!0),Promise.all(e.map(async e=>{let t=g(e);try{_(await c(e),t,e)}catch(t){s(n=>({...n,[e]:t instanceof Error?t.message:String(t)}))}})).finally(()=>u(!1)))},[g,_]),y=(0,d.useMemo)(()=>[...e].join(`
3
- `),[e]);return(0,d.useEffect)(()=>{v(y?y.split(`
4
- `):[])},[y]),(0,d.useEffect)(()=>{let e=new Map(Object.values(t).map(e=>[o(e.repoRoot),e]));for(let t of y?y.split(`
5
- `):[]){let n=h.current.get(t),r=e.get(o(t))??(n?e.get(o(n)):void 0);if(!r||m.current.get(t)===r)continue;m.current.set(t,r);let i=g(t);_(r,i,t)}},[t,y,g,_]),{data:n,failed:i,loading:l,pending:(0,d.useMemo)(()=>(y?y.split(`
6
- `):[]).some(e=>!(e in n)&&!(e in i)),[y,n,i]),refresh:v}}var p=n();function m({issue:e,onOpen:t,onDelete:n}){return(0,p.jsxs)(`div`,{className:`group/card relative`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:t,className:`flex w-full cursor-pointer flex-col gap-1.5 border border-line bg-surface p-3 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,p.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[`#`,e.id]}),(0,p.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-fg`,children:e.title})]}),(0,p.jsx)(`div`,{className:`flex items-center gap-2 text-[11px] text-subtle`,children:(0,p.jsx)(`span`,{className:`font-mono`,children:e.created})})]}),(0,p.jsxs)(`div`,{className:`absolute right-2 top-2 flex gap-1 opacity-0 transition-opacity focus-within:opacity-100 group-hover/card:opacity-100`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Open issue #${e.id}`,"data-tip":`Open issue detail`,className:`relative flex h-5 w-5 items-center justify-center border border-line bg-surface text-subtle hover:border-primary hover:text-fg ${s}`,children:(0,p.jsx)(l,{size:11,strokeWidth:1.8})}),(0,p.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Delete issue #${e.id}`,"data-tip":`Delete issue`,className:`relative flex h-5 w-5 items-center justify-center border border-line bg-surface text-subtle hover:border-kobe-red/50 hover:text-kobe-red ${s}`,children:(0,p.jsx)(u,{size:11,strokeWidth:1.8})})]})]})}var h=(0,d.lazy)(()=>i(()=>import(`./IssueIntakePanel-CF7HL2s9.js`).then(e=>({default:e.IssueIntakePanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13]))),g=(0,d.lazy)(()=>i(()=>import(`./IssuePeek-BHWJhJku.js`).then(e=>({default:e.IssuePeek})),__vite__mapDeps([14,1,2,3,15,4,5,6,7,8,9,10,11,12,13])));function _({children:e}){return(0,p.jsx)(d.Suspense,{fallback:(0,p.jsx)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:(0,p.jsx)(`div`,{className:`relative flex h-full w-[640px] max-w-[92vw] items-center justify-center border-l border-line bg-bg text-[12px] text-subtle shadow-2xl`,children:`Loading…`})}),children:e})}export{f as a,m as i,h as n,g as r,_ as t};
@@ -1 +0,0 @@
1
- import{AppShell as e}from"./AppShell-BTOznqKS.js";var t=e;export{t as component};
@@ -1 +0,0 @@
1
- import{l as e}from"./terminal-B6OlmT6e.js";import{_ as t,f as n,y as r}from"./tabs-B_hac99E.js";import{d as i}from"./createLucideIcon-Dn8f0BBU.js";import{D as a,t as o}from"./index-CX2Ouner.js";import{AppShell as s}from"./AppShell-BTOznqKS.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(e))},[e,r]),(0,l.jsx)(s,{})}export{u as component};