feat: support OpenCode 2 and scrub secret values from tool output
- Default export is { id, setup, server }: OpenCode 2 calls setup(ctx), OpenCode 1 (1.18.29+) calls server()
- Tools defined once in lib/tools.ts and registered for both versions (V2 with codemode: false)
- Blocking covers path args of any tool, patch/apply_patch envelopes, shell commands naming env files, grep output, and V2 permission checks
- Secret-looking values from the project's env files are replaced in every non-envsitter tool's output
- Protected files come from envsitter's path policy; example/template files stay readable
- npm run test:e2e drives the real OpenCode 1 and 2 CLIs with a scripted model
- @opencode-ai/plugin ^1.19.3, @opencode/plugin ^2.1.0 (peer >=2.0.32), envsitter ^0.1.0, TypeScript 6
BREAKING CHANGE: the named export EnvSitterGuard is now the plugin definition object; call EnvSitterGuard.server(input) instead of EnvSitterGuard(input).
This commit is contained in:
+17
-6
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"name": "envsitter-guard",
|
||||
"version": "0.0.4",
|
||||
"description": "OpenCode plugin that prevents agents/tools from reading or editing sensitive .env* files, while still allowing safe inspection via EnvSitter.",
|
||||
"version": "0.1.0",
|
||||
"description": "OpenCode plugin (OpenCode 1 and 2) that prevents agents/tools from reading or editing sensitive .env files, while still allowing safe inspection via EnvSitter.",
|
||||
"license": "MIT",
|
||||
"homepage": "https://boxpositron.github.io/envsitter/guard/",
|
||||
"keywords": [
|
||||
"opencode",
|
||||
"opencode-plugin",
|
||||
@@ -40,17 +41,27 @@
|
||||
"typecheck": "tsc -p tsconfig.json",
|
||||
"build:test": "tsc -p tsconfig.test.json",
|
||||
"test": "npm run build:test && node --test dist-test/test/*.test.js",
|
||||
"test:e2e": "npm run build && node scripts/e2e-opencode.mjs",
|
||||
"prepack": "npm run build",
|
||||
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@opencode-ai/plugin": "^1.1.14",
|
||||
"envsitter": "^0.0.4"
|
||||
"@opencode-ai/plugin": "^1.19.3",
|
||||
"envsitter": "^0.1.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@opencode/plugin": ">=2.0.32"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@opencode/plugin": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "*",
|
||||
"@opencode/plugin": "^2.1.0",
|
||||
"@types/node": "^22.20.5",
|
||||
"husky": "^9.1.7",
|
||||
"typescript": "*"
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
||||
Reference in New Issue
Block a user