@hiveai/mcp 0.12.0 → 0.12.1

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
@@ -1497,6 +1497,7 @@ import {
1497
1497
  loadMemoriesFromDir as loadMemoriesFromDir14,
1498
1498
  loadUsageIndex as loadUsageIndex8,
1499
1499
  memoryMatchesAnchorPaths as memoryMatchesAnchorPaths2,
1500
+ rankMemoriesLexical as rankMemoriesLexical2,
1500
1501
  queryCodeMap,
1501
1502
  resolveBriefingBudget,
1502
1503
  serializeMemory as serializeMemory9,
@@ -1816,13 +1817,25 @@ async function getBriefing(input, ctx) {
1816
1817
  }
1817
1818
  if (act.applicable && act.activated) activatedSkills.add(id);
1818
1819
  }
1820
+ const lexNorm = /* @__PURE__ */ new Map();
1821
+ if (input.task) {
1822
+ const candidates = [...seen.keys()].map((id) => byId.get(id)).filter((x) => Boolean(x));
1823
+ const lex = rankMemoriesLexical2(candidates, input.task, candidates.length);
1824
+ const maxScore = lex.scores.reduce((m, s) => s > m ? s : m, 0);
1825
+ if (maxScore > 0) {
1826
+ lex.ranked.forEach((loaded, i) => {
1827
+ lexNorm.set(loaded.memory.frontmatter.id, (lex.scores[i] ?? 0) / maxScore);
1828
+ });
1829
+ }
1830
+ }
1819
1831
  const ranked = [...seen.values()].sort((a, b) => {
1820
1832
  const reasonScore = (m) => (m.type === "attempt" ? 3 : 0) + (m.reasons.includes("anchor") ? 4 : 0) + (m.reasons.includes("symbol") ? 4 : 0) + (m.reasons.includes("module") ? 2 : 0) + (m.reasons.includes("semantic") ? 2 : 0) + (m.reasons.includes("domain") ? 1 : 0);
1821
1833
  const confidenceScore = (m) => m.confidence === "authoritative" ? 4 : m.confidence === "trusted" ? 3 : m.confidence === "low" ? 1 : m.confidence === "stale" ? -2 : 0;
1822
1834
  const impactScore = (m) => (m.impact_score ?? 0) * 3;
1823
1835
  const activationBoost = (m) => activatedSkills.has(m.id) ? 5 : 0;
1824
- const sa = priorityRank(classifyMemoryPriority(a, byId.get(a.id), input.files, input.symbols)) * 100 + reasonScore(a) + confidenceScore(a) + impactScore(a) + activationBoost(a) + (a.semantic_score ?? 0);
1825
- const sb = priorityRank(classifyMemoryPriority(b, byId.get(b.id), input.files, input.symbols)) * 100 + reasonScore(b) + confidenceScore(b) + impactScore(b) + activationBoost(b) + (b.semantic_score ?? 0);
1836
+ const lexScore = (m) => 12 * (lexNorm.get(m.id) ?? 0);
1837
+ const sa = priorityRank(classifyMemoryPriority(a, byId.get(a.id), input.files, input.symbols)) * 100 + reasonScore(a) + confidenceScore(a) + impactScore(a) + activationBoost(a) + lexScore(a) + (a.semantic_score ?? 0);
1838
+ const sb = priorityRank(classifyMemoryPriority(b, byId.get(b.id), input.files, input.symbols)) * 100 + reasonScore(b) + confidenceScore(b) + impactScore(b) + activationBoost(b) + lexScore(b) + (b.semantic_score ?? 0);
1826
1839
  return sb - sa;
1827
1840
  });
1828
1841
  for (const mem of ranked.slice(0, briefingMaxMemories)) {
@@ -4006,7 +4019,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
4006
4019
  // src/server.ts
4007
4020
  import { hasRecentBriefingMarker, loadConfigSync } from "@hiveai/core";
4008
4021
  var SERVER_NAME = "haive";
4009
- var SERVER_VERSION = "0.12.0";
4022
+ var SERVER_VERSION = "0.12.1";
4010
4023
  function jsonResult(data) {
4011
4024
  return {
4012
4025
  content: [