agentic-loop 3.0.0 → 3.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/ralph/init.sh +11 -11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-loop",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Autonomous AI coding loop - PRD-driven development with Claude Code",
5
5
  "author": "Allie Jones <allie@allthrive.ai>",
6
6
  "license": "MIT",
package/ralph/init.sh CHANGED
@@ -196,7 +196,7 @@ auto_configure_project() {
196
196
  # Extract port from web/frontend service: "5173:5173" -> 5173
197
197
  web_port=$(grep -A 20 -E '^\s*(web|frontend|client|ui):' "$compose_file" 2>/dev/null | \
198
198
  grep -E '^\s*-\s*"?[0-9]+:[0-9]+"?' | head -1 | \
199
- grep -oE '[0-9]+:' | head -1 | tr -d ':')
199
+ grep -oE '[0-9]+:' | head -1 | tr -d ':' || true)
200
200
  fi
201
201
  done
202
202
 
@@ -206,7 +206,7 @@ auto_configure_project() {
206
206
  "apps/frontend/vite.config.ts" "frontend/vite.config.ts"; do
207
207
  if [[ -f "$vite_config" ]]; then
208
208
  # Look for port: 3000 or port: '3000'
209
- web_port=$(grep -E 'port\s*[=:]\s*[0-9]+' "$vite_config" 2>/dev/null | grep -oE '[0-9]{4}' | head -1)
209
+ web_port=$(grep -E 'port\s*[=:]\s*[0-9]+' "$vite_config" 2>/dev/null | grep -oE '[0-9]{4}' | head -1 || true)
210
210
  [[ -z "$web_port" ]] && web_port="5173" # Vite's documented default
211
211
  break
212
212
  fi
@@ -217,7 +217,7 @@ auto_configure_project() {
217
217
  if [[ -z "$web_port" ]]; then
218
218
  for hugo_config in "hugo.toml" "hugo.yaml" "hugo.json" "config.toml"; do
219
219
  if [[ -f "$hugo_config" ]] && [[ -d "content" || -d "layouts" || -d "themes" ]]; then
220
- web_port=$(grep -E 'port\s*=' "$hugo_config" 2>/dev/null | grep -oE '[0-9]+' | head -1)
220
+ web_port=$(grep -E 'port\s*=' "$hugo_config" 2>/dev/null | grep -oE '[0-9]+' | head -1 || true)
221
221
  [[ -z "$web_port" ]] && web_port="1313" # Hugo's documented default
222
222
  break
223
223
  fi
@@ -233,7 +233,7 @@ auto_configure_project() {
233
233
  local pkg_dir
234
234
  pkg_dir=$(dirname "$next_config")
235
235
  if [[ -f "$pkg_dir/package.json" ]]; then
236
- web_port=$(grep -E '"dev".*-p\s*[0-9]+' "$pkg_dir/package.json" 2>/dev/null | grep -oE '\-p\s*[0-9]+' | grep -oE '[0-9]+')
236
+ web_port=$(grep -E '"dev".*-p\s*[0-9]+' "$pkg_dir/package.json" 2>/dev/null | grep -oE '\-p\s*[0-9]+' | grep -oE '[0-9]+' || true)
237
237
  fi
238
238
  [[ -z "$web_port" ]] && web_port="3000" # Next.js documented default
239
239
  break
@@ -244,7 +244,7 @@ auto_configure_project() {
244
244
  # Priority 5: Generic package.json port detection
245
245
  if [[ -z "$web_port" && -f "package.json" ]]; then
246
246
  # Look for explicit port in scripts: --port 3000, -p 3000, :3000
247
- web_port=$(grep -E '"(dev|start|serve)"' package.json 2>/dev/null | grep -oE '(--port|-p|:)[[:space:]]*[0-9]{4}' | grep -oE '[0-9]{4}' | head -1)
247
+ web_port=$(grep -E '"(dev|start|serve)"' package.json 2>/dev/null | grep -oE '(--port|-p|:)[[:space:]]*[0-9]{4}' | grep -oE '[0-9]{4}' | head -1 || true)
248
248
  fi
249
249
 
250
250
  if [[ -n "$web_port" ]]; then
@@ -306,14 +306,14 @@ auto_configure_project() {
306
306
  # Extract port from api/backend service: "8000:8000" -> 8000
307
307
  api_port=$(grep -A 20 -E '^\s*(api|backend|server|app):' "$compose_file" 2>/dev/null | \
308
308
  grep -E '^\s*-\s*"?[0-9]+:[0-9]+"?' | head -1 | \
309
- grep -oE '[0-9]+:' | head -1 | tr -d ':')
309
+ grep -oE '[0-9]+:' | head -1 | tr -d ':' || true)
310
310
  fi
311
311
  done
312
312
 
313
313
  # Priority 2: Dockerfile EXPOSE directive
314
314
  if [[ -n "$backend_dir" && -z "$api_port" ]]; then
315
315
  if [[ -f "$backend_dir/Dockerfile" ]]; then
316
- api_port=$(grep -i "^EXPOSE" "$backend_dir/Dockerfile" 2>/dev/null | head -1 | grep -oE '[0-9]+' | head -1)
316
+ api_port=$(grep -i "^EXPOSE" "$backend_dir/Dockerfile" 2>/dev/null | head -1 | grep -oE '[0-9]+' | head -1 || true)
317
317
  fi
318
318
  fi
319
319
 
@@ -322,11 +322,11 @@ auto_configure_project() {
322
322
  if [[ -f "$backend_dir/pyproject.toml" ]] || [[ -f "$backend_dir/requirements.txt" ]]; then
323
323
  # Check pyproject.toml for port config
324
324
  if [[ -f "$backend_dir/pyproject.toml" ]]; then
325
- api_port=$(grep -E 'port\s*=' "$backend_dir/pyproject.toml" 2>/dev/null | grep -oE '[0-9]+' | head -1)
325
+ api_port=$(grep -E 'port\s*=' "$backend_dir/pyproject.toml" 2>/dev/null | grep -oE '[0-9]+' | head -1 || true)
326
326
  fi
327
327
  # Check for uvicorn command with --port
328
328
  if [[ -z "$api_port" && -f "$backend_dir/Makefile" ]]; then
329
- api_port=$(grep -E 'uvicorn.*--port' "$backend_dir/Makefile" 2>/dev/null | grep -oE '\-\-port[[:space:]]*[0-9]+' | grep -oE '[0-9]+' | head -1)
329
+ api_port=$(grep -E 'uvicorn.*--port' "$backend_dir/Makefile" 2>/dev/null | grep -oE '\-\-port[[:space:]]*[0-9]+' | grep -oE '[0-9]+' | head -1 || true)
330
330
  fi
331
331
  # Uvicorn/FastAPI default
332
332
  [[ -z "$api_port" ]] && api_port="8000"
@@ -335,7 +335,7 @@ auto_configure_project() {
335
335
 
336
336
  # Priority 4: Node backend - check package.json for port
337
337
  if [[ -n "$backend_dir" && -z "$api_port" && -f "$backend_dir/package.json" ]]; then
338
- api_port=$(grep -E '"(dev|start|serve)"' "$backend_dir/package.json" 2>/dev/null | grep -oE '(--port|-p|:)[[:space:]]*[0-9]{4}' | grep -oE '[0-9]{4}' | head -1)
338
+ api_port=$(grep -E '"(dev|start|serve)"' "$backend_dir/package.json" 2>/dev/null | grep -oE '(--port|-p|:)[[:space:]]*[0-9]{4}' | grep -oE '[0-9]{4}' | head -1 || true)
339
339
  fi
340
340
 
341
341
  if [[ -n "$api_port" ]]; then
@@ -415,7 +415,7 @@ ralph_status() {
415
415
  else
416
416
  # Check for misplaced PRD in subdirectories
417
417
  local found_prd
418
- found_prd=$(find . -path "./.ralph" -prune -o -name "prd.json" -path "*/.ralph/prd.json" -print 2>/dev/null | head -1)
418
+ found_prd=$(find . -path "./.ralph" -prune -o -name "prd.json" -path "*/.ralph/prd.json" -print 2>/dev/null | head -1 || true)
419
419
 
420
420
  if [[ -n "$found_prd" ]]; then
421
421
  print_warning "PRD found in wrong location: $found_prd"