@jadenrazo/cloudcost-mcp 1.2.1 → 1.2.2

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.
@@ -4,6 +4,13 @@
4
4
  import { readFileSync } from "fs";
5
5
  import { join, dirname } from "path";
6
6
  import { fileURLToPath } from "url";
7
+
8
+ // src/data/freshness.ts
9
+ var FRESH_MAX_AGE_DAYS = 14;
10
+ var AGING_MAX_AGE_DAYS = 45;
11
+ var MS_PER_DAY = 864e5;
12
+
13
+ // src/data/loader.ts
7
14
  var __dirname = dirname(fileURLToPath(import.meta.url));
8
15
  function findProjectRoot(startDir) {
9
16
  let dir = startDir;
@@ -132,22 +139,21 @@ function getFallbackMetadata(provider) {
132
139
  }
133
140
  return _fallbackMeta[provider];
134
141
  }
135
- var FRESH_MAX_AGE_DAYS = 14;
136
- var AGING_MAX_AGE_DAYS = 45;
137
- var MS_PER_DAY = 864e5;
138
142
  function getPricingMetadata(provider, now = /* @__PURE__ */ new Date()) {
139
143
  const meta = getFallbackMetadata(provider);
140
144
  const source = meta?.source ?? "unknown";
141
145
  if (!meta?.last_updated) {
142
146
  return { source, as_of: null, age_days: null, staleness: "stale" };
143
147
  }
144
- const asOf = new Date(meta.last_updated);
145
- if (Number.isNaN(asOf.getTime())) {
148
+ const candidates = [meta.last_updated, meta.last_verified].filter((d) => typeof d === "string").map((d) => ({ raw: d, at: new Date(d) })).filter((d) => !Number.isNaN(d.at.getTime()));
149
+ if (candidates.length === 0) {
146
150
  return { source, as_of: meta.last_updated, age_days: null, staleness: "stale" };
147
151
  }
152
+ const oldest = candidates.reduce((a, b) => a.at.getTime() <= b.at.getTime() ? a : b);
153
+ const asOf = oldest.at;
148
154
  const ageDays = Math.max(0, Math.floor((now.getTime() - asOf.getTime()) / MS_PER_DAY));
149
155
  const staleness = ageDays < FRESH_MAX_AGE_DAYS ? "fresh" : ageDays < AGING_MAX_AGE_DAYS ? "aging" : "stale";
150
- return { source, as_of: meta.last_updated, age_days: ageDays, staleness };
156
+ return { source, as_of: oldest.raw, age_days: ageDays, staleness };
151
157
  }
152
158
  function _resetLoaderCache() {
153
159
  _resourceEquivalents = null;
@@ -181,4 +187,4 @@ export {
181
187
  getPricingMetadata,
182
188
  _resetLoaderCache
183
189
  };
184
- //# sourceMappingURL=chunk-LWTVE7UY.js.map
190
+ //# sourceMappingURL=chunk-R2BI5AVN.js.map
package/dist/cli.js CHANGED
@@ -9,8 +9,8 @@ import {
9
9
  loadConfig,
10
10
  optimizeCost,
11
11
  whatIf
12
- } from "./chunk-CGMU4ETN.js";
13
- import "./chunk-LWTVE7UY.js";
12
+ } from "./chunk-4P3I7BSL.js";
13
+ import "./chunk-R2BI5AVN.js";
14
14
 
15
15
  // src/cli.ts
16
16
  import { readFileSync, existsSync, statSync, realpathSync } from "fs";
package/dist/index.js CHANGED
@@ -36,12 +36,12 @@ import {
36
36
  tfvarsField,
37
37
  whatIf,
38
38
  whatIfSchema
39
- } from "./chunk-CGMU4ETN.js";
39
+ } from "./chunk-4P3I7BSL.js";
40
40
  import {
41
41
  getFallbackMetadata,
42
42
  getPricingMetadata,
43
43
  getResourceEquivalents
44
- } from "./chunk-LWTVE7UY.js";
44
+ } from "./chunk-R2BI5AVN.js";
45
45
 
46
46
  // src/server.ts
47
47
  import { createRequire } from "module";
@@ -15,7 +15,7 @@ import {
15
15
  getRegionPriceMultipliers,
16
16
  getResourceEquivalents,
17
17
  getStorageMap
18
- } from "./chunk-LWTVE7UY.js";
18
+ } from "./chunk-R2BI5AVN.js";
19
19
  export {
20
20
  _resetLoaderCache,
21
21
  getAwsInstances,
@@ -33,4 +33,4 @@ export {
33
33
  getResourceEquivalents,
34
34
  getStorageMap
35
35
  };
36
- //# sourceMappingURL=loader-CMBV7346.js.map
36
+ //# sourceMappingURL=loader-G7WW74B6.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jadenrazo/cloudcost-mcp",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "MCP server for multi-cloud cost analysis of Terraform, CloudFormation, Pulumi, and Bicep/ARM codebases",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,7 +32,7 @@
32
32
  "what-if"
33
33
  ],
34
34
  "engines": {
35
- "node": ">=24.15.0"
35
+ "node": ">=20.20.2"
36
36
  },
37
37
  "files": [
38
38
  "dist",
@@ -70,21 +70,23 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@cdktf/hcl2json": "^0.21.0",
73
- "@modelcontextprotocol/sdk": "^1.30.0",
73
+ "@modelcontextprotocol/sdk": "^1.31.0",
74
74
  "better-sqlite3": "^12.10.0",
75
75
  "yaml": "^2.9.0",
76
76
  "zod": "^4.4.3"
77
77
  },
78
78
  "overrides": {
79
- "hono": "^4.13.0",
79
+ "hono": "^4.13.5",
80
80
  "@hono/node-server": "^2.0.0",
81
81
  "path-to-regexp": "^8.4.2",
82
82
  "vite": "^8.0.0",
83
- "fast-uri": "^3.1.5",
84
- "ip-address": "^10.4.0",
85
- "qs": "^6.15.3",
83
+ "fast-uri": "^3.1.8",
84
+ "ip-address": "^10.7.1",
85
+ "qs": "^6.16.0",
86
86
  "body-parser": "^2.3.0",
87
- "brace-expansion": "^5.0.9"
87
+ "brace-expansion": "^5.0.12",
88
+ "esbuild": "^0.28.1",
89
+ "nanoid": "^3.3.18"
88
90
  },
89
91
  "prettier": {
90
92
  "semi": true,
@@ -97,7 +99,7 @@
97
99
  "@eslint/js": "^10.0.1",
98
100
  "@types/better-sqlite3": "^7.6.13",
99
101
  "@types/node": "^24.12.4",
100
- "@vitest/coverage-v8": "^4.1.10",
102
+ "@vitest/coverage-v8": "^4.1.11",
101
103
  "eslint": "^10.4.0",
102
104
  "eslint-config-prettier": "^10.1.8",
103
105
  "prettier": "^3.8.3",
@@ -105,6 +107,6 @@
105
107
  "tsx": "^4.22.0",
106
108
  "typescript": "^6.0.3",
107
109
  "typescript-eslint": "^8.59.3",
108
- "vitest": "^4.1.10"
110
+ "vitest": "^4.1.11"
109
111
  }
110
112
  }