@ax0l0tl/agent-governance-opencode 4.0.4 → 4.0.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.
Files changed (2) hide show
  1. package/package.json +2 -3
  2. package/src/index.mjs +3 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ax0l0tl/agent-governance-opencode",
3
- "version": "4.0.4",
3
+ "version": "4.0.5",
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",
@@ -42,8 +42,7 @@
42
42
  },
43
43
  "homepage": "https://github.com/microsoft/agent-governance-toolkit/tree/main/agent-governance-opencode",
44
44
  "dependencies": {
45
- "@microsoft/agent-governance-sdk": "3.7.0",
46
- "@opencode-ai/plugin": "1.17.1"
45
+ "@microsoft/agent-governance-sdk": "3.7.0"
47
46
  },
48
47
  "engines": {
49
48
  "node": ">=22.0.0"
package/src/index.mjs CHANGED
@@ -1,10 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { appendFileSync } from "node:fs";
5
- import { homedir } from "node:os";
6
- import { join } from "node:path";
7
- import { tool } from "@opencode-ai/plugin";
8
4
  import {
9
5
  checkArbitraryText,
10
6
  evaluateOpenCodePrompt,
@@ -82,12 +78,6 @@ export const AgtGovernance = async (ctx) => {
82
78
  // OpenCode emits a wide range of events. Only inspect prompt-bearing
83
79
  // events; ignore the rest cheaply.
84
80
  const prompt = extractPromptFromEvent(event);
85
- // TODO(temporary): remove after verifying which event types reach this hook.
86
- try {
87
- const logPath = join(homedir(), ".config", "opencode", "agt", "event-debug.ndjson");
88
- const entry = JSON.stringify({ ts: new Date().toISOString(), type: event?.type ?? null, covered: Boolean(prompt), event }) + "\n";
89
- appendFileSync(logPath, entry, "utf8");
90
- } catch { /* best-effort */ }
91
81
  if (!prompt) {
92
82
  return;
93
83
  }
@@ -159,9 +149,9 @@ export const AgtGovernance = async (ctx) => {
159
149
  agt_policy_check_text: {
160
150
  description:
161
151
  "Check text against AGT prompt, context-poisoning, and MCP-style threat detectors.",
162
- args: {
163
- text: tool.schema.string().describe("Text to inspect."),
164
- },
152
+ args: {
153
+ text: { type: "string", description: "Text to inspect." },
154
+ },
165
155
  async execute(args) {
166
156
  const state = await getState();
167
157
  const text = typeof args?.text === "string" ? args.text : "";