mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-12-04 06:21:59 +09:00
- #4127: PostToolUseFailure registered for Bash and Write|Edit|MultiEdit and forwarded with -s false and the real exit code (builds on #4170 by @rudycelekli; payload shape verified against Claude Code 2.1.289) - #4176: the hook shim starts the CLI from CLAUDE_PROJECT_DIR; the CLI only adopts a proven config in a directory that carries ruflo init's markers, not a bare .claude/ that Claude Code created - #4128: the shim starts the CLI detached and returns at once (about 25 ms instead of 0.2-4 s per hook), bounded to 4 concurrent telemetry CLIs per project, Stop never dropped, RUFLO_HOOK_SYNC=1 for the old path - ruflo-core 0.2.9 Co-Authored-By: RuFlo <ruv@ruv.net>
12 lines
558 B
JavaScript
12 lines
558 B
JavaScript
// Test fixture: a "CLI" that is slow like a cold ruflo start and records what it
|
|
// received (argv, cwd, stdin) so a test can prove the hook shim returned first
|
|
// and still delivered everything (#4128, #4176).
|
|
const fs = require('fs');
|
|
const out = process.env.HOOK_SLOW_OUT;
|
|
const delay = Number(process.env.HOOK_SLOW_MS || 1500);
|
|
let stdin = '';
|
|
try { stdin = fs.readFileSync(0, 'utf8'); } catch { /* no stdin */ }
|
|
setTimeout(() => {
|
|
if (out) fs.writeFileSync(out, JSON.stringify({ argv: process.argv.slice(2), cwd: process.cwd(), stdin }));
|
|
}, delay);
|