@gotgenes/pi-permission-system 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/CHANGELOG.md +384 -0
- package/LICENSE +21 -0
- package/README.md +606 -0
- package/config/config.example.json +27 -0
- package/index.ts +3 -0
- package/package.json +85 -0
- package/schemas/permissions.schema.json +88 -0
- package/src/bash-filter.ts +51 -0
- package/src/before-agent-start-cache.ts +44 -0
- package/src/common.ts +88 -0
- package/src/config-modal.ts +282 -0
- package/src/config-reporter.ts +26 -0
- package/src/extension-config.ts +203 -0
- package/src/index.ts +1983 -0
- package/src/logging.ts +118 -0
- package/src/model-option-compatibility.ts +182 -0
- package/src/permission-dialog.ts +89 -0
- package/src/permission-forwarding.ts +126 -0
- package/src/permission-manager.ts +989 -0
- package/src/skill-prompt-sanitizer.ts +344 -0
- package/src/status.ts +35 -0
- package/src/system-prompt-sanitizer.ts +210 -0
- package/src/tool-registry.ts +139 -0
- package/src/types.ts +50 -0
- package/src/wildcard-matcher.ts +84 -0
- package/src/yolo-mode.ts +29 -0
- package/src/zellij-modal.ts +1117 -0
- package/tests/config-modal.test.ts +248 -0
- package/tests/config-reporter.test.ts +139 -0
- package/tests/extension-config.test.ts +120 -0
- package/tests/permission-system.test.ts +2356 -0
- package/tests/session-start.test.ts +139 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.7.0](https://github.com/gotgenes/pi-permission-system/compare/v0.6.1...v0.7.0) (2026-05-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* add prek pre-commit hooks for Biome and markdownlint ([#14](https://github.com/gotgenes/pi-permission-system/issues/14)) ([1093e87](https://github.com/gotgenes/pi-permission-system/commit/1093e8774145517f4b65f1e489a86143d7c54fb0))
|
|
14
|
+
* align prek config with pi-autoformat conventions ([#14](https://github.com/gotgenes/pi-permission-system/issues/14)) ([a9b72aa](https://github.com/gotgenes/pi-permission-system/commit/a9b72aaecaa8c5d7fc5feac588ef2da2c4e5372d))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* use check-only mode for pre-commit hooks ([#14](https://github.com/gotgenes/pi-permission-system/issues/14)) ([fc37f1f](https://github.com/gotgenes/pi-permission-system/commit/fc37f1f1aa6d3aed9a8b8c9c88a98bf021250996))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
* plan prek pre-commit linting setup ([#14](https://github.com/gotgenes/pi-permission-system/issues/14)) ([5debd98](https://github.com/gotgenes/pi-permission-system/commit/5debd986bd24621105d1138daacb17fa4fb3ab8e))
|
|
25
|
+
* **retro:** add retro notes for issue [#13](https://github.com/gotgenes/pi-permission-system/issues/13) ([a0b889d](https://github.com/gotgenes/pi-permission-system/commit/a0b889d176ed607e5fcf3af793318ab35c871ac3))
|
|
26
|
+
|
|
27
|
+
## [0.6.1](https://github.com/gotgenes/pi-permission-system/compare/v0.6.0...v0.6.1) (2026-05-02)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* consolidate duplicate session_start handlers ([#13](https://github.com/gotgenes/pi-permission-system/issues/13)) ([6f5591a](https://github.com/gotgenes/pi-permission-system/commit/6f5591ac6097f5411075e2d10469df9ec5445329))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Documentation
|
|
36
|
+
|
|
37
|
+
* plan consolidate duplicate session_start handlers ([#13](https://github.com/gotgenes/pi-permission-system/issues/13)) ([3b045c2](https://github.com/gotgenes/pi-permission-system/commit/3b045c272a848687642bedca7da463ab56ade688))
|
|
38
|
+
* remove dual-handler caveat from AGENTS.md ([#13](https://github.com/gotgenes/pi-permission-system/issues/13)) ([5e8bf87](https://github.com/gotgenes/pi-permission-system/commit/5e8bf870fb3aa04c942e6804a5c2023c1e3e487e))
|
|
39
|
+
* **retro:** add retro notes for issue [#6](https://github.com/gotgenes/pi-permission-system/issues/6) ([8921a47](https://github.com/gotgenes/pi-permission-system/commit/8921a473f1864d2c0f3c8417f6effdcbc6b35e89))
|
|
40
|
+
|
|
41
|
+
## [0.6.0](https://github.com/gotgenes/pi-permission-system/compare/v0.5.0...v0.6.0) (2026-05-02)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
* add getResolvedPolicyPaths to PermissionManager ([#6](https://github.com/gotgenes/pi-permission-system/issues/6)) ([663b892](https://github.com/gotgenes/pi-permission-system/commit/663b892fbcaa092c9ac139283ed2e7bdd7e42b43))
|
|
47
|
+
* emit config.resolved review-log entry at startup ([#6](https://github.com/gotgenes/pi-permission-system/issues/6)) ([6968171](https://github.com/gotgenes/pi-permission-system/commit/6968171aca2e86c60a104c09df7d58d5bb1e59aa))
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Documentation
|
|
51
|
+
|
|
52
|
+
* document config.resolved diagnostic log entry ([#6](https://github.com/gotgenes/pi-permission-system/issues/6)) ([332fe41](https://github.com/gotgenes/pi-permission-system/commit/332fe413457a6913021ffc4cb8d6e80a7cd7fff2))
|
|
53
|
+
* plan config.resolved diagnostic log entry ([#6](https://github.com/gotgenes/pi-permission-system/issues/6)) ([8d51ff3](https://github.com/gotgenes/pi-permission-system/commit/8d51ff3a4464866ba9604e3bd6b52ab9bfb8f258))
|
|
54
|
+
|
|
55
|
+
## [0.5.0](https://github.com/gotgenes/pi-permission-system/compare/v0.4.6...v0.5.0) (2026-05-02)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### Features
|
|
59
|
+
|
|
60
|
+
* add extension config, logging system, and permission request events ([6252d9e](https://github.com/gotgenes/pi-permission-system/commit/6252d9e44ae0611dd399208f66da685dec5d4dbf))
|
|
61
|
+
* add getToolPermission for tool-level permission checks ([fe3ab17](https://github.com/gotgenes/pi-permission-system/commit/fe3ab179501ef57e2786dc6815ec2255eba77bc5))
|
|
62
|
+
* add guidelines sanitization to system prompt sanitizer ([5689e4a](https://github.com/gotgenes/pi-permission-system/commit/5689e4a3bb028517b09ba4f1d2999936316acb33))
|
|
63
|
+
* add yolo mode and permission forwarding ([b36e113](https://github.com/gotgenes/pi-permission-system/commit/b36e113266669b30065ccc45fcc9ed3a37ebf18d))
|
|
64
|
+
* **caching:** add before-agent-start cache for active tools and prompt state ([b0f1c85](https://github.com/gotgenes/pi-permission-system/commit/b0f1c85e35f61cb1b05a2ab3f92a670fdfc45f02))
|
|
65
|
+
* detect misplaced permission keys in config.json ([#4](https://github.com/gotgenes/pi-permission-system/issues/4)) ([5be5eda](https://github.com/gotgenes/pi-permission-system/commit/5be5eda17a473b8cd3ed0fecc4d166a8339fae7b))
|
|
66
|
+
* loadPermissionSystemConfig warns on misplaced permission keys ([#4](https://github.com/gotgenes/pi-permission-system/issues/4)) ([4f0e173](https://github.com/gotgenes/pi-permission-system/commit/4f0e173e62037fef57fe724fd21f3327213f4570))
|
|
67
|
+
* **permission-system:** expose tool input params in logs and ask prompts ([e334964](https://github.com/gotgenes/pi-permission-system/commit/e334964a9a673d17acb29c8e6d82c539827aca6a))
|
|
68
|
+
* **permission:** add layered policy reload handling ([ad0a4da](https://github.com/gotgenes/pi-permission-system/commit/ad0a4dac4fc274736e8f20ad08145316b30d61cb))
|
|
69
|
+
* **permission:** add state and denial reason to permission prompts ([d499b94](https://github.com/gotgenes/pi-permission-system/commit/d499b94985b396006598b7011877cc9885efefd3))
|
|
70
|
+
* **permission:** forward subagent approval requests ([bb9086e](https://github.com/gotgenes/pi-permission-system/commit/bb9086e0e1b99a665fc5ddbcc1665f6421e8ccf7))
|
|
71
|
+
* **permission:** log sanitized tool input previews ([192b66c](https://github.com/gotgenes/pi-permission-system/commit/192b66ce7720a20d63910bdfc95f075130a43773))
|
|
72
|
+
* **special:** enforce external_directory CWD boundary in tool_call handler ([6c59781](https://github.com/gotgenes/pi-permission-system/commit/6c59781a6d69e33eb297ecfb60e6d5b21c3f88b6))
|
|
73
|
+
* **status:** add permission system status sync for yolo mode ([0b77943](https://github.com/gotgenes/pi-permission-system/commit/0b77943adbc8a87de2161fd8037d2d80505fbfd1))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
### Bug Fixes
|
|
77
|
+
|
|
78
|
+
* **events:** listen on session_start instead of nonexistent session_switch ([2bbbaba](https://github.com/gotgenes/pi-permission-system/commit/2bbbaba9d0b31fe08c19e0819f11b4c1c705aa97))
|
|
79
|
+
* **package:** stop publishing config.json ([af1b531](https://github.com/gotgenes/pi-permission-system/commit/af1b5311112046f32e153332bb8e0fb996b6882e))
|
|
80
|
+
* **permission:** add model option compatibility guard ([d9dd506](https://github.com/gotgenes/pi-permission-system/commit/d9dd5063edd1c6a7410105a92c6c45fa9c195699))
|
|
81
|
+
* **permission:** harden prompt and external directory enforcement ([48c3af1](https://github.com/gotgenes/pi-permission-system/commit/48c3af165a6f2c1a4c689c436d8c6c4112ec6aae))
|
|
82
|
+
* **permission:** summarize file tool approval prompts ([3775894](https://github.com/gotgenes/pi-permission-system/commit/3775894f23756ad0ed06ae17961d547b0cb5bc47))
|
|
83
|
+
* **prompt:** remove denied tools from available tools section ([f22bccc](https://github.com/gotgenes/pi-permission-system/commit/f22bcccdca7f9ce9df066973e4735cd2e0427280))
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
### Documentation
|
|
87
|
+
|
|
88
|
+
* add AGENTS.md and .pi/prompts workflow templates ([bebc197](https://github.com/gotgenes/pi-permission-system/commit/bebc197f59ada2dfff24f6fc1ef3cf46b2415675))
|
|
89
|
+
* add readme and changelog ([07e29c5](https://github.com/gotgenes/pi-permission-system/commit/07e29c57a9fcb7731ec62531e7c9f1ef5883c0d1))
|
|
90
|
+
* add Related Pi Extensions cross-linking section ([facdf3f](https://github.com/gotgenes/pi-permission-system/commit/facdf3fda8a5ec2486a818ada2836ef7be039f40))
|
|
91
|
+
* clarify config.json vs permission-policy file ([#4](https://github.com/gotgenes/pi-permission-system/issues/4)) ([464e1d1](https://github.com/gotgenes/pi-permission-system/commit/464e1d19b637807bb754d95397db9cf59d446673))
|
|
92
|
+
* fix recipe ordering and clarify last-match-wins precedence ([70427f6](https://github.com/gotgenes/pi-permission-system/commit/70427f662b16b655fd23867c6960cfae0923b821))
|
|
93
|
+
* plan warn on misplaced permission keys in config.json ([#4](https://github.com/gotgenes/pi-permission-system/issues/4)) ([ffcef67](https://github.com/gotgenes/pi-permission-system/commit/ffcef6787b7ac1bb44acc958266eed9e1b5fbf9a))
|
|
94
|
+
* **release:** finalize 0.4.2 notes ([ea1c587](https://github.com/gotgenes/pi-permission-system/commit/ea1c58761e468dade823b3618e43b8909b6c4aee))
|
|
95
|
+
* **release:** prepare 0.4.3 notes ([73a255c](https://github.com/gotgenes/pi-permission-system/commit/73a255c991c7a14d10711f99973991a68ab50c1b))
|
|
96
|
+
* **release:** prepare 0.4.4 notes ([78f5c48](https://github.com/gotgenes/pi-permission-system/commit/78f5c48aab6a94c7bb7356af4db1798340522848))
|
|
97
|
+
* **release:** prepare v0.4.5 ([e5a713b](https://github.com/gotgenes/pi-permission-system/commit/e5a713b0e3a0149e2728b81c4ca85188ebe668eb))
|
|
98
|
+
* **release:** update CHANGELOG for 0.4.2 ([47084d6](https://github.com/gotgenes/pi-permission-system/commit/47084d6af8fb4b515dad4519c3487f9f6b11d287))
|
|
99
|
+
* update README for [@gotgenes](https://github.com/gotgenes) fork ([f6ff1dd](https://github.com/gotgenes/pi-permission-system/commit/f6ff1dd687e73722e3a1cc8b1f457e6dcc2227ff))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
### Miscellaneous Chores
|
|
103
|
+
|
|
104
|
+
* add biome and markdownlint-cli2 tooling ([3140f32](https://github.com/gotgenes/pi-permission-system/commit/3140f32c4bc4be13f06e1ec337ce525317f565bf))
|
|
105
|
+
* add license, ignores, and assets ([f59ce79](https://github.com/gotgenes/pi-permission-system/commit/f59ce79a6a3c9b48994b9c4a15e5e81d853a7b2b))
|
|
106
|
+
* align npm keywords for discoverability ([fabbb4d](https://github.com/gotgenes/pi-permission-system/commit/fabbb4d024d41ac4c4d01e9218d0d4cc8538ae6b))
|
|
107
|
+
* bootstrap extension project ([4b3e7d5](https://github.com/gotgenes/pi-permission-system/commit/4b3e7d51c5b94ec580bd06943c427a5272ad2be2))
|
|
108
|
+
* bump version to 0.2.0 ([4df5864](https://github.com/gotgenes/pi-permission-system/commit/4df5864414cb5a252eb757b060034ca86e5c96eb))
|
|
109
|
+
* **deps:** update pi peer dependencies ([bf3d7e6](https://github.com/gotgenes/pi-permission-system/commit/bf3d7e6f3610ab69f2988a6748af5c6a6a1193eb))
|
|
110
|
+
* exclude docs folder from version control ([3fa6a49](https://github.com/gotgenes/pi-permission-system/commit/3fa6a496f4c28e65bbcb6787a3e9b5c636706ed3))
|
|
111
|
+
* pin typescript as devDependency ([2ff692f](https://github.com/gotgenes/pi-permission-system/commit/2ff692f36a1061df222364ebe4f44465423d7586))
|
|
112
|
+
* release v0.3.0 ([36a3d7e](https://github.com/gotgenes/pi-permission-system/commit/36a3d7ee2794b9350bdac5de029d9f074a2c63ad))
|
|
113
|
+
* release v0.4.1 ([da22e18](https://github.com/gotgenes/pi-permission-system/commit/da22e1879aaf0bf5d0673eefddd9df29f7f4e256))
|
|
114
|
+
* **release:** cut v0.1.1 ([5d8739b](https://github.com/gotgenes/pi-permission-system/commit/5d8739ba5ceabcbd940ebb61b8ffbbf05a962579))
|
|
115
|
+
* **release:** cut v0.1.2 ([f4f0fe7](https://github.com/gotgenes/pi-permission-system/commit/f4f0fe769f274d3cd1355015620b5636d934095f))
|
|
116
|
+
* **release:** cut v0.1.3 ([88667f2](https://github.com/gotgenes/pi-permission-system/commit/88667f2aa9c1c8de84ad6a9b798635b155a90b65))
|
|
117
|
+
* **release:** cut v0.1.4 ([6c9804b](https://github.com/gotgenes/pi-permission-system/commit/6c9804b4434681248edfde07cff75d32e50240c6))
|
|
118
|
+
* **release:** cut v0.1.5 ([cdaca30](https://github.com/gotgenes/pi-permission-system/commit/cdaca303c1e49bcbe542037204ed77e98f78d02e))
|
|
119
|
+
* **release:** cut v0.1.6 ([644660e](https://github.com/gotgenes/pi-permission-system/commit/644660e37e287b0121c7b5433095e536cd46ee92))
|
|
120
|
+
* **release:** cut v0.1.7 ([1e73124](https://github.com/gotgenes/pi-permission-system/commit/1e731249bc2fdaf5f2e37efdaa1fa58475cd75f9))
|
|
121
|
+
* **release:** cut v0.1.8 ([164a6e3](https://github.com/gotgenes/pi-permission-system/commit/164a6e3434a19b817725edb3ec9db9dd51856393))
|
|
122
|
+
* rename package and update metadata for [@gotgenes](https://github.com/gotgenes) fork ([cd9bc5f](https://github.com/gotgenes/pi-permission-system/commit/cd9bc5f4844210f6a547ce99a8efdef985be8c7f))
|
|
123
|
+
* **types:** replace types-shims.d.ts with real type packages ([3809612](https://github.com/gotgenes/pi-permission-system/commit/380961271ae5bc0f4e68becb42e00335e5e5c1c4))
|
|
124
|
+
|
|
125
|
+
## [Unreleased]
|
|
126
|
+
|
|
127
|
+
## [0.4.6] - 2026-04-28
|
|
128
|
+
|
|
129
|
+
### Added
|
|
130
|
+
- Added bounded, sanitized tool input previews to permission review logs for non-bash/non-MCP tool calls, inspired by PR #10 from @DevkumarPatel.
|
|
131
|
+
|
|
132
|
+
### Changed
|
|
133
|
+
- Reused the extension's safe JSON serialization path for generic tool approval previews so circular values and BigInts are summarized without raw full-input logging.
|
|
134
|
+
- Updated `@mariozechner/pi-ai`, `@mariozechner/pi-coding-agent`, and `@mariozechner/pi-tui` peer dependencies to `^0.70.5`.
|
|
135
|
+
|
|
136
|
+
## [0.4.5] - 2026-04-27
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
- Added a model option compatibility guard for OpenAI Responses/Codex streams so unsupported `temperature` values are removed from stream options and outgoing payloads before provider calls.
|
|
140
|
+
|
|
141
|
+
## [0.4.4] - 2026-04-25
|
|
142
|
+
|
|
143
|
+
### Added
|
|
144
|
+
- Added runtime enforcement for the `external_directory` special permission on path-bearing tools (`read`, `write`, `edit`, `find`, `grep`, `ls`) before normal tool permission checks (thanks to @gotgenes for PR #9)
|
|
145
|
+
- Added readable `ask` prompt summaries for built-in file tools and bounded input previews for generic extension tools so users can make informed approval decisions (thanks to @beantownbytes for PR #8)
|
|
146
|
+
- Added `skill-prompt-sanitizer.ts` to parse and sanitize every `<available_skills>` block, including prompts with multiple skill sections
|
|
147
|
+
|
|
148
|
+
### Changed
|
|
149
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to `^0.70.2`
|
|
150
|
+
- Refactored skill prompt filtering out of `src/index.ts` into a dedicated module for clearer ownership and reuse
|
|
151
|
+
- Permission prompts for `edit`, `write`, `read`, `find`, `grep`, and `ls` now show concise path/action summaries instead of raw multiline JSON
|
|
152
|
+
|
|
153
|
+
### Fixed
|
|
154
|
+
- Denied skills are now removed from all available-skill prompt blocks instead of only the first block
|
|
155
|
+
- Denied skill entries are no longer retained for later skill-read path matching after prompt sanitization
|
|
156
|
+
- External path access now honors `special.external_directory: deny` and blocks `ask` decisions when no UI or forwarding channel is available
|
|
157
|
+
|
|
158
|
+
### Tests
|
|
159
|
+
- Added runtime `tool_call` coverage for external directory deny, ask-without-UI, ask approval, internal path allow, and optional path omission
|
|
160
|
+
- Added prompt regression coverage for generic tool input previews and readable built-in file-tool approval summaries
|
|
161
|
+
- Added multi-block skill prompt sanitizer regression coverage
|
|
162
|
+
|
|
163
|
+
## [0.4.2] - 2026-04-20
|
|
164
|
+
|
|
165
|
+
### Added
|
|
166
|
+
- Added project-level permission layering from the active session workspace via `<cwd>/.pi/agent/pi-permissions.jsonc`
|
|
167
|
+
- Added project-level per-agent overrides via `<cwd>/.pi/agent/agents/<agent>.md` (thanks to @Talia-12 for PR #7)
|
|
168
|
+
- Added reload-aware permission manager refresh paths so policy caches are rebuilt when Pi reload events occur
|
|
169
|
+
- Added a dedicated `tests/` directory with modular test entrypoints and a shared test harness
|
|
170
|
+
- Added before-agent-start caching module to dedupe unchanged active-tool exposure and prompt state across `before_agent_start` lifecycle invocations
|
|
171
|
+
- Added `PermissionPromptDecision` type with `state` and `denialReason` fields for richer permission prompt resolution
|
|
172
|
+
- Added `getPolicyCacheStamp()` method to `PermissionManager` for cache invalidation tracking
|
|
173
|
+
|
|
174
|
+
### Changed
|
|
175
|
+
- Global path resolution now follows Pi's `getAgentDir()` helper, so global config, agents, sessions, and logs respect `PI_CODING_AGENT_DIR` (thanks to @jvortmann for PR #6)
|
|
176
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to `^0.67.68`
|
|
177
|
+
- Updated TypeScript project configuration and npm scripts to run tests from `tests/` instead of `src/`
|
|
178
|
+
- Updated README documentation for project-level policy files, yolo mode config, test layout, and `PI_CODING_AGENT_DIR`
|
|
179
|
+
- Permission prompts and forwarding now return `PermissionPromptDecision` instead of boolean for richer resolution tracking
|
|
180
|
+
- Permission denial messages now include user-provided denial reasons when available
|
|
181
|
+
|
|
182
|
+
### Removed
|
|
183
|
+
- Removed the legacy packaged `asset/` directory because the README now uses externally hosted images instead of repository-bundled screenshots
|
|
184
|
+
|
|
185
|
+
### Fixed
|
|
186
|
+
- `/skill:<name>` permission handling now falls back to the current merged skill policy when no active agent context is available in the main session (thanks to @NSBeidou and @hidromagnetismo for reporting the issue)
|
|
187
|
+
- Skill denial messaging now reflects whether the block came from an agent-specific rule or the merged policy without agent context
|
|
188
|
+
|
|
189
|
+
### Tests
|
|
190
|
+
- Added coverage for project-level precedence across global, project, system-agent, and project-agent layers
|
|
191
|
+
- Added coverage for resolving config from `PI_CODING_AGENT_DIR`
|
|
192
|
+
- Added coverage for before-agent-start cache key generation and state deduplication
|
|
193
|
+
- Added coverage for cache invalidation on permission policy changes
|
|
194
|
+
|
|
195
|
+
## [0.4.1] - 2026-04-01
|
|
196
|
+
|
|
197
|
+
### Changed
|
|
198
|
+
- Updated npm keywords for improved discoverability (`pi-coding-agent`, `coding-agent`, `access-control`, `authorization`, `security`)
|
|
199
|
+
- Updated README permission prompt example image
|
|
200
|
+
- Added Related Pi Extensions cross-linking section to README
|
|
201
|
+
|
|
202
|
+
## [0.4.0] - 2026-04-01
|
|
203
|
+
|
|
204
|
+
### Added
|
|
205
|
+
- System prompt sanitizer now removes inactive tool guidelines from the `Guidelines:` section
|
|
206
|
+
- Guideline filtering based on allowed tools (e.g., removes task/mcp/bash/write guidance when tools are denied)
|
|
207
|
+
- New `TOOL_GUIDELINE_RULES` configuration for extensible guideline filtering
|
|
208
|
+
- Helper functions: `findSection()`, `removeLineSection()`, `sanitizeGuidelinesSection()`
|
|
209
|
+
|
|
210
|
+
### Changed
|
|
211
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.64.0
|
|
212
|
+
- Updated `@sinclair/typebox` peer dependency to ^0.34.49
|
|
213
|
+
- Refactored system prompt sanitizer to handle both `Available tools:` and `Guidelines:` sections
|
|
214
|
+
|
|
215
|
+
### Tests
|
|
216
|
+
- Added tests for system prompt sanitizer removing Available tools section
|
|
217
|
+
- Added tests for guideline filtering based on allowed tools
|
|
218
|
+
- Added tests for inactive built-in write/edit/task/mcp guidance removal
|
|
219
|
+
|
|
220
|
+
## [0.3.1] - 2026-03-24
|
|
221
|
+
|
|
222
|
+
### Added
|
|
223
|
+
- Permission system status module (`status.ts`) to expose yolo mode status to the UI
|
|
224
|
+
- `syncPermissionSystemStatus()` function to sync status with the TUI status bar
|
|
225
|
+
- `PERMISSION_SYSTEM_STATUS_KEY` and `PERMISSION_SYSTEM_YOLO_STATUS_VALUE` constants for status identification
|
|
226
|
+
|
|
227
|
+
### Changed
|
|
228
|
+
- Integrated status sync on config load, config save, and extension unload
|
|
229
|
+
- Status is only exposed when yolo mode is enabled
|
|
230
|
+
|
|
231
|
+
### Tests
|
|
232
|
+
- Added test for permission-system status being undefined when yolo mode is disabled and "yolo" when enabled
|
|
233
|
+
|
|
234
|
+
## [0.3.0] - 2026-03-23
|
|
235
|
+
|
|
236
|
+
### Added
|
|
237
|
+
- Yolo mode for auto-approval when enabled — bypasses permission prompts for streamlined workflows
|
|
238
|
+
- Permission forwarding system for subagent-to-primary IPC communication
|
|
239
|
+
- Configuration modal UI with Zellij integration (`config-modal.ts`, `zellij-modal.ts`)
|
|
240
|
+
- `permission-forwarding.ts` module for subagent permission request routing
|
|
241
|
+
- `yolo-mode.ts` module for automatic permission approval when yolo mode is active
|
|
242
|
+
|
|
243
|
+
### Changed
|
|
244
|
+
- Updated `@mariozechner/pi-coding-agent` and `@mariozechner/pi-tui` peer dependencies to ^0.62.0
|
|
245
|
+
- Refactored `index.ts` to export new permission resolution utilities
|
|
246
|
+
- Expanded `extension-config.ts` with config normalization for new features
|
|
247
|
+
- Added `types-shims.d.ts` for Zellij modal type definitions
|
|
248
|
+
|
|
249
|
+
### Tests
|
|
250
|
+
- Added comprehensive tests for config modal functionality
|
|
251
|
+
- Added tests for permission forwarding behavior
|
|
252
|
+
|
|
253
|
+
## [0.2.2] - 2026-03-13
|
|
254
|
+
|
|
255
|
+
### Changed
|
|
256
|
+
- Removed delegation task restriction logic — the `task` tool is no longer restricted to orchestrator agent only
|
|
257
|
+
- Simplified tool permission lookup to use explicit `tools` entries for arbitrary registered tools instead of MCP fallback
|
|
258
|
+
- Renamed `TOOL_PERMISSION_NAMES` to `BUILT_IN_TOOL_PERMISSION_NAMES` to clarify it covers only canonical Pi tools
|
|
259
|
+
- Updated schema descriptions for `tools` and `mcp` fields to guide configuration usage
|
|
260
|
+
|
|
261
|
+
### Removed
|
|
262
|
+
- Removed delegation-specific permission checks (`isDelegationAllowedAgent`, `getDelegationBlockReason`) from permission evaluation
|
|
263
|
+
|
|
264
|
+
### Tests
|
|
265
|
+
- Added comprehensive test coverage for tool permission lookup behavior
|
|
266
|
+
|
|
267
|
+
## [0.2.1] - 2026-03-13
|
|
268
|
+
|
|
269
|
+
### Added
|
|
270
|
+
- Extension configuration system (`config.json`) with `debugLog` and `permissionReviewLog` options
|
|
271
|
+
- JSONL debug logging to `logs/pi-permission-system-debug.jsonl` when `debugLog` is enabled
|
|
272
|
+
- JSONL permission review logging to `logs/pi-permission-system-permission-review.jsonl` for auditing
|
|
273
|
+
- Permission request event emission on `pi-permission-system:permission-request` channel for external consumers
|
|
274
|
+
- New `extension-config.ts` module for config file management and path resolution
|
|
275
|
+
- New `logging.ts` module with `createPermissionSystemLogger` for structured log output
|
|
276
|
+
|
|
277
|
+
### Changed
|
|
278
|
+
- Replaced `console.warn`/`console.error` calls with structured logging to file
|
|
279
|
+
- Permission forwarding now logs request creation, response received, timeout, and user prompts
|
|
280
|
+
- Updated README documentation to cover extension config, logging, and event emission
|
|
281
|
+
|
|
282
|
+
## [0.2.0] - 2026-03-12
|
|
283
|
+
|
|
284
|
+
### Added
|
|
285
|
+
- `getToolPermission()` method to retrieve tool-level permission state without evaluating command-level rules, useful for tool injection decisions
|
|
286
|
+
|
|
287
|
+
## [0.1.8] - 2026-03-10
|
|
288
|
+
|
|
289
|
+
### Changed
|
|
290
|
+
- Refactored pattern compilation to support multiple sources for proper global+agent pattern merging
|
|
291
|
+
- Simplified `wildcard-matcher.ts` by removing unused `wildcardCount` and `literalLength` properties
|
|
292
|
+
- `BashFilter` now accepts pre-compiled patterns via `BashPermissionSource` type
|
|
293
|
+
- Replaced `compilePermissionPatterns` with `compilePermissionPatternsFromSources` for cleaner API
|
|
294
|
+
|
|
295
|
+
### Fixed
|
|
296
|
+
- Permission pattern priority now correctly implements last-match-wins hierarchy (opencode-style)
|
|
297
|
+
- MCP tool-level deny no longer blocks specific MCP allow patterns
|
|
298
|
+
|
|
299
|
+
### Tests
|
|
300
|
+
- Updated tests to reflect last-match-wins behavior
|
|
301
|
+
- Added test for specific MCP rules winning over `tools.mcp: deny`
|
|
302
|
+
- Rearranged test pattern declarations for clarity
|
|
303
|
+
|
|
304
|
+
## [0.1.7] - 2026-03-10
|
|
305
|
+
|
|
306
|
+
### Added
|
|
307
|
+
- `src/common.ts` — Shared utility module with `toRecord()`, `getNonEmptyString()`, `isPermissionState()`, `parseSimpleYamlMap()`, `extractFrontmatter()`
|
|
308
|
+
- `src/wildcard-matcher.ts` — Wildcard pattern compilation and matching with specificity sorting
|
|
309
|
+
- File stamp caching in `PermissionManager` for improved performance
|
|
310
|
+
- `tools.mcp` fallback permission for MCP operations
|
|
311
|
+
- MCP tool permission targets now inferred from configured server names in `mcp.json`
|
|
312
|
+
|
|
313
|
+
### Changed
|
|
314
|
+
- Refactored `bash-filter.ts` to use shared `wildcard-matcher.ts` module
|
|
315
|
+
- Refactored `index.ts` to use shared `common.ts` utilities
|
|
316
|
+
- Refactored `permission-manager.ts` to use shared modules and caching
|
|
317
|
+
- Pre-compiled wildcard patterns are now reused across permission checks
|
|
318
|
+
- Updated README architecture documentation to reflect new module organization
|
|
319
|
+
|
|
320
|
+
### Tests
|
|
321
|
+
- Added tests for MCP proxy tool inferring server-prefixed aliases from configured server names
|
|
322
|
+
- Added tests for `tools.mcp` fallback behavior
|
|
323
|
+
- Added tests for `task` using tool permissions instead of MCP fallback
|
|
324
|
+
|
|
325
|
+
## [0.1.6] - 2026-03-09
|
|
326
|
+
|
|
327
|
+
### Added
|
|
328
|
+
- Sanitized the `Available tools:` system prompt section so denied tools are removed before the agent starts.
|
|
329
|
+
|
|
330
|
+
### Changed
|
|
331
|
+
- Updated README documentation to describe system-prompt tool sanitization and refreshed the displayed package version.
|
|
332
|
+
|
|
333
|
+
### Fixed
|
|
334
|
+
- Prevented hidden tools from remaining advertised in the startup system prompt after runtime tool filtering.
|
|
335
|
+
|
|
336
|
+
## [0.1.5] - 2026-03-09
|
|
337
|
+
|
|
338
|
+
### Changed
|
|
339
|
+
- Added `repository`, `homepage`, and `bugs` package metadata so npm links back to the public GitHub repository and issue tracker.
|
|
340
|
+
|
|
341
|
+
## [0.1.4] - 2026-03-07
|
|
342
|
+
|
|
343
|
+
### Added
|
|
344
|
+
- Added permission request forwarding so non-UI subagent sessions can surface `ask` confirmations back to the main interactive session.
|
|
345
|
+
- Added filesystem-based request/response handling for both primary and legacy permission-forwarding directories.
|
|
346
|
+
|
|
347
|
+
### Changed
|
|
348
|
+
- Updated README documentation to describe subagent permission forwarding behavior and current architecture responsibilities.
|
|
349
|
+
- Added `package-lock.json` to the repository for reproducible local installs.
|
|
350
|
+
|
|
351
|
+
### Fixed
|
|
352
|
+
- Preserved interactive `ask` permission flows for delegated subagents that would otherwise fail without direct UI access.
|
|
353
|
+
- Improved cleanup and compatibility handling around legacy permission-forwarding directories.
|
|
354
|
+
|
|
355
|
+
## [0.1.3] - 2026-03-04
|
|
356
|
+
|
|
357
|
+
### Fixed
|
|
358
|
+
- Use absolute GitHub raw URL for README image to fix npm display
|
|
359
|
+
|
|
360
|
+
## [0.1.2] - 2026-03-04
|
|
361
|
+
|
|
362
|
+
### Changed
|
|
363
|
+
- Rewrote README.md with professional documentation standards
|
|
364
|
+
- Added comprehensive feature documentation, configuration reference, and usage examples
|
|
365
|
+
|
|
366
|
+
## [0.1.1] - 2026-03-02
|
|
367
|
+
|
|
368
|
+
### Changed
|
|
369
|
+
- Added `asset/` to the npm package `files` whitelist so README image assets are included in tarballs.
|
|
370
|
+
|
|
371
|
+
## [0.1.0] - 2026-03-02
|
|
372
|
+
|
|
373
|
+
### Changed
|
|
374
|
+
- Reorganized repository structure to match standard extension layout:
|
|
375
|
+
- moved implementation and tests into `src/`
|
|
376
|
+
- added root `index.ts` shim for Pi auto-discovery
|
|
377
|
+
- standardized TypeScript project settings with Bundler module resolution
|
|
378
|
+
- Added package distribution metadata and scripts, including `pi.extensions` and publish file whitelist.
|
|
379
|
+
- Added repository scaffolding files (`README.md`, `CHANGELOG.md`, `LICENSE`, `.gitignore`, `.npmignore`) and config starter template.
|
|
380
|
+
|
|
381
|
+
### Preserved
|
|
382
|
+
- Global permission config path semantics remained `~/.pi/agent/pi-permissions.jsonc`.
|
|
383
|
+
- Permission schema location remained `schemas/permissions.schema.json`.
|
|
384
|
+
- Permission enforcement behavior remained intact.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 MasuRii
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|