loki-mode 5.4.7 → 5.5.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/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.7
6
+ # Loki Mode v5.5.0
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.7 | Gemini rate limit fallback to flash model | ~245 lines core**
244
+ **v5.5.0 | HTTP/SSE API server for integrations | ~245 lines core**
package/VERSION CHANGED
@@ -1 +1 @@
1
- 5.4.7
1
+ 5.5.0
package/autonomy/loki CHANGED
@@ -79,7 +79,10 @@ show_help() {
79
79
  echo " pause Pause after current session"
80
80
  echo " resume Resume paused execution"
81
81
  echo " status Show current status"
82
+ echo " logs Show recent log output"
82
83
  echo " dashboard Open dashboard in browser"
84
+ echo " serve Start HTTP API server (alias for api start)"
85
+ echo " api [cmd] HTTP API server (start|stop|status)"
83
86
  echo " import Import GitHub issues as tasks"
84
87
  echo " config [cmd] Manage configuration (show|init|edit|path)"
85
88
  echo " version Show version"
@@ -505,6 +508,123 @@ cmd_version() {
505
508
  echo "Loki Mode v$(get_version)"
506
509
  }
507
510
 
511
+ # Show recent logs
512
+ cmd_logs() {
513
+ local lines="${1:-50}"
514
+ local log_file="$LOKI_DIR/logs/session.log"
515
+
516
+ if [ ! -f "$log_file" ]; then
517
+ echo -e "${YELLOW}No log file found at $log_file${NC}"
518
+ exit 0
519
+ fi
520
+
521
+ echo -e "${BOLD}Recent Logs (last $lines lines)${NC}"
522
+ echo ""
523
+ tail -n "$lines" "$log_file"
524
+ }
525
+
526
+ # API server management
527
+ cmd_api() {
528
+ local subcommand="${1:-help}"
529
+ local port="${LOKI_API_PORT:-9898}"
530
+ local pid_file="$LOKI_DIR/api.pid"
531
+ local api_server="$SKILL_DIR/api/server.js"
532
+
533
+ case "$subcommand" in
534
+ start)
535
+ # Check if Node.js is available
536
+ if ! command -v node &> /dev/null; then
537
+ echo -e "${RED}Error: Node.js not found. Install with: brew install node${NC}"
538
+ exit 1
539
+ fi
540
+
541
+ # Check if already running
542
+ if [ -f "$pid_file" ]; then
543
+ local existing_pid=$(cat "$pid_file")
544
+ if kill -0 "$existing_pid" 2>/dev/null; then
545
+ echo -e "${YELLOW}API server already running (PID: $existing_pid)${NC}"
546
+ echo "URL: http://localhost:$port"
547
+ exit 0
548
+ fi
549
+ fi
550
+
551
+ # Start server
552
+ mkdir -p "$LOKI_DIR"
553
+ nohup node "$api_server" --port "$port" > "$LOKI_DIR/logs/api.log" 2>&1 &
554
+ local new_pid=$!
555
+ echo "$new_pid" > "$pid_file"
556
+
557
+ echo -e "${GREEN}API server started${NC}"
558
+ echo " PID: $new_pid"
559
+ echo " URL: http://localhost:$port"
560
+ echo " Logs: $LOKI_DIR/logs/api.log"
561
+ ;;
562
+
563
+ stop)
564
+ if [ -f "$pid_file" ]; then
565
+ local pid=$(cat "$pid_file")
566
+ if kill -0 "$pid" 2>/dev/null; then
567
+ kill "$pid"
568
+ rm -f "$pid_file"
569
+ echo -e "${GREEN}API server stopped${NC}"
570
+ else
571
+ rm -f "$pid_file"
572
+ echo -e "${YELLOW}API server was not running${NC}"
573
+ fi
574
+ else
575
+ echo -e "${YELLOW}No API server PID file found${NC}"
576
+ fi
577
+ ;;
578
+
579
+ status)
580
+ if [ -f "$pid_file" ]; then
581
+ local pid=$(cat "$pid_file")
582
+ if kill -0 "$pid" 2>/dev/null; then
583
+ echo -e "${GREEN}API server running${NC}"
584
+ echo " PID: $pid"
585
+ echo " URL: http://localhost:$port"
586
+
587
+ # Try to fetch status
588
+ if command -v curl &> /dev/null; then
589
+ echo ""
590
+ echo -e "${CYAN}Status:${NC}"
591
+ curl -s "http://localhost:$port/status" 2>/dev/null | jq . 2>/dev/null || true
592
+ fi
593
+ else
594
+ echo -e "${YELLOW}API server not running (stale PID file)${NC}"
595
+ rm -f "$pid_file"
596
+ fi
597
+ else
598
+ echo -e "${YELLOW}API server not running${NC}"
599
+ fi
600
+ ;;
601
+
602
+ *)
603
+ echo -e "${BOLD}Loki Mode API Server${NC}"
604
+ echo ""
605
+ echo "Usage: loki api <command>"
606
+ echo ""
607
+ echo "Commands:"
608
+ echo " start Start the HTTP API server"
609
+ echo " stop Stop the API server"
610
+ echo " status Check if API server is running"
611
+ echo ""
612
+ echo "Environment:"
613
+ echo " LOKI_API_PORT Port to listen on (default: 9898)"
614
+ echo ""
615
+ echo "Endpoints:"
616
+ echo " GET /health - Health check"
617
+ echo " GET /status - Session status"
618
+ echo " GET /events - SSE stream"
619
+ echo " GET /logs - Recent logs"
620
+ echo " POST /start - Start session"
621
+ echo " POST /stop - Stop session"
622
+ echo " POST /pause - Pause session"
623
+ echo " POST /resume - Resume session"
624
+ ;;
625
+ esac
626
+ }
627
+
508
628
  # Main command dispatcher
509
629
  main() {
510
630
  if [ $# -eq 0 ]; then
@@ -534,6 +654,15 @@ main() {
534
654
  dashboard)
535
655
  cmd_dashboard
536
656
  ;;
657
+ logs)
658
+ cmd_logs "$@"
659
+ ;;
660
+ serve)
661
+ cmd_api start "$@"
662
+ ;;
663
+ api)
664
+ cmd_api "$@"
665
+ ;;
537
666
  import)
538
667
  cmd_import
539
668
  ;;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loki-mode",
3
- "version": "5.4.7",
3
+ "version": "5.5.0",
4
4
  "description": "Multi-agent autonomous startup system for Claude Code, Codex CLI, and Gemini CLI",
5
5
  "keywords": [
6
6
  "claude",