@ganakailabs/cloudeval-cli 0.29.2 → 0.29.4
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/{App-ISTB45LE.js → App-33TDHYUP.js} +2 -2
- package/dist/{Banner-USFUJC3Y.js → Banner-QGOVG5CQ.js} +2 -2
- package/dist/{chunk-FWCQ4PWL.js → chunk-LEWFJSYP.js} +1 -1
- package/dist/{chunk-YAD6SGBL.js → chunk-XZIBSJA4.js} +1 -1
- package/dist/cli.js +44 -24
- package/package.json +1 -1
- package/sbom.spdx.json +1 -1
|
@@ -38,10 +38,10 @@ import {
|
|
|
38
38
|
} from "./chunk-ERGQHMNT.js";
|
|
39
39
|
import {
|
|
40
40
|
Banner
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-XZIBSJA4.js";
|
|
42
42
|
import {
|
|
43
43
|
CLI_VERSION
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-LEWFJSYP.js";
|
|
45
45
|
import {
|
|
46
46
|
raisedButtonStyle,
|
|
47
47
|
terminalTheme
|
package/dist/cli.js
CHANGED
|
@@ -39,7 +39,7 @@ import {
|
|
|
39
39
|
} from "./chunk-ERGQHMNT.js";
|
|
40
40
|
import {
|
|
41
41
|
CLI_VERSION
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-LEWFJSYP.js";
|
|
43
43
|
|
|
44
44
|
// src/runtime/prepareInk.ts
|
|
45
45
|
import fs from "fs";
|
|
@@ -3469,6 +3469,16 @@ var renderAiSummarySections = (shortSummary, detailsMarkdown) => {
|
|
|
3469
3469
|
}
|
|
3470
3470
|
return lines.join("\n");
|
|
3471
3471
|
};
|
|
3472
|
+
var isInstructionLikeAiDetails = (detailsMarkdown) => {
|
|
3473
|
+
const normalized = detailsMarkdown.toLowerCase();
|
|
3474
|
+
return [
|
|
3475
|
+
"markdown for a collapsible ai details section",
|
|
3476
|
+
"use short paragraphs or bullets",
|
|
3477
|
+
"bold important evidence keywords",
|
|
3478
|
+
"prefer concrete failed test names",
|
|
3479
|
+
"headings: **main risk**"
|
|
3480
|
+
].some((marker) => normalized.includes(marker));
|
|
3481
|
+
};
|
|
3472
3482
|
var githubWorkflowRunUrl = () => {
|
|
3473
3483
|
const server = process.env.GITHUB_SERVER_URL;
|
|
3474
3484
|
const repo = process.env.GITHUB_REPOSITORY;
|
|
@@ -3512,32 +3522,33 @@ var deterministicAiSummary = (data, error) => {
|
|
|
3512
3522
|
const failedTests = numberFrom(validation?.unitTests?.failed) ?? numberFrom(validation?.unit_tests?.failed) ?? numberFrom(validation?.failedUnitTests) ?? numberFrom(validation?.failed_tests) ?? 0;
|
|
3513
3523
|
const policyFailed = numberFrom(validation?.policyChecks?.failed) ?? numberFrom(validation?.policy_checks?.failed) ?? numberFrom(data.gate?.policy?.failed) ?? 0;
|
|
3514
3524
|
const policyStatus = policyFailed > 0 ? "has failed checks" : "GOOD";
|
|
3525
|
+
const weakestPillar = Array.isArray(data.gate?.wellArchitected?.pillars) ? data.gate.wellArchitected.pillars.filter((pillar) => numberFrom(pillar.score) !== void 0).sort(
|
|
3526
|
+
(left, right) => (numberFrom(left.score) ?? 0) - (numberFrom(right.score) ?? 0)
|
|
3527
|
+
)[0] : void 0;
|
|
3528
|
+
const weakestPillarLabel = weakestPillar?.label ?? weakestPillar?.id ?? "the weakest Well-Architected pillar";
|
|
3529
|
+
const highRisk = numberFrom(data.gate?.wellArchitected?.risks?.high) ?? 0;
|
|
3515
3530
|
const summary = [
|
|
3516
3531
|
`CloudEval review completed with **${String(data.gate?.status ?? "UNKNOWN").toUpperCase()}**.`,
|
|
3517
3532
|
`Well-Architected posture is **${formatScore(score)} (${rating})**, validation has **${displayNumber(failedTests)} failed unit tests**, policy checks are **${policyStatus}**, and monthly cost is **${formatMonthlyMoney(cost?.amount, cost?.currency)}**.`,
|
|
3518
|
-
|
|
3533
|
+
`Prioritize **failed validation checks** and **${weakestPillarLabel}** first.`
|
|
3519
3534
|
].join(" ");
|
|
3535
|
+
const detailsMarkdown = [
|
|
3536
|
+
`**Main risk**
|
|
3537
|
+
The gate is **${String(data.gate?.status ?? "UNKNOWN").toUpperCase()}** with Well-Architected posture **${formatScore(score)} (${rating})**, **${displayNumber(failedTests)} failed unit tests**, and monthly cost **${formatMonthlyMoney(cost?.amount, cost?.currency)}**.`,
|
|
3538
|
+
`**Why it matters**
|
|
3539
|
+
${highRisk > 0 ? `There are **${displayNumber(highRisk)} high-risk findings**. ` : ""}Validation failures, weak architecture pillars, and cost over budget are the highest-signal remediation inputs before merge.`,
|
|
3540
|
+
`**Recommended actions**
|
|
3541
|
+
Fix **${displayNumber(failedTests)} failed unit tests**, address **${weakestPillarLabel}**, review cost drivers against the budget, rerun CloudEval review, and compare the updated gate.`,
|
|
3542
|
+
"**Evidence used**\n**Gate status**, **Well-Architected score**, **validation totals**, **policy totals**, **monthly cost**, and **architecture signals**."
|
|
3543
|
+
].join("\n\n");
|
|
3520
3544
|
return {
|
|
3521
3545
|
enabled: true,
|
|
3522
3546
|
status: "fallback",
|
|
3523
3547
|
fallbackUsed: true,
|
|
3524
3548
|
warnings: error ? [`Review summary endpoint failed: ${error}`] : [],
|
|
3525
3549
|
shortSummary: summary,
|
|
3526
|
-
detailsMarkdown
|
|
3527
|
-
|
|
3528
|
-
"**Why it matters**\n**Failed validation** and **weak architecture pillars** are the highest-signal remediation inputs.",
|
|
3529
|
-
"**Recommended actions**\nFix **failed validation checks**, address the **weakest pillar**, rerun CloudEval review, and compare the updated gate.",
|
|
3530
|
-
"**Evidence used**\n**Gate status**, **Well-Architected score**, **validation totals**, **policy totals**, and **monthly cost**."
|
|
3531
|
-
].join("\n\n"),
|
|
3532
|
-
markdown: renderAiSummarySections(
|
|
3533
|
-
summary,
|
|
3534
|
-
[
|
|
3535
|
-
"**Main risk**\nCloudEval could not produce an AI-written review summary, so use the deterministic gate evidence.",
|
|
3536
|
-
"**Why it matters**\n**Failed validation** and **weak architecture pillars** are the highest-signal remediation inputs.",
|
|
3537
|
-
"**Recommended actions**\nFix **failed validation checks**, address the **weakest pillar**, rerun CloudEval review, and compare the updated gate.",
|
|
3538
|
-
"**Evidence used**\n**Gate status**, **Well-Architected score**, **validation totals**, **policy totals**, and **monthly cost**."
|
|
3539
|
-
].join("\n\n")
|
|
3540
|
-
)
|
|
3550
|
+
detailsMarkdown,
|
|
3551
|
+
markdown: renderAiSummarySections(summary, detailsMarkdown)
|
|
3541
3552
|
};
|
|
3542
3553
|
};
|
|
3543
3554
|
var generateAiSummary = async (input) => {
|
|
@@ -3552,15 +3563,24 @@ var generateAiSummary = async (input) => {
|
|
|
3552
3563
|
idempotencyKey: `cloudeval-review-summary-${input.data.projectId}-${input.data.commitSha ?? "head"}`
|
|
3553
3564
|
});
|
|
3554
3565
|
const shortSummary = String(response.summary ?? "").trim();
|
|
3555
|
-
|
|
3566
|
+
let detailsMarkdown = String(response.details ?? "").trim();
|
|
3556
3567
|
if (!shortSummary) {
|
|
3557
3568
|
return deterministicAiSummary(input.data, "Review summary endpoint returned no summary.");
|
|
3558
3569
|
}
|
|
3570
|
+
const warnings = Array.isArray(response.warnings) ? response.warnings : [];
|
|
3571
|
+
if (isInstructionLikeAiDetails(detailsMarkdown)) {
|
|
3572
|
+
const fallback = deterministicAiSummary(
|
|
3573
|
+
input.data,
|
|
3574
|
+
"Review summary endpoint returned instruction-like details."
|
|
3575
|
+
);
|
|
3576
|
+
detailsMarkdown = String(fallback.detailsMarkdown ?? "").trim();
|
|
3577
|
+
warnings.push("Review summary endpoint returned instruction-like details; using deterministic details.");
|
|
3578
|
+
}
|
|
3559
3579
|
return {
|
|
3560
3580
|
enabled: true,
|
|
3561
|
-
status: response.fallback_used ? "fallback" : "ok",
|
|
3562
|
-
fallbackUsed: Boolean(response.fallback_used),
|
|
3563
|
-
warnings
|
|
3581
|
+
status: response.fallback_used || warnings.length > 0 ? "fallback" : "ok",
|
|
3582
|
+
fallbackUsed: Boolean(response.fallback_used) || warnings.length > 0,
|
|
3583
|
+
warnings,
|
|
3564
3584
|
riskHighlights: Array.isArray(response.risk_highlights) ? response.risk_highlights : [],
|
|
3565
3585
|
recommendedActions: Array.isArray(response.recommended_actions) ? response.recommended_actions : [],
|
|
3566
3586
|
evidenceUsed: Array.isArray(response.evidence_used) ? response.evidence_used : [],
|
|
@@ -16573,7 +16593,7 @@ program.command("tui").description("Open the CloudEval Terminal UI").option(
|
|
|
16573
16593
|
const { assertSecureBaseUrl } = await import("./dist-QYIPN7MD.js");
|
|
16574
16594
|
const [{ render }, { App }] = await Promise.all([
|
|
16575
16595
|
import("ink"),
|
|
16576
|
-
import("./App-
|
|
16596
|
+
import("./App-33TDHYUP.js")
|
|
16577
16597
|
]);
|
|
16578
16598
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
16579
16599
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -16631,7 +16651,7 @@ program.command("chat").description("Start an interactive chat session").option(
|
|
|
16631
16651
|
const { assertSecureBaseUrl } = await import("./dist-QYIPN7MD.js");
|
|
16632
16652
|
const [{ render }, { App }] = await Promise.all([
|
|
16633
16653
|
import("ink"),
|
|
16634
|
-
import("./App-
|
|
16654
|
+
import("./App-33TDHYUP.js")
|
|
16635
16655
|
]);
|
|
16636
16656
|
const baseUrl = await resolveBaseUrl(options, command);
|
|
16637
16657
|
assertSecureBaseUrl(baseUrl);
|
|
@@ -17385,7 +17405,7 @@ Error: ${errorMsg}
|
|
|
17385
17405
|
program.command("banner").description("Preview the startup banner and terminal capabilities").action(async () => {
|
|
17386
17406
|
const { render } = await import("ink");
|
|
17387
17407
|
const BannerPreview = React.lazy(async () => ({
|
|
17388
|
-
default: (await import("./Banner-
|
|
17408
|
+
default: (await import("./Banner-QGOVG5CQ.js")).Banner
|
|
17389
17409
|
}));
|
|
17390
17410
|
render(
|
|
17391
17411
|
/* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(BannerPreview, { disable: false }) })
|
package/package.json
CHANGED
package/sbom.spdx.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"SPDXID": "SPDXRef-Package-CloudEval-CLI",
|
|
16
16
|
"name": "CloudEval CLI",
|
|
17
|
-
"versionInfo": "0.29.
|
|
17
|
+
"versionInfo": "0.29.4",
|
|
18
18
|
"downloadLocation": "https://github.com/ganakailabs/cloudeval-cli",
|
|
19
19
|
"filesAnalyzed": false,
|
|
20
20
|
"licenseConcluded": "LicenseRef-CloudEval-CLI",
|