@webpieces/ai-hook-rules 0.2.121 → 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.
- package/bin/postinstall.js +17 -0
- package/bin/wp-setup-ai-hooks.js +19 -0
- package/package.json +7 -3
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Plain JS shim — delegates to compiled TypeScript.
|
|
3
|
+
// Must NOT be converted to TypeScript (needs to exist pre-build for pnpm bin symlinks).
|
|
4
|
+
// eslint-disable-next-line @webpieces/no-unmanaged-exceptions
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const compiled = path.join(__dirname, '..', 'src', 'bin', 'postinstall.js');
|
|
10
|
+
|
|
11
|
+
if (fs.existsSync(compiled)) {
|
|
12
|
+
require(compiled).main().catch(function (err) {
|
|
13
|
+
console.error(' [ai-hook-rules] error:', err.message);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
});
|
|
16
|
+
} else {
|
|
17
|
+
console.error(' [ai-hook-rules] Package not built yet. Run the build first, or install from npm.');
|
|
18
|
+
process.exit(1);
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/ai-hook-rules",
|
|
3
|
-
"version": "0.2.
|
|
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
|
-
"wp-setup-ai-hooks": "./
|
|
11
|
+
"wp-setup-ai-hooks": "./bin/wp-setup-ai-hooks.js"
|
|
9
12
|
},
|
|
10
13
|
"exports": {
|
|
11
14
|
".": "./src/index.js",
|
|
@@ -16,6 +19,7 @@
|
|
|
16
19
|
},
|
|
17
20
|
"files": [
|
|
18
21
|
"src/**/*",
|
|
22
|
+
"bin/**/*",
|
|
19
23
|
"templates/**/*",
|
|
20
24
|
"openclaw.plugin.json",
|
|
21
25
|
"README.md"
|
|
@@ -28,7 +32,7 @@
|
|
|
28
32
|
"directory": "packages/tooling/ai-hook-rules"
|
|
29
33
|
},
|
|
30
34
|
"dependencies": {
|
|
31
|
-
"@webpieces/rules-config": "0.2.
|
|
35
|
+
"@webpieces/rules-config": "0.2.123"
|
|
32
36
|
},
|
|
33
37
|
"publishConfig": {
|
|
34
38
|
"access": "public"
|