blade-code 0.10.133 → 0.10.137
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-h6tr3zz7.js → chunk-0c82q1sz.js} +1 -1
- package/dist/chunk-0ccm29qy.js +2 -0
- package/dist/{chunk-fjvt9mwv.js → chunk-0k2x2ae6.js} +1 -1
- package/dist/{chunk-7hxyxv4x.js → chunk-1evc05gr.js} +2 -2
- package/dist/chunk-35668hyn.js +1 -0
- package/dist/{chunk-d881py5y.js → chunk-39de5k03.js} +2 -2
- package/dist/chunk-3gmcvd0c.js +1 -0
- package/dist/{chunk-7j628q12.js → chunk-4jqw75ce.js} +1 -1
- package/dist/chunk-5774a669.js +1 -0
- package/dist/chunk-5btfnf2r.js +14 -0
- package/dist/{chunk-bj8cgfbr.js → chunk-5dwmhsrx.js} +1 -1
- package/dist/chunk-5sf2rc1z.js +171 -0
- package/dist/{chunk-nfdfthhb.js → chunk-69nwa6bn.js} +1 -1
- package/dist/{chunk-2nv0kg12.js → chunk-69rjav47.js} +1 -1
- package/dist/{chunk-w3y69e4e.js → chunk-6e3mh79j.js} +1 -1
- package/dist/{chunk-3csj18f1.js → chunk-6xvrrypm.js} +1 -1
- package/dist/{chunk-87ycd3f8.js → chunk-74bswv4z.js} +2 -2
- package/dist/{chunk-ndgdf5jx.js → chunk-75yy9yre.js} +1 -1
- package/dist/chunk-7n035mhg.js +1 -0
- package/dist/{chunk-e1q1hvty.js → chunk-7ykqvsph.js} +2 -2
- package/dist/chunk-9a7bppj7.js +2 -0
- package/dist/{chunk-cfamqqgv.js → chunk-9frd4fpk.js} +2 -2
- package/dist/chunk-a26vtcv5.js +5 -0
- package/dist/{chunk-0ap8b3sw.js → chunk-affzv7f1.js} +1 -1
- package/dist/chunk-b08thknq.js +1 -0
- package/dist/{chunk-f1wnva76.js → chunk-bx75fd0d.js} +396 -394
- package/dist/chunk-bzqbmz6t.js +171 -0
- package/dist/{chunk-yvk8w63g.js → chunk-c2mx5zg0.js} +1 -1
- package/dist/chunk-chspy9f8.js +23 -0
- package/dist/chunk-d6tbr25k.js +1 -0
- package/dist/chunk-dt9n4f4e.js +1 -0
- package/dist/{chunk-ms360ds6.js → chunk-e76gej4y.js} +2 -2
- package/dist/{chunk-bzp08nf6.js → chunk-e8pfbb6c.js} +1 -1
- package/dist/chunk-ermypm1x.js +2 -0
- package/dist/chunk-esp69w6w.js +1 -0
- package/dist/{chunk-z5mm9g1y.js → chunk-etf3e9kt.js} +1 -1
- package/dist/{chunk-x1w3fvhr.js → chunk-f2b9cyj5.js} +2 -2
- package/dist/chunk-g1y60ey9.js +1 -0
- package/dist/{chunk-be2csw9m.js → chunk-g799czsy.js} +1 -1
- package/dist/{chunk-dnt4c3gy.js → chunk-g9vdmvk2.js} +2 -2
- package/dist/chunk-gf5v8aff.js +1 -0
- package/dist/chunk-gpj7k3er.js +6 -0
- package/dist/{chunk-mkvqtawj.js → chunk-h05qhgrb.js} +2 -2
- package/dist/{chunk-2qyh6qhb.js → chunk-h74p51hg.js} +2 -2
- package/dist/{chunk-1tfjaazq.js → chunk-karq4wfd.js} +1 -1
- package/dist/{chunk-cz9mqkn2.js → chunk-ky9br0z8.js} +1 -1
- package/dist/chunk-m9kh7djg.js +6 -0
- package/dist/{chunk-gv24cgpb.js → chunk-mavranwn.js} +3 -3
- package/dist/{chunk-0xph7bhe.js → chunk-mthf5akx.js} +2 -2
- package/dist/{chunk-8xem2mzy.js → chunk-mzye1ah2.js} +1 -1
- package/dist/chunk-na4wzne8.js +1 -0
- package/dist/chunk-ntmkzrs8.js +1 -0
- package/dist/{chunk-961nemng.js → chunk-nxnmqk4s.js} +1 -1
- package/dist/{chunk-h123tjsg.js → chunk-p0gbxaqz.js} +2 -2
- package/dist/chunk-pj15kt5b.js +10 -0
- package/dist/chunk-pv1vwasz.js +1 -0
- package/dist/{chunk-r4bgsfj6.js → chunk-q0s3gcjm.js} +1 -1
- package/dist/{chunk-jy61b0v8.js → chunk-ramana2t.js} +2 -2
- package/dist/{chunk-ks67gd2j.js → chunk-rgjr7jsd.js} +1 -1
- package/dist/chunk-v5503t2t.js +25 -0
- package/dist/chunk-vda03kxj.js +1 -0
- package/dist/{chunk-4xhawy0e.js → chunk-vg3zwv4g.js} +1 -1
- package/dist/chunk-vp6d1fqp.js +3 -0
- package/dist/{chunk-nyk5q71k.js → chunk-w9z34f27.js} +1 -1
- package/dist/{chunk-5x3h9ak8.js → chunk-wa71vstt.js} +1 -1
- package/dist/{chunk-f4pn5tmr.js → chunk-wc9wsyrc.js} +1 -1
- package/dist/{chunk-0d440hhe.js → chunk-wxtj6gqb.js} +1 -1
- package/dist/{chunk-rmm7n9n3.js → chunk-wxypv01z.js} +2 -2
- package/dist/{chunk-77efqpdc.js → chunk-wzkh3e6a.js} +1 -1
- package/dist/{chunk-rcthrb7h.js → chunk-xg9fyvw0.js} +2 -2
- package/dist/{chunk-7zvwfz85.js → chunk-xt0ktytp.js} +2 -2
- package/dist/{chunk-xgz1yanb.js → chunk-y6jee9w7.js} +1 -1
- package/dist/{chunk-3ndwbb7h.js → chunk-ybc5myz7.js} +1 -1
- package/dist/{chunk-53h87fmt.js → chunk-z3hpstky.js} +1 -1
- package/dist/{chunk-555ffyze.js → chunk-zk9rf1d7.js} +2 -2
- package/dist/web/assets/ChatView-DpvPjAh7.js +63 -0
- package/dist/web/assets/{CodeBlockHighlighter-D0yM8QTf.js → CodeBlockHighlighter-Czp4VZIg.js} +1 -1
- package/dist/web/assets/{FilePreview-CaTCjV5i.js → FilePreview-BJWuYfyF.js} +15 -20
- package/dist/web/assets/{KanbanBoard-BY0SXCol.js → KanbanBoard-DrYzt5Kh.js} +4 -4
- package/dist/web/assets/{MarkdownRenderer-zKto-Pty.js → MarkdownRenderer-DxkR5r7t.js} +3 -3
- package/dist/web/assets/{ScrollArea-1qPJ8lcT.js → ScrollArea-D71pJjgW.js} +1 -1
- package/dist/web/assets/{SessionHistorySurface-Ce9xX62q.js → SessionHistorySurface-2y9bnndm.js} +2 -2
- package/dist/web/assets/{SettingsModal-BxKOMuIm.js → SettingsModal-BbaTL5Rk.js} +1 -1
- package/dist/web/assets/{Sidebar-CEF6lGps.js → Sidebar-COZltpL9.js} +1 -1
- package/dist/web/assets/{TaskSwitcher-C-EY0nVG.js → TaskSwitcher-3giB7l1P.js} +2 -2
- package/dist/web/assets/{TerminalPanel-C3PVDyAr.js → TerminalPanel-gvTTiTgX.js} +2 -2
- package/dist/web/assets/{archive-D5Nuw__Q.js → archive-DndqAA2q.js} +1 -1
- package/dist/web/assets/{arrow-left-DaOpfgEz.js → arrow-left-XNYfpUAb.js} +1 -1
- package/dist/web/assets/{calendar-clock-DA_D4ppV.js → calendar-clock-BQOfNcCK.js} +1 -1
- package/dist/web/assets/{chevron-right-COQAoZf3.js → chevron-right-Cvq3LzHK.js} +1 -1
- package/dist/web/assets/chevrons-up-down-Dia1U9Sz.js +16 -0
- package/dist/web/assets/{clock-3-DJ-pSj3t.js → clock-3-CnxLS8cv.js} +1 -1
- package/dist/web/assets/{copy-5c0ESKoo.js → copy-CWCS3Lql.js} +1 -1
- package/dist/web/assets/{download-VkaTciEH.js → download-DXdsM18t.js} +1 -1
- package/dist/web/assets/{external-link-BypdqupZ.js → external-link-1IN2ZfaO.js} +1 -1
- package/dist/web/assets/{folder-B8znObPL.js → folder-Bpq602dI.js} +1 -1
- package/dist/web/assets/index-57UZsfTt.css +1 -0
- package/dist/web/assets/index-DEOQizD2.js +203 -0
- package/dist/web/assets/{pause-BWbHHYG6.js → pause-BYhoGDZq.js} +1 -1
- package/dist/web/assets/{pencil-BPyvvR59.js → pencil-pRZQVHFU.js} +1 -1
- package/dist/web/assets/{play-CLJgUH4S.js → play-DGZdCyPk.js} +1 -1
- package/dist/web/assets/{plus-D1VVvu-z.js → plus-CAQ3qlUJ.js} +1 -1
- package/dist/web/assets/session-events-C5_Q0kZV.js +29 -0
- package/dist/web/assets/{settings-CGCgC_NX.js → settings-BPfzj_Vf.js} +1 -1
- package/dist/web/assets/teamService-BScT9o9A.js +1 -0
- package/dist/web/assets/{terminal-pA96HZrI.js → terminal-CldJbdMr.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-00zazdct.js +0 -25
- package/dist/chunk-04yas0t8.js +0 -1
- package/dist/chunk-2242dshn.js +0 -2
- package/dist/chunk-2nxev7f2.js +0 -1
- package/dist/chunk-43a0n5rw.js +0 -1
- package/dist/chunk-679b7s58.js +0 -2
- package/dist/chunk-78wwep9f.js +0 -1
- package/dist/chunk-88jmtcv7.js +0 -171
- package/dist/chunk-ar3sdj0w.js +0 -3
- package/dist/chunk-avf9spct.js +0 -1
- package/dist/chunk-azv25dg2.js +0 -10
- package/dist/chunk-b8c1vj8c.js +0 -1
- package/dist/chunk-bbw6s542.js +0 -1
- package/dist/chunk-eetva9y8.js +0 -1
- package/dist/chunk-kjjpn49y.js +0 -1
- package/dist/chunk-kx61g7xw.js +0 -1
- package/dist/chunk-m30sbsnw.js +0 -1
- package/dist/chunk-n589jxsm.js +0 -1
- package/dist/chunk-n7pydthh.js +0 -6
- package/dist/chunk-nry7d26k.js +0 -2
- package/dist/chunk-p8y5kk56.js +0 -6
- package/dist/chunk-py92cy57.js +0 -14
- package/dist/chunk-rkjrft19.js +0 -5
- package/dist/chunk-sr9gqacp.js +0 -1
- package/dist/chunk-sxqydew5.js +0 -1
- package/dist/chunk-t52v91dy.js +0 -23
- package/dist/chunk-v7zt3pft.js +0 -171
- package/dist/web/assets/ChatView-hYd9mmJ6.js +0 -53
- package/dist/web/assets/chevrons-up-down-B_WSFixv.js +0 -11
- package/dist/web/assets/index-B4186fIT.css +0 -1
- package/dist/web/assets/index-DorkRCqS.js +0 -210
- package/dist/web/assets/session-events-C6fPz20c.js +0 -22
- package/dist/web/assets/teamService-DsYRmp6u.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as r}from"./vendor-react-DofNRwfy.js";import{o as t,V as n,p,q as c,r as f}from"./vendor-radix-D6QrtXqd.js";import{j as d}from"./index-
|
|
1
|
+
import{r as s,j as r}from"./vendor-react-DofNRwfy.js";import{o as t,V as n,p,q as c,r as f}from"./vendor-radix-D6QrtXqd.js";import{j as d}from"./index-DEOQizD2.js";const m=s.forwardRef(({className:l,children:e,...a},o)=>r.jsxs(t,{ref:o,className:d("overflow-hidden relative",l),...a,children:[r.jsx(n,{className:"h-full w-full rounded-[inherit] [&>div]:!block !overflow-auto",children:e}),r.jsx(i,{}),r.jsx(p,{})]}));m.displayName=t.displayName;const i=s.forwardRef(({className:l,orientation:e="vertical",...a},o)=>r.jsx(c,{ref:o,orientation:e,className:d("flex touch-none select-none transition-colors",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...a,children:r.jsx(f,{className:"relative flex-1 rounded-full bg-border"})}));i.displayName=c.displayName;export{m as S};
|
package/dist/web/assets/{SessionHistorySurface-Ce9xX62q.js → SessionHistorySurface-2y9bnndm.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{j as e,r as l}from"./vendor-react-DofNRwfy.js";import{c as O,u as g,a as c,X as _,
|
|
1
|
+
import{j as e,r as l}from"./vendor-react-DofNRwfy.js";import{c as O,u as g,a as c,X as _,U as H,C as L}from"./index-DEOQizD2.js";import{C as T}from"./copy-CWCS3Lql.js";import"./vendor-radix-D6QrtXqd.js";import"./session-events-C5_Q0kZV.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const E=O("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);function B({selection:s,loadState:a,error:o,recoveryCode:i,truncated:n}){const t=g(),u=t(s.capabilities.connection==="local"?"history.connection.local":s.capabilities.connection==="offline"?"history.connection.offline":"history.connection.online"),d=i==="session_surface_cursor_invalid"?t("history.recovery.cursor"):i==="session_surface_snapshot_changed"?t("history.recovery.snapshot"):null,x=o?o.code==="session_surface_unavailable"?t("history.error.unavailable"):o.code==="session_surface_state_invalid"?t("history.error.invalid"):t("history.error.generic"):null;return e.jsxs("section",{className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas-veil))] p-4","aria-label":t("history.banner.aria"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 font-mono text-[11px]",children:[e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-border))] px-2 py-1",children:t("history.badge.remote")}),e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-border))] px-2 py-1",children:u}),e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-accent))] bg-[hsl(var(--deck-accent-soft))] px-2 py-1 text-[hsl(var(--deck-accent))]",children:t("history.badge.historyOnly")})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-[hsl(var(--deck-ink-faint))]",children:t("history.location.label")}),e.jsx("div",{className:"mt-1 break-all font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:s.displayCwd})]}),e.jsxs("div",{className:"mt-4 grid gap-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:[e.jsx("div",{children:t("history.unavailable.prompt")}),e.jsx("div",{children:t("history.unavailable.files")}),e.jsx("div",{children:t("history.unavailable.terminal")})]}),a==="loading"&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-surface))] px-3 py-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("history.loading")}),d&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-accent-soft))] px-3 py-2 text-[12px] text-[hsl(var(--deck-accent))]",children:d}),n&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-surface))] px-3 py-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("history.bounded")}),o&&e.jsx("div",{className:"mt-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-[12px] text-red-700",role:"alert",children:x})]})}function R({text:s,label:a}){const[o,i]=l.useState(!1),n=async()=>{try{await navigator.clipboard.writeText(s),i(!0),window.setTimeout(()=>i(!1),1400)}catch{}};return e.jsx("button",{type:"button","aria-label":a,title:a,onClick:n,className:"flex h-7 w-7 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))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:o?e.jsx(L,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-accent))]"}):e.jsx(T,{className:"h-3.5 w-3.5"})})}function
|
|
6
|
+
*/const E=O("GitBranchPlus",[["path",{d:"M6 3v12",key:"qpgusn"}],["path",{d:"M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"1d02ji"}],["path",{d:"M6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",key:"chk6ph"}],["path",{d:"M15 6a9 9 0 0 0-9 9",key:"or332x"}],["path",{d:"M18 15v6",key:"9wciyi"}],["path",{d:"M21 18h-6",key:"139f0c"}]]);function B({selection:s,loadState:a,error:o,recoveryCode:i,truncated:n}){const t=g(),u=t(s.capabilities.connection==="local"?"history.connection.local":s.capabilities.connection==="offline"?"history.connection.offline":"history.connection.online"),d=i==="session_surface_cursor_invalid"?t("history.recovery.cursor"):i==="session_surface_snapshot_changed"?t("history.recovery.snapshot"):null,x=o?o.code==="session_surface_unavailable"?t("history.error.unavailable"):o.code==="session_surface_state_invalid"?t("history.error.invalid"):t("history.error.generic"):null;return e.jsxs("section",{className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas-veil))] p-4","aria-label":t("history.banner.aria"),children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2 font-mono text-[11px]",children:[e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-border))] px-2 py-1",children:t("history.badge.remote")}),e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-border))] px-2 py-1",children:u}),e.jsx("span",{className:"rounded-full border border-[hsl(var(--deck-accent))] bg-[hsl(var(--deck-accent-soft))] px-2 py-1 text-[hsl(var(--deck-accent))]",children:t("history.badge.historyOnly")})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx("div",{className:"font-mono text-[11px] uppercase tracking-[0.18em] text-[hsl(var(--deck-ink-faint))]",children:t("history.location.label")}),e.jsx("div",{className:"mt-1 break-all font-mono text-[12px] text-[hsl(var(--deck-ink))]",children:s.displayCwd})]}),e.jsxs("div",{className:"mt-4 grid gap-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:[e.jsx("div",{children:t("history.unavailable.prompt")}),e.jsx("div",{children:t("history.unavailable.files")}),e.jsx("div",{children:t("history.unavailable.terminal")})]}),a==="loading"&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-surface))] px-3 py-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("history.loading")}),d&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-accent-soft))] px-3 py-2 text-[12px] text-[hsl(var(--deck-accent))]",children:d}),n&&e.jsx("div",{className:"mt-4 rounded-lg bg-[hsl(var(--deck-surface))] px-3 py-2 text-[12px] text-[hsl(var(--deck-ink-muted))]",children:t("history.bounded")}),o&&e.jsx("div",{className:"mt-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-[12px] text-red-700",role:"alert",children:x})]})}function R({text:s,label:a}){const[o,i]=l.useState(!1),n=async()=>{try{await navigator.clipboard.writeText(s),i(!0),window.setTimeout(()=>i(!1),1400)}catch{}};return e.jsx("button",{type:"button","aria-label":a,title:a,onClick:n,className:"flex h-7 w-7 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))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))]",children:o?e.jsx(L,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-accent))]"}):e.jsx(T,{className:"h-3.5 w-3.5"})})}function I(){const s=g(),a=c(r=>r.historySurfaceSelection),o=c(r=>r.historySurfaceMessages),i=c(r=>r.historySurfaceOlderCursor),n=c(r=>r.historySurfaceLoadState),t=c(r=>r.historySurfaceError),u=c(r=>r.historySurfaceRecoveryCode),d=c(r=>r.historySurfaceTruncated),x=c(r=>r.loadOlderSurfaceHistory),j=c(r=>r.forkHistorySurface),N=c(r=>r.closeHistorySurface),[h,v]=l.useState(""),p=l.useRef(null);l.useEffect(()=>{a||v("")},[a]),l.useEffect(()=>{n==="error"&&(p.current=null)},[n]);const y=l.useMemo(()=>{const r=h.trim().toLowerCase();return r?o.filter(M=>M.content.toLowerCase().includes(r)):o},[o,h]);if(!a)return null;const m=n==="loading-older",k=n==="forking",S=n==="loading",f=a.capabilities.history.read&&!!i&&!m&&!S,w=a.capabilities.history.fork&&!k,b=()=>{!i||!f||p.current!==i&&(p.current=i,x())},C=r=>{r.currentTarget.scrollTop>8||!f||b()};return e.jsxs("section",{className:"flex h-full min-h-0 flex-col gap-4 p-4","aria-label":s("history.surface.aria"),children:[e.jsx(B,{selection:a,loadState:n,error:t,recoveryCode:u,truncated:d}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("button",{type:"button",onClick:b,disabled:!f,className:"inline-flex h-9 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))] disabled:cursor-not-allowed disabled:opacity-50",children:s(m?"history.action.loadingOlder":"history.action.loadOlder")}),e.jsxs("button",{type:"button",onClick:()=>void j(),disabled:!w,className:"inline-flex h-9 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))] disabled:cursor-not-allowed disabled:opacity-50",children:[e.jsx(E,{className:"h-3.5 w-3.5"}),s(k?"history.action.forking":"history.action.fork")]}),e.jsxs("button",{type:"button",onClick:N,className:"inline-flex h-9 items-center gap-2 rounded-md border border-[hsl(var(--deck-border))] px-3 font-mono text-[11px] text-[hsl(var(--deck-ink))] transition-colors hover:bg-[hsl(var(--deck-surface))]",children:[e.jsx(_,{className:"h-3.5 w-3.5"}),s("history.action.close")]})]}),e.jsxs("div",{className:"rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas-veil))] p-3",children:[e.jsxs("label",{className:"flex items-center gap-2 rounded-lg border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-3 py-2",children:[e.jsx(H,{className:"h-3.5 w-3.5 text-[hsl(var(--deck-ink-faint))]"}),e.jsx("input",{type:"search","aria-label":s("history.search.aria"),value:h,onChange:r=>v(r.target.value),placeholder:s("history.search.placeholder"),className:"w-full bg-transparent font-mono text-[12px] text-[hsl(var(--deck-ink))] outline-none placeholder:text-[hsl(var(--deck-ink-faint))]"})]}),e.jsx("p",{className:"mt-2 text-[12px] text-[hsl(var(--deck-ink-faint))]",children:s("history.search.scope")})]}),e.jsxs("div",{"data-history-scroll-viewport":!0,onScroll:C,className:"min-h-0 flex-1 overflow-auto rounded-xl border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas-veil))]",children:[e.jsx("div",{"data-history-older-sentinel":!0,"aria-hidden":"true",className:"h-px w-full"}),y.length===0?e.jsx("div",{className:"px-4 py-6 text-[12px] text-[hsl(var(--deck-ink-faint))]",children:s(h?"history.search.empty":"history.messages.empty")}):e.jsx("ol",{className:"divide-y divide-[hsl(var(--deck-border))]",children:y.map(r=>e.jsxs("li",{className:"px-4 py-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("div",{className:"font-mono text-[11px] uppercase tracking-[0.16em] text-[hsl(var(--deck-ink-faint))]",children:s(r.role==="user"?"history.role.user":"history.role.assistant")}),e.jsx("div",{className:"mt-1 font-mono text-[11px] text-[hsl(var(--deck-ink-faint))]",children:r.timestamp})]}),e.jsx(R,{text:r.content,label:s("history.action.copy",{id:r.id})})]}),e.jsx("pre",{className:"mt-3 whitespace-pre-wrap break-words font-mono text-[12px] leading-6 text-[hsl(var(--deck-ink))]",children:r.content})]},r.id))})]})]})}export{I as SessionHistorySurface};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as n,e as Qe,g as Kt,j as e}from"./vendor-react-DofNRwfy.js";import{c as nt,u as ge,
|
|
1
|
+
import{r as n,e as Qe,g as Kt,j as e}from"./vendor-react-DofNRwfy.js";import{c as nt,u as ge,p as Me,j as D,A as Ue,L as ne,U as ea,C as gt,Z as q,D as $e,e as Ie,$ as Je,g as Ke,X as He,a0 as ta,a1 as aa,n as _t,a2 as sa,a as Le,O as Ut,a3 as Pe,T as ze,a4 as bt,P as na,r as ra,x as la,a5 as oa,a6 as ia}from"./index-DEOQizD2.js";import{_ as ie,j as se,k as ke,l as ut,m as mt,n as zt}from"./vendor-radix-D6QrtXqd.js";import{P as We}from"./plus-CAQ3qlUJ.js";import{E as jt,A as Ht}from"./external-link-1IN2ZfaO.js";import{D as xt}from"./download-DXdsM18t.js";import{S as da}from"./ScrollArea-D71pJjgW.js";import{C as ca}from"./calendar-clock-BQOfNcCK.js";import{P as ua}from"./play-DGZdCyPk.js";import{P as pt}from"./pencil-pRZQVHFU.js";import{t as lt}from"./team-QZ9byb3E.js";import{_ as ma}from"./session-events-C5_Q0kZV.js";import{A as xa}from"./arrow-left-XNYfpUAb.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-
|
|
1
|
+
import{r as D,j as e}from"./vendor-react-DofNRwfy.js";import{S as ze}from"./ScrollArea-D71pJjgW.js";import{c as pe,l as mt,u as se,a as d,a0 as He,a1 as Qe,a2 as Ve,p as Xe,j as w,L as te,b as K,d as $,E as Se,r as kt,al as bt,C as vt,X as gt,A as Je,w as jt,R as yt,T as wt,m as Ye,ab as Re,U as We,M as Nt,a7 as Ze,a9 as et,am as St,aa as tt,s as be,an as st,V as Tt,ao as Ct,ad as Et,Y as At,I as Dt}from"./index-DEOQizD2.js";import{M as at,Z as G,_ as Pt}from"./session-events-C5_Q0kZV.js";import{A as nt}from"./archive-DndqAA2q.js";import{D as rt}from"./download-DXdsM18t.js";import{P as It}from"./pencil-pRZQVHFU.js";import{S as it}from"./settings-BPfzj_Vf.js";import{P as Oe}from"./plus-CAQ3qlUJ.js";import{T as ct}from"./terminal-CldJbdMr.js";import{C as Rt}from"./chevron-right-Cvq3LzHK.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as A,j as N,
|
|
1
|
+
import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as A,j as N,a7 as Ie,d as J,b as R,E as Pe,a8 as Le,a9 as q,aa as X,u as Fe,a as c,ab as L,ac as Re,ad as qe,z as Ee,D as Be,e as Ke,ae as Oe,g as $e,h as ze,U as G,s as He,A as ke,t as We,G as Qe,L as F,w as Ue,R as Ve}from"./index-DEOQizD2.js";import{_ as h,M as _e,Z}from"./session-events-C5_Q0kZV.js";import{A as fe,F as Ge}from"./folder-Bpq602dI.js";import{P as Ze}from"./plus-CAQ3qlUJ.js";import{T as Je}from"./terminal-CldJbdMr.js";import{S as Xe}from"./settings-BPfzj_Vf.js";import{C as Ye}from"./clock-3-CnxLS8cv.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -23,4 +23,4 @@ import{j as n,r as l}from"./vendor-react-DofNRwfy.js";import{c as A,j as N,a6 as
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
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};
|
|
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 Y(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=q(t,a);return E([Y(t),X(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(Y(t)),o=E(X(q(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=J(R(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=Fe(),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=>_e(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:Ze,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:Re,run:()=>{Z(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:Je,run:()=>{Z(c.getState())||B()}},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:Xe,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:qe,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]),W=s==="tasks"?v[f]??null:null,Q=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=R(e),d=J(i),x=q(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(!Z(c.getState())){I(null);try{const d=R(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"&&W?(e.preventDefault(),le(W)):e.key==="Enter"&&Q?(e.preventDefault(),me(Q)):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(G,{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":W?`task-switcher-result-${f}`:Q?`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=R(e),x=J(d),S=q(e,D),Me=X(S),he=He(d,O),U=i===f,Ae=Ce===x,De=z.includes(x),P=Y(e),pe=e.taskStatus==="running"||e.taskStatus==="queued",ue=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),V=Se.includes(x),_=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(We,{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(Ge,{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(Qe,{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(Ye,{className:"h-2.5 w-2.5"}),ot(e)]})]})]}),Ae?n.jsx(F,{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(F,{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(_?"session.action.retrying":"session.action.retry",{title:P}),disabled:_,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:_?n.jsx(F,{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(F,{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(G,{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(G,{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};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{r,j as a}from"./vendor-react-DofNRwfy.js";import{D as R,o as C,L as
|
|
1
|
+
import{r,j as a}from"./vendor-react-DofNRwfy.js";import{D as R,o as C,L as M}from"./vendor-xterm-DuYZoU4T.js";import{c as N,u as F,a as x,ak as T,j as p,X as W}from"./index-DEOQizD2.js";import{_ as I,Z as L,M as A}from"./session-events-C5_Q0kZV.js";import{T as D}from"./terminal-CldJbdMr.js";import"./vendor-radix-D6QrtXqd.js";/**
|
|
2
2
|
* @license lucide-react v0.300.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const G=
|
|
6
|
+
*/const G=N("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 M;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,16 @@
|
|
|
1
|
+
import{c as o}from"./index-DEOQizD2.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 e=o("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
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=o("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
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 a=o("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);export{e as A,a as C,t as a};
|