arkaos 2.3.1 → 2.3.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/VERSION CHANGED
@@ -1 +1 @@
1
- 2.3.1
1
+ 2.3.3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arkaos",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "The Operating System for AI Agent Teams",
5
5
  "type": "module",
6
6
  "bin": {
package/pyproject.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arkaos-core"
3
- version = "2.3.1"
3
+ version = "2.3.3"
4
4
  description = "Core engine for ArkaOS — The Operating System for AI Agent Teams"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
@@ -1,54 +1,104 @@
1
1
  #!/usr/bin/env bash
2
- # ArkaOS Dashboard — Start FastAPI + Nuxt servers
2
+ # ArkaOS Dashboard — Start FastAPI + Nuxt servers with dynamic ports
3
3
  set -euo pipefail
4
4
 
5
5
  ARKAOS_ROOT="${ARKAOS_ROOT:-$(cd "$(dirname "$0")/.." && pwd)}"
6
6
  DASHBOARD_DIR="${ARKAOS_ROOT}/dashboard"
7
7
  PID_FILE="$HOME/.arkaos/dashboard.pid"
8
- API_PORT="${ARKAOS_DASHBOARD_API_PORT:-3334}"
9
- UI_PORT="${ARKAOS_DASHBOARD_UI_PORT:-3333}"
8
+ PORT_FILE="$HOME/.arkaos/dashboard.ports"
10
9
 
11
10
  mkdir -p "$HOME/.arkaos"
12
11
 
13
- # Check if already running
12
+ # ── Kill existing if running ──
14
13
  if [ -f "$PID_FILE" ]; then
15
- api_pid=$(head -1 "$PID_FILE" 2>/dev/null || echo "")
16
- ui_pid=$(tail -1 "$PID_FILE" 2>/dev/null || echo "")
17
- if [ -n "$api_pid" ] && kill -0 "$api_pid" 2>/dev/null; then
18
- echo "Dashboard already running (API PID: $api_pid, UI PID: $ui_pid)"
19
- echo " API: http://localhost:${API_PORT}"
20
- echo " UI: http://localhost:${UI_PORT}"
21
- exit 0
22
- fi
23
- rm -f "$PID_FILE"
14
+ while read -r pid; do
15
+ kill "$pid" 2>/dev/null || true
16
+ done < "$PID_FILE"
17
+ rm -f "$PID_FILE" "$PORT_FILE"
18
+ sleep 1
24
19
  fi
25
20
 
26
- # Start FastAPI backend
27
- echo "Starting API server on :${API_PORT}..."
28
- ARKAOS_ROOT="$ARKAOS_ROOT" python3 "${ARKAOS_ROOT}/scripts/dashboard-api.py" --port "$API_PORT" &
21
+ # ── Find available ports ──
22
+ find_port() {
23
+ local port=$1
24
+ while lsof -i :"$port" >/dev/null 2>&1; do
25
+ port=$((port + 1))
26
+ done
27
+ echo "$port"
28
+ }
29
+
30
+ # UI first (lower port), API second (higher port) — ensures they don't collide
31
+ UI_PORT=$(find_port "${ARKAOS_DASHBOARD_UI_PORT:-3333}")
32
+ API_PORT=$(find_port "${ARKAOS_DASHBOARD_API_PORT:-$((UI_PORT + 1))}")
33
+
34
+ echo ""
35
+ echo " ArkaOS Dashboard"
36
+ echo " ─────────────────"
37
+
38
+ # ── Start FastAPI backend ──
39
+ echo " Starting API on :${API_PORT}..."
40
+ ARKAOS_ROOT="$ARKAOS_ROOT" python3 "${ARKAOS_ROOT}/scripts/dashboard-api.py" --port "$API_PORT" >/dev/null 2>&1 &
29
41
  API_PID=$!
42
+ sleep 2
43
+
44
+ # Verify API started
45
+ if ! kill -0 "$API_PID" 2>/dev/null; then
46
+ echo " ✗ API failed to start"
47
+ exit 1
48
+ fi
49
+ echo " ✓ API: http://localhost:${API_PORT}"
30
50
 
31
- # Check if Nuxt is built
51
+ # ── Start Nuxt frontend ──
52
+ UI_PID=""
32
53
  if [ -d "${DASHBOARD_DIR}/.output" ]; then
33
- echo "Starting dashboard on :${UI_PORT}..."
34
- PORT="$UI_PORT" node "${DASHBOARD_DIR}/.output/server/index.mjs" &
54
+ echo " Starting UI on :${UI_PORT}..."
55
+ PORT="$UI_PORT" NUXT_PUBLIC_API_BASE="http://localhost:${API_PORT}" node "${DASHBOARD_DIR}/.output/server/index.mjs" >/dev/null 2>&1 &
35
56
  UI_PID=$!
36
57
  elif [ -d "${DASHBOARD_DIR}/node_modules" ]; then
37
- echo "Starting dashboard (dev mode) on :${UI_PORT}..."
38
- cd "$DASHBOARD_DIR" && npx nuxt dev --port "$UI_PORT" &
58
+ echo " Starting UI (dev) on :${UI_PORT}..."
59
+ cd "$DASHBOARD_DIR" && NUXT_PUBLIC_API_BASE="http://localhost:${API_PORT}" npx nuxt dev --port "$UI_PORT" >/dev/null 2>&1 &
39
60
  UI_PID=$!
61
+ cd "$ARKAOS_ROOT"
40
62
  else
41
- echo "Dashboard not built. Run: cd dashboard && npm install && npm run build"
42
- UI_PID=""
63
+ # Auto-install and start
64
+ echo " Installing dashboard dependencies..."
65
+ if command -v pnpm >/dev/null 2>&1; then
66
+ (cd "$DASHBOARD_DIR" && pnpm install --silent 2>/dev/null)
67
+ else
68
+ (cd "$DASHBOARD_DIR" && npm install --silent 2>/dev/null)
69
+ fi
70
+
71
+ if [ -d "${DASHBOARD_DIR}/node_modules" ]; then
72
+ echo " Starting UI (dev) on :${UI_PORT}..."
73
+ cd "$DASHBOARD_DIR" && NUXT_PUBLIC_API_BASE="http://localhost:${API_PORT}" npx nuxt dev --port "$UI_PORT" >/dev/null 2>&1 &
74
+ UI_PID=$!
75
+ cd "$ARKAOS_ROOT"
76
+ else
77
+ echo " ⚠ Dashboard install failed. API-only mode."
78
+ fi
43
79
  fi
44
80
 
45
- # Save PIDs
81
+ # ── Save state ──
46
82
  echo "$API_PID" > "$PID_FILE"
47
- [ -n "${UI_PID:-}" ] && echo "$UI_PID" >> "$PID_FILE"
83
+ [ -n "$UI_PID" ] && echo "$UI_PID" >> "$PID_FILE"
84
+ echo "API_PORT=$API_PORT" > "$PORT_FILE"
85
+ echo "UI_PORT=$UI_PORT" >> "$PORT_FILE"
48
86
 
49
87
  echo ""
50
- echo "ArkaOS Dashboard running:"
51
- echo " API: http://localhost:${API_PORT}/api/overview"
52
- [ -n "${UI_PID:-}" ] && echo " UI: http://localhost:${UI_PORT}"
88
+ echo " ┌──────────────────────────────────────┐"
89
+ echo " API: http://localhost:${API_PORT}"
90
+ [ -n "$UI_PID" ] && echo " UI: http://localhost:${UI_PORT}"
91
+ echo " └──────────────────────────────────────┘"
92
+ echo ""
93
+ echo " Stop: npx arkaos dashboard stop"
94
+ echo " or kill \$(cat $PID_FILE)"
53
95
  echo ""
54
- echo "Stop with: kill \$(cat $PID_FILE)"
96
+
97
+ # Wait for UI to be ready
98
+ if [ -n "$UI_PID" ]; then
99
+ sleep 5
100
+ # Open browser
101
+ if command -v open >/dev/null 2>&1; then
102
+ open "http://localhost:${UI_PORT}" 2>/dev/null || true
103
+ fi
104
+ fi