@narumitw/pi-goal 0.9.2 → 0.10.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/README.md CHANGED
@@ -86,7 +86,7 @@ While a goal is active, `pi-goal` injects persistence rules and exposes `goal_co
86
86
 
87
87
  ## 🛑 Interruption and queued-input behavior
88
88
 
89
- On user pause, abort, or non-retryable error, `pi-goal` pauses the goal, aborts stale work, and blocks stale tool calls until the next user prompt (non-extension input). On `/goal clear`, it only clears goal state and pending continuation markers; it does not abort the current turn. Retryable provider interruptions and overflow compaction retries stay active while Pi retries; no extra continuation is queued.
89
+ On user pause, abort, or non-retryable error, `pi-goal` pauses the goal, aborts stale work, and blocks stale tool calls until the next user prompt (non-extension input), `/goal resume`, or `/goal clear`. On `/goal clear`, it clears goal state, pending continuation markers, and any stale tool-call block; it does not abort the current turn. Retryable provider interruptions and overflow compaction retries stay active while Pi retries; no extra continuation is queued.
90
90
 
91
91
  ## 🧠 Use cases
92
92
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@narumitw/pi-goal",
3
- "version": "0.9.2",
3
+ "version": "0.10.0",
4
4
  "description": "Pi extension that keeps working on a /goal until the agent marks it complete.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,12 +28,12 @@
28
28
  "typecheck": "tsc --noEmit"
29
29
  },
30
30
  "dependencies": {
31
- "typebox": "^1.1.37"
31
+ "typebox": "^1.3.3"
32
32
  },
33
33
  "devDependencies": {
34
- "@biomejs/biome": "2.4.14",
35
- "@earendil-works/pi-ai": "0.79.8",
36
- "@earendil-works/pi-coding-agent": "0.79.8",
34
+ "@biomejs/biome": "2.5.2",
35
+ "@earendil-works/pi-ai": "0.80.3",
36
+ "@earendil-works/pi-coding-agent": "0.80.3",
37
37
  "typescript": "6.0.3"
38
38
  },
39
39
  "repository": {
package/src/goal.ts CHANGED
@@ -293,6 +293,10 @@ export default function goal(pi: ExtensionAPI) {
293
293
 
294
294
  pi.on("tool_call", () => {
295
295
  if (!staleGoalToolCallsBlocked) return;
296
+ if (!activeGoal || activeGoal.status !== "paused") {
297
+ clearStaleGoalToolCallBlock();
298
+ return;
299
+ }
296
300
  return {
297
301
  block: true,
298
302
  reason: "Blocked stale /goal tool call after the goal was paused or interrupted.",
@@ -439,6 +443,7 @@ function clearGoal(ctx: StatusContext) {
439
443
  ctx.ui.notify("No active goal.", "info");
440
444
  cancelContinuationPending();
441
445
  clearGoalRecovery();
446
+ clearStaleGoalToolCallBlock();
442
447
  clearPersistedGoal(ctx.cwd);
443
448
  ctx.ui.setStatus(STATUS_KEY, undefined);
444
449
  return;
@@ -1004,6 +1009,7 @@ function loadGoalFromSession(ctx: StatusContext): ActiveGoal | undefined {
1004
1009
  function clearActiveGoal(ctx: StatusContext) {
1005
1010
  cancelContinuationPending();
1006
1011
  clearGoalRecovery();
1012
+ clearStaleGoalToolCallBlock();
1007
1013
  activeGoal = undefined;
1008
1014
  clearPersistedGoal(ctx.cwd);
1009
1015
  ctx.ui.setStatus(STATUS_KEY, undefined);