@principal-ade/code-quality-panels 0.1.18 → 0.1.20

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.
@@ -106,7 +106,7 @@ const createLucideIcon = (iconName, iconNode) => {
106
106
  * This source code is licensed under the ISC license.
107
107
  * See the LICENSE file in the root directory of this source tree.
108
108
  */
109
- const __iconNode$e = [
109
+ const __iconNode$f = [
110
110
  ["path", { d: "M12 7v14", key: "1akyts" }],
111
111
  [
112
112
  "path",
@@ -116,14 +116,14 @@ const __iconNode$e = [
116
116
  }
117
117
  ]
118
118
  ];
119
- const BookOpen = createLucideIcon("book-open", __iconNode$e);
119
+ const BookOpen = createLucideIcon("book-open", __iconNode$f);
120
120
  /**
121
121
  * @license lucide-react v0.552.0 - ISC
122
122
  *
123
123
  * This source code is licensed under the ISC license.
124
124
  * See the LICENSE file in the root directory of this source tree.
125
125
  */
126
- const __iconNode$d = [
126
+ const __iconNode$e = [
127
127
  [
128
128
  "path",
129
129
  { d: "M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1", key: "ezmyqa" }
@@ -136,14 +136,14 @@ const __iconNode$d = [
136
136
  }
137
137
  ]
138
138
  ];
139
- const Braces = createLucideIcon("braces", __iconNode$d);
139
+ const Braces = createLucideIcon("braces", __iconNode$e);
140
140
  /**
141
141
  * @license lucide-react v0.552.0 - ISC
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
145
  */
146
- const __iconNode$c = [
146
+ const __iconNode$d = [
147
147
  ["path", { d: "M12 20v-9", key: "1qisl0" }],
148
148
  ["path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z", key: "uouzyp" }],
149
149
  ["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
@@ -156,41 +156,41 @@ const __iconNode$c = [
156
156
  ["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
157
157
  ["path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13", key: "1vgav8" }]
158
158
  ];
159
- const Bug = createLucideIcon("bug", __iconNode$c);
159
+ const Bug = createLucideIcon("bug", __iconNode$d);
160
160
  /**
161
161
  * @license lucide-react v0.552.0 - ISC
162
162
  *
163
163
  * This source code is licensed under the ISC license.
164
164
  * See the LICENSE file in the root directory of this source tree.
165
165
  */
166
- const __iconNode$b = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
167
- const Check = createLucideIcon("check", __iconNode$b);
166
+ const __iconNode$c = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
167
+ const Check = createLucideIcon("check", __iconNode$c);
168
168
  /**
169
169
  * @license lucide-react v0.552.0 - ISC
170
170
  *
171
171
  * This source code is licensed under the ISC license.
172
172
  * See the LICENSE file in the root directory of this source tree.
173
173
  */
174
- const __iconNode$a = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
175
- const ChevronRight = createLucideIcon("chevron-right", __iconNode$a);
174
+ const __iconNode$b = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
175
+ const ChevronRight = createLucideIcon("chevron-right", __iconNode$b);
176
176
  /**
177
177
  * @license lucide-react v0.552.0 - ISC
178
178
  *
179
179
  * This source code is licensed under the ISC license.
180
180
  * See the LICENSE file in the root directory of this source tree.
181
181
  */
182
- const __iconNode$9 = [
182
+ const __iconNode$a = [
183
183
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
184
184
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
185
185
  ];
186
- const Copy = createLucideIcon("copy", __iconNode$9);
186
+ const Copy = createLucideIcon("copy", __iconNode$a);
187
187
  /**
188
188
  * @license lucide-react v0.552.0 - ISC
189
189
  *
190
190
  * This source code is licensed under the ISC license.
191
191
  * See the LICENSE file in the root directory of this source tree.
192
192
  */
193
- const __iconNode$8 = [
193
+ const __iconNode$9 = [
194
194
  [
195
195
  "path",
196
196
  {
@@ -202,14 +202,14 @@ const __iconNode$8 = [
202
202
  ["circle", { cx: "11.5", cy: "14.5", r: "2.5", key: "1bq0ko" }],
203
203
  ["path", { d: "M13.3 16.3 15 18", key: "2quom7" }]
204
204
  ];
205
- const FileSearch = createLucideIcon("file-search", __iconNode$8);
205
+ const FileSearch = createLucideIcon("file-search", __iconNode$9);
206
206
  /**
207
207
  * @license lucide-react v0.552.0 - ISC
208
208
  *
209
209
  * This source code is licensed under the ISC license.
210
210
  * See the LICENSE file in the root directory of this source tree.
211
211
  */
212
- const __iconNode$7 = [
212
+ const __iconNode$8 = [
213
213
  [
214
214
  "path",
215
215
  {
@@ -220,27 +220,27 @@ const __iconNode$7 = [
220
220
  ["path", { d: "M6.453 15h11.094", key: "3shlmq" }],
221
221
  ["path", { d: "M8.5 2h7", key: "csnxdl" }]
222
222
  ];
223
- const FlaskConical = createLucideIcon("flask-conical", __iconNode$7);
223
+ const FlaskConical = createLucideIcon("flask-conical", __iconNode$8);
224
224
  /**
225
225
  * @license lucide-react v0.552.0 - ISC
226
226
  *
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const __iconNode$6 = [
230
+ const __iconNode$7 = [
231
231
  ["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
232
232
  ["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
233
233
  ["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
234
234
  ["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
235
235
  ];
236
- const GitBranch = createLucideIcon("git-branch", __iconNode$6);
236
+ const GitBranch = createLucideIcon("git-branch", __iconNode$7);
237
237
  /**
238
238
  * @license lucide-react v0.552.0 - ISC
239
239
  *
240
240
  * This source code is licensed under the ISC license.
241
241
  * See the LICENSE file in the root directory of this source tree.
242
242
  */
243
- const __iconNode$5 = [
243
+ const __iconNode$6 = [
244
244
  [
245
245
  "path",
246
246
  {
@@ -249,26 +249,26 @@ const __iconNode$5 = [
249
249
  }
250
250
  ]
251
251
  ];
252
- const Hexagon = createLucideIcon("hexagon", __iconNode$5);
252
+ const Hexagon = createLucideIcon("hexagon", __iconNode$6);
253
253
  /**
254
254
  * @license lucide-react v0.552.0 - ISC
255
255
  *
256
256
  * This source code is licensed under the ISC license.
257
257
  * See the LICENSE file in the root directory of this source tree.
258
258
  */
259
- const __iconNode$4 = [
259
+ const __iconNode$5 = [
260
260
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
261
261
  ["path", { d: "M12 16v-4", key: "1dtifu" }],
262
262
  ["path", { d: "M12 8h.01", key: "e9boi3" }]
263
263
  ];
264
- const Info = createLucideIcon("info", __iconNode$4);
264
+ const Info = createLucideIcon("info", __iconNode$5);
265
265
  /**
266
266
  * @license lucide-react v0.552.0 - ISC
267
267
  *
268
268
  * This source code is licensed under the ISC license.
269
269
  * See the LICENSE file in the root directory of this source tree.
270
270
  */
271
- const __iconNode$3 = [
271
+ const __iconNode$4 = [
272
272
  [
273
273
  "path",
274
274
  {
@@ -280,32 +280,43 @@ const __iconNode$3 = [
280
280
  ["path", { d: "M22 4h-4", key: "gwowj6" }],
281
281
  ["circle", { cx: "4", cy: "20", r: "2", key: "6kqj1y" }]
282
282
  ];
283
- const Sparkles = createLucideIcon("sparkles", __iconNode$3);
283
+ const Sparkles = createLucideIcon("sparkles", __iconNode$4);
284
284
  /**
285
285
  * @license lucide-react v0.552.0 - ISC
286
286
  *
287
287
  * This source code is licensed under the ISC license.
288
288
  * See the LICENSE file in the root directory of this source tree.
289
289
  */
290
- const __iconNode$2 = [
290
+ const __iconNode$3 = [
291
291
  ["path", { d: "M12 19h8", key: "baeox8" }],
292
292
  ["path", { d: "m4 17 6-6-6-6", key: "1yngyt" }]
293
293
  ];
294
- const Terminal = createLucideIcon("terminal", __iconNode$2);
294
+ const Terminal = createLucideIcon("terminal", __iconNode$3);
295
295
  /**
296
296
  * @license lucide-react v0.552.0 - ISC
297
297
  *
298
298
  * This source code is licensed under the ISC license.
299
299
  * See the LICENSE file in the root directory of this source tree.
300
300
  */
301
- const __iconNode$1 = [
301
+ const __iconNode$2 = [
302
302
  ["path", { d: "M10 11v6", key: "nco0om" }],
303
303
  ["path", { d: "M14 11v6", key: "outv1u" }],
304
304
  ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
305
305
  ["path", { d: "M3 6h18", key: "d0wm0j" }],
306
306
  ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
307
307
  ];
308
- const Trash2 = createLucideIcon("trash-2", __iconNode$1);
308
+ const Trash2 = createLucideIcon("trash-2", __iconNode$2);
309
+ /**
310
+ * @license lucide-react v0.552.0 - ISC
311
+ *
312
+ * This source code is licensed under the ISC license.
313
+ * See the LICENSE file in the root directory of this source tree.
314
+ */
315
+ const __iconNode$1 = [
316
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
317
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
318
+ ];
319
+ const X = createLucideIcon("x", __iconNode$1);
309
320
  /**
310
321
  * @license lucide-react v0.552.0 - ISC
311
322
  *
@@ -1471,6 +1482,17 @@ const QualityHexagonPanelContent = ({
1471
1482
  var _a;
1472
1483
  const { theme } = useTheme();
1473
1484
  const [refreshingPackages, setRefreshingPackages] = React2__default.useState(/* @__PURE__ */ new Set());
1485
+ const [showHelpOverlay, setShowHelpOverlay] = React2__default.useState(false);
1486
+ const [copiedCommand, setCopiedCommand] = React2__default.useState(null);
1487
+ const handleCopyCommand = async (command) => {
1488
+ try {
1489
+ await navigator.clipboard.writeText(command);
1490
+ setCopiedCommand(command);
1491
+ setTimeout(() => setCopiedCommand(null), 2e3);
1492
+ } catch {
1493
+ console.log("Copy:", command);
1494
+ }
1495
+ };
1474
1496
  const qualitySlice = context.getSlice("quality");
1475
1497
  const hasQualitySlice = context.hasSlice("quality");
1476
1498
  const isLoading = (qualitySlice == null ? void 0 : qualitySlice.loading) ?? false;
@@ -1536,7 +1558,8 @@ const QualityHexagonPanelContent = ({
1536
1558
  overflowY: "auto",
1537
1559
  boxSizing: "border-box",
1538
1560
  display: "flex",
1539
- flexDirection: "column"
1561
+ flexDirection: "column",
1562
+ position: "relative"
1540
1563
  },
1541
1564
  children: [
1542
1565
  /* @__PURE__ */ jsxs("div", { style: {
@@ -1565,7 +1588,8 @@ const QualityHexagonPanelContent = ({
1565
1588
  /* @__PURE__ */ jsx(
1566
1589
  "span",
1567
1590
  {
1568
- title: "Platinum: 90%+ avg | Gold: 75%+ | Silver: 60%+ | Bronze: 40%+",
1591
+ onClick: () => setShowHelpOverlay(true),
1592
+ title: "Click for help",
1569
1593
  style: {
1570
1594
  display: "inline-flex",
1571
1595
  alignItems: "center",
@@ -1576,7 +1600,7 @@ const QualityHexagonPanelContent = ({
1576
1600
  border: `1px solid ${theme.colors.border}`,
1577
1601
  fontSize: 11,
1578
1602
  color: theme.colors.textMuted,
1579
- cursor: "help"
1603
+ cursor: "pointer"
1580
1604
  },
1581
1605
  children: "?"
1582
1606
  }
@@ -1649,6 +1673,133 @@ const QualityHexagonPanelContent = ({
1649
1673
  );
1650
1674
  }) })
1651
1675
  }
1676
+ ),
1677
+ showHelpOverlay && /* @__PURE__ */ jsx(
1678
+ "div",
1679
+ {
1680
+ style: {
1681
+ position: "absolute",
1682
+ top: 0,
1683
+ left: 0,
1684
+ right: 0,
1685
+ bottom: 0,
1686
+ backgroundColor: "rgba(0, 0, 0, 0.7)",
1687
+ display: "flex",
1688
+ alignItems: "center",
1689
+ justifyContent: "center",
1690
+ zIndex: 100
1691
+ },
1692
+ onClick: () => setShowHelpOverlay(false),
1693
+ children: /* @__PURE__ */ jsxs(
1694
+ "div",
1695
+ {
1696
+ style: {
1697
+ backgroundColor: theme.colors.surface,
1698
+ borderRadius: 8,
1699
+ padding: 20,
1700
+ maxWidth: 400,
1701
+ width: "90%",
1702
+ border: `1px solid ${theme.colors.border}`
1703
+ },
1704
+ onClick: (e) => e.stopPropagation(),
1705
+ children: [
1706
+ /* @__PURE__ */ jsxs("div", { style: {
1707
+ display: "flex",
1708
+ justifyContent: "space-between",
1709
+ alignItems: "center",
1710
+ marginBottom: 16
1711
+ }, children: [
1712
+ /* @__PURE__ */ jsx("h3", { style: {
1713
+ margin: 0,
1714
+ fontSize: 16,
1715
+ fontWeight: 600,
1716
+ color: theme.colors.text
1717
+ }, children: "Quality Lens CLI" }),
1718
+ /* @__PURE__ */ jsx(
1719
+ "button",
1720
+ {
1721
+ onClick: () => setShowHelpOverlay(false),
1722
+ style: {
1723
+ background: "none",
1724
+ border: "none",
1725
+ cursor: "pointer",
1726
+ padding: 4,
1727
+ display: "flex",
1728
+ color: theme.colors.textMuted
1729
+ },
1730
+ children: /* @__PURE__ */ jsx(X, { size: 18 })
1731
+ }
1732
+ )
1733
+ ] }),
1734
+ /* @__PURE__ */ jsx("p", { style: {
1735
+ fontSize: 13,
1736
+ color: theme.colors.textMuted,
1737
+ margin: "0 0 12px 0"
1738
+ }, children: "Run quality checks locally with the CLI:" }),
1739
+ [
1740
+ { cmd: "npx @principal-ai/quality-lens-cli init", label: "Initialize quality lens in your project" },
1741
+ { cmd: "npx @principal-ai/quality-lens-cli list", label: "List available quality lenses" }
1742
+ ].map(({ cmd, label }) => /* @__PURE__ */ jsxs("div", { style: { marginBottom: 12 }, children: [
1743
+ /* @__PURE__ */ jsx("span", { style: { fontSize: 11, color: theme.colors.textMuted }, children: label }),
1744
+ /* @__PURE__ */ jsxs(
1745
+ "div",
1746
+ {
1747
+ style: {
1748
+ display: "flex",
1749
+ alignItems: "center",
1750
+ justifyContent: "space-between",
1751
+ gap: 8,
1752
+ padding: "8px 12px",
1753
+ borderRadius: 6,
1754
+ backgroundColor: theme.colors.background,
1755
+ border: `1px solid ${theme.colors.border}`,
1756
+ fontFamily: "monospace",
1757
+ fontSize: 12,
1758
+ marginTop: 4
1759
+ },
1760
+ children: [
1761
+ /* @__PURE__ */ jsx("code", { style: { color: theme.colors.text }, children: cmd }),
1762
+ /* @__PURE__ */ jsx(
1763
+ "button",
1764
+ {
1765
+ onClick: () => handleCopyCommand(cmd),
1766
+ style: {
1767
+ display: "flex",
1768
+ alignItems: "center",
1769
+ padding: 4,
1770
+ border: "none",
1771
+ backgroundColor: "transparent",
1772
+ color: theme.colors.textMuted,
1773
+ cursor: "pointer"
1774
+ },
1775
+ title: "Copy command",
1776
+ children: copiedCommand === cmd ? /* @__PURE__ */ jsx(Check, { size: 14, color: theme.colors.success }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
1777
+ }
1778
+ )
1779
+ ]
1780
+ }
1781
+ )
1782
+ ] }, cmd)),
1783
+ /* @__PURE__ */ jsxs("div", { style: {
1784
+ marginTop: 16,
1785
+ padding: 12,
1786
+ backgroundColor: theme.colors.background,
1787
+ borderRadius: 6,
1788
+ fontSize: 12,
1789
+ color: theme.colors.textMuted
1790
+ }, children: [
1791
+ /* @__PURE__ */ jsx("strong", { style: { color: theme.colors.text }, children: "Tiers:" }),
1792
+ /* @__PURE__ */ jsxs("div", { style: { marginTop: 8, display: "flex", flexDirection: "column", gap: 4 }, children: [
1793
+ /* @__PURE__ */ jsx("span", { children: "🏆 Platinum: 90%+ average" }),
1794
+ /* @__PURE__ */ jsx("span", { children: "🥇 Gold: 75%+ average" }),
1795
+ /* @__PURE__ */ jsx("span", { children: "🥈 Silver: 60%+ average" }),
1796
+ /* @__PURE__ */ jsx("span", { children: "🥉 Bronze: 40%+ average" })
1797
+ ] })
1798
+ ] })
1799
+ ]
1800
+ }
1801
+ )
1802
+ }
1652
1803
  )
1653
1804
  ]
1654
1805
  }
@@ -1873,11 +2024,6 @@ function RepositoryQualityGridItem({
1873
2024
  }
1874
2025
  );
1875
2026
  }
1876
- function calculateAverageScore(metrics) {
1877
- const adjusted = { ...metrics };
1878
- adjusted.deadCode = 100 - adjusted.deadCode;
1879
- return Object.values(adjusted).reduce((a, b) => a + b, 0) / 6;
1880
- }
1881
2027
  function RepositoryQualityGrid({
1882
2028
  repositories,
1883
2029
  theme,
@@ -1891,16 +2037,8 @@ function RepositoryQualityGrid({
1891
2037
  const items = React2.useMemo(() => flattenRepositories(repositories), [repositories]);
1892
2038
  const overallTier = React2.useMemo(() => calculateOverallTier(items), [items]);
1893
2039
  const sortedItems = React2.useMemo(() => {
1894
- return [...items].sort((a, b) => {
1895
- if (selectedMetric) {
1896
- const aVal = selectedMetric === "deadCode" ? 100 - a.metrics[selectedMetric] : a.metrics[selectedMetric];
1897
- const bVal = selectedMetric === "deadCode" ? 100 - b.metrics[selectedMetric] : b.metrics[selectedMetric];
1898
- return bVal - aVal;
1899
- } else {
1900
- return calculateAverageScore(b.metrics) - calculateAverageScore(a.metrics);
1901
- }
1902
- });
1903
- }, [items, selectedMetric]);
2040
+ return [...items].sort((a, b) => a.packageName.localeCompare(b.packageName));
2041
+ }, [items]);
1904
2042
  const tierColors = {
1905
2043
  none: "#808080",
1906
2044
  bronze: "#CD7F32",
@@ -2186,9 +2324,10 @@ const RepositoryQualityGridPanelContent = ({
2186
2324
  };
2187
2325
  const RepositoryQualityGridPanel = RepositoryQualityGridPanelContent;
2188
2326
  function groupResultsByPackage(results) {
2327
+ var _a;
2189
2328
  const map = /* @__PURE__ */ new Map();
2190
2329
  for (const result of results) {
2191
- const key = result.package.name;
2330
+ const key = ((_a = result.package) == null ? void 0 : _a.name) ?? "unknown";
2192
2331
  const existing = map.get(key) || [];
2193
2332
  existing.push(result);
2194
2333
  map.set(key, existing);
@@ -2234,14 +2373,15 @@ function getSeverityBg(severity) {
2234
2373
  }
2235
2374
  }
2236
2375
  function getPackageSummary(results) {
2376
+ var _a, _b, _c, _d, _e;
2237
2377
  let totalErrors = 0;
2238
2378
  let totalWarnings = 0;
2239
2379
  let passCount = 0;
2240
2380
  let failCount = 0;
2241
2381
  for (const result of results) {
2242
- totalErrors += result.metrics.issuesBySeverity.error;
2243
- totalWarnings += result.metrics.issuesBySeverity.warning;
2244
- if (result.execution.success) {
2382
+ totalErrors += ((_b = (_a = result.metrics) == null ? void 0 : _a.issuesBySeverity) == null ? void 0 : _b.error) ?? 0;
2383
+ totalWarnings += ((_d = (_c = result.metrics) == null ? void 0 : _c.issuesBySeverity) == null ? void 0 : _d.warning) ?? 0;
2384
+ if ((_e = result.execution) == null ? void 0 : _e.success) {
2245
2385
  passCount++;
2246
2386
  } else {
2247
2387
  failCount++;
@@ -2257,7 +2397,7 @@ function LensDataDebugPanel$1({
2257
2397
  onFileClick,
2258
2398
  onPackageSelect
2259
2399
  }) {
2260
- const packageGroups = React2.useMemo(() => groupResultsByPackage(data.results), [data.results]);
2400
+ const packageGroups = React2.useMemo(() => groupResultsByPackage((data == null ? void 0 : data.results) ?? []), [data == null ? void 0 : data.results]);
2261
2401
  const packageNames = React2.useMemo(() => Array.from(packageGroups.keys()), [packageGroups]);
2262
2402
  const [selectedPackage, setSelectedPackage] = React2.useState(
2263
2403
  initialSelectedPackage || (packageNames.length === 1 ? packageNames[0] : null)
@@ -2375,10 +2515,11 @@ function LensDataDebugPanel$1({
2375
2515
  borderRadius: 6
2376
2516
  }, children: "Select a package above to view lens results" }),
2377
2517
  selectedPackage && selectedResults.map((result, idx) => {
2378
- const lensKey = `${result.lens.id}-${idx}`;
2518
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2519
+ const lensKey = `${((_a = result.lens) == null ? void 0 : _a.id) ?? "unknown"}-${idx}`;
2379
2520
  const isExpanded = expandedLens === lensKey;
2380
- const filesWithIssues = getFilesWithIssues(result.issues);
2381
- const hasIssues = result.issues.length > 0;
2521
+ const filesWithIssues = getFilesWithIssues(result.issues ?? []);
2522
+ const hasIssues = (((_b = result.issues) == null ? void 0 : _b.length) ?? 0) > 0;
2382
2523
  return /* @__PURE__ */ jsxs(
2383
2524
  "div",
2384
2525
  {
@@ -2419,10 +2560,10 @@ function LensDataDebugPanel$1({
2419
2560
  children: /* @__PURE__ */ jsx("polyline", { points: "9,18 15,12 9,6" })
2420
2561
  }
2421
2562
  ),
2422
- /* @__PURE__ */ jsx("span", { style: { fontWeight: 600, color: theme.colors.text }, children: result.lens.id }),
2563
+ /* @__PURE__ */ jsx("span", { style: { fontWeight: 600, color: theme.colors.text }, children: ((_c = result.lens) == null ? void 0 : _c.id) ?? "unknown" }),
2423
2564
  /* @__PURE__ */ jsxs("span", { style: { color: theme.colors.textMuted }, children: [
2424
2565
  "(",
2425
- result.lens.command,
2566
+ ((_d = result.lens) == null ? void 0 : _d.command) ?? "",
2426
2567
  ")"
2427
2568
  ] })
2428
2569
  ] }),
@@ -2431,33 +2572,33 @@ function LensDataDebugPanel$1({
2431
2572
  padding: "2px 6px",
2432
2573
  borderRadius: 4,
2433
2574
  fontSize: 11,
2434
- backgroundColor: result.execution.success ? "rgba(34, 197, 94, 0.1)" : "rgba(239, 68, 68, 0.1)",
2435
- color: result.execution.success ? "#22c55e" : "#ef4444"
2436
- }, children: result.execution.success ? "pass" : "fail" }),
2575
+ backgroundColor: ((_e = result.execution) == null ? void 0 : _e.success) ? "rgba(34, 197, 94, 0.1)" : "rgba(239, 68, 68, 0.1)",
2576
+ color: ((_f = result.execution) == null ? void 0 : _f.success) ? "#22c55e" : "#ef4444"
2577
+ }, children: ((_g = result.execution) == null ? void 0 : _g.success) ? "pass" : "fail" }),
2437
2578
  hasIssues && /* @__PURE__ */ jsxs("div", { style: { display: "flex", gap: 6 }, children: [
2438
- result.metrics.issuesBySeverity.error > 0 && /* @__PURE__ */ jsxs("span", { style: {
2579
+ (((_i = (_h = result.metrics) == null ? void 0 : _h.issuesBySeverity) == null ? void 0 : _i.error) ?? 0) > 0 && /* @__PURE__ */ jsxs("span", { style: {
2439
2580
  padding: "2px 6px",
2440
2581
  borderRadius: 4,
2441
2582
  fontSize: 11,
2442
2583
  backgroundColor: getSeverityBg("error"),
2443
2584
  color: getSeverityColor("error")
2444
2585
  }, children: [
2445
- result.metrics.issuesBySeverity.error,
2586
+ ((_k = (_j = result.metrics) == null ? void 0 : _j.issuesBySeverity) == null ? void 0 : _k.error) ?? 0,
2446
2587
  " errors"
2447
2588
  ] }),
2448
- result.metrics.issuesBySeverity.warning > 0 && /* @__PURE__ */ jsxs("span", { style: {
2589
+ (((_m = (_l = result.metrics) == null ? void 0 : _l.issuesBySeverity) == null ? void 0 : _m.warning) ?? 0) > 0 && /* @__PURE__ */ jsxs("span", { style: {
2449
2590
  padding: "2px 6px",
2450
2591
  borderRadius: 4,
2451
2592
  fontSize: 11,
2452
2593
  backgroundColor: getSeverityBg("warning"),
2453
2594
  color: getSeverityColor("warning")
2454
2595
  }, children: [
2455
- result.metrics.issuesBySeverity.warning,
2596
+ ((_o = (_n = result.metrics) == null ? void 0 : _n.issuesBySeverity) == null ? void 0 : _o.warning) ?? 0,
2456
2597
  " warnings"
2457
2598
  ] })
2458
2599
  ] }),
2459
2600
  /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: theme.colors.textMuted }, children: [
2460
- result.metrics.filesAnalyzed,
2601
+ ((_p = result.metrics) == null ? void 0 : _p.filesAnalyzed) ?? 0,
2461
2602
  " files"
2462
2603
  ] })
2463
2604
  ] })
@@ -2480,16 +2621,16 @@ function LensDataDebugPanel$1({
2480
2621
  }, children: [
2481
2622
  /* @__PURE__ */ jsxs("div", { children: [
2482
2623
  /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Files Analyzed" }),
2483
- /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: result.metrics.filesAnalyzed })
2624
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: ((_q = result.metrics) == null ? void 0 : _q.filesAnalyzed) ?? 0 })
2484
2625
  ] }),
2485
2626
  /* @__PURE__ */ jsxs("div", { children: [
2486
2627
  /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Total Issues" }),
2487
- /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: result.metrics.totalIssues })
2628
+ /* @__PURE__ */ jsx("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: ((_r = result.metrics) == null ? void 0 : _r.totalIssues) ?? 0 })
2488
2629
  ] }),
2489
2630
  /* @__PURE__ */ jsxs("div", { children: [
2490
2631
  /* @__PURE__ */ jsx("div", { style: { fontSize: 11, color: theme.colors.textMuted }, children: "Duration" }),
2491
2632
  /* @__PURE__ */ jsxs("div", { style: { fontSize: 16, fontWeight: 600, color: theme.colors.text }, children: [
2492
- result.execution.duration || 0,
2633
+ ((_s = result.execution) == null ? void 0 : _s.duration) ?? 0,
2493
2634
  "ms"
2494
2635
  ] })
2495
2636
  ] }),
@@ -2706,19 +2847,18 @@ const LensDataDebugPanelContent = ({
2706
2847
  context,
2707
2848
  actions
2708
2849
  }) => {
2709
- var _a, _b, _c;
2710
2850
  const { theme } = useTheme();
2711
2851
  const lensResultsSlice = context.getSlice("lensResults");
2712
2852
  const hasSlice = context.hasSlice("lensResults");
2713
2853
  const isLoading = (lensResultsSlice == null ? void 0 : lensResultsSlice.loading) ?? false;
2714
2854
  const handleFileClick = (file, line) => {
2715
- var _a2, _b2, _c2;
2716
- const repoPath = (_a2 = context.currentScope.repository) == null ? void 0 : _a2.path;
2855
+ var _a, _b, _c;
2856
+ const repoPath = (_a = context.currentScope.repository) == null ? void 0 : _a.path;
2717
2857
  const fullPath = repoPath ? `${repoPath}/${file}` : file;
2718
2858
  if (line) {
2719
- (_b2 = actions.openFile) == null ? void 0 : _b2.call(actions, `${fullPath}:${line}`);
2859
+ (_b = actions.openFile) == null ? void 0 : _b.call(actions, `${fullPath}:${line}`);
2720
2860
  } else {
2721
- (_c2 = actions.openFile) == null ? void 0 : _c2.call(actions, fullPath);
2861
+ (_c = actions.openFile) == null ? void 0 : _c.call(actions, fullPath);
2722
2862
  }
2723
2863
  };
2724
2864
  return /* @__PURE__ */ jsxs(
@@ -2759,19 +2899,14 @@ const LensDataDebugPanelContent = ({
2759
2899
  },
2760
2900
  children: "Lens Data Debug"
2761
2901
  }
2762
- ),
2763
- (lensResultsSlice == null ? void 0 : lensResultsSlice.data) && /* @__PURE__ */ jsxs(Fragment, { children: [
2764
- /* @__PURE__ */ jsx("span", { style: { color: theme.colors.textMuted }, children: "•" }),
2765
- /* @__PURE__ */ jsxs("span", { style: { fontSize: 12, color: theme.colors.textMuted }, children: [
2766
- ((_a = lensResultsSlice.data.metadata.git) == null ? void 0 : _a.repository) || "Unknown",
2767
- " @ ",
2768
- ((_c = (_b = lensResultsSlice.data.metadata.git) == null ? void 0 : _b.commit) == null ? void 0 : _c.slice(0, 7)) || "?"
2769
- ] })
2770
- ] })
2902
+ )
2771
2903
  ] }),
2772
2904
  (lensResultsSlice == null ? void 0 : lensResultsSlice.data) && /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, fontSize: 11, color: theme.colors.textMuted }, children: [
2773
2905
  /* @__PURE__ */ jsxs("span", { children: [
2774
- new Set(lensResultsSlice.data.results.map((r2) => r2.package.name)).size,
2906
+ new Set(lensResultsSlice.data.results.map((r2) => {
2907
+ var _a;
2908
+ return ((_a = r2.package) == null ? void 0 : _a.name) ?? "unknown";
2909
+ })).size,
2775
2910
  " packages"
2776
2911
  ] }),
2777
2912
  /* @__PURE__ */ jsxs("span", { children: [