@hiveai/cli 0.9.15 → 0.9.16

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/README.md CHANGED
@@ -52,13 +52,28 @@ haive memory add \
52
52
  haive enforce status
53
53
  haive enforce check --stage pre-commit
54
54
  haive enforce ci
55
- haive benchmark report --dir benchmarks/agent-benchmark
56
55
  ```
57
56
 
58
57
  ---
59
58
 
60
59
  ## Commands
61
60
 
61
+ The default help is intentionally small and centered on the core harness workflow. Run:
62
+
63
+ ```bash
64
+ haive --help
65
+ haive memory --help
66
+ ```
67
+
68
+ to see the focused surface. Maintenance and experimental commands remain available, but are hidden from default help:
69
+
70
+ ```bash
71
+ haive --advanced --help
72
+ haive --advanced memory --help
73
+ ```
74
+
75
+ This keeps hAIve from feeling like a grab bag: day-to-day users see context loading, enforcement, diagnostics, sync, recaps, and the high-signal memory operations first.
76
+
62
77
  ### `haive init`
63
78
 
64
79
  Initialize the `.ai/` structure in a project. **Autopilot mode is ON by default** and now installs strict enforcement gates by default.
package/dist/index.js CHANGED
@@ -6345,7 +6345,7 @@ When done, respond with: "Imported N memories: [list of IDs]" or "Nothing action
6345
6345
  };
6346
6346
  }
6347
6347
  var SERVER_NAME = "haive";
6348
- var SERVER_VERSION = "0.9.15";
6348
+ var SERVER_VERSION = "0.9.16";
6349
6349
  function jsonResult(data) {
6350
6350
  return {
6351
6351
  content: [
@@ -6356,7 +6356,7 @@ function jsonResult(data) {
6356
6356
  ]
6357
6357
  };
6358
6358
  }
6359
- var ENFORCEMENT_PROFILE_TOOLS = /* @__PURE__ */ new Set([
6359
+ var ENFORCEMENT_PROFILE_TOOLS = [
6360
6360
  "get_briefing",
6361
6361
  "mem_save",
6362
6362
  "mem_tried",
@@ -6367,7 +6367,47 @@ var ENFORCEMENT_PROFILE_TOOLS = /* @__PURE__ */ new Set([
6367
6367
  "code_map",
6368
6368
  "pre_commit_check",
6369
6369
  "mem_session_end"
6370
- ]);
6370
+ ];
6371
+ var MAINTENANCE_PROFILE_TOOLS = [
6372
+ ...ENFORCEMENT_PROFILE_TOOLS,
6373
+ "mem_suggest_topic",
6374
+ "mem_for_files",
6375
+ "mem_list",
6376
+ "get_project_context",
6377
+ "bootstrap_project_save",
6378
+ "mem_resolve_project",
6379
+ "mem_update",
6380
+ "mem_approve",
6381
+ "mem_reject",
6382
+ "mem_pending",
6383
+ "mem_delete",
6384
+ "mem_diff",
6385
+ "get_recap",
6386
+ "code_search",
6387
+ "anti_patterns_check",
6388
+ "mem_distill",
6389
+ "mem_timeline",
6390
+ "mem_conflict_candidates"
6391
+ ];
6392
+ var EXPERIMENTAL_PROFILE_TOOLS = [
6393
+ ...MAINTENANCE_PROFILE_TOOLS,
6394
+ "mem_observe",
6395
+ "why_this_file",
6396
+ "why_this_decision",
6397
+ "mem_conflicts_with",
6398
+ "pattern_detect",
6399
+ "runtime_journal_append",
6400
+ "runtime_journal_tail"
6401
+ ];
6402
+ var TOOL_PROFILES = {
6403
+ enforcement: new Set(ENFORCEMENT_PROFILE_TOOLS),
6404
+ maintenance: new Set(MAINTENANCE_PROFILE_TOOLS),
6405
+ experimental: new Set(EXPERIMENTAL_PROFILE_TOOLS)
6406
+ };
6407
+ function getAllowedToolsForProfile(profile) {
6408
+ if (profile === "full") return TOOL_PROFILES.experimental;
6409
+ return TOOL_PROFILES[profile] ?? TOOL_PROFILES.enforcement;
6410
+ }
6371
6411
  var BRIEFING_TOOLS = /* @__PURE__ */ new Set(["get_briefing", "mem_relevant_to"]);
6372
6412
  var MUTATING_TOOLS = /* @__PURE__ */ new Set([
6373
6413
  "mem_save",
@@ -6394,7 +6434,8 @@ function createHaiveServer(options = {}) {
6394
6434
  { name: SERVER_NAME, version: SERVER_VERSION },
6395
6435
  { capabilities: { tools: {}, prompts: {} } }
6396
6436
  );
6397
- const shouldRegisterTool = (name) => toolProfile === "full" || ENFORCEMENT_PROFILE_TOOLS.has(name);
6437
+ const allowedTools = getAllowedToolsForProfile(toolProfile);
6438
+ const shouldRegisterTool = (name) => allowedTools.has(name);
6398
6439
  const registerTool = (name, description, schema, handler) => {
6399
6440
  if (!shouldRegisterTool(name)) return;
6400
6441
  const tool = server.tool.bind(server);
@@ -6418,7 +6459,11 @@ function createHaiveServer(options = {}) {
6418
6459
  }
6419
6460
  );
6420
6461
  };
6421
- const shouldRegisterPrompt = (name) => toolProfile === "full" || name === "bootstrap_project" || name === "post_task";
6462
+ const shouldRegisterPrompt = (name) => {
6463
+ if (name === "bootstrap_project" || name === "post_task") return true;
6464
+ if (name === "import_docs") return toolProfile !== "enforcement";
6465
+ return toolProfile === "experimental" || toolProfile === "full";
6466
+ };
6422
6467
  registerTool(
6423
6468
  "mem_save",
6424
6469
  [
@@ -10907,14 +10952,14 @@ function registerDoctor(program2) {
10907
10952
  fix: "Edit .ai/haive.config.json: set autoSessionEnd: true (or re-run `haive init` without --manual)."
10908
10953
  });
10909
10954
  }
10910
- findings.push(...await collectInstallFindings(root, "0.9.15"));
10955
+ findings.push(...await collectInstallFindings(root, "0.9.16"));
10911
10956
  try {
10912
10957
  const legacyRaw = execSync3("haive-mcp --version", {
10913
10958
  encoding: "utf8",
10914
10959
  timeout: 3e3,
10915
10960
  stdio: ["ignore", "pipe", "ignore"]
10916
10961
  }).trim();
10917
- const cliVersion = "0.9.15";
10962
+ const cliVersion = "0.9.16";
10918
10963
  if (legacyRaw && legacyRaw !== cliVersion) {
10919
10964
  findings.push({
10920
10965
  severity: "warn",
@@ -12006,7 +12051,7 @@ async function buildEnforcementReport(dir, stage, sessionId) {
12006
12051
  findings: [{ severity: "info", code: "enforcement-off", message: "hAIve enforcement is disabled." }]
12007
12052
  };
12008
12053
  }
12009
- findings.push(...await inspectIntegrationVersions(root, "0.9.15"));
12054
+ findings.push(...await inspectIntegrationVersions(root, "0.9.16"));
12010
12055
  if (config.enforcement?.requireBriefingFirst !== false && stage !== "ci") {
12011
12056
  const hasBriefing = await hasRecentBriefingMarker(paths, sessionId);
12012
12057
  findings.push(hasBriefing ? { severity: "ok", code: "briefing-loaded", message: "A recent hAIve briefing marker exists." } : {
@@ -12464,7 +12509,7 @@ function registerRun(program2) {
12464
12509
 
12465
12510
  // src/index.ts
12466
12511
  var program = new Command51();
12467
- program.name("haive").description("hAIve \u2014 policy enforcement layer for AI coding agents").version("0.9.15");
12512
+ program.name("haive").description("hAIve \u2014 policy enforcement layer for AI coding agents").version("0.9.16").option("--advanced", "show maintenance and experimental commands in help");
12468
12513
  registerInit(program);
12469
12514
  registerWelcome(program);
12470
12515
  registerResolveProject(program);
@@ -12517,6 +12562,32 @@ registerBenchmark(program);
12517
12562
  registerDoctor(program);
12518
12563
  registerPlayback(program);
12519
12564
  registerPrecommit(program);
12565
+ var CORE_ROOT_COMMANDS = /* @__PURE__ */ new Set([
12566
+ "init",
12567
+ "doctor",
12568
+ "agent",
12569
+ "enforce",
12570
+ "run",
12571
+ "briefing",
12572
+ "sync",
12573
+ "mcp",
12574
+ "memory",
12575
+ "session",
12576
+ "precommit",
12577
+ "welcome"
12578
+ ]);
12579
+ var CORE_MEMORY_COMMANDS = /* @__PURE__ */ new Set([
12580
+ "add",
12581
+ "list",
12582
+ "query",
12583
+ "show",
12584
+ "verify",
12585
+ "lint",
12586
+ "tried",
12587
+ "rm"
12588
+ ]);
12589
+ var CORE_SESSION_COMMANDS = /* @__PURE__ */ new Set(["end"]);
12590
+ applySurfaceVisibility(program);
12520
12591
  program.parseAsync(process.argv).catch((err) => {
12521
12592
  if (isZodError(err)) {
12522
12593
  for (const issue of err.issues) {
@@ -12528,6 +12599,44 @@ program.parseAsync(process.argv).catch((err) => {
12528
12599
  }
12529
12600
  process.exit(1);
12530
12601
  });
12602
+ function applySurfaceVisibility(root) {
12603
+ const showAdvanced = process.argv.includes("--advanced") || process.env.HAIVE_SHOW_ADVANCED === "1";
12604
+ if (!showAdvanced) hideNonCoreCommands(root);
12605
+ root.addHelpText(
12606
+ "after",
12607
+ [
12608
+ "",
12609
+ "Default help shows the core hAIve harness: init, doctor, agent setup, briefing, enforcement,",
12610
+ "sync, session recaps, and high-signal memory commands.",
12611
+ "Run `haive --advanced --help` or set HAIVE_SHOW_ADVANCED=1 to show maintenance and experimental commands."
12612
+ ].join("\n")
12613
+ );
12614
+ const memoryCommand = root.commands.find((cmd) => cmd.name() === "memory");
12615
+ memoryCommand?.addHelpText(
12616
+ "after",
12617
+ [
12618
+ "",
12619
+ "Default help shows the memory commands that support the core harness workflow.",
12620
+ "Run `haive --advanced memory --help` or set HAIVE_SHOW_ADVANCED=1 to show review, import, digest, timeline, and conflict tools."
12621
+ ].join("\n")
12622
+ );
12623
+ }
12624
+ function hideNonCoreCommands(command) {
12625
+ for (const child of command.commands) {
12626
+ if (!isCoreCommand(command, child)) {
12627
+ child._hidden = true;
12628
+ }
12629
+ hideNonCoreCommands(child);
12630
+ }
12631
+ }
12632
+ function isCoreCommand(parent, child) {
12633
+ const parentName = parent.name();
12634
+ const childName = child.name();
12635
+ if (parentName === "haive") return CORE_ROOT_COMMANDS.has(childName);
12636
+ if (parentName === "memory") return CORE_MEMORY_COMMANDS.has(childName);
12637
+ if (parentName === "session") return CORE_SESSION_COMMANDS.has(childName);
12638
+ return true;
12639
+ }
12531
12640
  function isZodError(err) {
12532
12641
  return err !== null && typeof err === "object" && "issues" in err && Array.isArray(err.issues);
12533
12642
  }