High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.
fix: npm wrapper arch detection and add dev check npm
Luigi Agosti5d8f589bb8ed
diff --git a/dev b/devindex baf39660..51cce6d5 100755--- a/dev+++ b/dev@@ -35,6 +35,7 @@ COMMANDS=("doctor:🩺:Setup dev environment""check go:🧪:Go only""check dashboard:🧪:Dashboard only"+ "check npm:🧪:npm package only""check security:🧪:Gosec security scan""check docs:🧪:Validate docs JSON""binary:📦:Build release-style binary into dist/"@@ -91,6 +92,11 @@ run_command() {echo ""exec bash scripts/check-dashboard.sh;;+ "check npm")+ echo " ${ACCENT}${BOLD}🧪 npm package checks${NC}"+ echo ""+ exec bash scripts/check-npm.sh+ ;;"check security")echo " ${ACCENT}${BOLD}🔒 Security scan${NC}"echo ""diff --git a/npm/bin/pinchtab b/npm/bin/pinchtabindex 30138827..74a0b705 100755--- a/npm/bin/pinchtab+++ b/npm/bin/pinchtab@@ -7,7 +7,16 @@ const fs = require('fs');function getBinaryName() {const platform = process.platform;- const arch = (process.arch === 'arm64' || process.arch === 'aarch64') ? 'arm64' : 'amd64';+ let arch;+ if (process.arch === 'x64') {+ arch = 'amd64';+ } else if (process.arch === 'arm64') {+ arch = 'arm64';+ } else {+ throw new Error(+ `Unsupported architecture: ${process.arch}. Only x64 (amd64) and arm64 are supported.`+ );+ }if (platform === 'darwin') {return `pinchtab-darwin-${arch}`;diff --git a/npm/tests/mcp-wrapper.test.ts b/npm/tests/mcp-wrapper.test.tsindex 137c7e85..9d69486b 100644--- a/npm/tests/mcp-wrapper.test.ts+++ b/npm/tests/mcp-wrapper.test.ts@@ -66,7 +66,14 @@ describe('MCP wrapper integration', () => {const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'pinchtab-home-'));const pkgPath = path.join(__dirname, '..', '..', 'package.json');const version = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')).version;- const arch = process.arch === 'arm64' || process.arch === 'aarch64' ? 'arm64' : 'amd64';+ let arch: 'amd64' | 'arm64';+ if (process.arch === 'x64') {+ arch = 'amd64';+ } else if (process.arch === 'arm64') {+ arch = 'arm64';+ } else {+ throw new Error(`Unsupported architecture: ${process.arch}`);+ }let binaryName: string;if (process.platform === 'darwin') {diff --git a/scripts/README.md b/scripts/README.mdindex 275d7392..40e60889 100644--- a/scripts/README.md+++ b/scripts/README.md@@ -10,6 +10,7 @@ Development and CI scripts for PinchTab.|--------|---------|| `check.sh` | Go checks (format, vet, build, lint) || `check-dashboard.sh` | Dashboard checks (typecheck, eslint, prettier) |+| `check-npm.sh` | npm package checks (lint, format, typecheck, tests, pack validation) || `check-gosec.sh` | Security scan with gosec (reproduces CI security job) || `check-docs-json.sh` | Validate `docs/index.json` structure || `test.sh` | Go test runner with progress (unit, integration, system, or all) |