@wrongstack/webui 0.300.0 → 0.301.0

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 (124) hide show
  1. package/dist/assets/AgentRosterView-BV6ysoGs.js +9 -0
  2. package/dist/assets/{AnalyticsDashboard-CIN35A_u.js → AnalyticsDashboard-UWNP8zjE.js} +1 -1
  3. package/dist/assets/{AudienceMemoryPanel-BAY2Bh8z.js → AudienceMemoryPanel-DwDKbvSA.js} +1 -1
  4. package/dist/assets/{ChangesView-CVWSTGmX.js → ChangesView-DuVlGWkD.js} +1 -1
  5. package/dist/assets/ChronicleDashboard-cs16n708.js +1 -0
  6. package/dist/assets/{CodeEditor-CWY_6cQD.js → CodeEditor-sr50ljZN.js} +1 -1
  7. package/dist/assets/{CodeMap-CjmKO0lB.js → CodeMap-CtK-C8gK.js} +1 -1
  8. package/dist/assets/ConfirmModal-ndS17YwF.js +1 -0
  9. package/dist/assets/{CronJobsPanel-BinzTWNs.js → CronJobsPanel-Dovomns5.js} +1 -1
  10. package/dist/assets/{DeadCodeScanPanel-C3CgaNVv.js → DeadCodeScanPanel-DjR4LLMs.js} +1 -1
  11. package/dist/assets/{DebugDashboard-BqUghn06.js → DebugDashboard-jK1yp3qS.js} +1 -1
  12. package/dist/assets/{DesignGalleryView-CuWWQAlD.js → DesignGalleryView-CqXlEUzE.js} +1 -1
  13. package/dist/assets/GoalView-CGNLrnA4.js +1 -0
  14. package/dist/assets/KanbanView--tAf_K7N.js +3 -0
  15. package/dist/assets/{MailboxDetailView-aaHx9Nma.js → MailboxDetailView-0TBzZTdN.js} +1 -1
  16. package/dist/assets/{MemoryManager-BgcicCyg.js → MemoryManager-CDK_MO8A.js} +1 -1
  17. package/dist/assets/{ModelPicker-B3BqjJnT.js → ModelPicker-BbBZuQwR.js} +1 -1
  18. package/dist/assets/{OfficeMapPanel-Ck8NUOEs.js → OfficeMapPanel-68sVzHRD.js} +2 -2
  19. package/dist/assets/{OfficeMapPanel-CpexsBed.css → OfficeMapPanel-D6yTfGIT.css} +1 -1
  20. package/dist/assets/{ProcessMonitor-CoMYZcdS.js → ProcessMonitor-gFwiF8gX.js} +1 -1
  21. package/dist/assets/{QueuePanel-CA3CVCO_.js → QueuePanel-Cx-isRGl.js} +1 -1
  22. package/dist/assets/{RefreshDebugView-cqBtyNna.js → RefreshDebugView-C9tdu6Ld.js} +1 -1
  23. package/dist/assets/{RequirementIntakeView-BBtUk8mC.js → RequirementIntakeView-cPEw-RpV.js} +1 -1
  24. package/dist/assets/SageTabs-BbK6VFO0.js +2 -0
  25. package/dist/assets/SddHub-NKvDRECi.js +2 -0
  26. package/dist/assets/{SessionInspectView-DHC_xTzG.js → SessionInspectView-DPG5qWhj.js} +1 -1
  27. package/dist/assets/SessionList-ncl-20X_.js +1 -0
  28. package/dist/assets/SessionsDashboard-D23UVLr4.js +1 -0
  29. package/dist/assets/SetupScreen-D3XQ8MGk.js +1 -0
  30. package/dist/assets/{SkillDetailView-D7wSJWUX.js → SkillDetailView-DDPhVFet.js} +1 -1
  31. package/dist/assets/{SpecsView-BRWSI1iV.js → SpecsView-afIS0QpX.js} +1 -1
  32. package/dist/assets/{TechStackView-BOjkuJLe.js → TechStackView-kQ2OGxxw.js} +1 -1
  33. package/dist/assets/{TerminalPanel-Dg8WR5Un.js → TerminalPanel-GcJWeldW.js} +1 -1
  34. package/dist/assets/{Toaster-DSKFSuK3.js → Toaster-CgQA9256.js} +1 -1
  35. package/dist/assets/{activity-BWbV0byu.js → activity-B-cvKIfT.js} +4 -4
  36. package/dist/assets/{activity-DA9hmVZV.js → activity-Ba3aMzvo.js} +4 -4
  37. package/dist/assets/{activity-GdnS66AB.js → activity-CRTVZ5A4.js} +4 -4
  38. package/dist/assets/{activity-eawh_OWs.js → activity-DsSuflRW.js} +4 -4
  39. package/dist/assets/{activity-Bze6njDy.js → activity-DxDRJ8kN.js} +4 -4
  40. package/dist/assets/{activity-Bjb_mil3.js → activity-VI776bUZ.js} +4 -4
  41. package/dist/assets/{activity-Ciqcr7Ps.js → activity-nVmsmqAI.js} +4 -4
  42. package/dist/assets/chat-BPuAsrkF.js +1 -0
  43. package/dist/assets/chat-BfQBSiII.js +1 -0
  44. package/dist/assets/chat-BnkVCZ3Q.js +1 -0
  45. package/dist/assets/chat-CR2B97dj.js +1 -0
  46. package/dist/assets/chat-CdiY7G6Z.js +1 -0
  47. package/dist/assets/chat-DResBrkV.js +1 -0
  48. package/dist/assets/chat-Di8o0wDz.js +1 -0
  49. package/dist/assets/chat-store-DbxFVDwi.js +17 -0
  50. package/dist/assets/i18n-COgumVF5.js +2 -0
  51. package/dist/assets/index-CtpViiZy.js +132 -0
  52. package/dist/assets/index-fIsq43fR.css +1 -0
  53. package/dist/assets/mailbox-store-C1mzoSqJ.js +1 -0
  54. package/dist/assets/{progress-ring-D_d6hn_4.js → progress-ring-D_48qsBl.js} +1 -1
  55. package/dist/assets/{roster-ws-D6dGRfC5.js → roster-ws-Da57e_sI.js} +1 -1
  56. package/dist/assets/session-store-Df7_hhe9.js +1 -0
  57. package/dist/assets/settings-Bb7_utQE.js +1 -0
  58. package/dist/assets/settings-Bd8zMwvC.js +1 -0
  59. package/dist/assets/settings-DdFgBMAw.js +1 -0
  60. package/dist/assets/settings-De6sXIFO.js +1 -0
  61. package/dist/assets/settings-E8SKMLxq.js +1 -0
  62. package/dist/assets/settings-zIY9-ivF.js +1 -0
  63. package/dist/assets/settings-zKBcRjqE.js +1 -0
  64. package/dist/assets/stores-ChEnUmic.js +7 -0
  65. package/dist/assets/{useWebSocket-DuLtH2jI.js → useWebSocket-_gk4MRJz.js} +7 -7
  66. package/dist/assets/ws-client-TTMa0XaT.js +1 -0
  67. package/dist/components/AgentCard.d.ts +21 -0
  68. package/dist/components/AgentsPage.d.ts +0 -3
  69. package/dist/components/ChatInput/refine-panel-host.d.ts +2 -2
  70. package/dist/components/ConfirmModal.d.ts +7 -2
  71. package/dist/components/KanbanBoardState.d.ts +1 -1
  72. package/dist/components/SettingsPanel/ShadowSection.d.ts +18 -1
  73. package/dist/components/SettingsPanel/brain-section-options.d.ts +2 -0
  74. package/dist/components/index.d.ts +0 -1
  75. package/dist/hooks/useWebSocket.d.ts +10 -2
  76. package/dist/index.css +32 -0
  77. package/dist/index.html +15 -14
  78. package/dist/index.js +3480 -3168
  79. package/dist/lib/kanban-board-active.d.ts +19 -0
  80. package/dist/lib/plugin-enablement.d.ts +1 -1
  81. package/dist/lib/ws-client.d.ts +21 -1
  82. package/dist/stores/fleet-store.d.ts +1 -1
  83. package/dist/stores/local-prefs.d.ts +9 -0
  84. package/dist/stores/session-store.d.ts +9 -1
  85. package/dist/stores/ui-store.d.ts +2 -0
  86. package/dist/types/brain.d.ts +2 -0
  87. package/dist/types/client-message.d.ts +7 -1
  88. package/dist/types/protocol-core.d.ts +2 -0
  89. package/dist/types/runtime.d.ts +14 -0
  90. package/dist/types/server-message.d.ts +3 -3
  91. package/package.json +8 -8
  92. package/dist/assets/AgentRosterView-wkALMOGD.js +0 -9
  93. package/dist/assets/ChronicleDashboard-Bg3W7C9U.js +0 -1
  94. package/dist/assets/GoalView-2weuLiPM.js +0 -1
  95. package/dist/assets/KanbanView-DXYRrshJ.js +0 -3
  96. package/dist/assets/SageTabs-Di49i4Yu.js +0 -2
  97. package/dist/assets/SddHub-D8iV6l9A.js +0 -2
  98. package/dist/assets/SessionList-DH-ZsHmv.js +0 -1
  99. package/dist/assets/SessionsDashboard-Coi6htwg.js +0 -1
  100. package/dist/assets/SetupScreen-CD2Sx4n9.js +0 -1
  101. package/dist/assets/chat-4NEOESoU.js +0 -1
  102. package/dist/assets/chat-BSg62iwX.js +0 -1
  103. package/dist/assets/chat-Bb1TpPfJ.js +0 -1
  104. package/dist/assets/chat-COLKjtcx.js +0 -1
  105. package/dist/assets/chat-CfRKV9iX.js +0 -1
  106. package/dist/assets/chat-EbeT4kiS.js +0 -1
  107. package/dist/assets/chat-store-CtOyUCdF.js +0 -17
  108. package/dist/assets/chat-ux_gymOJ.js +0 -1
  109. package/dist/assets/i18n-C31PI0Up.js +0 -2
  110. package/dist/assets/index-5IWUhPO4.css +0 -1
  111. package/dist/assets/index-D1izXztg.js +0 -132
  112. package/dist/assets/mailbox-store-Bc9ER3Ph.js +0 -1
  113. package/dist/assets/session-store-b2KGFwkX.js +0 -1
  114. package/dist/assets/settings-BKuhxUSF.js +0 -1
  115. package/dist/assets/settings-CeK0doV7.js +0 -1
  116. package/dist/assets/settings-DZ-H89lu.js +0 -1
  117. package/dist/assets/settings-DvrdpSdA.js +0 -1
  118. package/dist/assets/settings-SBUqq0ll.js +0 -1
  119. package/dist/assets/settings-W8t1ZrxM.js +0 -1
  120. package/dist/assets/settings-tOqZkk9R.js +0 -1
  121. package/dist/assets/stores-OBoFiAKe.js +0 -7
  122. package/dist/assets/ws-client-Bw1ixxwI.js +0 -1
  123. package/dist/components/AgentsMonitor.d.ts +0 -26
  124. package/dist/components/FleetMonitor.d.ts +0 -21
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ci as t,Di as n,Ea as r,Fr as i,Jt as a,Ln as o,M as s,Nt as c,Pa as l,Un as u,Wt as d,an as f,ca as p,di as m,dt as ee,gi as te,hn as h,ir as g,ki as _,lt as v,sa as y,ut as ne,vn as re,xa as b,za as x,zr as S}from"./vendor-BuarzSSb.js";import"./i18n-C31PI0Up.js";import{t as C}from"./utils-B-9lSDIn.js";import{i as w}from"./stores-OBoFiAKe.js";import{t as T}from"./button-Dcy288Mc.js";import{t as E}from"./input-fo9-BPBC.js";import{C as D,S as O}from"./index-D1izXztg.js";var k=e(x(),1),A=v(),ie={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}},ae={labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function j(e){return ie[e]??ae}var M={npm:{label:`npm / Node.js`,icon:o},python:{label:`Python`,icon:n},rust:{label:`Rust`,icon:a},go:{label:`Go`,icon:h},dotnet:{label:`.NET`,icon:u},php:{label:`PHP`,icon:c},dart:{label:`Dart / Flutter`,icon:t},maven:{label:`Maven`,icon:r},gradle:{label:`Gradle`,icon:p},ruby:{label:`Ruby`,icon:i},swift:{label:`Swift`,icon:ne},elixir:{label:`Elixir`,icon:c},cpp:{label:`C / C++`,icon:_}},oe={labelKey:`activity:techStackStatus.unknown`};function N(e,t){let n=P(e);return n.labelKey?t(n.labelKey):n.label??e}function P(e){return M[e]??oe}function F({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=P(e);if(!n.icon)return null;let r=n.icon;return(0,A.jsx)(r,{className:t})}function se(e){return j(e.status).weight>=50}var I=[`critical`,`high`,`medium`,`low`,`info`],L={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`}},R={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`},z={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 B(e){return z[e]??z.unsupported}function V(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 H(e){let t=V(e.locked??e.installed??e.requested),n=V(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 U(e){return e.locked??e.installed??e.requested??null}function W(e){return e.confidence<1}function G({className:e,children:t}){return(0,A.jsx)(`span`,{className:C(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function K({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,A.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,A.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:C(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,A.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function ce({dependency:e,findings:t,deepDive:n,onDeepDive:r,onBack:i,coverage:a}){let{t:o}=l(),s=j(e.status),c=U(e),u=H(e),f=a?B(a).noteKey:void 0;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:i,"aria-label":o(`activity:techStack.backToDependencyList`),className:`shrink-0 md:hidden`,children:(0,A.jsx)(b,{className:`size-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`h2`,{className:`min-w-0 truncate font-mono text-sm font-bold text-foreground`,children:e.name}),(0,A.jsx)(G,{className:s.badge,children:o(s.labelKey)})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[N(e.ecosystem,o),` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,A.jsx)(`span`,{className:`text-warning`,children:o(f)})]})]})]})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-baseline gap-2 font-mono text-xs`,children:[(0,A.jsx)(`span`,{className:`text-foreground`,children:c??`—`}),e.latestStable&&e.latestStable!==c&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`text-info`,children:e.latestStable})]}),u.label&&(0,A.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[`(`,u.label,`)`]})]})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-2 gap-px border border-border/70 bg-border/60`,children:[(0,A.jsx)(q,{label:o(`activity:techStack.constraint`),value:e.requested??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.locked`),value:e.locked??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.latestStable`),value:e.latestStable??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.license`),value:e.license??`—`}),e.wanted&&(0,A.jsx)(q,{label:o(`activity:techStack.wanted`),value:e.wanted,mono:!0}),e.resolvable&&(0,A.jsx)(q,{label:o(`activity:techStack.resolvable`),value:e.resolvable,mono:!0}),e.purl&&(0,A.jsx)(q,{label:o(`activity:techStack.purl`),value:e.purl,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.registryFlags`),value:[e.deprecated&&`deprecated`,e.yanked&&`yanked`].filter(Boolean).join(`, `)||`none`})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:o(`activity:techStack.findings`)}),(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>r(e),disabled:n.status===`loading`,className:`h-7 text-[10px]`,children:[n.status===`loading`?(0,A.jsx)(g,{className:`size-3 animate-spin`}):(0,A.jsx)(d,{className:`size-3`}),n.status===`loading`?`Researching…`:`Deep dive`]})]}),n.status===`error`&&n.error&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-1.5 text-[10px] text-destructive`,children:n.error}),t.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.nothingFlaggedRunADeepDive`)}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:L[e.severity].badge,children:o(L[e.severity].labelKey)}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?o(R[e.action]):e.action}),W(e)&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(d,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.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,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.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,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.noEvidenceRecorded`)}):(0,A.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.evidence.map((t,n)=>(0,A.jsxs)(`li`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:t.kind}),(0,A.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(t.retrievedAt).toLocaleString()})]}),t.source.startsWith(`http`)?(0,A.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,A.jsx)(`span`,{className:`truncate`,children:t.source}),(0,A.jsx)(m,{className:`size-2.5 shrink-0`})]}):(0,A.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:t.source}),t.detail&&(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-muted-foreground`,children:t.detail})]},`${e.id}-evidence-${n}`))})]})]})]})}function q({label:e,value:t,mono:n}){return(0,A.jsxs)(`div`,{className:`bg-card/55 px-2.5 py-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:C(`mt-0.5 truncate text-[11px] text-foreground`,n&&`font-mono`),children:t})]})}var J=`grid grid-cols-[minmax(0,2.2fr)_minmax(0,1.6fr)_minmax(0,1.1fr)] gap-2`;function le({dependencies:e,selectedId:t,hasDependencies:n,coverageByWorkspaceId:r,onSelect:i}){let{t:a}=l(),o=D(e,30);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.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,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:C(J,`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,A.jsx)(`span`,{children:a(`activity:techStack.package`)}),(0,A.jsx)(`span`,{children:a(`activity:techStack.installedLatest`)}),(0,A.jsx)(`span`,{children:a(`activity:techStack.status`)})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(s,{className:`h-full`,"aria-label":a(`activity:techStack.dependencies`),children:o.pageItems.map(e=>(0,A.jsx)(Y,{dependency:e,selected:e.id===t,coverage:r?.get(e.workspaceId),onSelect:i},e.id))})}),(0,A.jsx)(O,{page:o.page,pageSize:o.pageSize,totalItems:o.totalItems,onPageChange:o.setPage,itemLabel:`dependencies`})]})}function Y({dependency:e,selected:t,coverage:n,onSelect:r}){let{t:i}=l(),a=j(e.status),o=U(e),s=H(e),c=n?B(n).noteKey:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e),"aria-current":t,className:C(J,`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,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:C(`size-1.5 shrink-0`,a.dot),"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e.name})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem,className:`mr-0.5 inline-block size-3 align-text-bottom`}),N(e.ecosystem,i),` · `,e.direct?`direct`:`transitive`,` · `,e.scope,c&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`span`,{className:`text-warning`,children:i(c)})]})]})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5 font-mono text-[11px]`,children:[(0,A.jsx)(`span`,{className:`truncate text-foreground`,children:o??`—`}),e.latestStable&&e.latestStable!==o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`truncate text-info`,children:e.latestStable})]})]}),s.label?(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:s.label}):e.requested&&(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:e.requested})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,A.jsx)(G,{className:a.badge,children:i(a.labelKey)}),e.deprecated&&(0,A.jsx)(G,{className:`border-destructive/35 bg-destructive/10 text-destructive`,children:`dep`}),e.yanked&&(0,A.jsx)(G,{className:`border-destructive/45 bg-destructive/15 text-destructive`,children:`yank`})]})]})}function ue({findings:e,dependenciesById:t,onSelectDependency:n}){let{t:r}=l(),i=D(e,20);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsxs)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:[r(`activity:techStack.noFindingsRun`),` `,(0,A.jsx)(`span`,{className:`font-mono text-foreground`,children:r(`activity:techStack.analyze`)}),` `,r(`activity:techStack.toCheckVersionsAndAdvisoriesAgainst`)]})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-4`,children:I.map(e=>[e,i.pageItems.filter(t=>t.severity===e)]).filter(([,e])=>e.length>0).map(([e,i])=>(0,A.jsxs)(`section`,{children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,A.jsx)(G,{className:L[e].badge,children:r(L[e].labelKey)}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] tabular-nums text-muted-foreground`,children:i.length})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map(e=>(0,A.jsx)(X,{finding:e,dependency:t.get(e.dependencyId),onSelectDependency:n},e.id))})]},e))})}),(0,A.jsx)(O,{page:i.page,pageSize:i.pageSize,totalItems:i.totalItems,onPageChange:i.setPage,itemLabel:`findings`})]})}function X({finding:e,dependency:t,onSelectDependency:n}){let{t:r}=l(),i=W(e);return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.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,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?r(R[e.action]):e.action}),i&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(d,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.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,A.jsx)(`ul`,{className:C(`mt-1.5 flex flex-col gap-0.5`),children:e.evidence.slice(0,4).map((t,n)=>(0,A.jsx)(`li`,{className:`min-w-0 truncate text-[10px]`,children:t.source.startsWith(`http`)?(0,A.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`text-info underline-offset-2 hover:underline`,children:t.detail??t.source}):(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:t.detail??t.source})},`${e.id}-${n}`))})]})}function de({searchQuery:e,ecosystemFilter:t,statusFilter:n,directOnly:r,sort:i,hasFilters:a,ecosystems:o,statuses:s,visibleCount:c,totalCount:u,onSearchChange:d,onEcosystemFilterChange:p,onStatusFilterChange:m,onToggleDirectOnly:te,onSortChange:h,onClearFilters:g}){let{t:_}=l();return(0,A.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,A.jsx)(f,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(E,{"aria-label":_(`activity:techStack.searchDependencies`),value:e,onChange:e=>d(e.target.value),placeholder:_(`activity:techStack.searchByPackageName`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,A.jsx)(`button`,{type:`button`,"aria-label":_(`activity:techStack.clearSearch`),onClick:()=>d(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(ee,{className:`size-3.5`})})]}),(0,A.jsx)(T,{variant:r?`default`:`outline`,size:`sm`,onClick:te,"aria-pressed":r,title:_(`activity:techStack.showOnlyDependenciesThisProjectDeclaresItself`),className:`shrink-0`,children:_(`activity:techStack.directOnly`)}),a&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:g,"aria-label":_(`activity:techStack.clearAllFilters`),title:_(`activity:techStack.clearAllFilters`),className:`shrink-0`,children:(0,A.jsx)(S,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-ecosystem-filter`,children:_(`activity:techStack.filterByEcosystem`)}),(0,A.jsxs)(`select`,{id:`techstack-ecosystem-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:_(`activity:techStack.allEcosystems`)}),o.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[N(e,_),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:_(`activity:techStack.filterByStatus`)}),(0,A.jsxs)(`select`,{id:`techstack-status-filter`,value:n,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,A.jsx)(`option`,{value:`all`,children:_(`activity:techStack.allStatuses`)}),s.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[_(j(e).labelKey),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:_(`activity:techStack.sortDependencies`)}),(0,A.jsxs)(`select`,{id:`techstack-sort`,value:i,onChange:e=>h(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`attention`,children:_(`activity:techStack.sortNeedsAttention`)}),(0,A.jsx)(`option`,{value:`drift`,children:_(`activity:techStack.sortMostOutOfDate`)}),(0,A.jsx)(`option`,{value:`name`,children:_(`activity:techStack.sortName`)})]})]})]}),(0,A.jsx)(`p`,{className:C(`text-[10px] text-muted-foreground`,a&&`text-info`),children:c===u?`${u} dependencies`:`${c} of ${u} dependencies`})]})}var fe=[{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 pe(){let{t:e}=l(),t=w(e=>e.snapshot),n=w(e=>e.stale),r=w(e=>e.loading),i=w(e=>e.error),a=w(e=>e.activeJob),[o,s]=(0,k.useState)(`dependencies`),[c,u]=(0,k.useState)(``),[f,p]=(0,k.useState)(`all`),[m,h]=(0,k.useState)(`all`),[_,v]=(0,k.useState)(!1),[y,ne]=(0,k.useState)(`attention`),[b,x]=(0,k.useState)(null),[S,E]=(0,k.useState)([]),[D,O]=(0,k.useState)({status:`idle`,error:null}),[ie,ae]=(0,k.useState)(null),[M,oe]=(0,k.useState)(null),[N,P]=(0,k.useState)(new Set),[F,I]=(0,k.useState)(!1),L=(0,k.useCallback)(async()=>{let e=w.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))}},[]),R=(0,k.useCallback)(async e=>{let t=w.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))}},[]),z=(0,k.useCallback)(async()=>{let e=w.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}`);w.getState().jobCancelled(e.id)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}},[]),B=(0,k.useCallback)(async e=>{O({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}`);E(n.findings??[]),O({status:`idle`,error:null})}catch(e){O({status:`error`,error:e instanceof Error?e.message:String(e)})}},[]);(0,k.useEffect)(()=>{L()},[L]),(0,k.useEffect)(()=>{o!==`trends`&&o!==`remediation`||fetch(`/api/techstack/${o===`trends`?`trends`:`remediation`}`).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);t.trend&&ae(t.trend),t.plan&&oe(t.plan)}).catch(e=>w.getState().setError(e instanceof Error?e.message:String(e)))},[o,t?.id]);let V=(0,k.useCallback)(async()=>{if(N.size!==0){I(!0);try{let e=await fetch(`/api/techstack/remediation/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvedItems:[...N]})}),t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);P(new Set),await R(`inventory`)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}finally{I(!1)}}},[N,R]);(0,k.useEffect)(()=>{E([]),O({status:`idle`,error:null})},[t?.id]);let U=(0,k.useMemo)(()=>t?.dependencies??[],[t]),W=(0,k.useMemo)(()=>t?.findings??[],[t]),G=(0,k.useMemo)(()=>new Map(U.map(e=>[e.id,e])),[U]),q=(0,k.useMemo)(()=>ve(U.map(e=>e.ecosystem)),[U]),J=(0,k.useMemo)(()=>ve(U.map(e=>e.status)),[U]),Y=(0,k.useMemo)(()=>new Map(t?.workspaces.map(e=>[e.id,e.coverage])??[]),[t]),X=(0,k.useMemo)(()=>{let e=c.trim().toLowerCase(),t=[...U.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||f!==`all`&&t.ecosystem!==f||m!==`all`&&t.status!==m||_&&!t.direct))];return y===`name`?t.sort((e,t)=>e.name.localeCompare(t.name)):y===`drift`?t.sort((e,t)=>H(t).majorsBehind-H(e).majorsBehind||e.name.localeCompare(t.name)):t.sort((e,t)=>j(t.status).weight-j(e.status).weight||Number(t.direct)-Number(e.direct)||e.name.localeCompare(t.name)),t},[U,c,f,m,_,y]),Z=b?G.get(b):void 0,pe=(0,k.useMemo)(()=>Z?[...W.filter(e=>e.dependencyId===Z.id),...S.filter(e=>e.dependencyId===Z.id)]:[],[W,S,Z]),be=(0,k.useMemo)(()=>U.filter(se).length,[U]),xe=(0,k.useMemo)(()=>U.filter(e=>H(e).majorsBehind>0).length,[U]),Se=(0,k.useMemo)(()=>U.filter(e=>e.status===`vulnerable`).length,[U]),Ce=c.trim()!==``||f!==`all`||m!==`all`||_,we=(0,k.useCallback)(()=>{u(``),p(`all`),h(`all`),v(!1)},[]),$=!!(a&&![`completed`,`failed`,`cancelled`].includes(a.status)),Te=(0,k.useCallback)(e=>{x(e),s(`dependencies`)},[]);return(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,A.jsx)(`header`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:e(`activity:techStack.techstack`)}),(0,A.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:t?`${t.workspaces.length} workspaces`:`no scan yet`}),n&&(0,A.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,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground sm:text-xs`,children:t?`${t.targetRoot} · scanned ${new Date(t.createdAt).toLocaleString()}`:`Scan the open project to inventory its dependencies.`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>void R(`inventory`),disabled:$,title:e(`activity:techStack.offlineReReadManifestsAndLockfiles`),children:[(0,A.jsx)(re,{className:C(`size-3.5`,$&&`animate-spin`)}),(0,A.jsx)(`span`,{className:`hidden sm:inline`,children:e(`activity:techStack.refresh`)})]}),(0,A.jsxs)(T,{size:`sm`,onClick:()=>void R(`analyze`),disabled:$,title:e(`activity:techStack.checkRegistriesAndAdvisoriesThenInterpretTheResultsWithTheModel`),children:[(0,A.jsx)(d,{className:`size-3.5`}),e(`activity:techStack.analyze`)]}),$&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>void z(),"aria-label":e(`activity:techStack.cancelJob`),children:(0,A.jsx)(ee,{className:`size-4`})}),(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>t&&ye(t),disabled:!t,"aria-label":e(`activity:techStack.exportSnapshotAsJson`),title:e(`activity:techStack.exportSnapshotAsJson`),children:(0,A.jsx)(te,{className:`size-4`})})]})]})}),t&&(0,A.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,A.jsx)(K,{label:e(`activity:techStack.dependencies`),value:U.length,hint:`${X.length} visible`}),(0,A.jsx)(K,{label:e(`activity:techStack.outdated`),value:xe,hint:e(`activity:techStack.majorsBehind`),tone:xe>0?`warning`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.vulnerable`),value:Se,hint:e(`activity:techStack.knownAdvisories`),tone:Se>0?`destructive`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.findings`),value:W.length,hint:`${be} need attention`,tone:W.length>0?`info`:`default`})]}),($||i)&&(0,A.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[$&&a&&(0,A.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-info`,children:[(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),(0,A.jsx)(`span`,{className:`font-mono`,children:a.status}),a.progress&&(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[a.progress.completed,`/`,a.progress.total]})]}),i&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>void L(),className:`underline`,children:e(`activity:techStack.retry`)})]})]}),r&&!t?(0,A.jsx)(Q,{}):t?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`nav`,{className:`flex shrink-0 gap-1 border-b border-border/70 px-2`,children:fe.map(t=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-current":o===t.id,className:C(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,o===t.id?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e(t.labelKey),t.id===`findings`&&W.length>0&&(0,A.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:W.length})]},t.id))}),o===`dependencies`&&(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(340px,1fr)_minmax(0,1.15fr)]`,children:[(0,A.jsxs)(`section`,{className:C(`min-h-0 border-r border-border/70`,Z?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:techStack.dependencyList`),children:[(0,A.jsx)(de,{searchQuery:c,ecosystemFilter:f,statusFilter:m,directOnly:_,sort:y,hasFilters:Ce,ecosystems:q,statuses:J,visibleCount:X.length,totalCount:U.length,onSearchChange:u,onEcosystemFilterChange:p,onStatusFilterChange:h,onToggleDirectOnly:()=>v(e=>!e),onSortChange:ne,onClearFilters:we}),(0,A.jsx)(le,{dependencies:X,selectedId:b,hasDependencies:U.length>0,coverageByWorkspaceId:Y,onSelect:e=>x(e.id)})]}),(0,A.jsx)(`section`,{className:C(`min-h-0`,Z?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:techStack.dependencyDetail`),children:Z?(0,A.jsx)(ce,{dependency:Z,findings:pe,deepDive:D,onDeepDive:B,onBack:()=>x(null),coverage:Y.get(Z.workspaceId)}):(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:e(`activity:techStack.selectADependencyToSeeIts`)})})})]}),o===`findings`&&(0,A.jsx)(ue,{findings:W,dependenciesById:G,onSelectDependency:Te}),o===`workspaces`&&(0,A.jsx)(ge,{snapshot:t}),o===`trends`&&(0,A.jsx)(me,{trend:ie}),o===`remediation`&&(0,A.jsx)(he,{plan:M,approved:N,applying:F,onToggle:e=>P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onApply:()=>void V()})]}):(0,A.jsx)(_e,{onScan:()=>void R(`inventory`),disabled:$})]})}function me({trend:e}){return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.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,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,A.jsxs)(`div`,{className:`grid grid-cols-4 border border-border/70 bg-card/40 p-2 text-xs`,children:[(0,A.jsx)(`span`,{children:new Date(e.createdAt).toLocaleDateString()}),(0,A.jsxs)(`span`,{children:[e.dependencies,` deps`]}),(0,A.jsxs)(`span`,{className:`text-warning`,children:[e.outdated,` outdated`]}),(0,A.jsxs)(`span`,{className:`text-destructive`,children:[e.vulnerable,` vulnerable`]})]},e.snapshotId))})]}):(0,A.jsx)(Q,{})}function he({plan:e,approved:t,applying:n,onToggle:r,onApply:i}){let{t:a}=l();return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.warning}),(0,A.jsxs)(T,{size:`sm`,disabled:t.size===0||n,onClick:i,children:[n&&(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),`Apply `,t.size>0?t.size:``]})]}),(0,A.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,A.jsxs)(`label`,{className:C(`flex gap-3 border border-border/70 bg-card/40 p-2.5`,i?`cursor-not-allowed opacity-65`:`cursor-pointer`),children:[(0,A.jsx)(`input`,{type:`checkbox`,disabled:i,checked:t.has(n),onChange:()=>r(n)}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`span`,{className:`block font-mono text-xs`,children:[e.dependencyName,` · `,e.action]}),(0,A.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[e.currentVersion??`?`,` → `,e.targetVersion??`latest`,` · `,e.rationale]}),i&&(0,A.jsx)(`span`,{className:`block text-[10px] text-warning`,children:a(`activity:techStack.requiresAManualPackageChoice`)})]})]},n)}),e.items.length===0&&(0,A.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:a(`activity:techStack.noRemediationNeeded`)})]})]}):(0,A.jsx)(Q,{})}function ge({snapshot:e}){let{t}=l(),n=(0,k.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,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`activity:techStack.noWorkspacesDetected`)})}):(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.workspaces.map(e=>{let r=z[e.coverage];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate font-mono text-xs text-foreground`,children:e.relativeRoot}),(0,A.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem}),(0,A.jsx)(`span`,{children:N(e.ecosystem,t)}),e.packageManager?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(`span`,{children:e.packageManager})]}):null,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsxs)(`span`,{children:[n.get(e.id)??0,` deps`]})]})]}),(0,A.jsx)(`span`,{className:C(`shrink-0 border px-1.5 py-0.5 text-[10px] font-medium`,r.badge),children:t(r.labelKey)})]}),e.manifests.length>0&&(0,A.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.manifests.map(e=>(0,A.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 Q(){let{t:e}=l();return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,A.jsx)(g,{className:`size-5 animate-spin text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:techStack.loadingSnapshot`)})]})})}function _e({onScan:e,disabled:t}){let{t:n}=l(),r=(0,k.useMemo)(()=>Object.values(M).map(e=>e.label??``).filter(Boolean).join(`, `),[]);return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-3 text-center`,children:[(0,A.jsx)(`div`,{className:`flex size-14 items-center justify-center border border-info/25 bg-info/5 text-info`,children:(0,A.jsx)(y,{className:`size-6`})}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`activity:techStack.noInventoryYet`)}),(0,A.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,A.jsxs)(T,{size:`sm`,onClick:e,disabled:t,children:[(0,A.jsx)(re,{className:C(`size-3.5`,t&&`animate-spin`)}),n(`activity:techStack.scanThisProject`)]})]})})}function ve(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]))}function ye(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`techstack.json`,r.click(),URL.revokeObjectURL(n)}export{pe as TechStackView};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ci as t,Di as n,Ea as r,Fr as i,Jt as a,Ln as o,M as s,Nt as c,Pa as l,Un as u,Wt as d,an as f,ca as p,di as m,dt as ee,gi as te,hn as h,ir as g,ki as _,lt as v,sa as y,ut as ne,vn as re,xa as b,za as x,zr as S}from"./vendor-BuarzSSb.js";import"./i18n-COgumVF5.js";import{t as C}from"./utils-B-9lSDIn.js";import{i as w}from"./stores-ChEnUmic.js";import{t as T}from"./button-Dcy288Mc.js";import{t as E}from"./input-fo9-BPBC.js";import{b as D,x as O}from"./index-CtpViiZy.js";var k=e(x(),1),A=v(),ie={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}},ae={labelKey:`activity:techStackStatus.unknown`,badge:`border-border/70 bg-muted text-muted-foreground`,dot:`bg-muted-foreground`,weight:0};function j(e){return ie[e]??ae}var M={npm:{label:`npm / Node.js`,icon:o},python:{label:`Python`,icon:n},rust:{label:`Rust`,icon:a},go:{label:`Go`,icon:h},dotnet:{label:`.NET`,icon:u},php:{label:`PHP`,icon:c},dart:{label:`Dart / Flutter`,icon:t},maven:{label:`Maven`,icon:r},gradle:{label:`Gradle`,icon:p},ruby:{label:`Ruby`,icon:i},swift:{label:`Swift`,icon:ne},elixir:{label:`Elixir`,icon:c},cpp:{label:`C / C++`,icon:_}},oe={labelKey:`activity:techStackStatus.unknown`};function N(e,t){let n=P(e);return n.labelKey?t(n.labelKey):n.label??e}function P(e){return M[e]??oe}function F({ecosystem:e,className:t=`size-3.5 shrink-0`}){let n=P(e);if(!n.icon)return null;let r=n.icon;return(0,A.jsx)(r,{className:t})}function se(e){return j(e.status).weight>=50}var I=[`critical`,`high`,`medium`,`low`,`info`],L={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`}},R={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`},z={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 B(e){return z[e]??z.unsupported}function V(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 H(e){let t=V(e.locked??e.installed??e.requested),n=V(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 U(e){return e.locked??e.installed??e.requested??null}function W(e){return e.confidence<1}function G({className:e,children:t}){return(0,A.jsx)(`span`,{className:C(`inline-flex shrink-0 items-center gap-1 border px-1.5 py-0.5 text-[10px] font-medium`,e),children:t})}function K({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,A.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,A.jsx)(`p`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:e}),(0,A.jsxs)(`div`,{className:`mt-1 flex items-end justify-between gap-2`,children:[(0,A.jsx)(`p`,{className:C(`font-mono text-xl font-bold tabular-nums`,i),children:t}),(0,A.jsx)(`p`,{className:`truncate text-[9px] text-muted-foreground`,children:n})]})]})}function ce({dependency:e,findings:t,deepDive:n,onDeepDive:r,onBack:i,coverage:a}){let{t:o}=l(),s=j(e.status),c=U(e),u=H(e),f=a?B(a).noteKey:void 0;return(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`header`,{className:`shrink-0 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:i,"aria-label":o(`activity:techStack.backToDependencyList`),className:`shrink-0 md:hidden`,children:(0,A.jsx)(b,{className:`size-4`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(`h2`,{className:`min-w-0 truncate font-mono text-sm font-bold text-foreground`,children:e.name}),(0,A.jsx)(G,{className:s.badge,children:o(s.labelKey)})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[N(e.ecosystem,o),` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,f&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,A.jsx)(`span`,{className:`text-warning`,children:o(f)})]})]})]})]}),(0,A.jsxs)(`div`,{className:`mt-2 flex flex-wrap items-baseline gap-2 font-mono text-xs`,children:[(0,A.jsx)(`span`,{className:`text-foreground`,children:c??`—`}),e.latestStable&&e.latestStable!==c&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`text-info`,children:e.latestStable})]}),u.label&&(0,A.jsxs)(`span`,{className:`text-[10px] text-warning`,children:[`(`,u.label,`)`]})]})]}),(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`dl`,{className:`grid grid-cols-2 gap-px border border-border/70 bg-border/60`,children:[(0,A.jsx)(q,{label:o(`activity:techStack.constraint`),value:e.requested??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.locked`),value:e.locked??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.latestStable`),value:e.latestStable??`—`,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.license`),value:e.license??`—`}),e.wanted&&(0,A.jsx)(q,{label:o(`activity:techStack.wanted`),value:e.wanted,mono:!0}),e.resolvable&&(0,A.jsx)(q,{label:o(`activity:techStack.resolvable`),value:e.resolvable,mono:!0}),e.purl&&(0,A.jsx)(q,{label:o(`activity:techStack.purl`),value:e.purl,mono:!0}),(0,A.jsx)(q,{label:o(`activity:techStack.registryFlags`),value:[e.deprecated&&`deprecated`,e.yanked&&`yanked`].filter(Boolean).join(`, `)||`none`})]}),(0,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsx)(`h3`,{className:`text-[9px] font-bold uppercase tracking-[0.16em] text-muted-foreground`,children:o(`activity:techStack.findings`)}),(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>r(e),disabled:n.status===`loading`,className:`h-7 text-[10px]`,children:[n.status===`loading`?(0,A.jsx)(g,{className:`size-3 animate-spin`}):(0,A.jsx)(d,{className:`size-3`}),n.status===`loading`?`Researching…`:`Deep dive`]})]}),n.status===`error`&&n.error&&(0,A.jsx)(`p`,{role:`alert`,className:`mb-1.5 text-[10px] text-destructive`,children:n.error}),t.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.nothingFlaggedRunADeepDive`)}):(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:L[e.severity].badge,children:o(L[e.severity].labelKey)}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?o(R[e.action]):e.action}),W(e)&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(d,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.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,A.jsxs)(`section`,{className:`mt-4`,children:[(0,A.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,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:o(`activity:techStack.noEvidenceRecorded`)}):(0,A.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.evidence.map((t,n)=>(0,A.jsxs)(`li`,{className:`border border-border/70 bg-card/40 p-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:t.kind}),(0,A.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground`,children:new Date(t.retrievedAt).toLocaleString()})]}),t.source.startsWith(`http`)?(0,A.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,A.jsx)(`span`,{className:`truncate`,children:t.source}),(0,A.jsx)(m,{className:`size-2.5 shrink-0`})]}):(0,A.jsx)(`p`,{className:`mt-1 truncate font-mono text-[10px] text-muted-foreground`,children:t.source}),t.detail&&(0,A.jsx)(`p`,{className:`mt-0.5 text-[10px] leading-relaxed text-muted-foreground`,children:t.detail})]},`${e.id}-evidence-${n}`))})]})]})]})}function q({label:e,value:t,mono:n}){return(0,A.jsxs)(`div`,{className:`bg-card/55 px-2.5 py-1.5`,children:[(0,A.jsx)(`dt`,{className:`text-[9px] font-bold uppercase tracking-[0.14em] text-muted-foreground`,children:e}),(0,A.jsx)(`dd`,{className:C(`mt-0.5 truncate text-[11px] text-foreground`,n&&`font-mono`),children:t})]})}var J=`grid grid-cols-[minmax(0,2.2fr)_minmax(0,1.6fr)_minmax(0,1.1fr)] gap-2`;function le({dependencies:e,selectedId:t,hasDependencies:n,coverageByWorkspaceId:r,onSelect:i}){let{t:a}=l(),o=O(e,30);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.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,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsxs)(`div`,{className:C(J,`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,A.jsx)(`span`,{children:a(`activity:techStack.package`)}),(0,A.jsx)(`span`,{children:a(`activity:techStack.installedLatest`)}),(0,A.jsx)(`span`,{children:a(`activity:techStack.status`)})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(s,{className:`h-full`,"aria-label":a(`activity:techStack.dependencies`),children:o.pageItems.map(e=>(0,A.jsx)(Y,{dependency:e,selected:e.id===t,coverage:r?.get(e.workspaceId),onSelect:i},e.id))})}),(0,A.jsx)(D,{page:o.page,pageSize:o.pageSize,totalItems:o.totalItems,onPageChange:o.setPage,itemLabel:`dependencies`})]})}function Y({dependency:e,selected:t,coverage:n,onSelect:r}){let{t:i}=l(),a=j(e.status),o=U(e),s=H(e),c=n?B(n).noteKey:void 0;return(0,A.jsxs)(`button`,{type:`button`,onClick:()=>r(e),"aria-current":t,className:C(J,`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,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,A.jsx)(`span`,{className:C(`size-1.5 shrink-0`,a.dot),"aria-hidden":`true`}),(0,A.jsx)(`span`,{className:`truncate font-mono text-xs text-foreground`,children:e.name})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem,className:`mr-0.5 inline-block size-3 align-text-bottom`}),N(e.ecosystem,i),` · `,e.direct?`direct`:`transitive`,` · `,e.scope,c&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`span`,{className:`text-warning`,children:i(c)})]})]})]}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-1.5 font-mono text-[11px]`,children:[(0,A.jsx)(`span`,{className:`truncate text-foreground`,children:o??`—`}),e.latestStable&&e.latestStable!==o&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`→`}),(0,A.jsx)(`span`,{className:`truncate text-info`,children:e.latestStable})]})]}),s.label?(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:s.label}):e.requested&&(0,A.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[10px] text-muted-foreground`,children:e.requested})]}),(0,A.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1`,children:[(0,A.jsx)(G,{className:a.badge,children:i(a.labelKey)}),e.deprecated&&(0,A.jsx)(G,{className:`border-destructive/35 bg-destructive/10 text-destructive`,children:`dep`}),e.yanked&&(0,A.jsx)(G,{className:`border-destructive/45 bg-destructive/15 text-destructive`,children:`yank`})]})]})}function ue({findings:e,dependenciesById:t,onSelectDependency:n}){let{t:r}=l(),i=O(e,20);return e.length===0?(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsxs)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:[r(`activity:techStack.noFindingsRun`),` `,(0,A.jsx)(`span`,{className:`font-mono text-foreground`,children:r(`activity:techStack.analyze`)}),` `,r(`activity:techStack.toCheckVersionsAndAdvisoriesAgainst`)]})}):(0,A.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-4`,children:I.map(e=>[e,i.pageItems.filter(t=>t.severity===e)]).filter(([,e])=>e.length>0).map(([e,i])=>(0,A.jsxs)(`section`,{children:[(0,A.jsxs)(`div`,{className:`mb-1.5 flex items-center gap-2`,children:[(0,A.jsx)(G,{className:L[e].badge,children:r(L[e].labelKey)}),(0,A.jsx)(`span`,{className:`font-mono text-[10px] tabular-nums text-muted-foreground`,children:i.length})]}),(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:i.map(e=>(0,A.jsx)(X,{finding:e,dependency:t.get(e.dependencyId),onSelectDependency:n},e.id))})]},e))})}),(0,A.jsx)(D,{page:i.page,pageSize:i.pageSize,totalItems:i.totalItems,onPageChange:i.setPage,itemLabel:`findings`})]})}function X({finding:e,dependency:t,onSelectDependency:n}){let{t:r}=l(),i=W(e);return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,A.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,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?r(R[e.action]):e.action}),i&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(d,{className:`size-2.5`}),`AI · `,Math.round(e.confidence*100),`%`]})]}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[11px] leading-relaxed text-muted-foreground`,children:e.rationale}),e.breakingRisk&&(0,A.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,A.jsx)(`ul`,{className:C(`mt-1.5 flex flex-col gap-0.5`),children:e.evidence.slice(0,4).map((t,n)=>(0,A.jsx)(`li`,{className:`min-w-0 truncate text-[10px]`,children:t.source.startsWith(`http`)?(0,A.jsx)(`a`,{href:t.source,target:`_blank`,rel:`noreferrer noopener`,className:`text-info underline-offset-2 hover:underline`,children:t.detail??t.source}):(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:t.detail??t.source})},`${e.id}-${n}`))})]})}function de({searchQuery:e,ecosystemFilter:t,statusFilter:n,directOnly:r,sort:i,hasFilters:a,ecosystems:o,statuses:s,visibleCount:c,totalCount:u,onSearchChange:d,onEcosystemFilterChange:p,onStatusFilterChange:m,onToggleDirectOnly:te,onSortChange:h,onClearFilters:g}){let{t:_}=l();return(0,A.jsxs)(`div`,{className:`shrink-0 space-y-2 border-b border-border/70 bg-card/45 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(`div`,{className:`relative min-w-0 flex-1`,children:[(0,A.jsx)(f,{className:`pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground`}),(0,A.jsx)(E,{"aria-label":_(`activity:techStack.searchDependencies`),value:e,onChange:e=>d(e.target.value),placeholder:_(`activity:techStack.searchByPackageName`),className:`h-10 min-w-0 bg-background pl-9 pr-8 text-xs`}),e&&(0,A.jsx)(`button`,{type:`button`,"aria-label":_(`activity:techStack.clearSearch`),onClick:()=>d(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(ee,{className:`size-3.5`})})]}),(0,A.jsx)(T,{variant:r?`default`:`outline`,size:`sm`,onClick:te,"aria-pressed":r,title:_(`activity:techStack.showOnlyDependenciesThisProjectDeclaresItself`),className:`shrink-0`,children:_(`activity:techStack.directOnly`)}),a&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:g,"aria-label":_(`activity:techStack.clearAllFilters`),title:_(`activity:techStack.clearAllFilters`),className:`shrink-0`,children:(0,A.jsx)(S,{className:`size-4`})})]}),(0,A.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-ecosystem-filter`,children:_(`activity:techStack.filterByEcosystem`)}),(0,A.jsxs)(`select`,{id:`techstack-ecosystem-filter`,value:t,onChange:e=>p(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`all`,children:_(`activity:techStack.allEcosystems`)}),o.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[N(e,_),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:_(`activity:techStack.filterByStatus`)}),(0,A.jsxs)(`select`,{id:`techstack-status-filter`,value:n,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,A.jsx)(`option`,{value:`all`,children:_(`activity:techStack.allStatuses`)}),s.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[_(j(e).labelKey),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:_(`activity:techStack.sortDependencies`)}),(0,A.jsxs)(`select`,{id:`techstack-sort`,value:i,onChange:e=>h(e.target.value),className:`h-9 w-full min-w-0 border border-input bg-background px-2 text-xs`,children:[(0,A.jsx)(`option`,{value:`attention`,children:_(`activity:techStack.sortNeedsAttention`)}),(0,A.jsx)(`option`,{value:`drift`,children:_(`activity:techStack.sortMostOutOfDate`)}),(0,A.jsx)(`option`,{value:`name`,children:_(`activity:techStack.sortName`)})]})]})]}),(0,A.jsx)(`p`,{className:C(`text-[10px] text-muted-foreground`,a&&`text-info`),children:c===u?`${u} dependencies`:`${c} of ${u} dependencies`})]})}var fe=[{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 pe(){let{t:e}=l(),t=w(e=>e.snapshot),n=w(e=>e.stale),r=w(e=>e.loading),i=w(e=>e.error),a=w(e=>e.activeJob),[o,s]=(0,k.useState)(`dependencies`),[c,u]=(0,k.useState)(``),[f,p]=(0,k.useState)(`all`),[m,h]=(0,k.useState)(`all`),[_,v]=(0,k.useState)(!1),[y,ne]=(0,k.useState)(`attention`),[b,x]=(0,k.useState)(null),[S,E]=(0,k.useState)([]),[D,O]=(0,k.useState)({status:`idle`,error:null}),[ie,ae]=(0,k.useState)(null),[M,oe]=(0,k.useState)(null),[N,P]=(0,k.useState)(new Set),[F,I]=(0,k.useState)(!1),L=(0,k.useCallback)(async()=>{let e=w.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))}},[]),R=(0,k.useCallback)(async e=>{let t=w.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))}},[]),z=(0,k.useCallback)(async()=>{let e=w.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}`);w.getState().jobCancelled(e.id)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}},[]),B=(0,k.useCallback)(async e=>{O({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}`);E(n.findings??[]),O({status:`idle`,error:null})}catch(e){O({status:`error`,error:e instanceof Error?e.message:String(e)})}},[]);(0,k.useEffect)(()=>{L()},[L]),(0,k.useEffect)(()=>{o!==`trends`&&o!==`remediation`||fetch(`/api/techstack/${o===`trends`?`trends`:`remediation`}`).then(async e=>{let t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);t.trend&&ae(t.trend),t.plan&&oe(t.plan)}).catch(e=>w.getState().setError(e instanceof Error?e.message:String(e)))},[o,t?.id]);let V=(0,k.useCallback)(async()=>{if(N.size!==0){I(!0);try{let e=await fetch(`/api/techstack/remediation/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({approvedItems:[...N]})}),t=await e.json();if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);P(new Set),await R(`inventory`)}catch(e){w.getState().setError(e instanceof Error?e.message:String(e))}finally{I(!1)}}},[N,R]);(0,k.useEffect)(()=>{E([]),O({status:`idle`,error:null})},[t?.id]);let U=(0,k.useMemo)(()=>t?.dependencies??[],[t]),W=(0,k.useMemo)(()=>t?.findings??[],[t]),G=(0,k.useMemo)(()=>new Map(U.map(e=>[e.id,e])),[U]),q=(0,k.useMemo)(()=>ve(U.map(e=>e.ecosystem)),[U]),J=(0,k.useMemo)(()=>ve(U.map(e=>e.status)),[U]),Y=(0,k.useMemo)(()=>new Map(t?.workspaces.map(e=>[e.id,e.coverage])??[]),[t]),X=(0,k.useMemo)(()=>{let e=c.trim().toLowerCase(),t=[...U.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||f!==`all`&&t.ecosystem!==f||m!==`all`&&t.status!==m||_&&!t.direct))];return y===`name`?t.sort((e,t)=>e.name.localeCompare(t.name)):y===`drift`?t.sort((e,t)=>H(t).majorsBehind-H(e).majorsBehind||e.name.localeCompare(t.name)):t.sort((e,t)=>j(t.status).weight-j(e.status).weight||Number(t.direct)-Number(e.direct)||e.name.localeCompare(t.name)),t},[U,c,f,m,_,y]),Z=b?G.get(b):void 0,pe=(0,k.useMemo)(()=>Z?[...W.filter(e=>e.dependencyId===Z.id),...S.filter(e=>e.dependencyId===Z.id)]:[],[W,S,Z]),be=(0,k.useMemo)(()=>U.filter(se).length,[U]),xe=(0,k.useMemo)(()=>U.filter(e=>H(e).majorsBehind>0).length,[U]),Se=(0,k.useMemo)(()=>U.filter(e=>e.status===`vulnerable`).length,[U]),Ce=c.trim()!==``||f!==`all`||m!==`all`||_,we=(0,k.useCallback)(()=>{u(``),p(`all`),h(`all`),v(!1)},[]),$=!!(a&&![`completed`,`failed`,`cancelled`].includes(a.status)),Te=(0,k.useCallback)(e=>{x(e),s(`dependencies`)},[]);return(0,A.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,A.jsx)(`header`,{className:`shrink-0 border-b border-border/70 px-4 py-3`,children:(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsx)(`h1`,{className:`text-base font-bold sm:text-lg`,children:e(`activity:techStack.techstack`)}),(0,A.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:t?`${t.workspaces.length} workspaces`:`no scan yet`}),n&&(0,A.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,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground sm:text-xs`,children:t?`${t.targetRoot} · scanned ${new Date(t.createdAt).toLocaleString()}`:`Scan the open project to inventory its dependencies.`})]}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,A.jsxs)(T,{variant:`outline`,size:`sm`,onClick:()=>void R(`inventory`),disabled:$,title:e(`activity:techStack.offlineReReadManifestsAndLockfiles`),children:[(0,A.jsx)(re,{className:C(`size-3.5`,$&&`animate-spin`)}),(0,A.jsx)(`span`,{className:`hidden sm:inline`,children:e(`activity:techStack.refresh`)})]}),(0,A.jsxs)(T,{size:`sm`,onClick:()=>void R(`analyze`),disabled:$,title:e(`activity:techStack.checkRegistriesAndAdvisoriesThenInterpretTheResultsWithTheModel`),children:[(0,A.jsx)(d,{className:`size-3.5`}),e(`activity:techStack.analyze`)]}),$&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>void z(),"aria-label":e(`activity:techStack.cancelJob`),children:(0,A.jsx)(ee,{className:`size-4`})}),(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:()=>t&&ye(t),disabled:!t,"aria-label":e(`activity:techStack.exportSnapshotAsJson`),title:e(`activity:techStack.exportSnapshotAsJson`),children:(0,A.jsx)(te,{className:`size-4`})})]})]})}),t&&(0,A.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,A.jsx)(K,{label:e(`activity:techStack.dependencies`),value:U.length,hint:`${X.length} visible`}),(0,A.jsx)(K,{label:e(`activity:techStack.outdated`),value:xe,hint:e(`activity:techStack.majorsBehind`),tone:xe>0?`warning`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.vulnerable`),value:Se,hint:e(`activity:techStack.knownAdvisories`),tone:Se>0?`destructive`:`success`}),(0,A.jsx)(K,{label:e(`activity:techStack.findings`),value:W.length,hint:`${be} need attention`,tone:W.length>0?`info`:`default`})]}),($||i)&&(0,A.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-2`,"aria-live":`polite`,children:[$&&a&&(0,A.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2 text-xs text-info`,children:[(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),(0,A.jsx)(`span`,{className:`font-mono`,children:a.status}),a.progress&&(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[a.progress.completed,`/`,a.progress.total]})]}),i&&(0,A.jsxs)(`div`,{role:`alert`,className:`flex items-center gap-2 text-xs text-destructive`,children:[(0,A.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:i}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>void L(),className:`underline`,children:e(`activity:techStack.retry`)})]})]}),r&&!t?(0,A.jsx)(Q,{}):t?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`nav`,{className:`flex shrink-0 gap-1 border-b border-border/70 px-2`,children:fe.map(t=>(0,A.jsxs)(`button`,{type:`button`,onClick:()=>s(t.id),"aria-current":o===t.id,className:C(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,o===t.id?`border-primary text-foreground`:`border-transparent text-muted-foreground hover:text-foreground`),children:[e(t.labelKey),t.id===`findings`&&W.length>0&&(0,A.jsx)(`span`,{className:`ml-1.5 font-mono text-[10px] tabular-nums text-muted-foreground`,children:W.length})]},t.id))}),o===`dependencies`&&(0,A.jsxs)(`div`,{className:`grid min-h-0 flex-1 md:grid-cols-[minmax(340px,1fr)_minmax(0,1.15fr)]`,children:[(0,A.jsxs)(`section`,{className:C(`min-h-0 border-r border-border/70`,Z?`hidden md:flex md:flex-col`:`flex flex-col`),"aria-label":e(`activity:techStack.dependencyList`),children:[(0,A.jsx)(de,{searchQuery:c,ecosystemFilter:f,statusFilter:m,directOnly:_,sort:y,hasFilters:Ce,ecosystems:q,statuses:J,visibleCount:X.length,totalCount:U.length,onSearchChange:u,onEcosystemFilterChange:p,onStatusFilterChange:h,onToggleDirectOnly:()=>v(e=>!e),onSortChange:ne,onClearFilters:we}),(0,A.jsx)(le,{dependencies:X,selectedId:b,hasDependencies:U.length>0,coverageByWorkspaceId:Y,onSelect:e=>x(e.id)})]}),(0,A.jsx)(`section`,{className:C(`min-h-0`,Z?`flex flex-col`:`hidden md:flex md:flex-col`),"aria-label":e(`activity:techStack.dependencyDetail`),children:Z?(0,A.jsx)(ce,{dependency:Z,findings:pe,deepDive:D,onDeepDive:B,onBack:()=>x(null),coverage:Y.get(Z.workspaceId)}):(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8 text-center`,children:(0,A.jsx)(`p`,{className:`max-w-xs text-xs text-muted-foreground`,children:e(`activity:techStack.selectADependencyToSeeIts`)})})})]}),o===`findings`&&(0,A.jsx)(ue,{findings:W,dependenciesById:G,onSelectDependency:Te}),o===`workspaces`&&(0,A.jsx)(ge,{snapshot:t}),o===`trends`&&(0,A.jsx)(me,{trend:ie}),o===`remediation`&&(0,A.jsx)(he,{plan:M,approved:N,applying:F,onToggle:e=>P(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}),onApply:()=>void V()})]}):(0,A.jsx)(_e,{onScan:()=>void R(`inventory`),disabled:$})]})}function me({trend:e}){return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.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,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.points.map(e=>(0,A.jsxs)(`div`,{className:`grid grid-cols-4 border border-border/70 bg-card/40 p-2 text-xs`,children:[(0,A.jsx)(`span`,{children:new Date(e.createdAt).toLocaleDateString()}),(0,A.jsxs)(`span`,{children:[e.dependencies,` deps`]}),(0,A.jsxs)(`span`,{className:`text-warning`,children:[e.outdated,` outdated`]}),(0,A.jsxs)(`span`,{className:`text-destructive`,children:[e.vulnerable,` vulnerable`]})]},e.snapshotId))})]}):(0,A.jsx)(Q,{})}function he({plan:e,approved:t,applying:n,onToggle:r,onApply:i}){let{t:a}=l();return e?(0,A.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:[(0,A.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3`,children:[(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.warning}),(0,A.jsxs)(T,{size:`sm`,disabled:t.size===0||n,onClick:i,children:[n&&(0,A.jsx)(g,{className:`size-3.5 animate-spin`}),`Apply `,t.size>0?t.size:``]})]}),(0,A.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,A.jsxs)(`label`,{className:C(`flex gap-3 border border-border/70 bg-card/40 p-2.5`,i?`cursor-not-allowed opacity-65`:`cursor-pointer`),children:[(0,A.jsx)(`input`,{type:`checkbox`,disabled:i,checked:t.has(n),onChange:()=>r(n)}),(0,A.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,A.jsxs)(`span`,{className:`block font-mono text-xs`,children:[e.dependencyName,` · `,e.action]}),(0,A.jsxs)(`span`,{className:`block text-[10px] text-muted-foreground`,children:[e.currentVersion??`?`,` → `,e.targetVersion??`latest`,` · `,e.rationale]}),i&&(0,A.jsx)(`span`,{className:`block text-[10px] text-warning`,children:a(`activity:techStack.requiresAManualPackageChoice`)})]})]},n)}),e.items.length===0&&(0,A.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:a(`activity:techStack.noRemediationNeeded`)})]})]}):(0,A.jsx)(Q,{})}function ge({snapshot:e}){let{t}=l(),n=(0,k.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,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t(`activity:techStack.noWorkspacesDetected`)})}):(0,A.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto p-3`,children:(0,A.jsx)(`div`,{className:`flex flex-col gap-1.5`,children:e.workspaces.map(e=>{let r=z[e.coverage];return(0,A.jsxs)(`div`,{className:`border border-border/70 bg-card/40 p-2.5`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`p`,{className:`truncate font-mono text-xs text-foreground`,children:e.relativeRoot}),(0,A.jsxs)(`p`,{className:`mt-0.5 flex items-center gap-1 truncate text-[10px] text-muted-foreground`,children:[(0,A.jsx)(F,{ecosystem:e.ecosystem}),(0,A.jsx)(`span`,{children:N(e.ecosystem,t)}),e.packageManager?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsx)(`span`,{children:e.packageManager})]}):null,(0,A.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,A.jsxs)(`span`,{children:[n.get(e.id)??0,` deps`]})]})]}),(0,A.jsx)(`span`,{className:C(`shrink-0 border px-1.5 py-0.5 text-[10px] font-medium`,r.badge),children:t(r.labelKey)})]}),e.manifests.length>0&&(0,A.jsx)(`div`,{className:`mt-1.5 flex flex-wrap gap-1`,children:e.manifests.map(e=>(0,A.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 Q(){let{t:e}=l();return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,A.jsx)(g,{className:`size-5 animate-spin text-muted-foreground`}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e(`activity:techStack.loadingSnapshot`)})]})})}function _e({onScan:e,disabled:t}){let{t:n}=l(),r=(0,k.useMemo)(()=>Object.values(M).map(e=>e.label??``).filter(Boolean).join(`, `),[]);return(0,A.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-8`,children:(0,A.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-3 text-center`,children:[(0,A.jsx)(`div`,{className:`flex size-14 items-center justify-center border border-info/25 bg-info/5 text-info`,children:(0,A.jsx)(y,{className:`size-6`})}),(0,A.jsx)(`h2`,{className:`text-sm font-semibold`,children:n(`activity:techStack.noInventoryYet`)}),(0,A.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,A.jsxs)(T,{size:`sm`,onClick:e,disabled:t,children:[(0,A.jsx)(re,{className:C(`size-3.5`,t&&`animate-spin`)}),n(`activity:techStack.scanThisProject`)]})]})})}function ve(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]))}function ye(e){let t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`techstack.json`,r.click(),URL.revokeObjectURL(n)}export{pe as TechStackView};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Cn as t,La as n,Pa as r,Vt as i,dt as a,jt as o,lt as s,mn as c,za as l}from"./vendor-BuarzSSb.js";import"./i18n-C31PI0Up.js";import{t as u}from"./ws-client-Bw1ixxwI.js";import{n as d,t as f}from"./utils-B-9lSDIn.js";import{t as p}from"./session-store-b2KGFwkX.js";import{F as m}from"./stores-OBoFiAKe.js";import{n as h}from"./ui-store-CE4-TlwB.js";import{n as g,t as _}from"./xterm-DUBp1lnG.js";var v=e(l(),1),y=`wrongstack.terminalDockHeight`;function b(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var x=s(),S={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`},C=8;function w(e=!1){return typeof window>`u`?300:b(window.innerHeight*(e?.32:.4))}function T(e=!1){if(typeof window>`u`)return w(e);try{let t=window.localStorage.getItem(y),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?b(n):w(e)}catch{return w(e)}}function E(e){try{window.localStorage.setItem(y,String(b(e)))}catch{}}function D(){return d()}function O(e){return{id:D(),name:`Terminal ${e}`,status:`starting`}}function k({desktopShell:e=!1,onClose:n}){let s=(0,v.useRef)(null),{t:l}=r(),u=(0,v.useRef)(1),[d,m]=(0,v.useState)(()=>T(e)),[g,_]=(0,v.useState)(()=>[O(1)]),[y,S]=(0,v.useState)(()=>g[0]?.id??``),w=h(e=>e.terminalCreateNonce),k=(0,v.useRef)(w),j=p(e=>e.projectName),M=p(e=>e.cwd);(0,v.useEffect)(()=>{let e=()=>{m(e=>{let t=b(e);return E(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),s.current?.();let t=e.clientY,n=d,r=document.body.style.cursor,i=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let a=e=>{let r=b(n+t-e.clientY);m(r),E(r)},o=()=>{document.body.style.cursor=r,document.body.style.userSelect=i,window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),s.current===o&&(s.current=null)};s.current=o,window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o,{once:!0}),window.addEventListener(`pointercancel`,o,{once:!0})};(0,v.useEffect)(()=>()=>s.current?.(),[]);let P=()=>{_(e=>{if(e.length>=C)return e;u.current+=1;let t=O(u.current);return S(t.id),[...e,t]})};(0,v.useEffect)(()=>{w!==k.current&&(k.current=w,P())},[w]);let F=e=>{_(t=>{let r=t.findIndex(t=>t.id===e);if(r===-1)return t;let i=t.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(n),i):(y===e&&S(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=D();_(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&S(t),i})},L=()=>{_([]),S(``),queueMicrotask(n)},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,x.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:d},"data-shell":e?`desktop`:`browser`,className:f(`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,x.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,x.jsxs)(`div`,{className:f(`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,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-foreground`,children:[(0,x.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,x.jsx)(`span`,{className:`font-medium`,children:l(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:j||M||l(`activity:terminal.projectShell`)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=C,title:g.length>=C?l(`activity:terminal.maxTerminals`,{count:C}):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,x.jsx)(t,{className:`h-4 w-4`})}),(0,x.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,x.jsx)(c,{className:`h-3.5 w-3.5`})}),(0,x.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,x.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,x.jsx)(`button`,{type:`button`,onClick:n,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,x.jsx)(a,{className:`h-4 w-4`})})]})]}),(0,x.jsx)(`div`,{className:f(`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,x.jsxs)(`div`,{className:f(`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,x.jsxs)(`button`,{type:`button`,onClick:()=>S(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,x.jsx)(`span`,{className:f(`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,x.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,x.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,x.jsx)(a,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,x.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,x.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,x.jsx)(A,{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 A({id:e,active:t,onRunning:r,onExit:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(r),l=(0,v.useRef)(i),d=m(e=>e.wsConnected);return(0,v.useEffect)(()=>{c.current=r,l.current=i},[i,r]),(0,v.useEffect)(()=>{let t=a.current;if(!t)return;let r=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:S,scrollback:5e3}),i=new g;o.current=r,s.current=i,r.loadAddon(i),r.open(t);try{i.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:r.cols,rows:r.rows}});let f=!1,p=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(f||(f=!0,c.current()),r.write(t.payload.data))}),h=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(r.write(`\r\n\x1b[2m${n.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),v=r.onData(t=>{d.send({type:`terminal.input`,payload:{id:e,data:t}})}),y=new ResizeObserver(()=>{if(t.offsetParent)try{i.fit(),d.send({type:`terminal.resize`,payload:{id:e,cols:r.cols,rows:r.rows}})}catch{}});return y.observe(t),()=>{p(),h(),v.dispose(),y.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),r.dispose(),o.current=null,s.current=null}},[e,d]),(0,v.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{s.current?.fit();let t=o.current;t&&(u(m.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,x.jsx)(`div`,{ref:a,className:f(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{k as TerminalPanel};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Cn as t,La as n,Pa as r,Vt as i,dt as a,jt as o,lt as s,mn as c,za as l}from"./vendor-BuarzSSb.js";import"./i18n-COgumVF5.js";import{t as u}from"./ws-client-TTMa0XaT.js";import{n as d,t as f}from"./utils-B-9lSDIn.js";import{t as p}from"./session-store-Df7_hhe9.js";import{I as m}from"./stores-ChEnUmic.js";import{n as h}from"./ui-store-CE4-TlwB.js";import{n as g,t as _}from"./xterm-DUBp1lnG.js";var v=e(l(),1),y=`wrongstack.terminalDockHeight`;function b(e){let t=typeof window>`u`?640:Math.max(140,Math.min(640,Math.floor(window.innerHeight*.55),window.innerHeight-260));return Math.min(Math.max(Math.round(e),140),t)}var x=s(),S={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`},C=8;function w(e=!1){return typeof window>`u`?300:b(window.innerHeight*(e?.32:.4))}function T(e=!1){if(typeof window>`u`)return w(e);try{let t=window.localStorage.getItem(y),n=t?Number.parseInt(t,10):NaN;return Number.isFinite(n)?b(n):w(e)}catch{return w(e)}}function E(e){try{window.localStorage.setItem(y,String(b(e)))}catch{}}function D(){return d()}function O(e){return{id:D(),name:`Terminal ${e}`,status:`starting`}}function k({desktopShell:e=!1,onClose:n}){let s=(0,v.useRef)(null),{t:l}=r(),u=(0,v.useRef)(1),[d,m]=(0,v.useState)(()=>T(e)),[g,_]=(0,v.useState)(()=>[O(1)]),[y,S]=(0,v.useState)(()=>g[0]?.id??``),w=h(e=>e.terminalCreateNonce),k=(0,v.useRef)(w),j=p(e=>e.projectName),M=p(e=>e.cwd);(0,v.useEffect)(()=>{let e=()=>{m(e=>{let t=b(e);return E(t),t})};return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let N=e=>{e.preventDefault(),s.current?.();let t=e.clientY,n=d,r=document.body.style.cursor,i=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let a=e=>{let r=b(n+t-e.clientY);m(r),E(r)},o=()=>{document.body.style.cursor=r,document.body.style.userSelect=i,window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),s.current===o&&(s.current=null)};s.current=o,window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o,{once:!0}),window.addEventListener(`pointercancel`,o,{once:!0})};(0,v.useEffect)(()=>()=>s.current?.(),[]);let P=()=>{_(e=>{if(e.length>=C)return e;u.current+=1;let t=O(u.current);return S(t.id),[...e,t]})};(0,v.useEffect)(()=>{w!==k.current&&(k.current=w,P())},[w]);let F=e=>{_(t=>{let r=t.findIndex(t=>t.id===e);if(r===-1)return t;let i=t.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(n),i):(y===e&&S(i[Math.max(0,r-1)]?.id??i[0]?.id??``),i)})},I=e=>{let t=D();_(n=>{let r=!1,i=n.map(n=>n.id===e?(r=!0,{...n,id:t,status:`starting`,exitCode:void 0}):n);return r&&S(t),i})},L=()=>{_([]),S(``),queueMicrotask(n)},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,x.jsxs)(`div`,{"data-terminal-dock":!0,style:{height:d},"data-shell":e?`desktop`:`browser`,className:f(`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,x.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,x.jsxs)(`div`,{className:f(`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,x.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-xs text-foreground`,children:[(0,x.jsx)(i,{className:`h-3.5 w-3.5 shrink-0 text-primary`}),(0,x.jsx)(`span`,{className:`font-medium`,children:l(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:j||M||l(`activity:terminal.projectShell`)})]}),(0,x.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,x.jsx)(`button`,{type:`button`,onClick:P,disabled:g.length>=C,title:g.length>=C?l(`activity:terminal.maxTerminals`,{count:C}):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,x.jsx)(t,{className:`h-4 w-4`})}),(0,x.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,x.jsx)(c,{className:`h-3.5 w-3.5`})}),(0,x.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,x.jsx)(o,{className:`h-3.5 w-3.5`})}),(0,x.jsx)(`button`,{type:`button`,onClick:n,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,x.jsx)(a,{className:`h-4 w-4`})})]})]}),(0,x.jsx)(`div`,{className:f(`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,x.jsxs)(`div`,{className:f(`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,x.jsxs)(`button`,{type:`button`,onClick:()=>S(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,x.jsx)(`span`,{className:f(`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,x.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[t.name,t.status===`exited`&&typeof t.exitCode==`number`?` (${t.exitCode})`:``]})]}),(0,x.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,x.jsx)(a,{className:`h-3 w-3`})})]},t.id))}),M&&!e&&(0,x.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,x.jsx)(`div`,{className:`relative min-h-0 min-w-0 flex-1 overflow-hidden`,children:g.map(e=>(0,x.jsx)(A,{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 A({id:e,active:t,onRunning:r,onExit:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(r),l=(0,v.useRef)(i),d=m(e=>e.wsConnected);return(0,v.useEffect)(()=>{c.current=r,l.current=i},[i,r]),(0,v.useEffect)(()=>{let t=a.current;if(!t)return;let r=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:S,scrollback:5e3}),i=new g;o.current=r,s.current=i,r.loadAddon(i),r.open(t);try{i.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:r.cols,rows:r.rows}});let f=!1,p=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(f||(f=!0,c.current()),r.write(t.payload.data))}),h=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(r.write(`\r\n\x1b[2m${n.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),v=r.onData(t=>{d.send({type:`terminal.input`,payload:{id:e,data:t}})}),y=new ResizeObserver(()=>{if(t.offsetParent)try{i.fit(),d.send({type:`terminal.resize`,payload:{id:e,cols:r.cols,rows:r.rows}})}catch{}});return y.observe(t),()=>{p(),h(),v.dispose(),y.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),r.dispose(),o.current=null,s.current=null}},[e,d]),(0,v.useEffect)(()=>{t&&window.requestAnimationFrame(()=>{try{s.current?.fit();let t=o.current;t&&(u(m.getState().wsUrl).send({type:`terminal.resize`,payload:{id:e,cols:t.cols,rows:t.rows}}),t.focus())}catch{}})},[t,e]),(0,x.jsx)(`div`,{ref:a,className:f(`absolute inset-0 min-h-0 min-w-0 overflow-hidden px-2 py-1`,t?`block`:`hidden`)})}export{k as TerminalPanel};
@@ -1 +1 @@
1
- import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ii as t,La as n,Na as r,Ot as i,Pa as a,Wi as o,br as s,dt as c,lt as l,za as u}from"./vendor-BuarzSSb.js";import"./i18n-C31PI0Up.js";import{n as d,t as f}from"./utils-B-9lSDIn.js";var p=e(u(),1),m=l();function h(){return`toast_${d()}`}var g=8e3,_=r(e=>({toasts:[],push:t=>{let n=h();return e(e=>({toasts:[...e.toasts,{...t,id:n}]})),n},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),v={success:(e,t=3500)=>_.getState().push({message:e,variant:`success`,ttl:t}),error:(e,t=6e3)=>_.getState().push({message:e,variant:`error`,ttl:t}),warn:(e,t=4500)=>_.getState().push({message:e,variant:`warn`,ttl:t}),info:(e,t=3500)=>_.getState().push({message:e,variant:`info`,ttl:t}),undoable:(e,t,r=n.t(`common:action.undo`),i=g)=>_.getState().push({message:e,variant:`info`,ttl:i,action:{label:r,onClick:t}}),dismiss:e=>_.getState().dismiss(e)};function y({variant:e}){return e===`success`?(0,m.jsx)(o,{className:`h-4 w-4 text-success`}):e===`error`?(0,m.jsx)(t,{className:`h-4 w-4 text-destructive`}):e===`warn`?(0,m.jsx)(i,{className:`h-4 w-4 text-warning`}):(0,m.jsx)(s,{className:`h-4 w-4 text-info`})}function b({entry:e}){let{t}=a(),n=_(e=>e.dismiss);return(0,p.useEffect)(()=>{let t=setTimeout(()=>n(e.id),e.ttl);return()=>clearTimeout(t)},[e.id,e.ttl,n]),(0,m.jsxs)(`div`,{className:f(`flex items-start gap-2 rounded-lg border bg-popover shadow-lg px-3 py-2 text-sm max-w-sm`,`animate-message`,e.variant===`error`&&`border-destructive/40`,e.variant===`warn`&&`border-warning/40`,e.variant===`success`&&`border-success/40`),children:[(0,m.jsx)(y,{variant:e.variant}),(0,m.jsx)(`div`,{className:`flex-1 min-w-0 whitespace-pre-wrap break-words leading-snug`,children:e.message}),e.action&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.onClick(),n(e.id)},className:`shrink-0 font-medium text-primary hover:underline`,children:e.action.label}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),className:`text-muted-foreground hover:text-foreground`,title:t(`activity:toast.dismiss`),"aria-label":t(`activity:toast.dismiss`),children:(0,m.jsx)(c,{className:`h-3.5 w-3.5`})})]})}function x(){let{t:e}=a(),t=_(e=>e.toasts);return t.length===0?null:(0,m.jsx)(`section`,{className:`fixed bottom-4 right-4 z-[60] flex flex-col gap-2 pointer-events-auto`,"aria-label":e(`activity:toaster.notifications`),"aria-live":`polite`,children:t.map(e=>(0,m.jsx)(b,{entry:e},e.id))})}export{v as n,x as t};
1
+ import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ii as t,La as n,Na as r,Ot as i,Pa as a,Wi as o,br as s,dt as c,lt as l,za as u}from"./vendor-BuarzSSb.js";import"./i18n-COgumVF5.js";import{n as d,t as f}from"./utils-B-9lSDIn.js";var p=e(u(),1),m=l();function h(){return`toast_${d()}`}var g=8e3,_=r(e=>({toasts:[],push:t=>{let n=h();return e(e=>({toasts:[...e.toasts,{...t,id:n}]})),n},dismiss:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)}))})),v={success:(e,t=3500)=>_.getState().push({message:e,variant:`success`,ttl:t}),error:(e,t=6e3)=>_.getState().push({message:e,variant:`error`,ttl:t}),warn:(e,t=4500)=>_.getState().push({message:e,variant:`warn`,ttl:t}),info:(e,t=3500)=>_.getState().push({message:e,variant:`info`,ttl:t}),undoable:(e,t,r=n.t(`common:action.undo`),i=g)=>_.getState().push({message:e,variant:`info`,ttl:i,action:{label:r,onClick:t}}),dismiss:e=>_.getState().dismiss(e)};function y({variant:e}){return e===`success`?(0,m.jsx)(o,{className:`h-4 w-4 text-success`}):e===`error`?(0,m.jsx)(t,{className:`h-4 w-4 text-destructive`}):e===`warn`?(0,m.jsx)(i,{className:`h-4 w-4 text-warning`}):(0,m.jsx)(s,{className:`h-4 w-4 text-info`})}function b({entry:e}){let{t}=a(),n=_(e=>e.dismiss);return(0,p.useEffect)(()=>{let t=setTimeout(()=>n(e.id),e.ttl);return()=>clearTimeout(t)},[e.id,e.ttl,n]),(0,m.jsxs)(`div`,{className:f(`flex items-start gap-2 rounded-lg border bg-popover shadow-lg px-3 py-2 text-sm max-w-sm`,`animate-message`,e.variant===`error`&&`border-destructive/40`,e.variant===`warn`&&`border-warning/40`,e.variant===`success`&&`border-success/40`),children:[(0,m.jsx)(y,{variant:e.variant}),(0,m.jsx)(`div`,{className:`flex-1 min-w-0 whitespace-pre-wrap break-words leading-snug`,children:e.message}),e.action&&(0,m.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.onClick(),n(e.id)},className:`shrink-0 font-medium text-primary hover:underline`,children:e.action.label}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>n(e.id),className:`text-muted-foreground hover:text-foreground`,title:t(`activity:toast.dismiss`),"aria-label":t(`activity:toast.dismiss`),children:(0,m.jsx)(c,{className:`h-3.5 w-3.5`})})]})}function x(){let{t:e}=a(),t=_(e=>e.toasts);return t.length===0?null:(0,m.jsx)(`section`,{className:`fixed bottom-4 right-4 z-[60] flex flex-col gap-2 pointer-events-auto`,"aria-label":e(`activity:toaster.notifications`),"aria-live":`polite`,children:t.map(e=>(0,m.jsx)(b,{entry:e},e.id))})}export{v as n,x as t};