blade-code 0.10.128 → 0.10.130
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-0z9nqbd0.js +2 -0
- package/dist/chunk-1bb4h5gf.js +1 -0
- package/dist/chunk-2bnpn8be.js +1 -0
- package/dist/{chunk-xzfc1s6k.js → chunk-2y1qngw7.js} +1 -1
- package/dist/{chunk-jy0vfp8a.js → chunk-42h7kj6p.js} +1 -1
- package/dist/{chunk-ted1hyvb.js → chunk-44jtpg8y.js} +1 -1
- package/dist/chunk-4sxxvtn4.js +1 -0
- package/dist/chunk-51qc7n8t.js +1 -0
- package/dist/{chunk-z3hpstky.js → chunk-53h87fmt.js} +1 -1
- package/dist/{chunk-y93nqyqd.js → chunk-55hq1ps4.js} +2 -2
- package/dist/{chunk-9n90djh7.js → chunk-5a17mdjd.js} +2 -2
- package/dist/{chunk-pq6g92cz.js → chunk-6p6ts4kv.js} +2 -2
- package/dist/{chunk-sca5q3tt.js → chunk-77efqpdc.js} +1 -1
- package/dist/chunk-7jj607dg.js +94 -0
- package/dist/{chunk-yqqeh12b.js → chunk-8a6nrqdc.js} +2 -2
- package/dist/{chunk-10w2pj3r.js → chunk-93x9xbew.js} +1 -1
- package/dist/{chunk-1aw643j2.js → chunk-9et78e3v.js} +2 -2
- package/dist/chunk-9gs4eqt8.js +1 -0
- package/dist/chunk-9s8saznq.js +1 -0
- package/dist/{chunk-fa0pyv9k.js → chunk-9yqadjea.js} +2 -2
- package/dist/{chunk-a7gghhvn.js → chunk-a4jetpj8.js} +18 -18
- package/dist/{chunk-yqpej45c.js → chunk-a60cmnmz.js} +2 -2
- package/dist/{chunk-8hd4vd20.js → chunk-aaxc81jc.js} +1 -1
- package/dist/{chunk-xejvs1fk.js → chunk-agda17kj.js} +1 -1
- package/dist/{chunk-c47db31j.js → chunk-ajsw4te2.js} +2 -2
- package/dist/{chunk-r04vwtej.js → chunk-ar5np5h5.js} +2 -2
- package/dist/chunk-b8m7zc7t.js +170 -0
- package/dist/chunk-bcre3557.js +1 -0
- package/dist/{chunk-atema2rc.js → chunk-dfjmvj3d.js} +2 -2
- package/dist/chunk-dkgaxmsp.js +10 -0
- package/dist/{chunk-mkvvyq49.js → chunk-e1d0e6t6.js} +2 -2
- package/dist/{chunk-s7axaw78.js → chunk-edtxcqxa.js} +1 -1
- package/dist/chunk-f8gb685p.js +2 -0
- package/dist/chunk-fjv2vede.js +1 -0
- package/dist/{chunk-zfyg3888.js → chunk-g4xny949.js} +1 -1
- package/dist/chunk-gfbkrk60.js +338 -0
- package/dist/{chunk-12hdakw4.js → chunk-gmqpfm52.js} +2 -2
- package/dist/{chunk-skv2gb99.js → chunk-grhsv55v.js} +2 -2
- package/dist/chunk-gzz0gnmv.js +1 -0
- package/dist/chunk-h1wphqkc.js +1 -0
- package/dist/{chunk-6v2hhgka.js → chunk-hhg1zcbq.js} +2 -2
- package/dist/{chunk-9hnfz9bx.js → chunk-hw1gbr11.js} +1 -1
- package/dist/{chunk-nx8xb7dm.js → chunk-jkfkyedn.js} +1 -1
- package/dist/chunk-kd3k1q9z.js +1 -0
- package/dist/{chunk-n8w1jxsh.js → chunk-kfkvdj49.js} +1 -1
- package/dist/chunk-m9mw8ppy.js +1 -0
- package/dist/{chunk-xshrj2nd.js → chunk-mdew58v9.js} +1 -1
- package/dist/{chunk-n4q6fvqe.js → chunk-mvm1rzc4.js} +2 -2
- package/dist/{chunk-qm632an7.js → chunk-p00f53yq.js} +1 -1
- package/dist/{chunk-p7349xay.js → chunk-p2sp2e0a.js} +2 -2
- package/dist/chunk-pj69j4zp.js +2 -0
- package/dist/{chunk-41byj2h8.js → chunk-pk11fexz.js} +2 -2
- package/dist/chunk-qahz5x5c.js +14 -0
- package/dist/{chunk-6m4sqwj0.js → chunk-qcvxff27.js} +2 -2
- package/dist/{chunk-p2rxrxct.js → chunk-r9tawy93.js} +3 -3
- package/dist/{chunk-rz2wc93t.js → chunk-s2atpv23.js} +4 -4
- package/dist/chunk-saedy6bj.js +1 -0
- package/dist/{chunk-fgbqm2jh.js → chunk-sfe4810k.js} +1 -1
- package/dist/{chunk-96w8ay2h.js → chunk-sj1dzeta.js} +1 -1
- package/dist/chunk-sn71fsm5.js +1 -0
- package/dist/{chunk-yysqw1cq.js → chunk-ss4sncn3.js} +2 -2
- package/dist/chunk-ss86eq2h.js +23 -0
- package/dist/{chunk-ektgnqmh.js → chunk-sx77dpxw.js} +1 -1
- package/dist/chunk-t4apxzp1.js +2 -0
- package/dist/chunk-te6203yf.js +1 -0
- package/dist/{chunk-gxwkwkhp.js → chunk-tkydv9k8.js} +1 -1
- package/dist/{chunk-60he05xs.js → chunk-tw5fr07c.js} +2 -2
- package/dist/{chunk-q3y3s16v.js → chunk-v52wc8yg.js} +2 -2
- package/dist/{chunk-b408cqg1.js → chunk-v5hzk7j2.js} +2 -2
- package/dist/{chunk-v4nqv1pr.js → chunk-v94ztjtp.js} +385 -385
- package/dist/{chunk-85jv1sr7.js → chunk-xa9k5pjt.js} +2 -2
- package/dist/{chunk-mvgmsjwq.js → chunk-z03dtyh6.js} +1 -1
- package/dist/{chunk-jxc67ydz.js → chunk-zc91c7b5.js} +2 -2
- package/dist/{chunk-mm05y2c5.js → chunk-zkzhm39s.js} +1 -1
- package/dist/{chunk-1xg7qx35.js → chunk-zwjrensv.js} +1 -1
- package/dist/web/assets/ChatView-Bg36FUaj.js +53 -0
- package/dist/web/assets/{CodeBlockHighlighter-0VOa5Mes.js → CodeBlockHighlighter-D5rB73Eo.js} +2 -2
- package/dist/web/assets/FilePreview-BxaBSmap.js +65 -0
- package/dist/web/assets/KanbanBoard-B4gx3JMo.js +16 -0
- package/dist/web/assets/{MarkdownRenderer-3g4TPTeI.js → MarkdownRenderer-BRH7LHhN.js} +3 -3
- package/dist/web/assets/ScrollArea-DikU3QeQ.js +1 -0
- package/dist/web/assets/SessionHistorySurface-DG80d6-F.js +6 -0
- package/dist/web/assets/{SettingsModal-3GMy6V-E.js → SettingsModal-Bxqkok81.js} +3 -3
- package/dist/web/assets/Sidebar-DGaHGcHx.js +31 -0
- package/dist/web/assets/TaskSwitcher-DOnLPurk.js +26 -0
- package/dist/web/assets/TerminalPanel-BzhCF9vw.js +6 -0
- package/dist/web/assets/archive-BiDGrqry.js +6 -0
- package/dist/web/assets/{arrow-left-03GxbYI7.js → arrow-left-BY-esOAP.js} +1 -1
- package/dist/web/assets/{calendar-clock-8W4ostX1.js → calendar-clock-BCyxvfVt.js} +1 -1
- package/dist/web/assets/chevron-right-Bg-10yuN.js +6 -0
- package/dist/web/assets/{chevrons-up-down-BboZzEAk.js → chevrons-up-down-M5SAJq7T.js} +1 -1
- package/dist/web/assets/{clock-3-aXgeptZP.js → clock-3-v-nHTA0A.js} +1 -1
- package/dist/web/assets/copy-p1zc_rjZ.js +6 -0
- package/dist/web/assets/download-D_-kbJXR.js +6 -0
- package/dist/web/assets/{external-link-UkIIC2ds.js → external-link-wSGTIqe3.js} +1 -1
- package/dist/web/assets/{folder-BOCc5dv2.js → folder-Ltm9jCS5.js} +1 -1
- package/dist/web/assets/index-B4186fIT.css +1 -0
- package/dist/web/assets/index-_xnlrekR.js +210 -0
- package/dist/web/assets/{pause-DVIT6IIr.js → pause-_LvCZkxM.js} +1 -1
- package/dist/web/assets/pencil-DB6ICr_h.js +6 -0
- package/dist/web/assets/{play-DsdF5dji.js → play-BRXP1rHJ.js} +1 -1
- package/dist/web/assets/plus-BqvjEpLw.js +6 -0
- package/dist/web/assets/session-events-AGMXvPey.js +22 -0
- package/dist/web/assets/settings-LfQbDvBA.js +6 -0
- package/dist/web/assets/teamService-B5FnUcet.js +1 -0
- package/dist/web/assets/terminal-By4sO9Gw.js +6 -0
- package/dist/web/assets/vendor-radix-D6QrtXqd.js +45 -0
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/chunk-0ktte40x.js +0 -185
- package/dist/chunk-1acb8fwq.js +0 -120
- package/dist/chunk-3pwqqk7w.js +0 -1
- package/dist/chunk-3q7g9206.js +0 -1
- package/dist/chunk-562w5zc6.js +0 -2
- package/dist/chunk-5x56nka1.js +0 -1
- package/dist/chunk-7hajkvde.js +0 -1
- package/dist/chunk-9wptwfmg.js +0 -1
- package/dist/chunk-ap01rwg0.js +0 -169
- package/dist/chunk-cm8fy1jn.js +0 -1
- package/dist/chunk-dp4r5bay.js +0 -1
- package/dist/chunk-dtxza4zh.js +0 -1
- package/dist/chunk-hd7bxzvy.js +0 -1
- package/dist/chunk-hks48s9k.js +0 -1
- package/dist/chunk-hmncnf7p.js +0 -1
- package/dist/chunk-j6fj679p.js +0 -10
- package/dist/chunk-m8czdpyg.js +0 -1
- package/dist/chunk-p5awnndq.js +0 -8
- package/dist/chunk-s7peh6kf.js +0 -2
- package/dist/chunk-ws6gtw33.js +0 -1
- package/dist/chunk-wtmhqy5s.js +0 -1
- package/dist/chunk-xnstybjm.js +0 -2
- package/dist/chunk-xpdtg9h9.js +0 -23
- package/dist/chunk-z2jwm4s8.js +0 -1
- package/dist/web/assets/ChatView-DCHnicTP.js +0 -58
- package/dist/web/assets/FilePreview-C_3KHzzj.js +0 -65
- package/dist/web/assets/KanbanBoard-D_NTkUnD.js +0 -16
- package/dist/web/assets/TaskSwitcher-eCdxu5Eo.js +0 -26
- package/dist/web/assets/TerminalPanel-9q9Trmv9.js +0 -6
- package/dist/web/assets/index-DGf6Z2kM.css +0 -1
- package/dist/web/assets/index-DaiT-mmo.js +0 -275
- package/dist/web/assets/session-events-CWzF04l4.js +0 -22
- package/dist/web/assets/teamService-BliaDj1Z.js +0 -1
- package/dist/web/assets/vendor-radix-Bc1_Q9tz.js +0 -45
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-DikU3QeQ.js";import{c as pe,l as mt,u as se,a as d,$ as He,a0 as Qe,a1 as Ve,v as Xe,j as w,L as te,b as K,d as $,y as Se,p as kt,al as bt,C as vt,X as gt,A as Je,E as jt,R as yt,T as wt,m as Ye,aa as Re,Q as We,K as Nt,a6 as Ze,a8 as et,am as St,a9 as tt,s as be,an as st,U as Tt,ao as Ct,ac as Et,V as At,z as Dt}from"./index-_xnlrekR.js";import{i as at,r as G,m as Pt}from"./session-events-AGMXvPey.js";import{A as nt}from"./archive-BiDGrqry.js";import{D as rt}from"./download-D_-kbJXR.js";import{P as It}from"./pencil-DB6ICr_h.js";import{S as it}from"./settings-LfQbDvBA.js";import{P as Oe}from"./plus-BqvjEpLw.js";import{T as ct}from"./terminal-By4sO9Gw.js";import{C as Rt}from"./chevron-right-Bg-10yuN.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 Ot=pe("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
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 _t=pe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
|
|
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 Mt=pe("GitFork",[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]]);/**
|
|
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 Bt=pe("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
|
|
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 ot=pe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
27
|
+
* @license lucide-react v0.300.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Lt=pe("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);async function lt(t,a=!1){const r=await mt.exportSessionMarkdown(t,a),c=new Blob([r.markdown],{type:"text/markdown;charset=utf-8"}),o=URL.createObjectURL(c),l=document.createElement("a");l.href=o,l.download=r.filename,l.hidden=!0,document.body.appendChild(l);try{l.click()}finally{l.remove(),await new Promise(C=>{window.setTimeout(()=>{URL.revokeObjectURL(o),C()},0)})}return r}function Ut(){const t=se(),a=d(h=>h.archivedSessions),r=d(h=>h.archivedCatalogLoadState),c=d(h=>h.archivedCatalogError),o=d(h=>h.loadArchivedSessions),l=d(h=>h.unarchiveSession),C=d(h=>h.setError),b=d(h=>at(h.historySurfaceSelection)),[v,m]=D.useState(!1),[g,P]=D.useState(null),[R,j]=D.useState(null),T=h=>{h&&G(d.getState())||(m(h),h&&o())},B=()=>{G(d.getState())||o()};return b?null:e.jsxs(He,{open:v,onOpenChange:T,children:[e.jsx(Qe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"flex h-8 w-full items-center justify-between rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]","aria-label":t("archive.open"),children:[e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(nt,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),t("archive.title")]}),a.length>0&&e.jsx("span",{className:"rounded-sm bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 text-[9px] text-[hsl(var(--deck-ink-faint))]",children:a.length})]})}),e.jsxs(Ve,{role:"dialog","aria-label":t("archive.title"),side:"right",align:"end",sideOffset:8,className:"w-[340px] overflow-hidden p-0",children:[e.jsxs("div",{className:"flex h-10 items-center justify-between border-b border-[hsl(var(--deck-hairline))] px-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono text-[11px] font-medium uppercase tracking-[0.08em] text-[hsl(var(--deck-ink))]",children:t("archive.title")}),e.jsx("div",{className:"text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:t("archive.subtitle")})]}),e.jsx("button",{type:"button",onClick:B,"aria-label":t("archive.refresh"),className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Xe,{className:w("h-3 w-3",(r==="loading"||r==="hydrating")&&"animate-spin")})})]}),c?e.jsxs("div",{className:"px-3 py-4 text-[11px] text-red-600 dark:text-red-400",children:[e.jsx("div",{children:c}),e.jsx("button",{type:"button",onClick:B,className:"mt-2 font-mono text-[10px] text-[hsl(var(--deck-accent))] focus-visible:outline-none focus-visible:underline",children:t("archive.retry")})]}):a.length===0&&(r==="loading"||r==="hydrating")?e.jsxs("div",{className:"flex h-24 items-center justify-center gap-2 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(te,{className:"h-3 w-3 animate-spin"}),t("archive.loading")]}):a.length===0?e.jsx("div",{className:"flex h-24 items-center justify-center px-6 text-center text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:t("archive.empty")}):e.jsx(ze,{className:"max-h-[340px]",children:e.jsx("div",{className:"divide-y divide-[hsl(var(--deck-hairline))]",children:a.map(h=>{var A;const E=K(h),M=$(E),_=g===M,Y=h.projectPath.split("/").filter(Boolean).at(-1)??h.projectPath;return e.jsxs("div",{className:"flex min-h-[58px] items-center gap-2 px-3 py-2",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"truncate font-mono text-[11.5px] text-[hsl(var(--deck-ink))]",children:Se(h,t)}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 truncate font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{className:"truncate",children:Y}),h.archivedAt&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":!0,children:"·"}),e.jsx("span",{children:new Date(h.archivedAt).toLocaleString()})]})]}),h.archivedBySessionId!==h.sessionId&&e.jsx("div",{className:"mt-0.5 truncate text-[9px] text-[hsl(var(--deck-accent))]",children:t("archive.inherited",{id:((A=h.archivedBySessionId)==null?void 0:A.slice(0,8))??""})})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[e.jsx("button",{type:"button",disabled:R!==null,onClick:async()=>{if(!G(d.getState())){j(M);try{await lt(E)}catch(U){C(U instanceof Error?U.message:"Session export failed")}finally{j(null)}}},"aria-label":t("session.action.export",{title:Se(h,t)}),title:t("session.action.exportShort"),className:"flex h-7 w-7 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-35",children:R===M?e.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(rt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",disabled:_||h.archivedBySessionId!==h.sessionId,onClick:async()=>{if(!G(d.getState())){P(M);try{await l(E)}finally{P(null)}}},"aria-label":t("archive.restore",{title:Se(h,t)}),title:h.archivedBySessionId!==h.sessionId?t("archive.restoreAncestor"):t("archive.restoreShort"),className:"flex h-7 w-7 items-center justify-center rounded 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-not-allowed disabled:opacity-35",children:_?e.jsx(te,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(Ot,{className:"h-3.5 w-3.5"})})]})]},M)})})})]})]})}const _e={en:"sidebar.language.en",zh:"sidebar.language.zh"};function dt({className:t,variant:a="pill"}){const{locale:r,setLocale:c}=kt(),o=se();if(a==="compact"){const l=r==="en"?"zh":"en";return e.jsx("button",{type:"button",onClick:()=>c(l),"aria-label":o("sidebar.language.aria"),title:o("sidebar.language.label"),className:w("flex justify-center items-center w-10 h-10 font-mono font-medium rounded-md transition-colors text-[11px] text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",t),children:o(_e[r])})}return e.jsx("div",{role:"group","aria-label":o("sidebar.language.aria"),className:w("inline-flex h-8 items-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-[2px] font-mono text-[11px]",t),children:bt.map(l=>{const C=l===r;return e.jsx("button",{type:"button",onClick:()=>c(l),"aria-pressed":C,className:w("flex justify-center items-center px-2 h-full transition-colors min-w-[28px] rounded-[4px]",C?"bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))]":"text-[hsl(var(--deck-ink-muted))] hover:text-[hsl(var(--deck-ink))]"),children:o(_e[l])},l)})})}function Ft({summary:t,isActive:a,onSelect:r}){const c=se(),o=t.title??t.locator.sessionId,l=c(t.capabilities.connection==="offline"?"history.connection.offline":t.capabilities.connection==="local"?"history.connection.local":"history.connection.online");return e.jsxs("div",{className:w("flex relative items-center w-full transition-colors min-h-[54px]",a?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[a&&e.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),e.jsxs("button",{type:"button","aria-label":c("session.action.select",{title:o}),"aria-current":a?"true":void 0,onClick:r,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx("span",{className:w("h-1.5 w-1.5 shrink-0 rounded-full",t.capabilities.connection==="offline"?"bg-amber-500":"bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)]"),title:l}),e.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[e.jsxs("span",{className:w("flex gap-2 items-center text-left truncate text-[12px]",a?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[e.jsx("span",{className:"truncate",children:o}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded border border-[hsl(var(--deck-border))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-ink-faint))]",children:c("history.badge.remote")}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded border border-[hsl(var(--deck-border))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-ink-faint))]",children:l}),e.jsx("span",{className:"inline-flex shrink-0 items-center rounded bg-[hsl(var(--deck-accent-soft))] px-1.5 py-0.5 text-[8.5px] text-[hsl(var(--deck-accent))]",children:c("history.badge.historyOnly")})]}),e.jsx("span",{className:"mt-0.5 block truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:t.displayCwd})]})]})]})}const qt={running:"bg-blue-500 dark:bg-blue-400 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse",queued:"bg-amber-400 dark:bg-amber-300",interrupted:"bg-orange-500 dark:bg-orange-400",failed:"bg-red-500 dark:bg-red-400",cancelled:"bg-zinc-400 dark:bg-zinc-500",completed:"bg-[hsl(var(--deck-accent))]"};function Gt({session:t,isActive:a,isForking:r,isUnread:c,anyForking:o,isEditing:l,editingTitle:C,title:b,context:v,isCancelling:m,isRetrying:g,isExporting:P,onSelect:R,onCancelTask:j,onRetryTask:T,onFork:B,onArchive:h,onExport:E,onStartRename:M,onDelete:_,onEditingTitleChange:Y,onSaveRename:A,onCancelRename:U}){const y=se(),[F,z]=D.useState(!1),ae=D.useRef(null),q=D.useRef(null);return l?e.jsxs("div",{className:"flex h-9 w-full items-center gap-2 bg-[hsl(var(--deck-surface))] px-3",children:[e.jsx("input",{type:"text",value:C,onChange:S=>Y(S.target.value),onKeyDown:S=>{S.key==="Enter"&&A(),S.key==="Escape"&&U()},autoFocus:!0,className:"flex-1 rounded bg-[hsl(var(--deck-canvas))] px-2 py-1 font-mono text-[13px] text-[hsl(var(--deck-ink))] outline-none focus:ring-1 focus:ring-[hsl(var(--deck-accent))]"}),e.jsx("button",{"aria-label":y("session.action.save",{title:b}),onClick:A,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-accent))] hover:bg-[hsl(var(--deck-canvas))]",children:e.jsx(vt,{className:"w-3 h-3"})}),e.jsx("button",{"aria-label":y("session.action.cancel",{title:b}),onClick:U,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] hover:bg-[hsl(var(--deck-canvas))]",children:e.jsx(gt,{className:"w-3 h-3"})})]}):e.jsxs("div",{className:w("flex relative items-center w-full transition-colors group min-h-[54px]",a?"bg-[hsl(var(--deck-surface))]":"hover:bg-[hsl(var(--deck-surface))]/60"),children:[a&&e.jsx("span",{className:"absolute left-0 top-1/2 h-6 w-[2px] -translate-y-1/2 rounded-r bg-[hsl(var(--deck-accent))]"}),e.jsxs("button",{type:"button","aria-label":y("session.action.select",{title:b}),"aria-current":a?"true":void 0,"aria-busy":r?"true":void 0,onClick:R,className:"flex min-h-[54px] min-w-0 flex-1 cursor-pointer items-center gap-2 py-1.5 pl-4 pr-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx("span",{className:w("h-1.5 w-1.5 shrink-0 rounded-full",t.pendingInteraction?"animate-pulse bg-amber-500 shadow-[0_0_5px_rgba(245,158,11,0.75)]":qt[t.taskStatus]),title:t.pendingInteraction?y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"):t.taskStatus}),e.jsxs("span",{className:"flex-1 min-w-0 font-mono",children:[e.jsxs("span",{className:w("flex gap-2 items-center text-left truncate text-[12px]",a?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:[e.jsx("span",{className:"truncate",children:b}),c&&e.jsx("span",{title:y("taskSwitcher.new"),className:"h-1.5 w-1.5 shrink-0 rounded-full bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.75)]"}),t.pendingInteraction&&e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-amber-100 px-1.5 py-0.5 text-[8.5px] text-amber-800 dark:bg-amber-950/60 dark:text-amber-300",title:y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission"),children:[e.jsx(Je,{className:"h-2.5 w-2.5"}),y(t.pendingInteraction.type==="question"?"interaction.badge.question":t.pendingInteraction.type==="elicitation"?"interaction.badge.elicitation":"interaction.badge.permission")]}),t.relationType==="fork"&&t.parentId&&e.jsxs("span",{title:`${y("session.forkedFrom")} ${t.parentId.slice(0,6)}`,"aria-label":`${y("session.forkedFrom")} ${t.parentId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:[y("session.forkedFrom")," ",t.parentId.slice(0,6)]}),t.taskRetriedFrom&&e.jsx("span",{title:`${y("session.retriedFrom")} ${t.taskRetriedFrom.sessionId.slice(0,6)}`,className:"shrink-0 text-[9px] text-[hsl(var(--deck-accent))]",children:y("session.retryShort")})]}),e.jsxs("span",{className:"mt-0.5 flex min-w-0 items-center gap-1.5 truncate text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{className:"truncate",children:v.project}),e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"truncate",children:v.environment}),v.queue&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"text-amber-700 truncate dark:text-amber-400",children:v.queue})]}),v.diff&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"opacity-50",children:"·"}),e.jsx("span",{className:"truncate text-[hsl(var(--deck-accent))]",children:v.diff})]})]}),v.reason&&e.jsx("span",{title:v.reason,className:"mt-0.5 block truncate text-[9.5px] text-red-600 dark:text-red-400",children:v.reason})]}),r&&e.jsx(te,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"})]}),e.jsxs("div",{className:w("flex items-center gap-0.5 pr-2 transition-opacity group-focus-within:opacity-100",t.taskStatus==="running"||t.taskStatus==="queued"||t.taskRetryAvailable&&(t.taskStatus==="failed"||t.taskStatus==="interrupted"||t.taskStatus==="cancelled")?"opacity-100":"opacity-50 group-hover:opacity-100"),children:[(t.taskStatus==="running"||t.taskStatus==="queued")&&e.jsx("button",{type:"button","aria-label":y(m?"session.action.stopping":"session.action.stop",{title:b}),disabled:m,onClick:S=>{S.stopPropagation(),j()},className:"flex h-6 w-6 items-center justify-center rounded 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:m?e.jsx(te,{className:"h-3 w-3 animate-spin"}):e.jsx(jt,{className:"h-3 w-3"})}),t.taskRetryAvailable&&(t.taskStatus==="failed"||t.taskStatus==="interrupted"||t.taskStatus==="cancelled")&&e.jsx("button",{ref:ae,type:"button","aria-label":y(g?"session.action.retrying":"session.action.retry",{title:b}),disabled:g,onClick:S=>{S.stopPropagation(),T()},className:"flex h-6 w-6 items-center justify-center rounded 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:g?e.jsx(te,{className:"h-3 w-3 animate-spin"}):e.jsx(yt,{className:"h-3 w-3"})}),e.jsxs(He,{open:F,onOpenChange:z,children:[e.jsx(Qe,{asChild:!0,children:e.jsx("button",{type:"button","aria-label":y("session.action.more",{title:b}),"aria-expanded":F,className:"flex h-6 w-6 items-center justify-center rounded text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-canvas))] hover:text-[hsl(var(--deck-ink))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Lt,{className:"h-3.5 w-3.5"})})}),e.jsxs(Ve,{ref:q,role:"menu","aria-label":y("session.action.more",{title:b}),side:"right",align:"start",sideOffset:6,className:"w-40 p-1",onOpenAutoFocus:S=>{var H,ie;S.preventDefault(),(ie=(H=q.current)==null?void 0:H.querySelector('[role="menuitem"]:not([disabled])'))==null||ie.focus()},onKeyDown:S=>{S.key==="Escape"&&(S.preventDefault(),S.stopPropagation(),z(!1),window.setTimeout(()=>{var H;return(H=ae.current)==null?void 0:H.focus()},0))},children:[e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.fork",{title:b}),disabled:o,onClick:S=>{S.stopPropagation(),B(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-45",children:[e.jsx(Mt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.forkShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.rename",{title:b}),onClick:S=>{M(S),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none",children:[e.jsx(It,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.renameShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.archive",{title:b}),disabled:t.taskStatus==="running"||t.taskStatus==="queued",onClick:S=>{S.stopPropagation(),h(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-35",children:[e.jsx(nt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.archiveShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.export",{title:b}),disabled:P,onClick:S=>{S.stopPropagation(),E(),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))] focus-visible:bg-[hsl(var(--deck-surface))] focus-visible:text-[hsl(var(--deck-ink))] focus-visible:outline-none disabled:cursor-wait disabled:opacity-45",children:[P?e.jsx(te,{className:"h-3 w-3 animate-spin","aria-hidden":!0}):e.jsx(rt,{className:"h-3 w-3","aria-hidden":!0}),y(P?"session.action.exportingShort":"session.action.exportShort")]}),e.jsxs("button",{type:"button",role:"menuitem","aria-label":y("session.action.delete",{title:b}),onClick:S=>{_(S),z(!1)},className:"flex w-full items-center gap-2 rounded px-2 py-1.5 text-left font-mono text-[11px] text-red-600 transition-colors hover:bg-red-500/10 focus-visible:bg-red-500/10 focus-visible:outline-none dark:text-red-400",children:[e.jsx(wt,{className:"h-3 w-3","aria-hidden":!0}),y("session.action.deleteShort")]})]})]})]})]})}function Kt({onExpand:t,onNewChat:a,onOpenBoard:r,onOpenTaskSwitcher:c,onToggleTerminal:o,onToggleSettings:l,isTerminalOpen:C,taskEventsConnected:b,unreadCount:v,boardActive:m,terminalDisabled:g=!1,taskSwitcherDisabled:P=!1,className:R}){const j=se(),T=[{icon:it,action:l,labelKey:"sidebar.section.settings"}];return e.jsxs("div",{className:w("flex flex-col gap-2 items-center py-5 h-screen border-r w-[64px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",R),children:[e.jsx("button",{onClick:t,className:"rounded-md p-1 transition-colors hover:bg-[hsl(var(--deck-surface))]","aria-label":j("sidebar.action.expand"),children:e.jsx(Ye,{size:28})}),e.jsx("button",{onClick:a,"aria-label":j("sidebar.action.newTaskShort"),title:j("sidebar.action.newTaskShort"),className:"mt-6 flex h-10 w-10 items-center justify-center rounded-md bg-[hsl(var(--deck-ink))] text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/85",children:e.jsx(Oe,{className:"h-4 w-4 stroke-[2.5]"})}),e.jsx("button",{type:"button",onClick:r,"aria-label":j("sidebar.action.taskBoard"),"aria-current":m?"page":void 0,title:j("sidebar.action.taskBoard"),className:w("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",m?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:e.jsx(ot,{className:"h-4 w-4"})}),e.jsx("button",{onClick:o,disabled:g,"aria-label":j("sidebar.action.terminalToggle"),title:j("sidebar.action.terminal"),className:w("flex h-10 w-10 items-center justify-center rounded-md border transition-colors",g&&"cursor-not-allowed opacity-35",C?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-transparent text-[hsl(var(--deck-ink-muted))] hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]"),children:e.jsx(ct,{className:"w-4 h-4"})}),e.jsxs("button",{onClick:c,disabled:P,"aria-label":j("sidebar.action.searchTasks"),title:`${j("sidebar.action.searchTasks")} (${Re("searchTasks")})`,className:w("relative flex h-10 w-10 items-center justify-center rounded-md border border-transparent text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",P&&"cursor-not-allowed opacity-35"),children:[e.jsx(We,{className:"h-4 w-4"}),v>0&&e.jsx("span",{"aria-label":j("sidebar.unreadTasks",{count:v}),className:"absolute right-0.5 top-0.5 flex min-h-4 min-w-4 items-center justify-center rounded-full bg-[hsl(var(--deck-accent))] px-1 font-mono text-[8px] font-semibold text-white",children:v>99?"99+":v})]}),e.jsx("div",{className:"flex-1"}),e.jsx("div",{className:"my-2 h-px w-6 bg-[hsl(var(--deck-hairline))]"}),T.map(({icon:B,action:h,labelKey:E})=>e.jsx("button",{"data-settings-trigger":!0,onClick:h,"aria-label":j(E),title:j(E),className:"flex h-10 w-10 items-center justify-center rounded-md text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:e.jsx(B,{className:"w-4 h-4"})},E)),e.jsx(dt,{variant:"compact"}),e.jsx("div",{className:"mt-1",children:e.jsx("div",{role:"status","aria-label":j(b?"sidebar.status.feedLive":"sidebar.status.feedOffline"),className:w("h-2 w-2 rounded-full",b?"bg-[hsl(var(--deck-accent))] shadow-[0_0_6px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60"),title:j(b?"sidebar.status.feedLive":"sidebar.status.feedOffline")})})]})}const ht="blade.sidebar.project-order.v1";function ve(t){const a=new Set,r=[];for(const c of t)typeof c!="string"||!c||a.has(c)||(a.add(c),r.push(c));return r}function $t(){if(typeof window>"u")return[];try{const t=JSON.parse(window.localStorage.getItem(ht)??"[]");return Array.isArray(t)?ve(t):[]}catch{return[]}}function Me(t){if(!(typeof window>"u"))try{window.localStorage.setItem(ht,JSON.stringify(ve(t)))}catch{}}function Be(t,a){const r=new Map(ve(a).map((o,l)=>[o,l])),c=r.size;return t.map((o,l)=>({project:o,rank:r.get(o.path)??c+l})).sort((o,l)=>o.rank-l.rank).map(({project:o})=>o)}function Le(t,a,r){const c=ve(t),o=c.indexOf(a),l=c.indexOf(r);if(o<0||l<0||o===l)return c;const[C]=c.splice(o,1);return c.splice(l,0,C),c}function Ue(t,a,r){const c=ve(t),o=c.indexOf(a),l=o+r;return o<0||l<0||l>=c.length||([c[o],c[l]]=[c[l],c[o]]),c}function Fe({name:t,path:a,count:r,countIsPartial:c=!1,isActive:o,hasRunning:l,unreadCount:C,collapsed:b,onToggle:v,onSelect:m,onCreateTask:g,reorderPosition:P,reorderCount:R,isDragging:j=!1,onDragStart:T,onDragEnd:B,onReorderKeyDown:h}){const E=se();return e.jsxs("div",{className:w("group/proj flex w-full items-center gap-2 px-5 pb-1.5 pt-3 text-left transition-colors","hover:bg-[hsl(var(--deck-surface))]/40"),children:[e.jsx("button",{type:"button",draggable:!0,"data-project-drag-handle":a,onDragStart:T,onDragEnd:B,onKeyDown:h,"aria-label":E("sidebar.project.reorder",{name:t,position:P,count:R}),title:E("sidebar.project.reorderHint"),className:w("-ml-2 flex h-6 w-4 shrink-0 cursor-grab items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-45 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-ink-muted))] hover:opacity-100 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] active:cursor-grabbing group-hover/proj:opacity-100",j&&"cursor-grabbing opacity-100 text-[hsl(var(--deck-accent))]"),children:e.jsx(Bt,{className:"h-3.5 w-3.5"})}),e.jsx("button",{type:"button",onClick:v,"aria-expanded":!b,"aria-label":E(b?"sidebar.project.expand":"sidebar.project.collapse",{name:t}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:e.jsx(Rt,{className:w("h-3 w-3 text-[hsl(var(--deck-ink-faint))] transition-transform duration-150",!b&&"rotate-90")})}),e.jsxs("button",{type:"button",onClick:m??v,title:a,"aria-current":o?"true":void 0,className:"flex min-h-6 min-w-0 flex-1 items-center gap-2 rounded-sm text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:[e.jsx(Nt,{className:w("h-3.5 w-3.5 shrink-0",o?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]")}),e.jsx("span",{className:w("flex-1 truncate font-mono text-[11.5px] font-medium tracking-[-0.01em]",o?"text-[hsl(var(--deck-ink))]":"text-[hsl(var(--deck-ink-muted))]"),children:t}),l&&e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-blue-500 shadow-[0_0_5px_rgba(59,130,246,0.7)] animate-pulse dark:bg-blue-400","aria-hidden":!0}),C>0&&e.jsx("span",{"aria-label":E("sidebar.unreadTasks",{count:C}),className:"shrink-0 rounded-full bg-[hsl(var(--deck-accent))] px-1.5 py-0.5 font-mono text-[8px] font-semibold text-white",children:C}),e.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[hsl(var(--deck-ink-faint))]",children:[r.toString().padStart(2,"0"),c?"+":""]})]}),g&&e.jsx("button",{type:"button",onClick:g,title:E("sidebar.project.newTask",{name:t}),"aria-label":E("sidebar.project.newTask",{name:t}),className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-sm text-[hsl(var(--deck-ink-faint))] opacity-0 transition-[opacity,color,background-color] hover:bg-[hsl(var(--deck-surface-2))] hover:text-[hsl(var(--deck-accent))] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] group-hover/proj:opacity-100",children:e.jsx(Oe,{className:"h-3.5 w-3.5"})})]})}const zt=["running","queued","interrupted","failed","cancelled","completed"],Ht={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"},ue=t=>t.length>1?t.replace(/\/+$/,""):t;function ut(t){const a=new Map;for(const r of t){if(!r)continue;const c=$(K(r));a.has(c)||a.set(c,r)}return Array.from(a.values())}function Qt(t){const a=ut(t),r=[];for(const c of zt){const o=a.filter(l=>l.taskStatus===c).sort(Ze);o.length>0&&r.push({code:Ht[c],status:c,sessions:o})}return r}function Vt(t,a,r=[]){const c=ut(t),o=new Map,l=r.map(ue),C=new Map(l.map((m,g)=>[m,g]));for(const m of l)o.set(m,[]);for(const m of c){const g=et(m,a),P=o.get(g);P?P.push(m):o.set(g,[m])}const b=a?ue(a):null,v=Array.from(o.entries()).map(([m,g])=>{const P=[...g].sort(Ze),R=g.reduce((j,T)=>Math.max(j,St(T)),0);return{path:m,name:tt(m),isActive:b?ue(m)===b:!1,isBound:C.has(ue(m)),hasRunning:g.some(j=>j.taskStatus==="running"),lastActivity:R,sessions:P}});return v.sort((m,g)=>m.isBound!==g.isBound?m.isBound?-1:1:m.isBound&&g.isBound?(C.get(ue(m.path))??Number.MAX_SAFE_INTEGER)-(C.get(ue(g.path))??Number.MAX_SAFE_INTEGER):g.lastActivity-m.lastActivity),v}const Ne=12,Xt=["running","queued","interrupted","failed","cancelled","completed"],qe={RUNNING:"sidebar.group.running",QUEUED:"sidebar.group.queued",INTERRUPTED:"sidebar.group.interrupted",FAILED:"sidebar.group.failed",CANCELLED:"sidebar.group.cancelled",DONE:"sidebar.group.done"},Ge={RUNNING:"text-blue-700 dark:text-blue-400",QUEUED:"text-amber-700 dark:text-amber-400",INTERRUPTED:"text-orange-700 dark:text-orange-400",FAILED:"text-red-700 dark:text-red-400",CANCELLED:"text-[hsl(var(--deck-ink-faint))]",DONE:"text-[hsl(var(--deck-accent))]"},Jt={running:"RUNNING",queued:"QUEUED",interrupted:"INTERRUPTED",failed:"FAILED",cancelled:"CANCELLED",completed:"DONE"};function xe(t){return t.length>1?t.replace(/\/+$/,""):t}function Ke(t){const a=t.lastMessageTime||t.firstMessageTime;if(!a)return 0;const r=new Date(a).getTime();return Number.isNaN(r)?0:r}function Yt(t,a){if(t.locator.workspace.kind!=="local")throw new Error("Expected a local Session surface summary");return{...a??{sessionId:t.locator.sessionId,projectPath:t.locator.workspace.projectPath,rootId:t.rootId,taskStatus:t.taskStatus,messageCount:t.messageCount,firstMessageTime:t.firstMessageTime,lastMessageTime:t.lastMessageTime,hasErrors:t.hasErrors},sessionId:t.locator.sessionId,projectPath:t.locator.workspace.projectPath,title:t.title,rootId:t.rootId,parentId:t.parentId,relationType:t.relationType,taskStatus:t.taskStatus,messageCount:t.messageCount,firstMessageTime:t.firstMessageTime,lastMessageTime:t.lastMessageTime,hasErrors:t.hasErrors,archivedAt:t.archivedAt,selectedModelId:t.selectedModelId}}function $e(t){return t.kind==="local"?t.session.taskStatus:t.summary.taskStatus}function Wt(t,a){return a.activityTime-t.activityTime}function Ie(t){return[...t].sort(Wt)}function Zt({view:t,sessions:a,surfaceCatalog:r,activeProjectPath:c,boundProjects:o,currentSessionRef:l,historySurfaceSelection:C,unreadTaskKeys:b,catalogLoadState:v,onSelectProject:m,onCreateTask:g,onRetryCatalog:P,renderLocalRow:R,renderRemoteRow:j}){const T=se(),[B,h]=D.useState({}),[E,M]=D.useState({}),[_,Y]=D.useState($t),[A,U]=D.useState(null),[y,F]=D.useState(null),[z,ae]=D.useState(""),q=v==="ready"||r.length>0,S=v==="loading"||v==="hydrating",H=S||v==="error",ie=q?r.length:a.length,Te=D.useMemo(()=>t==="status"?Qt(a):[],[a,t]),ne=D.useMemo(()=>t==="project"?Vt(a,c,o.map(n=>n.path)):[],[c,o,a,t]),Q=D.useMemo(()=>Be(ne,_),[ne,_]),V=D.useMemo(()=>{if(!q)return[];const n=new Map(a.map(x=>[$(K(x)),x])),k=[];for(const x of r){if(x.locator.workspace.kind==="local"){const I={sessionId:x.locator.sessionId,projectPath:x.locator.workspace.projectPath},i=n.get($(I)),p=Yt(x,i);k.push({kind:"local",path:i?et(p,c):x.locator.workspace.projectPath,activityTime:Ke(x),session:p});continue}k.push({kind:"remote",activityTime:Ke(x),summary:x})}return k},[c,a,r,q]),Ce=D.useMemo(()=>!q||t!=="status"?[]:Xt.flatMap(n=>{const k=Ie(V.filter(x=>$e(x)===n));return k.length===0?[]:[{code:Jt[n],entries:k}]}),[V,q,t]),X=D.useMemo(()=>{if(!q||t!=="project")return[];const n=o.map(p=>xe(p.path)),k=new Map(n.map((p,u)=>[p,u])),x=new Map;for(const p of n)x.set(p,[]);for(const p of V){if(p.kind!=="local")continue;const u=x.get(p.path);u?u.push(p):x.set(p.path,[p])}const I=c?xe(c):null,i=Array.from(x.entries()).map(([p,u])=>({path:p,name:tt(p),isActive:I?xe(p)===I:!1,isBound:k.has(xe(p)),hasRunning:u.some(f=>$e(f)==="running"),lastActivity:u.reduce((f,L)=>Math.max(f,L.activityTime),0),entries:Ie(u)}));return i.sort((p,u)=>p.isBound!==u.isBound?p.isBound?-1:1:p.isBound&&u.isBound?(k.get(xe(p.path))??Number.MAX_SAFE_INTEGER)-(k.get(xe(u.path))??Number.MAX_SAFE_INTEGER):u.lastActivity-p.lastActivity),Be(i,_)},[c,o,V,_,q,t]),ce=D.useMemo(()=>t==="project"?Ie(V.filter(n=>n.kind==="remote")):[],[V,t]),ge=n=>n.kind==="local"&&!!n.session.pendingInteraction,je=n=>n.kind==="local"&&b.includes($(K(n.session))),fe=n=>n.kind==="local"?!!(l&&be(K(n.session),l)):!!(C&&st(n.summary.locator,C.locator)),ye=(n,k)=>{const x=E[n]??!1,I=x?k:k.filter((u,f)=>{if(f<Ne)return!0;const L=K(u);return!!u.pendingInteraction||b.includes($(L))||!!(l&&be(L,l))}),i=k.length-I.length,p=x?k.length>Ne:i>0;return e.jsxs(e.Fragment,{children:[I.map(R),p&&e.jsx("button",{type:"button",onClick:()=>M(u=>({...u,[n]:!x})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:x?T("sidebar.group.showLess"):T("sidebar.group.showMore",{count:i})})]})},W=(n,k)=>{const x=E[n]??!1,I=x?k:k.filter((u,f)=>f<Ne?!0:ge(u)||je(u)||fe(u)),i=k.length-I.length,p=x?k.length>Ne:i>0;return e.jsxs(e.Fragment,{children:[I.map(u=>u.kind==="local"?R(u.session):j(u.summary)),p&&e.jsx("button",{type:"button",onClick:()=>M(u=>({...u,[n]:!x})),className:"mx-4 my-1 rounded-md px-3 py-1.5 text-left font-mono text-[10.5px] text-[hsl(var(--deck-ink-faint))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink-muted))]",children:x?T("sidebar.group.showLess"):T("sidebar.group.showMore",{count:i})})]})},oe=S?e.jsxs("div",{role:"status","aria-live":"polite",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-[hsl(var(--deck-surface))]/55 px-3 py-2 font-mono text-[9.5px] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx(te,{className:"h-3 w-3 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}),e.jsx("span",{className:"flex-1 min-w-0",children:T("sidebar.catalog.syncing")}),e.jsx("span",{className:"tabular-nums shrink-0",children:T("sidebar.catalog.loaded",{count:ie})})]}):v==="error"?e.jsxs("div",{role:"alert",className:"mx-4 mt-2 flex items-center gap-2 rounded-md bg-amber-50/80 px-3 py-2 font-mono text-[9.5px] text-amber-800 dark:bg-amber-950/35 dark:text-amber-300",children:[e.jsx(Je,{className:"w-3 h-3 shrink-0"}),e.jsx("span",{className:"flex-1 min-w-0",children:T("sidebar.catalog.incomplete")}),e.jsxs("button",{type:"button",onClick:P,className:"inline-flex min-h-6 shrink-0 items-center gap-1 rounded px-1.5 font-medium hover:bg-amber-100 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-amber-500 dark:hover:bg-amber-900/50",children:[e.jsx(Xe,{className:"h-2.5 w-2.5"}),T("sidebar.catalog.retry")]})]}):null;if(q){if(t==="status")return e.jsxs("div",{className:"flex flex-col",children:[oe,Ce.map((i,p)=>e.jsxs("div",{children:[e.jsxs("div",{className:w("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",Ge[i.code]??"text-[hsl(var(--deck-ink-faint))]",p===0&&"pt-2"),children:[e.jsx("span",{children:T(qe[i.code])}),e.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[i.entries.length.toString().padStart(2,"0"),H?"+":""]})]}),W(`status:${i.code}`,i.entries)]},i.code))]});const n=X.some(i=>i.isActive||i.entries.some(fe)),k=i=>i.entries.some(fe),x=(i,p)=>{if(i.join("\0")===X.map(f=>f.path).join("\0"))return;Y(i),Me(i);const u=X.find(f=>f.path===p);ae(T("sidebar.project.reordered",{name:(u==null?void 0:u.name)??p,position:i.indexOf(p)+1}))},I=(i,p)=>{const u=i.entries.filter(je).length,f=k(i),L=u>0,re=i.entries.some(ge),Z=B[i.path]??(n&&!i.isActive&&!(f||i.hasRunning||L||re));return e.jsxs("div",{"data-project-group":i.path,onDragEnter:O=>{!A||A===i.path||(O.preventDefault(),F(i.path))},onDragOver:O=>{!A||A===i.path||(O.preventDefault(),O.dataTransfer.dropEffect="move")},onDrop:O=>{O.preventDefault();const ee=A||O.dataTransfer.getData("text/plain");ee&&ee!==i.path&&x(Le(X.map(ke=>ke.path),ee,i.path),ee),U(null),F(null)},className:w("relative transition-colors",y===i.path&&A!==i.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[e.jsx(Fe,{name:i.name,path:i.path,count:i.entries.length,countIsPartial:H,isActive:i.isActive,hasRunning:i.hasRunning,unreadCount:u,collapsed:Z,onSelect:()=>m(i.path),onCreateTask:()=>g(i.path),reorderPosition:p+1,reorderCount:X.length,isDragging:A===i.path,onDragStart:O=>{O.dataTransfer.effectAllowed="move",O.dataTransfer.setData("text/plain",i.path),U(i.path)},onDragEnd:()=>{U(null),F(null)},onReorderKeyDown:O=>{if(O.key!=="ArrowUp"&&O.key!=="ArrowDown")return;O.preventDefault();const ee=Ue(X.map(ke=>ke.path),i.path,O.key==="ArrowUp"?-1:1);x(ee,i.path)},onToggle:()=>h(O=>({...O,[i.path]:!Z}))}),!Z&&W(`project:${i.path}`,i.entries)]},i.path)};return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"sr-only","aria-live":"polite",children:z}),oe,ce.length>0&&e.jsxs("section",{"data-remote-session-group":!0,children:[e.jsxs("div",{className:"flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:[e.jsx("span",{children:T("sidebar.project.remoteSessions")}),e.jsx("span",{children:ce.length.toString().padStart(2,"0")})]}),W("remote-sessions",ce)]}),X.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:T("sidebar.project.projects")}),X.map(I)]})]})}if(t==="status")return e.jsxs("div",{className:"flex flex-col",children:[oe,Te.map((n,k)=>e.jsxs("div",{children:[e.jsxs("div",{className:w("flex items-center justify-between px-5 pb-2 pt-3 font-mono text-[10px] tracking-[0.16em]",Ge[n.code]??"text-[hsl(var(--deck-ink-faint))]",k===0&&"pt-2"),children:[e.jsx("span",{children:T(qe[n.code])}),e.jsxs("span",{className:"text-[hsl(var(--deck-ink-faint))]",children:[n.sessions.length.toString().padStart(2,"0"),H?"+":""]})]}),ye(`status:${n.code}`,n.sessions)]},n.code))]});const le=Q.some(n=>n.isActive),me=n=>!!(l&&n.sessions.some(k=>be(K(k),l))),de=(n,k)=>{if(n.join("\0")===Q.map(I=>I.path).join("\0"))return;Y(n),Me(n);const x=Q.find(I=>I.path===k);ae(T("sidebar.project.reordered",{name:(x==null?void 0:x.name)??k,position:n.indexOf(k)+1}))},we=(n,k)=>{const x=n.sessions.filter(f=>b.includes($(K(f)))).length,I=me(n),i=x>0,p=n.sessions.some(f=>!!f.pendingInteraction),u=B[n.path]??(le&&!n.isActive&&!(I||n.hasRunning||i||p));return e.jsxs("div",{"data-project-group":n.path,onDragEnter:f=>{!A||A===n.path||(f.preventDefault(),F(n.path))},onDragOver:f=>{!A||A===n.path||(f.preventDefault(),f.dataTransfer.dropEffect="move")},onDrop:f=>{f.preventDefault();const L=A||f.dataTransfer.getData("text/plain");L&&L!==n.path&&de(Le(Q.map(re=>re.path),L,n.path),L),U(null),F(null)},className:w("relative transition-colors",y===n.path&&A!==n.path&&"bg-[hsl(var(--deck-accent-soft))]/55 before:absolute before:inset-y-1 before:left-0 before:w-0.5 before:rounded-full before:bg-[hsl(var(--deck-accent))]"),children:[e.jsx(Fe,{name:n.name,path:n.path,count:n.sessions.length,countIsPartial:H,isActive:n.isActive,hasRunning:n.hasRunning,unreadCount:x,collapsed:u,onSelect:()=>m(n.path),onCreateTask:()=>g(n.path),reorderPosition:k+1,reorderCount:Q.length,isDragging:A===n.path,onDragStart:f=>{f.dataTransfer.effectAllowed="move",f.dataTransfer.setData("text/plain",n.path),U(n.path)},onDragEnd:()=>{U(null),F(null)},onReorderKeyDown:f=>{if(f.key!=="ArrowUp"&&f.key!=="ArrowDown")return;f.preventDefault();const L=Ue(Q.map(re=>re.path),n.path,f.key==="ArrowUp"?-1:1);de(L,n.path)},onToggle:()=>h(f=>({...f,[n.path]:!u}))}),!u&&ye(`project:${n.path}`,n.sessions)]},n.path)};return e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"sr-only","aria-live":"polite",children:z}),oe,Q.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-5 pb-0.5 pt-2 font-mono text-[9px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:T("sidebar.project.projects")}),Q.map(we)]})]})}function us({className:t,onNavigate:a}){const r=se(),{toggleSettings:c,toggleSidebar:o,isSidebarOpen:l,isTerminalOpen:C,toggleTerminal:b,sidebarView:v,setSidebarView:m,setTaskSwitcherOpen:g,mainView:P,setMainView:R,setBoardProjectPath:j,setFilePreviewOpen:T}=Pt(),B=d(s=>s.sessions),h=d(s=>s.surfaceCatalog),E=d(s=>s.surfaceCatalogLoadState),M=d(s=>s.historySurfaceSelection),_=at(M),Y=d(s=>s.currentSessionRef),A=d(s=>s.forkingSessionRef),U=d(s=>s.selectSession),y=d(s=>s.openHistorySurface),F=d(s=>s.startTemporarySession),z=d(s=>s.deleteSession),ae=d(s=>s.archiveSession),q=d(s=>s.forkSession),S=d(s=>s.updateSession),H=d(s=>s.loadSessions),ie=d(s=>s.loadSurfaceCatalog),Te=d(s=>s.setError),ne=d(s=>s.taskEventsConnected),Q=d(s=>s.taskWorkspaceInfo),V=d(s=>s.boundProjects),Ce=d(s=>s.selectedProjectPath),X=d(s=>s.bindProject),ce=d(s=>s.selectProject),ge=d(s=>s.cancelTask),je=d(s=>s.cancellingTaskKeys),fe=d(s=>s.retryTask),ye=d(s=>s.retryingTaskKeys),W=d(s=>s.unreadTaskKeys),[oe,le]=D.useState(null),[me,de]=D.useState(""),[we,n]=D.useState(null),[k,x]=D.useState(!1),I=Ce??(Q==null?void 0:Q.cwd)??null,i=s=>Se(s,r),p=s=>{const N=s.taskSourceProjectPath||s.projectPath,J=N.split("/").filter(Boolean).at(-1)||N,he=s.taskIsolation==="worktree"?s.taskWorktreeBranch||r("session.env.worktree"):r("session.env.local"),Ee=s.taskDiffStat?`+${s.taskDiffStat.additions} −${s.taskDiffStat.deletions}`:void 0,Ae=s.taskStatus==="queued"&&s.taskQueuePosition?r("session.queued",{position:s.taskQueuePosition,depth:s.taskQueueDepth??s.taskQueuePosition}):void 0,De=Dt(s,r);return{project:J,environment:he,diff:Ee,queue:Ae,reason:De}},u=()=>{R("workspace"),F(I??void 0),a==null||a()},f=()=>{d.getState().closeHistorySurface(),T(!1),j(I),R("board"),a==null||a()},L=async s=>{V.some(N=>N.path===s)?ce(s):await X(s),R("workspace"),F(s),a==null||a()},re=async s=>{V.some(N=>N.path===s)?ce(s):await X(s),R("workspace"),F(s),a==null||a()},Z=s=>{s(),a==null||a()},O=()=>{G(d.getState())||Z(b)},ee=async(s,N)=>{s.stopPropagation(),!G(d.getState())&&await z(K(N))},ke=async s=>{if(G(d.getState()))return;const N=K(s),J=$(N);if(!we){n(J);try{await lt(N)}catch(he){Te(he instanceof Error?he.message:"Session export failed")}finally{n(null)}}},xt=(s,N)=>{s.stopPropagation(),!G(d.getState())&&(le($(K(N))),de(i(N)))},pt=async s=>{if(!G(d.getState())){if(!me.trim()){le(null);return}try{await S(K(s),me.trim()),le(null),await H()}catch(N){console.error("Failed to rename session:",N)}}},ft=()=>{le(null),de("")};return l?e.jsxs("div",{className:w("flex flex-col h-screen border-r w-[260px] border-[hsl(var(--deck-hairline))] bg-[hsl(var(--deck-canvas-veil))]",t),children:[e.jsxs("div",{className:"flex flex-col gap-6 px-5 pt-5 pb-5",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx(Ye,{size:26}),e.jsx("span",{className:"font-mono text-[15px] font-semibold tracking-[-0.01em] text-[hsl(var(--deck-ink))]",children:"Blade"}),e.jsx("span",{className:"ml-1 rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.brand.badge")})]}),e.jsx("button",{onClick:o,"aria-label":r("sidebar.action.collapse"),className:"flex h-8 w-8 items-center justify-center rounded transition-colors hover:bg-[hsl(var(--deck-surface))]",children:e.jsx(_t,{className:"h-3 w-3 text-[hsl(var(--deck-ink-muted))]"})})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsxs("button",{onClick:u,className:"flex h-9 w-full items-center justify-between rounded-md bg-[hsl(var(--deck-ink))] px-3 font-mono text-[13px] font-medium text-[hsl(var(--deck-canvas))] transition-colors hover:bg-[hsl(var(--deck-ink))]/88",children:[e.jsxs("span",{className:"flex gap-2 items-center",children:[e.jsx(Oe,{className:"h-3.5 w-3.5 stroke-[2.5]"}),r("sidebar.action.newTask")]}),e.jsx("span",{className:"rounded-sm bg-white/10 px-1.5 py-[1px] font-mono text-[10px] text-white/80",children:Re("newTask")})]}),e.jsxs("button",{type:"button",onClick:f,"aria-current":P==="board"?"page":void 0,className:w("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",P==="board"?"border-[hsl(var(--deck-accent)/0.45)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[e.jsx(ot,{className:"h-3.5 w-3.5"}),r("sidebar.action.taskBoard")]}),e.jsxs("button",{onClick:O,disabled:_,className:w("flex h-9 w-full items-center gap-2 rounded-md border px-3 font-mono text-[12.5px] transition-colors",C?"border-[hsl(var(--deck-accent)/0.55)] bg-[hsl(var(--deck-accent-soft))] text-[hsl(var(--deck-accent))]":"border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-muted))] hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]"),children:[e.jsx(ct,{className:"h-3.5 w-3.5"}),r("sidebar.action.terminal")]}),!_&&e.jsxs("button",{type:"button",onClick:()=>Z(()=>g(!0)),className:"flex h-9 w-full items-center justify-between rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-ink))]",children:[e.jsxs("span",{className:"flex items-center gap-2",children:[e.jsx(We,{className:"h-3.5 w-3.5"}),r("sidebar.action.searchTasks")]}),e.jsx("span",{className:"rounded-sm border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-[1px] font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:W.length>0?W.length:Re("searchTasks")})]})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{className:"flex flex-1 items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["project","status"].map(s=>e.jsx("button",{type:"button",onClick:()=>m(s),"aria-pressed":v===s,"aria-label":r(s==="project"?"sidebar.view.projectAria":"sidebar.view.statusAria"),className:w("flex-1 rounded-[5px] py-1 font-mono text-[11px] tracking-[0.02em] transition-colors",v===s?"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:r(s==="project"?"sidebar.view.project":"sidebar.view.status")},s))}),e.jsx("button",{type:"button",onClick:()=>x(!0),disabled:_,title:r("projects.bind.action"),"aria-label":r("projects.bind.action"),className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] text-[hsl(var(--deck-ink-faint))] transition-colors hover:border-[hsl(var(--deck-border-strong))] hover:text-[hsl(var(--deck-accent))]",children:e.jsx(Tt,{className:"h-3.5 w-3.5"})})]})]}),e.jsx(ze,{className:"flex-1 px-0",children:e.jsxs("div",{className:"flex flex-col",children:[(B.length>0||h.length>0||V.length>0||E==="loading"||E==="hydrating"||E==="error")&&e.jsx(Zt,{view:v,sessions:B,surfaceCatalog:h,activeProjectPath:I,boundProjects:V,currentSessionRef:Y,historySurfaceSelection:M,unreadTaskKeys:W,catalogLoadState:E,onRetryCatalog:()=>{ie()},onSelectProject:s=>void L(s).catch(()=>{}),onCreateTask:s=>void re(s).catch(()=>{}),renderLocalRow:s=>{const N=K(s),J=$(N),he=be(N,Y),Ee=oe===J,Ae=be(N,A),De=!!A;return e.jsx(Gt,{session:s,sessionRef:N,isActive:he,isForking:Ae,isUnread:W.includes($(N)),anyForking:De,isEditing:Ee,editingTitle:me,title:i(s),context:p(s),isCancelling:je.includes($(N)),isRetrying:ye.includes($(N)),isExporting:we===J,onSelect:()=>(a==null||a(),R("workspace"),U(N)),onCancelTask:()=>{G(d.getState())||ge(N).catch(()=>{})},onRetryTask:()=>{G(d.getState())||fe(N).catch(()=>{})},onFork:()=>{G(d.getState())||q(s)},onArchive:()=>{G(d.getState())||ae(N)},onExport:()=>void ke(s),onStartRename:Pe=>xt(Pe,s),onDelete:Pe=>ee(Pe,s),onEditingTitleChange:de,onSaveRename:()=>pt(s),onCancelRename:ft},J)},renderRemoteRow:s=>e.jsx(Ft,{summary:s,isActive:st(s.locator,M==null?void 0:M.locator),onSelect:()=>(a==null||a(),R("workspace"),y(s.locator))},Ct(s.locator))}),h.length===0&&B.length===0&&e.jsx("div",{className:"px-5 mt-6",children:e.jsxs("div",{className:"rounded-md border border-dashed border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))]/60 px-4 py-6 text-center",children:[e.jsx("div",{className:"mx-auto mb-2 inline-flex h-8 w-8 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))]",children:e.jsx(Et,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"})}),e.jsx("div",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink-muted))]",children:r("sidebar.empty.title")}),e.jsx("div",{className:"mt-1 text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.empty.hint")})]})})]})}),e.jsxs("div",{className:"flex flex-col gap-3 px-5 pt-3 pb-5",children:[e.jsxs("div",{className:"flex flex-col gap-0.5 border-t border-[hsl(var(--deck-hairline))] pt-3",children:[!_&&e.jsx(Ut,{}),[{icon:it,action:()=>Z(c),labelKey:"sidebar.section.settings"}].map(({icon:s,action:N,labelKey:J})=>e.jsxs("button",{"data-settings-trigger":!0,onClick:N,className:"flex h-8 w-full items-center gap-2.5 rounded-md px-2.5 font-mono text-[12.5px] text-[hsl(var(--deck-ink-muted))] transition-colors hover:bg-[hsl(var(--deck-surface))] hover:text-[hsl(var(--deck-ink))]",children:[e.jsx(s,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),r(J)]},J))]}),e.jsxs("div",{className:"flex gap-2 justify-between items-center",children:[e.jsx("span",{className:"font-mono text-[10px] uppercase tracking-[0.14em] text-[hsl(var(--deck-ink-faint))]",children:r("sidebar.language.label")}),e.jsx(dt,{})]}),e.jsxs("div",{className:"flex items-center gap-2.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-3 py-2",children:[e.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-md bg-[hsl(var(--deck-canvas-veil))]",children:e.jsx("div",{className:"h-2 w-2 rounded-full bg-[hsl(var(--deck-ink))]"})}),e.jsxs("div",{className:"flex flex-1 flex-col gap-[1px]",children:[e.jsx("span",{className:"font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:r("sidebar.status.user")}),e.jsxs("span",{className:w("flex gap-1 items-center font-mono text-[10px]",ne?"text-[hsl(var(--deck-accent))]":"text-[hsl(var(--deck-ink-faint))]"),children:[e.jsx("span",{className:w("h-1 w-1 rounded-full",ne?"bg-[hsl(var(--deck-accent))] shadow-[0_0_5px_hsl(var(--deck-accent-glow)/0.9)]":"bg-[hsl(var(--deck-ink-faint))]/60")}),r(ne?"sidebar.status.feedLive":"sidebar.status.feedOffline")]})]})]})]}),!_&&e.jsx(At,{open:k,onOpenChange:x})]}):e.jsx(Kt,{className:t,onExpand:o,onNewChat:u,onOpenBoard:f,onOpenTaskSwitcher:()=>Z(()=>g(!0)),onToggleTerminal:O,onToggleSettings:()=>Z(c),isTerminalOpen:C,taskEventsConnected:ne,unreadCount:W.length,boardActive:P==="board",terminalDisabled:_,taskSwitcherDisabled:_})}export{us as Sidebar};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as A,j as N,a6 as Ie,d as X,b as F,y as Pe,a7 as Le,a8 as R,a9 as Y,u as qe,a as c,aa as L,ab as Fe,ac as Re,x as Ee,D as Be,e as Ke,ad as Oe,g as $e,h as ze,Q as _,s as He,A as ke,q as Qe,G as We,L as q,E as Ue,R as Ve}from"./index-_xnlrekR.js";import{m as h,i as Ge,r as J}from"./session-events-AGMXvPey.js";import{A as fe,F as _e}from"./folder-Ltm9jCS5.js";import{P as Je}from"./plus-BqvjEpLw.js";import{T as Xe}from"./terminal-By4sO9Gw.js";import{S as Ye}from"./settings-LfQbDvBA.js";import{C as Ze}from"./clock-3-v-nHTA0A.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 et=A("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 tt=A("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 nt=A("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 st=A("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 at=A("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 rt(t,a){const s=a.trim().toLocaleLowerCase();return s?t.filter(r=>`${r.label} ${r.description} ${r.keywords}`.toLocaleLowerCase().includes(s)):t}function it({actions:t,selectedIndex:a,onSelect:s,onRun:r}){return t.map((o,p)=>{const k=p===a,m=o.icon;return n.jsx("div",{id:`command-center-result-${p}`,"data-task-result-index":p,role:"option","aria-selected":k,onMouseEnter:()=>s(p),className:N("group flex min-h-[58px] w-full items-center rounded-lg border border-transparent text-left transition-colors",k?"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(o),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:o.label}),n.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:o.description})]}),o.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:o.shortcut}),n.jsx(fe,{className:N("h-3.5 w-3.5 shrink-0 transition-all",k?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]})},o.id)})}const ct={running:"running active 进行中 运行中",queued:"queued waiting 排队中 等待中",interrupted:"interrupted paused 已暂停 已中断",failed:"failed error 已失败 错误",cancelled:"cancelled canceled 已取消",completed:"completed done finished 已完成 完成"};function Z(t){return Pe(t,Le)}function ot(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 E(t){return t.normalize("NFKC").toLocaleLowerCase().trim()}function lt(t,a){var r,o;const s=R(t,a);return E([Z(t),Y(s),s,t.projectPath,t.gitBranch,t.taskWorktreeBranch,t.taskStatus,ct[t.taskStatus],((r=t.pendingInteraction)==null?void 0:r.type)==="question"?"needs answer question attention 等待回答 需要回答":((o=t.pendingInteraction)==null?void 0:o.type)==="elicitation"?"mcp input elicitation attention MCP 输入 等待输入":t.pendingInteraction?"needs approval permission attention 等待审批 需要授权":"",t.sessionId].filter(Boolean).join(" "))}function xe(t,a,s){if(!a)return 0;const r=E(Z(t)),o=E(Y(R(t,s)));return r===a?500:r.startsWith(a)?400:r.includes(a)?300:o===a?250:o.startsWith(a)?200:100}function dt(t,a,s,r=50){const o=E(a),p=o.split(/\s+/).filter(Boolean),k=new Set;return t.filter(m=>{if(p.length===0)return!0;const u=lt(m,s);return p.every(g=>u.includes(g))}).sort((m,u)=>{const g=+!!u.pendingInteraction-+!!m.pendingInteraction;return g!==0?g:xe(u,o,s)-xe(m,o,s)||Ie(m,u)}).filter(m=>{const u=X(F(m));return k.has(u)?!1:(k.add(u),!0)}).slice(0,r)}const mt={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 vt(){const t=qe(),a=h(e=>e.isTaskSwitcherOpen),s=h(e=>e.taskSwitcherMode),r=h(e=>e.setTaskSwitcherOpen),o=h(e=>e.setTaskSwitcherMode),p=h(e=>e.setMainView),k=h(e=>e.toggleSidebar),m=h(e=>e.isFilePreviewOpen),u=h(e=>e.setFilePreviewOpen),g=h(e=>e.openFilePreview),B=h(e=>e.toggleTerminal),w=h(e=>e.openSettings),b=c(e=>e.sessions),ge=c(e=>e.isLoading),C=c(e=>e.catalogLoadState),K=C==="loading"||C==="hydrating",O=c(e=>e.currentSessionRef),$=c(e=>Ge(e.historySurfaceSelection)),ee=c(e=>e.closeHistorySurface),te=c(e=>e.isTemporarySession),ne=c(e=>e.startTemporarySession),z=c(e=>e.unreadTaskKeys),be=c(e=>e.boundProjects),D=c(e=>{var i;return e.selectedProjectPath??((i=e.taskWorkspaceInfo)==null?void 0:i.cwd)??null}),ye=c(e=>e.selectProject),ve=c(e=>e.selectSession),we=c(e=>e.cancelTask),je=c(e=>e.retryTask),Se=c(e=>e.cancellingTaskKeys),Ne=c(e=>e.retryingTaskKeys),[y,se]=l.useState(""),[f,j]=l.useState(0),[Ce,H]=l.useState(null),[ae,I]=l.useState(null),re=l.useRef(null),ie=l.useRef(null),ce=l.useMemo(()=>[{id:"new-task",label:t("commandCenter.action.newTask"),description:t("commandCenter.action.newTaskDescription"),keywords:"create compose session",icon:Je,shortcut:L("newTask"),run:()=>{ee(),p("workspace"),ne(),requestAnimationFrame(()=>Ee())}},{id:"toggle-preview",label:t("commandCenter.action.preview"),description:t("commandCenter.action.previewDescription"),keywords:"diff files logs artifact review",icon:Fe,run:()=>{J(c.getState())||(m?u(!1):g((!O||te)&&h.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:Xe,run:()=>{J(c.getState())||B()}},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:Ye,run:()=>w("general")},{id:"open-models",label:t("commandCenter.action.models"),description:t("commandCenter.action.modelsDescription"),keywords:"provider llm api configuration",icon:tt,run:()=>w("models")},{id:"open-shortcuts",label:t("commandCenter.action.shortcuts"),description:t("commandCenter.action.shortcutsDescription"),keywords:"keyboard hotkey key binding",icon:nt,shortcut:L("openCommands"),run:()=>w("shortcuts")},{id:"open-skills",label:t("commandCenter.action.skills"),description:t("commandCenter.action.skillsDescription"),keywords:"capabilities workflow",icon:Re,run:()=>w("skills")},{id:"open-mcp",label:t("commandCenter.action.mcp"),description:t("commandCenter.action.mcpDescription"),keywords:"server tools protocol integration",icon:at,run:()=>w("mcp")},{id:"toggle-sidebar",label:t("commandCenter.action.sidebar"),description:t("commandCenter.action.sidebarDescription"),keywords:"navigation layout panel projects",icon:st,shortcut:L("toggleSidebar"),run:k}],[O,ee,m,te,g,w,u,p,ne,t,k,B]),v=l.useMemo(()=>dt(b,y,D),[D,y,b]),T=l.useMemo(()=>rt(ce,y),[ce,y]),M=s==="tasks"?v.length:T.length,oe=l.useMemo(()=>b.filter(e=>!!e.pendingInteraction).length,[b]),Q=s==="tasks"?v[f]??null:null,W=s==="commands"?T[f]??null:null;l.useEffect(()=>{a&&(se(""),j(0),H(null),I(null))},[s,a]),l.useEffect(()=>{$&&a&&r(!1)},[$,a,r]),l.useEffect(()=>{j(0)},[y]),l.useEffect(()=>{var i,d;const e=(i=ie.current)==null?void 0:i.querySelector(`[data-task-result-index="${f}"]`);(d=e==null?void 0:e.scrollIntoView)==null||d.call(e,{block:"nearest"})},[f]);const le=async e=>{const i=F(e),d=X(i),x=R(e,D);H(d),be.some(S=>S.path===x)&&ye(x);try{p("workspace"),await ve(i),r(!1)}catch(S){I(S instanceof Error?S.message:t("taskSwitcher.action.failed"))}finally{H(null)}},de=async(e,i)=>{if(!J(c.getState())){I(null);try{const d=F(i);e==="cancel"?await we(d):(await je(d),r(!1))}catch(d){I(d instanceof Error?d.message:t("taskSwitcher.action.failed"))}}},me=e=>{r(!1),requestAnimationFrame(e.run)},Te=e=>{e.key==="ArrowDown"?(e.preventDefault(),j(i=>M===0?0:(i+1)%M)):e.key==="ArrowUp"?(e.preventDefault(),j(i=>M===0?0:(i-1+M)%M)):e.key==="Enter"&&Q?(e.preventDefault(),le(Q)):e.key==="Enter"&&W?(e.preventDefault(),me(W)):e.key==="Escape"&&(e.preventDefault(),r(!1))};return $?null:n.jsx(Be,{open:a,onOpenChange:r,children:n.jsxs(Ke,{hideCloseButton:!0,onCloseAutoFocus:Oe,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($e,{className:"sr-only",children:t("commandCenter.title")}),n.jsx(ze,{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(_,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]"}),n.jsx("input",{ref:re,autoFocus:!0,role:"combobox","aria-expanded":"true","aria-controls":"task-switcher-results","aria-activedescendant":Q?`task-switcher-result-${f}`:W?`command-center-result-${f}`:void 0,"aria-label":t(s==="tasks"?"taskSwitcher.searchAria":"commandCenter.searchAria"),placeholder:t(s==="tasks"?"taskSwitcher.placeholder":"commandCenter.placeholder"),value:y,onChange:e=>se(e.target.value),onKeyDown:Te,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:()=>{o(e),requestAnimationFrame(()=>{var i;return(i=re.current)==null?void 0:i.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:T.length}):y?t("taskSwitcher.results",{count:v.length}):K?b.length===0?t("taskSwitcher.indexing"):t("taskSwitcher.indexingLoaded",{count:b.length}):C==="error"?t("sidebar.catalog.incomplete"):oe>0?t("taskSwitcher.needsAction",{count:oe}):z.length>0?t("taskSwitcher.unread",{count:z.length}):t("taskSwitcher.scope",{count:b.length})})})]}),ae&&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:ae}),n.jsxs("div",{id:"task-switcher-results",ref:ie,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(it,{actions:T,selectedIndex:f,onSelect:j,onRun:me}),s==="tasks"&&v.map((e,i)=>{const d=F(e),x=X(d),S=R(e,D),Me=Y(S),he=He(d,O),U=i===f,Ae=Ce===x,De=z.includes(x),P=Z(e),pe=e.taskStatus==="running"||e.taskStatus==="queued",ue=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),V=Se.includes(x),G=Ne.includes(x);return n.jsxs("div",{id:`task-switcher-result-${i}`,"data-task-result-index":i,"data-session-ref":x,role:"option","aria-selected":U,onMouseEnter:()=>j(i),className:N("group flex min-h-[68px] w-full items-center rounded-lg border border-transparent text-left transition-colors",U?"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 le(e),"aria-label":t("session.action.select",{title:P}),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))]",he?"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(ke,{className:"h-3.5 w-3.5 animate-pulse text-amber-600 dark:text-amber-400"}):e.taskStatus==="running"?n.jsx(et,{className:"h-3.5 w-3.5 animate-pulse"}):n.jsx(Qe,{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:P}),he&&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")}),De&&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(_e,{className:"h-2.5 w-2.5 shrink-0"}),n.jsx("span",{className:"truncate",children:Me})]}),(e.taskWorktreeBranch||e.gitBranch)&&n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(We,{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(mt[e.taskStatus])}),n.jsxs("span",{className:"ml-auto inline-flex shrink-0 items-center gap-1",children:[n.jsx(Ze,{className:"h-2.5 w-2.5"}),ot(e)]})]})]}),Ae?n.jsx(q,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}):n.jsx(fe,{className:N("h-3.5 w-3.5 shrink-0 transition-all",U?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]}),(pe||ue)&&n.jsxs("div",{className:"flex shrink-0 items-center pr-2",children:[pe&&n.jsx("button",{type:"button","aria-label":t(V?"session.action.stopping":"session.action.stop",{title:P}),disabled:V,onClick:()=>void de("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:V?n.jsx(q,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ue,{className:"h-3.5 w-3.5"})}),ue&&n.jsx("button",{type:"button","aria-label":t(G?"session.action.retrying":"session.action.retry",{title:P}),disabled:G,onClick:()=>void de("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:G?n.jsx(q,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ve,{className:"h-3.5 w-3.5"})})]})]},x)}),s==="tasks"&&v.length===0&&K&&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(q,{className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("taskSwitcher.indexing")]}),s==="tasks"&&v.length===0&&!K&&C!=="error"&&!ge&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(_,{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"&&v.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(ke,{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"&&T.length===0&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(_,{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:[L(s==="tasks"?"openCommands":"searchTasks")," ",t(s==="tasks"?"commandCenter.mode.commands":"commandCenter.mode.tasks")]})]})]})})}export{vt as TaskSwitcher};
|
|
@@ -0,0 +1,6 @@
|
|
|
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,ak as T,j as p,X as W}from"./index-_xnlrekR.js";import{m as I,r as L,i as A}from"./session-events-AGMXvPey.js";import{T as D}from"./terminal-By4sO9Gw.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 G=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(G,{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};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as e}from"./index-_xnlrekR.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 t=e("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);export{t as A};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as t}from"./index-_xnlrekR.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 h=t("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);export{h as C};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c}from"./index-_xnlrekR.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 t=c("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);export{t as C};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{c as o}from"./index-_xnlrekR.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 a=o("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);export{a as D};
|