@hiveai/mcp 0.10.2 → 0.10.3
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 +28 -2
- package/dist/index.js.map +1 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +28 -2
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2443,6 +2443,7 @@ function runCommand(cmd, args, cwd) {
|
|
|
2443
2443
|
// src/tools/anti-patterns-check.ts
|
|
2444
2444
|
import { existsSync as existsSync22 } from "fs";
|
|
2445
2445
|
import {
|
|
2446
|
+
addedLinesFromDiff,
|
|
2446
2447
|
deriveConfidence as deriveConfidence6,
|
|
2447
2448
|
getUsage as getUsage7,
|
|
2448
2449
|
isRetiredMemory as isRetiredMemory2,
|
|
@@ -2450,6 +2451,8 @@ import {
|
|
|
2450
2451
|
loadUsageIndex as loadUsageIndex9,
|
|
2451
2452
|
literalMatchesAnyToken as literalMatchesAnyToken3,
|
|
2452
2453
|
memoryMatchesAnchorPaths as memoryMatchesAnchorPaths4,
|
|
2454
|
+
runRegexSensor,
|
|
2455
|
+
sensorAppliesToPath,
|
|
2453
2456
|
tokenizeQuery as tokenizeQuery3
|
|
2454
2457
|
} from "@hiveai/core";
|
|
2455
2458
|
import { z as z24 } from "zod";
|
|
@@ -2587,6 +2590,29 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
2587
2590
|
}
|
|
2588
2591
|
}
|
|
2589
2592
|
}
|
|
2593
|
+
if (input.diff) {
|
|
2594
|
+
const added = addedLinesFromDiff(input.diff);
|
|
2595
|
+
const scanText = added.trim().length > 0 ? added : input.diff;
|
|
2596
|
+
for (const { memory } of negative) {
|
|
2597
|
+
const sensor = memory.frontmatter.sensor;
|
|
2598
|
+
if (!sensor || sensor.kind !== "regex") continue;
|
|
2599
|
+
const anchorPaths = memory.frontmatter.anchor.paths;
|
|
2600
|
+
const inScope = input.paths.length === 0 || input.paths.some((p) => sensorAppliesToPath(sensor, anchorPaths, p));
|
|
2601
|
+
if (!inScope) continue;
|
|
2602
|
+
const hit = runRegexSensor(memory.frontmatter.id, sensor, {
|
|
2603
|
+
path: input.paths[0] ?? "",
|
|
2604
|
+
content: scanText
|
|
2605
|
+
});
|
|
2606
|
+
if (hit) {
|
|
2607
|
+
upsert(memory.frontmatter, memory.body, "sensor");
|
|
2608
|
+
const w = seen.get(memory.frontmatter.id);
|
|
2609
|
+
if (w) {
|
|
2610
|
+
w.sensor_message = hit.message;
|
|
2611
|
+
w.sensor_severity = hit.severity;
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
}
|
|
2615
|
+
}
|
|
2590
2616
|
if (input.semantic && input.diff) {
|
|
2591
2617
|
try {
|
|
2592
2618
|
const mod = await import("@hiveai/embeddings");
|
|
@@ -2605,7 +2631,7 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
2605
2631
|
}
|
|
2606
2632
|
const warnings = [...seen.values()].sort((a, b) => {
|
|
2607
2633
|
const score = (w) => {
|
|
2608
|
-
const reasonW = (w.reasons.includes("anchor") ? 4 : 0) + (w.reasons.includes("literal") ? 2 : 0) + (w.reasons.includes("semantic") ? 1 : 0);
|
|
2634
|
+
const reasonW = (w.reasons.includes("sensor") ? 8 : 0) + (w.reasons.includes("anchor") ? 4 : 0) + (w.reasons.includes("literal") ? 2 : 0) + (w.reasons.includes("semantic") ? 1 : 0);
|
|
2609
2635
|
const confW = w.confidence === "authoritative" ? 3 : w.confidence === "trusted" ? 2 : w.confidence === "low" ? 1 : 0;
|
|
2610
2636
|
return reasonW + confW + (w.semantic_score ?? 0);
|
|
2611
2637
|
};
|
|
@@ -3874,7 +3900,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
3874
3900
|
// src/server.ts
|
|
3875
3901
|
import { loadConfigSync } from "@hiveai/core";
|
|
3876
3902
|
var SERVER_NAME = "haive";
|
|
3877
|
-
var SERVER_VERSION = "0.10.
|
|
3903
|
+
var SERVER_VERSION = "0.10.3";
|
|
3878
3904
|
function jsonResult(data) {
|
|
3879
3905
|
return {
|
|
3880
3906
|
content: [
|