@ganakailabs/cloudeval-cli 0.26.3 → 0.26.5

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