forked from browser-use/desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
481 lines (435 loc) · 17.2 KB
/
Copy pathTaskfile.yml
File metadata and controls
481 lines (435 loc) · 17.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
version: "3"
vars:
APP_DIR: app
tasks:
default:
desc: List all available tasks
cmds:
- task --list
silent: true
up:
desc: Install deps and start the app
dir: "{{.APP_DIR}}"
cmds:
- yarn install
- test -d node_modules/electron/dist/Electron.app || test -d node_modules/electron/dist/BrowserUse.app || node node_modules/electron/install.js
- bash scripts/patch-electron-plist.sh
- npm start
up:clean:
desc: Wipe Vite cache then start the app (use if HMR is acting up)
dir: "{{.APP_DIR}}"
cmds:
- yarn install
- test -d node_modules/electron/dist/Electron.app || test -d node_modules/electron/dist/BrowserUse.app || node node_modules/electron/install.js
- bash scripts/patch-electron-plist.sh
- npm run start:clean
reset:onboarding:
desc: Delete onboarding state, sessions, imported cookies, and WhatsApp auth
dir: "{{.APP_DIR}}"
cmds:
- npm run start:reset-onboarding
reset:sessions:
desc: Delete sessions.db so the next launch shows no sessions
dir: "{{.APP_DIR}}"
cmds:
- npm run start:reset-sessions
agent:run:
desc: Submit a task to a running local app, e.g. task agent:run PROMPT='open example.com' ENGINE=codex
silent: true
cmds:
- |
PROMPT="{{default "" .PROMPT}}"
ENGINE="{{default "" .ENGINE}}"
JSON="{{default "" .JSON}}"
if [ -z "$PROMPT" ]; then
echo "Set PROMPT, e.g. task agent:run PROMPT='open example.com and report the title' ENGINE=codex"
exit 1
fi
if [ -n "$ENGINE" ] && [ "$JSON" = "1" ]; then
node app/scripts/run-task.mjs --json --engine "$ENGINE" "$PROMPT"
elif [ -n "$ENGINE" ]; then
node app/scripts/run-task.mjs --engine "$ENGINE" "$PROMPT"
elif [ "$JSON" = "1" ]; then
node app/scripts/run-task.mjs --json "$PROMPT"
else
node app/scripts/run-task.mjs "$PROMPT"
fi
lint:
desc: Run eslint
dir: "{{.APP_DIR}}"
cmds:
- npm run lint
typecheck:
desc: tsc --noEmit
dir: "{{.APP_DIR}}"
cmds:
- npm run typecheck
logs:all:
desc: Tail all local app logs with colored human-readable formatting
silent: true
cmds:
- |
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
if ! ls "$LOG_DIR"/*.log >/dev/null 2>&1; then
echo "No logs found in $LOG_DIR"
exit 1
fi
tail -n "${LINES:-200}" -F "$LOG_DIR"/*.log | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=all
logs:service:
desc: Tail one local app log channel with colored formatting, e.g. task logs:service SERVICE=browser
silent: true
cmds:
- |
SERVICE="{{default "" .SERVICE}}"
SESSION_ID="{{default "" .SESSION_ID}}"
LEVEL="{{default "" .LEVEL}}"
if [ -z "$SERVICE" ]; then
echo "Set SERVICE, e.g. task logs:service SERVICE=browser"
exit 1
fi
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
FILE="$LOG_DIR/$SERVICE.log"
if [ "$SERVICE" = "app" ] && [ ! -f "$FILE" ] && [ -f "$LOG_DIR/main.log" ]; then
FILE="$LOG_DIR/main.log"
fi
if [ "$SERVICE" = "main" ] && [ ! -f "$FILE" ] && [ -f "$LOG_DIR/app.log" ]; then
FILE="$LOG_DIR/app.log"
fi
if [ ! -f "$FILE" ]; then
echo "No log file found: $FILE"
exit 1
fi
set --
if [ -n "$SESSION_ID" ]; then set -- "$@" --session="$SESSION_ID"; fi
if [ -n "$LEVEL" ]; then set -- "$@" --level="$LEVEL"; fi
tail -n "${LINES:-200}" -F "$FILE" | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=all "$@"
logs:app:
desc: Tail desktop app lifecycle logs
silent: true
cmds:
- task: logs:service
vars: { SERVICE: app }
logs:main:
desc: Tail desktop app lifecycle logs (legacy alias for logs:app)
silent: true
cmds:
- task: logs:app
logs:browser:
desc: Tail browser/WebContents logs
silent: true
cmds:
- task: logs:service
vars: { SERVICE: browser }
logs:renderer:
desc: Tail verbose frontend renderer console logs
silent: true
cmds:
- task: logs:service
vars: { SERVICE: renderer }
logs:engine:
desc: Tail engine subprocess lifecycle logs
silent: true
cmds:
- task: logs:service
vars:
SERVICE: engine
SESSION_ID: "{{default \"\" .SESSION_ID}}"
logs:agent:
desc: Tail agent transcript events, e.g. task logs:agent SESSION_ID=abc123
silent: true
cmds:
- |
SESSION_ID="{{default "" .SESSION_ID}}"
FOLLOW="{{default "1" .FOLLOW}}"
JSON="{{default "" .JSON}}"
LINES_ARG="{{default "" .LINES}}"
set --
if [ -n "$SESSION_ID" ]; then set -- "$@" --session "$SESSION_ID"; fi
if [ "$FOLLOW" = "0" ]; then set -- "$@" --no-follow; fi
if [ -n "$LINES_ARG" ]; then
set -- "$@" --lines "$LINES_ARG"
elif [ -n "$LINES" ]; then
set -- "$@" --lines "$LINES"
fi
if [ "$JSON" = "1" ]; then set -- "$@" --json; fi
node app/scripts/agent-logs.mjs "$@"
logs:errors:
desc: Tail warnings and errors across all log files
silent: true
cmds:
- |
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
if ! ls "$LOG_DIR"/*.log >/dev/null 2>&1; then
echo "No logs found in $LOG_DIR"
exit 1
fi
tail -n "${LINES:-200}" -F "$LOG_DIR"/*.log | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=all --level=warn
logs:startup:
desc: Tail browser startup timing logs with colored human-readable timing
silent: true
cmds:
- |
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
FILE="$LOG_DIR/browser.log"
if [ ! -f "$FILE" ]; then
echo "No log file found: $FILE"
exit 1
fi
tail -n "${LINES:-200}" -F "$FILE" | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=startup
logs:navigation:
desc: Tail browser URL navigation timing logs with colored human-readable timing
silent: true
cmds:
- |
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
FILE="$LOG_DIR/browser.log"
if [ ! -f "$FILE" ]; then
echo "No log file found: $FILE"
exit 1
fi
tail -n "${LINES:-200}" -F "$FILE" | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=navigation
logs:session:
desc: Tail app/browser/engine log lines for one session, e.g. task logs:session SESSION_ID=abc123
silent: true
cmds:
- |
SESSION_ID="{{default "" .SESSION_ID}}"
if [ -z "$SESSION_ID" ]; then
echo "Set SESSION_ID, e.g. task logs:session SESSION_ID=abc123"
exit 1
fi
LOG_DIR="${AGB_LOG_DIR:-$HOME/Library/Application Support/Browser Use/logs}"
if ! ls "$LOG_DIR"/*.log >/dev/null 2>&1; then
echo "No logs found in $LOG_DIR"
exit 1
fi
tail -n "${LINES:-200}" -F "$LOG_DIR"/*.log | LOG_COLOR="${LOG_COLOR:-1}" node app/scripts/pretty-logs.mjs --mode=all --session="$SESSION_ID"
package:
desc: Build an unpackaged app (electron-forge package)
dir: "{{.APP_DIR}}"
cmds:
- npm run package
make:
desc: Build platform installers (electron-forge make)
dir: "{{.APP_DIR}}"
cmds:
- npm run make
linux:make:docker:
desc: Build Linux .deb, .rpm, and AppImage packages inside Docker
cmds:
- bash scripts/build-linux-docker.sh
linux:verify-artifacts:
desc: Verify Linux .deb, .rpm, AppImage, and update feed artifacts exist under app/out/make
cmds:
- node scripts/verify-linux-artifacts.mjs
release:dev:
desc: Unsigned ad-hoc build for local testing (fast, no Apple credentials)
dir: "{{.APP_DIR}}"
cmds:
- SKIP_SIGNING=1 npm run make
release:signed:
desc: Signed but NOT notarized — runs on your Mac with right-click bypass, not for public distribution
dir: "{{.APP_DIR}}"
cmds:
- |
if [ ! -f .env.signing ]; then
echo "Missing .env.signing — see notary:setup"
exit 1
fi
set -a; . ./.env.signing; set +a
unset APPLE_ID APPLE_APP_SPECIFIC_PASSWORD APPLE_TEAM_ID
npm run make
release:full:
desc: Signed + notarized DMG for public distribution (slow — Apple notarization adds 5-30+ min)
dir: "{{.APP_DIR}}"
cmds:
- |
if [ ! -f .env.signing ]; then
echo "Missing .env.signing — see notary:setup"
exit 1
fi
set -a; . ./.env.signing; set +a
npm run make
release:publish:
desc: Cut a full GitHub release for all platforms. Auto-bumps patch from latest tag, or pass VERSION=X.Y.Z. Pushes a tag to trigger release.yml.
silent: true
cmds:
- |
set -euo pipefail
if ! git diff --quiet || ! git diff --cached --quiet; then
echo "✗ Working tree dirty — commit or stash first."
exit 1
fi
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" != "main" ]; then
echo "✗ Not on main (currently on $branch)."
exit 1
fi
git fetch origin main --tags --quiet
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/main)" ]; then
echo "✗ Local main is out of sync with origin/main — push or pull first."
exit 1
fi
VERSION="{{default "" .VERSION}}"
if [ -z "$VERSION" ]; then
latest=$(git tag --list 'v*.*.*' --sort=-version:refname | head -1)
if [ -z "$latest" ]; then
VERSION="0.0.1"
else
IFS=. read -r major minor patch <<< "${latest#v}"
VERSION="${major}.${minor}.$((patch + 1))"
fi
echo "→ auto-bumped from ${latest:-<none>} to v$VERSION"
fi
if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
echo "✗ Invalid VERSION '$VERSION' (expected X.Y.Z)"
exit 1
fi
tag="v$VERSION"
if git rev-parse "refs/tags/$tag" >/dev/null 2>&1; then
echo "✗ Tag $tag already exists."
exit 1
fi
package_version=$(node -p "require('./app/package.json').version")
if [ "$package_version" != "$VERSION" ]; then
echo "→ bumping app/package.json from $package_version to $VERSION"
node -e "const fs=require('fs'); const p='app/package.json'; const pkg=JSON.parse(fs.readFileSync(p,'utf8')); pkg.version=process.argv[1]; fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');" "$VERSION"
git add app/package.json
git commit -m "Prepare release $tag" -m "Align the packaged Electron app version with the release tag so auto-update metadata advertises the same version that the app reports at runtime." -m "Constraint: electron-updater compares the published manifest version against app.getVersion()" -m "Confidence: high" -m "Scope-risk: narrow" -m "Tested: release.yml validates tag/package version before publishing" -m "Not-tested: signed CI build before tag push"
git push origin HEAD:main
else
echo "→ package version already at $VERSION"
fi
echo "→ tagging $tag → release.yml will build and publish all platform assets"
git tag -a "$tag" -m "Release $tag"
git push origin "$tag"
echo
echo "✓ pushed. Watch the run:"
sleep 3
run_id=$(gh run list --repo "$(gh repo view --json nameWithOwner --jq .nameWithOwner)" --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId' 2>/dev/null || echo "")
if [ -n "$run_id" ]; then
echo " gh run watch $run_id"
echo " https://github.com/$(gh repo view --json nameWithOwner --jq .nameWithOwner)/actions/runs/$run_id"
fi
echo "Once green:"
echo " https://github.com/$(gh repo view --json nameWithOwner --jq .nameWithOwner)/releases/tag/$tag"
release:preview:
desc: Throwaway preview build from the CURRENT branch — defaults to windows/unsigned for tester handoff. Override with PLATFORM=mac|linux|all SIGNING_MODE=signed|notarized.
silent: true
cmds:
- |
set -euo pipefail
platform="{{default "windows" .PLATFORM}}"
signing_mode="{{default "unsigned" .SIGNING_MODE}}"
case "$platform" in
all|mac|windows|linux) ;;
*)
echo "✗ Invalid PLATFORM '$platform' (expected all, mac, windows, or linux)"
exit 1
;;
esac
case "$signing_mode" in
unsigned|signed|notarized) ;;
*)
echo "✗ Invalid SIGNING_MODE '$signing_mode' (expected unsigned, signed, or notarized)"
exit 1
;;
esac
branch=$(git rev-parse --abbrev-ref HEAD)
if [ "$branch" = "HEAD" ]; then
echo "✗ Detached HEAD — checkout a branch first."
exit 1
fi
echo "→ dispatching release.yml: ref=$branch platform=$platform signing-mode=$signing_mode (auto tag v0.0.0-dev-<timestamp>)"
gh workflow run release.yml --ref "$branch" -f platform="$platform" -f signing-mode="$signing_mode"
sleep 3
run_id=$(gh run list --repo "$(gh repo view --json nameWithOwner --jq .nameWithOwner)" --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId' 2>/dev/null || echo "")
if [ -n "$run_id" ]; then
echo " gh run watch $run_id"
echo " https://github.com/$(gh repo view --json nameWithOwner --jq .nameWithOwner)/actions/runs/$run_id"
fi
release:dispatch:
desc: Manually run release.yml on MAIN for PLATFORM=all|mac|windows|linux. For previews from a feature branch use release:preview instead. Optional TAG=... SIGNING_MODE=unsigned|signed|notarized.
silent: true
cmds:
- |
set -euo pipefail
platform="{{default "all" .PLATFORM}}"
signing_mode="{{default "signed" .SIGNING_MODE}}"
tag="{{default "" .TAG}}"
case "$platform" in
all|mac|windows|linux) ;;
*)
echo "✗ Invalid PLATFORM '$platform' (expected all, mac, windows, or linux)"
exit 1
;;
esac
case "$signing_mode" in
unsigned|signed|notarized) ;;
*)
echo "✗ Invalid SIGNING_MODE '$signing_mode' (expected unsigned, signed, or notarized)"
exit 1
;;
esac
if [ -n "$tag" ]; then
gh workflow run release.yml --ref main -f platform="$platform" -f signing-mode="$signing_mode" -f tag="$tag"
else
gh workflow run release.yml --ref main -f platform="$platform" -f signing-mode="$signing_mode"
fi
echo "✓ queued release.yml for platform=$platform signing-mode=$signing_mode"
sleep 3
run_id=$(gh run list --repo "$(gh repo view --json nameWithOwner --jq .nameWithOwner)" --workflow=release.yml --limit 1 --json databaseId --jq '.[0].databaseId' 2>/dev/null || echo "")
if [ -n "$run_id" ]; then
echo " gh run watch $run_id"
echo " https://github.com/$(gh repo view --json nameWithOwner --jq .nameWithOwner)/actions/runs/$run_id"
fi
notary:setup:
desc: One-time — store Apple notary credentials in macOS keychain so notary:* tasks work without env vars
dir: "{{.APP_DIR}}"
cmds:
- |
if [ ! -f .env.signing ]; then
echo "Create app/.env.signing with APPLE_ID, APPLE_APP_SPECIFIC_PASSWORD, APPLE_TEAM_ID first"
exit 1
fi
set -a; . ./.env.signing; set +a
xcrun notarytool store-credentials "browseruse-notary" --apple-id "$APPLE_ID" --password "$APPLE_APP_SPECIFIC_PASSWORD" --team-id "$APPLE_TEAM_ID"
notary:status:
desc: List recent Apple notarization submissions and their status
silent: true
cmds:
- xcrun notarytool history --keychain-profile "browseruse-notary"
notary:log:
desc: Show detailed Apple log for a submission, e.g. task notary:log ID=abc123-...
silent: true
cmds:
- |
ID="{{default "" .ID}}"
if [ -z "$ID" ]; then
echo "Set ID, e.g. task notary:log ID=abc123-..."
exit 1
fi
xcrun notarytool log "$ID" --keychain-profile "browseruse-notary"
notary:wait:
desc: Block until a notarization submission finishes, e.g. task notary:wait ID=abc123-...
silent: true
cmds:
- |
ID="{{default "" .ID}}"
if [ -z "$ID" ]; then
echo "Set ID, e.g. task notary:wait ID=abc123-..."
exit 1
fi
xcrun notarytool wait "$ID" --keychain-profile "browseruse-notary"
notary:staple:
desc: Manually attach a notarization ticket to a .app or .dmg, e.g. task notary:staple PATH=out/make/.../Browser-Use.dmg
silent: true
cmds:
- |
TARGET="{{default "" .PATH}}"
if [ -z "$TARGET" ]; then
echo "Set PATH, e.g. task notary:staple PATH=app/out/make/.../Browser-Use.dmg"
exit 1
fi
xcrun stapler staple "$TARGET"
xcrun stapler validate "$TARGET"