@hiveai/mcp 0.10.1 → 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/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @hiveai/mcp
2
2
 
3
- > **hAIve MCP server** policy-aware briefing and memory tools for MCP-compatible AI coding agents.
3
+ > **hAIve MCP server** - policy-aware briefing and memory tools for MCP-compatible coding-agent harnesses.
4
4
 
5
- The MCP server is how agents load team policy before changing code. By default it exposes a small enforcement-oriented tool surface: briefing, relevant memories, failed-attempt capture, anchor verification, code-map lookup, and pre-commit checks. Larger maintenance and experimental surfaces are opt-in via `HAIVE_TOOL_PROFILE`.
5
+ The MCP server is how agents load team policy before changing code. By default it exposes a small harness-oriented tool surface: briefing, relevant memories, failed-attempt capture, anchor verification, code-map lookup, and pre-commit checks. Larger maintenance and experimental surfaces are opt-in via `HAIVE_TOOL_PROFILE`.
6
6
 
7
- hAIve is not just a memory database. The MCP layer participates in enforcement: state-changing hAIve tools require `get_briefing` or `mem_relevant_to` first, so agents cannot silently skip team context while using hAIve.
7
+ hAIve is not just a memory database. The MCP layer participates in context policy: state-changing hAIve tools require `get_briefing` or `mem_relevant_to` first, so agents cannot silently skip team context while using hAIve.
8
8
 
9
9
  ---
10
10
 
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.1";
3903
+ var SERVER_VERSION = "0.10.3";
3878
3904
  function jsonResult(data) {
3879
3905
  return {
3880
3906
  content: [