@hiveai/mcp 0.9.27 → 0.9.28

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.d.ts CHANGED
@@ -358,6 +358,10 @@ interface AntiPatternsWarning {
358
358
  body_preview: string;
359
359
  reasons: Array<"anchor" | "literal" | "semantic">;
360
360
  semantic_score?: number;
361
+ /** Memory tags — used downstream (e.g. pre_commit_check) to weight a warning by topic. */
362
+ tags?: string[];
363
+ /** Anchor paths of the memory — lets the gate tell what kind of file this warning is about. */
364
+ anchor_paths?: string[];
361
365
  }
362
366
  interface AntiPatternsCheckOutput {
363
367
  /** Total number of attempt+gotcha memories that exist in this project. */
package/dist/server.js CHANGED
@@ -1400,6 +1400,7 @@ import {
1400
1400
  isGlobPath,
1401
1401
  isAutoPromoteEligible,
1402
1402
  isDecaying,
1403
+ isStackPackSeed,
1403
1404
  literalMatchesAllTokens as literalMatchesAllTokens2,
1404
1405
  literalMatchesAnyToken as literalMatchesAnyToken2,
1405
1406
  loadCodeMap,
@@ -1413,7 +1414,8 @@ import {
1413
1414
  serializeMemory as serializeMemory9,
1414
1415
  tokenizeQuery as tokenizeQuery2,
1415
1416
  trackReads as trackReads3,
1416
- truncateToTokens
1417
+ truncateToTokens,
1418
+ writeBriefingMarker
1417
1419
  } from "@hiveai/core";
1418
1420
  import { z as z17 } from "zod";
1419
1421
  var GetBriefingInputSchema = {
@@ -1867,6 +1869,16 @@ When done, call \`mem_session_end\` to acknowledge \u2014 this clears the pendin
1867
1869
  );
1868
1870
  }
1869
1871
  }
1872
+ if (existsSync18(ctx.paths.haiveDir)) {
1873
+ await writeBriefingMarker(ctx.paths, {
1874
+ sessionId: process.env.HAIVE_SESSION_ID,
1875
+ ...input.task ? { task: input.task } : {},
1876
+ source: "mcp-get-briefing",
1877
+ files: input.files,
1878
+ memoryIds: outputMemories.map((m) => m.id)
1879
+ }).catch(() => {
1880
+ });
1881
+ }
1870
1882
  return {
1871
1883
  ...input.task ? { task: input.task } : {},
1872
1884
  search_mode: searchMode,
@@ -1921,6 +1933,9 @@ function classifyMemoryPriority(memory, loaded, inputFiles, inputSymbols) {
1921
1933
  if (fm?.requires_human_approval || directAnchor || directSymbol || memory.type === "attempt" && (memory.match_quality === "exact" || strongSemantic) || memory.type === "skill" && (memory.match_quality === "exact" || strongSemantic)) {
1922
1934
  return "must_read";
1923
1935
  }
1936
+ if (isStackPackSeed(fm)) {
1937
+ return "background";
1938
+ }
1924
1939
  if (memory.type === "skill" || memory.reasons.includes("module") || memory.reasons.includes("domain") || memory.match_quality === "exact" || usefulSemantic) {
1925
1940
  return "useful";
1926
1941
  }
@@ -2450,6 +2465,8 @@ async function antiPatternsCheck(input, ctx) {
2450
2465
  confidence: deriveConfidence6(fm, u),
2451
2466
  body_preview: body.split("\n").slice(0, 5).join("\n").slice(0, 400),
2452
2467
  reasons: [reason],
2468
+ tags: fm.tags ?? [],
2469
+ anchor_paths: fm.anchor?.paths ?? [],
2453
2470
  ...score !== void 0 ? { semantic_score: score } : {}
2454
2471
  });
2455
2472
  };
@@ -3075,8 +3092,45 @@ function fileTypeDowngradeReason(warning, paths) {
3075
3092
  if (configOnly && !warning.reasons.includes("anchor") && !hasStrongSemantic(warning)) {
3076
3093
  return "package/config-only change; warning has no anchor on these files and no strong semantic match \u2014 downgraded to info.";
3077
3094
  }
3095
+ const touchesBuildFile = paths.some(isPackageOrConfigPath);
3096
+ if (!touchesBuildFile && isBuildScopedWarning(warning) && !warning.reasons.includes("anchor") && !hasStrongSemantic(warning)) {
3097
+ return "build/packaging gotcha, but no package/build file changed \u2014 downgraded to info.";
3098
+ }
3078
3099
  return null;
3079
3100
  }
3101
+ function isBuildScopedWarning(warning) {
3102
+ const tags = warning.tags ?? [];
3103
+ if (tags.some((t) => BUILD_SCOPED_TAGS.has(t.toLowerCase()))) return true;
3104
+ const anchors = warning.anchor_paths ?? [];
3105
+ return anchors.length > 0 && anchors.every(isPackageOrConfigPath);
3106
+ }
3107
+ var BUILD_SCOPED_TAGS = /* @__PURE__ */ new Set([
3108
+ "npm",
3109
+ "pnpm",
3110
+ "yarn",
3111
+ "publish",
3112
+ "install",
3113
+ "packaging",
3114
+ "package",
3115
+ "build",
3116
+ "tsup",
3117
+ "bundler",
3118
+ "monorepo",
3119
+ "workspace",
3120
+ "versioning",
3121
+ "version",
3122
+ "dev-workflow",
3123
+ "hotswap",
3124
+ "ci",
3125
+ "workflow",
3126
+ "release",
3127
+ "changelog",
3128
+ "dependencies",
3129
+ "deps",
3130
+ "dependency",
3131
+ "tooling",
3132
+ "config"
3133
+ ]);
3080
3134
  function hasStrongSemantic(warning) {
3081
3135
  return warning.reasons.includes("semantic") && (warning.semantic_score ?? 0) >= 0.65;
3082
3136
  }
@@ -3707,7 +3761,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
3707
3761
  // src/server.ts
3708
3762
  import { loadConfigSync } from "@hiveai/core";
3709
3763
  var SERVER_NAME = "haive";
3710
- var SERVER_VERSION = "0.9.27";
3764
+ var SERVER_VERSION = "0.9.28";
3711
3765
  function jsonResult(data) {
3712
3766
  return {
3713
3767
  content: [