@trevonistrevon/pi-loop 0.4.10 → 0.4.11

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
@@ -6,7 +6,7 @@
6
6
  ## Install
7
7
 
8
8
  ```bash
9
- pi install @trevonistrevon/pi-loop
9
+ pi install npm:@trevonistrevon/pi-loop
10
10
  ```
11
11
 
12
12
  ## Quick start
package/dist/index.js CHANGED
@@ -403,6 +403,18 @@ export default function (pi) {
403
403
  showPersistedLoops(isResume);
404
404
  widget.update();
405
405
  });
406
+ pi.on("tool_execution_end", async (event, ctx) => {
407
+ _latestCtx = ctx;
408
+ widget.setUICtx(ctx.ui);
409
+ if (event?.toolName !== "bash" || event?.isError)
410
+ return;
411
+ const command = event?.args?.command ?? event?.input?.command;
412
+ if (typeof command !== "string")
413
+ return;
414
+ if (!/^\s*git\s+commit\b/i.test(command))
415
+ return;
416
+ await cleanDoneTasks();
417
+ });
406
418
  // ── Dynamic loop pump — fires cron/hybrid loops on idle instead of wall-clock timers ──
407
419
  async function pumpLoops() {
408
420
  const pendingTasks = new Map();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trevonistrevon/pi-loop",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "A pi extension for cron/event-based agent re-wake loops and background process monitoring.",
5
5
  "author": "trevonistrevon",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -441,6 +441,19 @@ export default function (pi: ExtensionAPI) {
441
441
  widget.update();
442
442
  });
443
443
 
444
+ pi.on("tool_execution_end", async (event: any, ctx: ExtensionContext) => {
445
+ _latestCtx = ctx;
446
+ widget.setUICtx(ctx.ui);
447
+
448
+ if (event?.toolName !== "bash" || event?.isError) return;
449
+
450
+ const command = event?.args?.command ?? event?.input?.command;
451
+ if (typeof command !== "string") return;
452
+ if (!/^\s*git\s+commit\b/i.test(command)) return;
453
+
454
+ await cleanDoneTasks();
455
+ });
456
+
444
457
  // ── Dynamic loop pump — fires cron/hybrid loops on idle instead of wall-clock timers ──
445
458
 
446
459
  async function pumpLoops(): Promise<void> {