@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
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-yge5k7Tv.js","assets/terminal-B6OlmT6e.js","assets/tabs-B_hac99E.js","assets/createLucideIcon-Dn8f0BBU.js","assets/store-CbgoTSs1.js","assets/rotate-cw-zLlRat-M.js","assets/web-transport-BS7imUMS.js","assets/ChatTerminal-kHJ-D0s7.css"])))=>i.map(i=>d[i]);
2
- import{c as e,l as t,o as n,t as r}from"./terminal-B6OlmT6e.js";import{_ as i,a,h as o,i as s,o as c,p as l,t as u,v as d,y as f}from"./tabs-B_hac99E.js";import{d as p,t as m}from"./createLucideIcon-Dn8f0BBU.js";import{i as h,n as g}from"./store-CbgoTSs1.js";import{t as _}from"./ChatTranscript-DwC3GoFY.js";import{t as v}from"./rotate-cw-zLlRat-M.js";import{t as y}from"./web-transport-BS7imUMS.js";var b=m(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),x=m(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),S=m(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),C=t(f(),1);function w(e,t=36){return e.length<=t?e:`…${e.slice(e.length-t+1)}`}async function T(e,t={}){return{files:(await n.get(`/api/diff`,{query:{worktreePath:e,path:t.path,namesOnly:t.namesOnly?`1`:void 0},label:`diff fetch`})).files??[]}}function E(e){switch(e){case`added`:return{label:`A`,cls:`text-kobe-green`};case`untracked`:return{label:`U`,cls:`text-kobe-green`};case`modified`:return{label:`M`,cls:`text-kobe-yellow`};case`deleted`:return{label:`D`,cls:`text-kobe-red`};case`renamed`:return{label:`R`,cls:`text-kobe-blue`};case`copied`:return{label:`C`,cls:`text-kobe-blue`};default:return{label:e.slice(0,1).toUpperCase()||`?`,cls:`text-muted`}}}function D(e){switch(e){case`hunk`:return`kobe-diff-hunk`;case`meta`:return`kobe-diff-meta`;case`add`:return`kobe-diff-add`;case`del`:return`kobe-diff-del`;default:return`kobe-diff-ctx`}}function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k(e){let t=e.replace(/\*+/g,`*`).split(`*`).map(O).join(`.*`);return RegExp(`^${t}$`)}function A(e,t){let n=t.trim(),r=n.startsWith(`!`),i=(r?n.slice(1):n).trim().toLowerCase();if(!i)return!0;let a=e.toLowerCase(),o=i.includes(`*`)?k(i).test(a):a.includes(i);return r?!o:o}function j(e,t){let n=t.trim();return n?e.filter(e=>A(e.path,n)):e}var M=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,N=[`diff --git`,`index `,`--- `,`+++ `,`new file`,`deleted file`,`rename `,`similarity `,`copy `,`\\ No newline`,`Binary files`];function P(e){return N.some(t=>e.startsWith(t))}function F(e){let t=0,n=0;for(let r of I(e))r.kind===`add`?t++:r.kind===`del`&&n++;return{added:t,deleted:n}}function I(e){let t=e.replace(/\n$/,``).split(`
2
+ import{c as e,l as t,o as n,t as r}from"./terminal-B6OlmT6e.js";import{_ as i,a,h as o,i as s,o as c,p as l,t as u,v as d,y as f}from"./tabs-B_hac99E.js";import{d as p,t as m}from"./createLucideIcon-Dn8f0BBU.js";import{i as h,n as g}from"./store-CbgoTSs1.js";import{t as _}from"./ChatTranscript-BKbzoH8U.js";import{t as v}from"./rotate-cw-zLlRat-M.js";import{t as y}from"./web-transport-BS7imUMS.js";var b=m(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),x=m(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),S=m(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),C=t(f(),1);function w(e,t=36){return e.length<=t?e:`…${e.slice(e.length-t+1)}`}async function T(e,t={}){return{files:(await n.get(`/api/diff`,{query:{worktreePath:e,path:t.path,namesOnly:t.namesOnly?`1`:void 0},label:`diff fetch`})).files??[]}}function E(e){switch(e){case`added`:return{label:`A`,cls:`text-kobe-green`};case`untracked`:return{label:`U`,cls:`text-kobe-green`};case`modified`:return{label:`M`,cls:`text-kobe-yellow`};case`deleted`:return{label:`D`,cls:`text-kobe-red`};case`renamed`:return{label:`R`,cls:`text-kobe-blue`};case`copied`:return{label:`C`,cls:`text-kobe-blue`};default:return{label:e.slice(0,1).toUpperCase()||`?`,cls:`text-muted`}}}function D(e){switch(e){case`hunk`:return`kobe-diff-hunk`;case`meta`:return`kobe-diff-meta`;case`add`:return`kobe-diff-add`;case`del`:return`kobe-diff-del`;default:return`kobe-diff-ctx`}}function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function k(e){let t=e.replace(/\*+/g,`*`).split(`*`).map(O).join(`.*`);return RegExp(`^${t}$`)}function A(e,t){let n=t.trim(),r=n.startsWith(`!`),i=(r?n.slice(1):n).trim().toLowerCase();if(!i)return!0;let a=e.toLowerCase(),o=i.includes(`*`)?k(i).test(a):a.includes(i);return r?!o:o}function j(e,t){let n=t.trim();return n?e.filter(e=>A(e.path,n)):e}var M=/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/,N=[`diff --git`,`index `,`--- `,`+++ `,`new file`,`deleted file`,`rename `,`similarity `,`copy `,`\\ No newline`,`Binary files`];function P(e){return N.some(t=>e.startsWith(t))}function F(e){let t=0,n=0;for(let r of I(e))r.kind===`add`?t++:r.kind===`del`&&n++;return{added:t,deleted:n}}function I(e){let t=e.replace(/\n$/,``).split(`
3
3
  `),n=[],r=0,i=0,a=!1;for(let e of t){let t=M.exec(e);if(t){r=Number.parseInt(t[1],10),i=Number.parseInt(t[2],10),a=!0,n.push({kind:`hunk`,oldLn:null,newLn:null,text:e});continue}if(e.startsWith(`diff --git`)&&(a=!1),e===``||!a&&P(e)){n.push({kind:`meta`,oldLn:null,newLn:null,text:e});continue}let o=e[0];o===`+`?(n.push({kind:`add`,oldLn:null,newLn:i,text:e}),i++):o===`-`?(n.push({kind:`del`,oldLn:r,newLn:null,text:e}),r++):P(e)?n.push({kind:`meta`,oldLn:null,newLn:null,text:e}):(n.push({kind:`ctx`,oldLn:r,newLn:i,text:e}),r++,i++)}return n}var L=p();function R({added:e,deleted:t}){return e===0&&t===0?null:(0,L.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px]`,children:[(0,L.jsxs)(`span`,{className:`text-kobe-green`,children:[`+`,e]}),` `,(0,L.jsxs)(`span`,{className:`text-kobe-red`,children:[`−`,t]})]})}function z(e){let{worktreeChanges:t}=g(),n=e?t[e]:void 0;return n?`${n.added}:${n.deleted}`:`none`}function B({onRetry:e}){let{daemonConnected:t,streamConnected:n}=g();return y({daemonConnected:t,streamConnected:n})?(0,L.jsx)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:`The kobe daemon is offline — changes will reappear once it reconnects.`}):(0,L.jsxs)(`div`,{className:`flex flex-col items-start gap-2 px-3 py-4`,children:[(0,L.jsx)(`span`,{className:`text-[12px] text-kobe-red`,children:`Couldn't load changes.`}),(0,L.jsxs)(`button`,{type:`button`,onClick:e,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,L.jsx)(v,{size:11,strokeWidth:2}),`Retry`]})]})}function V({patch:e,wrap:t}){let n=(0,C.useMemo)(()=>I(e),[e]);return e.trim()?(0,L.jsx)(`div`,{className:`kobe-diff min-h-0 flex-1 overflow-auto py-2 font-mono text-[12px] leading-[1.15rem] ${t?`kobe-diff-wrap`:``}`,children:n.map((e,t)=>(0,L.jsxs)(`div`,{className:`kobe-diff-row ${D(e.kind)}`,children:[(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.oldLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-gutter`,children:e.newLn??``}),(0,L.jsx)(`span`,{className:`kobe-diff-text`,children:e.text===``?` `:e.text})]},t))}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`No textual diff for this file.`})}function H({worktreePath:e,onOpenFile:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(null),c=z(e),{worktreeChanges:l}=g(),u=e?l[e]:void 0,d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),s(null);return}let t=++d.current;a(!0),s(null);try{let n=await T(e,{namesOnly:!0});t===d.current&&r(n)}catch(e){t===d.current&&(s(e instanceof Error?e.message:String(e)),r(null))}finally{t===d.current&&a(!1)}},[e]);(0,C.useEffect)(()=>{f()},[f,c]);let[p,m]=(0,C.useState)(``);(0,C.useEffect)(()=>{m(``)},[e]);let h=n?.files??[],_=(0,C.useMemo)(()=>j(h,p),[h,p]);return(0,L.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,L.jsxs)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:[`Changes`,h.length>0?` · ${h.length}`:``]}),u&&(0,L.jsx)(R,{added:u.added,deleted:u.deleted}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>void f(),disabled:!e||i,className:`ml-auto rounded border border-line px-1.5 py-0.5 text-[10px] text-muted transition-colors hover:bg-surface disabled:opacity-40`,children:i?`…`:`↻`})]}),e?o?(0,L.jsx)(B,{onRetry:()=>void f()}):h.length===0?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsx)(`div`,{className:`text-[12px] text-subtle`,children:i?`Loading changes…`:`Worktree clean.`})}):(0,L.jsxs)(L.Fragment,{children:[h.length>1&&(0,L.jsx)(`input`,{value:p,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Escape`&&p&&(e.preventDefault(),m(``))},placeholder:`Filter ${h.length} files… (*.ts, !*.json)`,title:`Match a substring, a *.glob, or !exclude`,spellCheck:!1,className:`mx-3 mb-1 shrink-0 border border-line bg-bg px-2 py-1 font-mono text-[11px] text-fg placeholder:text-subtle focus:border-line-active focus:outline-none`}),_.length===0?(0,L.jsx)(`div`,{className:`px-3 py-3 text-center text-[11px] text-subtle`,children:`No files match.`}):(0,L.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:_.map(e=>{let n=E(e.status);return(0,L.jsxs)(`button`,{type:`button`,onClick:()=>t(e.path),title:e.path,className:`flex w-full items-center gap-2 border-l-2 border-transparent px-3 py-2 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsx)(`span`,{className:`w-3 shrink-0 text-center font-mono text-[11px] font-bold ${n.cls}`,children:n.label}),(0,L.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[12px] text-fg/90`,children:w(e.path,34)}),e.staged&&(0,L.jsx)(`span`,{className:`shrink-0 text-[9px] uppercase text-subtle`,children:`staged`})]},e.path)})})]}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center px-4 text-center`,children:(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`div`,{className:`text-[12px] font-semibold text-fg`,children:`No task selected`}),(0,L.jsx)(`div`,{className:`mt-1 max-w-48 text-[12px] leading-relaxed text-subtle`,children:`Select a task to watch its worktree changes.`})]})})]})}function U({worktreePath:e,path:t}){let[n,r]=(0,C.useState)(null),[i,a]=(0,C.useState)(!1),[o,s]=(0,C.useState)(!1),[c,l]=(0,C.useState)(null),u=z(e),d=(0,C.useRef)(0),f=(0,C.useCallback)(async()=>{if(!e){r(null),l(null);return}let n=++d.current;s(!0),l(null);try{let i=await T(e,{path:t});if(n!==d.current)return;r(i.files.find(e=>e.path===t)??null)}catch(e){n===d.current&&l(e instanceof Error?e.message:String(e))}finally{n===d.current&&s(!1)}},[e,t]);(0,C.useEffect)(()=>{f()},[f,u]);let p=n?F(n.patch):null;return(0,L.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col border border-line bg-bg`,children:[(0,L.jsxs)(`div`,{className:`flex h-9 shrink-0 items-center gap-2 border-b border-line px-3`,children:[(0,L.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,title:t,children:t}),p&&(0,L.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,L.jsx)(R,{added:p.added,deleted:p.deleted})}),n&&(0,L.jsx)(`span`,{className:`shrink-0 text-[10px] uppercase tracking-wide text-subtle ${p&&(p.added||p.deleted)?``:`ml-auto`}`,children:n.status}),n&&(0,L.jsx)(`button`,{type:`button`,onClick:()=>a(e=>!e),title:i?`Disable line wrap`:`Wrap long lines`,className:`shrink-0 border px-1.5 py-0.5 font-mono text-[10px] transition-colors ${i?`border-primary bg-inset text-fg`:`border-line bg-bg text-subtle hover:border-primary hover:text-fg`}`,children:`wrap`})]}),c?(0,L.jsx)(B,{onRetry:()=>void f()}):n?(0,L.jsx)(V,{patch:n.patch,wrap:i}):o?(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`Loading preview…`}):(0,L.jsx)(`div`,{className:`flex flex-1 items-center justify-center text-[12px] text-subtle`,children:`No diff for this file.`})]})}var W=e({WorkspaceTabs:()=>Z}),G=(0,C.lazy)(()=>h(()=>import(`./ChatTerminal-yge5k7Tv.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function K(){return(0,L.jsx)(`div`,{className:`flex h-full w-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`})}function q(e){return e??`claude`}function J({taskId:e,tabId:t,vendor:n}){return(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6`,children:(0,L.jsx)(`div`,{className:`grid w-full max-w-2xl grid-cols-1 gap-3 md:grid-cols-3`,children:[{title:`Vendor`,detail:n,body:`Start an engine session for this task.`,icon:b,action:()=>c(e,t,`vendor`)},{title:`Chat`,detail:`transcript`,body:`Read the session as structured messages and tool calls.`,icon:x,action:()=>c(e,t,`transcript`)},{title:`Terminal`,detail:`shell / worktree`,body:`Open a command shell in this task worktree.`,icon:S,action:()=>c(e,t,`terminal`)}].map(e=>{let t=e.icon;return(0,L.jsxs)(`button`,{type:`button`,onClick:e.action,className:`group flex min-h-36 flex-col border border-line bg-surface p-4 text-left transition-colors hover:border-primary hover:bg-inset`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsx)(`span`,{className:`flex h-9 w-9 shrink-0 items-center justify-center border border-line bg-bg text-muted group-hover:border-primary group-hover:text-primary`,children:(0,L.jsx)(t,{size:17,strokeWidth:1.8})}),(0,L.jsx)(`span`,{className:`truncate text-[10px] uppercase text-subtle`,children:e.detail})]}),(0,L.jsx)(`div`,{className:`mt-5 text-[12px] font-bold uppercase tracking-[0.12em] text-fg`,children:e.title}),(0,L.jsx)(`div`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:e.body})]},e.title)})})})}function Y({tab:e,taskId:t,taskWorktreePath:n,taskTitle:r,vendor:i}){return e?.kind===`empty`?(0,L.jsx)(J,{taskId:t,tabId:e.id,vendor:i}):e?.kind===`vendor`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:t,mode:`engine`},e.id)}):e?.kind===`terminal`?(0,L.jsx)(C.Suspense,{fallback:(0,L.jsx)(K,{}),children:(0,L.jsx)(G,{tabId:e.id,taskId:t,mode:`shell`},e.id)}):e?.kind===`transcript`?(0,L.jsx)(_,{worktreePath:n,vendor:i,title:r},e.id):e?.kind===`file`?(0,L.jsx)(U,{worktreePath:n,path:e.path},e.id):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Opening a tab…`})}function X({tab:e,side:t,children:n,onCloseSplit:r}){return(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col`,children:[t===`right`&&(0,L.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-line bg-surface px-3`,children:[(0,L.jsx)(`span`,{className:`truncate text-[11px] text-muted`,children:e?.title??`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:r,className:`text-[11px] text-subtle hover:text-fg`,"aria-label":`close split`,title:`Close split`,children:`×`})]}),(0,L.jsx)(`div`,{className:`min-h-0 flex-1 p-2`,children:n})]})}function Z(){let[e,t]=(0,C.useState)(null),[n,c]=(0,C.useState)(!1),{selectedTaskId:f,tabsByTask:p,activeByTask:m,splitByTask:h}=i(),{tasks:_,jobs:v}=g(),y=f?_.find(e=>e.id===f):null,b=f?p[f]??[]:[],x=f?m[f]:void 0,S=f?h[f]:void 0,w=e=>{if(!f)return;let t=b.find(t=>t.id===e);a(f,e),t&&d(t.kind)&&r(e)},T=b.find(e=>e.id===x)??b[0],E=S&&S!==T?.id?b.find(e=>e.id===S):void 0,D=q(y?.vendor),O=y?.title||y?.branch||`Session`,k=!!y&&((f?v[f]?.phase===`running`:!1)||y.worktreePath===null);return(0,L.jsxs)(`section`,{className:`flex min-w-0 flex-1 flex-col bg-bg`,children:[(0,L.jsx)(`div`,{className:`flex h-9 shrink-0 items-stretch border-b border-line bg-surface`,children:f?(0,L.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-stretch overflow-x-auto`,role:`tablist`,children:[b.map(e=>{let n=e.id===T?.id,r=e.id===E?.id;return(0,L.jsxs)(`div`,{role:`tab`,"aria-selected":n,tabIndex:0,draggable:!0,onDragStart:n=>{n.dataTransfer.effectAllowed=`move`,n.dataTransfer.setData(`text/plain`,e.id),t(e.id)},onDragEnd:()=>{t(null),c(!1)},className:`group flex h-9 select-none items-center gap-2 border-r border-b-2 border-r-line px-3 text-[12px] transition-colors ${n?`border-b-primary bg-bg text-fg`:r?`border-b-kobe-blue bg-inset text-fg`:`border-b-transparent text-muted hover:bg-inset/50`}`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>l(f,e.id),className:`max-w-40 cursor-grab truncate active:cursor-grabbing`,title:r?`${e.title} (split)`:e.title,children:e.title}),r&&(0,L.jsx)(`span`,{className:`text-[9px] font-bold uppercase text-kobe-blue`,children:`Split`}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>w(e.id),className:`text-subtle opacity-0 transition-opacity hover:text-fg group-hover:opacity-100`,"aria-label":`close tab`,title:`Close tab`,children:`×`})]},e.id)}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>u(f),className:`px-3 text-[13px] text-subtle hover:text-fg`,"aria-label":`new tab`,title:`New tab`,children:`+`})]}):(0,L.jsxs)(`div`,{className:`flex items-center gap-2 px-3 text-[11px] text-subtle`,children:[(0,L.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-subtle`}),`No task selected`]})}),(0,L.jsxs)(`section`,{className:`relative min-h-0 flex-1`,"aria-label":`Workspace`,onDragOver:t=>{if(!f||!e)return;t.preventDefault();let n=t.currentTarget.getBoundingClientRect();c(t.clientX>n.left+n.width/2)},onDragLeave:()=>c(!1),onDrop:n=>{if(!f||!e)return;n.preventDefault();let r=n.currentTarget.getBoundingClientRect();n.clientX>r.left+r.width/2?o(f,e):l(f,e),t(null),c(!1)},children:[f&&T?(0,L.jsxs)(`div`,{className:`flex h-full min-w-0`,children:[(0,L.jsx)(X,{tab:T,side:`left`,children:(0,L.jsx)(Y,{tab:T,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})}),E&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`div`,{className:`w-px shrink-0 bg-line`}),(0,L.jsx)(X,{tab:E,side:`right`,onCloseSplit:()=>{f&&s(f)},children:(0,L.jsx)(Y,{tab:E,taskId:f,taskWorktreePath:y?.worktreePath??null,taskTitle:O,vendor:D})})]})]}):(0,L.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-center`,children:(0,L.jsxs)(`div`,{className:`max-w-md`,children:[(0,L.jsx)(`div`,{className:`font-mono text-[13px] font-bold text-primary`,children:`[kobe web]`}),(0,L.jsx)(`h1`,{className:`mt-4 text-[18px] font-semibold text-fg`,children:y?k?`Setting up this task's worktree…`:`Opening workspace…`:`Select a task to open its workspace.`}),(0,L.jsx)(`p`,{className:`mt-2 text-[12px] leading-relaxed text-subtle`,children:`Web workspaces keep their own browser tabs, split panes, notes, and file previews for each task.`})]})}),e&&(0,L.jsx)(`div`,{className:`pointer-events-none absolute inset-y-2 right-2 flex w-[calc(50%-0.5rem)] items-center justify-center border border-dashed ${n?`border-primary bg-primary/10`:`border-line bg-inset/40`}`,children:(0,L.jsx)(`span`,{className:`border border-line bg-bg px-2 py-1 text-[10px] font-bold uppercase tracking-[0.12em] text-muted`,children:`Drop to split right`})})]})]})}export{w as i,W as n,H as r,Z as t};
@@ -0,0 +1 @@
1
+ import{Board as e}from"./Board-IDFIzXrT.js";var t=e;export{t as component};