From 608c44118364d32e4f2c7bd199039d22b4eb5226 Mon Sep 17 00:00:00 2001 From: NiveditJain Date: Tue, 7 Apr 2026 18:58:10 +0000 Subject: [PATCH] fix: set FAILPROOFAI_DIST_PATH at startup + add `p` alias for policies + bump to 0.0.1-beta.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix custom hooks loading failure: bin entry now sets FAILPROOFAI_DIST_PATH so findDistIndex() resolves the dist module and rewrites `import from 'failproofai'` in user hook files — previously returned null and left the import unrewritten - Add `p` as a shorthand alias for the `policies` subcommand (normalised early so all downstream routing works transparently) - Bump version to 0.0.1-beta.10 Co-Authored-By: Claude Sonnet 4.6 --- bin/failproofai.mjs | 13 ++++++++++++- package.json | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/failproofai.mjs b/bin/failproofai.mjs index 2f9c45e4..bab67911 100755 --- a/bin/failproofai.mjs +++ b/bin/failproofai.mjs @@ -24,8 +24,19 @@ if (!process.env.FAILPROOFAI_PACKAGE_ROOT) { ); } +if (!process.env.FAILPROOFAI_DIST_PATH) { + process.env.FAILPROOFAI_DIST_PATH = resolve( + dirname(realpathSync(fileURLToPath(import.meta.url))), + "..", + "dist" + ); +} + const args = process.argv.slice(2); +// Normalize 'p' → 'policies' (shorthand alias) +if (args[0] === "p") args[0] = "policies"; + // --help / -h (only when not inside a subcommand that handles its own --help) const SUBCOMMANDS = ["policies"]; if ((args.includes("--help") || args.includes("-h")) && !SUBCOMMANDS.includes(args[0])) { @@ -38,7 +49,7 @@ USAGE COMMANDS (no args) Launch the policy dashboard - policies List all available policies and their status + policies, p List all available policies and their status policies --install, -i Enable policies in Claude Code settings [names...] Specific policy names to enable --scope user|project|local Config scope to write to (default: user) diff --git a/package.json b/package.json index 5777048a..3e843ef5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "failproofai", - "version": "0.0.1-beta.9", + "version": "0.0.1-beta.10", "description": "Open-source hooks, policies, and project visualization for Claude Code & Agents SDK", "bin": { "failproofai": "./bin/failproofai.mjs"