@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 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: `Start a background command and stream its output via pi events. Optionally auto-notify when done.
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
- The monitor runs a shell command in the background. Each output line is emitted as a "monitor:output" pi event. Use this to watch logs, tail files, poll APIs, run experiments, etc.
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
- Use this tool to:\n- Start a long-running experiment and get notified when it finishes\n- Watch a log file or build output in the background\n- Poll an API and stream results\n- Run any background command whose output you want to track
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. No need to create a separate LoopCreate or poll MonitorList.\n\nExample: MonitorCreate command="python train.py" onDone="Check training results and report best loss"`,
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
- "Use onDone to auto-notify when a long-running command finishes no need for a separate LoopCreate.",
422
- "When starting experiments or benchmarks, pass onDone so the agent automatically picks up the results.",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trevonistrevon/pi-loop",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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
@@ -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: `Start a background command and stream its output via pi events. Optionally auto-notify when done.
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
- The monitor runs a shell command in the background. Each output line is emitted as a "monitor:output" pi event. Use this to watch logs, tail files, poll APIs, run experiments, etc.
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
- Use this tool to:\n- Start a long-running experiment and get notified when it finishes\n- Watch a log file or build output in the background\n- Poll an API and stream results\n- Run any background command whose output you want to track
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. No need to create a separate LoopCreate or poll MonitorList.\n\nExample: MonitorCreate command="python train.py" onDone="Check training results and report best loss"`,
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
- "Use onDone to auto-notify when a long-running command finishes no need for a separate LoopCreate.",
459
- "When starting experiments or benchmarks, pass onDone so the agent automatically picks up the results.",
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" }),