@webpieces/ai-hook-rules 0.2.122 → 0.2.123

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/postinstall.js +17 -0
  2. package/package.json +5 -2
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ // Postinstall shim — delegates to compiled TypeScript.
3
+ // Must be plain JS because it runs during `pnpm install` BEFORE any build step.
4
+ //
5
+ // In workspace: compiled .js doesn't exist yet → silently exits (no-op).
6
+ // In consumer: compiled .js exists in npm package → runs full setup.
7
+ 'use strict';
8
+
9
+ const path = require('path');
10
+ const fs = require('fs');
11
+
12
+ const compiled = path.join(__dirname, '..', 'src', 'bin', 'postinstall.js');
13
+ if (fs.existsSync(compiled)) {
14
+ require(compiled).main().catch(function (err) {
15
+ console.error(' [ai-hook-rules] postinstall warning:', err.message);
16
+ });
17
+ }
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@webpieces/ai-hook-rules",
3
- "version": "0.2.122",
3
+ "version": "0.2.123",
4
4
  "description": "Pluggable write-time validation framework for AI coding agents (@webpieces/ai-hook-rules). Claude Code PreToolUse + openclaw before_tool_call adapters share one rule engine.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
7
+ "scripts": {
8
+ "postinstall": "node bin/postinstall.js"
9
+ },
7
10
  "bin": {
8
11
  "wp-setup-ai-hooks": "./bin/wp-setup-ai-hooks.js"
9
12
  },
@@ -29,7 +32,7 @@
29
32
  "directory": "packages/tooling/ai-hook-rules"
30
33
  },
31
34
  "dependencies": {
32
- "@webpieces/rules-config": "0.2.122"
35
+ "@webpieces/rules-config": "0.2.123"
33
36
  },
34
37
  "publishConfig": {
35
38
  "access": "public"