@geohar/pi-permissions-approve0.1.0
Pi extension: turn on pi-permission-system's auto-approve in every session that decides its own asks, so the authorizer chain still judges and config denies still hold, without launching pi with --auto-approve.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
@geohar/pi-permissions-approve
A Pi extension that turns on @gotgenes/pi-permission-system's auto-approve in every session, so you don't have to launch Pi with --auto-approve.
Auto-approve deliberately has no config setting: it is set per session, by the launch flag or by /permission-system:auto-approve on.
This extension sends that command for you whenever a session starts.
What auto-approve does
Auto-approve is the last step for an ask, after the authorizer chain:
config deny ─► blocked (auto-approve never sees it)
ask ─► authorizerChain links ─► a link denies? blocked, with its reason
└► every link defers ─► auto-approve ─► allowed, no prompt
- Your links still judge first. A link such as
auto-reviewsees every ask and its deny stands. - Config denies still hold. They never reach the chain or auto-approve.
- It covers directory access. A link's
allowonexternal_directoryandpathasks is capped todeferby pi-permission-system; auto-approve is not a link, so it approves those too. - Subagents are covered. The command turns on both scopes, this session's own asks and every ask its subagents forward to it.
Each approval is recorded in the review log as decidedBy: { kind: "auto_approve", setter: "command", scope: … }, so you can always tell it apart from your own answers.
How it works
The extension listens for pi-permission-system's permissions:ready broadcast, which each session emits once it is set up and which says whether the session decides its own asks.
For each new session id that does, it sends /permission-system:auto-approve on as a command (no turn starts and nothing reaches the model).
- A subagent that relays its asks to its parent is skipped: the parent's auto-approve answers them.
permissions:readyfires twice per session; the command is sent once per session id.- A session switch (
/new,/resume,/fork) brings a new id, and pi-permission-system rebuilds its auto-approve state then, so the command is sent again. - If Pi can't take the command at that moment, the next
permissions:readytries again.
It uses only the event bus and the slash command, never an import of pi-permission-system, so it can't load a second copy of that package.
To pause it for one session, run /permission-system:auto-approve off.
Install
pi install npm:@geohar/pi-permissions-approve
Or, from a checkout, build it and point Pi at it:
npm install && npm run build
pi -e ./dist/index.js
Requires @gotgenes/pi-permission-system 45.0.0 or later (the release that introduced auto-approve).
License
MIT