@ax0l0tl/agent-governance-opencode 4.0.6 → 4.0.7

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/package.json +1 -1
  2. package/src/index.mjs +8 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ax0l0tl/agent-governance-opencode",
3
- "version": "4.0.6",
3
+ "version": "4.0.7",
4
4
  "description": "Public Preview — OpenCode CLI governance plugin for Agent Governance Toolkit developer protection policies",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
package/src/index.mjs CHANGED
@@ -89,14 +89,15 @@ export const AgtGovernance = async (ctx) => {
89
89
  prompt,
90
90
  sessionId: event?.properties?.sessionID ?? event?.properties?.sessionId,
91
91
  });
92
- if (result.effect === "deny") {
93
- // TEMP: file log to verify event hook fires on user input
94
- try {
95
- const entry = `[AGT DENY] ${new Date().toISOString()} sessionId=${event?.properties?.sessionID ?? event?.properties?.sessionId ?? "unknown"} reason=${result.reason}\n`;
92
+
93
+ // TEMP: file log to verify event hook fires on user input
94
+ try {
95
+ const entry = `[AGT] ${new Date().toISOString()} sessionId=${event?.properties?.sessionID ?? event?.properties?.sessionId ?? "unknown"} effect=${result.effect} reason=${result.reason}\n`;
96
96
  appendFileSync(join(dirname(state.auditPath), "agt-deny.log"), entry, "utf8");
97
- } catch {
98
- // best-effort — do not suppress the deny
99
- }
97
+ } catch {
98
+ // best-effort — do not suppress the deny
99
+ }
100
+ if (result.effect === "deny") {
100
101
  throw new Error(result.reason || "AGT governance blocked the submitted prompt.");
101
102
  }
102
103
  },