agentic-loop 3.5.1 → 3.5.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/package.json +1 -1
- package/ralph/setup.sh +25 -1
package/package.json
CHANGED
package/ralph/setup.sh
CHANGED
|
@@ -157,7 +157,7 @@ setup_ralph_dir() {
|
|
|
157
157
|
echo " Created .ralph/config.json"
|
|
158
158
|
fi
|
|
159
159
|
|
|
160
|
-
# Copy signs template
|
|
160
|
+
# Copy or merge signs template
|
|
161
161
|
if [[ ! -f ".ralph/signs.json" ]]; then
|
|
162
162
|
if [[ -f "$pkg_root/templates/signs.json" ]]; then
|
|
163
163
|
cp "$pkg_root/templates/signs.json" ".ralph/signs.json"
|
|
@@ -165,6 +165,30 @@ setup_ralph_dir() {
|
|
|
165
165
|
echo '{"signs": []}' > ".ralph/signs.json"
|
|
166
166
|
fi
|
|
167
167
|
echo " Created .ralph/signs.json"
|
|
168
|
+
else
|
|
169
|
+
# Merge new default signs into existing file
|
|
170
|
+
if [[ -f "$pkg_root/templates/signs.json" ]] && command -v jq &>/dev/null; then
|
|
171
|
+
local existing_ids new_signs_added=0
|
|
172
|
+
existing_ids=$(jq -r '.signs[].id // empty' ".ralph/signs.json" 2>/dev/null | tr '\n' '|')
|
|
173
|
+
|
|
174
|
+
# Add signs from template that don't exist locally
|
|
175
|
+
while IFS= read -r sign; do
|
|
176
|
+
local sign_id
|
|
177
|
+
sign_id=$(echo "$sign" | jq -r '.id // empty')
|
|
178
|
+
if [[ -n "$sign_id" && ! "$existing_ids" =~ "$sign_id" ]]; then
|
|
179
|
+
# Add this sign to local file
|
|
180
|
+
local tmp_file
|
|
181
|
+
tmp_file=$(mktemp)
|
|
182
|
+
jq --argjson new_sign "$sign" '.signs += [$new_sign]' ".ralph/signs.json" > "$tmp_file"
|
|
183
|
+
mv "$tmp_file" ".ralph/signs.json"
|
|
184
|
+
((new_signs_added++))
|
|
185
|
+
fi
|
|
186
|
+
done < <(jq -c '.signs[]' "$pkg_root/templates/signs.json" 2>/dev/null)
|
|
187
|
+
|
|
188
|
+
if [[ $new_signs_added -gt 0 ]]; then
|
|
189
|
+
echo " Merged $new_signs_added new sign(s) into .ralph/signs.json"
|
|
190
|
+
fi
|
|
191
|
+
fi
|
|
168
192
|
fi
|
|
169
193
|
|
|
170
194
|
# Create or update PROMPT.md
|