#!/usr/bin/env node /** * The `vigiles` bin — a DISPATCHER SHIM, and deliberately almost empty. * * ## Why this file has no imports * * `dist/cli.js` is the `bin`, so it is also what the harness spawns for * `vigiles hook-runtime run-program ` — a compiled hook's decision, which * runs on EVERY matching tool call. The output is CommonJS, where a top-level * `import` becomes a top-level `require` that resolves BEFORE argv is read. The * verb barrel (`./cli-main.js`) has ~85 of them: the report template loader, the * linter catalogs, the adapter registry, `audit`, `eval`, `init`. A hook calls * none of it. * * MEASURED 2026-09-08, Node 22.22.2, median of 20 spawns * (`node tools/measure-hook-startup.mjs` — run it, do not trust these): * * ``` * bare `node -e ''` 42 ms * require dist/core/hook-program.js 170 ms * require dist/cli.js ← what a hook used to load 623 ms * a real run-program spawn 610-661 ms * ``` * * A shell hook doing the same job costs ~12 ms and a python one ~35 ms, so the * gap was the reason to keep the shell hook. Issue #216. * * ## The rule this file exists to hold * * 🔴 NO TOP-LEVEL IMPORT MAY BE ADDED HERE. Every `require` in this file is paid * by every gated tool call before anything decides anything. Both branches below * load their module lazily, inside the branch. `src/hook-runtime-graph.test.ts` * fails the day a top-level import puts the CLI barrel back into a hook * decision's module graph — it asserts the GRAPH, not a duration, because a * timing threshold on a shared CI runner is flaky and would be quarantined first. * * ## What must not change * * The emitted command `npx vigiles hook-runtime run-program ` is byte-for-byte * what `vigiles compile` has already written into users' `.claude/settings.json` * and `.codex/config.toml`, and it is covered by the SHA stamp beside each hook. * Renaming it — or moving the bin off `dist/cli.js` — breaks a contract that * lives in other people's repositories. It is a fast path THROUGH the same * command, never a new one. * * Harness-neutral: `run-program` dispatches on the hook's own role, and the gate * protocol (deny → exit 2) is identical on Claude Code and Codex, so one path * serves both. The single harness-specific fact (which events accept injected * context) is read from the resolved adapter inside the runtime. */ export {}; //# sourceMappingURL=cli.d.ts.map