@trevonistrevon/pi-loop 0.1.3 → 0.1.4
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/dist/index.js +11 -6
- package/package.json +1 -1
- package/src/index.ts +11 -6
package/dist/index.js
CHANGED
|
@@ -402,13 +402,17 @@ Use "pause" to temporarily stop a loop without removing it. Use "delete" to perm
|
|
|
402
402
|
pi.registerTool({
|
|
403
403
|
name: "MonitorCreate",
|
|
404
404
|
label: "MonitorCreate",
|
|
405
|
-
description: `
|
|
405
|
+
description: `Run a shell command in the background and get notified when it finishes. The core tool for async/parallel work.
|
|
406
406
|
|
|
407
|
-
|
|
407
|
+
Fire off a build check, CI monitor, experiment, script, or any slow command — then keep working. Output streams back as "monitor:output" events. When the process exits, "monitor:done" fires (or "monitor:error" on failure).
|
|
408
|
+
|
|
409
|
+
If you pass onDone with a prompt, the monitor auto-creates a one-shot completion loop — you get a system reminder with the exit code and output line count. No need to poll or create a separate loop.
|
|
410
|
+
|
|
411
|
+
DO NOT use raw Bash while/sleep/for loops to watch something. DO NOT run slow commands inline that could be offloaded. Use MonitorCreate to run work in parallel while you continue.
|
|
408
412
|
|
|
409
413
|
## When to Use
|
|
410
414
|
|
|
411
|
-
|
|
415
|
+
Default to MonitorCreate for any long-running or background work:\n- Watch a CI/CD build (hut, gh, curl polling) while you work on something else\n- Run experiments, benchmarks, or training scripts in parallel\n- Tail a log or poll an API endpoint\n- Fire off a slow curl/fetch and check the result later\n- Run any script or command you don't need to wait on inline
|
|
412
416
|
|
|
413
417
|
## Events emitted
|
|
414
418
|
|
|
@@ -416,10 +420,11 @@ Use this tool to:\n- Start a long-running experiment and get notified when it fi
|
|
|
416
420
|
|
|
417
421
|
## onDone — auto-notify on completion
|
|
418
422
|
|
|
419
|
-
Pass onDone with a prompt and the monitor auto-creates a one-shot loop that fires when the process exits. The system reminder includes the exit code and output line count
|
|
423
|
+
Pass onDone with a prompt and the monitor auto-creates a one-shot loop that fires when the process exits. The system reminder includes the exit code and output line count.\n\nExample: MonitorCreate command="python train.py" onDone="Check training results and report best loss"\nExample: MonitorCreate command="hut builds show 1769753" onDone="Analyze the build result and report status"`,
|
|
420
424
|
promptGuidelines: [
|
|
421
|
-
"
|
|
422
|
-
"When
|
|
425
|
+
"Default to MonitorCreate for any long-running or background command — releases the agent to keep working on other tasks in parallel.",
|
|
426
|
+
"When the user asks to monitor CI builds, watch a build, check a remote job, or run an experiment, use MonitorCreate instead of inline bash/curl/wait.",
|
|
427
|
+
"Use onDone to auto-notify when a background command finishes — the agent will pick up the results automatically.",
|
|
423
428
|
],
|
|
424
429
|
parameters: Type.Object({
|
|
425
430
|
command: Type.String({ description: "Shell command to run in background" }),
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -439,13 +439,17 @@ Use "pause" to temporarily stop a loop without removing it. Use "delete" to perm
|
|
|
439
439
|
pi.registerTool({
|
|
440
440
|
name: "MonitorCreate",
|
|
441
441
|
label: "MonitorCreate",
|
|
442
|
-
description: `
|
|
442
|
+
description: `Run a shell command in the background and get notified when it finishes. The core tool for async/parallel work.
|
|
443
443
|
|
|
444
|
-
|
|
444
|
+
Fire off a build check, CI monitor, experiment, script, or any slow command — then keep working. Output streams back as "monitor:output" events. When the process exits, "monitor:done" fires (or "monitor:error" on failure).
|
|
445
|
+
|
|
446
|
+
If you pass onDone with a prompt, the monitor auto-creates a one-shot completion loop — you get a system reminder with the exit code and output line count. No need to poll or create a separate loop.
|
|
447
|
+
|
|
448
|
+
DO NOT use raw Bash while/sleep/for loops to watch something. DO NOT run slow commands inline that could be offloaded. Use MonitorCreate to run work in parallel while you continue.
|
|
445
449
|
|
|
446
450
|
## When to Use
|
|
447
451
|
|
|
448
|
-
|
|
452
|
+
Default to MonitorCreate for any long-running or background work:\n- Watch a CI/CD build (hut, gh, curl polling) while you work on something else\n- Run experiments, benchmarks, or training scripts in parallel\n- Tail a log or poll an API endpoint\n- Fire off a slow curl/fetch and check the result later\n- Run any script or command you don't need to wait on inline
|
|
449
453
|
|
|
450
454
|
## Events emitted
|
|
451
455
|
|
|
@@ -453,10 +457,11 @@ Use this tool to:\n- Start a long-running experiment and get notified when it fi
|
|
|
453
457
|
|
|
454
458
|
## onDone — auto-notify on completion
|
|
455
459
|
|
|
456
|
-
Pass onDone with a prompt and the monitor auto-creates a one-shot loop that fires when the process exits. The system reminder includes the exit code and output line count
|
|
460
|
+
Pass onDone with a prompt and the monitor auto-creates a one-shot loop that fires when the process exits. The system reminder includes the exit code and output line count.\n\nExample: MonitorCreate command="python train.py" onDone="Check training results and report best loss"\nExample: MonitorCreate command="hut builds show 1769753" onDone="Analyze the build result and report status"`,
|
|
457
461
|
promptGuidelines: [
|
|
458
|
-
"
|
|
459
|
-
"When
|
|
462
|
+
"Default to MonitorCreate for any long-running or background command — releases the agent to keep working on other tasks in parallel.",
|
|
463
|
+
"When the user asks to monitor CI builds, watch a build, check a remote job, or run an experiment, use MonitorCreate instead of inline bash/curl/wait.",
|
|
464
|
+
"Use onDone to auto-notify when a background command finishes — the agent will pick up the results automatically.",
|
|
460
465
|
],
|
|
461
466
|
parameters: Type.Object({
|
|
462
467
|
command: Type.String({ description: "Shell command to run in background" }),
|