browser-use fix

Fix of browser-use and playwright versions

frdel committed Feb 19, 2025 at 22:10 UTC 3e187e8e314ff661b489ee07648fcd2c9d6062e3
11 files changed +12 -164
.gitignore
+2 -1
@@ -45,4 +45,5 @@ instruments/**
45 !instruments/default/**
46
47 # Global rule to include .gitkeep files anywhere
48 -!**/.gitkeep
\ No newline at end of file
48 +!**/.gitkeep
49 +agent_history.gif
docker/exe/Dockerfile deleted
-53
@@ -1,53 +0,0 @@
1 -# Use the latest slim version of Debian
2 -FROM --platform=$TARGETPLATFORM debian:bookworm-slim
3 -
4 -# Set ARG for platform-specific commands
5 -ARG TARGETPLATFORM
6 -
7 -# Update and install necessary packages
8 -RUN apt-get update && apt-get install -y \
9 - python3 \
10 - python3-pip \
11 - python3-venv \
12 - nodejs \
13 - npm \
14 - openssh-server \
15 - sudo \
16 - curl \
17 - wget \
18 - git
19 -
20 -# Cleanup package list
21 -RUN rm -rf /var/lib/apt/lists/*
22 -
23 -# Set up SSH
24 -RUN mkdir /var/run/sshd && \
25 - echo 'root:toor' | chpasswd && \
26 - sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
27 -
28 -# Create and activate Python virtual environment
29 -ENV VIRTUAL_ENV=/opt/venv
30 -RUN python3 -m venv $VIRTUAL_ENV
31 -
32 -# Copy the script to ensure .bashrc is in the root directory
33 -COPY initialize.sh /usr/local/bin/initialize.sh
34 -RUN chmod +x /usr/local/bin/initialize.sh
35 -
36 -# Copy contents of filesystem directory to /fs
37 -COPY ./fs/ /fs
38 -
39 -# Ensure the virtual environment and pip setup
40 -RUN $VIRTUAL_ENV/bin/pip install --upgrade pip
41 -
42 -# Install additional python packages
43 -RUN $VIRTUAL_ENV/bin/pip install \
44 - ipython \
45 - requests
46 -
47 -# Expose SSH port
48 -EXPOSE 22
49 -
50 -# Init .bashrc
51 -CMD ["/usr/local/bin/initialize.sh"]
52 -
53 -
docker/exe/build.txt deleted
-2
@@ -1,2 +0,0 @@
1 -docker login
2 -docker buildx build --platform linux/amd64,linux/arm64 -t frdel/agent-zero-exe:latest --push .
\ No newline at end of file
docker/exe/fs/exe/node_eval.js deleted
-66
@@ -1,66 +0,0 @@
1 -#!/usr/bin/env node
2 -
3 -const vm = require('vm');
4 -const path = require('path');
5 -const Module = require('module');
6 -
7 - // Enhance `require` to search CWD and parent directories first, then globally
8 -function customRequire(moduleName) {
9 - let currentDir = process.cwd();
10 - const root = path.parse(currentDir).root;
11 -
12 - do {
13 - try {
14 - const modulePath = path.join(currentDir, 'node_modules', moduleName);
15 - return require(modulePath);
16 - } catch (err) {
17 - currentDir = path.dirname(currentDir);
18 - }
19 - } while (currentDir !== root);
20 -
21 - try {
22 - return require(moduleName);
23 - } catch (globalErr) {
24 - console.error(`Cannot find module: ${moduleName}`);
25 - throw globalErr;
26 - }
27 -}
28 -
29 -// Create the VM context
30 -const context = vm.createContext({
31 - ...global,
32 - require: customRequire, // Use the custom require
33 - __filename: path.join(process.cwd(), 'eval.js'),
34 - __dirname: process.cwd(),
35 - module: { exports: {} },
36 - exports: module.exports,
37 - console: console,
38 - process: process,
39 - Buffer: Buffer,
40 - setTimeout: setTimeout,
41 - setInterval: setInterval,
42 - setImmediate: setImmediate,
43 - clearTimeout: clearTimeout,
44 - clearInterval: clearInterval,
45 - clearImmediate: clearImmediate,
46 -});
47 -
48 -// Retrieve the code from the command-line argument
49 -const code = process.argv[2];
50 -
51 -const wrappedCode = `
52 - (async function() {
53 - try {
54 - const __result__ = await eval(${JSON.stringify(code)});
55 - if (__result__ !== undefined) console.log('Out[1]:', __result__);
56 - } catch (error) {
57 - console.error(error);
58 - }
59 - })();
60 -`;
61 -
62 -vm.runInContext(wrappedCode, context, {
63 - filename: 'eval.js',
64 - lineOffset: -2,
65 - columnOffset: 0,
66 -}).catch(console.error);
docker/exe/fs/root/.bashrc deleted
-9
@@ -1,9 +0,0 @@
1 -# .bashrc
2 -
3 -# Source global definitions
4 -if [ -f /etc/bashrc ]; then
5 - . /etc/bashrc
6 -fi
7 -
8 -# Activate the virtual environment
9 -source /opt/venv/bin/activate
docker/exe/fs/root/.profile deleted
-9
@@ -1,9 +0,0 @@
1 -# .bashrc
2 -
3 -# Source global definitions
4 -if [ -f /etc/bashrc ]; then
5 - . /etc/bashrc
6 -fi
7 -
8 -# Activate the virtual environment
9 -source /opt/venv/bin/activate
docker/exe/initialize.sh deleted
-14
@@ -1,14 +0,0 @@
1 -#!/bin/bash
2 -
3 -# Copy all contents from /fs to root directory (/) with overwriting
4 -cp -r /fs/* / --no-preserve=ownership,mode
5 -
6 -# allow execution of /root/.bashrc and /root/.profile
7 -chmod 444 /root/.bashrc
8 -chmod 444 /root/.profile
9 -
10 -# update package list to save time later
11 -apt-get update
12 -
13 -# Start SSH service
14 -exec /usr/sbin/sshd -D
\ No newline at end of file
docker/run/fs/ins/install_additional.sh
+1 -4
@@ -1,7 +1,4 @@
1 #!/bin/bash
2
3 # searxng
4 -bash /ins/install_searxng.sh "$@"
5 -
6 -# playwright
7 -bash /ins/install_playwright.sh "$@"
\ No newline at end of file
4 +bash /ins/install_searxng.sh "$@"
\ No newline at end of file
docker/run/fs/ins/install_playwright.sh
+2 -2
@@ -3,8 +3,8 @@
3 # activate venv
4 . "/ins/setup_venv.sh" "$@"
5
6 -# install playwright
6 +# install playwright if not installed
7 pip install playwright
8
9 # install chromium with dependencies
10 -playwright install --with-deps chromium
10 +playwright install --with-deps chromium-headless-shell
docker/run/fs/ins/post_install.sh
+3
@@ -1,5 +1,8 @@
1 #!/bin/bash
2
3 +# install playwright
4 +bash /ins/install_playwright.sh "$@"
5 +
6 # Cleanup package list
7 rm -rf /var/lib/apt/lists/*
8 apt-get clean
\ No newline at end of file
requirements.txt
+4 -4
@@ -1,6 +1,6 @@
1 ansio==0.0.1
2 beautifulsoup4==4.12.3
3 -browser-use==0.1.17
3 +browser-use==0.1.37
4 docker==7.1.0
5 duckduckgo-search==6.1.12
6 faiss-cpu==1.8.0.post1
@@ -8,14 +8,14 @@ flask[async]==3.0.3
8 flask-basicauth==0.2.0
9 GitPython==3.1.43
10 inputimeout==1.0.4
11 -langchain-anthropic==0.3.1
11 +langchain-anthropic==0.3.3
12 langchain-community==0.3.13
13 -langchain-google-genai==2.0.7
13 +langchain-google-genai==2.0.8
14 langchain-groq==0.2.2
15 langchain-huggingface==0.1.2
16 langchain-mistralai==0.2.4
17 langchain-ollama==0.2.2
18 -langchain-openai==0.3.4
18 +langchain-openai==0.3.1
19 openai-whisper==20240930
20 lxml_html_clean==0.3.1
21 markdown==3.7