@aliou/pi-guardrails 0.6.1 → 0.7.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 +8 -4
- package/config.ts +9 -7
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -68,7 +68,6 @@ Configs without a `version` field are automatically migrated on first load. The
|
|
|
68
68
|
|
|
69
69
|
```json
|
|
70
70
|
{
|
|
71
|
-
"version": "0.7.0-20260204",
|
|
72
71
|
"enabled": true,
|
|
73
72
|
"features": {
|
|
74
73
|
"protectEnvFiles": true,
|
|
@@ -78,12 +77,17 @@ Configs without a `version` field are automatically migrated on first load. The
|
|
|
78
77
|
"protectedPatterns": [
|
|
79
78
|
{ "pattern": ".env" },
|
|
80
79
|
{ "pattern": ".env.local" },
|
|
81
|
-
{ "pattern": ".env.production" }
|
|
80
|
+
{ "pattern": ".env.production" },
|
|
81
|
+
{ "pattern": ".env.prod" },
|
|
82
|
+
{ "pattern": ".dev.vars" }
|
|
82
83
|
],
|
|
83
84
|
"allowedPatterns": [
|
|
84
85
|
{ "pattern": ".env.example" },
|
|
85
86
|
{ "pattern": ".env.sample" },
|
|
86
|
-
{ "pattern": "
|
|
87
|
+
{ "pattern": ".env.test" },
|
|
88
|
+
{ "pattern": "*.example.env" },
|
|
89
|
+
{ "pattern": "*.sample.env" },
|
|
90
|
+
{ "pattern": "*.test.env" }
|
|
87
91
|
],
|
|
88
92
|
"protectedDirectories": [],
|
|
89
93
|
"protectedTools": ["read", "write", "edit", "bash", "grep", "find", "ls"],
|
|
@@ -103,7 +107,7 @@ Configs without a `version` field are automatically migrated on first load. The
|
|
|
103
107
|
}
|
|
104
108
|
```
|
|
105
109
|
|
|
106
|
-
All fields are optional. Missing fields use defaults shown above.
|
|
110
|
+
All fields are optional. Missing fields use defaults shown above. The default patterns listed here may change between versions. Check the source code or run `/guardrails:settings` to see the current defaults and update them to your liking.
|
|
107
111
|
|
|
108
112
|
### Pattern Format
|
|
109
113
|
|
package/config.ts
CHANGED
|
@@ -201,16 +201,18 @@ export const configLoader = new ConfigLoader<GuardrailsConfig, ResolvedConfig>(
|
|
|
201
201
|
"guardrails",
|
|
202
202
|
DEFAULT_CONFIG,
|
|
203
203
|
{
|
|
204
|
+
scopes: ["global", "local", "memory"],
|
|
204
205
|
migrations,
|
|
205
|
-
afterMerge: (resolved, global,
|
|
206
|
+
afterMerge: (resolved, global, local, memory) => {
|
|
206
207
|
// customPatterns replaces the entire patterns array and disables
|
|
207
208
|
// built-in structural matchers (user owns all matching).
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
// Priority: memory > local > global
|
|
210
|
+
const customPatterns =
|
|
211
|
+
memory?.permissionGate?.customPatterns ??
|
|
212
|
+
local?.permissionGate?.customPatterns ??
|
|
213
|
+
global?.permissionGate?.customPatterns;
|
|
214
|
+
if (customPatterns) {
|
|
215
|
+
resolved.permissionGate.patterns = customPatterns;
|
|
214
216
|
resolved.permissionGate.useBuiltinMatchers = false;
|
|
215
217
|
}
|
|
216
218
|
return resolved;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-guardrails",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"README.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@aliou/
|
|
36
|
-
"@aliou/
|
|
35
|
+
"@aliou/sh": "^0.1.0",
|
|
36
|
+
"@aliou/pi-utils-settings": "^0.2.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"@mariozechner/pi-coding-agent": ">=0.51.0"
|