agent-guardrails 0.3.7 → 0.3.8

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.
@@ -9,8 +9,8 @@
9
9
  * Triggered by: Edit, Write, MultiEdit tool usage
10
10
  */
11
11
 
12
- import fs from "node:fs";
13
- import path from "node:path";
12
+ const fs = require("node:fs");
13
+ const path = require("node:path");
14
14
 
15
15
  const projectDir = process.env.CLAUDE_PROJECT_DIR || process.cwd();
16
16
  const resultFile = path.join(projectDir, ".agent-guardrails", "daemon-result.json");
@@ -20,14 +20,14 @@ if (!fs.existsSync(resultFile)) process.exit(0);
20
20
  try {
21
21
  const data = JSON.parse(fs.readFileSync(resultFile, "utf8"));
22
22
 
23
- if (!data.ok && data.result?.findings?.length > 0) {
23
+ if (!data.ok && data.result && data.result.findings && data.result.findings.length > 0) {
24
24
  const errors = data.result.findings
25
25
  .filter(f => f.severity === "error")
26
- .map(f => `[${f.code}] ${f.message}`)
26
+ .map(f => "[" + f.code + "] " + f.message)
27
27
  .join("\n");
28
28
 
29
29
  if (errors) {
30
- process.stderr.write(`Guardrails daemon detected issues:\n${errors}\n`);
30
+ process.stderr.write("Guardrails daemon detected issues:\n" + errors + "\n");
31
31
  process.exit(2);
32
32
  }
33
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-guardrails",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "mcpName": "io.github.logi-cmd/agent-guardrails",
5
5
  "description": "Production guardrails for AI coding agents",
6
6
  "type": "module",