@basou/cli 0.23.0 → 0.24.0

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/program.js CHANGED
@@ -2036,7 +2036,7 @@ async function assertWorkspaceInitialized4(basouRoot) {
2036
2036
  // src/commands/hook.ts
2037
2037
  import { open, readFile as readFile2, stat as stat2 } from "fs/promises";
2038
2038
  import {
2039
- DEFAULT_STOP_HOOK_MIN_ACTIONS,
2039
+ DEFAULT_STOP_HOOK_MIN_EDITS,
2040
2040
  evaluateStopHook
2041
2041
  } from "@basou/core";
2042
2042
  var MAX_TRANSCRIPT_BYTES = 8 * 1024 * 1024;
@@ -2047,11 +2047,11 @@ function registerHookCommand(program) {
2047
2047
  hook.command("stop").description(
2048
2048
  "Stop-hook: when a substantive session recorded no decisions or next step, emit a non-blocking nudge to capture them. Reads the Stop hook JSON payload on stdin; never blocks and never fails the session."
2049
2049
  ).option(
2050
- "--min-actions <n>",
2051
- `Minimum commands+edits before nudging (default ${DEFAULT_STOP_HOOK_MIN_ACTIONS})`
2050
+ "--min-edits <n>",
2051
+ `Minimum file edits before nudging on edits alone (default ${DEFAULT_STOP_HOOK_MIN_EDITS})`
2052
2052
  ).addHelpText("after", HOOK_STOP_HELP).action(async (options) => {
2053
- const minActions = parseMinActions(options.minActions);
2054
- await runHookStop(minActions !== void 0 ? { minActions } : {});
2053
+ const minEdits = parseMinEdits(options.minEdits);
2054
+ await runHookStop(minEdits !== void 0 ? { minEdits } : {});
2055
2055
  });
2056
2056
  }
2057
2057
  var HOOK_STOP_HELP = `
@@ -2065,11 +2065,13 @@ Install as a Claude Code Stop hook in ~/.claude/settings.json:
2065
2065
  }
2066
2066
 
2067
2067
  On every turn end basou inspects the session transcript. If the session did
2068
- substantive work (>= ${DEFAULT_STOP_HOOK_MIN_ACTIONS} commands + file edits by default) but ran no capture
2069
- verb ('basou decision capture' / 'decision record' / 'note'), it emits a
2070
- non-blocking reminder so the agent can record the why / next step. The reminder
2071
- continues the conversation (Claude may act on it or stop); it never forces.
2072
- The 'stop_hook_active' flag is honored so the nudge cannot loop.
2068
+ content-substantive work but ran no capture verb ('basou decision capture' /
2069
+ 'decision record' / 'note'), it emits a non-blocking reminder so the agent can
2070
+ record the why / next step. Substantive = EITHER >= ${DEFAULT_STOP_HOOK_MIN_EDITS} file edits (default)
2071
+ OR a free-form AskUserQuestion answer (an uncaptured conversational decision).
2072
+ Read-only Bash (ls / grep / git status) does NOT count. The reminder is
2073
+ non-blocking: Claude sees it and may act on it or stop; it never forces the turn
2074
+ to continue. The 'stop_hook_active' flag is honored so the nudge cannot loop.
2073
2075
  `;
2074
2076
  async function runHookStop(options, ctx = {}) {
2075
2077
  try {
@@ -2105,7 +2107,7 @@ async function doRunHookStop(options, ctx) {
2105
2107
  records,
2106
2108
  // stop_hook_active was already handled by the early return above.
2107
2109
  stopHookActive: false,
2108
- ...options.minActions !== void 0 ? { minActions: options.minActions } : {}
2110
+ ...options.minEdits !== void 0 ? { minEdits: options.minEdits } : {}
2109
2111
  });
2110
2112
  if (evaluation.kind !== "nudge") return;
2111
2113
  write(
@@ -2154,7 +2156,7 @@ async function readTranscriptBounded(path, maxBytes = MAX_TRANSCRIPT_BYTES) {
2154
2156
  await handle.close();
2155
2157
  }
2156
2158
  }
2157
- function parseMinActions(raw) {
2159
+ function parseMinEdits(raw) {
2158
2160
  if (raw === void 0 || !/^\d+$/.test(raw)) return void 0;
2159
2161
  return Number(raw);
2160
2162
  }