@rainy-updates/cli 0.5.6 → 0.5.7

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.
@@ -0,0 +1,14 @@
1
+ export function deriveReviewVerdict(items, errors) {
2
+ if (items.some((item) => item.update.peerConflictSeverity === "error" ||
3
+ item.update.licenseStatus === "denied")) {
4
+ return "blocked";
5
+ }
6
+ if (items.some((item) => item.advisories.length > 0 || item.update.riskLevel === "critical")) {
7
+ return "actionable";
8
+ }
9
+ if (errors.length > 0 ||
10
+ items.some((item) => item.update.riskLevel === "high" || item.update.diffType === "major")) {
11
+ return "review";
12
+ }
13
+ return "safe";
14
+ }
@@ -63,6 +63,12 @@ export function createSummary(input) {
63
63
  cacheBackend: undefined,
64
64
  binaryRecommended: false,
65
65
  gaReady: undefined,
66
+ dependencyHealthScore: undefined,
67
+ findingCountsByCategory: undefined,
68
+ findingCountsBySeverity: undefined,
69
+ primaryFindingCode: undefined,
70
+ primaryFindingCategory: undefined,
71
+ nextActionReason: undefined,
66
72
  };
67
73
  }
68
74
  export function finalizeSummary(summary) {
@@ -70,6 +70,10 @@ export function renderResult(result, format, display = {}) {
70
70
  `cache_backend=${result.summary.cacheBackend ?? ""}`,
71
71
  `degraded_sources=${(result.summary.degradedSources ?? []).join(",")}`,
72
72
  `ga_ready=${result.summary.gaReady === true ? "1" : "0"}`,
73
+ `dependency_health_score=${result.summary.dependencyHealthScore ?? ""}`,
74
+ `primary_finding_code=${result.summary.primaryFindingCode ?? ""}`,
75
+ `primary_finding_category=${result.summary.primaryFindingCategory ?? ""}`,
76
+ `next_action_reason=${result.summary.nextActionReason ?? ""}`,
73
77
  ].join("\n");
74
78
  }
75
79
  const lines = [];
@@ -130,6 +134,9 @@ export function renderResult(result, format, display = {}) {
130
134
  if (result.summary.verdict) {
131
135
  lines.push(`Verdict=${result.summary.verdict}, riskPackages=${result.summary.riskPackages ?? 0}, securityPackages=${result.summary.securityPackages ?? 0}, peerConflictPackages=${result.summary.peerConflictPackages ?? 0}, licenseViolationPackages=${result.summary.licenseViolationPackages ?? 0}`);
132
136
  }
137
+ if (typeof result.summary.dependencyHealthScore === "number") {
138
+ lines.push(`DependencyHealthScore=${result.summary.dependencyHealthScore}, primaryFinding=${result.summary.primaryFindingCode ?? "none"}, category=${result.summary.primaryFindingCategory ?? "none"}`);
139
+ }
133
140
  if (result.summary.runId) {
134
141
  lines.push(`RunId=${result.summary.runId}, artifactManifest=${result.summary.artifactManifest ?? "none"}, blockedPackages=${result.summary.blockedPackages ?? 0}, reviewPackages=${result.summary.reviewPackages ?? 0}, monitorPackages=${result.summary.monitorPackages ?? 0}`);
135
142
  }
@@ -34,6 +34,10 @@ export async function writeGitHubOutput(filePath, result) {
34
34
  `cache_backend=${result.summary.cacheBackend ?? ""}`,
35
35
  `degraded_sources=${(result.summary.degradedSources ?? []).join(",")}`,
36
36
  `ga_ready=${result.summary.gaReady === true ? "1" : "0"}`,
37
+ `dependency_health_score=${result.summary.dependencyHealthScore ?? ""}`,
38
+ `primary_finding_code=${result.summary.primaryFindingCode ?? ""}`,
39
+ `primary_finding_category=${result.summary.primaryFindingCategory ?? ""}`,
40
+ `next_action_reason=${result.summary.nextActionReason ?? ""}`,
37
41
  `fix_pr_applied=${result.summary.fixPrApplied === true ? "1" : "0"}`,
38
42
  `fix_pr_branches_created=${result.summary.fixPrBranchesCreated}`,
39
43
  `fix_pr_branch=${result.summary.fixBranchName ?? ""}`,
@@ -101,6 +101,10 @@ export function createSarifReport(result) {
101
101
  monitorPackages: result.summary.monitorPackages ?? 0,
102
102
  degradedSources: result.summary.degradedSources ?? [],
103
103
  cacheBackend: result.summary.cacheBackend,
104
+ dependencyHealthScore: result.summary.dependencyHealthScore,
105
+ primaryFindingCode: result.summary.primaryFindingCode,
106
+ primaryFindingCategory: result.summary.primaryFindingCategory,
107
+ nextActionReason: result.summary.nextActionReason,
104
108
  },
105
109
  },
106
110
  ],
@@ -5,6 +5,9 @@ export type CiProfile = "minimal" | "strict" | "enterprise";
5
5
  export type LockfileMode = "preserve" | "update" | "error";
6
6
  export type Verdict = "safe" | "review" | "blocked" | "actionable";
7
7
  export type RiskLevel = "critical" | "high" | "medium" | "low";
8
+ export type DoctorFindingSeverity = "error" | "warning";
9
+ export type DoctorScoreLabel = "Strong" | "Needs Review" | "Action Needed" | "Blocked / Critical";
10
+ export type DoctorFindingCategory = "Security" | "Compatibility" | "Policy" | "Operational Health" | "Licensing" | "Unused / Cleanup" | "Release Risk" | "Registry / Execution" | "Workspace Integrity";
8
11
  export type RiskCategory = "known-vulnerability" | "behavioral-risk" | "operational-health";
9
12
  export type MaintainerChurnStatus = "unknown" | "stable" | "elevated-change";
10
13
  export type PolicyAction = "allow" | "review" | "block" | "monitor";
@@ -204,6 +207,12 @@ export interface Summary {
204
207
  cacheBackend?: "sqlite" | "file";
205
208
  binaryRecommended?: boolean;
206
209
  gaReady?: boolean;
210
+ dependencyHealthScore?: number;
211
+ findingCountsByCategory?: Partial<Record<DoctorFindingCategory, number>>;
212
+ findingCountsBySeverity?: Partial<Record<DoctorFindingSeverity, number>>;
213
+ primaryFindingCode?: string;
214
+ primaryFindingCategory?: DoctorFindingCategory;
215
+ nextActionReason?: string;
207
216
  }
208
217
  export interface CheckResult {
209
218
  projectPath: string;
@@ -434,13 +443,32 @@ export interface ReviewOptions extends CheckOptions {
434
443
  export interface DoctorOptions extends CheckOptions {
435
444
  verdictOnly: boolean;
436
445
  includeChangelog?: boolean;
446
+ agentReport?: boolean;
447
+ }
448
+ export interface DoctorFinding {
449
+ id: string;
450
+ code: string;
451
+ category: DoctorFindingCategory;
452
+ severity: DoctorFindingSeverity;
453
+ scope: "project" | "package";
454
+ packageName?: string;
455
+ workspace?: string;
456
+ summary: string;
457
+ details?: string;
458
+ help?: string;
459
+ recommendedAction?: string;
460
+ evidence?: string[];
437
461
  }
438
462
  export interface DoctorResult {
439
463
  verdict: Verdict;
464
+ score: number;
465
+ scoreLabel: DoctorScoreLabel;
440
466
  summary: Summary;
441
467
  review: ReviewResult;
468
+ findings: DoctorFinding[];
442
469
  primaryFindings: string[];
443
470
  recommendedCommand: string;
471
+ nextActionReason: string;
444
472
  }
445
473
  export interface AnalysisBundle {
446
474
  check: CheckResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rainy-updates/cli",
3
- "version": "0.5.6",
3
+ "version": "0.5.7",
4
4
  "description": "The fastest DevOps-first dependency CLI. Checks, audits, upgrades, bisects, and automates npm/pnpm dependencies in CI.",
5
5
  "type": "module",
6
6
  "private": false,