infrawise 0.12.2 → 0.12.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.
@@ -90,17 +90,8 @@ export class IaCHandlerLinker {
90
90
  return links;
91
91
  }
92
92
  }
93
- export class CompositeLinker {
94
- proven;
95
- heuristic;
96
- constructor(proven, heuristic) {
97
- this.proven = proven;
98
- this.heuristic = heuristic;
99
- }
100
- link(graph) {
101
- const provenLinks = this.proven.link(graph);
102
- const covered = new Set(provenLinks.map((l) => l.lambdaId));
103
- const heur = this.heuristic.link(graph).filter((l) => !covered.has(l.lambdaId));
104
- return [...provenLinks, ...heur];
105
- }
93
+ export function compositeLink(iacLambdas, graph) {
94
+ const proven = new IaCHandlerLinker(iacLambdas).link(graph);
95
+ const covered = new Set(proven.map((l) => l.lambdaId));
96
+ return [...proven, ...new HeuristicLinker().link(graph).filter((l) => !covered.has(l.lambdaId))];
106
97
  }
@@ -1,4 +1,4 @@
1
- import { HeuristicLinker, IaCHandlerLinker, CompositeLinker, } from './linkers.js';
1
+ import { compositeLink } from './linkers.js';
2
2
  const TRANSPORT_EDGES = new Set(['publishes_to', 'triggers']);
3
3
  export class PipelineAnalyzer {
4
4
  name = 'PipelineAnalyzer';
@@ -7,7 +7,7 @@ export class PipelineAnalyzer {
7
7
  this.iacLambdas = lambdas;
8
8
  }
9
9
  async analyze(graph) {
10
- const links = new CompositeLinker(new IaCHandlerLinker(this.iacLambdas), new HeuristicLinker()).link(graph);
10
+ const links = compositeLink(this.iacLambdas, graph);
11
11
  const nodeById = new Map(graph.nodes.map((n) => [n.id, n]));
12
12
  return [
13
13
  ...detectMissingDlqHop(graph),
@@ -44,11 +44,7 @@ export function clearCache(key) {
44
44
  fs.unlinkSync(filePath);
45
45
  }
46
46
  else {
47
- if (fs.existsSync(cacheDir)) {
48
- const files = fs.readdirSync(cacheDir);
49
- for (const file of files) {
50
- fs.unlinkSync(path.join(cacheDir, file));
51
- }
52
- }
47
+ if (fs.existsSync(cacheDir))
48
+ fs.rmSync(cacheDir, { recursive: true });
53
49
  }
54
50
  }
@@ -367,39 +367,22 @@ function resolveEdgeType(operationType) {
367
367
  return 'query';
368
368
  }
369
369
  // ── Typed node selectors ─────────────────────────────────────────────────────
370
- export function getTableNodes(graph) {
371
- return graph.nodes.filter((n) => n.type === 'table');
372
- }
373
- export function getFunctionNodes(graph) {
374
- return graph.nodes.filter((n) => n.type === 'function');
375
- }
376
- export function getIndexNodes(graph) {
377
- return graph.nodes.filter((n) => n.type === 'index');
378
- }
379
- export function getQueueNodes(graph) {
380
- return graph.nodes.filter((n) => n.type === 'queue');
381
- }
382
- export function getTopicNodes(graph) {
383
- return graph.nodes.filter((n) => n.type === 'topic');
384
- }
385
- export function getSecretNodes(graph) {
386
- return graph.nodes.filter((n) => n.type === 'secret');
387
- }
388
- export function getParameterNodes(graph) {
389
- return graph.nodes.filter((n) => n.type === 'parameter');
390
- }
391
- export function getLogGroupNodes(graph) {
392
- return graph.nodes.filter((n) => n.type === 'log_group');
393
- }
394
- export function getLambdaNodes(graph) {
395
- return graph.nodes.filter((n) => n.type === 'lambda');
396
- }
397
- export function getEventBridgeRuleNodes(graph) {
398
- return graph.nodes.filter((n) => n.type === 'eventbridge_rule');
399
- }
400
- export function getBucketNodes(graph) {
401
- return graph.nodes.filter((n) => n.type === 'bucket');
370
+ // ponytail: one generic replaces 11 typed selectors
371
+ export function getNodes(graph, type) {
372
+ return graph.nodes.filter((n) => n.type === type);
402
373
  }
374
+ export const getTableNodes = (g) => getNodes(g, 'table');
375
+ export const getFunctionNodes = (g) => getNodes(g, 'function');
376
+ export const getIndexNodes = (g) => getNodes(g, 'index');
377
+ export const getQueueNodes = (g) => getNodes(g, 'queue');
378
+ export const getTopicNodes = (g) => getNodes(g, 'topic');
379
+ export const getSecretNodes = (g) => getNodes(g, 'secret');
380
+ export const getParameterNodes = (g) => getNodes(g, 'parameter');
381
+ export const getLogGroupNodes = (g) => getNodes(g, 'log_group');
382
+ export const getLambdaNodes = (g) => getNodes(g, 'lambda');
383
+ export const getEventBridgeRuleNodes = (g) => getNodes(g, 'eventbridge_rule');
384
+ export const getBucketNodes = (g) => getNodes(g, 'bucket');
385
+ export const getAPINodes = (g) => getNodes(g, 'api');
403
386
  export function getEdgesForNode(graph, nodeId) {
404
387
  return graph.edges.filter((e) => e.from === nodeId || e.to === nodeId);
405
388
  }
@@ -420,6 +403,3 @@ export function getEdgeFrequency(graph) {
420
403
  }
421
404
  return freq;
422
405
  }
423
- export function getAPINodes(graph) {
424
- return graph.nodes.filter((n) => n.type === 'api');
425
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "infrawise",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
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": [
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "main": "dist/cli/index.js",
53
53
  "engines": {
54
- "node": ">=24.0.0",
54
+ "node": ">=20.0.0",
55
55
  "pnpm": ">=9.0.0"
56
56
  },
57
- "packageManager": "pnpm@11.6.0",
57
+ "packageManager": "pnpm@10.14.0",
58
58
  "scripts": {
59
59
  "build": "tsc --noEmit false --outDir dist",
60
60
  "test": "vitest run --passWithNoTests",