opencode-shell-safety 0.2.2 → 0.2.3

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -33
  3. package/package.json +3 -1
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Alexandru Nedelcu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # opencode-shell-safety
2
2
 
3
- An OpenCode v2 plugin that uses [Jev](https://en.wikipedia.org/wiki/Jev_(AI_model))
4
- to classify shell permission requests against the active agent definition and
5
- its filesystem policy.
3
+ [![npm version](https://img.shields.io/npm/v/opencode-shell-safety)](https://www.npmjs.com/package/opencode-shell-safety)
4
+
5
+ An OpenCode v2 plugin that uses [Jev](<https://en.wikipedia.org/wiki/Jev_(AI_model)>) to classify shell permission requests against the active agent definition and its filesystem policy.
6
+
7
+ This project is part of [alexandru/agents-config](https://github.com/alexandru/agents-config). See it in use in my [OpenCode configuration](https://github.com/alexandru/opencode-config).
6
8
 
7
9
  ## Configuration
8
10
 
@@ -21,12 +23,12 @@ its filesystem policy.
21
23
  "integration": "opencode",
22
24
  "agents": {
23
25
  "Explorer": {
24
- "enabled": true
25
- }
26
- }
27
- }
28
- }
29
- ]
26
+ "enabled": true,
27
+ },
28
+ },
29
+ },
30
+ },
31
+ ],
30
32
  }
31
33
  ```
32
34
 
@@ -51,35 +53,35 @@ Get an API key from [TypeSafe AI](https://docs.typesafe.ai/introduction/quicksta
51
53
  "apiKeyEnv": "TYPESAFE_API_KEY",
52
54
  "agents": {
53
55
  "Explorer": {
54
- "enabled": true
55
- }
56
- }
57
- }
58
- }
59
- ]
56
+ "enabled": true,
57
+ },
58
+ },
59
+ },
60
+ },
61
+ ],
60
62
  }
61
63
  ```
62
64
 
63
65
  ## Options
64
66
 
65
- | Option | Description |
66
- | --- | --- |
67
- | `endpoint` | SystemOne HTTP endpoint. |
68
- | `model` | Model sent in each classification request. |
69
- | `integration` | OpenCode integration whose credential takes precedence over `apiKeyEnv`. |
70
- | `apiKeyEnv` | Environment variable to read if no integration credential is available. |
71
- | `allowProbability` | Minimum `withinPolicy` probability required to allow a command. |
72
- | `violationProbability` | Probability at or above which a filesystem, remote-mutation, or credential violation denies a command. |
73
- | `timeoutMs` | Timeout for one request attempt. |
74
- | `maxAttempts` | Maximum attempts for network, timeout, rate-limit, and server failures. |
75
- | `retryDelayMs` | Delay between retry attempts. |
76
- | `cache.capacity` | Maximum number of cached classification results. |
77
- | `cache.ttlMs` | Successful classification cache lifetime in milliseconds. |
78
- | `agents.<name>.enabled` | Enables classification for an agent. |
79
- | `agents.<name>.thresholds` | Optional per-agent probability thresholds. |
80
- | `agents.<name>.http` | Optional. Omission permits no HTTP methods or credential hosts. |
81
- | `agents.<name>.http.methods` | HTTP methods the policy permits. |
82
- | `agents.<name>.http.credentials` | Environment credential names mapped to allowed HTTPS hosts. |
67
+ | Option | Description |
68
+ | -------------------------------- | ------------------------------------------------------------------------------------------------------ |
69
+ | `endpoint` | SystemOne HTTP endpoint. |
70
+ | `model` | Model sent in each classification request. |
71
+ | `integration` | OpenCode integration whose credential takes precedence over `apiKeyEnv`. |
72
+ | `apiKeyEnv` | Environment variable to read if no integration credential is available. |
73
+ | `allowProbability` | Minimum `withinPolicy` probability required to allow a command. |
74
+ | `violationProbability` | Probability at or above which a filesystem, remote-mutation, or credential violation denies a command. |
75
+ | `timeoutMs` | Timeout for one request attempt. |
76
+ | `maxAttempts` | Maximum attempts for network, timeout, rate-limit, and server failures. |
77
+ | `retryDelayMs` | Delay between retry attempts. |
78
+ | `cache.capacity` | Maximum number of cached classification results. |
79
+ | `cache.ttlMs` | Successful classification cache lifetime in milliseconds. |
80
+ | `agents.<name>.enabled` | Enables classification for an agent. |
81
+ | `agents.<name>.thresholds` | Optional per-agent probability thresholds. |
82
+ | `agents.<name>.http` | Optional. Omission permits no HTTP methods or credential hosts. |
83
+ | `agents.<name>.http.methods` | HTTP methods the policy permits. |
84
+ | `agents.<name>.http.credentials` | Environment credential names mapped to allowed HTTPS hosts. |
83
85
 
84
86
  Set at least one of `integration` or `apiKeyEnv`.
85
87
 
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "opencode-shell-safety",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "OpenCode plugin that classifies shell permission requests against agent policy.",
5
+ "license": "MIT",
5
6
  "type": "module",
6
7
  "exports": {
7
8
  ".": "./src/index.ts"
8
9
  },
9
10
  "files": [
11
+ "LICENSE",
10
12
  "src",
11
13
  "README.md"
12
14
  ],