From 82810f53a1a79c427e90db5662d2300eb70ce6bf Mon Sep 17 00:00:00 2001 From: Dillon DuPont Date: Wed, 7 May 2025 11:14:44 -0400 Subject: [PATCH 1/2] replaced remaining `os=` occurances with `os_type=` --- README.md | 2 +- libs/computer/README.md | 2 +- libs/computer/computer/ui/gradio/app.py | 2 +- notebooks/blog/build-your-own-operator-on-macos-1.ipynb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8eb12022..640902dc 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ If you want to use AI agents with virtualized environments: from computer import Computer from agent import ComputerAgent, LLM, AgentLoop, LLMProvider - async with Computer(verbosity=logging.DEBUG) as macos_computer: + async with Computer(os_type="macos", display="1024x768") as macos_computer: agent = ComputerAgent( computer=macos_computer, loop=AgentLoop.OPENAI, # or AgentLoop.ANTHROPIC, or AgentLoop.UITARS, or AgentLoop.OMNI diff --git a/libs/computer/README.md b/libs/computer/README.md index 7690ff4a..c817c8cd 100644 --- a/libs/computer/README.md +++ b/libs/computer/README.md @@ -26,7 +26,7 @@ ```python from computer import Computer -computer = Computer(os="macos", display="1024x768", memory="8GB", cpu="4") +computer = Computer(os_type="macos", display="1024x768", memory="8GB", cpu="4") try: await computer.run() diff --git a/libs/computer/computer/ui/gradio/app.py b/libs/computer/computer/ui/gradio/app.py index 47a73ccd..e68ea26a 100644 --- a/libs/computer/computer/ui/gradio/app.py +++ b/libs/computer/computer/ui/gradio/app.py @@ -532,7 +532,7 @@ async def handle_init_computer(): """Initialize the computer instance and tools""" global computer, tool_call_logs, tools - computer = Computer(os="macos", display="1024x768", memory="8GB", cpu="4") + computer = Computer(os_type="macos", display="1024x768", memory="8GB", cpu="4") await computer.run() # Log computer initialization as a tool call diff --git a/notebooks/blog/build-your-own-operator-on-macos-1.ipynb b/notebooks/blog/build-your-own-operator-on-macos-1.ipynb index 70c0e6ea..e39ce336 100644 --- a/notebooks/blog/build-your-own-operator-on-macos-1.ipynb +++ b/notebooks/blog/build-your-own-operator-on-macos-1.ipynb @@ -187,7 +187,7 @@ " display=\"1024x768\",\n", " memory=\"4GB\",\n", " cpu=\"2\",\n", - " os=\"macos\"\n", + " os_type=\"macos\"\n", " ) as computer:\n", " await computer.run()\n", " \n", From bbd07cedd0f480f48d13ea1f129a956131431c00 Mon Sep 17 00:00:00 2001 From: f-trycua Date: Wed, 7 May 2025 12:09:34 -0700 Subject: [PATCH 2/2] Prevent install if sudo --- libs/lume/scripts/install.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/lume/scripts/install.sh b/libs/lume/scripts/install.sh index 171076e7..11629f49 100755 --- a/libs/lume/scripts/install.sh +++ b/libs/lume/scripts/install.sh @@ -12,6 +12,16 @@ GREEN=$(tput setaf 2) BLUE=$(tput setaf 4) YELLOW=$(tput setaf 3) +# Check if running as root or with sudo +if [ "$(id -u)" -eq 0 ] || [ -n "$SUDO_USER" ]; then + echo "${RED}Error: Do not run this script with sudo or as root.${NORMAL}" + echo "If you need to install to a system directory, create it first with proper permissions:" + echo " sudo mkdir -p /desired/directory && sudo chown $(whoami) /desired/directory" + echo "Then run the installer normally:" + echo " ./install.sh --install-dir=/desired/directory" + exit 1 +fi + # Default installation directory (user-specific, doesn't require sudo) DEFAULT_INSTALL_DIR="$HOME/.local/bin" INSTALL_DIR="${INSTALL_DIR:-$DEFAULT_INSTALL_DIR}"