loki-mode 6.38.4 → 6.38.5

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/SKILL.md CHANGED
@@ -3,7 +3,7 @@ name: loki-mode
3
3
  description: Multi-agent autonomous startup system. Triggers on "Loki Mode". Takes PRD to deployed product with minimal human intervention. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v6.38.4
6
+ # Loki Mode v6.38.5
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -267,4 +267,4 @@ The following features are documented in skill modules but not yet fully automat
267
267
  | Quality gates 3-reviewer system | Implemented (v5.35.0) | 5 specialist reviewers in `skills/quality-gates.md`; execution in run.sh |
268
268
  | Benchmarks (HumanEval, SWE-bench) | Infrastructure only | Runner scripts and datasets exist in `benchmarks/`; no published results |
269
269
 
270
- **v6.38.4 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
270
+ **v6.38.5 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 6.38.4
1
+ 6.38.5
package/autonomy/loki CHANGED
@@ -3036,10 +3036,7 @@ cmd_web_start() {
3036
3036
  echo -e "${RED}Error: Port must be between 1 and 65535, got $port${NC}"
3037
3037
  exit 1
3038
3038
  fi
3039
- if lsof -Pi :"$port" -sTCP:LISTEN -t >/dev/null 2>&1; then
3040
- echo -e "${RED}Error: Port $port is already in use${NC}"
3041
- exit 1
3042
- fi
3039
+ # Port validation moved below (after PID file check) so we can offer to kill orphans
3043
3040
 
3044
3041
  # Validate --prd file if provided
3045
3042
  if [ -n "$prd_file" ]; then
@@ -3095,11 +3092,26 @@ cmd_web_start() {
3095
3092
  fi
3096
3093
  fi
3097
3094
 
3098
- # Check if port is already in use
3095
+ # Check if port is already in use -- try to clean up orphaned processes
3099
3096
  if lsof -i:"$port" -sTCP:LISTEN &> /dev/null; then
3100
- echo -e "${RED}Error: Port $port already in use${NC}"
3101
- echo "Use --port to specify a different port, or stop the existing process."
3102
- exit 1
3097
+ local blocking_pid
3098
+ blocking_pid=$(lsof -ti:"$port" -sTCP:LISTEN 2>/dev/null | head -1)
3099
+ if [ -n "$blocking_pid" ]; then
3100
+ echo -e "${YELLOW}Port $port in use by PID $blocking_pid -- stopping it...${NC}"
3101
+ kill "$blocking_pid" 2>/dev/null
3102
+ sleep 1
3103
+ if kill -0 "$blocking_pid" 2>/dev/null; then
3104
+ kill -9 "$blocking_pid" 2>/dev/null
3105
+ sleep 1
3106
+ fi
3107
+ # Verify port is now free
3108
+ if lsof -i:"$port" -sTCP:LISTEN &> /dev/null; then
3109
+ echo -e "${RED}Error: Could not free port $port${NC}"
3110
+ echo "Use --port to specify a different port, or manually kill the process."
3111
+ exit 1
3112
+ fi
3113
+ echo -e "${GREEN}Port $port freed.${NC}"
3114
+ fi
3103
3115
  fi
3104
3116
 
3105
3117
  # Start the server
@@ -3155,45 +3167,78 @@ cmd_web_start() {
3155
3167
  }
3156
3168
 
3157
3169
  cmd_web_stop() {
3158
- if [ ! -f "$PURPLE_LAB_PID_FILE" ]; then
3159
- echo "Purple Lab is not running."
3160
- return 0
3170
+ local stopped=false
3171
+ local port
3172
+ port=$(cat "${LOKI_DIR}/purple-lab/port" 2>/dev/null || echo "$PURPLE_LAB_DEFAULT_PORT")
3173
+
3174
+ # Try PID file first
3175
+ if [ -f "$PURPLE_LAB_PID_FILE" ]; then
3176
+ local pid
3177
+ pid=$(cat "$PURPLE_LAB_PID_FILE" 2>/dev/null)
3178
+ if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
3179
+ kill "$pid" 2>/dev/null
3180
+ sleep 1
3181
+ if kill -0 "$pid" 2>/dev/null; then
3182
+ kill -9 "$pid" 2>/dev/null
3183
+ fi
3184
+ echo -e "${GREEN}Purple Lab stopped (PID: $pid)${NC}"
3185
+ stopped=true
3186
+ fi
3187
+ rm -f "$PURPLE_LAB_PID_FILE"
3161
3188
  fi
3162
3189
 
3163
- local pid
3164
- pid=$(cat "$PURPLE_LAB_PID_FILE" 2>/dev/null)
3165
- if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
3166
- kill "$pid" 2>/dev/null
3190
+ # Also kill any process on the port (catches orphans without PID file)
3191
+ local port_pid
3192
+ port_pid=$(lsof -ti:"$port" -sTCP:LISTEN 2>/dev/null | head -1 || true)
3193
+ if [ -n "$port_pid" ]; then
3194
+ kill "$port_pid" 2>/dev/null
3167
3195
  sleep 1
3168
- if kill -0 "$pid" 2>/dev/null; then
3169
- kill -9 "$pid" 2>/dev/null
3196
+ if kill -0 "$port_pid" 2>/dev/null; then
3197
+ kill -9 "$port_pid" 2>/dev/null
3170
3198
  fi
3171
- echo -e "${GREEN}Purple Lab stopped (PID: $pid)${NC}"
3172
- else
3173
- echo "Purple Lab was not running."
3199
+ if [ "$stopped" = false ]; then
3200
+ echo -e "${GREEN}Purple Lab stopped (orphan PID: $port_pid on port $port)${NC}"
3201
+ fi
3202
+ stopped=true
3174
3203
  fi
3175
- rm -f "$PURPLE_LAB_PID_FILE"
3176
- }
3177
3204
 
3178
- cmd_web_status() {
3179
- if [ ! -f "$PURPLE_LAB_PID_FILE" ]; then
3205
+ if [ "$stopped" = false ]; then
3180
3206
  echo "Purple Lab is not running."
3181
- return 0
3182
3207
  fi
3183
3208
 
3184
- local pid
3185
- pid=$(cat "$PURPLE_LAB_PID_FILE" 2>/dev/null)
3186
- if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
3187
- local port
3188
- port=$(cat "${LOKI_DIR}/purple-lab/port" 2>/dev/null || echo "$PURPLE_LAB_DEFAULT_PORT")
3189
- echo -e "${GREEN}Purple Lab is running${NC}"
3190
- echo " PID: $pid"
3191
- echo " URL: http://${PURPLE_LAB_DEFAULT_HOST}:${port}"
3192
- echo " Logs: ${LOKI_DIR}/purple-lab/logs/purple-lab.log"
3193
- else
3194
- echo "Purple Lab is not running (stale PID file)."
3209
+ rm -f "$PURPLE_LAB_PID_FILE" "${LOKI_DIR}/purple-lab/port" 2>/dev/null || true
3210
+ }
3211
+
3212
+ cmd_web_status() {
3213
+ local port
3214
+ port=$(cat "${LOKI_DIR}/purple-lab/port" 2>/dev/null || echo "$PURPLE_LAB_DEFAULT_PORT")
3215
+
3216
+ # Check PID file
3217
+ if [ -f "$PURPLE_LAB_PID_FILE" ]; then
3218
+ local pid
3219
+ pid=$(cat "$PURPLE_LAB_PID_FILE" 2>/dev/null)
3220
+ if [ -n "$pid" ] && kill -0 "$pid" 2>/dev/null; then
3221
+ echo -e "${GREEN}Purple Lab is running${NC}"
3222
+ echo " PID: $pid"
3223
+ echo " URL: http://${PURPLE_LAB_DEFAULT_HOST}:${port}"
3224
+ echo " Logs: ${LOKI_DIR}/purple-lab/logs/purple-lab.log"
3225
+ return 0
3226
+ fi
3195
3227
  rm -f "$PURPLE_LAB_PID_FILE"
3196
3228
  fi
3229
+
3230
+ # Fallback: check port directly (catches orphans)
3231
+ local port_pid
3232
+ port_pid=$(lsof -ti:"$port" -sTCP:LISTEN 2>/dev/null | head -1 || true)
3233
+ if [ -n "$port_pid" ]; then
3234
+ echo -e "${YELLOW}Purple Lab is running (orphan process)${NC}"
3235
+ echo " PID: $port_pid"
3236
+ echo " Port: $port"
3237
+ echo " Note: No PID file found. Stop with: loki web stop"
3238
+ return 0
3239
+ fi
3240
+
3241
+ echo "Purple Lab is not running."
3197
3242
  }
3198
3243
 
3199
3244
  # Import GitHub issues
@@ -7,7 +7,7 @@ Modules:
7
7
  control: Session control API (start/stop/pause/resume)
8
8
  """
9
9
 
10
- __version__ = "6.38.4"
10
+ __version__ = "6.38.5"
11
11
 
12
12
  # Expose the control app for easy import
13
13
  try:
@@ -2,7 +2,7 @@
2
2
 
3
3
  The flagship product of [Autonomi](https://www.autonomi.dev/). Complete installation instructions for all platforms and use cases.
4
4
 
5
- **Version:** v6.38.4
5
+ **Version:** v6.38.5
6
6
 
7
7
  ---
8
8
 
package/mcp/__init__.py CHANGED
@@ -57,4 +57,4 @@ try:
57
57
  except ImportError:
58
58
  __all__ = ['mcp']
59
59
 
60
- __version__ = '6.38.4'
60
+ __version__ = '6.38.5'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "6.38.4",
3
+ "version": "6.38.5",
4
4
  "description": "Loki Mode by Autonomi - Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "agent",