@basou/cli 0.23.0 → 0.25.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/index.js +15 -13
- package/dist/index.js.map +1 -1
- package/dist/program.js +15 -13
- package/dist/program.js.map +1 -1
- package/package.json +2 -2
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
|
-
|
|
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-
|
|
2051
|
-
`Minimum
|
|
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
|
|
2054
|
-
await runHookStop(
|
|
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
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
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.
|
|
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
|
|
2159
|
+
function parseMinEdits(raw) {
|
|
2158
2160
|
if (raw === void 0 || !/^\d+$/.test(raw)) return void 0;
|
|
2159
2161
|
return Number(raw);
|
|
2160
2162
|
}
|
|
@@ -9846,7 +9848,7 @@ var pkg = require2("../package.json");
|
|
|
9846
9848
|
var BASOU_CLI_VERSION = pkg.version;
|
|
9847
9849
|
function buildProgram() {
|
|
9848
9850
|
const program = new Command();
|
|
9849
|
-
program.name("basou").description("
|
|
9851
|
+
program.name("basou").description("A harness for steering AI coding agents").version(BASOU_CLI_VERSION).enablePositionalOptions();
|
|
9850
9852
|
registerInitCommand(program);
|
|
9851
9853
|
registerStatusCommand(program);
|
|
9852
9854
|
registerStatsCommand(program);
|