@wrongstack/webui 0.318.0 → 0.319.1

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 (99) hide show
  1. package/dist/assets/{AgentRosterView-C46rL23K.js → AgentRosterView-VIctzKMy.js} +1 -1
  2. package/dist/assets/{AnalyticsDashboard-B8r_8kNv.js → AnalyticsDashboard-Dr67MeEY.js} +1 -1
  3. package/dist/assets/{AudienceMemoryPanel-Ciybycpn.js → AudienceMemoryPanel-DoaZfrjf.js} +1 -1
  4. package/dist/assets/{ChangesView-BREfCsEq.js → ChangesView-s7Mn7iE2.js} +1 -1
  5. package/dist/assets/ChimeraReviewsView-Cverzv0b.js +1 -0
  6. package/dist/assets/{ChronicleDashboard-bo2jv52s.js → ChronicleDashboard-CzqPfaPc.js} +1 -1
  7. package/dist/assets/{CodeEditor-C_KzNkIb.js → CodeEditor-DXQoTSH5.js} +1 -1
  8. package/dist/assets/{CodeMap-DA_k3u5g.js → CodeMap-D34FOPgR.js} +1 -1
  9. package/dist/assets/{ConfirmModal-gukSikBD.js → ConfirmModal-B6BGiiN8.js} +1 -1
  10. package/dist/assets/{CronJobsPanel-D-43oYQ-.js → CronJobsPanel-CenxuaN9.js} +1 -1
  11. package/dist/assets/{DeadCodeScanPanel-VnMQatbH.js → DeadCodeScanPanel-DooqnEMF.js} +1 -1
  12. package/dist/assets/{DebugDashboard-DNDadwro.js → DebugDashboard-DWaUg6e1.js} +1 -1
  13. package/dist/assets/{DesignGalleryView-B9ZMJPOQ.js → DesignGalleryView-BKtjn4px.js} +1 -1
  14. package/dist/assets/{GoalView-BkoCNN8l.js → GoalView-BZ62_vF-.js} +1 -1
  15. package/dist/assets/{KanbanView-nql6LkaS.js → KanbanView-DsWnTpxr.js} +1 -1
  16. package/dist/assets/{MailboxDetailView-CdHRfnNq.js → MailboxDetailView-DS1P9DRT.js} +1 -1
  17. package/dist/assets/{MemoryDrawer-CfukdhlF.js → MemoryDrawer-BJEY1v4P.js} +1 -1
  18. package/dist/assets/{MemoryManager-BD_VnFAu.js → MemoryManager-D-kuyTQe.js} +1 -1
  19. package/dist/assets/{ModelPicker-C3r7IFfh.js → ModelPicker-CLs0qQgg.js} +1 -1
  20. package/dist/assets/{OfficeMapPanel-B47jfEHf.js → OfficeMapPanel-BqoCcniD.js} +1 -1
  21. package/dist/assets/{ProcessMonitor-CvHdN8Bn.js → ProcessMonitor-CHNNqCk9.js} +1 -1
  22. package/dist/assets/{PromptJournalView-CXZ9notj.js → PromptJournalView-Biu4DknM.js} +1 -1
  23. package/dist/assets/{QueuePanel-DOcgHRH3.js → QueuePanel-CzTXq6j4.js} +1 -1
  24. package/dist/assets/{RefreshDebugView-BYmeORMQ.js → RefreshDebugView-d9iU3sFX.js} +1 -1
  25. package/dist/assets/{RequirementIntakeView-CFgVx_0T.js → RequirementIntakeView-BVyF2zXR.js} +1 -1
  26. package/dist/assets/{SageTabs-BRJG0fhZ.js → SageTabs-YASyEFo6.js} +2 -2
  27. package/dist/assets/{SddFlowGraph-BsfhxlDK.js → SddFlowGraph-Bj_Aqq5B.js} +1 -1
  28. package/dist/assets/{SddHub-Br1vyCgq.js → SddHub-rmGGEYZe.js} +1 -1
  29. package/dist/assets/{SessionInspectView-BSRjWErA.js → SessionInspectView-iaKkGAAM.js} +1 -1
  30. package/dist/assets/{SessionList-BkaI91oW.js → SessionList-vmAS2Fg5.js} +1 -1
  31. package/dist/assets/{SessionsDashboard-BEQs4Div.js → SessionsDashboard-x3iyhrGl.js} +1 -1
  32. package/dist/assets/SetupScreen-huPJT0Bv.js +1 -0
  33. package/dist/assets/{SkillDetailView-DqxkOnb8.js → SkillDetailView-BcD9z7zG.js} +1 -1
  34. package/dist/assets/{SpecsView-COS0-sxq.js → SpecsView-ok8HZ8ws.js} +1 -1
  35. package/dist/assets/{TechStackView-Dr8vI0hK.js → TechStackView-DmMtwb4l.js} +1 -1
  36. package/dist/assets/{TerminalPanel-DlIyvxm6.js → TerminalPanel-cbM6oQWQ.js} +1 -1
  37. package/dist/assets/{activity-q85HXQNv.js → activity-BU6MNvBJ.js} +1 -1
  38. package/dist/assets/{activity-B2_Vr2oD.js → activity-C7dkJqBU.js} +1 -1
  39. package/dist/assets/{activity-DYMBKGt0.js → activity-C_18AaRY.js} +1 -1
  40. package/dist/assets/{activity-IxgYWPDt.js → activity-CpnSsE22.js} +1 -1
  41. package/dist/assets/{activity-BF1idM4Y.js → activity-CtTKsSX6.js} +1 -1
  42. package/dist/assets/{activity-C-kOJZXC.js → activity-D1rp3dH9.js} +1 -1
  43. package/dist/assets/{activity-DPpMW8BU.js → activity-hTPcI4q1.js} +1 -1
  44. package/dist/assets/{chat-DTI7lNDx.js → chat-6dE2AJNN.js} +1 -1
  45. package/dist/assets/{chat-BvKkSd09.js → chat-B3AJmhGD.js} +1 -1
  46. package/dist/assets/{chat-BNWqeV-N.js → chat-BHsbpaVt.js} +1 -1
  47. package/dist/assets/{chat-BlllxfpP.js → chat-BITJe8-v.js} +1 -1
  48. package/dist/assets/{chat-DlhXGxxi.js → chat-U-Jjb8_k.js} +1 -1
  49. package/dist/assets/{chat-B60h8Cji.js → chat-_Xp5fDnj.js} +1 -1
  50. package/dist/assets/{chat-B5a3cvps.js → chat-mSbSzPl5.js} +1 -1
  51. package/dist/assets/{chat-store-DIcs826A.js → chat-store-oW_-zcJP.js} +1 -1
  52. package/dist/assets/{i18n-Cv65b1SP.js → i18n-D06uU1PM.js} +2 -2
  53. package/dist/assets/index-BQ7PJ-sA.js +144 -0
  54. package/dist/assets/index-CWYymMpa.css +1 -0
  55. package/dist/assets/{roster-ws-D5JW3IPJ.js → roster-ws-BQUI8QuW.js} +1 -1
  56. package/dist/assets/setup-B0D9CK3-.js +1 -0
  57. package/dist/assets/setup-B58YVaGU.js +1 -0
  58. package/dist/assets/setup-C2H9Uv0Q.js +1 -0
  59. package/dist/assets/setup-CzM4dkkU.js +1 -0
  60. package/dist/assets/setup-Di56FlHP.js +1 -0
  61. package/dist/assets/setup-Dwt58Mpz.js +1 -0
  62. package/dist/assets/setup-DznVdlJy.js +1 -0
  63. package/dist/assets/{stores-CNuMLG8X.js → stores-C7Vvce-6.js} +1 -1
  64. package/dist/assets/ui-store-Dm7ujR9u.js +1 -0
  65. package/dist/assets/useWebSocket-9lfOsI_r.js +27 -0
  66. package/dist/assets/{view-navigation-DPOY0lyt.js → view-navigation-wOKaM_Rf.js} +1 -1
  67. package/dist/assets/{ws-client-D-d32pHb.js → ws-client-DtTZLD8e.js} +2 -2
  68. package/dist/components/ChatInput/use-speech-recognition.d.ts +1 -1
  69. package/dist/components/DependencyGraph.d.ts +1 -1
  70. package/dist/components/DiffView.d.ts +1 -1
  71. package/dist/components/MessageBubble/ToolLedgerCard.d.ts +1 -1
  72. package/dist/components/SetupScreen/CustomProviderSection.d.ts +1 -1
  73. package/dist/components/agents/AgentRosterCard.d.ts +1 -1
  74. package/dist/components/context-editor/ContextWindowEditor.d.ts +1 -1
  75. package/dist/components/ui/dropdown-menu.d.ts +1 -1
  76. package/dist/components/vector-memory-panel/index.d.ts +1 -1
  77. package/dist/index.html +14 -14
  78. package/dist/index.js +5788 -3483
  79. package/dist/lib/launch-builtin-round.d.ts +43 -0
  80. package/dist/lib/perf-run-message.d.ts +51 -0
  81. package/dist/manifest.json +1 -1
  82. package/dist/stores/fleet-store.d.ts +4 -0
  83. package/dist/stores/index.d.ts +2 -2
  84. package/dist/stores/types.d.ts +9 -0
  85. package/dist/stores/ui-store.d.ts +0 -2
  86. package/package.json +10 -10
  87. package/dist/assets/ChimeraReviewsView-aSYmQ8tC.js +0 -1
  88. package/dist/assets/SetupScreen-zY4541lT.js +0 -1
  89. package/dist/assets/index-DSyVpLgL.css +0 -1
  90. package/dist/assets/index-DbprKWmG.js +0 -137
  91. package/dist/assets/setup-BQLPzL3N.js +0 -1
  92. package/dist/assets/setup-C9lrNwQF.js +0 -1
  93. package/dist/assets/setup-CcxP7cUl.js +0 -1
  94. package/dist/assets/setup-CtKKNpH9.js +0 -1
  95. package/dist/assets/setup-D4rp2jda.js +0 -1
  96. package/dist/assets/setup-MvmOtwNp.js +0 -1
  97. package/dist/assets/setup-blxUcxNU.js +0 -1
  98. package/dist/assets/ui-store-DpKUBLWd.js +0 -1
  99. package/dist/assets/useWebSocket-VIItbvVK.js +0 -27
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,D as n,_t as r}from"./ws-client-D-d32pHb.js";import{Sn as i,Ui as a,Xa as o,_n as s,ei as c,fr as l,ht as u,ia as d,io as f,ji as p,mt as m,oa as h,oo as g,qa as _,ta as v,to as y,ut as b}from"./vendor-enc0q-Va.js";import"./i18n-Cv65b1SP.js";import{t as x}from"./useWebSocket-VIItbvVK.js";import{t as S}from"./utils-DQ9Exx8j.js";import"./stores-CNuMLG8X.js";import{C,E as w,T,b as E,d as D,w as O}from"./index-DbprKWmG.js";import{t as k}from"./SessionList-BkaI91oW.js";var A=e(g(),1),j=b(),M=12;async function N(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 P(e){switch(e){case`running`:return{icon:(0,j.jsx)(_,{className:`h-3.5 w-3.5`}),cls:`text-success`};case`streaming`:return{icon:(0,j.jsx)(i,{className:`h-3.5 w-3.5`}),cls:`text-primary`};case`waiting_user`:return{icon:(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),cls:`text-warning`};case`error`:return{icon:(0,j.jsx)(h,{className:`h-3.5 w-3.5`}),cls:`text-destructive`};case`idle`:return{icon:(0,j.jsx)(v,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`};default:return{icon:(0,j.jsx)(d,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`}}}function F(e){switch(e){case`active`:return{icon:(0,j.jsx)(m,{className:`h-3.5 w-3.5`}),cls:`text-success`,badge:`border-success/25 bg-success/8 text-success`};case`idle`:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-primary`,badge:`border-primary/25 bg-primary/10 text-primary`};case`closing`:return{icon:(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),cls:`text-warning`,badge:`border-warning/25 bg-warning/10 text-warning`};case`lost`:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-destructive/60`,badge:`border-destructive/15 bg-destructive/5 text-destructive/70`};default:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`,badge:`border-border bg-muted text-muted-foreground`}}}function I(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 L(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return f.t(`common:time.justNow`);if(n<60)return f.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?f.t(`common:time.minutesAgo`,{count:r}):f.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function R(){let e=t(e=>e.wsConnected),i=r(),{entries:a,loading:s,error:c}=n(o(e=>({entries:e.entries,loading:e.loading,error:e.error}))),{listSessions:l,resumeSession:u,deleteSession:d,renameSession:f}=x(),[p,m]=(0,A.useState)(``);return(0,A.useEffect)(()=>{e&&l(200)},[i,l,e]),(0,j.jsx)(k,{historyQuery:p,setHistoryQuery:m,historyEntries:a,historyLoading:s,historyError:c,wsConnected:e,listSessions:l,resumeSession:u,deleteSession:d,renameSession:f,variant:`workspace`})}function z(){let{t:e}=y();return(0,j.jsxs)(C,{defaultValue:`history`,className:`flex h-full min-h-0 flex-col bg-background`,"data-testid":`sessions-workspace`,children:[(0,j.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border/75 bg-card px-4 py-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-primary`,children:e(`activity:sessions.workspaceEyebrow`,{defaultValue:`Conversation control`})}),(0,j.jsx)(`h1`,{className:`mt-0.5 text-lg font-semibold tracking-tight`,children:e(`activity:sessions.workspaceTitle`,{defaultValue:`Sessions`})})]}),(0,j.jsxs)(T,{className:`h-9 min-h-9 justify-start border-border/75 bg-background p-0 shadow-none`,children:[(0,j.jsxs)(w,{value:`history`,className:`h-9 gap-1.5 border-r border-border/75 px-3 text-xs shadow-none data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:ring-0`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5`}),e(`activity:sessions.tabs.history`,{defaultValue:`History`})]}),(0,j.jsxs)(w,{value:`live`,className:`h-9 gap-1.5 px-3 text-xs shadow-none data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:ring-0`,children:[(0,j.jsx)(i,{className:`h-3.5 w-3.5`}),e(`activity:sessions.tabs.live`,{defaultValue:`Live sessions`})]})]})]}),(0,j.jsx)(O,{value:`history`,className:`mt-0 min-h-0 flex-1 overflow-hidden ring-0`,children:(0,j.jsx)(R,{})}),(0,j.jsx)(O,{value:`live`,className:`mt-0 min-h-0 flex-1 overflow-hidden ring-0`,children:(0,j.jsx)(B,{})})]})}function B(){let{t:e}=y(),[t,n]=(0,A.useState)([]),[r,i]=(0,A.useState)(!0),[o,s]=(0,A.useState)(null),[d,f]=(0,A.useState)(1),g=D(`sessions`,!r&&!o&&t.length>0),_=(0,A.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){s(null),n([]);return}throw Error(`HTTP ${e.status}: ${await N(e)}`)}if(!(e.headers.get(`content-type`)?.toLowerCase()??``).includes(`application/json`)){s(null),n([]);return}let t=await e.json();if(!Array.isArray(t)){s(null),n([]);return}n(e=>{let n=t;if(e.length===n.length){let t=!0;for(let r=0;r<n.length;r++){let i=n[r],a=e[r];if(i.sessionId!==a.sessionId||i.status!==a.status||i.agentCount!==a.agentCount||i.startedAt!==a.startedAt){t=!1;break}}if(t)return e}return n}),s(null)}catch(e){if(e instanceof SyntaxError){s(null),n([]);return}s(e instanceof Error?e.message:String(e))}finally{i(!1)}},[]);(0,A.useEffect)(()=>{_();let e=setInterval(_,5e3);return()=>clearInterval(e)},[_]);let v=t.filter(e=>e.status===`active`).length,b=t.reduce((e,t)=>e+t.agentCount,0),x=t.slice((d-1)*M,d*M);return(0,A.useEffect)(()=>{let e=Math.max(1,Math.ceil(t.length/M));d>e&&f(e)},[d,t.length]),r?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground`,children:[(0,j.jsx)(l,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:liveSessions.loading`)]})}):o?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface max-w-lg p-5 text-center`,children:[(0,j.jsx)(h,{className:`mx-auto h-8 w-8 text-warning`}),(0,j.jsx)(`p`,{className:`mt-3 text-sm font-medium`,children:e(`activity:liveSessions.apiUnavailable`)}),(0,j.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:o})]})}):t.length===0?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface max-w-md p-6 text-center text-muted-foreground`,children:[(0,j.jsx)(u,{className:`mx-auto h-9 w-9 opacity-50`}),(0,j.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:e(`activity:liveSessions.empty`)}),(0,j.jsx)(`p`,{className:`mt-1 text-xs`,children:e(`activity:liveSessions.autoRefresh`)})]})}):(0,j.jsx)(`div`,{ref:g,className:`h-full min-h-0 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4`,children:[(0,j.jsx)(`header`,{className:`border border-border/70 bg-card/75 p-4`,children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(m,{className:`h-4 w-4 text-primary`}),(0,j.jsx)(`h2`,{className:`text-base font-semibold`,children:e(`activity:liveSessions.heading`,{count:t.length})})]}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:liveSessions.autoRefresh`)})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 text-center sm:min-w-[22rem]`,children:[(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:t.length}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.sessions`)})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-success`,children:v}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.active`)})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:b}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.agents`)})]})]})]})}),(0,j.jsx)(`div`,{className:`grid gap-3`,children:x.map(t=>{let n=F(t.status);return(0,j.jsxs)(`article`,{className:`border border-border/70 bg-card/75 p-3 sm:p-4`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:n.cls,children:n.icon}),(0,j.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold`,title:t.projectName,children:t.projectName}),(0,j.jsx)(`span`,{className:`bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:t.projectSlug}),(0,j.jsx)(`span`,{className:`inline-flex items-center border px-1.5 py-0.5 text-[10px] font-semibold uppercase ${n.badge}`,children:t.status})]}),(0,j.jsxs)(`div`,{className:`mt-2 grid gap-1.5 text-xs text-muted-foreground md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,j.jsx)(p,{className:`h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono`,title:t.workingDir,children:t.workingDir})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t.gitBranch?(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1 text-primary`,children:[(0,j.jsx)(c,{className:`h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`truncate font-mono`,children:t.gitBranch})]}):null,(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),I(t.startedAt)]}),(0,j.jsx)(`span`,{className:`font-mono`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs sm:grid-cols-3 lg:w-64`,children:[(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.agents`)}),(0,j.jsx)(`div`,{className:`font-semibold tabular-nums`,children:t.agentCount})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.status`)}),(0,j.jsx)(`div`,{className:`truncate font-mono font-semibold`,children:t.status})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.runtime`)}),(0,j.jsx)(`div`,{className:`font-mono font-semibold`,children:I(t.startedAt)})]})]})]}),(0,j.jsxs)(`div`,{className:`mt-3 overflow-hidden border border-border/70 bg-background/45`,children:[t.agents.length===0?(0,j.jsx)(`div`,{className:`px-3 py-3 text-xs text-muted-foreground`,children:e(`activity:liveSessions.noAgents`)}):(0,j.jsx)(`div`,{className:`divide-y divide-border/60`,children:t.agents.slice(0,5).map(t=>{let n=P(t.status);return(0,j.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 px-3 py-2 text-xs sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,14rem)_auto]`,children:[(0,j.jsx)(`span`,{className:S(`mt-0.5 shrink-0`,n.cls),children:n.icon}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`truncate font-medium`,title:t.name,children:t.name}),(0,j.jsx)(`div`,{className:`font-mono text-[10px] text-muted-foreground`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:L(t.lastActivityAt)})})]}),(0,j.jsx)(`div`,{className:`min-w-0 font-mono text-[10px] text-muted-foreground sm:text-xs`,children:t.currentTool?(0,j.jsx)(`span`,{className:`block truncate`,title:t.currentTool,children:t.currentTool}):(0,j.jsx)(`span`,{className:`text-muted-foreground/75`,children:t.status})}),(0,j.jsx)(`span`,{className:`hidden font-mono text-[10px] text-muted-foreground sm:block`,children:L(t.lastActivityAt)})]},t.id)})}),t.agents.length>5?(0,j.jsx)(`div`,{className:`border-t border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null]})]},t.sessionId)})}),(0,j.jsx)(E,{page:d,pageSize:M,totalItems:t.length,onPageChange:f,itemLabel:`sessions`})]})})}export{z as SessionsDashboard};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,D as n,_t as r}from"./ws-client-DtTZLD8e.js";import{Sn as i,Ui as a,Xa as o,_n as s,ei as c,fr as l,ht as u,ia as d,io as f,ji as p,mt as m,oa as h,oo as g,qa as _,ta as v,to as y,ut as b}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{t as x}from"./useWebSocket-9lfOsI_r.js";import{t as S}from"./utils-DQ9Exx8j.js";import"./stores-C7Vvce-6.js";import{C,E as w,T,b as E,d as D,w as O}from"./index-BQ7PJ-sA.js";import{t as k}from"./SessionList-vmAS2Fg5.js";var A=e(g(),1),j=b(),M=12;async function N(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 P(e){switch(e){case`running`:return{icon:(0,j.jsx)(_,{className:`h-3.5 w-3.5`}),cls:`text-success`};case`streaming`:return{icon:(0,j.jsx)(i,{className:`h-3.5 w-3.5`}),cls:`text-primary`};case`waiting_user`:return{icon:(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),cls:`text-warning`};case`error`:return{icon:(0,j.jsx)(h,{className:`h-3.5 w-3.5`}),cls:`text-destructive`};case`idle`:return{icon:(0,j.jsx)(v,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`};default:return{icon:(0,j.jsx)(d,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`}}}function F(e){switch(e){case`active`:return{icon:(0,j.jsx)(m,{className:`h-3.5 w-3.5`}),cls:`text-success`,badge:`border-success/25 bg-success/8 text-success`};case`idle`:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-primary`,badge:`border-primary/25 bg-primary/10 text-primary`};case`closing`:return{icon:(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),cls:`text-warning`,badge:`border-warning/25 bg-warning/10 text-warning`};case`lost`:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-destructive/60`,badge:`border-destructive/15 bg-destructive/5 text-destructive/70`};default:return{icon:(0,j.jsx)(u,{className:`h-3.5 w-3.5`}),cls:`text-muted-foreground`,badge:`border-border bg-muted text-muted-foreground`}}}function I(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 L(e){let t=Date.now()-new Date(e).getTime(),n=Math.floor(t/1e3);if(n<10)return f.t(`common:time.justNow`);if(n<60)return f.t(`common:time.secondsAgo`,{count:n});let r=Math.floor(n/60);return r<60?f.t(`common:time.minutesAgo`,{count:r}):f.t(`common:time.hoursAgo`,{count:Math.floor(r/60)})}function R(){let e=t(e=>e.wsConnected),i=r(),{entries:a,loading:s,error:c}=n(o(e=>({entries:e.entries,loading:e.loading,error:e.error}))),{listSessions:l,resumeSession:u,deleteSession:d,renameSession:f}=x(),[p,m]=(0,A.useState)(``);return(0,A.useEffect)(()=>{e&&l(200)},[i,l,e]),(0,j.jsx)(k,{historyQuery:p,setHistoryQuery:m,historyEntries:a,historyLoading:s,historyError:c,wsConnected:e,listSessions:l,resumeSession:u,deleteSession:d,renameSession:f,variant:`workspace`})}function z(){let{t:e}=y();return(0,j.jsxs)(C,{defaultValue:`history`,className:`flex h-full min-h-0 flex-col bg-background`,"data-testid":`sessions-workspace`,children:[(0,j.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border/75 bg-card px-4 py-3 lg:flex-row lg:items-center lg:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`text-[10px] font-semibold uppercase tracking-[0.16em] text-primary`,children:e(`activity:sessions.workspaceEyebrow`,{defaultValue:`Conversation control`})}),(0,j.jsx)(`h1`,{className:`mt-0.5 text-lg font-semibold tracking-tight`,children:e(`activity:sessions.workspaceTitle`,{defaultValue:`Sessions`})})]}),(0,j.jsxs)(T,{className:`h-9 min-h-9 justify-start border-border/75 bg-background p-0 shadow-none`,children:[(0,j.jsxs)(w,{value:`history`,className:`h-9 gap-1.5 border-r border-border/75 px-3 text-xs shadow-none data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:ring-0`,children:[(0,j.jsx)(s,{className:`h-3.5 w-3.5`}),e(`activity:sessions.tabs.history`,{defaultValue:`History`})]}),(0,j.jsxs)(w,{value:`live`,className:`h-9 gap-1.5 px-3 text-xs shadow-none data-[state=active]:bg-foreground data-[state=active]:text-background data-[state=active]:ring-0`,children:[(0,j.jsx)(i,{className:`h-3.5 w-3.5`}),e(`activity:sessions.tabs.live`,{defaultValue:`Live sessions`})]})]})]}),(0,j.jsx)(O,{value:`history`,className:`mt-0 min-h-0 flex-1 overflow-hidden ring-0`,children:(0,j.jsx)(R,{})}),(0,j.jsx)(O,{value:`live`,className:`mt-0 min-h-0 flex-1 overflow-hidden ring-0`,children:(0,j.jsx)(B,{})})]})}function B(){let{t:e}=y(),[t,n]=(0,A.useState)([]),[r,i]=(0,A.useState)(!0),[o,s]=(0,A.useState)(null),[d,f]=(0,A.useState)(1),g=D(`sessions`,!r&&!o&&t.length>0),_=(0,A.useCallback)(async()=>{try{let e=await fetch(`/api/sessions`);if(!e.ok){if(e.status===404){s(null),n([]);return}throw Error(`HTTP ${e.status}: ${await N(e)}`)}if(!(e.headers.get(`content-type`)?.toLowerCase()??``).includes(`application/json`)){s(null),n([]);return}let t=await e.json();if(!Array.isArray(t)){s(null),n([]);return}n(e=>{let n=t;if(e.length===n.length){let t=!0;for(let r=0;r<n.length;r++){let i=n[r],a=e[r];if(i.sessionId!==a.sessionId||i.status!==a.status||i.agentCount!==a.agentCount||i.startedAt!==a.startedAt){t=!1;break}}if(t)return e}return n}),s(null)}catch(e){if(e instanceof SyntaxError){s(null),n([]);return}s(e instanceof Error?e.message:String(e))}finally{i(!1)}},[]);(0,A.useEffect)(()=>{_();let e=setInterval(_,5e3);return()=>clearInterval(e)},[_]);let v=t.filter(e=>e.status===`active`).length,b=t.reduce((e,t)=>e+t.agentCount,0),x=t.slice((d-1)*M,d*M);return(0,A.useEffect)(()=>{let e=Math.max(1,Math.ceil(t.length/M));d>e&&f(e)},[d,t.length]),r?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface flex items-center gap-2 px-4 py-3 text-sm text-muted-foreground`,children:[(0,j.jsx)(l,{className:`h-4 w-4 animate-spin text-primary`}),e(`activity:liveSessions.loading`)]})}):o?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface max-w-lg p-5 text-center`,children:[(0,j.jsx)(h,{className:`mx-auto h-8 w-8 text-warning`}),(0,j.jsx)(`p`,{className:`mt-3 text-sm font-medium`,children:e(`activity:liveSessions.apiUnavailable`)}),(0,j.jsx)(`p`,{className:`mt-1 break-words text-xs text-muted-foreground`,children:o})]})}):t.length===0?(0,j.jsx)(`div`,{className:`flex h-full min-h-0 items-center justify-center bg-[hsl(var(--surface-2)/0.45)] p-4`,children:(0,j.jsxs)(`div`,{className:`ws-surface max-w-md p-6 text-center text-muted-foreground`,children:[(0,j.jsx)(u,{className:`mx-auto h-9 w-9 opacity-50`}),(0,j.jsx)(`p`,{className:`mt-3 text-sm font-medium text-foreground`,children:e(`activity:liveSessions.empty`)}),(0,j.jsx)(`p`,{className:`mt-1 text-xs`,children:e(`activity:liveSessions.autoRefresh`)})]})}):(0,j.jsx)(`div`,{ref:g,className:`h-full min-h-0 overflow-y-auto overscroll-contain bg-[hsl(var(--surface-2)/0.45)] p-4 sm:p-6`,children:(0,j.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4`,children:[(0,j.jsx)(`header`,{className:`border border-border/70 bg-card/75 p-4`,children:(0,j.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(m,{className:`h-4 w-4 text-primary`}),(0,j.jsx)(`h2`,{className:`text-base font-semibold`,children:e(`activity:liveSessions.heading`,{count:t.length})})]}),(0,j.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:e(`activity:liveSessions.autoRefresh`)})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-3 gap-2 text-center sm:min-w-[22rem]`,children:[(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:t.length}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.sessions`)})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums text-success`,children:v}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.active`)})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/60 px-3 py-2`,children:[(0,j.jsx)(`div`,{className:`text-lg font-semibold tabular-nums`,children:b}),(0,j.jsx)(`div`,{className:`text-[10px] uppercase text-muted-foreground`,children:e(`activity:sessionsDash.agents`)})]})]})]})}),(0,j.jsx)(`div`,{className:`grid gap-3`,children:x.map(t=>{let n=F(t.status);return(0,j.jsxs)(`article`,{className:`border border-border/70 bg-card/75 p-3 sm:p-4`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,j.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,j.jsx)(`span`,{className:n.cls,children:n.icon}),(0,j.jsx)(`h3`,{className:`min-w-0 truncate text-sm font-semibold`,title:t.projectName,children:t.projectName}),(0,j.jsx)(`span`,{className:`bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,children:t.projectSlug}),(0,j.jsx)(`span`,{className:`inline-flex items-center border px-1.5 py-0.5 text-[10px] font-semibold uppercase ${n.badge}`,children:t.status})]}),(0,j.jsxs)(`div`,{className:`mt-2 grid gap-1.5 text-xs text-muted-foreground md:grid-cols-[minmax(0,1fr)_auto]`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,j.jsx)(p,{className:`h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`min-w-0 truncate font-mono`,title:t.workingDir,children:t.workingDir})]}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[t.gitBranch?(0,j.jsxs)(`span`,{className:`inline-flex min-w-0 max-w-full items-center gap-1 text-primary`,children:[(0,j.jsx)(c,{className:`h-3.5 w-3.5 shrink-0`}),(0,j.jsx)(`span`,{className:`truncate font-mono`,children:t.gitBranch})]}):null,(0,j.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,j.jsx)(a,{className:`h-3.5 w-3.5`}),I(t.startedAt)]}),(0,j.jsx)(`span`,{className:`font-mono`,children:e(`activity:liveSessions.pidLabel`,{pid:t.pid})})]})]})]}),(0,j.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-xs sm:grid-cols-3 lg:w-64`,children:[(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.agents`)}),(0,j.jsx)(`div`,{className:`font-semibold tabular-nums`,children:t.agentCount})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.status`)}),(0,j.jsx)(`div`,{className:`truncate font-mono font-semibold`,children:t.status})]}),(0,j.jsxs)(`div`,{className:`border border-border/70 bg-background/50 px-2 py-1.5`,children:[(0,j.jsx)(`div`,{className:`text-[10px] text-muted-foreground`,children:e(`activity:sessionsDash.runtime`)}),(0,j.jsx)(`div`,{className:`font-mono font-semibold`,children:I(t.startedAt)})]})]})]}),(0,j.jsxs)(`div`,{className:`mt-3 overflow-hidden border border-border/70 bg-background/45`,children:[t.agents.length===0?(0,j.jsx)(`div`,{className:`px-3 py-3 text-xs text-muted-foreground`,children:e(`activity:liveSessions.noAgents`)}):(0,j.jsx)(`div`,{className:`divide-y divide-border/60`,children:t.agents.slice(0,5).map(t=>{let n=P(t.status);return(0,j.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1 px-3 py-2 text-xs sm:grid-cols-[auto_minmax(0,1fr)_minmax(0,14rem)_auto]`,children:[(0,j.jsx)(`span`,{className:S(`mt-0.5 shrink-0`,n.cls),children:n.icon}),(0,j.jsxs)(`div`,{className:`min-w-0`,children:[(0,j.jsx)(`div`,{className:`truncate font-medium`,title:t.name,children:t.name}),(0,j.jsx)(`div`,{className:`font-mono text-[10px] text-muted-foreground`,children:e(`activity:liveSessions.agentMeta`,{iter:t.iterations,tools:t.toolCalls,ago:L(t.lastActivityAt)})})]}),(0,j.jsx)(`div`,{className:`min-w-0 font-mono text-[10px] text-muted-foreground sm:text-xs`,children:t.currentTool?(0,j.jsx)(`span`,{className:`block truncate`,title:t.currentTool,children:t.currentTool}):(0,j.jsx)(`span`,{className:`text-muted-foreground/75`,children:t.status})}),(0,j.jsx)(`span`,{className:`hidden font-mono text-[10px] text-muted-foreground sm:block`,children:L(t.lastActivityAt)})]},t.id)})}),t.agents.length>5?(0,j.jsx)(`div`,{className:`border-t border-border/60 px-3 py-2 text-xs text-muted-foreground`,children:e(`activity:liveSessions.andMore`,{count:t.agents.length-5})}):null]})]},t.sessionId)})}),(0,j.jsx)(E,{page:d,pageSize:M,totalItems:t.length,onPageChange:f,itemLabel:`sessions`})]})})}export{z as SessionsDashboard};
@@ -0,0 +1 @@
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,K as n,t as r,x as i}from"./ws-client-DtTZLD8e.js";import{Dn as a,Dr as o,Hr as s,Kt as c,La as l,Lr as u,Ni as d,Xa as f,Yt as p,bi as m,da as h,fa as g,fr as _,io as v,nn as y,oo as b,pa as x,t as S,to as C,ut as w,wa as T,xn as ee}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{t as te}from"./useWebSocket-9lfOsI_r.js";import{t as E}from"./utils-DQ9Exx8j.js";import"./stores-C7Vvce-6.js";import{o as D}from"./view-navigation-wOKaM_Rf.js";import{a as O,n as ne,o as re,r as k,t as A}from"./dialog-BTHxOi5z.js";import{t as j}from"./button-DNyYztcH.js";import{t as M}from"./input-CTGeYzNe.js";import{D as ie,a as N,b as P,c as F,o as I,s as L,x as R}from"./index-BQ7PJ-sA.js";var z=e(b(),1);function B(e,t=8e3){return new Promise((n,r)=>{let i=setTimeout(()=>{a(),r(Error(`timeout`))},t),a=e.on(`key.operation_result`,e=>{clearTimeout(i),a(),n(e.payload)})})}var V=w();function ae({onKeySaved:e}){let{t:i}=C(),[o,s]=(0,z.useState)(!1),[c,l]=(0,z.useState)(``),[u,d]=(0,z.useState)(`openai-compatible`),[f,p]=(0,z.useState)(``),[m,g]=(0,z.useState)(``),[v,y]=(0,z.useState)(!1),[b,x]=(0,z.useState)([]),{setFieldRef:S,handleKeyDown:w}=F(),T=async()=>{if(c.trim()){y(!0);try{let a=r(t.getState().wsUrl),o=B(a);a.send({type:`provider.add`,payload:{id:c.trim(),family:u,baseUrl:f.trim()||void 0,apiKey:m.trim()||void 0,models:b.length>0?b.map(e=>e.id):void 0,customModels:b.length>0?Object.fromEntries(b.filter(e=>e.name||e.maxOutput||e.capabilities).map(e=>[e.id,{...e.name&&e.name!==e.id?{name:e.name}:{},...e.maxOutput?{maxOutput:e.maxOutput}:{},...e.capabilities&&Object.values(e.capabilities).some(Boolean)?{capabilities:e.capabilities}:{}}])):void 0}});let d=await o;if(!d.success)throw Error(d.message);n.success(i(`setup:screen.toasts.providerAdded`,{id:c.trim()})),e(c.trim()),a.listSavedProviders(),a.probeProvider(c.trim()),l(``),p(``),g(``),x([]),s(!1)}catch(e){let t=e instanceof Error&&e.message&&e.message!==`timeout`?e.message:null;n.error(t??i(`setup:screen.toasts.providerAddFailed`))}finally{y(!1)}}};return(0,V.jsxs)(`div`,{className:`rounded-xl border border-dashed border-border/60 overflow-hidden`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>s(!o),className:`w-full flex items-center gap-3 p-4 text-left hover:bg-muted/30 transition-colors`,children:[(0,V.jsx)(`div`,{className:`w-10 h-10 rounded-lg bg-muted/50 flex items-center justify-center`,children:(0,V.jsx)(a,{className:`h-5 w-5 text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`flex-1`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-medium`,children:i(`setup:screen.custom.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i(`setup:screen.custom.description`)})]}),(0,V.jsx)(h,{className:E(`h-4 w-4 text-muted-foreground transition-transform`,o&&`rotate-90`)})]}),o&&(0,V.jsxs)(`div`,{className:`px-4 pb-4 space-y-3 border-t border-border/40`,children:[(0,V.jsxs)(`div`,{className:`space-y-1.5 pt-3`,children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground block`,children:i(`setup:screen.custom.localServers`)}),(0,V.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:N.map(e=>(0,V.jsx)(j,{type:`button`,size:`sm`,variant:c===e.id?`default`:`outline`,onClick:()=>{l(e.id),d(`openai-compatible`),p(e.defaultBaseUrl),e.noAuth&&g(``),x([])},title:e.hint,children:e.label},e.id))})]}),(0,V.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:i(`setup:screen.custom.providerId`)}),(0,V.jsx)(M,{placeholder:i(`activity:customProviderSection.eGMyLlm`),value:c,onChange:e=>l(e.target.value),className:`text-sm`,ref:S(0),onKeyDown:e=>w(e,0)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:i(`setup:screen.custom.family`)}),(0,V.jsxs)(`select`,{value:u,onChange:e=>d(e.target.value),className:`flex h-9 w-full rounded-md border border-input bg-transparent px-3 text-sm`,ref:S(1),onKeyDown:e=>w(e,1),children:[(0,V.jsx)(`option`,{value:`openai-compatible`,children:i(`setup:screen.custom.familyOpenAiCompatible`)}),(0,V.jsx)(`option`,{value:`openai`,children:`OpenAI`}),(0,V.jsx)(`option`,{value:`anthropic`,children:`Anthropic`}),(0,V.jsx)(`option`,{value:`google`,children:`Google`})]})]})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:i(`setup:screen.custom.baseUrl`)}),(0,V.jsx)(M,{placeholder:i(`activity:customProviderSection.eGHttpLocalhost11434V1`),value:f,onChange:e=>p(e.target.value),className:`text-sm font-mono`,ref:S(2),onKeyDown:e=>w(e,2)})]}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`span`,{className:`text-[11px] font-medium text-muted-foreground mb-1 block`,children:i(`setup:screen.custom.apiKey`)}),(0,V.jsx)(M,{type:`password`,placeholder:i(`setup:screen.custom.apiKeyPlaceholder`),value:m,onChange:e=>g(e.target.value),className:`text-sm font-mono`,ref:S(3),onKeyDown:e=>w(e,3)})]}),(0,V.jsx)(L,{models:b,onChange:x}),(0,V.jsxs)(j,{onClick:T,disabled:!c.trim()||v,size:`sm`,ref:S(4),onKeyDown:e=>w(e,4,T),children:[v?(0,V.jsx)(_,{className:`h-4 w-4 animate-spin mr-2`}):null,i(`setup:screen.custom.add`)]})]})]})}var H=I();async function oe(e,t){try{let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`HTTP ${n.status}`);let r=await n.json();if(!Array.isArray(r))throw Error(`Expected JSON array`);let i=r.filter(e=>typeof e.id==`string`&&typeof e.name==`string`&&typeof e.family==`string`);return i.length>0?i:H}catch{return H}}function se(e,t){let n=new Date().getTime()-e.getTime(),r=Math.floor(n/1e3);if(r<10)return t(`setup:screen.time.justNow`);if(r<60)return t(`setup:screen.time.secondsAgo`,{count:r});let i=Math.floor(r/60);if(i<60)return t(`setup:screen.time.minutesAgo`,{count:i});let a=Math.floor(i/60);return a<24?t(`setup:screen.time.hoursAgo`,{count:a}):t(`setup:screen.time.daysAgo`,{count:Math.floor(a/24)})}var ce=e(S(),1);function le({popular:e,catalogProvider:i,savedProvider:a,onKeySaved:o,probeResult:c}){let{t:l}=C(),[u,f]=(0,z.useState)(``),[p,v]=(0,z.useState)(!1),[b,S]=(0,z.useState)(!!a?.apiKeys.some(e=>e.isActive)),[w,T]=(0,z.useState)(!1),[ee,te]=(0,z.useState)(!1),[D,ie]=(0,z.useState)(!1),[N,P]=(0,z.useState)(null);(0,z.useEffect)(()=>{D&&e.referral&&ce.toDataURL(e.referral.url,{width:200,margin:2,color:{dark:`#000000`,light:`#ffffff`}}).then(e=>P(e)).catch(()=>P(null))},[D,e.referral]);let F=async()=>{if(u.trim()){v(!0);try{let a=r(t.getState().wsUrl),s=B(a);i?a.addKey(e.id,`default`,u.trim()):a.send({type:`provider.add`,payload:{id:e.id,family:e.family,apiKey:u.trim()}});let c=await s;if(!c.success)throw Error(c.message);S(!0),f(``),n.success(l(`setup:screen.toasts.keySaved`,{name:e.name})),o(e.id),a.listSavedProviders(),a.probeProvider(e.id)}catch(t){let r=t instanceof Error&&t.message&&t.message!==`timeout`?t.message:null;n.error(r??l(`setup:screen.toasts.keySaveFailed`,{name:e.name}))}finally{v(!1)}}},I=e=>{e.key===`Enter`&&u.trim()&&F()},L=async()=>{if(e.referral)try{await navigator.clipboard.writeText(e.referral.url),te(!0),n.success(l(`setup:screen.toasts.referralCopied`)),setTimeout(()=>te(!1),2e3)}catch{n.error(l(`setup:screen.toasts.referralCopyFailed`))}},R=i&&i.modelCount>0;return(0,V.jsxs)(`div`,{className:E(`rounded-xl border p-4 transition-all`,b?`border-success/30 bg-success/5`:`bg-gradient-to-br ${e.color}`),children:[(0,V.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,V.jsx)(`span`,{className:`text-2xl shrink-0 mt-0.5`,children:e.icon}),(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:e.name}),b&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-success/10 text-success border border-success/20`,children:[(0,V.jsx)(x,{className:`h-2.5 w-2.5`}),l(`setup:screen.card.keySaved`)]}),e.referral&&!b&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full bg-warning/10 text-warning border border-warning/20`,children:[(0,V.jsx)(s,{className:`h-2.5 w-2.5`}),l(`setup:screen.card.referral`)]})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e.description}),e.referral&&!b&&(0,V.jsxs)(`p`,{className:`text-[11px] text-warning/80 mt-1`,children:[`🎁 `,e.referral.reward]}),b?b?(0,V.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[a?.baseUrl&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70 font-mono truncate`,title:a.baseUrl,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[l(`activity:providerKey.url`),` `]}),a.baseUrl]}),a?.models&&a.models.length>0&&(0,V.jsxs)(`div`,{className:`text-[11px] text-muted-foreground/70`,children:[(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[l(`activity:providerKey.models`),` `]}),a.pickedModelId??a.models[0],(0,V.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[` `,`(+`,a.models.length-1,` more)`]})]}),c===`probing`?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground mt-1`,children:[(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}),l(`setup:screen.probe.checking`,`Checking connection…`)]}):c?.ok?(0,V.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-success mt-1`,children:[(0,V.jsx)(x,{className:`h-3 w-3`}),(0,V.jsxs)(`span`,{children:[l(`setup:screen.probe.connected`,`Connected`),c.modelCount!=null&&` · ${c.modelCount} ${l(`setup:screen.probe.models`,`models`)}`,c.elapsedMs!=null&&` · ${c.elapsedMs}ms`]})]}):c&&!c.ok?(0,V.jsxs)(`div`,{className:`flex items-start gap-1.5 text-[11px] text-destructive mt-1`,children:[(0,V.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:`✕`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium`,children:l(`setup:screen.probe.failed`,`Probe failed`)}),c.status===`no_base_url`&&(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:l(`setup:screen.probe.noBaseUrl`,`No base URL configured`)}),c.status===`unreachable`&&(0,V.jsxs)(`span`,{className:`block text-destructive/70`,children:[l(`setup:screen.probe.unreachable`,`Could not connect`),c.detail?`: ${c.detail}`:``]}),c.status!==`no_base_url`&&c.status!==`unreachable`&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`block text-destructive/70`,children:c.httpStatus==null?c.status:`${l(`setup:screen.probe.httpStatus`,`Status`)} ${c.httpStatus}`}),c.detail&&(0,V.jsx)(`span`,{className:`block text-destructive/70 truncate max-w-[250px]`,title:c.detail,children:c.detail})]})]})]}):null,R&&(0,V.jsxs)(`button`,{type:`button`,onClick:()=>T(!w),className:`text-[11px] text-muted-foreground hover:text-foreground transition-colors flex items-center gap-1`,children:[l(`setup:screen.providers.modelsAvailable`,{count:i?.modelCount??0}),w?(0,V.jsx)(g,{className:`h-3 w-3`}):(0,V.jsx)(h,{className:`h-3 w-3`})]})]}):null:(0,V.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex gap-2`,children:[(0,V.jsx)(M,{type:`password`,placeholder:e.keyPlaceholder,value:u,onChange:e=>f(e.target.value),onKeyDown:I,className:`font-mono text-sm`}),(0,V.jsx)(j,{onClick:F,disabled:!u.trim()||p,size:`sm`,className:`shrink-0`,children:p?(0,V.jsx)(_,{className:`h-4 w-4 animate-spin`}):l(`setup:screen.card.save`)})]}),e.docsUrl&&(0,V.jsxs)(`a`,{href:e.docsUrl,target:`_blank`,rel:`noopener noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors`,children:[l(`setup:screen.card.getKey`),` `,(0,V.jsx)(m,{className:`h-3 w-3`})]}),e.referral&&(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(`button`,{type:`button`,onClick:L,className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:ee?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(x,{className:`h-3 w-3`}),` `,l(`setup:screen.card.copied`)]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(d,{className:`h-3 w-3`}),` `,l(`setup:screen.card.copyReferral`)]})}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>ie(!0),className:`inline-flex items-center gap-1 text-[11px] text-warning/80 hover:text-warning transition-colors`,children:[(0,V.jsx)(y,{className:`h-3 w-3`}),` `,l(`setup:screen.card.share`)]})]})]})]})]}),(0,V.jsx)(A,{open:D,onOpenChange:ie,children:(0,V.jsxs)(ne,{className:`sm:max-w-md`,children:[(0,V.jsxs)(O,{children:[(0,V.jsxs)(re,{className:`flex items-center gap-2`,children:[(0,V.jsx)(s,{className:`h-4 w-4 text-warning`}),l(`setup:screen.share.title`,{name:e.name})]}),(0,V.jsx)(k,{children:l(`setup:screen.share.description`)})]}),(0,V.jsx)(`div`,{className:`flex flex-col items-center gap-4 py-4`,children:e.referral&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`text-sm text-center`,children:(0,V.jsxs)(`p`,{className:`font-medium text-warning`,children:[`🎁 `,e.referral.reward]})}),N?(0,V.jsx)(`div`,{className:`rounded-lg border border-border p-2 bg-white`,children:(0,V.jsx)(`img`,{src:N,alt:l(`setup:screen.card.qrAlt`,{name:e.name}),className:`w-[200px] h-[200px]`})}):(0,V.jsx)(`div`,{className:`w-[200px] h-[200px] rounded-lg border border-border flex items-center justify-center bg-muted`,children:(0,V.jsx)(_,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),(0,V.jsxs)(`div`,{className:`w-full space-y-2`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-center gap-2`,children:[(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://twitter.com/intent/tweet?text=${t}&url=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.twitter`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z`})}),`X`]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`Check out ${e.name}! ${e.referral.reward}`);window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${t}&summary=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.linkedin`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`})}),l(`activity:providerKey.linkedin`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward} ${e.referral.url}`);window.open(`https://t.me/share/url?url=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.telegram`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z`})}),l(`activity:providerKey.telegram`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://wa.me/?text=${t}%20${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.whatsapp`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.134 1.585 5.934L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z`})}),l(`activity:providerKey.whatsapp`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(e.referral.url),n=encodeURIComponent(`${e.name} - ${e.referral.reward}`);window.open(`https://www.reddit.com/submit?url=${t}&title=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.reddit`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 0 1.108-.701 1.25 1.25 0 0 1 2.144.33zm-8.811 8.748c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754zm7.944 0c-.968 0-1.754.786-1.754 1.754 0 .968.786 1.754 1.754 1.754.968 0 1.754-.786 1.754-1.754 0-.968-.786-1.754-1.754-1.754z`})}),l(`activity:providerKey.reddit`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`https://www.facebook.com/sharer/sharer.php?u=${n}&quote=${t}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card text-xs text-foreground hover:bg-muted transition-colors`,title:l(`setup:screen.share.facebook`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`currentColor`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{d:`M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z`})}),l(`activity:providerKey.facebook`)]}),(0,V.jsxs)(`button`,{type:`button`,onClick:()=>{let t=encodeURIComponent(`Check out ${e.name}! 🎁 ${e.referral.reward}`),n=encodeURIComponent(e.referral.url);window.open(`mailto:?subject=${t}&body=${n}`,`_blank`,`noopener,noreferrer`)},className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-muted text-muted-foreground text-xs hover:bg-muted/80 transition-colors`,title:l(`setup:screen.share.email`),children:[(0,V.jsx)(`svg`,{role:`img`,"aria-hidden":`true`,className:`h-3.5 w-3.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,viewBox:`0 0 24 24`,children:(0,V.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25H4.5a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75`})}),l(`activity:providerKey.email`)]})]}),(0,V.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,V.jsx)(M,{value:e.referral.url,readOnly:!0,className:`font-mono text-xs flex-1`}),(0,V.jsx)(j,{size:`sm`,variant:`outline`,onClick:L,className:`shrink-0`,children:ee?(0,V.jsx)(x,{className:`h-4 w-4`}):(0,V.jsx)(d,{className:`h-4 w-4`})})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground text-center`,children:l(`setup:screen.share.hint`)})]})]})})]})})]})}function U(){let{t:e}=C(),{model:a,setProvider:s,setModel:d,wsConnected:m,wsUrl:g}=t(f(e=>({model:e.model,setProvider:e.setProvider,setModel:e.setModel,wsConnected:e.wsConnected,wsUrl:e.wsUrl})));te();let[y,b]=(0,z.useState)([]),[S,w]=(0,z.useState)({}),[O,ne]=(0,z.useState)([]),[re,k]=(0,z.useState)(!1),[A,M]=(0,z.useState)(null),[N,F]=(0,z.useState)(0),[I,L]=(0,z.useState)(new Set),[B,ce]=(0,z.useState)({}),[U,ue]=(0,z.useState)(H),[W,G]=(0,z.useState)(!1),[de,fe]=(0,z.useState)(0),[pe,me]=(0,z.useState)(0),[K,he]=(0,z.useState)(null),q=(0,z.useRef)(!0);(0,z.useEffect)(()=>{let e=new AbortController,t=`${window.location.origin}/providers.json`;return G(!0),oe(t,e.signal).then(t=>{if(t!==H){if(ue(t),G(!1),!q.current){let e=t.length-pe;e>0?n.success(v.t(`setup:screen.toasts.providersLoadedNew`,{count:t.length,diff:e})):e<0?n.success(v.t(`setup:screen.toasts.providersLoadedRemoved`,{count:t.length,diff:Math.abs(e)})):n.success(v.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:t.length})),me(t.length)}he(new Date);return}return oe(`https://raw.githubusercontent.com/WrongStack/WrongStack/main/packages/webui/public/providers.json`,e.signal)}).then(e=>{if(e){if(ue(e),!q.current){let t=e.length-pe;t>0?n.success(v.t(`setup:screen.toasts.providersLoadedNew`,{count:e.length,diff:t})):t<0?n.success(v.t(`setup:screen.toasts.providersLoadedRemoved`,{count:e.length,diff:Math.abs(t)})):n.success(v.t(`setup:screen.toasts.providersLoadedNoChanges`,{count:e.length})),me(e.length)}he(new Date)}}).catch(()=>{q.current||n.error(v.t(`setup:screen.toasts.providersRefreshFailed`))}).finally(()=>{G(!1),q.current=!1}),()=>e.abort()},[de]);let[J,ge]=(0,z.useState)(null),[Y,X]=(0,z.useState)(null),[_e,ve]=(0,z.useState)(!1);(0,z.useEffect)(()=>{if(!m)return;let e=r(g),t=setTimeout(()=>{t=null,k(!1),M(v.t(`setup:screen.errors.backendNotResponding`))},8e3),n=()=>{t&&=(clearTimeout(t),null)},i=e.on(`provider.catalog`,e=>{if(e.type===`provider.catalog`){n(),M(null);let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));b(t),k(!1)}}),o=e.on(`provider.models`,e=>{if(e.type===`provider.models`){let t=e.payload;if(t.provider!==J)return;w(e=>({...e,[t.provider]:t.models})),ve(!1),t.models.length===1?X(t.models[0].id):a&&t.models.some(e=>e.id===a)&&X(a)}}),s=e.on(`providers.saved`,e=>{if(e.type===`providers.saved`){let t=e.payload.providers.sort((e,t)=>e.id.localeCompare(t.id));ne(t);let n=new Set(t.filter(e=>e.apiKeys.some(e=>e.isActive)).map(e=>e.id));L(n)}}),c=e.on(`provider.probe`,e=>{if(e.type!==`provider.probe`)return;let t=e.payload;ce(e=>({...e,[t.providerId]:t}))});return M(null),k(!0),e.listProviders(),()=>{n(),i?.(),o?.(),s?.(),c?.()}},[m,g,a,N,J]);let ye=(0,z.useCallback)(()=>{M(null),F(e=>e+1)},[]),be=(0,z.useCallback)(()=>{fe(e=>e+1)},[]),xe=(0,z.useCallback)(t=>se(t,e),[e]),Z=(0,z.useCallback)(e=>{L(t=>new Set([...t,e])),ge(e),X(null)},[]),Se=I.size>0;(0,z.useEffect)(()=>{if(!J||!m)return;let e=r(g);S[J]||(ve(!0),e.listProviderModels(J))},[J,m,g,S]);let Ce=J?S[J]??[]:[],we=(0,z.useCallback)(async()=>{if(!J||!Y)return;if(!I.has(J)){n.error(`Please save the provider configuration before starting a session.`);return}s(J),d(Y);let e=await r(g).switchModel(J,Y,5e3);e.success?(i.getState().openPicker({startsSession:!0}),D(`chat`)):n.error(e.message||v.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,s,d,g]),Te=(0,z.useCallback)(async()=>{if(!J||!Y)return;s(J),d(Y);let e=await r(g).switchModel(J,Y,5e3);e.success?D(`chat`):n.error(e.message||v.t(`setup:screen.errors.modelSwitchTimeout`))},[J,Y,s,d,g]),Ee=new Set(U.map(e=>e.id)),De=y.filter(e=>!Ee.has(e.id)).sort((e,t)=>e.id.localeCompare(t.id)),Q=R(De,10);R(O,9);let $=R(Ce,12,J);return(0,V.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,V.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b bg-card px-4 py-4 sm:flex-row sm:items-center sm:justify-between sm:px-6`,children:[(0,V.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,V.jsx)(`img`,{src:`/wrongstack.svg`,alt:`WrongStack`,draggable:!1,className:`ws-brand-logo h-10 w-10 shrink-0 border border-border/70 shadow-sm`}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h1`,{className:`truncate text-lg font-semibold`,children:e(`setup:screen.header.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground sm:truncate`,children:e(`setup:screen.header.subtitle`)})]})]}),Se&&J?(0,V.jsxs)(`span`,{className:`text-xs text-success/80`,children:[(0,V.jsx)(x,{className:`h-3 w-3 inline-block mr-1`}),e(`setup:screen.header.continue`)]}):null]}),(0,V.jsx)(ie,{className:`min-h-0 flex-1`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-3xl space-y-8 p-4 pb-4 sm:p-6`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm`,children:[(0,V.jsxs)(`div`,{className:E(`flex min-w-0 items-center gap-1.5`,Se?`text-success`:`text-primary font-medium`),children:[(0,V.jsx)(o,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.addKeys`)})]}),(0,V.jsx)(h,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:E(`flex min-w-0 items-center gap-1.5`,J?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(T,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.pickModel`)})]}),(0,V.jsx)(h,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,V.jsxs)(`div`,{className:E(`flex min-w-0 items-center gap-1.5`,J&&Y?`text-primary font-medium`:`text-muted-foreground`),children:[(0,V.jsx)(c,{className:`h-4 w-4`}),(0,V.jsx)(`span`,{children:e(`setup:screen.steps.start`)})]})]}),(0,V.jsxs)(`div`,{className:`flex items-start gap-3 rounded-xl border border-primary/20 bg-primary/5 p-4`,children:[(0,V.jsx)(p,{className:`h-5 w-5 text-primary shrink-0 mt-0.5`}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium`,children:e(`setup:screen.security.title`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-0.5`,children:e(`setup:screen.security.body`)})]})]}),A?(0,V.jsxs)(`div`,{className:`flex flex-col items-center text-center gap-4 py-12 rounded-xl border border-destructive/30 bg-destructive/5 px-6`,children:[(0,V.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-destructive/10 border border-destructive/30 flex items-center justify-center`,children:(0,V.jsx)(u,{className:`h-6 w-6 text-destructive`})}),(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`p`,{className:`text-sm font-medium text-destructive`,children:e(`setup:screen.errors.backendUnreachable`)}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 max-w-sm`,children:A})]}),(0,V.jsxs)(j,{onClick:ye,size:`sm`,variant:`outline`,children:[(0,V.jsx)(_,{className:`h-4 w-4 mr-2`}),e(`setup:screen.errors.retry`)]})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.popular`)}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[W&&(0,V.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground`,children:[(0,V.jsx)(_,{className:`h-3 w-3 animate-spin`}),e(`setup:screen.providers.updating`)]}),K&&!W&&(0,V.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,title:K.toLocaleString(),children:xe(K)}),(0,V.jsxs)(`button`,{type:`button`,onClick:be,disabled:W,className:`inline-flex items-center gap-1 text-[11px] text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,title:e(`setup:screen.providers.refreshTitle`),children:[(0,V.jsx)(ee,{className:E(`h-3 w-3`,W&&`animate-spin`)}),e(`setup:screen.providers.refresh`)]})]})]}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:U.map(e=>(0,V.jsx)(le,{popular:e,catalogProvider:y.find(t=>t.id===e.id),savedProvider:O.find(t=>t.id===e.id),onKeySaved:Z,probeResult:B[e.id]},e.id))})]}),De.length>0&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.more`)}),(0,V.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:Q.pageItems.map(t=>(0,V.jsx)(le,{popular:{id:t.id,name:t.name,description:e(`setup:screen.providers.catalogDescription`,{family:t.family,count:t.modelCount}),icon:`🔗`,color:`from-muted/60 to-muted/20 border-border hover:border-primary/40`,keyPlaceholder:`API key`,family:t.family},catalogProvider:t,savedProvider:O.find(e=>e.id===t.id),onKeySaved:Z,probeResult:B[t.id]},t.id))}),(0,V.jsx)(P,{page:Q.page,pageSize:Q.pageSize,totalItems:Q.totalItems,onPageChange:Q.setPage,itemLabel:`providers`})]}),(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsx)(`h2`,{className:`text-sm font-medium text-muted-foreground uppercase tracking-wider`,children:e(`setup:screen.providers.selfHosted`)}),(0,V.jsx)(ae,{onKeySaved:Z})]})]}),re&&(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(_,{className:`h-6 w-6 animate-spin text-muted-foreground`})}),J&&(0,V.jsxs)(`div`,{className:`space-y-3`,children:[(0,V.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,V.jsxs)(`h2`,{className:`text-base font-semibold flex items-center gap-2`,children:[(0,V.jsx)(c,{className:`h-4 w-4 text-primary`}),e(`setup:screen.start.chooseModel`)]}),(0,V.jsx)(`button`,{type:`button`,onClick:()=>{ge(null),X(null)},className:`text-xs text-muted-foreground hover:text-foreground transition-colors`,children:e(`setup:screen.start.addMoreKeys`)})]}),(0,V.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`setup:screen.start.modelsFor`,{provider:J})}),_e?(0,V.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,V.jsx)(_,{className:`h-6 w-6 animate-spin text-muted-foreground`})}):Ce.length>0?(0,V.jsx)(`div`,{className:`grid grid-cols-1 gap-2`,children:$.pageItems.map(e=>{let t=e.contextWindow?`${(e.contextWindow/1e6).toFixed(0)}M ctx`:null;return(0,V.jsx)(`button`,{type:`button`,onClick:()=>X(e.id),className:E(`w-full text-left rounded-xl border p-3 transition-all`,`hover:border-primary/40 hover:bg-primary/5`,Y===e.id?`border-primary bg-primary/10 ring-1 ring-primary/30`:`border-border bg-card`),children:(0,V.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,V.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,V.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mt-1`,children:[t&&(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:t}),e.capabilities.slice(0,3).map(e=>(0,V.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-primary/10 text-primary border border-primary/20`,children:e},e))]})]}),Y===e.id&&(0,V.jsx)(`div`,{className:`flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary`,children:(0,V.jsx)(x,{className:`h-3 w-3 text-primary-foreground`})})]})},e.id)})}):(0,V.jsx)(`p`,{className:`text-sm text-muted-foreground py-8 text-center`,children:e(`setup:screen.errors.noModels`)}),(0,V.jsx)(P,{page:$.page,pageSize:$.pageSize,totalItems:$.totalItems,onPageChange:$.setPage,itemLabel:`models`})]}),J&&Y&&(0,V.jsxs)(`div`,{className:`sticky bottom-0 -mx-4 border-t bg-background/80 px-4 py-4 backdrop-blur-sm sm:-mx-6 sm:px-6`,children:[(0,V.jsx)(`div`,{className:`mb-3 flex min-w-0 items-center justify-between gap-2 text-sm text-muted-foreground`,children:(0,V.jsxs)(`span`,{className:`min-w-0 truncate`,children:[J,` / `,Y]})}),(0,V.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-2`,children:[(0,V.jsxs)(j,{onClick:we,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(T,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.startSession`),(0,V.jsx)(l,{className:`h-4 w-4 ml-2`})]}),(0,V.jsxs)(j,{onClick:Te,variant:`outline`,className:`flex-1`,size:`lg`,children:[(0,V.jsx)(x,{className:`h-4 w-4 mr-2`}),e(`setup:screen.start.saveConfig`)]})]}),(0,V.jsx)(`p`,{className:`text-[11px] text-muted-foreground/60 text-center mt-2`,children:e(`setup:screen.start.saveConfigHint`)})]})]})})]})}export{U as SetupScreen};
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/vendor-enc0q-Va.js","assets/rolldown-runtime-hePW80VL.js","assets/monaco-BCqJp2xW.js","assets/monaco-Bowa0-zp.css","assets/markdown-Kp5uSgOw.js","assets/vendor-BMdWcCR4.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$r as t,Ea as n,Ei as r,Fn as ee,Kt as te,Lr as ne,Mt as i,Ni as re,Pa as a,da as o,fr as s,ft as ie,ii as ae,io as c,jn as oe,oo as l,pa as se,to as u,ua as ce,ut as d,xn as le}from"./vendor-enc0q-Va.js";import"./i18n-Cv65b1SP.js";import{s as f}from"./monaco-BCqJp2xW.js";import{t as ue}from"./useWebSocket-VIItbvVK.js";import{t as p}from"./utils-DQ9Exx8j.js";import{n as m}from"./ui-store-DpKUBLWd.js";import{o as de}from"./view-navigation-DPOY0lyt.js";import{a as fe,n as pe,o as me,t as he}from"./dialog-BTHxOi5z.js";import{p as ge}from"./markdown-Kp5uSgOw.js";import{d as _e,m as ve,v as ye}from"./index-DbprKWmG.js";import{t as be}from"./empty-state-DBQN80mK.js";var h=e(l(),1),g=d(),xe=(0,h.lazy)(()=>f(()=>import(`./vendor-enc0q-Va.js`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5])));function _(e){return e===`project`||e===`user`}function Se(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function Ce({source:e}){let{t}=u(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,g.jsx)(`span`,{className:p(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function v({className:e}){let{t:l}=u(),{client:d}=ue(),f=m(e=>e.skillsState),v=m(e=>e.setSkillsState),y=f.selectedSkill,b=f.navHistory,x=f.historyIndex,[S,C]=(0,h.useState)(null),[we,w]=(0,h.useState)(!1),[T,E]=(0,h.useState)(null),Te=_e(`skill-detail`,!!S),[D,O]=(0,h.useState)(!1),[k,A]=(0,h.useState)(``),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)(null),[F,I]=(0,h.useState)(!1),[L,R]=(0,h.useState)(null),[z,B]=(0,h.useState)(!1),V=(0,h.useRef)(``),[Ee,De]=(0,h.useState)(!1),[H,U]=(0,h.useState)(null),[Oe,ke]=(0,h.useState)(!1),[W,G]=(0,h.useState)(null),[K,Ae]=(0,h.useState)(!1),[je,Me]=(0,h.useState)([]),q=(0,h.useRef)(f);q.current=f;let J=(0,h.useRef)(!1),Y=(0,h.useMemo)(()=>k?{lines:k.split(`
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$r as t,Ea as n,Ei as r,Fn as ee,Kt as te,Lr as ne,Mt as i,Ni as re,Pa as a,da as o,fr as s,ft as ie,ii as ae,io as c,jn as oe,oo as l,pa as se,to as u,ua as ce,ut as d,xn as le}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{s as f}from"./monaco-BCqJp2xW.js";import{t as ue}from"./useWebSocket-9lfOsI_r.js";import{t as p}from"./utils-DQ9Exx8j.js";import{n as m}from"./ui-store-Dm7ujR9u.js";import{o as de}from"./view-navigation-wOKaM_Rf.js";import{a as fe,n as pe,o as me,t as he}from"./dialog-BTHxOi5z.js";import{p as ge}from"./markdown-Kp5uSgOw.js";import{d as _e,m as ve,v as ye}from"./index-BQ7PJ-sA.js";import{t as be}from"./empty-state-DBQN80mK.js";var h=e(l(),1),g=d(),xe=(0,h.lazy)(()=>f(()=>import(`./vendor-enc0q-Va.js`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5])));function _(e){return e===`project`||e===`user`}function Se(e){let t=e.match(/^(.+?)\/SKILL(?:\.save)?\.md$/);return t?t[1]:null}function Ce({source:e}){let{t}=u(),n=e===`project`?`project`:e===`user`?`user`:`bundled`;return(0,g.jsx)(`span`,{className:p(`inline-flex items-center rounded-md border px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide`,n===`project`&&`border-success/25 bg-success/8 text-success`,n===`user`&&`border-primary/25 bg-primary/10 text-primary`,n===`bundled`&&`border-border/70 bg-muted/60 text-muted-foreground`),children:t(`activity:skillDetail.${{project:`scopeProject`,user:`scopeGlobal`,bundled:`scopeBundled`}[n]}`)})}function v({className:e}){let{t:l}=u(),{client:d}=ue(),f=m(e=>e.skillsState),v=m(e=>e.setSkillsState),y=f.selectedSkill,b=f.navHistory,x=f.historyIndex,[S,C]=(0,h.useState)(null),[we,w]=(0,h.useState)(!1),[T,E]=(0,h.useState)(null),Te=_e(`skill-detail`,!!S),[D,O]=(0,h.useState)(!1),[k,A]=(0,h.useState)(``),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)(null),[F,I]=(0,h.useState)(!1),[L,R]=(0,h.useState)(null),[z,B]=(0,h.useState)(!1),V=(0,h.useRef)(``),[Ee,De]=(0,h.useState)(!1),[H,U]=(0,h.useState)(null),[Oe,ke]=(0,h.useState)(!1),[W,G]=(0,h.useState)(null),[K,Ae]=(0,h.useState)(!1),[je,Me]=(0,h.useState)([]),q=(0,h.useRef)(f);q.current=f;let J=(0,h.useRef)(!1),Y=(0,h.useMemo)(()=>k?{lines:k.split(`
3
3
  `).length,words:k.trim()?k.trim().split(/\s+/).length:0,chars:k.length}:{lines:0,words:0,chars:0},[k]),X=(0,h.useMemo)(()=>{if(!k)return null;let e=5242880,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,h.useEffect)(()=>{if(!L)return;let e=setTimeout(()=>R(null),2e3);return()=>clearTimeout(e)},[L]),(0,h.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,h.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,h.useEffect)(()=>{if(!d||!y)return;w(!0),C(null),E(null);let e=setTimeout(()=>{w(!1),E(c.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;De(!1);let n=q.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}),U({updated:t.payload.updated??[],unchanged:t.payload.unchanged??[],errors:t.payload.errors??[]}),d.send({type:`skills.list`},{echoToChat:!1})}else U({updated:[],unchanged:[],errors:[{name:``,error:t.payload.error??c.t(`activity:skillDetail.updateFailed`)}]})},r=e=>{let t=e;t.payload.skills&&Me(t.payload.skills)};return d.on(`skills.content`,t),d.on(`skills.updated`,n),d.on(`skills.list`,r),d.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),()=>{clearTimeout(e),d.off(`skills.content`,t),d.off(`skills.updated`,n),d.off(`skills.list`,r)}},[d,y?.name,y?.source]),(0,h.useEffect)(()=>{D&&(O(!1),A(``),P(null))},[y?.name]);let Z=(0,h.useCallback)(e=>je.find(t=>t.name.toLowerCase()===e.toLowerCase()),[je]),Q=(0,h.useCallback)(e=>{let t=Z(e);if(t){J.current=!1;let e=b.slice(0,x+1);e.push(t),v({...q.current,selectedSkill:t,navHistory:e,historyIndex:e.length-1}),O(!1),A(``),U(null)}},[Z,b,x,v]),Ne=(0,h.useCallback)(()=>{if(x<=0)return;J.current=!0;let e=x-1,t=b[e];v({...q.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),U(null)},[x,b,v]),Pe=(0,h.useCallback)(()=>{if(x>=b.length-1)return;J.current=!0;let e=x+1,t=b[e];v({...q.current,selectedSkill:t,historyIndex:e}),O(!1),A(``),U(null)},[x,b,v]),$=(0,h.useCallback)(()=>{de(`chat`)},[]),Fe=(0,h.useCallback)(()=>{S&&(A(S.body),V.current=S.body,B(!1),P(null),O(!0),I(!1))},[S]),Ie=(0,h.useCallback)(()=>{O(!1),A(``),P(null),I(!1),B(!1),y&&localStorage.removeItem(`skills_draft_${y.name}`)},[y]),Le=(0,h.useCallback)(()=>{!y||!S||(B(!1),A(S.body),V.current=S.body,y&&localStorage.removeItem(`skills_draft_${y.name}`))},[y,S]),Re=(0,h.useCallback)(()=>{if(!d||!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),d.send({type:`skills.content`,payload:{name:y.name,source:y.source}}),d.send({type:`skills.list`},{echoToChat:!1})):P(n.payload.error??c.t(`activity:skillDetail.saveFailed`)),d.off(`skills.edited`,e)};d.on(`skills.edited`,e),d.editSkill(y.name,k)},[d,y,k]),ze=(0,h.useCallback)(()=>{!d||!y||(De(!0),U(null),d.checkForUpdates(y.name,y.source===`user`))},[d,y]),Be=(0,h.useCallback)(()=>{y?.sourceUrl&&navigator.clipboard.writeText(y.sourceUrl).then(()=>{ke(!0),setTimeout(()=>ke(!1),2e3)})},[y]),Ve=(0,h.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]),He=(0,h.useCallback)(async e=>{if(!d||!e)return;Ae(!0);let t=e=>{let n=e;Ae(!1),n.payload.success?(G(null),d.send({type:`skills.list`},{echoToChat:!1}),$()):P(n.payload.error??c.t(`activity:skillDetail.uninstallFailed`)),d.off(`skills.uninstalled`,t)};d.on(`skills.uninstalled`,t),d.uninstallSkill(e.name,e.source===`user`)},[d,$]);return y?(0,g.jsxs)(`div`,{className:p(`flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden bg-[hsl(var(--surface-2)/0.45)] p-3`,e),children:[(0,g.jsxs)(`div`,{className:`shrink-0 rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,g.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between`,children:[(0,g.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,g.jsx)(`span`,{className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:(0,g.jsx)(te,{className:`h-4 w-4`})}),(0,g.jsx)(`h1`,{className:`min-w-0 truncate text-base font-semibold`,children:y.name}),y.version&&(0,g.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`v`,y.version]}),(0,g.jsx)(Ce,{source:y.source})]}),(0,g.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1 line-clamp-2`,children:y.description||y.trigger}),y.sourceUrl&&(0,g.jsxs)(`div`,{className:`mt-2 flex min-w-0 items-center gap-1`,children:[(0,g.jsxs)(`a`,{href:`https://${y.sourceUrl.replace(`github:`,``)}`,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-w-0 items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground`,title:l(`activity:skillDetail.openSourceRepo`),children:[(0,g.jsx)(ne,{className:`h-3 w-3 shrink-0`}),(0,g.jsx)(`span`,{className:`truncate font-mono`,children:y.sourceUrl})]}),(0,g.jsx)(`button`,{type:`button`,onClick:Be,className:`flex shrink-0 items-center text-muted-foreground transition-colors hover:text-foreground`,title:l(`activity:skillDetail.copySourceUrl`),children:Oe?(0,g.jsx)(se,{className:`h-3 w-3 text-success`}):(0,g.jsx)(re,{className:`h-3 w-3`})})]}),y.scope.length>0&&(0,g.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:y.scope.map(e=>(0,g.jsx)(`span`,{className:`px-1.5 py-0.5 text-[10px] rounded bg-muted text-muted-foreground`,children:e},e))}),H&&(0,g.jsxs)(`div`,{className:`mt-2 text-xs space-y-1`,children:[H.updated.length>0&&(0,g.jsx)(`div`,{className:`text-success`,children:l(`activity:skillDetail.updatedLabel`,{list:H.updated.map(e=>`${e.name} (${e.oldRef} → ${e.newRef})`).join(`, `)})}),H.unchanged.length>0&&(0,g.jsx)(`div`,{className:`text-muted-foreground`,children:l(`activity:skillDetail.upToDateLabel`,{list:H.unchanged.join(`, `)})}),H.errors.length>0&&(0,g.jsx)(`div`,{className:`text-destructive`,children:l(`activity:skillDetail.errorsLabel`,{list:H.errors.map(e=>`${e.name?`${e.name}: `:``}${e.error}`).join(`; `)})})]})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1 lg:ml-auto lg:shrink-0 lg:justify-end`,children:[_(y.source)&&y.sourceUrl&&(0,g.jsx)(`button`,{type:`button`,onClick:ze,disabled:Ee,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-50`,title:l(`activity:skillDetail.checkUpdatesTitle`),children:Ee?(0,g.jsx)(s,{className:`h-3.5 w-3.5 animate-spin`}):(0,g.jsx)(le,{className:`h-3.5 w-3.5`})}),y.source!==`bundled`&&!D&&(0,g.jsx)(`button`,{type:`button`,onClick:Ve,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:l(`activity:skillDetail.exportTitle`),children:(0,g.jsx)(r,{className:`h-3.5 w-3.5`})}),_(y.source)&&!D&&(0,g.jsx)(`button`,{type:`button`,onClick:Fe,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,title:l(`activity:skillDetail.editTitle`),children:(0,g.jsx)(oe,{className:`h-3.5 w-3.5`})}),_(y.source)&&(0,g.jsx)(`button`,{type:`button`,onClick:()=>G(y),className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive`,title:l(`activity:skillDetail.uninstallTitle`),children:(0,g.jsx)(i,{className:`h-3.5 w-3.5`})}),(0,g.jsx)(`button`,{type:`button`,onClick:$,className:`flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground hover:bg-accent hover:text-foreground`,title:l(`activity:skillDetail.closeTitle`),children:(0,g.jsx)(ie,{className:`h-4 w-4`})})]})]}),b.length>1&&(0,g.jsxs)(`div`,{className:`mt-3 flex min-w-0 items-center gap-1 rounded-lg border border-border/60 bg-muted/35 px-2 py-1`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:Ne,disabled:x<=0,className:p(`rounded p-1 transition-colors`,x<=0?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:l(`activity:skillDetail.backTitle`),children:(0,g.jsx)(ce,{className:`h-4 w-4`})}),(0,g.jsx)(`button`,{type:`button`,onClick:Pe,disabled:x>=b.length-1,className:p(`rounded p-1 transition-colors`,x>=b.length-1?`text-muted-foreground/65 cursor-not-allowed`:`hover:bg-accent text-muted-foreground cursor-pointer`),title:l(`activity:skillDetail.forwardTitle`),children:(0,g.jsx)(o,{className:`h-4 w-4`})}),(0,g.jsx)(`div`,{className:`flex items-center gap-0.5 overflow-x-auto text-xs`,children:b.map((e,t)=>(0,g.jsxs)(`span`,{className:`flex items-center shrink-0`,children:[t>0&&(0,g.jsx)(o,{className:`h-3 w-3 text-muted-foreground/65 mx-0.5 shrink-0`}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>{t<x&&(J.current=!0,v({...q.current,selectedSkill:e,historyIndex:t}),O(!1),A(``),U(null))},className:p(`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,g.jsxs)(`div`,{className:`shrink-0 space-y-2 rounded-xl border border-border/70 bg-card/70 px-4 py-3 shadow-sm`,children:[S.relatedFiles.length>0&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,g.jsx)(t,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:l(`activity:skillDetail.relatedFiles`)})]}),S.relatedFiles.map(e=>{let t=Se(e);return t&&Z(t)?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>Q(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] transition-colors hover:border-primary/40 hover:text-primary`,title:l(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,g.jsx)(a,{className:`h-2.5 w-2.5`}),e]},e):(0,g.jsx)(`span`,{className:`rounded-md border border-border/70 bg-background/60 px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:e},e)})]}),S.references.length>0&&(0,g.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,g.jsx)(ae,{className:`h-3 w-3`}),(0,g.jsx)(`span`,{className:`font-medium uppercase tracking-wide`,children:l(`activity:skillDetail.references`)})]}),S.references.map(e=>{let t=Se(e)??e.replace(/\.md$/,``);return Z(t)?(0,g.jsxs)(`button`,{type:`button`,onClick:()=>Q(t),className:`inline-flex min-w-0 items-center gap-1 rounded-md border border-primary/20 bg-primary/5 px-1.5 py-0.5 text-[10px] text-primary transition-colors hover:border-primary/30 hover:bg-primary/10`,title:l(`activity:skillDetail.goToSkillTitle`,{name:t}),children:[(0,g.jsx)(a,{className:`h-2.5 w-2.5`}),t]},e):(0,g.jsx)(`span`,{className:`rounded-md bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground`,children:t},e)})]})]}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-hidden rounded-xl border border-border/70 bg-card/70 shadow-sm`,children:we?(0,g.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center text-muted-foreground`,children:[(0,g.jsx)(s,{className:`mx-auto mb-2 h-6 w-6 animate-spin text-primary`}),(0,g.jsx)(`p`,{children:l(`activity:skillDetail.loadingContent`)})]}):D?(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col`,children:[(0,g.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border/70 bg-muted/30 px-4 py-2 sm:flex-row sm:items-center sm:justify-between`,children:[(0,g.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:l(`activity:skillDetail.editingLabel`,{name:y.name})}),(0,g.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:l(`activity:skillDetail.editStats`,{lines:Y.lines,words:Y.words,chars:Y.chars})}),X&&(0,g.jsx)(`span`,{className:`text-xs tabular-nums ${X.level===`critical`?`font-medium text-destructive`:`text-warning`}`,children:l(`activity:skillDetail.charsWarningFmt`,{used:(X.used/1048576).toFixed(1),limit:(X.limit/1048576).toFixed(0)})}),L&&(0,g.jsx)(`span`,{className:`text-xs text-success animate-pulse`,children:l(`activity:skillDetail.draftSaved`)}),z&&(0,g.jsx)(`span`,{className:`animate-pulse text-xs text-warning`,children:l(`activity:skillDetail.draftRestored`)})]}),(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[N&&(0,g.jsx)(`span`,{className:`text-xs text-destructive`,children:N}),z&&(0,g.jsx)(`button`,{type:`button`,onClick:Le,className:`rounded-md border border-warning/35 px-2 py-1 text-[10px] text-warning transition-colors hover:bg-warning/10`,children:l(`activity:skillDetail.discardDraft`)}),(0,g.jsx)(`button`,{type:`button`,onClick:Ie,className:`rounded-md border border-border/70 px-2 py-1 text-xs transition-colors hover:bg-accent`,children:l(`common:action.cancel`)}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>I(e=>!e),title:l(F?`activity:skillDetail.hidePreviewTitle`:`activity:skillDetail.splitViewTitle`),className:`rounded-md border px-2 py-1 text-xs transition-colors ${F?`border-primary/40 bg-primary/10 text-primary`:`border-border/70 text-muted-foreground hover:bg-accent`}`,children:(0,g.jsx)(ee,{className:`h-3 w-3 inline`})}),(0,g.jsx)(`button`,{type:`button`,onClick:Re,disabled:j||!k.trim(),className:`rounded-md bg-primary px-3 py-1 text-xs text-primary-foreground shadow-sm shadow-primary/15 transition-colors hover:bg-primary/90 disabled:opacity-50`,children:j?(0,g.jsx)(s,{className:`h-3 w-3 animate-spin inline`}):l(`common:action.save`)})]})]}),F?(0,g.jsxs)(`div`,{className:`flex flex-1 min-h-0 gap-0.5`,children:[(0,g.jsx)(`div`,{className:`flex-1 min-w-0 flex flex-col min-h-0`,children:(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(xe,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:l(`activity:skillDetail.contentPlaceholder`)})})}),(0,g.jsx)(`div`,{className:`w-px bg-border flex-shrink-0`}),(0,g.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain bg-background/45 p-4 prose prose-sm dark:prose-invert max-w-none`,children:(0,g.jsx)(ve,{rehypePlugins:[ge],components:ye,children:k})})]}):(0,g.jsx)(h.Suspense,{fallback:null,children:(0,g.jsx)(xe,{value:k,onChange:e=>A(e.target.value??``),language:`markdown`,className:`flex-1`,style:{fontSize:12,backgroundColor:`transparent`,minHeight:0},placeholder:l(`activity:skillDetail.contentPlaceholder`)})})]}):S?(0,g.jsx)(`div`,{ref:Te,className:`h-full min-h-0 overflow-y-auto overscroll-contain p-5 sm:p-6 prose prose-sm dark:prose-invert max-w-none`,children:(0,g.jsx)(ve,{rehypePlugins:[ge],components:ye,children:S.body})}):T?(0,g.jsxs)(`div`,{className:`flex h-full min-h-[16rem] flex-col items-center justify-center p-8 text-center`,children:[(0,g.jsx)(`p`,{className:`text-destructive mb-2`,children:l(`activity:skillDetail.loadFailed`)}),(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:T}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>{d&&y&&(w(!0),E(null),d.send({type:`skills.content`,payload:{name:y.name,source:y.source}}))},className:`mt-4 rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent`,children:l(`common:action.retry`)})]}):(0,g.jsx)(`div`,{className:`flex h-full min-h-[16rem] items-center justify-center p-8 text-center text-muted-foreground`,children:l(`activity:skillDetail.noContent`)})}),(0,g.jsx)(he,{open:!!W,onOpenChange:e=>{e||G(null)},children:(0,g.jsxs)(pe,{className:`flex max-h-[calc(100dvh-2rem)] w-[380px] max-w-[90vw] flex-col gap-0 overflow-hidden p-0`,showCloseButton:!1,children:[(0,g.jsxs)(fe,{className:`flex shrink-0 items-center justify-between border-b border-border/70 p-4 sm:flex-row sm:justify-between sm:space-y-0`,children:[(0,g.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,g.jsx)(i,{className:`h-4 w-4 text-destructive`}),(0,g.jsx)(me,{className:`font-semibold text-sm`,children:l(`activity:skillDetail.uninstallSkillHeading`)})]}),(0,g.jsx)(`button`,{type:`button`,onClick:()=>G(null),"aria-label":l(`common:action.close`),className:`rounded p-1 text-muted-foreground hover:bg-accent hover:text-accent-foreground`,children:(0,g.jsx)(ie,{className:`h-4 w-4`})})]}),(0,g.jsxs)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto overscroll-contain p-4`,children:[(0,g.jsx)(`p`,{className:`text-sm`,children:W&&l(`activity:skillDetail.uninstallConfirm`,{name:W.name})}),(0,g.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:W&&l(`activity:skillDetail.uninstallRemovePath`,{path:W.path})})]}),(0,g.jsxs)(`div`,{className:`flex shrink-0 justify-end gap-2 border-t border-border/70 bg-muted/20 p-4`,children:[(0,g.jsx)(`button`,{type:`button`,onClick:()=>G(null),disabled:K,className:`rounded-md border border-border/70 px-3 py-1.5 text-xs transition-colors hover:bg-accent disabled:opacity-50`,children:l(`common:action.cancel`)}),(0,g.jsxs)(`button`,{type:`button`,onClick:()=>W&&He(W),disabled:K,className:`flex items-center gap-1.5 rounded-md bg-destructive px-3 py-1.5 text-xs text-destructive-foreground transition-colors hover:bg-destructive/90 disabled:cursor-not-allowed disabled:opacity-50`,children:[K&&(0,g.jsx)(s,{className:`h-3 w-3 animate-spin`}),l(`activity:skillDetail.uninstallAction`)]})]})]})})]}):(0,g.jsx)(be,{icon:(0,g.jsx)(n,{className:`h-6 w-6`}),title:l(`activity:skillDetail.noSkillSelected`),description:l(`activity:skillDetail.selectSkillHint`),action:{label:l(`activity:skillDetail.goToChat`),onClick:$},className:e})}export{v as SkillDetailView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Ji as t,On as n,Sr as r,Ui as i,Wn as a,Yi as o,da as s,fa as c,fr as l,ft as u,gn as d,ia as f,ii as p,ja as m,oo as h,to as g,ur as _,ut as v}from"./vendor-enc0q-Va.js";import"./i18n-Cv65b1SP.js";import{t as y}from"./useWebSocket-VIItbvVK.js";import{t as b}from"./utils-DQ9Exx8j.js";import{r as x}from"./stores-CNuMLG8X.js";import{r as S}from"./view-navigation-DPOY0lyt.js";import{t as C}from"./button-DNyYztcH.js";var w=e(h(),1),T=v(),E={completed:{icon:(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),text:`text-success`,ring:`border-success/35`},in_progress:{icon:(0,T.jsx)(l,{className:`h-3.5 w-3.5 animate-spin`}),text:`text-primary`,ring:`border-primary/45`},queued:{icon:(0,T.jsx)(i,{className:`h-3.5 w-3.5`}),text:`text-warning`,ring:`border-warning/35`},blocked:{icon:(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),text:`text-destructive`,ring:`border-destructive/30`},pending:{icon:(0,T.jsx)(t,{className:`h-3.5 w-3.5`}),text:`text-muted-foreground`,ring:`border-border/70`},review:{icon:(0,T.jsx)(d,{className:`h-3.5 w-3.5`}),text:`text-primary`,ring:`border-primary/35`},failed:{icon:(0,T.jsx)(o,{className:`h-3.5 w-3.5`}),text:`text-destructive`,ring:`border-destructive/45`},cancelled:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),text:`text-muted-foreground`,ring:`border-border/70`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{labelKey:`activity:depGraph.prioCrit`,cls:`bg-destructive/10 text-destructive`},high:{labelKey:`activity:depGraph.prioHigh`,cls:`bg-destructive/10 text-destructive`},medium:{labelKey:`activity:depGraph.prioMed`,cls:`bg-warning/12 text-warning`},low:{labelKey:`activity:depGraph.prioLow`,cls:`bg-success/12 text-success`}};function k({columns:e,onTaskClick:t}){let{t:n}=g();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,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:b(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-muted-foreground`,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-border/60 pb-1 text-center text-xs font-medium uppercase text-muted-foreground`,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-muted-foreground/75`,children:(0,T.jsx)(s,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=g();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:b(`w-full rounded-lg border bg-background/55 p-2.5 text-left shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/35`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-foreground`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:b(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:i(r.labelKey)})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-foreground`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:b(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(l,{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,onRunStarted:t}){let{client:i}=y(),{t:o}=g(),l=x(e=>e.specs),d=x(e=>e.detail),f=x(e=>e.expandedSpecId),m=x(e=>e.setExpanded),[h,_]=(0,w.useState)(`graph`),v=(0,w.useCallback)(e=>{!d||d.specId!==e.id||(i?.send?.({type:`goal.start`,payload:{title:e.title,phases:j(d),autonomous:!0}}),S(`goal`))},[d,i]),E=(0,w.useCallback)(e=>{let n=e.graphId??(d?.specId===e.id?d.graphId:void 0);n?i?.send?.({type:`sdd.run.from_graph`,payload:{graphId:n,worktrees:!0}}):i?.send?.({type:`sdd.run.from_spec`,payload:{specId:e.id,worktrees:!0}}),t?.(),S(`sddhub`)},[d,i,t]);(0,w.useEffect)(()=>{i?.send?.({type:`specs.list`})},[i]);let D=(0,w.useCallback)(e=>{f===e.id?m(null):(m(e.id),i?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[f,m,i]),O=d?.columns.flatMap(e=>e.tasks)??[],A={done:O.filter(e=>e.status===`completed`).length,running:O.filter(e=>e.status===`in_progress`).length,pending:O.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)(p,{className:`h-5 w-5 text-warning`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:o(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(C,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(u,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:l.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:o(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:l.map(e=>{let t=f===e.id,i=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:()=>D(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)(c,{className:`h-4 w-4`}):(0,T.jsx)(s,{className:`h-4 w-4`})}),(0,T.jsx)(p,{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-success transition-all`,style:{width:`${i}%`}})}),(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:[o(`activity:specs.tasks`,{count:d?.total??e.total}),d&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-success`,children:o(`activity:specs.doneCount`,{count:A.done})}),` `,(0,T.jsx)(`span`,{className:`text-primary`,children:o(`activity:specs.runningCount`,{count:A.running})}),` `,(0,T.jsx)(`span`,{children:o(`activity:specs.pendingCount`,{count:A.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>E(e),title:o(`activity:specs.runAsSddTitle`),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success transition-colors hover:bg-success/25`,children:[(0,T.jsx)(n,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.runAsSdd`)]}),(0,T.jsxs)(`button`,{type:`button`,disabled:!d||d.specId!==e.id,onClick:()=>v(e),title:o(`activity:specs.runAsGoalTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning transition-colors hover:bg-warning/25 disabled:opacity-40`,children:[(0,T.jsx)(n,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.runAsGoal`)]}),(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:()=>_(`list`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,h===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>_(`graph`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,h===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.graph`)]})]})]})]}),!d||d.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:o(`activity:specs.loadingTasks`)}):h===`graph`?(0,T.jsx)(k,{columns:d.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:O.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-hePW80VL.js";import{Ji as t,On as n,Sr as r,Ui as i,Wn as a,Yi as o,da as s,fa as c,fr as l,ft as u,gn as d,ia as f,ii as p,ja as m,oo as h,to as g,ur as _,ut as v}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{t as y}from"./useWebSocket-9lfOsI_r.js";import{t as b}from"./utils-DQ9Exx8j.js";import{r as x}from"./stores-C7Vvce-6.js";import{r as S}from"./view-navigation-wOKaM_Rf.js";import{t as C}from"./button-DNyYztcH.js";var w=e(h(),1),T=v(),E={completed:{icon:(0,T.jsx)(f,{className:`h-3.5 w-3.5`}),text:`text-success`,ring:`border-success/35`},in_progress:{icon:(0,T.jsx)(l,{className:`h-3.5 w-3.5 animate-spin`}),text:`text-primary`,ring:`border-primary/45`},queued:{icon:(0,T.jsx)(i,{className:`h-3.5 w-3.5`}),text:`text-warning`,ring:`border-warning/35`},blocked:{icon:(0,T.jsx)(_,{className:`h-3.5 w-3.5`}),text:`text-destructive`,ring:`border-destructive/30`},pending:{icon:(0,T.jsx)(t,{className:`h-3.5 w-3.5`}),text:`text-muted-foreground`,ring:`border-border/70`},review:{icon:(0,T.jsx)(d,{className:`h-3.5 w-3.5`}),text:`text-primary`,ring:`border-primary/35`},failed:{icon:(0,T.jsx)(o,{className:`h-3.5 w-3.5`}),text:`text-destructive`,ring:`border-destructive/45`},cancelled:{icon:(0,T.jsx)(m,{className:`h-3.5 w-3.5`}),text:`text-muted-foreground`,ring:`border-border/70`}},D=[`completed`,`in_progress`,`queued`,`blocked`,`pending`,`failed`],O={critical:{labelKey:`activity:depGraph.prioCrit`,cls:`bg-destructive/10 text-destructive`},high:{labelKey:`activity:depGraph.prioHigh`,cls:`bg-destructive/10 text-destructive`},medium:{labelKey:`activity:depGraph.prioMed`,cls:`bg-warning/12 text-warning`},low:{labelKey:`activity:depGraph.prioLow`,cls:`bg-success/12 text-success`}};function k({columns:e,onTaskClick:t}){let{t:n}=g();return e.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:n(`activity:board.emptySpec`)}):(0,T.jsxs)(`div`,{className:`rounded-xl border border-border/70 bg-card/75 p-4 shadow-sm`,children:[(0,T.jsx)(`h3`,{className:`mb-3 text-sm font-semibold text-foreground`,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:b(`inline-flex items-center gap-1.5`,E[e].text),children:[E[e].icon,(0,T.jsx)(`span`,{className:`text-muted-foreground`,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-border/60 pb-1 text-center text-xs font-medium uppercase text-muted-foreground`,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-muted-foreground/75`,children:(0,T.jsx)(s,{className:`h-5 w-5`})})]},n.label))})]})}function A({task:e,onClick:t}){let n=E[e.displayStatus],r=O[e.priority],{t:i}=g();return(0,T.jsxs)(`button`,{type:`button`,onClick:()=>t?.(e.id),className:b(`w-full rounded-lg border bg-background/55 p-2.5 text-left shadow-sm transition-colors hover:border-primary/35 hover:bg-accent/35`,n.ring),children:[(0,T.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,T.jsxs)(`span`,{className:b(`inline-flex items-center gap-1.5 text-xs font-medium`,n.text),children:[n.icon,(0,T.jsx)(`span`,{className:`font-mono text-foreground`,children:e.shortId})]}),(0,T.jsx)(`span`,{className:b(`rounded px-1.5 py-0.5 text-[10px] font-medium`,r.cls),children:i(r.labelKey)})]}),(0,T.jsx)(`p`,{className:`mt-1.5 text-xs text-foreground`,children:e.title}),e.deps.length>0&&(0,T.jsxs)(`p`,{className:`mt-1 font-mono text-[10px] text-muted-foreground`,children:[`← `,e.deps.join(`, `)]}),e.agentName&&(0,T.jsxs)(`div`,{className:b(`mt-1.5 inline-flex items-center gap-1 rounded-full px-1.5 py-0.5 text-[10px]`,e.displayStatus===`in_progress`?`bg-primary/10 text-primary`:`bg-muted text-muted-foreground`),title:e.worktreeBranch?i(`activity:board.worktreePrefix`,{branch:e.worktreeBranch}):void 0,children:[e.displayStatus===`in_progress`&&(0,T.jsx)(l,{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,onRunStarted:t}){let{client:i}=y(),{t:o}=g(),l=x(e=>e.specs),d=x(e=>e.detail),f=x(e=>e.expandedSpecId),m=x(e=>e.setExpanded),[h,_]=(0,w.useState)(`graph`),v=(0,w.useCallback)(e=>{!d||d.specId!==e.id||(i?.send?.({type:`goal.start`,payload:{title:e.title,phases:j(d),autonomous:!0}}),S(`goal`))},[d,i]),E=(0,w.useCallback)(e=>{let n=e.graphId??(d?.specId===e.id?d.graphId:void 0);n?i?.send?.({type:`sdd.run.from_graph`,payload:{graphId:n,worktrees:!0}}):i?.send?.({type:`sdd.run.from_spec`,payload:{specId:e.id,worktrees:!0}}),t?.(),S(`sddhub`)},[d,i,t]);(0,w.useEffect)(()=>{i?.send?.({type:`specs.list`})},[i]);let D=(0,w.useCallback)(e=>{f===e.id?m(null):(m(e.id),i?.send?.({type:`specs.get`,payload:{specId:e.id}}))},[f,m,i]),O=d?.columns.flatMap(e=>e.tasks)??[],A={done:O.filter(e=>e.status===`completed`).length,running:O.filter(e=>e.status===`in_progress`).length,pending:O.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)(p,{className:`h-5 w-5 text-warning`}),(0,T.jsxs)(`div`,{children:[(0,T.jsx)(`h1`,{className:`text-lg font-semibold`,children:o(`activity:specs.heading`)}),(0,T.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:o(`activity:specs.subtitle`)})]})]}),(0,T.jsx)(C,{variant:`ghost`,size:`icon`,onClick:e,children:(0,T.jsx)(u,{className:`h-4 w-4`})})]}),(0,T.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto overscroll-contain p-4`,children:l.length===0?(0,T.jsx)(`div`,{className:`flex h-40 items-center justify-center text-sm text-muted-foreground`,children:o(`activity:specs.empty`,{command:`/sdd`})}):(0,T.jsx)(`div`,{className:`space-y-3`,children:l.map(e=>{let t=f===e.id,i=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:()=>D(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)(c,{className:`h-4 w-4`}):(0,T.jsx)(s,{className:`h-4 w-4`})}),(0,T.jsx)(p,{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-success transition-all`,style:{width:`${i}%`}})}),(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:[o(`activity:specs.tasks`,{count:d?.total??e.total}),d&&(0,T.jsxs)(`span`,{className:`ml-3 text-xs font-normal text-muted-foreground`,children:[(0,T.jsx)(`span`,{className:`text-success`,children:o(`activity:specs.doneCount`,{count:A.done})}),` `,(0,T.jsx)(`span`,{className:`text-primary`,children:o(`activity:specs.runningCount`,{count:A.running})}),` `,(0,T.jsx)(`span`,{children:o(`activity:specs.pendingCount`,{count:A.pending})})]})]}),(0,T.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,T.jsxs)(`button`,{type:`button`,onClick:()=>E(e),title:o(`activity:specs.runAsSddTitle`),className:`inline-flex items-center gap-1 rounded-md bg-success/15 px-2.5 py-1 text-xs font-medium text-success transition-colors hover:bg-success/25`,children:[(0,T.jsx)(n,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.runAsSdd`)]}),(0,T.jsxs)(`button`,{type:`button`,disabled:!d||d.specId!==e.id,onClick:()=>v(e),title:o(`activity:specs.runAsGoalTitle`),className:`inline-flex items-center gap-1 rounded-md bg-warning/15 px-2.5 py-1 text-xs font-medium text-warning transition-colors hover:bg-warning/25 disabled:opacity-40`,children:[(0,T.jsx)(n,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.runAsGoal`)]}),(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:()=>_(`list`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,h===`list`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(r,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.list`)]}),(0,T.jsxs)(`button`,{type:`button`,onClick:()=>_(`graph`),className:b(`inline-flex items-center gap-1 rounded px-2 py-1 text-xs`,h===`graph`?`bg-primary/15 text-primary`:`text-muted-foreground`),children:[(0,T.jsx)(a,{className:`h-3.5 w-3.5`}),` `,o(`activity:specs.graph`)]})]})]})]}),!d||d.specId!==e.id?(0,T.jsx)(`div`,{className:`flex h-24 items-center justify-center text-sm text-muted-foreground`,children:o(`activity:specs.loadingTasks`)}):h===`graph`?(0,T.jsx)(k,{columns:d.columns}):(0,T.jsx)(`div`,{className:`space-y-1.5`,children:O.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,2 +1,2 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$t as t,Ca as n,Ei as r,Ft as i,Ga as a,Hi as o,Jn as s,Kt as c,N as l,Pi as u,Sa as d,Ur as f,Vi as p,Vn as m,Yt as h,bi as g,dt as _,fr as v,ft as ee,hi as te,ii as ne,oo as y,qr as b,sn as x,to as S,ut as re,vn as C,xn as ie,za as w}from"./vendor-enc0q-Va.js";import"./i18n-Cv65b1SP.js";import{t as T}from"./utils-DQ9Exx8j.js";import{n as E}from"./stores-CNuMLG8X.js";import{t as D}from"./button-DNyYztcH.js";import{t as O}from"./input-CTGeYzNe.js";import{A as ae,M as k,N as oe,b as A,j as se,x as j}from"./index-DbprKWmG.js";var M=e(y(),1),N=re(),P={current:{labelKey:`activity:techStackStatus.current`,badge:`border-success/35 bg-success/10 text-success`,dot:`bg-success`,weight:0},update_available_safe:{labelKey:`activity:techStackStatus.update_available_safe`,badge:`border-info/35 bg-info/10 text-info`,dot:`bg-info`,weight:30},update_available_breaking:{labelKey:`activity:techStackStatus.update_available_breaking`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:50},vulnerable:{labelKey:`activity:techStackStatus.vulnerable`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:100},deprecated:{labelKey:`activity:techStackStatus.deprecated`,badge:`border-destructive/35 bg-destructive/10 text-destructive`,dot:`bg-destructive`,weight:70},yanked:{labelKey:`activity:techStackStatus.yanked`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:80},unmaintained_suspected:{labelKey:`activity:techStackStatus.unmaintained_suspected`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:60},blocked_by_constraints:{labelKey:`activity:techStackStatus.blocked_by_constraints`,badge:`border-warning/30 bg-warning/5 text-warning`,dot:`bg-warning`,weight:40},private_or_unresolved:{labelKey:`activity:techStackStatus.private_or_unresolved`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:10},local_path:{labelKey:`activity:techStackStatus.local_path`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},git_dependency:{labelKey:`activity:techStackStatus.git_dependency`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unsupported:{labelKey:`activity:techStackStatus.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unknown:{labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:20}},ce={labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function F(e){return P[e]??ce}var le={npm:{label:`npm / Node.js`,icon:m},python:{label:`Python`,icon:o},rust:{label:`Rust`,icon:h},go:{label:`Go`,icon:C},dotnet:{label:`.NET`,icon:s},php:{label:`PHP`,icon:i},dart:{label:`Dart / Flutter`,icon:u},maven:{label:`Maven`,icon:a},gradle:{label:`Gradle`,icon:n},ruby:{label:`Ruby`,icon:f},swift:{label:`Swift`,icon:_},elixir:{label:`Elixir`,icon:i},cpp:{label:`C / C++`,icon:p}},ue={labelKey:`activity:techStackStatus.unknown`};function I(e,t){let n=L(e);return n.labelKey?t(n.labelKey):n.label??e}function L(e){return le[e]??ue}function R({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=L(e);if(!n.icon)return null;let r=n.icon;return(0,N.jsx)(r,{className:t})}function de(e){return F(e.status).weight>=50}var fe=[`critical`,`high`,`medium`,`low`,`info`],z={critical:{labelKey:`activity:techStackSeverity.critical`,badge:`border-destructive/45 bg-destructive/15 text-destructive`},high:{labelKey:`activity:techStackSeverity.high`,badge:`border-destructive/35 bg-destructive/10 text-destructive`},medium:{labelKey:`activity:techStackSeverity.medium`,badge:`border-warning/35 bg-warning/10 text-warning`},low:{labelKey:`activity:techStackSeverity.low`,badge:`border-info/35 bg-info/10 text-info`},info:{labelKey:`activity:techStackSeverity.info`,badge:`border-border/70 bg-muted text-muted-foreground`}},B={none:`activity:techStackAction.none`,upgrade_patch:`activity:techStackAction.upgrade_patch`,upgrade_minor:`activity:techStackAction.upgrade_minor`,upgrade_major:`activity:techStackAction.upgrade_major`,replace:`activity:techStackAction.replace`,remove:`activity:techStackAction.remove`,investigate:`activity:techStackAction.investigate`},V={full:{labelKey:`activity:techStackCoverage.full`,badge:`border-success/35 bg-success/10 text-success`,noteKey:void 0},partial:{labelKey:`activity:techStackCoverage.partial`,badge:`border-warning/35 bg-warning/10 text-warning`,noteKey:`activity:techStackCoverage.partialNote`},unsupported:{labelKey:`activity:techStackCoverage.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,noteKey:`activity:techStackCoverage.unsupportedNote`}};function H(e){return V[e]??V.unsupported}function U(e){if(!e)return null;let t=/^\D*(\d+)/.exec(e);if(!t?.[1])return null;let n=Number(t[1]);return Number.isFinite(n)?n:null}function W(e){let t=U(e.locked??e.installed??e.requested),n=U(e.latestStable);if(t===null||n===null||n<=t)return{majorsBehind:0,label:null};let r=n-t;return{majorsBehind:r,label:`${r} major${r===1?``:`s`} behind`}}function G(e){return e.locked??e.installed??e.requested??null}function K(e){return e.confidence<1}function q({className:e,children:t}){return(0,N.jsx)(`span`,{className:T(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function J({label:e,value:t,hint:n,tone:r=`default`}){let i={default:`text-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,destructive:`text-destructive`}[r];return(0,N.jsxs)(`div`,{className:`border border-border/70 bg-card/55 px-3 py-2.5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.035)]`,children:[(0,N.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,N.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,N.jsx)(`p`,{className:T(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,N.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function Y(e,t){let n,r,i;if(t===`json`)n=JSON.stringify(e,null,2),r=`techstack.json`,i=`application/json`;else if(t===`spdx`){let t={spdxVersion:`SPDX-2.3`,dataLicense:`CC0-1.0`,SPDXID:`SPDXRef-DOCUMENT`,name:`TechStack-SBOM-${e.projectId}`,documentNamespace:`https://wrongstack.dev/spdx/${e.id}`,creationInfo:{created:e.createdAt,creators:[`Tool: WrongStack TechStack Engine`]},packages:e.dependencies.map((e,t)=>({name:e.name,SPDXID:`SPDXRef-Package-${t}`,versionInfo:e.locked??e.requested,downloadLocation:e.purl?`https://purl.io/${e.purl}`:`NOASSERTION`,licenseConcluded:e.license??`NOASSERTION`}))};n=JSON.stringify(t,null,2),r=`techstack-sbom-spdx.json`,i=`application/json`}else if(t===`cyclonedx`){let t={bomFormat:`CycloneDX`,specVersion:`1.5`,version:1,metadata:{timestamp:e.createdAt,tools:[{name:`WrongStack TechStack Engine`,version:e.adapterVersion}]},components:e.dependencies.map(e=>({type:`library`,name:e.name,version:e.locked??e.requested,...e.purl?{purl:e.purl}:{},...e.license?{licenses:[{license:{id:e.license}}]}:{}}))};n=JSON.stringify(t,null,2),r=`techstack-sbom-cyclonedx.json`,i=`application/json`}else{let t=[`# TechStack Report`,``,`**Generated:** ${e.createdAt}`,`**Target:** ${e.targetRoot}`,`**Fingerprint:** ${e.fingerprint}`,`**Workspaces:** ${e.workspaces.length}`,`**Dependencies:** ${e.dependencies.length}`,`**Findings:** ${e.findings.length}`,`**Coverage:** ${e.coverage}`,``];if(e.workspaces.length>0){t.push(`## Workspaces`,``,`| Workspace | Ecosystem | Coverage | Deps |`,`|---|---|---|---|`);for(let n of e.workspaces){let r=e.dependencies.filter(e=>e.workspaceId===n.id).length;t.push(`| ${n.relativeRoot} | ${n.ecosystem} | ${n.coverage} | ${r} |`)}t.push(``)}if(e.findings.length>0){t.push(`## Findings`,``);let n=new Map;for(let t of e.findings)n.set(t.severity,[...n.get(t.severity)??[],t]);for(let r of[`critical`,`high`,`medium`,`low`,`info`]){let i=n.get(r);if(i?.length){t.push(`### ${r.charAt(0).toUpperCase()+r.slice(1)} (${i.length})`,``);for(let n of i){let r=e.dependencies.find(e=>e.id===n.dependencyId);t.push(`- **${r?.name??n.dependencyId}** — ${n.type} — ${n.rationale}`)}t.push(``)}}}if(e.dependencies.length>0){t.push(`## Dependencies`,``,`| Name | Ecosystem | Status | Locked | Latest |`,`|---|---|---|---|---|`);for(let n of e.dependencies)t.push(`| ${n.name} | ${n.ecosystem} | ${n.status} | ${n.locked??`—`} | ${n.latestStable??`—`} |`)}n=t.join(`
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$t as t,Ca as n,Ei as r,Ft as i,Ga as a,Hi as o,Jn as s,Kt as c,N as l,Pi as u,Sa as d,Ur as f,Vi as p,Vn as m,Yt as h,bi as g,dt as _,fr as v,ft as ee,hi as te,ii as ne,oo as y,qr as b,sn as x,to as S,ut as re,vn as C,xn as ie,za as w}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{t as T}from"./utils-DQ9Exx8j.js";import{n as E}from"./stores-C7Vvce-6.js";import{t as D}from"./button-DNyYztcH.js";import{t as O}from"./input-CTGeYzNe.js";import{A as ae,M as k,N as oe,b as A,j as se,x as j}from"./index-BQ7PJ-sA.js";var M=e(y(),1),N=re(),P={current:{labelKey:`activity:techStackStatus.current`,badge:`border-success/35 bg-success/10 text-success`,dot:`bg-success`,weight:0},update_available_safe:{labelKey:`activity:techStackStatus.update_available_safe`,badge:`border-info/35 bg-info/10 text-info`,dot:`bg-info`,weight:30},update_available_breaking:{labelKey:`activity:techStackStatus.update_available_breaking`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:50},vulnerable:{labelKey:`activity:techStackStatus.vulnerable`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:100},deprecated:{labelKey:`activity:techStackStatus.deprecated`,badge:`border-destructive/35 bg-destructive/10 text-destructive`,dot:`bg-destructive`,weight:70},yanked:{labelKey:`activity:techStackStatus.yanked`,badge:`border-destructive/45 bg-destructive/15 text-destructive`,dot:`bg-destructive`,weight:80},unmaintained_suspected:{labelKey:`activity:techStackStatus.unmaintained_suspected`,badge:`border-warning/35 bg-warning/10 text-warning`,dot:`bg-warning`,weight:60},blocked_by_constraints:{labelKey:`activity:techStackStatus.blocked_by_constraints`,badge:`border-warning/30 bg-warning/5 text-warning`,dot:`bg-warning`,weight:40},private_or_unresolved:{labelKey:`activity:techStackStatus.private_or_unresolved`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:10},local_path:{labelKey:`activity:techStackStatus.local_path`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},git_dependency:{labelKey:`activity:techStackStatus.git_dependency`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unsupported:{labelKey:`activity:techStackStatus.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:5},unknown:{labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:20}},ce={labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function F(e){return P[e]??ce}var le={npm:{label:`npm / Node.js`,icon:m},python:{label:`Python`,icon:o},rust:{label:`Rust`,icon:h},go:{label:`Go`,icon:C},dotnet:{label:`.NET`,icon:s},php:{label:`PHP`,icon:i},dart:{label:`Dart / Flutter`,icon:u},maven:{label:`Maven`,icon:a},gradle:{label:`Gradle`,icon:n},ruby:{label:`Ruby`,icon:f},swift:{label:`Swift`,icon:_},elixir:{label:`Elixir`,icon:i},cpp:{label:`C / C++`,icon:p}},ue={labelKey:`activity:techStackStatus.unknown`};function I(e,t){let n=L(e);return n.labelKey?t(n.labelKey):n.label??e}function L(e){return le[e]??ue}function R({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=L(e);if(!n.icon)return null;let r=n.icon;return(0,N.jsx)(r,{className:t})}function de(e){return F(e.status).weight>=50}var fe=[`critical`,`high`,`medium`,`low`,`info`],z={critical:{labelKey:`activity:techStackSeverity.critical`,badge:`border-destructive/45 bg-destructive/15 text-destructive`},high:{labelKey:`activity:techStackSeverity.high`,badge:`border-destructive/35 bg-destructive/10 text-destructive`},medium:{labelKey:`activity:techStackSeverity.medium`,badge:`border-warning/35 bg-warning/10 text-warning`},low:{labelKey:`activity:techStackSeverity.low`,badge:`border-info/35 bg-info/10 text-info`},info:{labelKey:`activity:techStackSeverity.info`,badge:`border-border/70 bg-muted text-muted-foreground`}},B={none:`activity:techStackAction.none`,upgrade_patch:`activity:techStackAction.upgrade_patch`,upgrade_minor:`activity:techStackAction.upgrade_minor`,upgrade_major:`activity:techStackAction.upgrade_major`,replace:`activity:techStackAction.replace`,remove:`activity:techStackAction.remove`,investigate:`activity:techStackAction.investigate`},V={full:{labelKey:`activity:techStackCoverage.full`,badge:`border-success/35 bg-success/10 text-success`,noteKey:void 0},partial:{labelKey:`activity:techStackCoverage.partial`,badge:`border-warning/35 bg-warning/10 text-warning`,noteKey:`activity:techStackCoverage.partialNote`},unsupported:{labelKey:`activity:techStackCoverage.unsupported`,badge:`border-border/70 bg-muted text-muted-foreground`,noteKey:`activity:techStackCoverage.unsupportedNote`}};function H(e){return V[e]??V.unsupported}function U(e){if(!e)return null;let t=/^\D*(\d+)/.exec(e);if(!t?.[1])return null;let n=Number(t[1]);return Number.isFinite(n)?n:null}function W(e){let t=U(e.locked??e.installed??e.requested),n=U(e.latestStable);if(t===null||n===null||n<=t)return{majorsBehind:0,label:null};let r=n-t;return{majorsBehind:r,label:`${r} major${r===1?``:`s`} behind`}}function G(e){return e.locked??e.installed??e.requested??null}function K(e){return e.confidence<1}function q({className:e,children:t}){return(0,N.jsx)(`span`,{className:T(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function J({label:e,value:t,hint:n,tone:r=`default`}){let i={default:`text-foreground`,success:`text-success`,warning:`text-warning`,info:`text-info`,destructive:`text-destructive`}[r];return(0,N.jsxs)(`div`,{className:`border border-border/70 bg-card/55 px-3 py-2.5 shadow-[inset_0_1px_0_hsl(var(--foreground)/0.035)]`,children:[(0,N.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,N.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,N.jsx)(`p`,{className:T(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,N.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function Y(e,t){let n,r,i;if(t===`json`)n=JSON.stringify(e,null,2),r=`techstack.json`,i=`application/json`;else if(t===`spdx`){let t={spdxVersion:`SPDX-2.3`,dataLicense:`CC0-1.0`,SPDXID:`SPDXRef-DOCUMENT`,name:`TechStack-SBOM-${e.projectId}`,documentNamespace:`https://wrongstack.dev/spdx/${e.id}`,creationInfo:{created:e.createdAt,creators:[`Tool: WrongStack TechStack Engine`]},packages:e.dependencies.map((e,t)=>({name:e.name,SPDXID:`SPDXRef-Package-${t}`,versionInfo:e.locked??e.requested,downloadLocation:e.purl?`https://purl.io/${e.purl}`:`NOASSERTION`,licenseConcluded:e.license??`NOASSERTION`}))};n=JSON.stringify(t,null,2),r=`techstack-sbom-spdx.json`,i=`application/json`}else if(t===`cyclonedx`){let t={bomFormat:`CycloneDX`,specVersion:`1.5`,version:1,metadata:{timestamp:e.createdAt,tools:[{name:`WrongStack TechStack Engine`,version:e.adapterVersion}]},components:e.dependencies.map(e=>({type:`library`,name:e.name,version:e.locked??e.requested,...e.purl?{purl:e.purl}:{},...e.license?{licenses:[{license:{id:e.license}}]}:{}}))};n=JSON.stringify(t,null,2),r=`techstack-sbom-cyclonedx.json`,i=`application/json`}else{let t=[`# TechStack Report`,``,`**Generated:** ${e.createdAt}`,`**Target:** ${e.targetRoot}`,`**Fingerprint:** ${e.fingerprint}`,`**Workspaces:** ${e.workspaces.length}`,`**Dependencies:** ${e.dependencies.length}`,`**Findings:** ${e.findings.length}`,`**Coverage:** ${e.coverage}`,``];if(e.workspaces.length>0){t.push(`## Workspaces`,``,`| Workspace | Ecosystem | Coverage | Deps |`,`|---|---|---|---|`);for(let n of e.workspaces){let r=e.dependencies.filter(e=>e.workspaceId===n.id).length;t.push(`| ${n.relativeRoot} | ${n.ecosystem} | ${n.coverage} | ${r} |`)}t.push(``)}if(e.findings.length>0){t.push(`## Findings`,``);let n=new Map;for(let t of e.findings)n.set(t.severity,[...n.get(t.severity)??[],t]);for(let r of[`critical`,`high`,`medium`,`low`,`info`]){let i=n.get(r);if(i?.length){t.push(`### ${r.charAt(0).toUpperCase()+r.slice(1)} (${i.length})`,``);for(let n of i){let r=e.dependencies.find(e=>e.id===n.dependencyId);t.push(`- **${r?.name??n.dependencyId}** — ${n.type} — ${n.rationale}`)}t.push(``)}}}if(e.dependencies.length>0){t.push(`## Dependencies`,``,`| Name | Ecosystem | Status | Locked | Latest |`,`|---|---|---|---|---|`);for(let n of e.dependencies)t.push(`| ${n.name} | ${n.ecosystem} | ${n.status} | ${n.locked??`—`} | ${n.latestStable??`—`} |`)}n=t.join(`
2
2
  `),r=`techstack-report.md`,i=`text/markdown`}let a=new Blob([n],{type:i}),o=URL.createObjectURL(a),s=document.createElement(`a`);s.href=o,s.download=r,s.click(),URL.revokeObjectURL(o)}function pe({dependency:e,findings:t,deepDive:n,onDeepDive:r,onBack:i,coverage:a}){let{t:o}=S(),s=F(e.status),l=G(e),u=W(e),d=a?H(a).noteKey:void 0;return(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,N.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/45 p-3`,children:[(0,N.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,N.jsx)(D,{variant:`ghost`,size:`icon`,onClick:i,"aria-label":o(`activity:techStack.backToDependencyList`),className:`shrink-0 md:hidden`,children:(0,N.jsx)(w,{className:`size-4`})}),(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,N.jsx)(`h2`,{className:`min-w-0 truncate font-mono text-sm font-bold text-foreground`,children:e.name}),(0,N.jsx)(q,{className:s.badge,children:o(s.labelKey)})]}),(0,N.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[I(e.ecosystem,o),` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,d&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,N.jsx)(`span`,{className:`text-warning`,children:o(d)})]})]})]})]}),(0,N.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-baseline gap-2 font-mono text-xs`,children:[(0,N.jsx)(`span`,{className:`text-foreground`,children:l??`—`}),e.latestStable&&e.latestStable!==l&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,N.jsx)(`span`,{className:`text-info`,children:e.latestStable})]}),u.label&&(0,N.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[`(`,u.label,`)`]})]})]}),(0,N.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,N.jsxs)(`dl`,{className:`grid grid-cols-2 gap-px border border-border/70 bg-border/60`,children:[(0,N.jsx)(X,{label:o(`activity:techStack.constraint`),value:e.requested??`—`,mono:!0}),(0,N.jsx)(X,{label:o(`activity:techStack.locked`),value:e.locked??`—`,mono:!0}),(0,N.jsx)(X,{label:o(`activity:techStack.latestStable`),value:e.latestStable??`—`,mono:!0}),(0,N.jsx)(X,{label:o(`activity:techStack.license`),value:e.license??`—`}),e.wanted&&(0,N.jsx)(X,{label:o(`activity:techStack.wanted`),value:e.wanted,mono:!0}),e.resolvable&&(0,N.jsx)(X,{label:o(`activity:techStack.resolvable`),value:e.resolvable,mono:!0}),e.purl&&(0,N.jsx)(X,{label:o(`activity:techStack.purl`),value:e.purl,mono:!0}),(0,N.jsx)(X,{label:o(`activity:techStack.registryFlags`),value:[e.deprecated&&`deprecated`,e.yanked&&`yanked`].filter(Boolean).join(`, `)||`none`})]}),(0,N.jsxs)(`section`,{className:`mt-4`,children:[(0,N.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,N.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:o(`activity:techStack.findings`)}),(0,N.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>r(e),disabled:n.status===`loading`,className:`h-7 text-[10px]`,children:[n.status===`loading`?(0,N.jsx)(v,{className:`size-3 animate-spin`}):(0,N.jsx)(c,{className:`size-3`}),n.status===`loading`?`Researching…`:`Deep dive`]})]}),n.status===`error`&&n.error&&(0,N.jsx)(`p`,{role:`alert`,className:`mb-1.5 text-[10px] text-destructive`,children:n.error}),t.length===0?(0,N.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.nothingFlaggedRunADeepDive`)}):(0,N.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,N.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,N.jsx)(q,{className:z[e.severity].badge,children:o(z[e.severity].labelKey)}),(0,N.jsx)(q,{className:`border-border/70 bg-muted text-muted-foreground`,children:B[e.action]?o(B[e.action]):e.action}),K(e)&&(0,N.jsxs)(q,{className:`border-info/35 bg-info/10 text-info`,children:[(0,N.jsx)(c,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,N.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,N.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk})]},e.id))})]}),(0,N.jsxs)(`section`,{className:`mt-4`,children:[(0,N.jsx)(`h3`,{className:`mb-1.5 text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:o(`activity:techStack.evidence`)}),e.evidence.length===0?(0,N.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.noEvidenceRecorded`)}):(0,N.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.evidence.map((t,n)=>(0,N.jsxs)(`li`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,N.jsx)(q,{className:`border-border/70 bg-muted text-muted-foreground`,children:t.kind}),(0,N.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(t.retrievedAt).toLocaleString()})]}),t.source.startsWith(`http`)?(0,N.jsxs)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`mt-1 flex min-w-0 items-center gap-1 truncate text-[10px] text-info underline-offset-2 hover:underline`,children:[(0,N.jsx)(`span`,{className:`truncate`,children:t.source}),(0,N.jsx)(g,{className:`size-2.5 shrink-0`})]}):(0,N.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:t.source}),t.detail&&(0,N.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-muted-foreground`,children:t.detail})]},`${e.id}-evidence-${n}`))})]})]})]})}function X({label:e,value:t,mono:n}){return(0,N.jsxs)(`div`,{className:`bg-card/55 px-2.5 py-1.5`,children:[(0,N.jsx)(`dt`,{className:`text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,N.jsx)(`dd`,{className:T(`mt-0.5 truncate text-[11px] text-foreground`,n&&`font-mono`),children:t})]})}var me=`grid grid-cols-[minmax(0,2.2fr)_minmax(0,1.6fr)_minmax(0,1.1fr)] gap-2`;function he({dependencies:e,selectedId:t,hasDependencies:n,coverageByWorkspaceId:r,onSelect:i}){let{t:a}=S(),o=j(e,30);return e.length===0?(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,N.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:n?`No dependencies match the current filters.`:`No dependencies inventoried yet. Run a scan to populate the inventory.`})}):(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,N.jsxs)(`div`,{className:T(me,`shrink-0 border-b border-border/70 bg-card/45 px-3 py-1.5 text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`),children:[(0,N.jsx)(`span`,{children:a(`activity:techStack.package`)}),(0,N.jsx)(`span`,{children:a(`activity:techStack.installedLatest`)}),(0,N.jsx)(`span`,{children:a(`activity:techStack.status`)})]}),(0,N.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,N.jsx)(l,{className:`h-full`,"aria-label":a(`activity:techStack.dependencies`),children:o.pageItems.map(e=>(0,N.jsx)(ge,{dependency:e,selected:e.id===t,coverage:r?.get(e.workspaceId),onSelect:i},e.id))})}),(0,N.jsx)(A,{page:o.page,pageSize:o.pageSize,totalItems:o.totalItems,onPageChange:o.setPage,itemLabel:`dependencies`})]})}function ge({dependency:e,selected:t,coverage:n,onSelect:r}){let{t:i}=S(),a=F(e.status),o=G(e),s=W(e),c=n?H(n).noteKey:void 0;return(0,N.jsxs)(`button`,{type:`button`,onClick:()=>r(e),"aria-current":t,className:T(me,`w-full items-center border-b border-border/40 px-3 py-2 text-left transition-colors hover:bg-accent/40`,t&&`bg-accent/60`),children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,N.jsx)(`span`,{className:T(`size-1.5 shrink-0`,a.dot),"aria-hidden":`true`}),(0,N.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e.name})]}),(0,N.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[(0,N.jsx)(R,{ecosystem:e.ecosystem,className:`mr-0.5 inline-block size-3 align-text-bottom`}),I(e.ecosystem,i),` · `,e.direct?`direct`:`transitive`,` · `,e.scope,c&&(0,N.jsxs)(N.Fragment,{children:[` · `,(0,N.jsx)(`span`,{className:`text-warning`,children:i(c)})]})]})]}),(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5 font-mono text-[11px]`,children:[(0,N.jsx)(`span`,{className:`truncate text-foreground`,children:o??`—`}),e.latestStable&&e.latestStable!==o&&(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`→`}),(0,N.jsx)(`span`,{className:`truncate text-info`,children:e.latestStable})]})]}),s.label?(0,N.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:s.label}):e.requested&&(0,N.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:e.requested})]}),(0,N.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,N.jsx)(q,{className:a.badge,children:i(a.labelKey)}),e.deprecated&&(0,N.jsx)(q,{className:`border-destructive/35 bg-destructive/10 text-destructive`,children:`dep`}),e.yanked&&(0,N.jsx)(q,{className:`border-destructive/45 bg-destructive/15 text-destructive`,children:`yank`})]})]})}function _e({findings:e,dependenciesById:t,onSelectDependency:n}){let{t:r}=S(),i=j(e,20);if(e.length===0)return(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,N.jsxs)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:[r(`activity:techStack.noFindingsRun`),` `,(0,N.jsx)(`span`,{className:`font-mono text-foreground`,children:r(`activity:techStack.analyze`)}),` `,r(`activity:techStack.toCheckVersionsAndAdvisoriesAgainst`)]})});let a=fe.map(e=>[e,i.pageItems.filter(t=>t.severity===e)]).filter(([,e])=>e.length>0);return(0,N.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-4`,children:a.map(([e,i])=>(0,N.jsxs)(`section`,{children:[(0,N.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,N.jsx)(q,{className:z[e].badge,children:r(z[e].labelKey)}),(0,N.jsx)(`span`,{className:`font-mono text-[10px] tabular-nums text-muted-foreground`,children:i.length})]}),(0,N.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map(e=>(0,N.jsx)(ve,{finding:e,dependency:t.get(e.dependencyId),onSelectDependency:n},e.id))})]},e))})}),(0,N.jsx)(A,{page:i.page,pageSize:i.pageSize,totalItems:i.totalItems,onPageChange:i.setPage,itemLabel:`findings`})]})}function ve({finding:e,dependency:t,onSelectDependency:n}){let{t:r}=S(),i=K(e);return(0,N.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,N.jsx)(`button`,{type:`button`,onClick:()=>n(e.dependencyId),className:`min-w-0 truncate font-mono text-xs text-foreground underline-offset-2 hover:underline`,children:t?.name??e.dependencyId}),(0,N.jsx)(q,{className:`border-border/70 bg-muted text-muted-foreground`,children:B[e.action]?r(B[e.action]):e.action}),i&&(0,N.jsxs)(q,{className:`border-info/35 bg-info/10 text-info`,children:[(0,N.jsx)(c,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,N.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,N.jsx)(`p`,{className:`mt-1 border-l-2 border-warning/40 pl-2 text-[10px] leading-relaxed text-warning`,children:e.breakingRisk}),e.evidence.length>0&&(0,N.jsx)(`ul`,{className:T(`mt-1.5 flex flex-col gap-0.5`),children:e.evidence.slice(0,4).map((t,n)=>(0,N.jsx)(`li`,{className:`min-w-0 truncate text-[10px]`,children:t.source.startsWith(`http`)?(0,N.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`text-info underline-offset-2 hover:underline`,children:t.detail??t.source}):(0,N.jsx)(`span`,{className:`text-muted-foreground`,children:t.detail??t.source})},`${e.id}-${n}`))})]})}function ye({searchQuery:e,ecosystemFilter:t,statusFilter:n,directOnly:r,sort:i,hasFilters:a,ecosystems:o,statuses:s,visibleCount:c,totalCount:l,onSearchChange:u,onEcosystemFilterChange:d,onStatusFilterChange:f,onToggleDirectOnly:p,onSortChange:m,onClearFilters:h}){let{t:g}=S();return(0,N.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border/70 bg-card/45 p-3`,children:[(0,N.jsxs)(`div`,{className:`flex gap-2`,children:[(0,N.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,N.jsx)(x,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,N.jsx)(O,{"aria-label":g(`activity:techStack.searchDependencies`),value:e,onChange:e=>u(e.target.value),placeholder:g(`activity:techStack.searchByPackageName`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,N.jsx)(`button`,{type:`button`,"aria-label":g(`activity:techStack.clearSearch`),onClick:()=>u(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,N.jsx)(ee,{className:`size-3.5`})})]}),(0,N.jsx)(D,{variant:r?`default`:`outline`,size:`sm`,onClick:p,"aria-pressed":r,title:g(`activity:techStack.showOnlyDependenciesThisProjectDeclaresItself`),className:`shrink-0`,children:g(`activity:techStack.directOnly`)}),a&&(0,N.jsx)(D,{variant:`ghost`,size:`icon`,onClick:h,"aria-label":g(`activity:techStack.clearAllFilters`),title:g(`activity:techStack.clearAllFilters`),className:`shrink-0`,children:(0,N.jsx)(b,{className:`size-4`})})]}),(0,N.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-ecosystem-filter`,children:g(`activity:techStack.filterByEcosystem`)}),(0,N.jsxs)(`select`,{id:`techstack-ecosystem-filter`,value:t,onChange:e=>d(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,N.jsx)(`option`,{value:`all`,children:g(`activity:techStack.allEcosystems`)}),o.map(([e,t])=>(0,N.jsxs)(`option`,{value:e,children:[I(e,g),` · `,t]},e))]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:g(`activity:techStack.filterByStatus`)}),(0,N.jsxs)(`select`,{id:`techstack-status-filter`,value:n,onChange:e=>f(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,N.jsx)(`option`,{value:`all`,children:g(`activity:techStack.allStatuses`)}),s.map(([e,t])=>(0,N.jsxs)(`option`,{value:e,children:[g(F(e).labelKey),` · `,t]},e))]})]}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:g(`activity:techStack.sortDependencies`)}),(0,N.jsxs)(`select`,{id:`techstack-sort`,value:i,onChange:e=>m(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,N.jsx)(`option`,{value:`attention`,children:g(`activity:techStack.sortNeedsAttention`)}),(0,N.jsx)(`option`,{value:`drift`,children:g(`activity:techStack.sortMostOutOfDate`)}),(0,N.jsx)(`option`,{value:`name`,children:g(`activity:techStack.sortName`)})]})]})]}),(0,N.jsx)(`p`,{className:T(`text-[10px] text-muted-foreground`,a&&`text-info`),children:c===l?`${l} dependencies`:`${c} of ${l} dependencies`})]})}var be=[{id:`dependencies`,labelKey:`activity:techStack.tabDependencies`},{id:`findings`,labelKey:`activity:techStack.tabFindings`},{id:`workspaces`,labelKey:`activity:techStack.tabWorkspaces`},{id:`trends`,labelKey:`activity:techStack.tabTrends`},{id:`remediation`,labelKey:`activity:techStack.tabRemediation`}],Z=new Set([`npm`,`python`,`rust`,`go`,`php`,`dotnet`]);function Q(){let{t:e}=S(),n=E(e=>e.snapshot),i=E(e=>e.stale),a=E(e=>e.loading),o=E(e=>e.error),s=E(e=>e.activeJob),[l,u]=(0,M.useState)(`dependencies`),[d,f]=(0,M.useState)(``),[p,m]=(0,M.useState)(`all`),[g,_]=(0,M.useState)(`all`),[y,b]=(0,M.useState)(!1),[x,re]=(0,M.useState)(`attention`),[C,w]=(0,M.useState)(null),[O,A]=(0,M.useState)([]),[j,P]=(0,M.useState)({status:`idle`,error:null}),[ce,le]=(0,M.useState)(null),[ue,I]=(0,M.useState)(null),[L,R]=(0,M.useState)(new Set),[fe,z]=(0,M.useState)(!1),B=(0,M.useCallback)(async()=>{let e=E.getState();e.setLoading(!0),e.setError(null);try{let t=await fetch(`/api/techstack/snapshot`);if(t.status===404){e.setSnapshot(null,!1);return}if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);let n=await t.json();e.setSnapshot(n.snapshot,n.stale)}catch(t){e.setError(t instanceof Error?t.message:String(t))}},[]),V=(0,M.useCallback)(async e=>{let t=E.getState();t.setLoading(!0),t.setError(null);try{let n=await fetch(`/api/techstack/${e}`,{method:`POST`}),r=await n.json();if(!n.ok||!r.jobId)throw Error(r.error??`HTTP ${n.status}: ${n.statusText}`);t.jobStarted(r.jobId,e)}catch(e){t.setError(e instanceof Error?e.message:String(e))}},[]),H=(0,M.useCallback)(async()=>{let e=E.getState().activeJob;if(e)try{let t=await fetch(`/api/techstack/jobs/${encodeURIComponent(e.id)}/cancel`,{method:`POST`});if(!t.ok)throw Error(`HTTP ${t.status}: ${t.statusText}`);E.getState().jobCancelled(e.id)}catch(e){E.getState().setError(e instanceof Error?e.message:String(e))}},[]),U=(0,M.useCallback)(async e=>{P({status:`loading`,error:null});try{let t=await fetch(`/api/techstack/deps/${encodeURIComponent(e.id)}/research`,{method:`POST`}),n=await t.json();if(!t.ok)throw Error(n.error??`HTTP ${t.status}`);A(n.findings??[]),P({status:`idle`,error:null})}catch(e){P({status:`error`,error:e instanceof Error?e.message:String(e)})}},[]);(0,M.useEffect)(()=>{B()},[B]),(0,M.useEffect)(()=>{(l===`trends`||l===`remediation`)&&fetch(`/api/techstack/${l===`trends`?`trends`:`remediation`}`).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);t.trend&&le(t.trend),t.plan&&I(t.plan)}).catch(e=>E.getState().setError(e instanceof Error?e.message:String(e)))},[l,n?.id]);let G=(0,M.useCallback)(async()=>{if(L.size!==0){z(!0);try{let e=await fetch(`/api/techstack/remediation/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvedItems:[...L]})}),t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);R(new Set),await V(`inventory`)}catch(e){E.getState().setError(e instanceof Error?e.message:String(e))}finally{z(!1)}}},[L,V]);(0,M.useEffect)(()=>{A([]),P({status:`idle`,error:null})},[n?.id]);let K=(0,M.useMemo)(()=>n?.dependencies??[],[n]),q=(0,M.useMemo)(()=>n?.findings??[],[n]),X=(0,M.useMemo)(()=>new Map(K.map(e=>[e.id,e])),[K]),me=(0,M.useMemo)(()=>Ee(K.map(e=>e.ecosystem)),[K]),ge=(0,M.useMemo)(()=>Ee(K.map(e=>e.status)),[K]),ve=(0,M.useMemo)(()=>new Map(n?.workspaces.map(e=>[e.id,e.coverage])??[]),[n]),Z=(0,M.useMemo)(()=>{let e=d.trim().toLowerCase(),t=[...K.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||p!==`all`&&t.ecosystem!==p||g!==`all`&&t.status!==g||y&&!t.direct))];return x===`name`?t.sort((e,t)=>e.name.localeCompare(t.name)):x===`drift`?t.sort((e,t)=>W(t).majorsBehind-W(e).majorsBehind||e.name.localeCompare(t.name)):t.sort((e,t)=>F(t.status).weight-F(e.status).weight||Number(t.direct)-Number(e.direct)||e.name.localeCompare(t.name)),t},[K,d,p,g,y,x]),Q=C?X.get(C):void 0,De=(0,M.useMemo)(()=>Q?[...q.filter(e=>e.dependencyId===Q.id),...O.filter(e=>e.dependencyId===Q.id)]:[],[q,O,Q]),Oe=(0,M.useMemo)(()=>K.filter(de).length,[K]),ke=(0,M.useMemo)(()=>K.filter(e=>W(e).majorsBehind>0).length,[K]),Ae=(0,M.useMemo)(()=>K.filter(e=>e.status===`vulnerable`).length,[K]),je=d.trim()!==``||p!==`all`||g!==`all`||y,Me=(0,M.useCallback)(()=>{f(``),m(`all`),_(`all`),b(!1)},[]),$=!!(s&&![`completed`,`failed`,`cancelled`].includes(s.status)),Ne=(0,M.useCallback)(e=>{w(e),u(`dependencies`)},[]);return(0,N.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,N.jsx)(`header`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,children:(0,N.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,N.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:e(`activity:techStack.techstack`)}),(0,N.jsx)(`span`,{className:`border border-info/35 bg-info/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-info`,children:n?`${n.workspaces.length} workspaces`:`no scan yet`}),i&&(0,N.jsx)(`span`,{className:`border border-warning/35 bg-warning/10 px-2 py-0.5 font-mono text-[9px] font-bold uppercase text-warning`,children:e(`activity:techStack.staleGt24h`)})]}),(0,N.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground sm:text-xs`,children:n?`${n.targetRoot} · scanned ${new Date(n.createdAt).toLocaleString()}`:`Scan the open project to inventory its dependencies.`})]}),(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,N.jsxs)(D,{variant:`outline`,size:`sm`,onClick:()=>void V(`inventory`),disabled:$,title:e(`activity:techStack.offlineReReadManifestsAndLockfiles`),children:[(0,N.jsx)(ie,{className:T(`size-3.5`,$&&`animate-spin`)}),(0,N.jsx)(`span`,{className:`hidden sm:inline`,children:e(`activity:techStack.refresh`)})]}),(0,N.jsxs)(D,{size:`sm`,onClick:()=>void V(`analyze`),disabled:$,title:e(`activity:techStack.checkRegistriesAndAdvisoriesThenInterpretTheResultsWithTheModel`),children:[(0,N.jsx)(c,{className:`size-3.5`}),e(`activity:techStack.analyze`)]}),$&&(0,N.jsx)(D,{variant:`ghost`,size:`icon`,onClick:()=>void H(),"aria-label":e(`activity:techStack.cancelJob`),children:(0,N.jsx)(ee,{className:`size-4`})}),(0,N.jsxs)(ae,{children:[(0,N.jsx)(oe,{asChild:!0,children:(0,N.jsx)(D,{variant:`ghost`,size:`icon`,disabled:!n,"aria-label":e(`activity:techStack.exportOptions`),title:e(`activity:techStack.exportOptions`),children:(0,N.jsx)(r,{className:`size-4`})})}),(0,N.jsxs)(se,{align:`end`,className:`w-60`,children:[(0,N.jsxs)(k,{onClick:()=>n&&Y(n,`json`),children:[(0,N.jsx)(te,{className:`mr-2 size-4`}),e(`activity:techStack.exportSnapshotAsJson`)]}),(0,N.jsxs)(k,{onClick:()=>n&&Y(n,`spdx`),children:[(0,N.jsx)(h,{className:`mr-2 size-4`}),e(`activity:techStack.exportSbomSpdx`)]}),(0,N.jsxs)(k,{onClick:()=>n&&Y(n,`cyclonedx`),children:[(0,N.jsx)(t,{className:`mr-2 size-4`}),e(`activity:techStack.exportSbomCycloneDx`)]}),(0,N.jsxs)(k,{onClick:()=>n&&Y(n,`md`),children:[(0,N.jsx)(ne,{className:`mr-2 size-4`}),e(`activity:techStack.exportReportMd`)]})]})]})]})]})}),n&&(0,N.jsxs)(`div`,{className:`grid shrink-0 grid-cols-2 gap-px border-b border-border/70 bg-border/60 sm:grid-cols-4`,children:[(0,N.jsx)(J,{label:e(`activity:techStack.dependencies`),value:K.length,hint:`${Z.length} visible`}),(0,N.jsx)(J,{label:e(`activity:techStack.outdated`),value:ke,hint:e(`activity:techStack.majorsBehind`),tone:ke>0?`warning`:`success`}),(0,N.jsx)(J,{label:e(`activity:techStack.vulnerable`),value:Ae,hint:e(`activity:techStack.knownAdvisories`),tone:Ae>0?`destructive`:`success`}),(0,N.jsx)(J,{label:e(`activity:techStack.findings`),value:q.length,hint:`${Oe} need attention`,tone:q.length>0?`info`:`default`})]}),($||o)&&(0,N.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[$&&s&&(0,N.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-info`,children:[(0,N.jsx)(v,{className:`size-3.5 animate-spin`}),(0,N.jsx)(`span`,{className:`font-mono`,children:s.status}),s.progress&&(0,N.jsxs)(`span`,{className:`text-muted-foreground`,children:[s.progress.completed,`/`,s.progress.total]})]}),o&&(0,N.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,N.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:o}),(0,N.jsx)(`button`,{type:`button`,onClick:()=>void B(),className:`underline`,children:e(`activity:techStack.retry`)})]})]}),a&&!n?(0,N.jsx)(we,{}):n?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`nav`,{className:`flex shrink-0 gap-1 border-b border-border/70 px-2`,children:be.map(t=>(0,N.jsxs)(`button`,{type:`button`,onClick:()=>u(t.id),"aria-current":l===t.id,className:T(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,l===t.id?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e(t.labelKey),t.id===`findings`&&q.length>0&&(0,N.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:q.length})]},t.id))}),l===`dependencies`&&(0,N.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(340px,1fr)_minmax(0,1.15fr)]`,children:[(0,N.jsxs)(`section`,{className:T(`min-h-0 border-r border-border/70`,Q?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:techStack.dependencyList`),children:[(0,N.jsx)(ye,{searchQuery:d,ecosystemFilter:p,statusFilter:g,directOnly:y,sort:x,hasFilters:je,ecosystems:me,statuses:ge,visibleCount:Z.length,totalCount:K.length,onSearchChange:f,onEcosystemFilterChange:m,onStatusFilterChange:_,onToggleDirectOnly:()=>b(e=>!e),onSortChange:re,onClearFilters:Me}),(0,N.jsx)(he,{dependencies:Z,selectedId:C,hasDependencies:K.length>0,coverageByWorkspaceId:ve,onSelect:e=>w(e.id)})]}),(0,N.jsx)(`section`,{className:T(`min-h-0`,Q?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:techStack.dependencyDetail`),children:Q?(0,N.jsx)(pe,{dependency:Q,findings:De,deepDive:j,onDeepDive:U,onBack:()=>w(null),coverage:ve.get(Q.workspaceId)}):(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,N.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:e(`activity:techStack.selectADependencyToSeeIts`)})})})]}),l===`findings`&&(0,N.jsx)(_e,{findings:q,dependenciesById:X,onSelectDependency:Ne}),l===`workspaces`&&(0,N.jsx)(Ce,{snapshot:n}),l===`trends`&&(0,N.jsx)(xe,{trend:ce}),l===`remediation`&&(0,N.jsx)(Se,{plan:ue,approved:L,applying:fe,onToggle:e=>R(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onApply:()=>void G()})]}):(0,N.jsx)(Te,{onScan:()=>void V(`inventory`),disabled:$})]})}function xe({trend:e}){return e?(0,N.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,N.jsxs)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:[e.snapshots,` snapshots`,e.vulnerabilityHalfLifeMs===void 0?``:` · vulnerability half-life ${(e.vulnerabilityHalfLifeMs/864e5).toFixed(1)} days`]}),(0,N.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,N.jsxs)(`div`,{className:`grid grid-cols-4 border border-border/70 bg-card/40 p-2 text-xs`,children:[(0,N.jsx)(`span`,{children:new Date(e.createdAt).toLocaleDateString()}),(0,N.jsxs)(`span`,{children:[e.dependencies,` deps`]}),(0,N.jsxs)(`span`,{className:`text-warning`,children:[e.outdated,` outdated`]}),(0,N.jsxs)(`span`,{className:`text-destructive`,children:[e.vulnerable,` vulnerable`]})]},e.snapshotId))})]}):(0,N.jsx)(we,{})}function Se({plan:e,approved:t,applying:n,onToggle:r,onApply:i}){let{t:a}=S();return e?(0,N.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,N.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.warning}),(0,N.jsxs)(D,{size:`sm`,disabled:t.size===0||n,onClick:i,children:[n&&(0,N.jsx)(v,{className:`size-3.5 animate-spin`}),`Apply `,t.size>0?t.size:``]})]}),(0,N.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[e.items.map(e=>{let n=`${e.workspaceId}:${e.ecosystem}:${e.dependencyName}:${e.action}`,i=e.action===`replace`||e.action===`investigate`||!Z.has(e.ecosystem);return(0,N.jsxs)(`label`,{className:T(`flex gap-3 border border-border/70 bg-card/40 p-2.5`,i?`cursor-not-allowed opacity-65`:`cursor-pointer`),children:[(0,N.jsx)(`input`,{type:`checkbox`,disabled:i,checked:t.has(n),onChange:()=>r(n)}),(0,N.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,N.jsxs)(`span`,{className:`block font-mono text-xs`,children:[e.dependencyName,` · `,e.action]}),(0,N.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[e.currentVersion??`?`,` → `,e.targetVersion??`latest`,` · `,e.rationale]}),i&&(0,N.jsx)(`span`,{className:`block text-[10px] text-warning`,children:a(`activity:techStack.requiresAManualPackageChoice`)})]})]},n)}),e.items.length===0&&(0,N.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:a(`activity:techStack.noRemediationNeeded`)})]})]}):(0,N.jsx)(we,{})}function Ce({snapshot:e}){let{t}=S(),n=(0,M.useMemo)(()=>{let t=new Map;for(let n of e.dependencies)t.set(n.workspaceId,(t.get(n.workspaceId)??0)+1);return t},[e]);return e.workspaces.length===0?(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,N.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`activity:techStack.noWorkspacesDetected`)})}):(0,N.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,N.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.workspaces.map(e=>{let r=V[e.coverage];return(0,N.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,N.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,N.jsxs)(`div`,{className:`min-w-0`,children:[(0,N.jsx)(`p`,{className:`truncate font-mono text-xs text-foreground`,children:e.relativeRoot}),(0,N.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1 truncate text-[10px] text-muted-foreground`,children:[(0,N.jsx)(R,{ecosystem:e.ecosystem}),(0,N.jsx)(`span`,{children:I(e.ecosystem,t)}),e.packageManager?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,N.jsx)(`span`,{children:e.packageManager})]}):null,(0,N.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,N.jsxs)(`span`,{children:[n.get(e.id)??0,` deps`]})]})]}),(0,N.jsx)(`span`,{className:T(`shrink-0 border px-1.5 py-0.5 text-[10px] font-medium`,r.badge),children:t(r.labelKey)})]}),e.manifests.length>0&&(0,N.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.manifests.map(e=>(0,N.jsx)(`span`,{className:`border border-border/70 bg-background/45 px-1.5 py-0.5 font-mono text-[9px] text-muted-foreground`,children:e.split(/[/\\]/).pop()},e))})]},e.id)})})})}function we(){let{t:e}=S();return(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,N.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,N.jsx)(v,{className:`size-5 animate-spin text-muted-foreground`}),(0,N.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:techStack.loadingSnapshot`)})]})})}function Te({onScan:e,disabled:t}){let{t:n}=S(),r=(0,M.useMemo)(()=>Object.values(le).map(e=>e.label??``).filter(Boolean).join(`, `),[]);return(0,N.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,N.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-3 text-center`,children:[(0,N.jsx)(`div`,{className:`flex size-14 items-center justify-center border border-info/25 bg-info/5 text-info`,children:(0,N.jsx)(d,{className:`size-6`})}),(0,N.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`activity:techStack.noInventoryYet`)}),(0,N.jsxs)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:[`TechStack reads every manifest and lockfile in the open project — `,r,` — and compares what you have against the upstream registries.`]}),(0,N.jsxs)(D,{size:`sm`,onClick:e,disabled:t,children:[(0,N.jsx)(ie,{className:T(`size-3.5`,t&&`animate-spin`)}),n(`activity:techStack.scanThisProject`)]})]})})}function Ee(e){let t=new Map;for(let n of e)t.set(n,(t.get(n)??0)+1);return[...t.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0]))}export{Q as TechStackView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,X as n,t as r}from"./ws-client-D-d32pHb.js";import{Dn as i,Mt as a,Ut as o,ft as s,gn as c,io as l,oo as u,to as d,ut as f}from"./vendor-enc0q-Va.js";import"./i18n-Cv65b1SP.js";import{n as p,t as m}from"./utils-DQ9Exx8j.js";import{n as h}from"./ui-store-DpKUBLWd.js";import"./stores-CNuMLG8X.js";import{n as g,t as _}from"./xterm-BWzBEEhg.js";var v=e(u(),1),y=`wrongstack.terminalDockHeight`,b=260;function x(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-b));return Math.min(Math.max(Math.round(e),140),t)}var S=f(),C={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`},w=8;function T(e=!1){return typeof window>`u`?300:x(window.innerHeight*(e?.32:.4))}function E(e=!1){if(typeof window>`u`)return T(e);try{let t=window.localStorage.getItem(y),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?x(n):T(e)}catch{return T(e)}}function D(e){try{window.localStorage.setItem(y,String(x(e)))}catch{}}function O(){return p()}function k(e){return{id:O(),name:`Terminal ${e}`,status:`starting`}}function A({desktopShell:e=!1,onClose:t}){let r=(0,v.useRef)(null),{t:l}=d(),u=(0,v.useRef)(1),[f,p]=(0,v.useState)(()=>E(e)),[g,_]=(0,v.useState)(()=>[k(1)]),[y,b]=(0,v.useState)(()=>g[0]?.id??``),C=h(e=>e.terminalCreateNonce),T=(0,v.useRef)(C),A=n(e=>e.projectName),M=n(e=>e.cwd);(0,v.useEffect)(()=>{let e=()=>{p(e=>{let t=x(e);return D(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),r.current?.();let t=e.clientY,n=f,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 r=x(n+t-e.clientY);p(r),D(r)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),r.current===s&&(r.current=null)};r.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,v.useEffect)(()=>()=>r.current?.(),[]);let P=()=>{if(g.length>=w)return;u.current+=1;let e=k(u.current);_([...g,e]),b(e.id)};(0,v.useEffect)(()=>{C!==T.current&&(T.current=C,P())},[C]);let F=e=>{let n=g.findIndex(t=>t.id===e);if(n===-1)return;let r=g.filter(t=>t.id!==e);if(_(r),r.length===0){queueMicrotask(t);return}y===e&&b(r[Math.max(0,n-1)]?.id??r[0]?.id??``)},I=e=>{let t=O();g.some(t=>t.id===e)&&(_(g.map(n=>n.id===e?{...n,id:t,status:`starting`,exitCode:void 0}:n)),b(t))},L=()=>{_([]),b(``),queueMicrotask(t)},R=(e,t)=>{_(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===y)??g[0]??null;return(0,S.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:f},"data-shell":e?`desktop`:`browser`,className:m(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border/70 bg-card shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,S.jsx)(`hr`,{"aria-orientation":`horizontal`,tabIndex:0,title:l(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-muted/70 transition-colors hover:bg-primary/35 border-0`}),(0,S.jsxs)(`div`,{className:m(`flex min-w-0 items-center justify-between gap-3 border-b border-border/70 bg-card/85`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-foreground`,children:[(0,S.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,S.jsx)(`span`,{className:`font-medium`,children:l(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,S.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:A||M||l(`activity:terminal.projectShell`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=w,title:g.length>=w?l(`activity:terminal.maxTerminals`,{count:w}):l(`activity:terminal.newTerminal`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(i,{className:`h-4 w-4`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:l(`activity:terminal.restart`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(c,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:l(`activity:terminal.closeAll`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:t,title:l(`activity:terminal.closeDock`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,S.jsx)(s,{className:`h-4 w-4`})})]})]}),(0,S.jsx)(`div`,{className:m(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/70 bg-[hsl(var(--surface-2)/0.45)]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,S.jsxs)(`div`,{className:m(`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]`,y===t.id?`border-primary/35 bg-primary/10 text-primary`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>b(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,S.jsx)(`span`,{className:m(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-success`,t.status===`starting`&&`bg-primary`,t.status===`exited`&&`bg-destructive`)}),(0,S.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,S.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-muted-foreground opacity-70 hover:bg-accent hover:text-foreground hover:opacity-100`,title:l(`activity:terminal.closeTab`,{name:t.name}),children:(0,S.jsx)(s,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,S.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/60 bg-muted/30 px-3 py-1 text-[11px] font-mono text-muted-foreground`,children:M}),(0,S.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,S.jsx)(j,{id:e.id,active:e.id===y,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function j({id:e,active:n,onRunning:i,onExit:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),u=(0,v.useRef)(i),d=(0,v.useRef)(a),f=t(e=>e.wsConnected);return(0,v.useEffect)(()=>{u.current=i,d.current=a},[a,i]),(0,v.useEffect)(()=>{let n=o.current;if(!n)return;let i=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:C,scrollback:5e3}),a=new g;s.current=i,c.current=a,i.loadAddon(a),i.open(n);try{a.fit()}catch{}let f=r(t.getState().wsUrl);f.send({type:`terminal.create`,payload:{id:e,cols:i.cols,rows:i.rows}});let p=!1,m=f.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(p||(p=!0,u.current()),i.write(t.payload.data))}),h=f.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(i.write(`\r\n\x1b[2m${l.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),d.current(t.payload.exitCode))}),v=i.onData(t=>{f.send({type:`terminal.input`,payload:{id:e,data:t}})}),y=new ResizeObserver(()=>{if(n.offsetParent)try{a.fit(),f.send({type:`terminal.resize`,payload:{id:e,cols:i.cols,rows:i.rows}})}catch{}});return y.observe(n),()=>{m(),h(),v.dispose(),y.disconnect(),f.send({type:`terminal.close`,payload:{id:e}}),i.dispose(),s.current=null,c.current=null}},[e,f]),(0,v.useEffect)(()=>{n&&window.requestAnimationFrame(()=>{try{c.current?.fit();let n=s.current;n&&(r(t.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}}),n.focus())}catch{}})},[n,e]),(0,S.jsx)(`div`,{ref:o,className:m(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,n?`block`:`hidden`)})}export{A as TerminalPanel};
1
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,X as n,t as r}from"./ws-client-DtTZLD8e.js";import{Dn as i,Mt as a,Ut as o,ft as s,gn as c,io as l,oo as u,to as d,ut as f}from"./vendor-enc0q-Va.js";import"./i18n-D06uU1PM.js";import{n as p,t as m}from"./utils-DQ9Exx8j.js";import{n as h}from"./ui-store-Dm7ujR9u.js";import"./stores-C7Vvce-6.js";import{n as g,t as _}from"./xterm-BWzBEEhg.js";var v=e(u(),1),y=`wrongstack.terminalDockHeight`,b=260;function x(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-b));return Math.min(Math.max(Math.round(e),140),t)}var S=f(),C={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`},w=8;function T(e=!1){return typeof window>`u`?300:x(window.innerHeight*(e?.32:.4))}function E(e=!1){if(typeof window>`u`)return T(e);try{let t=window.localStorage.getItem(y),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?x(n):T(e)}catch{return T(e)}}function D(e){try{window.localStorage.setItem(y,String(x(e)))}catch{}}function O(){return p()}function k(e){return{id:O(),name:`Terminal ${e}`,status:`starting`}}function A({desktopShell:e=!1,onClose:t}){let r=(0,v.useRef)(null),{t:l}=d(),u=(0,v.useRef)(1),[f,p]=(0,v.useState)(()=>E(e)),[g,_]=(0,v.useState)(()=>[k(1)]),[y,b]=(0,v.useState)(()=>g[0]?.id??``),C=h(e=>e.terminalCreateNonce),T=(0,v.useRef)(C),A=n(e=>e.projectName),M=n(e=>e.cwd);(0,v.useEffect)(()=>{let e=()=>{p(e=>{let t=x(e);return D(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),r.current?.();let t=e.clientY,n=f,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 r=x(n+t-e.clientY);p(r),D(r)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),r.current===s&&(r.current=null)};r.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,v.useEffect)(()=>()=>r.current?.(),[]);let P=()=>{if(g.length>=w)return;u.current+=1;let e=k(u.current);_([...g,e]),b(e.id)};(0,v.useEffect)(()=>{C!==T.current&&(T.current=C,P())},[C]);let F=e=>{let n=g.findIndex(t=>t.id===e);if(n===-1)return;let r=g.filter(t=>t.id!==e);if(_(r),r.length===0){queueMicrotask(t);return}y===e&&b(r[Math.max(0,n-1)]?.id??r[0]?.id??``)},I=e=>{let t=O();g.some(t=>t.id===e)&&(_(g.map(n=>n.id===e?{...n,id:t,status:`starting`,exitCode:void 0}:n)),b(t))},L=()=>{_([]),b(``),queueMicrotask(t)},R=(e,t)=>{_(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===y)??g[0]??null;return(0,S.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:f},"data-shell":e?`desktop`:`browser`,className:m(`z-30 flex min-h-0 shrink-0 flex-col border-t border-border/70 bg-card shadow-2xl`,e&&`ws-terminal-desktop`),children:[(0,S.jsx)(`hr`,{"aria-orientation":`horizontal`,tabIndex:0,title:l(`activity:terminal.resize`),onPointerDown:N,className:`h-1.5 cursor-ns-resize bg-muted/70 transition-colors hover:bg-primary/35 border-0`}),(0,S.jsxs)(`div`,{className:m(`flex min-w-0 items-center justify-between gap-3 border-b border-border/70 bg-card/85`,e?`px-2 py-1`:`px-3 py-1.5`),children:[(0,S.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-foreground`,children:[(0,S.jsx)(o,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,S.jsx)(`span`,{className:`font-medium`,children:l(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,S.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:A||M||l(`activity:terminal.projectShell`)})]}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=w,title:g.length>=w?l(`activity:terminal.maxTerminals`,{count:w}):l(`activity:terminal.newTerminal`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(i,{className:`h-4 w-4`})}),(0,S.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:l(`activity:terminal.restart`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(c,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:L,disabled:g.length===0,title:l(`activity:terminal.closeAll`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:cursor-not-allowed disabled:opacity-40`,children:(0,S.jsx)(a,{className:`h-3.5 w-3.5`})}),(0,S.jsx)(`button`,{type:`button`,onClick:t,title:l(`activity:terminal.closeDock`),className:`inline-flex h-6 w-6 items-center justify-center rounded text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:(0,S.jsx)(s,{className:`h-4 w-4`})})]})]}),(0,S.jsx)(`div`,{className:m(`flex min-w-0 items-center gap-1 overflow-x-auto border-b border-border/70 bg-[hsl(var(--surface-2)/0.45)]`,e?`px-1.5 py-0.5`:`px-2 py-1`),children:g.map(t=>(0,S.jsxs)(`div`,{className:m(`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]`,y===t.id?`border-primary/35 bg-primary/10 text-primary`:`border-transparent bg-transparent text-muted-foreground hover:bg-accent hover:text-foreground`),children:[(0,S.jsxs)(`button`,{type:`button`,onClick:()=>b(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,S.jsx)(`span`,{className:m(`h-1.5 w-1.5 shrink-0 rounded-full`,t.status===`running`&&`bg-success`,t.status===`starting`&&`bg-primary`,t.status===`exited`&&`bg-destructive`)}),(0,S.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,S.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-muted-foreground opacity-70 hover:bg-accent hover:text-foreground hover:opacity-100`,title:l(`activity:terminal.closeTab`,{name:t.name}),children:(0,S.jsx)(s,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,S.jsx)(`div`,{className:`min-w-0 truncate border-b border-border/60 bg-muted/30 px-3 py-1 text-[11px] font-mono text-muted-foreground`,children:M}),(0,S.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,S.jsx)(j,{id:e.id,active:e.id===y,onRunning:()=>R(e.id,{status:`running`}),onExit:t=>R(e.id,{status:`exited`,exitCode:t})},e.id))})]})}function j({id:e,active:n,onRunning:i,onExit:a}){let o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(null),u=(0,v.useRef)(i),d=(0,v.useRef)(a),f=t(e=>e.wsConnected);return(0,v.useEffect)(()=>{u.current=i,d.current=a},[a,i]),(0,v.useEffect)(()=>{let n=o.current;if(!n)return;let i=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:C,scrollback:5e3}),a=new g;s.current=i,c.current=a,i.loadAddon(a),i.open(n);try{a.fit()}catch{}let f=r(t.getState().wsUrl);f.send({type:`terminal.create`,payload:{id:e,cols:i.cols,rows:i.rows}});let p=!1,m=f.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(p||(p=!0,u.current()),i.write(t.payload.data))}),h=f.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(i.write(`\r\n\x1b[2m${l.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),d.current(t.payload.exitCode))}),v=i.onData(t=>{f.send({type:`terminal.input`,payload:{id:e,data:t}})}),y=new ResizeObserver(()=>{if(n.offsetParent)try{a.fit(),f.send({type:`terminal.resize`,payload:{id:e,cols:i.cols,rows:i.rows}})}catch{}});return y.observe(n),()=>{m(),h(),v.dispose(),y.disconnect(),f.send({type:`terminal.close`,payload:{id:e}}),i.dispose(),s.current=null,c.current=null}},[e,f]),(0,v.useEffect)(()=>{n&&window.requestAnimationFrame(()=>{try{c.current?.fit();let n=s.current;n&&(r(t.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:n.cols,rows:n.rows}}),n.focus())}catch{}})},[n,e]),(0,S.jsx)(`div`,{ref:o,className:m(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,n?`block`:`hidden`)})}export{A as TerminalPanel};
@@ -1,4 +1,4 @@
1
- var e={chat:`Sessione`,agents:`Agenti`,history:`Cronologia`,files:`File`,changes:`Modifiche`,mailbox:`Posta`,skills:`Skill`,worktrees:`Worktree`,design:`Design Studio`,settings:`Impostazioni`,sddhub:`SDD`,goal:`Goal`,memory:`Memoria`,fleet:`Flotta`,inspector:`Ispettore`,prompts:`Prompt`,kanban:`Kanban`,codemap:`CodeMap`,techstack:`TechStack`,chronicle:`Chronicle`,intake:`Requisiti`,roster:`Roster agenti`,chimera:`Revisioni Chimera`},t={returnToChat:`{{name}} — torna alla chat`,returnToChatDefault:`WrongStack — torna alla chat`},n={connected:`Connesso`,disconnected:`Disconnesso`,idle:`Inattivo`,thinking:`In riflessione`,running:`In esecuzione`,waiting:`In attesa`,done:`Completato`,stopped:`Fermato`},r={moreWithHidden:`Altro, {{count}} elementi nascosti`,moreOptions:`Altre opzioni`,moreCompactHidden:`Altro — {{count}} pannelli/viste nascosti, palette, tema, monitor`,moreCompact:`Altro — palette, tema, monitor`,moreFull:`Altro — palette, tema, scorciatoie, monitor`,commandPalette:`Palette dei comandi`,keyboardShortcuts:`Scorciatoie da tastiera`,panels:`Pannelli`,views:`Viste`,theme:`Tema`,monitors:`Monitor`,fleetMonitor:`Ispettore della flotta`},i={dragHint:`Trascina per ridimensionare · doppio clic per ripristinare`,collapse:`Comprimi pannello (Ctrl+\\)`},a={openDashboard:`Apri dashboard delle sessioni`},o={pending:`in attesa…`,empty:`Nessun agente`,emptyHint:`I sotto-agenti appaiono qui quando la flotta è attiva.`,runningCount:`{{count}} in esecuzione`,totalCount:`{{count}} totali`,openFull:`Apri ispettore della flotta`,agentsLive:`AGENTI · LIVE`,doneCount:`{{count}} completati`,failedCount:`{{count}} falliti`,modelsLabel:`modelli`,shownLabel:`mostrati`,totalLabel:`totale`,leaderFleetTotals:`(leader {{leader}} · flotta {{fleet}})`,navHintJk:`j/k o ↑↓ per navigare`,escCloseDetail:`· Esc per chiudere il dettaglio`,noAgentsRunning:`Nessun agente in corso.`,contextUsage:`Utilizzo contesto`,lastToolLabel:`ultimo:`,unknownSession:`Sessione sconosciuta`,sessionCopyTitle:`Sessione: {{sid}} — clicca per copiare`,sessionWord:`sessione`,agentsCountSuffix_one:`{{count}} agente`,agentsCountSuffix_other:`{{count}} agenti`,sessionTitle:`Sessione: {{sid}}`,projectSuffix:` · Progetto: {{name}}`,statusIdle:`inattivo`,filterAll:`Tutti`,filterRunning:`In esecuzione`,filterDone:`Completati`,filterCompleted:`Completati`,filterFailed:`Falliti`,clearFinished:`Rimuovi`,clearFinishedTitle:`Rimuovi gli agenti terminati`,rosterHint:`Frecce per navigare · Invio per espandere`,itSuffix:`it.`,tcSuffix:`ch.`,toolLog:`Registro strumenti`,showAll:`Mostra tutti`,showFewer:`Mostra meno`,streaming:`In diretta`,failure:`Errore`,timeout:`Tempo scaduto`,reRun:`Esegui di nuovo`,reRunTitle:`Esegui di nuovo questo agente (non ancora implementato)`,lastToolCalls_one:`Ultima {{count}} chiamata strumento`,lastToolCalls_other:`Ultime {{count}} chiamate strumento`,config:`Configurazione`,configProvider:`Provider`,configModel:`Modello`,configDescription:`Descrizione`,configTaskId:`ID attività`,transcript:`Trascrizione`,openInspector:`Apri nell’ispettore della flotta`,openChat:`Apri chat`,leaderTab:`Leader`,tabsLabel:`Cambia vista agente`,emptyFilteredTitle:`Nessun agente corrisponde al filtro`,emptyFilteredHint:`Modifica o cancella il filtro per vedere tutti gli agenti.`,emptyFilteredClear:`Mostra tutti`,emptyFinishedTitle:`Tutte le attività sono complete`,emptyFinishedHint:`Tutti gli agenti hanno terminato: rimuovi quelli conclusi o crea nuove attività per vedere qui l’attività.`,emptyFinishedStats:`{{completed}} completati · {{failed}} falliti`},s={fileCount_one:`{{count}} file`,fileCount_other:`{{count}} file`,refreshTitle:`Aggiorna modifiche`,loading:`Caricamento modifiche…`,clean:`Nessuna modifica — l'albero di lavoro è pulito.`,selectPrompt:`Seleziona un file modificato per vederne il diff.`,unified:`Unificato`,unifiedTitle:`Diff unificato`,edit:`Modifica`,editTitle:`Diff side-by-side modificabile`,loadingDiff:`Caricamento diff…`,diffTimeout:`Il diff non è arrivato. Il file potrebbe essere cambiato o la connessione persa.`,binary:`File binario — diff non mostrato.`,tooLarge:`File troppo grande per il diff.`},c={openAgentsPanel:`Apri pannello agenti (flotta live)`,hidePanel:`Nascondi pannello Ispettore`,label:`Ispettore`,openAudit:`Apri scheda Audit`,tabFleet:`Flotta`,tabAgents:`Agenti`,tabAudit:`Audit`,tabCouncil:`Council`,councilCount:`{{count}} panel`,councilCount_other:`{{count}} panel`,councilClear:`Svuota`,councilEmpty:`In questa sessione non è ancora stato convocato alcun council.`,councilEmptyHint:`Il Brain convoca un panel multi-modello per le domande che raggiungono o superano la sua soglia di rischio council. Configurabile in Impostazioni › Brain › Council.`,collapseAria:`Comprimi pannello Ispettore`,collapseTitle:`Comprimi (Esc)`,noAgentsActive:`Nessun agente attivo`,agentsAppearHint:`Gli agenti appaiono qui quando la flotta è attiva.`,selected:`{{name}} (selezionato)`},l={header:`Prossimi passi`,autoSubmitting:`invio automatico tra`,clickToFill:`clic per compilare`,clickToFillTitle:`Clic per compilare: {{text}}`,auto:`auto`,willAutoSubmit:`Invio automatico dopo il countdown`,autoFilling:`Compilazione in corso`,autoModeIdle:`Auto — in attesa del marcatore auto="true"`,nSelected:`{{count}} selezionati`,submitN:`Invia {{count}}`,deselectTitle:`Deseleziona`,selectTitle:`Seleziona per l'invio in batch`,nSelected_one:`{{count}} selezionato`,nSelected_other:`{{count}} selezionati`,submitN_one:`Invia {{count}}`,submitN_other:`Invia {{count}}`},u={onlineCount:`{{count}} online`,messages:`Messaggi`,compose:`Scrivi messaggio`,recipient:`Destinatario`,messageType:`Tipo`,audience:`Destinatari`,audienceAll:`Tutti gli agenti`,audienceLeaders:`Solo leader`,priority:`Priorità`,priorityLow:`Bassa`,priorityNormal:`Normale`,priorityHigh:`Alta`,subjectPlaceholder:`Oggetto (facoltativo)`,bodyPlaceholder:`Messaggio`,leadersOnlyHint:`Solo gli agenti leader e le interfacce leader possono ricevere questo messaggio.`,leadersLabel:`leader`,send:`Invia`,sending:`Invio…`,sent:`Inviato`,sendFailed:`Invio del messaggio non riuscito.`,defaultSubject:`Messaggio WebUI`,deleteAllTitle:`Elimina tutti i messaggi`,deleteAll:`Elimina tutti`,deleting:`Eliminazione…`,purgeTitle:`Purga messaggi obsoleti/orfani`,purge:`Purga`,purging:`Pulizia…`,compact:`Compatta`,compacting:`Compattazione…`,compactTitle:`Compattazione auto: rimuovi scaduti, letti-da-tutti e obsoleti`,compactRemoved:`{{count}} rimossi`,compactExpired:`{{count}} scaduti`,compactReadByAll:`{{count}} letti da tutti`,compactStale:`{{count}} obsoleti`,compactRemaining:`{{count}} rimanenti`,newLabel:`NUOVO`,empty:`Nessun messaggio.`,offlineCount:`+{{count}} offline`,timeNow:`ora`,deleteAllConfirmTitle_one:`Eliminare {{count}} messaggio?`,deleteAllConfirmTitle_other:`Eliminare tutti i {{count}} messaggi?`,deleteAllConfirmBody:`Il file della mailbox viene troncato per ogni agente. Operazione irreversibile.`,purgeConfirmTitle:`Purgare i messaggi obsoleti?`,purgeConfirmBody:`Rimuove i messaggi completati più vecchi di 1 giorno e quelli incompleti più vecchi di 7 giorni. I messaggi attivi vengono conservati.`,type:{note:`Nota`,ask:`Domanda`,assign:`Assegnazione`,steer:`Dirigi`,btw:`A proposito`,broadcast:`Broadcast`,status:`Stato`,result:`Risultato`,review:`Revisione`},emptyDetail:`Nessun messaggio selezionato`,emptyDetailHint:`Clicca un messaggio nel pannello Mailbox per vederlo qui.`,readBy:`Letto da`,backToChat:`Torna alla chat`,completed:`Completato`,everyone:`tutti`,closeTitle:`Chiudi (Esc)`,replyTo:`In risposta a: {{id}}`,completedBy:`Completato da {{name}}`,completedByAt:`Completato da {{name}} il {{time}}`,outcome:`Risultato:`,task:`Attività:`,messageNotFound:`Messaggio non trovato`,messageNotFoundHint:`Questo messaggio potrebbe essere stato eliminato o rimosso.`,sessionLabel:`Sessione`,sessionScope:`Sessione {{sid}}`,sessionScopeTitle:`Consegnato solo agli agenti nella sessione {{sid}}`,projectLabel:`Progetto`,projectScope:`Progetto (ogni agente)`,directScope:`Diretto`,scopeLabel:`Ambito`},d={recentSessions:`Sessioni recenti`,deleteEmptyTitle_one:`Eliminare {{count}} sessione vuota?`,deleteEmptyTitle_other:`Eliminare {{count}} sessioni vuote?`,deleteEmptyConfirmBody:`Le sessioni senza utilizzo di token vengono rimosse dal disco.`,filterPlaceholder:`Filtra per titolo, modello, provider…`,clearFilter:`Cancella filtro`,noHistory:`Nessuna cronologia`,noHistoryHint:`Le tue conversazioni appariranno qui`,noMatches:`Nessuna corrispondenza`,noMatchesHint:`Prova un filtro diverso`,group:{favorites:`Preferiti`,today:`Oggi`,yesterday:`Ieri`,thisWeek:`Questa settimana`,earlier:`Precedenti`},nicknamePlaceholder:`Soprannome`,empty:`(vuoto)`,resuming:`riprende…`,active:`attiva`,activeTab:`Scheda attiva`,tabNumber:`Scheda {{count}}`,renameTitleNickname:`{{nickname}} — originale: {{title}}`,renameTitle:`{{title}}
1
+ var e={chat:`Sessione`,agents:`Agenti`,history:`Cronologia`,files:`File`,changes:`Modifiche`,mailbox:`Posta`,skills:`Skill`,worktrees:`Worktree`,design:`Design Studio`,settings:`Impostazioni`,sddhub:`SDD`,goal:`Goal`,memory:`Memoria`,fleet:`Flotta`,inspector:`Ispettore`,prompts:`Prompt`,kanban:`Kanban`,codemap:`CodeMap`,techstack:`TechStack`,chronicle:`Chronicle`,intake:`Requisiti`,roster:`Roster agenti`,chimera:`Revisioni Chimera`},t={returnToChat:`{{name}} — torna alla chat`,returnToChatDefault:`WrongStack — torna alla chat`},n={connected:`Connesso`,disconnected:`Disconnesso`,idle:`Inattivo`,thinking:`In riflessione`,running:`In esecuzione`,waiting:`In attesa`,done:`Completato`,stopped:`Fermato`},r={moreWithHidden:`Altro, {{count}} elementi nascosti`,moreOptions:`Altre opzioni`,moreCompactHidden:`Altro — {{count}} pannelli/viste nascosti, palette, tema, monitor`,moreCompact:`Altro — palette, tema, monitor`,moreFull:`Altro — palette, tema, scorciatoie, monitor`,commandPalette:`Palette dei comandi`,keyboardShortcuts:`Scorciatoie da tastiera`,panels:`Pannelli`,views:`Viste`,theme:`Tema`,monitors:`Monitor`,fleetMonitor:`Ispettore della flotta`},i={dragHint:`Trascina per ridimensionare · doppio clic per ripristinare`,collapse:`Comprimi pannello (Ctrl+\\)`},a={openDashboard:`Apri dashboard delle sessioni`},o={pending:`in attesa…`,empty:`Nessun agente`,emptyHint:`I sotto-agenti appaiono qui quando la flotta è attiva.`,runningCount:`{{count}} in esecuzione`,totalCount:`{{count}} totali`,openFull:`Apri ispettore della flotta`,agentsLive:`AGENTI · LIVE`,doneCount:`{{count}} completati`,failedCount:`{{count}} falliti`,modelsLabel:`modelli`,shownLabel:`mostrati`,totalLabel:`totale`,leaderFleetTotals:`(leader {{leader}} · flotta {{fleet}})`,navHintJk:`j/k o ↑↓ per navigare`,escCloseDetail:`· Esc per chiudere il dettaglio`,noAgentsRunning:`Nessun agente in corso.`,contextUsage:`Utilizzo contesto`,lastToolLabel:`ultimo:`,unknownSession:`Sessione sconosciuta`,sessionCopyTitle:`Sessione: {{sid}} — clicca per copiare`,sessionWord:`sessione`,agentsCountSuffix_one:`{{count}} agente`,agentsCountSuffix_other:`{{count}} agenti`,sessionTitle:`Sessione: {{sid}}`,projectSuffix:` · Progetto: {{name}}`,statusIdle:`inattivo`,filterAll:`Tutti`,filterRunning:`In esecuzione`,filterDone:`Completati`,filterCompleted:`Completati`,filterFailed:`Falliti`,clearFinished:`Rimuovi`,clearFinishedTitle:`Rimuovi gli agenti terminati`,rosterHint:`Frecce per navigare · Invio per espandere`,itSuffix:`it.`,tcSuffix:`ch.`,toolLog:`Registro strumenti`,showAll:`Mostra tutti`,showFewer:`Mostra meno`,streaming:`In diretta`,failure:`Errore`,timeout:`Tempo scaduto`,reRun:`Esegui di nuovo`,reRunTitle:`Esegui di nuovo questo agente (non ancora implementato)`,lastToolCalls_one:`Ultima {{count}} chiamata strumento`,lastToolCalls_other:`Ultime {{count}} chiamate strumento`,config:`Configurazione`,configProvider:`Provider`,configModel:`Modello`,configDescription:`Descrizione`,configTaskId:`ID attività`,transcript:`Trascrizione`,openInspector:`Apri nell’ispettore della flotta`,openChat:`Apri chat`,leaderTab:`Leader`,tabsLabel:`Cambia vista agente`,moreTabsTitle:`Altri agenti ({{n}})`,closeTab:`Chiudi {{name}}`,emptyFilteredTitle:`Nessun agente corrisponde al filtro`,emptyFilteredHint:`Modifica o cancella il filtro per vedere tutti gli agenti.`,emptyFilteredClear:`Mostra tutti`,emptyFinishedTitle:`Tutte le attività sono complete`,emptyFinishedHint:`Tutti gli agenti hanno terminato: rimuovi quelli conclusi o crea nuove attività per vedere qui l’attività.`,emptyFinishedStats:`{{completed}} completati · {{failed}} falliti`},s={fileCount_one:`{{count}} file`,fileCount_other:`{{count}} file`,refreshTitle:`Aggiorna modifiche`,loading:`Caricamento modifiche…`,clean:`Nessuna modifica — l'albero di lavoro è pulito.`,selectPrompt:`Seleziona un file modificato per vederne il diff.`,unified:`Unificato`,unifiedTitle:`Diff unificato`,edit:`Modifica`,editTitle:`Diff side-by-side modificabile`,loadingDiff:`Caricamento diff…`,diffTimeout:`Il diff non è arrivato. Il file potrebbe essere cambiato o la connessione persa.`,binary:`File binario — diff non mostrato.`,tooLarge:`File troppo grande per il diff.`},c={openAgentsPanel:`Apri pannello agenti (flotta live)`,hidePanel:`Nascondi pannello Ispettore`,label:`Ispettore`,openAudit:`Apri scheda Audit`,tabFleet:`Flotta`,tabAgents:`Agenti`,tabAudit:`Audit`,tabCouncil:`Council`,councilCount:`{{count}} panel`,councilCount_other:`{{count}} panel`,councilClear:`Svuota`,councilEmpty:`In questa sessione non è ancora stato convocato alcun council.`,councilEmptyHint:`Il Brain convoca un panel multi-modello per le domande che raggiungono o superano la sua soglia di rischio council. Configurabile in Impostazioni › Brain › Council.`,collapseAria:`Comprimi pannello Ispettore`,collapseTitle:`Comprimi (Esc)`,noAgentsActive:`Nessun agente attivo`,agentsAppearHint:`Gli agenti appaiono qui quando la flotta è attiva.`,selected:`{{name}} (selezionato)`},l={header:`Prossimi passi`,autoSubmitting:`invio automatico tra`,clickToFill:`clic per compilare`,clickToFillTitle:`Clic per compilare: {{text}}`,auto:`auto`,willAutoSubmit:`Invio automatico dopo il countdown`,autoFilling:`Compilazione in corso`,autoModeIdle:`Auto — in attesa del marcatore auto="true"`,nSelected:`{{count}} selezionati`,submitN:`Invia {{count}}`,deselectTitle:`Deseleziona`,selectTitle:`Seleziona per l'invio in batch`,nSelected_one:`{{count}} selezionato`,nSelected_other:`{{count}} selezionati`,submitN_one:`Invia {{count}}`,submitN_other:`Invia {{count}}`},u={onlineCount:`{{count}} online`,messages:`Messaggi`,compose:`Scrivi messaggio`,recipient:`Destinatario`,messageType:`Tipo`,audience:`Destinatari`,audienceAll:`Tutti gli agenti`,audienceLeaders:`Solo leader`,priority:`Priorità`,priorityLow:`Bassa`,priorityNormal:`Normale`,priorityHigh:`Alta`,subjectPlaceholder:`Oggetto (facoltativo)`,bodyPlaceholder:`Messaggio`,leadersOnlyHint:`Solo gli agenti leader e le interfacce leader possono ricevere questo messaggio.`,leadersLabel:`leader`,send:`Invia`,sending:`Invio…`,sent:`Inviato`,sendFailed:`Invio del messaggio non riuscito.`,defaultSubject:`Messaggio WebUI`,deleteAllTitle:`Elimina tutti i messaggi`,deleteAll:`Elimina tutti`,deleting:`Eliminazione…`,purgeTitle:`Purga messaggi obsoleti/orfani`,purge:`Purga`,purging:`Pulizia…`,compact:`Compatta`,compacting:`Compattazione…`,compactTitle:`Compattazione auto: rimuovi scaduti, letti-da-tutti e obsoleti`,compactRemoved:`{{count}} rimossi`,compactExpired:`{{count}} scaduti`,compactReadByAll:`{{count}} letti da tutti`,compactStale:`{{count}} obsoleti`,compactRemaining:`{{count}} rimanenti`,newLabel:`NUOVO`,empty:`Nessun messaggio.`,offlineCount:`+{{count}} offline`,timeNow:`ora`,deleteAllConfirmTitle_one:`Eliminare {{count}} messaggio?`,deleteAllConfirmTitle_other:`Eliminare tutti i {{count}} messaggi?`,deleteAllConfirmBody:`Il file della mailbox viene troncato per ogni agente. Operazione irreversibile.`,purgeConfirmTitle:`Purgare i messaggi obsoleti?`,purgeConfirmBody:`Rimuove i messaggi completati più vecchi di 1 giorno e quelli incompleti più vecchi di 7 giorni. I messaggi attivi vengono conservati.`,type:{note:`Nota`,ask:`Domanda`,assign:`Assegnazione`,steer:`Dirigi`,btw:`A proposito`,broadcast:`Broadcast`,status:`Stato`,result:`Risultato`,review:`Revisione`},emptyDetail:`Nessun messaggio selezionato`,emptyDetailHint:`Clicca un messaggio nel pannello Mailbox per vederlo qui.`,readBy:`Letto da`,backToChat:`Torna alla chat`,completed:`Completato`,everyone:`tutti`,closeTitle:`Chiudi (Esc)`,replyTo:`In risposta a: {{id}}`,completedBy:`Completato da {{name}}`,completedByAt:`Completato da {{name}} il {{time}}`,outcome:`Risultato:`,task:`Attività:`,messageNotFound:`Messaggio non trovato`,messageNotFoundHint:`Questo messaggio potrebbe essere stato eliminato o rimosso.`,sessionLabel:`Sessione`,sessionScope:`Sessione {{sid}}`,sessionScopeTitle:`Consegnato solo agli agenti nella sessione {{sid}}`,projectLabel:`Progetto`,projectScope:`Progetto (ogni agente)`,directScope:`Diretto`,scopeLabel:`Ambito`},d={recentSessions:`Sessioni recenti`,deleteEmptyTitle_one:`Eliminare {{count}} sessione vuota?`,deleteEmptyTitle_other:`Eliminare {{count}} sessioni vuote?`,deleteEmptyConfirmBody:`Le sessioni senza utilizzo di token vengono rimosse dal disco.`,filterPlaceholder:`Filtra per titolo, modello, provider…`,clearFilter:`Cancella filtro`,noHistory:`Nessuna cronologia`,noHistoryHint:`Le tue conversazioni appariranno qui`,noMatches:`Nessuna corrispondenza`,noMatchesHint:`Prova un filtro diverso`,group:{favorites:`Preferiti`,today:`Oggi`,yesterday:`Ieri`,thisWeek:`Questa settimana`,earlier:`Precedenti`},nicknamePlaceholder:`Soprannome`,empty:`(vuoto)`,resuming:`riprende…`,active:`attiva`,activeTab:`Scheda attiva`,tabNumber:`Scheda {{count}}`,renameTitleNickname:`{{nickname}} — originale: {{title}}`,renameTitle:`{{title}}
2
2
 
3
3
  Doppio clic per rinominare`,unfavorite:`Rimuovi dai preferiti`,markFavorite:`Segna come preferito`,deleteSessionConfirmTitle:`Eliminare la sessione?`,deleteSessionConfirmBody:`"{{name}}" verrà rimossa dal disco. Operazione irreversibile.`,deleteSessionTitle:`Elimina sessione`,deleteKeptLastTab:`Sessione non eliminata: almeno una scheda deve rimanere aperta.`,closeOngoingTabTitle:`In questa sessione è in corso un'operazione`,closeOngoingTabQuestion:`Vuoi davvero chiudere questa scheda?`,closeHistoryTabTitle:`Chiudere questa scheda?`,closeHistoryTabMessage:`Questa scheda contiene cronologia dell'agente. Vuoi davvero chiuderla?`,closeTabAction:`Chiudi scheda`,warnLeaderRunning:`Esecuzione del leader in corso`,warnSubagentLine:`{{name}} — in esecuzione{{suffix}}`,warnFinishedAgents:`{{count}} sottoagenti terminati in registro`,warnQueuedMessages:`{{count}} messaggi in coda`,stillRunningToast:`"{{title}}" continua in background:
4
4
  {{lines}}`,interruptAndClose:`Interrompi e chiudi`,allTabsRunning:`Tutti e 4 gli slot delle schede sono occupati. Chiudi una scheda prima di aprire una nuova sessione.`,rename:`Rinomina sessione`,renameAction:`Rinomina`,resume:`Riprendi sessione`,resumeShort:`Riprendi`,workspaceEyebrow:`Controllo sessione`,workspaceTitle:`Sessioni`,workspaceHint:`Cerca, ispeziona, fissa e riprendi tutte le conversazioni del progetto.`,tabs:{history:`Cronologia`,live:`Sessioni attive`},filters:{all:`Tutte`,favorites:`Preferite`,active:`Attive`,completed:`Completate`,issues:`Problemi`},status:{active:`Attiva`,completed:`Completata`,error:`Errore`,timeout:`Timeout`,aborted:`Annullata`,saved:`Sessione salvata`},sort:{label:`Ordina sessioni`,recent:`Più recenti`,tokens:`Più token`,activity:`Più attività`},stats:{sessions:`Sessioni`,tokens:`Token`,tools:`Chiamate strumenti`,files:`File modificati`,errors:`Errori`},inspect:`Ispeziona sessione`},f={actions:{abort:`Interrompi`,newSession:`Nuova sessione`,export:`Esporta`,compact:`Comprimi`,newSessionConfirm:`Confermi?`,newSessionConfirmMessage:`Un'attività è ancora in corso. Avviare comunque una nuova sessione?`,newSessionTitle:`Avvia una nuova sessione (Ctrl+N)`,exportTitle:`Esporta la chat come markdown (Ctrl+E)`,compactTitle:`Comprimi la finestra di contesto`,clearTitle:`Cancella il contesto (Ctrl+L)`},model:`Modello`,modelTitle:`Cambia modello (Ctrl+M)`,context:`Contesto`,contextTitle:`Clicca per un dettaglio del contesto`,sessionLabel:`Sessione`,stats:{messages:`Messaggi`,elapsed:`Trascorso`,tokens:`Token`,cost:`Costo`,iteration:`Iterazione`,agents:`Agenti`,tokensSub:`{{in}} in / {{out}} out`,iterationOf:`di {{max}}`,agentsRunning:`{{count}} in esecuzione`},plan:`Piano`,planComplete:`{{pct}}% completato`,pinned:`Fissati`,quickSettings:`Impostazioni rapide`,autonomy:`Autonomia`,autonomyTitle:`Interrompi l'esecuzione automatica dei passaggi successivi. Disattiva per fermare il ciclo autonomo dell'agente`,autonomyOptions:{off:`Off`,suggest:`Suggerisci`,auto:`Auto`,eternal:`Perpetuo`,"eternal-parallel":`Perpetuo Parallelo`},yolo:`Modalità YOLO`,yoloTitle:`Ignora le conferme degli strumenti`,refine:`Affina i prompt`,refineTitle:`Riscrivi i prompt prima dell'invio`,sound:`Suono al completamento`,soundTitle:`Riproduci un dolce suono al termine di un'esecuzione`,sessionId:`sessione {{id}}`},p={status:{running:`in esecuzione`,completed:`completato`,failed:`fallito`,timeout:`timeout`,stopped:`fermato`},leader:`leader`,providerModel:`Provider / Modello`,elapsed:`Trascorso`,running:`in corso…`,iterations:`Iterazioni`,toolCalls:`Chiamate strum.`,cost:`Costo`,budgetExtensions:`Estensioni budget`,activity:`Attività`,contextWindow:`Finestra di contesto`,tokensUsed:`{{used}} / {{max}} token`,toolRunning:`in esecuzione…`,lastTool:`ultimo strumento`,error:`Errore`,finalOutput:`Output finale`,copyOutput:`Copia output`,liveOutput:`Output live`,waitingOutput:`In attesa di output…`,outputHint:`L'output appare qui mentre l'agente trasmette il testo.`,toolLog:`Log strumenti ({{count}} chiamate)`,fail:`fallito`,moreTools:`+{{count}} altri strumenti`,cardRunning:`in esecuzione {{tool}}`,cardLastTool:`ultimo: {{tool}}`,contextPercent:`Contesto {{pct}}%`,doneCount:`{{count}} completati`,errCount:`{{count}} err`,statusRunning:`in corso`,statusDone:`completato`,statusFailed:`fallito`,statusTimeout:`timeout`,statusStopped:`fermato`,hittingLimitTitle:`⚡ raggiunge il limite {{kind}} ({{used}}/{{limit}})`,budgetExt_one:`{{count}} estensione budget`,budgetExt_other:`{{count}} estensioni budget`,extendedTimes_one:`L'agente ha esteso il budget {{count}} volta per attività lunghe`,extendedTimes_other:`L'agente ha esteso il budget {{count}} volte per attività lunghe`,errorLabel:`Errore`,failureReason:`Motivo fallimento`,failed:`Fallito`},m={wsNotConnected:`WebSocket non connesso`,noData:`Nessun dato di debug ricevuto. Il server potrebbe non supportare il debug del contesto.`,title:`Dettaglio contesto`,windowUsage:`Utilizzo finestra`,contextMode:`Modalità contesto`,fetching:`Recupero del dettaglio del contesto…`,systemPrompt:`Prompt di sistema`,tools:`Strumenti`,messages:`Messaggi`,tokenAllocation:`Allocazione token`,systemTitle:`Sistema: {{tokens}}`,toolsTitle:`Strumenti: {{tokens}}`,messagesTitle:`Messaggi: {{tokens}}`,system:`Sistema`,toolBreakdown:`Dettaglio strumenti`,messagesSummary:`Messaggi ({{count}}) — {{total}} tok`,barWithTokens:`Finestra di contesto: {{tokens}} / {{max}} token ({{pct}})`,barPct:`Finestra di contesto: {{pct}}`,barClick:` — clicca per il dettaglio`},h={header:`✨ Affina prompt`,autoSend:`invio automatico in {{count}} s`,cancelTitle:`Annulla (Esc)`,editLabel:`Modifica il prompt affinato:`,editPlaceholder:`Modifica il prompt affinato...`,useEdit:`Usa modifica`,original:`Originale`,refined:`Affinato`,yourLanguage:`(la tua lingua)`,refinedTitle:`Clicca o premi Invio per usare questa versione`,copyToInputTitle:`Copia nell'input senza inviare`,english:`Inglese`,englishTitle:`Premi e per la versione inglese`,hintRefined:`affinato`,hintEnglish:`Inglese`,hintOriginal:`originale`,hintEdit:`modifica`,hintRetry:`riprova`,edit:`Modifica`,useRefined:`Usa affinato`,langOriginal:`Original`,langEnglish:`English`,languageTitle:`Cambia la lingua predefinita di rifinitura — Originale o inglese`,yolo:`YOLO`,yoloTitle:`Salta le richieste di conferma degli strumenti`,refining:`Refining…`,sendAsIs:`Send as-is`,failedHeader:`Refinement failed`,retry:`Retry (more time)`,retryBetter:`Riprova meglio`,retryFallback:`Retry with {{model}}`,pickModel:`Another model…`,pickModelTitle:`Riprova la rifinitura con un altro modello`,pickModelHint:`Scegli un provider/modello su cui rieseguire questa rifinitura. Il modello della sessione resta invariato.`,countdownHeader:`✨ Il perfezionamento inizia tra…`,countdownYourMessage:`Il tuo messaggio`,countdownHint:`Il perfezionamento inizia tra {{seconds}}s. Clicca "Invia tale quale" per saltare.`,countdownStartNow:`Perfeziona ora`,countdownSendAsIs:`Invia tale quale`,cancelRefineSendOriginal:`Annulla e invia originale`},g={heading:`Specifiche`,subtitle:`Visualizza e gestisci lo sviluppo guidato dalle specifiche`,empty:`Nessuna spec trovata. Usa {{command}} per crearne una.`,tasks:`Attività ({{count}})`,doneCount:`{{count}} completate`,runningCount:`{{count}} in corso`,pendingCount:`{{count}} in attesa`,runTitle:`Esegui questa spec come un job multi-agente live`,run:`Esegui`,runAsSdd:`Esegui come SDD`,runAsSddTitle:`Avvia un run SDD multi-agente in parallelo (worktree, verifica, board live)`,runAsGoal:`Esegui come Goal`,runAsGoalTitle:`Avvia un Goal a fasi dalle colonne attività di questa spec`,list:`Lista`,graph:`Grafo`,loadingTasks:`Caricamento attività…`},_={heading:`Verificatore di resilienza F5`,subtitle:`Conferma che l'ultima sessione attiva, la trascrizione e lo stato UI sopravvivono a un aggiornamento della pagina. Apri questa vista, poi premi F5 — ogni riga verde dovrebbe restare verde.`,recordProbe:`Registra sondaggio`,latestSession:`Ultima sessione attiva`,restoredLocal:`Ripristinato da localStorage`,sessionIdExtra:`id sessione: {{id}}`,noSessionYet:`nessuna sessione è ancora stata avviata`,activePointer:`Puntatore sessione attiva`,lastVisited:`timestamp lastVisitedAt`,never:`mai`,persistedEnv:`Ambiente persistente`,transcriptRehydrate:`Reidratazione trascrizione chat`,localTranscript:`Trascrizione locale recuperata`,messagesExtra:`{{count}} messaggi, {{queued}} in coda`,noMessages:`0 messaggi`,noBleed:`Nessuna perdita tra sessioni`,bleedExtra:`collegato={{bound}} vs attivo={{active}}`,transcriptBinds:`la trascrizione si lega alla sessione attiva`,uiWorkspace:`Area di lavoro UI`,noneValue:`(nessuno)`,payloadSize:`Carico utile localStorage (4 chiavi): {{count}} caratteri`,probeLog:`Registro sondaggi`,noProbes:`Nessun sondaggio ancora — premi il pulsante "Registra sondaggio" in alto, oppure F5 in questa vista, per registrare un controllo di reidratazione.`,simulatedF5:`F5 simulato: riesecuzione di persist rehydrate`},v={status:{pending:`In attesa`,in_progress:`In corso`,review:`Revisione`,failed:`Fallito`,completed:`Completato`,queued:`In coda`,blocked:`Bloccato`,cancelled:`Annullato`},newTaskTitle:`Nuova attività`,newTaskPlaceholder:`Titolo attività…`,addTask:`Aggiungi attività`,empty:`Nessuna fase ancora — avvia un'esecuzione Goal per popolare la bacheca.`,summary:`{{phases}} fasi · {{tasks}} attività`,phases:`Fasi`,statusTab:`Stato`,dropHere:`Trascina le attività qui`,emptySpec:`Nessuna attività in questa spec ancora.`,depGraphHeading:`Grafo delle dipendenze`,worktreePrefix:`worktree: {{branch}}`},y={trendUp:`In aumento`,trendDown:`In diminuzione`,trendStable:`Stabile`,heading:`Dashboard di debug`,subtitle:`Monitoraggio in tempo reale per WrongStack WebUI`,refreshLabel:`Aggiorna:`,lastUpdated:`Ultimo aggiornamento: {{time}}`,fetchFailed:`Recupero delle metriche non riuscito`,fileWatcher:`File Watcher`,watcherStatus:`Stato watcher`,running:`In esecuzione`,stopped:`Fermo`,activeProjects:`Progetti attivi`,projectsWatched:`Progetti monitorati`,fileChanges:`Modifiche file`,totalDetected:`Totale rilevato`,filesProcessed:`File elaborati`,afterHash:`Dopo filtro hash`,broadcastsSent:`Broadcast inviati`,toClients:`Ai client WebUI`,debounceResets:`Reset debounce`,rapidWrites:`Scritture rapide successive`,avgDebounce:`Ritardo debounce medio`,actualDelay:`Ritardo effettivo applicato`,totalDelay:`Ritardo totale`,sumDelays:`Somma di tutti i ritardi`,browserPerf:`Prestazioni browser`,heapUsed:`Heap usato`,jsHeap:`Heap JavaScript`,heapTotal:`Heap totale`,totalHeap:`Dimensione totale heap`,pageUptime:`Tempo di attività pagina`,sinceLoad:`Dal caricamento`,rawData:`Dati grezzi`},b={allowlistTitle:`Elenco modelli consentiti`,modelCount_one:`{{count}} modello`,modelCount_other:`{{count}} modelli`,using:`In uso`,noModelPicked:`(nessun modello scelto)`,clearAllowlist:`Cancella allowlist`,clearAllowlistAria:`Cancella l'allowlist salvata per {{provider}}`,refresh:`Aggiorna dal server`,refreshAria:`Aggiorna l'elenco modelli per {{provider}}`,probing:`Verifica…`,searchPlaceholder:`Cerca modelli…`,use:`Usa`,useModelAria:`Usa il modello {{model}} per {{provider}}`},x={expandChip:`Espandi {{label}}`,collapseChip:`Comprimi {{label}}`,ahead:`{{count}} in avanti`,behind:`{{count}} indietro`,linesAdded:`{{count}} righe aggiunte`,linesDeleted:`{{count}} righe eliminate`,untrackedFiles:`{{count}} file non tracciati`,customizeTitle:`Personalizza chip del dock`,dockChips:`Chip del dock`,noActiveGoal:`Nessun obiettivo attivo`,noActiveGoalDetail:`Avvia un obiettivo dalla chat o dal comando goal.`,closeWorkspaceInspector:`Chiudi l'ispettore del workspace`,goal:`Obiettivo`,goalState:`Stato dell'obiettivo`,goalStateDetail:`Obiettivo attivo e avanzamento`,fleet:`Flotta`,fleetDetail:`Roster degli agenti in tempo reale e attività`,work:`Lavoro`,workDetail:`To-do, attività e piano`,worktrees:`Worktree`,worktreesDetail:`Rami e corsie paralleli`,collab:`Collab`,collabDetail:`Partecipanti alla sessione e controlli`,inspector:`Ispettore del workspace`,inspectorNamed:`Ispettore del workspace {{name}}`,workspace:`Workspace`,workspaceDetails:`Dettagli del workspace`},S={leaderBadge:`LEADER`,iters:`Iter.`,tools:`Strumenti`,activityBins:`Attività (12 bin)`,streamingOutput:`Output in streaming`,recentTools:`Strumenti recenti`,finalOutput:`Output finale`,heading:`Monitor agenti`,prevAgent:`Agente precedente`,nextAgent:`Agente successivo`,closeAria:`Chiudi monitor agenti`,hintPage:`←→ pagina`,hintNavigate:`↑↓ naviga elenco`,hintEsc:`Esc chiudi`},C={resize:`Ridimensiona terminali`,labelSingular:`Terminale`,labelPlural:`Terminali`,projectShell:`Shell del progetto`,maxTerminals:`Massimo {{count}} terminali`,newTerminal:`Nuovo terminale`,restart:`Riavvia terminale attivo`,closeAll:`Chiudi tutti i terminali`,closeDock:"Chiudi dock del terminale (Ctrl+`)",closeTab:`Chiudi {{name}}`,processExited:`[processo terminato con codice {{code}}]`},w={liveStream:`Stream dal vivo`,events_one:`{{count}} evento`,events_other:`{{count}} eventi`,interruptTitle:`Ferma cooperativamente questo agente al prossimo passo (non un kill)`,interrupt:`⏸ Interrompi`,interrupting:`…`,loading:`Caricamento sessione…`,done:`✓✓ fatto`,read:`✓ letto`,delivered:`⏳ consegnato`,agent:`Agente`,you:`Tu`,working:`{{name}} · in lavoro`,claude:`Claude`,priority:`Priorità`,placeholder:`{{label}} → questa sessione…`,send:`Invia`,sendHint:`⌘/Ctrl+Invio per inviare · visibile alla prossima iterazione dell'agente`,msgType:{steerLabel:`🔄 Dirigi`,steerHint:`Regola il comportamento durante l'attività`,askLabel:`❓ Chiedi`,askHint:`Domanda — attende una risposta`,assignLabel:`📋 Assegna`,assignHint:`Un'attività da svolgere`,noteLabel:`💬 Nota`,noteHint:`Per info, non urgente`},sentRunning:`Consegnato — l'agente in esecuzione lo vedrà al prossimo passo`,sentIdle:`Consegnato — il target è inattivo; appare nella sua mailbox, letto alla prossima esecuzione`,sentFailed:`Non riuscito: {{error}}`,interruptReason:`L'operatore ha richiesto l'arresto da Fleet HQ`,interruptSent:`Interruzione inviata — l'agente si ferma al prossimo passo (non un kill)`,interruptFailed:`Interruzione non riuscita: {{error}}`},T={empty:`Nessun effetto collaterale registrato ancora.`,emptyHint:`I comandi bash, le installazioni di pacchetti e le richieste di rete appariranno qui.`,heading:`Effetti collaterali`,exportTitle:`Esporta gli effetti collaterali filtrati come CSV`,all:`Tutti`,colTime:`Ora`,colTool:`Strumento`,colRisk:`Rischio`,colDetail:`Dettaglio`,colOutcome:`Esito`},E={elapsedHm:`{{h}}h {{m}}m fa`,elapsedMs:`{{m}}m {{s}}s fa`,elapsedS:`{{s}}s fa`,heading:`Monitor della flotta`,clientsHeading:`Client connessi`,terminal:`Terminale`,webui:`UI Web`,repl:`REPL`,totalConnected:`connessi in totale`,mailQueue:`Coda di posta`,total:`Totale`,open:`Aperti`,unread:`Non letti`,agents:`Agenti`,messagesSub:`messaggi`,uncompletedSub:`non completati`,waitingSub:`in attesa`,ofTotal:`su {{count}} totali`,agentRoster:`Elenco agenti`,liveMailActivity:`Attività posta dal vivo`,noActivity:`Nessuna attività recente`,mailboxAgents:`Agenti mailbox`,noMailboxAgents:`Nessun agente registrato`,moreCount:`+{{count}} altri`,agentFallback:`agente`,fleetAgents:`Agenti flotta`,noFleetAgents:`Nessun agente flotta in esecuzione`,iter:`iter.`,mailType:{sent:`Inviato`,delivered:`Consegnato`,read:`Letto`,completed:`Completato`}},D={status:{pending:`in attesa`,queued:`in coda`,in_progress:`in corso`,blocked:`bloccato`,review:`revisione`,failed:`fallito`,completed:`completato`,cancelled:`annullato`},activityHeading:`Attività`,feedEmpty:`Ancora nulla — gli eventi appaiono qui man mano che gli agenti prendono e completano le attività.`,destroyTitle:`Distruggere il progetto SDD?`,destroyDesc:`Questo cancella il run e il suo lavoro. Non può essere annullato (il revert opzionale preserva la cronologia).`,stopRun:`Ferma il run`,stopRunAgents_one:`Ferma il run ({{count}} agente attivo)`,stopRunAgents_other:`Ferma il run ({{count}} agenti attivi)`,removeWorktreesAll:`Rimuovi tutti i worktree git + branch wstack/ap/* — incluso il lavoro non mergiato`,removeWorktreesCount_one:`Rimuovi {{count}} worktree git + branch wstack/ap/* — incluso il lavoro non mergiato`,removeWorktreesCount_other:`Rimuovi {{count}} worktree git + branch wstack/ap/* — incluso il lavoro non mergiato`,deleteArtifacts:`Elimina tutti gli artefatti SDD (spec, grafo attività, board, sessione)`,revertMerged_one:`Revert anche {{count}} commit mergiato`,revertMerged_other:`Revert anche {{count}} commit mergiati`,revertHint:`Aggiunge commit di revert (cronologia preservata). Rifiutato se l'albero di lavoro è sporco.`,baseBranchFallback:`il branch di base`,noteLeaveMerged:`I commit mergiati resteranno sul branch di base. Spunta la casella sopra per annullare anche quelli.`,noteAbandon:`Assicurati di voler davvero abbandonare questo run.`,destroying:`Distruzione…`,destroyAll:`Distruggi tutto`,kanbanBacklog:`Backlog`,kanbanReady:`Pronto`,kanbanRunning:`In corso`,kanbanReview:`Revisione`,kanbanFailed:`Fallito`,kanbanDone:`Completato`,kanbanEmpty:`vuoto`},O={collapseToLines:`Comprimi alle prime {{count}} righe`,showAllLines:`Mostra tutte le {{total}} righe ({{more}} in più)`,exitCode:`codice di uscita:`,jsonLines:`JSON · {{count}} righe`,collapse:`comprimi`,expand:`espandi`},k={heading:`Design Studio — Galleria`,kitsCount:`{{count}} kit`,searchPlaceholder:`Cerca kit…`,stackTitle:`Stack per Use + Materialize`,wrote:`Scritto {{path}}`,materializeFailed:`Materialize non riuscito: {{error}}`,verifyError:`Verifica: {{error}}`,verifyOffPalette:`Verifica: {{pct}}% on-palette — {{count}} off-palette in {{files}} file`,verifyClean:`Verifica: pulito ✓ ({{files}} file on-palette)`,writing:`Scrittura del file di tema…`,scanning:`Scansione dei file UI…`,active:`Attivo`,reapply:`Riapplica`,use:`Usa`,materializeTitle:`Scrivi i token in un file di tema {{stack}}`,materialize:`Materializza`,verifyTitle:`Scansiona i file UI per colori fuori palette`,verify:`Verifica`,colors:`Colori`},A={summary_one:`{{count}} fase · {{pct}}% completato`,summary_other:`{{count}} fasi · {{pct}}% completato`,switchBoard:`Cambia bacheca`,boardsCount_one:`{{count}} bacheca…`,boardsCount_other:`{{count}} bacheche…`,toggleAutonomousTitle:`Attiva/disattiva modalità autonoma`,autonomous:`Autonomo`,manual:`Manuale`,resumeTitle:`Riprendi l'esecuzione`,pauseTitle:`Sospendi l'esecuzione`,resume:`Riprendi`,pause:`Sospendi`,stopTitle:`Ferma l'esecuzione — annulla immediatamente gli agenti in corso`,stop:`Ferma`,newTitle:`Cancella questa bacheca e avvia una nuova esecuzione Goal`,newLabel:`Nuovo`,revertConfirm:`Annullare i commit dell'esecuzione?`,revertTitle:`Annulla questa esecuzione — git-revert dei commit effettuati e rimozione dei worktree`,revert:`Annulla`,goal:`Obiettivo`,planning:`Pianificazione delle fasi…`,planningBody:`Il tuo obiettivo è stato ricevuto. WrongStack lo sta scomponendo in fasi e attività — la bacheca appare qui appena il piano è pronto.`,startHeading:`Avvia un piano di fasi`,startBody:`Descrivi cosa vuoi costruire. WrongStack pianificherà fasi e attività, poi le eseguirà — osserva e guida l'esecuzione sulla bacheca.`,startPlaceholder:`es. Crea un'API REST per la gestione utenti con Express e SQLite...`,isolateLabel:`Isola ogni fase nel suo worktree git`,startButton:`Avvia Goal`,ctrlHint:`Ctrl+Invio per avviare`,isolateOn:`le fasi girano in worktree isolati, uniti in squash`,isolateOff:`le fasi girano direttamente sul ramo corrente`,lanes:`Corsie`,graph:`Grafo`,planningAck:`🚀 **Goal** — ricevuto. Sto pianificando le fasi per il tuo obiettivo…`,assess:{analyzing:`Analisi dell'ambito dell'obiettivo…`,realistic:`✓ L'ambito sembra realistico`,durationConcern:`⚠ Problema di durata`,durationClaimed:`Durata indicata: {{duration}}`,recommendation:`Consigliato: {{duration}}`,concerns:`Preoccupazioni`,analysisFailed:`Impossibile analizzare l'ambito dell'obiettivo`,override:`Avvia comunque`,overrideTitle:`Cancella l'avviso e abilita il pulsante di avvio`,disableTitle:`Questo obiettivo ha una durata irrealistica — usa "Avvia comunque" per sovrascrivere`},multiBoardLabel:`Dividi in più board kanban`,verifyTasksLabel:`Richiedi verifica per ogni attività`,chimeraReviewLabel:`Abilita revisione automatica chimera`},j={noObservers:`Nessun osservatore dal vivo`,observerTitle:`Entra come osservatore in sola lettura (Fase 1)`,observerRole:`osservatore`,annotatorTitle:`Entra come annotatore — lascia note sugli strumenti (Fase 2)`,annotatorRole:`annotatore`,controllerTitle:`Entra come controllore — può mettere in pausa l'agente (Fase 3)`,controllerRole:`controllore`,errorPrefix:`Collab: {{error}}`,dismiss:`chiudi`,observers_one:`{{count}} osservatore`,observers_other:`{{count}} osservatori`,annotationsTitle:`{{count}} annotazione/i aperte — annotatori in revisione`,notes_one:`{{count}} nota`,notes_other:`{{count}} note`,pausedTitle:`Ciclo agente in pausa — un controllore sta revisionando`,paused:`in pausa`,joinedTitle:`Entrato {{time}}`,grantTitle:`Cedi controllo — promuovi questo partecipante a controllore`,injectTitle:`Inietta un risultato sintetico per una chiamata strumento in corso`,inject:`Inietta`,resumeTitle:`Riprendi il ciclo dell'agente`,resume:`Riprendi`,pauseTitle:`Metti in pausa l'agente prima della prossima chiamata strumento`,pauseAgent:`Metti in pausa agente`,leaveTitle:`Lascia la sessione di osservazione`,leave:`Lascia`,injectToolResult:`Inietta risultato strumento`,close:`chiudi`,targetTool:`id tool_use target`,targetPlaceholder:`scegli una chiamata in corso o digita un id tool_use`,toolFallback:`strumento`,noPendingTools:`Nessuna chiamata strumento in corso — digita un id tool_use o metti prima in pausa l'agente.`,resultContent:`Contenuto risultato`,resultPlaceholder:`Risultato strumento sintetico fornito all'agente al posto dell'esecuzione`,markError:`segna come errore`,reasonPlaceholder:`motivo (registro audit)`,queueInjection:`Metti in coda iniezione`,controllerInjection:`iniezione controllore`},M={connected:`Connesso`,reconnecting:`Riconnessione al backend (tentativo {{attempt}}) — nuovo tentativo tra {{remaining}} s`,disconnected:`Disconnesso dal backend`,retry:`Riprova ora`,retryTitle:`Riprova la connessione ora`,dismissTitle:`Chiudi (il chip nella barra superiore mostra ancora lo stato)`},N={modePrefix:`modalità:`,activeTitle:`Modalità attiva`,heading:`Modalità`,defaultName:`Predefinito`,defaultDesc:`Comportamento standard dell'agente`},P={clickTitle:`Clicca per il dettaglio dei costi per turno`,heading:`Dettaglio costi`,noPricing:`Nessuna tariffazione per il modello attuale — i valori di costo sono zero.`,noTurns:`Nessun turno completato ancora. Esegui un prompt per vedere il costo per turno qui.`,topExpensive_one:`Turno più costoso`,topExpensive_other:`I {{count}} turni più costosi`},F={runDefault:`Predefinito del run`,useRunDefault:`Usa predefinito del run`,filterPlaceholder:`Filtra modelli…`,loading:`Caricamento modelli…`,noMatch:`Nessuna corrispondenza`},I={heading:`Cambia modello`,filterPlaceholder:`Filtra provider e modelli…`,providerFilter:`Provider`,providerFilterAll:`Tutti i provider`,favoritesOnly:`Solo preferiti`,favoriteModel:`Modello preferito`,noFavoritesConfigured:`Nessun modello preferito configurato (aggiungili in Impostazioni → Fallback).`,noFavoritesMatch:`Nessun modello preferito corrisponde al filtro.`,noSavedProviders:`Nessun provider salvato — registra prima una chiave nelle Impostazioni.`,noMatch:`Nessun modello corrispondente`,active:`attivo`},L={todos:`Da fare`,tasks:`Attività`,plan:`Piano`},R={toggleAria:`Attiva/disattiva: {{content}}`,removeTitle:`Rimuovi attività`,removeAria:`Rimuovi "{{content}}"`,completedCount_one:`{{count}} completata`,completedCount_other:`{{count}} completate`,blockedBy:`In attesa di: {{work}}`},z={start:`Avvia`,complete:`Completa`,retry:`Riprova`,assign:`Assegna`,assignTitle:`Assegna agente`,unassigned:`Non assegnato`,statusPending:`In attesa`,statusInProgress:`In corso`,statusBlocked:`Bloccato`,statusFailed:`Fallito`,statusReview:`Revisione`,statusDone:`Completato`,startTitle:`Avvia`,completeTitle:`Completa`,fail:`Fallisci`,failTitle:`Segna come fallito`,boardCount:`{{total}} attività · {{done}} completate`},B={toolCalls_one:`{{count}} chiamata strumento`,toolCalls_other:`{{count}} chiamate strumento`},V={removeTitle:`Rimuovi riferimento`,linesCount_one:`{{count}} riga`,linesCount_other:`{{count}} righe`},H={statusOpen:`Aperto`,statusInProgress:`In corso`,statusDone:`Completato`,startTitle:`Avvia`,doneTitle:`Segna come completato`,reopenTitle:`Riapri`,reopen:`Riapri`},U={heading:`@ File`,noMatch:`Nessun file corrisponde a "{{query}}"`,searching:`Ricerca nel progetto…`,selectInsertEscDismiss:`↑/↓ seleziona · ↵ inserisci · Esc chiudi`},W={dismiss:`Chiudi`},G={placeholder:`Cerca nella chat…`,prevHit:`Risultato precedente`,nextHit:`Risultato successivo`,close:`Chiudi (Esc)`},K={statusPending:`In attesa`,statusReady:`Pronto`,statusRunning:`In esecuzione`,statusPaused:`In pausa`,statusCompleted:`Completato`,statusFailed:`Fallito`,statusSkipped:`Saltato`,heading:`Fasi`,autonomousOn:`● Autonomo`,autonomousOff:`○ Manuale`,autonomousOnTitle:`Modalità autonoma attiva — clicca per mettere in pausa`,autonomousOffTitle:`Modalità manuale — clicca per attivare l'autonomo`,overallProgress:`Progresso complessivo`,tasksSuffix:`{{done}}/{{total}} attività`,agentsSuffix_one:`{{count}} agente`,agentsSuffix_other:`{{count}} agenti`},q={triggerTitle:`Modalità finestra di contesto`,ctxPrefix:`ctx:`,opsHeading:`Operazioni di contesto`,compactNow:`Compatta ora`,compactNowDesc:`Ometti output strumento vecchi`,compactAggressive:`Compattazione aggressiva`,compactAggressiveDesc:`Omissione massima ora`,repairContext:`Ripara contesto`,repairDesc:`Correggi blocchi tool-use orfani`,debugContext:`Debug contesto`,debugDesc:`Dettaglio dimensioni per sezione`,windowHeading:`Finestra di contesto`,keepElide:`mantieni {{k}} recenti · ometti {{t}}+ token`,fallbackName:`Bilanciato`,fallbackDesc:`Compattazione rolling predefinita`},J={kindAssistant:`Assistente`,kindThinking:`Pensiero`,kindToolCall:`Chiamata strumento`,kindToolResult:`Risultato strumento`,kindError:`Errore`,kindStatus:`Stato`,kindSystem:`Sistema`,title:`Cronologia chat`,copyTitle:`Copia cronologia chat agente`,empty:`Nessuna cronologia chat per questo agente ancora.`,taskLabel:`Attività`,taskChars:`{{count}} caratteri`,taskExpand:`Mostra`,taskExpandTitle:`Mostra la descrizione completa dell'attività`,taskModalTitle:`Descrizione dell'attività`,taskModalDescription:`L'attività completa per cui questo agente è stato avviato.`,readOnly:`Sola lettura`,returnToLeader:`Torna alla chat`},Y={heading:`Modalità autonomia`,titlePrefix:`Autonomia: {{label}}`,descOff:`Controllo manuale totale — l'agente attende il tuo input.`,descSuggest:`L'agente suggerisce i prossimi passi ma attende approvazione.`,descAuto:`L'agente procede automaticamente dopo un breve ritardo di conferma.`,descEternal:`L'agente gira in autonomia fino al completamento dell'obiettivo.`,descEternalParallel:`Esecuzione autonoma multi-agente — modalità flotta.`,labelOff:`Disattivato`,labelSuggest:`Suggerisci`,labelAuto:`Auto`,labelEternal:`Eterno`,labelEternalParallel:`Eterno parallelo`},X={heading:`Coda dei messaggi`,subtitle:`{{count}} in coda · messaggi inviati prima che l'agente finisca`,btwTitle:`A proposito — inviato come follow-up senza interrompere l'agente in corso`,steerTitle:`Guida — interrompe l'agente in corso e lo reindirizza con questo messaggio`,queueTitle:`In coda — trattenuto fino al completamento del run dell'agente, poi inviato in ordine`,sortNewestTitle:`Ordinato dal più recente — clicca per ordinare dal più vecchio`,sortOldestTitle:`Ordinato dal più vecchio — clicca per ordinare dal più recente`,newest:`Più recente`,oldest:`Più vecchio`,clear:`Svuota`,clearTitle:`Cancella tutti i messaggi in coda`,closeTitle:`Chiudi`,emptyTitle:`La coda è vuota`,emptyBody:`Usa i pulsanti btw / steer / aggiungi a coda accanto all'input per aggiungere messaggi. Gli elementi in coda sono inviati in ordine al completamento del run dell'agente.`,removeTitle:`Rimuovi dalla coda`,clearDispatchedTitle:`Cancella i messaggi in coda — le note già inviate non possono essere revocate`,dispatchedTitle:`Già inviato all'agente`,dispatchedLabel:`Inviato`,footer:`I messaggi sono inviati in ordine di arrivo al completamento del run dell'agente. Usa l'ordinamento per vedere i più recenti prima.`},Z={heading:`Checkpoint di sessione`,countSuffix_one:`{{count}} checkpoint`,countSuffix_other:`{{count}} checkpoint`,description:`Riavvolgi la sessione a qualsiasi checkpoint. Messaggi e modifiche ai file tornano a quel punto — l'LLM continua da lì come se nulla fosse successo dopo.`,emptyTitle:`Nessun checkpoint ancora`,emptyBody:`I checkpoint sono creati automaticamente a ogni messaggio inviato. Invia qualche messaggio e torna.`,latest:`recente`,msgSuffix_one:`{{count}} msg`,msgSuffix_other:`{{count}} msg`,footerPre:`Clicca un checkpoint per riavvolgere`,footerPost:`per chiudere`},Q={statusActive:`Attivo`,statusPaused:`In pausa`,statusDone:`Completato`,statusFailed:`Fallito`,statusAbandoned:`Abbandonato`,heading:`Obiettivo`,refined:`Raffinato`,progress:`Progresso`,iterations:`iterazioni`,deliverables:`Deliverable`,recentActivity:`Attività recente`},$={cleanTitle_one:`Pulire {{count}} worktree orfano?`,cleanTitle_other:`Pulire {{count}} worktree orfani?`,cleanMessage:`Rimuove forzatamente ogni worktree git + branch wstack/ap residuo da run precedenti. Il lavoro non mergiato al loro interno va perso.`,cleanConfirm:`Pulisci orfani`,orphanCount_one:`{{count}} worktree orfano da run precedenti`,orphanCount_other:`{{count}} worktree orfani da run precedenti`,andMore:`…e {{count}} altri`,cleanButtonTitle:`Rimuovi forzatamente tutti i worktree + branch orfani`,removed_one:`✓ {{count}} worktree orfano rimosso.`,removed_other:`✓ {{count}} worktree orfani rimossi.`,cleanupFailed:`pulizia fallita`,lanesHeading:`Worktree`,base:`base`,isolatedCount_one:`{{count}} isolato`,isolatedCount_other:`{{count}} isolati`,statusAllocating:`allocazione`,statusActive:`attivo`,statusCommitting:`commit`,statusMerging:`merge`,statusMerged:`mergiato`,statusConflict:`conflitto`,statusFailed:`fallito`,conflictBadge:`CONFLITTO`,graphAria:`Grafo dei branch worktree da {{base}}`,mergedLabel:`✓ mergiato → {{base}}`},ee={heading:`Processi in esecuzione`,subtitle:`{{active}} attivi · {{total}} totali`,killAll:`Termina tutti`,emptyTitle:`Nessun processo tracciato`,emptyBody:`I processi appaiono qui quando l'agente esegue strumenti bash o exec. I processi attivi mostrano un LED pulsante.`,pidLabel:`PID {{pid}}`,protected:`protetto`,protectedTitle:`Protetto — sopravvive a kill/killAll`,background:`in background`,backgroundTitle:`Processo scollegato — continua dopo la chiusura di CLI/WebUI`,confirmKillBackground:`Terminare il processo scollegato in background {{pid}}?`,confirmKillAll:`Terminare tutti i {{count}} processi in esecuzione?`,killTitle:`Termina PID {{pid}}`},te={tooLarge:`Diff omesso (file troppo grande per il rendering in linea).`},ne={placeholder:`Aggiungi un modello di fallback…`,emptyHint:`Provati in ordine quando il modello primario è limitato o si blocca.`,moveUp:`Sposta su`,moveDown:`Sposta giù`},re={loading:`Caricamento sessioni...`,apiUnavailable:`API di sessione non disponibile:`,empty:`Nessuna sessione live. Apri un'altra istanza wstack per vederla qui.`,heading:`Sessioni live ({{count}})`,autoRefresh:`aggiornamento automatico ogni 5 s`,pidLabel:`PID {{pid}}`,agentMeta:`{{iter}} iter · {{tools}} strumenti · {{ago}}`,andMore:`... e altre {{count}}`,noAgents:`Nessun agente`},ie={applyTitle:`Scrivi la versione modificata sul disco`,applying:`Applicazione…`,applied:`Applicato`,apply:`Applica`},ae={showStack_one:`Mostra trace dello stack ({{count}} frame)`,showStack_other:`Mostra trace dello stack ({{count}} frame)`,hideStack_one:`Nascondi trace dello stack ({{count}} frame)`,hideStack_other:`Nascondi trace dello stack ({{count}} frame)`},oe={liveHeading:`Live`,clients:`Client`,agents:`Agenti`,model:`Modello`,mode:`Modalità`,toolCalls:`Chiamate strum.`,displayHeading:`Display`,statsHud:`HUD stat`,legends:`Legende`,minimap:`Minimappa`,zoomControls:`Controlli zoom`,animateWires:`Anima fili`,backgroundHeading:`Sfondo`,waitThresholdHeading:`Soglia di attesa`,waitThresholdHint:`Contrassegna una scrivania attiva come in attesa dopo questo silenzio`,bgDots:`Punti`,bgLines:`Linee`,bgCross:`Croce`,bgNone:`Nessuno`},se={noParams:`(nessun parametro)`,itemCount_one:`{{count}} elemento`,itemCount_other:`{{count}} elementi`,keyCount_one:`{{count}} chiave`,keyCount_other:`{{count}} chiavi`},ce={roleYou:`Tu`,roleTool:`Strumento`,roleThinking:`Pensiero`,roleAssistant:`Assistente`,inputLabel:`Input`,downloadTitle:`Scarica come file`,empty:`(vuoto)`,hideDetails:`Nascondi dettagli`,showDetails:`Mostra dettagli`,showDetailsLines_one:`Mostra dettagli ({{count}} riga)`,showDetailsLines_other:`Mostra dettagli ({{count}} righe)`,editHint:`⌘/Ctrl+Invio per salvare · Esc per annullare`,saveResend:`Salva e reinvia`,thinkingProcess:`Processo di pensiero`,thinkingMeta:`iter {{iter}} · {{dur}} · {{lines}}`,replay:`replay`,linesSuffix_one:`{{count}} riga`,linesSuffix_other:`{{count}} righe`,copyLog:`Copia log`,showFullLog:`Mostra log completo`,typing:`Scrive…`,noContent:`Nessun contenuto`,imageNotRetained:`L'anteprima dell'immagine non viene conservata dopo il ricaricamento`,failedToSend:`⚠ Invio fallito`,autoPaused:`⚠️ _Avanzamento automatico in pausa — raggiunto il numero massimo di turni automatici consecutivi. Digita qualcosa per continuare (l'autonomia resta attiva)._`,autoLoopHalted:`⚠️ _Invio automatico interrotto perché lo stesso prompt si è ripetuto. L'autonomia resta attiva; inserisci un nuovo prompt per reimpostare la protezione dai cicli._`,rsIterations:`Iterazioni: {{n}}`,rsTools:`Chiamate strum.: {{n}}`,rsElapsed:`Trascorso: {{s}}`,rsCost:`Costo: {{c}}`,useInput:`Input: {{n}}`,useOutput:`Output: {{n}}`,useCacheRead:`Lettura cache: {{n}}`,useCost:`Costo: {{c}}`,renderedLabel:`Renderizzato`,rawLabel:`Grezzo`,showRenderedTitle:`Mostra markdown renderizzato`,showRawTitle:`Mostra sorgente markdown grezzo`,editTitle:`Modifica e reinvia questo prompt`,editLabel:`Modifica`,unpinTitle:`Rimuovi pin`,pinTitle:`Fissa questa risposta`,pinnedLabel:`Fissato`,pinLabel:`Fissa`,regenerateTitle:`Rigenera questa risposta`,retryLabel:`Riprova`},le={toolFallback:`strumento`,toolFailed:`Strumento fallito`},ue={heading:`Scorciatoie da tastiera`,footerPre:`Premi`,footerPost:`in qualsiasi momento per riaprire questa lista.`,sectionGlobal:`Globali`,sectionTuiParity:`Parità pannello TUI`,sectionFleet:`Flotta & Agenti`,sectionChatInput:`Input chat`,sectionChat:`Chat`,sectionChatNav:`Navigazione chat (senza scrivere)`,dCommandPalette:`Apri palette comandi`,dShowOverlay:`Mostra questa overlay scorciatoie`,dToggleSidebar:`Mostra/nascondi barra laterale`,dOpenPanel:`Apri pannello laterale (Sessione, Agenti, Cronologia, File, Changes, Messaggi, Competenze)`,dDesignStudio:`Apri pannello Design Studio`,dWorktrees:`Apri la scheda Worktrees nel pannello Changes`,dSettings:`Apri Impostazioni`,dMemory:`Apri Memoria`,dFocusInput:`Focalizza l'input dei messaggi`,dSessionPanel:`Pannello sessione`,dFleetOverlay:`Overlay monitor flotta`,dAgentsOverlay:`Overlay monitor agenti`,dWorktreeMonitor:`Monitor worktree`,dPlanPanel:`Pannello piano`,dTodosPanel:`Pannello attività`,dQueuePanel:`Pannello coda`,dProcessMonitor:`Monitor processi`,dGoalPanel:`Pannello obiettivo`,dSessionsDashboard:`Dashboard sessioni`,dOfficeMap:`Mappa uffici (scheda dell'Agent Roster)`,dDockPicker:`Selettore chip del dock`,dOpenFleet:`Apri overlay monitor flotta`,dOpenAgents:`Apri overlay monitor agenti`,dNavigateAgents:`Naviga gli agenti nel monitor`,dSelectAgent:`Seleziona agente focalizzato`,dCloseOverlay:`Chiudi overlay attivo`,dSendMessage:`Invia messaggio`,dNewline:`Inserisci una nuova riga`,dRecallPrev:`Riprendi prompt precedente (input vuoto)`,dRecallNext:`Riprendi prompt successivo`,dSlashPopup:`Apri popup comandi slash`,dAutocomplete:`Autocompleta comando evidenziato`,dDismissPopup:`Chiudi popup / pulisci input`,dSearchChat:`Cerca nella chat attuale`,dClearContext:`Pulisci contesto (come /clear)`,dNewSession:`Avvia nuova sessione (come /new)`,dExportMarkdown:`Esporta chat come markdown`,dModelSwitcher:`Overlay selettore modello rapido`,dCompactDensity:`Attiva/disattiva densità UI compatta`,dAbortRun:`Interrompi run in corso (durante esecuzione)`,dFocusNext:`Focalizza messaggio successivo (alias: ↓)`,dFocusPrev:`Focalizza messaggio precedente (alias: ↑)`,dJumpFirst:`Vai al primo messaggio`,dJumpLast:`Vai all'ultimo messaggio`,dCopyFocused:`Copia testo messaggio focalizzato`,dClearFocused:`Cancella messaggio focalizzato`},de={titleFallback:`Board SDD live`,defaultModelTitle:`Modello worker predefinito a livello di run (gli override per task hanno la precedenza)`,graphLabel:`Grafo`,kanbanLabel:`Kanban`,retryAllTitle:`Rimetti ogni attività fallita in pending`,retryFailed:`Riprova fallite ({{count}})`,resume:`Riprendi`,pause:`Pausa`,stop:`Ferma`,cleanTitle:`Rimuovi i worktree git + branch wstack/ap del run`,cleanWorktrees:`Pulisci worktree`,rollbackTitle:`Revert di {{count}} commit mergiati su {{base}}`,rollback:`Rollback ({{count}})`,stopping:`Arresto…`,destroying:`Distruzione…`,destroyTitle:`Ferma, rimuovi tutti i worktree, revert opzionale dei commit mergiati ed elimina il progetto SDD`,destroy:`Distruggi`,statDone:`fatti`,statRunning:`in corso`,statFailed:`falliti`,statWave:`ondata`,statElapsed:`trascorso`,noActiveWorkers:`nessun worker attivo`,deadlock:`Stallo — attività bloccate da lavoro fallito:`,noRunTitle:`Nessun run SDD attivo.`,noRunBody:`Avviane uno dalla procedura New SDD Project o tramite /sdd execute nella CLI — gli agenti appaiono qui live, ciascuno in un worktree isolato.`,clickTaskHint:`clicca un'attività per i dettagli`,lcClean:`Pulizia`,lcRollback:`Rollback`,lcDestroy:`Distruzione`,lcFailed:`{{op}} fallito: {{reason}}`,lcUnknownError:`errore sconosciuto`,lcWorktrees_one:`{{count}} worktree rimosso`,lcWorktrees_other:`{{count}} worktree rimossi`,lcCommits_one:`{{count}} commit revertato`,lcCommits_other:`{{count}} commit revertati`,lcDeleted:`eliminato {{items}}`,lcNothing:`nulla da fare`,lcNote:`{{op}}: {{body}} — nota: {{reason}}`,lcOk:`{{op}}: {{body}}`},fe={backTitle:`Torna all'attività`,expandTitle:`Espandi dettagli attività`,collapseTitle:`Riduci dettagli attività`,eventLog:`Registro eventi attività`,newestFirst:`più recenti prima`,noEvents:`Non è stata ancora registrata alcuna attività per questo task.`,workingOn:`lavora a questa attività`,assigned:`assegnato`,metaPriority:`Priorità`,metaType:`Tipo`,metaDuration:`Durata`,metaElapsed:`Trascorso`,metaRetries:`Tentativi`,metaWorktree:`Worktree`,workerModel:`Modello worker`,runDefault:`predefinito del run: {{model}}`,runDefaultPlaceholder:`Predefinito del run`,runDefaultPlaceholderModel:`Predefinito del run ({{model}})`,verificationCmd:`Comando di verifica`,gatesCompletion:`gating del completamento (exit 0)`,verifyPlaceholder:`es. pnpm vitest run path/to/file`,addVerify:`+ Aggiungi comando di verifica`,description:`Descrizione`,timeline:`Cronologia`,dependsOn:`Dipende da`,blocks:`Blocca`,newWorkerPlaceholder:`Nome nuovo worker…`,confirmStop:`Fermare questa attività in corso?`,confirmDelete:`Eliminare questa attività dal run?`,retryTitle:`Rimetti questa attività in pending`,reassign:`Riassegna`,stopTitle:`Interrompi il worker su questa attività`,splitTitle:`Dividi questa attività in sotto-attività delegate a worker separati`,split:`Dividi`,splitHint:`Una sotto-attività per riga — Titolo :: descrizione (descrizione facoltativa)`,splitPlaceholder:`Scrivi il layer dati :: aggiungi il repository