s9n-devops-agent 1.5.3 → 1.5.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "s9n-devops-agent",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
4
4
  "description": "CS_DevOpsAgent - Intelligent Git Automation System with multi-agent support and session management",
5
5
  "type": "module",
6
6
  "main": "src/cs-devops-agent-worker.js",
@@ -41,7 +41,7 @@ show_copyright() {
41
41
  echo "======================================================================"
42
42
  echo
43
43
  echo " CS_DevOpsAgent - Intelligent Git Automation System"
44
- echo " Version 1.5.3 | Build 20251009.5"
44
+ echo " Version 1.5.4 | Build 20251009.6"
45
45
  echo " "
46
46
  echo " Copyright (c) 2024 SecondBrain Labs"
47
47
  echo " Author: Sachin Dev Duggal"
@@ -183,13 +183,36 @@ select_session() {
183
183
  return 0
184
184
  elif [[ "$choice" =~ ^[0-9]+$ ]] && [[ "$choice" -ge 1 ]] && [[ "$choice" -le "${#session_files[@]}" ]]; then
185
185
  # Use existing session
186
+ # In zsh, arrays are 1-indexed, so $choice maps directly
186
187
  local selected_file="${session_files[$choice]}"
188
+
189
+ # Validate that the file exists
190
+ if [[ ! -f "$selected_file" ]]; then
191
+ echo -e "${RED}Error: Session file not found: $selected_file${NC}"
192
+ return 1
193
+ fi
194
+
187
195
  local session_data=$(cat "$selected_file")
196
+
197
+ # Validate session data was read
198
+ if [[ -z "$session_data" ]]; then
199
+ echo -e "${RED}Error: Could not read session data from: $selected_file${NC}"
200
+ return 1
201
+ fi
202
+
188
203
  local session_id=$(echo "$session_data" | grep -o '"sessionId"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*: *"\([^"]*\)".*/\1/')
189
204
  local worktree_path=$(echo "$session_data" | grep -o '"worktreePath"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*: *"\([^"]*\)".*/\1/')
190
205
  local task=$(echo "$session_data" | grep -o '"task"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*: *"\([^"]*\)".*/\1/')
191
206
  local branch_name=$(echo "$session_data" | grep -o '"branchName"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*: *"\([^"]*\)".*/\1/')
192
207
 
208
+ # Validate we got a session ID
209
+ if [[ -z "$session_id" ]]; then
210
+ echo -e "${RED}Error: Could not extract session ID from file: $selected_file${NC}"
211
+ echo -e "${YELLOW}File contents:${NC}"
212
+ cat "$selected_file"
213
+ return 1
214
+ fi
215
+
193
216
  echo
194
217
  echo -e "${GREEN}Using existing session: ${session_id}${NC}"
195
218