@hiveai/mcp 0.9.26 → 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/index.js CHANGED
@@ -1223,7 +1223,8 @@ var SessionTracker = class {
1223
1223
  const ranPostTask = this.events.some(
1224
1224
  (e) => e.tool === "mem_session_end" && !e.summary?.startsWith("Auto-captured")
1225
1225
  );
1226
- if (!ranPostTask && existsSync16(this.ctx.paths.haiveDir)) {
1226
+ const isSubstantialSession = totalCalls >= 3 || writingTools.length > 0;
1227
+ if (!ranPostTask && isSubstantialSession && existsSync16(this.ctx.paths.haiveDir)) {
1227
1228
  try {
1228
1229
  const memoriesSaved = writingTools.map((e) => e.summary ?? "").filter(Boolean).slice(0, 20);
1229
1230
  const payload = {
@@ -1401,6 +1402,7 @@ import {
1401
1402
  isGlobPath,
1402
1403
  isAutoPromoteEligible,
1403
1404
  isDecaying,
1405
+ isStackPackSeed,
1404
1406
  literalMatchesAllTokens as literalMatchesAllTokens2,
1405
1407
  literalMatchesAnyToken as literalMatchesAnyToken2,
1406
1408
  loadCodeMap,
@@ -1414,7 +1416,8 @@ import {
1414
1416
  serializeMemory as serializeMemory9,
1415
1417
  tokenizeQuery as tokenizeQuery2,
1416
1418
  trackReads as trackReads3,
1417
- truncateToTokens
1419
+ truncateToTokens,
1420
+ writeBriefingMarker
1418
1421
  } from "@hiveai/core";
1419
1422
  import { z as z17 } from "zod";
1420
1423
  var GetBriefingInputSchema = {
@@ -1868,6 +1871,16 @@ When done, call \`mem_session_end\` to acknowledge \u2014 this clears the pendin
1868
1871
  );
1869
1872
  }
1870
1873
  }
1874
+ if (existsSync18(ctx.paths.haiveDir)) {
1875
+ await writeBriefingMarker(ctx.paths, {
1876
+ sessionId: process.env.HAIVE_SESSION_ID,
1877
+ ...input.task ? { task: input.task } : {},
1878
+ source: "mcp-get-briefing",
1879
+ files: input.files,
1880
+ memoryIds: outputMemories.map((m) => m.id)
1881
+ }).catch(() => {
1882
+ });
1883
+ }
1871
1884
  return {
1872
1885
  ...input.task ? { task: input.task } : {},
1873
1886
  search_mode: searchMode,
@@ -1922,6 +1935,9 @@ function classifyMemoryPriority(memory, loaded, inputFiles, inputSymbols) {
1922
1935
  if (fm?.requires_human_approval || directAnchor || directSymbol || memory.type === "attempt" && (memory.match_quality === "exact" || strongSemantic) || memory.type === "skill" && (memory.match_quality === "exact" || strongSemantic)) {
1923
1936
  return "must_read";
1924
1937
  }
1938
+ if (isStackPackSeed(fm)) {
1939
+ return "background";
1940
+ }
1925
1941
  if (memory.type === "skill" || memory.reasons.includes("module") || memory.reasons.includes("domain") || memory.match_quality === "exact" || usefulSemantic) {
1926
1942
  return "useful";
1927
1943
  }
@@ -2451,6 +2467,8 @@ async function antiPatternsCheck(input, ctx) {
2451
2467
  confidence: deriveConfidence6(fm, u),
2452
2468
  body_preview: body.split("\n").slice(0, 5).join("\n").slice(0, 400),
2453
2469
  reasons: [reason],
2470
+ tags: fm.tags ?? [],
2471
+ anchor_paths: fm.anchor?.paths ?? [],
2454
2472
  ...score !== void 0 ? { semantic_score: score } : {}
2455
2473
  });
2456
2474
  };
@@ -3076,8 +3094,45 @@ function fileTypeDowngradeReason(warning, paths) {
3076
3094
  if (configOnly && !warning.reasons.includes("anchor") && !hasStrongSemantic(warning)) {
3077
3095
  return "package/config-only change; warning has no anchor on these files and no strong semantic match \u2014 downgraded to info.";
3078
3096
  }
3097
+ const touchesBuildFile = paths.some(isPackageOrConfigPath);
3098
+ if (!touchesBuildFile && isBuildScopedWarning(warning) && !warning.reasons.includes("anchor") && !hasStrongSemantic(warning)) {
3099
+ return "build/packaging gotcha, but no package/build file changed \u2014 downgraded to info.";
3100
+ }
3079
3101
  return null;
3080
3102
  }
3103
+ function isBuildScopedWarning(warning) {
3104
+ const tags = warning.tags ?? [];
3105
+ if (tags.some((t) => BUILD_SCOPED_TAGS.has(t.toLowerCase()))) return true;
3106
+ const anchors = warning.anchor_paths ?? [];
3107
+ return anchors.length > 0 && anchors.every(isPackageOrConfigPath);
3108
+ }
3109
+ var BUILD_SCOPED_TAGS = /* @__PURE__ */ new Set([
3110
+ "npm",
3111
+ "pnpm",
3112
+ "yarn",
3113
+ "publish",
3114
+ "install",
3115
+ "packaging",
3116
+ "package",
3117
+ "build",
3118
+ "tsup",
3119
+ "bundler",
3120
+ "monorepo",
3121
+ "workspace",
3122
+ "versioning",
3123
+ "version",
3124
+ "dev-workflow",
3125
+ "hotswap",
3126
+ "ci",
3127
+ "workflow",
3128
+ "release",
3129
+ "changelog",
3130
+ "dependencies",
3131
+ "deps",
3132
+ "dependency",
3133
+ "tooling",
3134
+ "config"
3135
+ ]);
3081
3136
  function hasStrongSemantic(warning) {
3082
3137
  return warning.reasons.includes("semantic") && (warning.semantic_score ?? 0) >= 0.65;
3083
3138
  }
@@ -3088,9 +3143,36 @@ function isDocLikePath(file) {
3088
3143
  function isPackageOrConfigPath(file) {
3089
3144
  const lower = file.toLowerCase();
3090
3145
  const base = lower.split("/").pop() ?? lower;
3091
- return lower.endsWith("package.json") || lower.endsWith("package-lock.json") || lower.endsWith("pnpm-lock.yaml") || lower.endsWith("yarn.lock") || lower.endsWith("bun.lockb") || lower.endsWith(".config.ts") || lower.endsWith(".config.js") || lower.endsWith(".json") || lower.endsWith(".yml") || lower.endsWith(".yaml") || lower.endsWith(".toml") || lower.startsWith(".github/workflows/") || lower.startsWith(".github/") && lower.endsWith(".yml") || // Dotfiles that are pure configuration/tooling — never trigger runtime gotchas
3146
+ return lower.endsWith("package.json") || lower.endsWith("package-lock.json") || lower.endsWith("pnpm-lock.yaml") || lower.endsWith("yarn.lock") || lower.endsWith("bun.lockb") || lower.endsWith(".config.ts") || lower.endsWith(".config.js") || isJsonConfigFile(base) || lower.endsWith(".yml") || lower.endsWith(".yaml") || lower.endsWith(".toml") || lower.startsWith(".github/workflows/") || lower.startsWith(".github/") && lower.endsWith(".yml") || // Dotfiles that are pure configuration/tooling — never trigger runtime gotchas
3092
3147
  base === ".gitignore" || base === ".gitattributes" || base === ".gitmodules" || base === ".editorconfig" || base === ".nvmrc" || base === ".node-version" || base === ".npmrc" || base === ".yarnrc" || base === ".yarnrc.yml" || base === ".dockerignore" || base === "dockerfile" || base.startsWith("dockerfile.") || base === ".env.example" || base === ".env.template" || lower.endsWith(".prettierrc") || lower.endsWith(".eslintrc") || lower.endsWith(".eslintignore") || lower.endsWith(".prettierignore") || lower.endsWith(".stylelintrc") || lower.endsWith(".browserslistrc");
3093
3148
  }
3149
+ function isJsonConfigFile(base) {
3150
+ const knownConfigs = /* @__PURE__ */ new Set([
3151
+ "tsconfig.json",
3152
+ "jsconfig.json",
3153
+ "deno.json",
3154
+ "deno.jsonc",
3155
+ "nx.json",
3156
+ "turbo.json",
3157
+ "lerna.json",
3158
+ "rush.json",
3159
+ "jest.config.json",
3160
+ "vitest.config.json",
3161
+ "babel.config.json",
3162
+ ".babelrc.json",
3163
+ ".swcrc",
3164
+ ".mocharc.json",
3165
+ "renovate.json",
3166
+ "dependabot.json",
3167
+ ".prettierrc.json",
3168
+ ".eslintrc.json",
3169
+ ".stylelintrc.json"
3170
+ ]);
3171
+ if (knownConfigs.has(base)) return true;
3172
+ if (/^tsconfig\..+\.json$/.test(base)) return true;
3173
+ if (/^\.[a-z]+rc\.json$/.test(base)) return true;
3174
+ return false;
3175
+ }
3094
3176
  function repairCommandForWarning(warning, paths) {
3095
3177
  const firstPath = paths[0];
3096
3178
  return firstPath ? `haive briefing --files "${firstPath}" --task "review ${warning.id}"` : `haive memory show ${warning.id}`;
@@ -3681,7 +3763,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
3681
3763
  // src/server.ts
3682
3764
  import { loadConfigSync } from "@hiveai/core";
3683
3765
  var SERVER_NAME = "haive";
3684
- var SERVER_VERSION = "0.9.26";
3766
+ var SERVER_VERSION = "0.9.28";
3685
3767
  function jsonResult(data) {
3686
3768
  return {
3687
3769
  content: [