@mrpatronz/nexusflow 0.2.0 → 0.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.
- package/dist/analyzers/index.d.ts +2 -0
- package/dist/analyzers/index.d.ts.map +1 -1
- package/dist/analyzers/index.js +9 -1
- package/dist/analyzers/index.js.map +1 -1
- package/dist/analyzers/messaging-analyzer.d.ts +17 -0
- package/dist/analyzers/messaging-analyzer.d.ts.map +1 -0
- package/dist/analyzers/messaging-analyzer.js +229 -0
- package/dist/analyzers/messaging-analyzer.js.map +1 -0
- package/dist/analyzers/readme-summarizer.d.ts.map +1 -1
- package/dist/analyzers/readme-summarizer.js +8 -4
- package/dist/analyzers/readme-summarizer.js.map +1 -1
- package/dist/analyzers/run-analyzer.d.ts +15 -0
- package/dist/analyzers/run-analyzer.d.ts.map +1 -0
- package/dist/analyzers/run-analyzer.js +246 -0
- package/dist/analyzers/run-analyzer.js.map +1 -0
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/generators/base.d.ts.map +1 -1
- package/dist/generators/base.js +18 -57
- package/dist/generators/base.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +30 -14
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/map-generator.d.ts +1 -1
- package/dist/generators/map-generator.d.ts.map +1 -1
- package/dist/generators/map-generator.js +157 -54
- package/dist/generators/map-generator.js.map +1 -1
- package/dist/generators/map-generator.test.js +71 -0
- package/dist/generators/map-generator.test.js.map +1 -1
- package/dist/generators/plan-generator.d.ts +2 -2
- package/dist/generators/plan-generator.d.ts.map +1 -1
- package/dist/generators/plan-generator.js +47 -67
- package/dist/generators/plan-generator.js.map +1 -1
- package/dist/generators/skills-generator.d.ts +15 -0
- package/dist/generators/skills-generator.d.ts.map +1 -0
- package/dist/generators/skills-generator.js +225 -0
- package/dist/generators/skills-generator.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +16 -85
- package/dist/mcp/server.js.map +1 -1
- package/dist/server.d.ts +0 -5
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +9 -6
- package/dist/server.js.map +1 -1
- package/dist/types.d.ts +46 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/analyzers/index.ts +9 -1
- package/src/analyzers/messaging-analyzer.ts +254 -0
- package/src/analyzers/readme-summarizer.ts +9 -4
- package/src/analyzers/run-analyzer.ts +269 -0
- package/src/core/config.ts +1 -1
- package/src/generators/base.ts +19 -56
- package/src/generators/index.ts +32 -14
- package/src/generators/map-generator.test.ts +78 -0
- package/src/generators/map-generator.ts +164 -53
- package/src/generators/plan-generator.ts +53 -75
- package/src/generators/skills-generator.ts +255 -0
- package/src/mcp/server.ts +16 -89
- package/src/server.ts +9 -6
- package/src/types.ts +54 -0
|
@@ -26,4 +26,6 @@ export { detectDependencies, findInterRepoDependencies, detectNuGetFeeds } from
|
|
|
26
26
|
export { detectPorts } from './detect-ports.js';
|
|
27
27
|
export { detectExistingAIConfigs } from './detect-existing.js';
|
|
28
28
|
export { extractReadmeSummary } from './readme-summarizer.js';
|
|
29
|
+
export { analyzeMessaging } from './messaging-analyzer.js';
|
|
30
|
+
export { analyzeRunConfig } from './run-analyzer.js';
|
|
29
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAU7D;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,eAAe,CAAC,CA6B1E;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,QAAQ,EAAE,GAChB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAoBvC;AAGD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/analyzers/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import { detectDependencies, detectProducedPackages, detectNuGetFeeds } from './
|
|
|
11
11
|
import { detectPorts } from './detect-ports.js';
|
|
12
12
|
import { detectExistingAIConfigs } from './detect-existing.js';
|
|
13
13
|
import { extractReadmeSummary } from './readme-summarizer.js';
|
|
14
|
+
import { analyzeMessaging } from './messaging-analyzer.js';
|
|
15
|
+
import { analyzeRunConfig } from './run-analyzer.js';
|
|
14
16
|
/**
|
|
15
17
|
* Runs all analyzers against a single repository and returns
|
|
16
18
|
* a complete {@link ProjectAnalysis}.
|
|
@@ -19,7 +21,7 @@ import { extractReadmeSummary } from './readme-summarizer.js';
|
|
|
19
21
|
* @returns Full analysis result.
|
|
20
22
|
*/
|
|
21
23
|
export async function analyzeRepo(repo) {
|
|
22
|
-
const [techStack, endpoints, dependencies, produces, nugetFeeds, ports, existingAIConfigs, readmeSummary] = await Promise.all([
|
|
24
|
+
const [techStack, endpoints, dependencies, produces, nugetFeeds, ports, existingAIConfigs, readmeSummary, messaging, runConfig] = await Promise.all([
|
|
23
25
|
detectTechStack(repo.path),
|
|
24
26
|
detectApis(repo.path),
|
|
25
27
|
detectDependencies(repo.path),
|
|
@@ -28,6 +30,8 @@ export async function analyzeRepo(repo) {
|
|
|
28
30
|
detectPorts(repo.path),
|
|
29
31
|
detectExistingAIConfigs(repo.path),
|
|
30
32
|
extractReadmeSummary(repo.path),
|
|
33
|
+
analyzeMessaging(repo.path),
|
|
34
|
+
analyzeRunConfig(repo.path),
|
|
31
35
|
]);
|
|
32
36
|
return {
|
|
33
37
|
name: repo.name,
|
|
@@ -40,6 +44,8 @@ export async function analyzeRepo(repo) {
|
|
|
40
44
|
ports,
|
|
41
45
|
existingAIConfigs,
|
|
42
46
|
readmeSummary,
|
|
47
|
+
messaging,
|
|
48
|
+
runConfig,
|
|
43
49
|
};
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
@@ -75,4 +81,6 @@ export { detectDependencies, findInterRepoDependencies, detectNuGetFeeds } from
|
|
|
75
81
|
export { detectPorts } from './detect-ports.js';
|
|
76
82
|
export { detectExistingAIConfigs } from './detect-existing.js';
|
|
77
83
|
export { extractReadmeSummary } from './readme-summarizer.js';
|
|
84
|
+
export { analyzeMessaging } from './messaging-analyzer.js';
|
|
85
|
+
export { analyzeRunConfig } from './run-analyzer.js';
|
|
78
86
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/analyzers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AAGtB,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,sBA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AAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnE,OAAO,CAAC,IAAI,CAAC,qBAAqB,IAAI,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC,CAAC;YACvD,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,CAAC,OAAO,CAAC,YAAY,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACjE,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iCAAiC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/messaging-analyzer
|
|
3
|
+
* Detects publishers and subscribers for pub/sub messaging topologies
|
|
4
|
+
* across multiple programming languages and frameworks.
|
|
5
|
+
*/
|
|
6
|
+
import type { MessagingTopology } from '../types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Analyzes messaging/event topology in a repository.
|
|
9
|
+
*
|
|
10
|
+
* Scans C#, JS/TS, Python, and Go source files for publish and subscribe
|
|
11
|
+
* patterns and extracts message/event contracts.
|
|
12
|
+
*
|
|
13
|
+
* @param repoPath - Absolute path to the repository root.
|
|
14
|
+
* @returns Detected publishers and subscribers.
|
|
15
|
+
*/
|
|
16
|
+
export declare function analyzeMessaging(repoPath: string): Promise<MessagingTopology>;
|
|
17
|
+
//# sourceMappingURL=messaging-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging-analyzer.d.ts","sourceRoot":"","sources":["../../src/analyzers/messaging-analyzer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,iBAAiB,EAAuC,MAAM,aAAa,CAAC;AAE1F;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyOnF"}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/messaging-analyzer
|
|
3
|
+
* Detects publishers and subscribers for pub/sub messaging topologies
|
|
4
|
+
* across multiple programming languages and frameworks.
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'node:fs/promises';
|
|
7
|
+
import * as path from 'node:path';
|
|
8
|
+
import { globby } from 'globby';
|
|
9
|
+
/**
|
|
10
|
+
* Analyzes messaging/event topology in a repository.
|
|
11
|
+
*
|
|
12
|
+
* Scans C#, JS/TS, Python, and Go source files for publish and subscribe
|
|
13
|
+
* patterns and extracts message/event contracts.
|
|
14
|
+
*
|
|
15
|
+
* @param repoPath - Absolute path to the repository root.
|
|
16
|
+
* @returns Detected publishers and subscribers.
|
|
17
|
+
*/
|
|
18
|
+
export async function analyzeMessaging(repoPath) {
|
|
19
|
+
const publishers = [];
|
|
20
|
+
const subscribers = [];
|
|
21
|
+
try {
|
|
22
|
+
const files = await globby(['**/*.ts', '**/*.js', '**/*.cs', '**/*.py', '**/*.go'], {
|
|
23
|
+
cwd: repoPath,
|
|
24
|
+
absolute: true,
|
|
25
|
+
ignore: ['**/node_modules/**', '**/bin/**', '**/obj/**', '**/dist/**', '**/out/**', '**/.git/**'],
|
|
26
|
+
});
|
|
27
|
+
for (const file of files) {
|
|
28
|
+
try {
|
|
29
|
+
const stat = await fs.stat(file);
|
|
30
|
+
if (!stat.isFile() || stat.size > 200_000)
|
|
31
|
+
continue; // Skip large files
|
|
32
|
+
const content = await fs.readFile(file, 'utf-8');
|
|
33
|
+
const relPath = path.relative(repoPath, file).replace(/\\/g, '/');
|
|
34
|
+
if (file.endsWith('.cs')) {
|
|
35
|
+
// ── C# Messaging Patterns ────────────────────────────────────────
|
|
36
|
+
// MediatR notification handler
|
|
37
|
+
// INotificationHandler<MyNotification>
|
|
38
|
+
const mediatrSubRegex = /:\s*INotificationHandler\s*<\s*(\w+)\s*>/g;
|
|
39
|
+
let match;
|
|
40
|
+
while ((match = mediatrSubRegex.exec(content)) !== null) {
|
|
41
|
+
subscribers.push({
|
|
42
|
+
contractType: match[1],
|
|
43
|
+
handlerFile: relPath,
|
|
44
|
+
registrationFile: relPath,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// MediatR command/query handler
|
|
48
|
+
// IRequestHandler<MyRequest, MyResponse> or IRequestHandler<MyRequest>
|
|
49
|
+
const requestHandlerRegex = /:\s*IRequestHandler\s*<\s*(\w+)(?:\s*,\s*\w+)?\s*>/g;
|
|
50
|
+
while ((match = requestHandlerRegex.exec(content)) !== null) {
|
|
51
|
+
subscribers.push({
|
|
52
|
+
contractType: match[1],
|
|
53
|
+
handlerFile: relPath,
|
|
54
|
+
registrationFile: relPath,
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// MassTransit Consumer: IConsumer<MyMessage>
|
|
58
|
+
const massTransitSubRegex = /:\s*IConsumer\s*<\s*(\w+)\s*>/g;
|
|
59
|
+
while ((match = massTransitSubRegex.exec(content)) !== null) {
|
|
60
|
+
subscribers.push({
|
|
61
|
+
contractType: match[1],
|
|
62
|
+
handlerFile: relPath,
|
|
63
|
+
registrationFile: relPath,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// NServiceBus Handler: IHandleMessages<MyMessage>
|
|
67
|
+
const nserviceBusSubRegex = /:\s*IHandleMessages\s*<\s*(\w+)\s*>/g;
|
|
68
|
+
while ((match = nserviceBusSubRegex.exec(content)) !== null) {
|
|
69
|
+
subscribers.push({
|
|
70
|
+
contractType: match[1],
|
|
71
|
+
handlerFile: relPath,
|
|
72
|
+
registrationFile: relPath,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
// Azure Service Bus triggers: [ServiceBusTrigger("queueOrTopicName")]
|
|
76
|
+
const sbtRegex = /\[ServiceBusTrigger\s*\(\s*"([^"]+)"(?:\s*,\s*"[^"]+")?\s*\)\]/g;
|
|
77
|
+
while ((match = sbtRegex.exec(content)) !== null) {
|
|
78
|
+
subscribers.push({
|
|
79
|
+
contractType: 'ServiceBusMessage',
|
|
80
|
+
handlerFile: relPath,
|
|
81
|
+
registrationFile: relPath,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// Publishers in C#
|
|
85
|
+
// .Publish<MyEvent>( or .PublishAsync<MyEvent>( or .Send<MyCommand>( or .SendAsync<MyCommand>(
|
|
86
|
+
const csPubRegex = /\b(?:Publish|PublishAsync|Send|SendAsync)\s*<\s*(\w+)\s*>\s*\(/g;
|
|
87
|
+
while ((match = csPubRegex.exec(content)) !== null) {
|
|
88
|
+
publishers.push({
|
|
89
|
+
contractType: match[1],
|
|
90
|
+
topicOrQueue: 'direct/inferred',
|
|
91
|
+
publisherFile: relPath,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
const mediatorSendRegex = /\bmediator\s*\.\s*(?:Send|Publish)\s*\(\s*new\s+(\w+)\s*\(/gi;
|
|
95
|
+
while ((match = mediatorSendRegex.exec(content)) !== null) {
|
|
96
|
+
publishers.push({
|
|
97
|
+
contractType: match[1],
|
|
98
|
+
topicOrQueue: 'mediator',
|
|
99
|
+
publisherFile: relPath,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
else if (file.endsWith('.ts') || file.endsWith('.js')) {
|
|
104
|
+
// ── TS/JS Messaging Patterns ─────────────────────────────────────
|
|
105
|
+
// EventEmitter emitters: emit('event-name', ...)
|
|
106
|
+
const tsEmitRegex = /\bemit\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
|
107
|
+
let match;
|
|
108
|
+
while ((match = tsEmitRegex.exec(content)) !== null) {
|
|
109
|
+
publishers.push({
|
|
110
|
+
contractType: match[1],
|
|
111
|
+
topicOrQueue: 'EventEmitter',
|
|
112
|
+
publisherFile: relPath,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// EventEmitter listeners: on('event-name', ...) or addListener('event-name', ...)
|
|
116
|
+
const tsOnRegex = /\b(?:on|addListener)\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
|
117
|
+
while ((match = tsOnRegex.exec(content)) !== null) {
|
|
118
|
+
subscribers.push({
|
|
119
|
+
contractType: match[1],
|
|
120
|
+
handlerFile: relPath,
|
|
121
|
+
registrationFile: relPath,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Kafka/RabbitMQ subscribe: topic: 'topic-name' inside subscription object
|
|
125
|
+
const tsSubTopicRegex = /topic\s*:\s*['"`]([^'"`]+)['"`]/g;
|
|
126
|
+
while ((match = tsSubTopicRegex.exec(content)) !== null) {
|
|
127
|
+
subscribers.push({
|
|
128
|
+
contractType: 'Kafka/MQ Message',
|
|
129
|
+
handlerFile: relPath,
|
|
130
|
+
registrationFile: relPath,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// BullMQ add: queue.add('job-name', ...)
|
|
134
|
+
const bullmqAddRegex = /\badd\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
|
135
|
+
while ((match = bullmqAddRegex.exec(content)) !== null) {
|
|
136
|
+
publishers.push({
|
|
137
|
+
contractType: match[1],
|
|
138
|
+
topicOrQueue: 'BullMQ',
|
|
139
|
+
publisherFile: relPath,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
else if (file.endsWith('.py')) {
|
|
144
|
+
// ── Python Messaging Patterns ────────────────────────────────────
|
|
145
|
+
// Celery task definitions: @app.task or @shared_task
|
|
146
|
+
const celeryTaskRegex = /@(?:[a-zA-Z0-9_]+\.)?(?:task|shared_task)(?:\([^)]*\))?\s*\n\s*def\s+(\w+)\s*\(/g;
|
|
147
|
+
let match;
|
|
148
|
+
while ((match = celeryTaskRegex.exec(content)) !== null) {
|
|
149
|
+
subscribers.push({
|
|
150
|
+
contractType: match[1],
|
|
151
|
+
handlerFile: relPath,
|
|
152
|
+
registrationFile: relPath,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
// Celery task invocations: task.delay(...) or task.apply_async(...)
|
|
156
|
+
const celeryDelayRegex = /\b(\w+)\s*\.\s*(?:delay|apply_async)\s*\(/g;
|
|
157
|
+
while ((match = celeryDelayRegex.exec(content)) !== null) {
|
|
158
|
+
publishers.push({
|
|
159
|
+
contractType: match[1],
|
|
160
|
+
topicOrQueue: 'Celery',
|
|
161
|
+
publisherFile: relPath,
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
// RabbitMQ basic_publish: routing_key='key'
|
|
165
|
+
const pikaPublishRegex = /routing_key\s*=\s*['"`]([^'"`]+)['"`]/g;
|
|
166
|
+
while ((match = pikaPublishRegex.exec(content)) !== null) {
|
|
167
|
+
publishers.push({
|
|
168
|
+
contractType: match[1],
|
|
169
|
+
topicOrQueue: 'RabbitMQ',
|
|
170
|
+
publisherFile: relPath,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
else if (file.endsWith('.go')) {
|
|
175
|
+
// ── Go Messaging Patterns ────────────────────────────────────────
|
|
176
|
+
// Go publish/produce calls: Publish("topic", ...) or Produce("topic", ...)
|
|
177
|
+
const goPubRegex = /\b(?:Publish|Produce|Send)\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
|
178
|
+
let match;
|
|
179
|
+
while ((match = goPubRegex.exec(content)) !== null) {
|
|
180
|
+
publishers.push({
|
|
181
|
+
contractType: 'GoMessage',
|
|
182
|
+
topicOrQueue: match[1],
|
|
183
|
+
publisherFile: relPath,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
// Go subscribe/consume calls: Subscribe("topic", ...) or Consume("topic", ...)
|
|
187
|
+
const goSubRegex = /\b(?:Subscribe|Consume)\s*\(\s*['"`]([^'"`]+)['"`]/g;
|
|
188
|
+
while ((match = goSubRegex.exec(content)) !== null) {
|
|
189
|
+
subscribers.push({
|
|
190
|
+
contractType: 'GoMessage',
|
|
191
|
+
handlerFile: relPath,
|
|
192
|
+
registrationFile: relPath,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
catch {
|
|
198
|
+
// Skip unreadable files
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch {
|
|
203
|
+
// Ignore errors
|
|
204
|
+
}
|
|
205
|
+
// De-duplicate publishers & subscribers
|
|
206
|
+
const uniquePublishers = [];
|
|
207
|
+
const seenPub = new Set();
|
|
208
|
+
for (const p of publishers) {
|
|
209
|
+
const key = `${p.contractType}:${p.topicOrQueue}:${p.publisherFile}`;
|
|
210
|
+
if (!seenPub.has(key)) {
|
|
211
|
+
seenPub.add(key);
|
|
212
|
+
uniquePublishers.push(p);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const uniqueSubscribers = [];
|
|
216
|
+
const seenSub = new Set();
|
|
217
|
+
for (const s of subscribers) {
|
|
218
|
+
const key = `${s.contractType}:${s.handlerFile}:${s.registrationFile}`;
|
|
219
|
+
if (!seenSub.has(key)) {
|
|
220
|
+
seenSub.add(key);
|
|
221
|
+
uniqueSubscribers.push(s);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
publishers: uniquePublishers,
|
|
226
|
+
subscribers: uniqueSubscribers,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
//# sourceMappingURL=messaging-analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messaging-analyzer.js","sourceRoot":"","sources":["../../src/analyzers/messaging-analyzer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,QAAgB;IACrD,MAAM,UAAU,GAAuB,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAwB,EAAE,CAAC;IAE5C,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,MAAM,CACxB,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,EACvD;YACE,GAAG,EAAE,QAAQ;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,CAAC,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC;SAClG,CACF,CAAC;QAEF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC;gBACH,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,IAAI,GAAG,OAAO;oBAAE,SAAS,CAAC,mBAAmB;gBAExE,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBACjD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;gBAElE,IAAI,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AAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACvE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACjB,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO;QACL,UAAU,EAAE,gBAAgB;QAC5B,WAAW,EAAE,iBAAiB;KAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-summarizer.d.ts","sourceRoot":"","sources":["../../src/analyzers/readme-summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"readme-summarizer.d.ts","sourceRoot":"","sources":["../../src/analyzers/readme-summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkFxB"}
|
|
@@ -63,12 +63,16 @@ export async function extractReadmeSummary(repoPath) {
|
|
|
63
63
|
if (trimmed.startsWith('#'))
|
|
64
64
|
continue;
|
|
65
65
|
// Detect Table of Contents (TOC) lists
|
|
66
|
-
// Skip lines that look like: - [About](#about) or * 1. [Section](#section)
|
|
67
|
-
if (/^[-*+]\s*(\d+\.)?\s*\[[^\]]+\]\(#[^)]+\)/.test(trimmed)) {
|
|
66
|
+
// Skip lines that look like: - [About](#about) or 1. [About](#about) or * 1. [Section](#section)
|
|
67
|
+
if (/^(?:[-*+]\s*|\d+\.\s*)(\d+\.)?\s*\[[^\]]+\]\(#[^)]+\)/.test(trimmed)) {
|
|
68
68
|
continue;
|
|
69
69
|
}
|
|
70
|
-
// Skip
|
|
71
|
-
if (
|
|
70
|
+
// Skip link-only lines (e.g., "[API Docs](https://...)")
|
|
71
|
+
if (/^\[[^\]]+\]\([^)]+\)$/.test(trimmed)) {
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
// Skip standard bullet and numbered lists if we are searching for prose (e.g. at the top of README before prose)
|
|
75
|
+
if (proseLines.length === 0 && (/^[-*+]\s+/.test(trimmed) || /^\d+\.\s+/.test(trimmed))) {
|
|
72
76
|
continue;
|
|
73
77
|
}
|
|
74
78
|
// Accumulate prose lines
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-summarizer.js","sourceRoot":"","sources":["../../src/analyzers/readme-summarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,QAAgB;IAEhB,8BAA8B;IAC9B,MAAM,UAAU,GAAG,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC;IAElF,IAAI,OAAO,GAAkB,IAAI,CAAC;IAElC,KAAK,MAAM,QAAQ,IAAI,UAAU,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;YACpE,MAAM;QACR,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,gEAAgE;IAChE,O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GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACjE,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,kEAAkE;IAClE,OAAO,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;AACxE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/run-analyzer
|
|
3
|
+
* Analyzes projects to discover local run configurations, entry points,
|
|
4
|
+
* database dependencies, external services, and flags shared staging/test
|
|
5
|
+
* infrastructure or committed secrets.
|
|
6
|
+
*/
|
|
7
|
+
import type { RunConfig } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Analyzes local run configurations, databases, and dependencies in a repository.
|
|
10
|
+
*
|
|
11
|
+
* @param repoPath - Absolute path to the repository root.
|
|
12
|
+
* @returns Run configuration analysis.
|
|
13
|
+
*/
|
|
14
|
+
export declare function analyzeRunConfig(repoPath: string): Promise<RunConfig>;
|
|
15
|
+
//# sourceMappingURL=run-analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-analyzer.d.ts","sourceRoot":"","sources":["../../src/analyzers/run-analyzer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAwF,MAAM,aAAa,CAAC;AAEnI;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAyP3E"}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module analyzers/run-analyzer
|
|
3
|
+
* Analyzes projects to discover local run configurations, entry points,
|
|
4
|
+
* database dependencies, external services, and flags shared staging/test
|
|
5
|
+
* infrastructure or committed secrets.
|
|
6
|
+
*/
|
|
7
|
+
import * as fsp from 'node:fs/promises';
|
|
8
|
+
import * as path from 'node:path';
|
|
9
|
+
import { globby } from 'globby';
|
|
10
|
+
/**
|
|
11
|
+
* Analyzes local run configurations, databases, and dependencies in a repository.
|
|
12
|
+
*
|
|
13
|
+
* @param repoPath - Absolute path to the repository root.
|
|
14
|
+
* @returns Run configuration analysis.
|
|
15
|
+
*/
|
|
16
|
+
export async function analyzeRunConfig(repoPath) {
|
|
17
|
+
const entryPoints = [];
|
|
18
|
+
const databases = [];
|
|
19
|
+
const sharedInfraWarnings = [];
|
|
20
|
+
const committedSecrets = [];
|
|
21
|
+
const externalDependencies = [];
|
|
22
|
+
const isLocalHost = (host) => {
|
|
23
|
+
const h = host.toLowerCase().trim();
|
|
24
|
+
return (h.includes('localhost') ||
|
|
25
|
+
h.includes('127.0.0.1') ||
|
|
26
|
+
h.includes('[::1]') ||
|
|
27
|
+
h.includes('(localdb)') ||
|
|
28
|
+
h === 'db' ||
|
|
29
|
+
h === 'postgres' ||
|
|
30
|
+
h === 'redis' ||
|
|
31
|
+
h === 'mongo');
|
|
32
|
+
};
|
|
33
|
+
try {
|
|
34
|
+
// ── 1. Entry Points Detection ──────────────────────────────────────────
|
|
35
|
+
// A. Check for C# Web/Worker apps
|
|
36
|
+
const csprojFiles = await globby('**/*.csproj', {
|
|
37
|
+
cwd: repoPath,
|
|
38
|
+
absolute: true,
|
|
39
|
+
ignore: ['**/node_modules/**', '**/bin/**', '**/obj/**', '**/dist/**', '**/out/**', '**/.git/**'],
|
|
40
|
+
});
|
|
41
|
+
for (const file of csprojFiles) {
|
|
42
|
+
try {
|
|
43
|
+
const content = await fsp.readFile(file, 'utf-8');
|
|
44
|
+
const relPath = path.relative(repoPath, file).replace(/\\/g, '/');
|
|
45
|
+
if (content.includes('Sdk="Microsoft.NET.Sdk.Web"')) {
|
|
46
|
+
entryPoints.push({
|
|
47
|
+
projectPath: relPath,
|
|
48
|
+
type: 'aspnet',
|
|
49
|
+
command: 'dotnet run',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else if (content.includes('Sdk="Microsoft.NET.Sdk.Worker"')) {
|
|
53
|
+
entryPoints.push({
|
|
54
|
+
projectPath: relPath,
|
|
55
|
+
type: 'worker',
|
|
56
|
+
command: 'dotnet run',
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch { }
|
|
61
|
+
}
|
|
62
|
+
// B. Check for package.json (Node/JS/TS)
|
|
63
|
+
const packageJsonPath = path.join(repoPath, 'package.json');
|
|
64
|
+
try {
|
|
65
|
+
const raw = await fsp.readFile(packageJsonPath, 'utf-8');
|
|
66
|
+
const pkg = JSON.parse(raw);
|
|
67
|
+
if (pkg.scripts && (pkg.scripts.start || pkg.scripts.dev)) {
|
|
68
|
+
entryPoints.push({
|
|
69
|
+
projectPath: 'package.json',
|
|
70
|
+
type: pkg.dependencies && pkg.dependencies.next ? 'nextjs' : 'node',
|
|
71
|
+
command: pkg.scripts.dev ? 'npm run dev' : 'npm start',
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch { }
|
|
76
|
+
// C. Check for Python/Go
|
|
77
|
+
const goModFiles = await globby('**/go.mod', { cwd: repoPath, absolute: true });
|
|
78
|
+
if (goModFiles.length > 0) {
|
|
79
|
+
entryPoints.push({
|
|
80
|
+
projectPath: path.relative(repoPath, goModFiles[0]).replace(/\\/g, '/'),
|
|
81
|
+
type: 'go',
|
|
82
|
+
command: 'go run .',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const pyFiles = await globby(['**/requirements.txt', '**/Pipfile', '**/pyproject.toml'], { cwd: repoPath, absolute: true });
|
|
86
|
+
if (pyFiles.length > 0) {
|
|
87
|
+
entryPoints.push({
|
|
88
|
+
projectPath: path.relative(repoPath, pyFiles[0]).replace(/\\/g, '/'),
|
|
89
|
+
type: 'python',
|
|
90
|
+
command: 'python main.py',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
// ── 2. Config Files Parsing (DBs, Shared Infra, Secrets) ───────────────
|
|
94
|
+
const configFiles = await globby(['**/appsettings.json', '**/appsettings.Development.json', '**/appsettings.*.json', '**/.env', '**/.env.development', '**/.env.local'], {
|
|
95
|
+
cwd: repoPath,
|
|
96
|
+
absolute: true,
|
|
97
|
+
ignore: ['**/node_modules/**', '**/bin/**', '**/obj/**', '**/dist/**', '**/out/**', '**/.git/**'],
|
|
98
|
+
});
|
|
99
|
+
for (const file of configFiles) {
|
|
100
|
+
try {
|
|
101
|
+
const content = await fsp.readFile(file, 'utf-8');
|
|
102
|
+
const relPath = path.relative(repoPath, file).replace(/\\/g, '/');
|
|
103
|
+
// Secrets Check (Universal regex for high probability secrets)
|
|
104
|
+
const secretRegex = /(?:password|pwd|secret|key|token|privatekey|accountkey|sharedaccesskey)\s*[=:]\s*['"`]?([^'";\s]{12,})['"`]?/gi;
|
|
105
|
+
let secretMatch;
|
|
106
|
+
while ((secretMatch = secretRegex.exec(content)) !== null) {
|
|
107
|
+
const matchedVal = secretMatch[1];
|
|
108
|
+
// Skip if it looks like a placeholder
|
|
109
|
+
if (!matchedVal.includes('placeholder') && !matchedVal.includes('<your') && !matchedVal.toLowerCase().includes('your_')) {
|
|
110
|
+
committedSecrets.push({
|
|
111
|
+
file: relPath,
|
|
112
|
+
lineHint: secretMatch[0].split(/[=:]/)[0].trim(),
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (file.endsWith('.json')) {
|
|
117
|
+
const parsed = JSON.parse(content);
|
|
118
|
+
// connectionStrings
|
|
119
|
+
if (parsed.ConnectionStrings) {
|
|
120
|
+
for (const [key, value] of Object.entries(parsed.ConnectionStrings)) {
|
|
121
|
+
if (typeof value === 'string') {
|
|
122
|
+
let provider = 'unknown';
|
|
123
|
+
if (value.toLowerCase().includes('sql server') || value.toLowerCase().includes('sqlexpress') || value.toLowerCase().includes('server=')) {
|
|
124
|
+
provider = 'SQL Server';
|
|
125
|
+
}
|
|
126
|
+
if (value.toLowerCase().includes('postgresql') || value.toLowerCase().includes('port=5432')) {
|
|
127
|
+
provider = 'PostgreSQL';
|
|
128
|
+
}
|
|
129
|
+
// Extract Host
|
|
130
|
+
const hostMatch = value.match(/Server=([^;]+)/i) ?? value.match(/Host=([^;]+)/i) ?? value.match(/Data Source=([^;]+)/i);
|
|
131
|
+
const host = hostMatch ? hostMatch[1].trim() : 'unknown';
|
|
132
|
+
databases.push({
|
|
133
|
+
provider,
|
|
134
|
+
host,
|
|
135
|
+
configFile: relPath,
|
|
136
|
+
});
|
|
137
|
+
if (host !== 'unknown' && !isLocalHost(host)) {
|
|
138
|
+
sharedInfraWarnings.push({
|
|
139
|
+
resource: key,
|
|
140
|
+
host,
|
|
141
|
+
configFile: relPath,
|
|
142
|
+
warning: `⚠️ SHARED INFRA: ${relPath} binds ConnectionString "${key}" to non-local host (${host}). Running locally may connect to shared test/production databases.`,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Service Bus or MQ settings
|
|
149
|
+
const rabbitRegex = /"HostName"\s*:\s*"([^"]+)"/gi;
|
|
150
|
+
let rabbitMatch;
|
|
151
|
+
while ((rabbitMatch = rabbitRegex.exec(content)) !== null) {
|
|
152
|
+
const host = rabbitMatch[1];
|
|
153
|
+
if (!isLocalHost(host)) {
|
|
154
|
+
sharedInfraWarnings.push({
|
|
155
|
+
resource: 'RabbitMQ',
|
|
156
|
+
host,
|
|
157
|
+
configFile: relPath,
|
|
158
|
+
warning: `⚠️ SHARED INFRA: ${relPath} binds RabbitMQ host to non-local host (${host}).`,
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
// B. .env parsing
|
|
165
|
+
const lines = content.split('\n');
|
|
166
|
+
for (const line of lines) {
|
|
167
|
+
const cleanLine = line.trim();
|
|
168
|
+
if (cleanLine.startsWith('#') || !cleanLine.includes('='))
|
|
169
|
+
continue;
|
|
170
|
+
const [key, val] = cleanLine.split('=', 2);
|
|
171
|
+
if (!key || !val)
|
|
172
|
+
continue;
|
|
173
|
+
const cleanKey = key.trim();
|
|
174
|
+
const cleanVal = val.trim().replace(/^['"]|['"]$/g, '');
|
|
175
|
+
// DB UrL e.g. DATABASE_URL=postgres://user:pass@host:port/db
|
|
176
|
+
if (cleanKey.includes('DATABASE_URL') || cleanKey.includes('MONGODB_URI') || cleanKey.includes('REDIS_URL')) {
|
|
177
|
+
let provider = 'unknown';
|
|
178
|
+
if (cleanVal.startsWith('postgres'))
|
|
179
|
+
provider = 'PostgreSQL';
|
|
180
|
+
else if (cleanVal.startsWith('mongodb'))
|
|
181
|
+
provider = 'MongoDB';
|
|
182
|
+
else if (cleanVal.startsWith('redis'))
|
|
183
|
+
provider = 'Redis';
|
|
184
|
+
// Extract Host from URL
|
|
185
|
+
const hostMatch = cleanVal.match(/@([^:/]+)/);
|
|
186
|
+
const host = hostMatch ? hostMatch[1] : cleanVal;
|
|
187
|
+
databases.push({
|
|
188
|
+
provider,
|
|
189
|
+
host,
|
|
190
|
+
configFile: relPath,
|
|
191
|
+
});
|
|
192
|
+
if (!isLocalHost(host)) {
|
|
193
|
+
sharedInfraWarnings.push({
|
|
194
|
+
resource: cleanKey,
|
|
195
|
+
host,
|
|
196
|
+
configFile: relPath,
|
|
197
|
+
warning: `⚠️ SHARED INFRA: .env variable "${cleanKey}" points to non-local host (${host}).`,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch { }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
// Ignore errors
|
|
209
|
+
}
|
|
210
|
+
// De-duplicate external dependencies / warnings
|
|
211
|
+
const uniqueInfraWarnings = [];
|
|
212
|
+
const seenInfra = new Set();
|
|
213
|
+
for (const w of sharedInfraWarnings) {
|
|
214
|
+
const key = `${w.resource}:${w.host}:${w.configFile}`;
|
|
215
|
+
if (!seenInfra.has(key)) {
|
|
216
|
+
seenInfra.add(key);
|
|
217
|
+
uniqueInfraWarnings.push(w);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
const uniqueDatabases = [];
|
|
221
|
+
const seenDb = new Set();
|
|
222
|
+
for (const db of databases) {
|
|
223
|
+
const key = `${db.provider}:${db.host}:${db.configFile}`;
|
|
224
|
+
if (!seenDb.has(key)) {
|
|
225
|
+
seenDb.add(key);
|
|
226
|
+
uniqueDatabases.push(db);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
const uniqueSecrets = [];
|
|
230
|
+
const seenSecret = new Set();
|
|
231
|
+
for (const s of committedSecrets) {
|
|
232
|
+
const key = `${s.file}:${s.lineHint}`;
|
|
233
|
+
if (!seenSecret.has(key)) {
|
|
234
|
+
seenSecret.add(key);
|
|
235
|
+
uniqueSecrets.push(s);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
entryPoints,
|
|
240
|
+
databases: uniqueDatabases,
|
|
241
|
+
sharedInfraWarnings: uniqueInfraWarnings,
|
|
242
|
+
committedSecrets: uniqueSecrets,
|
|
243
|
+
externalDependencies,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
//# sourceMappingURL=run-analyzer.js.map
|