@red-codes/agentguard 1.1.4 → 1.1.5
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/dist/bin.js +9 -3
- package/dist/bin.js.map +2 -2
- package/package.json +5 -5
package/dist/bin.js
CHANGED
|
@@ -9653,11 +9653,17 @@ function formatHookResponse(result) {
|
|
|
9653
9653
|
if (!result.allowed) {
|
|
9654
9654
|
const reason = result.decision?.decision?.reason ?? "Action denied";
|
|
9655
9655
|
const violations = result.decision?.violations ?? [];
|
|
9656
|
-
const parts = [
|
|
9656
|
+
const parts = [reason];
|
|
9657
9657
|
if (violations.length > 0) {
|
|
9658
9658
|
parts.push(`Violations: ${violations.map((v) => v.name).join(", ")}`);
|
|
9659
9659
|
}
|
|
9660
|
-
return JSON.stringify({
|
|
9660
|
+
return JSON.stringify({
|
|
9661
|
+
hookSpecificOutput: {
|
|
9662
|
+
hookEventName: "PreToolUse",
|
|
9663
|
+
permissionDecision: "deny",
|
|
9664
|
+
permissionDecisionReason: parts.join(" | ")
|
|
9665
|
+
}
|
|
9666
|
+
});
|
|
9661
9667
|
}
|
|
9662
9668
|
return "";
|
|
9663
9669
|
}
|
|
@@ -29062,7 +29068,7 @@ async function main() {
|
|
|
29062
29068
|
}
|
|
29063
29069
|
case "--version":
|
|
29064
29070
|
case "-v": {
|
|
29065
|
-
console.log(`agentguard v${"1.1.
|
|
29071
|
+
console.log(`agentguard v${"1.1.5"}`);
|
|
29066
29072
|
break;
|
|
29067
29073
|
}
|
|
29068
29074
|
case "help":
|