@hiveai/cli 0.10.2 → 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/dist/index.js CHANGED
@@ -3803,6 +3803,7 @@ import {
3803
3803
  import { z as z23 } from "zod";
3804
3804
  import { existsSync as existsSync222 } from "fs";
3805
3805
  import {
3806
+ addedLinesFromDiff,
3806
3807
  deriveConfidence as deriveConfidence6,
3807
3808
  getUsage as getUsage7,
3808
3809
  isRetiredMemory as isRetiredMemory2,
@@ -3810,6 +3811,8 @@ import {
3810
3811
  loadUsageIndex as loadUsageIndex9,
3811
3812
  literalMatchesAnyToken as literalMatchesAnyToken3,
3812
3813
  memoryMatchesAnchorPaths as memoryMatchesAnchorPaths4,
3814
+ runRegexSensor,
3815
+ sensorAppliesToPath,
3813
3816
  tokenizeQuery as tokenizeQuery3
3814
3817
  } from "@hiveai/core";
3815
3818
  import { z as z24 } from "zod";
@@ -6192,6 +6195,29 @@ async function antiPatternsCheck(input, ctx) {
6192
6195
  }
6193
6196
  }
6194
6197
  }
6198
+ if (input.diff) {
6199
+ const added = addedLinesFromDiff(input.diff);
6200
+ const scanText = added.trim().length > 0 ? added : input.diff;
6201
+ for (const { memory: memory2 } of negative) {
6202
+ const sensor = memory2.frontmatter.sensor;
6203
+ if (!sensor || sensor.kind !== "regex") continue;
6204
+ const anchorPaths = memory2.frontmatter.anchor.paths;
6205
+ const inScope = input.paths.length === 0 || input.paths.some((p) => sensorAppliesToPath(sensor, anchorPaths, p));
6206
+ if (!inScope) continue;
6207
+ const hit = runRegexSensor(memory2.frontmatter.id, sensor, {
6208
+ path: input.paths[0] ?? "",
6209
+ content: scanText
6210
+ });
6211
+ if (hit) {
6212
+ upsert(memory2.frontmatter, memory2.body, "sensor");
6213
+ const w = seen.get(memory2.frontmatter.id);
6214
+ if (w) {
6215
+ w.sensor_message = hit.message;
6216
+ w.sensor_severity = hit.severity;
6217
+ }
6218
+ }
6219
+ }
6220
+ }
6195
6221
  if (input.semantic && input.diff) {
6196
6222
  try {
6197
6223
  const mod = await import("@hiveai/embeddings");
@@ -6210,7 +6236,7 @@ async function antiPatternsCheck(input, ctx) {
6210
6236
  }
6211
6237
  const warnings = [...seen.values()].sort((a, b) => {
6212
6238
  const score = (w) => {
6213
- const reasonW = (w.reasons.includes("anchor") ? 4 : 0) + (w.reasons.includes("literal") ? 2 : 0) + (w.reasons.includes("semantic") ? 1 : 0);
6239
+ 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);
6214
6240
  const confW = w.confidence === "authoritative" ? 3 : w.confidence === "trusted" ? 2 : w.confidence === "low" ? 1 : 0;
6215
6241
  return reasonW + confW + (w.semantic_score ?? 0);
6216
6242
  };
@@ -7389,7 +7415,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
7389
7415
  };
7390
7416
  }
7391
7417
  var SERVER_NAME = "haive";
7392
- var SERVER_VERSION = "0.10.2";
7418
+ var SERVER_VERSION = "0.10.3";
7393
7419
  function jsonResult(data) {
7394
7420
  return {
7395
7421
  content: [
@@ -12467,14 +12493,14 @@ function registerDoctor(program2) {
12467
12493
  fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `haive init` without --manual)."
12468
12494
  });
12469
12495
  }
12470
- findings.push(...await collectInstallFindings(root, "0.10.2"));
12496
+ findings.push(...await collectInstallFindings(root, "0.10.3"));
12471
12497
  try {
12472
12498
  const legacyRaw = execSync3("haive-mcp --version", {
12473
12499
  encoding: "utf8",
12474
12500
  timeout: 3e3,
12475
12501
  stdio: ["ignore", "pipe", "ignore"]
12476
12502
  }).trim();
12477
- const cliVersion = "0.10.2";
12503
+ const cliVersion = "0.10.3";
12478
12504
  if (legacyRaw && legacyRaw !== cliVersion) {
12479
12505
  findings.push({
12480
12506
  severity: "warn",
@@ -13772,7 +13798,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
13772
13798
  findings: [{ severity: "info", code: "enforcement-off", message: "hAIve enforcement is disabled." }]
13773
13799
  });
13774
13800
  }
13775
- findings.push(...await inspectIntegrationVersions(root, "0.10.2"));
13801
+ findings.push(...await inspectIntegrationVersions(root, "0.10.3"));
13776
13802
  if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
13777
13803
  const hasBriefing = await hasRecentBriefingMarker(paths, sessionId);
13778
13804
  findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent hAIve briefing marker exists." } : {
@@ -14384,7 +14410,7 @@ function registerRun(program2) {
14384
14410
 
14385
14411
  // src/index.ts
14386
14412
  var program = new Command52();
14387
- program.name("haive").description("hAIve - repo-native memory and context policy for coding-agent harnesses").version("0.10.2").option("--advanced", "show maintenance and experimental commands in help");
14413
+ program.name("haive").description("hAIve - repo-native memory and context policy for coding-agent harnesses").version("0.10.3").option("--advanced", "show maintenance and experimental commands in help");
14388
14414
  registerInit(program);
14389
14415
  registerWelcome(program);
14390
14416
  registerResolveProject(program);