blade-code 0.10.160 → 0.10.162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blade.js +2 -2
- package/dist/{chunk-erhaedch.js → chunk-06hkf59s.js} +1 -1
- package/dist/chunk-0aya8d61.js +14 -0
- package/dist/{chunk-k3ne93k8.js → chunk-0mr8nexh.js} +2 -2
- package/dist/{chunk-tya95jej.js → chunk-0tzecdv3.js} +1 -1
- package/dist/chunk-1yq72zb7.js +8 -0
- package/dist/{chunk-jsv3e4k6.js → chunk-2f8d0km4.js} +1 -1
- package/dist/{chunk-5q4z0sfr.js → chunk-2mk914vk.js} +2 -2
- package/dist/{chunk-ht8epjz2.js → chunk-30x3mcsb.js} +2 -2
- package/dist/{chunk-6112ra8v.js → chunk-3aavhxe8.js} +1 -1
- package/dist/{chunk-ewwrss2w.js → chunk-3kszepm6.js} +1 -1
- package/dist/chunk-3xffezpc.js +1 -0
- package/dist/{chunk-28tzj187.js → chunk-3y2x6fb6.js} +1 -1
- package/dist/{chunk-7rjft1z9.js → chunk-46t79ek8.js} +2 -2
- package/dist/{chunk-9kj19a8t.js → chunk-4cdk4mds.js} +1 -1
- package/dist/chunk-4k7gvnth.js +1 -0
- package/dist/{chunk-7xtxvrh8.js → chunk-4wx5sya5.js} +1 -1
- package/dist/{chunk-7wcxjbyg.js → chunk-50vwafn5.js} +1 -1
- package/dist/{chunk-9xbwtjac.js → chunk-53fc0yrq.js} +1 -1
- package/dist/chunk-56ma2n3p.js +1 -0
- package/dist/chunk-5v0jcyea.js +2 -0
- package/dist/chunk-66wk3exc.js +1 -0
- package/dist/chunk-6c5z2b5s.js +1 -0
- package/dist/{chunk-5f40659e.js → chunk-6sedqj8r.js} +1 -1
- package/dist/{chunk-hs56jgkm.js → chunk-92ck72sg.js} +1 -1
- package/dist/{chunk-4c13mnh8.js → chunk-9cb1hv2z.js} +1 -1
- package/dist/chunk-9f6nyfcs.js +1 -0
- package/dist/{chunk-mt26v0vg.js → chunk-a6wkam4s.js} +1 -1
- package/dist/chunk-abc5bzqn.js +1 -0
- package/dist/{chunk-kr5w8q8v.js → chunk-ajtwwg2b.js} +1 -1
- package/dist/chunk-azn3qphf.js +1 -0
- package/dist/{chunk-gmmhpp0k.js → chunk-cvwcrr4h.js} +5 -5
- package/dist/{chunk-42y6ks44.js → chunk-d420fs8m.js} +1 -1
- package/dist/{chunk-n34qsnks.js → chunk-ddvdc2p0.js} +1 -1
- package/dist/chunk-e6tz8qrg.js +1 -0
- package/dist/{chunk-sdapqhj0.js → chunk-eg3ms291.js} +1 -1
- package/dist/{chunk-5xnht5vw.js → chunk-f194ct93.js} +2 -2
- package/dist/{chunk-zrgfvc4k.js → chunk-g01mth5d.js} +2 -2
- package/dist/{chunk-2ffyr4zh.js → chunk-hjrc4jdm.js} +1 -1
- package/dist/{chunk-y0vdq8h3.js → chunk-hs0fatm3.js} +1 -1
- package/dist/{chunk-0b67y4j1.js → chunk-j8hbddjp.js} +2 -2
- package/dist/chunk-j9fdpvq0.js +1 -0
- package/dist/{chunk-v1mamd1x.js → chunk-jj4ggb04.js} +2 -2
- package/dist/{chunk-f2y0gxyq.js → chunk-kqvzmnja.js} +2 -2
- package/dist/{chunk-sd9bze9x.js → chunk-kv458q06.js} +1 -1
- package/dist/{chunk-9tk6wq70.js → chunk-kvp523gt.js} +1 -1
- package/dist/{chunk-yh34b6z0.js → chunk-mg03ydep.js} +2 -2
- package/dist/{chunk-7bexc9c3.js → chunk-msx7ecb2.js} +2 -2
- package/dist/chunk-n6mv8p83.js +1 -0
- package/dist/chunk-n7kwrvvw.js +10 -0
- package/dist/{chunk-v67st2xb.js → chunk-nheny8xp.js} +2 -2
- package/dist/{chunk-4n0efk4n.js → chunk-nj2bggcj.js} +2 -2
- package/dist/{chunk-9q26ss92.js → chunk-psm2d7pr.js} +1 -1
- package/dist/chunk-pzqy0x7r.js +1 -0
- package/dist/{chunk-70hjk2jn.js → chunk-qjbn97e2.js} +2 -2
- package/dist/{chunk-sn2bqttf.js → chunk-qq8h5eag.js} +1 -1
- package/dist/{chunk-fhsvz4b1.js → chunk-rjbneaq0.js} +2 -2
- package/dist/{chunk-gm2yfq3r.js → chunk-rvs364rz.js} +2 -2
- package/dist/{chunk-g7pwwxvz.js → chunk-sspk1ah8.js} +3 -3
- package/dist/{chunk-xgyx1hwx.js → chunk-syq7j5b0.js} +2 -2
- package/dist/{chunk-qzxj1gvs.js → chunk-sz1jw89z.js} +1 -1
- package/dist/{chunk-7xhw74hk.js → chunk-t0gm0pn1.js} +1 -1
- package/dist/{chunk-erext256.js → chunk-t89f4way.js} +2 -2
- package/dist/{chunk-hv8nt7wj.js → chunk-vbjgcn49.js} +1 -1
- package/dist/{chunk-kenxyanc.js → chunk-vh5hxd2w.js} +1 -1
- package/dist/{chunk-n9819k4p.js → chunk-vw9paban.js} +1 -1
- package/dist/{chunk-fx9vm1n5.js → chunk-w33zjw8m.js} +2 -2
- package/dist/{chunk-e07acz8d.js → chunk-wbr9fc4k.js} +1 -1
- package/dist/{chunk-53vh6vpt.js → chunk-wcps5gjm.js} +1 -1
- package/dist/{chunk-jbpasjg9.js → chunk-xmymx75h.js} +1 -1
- package/dist/{chunk-a5r7c1n4.js → chunk-y54mge74.js} +3 -3
- package/dist/{chunk-vz13c7fr.js → chunk-y5wngtz0.js} +2 -2
- package/dist/{chunk-9zvxdc7t.js → chunk-yk62xvqm.js} +2 -2
- package/dist/{chunk-hj1c3k0m.js → chunk-za0frk62.js} +2 -2
- package/dist/chunk-zb6mn0dz.js +1 -0
- package/dist/{chunk-pv6cgfv1.js → chunk-zj1g4nbq.js} +1 -1
- package/dist/{chunk-wm896gnx.js → chunk-zzvs471p.js} +1 -1
- package/dist/web/assets/ChatView-er_sxPPR.js +70 -0
- package/dist/web/assets/{CodeBlockHighlighter-BpPOUcO7.js → CodeBlockHighlighter-y0h2qpHE.js} +1 -1
- package/dist/web/assets/{FilePreview-DXGkgNrQ.js → FilePreview-D3mhQ088.js} +14 -19
- package/dist/web/assets/{KanbanBoard-MYvqGgQH.js → KanbanBoard-CVg8k1mE.js} +2 -2
- package/dist/web/assets/{MarkdownRenderer-CXDrI3kX.js → MarkdownRenderer-CNBuegIp.js} +3 -3
- package/dist/web/assets/{ScrollArea-DocDa_rN.js → ScrollArea-nKClMHtv.js} +1 -1
- package/dist/web/assets/{SessionHistorySurface-D4Hxlpnr.js → SessionHistorySurface-DxS7TPaS.js} +1 -1
- package/dist/web/assets/{SettingsModal-ROSA92Eo.js → SettingsModal-CUn7pWF9.js} +1 -1
- package/dist/web/assets/{Sidebar-ByhqdRdj.js → Sidebar-CfxwNI2v.js} +1 -1
- package/dist/web/assets/TaskSwitcher-CSoJ4y5B.js +26 -0
- package/dist/web/assets/{TerminalPanel-czvVuMgl.js → TerminalPanel-BQuhnBca.js} +2 -2
- package/dist/web/assets/{archive-BwNnCDDQ.js → archive-BboAmbOv.js} +1 -1
- package/dist/web/assets/{arrow-left-Dc9lvaeD.js → arrow-left-DAUtSPbk.js} +1 -1
- package/dist/web/assets/{calendar-clock-o0GyQ0Np.js → calendar-clock-Vl0t-Nd3.js} +1 -1
- package/dist/web/assets/{chevron-right-CgHjrrmB.js → chevron-right-CF4tZJv_.js} +1 -1
- package/dist/web/assets/{clock-3-BB58ITKo.js → clock-3-UujBmwyg.js} +1 -1
- package/dist/web/assets/{copy-o_KiXkAh.js → copy-DqhAOOxU.js} +1 -1
- package/dist/web/assets/{download-BBtK3WHk.js → download-9K17cUAi.js} +1 -1
- package/dist/web/assets/{external-link-smSBd9oE.js → external-link-ZWYy4pMB.js} +1 -1
- package/dist/web/assets/{folder-BJP6kIlC.js → folder-CWkv_E0L.js} +1 -1
- package/dist/web/assets/index-C6zClU0B.js +211 -0
- package/dist/web/assets/index-CaCifsSK.css +1 -0
- package/dist/web/assets/message-square-plus-DOcUaurY.js +21 -0
- package/dist/web/assets/{pause-yqaK1hvk.js → pause-CvRQWY37.js} +1 -1
- package/dist/web/assets/{pencil-BZbDnyg2.js → pencil-CrKIc9az.js} +1 -1
- package/dist/web/assets/{play-WQ7288Ky.js → play-DN4KhXKM.js} +1 -1
- package/dist/web/assets/{plus-veQ2IAZx.js → plus-jGKGKGzn.js} +1 -1
- package/dist/web/assets/{session-events-Dwyp0AVI.js → session-events-aq2qdB3u.js} +25 -25
- package/dist/web/assets/{settings-B8xvrdSb.js → settings-DkVTw2qw.js} +1 -1
- package/dist/web/assets/{team-BrF46S7E.js → team-BBLJq3rO.js} +1 -1
- package/dist/web/assets/teamService-B6W5r_Z_.js +1 -0
- package/dist/web/assets/{terminal-BrqsCKf2.js → terminal-C30CbzhP.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-514va7ce.js +0 -2
- package/dist/chunk-6c7v7ny5.js +0 -1
- package/dist/chunk-6s037nx9.js +0 -14
- package/dist/chunk-7ss9htq0.js +0 -1
- package/dist/chunk-bz9e9hj8.js +0 -1
- package/dist/chunk-dav8ngkr.js +0 -1
- package/dist/chunk-enf0egke.js +0 -1
- package/dist/chunk-er7r2abv.js +0 -1
- package/dist/chunk-j7784bxm.js +0 -1
- package/dist/chunk-k1tfry97.js +0 -5
- package/dist/chunk-p2r4svss.js +0 -10
- package/dist/chunk-r95wa6vn.js +0 -1
- package/dist/chunk-wsa7g7vd.js +0 -1
- package/dist/chunk-yx6kf3s7.js +0 -1
- package/dist/chunk-zn9tdkrq.js +0 -1
- package/dist/chunk-zqjm9yd8.js +0 -1
- package/dist/chunk-zv01qe34.js +0 -1
- package/dist/web/assets/ChatView-DYpMrwtA.js +0 -63
- package/dist/web/assets/TaskSwitcher-Dbo20Tim.js +0 -26
- package/dist/web/assets/chevrons-up-down-zQ_UZWV9.js +0 -16
- package/dist/web/assets/index-RGoMvYl5.css +0 -1
- package/dist/web/assets/index-pqMcowCZ.js +0 -203
- package/dist/web/assets/teamService-fDnXqw4L.js +0 -1
package/dist/web/assets/{SessionHistorySurface-D4Hxlpnr.js → SessionHistorySurface-DxS7TPaS.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e,r as l}from"./vendor-react-DofNRwfy.js";import{c as O,u as g,a as c,X as _
|
|
1
|
+
import{j as e,r as l}from"./vendor-react-DofNRwfy.js";import{c as O,u as g,a as c,X as _,$ as H,C as L}from"./index-C6zClU0B.js";import{C as T}from"./copy-DqhAOOxU.js";import"./vendor-radix-D6QrtXqd.js";import"./session-events-aq2qdB3u.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as n,e as Qe,g as Kt,j as e}from"./vendor-react-DofNRwfy.js";import{c as ht,u as ge,
|
|
1
|
+
import{r as n,e as Qe,g as Kt,j as e}from"./vendor-react-DofNRwfy.js";import{c as ht,u as ge,t as Me,j as R,A as Ue,L as ne,$ as ea,C as gt,a2 as q,D as $e,e as Ie,a3 as Je,g as Ke,X as He,a4 as ta,a5 as aa,o as _t,a6 as sa,a as Le,Y as Ut,a7 as Pe,T as ze,a8 as bt,P as na,w as ra,E as la,a9 as oa,aa as ia}from"./index-C6zClU0B.js";import{_ as ie,j as se,k as ke,l as ct,m as ut,n as zt}from"./vendor-radix-D6QrtXqd.js";import{P as We}from"./plus-jGKGKGzn.js";import{E as jt,A as Ht}from"./external-link-ZWYy4pMB.js";import{D as mt}from"./download-9K17cUAi.js";import{S as da}from"./ScrollArea-nKClMHtv.js";import{C as ca}from"./calendar-clock-Vl0t-Nd3.js";import{P as ua}from"./play-DN4KhXKM.js";import{P as xt}from"./pencil-CrKIc9az.js";import{A as ma,t as rt}from"./team-BBLJq3rO.js";import{a0 as xa}from"./session-events-aq2qdB3u.js";import{A as pa}from"./arrow-left-DAUtSPbk.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-
|
|
1
|
+
import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-nKClMHtv.js";import{c as pe,l as mt,u as se,a as d,a4 as He,a5 as Qe,a6 as Ve,t as Xe,j as w,L as te,b as K,d as $,K as Se,w as kt,ap as bt,C as vt,X as gt,A as Je,z as jt,R as yt,T as wt,n as Ye,af as Oe,$ as We,U as Nt,ab as Ze,ad as et,aq as St,ae as tt,s as be,ar as st,a0 as Tt,as as Ct,ah as Et,a1 as At,N as Dt}from"./index-C6zClU0B.js";import{N as at,$ as G,a0 as Pt}from"./session-events-aq2qdB3u.js";import{A as nt}from"./archive-BboAmbOv.js";import{D as rt}from"./download-9K17cUAi.js";import{P as It}from"./pencil-CrKIc9az.js";import{S as it}from"./settings-DkVTw2qw.js";import{P as _e}from"./plus-jGKGKGzn.js";import{T as ct}from"./terminal-C30CbzhP.js";import{C as Rt}from"./chevron-right-CF4tZJv_.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as I,j as N,ab as Ke,d as $,b as A,K as Be,ac as Oe,ad as z,ae as ne,u as $e,a as i,af as B,ag as ze,ah as He,J as We,D as Qe,e as Ue,ai as Ve,g as Ge,h as Je,$ as ee,s as _e,A as we,x as Xe,G as Ye,L as O,z as Ze,R as et}from"./index-C6zClU0B.js";import{a0 as p,N as tt,$ as te}from"./session-events-aq2qdB3u.js";import{A as Se,F as nt}from"./folder-CWkv_E0L.js";import{P as st}from"./plus-jGKGKGzn.js";import{T as at}from"./terminal-C30CbzhP.js";import{S as rt}from"./settings-DkVTw2qw.js";import{C as it}from"./clock-3-UujBmwyg.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
|
+
* @license lucide-react v0.300.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const ct=I("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
|
|
7
|
+
* @license lucide-react v0.300.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const ot=I("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/**
|
|
12
|
+
* @license lucide-react v0.300.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const lt=I("Keyboard",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",ry:"2",key:"15u882"}],["path",{d:"M6 8h.001",key:"1ej0i3"}],["path",{d:"M10 8h.001",key:"1x2st2"}],["path",{d:"M14 8h.001",key:"1vkmyp"}],["path",{d:"M18 8h.001",key:"kfsenl"}],["path",{d:"M8 12h.001",key:"1sjpby"}],["path",{d:"M12 12h.001",key:"al75ts"}],["path",{d:"M16 12h.001",key:"931bgk"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
|
|
17
|
+
* @license lucide-react v0.300.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const dt=I("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"9",x2:"9",y1:"3",y2:"21",key:"13tij5"}]]);/**
|
|
22
|
+
* @license lucide-react v0.300.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const mt=I("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);function pt(t,a){const s=a.trim().toLocaleLowerCase();return s?t.filter(r=>`${r.label} ${r.description} ${r.keywords}`.toLocaleLowerCase().includes(s)):t}function ut({actions:t,selectedIndex:a,onSelect:s,onRun:r}){return t.map((c,u)=>{const x=u===a,m=c.icon;return n.jsx("div",{id:`command-center-result-${u}`,"data-task-result-index":u,role:"option","aria-selected":x,onMouseMove:()=>{x||s(u)},className:N("group flex min-h-[58px] w-full items-center rounded-lg border border-transparent text-left transition-colors",x?"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:n.jsxs("button",{type:"button",onClick:()=>r(c),className:"flex min-h-[58px] min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[n.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-accent))]",children:n.jsx(m,{className:"h-3.5 w-3.5"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate font-mono text-[12.5px] font-medium text-[hsl(var(--deck-ink))]",children:c.label}),n.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:c.description})]}),c.shortcut&&n.jsx("span",{className:"shrink-0 rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:c.shortcut}),n.jsx(Se,{className:N("h-3.5 w-3.5 shrink-0 transition-all",x?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]})},c.id)})}const ht={running:"running active 进行中 运行中",queued:"queued waiting 排队中 等待中",interrupted:"interrupted paused 已暂停 已中断",failed:"failed error 已失败 错误",cancelled:"cancelled canceled 已取消",completed:"completed done finished 已完成 完成"};function se(t){return Be(t,Oe)}function kt(t){const a=t.lastMessageTime||t.firstMessageTime;if(!a)return"";const s=new Date(a);return Number.isNaN(s.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(s)}function H(t){return t.normalize("NFKC").toLocaleLowerCase().trim()}function xt(t,a){var r,c;const s=z(t,a);return H([se(t),ne(s),s,t.projectPath,t.gitBranch,t.taskWorktreeBranch,t.taskStatus,ht[t.taskStatus],((r=t.pendingInteraction)==null?void 0:r.type)==="question"?"needs answer question attention 等待回答 需要回答":((c=t.pendingInteraction)==null?void 0:c.type)==="elicitation"?"mcp input elicitation attention MCP 输入 等待输入":t.pendingInteraction?"needs approval permission attention 等待审批 需要授权":"",t.sessionId].filter(Boolean).join(" "))}function je(t,a,s){if(!a)return 0;const r=H(se(t)),c=H(ne(z(t,s)));return r===a?500:r.startsWith(a)?400:r.includes(a)?300:c===a?250:c.startsWith(a)?200:100}function ft(t,a,s,r=50){const c=H(a),u=c.split(/\s+/).filter(Boolean),x=new Set;return t.filter(m=>{if(u.length===0)return!0;const h=xt(m,s);return u.every(y=>h.includes(y))}).sort((m,h)=>{const y=+!!h.pendingInteraction-+!!m.pendingInteraction;return y!==0?y:je(h,c,s)-je(m,c,s)||Ke(m,h)}).filter(m=>{const h=$(A(m));return x.has(h)?!1:(x.add(h),!0)}).slice(0,r)}const gt={running:"sidebar.group.running",queued:"sidebar.group.queued",interrupted:"sidebar.group.interrupted",failed:"sidebar.group.failed",cancelled:"sidebar.group.cancelled",completed:"sidebar.group.done"};function Mt(){const t=$e(),a=p(e=>e.isTaskSwitcherOpen),s=p(e=>e.taskSwitcherMode),r=p(e=>e.setTaskSwitcherOpen),c=p(e=>e.setTaskSwitcherMode),u=p(e=>e.setMainView),x=p(e=>e.toggleSidebar),m=p(e=>e.isFilePreviewOpen),h=p(e=>e.setFilePreviewOpen),y=p(e=>e.openFilePreview),W=p(e=>e.toggleTerminal),w=p(e=>e.openSettings),b=i(e=>e.sessions),Ne=i(e=>e.isLoading),C=i(e=>e.catalogLoadState),Q=C==="loading"||C==="hydrating",U=i(e=>e.currentSessionRef),V=i(e=>tt(e.historySurfaceSelection)),ae=i(e=>e.closeHistorySurface),re=i(e=>e.isTemporarySession),ie=i(e=>e.startTemporarySession),G=i(e=>e.unreadTaskKeys),Ce=i(e=>e.boundProjects),P=i(e=>{var o;return e.selectedProjectPath??((o=e.taskWorkspaceInfo)==null?void 0:o.cwd)??null}),Te=i(e=>e.selectProject),Me=i(e=>e.selectSession),De=i(e=>e.cancelTask),Ae=i(e=>e.retryTask),Ie=i(e=>e.cancellingTaskKeys),Pe=i(e=>e.retryingTaskKeys),[v,ce]=l.useState(""),[T,oe]=l.useState(null),[Re,J]=l.useState(null),[le,R]=l.useState(null),de=l.useRef(null),me=l.useRef(null),M=l.useRef(!1),pe=l.useMemo(()=>[{id:"new-task",label:t("commandCenter.action.newTask"),description:t("commandCenter.action.newTaskDescription"),keywords:"create compose session",icon:st,shortcut:B("newTask"),run:()=>{ae(),u("workspace"),ie(),requestAnimationFrame(()=>We())}},{id:"toggle-preview",label:t("commandCenter.action.preview"),description:t("commandCenter.action.previewDescription"),keywords:"diff files logs artifact review",icon:ze,run:()=>{te(i.getState())||(m?h(!1):y((!U||re)&&p.getState().previewRequestId===0?{tab:"files"}:void 0))}},{id:"toggle-terminal",label:t("commandCenter.action.terminal"),description:t("commandCenter.action.terminalDescription"),keywords:"shell console command line",icon:at,run:()=>{te(i.getState())||W()}},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:rt,run:()=>w("general")},{id:"open-models",label:t("commandCenter.action.models"),description:t("commandCenter.action.modelsDescription"),keywords:"provider llm api configuration",icon:ot,run:()=>w("models")},{id:"open-shortcuts",label:t("commandCenter.action.shortcuts"),description:t("commandCenter.action.shortcutsDescription"),keywords:"keyboard hotkey key binding",icon:lt,shortcut:B("openCommands"),run:()=>w("shortcuts")},{id:"open-skills",label:t("commandCenter.action.skills"),description:t("commandCenter.action.skillsDescription"),keywords:"capabilities workflow",icon:He,run:()=>w("skills")},{id:"open-mcp",label:t("commandCenter.action.mcp"),description:t("commandCenter.action.mcpDescription"),keywords:"server tools protocol integration",icon:mt,run:()=>w("mcp")},{id:"toggle-sidebar",label:t("commandCenter.action.sidebar"),description:t("commandCenter.action.sidebarDescription"),keywords:"navigation layout panel projects",icon:dt,shortcut:B("toggleSidebar"),run:x}],[U,ae,m,re,y,w,h,u,ie,t,x,W]),g=l.useMemo(()=>ft(b,v,P),[P,v,b]),j=l.useMemo(()=>pt(pe,v),[pe,v]),L=l.useMemo(()=>s==="tasks"?g.map(e=>$(A(e))):j.map(e=>e.id),[s,g,j]),F=JSON.stringify([a,s,v]),k=Math.max(0,(T==null?void 0:T.scope)===F&&T.key!==null?L.indexOf(T.key):-1),ue=L[k]??null,q=e=>oe({scope:F,key:L[e]??null}),D=L.length,he=l.useMemo(()=>b.filter(e=>!!e.pendingInteraction).length,[b]),_=s==="tasks"?g[k]??null:null,X=s==="commands"?j[k]??null:null;l.useEffect(()=>{M.current=!1,a&&(ce(""),J(null),R(null))},[s,a]),l.useEffect(()=>{V&&a&&r(!1)},[V,a,r]),l.useEffect(()=>{oe({scope:F,key:ue})},[F,ue]),l.useEffect(()=>{var o,d;const e=(o=me.current)==null?void 0:o.querySelector(`[data-task-result-index="${k}"]`);(d=e==null?void 0:e.scrollIntoView)==null||d.call(e,{block:"nearest"})},[k]);const ke=async e=>{const o=A(e),d=$(o),f=z(e,P);J(d),Ce.some(S=>S.path===f)&&Te(f);try{u("workspace"),await Me(o),r(!1)}catch(S){R(S instanceof Error?S.message:t("taskSwitcher.action.failed"))}finally{J(null)}},xe=async(e,o)=>{if(!te(i.getState())){R(null);try{const d=A(o);e==="cancel"?await De(d):(await Ae(d),r(!1))}catch(d){R(d instanceof Error?d.message:t("taskSwitcher.action.failed"))}}},fe=e=>{r(!1),requestAnimationFrame(e.run)},ge=e=>M.current||e.isComposing||e.keyCode===229,Le=e=>{ge(e.nativeEvent)||(e.key==="ArrowDown"?(e.preventDefault(),q(D===0?0:(k+1)%D)):e.key==="ArrowUp"?(e.preventDefault(),q(D===0?0:(k-1+D)%D)):e.key==="Enter"&&_?(e.preventDefault(),ke(_)):e.key==="Enter"&&X?(e.preventDefault(),fe(X)):e.key==="Escape"&&(e.preventDefault(),r(!1)))};return V?null:n.jsx(Qe,{open:a,onOpenChange:r,children:n.jsxs(Ue,{hideCloseButton:!0,onEscapeKeyDown:e=>{ge(e)&&e.preventDefault()},onCloseAutoFocus:Ve,className:"top-3 w-[min(680px,calc(100vw-32px))] max-w-none translate-y-0 gap-0 overflow-hidden rounded-xl border-[hsl(var(--deck-border-strong))] bg-[hsl(var(--deck-canvas))] p-0 shadow-2xl sm:top-[18%]",children:[n.jsx(Ge,{className:"sr-only",children:t("commandCenter.title")}),n.jsx(Je,{className:"sr-only",children:t("commandCenter.description")}),n.jsxs("div",{className:"flex h-14 items-center gap-3 border-b border-[hsl(var(--deck-hairline))] px-4",children:[n.jsx(ee,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]"}),n.jsx("input",{ref:de,autoFocus:!0,role:"combobox","aria-expanded":"true","aria-controls":"task-switcher-results","aria-activedescendant":_?`task-switcher-result-${k}`:X?`command-center-result-${k}`:void 0,"aria-label":t(s==="tasks"?"taskSwitcher.searchAria":"commandCenter.searchAria"),placeholder:t(s==="tasks"?"taskSwitcher.placeholder":"commandCenter.placeholder"),value:v,onChange:e=>ce(e.target.value),onCompositionStart:()=>{M.current=!0},onCompositionEnd:()=>{M.current=!1},onBlur:()=>{M.current=!1},onKeyDown:Le,className:"h-full min-w-0 flex-1 bg-transparent font-mono text-[14px] text-[hsl(var(--deck-ink))] outline-none placeholder:text-[hsl(var(--deck-ink-faint))]"}),n.jsx("span",{className:"rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:"ESC"})]}),n.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 pb-2 pt-3",children:[n.jsx("div",{role:"tablist","aria-label":t("commandCenter.modeAria"),className:"flex items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["tasks","commands"].map(e=>n.jsx("button",{type:"button",role:"tab","aria-selected":s===e,onClick:()=>{c(e),requestAnimationFrame(()=>{var o;return(o=de.current)==null?void 0:o.focus()})},className:N("rounded-[5px] px-2.5 py-1 font-mono text-[9.5px] uppercase tracking-[0.1em] transition-colors",s===e?"bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-ink))] shadow-sm":"text-[hsl(var(--deck-ink-faint))] hover:text-[hsl(var(--deck-ink-muted))]"),children:t(e==="tasks"?"commandCenter.mode.tasks":"commandCenter.mode.commands")},e))}),n.jsx("span",{children:n.jsx("span",{className:"font-mono text-[9.5px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:s==="commands"?t("commandCenter.actions",{count:j.length}):v?t("taskSwitcher.results",{count:g.length}):Q?b.length===0?t("taskSwitcher.indexing"):t("taskSwitcher.indexingLoaded",{count:b.length}):C==="error"?t("sidebar.catalog.incomplete"):he>0?t("taskSwitcher.needsAction",{count:he}):G.length>0?t("taskSwitcher.unread",{count:G.length}):t("taskSwitcher.scope",{count:b.length})})})]}),le&&n.jsx("div",{role:"alert",className:"mx-4 mb-2 rounded-md border border-red-300/70 bg-red-50 px-3 py-2 font-mono text-[10.5px] text-red-700 dark:border-red-900/70 dark:bg-red-950/35 dark:text-red-300",children:le}),n.jsxs("div",{id:"task-switcher-results",ref:me,role:"listbox","aria-label":t(s==="tasks"?"taskSwitcher.resultsAria":"commandCenter.resultsAria"),className:"max-h-[min(460px,60vh)] overflow-y-auto px-2 pb-2",children:[s==="commands"&&n.jsx(ut,{actions:j,selectedIndex:k,onSelect:q,onRun:fe}),s==="tasks"&&g.map((e,o)=>{const d=A(e),f=$(d),S=z(e,P),Fe=ne(S),ye=_e(d,U),E=o===k,qe=Re===f,Ee=G.includes(f),K=se(e),be=e.taskStatus==="running"||e.taskStatus==="queued",ve=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),Y=Ie.includes(f),Z=Pe.includes(f);return n.jsxs("div",{id:`task-switcher-result-${o}`,"data-task-result-index":o,"data-session-ref":f,role:"option","aria-selected":E,onMouseMove:()=>{E||q(o)},className:N("group flex min-h-[68px] w-full items-center rounded-lg border border-transparent text-left transition-colors",E?"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[n.jsxs("button",{type:"button",onClick:()=>void ke(e),"aria-label":t("session.action.select",{title:K}),className:"flex min-h-[68px] min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[n.jsx("span",{className:N("flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-[hsl(var(--deck-canvas))]",ye?"border-[hsl(var(--deck-accent)/0.5)] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] text-[hsl(var(--deck-ink-faint))]"),children:e.pendingInteraction?n.jsx(we,{className:"h-3.5 w-3.5 animate-pulse text-amber-600 dark:text-amber-400"}):e.taskStatus==="running"?n.jsx(ct,{className:"h-3.5 w-3.5 animate-pulse"}):n.jsx(Xe,{className:"h-3.5 w-3.5"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsxs("span",{className:"flex items-center gap-2",children:[n.jsx("span",{className:"truncate font-mono text-[12.5px] font-medium text-[hsl(var(--deck-ink))]",children:K}),ye&&n.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.1em] text-[hsl(var(--deck-accent))]",children:t("taskSwitcher.current")}),Ee&&n.jsx("span",{className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.1em] text-[hsl(var(--deck-accent))]",children:t("taskSwitcher.new")}),e.pendingInteraction&&n.jsx("span",{className:"shrink-0 rounded bg-amber-100 px-1.5 py-0.5 font-mono text-[8.5px] uppercase tracking-[0.08em] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",children:t(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")}),e.taskRetriedFrom&&n.jsx("span",{title:`${t("session.retriedFrom")} ${e.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 font-mono text-[8.5px] text-[hsl(var(--deck-accent))]",children:t("session.retryShort")})]}),n.jsxs("span",{className:"mt-1 flex min-w-0 items-center gap-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(nt,{className:"h-2.5 w-2.5 shrink-0"}),n.jsx("span",{className:"truncate",children:Fe})]}),(e.taskWorktreeBranch||e.gitBranch)&&n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(Ye,{className:"h-2.5 w-2.5 shrink-0"}),n.jsx("span",{className:"truncate",children:e.taskWorktreeBranch||e.gitBranch})]}),n.jsx("span",{className:"shrink-0",children:e.taskStatus==="queued"&&e.taskQueuePosition!==void 0&&e.taskQueueDepth!==void 0?t("session.queued",{position:e.taskQueuePosition,depth:e.taskQueueDepth}):e.pendingInteraction?t(e.pendingInteraction.type==="question"?"interaction.badge.question":e.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):t(gt[e.taskStatus])}),n.jsxs("span",{className:"ml-auto inline-flex shrink-0 items-center gap-1",children:[n.jsx(it,{className:"h-2.5 w-2.5"}),kt(e)]})]})]}),qe?n.jsx(O,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}):n.jsx(Se,{className:N("h-3.5 w-3.5 shrink-0 transition-all",E?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]}),(be||ve)&&n.jsxs("div",{className:"flex shrink-0 items-center pr-2",children:[be&&n.jsx("button",{type:"button","aria-label":t(Y?"session.action.stopping":"session.action.stop",{title:K}),disabled:Y,onClick:()=>void xe("cancel",e),className:"flex h-8 w-8 items-center justify-center rounded-md text-red-500 transition-colors hover:bg-red-500/10 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-red-500 disabled:cursor-wait disabled:opacity-60",children:Y?n.jsx(O,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ze,{className:"h-3.5 w-3.5"})}),ve&&n.jsx("button",{type:"button","aria-label":t(Z?"session.action.retrying":"session.action.retry",{title:K}),disabled:Z,onClick:()=>void xe("retry",e),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:Z?n.jsx(O,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(et,{className:"h-3.5 w-3.5"})})]})]},f)}),s==="tasks"&&g.length===0&&Q&&n.jsxs("div",{className:"flex min-h-36 items-center justify-center gap-2 font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsx(O,{className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("taskSwitcher.indexing")]}),s==="tasks"&&g.length===0&&!Q&&C!=="error"&&!Ne&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(ee,{className:"mb-3 h-5 w-5 text-[hsl(var(--deck-ink-faint))]"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("taskSwitcher.empty")}),n.jsx("p",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("taskSwitcher.emptyHint")})]}),s==="tasks"&&g.length===0&&C==="error"&&n.jsxs("div",{role:"alert",className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(we,{className:"mb-3 h-5 w-5 text-amber-500"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("sidebar.catalog.incomplete")})]}),s==="commands"&&j.length===0&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(ee,{className:"mb-3 h-5 w-5 text-[hsl(var(--deck-ink-faint))]"}),n.jsx("p",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("commandCenter.empty")}),n.jsx("p",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("commandCenter.emptyHint")})]})]}),n.jsxs("div",{className:"flex items-center gap-4 border-t border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))] px-4 py-2 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[n.jsxs("span",{children:["↑↓ ",t("taskSwitcher.hint.navigate")]}),n.jsxs("span",{children:["↵ ",t("taskSwitcher.hint.open")]}),n.jsxs("span",{className:"ml-auto",children:[B(s==="tasks"?"openCommands":"searchTasks")," ",t(s==="tasks"?"commandCenter.mode.commands":"commandCenter.mode.tasks")]})]})]})})}export{Mt as TaskSwitcher};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r,j as a}from"./vendor-react-DofNRwfy.js";import{D as R,o as C,L as
|
|
1
|
+
import{r,j as a}from"./vendor-react-DofNRwfy.js";import{D as R,o as C,L as N}from"./vendor-xterm-DuYZoU4T.js";import{c as M,u as F,a as x,ao as T,j as p,X as W}from"./index-C6zClU0B.js";import{a0 as I,$ as L,N as A}from"./session-events-aq2qdB3u.js";import{T as D}from"./terminal-C30CbzhP.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const $=M("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),J=({workspacePath:b})=>{const c=F(),E=x(e=>e.historySurfaceSelection),{isTerminalOpen:l,toggleTerminal:z}=I(),[s,j]=r.useState(!1),[y,u]=r.useState(!1),h=T(),g=r.useRef(null),i=r.useRef(null),m=r.useRef(null),o=r.useRef(null),S=r.useRef(null),v=r.useCallback(()=>{var f;if(L(x.getState())||((f=o.current)==null?void 0:f.readyState)===WebSocket.OPEN)return;const e=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal/ws`,t=b?`${e}?cwd=${encodeURIComponent(b)}`:e,n=new WebSocket(t);o.current=n,n.onopen=()=>{u(!0)},n.onmessage=w=>{var d;(d=i.current)==null||d.write(w.data)},n.onclose=()=>{u(!1)},n.onerror=()=>{u(!1)}},[b]),k=r.useCallback(()=>{o.current&&(o.current.close(),o.current=null),u(!1)},[]),B=r.useCallback(e=>{var t;A(x.getState().historySurfaceSelection)||((t=o.current)==null?void 0:t.readyState)===WebSocket.OPEN&&o.current.send(e)},[]);return r.useEffect(()=>(S.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{var e;return(e=S.current)==null?void 0:e.focus({preventScroll:!0})}),[]),r.useEffect(()=>{if(!l||!g.current||i.current)return;const e={background:"#ffffff",foreground:"#111827",cursor:"#111827",cursorAccent:"#ffffff",selectionBackground:"#E5E7EB",black:"#111827",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#111827",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#a855f7",brightCyan:"#22d3ee",brightWhite:"#111827"},t=new R({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:"JetBrains Mono, Menlo, Monaco, Consolas, monospace",allowTransparency:!0,scrollback:1e4,theme:h?{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}:e}),n=new C,f=new N;t.loadAddon(n),t.loadAddon(f),t.open(g.current),n.fit();const w=requestAnimationFrame(()=>t.focus());return t.onData(d=>{B(d)}),i.current=t,m.current=n,v(),()=>{cancelAnimationFrame(w),k(),t.dispose(),i.current=null,m.current=null}},[E,l,v,k,B]),r.useEffect(()=>{i.current&&(i.current.options.theme=h?{background:"#0a0a0a",foreground:"#e4e4e7",cursor:"#e4e4e7",cursorAccent:"#0a0a0a",selectionBackground:"#3f3f46",black:"#18181b",red:"#ef4444",green:"#22c55e",yellow:"#eab308",blue:"#3b82f6",magenta:"#a855f7",cyan:"#06b6d4",white:"#e4e4e7",brightBlack:"#52525b",brightRed:"#f87171",brightGreen:"#4ade80",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#c084fc",brightCyan:"#22d3ee",brightWhite:"#fafafa"}:{background:"#ffffff",foreground:"#111827",cursor:"#111827",cursorAccent:"#ffffff",selectionBackground:"#E5E7EB",black:"#111827",red:"#dc2626",green:"#16a34a",yellow:"#ca8a04",blue:"#2563eb",magenta:"#7c3aed",cyan:"#0891b2",white:"#111827",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#facc15",brightBlue:"#60a5fa",brightMagenta:"#a855f7",brightCyan:"#22d3ee",brightWhite:"#111827"})},[h]),r.useEffect(()=>{if(!l||s)return;const e=()=>{var n;(n=m.current)==null||n.fit()};window.addEventListener("resize",e);const t=setTimeout(e,100);return()=>{window.removeEventListener("resize",e),clearTimeout(t)}},[l,s]),!l||A(E)?null:a.jsxs("div",{role:"region","aria-label":c("terminal.title"),className:p("fixed bottom-0 left-0 right-0 z-40 bg-white dark:bg-[#0a0a0a] border-t border-[#E5E7EB] dark:border-zinc-800 transition-all duration-200",s?"h-10":"h-[min(18rem,45dvh)]"),children:[a.jsxs("div",{className:"flex items-center justify-between h-10 px-3 border-b border-[#E5E7EB] dark:border-zinc-800 bg-[#F9FAFB] dark:bg-zinc-900/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(D,{className:"h-4 w-4 text-[#9CA3AF] dark:text-zinc-400"}),a.jsx("span",{className:"text-sm text-[#6B7280] dark:text-zinc-400",children:c("terminal.title")}),a.jsx("span",{role:"status","aria-label":c(y?"terminal.status.connected":"terminal.status.disconnected"),className:p("w-2 h-2 rounded-full",y?"bg-green-500":"bg-zinc-600")})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",onClick:()=>j(!s),"aria-label":c(s?"terminal.action.restore":"terminal.action.minimize"),className:"p-1.5 rounded hover:bg-[#E5E7EB] text-[#9CA3AF] hover:text-[#111827] dark:hover:bg-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 transition-colors",children:a.jsx($,{className:"h-4 w-4"})}),a.jsx("button",{type:"button",onClick:()=>{k(),z()},"aria-label":c("terminal.action.close"),className:"p-1.5 rounded hover:bg-[#E5E7EB] text-[#9CA3AF] hover:text-[#111827] dark:hover:bg-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 transition-colors",children:a.jsx(W,{className:"h-4 w-4"})})]})]}),a.jsx("div",{ref:g,className:p("h-[calc(100%-40px)] p-2",s&&"hidden")})]})};export{J as TerminalPanel};
|