@sma1lboy/rove 0.9.82 → 0.9.83

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 (34) hide show
  1. package/dist/cli/index.js +452 -448
  2. package/dist/cli/kobe-run.js +452 -448
  3. package/dist/cli/kobe.js +1 -1
  4. package/dist/cli/rove-run.js +452 -448
  5. package/dist/cli/rove.js +1 -1
  6. package/dist/web-ui/assets/{AppShell-hnbk63TJ.js → AppShell-DG7_0Bmy.js} +1 -1
  7. package/dist/web-ui/assets/{Board-DxH_CoKe.js → Board-DeV3mFPq.js} +1 -1
  8. package/dist/web-ui/assets/{BoardPeek-CtY1rR7a.js → BoardPeek-DvsuFRiu.js} +2 -2
  9. package/dist/web-ui/assets/ChatTerminal-0kOTbkZl.js +87 -0
  10. package/dist/web-ui/assets/{ChatTranscript-DWQDNdY8.js → ChatTranscript-B_RTOA6i.js} +1 -1
  11. package/dist/web-ui/assets/{ConfirmDialog-DKwTbNuT.js → ConfirmDialog-Bbk9ORM3.js} +1 -1
  12. package/dist/web-ui/assets/{IssueIntakePanel-DH32Qbzs.js → IssueIntakePanel-BhIBRtAi.js} +1 -1
  13. package/dist/web-ui/assets/{IssuePeek-BEYwOLGn.js → IssuePeek-Djjgmo1R.js} +1 -1
  14. package/dist/web-ui/assets/{IssuesPage-CZByZRvC.js → IssuesPage-Bd3InEBh.js} +1 -1
  15. package/dist/web-ui/assets/{SettingsPage-Doy1wkgu.js → SettingsPage-BSWbIJdM.js} +1 -1
  16. package/dist/web-ui/assets/{SlideOver-DBKmu1VL.js → SlideOver-CIJZbPMm.js} +1 -1
  17. package/dist/web-ui/assets/{ViewToggle-BSDdHLqY.js → ViewToggle-Bv5WdpVD.js} +1 -1
  18. package/dist/web-ui/assets/{WorkspaceTabs-BstY84VU.js → WorkspaceTabs-CpT5ktr_.js} +3 -3
  19. package/dist/web-ui/assets/board-DYgCpt0-.js +1 -0
  20. package/dist/web-ui/assets/harness-DRekmn1C.js +1 -0
  21. package/dist/web-ui/assets/{index-CZKcqLos.js → index-CPq-AhN5.js} +2 -2
  22. package/dist/web-ui/assets/{issues-CKoglLQ-.js → issues-BW77-NNm.js} +1 -1
  23. package/dist/web-ui/assets/issues-CHbRjPHm.js +1 -0
  24. package/dist/web-ui/assets/{lazy-issue-panels-BV1MbpkU.js → lazy-issue-panels-B4iqKG-C.js} +3 -3
  25. package/dist/web-ui/assets/routes-CiEmhphc.js +1 -0
  26. package/dist/web-ui/assets/{task._taskId-PrFBsYK4.js → task._taskId-BcKcXBHp.js} +1 -1
  27. package/dist/web-ui/assets/{worktrees-BRQAKJzb.js → worktrees-BF3NV-l4.js} +1 -1
  28. package/dist/web-ui/index.html +1 -1
  29. package/package.json +1 -1
  30. package/dist/web-ui/assets/ChatTerminal-CgZ1wFNc.js +0 -87
  31. package/dist/web-ui/assets/board-DhY5Ennr.js +0 -1
  32. package/dist/web-ui/assets/harness-DlNPXgXi.js +0 -1
  33. package/dist/web-ui/assets/issues-CdV4CXpG.js +0 -1
  34. package/dist/web-ui/assets/routes-CKdbFNHn.js +0 -1
package/dist/cli/rove.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{join as z1}from"node:path";import{createInterface as $1}from"node:readline/promises";import{pathToFileURL as J1}from"node:url";import{spawnSync as h}from"node:child_process";import{constants as t,accessSync as u}from"node:fs";import{homedir as o}from"node:os";import{basename as r,delimiter as l,dirname as i,join as q}from"node:path";import{fileURLToPath as U}from"node:url";var c={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.82",description:"Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",keywords:["terminal","tui","cli","multiplexer","ai-agents","coding-agent","ai-coding-assistant","agentic-ai","parallel-agents","git-worktree","claude-code","codex","llm","developer-tools"],type:"module",packageManager:"bun@1.3.13",bin:{kobe:"dist/cli/kobe.js",rove:"dist/cli/rove.js"},files:["dist/cli","dist/web-ui","dist/skills","dist/*.wav","README.md","LICENSE"],publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/Sma1lboy/rove.git"},homepage:"https://rove.run",bugs:{url:"https://github.com/Sma1lboy/rove/issues"},engines:{bun:">=1.3.11"},scripts:{dev:"ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts","dev:kobe":"KOBE_DEV=1 bun --conditions=browser ./src/cli/kobe.ts","dev:mock":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:mock-react":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:mock-react-task-dialogs":"KOBE_DEV=1 bun ./src/tui-react/component/mock-dialogs-host.tsx","dev:mock-react-filetree":"KOBE_DEV=1 bun ./src/tui-react/panes/filetree/mock-host.tsx","dev:mock-react-sidebar":"KOBE_DEV=1 bun ./src/tui-react/panes/sidebar/mock-host.tsx","dev:mock-react-terminal":"KOBE_DEV=1 bun ./src/tui-react/panes/terminal/mock-host.tsx","dev:mock-react-dialogs":"KOBE_DEV=1 bun ./src/tui-react/mock/dialogs-host.tsx","dev:mock-react-workspace":"KOBE_DEV=1 bun ./src/tui-react/workspace/mock-host.tsx","dev:sandbox":"bun run scripts/dev-sandbox.ts run","dev:sandbox:reset":"bun run scripts/dev-sandbox.ts reset",build:"bun run scripts/build.ts","build:with-web":"bun run build",compile:"bun run scripts/compile.ts",typecheck:"tsc --noEmit","check-i18n":"bun run scripts/check-i18n.ts",test:"bun run test:fast && bun run test:socket","perf:golden":"bun scripts/perf-golden.ts","pty:soak":"bun scripts/pty-soak.ts","test:fast":"vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8","test:socket":"KOBE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"KOBE_INCLUDE_SOCKET=1 KOBE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"KOBE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun test test/render --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage-render",coverage:"vitest run --coverage --passWithNoTests",bench:"vitest bench --run",lint:"biome check .",knip:"knip-bun",postinstall:"bun run scripts/check-preview-deps.ts || true",prepublishOnly:"bun run typecheck && bun run build","plugin-sandbox":"bun run scripts/plugin-sandbox.ts"},"//":"biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).",dependencies:{"@ansi-tools/parser":"^1.0.15","@opentui/core":"0.4.3","@opentui/react":"0.4.3","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0","node-pty":"^1.1.0",react:"^19.2.8",ws:"^8.18.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/kobe-daemon":"0.7.17","@tsconfig/bun":"1.0.10","@types/bun":"1.3.14","@types/node":"25.6.2","@types/react":"^19.2.0","@vitest/coverage-v8":"2.1.9",knip:"^6.14.2","kobe-web":"workspace:*","react-devtools-core":"^7.0.1",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var x="rove",w="kobe";var E="ROVE_INVOKED_AS";function Y(b=process.env){return b[E]===x?x:w}var K="ROVE_BUN",a="ROVE_NO_BUN_BOOTSTRAP",p="ROVE_SKIP_BUN_CHECK",F=c.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0",B=(b)=>{try{return u(b,t.X_OK),!0}catch{return!1}},e=(b)=>b==="win32"?"bun.exe":"bun",n=(b)=>{let W=h(b,["--version"],{encoding:"utf8",timeout:5000});if(W.error||W.status!==0)return null;return W.stdout?.split(`
2
+ import{join as z1}from"node:path";import{createInterface as $1}from"node:readline/promises";import{pathToFileURL as J1}from"node:url";import{spawnSync as h}from"node:child_process";import{constants as t,accessSync as u}from"node:fs";import{homedir as o}from"node:os";import{basename as r,delimiter as l,dirname as i,join as q}from"node:path";import{fileURLToPath as U}from"node:url";var c={$schema:"https://json.schemastore.org/package.json",name:"@sma1lboy/rove",version:"0.9.83",description:"Rove — the agent multiplexer for your terminal. Run coding agents on parallel tasks with isolated worktrees and persistent sessions.",keywords:["terminal","tui","cli","multiplexer","ai-agents","coding-agent","ai-coding-assistant","agentic-ai","parallel-agents","git-worktree","claude-code","codex","llm","developer-tools"],type:"module",packageManager:"bun@1.3.13",bin:{kobe:"dist/cli/kobe.js",rove:"dist/cli/rove.js"},files:["dist/cli","dist/web-ui","dist/skills","dist/*.wav","README.md","LICENSE"],publishConfig:{access:"public"},repository:{type:"git",url:"git+https://github.com/Sma1lboy/rove.git"},homepage:"https://rove.run",bugs:{url:"https://github.com/Sma1lboy/rove/issues"},engines:{bun:">=1.3.11"},scripts:{dev:"ROVE_DEV=1 bun --conditions=browser ./src/cli/rove.ts","dev:kobe":"KOBE_DEV=1 bun --conditions=browser ./src/cli/kobe.ts","dev:mock":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:mock-react":"KOBE_DEV=1 bun ./src/tui-react/mock/host.tsx","dev:mock-react-task-dialogs":"KOBE_DEV=1 bun ./src/tui-react/component/mock-dialogs-host.tsx","dev:mock-react-filetree":"KOBE_DEV=1 bun ./src/tui-react/panes/filetree/mock-host.tsx","dev:mock-react-sidebar":"KOBE_DEV=1 bun ./src/tui-react/panes/sidebar/mock-host.tsx","dev:mock-react-terminal":"KOBE_DEV=1 bun ./src/tui-react/panes/terminal/mock-host.tsx","dev:mock-react-dialogs":"KOBE_DEV=1 bun ./src/tui-react/mock/dialogs-host.tsx","dev:mock-react-workspace":"KOBE_DEV=1 bun ./src/tui-react/workspace/mock-host.tsx","dev:sandbox":"bun run scripts/dev-sandbox.ts run","dev:sandbox:reset":"bun run scripts/dev-sandbox.ts reset",build:"bun run scripts/build.ts","build:with-web":"bun run build",compile:"bun run scripts/compile.ts",typecheck:"tsc --noEmit","check-i18n":"bun run scripts/check-i18n.ts",test:"bun run test:fast && bun run test:socket","perf:golden":"bun scripts/perf-golden.ts","pty:soak":"bun scripts/pty-soak.ts","test:fast":"vitest run --passWithNoTests --minWorkers=1 --maxWorkers=8","test:socket":"KOBE_INCLUDE_SOCKET=1 vitest run test/daemon --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:socket:coverage":"KOBE_INCLUDE_SOCKET=1 KOBE_COVERAGE_DAEMON=1 vitest run test/daemon --coverage --pool forks --minWorkers=1 --maxWorkers=4 --passWithNoTests","test:behavior":"KOBE_INCLUDE_BEHAVIOR=1 vitest run test/behavior --pool forks --minWorkers=1 --maxWorkers=1 --retry=2 --passWithNoTests","test:render":"bun test test/render --coverage --coverage-reporter=text --coverage-reporter=lcov --coverage-dir=coverage-render",coverage:"vitest run --coverage --passWithNoTests",bench:"vitest bench --run",lint:"biome check .",knip:"knip-bun",postinstall:"bun run scripts/check-preview-deps.ts || true",prepublishOnly:"bun run typecheck && bun run build","plugin-sandbox":"bun run scripts/plugin-sandbox.ts"},"//":"biome.json + bunfig.toml live at the monorepo root since they apply repo-wide; bun.lock also lives at root (workspace-shared).",dependencies:{"@ansi-tools/parser":"^1.0.15","@opentui/core":"0.4.3","@opentui/react":"0.4.3","@xterm/addon-serialize":"^0.14.0","@xterm/addon-unicode11":"^0.9.0","@xterm/headless":"^6.0.0","node-pty":"^1.1.0",react:"^19.2.8",ws:"^8.18.0"},devDependencies:{"@biomejs/biome":"1.9.4","@sma1lboy/kobe-daemon":"0.7.17","@tsconfig/bun":"1.0.10","@types/bun":"1.3.14","@types/node":"25.6.2","@types/react":"^19.2.0","@vitest/coverage-v8":"2.1.9",knip:"^6.14.2","kobe-web":"workspace:*","react-devtools-core":"^7.0.1",typescript:"5.8.2",vitest:"2.1.9"},trustedDependencies:[]};var x="rove",w="kobe";var E="ROVE_INVOKED_AS";function Y(b=process.env){return b[E]===x?x:w}var K="ROVE_BUN",a="ROVE_NO_BUN_BOOTSTRAP",p="ROVE_SKIP_BUN_CHECK",F=c.engines.bun.match(/\d+\.\d+\.\d+/)?.[0]??"0.0.0",B=(b)=>{try{return u(b,t.X_OK),!0}catch{return!1}},e=(b)=>b==="win32"?"bun.exe":"bun",n=(b)=>{let W=h(b,["--version"],{encoding:"utf8",timeout:5000});if(W.error||W.status!==0)return null;return W.stdout?.split(`
3
3
  `)[0]?.trim()??""};function g(b){return b.trim().match(/^v?(\d+\.\d+\.\d+)/)?.[1]??null}function j(b,W=F){let k=g(b),J=g(W);if(!k||!J)return!0;let $=k.split(".").map(Number),z=J.split(".").map(Number);for(let Q=0;Q<3;Q++){let H=$[Q]??0,Z=z[Q]??0;if(H!==Z)return H>Z}return!0}function G(b=process.env){return b[p]==="1"}function C(b={}){let W=b.env??process.env,k=b.platform??process.platform,J=b.home??W.HOME??W.USERPROFILE??o(),$=e(k),z=[],Q=W[K]?.trim();if(Q)z.push(Q);for(let P of(W.PATH??W.Path??"").split(l))if(P)z.push(q(P,$));let H=W.BUN_INSTALL?.trim();if(H)z.push(q(H,"bin",$));if(J)z.push(q(J,".bun","bin",$));let Z=b.launcherDir;if(Z)z.push(q(Z,"..","..","node_modules","bun","bin",$)),z.push(q(Z,"..","..","..","bun","bin",$));return z}function b1(b={}){let W=b.isExecutable??B;return C(b).find((k)=>W(k))??null}function L(b={}){let W=b.isExecutable??B,k=b.bunVersionOf??n;if(G(b.env??process.env))return{bun:b1(b),stale:null,unusable:null};let J=null,$=null;for(let z of C(b)){if(!W(z))continue;let Q=k(z);if(Q===null){$??=z;continue}if(j(Q))return{bun:z,stale:J,unusable:$};J??={path:z,version:g(Q)??Q}}return{bun:null,stale:J,unusable:$}}function O(b){return i(U(b))}function M(b){return r(U(b)).replace(/\.[cm]?[jt]s$/,"")}function W1(b=process.platform){return b==="win32"?["powershell","-NoProfile","-Command","irm bun.sh/install.ps1 | iex"]:["bash","-c","curl -fsSL https://bun.sh/install | bash"]}function T(b=Y(),W=process.platform){let k=W==="win32"?'powershell -c "irm bun.sh/install.ps1 | iex"':"curl -fsSL https://bun.sh/install | bash";return[`${b}: Rove runs on the Bun runtime, and no Bun was found on this machine.`,"","Install Bun, then run this command again:",` ${k}`," npm install -g bun # any platform, if you already have npm","","Or install Bun and Rove together in one step:"," curl -fsSL https://rove.run/install.sh | sh","",`Already have Bun somewhere unusual? Point Rove at it: ${K}=/path/to/bun`,""].join(`
4
4
  `)}function D(b,W,k=Y()){return[`${k}: this machine's Bun is too old for Rove — found ${W} at ${b}, need ${F} or newer.`,"","Rove's terminals are built on Bun's PTY API. An older Bun ignores it silently,","so every terminal and engine tab would open empty and stay empty.","","Upgrade Bun, then run this command again:"," bun upgrade # Bun installed itself (~/.bun)"," brew upgrade bun # Homebrew"," npm install -g bun@latest # npm-managed Bun","",`Have a newer Bun elsewhere? Point Rove at it: ${K}=/path/to/bun`,`Run on this one anyway (unsupported, terminals will be blank): ${p}=1`,""].join(`
5
5
  `)}function s(b,W=Y()){return[`${W}: the Bun at ${b} could not be run — \`${b} --version\` failed or never returned.`,"","Rove skipped it rather than starting through it, which would hang or fail","with a message from that binary instead of this one.","","Reinstall Bun, then run this command again:"," curl -fsSL https://bun.sh/install | bash","",`Have a working Bun elsewhere? Point Rove at it: ${K}=/path/to/bun`,""].join(`
@@ -1,4 +1,4 @@
1
- import{f as e,o as t}from"./terminal-BKWB4JIn.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-BsXizNGF.js";import{d as s,m as c,p as l,t as u}from"./createLucideIcon-DrxWh_Q-.js";import{a as d,n as f,r as p}from"./toast-I1ewzF0H.js";import{n as m,t as h}from"./ViewToggle-BSDdHLqY.js";import{n as g,t as _}from"./store-Cc1XsUcM.js";import{t as v}from"./active-task-CXPUHK6n.js";import{t as y}from"./external-store-BaYf2nY4.js";import{i as b,r as x,t as S}from"./WorkspaceTabs-BstY84VU.js";import{t as C}from"./SettingsPage-Doy1wkgu.js";import{C as w,S as T,T as E,_ as ee,c as D,f as O,g as k,h as A,m as j,n as te,o as ne,p as M,r as re,s as ie,v as ae,w as oe,x as se,y as ce}from"./index-CZKcqLos.js";import{r as le}from"./web-transport-CxvfY4-A.js";import{n as ue,t as de}from"./time-kviT26Tm.js";import{n as fe,t as pe}from"./ConfirmDialog-DKwTbNuT.js";import{t as me}from"./text-match-DW3sD-Rt.js";import{n as he,r as ge,t as _e}from"./chips-CMEcGApG.js";var ve=u(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ye=u(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),N=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),P=u(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),F=e(o(),1),I=c();function be({onClose:e}){let{tasks:t}=g(),n=d(),i=(0,F.useRef)(null);M(i);let a=(0,F.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,F.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,F.useState)(a[0]??``),[u,m]=(0,F.useState)(null),[h,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),w=async e=>{if(e){y(!0),m(null);try{let{worktrees:t}=await _(`worktree.discoverAdoptable`,{repo:e});m(t)}catch(e){p(`scan worktrees`,e),m([])}finally{y(!1)}}},T=async t=>{x(t.path);try{let{task:i}=await _(`worktree.adopt`,{repo:s,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),v(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),f(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){p(`adopt worktree`,e)}finally{x(null)}};return S?(0,I.jsx)(re,{onClose:e}):a.length===0?(0,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,I.jsxs)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:[`No repos known to `,l(),` yet. Create a task in a repo first, then come back to adopt its worktrees.`]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>C(!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,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`select`,{value:s,onChange:e=>c(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,I.jsx)(`option`,{value:e,children:e},e))}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void w(s),disabled:!s||h,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:h?`Scanning…`:`Scan`})]})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:u===null?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Pick a repo and Scan to find adoptable worktrees.`}):u.length===0?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No adoptable worktrees found for this repo.`}):u.map(e=>{let t=o.has(e.path);return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,I.jsx)(`span`,{className:`ml-auto shrink-0`,children:ue(e.lastActivityMs)})]})]}),t?(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>void T(e),disabled:b!==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:b===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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`})})]})})}var L=y({query:``,statusFilter:`all`,sortMode:`default`}),R=null;function z(e){L.update(t=>({...t,...e}))}function B(e){z({query:e})}function V(e){z({statusFilter:e})}function xe(e){z({sortMode:e})}function Se(e){!e||e===R||(R=e,z({sortMode:e}))}function Ce(){return L.useSnapshot()}function H(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function U(e,t){let n=H(t)-H(e);return n===0?t.id.localeCompare(e.id):n}function we(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(U),i.sort(U)),[...n,...r,...i]}function Te(e,t){let n=[e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `);return me(n,t)}function W({children:e,suffix:t}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function G({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:A(t?.state),l=de(e.updatedAt||e.createdAt);return(0,I.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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,I.jsx)(N,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${j(t?.state)}`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,I.jsx)(ge,{pr:e.prStatus}),e.pinned&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,I.jsx)(_e,{counts:r})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(he,{label:i}),c&&(0,I.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,I.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:s,worktreeChanges:c,uiPrefs:l,hydrated:u,streamConnected:f}=g(),{selectedTaskId:p}=n(),m=O(),h=(0,F.useMemo)(()=>ne(a),[a]),_=e=>ie(m,e,h),{query:y,statusFilter:b,sortMode:x}=Ce(),S=(0,F.useRef)(null),C=(0,F.useRef)(null);(0,F.useEffect)(()=>{p&&S.current?.querySelector(`[data-task-id="${CSS.escape(p)}"]`)?.scrollIntoView({block:`nearest`})},[p]);let w=l?.sortMode;(0,F.useEffect)(()=>{Se(w)},[w]);let T=(0,F.useMemo)(()=>we(a.filter(e=>Te(e,y)&&te(o[e.id],c[e.worktreePath],b)),x),[a,y,b,x,o,c]),E=T.filter(e=>e.kind===`main`),D=T.filter(e=>e.kind!==`main`),A=!u||!f&&a.length===0,j=d(),M=e=>{r(e),v(e),j({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.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(),C.current?.focus();return}if(n&&o&&o!==document.body&&!S.current?.contains(o)||T.length===0)return;e.preventDefault();let s=T.findIndex(e=>e.id===p),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),T.length-1);M(T[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,p]),(0,I.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,I.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>xe(x==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${x===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[T.length,`/`,a.length]}),(0,I.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,I.jsx)(ye,{size:14,strokeWidth:1.9})}),(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,I.jsx)(ce,{size:14,strokeWidth:2.2})})]})]}),(0,I.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,I.jsx)(ae,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:C,value:y,onChange:e=>B(e.target.value),onKeyDown:e=>{e.key===`Enter`&&T.length>0?(e.preventDefault(),M(T[0].id),e.currentTarget.blur()):e.key===`Escape`&&y&&(e.preventDefault(),B(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),y&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>B(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,I.jsx)(k,{size:13,strokeWidth:2})})]}),(0,I.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,I.jsx)(`button`,{type:`button`,onClick:()=>V(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${b===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,I.jsx)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:A?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,I.jsx)(N,{size:13,strokeWidth:2,className:`animate-spin`}),(0,I.jsx)(`span`,{children:`connecting…`})]}):a.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No tasks yet.`}),(0,I.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`})]}):T.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`div`,{children:y?`No matches for “${y}”.`:`No tasks in this status.`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{B(``),V(`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,I.jsxs)(I.Fragment,{children:[E.length>0&&(0,I.jsx)(W,{children:`Projects`}),E.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id)),D.length>0&&(0,I.jsx)(W,{suffix:x==="default"?void 0:x,children:`Worktrees`}),D.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id))]})}),(0,I.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,I.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,I.jsx)(ee,{size:15,strokeWidth:1.8}),(0,I.jsx)(`span`,{children:`Settings`})]})})]})}async function De(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 K(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}var q=`(?:[^()]|\\([^()]*\\))+`,je=RegExp(`!\\[([^\\]]*)\\]\\((${q})\\)`,`g`),Me=RegExp(`\\[([^\\]]+)\\]\\((${q})\\)`,`g`);function J(e,t){let n=Ae(t.replace(/&amp;/g,`&`));return n?`<a href="${K(n)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${e}</a>`:`${e}(${t})`}function Ne(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(je,(e,t,n)=>{let r=ke(n.replace(/&amp;/g,`&`));return r?`<img src="${K(r)}" alt="${t}" loading="lazy" class="kobe-md-img">`:t?J(t,n):`![${t}](${n})`})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(Me,(e,t,n)=>J(t,n))),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Y(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:Ne(e)).join(``)}function Pe(e){let t=e.replace(/\r\n/g,`
1
+ import{f as e,o as t}from"./terminal-BKWB4JIn.js";import{_ as n,f as r,l as i,r as a,y as o}from"./tabs-BsXizNGF.js";import{d as s,m as c,p as l,t as u}from"./createLucideIcon-DrxWh_Q-.js";import{a as d,n as f,r as p}from"./toast-I1ewzF0H.js";import{n as m,t as h}from"./ViewToggle-Bv5WdpVD.js";import{n as g,t as _}from"./store-Cc1XsUcM.js";import{t as v}from"./active-task-CXPUHK6n.js";import{t as y}from"./external-store-BaYf2nY4.js";import{i as b,r as x,t as S}from"./WorkspaceTabs-CpT5ktr_.js";import{t as C}from"./SettingsPage-BSWbIJdM.js";import{C as w,S as T,T as E,_ as ee,c as D,f as O,g as k,h as A,m as j,n as te,o as ne,p as M,r as re,s as ie,v as ae,w as oe,x as se,y as ce}from"./index-CPq-AhN5.js";import{r as le}from"./web-transport-CxvfY4-A.js";import{n as ue,t as de}from"./time-kviT26Tm.js";import{n as fe,t as pe}from"./ConfirmDialog-Bbk9ORM3.js";import{t as me}from"./text-match-DW3sD-Rt.js";import{n as he,r as ge,t as _e}from"./chips-CMEcGApG.js";var ve=u(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),ye=u(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),N=u(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),P=u(`panel-right`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),F=e(o(),1),I=c();function be({onClose:e}){let{tasks:t}=g(),n=d(),i=(0,F.useRef)(null);M(i);let a=(0,F.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,F.useMemo)(()=>new Set(t.map(e=>e.worktreePath).filter(Boolean)),[t]),[s,c]=(0,F.useState)(a[0]??``),[u,m]=(0,F.useState)(null),[h,y]=(0,F.useState)(!1),[b,x]=(0,F.useState)(null),[S,C]=(0,F.useState)(!1),w=async e=>{if(e){y(!0),m(null);try{let{worktrees:t}=await _(`worktree.discoverAdoptable`,{repo:e});m(t)}catch(e){p(`scan worktrees`,e),m([])}finally{y(!1)}}},T=async t=>{x(t.path);try{let{task:i}=await _(`worktree.adopt`,{repo:s,worktreePath:t.path,branch:t.branch,ifExists:`return`});r(i.id),v(i.id),n({to:`/task/$taskId`,params:{taskId:i.id}}),f(`success`,`Adopted ${t.branch||t.path}`),e()}catch(e){p(`adopt worktree`,e)}finally{x(null)}};return S?(0,I.jsx)(re,{onClose:e}):a.length===0?(0,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`px-3 py-6 text-center`,children:[(0,I.jsxs)(`p`,{className:`text-[12px] leading-relaxed text-subtle`,children:[`No repos known to `,l(),` yet. Create a task in a repo first, then come back to adopt its worktrees.`]}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>C(!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,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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,I.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,I.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,I.jsxs)(`div`,{className:`flex items-center justify-between border-b border-line px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-fg`,children:`Adopt worktree`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-subtle`,children:[`pull an existing worktree into `,l()]})]}),(0,I.jsxs)(`div`,{className:`space-y-2 px-3 py-3`,children:[(0,I.jsx)(`div`,{className:`mb-1 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Repo`}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(`select`,{value:s,onChange:e=>c(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,I.jsx)(`option`,{value:e,children:e},e))}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>void w(s),disabled:!s||h,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:h?`Scanning…`:`Scan`})]})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto border-t border-line`,children:u===null?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`Pick a repo and Scan to find adoptable worktrees.`}):u.length===0?(0,I.jsx)(`p`,{className:`px-3 py-6 text-center text-[12px] text-subtle`,children:`No adoptable worktrees found for this repo.`}):u.map(e=>{let t=o.has(e.path);return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-line-subtle px-3 py-2 last:border-b-0`,children:[(0,I.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono text-[12px] text-fg`,children:e.branch||`(detached)`}),e.dirty&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-kobe-yellow`,children:`dirty`}),e.kobeManaged&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`rove`})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 text-[10px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`truncate font-mono`,children:e.path}),e.lastActivityMs>0&&(0,I.jsx)(`span`,{className:`ml-auto shrink-0`,children:ue(e.lastActivityMs)})]})]}),t?(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`tracked`}):(0,I.jsx)(`button`,{type:`button`,onClick:()=>void T(e),disabled:b!==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:b===e.path?`Adopting…`:`Adopt`})]},e.path)})}),(0,I.jsx)(`div`,{className:`flex justify-end border-t border-line px-3 py-2`,children:(0,I.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`})})]})})}var L=y({query:``,statusFilter:`all`,sortMode:`default`}),R=null;function z(e){L.update(t=>({...t,...e}))}function B(e){z({query:e})}function V(e){z({statusFilter:e})}function xe(e){z({sortMode:e})}function Se(e){!e||e===R||(R=e,z({sortMode:e}))}function Ce(){return L.useSnapshot()}function H(e){let t=Date.parse(e.updatedAt||e.createdAt);return Number.isFinite(t)?t:0}function U(e,t){let n=H(t)-H(e);return n===0?t.id.localeCompare(e.id):n}function we(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(U),i.sort(U)),[...n,...r,...i]}function Te(e,t){let n=[e.title,e.branch,e.repo,e.worktreePath,e.vendor,e.status].filter(Boolean).join(` `);return me(n,t)}function W({children:e,suffix:t}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:e}),t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`h-px flex-1 bg-line`}),(0,I.jsx)(`span`,{className:`font-mono text-[10px] font-bold uppercase text-primary`,children:t})]}):null]})}function G({task:e,engine:t,job:n,changes:r,engineName:i,active:a,onClick:o}){let s=n?.phase===`running`,c=s?`materializing…`:A(t?.state),l=de(e.updatedAt||e.createdAt);return(0,I.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,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s?(0,I.jsx)(N,{size:10,strokeWidth:2.5,className:`shrink-0 animate-spin text-primary`}):(0,I.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${j(t?.state)}`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] ${a?`text-fg`:`text-fg/90`}`,children:e.title||e.branch}),(0,I.jsx)(ge,{pr:e.prStatus}),e.pinned&&(0,I.jsx)(`span`,{className:`shrink-0 text-[10px] text-subtle`,children:`PIN`}),(0,I.jsx)(_e,{counts:r})]}),(0,I.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-2 pl-3.5 text-[11px] text-subtle`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,children:e.branch||`—`}),(0,I.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[(0,I.jsx)(he,{label:i}),c&&(0,I.jsx)(`span`,{className:`text-muted`,children:c}),l&&(0,I.jsx)(`span`,{className:`text-subtle`,children:l})]})]})]})}function Ee({onOpenSettings:e,onNewTask:t,onAdopt:i}){let{tasks:a,engineStates:o,jobs:s,worktreeChanges:c,uiPrefs:l,hydrated:u,streamConnected:f}=g(),{selectedTaskId:p}=n(),m=O(),h=(0,F.useMemo)(()=>ne(a),[a]),_=e=>ie(m,e,h),{query:y,statusFilter:b,sortMode:x}=Ce(),S=(0,F.useRef)(null),C=(0,F.useRef)(null);(0,F.useEffect)(()=>{p&&S.current?.querySelector(`[data-task-id="${CSS.escape(p)}"]`)?.scrollIntoView({block:`nearest`})},[p]);let w=l?.sortMode;(0,F.useEffect)(()=>{Se(w)},[w]);let T=(0,F.useMemo)(()=>we(a.filter(e=>Te(e,y)&&te(o[e.id],c[e.worktreePath],b)),x),[a,y,b,x,o,c]),E=T.filter(e=>e.kind===`main`),D=T.filter(e=>e.kind!==`main`),A=!u||!f&&a.length===0,j=d(),M=e=>{r(e),v(e),j({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.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(),C.current?.focus();return}if(n&&o&&o!==document.body&&!S.current?.contains(o)||T.length===0)return;e.preventDefault();let s=T.findIndex(e=>e.id===p),c=s===-1?0:Math.min(Math.max(s+(r?1:-1),0),T.length-1);M(T[c].id)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[T,p]),(0,I.jsxs)(`aside`,{className:`flex w-64 shrink-0 flex-col border-r border-line bg-bg`,children:[(0,I.jsxs)(`div`,{className:`border-b border-line bg-surface/50 px-3 py-2`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Tasks`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`button`,{type:`button`,onClick:()=>xe(x==="default"?`recent`:`default`),className:`font-mono text-[10px] uppercase ${x===`recent`?`text-primary`:`text-muted hover:text-fg`}`,title:`Toggle task sort`,children:`sort`}),(0,I.jsxs)(`span`,{className:`font-mono text-[10px] text-muted`,children:[T.length,`/`,a.length]}),(0,I.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,I.jsx)(ye,{size:14,strokeWidth:1.9})}),(0,I.jsx)(`button`,{type:`button`,onClick:t,className:`text-muted transition-colors hover:text-primary`,title:`New task`,"aria-label":`New task`,children:(0,I.jsx)(ce,{size:14,strokeWidth:2.2})})]})]}),(0,I.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,I.jsx)(ae,{size:14,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,I.jsx)(`input`,{ref:C,value:y,onChange:e=>B(e.target.value),onKeyDown:e=>{e.key===`Enter`&&T.length>0?(e.preventDefault(),M(T[0].id),e.currentTarget.blur()):e.key===`Escape`&&y&&(e.preventDefault(),B(``))},placeholder:`Filter tasks`,className:`min-w-0 flex-1 bg-transparent text-fg placeholder:text-subtle focus:outline-none`}),y&&(0,I.jsx)(`button`,{type:`button`,onClick:()=>B(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear task filter`,title:`Clear filter`,children:(0,I.jsx)(k,{size:13,strokeWidth:2})})]}),(0,I.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,I.jsx)(`button`,{type:`button`,onClick:()=>V(e.key),title:e.title,className:`border px-1.5 py-0.5 text-[10px] transition-colors ${b===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,I.jsx)(`div`,{ref:S,className:`flex-1 overflow-y-auto`,children:A?(0,I.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-4 text-[12px] text-subtle`,children:[(0,I.jsx)(N,{size:13,strokeWidth:2,className:`animate-spin`}),(0,I.jsx)(`span`,{children:`connecting…`})]}):a.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`p`,{children:`No tasks yet.`}),(0,I.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`})]}):T.length===0?(0,I.jsxs)(`div`,{className:`px-3 py-4 text-[12px] leading-relaxed text-subtle`,children:[(0,I.jsx)(`div`,{children:y?`No matches for “${y}”.`:`No tasks in this status.`}),(0,I.jsx)(`button`,{type:`button`,onClick:()=>{B(``),V(`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,I.jsxs)(I.Fragment,{children:[E.length>0&&(0,I.jsx)(W,{children:`Projects`}),E.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id)),D.length>0&&(0,I.jsx)(W,{suffix:x==="default"?void 0:x,children:`Worktrees`}),D.map(e=>(0,I.jsx)(G,{task:e,engine:o[e.id],job:s[e.id],changes:c[e.worktreePath],engineName:_(e),active:e.id===p,onClick:()=>M(e.id)},e.id))]})}),(0,I.jsx)(`div`,{className:`border-t border-line p-2`,children:(0,I.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,I.jsx)(ee,{size:15,strokeWidth:1.8}),(0,I.jsx)(`span`,{children:`Settings`})]})})]})}async function De(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 K(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}var Oe=/^\/api\/issue-assets\/[a-f0-9]{16}\/[A-Za-z0-9_-]+\.[a-z0-9]+$/;function ke(e){let t=e.trim();return Oe.test(t)?t:null}function Ae(e){let t=e.trim();return/^https?:\/\//i.test(t)?t:t.startsWith(`//`)?null:t.startsWith(`/`)||t.startsWith(`#`)||t.startsWith(`./`)||t.startsWith(`../`)?t:null}var q=`(?:[^()]|\\([^()]*\\))+`,je=RegExp(`!\\[([^\\]]*)\\]\\((${q})\\)`,`g`),Me=RegExp(`\\[([^\\]]+)\\]\\((${q})\\)`,`g`);function J(e,t){let n=Ae(t.replace(/&amp;/g,`&`));return n?`<a href="${K(n)}" target="_blank" rel="noopener noreferrer" class="kobe-md-link">${e}</a>`:`${e}(${t})`}function Ne(e){let t=e;return t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(je,(e,t,n)=>{let r=ke(n.replace(/&amp;/g,`&`));return r?`<img src="${K(r)}" alt="${t}" loading="lazy" class="kobe-md-img">`:t?J(t,n):`![${t}](${n})`})),t.includes(`]`)&&t.includes(`)`)&&(t=t.replace(Me,(e,t,n)=>J(t,n))),t=t.replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`),t=t.replace(/(^|[^*])\*([^*]+)\*/g,`$1<em>$2</em>`),t}function Y(e){return e.split(/(`[^`]+`)/g).map((e,t)=>t%2==1?`<code class="kobe-md-code">${e.slice(1,-1)}</code>`:Ne(e)).join(``)}function Pe(e){let t=e.replace(/\r\n/g,`
2
2
  `).split(`
3
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(K(t[r])),r++;r++,n.push(`<pre class="kobe-md-pre"><code>${e.join(`
4
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">${Y(K(o[2]))}</h${e}>`),r++;continue}if(/^>\s?/.test(e)){a(),n.push(`<blockquote class="kobe-md-quote">${Y(K(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>${Y(K(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>${Y(K(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">${Y(K(l.join(` `)))}</p>`)}return a(),n.join(`
@@ -1 +1 @@
1
- import{f as e}from"./terminal-BKWB4JIn.js";import{f as t,y as n}from"./tabs-BsXizNGF.js";import{d as r,m as i}from"./createLucideIcon-DrxWh_Q-.js";import{a,n as o,r as s}from"./toast-I1ewzF0H.js";import{n as c,t as l}from"./ViewToggle-BSDdHLqY.js";import{n as u}from"./store-Cc1XsUcM.js";import{t as ee}from"./active-task-CXPUHK6n.js";import{t as d}from"./external-store-BaYf2nY4.js";import{t as f}from"./external-link-pnC-vBvQ.js";import{a as te,i as p,n as m,r as h,t as g}from"./lazy-issue-panels-BV1MbpkU.js";import{g as ne,v as _,y as v}from"./index-CZKcqLos.js";import{n as y,t as re}from"./ConfirmDialog-DKwTbNuT.js";import{_ as b,a as x,d as ie,g as S,h as C,m as w,p as T,s as E,u as D}from"./issues-CKoglLQ-.js";var O=e(n(),1),k={query:``,repo:null};function A(e){j.update(t=>({...t,...e}))}var j=d(k);function M(){return j.useSnapshot()}function N(e){e!==j.getSnapshot().query&&A({query:e})}function P(e){e!==j.getSnapshot().repo&&A({repo:e})}function ae(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,O.useState)(!1),[o,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(new Map);return(0,O.useEffect)(()=>{u(e=>{if(e.size===0)return e;let r=new Map(e),i=!1;for(let e of t){let t=n[e];if(!(!t||!t.exists))for(let n of t.issues)n.taskId&&r.delete(`${e}:${n.id}`)&&(i=!0)}return i?r:e})},[t,n]),{issueBusy:i,quickStartingId:o,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await C(e,t,n),r([e]),!0}catch(e){return s(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await x(e,t.id),r([e]),!0}catch(e){return s(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(o===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await w(e,t,{vendor:n,effort:r,placement:i});return i!==`project`&&u(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:a}),r}),o}catch(e){s(`quick start issue`,e);return}finally{c(null)}}}}}var F=i();function I({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,F.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,F.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,F.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,F.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,F.jsx)(v,{size:11,strokeWidth:2}),(0,F.jsx)(`span`,{children:`New story`})]})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,F.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=b(t)?t.taskId:void 0;return(0,F.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,F.jsx)(p,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,F.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,F.jsx)(f,{size:10,strokeWidth:1.8}),(0,F.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,F.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function L({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,F.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,F.jsx)(I,{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 R(){let{tasks:e,hydrated:n,daemonConnected:i}=u(),{query:d,repo:f}=M(),p=a(),b=(0,O.useRef)(null),[x,C]=(0,O.useState)(null),[w,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(null),[I,R]=(0,O.useState)([]);(0,O.useEffect)(()=>{let e=!1;return E().then(t=>{e||R(t)}).catch(e=>s(`load projects`,e)),()=>{e=!0}},[]);let z=(0,O.useMemo)(()=>D(e,I),[e,I]),B=(0,O.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,O.useMemo)(()=>T(z,f),[z,f]),{data:H,pending:U,refresh:W}=te(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:oe,quickStart:se}=ae({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:ce,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,O.useMemo)(()=>S({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,O.useEffect)(()=>{x&&(Y.some(e=>e.repo===x.repo&&e.issue.id===x.id)||C(null))},[Y,x]),(0,O.useEffect)(()=>{let e=e=>{if(x||w||A||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(),b.current?.focus()):e.key===`Escape`&&t===b.current&&d&&(e.preventDefault(),N(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,x,w,A]),(0,O.useEffect)(()=>{f!==V&&P(V)},[V,f]);let le=!!d,$=e=>{t(e),ee(e),p({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,F.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,F.jsx)(y,{}),(0,F.jsxs)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:[`[`,r,`]`]}),(0,F.jsx)(l,{}),(0,F.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,F.jsx)(_,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,F.jsx)(`input`,{ref:b,value:d,onChange:e=>N(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,F.jsx)(ne,{size:13,strokeWidth:2})})]}),z.length>0&&(0,F.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,F.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,F.jsx)(`select`,{value:V??``,onChange:e=>P(e.target.value),title:V??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:z.map(e=>{let t=ce.find(t=>t.repo===e.repo)?.count??0;return(0,F.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,F.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,F.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,F.jsx)(c,{}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&le&&Q?(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No stories match.`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{N(``)},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&&!i?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,F.jsx)(L,{board:X[0],onNewIssue:k,onPeekIssue:e=>C({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>j({repo:e,issue:t})}):(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>p({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=V??X[0]?.repo??B[0];return e?(0,F.jsx)(`button`,{type:`button`,onClick:()=>k(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,F.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),w&&(0,F.jsx)(g,{children:(0,F.jsx)(m,{repoRoot:w,open:!0,onClose:()=>k(null),onCreated:(e,t)=>{w&&W([w]),o(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!x)return null;let e=Y.find(e=>e.repo===x.repo&&e.issue.id===x.id);return e?(0,F.jsx)(g,{children:(0,F.jsx)(h,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>C(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await se(e.repo,e.issue,t,n,r);i&&a?(C(null),$(a)):C(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;C(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&ie(t,e.issue).then(()=>o(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>s(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),A&&(0,F.jsx)(re,{title:`Delete issue`,body:`Delete issue #${A.issue.id}: "${A.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:G,onConfirm:()=>void oe(A.repo,A.issue).then(e=>{e&&(j(null),x?.repo===A.repo&&x.id===A.issue.id&&C(null))}),onCancel:()=>j(null)})]})}export{R as Board};
1
+ import{f as e}from"./terminal-BKWB4JIn.js";import{f as t,y as n}from"./tabs-BsXizNGF.js";import{d as r,m as i}from"./createLucideIcon-DrxWh_Q-.js";import{a,n as o,r as s}from"./toast-I1ewzF0H.js";import{n as c,t as l}from"./ViewToggle-Bv5WdpVD.js";import{n as u}from"./store-Cc1XsUcM.js";import{t as ee}from"./active-task-CXPUHK6n.js";import{t as d}from"./external-store-BaYf2nY4.js";import{t as f}from"./external-link-pnC-vBvQ.js";import{a as te,i as p,n as m,r as h,t as g}from"./lazy-issue-panels-B4iqKG-C.js";import{g as ne,v as _,y as v}from"./index-CPq-AhN5.js";import{n as y,t as re}from"./ConfirmDialog-Bbk9ORM3.js";import{_ as b,a as x,d as ie,g as S,h as C,m as w,p as T,s as E,u as D}from"./issues-BW77-NNm.js";var O=e(n(),1),k={query:``,repo:null};function A(e){j.update(t=>({...t,...e}))}var j=d(k);function M(){return j.useSnapshot()}function N(e){e!==j.getSnapshot().query&&A({query:e})}function P(e){e!==j.getSnapshot().repo&&A({repo:e})}function ae(e){let{issueRepos:t,issueData:n,refreshIssues:r}=e,[i,a]=(0,O.useState)(!1),[o,c]=(0,O.useState)(null),[l,u]=(0,O.useState)(new Map);return(0,O.useEffect)(()=>{u(e=>{if(e.size===0)return e;let r=new Map(e),i=!1;for(let e of t){let t=n[e];if(!(!t||!t.exists))for(let n of t.issues)n.taskId&&r.delete(`${e}:${n.id}`)&&(i=!0)}return i?r:e})},[t,n]),{issueBusy:i,quickStartingId:o,pendingLinks:l,saveIssue:async(e,t,n)=>{a(!0);try{return await C(e,t,n),r([e]),!0}catch(e){return s(`update issue`,e),!1}finally{a(!1)}},deleteIssueConfirmed:async(e,t)=>{a(!0);try{return await x(e,t.id),r([e]),!0}catch(e){return s(`delete issue`,e),!1}finally{a(!1)}},quickStart:async(e,t,n,r,i)=>{if(o===null){c(t.id);try{let{taskId:a,workspaceTaskId:o}=await w(e,t,{vendor:n,effort:r,placement:i});return i!==`project`&&u(n=>{let r=new Map(n);return r.set(`${e}:${t.id}`,{repo:e,issueId:t.id,taskId:a}),r}),o}catch(e){s(`quick start issue`,e);return}finally{c(null)}}}}}var F=i();function I({repo:e,column:t,onNewIssue:n,onPeekIssue:r,onOpenTask:i,onDeleteIssue:a}){return(0,F.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,F.jsxs)(`div`,{className:`mb-2 flex items-baseline gap-2`,children:[(0,F.jsx)(`h2`,{className:`text-[11px] font-bold uppercase tracking-[0.12em] ${t.accent}`,children:t.title}),(0,F.jsx)(`span`,{className:`font-mono text-[10px] text-subtle`,children:t.cards.length+t.hiddenCount}),n&&(0,F.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,F.jsx)(v,{size:11,strokeWidth:2}),(0,F.jsx)(`span`,{children:`New story`})]})]}),(0,F.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto pb-2`,children:[t.cards.length===0?(0,F.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=b(t)?t.taskId:void 0;return(0,F.jsxs)(`div`,{className:`group/wrap relative`,children:[(0,F.jsx)(p,{issue:t,onOpen:()=>r(t),onDelete:()=>a(t)}),n&&(0,F.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,F.jsx)(f,{size:10,strokeWidth:1.8}),(0,F.jsx)(`span`,{children:`open task`})]})]},`issue:${t.id}`)}),t.hiddenCount>0&&(0,F.jsxs)(`div`,{className:`p-2 text-center text-[10px] text-subtle`,children:[`+`,t.hiddenCount,` more — finish stories to thin this column`]})]})]})}function L({board:e,onNewIssue:t,onPeekIssue:n,onOpenTask:r,onDeleteIssue:i}){return(0,F.jsx)(`div`,{className:`flex h-full min-w-max gap-4`,children:e.columns.map(a=>(0,F.jsx)(I,{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 R(){let{tasks:e,hydrated:n,daemonConnected:i}=u(),{query:d,repo:f}=M(),p=a(),b=(0,O.useRef)(null),[x,C]=(0,O.useState)(null),[w,k]=(0,O.useState)(null),[A,j]=(0,O.useState)(null),[I,R]=(0,O.useState)([]);(0,O.useEffect)(()=>{let e=!1;return E().then(t=>{e||R(t)}).catch(e=>s(`load projects`,e)),()=>{e=!0}},[]);let z=(0,O.useMemo)(()=>D(e,I),[e,I]),B=(0,O.useMemo)(()=>z.map(e=>e.repo),[z]),V=(0,O.useMemo)(()=>T(z,f),[z,f]),{data:H,pending:U,refresh:W}=te(B),{issueBusy:G,quickStartingId:K,pendingLinks:q,saveIssue:J,deleteIssueConfirmed:oe,quickStart:se}=ae({issueRepos:B,issueData:H,refreshIssues:W}),{allIssues:Y,repoChips:ce,projectBoards:X,shownCount:Z,hasAnyCard:Q}=(0,O.useMemo)(()=>S({issueData:H,issueRepos:B,pendingLinks:q,query:d,repoFilter:V}),[H,B,q,d,V]);(0,O.useEffect)(()=>{x&&(Y.some(e=>e.repo===x.repo&&e.issue.id===x.id)||C(null))},[Y,x]),(0,O.useEffect)(()=>{let e=e=>{if(x||w||A||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(),b.current?.focus()):e.key===`Escape`&&t===b.current&&d&&(e.preventDefault(),N(``))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[d,x,w,A]),(0,O.useEffect)(()=>{f!==V&&P(V)},[V,f]);let le=!!d,$=e=>{t(e),ee(e),p({to:`/task/$taskId`,params:{taskId:e}})};return(0,F.jsxs)(`div`,{className:`flex h-screen flex-col overflow-hidden bg-bg text-fg`,children:[(0,F.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,F.jsx)(y,{}),(0,F.jsxs)(`span`,{className:`font-mono text-[13px] font-bold text-primary`,children:[`[`,r,`]`]}),(0,F.jsx)(l,{}),(0,F.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,F.jsx)(_,{size:13,strokeWidth:1.8,className:`shrink-0 text-subtle`}),(0,F.jsx)(`input`,{ref:b,value:d,onChange:e=>N(e.target.value),placeholder:`Filter stories ( / )`,className:`w-44 bg-transparent text-[12px] text-fg placeholder:text-subtle focus:outline-none`}),d&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>N(``),className:`shrink-0 text-subtle hover:text-fg`,"aria-label":`clear filter`,title:`Clear filter`,children:(0,F.jsx)(ne,{size:13,strokeWidth:2})})]}),z.length>0&&(0,F.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,F.jsx)(`span`,{className:`shrink-0 text-[10px] font-bold uppercase tracking-[0.12em] text-subtle`,children:`Project`}),(0,F.jsx)(`select`,{value:V??``,onChange:e=>P(e.target.value),title:V??`Select project`,className:`min-w-0 flex-1 bg-transparent font-mono text-[11px] text-fg focus:outline-none`,children:z.map(e=>{let t=ce.find(t=>t.repo===e.repo)?.count??0;return(0,F.jsxs)(`option`,{value:e.repo,title:e.repo,className:`bg-surface text-fg`,children:[e.label,` · `,t,` · `,e.repo]},e.repo)})})]}),(0,F.jsx)(`div`,{className:`ml-auto flex items-center gap-3 font-mono text-[11px] text-subtle`,children:(0,F.jsxs)(`span`,{children:[Z,` stor`,Z===1?`y`:`ies`]})})]}),(0,F.jsx)(c,{}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-x-auto overflow-y-hidden p-4`,children:!n||U&&!Q?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Loading…`}):Z===0&&le&&Q?(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No stories match.`}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>{N(``)},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&&!i?(0,F.jsx)(`p`,{className:`text-[12px] text-subtle`,children:`Can't reach the daemon — issue list may be incomplete.`}):X[0]?(0,F.jsx)(L,{board:X[0],onNewIssue:k,onPeekIssue:e=>C({repo:X[0].repo,id:e.id}),onOpenTask:$,onDeleteIssue:(e,t)=>j({repo:e,issue:t})}):(0,F.jsxs)(`div`,{className:`text-[12px] leading-relaxed text-subtle`,children:[(0,F.jsx)(`p`,{children:`No projects yet. Create a task from the workspace to track stories against its repo.`}),(0,F.jsx)(`div`,{className:`mt-3 flex items-center gap-2`,children:(0,F.jsx)(`button`,{type:`button`,onClick:()=>p({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=V??X[0]?.repo??B[0];return e?(0,F.jsx)(`button`,{type:`button`,onClick:()=>k(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,F.jsx)(v,{size:22,strokeWidth:2.2})}):null})(),w&&(0,F.jsx)(g,{children:(0,F.jsx)(m,{repoRoot:w,open:!0,onClose:()=>k(null),onCreated:(e,t)=>{w&&W([w]),o(`success`,t?`Story #${e.id} created — starting its session`:`Story #${e.id} created`)}})}),(()=>{if(!x)return null;let e=Y.find(e=>e.repo===x.repo&&e.issue.id===x.id);return e?(0,F.jsx)(g,{children:(0,F.jsx)(h,{issue:e.issue,repoRoot:e.repo,busy:G,starting:K===e.issue.id,onClose:()=>C(null),onSave:t=>J(e.repo,e.issue.id,t),onStart:async({vendor:t,effort:n,placement:r,watch:i})=>{let a=await se(e.repo,e.issue,t,n,r);i&&a?(C(null),$(a)):C(null)},onOpenSession:e.issue.taskId?()=>{let t=e.issue.taskId;C(null),t&&$(t)}:void 0,onPromptMerge:e.issue.taskId?()=>{let t=e.issue.taskId;t&&ie(t,e.issue).then(()=>o(`success`,`Prompt inserted for story #${e.issue.id}`)).catch(e=>s(`prompt issue merge`,e))}:void 0},`${e.repo}:${e.issue.id}`)}):null})(),A&&(0,F.jsx)(re,{title:`Delete issue`,body:`Delete issue #${A.issue.id}: "${A.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:G,onConfirm:()=>void oe(A.repo,A.issue).then(e=>{e&&(j(null),x?.repo===A.repo&&x.id===A.issue.id&&C(null))}),onCancel:()=>j(null)})]})}export{R as Board};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-CgZ1wFNc.js","assets/terminal-BKWB4JIn.js","assets/tabs-BsXizNGF.js","assets/createLucideIcon-DrxWh_Q-.js","assets/store-Cc1XsUcM.js","assets/rotate-cw-DUqV1kpL.js","assets/web-transport-CxvfY4-A.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
2
- import{f as e}from"./terminal-BKWB4JIn.js";import{c as t,y as n}from"./tabs-BsXizNGF.js";import{m as r,t as i}from"./createLucideIcon-DrxWh_Q-.js";import{i as a}from"./store-Cc1XsUcM.js";import{t as o}from"./ChatTranscript-DWQDNdY8.js";import{t as s}from"./external-link-pnC-vBvQ.js";import{c,g as l,h as u,m as d,p as f}from"./index-CZKcqLos.js";var p=i(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),m=i(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),h=e(n(),1),g=r(),_=(0,h.lazy)(()=>a(()=>import(`./ChatTerminal-CgZ1wFNc.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function v({task:e,engine:n,onClose:r,onOpenWorkspace:i,onReview:a,onCreatePr:v}){let[y,b]=(0,h.useState)(`engine`),[x]=(0,h.useState)(()=>t(e.id)),S=(0,h.useRef)(null);f(S,!0),(0,h.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=e.target;t?.closest(`.xterm`)||t&&(t.tagName===`TEXTAREA`||t.tagName===`INPUT`)||(e.preventDefault(),r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let C=u(n?.state),w=e=>`border-b-2 px-2 py-1.5 text-[11px] transition-colors ${e?`border-primary text-fg`:`border-transparent text-muted hover:text-fg`}`;return(0,g.jsxs)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:[(0,g.jsx)(`button`,{type:`button`,"aria-label":`Close peek`,onClick:r,className:`absolute inset-0 cursor-default bg-black/40`}),(0,g.jsxs)(`div`,{ref:S,role:`dialog`,"aria-modal":`true`,"aria-label":`Session peek: ${e.title||e.branch||e.id}`,className:`relative flex h-full w-[640px] max-w-[92vw] flex-col border-l border-line bg-bg shadow-2xl`,children:[(0,g.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface px-3`,children:[(0,g.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${d(n?.state)}`}),(0,g.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-fg`,children:e.title||e.branch||e.id}),(0,g.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-[11px] text-subtle sm:inline`,children:e.branch}),C&&(0,g.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:C}),(0,g.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[a&&(0,g.jsxs)(`button`,{type:`button`,onClick:a,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Review → done if it passes`,children:[(0,g.jsx)(p,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Review`})]}),v&&(0,g.jsxs)(`button`,{type:`button`,onClick:v,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open a PR for this branch`,children:[(0,g.jsx)(m,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`PR`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open in workspace`,children:[(0,g.jsx)(s,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Workspace`})]}),(0,g.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center text-muted transition-colors hover:text-fg`,"aria-label":`Close peek`,title:`Close (Esc)`,children:(0,g.jsx)(l,{size:15,strokeWidth:1.8})})]})]}),(0,g.jsxs)(`nav`,{className:`flex shrink-0 items-center gap-1 border-b border-line bg-surface px-2`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`engine`),className:w(y===`engine`),children:`Engine`}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`transcript`),className:w(y===`transcript`),children:`Transcript`})]}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,children:y===`engine`?(0,g.jsx)(h.Suspense,{fallback:(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`}),children:(0,g.jsx)(_,{tabId:x,taskId:e.id,mode:`engine`},x)}):(0,g.jsx)(o,{worktreePath:e.worktreePath,vendor:c(e.vendor),title:e.title||e.branch})})]})]})}export{v as BoardPeek};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ChatTerminal-0kOTbkZl.js","assets/terminal-BKWB4JIn.js","assets/tabs-BsXizNGF.js","assets/createLucideIcon-DrxWh_Q-.js","assets/store-Cc1XsUcM.js","assets/rotate-cw-DUqV1kpL.js","assets/web-transport-CxvfY4-A.js","assets/ChatTerminal-BrP-ENHg.css"])))=>i.map(i=>d[i]);
2
+ import{f as e}from"./terminal-BKWB4JIn.js";import{c as t,y as n}from"./tabs-BsXizNGF.js";import{m as r,t as i}from"./createLucideIcon-DrxWh_Q-.js";import{i as a}from"./store-Cc1XsUcM.js";import{t as o}from"./ChatTranscript-B_RTOA6i.js";import{t as s}from"./external-link-pnC-vBvQ.js";import{c,g as l,h as u,m as d,p as f}from"./index-CPq-AhN5.js";var p=i(`clipboard-check`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`m9 14 2 2 4-4`,key:`df797q`}]]),m=i(`git-pull-request`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]),h=e(n(),1),g=r(),_=(0,h.lazy)(()=>a(()=>import(`./ChatTerminal-0kOTbkZl.js`).then(e=>({default:e.ChatTerminal})),__vite__mapDeps([0,1,2,3,4,5,6,7])));function v({task:e,engine:n,onClose:r,onOpenWorkspace:i,onReview:a,onCreatePr:v}){let[y,b]=(0,h.useState)(`engine`),[x]=(0,h.useState)(()=>t(e.id)),S=(0,h.useRef)(null);f(S,!0),(0,h.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=e.target;t?.closest(`.xterm`)||t&&(t.tagName===`TEXTAREA`||t.tagName===`INPUT`)||(e.preventDefault(),r())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[r]);let C=u(n?.state),w=e=>`border-b-2 px-2 py-1.5 text-[11px] transition-colors ${e?`border-primary text-fg`:`border-transparent text-muted hover:text-fg`}`;return(0,g.jsxs)(`div`,{className:`fixed inset-0 z-40 flex justify-end`,children:[(0,g.jsx)(`button`,{type:`button`,"aria-label":`Close peek`,onClick:r,className:`absolute inset-0 cursor-default bg-black/40`}),(0,g.jsxs)(`div`,{ref:S,role:`dialog`,"aria-modal":`true`,"aria-label":`Session peek: ${e.title||e.branch||e.id}`,className:`relative flex h-full w-[640px] max-w-[92vw] flex-col border-l border-line bg-bg shadow-2xl`,children:[(0,g.jsxs)(`header`,{className:`flex h-10 shrink-0 items-center gap-2 border-b border-line bg-surface px-3`,children:[(0,g.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full ${d(n?.state)}`}),(0,g.jsx)(`span`,{className:`min-w-0 truncate text-[13px] text-fg`,children:e.title||e.branch||e.id}),(0,g.jsx)(`span`,{className:`hidden min-w-0 truncate font-mono text-[11px] text-subtle sm:inline`,children:e.branch}),C&&(0,g.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted`,children:C}),(0,g.jsxs)(`div`,{className:`ml-auto flex shrink-0 items-center gap-2`,children:[a&&(0,g.jsxs)(`button`,{type:`button`,onClick:a,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Review → done if it passes`,children:[(0,g.jsx)(p,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Review`})]}),v&&(0,g.jsxs)(`button`,{type:`button`,onClick:v,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open a PR for this branch`,children:[(0,g.jsx)(m,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`PR`})]}),(0,g.jsxs)(`button`,{type:`button`,onClick:i,className:`flex items-center gap-1 text-muted transition-colors hover:text-fg`,title:`Open in workspace`,children:[(0,g.jsx)(s,{size:13,strokeWidth:1.8}),(0,g.jsx)(`span`,{className:`text-[11px]`,children:`Workspace`})]}),(0,g.jsx)(`button`,{type:`button`,onClick:r,className:`flex items-center text-muted transition-colors hover:text-fg`,"aria-label":`Close peek`,title:`Close (Esc)`,children:(0,g.jsx)(l,{size:15,strokeWidth:1.8})})]})]}),(0,g.jsxs)(`nav`,{className:`flex shrink-0 items-center gap-1 border-b border-line bg-surface px-2`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`engine`),className:w(y===`engine`),children:`Engine`}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>b(`transcript`),className:w(y===`transcript`),children:`Transcript`})]}),(0,g.jsx)(`div`,{className:`min-h-0 flex-1`,children:y===`engine`?(0,g.jsx)(h.Suspense,{fallback:(0,g.jsx)(`div`,{className:`flex h-full items-center justify-center text-[12px] text-subtle`,children:`Loading terminal…`}),children:(0,g.jsx)(_,{tabId:x,taskId:e.id,mode:`engine`},x)}):(0,g.jsx)(o,{worktreePath:e.worktreePath,vendor:c(e.vendor),title:e.title||e.branch})})]})]})}export{v as BoardPeek};