@wrongstack/webui 0.302.2 → 0.303.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.
- package/dist/assets/AgentRosterView-BnnhSRau.js +9 -0
- package/dist/assets/{AnalyticsDashboard-C9aPEyov.js → AnalyticsDashboard-CMs176Dp.js} +1 -1
- package/dist/assets/{AudienceMemoryPanel-Bciki41o.js → AudienceMemoryPanel-BRXM47H1.js} +2 -2
- package/dist/assets/{ChangesView-DumffowD.js → ChangesView-DxAQY4v4.js} +1 -1
- package/dist/assets/ChronicleDashboard-DPI_5S2R.js +1 -0
- package/dist/assets/CodeEditor-9Fu9hRrw.js +1 -0
- package/dist/assets/CodeMap-B7YGx2G0.js +1 -0
- package/dist/assets/{ConfirmModal-CdKg3EOQ.js → ConfirmModal-DXy17_uy.js} +1 -1
- package/dist/assets/{CronJobsPanel-CJ7Vc1Am.js → CronJobsPanel-C_bGieGQ.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-DaeHUzc5.js → DeadCodeScanPanel-hkBvamWn.js} +2 -2
- package/dist/assets/{DebugDashboard-BI3EmXrM.js → DebugDashboard-CDWJ9nLR.js} +1 -1
- package/dist/assets/{DesignGalleryView-DMW6Ab__.js → DesignGalleryView-BG-p6kFX.js} +1 -1
- package/dist/assets/GoalView-CCklBpTx.js +1 -0
- package/dist/assets/KanbanView-Dzvn9y79.js +3 -0
- package/dist/assets/MailboxDetailView-7dtt5joR.js +1 -0
- package/dist/assets/MemoryDrawer-D2Yq9oba.js +1 -0
- package/dist/assets/MemoryManager-CL5AiyKr.js +1 -0
- package/dist/assets/{ModelPicker-IOZSUnqM.js → ModelPicker-BazB-GbH.js} +1 -1
- package/dist/assets/OfficeMapPanel-Dtb75DlY.js +4 -0
- package/dist/assets/{ProcessMonitor-TGqyXxmB.js → ProcessMonitor-BTjaxnO-.js} +1 -1
- package/dist/assets/{QueuePanel-5aMgQbHv.js → QueuePanel-BOD9qtHp.js} +1 -1
- package/dist/assets/{RefreshDebugView-DfBYFPEF.js → RefreshDebugView-DfbZ-vgF.js} +1 -1
- package/dist/assets/{RequirementIntakeView-CNAFKiQ3.js → RequirementIntakeView-CeZFJlrn.js} +1 -1
- package/dist/assets/SageTabs-BlK58zgb.js +2 -0
- package/dist/assets/SddFlowGraph-DWphr6Tr.js +1 -0
- package/dist/assets/SddHub-ZRkMmA7e.js +2 -0
- package/dist/assets/{SessionInspectView-CytBw7Y9.js → SessionInspectView-DqrSHseG.js} +1 -1
- package/dist/assets/SessionList-DLoIKc1b.js +1 -0
- package/dist/assets/{SessionsDashboard-CridPbkX.js → SessionsDashboard-CUj2WSYM.js} +1 -1
- package/dist/assets/SetupScreen-B_2CuLeR.js +1 -0
- package/dist/assets/SkillDetailView-ChspOaAw.js +3 -0
- package/dist/assets/{SpecsView-DUx1sgtH.js → SpecsView-Cl4vpAoL.js} +1 -1
- package/dist/assets/{TechStackView-CvUiAISX.js → TechStackView-DsFV85XT.js} +1 -1
- package/dist/assets/{TerminalPanel-Dg5hqYTA.js → TerminalPanel-GraS3zw1.js} +1 -1
- package/dist/assets/{Toaster-BgN2bRJx.js → Toaster-D76T-Ld4.js} +1 -1
- package/dist/assets/{button-Dcy288Mc.js → button-ELs5xgtQ.js} +1 -1
- package/dist/assets/{chat-store-DbxFVDwi.js → chat-store-CBJ1gc8n.js} +1 -1
- package/dist/assets/{codemap-activity-store-DQfjo7-j.js → codemap-activity-store-D67-genN.js} +1 -1
- package/dist/assets/codemap-index-store-ByAYIzQA.js +1 -0
- package/dist/assets/{dialog-ftgTihmF.js → dialog-CfAoIH8P.js} +1 -1
- package/dist/assets/{empty-state-RRSqQaCk.js → empty-state-BDwjdvMh.js} +1 -1
- package/dist/assets/{i18n-9T7iGYgW.js → i18n-BvFgJYE2.js} +2 -2
- package/dist/assets/index-BTRQG7C5.js +132 -0
- package/dist/assets/index-DHsJniTZ.css +1 -0
- package/dist/assets/{input-fo9-BPBC.js → input-DSTQkMEh.js} +1 -1
- package/dist/assets/{mailbox-store-C1mzoSqJ.js → mailbox-store-CKpkM0H1.js} +1 -1
- package/dist/assets/{roster-ws-Da57e_sI.js → roster-ws-a3-SO1Yb.js} +1 -1
- package/dist/assets/{session-store-Df7_hhe9.js → session-store-Ce4Dck2K.js} +1 -1
- package/dist/assets/settings-BUtmAZBV.js +1 -0
- package/dist/assets/settings-BlMNd_AC.js +1 -0
- package/dist/assets/settings-ClpzPWKE.js +1 -0
- package/dist/assets/settings-CyYYbmdR.js +1 -0
- package/dist/assets/settings-DyIEVRJT.js +1 -0
- package/dist/assets/settings-Orwkg3lH.js +1 -0
- package/dist/assets/settings-XRC0dC9D.js +1 -0
- package/dist/assets/{shared-KAzksK0C.js → shared-D368RBth.js} +1 -1
- package/dist/assets/stores-BATHCuMN.js +7 -0
- package/dist/assets/{ui-store-CE4-TlwB.js → ui-store-BGNdg1e4.js} +1 -1
- package/dist/assets/{useWebSocket-CZSpbA3M.js → useWebSocket-B2opfRwA.js} +3 -3
- package/dist/assets/utils-CUCQrODG.js +1 -0
- package/dist/assets/{vendor-BuarzSSb.js → vendor-GiKfK4Iw.js} +30 -30
- package/dist/assets/{view-navigation-DIDEcp4V.js → view-navigation-FdnvQSOv.js} +1 -1
- package/dist/assets/{ws-client-TTMa0XaT.js → ws-client-CGEB75Dy.js} +1 -1
- package/dist/components/KanbanContractGraphDashboard.d.ts +7 -0
- package/dist/components/KanbanContractGraphPanel.d.ts +7 -0
- package/dist/components/KanbanContractGraphView.d.ts +40 -0
- package/dist/components/KanbanViewModeTabs.d.ts +1 -1
- package/dist/components/KanbanWorkbench.d.ts +9 -0
- package/dist/components/TaskVerificationSection.d.ts +3 -3
- package/dist/components/agent-roster-data.d.ts +9 -0
- package/dist/index.html +22 -22
- package/dist/index.js +5260 -3984
- package/dist/lib/palettes.d.ts +1 -1
- package/dist/stores/kanban-store.d.ts +2 -1
- package/dist/stores/session-store.d.ts +2 -0
- package/dist/types/sage.d.ts +5 -13
- package/dist/types/system.d.ts +2 -0
- package/package.json +8 -8
- package/dist/assets/AgentRosterView-BwukmHoA.js +0 -9
- package/dist/assets/ChronicleDashboard-BYGV5twz.js +0 -1
- package/dist/assets/CodeEditor-D2Dnax7e.js +0 -1
- package/dist/assets/CodeMap-DIKKs3Ux.js +0 -1
- package/dist/assets/GoalView-3291Hxnb.js +0 -1
- package/dist/assets/KanbanView-CFE63A4a.js +0 -3
- package/dist/assets/MailboxDetailView-CUTWkSyK.js +0 -1
- package/dist/assets/MemoryDrawer-Dsy0AX6f.js +0 -1
- package/dist/assets/MemoryManager-D1kXeVE3.js +0 -1
- package/dist/assets/OfficeMapPanel-Q81eioDB.js +0 -4
- package/dist/assets/SageTabs-olgLJfg_.js +0 -2
- package/dist/assets/SddHub-7Z55QY-M.js +0 -2
- package/dist/assets/SessionList-C3ygQN8A.js +0 -1
- package/dist/assets/SetupScreen-BkVjdky4.js +0 -1
- package/dist/assets/SkillDetailView-Cp-xEHww.js +0 -3
- package/dist/assets/codemap-index-store-COStDU-8.js +0 -1
- package/dist/assets/index-Cw20Xg0d.css +0 -1
- package/dist/assets/index-FHt-sKVF.js +0 -132
- package/dist/assets/progress-ring-B9pqitSa.js +0 -1
- package/dist/assets/settings-Bb7_utQE.js +0 -1
- package/dist/assets/settings-Bd8zMwvC.js +0 -1
- package/dist/assets/settings-DdFgBMAw.js +0 -1
- package/dist/assets/settings-De6sXIFO.js +0 -1
- package/dist/assets/settings-E8SKMLxq.js +0 -1
- package/dist/assets/settings-zIY9-ivF.js +0 -1
- package/dist/assets/settings-zKBcRjqE.js +0 -1
- package/dist/assets/stores-vuG0AaKy.js +0 -7
- package/dist/assets/utils-B-9lSDIn.js +0 -1
|
@@ -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-9T7iGYgW.js";import{t as C}from"./utils-B-9lSDIn.js";import{i as w}from"./stores-vuG0AaKy.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-FHt-sKVF.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
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ai as t,Ba as n,Br as r,Da as i,Fa as a,Ir as o,Jt as s,M as c,Nt as l,Oi as u,Rn as d,Sa as f,Wn as p,Wt as m,_i as ee,an as h,ar as g,ca as _,dt as te,fi as v,hn as y,la as ne,lt as b,ut as x,vn as re,wi as S}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{t as C}from"./utils-CUCQrODG.js";import{i as w}from"./stores-BATHCuMN.js";import{t as T}from"./button-ELs5xgtQ.js";import{t as E}from"./input-DSTQkMEh.js";import{b as D,x as O}from"./index-BTRQG7C5.js";var k=e(n(),1),A=b(),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:d},python:{label:`Python`,icon:u},rust:{label:`Rust`,icon:s},go:{label:`Go`,icon:y},dotnet:{label:`.NET`,icon:p},php:{label:`PHP`,icon:l},dart:{label:`Dart / Flutter`,icon:S},maven:{label:`Maven`,icon:i},gradle:{label:`Gradle`,icon:ne},ruby:{label:`Ruby`,icon:o},swift:{label:`Swift`,icon:x},elixir:{label:`Elixir`,icon:l},cpp:{label:`C / C++`,icon:t}},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:o}){let{t:s}=a(),c=j(e.status),l=U(e),u=H(e),d=o?B(o).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":s(`activity:techStack.backToDependencyList`),className:`shrink-0 md:hidden`,children:(0,A.jsx)(f,{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:c.badge,children:s(c.labelKey)})]}),(0,A.jsxs)(`p`,{className:`mt-0.5 truncate text-[10px] text-muted-foreground`,children:[N(e.ecosystem,s),` ·`,` `,e.direct?`direct`:`transitive`,` · `,e.scope,` ·`,` `,e.sourceType,d&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{"aria-hidden":`true`,children:` · `}),(0,A.jsx)(`span`,{className:`text-warning`,children:s(d)})]})]})]})]}),(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:l??`—`}),e.latestStable&&e.latestStable!==l&&(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:s(`activity:techStack.constraint`),value:e.requested??`—`,mono:!0}),(0,A.jsx)(q,{label:s(`activity:techStack.locked`),value:e.locked??`—`,mono:!0}),(0,A.jsx)(q,{label:s(`activity:techStack.latestStable`),value:e.latestStable??`—`,mono:!0}),(0,A.jsx)(q,{label:s(`activity:techStack.license`),value:e.license??`—`}),e.wanted&&(0,A.jsx)(q,{label:s(`activity:techStack.wanted`),value:e.wanted,mono:!0}),e.resolvable&&(0,A.jsx)(q,{label:s(`activity:techStack.resolvable`),value:e.resolvable,mono:!0}),e.purl&&(0,A.jsx)(q,{label:s(`activity:techStack.purl`),value:e.purl,mono:!0}),(0,A.jsx)(q,{label:s(`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:s(`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)(m,{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:s(`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:s(L[e.severity].labelKey)}),(0,A.jsx)(G,{className:`border-border/70 bg-muted text-muted-foreground`,children:R[e.action]?s(R[e.action]):e.action}),W(e)&&(0,A.jsxs)(G,{className:`border-info/35 bg-info/10 text-info`,children:[(0,A.jsx)(m,{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:s(`activity:techStack.evidence`)}),e.evidence.length===0?(0,A.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:s(`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)(v,{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:o}=a(),s=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:o(`activity:techStack.package`)}),(0,A.jsx)(`span`,{children:o(`activity:techStack.installedLatest`)}),(0,A.jsx)(`span`,{children:o(`activity:techStack.status`)})]}),(0,A.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,A.jsx)(c,{className:`h-full`,"aria-label":o(`activity:techStack.dependencies`),children:s.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:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:s.setPage,itemLabel:`dependencies`})]})}function Y({dependency:e,selected:t,coverage:n,onSelect:r}){let{t:i}=a(),o=j(e.status),s=U(e),c=H(e),l=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`,o.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,l&&(0,A.jsxs)(A.Fragment,{children:[` · `,(0,A.jsx)(`span`,{className:`text-warning`,children:i(l)})]})]})]}),(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:s??`—`}),e.latestStable&&e.latestStable!==s&&(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})]})]}),c.label?(0,A.jsx)(`p`,{className:`mt-0.5 truncate text-[10px] text-warning`,children:c.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:o.badge,children:i(o.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}=a(),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}=a(),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)(m,{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:i,sort:o,hasFilters:s,ecosystems:c,statuses:l,visibleCount:u,totalCount:d,onSearchChange:f,onEcosystemFilterChange:p,onStatusFilterChange:m,onToggleDirectOnly:ee,onSortChange:g,onClearFilters:_}){let{t:v}=a();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)(h,{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":v(`activity:techStack.searchDependencies`),value:e,onChange:e=>f(e.target.value),placeholder:v(`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":v(`activity:techStack.clearSearch`),onClick:()=>f(``),className:`absolute right-2 top-1/2 -translate-y-1/2 p-1 text-muted-foreground hover:text-foreground`,children:(0,A.jsx)(te,{className:`size-3.5`})})]}),(0,A.jsx)(T,{variant:i?`default`:`outline`,size:`sm`,onClick:ee,"aria-pressed":i,title:v(`activity:techStack.showOnlyDependenciesThisProjectDeclaresItself`),className:`shrink-0`,children:v(`activity:techStack.directOnly`)}),s&&(0,A.jsx)(T,{variant:`ghost`,size:`icon`,onClick:_,"aria-label":v(`activity:techStack.clearAllFilters`),title:v(`activity:techStack.clearAllFilters`),className:`shrink-0`,children:(0,A.jsx)(r,{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:v(`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:v(`activity:techStack.allEcosystems`)}),c.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[N(e,v),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-status-filter`,children:v(`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:v(`activity:techStack.allStatuses`)}),l.map(([e,t])=>(0,A.jsxs)(`option`,{value:e,children:[v(j(e).labelKey),` · `,t]},e))]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`sr-only`,htmlFor:`techstack-sort`,children:v(`activity:techStack.sortDependencies`)}),(0,A.jsxs)(`select`,{id:`techstack-sort`,value:o,onChange:e=>g(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:v(`activity:techStack.sortNeedsAttention`)}),(0,A.jsx)(`option`,{value:`drift`,children:v(`activity:techStack.sortMostOutOfDate`)}),(0,A.jsx)(`option`,{value:`name`,children:v(`activity:techStack.sortName`)})]})]})]}),(0,A.jsx)(`p`,{className:C(`text-[10px] text-muted-foreground`,s&&`text-info`),children:u===d?`${d} dependencies`:`${u} of ${d} 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}=a(),t=w(e=>e.snapshot),n=w(e=>e.stale),r=w(e=>e.loading),i=w(e=>e.error),o=w(e=>e.activeJob),[s,c]=(0,k.useState)(`dependencies`),[l,u]=(0,k.useState)(``),[d,f]=(0,k.useState)(`all`),[p,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)(()=>{s!==`trends`&&s!==`remediation`||fetch(`/api/techstack/${s===`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)))},[s,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=l.trim().toLowerCase(),t=[...U.filter(t=>!(e&&!t.name.toLowerCase().includes(e)||d!==`all`&&t.ecosystem!==d||p!==`all`&&t.status!==p||_&&!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,l,d,p,_,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=l.trim()!==``||d!==`all`||p!==`all`||_,we=(0,k.useCallback)(()=>{u(``),f(`all`),h(`all`),v(!1)},[]),$=!!(o&&![`completed`,`failed`,`cancelled`].includes(o.status)),Te=(0,k.useCallback)(e=>{x(e),c(`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)(m,{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)(te,{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)(ee,{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:[$&&o&&(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:o.status}),o.progress&&(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[o.progress.completed,`/`,o.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:()=>c(t.id),"aria-current":s===t.id,className:C(`border-b-2 px-3 py-2 text-xs font-medium transition-colors`,s===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))}),s===`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:l,ecosystemFilter:d,statusFilter:p,directOnly:_,sort:y,hasFilters:Ce,ecosystems:q,statuses:J,visibleCount:X.length,totalCount:U.length,onSearchChange:u,onEcosystemFilterChange:f,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`)})})})]}),s===`findings`&&(0,A.jsx)(ue,{findings:W,dependenciesById:G,onSelectDependency:Te}),s===`workspaces`&&(0,A.jsx)(ge,{snapshot:t}),s===`trends`&&(0,A.jsx)(me,{trend:ie}),s===`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:o}=a();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:o(`activity:techStack.requiresAManualPackageChoice`)})]})]},n)}),e.items.length===0&&(0,A.jsx)(`p`,{className:`p-8 text-center text-xs text-muted-foreground`,children:o(`activity:techStack.noRemediationNeeded`)})]})]}):(0,A.jsx)(Q,{})}function ge({snapshot:e}){let{t}=a(),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}=a();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}=a(),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)(_,{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{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,Fa as n,Ra as r,Vt as i,dt as a,jt as o,lt as s,mn as c,wn as l}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{t as u}from"./ws-client-CGEB75Dy.js";import{n as d,t as f}from"./utils-CUCQrODG.js";import{t as p}from"./session-store-Ce4Dck2K.js";import{I as m}from"./stores-BATHCuMN.js";import{n as h}from"./ui-store-BGNdg1e4.js";import{n as g,t as _}from"./xterm-DUBp1lnG.js";var v=e(t(),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:t}){let r=(0,v.useRef)(null),{t:s}=n(),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(),r.current?.();let t=e.clientY,n=d,i=document.body.style.cursor,a=document.body.style.userSelect;document.body.style.cursor=`ns-resize`,document.body.style.userSelect=`none`;let o=e=>{let r=b(n+t-e.clientY);m(r),E(r)},s=()=>{document.body.style.cursor=i,document.body.style.userSelect=a,window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),window.removeEventListener(`pointercancel`,s),r.current===s&&(r.current=null)};r.current=s,window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s,{once:!0}),window.addEventListener(`pointercancel`,s,{once:!0})};(0,v.useEffect)(()=>()=>r.current?.(),[]);let P=()=>{_(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=>{_(n=>{let r=n.findIndex(t=>t.id===e);if(r===-1)return n;let i=n.filter(t=>t.id!==e);return i.length===0?(queueMicrotask(t),i):(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(t)},R=(e,t)=>{_(n=>n.map(n=>n.id===e?{...n,...t}:n))},z=g.find(e=>e.id===y)??g[0]??null;return(0,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:s(`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:s(e?`activity:terminal.labelSingular`:`activity:terminal.labelPlural`)}),(0,x.jsx)(`span`,{className:`min-w-0 truncate text-muted-foreground`,children:j||M||s(`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?s(`activity:terminal.maxTerminals`,{count:C}):s(`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)(l,{className:`h-4 w-4`})}),(0,x.jsx)(`button`,{type:`button`,onClick:()=>z&&I(z.id),disabled:!z,title:s(`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:s(`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:t,title:s(`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:s(`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:n,onExit:i}){let a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=(0,v.useRef)(n),l=(0,v.useRef)(i),d=m(e=>e.wsConnected);return(0,v.useEffect)(()=>{c.current=n,l.current=i},[i,n]),(0,v.useEffect)(()=>{let t=a.current;if(!t)return;let n=new _({fontFamily:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace`,fontSize:13,cursorBlink:!0,theme:S,scrollback:5e3}),i=new g;o.current=n,s.current=i,n.loadAddon(i),n.open(t);try{i.fit()}catch{}let d=u(m.getState().wsUrl);d.send({type:`terminal.create`,payload:{id:e,cols:n.cols,rows:n.rows}});let f=!1,p=d.on(`terminal.output`,t=>{t.type===`terminal.output`&&t.payload.id===e&&(f||(f=!0,c.current()),n.write(t.payload.data))}),h=d.on(`terminal.exit`,t=>{t.type===`terminal.exit`&&t.payload.id===e&&(n.write(`\r\n\x1b[2m${r.t(`activity:terminal.processExited`,{code:t.payload.exitCode})}\x1b[0m\r\n`),l.current(t.payload.exitCode))}),v=n.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:n.cols,rows:n.rows}})}catch{}});return y.observe(t),()=>{p(),h(),v.dispose(),y.disconnect(),d.send({type:`terminal.close`,payload:{id:e}}),n.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{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,Fa as n,Gi as r,Li as i,Ot as a,Pa as o,Ra as s,dt as c,lt as l,xr as u}from"./vendor-GiKfK4Iw.js";import"./i18n-BvFgJYE2.js";import{n as d,t as f}from"./utils-CUCQrODG.js";var p=e(t(),1),m=l();function h(){return`toast_${d()}`}var g=8e3,_=o(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,n=s.t(`common:action.undo`),r=g)=>_.getState().push({message:e,variant:`info`,ttl:r,action:{label:n,onClick:t}}),dismiss:e=>_.getState().dismiss(e)};function y({variant:e}){return e===`success`?(0,m.jsx)(r,{className:`h-4 w-4 text-success`}):e===`error`?(0,m.jsx)(i,{className:`h-4 w-4 text-destructive`}):e===`warn`?(0,m.jsx)(a,{className:`h-4 w-4 text-warning`}):(0,m.jsx)(u,{className:`h-4 w-4 text-info`})}function b({entry:e}){let{t}=n(),r=_(e=>e.dismiss);return(0,p.useEffect)(()=>{let t=setTimeout(()=>r(e.id),e.ttl);return()=>clearTimeout(t)},[e.id,e.ttl,r]),(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(),r(e.id)},className:`shrink-0 font-medium text-primary hover:underline`,children:e.action.label}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>r(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}=n(),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 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,H as n,ct as r,lt as i}from"./vendor-GiKfK4Iw.js";import{t as a}from"./utils-CUCQrODG.js";var o=e(t(),1),s=i(),c=n(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-[background-color,border-color,color,box-shadow,transform] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:translate-y-px`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-sm shadow-primary/15 hover:bg-primary/90 hover:shadow-md hover:shadow-primary/20`,destructive:`bg-destructive text-destructive-foreground shadow-sm shadow-destructive/15 hover:bg-destructive/90`,outline:`border border-input bg-card/70 shadow-sm hover:border-primary/35 hover:bg-accent/70 hover:text-accent-foreground`,secondary:`border border-border/60 bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent/70 hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-10 px-4 py-2`,sm:`h-9 rounded-md px-3`,lg:`h-11 rounded-md px-8`,icon:`h-10 w-10`}},defaultVariants:{variant:`default`,size:`default`}}),l=o.forwardRef(({className:e,variant:t,size:n,asChild:i=!1,...o},l)=>(0,s.jsx)(i?r:`button`,{className:a(c({variant:t,size:n,className:e})),ref:l,...o}));l.displayName=`Button`;export{l as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Na as e,Pa as t}from"./vendor-GiKfK4Iw.js";import{n}from"./utils-CUCQrODG.js";function r(e,t){if(e==null){let e=Error(t?`Expected ${t} to be defined`:`Expected value to be defined`);throw e.name=`ExpectDefinedError`,e}return e}function i(e){return e!==`tool_use`&&e!==`tool_call`}var a=/<nextsteps\b[^>]*>\s*\n+/i,o=/^(?:(\d+)[.)]\s*|[-*•]\s*)(.+?)(\s+auto="true")?$/,s=6;function c(e,t=!1,n=!0){return n?d(e,t):u(e)}function l(e,t,n,r){e.push(r?{index:t,text:n,auto:!0}:{index:t,text:n})}function u(e){let t=e.split(`
|
|
2
2
|
`),n=[],r=new Set;for(let e of t){let t=e.trim();if(!t)continue;let i=o.exec(t);if(!i)continue;let a=i[1],c=i[2].trim(),u;if(u=a===void 0?n.length+1:Number.parseInt(a,10),r.has(u))continue;r.add(u);let d=!!i[3]&&n.length===0&&u===1;if(l(n,u,c,d),n.length>=s)break}return{steps:n,texts:n.map(e=>e.text),stripped:e,autoTexts:n.filter(e=>e.auto).map(e=>e.text)}}function d(e,t){let n=a.exec(e);if(!n)return{steps:[],texts:[],stripped:e,autoTexts:[]};let r=n.index+n[0].length,i=e.slice(r),c=i.split(`
|
|
3
3
|
`),u=[],d=new Set;for(let e of c){let t=e.trim();if(!t)continue;let n=o.exec(t);if(!n)break;let r=n[1],i=n[2].trim(),a;if(a=r===void 0?u.length+1:Number.parseInt(r,10),d.has(a))continue;d.add(a);let c=!!n[3]&&u.length===0&&a===1;if(l(u,a,i,c),u.length>=s)break}if(u.length===0||!i.includes(`</nextsteps>`))return{steps:[],texts:[],stripped:e,autoTexts:[]};let p=u.map(e=>e.text),m=u.filter(e=>e.auto).map(e=>e.text),h=n.index,g=n[0].length+f(i,u.length);return{steps:u,texts:p,stripped:(e.slice(0,h)+e.slice(h+g)).replace(/\n{3,}/g,`
|
|
4
4
|
|
package/dist/assets/{codemap-activity-store-DQfjo7-j.js → codemap-activity-store-D67-genN.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Na as e}from"./vendor-BuarzSSb.js";var t=8e3,n=2500,r=30*6e4,i=200,a=500,o={read:`read`,read_file:`read`,write:`write`,write_file:`write`,edit:`edit`,patch:`edit`,apply_patch:`edit`,replace:`edit`,delete:`delete`,delete_file:`delete`,remove:`delete`,grep:`search`,glob:`search`,search:`search`,"codebase-search":`search`,"codebase-index":`index`,remember:`memory`,forget:`memory`,memory_search:`memory`,memory_update:`memory`,memory_delete:`memory`};function s(e,t=``){return e===`rename`?`edit`:e in{read:1,write:1,edit:1,delete:1,search:1}?e:o[t]}function c(e){let t=[];for(let n of[`path`,`file`,`filePath`,`target`]){let r=e[n];typeof r==`string`&&t.push(r)}let n=e.files;if(typeof n==`string`&&t.push(n),Array.isArray(n))for(let e of n)typeof e==`string`&&t.push(e);return[...new Set(t)]}function l(e,t){let n=typeof t.old_string==`string`?t.old_string.trim():``,r=typeof t.new_string==`string`?t.new_string.trim():``;if(n||r)return`${n.replace(/\s+/g,` `).slice(0,42)||`∅`} → ${r.replace(/\s+/g,` `).slice(0,42)||`∅`}`;if(typeof t.patch==`string`){let n=d(t);return`${e} +${n?.added??0} −${n?.removed??0}`}let i=typeof t.content==`string`?t.content:void 0;if(i!==void 0){let t=i.length===0?0:i.split(/\r?\n/).length;return`${e} ${t} line${t===1?``:`s`}`}for(let e of[`query`,`pattern`,`old_string`,`new_string`,`text`,`command`]){let n=t[e];if(typeof n==`string`&&n.trim()){let t=n.trim().replace(/\s+/g,` `).slice(0,96);return e===`query`?`"${t}"`:e===`pattern`?`/${t}/`:e===`command`?`$ ${t}`:t}}return e}function u(e){return e.trim().replace(/\s+/g,` `).slice(0,72)}function d(e){let t=typeof e.old_string==`string`?e.old_string:void 0,n=typeof e.new_string==`string`?e.new_string:void 0;if(t!==void 0||n!==void 0){let e=t?t.split(/\r?\n/).length:0;return{added:n?n.split(/\r?\n/).length:0,removed:e,...t?{before:u(t)}:{},...n?{after:u(n)}:{}}}let r=typeof e.patch==`string`?e.patch:void 0;if(r){let e=r.split(/\r?\n/),t=e.filter(e=>e.startsWith(`+`)&&!e.startsWith(`+++`)),n=e.filter(e=>e.startsWith(`-`)&&!e.startsWith(`---`));return{added:t.length,removed:n.length,...n[0]?{before:u(n[0].slice(1))}:{},...t[0]?{after:u(t[0].slice(1))}:{}}}let i=typeof e.content==`string`?e.content:void 0;if(i!==void 0)return{added:i.length===0?0:i.split(/\r?\n/).length,removed:0,...i?{after:u(i)}:{}}}function f(e){let t=e.status??`observed`;return{...e,id:e.id??`${e.toolUseId??`event`}:${e.filePath}:${e.timestamp}`,status:t,source:e.source??`legacy`,agentName:e.agentName??e.agent,agent:e.agent??e.agentName}}function p(e,t){let n=e.get(t.filePath)??[];if(e.set(t.filePath,[t,...n].slice(0,i)),e.size<=a)return;let r=[...e.entries()].sort((e,t)=>(e[1][0]?.timestamp??0)-(t[1][0]?.timestamp??0))[0]?.[0];r&&e.delete(r)}function m(e){return`${e.sessionId??`unscoped`}:${e.agentId??e.agentName??e.agent??`external`}`}function h(e){let t=new Map;for(let n of e){let e=n.agentId??`external`,r=n.agentName??n.agent??`External process`,i=n.sessionId??`unscoped`,a=m(n),o=t.get(a);o?(o.operations.push(n),o.startedAt=Math.min(o.startedAt,n.timestamp)):t.set(a,{key:a,agentId:e,agentName:r,sessionId:i,operations:[n],startedAt:n.timestamp})}return[...t.values()].sort((e,t)=>e.startedAt-t.startedAt)}function g(e,t,n){let r=String(e.name??`unknown`),i=e.input&&typeof e.input==`object`?e.input:{},a=Date.now(),o=String(e.id??`${r}:${a}`),c=d(i);return(t.length>0?t:[{filePath:`(tool:${r})`,operation:`execute`}]).map((u,d)=>({id:`${o}:${d}`,toolUseId:o,filePath:u.filePath,type:u.operation===`execute`?`execute`:s(u.operation,r)??`edit`,toolName:r,summary:l(r,i),timestamp:a,status:n,source:`tool`,attribution:t.length>0?`exact`:`correlated`,...c?{change:c}:{},sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,traceId:typeof e.traceId==`string`?e.traceId:void 0,agentId:typeof e.agentId==`string`?e.agentId:`leader`,agentName:typeof e.agentName==`string`?e.agentName:`LEADER`,...u.line?{line:u.line}:{},...u.endLine?{endLine:u.endLine}:{}}))}function _(e){let t=e.payload??{};if(e.type===`tool.started`||e.type===`tool.executed`||e.type===`codemap.tool_started`||e.type===`codemap.tool_executed`)return g(t,Array.isArray(t.fileTargets)?t.fileTargets:c(t.input&&typeof t.input==`object`?t.input:{}).map(e=>({filePath:e,operation:o[String(t.name??``)]??`edit`})),e.type===`tool.started`||e.type===`codemap.tool_started`?`active`:`completed`);if(e.type===`provider.response`){let e=t.blocks;if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type!==`tool_use`)continue;let r=String(e.name??``),i=o[r];if(!i)continue;let a=e.input&&typeof e.input==`object`?e.input:{},s=c(a),u=Date.now();s.length===0&&(i===`memory`||i===`search`||i===`index`)&&s.push(`(global)`);for(let e of s)n.push({filePath:e,type:i,toolName:r,summary:l(r,a),timestamp:u})}return n}if(e.type===`tool.progress`){let e=t.event&&typeof t.event==`object`?t.event:void 0;if(e?.type!==`file_changed`||typeof e.path!=`string`)return[];let n=String(e.operation??`edit`);return[{id:`${String(t.id??`progress`)}:${e.path}:${Date.now()}`,toolUseId:typeof t.id==`string`?t.id:void 0,filePath:e.path,type:s(n)??`edit`,toolName:String(t.name??`deterministic-tool`),summary:String(e.text??`tool reported file change`),timestamp:Date.now(),status:`active`,source:`deterministic`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,line:typeof e.line==`number`?e.line:void 0,endLine:typeof e.endLine==`number`?e.endLine:void 0,attribution:`exact`}]}if(e.type===`codemap.file_event`){let e=s(String(t.operation??`edit`))??`edit`;return typeof t.filePath==`string`?[{filePath:t.filePath,type:e,toolName:typeof t.toolName==`string`?t.toolName:String(t.source??`watcher`),summary:`${String(t.source??`external`)} ${String(t.operation??`changed`)}`,timestamp:typeof t.at==`number`?t.at:Date.now(),status:t.phase===`started`?`active`:`observed`,source:t.source??`external`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,toolUseId:typeof t.toolUseId==`string`?t.toolUseId:void 0,line:typeof t.line==`number`?t.line:void 0,endLine:typeof t.endLine==`number`?t.endLine:void 0}]:[]}return e.type===`file.saved`&&typeof t.filePath==`string`?[{filePath:t.filePath,type:`write`,toolName:`save`,summary:``,timestamp:Date.now(),source:`editor`}]:e.type===`memory.event`&&typeof t.event==`string`?[{filePath:`(memory)`,type:`memory`,toolName:`memory.${t.event}`,summary:String(t.memoryId??``),timestamp:Date.now()}]:[]}var v=e((e,i)=>({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0,recordActivity(n){let r=f(n);e(e=>{let n=new Map(e.history),i=new Map(e.pulses);return p(n,r),i.set(r.filePath,Date.now()+t),{history:n,pulses:i,totalCount:e.totalCount+1}})},startActivities(n){if(n.length===0)return;let r=n.map(e=>f({...e,status:`active`}));e(e=>{let n=new Map(e.history),i=new Map(e.pulses),a=new Map(e.activeOperations);for(let e of r)if(p(n,e),i.set(e.filePath,Date.now()+t),e.toolUseId){let t=a.get(e.toolUseId)??[];a.set(e.toolUseId,[...t,e])}return{history:n,pulses:i,activeOperations:a,totalCount:e.totalCount+r.length}})},finishTool(n,r){let i=r.timestamp??Date.now();e(e=>{let a=e.activeOperations.get(n)??[];if(a.length===0)return e;let o=new Map(e.history),s=new Map(e.pulses);for(let e of a){let a=o.get(e.filePath)??[];o.set(e.filePath,a.map(e=>e.toolUseId===n?{...e,status:r.ok?`completed`:`failed`,ok:r.ok,completedAt:i,durationMs:r.durationMs??i-e.timestamp}:e)),s.set(e.filePath,Date.now()+t)}let c=new Map(e.activeOperations);return c.delete(n),{history:o,pulses:s,activeOperations:c}})},recordFileEvent(r){let i=f({...r,attribution:r.attribution??(r.agentId?`exact`:`external`)});e(e=>{let r=(e.history.get(i.filePath)??[]).find(e=>e.source!==`watcher`&&e.source!==`external`&&Math.abs(i.timestamp-e.timestamp)<=n);if(r){let n=new Map(e.history);n.set(i.filePath,(n.get(i.filePath)??[]).map(e=>e.id===r.id?{...e,watcherConfirmed:e.watcherConfirmed||i.source===`watcher`||i.source===`editor`}:e));let a=new Map(e.pulses);return a.set(i.filePath,Date.now()+t),{history:n,pulses:a}}let a=i.toolUseId?e.activeOperations.get(i.toolUseId):void 0;if(a&&a.length>0){let n=a[0],r=f({...i,status:`active`,source:i.source??`deterministic`,sessionId:i.sessionId??n.sessionId,traceId:i.traceId??n.traceId,agentId:i.agentId??n.agentId,agentName:i.agentName??n.agentName,agent:i.agent??n.agent,attribution:`exact`}),o=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);return p(o,r),s.set(r.filePath,Date.now()+t),c.set(i.toolUseId,[...a,r]),{history:o,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let o=[...e.activeOperations.values()].flat().filter(e=>e.filePath.startsWith(`(tool:`)&&Math.abs(i.timestamp-e.timestamp)<=3e5);if(o.length===1){let n=o[0],r=f({...i,id:`${n.toolUseId}:${i.filePath}:${i.timestamp}`,toolUseId:n.toolUseId,toolName:n.toolName,summary:`${n.toolName} → filesystem ${i.type}`,status:`active`,source:`deterministic`,sessionId:n.sessionId,traceId:n.traceId,agentId:n.agentId,agentName:n.agentName,agent:n.agent,watcherConfirmed:!0,attribution:`correlated`}),a=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);if(p(a,r),s.set(r.filePath,Date.now()+t),r.toolUseId){let e=c.get(r.toolUseId)??[];c.set(r.toolUseId,[...e,r])}return{history:a,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let s=new Map(e.history),c=new Map(e.pulses);return p(s,i),c.set(i.filePath,Date.now()+t),{history:s,pulses:c,totalCount:e.totalCount+1}})},resolveActivitySymbol(t,n,r){e(e=>{let i=new Map(e.history);i.set(n,(i.get(n)??[]).map(e=>e.toolUseId===t?{...e,symbol:r}:e));let a=new Map(e.activeOperations),o=a.get(t);return o&&a.set(t,o.map(e=>e.filePath===n?{...e,symbol:r}:e)),{history:i,activeOperations:a}})},getActivityForFile(e){return i().history.get(e)??[]},getActiveForFile(e){return[...i().activeOperations.values()].flat().filter(t=>t.filePath===e)},getActiveOperations(){return[...i().activeOperations.values()].flat()},getAgentPresences(){return h(i().getActiveOperations())},getPulsingFiles(){return i()._sweep(),new Set(i().pulses.keys())},getPulseType(e){if(i()._sweep(),i().pulses.has(e))return i().history.get(e)?.[0]?.type},clear(){e({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0})},_sweep(){let t=Date.now(),n=[...i().pulses].filter(([,e])=>e<t).map(([e])=>e),a=[...i().activeOperations].filter(([,e])=>e.every(e=>t-e.timestamp>r)).map(([e])=>e);n.length===0&&a.length===0||e(e=>{let r=new Map(e.pulses);for(let e of n)r.delete(e);if(a.length===0)return{pulses:r};let i=new Map(e.history),o=new Map(e.activeOperations);for(let e of a){for(let n of o.get(e)??[])i.set(n.filePath,(i.get(n.filePath)??[]).map(n=>n.toolUseId===e?{...n,status:`failed`,ok:!1,completedAt:t,durationMs:t-n.timestamp,summary:`${n.summary||n.toolName} · telemetry timeout`}:n));o.delete(e)}return{pulses:r,history:i,activeOperations:o}})}}));export{v as i,_ as n,h as r,m as t};
|
|
1
|
+
import{Pa as e}from"./vendor-GiKfK4Iw.js";var t=8e3,n=2500,r=30*6e4,i=200,a=500,o={read:`read`,read_file:`read`,write:`write`,write_file:`write`,edit:`edit`,patch:`edit`,apply_patch:`edit`,replace:`edit`,delete:`delete`,delete_file:`delete`,remove:`delete`,grep:`search`,glob:`search`,search:`search`,"codebase-search":`search`,"codebase-index":`index`,remember:`memory`,forget:`memory`,memory_search:`memory`,memory_update:`memory`,memory_delete:`memory`};function s(e,t=``){return e===`rename`?`edit`:e in{read:1,write:1,edit:1,delete:1,search:1}?e:o[t]}function c(e){let t=[];for(let n of[`path`,`file`,`filePath`,`target`]){let r=e[n];typeof r==`string`&&t.push(r)}let n=e.files;if(typeof n==`string`&&t.push(n),Array.isArray(n))for(let e of n)typeof e==`string`&&t.push(e);return[...new Set(t)]}function l(e,t){let n=typeof t.old_string==`string`?t.old_string.trim():``,r=typeof t.new_string==`string`?t.new_string.trim():``;if(n||r)return`${n.replace(/\s+/g,` `).slice(0,42)||`∅`} → ${r.replace(/\s+/g,` `).slice(0,42)||`∅`}`;if(typeof t.patch==`string`){let n=d(t);return`${e} +${n?.added??0} −${n?.removed??0}`}let i=typeof t.content==`string`?t.content:void 0;if(i!==void 0){let t=i.length===0?0:i.split(/\r?\n/).length;return`${e} ${t} line${t===1?``:`s`}`}for(let e of[`query`,`pattern`,`old_string`,`new_string`,`text`,`command`]){let n=t[e];if(typeof n==`string`&&n.trim()){let t=n.trim().replace(/\s+/g,` `).slice(0,96);return e===`query`?`"${t}"`:e===`pattern`?`/${t}/`:e===`command`?`$ ${t}`:t}}return e}function u(e){return e.trim().replace(/\s+/g,` `).slice(0,72)}function d(e){let t=typeof e.old_string==`string`?e.old_string:void 0,n=typeof e.new_string==`string`?e.new_string:void 0;if(t!==void 0||n!==void 0){let e=t?t.split(/\r?\n/).length:0;return{added:n?n.split(/\r?\n/).length:0,removed:e,...t?{before:u(t)}:{},...n?{after:u(n)}:{}}}let r=typeof e.patch==`string`?e.patch:void 0;if(r){let e=r.split(/\r?\n/),t=e.filter(e=>e.startsWith(`+`)&&!e.startsWith(`+++`)),n=e.filter(e=>e.startsWith(`-`)&&!e.startsWith(`---`));return{added:t.length,removed:n.length,...n[0]?{before:u(n[0].slice(1))}:{},...t[0]?{after:u(t[0].slice(1))}:{}}}let i=typeof e.content==`string`?e.content:void 0;if(i!==void 0)return{added:i.length===0?0:i.split(/\r?\n/).length,removed:0,...i?{after:u(i)}:{}}}function f(e){let t=e.status??`observed`;return{...e,id:e.id??`${e.toolUseId??`event`}:${e.filePath}:${e.timestamp}`,status:t,source:e.source??`legacy`,agentName:e.agentName??e.agent,agent:e.agent??e.agentName}}function p(e,t){let n=e.get(t.filePath)??[];if(e.set(t.filePath,[t,...n].slice(0,i)),e.size<=a)return;let r=[...e.entries()].sort((e,t)=>(e[1][0]?.timestamp??0)-(t[1][0]?.timestamp??0))[0]?.[0];r&&e.delete(r)}function m(e){return`${e.sessionId??`unscoped`}:${e.agentId??e.agentName??e.agent??`external`}`}function h(e){let t=new Map;for(let n of e){let e=n.agentId??`external`,r=n.agentName??n.agent??`External process`,i=n.sessionId??`unscoped`,a=m(n),o=t.get(a);o?(o.operations.push(n),o.startedAt=Math.min(o.startedAt,n.timestamp)):t.set(a,{key:a,agentId:e,agentName:r,sessionId:i,operations:[n],startedAt:n.timestamp})}return[...t.values()].sort((e,t)=>e.startedAt-t.startedAt)}function g(e,t,n){let r=String(e.name??`unknown`),i=e.input&&typeof e.input==`object`?e.input:{},a=Date.now(),o=String(e.id??`${r}:${a}`),c=d(i);return(t.length>0?t:[{filePath:`(tool:${r})`,operation:`execute`}]).map((u,d)=>({id:`${o}:${d}`,toolUseId:o,filePath:u.filePath,type:u.operation===`execute`?`execute`:s(u.operation,r)??`edit`,toolName:r,summary:l(r,i),timestamp:a,status:n,source:`tool`,attribution:t.length>0?`exact`:`correlated`,...c?{change:c}:{},sessionId:typeof e.sessionId==`string`?e.sessionId:void 0,traceId:typeof e.traceId==`string`?e.traceId:void 0,agentId:typeof e.agentId==`string`?e.agentId:`leader`,agentName:typeof e.agentName==`string`?e.agentName:`LEADER`,...u.line?{line:u.line}:{},...u.endLine?{endLine:u.endLine}:{}}))}function _(e){let t=e.payload??{};if(e.type===`tool.started`||e.type===`tool.executed`||e.type===`codemap.tool_started`||e.type===`codemap.tool_executed`)return g(t,Array.isArray(t.fileTargets)?t.fileTargets:c(t.input&&typeof t.input==`object`?t.input:{}).map(e=>({filePath:e,operation:o[String(t.name??``)]??`edit`})),e.type===`tool.started`||e.type===`codemap.tool_started`?`active`:`completed`);if(e.type===`provider.response`){let e=t.blocks;if(!Array.isArray(e))return[];let n=[];for(let t of e){if(!t||typeof t!=`object`)continue;let e=t;if(e.type!==`tool_use`)continue;let r=String(e.name??``),i=o[r];if(!i)continue;let a=e.input&&typeof e.input==`object`?e.input:{},s=c(a),u=Date.now();s.length===0&&(i===`memory`||i===`search`||i===`index`)&&s.push(`(global)`);for(let e of s)n.push({filePath:e,type:i,toolName:r,summary:l(r,a),timestamp:u})}return n}if(e.type===`tool.progress`){let e=t.event&&typeof t.event==`object`?t.event:void 0;if(e?.type!==`file_changed`||typeof e.path!=`string`)return[];let n=String(e.operation??`edit`);return[{id:`${String(t.id??`progress`)}:${e.path}:${Date.now()}`,toolUseId:typeof t.id==`string`?t.id:void 0,filePath:e.path,type:s(n)??`edit`,toolName:String(t.name??`deterministic-tool`),summary:String(e.text??`tool reported file change`),timestamp:Date.now(),status:`active`,source:`deterministic`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,line:typeof e.line==`number`?e.line:void 0,endLine:typeof e.endLine==`number`?e.endLine:void 0,attribution:`exact`}]}if(e.type===`codemap.file_event`){let e=s(String(t.operation??`edit`))??`edit`;return typeof t.filePath==`string`?[{filePath:t.filePath,type:e,toolName:typeof t.toolName==`string`?t.toolName:String(t.source??`watcher`),summary:`${String(t.source??`external`)} ${String(t.operation??`changed`)}`,timestamp:typeof t.at==`number`?t.at:Date.now(),status:t.phase===`started`?`active`:`observed`,source:t.source??`external`,sessionId:typeof t.sessionId==`string`?t.sessionId:void 0,traceId:typeof t.traceId==`string`?t.traceId:void 0,agentId:typeof t.agentId==`string`?t.agentId:void 0,agentName:typeof t.agentName==`string`?t.agentName:void 0,toolUseId:typeof t.toolUseId==`string`?t.toolUseId:void 0,line:typeof t.line==`number`?t.line:void 0,endLine:typeof t.endLine==`number`?t.endLine:void 0}]:[]}return e.type===`file.saved`&&typeof t.filePath==`string`?[{filePath:t.filePath,type:`write`,toolName:`save`,summary:``,timestamp:Date.now(),source:`editor`}]:e.type===`memory.event`&&typeof t.event==`string`?[{filePath:`(memory)`,type:`memory`,toolName:`memory.${t.event}`,summary:String(t.memoryId??``),timestamp:Date.now()}]:[]}var v=e((e,i)=>({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0,recordActivity(n){let r=f(n);e(e=>{let n=new Map(e.history),i=new Map(e.pulses);return p(n,r),i.set(r.filePath,Date.now()+t),{history:n,pulses:i,totalCount:e.totalCount+1}})},startActivities(n){if(n.length===0)return;let r=n.map(e=>f({...e,status:`active`}));e(e=>{let n=new Map(e.history),i=new Map(e.pulses),a=new Map(e.activeOperations);for(let e of r)if(p(n,e),i.set(e.filePath,Date.now()+t),e.toolUseId){let t=a.get(e.toolUseId)??[];a.set(e.toolUseId,[...t,e])}return{history:n,pulses:i,activeOperations:a,totalCount:e.totalCount+r.length}})},finishTool(n,r){let i=r.timestamp??Date.now();e(e=>{let a=e.activeOperations.get(n)??[];if(a.length===0)return e;let o=new Map(e.history),s=new Map(e.pulses);for(let e of a){let a=o.get(e.filePath)??[];o.set(e.filePath,a.map(e=>e.toolUseId===n?{...e,status:r.ok?`completed`:`failed`,ok:r.ok,completedAt:i,durationMs:r.durationMs??i-e.timestamp}:e)),s.set(e.filePath,Date.now()+t)}let c=new Map(e.activeOperations);return c.delete(n),{history:o,pulses:s,activeOperations:c}})},recordFileEvent(r){let i=f({...r,attribution:r.attribution??(r.agentId?`exact`:`external`)});e(e=>{let r=(e.history.get(i.filePath)??[]).find(e=>e.source!==`watcher`&&e.source!==`external`&&Math.abs(i.timestamp-e.timestamp)<=n);if(r){let n=new Map(e.history);n.set(i.filePath,(n.get(i.filePath)??[]).map(e=>e.id===r.id?{...e,watcherConfirmed:e.watcherConfirmed||i.source===`watcher`||i.source===`editor`}:e));let a=new Map(e.pulses);return a.set(i.filePath,Date.now()+t),{history:n,pulses:a}}let a=i.toolUseId?e.activeOperations.get(i.toolUseId):void 0;if(a&&a.length>0){let n=a[0],r=f({...i,status:`active`,source:i.source??`deterministic`,sessionId:i.sessionId??n.sessionId,traceId:i.traceId??n.traceId,agentId:i.agentId??n.agentId,agentName:i.agentName??n.agentName,agent:i.agent??n.agent,attribution:`exact`}),o=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);return p(o,r),s.set(r.filePath,Date.now()+t),c.set(i.toolUseId,[...a,r]),{history:o,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let o=[...e.activeOperations.values()].flat().filter(e=>e.filePath.startsWith(`(tool:`)&&Math.abs(i.timestamp-e.timestamp)<=3e5);if(o.length===1){let n=o[0],r=f({...i,id:`${n.toolUseId}:${i.filePath}:${i.timestamp}`,toolUseId:n.toolUseId,toolName:n.toolName,summary:`${n.toolName} → filesystem ${i.type}`,status:`active`,source:`deterministic`,sessionId:n.sessionId,traceId:n.traceId,agentId:n.agentId,agentName:n.agentName,agent:n.agent,watcherConfirmed:!0,attribution:`correlated`}),a=new Map(e.history),s=new Map(e.pulses),c=new Map(e.activeOperations);if(p(a,r),s.set(r.filePath,Date.now()+t),r.toolUseId){let e=c.get(r.toolUseId)??[];c.set(r.toolUseId,[...e,r])}return{history:a,pulses:s,activeOperations:c,totalCount:e.totalCount+1}}let s=new Map(e.history),c=new Map(e.pulses);return p(s,i),c.set(i.filePath,Date.now()+t),{history:s,pulses:c,totalCount:e.totalCount+1}})},resolveActivitySymbol(t,n,r){e(e=>{let i=new Map(e.history);i.set(n,(i.get(n)??[]).map(e=>e.toolUseId===t?{...e,symbol:r}:e));let a=new Map(e.activeOperations),o=a.get(t);return o&&a.set(t,o.map(e=>e.filePath===n?{...e,symbol:r}:e)),{history:i,activeOperations:a}})},getActivityForFile(e){return i().history.get(e)??[]},getActiveForFile(e){return[...i().activeOperations.values()].flat().filter(t=>t.filePath===e)},getActiveOperations(){return[...i().activeOperations.values()].flat()},getAgentPresences(){return h(i().getActiveOperations())},getPulsingFiles(){return i()._sweep(),new Set(i().pulses.keys())},getPulseType(e){if(i()._sweep(),i().pulses.has(e))return i().history.get(e)?.[0]?.type},clear(){e({history:new Map,pulses:new Map,activeOperations:new Map,totalCount:0})},_sweep(){let t=Date.now(),n=[...i().pulses].filter(([,e])=>e<t).map(([e])=>e),a=[...i().activeOperations].filter(([,e])=>e.every(e=>t-e.timestamp>r)).map(([e])=>e);n.length===0&&a.length===0||e(e=>{let r=new Map(e.pulses);for(let e of n)r.delete(e);if(a.length===0)return{pulses:r};let i=new Map(e.history),o=new Map(e.activeOperations);for(let e of a){for(let n of o.get(e)??[])i.set(n.filePath,(i.get(n.filePath)??[]).map(n=>n.toolUseId===e?{...n,status:`failed`,ok:!1,completedAt:t,durationMs:t-n.timestamp,summary:`${n.summary||n.toolName} · telemetry timeout`}:n));o.delete(e)}return{pulses:r,history:i,activeOperations:o}})}}));export{v as i,_ as n,h as r,m as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Pa as e}from"./vendor-GiKfK4Iw.js";var t=e(e=>({generation:0,lastUpdatedAt:null,notifyIndexUpdated(t=Date.now()){e(e=>({generation:e.generation+1,lastUpdatedAt:t}))}}));export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{Ba as t,G as n,J as r,K as i,U as a,W as o,Y as s,dt as c,lt as l,q as u}from"./vendor-GiKfK4Iw.js";import{t as d}from"./utils-CUCQrODG.js";var f=e(t(),1),p=l(),m=a,h=r,g=f.forwardRef(({className:e,...t},n)=>(0,p.jsx)(u,{ref:n,className:d(`fixed inset-0 z-50 bg-black/65 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));g.displayName=u.displayName;var _=f.forwardRef(({className:e,children:t,showCloseButton:r=!0,...i},a)=>(0,p.jsxs)(h,{children:[(0,p.jsx)(g,{}),(0,p.jsxs)(n,{ref:a,className:d(`fixed left-[50%] top-[50%] z-50 grid max-h-[calc(100dvh-2rem)] w-[calc(100vw-1.5rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border border-border/70 bg-card p-5 shadow-2xl duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:p-6`,e),...i,children:[t,r&&(0,p.jsxs)(o,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,p.jsx)(c,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));_.displayName=n.displayName;var v=({className:e,...t})=>(0,p.jsx)(`div`,{className:d(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});v.displayName=`DialogHeader`;var y=({className:e,...t})=>(0,p.jsx)(`div`,{className:d(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});y.displayName=`DialogFooter`;var b=f.forwardRef(({className:e,...t},n)=>(0,p.jsx)(s,{ref:n,className:d(`text-lg font-semibold leading-none`,e),...t}));b.displayName=s.displayName;var x=f.forwardRef(({className:e,...t},n)=>(0,p.jsx)(i,{ref:n,className:d(`text-sm text-muted-foreground`,e),...t}));x.displayName=i.displayName;export{v as a,y as i,_ as n,b as o,x as r,m as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{lt as e}from"./vendor-
|
|
1
|
+
import{lt as e}from"./vendor-GiKfK4Iw.js";import{t}from"./utils-CUCQrODG.js";var n=e();function r({icon:e,title:r,description:i,action:a,className:o,panel:s=!0}){return(0,n.jsx)(`div`,{className:t(`flex min-h-0 min-w-0 flex-1 items-center justify-center p-4`,s&&`bg-[hsl(var(--surface-2)/0.45)]`,o),children:(0,n.jsxs)(`div`,{className:`ws-surface flex max-w-md flex-col items-center gap-3 rounded-xl p-6 text-center text-muted-foreground`,children:[e&&(0,n.jsx)(`span`,{className:`flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10 text-primary`,children:e}),(0,n.jsxs)(`div`,{children:[(0,n.jsx)(`p`,{className:`text-base font-semibold text-foreground`,children:r}),i&&(0,n.jsx)(`p`,{className:`mt-1 text-sm`,children:i})]}),a&&(0,n.jsx)(`button`,{type:`button`,onClick:a.onClick,className:`mt-1 rounded-md border border-border/70 bg-card/70 px-4 py-2 text-sm text-foreground shadow-sm transition-colors hover:bg-accent`,children:a.label})]})})}export{r as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-BwEBEQ51.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-CdiY7G6Z.js","assets/commandPalette-DpaemFux.js","assets/common-COVxQ0FV.js","assets/settings-
|
|
2
|
-
import{Fa as e,Ia as t,La as n,Ma as r,Na as i}from"./vendor-BuarzSSb.js";import{t as a}from"./activity-BwEBEQ51.js";import{t as o}from"./chat-CdiY7G6Z.js";import{t as s}from"./commandPalette-DpaemFux.js";import{t as c}from"./common-COVxQ0FV.js";import{t as l}from"./settings-zIY9-ivF.js";import{t as u}from"./setup-BFcmn89w.js";import{t as d}from"./toasts-BL_8kH4B.js";import{s as f}from"./monaco-BLUV5g0U.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,fleetChatVerbosity:`off`,nextPrediction:!1,nextStepsTool:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,modelAvailabilitySchedule:[],featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceCountdownMs:3e3,enhanceLanguage:`original`,refinerProvider:``,refinerModel:``,refinerFallbackProfile:``,thinkingWord:`thinking`,statuslineMode:`minimum`,animationStyle:`rainbow`,showThinkingLogs:!0,groupToolCalls:!0,autoCollapseInput:!1,showModelReasoning:!0,showAgentSwarmPanel:`bottom`,allowOutsideProjectRoot:!0,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,breakerEnabled:!1,breakerAutoKillResetMs:6e4,fsAccess:`unrestricted`,debugStream:!1,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_(),chimeraAutoFix:`off`,readSymbols:!1,showSageMemoryInject:!1,sageMemoryInjectThreshold:.85,preRefineSeconds:3,multiDiffSummaryThreshold:5,chimeraEnabled:!0,chimeraProvider:``,chimeraModel:``,chimeraMaxFiles:15,autoReviewEnabled:!1,autoReviewProvider:``,autoReviewModel:``,autoReviewFallbackProfile:``,autoReviewModelSelection:`round-robin`,autoReviewFallbackModels:[],autoReviewDebounceMs:15e3,autoReviewMaxFilesPerBatch:15,autoReviewMaxConcurrentReviews:2,autoReviewCascadeOn:`off`,pluginsEnabled:{}},x=i()(r(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:15,migrate:(e,t)=>{let n=e??{};return t<12&&n.autoReviewDebounceMs===5e3&&(n.autoReviewDebounceMs=15e3),typeof n.fleetChatVerbosity!=`string`&&(n.streamFleet===!0?n.fleetChatVerbosity=`full`:(n.streamFleet,n.fleetChatVerbosity=`off`),delete n.streamFleet),n.fleetChatVerbosity!==`off`&&n.fleetChatVerbosity!==`full`&&(n.fleetChatVerbosity=`off`),[`hybrid`,`intelligent`,`selective`].includes(n.contextStrategy)||(n.contextStrategy=`hybrid`),n.auditLevel===`verbose`&&(n.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(n.auditLevel)||(n.auditLevel=`standard`),typeof n.autoProceedMaxIterations!=`number`&&(n.autoProceedMaxIterations=50),(!n.fallbackProfiles||typeof n.fallbackProfiles!=`object`||Array.isArray(n.fallbackProfiles))&&(n.fallbackProfiles={}),Array.isArray(n.favoriteModels)||(n.favoriteModels=[]),typeof n.favoriteModelsOnly!=`boolean`&&(n.favoriteModelsOnly=!1),Array.isArray(n.modelAvailabilitySchedule)||(n.modelAvailabilitySchedule=[]),(!n.modelMatrix||typeof n.modelMatrix!=`object`||Array.isArray(n.modelMatrix))&&(n.modelMatrix={}),(typeof n.uiLocale!=`string`||!n.uiLocale)&&(n.uiLocale=_()),typeof n.breakerEnabled!=`boolean`&&(n.breakerEnabled=!1),typeof n.breakerAutoKillResetMs!=`number`&&(n.breakerAutoKillResetMs=6e4),n.fsAccess!==`unrestricted`&&n.fsAccess!==`project`&&(n.fsAccess=`unrestricted`),typeof n.debugStream!=`boolean`&&(n.debugStream=!1),typeof n.chimeraEnabled!=`boolean`&&(n.chimeraEnabled=!0),typeof n.chimeraProvider!=`string`&&(n.chimeraProvider=``),typeof n.chimeraModel!=`string`&&(n.chimeraModel=``),n.chimeraAutoFix!==`off`&&n.chimeraAutoFix!==`ask`&&n.chimeraAutoFix!==`auto`&&(n.chimeraAutoFix=`off`),(typeof n.chimeraMaxFiles!=`number`||!Number.isFinite(n.chimeraMaxFiles)||n.chimeraMaxFiles<1)&&(n.chimeraMaxFiles=15),typeof n.autoReviewEnabled!=`boolean`&&(n.autoReviewEnabled=!1),typeof n.autoReviewProvider!=`string`&&(n.autoReviewProvider=``),typeof n.autoReviewModel!=`string`&&(n.autoReviewModel=``),typeof n.autoReviewFallbackProfile!=`string`&&(n.autoReviewFallbackProfile=``),n.autoReviewModelSelection!==`round-robin`&&n.autoReviewModelSelection!==`random`&&(n.autoReviewModelSelection=`round-robin`),Array.isArray(n.autoReviewFallbackModels)||(n.autoReviewFallbackModels=[]),(typeof n.autoReviewDebounceMs!=`number`||!Number.isFinite(n.autoReviewDebounceMs)||n.autoReviewDebounceMs<0)&&(n.autoReviewDebounceMs=15e3),(typeof n.autoReviewMaxFilesPerBatch!=`number`||!Number.isFinite(n.autoReviewMaxFilesPerBatch)||n.autoReviewMaxFilesPerBatch<1)&&(n.autoReviewMaxFilesPerBatch=15),(typeof n.autoReviewMaxConcurrentReviews!=`number`||!Number.isFinite(n.autoReviewMaxConcurrentReviews)||n.autoReviewMaxConcurrentReviews<1)&&(n.autoReviewMaxConcurrentReviews=2),n.autoReviewCascadeOn!==`off`&&n.autoReviewCascadeOn!==`critical`&&n.autoReviewCascadeOn!==`high`&&(n.autoReviewCascadeOn=`off`),typeof n.showModelReasoning!=`boolean`&&(n.showModelReasoning=!0),typeof n.autoCollapseInput!=`boolean`&&(n.autoCollapseInput=!1),typeof n.showAgentSwarmPanel==`boolean`?n.showAgentSwarmPanel=n.showAgentSwarmPanel?`bottom`:`off`:(typeof n.showAgentSwarmPanel!=`string`||![`bottom`,`sidebar`,`off`].includes(n.showAgentSwarmPanel))&&(n.showAgentSwarmPanel=`bottom`),typeof n.allowOutsideProjectRoot!=`boolean`&&(n.allowOutsideProjectRoot=!0),typeof n.readSymbols!=`boolean`&&(n.readSymbols=!1),typeof n.showSageMemoryInject!=`boolean`&&(n.showSageMemoryInject=!1),(typeof n.sageMemoryInjectThreshold!=`number`||!Number.isFinite(n.sageMemoryInjectThreshold)||n.sageMemoryInjectThreshold<0||n.sageMemoryInjectThreshold>1)&&(n.sageMemoryInjectThreshold=.85),(typeof n.preRefineSeconds!=`number`||!Number.isFinite(n.preRefineSeconds)||n.preRefineSeconds<0)&&(n.preRefineSeconds=3),(typeof n.multiDiffSummaryThreshold!=`number`||!Number.isFinite(n.multiDiffSummaryThreshold)||n.multiDiffSummaryThreshold<0)&&(n.multiDiffSummaryThreshold=5),n},partialize:e=>{let{hqToken:t,...n}=e;return n},merge:(e,t)=>{let{hqToken:n,...r}=e??{};return{...t,...r,hqToken:``}}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}n.use(e).use(t((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-BLSyJfTr.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-BnkVCZ3Q.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-aaAou3Tl.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-BiNu_WzQ.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-zKBcRjqE.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-DD8rKpQU.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-BwEBEQ51.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-CdiY7G6Z.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DpaemFux.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-COVxQ0FV.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-zIY9-ivF.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-BFcmn89w.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-C-9I3_s4.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-BPuAsrkF.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-Nlxs0V7J.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BXJbu5Y-.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-DdFgBMAw.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-COxU-AT_.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-CRMLR4a3.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-BfQBSiII.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-Dfk74u87.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-Ch7JihXD.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-Bb7_utQE.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-CMteRkTs.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-BnTQWNPX.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-CR2B97dj.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-CUh_kgfp.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-DPaTeTls.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-Bd8zMwvC.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-pPW1kVR_.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-Xqrt9v4z.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-DResBrkV.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-tFxIIhvU.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-DdGpRh8j.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-E8SKMLxq.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-BOYK0I6-.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CZIixoel.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-Di8o0wDz.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-CGMq-qlP.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-pI6fYZW3.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-De6sXIFO.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-Bd23KLtt.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(n.language||`en`),x.subscribe((e,t)=>{let r=e.uiLocale;r&&r!==t.uiLocale&&r!==n.language&&n.changeLanguage(r).then(()=>w(r))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(e=>{if(!e)return;let t=v(e);if(t===n.language)return;let r=x.getState();r.uiLocale!==t&&r.set({uiLocale:t}),n.changeLanguage(t).then(()=>w(t))})}try{T()}catch{}export{h as n,x as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/activity-BwEBEQ51.js","assets/rolldown-runtime-QTnfLwEv.js","assets/chat-CdiY7G6Z.js","assets/commandPalette-DpaemFux.js","assets/common-COVxQ0FV.js","assets/settings-BUtmAZBV.js","assets/setup-BFcmn89w.js","assets/toasts-BL_8kH4B.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Ia as e,La as t,Na as n,Pa as r,Ra as i}from"./vendor-GiKfK4Iw.js";import{t as a}from"./activity-BwEBEQ51.js";import{t as o}from"./chat-CdiY7G6Z.js";import{t as s}from"./commandPalette-DpaemFux.js";import{t as c}from"./common-COVxQ0FV.js";import{t as l}from"./settings-BUtmAZBV.js";import{t as u}from"./setup-BFcmn89w.js";import{t as d}from"./toasts-BL_8kH4B.js";import{s as f}from"./monaco-BLUV5g0U.js";var p=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},m=[`en`,`tr`,`de`,`fr`,`it`,`es`,`pt-BR`],h=[{code:`en`,name:`English`},{code:`tr`,name:`Türkçe`},{code:`de`,name:`Deutsch`},{code:`fr`,name:`Français`},{code:`it`,name:`Italiano`},{code:`es`,name:`Español`},{code:`pt-BR`,name:`Português (Brasil)`}],g=new Set(m);function _(){return typeof navigator>`u`||!navigator.language?`en`:y(navigator.language)}function v(e){return!e||typeof e!=`string`?_():y(e)}function y(e){let t=e.trim().toLowerCase();if(!t)return`en`;if(g.has(t))return t;let n=t.split(`-`)[0];return n&&g.has(n)?n:n===`pt`?`pt-BR`:`en`}var b={autonomy:`auto`,autonomyDelayMs:45e3,autoProceedMaxIterations:50,yolo:!0,maxIterations:500,chime:!1,confirmExit:!0,fleetChatVerbosity:`off`,nextPrediction:!1,nextStepsTool:!1,fallbackModels:[],fallbackProfiles:{},favoriteModels:[],favoriteModelsOnly:!1,modelMatrix:{},fallbackAuto:!0,modelAvailabilitySchedule:[],featureMcp:!0,featurePlugins:!0,featureMemory:!0,featureSkills:!0,featureModelsRegistry:!0,indexOnStart:!0,contextAutoCompact:!0,contextStrategy:`hybrid`,contextMode:`balanced`,tokenSavingTier:`off`,maxConcurrent:10,titleAnimation:!0,logLevel:`info`,auditLevel:`standard`,enhanceEnabled:!0,enhanceDelayMs:6e4,enhanceCountdownMs:3e3,enhanceLanguage:`original`,refinerProvider:``,refinerModel:``,refinerFallbackProfile:``,thinkingWord:`thinking`,statuslineMode:`minimum`,animationStyle:`rainbow`,showThinkingLogs:!0,groupToolCalls:!0,autoCollapseInput:!1,showModelReasoning:!0,showAgentSwarmPanel:`bottom`,allowOutsideProjectRoot:!0,reasoningMode:`auto`,reasoningEffort:`high`,reasoningPreserve:!1,cacheTtl:`default`,breakerEnabled:!1,breakerAutoKillResetMs:6e4,fsAccess:`unrestricted`,debugStream:!1,hqEnabled:!1,hqUrl:``,hqToken:``,hqRawContent:!1,tgConfigured:!1,tgSessionEnd:!1,tgDelegate:!0,tgLongToolMs:3e4,uiLocale:_(),chimeraAutoFix:`off`,readSymbols:!1,showSageMemoryInject:!1,sageMemoryInjectThreshold:.85,preRefineSeconds:3,multiDiffSummaryThreshold:5,chimeraEnabled:!0,chimeraProvider:``,chimeraModel:``,chimeraMaxFiles:15,autoReviewEnabled:!1,autoReviewProvider:``,autoReviewModel:``,autoReviewFallbackProfile:``,autoReviewModelSelection:`round-robin`,autoReviewFallbackModels:[],autoReviewDebounceMs:15e3,autoReviewMaxFilesPerBatch:15,autoReviewMaxConcurrentReviews:2,autoReviewCascadeOn:`off`,pluginsEnabled:{}},x=r()(n(e=>({...b,set:t=>e(t),reset:()=>e(b)}),{name:`wrongstack-local-prefs`,version:15,migrate:(e,t)=>{let n=e??{};return t<12&&n.autoReviewDebounceMs===5e3&&(n.autoReviewDebounceMs=15e3),typeof n.fleetChatVerbosity!=`string`&&(n.streamFleet===!0?n.fleetChatVerbosity=`full`:(n.streamFleet,n.fleetChatVerbosity=`off`),delete n.streamFleet),n.fleetChatVerbosity!==`off`&&n.fleetChatVerbosity!==`full`&&(n.fleetChatVerbosity=`off`),[`hybrid`,`intelligent`,`selective`].includes(n.contextStrategy)||(n.contextStrategy=`hybrid`),n.auditLevel===`verbose`&&(n.auditLevel=`full`),[`minimal`,`standard`,`full`].includes(n.auditLevel)||(n.auditLevel=`standard`),typeof n.autoProceedMaxIterations!=`number`&&(n.autoProceedMaxIterations=50),(!n.fallbackProfiles||typeof n.fallbackProfiles!=`object`||Array.isArray(n.fallbackProfiles))&&(n.fallbackProfiles={}),Array.isArray(n.favoriteModels)||(n.favoriteModels=[]),typeof n.favoriteModelsOnly!=`boolean`&&(n.favoriteModelsOnly=!1),Array.isArray(n.modelAvailabilitySchedule)||(n.modelAvailabilitySchedule=[]),(!n.modelMatrix||typeof n.modelMatrix!=`object`||Array.isArray(n.modelMatrix))&&(n.modelMatrix={}),(typeof n.uiLocale!=`string`||!n.uiLocale)&&(n.uiLocale=_()),typeof n.breakerEnabled!=`boolean`&&(n.breakerEnabled=!1),typeof n.breakerAutoKillResetMs!=`number`&&(n.breakerAutoKillResetMs=6e4),n.fsAccess!==`unrestricted`&&n.fsAccess!==`project`&&(n.fsAccess=`unrestricted`),typeof n.debugStream!=`boolean`&&(n.debugStream=!1),typeof n.chimeraEnabled!=`boolean`&&(n.chimeraEnabled=!0),typeof n.chimeraProvider!=`string`&&(n.chimeraProvider=``),typeof n.chimeraModel!=`string`&&(n.chimeraModel=``),n.chimeraAutoFix!==`off`&&n.chimeraAutoFix!==`ask`&&n.chimeraAutoFix!==`auto`&&(n.chimeraAutoFix=`off`),(typeof n.chimeraMaxFiles!=`number`||!Number.isFinite(n.chimeraMaxFiles)||n.chimeraMaxFiles<1)&&(n.chimeraMaxFiles=15),typeof n.autoReviewEnabled!=`boolean`&&(n.autoReviewEnabled=!1),typeof n.autoReviewProvider!=`string`&&(n.autoReviewProvider=``),typeof n.autoReviewModel!=`string`&&(n.autoReviewModel=``),typeof n.autoReviewFallbackProfile!=`string`&&(n.autoReviewFallbackProfile=``),n.autoReviewModelSelection!==`round-robin`&&n.autoReviewModelSelection!==`random`&&(n.autoReviewModelSelection=`round-robin`),Array.isArray(n.autoReviewFallbackModels)||(n.autoReviewFallbackModels=[]),(typeof n.autoReviewDebounceMs!=`number`||!Number.isFinite(n.autoReviewDebounceMs)||n.autoReviewDebounceMs<0)&&(n.autoReviewDebounceMs=15e3),(typeof n.autoReviewMaxFilesPerBatch!=`number`||!Number.isFinite(n.autoReviewMaxFilesPerBatch)||n.autoReviewMaxFilesPerBatch<1)&&(n.autoReviewMaxFilesPerBatch=15),(typeof n.autoReviewMaxConcurrentReviews!=`number`||!Number.isFinite(n.autoReviewMaxConcurrentReviews)||n.autoReviewMaxConcurrentReviews<1)&&(n.autoReviewMaxConcurrentReviews=2),n.autoReviewCascadeOn!==`off`&&n.autoReviewCascadeOn!==`critical`&&n.autoReviewCascadeOn!==`high`&&(n.autoReviewCascadeOn=`off`),typeof n.showModelReasoning!=`boolean`&&(n.showModelReasoning=!0),typeof n.autoCollapseInput!=`boolean`&&(n.autoCollapseInput=!1),typeof n.showAgentSwarmPanel==`boolean`?n.showAgentSwarmPanel=n.showAgentSwarmPanel?`bottom`:`off`:(typeof n.showAgentSwarmPanel!=`string`||![`bottom`,`sidebar`,`off`].includes(n.showAgentSwarmPanel))&&(n.showAgentSwarmPanel=`bottom`),typeof n.allowOutsideProjectRoot!=`boolean`&&(n.allowOutsideProjectRoot=!0),typeof n.readSymbols!=`boolean`&&(n.readSymbols=!1),typeof n.showSageMemoryInject!=`boolean`&&(n.showSageMemoryInject=!1),(typeof n.sageMemoryInjectThreshold!=`number`||!Number.isFinite(n.sageMemoryInjectThreshold)||n.sageMemoryInjectThreshold<0||n.sageMemoryInjectThreshold>1)&&(n.sageMemoryInjectThreshold=.85),(typeof n.preRefineSeconds!=`number`||!Number.isFinite(n.preRefineSeconds)||n.preRefineSeconds<0)&&(n.preRefineSeconds=3),(typeof n.multiDiffSummaryThreshold!=`number`||!Number.isFinite(n.multiDiffSummaryThreshold)||n.multiDiffSummaryThreshold<0)&&(n.multiDiffSummaryThreshold=5),n},partialize:e=>{let{hqToken:t,...n}=e;return n},merge:(e,t)=>{let{hqToken:n,...r}=e??{};return{...t,...r,hqToken:``}}})),S=[`common`,`activity`,`chat`,`commandPalette`,`settings`,`setup`,`toasts`];function C(){try{return v(x.getState().uiLocale)}catch{return`en`}}i.use(e).use(t((e,t)=>p(Object.assign({"./locales/de/activity.json":()=>f(()=>import(`./activity-BLSyJfTr.js`),[]),"./locales/de/chat.json":()=>f(()=>import(`./chat-BnkVCZ3Q.js`),[]),"./locales/de/commandPalette.json":()=>f(()=>import(`./commandPalette-aaAou3Tl.js`),[]),"./locales/de/common.json":()=>f(()=>import(`./common-BiNu_WzQ.js`),[]),"./locales/de/settings.json":()=>f(()=>import(`./settings-ClpzPWKE.js`),[]),"./locales/de/setup.json":()=>f(()=>import(`./setup-DD8rKpQU.js`),[]),"./locales/de/toasts.json":()=>f(()=>import(`./toasts-CFzweRH5.js`),[]),"./locales/en/activity.json":()=>f(()=>import(`./activity-BwEBEQ51.js`).then(e=>e.n),__vite__mapDeps([0,1])),"./locales/en/chat.json":()=>f(()=>import(`./chat-CdiY7G6Z.js`).then(e=>e.n),__vite__mapDeps([2,1])),"./locales/en/commandPalette.json":()=>f(()=>import(`./commandPalette-DpaemFux.js`).then(e=>e.n),__vite__mapDeps([3,1])),"./locales/en/common.json":()=>f(()=>import(`./common-COVxQ0FV.js`).then(e=>e.n),__vite__mapDeps([4,1])),"./locales/en/settings.json":()=>f(()=>import(`./settings-BUtmAZBV.js`).then(e=>e.n),__vite__mapDeps([5,1])),"./locales/en/setup.json":()=>f(()=>import(`./setup-BFcmn89w.js`).then(e=>e.n),__vite__mapDeps([6,1])),"./locales/en/toasts.json":()=>f(()=>import(`./toasts-BL_8kH4B.js`).then(e=>e.n),__vite__mapDeps([7,1])),"./locales/es/activity.json":()=>f(()=>import(`./activity-C-9I3_s4.js`),[]),"./locales/es/chat.json":()=>f(()=>import(`./chat-BPuAsrkF.js`),[]),"./locales/es/commandPalette.json":()=>f(()=>import(`./commandPalette-Nlxs0V7J.js`),[]),"./locales/es/common.json":()=>f(()=>import(`./common-BXJbu5Y-.js`),[]),"./locales/es/settings.json":()=>f(()=>import(`./settings-DyIEVRJT.js`),[]),"./locales/es/setup.json":()=>f(()=>import(`./setup-COxU-AT_.js`),[]),"./locales/es/toasts.json":()=>f(()=>import(`./toasts-BwQJwYLe.js`),[]),"./locales/fr/activity.json":()=>f(()=>import(`./activity-CRMLR4a3.js`),[]),"./locales/fr/chat.json":()=>f(()=>import(`./chat-BfQBSiII.js`),[]),"./locales/fr/commandPalette.json":()=>f(()=>import(`./commandPalette-Dfk74u87.js`),[]),"./locales/fr/common.json":()=>f(()=>import(`./common-Ch7JihXD.js`),[]),"./locales/fr/settings.json":()=>f(()=>import(`./settings-BlMNd_AC.js`),[]),"./locales/fr/setup.json":()=>f(()=>import(`./setup-CMteRkTs.js`),[]),"./locales/fr/toasts.json":()=>f(()=>import(`./toasts-BCDGDcyq.js`),[]),"./locales/it/activity.json":()=>f(()=>import(`./activity-BnTQWNPX.js`),[]),"./locales/it/chat.json":()=>f(()=>import(`./chat-CR2B97dj.js`),[]),"./locales/it/commandPalette.json":()=>f(()=>import(`./commandPalette-CUh_kgfp.js`),[]),"./locales/it/common.json":()=>f(()=>import(`./common-DPaTeTls.js`),[]),"./locales/it/settings.json":()=>f(()=>import(`./settings-CyYYbmdR.js`),[]),"./locales/it/setup.json":()=>f(()=>import(`./setup-pPW1kVR_.js`),[]),"./locales/it/toasts.json":()=>f(()=>import(`./toasts-Dm12Nq8t.js`),[]),"./locales/pt-BR/activity.json":()=>f(()=>import(`./activity-Xqrt9v4z.js`),[]),"./locales/pt-BR/chat.json":()=>f(()=>import(`./chat-DResBrkV.js`),[]),"./locales/pt-BR/commandPalette.json":()=>f(()=>import(`./commandPalette-tFxIIhvU.js`),[]),"./locales/pt-BR/common.json":()=>f(()=>import(`./common-DdGpRh8j.js`),[]),"./locales/pt-BR/settings.json":()=>f(()=>import(`./settings-Orwkg3lH.js`),[]),"./locales/pt-BR/setup.json":()=>f(()=>import(`./setup-BOYK0I6-.js`),[]),"./locales/pt-BR/toasts.json":()=>f(()=>import(`./toasts-frBt6fvE.js`),[]),"./locales/tr/activity.json":()=>f(()=>import(`./activity-CZIixoel.js`),[]),"./locales/tr/chat.json":()=>f(()=>import(`./chat-Di8o0wDz.js`),[]),"./locales/tr/commandPalette.json":()=>f(()=>import(`./commandPalette-CGMq-qlP.js`),[]),"./locales/tr/common.json":()=>f(()=>import(`./common-pI6fYZW3.js`),[]),"./locales/tr/settings.json":()=>f(()=>import(`./settings-XRC0dC9D.js`),[]),"./locales/tr/setup.json":()=>f(()=>import(`./setup-Bd23KLtt.js`),[]),"./locales/tr/toasts.json":()=>f(()=>import(`./toasts-DDYQsJV8.js`),[])}),`./locales/${e}/${t}.json`,4))).init({lng:C(),fallbackLng:`en`,supportedLngs:[...m],ns:[...S],defaultNS:`common`,partialBundledLanguages:!0,resources:{en:{common:c,activity:a,chat:o,commandPalette:s,settings:l,setup:u,toasts:d}},interpolation:{escapeValue:!1},react:{useSuspense:!1},returnNull:!1});function w(e){typeof document<`u`&&(document.documentElement.lang=e)}w(i.language||`en`),x.subscribe((e,t)=>{let n=e.uiLocale;n&&n!==t.uiLocale&&n!==i.language&&i.changeLanguage(n).then(()=>w(n))});function T(){window.wrongstackDesktopHost?.onLocaleChanged?.(e=>{if(!e)return;let t=v(e);if(t===i.language)return;let n=x.getState();n.uiLocale!==t&&n.set({uiLocale:t}),i.changeLanguage(t).then(()=>w(t))})}try{T()}catch{}export{h as n,x as t};
|