codex-ralph 0.3.1 → 0.3.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 +9 -1
- package/agent/ralph-loop.sh +32 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,15 @@ 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 generates a UUID and includes it in
|
|
20
|
+
Provide these as environment variables (e.g., when invoking `npx`). Each session generates a UUID and includes it in progress messages.
|
|
21
|
+
|
|
22
|
+
Message format:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
🧭 ~<session-uuid>~
|
|
26
|
+
📌 <current requirement title>
|
|
27
|
+
🎯 <current index> of <total requirements>
|
|
28
|
+
```
|
|
21
29
|
|
|
22
30
|
## Sprint format (Markdown)
|
|
23
31
|
|
package/agent/ralph-loop.sh
CHANGED
|
@@ -115,6 +115,33 @@ print(sum(1 for m in items if m.strip() != "x"))
|
|
|
115
115
|
PY
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
+
total_count() {
|
|
119
|
+
python3 - <<PY
|
|
120
|
+
from pathlib import Path
|
|
121
|
+
import re
|
|
122
|
+
|
|
123
|
+
path = Path("$SPRINT_FILE")
|
|
124
|
+
text = path.read_text(encoding="utf-8")
|
|
125
|
+
items = re.findall(r"^## \[( |x|X)\] ", text, flags=re.M)
|
|
126
|
+
print(len(items))
|
|
127
|
+
PY
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
current_index() {
|
|
131
|
+
python3 - <<PY
|
|
132
|
+
from pathlib import Path
|
|
133
|
+
import re
|
|
134
|
+
|
|
135
|
+
path = Path("$SPRINT_FILE")
|
|
136
|
+
text = path.read_text(encoding="utf-8")
|
|
137
|
+
items = re.findall(r"^## \[( |x|X)\] ", text, flags=re.M)
|
|
138
|
+
remaining = sum(1 for m in items if m.strip() != "x")
|
|
139
|
+
total = len(items)
|
|
140
|
+
current = total - remaining + 1 if remaining > 0 else total
|
|
141
|
+
print(current)
|
|
142
|
+
PY
|
|
143
|
+
}
|
|
144
|
+
|
|
118
145
|
next_description() {
|
|
119
146
|
python3 - <<PY
|
|
120
147
|
from pathlib import Path
|
|
@@ -161,7 +188,8 @@ iteration=1
|
|
|
161
188
|
while true; do
|
|
162
189
|
remaining="$(remaining_count)"
|
|
163
190
|
if [[ "$remaining" == "0" ]]; then
|
|
164
|
-
|
|
191
|
+
total="$(total_count)"
|
|
192
|
+
send_telegram "🧭 ~${SESSION_UUID}~"$'\n'"✅ All requirements completed"$'\n'"🎯 ${total} of ${total}"
|
|
165
193
|
echo "All sprint requirements complete."
|
|
166
194
|
echo "<promise>DONE</promise>"
|
|
167
195
|
exit 0
|
|
@@ -173,7 +201,9 @@ while true; do
|
|
|
173
201
|
fi
|
|
174
202
|
|
|
175
203
|
desc="$(next_description)"
|
|
176
|
-
|
|
204
|
+
total="$(total_count)"
|
|
205
|
+
current="$(current_index)"
|
|
206
|
+
send_telegram "🧭 ~${SESSION_UUID}~"$'\n'"📌 ${desc}"$'\n'"🎯 ${current} of ${total}"
|
|
177
207
|
echo "Iteration $iteration - next requirement: $desc"
|
|
178
208
|
|
|
179
209
|
prompt_tmp="$(mktemp)"
|