@hiveai/mcp 0.13.7 → 0.13.9
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 +20 -1
- package/dist/index.js.map +1 -1
- package/dist/server.js +20 -1
- package/dist/server.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2620,6 +2620,7 @@ function runCommand(cmd, args, cwd) {
|
|
|
2620
2620
|
import { existsSync as existsSync25 } from "fs";
|
|
2621
2621
|
import {
|
|
2622
2622
|
addedLinesFromDiff,
|
|
2623
|
+
appendPreventionEvent,
|
|
2623
2624
|
buildDocFrequency,
|
|
2624
2625
|
CODE_STOPWORDS,
|
|
2625
2626
|
deriveConfidence as deriveConfidence6,
|
|
@@ -2630,7 +2631,9 @@ import {
|
|
|
2630
2631
|
loadUsageIndex as loadUsageIndex10,
|
|
2631
2632
|
literalMatchesAnyToken as literalMatchesAnyToken3,
|
|
2632
2633
|
memoryMatchesAnchorPaths as memoryMatchesAnchorPaths4,
|
|
2634
|
+
recordPrevention,
|
|
2633
2635
|
runSensors,
|
|
2636
|
+
saveUsageIndex as saveUsageIndex4,
|
|
2634
2637
|
sensorTargetsFromDiff,
|
|
2635
2638
|
tokenizeQuery as tokenizeQuery3
|
|
2636
2639
|
} from "@hiveai/core";
|
|
@@ -2771,6 +2774,22 @@ async function antiPatternsCheck(input, ctx) {
|
|
|
2771
2774
|
};
|
|
2772
2775
|
return score(b) - score(a);
|
|
2773
2776
|
}).slice(0, input.limit);
|
|
2777
|
+
const strongCatches = warnings.filter(
|
|
2778
|
+
(w) => w.reasons.includes("sensor") || w.distinctive_literal === true || w.reasons.includes("anchor") && w.reasons.includes("literal")
|
|
2779
|
+
);
|
|
2780
|
+
if (strongCatches.length > 0) {
|
|
2781
|
+
const recordedIds = [];
|
|
2782
|
+
for (const w of strongCatches) if (recordPrevention(usage, w.id)) recordedIds.push(w.id);
|
|
2783
|
+
if (recordedIds.length > 0) {
|
|
2784
|
+
await saveUsageIndex4(ctx.paths, usage).catch(() => {
|
|
2785
|
+
});
|
|
2786
|
+
const at = (/* @__PURE__ */ new Date()).toISOString();
|
|
2787
|
+
for (const id of recordedIds) {
|
|
2788
|
+
await appendPreventionEvent(ctx.paths, { at, id, source: "anti-pattern" }).catch(() => {
|
|
2789
|
+
});
|
|
2790
|
+
}
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2774
2793
|
return {
|
|
2775
2794
|
scanned: negative.length,
|
|
2776
2795
|
warnings
|
|
@@ -4111,7 +4130,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
|
|
|
4111
4130
|
// src/server.ts
|
|
4112
4131
|
import { hasRecentBriefingMarker, loadConfigSync } from "@hiveai/core";
|
|
4113
4132
|
var SERVER_NAME = "haive";
|
|
4114
|
-
var SERVER_VERSION = "0.13.
|
|
4133
|
+
var SERVER_VERSION = "0.13.9";
|
|
4115
4134
|
function jsonResult(data) {
|
|
4116
4135
|
return {
|
|
4117
4136
|
content: [
|