secufusion-mcp 2.1.6 → 2.2.0
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/README.md +5 -3
- package/agents/AGENTS.md +224 -31
- package/agents/reviewer.md +231 -304
- package/commands/sfn-code.md +72 -6
- package/commands/sfn-init.md +506 -36
- package/commands/sfn-review.md +695 -30
- package/mcp/dist/parsers/events.js +11 -4
- package/mcp/dist/server.js +253 -1396
- package/package.json +2 -2
- package/scripts/.secufusion-migrations.json +395 -0
- package/scripts/.secufusion-project-spec.json +857 -0
|
@@ -7,14 +7,21 @@ export function parseEventTopics(filePath, fileContent, repository) {
|
|
|
7
7
|
const topicsConsumed = [];
|
|
8
8
|
const topicsProduced = [];
|
|
9
9
|
const violations = [];
|
|
10
|
-
|
|
10
|
+
// Accepts either a quoted literal ("my-topic") or a bare/qualified constant
|
|
11
|
+
// reference (TOPIC, KafkaTopicConfig.EVENTS_TOPIC) — real Spring code almost
|
|
12
|
+
// always uses the latter, so requiring quotes here missed nearly every consumer.
|
|
13
|
+
const listenerRegex = /@KafkaListener\s*\(\s*topics\s*=\s*(?:["']([^"']+)["']|([A-Za-z_][\w.]*))/g;
|
|
11
14
|
let match;
|
|
12
15
|
while ((match = listenerRegex.exec(fileContent)) !== null) {
|
|
13
|
-
topicsConsumed.push(match[1]);
|
|
16
|
+
topicsConsumed.push(match[1] || match[2]);
|
|
14
17
|
}
|
|
15
|
-
|
|
18
|
+
// Matches any *KafkaTemplate-suffixed field (kafkaTemplate, deviceDeletedKafkaTemplate, ...)
|
|
19
|
+
// — not just the literal capitalized type name, which never appears at the call site —
|
|
20
|
+
// and the first .send(...) argument whether it's a quoted literal or a constant reference,
|
|
21
|
+
// allowing the call to wrap onto following lines as it does in practice.
|
|
22
|
+
const producerRegex = /([A-Za-z_]*[Kk]afkaTemplate)\s*\.\s*send\s*\(\s*(?:["']([^"']+)["']|([A-Za-z_][\w.]*))/g;
|
|
16
23
|
while ((match = producerRegex.exec(fileContent)) !== null) {
|
|
17
|
-
topicsProduced.push(match[
|
|
24
|
+
topicsProduced.push(match[2] || match[3]);
|
|
18
25
|
}
|
|
19
26
|
if (topicsConsumed.length === 0 && topicsProduced.length === 0) {
|
|
20
27
|
return events;
|