@gotgenes/pi-permission-system 5.14.0 → 5.14.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 CHANGED
@@ -5,6 +5,19 @@ 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.14.1](https://github.com/gotgenes/pi-permission-system/compare/v5.14.0...v5.14.1) (2026-05-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * show tool name instead of bare wildcard in session-approval label ([1a65c30](https://github.com/gotgenes/pi-permission-system/commit/1a65c3017f25012c3a7ced63f26d40fcecea81d3))
14
+ * surface-prefixed session-approval labels for all permission surfaces ([759da03](https://github.com/gotgenes/pi-permission-system/commit/759da03be9c0d847ec6de58e161ef2e7cbbc70b8))
15
+
16
+
17
+ ### Documentation
18
+
19
+ * **retro:** add retro notes for issue [#122](https://github.com/gotgenes/pi-permission-system/issues/122) ([7867db2](https://github.com/gotgenes/pi-permission-system/commit/7867db22054df00e13aa6c88347238dadaa63166))
20
+
8
21
  ## [5.14.0](https://github.com/gotgenes/pi-permission-system/compare/v5.13.0...v5.14.0) (2026-05-09)
9
22
 
10
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gotgenes/pi-permission-system",
3
- "version": "5.14.0",
3
+ "version": "5.14.1",
4
4
  "description": "Permission enforcement extension for the Pi coding agent.",
5
5
  "type": "module",
6
6
  "files": [
@@ -57,8 +57,21 @@ export function suggestMcpPattern(target: string): string {
57
57
  return "*";
58
58
  }
59
59
 
60
- function buildLabel(pattern: string): string {
61
- return `Yes, allow "${pattern}" for this session`;
60
+ /** Surface-aware human-readable labels for the session-approval option. */
61
+ function buildLabel(pattern: string, surface: string): string {
62
+ switch (surface) {
63
+ case "bash":
64
+ return `Yes, allow bash "${pattern}" for this session`;
65
+ case "mcp":
66
+ return `Yes, allow mcp tool "${pattern}" for this session`;
67
+ case "skill":
68
+ return `Yes, allow skill "${pattern}" for this session`;
69
+ case "external_directory":
70
+ return `Yes, allow access to external directory "${pattern}" for this session`;
71
+ default:
72
+ // Tool surfaces (read, write, edit, grep, find, ls, extension tools)
73
+ return `Yes, allow tool "${surface}" for this session`;
74
+ }
62
75
  }
63
76
 
64
77
  /**
@@ -92,5 +105,5 @@ export function suggestSessionPattern(
92
105
  break;
93
106
  }
94
107
 
95
- return { surface, pattern, label: buildLabel(pattern) };
108
+ return { surface, pattern, label: buildLabel(pattern, surface) };
96
109
  }
@@ -136,23 +136,46 @@ describe("suggestSessionPattern", () => {
136
136
  const result = suggestSessionPattern("edit", "*");
137
137
  expect(result).toMatchObject({ surface: "edit", pattern: "*" });
138
138
  });
139
+
140
+ it("label shows tool name instead of bare wildcard", () => {
141
+ const result = suggestSessionPattern("find", "*");
142
+ expect(result.label).toBe('Yes, allow tool "find" for this session');
143
+ });
139
144
  });
140
145
 
141
146
  describe("label field", () => {
142
- it("includes the suggested pattern in the label", () => {
143
- // git arity=2, "git status" has 2 tokens → trailing wildcard.
147
+ it("bash label includes surface prefix and pattern", () => {
144
148
  const result = suggestSessionPattern("bash", "git status");
145
- expect(result.label).toContain("git status*");
149
+ expect(result.label).toBe(
150
+ 'Yes, allow bash "git status*" for this session',
151
+ );
146
152
  });
147
153
 
148
- it("wraps the pattern in quotes in the label", () => {
154
+ it("mcp label includes surface prefix and pattern", () => {
149
155
  const result = suggestSessionPattern("mcp", "exa:search");
150
- expect(result.label).toContain('"exa:*"');
156
+ expect(result.label).toBe('Yes, allow mcp tool "exa:*" for this session');
151
157
  });
152
158
 
153
- it("label reads as a natural session-approval option", () => {
159
+ it("skill label includes surface prefix", () => {
154
160
  const result = suggestSessionPattern("skill", "librarian");
155
- expect(result.label).toBe('Yes, allow "librarian" for this session');
161
+ expect(result.label).toBe(
162
+ 'Yes, allow skill "librarian" for this session',
163
+ );
164
+ });
165
+
166
+ it("external_directory label includes surface prefix", () => {
167
+ const result = suggestSessionPattern(
168
+ "external_directory",
169
+ "/tmp/foo.txt",
170
+ );
171
+ expect(result.label).toBe(
172
+ 'Yes, allow access to external directory "/tmp/*" for this session',
173
+ );
174
+ });
175
+
176
+ it("tool label shows tool name, not wildcard pattern", () => {
177
+ const result = suggestSessionPattern("edit", "*");
178
+ expect(result.label).toBe('Yes, allow tool "edit" for this session');
156
179
  });
157
180
  });
158
181
  });