brave-real-browser-mcp-server 2.33.12 โ 2.34.0
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/.github/workflows/auto-update-deps.yml +330 -0
- package/README.md +321 -39
- package/package.json +9 -2
- package/packages/brave-real-blocker/package.json +2 -2
- package/packages/brave-real-launcher/package.json +2 -2
- package/packages/brave-real-puppeteer-core/package.json +2 -2
- package/src/mcp/handlers.js +869 -0
- package/src/mcp/index.js +174 -0
- package/src/mcp/server.js +131 -0
- package/src/mcp/tools.js +763 -0
- package/.github/workflows/ecosystem-sync.yml +0 -77
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
name: "\U0001F504 Auto-Update All Dependencies"
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
# Daily check at 6 AM UTC (11:30 AM IST)
|
|
5
|
+
schedule:
|
|
6
|
+
- cron: '0 6 * * *'
|
|
7
|
+
|
|
8
|
+
# Manual trigger
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
force_update:
|
|
12
|
+
description: 'Force update all dependencies'
|
|
13
|
+
required: false
|
|
14
|
+
default: false
|
|
15
|
+
type: boolean
|
|
16
|
+
dry_run:
|
|
17
|
+
description: 'Dry run (check only, no update)'
|
|
18
|
+
required: false
|
|
19
|
+
default: false
|
|
20
|
+
type: boolean
|
|
21
|
+
|
|
22
|
+
env:
|
|
23
|
+
NODE_VERSION: '20'
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
# ==================== CHECK & UPDATE DEPENDENCIES ====================
|
|
27
|
+
update-dependencies:
|
|
28
|
+
name: "\U0001F504 Check & Update Dependencies"
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
permissions:
|
|
31
|
+
contents: write
|
|
32
|
+
pull-requests: write
|
|
33
|
+
|
|
34
|
+
outputs:
|
|
35
|
+
blocker_updated: ${{ steps.update-blocker.outputs.updated }}
|
|
36
|
+
launcher_updated: ${{ steps.update-launcher.outputs.updated }}
|
|
37
|
+
puppeteer_updated: ${{ steps.update-puppeteer.outputs.updated }}
|
|
38
|
+
root_updated: ${{ steps.update-root.outputs.updated }}
|
|
39
|
+
any_updated: ${{ steps.summary.outputs.any_updated }}
|
|
40
|
+
|
|
41
|
+
steps:
|
|
42
|
+
- name: "\U0001F4E5 Checkout"
|
|
43
|
+
uses: actions/checkout@v4
|
|
44
|
+
with:
|
|
45
|
+
token: ${{ secrets.GH_TOKEN || github.token }}
|
|
46
|
+
fetch-depth: 0
|
|
47
|
+
|
|
48
|
+
- name: "\U0001F7E2 Setup Node.js"
|
|
49
|
+
uses: actions/setup-node@v4
|
|
50
|
+
with:
|
|
51
|
+
node-version: ${{ env.NODE_VERSION }}
|
|
52
|
+
registry-url: 'https://registry.npmjs.org'
|
|
53
|
+
|
|
54
|
+
- name: "\u2699\uFE0F Configure Git"
|
|
55
|
+
run: |
|
|
56
|
+
git config --global user.name "github-actions[bot]"
|
|
57
|
+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
58
|
+
|
|
59
|
+
- name: "\U0001F4E6 Install Dependencies"
|
|
60
|
+
run: npm install
|
|
61
|
+
|
|
62
|
+
# ==================== UPDATE BLOCKER ====================
|
|
63
|
+
- name: "\U0001F6E1\uFE0F Update brave-real-blocker dependencies"
|
|
64
|
+
id: update-blocker
|
|
65
|
+
run: |
|
|
66
|
+
echo "=================================================="
|
|
67
|
+
echo "\U0001F6E1\uFE0F Checking brave-real-blocker dependencies..."
|
|
68
|
+
echo "=================================================="
|
|
69
|
+
cd packages/brave-real-blocker
|
|
70
|
+
|
|
71
|
+
# Check outdated
|
|
72
|
+
echo "๐ Current outdated packages:"
|
|
73
|
+
npm outdated || true
|
|
74
|
+
|
|
75
|
+
OUTDATED=$(npm outdated --json 2>/dev/null || echo "{}")
|
|
76
|
+
|
|
77
|
+
if [ "$OUTDATED" != "{}" ] && [ -n "$OUTDATED" ]; then
|
|
78
|
+
echo "๐ฆ Found outdated dependencies!"
|
|
79
|
+
echo "$OUTDATED" | jq -r 'to_entries[] | "\(.key): \(.value.current) โ \(.value.latest)"' || true
|
|
80
|
+
|
|
81
|
+
if [ "${{ github.event.inputs.dry_run }}" != "true" ]; then
|
|
82
|
+
# Update all dependencies
|
|
83
|
+
npm update
|
|
84
|
+
|
|
85
|
+
# Update to latest major versions for key packages
|
|
86
|
+
npm install @cliqz/adblocker-puppeteer@latest --save 2>/dev/null || true
|
|
87
|
+
npm install @ghostery/adblocker-puppeteer@latest --save 2>/dev/null || true
|
|
88
|
+
npm install cross-fetch@latest fs-extra@latest --save 2>/dev/null || true
|
|
89
|
+
|
|
90
|
+
echo "updated=true" >> $GITHUB_OUTPUT
|
|
91
|
+
echo "โ
Updated brave-real-blocker dependencies"
|
|
92
|
+
else
|
|
93
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
94
|
+
echo "๐งช Dry run - skipping update"
|
|
95
|
+
fi
|
|
96
|
+
else
|
|
97
|
+
echo "โ
All dependencies are up to date"
|
|
98
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
# ==================== UPDATE LAUNCHER ====================
|
|
102
|
+
- name: "\U0001F680 Update brave-real-launcher dependencies"
|
|
103
|
+
id: update-launcher
|
|
104
|
+
run: |
|
|
105
|
+
echo "=================================================="
|
|
106
|
+
echo "\U0001F680 Checking brave-real-launcher dependencies..."
|
|
107
|
+
echo "=================================================="
|
|
108
|
+
cd packages/brave-real-launcher
|
|
109
|
+
|
|
110
|
+
echo "๐ Current outdated packages:"
|
|
111
|
+
npm outdated || true
|
|
112
|
+
|
|
113
|
+
OUTDATED=$(npm outdated --json 2>/dev/null || echo "{}")
|
|
114
|
+
|
|
115
|
+
if [ "$OUTDATED" != "{}" ] && [ -n "$OUTDATED" ]; then
|
|
116
|
+
echo "๐ฆ Found outdated dependencies!"
|
|
117
|
+
|
|
118
|
+
if [ "${{ github.event.inputs.dry_run }}" != "true" ]; then
|
|
119
|
+
npm update
|
|
120
|
+
npm install which@latest escape-string-regexp@latest is-wsl@latest --save 2>/dev/null || true
|
|
121
|
+
|
|
122
|
+
echo "updated=true" >> $GITHUB_OUTPUT
|
|
123
|
+
echo "โ
Updated brave-real-launcher dependencies"
|
|
124
|
+
else
|
|
125
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
126
|
+
fi
|
|
127
|
+
else
|
|
128
|
+
echo "โ
All dependencies are up to date"
|
|
129
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
130
|
+
fi
|
|
131
|
+
|
|
132
|
+
# ==================== UPDATE PUPPETEER-CORE ====================
|
|
133
|
+
- name: "\U0001F3AD Update brave-real-puppeteer-core dependencies"
|
|
134
|
+
id: update-puppeteer
|
|
135
|
+
run: |
|
|
136
|
+
echo "=================================================="
|
|
137
|
+
echo "\U0001F3AD Checking brave-real-puppeteer-core dependencies..."
|
|
138
|
+
echo "=================================================="
|
|
139
|
+
cd packages/brave-real-puppeteer-core
|
|
140
|
+
|
|
141
|
+
echo "๐ Current outdated packages:"
|
|
142
|
+
npm outdated || true
|
|
143
|
+
|
|
144
|
+
OUTDATED=$(npm outdated --json 2>/dev/null || echo "{}")
|
|
145
|
+
|
|
146
|
+
if [ "$OUTDATED" != "{}" ] && [ -n "$OUTDATED" ]; then
|
|
147
|
+
echo "๐ฆ Found outdated dependencies!"
|
|
148
|
+
|
|
149
|
+
if [ "${{ github.event.inputs.dry_run }}" != "true" ]; then
|
|
150
|
+
npm update
|
|
151
|
+
|
|
152
|
+
# Update puppeteer-core and playwright-core to latest
|
|
153
|
+
npm install puppeteer-core@latest --save-optional 2>/dev/null || true
|
|
154
|
+
npm install playwright-core@latest --save-optional 2>/dev/null || true
|
|
155
|
+
npm install yargs@latest --save 2>/dev/null || true
|
|
156
|
+
|
|
157
|
+
echo "updated=true" >> $GITHUB_OUTPUT
|
|
158
|
+
echo "โ
Updated brave-real-puppeteer-core dependencies"
|
|
159
|
+
else
|
|
160
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
161
|
+
fi
|
|
162
|
+
else
|
|
163
|
+
echo "โ
All dependencies are up to date"
|
|
164
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
165
|
+
fi
|
|
166
|
+
|
|
167
|
+
# ==================== UPDATE ROOT ====================
|
|
168
|
+
- name: "\U0001F981 Update root (mcp-server) dependencies"
|
|
169
|
+
id: update-root
|
|
170
|
+
run: |
|
|
171
|
+
echo "=================================================="
|
|
172
|
+
echo "\U0001F981 Checking root package dependencies..."
|
|
173
|
+
echo "=================================================="
|
|
174
|
+
|
|
175
|
+
echo "๐ Current outdated packages:"
|
|
176
|
+
npm outdated || true
|
|
177
|
+
|
|
178
|
+
OUTDATED=$(npm outdated --json 2>/dev/null || echo "{}")
|
|
179
|
+
|
|
180
|
+
if [ "$OUTDATED" != "{}" ] && [ -n "$OUTDATED" ]; then
|
|
181
|
+
echo "๐ฆ Found outdated dependencies!"
|
|
182
|
+
|
|
183
|
+
if [ "${{ github.event.inputs.dry_run }}" != "true" ]; then
|
|
184
|
+
npm update
|
|
185
|
+
|
|
186
|
+
# Update key dependencies
|
|
187
|
+
npm install ghost-cursor@latest --save 2>/dev/null || true
|
|
188
|
+
npm install puppeteer-extra@latest puppeteer-extra-plugin-stealth@latest --save 2>/dev/null || true
|
|
189
|
+
|
|
190
|
+
echo "updated=true" >> $GITHUB_OUTPUT
|
|
191
|
+
echo "โ
Updated root dependencies"
|
|
192
|
+
else
|
|
193
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
194
|
+
fi
|
|
195
|
+
else
|
|
196
|
+
echo "โ
All dependencies are up to date"
|
|
197
|
+
echo "updated=false" >> $GITHUB_OUTPUT
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
# ==================== SUMMARY ====================
|
|
201
|
+
- name: "\U0001F4CB Check if any updates"
|
|
202
|
+
id: summary
|
|
203
|
+
run: |
|
|
204
|
+
if [ "${{ steps.update-blocker.outputs.updated }}" = "true" ] || \
|
|
205
|
+
[ "${{ steps.update-launcher.outputs.updated }}" = "true" ] || \
|
|
206
|
+
[ "${{ steps.update-puppeteer.outputs.updated }}" = "true" ] || \
|
|
207
|
+
[ "${{ steps.update-root.outputs.updated }}" = "true" ] || \
|
|
208
|
+
[ "${{ github.event.inputs.force_update }}" = "true" ]; then
|
|
209
|
+
echo "any_updated=true" >> $GITHUB_OUTPUT
|
|
210
|
+
echo "๐ฆ Dependencies were updated!"
|
|
211
|
+
else
|
|
212
|
+
echo "any_updated=false" >> $GITHUB_OUTPUT
|
|
213
|
+
echo "โ
No updates needed"
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
# ==================== SYNC INTERNAL VERSIONS ====================
|
|
217
|
+
- name: "\U0001F504 Sync internal dependency versions"
|
|
218
|
+
if: steps.summary.outputs.any_updated == 'true'
|
|
219
|
+
run: |
|
|
220
|
+
echo "๐ Syncing internal dependency versions..."
|
|
221
|
+
node scripts/prepare-publish.js
|
|
222
|
+
|
|
223
|
+
# ==================== BUILD TEST ====================
|
|
224
|
+
- name: "\U0001F528 Build all packages"
|
|
225
|
+
if: steps.summary.outputs.any_updated == 'true'
|
|
226
|
+
run: |
|
|
227
|
+
echo "๐จ Building all packages..."
|
|
228
|
+
|
|
229
|
+
cd packages/brave-real-blocker && npm run build 2>/dev/null || true && cd ../..
|
|
230
|
+
cd packages/brave-real-launcher && npm run build 2>/dev/null || true && cd ../..
|
|
231
|
+
cd packages/brave-real-puppeteer-core && npm run build 2>/dev/null || true && cd ../..
|
|
232
|
+
npm run build || true
|
|
233
|
+
|
|
234
|
+
echo "โ
Build completed"
|
|
235
|
+
|
|
236
|
+
# ==================== COMMIT & PUSH ====================
|
|
237
|
+
- name: "\U0001F4DD Commit dependency updates"
|
|
238
|
+
if: steps.summary.outputs.any_updated == 'true'
|
|
239
|
+
run: |
|
|
240
|
+
# Check for changes
|
|
241
|
+
if git diff --quiet && git diff --staged --quiet; then
|
|
242
|
+
echo "No changes to commit"
|
|
243
|
+
exit 0
|
|
244
|
+
fi
|
|
245
|
+
|
|
246
|
+
# Create detailed commit message
|
|
247
|
+
COMMIT_MSG="chore(deps): \U0001F504 Auto-update dependencies\n\n"
|
|
248
|
+
|
|
249
|
+
if [ "${{ steps.update-blocker.outputs.updated }}" = "true" ]; then
|
|
250
|
+
COMMIT_MSG="${COMMIT_MSG}- Updated brave-real-blocker dependencies\n"
|
|
251
|
+
fi
|
|
252
|
+
if [ "${{ steps.update-launcher.outputs.updated }}" = "true" ]; then
|
|
253
|
+
COMMIT_MSG="${COMMIT_MSG}- Updated brave-real-launcher dependencies\n"
|
|
254
|
+
fi
|
|
255
|
+
if [ "${{ steps.update-puppeteer.outputs.updated }}" = "true" ]; then
|
|
256
|
+
COMMIT_MSG="${COMMIT_MSG}- Updated brave-real-puppeteer-core dependencies\n"
|
|
257
|
+
fi
|
|
258
|
+
if [ "${{ steps.update-root.outputs.updated }}" = "true" ]; then
|
|
259
|
+
COMMIT_MSG="${COMMIT_MSG}- Updated root package dependencies\n"
|
|
260
|
+
fi
|
|
261
|
+
|
|
262
|
+
git add .
|
|
263
|
+
echo -e "$COMMIT_MSG" | git commit -F -
|
|
264
|
+
git push origin main
|
|
265
|
+
|
|
266
|
+
echo "โ
Changes committed and pushed"
|
|
267
|
+
|
|
268
|
+
# ==================== TRIGGER PUBLISH ====================
|
|
269
|
+
trigger-publish:
|
|
270
|
+
name: "\U0001F680 Trigger NPM Publish"
|
|
271
|
+
runs-on: ubuntu-latest
|
|
272
|
+
needs: update-dependencies
|
|
273
|
+
if: needs.update-dependencies.outputs.any_updated == 'true' && github.event.inputs.dry_run != 'true'
|
|
274
|
+
|
|
275
|
+
steps:
|
|
276
|
+
- name: "\U0001F680 Trigger Monorepo Publish"
|
|
277
|
+
uses: actions/github-script@v7
|
|
278
|
+
with:
|
|
279
|
+
github-token: ${{ secrets.GH_TOKEN || github.token }}
|
|
280
|
+
script: |
|
|
281
|
+
console.log("๐ Triggering Monorepo Publish Workflow...");
|
|
282
|
+
|
|
283
|
+
try {
|
|
284
|
+
await github.rest.actions.createWorkflowDispatch({
|
|
285
|
+
owner: context.repo.owner,
|
|
286
|
+
repo: context.repo.repo,
|
|
287
|
+
workflow_id: 'monorepo-publish.yml',
|
|
288
|
+
ref: 'main',
|
|
289
|
+
inputs: {
|
|
290
|
+
force_publish: 'true',
|
|
291
|
+
increment_type: 'patch'
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
console.log("โ
Successfully triggered publish workflow!");
|
|
295
|
+
} catch (error) {
|
|
296
|
+
console.log("โ ๏ธ Could not trigger workflow:", error.message);
|
|
297
|
+
console.log("Manual trigger may be needed.");
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
# ==================== SUMMARY ====================
|
|
301
|
+
summary:
|
|
302
|
+
name: "\U0001F4CB Update Summary"
|
|
303
|
+
runs-on: ubuntu-latest
|
|
304
|
+
needs: [update-dependencies, trigger-publish]
|
|
305
|
+
if: always()
|
|
306
|
+
|
|
307
|
+
steps:
|
|
308
|
+
- name: "\U0001F4CB Generate Summary"
|
|
309
|
+
run: |
|
|
310
|
+
echo "## \U0001F504 Dependency Auto-Update Summary" >> $GITHUB_STEP_SUMMARY
|
|
311
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
312
|
+
echo "### \U0001F4E6 Package Updates" >> $GITHUB_STEP_SUMMARY
|
|
313
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
314
|
+
echo "| Package | Updated |" >> $GITHUB_STEP_SUMMARY
|
|
315
|
+
echo "|---------|---------|" >> $GITHUB_STEP_SUMMARY
|
|
316
|
+
echo "| brave-real-blocker | ${{ needs.update-dependencies.outputs.blocker_updated }} |" >> $GITHUB_STEP_SUMMARY
|
|
317
|
+
echo "| brave-real-launcher | ${{ needs.update-dependencies.outputs.launcher_updated }} |" >> $GITHUB_STEP_SUMMARY
|
|
318
|
+
echo "| brave-real-puppeteer-core | ${{ needs.update-dependencies.outputs.puppeteer_updated }} |" >> $GITHUB_STEP_SUMMARY
|
|
319
|
+
echo "| brave-real-browser-mcp-server | ${{ needs.update-dependencies.outputs.root_updated }} |" >> $GITHUB_STEP_SUMMARY
|
|
320
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
321
|
+
echo "### \U0001F680 Publish Status" >> $GITHUB_STEP_SUMMARY
|
|
322
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
323
|
+
if [ "${{ needs.update-dependencies.outputs.any_updated }}" = "true" ]; then
|
|
324
|
+
echo "โ
Dependencies updated and publish triggered" >> $GITHUB_STEP_SUMMARY
|
|
325
|
+
else
|
|
326
|
+
echo "โ
All dependencies are up to date - no publish needed" >> $GITHUB_STEP_SUMMARY
|
|
327
|
+
fi
|
|
328
|
+
echo "" >> $GITHUB_STEP_SUMMARY
|
|
329
|
+
echo "---" >> $GITHUB_STEP_SUMMARY
|
|
330
|
+
echo "*Auto-generated by GitHub Actions*" >> $GITHUB_STEP_SUMMARY
|