@visa/cli 2.0.0-rc.10 → 2.0.0-rc.12

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/install.ps1 CHANGED
@@ -123,15 +123,44 @@ try {
123
123
  exit 1
124
124
  }
125
125
 
126
+ # Check npm separately. Some Windows installs expose node before a refreshed
127
+ # shell can find npm, and npm failures are much easier to fix when called out.
128
+ try {
129
+ $npmVersionOutput = (& npm --version 2>$null | Select-Object -First 1)
130
+ if ($LASTEXITCODE -ne 0 -or -not $npmVersionOutput) { throw "not found" }
131
+ Write-Host " [OK] npm $($npmVersionOutput.Trim())" -ForegroundColor Green
132
+ } catch {
133
+ Write-Host " npm is required but was not found." -ForegroundColor Red
134
+ Write-Host " Install Node.js from https://nodejs.org/, close and reopen PowerShell, then try again." -ForegroundColor Yellow
135
+ Wait-BeforeExit
136
+ exit 1
137
+ }
138
+
126
139
  # Install via npm
127
140
  Write-Host " Running: npm install -g @visa/cli" -ForegroundColor Gray
128
- & npm install -g @visa/cli 2>&1 | Out-Host
141
+ $npmOutput = & npm install -g @visa/cli 2>&1
142
+ $npmExitCode = $LASTEXITCODE
143
+ $npmText = ($npmOutput | Out-String)
144
+ $npmOutput | Out-Host
129
145
 
130
- if ($LASTEXITCODE -ne 0) {
146
+ if ($npmExitCode -ne 0) {
131
147
  Write-Host ""
132
- Write-Host " npm install failed (exit code $LASTEXITCODE)." -ForegroundColor Red
133
- Write-Host " Try running PowerShell as Administrator, or run manually:" -ForegroundColor Yellow
134
- Write-Host " npm install -g @visa/cli" -ForegroundColor Yellow
148
+ Write-Host " npm install failed (exit code $npmExitCode)." -ForegroundColor Red
149
+
150
+ if ($npmText -match 'Access is denied|EACCES|EPERM|permission denied') {
151
+ Write-Host " Permission problem detected. Prefer a user-scoped npm prefix before using Administrator PowerShell:" -ForegroundColor Yellow
152
+ Write-Host ' mkdir "$env:USERPROFILE\.npm-global"' -ForegroundColor Yellow
153
+ Write-Host ' npm config set prefix "$env:USERPROFILE\.npm-global"' -ForegroundColor Yellow
154
+ Write-Host ' [Environment]::SetEnvironmentVariable("Path", "$env:USERPROFILE\.npm-global;$env:Path", "User")' -ForegroundColor Yellow
155
+ Write-Host " Then close and reopen PowerShell and rerun this installer." -ForegroundColor Yellow
156
+ } elseif ($npmText -match 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY|SELF_SIGNED_CERT_IN_CHAIN|CERT_HAS_EXPIRED|unable to verify') {
157
+ Write-Host " Certificate/proxy problem detected. If you are on a corporate network, use a personal network or ask IT for the npm certificate configuration." -ForegroundColor Yellow
158
+ Write-Host " Do not disable TLS verification globally." -ForegroundColor Yellow
159
+ } else {
160
+ Write-Host " Run manually for the full error, then retry:" -ForegroundColor Yellow
161
+ Write-Host " npm install -g @visa/cli" -ForegroundColor Yellow
162
+ }
163
+
135
164
  Wait-BeforeExit
136
165
  exit 1
137
166
  }
@@ -158,10 +187,12 @@ Write-Host ""
158
187
  if ($verifiedCommand) {
159
188
  Write-Host " Visa CLI $visaVersion installed." -ForegroundColor Green
160
189
  Write-Host " Run '$verifiedCommand setup' to get started." -ForegroundColor Cyan
190
+ Write-Host " After setup, run /mcp inside Claude Code, not PowerShell, if Claude Code was already open." -ForegroundColor Cyan
161
191
  Write-Host ""
162
192
  } else {
163
193
  $primaryCommand = $cliCommandNames | Select-Object -First 1
164
194
  Write-Host " Installed but '$primaryCommand' was not runnable from PATH yet." -ForegroundColor Yellow
165
195
  Write-Host " Close and reopen PowerShell, then run: $primaryCommand setup" -ForegroundColor Yellow
196
+ Write-Host " Run /mcp inside Claude Code after setup if you need to reconnect the MCP server." -ForegroundColor Yellow
166
197
  Write-Host ""
167
198
  }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@visa/cli",
3
- "version": "2.0.0-rc.10",
3
+ "version": "2.0.0-rc.12",
4
4
  "description": "AI-powered payments for Claude Code",
5
5
  "bin": {
6
6
  "visa-cli": "./bin/visa-cli.js"
7
7
  },
8
8
  "scripts": {
9
+ "prebuild": "pnpm --filter @visa/money build",
9
10
  "build": "tsc --noEmit && node esbuild.config.js",
10
11
  "dev": "tsc --watch",
11
12
  "pretest": "pnpm build",
@@ -38,6 +39,7 @@
38
39
  "license": "SEE LICENSE IN LICENSE",
39
40
  "dependencies": {
40
41
  "@modelcontextprotocol/sdk": "^1.0.0",
42
+ "@visa/money": "workspace:*",
41
43
  "commander": "^12.1.0",
42
44
  "zod": "^3.23.0"
43
45
  },
@@ -48,7 +50,7 @@
48
50
  "@changesets/cli": "^2.31.0",
49
51
  "@types/jest": "^30.0.0",
50
52
  "@types/node": "^25.6.0",
51
- "@typescript-eslint/eslint-plugin": "^8.59.1",
53
+ "@typescript-eslint/eslint-plugin": "^8.59.2",
52
54
  "@typescript-eslint/parser": "^8.59.1",
53
55
  "@types/express": "^5.0.0",
54
56
  "esbuild": "^0.27.4",