@sma1lboy/kobe 0.7.53 → 0.7.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +207 -205
- package/dist/web-ui/assets/AppShell-DatLbUH8.js +5 -0
- package/dist/web-ui/assets/{Board-Cb_qgK8p.js → Board-eEGLQBF4.js} +1 -1
- package/dist/web-ui/assets/{BoardPeek-BhMuWjKj.js → BoardPeek-BN0d-Zie.js} +1 -1
- package/dist/web-ui/assets/{ChatTranscript-DdXMAQZR.js → ChatTranscript-CzQspNKE.js} +1 -1
- package/dist/web-ui/assets/{ConfirmDialog-NPI1j7RW.js → ConfirmDialog-BPIwmIjt.js} +1 -1
- package/dist/web-ui/assets/IssueIntakePanel-BF7ifkKK.js +1 -0
- package/dist/web-ui/assets/IssuePeek-DTInqza8.js +1 -0
- package/dist/web-ui/assets/{IssuesPage-zQbthJwx.js → IssuesPage-Bx7iHFBo.js} +1 -1
- package/dist/web-ui/assets/{SlideOver-CLaRtSQE.js → RichEditor-DvjbbcLw.js} +52 -52
- package/dist/web-ui/assets/{SettingsPage-BT-LGgyI.js → SettingsPage-DZ25Tk5v.js} +2 -2
- package/dist/web-ui/assets/SlideOver-D9BDfm6L.js +1 -0
- package/dist/web-ui/assets/{ViewToggle-Cok6O_mP.js → ViewToggle-DsJBr4VT.js} +1 -1
- package/dist/web-ui/assets/{WorkspaceTabs-DmfAn-hk.js → WorkspaceTabs-C2pSVT1A.js} +1 -1
- package/dist/web-ui/assets/board-rpuYw0Ze.js +1 -0
- package/dist/web-ui/assets/{index-CZ8GNIM9.js → index-BC9H3mAq.js} +2 -2
- package/dist/web-ui/assets/issues-CvEDCZIa.js +1 -0
- package/dist/web-ui/assets/{issues-Dq7AkivK.js → issues-YCoQHBtW.js} +1 -1
- package/dist/web-ui/assets/{lazy-issue-panels-CAA0flSv.js → lazy-issue-panels-C8OnZML2.js} +3 -3
- package/dist/web-ui/assets/routes-BvOMdZDM.js +1 -0
- package/dist/web-ui/assets/{task._taskId-DBT8vG_M.js → task._taskId-DweEr9w7.js} +1 -1
- package/dist/web-ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/web-ui/assets/AppShell-CYm01lx0.js +0 -5
- package/dist/web-ui/assets/IssueIntakePanel-60iwjJTZ.js +0 -1
- package/dist/web-ui/assets/IssuePeek-BbXifAKp.js +0 -1
- package/dist/web-ui/assets/board-BEUe7jtL.js +0 -1
- package/dist/web-ui/assets/issues-DkAiF0x1.js +0 -1
- package/dist/web-ui/assets/routes-DBeL-4xe.js +0 -1
- /package/dist/web-ui/assets/{SlideOver-B4sEOPyN.css → RichEditor-B4sEOPyN.css} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{IssuesPage as e}from"./IssuesPage-Bx7iHFBo.js";var t=e;export{t as component};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{c as e}from"./tabs-Db1r1FTh.js";import{t}from"./store-BXWXnGds.js";import{i as n,r}from"./terminal-Ckm9XXat.js";import{t as i}from"./settings-B_VT_pPR.js";import{w as a}from"./index-
|
|
1
|
+
import{c as e}from"./tabs-Db1r1FTh.js";import{t}from"./store-BXWXnGds.js";import{i as n,r}from"./terminal-Ckm9XXat.js";import{t as i}from"./settings-B_VT_pPR.js";import{w as a}from"./index-BC9H3mAq.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 e=await n.get(`/api/projects`,{label:`load projects`});return Array.isArray(e.projects)?e.projects.filter(e=>typeof e==`string`):[]}async function S(e){return n.get(`/api/issues`,{query:{repoRoot:e},label:`load issues`})}async function C(e,t){return n.post(`/api/issues`,{repoRoot:e,op:t},{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 e=await n.getOr(`/api/cli-invocation`,{},{label:`load CLI invocation`});return typeof e.api==`string`&&e.api.trim().length>0?e.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
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
3
|
`)}async function R(n,o,s,c){let l=s?.trim()||await i(),{taskId:u}=await t(`task.create`,{repo:n,title:`#${o.id} ${o.title}`,...l?{vendor:l}:{},...c?.trim()?{effort:c.trim()}:{}});a(u),await E(n,o.id,u).catch(()=>{});let d=await O().catch(()=>`kobe api`);return await r(e(u),u,I(o,d)),{taskId:u}}async function z(t,n){let i=await O().catch(()=>`kobe api`);await r(e(t),t,L(n,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,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/IssueIntakePanel-
|
|
2
|
-
import{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n,t as r}from"./createLucideIcon-BoVlWivB.js";import{i,n as a,r as o}from"./store-BXWXnGds.js";import{o as s}from"./ConfirmDialog-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/IssueIntakePanel-BF7ifkKK.js","assets/tabs-Db1r1FTh.js","assets/terminal-Ckm9XXat.js","assets/RichEditor-DvjbbcLw.js","assets/index-BC9H3mAq.js","assets/store-BXWXnGds.js","assets/createLucideIcon-BoVlWivB.js","assets/toast-CfAxitbT.js","assets/settings-B_VT_pPR.js","assets/index-C7JcdWbk.css","assets/RichEditor-B4sEOPyN.css","assets/SlideOver-D9BDfm6L.js","assets/issues-YCoQHBtW.js","assets/text-match-C3BRtNXy.js","assets/IssuePeek-DTInqza8.js","assets/external-link-C51-09OW.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{S as e,y as t}from"./tabs-Db1r1FTh.js";import{d as n,t as r}from"./createLucideIcon-BoVlWivB.js";import{i,n as a,r as o}from"./store-BXWXnGds.js";import{o as s}from"./ConfirmDialog-BPIwmIjt.js";import{o as c}from"./issues-YCoQHBtW.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
3
|
`),[e]);return(0,d.useEffect)(()=>{v(y?y.split(`
|
|
4
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
5
|
`):[]){let n=h.current.get(t),r=e.get(o(t))??(n?e.get(o(n)):void 0);r&&m.current.get(t)!==r&&(m.current.set(t,r),_(r,g(t),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-
|
|
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-BF7ifkKK.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-DTInqza8.js`).then(e=>({default:e.IssuePeek})),__vite__mapDeps([14,1,2,3,4,5,6,7,8,9,10,15,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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{AppShell as e}from"./AppShell-DatLbUH8.js";var t=e;export{t as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e,_ as t,f as n,y as r}from"./tabs-Db1r1FTh.js";import{d as i}from"./createLucideIcon-BoVlWivB.js";import{t as a,w as o}from"./index-
|
|
1
|
+
import{S as e,_ as t,f as n,y as r}from"./tabs-Db1r1FTh.js";import{d as i}from"./createLucideIcon-BoVlWivB.js";import{t as a,w as o}from"./index-BC9H3mAq.js";import{AppShell as s}from"./AppShell-DatLbUH8.js";var c=e(r()),l=i();function u(){let{taskId:e}=a.useParams(),{selectedTaskId:r}=t();return(0,c.useEffect)(()=>{!e||e===r||(n(e),o(e))},[e,r]),(0,l.jsx)(s,{})}export{u as component};
|
package/dist/web-ui/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>kobe-web</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BC9H3mAq.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/terminal-Ckm9XXat.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/tabs-Db1r1FTh.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/createLucideIcon-BoVlWivB.js">
|
package/package.json
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{S as e,_ as t,f as n,l as r,r as i,y as a}from"./tabs-Db1r1FTh.js";import{a as o,n as s,r as c}from"./toast-CfAxitbT.js";import{d as l,t as u}from"./createLucideIcon-BoVlWivB.js";import{n as d,t as f}from"./ViewToggle-Cok6O_mP.js";import{n as p,t as m}from"./store-BXWXnGds.js";import{i as h}from"./terminal-Ckm9XXat.js";import{i as g}from"./settings-B_VT_pPR.js";import{i as _,r as v,t as y}from"./WorkspaceTabs-DmfAn-hk.js";import{t as b}from"./SettingsPage-BT-LGgyI.js";import{n as x,r as S}from"./ChatTranscript-DdXMAQZR.js";import{C,S as w,b as T,d as E,f as D,g as ee,h as te,l as O,m as ne,n as re,o as ie,p as k,r as A,s as ae,u as j,v as M,w as N,x as P,y as F}from"./index-CZ8GNIM9.js";import{t as I}from"./text-match-C3BRtNXy.js";import{r as L}from"./web-transport-BS7imUMS.js";import{a as oe,i as se,n as ce,r as le,t as R}from"./ConfirmDialog-NPI1j7RW.js";var ue=u(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),de=u(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),z=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fe=u(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),B=e(a(),1),V=g({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),H=null;function U(e){V.update(t=>({...t,...e}))}function W(e){U({query:e})}function G(e){U({statusFilter:e})}function pe(e){U({sortMode:e})}function me(e){U({showArchived:e})}function he(e){!e||e===H||(H=e,U({sortMode:e}))}function ge(){return V.useSnapshot()}function K(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function q(e,t){let n=K(t)-K(e);return n===0?t.id.localeCompare(e.id):n}function _e(e,t){let n=e.filter(e=>e.kind===`main`),r=e.filter(e=>e.kind!==`main`&&e.pinned),i=e.filter(e=>e.kind!==`main`&&!e.pinned);return t===`recent`&&(r.sort(q),i.sort(q)),[...n,...r,...i]}function ve(e,t){return I([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}var J=l();function ye({onClose:e}){let{tasks:t}=p(),r=o(),i=(0,B.useRef)(null);j(i);let a=(0,B.useMemo)(()=>{let e=new Set,n=[];for(let r of t)r.repo&&!e.has(r.repo)&&(e.add(r.repo),n.push(r.repo));return n.sort()},[t]),l=(0,B.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[u,d]=(0,B.useState)(a[0]??``),[f,h]=(0,B.useState)(null),[g,_]=(0,B.useState)(!1),[v,y]=(0,B.useState)(null),[b,x]=(0,B.useState)(!1),C=async e=>{if(e){_(!0),h(null);try{let{worktrees:t}=await m(`worktree.discoverAdoptable`,{repo:e});h(t)}catch(e){c(`scan worktrees`,e),h([])}finally{_(!1)}}},w=async t=>{y(t.path);try{let{task:i}=await m(`worktree.adopt`,{repo:u,worktreePath:t.path,branch:t.branch,ifExists:`return`});n(i.id),N(i.id),r({to:`/task/$taskId`,params:{taskId:i.id}}),s(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){c(`adopt worktree`,e)}finally{y(null)}};return b?(0,J.jsx)(A,{onClose:e}):a.length===0?(0,J.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:e,onKeyDown:t=>{t.key===`Escape`&&e()},role:`presentation`,children:(0,J.jsxs)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Adopt worktree`,className:`flex w-[32rem] max-w-[calc(100vw-2rem)] flex-col border border-line bg-surface shadow-xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,J.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,J.jsx)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:`No repos known to kobe yet. Create a task in a repo first, then come back to adopt its worktrees.`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>x(!0),className:`mt-4 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10`,children:`Create a task`})]}),(0,J.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,J.jsx)(`button`,{type:`button`,onClick:e,className:`border border-line bg-bg px-3 py-1.5 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Close`})})]})}):(0,J.jsx)(`div`,{className:`fixed inset-0 z-40 flex items-center justify-center bg-black/60`,onClick:e,onKeyDown:t=>{t.key===`Escape`&&e()},role:`presentation`,children:(0,J.jsxs)(`div`,{ref:i,role:`dialog`,"aria-modal":`true`,"aria-label":`Adopt worktree`,className:`flex max-h-[80vh] w-[32rem] max-w-[calc(100vw-2rem)] flex-col border border-line bg-surface shadow-xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,J.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,J.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(`select`,{value:u,onChange:e=>d(e.target.value),className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`,children:a.map(e=>(0,J.jsx)(`option`,{value:e,children:e},e))}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>void C(u),disabled:!u||g,className:`shrink-0 border border-primary bg-inset px-3 py-1.5 text-[11px] text-fg transition-colors hover:bg-primary/10 disabled:opacity-40`,children:g?`Scanning…`:`Scan`})]})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,J.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Pick a repo and Scan to find adoptable worktrees.`}):f.length===0?(0,J.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No adoptable worktrees found for this repo.`}):f.map(e=>{let t=l.has(e.path);return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,J.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,J.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`})]}),(0,J.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,J.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,J.jsx)(`span`,{className:`ml-auto shrink-0`,children:S(e.lastActivityMs)})]})]}),t?(0,J.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,J.jsx)(`button`,{type:`button`,onClick:()=>void w(e),disabled:v!==null,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg disabled:opacity-40`,children:v===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,J.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,J.jsx)(`button`,{type:`button`,onClick:e,className:`border border-line bg-bg px-3 py-1.5 text-[11px] text-muted transition-colors hover:border-primary hover:text-fg`,children:`Close`})})]})})}async function be(e){try{if(navigator.clipboard?.writeText)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function Y(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}var xe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function Se(e){let t=e.trim();return xe.test(t)?t:null}function Ce(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}function we(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Se(n.replace(/&/g,`&`));return r?`<img src="${Y(r)}" alt="${Y(t)}" loading="lazy" class="kobe-md-img">`:``})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ce(n.replace(/&/g,`&`));return r?`<a href="${Y(r)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${t}</a>`:`${t}(${n})`})),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function X(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:we(e)).join(``)}function Te(e){let t=e.replace(/\r\n/g,`
|
|
2
|
-
`).split(`
|
|
3
|
-
`),n=[],r=0,i=null,a=()=>{i&&=(n.push(`</${i}>`),null)};for(;r<t.length;){let e=t[r];if(/^```/.test(e)){a();let e=[];for(r++;r<t.length&&!/^```/.test(t[r]);)e.push(Y(t[r])),r++;r++,n.push(`<pre class="kobe-md-pre"><code>${e.join(`
|
|
4
|
-
`)}</code></pre>`);continue}if(/^\s*(-{3,}|\*{3,}|_{3,})\s*$/.test(e)){a(),n.push(`<hr class="kobe-md-hr" />`),r++;continue}let o=/^(#{1,6})\s+(.*)$/.exec(e);if(o){a();let e=o[1].length;n.push(`<h${e} class="kobe-md-h">${X(Y(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${X(Y(e.replace(/^>\s?/,``)))}</blockquote>`),r++;continue}let s=/^\s*[-*]\s+(.*)$/.exec(e);if(s){i!==`ul`&&(a(),n.push(`<ul class="kobe-md-ul">`),i=`ul`),n.push(`<li>${X(Y(s[1]))}</li>`),r++;continue}let c=/^\s*\d+\.\s+(.*)$/.exec(e);if(c){i!==`ol`&&(a(),n.push(`<ol class="kobe-md-ol">`),i=`ol`),n.push(`<li>${X(Y(c[1]))}</li>`),r++;continue}if(e.trim()===``){a(),r++;continue}a();let l=[e];for(r++;r<t.length&&t[r].trim()!==``&&!/^(#{1,6}\s|>\s?|```|\s*[-*]\s|\s*\d+\.\s|\s*(-{3,}|\*{3,}|_{3,})\s*$)/.test(t[r]);)l.push(t[r]),r++;n.push(`<p class="kobe-md-p">${X(Y(l.join(` `)))}</p>`)}return a(),n.join(`
|
|
5
|
-
`)}async function Ee(e){return(await h.get(`/api/notes`,{query:{taskId:e},label:`load notes`})).markdown??``}async function De(e,t){await h.put(`/api/notes`,{taskId:e,markdown:t},{label:`save notes`})}function Oe(e){switch(e){case`saving`:return`saving…`;case`saved`:return`saved`;case`error`:return`save failed`;default:return``}}var ke=600;function Ae({children:e,right:t}){return(0,J.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t]})}function je({taskId:e,full:t=!1}){let[n,r]=(0,B.useState)(``),[i,a]=(0,B.useState)(!1),[o,s]=(0,B.useState)(!1),[c,l]=(0,B.useState)(`idle`),u=(0,B.useMemo)(()=>Te(n),[n]),d=(0,B.useRef)(null),f=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(d.current&&clearTimeout(d.current),f.current=e,l(`idle`),r(``),a(!1),!e)return;let t=!1;return s(!0),Ee(e).then(n=>{!t&&f.current===e&&r(n)}).catch(()=>{!t&&f.current===e&&r(``)}).finally(()=>{t||s(!1)}),()=>{t=!0}},[e]),(0,B.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let p=(0,B.useCallback)(t=>{if(r(t),!e)return;let n=e;l(`saving`),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{De(n,t).then(()=>{f.current===n&&l(`saved`)}).catch(()=>{f.current===n&&l(`error`)})},ke)},[e]);return(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-bg`,children:[(0,J.jsx)(Ae,{right:e?(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==`idle`&&(0,J.jsx)(`span`,{className:`text-[10px] ${c===`error`?`text-kobe-red`:`text-subtle`}`,children:Oe(c)}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),className:`border px-1.5 py-0.5 text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,title:`Toggle markdown preview`,children:i?`Edit`:`Preview`})]}):null,children:`Notes`}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1 ${t?`px-0 pb-0`:`px-3 pb-3`}`,children:e?i?(0,J.jsx)(`div`,{className:`h-full w-full overflow-auto bg-surface px-4 py-3 ${t?`border-t border-line`:`rounded border border-line`}`,children:n.trim()?(0,J.jsx)(`div`,{className:`kobe-md text-[12px] leading-relaxed text-fg`,dangerouslySetInnerHTML:{__html:u}}):(0,J.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Nothing to preview yet.`})}):(0,J.jsx)(`textarea`,{value:n,onChange:e=>p(e.target.value),spellCheck:!1,placeholder:o?`loading notes…`:`Notes for this task — markdown, autosaved.`,disabled:o,className:`h-full w-full resize-none border-line bg-surface px-4 py-3 font-mono text-[12px] leading-relaxed text-fg placeholder:text-subtle focus:border-line-active focus:outline-none disabled:opacity-60 ${t?`border-x-0 border-b-0 border-t`:`rounded border`}`}):(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,J.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to open its web-only scratchpad.`})]})})})]})}var Me=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],Ne=`DIRTY_WORKTREE`;function Pe(e){return e.replace(/_/g,` `)}function Z({name:e,value:t,mono:n=!1}){return(0,J.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2 last:border-b-0`,children:[(0,J.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,J.jsx)(`div`,{className:`mt-1 min-w-0 truncate text-[12px] text-fg ${n?`font-mono`:``}`,title:t,children:t||`—`})]})}function Q({children:e,onClick:t,disabled:n,danger:r=!1}){return(0,J.jsx)(`button`,{type:`button`,onClick:t,disabled:n,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${r?`border-kobe-red/40 text-kobe-red hover:bg-kobe-red/10`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:e})}function Fe({task:e}){let[t,n]=(0,B.useState)(e?.title??``),[r,a]=(0,B.useState)(e?.branch??``),[l,u]=(0,B.useState)(null),[d,f]=(0,B.useState)(!1),p=(0,B.useRef)(null);(0,B.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let[h,g]=(0,B.useState)(null),_=O(),v=o();if((0,B.useEffect)(()=>{n(e?.title??``)},[e?.title]),(0,B.useEffect)(()=>{a(e?.branch??``)},[e?.branch]),!e)return(0,J.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,J.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Pick a task to edit its metadata and worktree state.`})]})});let y=async(e,t)=>{u(e);try{await t()}catch(t){c(e.split(`:`)[0],t)}finally{u(null)}},b=()=>{let n=t.trim();!n||n===e.title||y(`rename`,()=>m(`task.rename`,{taskId:e.id,title:n}))},x=()=>{let t=r.trim();!t||t===e.branch||y(`branch`,()=>m(`task.setBranch`,{taskId:e.id,branch:t}))},S=()=>{be(e.worktreePath).then(e=>{e&&(f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1200))})},w=()=>{g(null),y(`archive`,async()=>{await m(`task.archive`,{taskId:e.id,archived:!0}),i(),v({to:`/`}),await C(null)})},T=()=>{y(`restore`,()=>m(`task.archive`,{taskId:e.id,archived:!1}))},E=t=>{g(null),u(`delete`),(async()=>{try{await m(`task.delete`,{taskId:e.id,force:t}),i(),v({to:`/`}),N(null),s(`success`,`Deleted "${e.title||e.branch}"`)}catch(e){let n=e instanceof Error?e.message:String(e);!t&&n.includes(Ne)?g({kind:`delete`,force:!0}):c(`delete`,e)}finally{u(null)}})()};return(0,J.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,J.jsxs)(`div`,{className:`border-b border-line px-3 py-3`,children:[(0,J.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Task`}),(0,J.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,J.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onBlur:b,onKeyDown:e=>{e.key===`Enter`&&b()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1.5 text-[12px] text-fg focus:border-line-active focus:outline-none`}),(0,J.jsx)(Q,{onClick:b,disabled:l===`rename`,children:`Save`})]}),e.archived&&(0,J.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-2 border border-kobe-yellow/40 bg-kobe-yellow/10 px-2 py-1.5`,children:[(0,J.jsx)(`span`,{className:`text-[11px] text-kobe-yellow`,children:`archived`}),(0,J.jsx)(Q,{onClick:T,disabled:l!==null,children:`Restore`})]})]}),(0,J.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:[e.kind===`main`?(0,J.jsx)(Z,{name:`Branch`,value:e.branch,mono:!0}):(0,J.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2`,children:[(0,J.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Branch`}),(0,J.jsx)(`div`,{className:`mt-1 flex gap-2`,children:(0,J.jsx)(`input`,{value:r,onChange:e=>a(e.target.value),onBlur:x,onKeyDown:e=>{e.key===`Enter`&&x()},className:`min-w-0 flex-1 border border-line bg-bg px-2 py-1 font-mono text-[12px] text-fg focus:border-line-active focus:outline-none`})})]}),(0,J.jsx)(Z,{name:`Vendor`,value:e.vendor??`claude`}),(0,J.jsx)(Z,{name:`Worktree`,value:e.worktreePath,mono:!0}),(0,J.jsx)(Z,{name:`Repo`,value:e.repo,mono:!0}),(0,J.jsxs)(`div`,{className:`mt-4`,children:[(0,J.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Status`}),(0,J.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:Me.map(t=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>void y(`status:${t}`,()=>m(`task.status`,{taskId:e.id,status:t})),disabled:l!==null,className:`border px-2 py-1.5 text-left text-[11px] capitalize transition-colors disabled:opacity-40 ${e.status===t?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:Pe(t)},t))})]}),(0,J.jsxs)(`div`,{className:`mt-4`,children:[(0,J.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Vendor`}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(t=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>void y(`vendor:${t.id}`,()=>m(`task.setVendor`,{taskId:e.id,vendor:t.id})),disabled:l!==null,className:`border px-2 py-1 text-[11px] transition-colors disabled:opacity-40 ${(e.vendor??`claude`)===t.id?`border-primary bg-inset text-fg`:`border-line bg-surface text-muted hover:border-primary hover:text-fg`}`,children:t.label},t.id))})]}),(0,J.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,J.jsx)(Q,{onClick:()=>void y(`pin`,()=>m(`task.pin`,{taskId:e.id,pinned:!e.pinned})),disabled:l!==null,children:e.pinned?`Unpin`:`Pin`}),(0,J.jsx)(Q,{onClick:()=>void y(`worktree`,()=>m(`task.ensureWorktree`,{taskId:e.id})),disabled:l!==null,children:`Ensure worktree`}),(0,J.jsx)(Q,{onClick:S,children:d?`Copied`:`Copy path`}),!e.archived&&(0,J.jsx)(Q,{onClick:()=>g({kind:`archive`}),disabled:l!==null,danger:!0,children:`Archive`})]}),e.kind!==`main`&&(0,J.jsxs)(`div`,{className:`mt-4 border-t border-line-subtle pt-3`,children:[(0,J.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Danger zone`}),(0,J.jsx)(Q,{onClick:()=>g({kind:`delete`,force:!1}),disabled:l!==null,danger:!0,children:`Delete task + worktree`})]})]}),h?.kind===`archive`&&(0,J.jsx)(R,{title:`Archive task`,body:`Archive "${e.title||e.branch}"? Its tmux session and engine will be stopped; the worktree stays on disk and the task can be restored from the Archived section.`,confirmLabel:`Archive`,danger:!0,busy:l===`archive`,onConfirm:w,onCancel:()=>g(null)}),h?.kind===`delete`&&(0,J.jsx)(R,{title:h.force?`Worktree has uncommitted changes`:`Delete task`,body:h.force?`"${e.title||e.branch}" has uncommitted or untracked changes in its worktree. Force-delete discards them permanently.`:`Delete "${e.title||e.branch}"? This removes the task, kills its engine session, and removes its worktree (branch history stays in git).`,confirmLabel:h.force?`Force delete`:`Delete`,danger:!0,busy:l===`delete`,onConfirm:()=>E(h.force),onCancel:()=>g(null)})]})}function Ie({drawer:e=!1,onClose:n}={}){let[i,a]=(0,B.useState)(`overview`),{selectedTaskId:o}=t(),{tasks:s}=p(),c=o?s.find(e=>e.id===o)??null:null;return(0,J.jsxs)(`aside`,{className:e?`flex h-full w-full flex-col bg-bg`:`flex w-80 shrink-0 flex-col border-l border-line bg-bg`,children:[(0,J.jsxs)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:[[`overview`,`notes`,`changes`].map(e=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`px-3 text-[10px] font-bold uppercase tracking-[0.12em] ${i===e?`border-b-2 border-primary text-fg`:`text-subtle hover:text-muted`}`,children:e===`overview`?`Task`:e===`notes`?`Notes`:`Changes`},e)),e&&n&&(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`ml-auto px-3 text-subtle hover:text-fg`,"aria-label":`Close tools`,children:(0,J.jsx)(k,{size:14,strokeWidth:2})})]}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:i===`overview`?(0,J.jsx)(Fe,{task:c}):i===`notes`?(0,J.jsx)(je,{taskId:o,full:!0}):(0,J.jsx)(v,{worktreePath:c?.worktreePath??null,onOpenFile:e=>{o&&r(o,e)}})})]})}function Le({children:e,suffix:t}){return(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,J.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function $({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:D(t?.state),l=x(e.updatedAt||e.createdAt);return(0,J.jsxs)(`button`,{type:`button`,"data-task-id":e.id,onClick:o,className:`group w-full border-l-2 px-3 py-2 text-left transition-colors ${a?`border-primary bg-inset`:`border-transparent hover:bg-surface`}`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,J.jsx)(z,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,J.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${E(t?.state)}`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,J.jsx)(oe,{pr:e.prStatus}),e.pinned&&(0,J.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,J.jsx)(le,{counts:r})]}),(0,J.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,J.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,J.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,J.jsx)(se,{label:i}),c&&(0,J.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,J.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Re({task:e,onRestore:t}){return(0,J.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:e.title||e.branch}),(0,J.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-muted opacity-0 transition-opacity hover:border-primary hover:text-fg group-hover:opacity-100`,children:`Restore`})]})}function ze({onOpenSettings:e,onNewTask:r,onAdopt:i}){let{tasks:a,engineStates:s,jobs:l,worktreeChanges:u,uiPrefs:d,hydrated:f,streamConnected:h}=p(),{selectedTaskId:g}=t(),_=O(),v=(0,B.useMemo)(()=>ie(a),[a]),y=e=>ae(_,e,v),{query:b,statusFilter:x,sortMode:S,showArchived:C}=ge(),w=(0,B.useRef)(null),T=(0,B.useRef)(null);(0,B.useEffect)(()=>{g&&w.current?.querySelector(`[data-task-id="${CSS.escape(g)}"]`)?.scrollIntoView({block:`nearest`})},[g]);let E=d?.sortMode;(0,B.useEffect)(()=>{he(E)},[E]);let D=(0,B.useMemo)(()=>a.filter(e=>!e.archived),[a]),A=(0,B.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),j=(0,B.useMemo)(()=>_e(D.filter(e=>ve(e,b)&&re(s[e.id],u[e.worktreePath],x)),S),[D,b,x,S,s,u]),M=j.filter(e=>e.kind===`main`),P=j.filter(e=>e.kind!==`main`),F=!f||!h&&a.length===0,I=o(),L=e=>{n(e),N(e),I({to:`/task/$taskId`,params:{taskId:e}})};(0,B.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.key,n=t===`ArrowDown`||t===`ArrowUp`,r=t===`j`||t===`ArrowDown`,i=t===`k`||t===`ArrowUp`,a=t===`/`;if(!r&&!i&&!a)return;let o=e.target;if(o&&(o.tagName===`INPUT`||o.tagName===`TEXTAREA`||o.tagName===`SELECT`||o.isContentEditable)||document.querySelector(`[role=dialog],[role=alertdialog]`)||document.querySelector(`[data-settings-open]`))return;if(a){e.preventDefault(),T.current?.focus();return}if(n&&o&&o!==document.body&&!w.current?.contains(o)||j.length===0)return;e.preventDefault();let s=j.findIndex(e=>e.id===g);L(j[s===-1?0:Math.min(Math.max(s+(r?1:-1),0),j.length-1)].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[j,g]);let oe=e=>{m(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>c(`restore "${e.title||e.branch}"`,t))};return(0,J.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,J.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,J.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:()=>pe(S==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${S===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,J.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[j.length,`/`,D.length]}),(0,J.jsx)(`button`,{type:`button`,onClick:i,className:`text-muted transition-colors hover:text-primary`,title:`Adopt an existing worktree`,"aria-label":`Adopt worktree`,children:(0,J.jsx)(de,{size:14,strokeWidth:1.9})}),(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,J.jsx)(ee,{size:14,strokeWidth:2.2})})]})]}),(0,J.jsxs)(`label`,{className:`mt-2 flex h-8 items-center gap-2 border border-line bg-bg px-2 text-[12px] text-muted focus-within:border-line-active`,children:[(0,J.jsx)(te,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,J.jsx)(`input`,{ref:T,value:b,onChange:e=>W(e.target.value),onKeyDown:e=>{e.key===`Enter`&&j.length>0?(e.preventDefault(),L(j[0].id),e.currentTarget.blur()):e.key===`Escape`&&b&&(e.preventDefault(),W(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),b&&(0,J.jsx)(`button`,{type:`button`,onClick:()=>W(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,J.jsx)(k,{size:13,strokeWidth:2})})]}),(0,J.jsx)(`div`,{className:`mt-2 flex items-center gap-1`,children:[{key:`all`,label:`All`,title:`All tasks`},{key:`attention`,label:`Needs`,title:`Needs input / errored / rate-limited`}].map(e=>(0,J.jsx)(`button`,{type:`button`,onClick:()=>G(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${x===e.key?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:e.label},e.key))})]}),(0,J.jsxs)(`div`,{ref:w,className:`flex-1 overflow-y-auto`,children:[F?(0,J.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,J.jsx)(z,{size:13,strokeWidth:2,className:`animate-spin`}),(0,J.jsx)(`span`,{children:`connecting…`})]}):D.length===0?(0,J.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,J.jsx)(`p`,{children:`No tasks yet.`}),(0,J.jsx)(`button`,{type:`button`,onClick:r,className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`+ New task`})]}):j.length===0?(0,J.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,J.jsx)(`div`,{children:b?`No matches for “${b}”.`:`No tasks in this status.`}),(0,J.jsx)(`button`,{type:`button`,onClick:()=>{W(``),G(`all`)},className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Clear filter`})]}):(0,J.jsxs)(J.Fragment,{children:[M.length>0&&(0,J.jsx)(Le,{children:`Projects`}),M.map(e=>(0,J.jsx)($,{task:e,engine:s[e.id],job:l[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id)),P.length>0&&(0,J.jsx)(Le,{suffix:S==="default"?void 0:S,children:`Worktrees`}),P.map(e=>(0,J.jsx)($,{task:e,engine:s[e.id],job:l[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id))]}),!F&&A.length>0&&(0,J.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>me(!C),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,J.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,J.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:A.length}),(0,J.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:C?`−`:`+`})]}),C&&A.map(e=>(0,J.jsx)(Re,{task:e,onRestore:()=>oe(e)},e.id))]})]}),(0,J.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,J.jsxs)(`button`,{type:`button`,onClick:e,className:`flex w-full items-center gap-2 border border-line bg-surface px-2 py-2 text-left text-[12px] text-muted transition-colors hover:border-primary hover:bg-inset hover:text-fg`,children:[(0,J.jsx)(ne,{size:15,strokeWidth:1.8}),(0,J.jsx)(`span`,{children:`Settings`})]})})]})}function Be({onToggleTools:e,onShowHelp:n}){let{daemonConnected:r,streamConnected:i,tasks:a}=p(),{selectedTaskId:o}=t(),s=o?a.find(e=>e.id===o):null,c=L({daemonConnected:r,streamConnected:i});return(0,J.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,J.jsx)(ce,{}),(0,J.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,J.jsx)(f,{}),s?(0,J.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,J.jsx)(`span`,{className:`max-w-56 truncate rounded bg-inset px-2 py-0.5 text-[11px] text-fg`,children:s.title||s.branch}),(0,J.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-[11px] text-subtle md:inline`,children:s.branch})]}):(0,J.jsx)(`span`,{className:`rounded bg-inset px-2 py-0.5 text-[11px] text-muted`,children:`Workspace`}),(0,J.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[11px] text-subtle`,children:[(0,J.jsxs)(`span`,{className:`hidden items-center gap-1.5 sm:flex`,title:c.title,children:[(0,J.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${c.ok?`bg-kobe-green`:`bg-kobe-yellow`}`}),(0,J.jsx)(`span`,{children:c.label})]}),(0,J.jsx)(`button`,{type:`button`,onClick:n,className:`hidden items-center text-muted transition-colors hover:text-fg sm:flex`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts (?)`,children:(0,J.jsx)(ue,{size:15,strokeWidth:1.8})}),(0,J.jsx)(`button`,{type:`button`,onClick:e,className:`flex items-center text-muted transition-colors hover:text-fg lg:hidden`,"aria-label":`Toggle task tools`,title:`Task tools`,children:(0,J.jsx)(fe,{size:15,strokeWidth:1.8})})]})]})}function Ve(){let{tasks:e,update:n}=p(),{selectedTaskId:r}=t(),i=r?e.find(e=>e.id===r):null,a=e.filter(e=>!e.archived).length;return(0,J.jsxs)(`footer`,{className:`flex h-7 shrink-0 items-center gap-4 border-t border-line bg-surface px-3 text-[11px] text-subtle`,children:[(0,J.jsxs)(`span`,{children:[a,` task`,a===1?``:`s`]}),i&&(0,J.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[i.kind===`main`?`project`:`worktree`,` ·`,` `,_(i.worktreePath,54)]}),(0,J.jsx)(`span`,{className:`ml-auto`,children:n?.latest?`update ${n.latest} available`:`kobe web`})]})}function He(){let{settingsOpen:e}=w(),[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,J.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,J.jsx)(Be,{onToggleTools:()=>i(e=>!e),onShowHelp:F}),(0,J.jsx)(d,{}),(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,J.jsx)(ze,{onOpenSettings:P,onNewTask:T,onAdopt:()=>n(!0)}),e?(0,J.jsx)(b,{onClose:M}):(0,J.jsx)(y,{}),(0,J.jsx)(`div`,{className:`hidden lg:flex`,children:(0,J.jsx)(Ie,{})}),r&&(0,J.jsx)(`div`,{className:`fixed inset-0 z-30 flex justify-end bg-black/50 lg:hidden`,onClick:()=>i(!1),onKeyDown:e=>{e.key===`Escape`&&i(!1)},role:`presentation`,children:(0,J.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`Task tools`,className:`h-full w-80 max-w-[85vw] border-l border-line bg-bg shadow-2xl`,onClick:e=>e.stopPropagation(),onKeyDown:()=>{},children:(0,J.jsx)(Ie,{drawer:!0,onClose:()=>i(!1)})})})]}),(0,J.jsx)(Ve,{}),t&&(0,J.jsx)(ye,{onClose:()=>n(!1)})]})}export{He as AppShell};
|
|
@@ -1 +0,0 @@
|
|
|
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-Dq7AkivK.js";import{n as a,r as o,t as s}from"./SlideOver-CLaRtSQE.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};
|
|
@@ -1 +0,0 @@
|
|
|
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-Dq7AkivK.js";import{n as s,r as c,t as l}from"./SlideOver-CLaRtSQE.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};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Board as e}from"./Board-Cb_qgK8p.js";var t=e;export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{IssuesPage as e}from"./IssuesPage-zQbthJwx.js";var t=e;export{t as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{AppShell as e}from"./AppShell-CYm01lx0.js";var t=e;export{t as component};
|
|
File without changes
|