codex-ralph 0.3.0 → 0.3.1
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 +14 -0
- package/agent/ralph-loop.sh +30 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,13 +8,27 @@ Minimal Ralph Wiggum Loop runner that feeds a sprint requirement into Codex, one
|
|
|
8
8
|
npx codex-ralph --sprint=path/to/Sprint_0001.md --max-iterations=1
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Telegram progress notifications
|
|
12
|
+
|
|
13
|
+
If you set Telegram credentials, the loop will send progress messages:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
CODEX_RALPH_TG_KEY=123456:bot-token
|
|
17
|
+
CODEX_RALPH_TG_CHAT=123456789
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Provide these as environment variables (e.g., when invoking `npx`). Each session generates a UUID and includes it in start/transition/finish messages.
|
|
21
|
+
|
|
11
22
|
## Sprint format (Markdown)
|
|
12
23
|
|
|
13
24
|
Each requirement is a level-2 heading with a checkbox. The loop picks the first unchecked item.
|
|
14
25
|
|
|
15
26
|
```markdown
|
|
16
27
|
## [ ] Requirement description
|
|
28
|
+
|
|
17
29
|
Description: Free-form task details.
|
|
30
|
+
|
|
31
|
+
Acceptance criteria: Free-form acceptance criteria.
|
|
18
32
|
```
|
|
19
33
|
|
|
20
34
|
## Behavior
|
package/agent/ralph-loop.sh
CHANGED
|
@@ -11,6 +11,32 @@ ROOT_DIR="$(cd "$(dirname "$SCRIPT_PATH")/.." && pwd)"
|
|
|
11
11
|
SPRINT_FILE=""
|
|
12
12
|
MAX_ITERATIONS=0
|
|
13
13
|
NOTES_FILE=""
|
|
14
|
+
SESSION_UUID=""
|
|
15
|
+
|
|
16
|
+
session_uuid() {
|
|
17
|
+
if [[ -n "${SESSION_UUID}" ]]; then
|
|
18
|
+
echo "${SESSION_UUID}"
|
|
19
|
+
return
|
|
20
|
+
fi
|
|
21
|
+
SESSION_UUID="$(python3 - <<PY
|
|
22
|
+
import uuid
|
|
23
|
+
print(uuid.uuid4())
|
|
24
|
+
PY
|
|
25
|
+
)"
|
|
26
|
+
echo "${SESSION_UUID}"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
send_telegram() {
|
|
30
|
+
local message="$1"
|
|
31
|
+
if [[ -z "${CODEX_RALPH_TG_KEY:-}" || -z "${CODEX_RALPH_TG_CHAT:-}" ]]; then
|
|
32
|
+
return
|
|
33
|
+
fi
|
|
34
|
+
curl -sS -o /dev/null -X POST \
|
|
35
|
+
"https://api.telegram.org/bot${CODEX_RALPH_TG_KEY}/sendMessage" \
|
|
36
|
+
-d "chat_id=${CODEX_RALPH_TG_CHAT}" \
|
|
37
|
+
--data-urlencode "text=${message}" \
|
|
38
|
+
|| true
|
|
39
|
+
}
|
|
14
40
|
|
|
15
41
|
usage() {
|
|
16
42
|
cat <<USAGE
|
|
@@ -23,6 +49,8 @@ Options:
|
|
|
23
49
|
USAGE
|
|
24
50
|
}
|
|
25
51
|
|
|
52
|
+
session_uuid >/dev/null
|
|
53
|
+
|
|
26
54
|
for arg in "$@"; do
|
|
27
55
|
case "$arg" in
|
|
28
56
|
--sprint=*)
|
|
@@ -133,6 +161,7 @@ iteration=1
|
|
|
133
161
|
while true; do
|
|
134
162
|
remaining="$(remaining_count)"
|
|
135
163
|
if [[ "$remaining" == "0" ]]; then
|
|
164
|
+
send_telegram "Ralph loop finished all requirements. Session ${SESSION_UUID}."
|
|
136
165
|
echo "All sprint requirements complete."
|
|
137
166
|
echo "<promise>DONE</promise>"
|
|
138
167
|
exit 0
|
|
@@ -144,6 +173,7 @@ while true; do
|
|
|
144
173
|
fi
|
|
145
174
|
|
|
146
175
|
desc="$(next_description)"
|
|
176
|
+
send_telegram "Ralph loop starting requirement: ${desc}. Session ${SESSION_UUID}."
|
|
147
177
|
echo "Iteration $iteration - next requirement: $desc"
|
|
148
178
|
|
|
149
179
|
prompt_tmp="$(mktemp)"
|