@hiveai/cli 0.9.6 → 0.9.7

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
@@ -843,7 +843,7 @@ async function scanDirs(root, maxDepth = 2) {
843
843
  if (depth > maxDepth) return;
844
844
  let entries;
845
845
  try {
846
- entries = await readdir(dir, { withFileTypes: true });
846
+ entries = await readdir(dir, { withFileTypes: true, encoding: "utf8" });
847
847
  } catch {
848
848
  return;
849
849
  }
@@ -4622,6 +4622,7 @@ var CodeMapInputSchema = {
4622
4622
  "Approximate token budget for the response. When the matching set exceeds it, files are ranked by export density (exports per LOC) and the highest-signal ones are kept first. Omit to disable budgeting (legacy behavior)."
4623
4623
  )
4624
4624
  };
4625
+ var CodeMapInputZod = z18.object(CodeMapInputSchema);
4625
4626
  async function codeMapTool(input, ctx) {
4626
4627
  const map = await loadCodeMap22(ctx.paths);
4627
4628
  if (!map) {
@@ -6029,7 +6030,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
6029
6030
  };
6030
6031
  }
6031
6032
  var SERVER_NAME = "haive";
6032
- var SERVER_VERSION = "0.9.6";
6033
+ var SERVER_VERSION = "0.9.7";
6033
6034
  function jsonResult(data) {
6034
6035
  return {
6035
6036
  content: [
@@ -7287,9 +7288,10 @@ Attends une **confirmation explicite** avant d'agir.
7287
7288
  }
7288
7289
  if (opts.embed) {
7289
7290
  try {
7290
- const emb = await import("@hiveai/embeddings");
7291
+ const { Embedder, rebuildIndex } = await import("@hiveai/embeddings");
7291
7292
  log(ui.dim("embed: rebuilding index\u2026"));
7292
- const report = await emb.rebuildIndex(paths);
7293
+ const embedder = await Embedder.create();
7294
+ const { report } = await rebuildIndex(paths, embedder);
7293
7295
  log(ui.dim(`embed: index rebuilt (${report.added} added, ${report.updated} updated, ${report.removed} removed)`));
7294
7296
  } catch {
7295
7297
  ui.warn("--embed: @hiveai/embeddings not available or index build failed. Run `haive embeddings index` manually.");
@@ -8718,8 +8720,8 @@ function parseChangelog(content) {
8718
8720
  const sections = content.split(/^#{1,3}\s+/m).slice(1);
8719
8721
  for (const section of sections) {
8720
8722
  const versionMatch = section.match(/^(?:\[?)([0-9]+\.[0-9]+[.0-9]*)/);
8721
- if (!versionMatch) continue;
8722
- const version = versionMatch[1];
8723
+ const version = versionMatch?.[1];
8724
+ if (!version) continue;
8723
8725
  const entry = {
8724
8726
  version,
8725
8727
  breaking: [],
@@ -8730,7 +8732,7 @@ function parseChangelog(content) {
8730
8732
  };
8731
8733
  const subSections = section.split(/^#{2,4}\s+/m);
8732
8734
  for (const sub of subSections) {
8733
- const firstLine = sub.split("\n")[0].toLowerCase().trim();
8735
+ const firstLine = (sub.split("\n")[0] ?? "").toLowerCase().trim();
8734
8736
  const items = sub.split("\n").slice(1).filter((l) => l.trim().startsWith("-") || l.trim().startsWith("*")).map((l) => l.replace(/^[\s\-*]+/, "").trim()).filter(Boolean);
8735
8737
  if (/breaking/.test(firstLine)) {
8736
8738
  entry.breaking.push(...items);
@@ -8746,8 +8748,9 @@ function parseChangelog(content) {
8746
8748
  for (const sub2 of subSections) {
8747
8749
  for (const line of sub2.split("\n")) {
8748
8750
  const breakingMatch = line.match(/BREAKING CHANGE[S]?:\s*(.+)/i);
8749
- if (breakingMatch && !entry.breaking.includes(breakingMatch[1].trim())) {
8750
- entry.breaking.push(breakingMatch[1].trim());
8751
+ const breakingText = breakingMatch?.[1]?.trim();
8752
+ if (breakingText && !entry.breaking.includes(breakingText)) {
8753
+ entry.breaking.push(breakingText);
8751
8754
  }
8752
8755
  }
8753
8756
  }
@@ -8789,7 +8792,8 @@ function registerMemoryImportChangelog(memory2) {
8789
8792
  }
8790
8793
  if (opts.versions) {
8791
8794
  if (opts.versions === "latest") {
8792
- entries = [entries[0]];
8795
+ const latest = entries[0];
8796
+ entries = latest ? [latest] : [];
8793
8797
  } else {
8794
8798
  const requested = opts.versions.split(",").map((v) => v.trim());
8795
8799
  entries = entries.filter((e) => requested.includes(e.version));
@@ -10366,7 +10370,7 @@ function registerDoctor(program2) {
10366
10370
  timeout: 3e3,
10367
10371
  stdio: ["ignore", "pipe", "ignore"]
10368
10372
  }).trim();
10369
- const cliVersion = "0.9.6";
10373
+ const cliVersion = "0.9.7";
10370
10374
  if (legacyRaw && legacyRaw !== cliVersion) {
10371
10375
  findings.push({
10372
10376
  severity: "warn",
@@ -10970,7 +10974,7 @@ function registerMemoryConflictCandidates(memory2) {
10970
10974
 
10971
10975
  // src/index.ts
10972
10976
  var program = new Command47();
10973
- program.name("haive").description("hAIve \u2014 team-first persistent memory layer for AI coding agents").version("0.9.6");
10977
+ program.name("haive").description("hAIve \u2014 team-first persistent memory layer for AI coding agents").version("0.9.7");
10974
10978
  registerInit(program);
10975
10979
  registerWelcome(program);
10976
10980
  registerResolveProject(program);