blade-code 0.10.64 → 0.10.66

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 (112) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/{chunk-wy4pn9sk.js → chunk-0j22w4wh.js} +1 -1
  3. package/dist/chunk-0qtrv97b.js +2 -0
  4. package/dist/chunk-0scxrkcf.js +1 -0
  5. package/dist/{chunk-2z3xe3rw.js → chunk-0wxkymqv.js} +1 -1
  6. package/dist/{chunk-egb457mv.js → chunk-1c69c4rd.js} +1 -1
  7. package/dist/{chunk-b19f55s7.js → chunk-1z9wct9w.js} +1 -1
  8. package/dist/chunk-2eq5dyga.js +1 -0
  9. package/dist/{chunk-0jxh2zq5.js → chunk-2kkpn41a.js} +2 -2
  10. package/dist/{chunk-pxy15vf3.js → chunk-2xk6m4fc.js} +12 -3
  11. package/dist/{chunk-81pdgcq7.js → chunk-30kmydfj.js} +2 -2
  12. package/dist/{chunk-z8heg5qv.js → chunk-4sztphe9.js} +1 -1
  13. package/dist/{chunk-6rg6mngq.js → chunk-50jthhfq.js} +1 -1
  14. package/dist/chunk-5147jh26.js +2 -0
  15. package/dist/{chunk-cm9mph7j.js → chunk-5d2cdvdy.js} +1 -1
  16. package/dist/chunk-69j98a7j.js +166 -0
  17. package/dist/{chunk-8ekk8pa7.js → chunk-6pyktfa4.js} +1 -1
  18. package/dist/chunk-89090tyx.js +1 -0
  19. package/dist/chunk-8c677xtx.js +1 -0
  20. package/dist/chunk-8nmwft1y.js +112 -0
  21. package/dist/{chunk-y8r2knxm.js → chunk-98n2rxmq.js} +2 -2
  22. package/dist/{chunk-pdys123h.js → chunk-a2594p5r.js} +1 -1
  23. package/dist/{chunk-2m7at619.js → chunk-a3xnd8cg.js} +2 -2
  24. package/dist/{chunk-7p0bzza4.js → chunk-abef6dq1.js} +2 -2
  25. package/dist/chunk-ax9ftraa.js +1 -0
  26. package/dist/{chunk-d9z0rbz1.js → chunk-b66veqye.js} +2 -2
  27. package/dist/{chunk-6g3qzz9h.js → chunk-bbcb9jzb.js} +1 -1
  28. package/dist/{chunk-3tednchw.js → chunk-bjqjdw34.js} +2 -2
  29. package/dist/chunk-c8zcyvss.js +1 -0
  30. package/dist/{chunk-detkh4dd.js → chunk-cdy9efgm.js} +1 -1
  31. package/dist/chunk-dc64v4sa.js +1 -0
  32. package/dist/{chunk-83wm4akj.js → chunk-dktrankr.js} +1 -1
  33. package/dist/chunk-e7pssnr9.js +1 -0
  34. package/dist/chunk-eq99gcj8.js +1 -0
  35. package/dist/{chunk-j9snkjpe.js → chunk-f99n8812.js} +2 -2
  36. package/dist/{chunk-gdrqxnzh.js → chunk-gezg1mpa.js} +1 -1
  37. package/dist/{chunk-khkhsaan.js → chunk-h0ft81a3.js} +1 -1
  38. package/dist/{chunk-rcv4q8hm.js → chunk-ha50z8dp.js} +1 -1
  39. package/dist/{chunk-d1t91jgz.js → chunk-hat9v5c5.js} +1 -1
  40. package/dist/{chunk-av10vmxk.js → chunk-hcv17986.js} +1 -1
  41. package/dist/{chunk-5g2p1fwn.js → chunk-j38jh128.js} +2 -2
  42. package/dist/chunk-jmjn6zcc.js +1 -0
  43. package/dist/{chunk-kjvntyr5.js → chunk-k0pa8874.js} +1 -1
  44. package/dist/{chunk-6fwh0m6d.js → chunk-k99r5c4v.js} +3 -3
  45. package/dist/chunk-kmarzy98.js +1 -0
  46. package/dist/chunk-kv0bkxhd.js +8 -0
  47. package/dist/{chunk-87jz5600.js → chunk-m57w4p91.js} +1 -1
  48. package/dist/{chunk-9zdx6jsh.js → chunk-nt55nz8d.js} +40 -40
  49. package/dist/chunk-p0b4mv7e.js +10 -0
  50. package/dist/{chunk-cz68x56m.js → chunk-ppsvzgs5.js} +2 -2
  51. package/dist/{chunk-3m640njb.js → chunk-pzb5sqwd.js} +1 -1
  52. package/dist/{chunk-wrw5hegj.js → chunk-q3mfescm.js} +2 -2
  53. package/dist/{chunk-wqewxnez.js → chunk-qdah5kkc.js} +246 -246
  54. package/dist/{chunk-as5z4m2d.js → chunk-rf01e14b.js} +1 -1
  55. package/dist/chunk-rhs1dv6w.js +1 -0
  56. package/dist/{chunk-jk8bqc5b.js → chunk-s7jsadnc.js} +2 -2
  57. package/dist/{chunk-ej6h16ae.js → chunk-t2gq918a.js} +2 -2
  58. package/dist/chunk-t89q7d03.js +22 -0
  59. package/dist/{chunk-fp1h8wdh.js → chunk-t8xmh4w2.js} +1 -1
  60. package/dist/{chunk-z2hmx0jz.js → chunk-te21eb71.js} +1 -1
  61. package/dist/{chunk-9r0yebs1.js → chunk-th4jjfgm.js} +1 -1
  62. package/dist/{chunk-7b467h8k.js → chunk-v0rsz1rt.js} +1 -1
  63. package/dist/{chunk-wt4wv5rb.js → chunk-w6p2hcfw.js} +1 -1
  64. package/dist/{chunk-rctbavme.js → chunk-xny9q252.js} +2 -2
  65. package/dist/chunk-xz6y0w4n.js +2 -0
  66. package/dist/{chunk-tcga95a4.js → chunk-ybv6stfh.js} +2 -2
  67. package/dist/{chunk-69rc9hw6.js → chunk-yn51162x.js} +1 -1
  68. package/dist/{chunk-1jc7d3nt.js → chunk-ypqp368c.js} +2 -2
  69. package/dist/{chunk-eeac8teg.js → chunk-yvg961q3.js} +1 -1
  70. package/dist/chunk-yy6h97k0.js +1 -0
  71. package/dist/chunk-zdxxqchm.js +140 -0
  72. package/dist/chunk-zk42hrdh.js +1 -0
  73. package/dist/{chunk-2xbmkyb2.js → chunk-zvz2cnt4.js} +1 -1
  74. package/dist/web/assets/{ChatView-B6IO9U-D.js → ChatView-BVrhnE2j.js} +6 -6
  75. package/dist/web/assets/{CodeBlockHighlighter-DVGtFQgX.js → CodeBlockHighlighter-Dy7QpAmC.js} +1 -1
  76. package/dist/web/assets/{FilePreview-C-8_o7yw.js → FilePreview-BI3nkxz1.js} +2 -2
  77. package/dist/web/assets/KanbanBoard-D5dYOyPH.js +1 -0
  78. package/dist/web/assets/{MarkdownRenderer-D04IKQhF.js → MarkdownRenderer-Da1vB81L.js} +12 -12
  79. package/dist/web/assets/{SettingsModal-BMoZLVEe.js → SettingsModal-jcCFqLqS.js} +2 -2
  80. package/dist/web/assets/TaskSwitcher-CQ--jOLB.js +1 -0
  81. package/dist/web/assets/{TerminalPanel-fTk9D5hU.js → TerminalPanel-CWzjEXOb.js} +1 -1
  82. package/dist/web/assets/index-BOgOL4hG.js +11 -0
  83. package/dist/web/assets/index-DbWgTuT3.css +1 -0
  84. package/dist/web/assets/{vendor-icons-ICv1v-tf.js → vendor-icons-B63aW_OM.js} +82 -62
  85. package/dist/web/index.html +3 -3
  86. package/package.json +2 -2
  87. package/dist/chunk-0d1197b9.js +0 -1
  88. package/dist/chunk-1vw79f30.js +0 -1
  89. package/dist/chunk-1wr6hrwt.js +0 -1
  90. package/dist/chunk-7781czcd.js +0 -1
  91. package/dist/chunk-86gc2mqb.js +0 -1
  92. package/dist/chunk-9c31jemm.js +0 -1
  93. package/dist/chunk-9kmtcgm6.js +0 -2
  94. package/dist/chunk-acfka6w7.js +0 -1
  95. package/dist/chunk-addsr9hg.js +0 -22
  96. package/dist/chunk-avhwgbg0.js +0 -1
  97. package/dist/chunk-bcp7nwwy.js +0 -10
  98. package/dist/chunk-bjz7t9fe.js +0 -8
  99. package/dist/chunk-dbs94h44.js +0 -1
  100. package/dist/chunk-g0n88mhg.js +0 -1
  101. package/dist/chunk-jy1e6ve5.js +0 -111
  102. package/dist/chunk-q8zp4je9.js +0 -1
  103. package/dist/chunk-qs4erqd0.js +0 -2
  104. package/dist/chunk-vjyysxhx.js +0 -1
  105. package/dist/chunk-wwsg165p.js +0 -116
  106. package/dist/chunk-wy2b5hsh.js +0 -2
  107. package/dist/chunk-xm44tqjb.js +0 -1
  108. package/dist/chunk-y78m734s.js +0 -204
  109. package/dist/chunk-y83x0w26.js +0 -1
  110. package/dist/web/assets/TaskSwitcher-CIuCEbvU.js +0 -1
  111. package/dist/web/assets/index-CO5sUiJn.js +0 -11
  112. package/dist/web/assets/index-Dxdnbd79.css +0 -1
@@ -1 +0,0 @@
1
- import{f as a,g as i,h as l,i as m}from"./chunk-bjz7t9fe.js";import"./chunk-83wm4akj.js";import"./chunk-eeac8teg.js";import"./chunk-pdys123h.js";import"./chunk-egb457mv.js";import"./chunk-wy2b5hsh.js";import"./chunk-wqewxnez.js";import"./chunk-3m640njb.js";import"./chunk-qs4erqd0.js";import"./chunk-y78m734s.js";import"./chunk-9r0yebs1.js";import"./chunk-jy1e6ve5.js";import"./chunk-2z3xe3rw.js";import"./chunk-wwsg165p.js";import{ed as n}from"./chunk-rctbavme.js";import"./chunk-3tednchw.js";import{Ad as s}from"./chunk-2m7at619.js";import"./chunk-v508x7cg.js";import"./chunk-wy4pn9sk.js";import"./chunk-0jxh2zq5.js";import"./chunk-j9snkjpe.js";import"./chunk-69rc9hw6.js";import"./chunk-d9z0rbz1.js";import"./chunk-pxy15vf3.js";import"./chunk-d1t91jgz.js";import"./chunk-detkh4dd.js";import"./chunk-2xbmkyb2.js";import"./chunk-6fwh0m6d.js";import"./chunk-87jz5600.js";import"./chunk-7p0bzza4.js";import"./chunk-khkhsaan.js";import"./chunk-7b467h8k.js";import"./chunk-9kmtcgm6.js";import"./chunk-kjvntyr5.js";import"./chunk-8ekk8pa7.js";import"./chunk-y8r2knxm.js";import"./chunk-1jc7d3nt.js";import"./chunk-fp1h8wdh.js";import"./chunk-5g2p1fwn.js";import"./chunk-ej6h16ae.js";import"./chunk-cm9mph7j.js";import"./chunk-cz68x56m.js";import"./chunk-av10vmxk.js";import v from"chalk";var C={command:"serve",describe:"Start a headless Blade server (no browser)",builder:a,handler:async(p)=>{let r=i(p);if(await s(),!process.env.BLADE_SERVER_PASSWORD)console.log(v.yellow("Warning: BLADE_SERVER_PASSWORD is not set; server is unsecured."));let e=await m.listenAsync(r);if(console.log(`Blade server listening on http://${e.hostname}:${e.port}`),r.hostname==="0.0.0.0"){let o=l();for(let g of o)console.log(` Network: http://${g}:${e.port}`)}let t,c=new Promise((o)=>{t=o}),d=n(async()=>{await e.stop(),t()});try{await c}finally{d(),await e.stop()}}};export{C as serveCommand};
@@ -1 +0,0 @@
1
- import{j as n,r as d}from"./vendor-react-DG5dkZ_t.js";import{j as N,y as Ce,d as G,c as L,z as Te,A as E,E as _,F as De,u as Ae,b as p,a as o,G as P,n as Ie,D as Fe,e as Pe,H as Re,g as Le,h as Ee,s as qe}from"./index-CO5sUiJn.js";import{ae as ue,i as Be,F as Me,j as Ke,h as Oe,af as $e,ag as We,o as Qe,ah as ze,ai as He,k as U,f as de,aj as Ue,U as Ge,ak as _e,G as Ve,al as Je,L as R,S as Xe,R as Ye}from"./vendor-icons-ICv1v-tf.js";import"./vendor-radix-DXRuAJHH.js";import"./session-events-BvtUOaNG.js";function Ze(t,r){const s=r.trim().toLocaleLowerCase();return s?t.filter(i=>`${i.label} ${i.description} ${i.keywords}`.toLocaleLowerCase().includes(s)):t}function et({actions:t,selectedIndex:r,onSelect:s,onRun:i}){return t.map((c,h)=>{const k=h===r,m=c.icon;return n.jsx("div",{id:`command-center-result-${h}`,"data-task-result-index":h,role:"option","aria-selected":k,onMouseEnter:()=>s(h),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:()=>i(c),className:"flex min-h-[58px] min-w-0 flex-1 items-center gap-3 px-3 py-2 text-left focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-[hsl(var(--deck-accent))]",children:[n.jsx("span",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] text-[hsl(var(--deck-accent))]",children:n.jsx(m,{className:"h-3.5 w-3.5"})}),n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate font-mono text-[12.5px] font-medium text-[hsl(var(--deck-ink))]",children:c.label}),n.jsx("span",{className:"mt-0.5 block truncate text-[10.5px] text-[hsl(var(--deck-ink-faint))]",children:c.description})]}),c.shortcut&&n.jsx("span",{className:"shrink-0 rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-canvas))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:c.shortcut}),n.jsx(ue,{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")})]})},c.id)})}const tt={running:"running active 进行中 运行中",queued:"queued waiting 排队中 等待中",interrupted:"interrupted paused 已暂停 已中断",failed:"failed error 已失败 错误",cancelled:"cancelled canceled 已取消",completed:"completed done finished 已完成 完成"};function V(t){return Te(t,De)}function nt(t){const r=t.lastMessageTime||t.firstMessageTime;if(!r)return"";const s=new Date(r);return Number.isNaN(s.getTime())?"":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(s)}function q(t){return t.normalize("NFKC").toLocaleLowerCase().trim()}function st(t,r){var i,c;const s=E(t,r);return q([V(t),_(s),s,t.projectPath,t.gitBranch,t.taskWorktreeBranch,t.taskStatus,tt[t.taskStatus],((i=t.pendingInteraction)==null?void 0:i.type)==="question"?"needs answer question attention 等待回答 需要回答":((c=t.pendingInteraction)==null?void 0:c.type)==="elicitation"?"mcp input elicitation attention MCP 输入 等待输入":t.pendingInteraction?"needs approval permission attention 等待审批 需要授权":"",t.sessionId].filter(Boolean).join(" "))}function me(t,r,s){if(!r)return 0;const i=q(V(t)),c=q(_(E(t,s)));return i===r?500:i.startsWith(r)?400:i.includes(r)?300:c===r?250:c.startsWith(r)?200:100}function at(t,r,s,i=50){const c=q(r),h=c.split(/\s+/).filter(Boolean),k=new Set;return t.filter(m=>{if(h.length===0)return!0;const u=st(m,s);return h.every(g=>u.includes(g))}).sort((m,u)=>{const g=+!!u.pendingInteraction-+!!m.pendingInteraction;return g!==0?g:me(u,c,s)-me(m,c,s)||Ce(m,u)}).filter(m=>{const u=G(L(m));return k.has(u)?!1:(k.add(u),!0)}).slice(0,i)}const rt={running:"sidebar.group.running",queued:"sidebar.group.queued",interrupted:"sidebar.group.interrupted",failed:"sidebar.group.failed",cancelled:"sidebar.group.cancelled",completed:"sidebar.group.done"};function mt(){const t=Ae(),r=p(e=>e.isTaskSwitcherOpen),s=p(e=>e.taskSwitcherMode),i=p(e=>e.setTaskSwitcherOpen),c=p(e=>e.setTaskSwitcherMode),h=p(e=>e.toggleSidebar),k=p(e=>e.isFilePreviewOpen),m=p(e=>e.setFilePreviewOpen),u=p(e=>e.openFilePreview),g=p(e=>e.toggleTerminal),b=p(e=>e.openSettings),v=o(e=>e.sessions),pe=o(e=>e.isLoading),C=o(e=>e.catalogLoadState),B=C==="loading"||C==="hydrating",M=o(e=>e.currentSessionRef),J=o(e=>e.isTemporarySession),X=o(e=>e.startTemporarySession),K=o(e=>e.unreadTaskKeys),he=o(e=>e.boundProjects),A=o(e=>{var a;return e.selectedProjectPath??((a=e.taskWorkspaceInfo)==null?void 0:a.cwd)??null}),ke=o(e=>e.selectProject),xe=o(e=>e.selectSession),fe=o(e=>e.cancelTask),ge=o(e=>e.retryTask),be=o(e=>e.cancellingTaskKeys),ve=o(e=>e.retryingTaskKeys),[w,Y]=d.useState(""),[f,j]=d.useState(0),[we,O]=d.useState(null),[Z,I]=d.useState(null),ee=d.useRef(null),te=d.useRef(null),ne=d.useMemo(()=>[{id:"new-task",label:t("commandCenter.action.newTask"),description:t("commandCenter.action.newTaskDescription"),keywords:"create compose session",icon:Be,shortcut:P("newTask"),run:()=>{X(),requestAnimationFrame(()=>Ie())}},{id:"toggle-preview",label:t("commandCenter.action.preview"),description:t("commandCenter.action.previewDescription"),keywords:"diff files logs artifact review",icon:Me,run:()=>{k?m(!1):u((!M||J)&&p.getState().previewRequestId===0?{tab:"files"}:void 0)}},{id:"toggle-terminal",label:t("commandCenter.action.terminal"),description:t("commandCenter.action.terminalDescription"),keywords:"shell console command line",icon:Ke,run:g},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:Oe,run:()=>b("general")},{id:"open-models",label:t("commandCenter.action.models"),description:t("commandCenter.action.modelsDescription"),keywords:"provider llm api configuration",icon:$e,run:()=>b("models")},{id:"open-shortcuts",label:t("commandCenter.action.shortcuts"),description:t("commandCenter.action.shortcutsDescription"),keywords:"keyboard hotkey key binding",icon:We,shortcut:P("openCommands"),run:()=>b("shortcuts")},{id:"open-skills",label:t("commandCenter.action.skills"),description:t("commandCenter.action.skillsDescription"),keywords:"capabilities workflow",icon:Qe,run:()=>b("skills")},{id:"open-mcp",label:t("commandCenter.action.mcp"),description:t("commandCenter.action.mcpDescription"),keywords:"server tools protocol integration",icon:ze,run:()=>b("mcp")},{id:"toggle-sidebar",label:t("commandCenter.action.sidebar"),description:t("commandCenter.action.sidebarDescription"),keywords:"navigation layout panel projects",icon:He,shortcut:P("toggleSidebar"),run:h}],[M,k,J,u,b,m,X,t,h,g]),y=d.useMemo(()=>at(v,w,A),[A,w,v]),T=d.useMemo(()=>Ze(ne,w),[ne,w]),D=s==="tasks"?y.length:T.length,se=d.useMemo(()=>v.filter(e=>!!e.pendingInteraction).length,[v]),$=s==="tasks"?y[f]??null:null,W=s==="commands"?T[f]??null:null;d.useEffect(()=>{r&&(Y(""),j(0),O(null),I(null))},[s,r]),d.useEffect(()=>{j(0)},[w]),d.useEffect(()=>{var a,l;const e=(a=te.current)==null?void 0:a.querySelector(`[data-task-result-index="${f}"]`);(l=e==null?void 0:e.scrollIntoView)==null||l.call(e,{block:"nearest"})},[f]);const ae=async e=>{const a=L(e),l=G(a),x=E(e,A);O(l),he.some(S=>S.path===x)&&ke(x);try{await xe(a),i(!1)}catch(S){I(S instanceof Error?S.message:t("taskSwitcher.action.failed"))}finally{O(null)}},re=async(e,a)=>{I(null);try{const l=L(a);e==="cancel"?await fe(l):(await ge(l),i(!1))}catch(l){I(l instanceof Error?l.message:t("taskSwitcher.action.failed"))}},ie=e=>{i(!1),requestAnimationFrame(e.run)},ye=e=>{e.key==="ArrowDown"?(e.preventDefault(),j(a=>D===0?0:(a+1)%D)):e.key==="ArrowUp"?(e.preventDefault(),j(a=>D===0?0:(a-1+D)%D)):e.key==="Enter"&&$?(e.preventDefault(),ae($)):e.key==="Enter"&&W?(e.preventDefault(),ie(W)):e.key==="Escape"&&(e.preventDefault(),i(!1))};return n.jsx(Fe,{open:r,onOpenChange:i,children:n.jsxs(Pe,{hideCloseButton:!0,onCloseAutoFocus:Re,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(Le,{className:"sr-only",children:t("commandCenter.title")}),n.jsx(Ee,{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(U,{className:"h-4 w-4 shrink-0 text-[hsl(var(--deck-accent))]"}),n.jsx("input",{ref:ee,autoFocus:!0,role:"combobox","aria-expanded":"true","aria-controls":"task-switcher-results","aria-activedescendant":$?`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:w,onChange:e=>Y(e.target.value),onKeyDown:ye,className:"h-full min-w-0 flex-1 bg-transparent font-mono text-[14px] text-[hsl(var(--deck-ink))] outline-none placeholder:text-[hsl(var(--deck-ink-faint))]"}),n.jsx("span",{className:"rounded border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] px-1.5 py-0.5 font-mono text-[9px] text-[hsl(var(--deck-ink-faint))]",children:"ESC"})]}),n.jsxs("div",{className:"flex items-center justify-between gap-3 px-4 pb-2 pt-3",children:[n.jsx("div",{role:"tablist","aria-label":t("commandCenter.modeAria"),className:"flex items-center gap-0.5 rounded-md border border-[hsl(var(--deck-border))] bg-[hsl(var(--deck-surface))] p-0.5",children:["tasks","commands"].map(e=>n.jsx("button",{type:"button",role:"tab","aria-selected":s===e,onClick:()=>{c(e),requestAnimationFrame(()=>{var a;return(a=ee.current)==null?void 0:a.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}):w?t("taskSwitcher.results",{count:y.length}):B?v.length===0?t("taskSwitcher.indexing"):t("taskSwitcher.indexingLoaded",{count:v.length}):C==="error"?t("sidebar.catalog.incomplete"):se>0?t("taskSwitcher.needsAction",{count:se}):K.length>0?t("taskSwitcher.unread",{count:K.length}):t("taskSwitcher.scope",{count:v.length})})})]}),Z&&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:Z}),n.jsxs("div",{id:"task-switcher-results",ref:te,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(et,{actions:T,selectedIndex:f,onSelect:j,onRun:ie}),s==="tasks"&&y.map((e,a)=>{const l=L(e),x=G(l),S=E(e,A),je=_(S),ce=qe(l,M),Q=a===f,Se=we===x,Ne=K.includes(x),F=V(e),oe=e.taskStatus==="running"||e.taskStatus==="queued",le=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),z=be.includes(x),H=ve.includes(x);return n.jsxs("div",{id:`task-switcher-result-${a}`,"data-task-result-index":a,"data-session-ref":x,role:"option","aria-selected":Q,onMouseEnter:()=>j(a),className:N("group flex min-h-[68px] w-full items-center rounded-lg border border-transparent text-left transition-colors",Q?"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 ae(e),"aria-label":t("session.action.select",{title:F}),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))]",ce?"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(de,{className:"h-3.5 w-3.5 animate-pulse text-amber-600 dark:text-amber-400"}):e.taskStatus==="running"?n.jsx(Ue,{className:"h-3.5 w-3.5 animate-pulse"}):n.jsx(Ge,{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:F}),ce&&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")}),Ne&&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:je})]}),(e.taskWorktreeBranch||e.gitBranch)&&n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(Ve,{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(rt[e.taskStatus])}),n.jsxs("span",{className:"ml-auto inline-flex shrink-0 items-center gap-1",children:[n.jsx(Je,{className:"h-2.5 w-2.5"}),nt(e)]})]})]}),Se?n.jsx(R,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}):n.jsx(ue,{className:N("h-3.5 w-3.5 shrink-0 transition-all",Q?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]}),(oe||le)&&n.jsxs("div",{className:"flex shrink-0 items-center pr-2",children:[oe&&n.jsx("button",{type:"button","aria-label":t(z?"session.action.stopping":"session.action.stop",{title:F}),disabled:z,onClick:()=>void re("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:z?n.jsx(R,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Xe,{className:"h-3.5 w-3.5"})}),le&&n.jsx("button",{type:"button","aria-label":t(H?"session.action.retrying":"session.action.retry",{title:F}),disabled:H,onClick:()=>void re("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:H?n.jsx(R,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ye,{className:"h-3.5 w-3.5"})})]})]},x)}),s==="tasks"&&y.length===0&&B&&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(R,{className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("taskSwitcher.indexing")]}),s==="tasks"&&y.length===0&&!B&&C!=="error"&&!pe&&n.jsxs("div",{className:"flex min-h-36 flex-col items-center justify-center px-6 text-center",children:[n.jsx(U,{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"&&y.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(de,{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(U,{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:[P(s==="tasks"?"openCommands":"searchTasks")," ",t(s==="tasks"?"commandCenter.mode.commands":"commandCenter.mode.tasks")]})]})]})})}export{mt as TaskSwitcher};