#!/usr/bin/env node /** * SLIM HOOK ENTRY — what the IDE actually spawns on every hook event. * * The per-event tax on a hook used to be loading the ENTIRE CLI (dist/index.js * and its transitive graph) just to ask the resident daemon one question over * the verdict pipe. On a normal laptop that is tens of milliseconds; on a * locked-down corporate machine whose EDR re-scans every loaded file, it is * the 1-5s "sticky" pause a docker-heavy customer feels dozens of times an * hour. This entry exists to make the common path (daemon up, IPC verdict) * load almost nothing: * * node boot -> hookSlim.js -> hookIo.js + verdictIpcClient.js (3 small files, * Node built-ins only) -> named-pipe verdict -> print -> exit. * * FALLBACK PARITY: when the daemon is unreachable, this entry lazily requires * the full hook evaluation (`commands/hook.evaluateHookRequest`) — literally * the same code the full CLI runs — so behavior with the daemon down is * byte-identical to `index.js hook`. The slim win applies exactly where it * matters: the warm, common case. * * FAIL-OPEN CONTRACT (same as the full hook): any unexpected error must never * surface as a stack trace, a nonzero exit, or a blocked command. The ONE * exception is the admin kill-switch — a crash on a suspended machine still * denies, so a broken install can never unlock a machine an admin suspended. * * COLD-START CONTRACT: static imports here are restricted to the two leaves * below (Node built-ins only). Everything else loads lazily, and ONLY on the * fallback path. `scripts/test-slim-hook.js` fails CI if the warm-path module * graph grows. */ export {};