@gotgenes/pi-permission-system 5.18.0 → 5.18.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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/pattern-suggest.ts +5 -0
- package/tests/pattern-suggest.test.ts +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [5.18.1](https://github.com/gotgenes/pi-permission-system/compare/v5.18.0...v5.18.1) (2026-05-15)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Documentation
|
|
12
|
+
|
|
13
|
+
* plan Pi GitHub Tools extension ([#153](https://github.com/gotgenes/pi-permission-system/issues/153)) ([6f8566f](https://github.com/gotgenes/pi-permission-system/commit/6f8566feba22981e3f726aae8544bab53dce8a8a))
|
|
14
|
+
* **retro:** add retro notes for issue [#145](https://github.com/gotgenes/pi-permission-system/issues/145) ([70ff363](https://github.com/gotgenes/pi-permission-system/commit/70ff36369a902f82d78e277ba9fa7948bb62d82c))
|
|
15
|
+
* update /ship-issue to use pi-github-tools ([#153](https://github.com/gotgenes/pi-permission-system/issues/153)) ([7a4de21](https://github.com/gotgenes/pi-permission-system/commit/7a4de21ee16f7a1fff3ef8cf6e2b3a0516183ab5))
|
|
16
|
+
* update docs and pattern-suggest for path surface ([6defcdb](https://github.com/gotgenes/pi-permission-system/commit/6defcdb5430296c82da6eefc1980ab109dedc202))
|
|
17
|
+
|
|
8
18
|
## [5.18.0](https://github.com/gotgenes/pi-permission-system/compare/v5.17.0...v5.18.0) (2026-05-14)
|
|
9
19
|
|
|
10
20
|
|
package/README.md
CHANGED
|
@@ -17,6 +17,7 @@ Permission enforcement extension for the [Pi](https://pi.mariozechner.at/) codin
|
|
|
17
17
|
- **Enforces allow / ask / deny** at tool-call time with UI confirmation dialogs
|
|
18
18
|
- **Controls bash commands** with wildcard pattern matching (`git *: ask`, `rm -rf *: deny`)
|
|
19
19
|
- **Gates MCP and skill access** at server, tool, and skill-name granularity
|
|
20
|
+
- **Protects sensitive file patterns** — cross-cutting `path` rules deny `.env`, `~/.ssh/*`, etc. across all tools and bash at once
|
|
20
21
|
- **Guards external paths** — prompts before file tools or bash commands reach outside `cwd`
|
|
21
22
|
- **Forwards prompts from subagents** — `ask` policies work even in non-UI execution contexts
|
|
22
23
|
|
package/package.json
CHANGED
package/src/pattern-suggest.ts
CHANGED
|
@@ -69,6 +69,8 @@ function buildLabel(pattern: string, surface: string): string {
|
|
|
69
69
|
return `Yes, allow skill "${pattern}" for this session`;
|
|
70
70
|
case "external_directory":
|
|
71
71
|
return `Yes, allow access to external directory "${pattern}" for this session`;
|
|
72
|
+
case "path":
|
|
73
|
+
return `Yes, allow path "${pattern}" for this session`;
|
|
72
74
|
default:
|
|
73
75
|
// Path-bearing tools with a specific path pattern show the pattern.
|
|
74
76
|
if (PATH_BEARING_TOOLS.has(surface) && pattern !== "*") {
|
|
@@ -104,6 +106,9 @@ export function suggestSessionPattern(
|
|
|
104
106
|
case "external_directory":
|
|
105
107
|
pattern = deriveApprovalPattern(value);
|
|
106
108
|
break;
|
|
109
|
+
case "path":
|
|
110
|
+
pattern = deriveApprovalPattern(value);
|
|
111
|
+
break;
|
|
107
112
|
default:
|
|
108
113
|
// Path-bearing tools: derive a directory-scoped pattern from the path.
|
|
109
114
|
if (PATH_BEARING_TOOLS.has(surface) && value !== "*") {
|
|
@@ -121,6 +121,21 @@ describe("suggestSessionPattern", () => {
|
|
|
121
121
|
});
|
|
122
122
|
});
|
|
123
123
|
|
|
124
|
+
describe("path surface", () => {
|
|
125
|
+
it("returns directory-scoped pattern for a file path", () => {
|
|
126
|
+
const result = suggestSessionPattern("path", "src/.env");
|
|
127
|
+
expect(result).toMatchObject({
|
|
128
|
+
surface: "path",
|
|
129
|
+
pattern: "src/*",
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("label includes path pattern", () => {
|
|
134
|
+
const result = suggestSessionPattern("path", "src/.env");
|
|
135
|
+
expect(result.label).toBe('Yes, allow path "src/*" for this session');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
|
|
124
139
|
describe("path-bearing tool surfaces", () => {
|
|
125
140
|
it("returns directory-scoped pattern for read with a file path", () => {
|
|
126
141
|
const result = suggestSessionPattern("read", "/outside/project/file.ts");
|