@ganakailabs/cloudeval-cli 0.26.12 → 0.27.1

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-USSCB2ZU.js";
39
39
  import {
40
40
  Banner
41
- } from "./chunk-GR76HJZF.js";
41
+ } from "./chunk-LWHSK5SO.js";
42
42
  import {
43
43
  CLI_VERSION
44
- } from "./chunk-4AK6A5GF.js";
44
+ } from "./chunk-FJDUSS2S.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-GR76HJZF.js";
7
- import "./chunk-4AK6A5GF.js";
6
+ } from "./chunk-LWHSK5SO.js";
7
+ import "./chunk-FJDUSS2S.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.12";
2
+ var CLI_VERSION = "0.27.1";
3
3
 
4
4
  export {
5
5
  CLI_VERSION
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  CLI_VERSION
3
- } from "./chunk-4AK6A5GF.js";
3
+ } from "./chunk-FJDUSS2S.js";
4
4
  import {
5
5
  shouldUseColor,
6
6
  terminalTheme
package/dist/cli.js CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  } from "./chunk-USSCB2ZU.js";
40
40
  import {
41
41
  CLI_VERSION
42
- } from "./chunk-4AK6A5GF.js";
42
+ } from "./chunk-FJDUSS2S.js";
43
43
 
44
44
  // src/runtime/prepareInk.ts
45
45
  import fs from "fs";
@@ -2413,14 +2413,41 @@ var parseGateConfig = (configText) => {
2413
2413
  const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*([^\\s#]+)`, "m"));
2414
2414
  return match ? match[1].trim() : void 0;
2415
2415
  };
2416
+ const firstStringValue = (...keys) => {
2417
+ for (const key of keys) {
2418
+ const value = stringValue2(key);
2419
+ if (value !== void 0) {
2420
+ return value;
2421
+ }
2422
+ }
2423
+ return void 0;
2424
+ };
2416
2425
  const numberValue2 = (key) => {
2417
2426
  const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*([0-9]+(?:\\.[0-9]+)?)`, "m"));
2418
2427
  return match ? Number(match[1]) : void 0;
2419
2428
  };
2429
+ const firstNumberValue = (...keys) => {
2430
+ for (const key of keys) {
2431
+ const value = numberValue2(key);
2432
+ if (value !== void 0) {
2433
+ return value;
2434
+ }
2435
+ }
2436
+ return void 0;
2437
+ };
2420
2438
  const booleanValue2 = (key) => {
2421
2439
  const match = configText.match(new RegExp(`^\\s*${key}\\s*:\\s*(true|false)`, "im"));
2422
2440
  return match ? match[1].toLowerCase() === "true" : void 0;
2423
2441
  };
2442
+ const firstBooleanValue = (...keys) => {
2443
+ for (const key of keys) {
2444
+ const value = booleanValue2(key);
2445
+ if (value !== void 0) {
2446
+ return value;
2447
+ }
2448
+ }
2449
+ return void 0;
2450
+ };
2424
2451
  const pillarScoreMins = {};
2425
2452
  const pillarBlock = configText.match(/^(\s*)pillars\s*:\s*$(?<body>(?:\n\s+[-\w]+\s*:\s*[0-9]+(?:\.[0-9]+)?\s*)+)/m);
2426
2453
  const pillarBody = pillarBlock?.groups?.body ?? "";
@@ -2442,15 +2469,21 @@ var parseGateConfig = (configText) => {
2442
2469
  pillarScoreMins[key] = value;
2443
2470
  }
2444
2471
  }
2445
- const enforcement = stringValue2("enforcement")?.toLowerCase();
2472
+ const enforcement = firstStringValue("enforcement", "mode")?.toLowerCase();
2446
2473
  return {
2447
- enforcement: enforcement === "warn" ? "warn" : "required",
2448
- overallScoreMin: numberValue2("overall_score_min") ?? 80,
2449
- pillarScoreMin: numberValue2("pillar_score_min"),
2474
+ enforcement: enforcement === "warn" || enforcement === "comment_only" ? "warn" : "required",
2475
+ overallScoreMin: firstNumberValue("overall_score_min", "minimum_well_architected_score") ?? 80,
2476
+ pillarScoreMin: firstNumberValue("pillar_score_min", "minimum_pillar_score"),
2450
2477
  pillarScoreMins,
2451
- failOnHighRisk: booleanValue2("fail_on_high_risk") ?? true,
2452
- failOnValidationErrors: booleanValue2("fail_on_validation_errors") ?? true,
2453
- maxMonthlyCost: numberValue2("max_monthly_cost")
2478
+ failOnHighRisk: firstBooleanValue(
2479
+ "fail_on_high_risk",
2480
+ "fail_when_high_risk_findings_exist"
2481
+ ) ?? true,
2482
+ failOnValidationErrors: firstBooleanValue(
2483
+ "fail_on_validation_errors",
2484
+ "fail_when_validation_fails"
2485
+ ) ?? true,
2486
+ maxMonthlyCost: firstNumberValue("max_monthly_cost", "max_monthly_cost_usd")
2454
2487
  };
2455
2488
  };
2456
2489
  var numberFrom = (...values) => {
@@ -2537,7 +2570,8 @@ var formatMoney = (amount, currency, fallback = "not available") => {
2537
2570
  if (numericAmount === void 0) {
2538
2571
  return fallback;
2539
2572
  }
2540
- return currency ? `${numericAmount} ${currency}` : String(numericAmount);
2573
+ const formattedAmount = trimNumber(numericAmount);
2574
+ return currency ? `${formattedAmount} ${currency}` : formattedAmount;
2541
2575
  };
2542
2576
  var trimNumber = (value, fractionDigits = 2) => Number.isInteger(value) ? String(value) : String(Number(value.toFixed(fractionDigits)));
2543
2577
  var formatScore = (value, fallback = "unknown") => {
@@ -6127,18 +6161,18 @@ var readWorkspaceConfig = (content) => {
6127
6161
  };
6128
6162
  };
6129
6163
  var generateWorkspaceConfig = (entry, parameters, sourceEntry) => {
6130
- const parameterLine = parameters ? ` parameters: ${parameters}
6131
- ` : "";
6164
+ const parameterLine = parameters ? ` parameters: ${parameters}` : "";
6132
6165
  const sourceEntryLine = sourceEntry ? ` source_entry: ${sourceEntry}` : "";
6133
6166
  return [
6134
6167
  "# CloudEval config v1. Paths are relative to this workspace root.",
6135
6168
  "# Visualization source for diagrams and reports.",
6136
6169
  "version: 1",
6137
6170
  "stacks:",
6138
- " - id: main",
6171
+ " - id: primary-architecture",
6172
+ " name: Primary architecture",
6139
6173
  ` entry: ${entry}`,
6140
6174
  sourceEntryLine,
6141
- parameterLine.trimEnd(),
6175
+ parameterLine,
6142
6176
  "resolve:",
6143
6177
  " # Follow relative ARM templateLink files when building the analysis bundle.",
6144
6178
  " linked_templates: true",
@@ -6151,12 +6185,12 @@ var generateWorkspaceConfig = (entry, parameters, sourceEntry) => {
6151
6185
  "# Uncomment and tune these when pull requests should be blocked by CloudEval.",
6152
6186
  "# ci:",
6153
6187
  "# gates:",
6154
- "# enforcement: required # required fails CI; warn only reports failures",
6155
- "# overall_score_min: 80 # minimum Well-Architected score out of 100",
6156
- "# pillar_score_min: 75 # optional default minimum for every pillar",
6157
- "# fail_on_high_risk: true # fail when high-risk architecture findings exist",
6158
- "# fail_on_validation_errors: true # fail when policy checks or unit tests fail",
6159
- "# max_monthly_cost: 500 # optional monthly budget gate",
6188
+ "# enforcement: block_pull_request",
6189
+ "# minimum_well_architected_score: 80",
6190
+ "# minimum_pillar_score: 75",
6191
+ "# fail_when_high_risk_findings_exist: true",
6192
+ "# fail_when_validation_fails: true",
6193
+ "# max_monthly_cost_usd: 500",
6160
6194
  ""
6161
6195
  ].filter((line) => line.length > 0).join("\n");
6162
6196
  };
@@ -15598,7 +15632,7 @@ program.command("tui").description("Open the CloudEval Terminal UI").option(
15598
15632
  const { assertSecureBaseUrl } = await import("./dist-PEYJDO7A.js");
15599
15633
  const [{ render }, { App }] = await Promise.all([
15600
15634
  import("ink"),
15601
- import("./App-H7B3T5QW.js")
15635
+ import("./App-XHSK5SJA.js")
15602
15636
  ]);
15603
15637
  const baseUrl = await resolveBaseUrl(options, command);
15604
15638
  assertSecureBaseUrl(baseUrl);
@@ -15656,7 +15690,7 @@ program.command("chat").description("Start an interactive chat session").option(
15656
15690
  const { assertSecureBaseUrl } = await import("./dist-PEYJDO7A.js");
15657
15691
  const [{ render }, { App }] = await Promise.all([
15658
15692
  import("ink"),
15659
- import("./App-H7B3T5QW.js")
15693
+ import("./App-XHSK5SJA.js")
15660
15694
  ]);
15661
15695
  const baseUrl = await resolveBaseUrl(options, command);
15662
15696
  assertSecureBaseUrl(baseUrl);
@@ -16410,7 +16444,7 @@ Error: ${errorMsg}
16410
16444
  program.command("banner").description("Preview the startup banner and terminal capabilities").action(async () => {
16411
16445
  const { render } = await import("ink");
16412
16446
  const BannerPreview = React.lazy(async () => ({
16413
- default: (await import("./Banner-MOLW4ADA.js")).Banner
16447
+ default: (await import("./Banner-GAOI3CZR.js")).Banner
16414
16448
  }));
16415
16449
  render(
16416
16450
  /* @__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.12",
3
+ "version": "0.27.1",
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.12",
17
+ "versionInfo": "0.27.1",
18
18
  "downloadLocation": "https://github.com/ganakailabs/cloudeval-cli",
19
19
  "filesAnalyzed": false,
20
20
  "licenseConcluded": "LicenseRef-CloudEval-CLI",