Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ Everything runs locally — no data leaves your machine.
## Requirements

- Node.js >= 20.9.0
- Bun >= 1.3.0
- Bun >= 1.3.0 (optional — only needed for development / building from source)

---

## Install

```bash
npm install -g failproofai
# or
bun add -g failproofai
```

---
Expand Down
4 changes: 3 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ icon: rocket
## Requirements

- **Node.js** >= 20.9.0
- **Bun** >= 1.3.0 (used as the runtime and bundler)
- **Bun** >= 1.3.0 (optional — only needed for development / building from source)

---

## Installation

```bash
npm install -g failproofai
# or
bun add -g failproofai
```

---
Expand Down
4 changes: 3 additions & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ It also includes a local web dashboard for browsing Claude Code sessions, inspec

## Quick start

Install globally via npm:
Install globally:

```bash
npm install -g failproofai
# or
bun add -g failproofai
```

Enable policies:
Expand Down
2 changes: 2 additions & 0 deletions docs/package-aliases.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ The canonical npm package is **`failproofai`**:

```bash
npm install -g failproofai
# or
bun add -g failproofai
```

---
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "failproofai",
"version": "0.0.1",
"version": "0.0.2-beta.1",
"description": "Open-source hooks, policies, and project visualization for Claude Code & Agents SDK",
"bin": {
"failproofai": "./bin/failproofai.mjs"
"failproofai": "./dist/cli.mjs"
},
"files": [
"bin/",
Expand All @@ -19,10 +19,11 @@
"bun": ">=1.3.0"
},
"scripts": {
"predev": "bun link",
"predev": "bun run build:cli && bun link",
"dev": "FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/dev.ts --port 8020",
"build": "bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\"",
"prestart": "bun link",
"build:cli": "bun build --target=node --format=esm --outfile=dist/cli.mjs bin/failproofai.mjs --external posthog-node && node -e \"const fs=require('fs');const c=fs.readFileSync('dist/cli.mjs','utf8');fs.writeFileSync('dist/cli.mjs',c.replace('#!/usr/bin/env bun','#!/usr/bin/env node').replace('// @bun\\n',''))\"",
"build": "bun build --target=node --format=cjs --outfile=dist/index.js src/index.ts && bun run build:cli && bun --bun next build && node -e \"const {cpSync}=require('fs');cpSync('.next/static','.next/standalone/.next/static',{recursive:true});\"",
"prestart": "bun run build:cli && bun link",
"start": "FAILPROOFAI_TELEMETRY_DISABLED=1 bun scripts/start.ts",
"test": "vitest",
"test:run": "vitest run",
Expand Down
2 changes: 1 addition & 1 deletion scripts/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function launch(mode: "dev" | "start"): void {
const serverJsPath = resolve(packageRoot, ".next/standalone/server.js");
if (!existsSync(serverJsPath)) {
console.error(
`\nError: Cannot find server binary at:\n ${serverJsPath}\n\n` +
`\nError: Cannot find server.js at:\n ${serverJsPath}\n\n` +
`The package may be missing its build output.\n` +
`Try reinstalling:\n npm install -g failproofai@latest\n`
);
Expand Down
11 changes: 11 additions & 0 deletions scripts/postinstall.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,17 @@ import { trackInstallEvent } from "./install-telemetry.mjs";
// from process.cwd() only when we are being installed as a dependency by someone else.
if (!process.env.INIT_CWD || process.env.INIT_CWD === process.cwd()) process.exit(0);

// Verify server.js exists — fail the install early if the dashboard build is missing.
const serverJsPath = resolve(process.cwd(), ".next", "standalone", "server.js");
if (!existsSync(serverJsPath)) {
console.error(
`\n[failproofai] Error: server.js not found at:\n ${serverJsPath}\n\n` +
` The package may not have been built correctly.\n` +
` Try reinstalling: npm install -g failproofai@latest\n`
);
process.exit(1);
}

const FAILPROOFAI_HOOK_MARKER = "__failproofai_hook__";
const NAMESPACE = "failproofai-telemetry-v1";

Expand Down