loki-mode 5.4.1 → 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 +2 -2
- package/VERSION +1 -1
- package/autonomy/.loki/dashboard/index.html +34 -1
- package/autonomy/run.sh +79 -22
- package/package.json +1 -1
- package/providers/gemini.sh +11 -14
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.
|
|
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.
|
|
244
|
+
**v5.4.3 | Dashboard Improvements | ~245 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.4.
|
|
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">
|
|
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
|
@@ -1374,7 +1374,7 @@ spawn_worktree_session() {
|
|
|
1374
1374
|
;;
|
|
1375
1375
|
gemini)
|
|
1376
1376
|
# Note: -p flag is DEPRECATED per gemini --help. Using positional prompt.
|
|
1377
|
-
gemini --yolo \
|
|
1377
|
+
gemini --yolo --model "${PROVIDER_MODEL:-gemini-3-pro-preview}" \
|
|
1378
1378
|
"Loki Mode: $task_prompt. Read .loki/CONTINUITY.md for context." \
|
|
1379
1379
|
>> "$log_file" 2>&1
|
|
1380
1380
|
;;
|
|
@@ -1467,7 +1467,7 @@ Output ONLY the resolved file content with no conflict markers. No explanations.
|
|
|
1467
1467
|
;;
|
|
1468
1468
|
gemini)
|
|
1469
1469
|
# Note: -p flag is DEPRECATED per gemini --help. Using positional prompt.
|
|
1470
|
-
resolution=$(gemini --yolo "$conflict_prompt" 2>/dev/null)
|
|
1470
|
+
resolution=$(gemini --yolo --model "${PROVIDER_MODEL:-gemini-3-pro-preview}" "$conflict_prompt" 2>/dev/null)
|
|
1471
1471
|
;;
|
|
1472
1472
|
*)
|
|
1473
1473
|
log_error "Unknown provider: ${PROVIDER_NAME}"
|
|
@@ -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
|
-
|
|
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
|
-
#
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
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
|
-
|
|
3353
|
-
|
|
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) ==="
|
|
3408
|
-
echo "=== Provider: ${PROVIDER_NAME:-claude} ==="
|
|
3409
|
-
echo "=== Prompt: $prompt ==="
|
|
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) ==="
|
|
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,17 +3697,17 @@ 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
|
|
|
3647
3704
|
gemini)
|
|
3648
3705
|
# Gemini: Degraded mode - no stream-json, no agent tracking
|
|
3649
|
-
#
|
|
3650
|
-
|
|
3651
|
-
echo "[loki] Gemini
|
|
3652
|
-
gemini --yolo \
|
|
3653
|
-
"$prompt" 2>&1 | tee -a "$log_file"
|
|
3706
|
+
# Using --model flag to specify model
|
|
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"
|
|
3709
|
+
gemini --yolo --model "${PROVIDER_MODEL:-gemini-3-pro-preview}" \
|
|
3710
|
+
"$prompt" 2>&1 | tee -a "$log_file" "$agent_log"
|
|
3654
3711
|
local exit_code=${PIPESTATUS[0]}
|
|
3655
3712
|
;;
|
|
3656
3713
|
|
package/package.json
CHANGED
package/providers/gemini.sh
CHANGED
|
@@ -48,12 +48,12 @@ PROVIDER_HAS_MCP=false
|
|
|
48
48
|
PROVIDER_MAX_PARALLEL=1
|
|
49
49
|
|
|
50
50
|
# Model Configuration
|
|
51
|
-
# Gemini
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
PROVIDER_MODEL_PLANNING="gemini-3-pro-
|
|
55
|
-
PROVIDER_MODEL_DEVELOPMENT="gemini-3-pro-
|
|
56
|
-
PROVIDER_MODEL_FAST="gemini-3-pro-
|
|
51
|
+
# Gemini CLI supports --model flag to specify model
|
|
52
|
+
# Using gemini-3-pro-preview (latest as of Jan 2026)
|
|
53
|
+
PROVIDER_MODEL="gemini-3-pro-preview"
|
|
54
|
+
PROVIDER_MODEL_PLANNING="gemini-3-pro-preview"
|
|
55
|
+
PROVIDER_MODEL_DEVELOPMENT="gemini-3-pro-preview"
|
|
56
|
+
PROVIDER_MODEL_FAST="gemini-3-pro-preview"
|
|
57
57
|
|
|
58
58
|
# Thinking levels (Gemini-specific: maps to reasoning depth)
|
|
59
59
|
PROVIDER_THINKING_PLANNING="high"
|
|
@@ -97,13 +97,12 @@ provider_version() {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
# Invocation function
|
|
100
|
-
#
|
|
101
|
-
# Thinking mode is configured via settings.json, not CLI
|
|
100
|
+
# Uses --model flag to specify model, --yolo for autonomous mode
|
|
102
101
|
# Using positional prompt (not deprecated -p flag)
|
|
103
102
|
provider_invoke() {
|
|
104
103
|
local prompt="$1"
|
|
105
104
|
shift
|
|
106
|
-
gemini --yolo "$prompt" "$@"
|
|
105
|
+
gemini --yolo --model "$PROVIDER_MODEL" "$prompt" "$@"
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
# Model tier to thinking level parameter
|
|
@@ -118,14 +117,12 @@ provider_get_tier_param() {
|
|
|
118
117
|
}
|
|
119
118
|
|
|
120
119
|
# Tier-aware invocation
|
|
121
|
-
#
|
|
122
|
-
# Thinking mode is configured via ~/.gemini/settings.json
|
|
120
|
+
# Uses --model flag to specify model
|
|
123
121
|
# Using positional prompt (not deprecated -p flag)
|
|
124
122
|
provider_invoke_with_tier() {
|
|
125
123
|
local tier="$1"
|
|
126
124
|
local prompt="$2"
|
|
127
125
|
shift 2
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
gemini --yolo "$prompt" "$@"
|
|
126
|
+
echo "[loki] Using tier: $tier, model: $PROVIDER_MODEL" >&2
|
|
127
|
+
gemini --yolo --model "$PROVIDER_MODEL" "$prompt" "$@"
|
|
131
128
|
}
|