@aliou/pi-guardrails 0.6.1 → 0.7.0
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/config.ts +9 -7
- package/package.json +2 -2
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.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"README.md"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@aliou/pi-utils-settings": "^0.
|
|
35
|
+
"@aliou/pi-utils-settings": "^0.2.0",
|
|
36
36
|
"@aliou/sh": "^0.1.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|