opencode-v2-guard 1.0.1 → 1.0.2

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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # opencode-guard
1
+ # opencode-v2-guard
2
2
 
3
3
  Security plugin for [OpenCode](https://opencode.ai) V2: intercepts prompts, tool calls and shell commands, detects secrets and personal data, and masks them **before** they reach disk, model context, logs or the network. No LLM involved — only deterministic patterns.
4
4
 
@@ -49,13 +49,13 @@ Or a local checkout:
49
49
  ```json
50
50
  "plugins": [
51
51
  {
52
- "package": "/path/to/opencode-guard",
52
+ "package": "/path/to/opencode-v2-guard",
53
53
  "options": { "mode": "enforce" }
54
54
  }
55
55
  ]
56
56
  ```
57
57
 
58
- OpenCode installs the npm package automatically on startup. Then `opencode service restart`. Verify with `opencode api get "/api/plugin?directory=..."` — look for `"id":"guard"` with `"status":"active"`.
58
+ OpenCode installs the npm package automatically on startup. Then `opencode service restart`. Verify with `opencode api get "/api/plugin?directory=..."` — look for `"id":"opencode-v2-guard"` with `"status":"active"`.
59
59
 
60
60
  ## Options
61
61
 
@@ -86,7 +86,7 @@ OpenCode installs the npm package automatically on startup. Then `opencode servi
86
86
 
87
87
  ```bash
88
88
  npm install
89
- npm test # node --test (42 tests)
89
+ npm test # node --test (111 tests)
90
90
  npm run typecheck # tsc --noEmit
91
91
  ```
92
92
 
@@ -99,7 +99,7 @@ The OpenCode server watches `src/**` and reloads the plugin on save — no servi
99
99
  **After changes, make sure nothing broke:**
100
100
 
101
101
  ```bash
102
- npm test # expect: pass 42, fail 0
102
+ npm test # expect: pass 111, fail 0
103
103
  ```
104
104
 
105
105
  **If anything misbehaves (plugin failed to load, config changed outside the watched files):**
@@ -172,7 +172,7 @@ opencode service restart
172
172
  ```json
173
173
  "plugins": [
174
174
  {
175
- "package": "/absolute/path/to/opencode-guard",
175
+ "package": "/absolute/path/to/opencode-v2-guard",
176
176
  "options": { "mode": "enforce" }
177
177
  }
178
178
  ]
@@ -210,7 +210,7 @@ OpenCode сам установит npm-пакет при старте. Зате
210
210
 
211
211
  ```bash
212
212
  npm install
213
- npm test # node --test (52 теста)
213
+ npm test # node --test (111 тестов)
214
214
  npm run typecheck # tsc --noEmit
215
215
  ```
216
216
 
@@ -220,7 +220,7 @@ npm run typecheck # tsc --noEmit
220
220
 
221
221
  **Правки кода:** сохранил файл — сервер сам перезагрузил плагин (file watcher). Никаких команд не требуется.
222
222
 
223
- **Проверка, что не сломано:** `npm test` — ожидается `pass 42, fail 0`.
223
+ **Проверка, что не сломано:** `npm test` — ожидается `pass 111, fail 0`.
224
224
 
225
225
  **Если что-то пошло не так (плагин не загрузился, правки вне зоны watcher'а):** `opencode service restart` — эта одна команда универсальный «сброс/апдейт».
226
226
 
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "opencode-v2-guard",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Security plugin for OpenCode V2 — deterministic secret/PII redaction, sensitive-path blocking, prompt-injection detection in skills, package-install interception (blocklist + typosquat)",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/avkutuzov/opencode-guard.git"
9
+ "url": "git+https://github.com/avkutuzov/opencode-v2-guard.git"
10
10
  },
11
- "homepage": "https://github.com/avkutuzov/opencode-guard#readme",
11
+ "homepage": "https://github.com/avkutuzov/opencode-v2-guard#readme",
12
12
  "keywords": [
13
13
  "opencode",
14
14
  "opencode-plugin",
package/src/index.ts CHANGED
@@ -3,7 +3,7 @@ import { resolveConfig } from "./config.ts"
3
3
  import { registerGuard } from "./guard.ts"
4
4
 
5
5
  export default Plugin.define({
6
- id: "guard",
6
+ id: "opencode-v2-guard",
7
7
  setup(ctx) {
8
8
  const cfg = resolveConfig(ctx.options)
9
9
  return registerGuard(ctx, cfg)