kubeagent 0.1.26 → 0.1.27

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.
@@ -97,15 +97,20 @@ export async function handleIssues(issues, config, clusterContext, noInteractive
97
97
  const kbDir = join(configDir(), "clusters", clusterContext ?? "default");
98
98
  const dateStr = new Date().toISOString().slice(0, 10);
99
99
  // ── Issues detected ──────────────────────────────────────
100
- const critCount = issues.filter((i) => i.severity === "critical").length;
101
- const warnCount = issues.filter((i) => i.severity === "warning").length;
100
+ const SEVERITY_RANK = { critical: 0, warning: 1, info: 2 };
101
+ const sortBySeverity = (a, b) => (SEVERITY_RANK[a.severity] ?? 3) - (SEVERITY_RANK[b.severity] ?? 3);
102
+ const sortedIssues = [...issues].sort(sortBySeverity);
103
+ const critCount = sortedIssues.filter((i) => i.severity === "critical").length;
104
+ const warnCount = sortedIssues.filter((i) => i.severity === "warning").length;
105
+ const infoCount = sortedIssues.filter((i) => i.severity === "info").length;
102
106
  const parts = [
103
- critCount ? chalk.red(`${critCount} critical`) : "",
104
- warnCount ? chalk.yellow(`${warnCount} warning`) : "",
107
+ critCount ? chalk.red(`${critCount} CRITICAL`) : "",
108
+ warnCount ? chalk.yellow(`${warnCount} WARNING`) : "",
109
+ infoCount ? chalk.cyan(`${infoCount} INFO`) : "",
105
110
  ].filter(Boolean).join(chalk.dim(", "));
106
- sectionHeader(`${issues.length} issue${issues.length !== 1 ? "s" : ""} detected ${parts}`, chalk.red.bold);
107
- const gaveUpIssues = issues.filter((i) => getOrCreate(issueKey(i)).gaveUp);
108
- const actionableIssues = issues.filter((i) => !getOrCreate(issueKey(i)).gaveUp);
111
+ sectionHeader(`${sortedIssues.length} issue${sortedIssues.length !== 1 ? "s" : ""} detected ${parts}`, chalk.red.bold);
112
+ const gaveUpIssues = sortedIssues.filter((i) => getOrCreate(issueKey(i)).gaveUp);
113
+ const actionableIssues = sortedIssues.filter((i) => !getOrCreate(issueKey(i)).gaveUp);
109
114
  for (const issue of actionableIssues) {
110
115
  printIssue(issue);
111
116
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kubeagent",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "AI-powered Kubernetes management CLI",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",