@hiveai/cli 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
@@ -2743,7 +2743,7 @@ ${SEED_FOOTER(stack)}` });
2743
2743
  }
2744
2744
 
2745
2745
  // src/commands/init.ts
2746
- var HAIVE_GITHUB_ACTION_REF = `v${"0.12.0"}`;
2746
+ var HAIVE_GITHUB_ACTION_REF = `v${"0.12.1"}`;
2747
2747
  var PROJECT_CONTEXT_TEMPLATE = `# Project context
2748
2748
 
2749
2749
  > Generated by \`haive init\`. Run \`haive init --bootstrap\` to auto-fill from your codebase,
@@ -3782,6 +3782,7 @@ import {
3782
3782
  loadMemoriesFromDir as loadMemoriesFromDir14,
3783
3783
  loadUsageIndex as loadUsageIndex8,
3784
3784
  memoryMatchesAnchorPaths as memoryMatchesAnchorPaths22,
3785
+ rankMemoriesLexical as rankMemoriesLexical2,
3785
3786
  queryCodeMap as queryCodeMap2,
3786
3787
  resolveBriefingBudget as resolveBriefingBudget2,
3787
3788
  serializeMemory as serializeMemory9,
@@ -5472,13 +5473,25 @@ async function getBriefing(input, ctx) {
5472
5473
  }
5473
5474
  if (act.applicable && act.activated) activatedSkills.add(id);
5474
5475
  }
5476
+ const lexNorm = /* @__PURE__ */ new Map();
5477
+ if (input.task) {
5478
+ const candidates = [...seen.keys()].map((id) => byId.get(id)).filter((x) => Boolean(x));
5479
+ const lex = rankMemoriesLexical2(candidates, input.task, candidates.length);
5480
+ const maxScore = lex.scores.reduce((m, s) => s > m ? s : m, 0);
5481
+ if (maxScore > 0) {
5482
+ lex.ranked.forEach((loaded, i) => {
5483
+ lexNorm.set(loaded.memory.frontmatter.id, (lex.scores[i] ?? 0) / maxScore);
5484
+ });
5485
+ }
5486
+ }
5475
5487
  const ranked = [...seen.values()].sort((a, b) => {
5476
5488
  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);
5477
5489
  const confidenceScore = (m) => m.confidence === "authoritative" ? 4 : m.confidence === "trusted" ? 3 : m.confidence === "low" ? 1 : m.confidence === "stale" ? -2 : 0;
5478
5490
  const impactScore = (m) => (m.impact_score ?? 0) * 3;
5479
5491
  const activationBoost = (m) => activatedSkills.has(m.id) ? 5 : 0;
5480
- 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);
5481
- 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);
5492
+ const lexScore = (m) => 12 * (lexNorm.get(m.id) ?? 0);
5493
+ 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);
5494
+ 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);
5482
5495
  return sb - sa;
5483
5496
  });
5484
5497
  for (const mem of ranked.slice(0, briefingMaxMemories)) {
@@ -7518,7 +7531,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
7518
7531
  };
7519
7532
  }
7520
7533
  var SERVER_NAME = "haive";
7521
- var SERVER_VERSION = "0.12.0";
7534
+ var SERVER_VERSION = "0.12.1";
7522
7535
  function jsonResult(data) {
7523
7536
  return {
7524
7537
  content: [
@@ -12969,14 +12982,14 @@ function registerDoctor(program2) {
12969
12982
  fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `haive init` without --manual)."
12970
12983
  });
12971
12984
  }
12972
- findings.push(...await collectInstallFindings(root, "0.12.0"));
12985
+ findings.push(...await collectInstallFindings(root, "0.12.1"));
12973
12986
  try {
12974
12987
  const legacyRaw = execSync3("haive-mcp --version", {
12975
12988
  encoding: "utf8",
12976
12989
  timeout: 3e3,
12977
12990
  stdio: ["ignore", "pipe", "ignore"]
12978
12991
  }).trim();
12979
- const cliVersion = "0.12.0";
12992
+ const cliVersion = "0.12.1";
12980
12993
  if (legacyRaw && legacyRaw !== cliVersion) {
12981
12994
  findings.push({
12982
12995
  severity: "warn",
@@ -14477,7 +14490,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
14477
14490
  findings: [{ severity: "info", code: "enforcement-off", message: "hAIve enforcement is disabled." }]
14478
14491
  });
14479
14492
  }
14480
- findings.push(...await inspectIntegrationVersions(root, "0.12.0"));
14493
+ findings.push(...await inspectIntegrationVersions(root, "0.12.1"));
14481
14494
  if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
14482
14495
  const hasBriefing = await hasRecentBriefingMarker2(paths, sessionId);
14483
14496
  findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent hAIve briefing marker exists." } : {
@@ -15476,7 +15489,7 @@ function shellQuote(value) {
15476
15489
 
15477
15490
  // src/index.ts
15478
15491
  var program = new Command56();
15479
- program.name("haive").description("hAIve - repo-native memory and context policy for coding-agent harnesses").version("0.12.0").option("--advanced", "show maintenance and experimental commands in help");
15492
+ program.name("haive").description("hAIve - repo-native memory and context policy for coding-agent harnesses").version("0.12.1").option("--advanced", "show maintenance and experimental commands in help");
15480
15493
  registerInit(program);
15481
15494
  registerWelcome(program);
15482
15495
  registerResolveProject(program);