pi-rewind-hook 1.1.0 → 1.1.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
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.1.1] - 2024-12-27
6
+
7
+ ### Fixed
8
+ - Use `before_branch` event instead of `branch` for proper hook timing (thanks @badlogic)
9
+ - Cancel branch when user dismisses restore options menu
10
+
5
11
  ## [1.1.0] - 2024-12-27
6
12
 
7
13
  ### Added
package/index.ts CHANGED
@@ -160,7 +160,7 @@ export default function (pi: HookAPI) {
160
160
  });
161
161
 
162
162
  pi.on("session", async (event, ctx) => {
163
- if (event.reason !== "branch") return;
163
+ if (event.reason !== "before_branch") return;
164
164
  if (!ctx.hasUI) return;
165
165
  if (!isGitRepo) return;
166
166
 
@@ -205,7 +205,7 @@ export default function (pi: HookAPI) {
205
205
 
206
206
  if (!choice) {
207
207
  ctx.ui.notify("Rewind cancelled", "info");
208
- return;
208
+ return { cancel: true };
209
209
  }
210
210
 
211
211
  if (choice.startsWith("Conversation only")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-rewind-hook",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Rewind hook for Pi agent - automatic git checkpoints with file/conversation restore",
5
5
  "bin": {
6
6
  "pi-rewind-hook": "./install.js"