@geekbeer/minion 3.5.34 → 3.5.35

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/win/minion-cli.ps1 +50 -53
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekbeer/minion",
3
- "version": "3.5.34",
3
+ "version": "3.5.35",
4
4
  "description": "AI Agent runtime for Minion - manages status and skill deployment on VPS",
5
5
  "main": "linux/server.js",
6
6
  "bin": {
@@ -114,25 +114,46 @@ function Test-CommandExists {
114
114
  $null -ne (Get-Command $Name -ErrorAction SilentlyContinue)
115
115
  }
116
116
 
117
- function Invoke-Winget {
118
- # Wrapper for winget install that handles broken sources.
119
- # winget's msstore source can fail with 0x8a15000f on fresh/misconfigured systems.
120
- # This function tries: (1) --source winget, (2) winget source reset + retry, (3) fail.
121
- param([string]$Id)
122
-
123
- if (-not (Test-CommandExists 'winget')) { return $false }
124
-
125
- # Attempt 1: install with --source winget (skip msstore)
126
- $result = cmd /c "winget install --id $Id --source winget --accept-package-agreements --accept-source-agreements 2>&1"
127
- if ($LASTEXITCODE -eq 0) { return $true }
128
-
129
- # Attempt 2: reset sources and retry
130
- Write-Host " Retrying after winget source reset..."
131
- cmd /c "winget source reset --force 2>&1" | Out-Null
132
- $result = cmd /c "winget install --id $Id --source winget --accept-package-agreements --accept-source-agreements 2>&1"
133
- if ($LASTEXITCODE -eq 0) { return $true }
117
+ function Install-GitDirect {
118
+ # Download and install Git for Windows from GitHub Releases.
119
+ # Uses the GitHub API to resolve the latest 64-bit installer URL.
120
+ Write-Host " Downloading Git for Windows..."
121
+ try {
122
+ $releaseApi = 'https://api.github.com/repos/git-for-windows/git/releases/latest'
123
+ $release = Invoke-RestMethod -Uri $releaseApi -UseBasicParsing
124
+ $asset = $release.assets | Where-Object { $_.name -match '64-bit\.exe$' -and $_.name -notmatch 'portable' } | Select-Object -First 1
125
+ if (-not $asset) { Write-Warn "Could not find Git installer from GitHub releases"; return $false }
126
+
127
+ $installerPath = Join-Path $env:TEMP $asset.name
128
+ Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $installerPath -UseBasicParsing
129
+ Write-Host " Running Git installer (silent)..."
130
+ $proc = Start-Process -FilePath $installerPath -ArgumentList '/VERYSILENT', '/NORESTART', '/SP-' -Wait -PassThru
131
+ Remove-Item $installerPath -Force -ErrorAction SilentlyContinue
132
+ return ($proc.ExitCode -eq 0)
133
+ }
134
+ catch {
135
+ Write-Warn "Git download failed: $_"
136
+ return $false
137
+ }
138
+ }
134
139
 
135
- return $false
140
+ function Install-PythonDirect {
141
+ # Download and install Python from python.org.
142
+ # Installs for all users with PATH prepended.
143
+ Write-Host " Downloading Python 3.12..."
144
+ try {
145
+ $pyUrl = 'https://www.python.org/ftp/python/3.12.8/python-3.12.8-amd64.exe'
146
+ $installerPath = Join-Path $env:TEMP 'python-installer.exe'
147
+ Invoke-WebRequest -Uri $pyUrl -OutFile $installerPath -UseBasicParsing
148
+ Write-Host " Running Python installer (silent)..."
149
+ $proc = Start-Process -FilePath $installerPath -ArgumentList '/quiet', 'InstallAllUsers=1', 'PrependPath=1', 'Include_pip=1' -Wait -PassThru
150
+ Remove-Item $installerPath -Force -ErrorAction SilentlyContinue
151
+ return ($proc.ExitCode -eq 0)
152
+ }
153
+ catch {
154
+ Write-Warn "Python download failed: $_"
155
+ return $false
156
+ }
136
157
  }
137
158
 
138
159
  function Remove-ScheduledTaskSilent {
@@ -519,23 +540,8 @@ function Invoke-Setup {
519
540
  Write-Detail "Node.js $nodeVersion already installed"
520
541
  }
521
542
  else {
522
- Write-Host " Installing Node.js via winget..."
523
- $installed = Invoke-Winget 'OpenJS.NodeJS.LTS'
524
- if ($installed) {
525
- # Refresh PATH
526
- $env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
527
- if (Test-CommandExists 'node') {
528
- Write-Detail "Node.js installed successfully"
529
- }
530
- else {
531
- Write-Warn "Node.js installed but not in PATH. Please restart this terminal."
532
- exit 1
533
- }
534
- }
535
- else {
536
- Write-Error "Failed to install Node.js. Please install manually from https://nodejs.org/"
537
- exit 1
538
- }
543
+ Write-Error "Node.js is required but not installed. Please install from https://nodejs.org/ and re-run setup."
544
+ exit 1
539
545
  }
540
546
 
541
547
  # Step 2: Install Git (required by Claude Code for git-bash)
@@ -551,8 +557,7 @@ function Invoke-Setup {
551
557
  if (Test-Path $candidateBash) { $gitBashPath = $candidateBash }
552
558
  }
553
559
  else {
554
- Write-Host " Installing Git via winget..."
555
- $installed = Invoke-Winget 'Git.Git'
560
+ $installed = Install-GitDirect
556
561
  if ($installed) {
557
562
  # Refresh PATH
558
563
  $env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
@@ -808,14 +813,13 @@ function Invoke-Setup {
808
813
  if ($pyVer -match '\d+\.\d+') { $pythonUsable = $true }
809
814
  }
810
815
  if (-not $pythonUsable) {
811
- Write-Host " Python not found. Installing via winget..."
812
- $installed = Invoke-Winget 'Python.Python.3.12'
816
+ $installed = Install-PythonDirect
813
817
  if ($installed) {
814
818
  $env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
815
819
  Write-Detail "Python installed"
816
820
  }
817
821
  else {
818
- Write-Warn "Failed to install Python. Install manually: winget install --id Python.Python.3.12"
822
+ Write-Warn "Failed to install Python. Install manually from https://www.python.org/downloads/"
819
823
  }
820
824
  }
821
825
 
@@ -1270,23 +1274,16 @@ function Invoke-Configure {
1270
1274
 
1271
1275
  # Install cloudflared if needed
1272
1276
  if (-not (Test-CommandExists 'cloudflared')) {
1273
- Write-Host " Installing cloudflared..."
1274
- if (Test-CommandExists 'winget') {
1275
- $installed = Invoke-Winget 'Cloudflare.cloudflared'
1276
- if ($installed) {
1277
- $env:PATH = [System.Environment]::GetEnvironmentVariable('PATH', 'Machine') + ';' + [System.Environment]::GetEnvironmentVariable('PATH', 'User')
1278
- }
1279
- }
1280
- elseif (Test-CommandExists 'choco') {
1281
- & choco install cloudflared -y
1282
- }
1283
- else {
1284
- Write-Host " Downloading cloudflared..."
1277
+ Write-Host " Downloading cloudflared..."
1278
+ try {
1285
1279
  $cfUrl = 'https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe'
1286
1280
  $cfPath = Join-Path $DataDir 'cloudflared.exe'
1287
- Invoke-WebRequest -Uri $cfUrl -OutFile $cfPath
1281
+ Invoke-WebRequest -Uri $cfUrl -OutFile $cfPath -UseBasicParsing
1288
1282
  Write-Detail "cloudflared downloaded to $cfPath"
1289
1283
  }
1284
+ catch {
1285
+ Write-Warn "Failed to download cloudflared: $_"
1286
+ }
1290
1287
  }
1291
1288
  else {
1292
1289
  Write-Detail "cloudflared already installed"