@brettinternet/pi-loop 0.1.1 → 0.1.2
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 +22 -36
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,49 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pi-loop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Run a prompt repeatedly, with a fresh session for every iteration.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```bash
|
|
6
|
+
pi install npm:@brettinternet/pi-loop
|
|
7
|
+
```
|
|
6
8
|
|
|
7
9
|
```text
|
|
8
|
-
/loop <count> [--delay <duration>] <prompt>
|
|
9
|
-
/loop for <duration> --delay <duration> <prompt>
|
|
10
|
-
/loop <count>
|
|
11
|
-
/loop +<count>
|
|
12
|
-
/loop -<count>
|
|
13
|
-
/loop delay <duration>
|
|
14
|
-
/loop prompt <text>
|
|
15
|
-
/loop append <text>
|
|
16
|
-
/loop status
|
|
17
|
-
/loop
|
|
18
|
-
/loop end
|
|
19
|
-
/loop resume
|
|
20
|
-
/loop next
|
|
10
|
+
/loop <count> [--delay <duration>] <prompt>
|
|
11
|
+
/loop for <duration> --delay <duration> <prompt>
|
|
12
|
+
/loop <count>
|
|
13
|
+
/loop +<count>
|
|
14
|
+
/loop -<count>
|
|
15
|
+
/loop delay <duration>
|
|
16
|
+
/loop prompt <text>
|
|
17
|
+
/loop append <text>
|
|
18
|
+
/loop status
|
|
19
|
+
/loop
|
|
20
|
+
/loop end
|
|
21
|
+
/loop resume
|
|
22
|
+
/loop next
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
Durations use
|
|
24
|
-
|
|
25
|
-
A retune changes only a counted loop's next-boundary future budget; it never changes the prompt. Timed loops have no iteration budget to retune. Retuning or resuming while a graceful end is pending cancels it and reuses the loop's prompt. A subtraction may reduce that budget to zero, ending the loop after the active iteration. Invalid or ambiguous forms are rejected instead of guessing.
|
|
26
|
-
|
|
27
|
-
Prompt updates never affect the active iteration or change its budget. `prompt` replaces the complete prompt, including prior appended instructions. `append` adds a blank line and the supplied text. Updates persist across all not-yet-started iterations and may also be made while paused for the retried iteration. Updating a stopping loop preserves the pending end. Ordinary messages still belong only to the current session; use these commands to configure future fresh sessions.
|
|
28
|
-
|
|
29
|
-
Loops continue only after `agent_settled`. An aborted or error assistant output is not considered terminal while Pi is automatically retrying or continuing after a permission prompt. After Pi fully settles with an error, the loop retries the same iteration in the same session up to three times, waiting 30 seconds, 1 minute, then 2 minutes. An explicit abort pauses immediately. Exhausted retries also pause without consuming the iteration; `/loop status` includes the retry count, reason, timestamp, and timed-loop deadline when applicable. Manual `/loop resume` resets the retry allowance.
|
|
30
|
-
|
|
31
|
-
Every active loop session receives stable system guidance about its unattended-loop context and can call the `loop_pause` tool when useful work cannot continue without human input, credentials, permissions, or another non-transient external dependency. The guidance deliberately omits iteration and deadline values to preserve a stable prompt prefix for provider caching. The tool records the supplied reason, pauses without consuming the iteration, and terminates that agent turn. Temporary conditions expected to resolve in a later iteration should not pause the loop.
|
|
25
|
+
Durations use `ms`, `s`, `m`, `h`, or `d`. Delays range from 1 second to 24 hours. Timed loops run for at most 30 days.
|
|
32
26
|
|
|
33
|
-
|
|
27
|
+
Errors retry after 30 seconds, 1 minute, and 2 minutes, then pause. Aborting pauses the loop. A `loop_pause` request pauses for human blockers. Recovery preserves the loop so you can resume or advance it.
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
Chain commands in the prompt:
|
|
36
30
|
|
|
37
31
|
```text
|
|
38
32
|
/loop 10 /wait 10m /skill:myskill skill argument here
|
|
39
33
|
```
|
|
40
34
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
The extension does not use dialogs and is safe to load in print, JSON, and RPC modes.
|
|
44
|
-
|
|
45
|
-
Install it with:
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
pi install npm:@brettinternet/pi-loop
|
|
49
|
-
```
|
|
35
|
+
Built-in interactive commands cannot be chained.
|