| commit | 33d282f80db786cc60ba521a38ed5166f23239ed | [log] [tgz] |
|---|---|---|
| author | Philip Zeyliger <philip@bold.dev> | Sat May 03 04:01:54 2025 +0000 |
| committer | Philip Zeyliger <philip@bold.dev> | Tue May 06 10:23:39 2025 -0700 |
| tree | 9ed1f15c6d3081d5bef7d16b9d72e78a2c7780cf | |
| parent | a9d87aa69cfefdc91ec7aaa6bc42907749748e76 [diff] |
Add browse tool support.
I reviewed some MCPs (using OpenAI's deep research to help), and it
helped me choose chromedp as the relevant library and helped me come up
with an interface. This commit adds chrome to the Docker image which is
kind of big. (I've noticed that it's smaller on Ubuntu, where it doesn't
pull in X11.) go-playwright was a library contender as well.
Implement browser automation tooling using chromedp
This implementation adds browser automation capabilities to the system via the chromedp library,
enabling Claude to interact with web content effectively.
Key features include:
1. Core browser automation functionality:
- Created new browsertools package in claudetool/browser
- Implemented tools for navigating, clicking, typing, waiting for elements,
getting text, evaluating JavaScript, taking screenshots, and scrolling
- Added lazy browser initialization that defers until first use
- Integrated with the agent to expose these tools to Claude
2. Screenshot handling and display:
- Implemented screenshot storage with UUID-based IDs in /tmp/sketch-screenshots
- Added endpoint to serve screenshots via /screenshot/{id}
- Created dedicated UI component for displaying screenshots
- Ensured proper responsive design with loading states and error handling
- Fixed URL paths for proper rehomed URL support
- Modified tool calls component to auto-expand screenshot results
3. Error handling and reliability:
- Added graceful error handling for browser initialization failures
- Implemented proper cleanup of browser resources
The browser automation tools provide a powerful way for Claude to interact with web content,
making it possible to scrape data, test web applications, and automate web-based tasks.
Co-Authored-By: sketch <hello@sketch.dev>
Sketch is an agentic coding tool focused on the Go programming language. Sketch runs in your terminal, has a web UI, understands your code, and helps you get work done. To keep your environment pristine, sketch starts a docker container and outputs its work onto a branch in your host git repository.
To get started:
go install sketch.dev/cmd/sketch@latest sketch
Currently sketch runs on macOS and linux. It uses docker for containers.
macOS: brew install colima (or an equivalent, like Docker Desktop or Orbstack) linux: apt install docker.io (or equivalent for your distro) WSL2: install Docker Desktop for Windows (docker entirely inside WSL2 is tricky)
The sketch.dev service is used to provide access to an LLM service and give you a way to access the web UI from anywhere.
We have a discord server to discuss sketch.
Join if you want! https://discord.gg/6w9qNRUDzS
See CONTRIBUTING.md
Sketch is open source. It is right here in this repository! Have a look around and mod away.
If you want to run sketch entirely without the sketch.dev service, you can set the flag -skaband-addr="" and then provide an ANTHROPIC_API_KEY environment variable. (More LLM services coming soon!)