@swarmvaultai/engine 0.1.8 → 0.1.10
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/index.js +21 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1409,6 +1409,21 @@ import path9 from "path";
|
|
|
1409
1409
|
import matter2 from "gray-matter";
|
|
1410
1410
|
import { z as z4 } from "zod";
|
|
1411
1411
|
|
|
1412
|
+
// src/findings.ts
|
|
1413
|
+
function normalizeFindingSeverity(value) {
|
|
1414
|
+
if (typeof value !== "string") {
|
|
1415
|
+
return "info";
|
|
1416
|
+
}
|
|
1417
|
+
const normalized = value.trim().toLowerCase();
|
|
1418
|
+
if (normalized === "error" || normalized === "critical" || normalized === "fatal" || normalized === "high" || normalized === "severe") {
|
|
1419
|
+
return "error";
|
|
1420
|
+
}
|
|
1421
|
+
if (normalized === "warning" || normalized === "warn" || normalized === "medium" || normalized === "moderate" || normalized === "caution") {
|
|
1422
|
+
return "warning";
|
|
1423
|
+
}
|
|
1424
|
+
return "info";
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1412
1427
|
// src/orchestration.ts
|
|
1413
1428
|
import { spawn } from "child_process";
|
|
1414
1429
|
import path7 from "path";
|
|
@@ -1417,7 +1432,7 @@ var orchestrationRoleResultSchema = z2.object({
|
|
|
1417
1432
|
summary: z2.string().optional(),
|
|
1418
1433
|
findings: z2.array(
|
|
1419
1434
|
z2.object({
|
|
1420
|
-
severity: z2.
|
|
1435
|
+
severity: z2.string().optional().default("info"),
|
|
1421
1436
|
message: z2.string().min(1),
|
|
1422
1437
|
relatedPageIds: z2.array(z2.string()).optional(),
|
|
1423
1438
|
relatedSourceIds: z2.array(z2.string()).optional(),
|
|
@@ -1497,7 +1512,7 @@ async function runProviderRole(rootDir, role, roleConfig, input) {
|
|
|
1497
1512
|
return {
|
|
1498
1513
|
role,
|
|
1499
1514
|
summary: result.summary,
|
|
1500
|
-
findings: result.findings.map((finding) => ({ role, ...finding })),
|
|
1515
|
+
findings: result.findings.map((finding) => ({ role, ...finding, severity: normalizeFindingSeverity(finding.severity) })),
|
|
1501
1516
|
questions: result.questions,
|
|
1502
1517
|
proposals: result.proposals
|
|
1503
1518
|
};
|
|
@@ -1549,7 +1564,7 @@ async function runCommandRole(rootDir, role, executor, input) {
|
|
|
1549
1564
|
return {
|
|
1550
1565
|
role,
|
|
1551
1566
|
summary: parsed.summary,
|
|
1552
|
-
findings: parsed.findings.map((finding) => ({ role, ...finding })),
|
|
1567
|
+
findings: parsed.findings.map((finding) => ({ role, ...finding, severity: normalizeFindingSeverity(finding.severity) })),
|
|
1553
1568
|
questions: parsed.questions,
|
|
1554
1569
|
proposals: parsed.proposals
|
|
1555
1570
|
};
|
|
@@ -1723,7 +1738,7 @@ async function getWebSearchAdapterForTask(rootDir, task) {
|
|
|
1723
1738
|
var deepLintResponseSchema = z4.object({
|
|
1724
1739
|
findings: z4.array(
|
|
1725
1740
|
z4.object({
|
|
1726
|
-
severity: z4.
|
|
1741
|
+
severity: z4.string().optional().default("info"),
|
|
1727
1742
|
code: z4.enum(["coverage_gap", "contradiction_candidate", "missing_citation", "candidate_page", "follow_up_question"]),
|
|
1728
1743
|
message: z4.string().min(1),
|
|
1729
1744
|
relatedSourceIds: z4.array(z4.string()).default([]),
|
|
@@ -1895,7 +1910,7 @@ async function runDeepLint(rootDir, structuralFindings, options = {}) {
|
|
|
1895
1910
|
deepLintResponseSchema
|
|
1896
1911
|
);
|
|
1897
1912
|
findings = response.findings.map((item) => ({
|
|
1898
|
-
severity: item.severity,
|
|
1913
|
+
severity: normalizeFindingSeverity(item.severity),
|
|
1899
1914
|
code: item.code,
|
|
1900
1915
|
message: item.message,
|
|
1901
1916
|
relatedSourceIds: item.relatedSourceIds,
|
|
@@ -6514,7 +6529,7 @@ async function bootstrapDemo(rootDir, input) {
|
|
|
6514
6529
|
}
|
|
6515
6530
|
|
|
6516
6531
|
// src/mcp.ts
|
|
6517
|
-
var SERVER_VERSION = "0.1.
|
|
6532
|
+
var SERVER_VERSION = "0.1.10";
|
|
6518
6533
|
async function createMcpServer(rootDir) {
|
|
6519
6534
|
const server = new McpServer({
|
|
6520
6535
|
name: "swarmvault",
|