@melihmucuk/leash 1.0.0 → 1.0.1

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
@@ -57,7 +57,7 @@ Add to `~/.pi/agent/settings.json`:
57
57
 
58
58
  **OpenCode** - [docs](https://opencode.ai/docs/plugins/)
59
59
 
60
- Add to `~/.config/opencode/config.json`:
60
+ Add to `~/.config/opencode/opencode.json` (or `opencode.jsonc` if you use that):
61
61
 
62
62
  ```json
63
63
  {
package/bin/leash.js CHANGED
@@ -14,7 +14,18 @@ function getDistPath() {
14
14
 
15
15
  function getConfigPath(platformKey) {
16
16
  const platform = PLATFORMS[platformKey];
17
- return platform ? join(homedir(), platform.configPath) : null;
17
+ if (!platform) return null;
18
+
19
+ // Support multiple config paths (first existing wins, fallback to last)
20
+ if (platform.configPaths) {
21
+ for (const p of platform.configPaths) {
22
+ const full = join(homedir(), p);
23
+ if (existsSync(full)) return full;
24
+ }
25
+ return join(homedir(), platform.configPaths.at(-1));
26
+ }
27
+
28
+ return join(homedir(), platform.configPath);
18
29
  }
19
30
 
20
31
  function getLeashPath(platformKey) {
package/bin/lib.js CHANGED
@@ -4,7 +4,10 @@ import { dirname } from "path";
4
4
  export const PLATFORMS = {
5
5
  opencode: {
6
6
  name: "OpenCode",
7
- configPath: ".config/opencode/config.json",
7
+ configPaths: [
8
+ ".config/opencode/opencode.jsonc",
9
+ ".config/opencode/opencode.json",
10
+ ],
8
11
  distPath: "opencode/leash.js",
9
12
  setup: (config, leashPath) => {
10
13
  config.plugins = config.plugins || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@melihmucuk/leash",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "type": "module",
5
5
  "description": "Security guardrails for AI coding agents",
6
6
  "bin": {