@geekbeer/minion 2.4.1 → 2.5.1

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.
@@ -51,7 +51,7 @@ function buildAllowedCommands(procMgr) {
51
51
  }
52
52
  commands['update-agent'] = {
53
53
  description: 'Update @geekbeer/minion to latest version and restart',
54
- command: `npm install -g @geekbeer/minion@latest && ${SUDO}systemctl restart minion-agent`,
54
+ command: `${SUDO}npm install -g @geekbeer/minion@latest && ${SUDO}systemctl restart minion-agent`,
55
55
  deferred: true,
56
56
  }
57
57
  commands['restart-display'] = {
@@ -70,7 +70,7 @@ function buildAllowedCommands(procMgr) {
70
70
  }
71
71
  commands['update-agent'] = {
72
72
  description: 'Update @geekbeer/minion to latest version and restart',
73
- command: `npm install -g @geekbeer/minion@latest && ${SUDO}supervisorctl restart minion-agent`,
73
+ command: `${SUDO}npm install -g @geekbeer/minion@latest && ${SUDO}supervisorctl restart minion-agent`,
74
74
  deferred: true,
75
75
  }
76
76
  commands['restart-display'] = {
@@ -85,7 +85,7 @@ function buildAllowedCommands(procMgr) {
85
85
  // Standalone mode: limited commands
86
86
  commands['update-agent'] = {
87
87
  description: 'Update @geekbeer/minion to latest version',
88
- command: 'npm install -g @geekbeer/minion@latest',
88
+ command: `${SUDO}npm install -g @geekbeer/minion@latest`,
89
89
  }
90
90
  commands['status-services'] = {
91
91
  description: 'Show agent process info',
package/minion-cli.sh CHANGED
@@ -200,9 +200,9 @@ do_setup() {
200
200
  fi
201
201
  echo ""
202
202
 
203
- local TOTAL_STEPS=8
203
+ local TOTAL_STEPS=9
204
204
  if [ "$SETUP_TUNNEL" = true ]; then
205
- TOTAL_STEPS=9
205
+ TOTAL_STEPS=10
206
206
  fi
207
207
 
208
208
  # Step 1: Install Claude Code
@@ -275,8 +275,35 @@ do_setup() {
275
275
  echo -e "$ENV_CONTENT" | $SUDO tee /opt/minion-agent/.env > /dev/null
276
276
  echo " -> /opt/minion-agent/.env generated"
277
277
 
278
- # Step 5: Create service configuration
279
- echo "[5/${TOTAL_STEPS}] Creating service configuration ($PROC_MGR)..."
278
+ # Step 5: Configure sudoers for agent user
279
+ echo "[5/${TOTAL_STEPS}] Configuring sudoers for agent user..."
280
+ if [ "$TARGET_USER" != "root" ]; then
281
+ local NPM_BIN
282
+ NPM_BIN="$(which npm)"
283
+ local SUDOERS_FILE="/etc/sudoers.d/minion-agent"
284
+ local SUDOERS_CONTENT="${TARGET_USER} ALL=(root) NOPASSWD: ${NPM_BIN} install -g @geekbeer/minion@latest"
285
+
286
+ case "$PROC_MGR" in
287
+ systemd)
288
+ SUDOERS_CONTENT+="\n${TARGET_USER} ALL=(root) NOPASSWD: /usr/bin/systemctl restart minion-agent"
289
+ SUDOERS_CONTENT+="\n${TARGET_USER} ALL=(root) NOPASSWD: /usr/bin/systemctl restart xvfb fluxbox x11vnc novnc"
290
+ ;;
291
+ supervisord)
292
+ SUDOERS_CONTENT+="\n${TARGET_USER} ALL=(root) NOPASSWD: /usr/bin/supervisorctl restart minion-agent"
293
+ SUDOERS_CONTENT+="\n${TARGET_USER} ALL=(root) NOPASSWD: /usr/bin/supervisorctl restart xvfb fluxbox x11vnc novnc"
294
+ SUDOERS_CONTENT+="\n${TARGET_USER} ALL=(root) NOPASSWD: /usr/bin/supervisorctl status"
295
+ ;;
296
+ esac
297
+
298
+ echo -e "$SUDOERS_CONTENT" | $SUDO tee "$SUDOERS_FILE" > /dev/null
299
+ $SUDO chmod 440 "$SUDOERS_FILE"
300
+ echo " -> $SUDOERS_FILE created"
301
+ else
302
+ echo " -> Skipped (running as root)"
303
+ fi
304
+
305
+ # Step 6: Create service configuration
306
+ echo "[6/${TOTAL_STEPS}] Creating service configuration ($PROC_MGR)..."
280
307
  local NPM_ROOT
281
308
  NPM_ROOT="$(npm root -g)"
282
309
  local SERVER_PATH="${NPM_ROOT}/@geekbeer/minion/server.js"
@@ -367,8 +394,8 @@ SUPEOF
367
394
  ;;
368
395
  esac
369
396
 
370
- # Step 6: Enable and start service
371
- echo "[6/${TOTAL_STEPS}] Starting minion-agent service..."
397
+ # Step 7: Enable and start service
398
+ echo "[7/${TOTAL_STEPS}] Starting minion-agent service..."
372
399
  case "$PROC_MGR" in
373
400
  systemd)
374
401
  $SUDO systemctl daemon-reload
@@ -388,8 +415,8 @@ SUPEOF
388
415
  esac
389
416
  echo " -> minion-agent service started ($PROC_MGR)"
390
417
 
391
- # Step 7: Health check with retry
392
- echo "[7/${TOTAL_STEPS}] Running health check..."
418
+ # Step 8: Health check with retry
419
+ echo "[8/${TOTAL_STEPS}] Running health check..."
393
420
  local RETRIES=5
394
421
  local DELAY=2
395
422
  local SUCCESS=false
@@ -414,8 +441,8 @@ SUPEOF
414
441
  fi
415
442
  fi
416
443
 
417
- # Step 8: Deploy bundled skills
418
- echo "[8/${TOTAL_STEPS}] Deploying bundled skills..."
444
+ # Step 9: Deploy bundled skills
445
+ echo "[9/${TOTAL_STEPS}] Deploying bundled skills..."
419
446
  local BUNDLED_SKILLS_DIR="${NPM_ROOT}/@geekbeer/minion/skills"
420
447
  local CLAUDE_SKILLS_DIR="${TARGET_HOME}/.claude/skills"
421
448
 
@@ -448,10 +475,10 @@ SUPEOF
448
475
  echo " -> Deployed Claude rules: minion.md"
449
476
  fi
450
477
 
451
- # Step 9 (optional): Cloudflare Tunnel setup
478
+ # Step 10 (optional): Cloudflare Tunnel setup
452
479
  if [ "$SETUP_TUNNEL" = true ]; then
453
480
  echo ""
454
- echo "[9/${TOTAL_STEPS}] Setting up Cloudflare Tunnel..."
481
+ echo "[10/${TOTAL_STEPS}] Setting up Cloudflare Tunnel..."
455
482
 
456
483
  if [ -z "$HQ_URL" ] || [ -z "$API_TOKEN" ]; then
457
484
  echo " ERROR: --setup-tunnel requires --hq-url and --api-token"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekbeer/minion",
3
- "version": "2.4.1",
3
+ "version": "2.5.1",
4
4
  "description": "AI Agent runtime for Minion - manages status and skill deployment on VPS",
5
5
  "main": "server.js",
6
6
  "bin": {
@@ -100,6 +100,7 @@ async function executeWorkflowSession(workflow, executionId, skillNames) {
100
100
 
101
101
  // Extend PATH to include common CLI installation locations
102
102
  const additionalPaths = [
103
+ path.join(homeDir, 'bin'),
103
104
  path.join(homeDir, '.npm-global', 'bin'),
104
105
  path.join(homeDir, '.local', 'bin'),
105
106
  path.join(homeDir, '.claude', 'bin'),