loki-mode 6.12.4 → 6.13.0
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/README.md +1 -1
- package/SKILL.md +2 -2
- package/VERSION +1 -1
- package/autonomy/loki +207 -244
- package/dashboard/__init__.py +1 -1
- package/docs/INSTALLATION.md +1 -1
- package/mcp/__init__.py +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
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.
|
|
6
|
+
# Loki Mode v6.13.0
|
|
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.
|
|
270
|
+
**v6.13.0 | [Autonomi](https://www.autonomi.dev/) flagship product | ~260 lines core**
|
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
6.
|
|
1
|
+
6.13.0
|
package/autonomy/loki
CHANGED
|
@@ -5597,293 +5597,253 @@ cmd_sandbox() {
|
|
|
5597
5597
|
exec "$SANDBOX_SH" "$subcommand" "$@"
|
|
5598
5598
|
}
|
|
5599
5599
|
|
|
5600
|
-
# Demo mode -
|
|
5600
|
+
# Demo mode - build a real project from a bundled PRD template
|
|
5601
5601
|
cmd_demo() {
|
|
5602
5602
|
# Handle --help
|
|
5603
5603
|
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
|
|
5604
|
-
echo -e "${BOLD}loki demo${NC} -
|
|
5604
|
+
echo -e "${BOLD}loki demo${NC} - Build a real project from a bundled template"
|
|
5605
5605
|
echo ""
|
|
5606
|
-
echo "
|
|
5607
|
-
echo "
|
|
5606
|
+
echo "Creates a temporary directory, copies the Simple Todo App PRD, and"
|
|
5607
|
+
echo "runs 'loki start' to build it end-to-end. Shows a summary when done"
|
|
5608
|
+
echo "and offers to open the result in a browser."
|
|
5608
5609
|
echo ""
|
|
5609
|
-
echo "Usage: loki demo"
|
|
5610
|
+
echo "Usage: loki demo [options]"
|
|
5611
|
+
echo ""
|
|
5612
|
+
echo "Options:"
|
|
5613
|
+
echo " --dir PATH Use a specific directory instead of a temp dir"
|
|
5614
|
+
echo " --keep Keep the temp directory on exit (default: kept)"
|
|
5615
|
+
echo " --provider P AI provider to use (default: claude)"
|
|
5616
|
+
echo " --dry-run Show what would happen without running"
|
|
5617
|
+
echo ""
|
|
5618
|
+
echo "Examples:"
|
|
5619
|
+
echo " loki demo # Build todo app in temp dir"
|
|
5620
|
+
echo " loki demo --dir ~/demo-project # Build in specific directory"
|
|
5621
|
+
echo " loki demo --provider codex # Use Codex instead of Claude"
|
|
5610
5622
|
return 0
|
|
5611
5623
|
fi
|
|
5612
5624
|
|
|
5613
|
-
local version
|
|
5614
|
-
|
|
5625
|
+
local version
|
|
5626
|
+
version=$(get_version)
|
|
5615
5627
|
local demo_prd="$SKILL_DIR/templates/simple-todo-app.md"
|
|
5628
|
+
local demo_dir=""
|
|
5629
|
+
local provider=""
|
|
5630
|
+
local dry_run=false
|
|
5631
|
+
local start_args=()
|
|
5632
|
+
|
|
5633
|
+
# Parse arguments
|
|
5634
|
+
while [[ $# -gt 0 ]]; do
|
|
5635
|
+
case "$1" in
|
|
5636
|
+
--dir)
|
|
5637
|
+
if [[ -z "${2:-}" ]]; then
|
|
5638
|
+
echo -e "${RED}Error: --dir requires a path${NC}"
|
|
5639
|
+
return 1
|
|
5640
|
+
fi
|
|
5641
|
+
demo_dir="$2"
|
|
5642
|
+
shift 2
|
|
5643
|
+
;;
|
|
5644
|
+
--dir=*)
|
|
5645
|
+
demo_dir="${1#*=}"
|
|
5646
|
+
shift
|
|
5647
|
+
;;
|
|
5648
|
+
--provider)
|
|
5649
|
+
if [[ -z "${2:-}" ]]; then
|
|
5650
|
+
echo -e "${RED}Error: --provider requires a value${NC}"
|
|
5651
|
+
return 1
|
|
5652
|
+
fi
|
|
5653
|
+
provider="$2"
|
|
5654
|
+
shift 2
|
|
5655
|
+
;;
|
|
5656
|
+
--provider=*)
|
|
5657
|
+
provider="${1#*=}"
|
|
5658
|
+
shift
|
|
5659
|
+
;;
|
|
5660
|
+
--keep)
|
|
5661
|
+
# kept by default now, accepted for compat
|
|
5662
|
+
shift
|
|
5663
|
+
;;
|
|
5664
|
+
--dry-run)
|
|
5665
|
+
dry_run=true
|
|
5666
|
+
shift
|
|
5667
|
+
;;
|
|
5668
|
+
*)
|
|
5669
|
+
echo -e "${RED}Unknown option: $1${NC}"
|
|
5670
|
+
echo "Run 'loki demo --help' for usage."
|
|
5671
|
+
return 1
|
|
5672
|
+
;;
|
|
5673
|
+
esac
|
|
5674
|
+
done
|
|
5616
5675
|
|
|
5617
|
-
# Fall back to examples/ if templates/ doesn't exist
|
|
5676
|
+
# Fall back to examples/ if templates/ doesn't exist
|
|
5618
5677
|
if [ ! -f "$demo_prd" ]; then
|
|
5619
5678
|
demo_prd="$SKILL_DIR/examples/simple-todo-app.md"
|
|
5620
5679
|
fi
|
|
5621
5680
|
|
|
5622
5681
|
if [ ! -f "$demo_prd" ]; then
|
|
5623
5682
|
echo -e "${RED}Error: Demo PRD not found${NC}"
|
|
5624
|
-
echo "Expected at: $
|
|
5625
|
-
|
|
5683
|
+
echo "Expected at: $SKILL_DIR/templates/simple-todo-app.md"
|
|
5684
|
+
return 1
|
|
5626
5685
|
fi
|
|
5627
5686
|
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
echo ""
|
|
5636
|
-
|
|
5637
|
-
# Track if we created .loki for cleanup
|
|
5638
|
-
local demo_created_loki=false
|
|
5639
|
-
if [ ! -d "$LOKI_DIR" ]; then
|
|
5640
|
-
demo_created_loki=true
|
|
5687
|
+
# Set up the demo directory
|
|
5688
|
+
if [ -z "$demo_dir" ]; then
|
|
5689
|
+
demo_dir=$(mktemp -d "${TMPDIR:-/tmp}/loki-demo-XXXXXX")
|
|
5690
|
+
else
|
|
5691
|
+
# Expand ~ if present
|
|
5692
|
+
demo_dir="${demo_dir/#\~/$HOME}"
|
|
5693
|
+
mkdir -p "$demo_dir"
|
|
5641
5694
|
fi
|
|
5642
5695
|
|
|
5643
|
-
|
|
5644
|
-
|
|
5696
|
+
echo -e "${BOLD}Loki Mode v$version - Demo${NC}"
|
|
5697
|
+
echo ""
|
|
5698
|
+
echo -e " PRD: Simple Todo App"
|
|
5699
|
+
echo -e " Directory: ${CYAN}$demo_dir${NC}"
|
|
5700
|
+
if [ -n "$provider" ]; then
|
|
5701
|
+
echo -e " Provider: $provider"
|
|
5702
|
+
else
|
|
5703
|
+
echo -e " Provider: claude (default)"
|
|
5704
|
+
fi
|
|
5705
|
+
echo ""
|
|
5645
5706
|
|
|
5646
|
-
#
|
|
5647
|
-
|
|
5648
|
-
local start_time
|
|
5649
|
-
start_time=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
5650
|
-
cat > "$LOKI_DIR/session.json" << SESSEOF
|
|
5651
|
-
{
|
|
5652
|
-
"status": "running",
|
|
5653
|
-
"pid": $demo_pid,
|
|
5654
|
-
"provider": "claude",
|
|
5655
|
-
"started": "$start_time",
|
|
5656
|
-
"project": "$(pwd)",
|
|
5657
|
-
"mode": "demo"
|
|
5658
|
-
}
|
|
5659
|
-
SESSEOF
|
|
5660
|
-
echo "$demo_pid" > "$LOKI_DIR/loki.pid"
|
|
5661
|
-
|
|
5662
|
-
# Start dashboard server
|
|
5663
|
-
local dashboard_started=false
|
|
5664
|
-
if command -v python3 &> /dev/null && [ -f "$SKILL_DIR/dashboard/server.py" ]; then
|
|
5665
|
-
# Kill any existing dashboard on this port
|
|
5666
|
-
local existing_pids
|
|
5667
|
-
existing_pids=$(lsof -ti :57374 2>/dev/null || true)
|
|
5668
|
-
if [ -n "$existing_pids" ]; then
|
|
5669
|
-
echo "$existing_pids" | xargs kill 2>/dev/null || true
|
|
5670
|
-
sleep 1
|
|
5671
|
-
fi
|
|
5707
|
+
# Copy PRD into demo directory
|
|
5708
|
+
cp "$demo_prd" "$demo_dir/prd.md"
|
|
5672
5709
|
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
local demo_python="$DASHBOARD_PYTHON"
|
|
5710
|
+
# Initialize git repo if not already one
|
|
5711
|
+
if [ ! -d "$demo_dir/.git" ]; then
|
|
5712
|
+
git -C "$demo_dir" init -q 2>/dev/null || true
|
|
5713
|
+
fi
|
|
5678
5714
|
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
echo "
|
|
5715
|
+
if [ "$dry_run" = true ]; then
|
|
5716
|
+
echo -e "${YELLOW}[dry-run] Would run:${NC}"
|
|
5717
|
+
echo " cd $demo_dir"
|
|
5718
|
+
echo -n " loki start prd.md --simple --yes"
|
|
5719
|
+
[ -n "$provider" ] && echo -n " --provider $provider"
|
|
5720
|
+
echo ""
|
|
5721
|
+
echo ""
|
|
5722
|
+
echo -e "${DIM}PRD copied to: $demo_dir/prd.md${NC}"
|
|
5723
|
+
return 0
|
|
5724
|
+
fi
|
|
5683
5725
|
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
if curl -s http://127.0.0.1:57374/health &>/dev/null; then
|
|
5688
|
-
dashboard_started=true
|
|
5689
|
-
echo -e "${GREEN}Dashboard started${NC} at http://127.0.0.1:57374"
|
|
5690
|
-
break
|
|
5691
|
-
fi
|
|
5692
|
-
sleep 0.5
|
|
5693
|
-
wait_count=$((wait_count + 1))
|
|
5694
|
-
done
|
|
5726
|
+
echo -e "${DIM}Starting autonomous build...${NC}"
|
|
5727
|
+
echo -e "${DIM}(Press Ctrl+C to stop at any time)${NC}"
|
|
5728
|
+
echo ""
|
|
5695
5729
|
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5730
|
+
# Build start args
|
|
5731
|
+
start_args+=("prd.md" "--simple" "--yes")
|
|
5732
|
+
if [ -n "$provider" ]; then
|
|
5733
|
+
start_args+=("--provider" "$provider")
|
|
5699
5734
|
fi
|
|
5700
5735
|
|
|
5736
|
+
# Run loki start from the demo directory
|
|
5737
|
+
local start_exit=0
|
|
5738
|
+
(cd "$demo_dir" && cmd_start "${start_args[@]}") || start_exit=$?
|
|
5739
|
+
|
|
5701
5740
|
echo ""
|
|
5702
|
-
echo -e "${DIM}
|
|
5741
|
+
echo -e "${DIM}---------------------------------------${NC}"
|
|
5742
|
+
echo -e "${BOLD}Demo Complete${NC}"
|
|
5743
|
+
echo -e "${DIM}---------------------------------------${NC}"
|
|
5703
5744
|
echo ""
|
|
5704
5745
|
|
|
5705
|
-
#
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
local agents=("planner" "architect" "frontend-dev" "backend-dev" "test-engineer" "reviewer-1" "reviewer-2" "reviewer-3" "qa-engineer" "deploy-engineer")
|
|
5709
|
-
local tasks=("Analyze PRD requirements" "Design system architecture" "Scaffold React frontend" "Create Express API server" "Set up SQLite database" "Implement todo CRUD operations" "Write unit tests" "Run code review (3 reviewers)" "Quality gate validation" "Prepare deployment artifacts")
|
|
5710
|
-
|
|
5711
|
-
local iteration=1
|
|
5712
|
-
local completed_tasks=0
|
|
5713
|
-
local total_tasks=${#tasks[@]}
|
|
5714
|
-
local elapsed=0
|
|
5715
|
-
local task_idx=0
|
|
5716
|
-
|
|
5717
|
-
# Cleanup handler (guard against double-run)
|
|
5718
|
-
local _demo_cleaned=false
|
|
5719
|
-
cleanup_demo() {
|
|
5720
|
-
if [ "$_demo_cleaned" = true ]; then return; fi
|
|
5721
|
-
_demo_cleaned=true
|
|
5722
|
-
echo ""
|
|
5723
|
-
echo -e "${DIM}------- Demo Session Complete -------${NC}"
|
|
5724
|
-
echo ""
|
|
5746
|
+
# Show summary of what was generated
|
|
5747
|
+
echo -e "${BOLD}Project Directory:${NC} $demo_dir"
|
|
5748
|
+
echo ""
|
|
5725
5749
|
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5750
|
+
if [ -d "$demo_dir" ]; then
|
|
5751
|
+
# Count generated files (exclude .git and .loki)
|
|
5752
|
+
local file_count
|
|
5753
|
+
file_count=$(find "$demo_dir" -type f \
|
|
5754
|
+
-not -path "$demo_dir/.git/*" \
|
|
5755
|
+
-not -path "$demo_dir/.loki/*" \
|
|
5756
|
+
-not -name "prd.md" \
|
|
5757
|
+
2>/dev/null | wc -l | tr -d ' ')
|
|
5758
|
+
|
|
5759
|
+
local dir_count
|
|
5760
|
+
dir_count=$(find "$demo_dir" -type d \
|
|
5761
|
+
-not -path "$demo_dir/.git" \
|
|
5762
|
+
-not -path "$demo_dir/.git/*" \
|
|
5763
|
+
-not -path "$demo_dir/.loki" \
|
|
5764
|
+
-not -path "$demo_dir/.loki/*" \
|
|
5765
|
+
-not -path "$demo_dir" \
|
|
5766
|
+
2>/dev/null | wc -l | tr -d ' ')
|
|
5767
|
+
|
|
5768
|
+
echo -e "${BOLD}Generated:${NC} $file_count files in $dir_count directories"
|
|
5741
5769
|
echo ""
|
|
5742
5770
|
|
|
5743
|
-
#
|
|
5744
|
-
if
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
" 2>/dev/null || true
|
|
5771
|
+
# Show top-level structure
|
|
5772
|
+
if command -v tree &>/dev/null; then
|
|
5773
|
+
echo -e "${BOLD}Project Structure:${NC}"
|
|
5774
|
+
tree -L 2 --dirsfirst -I '.git|.loki' "$demo_dir" 2>/dev/null || \
|
|
5775
|
+
ls -1 "$demo_dir" 2>/dev/null
|
|
5776
|
+
echo ""
|
|
5777
|
+
else
|
|
5778
|
+
echo -e "${BOLD}Top-level contents:${NC}"
|
|
5779
|
+
ls -1 "$demo_dir" | grep -v '^\.\(git\|loki\)$' || true
|
|
5780
|
+
echo ""
|
|
5754
5781
|
fi
|
|
5755
5782
|
|
|
5756
|
-
#
|
|
5757
|
-
|
|
5758
|
-
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5783
|
+
# Check for common web artifacts and offer to open
|
|
5784
|
+
local has_web=false
|
|
5785
|
+
local open_target=""
|
|
5786
|
+
|
|
5787
|
+
# Check for common entry points
|
|
5788
|
+
for candidate in \
|
|
5789
|
+
"$demo_dir/index.html" \
|
|
5790
|
+
"$demo_dir/dist/index.html" \
|
|
5791
|
+
"$demo_dir/build/index.html" \
|
|
5792
|
+
"$demo_dir/public/index.html" \
|
|
5793
|
+
"$demo_dir/frontend/dist/index.html" \
|
|
5794
|
+
"$demo_dir/client/dist/index.html"; do
|
|
5795
|
+
if [ -f "$candidate" ]; then
|
|
5796
|
+
has_web=true
|
|
5797
|
+
open_target="$candidate"
|
|
5798
|
+
break
|
|
5799
|
+
fi
|
|
5800
|
+
done
|
|
5801
|
+
|
|
5802
|
+
# Check for package.json with start script
|
|
5803
|
+
local has_start_script=false
|
|
5804
|
+
if [ -f "$demo_dir/package.json" ]; then
|
|
5805
|
+
if grep -q '"start"' "$demo_dir/package.json" 2>/dev/null; then
|
|
5806
|
+
has_start_script=true
|
|
5807
|
+
fi
|
|
5808
|
+
if grep -q '"dev"' "$demo_dir/package.json" 2>/dev/null; then
|
|
5809
|
+
has_start_script=true
|
|
5762
5810
|
fi
|
|
5763
|
-
fi
|
|
5764
|
-
# Also kill by port
|
|
5765
|
-
local port_pids
|
|
5766
|
-
port_pids=$(lsof -ti :57374 2>/dev/null || true)
|
|
5767
|
-
if [ -n "$port_pids" ]; then
|
|
5768
|
-
echo "$port_pids" | xargs kill 2>/dev/null || true
|
|
5769
5811
|
fi
|
|
5770
5812
|
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5813
|
+
if [ "$has_web" = true ] && [ -n "$open_target" ]; then
|
|
5814
|
+
echo -e "${CYAN}A web frontend was generated.${NC}"
|
|
5815
|
+
echo ""
|
|
5816
|
+
echo -n "Open in browser? [Y/n] "
|
|
5817
|
+
read -r answer </dev/tty 2>/dev/null || answer="n"
|
|
5818
|
+
if [[ -z "$answer" || "$answer" =~ ^[Yy] ]]; then
|
|
5819
|
+
if command -v open &>/dev/null; then
|
|
5820
|
+
open "$open_target"
|
|
5821
|
+
elif command -v xdg-open &>/dev/null; then
|
|
5822
|
+
xdg-open "$open_target"
|
|
5823
|
+
else
|
|
5824
|
+
echo -e "Open this file in your browser: ${BLUE}$open_target${NC}"
|
|
5825
|
+
fi
|
|
5826
|
+
fi
|
|
5827
|
+
elif [ "$has_start_script" = true ]; then
|
|
5828
|
+
echo -e "${CYAN}A start script was found in package.json.${NC}"
|
|
5829
|
+
echo -e "To run the app:"
|
|
5830
|
+
echo -e " cd $demo_dir && npm install && npm start"
|
|
5774
5831
|
fi
|
|
5775
|
-
|
|
5832
|
+
fi
|
|
5776
5833
|
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
#
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
local duration="${phase_durations[$phase_idx]}"
|
|
5783
|
-
|
|
5784
|
-
echo -e "${BOLD}[$phase]${NC} Phase $((phase_idx + 1))/${#phases[@]}"
|
|
5785
|
-
|
|
5786
|
-
# Write dashboard state for this phase
|
|
5787
|
-
_write_demo_state "$phase" "$iteration" "$completed_tasks" "$total_tasks" "$elapsed"
|
|
5788
|
-
|
|
5789
|
-
# Simulate work within this phase
|
|
5790
|
-
local phase_elapsed=0
|
|
5791
|
-
while [ $phase_elapsed -lt $duration ]; do
|
|
5792
|
-
# Show task progress
|
|
5793
|
-
if [ $task_idx -lt $total_tasks ]; then
|
|
5794
|
-
local task="${tasks[$task_idx]}"
|
|
5795
|
-
local agent="${agents[$((task_idx % ${#agents[@]}))]}"
|
|
5796
|
-
echo -e " ${CYAN}[agent:$agent]${NC} $task"
|
|
5797
|
-
|
|
5798
|
-
# Write task to queue
|
|
5799
|
-
echo "{\"id\":\"task-$task_idx\",\"title\":\"$task\",\"status\":\"completed\",\"agent\":\"$agent\"}" \
|
|
5800
|
-
> "$LOKI_DIR/queue/task-$task_idx.json" 2>/dev/null
|
|
5801
|
-
|
|
5802
|
-
completed_tasks=$((completed_tasks + 1))
|
|
5803
|
-
task_idx=$((task_idx + 1))
|
|
5804
|
-
fi
|
|
5805
|
-
|
|
5806
|
-
# Quality gate checks at specific phases
|
|
5807
|
-
if [ "$phase" = "CODE_REVIEW" ]; then
|
|
5808
|
-
echo -e " ${GREEN}[gate]${NC} Blind review: 3/3 reviewers approve"
|
|
5809
|
-
sleep 1
|
|
5810
|
-
echo -e " ${GREEN}[gate]${NC} Anti-sycophancy check: devil's advocate triggered"
|
|
5811
|
-
sleep 1
|
|
5812
|
-
elif [ "$phase" = "QUALITY_ASSURANCE" ]; then
|
|
5813
|
-
echo -e " ${GREEN}[gate]${NC} Static analysis: 0 issues"
|
|
5814
|
-
sleep 1
|
|
5815
|
-
echo -e " ${GREEN}[gate]${NC} Test coverage: 87% (threshold: 80%)"
|
|
5816
|
-
sleep 1
|
|
5817
|
-
echo -e " ${GREEN}[gate]${NC} Security scan: no vulnerabilities"
|
|
5818
|
-
sleep 1
|
|
5819
|
-
fi
|
|
5820
|
-
|
|
5821
|
-
iteration=$((iteration + 1))
|
|
5822
|
-
local step_sleep=2
|
|
5823
|
-
if [ $((duration - phase_elapsed)) -lt 3 ]; then
|
|
5824
|
-
step_sleep=1
|
|
5825
|
-
fi
|
|
5826
|
-
sleep $step_sleep
|
|
5827
|
-
phase_elapsed=$((phase_elapsed + step_sleep))
|
|
5828
|
-
elapsed=$((elapsed + step_sleep))
|
|
5829
|
-
|
|
5830
|
-
# Update dashboard state
|
|
5831
|
-
_write_demo_state "$phase" "$iteration" "$completed_tasks" "$total_tasks" "$elapsed"
|
|
5832
|
-
done
|
|
5834
|
+
echo ""
|
|
5835
|
+
echo -e "${BOLD}Next steps:${NC}"
|
|
5836
|
+
echo -e " cd $demo_dir # Explore the generated project"
|
|
5837
|
+
echo -e " loki start ./your-prd.md # Build your own project"
|
|
5838
|
+
echo -e " loki init # Create a PRD interactively"
|
|
5833
5839
|
|
|
5840
|
+
if [ $start_exit -ne 0 ]; then
|
|
5834
5841
|
echo ""
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
echo -e "${BOLD}[COMPLETION_COUNCIL]${NC} Evaluating project completion..."
|
|
5839
|
-
_write_demo_state "COMPLETION_COUNCIL" "$iteration" "$total_tasks" "$total_tasks" "$elapsed"
|
|
5840
|
-
sleep 2
|
|
5841
|
-
echo -e " ${GREEN}[council]${NC} Member 1: COMPLETE (all acceptance criteria met)"
|
|
5842
|
-
sleep 1
|
|
5843
|
-
echo -e " ${GREEN}[council]${NC} Member 2: COMPLETE (tests passing, code reviewed)"
|
|
5844
|
-
sleep 1
|
|
5845
|
-
echo -e " ${GREEN}[council]${NC} Member 3: COMPLETE (deployment artifacts ready)"
|
|
5846
|
-
sleep 1
|
|
5847
|
-
echo -e " ${GREEN}[verdict]${NC} Unanimous: PROJECT COMPLETE (3/3 votes)"
|
|
5848
|
-
|
|
5849
|
-
# Write final state
|
|
5850
|
-
_write_demo_state "COMPLETE" "$iteration" "$total_tasks" "$total_tasks" "$elapsed"
|
|
5842
|
+
echo -e "${YELLOW}Note: loki start exited with code $start_exit.${NC}"
|
|
5843
|
+
echo -e "${YELLOW}The demo directory is preserved at: $demo_dir${NC}"
|
|
5844
|
+
fi
|
|
5851
5845
|
|
|
5852
|
-
|
|
5853
|
-
}
|
|
5854
|
-
|
|
5855
|
-
# Helper: write dashboard-state.json during demo
|
|
5856
|
-
_write_demo_state() {
|
|
5857
|
-
local phase="$1" iteration="$2" completed="$3" total="$4" elapsed="$5"
|
|
5858
|
-
local running_agents=$((RANDOM % 3 + 1))
|
|
5859
|
-
local pending=$((total - completed))
|
|
5860
|
-
local temp_file="$LOKI_DIR/.dashboard-state.json.tmp"
|
|
5861
|
-
|
|
5862
|
-
cat > "$temp_file" << STATEEOF
|
|
5863
|
-
{
|
|
5864
|
-
"status": "running",
|
|
5865
|
-
"mode": "demo",
|
|
5866
|
-
"phase": "$phase",
|
|
5867
|
-
"iteration": $iteration,
|
|
5868
|
-
"complexity": "standard",
|
|
5869
|
-
"provider": "claude",
|
|
5870
|
-
"current_task": "",
|
|
5871
|
-
"pending_tasks": $pending,
|
|
5872
|
-
"completed_tasks": $completed,
|
|
5873
|
-
"failed_tasks": 0,
|
|
5874
|
-
"running_agents": $running_agents,
|
|
5875
|
-
"total_agents": 10,
|
|
5876
|
-
"uptime_seconds": $elapsed,
|
|
5877
|
-
"version": "$(get_version)",
|
|
5878
|
-
"agents": [],
|
|
5879
|
-
"council": {
|
|
5880
|
-
"enabled": true,
|
|
5881
|
-
"last_verdict": null,
|
|
5882
|
-
"convergence_score": 0
|
|
5883
|
-
}
|
|
5884
|
-
}
|
|
5885
|
-
STATEEOF
|
|
5886
|
-
mv "$temp_file" "$LOKI_DIR/dashboard-state.json" 2>/dev/null
|
|
5846
|
+
return $start_exit
|
|
5887
5847
|
}
|
|
5888
5848
|
|
|
5889
5849
|
# Quick mode - lightweight single-task execution
|
|
@@ -11584,6 +11544,9 @@ cmd_remote() {
|
|
|
11584
11544
|
# Emit event
|
|
11585
11545
|
emit_event session cli remote_start "prd=${prd_abs:-none}"
|
|
11586
11546
|
|
|
11547
|
+
# Always use bypassPermissions so Loki Mode can operate autonomously
|
|
11548
|
+
rc_flags+=("--permission-mode" "bypassPermissions")
|
|
11549
|
+
|
|
11587
11550
|
# Launch remote-control
|
|
11588
11551
|
# If workspace isn't trusted, it exits immediately with an error.
|
|
11589
11552
|
# Use || true to prevent set -e from killing the script before auto-recovery.
|
package/dashboard/__init__.py
CHANGED
package/docs/INSTALLATION.md
CHANGED
package/mcp/__init__.py
CHANGED