blade-code 0.10.158 → 0.10.159

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/{chunk-6zzet05f.js → chunk-0bqt0wgm.js} +1 -1
  3. package/dist/chunk-1ms4x6yd.js +1 -0
  4. package/dist/{chunk-7z31ajj4.js → chunk-2z9hxxw9.js} +1 -1
  5. package/dist/{chunk-xh3bm0p0.js → chunk-5w1bzrx1.js} +1 -1
  6. package/dist/{chunk-ccsgzyth.js → chunk-67pa42n8.js} +1 -1
  7. package/dist/{chunk-6htg4eyc.js → chunk-74yxkkne.js} +1 -1
  8. package/dist/{chunk-bgc4wts7.js → chunk-9c0yfd4s.js} +1 -1
  9. package/dist/{chunk-a9fjtdsh.js → chunk-age2q38q.js} +1 -1
  10. package/dist/{chunk-479y73j2.js → chunk-aka7w2bf.js} +1 -1
  11. package/dist/{chunk-xxd3vx1j.js → chunk-asjbhtpk.js} +1 -1
  12. package/dist/{chunk-95z104ay.js → chunk-b17d67gc.js} +2 -2
  13. package/dist/{chunk-jdmm68kd.js → chunk-cwk0r8wh.js} +1 -1
  14. package/dist/{chunk-1329rzdd.js → chunk-dc2p24y5.js} +1 -1
  15. package/dist/{chunk-v7b7dx9j.js → chunk-dd4gev98.js} +1 -1
  16. package/dist/{chunk-vs8ywzme.js → chunk-es4aaeqw.js} +1 -1
  17. package/dist/{chunk-26109k8r.js → chunk-f97vk8pq.js} +1 -1
  18. package/dist/{chunk-thveee78.js → chunk-fszezcm7.js} +1 -1
  19. package/dist/{chunk-f6wx6sf2.js → chunk-g6v3ff0v.js} +1 -1
  20. package/dist/{chunk-ehdsj506.js → chunk-gfr6qac3.js} +3 -3
  21. package/dist/{chunk-jxxvc3b0.js → chunk-gjd5f281.js} +1 -1
  22. package/dist/{chunk-jcq3tk8c.js → chunk-kp77mfmv.js} +1 -1
  23. package/dist/{chunk-tfebp09g.js → chunk-kvgxt3sw.js} +1 -1
  24. package/dist/{chunk-kxz7j4a3.js → chunk-kzrd648a.js} +1 -1
  25. package/dist/chunk-n42cnhzv.js +1 -0
  26. package/dist/{chunk-fp7ssc21.js → chunk-qq308eks.js} +1 -1
  27. package/dist/{chunk-25z7w7jb.js → chunk-smkxpfnk.js} +1 -1
  28. package/dist/{chunk-7h3405ty.js → chunk-spyyvqq4.js} +1 -1
  29. package/dist/{chunk-pnfeyw0g.js → chunk-t8w6s1te.js} +1 -1
  30. package/dist/{chunk-mm5rqxam.js → chunk-vbb7tn8t.js} +1 -1
  31. package/dist/{chunk-p5k6x3be.js → chunk-vbgb5j6x.js} +1 -1
  32. package/dist/{chunk-gnjsdr40.js → chunk-w1h35604.js} +1 -1
  33. package/dist/{chunk-pz0d6ne3.js → chunk-w1x8d19a.js} +1 -1
  34. package/dist/{chunk-hamdqef9.js → chunk-wxtb8n1j.js} +1 -1
  35. package/dist/{chunk-4gsjcz7t.js → chunk-xxktawex.js} +1 -1
  36. package/dist/{chunk-vg6m8ybn.js → chunk-y72z40kh.js} +1 -1
  37. package/dist/{chunk-vq1myd58.js → chunk-yb72nbfx.js} +1 -1
  38. package/dist/{chunk-y1t2tvmq.js → chunk-yd2qz6ts.js} +1 -1
  39. package/dist/{chunk-ej0a0s1t.js → chunk-z7m4yh1n.js} +1 -1
  40. package/dist/web/assets/{ChatView-D9Rgy4Xd.js → ChatView-DYpMrwtA.js} +4 -4
  41. package/dist/web/assets/{CodeBlockHighlighter-D2xmVZ64.js → CodeBlockHighlighter-BpPOUcO7.js} +1 -1
  42. package/dist/web/assets/{FilePreview-DNvYgNjf.js → FilePreview-DXGkgNrQ.js} +1 -1
  43. package/dist/web/assets/{KanbanBoard-DHsb2qNL.js → KanbanBoard-MYvqGgQH.js} +1 -1
  44. package/dist/web/assets/{MarkdownRenderer-DaQIOCqh.js → MarkdownRenderer-CXDrI3kX.js} +3 -3
  45. package/dist/web/assets/{ScrollArea-CMTG2oYB.js → ScrollArea-DocDa_rN.js} +1 -1
  46. package/dist/web/assets/{SessionHistorySurface-B5W8o5Ac.js → SessionHistorySurface-D4Hxlpnr.js} +1 -1
  47. package/dist/web/assets/{SettingsModal-CoIGqfB8.js → SettingsModal-ROSA92Eo.js} +1 -1
  48. package/dist/web/assets/{Sidebar-Bp-rTtWG.js → Sidebar-ByhqdRdj.js} +1 -1
  49. package/dist/web/assets/TaskSwitcher-Dbo20Tim.js +26 -0
  50. package/dist/web/assets/{TerminalPanel-1SkToIB-.js → TerminalPanel-czvVuMgl.js} +1 -1
  51. package/dist/web/assets/{archive-VQ-zwIBp.js → archive-BwNnCDDQ.js} +1 -1
  52. package/dist/web/assets/{arrow-left-CNl5Vg6X.js → arrow-left-Dc9lvaeD.js} +1 -1
  53. package/dist/web/assets/{calendar-clock-B_VagIW-.js → calendar-clock-o0GyQ0Np.js} +1 -1
  54. package/dist/web/assets/{chevron-right-rbUP1NBz.js → chevron-right-CgHjrrmB.js} +1 -1
  55. package/dist/web/assets/{chevrons-up-down-DSWrXgFD.js → chevrons-up-down-zQ_UZWV9.js} +1 -1
  56. package/dist/web/assets/{clock-3-B7G3JFdh.js → clock-3-BB58ITKo.js} +1 -1
  57. package/dist/web/assets/{copy-BSAC3Lqd.js → copy-o_KiXkAh.js} +1 -1
  58. package/dist/web/assets/{download-Da_UuSK6.js → download-BBtK3WHk.js} +1 -1
  59. package/dist/web/assets/{external-link-RaJbv6zJ.js → external-link-smSBd9oE.js} +1 -1
  60. package/dist/web/assets/{folder-BDc_dntN.js → folder-BJP6kIlC.js} +1 -1
  61. package/dist/web/assets/{index-Cqil5mhT.js → index-pqMcowCZ.js} +3 -3
  62. package/dist/web/assets/{pause-DcqIkSCj.js → pause-yqaK1hvk.js} +1 -1
  63. package/dist/web/assets/{pencil-CuEcqcGd.js → pencil-BZbDnyg2.js} +1 -1
  64. package/dist/web/assets/{play-D-6oneXl.js → play-WQ7288Ky.js} +1 -1
  65. package/dist/web/assets/{plus-BszxRz9B.js → plus-veQ2IAZx.js} +1 -1
  66. package/dist/web/assets/{settings-C2nXcRY-.js → settings-B8xvrdSb.js} +1 -1
  67. package/dist/web/assets/{team-CWZp-rb4.js → team-BrF46S7E.js} +1 -1
  68. package/dist/web/assets/{teamService-Dyi2wFpb.js → teamService-fDnXqw4L.js} +1 -1
  69. package/dist/web/assets/{terminal-ZQmTPaBq.js → terminal-BrqsCKf2.js} +1 -1
  70. package/dist/web/index.html +1 -1
  71. package/package.json +1 -1
  72. package/dist/chunk-5kb1dh44.js +0 -1
  73. package/dist/chunk-9hmjg0k7.js +0 -1
  74. package/dist/web/assets/TaskSwitcher-BHlCaj6w.js +0 -26
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cqil5mhT.js";/**
1
+ import{c as e}from"./index-pqMcowCZ.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{c as e}from"./index-Cqil5mhT.js";/**
1
+ import{c as e}from"./index-pqMcowCZ.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{c as o}from"./index-Cqil5mhT.js";/**
1
+ import{c as o}from"./index-pqMcowCZ.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{c as e}from"./index-Cqil5mhT.js";/**
1
+ import{c as e}from"./index-pqMcowCZ.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{c as a}from"./index-Cqil5mhT.js";/**
1
+ import{c as a}from"./index-pqMcowCZ.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{c as s}from"./index-Cqil5mhT.js";/**
1
+ import{c as s}from"./index-pqMcowCZ.js";/**
2
2
  * @license lucide-react v0.300.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a6 as e,T as t,a7 as r,p as m}from"./session-events-Dwyp0AVI.js";import{Z as s}from"./index-Cqil5mhT.js";import"./vendor-react-DofNRwfy.js";import"./vendor-radix-D6QrtXqd.js";const p=e(t.Object({id:t.String(),name:t.String(),subagentType:t.String(),description:t.String(),agentId:t.Optional(t.String()),status:r(["leader","running","completed","failed","cancelled","unknown"]),result:t.Optional(t.Unknown()),stats:t.Optional(t.Unknown()),worktreePath:t.Optional(t.String())})),d=e(t.Object({id:t.String(),subject:t.String(),description:t.String(),status:r(["pending","blocked","running","completed"]),owner:t.Optional(t.String()),priority:r(["high","medium","low"]),dependsOn:t.Array(t.String()),blocks:t.Array(t.String()),result:t.Optional(t.String()),createdAt:t.String(),startedAt:t.Optional(t.String()),completedAt:t.Optional(t.String())})),o=e(t.Object({name:t.String(),description:t.Optional(t.String()),status:r(["idle","running","completed","failed","deleted"]),leadAgentId:t.String(),leadSessionId:t.Optional(t.String()),workspaceRoot:t.Optional(t.String()),peerMessagingEnabled:t.Boolean(),createdAt:t.Number(),updatedAt:t.Number(),deletedAt:t.Optional(t.Number()),members:t.Array(p),tasks:t.Array(d)}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),name:t.String({minLength:1}),description:t.Optional(t.String()),leadAgentType:t.Optional(t.String()),peerMessagingEnabled:t.Optional(t.Boolean()),members:t.Array(t.Object({name:t.String({minLength:1}),subagentType:t.String({minLength:1}),description:t.Optional(t.String()),prompt:t.String({minLength:10,maxLength:32*1024})}),{maxItems:32}),tasks:t.Optional(t.Array(t.Object({subject:t.String({minLength:1}),description:t.String({minLength:1}),dependsOn:t.Optional(t.Array(t.String())),assignedTo:t.Optional(t.String()),priority:t.Optional(r(["high","medium","low"]))}),{maxItems:256}))}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),to:t.String({minLength:1}),message:t.String({minLength:1,maxLength:32*1024})}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),memberId:t.String({minLength:1})}));const S=t.Array(o),u={list:async n=>{const i=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return m(S,await s(`/teams?${i.toString()}`))},sendMessage:async(n,i,a,g)=>{await s(`/teams/${encodeURIComponent(i)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n.sessionId,projectPath:n.projectPath,to:a,message:g})})},delete:async(n,i)=>{const a=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return o.parse(await s(`/teams/${encodeURIComponent(i)}?${a.toString()}`,{method:"DELETE"}))}};export{u as teamService};
1
+ import{a6 as e,T as t,a7 as r,p as m}from"./session-events-Dwyp0AVI.js";import{Z as s}from"./index-pqMcowCZ.js";import"./vendor-react-DofNRwfy.js";import"./vendor-radix-D6QrtXqd.js";const p=e(t.Object({id:t.String(),name:t.String(),subagentType:t.String(),description:t.String(),agentId:t.Optional(t.String()),status:r(["leader","running","completed","failed","cancelled","unknown"]),result:t.Optional(t.Unknown()),stats:t.Optional(t.Unknown()),worktreePath:t.Optional(t.String())})),d=e(t.Object({id:t.String(),subject:t.String(),description:t.String(),status:r(["pending","blocked","running","completed"]),owner:t.Optional(t.String()),priority:r(["high","medium","low"]),dependsOn:t.Array(t.String()),blocks:t.Array(t.String()),result:t.Optional(t.String()),createdAt:t.String(),startedAt:t.Optional(t.String()),completedAt:t.Optional(t.String())})),o=e(t.Object({name:t.String(),description:t.Optional(t.String()),status:r(["idle","running","completed","failed","deleted"]),leadAgentId:t.String(),leadSessionId:t.Optional(t.String()),workspaceRoot:t.Optional(t.String()),peerMessagingEnabled:t.Boolean(),createdAt:t.Number(),updatedAt:t.Number(),deletedAt:t.Optional(t.Number()),members:t.Array(p),tasks:t.Array(d)}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),name:t.String({minLength:1}),description:t.Optional(t.String()),leadAgentType:t.Optional(t.String()),peerMessagingEnabled:t.Optional(t.Boolean()),members:t.Array(t.Object({name:t.String({minLength:1}),subagentType:t.String({minLength:1}),description:t.Optional(t.String()),prompt:t.String({minLength:10,maxLength:32*1024})}),{maxItems:32}),tasks:t.Optional(t.Array(t.Object({subject:t.String({minLength:1}),description:t.String({minLength:1}),dependsOn:t.Optional(t.Array(t.String())),assignedTo:t.Optional(t.String()),priority:t.Optional(r(["high","medium","low"]))}),{maxItems:256}))}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),to:t.String({minLength:1}),message:t.String({minLength:1,maxLength:32*1024})}));e(t.Object({sessionId:t.String({minLength:1}),projectPath:t.String({minLength:1}),memberId:t.String({minLength:1})}));const S=t.Array(o),u={list:async n=>{const i=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return m(S,await s(`/teams?${i.toString()}`))},sendMessage:async(n,i,a,g)=>{await s(`/teams/${encodeURIComponent(i)}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:n.sessionId,projectPath:n.projectPath,to:a,message:g})})},delete:async(n,i)=>{const a=new URLSearchParams({sessionId:n.sessionId,projectPath:n.projectPath});return o.parse(await s(`/teams/${encodeURIComponent(i)}?${a.toString()}`,{method:"DELETE"}))}};export{u as teamService};
@@ -1,4 +1,4 @@
1
- import{c as e}from"./index-Cqil5mhT.js";/**
1
+ import{c as e}from"./index-pqMcowCZ.js";/**
2
2
  * @license lucide-react v0.300.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>BladeCode</title>
8
- <script type="module" crossorigin src="/assets/index-Cqil5mhT.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-pqMcowCZ.js"></script>
9
9
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-DofNRwfy.js">
10
10
  <link rel="modulepreload" crossorigin href="/assets/vendor-radix-D6QrtXqd.js">
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-RGoMvYl5.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blade-code",
3
- "version": "0.10.158",
3
+ "version": "0.10.159",
4
4
  "private": false,
5
5
  "description": "🗡️ Blade Code - 智能代码助手命令行工具",
6
6
  "type": "module",
@@ -1 +0,0 @@
1
- import{qf as a,rf as b}from"./chunk-hamdqef9.js";import"./chunk-xh3bm0p0.js";import"./chunk-sdapqhj0.js";export{a as globalOptions,b as cliConfig};
@@ -1 +0,0 @@
1
- import{k as a,l as b,m as c,n as d,o as e}from"./chunk-ej0a0s1t.js";import"./chunk-xh3bm0p0.js";import"./chunk-sdapqhj0.js";export{b as setSkipUntilVersion,d as performUpgrade,c as getUpgradeCommand,e as checkVersionOnStartup,a as checkVersion};
@@ -1,26 +0,0 @@
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-Cqil5mhT.js";import{_ as h,M as _e,Z}from"./session-events-Dwyp0AVI.js";import{A as fe,F as Ge}from"./folder-BDc_dntN.js";import{P as Ze}from"./plus-BszxRz9B.js";import{T as Je}from"./terminal-ZQmTPaBq.js";import{S as Xe}from"./settings-C2nXcRY-.js";import{C as Ye}from"./clock-3-B7G3JFdh.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 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};