@wrongstack/webui 0.282.1 → 0.282.2

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 (46) hide show
  1. package/dist/assets/{AnalyticsDashboard-TCNC-sVb.js → AnalyticsDashboard-CPLSpHzV.js} +1 -1
  2. package/dist/assets/{AutoPhaseView-BMUiT6aI.js → AutoPhaseView-HIzNPExo.js} +1 -1
  3. package/dist/assets/{CodeEditor-C0si742k.js → CodeEditor-dOQDoCfn.js} +1 -1
  4. package/dist/assets/{DebugDashboard-BHpiEOcf.js → DebugDashboard-CQCI-B4W.js} +1 -1
  5. package/dist/assets/{DesignGalleryView-BfZTw48N.js → DesignGalleryView-BxTlrmrr.js} +1 -1
  6. package/dist/assets/{KanbanView-C4T4y0b7.js → KanbanView-2uDRr6Qd.js} +1 -1
  7. package/dist/assets/{MailboxDetailView-DJtjP0NF.js → MailboxDetailView-B0DCs5lu.js} +1 -1
  8. package/dist/assets/OfficeMapPanel-lGSaptet.js +4 -0
  9. package/dist/assets/{ProcessMonitor-D53zn0h4.js → ProcessMonitor-eTb8_-ZW.js} +1 -1
  10. package/dist/assets/{QueuePanel-DTO68vaB.js → QueuePanel-TbbkNAx_.js} +1 -1
  11. package/dist/assets/{RefreshDebugView-BXq2P3wo.js → RefreshDebugView-CX6x-xHs.js} +1 -1
  12. package/dist/assets/SddBoardView-BXQsH6fr.js +2 -0
  13. package/dist/assets/{SddFlowGraph-CtMpzU4S.js → SddFlowGraph-DTWV-DPB.js} +1 -1
  14. package/dist/assets/SddWizard-1ZhDgcgM.js +1 -0
  15. package/dist/assets/{SessionsDashboard-Dqsrp5CK.js → SessionsDashboard-CfNbqjeh.js} +1 -1
  16. package/dist/assets/SkillDetailView-UzixISza.js +2 -0
  17. package/dist/assets/{SpecsView-Cwd6PiYr.js → SpecsView-BO8yG6ID.js} +1 -1
  18. package/dist/assets/{TerminalPanel-Bzyhr2aC.js → TerminalPanel-Bjbu9ktV.js} +1 -1
  19. package/dist/assets/{chat-store-CIMOL6-x.js → chat-store-7ekEnPAf.js} +1 -1
  20. package/dist/assets/{i18n-CNo6A2vu.js → i18n-BCQuDmQo.js} +2 -2
  21. package/dist/assets/index-Cb-hw9qG.js +147 -0
  22. package/dist/assets/index-ZtF5f7wy.css +1 -0
  23. package/dist/assets/{session-store-DN1UYDL9.js → session-store-KCJiKVqL.js} +1 -1
  24. package/dist/assets/settings-wb322bGN.js +1 -0
  25. package/dist/assets/{ui-store-BdOsq6T-.js → ui-store-CcznRsiV.js} +1 -1
  26. package/dist/assets/utils-C3qJEm2b.js +1 -0
  27. package/dist/assets/{vendor-Ch4m_qLI.js → vendor-Cm3Womkr.js} +25 -25
  28. package/dist/assets/{ws-client-BAV7SLzK.js → ws-client-9j1mjm9I.js} +1 -1
  29. package/dist/assets/{xyflow-D5_yey7w.js → xyflow-Dy5Edi88.js} +3 -3
  30. package/dist/index.html +10 -10
  31. package/dist/index.js +4040 -3685
  32. package/dist/index.js.map +1 -1
  33. package/dist/server/entry.js +42 -5
  34. package/dist/server/entry.js.map +1 -1
  35. package/dist/server/index.js +42 -5
  36. package/dist/server/index.js.map +1 -1
  37. package/dist/types.d.ts +28 -0
  38. package/package.json +6 -6
  39. package/dist/assets/OfficeMapPanel-CgvHvGQm.js +0 -4
  40. package/dist/assets/SddBoardView-C8X4MiTy.js +0 -2
  41. package/dist/assets/SddWizard-t5Cly3CG.js +0 -1
  42. package/dist/assets/SkillDetailView-Dq-fTqSp.js +0 -2
  43. package/dist/assets/index-CWj2bI87.js +0 -145
  44. package/dist/assets/index-D7_FeyCA.css +0 -1
  45. package/dist/assets/settings-CGhOOFpI.js +0 -1
  46. package/dist/assets/utils-DBns3uMk.js +0 -1
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{bt as r,ci as i,pt as a,wt as o}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as s}from"./utils-DBns3uMk.js";import{C as c,g as l,h as u,m as d,y as f}from"./index-CWj2bI87.js";var p=e(t(),1),m=n();function h({open:e,onClose:t,className:n}){let{t:h}=i(),[g,_]=(0,p.useState)([]),v=c(),y=(0,p.useRef)(null),b=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!(!e||!v.client?.isConnected))return v.client.send?.({type:`process.list`}),y.current=v.client.on?.(`process.list`,e=>{let t=e?.payload;t?.processes&&_(t.processes)})??null,b.current=setInterval(()=>{v.client.send?.({type:`process.list`})},3e3),()=>{y.current?.(),b.current&&clearInterval(b.current)}},[e,v.client]);let x=(0,p.useCallback)(e=>{v.client.send?.({type:`process.kill`,payload:{pid:e}})},[v.client]),S=(0,p.useCallback)(()=>{v.client.send?.({type:`process.killAll`})},[v.client]),C=g.filter(e=>e.status===`running`);return(0,m.jsx)(d,{open:e,onOpenChange:e=>{e||t()},children:(0,m.jsxs)(u,{className:s(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,n),showCloseButton:!1,children:[(0,m.jsx)(f,{className:`sr-only`,children:h(`activity:process.heading`)}),(0,m.jsx)(l,{className:`sr-only`,children:h(`activity:process.subtitle`,{active:C.length,total:g.length})}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400`,children:(0,m.jsx)(a,{className:`h-4 w-4`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold`,children:h(`activity:process.heading`)}),(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:h(`activity:process.subtitle`,{active:C.length,total:g.length})})]})]}),(0,m.jsx)(`div`,{className:`flex items-center gap-1`,children:C.length>0&&(0,m.jsxs)(`button`,{type:`button`,onClick:S,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,m.jsx)(r,{className:`h-3 w-3 fill-current`}),h(`activity:process.killAll`)]})})]}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:g.length===0?(0,m.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,m.jsx)(a,{className:`h-10 w-10 opacity-15`}),(0,m.jsx)(`p`,{className:`text-sm font-medium`,children:h(`activity:process.emptyTitle`)}),(0,m.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:h(`activity:process.emptyBody`)})]}):(0,m.jsx)(`div`,{className:`divide-y`,children:g.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,i=e.protected===!0;return(0,m.jsxs)(`div`,{className:s(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,m.jsx)(`span`,{className:s(`led shrink-0`,e.status===`running`?i?`text-blue-400`:`text-[hsl(var(--success))] led-pulse`:`text-muted-foreground`)}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:h(`activity:process.pidLabel`,{pid:e.pid})}),(0,m.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),i&&(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-blue-500/10 text-blue-600 dark:text-blue-400 font-medium shrink-0`,title:h(`activity:process.protectedTitle`),children:[(0,m.jsx)(o,{className:`h-2.5 w-2.5`}),h(`activity:process.protected`)]})]}),(0,m.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!i&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>x(e.pid),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:h(`activity:process.killTitle`,{pid:e.pid}),children:(0,m.jsx)(r,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{h as ProcessMonitor};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{bt as r,pt as i,ui as a,wt as o}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as s}from"./utils-C3qJEm2b.js";import{C as c,g as l,h as u,m as d,y as f}from"./index-Cb-hw9qG.js";var p=e(t(),1),m=n();function h({open:e,onClose:t,className:n}){let{t:h}=a(),[g,_]=(0,p.useState)([]),v=c(),y=(0,p.useRef)(null),b=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(!(!e||!v.client?.isConnected))return v.client.send?.({type:`process.list`}),y.current=v.client.on?.(`process.list`,e=>{let t=e?.payload;t?.processes&&_(t.processes)})??null,b.current=setInterval(()=>{v.client.send?.({type:`process.list`})},3e3),()=>{y.current?.(),b.current&&clearInterval(b.current)}},[e,v.client]);let x=(0,p.useCallback)(e=>{v.client.send?.({type:`process.kill`,payload:{pid:e}})},[v.client]),S=(0,p.useCallback)(()=>{v.client.send?.({type:`process.killAll`})},[v.client]),C=g.filter(e=>e.status===`running`);return(0,m.jsx)(d,{open:e,onOpenChange:e=>{e||t()},children:(0,m.jsxs)(u,{className:s(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[75dvh] pt-[10dvh]`,n),showCloseButton:!1,children:[(0,m.jsx)(f,{className:`sr-only`,children:h(`activity:process.heading`)}),(0,m.jsx)(l,{className:`sr-only`,children:h(`activity:process.subtitle`,{active:C.length,total:g.length})}),(0,m.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,m.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400`,children:(0,m.jsx)(i,{className:`h-4 w-4`})}),(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h2`,{className:`text-sm font-semibold`,children:h(`activity:process.heading`)}),(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:h(`activity:process.subtitle`,{active:C.length,total:g.length})})]})]}),(0,m.jsx)(`div`,{className:`flex items-center gap-1`,children:C.length>0&&(0,m.jsxs)(`button`,{type:`button`,onClick:S,className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,children:[(0,m.jsx)(r,{className:`h-3 w-3 fill-current`}),h(`activity:process.killAll`)]})})]}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:g.length===0?(0,m.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,m.jsx)(i,{className:`h-10 w-10 opacity-15`}),(0,m.jsx)(`p`,{className:`text-sm font-medium`,children:h(`activity:process.emptyTitle`)}),(0,m.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:h(`activity:process.emptyBody`)})]}):(0,m.jsx)(`div`,{className:`divide-y`,children:g.map(e=>{let t=e.status===`running`?Math.floor((Date.now()-e.startedAt)/1e3):null,n=t?t<60?`${t}s`:`${Math.floor(t/60)}m ${t%60}s`:null,i=e.protected===!0;return(0,m.jsxs)(`div`,{className:s(`flex items-center justify-between px-4 py-3 text-xs transition-colors`,e.status===`running`?`bg-background hover:bg-muted/30`:`bg-muted/20 text-muted-foreground`),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,m.jsx)(`span`,{className:s(`led shrink-0`,e.status===`running`?i?`text-blue-400`:`text-[hsl(var(--success))] led-pulse`:`text-muted-foreground`)}),(0,m.jsxs)(`div`,{className:`min-w-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground shrink-0`,children:h(`activity:process.pidLabel`,{pid:e.pid})}),(0,m.jsx)(`span`,{className:`font-medium truncate`,children:e.tool}),i&&(0,m.jsxs)(`span`,{className:`inline-flex items-center gap-0.5 px-1 py-0.5 rounded text-[9px] bg-blue-500/10 text-blue-600 dark:text-blue-400 font-medium shrink-0`,title:h(`activity:process.protectedTitle`),children:[(0,m.jsx)(o,{className:`h-2.5 w-2.5`}),h(`activity:process.protected`)]})]}),(0,m.jsx)(`code`,{className:`text-[10px] text-muted-foreground/70 truncate block mt-0.5 font-mono`,children:e.command})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0 ml-3`,children:[n&&(0,m.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:n}),e.status===`running`&&!i&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>x(e.pid),className:`p-1.5 rounded-md hover:bg-destructive/10 hover:text-destructive transition-colors`,title:h(`activity:process.killTitle`,{pid:e.pid}),children:(0,m.jsx)(r,{className:`h-3.5 w-3.5 fill-current`})})]})]},e.pid)})})})]})})}export{h as ProcessMonitor};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-CIMOL6-x.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{Z as i,ai as a,ci as o,dt as s,hn as c,ii as l}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as u}from"./utils-DBns3uMk.js";import{g as d,h as f,m as p,y as m}from"./index-CWj2bI87.js";var h=e(n(),1),g=r(),_={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-sky-500/10 text-sky-700 dark:text-sky-300 border-sky-500/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/30`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 border-indigo-500/30`}};function v({open:e,onClose:n,className:r}){let{t:v}=o(),y=t(e=>e.queue),b=t(e=>e.removeQueued),x=t(e=>e.clearQueue),[S,C]=(0,h.useState)(`oldest`),w=(0,h.useCallback)(e=>{b(e)},[b]),T=(0,h.useMemo)(()=>{let e=y.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>S===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[y,S]);return(0,g.jsx)(p,{open:e,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(f,{className:u(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[70dvh] pt-[10dvh]`,r),showCloseButton:!1,children:[(0,g.jsx)(m,{className:`sr-only`,children:v(`activity:queue.heading`)}),(0,g.jsx)(d,{className:`sr-only`,children:v(`activity:queue.subtitle`,{count:y.length})}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,g.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-indigo-500/10 text-indigo-600 dark:text-indigo-400`,children:(0,g.jsx)(c,{className:`h-4 w-4`})}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:queue.heading`)}),(0,g.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:queue.subtitle`,{count:y.length})})]})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,g.jsxs)(`button`,{type:`button`,onClick:()=>C(e=>e===`newest`?`oldest`:`newest`),className:u(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:v(S===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[S===`newest`?(0,g.jsx)(a,{className:`h-3 w-3`}):(0,g.jsx)(l,{className:`h-3 w-3`}),v(S===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),y.length>0&&(0,g.jsxs)(`button`,{type:`button`,onClick:()=>x(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:v(`activity:queue.clearTitle`),"data-testid":`queue-clear-all`,children:[(0,g.jsx)(s,{className:`h-3 w-3`}),v(`activity:queue.clear`)]})]})]}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:y.length===0?(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,g.jsx)(c,{className:`h-10 w-10 opacity-15`}),(0,g.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:queue.emptyTitle`)}),(0,g.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:queue.emptyBody`)})]}):(0,g.jsx)(`ul`,{className:`divide-y`,"data-testid":`queue-list`,children:T.map(({item:e,sourceIdx:t},n)=>{let r=_[e.mode];return(0,g.jsxs)(`li`,{className:`flex items-start justify-between px-4 py-3 text-xs hover:bg-muted/30 transition-colors gap-3`,"data-testid":`queue-item`,children:[(0,g.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,g.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,g.jsx)(`span`,{className:u(`shrink-0 inline-flex items-center justify-center text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded border`,r.tone),title:v(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,g.jsx)(`p`,{className:`text-sm text-foreground leading-relaxed min-w-0 break-words`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text})]}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>w(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,g.jsx)(i,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),y.length>0&&(0,g.jsx)(`div`,{className:`px-4 py-2.5 border-t shrink-0`,children:(0,g.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:v(`activity:queue.footer`)})})]})})}export{v as QueuePanel};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-7ekEnPAf.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{Z as i,_n as a,dt as o,oi as s,si as c,ui as l}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as u}from"./utils-C3qJEm2b.js";import{g as d,h as f,m as p,y as m}from"./index-Cb-hw9qG.js";var h=e(n(),1),g=r(),_={btw:{label:`btw`,titleKey:`btwTitle`,tone:`bg-sky-500/10 text-sky-700 dark:text-sky-300 border-sky-500/30`},steer:{label:`steer`,titleKey:`steerTitle`,tone:`bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/30`},queue:{label:`queue`,titleKey:`queueTitle`,tone:`bg-indigo-500/10 text-indigo-700 dark:text-indigo-300 border-indigo-500/30`}};function v({open:e,onClose:n,className:r}){let{t:v}=l(),y=t(e=>e.queue),b=t(e=>e.removeQueued),x=t(e=>e.clearQueue),[S,C]=(0,h.useState)(`oldest`),w=(0,h.useCallback)(e=>{b(e)},[b]),T=(0,h.useMemo)(()=>{let e=y.map((e,t)=>({item:e,sourceIdx:t}));return e.sort((e,t)=>S===`newest`?t.item.addedAt-e.item.addedAt:e.item.addedAt-t.item.addedAt),e},[y,S]);return(0,g.jsx)(p,{open:e,onOpenChange:e=>{e||n()},children:(0,g.jsxs)(f,{className:u(`max-w-lg gap-0 p-0 overflow-hidden flex flex-col max-h-[70dvh] pt-[10dvh]`,r),showCloseButton:!1,children:[(0,g.jsx)(m,{className:`sr-only`,children:v(`activity:queue.heading`)}),(0,g.jsx)(d,{className:`sr-only`,children:v(`activity:queue.subtitle`,{count:y.length})}),(0,g.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b shrink-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,g.jsx)(`span`,{className:`flex items-center justify-center w-8 h-8 rounded-lg bg-indigo-500/10 text-indigo-600 dark:text-indigo-400`,children:(0,g.jsx)(a,{className:`h-4 w-4`})}),(0,g.jsxs)(`div`,{children:[(0,g.jsx)(`h2`,{className:`text-sm font-semibold`,children:v(`activity:queue.heading`)}),(0,g.jsx)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:v(`activity:queue.subtitle`,{count:y.length})})]})]}),(0,g.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,g.jsxs)(`button`,{type:`button`,onClick:()=>C(e=>e===`newest`?`oldest`:`newest`),className:u(`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs transition-colors font-medium`,`text-muted-foreground hover:bg-muted hover:text-foreground`),title:v(S===`newest`?`activity:queue.sortNewestTitle`:`activity:queue.sortOldestTitle`),"data-testid":`queue-sort-toggle`,children:[S===`newest`?(0,g.jsx)(c,{className:`h-3 w-3`}):(0,g.jsx)(s,{className:`h-3 w-3`}),v(S===`newest`?`activity:queue.newest`:`activity:queue.oldest`)]}),y.length>0&&(0,g.jsxs)(`button`,{type:`button`,onClick:()=>x(),className:`flex items-center gap-1.5 px-2.5 py-1.5 rounded-md text-xs text-destructive hover:bg-destructive/10 transition-colors font-medium`,title:v(`activity:queue.clearTitle`),"data-testid":`queue-clear-all`,children:[(0,g.jsx)(o,{className:`h-3 w-3`}),v(`activity:queue.clear`)]})]})]}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:y.length===0?(0,g.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 gap-3 text-muted-foreground`,children:[(0,g.jsx)(a,{className:`h-10 w-10 opacity-15`}),(0,g.jsx)(`p`,{className:`text-sm font-medium`,children:v(`activity:queue.emptyTitle`)}),(0,g.jsx)(`p`,{className:`text-xs text-center max-w-xs`,children:v(`activity:queue.emptyBody`)})]}):(0,g.jsx)(`ul`,{className:`divide-y`,"data-testid":`queue-list`,children:T.map(({item:e,sourceIdx:t},n)=>{let r=_[e.mode];return(0,g.jsxs)(`li`,{className:`flex items-start justify-between px-4 py-3 text-xs hover:bg-muted/30 transition-colors gap-3`,"data-testid":`queue-item`,children:[(0,g.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,g.jsxs)(`span`,{className:`mt-1 text-[10px] font-mono text-muted-foreground shrink-0 w-5 text-right tabular-nums`,children:[n+1,`.`]}),(0,g.jsx)(`span`,{className:u(`shrink-0 inline-flex items-center justify-center text-[10px] font-semibold uppercase tracking-wider px-1.5 py-0.5 rounded border`,r.tone),title:v(`activity:queue.${r.titleKey}`),"data-testid":`queue-mode-${e.mode}`,children:r.label}),(0,g.jsx)(`p`,{className:`text-sm text-foreground leading-relaxed min-w-0 break-words`,children:e.text.length>120?`${e.text.slice(0,117)}…`:e.text})]}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>w(t),className:`ml-1 p-1.5 rounded-md shrink-0 hover:bg-destructive/10 hover:text-destructive transition-colors`,title:v(`activity:queue.removeTitle`),"data-testid":`queue-remove-${t}`,children:(0,g.jsx)(i,{className:`h-3.5 w-3.5`})})]},`${e.addedAt}-${t}`)})})}),y.length>0&&(0,g.jsx)(`div`,{className:`px-4 py-2.5 border-t shrink-0`,children:(0,g.jsx)(`p`,{className:`text-[10px] text-muted-foreground text-center`,children:v(`activity:queue.footer`)})})]})})}export{v as QueuePanel};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-CIMOL6-x.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{At as i,Ft as a,Mr as o,Pr as s,Tn as c,ci as l,er as u,ti as d}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as f}from"./session-store-DN1UYDL9.js";import{n as p}from"./ui-store-BdOsq6T-.js";var m=e(n(),1),h=r();function g(){let e=f(e=>e.session),{t:n}=l(),r=f.getState().session?.id,g=f(e=>e.projectName),x=f(e=>e.cwd),S=f(e=>e.mode),C=f(e=>e.contextMode),w=f(e=>e.lastVisitedAt),T=t(e=>e.messages),E=t(e=>e.queue.length),D=t(e=>e.boundSessionId),O=p(e=>e.currentView),k=p(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0?D!==r:!1;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto bg-background p-6`,children:(0,h.jsxs)(`div`,{className:`max-w-5xl mx-auto space-y-6`,children:[(0,h.jsxs)(`header`,{className:`flex items-start justify-between`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`h1`,{className:`text-2xl font-bold flex items-center gap-2`,children:[(0,h.jsx)(a,{className:`w-7 h-7 text-primary`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`px-3 py-1.5 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90`,children:n(`activity:refresh.recordProbe`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(o,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(u,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`border rounded-lg p-3 bg-muted/40 text-xs font-mono space-y-1`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(i,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(d,{className:`w-4 h-4 text-green-500 shrink-0`}):(0,h.jsx)(s,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`border rounded-lg px-3 py-2 ${r?`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`:n?`border-green-500/40 bg-green-500/10 text-green-700 dark:text-green-300`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`text-xs font-medium flex items-center gap-2`,children:[n&&!r?(0,h.jsx)(d,{className:`w-4 h-4`}):(0,h.jsx)(s,{className:`w-4 h-4`}),e]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`border rounded-lg p-3 bg-card`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{t}from"./chat-store-7ekEnPAf.js";import{m as n,p as r}from"./markdown-D0X23O-i.js";import{At as i,Dn as a,Ft as o,Ir as s,Pr as c,nr as l,ri as u,ui as d}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as f}from"./session-store-KCJiKVqL.js";import{n as p}from"./ui-store-CcznRsiV.js";var m=e(n(),1),h=r();function g(){let e=f(e=>e.session),{t:n}=d(),r=f.getState().session?.id,g=f(e=>e.projectName),x=f(e=>e.cwd),S=f(e=>e.mode),C=f(e=>e.contextMode),w=f(e=>e.lastVisitedAt),T=t(e=>e.messages),E=t(e=>e.queue.length),D=t(e=>e.boundSessionId),O=p(e=>e.currentView),k=p(e=>e.dockSection),[A,j]=(0,m.useState)([]),M=(0,m.useMemo)(()=>{if(typeof window>`u`)return 0;let e=0;for(let t of[`wrongstack-session`,`wrongstack-chat`,`wrongstack-ui`,`wrongstack-config`]){let n=window.localStorage.getItem(t);typeof n==`string`&&(e+=n.length)}return e},[T.length]),N=typeof window<`u`&&!!window.__wrongstackSessionRehydrated,P=typeof window<`u`&&!!window.__wrongstackChatRehydrated;function F(e,t){j(n=>[{ts:Date.now(),note:e,ok:t},...n].slice(0,20))}function I(){F(n(`activity:refresh.simulatedF5`),!0)}let L=D!==null&&r!==void 0?D!==r:!1;return(0,h.jsx)(`div`,{className:`h-full min-h-0 min-w-0 flex-1 overflow-y-auto bg-background p-6`,children:(0,h.jsxs)(`div`,{className:`max-w-5xl mx-auto space-y-6`,children:[(0,h.jsxs)(`header`,{className:`flex items-start justify-between`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsxs)(`h1`,{className:`text-2xl font-bold flex items-center gap-2`,children:[(0,h.jsx)(o,{className:`w-7 h-7 text-primary`}),n(`activity:refresh.heading`)]}),(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:n(`activity:refresh.subtitle`)})]}),(0,h.jsx)(`button`,{type:`button`,onClick:I,className:`px-3 py-1.5 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:opacity-90`,children:n(`activity:refresh.recordProbe`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(c,{className:`w-5 h-5`}),n(`activity:refresh.latestSession`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.restoredLocal`),ok:N,extra:r?n(`activity:refresh.sessionIdExtra`,{id:r}):n(`activity:refresh.noSessionYet`)}),(0,h.jsx)(_,{label:n(`activity:refresh.activePointer`),ok:!!e?.id,extra:e?y(e):`null`}),(0,h.jsx)(_,{label:n(`activity:refresh.lastVisited`),ok:w>0,extra:w>0?new Date(w).toISOString():n(`activity:refresh.never`)})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(l,{className:`w-5 h-5`}),n(`activity:refresh.persistedEnv`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`projectName`,value:g||`∅`}),(0,h.jsx)(v,{label:`cwd`,value:x||`∅`,mono:!0}),(0,h.jsx)(v,{label:`mode`,value:S,mono:!0}),(0,h.jsx)(v,{label:`contextMode`,value:C,mono:!0})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(a,{className:`w-5 h-5`}),n(`activity:refresh.transcriptRehydrate`)]}),(0,h.jsx)(_,{label:n(`activity:refresh.localTranscript`),ok:P&&(T.length>0||D===null),extra:T.length===0?n(`activity:refresh.noMessages`):n(`activity:refresh.messagesExtra`,{count:T.length,queued:E})}),(0,h.jsx)(_,{label:n(`activity:refresh.noBleed`),ok:!L,extra:L?n(`activity:refresh.bleedExtra`,{bound:D??`∅`,active:r??`∅`}):n(`activity:refresh.transcriptBinds`),warn:L}),T.length>0&&(0,h.jsxs)(`div`,{className:`border rounded-lg p-3 bg-muted/40 text-xs font-mono space-y-1`,children:[(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`first:`}),` `,b(T[0])]}),(0,h.jsxs)(`div`,{children:[(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:`last:`}),` `,b(T[T.length-1]??T[0])]})]})]}),(0,h.jsxs)(`section`,{className:`space-y-3`,children:[(0,h.jsxs)(`h2`,{className:`text-lg font-semibold flex items-center gap-2`,children:[(0,h.jsx)(i,{className:`w-5 h-5`}),n(`activity:refresh.uiWorkspace`)]}),(0,h.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,h.jsx)(v,{label:`currentView`,value:O,mono:!0}),(0,h.jsx)(v,{label:`dockSection`,value:k??n(`activity:refresh.noneValue`),mono:!0})]}),(0,h.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:refresh.payloadSize`,{count:M})})]}),(0,h.jsxs)(`section`,{className:`space-y-2`,children:[(0,h.jsx)(`h2`,{className:`text-lg font-semibold`,children:n(`activity:refresh.probeLog`)}),A.length===0?(0,h.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n(`activity:refresh.noProbes`)}):(0,h.jsx)(`ul`,{className:`space-y-1 text-xs font-mono`,children:A.map((e,t)=>(0,h.jsxs)(`li`,{className:`flex items-center gap-2`,children:[e.ok?(0,h.jsx)(u,{className:`w-4 h-4 text-green-500 shrink-0`}):(0,h.jsx)(s,{className:`w-4 h-4 text-amber-500 shrink-0`}),(0,h.jsx)(`span`,{className:`text-muted-foreground`,children:new Date(e.ts).toLocaleTimeString()}),(0,h.jsx)(`span`,{children:e.note})]},`${e.ts}-${t}`))})]})]})})}function _({label:e,extra:t,ok:n,warn:r}){return(0,h.jsxs)(`div`,{className:`border rounded-lg px-3 py-2 ${r?`border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300`:n?`border-green-500/40 bg-green-500/10 text-green-700 dark:text-green-300`:`border-border bg-muted/40 text-muted-foreground`}`,children:[(0,h.jsxs)(`div`,{className:`text-xs font-medium flex items-center gap-2`,children:[n&&!r?(0,h.jsx)(u,{className:`w-4 h-4`}):(0,h.jsx)(s,{className:`w-4 h-4`}),e]}),(0,h.jsx)(`div`,{className:`text-xs font-mono mt-1 break-all`,children:t})]})}function v({label:e,value:t,mono:n}){return(0,h.jsxs)(`div`,{className:`border rounded-lg p-3 bg-card`,children:[(0,h.jsx)(`p`,{className:`text-xs uppercase tracking-wide text-muted-foreground`,children:e}),(0,h.jsx)(`p`,{className:`mt-1 text-sm break-all `+(n?`font-mono`:`font-medium`),children:t})]})}function y(e){let t=e.title?.trim();return t?`${e.id} — "${t}" (${e.provider}/${e.model})`:`${e.id} (${e.provider}/${e.model})`}function b(e){let t=(e.content??``).trim().replace(/\s+/g,` `);return`[${e.role}] ${t.length>100?`${t.slice(0,99)}…`:t}`}export{g as RefreshDebugView};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$n as r,Ar as i,Gt as a,Ir as o,It as s,Nn as c,Pr as l,Ur as u,X as d,Yt as f,Z as p,ar as m,bt as ee,ct as te,dt as h,lr as g,ot as _,pi as v,ri as y,ti as b,ui as x,xt as S,yr as C}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as w}from"./utils-C3qJEm2b.js";import{C as T,_ as E,a as ne,g as D,h as O,k,m as A,o as j,p as M,v as N,y as P}from"./index-Cb-hw9qG.js";import{a as F,c as I,i as L,l as re,n as R,o as z,r as B,s as V,t as H}from"./SddFlowGraph-DTWV-DPB.js";var U=e(t(),1),W=n();function ie({feed:e,now:t}){let{t:n}=x();return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5 border-b border-border px-3 py-2 text-xs font-semibold text-foreground`,children:[(0,W.jsx)(l,{className:`h-3.5 w-3.5 text-orange-500 dark:text-orange-400`}),n(`activity:sdd.activityHeading`)]}),(0,W.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-1 overflow-auto p-2`,children:e.length===0?(0,W.jsx)(`p`,{className:`px-1 pt-4 text-center text-[11px] text-muted-foreground`,children:n(`activity:sdd.feedEmpty`)}):e.map((e,n)=>{let r=B[e.kind]??B.started,i=r.icon;return(0,W.jsxs)(`div`,{className:w(`sdd-rise flex items-start gap-2 rounded-md px-2 py-1.5 text-[11px]`,n===0?`bg-muted`:`hover:bg-muted`),children:[(0,W.jsx)(i,{className:w(`mt-0.5 h-3.5 w-3.5 shrink-0`,r.color)}),(0,W.jsx)(`span`,{className:`flex-1 leading-snug text-foreground`,children:e.text}),(0,W.jsx)(`span`,{className:`shrink-0 tabular-nums text-[10px] text-muted-foreground`,children:z(e.ts,t)})]},`${e.ts}-${n}`)})})]})}function G({open:e,onOpenChange:t,snapshot:n,busy:r,onConfirm:i}){let{t:a}=x(),s=n?.mergedCommits?.length??0,c=n?.baseBranch,[l,d]=(0,U.useState)(!1);(0,U.useEffect)(()=>{e&&d(!1)},[e]);let f=n?.status===`running`||n?.status===`paused`,p=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.worktreeBranch&&e.add(t.worktreeBranch);return e.size},[n?.tasks]),m=(0,U.useMemo)(()=>{let e=new Set;for(let t of n?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.add(t.agentName);return e.size},[n?.tasks]);return(0,W.jsx)(A,{open:e,onOpenChange:e=>!r&&t(e),children:(0,W.jsxs)(O,{className:`sm:max-w-lg border-red-500/50`,children:[(0,W.jsxs)(N,{children:[(0,W.jsxs)(P,{className:`flex items-center gap-2`,children:[(0,W.jsx)(h,{className:`h-5 w-5 text-red-500`}),a(`activity:sdd.destroyTitle`)]}),(0,W.jsx)(D,{children:a(`activity:sdd.destroyDesc`)})]}),(0,W.jsxs)(`ul`,{className:`space-y-1.5 py-1 text-sm`,children:[f&&(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:m>0?a(`activity:sdd.stopRunAgents`,{count:m}):a(`activity:sdd.stopRun`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:p>0?a(`activity:sdd.removeWorktreesCount`,{count:p}):a(`activity:sdd.removeWorktreesAll`)})]}),(0,W.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(`span`,{className:`mt-0.5 text-red-500`,children:`■`}),(0,W.jsx)(`span`,{children:a(`activity:sdd.deleteArtifacts`)})]})]}),s>0&&(0,W.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/5 p-2.5 text-sm`,children:[(0,W.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e=>d(e.target.checked),className:`mt-0.5 h-4 w-4 accent-amber-500`}),(0,W.jsxs)(`span`,{children:[(0,W.jsx)(`span`,{className:`font-medium`,children:a(`activity:sdd.revertMerged`,{count:s})}),` `,`on `,(0,W.jsx)(`code`,{className:`text-xs`,children:c??a(`activity:sdd.baseBranchFallback`)}),(0,W.jsx)(`span`,{className:`block text-xs text-muted-foreground`,children:a(`activity:sdd.revertHint`)})]})]}),(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md bg-muted/50 p-2 text-xs text-muted-foreground`,children:[(0,W.jsx)(o,{className:`mt-0.5 h-3.5 w-3.5 shrink-0 text-amber-500`}),a(s>0&&!l?`activity:sdd.noteLeaveMerged`:`activity:sdd.noteAbandon`)]}),(0,W.jsxs)(E,{className:`gap-2 sm:gap-2`,children:[(0,W.jsx)(M,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>t(!1),children:a(`common:action.cancel`)}),(0,W.jsx)(M,{size:`sm`,disabled:r,onClick:()=>i(l),className:`bg-red-600 text-white hover:bg-red-700`,children:r?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(u,{className:`mr-1 h-3.5 w-3.5 animate-spin`}),` `,a(`activity:sdd.destroying`)]}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(h,{className:`mr-1 h-3.5 w-3.5`}),` `,a(`activity:sdd.destroyAll`)]})})]})]})})}var K=[{key:`pending`,labelKey:`kanbanBacklog`,accent:`border-slate-600/40`,head:`text-muted-foreground`},{key:`queued`,labelKey:`kanbanReady`,accent:`border-cyan-500/40`,head:`text-cyan-600 dark:text-cyan-300`},{key:`in_progress`,labelKey:`kanbanRunning`,accent:`border-amber-400/50`,head:`text-amber-600 dark:text-amber-300`},{key:`review`,labelKey:`kanbanReview`,accent:`border-sky-500/40`,head:`text-sky-600 dark:text-sky-300`},{key:`failed`,labelKey:`kanbanFailed`,accent:`border-red-500/40`,head:`text-red-600 dark:text-red-300`},{key:`completed`,labelKey:`kanbanDone`,accent:`border-emerald-500/40`,head:`text-emerald-600 dark:text-emerald-300`}];function q({tasks:e,selectedId:t,onTaskClick:n}){let{t:r}=x(),i=(0,U.useMemo)(()=>{let t=new Map;for(let e of K)t.set(e.key,[]);for(let n of e){let e=n.displayStatus===`blocked`?`pending`:n.displayStatus===`cancelled`?`failed`:n.displayStatus;(t.get(e)??t.get(`pending`))?.push(n)}return t},[e]);return(0,W.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 gap-3 overflow-x-auto p-4`,children:K.map(e=>{let a=i.get(e.key)??[];return(0,W.jsxs)(`div`,{className:`flex min-h-0 w-64 shrink-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:w(`mb-2 flex items-center gap-2 border-b-2 pb-1.5`,e.accent),children:[(0,W.jsx)(`span`,{className:w(`text-xs font-bold uppercase tracking-wide`,e.head),children:r(`activity:sdd.${e.labelKey}`)}),(0,W.jsx)(`span`,{className:`rounded-full bg-muted px-1.5 text-[10px] text-muted-foreground`,children:a.length})]}),(0,W.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:[a.map(e=>(0,W.jsx)(J,{task:e,selected:e.id===t,onClick:()=>n(e.id)},e.id)),a.length===0&&(0,W.jsx)(`div`,{className:`rounded-md border border-dashed border-border py-6 text-center text-[10px] text-muted-foreground`,children:r(`activity:sdd.kanbanEmpty`)})]})]},e.key)})})}function J({task:e,selected:t,onClick:n}){let r=e.displayStatus===`in_progress`;return(0,W.jsxs)(`button`,{type:`button`,onClick:n,className:w(`sdd-node-enter w-full rounded-lg border bg-card p-2 text-left transition hover:brightness-125`,t?`border-violet-400/70 ring-1 ring-violet-400/40`:`border-border`,r&&`sdd-node-running`,e.displayStatus===`completed`&&`sdd-node-complete`,e.displayStatus===`failed`&&`sdd-node-failed`),children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[r&&(0,W.jsx)(u,{className:`h-3 w-3 animate-spin text-amber-400`}),e.displayStatus===`completed`&&(0,W.jsx)(C,{className:`h-3 w-3 text-emerald-400`}),e.displayStatus===`failed`&&(0,W.jsx)(p,{className:`h-3 w-3 text-red-400`}),(0,W.jsx)(`span`,{className:`font-mono text-[10px] text-muted-foreground`,children:e.shortId}),(0,W.jsx)(`span`,{className:w(`ml-auto rounded px-1.5 text-[9px] font-bold uppercase`,I(e.priority).chip),children:e.priority})]}),(0,W.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-foreground`,children:e.title}),(e.agentName||e.worktreeBranch||e.retries)&&(0,W.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[e.agentName&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`span`,{className:w(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,r?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:F(e.agentName)}),(0,W.jsx)(`span`,{className:`max-w-[80px] truncate text-[10px] text-muted-foreground`,children:e.agentName})]}),e.retries?(0,W.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-red-400`,children:[(0,W.jsx)(s,{className:`h-2.5 w-2.5`}),e.retries]}):null,e.worktreeBranch&&(0,W.jsx)(c,{className:`ml-auto h-2.5 w-2.5 text-muted-foreground`})]})]})}function ae({task:e,allTasks:t,feed:n,now:r,modelCandidates:a,defaultModel:o,onClose:l,onRetry:u,onReassign:d,onSetModel:f,onSetVerification:m,onCancel:te,onDelete:v,onSplit:y,onSelectTask:b}){let{t:T}=x(),E=re(e.displayStatus),D=E.icon,O=e.displayStatus===`in_progress`,k=e.displayStatus===`pending`||e.displayStatus===`blocked`||e.displayStatus===`queued`,[A,j]=(0,U.useState)(!1),[M,N]=(0,U.useState)(``),[P,L]=(0,U.useState)(null),[R,z]=(0,U.useState)(!1),[B,H]=(0,U.useState)(``),[ie,G]=(0,U.useState)(!1),[K,q]=(0,U.useState)(e.verificationCommand??``),J=()=>{M.trim()&&(d(e.id,M.trim()),j(!1),N(``))},ae=()=>{let t=B.split(`
2
+ `).map(e=>e.trim()).filter(Boolean).map(e=>{let[t,...n]=e.split(`::`),r=(t??``).trim();return{title:r,description:n.join(`::`).trim()||r}}).filter(e=>e.title);t.length&&(y(e.id,t),z(!1),H(``))},se=(0,U.useMemo)(()=>new Map(t.map(e=>[e.shortId,e])),[t]),X=(0,U.useMemo)(()=>t.filter(t=>t.deps.includes(e.shortId)),[t,e.shortId]),Z=(0,U.useMemo)(()=>n.filter(t=>t.taskShortId===e.shortId),[n,e.shortId]),ce=e.startedAt&&!e.completedAt?V(r-e.startedAt):e.startedAt&&e.completedAt?V(e.completedAt-e.startedAt):null;return(0,W.jsxs)(`div`,{className:`sdd-rise flex h-full min-h-0 min-w-0 flex-col`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-2`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:l,className:`text-muted-foreground hover:text-foreground`,title:T(`activity:sddTask.backTitle`),children:(0,W.jsx)(i,{className:`h-4 w-4`})}),(0,W.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,W.jsxs)(`span`,{className:w(`ml-auto flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px]`,E.ring,E.text),children:[(0,W.jsx)(D,{className:w(`h-3 w-3`,O&&`animate-spin`)}),E.label]})]}),(0,W.jsxs)(`div`,{className:`min-h-0 min-w-0 flex-1 space-y-3 overflow-auto p-3`,children:[(0,W.jsx)(`h3`,{className:`text-sm font-semibold leading-snug text-foreground`,children:e.title}),e.agentName&&(0,W.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-border bg-muted p-2`,children:[(0,W.jsx)(`span`,{className:w(`flex h-7 w-7 items-center justify-center rounded-full text-[10px] font-bold text-white`,O?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:F(e.agentName)}),(0,W.jsxs)(`div`,{className:`leading-tight`,children:[(0,W.jsx)(`div`,{className:`text-xs font-medium text-foreground`,children:e.agentName}),(0,W.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:T(O?`activity:sddTask.workingOn`:`activity:sddTask.assigned`)})]})]}),(0,W.jsxs)(`div`,{className:`grid grid-cols-2 gap-1.5 text-[11px]`,children:[(0,W.jsx)(Y,{label:T(`activity:sddTask.metaPriority`),children:(0,W.jsx)(`span`,{className:w(`font-medium uppercase`,I(e.priority).text),children:e.priority})}),(0,W.jsx)(Y,{label:T(`activity:sddTask.metaType`),children:e.type}),ce&&(0,W.jsx)(Y,{label:e.completedAt?T(`activity:sddTask.metaDuration`):T(`activity:sddTask.metaElapsed`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(g,{className:`h-3 w-3 text-muted-foreground`}),ce]})}),e.retries?(0,W.jsx)(Y,{label:T(`activity:sddTask.metaRetries`),children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 text-red-400`,children:[(0,W.jsx)(s,{className:`h-3 w-3`}),e.retries]})}):null,e.worktreeBranch&&(0,W.jsx)(Y,{label:T(`activity:sddTask.metaWorktree`),full:!0,children:(0,W.jsxs)(`span`,{className:`flex items-center gap-1 font-mono text-foreground`,title:e.worktreeBranch,children:[(0,W.jsx)(c,{className:`h-3 w-3 text-muted-foreground`}),(0,W.jsx)(`span`,{className:`truncate`,children:e.worktreeBranch})]})})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[T(`activity:sddTask.workerModel`),!e.model&&o&&(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,T(`activity:sddTask.runDefault`,{model:o})]})]}),(0,W.jsx)(ne,{value:e.model,provider:e.provider,candidates:a,placeholder:o?T(`activity:sddTask.runDefaultPlaceholderModel`,{model:o}):T(`activity:sddTask.runDefaultPlaceholder`),onPick:(t,n)=>f(e.id,t,n),onReset:e.model?()=>f(e.id,void 0,void 0):void 0}),e.fallbackModels&&e.fallbackModels.length>0&&(0,W.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-1`,children:e.fallbackModels.map((e,t)=>(0,W.jsxs)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:[`↳ `,e]},t))})]}),(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[T(`activity:sddTask.verificationCmd`),(0,W.jsxs)(`span`,{className:`font-normal normal-case text-muted-foreground`,children:[`· `,T(`activity:sddTask.gatesCompletion`)]})]}),ie?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:K,onChange:e=>q(e.target.value),onKeyDown:t=>{t.key===`Enter`?(m(e.id,K.trim()||void 0),G(!1)):t.key===`Escape`&&(q(e.verificationCommand??``),G(!1))},placeholder:T(`activity:sddTask.verifyPlaceholder`),className:`w-full rounded border border-border bg-background px-2 py-1 font-mono text-[11px] text-foreground`}),(0,W.jsxs)(`div`,{className:`flex gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,onClick:()=>{m(e.id,K.trim()||void 0),G(!1)},className:`rounded bg-primary px-2 py-0.5 text-[10px] text-primary-foreground hover:opacity-90`,children:T(`common:action.save`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{q(e.verificationCommand??``),G(!1)},className:`rounded bg-muted px-2 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.cancel`)})]})]}):e.verificationCommand?(0,W.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,W.jsx)(`code`,{className:`flex-1 truncate rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-foreground`,children:e.verificationCommand}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.edit`)}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>m(e.id,void 0),className:`rounded bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground hover:bg-muted/80`,children:T(`common:action.clear`)})]}):(0,W.jsx)(`button`,{type:`button`,onClick:()=>G(!0),className:`rounded border border-dashed border-border px-2 py-1 text-[10px] text-muted-foreground hover:bg-muted`,children:T(`activity:sddTask.addVerify`)})]}),e.description&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:T(`activity:sddTask.description`)}),(0,W.jsx)(`p`,{className:`whitespace-pre-wrap rounded-md bg-muted p-2 text-[11px] leading-relaxed text-foreground`,children:e.description})]}),Z.length>0&&(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:T(`activity:sddTask.timeline`)}),(0,W.jsx)(`div`,{className:`space-y-1 border-l border-border pl-2.5`,children:Z.map((e,t)=>(0,W.jsxs)(`div`,{className:`relative text-[11px] leading-snug text-foreground`,children:[(0,W.jsx)(`span`,{className:w(`absolute -left-[14px] top-1 h-1.5 w-1.5 rounded-full`,e.kind===`completed`?`bg-emerald-400`:e.kind===`failed`?`bg-red-400`:e.kind===`retrying`?`bg-orange-400`:`bg-amber-400`)}),e.text]},`${e.ts}-${t}`))})]}),e.deps.length>0&&(0,W.jsx)(oe,{title:T(`activity:sddTask.dependsOn`),shortIds:e.deps,byShort:se,onSelectTask:b}),X.length>0&&(0,W.jsx)(oe,{title:T(`activity:sddTask.blocks`),shortIds:X.map(e=>e.shortId),byShort:se,onSelectTask:b})]}),(0,W.jsxs)(`div`,{className:`border-t border-border p-2`,children:[A?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-1.5`,children:[(0,W.jsx)(`input`,{autoFocus:!0,value:M,onChange:e=>N(e.target.value),onKeyDown:e=>{e.key===`Enter`&&J(),e.key===`Escape`&&j(!1)},placeholder:T(`activity:sddTask.newWorkerPlaceholder`),className:`min-w-0 flex-1 rounded-md border border-border bg-background px-2 py-1.5 text-xs outline-none focus:border-violet-500`}),(0,W.jsx)(`button`,{type:`button`,onClick:J,disabled:!M.trim(),className:`rounded-md bg-violet-500/20 px-2 py-1.5 text-xs font-medium text-violet-700 dark:text-violet-200 hover:bg-violet-500/30 disabled:opacity-40`,children:(0,W.jsx)(C,{className:`h-3.5 w-3.5`})}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>j(!1),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})})]}):P?(0,W.jsxs)(`div`,{className:`sdd-rise flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`flex-1 text-xs text-foreground`,children:T(P===`stop`?`activity:sddTask.confirmStop`:`activity:sddTask.confirmDelete`)}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>{P===`stop`?te(e.id):v(e.id),L(null)},className:`inline-flex items-center gap-1 rounded-md bg-red-500/20 px-2.5 py-1.5 text-xs font-medium text-red-700 dark:text-red-200 hover:bg-red-500/30`,children:[(0,W.jsx)(C,{className:`h-3.5 w-3.5`}),` `,T(P===`stop`?`common:action.stop`:`common:action.delete`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>L(null),className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})})]}):(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>u(e.id),title:T(`activity:sddTask.retryTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-orange-500/15 py-1.5 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(s,{className:`h-3.5 w-3.5`}),` `,T(`common:action.retry`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>j(!0),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-violet-500/15 py-1.5 text-xs font-medium text-violet-600 dark:text-violet-300 hover:bg-violet-500/25`,children:[(0,W.jsx)(_,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.reassign`)]}),O&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>L(`stop`),title:T(`activity:sddTask.stopTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/15 py-1.5 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(ee,{className:`h-3.5 w-3.5`}),` `,T(`common:action.stop`)]}),!O&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>z(!0),title:T(`activity:sddTask.splitTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/15 py-1.5 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.split`)]}),k&&(0,W.jsxs)(`button`,{type:`button`,onClick:()=>L(`delete`),title:T(`activity:sddTask.deleteTitle`),className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-red-500/10 py-1.5 text-xs font-medium text-red-600 dark:text-red-300/90 hover:bg-red-500/20`,children:[(0,W.jsx)(h,{className:`h-3.5 w-3.5`}),` `,T(`common:action.delete`)]})]}),R&&(0,W.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,W.jsx)(`label`,{className:`text-[11px] text-muted-foreground`,htmlFor:`sdd-split-input`,children:T(`activity:sddTask.splitHint`)}),(0,W.jsx)(`textarea`,{id:`sdd-split-input`,autoFocus:!0,rows:3,value:B,onChange:e=>H(e.target.value),placeholder:T(`activity:sddTask.splitPlaceholder`),className:`w-full resize-y rounded-md border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-sky-500`}),(0,W.jsxs)(`div`,{className:`flex gap-2`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:ae,className:`inline-flex flex-1 items-center justify-center gap-1 rounded-md bg-sky-500/20 py-1.5 text-xs font-medium text-sky-700 dark:text-sky-200 hover:bg-sky-500/30`,children:[(0,W.jsx)(S,{className:`h-3.5 w-3.5`}),` `,T(`activity:sddTask.splitInto`)]}),(0,W.jsx)(`button`,{type:`button`,onClick:()=>{z(!1),H(``)},className:`rounded-md bg-muted px-2 py-1.5 text-xs text-muted-foreground hover:bg-muted`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})})]})]})]})]})}function Y({label:e,children:t,full:n}){return(0,W.jsxs)(`div`,{className:w(`rounded-md border border-border bg-muted/50 px-2 py-1`,n&&`col-span-2`),children:[(0,W.jsx)(`div`,{className:`text-[9px] uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`text-foreground`,children:t})]})}function oe({title:e,shortIds:t,byShort:n,onSelectTask:r}){return(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:t.map(e=>{let t=n.get(e);return(0,W.jsxs)(`button`,{type:`button`,disabled:!t,onClick:()=>t&&r(t.id),className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-foreground hover:bg-muted disabled:opacity-50`,title:t?.title,children:[(0,W.jsx)(`span`,{className:w(`h-1.5 w-1.5 rounded-full`,re(t?.displayStatus??`pending`).dot)}),(0,W.jsx)(`span`,{className:`font-mono`,children:e})]},e)})})]})}function se({pct:e}){let t=2*Math.PI*26,n=t-Math.max(0,Math.min(100,e))/100*t;return(0,W.jsxs)(`div`,{className:`relative h-16 w-16 shrink-0`,children:[(0,W.jsxs)(`svg`,{viewBox:`0 0 64 64`,className:`h-16 w-16 -rotate-90`,children:[(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`hsl(215 28% 22%)`,strokeWidth:`6`}),(0,W.jsx)(`circle`,{cx:`32`,cy:`32`,r:26,fill:`none`,stroke:`url(#sddgrad)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:t,strokeDashoffset:n,style:{transition:`stroke-dashoffset 0.6s cubic-bezier(0.16,1,0.3,1)`}}),(0,W.jsx)(`defs`,{children:(0,W.jsxs)(`linearGradient`,{id:`sddgrad`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,W.jsx)(`stop`,{offset:`0%`,stopColor:`#a78bfa`}),(0,W.jsx)(`stop`,{offset:`100%`,stopColor:`#22d3ee`})]})})]}),(0,W.jsxs)(`div`,{className:`absolute inset-0 flex items-center justify-center text-sm font-bold text-foreground`,children:[Math.round(e),`%`]})]})}function X({onClose:e}){let{t}=x(),{client:n}=T(),i=k(e=>e.snapshot),c=k(e=>e.lifecycleResult),u=k(e=>e.destroying),g=k(e=>e.setDestroying),_=k(e=>e.setLifecycleResult),[v,y]=(0,U.useState)(()=>Date.now()),[b,S]=(0,U.useState)(null),[C,E]=(0,U.useState)(`graph`),[ne,D]=(0,U.useState)(!1);(0,U.useEffect)(()=>{n?.send?.({type:`sdd.board.get`})},[n]);let O=i&&(i.status===`running`||i.status===`paused`);(0,U.useEffect)(()=>{if(!O)return;let e=setInterval(()=>y(Date.now()),1e3);return y(Date.now()),()=>clearInterval(e)},[O]);let A=(0,U.useCallback)(e=>n?.send?.(e),[n]),N=(0,U.useRef)(null),P=(0,U.useCallback)(e=>{N.current=null,A({type:`sdd.board.destroy`,payload:{revertMerged:e}})},[A]),I=(0,U.useCallback)(e=>{D(!1),_(null),g(!0),O?(A({type:`sdd.board.stop`,payload:{}}),N.current={revertMerged:e,deadline:Date.now()+2e4}):P(e)},[O,A,P,g,_]);(0,U.useEffect)(()=>{let e=N.current;e&&(!O||Date.now()>=e.deadline)&&P(e.revertMerged)},[O,i,P]);let re=(0,U.useCallback)(()=>{_(null),A({type:`sdd.board.cleanup_worktrees`,payload:{}})},[A,_]),z=(0,U.useCallback)(()=>{_(null),A({type:`sdd.board.rollback`,payload:{}})},[A,_]),B=(0,U.useMemo)(()=>(i?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch})),[i?.tasks]),K=(0,U.useMemo)(()=>{let e=new Map;for(let t of i?.tasks??[])t.displayStatus===`in_progress`&&t.agentName&&e.set(t.agentName,{name:t.agentName,task:t.title});return[...e.values()]},[i?.tasks]),J=(0,U.useCallback)(e=>S(e),[]),Y=(0,U.useCallback)(e=>A({type:`sdd.board.retry`,payload:{taskId:e}}),[A]),oe=(0,U.useCallback)(()=>A({type:`sdd.board.retry_all_failed`,payload:{}}),[A]),X=(0,U.useCallback)((e,t)=>{let n=t.trim();n&&A({type:`sdd.board.reassign`,payload:{taskId:e,agentName:n}})},[A]),Z=(0,U.useCallback)((e,t,n)=>A({type:`sdd.board.set_task_model`,payload:{taskId:e,model:t,provider:n}}),[A]),le=(0,U.useCallback)((e,t)=>A({type:`sdd.board.set_task_verification`,payload:{taskId:e,verificationCommand:t}}),[A]),ue=(0,U.useCallback)(e=>A({type:`sdd.board.cancel_task`,payload:{taskId:e}}),[A]),de=(0,U.useCallback)(e=>{A({type:`sdd.board.delete_task`,payload:{taskId:e}}),S(null)},[A]),fe=(0,U.useCallback)((e,t)=>{A({type:`sdd.board.split_task`,payload:{taskId:e,subtasks:t}}),S(null)},[A]),pe=j(b!==null),me=(0,U.useMemo)(()=>i?.tasks.find(e=>e.id===b)??null,[i?.tasks,b]),$=i?.progress,he=i?.diagnostics?.deadlockChains??[];return(0,W.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,W.jsxs)(`header`,{className:`sdd-sheen shrink-0 border-b border-border px-4 pb-3 pt-2.5`,children:[(0,W.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(l,{className:`h-5 w-5 text-orange-400`}),(0,W.jsx)(`h1`,{className:`text-lg font-semibold text-foreground`,children:i?.title??t(`activity:sddBoard.titleFallback`)}),i&&(0,W.jsx)(`span`,{className:w(`rounded-full border px-2 py-0.5 text-[11px] font-medium capitalize`,L[i.status]??L.idle),children:i.status}),i?.defaultModel&&(0,W.jsxs)(`span`,{className:`flex items-center gap-1 rounded-full border border-border bg-muted px-2 py-0.5 text-[10px] text-muted-foreground`,title:t(`activity:sddBoard.defaultModelTitle`),children:[(0,W.jsx)(m,{className:`h-3 w-3 text-violet-400`}),i.defaultModel]})]}),(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[i&&(0,W.jsx)(`div`,{className:`flex items-center rounded-md border border-border bg-muted p-0.5 text-[11px]`,children:[`graph`,`kanban`].map(e=>(0,W.jsx)(`button`,{type:`button`,onClick:()=>E(e),className:w(`rounded px-2 py-0.5 capitalize transition`,C===e?`bg-violet-500/25 text-violet-700 dark:text-violet-200`:`text-muted-foreground hover:text-foreground`),children:t(e===`graph`?`activity:sddBoard.graphLabel`:`activity:sddBoard.kanbanLabel`)},e))}),O&&($?.failed??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:oe,title:t(`activity:sddBoard.retryAllTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-600 dark:text-orange-300 hover:bg-orange-500/25`,children:[(0,W.jsx)(s,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.retryFailed`,{count:$?.failed??0})]}),O&&(0,W.jsxs)(W.Fragment,{children:[i?.status===`paused`?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.resume`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-sky-500/15 px-2.5 py-1 text-xs font-medium text-sky-600 dark:text-sky-300 hover:bg-sky-500/25`,children:[(0,W.jsx)(a,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.resume`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.pause`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(f,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.pause`)]}),(0,W.jsxs)(`button`,{type:`button`,onClick:()=>A({type:`sdd.board.stop`,payload:{}}),className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300 hover:bg-red-500/25`,children:[(0,W.jsx)(ee,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.stop`)]})]}),i&&!O&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`button`,{type:`button`,onClick:re,title:t(`activity:sddBoard.cleanTitle`),className:`inline-flex items-center gap-1 rounded-md bg-slate-500/15 px-2.5 py-1 text-xs font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-500/25`,children:[(0,W.jsx)(r,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.cleanWorktrees`)]}),(i.mergedCommits?.length??0)>0&&(0,W.jsxs)(`button`,{type:`button`,onClick:z,title:t(`activity:sddBoard.rollbackTitle`,{count:i.mergedCommits?.length??0,base:i.baseBranch??t(`activity:sdd.baseBranchFallback`)}),className:`inline-flex items-center gap-1 rounded-md bg-amber-500/15 px-2.5 py-1 text-xs font-medium text-amber-600 dark:text-amber-300 hover:bg-amber-500/25`,children:[(0,W.jsx)(te,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.rollback`,{count:i.mergedCommits?.length??0})]})]}),i&&(u?(0,W.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md bg-red-500/15 px-2.5 py-1 text-xs font-medium text-red-600 dark:text-red-300`,children:[(0,W.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}),` `,t(O?`activity:sddBoard.stopping`:`activity:sddBoard.destroying`)]}):(0,W.jsxs)(`button`,{type:`button`,onClick:()=>D(!0),title:t(`activity:sddBoard.destroyTitle`),className:`inline-flex items-center gap-1 rounded-md bg-red-600/90 px-2.5 py-1 text-xs font-medium text-white hover:bg-red-700`,children:[(0,W.jsx)(h,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddBoard.destroy`)]})),(0,W.jsx)(M,{variant:`ghost`,size:`icon`,onClick:e,children:(0,W.jsx)(p,{className:`h-4 w-4`})})]})]}),i&&$&&(0,W.jsxs)(`div`,{className:`mt-2.5 flex items-center gap-5`,children:[(0,W.jsx)(se,{pct:$.percentComplete}),(0,W.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[(0,W.jsx)(Q,{label:t(`activity:sddBoard.statDone`),value:`${$.completed}/${$.total}`,color:`text-emerald-600 dark:text-emerald-300`}),$.inProgress>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statRunning`),value:$.inProgress,color:`text-amber-600 dark:text-amber-300`}),$.failed>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statFailed`),value:$.failed,color:`text-red-600 dark:text-red-300`}),(0,W.jsx)(Q,{label:t(`activity:sddBoard.statWave`),value:i.wave+1,color:`text-violet-600 dark:text-violet-300`}),O&&i.startedAt>0&&(0,W.jsx)(Q,{label:t(`activity:sddBoard.statElapsed`),value:V(v-i.startedAt),color:`text-foreground`})]}),(0,W.jsx)(`div`,{className:`flex min-h-[24px] items-center gap-1.5`,children:K.length===0?(0,W.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:t(`activity:sddBoard.noActiveWorkers`)}):K.map((e,t)=>(0,W.jsxs)(`span`,{title:`${e.name} → ${e.task}`,className:`flex items-center gap-1 rounded-full bg-muted py-0.5 pl-0.5 pr-2`,children:[(0,W.jsx)(`span`,{className:w(`sdd-agent-live flex h-5 w-5 items-center justify-center rounded-full text-[9px] font-bold text-white`,R[t%R.length]),children:F(e.name)}),(0,W.jsx)(`span`,{className:`max-w-[90px] truncate text-[11px] text-foreground`,children:e.name})]},e.name))})]})]})]}),c&&(0,W.jsx)(ce,{result:c,onDismiss:()=>_(null)}),he.length>0&&(0,W.jsxs)(`div`,{className:`flex items-start gap-2 border-b border-rose-500/30 bg-rose-500/5 px-4 py-2 text-xs text-rose-600 dark:text-rose-300`,children:[(0,W.jsx)(o,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsxs)(`div`,{children:[(0,W.jsx)(`div`,{className:`font-semibold`,children:t(`activity:sddBoard.deadlock`)}),he.map(e=>(0,W.jsxs)(`div`,{className:`font-mono`,children:[e.blocked,` ← `,e.blockedBy.join(`, `)]},e.blocked))]})]}),(0,W.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1`,children:[(0,W.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:i?C===`graph`?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(H,{tasks:B,columns:i.columns,onTaskClick:J}),(0,W.jsx)(`div`,{className:`pointer-events-none absolute bottom-2 left-1/2 -translate-x-1/2 rounded-full bg-black/40 px-2 py-0.5 text-[10px] text-muted-foreground backdrop-blur`,children:t(`activity:sddBoard.clickTaskHint`)})]}):(0,W.jsx)(q,{tasks:i.tasks,selectedId:b,onTaskClick:J}):(0,W.jsxs)(`div`,{className:`flex h-full flex-col items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,W.jsx)(d,{className:`h-10 w-10 text-violet-500/40`}),(0,W.jsx)(`p`,{className:`text-foreground`,children:t(`activity:sddBoard.noRunTitle`)}),(0,W.jsx)(`p`,{className:`max-w-sm text-center text-xs text-muted-foreground`,children:t(`activity:sddBoard.noRunBody`)})]})}),i&&(0,W.jsx)(`aside`,{className:`w-80 shrink-0 border-l border-border bg-card`,children:me?(0,W.jsx)(ae,{task:me,allTasks:i.tasks,feed:i.feed??[],now:v,modelCandidates:pe,defaultModel:i.defaultModel,onClose:()=>S(null),onRetry:Y,onReassign:X,onSetModel:Z,onSetVerification:le,onCancel:ue,onDelete:de,onSplit:fe,onSelectTask:S},me.id):(0,W.jsx)(ie,{feed:i.feed??[],now:v})})]}),(0,W.jsx)(G,{open:ne,onOpenChange:D,snapshot:i,busy:u,onConfirm:I})]})}function Z(e){let t=e.op===`cleanup_worktrees`?`lcClean`:e.op===`rollback`?`lcRollback`:`lcDestroy`,n=v.t(`activity:sddBoard.${t}`);if(!e.ok)return v.t(`activity:sddBoard.lcFailed`,{op:n,reason:e.reason??v.t(`activity:sddBoard.lcUnknownError`)});let r=[];typeof e.removed==`number`&&r.push(v.t(`activity:sddBoard.lcWorktrees`,{count:e.removed})),typeof e.reverted==`number`&&e.reverted>0&&r.push(v.t(`activity:sddBoard.lcCommits`,{count:e.reverted})),e.deleted?.length&&r.push(v.t(`activity:sddBoard.lcDeleted`,{items:e.deleted.join(`, `)}));let i=r.length?r.join(` · `):v.t(`activity:sddBoard.lcNothing`);return e.reason?v.t(`activity:sddBoard.lcNote`,{op:n,body:i,reason:e.reason}):v.t(`activity:sddBoard.lcOk`,{op:n,body:i})}function ce({result:e,onDismiss:t}){let n=!e.ok||!!e.reason;return(0,W.jsxs)(`div`,{className:w(`flex items-start gap-2 border-b px-4 py-2 text-xs`,n?`border-amber-500/30 bg-amber-500/5 text-amber-700 dark:text-amber-300`:`border-emerald-500/30 bg-emerald-500/5 text-emerald-700 dark:text-emerald-300`),children:[n?(0,W.jsx)(b,{className:`mt-0.5 h-4 w-4 shrink-0`}):(0,W.jsx)(y,{className:`mt-0.5 h-4 w-4 shrink-0`}),(0,W.jsx)(`span`,{className:`flex-1`,children:Z(e)}),(0,W.jsx)(`button`,{type:`button`,onClick:t,className:`shrink-0 opacity-60 hover:opacity-100`,children:(0,W.jsx)(p,{className:`h-3.5 w-3.5`})})]})}function Q({label:e,value:t,color:n}){return(0,W.jsxs)(`span`,{className:`flex items-baseline gap-1`,children:[(0,W.jsx)(`span`,{className:w(`font-semibold tabular-nums`,n),children:t}),(0,W.jsx)(`span`,{className:`text-[10px] uppercase tracking-wide text-muted-foreground`,children:e})]})}export{X as SddBoardView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Cr as r,Et as i,Hr as a,It as o,Pr as s,Ut as c,Vr as l,Z as u,_r as d,ci as f,jn as p,kn as m,ur as h,xt as g,yr as _}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as v}from"./utils-DBns3uMk.js";import{a as y,c as b,m as x,n as S,o as C,p as w,r as T,t as E,u as D}from"./xyflow-D5_yey7w.js";var O=e(t(),1),k={pending:{label:`Pending`,icon:h,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-600/50 dark:bg-slate-700/20`,dot:`bg-slate-500`,hex:`#64748b`},queued:{label:`Ready`,icon:h,text:`text-cyan-600 dark:text-cyan-300`,ring:`border-cyan-500/50 bg-cyan-500/10`,dot:`bg-cyan-400`,hex:`#22d3ee`},in_progress:{label:`Running`,icon:l,spin:!0,text:`text-amber-600 dark:text-amber-300`,ring:`border-amber-400/60 bg-amber-500/10`,dot:`bg-amber-400`,hex:`#fbbf24`},blocked:{label:`Blocked`,icon:h,text:`text-fuchsia-600 dark:text-fuchsia-300`,ring:`border-fuchsia-500/50 bg-fuchsia-500/10`,dot:`bg-fuchsia-400`,hex:`#e879f9`},review:{label:`Review`,icon:h,text:`text-sky-600 dark:text-sky-300`,ring:`border-sky-500/50 bg-sky-500/10`,dot:`bg-sky-400`,hex:`#38bdf8`},failed:{label:`Failed`,icon:u,text:`text-red-600 dark:text-red-300`,ring:`border-red-500/60 bg-red-500/10`,dot:`bg-red-400`,hex:`#f87171`},completed:{label:`Done`,icon:d,text:`text-emerald-600 dark:text-emerald-300`,ring:`border-emerald-500/55 bg-emerald-500/10`,dot:`bg-emerald-400`,hex:`#34d399`},cancelled:{label:`Cancelled`,icon:r,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-500/50 dark:bg-slate-600/20`,dot:`bg-slate-500`,hex:`#94a3b8`}};function A(e){return k[e]??k.pending}var j={critical:{text:`text-red-600 dark:text-red-400`,chip:`bg-red-500/20 text-red-600 dark:text-red-300`},high:{text:`text-amber-600 dark:text-amber-400`,chip:`bg-amber-500/20 text-amber-600 dark:text-amber-300`},medium:{text:`text-cyan-600 dark:text-cyan-400`,chip:`bg-cyan-500/15 text-cyan-600 dark:text-cyan-300`},low:{text:`text-slate-500 dark:text-slate-400`,chip:`bg-slate-400/20 text-slate-600 dark:bg-slate-600/30 dark:text-slate-400`}};function M(e){return j[e]??j.medium}var N={running:`border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-300`,paused:`border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-300`,stopped:`border-zinc-500/40 bg-zinc-500/10 text-zinc-600 dark:text-zinc-300`,completed:`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`,failed:`border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-300`,deadlocked:`border-rose-500/40 bg-rose-500/10 text-rose-600 dark:text-rose-300`,idle:`border-border bg-muted text-muted-foreground`},P=[`bg-amber-500`,`bg-sky-500`,`bg-violet-500`,`bg-emerald-500`,`bg-rose-500`,`bg-cyan-500`,`bg-fuchsia-500`],F={started:{icon:c,color:`text-amber-400`},completed:{icon:d,color:`text-emerald-400`},failed:{icon:u,color:`text-red-400`},retrying:{icon:o,color:`text-orange-400`},wave:{icon:a,color:`text-violet-400`},deadlock:{icon:s,color:`text-rose-400`},verification_failed:{icon:i,color:`text-red-400`},conflict:{icon:m,color:`text-amber-400`},split:{icon:g,color:`text-sky-400`},supervisor:{icon:_,color:`text-fuchsia-400`}};function I(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function L(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function R(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var z=n(),B=300,V=128,H=240,U={pending:{ring:`border-slate-600/50`,chip:`bg-slate-700/40 text-slate-400`,dot:`bg-slate-500`},queued:{ring:`border-cyan-500/50`,chip:`bg-cyan-500/15 text-cyan-300`,dot:`bg-cyan-400`},in_progress:{ring:`border-amber-400/70`,chip:`bg-amber-500/20 text-amber-300`,dot:`bg-amber-400`},blocked:{ring:`border-fuchsia-500/50`,chip:`bg-fuchsia-500/15 text-fuchsia-300`,dot:`bg-fuchsia-400`},review:{ring:`border-sky-500/50`,chip:`bg-sky-500/15 text-sky-300`,dot:`bg-sky-400`},failed:{ring:`border-red-500/60`,chip:`bg-red-500/15 text-red-300`,dot:`bg-red-400`},completed:{ring:`border-emerald-500/55`,chip:`bg-emerald-500/15 text-emerald-300`,dot:`bg-emerald-400`},cancelled:{ring:`border-slate-500/50`,chip:`bg-slate-600/25 text-slate-400`,dot:`bg-slate-500`}};function W({data:e}){let t=e.task,{t:n}=f(),r=U[t.displayStatus],i=t.displayStatus===`in_progress`,a=t.displayStatus===`completed`?d:t.displayStatus===`failed`?u:i?l:h;return(0,z.jsxs)(`div`,{className:v(`sdd-node-enter group relative rounded-lg border bg-[#0e1117]/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,r.ring,i&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`cursor-pointer hover:brightness-125`),style:{width:H,animationDelay:`${Math.min(e.index*45,600)}ms`},onClick:()=>e.onTaskClick?.(t.id),children:[(0,z.jsx)(y,{type:`target`,position:x.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsx)(y,{type:`source`,position:x.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(a,{className:v(`h-3.5 w-3.5`,i&&`animate-spin`,r.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,z.jsx)(`span`,{className:`font-mono text-[10px] text-slate-500`,children:t.shortId}),(0,z.jsx)(`span`,{className:v(`font-mono text-[10px] font-bold uppercase`,M(t.priority).text),children:t.priority[0]}),(0,z.jsx)(`span`,{className:v(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,r.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-slate-200`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`span`,{className:v(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,i?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:I(t.agentName)}),(0,z.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-slate-300`,children:t.agentName})]}),t.retries?(0,z.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-red-400`,children:[(0,z.jsx)(o,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-slate-500`,title:t.worktreeBranch,children:[(0,z.jsx)(p,{className:`h-2.5 w-2.5`}),(0,z.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function G({data:e}){return(0,z.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase tracking-wider text-slate-500`,children:e.label})}var K={task:W,colLabel:G};function q(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*B,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*B,y:o*V},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:A(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function J({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=w(),{nodes:i,edges:a}=(0,O.useMemo)(()=>q(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,z.jsxs)(D,{nodes:i,edges:a,nodeTypes:K,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,z.jsx)(E,{variant:S.Dots,gap:22,size:1,color:`#1e293b`}),(0,z.jsx)(T,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,z.jsx)(C,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`rgba(2,6,23,0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?A(t).hex:`#334155`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-white/10`})]})}function Y({tasks:e,columns:t,onTaskClick:n}){return(0,z.jsx)(b,{children:(0,z.jsx)(J,{tasks:e,columns:t,onTaskClick:n})})}export{I as a,M as c,N as i,A as l,P as n,R as o,F as r,L as s,Y as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Et as r,Gt as i,Ir as a,It as o,Nn as s,Tr as c,Ur as l,Wr as u,Z as d,fr as f,jn as p,ui as m,xr as h,xt as g,yr as _}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as v}from"./utils-C3qJEm2b.js";import{a as y,c as b,m as x,n as S,o as C,p as w,r as T,t as E,u as D}from"./xyflow-Dy5Edi88.js";var O=e(t(),1),k={pending:{label:`Pending`,icon:f,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-600/50 dark:bg-slate-700/20`,dot:`bg-slate-500`,hex:`#64748b`},queued:{label:`Ready`,icon:f,text:`text-cyan-600 dark:text-cyan-300`,ring:`border-cyan-500/50 bg-cyan-500/10`,dot:`bg-cyan-400`,hex:`#22d3ee`},in_progress:{label:`Running`,icon:l,spin:!0,text:`text-amber-600 dark:text-amber-300`,ring:`border-amber-400/60 bg-amber-500/10`,dot:`bg-amber-400`,hex:`#fbbf24`},blocked:{label:`Blocked`,icon:f,text:`text-fuchsia-600 dark:text-fuchsia-300`,ring:`border-fuchsia-500/50 bg-fuchsia-500/10`,dot:`bg-fuchsia-400`,hex:`#e879f9`},review:{label:`Review`,icon:f,text:`text-sky-600 dark:text-sky-300`,ring:`border-sky-500/50 bg-sky-500/10`,dot:`bg-sky-400`,hex:`#38bdf8`},failed:{label:`Failed`,icon:d,text:`text-red-600 dark:text-red-300`,ring:`border-red-500/60 bg-red-500/10`,dot:`bg-red-400`,hex:`#f87171`},completed:{label:`Done`,icon:_,text:`text-emerald-600 dark:text-emerald-300`,ring:`border-emerald-500/55 bg-emerald-500/10`,dot:`bg-emerald-400`,hex:`#34d399`},cancelled:{label:`Cancelled`,icon:c,text:`text-slate-500 dark:text-slate-400`,ring:`border-slate-400/50 bg-slate-400/10 dark:border-slate-500/50 dark:bg-slate-600/20`,dot:`bg-slate-500`,hex:`#94a3b8`}};function A(e){return k[e]??k.pending}var j={critical:{text:`text-red-600 dark:text-red-400`,chip:`bg-red-500/20 text-red-600 dark:text-red-300`},high:{text:`text-amber-600 dark:text-amber-400`,chip:`bg-amber-500/20 text-amber-600 dark:text-amber-300`},medium:{text:`text-cyan-600 dark:text-cyan-400`,chip:`bg-cyan-500/15 text-cyan-600 dark:text-cyan-300`},low:{text:`text-slate-500 dark:text-slate-400`,chip:`bg-slate-400/20 text-slate-600 dark:bg-slate-600/30 dark:text-slate-400`}};function M(e){return j[e]??j.medium}var N={running:`border-sky-500/40 bg-sky-500/10 text-sky-600 dark:text-sky-300`,paused:`border-amber-500/40 bg-amber-500/10 text-amber-600 dark:text-amber-300`,stopped:`border-zinc-500/40 bg-zinc-500/10 text-zinc-600 dark:text-zinc-300`,completed:`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-300`,failed:`border-red-500/40 bg-red-500/10 text-red-600 dark:text-red-300`,deadlocked:`border-rose-500/40 bg-rose-500/10 text-rose-600 dark:text-rose-300`,idle:`border-border bg-muted text-muted-foreground`},P=[`bg-amber-500`,`bg-sky-500`,`bg-violet-500`,`bg-emerald-500`,`bg-rose-500`,`bg-cyan-500`,`bg-fuchsia-500`],F={started:{icon:i,color:`text-amber-400`},completed:{icon:_,color:`text-emerald-400`},failed:{icon:d,color:`text-red-400`},retrying:{icon:o,color:`text-orange-400`},wave:{icon:u,color:`text-violet-400`},deadlock:{icon:a,color:`text-rose-400`},verification_failed:{icon:r,color:`text-red-400`},conflict:{icon:p,color:`text-amber-400`},split:{icon:g,color:`text-sky-400`},supervisor:{icon:h,color:`text-fuchsia-400`}};function I(e){let t=e.trim().split(/\s+/);return((t[0]?.[0]??``)+(t[1]?.[0]??``)).toUpperCase()||`·`}function L(e){let t=Math.max(0,Math.floor(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?t%60?`${n}m ${t%60}s`:`${n}m`:`${Math.floor(n/60)}h ${n%60}m`}function R(e,t){let n=Math.max(0,Math.floor((t-e)/1e3));if(n<60)return`${n}s`;let r=Math.floor(n/60);return r<60?`${r}m`:`${Math.floor(r/60)}h`}var z=n(),B=300,V=128,H=240,U={pending:{ring:`border-slate-600/50`,chip:`bg-slate-700/40 text-slate-400`,dot:`bg-slate-500`},queued:{ring:`border-cyan-500/50`,chip:`bg-cyan-500/15 text-cyan-300`,dot:`bg-cyan-400`},in_progress:{ring:`border-amber-400/70`,chip:`bg-amber-500/20 text-amber-300`,dot:`bg-amber-400`},blocked:{ring:`border-fuchsia-500/50`,chip:`bg-fuchsia-500/15 text-fuchsia-300`,dot:`bg-fuchsia-400`},review:{ring:`border-sky-500/50`,chip:`bg-sky-500/15 text-sky-300`,dot:`bg-sky-400`},failed:{ring:`border-red-500/60`,chip:`bg-red-500/15 text-red-300`,dot:`bg-red-400`},completed:{ring:`border-emerald-500/55`,chip:`bg-emerald-500/15 text-emerald-300`,dot:`bg-emerald-400`},cancelled:{ring:`border-slate-500/50`,chip:`bg-slate-600/25 text-slate-400`,dot:`bg-slate-500`}};function W({data:e}){let t=e.task,{t:n}=m(),r=U[t.displayStatus],i=t.displayStatus===`in_progress`,a=t.displayStatus===`completed`?_:t.displayStatus===`failed`?d:i?l:f;return(0,z.jsxs)(`div`,{className:v(`sdd-node-enter group relative rounded-lg border bg-[#0e1117]/95 px-2.5 py-2 text-left shadow-lg backdrop-blur`,r.ring,i&&`sdd-node-running`,t.displayStatus===`completed`&&`sdd-node-complete`,t.displayStatus===`failed`&&`sdd-node-failed`,e.onTaskClick&&`cursor-pointer hover:brightness-125`),style:{width:H,animationDelay:`${Math.min(e.index*45,600)}ms`},onClick:()=>e.onTaskClick?.(t.id),children:[(0,z.jsx)(y,{type:`target`,position:x.Left,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsx)(y,{type:`source`,position:x.Right,isConnectable:!1,className:`!h-1.5 !w-1.5 !border-0 !bg-slate-500`}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,z.jsx)(a,{className:v(`h-3.5 w-3.5`,i&&`animate-spin`,r.chip.split(` `).find(e=>e.startsWith(`text`)))}),(0,z.jsx)(`span`,{className:`font-mono text-[10px] text-slate-500`,children:t.shortId}),(0,z.jsx)(`span`,{className:v(`font-mono text-[10px] font-bold uppercase`,M(t.priority).text),children:t.priority[0]}),(0,z.jsx)(`span`,{className:v(`ml-auto rounded px-1.5 py-px text-[9px] font-medium`,r.chip),children:n(`activity:sdd.status.${t.displayStatus}`)})]}),(0,z.jsx)(`p`,{className:`mt-1 line-clamp-2 text-[11px] leading-snug text-slate-200`,children:t.title}),(t.agentName||t.worktreeBranch)&&(0,z.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[t.agentName&&(0,z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`span`,{className:v(`flex h-4 w-4 items-center justify-center rounded-full text-[8px] font-bold text-white`,i?`bg-amber-500 sdd-agent-live`:`bg-slate-600`),children:I(t.agentName)}),(0,z.jsx)(`span`,{className:`max-w-[88px] truncate text-[10px] text-slate-300`,children:t.agentName})]}),t.retries?(0,z.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[9px] text-red-400`,children:[(0,z.jsx)(o,{className:`h-2.5 w-2.5`}),t.retries]}):null,t.worktreeBranch&&(0,z.jsxs)(`span`,{className:`ml-auto flex items-center gap-0.5 text-[9px] text-slate-500`,title:t.worktreeBranch,children:[(0,z.jsx)(s,{className:`h-2.5 w-2.5`}),(0,z.jsx)(`span`,{className:`max-w-[70px] truncate`,children:t.worktreeBranch.replace(/^.*\//,``)})]})]})]})}function G({data:e}){return(0,z.jsx)(`div`,{className:`whitespace-nowrap text-[11px] font-bold uppercase tracking-wider text-slate-500`,children:e.label})}var K={task:W,colLabel:G};function q(e,t,n){let r=new Map(e.map(e=>[e.shortId,e])),i=[],a=0;t.forEach((e,t)=>{i.push({id:`__col_${t}`,position:{x:t*B,y:-52},data:{label:e.label},draggable:!1,selectable:!1,type:`colLabel`,style:{pointerEvents:`none`}}),e.taskIds.forEach((e,o)=>{let s=r.get(e);s&&i.push({id:s.id,position:{x:t*B,y:o*V},data:{task:s,index:a++,onTaskClick:n},type:`task`,draggable:!0})})});let o=[];for(let t of e)for(let e of t.deps){let n=r.get(e);if(!n)continue;let i=n.displayStatus===`completed`&&(t.displayStatus===`in_progress`||t.displayStatus===`queued`);o.push({id:`${n.id}->${t.id}`,source:n.id,target:t.id,animated:i,className:i?`sdd-edge-flow`:void 0,style:{stroke:A(t.displayStatus).hex,strokeWidth:i?2.2:1.4,opacity:t.displayStatus===`pending`?.4:.85}})}return{nodes:i,edges:o}}function J({tasks:e,columns:t,onTaskClick:n}){let{fitView:r}=w(),{nodes:i,edges:a}=(0,O.useMemo)(()=>q(e,t,n),[e,t,n]),o=e.length;return(0,O.useEffect)(()=>{let e=setTimeout(()=>r({padding:.18,duration:400}),60);return()=>clearTimeout(e)},[o,r]),(0,z.jsxs)(D,{nodes:i,edges:a,nodeTypes:K,fitView:!0,fitViewOptions:{padding:.18},minZoom:.2,maxZoom:1.6,proOptions:{hideAttribution:!0},nodesConnectable:!1,elementsSelectable:!!n,children:[(0,z.jsx)(E,{variant:S.Dots,gap:22,size:1,color:`#1e293b`}),(0,z.jsx)(T,{showInteractive:!1,className:`!bottom-2 !left-2`}),(0,z.jsx)(C,{pannable:!0,zoomable:!0,nodeStrokeWidth:2,maskColor:`rgba(2,6,23,0.65)`,nodeColor:e=>{let t=e.data?.task?.displayStatus;return t?A(t).hex:`#334155`},className:`!bottom-2 !right-2 !h-24 !w-40 overflow-hidden rounded-md border border-white/10`})]})}function Y({tasks:e,columns:t,onTaskClick:n}){return(0,z.jsx)(b,{children:(0,z.jsx)(J,{tasks:e,columns:t,onTaskClick:n})})}export{I as a,M as c,N as i,A as l,P as n,R as o,F as r,L as s,Y as t};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$t as r,Lt as i,Rr as a,Sr as o,St as ee,Ur as s,Z as te,hr as c,it as l,jt as ne,mt as re,ui as ie,vr as u,yr as d}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as f}from"./utils-C3qJEm2b.js";import{C as ae,O as p,a as oe,i as se,o as m,p as h,w as ce}from"./index-Cb-hw9qG.js";import{c as g,t as _}from"./SddFlowGraph-DTWV-DPB.js";var v=e(t(),1),y=n(),b={idle:`phaseStart`,questioning:`phaseInterview`,spec_review:`phaseSpecReview`,implementation:`phasePlanning`,task_review:`phaseTaskReview`,executing:`phaseRunning`,done:`phaseDone`},x=[`questioning`,`spec_review`,`implementation`,`task_review`,`executing`];function S({onClose:e}){let{t}=ie(),{client:n}=ae(),o=p(e=>e.snapshot),l=p(e=>e.agentText),S=p(e=>e.error),T=p(e=>e.startedRunId),E=p(e=>e.setStartedRunId),[D,le]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!1),[M,ue]=(0,v.useState)(!0),[N,P]=(0,v.useState)(!0),[F,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)(void 0),[z,B]=(0,v.useState)(void 0),[V,H]=(0,v.useState)([]),[U,de]=(0,v.useState)(4),[W,fe]=(0,v.useState)(!0),G=m(F),K=(0,v.useCallback)(e=>n?.send?.(e),[n]),q=(0,v.useRef)(null);(0,v.useEffect)(()=>{K({type:`sdd.spec.get`})},[K]),(0,v.useEffect)(()=>{q.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[o?.answers.length??0,l]),(0,v.useEffect)(()=>{T&&(ce(`sddboard`),E(null))},[T,E]);let J=o?.busy??!1,Y=o?.phase??`idle`,X=!!o;(0,v.useEffect)(()=>{X&&j(!1)},[X]);let pe=o?.answers[o.answers.length-1]?.question??``,me=!!o&&(o.taskCount>0||!!o.graphId||Y===`task_review`||Y===`executing`),Z=()=>{let e=D.trim();!e||J||A||(j(!0),K({type:`sdd.spec.start`,payload:{goal:e}}))},Q=()=>{let e=O.trim();!e||J||(K({type:`sdd.spec.message`,payload:{text:e}}),k(``))},he=()=>!J&&K({type:`sdd.spec.approve`,payload:{}}),ge=()=>{K({type:`sdd.run.start`,payload:{parallelSlots:U,worktrees:W,...L?{model:L,provider:z}:{},...V.length?{fallbackModels:V}:{}}}),I(!1)},$=(0,v.useMemo)(()=>(o?.board?.tasks??[]).map(e=>({id:e.id,shortId:e.shortId,title:e.title,displayStatus:e.displayStatus,priority:e.priority,deps:e.deps,agentName:e.agentName,worktreeBranch:e.worktreeBranch,retries:e.retries})),[o?.board]),_e=$.length>0;return(0,y.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,y.jsxs)(`header`,{className:`sdd-sheen flex shrink-0 items-center justify-between border-b border-border px-4 py-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(a,{className:`h-5 w-5 text-violet-400`}),(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`text-lg font-semibold`,children:o?.title||t(`activity:sddWizard.titleFallback`)}),X&&(0,y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t(`activity:sddWizard.${b[Y]??`phaseStart`}`),Y===`questioning`&&` · ${t(`activity:sddWizard.questionsSuffix`,{cur:o?.questionCount??0,max:o?.maxQuestions??0})}`,o&&o.taskCount>0?` · ${t(`activity:sddWizard.tasksSuffix`,{count:o.taskCount})}`:``]})]}),J&&(0,y.jsx)(s,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[me&&(0,y.jsxs)(`div`,{className:`relative flex items-center gap-1.5`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:t(`activity:sddWizard.runCfgTitle`),className:f(`inline-flex items-center gap-1 rounded-md border px-2 py-1 text-xs font-medium`,L||V.length?`border-violet-500/40 bg-violet-500/10 text-violet-600 dark:text-violet-300`:`border-border bg-muted text-muted-foreground hover:text-foreground`),children:[(0,y.jsx)(ee,{className:`h-3.5 w-3.5`}),L||t(`activity:sddWizard.modelsLabel`)]}),(0,y.jsxs)(`button`,{type:`button`,onClick:ge,className:`inline-flex items-center gap-1 rounded-md bg-emerald-500/15 px-2.5 py-1 text-xs font-medium text-emerald-700 hover:bg-emerald-500/25 dark:text-emerald-400`,children:[(0,y.jsx)(i,{className:`h-3.5 w-3.5`}),` `,t(`activity:sddWizard.startRun`)]}),F&&(0,y.jsxs)(`div`,{className:`sdd-rise absolute right-0 top-9 z-50 w-72 rounded-lg border border-border bg-popover p-3 shadow-xl`,children:[(0,y.jsx)(`div`,{className:`mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.defaultWorkerModel`)}),(0,y.jsx)(oe,{value:L,provider:z,candidates:G,placeholder:t(`activity:sddWizard.leaderDefaultPlaceholder`),resetLabel:t(`activity:sddWizard.useSessionDefault`),onPick:(e,t)=>{R(e),B(t)},onReset:L?()=>{R(void 0),B(void 0)}:void 0}),(0,y.jsx)(`div`,{className:`mb-1 mt-3 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.fallbackChain`)}),(0,y.jsx)(se,{value:V,candidates:G,onChange:H}),(0,y.jsx)(`p`,{className:`mt-2 text-[10px] text-muted-foreground`,children:t(`activity:sddWizard.appliesToAll`)}),(0,y.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,y.jsx)(`label`,{htmlFor:`sdd-slots`,className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.parallelAgents`)}),(0,y.jsx)(`input`,{id:`sdd-slots`,type:`number`,min:1,max:16,value:U,onChange:e=>{let t=Number.parseInt(e.target.value,10);de(Number.isFinite(t)?Math.min(16,Math.max(1,t)):1)},className:`w-16 rounded-md border border-border bg-background px-2 py-1 text-right text-xs outline-none focus:border-violet-500`})]}),(0,y.jsxs)(`label`,{className:`mt-2 flex cursor-pointer items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:t(`activity:sddWizard.isolateWorktrees`)}),(0,y.jsx)(`input`,{type:`checkbox`,checked:W,onChange:e=>fe(e.target.checked),className:`h-3.5 w-3.5 accent-violet-500`})]}),(0,y.jsx)(`p`,{className:`mt-1 text-[10px] text-muted-foreground`,children:t(W?`activity:sddWizard.worktreeOn`:`activity:sddWizard.worktreeOff`)})]})]}),(0,y.jsx)(h,{variant:`ghost`,size:`icon`,onClick:e,children:(0,y.jsx)(te,{className:`h-4 w-4`})})]})]}),X&&(0,y.jsx)(`div`,{className:`flex shrink-0 items-center gap-1 border-b bg-card/50 px-4 py-1.5 text-[11px]`,children:x.map((e,n)=>{let r=e===Y,i=x.indexOf(Y)>n;return(0,y.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,y.jsxs)(`span`,{className:f(`rounded-full px-2 py-0.5`,r?`bg-violet-500/20 text-violet-600 dark:text-violet-300`:i?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`),children:[i&&(0,y.jsx)(d,{className:`mr-0.5 inline h-3 w-3`}),t(`activity:sddWizard.${b[e]}`)]}),n<x.length-1&&(0,y.jsx)(`span`,{className:`text-muted-foreground/40`,children:`→`})]},e)})}),(0,y.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-4`,children:[S&&(0,y.jsx)(`div`,{className:`mb-3 rounded-md border border-red-500/40 bg-red-500/5 p-2 text-xs text-red-300`,children:S}),X?(0,y.jsxs)(`div`,{className:`space-y-4`,children:[_e&&(0,y.jsxs)(`div`,{className:`sdd-rise overflow-hidden rounded-lg border border-violet-500/20 bg-[#0a0d14]`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>ue(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-white/5 px-3 py-1.5 text-[11px] font-medium text-violet-300 hover:bg-white/5`,children:[M?(0,y.jsx)(u,{className:`h-3.5 w-3.5`}):(0,y.jsx)(c,{className:`h-3.5 w-3.5`}),(0,y.jsx)(r,{className:`h-3.5 w-3.5`}),t(`activity:sddWizard.taskGraphSummary`,{count:o?.taskCount??0}),(0,y.jsx)(`span`,{className:`ml-auto text-slate-500`,children:t(M?`activity:sddWizard.dragToExplore`:`activity:sddWizard.show`)})]}),M&&(0,y.jsx)(`div`,{className:`h-[32dvh] min-h-[200px]`,children:(0,y.jsx)(_,{tasks:$,columns:o?.board?.columns??[]})})]}),(0,y.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-3`,children:[o?.goal&&(0,y.jsxs)(`div`,{className:`rounded-md border border-border bg-muted/30 px-3 py-2`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground`,children:[(0,y.jsx)(re,{className:`h-3 w-3`}),` `,t(`activity:sddWizard.goalLabel`)]}),(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:o.goal})]}),o?.answers.length||l&&Y===`questioning`||J?(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[o?.answers.map((e,t)=>(0,y.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,y.jsx)(w,{role:`assistant`,text:e.question}),(0,y.jsx)(w,{role:`user`,text:e.answer})]},t)),l&&Y===`questioning`&&l!==pe&&(0,y.jsx)(w,{role:`assistant`,text:l}),J&&(0,y.jsx)(w,{role:`assistant`,text:``,thinking:!0})]}):null,o?.spec&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card p-3`,children:[(0,y.jsxs)(`div`,{className:`mb-1 flex items-center gap-1.5 text-sm font-semibold`,children:[(0,y.jsx)(a,{className:`h-3.5 w-3.5 text-violet-400`}),o.spec.title]}),(0,y.jsx)(`p`,{className:`mb-2 text-xs text-muted-foreground`,children:o.spec.overview}),(0,y.jsx)(`ul`,{className:`space-y-0.5 text-xs`,children:o.spec.requirements.map((e,t)=>(0,y.jsxs)(`li`,{className:`flex gap-1.5`,children:[(0,y.jsx)(`span`,{className:f(`shrink-0 font-mono uppercase`,g(e.priority).text),children:e.priority[0]}),(0,y.jsx)(`span`,{children:e.description})]},t))})]}),l&&(Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(`div`,{className:`sdd-rise rounded-md border border-border bg-card`,children:[(0,y.jsxs)(`button`,{type:`button`,onClick:()=>P(e=>!e),className:`flex w-full items-center gap-1.5 border-b border-border/60 px-3 py-2 text-sm font-semibold hover:bg-muted/40`,children:[N?(0,y.jsx)(u,{className:`h-3.5 w-3.5`}):(0,y.jsx)(c,{className:`h-3.5 w-3.5`}),(0,y.jsx)(a,{className:`h-3.5 w-3.5 text-violet-400`}),` `,t(`activity:sddWizard.implementationPlan`)]}),N&&(0,y.jsx)(`div`,{className:`max-h-[40dvh] overflow-auto px-3 py-2`,children:(0,y.jsx)(`p`,{className:`whitespace-pre-wrap text-sm leading-relaxed text-foreground/90`,children:C(l)})})]}),l&&Y!==`questioning`&&Y!==`implementation`&&Y!==`task_review`&&!o?.spec&&(0,y.jsx)(w,{role:`assistant`,text:l}),(Y===`spec_review`||Y===`implementation`||Y===`task_review`)&&(0,y.jsxs)(h,{variant:`secondary`,onClick:he,disabled:J,children:[(0,y.jsx)(d,{className:`mr-1.5 h-4 w-4`}),t(Y===`spec_review`?`activity:sddWizard.approveSpec`:Y===`task_review`?`activity:sddWizard.approveTasks`:`activity:sddWizard.approvePlan`)]}),(0,y.jsx)(`div`,{ref:q})]})]}):(0,y.jsxs)(`div`,{className:`mx-auto mt-8 max-w-xl`,children:[(0,y.jsx)(`label`,{className:`mb-2 block text-sm font-medium`,htmlFor:`sdd-goal`,children:t(`activity:sddWizard.goalPrompt`)}),(0,y.jsx)(`textarea`,{id:`sdd-goal`,value:D,onChange:e=>le(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&Z()},rows:4,placeholder:t(`activity:sddWizard.goalPlaceholder`),className:`w-full resize-none rounded-md border border-border bg-card px-3 py-2 text-sm outline-none focus:border-violet-500`}),(0,y.jsx)(h,{className:`mt-3`,onClick:Z,disabled:!D.trim()||A,children:A?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(s,{className:`mr-1.5 h-4 w-4 animate-spin`}),` `,t(`activity:sddWizard.startingInterview`)]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(a,{className:`mr-1.5 h-4 w-4`}),` `,t(`activity:sddWizard.startInterview`)]})}),(0,y.jsx)(`p`,{className:`mt-3 text-xs text-muted-foreground`,children:t(`activity:sddWizard.introBody`)})]})]}),X&&Y!==`executing`&&Y!==`done`&&(0,y.jsxs)(`div`,{className:`flex shrink-0 items-end gap-2 border-t bg-card px-4 py-2`,children:[(0,y.jsx)(`textarea`,{value:O,onChange:e=>k(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),Q())},rows:1,placeholder:t(Y===`questioning`?`activity:sddWizard.answerPlaceholder`:`activity:sddWizard.changePlaceholder`),disabled:J,className:`max-h-32 flex-1 resize-none rounded-md border border-border bg-background px-3 py-2 text-sm outline-none focus:border-violet-500 disabled:opacity-50`}),(0,y.jsx)(h,{size:`icon`,onClick:Q,disabled:J||!O.trim(),children:(0,y.jsx)(ne,{className:`h-4 w-4`})})]})]})}function C(e){let t=e.replace(/```json[\s\S]*?```/gi,``).trim();return t.length>0?t:e.trim()}function w({role:e,text:t,live:n,thinking:r}){let i=e===`user`;return(0,y.jsxs)(`div`,{className:f(`sdd-rise flex items-start gap-2`,i&&`flex-row-reverse`),children:[(0,y.jsx)(`span`,{className:f(`mt-0.5 flex h-6 w-6 shrink-0 items-center justify-center rounded-full`,i?`bg-sky-500/20 text-sky-600 dark:text-sky-300`:`bg-violet-500/20 text-violet-600 dark:text-violet-300`,(n||r)&&`sdd-agent-live`),children:i?(0,y.jsx)(l,{className:`h-3.5 w-3.5`}):(0,y.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,y.jsx)(`div`,{className:f(`max-w-[80%] whitespace-pre-wrap rounded-2xl px-3 py-2 text-sm leading-relaxed text-foreground`,i?`rounded-tr-sm bg-sky-500/15`:`rounded-tl-sm bg-muted`),children:r?(0,y.jsxs)(`span`,{className:`flex items-center gap-1 py-0.5`,children:[(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-200ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground [animation-delay:-100ms]`}),(0,y.jsx)(`span`,{className:`h-1.5 w-1.5 animate-bounce rounded-full bg-muted-foreground`})]}):t})]})}export{S as SddWizard};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$ as r,Vr as i,ci as a,di as o,et as s,rr as c,sr as l,zn as u}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";var d=e(t(),1),f=n();async function p(e){try{let t=await e.clone().json(),n=typeof t.error==`string`?t.error:t.message;if(typeof n==`string`&&n.trim())return n}catch{try{let t=await e.text();if(t.trim())return t.trim()}catch{}}return e.statusText||`HTTP ${e.status}`}function m(e){switch(e){case`running`:return`▶`;case`streaming`:return`↻`;case`waiting_user`:return`⏳`;case`error`:return`✗`;case`idle`:return`■`;default:return`?`}}function h(e){switch(e){case`running`:return`text-emerald-400`;case`streaming`:return`text-cyan-400`;case`waiting_user`:return`text-amber-400`;case`error`:return`text-red-400`;default:return`text-slate-500`}}function g(e){switch(e){case`active`:return`text-emerald-400`;case`idle`:return`text-cyan-400`;case`closing`:return`text-amber-400`;default:return`text-slate-500`}}function _(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`<1m`;if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function v(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return o.t(`common:time.justNow`);if(n<60)return o.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?o.t(`common:time.minutesAgo`,{count:r}):o.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function y(){let{t:e}=a(),[t,n]=(0,d.useState)([]),[o,y]=(0,d.useState)(!0),[b,x]=(0,d.useState)(null),S=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){x(null),n([]);return}throw Error(`HTTP ${e.status}: ${await p(e)}`)}n(await e.json()),x(null)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(!1)}},[]);return(0,d.useEffect)(()=>{S();let e=setInterval(S,5e3);return()=>clearInterval(e)},[S]),o?(0,f.jsxs)(`div`,{className:`flex items-center gap-2 p-4 text-slate-400`,children:[(0,f.jsx)(i,{className:`h-4 w-4 animate-spin`}),e(`activity:liveSessions.loading`)]}):b?(0,f.jsxs)(`div`,{className:`p-4 text-slate-500 text-sm`,children:[e(`activity:liveSessions.apiUnavailable`),` `,(0,f.jsx)(`span`,{className:`text-slate-400`,children:b})]}):t.length===0?(0,f.jsx)(`div`,{className:`p-4 text-slate-500 text-sm`,children:e(`activity:liveSessions.empty`)}):(0,f.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-slate-200 uppercase tracking-wider`,children:e(`activity:liveSessions.heading`,{count:t.length})}),(0,f.jsx)(`span`,{className:`text-xs text-slate-500`,children:e(`activity:liveSessions.autoRefresh`)})]}),t.map(t=>(0,f.jsxs)(`div`,{className:`rounded-lg border border-slate-700 bg-slate-800/50 p-3 space-y-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,f.jsx)(`span`,{className:g(t.status),children:t.status===`active`?(0,f.jsx)(r,{className:`h-3.5 w-3.5 inline`}):t.status===`idle`?(0,f.jsx)(s,{className:`h-3.5 w-3.5 inline`}):null}),(0,f.jsx)(`span`,{className:`font-medium text-slate-200 text-sm`,children:t.projectName}),(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs`,children:[`[`,t.projectSlug,`]`]}),t.gitBranch?(0,f.jsxs)(`span`,{className:`text-purple-400 text-xs flex items-center gap-1`,children:[(0,f.jsx)(u,{className:`h-3 w-3`}),t.gitBranch]}):null,(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs ml-auto flex items-center gap-1`,children:[(0,f.jsx)(l,{className:`h-3 w-3`}),_(t.startedAt)]}),(0,f.jsx)(`span`,{className:`text-slate-600 text-xs`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]}),(0,f.jsxs)(`div`,{className:`text-slate-500 text-xs flex items-center gap-1`,children:[(0,f.jsx)(c,{className:`h-3 w-3`}),t.workingDir]}),(0,f.jsxs)(`div`,{className:`space-y-1 mt-2`,children:[t.agents.slice(0,5).map(t=>(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-xs pl-2 border-l-2 border-slate-700`,children:[(0,f.jsx)(`span`,{className:h(t.status),children:m(t.status)}),(0,f.jsx)(`span`,{className:`text-slate-300 font-medium`,children:t.name}),t.currentTool?(0,f.jsxs)(`span`,{className:`text-slate-500`,children:[`[`,t.currentTool,`]`]}):null,(0,f.jsx)(`span`,{className:`text-slate-600 ml-auto`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:v(t.lastActivityAt)})})]},t.id)),t.agents.length>5?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null,t.agents.length===0?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.noAgents`)}):null]})]},t.sessionId))]})}export{y as SessionsDashboard};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$ as r,Ur as i,Vn as a,ar as o,et as s,lr as c,pi as l,ui as u}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";var d=e(t(),1),f=n();async function p(e){try{let t=await e.clone().json(),n=typeof t.error==`string`?t.error:t.message;if(typeof n==`string`&&n.trim())return n}catch{try{let t=await e.text();if(t.trim())return t.trim()}catch{}}return e.statusText||`HTTP ${e.status}`}function m(e){switch(e){case`running`:return`▶`;case`streaming`:return`↻`;case`waiting_user`:return`⏳`;case`error`:return`✗`;case`idle`:return`■`;default:return`?`}}function h(e){switch(e){case`running`:return`text-emerald-400`;case`streaming`:return`text-cyan-400`;case`waiting_user`:return`text-amber-400`;case`error`:return`text-red-400`;default:return`text-slate-500`}}function g(e){switch(e){case`active`:return`text-emerald-400`;case`idle`:return`text-cyan-400`;case`closing`:return`text-amber-400`;default:return`text-slate-500`}}function _(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/6e4);if(n<1)return`<1m`;if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<24?`${r}h ${n%60}m`:`${Math.floor(r/24)}d`}function v(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return l.t(`common:time.justNow`);if(n<60)return l.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?l.t(`common:time.minutesAgo`,{count:r}):l.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function y(){let{t:e}=u(),[t,n]=(0,d.useState)([]),[l,y]=(0,d.useState)(!0),[b,x]=(0,d.useState)(null),S=(0,d.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){x(null),n([]);return}throw Error(`HTTP ${e.status}: ${await p(e)}`)}n(await e.json()),x(null)}catch(e){x(e instanceof Error?e.message:String(e))}finally{y(!1)}},[]);return(0,d.useEffect)(()=>{S();let e=setInterval(S,5e3);return()=>clearInterval(e)},[S]),l?(0,f.jsxs)(`div`,{className:`flex items-center gap-2 p-4 text-slate-400`,children:[(0,f.jsx)(i,{className:`h-4 w-4 animate-spin`}),e(`activity:liveSessions.loading`)]}):b?(0,f.jsxs)(`div`,{className:`p-4 text-slate-500 text-sm`,children:[e(`activity:liveSessions.apiUnavailable`),` `,(0,f.jsx)(`span`,{className:`text-slate-400`,children:b})]}):t.length===0?(0,f.jsx)(`div`,{className:`p-4 text-slate-500 text-sm`,children:e(`activity:liveSessions.empty`)}):(0,f.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,f.jsx)(`h2`,{className:`text-sm font-semibold text-slate-200 uppercase tracking-wider`,children:e(`activity:liveSessions.heading`,{count:t.length})}),(0,f.jsx)(`span`,{className:`text-xs text-slate-500`,children:e(`activity:liveSessions.autoRefresh`)})]}),t.map(t=>(0,f.jsxs)(`div`,{className:`rounded-lg border border-slate-700 bg-slate-800/50 p-3 space-y-2`,children:[(0,f.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,f.jsx)(`span`,{className:g(t.status),children:t.status===`active`?(0,f.jsx)(r,{className:`h-3.5 w-3.5 inline`}):t.status===`idle`?(0,f.jsx)(s,{className:`h-3.5 w-3.5 inline`}):null}),(0,f.jsx)(`span`,{className:`font-medium text-slate-200 text-sm`,children:t.projectName}),(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs`,children:[`[`,t.projectSlug,`]`]}),t.gitBranch?(0,f.jsxs)(`span`,{className:`text-purple-400 text-xs flex items-center gap-1`,children:[(0,f.jsx)(a,{className:`h-3 w-3`}),t.gitBranch]}):null,(0,f.jsxs)(`span`,{className:`text-slate-500 text-xs ml-auto flex items-center gap-1`,children:[(0,f.jsx)(c,{className:`h-3 w-3`}),_(t.startedAt)]}),(0,f.jsx)(`span`,{className:`text-slate-600 text-xs`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]}),(0,f.jsxs)(`div`,{className:`text-slate-500 text-xs flex items-center gap-1`,children:[(0,f.jsx)(o,{className:`h-3 w-3`}),t.workingDir]}),(0,f.jsxs)(`div`,{className:`space-y-1 mt-2`,children:[t.agents.slice(0,5).map(t=>(0,f.jsxs)(`div`,{className:`flex items-center gap-2 text-xs pl-2 border-l-2 border-slate-700`,children:[(0,f.jsx)(`span`,{className:h(t.status),children:m(t.status)}),(0,f.jsx)(`span`,{className:`text-slate-300 font-medium`,children:t.name}),t.currentTool?(0,f.jsxs)(`span`,{className:`text-slate-500`,children:[`[`,t.currentTool,`]`]}):null,(0,f.jsx)(`span`,{className:`text-slate-600 ml-auto`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:v(t.lastActivityAt)})})]},t.id)),t.agents.length>5?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null,t.agents.length===0?(0,f.jsx)(`div`,{className:`text-slate-600 text-xs pl-4`,children:e(`activity:liveSessions.noAgents`)}):null]})]},t.sessionId))]})}export{y as SessionsDashboard};
@@ -0,0 +1,2 @@
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{c as t,m as n,o as r,p as i}from"./markdown-D0X23O-i.js";import{An as ee,Bt as te,Cr as ne,Dr as re,Gn as ie,Jt as ae,Rr as oe,Ur as a,Xt as se,Z as o,_r as ce,dt as s,er as le,hr as c,pi as l,sr as ue,t as de,ui as fe,yr as pe,zn as me}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{n as u}from"./ui-store-CcznRsiV.js";import{t as d}from"./utils-C3qJEm2b.js";import{C as he,T as ge,d as f}from"./index-Cb-hw9qG.js";var p=e(n(),1),m=i();function h(e){return e===`project`||e===`user`}function g(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function _e({source:e}){let{t}=fe(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,m.jsx)(`span`,{className:d(`inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400`,n===`user`&&`bg-violet-100 text-violet-700 dark:bg-violet-950 dark:text-violet-400`,n===`bundled`&&`bg-slate-100 text-slate-600 dark:bg-slate-800 dark:text-slate-400`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function _({className:e}){let{t:n}=fe(),{client:i}=he(),_=u(e=>e.skillsState),v=u(e=>e.setSkillsState),y=_.selectedSkill,b=_.navHistory,x=_.historyIndex,[S,C]=(0,p.useState)(null),[ve,w]=(0,p.useState)(!1),[T,E]=(0,p.useState)(null),[D,O]=(0,p.useState)(!1),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(!1),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(null),[z,B]=(0,p.useState)(!1),V=(0,p.useRef)(``),[H,ye]=(0,p.useState)(!1),[U,W]=(0,p.useState)(null),[be,xe]=(0,p.useState)(!1),[G,K]=(0,p.useState)(null),[q,Se]=(0,p.useState)(!1),[Ce,we]=(0,p.useState)([]),J=(0,p.useRef)(_);J.current=_;let Y=(0,p.useRef)(!1),X=(0,p.useMemo)(()=>k?{lines:k.split(`
2
+ `).length,words:k.trim()?k.trim().split(/\s+/).length:0,chars:k.length}:{lines:0,words:0,chars:0},[k]),Z=(0,p.useMemo)(()=>{if(!k)return null;let e=5*1024*1024,t=new Blob([k]).size;return t>=e?{level:`critical`,used:t,limit:e}:t>=4194304?{level:`warn`,used:t,limit:e}:null},[k]);(0,p.useEffect)(()=>{if(!L)return;let e=setTimeout(()=>R(null),2e3);return()=>clearTimeout(e)},[L]),(0,p.useEffect)(()=>{if(!D||!y)return;let e=setInterval(()=>{k&&k!==V.current&&(V.current=k,localStorage.setItem(`skills_draft_${y.name}`,JSON.stringify({content:k,savedAt:Date.now()})),R(Date.now()))},5e3);return()=>clearInterval(e)},[D,k,y]),(0,p.useEffect)(()=>{if(!y||!D)return;let e=localStorage.getItem(`skills_draft_${y.name}`);if(e)try{let{content:t}=JSON.parse(e);t&&t!==k&&t!==V.current&&(A(t),V.current=t,B(!0))}catch{}},[y?.name,D]),(0,p.useEffect)(()=>{if(!i||!y)return;w(!0),C(null),E(null);let e=setTimeout(()=>{w(!1),E(l.t(`activity:skillDetail.timeoutError`))},1e4),t=t=>{clearTimeout(e);let n=t;n.payload.error?E(n.payload.error):n.payload.name&&C(n.payload),w(!1)},n=e=>{let t=e;ye(!1);let n=J.current;if(t.payload.success){let e={...n.knownRefs};for(let n of t.payload.updated??[])e[n.name]=n.newRef;v({...n,knownRefs:e,updateAvailableCount:0}),W({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),i.send({type:`skills.list`})}else W({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??l.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&we(t.payload.skills)};return i.on(`skills.content`,t),i.on(`skills.updated`,n),i.on(`skills.list`,r),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),()=>{clearTimeout(e),i.off(`skills.content`,t),i.off(`skills.updated`,n),i.off(`skills.list`,r)}},[i,y?.name,y?.source]),(0,p.useEffect)(()=>{D&&(O(!1),A(``),P(null))},[y?.name]);let Q=(0,p.useCallback)(e=>Ce.find(t=>t.name.toLowerCase()===e.toLowerCase()),[Ce]),Te=(0,p.useCallback)(e=>{let t=Q(e);if(t){Y.current=!1;let e=b.slice(0,x+1);e.push(t),v({...J.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),O(!1),A(``),W(null)}},[Q,b,x,v]),Ee=(0,p.useCallback)(()=>{if(x<=0)return;Y.current=!0;let e=x-1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),De=(0,p.useCallback)(()=>{if(x>=b.length-1)return;Y.current=!0;let e=x+1,t=b[e];v({...J.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),W(null)},[x,b,v]),$=(0,p.useCallback)(()=>{ge(`chat`)},[]),Oe=(0,p.useCallback)(()=>{S&&(A(S.body),V.current=S.body,B(!1),P(null),O(!0),I(!1))},[S]),ke=(0,p.useCallback)(()=>{O(!1),A(``),P(null),I(!1),B(!1),y&&localStorage.removeItem(`skills_draft_${y.name}`)},[y]),Ae=(0,p.useCallback)(()=>{!y||!S||(B(!1),A(S.body),V.current=S.body,y&&localStorage.removeItem(`skills_draft_${y.name}`))},[y,S]),je=(0,p.useCallback)(()=>{if(!i||!y||!k.trim())return;M(!0),P(null);let e=t=>{let n=t;M(!1),n.payload.success?(V.current=``,localStorage.removeItem(`skills_draft_${y.name}`),B(!1),O(!1),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),i.send({type:`skills.list`})):P(n.payload.error??l.t(`activity:skillDetail.saveFailed`)),i.off(`skills.edited`,e)};i.on(`skills.edited`,e),i.editSkill(y.name,k)},[i,y,k]),Me=(0,p.useCallback)(()=>{!i||!y||(ye(!0),W(null),i.checkForUpdates(y.name,y.source===`user`))},[i,y]),Ne=(0,p.useCallback)(()=>{y?.sourceUrl&&navigator.clipboard.writeText(y.sourceUrl).then(()=>{xe(!0),setTimeout(()=>xe(!1),2e3)})},[y]),Pe=(0,p.useCallback)(()=>{if(!S?.body)return;let e=new Blob([S.body],{type:`text/markdown`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`${S.name.replace(/\//g,`_`)}-SKILL.md`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t)},[S]),Fe=(0,p.useCallback)(async e=>{if(!i||!e)return;Se(!0);let t=e=>{let n=e;Se(!1),n.payload.success?(K(null),i.send({type:`skills.list`}),$()):P(n.payload.error??l.t(`activity:skillDetail.uninstallFailed`)),i.off(`skills.uninstalled`,t)};i.on(`skills.uninstalled`,t),i.uninstallSkill(e.name,e.source===`user`)},[i,$]);return y?(0,m.jsxs)(`div`,{className:d(`flex h-full min-h-0 min-w-0 flex-col overflow-hidden bg-background`,e),children:[(0,m.jsxs)(`div`,{className:`px-4 py-3 border-b bg-card shrink-0`,children:[(0,m.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(oe,{className:`h-4 w-4 text-primary shrink-0`}),(0,m.jsx)(`h1`,{className:`text-base font-semibold truncate`,children:y.name}),y.version&&(0,m.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,y.version]}),(0,m.jsx)(_e,{source:y.source})]}),(0,m.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:y.description||y.trigger}),y.sourceUrl&&(0,m.jsxs)(`div`,{className:`flex items-center gap-1 mt-2`,children:[(0,m.jsxs)(`a`,{href:`https://${y.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,title:n(`activity:skillDetail.openSourceRepo`),children:[(0,m.jsx)(ee,{className:`h-3 w-3 shrink-0`}),(0,m.jsx)(`span`,{className:`truncate font-mono`,children:y.sourceUrl})]}),(0,m.jsx)(`button`,{type:`button`,onClick:Ne,className:`flex items-center shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,title:n(`activity:skillDetail.copySourceUrl`),children:be?(0,m.jsx)(pe,{className:`h-3 w-3 text-green-500`}):(0,m.jsx)(ue,{className:`h-3 w-3`})})]}),y.scope.length>0&&(0,m.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:y.scope.map(e=>(0,m.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),U&&(0,m.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[U.updated.length>0&&(0,m.jsx)(`div`,{className:`text-green-600`,children:n(`activity:skillDetail.updatedLabel`,{list:U.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),U.unchanged.length>0&&(0,m.jsx)(`div`,{className:`text-muted-foreground`,children:n(`activity:skillDetail.upToDateLabel`,{list:U.unchanged.join(`, `)})}),U.errors.length>0&&(0,m.jsx)(`div`,{className:`text-destructive`,children:n(`activity:skillDetail.errorsLabel`,{list:U.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-1 ml-auto shrink-0`,children:[h(y.source)&&y.sourceUrl&&(0,m.jsx)(`button`,{type:`button`,onClick:Me,disabled:H,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer disabled:opacity-50`,title:n(`activity:skillDetail.checkUpdatesTitle`),children:H?(0,m.jsx)(a,{className:`h-3.5 w-3.5 animate-spin`}):(0,m.jsx)(te,{className:`h-3.5 w-3.5`})}),y.source!==`bundled`&&!D&&(0,m.jsx)(`button`,{type:`button`,onClick:Pe,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer`,title:n(`activity:skillDetail.exportTitle`),children:(0,m.jsx)(le,{className:`h-3.5 w-3.5`})}),h(y.source)&&!D&&(0,m.jsx)(`button`,{type:`button`,onClick:Oe,className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer`,title:n(`activity:skillDetail.editTitle`),children:(0,m.jsx)(ae,{className:`h-3.5 w-3.5`})}),h(y.source)&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(y),className:`flex items-center gap-1 px-2 py-1.5 text-xs rounded text-muted-foreground hover:text-destructive hover:bg-destructive/10 transition-colors cursor-pointer`,title:n(`activity:skillDetail.uninstallTitle`),children:(0,m.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,m.jsx)(`button`,{type:`button`,onClick:$,className:`p-1.5 rounded hover:bg-accent text-muted-foreground cursor-pointer`,title:n(`activity:skillDetail.closeTitle`),children:(0,m.jsx)(o,{className:`h-4 w-4`})})]})]}),b.length>1&&(0,m.jsxs)(`div`,{className:`flex items-center gap-1 mt-2`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:Ee,disabled:x<=0,className:d(`p-1 rounded transition-colors`,x<=0?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.backTitle`),children:(0,m.jsx)(ce,{className:`h-4 w-4`})}),(0,m.jsx)(`button`,{type:`button`,onClick:De,disabled:x>=b.length-1,className:d(`p-1 rounded transition-colors`,x>=b.length-1?`text-muted-foreground/40 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:n(`activity:skillDetail.forwardTitle`),children:(0,m.jsx)(c,{className:`h-4 w-4`})}),(0,m.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:b.map((e,t)=>(0,m.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,m.jsx)(c,{className:`h-3 w-3 text-muted-foreground/40 mx-0.5 shrink-0`}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>{t<x&&(Y.current=!0,v({...J.current,selectedSkill:e,historyIndex:t}),O(!1),A(``),W(null))},className:d(`hover:text-primary cursor-pointer transition-colors`,t===x?`text-primary font-medium`:`text-muted-foreground`),children:e.name})]},e.name+t))})]})]}),S&&(S.relatedFiles.length>0||S.references.length>0)&&(0,m.jsxs)(`div`,{className:`px-4 py-2 border-b bg-muted/30 shrink-0 space-y-2`,children:[S.relatedFiles.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,m.jsx)(me,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.relatedFiles`)})]}),S.relatedFiles.map(e=>{let t=g(e);return t&&Q(t)?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded bg-background border border-border hover:border-primary hover:text-primary transition-colors cursor-pointer`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,m.jsx)(re,{className:`h-2.5 w-2.5`}),e]},e):(0,m.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-background border border-border text-muted-foreground`,children:e},e)})]}),S.references.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,m.jsx)(ie,{className:`h-3 w-3`}),(0,m.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:n(`activity:skillDetail.references`)})]}),S.references.map(e=>{let t=g(e)??e.replace(/\.md$/,``);return Q(t)?(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Te(t),className:`inline-flex items-center gap-1 px-1.5 py-0.5 text-[10px] rounded bg-primary/5 border border-primary/20 text-primary hover:bg-primary/10 hover:border-primary/30 transition-colors cursor-pointer`,title:n(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,m.jsx)(re,{className:`h-2.5 w-2.5`}),t]},e):(0,m.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:t},e)})]})]}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto`,children:ve?(0,m.jsxs)(`div`,{className:`p-8 text-center text-muted-foreground`,children:[(0,m.jsx)(a,{className:`h-6 w-6 animate-spin mx-auto mb-2`}),(0,m.jsx)(`p`,{children:n(`activity:skillDetail.loadingContent`)})]}):D?(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,m.jsxs)(`div`,{className:`px-4 py-2 border-b shrink-0 flex items-center justify-between gap-2`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.editingLabel`,{name:y.name})}),(0,m.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:n(`activity:skillDetail.editStats`,{lines:X.lines,words:X.words,chars:X.chars})}),Z&&(0,m.jsx)(`span`,{className:`text-xs tabular-nums ${Z.level===`critical`?`text-red-500 font-medium`:`text-amber-500`}`,children:n(`activity:skillDetail.charsWarningFmt`,{used:(Z.used/(1024*1024)).toFixed(1),limit:(Z.limit/(1024*1024)).toFixed(0)})}),L&&(0,m.jsx)(`span`,{className:`text-xs text-green-500 animate-pulse`,children:n(`activity:skillDetail.draftSaved`)}),z&&(0,m.jsx)(`span`,{className:`text-xs text-amber-500 animate-pulse`,children:n(`activity:skillDetail.draftRestored`)})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[N&&(0,m.jsx)(`span`,{className:`text-xs text-destructive`,children:N}),z&&(0,m.jsx)(`button`,{type:`button`,onClick:Ae,className:`px-2 py-1 text-[10px] rounded border border-amber-500/50 text-amber-600 dark:text-amber-400 hover:bg-amber-500/10 transition-colors cursor-pointer`,children:n(`activity:skillDetail.discardDraft`)}),(0,m.jsx)(`button`,{type:`button`,onClick:ke,className:`px-2 py-1 text-xs rounded border border-border hover:bg-accent transition-colors cursor-pointer`,children:n(`common:action.cancel`)}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:n(F?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`px-2 py-1 text-xs rounded border transition-colors cursor-pointer ${F?`border-primary bg-primary/10 text-primary`:`border-border hover:bg-accent text-muted-foreground`}`,children:(0,m.jsx)(se,{className:`h-3 w-3 inline`})}),(0,m.jsx)(`button`,{type:`button`,onClick:je,disabled:j||!k.trim(),className:`px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors cursor-pointer`,children:j?(0,m.jsx)(a,{className:`h-3 w-3 animate-spin inline`}):n(`common:action.save`)})]})]}),F?(0,m.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,m.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,m.jsx)(de,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})}),(0,m.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,m.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,m.jsx)(t,{rehypePlugins:[r],components:f,children:k})})]}):(0,m.jsx)(de,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:n(`activity:skillDetail.contentPlaceholder`)})]}):S?(0,m.jsx)(`div`,{className:`p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,m.jsx)(t,{rehypePlugins:[r],components:f,children:S.body})}):T?(0,m.jsxs)(`div`,{className:`p-8 text-center`,children:[(0,m.jsx)(`p`,{className:`text-destructive mb-2`,children:n(`activity:skillDetail.loadFailed`)}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>{i&&y&&(w(!0),E(null),i.send({type:`skills.content`,payload:{name:y.name,source:y.source}}))},className:`mt-4 px-3 py-1.5 text-xs rounded border border-border hover:bg-accent transition-colors`,children:n(`common:action.retry`)})]}):(0,m.jsx)(`div`,{className:`p-8 text-center text-muted-foreground`,children:n(`activity:skillDetail.noContent`)})}),G&&(0,m.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40`,onClick:e=>{e.target===e.currentTarget&&K(null)},children:(0,m.jsxs)(`div`,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col overflow-hidden rounded-lg border bg-background shadow-xl`,children:[(0,m.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between p-4 border-b`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(s,{className:`h-4 w-4 text-destructive`}),(0,m.jsx)(`span`,{className:`font-semibold text-sm`,children:n(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(null),className:`p-1 rounded hover:bg-accent text-muted-foreground cursor-pointer`,children:(0,m.jsx)(o,{className:`h-4 w-4`})})]}),(0,m.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4 space-y-2`,children:[(0,m.jsx)(`p`,{className:`text-sm`,children:n(`activity:skillDetail.uninstallConfirm`,{name:G.name})}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:skillDetail.uninstallRemovePath`,{path:G.source===`user`?`~/.wrongstack/skills`:`.wrongstack/skills`})})]}),(0,m.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 p-4 border-t bg-muted/20`,children:[(0,m.jsx)(`button`,{type:`button`,onClick:()=>K(null),disabled:q,className:`px-3 py-1.5 text-xs rounded border border-border hover:bg-accent transition-colors disabled:opacity-50`,children:n(`common:action.cancel`)}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>Fe(G),disabled:q,className:`flex items-center gap-1.5 px-3 py-1.5 text-xs rounded bg-destructive text-destructive-foreground hover:bg-destructive/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors`,children:[q&&(0,m.jsx)(a,{className:`h-3 w-3 animate-spin`}),n(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,m.jsxs)(`div`,{className:d(`flex-1 flex flex-col items-center justify-center text-muted-foreground p-8`,e),children:[(0,m.jsx)(ne,{className:`h-12 w-12 mb-4 opacity-20`}),(0,m.jsx)(`p`,{className:`text-base font-medium`,children:n(`activity:skillDetail.noSkillSelected`)}),(0,m.jsx)(`p`,{className:`text-sm mt-1 text-center max-w-[300px]`,children:n(`activity:skillDetail.selectSkillHint`)}),(0,m.jsx)(`button`,{type:`button`,onClick:$,className:`mt-4 px-4 py-2 text-sm rounded-md border border-border hover:bg-accent transition-colors`,children:n(`activity:skillDetail.goToChat`)})]})}export{_ as SkillDetailView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$r as r,Cr as i,It as a,Un as o,Ut as s,Vr as c,Z as l,Zt as u,ci as d,fn as f,gr as p,lr as m,pr as h,sr as g,ti as _,vn as v}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as y}from"./utils-DBns3uMk.js";import{C as b,D as x,p as S,w as C}from"./index-CWj2bI87.js";var w=e(t(),1),T=n(),E={completed:{icon:(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),label:`Completed`,text:`text-emerald-400`,ring:`border-emerald-500/40`},in_progress:{icon:(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),label:`Running`,text:`text-sky-400`,ring:`border-sky-500/50`},queued:{icon:(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),label:`Queued`,text:`text-amber-400`,ring:`border-amber-500/40`},blocked:{icon:(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),label:`Blocked`,text:`text-rose-400`,ring:`border-rose-500/30`},pending:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),label:`Pending`,text:`text-slate-400`,ring:`border-white/10`},review:{icon:(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),label:`Review`,text:`text-violet-400`,ring:`border-violet-500/40`},failed:{icon:(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),label:`Failed`,text:`text-red-400`,ring:`border-red-500/50`},cancelled:{icon:(0,T.jsx)(i,{className:`h-3.5 w-3.5`}),label:`Cancelled`,text:`text-slate-400`,ring:`border-slate-500/40`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{label:`Crit`,cls:`bg-red-500/15 text-red-400`},high:{label:`High`,cls:`bg-red-500/15 text-red-400`},medium:{label:`Med`,cls:`bg-amber-500/15 text-amber-400`},low:{label:`Low`,cls:`bg-emerald-500/15 text-emerald-400`}};function k({columns:e,onTaskClick:t}){let{t:n}=d();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-slate-400`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-lg border border-white/10 bg-[#0f1115] p-4`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-slate-200`,children:n(`activity:board.depGraphHeading`)}),(0,T.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs`,children:D.map(e=>(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-slate-400`,children:n(`activity:board.status.${e}`)})]},e))}),(0,T.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:e.map((n,r)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,T.jsxs)(`div`,{className:`w-60 shrink-0`,children:[(0,T.jsx)(`div`,{className:`mb-2 border-b border-white/10 pb-1 text-center text-xs font-medium uppercase tracking-wider text-slate-500`,children:n.label}),(0,T.jsx)(`div`,{className:`space-y-2`,children:n.tasks.map(e=>(0,T.jsx)(A,{task:e,onClick:t},e.id))})]}),r<e.length-1&&(0,T.jsx)(`div`,{className:`flex h-full items-center pt-8 text-slate-600`,children:(0,T.jsx)(h,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=d();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:y(`w-full rounded-md border bg-[#161a22] p-2.5 text-left transition-colors hover:border-orange-500/40`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-slate-300`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:y(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:r.label})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-slate-200`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:y(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-sky-500/15 text-sky-400`:`bg-white/5 text-slate-400`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(c,{className:`h-3 w-3 animate-spin`}),(0,T.jsx)(`span`,{children:e.agentName})]})]})}function j(e){return e.columns.map(e=>({name:e.label,description:``,priority:`medium`,estimateHours:e.tasks.length,parallelizable:!1,taskTemplates:e.tasks.map(e=>({title:e.title,description:e.description,type:e.type,priority:e.priority,estimateHours:1}))}))}function M({onClose:e}){let{client:t}=b(),{t:n}=d(),r=x(e=>e.specs),i=x(e=>e.detail),a=x(e=>e.expandedSpecId),c=x(e=>e.setExpanded),[f,m]=(0,w.useState)(`graph`),g=(0,w.useCallback)(e=>{!i||i.specId!==e.id||(t?.send?.({type:`autophase.start`,payload:{title:e.title,phases:j(i),autonomous:!0}}),C(`autophase`))},[i,t]);(0,w.useEffect)(()=>{t?.send?.({type:`specs.list`})},[t]);let _=(0,w.useCallback)(e=>{a===e.id?c(null):(c(e.id),t?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[a,c,t]),E=i?.columns.flatMap(e=>e.tasks)??[],D={done:E.filter(e=>e.status===`completed`).length,running:E.filter(e=>e.status===`in_progress`).length,pending:E.filter(e=>e.status===`pending`||e.displayStatus===`queued`).length};return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,T.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b bg-card px-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(o,{className:`h-5 w-5 text-orange-500`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(S,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(l,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:r.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:r.map(e=>{let t=a===e.id,r=e.total>0?Math.round(e.completed/e.total*100):0;return(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/60`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>_(e),className:`flex w-full items-start gap-3 p-4 text-left`,children:[(0,T.jsx)(`span`,{className:`mt-1 text-muted-foreground`,children:t?(0,T.jsx)(p,{className:`h-4 w-4`}):(0,T.jsx)(h,{className:`h-4 w-4`})}),(0,T.jsx)(o,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.displayId}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] capitalize text-muted-foreground`,children:e.status})]}),(0,T.jsx)(`h2`,{className:`mt-1 text-base font-semibold`,children:e.title}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-emerald-500 transition-all`,style:{width:`${r}%`}})}),(0,T.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]})]})]}),t&&(0,T.jsxs)(`div`,{className:`border-t border-border p-4`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`text-sm font-medium`,children:[n(`activity:specs.tasks`,{count:i?.total??e.total}),i&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-emerald-500`,children:n(`activity:specs.doneCount`,{count:D.done})}),` `,(0,T.jsx)(`span`,{className:`text-sky-500`,children:n(`activity:specs.runningCount`,{count:D.running})}),` `,(0,T.jsx)(`span`,{children:n(`activity:specs.pendingCount`,{count:D.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,disabled:!i||i.specId!==e.id,onClick:()=>g(e),title:n(`activity:specs.runTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-500 transition-colors hover:bg-orange-500/25 disabled:opacity-40`,children:[(0,T.jsx)(s,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.run`)]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`list`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,f===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(v,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`graph`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,f===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(u,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.graph`)]})]})]})]}),!i||i.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.loadingTasks`)}):f===`graph`?(0,T.jsx)(k,{columns:i.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:E.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,T.jsx)(`span`,{className:`flex-1 text-sm`,children:e.title}),(0,T.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.displayStatus.replace(`_`,` `)})]},e.id))})]})]},e.id)})})})]})}export{M as SpecsView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{$t as r,Gn as i,Gt as a,It as o,Tr as s,Ur as c,Z as l,bn as u,dr as d,hr as f,lr as p,mn as m,ri as h,ti as g,ui as _,vr as v}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as y}from"./utils-C3qJEm2b.js";import{C as b,D as x,p as S,w as C}from"./index-Cb-hw9qG.js";var w=e(t(),1),T=n(),E={completed:{icon:(0,T.jsx)(h,{className:`h-3.5 w-3.5`}),label:`Completed`,text:`text-emerald-400`,ring:`border-emerald-500/40`},in_progress:{icon:(0,T.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),label:`Running`,text:`text-sky-400`,ring:`border-sky-500/50`},queued:{icon:(0,T.jsx)(p,{className:`h-3.5 w-3.5`}),label:`Queued`,text:`text-amber-400`,ring:`border-amber-500/40`},blocked:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),label:`Blocked`,text:`text-rose-400`,ring:`border-rose-500/30`},pending:{icon:(0,T.jsx)(d,{className:`h-3.5 w-3.5`}),label:`Pending`,text:`text-slate-400`,ring:`border-white/10`},review:{icon:(0,T.jsx)(o,{className:`h-3.5 w-3.5`}),label:`Review`,text:`text-violet-400`,ring:`border-violet-500/40`},failed:{icon:(0,T.jsx)(g,{className:`h-3.5 w-3.5`}),label:`Failed`,text:`text-red-400`,ring:`border-red-500/50`},cancelled:{icon:(0,T.jsx)(s,{className:`h-3.5 w-3.5`}),label:`Cancelled`,text:`text-slate-400`,ring:`border-slate-500/40`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{label:`Crit`,cls:`bg-red-500/15 text-red-400`},high:{label:`High`,cls:`bg-red-500/15 text-red-400`},medium:{label:`Med`,cls:`bg-amber-500/15 text-amber-400`},low:{label:`Low`,cls:`bg-emerald-500/15 text-emerald-400`}};function k({columns:e,onTaskClick:t}){let{t:n}=_();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-slate-400`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-lg border border-white/10 bg-[#0f1115] p-4`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-slate-200`,children:n(`activity:board.depGraphHeading`)}),(0,T.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs`,children:D.map(e=>(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-slate-400`,children:n(`activity:board.status.${e}`)})]},e))}),(0,T.jsx)(`div`,{className:`flex gap-3 overflow-x-auto pb-2`,children:e.map((n,r)=>(0,T.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,T.jsxs)(`div`,{className:`w-60 shrink-0`,children:[(0,T.jsx)(`div`,{className:`mb-2 border-b border-white/10 pb-1 text-center text-xs font-medium uppercase tracking-wider text-slate-500`,children:n.label}),(0,T.jsx)(`div`,{className:`space-y-2`,children:n.tasks.map(e=>(0,T.jsx)(A,{task:e,onClick:t},e.id))})]}),r<e.length-1&&(0,T.jsx)(`div`,{className:`flex h-full items-center pt-8 text-slate-600`,children:(0,T.jsx)(f,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=_();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:y(`w-full rounded-md border bg-[#161a22] p-2.5 text-left transition-colors hover:border-orange-500/40`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:y(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-slate-300`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:y(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:r.label})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-slate-200`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-slate-500`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:y(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-sky-500/15 text-sky-400`:`bg-white/5 text-slate-400`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(c,{className:`h-3 w-3 animate-spin`}),(0,T.jsx)(`span`,{children:e.agentName})]})]})}function j(e){return e.columns.map(e=>({name:e.label,description:``,priority:`medium`,estimateHours:e.tasks.length,parallelizable:!1,taskTemplates:e.tasks.map(e=>({title:e.title,description:e.description,type:e.type,priority:e.priority,estimateHours:1}))}))}function M({onClose:e}){let{client:t}=b(),{t:n}=_(),o=x(e=>e.specs),s=x(e=>e.detail),c=x(e=>e.expandedSpecId),d=x(e=>e.setExpanded),[p,m]=(0,w.useState)(`graph`),h=(0,w.useCallback)(e=>{!s||s.specId!==e.id||(t?.send?.({type:`autophase.start`,payload:{title:e.title,phases:j(s),autonomous:!0}}),C(`autophase`))},[s,t]);(0,w.useEffect)(()=>{t?.send?.({type:`specs.list`})},[t]);let g=(0,w.useCallback)(e=>{c===e.id?d(null):(d(e.id),t?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[c,d,t]),E=s?.columns.flatMap(e=>e.tasks)??[],D={done:E.filter(e=>e.status===`completed`).length,running:E.filter(e=>e.status===`in_progress`).length,pending:E.filter(e=>e.status===`pending`||e.displayStatus===`queued`).length};return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col bg-background`,children:[(0,T.jsxs)(`header`,{className:`flex shrink-0 items-center justify-between border-b bg-card px-4 py-2`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(i,{className:`h-5 w-5 text-orange-500`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:n(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(S,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(l,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-4`,children:o.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:o.map(e=>{let t=c===e.id,o=e.total>0?Math.round(e.completed/e.total*100):0;return(0,T.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/60`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>g(e),className:`flex w-full items-start gap-3 p-4 text-left`,children:[(0,T.jsx)(`span`,{className:`mt-1 text-muted-foreground`,children:t?(0,T.jsx)(v,{className:`h-4 w-4`}):(0,T.jsx)(f,{className:`h-4 w-4`})}),(0,T.jsx)(i,{className:`mt-0.5 h-4 w-4 text-muted-foreground`}),(0,T.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.displayId}),(0,T.jsx)(`span`,{className:`rounded bg-muted px-1.5 py-0.5 text-[10px] capitalize text-muted-foreground`,children:e.status})]}),(0,T.jsx)(`h2`,{className:`mt-1 text-base font-semibold`,children:e.title}),(0,T.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,T.jsx)(`div`,{className:`h-2 flex-1 overflow-hidden rounded-full bg-muted`,children:(0,T.jsx)(`div`,{className:`h-full rounded-full bg-emerald-500 transition-all`,style:{width:`${o}%`}})}),(0,T.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:[e.completed,`/`,e.total]})]})]})]}),t&&(0,T.jsxs)(`div`,{className:`border-t border-border p-4`,children:[(0,T.jsxs)(`div`,{className:`mb-3 flex items-center justify-between`,children:[(0,T.jsxs)(`div`,{className:`text-sm font-medium`,children:[n(`activity:specs.tasks`,{count:s?.total??e.total}),s&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-emerald-500`,children:n(`activity:specs.doneCount`,{count:D.done})}),` `,(0,T.jsx)(`span`,{className:`text-sky-500`,children:n(`activity:specs.runningCount`,{count:D.running})}),` `,(0,T.jsx)(`span`,{children:n(`activity:specs.pendingCount`,{count:D.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,disabled:!s||s.specId!==e.id,onClick:()=>h(e),title:n(`activity:specs.runTitle`),className:`inline-flex items-center gap-1 rounded-md bg-orange-500/15 px-2.5 py-1 text-xs font-medium text-orange-500 transition-colors hover:bg-orange-500/25 disabled:opacity-40`,children:[(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.run`)]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-1 rounded-md border border-border p-0.5`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`list`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,p===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(u,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>m(`graph`),className:y(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,p===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),` `,n(`activity:specs.graph`)]})]})]})]}),!s||s.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:specs.loadingTasks`)}):p===`graph`?(0,T.jsx)(k,{columns:s.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:E.map(e=>(0,T.jsxs)(`div`,{className:`flex items-center gap-3 rounded-md border border-border bg-card px-3 py-2`,children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:e.shortId}),(0,T.jsx)(`span`,{className:`flex-1 text-sm`,children:e.title}),(0,T.jsx)(`span`,{className:`text-xs capitalize text-muted-foreground`,children:e.displayStatus.replace(`_`,` `)})]},e.id))})]})]},e.id)})})})]})}export{M as SpecsView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{Fr as r,Ht as i,It as a,Z as o,ci as s,di as c,dt as l}from"./vendor-Ch4m_qLI.js";import"./i18n-CNo6A2vu.js";import{t as u}from"./ws-client-BAV7SLzK.js";import{t as d}from"./session-store-DN1UYDL9.js";import{n as f}from"./ui-store-BdOsq6T-.js";import{t as p}from"./utils-DBns3uMk.js";import{R as m}from"./index-CWj2bI87.js";import{n as h,t as g}from"./xterm-B9RXJkIu.js";var _=e(t(),1),v=`wrongstack.terminalDockHeight`;function y(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var b=n(),x={background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#f5e0dc`,selectionBackground:`#585b70`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#bac2de`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#f5c2e7`,brightCyan:`#94e2d5`,brightWhite:`#a6adc8`},S=8;function C(e=!1){return typeof window>`u`?300:y(window.innerHeight*(e?.32:.4))}function w(e=!1){if(typeof window>`u`)return C(e);try{let t=window.localStorage.getItem(v),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?y(n):C(e)}catch{return C(e)}}function T(e){try{window.localStorage.setItem(v,String(y(e)))}catch{}}function E(){try{return crypto.randomUUID()}catch{return`term-${Date.now()}-${Math.floor(Math.random()*1e6)}`}}function D(e){return{id:E(),name:`Terminal ${e}`,status:`starting`}}function O({desktopShell:e=!1,onClose:t}){let n=(0,_.useRef)(null),{t:c}=s(),u=(0,_.useRef)(1),[m,h]=(0,_.useState)(()=>w(e)),[g,v]=(0,_.useState)(()=>[D(1)]),[x,C]=(0,_.useState)(()=>g[0]?.id??``),O=f(e=>e.terminalCreateNonce),A=(0,_.useRef)(O),j=d(e=>e.projectName),M=d(e=>e.cwd);(0,_.useEffect)(()=>{let e=()=>{h(e=>{let t=y(e);return T(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),n.current?.();let t=e.clientY,r=m,i=document.body.style.cursor,a=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let o=e=>{let n=y(r+t-e.clientY);h(n),T(n)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),n.current===s&&(n.current=null)};n.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,_.useEffect)(()=>()=>n.current?.(),[]);let P=()=>{v(e=>{if(e.length>=S)return e;u.current+=1;let t=D(u.current);return C(t.id),[...e,t]})};(0,_.useEffect)(()=>{O!==A.current&&(A.current=O,P())},[O]);let F=e=>{v(n=>{let r=n.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(t),i):(x===e&&C(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=E();v(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&C(t),i})},L=()=>{v([]),C(``),queueMicrotask(t)},R=(e,t)=>{v(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===x)??g[0]??null;return(0,b.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:m},"data-shell":e?`desktop`:`browser`,className:p(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border bg-[#1e1e2e] shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,b.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,title:c(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-[#181825] hover:bg-primary/35 transition-colors`}),(0,b.jsxs)(`div`,{className:p(`flex min-w-0 items-center justify-between gap-3 border-b border-border/40 bg-[#181825]`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-[#cdd6f4]`,children:[(0,b.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),(0,b.jsx)(`span`,{className:`font-medium`,children:c(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,b.jsx)(`span`,{className:`min-w-0 truncate text-[#a6adc8]`,children:j||M||c(`activity:terminal.projectShell`)})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=S,title:g.length>=S?c(`activity:terminal.maxTerminals`,{count:S}):c(`activity:terminal.newTerminal`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(i,{className:`h-4 w-4`})}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:c(`activity:terminal.restart`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:c(`activity:terminal.closeAll`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(l,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:t,title:c(`activity:terminal.closeDock`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 transition-colors`,children:(0,b.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,b.jsx)(`div`,{className:p(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/40 bg-[#181825]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,b.jsxs)(`div`,{className:p(`group inline-flex items-center rounded border text-xs transition-colors`,e?`h-6 min-w-[92px] max-w-[148px]`:`h-7 min-w-[112px] max-w-[180px]`,x===t.id?`border-[#89b4fa]/45 bg-[#313244] text-[#cdd6f4]`:`border-transparent bg-transparent text-[#a6adc8] hover:bg-white/10`),children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>C(t.id),title:t.status===`exited`?`${t.name} exited`:t.name,className:`inline-flex min-w-0 flex-1 items-center gap-2 px-2 text-left`,children:[(0,b.jsx)(`span`,{className:p(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-[#a6e3a1]`,t.status===`starting`&&`bg-[#89b4fa]`,t.status===`exited`&&`bg-[#f38ba8]`)}),(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,b.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),F(t.id)},className:`mr-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[#a6adc8] opacity-70 hover:bg-white/10 hover:opacity-100`,title:c(`activity:terminal.closeTab`,{name:t.name}),children:(0,b.jsx)(o,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,b.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/30 bg-[#181825] px-3 py-1 text-[11px] font-mono text-[#6c7086]`,children:M}),(0,b.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,b.jsx)(k,{id:e.id,active:e.id===x,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function k({id:e,active:t,onRunning:n,onExit:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(n),l=(0,_.useRef)(r),d=m(e=>e.wsConnected);return(0,_.useEffect)(()=>{s.current=n,l.current=r},[r,n]),(0,_.useEffect)(()=>{let t=i.current;if(!t)return;let n=new g({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:x,scrollback:5e3}),r=new h;a.current=n,o.current=r,n.loadAddon(r),n.open(t);try{r.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:n.cols,rows:n.rows}}),s.current();let f=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&n.write(t.payload.data)}),p=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(n.write(`\r\n\x1b[2m${c.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),_=n.onData(t=>{d.send({type:`terminal.input`,payload:{id:e,data:t}})}),v=new ResizeObserver(()=>{if(t.offsetParent)try{r.fit(),d.send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}})}catch{}});return v.observe(t),()=>{f(),p(),_.dispose(),v.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),n.dispose(),a.current=null,o.current=null}},[e,d]),(0,_.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{o.current?.fit();let t=a.current;t&&(u(m.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,b.jsx)(`div`,{ref:i,className:p(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{O as TerminalPanel};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{m as t,p as n}from"./markdown-D0X23O-i.js";import{It as r,Lr as i,Wt as a,Z as o,dt as s,pi as c,ui as l}from"./vendor-Cm3Womkr.js";import"./i18n-BCQuDmQo.js";import{t as u}from"./ws-client-9j1mjm9I.js";import{t as d}from"./session-store-KCJiKVqL.js";import{n as f}from"./ui-store-CcznRsiV.js";import{t as p}from"./utils-C3qJEm2b.js";import{R as m}from"./index-Cb-hw9qG.js";import{n as h,t as g}from"./xterm-B9RXJkIu.js";var _=e(t(),1),v=`wrongstack.terminalDockHeight`;function y(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var b=n(),x={background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#f5e0dc`,selectionBackground:`#585b70`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#bac2de`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#f5c2e7`,brightCyan:`#94e2d5`,brightWhite:`#a6adc8`},S=8;function C(e=!1){return typeof window>`u`?300:y(window.innerHeight*(e?.32:.4))}function w(e=!1){if(typeof window>`u`)return C(e);try{let t=window.localStorage.getItem(v),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?y(n):C(e)}catch{return C(e)}}function T(e){try{window.localStorage.setItem(v,String(y(e)))}catch{}}function E(){try{return crypto.randomUUID()}catch{return`term-${Date.now()}-${Math.floor(Math.random()*1e6)}`}}function D(e){return{id:E(),name:`Terminal ${e}`,status:`starting`}}function O({desktopShell:e=!1,onClose:t}){let n=(0,_.useRef)(null),{t:c}=l(),u=(0,_.useRef)(1),[m,h]=(0,_.useState)(()=>w(e)),[g,v]=(0,_.useState)(()=>[D(1)]),[x,C]=(0,_.useState)(()=>g[0]?.id??``),O=f(e=>e.terminalCreateNonce),A=(0,_.useRef)(O),j=d(e=>e.projectName),M=d(e=>e.cwd);(0,_.useEffect)(()=>{let e=()=>{h(e=>{let t=y(e);return T(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),n.current?.();let t=e.clientY,r=m,i=document.body.style.cursor,a=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let o=e=>{let n=y(r+t-e.clientY);h(n),T(n)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),n.current===s&&(n.current=null)};n.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,_.useEffect)(()=>()=>n.current?.(),[]);let P=()=>{v(e=>{if(e.length>=S)return e;u.current+=1;let t=D(u.current);return C(t.id),[...e,t]})};(0,_.useEffect)(()=>{O!==A.current&&(A.current=O,P())},[O]);let F=e=>{v(n=>{let r=n.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(t),i):(x===e&&C(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=E();v(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&C(t),i})},L=()=>{v([]),C(``),queueMicrotask(t)},R=(e,t)=>{v(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===x)??g[0]??null;return(0,b.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:m},"data-shell":e?`desktop`:`browser`,className:p(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border bg-[#1e1e2e] shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,b.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,title:c(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-[#181825] hover:bg-primary/35 transition-colors`}),(0,b.jsxs)(`div`,{className:p(`flex min-w-0 items-center justify-between gap-3 border-b border-border/40 bg-[#181825]`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,b.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-[#cdd6f4]`,children:[(0,b.jsx)(i,{className:`h-3.5 w-3.5 shrink-0`}),(0,b.jsx)(`span`,{className:`font-medium`,children:c(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,b.jsx)(`span`,{className:`min-w-0 truncate text-[#a6adc8]`,children:j||M||c(`activity:terminal.projectShell`)})]}),(0,b.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,b.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=S,title:g.length>=S?c(`activity:terminal.maxTerminals`,{count:S}):c(`activity:terminal.newTerminal`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(a,{className:`h-4 w-4`})}),(0,b.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:c(`activity:terminal.restart`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(r,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:c(`activity:terminal.closeAll`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,b.jsx)(s,{className:`h-3.5 w-3.5`})}),(0,b.jsx)(`button`,{type:`button`,onClick:t,title:c(`activity:terminal.closeDock`),className:`inline-flex items-center justify-center h-6 w-6 rounded text-[#a6adc8] hover:bg-white/10 transition-colors`,children:(0,b.jsx)(o,{className:`h-4 w-4`})})]})]}),(0,b.jsx)(`div`,{className:p(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/40 bg-[#181825]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,b.jsxs)(`div`,{className:p(`group inline-flex items-center rounded border text-xs transition-colors`,e?`h-6 min-w-[92px] max-w-[148px]`:`h-7 min-w-[112px] max-w-[180px]`,x===t.id?`border-[#89b4fa]/45 bg-[#313244] text-[#cdd6f4]`:`border-transparent bg-transparent text-[#a6adc8] hover:bg-white/10`),children:[(0,b.jsxs)(`button`,{type:`button`,onClick:()=>C(t.id),title:t.status===`exited`?`${t.name} exited`:t.name,className:`inline-flex min-w-0 flex-1 items-center gap-2 px-2 text-left`,children:[(0,b.jsx)(`span`,{className:p(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-[#a6e3a1]`,t.status===`starting`&&`bg-[#89b4fa]`,t.status===`exited`&&`bg-[#f38ba8]`)}),(0,b.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,b.jsx)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),F(t.id)},className:`mr-1 inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-[#a6adc8] opacity-70 hover:bg-white/10 hover:opacity-100`,title:c(`activity:terminal.closeTab`,{name:t.name}),children:(0,b.jsx)(o,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,b.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/30 bg-[#181825] px-3 py-1 text-[11px] font-mono text-[#6c7086]`,children:M}),(0,b.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,b.jsx)(k,{id:e.id,active:e.id===x,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function k({id:e,active:t,onRunning:n,onExit:r}){let i=(0,_.useRef)(null),a=(0,_.useRef)(null),o=(0,_.useRef)(null),s=(0,_.useRef)(n),l=(0,_.useRef)(r),d=m(e=>e.wsConnected);return(0,_.useEffect)(()=>{s.current=n,l.current=r},[r,n]),(0,_.useEffect)(()=>{let t=i.current;if(!t)return;let n=new g({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:x,scrollback:5e3}),r=new h;a.current=n,o.current=r,n.loadAddon(r),n.open(t);try{r.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:n.cols,rows:n.rows}}),s.current();let f=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&n.write(t.payload.data)}),p=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(n.write(`\r\n\x1b[2m${c.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),_=n.onData(t=>{d.send({type:`terminal.input`,payload:{id:e,data:t}})}),v=new ResizeObserver(()=>{if(t.offsetParent)try{r.fit(),d.send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}})}catch{}});return v.observe(t),()=>{f(),p(),_.dispose(),v.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),n.dispose(),a.current=null,o.current=null}},[e,d]),(0,_.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{o.current?.fit();let t=a.current;t&&(u(m.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,b.jsx)(`div`,{ref:i,className:p(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{O as TerminalPanel};
@@ -1,4 +1,4 @@
1
- import{oi as e,si as t}from"./vendor-Ch4m_qLI.js";function n(e,t){if(e==null){let e=Error(t?`Expected ${t} to be defined`:`Expected value to be defined`);throw e.name=`ExpectDefinedError`,e}return e}function r(e,t){let n=e=>e.trim().replace(/\s+/g,` `).toLowerCase();return n(e)===n(t)}function i(e){return e instanceof Error?e.message:String(e)}function a(e){if(!e)return e;let t=e.split(/\n{2,}/),n=[];for(let e of t)n.length>0&&n[n.length-1]?.trim()===e.trim()||n.push(e);return n.map(e=>{let t=e.split(`
1
+ import{ci as e,li as t}from"./vendor-Cm3Womkr.js";function n(e,t){if(e==null){let e=Error(t?`Expected ${t} to be defined`:`Expected value to be defined`);throw e.name=`ExpectDefinedError`,e}return e}function r(e,t){let n=e=>e.trim().replace(/\s+/g,` `).toLowerCase();return n(e)===n(t)}function i(e){return e instanceof Error?e.message:String(e)}function a(e){if(!e)return e;let t=e.split(/\n{2,}/),n=[];for(let e of t)n.length>0&&n[n.length-1]?.trim()===e.trim()||n.push(e);return n.map(e=>{let t=e.split(`
2
2
  `),n=[];for(let e of t)n.length>0&&e.trim().length>0&&n[n.length-1]?.trim()===e.trim()||n.push(e);return n.join(`
3
3
  `)}).join(`
4
4
 
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-DT93tsyC.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-DCAGDU3F.js","assets/commandPalette-DUootORZ.js","assets/common-D7usadq4.js","assets/settings-CGhOOFpI.js","assets/setup-Dr2UDb8s.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
2
- import{di as e,li as t,oi as n,si as r,ui as i}from"./vendor-Ch4m_qLI.js";import{t as a}from"./activity-DT93tsyC.js";import{t as o}from"./chat-DCAGDU3F.js";import{t as s}from"./commandPalette-DUootORZ.js";import{t as c}from"./common-D7usadq4.js";import{t as l}from"./settings-CGhOOFpI.js";import{t as u}from"./setup-Dr2UDb8s.js";import{t as d}from"./toasts-BL_8kH4B.js";import{l as f}from"./monaco-DqY9Mr3N.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,streamFleet:!0,nextPrediction:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceLanguage:`original`,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_()},x=r()(n(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:5,migrate:e=>{let t=e??{};return[`hybrid`,`intelligent`,`selective`].includes(t.contextStrategy)||(t.contextStrategy=`hybrid`),t.auditLevel===`verbose`&&(t.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(t.auditLevel)||(t.auditLevel=`standard`),typeof t.autoProceedMaxIterations!=`number`&&(t.autoProceedMaxIterations=50),(!t.fallbackProfiles||typeof t.fallbackProfiles!=`object`||Array.isArray(t.fallbackProfiles))&&(t.fallbackProfiles={}),Array.isArray(t.favoriteModels)||(t.favoriteModels=[]),typeof t.favoriteModelsOnly!=`boolean`&&(t.favoriteModelsOnly=!1),(!t.modelMatrix||typeof t.modelMatrix!=`object`||Array.isArray(t.modelMatrix))&&(t.modelMatrix={}),(typeof t.uiLocale!=`string`||!t.uiLocale)&&(t.uiLocale=_()),t}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}e.use(t).use(i((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-CVWYwjgf.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-cxuX4gFa.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-2M1hYRuH.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-CrGjglH4.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-CQ4x-iFD.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-Iyk4ncan.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-DT93tsyC.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-DCAGDU3F.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DUootORZ.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-D7usadq4.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-CGhOOFpI.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-Dr2UDb8s.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-ByEwzh5Q.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-Cvy-F2d6.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-CTE9ITWg.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BAg8_MKg.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-TqprB9wO.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-BqoJ89VQ.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-BEjzb11U.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-Cfq81NCh.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-BYf22WAi.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-tmj0IcQS.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-DgGu17XI.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-C4wNoopG.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-Cjm0UoMi.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-DNIePdaQ.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-BZhacjvy.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-BH1mb9Im.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-BVvx94WK.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-B8S3Rhsj.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-DN6Bmnaw.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-CdLXf1yN.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-RxWSjQIg.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-C29pCVfm.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-CmHCQRVI.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-CGWbN6bj.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CqiCPjKb.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-DhofDrgA.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-BE_ljQwl.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-KzRPhobM.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-OOQ-99Tn.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-BPkWK-DE.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(e.language||`en`),x.subscribe((t,n)=>{let r=t.uiLocale;r&&r!==n.uiLocale&&r!==e.language&&e.changeLanguage(r).then(()=>w(r))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(t=>{if(!t)return;let n=v(t);if(n===e.language)return;let r=x.getState();r.uiLocale!==n&&r.set({uiLocale:n}),e.changeLanguage(n).then(()=>w(n))})}try{T()}catch{}export{h as n,x as t};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-DT93tsyC.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-DCAGDU3F.js","assets/commandPalette-DUootORZ.js","assets/common-D7usadq4.js","assets/settings-wb322bGN.js","assets/setup-Dr2UDb8s.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
2
+ import{ci as e,di as t,fi as n,li as r,pi as i}from"./vendor-Cm3Womkr.js";import{t as a}from"./activity-DT93tsyC.js";import{t as o}from"./chat-DCAGDU3F.js";import{t as s}from"./commandPalette-DUootORZ.js";import{t as c}from"./common-D7usadq4.js";import{t as l}from"./settings-wb322bGN.js";import{t as u}from"./setup-Dr2UDb8s.js";import{t as d}from"./toasts-BL_8kH4B.js";import{l as f}from"./monaco-DqY9Mr3N.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,streamFleet:!0,nextPrediction:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceLanguage:`original`,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_()},x=r()(e(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:5,migrate:e=>{let t=e??{};return[`hybrid`,`intelligent`,`selective`].includes(t.contextStrategy)||(t.contextStrategy=`hybrid`),t.auditLevel===`verbose`&&(t.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(t.auditLevel)||(t.auditLevel=`standard`),typeof t.autoProceedMaxIterations!=`number`&&(t.autoProceedMaxIterations=50),(!t.fallbackProfiles||typeof t.fallbackProfiles!=`object`||Array.isArray(t.fallbackProfiles))&&(t.fallbackProfiles={}),Array.isArray(t.favoriteModels)||(t.favoriteModels=[]),typeof t.favoriteModelsOnly!=`boolean`&&(t.favoriteModelsOnly=!1),(!t.modelMatrix||typeof t.modelMatrix!=`object`||Array.isArray(t.modelMatrix))&&(t.modelMatrix={}),(typeof t.uiLocale!=`string`||!t.uiLocale)&&(t.uiLocale=_()),t}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}i.use(t).use(n((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-CVWYwjgf.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-cxuX4gFa.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-2M1hYRuH.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-CrGjglH4.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-CQ4x-iFD.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-Iyk4ncan.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-DT93tsyC.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-DCAGDU3F.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DUootORZ.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-D7usadq4.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-wb322bGN.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-Dr2UDb8s.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-ByEwzh5Q.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-Cvy-F2d6.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-CTE9ITWg.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BAg8_MKg.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-TqprB9wO.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-BqoJ89VQ.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-BEjzb11U.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-Cfq81NCh.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-BYf22WAi.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-tmj0IcQS.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-DgGu17XI.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-C4wNoopG.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-Cjm0UoMi.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-DNIePdaQ.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-BZhacjvy.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-BH1mb9Im.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-BVvx94WK.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-B8S3Rhsj.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-DN6Bmnaw.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-CdLXf1yN.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-RxWSjQIg.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-C29pCVfm.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-CmHCQRVI.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-CGWbN6bj.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CqiCPjKb.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-DhofDrgA.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-BE_ljQwl.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-KzRPhobM.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-OOQ-99Tn.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-BPkWK-DE.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(i.language||`en`),x.subscribe((e,t)=>{let n=e.uiLocale;n&&n!==t.uiLocale&&n!==i.language&&i.changeLanguage(n).then(()=>w(n))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(e=>{if(!e)return;let t=v(e);if(t===i.language)return;let n=x.getState();n.uiLocale!==t&&n.set({uiLocale:t}),i.changeLanguage(t).then(()=>w(t))})}try{T()}catch{}export{h as n,x as t};