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