@juicesharp/rpiv-pi 2.1.0 → 2.2.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.
@@ -59,6 +59,14 @@ export interface BashWatchdog {
59
59
  /** The recorded timeout reason once the watchdog has fired, else `undefined`. Wired to
60
60
  * `WorkflowSessionContext.toolTimeout` so the runner can divert the abort to soft-halt. */
61
61
  timedOut(): { reason: string } | undefined;
62
+ /**
63
+ * Clear the recorded verdict (`fired` → undefined) AND every pending per-`toolCallId`
64
+ * timer WITHOUT unsubscribing — the `subscribe` listener stays live so a resumed turn's
65
+ * new bash `tool_execution_start` re-arms a fresh timer. The strike-recovery path calls
66
+ * this after consuming a strike (before re-prompting the child); `dispose()` (unsubscribe
67
+ * + clear) still runs in the per-stage `finally`. Mirrors `dispose()` minus the unsubscribe.
68
+ */
69
+ reset(): void;
62
70
  /** Unsubscribe + clear any pending timers. The host calls this in its per-stage `finally`. */
63
71
  dispose(): void;
64
72
  }
@@ -101,6 +109,14 @@ export function armBashWatchdog(session: WatchableSession, timeoutMs: number = B
101
109
 
102
110
  return {
103
111
  timedOut: () => fired,
112
+ // Recovery: clear the verdict + pending timers but KEEP the subscribe listener armed,
113
+ // so the resumed turn's next bash call re-arms a fresh per-toolCallId timer. dispose()
114
+ // (below) is the only path that unsubscribes.
115
+ reset: () => {
116
+ fired = undefined;
117
+ for (const timer of timers.values()) clearTimeout(timer);
118
+ timers.clear();
119
+ },
104
120
  dispose: () => {
105
121
  unsubscribe();
106
122
  for (const timer of timers.values()) clearTimeout(timer);