blade-code 0.10.65 → 0.10.67

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 (107) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/{chunk-9ebwtazz.js → chunk-0aja46wq.js} +1 -1
  3. package/dist/{chunk-czb954vz.js → chunk-0j22w4wh.js} +1 -1
  4. package/dist/{chunk-eg5mh9m9.js → chunk-0wxkymqv.js} +1 -1
  5. package/dist/{chunk-ca5mm1gk.js → chunk-1z9wct9w.js} +1 -1
  6. package/dist/{chunk-57gp2px5.js → chunk-2a9rndk2.js} +1 -1
  7. package/dist/{chunk-h127mgg2.js → chunk-2kkpn41a.js} +2 -2
  8. package/dist/{chunk-yrtmkb4a.js → chunk-2wz3mf50.js} +1 -1
  9. package/dist/chunk-37g8mh93.js +1 -0
  10. package/dist/{chunk-ka2kn5bs.js → chunk-38x7njj5.js} +2 -2
  11. package/dist/chunk-3j8q6yrf.js +1 -0
  12. package/dist/{chunk-5qaacj3x.js → chunk-50jthhfq.js} +1 -1
  13. package/dist/{chunk-ky32s7az.js → chunk-5147jh26.js} +1 -1
  14. package/dist/{chunk-rabt8yyf.js → chunk-53xbkvk1.js} +2 -2
  15. package/dist/{chunk-aphcj8rz.js → chunk-5d2cdvdy.js} +1 -1
  16. package/dist/{chunk-wzkr0p09.js → chunk-5kz804w9.js} +2 -2
  17. package/dist/{chunk-s16x4qkb.js → chunk-696t7mzc.js} +1 -1
  18. package/dist/{chunk-e11kmyt3.js → chunk-6am7zz57.js} +1 -1
  19. package/dist/{chunk-ngmajm4h.js → chunk-6pyktfa4.js} +1 -1
  20. package/dist/chunk-7agkmjm7.js +1 -0
  21. package/dist/{chunk-015t2dey.js → chunk-7pxpwkeg.js} +1 -1
  22. package/dist/{chunk-rd7jwwse.js → chunk-8mr5vydg.js} +1 -1
  23. package/dist/chunk-8t2xknh6.js +1 -0
  24. package/dist/{chunk-1vt7e9e7.js → chunk-98n2rxmq.js} +2 -2
  25. package/dist/{chunk-zpwasxzh.js → chunk-amaxww4b.js} +2 -2
  26. package/dist/{chunk-a1m7wr7r.js → chunk-bbcb9jzb.js} +1 -1
  27. package/dist/{chunk-5gjqdbxb.js → chunk-bjqjdw34.js} +2 -2
  28. package/dist/{chunk-hbbpe5f0.js → chunk-cdy9efgm.js} +1 -1
  29. package/dist/chunk-cn9jekw9.js +1 -0
  30. package/dist/{chunk-s1xp6g8m.js → chunk-dktrankr.js} +1 -1
  31. package/dist/chunk-e7pssnr9.js +1 -0
  32. package/dist/chunk-eq99gcj8.js +1 -0
  33. package/dist/{chunk-5ntrhs8k.js → chunk-eqqxr26g.js} +1 -1
  34. package/dist/{chunk-y51v2jvh.js → chunk-f99n8812.js} +2 -2
  35. package/dist/chunk-fs6ashcf.js +1 -0
  36. package/dist/chunk-gak96awp.js +22 -0
  37. package/dist/{chunk-98qmtexa.js → chunk-gayy8vky.js} +243 -243
  38. package/dist/chunk-gn3fxtkj.js +1 -0
  39. package/dist/chunk-gvxpdb2v.js +1 -0
  40. package/dist/{chunk-1jm8njkw.js → chunk-h0ft81a3.js} +1 -1
  41. package/dist/{chunk-k4t45b64.js → chunk-hat9v5c5.js} +1 -1
  42. package/dist/{chunk-arzhhj0e.js → chunk-hcv17986.js} +1 -1
  43. package/dist/{chunk-d39xaa7w.js → chunk-k0pa8874.js} +1 -1
  44. package/dist/{chunk-j6w1vf2q.js → chunk-k5a3n7q5.js} +12 -3
  45. package/dist/chunk-kccs7c9r.js +10 -0
  46. package/dist/chunk-kmarzy98.js +1 -0
  47. package/dist/{chunk-2yxdneb9.js → chunk-m57w4p91.js} +1 -1
  48. package/dist/{chunk-svczh6hn.js → chunk-nacssmem.js} +2 -2
  49. package/dist/{chunk-tb4jmrkp.js → chunk-nrh7qjat.js} +1 -1
  50. package/dist/{chunk-pfmmvpfh.js → chunk-p0gyfy9p.js} +3 -3
  51. package/dist/{chunk-9yvw5xy3.js → chunk-pf6ftbra.js} +2 -2
  52. package/dist/{chunk-6tacv9rs.js → chunk-ppsvzgs5.js} +2 -2
  53. package/dist/{chunk-4t89y8nj.js → chunk-pv576mrv.js} +40 -40
  54. package/dist/{chunk-m6a1c1tg.js → chunk-rbdd49vr.js} +1 -1
  55. package/dist/{chunk-53tb8vvv.js → chunk-s7jsadnc.js} +2 -2
  56. package/dist/{chunk-793067rd.js → chunk-t2gq918a.js} +2 -2
  57. package/dist/{chunk-gafk33py.js → chunk-t8xmh4w2.js} +1 -1
  58. package/dist/{chunk-sbpb7pcc.js → chunk-tb363yj8.js} +2 -2
  59. package/dist/{chunk-ejsggxs4.js → chunk-te88v4a8.js} +2 -2
  60. package/dist/{chunk-edd8n5r0.js → chunk-th4jjfgm.js} +1 -1
  61. package/dist/{chunk-7mdbwjxj.js → chunk-v0rsz1rt.js} +1 -1
  62. package/dist/{chunk-z228cmc5.js → chunk-vavy5dw8.js} +1 -1
  63. package/dist/{chunk-zxwdtn6q.js → chunk-w5jdnsyz.js} +9 -9
  64. package/dist/chunk-wr60s2qh.js +1 -0
  65. package/dist/chunk-xz6y0w4n.js +2 -0
  66. package/dist/{chunk-5ha0vf37.js → chunk-yn51162x.js} +1 -1
  67. package/dist/{chunk-eharmsjt.js → chunk-ypqp368c.js} +2 -2
  68. package/dist/chunk-yq2891kc.js +166 -0
  69. package/dist/{chunk-r94jtbd2.js → chunk-yvg961q3.js} +1 -1
  70. package/dist/chunk-yy6h97k0.js +1 -0
  71. package/dist/chunk-zd05g5qs.js +1 -0
  72. package/dist/{chunk-a49dy92d.js → chunk-zdxxqchm.js} +2 -2
  73. package/dist/{chunk-bnp9asmd.js → chunk-zvz2cnt4.js} +1 -1
  74. package/dist/web/assets/{ChatView-Jfq-sqKG.js → ChatView-BVrhnE2j.js} +6 -6
  75. package/dist/web/assets/{CodeBlockHighlighter-C9DvlG-V.js → CodeBlockHighlighter-Dy7QpAmC.js} +1 -1
  76. package/dist/web/assets/{FilePreview-YPtQcXr3.js → FilePreview-BI3nkxz1.js} +2 -2
  77. package/dist/web/assets/KanbanBoard-D5dYOyPH.js +1 -0
  78. package/dist/web/assets/{MarkdownRenderer-CpUKw2Gk.js → MarkdownRenderer-Da1vB81L.js} +12 -12
  79. package/dist/web/assets/{SettingsModal-BfDHa4xn.js → SettingsModal-jcCFqLqS.js} +2 -2
  80. package/dist/web/assets/TaskSwitcher-CQ--jOLB.js +1 -0
  81. package/dist/web/assets/{TerminalPanel-CDq3_gCr.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-0h74p1h8.js +0 -1
  88. package/dist/chunk-18nkg8hr.js +0 -1
  89. package/dist/chunk-197qz36b.js +0 -1
  90. package/dist/chunk-2vdq0fav.js +0 -1
  91. package/dist/chunk-4a75gwa1.js +0 -1
  92. package/dist/chunk-76ks3ygm.js +0 -10
  93. package/dist/chunk-8wvk5rgg.js +0 -1
  94. package/dist/chunk-98vestg4.js +0 -22
  95. package/dist/chunk-b7p7ywe6.js +0 -1
  96. package/dist/chunk-cxc2q3yy.js +0 -1
  97. package/dist/chunk-fv3aggr5.js +0 -1
  98. package/dist/chunk-fz60jh3y.js +0 -2
  99. package/dist/chunk-m19xed90.js +0 -1
  100. package/dist/chunk-mr5c4yzr.js +0 -1
  101. package/dist/chunk-pr8a6xfm.js +0 -1
  102. package/dist/chunk-pwehsv52.js +0 -159
  103. package/dist/chunk-w4eskwzj.js +0 -1
  104. package/dist/chunk-y8zk4r3y.js +0 -1
  105. package/dist/web/assets/TaskSwitcher-DacXxQcV.js +0 -1
  106. package/dist/web/assets/index-Dxdnbd79.css +0 -1
  107. package/dist/web/assets/index-t4mGaG1Z.js +0 -11
@@ -0,0 +1 @@
1
+ import{j as n,r as d}from"./vendor-react-DG5dkZ_t.js";import{j as S,H as Te,d as G,c as R,o as De,I as E,J as _,L as Ae,u as Ie,b as p,a as o,M as L,n as Fe,D as Le,e as Pe,N as Re,g as Ee,h as Me,s as qe}from"./index-BOgOL4hG.js";import{aj as ue,i as Be,F as Ke,k as Oe,h as $e,ak as We,al as Qe,p as He,am as Ve,an as ze,l as U,f as me,ao as Ue,V as Ge,ap as _e,G as Je,ac as Xe,L as P,S as Ye,R as Ze}from"./vendor-icons-B63aW_OM.js";import"./vendor-radix-DXRuAJHH.js";import"./session-events-BvtUOaNG.js";function et(t,r){const s=r.trim().toLocaleLowerCase();return s?t.filter(i=>`${i.label} ${i.description} ${i.keywords}`.toLocaleLowerCase().includes(s)):t}function tt({actions:t,selectedIndex:r,onSelect:s,onRun:i}){return t.map((c,u)=>{const k=u===r,m=c.icon;return n.jsx("div",{id:`command-center-result-${u}`,"data-task-result-index":u,role:"option","aria-selected":k,onMouseEnter:()=>s(u),className:S("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:S("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 nt={running:"running active 进行中 运行中",queued:"queued waiting 排队中 等待中",interrupted:"interrupted paused 已暂停 已中断",failed:"failed error 已失败 错误",cancelled:"cancelled canceled 已取消",completed:"completed done finished 已完成 完成"};function J(t){return De(t,Ae)}function st(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 M(t){return t.normalize("NFKC").toLocaleLowerCase().trim()}function at(t,r){var i,c;const s=E(t,r);return M([J(t),_(s),s,t.projectPath,t.gitBranch,t.taskWorktreeBranch,t.taskStatus,nt[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 pe(t,r,s){if(!r)return 0;const i=M(J(t)),c=M(_(E(t,s)));return i===r?500:i.startsWith(r)?400:i.includes(r)?300:c===r?250:c.startsWith(r)?200:100}function rt(t,r,s,i=50){const c=M(r),u=c.split(/\s+/).filter(Boolean),k=new Set;return t.filter(m=>{if(u.length===0)return!0;const h=at(m,s);return u.every(g=>h.includes(g))}).sort((m,h)=>{const g=+!!h.pendingInteraction-+!!m.pendingInteraction;return g!==0?g:pe(h,c,s)-pe(m,c,s)||Te(m,h)}).filter(m=>{const h=G(R(m));return k.has(h)?!1:(k.add(h),!0)}).slice(0,i)}const it={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 pt(){const t=Ie(),r=p(e=>e.isTaskSwitcherOpen),s=p(e=>e.taskSwitcherMode),i=p(e=>e.setTaskSwitcherOpen),c=p(e=>e.setTaskSwitcherMode),u=p(e=>e.setMainView),k=p(e=>e.toggleSidebar),m=p(e=>e.isFilePreviewOpen),h=p(e=>e.setFilePreviewOpen),g=p(e=>e.openFilePreview),q=p(e=>e.toggleTerminal),y=p(e=>e.openSettings),b=o(e=>e.sessions),he=o(e=>e.isLoading),C=o(e=>e.catalogLoadState),B=C==="loading"||C==="hydrating",K=o(e=>e.currentSessionRef),X=o(e=>e.isTemporarySession),Y=o(e=>e.startTemporarySession),O=o(e=>e.unreadTaskKeys),ke=o(e=>e.boundProjects),A=o(e=>{var a;return e.selectedProjectPath??((a=e.taskWorkspaceInfo)==null?void 0:a.cwd)??null}),xe=o(e=>e.selectProject),fe=o(e=>e.selectSession),ge=o(e=>e.cancelTask),be=o(e=>e.retryTask),ve=o(e=>e.cancellingTaskKeys),we=o(e=>e.retryingTaskKeys),[v,Z]=d.useState(""),[f,j]=d.useState(0),[ye,$]=d.useState(null),[ee,I]=d.useState(null),te=d.useRef(null),ne=d.useRef(null),se=d.useMemo(()=>[{id:"new-task",label:t("commandCenter.action.newTask"),description:t("commandCenter.action.newTaskDescription"),keywords:"create compose session",icon:Be,shortcut:L("newTask"),run:()=>{u("workspace"),Y(),requestAnimationFrame(()=>Fe())}},{id:"toggle-preview",label:t("commandCenter.action.preview"),description:t("commandCenter.action.previewDescription"),keywords:"diff files logs artifact review",icon:Ke,run:()=>{m?h(!1):g((!K||X)&&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:Oe,run:q},{id:"open-settings",label:t("commandCenter.action.settings"),description:t("commandCenter.action.settingsDescription"),keywords:"preferences general",icon:$e,run:()=>y("general")},{id:"open-models",label:t("commandCenter.action.models"),description:t("commandCenter.action.modelsDescription"),keywords:"provider llm api configuration",icon:We,run:()=>y("models")},{id:"open-shortcuts",label:t("commandCenter.action.shortcuts"),description:t("commandCenter.action.shortcutsDescription"),keywords:"keyboard hotkey key binding",icon:Qe,shortcut:L("openCommands"),run:()=>y("shortcuts")},{id:"open-skills",label:t("commandCenter.action.skills"),description:t("commandCenter.action.skillsDescription"),keywords:"capabilities workflow",icon:He,run:()=>y("skills")},{id:"open-mcp",label:t("commandCenter.action.mcp"),description:t("commandCenter.action.mcpDescription"),keywords:"server tools protocol integration",icon:Ve,run:()=>y("mcp")},{id:"toggle-sidebar",label:t("commandCenter.action.sidebar"),description:t("commandCenter.action.sidebarDescription"),keywords:"navigation layout panel projects",icon:ze,shortcut:L("toggleSidebar"),run:k}],[K,m,X,g,y,h,u,Y,t,k,q]),w=d.useMemo(()=>rt(b,v,A),[A,v,b]),T=d.useMemo(()=>et(se,v),[se,v]),D=s==="tasks"?w.length:T.length,ae=d.useMemo(()=>b.filter(e=>!!e.pendingInteraction).length,[b]),W=s==="tasks"?w[f]??null:null,Q=s==="commands"?T[f]??null:null;d.useEffect(()=>{r&&(Z(""),j(0),$(null),I(null))},[s,r]),d.useEffect(()=>{j(0)},[v]),d.useEffect(()=>{var a,l;const e=(a=ne.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 re=async e=>{const a=R(e),l=G(a),x=E(e,A);$(l),ke.some(N=>N.path===x)&&xe(x);try{u("workspace"),await fe(a),i(!1)}catch(N){I(N instanceof Error?N.message:t("taskSwitcher.action.failed"))}finally{$(null)}},ie=async(e,a)=>{I(null);try{const l=R(a);e==="cancel"?await ge(l):(await be(l),i(!1))}catch(l){I(l instanceof Error?l.message:t("taskSwitcher.action.failed"))}},ce=e=>{i(!1),requestAnimationFrame(e.run)},je=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"&&W?(e.preventDefault(),re(W)):e.key==="Enter"&&Q?(e.preventDefault(),ce(Q)):e.key==="Escape"&&(e.preventDefault(),i(!1))};return n.jsx(Le,{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(Ee,{className:"sr-only",children:t("commandCenter.title")}),n.jsx(Me,{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:te,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:v,onChange:e=>Z(e.target.value),onKeyDown:je,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=te.current)==null?void 0:a.focus()})},className:S("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}):v?t("taskSwitcher.results",{count:w.length}):B?b.length===0?t("taskSwitcher.indexing"):t("taskSwitcher.indexingLoaded",{count:b.length}):C==="error"?t("sidebar.catalog.incomplete"):ae>0?t("taskSwitcher.needsAction",{count:ae}):O.length>0?t("taskSwitcher.unread",{count:O.length}):t("taskSwitcher.scope",{count:b.length})})})]}),ee&&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:ee}),n.jsxs("div",{id:"task-switcher-results",ref:ne,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(tt,{actions:T,selectedIndex:f,onSelect:j,onRun:ce}),s==="tasks"&&w.map((e,a)=>{const l=R(e),x=G(l),N=E(e,A),Ne=_(N),oe=qe(l,K),H=a===f,Se=ye===x,Ce=O.includes(x),F=J(e),le=e.taskStatus==="running"||e.taskStatus==="queued",de=!!e.taskRetryAvailable&&(e.taskStatus==="failed"||e.taskStatus==="interrupted"||e.taskStatus==="cancelled"),V=ve.includes(x),z=we.includes(x);return n.jsxs("div",{id:`task-switcher-result-${a}`,"data-task-result-index":a,"data-session-ref":x,role:"option","aria-selected":H,onMouseEnter:()=>j(a),className:S("group flex min-h-[68px] w-full items-center rounded-lg border border-transparent text-left transition-colors",H?"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 re(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:S("flex h-8 w-8 shrink-0 items-center justify-center rounded-md border bg-[hsl(var(--deck-canvas))]",oe?"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(me,{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}),oe&&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")}),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.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:Ne})]}),(e.taskWorktreeBranch||e.gitBranch)&&n.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1",children:[n.jsx(Je,{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(it[e.taskStatus])}),n.jsxs("span",{className:"ml-auto inline-flex shrink-0 items-center gap-1",children:[n.jsx(Xe,{className:"h-2.5 w-2.5"}),st(e)]})]})]}),Se?n.jsx(P,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-[hsl(var(--deck-accent))]"}):n.jsx(ue,{className:S("h-3.5 w-3.5 shrink-0 transition-all",H?"translate-x-0 text-[hsl(var(--deck-accent))] opacity-100":"-translate-x-1 text-[hsl(var(--deck-ink-faint))] opacity-0")})]}),(le||de)&&n.jsxs("div",{className:"flex shrink-0 items-center pr-2",children:[le&&n.jsx("button",{type:"button","aria-label":t(V?"session.action.stopping":"session.action.stop",{title:F}),disabled:V,onClick:()=>void ie("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(P,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ye,{className:"h-3.5 w-3.5"})}),de&&n.jsx("button",{type:"button","aria-label":t(z?"session.action.retrying":"session.action.retry",{title:F}),disabled:z,onClick:()=>void ie("retry",e),className:"flex h-8 w-8 items-center justify-center rounded-md text-[hsl(var(--deck-accent))] transition-colors hover:bg-[hsl(var(--deck-accent-soft))] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[hsl(var(--deck-accent))] disabled:cursor-wait disabled:opacity-60",children:z?n.jsx(P,{className:"h-3.5 w-3.5 animate-spin"}):n.jsx(Ze,{className:"h-3.5 w-3.5"})})]})]},x)}),s==="tasks"&&w.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(P,{className:"h-3.5 w-3.5 animate-spin text-[hsl(var(--deck-accent))]"}),t("taskSwitcher.indexing")]}),s==="tasks"&&w.length===0&&!B&&C!=="error"&&!he&&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"&&w.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(me,{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:[L(s==="tasks"?"openCommands":"searchTasks")," ",t(s==="tasks"?"commandCenter.mode.commands":"commandCenter.mode.tasks")]})]})]})})}export{pt as TaskSwitcher};
@@ -1 +1 @@
1
- import{r as t,j as a}from"./vendor-react-DG5dkZ_t.js";import{D as A,o as j,L as R}from"./vendor-xterm-DuYZoU4T.js";import{u as C,b as N,L as F,j as x}from"./index-t4mGaG1Z.js";import{j as M,an as S,X as T}from"./vendor-icons-ICv1v-tf.js";import"./vendor-radix-DXRuAJHH.js";import"./session-events-BvtUOaNG.js";const $=({workspacePath:b})=>{const c=C(),{isTerminalOpen:l,toggleTerminal:y}=N(),[s,z]=t.useState(!1),[p,u]=t.useState(!1),g=F(),m=t.useRef(null),i=t.useRef(null),h=t.useRef(null),o=t.useRef(null),E=t.useRef(null),B=t.useCallback(()=>{var f;if(((f=o.current)==null?void 0:f.readyState)===WebSocket.OPEN)return;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal/ws`,e=b?`${r}?cwd=${encodeURIComponent(b)}`:r,n=new WebSocket(e);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=t.useCallback(()=>{o.current&&(o.current.close(),o.current=null),u(!1)},[]),v=t.useCallback(r=>{var e;((e=o.current)==null?void 0:e.readyState)===WebSocket.OPEN&&o.current.send(r)},[]);return t.useEffect(()=>(E.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{var r;return(r=E.current)==null?void 0:r.focus({preventScroll:!0})}),[]),t.useEffect(()=>{if(!l||!m.current||i.current)return;const r={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"},e=new A({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:"JetBrains Mono, Menlo, Monaco, Consolas, monospace",allowTransparency:!0,scrollback:1e4,theme:g?{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"}:r}),n=new j,f=new R;e.loadAddon(n),e.loadAddon(f),e.open(m.current),n.fit();const w=requestAnimationFrame(()=>e.focus());return e.onData(d=>{v(d)}),i.current=e,h.current=n,B(),()=>{cancelAnimationFrame(w),k(),e.dispose(),i.current=null,h.current=null}},[l,B,k,v]),t.useEffect(()=>{i.current&&(i.current.options.theme=g?{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"})},[g]),t.useEffect(()=>{if(!l||s)return;const r=()=>{var n;(n=h.current)==null||n.fit()};window.addEventListener("resize",r);const e=setTimeout(r,100);return()=>{window.removeEventListener("resize",r),clearTimeout(e)}},[l,s]),l?a.jsxs("div",{role:"region","aria-label":c("terminal.title"),className:x("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(M,{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(p?"terminal.status.connected":"terminal.status.disconnected"),className:x("w-2 h-2 rounded-full",p?"bg-green-500":"bg-zinc-600")})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",onClick:()=>z(!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(S,{className:"h-4 w-4"})}),a.jsx("button",{type:"button",onClick:()=>{k(),y()},"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(T,{className:"h-4 w-4"})})]})]}),a.jsx("div",{ref:m,className:x("h-[calc(100%-40px)] p-2",s&&"hidden")})]}):null};export{$ as TerminalPanel};
1
+ import{r as t,j as a}from"./vendor-react-DG5dkZ_t.js";import{D as A,o as R,L as j}from"./vendor-xterm-DuYZoU4T.js";import{u as C,b as N,Q as F,j as x}from"./index-BOgOL4hG.js";import{k as M,ar as S,X as T}from"./vendor-icons-B63aW_OM.js";import"./vendor-radix-DXRuAJHH.js";import"./session-events-BvtUOaNG.js";const $=({workspacePath:b})=>{const c=C(),{isTerminalOpen:l,toggleTerminal:y}=N(),[s,z]=t.useState(!1),[p,u]=t.useState(!1),g=F(),m=t.useRef(null),i=t.useRef(null),h=t.useRef(null),o=t.useRef(null),E=t.useRef(null),B=t.useCallback(()=>{var f;if(((f=o.current)==null?void 0:f.readyState)===WebSocket.OPEN)return;const r=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/terminal/ws`,e=b?`${r}?cwd=${encodeURIComponent(b)}`:r,n=new WebSocket(e);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=t.useCallback(()=>{o.current&&(o.current.close(),o.current=null),u(!1)},[]),v=t.useCallback(r=>{var e;((e=o.current)==null?void 0:e.readyState)===WebSocket.OPEN&&o.current.send(r)},[]);return t.useEffect(()=>(E.current=document.activeElement instanceof HTMLElement?document.activeElement:null,()=>{var r;return(r=E.current)==null?void 0:r.focus({preventScroll:!0})}),[]),t.useEffect(()=>{if(!l||!m.current||i.current)return;const r={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"},e=new A({cursorBlink:!0,cursorStyle:"bar",fontSize:14,fontFamily:"JetBrains Mono, Menlo, Monaco, Consolas, monospace",allowTransparency:!0,scrollback:1e4,theme:g?{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"}:r}),n=new R,f=new j;e.loadAddon(n),e.loadAddon(f),e.open(m.current),n.fit();const w=requestAnimationFrame(()=>e.focus());return e.onData(d=>{v(d)}),i.current=e,h.current=n,B(),()=>{cancelAnimationFrame(w),k(),e.dispose(),i.current=null,h.current=null}},[l,B,k,v]),t.useEffect(()=>{i.current&&(i.current.options.theme=g?{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"})},[g]),t.useEffect(()=>{if(!l||s)return;const r=()=>{var n;(n=h.current)==null||n.fit()};window.addEventListener("resize",r);const e=setTimeout(r,100);return()=>{window.removeEventListener("resize",r),clearTimeout(e)}},[l,s]),l?a.jsxs("div",{role:"region","aria-label":c("terminal.title"),className:x("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(M,{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(p?"terminal.status.connected":"terminal.status.disconnected"),className:x("w-2 h-2 rounded-full",p?"bg-green-500":"bg-zinc-600")})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button",onClick:()=>z(!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(S,{className:"h-4 w-4"})}),a.jsx("button",{type:"button",onClick:()=>{k(),y()},"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(T,{className:"h-4 w-4"})})]})]}),a.jsx("div",{ref:m,className:x("h-[calc(100%-40px)] p-2",s&&"hidden")})]}):null};export{$ as TerminalPanel};