@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 +1 -1
- package/dist/index.js +12 -0
- package/package.json +1 -1
- package/src/index.ts +13 -0
package/README.md
CHANGED
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
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> {
|