loki-mode 5.4.2 → 5.4.3

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 zero human intervention. Requires --dangerously-skip-permissions flag.
4
4
  ---
5
5
 
6
- # Loki Mode v5.4.2
6
+ # Loki Mode v5.4.3
7
7
 
8
8
  **You are an autonomous agent. You make decisions. You do not ask questions. You do not stop.**
9
9
 
@@ -241,4 +241,4 @@ Auto-detected or force with `LOKI_COMPLEXITY`:
241
241
 
242
242
  ---
243
243
 
244
- **v5.4.2 | Gemini 3 Pro Preview Model | ~245 lines core**
244
+ **v5.4.3 | Dashboard Improvements | ~245 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.4.2
1
+ 5.4.3
@@ -153,6 +153,33 @@
153
153
  font-weight: 400;
154
154
  }
155
155
 
156
+ /* Project Info */
157
+ .project-info {
158
+ padding: 12px;
159
+ background: var(--bg-tertiary);
160
+ border-radius: 8px;
161
+ margin-top: 8px;
162
+ }
163
+
164
+ .project-info .project-name {
165
+ font-size: 13px;
166
+ font-weight: 600;
167
+ color: var(--accent);
168
+ white-space: nowrap;
169
+ overflow: hidden;
170
+ text-overflow: ellipsis;
171
+ }
172
+
173
+ .project-info .project-path {
174
+ font-size: 10px;
175
+ color: var(--text-muted);
176
+ font-family: 'JetBrains Mono', monospace;
177
+ white-space: nowrap;
178
+ overflow: hidden;
179
+ text-overflow: ellipsis;
180
+ margin-top: 2px;
181
+ }
182
+
156
183
  /* Theme Toggle */
157
184
  .theme-toggle {
158
185
  display: flex;
@@ -1346,10 +1373,16 @@
1346
1373
  <div class="logo-icon">L</div>
1347
1374
  <div>
1348
1375
  <div class="logo-text">Loki Mode</div>
1349
- <div class="logo-version" id="version">v4.1.0</div>
1376
+ <div class="logo-version" id="version">v5.4.2</div>
1350
1377
  </div>
1351
1378
  </div>
1352
1379
 
1380
+ <!-- Project Info (injected by run.sh) -->
1381
+ <div class="project-info" id="project-info">
1382
+ <div class="project-name" id="project-name">--</div>
1383
+ <div class="project-path" id="project-path" title="">--</div>
1384
+ </div>
1385
+
1353
1386
  <!-- Theme Toggle -->
1354
1387
  <div class="theme-toggle">
1355
1388
  <span>Theme</span>
package/autonomy/run.sh CHANGED
@@ -1981,10 +1981,17 @@ write_dashboard_state() {
1981
1981
  fi
1982
1982
 
1983
1983
  # Write comprehensive JSON state
1984
+ local project_name=$(basename "$(pwd)")
1985
+ local project_path=$(pwd)
1986
+
1984
1987
  cat > "$output_file" << EOF
1985
1988
  {
1986
1989
  "timestamp": "$(date -u +%Y-%m-%dT%H:%M:%SZ)",
1987
1990
  "version": "$version",
1991
+ "project": {
1992
+ "name": "$project_name",
1993
+ "path": "$project_path"
1994
+ },
1988
1995
  "mode": "$mode",
1989
1996
  "phase": "$current_phase",
1990
1997
  "complexity": "$complexity",
@@ -2057,9 +2064,17 @@ stop_status_monitor() {
2057
2064
  generate_dashboard() {
2058
2065
  # Copy dashboard from skill installation (v4.0.0 with Anthropic design language)
2059
2066
  local skill_dashboard="$SCRIPT_DIR/.loki/dashboard/index.html"
2067
+ local project_name=$(basename "$(pwd)")
2068
+ local project_path=$(pwd)
2069
+
2060
2070
  if [ -f "$skill_dashboard" ]; then
2061
- cp "$skill_dashboard" .loki/dashboard/index.html
2071
+ # Copy and inject project info
2072
+ sed -e "s|Loki Mode</title>|Loki Mode - $project_name</title>|g" \
2073
+ -e "s|<div class=\"project-name\" id=\"project-name\">--|<div class=\"project-name\" id=\"project-name\">$project_name|g" \
2074
+ -e "s|<div class=\"project-path\" id=\"project-path\" title=\"\">--|<div class=\"project-path\" id=\"project-path\" title=\"$project_path\">$project_path|g" \
2075
+ "$skill_dashboard" > .loki/dashboard/index.html
2062
2076
  log_info "Dashboard copied from skill installation"
2077
+ log_info "Project: $project_name ($project_path)"
2063
2078
  return
2064
2079
  fi
2065
2080
 
@@ -2853,11 +2868,36 @@ start_dashboard() {
2853
2868
  # Generate HTML
2854
2869
  generate_dashboard
2855
2870
 
2856
- # Kill any existing process on the dashboard port
2857
- if lsof -i :$DASHBOARD_PORT &>/dev/null; then
2858
- log_step "Killing existing process on port $DASHBOARD_PORT..."
2859
- lsof -ti :$DASHBOARD_PORT | xargs kill -9 2>/dev/null || true
2860
- sleep 1
2871
+ # Find available port - don't kill other loki instances
2872
+ local original_port=$DASHBOARD_PORT
2873
+ local max_attempts=10
2874
+ local attempt=0
2875
+
2876
+ while lsof -i :$DASHBOARD_PORT &>/dev/null && [ $attempt -lt $max_attempts ]; do
2877
+ # Check if it's our own dashboard (same project)
2878
+ local existing_pid=$(lsof -ti :$DASHBOARD_PORT 2>/dev/null | head -1)
2879
+ local existing_cwd=""
2880
+ if [ -n "$existing_pid" ]; then
2881
+ existing_cwd=$(lsof -p "$existing_pid" 2>/dev/null | grep cwd | awk '{print $NF}')
2882
+ fi
2883
+
2884
+ if [ "$existing_cwd" = "$(pwd)/.loki" ]; then
2885
+ # Same project - kill and reuse port
2886
+ log_step "Killing existing dashboard for this project on port $DASHBOARD_PORT..."
2887
+ lsof -ti :$DASHBOARD_PORT | xargs kill -9 2>/dev/null || true
2888
+ sleep 1
2889
+ break
2890
+ else
2891
+ # Different project - find new port
2892
+ ((DASHBOARD_PORT++))
2893
+ ((attempt++))
2894
+ log_info "Port $((DASHBOARD_PORT-1)) in use by another instance, trying $DASHBOARD_PORT..."
2895
+ fi
2896
+ done
2897
+
2898
+ if [ $attempt -ge $max_attempts ]; then
2899
+ log_error "Could not find available port after $max_attempts attempts"
2900
+ return 1
2861
2901
  fi
2862
2902
 
2863
2903
  # Start Python HTTP server from .loki/ root so it can serve queue/ and state/
@@ -3349,8 +3389,11 @@ run_autonomous() {
3349
3389
  log_info "Base wait: ${BASE_WAIT}s"
3350
3390
  log_info "Max wait: ${MAX_WAIT}s"
3351
3391
  log_info "Autonomy mode: $AUTONOMY_MODE"
3352
- log_info "Prompt repetition (Haiku): $PROMPT_REPETITION"
3353
- log_info "Confidence routing: $CONFIDENCE_ROUTING"
3392
+ # Only show Claude-specific features for Claude provider
3393
+ if [ "${PROVIDER_NAME:-claude}" = "claude" ]; then
3394
+ log_info "Prompt repetition (Haiku): $PROMPT_REPETITION"
3395
+ log_info "Confidence routing: $CONFIDENCE_ROUTING"
3396
+ fi
3354
3397
  echo ""
3355
3398
 
3356
3399
  load_state
@@ -3393,6 +3436,20 @@ run_autonomous() {
3393
3436
  # Run AI provider with live output
3394
3437
  local start_time=$(date +%s)
3395
3438
  local log_file=".loki/logs/autonomy-$(date +%Y%m%d).log"
3439
+ local agent_log=".loki/logs/agent.log"
3440
+
3441
+ # Ensure agent.log exists for dashboard real-time view
3442
+ # (Dashboard reads this file for terminal output)
3443
+ # Keep history but limit size to ~1MB to prevent memory issues
3444
+ if [ -f "$agent_log" ] && [ "$(stat -f%z "$agent_log" 2>/dev/null || stat -c%s "$agent_log" 2>/dev/null)" -gt 1000000 ]; then
3445
+ # Trim to last 500KB
3446
+ tail -c 500000 "$agent_log" > "$agent_log.tmp" && mv "$agent_log.tmp" "$agent_log"
3447
+ fi
3448
+ touch "$agent_log"
3449
+ echo "" >> "$agent_log"
3450
+ echo "════════════════════════════════════════════════════════════════" >> "$agent_log"
3451
+ echo " NEW SESSION - $(date)" >> "$agent_log"
3452
+ echo "════════════════════════════════════════════════════════════════" >> "$agent_log"
3396
3453
 
3397
3454
  echo ""
3398
3455
  echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
@@ -3403,16 +3460,16 @@ run_autonomous() {
3403
3460
  echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
3404
3461
  echo ""
3405
3462
 
3406
- # Log start time
3407
- echo "=== Session started at $(date) ===" >> "$log_file"
3408
- echo "=== Provider: ${PROVIDER_NAME:-claude} ===" >> "$log_file"
3409
- echo "=== Prompt: $prompt ===" >> "$log_file"
3463
+ # Log start time (to both archival and dashboard logs)
3464
+ echo "=== Session started at $(date) ===" | tee -a "$log_file" "$agent_log"
3465
+ echo "=== Provider: ${PROVIDER_NAME:-claude} ===" | tee -a "$log_file" "$agent_log"
3466
+ echo "=== Prompt (truncated): ${prompt:0:200}... ===" | tee -a "$log_file" "$agent_log"
3410
3467
 
3411
3468
  # Dynamic tier selection based on RARV cycle phase
3412
3469
  CURRENT_TIER=$(get_rarv_tier "$ITERATION_COUNT")
3413
3470
  local rarv_phase=$(get_rarv_phase_name "$ITERATION_COUNT")
3414
3471
  local tier_param=$(get_provider_tier_param "$CURRENT_TIER")
3415
- echo "=== RARV Phase: $rarv_phase, Tier: $CURRENT_TIER ($tier_param) ===" >> "$log_file"
3472
+ echo "=== RARV Phase: $rarv_phase, Tier: $CURRENT_TIER ($tier_param) ===" | tee -a "$log_file" "$agent_log"
3416
3473
  log_info "RARV Phase: $rarv_phase -> Tier: $CURRENT_TIER ($tier_param)"
3417
3474
 
3418
3475
  set +e
@@ -3425,7 +3482,7 @@ run_autonomous() {
3425
3482
  LOKI_CURRENT_MODEL="$tier_param" \
3426
3483
  claude --dangerously-skip-permissions --model "$tier_param" -p "$prompt" \
3427
3484
  --output-format stream-json --verbose 2>&1 | \
3428
- tee -a "$log_file" | \
3485
+ tee -a "$log_file" "$agent_log" | \
3429
3486
  python3 -u -c '
3430
3487
  import sys
3431
3488
  import json
@@ -3640,7 +3697,7 @@ if __name__ == "__main__":
3640
3697
  # Uses dynamic tier from RARV phase (tier_param already set above)
3641
3698
  CODEX_MODEL_REASONING_EFFORT="$tier_param" \
3642
3699
  codex exec --dangerously-bypass-approvals-and-sandbox \
3643
- "$prompt" 2>&1 | tee -a "$log_file"
3700
+ "$prompt" 2>&1 | tee -a "$log_file" "$agent_log"
3644
3701
  local exit_code=${PIPESTATUS[0]}
3645
3702
  ;;
3646
3703
 
@@ -3648,8 +3705,9 @@ if __name__ == "__main__":
3648
3705
  # Gemini: Degraded mode - no stream-json, no agent tracking
3649
3706
  # Using --model flag to specify model
3650
3707
  echo "[loki] Gemini model: ${PROVIDER_MODEL:-gemini-3-pro-preview}, tier: $tier_param" >> "$log_file"
3708
+ echo "[loki] Gemini model: ${PROVIDER_MODEL:-gemini-3-pro-preview}, tier: $tier_param" >> "$agent_log"
3651
3709
  gemini --yolo --model "${PROVIDER_MODEL:-gemini-3-pro-preview}" \
3652
- "$prompt" 2>&1 | tee -a "$log_file"
3710
+ "$prompt" 2>&1 | tee -a "$log_file" "$agent_log"
3653
3711
  local exit_code=${PIPESTATUS[0]}
3654
3712
  ;;
3655
3713
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "5.4.2",
3
+ "version": "5.4.3",
4
4
  "description": "Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "claude",