browserwing 0.0.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.
package/PUBLISHING.md ADDED
@@ -0,0 +1,141 @@
1
+ # NPM Publishing Guide
2
+
3
+ This document explains how to publish BrowserWing to npm.
4
+
5
+ ## Prerequisites
6
+
7
+ 1. **NPM Account**: Create an account at https://www.npmjs.com
8
+ 2. **NPM Authentication**: Login via `npm login`
9
+ 3. **GitHub Release**: Create a GitHub release with binaries first
10
+
11
+ ## Publishing Process
12
+
13
+ ### Manual Publishing
14
+
15
+ 1. **Update Version**
16
+ ```bash
17
+ cd npm
18
+ npm version <new-version> # e.g., npm version 0.0.2
19
+ ```
20
+
21
+ 2. **Verify Files**
22
+ ```bash
23
+ npm pack --dry-run
24
+ ```
25
+
26
+ 3. **Test Installation Locally**
27
+ ```bash
28
+ npm link
29
+ browserwing --help
30
+ npm unlink
31
+ ```
32
+
33
+ 4. **Publish**
34
+ ```bash
35
+ ./publish.sh
36
+ # Or manually:
37
+ npm publish
38
+ ```
39
+
40
+ ### Automated Publishing (via GitHub Actions)
41
+
42
+ When you create a new GitHub Release:
43
+
44
+ 1. Tag format: `v0.0.1` (must start with 'v')
45
+ 2. Upload all platform binaries to the release
46
+ 3. Publish the release
47
+ 4. GitHub Actions will automatically:
48
+ - Update package.json version
49
+ - Publish to npm
50
+ - Add comment to release
51
+
52
+ **Setup Required:**
53
+ - Add `NPM_TOKEN` to GitHub Secrets
54
+ 1. Generate token at https://www.npmjs.com/settings/[username]/tokens
55
+ 2. Go to GitHub repo → Settings → Secrets → New repository secret
56
+ 3. Name: `NPM_TOKEN`, Value: your token
57
+
58
+ ## Package Structure
59
+
60
+ ```
61
+ npm/
62
+ ├── package.json # NPM package manifest
63
+ ├── install.js # Post-install script (downloads binary)
64
+ ├── bin/
65
+ │ └── browserwing # Node wrapper script
66
+ ├── README.md # NPM package README
67
+ └── .npmignore # Files to exclude from package
68
+ ```
69
+
70
+ ## How It Works
71
+
72
+ 1. User runs `npm install -g browserwing`
73
+ 2. NPM downloads the package (without binaries)
74
+ 3. `postinstall` script runs (`install.js`)
75
+ 4. Script detects OS/architecture
76
+ 5. Downloads appropriate binary from GitHub Releases
77
+ 6. Places binary in `bin/` directory
78
+ 7. NPM creates symlink to `bin/browserwing`
79
+
80
+ ## Testing
81
+
82
+ ### Test Local Package
83
+
84
+ ```bash
85
+ cd npm
86
+ npm pack
87
+ npm install -g browserwing-0.0.1.tgz
88
+ browserwing --version
89
+ npm uninstall -g browserwing
90
+ ```
91
+
92
+ ### Test Published Package
93
+
94
+ ```bash
95
+ npm install -g browserwing
96
+ browserwing --version
97
+ npm uninstall -g browserwing
98
+ ```
99
+
100
+ ## Troubleshooting
101
+
102
+ **Binary not downloading:**
103
+ - Check GitHub release exists with correct version
104
+ - Verify binary naming: `browserwing-{platform}-{arch}[.exe]`
105
+ - Check network/proxy settings
106
+
107
+ **Permission issues:**
108
+ - Use `sudo npm install -g browserwing` on Unix systems
109
+ - Or install without `-g` and use `npx browserwing`
110
+
111
+ **Platform not supported:**
112
+ - Check `install.js` platform/arch mappings
113
+ - Ensure binaries exist for that platform
114
+
115
+ ## Version Management
116
+
117
+ - Keep `npm/package.json` version in sync with GitHub releases
118
+ - Use semver format: MAJOR.MINOR.PATCH
119
+ - Tag releases with 'v' prefix: `v0.0.1`
120
+
121
+ ## Maintenance
122
+
123
+ **Unpublish a version (within 72 hours):**
124
+ ```bash
125
+ npm unpublish browserwing@0.0.1
126
+ ```
127
+
128
+ **Deprecate a version:**
129
+ ```bash
130
+ npm deprecate browserwing@0.0.1 "Critical bug, use 0.0.2+"
131
+ ```
132
+
133
+ **Update package info without republishing:**
134
+ - Update README, keywords, etc. in package.json
135
+ - Publish new patch version
136
+
137
+ ## References
138
+
139
+ - NPM Publishing: https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry
140
+ - Semantic Versioning: https://semver.org/
141
+ - Package.json: https://docs.npmjs.com/cli/v10/configuring-npm/package-json
package/README.md ADDED
@@ -0,0 +1,46 @@
1
+ # BrowserWing
2
+
3
+ Native Browser Automation Platform with AI Integration
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ # Using npm
9
+ npm install -g browserwing
10
+
11
+ # Using pnpm
12
+ pnpm add -g browserwing
13
+
14
+ # Using yarn
15
+ yarn global add browserwing
16
+ ```
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ # Start BrowserWing server
22
+ browserwing --port 8080
23
+
24
+ # Open in browser
25
+ # http://localhost:8080
26
+ ```
27
+
28
+ ## Features
29
+
30
+ - **Complete Browser Control**: 26+ HTTP API endpoints for full-featured browser automation
31
+ - **Built-in AI Agent**: Direct conversational interface for browser automation tasks
32
+ - **Universal AI Tool Integration**: Native MCP & Skills protocol support
33
+ - **Visual Script Recording**: Record, edit, and replay browser actions
34
+ - **Flexible Export Options**: Convert scripts to MCP commands or Skills files
35
+ - **Intelligent Data Extraction**: LLM-powered semantic extraction
36
+ - **Session Management**: Robust cookie and storage handling
37
+
38
+ ## Documentation
39
+
40
+ - Website: https://browserwing.com
41
+ - GitHub: https://github.com/browserwing/browserwing
42
+ - Issues: https://github.com/browserwing/browserwing/issues
43
+
44
+ ## License
45
+
46
+ MIT
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { spawn } = require('child_process');
4
+ const path = require('path');
5
+
6
+ // Determine binary name based on platform
7
+ const isWindows = process.platform === 'win32';
8
+ const binaryName = isWindows ? 'browserwing.exe' : 'browserwing';
9
+ const binaryPath = path.join(__dirname, binaryName);
10
+
11
+ // Check if binary exists
12
+ const fs = require('fs');
13
+ if (!fs.existsSync(binaryPath)) {
14
+ console.error('BrowserWing binary not found. Please reinstall the package.');
15
+ console.error('Run: npm install browserwing');
16
+ process.exit(1);
17
+ }
18
+
19
+ // Spawn the binary with all arguments
20
+ const child = spawn(binaryPath, process.argv.slice(2), {
21
+ stdio: 'inherit',
22
+ windowsHide: false
23
+ });
24
+
25
+ child.on('exit', (code) => {
26
+ process.exit(code);
27
+ });
28
+
29
+ child.on('error', (err) => {
30
+ console.error('Failed to start BrowserWing:', err);
31
+ process.exit(1);
32
+ });
package/install.js ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ const https = require('https');
4
+ const fs = require('fs');
5
+ const path = require('path');
6
+ const { execSync } = require('child_process');
7
+
8
+ const REPO = 'browserwing/browserwing';
9
+ const PACKAGE_VERSION = require('./package.json').version;
10
+
11
+ // Platform mapping
12
+ const PLATFORM_MAP = {
13
+ darwin: 'darwin',
14
+ linux: 'linux',
15
+ win32: 'windows'
16
+ };
17
+
18
+ const ARCH_MAP = {
19
+ x64: 'amd64',
20
+ arm64: 'arm64',
21
+ arm: 'armv7'
22
+ };
23
+
24
+ function getPlatform() {
25
+ const platform = PLATFORM_MAP[process.platform];
26
+ const arch = ARCH_MAP[process.arch];
27
+
28
+ if (!platform || !arch) {
29
+ throw new Error(`Unsupported platform: ${process.platform}-${process.arch}`);
30
+ }
31
+
32
+ return { platform, arch };
33
+ }
34
+
35
+ function getDownloadURL(version, platform, arch) {
36
+ const binaryName = platform === 'windows'
37
+ ? `browserwing-${platform}-${arch}.exe`
38
+ : `browserwing-${platform}-${arch}`;
39
+
40
+ return `https://github.com/${REPO}/releases/download/v${version}/${binaryName}`;
41
+ }
42
+
43
+ function downloadFile(url, dest) {
44
+ return new Promise((resolve, reject) => {
45
+ console.log(`Downloading BrowserWing from ${url}...`);
46
+
47
+ const file = fs.createWriteStream(dest);
48
+
49
+ https.get(url, {
50
+ headers: { 'User-Agent': 'browserwing-npm-installer' }
51
+ }, (response) => {
52
+ // Handle redirects
53
+ if (response.statusCode === 302 || response.statusCode === 301) {
54
+ return https.get(response.headers.location, (redirectResponse) => {
55
+ redirectResponse.pipe(file);
56
+ file.on('finish', () => {
57
+ file.close();
58
+ resolve();
59
+ });
60
+ }).on('error', reject);
61
+ }
62
+
63
+ if (response.statusCode !== 200) {
64
+ reject(new Error(`Failed to download: ${response.statusCode}`));
65
+ return;
66
+ }
67
+
68
+ response.pipe(file);
69
+
70
+ file.on('finish', () => {
71
+ file.close();
72
+ resolve();
73
+ });
74
+ }).on('error', (err) => {
75
+ fs.unlink(dest, () => {});
76
+ reject(err);
77
+ });
78
+ });
79
+ }
80
+
81
+ async function install() {
82
+ try {
83
+ const { platform, arch } = getPlatform();
84
+ console.log(`Installing BrowserWing for ${platform}-${arch}...`);
85
+
86
+ // Create bin directory
87
+ const binDir = path.join(__dirname, 'bin');
88
+ if (!fs.existsSync(binDir)) {
89
+ fs.mkdirSync(binDir, { recursive: true });
90
+ }
91
+
92
+ // Determine binary name
93
+ const binaryName = platform === 'windows' ? 'browserwing.exe' : 'browserwing';
94
+ const binaryPath = path.join(binDir, binaryName);
95
+
96
+ // Download binary
97
+ const downloadURL = getDownloadURL(PACKAGE_VERSION, platform, arch);
98
+ await downloadFile(downloadURL, binaryPath);
99
+
100
+ // Make executable on Unix-like systems
101
+ if (platform !== 'windows') {
102
+ fs.chmodSync(binaryPath, 0o755);
103
+ }
104
+
105
+ console.log('BrowserWing installed successfully!');
106
+ console.log('');
107
+ console.log('Quick start:');
108
+ console.log(' browserwing --port 8080');
109
+ console.log(' Open http://localhost:8080');
110
+
111
+ } catch (error) {
112
+ console.error('Installation failed:', error.message);
113
+ console.error('');
114
+ console.error('You can manually download from:');
115
+ console.error(`https://github.com/${REPO}/releases`);
116
+ process.exit(1);
117
+ }
118
+ }
119
+
120
+ install();
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "browserwing",
3
+ "version": "0.0.1",
4
+ "description": "Native Browser Automation Platform with AI Integration",
5
+ "keywords": [
6
+ "browser",
7
+ "automation",
8
+ "mcp",
9
+ "skills",
10
+ "ai",
11
+ "llm",
12
+ "rpa",
13
+ "web-automation"
14
+ ],
15
+ "homepage": "https://browserwing.com",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/browserwing/browserwing.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/browserwing/browserwing/issues"
22
+ },
23
+ "license": "MIT",
24
+ "author": "BrowserWing Team",
25
+ "bin": {
26
+ "browserwing": "bin/browserwing"
27
+ },
28
+ "scripts": {
29
+ "postinstall": "node install.js"
30
+ },
31
+ "engines": {
32
+ "node": ">=14.0.0"
33
+ },
34
+ "os": [
35
+ "darwin",
36
+ "linux",
37
+ "win32"
38
+ ],
39
+ "cpu": [
40
+ "x64",
41
+ "arm64"
42
+ ]
43
+ }
package/publish.sh ADDED
@@ -0,0 +1,58 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # NPM Publishing Script for BrowserWing
5
+
6
+ echo "╔════════════════════════════════════════╗"
7
+ echo "║ BrowserWing NPM Publishing Script ║"
8
+ echo "╚════════════════════════════════════════╝"
9
+ echo ""
10
+
11
+ # Check if logged in to npm
12
+ if ! npm whoami &> /dev/null; then
13
+ echo "Error: Not logged in to npm"
14
+ echo "Please run: npm login"
15
+ exit 1
16
+ fi
17
+
18
+ # Get version from package.json
19
+ VERSION=$(node -p "require('./package.json').version")
20
+ echo "Publishing version: $VERSION"
21
+ echo ""
22
+
23
+ # Verify the version matches a GitHub release
24
+ echo "Verifying GitHub release exists..."
25
+ RELEASE_URL="https://api.github.com/repos/browserwing/browserwing/releases/tags/v${VERSION}"
26
+ if ! curl -sf "$RELEASE_URL" > /dev/null; then
27
+ echo "Error: GitHub release v${VERSION} not found"
28
+ echo "Please create a GitHub release first"
29
+ exit 1
30
+ fi
31
+
32
+ echo "✓ GitHub release v${VERSION} found"
33
+ echo ""
34
+
35
+ # Dry run first
36
+ echo "Running npm publish --dry-run..."
37
+ npm publish --dry-run
38
+
39
+ echo ""
40
+ echo "Ready to publish to npm?"
41
+ read -p "Continue? (y/N) " -n 1 -r
42
+ echo ""
43
+
44
+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
45
+ echo "Cancelled"
46
+ exit 1
47
+ fi
48
+
49
+ # Publish to npm
50
+ echo "Publishing to npm..."
51
+ npm publish
52
+
53
+ echo ""
54
+ echo "✓ Successfully published browserwing@${VERSION} to npm!"
55
+ echo ""
56
+ echo "Users can now install with:"
57
+ echo " npm install -g browserwing"
58
+ echo " pnpm add -g browserwing"