infrawise 0.15.0 → 0.15.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.
@@ -131,12 +131,14 @@ function buildAnalyzers(config, iacDriftAnalyzer, iacLambdas) {
131
131
  ];
132
132
  }
133
133
  export async function runAnalyze(options = {}) {
134
- printHeader('Running Analysis');
134
+ if (!options.silent)
135
+ printHeader('Running Analysis');
135
136
  let config;
136
137
  try {
137
138
  config = loadConfig(options.config);
138
139
  setCacheDir(path.dirname(path.resolve(options.config ?? 'infrawise.yaml')));
139
- log.success('Config loaded', options.config ?? 'infrawise.yaml');
140
+ if (!options.silent)
141
+ log.success('Config loaded', options.config ?? 'infrawise.yaml');
140
142
  }
141
143
  catch (err) {
142
144
  console.error(formatError(err));
@@ -308,7 +310,9 @@ export async function runAnalyze(options = {}) {
308
310
  }
309
311
  }
310
312
  export async function runCodeRefresh(repoPath, config) {
311
- const cached = readCache('meta', 60 * 60 * 1000);
313
+ // Same 24h TTL as the graph cache — a shorter TTL here silently dropped all
314
+ // AWS/DB metadata from refreshed graphs once a serve/stdio session passed 1h.
315
+ const cached = readCache('meta', 24 * 60 * 60 * 1000);
312
316
  const dynamoMeta = cached?.dynamoMeta ?? [];
313
317
  const postgresMeta = cached?.postgresMeta ?? [];
314
318
  const mysqlMeta = cached?.mysqlMeta ?? [];
@@ -8,6 +8,7 @@ import { log, printHeader } from '../utils.js';
8
8
  import { runAnalyze, runCodeRefresh } from './analyze.js';
9
9
  import { runStdio } from './stdio.js';
10
10
  const BOX_W = 52;
11
+ const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
11
12
  const TOOL_MAP = [
12
13
  { name: 'get_infra_overview' },
13
14
  { name: 'get_graph_summary' },
@@ -84,8 +85,8 @@ export async function runServe(options = {}) {
84
85
  setConfigured(config !== undefined);
85
86
  const repoPath = process.cwd();
86
87
  // Auto-analyze if no cache
87
- const cachedGraph = readCache('graph');
88
- const cachedFindings = readCache('findings');
88
+ const cachedGraph = readCache('graph', CACHE_TTL_MS);
89
+ const cachedFindings = readCache('findings', CACHE_TTL_MS);
89
90
  if (cachedGraph && cachedFindings) {
90
91
  log.success('Cached analysis loaded', `${cachedGraph.nodes.length} nodes · ${cachedGraph.edges.length} edges · ${cachedFindings.length} finding(s)`);
91
92
  setGraphState(cachedGraph, cachedFindings, readCacheTimestamp('graph'));
@@ -25,7 +25,8 @@ export async function runStdio(configPath) {
25
25
  setGraphState(cachedGraph, cachedFindings, readCacheTimestamp('graph'));
26
26
  }
27
27
  else if (config) {
28
- await runAnalyze({ config: configPath });
28
+ // silent: stdout is reserved for MCP JSON-RPC — report text would corrupt the stream
29
+ await runAnalyze({ config: configPath, silent: true });
29
30
  const graph = readCache('graph', CACHE_TTL_MS) ?? { nodes: [], edges: [] };
30
31
  const findings = readCache('findings', CACHE_TTL_MS) ?? [];
31
32
  setGraphState(graph, findings, readCacheTimestamp('graph'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infrawise",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "mcpName": "io.github.Sidd27/infrawise",
5
5
  "description": "CLI-first infrastructure intelligence platform — analyzes DynamoDB, PostgreSQL, MySQL, MongoDB, SQS, SNS, SSM, Secrets Manager, Lambda, S3, API Gateway, CloudWatch Logs and exposes findings as an MCP server for Claude Code",
6
6
  "keywords": [