/** * PreToolUse hook handler (tools: Write, Edit, MultiEdit, NotebookEdit, Bash) — three rules: * * 1. Status Completion Guard — no manual `status: completed` in an increment's * metadata.json; closure goes through `/sw:done` / `specweave complete`. * 2. Required increment (opt-in, 0996) — with `planning.requireIncrement` set * to `remind` or `enforce`, an edit in a session with no increment and no * `specweave small-fix` is warned about or denied (see require-increment.ts). * 3. Jev Bash guard (opt-in, 0878) — when `.specweave/state/jev-guard.enabled` * exists AND `jev.enabled` AND `jev.guards.bash`, a shell command that * survives the regex prefilter is scored by Jev; a `deny` verdict blocks it, * a `warn` verdict is surfaced as additionalContext. * * NOT registered by the plugin manifest: 2.1 retired the intrusive default * hooks, and `plugins/specweave/hooks/hooks.json` still ships only SessionStart * and Stop. The Bash guard reaches this handler through a PROJECT-level entry * (matcher `Bash`) that `specweave jev setup --guard-bash` writes into * `/.claude/settings.json`; the Write/Edit rule stays callable for * anyone who wires PreToolUse up themselves. * * PRIVACY: scoring a command means POSTing its text to a third-party API * (OpenRouter or TypeSafe). The prefilter routes `curl`, `ssh`, `publish`, * `deploy` … toward Jev — exactly the commands that carry credentials — so * every command is run through `redactSecrets` (core/jev/redact) first — * the same single choke point the client uses on request state, so a key * shape only has to be taught once. Redaction is a heuristic, not a * guarantee; the guard stays opt-in for that reason and the docs page states * the export. * * 2.0 removed the interview-enforcement guard: `planning.deepInterview` is * advisory ('off' | 'critical' | 'deep') and enforced by the planning skill, not a hook. * * Output: `{}` (pass), `hookSpecificOutput.permissionDecision: "deny"`, or * `hookSpecificOutput.additionalContext` (warn). Paths are backslash-normalized * so the guards fire on Windows too. Everything fails OPEN: any error, timeout, * missing key or disabled config returns `{}`. * * @module core/hooks/handlers/pre-tool-use */ import type { HandlerFn } from './types.js'; export declare const handle: HandlerFn; //# sourceMappingURL=pre-tool-use.d.ts.map