@ganakailabs/cloudeval-cli 0.26.3 → 0.26.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.
@@ -38,10 +38,10 @@ import {
38
38
  } from "./chunk-3MIP274G.js";
39
39
  import {
40
40
  Banner
41
- } from "./chunk-DALUYBCW.js";
41
+ } from "./chunk-HEJJ6LSM.js";
42
42
  import {
43
43
  CLI_VERSION
44
- } from "./chunk-5NOPTAZO.js";
44
+ } from "./chunk-AJJXSTOE.js";
45
45
  import {
46
46
  raisedButtonStyle,
47
47
  terminalTheme
@@ -3,8 +3,8 @@ import {
3
3
  bannerMetaColor,
4
4
  bannerSegmentColor,
5
5
  splitBannerLineSegments
6
- } from "./chunk-DALUYBCW.js";
7
- import "./chunk-5NOPTAZO.js";
6
+ } from "./chunk-HEJJ6LSM.js";
7
+ import "./chunk-AJJXSTOE.js";
8
8
  import "./chunk-ZDKRIOMB.js";
9
9
  export {
10
10
  Banner,
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var CLI_VERSION = "0.26.3";
2
+ var CLI_VERSION = "0.26.4";
3
3
 
4
4
  export {
5
5
  CLI_VERSION
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CLI_VERSION
3
- } from "./chunk-5NOPTAZO.js";
3
+ } from "./chunk-AJJXSTOE.js";
4
4
  import {
5
5
  shouldUseColor,
6
6
  terminalTheme
package/dist/cli.js CHANGED
@@ -36,7 +36,7 @@ import {
36
36
  } from "./chunk-3MIP274G.js";
37
37
  import {
38
38
  CLI_VERSION
39
- } from "./chunk-5NOPTAZO.js";
39
+ } from "./chunk-AJJXSTOE.js";
40
40
 
41
41
  // src/runtime/prepareInk.ts
42
42
  import fs from "fs";
@@ -2480,6 +2480,23 @@ var entriesAsNamedRecords = (value, amountKey = "amount") => {
2480
2480
  [amountKey]: amount
2481
2481
  }));
2482
2482
  };
2483
+ var displayNumber = (value, fallback = "not available") => {
2484
+ const number = numberFrom(value);
2485
+ return number === void 0 ? fallback : String(number);
2486
+ };
2487
+ var formatMoney = (amount, currency, fallback = "not available") => {
2488
+ if (amount === void 0) {
2489
+ return fallback;
2490
+ }
2491
+ return [amount, currency].filter(Boolean).join(" ");
2492
+ };
2493
+ var formatValidation = (validation) => {
2494
+ const policyFailed = displayNumber(
2495
+ validation?.policyChecks?.failed ?? validation?.psRule?.failed
2496
+ );
2497
+ const unitFailed = displayNumber(validation?.unitTests?.failed);
2498
+ return `Policy checks ${policyFailed} failed, unit tests ${unitFailed} failed`;
2499
+ };
2483
2500
  var extractPillars = (waf) => {
2484
2501
  const fromArray = waf?.parsed?.score?.pillars;
2485
2502
  if (Array.isArray(fromArray)) {
@@ -2538,6 +2555,12 @@ var extractValidation = ({
2538
2555
  failed: numberFrom(psRuleSummary?.failed_rules, psRuleSummary?.failedRules, failedRules.length),
2539
2556
  errors: numberFrom(psRuleSummary?.error_rules, psRuleSummary?.errorRules)
2540
2557
  },
2558
+ policyChecks: {
2559
+ total: numberFrom(psRuleSummary?.total_rules, psRuleSummary?.totalRules, rules.length),
2560
+ passed: numberFrom(psRuleSummary?.passed_rules, psRuleSummary?.passedRules),
2561
+ failed: numberFrom(psRuleSummary?.failed_rules, psRuleSummary?.failedRules, failedRules.length),
2562
+ errors: numberFrom(psRuleSummary?.error_rules, psRuleSummary?.errorRules)
2563
+ },
2541
2564
  unitTests: {
2542
2565
  status: unitSummary?.status,
2543
2566
  total: numberFrom(unitSummary?.total_tests, unitSummary?.totalTests),
@@ -2574,16 +2597,26 @@ var evaluateGate = ({
2574
2597
  cost?.report?.processed?.totalMonthlyCost,
2575
2598
  cost?.parsed?.totalSpend?.amount,
2576
2599
  cost?.parsed?.total_spend?.amount,
2577
- cost?.raw?.total
2600
+ cost?.raw?.total,
2601
+ preload?.reports?.cost?.metrics?.monthly_cost,
2602
+ preload?.reports?.cost?.metrics?.monthlyCost,
2603
+ preload?.latest_payloads?.cost?.summary?.monthly_cost,
2604
+ preload?.latest_payloads?.cost?.summary?.monthlyCost,
2605
+ preload?.latest_payloads?.cost?.summary?.total_monthly_cost,
2606
+ preload?.latest_payloads?.cost?.summary?.totalMonthlyCost
2578
2607
  );
2579
2608
  const currency = String(
2580
- cost?.report?.metadata?.currency ?? cost?.parsed?.totalSpend?.currency ?? cost?.parsed?.total_spend?.currency ?? cost?.raw?.currency ?? ""
2609
+ cost?.report?.metadata?.currency ?? cost?.parsed?.totalSpend?.currency ?? cost?.parsed?.total_spend?.currency ?? cost?.raw?.currency ?? preload?.reports?.cost?.metrics?.currency ?? preload?.latest_payloads?.cost?.summary?.currency ?? ""
2581
2610
  ) || void 0;
2582
2611
  const savings = numberFrom(
2583
2612
  cost?.report?.processed?.opportunity_summary?.total_monthly_savings,
2584
2613
  cost?.report?.processed?.opportunitySummary?.totalMonthlySavings,
2585
2614
  cost?.parsed?.estimatedSavings?.amount,
2586
- cost?.parsed?.estimated_savings?.amount
2615
+ cost?.parsed?.estimated_savings?.amount,
2616
+ preload?.reports?.cost?.metrics?.estimated_savings,
2617
+ preload?.reports?.cost?.metrics?.estimatedSavings,
2618
+ preload?.latest_payloads?.cost?.summary?.estimated_savings,
2619
+ preload?.latest_payloads?.cost?.summary?.estimatedSavings
2587
2620
  );
2588
2621
  const pillars = extractPillars(waf).map((pillar) => {
2589
2622
  const threshold = gateConfig?.pillarScoreMins[pillar.id] ?? gateConfig?.pillarScoreMin;
@@ -2653,7 +2686,7 @@ var evaluateGate = ({
2653
2686
  const failedUnitTests = validation.unitTests.failed ?? 0;
2654
2687
  if (gateConfig.failOnValidationErrors && (failedPsRules > 0 || failedUnitTests > 0)) {
2655
2688
  failures.push(
2656
- `validation has ${failedPsRules} failed PSRule checks and ${failedUnitTests} failed unit tests`
2689
+ `validation has ${failedPsRules} failed policy checks and ${failedUnitTests} failed unit tests`
2657
2690
  );
2658
2691
  }
2659
2692
  if (gateConfig.maxMonthlyCost !== void 0 && monthlyCost !== void 0 && monthlyCost > gateConfig.maxMonthlyCost) {
@@ -2838,8 +2871,8 @@ var buildAiSummaryPrompt = (data) => [
2838
2871
  `Gate: ${String(data.gate?.status ?? "unknown").toUpperCase()}`,
2839
2872
  `Well-Architected score: ${data.gate?.wellArchitected?.overall?.score ?? data.gate?.overallScore ?? "unknown"}`,
2840
2873
  `High-risk findings: ${data.gate?.wellArchitected?.risks?.high ?? data.gate?.highRisk ?? "unknown"}`,
2841
- `Monthly cost: ${data.gate?.cost?.monthly?.amount ?? data.gate?.monthlyCost ?? "unknown"}`,
2842
- `Validation: PSRule failed ${data.gate?.validation?.psRule?.failed ?? "unknown"}, unit tests failed ${data.gate?.validation?.unitTests?.failed ?? "unknown"}`,
2874
+ `Monthly cost: ${formatMoney(data.gate?.cost?.monthly?.amount ?? data.gate?.monthlyCost, data.gate?.cost?.monthly?.currency)}`,
2875
+ `Validation: ${formatValidation(data.gate?.validation)}`,
2843
2876
  Array.isArray(data.gate?.failures) && data.gate.failures.length ? `Gate failures: ${data.gate.failures.join("; ")}` : "Gate failures: none reported"
2844
2877
  ].join("\n");
2845
2878
  var generateAiSummary = async ({
@@ -2915,8 +2948,8 @@ var buildMarkdownSummary = (data) => {
2915
2948
  `- **Commit:** \`${String(data.commitSha ?? "unknown").slice(0, 12)}\``,
2916
2949
  `- **Gate:** ${gateStatus}`,
2917
2950
  `- **Well-Architected score:** ${score}`,
2918
- `- **Cost:** ${cost?.amount ?? "unknown"} ${cost?.currency ?? ""}`.trim(),
2919
- `- **Validation:** PSRule ${validation?.psRule?.failed ?? "unknown"} failed, unit tests ${validation?.unitTests?.failed ?? "unknown"} failed`
2951
+ `- **Cost:** ${formatMoney(cost?.amount, cost?.currency)}`,
2952
+ `- **Validation:** ${formatValidation(validation)}`
2920
2953
  ];
2921
2954
  if (Array.isArray(data.gate?.failures) && data.gate.failures.length) {
2922
2955
  lines.push("", "#### Gate failures", "", ...data.gate.failures.map((failure) => `- ${failure}`));
@@ -2929,7 +2962,7 @@ var buildMarkdownSummary = (data) => {
2929
2962
  "",
2930
2963
  "#### Cost drilldown",
2931
2964
  "",
2932
- `- Cost: ${cost?.amount ?? "unknown"} ${cost?.currency ?? ""}${cost?.threshold !== void 0 ? ` (max ${cost.threshold})` : ""}`.trim()
2965
+ `- Cost: ${formatMoney(cost?.amount, cost?.currency)}${cost?.threshold !== void 0 ? ` (max ${cost.threshold})` : ""}`
2933
2966
  );
2934
2967
  }
2935
2968
  if (validation) {
@@ -2937,7 +2970,7 @@ var buildMarkdownSummary = (data) => {
2937
2970
  "",
2938
2971
  "#### Validation drilldown",
2939
2972
  "",
2940
- `- Validation: PSRule ${validation.psRule?.failed ?? "unknown"} failed, unit tests ${validation.unitTests?.failed ?? "unknown"} failed`
2973
+ `- Validation: ${formatValidation(validation)}`
2941
2974
  );
2942
2975
  }
2943
2976
  if (data.aiSummary?.markdown) {
@@ -14934,7 +14967,7 @@ program.command("tui").description("Open the CloudEval Terminal UI").option(
14934
14967
  const { assertSecureBaseUrl } = await import("./dist-QLN52XKY.js");
14935
14968
  const [{ render }, { App }] = await Promise.all([
14936
14969
  import("ink"),
14937
- import("./App-74TOEWUN.js")
14970
+ import("./App-SM7XELZQ.js")
14938
14971
  ]);
14939
14972
  const baseUrl = await resolveBaseUrl(options, command);
14940
14973
  assertSecureBaseUrl(baseUrl);
@@ -14992,7 +15025,7 @@ program.command("chat").description("Start an interactive chat session").option(
14992
15025
  const { assertSecureBaseUrl } = await import("./dist-QLN52XKY.js");
14993
15026
  const [{ render }, { App }] = await Promise.all([
14994
15027
  import("ink"),
14995
- import("./App-74TOEWUN.js")
15028
+ import("./App-SM7XELZQ.js")
14996
15029
  ]);
14997
15030
  const baseUrl = await resolveBaseUrl(options, command);
14998
15031
  assertSecureBaseUrl(baseUrl);
@@ -15746,7 +15779,7 @@ Error: ${errorMsg}
15746
15779
  program.command("banner").description("Preview the startup banner and terminal capabilities").action(async () => {
15747
15780
  const { render } = await import("ink");
15748
15781
  const BannerPreview = React.lazy(async () => ({
15749
- default: (await import("./Banner-JWHQ4HG5.js")).Banner
15782
+ default: (await import("./Banner-T3BVRZV3.js")).Banner
15750
15783
  }));
15751
15784
  render(
15752
15785
  /* @__PURE__ */ jsx(React.Suspense, { fallback: null, children: /* @__PURE__ */ jsx(BannerPreview, { disable: false }) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ganakailabs/cloudeval-cli",
3
- "version": "0.26.3",
3
+ "version": "0.26.4",
4
4
  "license": "LicenseRef-CloudEval-CLI",
5
5
  "type": "module",
6
6
  "description": "CloudEval CLI for cloud architecture, cost, report, automation, and MCP workflows.",
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.26.3",
17
+ "versionInfo": "0.26.4",
18
18
  "downloadLocation": "https://github.com/ganakailabs/cloudeval-cli",
19
19
  "filesAnalyzed": false,
20
20
  "licenseConcluded": "LicenseRef-CloudEval-CLI",