brave-real-browser-mcp-server 2.15.2 → 2.15.3
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/dist/index.js +1 -10
- package/dist/tool-definitions.js +0 -43
- package/package.json +1 -1
- package/dist/handlers/APPLY_OPTIMIZATION_PATTERN.js +0 -326
- package/dist/handlers/advanced-scraping-handlers.js +0 -58
- package/dist/handlers/data-transform-handlers.js +0 -66
- package/dist/handlers/dom-handlers.js +0 -206
- package/dist/handlers/network-handlers.js +0 -111
- package/dist/mcp-server.js +0 -265
- package/dist/test-constants.js +0 -111
- package/scripts/update-to-latest.cjs +0 -130
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auto-update script for brave-real-browser-mcp-server
|
|
5
|
-
*
|
|
6
|
-
* This script automatically updates all dependencies to their latest versions
|
|
7
|
-
* when npm install is run. It ensures the project always uses the most recent
|
|
8
|
-
* compatible versions while maintaining all functionality.
|
|
9
|
-
*
|
|
10
|
-
* Features:
|
|
11
|
-
* - Updates brave-real-browser to latest
|
|
12
|
-
* - Updates @modelcontextprotocol/sdk to latest
|
|
13
|
-
* - Skips in CI environments to prevent infinite loops
|
|
14
|
-
* - Silent mode to avoid cluttering install output
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const { execSync } = require('child_process');
|
|
18
|
-
const path = require('path');
|
|
19
|
-
const fs = require('fs');
|
|
20
|
-
|
|
21
|
-
// Skip in CI environments to prevent recursive installs
|
|
22
|
-
const isCIEnvironment = process.env.CI === 'true' ||
|
|
23
|
-
process.env.GITHUB_ACTIONS === 'true' ||
|
|
24
|
-
process.env.SKIP_AUTO_UPDATE === 'true';
|
|
25
|
-
|
|
26
|
-
if (isCIEnvironment) {
|
|
27
|
-
console.log('ℹ️ Auto-update skipped in CI environment');
|
|
28
|
-
process.exit(0);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// Check if we're in the root of the package
|
|
32
|
-
const packageJsonPath = path.join(process.cwd(), 'package.json');
|
|
33
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
34
|
-
console.log('ℹ️ Not in package root, skipping auto-update');
|
|
35
|
-
process.exit(0);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
console.log('\n🔄 Auto-updating dependencies to latest versions...\n');
|
|
39
|
-
|
|
40
|
-
// List of packages to always keep at latest version
|
|
41
|
-
const packagesToUpdate = [
|
|
42
|
-
'brave-real-browser',
|
|
43
|
-
'brave-real-launcher',
|
|
44
|
-
'brave-real-puppeteer-core',
|
|
45
|
-
'@modelcontextprotocol/sdk',
|
|
46
|
-
'turndown',
|
|
47
|
-
'@types/turndown',
|
|
48
|
-
'puppeteer-screen-recorder',
|
|
49
|
-
'rimraf'
|
|
50
|
-
];
|
|
51
|
-
|
|
52
|
-
try {
|
|
53
|
-
// Update each package to latest
|
|
54
|
-
for (const pkg of packagesToUpdate) {
|
|
55
|
-
try {
|
|
56
|
-
console.log(` Updating ${pkg}...`);
|
|
57
|
-
|
|
58
|
-
// Force update for brave-real-puppeteer-core
|
|
59
|
-
const forceFlag = pkg === 'brave-real-puppeteer-core' ? '--force' : '';
|
|
60
|
-
|
|
61
|
-
execSync(`npm install ${pkg}@latest --save --no-audit --no-fund ${forceFlag}`, {
|
|
62
|
-
stdio: 'pipe',
|
|
63
|
-
cwd: process.cwd()
|
|
64
|
-
});
|
|
65
|
-
console.log(` ✓ ${pkg} updated to latest`);
|
|
66
|
-
} catch (error) {
|
|
67
|
-
console.log(` ⚠️ Could not update ${pkg} (non-critical)`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
console.log('\n✅ All dependencies updated to latest versions!\n');
|
|
72
|
-
|
|
73
|
-
// Show current versions
|
|
74
|
-
console.log('📦 Current versions:');
|
|
75
|
-
for (const pkg of packagesToUpdate) {
|
|
76
|
-
try {
|
|
77
|
-
const version = execSync(`npm list ${pkg} --depth=0 --json`, {
|
|
78
|
-
stdio: 'pipe',
|
|
79
|
-
encoding: 'utf8'
|
|
80
|
-
});
|
|
81
|
-
const parsed = JSON.parse(version);
|
|
82
|
-
const installedVersion = parsed.dependencies?.[pkg]?.version || 'not found';
|
|
83
|
-
|
|
84
|
-
// Show 'latest' for brave-real-puppeteer-core
|
|
85
|
-
if (pkg === 'brave-real-puppeteer-core') {
|
|
86
|
-
console.log(` ${pkg}: ${installedVersion} (latest)`);
|
|
87
|
-
} else {
|
|
88
|
-
console.log(` ${pkg}: ${installedVersion}`);
|
|
89
|
-
}
|
|
90
|
-
} catch (error) {
|
|
91
|
-
// Ignore errors
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// Step 4: Run npm audit fix to resolve security vulnerabilities
|
|
96
|
-
console.log('\n🔒 Running security audit fix...');
|
|
97
|
-
try {
|
|
98
|
-
execSync('npm audit fix --force', {
|
|
99
|
-
stdio: 'pipe',
|
|
100
|
-
cwd: process.cwd()
|
|
101
|
-
});
|
|
102
|
-
console.log(' ✓ Security vulnerabilities fixed');
|
|
103
|
-
} catch (error) {
|
|
104
|
-
// Check if there are still vulnerabilities
|
|
105
|
-
try {
|
|
106
|
-
const auditResult = execSync('npm audit --json', {
|
|
107
|
-
stdio: 'pipe',
|
|
108
|
-
encoding: 'utf8'
|
|
109
|
-
});
|
|
110
|
-
const audit = JSON.parse(auditResult);
|
|
111
|
-
if (audit.metadata && audit.metadata.vulnerabilities) {
|
|
112
|
-
const total = audit.metadata.vulnerabilities.total || 0;
|
|
113
|
-
if (total === 0) {
|
|
114
|
-
console.log(' ✓ No security vulnerabilities found');
|
|
115
|
-
} else {
|
|
116
|
-
console.log(` ⚠️ ${total} vulnerabilities remaining (may require manual review)`);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
} catch (auditError) {
|
|
120
|
-
console.log(' ℹ️ Security audit completed');
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
console.log('');
|
|
125
|
-
|
|
126
|
-
} catch (error) {
|
|
127
|
-
console.error('⚠️ Auto-update encountered an error:', error.message);
|
|
128
|
-
console.log('ℹ️ Continuing with current versions...\n');
|
|
129
|
-
process.exit(0); // Don't fail the install
|
|
130
|
-
}
|