@sma1lboy/kobe 0.7.91 → 0.7.93

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 (31) hide show
  1. package/dist/cli/index.js +371 -371
  2. package/dist/web-ui/assets/AppShell-BEJGNTTN.js +5 -0
  3. package/dist/web-ui/assets/Board-IDFIzXrT.js +1 -0
  4. package/dist/web-ui/assets/{BoardPeek-nU0SN6cl.js → BoardPeek-BTehy4UX.js} +1 -1
  5. package/dist/web-ui/assets/ChatTranscript-BKbzoH8U.js +1 -0
  6. package/dist/web-ui/assets/{ConfirmDialog-cqOtp-Pc.js → ConfirmDialog-s0vMlcAP.js} +1 -1
  7. package/dist/web-ui/assets/{IssueIntakePanel-zBtgq4zu.js → IssueIntakePanel-DzyNodnf.js} +1 -1
  8. package/dist/web-ui/assets/{IssuePeek-uK2AqpVg.js → IssuePeek-j-sd5Pit.js} +1 -1
  9. package/dist/web-ui/assets/{IssuesPage-CfAZVOqX.js → IssuesPage-CizzkyG3.js} +1 -1
  10. package/dist/web-ui/assets/{RichEditor-BxYBnBst.js → RichEditor-B5dldvlg.js} +1 -1
  11. package/dist/web-ui/assets/SettingsPage-DF_alouR.js +2 -0
  12. package/dist/web-ui/assets/{SlideOver-D8iHEajO.js → SlideOver-Ds3g7tXz.js} +1 -1
  13. package/dist/web-ui/assets/{ViewToggle-Ks6S0ed3.js → ViewToggle-CfWPMzZq.js} +1 -1
  14. package/dist/web-ui/assets/{WorkspaceTabs-XzXvKFO2.js → WorkspaceTabs-DR7NCXZH.js} +1 -1
  15. package/dist/web-ui/assets/board-B6uuMuPK.js +1 -0
  16. package/dist/web-ui/assets/{index-B8vllT-Z.js → index-CLHcUG-u.js} +2 -2
  17. package/dist/web-ui/assets/{issues-CBlvj9fb.js → issues-BNEYA0hF.js} +1 -1
  18. package/dist/web-ui/assets/issues-BpIswsef.js +1 -0
  19. package/dist/web-ui/assets/{lazy-issue-panels-DiR5Ajwo.js → lazy-issue-panels-BuVM5o5S.js} +3 -3
  20. package/dist/web-ui/assets/routes-B-g-4AF8.js +1 -0
  21. package/dist/web-ui/assets/{task._taskId-DQKIMlZR.js → task._taskId-D9HssxYO.js} +1 -1
  22. package/dist/web-ui/assets/{worktrees-BZ0Y8HuE.js → worktrees-Sg0XZDuk.js} +1 -1
  23. package/dist/web-ui/index.html +1 -1
  24. package/package.json +1 -2
  25. package/dist/web-ui/assets/AppShell-BuGGPMuO.js +0 -5
  26. package/dist/web-ui/assets/Board-qlAVxf0y.js +0 -1
  27. package/dist/web-ui/assets/ChatTranscript-DwC3GoFY.js +0 -1
  28. package/dist/web-ui/assets/SettingsPage-CWlKrPol.js +0 -2
  29. package/dist/web-ui/assets/board-DGj1wrln.js +0 -1
  30. package/dist/web-ui/assets/issues-Bbnu3kjy.js +0 -1
  31. package/dist/web-ui/assets/routes-DCJvRvD0.js +0 -1
@@ -1,3 +1,3 @@
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-B8vllT-Z.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(`
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-CLHcUG-u.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
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(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};
@@ -0,0 +1 @@
1
+ import{IssuesPage as e}from"./IssuesPage-CizzkyG3.js";var t=e;export{t as component};
@@ -1,6 +1,6 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/IssueIntakePanel-zBtgq4zu.js","assets/terminal-B6OlmT6e.js","assets/tabs-B_hac99E.js","assets/createLucideIcon-Dn8f0BBU.js","assets/SlideOver-D8iHEajO.js","assets/index-B8vllT-Z.js","assets/toast-D798wIYZ.js","assets/external-store-DUMhHvtl.js","assets/store-CbgoTSs1.js","assets/index-DmtC0Wbe.css","assets/issues-CBlvj9fb.js","assets/text-match-C3BRtNXy.js","assets/RichEditor-BxYBnBst.js","assets/RichEditor-B4sEOPyN.css","assets/IssuePeek-uK2AqpVg.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-CBlvj9fb.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(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/IssueIntakePanel-DzyNodnf.js","assets/terminal-B6OlmT6e.js","assets/tabs-B_hac99E.js","assets/createLucideIcon-Dn8f0BBU.js","assets/SlideOver-Ds3g7tXz.js","assets/index-CLHcUG-u.js","assets/toast-D798wIYZ.js","assets/external-store-DUMhHvtl.js","assets/store-CbgoTSs1.js","assets/index-DmtC0Wbe.css","assets/issues-BNEYA0hF.js","assets/text-match-C3BRtNXy.js","assets/RichEditor-B5dldvlg.js","assets/RichEditor-B4sEOPyN.css","assets/IssuePeek-j-sd5Pit.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-BNEYA0hF.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);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-zBtgq4zu.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-uK2AqpVg.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};
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-DzyNodnf.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-j-sd5Pit.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};
@@ -0,0 +1 @@
1
+ import{AppShell as e}from"./AppShell-BEJGNTTN.js";var t=e;export{t as component};
@@ -1 +1 @@
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-B8vllT-Z.js";import{AppShell as s}from"./AppShell-BuGGPMuO.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};
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-CLHcUG-u.js";import{AppShell as s}from"./AppShell-BEJGNTTN.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};
@@ -1 +1 @@
1
- import{a as e,l as t,o as n}from"./terminal-B6OlmT6e.js";import{y as r}from"./tabs-B_hac99E.js";import{a as i,r as a}from"./toast-D798wIYZ.js";import{d as o,t as s}from"./createLucideIcon-Dn8f0BBU.js";import{n as c}from"./store-CbgoTSs1.js";import{t as l}from"./arrow-left-BXrVItPe.js";import{n as u}from"./time-kviT26Tm.js";import{n as d,t as f}from"./ConfirmDialog-cqOtp-Pc.js";var p=s(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),m=t(r(),1),h=class extends Error{};async function g(){let e=await n.get(`/api/worktrees`,{label:`load worktrees`});return Array.isArray(e.projects)?e.projects:[]}async function _(t,r){try{await n.delete(`/api/worktrees`,{path:t,force:r},{label:`delete worktree`})}catch(t){throw t instanceof e&&/refusing to remove dirty worktree/.test(t.detail)?new h(t.detail):t}}var v=o();function y(e){return e===!0?(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-green`,children:`on remote`}):e===!1?(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`not pushed`}):(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`remote unknown`})}function b({row:e,linkedTaskTitle:t,onDelete:n}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.kobeManaged&&(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`}),e.dirty&&(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),y(e.branchOnRemote),t&&(0,v.jsxs)(`span`,{className:`shrink-0 truncate text-[10px] text-subtle`,children:[`task: `,t]})]}),(0,v.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.createdAtMs>0&&(0,v.jsxs)(`span`,{className:`ml-auto shrink-0`,children:[`created `,u(e.createdAtMs)]})]})]}),(0,v.jsx)(`button`,{type:`button`,onClick:n,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-kobe-red hover:text-kobe-red`,children:`Delete`})]})}function x(){let e=i(),{tasks:t}=c(),[n,r]=(0,m.useState)(null),[o,s]=(0,m.useState)(!1),[u,y]=(0,m.useState)(null),[x,S]=(0,m.useState)(null),[C,w]=(0,m.useState)(!1),T=(0,m.useMemo)(()=>{let e=new Map;for(let n of t)n.worktreePath&&e.set(n.worktreePath,n.title||n.branch);return e},[t]),E=()=>{s(!0),g().then(r).catch(e=>a(`load worktrees`,e)).finally(()=>s(!1))};(0,m.useEffect)(E,[]);let D=e=>{r(t=>t?.map(t=>({...t,worktrees:t.worktrees.filter(t=>t.path!==e)}))??t)};return(0,v.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,v.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,v.jsx)(d,{}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>e({to:`/`}),className:`flex items-center gap-1.5 text-muted transition-colors hover:text-fg`,title:`Back to workspace`,children:[(0,v.jsx)(l,{size:15,strokeWidth:1.8}),(0,v.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,v.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Worktrees`}),(0,v.jsx)(`button`,{type:`button`,onClick:E,disabled:o,className:`ml-auto flex items-center gap-1.5 text-muted transition-colors hover:text-fg disabled:opacity-40`,title:`Refresh`,children:(0,v.jsx)(p,{size:13,strokeWidth:1.8,className:o?`animate-spin`:``})})]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:n===null?(0,v.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Loading worktrees…`}):n.length===0?(0,v.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No local projects known to kobe yet.`}):n.map(e=>(0,v.jsxs)(`div`,{className:`border-b border-line`,children:[(0,v.jsx)(`div`,{className:`border-b border-line-subtle bg-surface px-3 py-1.5 font-mono text-[11px] text-subtle`,children:e.repo}),e.worktrees.length===0?(0,v.jsx)(`p`,{className:`px-3 py-3 text-[12px] text-subtle`,children:`No worktrees.`}):e.worktrees.map(e=>(0,v.jsx)(b,{row:e,linkedTaskTitle:T.get(e.path)??null,onDelete:()=>y(e)},e.path))]},e.repo))}),u&&(0,v.jsx)(f,{title:`Delete worktree`,body:`Delete the worktree for "${u.branch||u.path}"? This removes the working directory; the branch itself is kept.`,confirmLabel:`Delete`,danger:!0,busy:C,onConfirm:()=>{if(!u)return;let e=u;w(!0),_(e.path,!1).then(()=>{D(e.path),y(null)}).catch(t=>{y(null),t instanceof h?S(e):a(`delete worktree`,t)}).finally(()=>w(!1))},onCancel:()=>y(null)}),x&&(0,v.jsx)(f,{title:`Force delete worktree`,body:`"${x.branch||x.path}" has uncommitted or untracked changes that will be PERMANENTLY LOST. Force delete anyway?`,confirmLabel:`Force delete`,danger:!0,busy:C,onConfirm:()=>{if(!x)return;let e=x;w(!0),_(e.path,!0).then(()=>{D(e.path),S(null)}).catch(e=>a(`force delete worktree`,e)).finally(()=>w(!1))},onCancel:()=>S(null)})]})}var S=x;export{S as component};
1
+ import{a as e,l as t,o as n}from"./terminal-B6OlmT6e.js";import{y as r}from"./tabs-B_hac99E.js";import{a as i,r as a}from"./toast-D798wIYZ.js";import{d as o,t as s}from"./createLucideIcon-Dn8f0BBU.js";import{n as c}from"./store-CbgoTSs1.js";import{t as l}from"./arrow-left-BXrVItPe.js";import{n as u}from"./time-kviT26Tm.js";import{n as d,t as f}from"./ConfirmDialog-s0vMlcAP.js";var p=s(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),m=t(r(),1),h=class extends Error{};async function g(){let e=await n.get(`/api/worktrees`,{label:`load worktrees`});return Array.isArray(e.projects)?e.projects:[]}async function _(t,r){try{await n.delete(`/api/worktrees`,{path:t,force:r},{label:`delete worktree`})}catch(t){throw t instanceof e&&/refusing to remove dirty worktree/.test(t.detail)?new h(t.detail):t}}var v=o();function y(e){return e===!0?(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-green`,children:`on remote`}):e===!1?(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`not pushed`}):(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`remote unknown`})}function b({row:e,linkedTaskTitle:t,onDelete:n}){return(0,v.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,v.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,v.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.kobeManaged&&(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`}),e.dirty&&(0,v.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),y(e.branchOnRemote),t&&(0,v.jsxs)(`span`,{className:`shrink-0 truncate text-[10px] text-subtle`,children:[`task: `,t]})]}),(0,v.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,v.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.createdAtMs>0&&(0,v.jsxs)(`span`,{className:`ml-auto shrink-0`,children:[`created `,u(e.createdAtMs)]})]})]}),(0,v.jsx)(`button`,{type:`button`,onClick:n,className:`shrink-0 border border-line bg-bg px-2 py-1 text-[11px] text-muted transition-colors hover:border-kobe-red hover:text-kobe-red`,children:`Delete`})]})}function x(){let e=i(),{tasks:t}=c(),[n,r]=(0,m.useState)(null),[o,s]=(0,m.useState)(!1),[u,y]=(0,m.useState)(null),[x,S]=(0,m.useState)(null),[C,w]=(0,m.useState)(!1),T=(0,m.useMemo)(()=>{let e=new Map;for(let n of t)n.worktreePath&&e.set(n.worktreePath,n.title||n.branch);return e},[t]),E=()=>{s(!0),g().then(r).catch(e=>a(`load worktrees`,e)).finally(()=>s(!1))};(0,m.useEffect)(E,[]);let D=e=>{r(t=>t?.map(t=>({...t,worktrees:t.worktrees.filter(t=>t.path!==e)}))??t)};return(0,v.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,v.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,v.jsx)(d,{}),(0,v.jsxs)(`button`,{type:`button`,onClick:()=>e({to:`/`}),className:`flex items-center gap-1.5 text-muted transition-colors hover:text-fg`,title:`Back to workspace`,children:[(0,v.jsx)(l,{size:15,strokeWidth:1.8}),(0,v.jsx)(`span`,{className:`text-[12px]`,children:`Workspace`})]}),(0,v.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Worktrees`}),(0,v.jsx)(`button`,{type:`button`,onClick:E,disabled:o,className:`ml-auto flex items-center gap-1.5 text-muted transition-colors hover:text-fg disabled:opacity-40`,title:`Refresh`,children:(0,v.jsx)(p,{size:13,strokeWidth:1.8,className:o?`animate-spin`:``})})]}),(0,v.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:n===null?(0,v.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Loading worktrees…`}):n.length===0?(0,v.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No local projects known to kobe yet.`}):n.map(e=>(0,v.jsxs)(`div`,{className:`border-b border-line`,children:[(0,v.jsx)(`div`,{className:`border-b border-line-subtle bg-surface px-3 py-1.5 font-mono text-[11px] text-subtle`,children:e.repo}),e.worktrees.length===0?(0,v.jsx)(`p`,{className:`px-3 py-3 text-[12px] text-subtle`,children:`No worktrees.`}):e.worktrees.map(e=>(0,v.jsx)(b,{row:e,linkedTaskTitle:T.get(e.path)??null,onDelete:()=>y(e)},e.path))]},e.repo))}),u&&(0,v.jsx)(f,{title:`Delete worktree`,body:`Delete the worktree for "${u.branch||u.path}"? This removes the working directory; the branch itself is kept.`,confirmLabel:`Delete`,danger:!0,busy:C,onConfirm:()=>{if(!u)return;let e=u;w(!0),_(e.path,!1).then(()=>{D(e.path),y(null)}).catch(t=>{y(null),t instanceof h?S(e):a(`delete worktree`,t)}).finally(()=>w(!1))},onCancel:()=>y(null)}),x&&(0,v.jsx)(f,{title:`Force delete worktree`,body:`"${x.branch||x.path}" has uncommitted or untracked changes that will be PERMANENTLY LOST. Force delete anyway?`,confirmLabel:`Force delete`,danger:!0,busy:C,onConfirm:()=>{if(!x)return;let e=x;w(!0),_(e.path,!0).then(()=>{D(e.path),S(null)}).catch(e=>a(`force delete worktree`,e)).finally(()=>w(!1))},onCancel:()=>S(null)})]})}var S=x;export{S as component};
@@ -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-B8vllT-Z.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CLHcUG-u.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/terminal-B6OlmT6e.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/tabs-B_hac99E.js">
11
11
  <link rel="modulepreload" crossorigin href="/assets/external-store-DUMhHvtl.js">
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@sma1lboy/kobe",
4
- "version": "0.7.91",
4
+ "version": "0.7.93",
5
5
  "description": "TUI orchestrator for Claude Code (codename)",
6
6
  "type": "module",
7
7
  "packageManager": "bun@1.3.13",
@@ -65,7 +65,6 @@
65
65
  "@xterm/headless": "^6.0.0",
66
66
  "node-pty": "^1.1.0",
67
67
  "react": "^19.2.0",
68
- "solid-js": "1.9.13",
69
68
  "ws": "^8.18.0"
70
69
  },
71
70
  "devDependencies": {
@@ -1,5 +0,0 @@
1
- import{l as e,o as t}from"./terminal-B6OlmT6e.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-B_hac99E.js";import{a as s,n as c,r as l}from"./toast-D798wIYZ.js";import{d as u,t as d}from"./createLucideIcon-Dn8f0BBU.js";import{n as f,t as p}from"./ViewToggle-Ks6S0ed3.js";import{n as m,t as h}from"./store-CbgoTSs1.js";import{t as g}from"./external-store-DUMhHvtl.js";import{i as _,r as v,t as y}from"./WorkspaceTabs-XzXvKFO2.js";import{t as b}from"./SettingsPage-CWlKrPol.js";import{t as x}from"./ChatTranscript-DwC3GoFY.js";import{C as S,D as C,E as w,S as T,T as E,_ as D,f as O,g as ee,h as k,m as A,n as te,o as ne,p as j,r as M,s as re,u as ie,v as ae,w as N,x as P,y as oe}from"./index-B8vllT-Z.js";import{t as F}from"./text-match-C3BRtNXy.js";import{n as I,t as L}from"./time-kviT26Tm.js";import{r as R}from"./web-transport-BS7imUMS.js";import{t as z}from"./SlideOver-D8iHEajO.js";import{n as B,r as V,t as H}from"./chips-L2qle6td.js";import{n as se,t as U}from"./ConfirmDialog-cqOtp-Pc.js";var ce=d(`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`}]]),le=d(`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`}]]),W=d(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ue=d(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),G=e(o(),1),K=g({query:``,statusFilter:`all`,sortMode:`default`,showArchived:!1}),de=null;function q(e){K.update(t=>({...t,...e}))}function J(e){q({query:e})}function fe(e){q({statusFilter:e})}function pe(e){q({sortMode:e})}function me(e){q({showArchived:e})}function he(e){!e||e===de||(de=e,q({sortMode:e}))}function ge(){return K.useSnapshot()}function _e(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function ve(e,t){let n=_e(t)-_e(e);return n===0?t.id.localeCompare(e.id):n}function ye(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(ve),i.sort(ve)),[...n,...r,...i]}function be(e,t){return F([e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `),t)}var Y=u();function xe({onClose:e}){let{tasks:t}=m(),n=s(),i=(0,G.useRef)(null);j(i);let a=(0,G.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]),o=(0,G.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[u,d]=(0,G.useState)(a[0]??``),[f,p]=(0,G.useState)(null),[g,_]=(0,G.useState)(!1),[v,y]=(0,G.useState)(null),[b,x]=(0,G.useState)(!1),S=async e=>{if(e){_(!0),p(null);try{let{worktrees:t}=await h(`worktree.discoverAdoptable`,{repo:e});p(t)}catch(e){l(`scan worktrees`,e),p([])}finally{_(!1)}}},w=async t=>{y(t.path);try{let{task:i}=await h(`worktree.adopt`,{repo:u,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),C(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),c(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){l(`adopt worktree`,e)}finally{y(null)}};return b?(0,Y.jsx)(M,{onClose:e}):a.length===0?(0,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,Y.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,Y.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,Y.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,Y.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,Y.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,Y.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,Y.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,Y.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:`pull an existing worktree into kobe`})]}),(0,Y.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,Y.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.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,Y.jsx)(`option`,{value:e,children:e},e))}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void S(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,Y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:f===null?(0,Y.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,Y.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=o.has(e.path);return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,Y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`kobe`})]}),(0,Y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,Y.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,Y.jsx)(`span`,{className:`ml-auto shrink-0`,children:I(e.lastActivityMs)})]})]}),t?(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,Y.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,Y.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,Y.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`})})]})})}function Se({task:e,onClose:t}){return(0,Y.jsx)(z,{open:e!==null,onClose:t,title:e?(0,Y.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 border border-line px-1 py-0.5 font-mono text-[9px] uppercase tracking-wide text-subtle`,children:`Archived`}),(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.title||e.branch})]}):void 0,children:e&&(0,Y.jsx)(x,{worktreePath:e.worktreePath??null,vendor:e.vendor??`claude`,title:e.title||e.branch})})}async function Ce(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 X(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var we=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function Te(e){let t=e.trim();return we.test(t)?t:null}function Ee(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 De(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Te(n.replace(/&amp;/g,`&`));return r?`<img src="${X(r)}" alt="${X(t)}" loading="lazy" class="kobe-md-img">`:`![${t}](${n})`})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(e,t,n)=>{let r=Ee(n.replace(/&amp;/g,`&`));return r?`<a href="${X(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 Z(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:De(e)).join(``)}function Oe(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(X(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">${Z(X(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${Z(X(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>${Z(X(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>${Z(X(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">${Z(X(l.join(` `)))}</p>`)}return a(),n.join(`
5
- `)}async function ke(e){return(await t.get(`/api/notes`,{query:{taskId:e},label:`load notes`})).markdown??``}async function Ae(e,n){await t.put(`/api/notes`,{taskId:e,markdown:n},{label:`save notes`})}function je(e){switch(e){case`saving`:return`saving…`;case`saved`:return`saved`;case`error`:return`save failed`;default:return``}}var Me=600;function Ne({children:e,right:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t]})}function Pe({taskId:e,full:t=!1}){let[n,r]=(0,G.useState)(``),[i,a]=(0,G.useState)(!1),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(`idle`),u=(0,G.useMemo)(()=>Oe(n),[n]),d=(0,G.useRef)(null),f=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(d.current&&clearTimeout(d.current),f.current=e,l(`idle`),r(``),a(!1),!e)return;let t=!1;return s(!0),ke(e).then(n=>{!t&&f.current===e&&r(n)}).catch(()=>{!t&&f.current===e&&r(``)}).finally(()=>{t||s(!1)}),()=>{t=!0}},[e]),(0,G.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let p=(0,G.useCallback)(t=>{if(r(t),!e)return;let n=e;l(`saving`),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>{Ae(n,t).then(()=>{f.current===n&&l(`saved`)}).catch(()=>{f.current===n&&l(`error`)})},Me)},[e]);return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 flex-1 flex-col bg-bg`,children:[(0,Y.jsx)(Ne,{right:e?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c!==`idle`&&(0,Y.jsx)(`span`,{className:`text-[10px] ${c===`error`?`text-kobe-red`:`text-subtle`}`,children:je(c)}),(0,Y.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,Y.jsx)(`div`,{className:`min-h-0 flex-1 ${t?`px-0 pb-0`:`px-3 pb-3`}`,children:e?i?(0,Y.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,Y.jsx)(`div`,{className:`kobe-md text-[12px] leading-relaxed text-fg`,dangerouslySetInnerHTML:{__html:u}}):(0,Y.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Nothing to preview yet.`})}):(0,Y.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,Y.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,Y.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 Fe=[`backlog`,`in_progress`,`in_review`,`done`,`canceled`,`error`],Ie=`DIRTY_WORKTREE`;function Le(e){return e.replace(/_/g,` `)}function Q({name:e,value:t,mono:n=!1}){return(0,Y.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2 last:border-b-0`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),(0,Y.jsx)(`div`,{className:`mt-1 min-w-0 truncate text-[12px] text-fg ${n?`font-mono`:``}`,title:t,children:t||`—`})]})}function $({children:e,onClick:t,disabled:n,danger:r=!1}){return(0,Y.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 Re({task:e}){let[t,n]=(0,G.useState)(e?.title??``),[r,i]=(0,G.useState)(e?.branch??``),[o,u]=(0,G.useState)(null),[d,f]=(0,G.useState)(!1),p=(0,G.useRef)(null);(0,G.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let[m,g]=(0,G.useState)(null),_=O(),v=s();if((0,G.useEffect)(()=>{n(e?.title??``)},[e?.title]),(0,G.useEffect)(()=>{i(e?.branch??``)},[e?.branch]),!e)return(0,Y.jsx)(`div`,{className:`flex h-full items-center justify-center px-4 text-center`,children:(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,Y.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){l(e.split(`:`)[0],t)}finally{u(null)}},b=()=>{let n=t.trim();!n||n===e.title||y(`rename`,()=>h(`task.rename`,{taskId:e.id,title:n}))},x=()=>{let t=r.trim();!t||t===e.branch||y(`branch`,()=>h(`task.setBranch`,{taskId:e.id,branch:t}))},S=()=>{Ce(e.worktreePath).then(e=>{e&&(f(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>f(!1),1200))})},T=()=>{g(null),y(`archive`,async()=>{await h(`task.archive`,{taskId:e.id,archived:!0}),a(),v({to:`/`}),await w(null)})},E=()=>{y(`restore`,()=>h(`task.archive`,{taskId:e.id,archived:!1}))},D=t=>{g(null),u(`delete`),(async()=>{try{await h(`task.delete`,{taskId:e.id,force:t}),a(),v({to:`/`}),C(null),c(`success`,`Deleted "${e.title||e.branch}"`)}catch(e){let n=e instanceof Error?e.message:String(e);!t&&n.includes(Ie)?g({kind:`delete`,force:!0}):l(`delete`,e)}finally{u(null)}})()};return(0,Y.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,Y.jsxs)(`div`,{className:`border-b border-line px-3 py-3`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Task`}),(0,Y.jsxs)(`div`,{className:`mt-2 flex gap-2`,children:[(0,Y.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,Y.jsx)($,{onClick:b,disabled:o===`rename`,children:`Save`})]}),e.archived&&(0,Y.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,Y.jsx)(`span`,{className:`text-[11px] text-kobe-yellow`,children:`archived`}),(0,Y.jsx)($,{onClick:E,disabled:o!==null,children:`Restore`})]})]}),(0,Y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:[e.kind===`main`?(0,Y.jsx)(Q,{name:`Branch`,value:e.branch,mono:!0}):(0,Y.jsxs)(`div`,{className:`min-w-0 border-b border-line-subtle py-2`,children:[(0,Y.jsx)(`div`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Branch`}),(0,Y.jsx)(`div`,{className:`mt-1 flex gap-2`,children:(0,Y.jsx)(`input`,{value:r,onChange:e=>i(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,Y.jsx)(Q,{name:`Vendor`,value:e.vendor??`claude`}),(0,Y.jsx)(Q,{name:`Worktree`,value:e.worktreePath,mono:!0}),(0,Y.jsx)(Q,{name:`Repo`,value:e.repo,mono:!0}),(0,Y.jsxs)(`div`,{className:`mt-4`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Status`}),(0,Y.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:Fe.map(t=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void y(`status:${t}`,()=>h(`task.status`,{taskId:e.id,status:t})),disabled:o!==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:Le(t)},t))})]}),(0,Y.jsxs)(`div`,{className:`mt-4`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Vendor`}),(0,Y.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:_.map(t=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>void y(`vendor:${t.id}`,()=>h(`task.setVendor`,{taskId:e.id,vendor:t.id})),disabled:o!==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,Y.jsxs)(`div`,{className:`mt-4 grid grid-cols-2 gap-2`,children:[(0,Y.jsx)($,{onClick:()=>void y(`pin`,()=>h(`task.pin`,{taskId:e.id,pinned:!e.pinned})),disabled:o!==null,children:e.pinned?`Unpin`:`Pin`}),(0,Y.jsx)($,{onClick:()=>void y(`worktree`,()=>h(`task.ensureWorktree`,{taskId:e.id})),disabled:o!==null,children:`Ensure worktree`}),(0,Y.jsx)($,{onClick:S,children:d?`Copied`:`Copy path`}),!e.archived&&(0,Y.jsx)($,{onClick:()=>g({kind:`archive`}),disabled:o!==null,danger:!0,children:`Archive`})]}),e.kind!==`main`&&(0,Y.jsxs)(`div`,{className:`mt-4 border-t border-line-subtle pt-3`,children:[(0,Y.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Danger zone`}),(0,Y.jsx)($,{onClick:()=>g({kind:`delete`,force:!1}),disabled:o!==null,danger:!0,children:`Delete task + worktree`})]})]}),m?.kind===`archive`&&(0,Y.jsx)(U,{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:o===`archive`,onConfirm:T,onCancel:()=>g(null)}),m?.kind===`delete`&&(0,Y.jsx)(U,{title:m.force?`Worktree has uncommitted changes`:`Delete task`,body:m.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:m.force?`Force delete`:`Delete`,danger:!0,busy:o===`delete`,onConfirm:()=>D(m.force),onCancel:()=>g(null)})]})}function ze({drawer:e=!1,onClose:t}={}){let[r,a]=(0,G.useState)(`overview`),{selectedTaskId:o}=n(),{tasks:s}=m(),c=o?s.find(e=>e.id===o)??null:null;return(0,Y.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,Y.jsxs)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:[[`overview`,`notes`,`changes`].map(e=>(0,Y.jsx)(`button`,{type:`button`,onClick:()=>a(e),className:`px-3 text-[10px] font-bold uppercase tracking-[0.12em] ${r===e?`border-b-2 border-primary text-fg`:`text-subtle hover:text-muted`}`,children:e===`overview`?`Task`:e===`notes`?`Notes`:`Changes`},e)),e&&t&&(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`ml-auto px-3 text-subtle hover:text-fg`,"aria-label":`Close tools`,children:(0,Y.jsx)(ee,{size:14,strokeWidth:2})})]}),(0,Y.jsx)(`div`,{className:`min-h-0 flex-1`,children:r===`overview`?(0,Y.jsx)(Re,{task:c}):r===`notes`?(0,Y.jsx)(Pe,{taskId:o,full:!0}):(0,Y.jsx)(v,{worktreePath:c?.worktreePath??null,onOpenFile:e=>{o&&i(o,e)}})})]})}function Be({children:e,suffix:t}){return(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function Ve({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:k(t?.state),l=L(e.updatedAt||e.createdAt);return(0,Y.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,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,Y.jsx)(W,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${A(t?.state)}`}),(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,Y.jsx)(V,{pr:e.prStatus}),e.pinned&&(0,Y.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,Y.jsx)(H,{counts:r})]}),(0,Y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,Y.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,Y.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,Y.jsx)(B,{label:i}),c&&(0,Y.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,Y.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function He({task:e,onRestore:t,onPreview:n}){let r=e.title||e.branch;return(0,Y.jsxs)(`div`,{className:`group flex items-center gap-2 border-l-2 border-transparent px-3 py-1.5`,children:[n?(0,Y.jsx)(`button`,{type:`button`,onClick:n,title:`Preview history`,className:`min-w-0 flex-1 truncate text-left text-[12px] text-subtle transition-colors hover:text-fg`,children:r}):(0,Y.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-subtle`,children:r}),(0,Y.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 Ue({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:c,worktreeChanges:u,uiPrefs:d,hydrated:f,streamConnected:p}=m(),{selectedTaskId:g}=n(),_=O(),v=(0,G.useMemo)(()=>ne(a),[a]),y=e=>re(_,e,v),{query:b,statusFilter:x,sortMode:S,showArchived:w}=ge(),T=(0,G.useRef)(null),E=(0,G.useRef)(null);(0,G.useEffect)(()=>{g&&T.current?.querySelector(`[data-task-id="${CSS.escape(g)}"]`)?.scrollIntoView({block:`nearest`})},[g]);let k=d?.sortMode;(0,G.useEffect)(()=>{he(k)},[k]);let A=(0,G.useMemo)(()=>a.filter(e=>!e.archived),[a]),j=(0,G.useMemo)(()=>a.filter(e=>e.archived&&e.kind!==`main`),[a]),M=(0,G.useMemo)(()=>ye(A.filter(e=>be(e,b)&&te(o[e.id],u[e.worktreePath],x)),S),[A,b,x,S,o,u]),N=M.filter(e=>e.kind===`main`),P=M.filter(e=>e.kind!==`main`),F=!f||!p&&a.length===0,I=s(),L=e=>{r(e),C(e),I({to:`/task/$taskId`,params:{taskId:e}})};(0,G.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(),E.current?.focus();return}if(n&&o&&o!==document.body&&!T.current?.contains(o)||M.length===0)return;e.preventDefault();let s=M.findIndex(e=>e.id===g),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),M.length-1);L(M[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[M,g]);let R=e=>{h(`task.archive`,{taskId:e.id,archived:!1}).catch(t=>l(`restore "${e.title||e.branch}"`,t))},[z,B]=(0,G.useState)(!1),[V,H]=(0,G.useState)(null);return(0,G.useEffect)(()=>{let e=!0;return ie().then(t=>{e&&B(t.archivedHistoryPreview===!0)}).catch(()=>{}),()=>{e=!1}},[]),(0,Y.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,Y.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.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,Y.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[M.length,`/`,A.length]}),(0,Y.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,Y.jsx)(le,{size:14,strokeWidth:1.9})}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,Y.jsx)(oe,{size:14,strokeWidth:2.2})})]})]}),(0,Y.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,Y.jsx)(ae,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,Y.jsx)(`input`,{ref:E,value:b,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&M.length>0?(e.preventDefault(),L(M[0].id),e.currentTarget.blur()):e.key===`Escape`&&b&&(e.preventDefault(),J(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),b&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>J(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,Y.jsx)(ee,{size:13,strokeWidth:2})})]}),(0,Y.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,Y.jsx)(`button`,{type:`button`,onClick:()=>fe(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,Y.jsxs)(`div`,{ref:T,className:`flex-1 overflow-y-auto`,children:[F?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,Y.jsx)(W,{size:13,strokeWidth:2,className:`animate-spin`}),(0,Y.jsx)(`span`,{children:`connecting…`})]}):A.length===0?(0,Y.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,Y.jsx)(`p`,{children:`No tasks yet.`}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,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`})]}):M.length===0?(0,Y.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,Y.jsx)(`div`,{children:b?`No matches for “${b}”.`:`No tasks in this status.`}),(0,Y.jsx)(`button`,{type:`button`,onClick:()=>{J(``),fe(`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,Y.jsxs)(Y.Fragment,{children:[N.length>0&&(0,Y.jsx)(Be,{children:`Projects`}),N.map(e=>(0,Y.jsx)(Ve,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id)),P.length>0&&(0,Y.jsx)(Be,{suffix:S==="default"?void 0:S,children:`Worktrees`}),P.map(e=>(0,Y.jsx)(Ve,{task:e,engine:o[e.id],job:c[e.id],changes:u[e.worktreePath],engineName:y(e),active:e.id===g,onClick:()=>L(e.id)},e.id))]}),!F&&j.length>0&&(0,Y.jsxs)(`div`,{className:`mt-2 border-t border-line-subtle pb-2`,children:[(0,Y.jsxs)(`button`,{type:`button`,onClick:()=>me(!w),className:`flex w-full items-center gap-2 px-3 py-2 text-left`,children:[(0,Y.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Archived`}),(0,Y.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:j.length}),(0,Y.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-subtle`,children:w?`−`:`+`})]}),w&&j.map(e=>(0,Y.jsx)(He,{task:e,onRestore:()=>R(e),onPreview:z?()=>H(e):void 0},e.id))]})]}),(0,Y.jsx)(Se,{task:V,onClose:()=>H(null)}),(0,Y.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,Y.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,Y.jsx)(D,{size:15,strokeWidth:1.8}),(0,Y.jsx)(`span`,{children:`Settings`})]})})]})}function We({onToggleTools:e,onShowHelp:t}){let{daemonConnected:r,streamConnected:i,tasks:a}=m(),{selectedTaskId:o}=n(),s=o?a.find(e=>e.id===o):null,c=R({daemonConnected:r,streamConnected:i});return(0,Y.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,Y.jsx)(se,{}),(0,Y.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,Y.jsx)(p,{}),s?(0,Y.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Y.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,Y.jsx)(`span`,{className:`hidden max-w-40 truncate font-mono text-[11px] text-subtle md:inline`,children:s.branch})]}):(0,Y.jsx)(`span`,{className:`rounded bg-inset px-2 py-0.5 text-[11px] text-muted`,children:`Workspace`}),(0,Y.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 text-[11px] text-subtle`,children:[(0,Y.jsxs)(`span`,{className:`hidden items-center gap-1.5 sm:flex`,title:c.title,children:[(0,Y.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${c.ok?`bg-kobe-green`:`bg-kobe-yellow`}`}),(0,Y.jsx)(`span`,{children:c.label})]}),(0,Y.jsx)(`button`,{type:`button`,onClick:t,className:`hidden items-center text-muted transition-colors hover:text-fg sm:flex`,"aria-label":`Keyboard shortcuts`,title:`Keyboard shortcuts (?)`,children:(0,Y.jsx)(ce,{size:15,strokeWidth:1.8})}),(0,Y.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,Y.jsx)(ue,{size:15,strokeWidth:1.8})})]})]})}function Ge(){let{tasks:e,update:t}=m(),{selectedTaskId:r}=n(),i=r?e.find(e=>e.id===r):null,a=e.filter(e=>!e.archived).length;return(0,Y.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,Y.jsxs)(`span`,{children:[a,` task`,a===1?``:`s`]}),i&&(0,Y.jsxs)(`span`,{className:`min-w-0 truncate text-muted`,children:[i.kind===`main`?`project`:`worktree`,` ·`,` `,_(i.worktreePath,54)]}),(0,Y.jsx)(`span`,{className:`ml-auto`,children:t?.latest?`update ${t.latest} available`:`kobe web`})]})}function Ke(){let{settingsOpen:e}=E(),[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{let e=e=>{e.key===`Escape`&&i(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,Y.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,Y.jsx)(We,{onToggleTools:()=>i(e=>!e),onShowHelp:T}),(0,Y.jsx)(f,{}),(0,Y.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,Y.jsx)(Ue,{onOpenSettings:N,onNewTask:S,onAdopt:()=>n(!0)}),e?(0,Y.jsx)(b,{onClose:P}):(0,Y.jsx)(y,{}),(0,Y.jsx)(`div`,{className:`hidden lg:flex`,children:(0,Y.jsx)(ze,{})}),r&&(0,Y.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,Y.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,Y.jsx)(ze,{drawer:!0,onClose:()=>i(!1)})})})]}),(0,Y.jsx)(Ge,{}),t&&(0,Y.jsx)(xe,{onClose:()=>n(!1)})]})}export{Ke as AppShell};
@@ -1 +0,0 @@
1
- import{l as e}from"./terminal-B6OlmT6e.js";import{f as t,y as n}from"./tabs-B_hac99E.js";import{a as r,n as i,r as a}from"./toast-D798wIYZ.js";import{d as o}from"./createLucideIcon-Dn8f0BBU.js";import{n as ee,t as s}from"./ViewToggle-Ks6S0ed3.js";import{n as te}from"./store-CbgoTSs1.js";import{t as c}from"./external-store-DUMhHvtl.js";import{t as l}from"./external-link-CGQEaSmM.js";import{a as u,i as d,n as f,r as p,t as m}from"./lazy-issue-panels-DiR5Ajwo.js";import{D as ne,g as re,v as ie,y as h}from"./index-B8vllT-Z.js";import{n as ae,t as oe}from"./ConfirmDialog-cqOtp-Pc.js";import{a as g,d as _,f as v,g as y,h as b,m as x,p as S,s as C,u as w}from"./issues-CBlvj9fb.js";var T=e(n(),1),E={query:``,repo:null};function D(e){O.update(t=>({...t,...e}))}var O=c(E);function se(){return O.useSnapshot()}function k(e){e!==O.getSnapshot().query&&D({query:e})}function A(e){e!==O.getSnapshot().repo&&D({repo:e})}var j=o();function M({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,j.jsxs)(`section`,{"data-column":`${e}:${t.key}`,className:`flex h-full shrink-0 flex-col border border-transparent ${t.key===`backlog`?`w-96`:`w-72`}`,children:[(0,j.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,j.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,j.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,j.jsxs)(`button`,{type:`button`,onClick:n,className:`ml-auto flex items-center gap-0.5 text-[10px] text-subtle transition-colors hover:text-fg`,title:`New story in this project`,children:[(0,j.jsx)(h,{size:11,strokeWidth:2}),(0,j.jsx)(`span`,{children:`New story`})]})]}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,j.jsx)(`div`,{className:`border border-dashed border-line-subtle p-3 text-center text-[11px] text-subtle`,children:`none`}):t.cards.map(e=>{let{issue:t}=e,n=y(t)?t.taskId:void 0;return(0,j.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,j.jsx)(d,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,j.jsxs)(`button`,{type:`button`,onClick:()=>i(n),"aria-label":`Open task for issue #${t.id}`,title:`Started — open task`,className:`absolute bottom-2 right-2 flex items-center gap-1 border border-line bg-surface px-1.5 py-0.5 text-[10px] text-subtle opacity-0 transition-opacity hover:border-primary hover:text-fg focus-visible:opacity-100 group-hover/wrap:opacity-100`,children:[(0,j.jsx)(l,{size:10,strokeWidth:1.8}),(0,j.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,j.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function ce({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,j.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,j.jsx)(M,{repo:e.repo,column:a,onNewIssue:a.key===`backlog`?()=>t(e.repo):void 0,onPeekIssue:n,onOpenTask:r,onDeleteIssue:t=>i(e.repo,t)},a.key))})}function N(){let{tasks:e,hydrated:n,daemonConnected:o}=te(),{query:c,repo:l}=se(),d=r(),y=(0,T.useRef)(null),[E,D]=(0,T.useState)(null),[O,M]=(0,T.useState)(null),[N,P]=(0,T.useState)(!1),[F,I]=(0,T.useState)(null),[L,R]=(0,T.useState)(new Map),[z,B]=(0,T.useState)(null),[V,H]=(0,T.useState)([]);(0,T.useEffect)(()=>{let e=!1;return C().then(t=>{e||H(t)}).catch(e=>a(`load projects`,e)),()=>{e=!0}},[]);let U=(0,T.useMemo)(()=>w(e,V),[e,V]),W=(0,T.useMemo)(()=>U.map(e=>e.repo),[U]),G=(0,T.useMemo)(()=>S(U,l),[U,l]),{data:K,pending:q,refresh:J}=u(W),{allIssues:Y,repoChips:le,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,T.useMemo)(()=>b({issueData:K,issueRepos:W,pendingLinks:L,query:c,repoFilter:G}),[K,W,L,c,G]);(0,T.useEffect)(()=>{R(e=>{if(e.size===0)return e;let t=new Map(e),n=!1;for(let e of W){let r=K[e];if(!(!r||!r.exists))for(let i of r.issues)i.taskId&&t.delete(`${e}:${i.id}`)&&(n=!0)}return n?t:e})},[W,K]),(0,T.useEffect)(()=>{E&&(Y.some(e=>e.repo===E.repo&&e.issue.id===E.id)||D(null))},[Y,E]),(0,T.useEffect)(()=>{let e=e=>{if(E||O||z||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target,n=!!t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.tagName===`SELECT`||t.isContentEditable);e.key===`/`&&!n?(e.preventDefault(),y.current?.focus()):e.key===`Escape`&&t===y.current&&c&&(e.preventDefault(),k(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[c,E,O,z]),(0,T.useEffect)(()=>{l!==G&&A(G)},[G,l]);let ue=!!c,$=e=>{t(e),ne(e),d({to:`/task/$taskId`,params:{taskId:e}})},de=async(e,t,n)=>{P(!0);try{return await x(e,t,n),J([e]),!0}catch(e){return a(`update issue`,e),!1}finally{P(!1)}},fe=async(e,t)=>{P(!0);try{await g(e,t.id),J([e]),B(null),E?.repo===e&&E.id===t.id&&D(null)}catch(e){a(`delete issue`,e)}finally{P(!1)}},pe=async(e,t,n,r)=>{if(F===null){I(t.id);try{let{taskId:i}=await v(e,t,n,r);return R(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:i}),r}),i}catch(e){a(`quick start issue`,e);return}finally{I(null)}}};return(0,j.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(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)(ae,{}),(0,j.jsx)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe]`}),(0,j.jsx)(s,{}),(0,j.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,j.jsx)(ie,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,j.jsx)(`input`,{ref:y,value:c,onChange:e=>k(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),c&&(0,j.jsx)(`button`,{type:`button`,onClick:()=>k(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,j.jsx)(re,{size:13,strokeWidth:2})})]}),U.length>0&&(0,j.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,j.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,j.jsx)(`select`,{value:G??``,onChange:e=>A(e.target.value),title:G??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:U.map(e=>{let t=le.find(t=>t.repo===e.repo)?.count??0;return(0,j.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,j.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,j.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,j.jsx)(ee,{}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||q&&!Q?(0,j.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&ue&&Q?(0,j.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,j.jsx)(`p`,{children:`No stories match.`}),(0,j.jsx)(`button`,{type:`button`,onClick:()=>{k(``)},className:`mt-3 border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Clear filters`})]}):Z===0&&!o?(0,j.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,j.jsx)(ce,{board:X[0],onNewIssue:M,onPeekIssue:e=>D({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>B({repo:e,issue:t})}):(0,j.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,j.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,j.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,j.jsx)(`button`,{type:`button`,onClick:()=>d({to:`/`}),className:`border border-line bg-surface px-2 py-1 text-[11px] text-muted hover:border-primary hover:text-fg`,children:`Back to workspace`})})]})}),(()=>{let e=G??X[0]?.repo??W[0];return e?(0,j.jsx)(`button`,{type:`button`,onClick:()=>M(e),title:`New story`,"aria-label":`New story`,className:`fixed bottom-6 right-6 z-20 flex h-12 w-12 items-center justify-center rounded-full border border-primary bg-primary text-bg shadow-lg transition-transform hover:scale-105`,children:(0,j.jsx)(h,{size:22,strokeWidth:2.2})}):null})(),O&&(0,j.jsx)(m,{children:(0,j.jsx)(f,{repoRoot:O,open:!0,onClose:()=>M(null),onCreated:(e,t)=>{O&&J([O]),i(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!E)return null;let e=Y.find(e=>e.repo===E.repo&&e.issue.id===E.id);return e?(0,j.jsx)(m,{children:(0,j.jsx)(p,{issue:e.issue,repoRoot:e.repo,busy:N,starting:F===e.issue.id,onClose:()=>D(null),onSave:t=>de(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,watch:r})=>{let i=await pe(e.repo,e.issue,t,n);r&&i?(D(null),$(i)):D(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;D(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&_(t,e.issue).then(()=>i(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>a(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),z&&(0,j.jsx)(oe,{title:`Delete issue`,body:`Delete issue #${z.issue.id}: "${z.issue.title}"? This removes it from the daemon issue tracker only; it does not delete any task, branch, worktree, or engine session.`,confirmLabel:`Delete`,danger:!0,busy:N,onConfirm:()=>void fe(z.repo,z.issue),onCancel:()=>B(null)})]})}export{N as Board};
@@ -1 +0,0 @@
1
- import{l as e,o as t}from"./terminal-B6OlmT6e.js";import{y as n}from"./tabs-B_hac99E.js";import{d as r,t as i}from"./createLucideIcon-Dn8f0BBU.js";import{n as a}from"./store-CbgoTSs1.js";import{t as o}from"./rotate-cw-zLlRat-M.js";import{g as s,v as c}from"./index-B8vllT-Z.js";import{t as l}from"./time-kviT26Tm.js";import{t as u}from"./web-transport-BS7imUMS.js";var d=i(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),f=i(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),p=e(n(),1);function m(e,n){return t.get(`/api/history/sessions`,{query:{worktreePath:e,vendor:n},label:`/api/history/sessions`})}async function h(e,n){let{messages:r}=await t.get(`/api/history/messages`,{query:{vendor:e,sessionId:n},label:`/api/history/messages`});return r}function g(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 _(e){return e>=1e6?`${(e/1e6).toFixed(1)}m`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function v(e,t,n,r=80){return t-e-n<r}var y=90;function b(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>y?`${n.slice(0,y-1)}…`:n}try{let t=JSON.stringify(e.input);return!t||t===`{}`||t===`null`?``:t.length>y?`${t.slice(0,y-1)}…`:t}catch{return``}}function x(e){if(typeof e==`string`)return e;if(e==null)return``;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function S(e){switch(e.type){case`text`:case`thinking`:return e.text;case`tool_call`:return`${e.name} ${b(e)}`;case`tool_result`:return x(e.output)}}function C(e){return e.blocks.map(S).join(` `)}function w(e,t){return!(t&&e.type===`tool_call`)}function T(e,t){return e.blocks.some(e=>e.type===`text`||e.type===`thinking`?e.text.trim()!==``:e.type===`tool_call`?!t:!1)}var E=r(),D=2500,O=600;function k({call:e,result:t}){let[n,r]=(0,p.useState)(!1),i=b(e),a=t?x(t.output):``,o=!n&&a.length>O,s=o?`${a.slice(0,O)}…`:a,c=a.length>0;return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.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,E.jsx)(`span`,{className:`shrink-0 text-[11px] ${t?.isError?`text-kobe-red`:`text-kobe-green`}`,children:`⏺`}),(0,E.jsx)(`span`,{className:`shrink-0 text-[12px] font-semibold text-fg`,children:e.name}),i&&(0,E.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px] text-subtle`,children:i}),c&&(0,E.jsx)(`span`,{className:`shrink-0 text-subtle`,children:n?(0,E.jsx)(d,{size:12}):(0,E.jsx)(f,{size:12})})]}),(n||!n&&a&&a.length<=O)&&a&&(0,E.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,E.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 A({text:e}){let[t,n]=(0,p.useState)(!1);return(0,E.jsxs)(`div`,{className:`my-1`,children:[(0,E.jsxs)(`button`,{type:`button`,onClick:()=>n(e=>!e),className:`flex items-baseline gap-2 text-[11px] italic text-subtle hover:text-muted`,children:[(0,E.jsx)(`span`,{children:`✱`}),(0,E.jsx)(`span`,{children:t?`thinking`:`thinking…`}),t?(0,E.jsx)(d,{size:11}):(0,E.jsx)(f,{size:11})]}),t&&(0,E.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 j({message:e,results:t,hideTools:n}){let r=[],i=l(e.timestamp),a=!1;return e.blocks.forEach((o,s)=>{if(!w(o,n))return;let c=`${e.timestamp}-${s}`;if(o.type===`text`){if(!o.text.trim())return;e.role===`user`?(r.push((0,E.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,E.jsx)(`span`,{className:`shrink-0 font-mono text-[12px] font-bold text-primary`,children:`❯`}),(0,E.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,E.jsx)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,title:e.timestamp,children:i})]},c)),a=!0):r.push((0,E.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,E.jsx)(k,{call:o,result:t.get(o.callId)},c));return}if(o.type===`thinking`){o.text.trim()&&r.push((0,E.jsx)(A,{text:o.text},c));return}}),r.length===0?null:(0,E.jsx)(E.Fragment,{children:r})}function M({worktreePath:e,vendor:t}){let{daemonConnected:n,streamConnected:r}=a(),i=u({daemonConnected:n,streamConnected:r}),[l,d]=(0,p.useState)([]),[f,y]=(0,p.useState)(null),[b,x]=(0,p.useState)(!0),[S,w]=(0,p.useState)([]),[O,k]=(0,p.useState)(``),[A,M]=(0,p.useState)(!1),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(!0),z=(0,p.useRef)(-1),B=(0,p.useRef)(null),V=(0,p.useRef)(!0),H=(0,p.useRef)(0),U=(0,p.useRef)(!0),W=(0,p.useRef)(null);(0,p.useEffect)(()=>{U.current=b,W.current=f},[b,f]);let G=(0,p.useCallback)(async(n=!1)=>{if(!e)return;let r=H.current;try{let i=await m(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 h(t,o):[];if(r!==H.current)return;d(i.sessions),w(s),y(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,p.useRef)(G);(0,p.useEffect)(()=>{K.current=G},[G]),(0,p.useEffect)(()=>{z.current=-1,I(!1),U.current=!0,W.current=null,V.current=!0,x(!0),y(null),k(``),M(!1),R(!0),K.current(!0);let e=window.setInterval(()=>{document.hidden||K.current()},D);return()=>window.clearInterval(e)},[e,t]);let q=e=>{let n=e===l.at(-1);U.current=n,W.current=e,x(n),y(e);let r=++H.current;h(t,e).then(e=>{r===H.current&&w(e)}).catch(e=>{r===H.current&&P(e instanceof Error?e.message:String(e))})};(0,p.useEffect)(()=>{let e=B.current;e&&V.current&&(e.scrollTop=e.scrollHeight)},[S]);let J=()=>{let e=B.current;if(!e)return;let t=v(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,p.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,p.useMemo)(()=>g(S),[S]),Q=(0,p.useMemo)(()=>S.map(e=>C(e).toLowerCase()),[S]),$=(0,p.useMemo)(()=>{let e=O.trim().toLowerCase();return S.filter((t,n)=>(!e||Q[n].includes(e))&&T(t,A))},[S,Q,O,A]);return e?(0,E.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,E.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center gap-2 border-b border-line bg-surface px-2`,children:[(0,E.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Chat`}),l.length>0&&(0,E.jsx)(`select`,{value:f??``,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:l.map((e,t)=>(0,E.jsxs)(`option`,{value:e,children:[`#`,t+1,` `,e.slice(0,8),t===l.length-1?` (latest)`:``]},e))}),(0,E.jsxs)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[10px] text-subtle`,children:[Z.contextTokens>0&&(0,E.jsxs)(`span`,{title:`Live context estimate (last turn's full prompt)`,children:[`ctx `,_(Z.contextTokens)]}),Z.outputTokens>0&&(0,E.jsxs)(`span`,{title:`Session tokens in / out`,children:[`⇡`,_(Z.inputTokens),` ⇣`,_(Z.outputTokens)]}),(0,E.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,E.jsx)(o,{size:11,strokeWidth:2})})]})]}),S.length>0&&(0,E.jsxs)(`div`,{className:`flex h-7 shrink-0 items-center gap-2 border-b border-line px-2`,children:[(0,E.jsx)(c,{size:11,strokeWidth:2,className:`shrink-0 text-subtle`}),(0,E.jsx)(`input`,{value:O,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Escape`&&O&&(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`}),O.trim()&&(0,E.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] text-subtle`,children:[$.length,`/`,S.length]}),O.trim()&&(0,E.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,E.jsx)(s,{size:12,strokeWidth:2})}),(0,E.jsx)(`button`,{type:`button`,onClick:()=>M(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,E.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[(0,E.jsx)(`div`,{ref:B,onScroll:J,className:`min-h-0 flex-1 overflow-y-auto px-3 py-2`,children:N?i?(0,E.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,E.jsxs)(`div`,{className:`flex flex-col items-start gap-2 py-4`,children:[(0,E.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load the transcript.`}),(0,E.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,E.jsx)(o,{size:11,strokeWidth:2}),`Retry`]})]}):F?S.length===0?(0,E.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,E.jsxs)(`div`,{className:`py-4 text-[12px] leading-relaxed text-subtle`,children:[`No messages match “`,O.trim(),`”.`]}):$.map((e,t)=>(0,E.jsx)(j,{message:e,results:X,hideTools:A},`${e.sessionId}-${t}`)):(0,E.jsx)(`div`,{className:`py-4 text-[12px] text-subtle`,children:`Loading transcript…`})}),!L&&$.length>0&&(0,E.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,E.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`This task has no worktree yet.`})}export{M as t};
@@ -1,2 +0,0 @@
1
- import{c as e,l as t,o as n}from"./terminal-B6OlmT6e.js";import{d as r,y as i}from"./tabs-B_hac99E.js";import{a,n as o,r as s}from"./toast-D798wIYZ.js";import{a as c,c as l,d as u,i as d,r as f,t as p,u as m}from"./createLucideIcon-Dn8f0BBU.js";import{c as h,d as g,u as _}from"./index-B8vllT-Z.js";var v=p(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),y=t(i(),1);async function b(){let e=await n.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 n.put(`/api/quick-prompts`,e,{label:`save quick prompts`})}function S(e){return h(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=u();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}=c();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:f,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:()=>d(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=e({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),o=(0,y.useRef)(0),c=(0,y.useCallback)(async()=>{let e=++o.current;r(!0),a(!1);try{let n=await _();e===o.current&&t(n)}catch(t){e===o.current&&a(!0),s(`load settings`,t)}finally{e===o.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,a]=(0,y.useState)(``),[c,l]=(0,y.useState)(``),u=(e,n,r)=>void t({engineUpdates:[{id:e,command:n,label:r}]}).then(()=>o(`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(()=>o(`success`,`default engine saved`)),onRemove:e=>void t({removeEngine:e}).then(()=>o(`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=>a(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(``),a(``),l(``),o(`success`,`engine added`)}).catch(e=>s(`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,a]=(0,y.useState)(!1);return(0,y.useEffect)(()=>{let e=!1;return b().then(n=>{e||(t(n.review??``),r(n.pr??``),a(!0))}).catch(t=>{e||s(`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(()=>o(`success`,`quick-action templates saved`)).catch(e=>s(`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:t}){let[n,i]=(0,y.useState)(!1),o=a();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 t({remoteProjects:!e.remoteProjects})}),(0,w.jsx)(A,{label:`Archived history preview`,detail:`Beta: click an archived task to preview its read-only engine history, even after its worktree is gone.`,enabled:e.archivedHistoryPreview,onToggle:()=>void t({archivedHistoryPreview:!e.archivedHistoryPreview})}),(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 t({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 t({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(!n){i(!0);return}r(),o({to:`/`}),i(!1)},onBlur:()=>i(!1),className:`border px-3 py-1.5 text-[11px] transition-colors ${n?`border-kobe-red/50 bg-kobe-red/10 text-kobe-red`:`border-line bg-bg text-muted hover:border-primary hover:text-fg`}`,children:n?`Click again to reset layout`:`Reset layout`})]})]})}function L(){let{supported:e,permission:t,enabled:n}=m();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 l(!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};
@@ -1 +0,0 @@
1
- import{Board as e}from"./Board-qlAVxf0y.js";var t=e;export{t as component};
@@ -1 +0,0 @@
1
- import{IssuesPage as e}from"./IssuesPage-CfAZVOqX.js";var t=e;export{t as component};
@@ -1 +0,0 @@
1
- import{AppShell as e}from"./AppShell-BuGGPMuO.js";var t=e;export{t as component};