@erichll/pi-auto-review 0.20.1 → 0.21.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.0 - 2026-09-25
4
+
5
+ - Raise the `@gotgenes/pi-permission-system` peer floor to `>=34.0.0` and update
6
+ the development baseline to `^34.0.0`. Version 34.0.0 introduces
7
+ syntax-level role projection for redirect targets so non-existent file
8
+ targets are governed by path rules without requiring pre-existence probes.
9
+ - Automatically dismiss deferred and pending review widgets when explicit
10
+ user permission decisions (`permissions:decision` with `allow`) occur or when
11
+ a new agent turn begins (`turn_start`), preventing stale `deferred` notices
12
+ from lingering in the TUI indefinitely.
13
+ - Unit tests added for deferred widget dismissal on local user confirmation.
14
+
3
15
  ## 0.20.1 - 2026-09-24
4
16
 
5
17
  - Upgrade the development baseline for `@gotgenes/pi-permission-system` to
package/README.md CHANGED
@@ -31,8 +31,7 @@ that dependency is a hard prerequisite (see [Install and enable](#install-and-en
31
31
  > **Prerequisite:** pi-auto-review is an authorizer inside
32
32
  > `@gotgenes/pi-permission-system`. Pi does not auto-install peer packages, so
33
33
  > install the permission system separately (once per machine) before this
34
- > extension. This release line supports permission-system 30.0.0 and later,
35
- > validated through 33.0.8:
34
+ > extension. This release line supports permission-system 34.0.0 and later:
36
35
 
37
36
  Node.js 22.13.0 or newer is required. Permission auditing uses Node's built-in
38
37
  `node:sqlite`; it does not require a SQLite CLI, system SQLite library, or npm
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erichll/pi-auto-review",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "Fail-closed, model-backed approval broker for Pi: deterministically hard-denies dangerous operations, reviews dangerous boundaries with a reviewer model, and issues one-shot expiring grants that OS sandbox adapters must consume before retrying.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -49,13 +49,13 @@
49
49
  "peerDependencies": {
50
50
  "@earendil-works/pi-ai": "^0.87.1",
51
51
  "@earendil-works/pi-coding-agent": "^0.87.1",
52
- "@gotgenes/pi-permission-system": ">=30.0.0"
52
+ "@gotgenes/pi-permission-system": ">=34.0.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@earendil-works/pi-ai": "^0.87.1",
56
56
  "@earendil-works/pi-coding-agent": "^0.87.1",
57
57
  "@earendil-works/pi-server": "^0.87.1",
58
- "@gotgenes/pi-permission-system": "^33.1.1",
58
+ "@gotgenes/pi-permission-system": "^34.0.0",
59
59
  "@types/node": "^26.6.2",
60
60
  "typescript": "^6.0.3"
61
61
  }
package/src/index.ts CHANGED
@@ -241,6 +241,9 @@ export function createPiAutoReviewExtension(
241
241
  pi.on("ui_prompt_end", () => {
242
242
  reviewWidget.promptEnd();
243
243
  });
244
+ pi.on("turn_start", () => {
245
+ reviewWidget.clear(context);
246
+ });
244
247
  } catch {
245
248
  // Older pi: widget behavior is unchanged.
246
249
  }
@@ -779,10 +779,18 @@ export class UserReviewWidgetController {
779
779
  const record = event as Record<string, unknown>;
780
780
  const current = this.#current;
781
781
  if (
782
- record.result !== "deny" ||
783
782
  typeof record.requestId !== "string" ||
784
783
  record.requestId !== current?.requestId ||
785
- !current.data ||
784
+ !current.data
785
+ ) return;
786
+
787
+ if (record.result === "allow") {
788
+ this.#scheduleDismiss(current.generation, current.ctx);
789
+ return;
790
+ }
791
+
792
+ if (
793
+ record.result !== "deny" ||
786
794
  current.data.lines.includes("Local confirmation · denied")
787
795
  ) return;
788
796
  const data = {