codex-ralph 0.4.1 โ 0.4.3
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 +3 -3
- package/agent/ralph-loop.sh +29 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ CODEX_RALPH_TG_KEY=123456:bot-token
|
|
|
17
17
|
CODEX_RALPH_TG_CHAT=123456789
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
Provide these as environment variables (e.g., when invoking `npx`). Each session
|
|
20
|
+
Provide these as environment variables (e.g., when invoking `npx`). Each session uses a randomly selected emoji to tag progress messages.
|
|
21
21
|
|
|
22
22
|
Usage:
|
|
23
23
|
|
|
@@ -31,10 +31,10 @@ Optional flags:
|
|
|
31
31
|
--max-iterations=10
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
Message format:
|
|
34
|
+
Message format (session emoji is chosen randomly from a small fixed set and stays constant for the session):
|
|
35
35
|
|
|
36
36
|
```
|
|
37
|
-
|
|
37
|
+
<session emoji>
|
|
38
38
|
๐ <current requirement title>
|
|
39
39
|
๐ฏ <current index> of <total requirements>
|
|
40
40
|
```
|
package/agent/ralph-loop.sh
CHANGED
|
@@ -11,19 +11,23 @@ ROOT_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
|
11
11
|
SPRINT_FILE=""
|
|
12
12
|
MAX_ITERATIONS=10
|
|
13
13
|
NOTES_FILE=""
|
|
14
|
-
|
|
14
|
+
SESSION_EMOJI=""
|
|
15
|
+
USE_CURSOR_AGENT=false
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
if [[ -n "${
|
|
18
|
-
echo "${
|
|
17
|
+
session_emoji() {
|
|
18
|
+
if [[ -n "${SESSION_EMOJI}" ]]; then
|
|
19
|
+
echo "${SESSION_EMOJI}"
|
|
19
20
|
return
|
|
20
21
|
fi
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
local emoji_pool=(
|
|
23
|
+
"๐งญ" "๐งฉ" "๐งช" "๐ฐ๏ธ" "๐ช"
|
|
24
|
+
"๐ช" "๐๏ธ" "๐งฟ" "๐งฒ" "๐ช"
|
|
25
|
+
"๐งฐ" "๐ช" "๐ช" "๐ชถ" "๐งฏ"
|
|
26
|
+
"๐งต" "๐งถ" "๐งท" "๐ช" "๐ชฌ"
|
|
27
|
+
)
|
|
28
|
+
local index=$((RANDOM % ${#emoji_pool[@]}))
|
|
29
|
+
SESSION_EMOJI="${emoji_pool[$index]}"
|
|
30
|
+
echo "${SESSION_EMOJI}"
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
send_telegram() {
|
|
@@ -40,22 +44,26 @@ send_telegram() {
|
|
|
40
44
|
|
|
41
45
|
usage() {
|
|
42
46
|
cat <<USAGE
|
|
43
|
-
Usage: ralph-loop SPRINT_PATH [--max-iterations=N]
|
|
47
|
+
Usage: ralph-loop SPRINT_PATH [--max-iterations=N] [--cursor-agent]
|
|
44
48
|
|
|
45
49
|
Options:
|
|
46
50
|
SPRINT_PATH Path to the sprint markdown file (required).
|
|
47
51
|
--max-iterations=N Stop after N iterations (0 = no limit, default 10).
|
|
52
|
+
--cursor-agent Use cursor-agent instead of codex (default: disabled).
|
|
48
53
|
-h, --help Show this help.
|
|
49
54
|
USAGE
|
|
50
55
|
}
|
|
51
56
|
|
|
52
|
-
|
|
57
|
+
session_emoji >/dev/null
|
|
53
58
|
|
|
54
59
|
for arg in "$@"; do
|
|
55
60
|
case "$arg" in
|
|
56
61
|
--max-iterations=*)
|
|
57
62
|
MAX_ITERATIONS="${arg#*=}"
|
|
58
63
|
;;
|
|
64
|
+
--cursor-agent)
|
|
65
|
+
USE_CURSOR_AGENT=true
|
|
66
|
+
;;
|
|
59
67
|
-h|--help)
|
|
60
68
|
usage
|
|
61
69
|
exit 0
|
|
@@ -195,7 +203,8 @@ while true; do
|
|
|
195
203
|
remaining="$(remaining_count)"
|
|
196
204
|
if [[ "$remaining" == "0" ]]; then
|
|
197
205
|
total="$(total_count)"
|
|
198
|
-
|
|
206
|
+
session_marker="$(session_emoji)"
|
|
207
|
+
send_telegram "${session_marker}"$'\n'"โ
All requirements completed"$'\n'"๐ฏ ${total} of ${total}"
|
|
199
208
|
echo "All sprint requirements complete."
|
|
200
209
|
echo "<promise>DONE</promise>"
|
|
201
210
|
exit 0
|
|
@@ -209,7 +218,8 @@ while true; do
|
|
|
209
218
|
desc="$(next_description)"
|
|
210
219
|
total="$(total_count)"
|
|
211
220
|
current="$(current_index)"
|
|
212
|
-
|
|
221
|
+
session_marker="$(session_emoji)"
|
|
222
|
+
send_telegram "${session_marker}"$'\n'"๐ ${desc}"$'\n'"๐ฏ ${current} of ${total}"
|
|
213
223
|
echo "Iteration $iteration - next requirement: $desc"
|
|
214
224
|
|
|
215
225
|
prompt_tmp="$(mktemp)"
|
|
@@ -223,7 +233,11 @@ while true; do
|
|
|
223
233
|
current_item_block
|
|
224
234
|
} > "$prompt_tmp"
|
|
225
235
|
|
|
226
|
-
|
|
236
|
+
if [[ "$USE_CURSOR_AGENT" == "true" ]]; then
|
|
237
|
+
cursor-agent -p < "$prompt_tmp"
|
|
238
|
+
else
|
|
239
|
+
codex exec - < "$prompt_tmp"
|
|
240
|
+
fi
|
|
227
241
|
|
|
228
242
|
rm -f "$prompt_tmp"
|
|
229
243
|
|